@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,84 @@
|
|
|
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 { Profile } from "../components/Profile";
|
|
11
|
+
import { ProfileProps } from "../components/Profile/Profile.props";
|
|
12
|
+
import profileArgs from "../components/Profile/Profile.args";
|
|
13
|
+
|
|
14
|
+
const propsDoc = `
|
|
15
|
+
The Profile has several optional elements: description, link, and role. Note that while \`avatar\` can display a placeholder image, this should be delivered via the API, so that it can be curated via the CMS, so it is required.
|
|
16
|
+
|
|
17
|
+
| Prop | Description |
|
|
18
|
+
|----------|-------------|
|
|
19
|
+
| \`description\` | A short plain-text description (e.g. a short bio) |
|
|
20
|
+
| \`link\` | Label and URL for an optional link. |
|
|
21
|
+
| \`role\` | A short plain-text phrase labelling the person's role. |
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Profile Story
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export default {
|
|
29
|
+
title: "Components/Profile",
|
|
30
|
+
component: Profile,
|
|
31
|
+
parameters: {
|
|
32
|
+
componentSubtitle: "Component",
|
|
33
|
+
docs: {
|
|
34
|
+
page: () => (
|
|
35
|
+
<>
|
|
36
|
+
<Subtitle />
|
|
37
|
+
<Title />
|
|
38
|
+
<Description>
|
|
39
|
+
The Profile component is used to display information about a person.
|
|
40
|
+
</Description>
|
|
41
|
+
<Primary />
|
|
42
|
+
<Subheading>Props</Subheading>
|
|
43
|
+
<Description>{propsDoc}</Description>
|
|
44
|
+
<Stories title="Examples"></Stories>
|
|
45
|
+
</>
|
|
46
|
+
),
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
} as Meta<typeof Profile>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Profile Template
|
|
53
|
+
*
|
|
54
|
+
* create a Storybook template for this component
|
|
55
|
+
*
|
|
56
|
+
*@param (Object) args - props to be passed to the component
|
|
57
|
+
*/
|
|
58
|
+
const ProfileTemplate: Story<ProfileProps> = (args) => <Profile {...args} />;
|
|
59
|
+
|
|
60
|
+
export const Basic = ProfileTemplate.bind({});
|
|
61
|
+
|
|
62
|
+
export const HasAll = ProfileTemplate.bind({});
|
|
63
|
+
|
|
64
|
+
export const HasDescription = ProfileTemplate.bind({});
|
|
65
|
+
|
|
66
|
+
export const HasLink = ProfileTemplate.bind({});
|
|
67
|
+
|
|
68
|
+
export const HasRole = ProfileTemplate.bind({});
|
|
69
|
+
|
|
70
|
+
// enumerate the props for the variations on the Profile component
|
|
71
|
+
Basic.args = profileArgs.basic;
|
|
72
|
+
Basic.storyName = "Profile - Basic";
|
|
73
|
+
|
|
74
|
+
HasAll.args = profileArgs.hasall;
|
|
75
|
+
HasAll.storyName = "Profile - All Optional Props";
|
|
76
|
+
|
|
77
|
+
HasDescription.args = profileArgs.hasdescription;
|
|
78
|
+
HasDescription.storyName = "Profile - With Descriptoon";
|
|
79
|
+
|
|
80
|
+
HasLink.args = profileArgs.haslink;
|
|
81
|
+
HasLink.storyName = "Profile - With Link";
|
|
82
|
+
|
|
83
|
+
HasRole.args = profileArgs.hasrole;
|
|
84
|
+
HasRole.storyName = "Profile - With Role";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Story, Meta } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Title,
|
|
4
|
+
Subtitle,
|
|
5
|
+
Subheading,
|
|
6
|
+
Description,
|
|
7
|
+
Primary,
|
|
8
|
+
ArgsTable,
|
|
9
|
+
Stories,
|
|
10
|
+
} from "@storybook/addon-docs";
|
|
11
|
+
import { ReadMore } from "../components/ReadMore";
|
|
12
|
+
import { ReadMoreProps } from "../components/ReadMore/ReadMore.props";
|
|
13
|
+
import readMoreArgs from "../components/ReadMore/readMore.args";
|
|
14
|
+
|
|
15
|
+
const stateDoc = `
|
|
16
|
+
By changing the \`openatstart\` prop you can set whether it should display the full text or the excerpt on component load. By default this is set to \`false\`.
|
|
17
|
+
|
|
18
|
+
| openatstart | Description |
|
|
19
|
+
|----------|-------------|
|
|
20
|
+
| \`false\` | The "excerpt" text is displayed. |
|
|
21
|
+
| \`true\` | The "fulltext" text is displayed. |`;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* ReadMore Story
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export default {
|
|
28
|
+
title: "Components/ReadMore",
|
|
29
|
+
component: ReadMore,
|
|
30
|
+
argTypes: {},
|
|
31
|
+
parameters: {
|
|
32
|
+
componentSubtitle: "Component",
|
|
33
|
+
docs: {
|
|
34
|
+
page: () => (
|
|
35
|
+
<>
|
|
36
|
+
<Subtitle />
|
|
37
|
+
<Title />
|
|
38
|
+
<Description>
|
|
39
|
+
The ReadMore component display an excerpt in its "closed" state and
|
|
40
|
+
the full text in its "open" state. Displays text as HTML using the
|
|
41
|
+
RichText component.
|
|
42
|
+
</Description>
|
|
43
|
+
<Primary />
|
|
44
|
+
<ArgsTable />
|
|
45
|
+
<Subheading>openatstart Prop</Subheading>
|
|
46
|
+
<Description>{stateDoc}</Description>
|
|
47
|
+
<Stories title="Examples"></Stories>
|
|
48
|
+
</>
|
|
49
|
+
),
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
} as Meta<typeof ReadMore>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* ReadMore Template
|
|
56
|
+
*
|
|
57
|
+
* create a Storybook template for this component
|
|
58
|
+
*
|
|
59
|
+
*@param (Object) args - props to be passed to the component
|
|
60
|
+
*/
|
|
61
|
+
const ReadMoreTemplate: Story<ReadMoreProps> = (args) => <ReadMore {...args} />;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* ReadMore Instance
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
export const BaseReadMore = ReadMoreTemplate.bind({});
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* ReadMore Instance - openatstart is true
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
export const OpenedReadMore = ReadMoreTemplate.bind({});
|
|
74
|
+
|
|
75
|
+
// enumerate the props for the read more component
|
|
76
|
+
BaseReadMore.args = readMoreArgs.closedatstart;
|
|
77
|
+
BaseReadMore.storyName = "ReadMore - default";
|
|
78
|
+
|
|
79
|
+
OpenedReadMore.args = readMoreArgs.openedatstart;
|
|
80
|
+
OpenedReadMore.storyName = "ReadMore - opened on component load";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Story, Meta } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Title,
|
|
4
|
+
Subtitle,
|
|
5
|
+
Description,
|
|
6
|
+
Primary,
|
|
7
|
+
ArgsTable,
|
|
8
|
+
Stories,
|
|
9
|
+
} from "@storybook/addon-docs";
|
|
10
|
+
import { RichText } from "../components/RichText";
|
|
11
|
+
import { RichTextProps } from "../components/RichText/RichText.props";
|
|
12
|
+
import richTextArgs from "../components/RichText/richText.args";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* RichText Story
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export default {
|
|
19
|
+
title: "Components/RichText",
|
|
20
|
+
component: RichText,
|
|
21
|
+
argTypes: {},
|
|
22
|
+
parameters: {
|
|
23
|
+
componentSubtitle: "Component",
|
|
24
|
+
docs: {
|
|
25
|
+
page: () => (
|
|
26
|
+
<>
|
|
27
|
+
<Subtitle />
|
|
28
|
+
<Title />
|
|
29
|
+
<Description>
|
|
30
|
+
The rich text component displays HTML as composed in a WYSIWYG
|
|
31
|
+
editor.
|
|
32
|
+
</Description>
|
|
33
|
+
<Primary />
|
|
34
|
+
<ArgsTable />
|
|
35
|
+
<Stories title="Examples"></Stories>
|
|
36
|
+
</>
|
|
37
|
+
),
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
} as Meta<typeof RichText>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* RichText Template
|
|
44
|
+
*
|
|
45
|
+
* create a Storybook template for this component
|
|
46
|
+
*
|
|
47
|
+
*@param (Object) args - props to be passed to the component
|
|
48
|
+
*/
|
|
49
|
+
const RichTextTemplate: Story<RichTextProps> = (args) => <RichText {...args} />;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* RichText Instance
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
export const BaseRichText = RichTextTemplate.bind({});
|
|
56
|
+
|
|
57
|
+
// enumerate the props for the rich text component
|
|
58
|
+
BaseRichText.args = richTextArgs.richtext;
|
|
59
|
+
BaseRichText.storyName = "Rich Text";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Story, Meta } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Title,
|
|
4
|
+
Subtitle,
|
|
5
|
+
Description,
|
|
6
|
+
Primary,
|
|
7
|
+
ArgsTable,
|
|
8
|
+
Stories,
|
|
9
|
+
} from "@storybook/addon-docs";
|
|
10
|
+
import { SearchField } from "../components/SearchField";
|
|
11
|
+
import { Input } from "../components/Input";
|
|
12
|
+
import { SearchFieldProps } from "../components/SearchField/SearchField.props";
|
|
13
|
+
import SearchFieldArgs from "../components/SearchField/SearchField.args";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Empty Story
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export default {
|
|
20
|
+
title: "Components/SearchField",
|
|
21
|
+
component: SearchField,
|
|
22
|
+
argTypes: {},
|
|
23
|
+
subcomponents: {
|
|
24
|
+
Input,
|
|
25
|
+
},
|
|
26
|
+
parameters: {
|
|
27
|
+
componentSubtitle: "Component",
|
|
28
|
+
docs: {
|
|
29
|
+
page: () => (
|
|
30
|
+
<>
|
|
31
|
+
<Subtitle />
|
|
32
|
+
<Title />
|
|
33
|
+
<Description>
|
|
34
|
+
The SearchField component displays a single search input and a
|
|
35
|
+
button. It fires a callback function passed to it as the callback
|
|
36
|
+
prop onChange of the field, and another callback function onClick of
|
|
37
|
+
the button.
|
|
38
|
+
</Description>
|
|
39
|
+
<Primary />
|
|
40
|
+
<ArgsTable />
|
|
41
|
+
<Stories title="Examples"></Stories>
|
|
42
|
+
</>
|
|
43
|
+
),
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
} as Meta<typeof SearchField>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* SearchField Template
|
|
50
|
+
*
|
|
51
|
+
* create a Storybook template for this component
|
|
52
|
+
*
|
|
53
|
+
*@param (Object) args - props to be passed to the component
|
|
54
|
+
*/
|
|
55
|
+
const SearchFieldTemplate: Story<SearchFieldProps> = (args) => (
|
|
56
|
+
<SearchField {...args} />
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
export const SearchFieldDefault = SearchFieldTemplate.bind({});
|
|
60
|
+
|
|
61
|
+
// enumerate the props for the default search field
|
|
62
|
+
SearchFieldDefault.args = SearchFieldArgs.searchfield;
|
|
63
|
+
SearchFieldDefault.storyName = "Default SearchField";
|
|
64
|
+
|
|
65
|
+
export const SearchFieldError = SearchFieldTemplate.bind({});
|
|
66
|
+
|
|
67
|
+
// enumerate the props for the default search field
|
|
68
|
+
SearchFieldError.args = SearchFieldArgs.searchfielderror;
|
|
69
|
+
SearchFieldError.storyName = "SearchField Error";
|
|
70
|
+
|
|
71
|
+
export const SearchFieldDisabled = SearchFieldTemplate.bind({});
|
|
72
|
+
|
|
73
|
+
// enumerate the props for the default search field
|
|
74
|
+
SearchFieldDisabled.args = SearchFieldArgs.searchfielddisabled;
|
|
75
|
+
SearchFieldDisabled.storyName = "Disabled SearchField";
|
|
76
|
+
|
|
77
|
+
export const SearchFieldLabel = SearchFieldTemplate.bind({});
|
|
78
|
+
|
|
79
|
+
// enumerate the props for the default search field
|
|
80
|
+
SearchFieldLabel.args = SearchFieldArgs.searchfieldlabel;
|
|
81
|
+
SearchFieldLabel.storyName = "SearchField with Label";
|
|
82
|
+
|
|
83
|
+
export const SearchFieldHelper = SearchFieldTemplate.bind({});
|
|
84
|
+
|
|
85
|
+
// enumerate the props for the default search field
|
|
86
|
+
SearchFieldHelper.args = SearchFieldArgs.searchfieldhelper;
|
|
87
|
+
SearchFieldHelper.storyName = "SearchField with Helper text";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Story, Meta } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Title,
|
|
4
|
+
Subtitle,
|
|
5
|
+
Description,
|
|
6
|
+
Primary,
|
|
7
|
+
Stories,
|
|
8
|
+
} from "@storybook/addon-docs";
|
|
9
|
+
import { TableOfContents } from "../components/TableOfContents";
|
|
10
|
+
import { TableOfContentsProps } from "../components/TableOfContents/TableOfContents.props";
|
|
11
|
+
import tableOfContentsArgs from "../components/TableOfContents/TableOfContents.args";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Empty Story
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export default {
|
|
18
|
+
title: "Components/TableOfContents",
|
|
19
|
+
component: TableOfContents,
|
|
20
|
+
parameters: {
|
|
21
|
+
componentSubtitle: "Component",
|
|
22
|
+
docs: {
|
|
23
|
+
page: () => (
|
|
24
|
+
<>
|
|
25
|
+
<Subtitle />
|
|
26
|
+
<Title />
|
|
27
|
+
<Description>
|
|
28
|
+
The TableOfContents component displays a list of anchor links to aid
|
|
29
|
+
users navigating within a page.
|
|
30
|
+
</Description>
|
|
31
|
+
<Primary />
|
|
32
|
+
<Stories title="Examples"></Stories>
|
|
33
|
+
</>
|
|
34
|
+
),
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
} as Meta<typeof TableOfContents>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* TableOfContents Template
|
|
41
|
+
*
|
|
42
|
+
* create a Storybook template for this component
|
|
43
|
+
*
|
|
44
|
+
*@param (Object) args - props to be passed to the component
|
|
45
|
+
*/
|
|
46
|
+
const TableOfContentsTemplate: Story<TableOfContentsProps> = () => (
|
|
47
|
+
<TableOfContents {...tableOfContentsArgs.toc} />
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export const TableOfContents1 = TableOfContentsTemplate.bind({});
|
|
@@ -0,0 +1,194 @@
|
|
|
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 { Tag, TagSet } from "../components/Tag";
|
|
12
|
+
import { TagProps } from "../components/Tag/Tag.props";
|
|
13
|
+
import tagSetArgs from "../components/Tag/TagSet.args";
|
|
14
|
+
import tagArgs from "../components/Tag/Tag.args";
|
|
15
|
+
|
|
16
|
+
const themeDoc = `
|
|
17
|
+
By changing
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Tag Story
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
export default {
|
|
25
|
+
title: "Components/Tag",
|
|
26
|
+
component: Tag,
|
|
27
|
+
argTypes: {},
|
|
28
|
+
parameters: {
|
|
29
|
+
componentSubtitle: "Component",
|
|
30
|
+
docs: {
|
|
31
|
+
page: () => (
|
|
32
|
+
<>
|
|
33
|
+
<Subtitle />
|
|
34
|
+
<Title />
|
|
35
|
+
<Description>
|
|
36
|
+
The tag component creates an anchor tag with a specific theme.
|
|
37
|
+
</Description>
|
|
38
|
+
<Primary />
|
|
39
|
+
<ArgsTable />
|
|
40
|
+
<Subheading>Theme Prop</Subheading>
|
|
41
|
+
<Description>{themeDoc}</Description>
|
|
42
|
+
<Stories title="Examples"></Stories>
|
|
43
|
+
</>
|
|
44
|
+
),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
} as Meta<typeof Tag>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Tag Template
|
|
51
|
+
*
|
|
52
|
+
* create a Storybook template for this component
|
|
53
|
+
*
|
|
54
|
+
*@param (Object) args - props to be passed to the component
|
|
55
|
+
*/
|
|
56
|
+
const DisplayTagTemplate: Story<TagProps> = (args) => (
|
|
57
|
+
<TagSet {...tagSetArgs.tag} {...args}>
|
|
58
|
+
<Tag {...tagArgs.tag} type="display">
|
|
59
|
+
Test 1
|
|
60
|
+
</Tag>
|
|
61
|
+
<Tag {...tagArgs.tag} id="tag2" type="display">
|
|
62
|
+
Test 2
|
|
63
|
+
</Tag>
|
|
64
|
+
<Tag {...tagArgs.tag} id="tag3" type="display">
|
|
65
|
+
Test 3
|
|
66
|
+
</Tag>
|
|
67
|
+
<Tag {...tagArgs.tag} id="tag4" type="display">
|
|
68
|
+
Test 4
|
|
69
|
+
</Tag>
|
|
70
|
+
<Tag {...tagArgs.tag} id="tag5" type="display">
|
|
71
|
+
Test 5
|
|
72
|
+
</Tag>
|
|
73
|
+
<Tag {...tagArgs.tag} id="tag6" type="display">
|
|
74
|
+
Test 6
|
|
75
|
+
</Tag>
|
|
76
|
+
<Tag {...tagArgs.tag} id="tag7" type="display">
|
|
77
|
+
Test 7
|
|
78
|
+
</Tag>
|
|
79
|
+
<Tag {...tagArgs.tag} id="tag8" type="display">
|
|
80
|
+
Test 8
|
|
81
|
+
</Tag>
|
|
82
|
+
<Tag {...tagArgs.tag} id="tag9" type="display">
|
|
83
|
+
Test 9
|
|
84
|
+
</Tag>
|
|
85
|
+
</TagSet>
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Tag 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 AnchorTagTemplate: Story<TagProps> = (args) => (
|
|
96
|
+
<TagSet {...tagSetArgs.tag} {...args}>
|
|
97
|
+
<Tag {...tagArgs.tag} url="https://www.google.com/" type="anchor">
|
|
98
|
+
Test 1
|
|
99
|
+
</Tag>
|
|
100
|
+
<Tag {...tagArgs.tag} id="tag2" url="https://www.google.com/" type="anchor">
|
|
101
|
+
Test 2
|
|
102
|
+
</Tag>
|
|
103
|
+
<Tag {...tagArgs.tag} id="tag3" url="https://www.google.com/" type="anchor">
|
|
104
|
+
Test 3
|
|
105
|
+
</Tag>
|
|
106
|
+
<Tag {...tagArgs.tag} id="tag4" url="https://www.google.com/" type="anchor">
|
|
107
|
+
Test 4
|
|
108
|
+
</Tag>
|
|
109
|
+
<Tag {...tagArgs.tag} id="tag5" url="https://www.google.com/" type="anchor">
|
|
110
|
+
Test 5
|
|
111
|
+
</Tag>
|
|
112
|
+
<Tag {...tagArgs.tag} id="tag6" url="https://www.google.com/" type="anchor">
|
|
113
|
+
Test 6
|
|
114
|
+
</Tag>
|
|
115
|
+
<Tag {...tagArgs.tag} id="tag7" url="https://www.google.com/" type="anchor">
|
|
116
|
+
Test 7
|
|
117
|
+
</Tag>
|
|
118
|
+
<Tag {...tagArgs.tag} id="tag8" url="https://www.google.com/" type="anchor">
|
|
119
|
+
Test 8
|
|
120
|
+
</Tag>
|
|
121
|
+
<Tag {...tagArgs.tag} id="tag9" url="https://www.google.com/" type="anchor">
|
|
122
|
+
Test 9
|
|
123
|
+
</Tag>
|
|
124
|
+
</TagSet>
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Button Tag Template
|
|
129
|
+
*
|
|
130
|
+
* create a Storybook template for this component
|
|
131
|
+
*
|
|
132
|
+
*@param (Object) args - props to be passed to the component
|
|
133
|
+
*/
|
|
134
|
+
const ButtonTagTemplate: Story<TagProps> = (args) => (
|
|
135
|
+
<TagSet {...tagSetArgs.buttonTag} {...args}>
|
|
136
|
+
<Tag {...tagArgs.tag} id="tag1" url="https://www.google.com/" type="button">
|
|
137
|
+
Test 1
|
|
138
|
+
</Tag>
|
|
139
|
+
<Tag {...tagArgs.tag} id="tag2" url="https://www.google.com/" type="button">
|
|
140
|
+
Test 2
|
|
141
|
+
</Tag>
|
|
142
|
+
<Tag {...tagArgs.tag} id="tag3" url="https://www.google.com/" type="button">
|
|
143
|
+
Test 3
|
|
144
|
+
</Tag>
|
|
145
|
+
<Tag {...tagArgs.tag} id="tag4" url="https://www.google.com/" type="button">
|
|
146
|
+
Test 4
|
|
147
|
+
</Tag>
|
|
148
|
+
<Tag {...tagArgs.tag} id="tag5" url="https://www.google.com/" type="button">
|
|
149
|
+
Test 5
|
|
150
|
+
</Tag>
|
|
151
|
+
<Tag {...tagArgs.tag} id="tag6" url="https://www.google.com/" type="button">
|
|
152
|
+
Test 6
|
|
153
|
+
</Tag>
|
|
154
|
+
<Tag {...tagArgs.tag} id="tag7" url="https://www.google.com/" type="button">
|
|
155
|
+
Test 7
|
|
156
|
+
</Tag>
|
|
157
|
+
<Tag {...tagArgs.tag} id="tag8" url="https://www.google.com/" type="button">
|
|
158
|
+
Test 8
|
|
159
|
+
</Tag>
|
|
160
|
+
<Tag {...tagArgs.tag} id="tag9" url="https://www.google.com/" type="button">
|
|
161
|
+
Test 9
|
|
162
|
+
</Tag>
|
|
163
|
+
</TagSet>
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Display Tag Instance
|
|
168
|
+
*
|
|
169
|
+
*/
|
|
170
|
+
export const DisplayTag = DisplayTagTemplate.bind({});
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Anchor Tag Instance
|
|
174
|
+
*
|
|
175
|
+
*/
|
|
176
|
+
export const AnchorTag = AnchorTagTemplate.bind({});
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Button Tag Instance
|
|
180
|
+
*
|
|
181
|
+
*/
|
|
182
|
+
export const ButtonTag = ButtonTagTemplate.bind({});
|
|
183
|
+
|
|
184
|
+
// enumerate the props for the light tag.
|
|
185
|
+
DisplayTag.args = tagSetArgs.tag;
|
|
186
|
+
DisplayTag.storyName = "Display Tag";
|
|
187
|
+
|
|
188
|
+
// enumerate the props for the light tag.
|
|
189
|
+
AnchorTag.args = tagSetArgs.tag;
|
|
190
|
+
AnchorTag.storyName = "Anchor Tag";
|
|
191
|
+
|
|
192
|
+
// enumerate the props for the light tag.
|
|
193
|
+
ButtonTag.args = tagSetArgs.buttonTag;
|
|
194
|
+
ButtonTag.storyName = "Button Tag";
|
|
@@ -0,0 +1,83 @@
|
|
|
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 { Tooltip } from "../components/Tooltip";
|
|
12
|
+
import { TooltipProps } from "../components/Tooltip/Tooltip.props";
|
|
13
|
+
import tooltipArgs from "../components/Tooltip/Tooltip.args";
|
|
14
|
+
|
|
15
|
+
const themeDoc = `
|
|
16
|
+
By changing the \`theme\` prop you can set whether the tooltip has a light or dark theme.`;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Tooltip Story
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export default {
|
|
23
|
+
title: "Components/Tooltip",
|
|
24
|
+
component: Tooltip,
|
|
25
|
+
argTypes: {},
|
|
26
|
+
parameters: {
|
|
27
|
+
componentSubtitle: "Component",
|
|
28
|
+
docs: {
|
|
29
|
+
page: () => (
|
|
30
|
+
<>
|
|
31
|
+
<Subtitle />
|
|
32
|
+
<Title />
|
|
33
|
+
<Description>
|
|
34
|
+
The link component creates an anchor link with a specific theme.
|
|
35
|
+
</Description>
|
|
36
|
+
<Primary />
|
|
37
|
+
<ArgsTable />
|
|
38
|
+
<Subheading>Theme Prop</Subheading>
|
|
39
|
+
<Description>{themeDoc}</Description>
|
|
40
|
+
<Stories title="Examples"></Stories>
|
|
41
|
+
</>
|
|
42
|
+
),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
} as Meta<typeof Tooltip>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Tooltip Template
|
|
49
|
+
*
|
|
50
|
+
* create a Storybook template for this component
|
|
51
|
+
*
|
|
52
|
+
*@param (Object) args - props to be passed to the component
|
|
53
|
+
*/
|
|
54
|
+
const TooltipTemplate: Story<TooltipProps> = (args) => (
|
|
55
|
+
<Tooltip {...args}>
|
|
56
|
+
<a href="https://www.google.com/">This is testing for the tooltip</a>
|
|
57
|
+
</Tooltip>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Tooltip Instance
|
|
62
|
+
*
|
|
63
|
+
*/
|
|
64
|
+
export const Light = TooltipTemplate.bind({});
|
|
65
|
+
|
|
66
|
+
export const Dark = TooltipTemplate.bind({});
|
|
67
|
+
|
|
68
|
+
export const LightIcon = TooltipTemplate.bind({});
|
|
69
|
+
|
|
70
|
+
export const DarkIcon = TooltipTemplate.bind({});
|
|
71
|
+
|
|
72
|
+
// enumerate the props for the tooltip
|
|
73
|
+
Light.args = tooltipArgs.light;
|
|
74
|
+
Light.storyName = "Tooltip - Light";
|
|
75
|
+
|
|
76
|
+
Dark.args = tooltipArgs.dark;
|
|
77
|
+
Dark.storyName = "Tooltip - Dark";
|
|
78
|
+
|
|
79
|
+
LightIcon.args = tooltipArgs.lighticon;
|
|
80
|
+
LightIcon.storyName = "Tooltip - Light, with Icon";
|
|
81
|
+
|
|
82
|
+
DarkIcon.args = tooltipArgs.darkicon;
|
|
83
|
+
DarkIcon.storyName = "Tooltip - Dark, with Icon";
|