@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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { withStoryBook } from "../../hoc";
|
|
3
|
+
import Hero from "../Hero/Hero";
|
|
4
|
+
import PageSection from "../PageSection/PageSection";
|
|
5
|
+
import Badge from "../Badge/Badge";
|
|
6
|
+
import Text from "../Text/Text";
|
|
7
|
+
import Image from "../Image/Image";
|
|
8
|
+
import Input from "../Input/Input";
|
|
9
|
+
import Nav from "../Nav/Nav";
|
|
10
|
+
import Card from "../Card/Card";
|
|
11
|
+
import FormButton from "../FormButton";
|
|
12
|
+
import CompassCardTemplate from "../Card/templates/CompassCardTemplate";
|
|
13
|
+
import ViewTemplatePage from "./ViewPageTemplate";
|
|
14
|
+
import Footer from "../Footer/Footer";
|
|
15
|
+
import GenericList from "../GenericList/GenericList";
|
|
16
|
+
import { DUMMYCOMPASSNAVDATA } from "../Nav/DUMMYNAVDATA.json";
|
|
17
|
+
import { DUMMYCOMPASSPRODUCTDATA } from "../Card/DUMMYPRODUCTDATA.json";
|
|
18
|
+
import TableDataDummy from "./TableDataDummy";
|
|
19
|
+
import Header from "../Header/Header";
|
|
20
|
+
import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
|
|
21
|
+
// Wrap your component with the HOC
|
|
22
|
+
const StorybookViewTemplatePage = withStoryBook(ViewTemplatePage);
|
|
23
|
+
export default {
|
|
24
|
+
title: "Page/ViewPageTemplate",
|
|
25
|
+
component: ViewTemplatePage,
|
|
26
|
+
argTypes: {
|
|
27
|
+
children: {
|
|
28
|
+
control: {
|
|
29
|
+
disable: true,
|
|
30
|
+
},
|
|
31
|
+
description: "nodes that can be passed to the component",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
tags: ["autodocs"],
|
|
35
|
+
};
|
|
36
|
+
const Template = (args) => (_jsx(StorybookViewTemplatePage, { ...args, storybookStyle: {
|
|
37
|
+
backgroundColor: args.bgColor,
|
|
38
|
+
} }));
|
|
39
|
+
export const DefaultView = Template.bind({});
|
|
40
|
+
DefaultView.args = {
|
|
41
|
+
children: (_jsx("div", { className: "min-h-96 flex items-center justify-center", children: _jsx(PageSection, { children: _jsx(_Fragment, { children: "Default page" }) }, "pageSectionTwo") })),
|
|
42
|
+
};
|
|
43
|
+
export const ViewWithHeroAndCardsWithGlassHeader = Template.bind({});
|
|
44
|
+
ViewWithHeroAndCardsWithGlassHeader.args = {
|
|
45
|
+
children: [
|
|
46
|
+
//the div acts as a spacer for the header because the header is fixed
|
|
47
|
+
_jsx("div", { className: "h-16" }, "spacer"),
|
|
48
|
+
_jsx("div", { className: "fixed top-0 w-full z-[1000]", children: _jsx(Header, { mobileLeft: true, hasIcons: true, hasSearchBar: true, hasBadge: true, hasNavItems: true, hasMobileMenu: true, logoBorderRadius: true, logoHoverColor: "hover:bg-blue-500", backgroundColor: "bg-gray-500", bottomBorderColor: "border-black", mobileOpenIcon: getFontAwesomeIcon("hamburger"), mobileCloseIcon: getFontAwesomeIcon("x"), mobileMenuBackground: "bg-blue-500", hasMobileIcons: true, hasMobileNavItems: true, hasMobileBadge: false, hasMobileSearchBar: true, hasAnimatedHamburgerButton: true, icons: _jsx(_Fragment, {}), badge: _jsx(Badge, { type: "href", to: "#", hoverColor: "hover:text-blue-500", borderColor: "border-none", mobileIcon: getFontAwesomeIcon("phone"), mobileIconLabel: "Contact Us", onClick: () => alert("Redirect to Contact Us page"), image: _jsx(Image, { src: "../../../assets/contact-image.png", alt: "", background: false, additionalClasses: "flex justify-center w-8 h-8 max-md:hidden" }), text: _jsxs(_Fragment, { children: [_jsx(Text, { size: "text-sm", color: "text-black", fontFamily: "font-serif", text: "Contact Us", tag: "h2", additionalClasses: "pl-2 pb-0 font-bold" }), _jsx(Text, { size: "text-xs", color: "text-black", fontFamily: "font-serif", text: "1-800-800-8000", tag: "p", additionalClasses: "pl-2 pt-0" })] }) }), logo: _jsx(Image, { src: "../../../assets/Logo.png", alt: "Generic Company Logo.", background: false, additionalClasses: " w-40 p-2" }), nav: _jsx(Nav, { navData: DUMMYCOMPASSNAVDATA, navBackgroundColor: "#FFFFF", parentHoverBackground: "none", parentHoverFontColor: "text-black", parentHoverUnderline: true, parentHoverBorderColor: "none", parentShape: "rounded", parentBackground: "none", parentBorderColor: "none", submenuBackgroundColor: "bg-white", submenuHoverBackground: "hover:bg-blue-500", submenuHoverBorderStyle: "top-bottom", submenuHoverBorderColor: "border-blue-500", includeSubmenuImages: true, mobileBreakpoint: "extraLarge", accordionParentStyle: "rounded p-2 w-full border-b-2 border-b-blue-700 text-black", accordionExpandedStyle: "pl-2 py-3" }), input: _jsx(Input, { labelVisible: false, label: undefined, inputType: "text", inputName: "search", borderColor: "border-gray-500", hasPlaceholder: true, placeholder: "Search", hasButton: true, backgroundColor: "bg-white", additionalClasses: "bg-blue-500", button: _jsx(FormButton, { icon: getFontAwesomeIcon("search"), backgroundColor: "bg-blue-500", hoverBackground: "hover:bg-black", hoverFontColor: "hover:text-white", additionalClasses: "h-full w-8 justify-center", shape: "none" }), inputWidth: "w-full" }) }) }, "header"),
|
|
49
|
+
_jsx(Hero, { textAlignment: "center", background: "image" }, "hero"),
|
|
50
|
+
_jsx(PageSection, { sectionContainerClasses: "flex flex-col w-full h-full bg-slate-100 p-6\n justify-center items-center max-sm:p-2 max-w-pageSectionMaxWidth mx-auto", children: _jsx(GenericList, { data: DUMMYCOMPASSPRODUCTDATA, listType: "unordered", hasVirtualization: false, containerClasses: "w-full h-[100%] grid grid-cols-4 gap-y-12 gap-x-8 max-lg:grid-cols-2 max-lg:gap-y-12 max-lg:gap-x-2 max-md:gap-12 max-sm:w-[90%] max-sm:gap-8 justify-items-center", renderItem: (item) => (_jsx(Card, { containerClasses: "w-full h-full shadow-md overflow-hidden rounded-md transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300 max-lg:transition-none max-lg:hover:transform-none max-w-72", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(CompassCardTemplate, { data: { ...item, title: "" } }) }, item.id)) }) }, "pageSectionOne"),
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
export const ViewWithTable = Template.bind({});
|
|
54
|
+
ViewWithTable.args = {
|
|
55
|
+
children: [
|
|
56
|
+
_jsx(Hero, { textAlignment: "center", background: "gradient" }, "hero"),
|
|
57
|
+
_jsx(PageSection, { children: _jsx(TableDataDummy, {}) }, "pageSectionFour"),
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
export const ViewWithTableAndTitle = Template.bind({});
|
|
61
|
+
ViewWithTableAndTitle.args = {
|
|
62
|
+
children: [
|
|
63
|
+
_jsx(Hero, { textAlignment: "left", background: "gradient" }, "hero"),
|
|
64
|
+
_jsx(PageSection, { children: _jsx(Text, { size: "text-2xl", color: "text-black", text: "Staff", fontFamily: "", tag: "h1", additionalClasses: "font-bold" }) }, "37"),
|
|
65
|
+
_jsx(PageSection, { children: _jsx(TableDataDummy, {}) }, "pageSectionFive"),
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
export const CompassPageView = Template.bind({});
|
|
69
|
+
CompassPageView.args = {
|
|
70
|
+
children: [
|
|
71
|
+
_jsxs("div", { children: [_jsx("div", { className: "h-16" }), _jsx("div", { className: "fixed top-0 w-full z-[1000]", children: _jsx(Header, { mobileLeft: true, icons: _jsx(_Fragment, {}), hasIcons: true, hasSearchBar: true, hasBadge: true, hasNavItems: true, hasMobileMenu: true, hasAnimatedHamburgerButton: true, logoBorderRadius: true, logoHoverColor: "hover:bg-green-500", backgroundColor: "bg-gray-500", bottomBorderColor: "border-green-500", mobileOpenIcon: getFontAwesomeIcon("hamburger"), mobileCloseIcon: getFontAwesomeIcon("x"), mobileMenuBackground: "bg-green-500", hasMobileIcons: true, hasMobileNavItems: true, hasMobileBadge: false, hasMobileSearchBar: true, badge: _jsx(Badge, { type: "href", to: "#", hoverColor: "hover:text-green-500", borderColor: "border-none", mobileIcon: getFontAwesomeIcon("phone"), mobileIconLabel: "Contact Us", onClick: () => alert("Redirect to Contact Us page"), image: _jsx(Image, { src: "../../../assets/contact-image.png", alt: "", background: false, additionalClasses: "flex justify-center w-8 h-8 max-md:hidden" }), text: _jsxs(_Fragment, { children: [_jsx(Text, { size: "text-sm", color: "text-black", fontFamily: "font-serif", text: "Contact Us", tag: "h2", additionalClasses: "pl-2 pb-0 font-bold" }), _jsx(Text, { size: "text-xs", color: "text-black", fontFamily: "font-serif", text: "1-800-800-8000", tag: "p", additionalClasses: "pl-2 pt-0" })] }) }), logo: _jsx(Image, { src: "../../../assets/compass-logo.png", alt: "Generic Company Logo.", background: false, additionalClasses: " w-40 p-2" }), nav: _jsx(Nav, { navData: DUMMYCOMPASSNAVDATA, navBackgroundColor: "#FFFFF", parentHoverBackground: "none", parentHoverFontColor: "text-black", parentHoverUnderline: true, parentHoverBorderColor: "none", parentShape: "rounded", parentBackground: "none", parentBorderColor: "none", submenuBackgroundColor: "bg-white", submenuHoverBackground: "hover:bg-green-500", submenuHoverBorderStyle: "top-bottom", submenuHoverBorderColor: "border-green-500", includeSubmenuImages: true, mobileBreakpoint: "extraLarge", accordionParentStyle: "rounded p-2 w-full border-b-2 border-b-teal-700 text-black", accordionExpandedStyle: "pl-2 py-3" }), input: _jsx(Input, { labelVisible: false, label: undefined, inputType: "text", inputName: "search", borderColor: "border-gray-500", hasPlaceholder: true, placeholder: "Search", hasButton: true, backgroundColor: "bg-white", additionalClasses: "bg-blue-500", button: _jsx(FormButton, { icon: getFontAwesomeIcon("search"), backgroundColor: "bg-green-500", hoverBackground: "hover:bg-black", hoverFontColor: "hover:text-white", additionalClasses: "h-full w-8 justify-center", shape: "none" }), inputWidth: "w-full" }) }) }), _jsx(Hero, { textAlignment: "left", background: "image", src: "../../../assets/compass-tech-hero-bg.png", text: _jsx(Text, { size: "text-2xl", color: "text-white", fontFamily: "font-serif", text: "Equip your team with exactly what they need", tag: "h1", additionalClasses: "w-3/4 max-sm:text-xl max-sm:w-3/4" }) }, "hero"), _jsx(PageSection, { sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6\n justify-center items-center h-[100%]", children: _jsx(Text, { size: "text-2xl", color: "text-black", fontFamily: "font-serif", text: "Kits", tag: "h2", additionalClasses: "my-4 max-sm:text-xl" }) }, "pageSection"), _jsx(PageSection, { sectionContainerClasses: "flex flex-col w-full h-full bg-slate-100 p-6\n justify-center items-center max-sm:p-2 max-w-pageSectionMaxWidth mx-auto", children: _jsx(GenericList, { data: DUMMYCOMPASSPRODUCTDATA, hasVirtualization: false, listType: "unordered", containerClasses: "w-full grid grid-cols-4 gap-y-12 gap-x-8 max-lg:grid-cols-2 max-lg:gap-y-12 max-lg:gap-x-2 max-md:gap-12 max-sm:w-[90%] max-sm:gap-8 justify-items-center", renderItem: (item) => (_jsx(Card, { containerClasses: "w-full h-full shadow-md overflow-hidden rounded-md transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300 max-lg:transition-none max-lg:hover:transform-none max-w-72", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(CompassCardTemplate, { data: { ...item, title: "" } }) }, item.id)) }) }, "pageSectionOne"), _jsxs(PageSection, { sectionContainerClasses: "flex w-full bg-yellow-400 flex p-6 justify-center items-center h-[100%] mt-6 max-sm:flex-col", children: [_jsx(Text, { size: "text-xl", color: "text-black", fontFamily: "font-serif", text: "Help us improve your experience:", tag: "h2", additionalClasses: "p-6 max-sm:p-2 max-sm:text-lg" }), _jsx(FormButton, { text: _jsx(Text, { size: "", color: "", text: "Take the Survey!", fontFamily: "" }), backgroundColor: "bg-green-500", shape: "rounded", borderColor: "border-none", hoverBackground: "hover:bg-green-500", hoverFontColor: "hover:text-green-500", hoverBorderColor: "hover:border-green-500", hoverUnderline: true, onClick: () => alert("Button clicked!"), as: "a" })] }), _jsx(Footer, { logo: _jsx(Image, { src: "../../../assets/compass-logo.png", alt: "Generic Compass Logo.", background: false, additionalClasses: " w-40 p-2" }), title: _jsx(Text, { size: "text-xl", color: "", text: "Compass Website", fontFamily: "", tag: "h2", additionalClasses: "font-bold uppercase pl-2 mt-2" }), slogan: _jsx(Text, { size: "text-md", color: "", text: "Great slogan goes here.", fontFamily: "", tag: "p", additionalClasses: "pl-2" }), copyRightText: _jsx(Text, { size: "md", color: "text-black", text: "Copyright \u00A9 2024 - All right reserved by Generic Company", fontFamily: "", additionalClasses: "text-center" }), socialTitle: _jsx(Text, { size: "md", color: "text-black", text: "Connect", fontFamily: "", additionalClasses: "font-bold uppercase w-full" }), contactTitle: _jsx(Text, { size: "md", color: "text-black", text: "Contact Us:", fontFamily: "", additionalClasses: "font-bold uppercase" }), logoBorderRadius: true, hasNavItems: true, hasSocial: true, logoHoverColor: "hover:bg-green-500", backgroundColor: "bg-green-500", accordionGap: "gap-1", copyRightTextPlacement: "center", socialPlacement: "center", accordionParentStyle: "border-b border-black p-2 w-full", accordionExpandedStyle: "pl-3 py-3" })] }, "randomNumberOne"),
|
|
72
|
+
],
|
|
73
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import { describe, expect, beforeEach, test, it } from "vitest";
|
|
4
|
+
import ViewTemplatePage from "./ViewPageTemplate";
|
|
5
|
+
import Hero from "../Hero/Hero";
|
|
6
|
+
import PageSection from "../PageSection/PageSection";
|
|
7
|
+
import Badge from "../Badge/Badge";
|
|
8
|
+
import Text from "../Text/Text";
|
|
9
|
+
import Image from "../Image/Image";
|
|
10
|
+
import Nav from "../Nav/Nav";
|
|
11
|
+
import Card from "../Card/Card";
|
|
12
|
+
import FormButton from "../FormButton";
|
|
13
|
+
import CompassCardTemplate from "../Card/templates/CompassCardTemplate";
|
|
14
|
+
import Footer from "../Footer/Footer";
|
|
15
|
+
import { DUMMYICONCOMPASSDATA } from "../Header/DUMMYICONDATA.json";
|
|
16
|
+
import { DUMMYCOMPASSNAVDATA } from "../Nav/DUMMYNAVDATA.json";
|
|
17
|
+
import { DUMMYCOMPASSPRODUCTDATA } from "../Card/DUMMYPRODUCTDATA.json";
|
|
18
|
+
import Header from "../Header/Header";
|
|
19
|
+
import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
|
|
20
|
+
import GenericList from "../GenericList/GenericList";
|
|
21
|
+
describe("<ViewTemplatePage />", () => {
|
|
22
|
+
it("renders with default background color", () => {
|
|
23
|
+
const { container } = render(_jsx(ViewTemplatePage, { children: _jsx("p", { children: "Content goes here" }) }));
|
|
24
|
+
// Check if the default background color is applied
|
|
25
|
+
expect(container.firstChild).toHaveClass("bg-gray-100");
|
|
26
|
+
});
|
|
27
|
+
it("renders with custom background color", () => {
|
|
28
|
+
const customBgColor = "bg-red-500";
|
|
29
|
+
const { container } = render(_jsx(ViewTemplatePage, { bgColor: customBgColor, children: _jsx("p", { children: "Content goes here" }) }));
|
|
30
|
+
// Check if the custom background color is applied
|
|
31
|
+
expect(container.firstChild).toHaveClass(customBgColor);
|
|
32
|
+
});
|
|
33
|
+
it("renders children correctly", () => {
|
|
34
|
+
const { getByText } = render(_jsx(ViewTemplatePage, { children: _jsx("p", { children: "Test child content" }) }));
|
|
35
|
+
// Check if the child content is rendered
|
|
36
|
+
expect(getByText("Test child content")).toBeInTheDocument();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
describe("<ViewTemplatePage />", () => {
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
render(_jsxs(ViewTemplatePage, { children: ["children: [ ", _jsx("div", { className: "h-16" }), ",", _jsx("div", { className: "fixed top-0 w-full z-[1000]", children: _jsx(Header, { hasIcons: true, iconsData: DUMMYICONCOMPASSDATA, logoBorderRadius: true, hasSearchBar: true, hasBadge: true, hasNavItems: true, logoHoverColor: "green", backgroundColor: "gray", bottomBorderColor: "green", badge: _jsx(Badge, { type: "href", to: "#", hoverColor: "green", borderColor: "none", mobileIcon: getFontAwesomeIcon("phone"), mobileIconLabel: "Contact Us", onClick: () => alert("Redirect to Contact Us page"), image: _jsx(Image, { src: "../../../assets/contact-image.png", alt: "", background: false, additionalClasses: "flex justify-center w-8 h-8 max-md:hidden" }), text: _jsxs(_Fragment, { children: [_jsx(Text, { size: "sm", color: "primary", fontFamily: "serif", text: "Contact Us", tag: "h2", additionalClasses: "pl-2 pb-0 font-bold" }), _jsx(Text, { size: "xs", color: "primary", fontFamily: "serif", text: "1-800-800-8000", tag: "p", additionalClasses: "pl-2 pt-0" })] }) }), logo: _jsx(Image, { src: "../../../assets/compass-logo.png", alt: "Generic Company Logo.", background: false, additionalClasses: " w-40 p-2" }), nav: _jsx(Nav, { navData: DUMMYCOMPASSNAVDATA, navBackgroundColor: "#FFFFF", parentHoverBackground: "none", parentHoverFontColor: "black", parentHoverUnderline: true, parentHoverBorderColor: "none", parentShape: "cornered", parentBackground: "none", parentBorderColor: "none", submenuBackgroundColor: "white", submenuHoverBackground: "green", submenuHoverBorderStyle: "top-bottom", submenuHoverBorderColor: "green", includeSubmenuImages: true, mobileBreakpoint: "extraLarge", accordionParentStyle: "cornered p-2 w-full border-b-2 border-b-teal-700 text-black", accordionExpandedStyle: "pl-2 py-3" }) }) }), ",", _jsx(Hero, { textAlignment: "right", background: "image", src: "../../../assets/compass-tech-hero-bg.png", text: _jsx(Text, { size: "xxxl", color: "white", fontFamily: "serif", text: "Equip your team with exactly what they need", tag: "h1", additionalClasses: "text-left w-3/4 max-xl:text-xl max-lg:text-xl max-md:hidden" }) }, "hero"), ",", _jsx("div", { "data-testid": "kits-header-section", children: _jsx(PageSection, { sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6\n\t\t\t\tjustify-center items-center h-[100%]", children: _jsx(Text, { size: "xxxl", color: "black", fontFamily: "serif", text: "Kits", tag: "h2", additionalClasses: "my-8" }) }, "pageSection") }), ",", _jsx("div", { "data-testid": "kits-cards-section", children: _jsx(PageSection, { sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6\n\t\t\tjustify-center items-center h-[100%]", children: _jsx(_Fragment, { children: _jsx("div", { className: "w-3/4 grid grid-cols-4 gap-8 h-[100%] max-xl:gap-1 max-lg:grid-cols-2 max-lg:gap-y-24 max-lg:justify-items-center", children: _jsx(GenericList, { data: DUMMYCOMPASSPRODUCTDATA, listType: "none", renderItem: (item) => (_jsx(Card, { containerClasses: "w-3/4", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(CompassCardTemplate, { data: item }) }, item.id)) }) }) }) }, "pageSection") }), ",", _jsx("div", { "data-testid": "survey-section", children: _jsxs(PageSection, { sectionContainerClasses: "w-full bg-yellow-400 flex p-6\n\t\t\t\tjustify-center items-center h-[100%] mt-6", children: [_jsx(Text, { size: "xl", color: "black", fontFamily: "serif", text: "Equip your team with exactly what they need", tag: "h1", additionalClasses: "mr-8" }), _jsx(FormButton, { text: _jsx(Text, { size: "", color: "", text: "Take the Survey!", fontFamily: "" }), shape: "semiRounded", borderColor: "none", hoverBackground: "green", hoverFontColor: "green", hoverBorderColor: "green", hoverUnderline: true, onClick: () => alert("Button clicked!"), as: "a" })] }) }), ",", _jsx(Footer, { logo: _jsx(Image, { src: "../../../assets/compass-logo.png", alt: "Generic Compass Logo.", background: false, additionalClasses: " w-40 p-2" }), title: _jsx(Text, { size: "xl", color: "", text: "Compass Website", fontFamily: "", tag: "h2", additionalClasses: "font-bold uppercase pl-2 mt-2 max-md:text-sm" }), slogan: _jsx(Text, { size: "md", color: "", text: "Great slogan goes here.", fontFamily: "", tag: "p", additionalClasses: "pl-2" }), copyRightText: _jsx(Text, { size: "md", color: "black", text: "Copyright \u00A9 2024 - All right reserved by Generic Company", fontFamily: "", additionalClasses: "text-center" }), socialTitle: _jsx(Text, { size: "md", color: "black", text: "Connect", fontFamily: "", additionalClasses: "font-bold uppercase w-full" }), contactTitle: _jsx(Text, { size: "md", color: "black", text: "Contact Us:", fontFamily: "", additionalClasses: "font-bold uppercase" }), logoBorderRadius: true, hasNavItems: true, hasSocial: true, logoHoverColor: "green", backgroundColor: "green", accordionGap: "gap-1", copyRightTextPlacement: "center", socialPlacement: "center", accordionParentStyle: "border-b border-black p-2 w-full", accordionExpandedStyle: "pl-3 py-3" }), ", ]"] }));
|
|
42
|
+
});
|
|
43
|
+
test("renders header on page", () => {
|
|
44
|
+
const header = screen.getByTestId("header");
|
|
45
|
+
expect(header).toBeInTheDocument();
|
|
46
|
+
});
|
|
47
|
+
test("renders hero on page", () => {
|
|
48
|
+
const hero = screen.getByTestId("image-background-hero");
|
|
49
|
+
expect(hero).toBeInTheDocument();
|
|
50
|
+
});
|
|
51
|
+
test("renders hero on page", () => {
|
|
52
|
+
const hero = screen.getByTestId("image-background-hero");
|
|
53
|
+
expect(hero).toBeInTheDocument();
|
|
54
|
+
});
|
|
55
|
+
test("renders kits header on page", () => {
|
|
56
|
+
const kitsHeading = screen.getByTestId("kits-header-section");
|
|
57
|
+
expect(kitsHeading).toBeInTheDocument();
|
|
58
|
+
});
|
|
59
|
+
test("renders cards section on page", () => {
|
|
60
|
+
const kitsCards = screen.getByTestId("kits-cards-section");
|
|
61
|
+
expect(kitsCards).toBeInTheDocument();
|
|
62
|
+
});
|
|
63
|
+
test("renders survey section on page", () => {
|
|
64
|
+
const surveySection = screen.getByTestId("survey-section");
|
|
65
|
+
expect(surveySection).toBeInTheDocument();
|
|
66
|
+
});
|
|
67
|
+
test("renders footer on page", () => {
|
|
68
|
+
const footer = screen.getByTestId("footer");
|
|
69
|
+
expect(footer).toBeInTheDocument();
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Section from ".";
|
|
3
|
+
import Card from "../Card/Card";
|
|
4
|
+
import Text from "../Text/Text";
|
|
5
|
+
import GenericList from "../GenericList/GenericList";
|
|
6
|
+
import { DUMMYPRODUCTDATA, DUMMYCOMPASSPRODUCTDATA, } from "../../components/Card/DUMMYPRODUCTDATA.json";
|
|
7
|
+
import HorizontalCardTemplate from "../Card/templates/HorizontalCardTemplate";
|
|
8
|
+
import CompassCardTemplate from "../Card/templates/CompassCardTemplate";
|
|
9
|
+
export default {
|
|
10
|
+
title: "Components/Section",
|
|
11
|
+
component: Section,
|
|
12
|
+
argTypes: {
|
|
13
|
+
children: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "none",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
sectionContainerClasses: {
|
|
19
|
+
control: {
|
|
20
|
+
type: "none",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
const Template = (args) => _jsx(Section, { ...args });
|
|
26
|
+
export const Default = Template.bind({});
|
|
27
|
+
Default.args = {
|
|
28
|
+
sectionContainerClasses: " flex flex-row justify-center items-center flex-wrap lg:gap-10 gap-4 my-20 lg:max-h-view-page max-h-fit min-h-fit overflow-scroll px-4",
|
|
29
|
+
children: (_jsxs(_Fragment, { children: [_jsx("div", { className: "bg-red-400 p-4", children: "Content 1" }), _jsx("div", { className: "bg-green-400 p-4", children: "Content 2" }), _jsx("div", { className: "bg-blue-400 p-4", children: "Content 3" })] })),
|
|
30
|
+
};
|
|
31
|
+
export const HorizontalCardsSection = Template.bind({});
|
|
32
|
+
HorizontalCardsSection.args = {
|
|
33
|
+
sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6 justify-center items-center",
|
|
34
|
+
children: (_jsxs(_Fragment, { children: [_jsx(Text, { tag: "h1", size: "lg", text: "Example of a section with horizontal cards:", color: "black", fontFamily: "", additionalClasses: "pb-12" }), _jsx(GenericList, { data: DUMMYPRODUCTDATA, listType: "none", renderItem: (item) => (_jsx(Card, { containerClasses: "flex mb-6 max-sm:w-1/2 max-sm:flex-col overflow-hidden", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(HorizontalCardTemplate, { data: item }) }, item.id)) })] })),
|
|
35
|
+
};
|
|
36
|
+
export const CompassCardsSection = Template.bind({});
|
|
37
|
+
CompassCardsSection.args = {
|
|
38
|
+
sectionContainerClasses: "w-full bg-slate-100 flex flex-col p-6 justify-center items-center h-[100%]",
|
|
39
|
+
children: (_jsxs(_Fragment, { children: [_jsx(Text, { tag: "h1", size: "lg", text: "Example of a section with horizontal cards:", color: "black", fontFamily: "", additionalClasses: "pb-12" }), _jsx(GenericList, { data: DUMMYCOMPASSPRODUCTDATA, listType: "none", containerClasses: "w-full grid grid-cols-4 gap-y-12 gap-x-8 h-full max-lg:grid-cols-2 max-lg:gap-y-12 max-lg:gap-x-2 max-md:gap-12 max-sm:w-[90%] max-sm:gap-8 justify-items-center", renderItem: (item) => (_jsx(Card, { containerClasses: "w-full h-full shadow-md overflow-hidden rounded-md transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300 max-lg:transition-none max-lg:hover:transform-none max-w-72", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(CompassCardTemplate, { data: item }) }, item.id)) })] })),
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { describe, it, expect, beforeEach } from "vitest";
|
|
3
|
+
import { render, screen } from "@testing-library/react";
|
|
4
|
+
import Section from "./PageSection";
|
|
5
|
+
import Text from "../Text/Text";
|
|
6
|
+
import Card from "../Card/Card";
|
|
7
|
+
import GenericList from "../GenericList/GenericList";
|
|
8
|
+
import CompassCardTemplate from "../Card/templates/CompassCardTemplate";
|
|
9
|
+
import { DUMMYCOMPASSPRODUCTDATA } from "../../components/Card/DUMMYPRODUCTDATA.json";
|
|
10
|
+
describe("<Section />", () => {
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
render(_jsx(Section, { sectionContainerClasses: "flex flex-row justify-center items-center flex-wrap lg:gap-10 gap-4 my-20 lg:max-h-view-page max-h-fit min-h-fit overflow-scroll px-4", children: _jsxs(_Fragment, { children: [_jsx("div", { className: "bg-red-400 p-4", children: "Content 1" }), _jsx("div", { className: "bg-green-400 p-4", children: "Content 2" }), _jsx("div", { className: "bg-blue-400 p-4", children: "Content 3" })] }) }));
|
|
13
|
+
});
|
|
14
|
+
it("renders children content", () => {
|
|
15
|
+
const { getByText } = render(_jsx(Section, { children: _jsx("div", { children: "Test Child" }) }));
|
|
16
|
+
expect(getByText("Test Child")).toBeInTheDocument();
|
|
17
|
+
});
|
|
18
|
+
it("displays children in a horizontal row", () => {
|
|
19
|
+
const section = screen.getByTestId("section");
|
|
20
|
+
expect(section).toHaveClass("flex-row");
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe("<Section /> with compass cards", () => {
|
|
24
|
+
it("displays correct cards", () => {
|
|
25
|
+
render(_jsx(Section, { sectionContainerClasses: "flex flex-row justify-center items-center flex-wrap lg:gap-10 gap-4 my-20 lg:max-h-view-page max-h-fit min-h-fit overflow-scroll px-4", children: _jsxs(_Fragment, { children: [_jsx(Text, { tag: "h1", size: "lg", text: "Example of a section with horizontal cards:", color: "black", fontFamily: "", additionalClasses: "pb-12" }), _jsx("div", { className: "grid grid-cols-4 gap-8 h-[100%] max-xl:gap-1 max-lg:grid-cols-2 max-lg:gap-y-24 max-lg:justify-items-center", children: _jsx(GenericList, { data: DUMMYCOMPASSPRODUCTDATA, listType: "none", renderItem: (item) => (_jsx(Card, { containerClasses: "w-3/4", cardBackgroundColor: item.cardBackgroundColor, cardBorderRadius: item.cardBorderRadius, cardBorderColor: item.cardBorderColor, cardBoxShadow: item.cardBoxShadow, children: _jsx(CompassCardTemplate, { data: item }) })) }) })] }) }));
|
|
26
|
+
const cards = screen.queryAllByTestId("card");
|
|
27
|
+
expect(cards.length).toBe(16);
|
|
28
|
+
expect(cards[0]).toHaveTextContent("Compass Sales Lenovo TP X13 Yoga G3 Laptop");
|
|
29
|
+
expect(cards[3]).toHaveTextContent("Exec RoadWarrior");
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import FormButton from "../FormButton/FormButton";
|
|
4
|
+
const SearchInput = ({ label, inputName, inputType, hasPlaceholder, placeholder, inputTextSize, inputShape, backgroundColor, inputWidth, inputBorderClasses, buttonClasses, buttonText, buttonIcon, buttonIconClasses, containerClasses, onButtonClick, role, ariaLabel, }) => {
|
|
5
|
+
const [inputValue, setInputValue] = useState("");
|
|
6
|
+
const handleInputChange = (e) => {
|
|
7
|
+
setInputValue(e.target.value);
|
|
8
|
+
};
|
|
9
|
+
const handleButtonClick = (event) => {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
if (event.currentTarget instanceof HTMLButtonElement) {
|
|
12
|
+
onButtonClick(inputValue);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
return (_jsx("div", { className: containerClasses, role: role, "aria-label": ariaLabel, children: _jsxs("form", { className: "w-full", children: [_jsx("label", { htmlFor: inputName, className: `sr-only`, children: label }), _jsx("div", { className: "flex w-full", children: _jsxs("div", { className: "flex w-full", children: [_jsx("input", { type: inputType, placeholder: hasPlaceholder ? placeholder : undefined, name: inputName, id: inputName, value: inputValue, onChange: handleInputChange, className: `flex p-2 ${inputTextSize} ${inputShape} ${backgroundColor} ${inputWidth} ${inputBorderClasses}` }), _jsx("div", { className: `flex items-center justify-center h-full`, children: _jsx(FormButton, { text: buttonText, icon: buttonIcon, iconClasses: buttonIconClasses, as: "button", additionalClasses: buttonClasses, onClick: handleButtonClick }) })] }) })] }) }));
|
|
16
|
+
};
|
|
17
|
+
export default SearchInput;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta } from "@storybook/react";
|
|
2
|
+
declare const _default: Meta;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const Default: any;
|
|
5
|
+
export declare const CommerceSearchInput: any;
|
|
6
|
+
export declare const WithIconButton: any;
|
|
7
|
+
export declare const WithoutButton: any;
|
|
8
|
+
export declare const CustomizedButton: any;
|
|
9
|
+
export declare const DisabledInput: any;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import SearchInput from "./SearchInput";
|
|
3
|
+
import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/SearchInput",
|
|
6
|
+
component: SearchInput,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
onButtonClick: { control: "none", table: { disable: true } },
|
|
10
|
+
inputType: { control: "none", table: { disable: true } },
|
|
11
|
+
inputName: { control: "none", table: { disable: true } },
|
|
12
|
+
placeholder: { control: "none" },
|
|
13
|
+
hasPlaceholder: { control: "none" },
|
|
14
|
+
inputTextSize: { control: "none" },
|
|
15
|
+
inputShape: { control: "none" },
|
|
16
|
+
backgroundColor: { control: "none" },
|
|
17
|
+
inputWidth: { control: "none" },
|
|
18
|
+
inputBorderClasses: { control: "none" },
|
|
19
|
+
buttonText: { control: "none", table: { disable: true } },
|
|
20
|
+
buttonIcon: { control: "none", table: { disable: true } },
|
|
21
|
+
buttonIconClasses: { control: "none" },
|
|
22
|
+
buttonClasses: { control: "none" },
|
|
23
|
+
containerClasses: { control: "none" },
|
|
24
|
+
},
|
|
25
|
+
parameters: { layout: "centered" },
|
|
26
|
+
};
|
|
27
|
+
const Template = (args) => _jsx(SearchInput, { ...args });
|
|
28
|
+
export const Default = Template.bind({});
|
|
29
|
+
Default.args = {
|
|
30
|
+
inputType: "text",
|
|
31
|
+
inputName: "default",
|
|
32
|
+
hasPlaceholder: true,
|
|
33
|
+
placeholder: "Type something...",
|
|
34
|
+
inputTextSize: "text-base",
|
|
35
|
+
inputShape: "rounded-md",
|
|
36
|
+
backgroundColor: "bg-white",
|
|
37
|
+
inputWidth: "w-80",
|
|
38
|
+
inputBorderClasses: "border border-gray-300",
|
|
39
|
+
buttonText: _jsx("span", { children: "Search" }),
|
|
40
|
+
buttonClasses: "bg-blue-500 text-white px-4 py-2 rounded-md",
|
|
41
|
+
buttonIcon: getFontAwesomeIcon("search"),
|
|
42
|
+
buttonIconClasses: "text-white",
|
|
43
|
+
containerClasses: "flex items-center space-x-2",
|
|
44
|
+
onButtonClick: (value) => alert(`Button clicked with input: ${value}`),
|
|
45
|
+
};
|
|
46
|
+
export const CommerceSearchInput = Template.bind({});
|
|
47
|
+
CommerceSearchInput.args = {
|
|
48
|
+
inputType: "search",
|
|
49
|
+
inputName: "commerceSearch",
|
|
50
|
+
hasPlaceholder: true,
|
|
51
|
+
placeholder: "Search for product...",
|
|
52
|
+
inputTextSize: "text-sm",
|
|
53
|
+
inputShape: "",
|
|
54
|
+
backgroundColor: "bg-gray-50",
|
|
55
|
+
inputWidth: "w-full",
|
|
56
|
+
inputBorderClasses: "border border-gray-300 focus:outline-none rounded-l-md",
|
|
57
|
+
buttonIcon: getFontAwesomeIcon("search"),
|
|
58
|
+
buttonIconClasses: "text-white",
|
|
59
|
+
buttonClasses: "bg-teal-600 p-2 rounded-r-md hover:bg-teal-700",
|
|
60
|
+
containerClasses: "flex items-center shadow-sm overflow-hidden",
|
|
61
|
+
onButtonClick: (value) => console.log(`Searching for: ${value}`),
|
|
62
|
+
};
|
|
63
|
+
export const WithIconButton = Template.bind({});
|
|
64
|
+
WithIconButton.args = {
|
|
65
|
+
inputType: "search",
|
|
66
|
+
inputName: "searchIcon",
|
|
67
|
+
hasPlaceholder: true,
|
|
68
|
+
placeholder: "Search...",
|
|
69
|
+
inputTextSize: "text-md",
|
|
70
|
+
inputShape: "rounded-full",
|
|
71
|
+
backgroundColor: "bg-gray-50",
|
|
72
|
+
inputWidth: "w-64",
|
|
73
|
+
inputBorderClasses: "border border-gray-400",
|
|
74
|
+
buttonIcon: getFontAwesomeIcon("magnifying-glass"),
|
|
75
|
+
buttonIconClasses: "text-blue-500",
|
|
76
|
+
buttonClasses: "p-2",
|
|
77
|
+
containerClasses: "flex items-center",
|
|
78
|
+
onButtonClick: (value) => console.log(`Searching for: ${value}`),
|
|
79
|
+
};
|
|
80
|
+
export const WithoutButton = Template.bind({});
|
|
81
|
+
WithoutButton.args = {
|
|
82
|
+
inputType: "text",
|
|
83
|
+
inputName: "withoutButton",
|
|
84
|
+
hasPlaceholder: true,
|
|
85
|
+
placeholder: "No button here...",
|
|
86
|
+
inputTextSize: "text-sm",
|
|
87
|
+
inputShape: "rounded",
|
|
88
|
+
backgroundColor: "bg-gray-100",
|
|
89
|
+
inputWidth: "w-full",
|
|
90
|
+
inputBorderClasses: "border border-gray-300",
|
|
91
|
+
containerClasses: "flex items-center",
|
|
92
|
+
onButtonClick: () => { },
|
|
93
|
+
};
|
|
94
|
+
export const CustomizedButton = Template.bind({});
|
|
95
|
+
CustomizedButton.args = {
|
|
96
|
+
inputType: "text",
|
|
97
|
+
inputName: "customButton",
|
|
98
|
+
hasPlaceholder: true,
|
|
99
|
+
placeholder: "Enter your query...",
|
|
100
|
+
inputTextSize: "text-lg",
|
|
101
|
+
inputShape: "rounded-lg",
|
|
102
|
+
backgroundColor: "bg-white",
|
|
103
|
+
inputWidth: "w-96",
|
|
104
|
+
inputBorderClasses: "border border-blue-500",
|
|
105
|
+
buttonText: (_jsxs("span", { className: "flex items-center space-x-1", children: [getFontAwesomeIcon("arrow-right"), _jsx("span", { children: "Go" })] })),
|
|
106
|
+
buttonClasses: "bg-green-600 text-white hover:bg-green-700 transition-colors rounded-full px-5 py-2",
|
|
107
|
+
buttonIcon: null,
|
|
108
|
+
containerClasses: "flex items-center space-x-3",
|
|
109
|
+
onButtonClick: (value) => alert(`Navigating with: ${value}`),
|
|
110
|
+
};
|
|
111
|
+
export const DisabledInput = Template.bind({});
|
|
112
|
+
DisabledInput.args = {
|
|
113
|
+
inputType: "text",
|
|
114
|
+
inputName: "disabledInput",
|
|
115
|
+
hasPlaceholder: true,
|
|
116
|
+
placeholder: "Disabled...",
|
|
117
|
+
inputTextSize: "text-sm",
|
|
118
|
+
inputShape: "rounded",
|
|
119
|
+
backgroundColor: "bg-gray-200",
|
|
120
|
+
inputWidth: "w-72",
|
|
121
|
+
inputBorderClasses: "border border-gray-400 cursor-not-allowed",
|
|
122
|
+
buttonText: _jsx("span", { children: "Disabled" }),
|
|
123
|
+
buttonClasses: "bg-gray-500 text-gray-300 px-4 py-2 rounded",
|
|
124
|
+
buttonIcon: getFontAwesomeIcon("ban"),
|
|
125
|
+
buttonIconClasses: "text-gray-400",
|
|
126
|
+
containerClasses: "flex items-center",
|
|
127
|
+
onButtonClick: () => alert("Button is disabled."),
|
|
128
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface SearchInputProps {
|
|
3
|
+
onChange?: (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
|
|
4
|
+
value?: string;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
role?: string;
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
inputType: string;
|
|
9
|
+
inputName: string;
|
|
10
|
+
hasPlaceholder: boolean;
|
|
11
|
+
placeholder: string;
|
|
12
|
+
containerClasses?: string;
|
|
13
|
+
inputTextSize?: string;
|
|
14
|
+
inputWidth?: string;
|
|
15
|
+
inputShape?: string;
|
|
16
|
+
borderColor?: string;
|
|
17
|
+
backgroundColor?: string;
|
|
18
|
+
inputBorderClasses?: string;
|
|
19
|
+
additionalClasses?: string;
|
|
20
|
+
buttonText?: JSX.Element;
|
|
21
|
+
buttonClasses?: string;
|
|
22
|
+
buttonIcon?: JSX.Element | null;
|
|
23
|
+
buttonIconClasses?: string;
|
|
24
|
+
onButtonClick: (inputValue: string) => void;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from "react";
|
|
3
|
+
const Slider = ({ min, max, step, minValue, maxValue, onMinChange, onMaxChange, additionalClasses = "", containerClasses = "p-8 border rounded-lg shadow-md bg-white max-w-lg", title = "Range", titleClasses = "text-xl text-black mb-4 font-bold", minLabel = "Min Value", maxLabel = "Max Value", labelClasses = "text-sm text-gray-500", inputClasses = "mt-2 text-lg font-semibold text-gray-900 border border-gray-300 rounded px-2 py-1 text-center w-20", sliderClasses = "relative w-full h-2 bg-gray-300 rounded", rangeClasses = "absolute h-2 bg-teal-500 rounded", thumbClasses = "absolute w-6 h-6 bg-white border-2 border-teal-500 rounded-full cursor-pointer", onAddSection, }) => {
|
|
4
|
+
const [minThumbValue, setMinThumbValue] = useState(minValue);
|
|
5
|
+
const [maxThumbValue, setMaxThumbValue] = useState(maxValue);
|
|
6
|
+
const sliderRef = useRef(null);
|
|
7
|
+
const isDragging = useRef(null);
|
|
8
|
+
const getPercentage = (value) => ((value - min) / (max - min)) * 100;
|
|
9
|
+
const handleMinChange = (value) => {
|
|
10
|
+
if (value <= maxThumbValue && value >= min) {
|
|
11
|
+
setMinThumbValue(value);
|
|
12
|
+
onMinChange(value);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const handleMaxChange = (value) => {
|
|
16
|
+
if (value >= minThumbValue && value <= max) {
|
|
17
|
+
setMaxThumbValue(value);
|
|
18
|
+
onMaxChange(value);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const handlePointerMove = (event) => {
|
|
22
|
+
if (sliderRef.current && isDragging.current) {
|
|
23
|
+
const sliderRect = sliderRef.current.getBoundingClientRect();
|
|
24
|
+
const sliderWidth = sliderRect.width;
|
|
25
|
+
const clickX = event.clientX - sliderRect.left;
|
|
26
|
+
const newValue = min + (clickX / sliderWidth) * (max - min);
|
|
27
|
+
if (isDragging.current === "min") {
|
|
28
|
+
handleMinChange(Math.round(newValue / step) * step);
|
|
29
|
+
}
|
|
30
|
+
else if (isDragging.current === "max") {
|
|
31
|
+
handleMaxChange(Math.round(newValue / step) * step);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const handlePointerUp = () => {
|
|
36
|
+
isDragging.current = null;
|
|
37
|
+
};
|
|
38
|
+
const handlePointerDown = (thumb) => {
|
|
39
|
+
isDragging.current = thumb;
|
|
40
|
+
};
|
|
41
|
+
return (_jsxs("div", { className: `${containerClasses} ${additionalClasses}`, children: [_jsx("h3", { className: titleClasses, children: title }), _jsx("hr", { className: "border-gray-300 mb-6" }), _jsxs("div", { className: "flex justify-between gap-4 mb-6", children: [_jsxs("div", { className: "flex flex-col items-center", children: [_jsx("span", { className: labelClasses, children: minLabel }), _jsx("input", { type: "number", value: minThumbValue, onChange: (e) => handleMinChange(Number(e.target.value)), className: inputClasses })] }), _jsxs("div", { className: "flex flex-col items-center", children: [_jsx("span", { className: labelClasses, children: maxLabel }), _jsx("input", { type: "number", value: maxThumbValue, onChange: (e) => handleMaxChange(Number(e.target.value)), className: inputClasses })] })] }), _jsxs("div", { className: sliderClasses, ref: sliderRef, onPointerMove: handlePointerMove, onPointerUp: handlePointerUp, onPointerCancel: handlePointerUp, onPointerLeave: handlePointerUp, children: [_jsx("div", { className: rangeClasses, style: {
|
|
42
|
+
left: `${getPercentage(minThumbValue)}%`,
|
|
43
|
+
right: `${100 - getPercentage(maxThumbValue)}%`,
|
|
44
|
+
} }), _jsx("div", { className: thumbClasses, style: {
|
|
45
|
+
left: `${getPercentage(minThumbValue)}%`,
|
|
46
|
+
transform: "translate(-50%, -50%)",
|
|
47
|
+
top: "50%",
|
|
48
|
+
zIndex: 5,
|
|
49
|
+
}, onPointerDown: () => handlePointerDown("min") }), _jsx("div", { className: thumbClasses, style: {
|
|
50
|
+
left: `${getPercentage(maxThumbValue)}%`,
|
|
51
|
+
transform: "translate(-50%, -50%)",
|
|
52
|
+
top: "50%",
|
|
53
|
+
zIndex: 4,
|
|
54
|
+
}, onPointerDown: () => handlePointerDown("max") })] }), onAddSection && (_jsx("button", { onClick: onAddSection, className: "mt-4 text-blue-500", children: "Add Section" }))] }));
|
|
55
|
+
};
|
|
56
|
+
export default Slider;
|