diff --git a/.storybook/main.js b/.storybook/main.js index 7bad229..299456e 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -1,8 +1,19 @@ module.exports = { - "stories": ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], - "addons": ["@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions"], - "framework": "@storybook/react", + stories: [ + "../src/client/stories/*.stories.mdx", + "../src/client/stories/*.stories.@(js|jsx|ts|tsx)", + ], + staticDirs: [ + "../src/client/stories/assets" + ], + addons: [ + "@storybook/addon-links", + "@storybook/preset-scss", + "@storybook/addon-essentials", + "@storybook/addon-interactions", + ], + framework: "@storybook/react", core: { - builder: "webpack5" - } -}; \ No newline at end of file + builder: "webpack5", + }, +}; diff --git a/package.json b/package.json index 0a0a1c7..fff8f1d 100644 --- a/package.json +++ b/package.json @@ -115,6 +115,7 @@ "@storybook/builder-webpack5": "^6.5.9", "@storybook/manager-webpack4": "^6.5.9", "@storybook/manager-webpack5": "^6.5.9", + "@storybook/preset-scss": "^1.0.3", "@storybook/react": "^6.5.9", "@storybook/testing-library": "^0.0.13", "@teamsupercell/typings-for-css-modules-loader": "^2.5.1", diff --git a/src/client/stories/Vertical.stories.tsx b/src/client/stories/Vertical.stories.tsx new file mode 100644 index 0000000..9e9658b --- /dev/null +++ b/src/client/stories/Vertical.stories.tsx @@ -0,0 +1,27 @@ +// Button.stories.ts|tsx + +import React from 'react'; + +import { ComponentMeta, ComponentStory } from '@storybook/react'; + +import { Card } from '../components/Carda'; +import "../assets/scss/App.scss"; +export default { + /* ๐Ÿ‘‡ The title prop is optional. + * See https://storybook.js.org/docs/react/configure/overview#configure-story-loading + * to learn how to generate automatic titles + */ + title: 'Card', + component: Card, +} as ComponentMeta; + +//๐Ÿ‘‡ We create a โ€œtemplateโ€ of how args map to rendering +const Template = (args) => ; +//๐Ÿ‘‡ Each story then reuses that template +export const Vertical = Template.bind({}); +Vertical.args = { + orientation: 'vertical', + hasDetails: true, + children:
details
, + imageUrl: "/wotr.jpg", +} diff --git a/src/client/stories/assets/code-brackets.svg b/src/client/stories/assets/code-brackets.svg new file mode 100644 index 0000000..73de947 --- /dev/null +++ b/src/client/stories/assets/code-brackets.svg @@ -0,0 +1 @@ +illustration/code-brackets \ No newline at end of file diff --git a/src/client/stories/assets/colors.svg b/src/client/stories/assets/colors.svg new file mode 100644 index 0000000..17d58d5 --- /dev/null +++ b/src/client/stories/assets/colors.svg @@ -0,0 +1 @@ +illustration/colors \ No newline at end of file diff --git a/src/client/stories/assets/comments.svg b/src/client/stories/assets/comments.svg new file mode 100644 index 0000000..6493a13 --- /dev/null +++ b/src/client/stories/assets/comments.svg @@ -0,0 +1 @@ +illustration/comments \ No newline at end of file diff --git a/src/client/stories/assets/direction.svg b/src/client/stories/assets/direction.svg new file mode 100644 index 0000000..65676ac --- /dev/null +++ b/src/client/stories/assets/direction.svg @@ -0,0 +1 @@ +illustration/direction \ No newline at end of file diff --git a/src/client/stories/assets/flow.svg b/src/client/stories/assets/flow.svg new file mode 100644 index 0000000..8ac27db --- /dev/null +++ b/src/client/stories/assets/flow.svg @@ -0,0 +1 @@ +illustration/flow \ No newline at end of file diff --git a/src/client/stories/assets/plugin.svg b/src/client/stories/assets/plugin.svg new file mode 100644 index 0000000..29e5c69 --- /dev/null +++ b/src/client/stories/assets/plugin.svg @@ -0,0 +1 @@ +illustration/plugin \ No newline at end of file diff --git a/src/client/stories/assets/repo.svg b/src/client/stories/assets/repo.svg new file mode 100644 index 0000000..f386ee9 --- /dev/null +++ b/src/client/stories/assets/repo.svg @@ -0,0 +1 @@ +illustration/repo \ No newline at end of file diff --git a/src/client/stories/assets/stackalt.svg b/src/client/stories/assets/stackalt.svg new file mode 100644 index 0000000..9b7ad27 --- /dev/null +++ b/src/client/stories/assets/stackalt.svg @@ -0,0 +1 @@ +illustration/stackalt \ No newline at end of file diff --git a/src/client/stories/assets/wotr.jpg b/src/client/stories/assets/wotr.jpg new file mode 100644 index 0000000..07d2f2a Binary files /dev/null and b/src/client/stories/assets/wotr.jpg differ diff --git a/yarn.lock b/yarn.lock index 76c1510..071f9f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3465,6 +3465,11 @@ dependencies: core-js "^3.8.2" +"@storybook/preset-scss@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@storybook/preset-scss/-/preset-scss-1.0.3.tgz#8ac834545c642dada0f64f510ef08dfb882e9737" + integrity sha512-o9Iz6wxPeNENrQa2mKlsDKynBfqU2uWaRP80HeWp4TkGgf7/x3DVF2O7yi9N0x/PI1qzzTTpxlQ90D62XmpiTw== + "@storybook/preview-web@6.5.9": version "6.5.9" resolved "https://registry.yarnpkg.com/@storybook/preview-web/-/preview-web-6.5.9.tgz#557d919e6df50d66259521aa36ebf4055bbd236e"