diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/storybook/.storybook/main.ts | 34 | ||||
-rw-r--r-- | apps/storybook/.storybook/preview-head.html | 3 | ||||
-rw-r--r-- | apps/storybook/.storybook/preview.ts | 17 | ||||
-rw-r--r-- | apps/storybook/index.html | 13 | ||||
-rw-r--r-- | apps/storybook/package.json | 36 | ||||
-rw-r--r-- | apps/storybook/postcss.config.js | 10 | ||||
-rw-r--r-- | apps/storybook/public/vite.svg | 1 | ||||
-rw-r--r-- | apps/storybook/tailwind.config.js | 2 | ||||
-rw-r--r-- | apps/storybook/tsconfig.json | 19 |
9 files changed, 135 insertions, 0 deletions
diff --git a/apps/storybook/.storybook/main.ts b/apps/storybook/.storybook/main.ts new file mode 100644 index 0000000..9a50fb5 --- /dev/null +++ b/apps/storybook/.storybook/main.ts @@ -0,0 +1,34 @@ +import type { StorybookConfig } from '@storybook/react-vite'; + +const config: StorybookConfig = { + stories: [ + { + directory: '../../../packages/ui/src/**', + titlePrefix: 'UI', + files: '*.stories.*' + }, + { + directory: '../../../interface/app/**', + titlePrefix: 'Interface', + files: '*.stories.*' + } + ], + addons: [ + '@storybook/addon-links', + '@storybook/addon-essentials', + '@storybook/addon-interactions', + '@storybook/addon-styling' + ], + framework: { + name: '@storybook/react-vite', + options: {} + }, + docs: { + autodocs: 'tag' + }, + core: { + disableTelemetry: true + } +}; + +export default config; diff --git a/apps/storybook/.storybook/preview-head.html b/apps/storybook/.storybook/preview-head.html new file mode 100644 index 0000000..b617b7b --- /dev/null +++ b/apps/storybook/.storybook/preview-head.html @@ -0,0 +1,3 @@ +<script> + window.global = window; +</script> diff --git a/apps/storybook/.storybook/preview.ts b/apps/storybook/.storybook/preview.ts new file mode 100644 index 0000000..1c3d344 --- /dev/null +++ b/apps/storybook/.storybook/preview.ts @@ -0,0 +1,17 @@ +import type { Preview } from '@storybook/react'; + +import '@polyfrost/ui/style'; + +const preview: Preview = { + parameters: { + actions: { argTypesRegex: '^on[A-Z].*' }, + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/ + } + } + } +}; + +export default preview; diff --git a/apps/storybook/index.html b/apps/storybook/index.html new file mode 100644 index 0000000..abcdd48 --- /dev/null +++ b/apps/storybook/index.html @@ -0,0 +1,13 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <link rel="icon" type="image/svg+xml" href="/vite.svg" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Nexus Storybook</title> + </head> + <body> + <div id="root"></div> + <script type="module" src="/src/main.tsx"></script> + </body> +</html> diff --git a/apps/storybook/package.json b/apps/storybook/package.json new file mode 100644 index 0000000..1282477 --- /dev/null +++ b/apps/storybook/package.json @@ -0,0 +1,36 @@ +{ + "name": "@polyfrost/storybook", + "private": true, + "scripts": { + "dev": "storybook dev -p 6006 --no-open", + "build-storybook": "storybook build --no-open" + }, + "dependencies": { + "@storybook/addon-essentials": "^7.4.6", + "@storybook/addon-interactions": "^7.4.6", + "@storybook/addon-links": "^7.4.6", + "@storybook/addon-styling": "^1.3.7", + "@storybook/blocks": "^7.4.6", + "@storybook/react": "^7.4.6", + "@storybook/react-vite": "^7.4.6", + "@storybook/testing-library": "^0.2.2", + "postcss-pseudo-companion-classes": "^0.1.1", + "sass": "^1.69.3", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@polyfrost/config": "workspace:*", + "@polyfrost/ui": "workspace:*", + "@types/react": "^18.2.28", + "@types/react-dom": "^18.2.13", + "@vitejs/plugin-react": "^4.1.0", + "autoprefixer": "^10.4.16", + "postcss": "^8.4.31", + "prop-types": "^15.8.1", + "storybook": "^7.4.6", + "tailwindcss": "^3.3.3", + "typescript": "^5.2.2", + "vite": "^4.4.11" + } +} diff --git a/apps/storybook/postcss.config.js b/apps/storybook/postcss.config.js new file mode 100644 index 0000000..de27714 --- /dev/null +++ b/apps/storybook/postcss.config.js @@ -0,0 +1,10 @@ +module.exports = { + plugins: { + 'tailwindcss': {}, + 'autoprefixer': {}, + 'postcss-pseudo-companion-classes': { + prefix: 'sb-pseudo--', + restrictTo: [':hover', ':focus'] + } + } +}; diff --git a/apps/storybook/public/vite.svg b/apps/storybook/public/vite.svg new file mode 100644 index 0000000..ee9fada --- /dev/null +++ b/apps/storybook/public/vite.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg> diff --git a/apps/storybook/tailwind.config.js b/apps/storybook/tailwind.config.js new file mode 100644 index 0000000..595a567 --- /dev/null +++ b/apps/storybook/tailwind.config.js @@ -0,0 +1,2 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = require('@polyfrost/ui/tailwind')('web'); diff --git a/apps/storybook/tsconfig.json b/apps/storybook/tsconfig.json new file mode 100644 index 0000000..da3cfcc --- /dev/null +++ b/apps/storybook/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "Node", + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "useDefineForClassFields": true, + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx" + } +} |