@ilo-org/react 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +36 -0
- package/.storybook/main.js +28 -0
- package/.storybook/manager-head.html +7 -0
- package/.storybook/manager.js +6 -0
- package/.storybook/preview.tsx +33 -0
- package/.storybook/styles.scss +1 -0
- package/.storybook/theme.js +11 -0
- package/.turbo/turbo-build.log +513 -0
- package/.turbo/turbo-check.log +5 -0
- package/.turbo/turbo-test.log +1676 -0
- package/=6.4.0 +115 -0
- package/=7.21.4 +21 -0
- package/LICENSE +201 -0
- package/README.md +11 -0
- package/lib/index.esm.js +24 -0
- package/lib/index.esm.js.map +1 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/package.json +115 -0
- package/rollup.config.js +40 -0
- package/src/__tests__/Accordion.test.tsx +52 -0
- package/src/__tests__/Button.test.tsx +60 -0
- package/src/__tests__/Callout.test.tsx +41 -0
- package/src/__tests__/ContextMenu.test.tsx +19 -0
- package/src/__tests__/Dropdown.test.tsx +38 -0
- package/src/__tests__/Form.test.tsx +34 -0
- package/src/__tests__/Heading.test.tsx +51 -0
- package/src/__tests__/Hero.test.tsx +22 -0
- package/src/__tests__/Image.test.tsx +21 -0
- package/src/__tests__/LinkList.test.tsx +17 -0
- package/src/__tests__/List.test.tsx +37 -0
- package/src/__tests__/Loading.text.tsx +33 -0
- package/src/__tests__/Notification.test.tsx +39 -0
- package/src/__tests__/Pagination.test.tsx +58 -0
- package/src/__tests__/Profile.test.tsx +48 -0
- package/src/__tests__/ReadMore.test.tsx +42 -0
- package/src/__tests__/RichText.test.tsx +16 -0
- package/src/__tests__/SearchField.test.tsx +35 -0
- package/src/__tests__/TableOfContents.test.tsx +12 -0
- package/src/__tests__/Tag.test.tsx +10 -0
- package/src/components/Accordion/Accordion.args.ts +19 -0
- package/src/components/Accordion/Accordion.props.d.ts +39 -0
- package/src/components/Accordion/Accordion.tsx +70 -0
- package/src/components/Accordion/AccordionButton.props.d.ts +13 -0
- package/src/components/Accordion/AccordionButton.tsx +60 -0
- package/src/components/Accordion/AccordionItem.props.d.ts +25 -0
- package/src/components/Accordion/AccordionItem.tsx +33 -0
- package/src/components/Accordion/AccordionPanel.props.d.ts +20 -0
- package/src/components/Accordion/AccordionPanel.tsx +47 -0
- package/src/components/Accordion/index.ts +4 -0
- package/src/components/Button/Button.args.ts +353 -0
- package/src/components/Button/Button.props.d.ts +74 -0
- package/src/components/Button/Button.tsx +67 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Callout/Callout.args.ts +64 -0
- package/src/components/Callout/Callout.props.d.ts +61 -0
- package/src/components/Callout/Callout.tsx +80 -0
- package/src/components/Callout/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.args.ts +22 -0
- package/src/components/Checkbox/Checkbox.props.d.ts +61 -0
- package/src/components/Checkbox/Checkbox.tsx +92 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/ChoiceGroup/ChoiceGroup.args.ts +90 -0
- package/src/components/ChoiceGroup/ChoiceGroup.props.d.ts +57 -0
- package/src/components/ChoiceGroup/ChoiceGroup.tsx +42 -0
- package/src/components/ChoiceGroup/index.ts +1 -0
- package/src/components/Collapse/Collapse.props.d.ts +92 -0
- package/src/components/Collapse/Collapse.tsx +130 -0
- package/src/components/Collapse/index.ts +1 -0
- package/src/components/ContextMenu/ContextMenu.args.ts +62 -0
- package/src/components/ContextMenu/ContextMenu.props.d.ts +28 -0
- package/src/components/ContextMenu/ContextMenu.tsx +32 -0
- package/src/components/ContextMenu/index.ts +1 -0
- package/src/components/Credit/Credit.args.ts +14 -0
- package/src/components/Credit/Credit.props.d.ts +11 -0
- package/src/components/Credit/Credit.tsx +41 -0
- package/src/components/Credit/index.ts +1 -0
- package/src/components/DatePicker/DatePicker.args.ts +82 -0
- package/src/components/DatePicker/DatePicker.props.d.ts +68 -0
- package/src/components/DatePicker/DatePicker.tsx +119 -0
- package/src/components/DatePicker/index.ts +1 -0
- package/src/components/Dropdown/Dropdown.args.ts +220 -0
- package/src/components/Dropdown/Dropdown.props.d.ts +84 -0
- package/src/components/Dropdown/Dropdown.tsx +82 -0
- package/src/components/Dropdown/index.ts +1 -0
- package/src/components/Empty/Empty.args.ts +14 -0
- package/src/components/Empty/Empty.props.d.ts +6 -0
- package/src/components/Empty/Empty.tsx +16 -0
- package/src/components/Empty/index.ts +1 -0
- package/src/components/Fieldset/Fieldset.props.d.ts +36 -0
- package/src/components/Fieldset/Fieldset.tsx +90 -0
- package/src/components/Fieldset/index.ts +1 -0
- package/src/components/FileUpload/FileUpload.args.ts +62 -0
- package/src/components/FileUpload/FileUpload.props.d.ts +63 -0
- package/src/components/FileUpload/FileUpload.tsx +82 -0
- package/src/components/FileUpload/index.ts +1 -0
- package/src/components/Form/Form.args.ts +265 -0
- package/src/components/Form/Form.props.d.ts +84 -0
- package/src/components/Form/Form.tsx +83 -0
- package/src/components/Form/index.ts +1 -0
- package/src/components/FormElement/FormElement.props.d.ts +53 -0
- package/src/components/FormElement/FormElement.tsx +26 -0
- package/src/components/FormElement/index.ts +1 -0
- package/src/components/FormGroup/FormGroup.args.ts +84 -0
- package/src/components/FormGroup/FormGroup.props.d.ts +71 -0
- package/src/components/FormGroup/FormGroup.tsx +73 -0
- package/src/components/FormGroup/index.ts +1 -0
- package/src/components/GlobalProvider/GlobalProvider.props.d.ts +15 -0
- package/src/components/GlobalProvider/GlobalProvider.tsx +27 -0
- package/src/components/GlobalProvider/index.js +4 -0
- package/src/components/Heading/Heading.args.ts +46 -0
- package/src/components/Heading/Heading.props.d.ts +24 -0
- package/src/components/Heading/Heading.tsx +28 -0
- package/src/components/Heading/index.ts +1 -0
- package/src/components/Hero/Hero.args.ts +296 -0
- package/src/components/Hero/Hero.props.d.ts +29 -0
- package/src/components/Hero/Hero.tsx +35 -0
- package/src/components/Hero/HeroCard.props.d.ts +65 -0
- package/src/components/Hero/HeroCard.tsx +53 -0
- package/src/components/Hero/index.ts +2 -0
- package/src/components/Icon/Icon.args.ts +15 -0
- package/src/components/Icon/Icon.props.d.ts +16 -0
- package/src/components/Icon/Icon.tsx +25 -0
- package/src/components/Icon/index.ts +1 -0
- package/src/components/Image/Image.args.ts +35 -0
- package/src/components/Image/Image.props.d.ts +38 -0
- package/src/components/Image/Image.tsx +51 -0
- package/src/components/Image/index.ts +1 -0
- package/src/components/Input/Input.args.ts +139 -0
- package/src/components/Input/Input.props.d.ts +63 -0
- package/src/components/Input/Input.tsx +63 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/Link/Link.args.ts +36 -0
- package/src/components/Link/Link.props.d.ts +34 -0
- package/src/components/Link/Link.tsx +49 -0
- package/src/components/Link/index.ts +1 -0
- package/src/components/LinkList/LinkList.args.ts +193 -0
- package/src/components/LinkList/LinkList.props.d.ts +52 -0
- package/src/components/LinkList/LinkList.tsx +59 -0
- package/src/components/LinkList/index.ts +1 -0
- package/src/components/List/List.args.ts +38 -0
- package/src/components/List/List.props.d.ts +36 -0
- package/src/components/List/List.tsx +47 -0
- package/src/components/List/ListItem.props.d.ts +25 -0
- package/src/components/List/ListItem.tsx +23 -0
- package/src/components/List/index.ts +2 -0
- package/src/components/Loading/Loading.args.ts +55 -0
- package/src/components/Loading/Loading.props.d.ts +23 -0
- package/src/components/Loading/Loading.tsx +24 -0
- package/src/components/Loading/index.ts +1 -0
- package/src/components/Notification/Notification.args.ts +157 -0
- package/src/components/Notification/Notification.props.d.ts +67 -0
- package/src/components/Notification/Notification.tsx +78 -0
- package/src/components/Notification/index.ts +1 -0
- package/src/components/NumberPicker/NumberPicker.args.ts +58 -0
- package/src/components/NumberPicker/NumberPicker.props.d.ts +56 -0
- package/src/components/NumberPicker/NumberPicker.tsx +65 -0
- package/src/components/NumberPicker/index.ts +1 -0
- package/src/components/Pagination/Pagination.args.ts +43 -0
- package/src/components/Pagination/Pagination.props.d.ts +66 -0
- package/src/components/Pagination/Pagination.tsx +114 -0
- package/src/components/Pagination/index.ts +1 -0
- package/src/components/Profile/Profile.args.ts +58 -0
- package/src/components/Profile/Profile.props.d.ts +43 -0
- package/src/components/Profile/Profile.tsx +43 -0
- package/src/components/Profile/index.ts +1 -0
- package/src/components/Radio/Radio.args.ts +22 -0
- package/src/components/Radio/Radio.props.d.ts +61 -0
- package/src/components/Radio/Radio.tsx +64 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/ReadMore/ReadMore.props.d.ts +38 -0
- package/src/components/ReadMore/ReadMore.tsx +55 -0
- package/src/components/ReadMore/index.ts +1 -0
- package/src/components/ReadMore/readMore.args.ts +35 -0
- package/src/components/RichText/RichText.props.d.ts +11 -0
- package/src/components/RichText/RichText.tsx +22 -0
- package/src/components/RichText/index.ts +1 -0
- package/src/components/RichText/richText.args.ts +15 -0
- package/src/components/SearchField/SearchField.args.ts +73 -0
- package/src/components/SearchField/SearchField.props.d.ts +35 -0
- package/src/components/SearchField/SearchField.tsx +55 -0
- package/src/components/SearchField/index.ts +1 -0
- package/src/components/TableOfContents/TableOfContents.args.ts +35 -0
- package/src/components/TableOfContents/TableOfContents.props.d.ts +23 -0
- package/src/components/TableOfContents/TableOfContents.tsx +32 -0
- package/src/components/TableOfContents/index.ts +1 -0
- package/src/components/Tag/Tag.args.ts +15 -0
- package/src/components/Tag/Tag.props.d.ts +34 -0
- package/src/components/Tag/Tag.tsx +99 -0
- package/src/components/Tag/TagSet.args.ts +39 -0
- package/src/components/Tag/TagSet.props.d.ts +36 -0
- package/src/components/Tag/TagSet.tsx +71 -0
- package/src/components/Tag/index.ts +2 -0
- package/src/components/Textarea/Textarea.args.ts +62 -0
- package/src/components/Textarea/Textarea.props.d.ts +71 -0
- package/src/components/Textarea/Textarea.tsx +67 -0
- package/src/components/Textarea/index.ts +1 -0
- package/src/components/Tooltip/Tooltip.args.ts +43 -0
- package/src/components/Tooltip/Tooltip.props.d.ts +48 -0
- package/src/components/Tooltip/Tooltip.tsx +139 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/Video/Video.args.ts +81 -0
- package/src/components/Video/Video.props.d.ts +82 -0
- package/src/components/Video/Video.tsx +29 -0
- package/src/components/Video/VideoPlayer.props.d.ts +80 -0
- package/src/components/Video/VideoPlayer.tsx +285 -0
- package/src/components/Video/index.ts +1 -0
- package/src/hooks/useGlobalSettings.ts +13 -0
- package/src/hooks/useVideoPlayer.ts +85 -0
- package/src/index.ts +19 -0
- package/src/public/favicon.ico +0 -0
- package/src/public/index.html +43 -0
- package/src/public/logo192.png +0 -0
- package/src/public/logo512.png +0 -0
- package/src/public/manifest.json +25 -0
- package/src/public/robots.txt +3 -0
- package/src/setup.ts +6 -0
- package/src/stories/Accordion.stories.tsx +94 -0
- package/src/stories/Button.stories.tsx +491 -0
- package/src/stories/Callout.stories.tsx +154 -0
- package/src/stories/ContextMenu.stories.tsx +72 -0
- package/src/stories/Dropdown.stories.tsx +85 -0
- package/src/stories/Empty.stories.tsx +48 -0
- package/src/stories/Form.stories.tsx +67 -0
- package/src/stories/Heading.stories.tsx +191 -0
- package/src/stories/Hero.stories.tsx +129 -0
- package/src/stories/Image.stories.tsx +71 -0
- package/src/stories/Introduction.stories.mdx +12 -0
- package/src/stories/Link.stories.tsx +99 -0
- package/src/stories/LinkList.stories.tsx +68 -0
- package/src/stories/List.stories.tsx +246 -0
- package/src/stories/Loading.stories.tsx +103 -0
- package/src/stories/Notification.stories.tsx +154 -0
- package/src/stories/Pagination.stories.tsx +63 -0
- package/src/stories/Profile.stories.tsx +84 -0
- package/src/stories/ReadMore.stories.tsx +80 -0
- package/src/stories/RichText.stories.tsx +59 -0
- package/src/stories/SearchField.stories.tsx +87 -0
- package/src/stories/TableOfContents.stories.tsx +50 -0
- package/src/stories/Tag.stories.tsx +194 -0
- package/src/stories/Tooltip.stories.tsx +83 -0
- package/src/stories/Video.stories.tsx +69 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/stories/assets/stackalt.svg +1 -0
- package/src/types/index.ts +49 -0
- package/src/types/temp.d.ts +9 -0
- package/src/utils/checkArrayDuplicates.ts +3 -0
- package/src/utils/createChainedFunction.ts +31 -0
- package/src/utils/getDefaultDimensionValue.ts +28 -0
- package/src/utils/hoursMinutesSeconds.ts +8 -0
- package/src/utils/transitionEndListener.ts +29 -0
- package/src/utils/triggerBrowserReflow.ts +4 -0
- package/storybook-static/0.f9bb25299a048d2bb825.manager.bundle.js +2 -0
- package/storybook-static/0.f9bb25299a048d2bb825.manager.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/01daf23af61cc99e9d75.woff2 +0 -0
- package/storybook-static/06a2da828c8b6497ba7a.woff +0 -0
- package/storybook-static/0fa24adac56865ac7e5f.ttf +0 -0
- package/storybook-static/12ec02e7e66abaf38243.eot +0 -0
- package/storybook-static/164.8f6e5926.iframe.bundle.js +2 -0
- package/storybook-static/164.8f6e5926.iframe.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/181.1d6d475b.iframe.bundle.js +1 -0
- package/storybook-static/1cc3364249fd0db446ad.ttf +0 -0
- package/storybook-static/1dbed2ef5cef8fcb4cbe.ttf +0 -0
- package/storybook-static/1fa1c16a4a45d13f0df8.ttf +0 -0
- package/storybook-static/23cdaa8575b5e003dcde.eot +0 -0
- package/storybook-static/248db78ddf1e3568728d.woff +0 -0
- package/storybook-static/27d33755a2b827666dc5.woff +0 -0
- package/storybook-static/29.8e0bc9a8.iframe.bundle.js +2 -0
- package/storybook-static/29.8e0bc9a8.iframe.bundle.js.LICENSE.txt +102 -0
- package/storybook-static/2ac1a95228cf06e17040.woff2 +0 -0
- package/storybook-static/337.b8defe66.iframe.bundle.js +2 -0
- package/storybook-static/337.b8defe66.iframe.bundle.js.LICENSE.txt +11 -0
- package/storybook-static/3579203659b1428de036.eot +0 -0
- package/storybook-static/36229f80a738c199462d.woff2 +0 -0
- package/storybook-static/409a9c398a28ee4d74ff.eot +0 -0
- package/storybook-static/431.8ab7c276.iframe.bundle.js +1 -0
- package/storybook-static/431.b32fed6077acc140df7c.manager.bundle.js +1 -0
- package/storybook-static/4bf5fc6f93ba10519c82.eot +0 -0
- package/storybook-static/51d7da3f5e58e3a24a84.woff +0 -0
- package/storybook-static/697.1f42ad69d33c2733c631.manager.bundle.js +1 -0
- package/storybook-static/697.9e56beef.iframe.bundle.js +1 -0
- package/storybook-static/6a159f0a2005668f1f78.woff +0 -0
- package/storybook-static/6f781753b674130d947a.ttf +0 -0
- package/storybook-static/70a240717e773fe567b3.woff2 +0 -0
- package/storybook-static/720.f44d4e1f5203b6083ae4.manager.bundle.js +1 -0
- package/storybook-static/730.1240c246.iframe.bundle.js +1 -0
- package/storybook-static/730.7223b772132e3e068755.manager.bundle.js +1 -0
- package/storybook-static/73ba1c910e0f7bfc6b18.woff2 +0 -0
- package/storybook-static/88739612501023fa15e3.woff +0 -0
- package/storybook-static/8a142c29a318c432117a.woff +0 -0
- package/storybook-static/914.8ddb80ae2badda1468b0.manager.bundle.js +2 -0
- package/storybook-static/914.8ddb80ae2badda1468b0.manager.bundle.js.LICENSE.txt +94 -0
- package/storybook-static/978.236a5d9d5736517b960e.manager.bundle.js +2 -0
- package/storybook-static/978.236a5d9d5736517b960e.manager.bundle.js.LICENSE.txt +12 -0
- package/storybook-static/978.32e8032b.iframe.bundle.js +2 -0
- package/storybook-static/978.32e8032b.iframe.bundle.js.LICENSE.txt +12 -0
- package/storybook-static/9db5d05810cb98f2831f.ttf +0 -0
- package/storybook-static/9ff97e342523931a4992.eot +0 -0
- package/storybook-static/a40d436619020fb67db5.woff +0 -0
- package/storybook-static/a41d7e330757fb4b2125.woff2 +0 -0
- package/storybook-static/ab3494afe25b712485ed.woff +0 -0
- package/storybook-static/b53d0e74edc5a5fbef0a.ttf +0 -0
- package/storybook-static/b70a9c0ad8e8b43f5e6c.ttf +0 -0
- package/storybook-static/c12a83f816844ff94375.ttf +0 -0
- package/storybook-static/c5116d16544f932eba4b.eot +0 -0
- package/storybook-static/c807e115c00aaffbac11.woff2 +0 -0
- package/storybook-static/cadb6b94d6b0ecc3a86a.woff2 +0 -0
- package/storybook-static/d0cff1b064bcd84324fe.eot +0 -0
- package/storybook-static/d3434771ad7e9030387e.ttf +0 -0
- package/storybook-static/d8610c2a4fe5c177f4f6.woff +0 -0
- package/storybook-static/d970f426740b938f39e1.woff +0 -0
- package/storybook-static/d9c7eba773ff1c8df5bb.eot +0 -0
- package/storybook-static/dd4645bdb2f1e1a47ed7.woff2 +0 -0
- package/storybook-static/e0a63577ac642885f067.eot +0 -0
- package/storybook-static/e2625b8a1277972c9240.ttf +0 -0
- package/storybook-static/f469ea3aa8aacf7ad83a.eot +0 -0
- package/storybook-static/f632ebfa0d7b7085d542.woff2 +0 -0
- package/storybook-static/f93e2252d7112c3bcca5.woff2 +0 -0
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/iframe.html +348 -0
- package/storybook-static/index.html +59 -0
- package/storybook-static/main.01e6a863.iframe.bundle.js +1 -0
- package/storybook-static/main.dc406261155f1ebb44ce.manager.bundle.js +1 -0
- package/storybook-static/reactPlayerDailyMotion.469cc00f.iframe.bundle.js +1 -0
- package/storybook-static/reactPlayerFacebook.1423bb15.iframe.bundle.js +1 -0
- package/storybook-static/reactPlayerFilePlayer.e19e24a0.iframe.bundle.js +1 -0
- package/storybook-static/reactPlayerKaltura.d1eb0868.iframe.bundle.js +1 -0
- package/storybook-static/reactPlayerMixcloud.9f1b1691.iframe.bundle.js +1 -0
- package/storybook-static/reactPlayerPreview.9295696b.iframe.bundle.js +1 -0
- package/storybook-static/reactPlayerSoundCloud.d420395c.iframe.bundle.js +1 -0
- package/storybook-static/reactPlayerStreamable.9b655bf3.iframe.bundle.js +1 -0
- package/storybook-static/reactPlayerTwitch.e90e6dea.iframe.bundle.js +1 -0
- package/storybook-static/reactPlayerVidyard.a37ae6b3.iframe.bundle.js +1 -0
- package/storybook-static/reactPlayerVimeo.a7f367ee.iframe.bundle.js +1 -0
- package/storybook-static/reactPlayerWistia.fb351944.iframe.bundle.js +1 -0
- package/storybook-static/reactPlayerYouTube.3514e11a.iframe.bundle.js +1 -0
- package/storybook-static/runtime~main.012769eac0433a7ec083.manager.bundle.js +1 -0
- package/storybook-static/runtime~main.f3168ed5.iframe.bundle.js +1 -0
- package/storybook-static/static/css/main.3d116812.css +3 -0
- package/storybook-static/static/css/main.3d116812.css.map +1 -0
- package/tsconfig.build.json +15 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
import { Story, Meta } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Title,
|
|
4
|
+
Subtitle,
|
|
5
|
+
Description,
|
|
6
|
+
Primary,
|
|
7
|
+
ArgsTable,
|
|
8
|
+
Stories,
|
|
9
|
+
Subheading,
|
|
10
|
+
} from "@storybook/addon-docs";
|
|
11
|
+
import { Button } from "../components/Button";
|
|
12
|
+
import { ButtonProps } from "../components/Button/Button.props";
|
|
13
|
+
import buttonArgs from "../components/Button/Button.args";
|
|
14
|
+
|
|
15
|
+
const themeDoc = `
|
|
16
|
+
By changing the \`size\` prop you can change the size of the button. By default this is set to \`large\`.
|
|
17
|
+
|
|
18
|
+
| Size | Description |
|
|
19
|
+
|----------|-------------|
|
|
20
|
+
| \`large\` | Button theme for a large button. |
|
|
21
|
+
| \`medium\` | Button theme for a medium button. |
|
|
22
|
+
| \`small\` | Button theme for a small button. |
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const typeDoc = `
|
|
26
|
+
By changing the \`type\` prop you can change the type of the button, which affects the design of its default state. By default this is set to \`primary\`.
|
|
27
|
+
|
|
28
|
+
| Type | Description |
|
|
29
|
+
|----------|-------------|
|
|
30
|
+
| \`primary\` | Button type for a primary button. |
|
|
31
|
+
| \`secondary\` | Button type for a secondary button. |
|
|
32
|
+
| \`tertiary\` | Button type for a tertiary button. |
|
|
33
|
+
| \`alert\` | Button type for an alert button. |
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Button Story
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
export default {
|
|
41
|
+
title: "Components/Button",
|
|
42
|
+
component: Button,
|
|
43
|
+
argTypes: {},
|
|
44
|
+
parameters: {
|
|
45
|
+
componentSubtitle: "Component",
|
|
46
|
+
docs: {
|
|
47
|
+
page: () => (
|
|
48
|
+
<>
|
|
49
|
+
<Subtitle />
|
|
50
|
+
<Title />
|
|
51
|
+
<Description>
|
|
52
|
+
The button component creates either an HTML button, or an anchor
|
|
53
|
+
link styled like a button.
|
|
54
|
+
</Description>
|
|
55
|
+
<Primary />
|
|
56
|
+
<ArgsTable />
|
|
57
|
+
<Subheading>Theme Prop</Subheading>
|
|
58
|
+
<Description>{themeDoc}</Description>
|
|
59
|
+
<Subheading>Type Prop</Subheading>
|
|
60
|
+
<Description>{typeDoc}</Description>
|
|
61
|
+
<Stories title="Examples"></Stories>
|
|
62
|
+
</>
|
|
63
|
+
),
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
} as Meta<typeof Button>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Button Template
|
|
70
|
+
*
|
|
71
|
+
* create a Storybook template for this component
|
|
72
|
+
*
|
|
73
|
+
*@param (Object) args - props to be passed to the component
|
|
74
|
+
*/
|
|
75
|
+
const ButtonTemplate: Story<ButtonProps> = (args) => <Button {...args} />;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Large Button Instance
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
export const BaseButton = ButtonTemplate.bind({});
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Medium Button Instance
|
|
85
|
+
*
|
|
86
|
+
*/
|
|
87
|
+
export const MediumButton = ButtonTemplate.bind({});
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Small Button Instance
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
export const SmallButton = ButtonTemplate.bind({});
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Primary Button Instance
|
|
97
|
+
*
|
|
98
|
+
*/
|
|
99
|
+
export const PrimaryButton = ButtonTemplate.bind({});
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Secondary Button Instance
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
export const SecondaryButton = ButtonTemplate.bind({});
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Tertiary Button Instance
|
|
109
|
+
*
|
|
110
|
+
*/
|
|
111
|
+
export const TertiaryButton = ButtonTemplate.bind({});
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Secondary Button Instance
|
|
115
|
+
*
|
|
116
|
+
*/
|
|
117
|
+
export const SecondaryButtonM = ButtonTemplate.bind({});
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Tertiary Button Instance
|
|
121
|
+
*
|
|
122
|
+
*/
|
|
123
|
+
export const TertiaryButtonM = ButtonTemplate.bind({});
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Secondary Button Instance
|
|
127
|
+
*
|
|
128
|
+
*/
|
|
129
|
+
export const SecondaryButtonSm = ButtonTemplate.bind({});
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Tertiary Button Instance
|
|
133
|
+
*
|
|
134
|
+
*/
|
|
135
|
+
export const TertiaryButtonSm = ButtonTemplate.bind({});
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Disabled Button Instance
|
|
139
|
+
*
|
|
140
|
+
*/
|
|
141
|
+
export const DisabledButton = ButtonTemplate.bind({});
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Large Button With Icon on the Left Instance
|
|
145
|
+
*
|
|
146
|
+
*/
|
|
147
|
+
export const LgIconLeftButton = ButtonTemplate.bind({});
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Medium Button With Icon on the Left Instance
|
|
151
|
+
*
|
|
152
|
+
*/
|
|
153
|
+
export const MIconLeftButton = ButtonTemplate.bind({});
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Small Button With Icon on the Left Instance
|
|
157
|
+
*
|
|
158
|
+
*/
|
|
159
|
+
export const SmIconLeftButton = ButtonTemplate.bind({});
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Large Button With Icon on the Right Instance
|
|
163
|
+
*
|
|
164
|
+
*/
|
|
165
|
+
export const LgIconRightButton = ButtonTemplate.bind({});
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Medium Button With Icon on the Right Instance
|
|
169
|
+
*
|
|
170
|
+
*/
|
|
171
|
+
export const MIconRightButton = ButtonTemplate.bind({});
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Small Button With Icon on the Right Instance
|
|
175
|
+
*
|
|
176
|
+
*/
|
|
177
|
+
export const SmIconRightButton = ButtonTemplate.bind({});
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Large Button With Icon on the Left Instance
|
|
181
|
+
*
|
|
182
|
+
*/
|
|
183
|
+
export const LgSecondaryIconLeftButton = ButtonTemplate.bind({});
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Medium Button With Icon on the Left Instance
|
|
187
|
+
*
|
|
188
|
+
*/
|
|
189
|
+
export const MSecondaryIconLeftButton = ButtonTemplate.bind({});
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Small Button With Icon on the Left Instance
|
|
193
|
+
*
|
|
194
|
+
*/
|
|
195
|
+
export const SmSecondaryIconLeftButton = ButtonTemplate.bind({});
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Large Button With Icon on the Right Instance
|
|
199
|
+
*
|
|
200
|
+
*/
|
|
201
|
+
export const LgSecondaryIconRightButton = ButtonTemplate.bind({});
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Medium Button With Icon on the Right Instance
|
|
205
|
+
*
|
|
206
|
+
*/
|
|
207
|
+
export const MSecondaryIconRightButton = ButtonTemplate.bind({});
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Small Button With Icon on the Right Instance
|
|
211
|
+
*
|
|
212
|
+
*/
|
|
213
|
+
export const SmSecondaryIconRightButton = ButtonTemplate.bind({});
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Large Button With Icon on the Left Instance
|
|
217
|
+
*
|
|
218
|
+
*/
|
|
219
|
+
export const LgTertiaryIconLeftButton = ButtonTemplate.bind({});
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Medium Button With Icon on the Left Instance
|
|
223
|
+
*
|
|
224
|
+
*/
|
|
225
|
+
export const MTertiaryIconLeftButton = ButtonTemplate.bind({});
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Small Button With Icon on the Left Instance
|
|
229
|
+
*
|
|
230
|
+
*/
|
|
231
|
+
export const SmTertiaryIconLeftButton = ButtonTemplate.bind({});
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Large Button With Icon on the Right Instance
|
|
235
|
+
*
|
|
236
|
+
*/
|
|
237
|
+
export const LgTertiaryIconRightButton = ButtonTemplate.bind({});
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Medium Button With Icon on the Right Instance
|
|
241
|
+
*
|
|
242
|
+
*/
|
|
243
|
+
export const MTertiaryIconRightButton = ButtonTemplate.bind({});
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Small Button With Icon on the Right Instance
|
|
247
|
+
*
|
|
248
|
+
*/
|
|
249
|
+
export const SmTertiaryIconRightButton = ButtonTemplate.bind({});
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Large Button With Icon on the Left Instance
|
|
253
|
+
*
|
|
254
|
+
*/
|
|
255
|
+
export const LgAlertIconLeftButton = ButtonTemplate.bind({});
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Medium Button With Icon on the Left Instance
|
|
259
|
+
*
|
|
260
|
+
*/
|
|
261
|
+
export const MAlertIconLeftButton = ButtonTemplate.bind({});
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Small Button With Icon on the Left Instance
|
|
265
|
+
*
|
|
266
|
+
*/
|
|
267
|
+
export const SmAlertIconLeftButton = ButtonTemplate.bind({});
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Large Button With Icon on the Right Instance
|
|
271
|
+
*
|
|
272
|
+
*/
|
|
273
|
+
export const LgAlertIconRightButton = ButtonTemplate.bind({});
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Medium Button With Icon on the Right Instance
|
|
277
|
+
*
|
|
278
|
+
*/
|
|
279
|
+
export const MAlertIconRightButton = ButtonTemplate.bind({});
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Small Button With Icon on the Right Instance
|
|
283
|
+
*
|
|
284
|
+
*/
|
|
285
|
+
export const SmAlertIconRightButton = ButtonTemplate.bind({});
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Secondary Button Instance
|
|
289
|
+
*
|
|
290
|
+
*/
|
|
291
|
+
export const ButtonAlertM = ButtonTemplate.bind({});
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Tertiary Button Instance
|
|
295
|
+
*
|
|
296
|
+
*/
|
|
297
|
+
export const ButtonAlertSm = ButtonTemplate.bind({});
|
|
298
|
+
|
|
299
|
+
// enumerate the props for the large button
|
|
300
|
+
BaseButton.args = buttonArgs.large;
|
|
301
|
+
BaseButton.args.url = "#";
|
|
302
|
+
BaseButton.storyName = "Large Button";
|
|
303
|
+
|
|
304
|
+
// enumerate the props for the medium button
|
|
305
|
+
MediumButton.args = buttonArgs.medium;
|
|
306
|
+
MediumButton.args.url = "#";
|
|
307
|
+
MediumButton.storyName = "Medium Button";
|
|
308
|
+
|
|
309
|
+
// enumerate the props for the small button
|
|
310
|
+
SmallButton.args = buttonArgs.small;
|
|
311
|
+
SmallButton.args.url = "#";
|
|
312
|
+
SmallButton.storyName = "Small Button";
|
|
313
|
+
|
|
314
|
+
// enumerate the props for the primary button
|
|
315
|
+
PrimaryButton.args = buttonArgs.primary;
|
|
316
|
+
PrimaryButton.args.url = "";
|
|
317
|
+
PrimaryButton.storyName = "Primary Button";
|
|
318
|
+
|
|
319
|
+
// enumerate the props for the secondary button
|
|
320
|
+
SecondaryButton.args = buttonArgs.secondary;
|
|
321
|
+
SecondaryButton.args.url = "";
|
|
322
|
+
SecondaryButton.storyName = "Secondary Button";
|
|
323
|
+
|
|
324
|
+
// enumerate the props for the tertiary button
|
|
325
|
+
TertiaryButton.args = buttonArgs.tertiary;
|
|
326
|
+
TertiaryButton.args.url = "";
|
|
327
|
+
TertiaryButton.storyName = "Tertiary Button";
|
|
328
|
+
|
|
329
|
+
// enumerate the props for the secondary button
|
|
330
|
+
SecondaryButtonM.args = buttonArgs.secondarym;
|
|
331
|
+
SecondaryButtonM.args.url = "";
|
|
332
|
+
SecondaryButtonM.storyName = "Secondary Medium";
|
|
333
|
+
|
|
334
|
+
// enumerate the props for the tertiary button
|
|
335
|
+
TertiaryButtonM.args = buttonArgs.tertiarym;
|
|
336
|
+
TertiaryButtonM.args.url = "";
|
|
337
|
+
TertiaryButtonM.storyName = "Tertiary Medium";
|
|
338
|
+
|
|
339
|
+
// enumerate the props for the secondary button
|
|
340
|
+
SecondaryButtonSm.args = buttonArgs.secondarysm;
|
|
341
|
+
SecondaryButtonSm.args.url = "";
|
|
342
|
+
SecondaryButtonSm.storyName = "Secondary Small";
|
|
343
|
+
|
|
344
|
+
// enumerate the props for the tertiary button
|
|
345
|
+
TertiaryButtonSm.args = buttonArgs.tertiarysm;
|
|
346
|
+
TertiaryButtonSm.args.url = "";
|
|
347
|
+
TertiaryButtonSm.storyName = "Tertiary Small";
|
|
348
|
+
|
|
349
|
+
// enumerate the props for the tertiary button
|
|
350
|
+
ButtonAlertM.args = buttonArgs.alertm;
|
|
351
|
+
ButtonAlertM.args.url = "";
|
|
352
|
+
ButtonAlertM.storyName = "Alert Medium";
|
|
353
|
+
|
|
354
|
+
// enumerate the props for the secondary button
|
|
355
|
+
ButtonAlertSm.args = buttonArgs.alertsm;
|
|
356
|
+
ButtonAlertSm.args.url = "";
|
|
357
|
+
ButtonAlertSm.storyName = "Alert Small";
|
|
358
|
+
|
|
359
|
+
// enumerate the props for a disabled button
|
|
360
|
+
DisabledButton.args = buttonArgs.disabled;
|
|
361
|
+
DisabledButton.args.url = "";
|
|
362
|
+
DisabledButton.storyName = "Disabled Button";
|
|
363
|
+
|
|
364
|
+
// enumerate the props for a large primary icon left button
|
|
365
|
+
LgIconLeftButton.args = buttonArgs.iconleftlgprimary;
|
|
366
|
+
LgIconLeftButton.args.url = "";
|
|
367
|
+
LgIconLeftButton.storyName = "Large Primary Button with icon on left";
|
|
368
|
+
|
|
369
|
+
// enumerate the props for a medium primary icon left button
|
|
370
|
+
MIconLeftButton.args = buttonArgs.iconleftmprimary;
|
|
371
|
+
MIconLeftButton.args.url = "";
|
|
372
|
+
MIconLeftButton.storyName = "Medium Primary Button with icon on left";
|
|
373
|
+
|
|
374
|
+
// enumerate the props for a small primary icon left button
|
|
375
|
+
SmIconLeftButton.args = buttonArgs.iconleftsmprimary;
|
|
376
|
+
SmIconLeftButton.args.url = "";
|
|
377
|
+
SmIconLeftButton.storyName = "Small Primary Button with icon on left";
|
|
378
|
+
|
|
379
|
+
// enumerate the props for a large primary icon right button
|
|
380
|
+
LgIconRightButton.args = buttonArgs.iconrightlgprimary;
|
|
381
|
+
LgIconRightButton.args.url = "";
|
|
382
|
+
LgIconRightButton.storyName = "Large Primary Button with icon on right";
|
|
383
|
+
|
|
384
|
+
// enumerate the props for a medium primary icon right button
|
|
385
|
+
MIconRightButton.args = buttonArgs.iconrightmprimary;
|
|
386
|
+
MIconRightButton.args.url = "";
|
|
387
|
+
MIconRightButton.storyName = "Medium Primary Button with icon on right";
|
|
388
|
+
|
|
389
|
+
// enumerate the props for a small primary icon right button
|
|
390
|
+
SmIconRightButton.args = buttonArgs.iconrightsmprimary;
|
|
391
|
+
SmIconRightButton.args.url = "";
|
|
392
|
+
SmIconRightButton.storyName = "Small Primary Button with icon on right;";
|
|
393
|
+
|
|
394
|
+
// enumerate the props for a large secondary icon left button
|
|
395
|
+
LgSecondaryIconLeftButton.args = buttonArgs.iconleftlgsecondary;
|
|
396
|
+
LgSecondaryIconLeftButton.args.url = "";
|
|
397
|
+
LgSecondaryIconLeftButton.storyName =
|
|
398
|
+
"Large Secondary Button with icon on left";
|
|
399
|
+
|
|
400
|
+
// enumerate the props for a medium secondary icon left button
|
|
401
|
+
MSecondaryIconLeftButton.args = buttonArgs.iconleftmsecondary;
|
|
402
|
+
MSecondaryIconLeftButton.args.url = "";
|
|
403
|
+
MSecondaryIconLeftButton.storyName =
|
|
404
|
+
"Medium Secondary Button with icon on left";
|
|
405
|
+
|
|
406
|
+
// enumerate the props for a small secondary icon left button
|
|
407
|
+
SmSecondaryIconLeftButton.args = buttonArgs.iconleftsmsecondary;
|
|
408
|
+
SmSecondaryIconLeftButton.args.url = "";
|
|
409
|
+
SmSecondaryIconLeftButton.storyName =
|
|
410
|
+
"Small Secondary Button with icon on left";
|
|
411
|
+
|
|
412
|
+
// enumerate the props for a large secondary icon right button
|
|
413
|
+
LgSecondaryIconRightButton.args = buttonArgs.iconrightlgsecondary;
|
|
414
|
+
LgSecondaryIconRightButton.args.url = "";
|
|
415
|
+
LgSecondaryIconRightButton.storyName =
|
|
416
|
+
"Large Secondary Button with icon on right";
|
|
417
|
+
|
|
418
|
+
// enumerate the props for a medium secondary icon right button
|
|
419
|
+
MSecondaryIconRightButton.args = buttonArgs.iconrightmsecondary;
|
|
420
|
+
MSecondaryIconRightButton.args.url = "";
|
|
421
|
+
MSecondaryIconRightButton.storyName =
|
|
422
|
+
"Medium Secondary Button with icon on right";
|
|
423
|
+
|
|
424
|
+
// enumerate the props for a small secondary icon right button
|
|
425
|
+
SmSecondaryIconRightButton.args = buttonArgs.iconrightsmsecondary;
|
|
426
|
+
SmSecondaryIconRightButton.args.url = "";
|
|
427
|
+
SmSecondaryIconRightButton.storyName =
|
|
428
|
+
"Small Secondary Button with icon on right;";
|
|
429
|
+
|
|
430
|
+
// enumerate the props for a large tertiary icon left button
|
|
431
|
+
LgTertiaryIconLeftButton.args = buttonArgs.iconleftlgtertiary;
|
|
432
|
+
LgTertiaryIconLeftButton.args.url = "";
|
|
433
|
+
LgTertiaryIconLeftButton.storyName = "Large Tertiary Button with icon on left";
|
|
434
|
+
|
|
435
|
+
// enumerate the props for a medium tertiary icon left button
|
|
436
|
+
MTertiaryIconLeftButton.args = buttonArgs.iconleftmtertiary;
|
|
437
|
+
MTertiaryIconLeftButton.args.url = "";
|
|
438
|
+
MTertiaryIconLeftButton.storyName = "Medium Tertiary Button with icon on left";
|
|
439
|
+
|
|
440
|
+
// enumerate the props for a small tertiary icon left button
|
|
441
|
+
SmTertiaryIconLeftButton.args = buttonArgs.iconleftsmtertiary;
|
|
442
|
+
SmTertiaryIconLeftButton.args.url = "";
|
|
443
|
+
SmTertiaryIconLeftButton.storyName = "Small Tertiary Button with icon on left";
|
|
444
|
+
|
|
445
|
+
// enumerate the props for a large tertiary icon right button
|
|
446
|
+
LgTertiaryIconRightButton.args = buttonArgs.iconrightlgtertiary;
|
|
447
|
+
LgTertiaryIconRightButton.args.url = "";
|
|
448
|
+
LgTertiaryIconRightButton.storyName =
|
|
449
|
+
"Large Tertiary Button with icon on right";
|
|
450
|
+
|
|
451
|
+
// enumerate the props for a medium tertiary icon right button
|
|
452
|
+
MTertiaryIconRightButton.args = buttonArgs.iconrightmtertiary;
|
|
453
|
+
MTertiaryIconRightButton.args.url = "";
|
|
454
|
+
MTertiaryIconRightButton.storyName =
|
|
455
|
+
"Medium Tertiary Button with icon on right";
|
|
456
|
+
|
|
457
|
+
// enumerate the props for a small tertiary icon right button
|
|
458
|
+
SmTertiaryIconRightButton.args = buttonArgs.iconrightsmtertiary;
|
|
459
|
+
SmTertiaryIconRightButton.args.url = "";
|
|
460
|
+
SmTertiaryIconRightButton.storyName =
|
|
461
|
+
"Small Tertiary Button with icon on right;";
|
|
462
|
+
|
|
463
|
+
// enumerate the props for a large alert icon left button
|
|
464
|
+
LgAlertIconLeftButton.args = buttonArgs.iconleftlgalert;
|
|
465
|
+
LgAlertIconLeftButton.args.url = "";
|
|
466
|
+
LgAlertIconLeftButton.storyName = "Large Alert Button with icon on left";
|
|
467
|
+
|
|
468
|
+
// enumerate the props for a medium alert icon left button
|
|
469
|
+
MAlertIconLeftButton.args = buttonArgs.iconleftmalert;
|
|
470
|
+
MAlertIconLeftButton.args.url = "";
|
|
471
|
+
MAlertIconLeftButton.storyName = "Medium Alert Button with icon on left";
|
|
472
|
+
|
|
473
|
+
// enumerate the props for a small alert icon left button
|
|
474
|
+
SmAlertIconLeftButton.args = buttonArgs.iconleftsmalert;
|
|
475
|
+
SmAlertIconLeftButton.args.url = "";
|
|
476
|
+
SmAlertIconLeftButton.storyName = "Small Alert Button with icon on left";
|
|
477
|
+
|
|
478
|
+
// enumerate the props for a large alert icon right button
|
|
479
|
+
LgAlertIconRightButton.args = buttonArgs.iconrightlgalert;
|
|
480
|
+
LgAlertIconRightButton.args.url = "";
|
|
481
|
+
LgAlertIconRightButton.storyName = "Large Alert Button with icon on right";
|
|
482
|
+
|
|
483
|
+
// enumerate the props for a medium alert icon right button
|
|
484
|
+
MAlertIconRightButton.args = buttonArgs.iconrightmalert;
|
|
485
|
+
MAlertIconRightButton.args.url = "";
|
|
486
|
+
MAlertIconRightButton.storyName = "Medium Alert Button with icon on right";
|
|
487
|
+
|
|
488
|
+
// enumerate the props for a small alert icon right button
|
|
489
|
+
SmAlertIconRightButton.args = buttonArgs.iconrightsmalert;
|
|
490
|
+
SmAlertIconRightButton.args.url = "";
|
|
491
|
+
SmAlertIconRightButton.storyName = "Small Alert Button with icon on right;";
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { Story, Meta } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Title,
|
|
4
|
+
Subtitle,
|
|
5
|
+
Description,
|
|
6
|
+
Primary,
|
|
7
|
+
ArgsTable,
|
|
8
|
+
Stories,
|
|
9
|
+
Subheading,
|
|
10
|
+
} from "@storybook/addon-docs";
|
|
11
|
+
import { Callout } from "../components/Callout";
|
|
12
|
+
import { CalloutProps } from "../components/Callout/Callout.props";
|
|
13
|
+
import calloutArgs from "../components/Callout/Callout.args";
|
|
14
|
+
|
|
15
|
+
const themeDoc = `
|
|
16
|
+
By changing the \`type\` prop you can change base coloring of the links. By default this is set to \`info\`.
|
|
17
|
+
|
|
18
|
+
| Theme | Description |
|
|
19
|
+
|----------|-------------|
|
|
20
|
+
| \`info\` | Callout color and icon for info block. |
|
|
21
|
+
| \`error\` | Callout color and icon for error block. |
|
|
22
|
+
| \`success\` | Callout color and icon for success block. |
|
|
23
|
+
| \`warning\` | Callout color and icon for warning block. |
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Callout Story
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export default {
|
|
31
|
+
title: "Components/Callout",
|
|
32
|
+
component: Callout,
|
|
33
|
+
argTypes: {},
|
|
34
|
+
parameters: {
|
|
35
|
+
componentSubtitle: "Component",
|
|
36
|
+
docs: {
|
|
37
|
+
page: () => (
|
|
38
|
+
<>
|
|
39
|
+
<Subtitle />
|
|
40
|
+
<Title />
|
|
41
|
+
<Description>
|
|
42
|
+
The Callout component provides an inline alert or message to end
|
|
43
|
+
users.
|
|
44
|
+
</Description>
|
|
45
|
+
<Primary />
|
|
46
|
+
<ArgsTable />
|
|
47
|
+
<Subheading>Theme Prop</Subheading>
|
|
48
|
+
<Description>{themeDoc}</Description>
|
|
49
|
+
<Stories title="Examples"></Stories>
|
|
50
|
+
</>
|
|
51
|
+
),
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
} as Meta<typeof Callout>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Info Callout Template
|
|
58
|
+
*
|
|
59
|
+
* create a Storybook template for this component
|
|
60
|
+
*
|
|
61
|
+
*@param (Object) args - props to be passed to the component
|
|
62
|
+
*/
|
|
63
|
+
const InfoCalloutTemplate: Story<CalloutProps> = (args) => (
|
|
64
|
+
<Callout {...calloutArgs.infoCallout} {...args}>
|
|
65
|
+
That Biff, what a character. Always trying to get away with something. Been
|
|
66
|
+
on top of Biff ever since high school. Although, if it wasn't for him - Yes,
|
|
67
|
+
yes, I'm George, George McFly, and I'm your density. I mean, I'm your
|
|
68
|
+
destiny. Right.
|
|
69
|
+
</Callout>
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Error Callout Template
|
|
74
|
+
*
|
|
75
|
+
* create a Storybook template for this component
|
|
76
|
+
*
|
|
77
|
+
*@param (Object) args - props to be passed to the component
|
|
78
|
+
*/
|
|
79
|
+
const ErrorCalloutTemplate: Story<CalloutProps> = (args) => (
|
|
80
|
+
<Callout {...calloutArgs.errorCallout} {...args}>
|
|
81
|
+
That Biff, what a character. Always trying to get away with something. Been
|
|
82
|
+
on top of Biff ever since high school. Although, if it wasn't for him - Yes,
|
|
83
|
+
yes, I'm George, George McFly, and I'm your density. I mean, I'm your
|
|
84
|
+
destiny. Right.
|
|
85
|
+
</Callout>
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Success Callout Template
|
|
90
|
+
*
|
|
91
|
+
* create a Storybook template for this component
|
|
92
|
+
*
|
|
93
|
+
*@param (Object) args - props to be passed to the component
|
|
94
|
+
*/
|
|
95
|
+
const SuccessCalloutTemplate: Story<CalloutProps> = (args) => (
|
|
96
|
+
<Callout {...calloutArgs.successCallout} {...args}>
|
|
97
|
+
That Biff, what a character. Always trying to get away with something. Been
|
|
98
|
+
on top of Biff ever since high school. Although, if it wasn't for him - Yes,
|
|
99
|
+
yes, I'm George, George McFly, and I'm your density. I mean, I'm your
|
|
100
|
+
destiny. Right.
|
|
101
|
+
</Callout>
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Warning Callout Template
|
|
106
|
+
*
|
|
107
|
+
* create a Storybook template for this component
|
|
108
|
+
*
|
|
109
|
+
*@param (Object) args - props to be passed to the component
|
|
110
|
+
*/
|
|
111
|
+
const WarningCalloutTemplate: Story<CalloutProps> = (args) => (
|
|
112
|
+
<Callout {...calloutArgs.warningCallout} {...args}>
|
|
113
|
+
That Biff, what a character. Always trying to get away with something. Been
|
|
114
|
+
on top of Biff ever since high school. Although, if it wasn't for him - Yes,
|
|
115
|
+
yes, I'm George, George McFly, and I'm your density. I mean, I'm your
|
|
116
|
+
destiny. Right.
|
|
117
|
+
</Callout>
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Info Callout Instance
|
|
122
|
+
*
|
|
123
|
+
*/
|
|
124
|
+
export const InfoCallout = InfoCalloutTemplate.bind({});
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Error Callout Instance
|
|
128
|
+
*
|
|
129
|
+
*/
|
|
130
|
+
export const ErrorCallout = ErrorCalloutTemplate.bind({});
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Success Callout Instance
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
export const SuccessCallout = SuccessCalloutTemplate.bind({});
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Warning Callout Instance
|
|
140
|
+
*
|
|
141
|
+
*/
|
|
142
|
+
export const WarningCallout = WarningCalloutTemplate.bind({});
|
|
143
|
+
|
|
144
|
+
// enumerate the props for the Info Callout
|
|
145
|
+
InfoCallout.storyName = "Info Callout";
|
|
146
|
+
|
|
147
|
+
// enumerate the props Error Callout
|
|
148
|
+
ErrorCallout.storyName = "Error Callout";
|
|
149
|
+
|
|
150
|
+
// enumerate the props Success Callout
|
|
151
|
+
SuccessCallout.storyName = "Success Callout";
|
|
152
|
+
|
|
153
|
+
// enumerate the props Warning Callout
|
|
154
|
+
WarningCallout.storyName = "Warning Callout";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Story, Meta } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Title,
|
|
4
|
+
Subtitle,
|
|
5
|
+
Description,
|
|
6
|
+
Primary,
|
|
7
|
+
Stories,
|
|
8
|
+
Subheading,
|
|
9
|
+
} from "@storybook/addon-docs";
|
|
10
|
+
import { ContextMenu } from "../components/ContextMenu";
|
|
11
|
+
import { ContextMenuProps } from "../components/ContextMenu/ContextMenu.props";
|
|
12
|
+
import contextMenuArgs from "../components/ContextMenu/ContextMenu.args";
|
|
13
|
+
|
|
14
|
+
const propsDoc = `
|
|
15
|
+
The ContextMenu receives a list of urls with labels and an optional prop indicating if this link is at the end of a 'section.'
|
|
16
|
+
|
|
17
|
+
| Prop | Description |
|
|
18
|
+
|----------|-------------|
|
|
19
|
+
| \`endsection\` | Boolean - is this at the end of a 'section'? |
|
|
20
|
+
| \`label\` | Label for this link. |
|
|
21
|
+
| \`url\` | URL for this link. |
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* ContextMenu Story
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export default {
|
|
29
|
+
title: "Components/ContextMenu",
|
|
30
|
+
component: ContextMenu,
|
|
31
|
+
parameters: {
|
|
32
|
+
componentSubtitle: "Component",
|
|
33
|
+
docs: {
|
|
34
|
+
page: () => (
|
|
35
|
+
<>
|
|
36
|
+
<Subtitle />
|
|
37
|
+
<Title />
|
|
38
|
+
<Description>
|
|
39
|
+
The ContextMenu component is used to display information about a
|
|
40
|
+
person.
|
|
41
|
+
</Description>
|
|
42
|
+
<Primary />
|
|
43
|
+
<Subheading>Props</Subheading>
|
|
44
|
+
<Description>{propsDoc}</Description>
|
|
45
|
+
<Stories title="Examples"></Stories>
|
|
46
|
+
</>
|
|
47
|
+
),
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
} as Meta<typeof ContextMenu>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* ContextMenu Template
|
|
54
|
+
*
|
|
55
|
+
* create a Storybook template for this component
|
|
56
|
+
*
|
|
57
|
+
*@param (Object) args - props to be passed to the component
|
|
58
|
+
*/
|
|
59
|
+
const ContextMenuTemplate: Story<ContextMenuProps> = (args) => (
|
|
60
|
+
<ContextMenu {...args} />
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export const Basic = ContextMenuTemplate.bind({});
|
|
64
|
+
|
|
65
|
+
export const WithSection = ContextMenuTemplate.bind({});
|
|
66
|
+
|
|
67
|
+
// enumerate the props for the variations on the ContextMenu component
|
|
68
|
+
Basic.args = contextMenuArgs.basic;
|
|
69
|
+
Basic.storyName = "ContextMenu - Basic";
|
|
70
|
+
|
|
71
|
+
WithSection.args = contextMenuArgs.withsection;
|
|
72
|
+
WithSection.storyName = "ContextMenu - With A 'Section'";
|