@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 @@
|
|
|
1
|
+
export { default as Pagination } from "./Pagination";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ProfileProps } from "./Profile.props";
|
|
2
|
+
|
|
3
|
+
const basic: ProfileProps = {
|
|
4
|
+
avatar: "http://placekitten.com/128/128",
|
|
5
|
+
className: "storybook",
|
|
6
|
+
name: "Firstname Lastname",
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const hasall: ProfileProps = {
|
|
10
|
+
avatar: "http://placekitten.com/128/128",
|
|
11
|
+
className: "storybook",
|
|
12
|
+
description:
|
|
13
|
+
"Firstname Lastname is the Senior Media Strategist. He has been with ILO for eight years.",
|
|
14
|
+
link: {
|
|
15
|
+
label: "Optional Link",
|
|
16
|
+
url: "http://www.google.com",
|
|
17
|
+
},
|
|
18
|
+
name: "Firstname Lastname",
|
|
19
|
+
role: "Senior Media Strategist",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const hasdescription: ProfileProps = {
|
|
23
|
+
avatar: "http://placekitten.com/128/128",
|
|
24
|
+
className: "storybook",
|
|
25
|
+
description:
|
|
26
|
+
"Firstname Lastname is the Senior Media Strategist. He has been with ILO for eight years.",
|
|
27
|
+
name: "Firstname Lastname",
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const haslink: ProfileProps = {
|
|
31
|
+
avatar: "http://placekitten.com/128/128",
|
|
32
|
+
className: "storybook",
|
|
33
|
+
link: {
|
|
34
|
+
label: "Optional Link",
|
|
35
|
+
url: "http://www.google.com",
|
|
36
|
+
},
|
|
37
|
+
name: "Firstname Lastname",
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const hasrole: ProfileProps = {
|
|
41
|
+
avatar: "http://placekitten.com/128/128",
|
|
42
|
+
className: "storybook",
|
|
43
|
+
name: "Firstname Lastname",
|
|
44
|
+
role: "Senior Media Strategist",
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Sample prop definitions for Profiles's enumerable properties (imported in stories and test)
|
|
49
|
+
*/
|
|
50
|
+
const ProfileArgs = {
|
|
51
|
+
basic,
|
|
52
|
+
hasall,
|
|
53
|
+
hasdescription,
|
|
54
|
+
haslink,
|
|
55
|
+
hasrole,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default ProfileArgs;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
interface LinkProps {
|
|
2
|
+
/**
|
|
3
|
+
* Specify the label for the the Profile's link
|
|
4
|
+
*/
|
|
5
|
+
label?: Required<string>;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Specify the url for the Profile's link
|
|
9
|
+
*/
|
|
10
|
+
url?: Required<string>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ProfileProps {
|
|
14
|
+
/**
|
|
15
|
+
* Specify an optional avatar to be added to your Profile component. Image *must* be a perfect square. CMS backend should provide a fallback if the avatar is not populated.
|
|
16
|
+
*/
|
|
17
|
+
avatar?: Required<string>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Specify an optional className to be added to your Profile component.
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Specify an optional description to be added to your Profile component.
|
|
26
|
+
*/
|
|
27
|
+
description?: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Specify an optional link to be added to your Profile component.
|
|
31
|
+
*/
|
|
32
|
+
link?: LinkProps;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Specify the name to be added to your Profile component.
|
|
36
|
+
*/
|
|
37
|
+
name?: Required<string>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Specify an optional role to be added to your Profile component.
|
|
41
|
+
*/
|
|
42
|
+
role?: string;
|
|
43
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import useGlobalSettings from "../../hooks/useGlobalSettings";
|
|
4
|
+
import { ProfileProps } from "./Profile.props";
|
|
5
|
+
|
|
6
|
+
const Profile: FC<ProfileProps> = ({
|
|
7
|
+
avatar,
|
|
8
|
+
className,
|
|
9
|
+
description,
|
|
10
|
+
link,
|
|
11
|
+
name,
|
|
12
|
+
role,
|
|
13
|
+
}) => {
|
|
14
|
+
const { prefix } = useGlobalSettings();
|
|
15
|
+
const baseClass = `${prefix}--profile`;
|
|
16
|
+
const profileClasses = classNames(className, {
|
|
17
|
+
[baseClass]: true,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<figure className={profileClasses}>
|
|
22
|
+
<img
|
|
23
|
+
className={`${baseClass}--avatar`}
|
|
24
|
+
src={avatar}
|
|
25
|
+
alt={`Avatar for ${name}`}
|
|
26
|
+
/>
|
|
27
|
+
<figcaption className={`${baseClass}--contents`}>
|
|
28
|
+
<span className={`${baseClass}--name id`}>{name}</span>
|
|
29
|
+
{role && <span className={`${baseClass}--role id`}>{role}</span>}
|
|
30
|
+
{description && (
|
|
31
|
+
<p className={`${baseClass}--description info`}>{description}</p>
|
|
32
|
+
)}
|
|
33
|
+
{link && (
|
|
34
|
+
<a className={`${baseClass}--link info`} href={link.url}>
|
|
35
|
+
<span>{link.label}</span>
|
|
36
|
+
</a>
|
|
37
|
+
)}
|
|
38
|
+
</figcaption>
|
|
39
|
+
</figure>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default Profile;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Profile } from "./Profile";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RadioProps } from "./Radio.props";
|
|
2
|
+
|
|
3
|
+
const basic: RadioProps = {
|
|
4
|
+
callback: "",
|
|
5
|
+
disabled: false,
|
|
6
|
+
error: false,
|
|
7
|
+
helper: false,
|
|
8
|
+
label: "Radio Field Label",
|
|
9
|
+
name: "radio",
|
|
10
|
+
required: false,
|
|
11
|
+
type: "radio",
|
|
12
|
+
value: "radio",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Sample prop definitions Radio's enumerable properties (imported in stories and test)
|
|
17
|
+
*/
|
|
18
|
+
const RadioArgs = {
|
|
19
|
+
basic,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default RadioArgs;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export interface RadioProps {
|
|
2
|
+
/**
|
|
3
|
+
* The Radio's onChange callback.
|
|
4
|
+
*/
|
|
5
|
+
callback: function;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Specify an optional className to be added to your Radio.
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Is the Radio disabled?
|
|
14
|
+
*/
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Does the Radio have an error?
|
|
19
|
+
*/
|
|
20
|
+
error?: string | false;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The Radio's helper text
|
|
24
|
+
*/
|
|
25
|
+
helper: string | false;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The Radio's id attribute
|
|
29
|
+
*/
|
|
30
|
+
id?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Does this Radio have a label?
|
|
34
|
+
*/
|
|
35
|
+
label: string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The Radio's name attribute
|
|
39
|
+
*/
|
|
40
|
+
name?: Required<string>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Specify whether this Radio is required
|
|
44
|
+
*/
|
|
45
|
+
required?: boolean;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Does this Radio have a tooltip?
|
|
49
|
+
*/
|
|
50
|
+
tooltip?: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The Radio's value attribute
|
|
54
|
+
*/
|
|
55
|
+
value?: Required<string>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The input's type.
|
|
59
|
+
*/
|
|
60
|
+
type?: "radio";
|
|
61
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { FC, useState } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import useGlobalSettings from "../../hooks/useGlobalSettings";
|
|
4
|
+
import { RadioProps } from "./Radio.props";
|
|
5
|
+
import { FormElement } from "../FormElement";
|
|
6
|
+
|
|
7
|
+
const Radio: FC<RadioProps> = ({
|
|
8
|
+
callback,
|
|
9
|
+
disabled = false,
|
|
10
|
+
error,
|
|
11
|
+
helper,
|
|
12
|
+
id,
|
|
13
|
+
label,
|
|
14
|
+
name,
|
|
15
|
+
required,
|
|
16
|
+
tooltip,
|
|
17
|
+
value,
|
|
18
|
+
}) => {
|
|
19
|
+
const { prefix } = useGlobalSettings();
|
|
20
|
+
const baseClass = `${prefix}--radio`;
|
|
21
|
+
|
|
22
|
+
const RadioClasses = classNames("", {
|
|
23
|
+
[baseClass]: true,
|
|
24
|
+
[`error`]: error,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const [checked, setChecked] = useState(false);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* On change, if there is a callback, call it
|
|
31
|
+
*/
|
|
32
|
+
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
33
|
+
setChecked(e.target.checked);
|
|
34
|
+
|
|
35
|
+
if (callback) {
|
|
36
|
+
callback(e);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<FormElement
|
|
42
|
+
elemid={id as any}
|
|
43
|
+
label={label}
|
|
44
|
+
helper={helper as any}
|
|
45
|
+
error={error as any}
|
|
46
|
+
required={required as any}
|
|
47
|
+
tooltip={tooltip}
|
|
48
|
+
>
|
|
49
|
+
<input
|
|
50
|
+
id={id}
|
|
51
|
+
name={name}
|
|
52
|
+
onChange={handleChange}
|
|
53
|
+
disabled={disabled}
|
|
54
|
+
required={required as any}
|
|
55
|
+
type={"radio"}
|
|
56
|
+
className={RadioClasses}
|
|
57
|
+
checked={checked}
|
|
58
|
+
value={value}
|
|
59
|
+
/>
|
|
60
|
+
</FormElement>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default Radio;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Radio } from "./Radio";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface ReadMoreButtonLabelProps {
|
|
2
|
+
/**
|
|
3
|
+
* Specify the label for the closed state of the "Read More" button
|
|
4
|
+
*/
|
|
5
|
+
closed?: Required<string>;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Specify the label for the opened state of the "Read More" button
|
|
9
|
+
*/
|
|
10
|
+
opened?: Required<string>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ReadMoreProps {
|
|
14
|
+
/**
|
|
15
|
+
* Specify labels for the "Read More" button.
|
|
16
|
+
*/
|
|
17
|
+
buttonlabel?: Required<ReadMoreButtonLabelProps>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Specify an optional className to be added to your Button.
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Specify the excerpt text
|
|
26
|
+
*/
|
|
27
|
+
excerpt?: html;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Specify the complete text
|
|
31
|
+
*/
|
|
32
|
+
fulltext?: html;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Specify the open/closed state on component load
|
|
36
|
+
*/
|
|
37
|
+
openatstart?: boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { FC, useState } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import useGlobalSettings from "../../hooks/useGlobalSettings";
|
|
4
|
+
import { ReadMoreProps } from "./ReadMore.props";
|
|
5
|
+
import { RichText } from "../RichText";
|
|
6
|
+
|
|
7
|
+
const ReadMore: FC<ReadMoreProps> = ({
|
|
8
|
+
buttonlabel,
|
|
9
|
+
className,
|
|
10
|
+
excerpt,
|
|
11
|
+
fulltext,
|
|
12
|
+
openatstart,
|
|
13
|
+
...rest
|
|
14
|
+
}) => {
|
|
15
|
+
const { prefix } = useGlobalSettings();
|
|
16
|
+
const baseClass = `${prefix}--read-more`;
|
|
17
|
+
const [content, setContent] = useState(openatstart ? fulltext : excerpt);
|
|
18
|
+
const [isopen, setOpen] = useState(openatstart);
|
|
19
|
+
|
|
20
|
+
const readMoreClasses = classNames(className, {
|
|
21
|
+
[baseClass]: true,
|
|
22
|
+
[`${baseClass}--open`]: isopen,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const readmoreButtonClasses = classNames(className, {
|
|
26
|
+
[`${baseClass}--button`]: true,
|
|
27
|
+
[`${baseClass}--button--open`]: isopen,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* On click, toggle state vars
|
|
32
|
+
*/
|
|
33
|
+
const handleClick = () => {
|
|
34
|
+
const nextcontent = content === excerpt ? fulltext : excerpt;
|
|
35
|
+
setContent(nextcontent);
|
|
36
|
+
setOpen(!isopen);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div className={readMoreClasses}>
|
|
41
|
+
<RichText content={content} {...rest} />
|
|
42
|
+
<button
|
|
43
|
+
className={readmoreButtonClasses}
|
|
44
|
+
aria-expanded={isopen}
|
|
45
|
+
onClick={() => handleClick()}
|
|
46
|
+
>
|
|
47
|
+
{isopen
|
|
48
|
+
? `${buttonlabel && buttonlabel.opened}`
|
|
49
|
+
: `${buttonlabel && buttonlabel.closed}`}
|
|
50
|
+
</button>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default ReadMore;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ReadMore } from "./ReadMore";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReadMoreProps } from "./ReadMore.props";
|
|
2
|
+
|
|
3
|
+
const closedatstart: ReadMoreProps = {
|
|
4
|
+
buttonlabel: {
|
|
5
|
+
closed: "Read More",
|
|
6
|
+
opened: "Close",
|
|
7
|
+
},
|
|
8
|
+
excerpt:
|
|
9
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
10
|
+
fulltext:
|
|
11
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
12
|
+
openatstart: false,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const openedatstart: ReadMoreProps = {
|
|
16
|
+
buttonlabel: {
|
|
17
|
+
closed: "Read More",
|
|
18
|
+
opened: "Close",
|
|
19
|
+
},
|
|
20
|
+
excerpt:
|
|
21
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
22
|
+
fulltext:
|
|
23
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
24
|
+
openatstart: true,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Sample prop definitions for ReadMore's enumerable properties (imported in stories and tests).
|
|
29
|
+
*/
|
|
30
|
+
const ReadMoreArgs = {
|
|
31
|
+
openedatstart,
|
|
32
|
+
closedatstart,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default ReadMoreArgs;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import useGlobalSettings from "../../hooks/useGlobalSettings";
|
|
4
|
+
import { RichTextProps } from "./RichText.props";
|
|
5
|
+
|
|
6
|
+
const RichText: FC<RichTextProps> = ({ className, content }) => {
|
|
7
|
+
const { prefix } = useGlobalSettings();
|
|
8
|
+
const baseClass = `${prefix}--richtext`;
|
|
9
|
+
|
|
10
|
+
const richTextClasses = classNames(className, {
|
|
11
|
+
[baseClass]: true,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
className={richTextClasses}
|
|
17
|
+
dangerouslySetInnerHTML={{ __html: content }}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default RichText;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as RichText } from "./RichText";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RichTextProps } from "./RichText.props";
|
|
2
|
+
|
|
3
|
+
const richtext: RichTextProps = {
|
|
4
|
+
content:
|
|
5
|
+
"<h1>Apollo 11</h1><p><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href='http://en.wikipedia.org/wiki/Neil_Armstrong'>Neil Armstrong</a> and <a href='http://en.wikipedia.org/wiki/Buzz_Aldrin'>Buzz Aldrin</a>, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.</p><p>Armstrong spent about <s>three and a half</s> two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5 kg) of lunar material for return to Earth. A third member of the mission, <a href='http://en.wikipedia.org/wiki/Michael_Collins_(astronaut)'>Michael Collins</a>, piloted the <a href='http://en.wikipedia.org/wiki/Apollo_Command/Service_Module'>command</a> spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth. <figure><img alt='placeholder image' class='right' src='https://place-hold.it/400x300?text=Placeholder Image'><figcaption>The caption for this image</figcaption></figure></p><h2>Broadcasting and <em>quotes</em> <a id='quotes' name='quotes'></a></h2><p>Broadcast on live TV to a world-wide audience, Armstrong stepped onto the lunar surface and described the event as:</p><blockquote><p>One small step for [a] man, one giant leap for mankind</p><cite>Neil Armstrong</cite></blockquote><h2>Technical details <a id='tech-details' name='tech-details'></a></h2><p>Launched by a <strong>Saturn V</strong> rocket from <a href='http://en.wikipedia.org/wiki/Kennedy_Space_Center'>Kennedy Space Center</a> in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of <a href='http://en.wikipedia.org/wiki/NASA'>NASA</a>'s Apollo program. The Apollo spacecraft had three parts:</p><ol><li><strong>Command Module</strong> with a cabin for the three astronauts which was the only part which landed back on Earth</li><li><strong>Service Module</strong> which supported the Command Module with propulsion, electrical power, oxygen and water</li><li><strong>Lunar Module</strong> for landing on the Moon.</li></ol><p>After being sent to the Moon by the Saturn V's upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the <a href='http://en.wikipedia.org/wiki/Mare_Tranquillitatis'>Sea of Tranquility</a>. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the <a href='http://en.wikipedia.org/wiki/Pacific_Ocean'>Pacific Ocean</a> on July 24.</p><hr><p><small>Source: <a href='http://en.wikipedia.org/wiki/Apollo_11'>Wikipedia.org</a></small></p><h2>H2 Headline</h2><p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.</p><h3>H3 Headline</h3><p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.</p><h4>H4 Headline</h4><p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.</p><h5>H5 Headline</h5><p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.</p><h6>H6 Headline</h6><p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.</p>",
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Sample prop definitions for RichText's enumerable properties (imported in stories and tests).
|
|
10
|
+
*/
|
|
11
|
+
const richTextArgs = {
|
|
12
|
+
richtext,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default richTextArgs;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { SearchFieldProps } from "./SearchField.props";
|
|
2
|
+
|
|
3
|
+
const searchfield: SearchFieldProps = {
|
|
4
|
+
action: "",
|
|
5
|
+
callback: "",
|
|
6
|
+
input: {
|
|
7
|
+
callback: "",
|
|
8
|
+
disabled: false,
|
|
9
|
+
name: "search",
|
|
10
|
+
placeholder: "Search Field",
|
|
11
|
+
type: "search",
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const searchfielderror: SearchFieldProps = {
|
|
16
|
+
action: "",
|
|
17
|
+
callback: "",
|
|
18
|
+
input: {
|
|
19
|
+
callback: "",
|
|
20
|
+
disabled: false,
|
|
21
|
+
error: "Error message",
|
|
22
|
+
name: "search",
|
|
23
|
+
placeholder: "Search Field",
|
|
24
|
+
type: "search",
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const searchfielddisabled: SearchFieldProps = {
|
|
29
|
+
action: "",
|
|
30
|
+
callback: "",
|
|
31
|
+
input: {
|
|
32
|
+
callback: "",
|
|
33
|
+
disabled: true,
|
|
34
|
+
name: "search",
|
|
35
|
+
placeholder: "Search Field",
|
|
36
|
+
type: "search",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const searchfieldlabel: SearchFieldProps = {
|
|
41
|
+
action: "",
|
|
42
|
+
callback: "",
|
|
43
|
+
input: {
|
|
44
|
+
label: "Search Field",
|
|
45
|
+
name: "search",
|
|
46
|
+
placeholder: "Search Field",
|
|
47
|
+
type: "search",
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const searchfieldhelper: SearchFieldProps = {
|
|
52
|
+
action: "",
|
|
53
|
+
callback: "",
|
|
54
|
+
input: {
|
|
55
|
+
helper: "Search Field Helper text",
|
|
56
|
+
name: "search",
|
|
57
|
+
placeholder: "Search Field",
|
|
58
|
+
type: "search",
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Sample prop definitions for SearchField's enumerable properties (imported in stories and test)
|
|
64
|
+
*/
|
|
65
|
+
const SearchFieldArgs = {
|
|
66
|
+
searchfield,
|
|
67
|
+
searchfielderror,
|
|
68
|
+
searchfielddisabled,
|
|
69
|
+
searchfieldlabel,
|
|
70
|
+
searchfieldhelper,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default SearchFieldArgs;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { InputProps } from "../Input.props";
|
|
2
|
+
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* The button's label.
|
|
6
|
+
*/
|
|
7
|
+
label: Required<string>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SearchFieldProps {
|
|
11
|
+
/**
|
|
12
|
+
* Specify the action attribute for the search form
|
|
13
|
+
*/
|
|
14
|
+
action?: Required<string>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Specify the properties of the submit button
|
|
18
|
+
*/
|
|
19
|
+
button?: Required<ButtonProps>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The search field submit button's click function.
|
|
23
|
+
*/
|
|
24
|
+
callback: function;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Specify an optional className to be added to your Button.
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Specify the properties of the search field input
|
|
33
|
+
*/
|
|
34
|
+
input?: Required<InputProps>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import useGlobalSettings from "../../hooks/useGlobalSettings";
|
|
4
|
+
import { SearchFieldProps } from "./SearchField.props";
|
|
5
|
+
import { Input } from "../Input";
|
|
6
|
+
|
|
7
|
+
const SearchField: FC<SearchFieldProps> = ({
|
|
8
|
+
action,
|
|
9
|
+
callback,
|
|
10
|
+
className,
|
|
11
|
+
input,
|
|
12
|
+
}) => {
|
|
13
|
+
const { prefix } = useGlobalSettings();
|
|
14
|
+
const baseClass = `${prefix}--searchfield`;
|
|
15
|
+
const buttonClass = `${baseClass}--button`;
|
|
16
|
+
|
|
17
|
+
const SearchFieldClasses = classNames(className, {
|
|
18
|
+
[baseClass]: true,
|
|
19
|
+
[`haslabel`]: input.label,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* On click, if there is a callback, call it
|
|
24
|
+
*/
|
|
25
|
+
const handleClick = (e: React.MouseEvent<Element, MouseEvent>) => {
|
|
26
|
+
if (callback) {
|
|
27
|
+
callback(e);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<form className={SearchFieldClasses} action={action}>
|
|
33
|
+
<Input
|
|
34
|
+
id={input.id}
|
|
35
|
+
name={input.name}
|
|
36
|
+
disabled={input.disabled}
|
|
37
|
+
callback={input.callback}
|
|
38
|
+
error={input.error}
|
|
39
|
+
helper={input.helper}
|
|
40
|
+
label={input.label}
|
|
41
|
+
placeholder={input.placeholder}
|
|
42
|
+
type={input.type}
|
|
43
|
+
className={`${prefix}--input`}
|
|
44
|
+
/>
|
|
45
|
+
<input
|
|
46
|
+
className={buttonClass}
|
|
47
|
+
disabled={input.disabled}
|
|
48
|
+
type="submit"
|
|
49
|
+
onClick={(e) => handleClick(e)}
|
|
50
|
+
/>
|
|
51
|
+
</form>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default SearchField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SearchField } from "./SearchField";
|