diff --git a/package.json b/package.json index 85dd0cb555..61e2c5e365 100644 --- a/package.json +++ b/package.json @@ -217,6 +217,6 @@ }, "lint-staged": { "*.{js,ts}": ["biome check --apply"], - "*.json": ["biome format --write"] + "*.json": ["biome format --write --no-errors-on-unmatched"] } } diff --git a/website/.storybook/main.js b/website/.storybook/main.js deleted file mode 100644 index a80e92f0a6..0000000000 --- a/website/.storybook/main.js +++ /dev/null @@ -1,134 +0,0 @@ -const AliasPlugin = require('enhanced-resolve/lib/AliasPlugin'); - -module.exports = { - stories: [ - '../src/**/*.stories.mdx', - '../src/**/*.stories.@(js|jsx|ts|tsx)', - ], - addons: [ - '@storybook/addon-links', - '@storybook/addon-essentials', - '@storybook/addon-interactions', - 'storybook-addon-root-attribute/register', - ], - framework: '@storybook/react', - staticDirs: [ - { - from: '../static', - to: '/', - }, - ], - webpackFinal: async (config) => { - const path = require('path'); - - const docusaurusPath = (...paths) => - path.resolve( - __dirname, - '../', - 'node_modules', - '@docusaurus', - ...paths, - ); - - config.resolve.plugins = [ - // add a "layered" approach to theme resolution that matches - // Docusaurus' theme resolution: - // https://docusaurus.io/docs/2.0.0-beta.17/advanced/client#theme-aliases - // - // First, check to see if the referenced component has - // been swizzled and exists in `../src/theme`. - // - // If it's not there, check the `theme-classic/lib-next/theme` directory in - // `node_modules`. - // - // Finally, if it's not found anywhere else, check the - // `theme-fallback` directory. - new AliasPlugin( - 'described-resolve', - [ - { - name: '@theme', - alias: [ - path.resolve(__dirname, '../', 'src', 'theme'), - docusaurusPath( - 'theme-classic', - 'lib-next', - 'theme', - ), - docusaurusPath( - 'core', - 'lib', - 'client', - 'theme-fallback', - ), - ], - }, - ], - 'resolve', - ), - ]; - - config.resolve.alias = { - ...config.resolve.alias, - '@site': path.resolve(__dirname, '../'), - '@docusaurus/theme-common': docusaurusPath( - 'theme-common', - 'src', - 'index.ts', - ), - '@docusaurus/utils-common': docusaurusPath('utils-common', 'lib'), - '@docusaurus/plugin-content-docs': docusaurusPath( - 'plugin-content-docs', - 'src', - ), - '@docusaurus': docusaurusPath('core', 'lib', 'client', 'exports'), - '@generated': path.resolve(__dirname, '../', '.docusaurus'), - }; - - let cssRules = []; - const rules = config.module.rules.map((rule) => { - if (rule.test.toString() === '/\\.css$/') { - cssRules.push(JSON.parse(JSON.stringify(rule))); - - return { - ...rule, - exclude: /\.module\.css$/, - }; - } else if (rule.test.toString() === '/\\.(mjs|tsx?|jsx?)$/') { - return { - ...rule, - // don't exclude docusaurus files - exclude: /node_modules\/(?!@docusaurus)/, - }; - } else return rule; - }); - - cssRules.forEach((r) => { - const moduleRule = { - ...r, - test: /\.module\.css$/, - use: r.use.map((use) => { - if ( - typeof use === 'object' && - use.loader.includes('/css-loader/') - ) { - use.options = { - ...use.options, - modules: true, - }; - } - return use; - }), - }; - rules.push(moduleRule); - }); - - return { - ...config, - module: { - ...config.module, - rules, - }, - }; - }, -}; diff --git a/website/.storybook/preview.js b/website/.storybook/preview.js deleted file mode 100644 index 194008022b..0000000000 --- a/website/.storybook/preview.js +++ /dev/null @@ -1,34 +0,0 @@ -import '../src/css/custom.css'; -import '../node_modules/infima/dist/css/default/default.css'; -import '../node_modules/@docusaurus/theme-classic/lib/admonitions.css'; -import { withRootAttribute } from 'storybook-addon-root-attribute'; - -export const parameters = { - actions: { argTypesRegex: '^on[A-Z].*' }, - controls: { - matchers: { - color: /(background|color)$/i, - date: /Date$/, - }, - }, - layout: 'fullscreen', - - // add docusaurus theming to storybook iframes - rootAttribute: { - root: 'html', - attribute: 'data-theme', - defaultState: { - name: 'Light', - value: 'light', - }, - states: [ - { - name: 'Dark', - value: 'dark', - }, - ], - tooltip: true, - }, -}; - -export const decorators = [withRootAttribute]; diff --git a/website/package.json b/website/package.json index c289fe7534..572f2a760d 100644 --- a/website/package.json +++ b/website/package.json @@ -15,9 +15,7 @@ "clear": "docusaurus clear", "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", - "write-heading-ids": "docusaurus write-heading-ids", - "storybook": "start-storybook -p 6006", - "build-storybook": "build-storybook" + "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { "@docusaurus/core": "2.3.1", @@ -72,18 +70,11 @@ "devDependencies": { "@babel/core": "7.23.0", "@docusaurus/module-type-aliases": "2.3.1", - "@storybook/addon-actions": "6.5.16", - "@storybook/addon-essentials": "6.5.16", - "@storybook/addon-interactions": "6.5.16", - "@storybook/addon-links": "6.5.16", - "@storybook/react": "6.5.16", - "@storybook/testing-library": "0.2.2", "@tsconfig/docusaurus": "2.0.1", "babel-loader": "9.1.3", "enhanced-resolve": "5.15.0", "react-router": "6.16.0", "replace-in-file": "7.0.1", - "storybook-addon-root-attribute": "1.0.2", "typescript": "4.8.4" } } diff --git a/website/src/stories/Button.jsx b/website/src/stories/Button.jsx deleted file mode 100644 index 15dde39209..0000000000 --- a/website/src/stories/Button.jsx +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './button.css'; - -/** - * Primary UI component for user interaction - */ -export const Button = ({ primary, backgroundColor, size, label, ...props }) => { - const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary'; - return ( - - ); -}; - -Button.propTypes = { - /** - * Is this the principal call to action on the page? - */ - primary: PropTypes.bool, - /** - * What background color to use - */ - backgroundColor: PropTypes.string, - /** - * How large should the button be? - */ - size: PropTypes.oneOf(['small', 'medium', 'large']), - /** - * Button contents - */ - label: PropTypes.string.isRequired, - /** - * Optional click handler - */ - onClick: PropTypes.func, -}; - -Button.defaultProps = { - backgroundColor: null, - primary: false, - size: 'medium', - onClick: undefined, -}; diff --git a/website/src/stories/Button.stories.jsx b/website/src/stories/Button.stories.jsx deleted file mode 100644 index 61f6e19e14..0000000000 --- a/website/src/stories/Button.stories.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import React from 'react'; - -import { Button } from './Button'; - -// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export -export default { - title: 'Example/Button', - component: Button, - // More on argTypes: https://storybook.js.org/docs/react/api/argtypes - argTypes: { - backgroundColor: { control: 'color' }, - }, -}; - -// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args -const Template = (args) =>