diff options
Diffstat (limited to 'examples/design-system/apps')
| -rw-r--r-- | examples/design-system/apps/docs/.eslintrc.js | 4 | ||||
| -rw-r--r-- | examples/design-system/apps/docs/.storybook/main.js | 27 | ||||
| -rw-r--r-- | examples/design-system/apps/docs/package.json | 30 | ||||
| -rw-r--r-- | examples/design-system/apps/docs/stories/button.stories.mdx | 20 |
4 files changed, 81 insertions, 0 deletions
diff --git a/examples/design-system/apps/docs/.eslintrc.js b/examples/design-system/apps/docs/.eslintrc.js new file mode 100644 index 0000000..b2a3fa9 --- /dev/null +++ b/examples/design-system/apps/docs/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ["acme"], +}; diff --git a/examples/design-system/apps/docs/.storybook/main.js b/examples/design-system/apps/docs/.storybook/main.js new file mode 100644 index 0000000..13b0e8a --- /dev/null +++ b/examples/design-system/apps/docs/.storybook/main.js @@ -0,0 +1,27 @@ +const path = require("path"); + +module.exports = { + stories: ["../stories/**/*.stories.mdx", "../stories/**/*.stories.tsx"], + addons: ["@storybook/addon-links", "@storybook/addon-essentials"], + framework: "@storybook/react", + core: { + builder: "@storybook/builder-vite", + }, + async viteFinal(config, { configType }) { + // customize the Vite config here + return { + ...config, + resolve: { + alias: [ + { + find: "@acme/core", + replacement: path.resolve( + __dirname, + "../../../packages/acme-core/" + ), + }, + ], + }, + }; + }, +}; diff --git a/examples/design-system/apps/docs/package.json b/examples/design-system/apps/docs/package.json new file mode 100644 index 0000000..a400e33 --- /dev/null +++ b/examples/design-system/apps/docs/package.json @@ -0,0 +1,30 @@ +{ + "name": "@acme/docs", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "start-storybook -p 6006", + "build": "build-storybook --docs", + "preview-storybook": "serve storybook-static", + "clean": "rm -rf .turbo && rm -rf node_modules" + }, + "dependencies": { + "@acme/core": "workspace:0.0.0", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@acme/tsconfig": "workspace:0.0.0", + "@storybook/addon-actions": "^6.5.14", + "@storybook/addon-docs": "^6.5.14", + "@storybook/addon-essentials": "^6.5.14", + "@storybook/addon-links": "^6.5.14", + "@storybook/builder-vite": "^0.1.41", + "@storybook/react": "^6.5.14", + "@vitejs/plugin-react": "^1.3.2", + "eslint-config-acme": "workspace:0.0.0", + "serve": "^13.0.4", + "typescript": "^4.9.3", + "vite": "^2.9.15" + } +} diff --git a/examples/design-system/apps/docs/stories/button.stories.mdx b/examples/design-system/apps/docs/stories/button.stories.mdx new file mode 100644 index 0000000..810be71 --- /dev/null +++ b/examples/design-system/apps/docs/stories/button.stories.mdx @@ -0,0 +1,20 @@ +import { Button } from "@acme/core/src"; +import { Meta, Story, Canvas, ArgsTable } from "@storybook/addon-docs"; + +<Meta title="Components/Button" component={Button} /> + +# Button + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec euismod, nisl eget consectetur tempor, nisl nunc egestas nisi, euismod aliquam nisl nunc euismod. + +## Props + +<ArgsTable of={Button} /> + +## Examples + +<Canvas> + <Story name="Default"> + <Button>Hello</Button> + </Story> +</Canvas> |
