Skip to content

Commit

Permalink
feat: icon component
Browse files Browse the repository at this point in the history
* feat: icon component boilerplate is created

* chore(storybook): use dist build directly in storybook ui

* feat: icon component implemented

* fix: firefox sometimes fails with concurrent tests

* chore: build script refactored

* chore: dependencies are updated

* chore(design): linter fixes

Co-authored-by: Murat Çorlu <[email protected]>
  • Loading branch information
muratcorlu and muratcorlu authored May 26, 2022
1 parent a82bc24 commit ae69926
Show file tree
Hide file tree
Showing 27 changed files with 462 additions and 101 deletions.
19 changes: 3 additions & 16 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,30 1,17 @@
const path = require('path');

module.exports = {
logLevel: 'debug',
stories: [
'../*.md',
'../docs/**/*.stories.mdx',
'../src/**/*.stories.@(js|jsx|ts|tsx|mdx)',
],
stories: ['../*.md', '../docs/**/*.stories.mdx', '../src/**/*.stories.mdx'],
addons: [
'@storybook/addon-links',
'@storybook/addon-docs',
'@storybook/addon-essentials',
'@storybook/addon-a11y',
'@storybook/addon-docs',
],
features: {
postcss: false,
interactionsDebugger: true,
buildStoriesJson: true,
},
framework: '@storybook/web-components',
webpackFinal: async config => {
const gracePath = path.join(__dirname, '..', 'dist');
config.resolve.alias['@trendyol-js/grace'] = path.resolve(
gracePath,
'grace.js'
);
return config;
},
staticDirs: ['../dist'],
};
2 changes: 2 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 1,2 @@
<link rel="stylesheet" href="/themes/default.css" />
<script type="module" src="/grace.js"></script>
1 change: 0 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 1,5 @@
import { setCustomElementsManifest } from '@storybook/web-components';
import customElements from '../src/custom-elements.json';
import '../dist/themes/default.css';

setCustomElementsManifest(customElements);

Expand Down
20 changes: 15 additions & 5 deletions docs/design-system/iconography.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,11 1,21 @@
import { Meta, Title, IconGallery, IconItem } from '@storybook/addon-docs/';
import { Meta, Title, IconGallery, IconItem } from '@storybook/addon-docs';

<Meta title="Design System/Iconography" />
<Meta
title="Design System/Iconography"
parameters={{
viewMode: 'docs',
previewTabs: {
canvas: {
hidden: true,
},
},
}}
/>

# Iconography

<IconGallery>
<IconItem name="mobile">
<p>Test</p>
<IconItem name="info">
<gr-icon name="info"></gr-icon>
</IconItem>
</IconGallery>
</IconGallery>
2 changes: 1 addition & 1 deletion docs/design-system/typography.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,4 1,4 @@
import { Meta, Typeset } from '@storybook/addon-docs/blocks';
import { Meta, Typeset } from '@storybook/addon-docs';

<Meta
title="Design System/Typography"
Expand Down
85 changes: 66 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 5,7 @@
"main": "dist/grace.js",
"module": "dist/grace.js",
"files": [
"dist/",
".prettierrc.json",
".eslintrc.json"
"dist/"
],
"author": {
"name": "Trendyol Tech",
Expand All @@ -23,7 21,7 @@
"prep:custom-elements": "wca analyze 'src/components/**/!(*.test).ts' --format json --outFile ./src/custom-elements.json",
"prebuild": "npm run prep",
"build": "node scripts/build.js",
"preserve": "npm run prep",
"build:dev": "node scripts/build.js",
"serve": "node scripts/build.js --serve",
"storybook:axe:prod": "npm run storybook:prod && npm run axe-storybook --build-dir=storybook-static/",
"storybook:axe:dev": "npm-run-all -s storybook:axe:dev:chromium storybook:axe:dev:firefox",
Expand Down Expand Up @@ -90,6 88,7 @@
"@web/test-runner-playwright": "^0.8.6",
"@webcomponents/webcomponentsjs": "^2.5.0",
"chromatic": "^6.5.4",
"del": "^6.1.0",
"esbuild": "^0.14.39",
"esbuild-plugin-lit-css": "^2.0.0",
"eslint": "^8.12.0",
Expand Down
Loading

0 comments on commit ae69926

Please sign in to comment.