@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,82 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Slider from "./Slider";
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Slider',
|
|
5
|
+
component: Slider,
|
|
6
|
+
argTypes: {
|
|
7
|
+
min: {
|
|
8
|
+
control: 'none',
|
|
9
|
+
description: 'The minimum value of the range. Example: `0`',
|
|
10
|
+
},
|
|
11
|
+
title: {
|
|
12
|
+
control: 'none',
|
|
13
|
+
description: 'The title of the range. Example: `Temperature Range`',
|
|
14
|
+
},
|
|
15
|
+
max: {
|
|
16
|
+
control: 'none',
|
|
17
|
+
description: 'The maximum value of the range. Example: `100`',
|
|
18
|
+
},
|
|
19
|
+
step: {
|
|
20
|
+
control: 'none',
|
|
21
|
+
description: 'The step value for the range. Example: `1`',
|
|
22
|
+
},
|
|
23
|
+
minValue: {
|
|
24
|
+
control: 'none',
|
|
25
|
+
description: 'The initial minimum value. Example: `10`',
|
|
26
|
+
},
|
|
27
|
+
maxValue: {
|
|
28
|
+
control: 'none',
|
|
29
|
+
description: 'The initial maximum value. Example: `90`',
|
|
30
|
+
},
|
|
31
|
+
onMinChange: {
|
|
32
|
+
control: 'none',
|
|
33
|
+
description: 'Callback function when the minimum value changes. Example: `(value: number) => console.log(value)`',
|
|
34
|
+
},
|
|
35
|
+
onMaxChange: {
|
|
36
|
+
control: 'none',
|
|
37
|
+
description: 'Callback function when the maximum value changes. Example: `(value: number) => console.log(value)`',
|
|
38
|
+
},
|
|
39
|
+
additionalClasses: {
|
|
40
|
+
control: 'none',
|
|
41
|
+
description: 'Additional CSS classes for the component. Example: `my-custom-slider`',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
tags: ['autodocs'],
|
|
45
|
+
parameters: {
|
|
46
|
+
layout: 'centered',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
const Template = (args) => _jsx(Slider, { ...args });
|
|
50
|
+
export const Default = Template.bind({});
|
|
51
|
+
Default.args = {
|
|
52
|
+
min: 0,
|
|
53
|
+
max: 100,
|
|
54
|
+
step: 1,
|
|
55
|
+
minValue: 20,
|
|
56
|
+
maxValue: 80,
|
|
57
|
+
onMinChange: (value) => console.log('Min value changed:', value),
|
|
58
|
+
onMaxChange: (value) => console.log('Max value changed:', value),
|
|
59
|
+
title: 'Range',
|
|
60
|
+
};
|
|
61
|
+
export const TemperatureRange = Template.bind({});
|
|
62
|
+
TemperatureRange.args = {
|
|
63
|
+
min: -50,
|
|
64
|
+
max: 50,
|
|
65
|
+
step: 0.5,
|
|
66
|
+
minValue: -10,
|
|
67
|
+
maxValue: 30,
|
|
68
|
+
onMinChange: (value) => console.log('Min value changed:', value),
|
|
69
|
+
onMaxChange: (value) => console.log('Max value changed:', value),
|
|
70
|
+
title: 'Temperature Range',
|
|
71
|
+
};
|
|
72
|
+
export const PriceRange = Template.bind({});
|
|
73
|
+
PriceRange.args = {
|
|
74
|
+
min: 0,
|
|
75
|
+
max: 2000,
|
|
76
|
+
step: 1,
|
|
77
|
+
minValue: 900,
|
|
78
|
+
maxValue: 1578,
|
|
79
|
+
onMinChange: (value) => console.log('Min value changed:', value),
|
|
80
|
+
onMaxChange: (value) => console.log('Max value changed:', value),
|
|
81
|
+
title: 'Price Range',
|
|
82
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const AdminSubmenu = ({ callToActionChildren, secondCallToActionChildren, menuClasses = "p-4 bg-white rounded-lg shadow-lg", }) => {
|
|
3
|
+
return (_jsxs("div", { className: menuClasses, children: [_jsx("div", { children: callToActionChildren }), _jsx("div", { children: secondCallToActionChildren })] }));
|
|
4
|
+
};
|
|
5
|
+
export default AdminSubmenu;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import AlertSubmenuItem from "./AlertSubmenuItem";
|
|
3
|
+
const AlertSubmenu = ({ data, newAlertCount, newAlertColor, onClearAlerts, newAlertCountClasses = "text-gray-900 font-semibold", clearAlertsTextClasses = "text-blue-600 hover:underline", clearAlertsText = "Mark all as Read", menuContainerClasses = "rounded-lg border border-stroke bg-white shadow-lg", menuHeaderContainerClasses = "flex justify-between items-center p-4 border-b border-gray-200", alertListContainerClasses = "overflow-y-auto max-h-[300px] divide-y divide-gray-200", }) => {
|
|
4
|
+
const alertList = data.map((alert, index) => (_jsx(AlertSubmenuItem, { link: alert.link, title: alert.title, subtitle: alert.subtitle, status: alert.status, statusColor: newAlertColor, externalLink: alert.externalLink, titleClasses: "font-medium text-gray-900", externalLinkClasses: "text-sm text-blue-600", subtitleClasses: "text-sm text-gray-500", itemContainerClasses: "p-4 hover:bg-gray-50" }, index)));
|
|
5
|
+
return (_jsxs("div", { className: menuContainerClasses, children: [_jsxs("div", { className: menuHeaderContainerClasses, children: [_jsxs("span", { className: newAlertCountClasses, children: [newAlertCount, " alerts"] }), _jsx("button", { className: clearAlertsTextClasses, onClick: onClearAlerts, children: clearAlertsText })] }), _jsxs("div", { className: alertListContainerClasses, children: [_jsx("ul", { children: alertList }), _jsx("div", { className: "text-center p-4 text-gray-500", children: "All up to date!" })] })] }));
|
|
6
|
+
};
|
|
7
|
+
export default AlertSubmenu;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
const AlertSubmenuItem = ({ link = "#", title, externalLink, subtitle, status, statusColor = "bg-blue-500", itemContainerClasses = "flex justify-between items-center p-4", titleClasses = "font-medium text-gray-900", externalLinkClasses = "text-sm text-blue-600", subtitleClasses = "text-sm text-gray-500", }) => {
|
|
3
|
+
return (_jsx("li", { className: itemContainerClasses, children: _jsxs("a", { href: link, className: "flex items-start gap-4", children: [_jsx("div", { className: "flex-shrink-0 pt-2", children: status && (_jsx("span", { className: `inline-block w-3 h-3 rounded-full ${statusColor}`, "aria-label": "New" })) }), _jsxs("div", { children: [_jsx("h6", { className: titleClasses, children: title }), externalLink && (_jsx("p", { className: externalLinkClasses, children: externalLink })), _jsx("p", { className: subtitleClasses, children: subtitle })] })] }) }));
|
|
4
|
+
};
|
|
5
|
+
export default AlertSubmenuItem;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface AlertSubmenuItemProps {
|
|
2
|
+
link?: string;
|
|
3
|
+
title: string;
|
|
4
|
+
externalLink?: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
status?: string;
|
|
7
|
+
statusColor?: string;
|
|
8
|
+
itemContainerClasses?: string;
|
|
9
|
+
titleClasses?: string;
|
|
10
|
+
externalLinkClasses?: string;
|
|
11
|
+
subtitleClasses?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface AlertSubmenuProps<T = Record<string, any>> {
|
|
14
|
+
data: T[];
|
|
15
|
+
newAlertCount?: number;
|
|
16
|
+
newAlertColor?: string;
|
|
17
|
+
onClearAlerts?: () => void;
|
|
18
|
+
newAlertCountClasses?: string;
|
|
19
|
+
clearAlertsTextClasses?: string;
|
|
20
|
+
clearAlertsText?: string;
|
|
21
|
+
menuContainerClasses?: string;
|
|
22
|
+
menuHeaderContainerClasses?: string;
|
|
23
|
+
alertListContainerClasses?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface AdminSubmenuProps {
|
|
26
|
+
callToActionChildren?: JSX.Element;
|
|
27
|
+
secondCallToActionChildren?: JSX.Element;
|
|
28
|
+
menuClasses?: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const Text = ({ size = "text-base", color = "text-black", tag = "span", text, fontFamily = "font-sans", additionalClasses = "", ...props }) => {
|
|
3
|
+
const ElementTag = tag;
|
|
4
|
+
const className = `
|
|
5
|
+
${size}
|
|
6
|
+
${color}
|
|
7
|
+
${fontFamily}
|
|
8
|
+
${additionalClasses}
|
|
9
|
+
`;
|
|
10
|
+
return (_jsx(ElementTag, { "data-testid": "text", className: className, ...props, children: text }));
|
|
11
|
+
};
|
|
12
|
+
export default Text;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Text from "./Text";
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/Text",
|
|
5
|
+
component: Text,
|
|
6
|
+
argTypes: {
|
|
7
|
+
size: {
|
|
8
|
+
control: {
|
|
9
|
+
type: "select", // Dropdown control
|
|
10
|
+
},
|
|
11
|
+
options: [
|
|
12
|
+
"text-xs",
|
|
13
|
+
"text-sm",
|
|
14
|
+
"text-md",
|
|
15
|
+
"text-lg",
|
|
16
|
+
"text-xl",
|
|
17
|
+
"text-2xl",
|
|
18
|
+
"text-3xl",
|
|
19
|
+
"text-base",
|
|
20
|
+
], // Define options explicitly
|
|
21
|
+
description: "The font size for the text. Use Tailwind CSS classes like 'text-xs', 'text-sm', 'text-md', etc. Default is 'text-base'.",
|
|
22
|
+
},
|
|
23
|
+
color: {
|
|
24
|
+
control: {
|
|
25
|
+
type: "select", // Dropdown control
|
|
26
|
+
},
|
|
27
|
+
options: [
|
|
28
|
+
"text-red-800",
|
|
29
|
+
"text-blue-800",
|
|
30
|
+
"text-green-800",
|
|
31
|
+
"text-slate-950",
|
|
32
|
+
"text-black",
|
|
33
|
+
],
|
|
34
|
+
description: "The color of the text. Use Tailwind CSS classes like 'text-red-800', 'text-blue-800', 'text-black', etc. Default is 'text-black'.",
|
|
35
|
+
},
|
|
36
|
+
tag: {
|
|
37
|
+
control: {
|
|
38
|
+
type: "select", // Dropdown control
|
|
39
|
+
},
|
|
40
|
+
options: ["h1", "h2", "h3", "h4", "h5", "p", "span"], // Ensure valid HTML tags are listed
|
|
41
|
+
description: "The type of HTML element the text should be. Options include 'h1', 'h2', 'p', etc. Default is 'span'.",
|
|
42
|
+
},
|
|
43
|
+
fontFamily: {
|
|
44
|
+
control: {
|
|
45
|
+
type: "select", // Dropdown control
|
|
46
|
+
},
|
|
47
|
+
options: ["font-sans", "font-mono", "font-serif"], // Define the font-family options
|
|
48
|
+
description: "The type of font family. Use Tailwind CSS classes like 'font-sans', 'font-mono', etc. Default is 'font-sans'.",
|
|
49
|
+
},
|
|
50
|
+
text: {
|
|
51
|
+
control: {
|
|
52
|
+
type: "text", // Text input control
|
|
53
|
+
},
|
|
54
|
+
description: "The main text displayed on the component.",
|
|
55
|
+
defaultValue: "Testing",
|
|
56
|
+
},
|
|
57
|
+
additionalClasses: {
|
|
58
|
+
control: {
|
|
59
|
+
type: "text", // Text input control
|
|
60
|
+
},
|
|
61
|
+
description: "Additional Tailwind CSS classes to be added.",
|
|
62
|
+
defaultValue: "",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
tags: ["autodocs"],
|
|
66
|
+
parameters: {
|
|
67
|
+
layout: "centered",
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
const Template = (args) => _jsx(Text, { ...args });
|
|
71
|
+
export const Primary = Template.bind({});
|
|
72
|
+
Primary.args = {
|
|
73
|
+
size: "text-2xl",
|
|
74
|
+
color: "text-blue-500",
|
|
75
|
+
tag: "h2",
|
|
76
|
+
fontFamily: "font-mono",
|
|
77
|
+
text: "Testing",
|
|
78
|
+
additionalClasses: "p-5",
|
|
79
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import { describe, expect, beforeEach, test } from "vitest";
|
|
4
|
+
import Text from "./Text";
|
|
5
|
+
describe("<Text />", () => {
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
render(_jsx(Text, { text: "Testing", size: "text-md", color: "text-red-500", tag: "h1", fontFamily: "font-sans" }));
|
|
8
|
+
});
|
|
9
|
+
test("renders Text component", () => {
|
|
10
|
+
expect(screen.getByTestId("text")).toBeInTheDocument();
|
|
11
|
+
});
|
|
12
|
+
test("contain correct text", () => {
|
|
13
|
+
expect(screen.getByTestId("text")).toHaveTextContent("Testing");
|
|
14
|
+
});
|
|
15
|
+
test("renders correct font color", () => {
|
|
16
|
+
const textElement = screen.getByTestId("text");
|
|
17
|
+
expect(textElement).toHaveClass("text-red-500");
|
|
18
|
+
});
|
|
19
|
+
test("renders correct font size", () => {
|
|
20
|
+
const textElement = screen.getByTestId("text");
|
|
21
|
+
expect(textElement).toHaveClass("text-md");
|
|
22
|
+
});
|
|
23
|
+
test("renders correct font family", () => {
|
|
24
|
+
const textElement = screen.getByTestId("text");
|
|
25
|
+
expect(textElement).toHaveClass("font-sans");
|
|
26
|
+
});
|
|
27
|
+
test("renders correct element type", () => {
|
|
28
|
+
const textElement = screen.getByTestId("text");
|
|
29
|
+
expect(textElement.tagName).toBe("H1");
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
|
|
3
2
|
export type TagName = "span" | "p" | "h1" | "h2" | "h3" | "h4" | "h5" | string;
|
|
4
|
-
|
|
5
3
|
export interface TextTypes {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
size?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
tag?: TagName;
|
|
7
|
+
text: ReactNode;
|
|
8
|
+
fontFamily?: string;
|
|
9
|
+
additionalClasses?: string;
|
|
12
10
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getFontAwesomeIcon } from "../../utils/getFontAwesomeIcon";
|
|
3
|
+
const Toaster = ({ message, additionalClasses, clearMessage, hasClearButton, statusProps = {
|
|
4
|
+
colorClass: "bg-gray-100 border border-gray-500 text-gay-800",
|
|
5
|
+
icon: { icon: "circleCheck", type: "solid" },
|
|
6
|
+
}, }) => {
|
|
7
|
+
const handleClearMessage = () => {
|
|
8
|
+
if (clearMessage) {
|
|
9
|
+
alert("Message Cleared!");
|
|
10
|
+
clearMessage(true);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
// Pull out colorClass and icon from statusProps
|
|
14
|
+
const { colorClass, icon: maybeIcon } = statusProps;
|
|
15
|
+
// We'll combine colorClass with other container styles
|
|
16
|
+
const containerClasses = colorClass ?? "";
|
|
17
|
+
// Your existing custom classes
|
|
18
|
+
const shadowClasses = `shadow-lg shadow-boxShadow rounded-lg`;
|
|
19
|
+
const closeButtonClasses = `cursor-pointer text-xs ml-4`;
|
|
20
|
+
return (_jsx("div", { "data-testid": "toaster-test-id", role: "alert", "aria-live": "polite", className: `${shadowClasses} ${containerClasses} ${additionalClasses}`, children: message.map((msg, index) => (_jsxs("div", { className: "flex items-center", children: [maybeIcon && (_jsx("div", { className: "mr-4", children: getFontAwesomeIcon(maybeIcon.icon, maybeIcon.type) })), _jsx("p", { className: index === 0 ? "font-semibold ml-2" : "ml-2", children: msg }), hasClearButton && (_jsx("div", { "data-testid": "clear-button", className: `${closeButtonClasses}`, onClick: handleClearMessage, children: getFontAwesomeIcon("x", "solid") }))] }, index))) }));
|
|
21
|
+
};
|
|
22
|
+
export default Toaster;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Meta } from "@storybook/react";
|
|
2
|
+
declare const _default: Meta;
|
|
3
|
+
export default _default;
|
|
4
|
+
/**
|
|
5
|
+
* Default
|
|
6
|
+
*/
|
|
7
|
+
export declare const Default: any;
|
|
8
|
+
/**
|
|
9
|
+
* WithIconFail
|
|
10
|
+
*/
|
|
11
|
+
export declare const WithIconFail: any;
|
|
12
|
+
/**
|
|
13
|
+
* WithIconSuccess
|
|
14
|
+
*/
|
|
15
|
+
export declare const WithIconSuccess: any;
|
|
16
|
+
/**
|
|
17
|
+
* WithIconAlert
|
|
18
|
+
*/
|
|
19
|
+
export declare const WithIconAlert: any;
|
|
20
|
+
/**
|
|
21
|
+
* HasClearMessage
|
|
22
|
+
*/
|
|
23
|
+
export declare const HasClearMessage: any;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Toaster from ".";
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/Toaster",
|
|
5
|
+
component: Toaster,
|
|
6
|
+
argTypes: {
|
|
7
|
+
message: {
|
|
8
|
+
control: "array",
|
|
9
|
+
description: "The main messages displayed on the toaster, passed as an array.",
|
|
10
|
+
},
|
|
11
|
+
additionalClasses: {
|
|
12
|
+
control: "text",
|
|
13
|
+
description: "Additional Tailwind CSS classes for the toaster container.",
|
|
14
|
+
},
|
|
15
|
+
hasClearButton: {
|
|
16
|
+
control: "boolean",
|
|
17
|
+
description: "Toggle to show or hide the clear message button.",
|
|
18
|
+
},
|
|
19
|
+
clearMessage: {
|
|
20
|
+
action: "Message Cleared!",
|
|
21
|
+
},
|
|
22
|
+
statusProps: {
|
|
23
|
+
control: "object",
|
|
24
|
+
description: "Object containing colorClass and optional icon config.",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
tags: ["autodocs"],
|
|
28
|
+
parameters: {
|
|
29
|
+
layout: "centered",
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
const Template = (args) => _jsx(Toaster, { message: [], ...args });
|
|
33
|
+
/**
|
|
34
|
+
* Default
|
|
35
|
+
*/
|
|
36
|
+
export const Default = Template.bind({});
|
|
37
|
+
Default.args = {
|
|
38
|
+
message: ["Your action was successful!"],
|
|
39
|
+
statusProps: {
|
|
40
|
+
// Pass the literal Tailwind classes instead of color: "green"
|
|
41
|
+
colorClass: "bg-green-100 border border-green-500 text-green-800",
|
|
42
|
+
},
|
|
43
|
+
additionalClasses: "p-5",
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* WithIconFail
|
|
47
|
+
*/
|
|
48
|
+
export const WithIconFail = Template.bind({});
|
|
49
|
+
WithIconFail.args = {
|
|
50
|
+
message: ["Your action failed!"],
|
|
51
|
+
statusProps: {
|
|
52
|
+
// Red variant
|
|
53
|
+
colorClass: "bg-red-100 border border-red-500 text-red-800",
|
|
54
|
+
icon: { icon: "x", type: "solid" },
|
|
55
|
+
},
|
|
56
|
+
additionalClasses: "p-5",
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* WithIconSuccess
|
|
60
|
+
*/
|
|
61
|
+
export const WithIconSuccess = Template.bind({});
|
|
62
|
+
WithIconSuccess.args = {
|
|
63
|
+
message: ["Action completed successfully!"],
|
|
64
|
+
statusProps: {
|
|
65
|
+
// Green variant
|
|
66
|
+
colorClass: "bg-green-100 border border-green-600 text-green-800",
|
|
67
|
+
icon: { icon: "circleCheck", type: "solid" },
|
|
68
|
+
},
|
|
69
|
+
additionalClasses: "p-5",
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* WithIconAlert
|
|
73
|
+
*/
|
|
74
|
+
export const WithIconAlert = Template.bind({});
|
|
75
|
+
WithIconAlert.args = {
|
|
76
|
+
message: ["Alert: Are you sure?"],
|
|
77
|
+
statusProps: {
|
|
78
|
+
// Gray variant
|
|
79
|
+
colorClass: "bg-yellow-100 border border-yellow-500 text-yellow-800",
|
|
80
|
+
icon: { icon: "triangleExclamation", type: "solid" },
|
|
81
|
+
},
|
|
82
|
+
additionalClasses: "p-5",
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* HasClearMessage
|
|
86
|
+
*/
|
|
87
|
+
export const HasClearMessage = Template.bind({});
|
|
88
|
+
HasClearMessage.args = {
|
|
89
|
+
message: [
|
|
90
|
+
"Message can be cleared and input has different padding from the additionalClasses prop",
|
|
91
|
+
],
|
|
92
|
+
hasClearButton: true,
|
|
93
|
+
clearMessage: () => {
|
|
94
|
+
alert("Message Cleared!");
|
|
95
|
+
},
|
|
96
|
+
statusProps: {
|
|
97
|
+
// Orange variant
|
|
98
|
+
colorClass: "bg-orange-100 border border-orange-500 text-orange-800",
|
|
99
|
+
icon: { icon: "circleCheck", type: "solid" },
|
|
100
|
+
},
|
|
101
|
+
additionalClasses: "py-2 px-5",
|
|
102
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import userEvent from "@testing-library/user-event";
|
|
4
|
+
import { describe, expect, test, vi } from "vitest";
|
|
5
|
+
import Toaster from "./Toaster";
|
|
6
|
+
const testId = "toaster-test-id";
|
|
7
|
+
const testMessage = "Test Message";
|
|
8
|
+
describe("Toaster Component Tests", () => {
|
|
9
|
+
test("renders the FA icon when passed in props", () => {
|
|
10
|
+
const customStatusProps = {
|
|
11
|
+
icon: { icon: "circleCheck", type: "solid" },
|
|
12
|
+
};
|
|
13
|
+
const { container } = render(_jsx(Toaster, { message: ["Success!"], statusProps: customStatusProps }));
|
|
14
|
+
const iconEl = container.querySelector(".fa-circle-check");
|
|
15
|
+
expect(iconEl).toBeInTheDocument();
|
|
16
|
+
});
|
|
17
|
+
test("does not render an icon when icon is not in props", () => {
|
|
18
|
+
const customStatusProps = {};
|
|
19
|
+
const { container } = render(_jsx(Toaster, { message: ["Success!"], statusProps: customStatusProps }));
|
|
20
|
+
const iconEl = container.querySelector(".fa-circle-check");
|
|
21
|
+
expect(iconEl).not.toBeInTheDocument();
|
|
22
|
+
});
|
|
23
|
+
test("renders correct colors for status", () => {
|
|
24
|
+
const customStatusProps = {
|
|
25
|
+
colorClass: "bg-green-100 border border-green-500 text-green-800",
|
|
26
|
+
};
|
|
27
|
+
render(_jsx(Toaster, { message: [testMessage], statusProps: customStatusProps }));
|
|
28
|
+
expect(screen.getByTestId(testId)).toHaveTextContent(testMessage);
|
|
29
|
+
expect(screen.getByTestId(testId)).toHaveClass(`${customStatusProps.colorClass}`);
|
|
30
|
+
});
|
|
31
|
+
test("calls clearMessage callback when the clear button is clicked", async () => {
|
|
32
|
+
// Arrange
|
|
33
|
+
const mockClearMessage = vi.fn();
|
|
34
|
+
const mockAlert = vi
|
|
35
|
+
.spyOn(window, "alert")
|
|
36
|
+
.mockImplementation(() => { });
|
|
37
|
+
render(_jsx(Toaster, { message: [testMessage], hasClearButton: true, clearMessage: mockClearMessage }));
|
|
38
|
+
// Act - Click the clear button
|
|
39
|
+
const clearButton = screen.getByTestId("clear-button");
|
|
40
|
+
await userEvent.click(clearButton);
|
|
41
|
+
// Assert
|
|
42
|
+
expect(mockAlert).toHaveBeenCalledWith("Message Cleared!");
|
|
43
|
+
expect(mockClearMessage).toHaveBeenCalledWith(true);
|
|
44
|
+
// Cleanup
|
|
45
|
+
mockAlert.mockRestore();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface StatusProps {
|
|
2
|
+
icon?: {
|
|
3
|
+
icon: string;
|
|
4
|
+
type: "solid" | "regular";
|
|
5
|
+
};
|
|
6
|
+
colorClass?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ToasterTypes {
|
|
9
|
+
message: string[];
|
|
10
|
+
additionalClasses?: string;
|
|
11
|
+
clearMessage?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
12
|
+
hasClearButton?: boolean;
|
|
13
|
+
statusProps?: StatusProps;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as withStoryBook } from "./styling/withStoryBook";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
|
+
export interface WithStoryBookProps {
|
|
3
|
+
storybookStyle?: CSSProperties;
|
|
4
|
+
}
|
|
5
|
+
declare const withStoryBook: <P extends object>(Component: React.ComponentType<P>) => React.FC<P & WithStoryBookProps>;
|
|
6
|
+
export default withStoryBook;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const withStoryBook = (Component) => {
|
|
3
|
+
return ({ storybookStyle, ...props }) => {
|
|
4
|
+
return (_jsx("div", { style: storybookStyle, children: _jsx(Component, { ...props }) }));
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export default withStoryBook;
|