trepur_components 2.3.3 → 2.3.4
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.cjs +43 -0
- package/.husky/pre-commit +4 -0
- package/.prettierrc.json +22 -0
- package/archive/Breadcrumbs/Breadcrumbs.stories.tsx +46 -0
- package/archive/Breadcrumbs/index.tsx +42 -0
- package/archive/BreadcrumbsBordered/BreadcrumbsBordered.stories.tsx +52 -0
- package/archive/BreadcrumbsBordered/index.tsx +44 -0
- package/archive/BreadcrumbsItem/BreadcrumbsItem.stories.tsx +40 -0
- package/archive/BreadcrumbsItem/index.tsx +149 -0
- package/archive/Button/Button.stories.tsx +150 -0
- package/archive/Button/index.tsx +111 -0
- package/archive/Button/style.module.css +76 -0
- package/archive/Calendar/Calendar.stories.tsx +82 -0
- package/archive/Calendar/index.tsx +76 -0
- package/archive/Calendar/style.css +233 -0
- package/archive/Card/Card.stories.tsx +75 -0
- package/archive/Card/index.tsx +102 -0
- package/archive/Card/style.module.css +75 -0
- package/archive/CardWithTopImage/CardWithTopImage.stories.tsx +50 -0
- package/archive/CardWithTopImage/index.tsx +39 -0
- package/archive/CardWithTopImage/style.module.css +11 -0
- package/archive/Carousel/Carousel.stories.tsx +451 -0
- package/archive/Carousel/index.tsx +388 -0
- package/archive/Carousel/style.module.css +99 -0
- package/archive/CarouselThumbnail/CarouselThumbnail.stories.tsx +350 -0
- package/archive/CarouselThumbnail/index.tsx +302 -0
- package/archive/CarouselThumbnail/style.module.css +67 -0
- package/archive/Checkbox/Checkbox.mdx +33 -0
- package/archive/Checkbox/Checkbox.stories.tsx +34 -0
- package/archive/Checkbox/index.tsx +51 -0
- package/archive/Checkbox/style.module.css +15 -0
- package/archive/Collapsible/Collapsible.stories.tsx +67 -0
- package/archive/Collapsible/index.tsx +116 -0
- package/archive/Collapsible/style.module.css +47 -0
- package/archive/Column/Column.stories.tsx +89 -0
- package/archive/Column/index.tsx +119 -0
- package/archive/Column/style.module.css +151 -0
- package/archive/ComponentWrapper/ComponentWrapper.stories.tsx +40 -0
- package/archive/ComponentWrapper/index.tsx +55 -0
- package/archive/ComponentWrapper/style.module.css +40 -0
- package/archive/Container/Container.stories.tsx +40 -0
- package/archive/Container/index.tsx +24 -0
- package/archive/Container/style.module.css +4 -0
- package/archive/Counter/Counter.stories.tsx +19 -0
- package/archive/Counter/index.tsx +66 -0
- package/archive/Counter/style.module.css +19 -0
- package/archive/DetailUpdater/DetailUpdater.stories.tsx +96 -0
- package/archive/DetailUpdater/index.tsx +112 -0
- package/archive/DetailUpdater/style.module.css +31 -0
- package/archive/Dialog/Dialog.stories.tsx +131 -0
- package/archive/Dialog/index.tsx +91 -0
- package/archive/Dialog/style.module.css +44 -0
- package/archive/DropdownMenu/DropdownMenu.stories.tsx +59 -0
- package/archive/DropdownMenu/index.tsx +51 -0
- package/archive/DropdownMenu/style.module.css +38 -0
- package/archive/DynamicTextSection/DynamicTextSection.stories.tsx +74 -0
- package/archive/DynamicTextSection/index.tsx +36 -0
- package/archive/DynamicTextSection/style.module.css +0 -0
- package/archive/FileUploader/FilePreview.tsx +48 -0
- package/archive/FileUploader/FileUploader.stories.tsx +28 -0
- package/archive/FileUploader/index.tsx +135 -0
- package/archive/FileUploader/style.module.css +54 -0
- package/archive/FilterItem/FilterItem.stories.tsx +33 -0
- package/archive/FilterItem/index.tsx +101 -0
- package/archive/FilterItem/style.module.css +27 -0
- package/archive/Footer/Footer.stories.tsx +59 -0
- package/archive/Footer/index.tsx +50 -0
- package/archive/Footer/style.module.css +19 -0
- package/archive/FooterNav/FooterNav.stories.tsx +125 -0
- package/archive/FooterNav/index.tsx +57 -0
- package/archive/FooterNav/style.module.css +32 -0
- package/archive/FooterNavItem/FooterNavItem.stories.tsx +53 -0
- package/archive/FooterNavItem/index.tsx +80 -0
- package/archive/FooterNavItem/style.module.css +139 -0
- package/archive/Form/Form.stories.tsx +86 -0
- package/archive/Form/index.tsx +61 -0
- package/archive/Form/style.module.css +0 -0
- package/archive/FyreCard/FyreCard.stories.tsx +31 -0
- package/archive/FyreCard/index.tsx +52 -0
- package/archive/FyreCard/style.module.css +19 -0
- package/archive/Greeting/Greeting.stories.tsx +41 -0
- package/archive/Greeting/index.tsx +32 -0
- package/archive/HamburgerIcon/HamburgerIcon.stories.tsx +32 -0
- package/archive/HamburgerIcon/index.tsx +103 -0
- package/archive/HamburgerIcon/style.module.css +85 -0
- package/archive/HorizontalLine/HorizontalLine.stories.tsx +54 -0
- package/archive/HorizontalLine/index.tsx +40 -0
- package/archive/HorizontalLine/style.module.css +55 -0
- package/archive/Icon/Icon.stories.tsx +164 -0
- package/archive/Icon/index.tsx +115 -0
- package/archive/Icon/style.module.css +253 -0
- package/archive/IconCard/IconCard.stories.tsx +46 -0
- package/archive/IconCard/index.tsx +57 -0
- package/archive/IconCard/style.module.css +18 -0
- package/archive/Image/Image.stories.tsx +87 -0
- package/archive/Image/index.tsx +132 -0
- package/archive/Image/style.module.css +109 -0
- package/archive/ImageInfo/ImageInfo.stories.tsx +39 -0
- package/archive/ImageInfo/index.tsx +95 -0
- package/archive/ImageInfo/style.module.css +47 -0
- package/archive/ImageLink/ImageLink.stories.tsx +37 -0
- package/archive/ImageLink/index.tsx +49 -0
- package/archive/ImageLink/style.module.css +23 -0
- package/archive/ImageLinkList/ImageLinkList.stories.tsx +34 -0
- package/archive/ImageLinkList/index.tsx +33 -0
- package/archive/ImageLinkList/style.module.css +3 -0
- package/archive/InformationIcon/InformationIcon.stories.tsx +83 -0
- package/archive/InformationIcon/index.tsx +128 -0
- package/archive/InformationIcon/style.module.css +71 -0
- package/archive/InformationIconBlock/InformationIconBlock.stories.tsx +32 -0
- package/archive/InformationIconBlock/index.tsx +63 -0
- package/archive/InformationIconBlock/style.module.css +7 -0
- package/archive/Input/Input.stories.tsx +84 -0
- package/archive/Input/index.tsx +131 -0
- package/archive/Input/style.module.css +60 -0
- package/archive/Jumbotron/Jumbotron.stories.tsx +21 -0
- package/archive/Jumbotron/index.tsx +31 -0
- package/archive/Jumbotron/style.module.css +8 -0
- package/archive/MenuButton/MenuButton.stories.tsx +46 -0
- package/archive/MenuButton/index.tsx +82 -0
- package/archive/MenuButton/style.module.css +45 -0
- package/archive/Modal/Modal.stories.tsx +86 -0
- package/archive/Modal/index.tsx +74 -0
- package/archive/Modal/style.module.css +35 -0
- package/archive/NavItem/NavItem.stories.tsx +90 -0
- package/archive/NavItem/index.tsx +65 -0
- package/archive/NavItem/style.module.css +71 -0
- package/archive/NavOld/NavOld.stories.tsx +193 -0
- package/archive/NavOld/StickyNav.tsx +191 -0
- package/archive/NavOld/index.tsx +273 -0
- package/archive/NavOld/style.module.css +156 -0
- package/archive/NavTwo/Dropdown.tsx +35 -0
- package/archive/NavTwo/Nav.stories.tsx +38 -0
- package/archive/NavTwo/Sidebar.tsx +34 -0
- package/archive/NavTwo/StickyNav.tsx +34 -0
- package/archive/NavTwo/index.tsx +45 -0
- package/archive/NavTwo/style.module.css +35 -0
- package/archive/NewsCard/NewsCard.stories.tsx +72 -0
- package/archive/NewsCard/index.tsx +57 -0
- package/archive/NewsCard/style.module.css +15 -0
- package/archive/Pill/Pill.stories.tsx +44 -0
- package/archive/Pill/index.tsx +64 -0
- package/archive/Pill/style.module.css +32 -0
- package/archive/ProductCard/ProductCard.stories.tsx +61 -0
- package/archive/ProductCard/index.tsx +111 -0
- package/archive/ProductCard/style.module.css +53 -0
- package/archive/ProductCardV2/ProductCardV2.stories.tsx +50 -0
- package/archive/ProductCardV2/index.tsx +119 -0
- package/archive/ProductCardV2/style.module.css +59 -0
- package/archive/Proficiencies/Proficiencies.stories.tsx +50 -0
- package/archive/Proficiencies/index.tsx +63 -0
- package/archive/Proficiencies/style.module.css +31 -0
- package/archive/Profile/Profile.stories.tsx +49 -0
- package/archive/Profile/index.tsx +103 -0
- package/archive/Profile/style.module.css +47 -0
- package/archive/Row/Row.stories.tsx +53 -0
- package/archive/Row/index.tsx +23 -0
- package/archive/Row/style.module.css +3 -0
- package/archive/Search/Search.stories.tsx +63 -0
- package/archive/Search/index.tsx +68 -0
- package/archive/Search/style.module.css +23 -0
- package/archive/Select/Select.stories.tsx +56 -0
- package/archive/Select/index.tsx +106 -0
- package/archive/Select/style.module.css +52 -0
- package/archive/Showcase/Showcase.stories.tsx +30 -0
- package/archive/Showcase/index.tsx +75 -0
- package/archive/Showcase/style.module.css +47 -0
- package/archive/SideNav/SideNav.stories.tsx +50 -0
- package/archive/SideNav/index.tsx +46 -0
- package/archive/SideNav/style.module.css +43 -0
- package/archive/SocialBlock/SocialBlock.stories.tsx +58 -0
- package/archive/SocialBlock/index.tsx +63 -0
- package/archive/SocialButton/SocialButton.stories.tsx +88 -0
- package/archive/SocialButton/index.tsx +71 -0
- package/archive/SocialButton/style.module.css +77 -0
- package/archive/StarRating/StarRating.stories.tsx +23 -0
- package/archive/StarRating/index.tsx +71 -0
- package/archive/Testimonial/Testimonial.stories.tsx +110 -0
- package/archive/Testimonial/index.tsx +61 -0
- package/archive/Testimonial/style.module.css +27 -0
- package/archive/TextAndTitle/TextAndTitle.stories.tsx +70 -0
- package/archive/TextAndTitle/index.tsx +123 -0
- package/archive/TextAndTitle/style.module.css +75 -0
- package/archive/TextArea/TextArea.stories.tsx +55 -0
- package/archive/TextArea/index.tsx +125 -0
- package/archive/TextArea/style.module.css +60 -0
- package/archive/Timeline/Timeline.stories.tsx +92 -0
- package/archive/Timeline/index.tsx +254 -0
- package/archive/Timeline/style.module.css +134 -0
- package/archive/TimelineV2/TimelineV2.stories.tsx +95 -0
- package/archive/TimelineV2/index.tsx +70 -0
- package/archive/TimelineV2/style.module.css +28 -0
- package/archive/Tubestops/Tubestops.stories.tsx +42 -0
- package/archive/Tubestops/index.tsx +58 -0
- package/archive/Tubestops/style.module.css +54 -0
- package/archive/UserIcon/UserIcon.stories.tsx +52 -0
- package/archive/UserIcon/index.tsx +46 -0
- package/archive/UserIcon/style.module.css +19 -0
- package/archive/Video/Video.stories.tsx +23 -0
- package/archive/Video/index.tsx +47 -0
- package/archive/fonts/Sora/OFL.txt +93 -0
- package/archive/fonts/Sora/README.txt +70 -0
- package/archive/fonts/Sora/Sora-VariableFont_wght.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-Bold.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-ExtraBold.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-ExtraLight.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-Light.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-Medium.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-Regular.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-SemiBold.ttf +0 -0
- package/archive/fonts/Sora/static/Sora-Thin.ttf +0 -0
- package/archive/theme.ts +39 -0
- package/archive/typography/Fonts/Fonts.stories.tsx +14 -0
- package/archive/typography/Fonts/Fonts.tsx +181 -0
- package/lib/components/Accordion/index.js +10 -10
- package/lib/components/AlertBar/index.js +10 -10
- package/lib/components/index.d.ts +4 -0
- package/lib/index.js +1 -7
- package/package.json +6 -8
- package/src/components/Accordion/Accordion.stories.tsx +116 -0
- package/src/components/Accordion/index.tsx +30 -0
- package/src/components/AlertBar/AlertBar.stories.tsx +95 -0
- package/src/components/AlertBar/index.tsx +115 -0
- package/src/components/Avatar/Avatar.stories.tsx +19 -0
- package/src/components/Avatar/index.tsx +495 -0
- package/src/components/index.ts +119 -0
- package/src/documentation/Colours.mdx +192 -0
- package/src/documentation/Introduction.mdx +9 -0
- package/src/index.ts +1 -0
- package/src/styles/base.css +116 -0
- package/src/utils/controls.ts +44 -0
- package/src/utils/matchMedia.ts +9 -0
- package/src/utils/screens.ts +7 -0
- package/storybook-build/assets/Accordion.stories-Cn994N1H.js +103 -0
- package/storybook-build/assets/AlertBar.stories-BkzNXFBh.js +202 -0
- package/storybook-build/assets/Avatar.stories-CpH6xVwM.js +418 -0
- package/storybook-build/assets/Color-6VNJS4EI-DQV2onvt.js +1378 -0
- package/storybook-build/assets/Colours-r29qjFlW.js +324 -0
- package/storybook-build/assets/DocsRenderer-NNNQARDV-OgWasCIs.js +44 -0
- package/storybook-build/assets/Introduction-Bs1PgnBZ.js +40 -0
- package/storybook-build/assets/WithTooltip-V3YHNWJZ-vi2V5TOO.js +15 -0
- package/storybook-build/assets/_commonjsHelpers-LQfde5yM.js +35 -0
- package/storybook-build/assets/axe-DnFZVv9V.js +32561 -0
- package/storybook-build/assets/chunk-EIRT5I3Z-DFD8udmD.js +480 -0
- package/storybook-build/assets/context-CIRBAiUz.js +20 -0
- package/storybook-build/assets/controls-DJSGrQKd.js +23 -0
- package/storybook-build/assets/entry-preview-DmlPV4-3.js +41 -0
- package/storybook-build/assets/entry-preview-docs-D46Drugi.js +11861 -0
- package/storybook-build/assets/formatter-SWP5E3XI-BWIasvKP.js +14427 -0
- package/storybook-build/assets/iframe-Dzzzanqi.js +144 -0
- package/storybook-build/assets/index-0FT4HXk-.js +7222 -0
- package/storybook-build/assets/index-B9Tccxv4.js +107 -0
- package/storybook-build/assets/index-BdOSk9or.js +41 -0
- package/storybook-build/assets/index-CU7cYjZD.js +9604 -0
- package/storybook-build/assets/index-Clz-aGG3.js +39 -0
- package/storybook-build/assets/index-CpyNLP69.js +63 -0
- package/storybook-build/assets/index-DM9bPmif.js +319 -0
- package/storybook-build/assets/index-ex9_VrIg.js +3734 -0
- package/storybook-build/assets/jsx-runtime-D2-sc1j1.js +35 -0
- package/storybook-build/assets/preview-3kSipVgK.js +430 -0
- package/storybook-build/assets/preview-B4rAxPmB.js +27 -0
- package/storybook-build/assets/preview-BMkwWyrh.js +2920 -0
- package/storybook-build/assets/preview-BeQelhbu.js +204 -0
- package/storybook-build/assets/preview-BiG-rflf.js +2444 -0
- package/storybook-build/assets/preview-BiYUJ7TP.js +22 -0
- package/storybook-build/assets/preview-C4ItOQzM.js +34 -0
- package/storybook-build/assets/preview-CWyhKACi.css +886 -0
- package/storybook-build/assets/preview-CtOV68TG.js +10 -0
- package/storybook-build/assets/preview-De9E9xaR.js +140 -0
- package/storybook-build/assets/preview-bL4x2zrN.js +99 -0
- package/storybook-build/assets/preview-gxqyGMHu.js +323 -0
- package/storybook-build/assets/react-18-B-gfo82w.js +29 -0
- package/storybook-build/assets/syntaxhighlighter-B5GMVT5T-DrY_Dc6-.js +15 -0
- package/storybook-build/favicon.svg +7 -0
- package/storybook-build/iframe.html +458 -0
- package/storybook-build/index.html +163 -0
- package/storybook-build/index.json +1 -0
- package/storybook-build/preview-stats.json +172 -0
- package/storybook-build/project.json +1 -0
- package/storybook-build/sb-addons/a11y-9/manager-bundle.js +3 -0
- package/storybook-build/sb-addons/a11y-9/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-build/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-build/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-build/sb-addons/essentials-backgrounds-3/manager-bundle.js +12 -0
- package/storybook-build/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-build/sb-addons/essentials-controls-1/manager-bundle.js +63 -0
- package/storybook-build/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +18 -0
- package/storybook-build/sb-addons/essentials-measure-6/manager-bundle.js +3 -0
- package/storybook-build/sb-addons/essentials-measure-6/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-build/sb-addons/essentials-outline-7/manager-bundle.js +3 -0
- package/storybook-build/sb-addons/essentials-outline-7/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-build/sb-addons/essentials-toolbars-5/manager-bundle.js +3 -0
- package/storybook-build/sb-addons/essentials-toolbars-5/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-build/sb-addons/essentials-viewport-4/manager-bundle.js +3 -0
- package/storybook-build/sb-addons/essentials-viewport-4/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-build/sb-addons/interactions-8/manager-bundle.js +12 -0
- package/storybook-build/sb-addons/interactions-8/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-build/sb-addons/links-0/manager-bundle.js +3 -0
- package/storybook-build/sb-addons/links-0/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-build/sb-addons/storybook-12/manager-bundle.js +151 -0
- package/storybook-build/sb-addons/storybook-12/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-build/sb-addons/storybook-react-i18next-11/manager-bundle.js +3 -0
- package/storybook-build/sb-addons/storybook-react-i18next-11/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-build/sb-addons/themes-10/register-bundle.js +5 -0
- package/storybook-build/sb-addons/themes-10/register-bundle.js.LEGAL.txt +0 -0
- package/storybook-build/sb-common-assets/fonts.css +31 -0
- package/storybook-build/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-build/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-build/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-build/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-build/sb-manager/WithTooltip-V3YHNWJZ-TRLNWEGW.js +1 -0
- package/storybook-build/sb-manager/chunk-4IYAVH3S.js +348 -0
- package/storybook-build/sb-manager/chunk-CXYKRFSY.js +9 -0
- package/storybook-build/sb-manager/chunk-KZYAAUOR.js +406 -0
- package/storybook-build/sb-manager/chunk-LVLAH4SI.js +7 -0
- package/storybook-build/sb-manager/chunk-ZEU7PDD3.js +1 -0
- package/storybook-build/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js +156 -0
- package/storybook-build/sb-manager/globals-module-info.js +1 -0
- package/storybook-build/sb-manager/globals.js +1 -0
- package/storybook-build/sb-manager/index.js +1 -0
- package/storybook-build/sb-manager/runtime.js +1 -0
- package/storybook-build/sb-manager/syntaxhighlighter-B5GMVT5T-EA5ASEYD.js +1 -0
- package/storybook-build/sb-preview/globals.js +1 -0
- package/storybook-build/sb-preview/runtime.js +112 -0
- package/storybook-build/src/components/Accordion/Accordion.stories.d.ts +94 -0
- package/storybook-build/src/components/Accordion/index.d.ts +9 -0
- package/storybook-build/src/components/AlertBar/AlertBar.stories.d.ts +162 -0
- package/storybook-build/src/components/AlertBar/index.d.ts +13 -0
- package/storybook-build/src/components/Avatar/Avatar.stories.d.ts +44 -0
- package/storybook-build/src/components/Avatar/index.d.ts +4 -0
- package/storybook-build/src/index.d.ts +1 -0
- package/storybook-build/src/utils/controls.d.ts +36 -0
- package/storybook-build/src/utils/matchMedia.d.ts +2 -0
- package/storybook-build/src/utils/screens.d.ts +7 -0
- package/storybook-build/src/utils/theme.d.ts +3 -0
- package/storybook-build/stories.json +1 -0
- package/storybook-build/styles/base.css +116 -0
- package/svg.d.ts +4 -0
- package/tailwind.config.ts +81 -0
- package/tsconfig.json +43 -0
- package/tsconfig.node.json +12 -0
- package/vite.config.mjs +64 -0
- package/lib/archive/Breadcrumbs/index.js +0 -12
- package/lib/archive/BreadcrumbsBordered/index.js +0 -25
- package/lib/archive/BreadcrumbsItem/index.js +0 -117
- /package/lib/{src/components → components}/Accordion/Accordion.stories.d.ts +0 -0
- /package/lib/{src/components → components}/Accordion/index.d.ts +0 -0
- /package/lib/{src/components → components}/AlertBar/AlertBar.stories.d.ts +0 -0
- /package/lib/{src/components → components}/AlertBar/index.d.ts +0 -0
- /package/lib/{src/components → components}/Avatar/Avatar.stories.d.ts +0 -0
- /package/lib/{src/components → components}/Avatar/index.d.ts +0 -0
- /package/lib/{src/index.d.ts → index.d.ts} +0 -0
- /package/lib/{src/utils → utils}/controls.d.ts +0 -0
- /package/lib/{src/utils → utils}/matchMedia.d.ts +0 -0
- /package/lib/{src/utils → utils}/screens.d.ts +0 -0
- /package/{lib → storybook-build}/src/components/index.d.ts +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { idAndClassName } from '@utils/controls';
|
|
3
|
+
|
|
4
|
+
import Search from '.';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/Search',
|
|
8
|
+
component: Search,
|
|
9
|
+
parameters: {},
|
|
10
|
+
argTypes: {
|
|
11
|
+
...idAndClassName,
|
|
12
|
+
leftIconProps: {
|
|
13
|
+
description:
|
|
14
|
+
'An optional param to display an icon to the left of the search bar',
|
|
15
|
+
control: 'text',
|
|
16
|
+
table: {
|
|
17
|
+
category: '',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
rightIconProps: {
|
|
21
|
+
description:
|
|
22
|
+
'An optional param to display an icon to the right of the search bar',
|
|
23
|
+
control: 'text',
|
|
24
|
+
table: {
|
|
25
|
+
category: '',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
placeholder: {
|
|
29
|
+
description:
|
|
30
|
+
'An optional param to display a placeholder inside the search box',
|
|
31
|
+
control: 'text',
|
|
32
|
+
table: {
|
|
33
|
+
category: '',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
text: {
|
|
37
|
+
description:
|
|
38
|
+
'An optional param to display a label on the left of the search bar',
|
|
39
|
+
control: 'text',
|
|
40
|
+
table: {
|
|
41
|
+
category: '',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
args: {
|
|
46
|
+
placeholder: 'search...',
|
|
47
|
+
leftIconProps: {
|
|
48
|
+
type: 'heart',
|
|
49
|
+
className: 'absolute mt-2 left-3 flex items-center',
|
|
50
|
+
bgColour: 'white',
|
|
51
|
+
},
|
|
52
|
+
rightIconProps: {
|
|
53
|
+
type: 'heart',
|
|
54
|
+
className: 'absolute mt-2 right-3 flex items-center',
|
|
55
|
+
bgColour: 'white',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
export default meta;
|
|
60
|
+
|
|
61
|
+
type Story = StoryObj<typeof meta>;
|
|
62
|
+
|
|
63
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { ChangeEventHandler } from 'react';
|
|
2
|
+
|
|
3
|
+
import Icon, { type Props as iconProps } from '@components/Icon';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export interface Props {
|
|
9
|
+
id?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
onChange?: (val: string | number) => void;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
text?: string;
|
|
14
|
+
leftIconProps?: iconProps;
|
|
15
|
+
rightIconProps?: iconProps;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Search = ({
|
|
19
|
+
id,
|
|
20
|
+
className,
|
|
21
|
+
onChange,
|
|
22
|
+
placeholder,
|
|
23
|
+
text,
|
|
24
|
+
leftIconProps,
|
|
25
|
+
rightIconProps,
|
|
26
|
+
}: Props): JSX.Element => {
|
|
27
|
+
const classList = classNames(className, style.classList, 'theme-local');
|
|
28
|
+
|
|
29
|
+
const inputClasses = classNames(
|
|
30
|
+
{
|
|
31
|
+
[style.leftIcon]: leftIconProps !== undefined,
|
|
32
|
+
[style.noLeftIcon]: leftIconProps === undefined,
|
|
33
|
+
},
|
|
34
|
+
style.inputClassList,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const onChangeFunc: ChangeEventHandler<HTMLInputElement> | undefined =
|
|
38
|
+
onChange != null
|
|
39
|
+
? (e: any) => {
|
|
40
|
+
onChange(e.target.value);
|
|
41
|
+
}
|
|
42
|
+
: undefined;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div id={id} className={classList}>
|
|
46
|
+
<div>
|
|
47
|
+
{text !== undefined && (
|
|
48
|
+
<h2 className={classNames(style.text, 'font-base-lg')}>{text}</h2>
|
|
49
|
+
)}
|
|
50
|
+
</div>
|
|
51
|
+
<div>
|
|
52
|
+
<div className={style.inputWrapper}>
|
|
53
|
+
{leftIconProps !== undefined && <Icon {...leftIconProps} />}
|
|
54
|
+
<input
|
|
55
|
+
className={inputClasses}
|
|
56
|
+
onChange={onChangeFunc}
|
|
57
|
+
placeholder={placeholder}
|
|
58
|
+
type="text"
|
|
59
|
+
name="search"
|
|
60
|
+
/>
|
|
61
|
+
{rightIconProps !== undefined && <Icon {...rightIconProps} />}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default Search;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.classList {
|
|
2
|
+
@apply flex;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.inputClassList {
|
|
6
|
+
@apply w-full rounded-md border-2 py-2 pr-9;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.leftIcon {
|
|
10
|
+
@apply pl-9;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.noLeftIcon {
|
|
14
|
+
@apply pl-2;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.text {
|
|
18
|
+
@apply py-2 pr-4;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.inputWrapper {
|
|
22
|
+
@apply relative flex w-full;
|
|
23
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { idAndClassName } from '@utils/controls';
|
|
3
|
+
|
|
4
|
+
import Select from '.';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/Select',
|
|
8
|
+
component: Select,
|
|
9
|
+
parameters: {},
|
|
10
|
+
argTypes: {
|
|
11
|
+
...idAndClassName,
|
|
12
|
+
|
|
13
|
+
label: {
|
|
14
|
+
description: '',
|
|
15
|
+
control: 'text',
|
|
16
|
+
table: {
|
|
17
|
+
category: '',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
label: 'This is a label',
|
|
23
|
+
options: [
|
|
24
|
+
'Option 1',
|
|
25
|
+
'Option 2',
|
|
26
|
+
'Option 3',
|
|
27
|
+
'Option 4',
|
|
28
|
+
'Option 1',
|
|
29
|
+
'Option 2',
|
|
30
|
+
'Option 3',
|
|
31
|
+
'Option 4',
|
|
32
|
+
'Option 1',
|
|
33
|
+
'Option 2',
|
|
34
|
+
'Option 3',
|
|
35
|
+
'Option 4',
|
|
36
|
+
'Option 1',
|
|
37
|
+
'Option 2',
|
|
38
|
+
'Option 3',
|
|
39
|
+
'Option 4',
|
|
40
|
+
'Option 1',
|
|
41
|
+
'Option 2',
|
|
42
|
+
'Option 3',
|
|
43
|
+
'Option 4',
|
|
44
|
+
'Option 1',
|
|
45
|
+
'Option 2',
|
|
46
|
+
'Option 3',
|
|
47
|
+
'Option 4',
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default meta;
|
|
53
|
+
|
|
54
|
+
type Story = StoryObj<typeof meta>;
|
|
55
|
+
|
|
56
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import Icon from '@components/Icon';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
id?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
options: string[];
|
|
12
|
+
label: string;
|
|
13
|
+
value?: string;
|
|
14
|
+
onClick?: any;
|
|
15
|
+
fullWidth?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const Select: React.FC<Props> = ({
|
|
20
|
+
id,
|
|
21
|
+
className,
|
|
22
|
+
options,
|
|
23
|
+
value,
|
|
24
|
+
label,
|
|
25
|
+
onClick,
|
|
26
|
+
required = false,
|
|
27
|
+
fullWidth = false,
|
|
28
|
+
}) => {
|
|
29
|
+
const [showDropDown, setShowDropDown] = useState(false);
|
|
30
|
+
const [activeValue, setActiveValue] = useState(
|
|
31
|
+
value !== undefined ? value : options?.[0],
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const handleOptionClick = (e: any): void => {
|
|
35
|
+
onClick(e.target.textContent);
|
|
36
|
+
setActiveValue(e.target.textContent);
|
|
37
|
+
setShowDropDown(false);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const fullWidthClasses = classNames({
|
|
41
|
+
[style.fullWidth]: fullWidth,
|
|
42
|
+
[style.notFullWidth]: !fullWidth,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const headerClassList = classNames(
|
|
46
|
+
fullWidthClasses,
|
|
47
|
+
style.classList,
|
|
48
|
+
className,
|
|
49
|
+
'theme-local',
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const dropdownClassList = classNames(
|
|
53
|
+
fullWidthClasses,
|
|
54
|
+
style.optionList,
|
|
55
|
+
'theme-local',
|
|
56
|
+
);
|
|
57
|
+
const dropdownItemClassList = classNames(style.option, 'theme-local');
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
<div
|
|
62
|
+
id={id}
|
|
63
|
+
className={headerClassList}
|
|
64
|
+
onClick={() => {
|
|
65
|
+
setShowDropDown(!showDropDown);
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<div className={style.labelContainer}>
|
|
69
|
+
<div className={style.labelWrapper}>
|
|
70
|
+
<p className={style.label}>{label}</p>
|
|
71
|
+
{required && <p className={style.required}> *</p>}
|
|
72
|
+
</div>
|
|
73
|
+
<p className={style.value}>{activeValue}</p>
|
|
74
|
+
</div>
|
|
75
|
+
<Icon
|
|
76
|
+
className={style.icon}
|
|
77
|
+
bgColour="white"
|
|
78
|
+
colour="ink"
|
|
79
|
+
hoverBgColour="white"
|
|
80
|
+
hoverColour="ink"
|
|
81
|
+
type="chevron-down"
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
{showDropDown && (
|
|
85
|
+
<div className={classNames(style.dropdownWrapper, fullWidthClasses)}>
|
|
86
|
+
<ul className={dropdownClassList}>
|
|
87
|
+
{options?.map((option: string, i) => (
|
|
88
|
+
<li
|
|
89
|
+
key={`key_${i}`}
|
|
90
|
+
className={dropdownItemClassList}
|
|
91
|
+
value={option}
|
|
92
|
+
onClick={(e) => {
|
|
93
|
+
handleOptionClick(e);
|
|
94
|
+
}}
|
|
95
|
+
>
|
|
96
|
+
{option}
|
|
97
|
+
</li>
|
|
98
|
+
))}
|
|
99
|
+
</ul>
|
|
100
|
+
</div>
|
|
101
|
+
)}
|
|
102
|
+
</>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export default Select;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.classList {
|
|
2
|
+
@apply w-full rounded-xl bg-white;
|
|
3
|
+
@apply shadow drop-shadow;
|
|
4
|
+
@apply flex cursor-pointer flex-row justify-between px-4;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.fullWidth {
|
|
8
|
+
@apply w-full;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.notFullWidth {
|
|
12
|
+
@apply sm:w-72;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.labelContainer {
|
|
16
|
+
@apply flex flex-col;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.labelWrapper {
|
|
20
|
+
@apply absolute mt-2 flex bg-white text-xs font-thin;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.required {
|
|
24
|
+
@apply font-semiBold text-error;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.value {
|
|
28
|
+
@apply rounded-xl border-ink bg-white pb-1 pt-6 text-ink;
|
|
29
|
+
@apply flex justify-between;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.icon {
|
|
33
|
+
@apply my-auto;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.dropdownWrapper {
|
|
37
|
+
@apply relative z-20;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.optionList {
|
|
41
|
+
@apply absolute w-full bg-white;
|
|
42
|
+
@apply mt-2 rounded-2xl py-4;
|
|
43
|
+
@apply shadow-xl;
|
|
44
|
+
@apply border border-lightest-grey;
|
|
45
|
+
@apply h-64 overflow-scroll;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.option {
|
|
49
|
+
@apply bg-white text-ink hover:bg-lightest-grey;
|
|
50
|
+
@apply hover:cursor-pointer;
|
|
51
|
+
@apply px-4 py-2;
|
|
52
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { idAndClassName } from '@utils/controls';
|
|
4
|
+
|
|
5
|
+
import Showcase from '.';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/Showcase',
|
|
9
|
+
component: Showcase,
|
|
10
|
+
argTypes: {
|
|
11
|
+
...idAndClassName,
|
|
12
|
+
},
|
|
13
|
+
args: {
|
|
14
|
+
title: 'This is a title',
|
|
15
|
+
subTitle: 'This is a subtitle',
|
|
16
|
+
description: 'This is a description',
|
|
17
|
+
bgColour: 'white',
|
|
18
|
+
size: 'large',
|
|
19
|
+
iconProps: {
|
|
20
|
+
type: 'chevron-down',
|
|
21
|
+
onClick: action('Icon click'),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
|
|
30
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Avatar from '@components/Avatar';
|
|
4
|
+
import ComponentWrapper from '@components/ComponentWrapper';
|
|
5
|
+
import Container from '@components/Container';
|
|
6
|
+
import Icon, { type Props as iconProps } from '@components/Icon';
|
|
7
|
+
import { type Colours } from '@utils/controls';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export interface Props {
|
|
13
|
+
id: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
title: string;
|
|
16
|
+
subTitle: string;
|
|
17
|
+
description: string;
|
|
18
|
+
bgColour?: Colours;
|
|
19
|
+
image: string;
|
|
20
|
+
|
|
21
|
+
size?: 'small' | 'medium' | 'large';
|
|
22
|
+
iconProps?: iconProps;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const Showcase: React.FC<Props> = ({
|
|
26
|
+
id,
|
|
27
|
+
className,
|
|
28
|
+
title,
|
|
29
|
+
subTitle,
|
|
30
|
+
description,
|
|
31
|
+
bgColour,
|
|
32
|
+
size = 'large',
|
|
33
|
+
|
|
34
|
+
iconProps,
|
|
35
|
+
}: Props): JSX.Element => {
|
|
36
|
+
const classList = classNames(className, 'theme-local');
|
|
37
|
+
|
|
38
|
+
const containerSize = classNames(
|
|
39
|
+
{
|
|
40
|
+
[style.smallContainer]: size === 'small',
|
|
41
|
+
[style.mediumContainer]: size === 'medium',
|
|
42
|
+
[style.largeContainer]: size === 'large',
|
|
43
|
+
},
|
|
44
|
+
style.container,
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<ComponentWrapper id={id} className={classList} bgColour={bgColour}>
|
|
49
|
+
<Container className={containerSize}>
|
|
50
|
+
<div className={style.textWrapper}>
|
|
51
|
+
<h2 className={style.title}>{title}</h2>
|
|
52
|
+
<h2 className={style.subTitle}>{subTitle}</h2>
|
|
53
|
+
<p className={style.description}>{description}</p>
|
|
54
|
+
</div>
|
|
55
|
+
<div className={style.avatarWrapper}>
|
|
56
|
+
<Avatar />
|
|
57
|
+
</div>
|
|
58
|
+
</Container>
|
|
59
|
+
{iconProps?.type !== undefined && (
|
|
60
|
+
<div className={style.iconWrapper}>
|
|
61
|
+
<Icon
|
|
62
|
+
className={style.icon}
|
|
63
|
+
size={2}
|
|
64
|
+
rounded
|
|
65
|
+
{...iconProps}
|
|
66
|
+
type={iconProps.type}
|
|
67
|
+
onClick={iconProps.onClick}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
)}
|
|
71
|
+
</ComponentWrapper>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default Showcase;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
@apply flex flex-wrap text-center md:flex-nowrap md:text-left;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.smallContainer {
|
|
6
|
+
@apply h-56;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.mediumContainer {
|
|
10
|
+
@apply h-96;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.largeContainer {
|
|
14
|
+
@apply min-h-[calc(100vh-176px)];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.textWrapper {
|
|
18
|
+
@apply m-auto w-full md:w-2/3 md:pl-16 md:pr-4 lg:pl-32 lg:pr-8 xl:pl-64;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.title {
|
|
22
|
+
@apply text-lg font-bold leading-tight text-primary md:text-xxl;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.subTitle {
|
|
26
|
+
@apply text-lg font-bold leading-tight text-black md:text-xxl;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.description {
|
|
30
|
+
@apply pt-4 text-sm text-black md:text-md;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.avatarWrapper {
|
|
34
|
+
@apply m-auto flex w-full justify-center md:w-1/3 md:pb-20;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.avatar {
|
|
38
|
+
@apply max-h-96 md:m-auto md:w-full;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.iconWrapper {
|
|
42
|
+
@apply w-full;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.icon {
|
|
46
|
+
@apply mx-auto hover:scale-125 hover:cursor-pointer;
|
|
47
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { idAndClassName } from '@utils/controls';
|
|
3
|
+
|
|
4
|
+
import SideNav from '.';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/SideNav',
|
|
8
|
+
component: SideNav,
|
|
9
|
+
parameters: {
|
|
10
|
+
backgrounds: {
|
|
11
|
+
default: 'grey',
|
|
12
|
+
values: [
|
|
13
|
+
{
|
|
14
|
+
name: 'grey',
|
|
15
|
+
value: '#f3f3f3',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
argTypes: {
|
|
21
|
+
...idAndClassName,
|
|
22
|
+
|
|
23
|
+
navLinks: {
|
|
24
|
+
description: 'An array of nav links to display in the component',
|
|
25
|
+
table: {
|
|
26
|
+
type: { summary: 'array' },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
bgColour: {
|
|
30
|
+
type: { name: 'string', required: false },
|
|
31
|
+
options: ['primary', 'secondary', 'white', 'black', 'gold'],
|
|
32
|
+
description: 'The background colour of the component',
|
|
33
|
+
table: {
|
|
34
|
+
type: { summary: 'string' },
|
|
35
|
+
},
|
|
36
|
+
defaultValue: 'primary',
|
|
37
|
+
control: 'select',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
args: {
|
|
41
|
+
children: <p>dfghj</p>,
|
|
42
|
+
showNav: true,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default meta;
|
|
47
|
+
|
|
48
|
+
type Story = StoryObj<typeof meta>;
|
|
49
|
+
|
|
50
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { type Colours } from '@utils/controls';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export interface Props {
|
|
9
|
+
id: string;
|
|
10
|
+
className: string;
|
|
11
|
+
children: any;
|
|
12
|
+
getNavStatus: (asSideBar: boolean, open: boolean) => void;
|
|
13
|
+
bgColour?: Colours;
|
|
14
|
+
showNav?: boolean;
|
|
15
|
+
leftExpand?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const SideNav = ({
|
|
19
|
+
id,
|
|
20
|
+
className,
|
|
21
|
+
children,
|
|
22
|
+
bgColour = 'primary',
|
|
23
|
+
showNav = false,
|
|
24
|
+
leftExpand = true,
|
|
25
|
+
}: Props): JSX.Element => {
|
|
26
|
+
const sideNavClasses = classNames(
|
|
27
|
+
{
|
|
28
|
+
[style.sideBarCollapsed]: !showNav,
|
|
29
|
+
[style.sideBarExpanded]: showNav,
|
|
30
|
+
[style.leftExpand]: leftExpand,
|
|
31
|
+
[style.rightExpand]: !leftExpand,
|
|
32
|
+
},
|
|
33
|
+
style[bgColour],
|
|
34
|
+
style.sideNavClassList,
|
|
35
|
+
className,
|
|
36
|
+
'theme-local',
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div id={id} className={sideNavClasses}>
|
|
41
|
+
{children}
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default SideNav;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.primary {
|
|
2
|
+
@apply bg-primary text-white;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.secondary {
|
|
6
|
+
@apply bg-secondary text-white;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.white {
|
|
10
|
+
@apply bg-white text-black;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.black {
|
|
14
|
+
@apply bg-black text-white;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.sideNavClassList {
|
|
18
|
+
@apply absolute z-50 h-full overflow-hidden duration-700;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.leftExpand {
|
|
22
|
+
@apply left-0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.rightExpand {
|
|
26
|
+
@apply right-0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.mobileSideBarMenu {
|
|
30
|
+
@apply space-y-1 pb-3 pt-2;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.mobileSideBarMenuNavItems {
|
|
34
|
+
@apply pl-8 pt-4;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.sideBarCollapsed {
|
|
38
|
+
@apply w-0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.sideBarExpanded {
|
|
42
|
+
@apply w-full sm:w-1/3;
|
|
43
|
+
}
|