@orangesk/orange-design-system 2.0.0-beta.36 → 2.0.0-beta.38
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/README.md +8 -2
- package/build/components/Icon/style.css +1 -1
- package/build/components/Icon/style.css.map +1 -1
- package/build/components/Loader/style.css +1 -1
- package/build/components/Loader/style.css.map +1 -1
- package/build/components/PromoBanner/style.css +1 -1
- package/build/components/PromoBanner/style.css.map +1 -1
- package/build/components/Table/style.css +1 -1
- package/build/components/Table/style.css.map +1 -1
- package/build/components/index.js +1 -1
- package/build/components/index.js.map +1 -1
- package/build/components/tsconfig.tsbuildinfo +1 -1
- package/build/components/types/index.d.ts +737 -729
- package/build/components/types/src/components/Accordion/Accordion.static.d.ts +2 -0
- package/build/components/types/src/components/Bar/index.d.ts +1 -1
- package/build/components/types/src/components/BlockAction/Context.d.ts +1 -1
- package/build/components/types/src/components/BlockAction/index.d.ts +2 -4
- package/build/components/types/src/components/Button/index.d.ts +1 -1
- package/build/components/types/src/components/Card/index.d.ts +2 -2
- package/build/components/types/src/components/Carousel/Carousel.d.ts +1 -1
- package/build/components/types/src/components/Carousel/CarouselItem.d.ts +1 -1
- package/build/components/types/src/components/CarouselHero/CarouselHero.d.ts +1 -1
- package/build/components/types/src/components/CarouselHero/CarouselHero.static.d.ts +1 -1
- package/build/components/types/src/components/CarouselHero/CarouselHeroItem.d.ts +1 -1
- package/build/components/types/src/components/CarouselHero/index.d.ts +1 -1
- package/build/components/types/src/components/CartTable/CartTable.d.ts +1 -1
- package/build/components/types/src/components/CartTable/data.d.ts +1 -1
- package/build/components/types/src/components/Code/Code.d.ts +1 -1
- package/build/components/types/src/components/Divider/Divider.d.ts +1 -1
- package/build/components/types/src/components/DocumentationSidebar/index.d.ts +1 -1
- package/build/components/types/src/components/Dropdown/index.d.ts +1 -1
- package/build/components/types/src/components/Forms/Autocomplete/Autocomplete.d.ts +3 -1
- package/build/components/types/src/components/Forms/Autocomplete/Autocomplete.static.d.ts +1 -0
- package/build/components/types/src/components/Forms/Group/Group.d.ts +1 -1
- package/build/components/types/src/components/Forms/Group/Item.d.ts +1 -1
- package/build/components/types/src/components/Forms/index.d.ts +1 -1
- package/build/components/types/src/components/Grid/GridCol.d.ts +3 -3
- package/build/components/types/src/components/Icon/iconSearchTags.d.ts +1 -0
- package/build/components/types/src/components/Icon/index.d.ts +1 -2
- package/build/components/types/src/components/IconList/Item.d.ts +1 -1
- package/build/components/types/src/components/List/ClickableControl.d.ts +1 -1
- package/build/components/types/src/components/List/List.d.ts +3 -3
- package/build/components/types/src/components/List/ListItem.d.ts +1 -1
- package/build/components/types/src/components/Loader/LoaderFullscreen.d.ts +7 -0
- package/build/components/types/src/components/Loader/index.d.ts +1 -0
- package/build/components/types/src/components/Megamenu/index.d.ts +1 -1
- package/build/components/types/src/components/Modal/ModalCloseButton.d.ts +1 -1
- package/build/components/types/src/components/Modal/index.d.ts +2 -2
- package/build/components/types/src/components/Pagination/helpers.d.ts +1 -1
- package/build/components/types/src/components/Pill/Pill.d.ts +1 -1
- package/build/components/types/src/components/Preview/Preview.d.ts +1 -1
- package/build/components/types/src/components/Preview/PreviewGenerator.d.ts +1 -1
- package/build/components/types/src/components/PromotionCard/PromotionCardContent.d.ts +1 -1
- package/build/components/types/src/components/PromotionCard/PromotionCardImageWrapper.d.ts +1 -1
- package/build/components/types/src/components/PromotionCard/PromotionCardTitle.d.ts +1 -1
- package/build/components/types/src/components/Sticker/Sticker.d.ts +3 -3
- package/build/components/types/src/components/Table/Table.d.ts +1 -1
- package/build/components/types/src/components/Table/index.d.ts +1 -1
- package/build/components/types/src/components/Tabs/index.d.ts +2 -2
- package/build/components/types/src/components/Tag/index.d.ts +1 -1
- package/build/components/types/src/components/Testimonial/Testimonial.d.ts +2 -2
- package/build/components/types/src/components/Tooltip/Tooltip.static.d.ts +6 -2
- package/build/components/types/src/components/Tooltip/index.d.ts +1 -1
- package/build/components/types/src/components/index.d.ts +21 -21
- package/build/components/types/src/scripts/index.d.ts +5 -5
- package/build/components/types/src/scripts/modules/SpacePreview/index.d.ts +1 -1
- package/build/components/types/src/utils/hooks.d.ts +1 -1
- package/build/components/types/src/utils/index.d.ts +2 -2
- package/build/lib/base.css +1 -1
- package/build/lib/base.css.map +1 -1
- package/build/lib/components.css +1 -1
- package/build/lib/components.css.map +1 -1
- package/build/lib/footer.js +1 -1
- package/build/lib/footer.js.map +1 -1
- package/build/lib/megamenu.js +1 -1
- package/build/lib/megamenu.js.map +1 -1
- package/build/lib/scripts.js +1 -1
- package/build/lib/scripts.js.map +1 -1
- package/build/lib/style.css +1 -1
- package/build/lib/style.css.map +1 -1
- package/build/lib/tsconfig.tsbuildinfo +1 -1
- package/build/sprite.svg +1 -1
- package/package.json +39 -30
- package/src/assets/icons/discount-price.svg +4 -0
- package/src/components/Accordion/Accordion.static.ts +44 -1
- package/src/components/Accordion/Accordion.tsx +2 -3
- package/src/components/Accordion/AccordionHeader.tsx +1 -1
- package/src/components/Accordion/AccordionItem.tsx +2 -1
- package/src/components/Accordion/HeadingContext.tsx +1 -1
- package/src/components/Accordion/tests/Accordion.unit.test.jsx +112 -4
- package/src/components/Alert/Alert.tsx +3 -4
- package/src/components/Alert/tests/Alert.conformance.test.jsx +2 -3
- package/src/components/Alert/tests/Alert.test.jsx +1 -1
- package/src/components/Alert/tests/Alert.visual.test.jsx +1 -2
- package/src/components/AnchorNavigation/AnchorNavigation.tsx +3 -3
- package/src/components/AnchorNavigation/tests/AnchorNavigation.conformance.test.jsx +1 -1
- package/src/components/Bar/Bar.tsx +1 -1
- package/src/components/Bar/BarBreak.tsx +1 -1
- package/src/components/Bar/BarItem.tsx +1 -1
- package/src/components/Bar/index.ts +1 -1
- package/src/components/Bar/tests/Bar.conformance.test.jsx +1 -1
- package/src/components/BlockAction/BlockAction.tsx +1 -1
- package/src/components/BlockAction/BlockActionControl.tsx +2 -3
- package/src/components/BlockAction/BlockActionIndicator.tsx +2 -3
- package/src/components/BlockAction/CloneElementWithClassName.tsx +1 -1
- package/src/components/BlockAction/Context.tsx +1 -1
- package/src/components/BlockAction/index.tsx +3 -8
- package/src/components/BlockAction/styles/config.scss +6 -6
- package/src/components/BlockAction/tests/BlockActionControl.unit.test.jsx +1 -1
- package/src/components/BodyBanner/BodyBanner.tsx +2 -2
- package/src/components/BodyBanner/tests/BodyBanner.conformance.test.jsx +1 -1
- package/src/components/Breadcrumbs/BreadcrumbItem.tsx +1 -1
- package/src/components/Breadcrumbs/tests/Breadcrumbs.conformance.test.jsx +1 -1
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Button/IconButton.tsx +7 -3
- package/src/components/Button/index.tsx +1 -3
- package/src/components/Button/tests/Button.conformance.test.jsx +1 -2
- package/src/components/Button/tests/Button.test.jsx +0 -1
- package/src/components/Button/tests/IconButton.unit.test.jsx +0 -1
- package/src/components/Buttons/tests/Buttons.conformance.test.jsx +1 -1
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/Card/CardProductHeader.tsx +1 -1
- package/src/components/Card/CardSection.tsx +1 -1
- package/src/components/Card/index.ts +2 -2
- package/src/components/Card/tests/Card.conformance.test.jsx +2 -2
- package/src/components/Card/tests/CardProductHeader.unit.test.jsx +1 -1
- package/src/components/Carousel/Carousel.static.ts +15 -15
- package/src/components/Carousel/Carousel.tsx +9 -11
- package/src/components/Carousel/CarouselItem.tsx +1 -1
- package/src/components/Carousel/tests/Carousel.conformance.test.jsx +2 -4
- package/src/components/CarouselHero/CarouselHero.static.ts +15 -15
- package/src/components/CarouselHero/CarouselHero.tsx +12 -13
- package/src/components/CarouselHero/CarouselHeroItem.tsx +2 -2
- package/src/components/CarouselHero/index.ts +1 -1
- package/src/components/CarouselHero/tests/CarouselHeroItem.conformance.test.jsx +1 -1
- package/src/components/CarouselPromotions/CarouselPromotions.static.ts +10 -10
- package/src/components/CarouselPromotions/CarouselPromotions.tsx +6 -7
- package/src/components/CarouselPromotions/CarouselPromotionsItem.tsx +3 -3
- package/src/components/CarouselPromotions/tests/CarouselPromotions.conformance.test.jsx +1 -3
- package/src/components/CarouselPromotions/tests/CarouselPromotions.unit.test.jsx +1 -2
- package/src/components/CartTable/CartTable.tsx +3 -4
- package/src/components/CartTable/FooterPriceColumn.tsx +1 -1
- package/src/components/CartTable/Price.tsx +1 -1
- package/src/components/CartTable/data.ts +1 -1
- package/src/components/CartTable/generateFooter.tsx +1 -1
- package/src/components/CartTable/generateRow.tsx +6 -8
- package/src/components/CartTable/styles/mixins.scss +46 -49
- package/src/components/CartTable/tests/CartTable.conformance.test.jsx +1 -1
- package/src/components/Code/Code.tsx +1 -1
- package/src/components/Container/Container.tsx +1 -1
- package/src/components/Container/styles/config.scss +2 -2
- package/src/components/Container/styles/mixins.scss +4 -4
- package/src/components/Container/tests/Container.unit.test.jsx +3 -2
- package/src/components/Controls/Controls.tsx +1 -1
- package/src/components/Controls/tests/Controls.test.jsx +2 -2
- package/src/components/Cover/Cover.tsx +1 -1
- package/src/components/Cover/index.ts +1 -0
- package/src/components/Cover/tests/Cover.conformance.test.jsx +8 -9
- package/src/components/Cover/tests/Cover.unit.test.jsx +0 -1
- package/src/components/Divider/Divider.tsx +1 -1
- package/src/components/Divider/tests/Divider.conformance.test.jsx +1 -1
- package/src/components/DocumentationSidebar/DocumentationSidebar.tsx +7 -7
- package/src/components/DocumentationSidebar/index.ts +2 -2
- package/src/components/Dropdown/Dropdown.static.ts +1 -1
- package/src/components/Dropdown/Dropdown.tsx +3 -5
- package/src/components/Dropdown/DropdownDivider.tsx +1 -1
- package/src/components/Dropdown/DropdownItem.tsx +1 -1
- package/src/components/Dropdown/DropdownToggleButton.tsx +1 -1
- package/src/components/Dropdown/index.ts +1 -1
- package/src/components/Dropdown/tests/Dropdown.conformance.test.jsx +2 -2
- package/src/components/Dropdown/tests/Dropdown.unit.test.jsx +1 -2
- package/src/components/Expander/Expander.tsx +1 -1
- package/src/components/Expander/tests/Expander.conformance.test.jsx +2 -4
- package/src/components/Expander/tests/Expander.unit.test.jsx +2 -4
- package/src/components/FeatureAccordion/FeatureAccordion.tsx +2 -2
- package/src/components/FeatureAccordion/FeatureAccordionItem.tsx +2 -1
- package/src/components/FeatureAccordion/tests/FeatureAccordion.conformance.test.jsx +1 -1
- package/src/components/FeatureAccordion/tests/FeatureAccordion.unit.test.jsx +2 -3
- package/src/components/Footer/Footer.tsx +4 -5
- package/src/components/Footer/static.ts +2 -2
- package/src/components/Footer/tests/Footer.unit.test.jsx +1 -1
- package/src/components/Forms/Autocomplete/Autocomplete.static.ts +1 -0
- package/src/components/Forms/Autocomplete/Autocomplete.tsx +8 -3
- package/src/components/Forms/Autocomplete/styles/config.scss +3 -3
- package/src/components/Forms/Checkbox/Checkbox.tsx +1 -1
- package/src/components/Forms/Checkbox/styles/mixins.scss +2 -2
- package/src/components/Forms/DatePicker/DatePicker.tsx +1 -2
- package/src/components/Forms/Field/Control.tsx +3 -3
- package/src/components/Forms/Field/Description.tsx +1 -1
- package/src/components/Forms/Field/Field.tsx +4 -4
- package/src/components/Forms/Field/Label.tsx +1 -1
- package/src/components/Forms/Field/Messages.tsx +2 -2
- package/src/components/Forms/Field/tests/Autocomplete.Field.conformance.test.jsx +1 -1
- package/src/components/Forms/Field/tests/Checkbox.Field.conformance.test.jsx +1 -1
- package/src/components/Forms/Field/tests/File.Field.conformance.test.jsx +1 -1
- package/src/components/Forms/Field/tests/Group.Field.conformance.test.jsx +1 -1
- package/src/components/Forms/Field/tests/Radio.Field.conformance.test.jsx +1 -1
- package/src/components/Forms/Field/tests/Rangeslider.Field.test.jsx +1 -1
- package/src/components/Forms/Field/tests/Select.Field.conformance.test.jsx +1 -1
- package/src/components/Forms/Field/tests/Text.Field.conformance.test.jsx +1 -1
- package/src/components/Forms/Field/tests/Textarea.Field.conformance.test.jsx +1 -1
- package/src/components/Forms/Field/tests/Tooltip.unit.test.jsx +1 -2
- package/src/components/Forms/Fieldset/Fieldset.tsx +1 -1
- package/src/components/Forms/File/File.tsx +4 -7
- package/src/components/Forms/File/styles/config.scss +5 -5
- package/src/components/Forms/Group/Group.tsx +2 -3
- package/src/components/Forms/Group/Item.tsx +1 -1
- package/src/components/Forms/Hint/Hint.tsx +1 -1
- package/src/components/Forms/Hint/styles/config.scss +1 -1
- package/src/components/Forms/Hint/styles/mixins.scss +2 -2
- package/src/components/Forms/InputStepper/InputStepper.tsx +1 -1
- package/src/components/Forms/Label/Label.tsx +1 -1
- package/src/components/Forms/Label/styles/mixins.scss +2 -2
- package/src/components/Forms/Message/Message.tsx +9 -5
- package/src/components/Forms/Radio/Radio.tsx +1 -1
- package/src/components/Forms/Radio/styles/mixins.scss +2 -2
- package/src/components/Forms/RangeSlider/RangeSlider.tsx +1 -1
- package/src/components/Forms/Select/Select.tsx +1 -1
- package/src/components/Forms/Select/styles/mixins.scss +6 -6
- package/src/components/Forms/TextArea/TextArea.tsx +1 -1
- package/src/components/Forms/TextInput/TextInput.tsx +3 -5
- package/src/components/Forms/TextInput/styles/mixins.scss +10 -10
- package/src/components/Forms/index.ts +1 -1
- package/src/components/Gauge/Gauge.tsx +1 -1
- package/src/components/Gauge/GaugeMaker.tsx +3 -3
- package/src/components/Gauge/tests/Gauge.unit.test.jsx +0 -1
- package/src/components/Grid/Grid.tsx +1 -1
- package/src/components/Grid/GridCol.tsx +21 -10
- package/src/components/Grid/tests/Grid.unit.test.jsx +0 -1
- package/src/components/Grid/tests/GridCol.unit.test.jsx +0 -1
- package/src/components/Hero/Hero.tsx +1 -1
- package/src/components/Hero/styles/config.scss +0 -1
- package/src/components/Hero/tests/Hero.conformance.test.jsx +1 -2
- package/src/components/Hero/tests/Hero.unit.test.jsx +0 -1
- package/src/components/Hero/tests/data.js +26 -26
- package/src/components/Icon/Icon.tsx +1 -1
- package/src/components/Icon/IconSearch.jsx +4 -4
- package/src/components/Icon/PictogramSearch.jsx +3 -14
- package/src/components/Icon/iconSearchTags.ts +1 -0
- package/src/components/Icon/index.ts +1 -2
- package/src/components/Icon/styles/export/size.scss +2 -2
- package/src/components/Icon/styles/mixins.scss +3 -3
- package/src/components/Icon/styles/style.scss +30 -0
- package/src/components/Icon/tests/Icon.conformance.test.jsx +1 -2
- package/src/components/Icon/tests/Icon.unit.test.jsx +1 -3
- package/src/components/Icon/tests/Pictogram.unit.test.jsx +1 -2
- package/src/components/IconList/IconList.tsx +1 -1
- package/src/components/IconList/Item.tsx +15 -11
- package/src/components/IconList/styles/config.scss +2 -2
- package/src/components/IconList/styles/style.scss +1 -1
- package/src/components/IconList/tests/IconList.conformance.test.jsx +1 -2
- package/src/components/IconList/tests/IconList.unit.test.jsx +29 -26
- package/src/components/Image/Image.tsx +1 -1
- package/src/components/Image/tests/Image.conformance.test.jsx +1 -1
- package/src/components/Image/tests/Image.unit.test.jsx +0 -1
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/Link/tests/Link.conformance.test.jsx +1 -1
- package/src/components/Link/tests/Link.unit.test.jsx +1 -1
- package/src/components/List/ClickableControl.tsx +12 -12
- package/src/components/List/List.tsx +13 -13
- package/src/components/List/ListItem.tsx +11 -11
- package/src/components/List/tests/ClickableControl.unit.test.jsx +0 -1
- package/src/components/List/tests/List.conformance.test.jsx +16 -17
- package/src/components/List/tests/ListItem.unit.test.jsx +46 -47
- package/src/components/Loader/Loader.tsx +1 -1
- package/src/components/Loader/LoaderFullscreen.tsx +32 -0
- package/src/components/Loader/index.ts +1 -0
- package/src/components/Loader/styles/config.scss +5 -5
- package/src/components/Loader/styles/mixins.scss +24 -0
- package/src/components/Loader/styles/style.scss +9 -0
- package/src/components/Loader/tests/Loader.conformance.test.jsx +1 -1
- package/src/components/Loader/tests/LoaderFullscreen.conformance.test.jsx +21 -0
- package/src/components/Loader/tests/LoaderFullscreen.unit.test.jsx +41 -0
- package/src/components/Loader/tests/test.scss +1 -1
- package/src/components/Megamenu/MegaMenuIcon.tsx +1 -1
- package/src/components/Megamenu/Megamenu.static.ts +5 -5
- package/src/components/Megamenu/Megamenu.tsx +28 -29
- package/src/components/Megamenu/MegamenuBlog.tsx +17 -19
- package/src/components/Megamenu/MegamenuSearchContent.tsx +2 -2
- package/src/components/Megamenu/MyOrangeMobilePanel.tsx +11 -12
- package/src/components/Megamenu/index.ts +1 -1
- package/src/components/Megamenu/static.ts +2 -2
- package/src/components/Modal/Modal.tsx +3 -4
- package/src/components/Modal/ModalBody.tsx +1 -1
- package/src/components/Modal/ModalCloseButton.tsx +1 -1
- package/src/components/Modal/ModalProductFooter.tsx +1 -1
- package/src/components/Modal/ModalProductHeader.tsx +1 -1
- package/src/components/Modal/index.ts +2 -2
- package/src/components/Modal/tests/Modal.conformance.test.jsx +2 -3
- package/src/components/Modal/tests/Modal.unit.test.jsx +0 -1
- package/src/components/Modal/tests/ModalProductHeader.unit.test.jsx +0 -1
- package/src/components/Modal/tests/ModalTitle.unit.test.jsx +0 -1
- package/src/components/Pagination/Pagination.tsx +2 -3
- package/src/components/Pagination/PaginationItem.tsx +1 -1
- package/src/components/Pagination/Separator.tsx +1 -1
- package/src/components/Pagination/helpers.ts +6 -1
- package/src/components/Pagination/tests/Item.unit.test.jsx +38 -39
- package/src/components/Pagination/tests/Pagination.conformance.test.jsx +7 -8
- package/src/components/Pagination/tests/Pagination.unit.test.jsx +39 -40
- package/src/components/Pagination/tests/Separator.unit.test.jsx +10 -11
- package/src/components/Pill/Pill.tsx +1 -1
- package/src/components/Pill/tests/Pill.conformance.test.jsx +1 -1
- package/src/components/Preview/CodeExample.tsx +6 -9
- package/src/components/Preview/Preview.tsx +2 -1
- package/src/components/Preview/PreviewGenerator.tsx +8 -8
- package/src/components/Preview/PreviewTitleBar.tsx +1 -1
- package/src/components/Preview/index.tsx +1 -1
- package/src/components/Progress/Progress.tsx +1 -1
- package/src/components/Progress/index.ts +1 -1
- package/src/components/Progress/tests/Progress.conformance.test.jsx +6 -7
- package/src/components/Progress/tests/Progress.unit.test.jsx +42 -39
- package/src/components/PromoBanner/PromoBanner.tsx +1 -1
- package/src/components/PromoBanner/styles/style.scss +2 -2
- package/src/components/PromoBanner/tests/PromoBanner.conformance.test.jsx +1 -2
- package/src/components/PromoBanner/tests/PromoBanner.unit.test.jsx +0 -1
- package/src/components/PromotionCard/PromotionCard.tsx +1 -1
- package/src/components/PromotionCard/PromotionCardContent.tsx +8 -8
- package/src/components/PromotionCard/PromotionCardImageWrapper.tsx +7 -9
- package/src/components/PromotionCard/PromotionCardSection.tsx +1 -1
- package/src/components/PromotionCard/PromotionCardTitle.tsx +11 -11
- package/src/components/PromotionCard/constants.ts +2 -2
- package/src/components/PromotionCard/styles/config.scss +2 -4
- package/src/components/PromotionCard/tests/PromotionCard.conformance.test.jsx +1 -2
- package/src/components/PromotionCard/tests/PromotionCard.unit.test.jsx +0 -1
- package/src/components/Section/Section.tsx +1 -1
- package/src/components/Section/tests/Section.conformance.test.jsx +1 -2
- package/src/components/Section/tests/Section.unit.test.jsx +0 -1
- package/src/components/Skeleton/Skeleton.tsx +1 -1
- package/src/components/Skeleton/styles/mixins.scss +3 -3
- package/src/components/Skeleton/tests/Skeleton.conformance.test.jsx +1 -1
- package/src/components/SkipLink/SkipLink.tsx +1 -1
- package/src/components/SkipLink/tests/SkipLink.unit.test.jsx +0 -4
- package/src/components/SocialButton/SocialButton.tsx +1 -1
- package/src/components/SocialButton/tests/SocialButton.unit.test.jsx +1 -1
- package/src/components/Stepbar/Stepbar.tsx +1 -1
- package/src/components/Stepbar/tests/Stepbar.conformance.test.jsx +1 -1
- package/src/components/Sticker/Sticker.tsx +14 -8
- package/src/components/Sticker/index.ts +1 -0
- package/src/components/Sticker/styles/mixins.scss +2 -2
- package/src/components/Sticker/tests/Sticker.conformance.test.jsx +5 -6
- package/src/components/Sticker/tests/Sticker.unit.test.jsx +16 -19
- package/src/components/Table/Header.tsx +1 -2
- package/src/components/Table/Row.tsx +1 -2
- package/src/components/Table/Rows.tsx +1 -2
- package/src/components/Table/Table.tsx +4 -5
- package/src/components/Table/docsData.ts +0 -1
- package/src/components/Table/index.ts +1 -1
- package/src/components/Table/styles/mixins.scss +5 -0
- package/src/components/Table/tests/Footer.unit.test.jsx +1 -2
- package/src/components/Table/tests/Header.unit.test.jsx +1 -2
- package/src/components/Table/tests/Row.unit.test.jsx +1 -2
- package/src/components/Table/tests/Rows.unit.test.jsx +1 -2
- package/src/components/Table/tests/Table.conformance.test.jsx +6 -6
- package/src/components/Table/tests/Table.unit.test.jsx +1 -1
- package/src/components/Tabs/Tabs.tsx +2 -2
- package/src/components/Tabs/index.ts +2 -2
- package/src/components/Tabs/tests/Tabs.unit.test.jsx +2 -3
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/Tag/TagButton.tsx +1 -1
- package/src/components/Tag/index.ts +1 -1
- package/src/components/Tag/styles/mixins.scss +1 -1
- package/src/components/Tag/tests/Tag.conformance.test.jsx +2 -3
- package/src/components/Tag/tests/Tag.unit.test.jsx +1 -3
- package/src/components/Tag/tests/TagButton.conformance.test.jsx +1 -1
- package/src/components/Tag/tests/TagButton.unit.test.jsx +1 -1
- package/src/components/Testimonial/Testimonial.tsx +15 -15
- package/src/components/Testimonial/styles/config.scss +25 -22
- package/src/components/Testimonial/styles/mixins.scss +36 -32
- package/src/components/Testimonial/tests/Testimonial.conformance.test.jsx +5 -6
- package/src/components/Testimonial/tests/Testimonial.unit.test.jsx +22 -23
- package/src/components/Tile/Tile.tsx +2 -3
- package/src/components/Tile/tests/Tile.conformance.test.jsx +1 -1
- package/src/components/Tooltip/InfoTooltip.tsx +1 -1
- package/src/components/Tooltip/Tooltip.static.ts +100 -66
- package/src/components/Tooltip/Tooltip.tsx +2 -3
- package/src/components/Tooltip/index.ts +1 -1
- package/src/components/Tooltip/styles/mixins.scss +14 -13
- package/src/components/Tooltip/tests/Tooltip.conformance.test.jsx +1 -1
- package/src/components/Tooltip/tests/Tooltip.unit.test.jsx +43 -34
- package/src/components/index.ts +41 -40
- package/src/styles/base/globals.scss +17 -1
- package/src/styles/export/breakpoint.scss +1 -1
- package/src/styles/export/breakpoint.ts +7 -7
- package/src/styles/export/space.scss +1 -1
- package/src/styles/tokens/breakpoint.scss +64 -49
- package/src/styles/tokens/space.scss +9 -9
- package/src/styles/tools/generate.scss +6 -6
- package/src/styles/tools/layout.scss +3 -3
- package/src/styles/tools/map.scss +2 -2
- package/src/styles/tools/text.scss +1 -1
- package/src/styles/utilities/index.scss +7 -7
- package/build/search-index.json +0 -426
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import cx from "classnames";
|
|
2
|
-
|
|
3
|
-
import { MegamenuIcon } from "./MegaMenuIcon";
|
|
4
2
|
import {
|
|
5
3
|
CLASS_CONTAINER,
|
|
6
4
|
CLASS_MOBILE,
|
|
7
|
-
CLASS_MOBILE_OVERLAY,
|
|
8
|
-
CLASS_MOBILE_WRAPPER,
|
|
9
|
-
CLASS_MOBILE_HEADER,
|
|
10
|
-
CLASS_MOBILE_BODY,
|
|
11
5
|
CLASS_MOBILE_ACCOUNT,
|
|
12
6
|
CLASS_MOBILE_ACCOUNT_AVATAR,
|
|
13
|
-
CLASS_MOBILE_ACCOUNT_NAME,
|
|
14
|
-
CLASS_MOBILE_ACCOUNT_PHONE,
|
|
15
|
-
CLASS_MOBILE_ACCOUNT_LOGOUT,
|
|
16
7
|
CLASS_MOBILE_ACCOUNT_CTA,
|
|
17
|
-
CLASS_MOBILE_ACCOUNT_LINKS,
|
|
18
8
|
CLASS_MOBILE_ACCOUNT_LINK,
|
|
9
|
+
CLASS_MOBILE_ACCOUNT_LINKS,
|
|
10
|
+
CLASS_MOBILE_ACCOUNT_LOGOUT,
|
|
11
|
+
CLASS_MOBILE_ACCOUNT_NAME,
|
|
12
|
+
CLASS_MOBILE_ACCOUNT_PHONE,
|
|
13
|
+
CLASS_MOBILE_BODY,
|
|
14
|
+
CLASS_MOBILE_HEADER,
|
|
15
|
+
CLASS_MOBILE_OVERLAY,
|
|
16
|
+
CLASS_MOBILE_WRAPPER,
|
|
19
17
|
CLASS_NAV,
|
|
18
|
+
CLASS_NAV_BUTTON,
|
|
19
|
+
CLASS_NAV_ITEM,
|
|
20
20
|
CLASS_NAV_SPACE_SMALL,
|
|
21
21
|
CLASS_NAV_SPACER,
|
|
22
|
-
CLASS_NAV_ITEM,
|
|
23
|
-
CLASS_NAV_BUTTON,
|
|
24
22
|
CLASS_SUBNAV,
|
|
25
23
|
CLASS_SUBNAV_ITEM,
|
|
26
24
|
} from "./constants";
|
|
25
|
+
import { MegamenuIcon } from "./MegaMenuIcon";
|
|
27
26
|
|
|
28
27
|
type MyOrangeMobilePanelProps = {
|
|
29
28
|
titleId: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Megamenu from "./Megamenu.static";
|
|
2
1
|
import moduleFactory, {
|
|
3
|
-
initModulesWithin,
|
|
4
2
|
destroyModulesWithin,
|
|
3
|
+
initModulesWithin,
|
|
5
4
|
} from "../../scripts/lib/moduleFactory";
|
|
5
|
+
import Megamenu from "./Megamenu.static";
|
|
6
6
|
import "./styles/style.scss";
|
|
7
7
|
|
|
8
8
|
// Module configuration for Megamenu
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import React, { useEffect, useMemo } from "react";
|
|
4
3
|
import cx from "classnames";
|
|
5
|
-
|
|
6
|
-
import { useStatic } from "../../utils/hooks";
|
|
4
|
+
import React, { useEffect, useMemo } from "react";
|
|
7
5
|
import ConditionalWrapper from "../../utils/ConditionalWrapper";
|
|
6
|
+
import { useStatic } from "../../utils/hooks";
|
|
8
7
|
import { Button } from "../Button";
|
|
9
8
|
import { Buttons } from "../Buttons";
|
|
10
9
|
import ModalStatic from "./Modal.static";
|
|
10
|
+
import { ModalBody } from "./ModalBody";
|
|
11
11
|
import { ModalCloseButton } from "./ModalCloseButton";
|
|
12
12
|
import { ModalTitle } from "./ModalTitle";
|
|
13
|
-
import { ModalBody } from "./ModalBody";
|
|
14
13
|
|
|
15
14
|
const CLASS_ROOT = "modal";
|
|
16
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IconButton } from "../Button";
|
|
2
|
-
import { IconButtonProps } from "../Button/IconButton";
|
|
3
2
|
import { ButtonType } from "../Button/Button";
|
|
3
|
+
import { IconButtonProps } from "../Button/IconButton";
|
|
4
4
|
|
|
5
5
|
interface ExtendedIconButtonProps extends IconButtonProps {
|
|
6
6
|
type?: ButtonType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Modal } from "./Modal";
|
|
2
2
|
export { ModalBody } from "./ModalBody";
|
|
3
|
-
export { ModalTitle } from "./ModalTitle";
|
|
4
3
|
export { ModalCloseButton } from "./ModalCloseButton";
|
|
5
|
-
export { ModalProductHeader } from "./ModalProductHeader";
|
|
6
4
|
export { ModalProductFooter } from "./ModalProductFooter";
|
|
5
|
+
export { ModalProductHeader } from "./ModalProductHeader";
|
|
6
|
+
export { ModalTitle } from "./ModalTitle";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { axe } from 'vitest-axe';
|
|
1
|
+
import { fireEvent, render } from "@testing-library/react";
|
|
2
|
+
import { axe } from "vitest-axe";
|
|
4
3
|
|
|
5
4
|
import { Button } from "../../Button";
|
|
6
5
|
import { Modal, ModalProductHeader } from "../";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React, { useMemo } from "react";
|
|
2
1
|
import cx from "classnames";
|
|
3
|
-
|
|
2
|
+
import React, { useMemo } from "react";
|
|
3
|
+
import { getItemState } from "./helpers";
|
|
4
4
|
import { PaginationItem } from "./PaginationItem";
|
|
5
5
|
import Separator from "./Separator";
|
|
6
|
-
import { getItemState } from "./helpers";
|
|
7
6
|
|
|
8
7
|
interface PaginationItemProps {
|
|
9
8
|
/** Page link href */
|
|
@@ -22,7 +22,12 @@ interface ItemState {
|
|
|
22
22
|
showSeparator: boolean;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export function getItemState({
|
|
25
|
+
export function getItemState({
|
|
26
|
+
activeIndex,
|
|
27
|
+
items,
|
|
28
|
+
isCompact,
|
|
29
|
+
index,
|
|
30
|
+
}: GetItemStateParams): ItemState {
|
|
26
31
|
const isFirst = index === 0;
|
|
27
32
|
const isSecond = index === 1;
|
|
28
33
|
const isCurrent = index === activeIndex;
|
|
@@ -2,94 +2,93 @@
|
|
|
2
2
|
* @vitest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { render } from '@testing-library/react';
|
|
5
|
+
import { render } from "@testing-library/react";
|
|
7
6
|
|
|
8
|
-
import { PaginationItem as Item } from
|
|
7
|
+
import { PaginationItem as Item } from "../PaginationItem.tsx";
|
|
9
8
|
|
|
10
|
-
describe(
|
|
11
|
-
describe(
|
|
12
|
-
it(
|
|
9
|
+
describe("rendering Item", () => {
|
|
10
|
+
describe("initial state", () => {
|
|
11
|
+
it("has default class pagination__item", () => {
|
|
13
12
|
const { container } = render(<Item />);
|
|
14
|
-
expect(container.querySelector(
|
|
13
|
+
expect(container.querySelector("li")).toHaveClass("pagination__item");
|
|
15
14
|
});
|
|
16
15
|
|
|
17
|
-
it(
|
|
16
|
+
it("has default class pagination__link", () => {
|
|
18
17
|
const { container } = render(<Item />);
|
|
19
|
-
expect(container.querySelector(
|
|
18
|
+
expect(container.querySelector("a")).toHaveClass("pagination__link");
|
|
20
19
|
});
|
|
21
20
|
|
|
22
|
-
it(
|
|
21
|
+
it("has default class btn", () => {
|
|
23
22
|
const { container } = render(<Item />);
|
|
24
|
-
expect(container.querySelector(
|
|
23
|
+
expect(container.querySelector("a")).toHaveClass("btn");
|
|
25
24
|
});
|
|
26
25
|
|
|
27
|
-
it(
|
|
26
|
+
it("has default class btn--square", () => {
|
|
28
27
|
const { container } = render(<Item />);
|
|
29
|
-
expect(container.querySelector(
|
|
28
|
+
expect(container.querySelector("a")).toHaveClass("btn--square");
|
|
30
29
|
});
|
|
31
30
|
});
|
|
32
31
|
|
|
33
|
-
describe(
|
|
34
|
-
it(
|
|
32
|
+
describe("passed props", () => {
|
|
33
|
+
it("passes other props", () => {
|
|
35
34
|
const { getByTestId } = render(<Item data-testid="test" />);
|
|
36
|
-
expect(getByTestId(
|
|
35
|
+
expect(getByTestId("test")).toBeInTheDocument();
|
|
37
36
|
});
|
|
38
37
|
|
|
39
|
-
it(
|
|
38
|
+
it("has link role when href is set", () => {
|
|
40
39
|
const { getByRole } = render(<Item href="/" />);
|
|
41
|
-
expect(getByRole(
|
|
40
|
+
expect(getByRole("link")).toBeInTheDocument();
|
|
42
41
|
});
|
|
43
42
|
|
|
44
|
-
it(
|
|
43
|
+
it("list item has additional class when className is set", () => {
|
|
45
44
|
const { container } = render(<Item className="test-class" />);
|
|
46
|
-
expect(container.querySelector(
|
|
45
|
+
expect(container.querySelector("li")).toHaveClass("test-class");
|
|
47
46
|
});
|
|
48
47
|
|
|
49
|
-
it(
|
|
48
|
+
it("anchor has pagination__link--active class when isActive is set to true", () => {
|
|
50
49
|
const { container } = render(<Item isActive={true} />);
|
|
51
|
-
expect(container.querySelector(
|
|
52
|
-
|
|
50
|
+
expect(container.querySelector("a")).toHaveClass(
|
|
51
|
+
"pagination__link--active",
|
|
53
52
|
);
|
|
54
53
|
});
|
|
55
54
|
|
|
56
|
-
it(
|
|
55
|
+
it("anchor attribute has pagination__link--active class when isActive is set to true", () => {
|
|
57
56
|
const { container } = render(<Item isActive={true} />);
|
|
58
|
-
expect(container.querySelector(
|
|
59
|
-
|
|
57
|
+
expect(container.querySelector("a")).toHaveClass(
|
|
58
|
+
"pagination__link--active",
|
|
60
59
|
);
|
|
61
60
|
});
|
|
62
61
|
|
|
63
|
-
it(
|
|
62
|
+
it("anchor shows label when hasIcon is falsy and label is truthy string", () => {
|
|
64
63
|
const { getByText } = render(<Item label="test-label" />);
|
|
65
|
-
expect(getByText(
|
|
64
|
+
expect(getByText("test-label")).toBeInTheDocument();
|
|
66
65
|
});
|
|
67
66
|
|
|
68
67
|
it('anchors aria-current attribute is set to "page" when isActive is true', () => {
|
|
69
68
|
const { container } = render(<Item isActive={true} />);
|
|
70
|
-
expect(container.querySelector(
|
|
71
|
-
|
|
69
|
+
expect(container.querySelector("a").getAttribute("aria-current")).toBe(
|
|
70
|
+
"page",
|
|
72
71
|
);
|
|
73
72
|
});
|
|
74
73
|
|
|
75
|
-
it(
|
|
74
|
+
it("anchors aria-label attribute is set to ariaLabel value", () => {
|
|
76
75
|
const { container } = render(<Item ariaLabel="test-label" />);
|
|
77
|
-
expect(container.querySelector(
|
|
78
|
-
|
|
76
|
+
expect(container.querySelector("a").getAttribute("aria-label")).toBe(
|
|
77
|
+
"test-label",
|
|
79
78
|
);
|
|
80
79
|
});
|
|
81
80
|
|
|
82
|
-
it(
|
|
81
|
+
it("first item with icon has a chevron-start icon", () => {
|
|
83
82
|
const { container } = render(<Item hasIcon={true} isFirst={true} />);
|
|
84
|
-
expect(container.querySelector(
|
|
85
|
-
|
|
83
|
+
expect(container.querySelector("use").getAttribute("xlink:href")).toBe(
|
|
84
|
+
"/sprite.svg#chevron-start",
|
|
86
85
|
);
|
|
87
86
|
});
|
|
88
87
|
|
|
89
|
-
it(
|
|
88
|
+
it("last item with icon has a chevron-end icon", () => {
|
|
90
89
|
const { container } = render(<Item hasIcon={true} isLast={true} />);
|
|
91
|
-
expect(container.querySelector(
|
|
92
|
-
|
|
90
|
+
expect(container.querySelector("use").getAttribute("xlink:href")).toBe(
|
|
91
|
+
"/sprite.svg#chevron-end",
|
|
93
92
|
);
|
|
94
93
|
});
|
|
95
94
|
});
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { axe } from 'vitest-axe';
|
|
1
|
+
import { render } from "@testing-library/react";
|
|
2
|
+
import { axe } from "vitest-axe";
|
|
4
3
|
|
|
5
|
-
import { Pagination } from
|
|
4
|
+
import { Pagination } from "../Pagination.tsx";
|
|
6
5
|
|
|
7
6
|
const getItems = (count = 10, current = Math.ceil(count / 2)) =>
|
|
8
7
|
[
|
|
9
8
|
...Array(count)
|
|
10
|
-
.fill(
|
|
9
|
+
.fill("")
|
|
11
10
|
.map((_, i) => i + 1),
|
|
12
|
-
].map(n => ({
|
|
11
|
+
].map((n) => ({
|
|
13
12
|
label: `${n}`,
|
|
14
13
|
ariaLabel: `Strana ${n}`,
|
|
15
14
|
href: `/?page=${n}`,
|
|
@@ -30,12 +29,12 @@ const example = (
|
|
|
30
29
|
</>
|
|
31
30
|
);
|
|
32
31
|
|
|
33
|
-
it(
|
|
32
|
+
it("is valid html", () => {
|
|
34
33
|
const { container } = render(example);
|
|
35
34
|
expect(container).toHTMLValidate();
|
|
36
35
|
});
|
|
37
36
|
|
|
38
|
-
it(
|
|
37
|
+
it("is accessible", async () => {
|
|
39
38
|
const { container } = render(example);
|
|
40
39
|
expect(await axe(container)).toHaveNoViolations();
|
|
41
40
|
});
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
1
|
+
import { render } from "@testing-library/react";
|
|
3
2
|
|
|
4
|
-
import { Pagination } from
|
|
3
|
+
import { Pagination } from "../Pagination.tsx";
|
|
5
4
|
|
|
6
5
|
//items array is required
|
|
7
|
-
describe(
|
|
8
|
-
describe(
|
|
9
|
-
it(
|
|
6
|
+
describe("rendering Pagination", () => {
|
|
7
|
+
describe("initial state", () => {
|
|
8
|
+
it("has default class pagination", () => {
|
|
10
9
|
const { getByTestId } = render(
|
|
11
|
-
<Pagination items={[]} data-testid="test-id"
|
|
10
|
+
<Pagination items={[]} data-testid="test-id" />,
|
|
12
11
|
);
|
|
13
|
-
expect(getByTestId(
|
|
12
|
+
expect(getByTestId("test-id")).toHaveClass("pagination");
|
|
14
13
|
});
|
|
15
14
|
});
|
|
16
15
|
|
|
17
|
-
describe(
|
|
16
|
+
describe("passed props", () => {
|
|
18
17
|
const createArray = (length, activeItemNum = 1) => {
|
|
19
18
|
return Array(length)
|
|
20
19
|
.fill()
|
|
@@ -25,83 +24,83 @@ describe('rendering Pagination', () => {
|
|
|
25
24
|
}));
|
|
26
25
|
};
|
|
27
26
|
|
|
28
|
-
it(
|
|
27
|
+
it("has label when set", () => {
|
|
29
28
|
const { getByLabelText } = render(
|
|
30
|
-
<Pagination items={[]} label="test-label"
|
|
29
|
+
<Pagination items={[]} label="test-label" />,
|
|
31
30
|
);
|
|
32
|
-
expect(getByLabelText(
|
|
31
|
+
expect(getByLabelText("test-label")).toBeInTheDocument();
|
|
33
32
|
});
|
|
34
|
-
it(
|
|
33
|
+
it("has additional class when className is set", () => {
|
|
35
34
|
const { getByTestId } = render(
|
|
36
|
-
<Pagination items={[]} data-testid="test-id" className="test-class"
|
|
35
|
+
<Pagination items={[]} data-testid="test-id" className="test-class" />,
|
|
37
36
|
);
|
|
38
|
-
expect(getByTestId(
|
|
39
|
-
expect(getByTestId(
|
|
37
|
+
expect(getByTestId("test-id")).toHaveClass("pagination");
|
|
38
|
+
expect(getByTestId("test-id")).toHaveClass("test-class");
|
|
40
39
|
});
|
|
41
|
-
it(
|
|
40
|
+
it("renders items when items array is set", () => {
|
|
42
41
|
const itemsArr = createArray(3);
|
|
43
42
|
const { container } = render(<Pagination items={itemsArr} />);
|
|
44
|
-
expect(container.querySelectorAll(
|
|
43
|
+
expect(container.querySelectorAll("li").length).toBe(3);
|
|
45
44
|
});
|
|
46
|
-
it(
|
|
45
|
+
it("pagination items have correct href attribute", () => {
|
|
47
46
|
const itemsArr = createArray(3);
|
|
48
47
|
const { container } = render(<Pagination items={itemsArr} />);
|
|
49
|
-
const items = container.querySelectorAll(
|
|
48
|
+
const items = container.querySelectorAll("li");
|
|
50
49
|
for (let i in itemsArr) {
|
|
51
|
-
expect(items[i].querySelector(
|
|
52
|
-
`/test${parseInt(i) + 1}
|
|
50
|
+
expect(items[i].querySelector("a").getAttribute("href")).toBe(
|
|
51
|
+
`/test${parseInt(i) + 1}`,
|
|
53
52
|
);
|
|
54
53
|
}
|
|
55
54
|
});
|
|
56
|
-
it(
|
|
55
|
+
it("pagination items have correct label", () => {
|
|
57
56
|
const itemsArr = createArray(3);
|
|
58
57
|
const { container } = render(<Pagination items={itemsArr} />);
|
|
59
|
-
const items = container.querySelectorAll(
|
|
58
|
+
const items = container.querySelectorAll("li");
|
|
60
59
|
for (let i in itemsArr) {
|
|
61
60
|
expect(items[i]).toHaveTextContent(`item${parseInt(i) + 1}`);
|
|
62
61
|
}
|
|
63
62
|
});
|
|
64
63
|
|
|
65
64
|
for (let i = 1; i <= 10; i++) {
|
|
66
|
-
it(
|
|
65
|
+
it("first and last item has icon/label based on current position when isCompact is set", () => {
|
|
67
66
|
const itemsArr = createArray(10, i);
|
|
68
67
|
const { container } = render(<Pagination items={itemsArr} isCompact />);
|
|
69
|
-
const queryItems = container.querySelectorAll(
|
|
68
|
+
const queryItems = container.querySelectorAll("li");
|
|
70
69
|
if (i < 3) {
|
|
71
|
-
expect(queryItems[0]).toHaveTextContent(
|
|
70
|
+
expect(queryItems[0]).toHaveTextContent("item1");
|
|
72
71
|
expect(
|
|
73
|
-
queryItems[9].querySelector(
|
|
74
|
-
).toBe(
|
|
72
|
+
queryItems[9].querySelector("use").getAttribute("xlink:href"),
|
|
73
|
+
).toBe("/sprite.svg#chevron-end");
|
|
75
74
|
} else if (i <= 8) {
|
|
76
75
|
expect(
|
|
77
|
-
queryItems[0].querySelector(
|
|
78
|
-
).toBe(
|
|
76
|
+
queryItems[0].querySelector("use").getAttribute("xlink:href"),
|
|
77
|
+
).toBe("/sprite.svg#chevron-start");
|
|
79
78
|
expect(
|
|
80
|
-
queryItems[9].querySelector(
|
|
81
|
-
).toBe(
|
|
79
|
+
queryItems[9].querySelector("use").getAttribute("xlink:href"),
|
|
80
|
+
).toBe("/sprite.svg#chevron-end");
|
|
82
81
|
} else {
|
|
83
|
-
expect(queryItems[9]).toHaveTextContent(
|
|
82
|
+
expect(queryItems[9]).toHaveTextContent("item10");
|
|
84
83
|
expect(
|
|
85
|
-
queryItems[0].querySelector(
|
|
86
|
-
).toBe(
|
|
84
|
+
queryItems[0].querySelector("use").getAttribute("xlink:href"),
|
|
85
|
+
).toBe("/sprite.svg#chevron-start");
|
|
87
86
|
}
|
|
88
87
|
});
|
|
89
88
|
}
|
|
90
89
|
for (let i = 1; i <= 8; i++) {
|
|
91
|
-
it(
|
|
90
|
+
it("renders separator/separators when isCompact is not set", () => {
|
|
92
91
|
const itemsArr = createArray(10, i);
|
|
93
92
|
const { container } = render(<Pagination items={itemsArr} />);
|
|
94
93
|
const sepNum = i <= 3 || i >= 8 ? 1 : 2;
|
|
95
94
|
expect(
|
|
96
|
-
container.getElementsByClassName(
|
|
95
|
+
container.getElementsByClassName("pagination__separator").length,
|
|
97
96
|
).toBe(sepNum);
|
|
98
97
|
});
|
|
99
98
|
}
|
|
100
|
-
it(
|
|
99
|
+
it("separator in not rendered when isCompact is set", () => {
|
|
101
100
|
const itemsArr = createArray(10, 5);
|
|
102
101
|
const { container } = render(<Pagination items={itemsArr} isCompact />);
|
|
103
102
|
expect(
|
|
104
|
-
container.getElementsByClassName(
|
|
103
|
+
container.getElementsByClassName("pagination__separator").length,
|
|
105
104
|
).toBe(0);
|
|
106
105
|
});
|
|
107
106
|
});
|
|
@@ -2,24 +2,23 @@
|
|
|
2
2
|
* @vitest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import { render } from '@testing-library/react';
|
|
5
|
+
import { render } from "@testing-library/react";
|
|
7
6
|
|
|
8
|
-
import Separator from
|
|
7
|
+
import Separator from "../Separator";
|
|
9
8
|
|
|
10
|
-
describe(
|
|
11
|
-
describe(
|
|
12
|
-
it(
|
|
9
|
+
describe("rendering Separator", () => {
|
|
10
|
+
describe("initial state", () => {
|
|
11
|
+
it("has default class pagination__separator", () => {
|
|
13
12
|
const { getByTestId } = render(<Separator data-testid="separator" />);
|
|
14
|
-
expect(getByTestId(
|
|
13
|
+
expect(getByTestId("separator")).toHaveClass("pagination__separator");
|
|
15
14
|
});
|
|
16
15
|
});
|
|
17
|
-
describe(
|
|
18
|
-
it(
|
|
16
|
+
describe("rendering Item", () => {
|
|
17
|
+
it("has additional class when className is set", () => {
|
|
19
18
|
const { getByTestId } = render(
|
|
20
|
-
<Separator data-testid="separator" className="test-class"
|
|
19
|
+
<Separator data-testid="separator" className="test-class" />,
|
|
21
20
|
);
|
|
22
|
-
expect(getByTestId(
|
|
21
|
+
expect(getByTestId("separator")).toHaveClass("test-class");
|
|
23
22
|
});
|
|
24
23
|
});
|
|
25
24
|
});
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import unescape from "unescape-html";
|
|
4
|
-
import reactElementToJSXString from "react-element-to-jsx-string";
|
|
1
|
+
import cx from "classnames";
|
|
2
|
+
import React, { ReactNode, useRef, useState } from "react";
|
|
5
3
|
import { renderToStaticMarkup } from "react-dom/server";
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import { Button } from "../Button";
|
|
4
|
+
import reactElementToJSXString from "react-element-to-jsx-string";
|
|
5
|
+
import unescape from "unescape-html";
|
|
9
6
|
import { formatHTML } from "../../utils/formatCode";
|
|
10
|
-
|
|
11
|
-
import
|
|
7
|
+
import { Button } from "../Button";
|
|
8
|
+
import Code from "../Code/";
|
|
12
9
|
|
|
13
10
|
interface CodeExampleProps {
|
|
14
11
|
codeJSXOptions?: Record<string, any>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Preview component (SERVER component - runs on server)
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from "react";
|
|
2
4
|
import React from "react";
|
|
3
5
|
import reactElementToJSXString from "react-element-to-jsx-string";
|
|
4
|
-
import type { ReactNode } from "react";
|
|
5
6
|
import { PreviewGenerator } from "./PreviewGenerator";
|
|
6
7
|
|
|
7
8
|
type PreviewProps = React.ComponentProps<typeof PreviewGenerator> & {
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import React, { useState, useId, ReactNode, FunctionComponent } from "react";
|
|
4
3
|
import cx from "classnames";
|
|
4
|
+
import React, { FunctionComponent, ReactNode, useId, useState } from "react";
|
|
5
5
|
import reactElementToJSXString from "react-element-to-jsx-string";
|
|
6
|
-
|
|
7
|
-
import PreviewTitleBar from "./PreviewTitleBar";
|
|
8
|
-
import CodeExample from "./CodeExample";
|
|
9
|
-
|
|
10
|
-
import { Card } from "../Card";
|
|
11
|
-
import { Icon } from "../Icon";
|
|
12
6
|
import { Button } from "../Button";
|
|
7
|
+
import { Card } from "../Card";
|
|
13
8
|
import { Dropdown, DropdownItem } from "../Dropdown";
|
|
9
|
+
import { Icon } from "../Icon";
|
|
10
|
+
import CodeExample from "./CodeExample";
|
|
11
|
+
import PreviewTitleBar from "./PreviewTitleBar";
|
|
14
12
|
|
|
15
13
|
import "./styles/style.scss";
|
|
16
14
|
|
|
@@ -354,7 +352,9 @@ const PreviewGenerator: FunctionComponent<PreviewProps> = ({
|
|
|
354
352
|
html;
|
|
355
353
|
|
|
356
354
|
// Apply the exact same wrapping logic for code display
|
|
357
|
-
const toCode = codeContent
|
|
355
|
+
const toCode = codeContent
|
|
356
|
+
? wrapComponentWithTheme(codeContent)
|
|
357
|
+
: codeContent;
|
|
358
358
|
|
|
359
359
|
// Generate JSX string for the JSX tab
|
|
360
360
|
// Use pre-generated JSX if provided (from server), otherwise generate client-side
|