@agilant/toga-blox 1.0.9 → 1.0.11
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/dist/components/Badge/Badge.d.ts +4 -0
- package/dist/components/Badge/Badge.js +9 -0
- package/dist/components/Badge/Badge.stories.d.ts +7 -0
- package/dist/components/Badge/Badge.stories.js +196 -0
- package/dist/components/Badge/Badge.test.d.ts +1 -0
- package/dist/components/Badge/Badge.test.js +80 -0
- package/dist/components/Badge/Badge.types.d.ts +25 -0
- package/dist/components/Badge/Badge.types.js +1 -0
- package/dist/components/Badge/index.js +2 -0
- package/dist/components/Card/Card.d.ts +4 -0
- package/dist/components/Card/Card.js +11 -0
- package/dist/components/Card/Card.stories.d.ts +12 -0
- package/dist/components/Card/Card.stories.js +173 -0
- package/dist/components/Card/Card.test.d.ts +1 -0
- package/dist/components/Card/Card.test.js +35 -0
- package/dist/components/Card/Card.types.d.ts +10 -0
- package/dist/components/Card/Card.types.js +1 -0
- package/dist/components/Card/DUMMYPRODUCTDATA.json +826 -0
- package/dist/components/Card/index.d.ts +3 -0
- package/dist/components/Card/templates/CategoryCardTemplate.d.ts +27 -0
- package/dist/components/Card/templates/CategoryCardTemplate.js +7 -0
- package/dist/components/Card/templates/CompassCardTemplate.d.ts +23 -0
- package/dist/components/Card/templates/CompassCardTemplate.js +7 -0
- package/dist/components/Card/templates/CounterContentCardTemplate.d.ts +53 -0
- package/dist/components/Card/templates/CounterContentCardTemplate.js +46 -0
- package/dist/components/Card/templates/HorizontalCardTemplate.d.ts +65 -0
- package/dist/components/Card/templates/HorizontalCardTemplate.js +13 -0
- package/dist/components/Card/templates/ItemCardTemplate.d.ts +61 -0
- package/dist/components/Card/templates/ItemCardTemplate.js +9 -0
- package/dist/components/Card/templates/KitContentCardTemplate.d.ts +53 -0
- package/dist/components/Card/templates/KitContentCardTemplate.js +9 -0
- package/dist/components/Card/templates/ShippingAddressCardTemplate.d.ts +15 -0
- package/dist/components/Card/templates/ShippingAddressCardTemplate.js +9 -0
- package/dist/components/Card/templates/VerticalCardTemplate.d.ts +61 -0
- package/dist/components/Card/templates/VerticalCardTemplate.js +9 -0
- package/dist/components/CounterButton/CounterButton.d.ts +4 -0
- package/dist/components/CounterButton/CounterButton.js +7 -0
- package/dist/components/CounterButton/CounterButton.stories.d.ts +4 -0
- package/dist/components/CounterButton/CounterButton.stories.js +69 -0
- package/dist/components/CounterButton/CounterButton.types.d.ts +10 -0
- package/dist/components/CounterButton/CounterButton.types.js +1 -0
- package/dist/components/Description/Description.d.ts +4 -0
- package/dist/components/Description/Description.js +5 -0
- package/dist/components/Description/Description.stories.d.ts +5 -0
- package/dist/components/Description/Description.stories.js +54 -0
- package/dist/components/Description/Description.types.d.ts +8 -0
- package/dist/components/Description/Description.types.js +1 -0
- package/dist/components/DropDownIconButton/DropDownIconButton.d.ts +4 -0
- package/dist/components/DropDownIconButton/DropDownIconButton.js +24 -0
- package/dist/components/DropDownIconButton/DropDownIconButton.stories.d.ts +6 -0
- package/dist/components/DropDownIconButton/DropDownIconButton.stories.js +145 -0
- package/dist/components/DropDownIconButton/DropDownIconButton.test.d.ts +1 -0
- package/dist/components/DropDownIconButton/DropDownIconButton.test.js +40 -0
- package/dist/components/DropDownIconButton/DropDownIconButton.types.d.ts +20 -0
- package/dist/components/DropDownIconButton/DropDownIconButton.types.js +1 -0
- package/dist/components/DropDownIconButton/index.js +2 -0
- package/dist/components/Footer/ContactInfoItem.d.ts +7 -0
- package/dist/components/Footer/ContactInfoItem.js +4 -0
- package/dist/components/Footer/DUMMYFOOTERDATA.json +132 -0
- package/dist/components/Footer/Footer.d.ts +4 -0
- package/dist/components/Footer/Footer.js +12 -0
- package/dist/components/Footer/Footer.stories.d.ts +7 -0
- package/dist/components/Footer/Footer.stories.js +155 -0
- package/dist/components/Footer/Footer.test.d.ts +1 -0
- package/dist/components/Footer/Footer.test.js +48 -0
- package/dist/components/Footer/Footer.types.d.ts +42 -0
- package/dist/components/Footer/Footer.types.js +1 -0
- package/dist/components/FormButton/FormButton.d.ts +4 -0
- package/dist/components/FormButton/FormButton.js +49 -0
- package/dist/components/FormButton/FormButton.stories.d.ts +12 -0
- package/dist/components/FormButton/FormButton.stories.js +200 -0
- package/dist/components/FormButton/FormButton.test.d.ts +1 -0
- package/dist/components/FormButton/FormButton.test.js +27 -0
- package/dist/components/FormButton/FormButton.types.d.ts +24 -0
- package/dist/components/FormButton/FormButton.types.js +1 -0
- package/dist/components/FormButton/index.js +2 -0
- package/dist/components/GenericList/DUMMYLISTDATA.json +560 -0
- package/dist/components/GenericList/GenericList.d.ts +16 -0
- package/dist/components/GenericList/GenericList.js +50 -0
- package/dist/components/GenericList/GenericList.stories.d.ts +35 -0
- package/dist/components/GenericList/GenericList.stories.js +87 -0
- package/dist/components/GenericList/GenericList.test.d.ts +1 -0
- package/dist/components/GenericList/GenericList.test.js +24 -0
- package/dist/components/GenericList/templates/DummyDataList.d.ts +6 -0
- package/dist/components/GenericList/templates/DummyDataList.js +6 -0
- package/dist/components/GenericList/templates/DynamicIconList.d.ts +32 -0
- package/dist/components/GenericList/templates/DynamicIconList.js +7 -0
- package/dist/components/GetSupport/GetSupport.d.ts +4 -0
- package/dist/components/GetSupport/GetSupport.js +7 -0
- package/dist/components/GetSupport/GetSupport.stories.d.ts +5 -0
- package/dist/components/GetSupport/GetSupport.stories.js +70 -0
- package/dist/components/GetSupport/GetSupport.test.d.ts +1 -0
- package/dist/components/GetSupport/GetSupport.test.js +49 -0
- package/dist/components/GetSupport/GetSupport.types.d.ts +11 -0
- package/dist/components/GetSupport/GetSupport.types.js +1 -0
- package/dist/components/HamburgerButton/Hamburger.stories.d.ts +5 -0
- package/dist/components/HamburgerButton/Hamburger.stories.js +97 -0
- package/dist/components/HamburgerButton/HamburgerButton.d.ts +4 -0
- package/dist/components/HamburgerButton/HamburgerButton.js +15 -0
- package/dist/components/HamburgerButton/HamburgerButton.types.d.ts +7 -0
- package/dist/components/HamburgerButton/HamburgerButton.types.js +1 -0
- package/dist/components/HamburgerButton/index.js +2 -0
- package/dist/components/Header/DUMMYICONDATA.json +136 -0
- package/dist/components/Header/Header.d.ts +4 -0
- package/dist/components/Header/Header.js +62 -0
- package/dist/components/Header/Header.stories.d.ts +8 -0
- package/dist/components/Header/Header.stories.js +225 -0
- package/dist/components/Header/Header.test.d.ts +1 -0
- package/dist/components/Header/Header.test.js +107 -0
- package/dist/components/Header/Header.types.d.ts +40 -0
- package/dist/components/Header/Header.types.js +1 -0
- package/dist/components/Header/headerContext.d.ts +39 -0
- package/dist/components/Header/headerContext.js +44 -0
- package/dist/components/Header/index.js +2 -0
- package/dist/components/Hero/Hero.d.ts +4 -0
- package/dist/components/Hero/Hero.js +21 -0
- package/dist/components/Hero/Hero.stories.d.ts +13 -0
- package/dist/components/Hero/Hero.stories.js +46 -0
- package/dist/components/Hero/Hero.test.d.ts +1 -0
- package/dist/components/Hero/Hero.test.js +62 -0
- package/dist/components/Hero/Hero.types.d.ts +8 -0
- package/dist/components/Hero/Hero.types.js +1 -0
- package/dist/components/Hero/index.js +2 -0
- package/dist/components/IconButton/IconButton.d.ts +4 -0
- package/dist/components/IconButton/IconButton.js +18 -0
- package/dist/components/IconButton/IconButton.stories.d.ts +7 -0
- package/dist/components/IconButton/IconButton.stories.js +187 -0
- package/dist/components/IconButton/IconButton.test.d.ts +1 -0
- package/dist/components/IconButton/IconButton.test.js +28 -0
- package/dist/components/IconButton/IconButton.types.d.ts +27 -0
- package/dist/components/IconButton/IconButton.types.js +1 -0
- package/dist/components/IconButton/index.js +2 -0
- package/dist/components/Image/Image.d.ts +4 -0
- package/dist/components/Image/Image.js +19 -0
- package/dist/components/Image/Image.stories.d.ts +14 -0
- package/dist/components/Image/Image.stories.js +63 -0
- package/dist/components/Image/Image.test.d.ts +1 -0
- package/dist/components/Image/Image.test.js +47 -0
- package/dist/components/Image/Image.types.d.ts +12 -0
- package/dist/components/Image/Image.types.js +1 -0
- package/dist/components/Image/index.js +2 -0
- package/dist/components/Input/Input.d.ts +4 -0
- package/dist/components/Input/Input.js +51 -0
- package/dist/components/Input/Input.stories.d.ts +13 -0
- package/dist/components/Input/Input.stories.js +364 -0
- package/dist/components/Input/Input.test.d.ts +1 -0
- package/dist/components/Input/Input.test.js +45 -0
- package/dist/components/Input/Input.types.d.ts +36 -0
- package/dist/components/Input/Input.types.js +1 -0
- package/dist/components/Input/InputMemoTypes.d.ts +2 -0
- package/dist/components/Input/InputMemoTypes.js +28 -0
- package/dist/components/Input/index.js +2 -0
- package/dist/components/MobileMenu/MobileMenu.d.ts +3 -0
- package/dist/components/MobileMenu/MobileMenu.js +7 -0
- package/dist/components/MobileMenu/MobileMenu.types.d.ts +20 -0
- package/dist/components/MobileMenu/MobileMenu.types.js +1 -0
- package/dist/components/MobileMenu/index.js +2 -0
- package/dist/components/Nav/DUMMYNAVDATA.json +234 -0
- package/dist/components/Nav/Nav.d.ts +4 -0
- package/dist/components/Nav/Nav.js +31 -0
- package/dist/components/Nav/Nav.stories.d.ts +6 -0
- package/dist/components/Nav/Nav.stories.js +164 -0
- package/dist/components/Nav/Nav.test.d.ts +1 -0
- package/dist/components/Nav/Nav.test.js +52 -0
- package/dist/components/Nav/Nav.types.d.ts +38 -0
- package/dist/components/Nav/Nav.types.js +1 -0
- package/dist/components/Nav/index.js +2 -0
- package/dist/components/Page/TableDataDummy.d.ts +3 -0
- package/dist/components/Page/TableDataDummy.js +5 -0
- package/dist/components/Page/ViewPageTemplate.d.ts +3 -0
- package/dist/components/Page/ViewPageTemplate.js +5 -0
- package/dist/components/Page/ViewPageTemplate.stories.d.ts +8 -0
- package/dist/components/Page/ViewPageTemplate.stories.js +73 -0
- package/dist/components/Page/ViewPageTemplate.test.d.ts +1 -0
- package/dist/components/Page/ViewPageTemplate.test.js +71 -0
- package/{src/components/Page/ViewPageTemplate.types.ts → dist/components/Page/ViewPageTemplate.types.d.ts} +2 -3
- package/dist/components/Page/ViewPageTemplate.types.js +1 -0
- package/dist/components/Page/index.js +2 -0
- package/dist/components/PageSection/PageSection.d.ts +4 -0
- package/dist/components/PageSection/PageSection.js +5 -0
- package/dist/components/PageSection/PageSection.stories.d.ts +6 -0
- package/dist/components/PageSection/PageSection.stories.js +40 -0
- package/{src/components/PageSection/PageSection.types.ts → dist/components/PageSection/PageSection.types.d.ts} +2 -3
- package/dist/components/PageSection/PageSection.types.js +1 -0
- package/dist/components/PageSection/PageSections.test.d.ts +1 -0
- package/dist/components/PageSection/PageSections.test.js +31 -0
- package/dist/components/PageSection/index.js +2 -0
- package/dist/components/SearchInput/SearchInput.d.ts +4 -0
- package/dist/components/SearchInput/SearchInput.js +17 -0
- package/dist/components/SearchInput/SearchInput.stories.d.ts +9 -0
- package/dist/components/SearchInput/SearchInput.stories.js +128 -0
- package/dist/components/SearchInput/SearchInput.types.d.ts +25 -0
- package/dist/components/SearchInput/SearchInput.types.js +1 -0
- package/dist/components/Slider/Slider.d.ts +4 -0
- package/dist/components/Slider/Slider.js +56 -0
- package/dist/components/Slider/Slider.stories.d.ts +6 -0
- package/dist/components/Slider/Slider.stories.js +82 -0
- package/dist/components/Slider/Slider.types.d.ts +21 -0
- package/dist/components/Slider/Slider.types.js +1 -0
- package/dist/components/Submenus/AdminSubmenu.d.ts +4 -0
- package/dist/components/Submenus/AdminSubmenu.js +5 -0
- package/dist/components/Submenus/AlertSubmenu.d.ts +4 -0
- package/dist/components/Submenus/AlertSubmenu.js +7 -0
- package/dist/components/Submenus/AlertSubmenuItem.d.ts +4 -0
- package/dist/components/Submenus/AlertSubmenuItem.js +5 -0
- package/dist/components/Submenus/types.d.ts +29 -0
- package/dist/components/Submenus/types.js +1 -0
- package/dist/components/Text/Text.d.ts +4 -0
- package/dist/components/Text/Text.js +12 -0
- package/dist/components/Text/Text.stories.d.ts +5 -0
- package/dist/components/Text/Text.stories.js +79 -0
- package/dist/components/Text/Text.test.d.ts +1 -0
- package/dist/components/Text/Text.test.js +31 -0
- package/{src/components/Text/Text.types.ts → dist/components/Text/Text.types.d.ts} +6 -8
- package/dist/components/Text/Text.types.js +1 -0
- package/dist/components/Text/index.js +2 -0
- package/dist/components/Toaster/Toaster.d.ts +4 -0
- package/dist/components/Toaster/Toaster.js +22 -0
- package/dist/components/Toaster/Toaster.stories.d.ts +23 -0
- package/dist/components/Toaster/Toaster.stories.js +102 -0
- package/dist/components/Toaster/Toaster.test.d.ts +1 -0
- package/dist/components/Toaster/Toaster.test.js +47 -0
- package/dist/components/Toaster/Toaster.types.d.ts +15 -0
- package/dist/components/Toaster/Toaster.types.js +1 -0
- package/dist/components/Toaster/index.js +2 -0
- package/dist/hoc/index.d.ts +1 -0
- package/dist/hoc/styling/withStoryBook.d.ts +6 -0
- package/dist/hoc/styling/withStoryBook.js +7 -0
- package/dist/main.css +1 -0
- package/dist/setupTests.js +1 -0
- package/dist/userHoc/index.js +1 -0
- package/dist/userHoc/withMemo.d.ts +5 -0
- package/dist/userHoc/withMemo.js +6 -0
- package/dist/utils/assertTagName.d.ts +3 -0
- package/dist/utils/assertTagName.js +6 -0
- package/dist/utils/generateAccordionItem.d.ts +15 -0
- package/dist/utils/generateAccordionItem.js +22 -0
- package/dist/utils/generateFooterContacts.d.ts +14 -0
- package/dist/utils/generateFooterContacts.js +19 -0
- package/dist/utils/generateNavMenu.d.ts +14 -0
- package/dist/utils/generateNavMenu.js +5 -0
- package/dist/utils/generateSocialList.d.ts +12 -0
- package/dist/utils/generateSocialList.js +4 -0
- package/dist/utils/getFontAwesomeIcon.d.ts +2 -0
- package/dist/utils/getFontAwesomeIcon.js +19 -0
- package/dist/utils/inputValidation.d.ts +6 -0
- package/dist/utils/inputValidation.js +12 -0
- package/package.json +9 -4
- package/.gitattributes +0 -5
- package/Dockerfile +0 -9
- package/assets/Logo.png +0 -0
- package/assets/cable.jpg +0 -0
- package/assets/card-1.jpg +0 -0
- package/assets/cat-logo.png +0 -0
- package/assets/compass-card-image-2.png +0 -0
- package/assets/compass-card-image-3.png +0 -0
- package/assets/compass-card-image-4.png +0 -0
- package/assets/compass-card-image.png +0 -0
- package/assets/compass-logo.png +0 -0
- package/assets/compass-tech-hero-bg.png +0 -0
- package/assets/contact-image.png +0 -0
- package/assets/green-laptop.png +0 -0
- package/assets/heroImage.png +0 -0
- package/assets/item.jpg +0 -0
- package/assets/map.png +0 -0
- package/assets/placeholder-no-image-available.png +0 -0
- package/assets/team.png +0 -0
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/clover.xml +0 -953
- package/coverage/coverage-final.json +0 -74
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -551
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/coverage/toga-blox-npm/index.html +0 -131
- package/coverage/toga-blox-npm/postcss.config.js.html +0 -103
- package/coverage/toga-blox-npm/src/components/Badge/Badge.stories.tsx.html +0 -793
- package/coverage/toga-blox-npm/src/components/Badge/Badge.tsx.html +0 -247
- package/coverage/toga-blox-npm/src/components/Badge/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/Card/Card.stories.tsx.html +0 -787
- package/coverage/toga-blox-npm/src/components/Card/Card.tsx.html +0 -163
- package/coverage/toga-blox-npm/src/components/Card/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/Card/templates/CategoryCardTemplate.tsx.html +0 -343
- package/coverage/toga-blox-npm/src/components/Card/templates/CompassCardTemplate.tsx.html +0 -259
- package/coverage/toga-blox-npm/src/components/Card/templates/CounterContentCardTemplate.tsx.html +0 -685
- package/coverage/toga-blox-npm/src/components/Card/templates/HorizontalCardTemplate.tsx.html +0 -637
- package/coverage/toga-blox-npm/src/components/Card/templates/ItemCardTemplate.tsx.html +0 -550
- package/coverage/toga-blox-npm/src/components/Card/templates/KitContentCardTemplate.tsx.html +0 -469
- package/coverage/toga-blox-npm/src/components/Card/templates/ShippingAddressCardTemplate.tsx.html +0 -418
- package/coverage/toga-blox-npm/src/components/Card/templates/VerticalCardTemplate.tsx.html +0 -592
- package/coverage/toga-blox-npm/src/components/Card/templates/index.html +0 -221
- package/coverage/toga-blox-npm/src/components/CounterButton/CounterButton.stories.tsx.html +0 -358
- package/coverage/toga-blox-npm/src/components/CounterButton/CounterButton.tsx.html +0 -385
- package/coverage/toga-blox-npm/src/components/CounterButton/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/Description/Description.stories.tsx.html +0 -286
- package/coverage/toga-blox-npm/src/components/Description/Description.tsx.html +0 -124
- package/coverage/toga-blox-npm/src/components/Description/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/DropDownIconButton/DropDownIconButton.stories.tsx.html +0 -676
- package/coverage/toga-blox-npm/src/components/DropDownIconButton/DropDownIconButton.tsx.html +0 -346
- package/coverage/toga-blox-npm/src/components/DropDownIconButton/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/Footer/ContactInfoItem.tsx.html +0 -139
- package/coverage/toga-blox-npm/src/components/Footer/Footer.stories.tsx.html +0 -934
- package/coverage/toga-blox-npm/src/components/Footer/Footer.tsx.html +0 -373
- package/coverage/toga-blox-npm/src/components/Footer/index.html +0 -146
- package/coverage/toga-blox-npm/src/components/FormButton/FormButton.stories.tsx.html +0 -952
- package/coverage/toga-blox-npm/src/components/FormButton/FormButton.tsx.html +0 -343
- package/coverage/toga-blox-npm/src/components/FormButton/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/GenericList/GenericList.stories.tsx.html +0 -376
- package/coverage/toga-blox-npm/src/components/GenericList/GenericList.tsx.html +0 -520
- package/coverage/toga-blox-npm/src/components/GenericList/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/GenericList/templates/DummyDataList.tsx.html +0 -154
- package/coverage/toga-blox-npm/src/components/GenericList/templates/DynamicIconList.tsx.html +0 -250
- package/coverage/toga-blox-npm/src/components/GenericList/templates/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/GetSupport/GetSupport.stories.tsx.html +0 -325
- package/coverage/toga-blox-npm/src/components/GetSupport/GetSupport.tsx.html +0 -262
- package/coverage/toga-blox-npm/src/components/GetSupport/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/HamburgerButton/Hamburger.stories.tsx.html +0 -760
- package/coverage/toga-blox-npm/src/components/HamburgerButton/HamburgerButton.tsx.html +0 -232
- package/coverage/toga-blox-npm/src/components/HamburgerButton/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/Header/Header.stories.tsx.html +0 -1633
- package/coverage/toga-blox-npm/src/components/Header/Header.tsx.html +0 -814
- package/coverage/toga-blox-npm/src/components/Header/headerContext.tsx.html +0 -460
- package/coverage/toga-blox-npm/src/components/Header/index.html +0 -146
- package/coverage/toga-blox-npm/src/components/Hero/Hero.stories.tsx.html +0 -289
- package/coverage/toga-blox-npm/src/components/Hero/Hero.tsx.html +0 -259
- package/coverage/toga-blox-npm/src/components/Hero/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/IconButton/IconButton.stories.tsx.html +0 -673
- package/coverage/toga-blox-npm/src/components/IconButton/IconButton.tsx.html +0 -313
- package/coverage/toga-blox-npm/src/components/IconButton/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/Image/Image.stories.tsx.html +0 -322
- package/coverage/toga-blox-npm/src/components/Image/Image.tsx.html +0 -226
- package/coverage/toga-blox-npm/src/components/Image/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/Input/Input.stories.tsx.html +0 -1621
- package/coverage/toga-blox-npm/src/components/Input/Input.tsx.html +0 -568
- package/coverage/toga-blox-npm/src/components/Input/InputMemoTypes.tsx.html +0 -181
- package/coverage/toga-blox-npm/src/components/Input/index.html +0 -146
- package/coverage/toga-blox-npm/src/components/MobileMenu/MobileMenu.tsx.html +0 -208
- package/coverage/toga-blox-npm/src/components/MobileMenu/index.html +0 -116
- package/coverage/toga-blox-npm/src/components/Nav/Nav.stories.tsx.html +0 -628
- package/coverage/toga-blox-npm/src/components/Nav/Nav.tsx.html +0 -622
- package/coverage/toga-blox-npm/src/components/Nav/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/Page/TableDataDummy.tsx.html +0 -733
- package/coverage/toga-blox-npm/src/components/Page/ViewPageTemplate.stories.tsx.html +0 -1714
- package/coverage/toga-blox-npm/src/components/Page/ViewPageTemplate.tsx.html +0 -115
- package/coverage/toga-blox-npm/src/components/Page/index.html +0 -146
- package/coverage/toga-blox-npm/src/components/PageSection/PageSection.stories.tsx.html +0 -433
- package/coverage/toga-blox-npm/src/components/PageSection/PageSection.tsx.html +0 -121
- package/coverage/toga-blox-npm/src/components/PageSection/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/SearchInput/SearchInput.stories.tsx.html +0 -517
- package/coverage/toga-blox-npm/src/components/SearchInput/SearchInput.tsx.html +0 -325
- package/coverage/toga-blox-npm/src/components/SearchInput/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/Slider/Slider.stories.tsx.html +0 -349
- package/coverage/toga-blox-npm/src/components/Slider/Slider.tsx.html +0 -502
- package/coverage/toga-blox-npm/src/components/Slider/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/Submenus/AdminSubmenu.tsx.html +0 -136
- package/coverage/toga-blox-npm/src/components/Submenus/AlertSubmenu.tsx.html +0 -253
- package/coverage/toga-blox-npm/src/components/Submenus/AlertSubmenuItem.tsx.html +0 -202
- package/coverage/toga-blox-npm/src/components/Submenus/index.html +0 -146
- package/coverage/toga-blox-npm/src/components/Text/Text.stories.tsx.html +0 -235
- package/coverage/toga-blox-npm/src/components/Text/Text.tsx.html +0 -172
- package/coverage/toga-blox-npm/src/components/Text/index.html +0 -131
- package/coverage/toga-blox-npm/src/components/Toaster/Toaster.stories.tsx.html +0 -445
- package/coverage/toga-blox-npm/src/components/Toaster/Toaster.tsx.html +0 -301
- package/coverage/toga-blox-npm/src/components/Toaster/index.html +0 -131
- package/coverage/toga-blox-npm/src/hoc/styling/index.html +0 -116
- package/coverage/toga-blox-npm/src/hoc/styling/withStoryBook.tsx.html +0 -142
- package/coverage/toga-blox-npm/src/userHoc/index.html +0 -116
- package/coverage/toga-blox-npm/src/userHoc/withMemo.tsx.html +0 -145
- package/coverage/toga-blox-npm/src/utils/assertTagName.tsx.html +0 -106
- package/coverage/toga-blox-npm/src/utils/generateAccordionItem.tsx.html +0 -373
- package/coverage/toga-blox-npm/src/utils/generateFooterContacts.tsx.html +0 -295
- package/coverage/toga-blox-npm/src/utils/generateNavMenu.tsx.html +0 -247
- package/coverage/toga-blox-npm/src/utils/generateSocialList.tsx.html +0 -187
- package/coverage/toga-blox-npm/src/utils/getFontAwesomeIcon.tsx.html +0 -145
- package/coverage/toga-blox-npm/src/utils/index.html +0 -206
- package/coverage/toga-blox-npm/src/utils/inputValidation.tsx.html +0 -163
- package/coverage/toga-blox-npm/tailwind.config.js.html +0 -205
- package/declarations.d.ts +0 -4
- package/docker-compose.yml +0 -22
- package/global.css +0 -4
- package/index.js +0 -4
- package/nodemon.json +0 -5
- package/postcss.config.js +0 -6
- package/src/components/Badge/Badge.stories.tsx +0 -236
- package/src/components/Badge/Badge.test.tsx +0 -175
- package/src/components/Badge/Badge.tsx +0 -54
- package/src/components/Badge/Badge.types.tsx +0 -26
- package/src/components/Card/Card.stories.tsx +0 -235
- package/src/components/Card/Card.test.tsx +0 -53
- package/src/components/Card/Card.tsx +0 -26
- package/src/components/Card/Card.types.ts +0 -11
- package/src/components/Card/DUMMYPRODUCTDATA.json +0 -826
- package/src/components/Card/templates/CategoryCardTemplate.tsx +0 -86
- package/src/components/Card/templates/CompassCardTemplate.tsx +0 -58
- package/src/components/Card/templates/CounterContentCardTemplate.tsx +0 -200
- package/src/components/Card/templates/HorizontalCardTemplate.tsx +0 -184
- package/src/components/Card/templates/ItemCardTemplate.tsx +0 -155
- package/src/components/Card/templates/KitContentCardTemplate.tsx +0 -128
- package/src/components/Card/templates/ShippingAddressCardTemplate.tsx +0 -111
- package/src/components/Card/templates/VerticalCardTemplate.tsx +0 -169
- package/src/components/CounterButton/CounterButton.stories.tsx +0 -91
- package/src/components/CounterButton/CounterButton.tsx +0 -100
- package/src/components/CounterButton/CounterButton.types.ts +0 -12
- package/src/components/Description/Description.stories.tsx +0 -67
- package/src/components/Description/Description.tsx +0 -13
- package/src/components/Description/Description.types.ts +0 -9
- package/src/components/DropDownIconButton/DropDownIconButton.stories.tsx +0 -197
- package/src/components/DropDownIconButton/DropDownIconButton.test.tsx +0 -90
- package/src/components/DropDownIconButton/DropDownIconButton.tsx +0 -87
- package/src/components/DropDownIconButton/DropDownIconButton.types.ts +0 -21
- package/src/components/Footer/ContactInfoItem.tsx +0 -18
- package/src/components/Footer/DUMMYFOOTERDATA.json +0 -132
- package/src/components/Footer/Footer.stories.tsx +0 -283
- package/src/components/Footer/Footer.test.tsx +0 -90
- package/src/components/Footer/Footer.tsx +0 -96
- package/src/components/Footer/Footer.types.tsx +0 -61
- package/src/components/FormButton/FormButton.stories.tsx +0 -289
- package/src/components/FormButton/FormButton.test.tsx +0 -73
- package/src/components/FormButton/FormButton.tsx +0 -86
- package/src/components/FormButton/FormButton.types.ts +0 -27
- package/src/components/GenericList/DUMMYLISTDATA.json +0 -560
- package/src/components/GenericList/GenericList.stories.tsx +0 -97
- package/src/components/GenericList/GenericList.test.tsx +0 -29
- package/src/components/GenericList/GenericList.tsx +0 -145
- package/src/components/GenericList/templates/DummyDataList.tsx +0 -23
- package/src/components/GenericList/templates/DynamicIconList.tsx +0 -55
- package/src/components/GetSupport/GetSupport.stories.tsx +0 -80
- package/src/components/GetSupport/GetSupport.test.tsx +0 -62
- package/src/components/GetSupport/GetSupport.tsx +0 -59
- package/src/components/GetSupport/GetSupport.types.ts +0 -11
- package/src/components/HamburgerButton/Hamburger.stories.tsx +0 -225
- package/src/components/HamburgerButton/HamburgerButton.tsx +0 -49
- package/src/components/HamburgerButton/HamburgerButton.types.tsx +0 -7
- package/src/components/Header/DUMMYICONDATA.json +0 -136
- package/src/components/Header/Header.stories.tsx +0 -516
- package/src/components/Header/Header.test.tsx +0 -322
- package/src/components/Header/Header.tsx +0 -243
- package/src/components/Header/Header.types.ts +0 -52
- package/src/components/Header/headerContext.tsx +0 -125
- package/src/components/Hero/Hero.stories.tsx +0 -68
- package/src/components/Hero/Hero.test.tsx +0 -109
- package/src/components/Hero/Hero.tsx +0 -58
- package/src/components/Hero/Hero.types.ts +0 -9
- package/src/components/IconButton/IconButton.stories.tsx +0 -196
- package/src/components/IconButton/IconButton.test.tsx +0 -52
- package/src/components/IconButton/IconButton.tsx +0 -76
- package/src/components/IconButton/IconButton.types.ts +0 -28
- package/src/components/Image/Image.stories.tsx +0 -79
- package/src/components/Image/Image.test.tsx +0 -87
- package/src/components/Image/Image.tsx +0 -47
- package/src/components/Image/Image.types.ts +0 -11
- package/src/components/Image/declarations.d.ts +0 -24
- package/src/components/Input/Input.stories.tsx +0 -512
- package/src/components/Input/Input.test.tsx +0 -89
- package/src/components/Input/Input.tsx +0 -161
- package/src/components/Input/Input.types.ts +0 -52
- package/src/components/Input/InputMemoTypes.tsx +0 -32
- package/src/components/MobileMenu/MobileMenu.tsx +0 -41
- package/src/components/MobileMenu/MobileMenu.types.tsx +0 -28
- package/src/components/Nav/DUMMYNAVDATA.json +0 -234
- package/src/components/Nav/Nav.stories.tsx +0 -181
- package/src/components/Nav/Nav.test.tsx +0 -89
- package/src/components/Nav/Nav.tsx +0 -179
- package/src/components/Nav/Nav.types.tsx +0 -47
- package/src/components/Page/TableDataDummy.tsx +0 -216
- package/src/components/Page/ViewPageTemplate.stories.tsx +0 -543
- package/src/components/Page/ViewPageTemplate.test.tsx +0 -361
- package/src/components/Page/ViewPageTemplate.tsx +0 -10
- package/src/components/PageSection/PageSection.stories.tsx +0 -116
- package/src/components/PageSection/PageSection.tsx +0 -12
- package/src/components/PageSection/PageSections.test.tsx +0 -89
- package/src/components/SearchInput/SearchInput.stories.tsx +0 -144
- package/src/components/SearchInput/SearchInput.tsx +0 -81
- package/src/components/SearchInput/SearchInput.types.ts +0 -28
- package/src/components/Slider/Slider.stories.tsx +0 -88
- package/src/components/Slider/Slider.tsx +0 -139
- package/src/components/Slider/Slider.types.ts +0 -21
- package/src/components/Submenus/AdminSubmenu.tsx +0 -17
- package/src/components/Submenus/AlertSubmenu.tsx +0 -56
- package/src/components/Submenus/AlertSubmenuItem.tsx +0 -39
- package/src/components/Submenus/types.tsx +0 -32
- package/src/components/Text/Text.stories.tsx +0 -50
- package/src/components/Text/Text.test.tsx +0 -52
- package/src/components/Text/Text.tsx +0 -29
- package/src/components/Toaster/Toaster.stories.tsx +0 -120
- package/src/components/Toaster/Toaster.test.tsx +0 -60
- package/src/components/Toaster/Toaster.tsx +0 -72
- package/src/components/Toaster/Toaster.types.ts +0 -12
- package/src/hoc/styling/withStoryBook.tsx +0 -19
- package/src/main.css +0 -3
- package/src/userHoc/withMemo.tsx +0 -20
- package/src/utils/assertTagName.tsx +0 -7
- package/src/utils/generateAccordionItem.tsx +0 -96
- package/src/utils/generateFooterContacts.tsx +0 -70
- package/src/utils/generateNavMenu.tsx +0 -54
- package/src/utils/generateSocialList.tsx +0 -34
- package/src/utils/getFontAwesomeIcon.tsx +0 -20
- package/src/utils/inputValidation.tsx +0 -26
- package/tailwind.config.js +0 -40
- package/tsconfig.json +0 -25
- package/vite.config.ts +0 -33
- /package/{src/components/Badge/index.ts → dist/components/Badge/index.d.ts} +0 -0
- /package/{src/components/Card/index.ts → dist/components/Card/index.js} +0 -0
- /package/{src/components/DropDownIconButton/index.ts → dist/components/DropDownIconButton/index.d.ts} +0 -0
- /package/{src/components/FormButton/index.ts → dist/components/FormButton/index.d.ts} +0 -0
- /package/{src/components/HamburgerButton/index.ts → dist/components/HamburgerButton/index.d.ts} +0 -0
- /package/{src/components/Header/index.ts → dist/components/Header/index.d.ts} +0 -0
- /package/{src/components/Hero/index.ts → dist/components/Hero/index.d.ts} +0 -0
- /package/{src/components/IconButton/index.ts → dist/components/IconButton/index.d.ts} +0 -0
- /package/{src/components/Image/index.ts → dist/components/Image/index.d.ts} +0 -0
- /package/{src/components/Input/index.ts → dist/components/Input/index.d.ts} +0 -0
- /package/{src/components/MobileMenu/index.ts → dist/components/MobileMenu/index.d.ts} +0 -0
- /package/{src/components/Nav/index.ts → dist/components/Nav/index.d.ts} +0 -0
- /package/{src/components/Page/index.ts → dist/components/Page/index.d.ts} +0 -0
- /package/{src/components/PageSection/index.ts → dist/components/PageSection/index.d.ts} +0 -0
- /package/{src/components/Text/index.ts → dist/components/Text/index.d.ts} +0 -0
- /package/{src/components/Toaster/index.ts → dist/components/Toaster/index.d.ts} +0 -0
- /package/{src/hoc/index.ts → dist/hoc/index.js} +0 -0
- /package/{src/setupTests.ts → dist/setupTests.d.ts} +0 -0
- /package/{src/userHoc/index.ts → dist/userHoc/index.d.ts} +0 -0
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from "@storybook/react";
|
|
2
|
-
import SearchInput from "./SearchInput";
|
|
3
|
-
import { SearchInputProps } from "./SearchInput.types";
|
|
4
|
-
import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: "Components/SearchInput",
|
|
8
|
-
component: SearchInput,
|
|
9
|
-
tags: ["autodocs"],
|
|
10
|
-
argTypes: {
|
|
11
|
-
onButtonClick: { control: "none", table: { disable: true } },
|
|
12
|
-
inputType: { control: "none", table: { disable: true } },
|
|
13
|
-
inputName: { control: "none", table: { disable: true } },
|
|
14
|
-
placeholder: { control: "none" },
|
|
15
|
-
hasPlaceholder: { control: "none" },
|
|
16
|
-
inputTextSize: { control: "none" },
|
|
17
|
-
inputShape: { control: "none" },
|
|
18
|
-
backgroundColor: { control: "none" },
|
|
19
|
-
inputWidth: { control: "none" },
|
|
20
|
-
inputBorderClasses: { control: "none" },
|
|
21
|
-
buttonText: { control: "none", table: { disable: true } },
|
|
22
|
-
buttonIcon: { control: "none", table: { disable: true } },
|
|
23
|
-
buttonIconClasses: { control: "none" },
|
|
24
|
-
buttonClasses: { control: "none" },
|
|
25
|
-
containerClasses: { control: "none" },
|
|
26
|
-
},
|
|
27
|
-
parameters: { layout: "centered" },
|
|
28
|
-
} as Meta;
|
|
29
|
-
|
|
30
|
-
const Template: StoryFn<SearchInputProps> = (args) => <SearchInput {...args} />;
|
|
31
|
-
|
|
32
|
-
export const Default = Template.bind({});
|
|
33
|
-
Default.args = {
|
|
34
|
-
inputType: "text",
|
|
35
|
-
inputName: "default",
|
|
36
|
-
hasPlaceholder: true,
|
|
37
|
-
placeholder: "Type something...",
|
|
38
|
-
inputTextSize: "text-base",
|
|
39
|
-
inputShape: "rounded-md",
|
|
40
|
-
backgroundColor: "bg-white",
|
|
41
|
-
inputWidth: "w-80",
|
|
42
|
-
inputBorderClasses: "border border-gray-300",
|
|
43
|
-
buttonText: <span>Search</span>,
|
|
44
|
-
buttonClasses: "bg-blue-500 text-white px-4 py-2 rounded-md",
|
|
45
|
-
buttonIcon: getFontAwesomeIcon("search"),
|
|
46
|
-
buttonIconClasses: "text-white",
|
|
47
|
-
containerClasses: "flex items-center space-x-2",
|
|
48
|
-
onButtonClick: (value) => alert(`Button clicked with input: ${value}`),
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const CommerceSearchInput = Template.bind({});
|
|
52
|
-
CommerceSearchInput.args = {
|
|
53
|
-
inputType: "search",
|
|
54
|
-
inputName: "commerceSearch",
|
|
55
|
-
hasPlaceholder: true,
|
|
56
|
-
placeholder: "Search for product...",
|
|
57
|
-
inputTextSize: "text-sm",
|
|
58
|
-
inputShape: "",
|
|
59
|
-
backgroundColor: "bg-gray-50",
|
|
60
|
-
inputWidth: "w-full",
|
|
61
|
-
inputBorderClasses: "border border-gray-300 focus:outline-none rounded-l-md",
|
|
62
|
-
buttonIcon: getFontAwesomeIcon("search"),
|
|
63
|
-
buttonIconClasses: "text-white",
|
|
64
|
-
buttonClasses: "bg-teal-600 p-2 rounded-r-md hover:bg-teal-700",
|
|
65
|
-
containerClasses: "flex items-center shadow-sm overflow-hidden",
|
|
66
|
-
onButtonClick: (value) => console.log(`Searching for: ${value}`),
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export const WithIconButton = Template.bind({});
|
|
71
|
-
WithIconButton.args = {
|
|
72
|
-
inputType: "search",
|
|
73
|
-
inputName: "searchIcon",
|
|
74
|
-
hasPlaceholder: true,
|
|
75
|
-
placeholder: "Search...",
|
|
76
|
-
inputTextSize: "text-md",
|
|
77
|
-
inputShape: "rounded-full",
|
|
78
|
-
backgroundColor: "bg-gray-50",
|
|
79
|
-
inputWidth: "w-64",
|
|
80
|
-
inputBorderClasses: "border border-gray-400",
|
|
81
|
-
buttonIcon: getFontAwesomeIcon("magnifying-glass"),
|
|
82
|
-
buttonIconClasses: "text-blue-500",
|
|
83
|
-
buttonClasses: "p-2",
|
|
84
|
-
containerClasses: "flex items-center",
|
|
85
|
-
onButtonClick: (value) => console.log(`Searching for: ${value}`),
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const WithoutButton = Template.bind({});
|
|
89
|
-
WithoutButton.args = {
|
|
90
|
-
inputType: "text",
|
|
91
|
-
inputName: "withoutButton",
|
|
92
|
-
hasPlaceholder: true,
|
|
93
|
-
placeholder: "No button here...",
|
|
94
|
-
inputTextSize: "text-sm",
|
|
95
|
-
inputShape: "rounded",
|
|
96
|
-
backgroundColor: "bg-gray-100",
|
|
97
|
-
inputWidth: "w-full",
|
|
98
|
-
inputBorderClasses: "border border-gray-300",
|
|
99
|
-
containerClasses: "flex items-center",
|
|
100
|
-
onButtonClick: () => { },
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export const CustomizedButton = Template.bind({});
|
|
104
|
-
CustomizedButton.args = {
|
|
105
|
-
inputType: "text",
|
|
106
|
-
inputName: "customButton",
|
|
107
|
-
hasPlaceholder: true,
|
|
108
|
-
placeholder: "Enter your query...",
|
|
109
|
-
inputTextSize: "text-lg",
|
|
110
|
-
inputShape: "rounded-lg",
|
|
111
|
-
backgroundColor: "bg-white",
|
|
112
|
-
inputWidth: "w-96",
|
|
113
|
-
inputBorderClasses: "border border-blue-500",
|
|
114
|
-
buttonText: (
|
|
115
|
-
<span className="flex items-center space-x-1">
|
|
116
|
-
{getFontAwesomeIcon("arrow-right")}
|
|
117
|
-
<span>Go</span>
|
|
118
|
-
</span>
|
|
119
|
-
),
|
|
120
|
-
buttonClasses:
|
|
121
|
-
"bg-green-600 text-white hover:bg-green-700 transition-colors rounded-full px-5 py-2",
|
|
122
|
-
buttonIcon: null,
|
|
123
|
-
containerClasses: "flex items-center space-x-3",
|
|
124
|
-
onButtonClick: (value) => alert(`Navigating with: ${value}`),
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
export const DisabledInput = Template.bind({});
|
|
128
|
-
DisabledInput.args = {
|
|
129
|
-
inputType: "text",
|
|
130
|
-
inputName: "disabledInput",
|
|
131
|
-
hasPlaceholder: true,
|
|
132
|
-
placeholder: "Disabled...",
|
|
133
|
-
inputTextSize: "text-sm",
|
|
134
|
-
inputShape: "rounded",
|
|
135
|
-
backgroundColor: "bg-gray-200",
|
|
136
|
-
inputWidth: "w-72",
|
|
137
|
-
inputBorderClasses: "border border-gray-400 cursor-not-allowed",
|
|
138
|
-
buttonText: <span>Disabled</span>,
|
|
139
|
-
buttonClasses: "bg-gray-500 text-gray-300 px-4 py-2 rounded",
|
|
140
|
-
buttonIcon: getFontAwesomeIcon("ban"),
|
|
141
|
-
buttonIconClasses: "text-gray-400",
|
|
142
|
-
containerClasses: "flex items-center",
|
|
143
|
-
onButtonClick: () => alert("Button is disabled."),
|
|
144
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import FormButton from "../FormButton/FormButton";
|
|
3
|
-
import { SearchInputProps } from "./SearchInput.types";
|
|
4
|
-
|
|
5
|
-
const SearchInput: React.FC<SearchInputProps> = ({
|
|
6
|
-
label,
|
|
7
|
-
inputName,
|
|
8
|
-
inputType,
|
|
9
|
-
hasPlaceholder,
|
|
10
|
-
placeholder,
|
|
11
|
-
inputTextSize,
|
|
12
|
-
inputShape,
|
|
13
|
-
backgroundColor,
|
|
14
|
-
inputWidth,
|
|
15
|
-
inputBorderClasses,
|
|
16
|
-
buttonClasses,
|
|
17
|
-
buttonText,
|
|
18
|
-
buttonIcon,
|
|
19
|
-
buttonIconClasses,
|
|
20
|
-
containerClasses,
|
|
21
|
-
onButtonClick,
|
|
22
|
-
role,
|
|
23
|
-
ariaLabel,
|
|
24
|
-
}) => {
|
|
25
|
-
const [inputValue, setInputValue] = useState<string>("");
|
|
26
|
-
|
|
27
|
-
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
28
|
-
setInputValue(e.target.value);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const handleButtonClick = (
|
|
32
|
-
event: React.MouseEvent<
|
|
33
|
-
HTMLButtonElement | HTMLAnchorElement,
|
|
34
|
-
MouseEvent
|
|
35
|
-
>
|
|
36
|
-
) => {
|
|
37
|
-
event.preventDefault();
|
|
38
|
-
if (event.currentTarget instanceof HTMLButtonElement) {
|
|
39
|
-
onButtonClick(inputValue);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<div className={containerClasses} role={role} aria-label={ariaLabel}>
|
|
45
|
-
<form className="w-full">
|
|
46
|
-
<label htmlFor={inputName} className={`sr-only`}>
|
|
47
|
-
{label}
|
|
48
|
-
</label>
|
|
49
|
-
<div className="flex w-full">
|
|
50
|
-
<div className="flex w-full">
|
|
51
|
-
<input
|
|
52
|
-
type={inputType}
|
|
53
|
-
placeholder={
|
|
54
|
-
hasPlaceholder ? placeholder : undefined
|
|
55
|
-
}
|
|
56
|
-
name={inputName}
|
|
57
|
-
id={inputName}
|
|
58
|
-
value={inputValue}
|
|
59
|
-
onChange={handleInputChange}
|
|
60
|
-
className={`flex p-2 ${inputTextSize} ${inputShape} ${backgroundColor} ${inputWidth} ${inputBorderClasses}`}
|
|
61
|
-
/>
|
|
62
|
-
<div
|
|
63
|
-
className={`flex items-center justify-center h-full`}
|
|
64
|
-
>
|
|
65
|
-
<FormButton
|
|
66
|
-
text={buttonText}
|
|
67
|
-
icon={buttonIcon}
|
|
68
|
-
iconClasses={buttonIconClasses}
|
|
69
|
-
as="button"
|
|
70
|
-
additionalClasses={buttonClasses}
|
|
71
|
-
onClick={handleButtonClick}
|
|
72
|
-
/>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</form>
|
|
77
|
-
</div>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export default SearchInput;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
export interface SearchInputProps {
|
|
4
|
-
onChange?: (
|
|
5
|
-
e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>
|
|
6
|
-
) => void;
|
|
7
|
-
value?: string;
|
|
8
|
-
label: React.ReactNode;
|
|
9
|
-
role?: string;
|
|
10
|
-
ariaLabel?: string;
|
|
11
|
-
inputType: string;
|
|
12
|
-
inputName: string;
|
|
13
|
-
hasPlaceholder: boolean;
|
|
14
|
-
placeholder: string;
|
|
15
|
-
containerClasses?: string;
|
|
16
|
-
inputTextSize?: string;
|
|
17
|
-
inputWidth?: string;
|
|
18
|
-
inputShape?: string;
|
|
19
|
-
borderColor?: string;
|
|
20
|
-
backgroundColor?: string;
|
|
21
|
-
inputBorderClasses?: string;
|
|
22
|
-
additionalClasses?: string;
|
|
23
|
-
buttonText?: JSX.Element;
|
|
24
|
-
buttonClasses?: string;
|
|
25
|
-
buttonIcon?: JSX.Element | null;
|
|
26
|
-
buttonIconClasses?: string;
|
|
27
|
-
onButtonClick: (inputValue: string) => void;
|
|
28
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from "@storybook/react";
|
|
2
|
-
import Slider from "./Slider";
|
|
3
|
-
import { SliderProps } from "./Slider.types";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/Slider',
|
|
7
|
-
component: Slider,
|
|
8
|
-
argTypes: {
|
|
9
|
-
min: {
|
|
10
|
-
control: 'none',
|
|
11
|
-
description: 'The minimum value of the range. Example: `0`',
|
|
12
|
-
},
|
|
13
|
-
title: {
|
|
14
|
-
control: 'none',
|
|
15
|
-
description: 'The title of the range. Example: `Temperature Range`',
|
|
16
|
-
},
|
|
17
|
-
max: {
|
|
18
|
-
control: 'none',
|
|
19
|
-
description: 'The maximum value of the range. Example: `100`',
|
|
20
|
-
},
|
|
21
|
-
step: {
|
|
22
|
-
control: 'none',
|
|
23
|
-
description: 'The step value for the range. Example: `1`',
|
|
24
|
-
},
|
|
25
|
-
minValue: {
|
|
26
|
-
control: 'none',
|
|
27
|
-
description: 'The initial minimum value. Example: `10`',
|
|
28
|
-
},
|
|
29
|
-
maxValue: {
|
|
30
|
-
control: 'none',
|
|
31
|
-
description: 'The initial maximum value. Example: `90`',
|
|
32
|
-
},
|
|
33
|
-
onMinChange: {
|
|
34
|
-
control: 'none',
|
|
35
|
-
description: 'Callback function when the minimum value changes. Example: `(value: number) => console.log(value)`',
|
|
36
|
-
},
|
|
37
|
-
onMaxChange: {
|
|
38
|
-
control: 'none',
|
|
39
|
-
description: 'Callback function when the maximum value changes. Example: `(value: number) => console.log(value)`',
|
|
40
|
-
},
|
|
41
|
-
additionalClasses: {
|
|
42
|
-
control: 'none',
|
|
43
|
-
description: 'Additional CSS classes for the component. Example: `my-custom-slider`',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
tags: ['autodocs'],
|
|
47
|
-
parameters: {
|
|
48
|
-
layout: 'centered',
|
|
49
|
-
},
|
|
50
|
-
} as Meta;
|
|
51
|
-
|
|
52
|
-
const Template: StoryFn<SliderProps> = (args) => <Slider {...args} />;
|
|
53
|
-
|
|
54
|
-
export const Default = Template.bind({});
|
|
55
|
-
Default.args = {
|
|
56
|
-
min: 0,
|
|
57
|
-
max: 100,
|
|
58
|
-
step: 1,
|
|
59
|
-
minValue: 20,
|
|
60
|
-
maxValue: 80,
|
|
61
|
-
onMinChange: (value: number) => console.log('Min value changed:', value),
|
|
62
|
-
onMaxChange: (value: number) => console.log('Max value changed:', value),
|
|
63
|
-
title: 'Range',
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const TemperatureRange = Template.bind({});
|
|
67
|
-
TemperatureRange.args = {
|
|
68
|
-
min: -50,
|
|
69
|
-
max: 50,
|
|
70
|
-
step: 0.5,
|
|
71
|
-
minValue: -10,
|
|
72
|
-
maxValue: 30,
|
|
73
|
-
onMinChange: (value: number) => console.log('Min value changed:', value),
|
|
74
|
-
onMaxChange: (value: number) => console.log('Max value changed:', value),
|
|
75
|
-
title: 'Temperature Range',
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const PriceRange = Template.bind({});
|
|
79
|
-
PriceRange.args = {
|
|
80
|
-
min: 0,
|
|
81
|
-
max: 2000,
|
|
82
|
-
step: 1,
|
|
83
|
-
minValue: 900,
|
|
84
|
-
maxValue: 1578,
|
|
85
|
-
onMinChange: (value: number) => console.log('Min value changed:', value),
|
|
86
|
-
onMaxChange: (value: number) => console.log('Max value changed:', value),
|
|
87
|
-
title: 'Price Range',
|
|
88
|
-
};
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useState } from "react";
|
|
2
|
-
import { SliderProps } from "./Slider.types";
|
|
3
|
-
|
|
4
|
-
const Slider: React.FC<SliderProps> = ({
|
|
5
|
-
min,
|
|
6
|
-
max,
|
|
7
|
-
step,
|
|
8
|
-
minValue,
|
|
9
|
-
maxValue,
|
|
10
|
-
onMinChange,
|
|
11
|
-
onMaxChange,
|
|
12
|
-
additionalClasses = "",
|
|
13
|
-
containerClasses = "p-8 border rounded-lg shadow-md bg-white max-w-lg",
|
|
14
|
-
title = "Range",
|
|
15
|
-
titleClasses = "text-xl text-black mb-4 font-bold",
|
|
16
|
-
minLabel = "Min Value",
|
|
17
|
-
maxLabel = "Max Value",
|
|
18
|
-
labelClasses = "text-sm text-gray-500",
|
|
19
|
-
inputClasses = "mt-2 text-lg font-semibold text-gray-900 border border-gray-300 rounded px-2 py-1 text-center w-20",
|
|
20
|
-
sliderClasses = "relative w-full h-2 bg-gray-300 rounded",
|
|
21
|
-
rangeClasses = "absolute h-2 bg-teal-500 rounded",
|
|
22
|
-
thumbClasses = "absolute w-6 h-6 bg-white border-2 border-teal-500 rounded-full cursor-pointer",
|
|
23
|
-
onAddSection,
|
|
24
|
-
}) => {
|
|
25
|
-
const [minThumbValue, setMinThumbValue] = useState(minValue);
|
|
26
|
-
const [maxThumbValue, setMaxThumbValue] = useState(maxValue);
|
|
27
|
-
const sliderRef = useRef<HTMLDivElement>(null);
|
|
28
|
-
const isDragging = useRef<"min" | "max" | null>(null);
|
|
29
|
-
|
|
30
|
-
const getPercentage = (value: number) =>
|
|
31
|
-
((value - min) / (max - min)) * 100;
|
|
32
|
-
|
|
33
|
-
const handleMinChange = (value: number) => {
|
|
34
|
-
if (value <= maxThumbValue && value >= min) {
|
|
35
|
-
setMinThumbValue(value);
|
|
36
|
-
onMinChange(value);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const handleMaxChange = (value: number) => {
|
|
41
|
-
if (value >= minThumbValue && value <= max) {
|
|
42
|
-
setMaxThumbValue(value);
|
|
43
|
-
onMaxChange(value);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const handlePointerMove = (event: React.PointerEvent) => {
|
|
48
|
-
if (sliderRef.current && isDragging.current) {
|
|
49
|
-
const sliderRect = sliderRef.current.getBoundingClientRect();
|
|
50
|
-
const sliderWidth = sliderRect.width;
|
|
51
|
-
const clickX = event.clientX - sliderRect.left;
|
|
52
|
-
const newValue = min + (clickX / sliderWidth) * (max - min);
|
|
53
|
-
|
|
54
|
-
if (isDragging.current === "min") {
|
|
55
|
-
handleMinChange(Math.round(newValue / step) * step);
|
|
56
|
-
} else if (isDragging.current === "max") {
|
|
57
|
-
handleMaxChange(Math.round(newValue / step) * step);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const handlePointerUp = () => {
|
|
63
|
-
isDragging.current = null;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const handlePointerDown = (thumb: "min" | "max") => {
|
|
67
|
-
isDragging.current = thumb;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<div className={`${containerClasses} ${additionalClasses}`}>
|
|
72
|
-
<h3 className={titleClasses}>{title}</h3>
|
|
73
|
-
<hr className="border-gray-300 mb-6" />
|
|
74
|
-
<div className="flex justify-between gap-4 mb-6">
|
|
75
|
-
<div className="flex flex-col items-center">
|
|
76
|
-
<span className={labelClasses}>{minLabel}</span>
|
|
77
|
-
<input
|
|
78
|
-
type="number"
|
|
79
|
-
value={minThumbValue}
|
|
80
|
-
onChange={(e) => handleMinChange(Number(e.target.value))}
|
|
81
|
-
className={inputClasses}
|
|
82
|
-
/>
|
|
83
|
-
</div>
|
|
84
|
-
<div className="flex flex-col items-center">
|
|
85
|
-
<span className={labelClasses}>{maxLabel}</span>
|
|
86
|
-
<input
|
|
87
|
-
type="number"
|
|
88
|
-
value={maxThumbValue}
|
|
89
|
-
onChange={(e) => handleMaxChange(Number(e.target.value))}
|
|
90
|
-
className={inputClasses}
|
|
91
|
-
/>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
<div
|
|
95
|
-
className={sliderClasses}
|
|
96
|
-
ref={sliderRef}
|
|
97
|
-
onPointerMove={handlePointerMove}
|
|
98
|
-
onPointerUp={handlePointerUp}
|
|
99
|
-
onPointerCancel={handlePointerUp}
|
|
100
|
-
onPointerLeave={handlePointerUp}
|
|
101
|
-
>
|
|
102
|
-
<div
|
|
103
|
-
className={rangeClasses}
|
|
104
|
-
style={{
|
|
105
|
-
left: `${getPercentage(minThumbValue)}%`,
|
|
106
|
-
right: `${100 - getPercentage(maxThumbValue)}%`,
|
|
107
|
-
}}
|
|
108
|
-
/>
|
|
109
|
-
<div
|
|
110
|
-
className={thumbClasses}
|
|
111
|
-
style={{
|
|
112
|
-
left: `${getPercentage(minThumbValue)}%`,
|
|
113
|
-
transform: "translate(-50%, -50%)",
|
|
114
|
-
top: "50%",
|
|
115
|
-
zIndex: 5,
|
|
116
|
-
}}
|
|
117
|
-
onPointerDown={() => handlePointerDown("min")}
|
|
118
|
-
/>
|
|
119
|
-
<div
|
|
120
|
-
className={thumbClasses}
|
|
121
|
-
style={{
|
|
122
|
-
left: `${getPercentage(maxThumbValue)}%`,
|
|
123
|
-
transform: "translate(-50%, -50%)",
|
|
124
|
-
top: "50%",
|
|
125
|
-
zIndex: 4,
|
|
126
|
-
}}
|
|
127
|
-
onPointerDown={() => handlePointerDown("max")}
|
|
128
|
-
/>
|
|
129
|
-
</div>
|
|
130
|
-
{onAddSection && (
|
|
131
|
-
<button onClick={onAddSection} className="mt-4 text-blue-500">
|
|
132
|
-
Add Section
|
|
133
|
-
</button>
|
|
134
|
-
)}
|
|
135
|
-
</div>
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
export default Slider;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface SliderProps {
|
|
2
|
-
min: number;
|
|
3
|
-
max: number;
|
|
4
|
-
step: number;
|
|
5
|
-
minValue: number;
|
|
6
|
-
maxValue: number;
|
|
7
|
-
onMinChange: (value: number) => void;
|
|
8
|
-
onMaxChange: (value: number) => void;
|
|
9
|
-
additionalClasses?: string;
|
|
10
|
-
containerClasses?: string;
|
|
11
|
-
title?: string;
|
|
12
|
-
titleClasses?: string;
|
|
13
|
-
minLabel?: string;
|
|
14
|
-
maxLabel?: string;
|
|
15
|
-
labelClasses?: string;
|
|
16
|
-
inputClasses?: string;
|
|
17
|
-
sliderClasses?: string;
|
|
18
|
-
rangeClasses?: string;
|
|
19
|
-
thumbClasses?: string;
|
|
20
|
-
onAddSection?: () => void;
|
|
21
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AdminSubmenuProps } from "./types";
|
|
3
|
-
|
|
4
|
-
const AdminSubmenu: React.FC<AdminSubmenuProps> = ({
|
|
5
|
-
callToActionChildren,
|
|
6
|
-
secondCallToActionChildren,
|
|
7
|
-
menuClasses = "p-4 bg-white rounded-lg shadow-lg",
|
|
8
|
-
}) => {
|
|
9
|
-
return (
|
|
10
|
-
<div className={menuClasses}>
|
|
11
|
-
<div>{callToActionChildren}</div>
|
|
12
|
-
<div>{secondCallToActionChildren}</div>
|
|
13
|
-
</div>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default AdminSubmenu;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import AlertSubmenuItem from "./AlertSubmenuItem";
|
|
3
|
-
import { AlertSubmenuProps } from "./types";
|
|
4
|
-
|
|
5
|
-
const AlertSubmenu: React.FC<AlertSubmenuProps> = ({
|
|
6
|
-
data,
|
|
7
|
-
newAlertCount,
|
|
8
|
-
newAlertColor,
|
|
9
|
-
onClearAlerts,
|
|
10
|
-
newAlertCountClasses = "text-gray-900 font-semibold",
|
|
11
|
-
clearAlertsTextClasses = "text-blue-600 hover:underline",
|
|
12
|
-
clearAlertsText = "Mark all as Read",
|
|
13
|
-
menuContainerClasses = "rounded-lg border border-stroke bg-white shadow-lg",
|
|
14
|
-
menuHeaderContainerClasses = "flex justify-between items-center p-4 border-b border-gray-200",
|
|
15
|
-
alertListContainerClasses = "overflow-y-auto max-h-[300px] divide-y divide-gray-200",
|
|
16
|
-
}) => {
|
|
17
|
-
const alertList = data.map((alert, index) => (
|
|
18
|
-
<AlertSubmenuItem
|
|
19
|
-
key={index}
|
|
20
|
-
link={alert.link}
|
|
21
|
-
title={alert.title}
|
|
22
|
-
subtitle={alert.subtitle}
|
|
23
|
-
status={alert.status}
|
|
24
|
-
statusColor={newAlertColor}
|
|
25
|
-
externalLink={alert.externalLink}
|
|
26
|
-
titleClasses="font-medium text-gray-900"
|
|
27
|
-
externalLinkClasses="text-sm text-blue-600"
|
|
28
|
-
subtitleClasses="text-sm text-gray-500"
|
|
29
|
-
itemContainerClasses="p-4 hover:bg-gray-50"
|
|
30
|
-
/>
|
|
31
|
-
));
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<div className={menuContainerClasses}>
|
|
35
|
-
<div className={menuHeaderContainerClasses}>
|
|
36
|
-
<span className={newAlertCountClasses}>
|
|
37
|
-
{newAlertCount} alerts
|
|
38
|
-
</span>
|
|
39
|
-
<button
|
|
40
|
-
className={clearAlertsTextClasses}
|
|
41
|
-
onClick={onClearAlerts}
|
|
42
|
-
>
|
|
43
|
-
{clearAlertsText}
|
|
44
|
-
</button>
|
|
45
|
-
</div>
|
|
46
|
-
<div className={alertListContainerClasses}>
|
|
47
|
-
<ul>{alertList}</ul>
|
|
48
|
-
<div className="text-center p-4 text-gray-500">
|
|
49
|
-
All up to date!
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export default AlertSubmenu;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AlertSubmenuItemProps } from "./types";
|
|
3
|
-
|
|
4
|
-
const AlertSubmenuItem: React.FC<AlertSubmenuItemProps> = ({
|
|
5
|
-
link = "#",
|
|
6
|
-
title,
|
|
7
|
-
externalLink,
|
|
8
|
-
subtitle,
|
|
9
|
-
status,
|
|
10
|
-
statusColor = "bg-blue-500",
|
|
11
|
-
itemContainerClasses = "flex justify-between items-center p-4",
|
|
12
|
-
titleClasses = "font-medium text-gray-900",
|
|
13
|
-
externalLinkClasses = "text-sm text-blue-600",
|
|
14
|
-
subtitleClasses = "text-sm text-gray-500",
|
|
15
|
-
}) => {
|
|
16
|
-
return (
|
|
17
|
-
<li className={itemContainerClasses}>
|
|
18
|
-
<a href={link} className="flex items-start gap-4">
|
|
19
|
-
<div className="flex-shrink-0 pt-2">
|
|
20
|
-
{status && (
|
|
21
|
-
<span
|
|
22
|
-
className={`inline-block w-3 h-3 rounded-full ${statusColor}`}
|
|
23
|
-
aria-label="New"
|
|
24
|
-
></span>
|
|
25
|
-
)}
|
|
26
|
-
</div>
|
|
27
|
-
<div>
|
|
28
|
-
<h6 className={titleClasses}>{title}</h6>
|
|
29
|
-
{externalLink && (
|
|
30
|
-
<p className={externalLinkClasses}>{externalLink}</p>
|
|
31
|
-
)}
|
|
32
|
-
<p className={subtitleClasses}>{subtitle}</p>
|
|
33
|
-
</div>
|
|
34
|
-
</a>
|
|
35
|
-
</li>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default AlertSubmenuItem;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export interface AlertSubmenuItemProps {
|
|
3
|
-
link?: string;
|
|
4
|
-
title: string;
|
|
5
|
-
externalLink?: string;
|
|
6
|
-
subtitle?: string;
|
|
7
|
-
status?: string;
|
|
8
|
-
statusColor?: string;
|
|
9
|
-
itemContainerClasses?: string;
|
|
10
|
-
titleClasses?: string;
|
|
11
|
-
externalLinkClasses?: string;
|
|
12
|
-
subtitleClasses?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface AlertSubmenuProps<T = Record<string, any>> {
|
|
16
|
-
data: T[];
|
|
17
|
-
newAlertCount?: number;
|
|
18
|
-
newAlertColor?: string;
|
|
19
|
-
onClearAlerts?: () => void;
|
|
20
|
-
newAlertCountClasses?: string;
|
|
21
|
-
clearAlertsTextClasses?: string;
|
|
22
|
-
clearAlertsText?: string;
|
|
23
|
-
menuContainerClasses?: string;
|
|
24
|
-
menuHeaderContainerClasses?: string;
|
|
25
|
-
alertListContainerClasses?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface AdminSubmenuProps {
|
|
29
|
-
callToActionChildren?: JSX.Element;
|
|
30
|
-
secondCallToActionChildren?: JSX.Element;
|
|
31
|
-
menuClasses?: string;
|
|
32
|
-
}
|