@orangesk/orange-design-system 2.0.0-beta.9 → 2.0.0
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 +358 -19
- package/build/appstore.svg +31 -0
- package/build/components/Accordion/style.css +2 -0
- package/build/components/Accordion/style.css.map +1 -0
- package/build/components/Alert/style.css +2 -0
- package/build/components/Alert/style.css.map +1 -0
- package/build/components/AnchorNavigation/style.css +2 -0
- package/build/components/AnchorNavigation/style.css.map +1 -0
- package/build/components/Bar/style.css +2 -0
- package/build/components/Bar/style.css.map +1 -0
- package/build/components/BlockAction/style.css +2 -0
- package/build/components/BlockAction/style.css.map +1 -0
- package/build/components/BodyBanner/style.css +2 -0
- package/build/components/BodyBanner/style.css.map +1 -0
- package/build/components/Breadcrumbs/style.css +2 -0
- package/build/components/Breadcrumbs/style.css.map +1 -0
- package/build/components/Button/style.css +2 -0
- package/build/components/Button/style.css.map +1 -0
- package/build/components/Buttons/style.css +2 -0
- package/build/components/Buttons/style.css.map +1 -0
- package/build/components/Card/style.css +2 -0
- package/build/components/Card/style.css.map +1 -0
- package/build/components/Carousel/style.css +2 -0
- package/build/components/Carousel/style.css.map +1 -0
- package/build/components/CarouselHero/style.css +2 -0
- package/build/components/CarouselHero/style.css.map +1 -0
- package/build/components/CarouselPromotions/style.css +2 -0
- package/build/components/CarouselPromotions/style.css.map +1 -0
- package/build/components/CartTable/style.css +2 -0
- package/build/components/CartTable/style.css.map +1 -0
- package/build/components/Code/style.css +2 -0
- package/build/components/Code/style.css.map +1 -0
- package/build/components/Container/style.css +2 -0
- package/build/components/Container/style.css.map +1 -0
- package/build/components/Controls/style.css +2 -0
- package/build/components/Controls/style.css.map +1 -0
- package/build/components/Cover/style.css +2 -0
- package/build/components/Cover/style.css.map +1 -0
- package/build/components/Divider/style.css +2 -0
- package/build/components/Divider/style.css.map +1 -0
- package/build/components/DocumentationSidebar/style.css +2 -0
- package/build/components/DocumentationSidebar/style.css.map +1 -0
- package/build/components/Dropdown/style.css +2 -0
- package/build/components/Dropdown/style.css.map +1 -0
- package/build/components/Expander/style.css +2 -0
- package/build/components/Expander/style.css.map +1 -0
- package/build/components/FeatureAccordion/style.css +2 -0
- package/build/components/FeatureAccordion/style.css.map +1 -0
- package/build/components/Footer/style.css +2 -0
- package/build/components/Footer/style.css.map +1 -0
- package/build/components/Gauge/style.css +2 -0
- package/build/components/Gauge/style.css.map +1 -0
- package/build/components/Grid/style.css +2 -0
- package/build/components/Grid/style.css.map +1 -0
- package/build/components/Hero/style.css +2 -0
- package/build/components/Hero/style.css.map +1 -0
- package/build/components/Icon/style.css +2 -0
- package/build/components/Icon/style.css.map +1 -0
- package/build/components/IconList/style.css +2 -0
- package/build/components/IconList/style.css.map +1 -0
- package/build/components/Image/style.css +2 -0
- package/build/components/Image/style.css.map +1 -0
- package/build/components/Link/style.css +2 -0
- package/build/components/Link/style.css.map +1 -0
- package/build/components/List/style.css +2 -0
- package/build/components/List/style.css.map +1 -0
- package/build/components/Loader/style.css +2 -0
- package/build/components/Loader/style.css.map +1 -0
- package/build/components/Megamenu/style.css +2 -0
- package/build/components/Megamenu/style.css.map +1 -0
- package/build/components/Modal/style.css +2 -0
- package/build/components/Modal/style.css.map +1 -0
- package/build/components/Pagination/style.css +2 -0
- package/build/components/Pagination/style.css.map +1 -0
- package/build/components/Pill/style.css +2 -0
- package/build/components/Pill/style.css.map +1 -0
- package/build/components/Preview/style.css +2 -0
- package/build/components/Preview/style.css.map +1 -0
- package/build/components/Progress/style.css +2 -0
- package/build/components/Progress/style.css.map +1 -0
- package/build/components/PromoBanner/style.css +2 -0
- package/build/components/PromoBanner/style.css.map +1 -0
- package/build/components/PromotionCard/style.css +2 -0
- package/build/components/PromotionCard/style.css.map +1 -0
- package/build/components/Section/style.css +2 -0
- package/build/components/Section/style.css.map +1 -0
- package/build/components/Skeleton/style.css +2 -0
- package/build/components/Skeleton/style.css.map +1 -0
- package/build/components/SkipLink/style.css +2 -0
- package/build/components/SkipLink/style.css.map +1 -0
- package/build/components/SocialButton/style.css +2 -0
- package/build/components/SocialButton/style.css.map +1 -0
- package/build/components/Stepbar/style.css +2 -0
- package/build/components/Stepbar/style.css.map +1 -0
- package/build/components/Sticker/style.css +2 -0
- package/build/components/Sticker/style.css.map +1 -0
- package/build/components/Table/style.css +2 -0
- package/build/components/Table/style.css.map +1 -0
- package/build/components/Tabs/style.css +2 -0
- package/build/components/Tabs/style.css.map +1 -0
- package/build/components/Tag/style.css +2 -0
- package/build/components/Tag/style.css.map +1 -0
- package/build/components/Testimonial/style.css +2 -0
- package/build/components/Testimonial/style.css.map +1 -0
- package/build/components/Tile/style.css +2 -0
- package/build/components/Tile/style.css.map +1 -0
- package/build/components/Tooltip/style.css +2 -0
- package/build/components/Tooltip/style.css.map +1 -0
- package/build/components/index.js +1 -23
- package/build/components/index.js.map +1 -1
- package/build/components/tsconfig.tsbuildinfo +1 -1
- package/build/components/types/index.d.ts +841 -801
- package/build/components/types/src/components/Accordion/Accordion.d.ts +2 -2
- package/build/components/types/src/components/Accordion/Accordion.static.d.ts +3 -0
- package/build/components/types/src/components/Alert/Alert.d.ts +0 -2
- package/build/components/types/src/components/AnchorNavigation/AnchorNavigation.d.ts +1 -2
- package/build/components/types/src/components/AnchorNavigation/AnchorNavigation.static.d.ts +76 -0
- package/build/components/types/src/components/Bar/index.d.ts +1 -1
- package/build/components/types/src/components/BlockAction/BlockAction.d.ts +2 -0
- package/build/components/types/src/components/BlockAction/Context.d.ts +3 -1
- package/build/components/types/src/components/BlockAction/index.d.ts +2 -4
- package/build/components/types/src/components/BodyBanner/BodyBanner.d.ts +12 -12
- package/build/components/types/src/components/Breadcrumbs/Breadcrumbs.d.ts +0 -2
- package/build/components/types/src/components/Button/Button.d.ts +0 -1
- package/build/components/types/src/components/Button/index.d.ts +4 -5
- package/build/components/types/src/components/Card/Card.d.ts +1 -1
- package/build/components/types/src/components/Card/index.d.ts +2 -1
- package/build/components/types/src/components/Carousel/Carousel.d.ts +1 -3
- package/build/components/types/src/components/Carousel/Carousel.static.d.ts +73 -7
- package/build/components/types/src/components/Carousel/CarouselItem.d.ts +1 -1
- package/build/components/types/src/components/CarouselHero/CarouselHero.d.ts +3 -2
- package/build/components/types/src/components/CarouselHero/CarouselHero.static.d.ts +4 -1
- package/build/components/types/src/components/CarouselHero/CarouselHeroItem.d.ts +1 -2
- package/build/components/types/src/components/CarouselHero/constants.d.ts +1 -2
- package/build/components/types/src/components/CarouselHero/index.d.ts +1 -1
- package/build/components/types/src/components/CarouselPromotions/CarouselPromotions.d.ts +0 -1
- package/build/components/types/src/components/CarouselPromotions/CarouselPromotions.static.d.ts +5 -0
- 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/Controls/Controls.d.ts +0 -1
- package/build/components/types/src/components/Cover/Cover.d.ts +3 -3
- package/build/components/types/src/components/Divider/Divider.d.ts +1 -5
- package/build/components/types/src/components/DocumentationSidebar/DocumentationSidebar.d.ts +1 -0
- 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/Expander/Expander.d.ts +6 -3
- package/build/components/types/src/components/Expander/Expander.static.d.ts +3 -2
- package/build/components/types/src/components/FeatureAccordion/FeatureAccordion.d.ts +14 -3
- package/build/components/types/src/components/FeatureAccordion/FeatureAccordion.static.d.ts +1 -2
- package/build/components/types/src/components/FeatureAccordion/FeatureAccordionItem.d.ts +3 -3
- package/build/components/types/src/components/Footer/Footer.static.d.ts +21 -0
- package/build/components/types/src/components/Footer/PlanObnovy.d.ts +1 -0
- package/build/components/types/src/components/Footer/constants.d.ts +12 -1
- package/build/components/types/src/components/Footer/data.d.ts +11 -0
- package/build/components/types/src/components/Footer/static.d.ts +21 -0
- 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 +12 -0
- package/build/components/types/src/components/Forms/File/File.d.ts +2 -0
- package/build/components/types/src/components/Forms/Group/Group.d.ts +4 -2
- package/build/components/types/src/components/Forms/Group/Item.d.ts +1 -1
- package/build/components/types/src/components/Forms/InputStepper/InputStepper.d.ts +2 -1
- package/build/components/types/src/components/Forms/RangeSlider/RangeSlider.d.ts +2 -0
- package/build/components/types/src/components/Forms/Select/index.d.ts +1 -1
- package/build/components/types/src/components/Forms/TextInput/TextInput.d.ts +3 -0
- package/build/components/types/src/components/Forms/index.d.ts +1 -1
- package/build/components/types/src/components/Grid/Grid.d.ts +2 -2
- package/build/components/types/src/components/Grid/GridCol.d.ts +4 -4
- package/build/components/types/src/components/Hero/Hero.d.ts +0 -3
- package/build/components/types/src/components/Icon/IconSearch.d.ts +2 -2
- package/build/components/types/src/components/Icon/IconSearchWrapper.d.ts +1 -1
- package/build/components/types/src/components/Icon/PictogramSearch.d.ts +6 -0
- package/build/components/types/src/components/Icon/PictogramSearchWrapper.d.ts +1 -0
- package/build/components/types/src/components/Icon/iconSearchTags.d.ts +172 -165
- package/build/components/types/src/components/Icon/iconUtils.d.ts +2 -0
- package/build/components/types/src/components/Icon/index.d.ts +1 -1
- package/build/components/types/src/components/IconList/Item.d.ts +1 -1
- package/build/components/types/src/components/Link/Link.d.ts +2 -2
- 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/BrandMark.d.ts +1 -0
- package/build/components/types/src/components/Megamenu/Logo.d.ts +1 -0
- package/build/components/types/src/components/Megamenu/LogoJeTu.d.ts +1 -0
- package/build/components/types/src/components/Megamenu/Megamenu.d.ts +9 -1
- package/build/components/types/src/components/Megamenu/Megamenu.static.d.ts +21 -5
- package/build/components/types/src/components/Megamenu/MegamenuBlog.d.ts +2 -1
- package/build/components/types/src/components/Megamenu/MegamenuSearchContent.d.ts +10 -0
- package/build/components/types/src/components/Megamenu/MyOrangeMobilePanel.d.ts +6 -0
- package/build/components/types/src/components/Megamenu/constants.d.ts +21 -0
- package/build/components/types/src/components/Megamenu/data.d.ts +21 -0
- package/build/components/types/src/components/Megamenu/ids.d.ts +11 -0
- package/build/components/types/src/components/Megamenu/index.d.ts +1 -1
- package/build/components/types/src/components/Megamenu/static.d.ts +2 -3
- package/build/components/types/src/components/Modal/Modal.d.ts +2 -6
- package/build/components/types/src/components/Modal/Modal.static.d.ts +4 -0
- package/build/components/types/src/components/Modal/ModalBody.d.ts +3 -3
- package/build/components/types/src/components/Modal/ModalCloseButton.d.ts +1 -1
- package/build/components/types/src/components/Modal/ModalProductHeader.d.ts +2 -0
- package/build/components/types/src/components/Modal/index.d.ts +2 -3
- package/build/components/types/src/components/Pagination/Pagination.d.ts +0 -2
- package/build/components/types/src/components/Pagination/Separator.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 +2 -3
- package/build/components/types/src/components/Preview/CodeExample.d.ts +1 -0
- package/build/components/types/src/components/Preview/Preview.d.ts +2 -2
- package/build/components/types/src/components/Preview/PreviewGenerator.d.ts +13 -9
- package/build/components/types/src/components/Preview/getElementDisplayName.d.ts +1 -0
- package/build/components/types/src/components/Preview/index.d.ts +1 -1
- package/build/components/types/src/components/Progress/Progress.d.ts +0 -1
- package/build/components/types/src/components/PromoBanner/PromoBanner.d.ts +12 -3
- package/build/components/types/src/components/PromotionCard/PromotionCard.d.ts +3 -3
- 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/Section/Section.d.ts +4 -1
- package/build/components/types/src/components/SocialButton/SocialButton.d.ts +13 -0
- package/build/components/types/src/components/SocialButton/index.d.ts +1 -0
- package/build/components/types/src/components/Stepbar/Stepbar.d.ts +0 -2
- package/build/components/types/src/components/Sticker/Sticker.d.ts +3 -3
- package/build/components/types/src/components/Table/Row.d.ts +1 -2
- package/build/components/types/src/components/Table/Table.d.ts +3 -3
- package/build/components/types/src/components/Table/docsData.d.ts +2 -0
- package/build/components/types/src/components/Table/index.d.ts +1 -1
- package/build/components/types/src/components/Table/types.d.ts +1 -0
- package/build/components/types/src/components/Tabs/Tabs.d.ts +0 -6
- package/build/components/types/src/components/Tabs/Tabs.static.d.ts +12 -0
- package/build/components/types/src/components/Tabs/index.d.ts +2 -2
- package/build/components/types/src/components/Tag/Tag.d.ts +0 -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/Tile/Tile.d.ts +3 -10
- package/build/components/types/src/components/Tooltip/Tooltip.d.ts +0 -1
- 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/Tooltip/tests/BaseWrapper.d.ts +1 -1
- package/build/components/types/src/components/index.d.ts +22 -20
- package/build/components/types/src/docs/utils/SpacePreview.d.ts +1 -2
- package/build/components/types/src/scripts/index.d.ts +7 -8
- package/build/components/types/src/scripts/modules/SameHeight.d.ts +7 -0
- package/build/components/types/src/scripts/modules/SpacePreview/index.d.ts +1 -1
- package/build/components/types/src/styles/export/color.d.ts +105 -0
- package/build/components/types/src/utils/formatCode.d.ts +5 -0
- package/build/components/types/src/utils/hooks.d.ts +1 -1
- package/build/components/types/src/utils/index.d.ts +2 -2
- package/build/fonts/HelveticaNeue-Bold.woff2 +0 -0
- package/build/fonts/HelveticaNeue-Light.woff2 +0 -0
- package/build/fonts/HelveticaNeue-Roman.woff2 +0 -0
- package/build/googleplay.svg +52 -0
- package/build/lib/base.css +3 -0
- package/build/lib/base.css.map +1 -0
- package/build/lib/components.css +1 -1
- package/build/lib/components.css.map +1 -1
- package/build/lib/footer.css +1 -1
- package/build/lib/footer.css.map +1 -1
- package/build/lib/footer.js +2 -0
- package/build/lib/footer.js.map +1 -0
- package/build/lib/megamenu.css +1 -1
- package/build/lib/megamenu.css.map +1 -1
- package/build/lib/megamenu.js +1 -1
- package/build/lib/megamenu.js.map +1 -1
- package/build/lib/scripts.js +1 -9
- 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/lib/utilities.css +2 -0
- package/build/lib/utilities.css.map +1 -0
- package/build/plan-obnovy.svg +53 -0
- package/build/search-index.json +426 -0
- package/build/sprite.svg +1 -1
- package/package.json +91 -61
- package/public/fonts/HelveticaNeue-Bold.woff2 +0 -0
- package/public/fonts/HelveticaNeue-Light.woff2 +0 -0
- package/public/fonts/HelveticaNeue-Roman.woff2 +0 -0
- package/src/assets/icons/ai.svg +6 -0
- package/src/assets/icons/discount-price.svg +4 -0
- package/src/assets/icons/instagram.svg +5 -1
- package/src/assets/icons/linkedin-2.svg +3 -1
- package/src/assets/icons/pause.svg +5 -1
- package/src/assets/icons/pictogram-deezer--dark.svg +24 -0
- package/src/assets/icons/pictogram-deezer.svg +24 -0
- package/src/assets/icons/pictogram-discount-rental--dark.svg +11 -0
- package/src/assets/icons/pictogram-discount-rental.svg +11 -0
- package/src/assets/icons/pictogram-discount-tv-package--dark.svg +7 -0
- package/src/assets/icons/pictogram-discount-tv-package.svg +7 -0
- package/src/assets/icons/pictogram-disney--dark.svg +15 -0
- package/src/assets/icons/pictogram-disney.svg +10 -0
- package/src/assets/icons/pictogram-eset--dark.svg +10 -0
- package/src/assets/icons/pictogram-eset.svg +10 -0
- package/src/assets/icons/pictogram-ewatch--dark.svg +7 -0
- package/src/assets/icons/pictogram-ewatch.svg +7 -0
- package/src/assets/icons/pictogram-exclusive-package--dark.svg +5 -0
- package/src/assets/icons/pictogram-exclusive-package.svg +5 -0
- package/src/assets/icons/pictogram-fast-data--dark.svg +6 -0
- package/src/assets/icons/pictogram-fast-data.svg +6 -0
- package/src/assets/icons/pictogram-hbo-max--dark.svg +4 -5
- package/src/assets/icons/pictogram-hbo-max.svg +4 -5
- package/src/assets/icons/pictogram-interaction--dark.svg +20 -0
- package/src/assets/icons/pictogram-interaction.svg +20 -0
- package/src/assets/icons/pictogram-internet--dark.svg +15 -0
- package/src/assets/icons/pictogram-internet.svg +15 -0
- package/src/assets/icons/pictogram-my-orange--dark.svg +6 -0
- package/src/assets/icons/pictogram-my-orange.svg +6 -0
- package/src/assets/icons/pictogram-offer-package--dark.svg +7 -0
- package/src/assets/icons/pictogram-offer-package.svg +7 -0
- package/src/assets/icons/pictogram-prima-love--dark.svg +4 -0
- package/src/assets/icons/pictogram-prima-love.svg +4 -0
- package/src/assets/icons/pictogram-shared-data--dark.svg +8 -0
- package/src/assets/icons/pictogram-shared-data.svg +8 -0
- package/src/assets/icons/pictogram-tariffs--dark.svg +9 -0
- package/src/assets/icons/pictogram-tariffs.svg +9 -0
- package/src/assets/icons/pictogram-unlimited-data--dark.svg +19 -0
- package/src/assets/icons/pictogram-unlimited-data.svg +19 -0
- package/src/assets/icons/pinterest.svg +4 -0
- package/src/assets/icons/play.svg +4 -1
- package/src/assets/icons/quote.svg +4 -0
- package/src/assets/icons/snapchat.svg +4 -0
- package/src/assets/icons/tiktok.svg +4 -0
- package/src/assets/icons/whatsapp.svg +4 -0
- package/src/assets/icons/youtube.svg +3 -1
- package/src/components/Accordion/Accordion.static.ts +79 -30
- package/src/components/Accordion/Accordion.tsx +6 -7
- package/src/components/Accordion/AccordionHeader.tsx +1 -11
- package/src/components/Accordion/AccordionItem.tsx +3 -1
- package/src/components/Accordion/HeadingContext.tsx +1 -1
- package/src/components/Accordion/styles/config.scss +3 -2
- package/src/components/Accordion/styles/mixins.scss +10 -9
- package/src/components/Accordion/styles/style.scss +2 -2
- package/src/components/Accordion/tests/{Accordion.static.test.js → Accordion.static.test.jsx} +23 -23
- package/src/components/Accordion/tests/{Accordion.unit.test.js → Accordion.unit.test.jsx} +125 -31
- package/src/components/Alert/Alert.tsx +3 -10
- package/src/components/Alert/styles/config.scss +1 -1
- package/src/components/Alert/styles/mixins.scss +4 -1
- package/src/components/Alert/tests/{Alert.conformance.test.js → Alert.conformance.test.jsx} +2 -3
- package/src/components/Alert/tests/{Alert.test.js → Alert.test.jsx} +2 -16
- package/src/components/Alert/tests/Alert.visual.test.jsx +137 -0
- package/src/components/Alert/tests/__screenshots__/Alert.visual.test.jsx/alert-preview-custom-title-chromium-linux.png +0 -0
- package/src/components/Alert/tests/__screenshots__/Alert.visual.test.jsx/alert-preview-danger-chromium-linux.png +0 -0
- package/src/components/Alert/tests/__screenshots__/Alert.visual.test.jsx/alert-preview-full-width-chromium-linux.png +0 -0
- package/src/components/Alert/tests/__screenshots__/Alert.visual.test.jsx/alert-preview-success-chromium-linux.png +0 -0
- package/src/components/Alert/tests/__screenshots__/Alert.visual.test.jsx/alert-preview-title-buttons-chromium-linux.png +0 -0
- package/src/components/Alert/tests/__screenshots__/Alert.visual.test.jsx/alert-preview-title-chromium-linux.png +0 -0
- package/src/components/Alert/tests/__screenshots__/Alert.visual.test.jsx/alert-preview-title-description-buttons-chromium-linux.png +0 -0
- package/src/components/Alert/tests/__screenshots__/Alert.visual.test.jsx/alert-preview-title-description-chromium-linux.png +0 -0
- package/src/components/Alert/tests/__screenshots__/Alert.visual.test.jsx/alert-preview-warning-chromium-linux.png +0 -0
- package/src/components/AnchorNavigation/AnchorNavigation.static.ts +746 -88
- package/src/components/AnchorNavigation/AnchorNavigation.tsx +5 -15
- package/src/components/AnchorNavigation/styles/mixins.scss +124 -15
- package/src/components/AnchorNavigation/tests/{AnchorNavigation.conformance.test.js → AnchorNavigation.conformance.test.jsx} +1 -10
- package/src/components/AnchorNavigation/tests/AnchorNavigation.unit.test.jsx +801 -0
- 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/styles/config.scss +4 -5
- package/src/components/Bar/styles/mixins.scss +11 -11
- package/src/components/Bar/tests/{Bar.conformance.test.js → Bar.conformance.test.jsx} +1 -1
- package/src/components/BlockAction/BlockAction.tsx +10 -3
- 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 +5 -1
- package/src/components/BlockAction/index.tsx +3 -8
- package/src/components/BlockAction/styles/config.scss +6 -6
- package/src/components/BlockAction/styles/mixins.scss +5 -0
- package/src/components/BlockAction/styles/style.scss +11 -4
- package/src/components/BlockAction/tests/{BlockAction.conformance.test.js → BlockAction.conformance.test.jsx} +1 -1
- package/src/components/BlockAction/tests/{BlockActionControl.unit.test.js → BlockActionControl.unit.test.jsx} +3 -3
- package/src/components/BodyBanner/BodyBanner.tsx +54 -78
- package/src/components/BodyBanner/styles/mixins.scss +50 -45
- package/src/components/BodyBanner/styles/style.scss +4 -18
- package/src/components/BodyBanner/tests/BodyBanner.conformance.test.jsx +84 -0
- package/src/components/BodyBanner/tests/BodyBanner.unit.test.jsx +201 -0
- package/src/components/Breadcrumbs/BreadcrumbItem.tsx +17 -8
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +4 -12
- package/src/components/Breadcrumbs/styles/mixins.scss +39 -10
- package/src/components/Breadcrumbs/styles/style.scss +2 -1
- package/src/components/Breadcrumbs/tests/{BreadcrumbItem.unit.test.js → BreadcrumbItem.unit.test.jsx} +14 -8
- package/src/components/Breadcrumbs/tests/{Breadcrumbs.conformance.test.js → Breadcrumbs.conformance.test.jsx} +1 -1
- package/src/components/Breadcrumbs/tests/{Breadcrumbs.integration.test.js → Breadcrumbs.integration.test.jsx} +14 -37
- package/src/components/Breadcrumbs/tests/{Breadcrumbs.unit.test.js → Breadcrumbs.unit.test.jsx} +19 -23
- package/src/components/Button/Button.tsx +1 -7
- package/src/components/Button/IconButton.tsx +7 -3
- package/src/components/Button/index.tsx +1 -3
- package/src/components/Button/styles/config.scss +5 -5
- package/src/components/Button/styles/mixins.scss +2 -2
- package/src/components/Button/tests/{Button.conformance.test.js → Button.conformance.test.jsx} +1 -2
- package/src/components/Button/tests/{Button.test.js → Button.test.jsx} +1 -12
- package/src/components/Button/tests/{IconButton.unit.test.js → IconButton.unit.test.jsx} +0 -1
- package/src/components/Buttons/styles/mixins.scss +8 -13
- package/src/components/Buttons/tests/{Buttons.conformance.test.js → Buttons.conformance.test.jsx} +1 -1
- package/src/components/Card/Card.tsx +17 -17
- package/src/components/Card/CardProductHeader.tsx +1 -1
- package/src/components/Card/CardSection.tsx +6 -2
- package/src/components/Card/index.ts +2 -1
- package/src/components/Card/styles/config.scss +2 -2
- package/src/components/Card/styles/mixins.scss +7 -6
- package/src/components/Card/tests/{Card.conformance.test.js → Card.conformance.test.jsx} +2 -2
- package/src/components/Card/tests/Card.unit.test.jsx +81 -0
- package/src/components/Card/tests/{CardProductHeader.unit.test.js → CardProductHeader.unit.test.jsx} +1 -1
- package/src/components/Card/tests/{CardSection.unit.test.js → CardSection.unit.test.jsx} +36 -3
- package/src/components/Carousel/Carousel.static.ts +623 -76
- package/src/components/Carousel/Carousel.tsx +9 -16
- package/src/components/Carousel/CarouselItem.tsx +1 -1
- package/src/components/Carousel/styles/mixins.scss +43 -17
- package/src/components/Carousel/tests/{Carousel.conformance.test.js → Carousel.conformance.test.jsx} +2 -4
- package/src/components/Carousel/tests/Carousel.static.test.jsx +988 -0
- package/src/components/Carousel/tests/{Carousel.unit.test.js → Carousel.unit.test.jsx} +117 -12
- package/src/components/CarouselHero/CarouselHero.static.ts +68 -37
- package/src/components/CarouselHero/CarouselHero.tsx +101 -39
- package/src/components/CarouselHero/CarouselHeroItem.tsx +13 -14
- package/src/components/CarouselHero/constants.ts +1 -2
- package/src/components/CarouselHero/index.ts +1 -1
- package/src/components/CarouselHero/styles/mixins.scss +19 -32
- package/src/components/CarouselHero/styles/style.scss +4 -8
- package/src/components/CarouselHero/tests/{CarouselHero.conformance.test.js → CarouselHero.conformance.test.jsx} +45 -46
- package/src/components/CarouselHero/tests/{CarouselHero.unit.test.js → CarouselHero.unit.test.jsx} +184 -42
- package/src/components/CarouselHero/tests/CarouselHero.visual.test.jsx +90 -0
- package/src/components/CarouselHero/tests/{CarouselHeroItem.conformance.test.js → CarouselHeroItem.conformance.test.jsx} +19 -26
- package/src/components/CarouselHero/tests/{CarouselHeroItem.unit.test.js → CarouselHeroItem.unit.test.jsx} +26 -93
- package/src/components/CarouselPromotions/CarouselPromotions.static.ts +72 -13
- package/src/components/CarouselPromotions/CarouselPromotions.tsx +7 -13
- package/src/components/CarouselPromotions/CarouselPromotionsItem.tsx +3 -3
- package/src/components/CarouselPromotions/styles/mixins.scss +8 -5
- package/src/components/CarouselPromotions/tests/{CarouselPromotions.conformance.test.js → CarouselPromotions.conformance.test.jsx} +13 -6
- package/src/components/CarouselPromotions/tests/{CarouselPromotions.unit.test.js → CarouselPromotions.unit.test.jsx} +3 -22
- package/src/components/CartTable/CartTable.tsx +3 -4
- package/src/components/CartTable/FooterPriceColumn.tsx +6 -4
- package/src/components/CartTable/Price.tsx +2 -2
- 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.js → CartTable.conformance.test.jsx} +1 -1
- package/src/components/Code/Code.tsx +1 -1
- package/src/components/Code/styles/style.scss +6 -5
- 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.conformance.test.js → Container.conformance.test.jsx} +2 -6
- package/src/components/Container/tests/{Container.unit.test.js → Container.unit.test.jsx} +5 -4
- package/src/components/Controls/Controls.tsx +3 -8
- package/src/components/Controls/tests/{Controls.test.js → Controls.test.jsx} +14 -46
- package/src/components/Cover/Cover.tsx +22 -20
- package/src/components/Cover/index.ts +1 -0
- package/src/components/Cover/styles/config.scss +23 -12
- package/src/components/Cover/styles/mixins.scss +6 -5
- package/src/components/Cover/tests/Cover.conformance.test.jsx +27 -0
- package/src/components/Cover/tests/Cover.unit.test.jsx +115 -0
- package/src/components/Divider/Divider.tsx +3 -17
- package/src/components/Divider/styles/config.scss +0 -17
- package/src/components/Divider/styles/mixins.scss +12 -12
- package/src/components/Divider/styles/style.scss +2 -16
- package/src/components/Divider/tests/{Divider.conformance.test.js → Divider.conformance.test.jsx} +2 -2
- package/src/components/Divider/tests/{Divider.unit.test.js → Divider.unit.test.jsx} +0 -17
- package/src/components/DocumentationSidebar/DocumentationSidebar.tsx +231 -9
- package/src/components/DocumentationSidebar/index.ts +2 -2
- package/src/components/DocumentationSidebar/styles/style.scss +76 -3
- package/src/components/Dropdown/Dropdown.static.ts +3 -2
- 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/styles/mixins.scss +1 -1
- package/src/components/Dropdown/tests/{Dropdown.conformance.test.js → Dropdown.conformance.test.jsx} +2 -2
- package/src/components/Dropdown/tests/{Dropdown.unit.test.js → Dropdown.unit.test.jsx} +1 -2
- package/src/components/Expander/Expander.static.ts +22 -28
- package/src/components/Expander/Expander.tsx +21 -17
- package/src/components/Expander/styles/style.scss +18 -3
- package/src/components/Expander/tests/{Expander.conformance.test.js → Expander.conformance.test.jsx} +23 -13
- package/src/components/Expander/tests/Expander.unit.test.jsx +196 -0
- package/src/components/FeatureAccordion/FeatureAccordion.static.ts +93 -48
- package/src/components/FeatureAccordion/FeatureAccordion.tsx +83 -60
- package/src/components/FeatureAccordion/FeatureAccordionItem.tsx +21 -8
- package/src/components/FeatureAccordion/styles/mixins.scss +25 -15
- package/src/components/FeatureAccordion/styles/style.scss +8 -6
- package/src/components/FeatureAccordion/tests/{FeatureAccordion.conformance.test.js → FeatureAccordion.conformance.test.jsx} +3 -1
- package/src/components/FeatureAccordion/tests/{FeatureAccordion.unit.test.js → FeatureAccordion.unit.test.jsx} +2 -8
- package/src/components/Footer/Footer.static.ts +130 -0
- package/src/components/Footer/Footer.tsx +157 -55
- package/src/components/Footer/PlanObnovy.tsx +211 -0
- package/src/components/Footer/constants.ts +12 -1
- package/src/components/Footer/data.ts +40 -0
- package/src/components/Footer/static.ts +59 -0
- package/src/components/Footer/styles/mixins.scss +133 -18
- package/src/components/Footer/styles/style.scss +67 -2
- package/src/components/Footer/tests/{Footer.conformance.test.js → Footer.conformance.test.jsx} +5 -9
- package/src/components/Footer/tests/{Footer.unit.test.js → Footer.unit.test.jsx} +7 -7
- package/src/components/Forms/Autocomplete/Autocomplete.static.ts +215 -2
- package/src/components/Forms/Autocomplete/Autocomplete.tsx +8 -3
- package/src/components/Forms/Autocomplete/styles/config.scss +3 -3
- package/src/components/Forms/Autocomplete/styles/style.scss +95 -0
- package/src/components/Forms/Autocomplete/tests/Autocomplete.static.test.ts +187 -0
- package/src/components/Forms/Checkbox/Checkbox.tsx +1 -1
- package/src/components/Forms/Checkbox/styles/config.scss +6 -3
- package/src/components/Forms/Checkbox/styles/mixins.scss +2 -2
- package/src/components/Forms/Checkbox/styles/style.scss +13 -6
- package/src/components/Forms/DatePicker/DatePicker.tsx +1 -2
- package/src/components/Forms/DatePicker/styles/style.scss +2 -3
- package/src/components/Forms/Field/Control.tsx +52 -49
- 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/styles/config.scss +8 -8
- package/src/components/Forms/Field/styles/mixins.scss +13 -10
- package/src/components/Forms/Field/styles/style.scss +4 -0
- package/src/components/Forms/Field/tests/{Autocomplete.Field.conformance.test.js → Autocomplete.Field.conformance.test.jsx} +2 -2
- package/src/components/Forms/Field/tests/{Checkbox.Field.conformance.test.js → Checkbox.Field.conformance.test.jsx} +2 -1
- package/src/components/Forms/Field/tests/{File.Field.conformance.test.js → File.Field.conformance.test.jsx} +3 -2
- package/src/components/Forms/Field/tests/Group.Field.conformance.test.jsx +72 -0
- package/src/components/Forms/Field/tests/{Radio.Field.conformance.test.js → Radio.Field.conformance.test.jsx} +2 -1
- package/src/components/Forms/Field/tests/{Rangeslider.Field.test.js → Rangeslider.Field.test.jsx} +2 -1
- package/src/components/Forms/Field/tests/{Select.Field.conformance.test.js → Select.Field.conformance.test.jsx} +2 -1
- package/src/components/Forms/Field/tests/{Text.Field.conformance.test.js → Text.Field.conformance.test.jsx} +2 -1
- package/src/components/Forms/Field/tests/{Textarea.Field.conformance.test.js → Textarea.Field.conformance.test.jsx} +2 -1
- package/src/components/Forms/Field/tests/{Tooltip.unit.test.js → Tooltip.unit.test.jsx} +1 -2
- package/src/components/Forms/Fieldset/Fieldset.tsx +1 -1
- package/src/components/Forms/Fieldset/styles/mixins.scss +3 -3
- package/src/components/Forms/File/File.tsx +5 -3
- package/src/components/Forms/File/styles/config.scss +5 -5
- package/src/components/Forms/File/styles/mixins.scss +1 -1
- package/src/components/Forms/Group/Group.tsx +23 -12
- package/src/components/Forms/Group/Item.tsx +1 -1
- package/src/components/Forms/Group/styles/config.scss +1 -1
- package/src/components/Forms/Group/styles/mixins.scss +31 -0
- package/src/components/Forms/Group/tests/{Group.unit.test.js → Group.unit.test.jsx} +9 -0
- 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 +6 -5
- package/src/components/Forms/InputStepper/styles/style.scss +56 -110
- package/src/components/Forms/InputStepper/tests/{InputStepper.unit.test.js → InputStepper.unit.test.jsx} +8 -0
- package/src/components/Forms/Label/Label.tsx +1 -1
- package/src/components/Forms/Label/styles/config.scss +3 -0
- package/src/components/Forms/Label/styles/mixins.scss +2 -2
- package/src/components/Forms/Message/Message.tsx +9 -5
- package/src/components/Forms/Message/styles/config.scss +2 -1
- package/src/components/Forms/Radio/Radio.tsx +1 -1
- package/src/components/Forms/Radio/styles/config.scss +6 -3
- package/src/components/Forms/Radio/styles/mixins.scss +2 -2
- package/src/components/Forms/RangeSlider/RangeSlider.tsx +4 -1
- package/src/components/Forms/RangeSlider/styles/mixins.scss +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/TextArea/styles/config.scss +1 -0
- package/src/components/Forms/TextArea/styles/mixins.scss +17 -10
- package/src/components/Forms/TextInput/TextInput.tsx +27 -2
- package/src/components/Forms/TextInput/styles/config.scss +4 -2
- package/src/components/Forms/TextInput/styles/mixins.scss +17 -11
- package/src/components/Forms/TextInput/styles/style.scss +67 -0
- package/src/components/Forms/index.ts +1 -1
- package/src/components/Forms/styles/config.scss +13 -10
- package/src/components/Gauge/Gauge.tsx +1 -1
- package/src/components/Gauge/GaugeMaker.tsx +5 -5
- package/src/components/Gauge/styles/style.scss +1 -1
- package/src/components/Gauge/tests/{Gauge.unit.test.js → Gauge.unit.test.jsx} +0 -1
- package/src/components/Grid/Grid.tsx +13 -4
- package/src/components/Grid/GridCol.tsx +21 -10
- package/src/components/Grid/styles/config.scss +7 -3
- package/src/components/Grid/styles/mixins.scss +63 -19
- package/src/components/Grid/styles/style.scss +15 -5
- package/src/components/Grid/tests/{Grid.unit.test.js → Grid.unit.test.jsx} +46 -6
- package/src/components/Grid/tests/{GridCol.unit.test.js → GridCol.unit.test.jsx} +1 -2
- package/src/components/Hero/Hero.tsx +3 -17
- package/src/components/Hero/styles/config.scss +0 -1
- package/src/components/Hero/styles/style.scss +0 -14
- package/src/components/Hero/tests/{Hero.conformance.test.js → Hero.conformance.test.jsx} +1 -2
- package/src/components/Hero/tests/Hero.unit.test.jsx +261 -0
- package/src/components/Hero/tests/data.js +26 -26
- package/src/components/Icon/Icon.tsx +1 -1
- package/src/components/Icon/IconSearch.jsx +15 -46
- package/src/components/Icon/PictogramSearch.jsx +123 -0
- package/src/components/Icon/PictogramSearchWrapper.tsx +31 -0
- package/src/components/Icon/SpritePathContext.tsx +1 -1
- package/src/components/Icon/iconSearchTags.ts +181 -173
- package/src/components/Icon/iconUtils.js +63 -0
- package/src/components/Icon/index.ts +1 -1
- 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 +32 -1
- package/src/components/Icon/tests/{Icon.conformance.test.js → Icon.conformance.test.jsx} +1 -2
- package/src/components/Icon/tests/{Icon.unit.test.js → Icon.unit.test.jsx} +2 -4
- package/src/components/Icon/tests/{Pictogram.unit.test.js → Pictogram.unit.test.jsx} +2 -21
- 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/mixins.scss +5 -5
- package/src/components/IconList/styles/style.scss +1 -1
- package/src/components/IconList/tests/{IconList.conformance.test.js → IconList.conformance.test.jsx} +2 -3
- package/src/components/IconList/tests/IconList.unit.test.jsx +82 -0
- package/src/components/IconList/tests/{Item.unit.test.js → Item.unit.test.jsx} +1 -1
- package/src/components/Image/Image.tsx +1 -1
- package/src/components/Image/styles/mixins.scss +2 -2
- package/src/components/Image/tests/{Image.conformance.test.js → Image.conformance.test.jsx} +1 -1
- package/src/components/Image/tests/{Image.unit.test.js → Image.unit.test.jsx} +12 -4
- package/src/components/Link/Link.tsx +5 -6
- package/src/components/Link/styles/mixins.scss +8 -4
- package/src/components/Link/tests/{Link.conformance.test.js → Link.conformance.test.jsx} +3 -9
- package/src/components/Link/tests/{Link.unit.test.js → Link.unit.test.jsx} +6 -26
- 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/styles/config.scss +12 -12
- package/src/components/List/styles/mixins.scss +16 -9
- package/src/components/List/tests/{ClickableControl.unit.test.js → ClickableControl.unit.test.jsx} +0 -1
- package/src/components/List/tests/{List.conformance.test.js → List.conformance.test.jsx} +16 -17
- package/src/components/List/tests/ListItem.unit.test.jsx +103 -0
- package/src/components/Loader/Loader.tsx +3 -11
- 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 +25 -1
- package/src/components/Loader/styles/style.scss +13 -4
- package/src/components/Loader/tests/{Loader.conformance.test.js → 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/BrandMark.tsx +15 -0
- package/src/components/Megamenu/Logo.tsx +13 -0
- package/src/components/Megamenu/LogoJeTu.tsx +60 -0
- package/src/components/Megamenu/MegaMenuIcon.tsx +1 -1
- package/src/components/Megamenu/Megamenu.static.ts +294 -98
- package/src/components/Megamenu/Megamenu.tsx +408 -594
- package/src/components/Megamenu/MegamenuBlog.tsx +211 -95
- package/src/components/Megamenu/MegamenuSearchContent.tsx +82 -0
- package/src/components/Megamenu/MyOrangeMobilePanel.tsx +126 -0
- package/src/components/Megamenu/constants.ts +21 -0
- package/src/components/Megamenu/data.ts +231 -0
- package/src/components/Megamenu/ids.ts +35 -0
- package/src/components/Megamenu/index.ts +1 -1
- package/src/components/Megamenu/static.ts +7 -13
- package/src/components/Megamenu/styles/mixins.scss +430 -65
- package/src/components/Megamenu/styles/style.scss +74 -0
- package/src/components/Megamenu/tests/Megamenu.unit.test.jsx +41 -0
- package/src/components/Modal/Modal.static.ts +77 -56
- package/src/components/Modal/Modal.tsx +38 -29
- package/src/components/Modal/ModalBody.tsx +27 -15
- package/src/components/Modal/ModalCloseButton.tsx +1 -1
- package/src/components/Modal/ModalProductFooter.tsx +1 -1
- package/src/components/Modal/ModalProductHeader.tsx +7 -3
- package/src/components/Modal/index.ts +2 -3
- package/src/components/Modal/styles/config.scss +4 -4
- package/src/components/Modal/styles/mixins.scss +22 -57
- package/src/components/Modal/styles/style.scss +1 -16
- package/src/components/Modal/tests/{Modal.conformance.test.js → Modal.conformance.test.jsx} +3 -4
- package/src/components/Modal/tests/{Modal.unit.test.js → Modal.unit.test.jsx} +0 -60
- package/src/components/Modal/tests/{ModalBody.unit.test.js → ModalBody.unit.test.jsx} +21 -12
- package/src/components/Modal/tests/{ModalProductHeader.unit.test.js → ModalProductHeader.unit.test.jsx} +12 -1
- package/src/components/Modal/tests/{ModalTitle.unit.test.js → ModalTitle.unit.test.jsx} +0 -1
- package/src/components/Pagination/Pagination.tsx +3 -14
- 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/styles/mixins.scss +9 -7
- package/src/components/Pagination/styles/style.scss +0 -4
- package/src/components/Pagination/tests/Item.unit.test.jsx +95 -0
- package/src/components/Pagination/tests/{Pagination.conformance.test.js → Pagination.conformance.test.jsx} +7 -8
- package/src/components/Pagination/tests/Pagination.unit.test.jsx +107 -0
- package/src/components/Pagination/tests/Separator.unit.test.jsx +24 -0
- package/src/components/Pill/Pill.tsx +14 -7
- package/src/components/Pill/styles/config.scss +2 -21
- package/src/components/Pill/styles/style.scss +18 -6
- package/src/components/Pill/tests/{Pill.conformance.test.js → Pill.conformance.test.jsx} +9 -7
- package/src/components/Pill/tests/Pill.unit.test.jsx +148 -0
- package/src/components/Preview/CodeExample.tsx +72 -34
- package/src/components/Preview/Preview.tsx +28 -14
- package/src/components/Preview/PreviewGenerator.tsx +351 -47
- package/src/components/Preview/PreviewTitleBar.tsx +1 -1
- package/src/components/Preview/getElementDisplayName.ts +25 -0
- package/src/components/Preview/index.tsx +1 -1
- package/src/components/Preview/styles/style.scss +51 -1
- package/src/components/Progress/Progress.tsx +2 -14
- package/src/components/Progress/index.ts +1 -1
- package/src/components/Progress/styles/config.scss +4 -4
- package/src/components/Progress/styles/mixins.scss +9 -7
- package/src/components/Progress/tests/{Progress.conformance.test.js → Progress.conformance.test.jsx} +6 -7
- package/src/components/Progress/tests/Progress.unit.test.jsx +111 -0
- package/src/components/PromoBanner/PromoBanner.tsx +72 -20
- package/src/components/PromoBanner/styles/mixins.scss +59 -12
- package/src/components/PromoBanner/styles/style.scss +49 -2
- package/src/components/PromoBanner/tests/PromoBanner.conformance.test.jsx +784 -0
- package/src/components/PromoBanner/tests/PromoBanner.unit.test.jsx +596 -0
- package/src/components/PromotionCard/PromotionCard.tsx +12 -13
- 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/styles/mixins.scss +4 -2
- package/src/components/PromotionCard/tests/PromotionCard.conformance.test.jsx +565 -0
- package/src/components/PromotionCard/tests/PromotionCard.unit.test.jsx +437 -0
- package/src/components/Section/Section.tsx +21 -11
- package/src/components/Section/styles/mixins.scss +38 -13
- package/src/components/Section/styles/style.scss +1 -0
- package/src/components/Section/tests/{Section.conformance.test.js → Section.conformance.test.jsx} +27 -17
- package/src/components/Section/tests/{Section.unit.test.js → Section.unit.test.jsx} +54 -34
- 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.js → Skeleton.conformance.test.jsx} +1 -1
- package/src/components/SkipLink/SkipLink.tsx +1 -1
- package/src/components/SkipLink/tests/{SkipLink.unit.test.js → SkipLink.unit.test.jsx} +1 -5
- package/src/components/SocialButton/SocialButton.tsx +67 -0
- package/src/components/SocialButton/index.ts +1 -0
- package/src/components/SocialButton/styles/config.scss +172 -0
- package/src/components/SocialButton/styles/mixins.scss +42 -0
- package/src/components/SocialButton/styles/style.scss +16 -0
- package/src/components/SocialButton/tests/SocialButton.unit.test.jsx +162 -0
- package/src/components/Stepbar/Stepbar.tsx +1 -6
- package/src/components/Stepbar/styles/config.scss +34 -17
- package/src/components/Stepbar/styles/mixins.scss +6 -4
- package/src/components/Stepbar/styles/style.scss +4 -2
- package/src/components/Stepbar/tests/{Stepbar.conformance.test.js → 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 +16 -0
- package/src/components/Sticker/tests/Sticker.unit.test.jsx +39 -0
- package/src/components/Table/Header.tsx +1 -2
- package/src/components/Table/Row.tsx +10 -5
- package/src/components/Table/Rows.tsx +1 -2
- package/src/components/Table/Table.tsx +15 -11
- package/src/components/Table/TableContext.ts +1 -0
- package/src/components/Table/docsData.ts +25 -1
- package/src/components/Table/index.ts +1 -1
- package/src/components/Table/styles/mixins.scss +51 -11
- package/src/components/Table/styles/style.scss +6 -4
- package/src/components/Table/tests/{Footer.unit.test.js → Footer.unit.test.jsx} +1 -2
- package/src/components/Table/tests/{Header.unit.test.js → Header.unit.test.jsx} +1 -2
- package/src/components/Table/tests/{Row.unit.test.js → Row.unit.test.jsx} +1 -2
- package/src/components/Table/tests/{Rows.unit.test.js → Rows.unit.test.jsx} +1 -2
- package/src/components/Table/tests/{Table.conformance.test.js → Table.conformance.test.jsx} +11 -7
- package/src/components/Table/tests/{Table.unit.test.js → Table.unit.test.jsx} +1 -32
- package/src/components/Table/types.ts +1 -0
- package/src/components/Tabs/Tabs.static.ts +157 -30
- package/src/components/Tabs/Tabs.tsx +64 -74
- package/src/components/Tabs/index.ts +2 -2
- package/src/components/Tabs/styles/config.scss +18 -25
- package/src/components/Tabs/styles/mixins.scss +94 -29
- package/src/components/Tabs/styles/style.scss +4 -15
- package/src/components/Tabs/tests/{Tabs.unit.test.js → Tabs.unit.test.jsx} +112 -10
- package/src/components/Tag/Tag.tsx +1 -5
- package/src/components/Tag/TagButton.tsx +1 -1
- package/src/components/Tag/index.ts +1 -1
- package/src/components/Tag/styles/config.scss +31 -31
- package/src/components/Tag/styles/mixins.scss +3 -2
- package/src/components/Tag/styles/style.scss +55 -0
- package/src/components/Tag/tests/{Tag.conformance.test.js → Tag.conformance.test.jsx} +2 -3
- package/src/components/Tag/tests/{Tag.unit.test.js → Tag.unit.test.jsx} +5 -7
- package/src/components/Tag/tests/{TagButton.conformance.test.js → TagButton.conformance.test.jsx} +1 -1
- package/src/components/Tag/tests/{TagButton.unit.test.js → TagButton.unit.test.jsx} +4 -3
- 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 +16 -0
- package/src/components/Testimonial/tests/Testimonial.unit.test.jsx +43 -0
- package/src/components/Tile/Tile.tsx +19 -36
- package/src/components/Tile/styles/mixins.scss +57 -44
- package/src/components/Tile/styles/style.scss +5 -33
- package/src/components/Tile/tests/{Tile.conformance.test.js → Tile.conformance.test.jsx} +1 -1
- package/src/components/Tile/tests/Tile.unit.test.jsx +64 -0
- package/src/components/Tooltip/InfoTooltip.tsx +2 -6
- package/src/components/Tooltip/Tooltip.static.ts +100 -66
- package/src/components/Tooltip/Tooltip.tsx +3 -13
- 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.js → Tooltip.conformance.test.jsx} +6 -2
- package/src/components/Tooltip/tests/{Tooltip.unit.test.js → Tooltip.unit.test.jsx} +41 -57
- package/src/components/index.ts +48 -37
- package/src/styles/base/globals-forms.scss +8 -0
- package/src/styles/base/globals.scss +67 -30
- package/src/styles/base/styleguide.scss +23 -18
- package/src/styles/export/base.js +2 -2
- package/src/styles/export/breakpoint.scss +1 -1
- package/src/styles/export/breakpoint.ts +7 -7
- package/src/styles/export/color.js +102 -20
- package/src/styles/export/color.scss +10 -20
- package/src/styles/export/space.scss +1 -1
- package/src/styles/shame.scss +16 -3
- package/src/styles/tokens/base.scss +1 -1
- package/src/styles/tokens/breakpoint.scss +64 -49
- package/src/styles/tokens/color-vars.scss +37 -0
- package/src/styles/tokens/color.scss +14 -14
- package/src/styles/tokens/space.scss +9 -9
- package/src/styles/tokens/tag-colors.scss +20 -0
- package/src/styles/tools/convert.scss +8 -0
- 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/typography/config.scss +102 -30
- package/src/styles/typography/mixins.scss +29 -17
- package/src/styles/typography/style.scss +19 -3
- package/src/styles/utilities/border.scss +1 -1
- package/src/styles/utilities/color.scss +0 -153
- package/src/styles/utilities/horizontal-scroll.scss +34 -12
- package/src/styles/utilities/index.scss +7 -6
- package/src/styles/utilities/layout.scss +18 -0
- package/src/styles/utilities/ordering.scss +44 -0
- package/src/styles/utilities/text.scss +43 -2
- package/src/styles/utilities/visibility.scss +2 -4
- package/build/components/index.css +0 -2
- package/build/components/index.css.map +0 -1
- package/build/components/types/src/components/Hero/HeroPlayground.d.ts +0 -2
- package/build/components/types/src/components/Modal/ModalProductBody.d.ts +0 -10
- package/build/lib/after-components.css +0 -2
- package/build/lib/after-components.css.map +0 -1
- package/build/lib/before-components.css +0 -3
- package/build/lib/before-components.css.map +0 -1
- package/build/lib/scripts.css +0 -2
- package/build/lib/scripts.css.map +0 -1
- package/src/components/Accordion/Accordion.mdx +0 -240
- package/src/components/Alert/Alert.mdx +0 -141
- package/src/components/AnchorNavigation/tests/AnchorNavigation.unit.test.js +0 -163
- package/src/components/Bar/Bar.mdx +0 -203
- package/src/components/BlockAction/BlockAction.mdx +0 -244
- package/src/components/BodyBanner/BodyBanner.mdx +0 -268
- package/src/components/Breadcrumbs/Breadcrumbs.mdx +0 -84
- package/src/components/Button/Button.mdx +0 -273
- package/src/components/Buttons/Buttons.mdx +0 -39
- package/src/components/Card/Card.mdx +0 -334
- package/src/components/Card/tests/Card.unit.test.js +0 -42
- package/src/components/Carousel/Carousel.mdx +0 -159
- package/src/components/CarouselPromotions/CarouselPromotions.mdx +0 -246
- package/src/components/CartTable/CartTable.mdx +0 -129
- package/src/components/Container/Container.mdx +0 -73
- package/src/components/Controls/Controls.mdx +0 -469
- package/src/components/Cover/Cover.mdx +0 -87
- package/src/components/Cover/tests/Cover.conformance.test.js +0 -28
- package/src/components/Cover/tests/Cover.unit.test.js +0 -116
- package/src/components/Divider/Divider.mdx +0 -65
- package/src/components/Dropdown/Dropdown.mdx +0 -260
- package/src/components/Expander/Expander.mdx +0 -153
- package/src/components/Expander/tests/Expander.unit.test.js +0 -124
- package/src/components/FeatureAccordion/FeatureAccordion.mdx +0 -33
- package/src/components/Forms/Autocomplete/Autocomplete.mdx +0 -198
- package/src/components/Forms/Checkbox/Checkbox.mdx +0 -139
- package/src/components/Forms/DatePicker/DatePicker.mdx +0 -149
- package/src/components/Forms/Field/Field.mdx +0 -383
- package/src/components/Forms/Field/tests/Group.Field.conformance.test.js +0 -47
- package/src/components/Forms/Fieldset/Fieldset.mdx +0 -178
- package/src/components/Forms/File/File.mdx +0 -88
- package/src/components/Forms/FormTooltip.mdx +0 -51
- package/src/components/Forms/Forms.mdx +0 -48
- package/src/components/Forms/Group/Group.mdx +0 -146
- package/src/components/Forms/Hint/Hint.mdx +0 -40
- package/src/components/Forms/InputStepper/InputStepper.mdx +0 -147
- package/src/components/Forms/Label/Label.mdx +0 -95
- package/src/components/Forms/Message/Message.mdx +0 -40
- package/src/components/Forms/Radio/Radio.mdx +0 -98
- package/src/components/Forms/RangeSlider/RangeSlider.mdx +0 -304
- package/src/components/Forms/Select/Select.mdx +0 -106
- package/src/components/Forms/TextArea/TextArea.mdx +0 -109
- package/src/components/Forms/TextInput/TextInput.mdx +0 -153
- package/src/components/Gauge/Gauge.mdx +0 -35
- package/src/components/Grid/Grid.mdx +0 -320
- package/src/components/Hero/Hero.mdx +0 -168
- package/src/components/Hero/HeroPlayground.tsx +0 -369
- package/src/components/Hero/tests/Hero.unit.test.js +0 -272
- package/src/components/Icon/Icon.mdx +0 -172
- package/src/components/IconList/IconList.mdx +0 -53
- package/src/components/IconList/tests/IconList.unit.test.js +0 -79
- package/src/components/Image/Image.mdx +0 -175
- package/src/components/Link/Link.mdx +0 -238
- package/src/components/List/List.mdx +0 -216
- package/src/components/List/tests/ListItem.unit.test.js +0 -104
- package/src/components/Loader/Loader.mdx +0 -148
- package/src/components/Modal/Modal.mdx +0 -565
- package/src/components/Modal/ModalProductBody.tsx +0 -52
- package/src/components/Pagination/Pagination.mdx +0 -45
- package/src/components/Pagination/tests/Item.unit.test.js +0 -96
- package/src/components/Pagination/tests/Pagination.unit.test.js +0 -108
- package/src/components/Pagination/tests/Separator.unit.test.js +0 -25
- package/src/components/Pagination/tests/utils.js +0 -12
- package/src/components/Pill/Pill.mdx +0 -41
- package/src/components/Pill/tests/Pill.unit.test.js +0 -108
- package/src/components/Progress/Progress.mdx +0 -119
- package/src/components/Progress/tests/Progress.unit.test.js +0 -108
- package/src/components/PromotionCard/PromotionCard.mdx +0 -191
- package/src/components/Section/Section.mdx +0 -397
- package/src/components/Skeleton/Skeleton.mdx +0 -90
- package/src/components/SkipLink/SkipLink.mdx +0 -23
- package/src/components/Stepbar/Stepbar.mdx +0 -137
- package/src/components/Sticker/Sticker.mdx +0 -50
- package/src/components/Sticker/tests/Sticker.conformance.test.js +0 -17
- package/src/components/Sticker/tests/Sticker.unit.test.js +0 -42
- package/src/components/Table/Table.mdx +0 -199
- package/src/components/Tabs/Tabs.mdx +0 -373
- package/src/components/Tag/Tag.mdx +0 -52
- package/src/components/Testimonial/Testimonial.mdx +0 -41
- package/src/components/Testimonial/tests/Testimonial.conformance.test.js +0 -17
- package/src/components/Testimonial/tests/Testimonial.unit.test.js +0 -44
- package/src/components/Tile/CHANGELOG.md +0 -14
- package/src/components/Tile/Tile.mdx +0 -163
- package/src/components/Tile/styles/config.scss +0 -18
- package/src/components/Tile/tests/Tile.unit.test.js +0 -126
- package/src/components/Tooltip/Tooltip.mdx +0 -227
- package/src/styles/after-components.scss +0 -2
- package/src/styles/before-components.scss +0 -18
- /package/build/lib/{after-components.js → base.js} +0 -0
- /package/build/lib/{before-components.js → utilities.js} +0 -0
- /package/src/components/Bar/tests/{Bar.unit.test.js → Bar.unit.test.jsx} +0 -0
- /package/src/components/Bar/tests/{BarBreak.unit.test.js → BarBreak.unit.test.jsx} +0 -0
- /package/src/components/Bar/tests/{BarItem.unit.test.js → BarItem.unit.test.jsx} +0 -0
- /package/src/components/BlockAction/tests/{BlockAction.unit.test.js → BlockAction.unit.test.jsx} +0 -0
- /package/src/components/BlockAction/tests/{BlockActionIndicator.unit.test.js → BlockActionIndicator.unit.test.jsx} +0 -0
- /package/src/components/BlockAction/tests/{CloneElementWithClassName.unit.test.js → CloneElementWithClassName.unit.test.jsx} +0 -0
- /package/src/components/Buttons/tests/{Buttons.unit.test.js → Buttons.unit.test.jsx} +0 -0
- /package/src/components/Carousel/tests/{CarouselItem.unit.test.js → CarouselItem.unit.test.jsx} +0 -0
- /package/src/components/CarouselPromotions/tests/{CarouselPromotionsItem.unit.test.js → CarouselPromotionsItem.unit.test.jsx} +0 -0
- /package/src/components/Forms/Checkbox/tests/{Checkbox.unit.test.js → Checkbox.unit.test.jsx} +0 -0
- /package/src/components/Forms/DatePicker/tests/{DatePicker.unit.test.js → DatePicker.unit.test.jsx} +0 -0
- /package/src/components/Forms/Field/tests/{Field.unit.test.js → Field.unit.test.jsx} +0 -0
- /package/src/components/Forms/Field/tests/{Label.unit.test.js → Label.unit.test.jsx} +0 -0
- /package/src/components/Forms/Field/tests/{Messages.unit.test.js → Messages.unit.test.jsx} +0 -0
- /package/src/components/Forms/Fieldset/tests/{Fieldset.unit.test.js → Fieldset.unit.test.jsx} +0 -0
- /package/src/components/Forms/Group/tests/{Item.unit.test.js → Item.unit.test.jsx} +0 -0
- /package/src/components/Forms/Hint/tests/{Hint.unit.test.js → Hint.unit.test.jsx} +0 -0
- /package/src/components/Forms/Label/tests/{Label.unit.test.js → Label.unit.test.jsx} +0 -0
- /package/src/components/Forms/Message/tests/{Message.unit.test.js → Message.unit.test.jsx} +0 -0
- /package/src/components/Forms/Radio/tests/{Radio.unit.test.js → Radio.unit.test.jsx} +0 -0
- /package/src/components/Forms/Select/tests/{Select.unit.test.js → Select.unit.test.jsx} +0 -0
- /package/src/components/Forms/TextArea/tests/{TextArea.unit.test.js → TextArea.unit.test.jsx} +0 -0
- /package/src/components/Forms/TextInput/tests/{TextInput.unit.test.js → TextInput.unit.test.jsx} +0 -0
- /package/src/components/Gauge/tests/{Gauge.conformance.test.js → Gauge.conformance.test.jsx} +0 -0
- /package/src/components/List/tests/{List.unit.test.js → List.unit.test.jsx} +0 -0
- /package/src/components/Loader/tests/{Loader.unit.test.js → Loader.unit.test.jsx} +0 -0
- /package/src/components/Modal/tests/{ModalCloseButton.unit.test.js → ModalCloseButton.unit.test.jsx} +0 -0
- /package/src/components/Skeleton/tests/{Skeleton.unit.test.js → Skeleton.unit.test.jsx} +0 -0
- /package/src/components/Stepbar/tests/{Stepbar.unit.test.js → Stepbar.unit.test.jsx} +0 -0
- /package/src/components/Table/tests/{Cell.unit.test.js → Cell.unit.test.jsx} +0 -0
- /package/src/components/Tabs/tests/{Tab.unit.test.js → Tab.unit.test.jsx} +0 -0
- /package/src/components/Tabs/tests/{TabPanel.unit.test.js → TabPanel.unit.test.jsx} +0 -0
- /package/src/components/Tooltip/tests/{InfoTooltip.unit.test.js → InfoTooltip.unit.test.jsx} +0 -0
|
@@ -1,34 +1,41 @@
|
|
|
1
1
|
import { Swiper } from "swiper";
|
|
2
|
-
import type { SwiperOptions } from "swiper/types";
|
|
3
2
|
import {
|
|
3
|
+
A11y,
|
|
4
|
+
Keyboard,
|
|
5
|
+
Mousewheel,
|
|
4
6
|
Navigation,
|
|
5
7
|
Pagination,
|
|
6
8
|
Scrollbar,
|
|
7
|
-
A11y,
|
|
8
|
-
Keyboard,
|
|
9
9
|
} from "swiper/modules";
|
|
10
|
+
import type { SwiperOptions } from "swiper/types";
|
|
10
11
|
|
|
11
12
|
import Tooltip from "../Tooltip/Tooltip.static";
|
|
12
13
|
|
|
13
14
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
SELECTOR_VIEWPORT,
|
|
18
|
-
SELECTOR_TRACK,
|
|
15
|
+
CLASS_ACTIVE,
|
|
16
|
+
CLASS_BLEED_RIGHT,
|
|
17
|
+
CLASS_DOT,
|
|
19
18
|
CLASS_SCROLLBAR_DRAG,
|
|
20
|
-
SELECTOR_SCROLLBAR,
|
|
21
19
|
CLASS_SCROLLBAR_HORIZONTAL,
|
|
22
|
-
CLASS_TRACK,
|
|
23
20
|
CLASS_SLIDE,
|
|
24
|
-
CLASS_DOT,
|
|
25
|
-
CLASS_ACTIVE,
|
|
26
|
-
SELECTOR_ACTIVE,
|
|
27
21
|
CLASS_SLIDE_NEXT,
|
|
28
22
|
CLASS_SLIDE_PREV,
|
|
29
|
-
|
|
23
|
+
CLASS_TRACK,
|
|
24
|
+
CLASS_VIEWPORT_WRAPPER,
|
|
25
|
+
SELECTOR_ACTIVE,
|
|
26
|
+
SELECTOR_DOTS,
|
|
27
|
+
SELECTOR_NEXT,
|
|
28
|
+
SELECTOR_PREV,
|
|
29
|
+
SELECTOR_SCROLLBAR,
|
|
30
|
+
SELECTOR_TRACK,
|
|
31
|
+
SELECTOR_VIEWPORT,
|
|
30
32
|
} from "./constants";
|
|
31
33
|
|
|
34
|
+
interface ExternalControlsState {
|
|
35
|
+
isAtStart: boolean;
|
|
36
|
+
isAtEnd: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
32
39
|
export const defaultConfig: SwiperOptions = {
|
|
33
40
|
navigation: {
|
|
34
41
|
nextEl: SELECTOR_NEXT,
|
|
@@ -49,10 +56,17 @@ export const defaultConfig: SwiperOptions = {
|
|
|
49
56
|
enabled: true,
|
|
50
57
|
horizontalClass: CLASS_SCROLLBAR_HORIZONTAL,
|
|
51
58
|
dragClass: CLASS_SCROLLBAR_DRAG,
|
|
59
|
+
hide: false,
|
|
52
60
|
},
|
|
53
61
|
slidesPerView: 1.2,
|
|
62
|
+
spaceBetween: 20,
|
|
63
|
+
mousewheel: {
|
|
64
|
+
forceToAxis: true,
|
|
65
|
+
sensitivity: 1,
|
|
66
|
+
},
|
|
54
67
|
a11y: {
|
|
55
68
|
enabled: true,
|
|
69
|
+
scrollOnFocus: false,
|
|
56
70
|
prevSlideMessage: "Predchádzajúci snímok",
|
|
57
71
|
nextSlideMessage: "Nasledujúci snímok",
|
|
58
72
|
paginationBulletMessage: "Prejsť na snímok {index}",
|
|
@@ -84,6 +98,83 @@ export default class Carousel {
|
|
|
84
98
|
viewport!: HTMLElement;
|
|
85
99
|
track!: HTMLElement;
|
|
86
100
|
instance!: Swiper;
|
|
101
|
+
carouselId?: string;
|
|
102
|
+
private isScrollbarDragging = false;
|
|
103
|
+
private externalControlsState: ExternalControlsState | null = null;
|
|
104
|
+
private resizeObserver?: ResizeObserver;
|
|
105
|
+
private resizeRafId?: number;
|
|
106
|
+
private boundWindowResizeHandler: () => void;
|
|
107
|
+
private bleedResizeHandler?: () => void;
|
|
108
|
+
private static readonly OVERFLOW_EPSILON_PX = 1;
|
|
109
|
+
|
|
110
|
+
private getViewportWrapper(): HTMLElement | null {
|
|
111
|
+
return this.element.querySelector(
|
|
112
|
+
`.${CLASS_VIEWPORT_WRAPPER}`,
|
|
113
|
+
) as HTMLElement | null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private getSlidesPerView(): number {
|
|
117
|
+
return Number(this.instance?.params?.slidesPerView) || 1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
private setScrollbarVisible(visible: boolean): void {
|
|
121
|
+
const scrollbarEl = this.element.querySelector(
|
|
122
|
+
SELECTOR_SCROLLBAR,
|
|
123
|
+
) as HTMLElement | null;
|
|
124
|
+
if (scrollbarEl) {
|
|
125
|
+
scrollbarEl.style.display = visible ? "" : "none";
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
private getSlidesContentWidth(): number {
|
|
130
|
+
if (!this.instance) {
|
|
131
|
+
return this.track?.scrollWidth || 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const slides = Array.from(this.instance.slides) as HTMLElement[];
|
|
135
|
+
const widthsSum = slides.reduce((sum, slide) => sum + slide.offsetWidth, 0);
|
|
136
|
+
const spaceBetween = Number(this.instance.params?.spaceBetween) || 0;
|
|
137
|
+
const gaps = Math.max(slides.length - 1, 0) * spaceBetween;
|
|
138
|
+
const measuredWidth = widthsSum + gaps;
|
|
139
|
+
|
|
140
|
+
// Fallback for early lifecycle/test DOM where slides can report 0 width.
|
|
141
|
+
if (widthsSum <= 0 || measuredWidth <= 0) {
|
|
142
|
+
return this.track?.scrollWidth || 0;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return measuredWidth;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
private getOverflowWidth(viewportWrapper?: HTMLElement): number {
|
|
149
|
+
const isBleedRight = this.element.classList.contains(CLASS_BLEED_RIGHT);
|
|
150
|
+
const containerWidth = isBleedRight
|
|
151
|
+
? this.element.clientWidth || viewportWrapper?.clientWidth || 0
|
|
152
|
+
: this.viewport?.clientWidth || 0;
|
|
153
|
+
|
|
154
|
+
if (containerWidth <= 0) {
|
|
155
|
+
return 0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const contentWidth = this.getSlidesContentWidth();
|
|
159
|
+
|
|
160
|
+
return contentWidth - containerWidth;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
private hasScrollableContent(viewportWrapper?: HTMLElement): boolean {
|
|
164
|
+
if (!this.instance || !this.instance.params) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const overflowWidth = this.getOverflowWidth(viewportWrapper);
|
|
169
|
+
if (overflowWidth !== 0) {
|
|
170
|
+
return overflowWidth > Carousel.OVERFLOW_EPSILON_PX;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Fallback for hidden/zero-width initialization.
|
|
174
|
+
const slidesCount = this.instance.slides.length;
|
|
175
|
+
const slidesPerView = this.getSlidesPerView();
|
|
176
|
+
return slidesCount > slidesPerView;
|
|
177
|
+
}
|
|
87
178
|
|
|
88
179
|
constructor(element: HTMLElement, config?: Partial<SwiperOptions>) {
|
|
89
180
|
this.element = element;
|
|
@@ -101,10 +192,10 @@ export default class Carousel {
|
|
|
101
192
|
|
|
102
193
|
this.handleSlideChange = this.handleSlideChange.bind(this);
|
|
103
194
|
this.updateTooltipPosition = this.updateTooltipPosition.bind(this);
|
|
195
|
+
this.boundWindowResizeHandler = this.handleWindowResize.bind(this);
|
|
104
196
|
|
|
105
197
|
(this.element as any).ODS_Carousel = this;
|
|
106
198
|
|
|
107
|
-
// Defer initialization to ensure DOM is ready
|
|
108
199
|
requestAnimationFrame(() => {
|
|
109
200
|
this.init();
|
|
110
201
|
});
|
|
@@ -118,25 +209,190 @@ export default class Carousel {
|
|
|
118
209
|
this.getCustomOptions();
|
|
119
210
|
}
|
|
120
211
|
|
|
212
|
+
const isBleedRight = this.element.classList.contains(CLASS_BLEED_RIGHT);
|
|
213
|
+
|
|
121
214
|
this.instance = new Swiper(this.viewport, {
|
|
122
215
|
...this.config,
|
|
123
|
-
|
|
216
|
+
// Swiper watchOverflow can mis-detect with slides offsets; manage bleed-right overflow ourselves.
|
|
217
|
+
watchOverflow: isBleedRight ? false : this.config.watchOverflow,
|
|
218
|
+
enabled: false,
|
|
219
|
+
modules: [Navigation, Pagination, Scrollbar, A11y, Keyboard, Mousewheel],
|
|
124
220
|
on: {
|
|
125
221
|
slideChange: this.handleSlideChange,
|
|
222
|
+
slideChangeTransitionEnd: () => {
|
|
223
|
+
this.updateExternalControlsState();
|
|
224
|
+
},
|
|
225
|
+
scrollbarDragStart: () => {
|
|
226
|
+
this.isScrollbarDragging = true;
|
|
227
|
+
},
|
|
228
|
+
scrollbarDragEnd: () => {
|
|
229
|
+
this.isScrollbarDragging = false;
|
|
230
|
+
this.updateExternalControlsState(true);
|
|
231
|
+
},
|
|
126
232
|
},
|
|
127
233
|
});
|
|
128
234
|
|
|
129
|
-
|
|
235
|
+
this.updateCarouselEnabledState();
|
|
236
|
+
|
|
130
237
|
if (this.element.classList.contains(CLASS_BLEED_RIGHT)) {
|
|
131
238
|
this.adjustConfigForBleedRight();
|
|
239
|
+
this.fixBleedRightScrollbar();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Sync scrollbar position after initialization (important for initialSlide config)
|
|
243
|
+
this.syncScrollbar();
|
|
244
|
+
|
|
245
|
+
if (this.instance && typeof this.instance.on === "function") {
|
|
246
|
+
this.instance.on("resize", () => {
|
|
247
|
+
this.updateCarouselEnabledState();
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
this.observeVisibilityChanges();
|
|
252
|
+
window.addEventListener("resize", this.boundWindowResizeHandler);
|
|
253
|
+
|
|
254
|
+
this.initExternalControls();
|
|
255
|
+
|
|
256
|
+
// Trigger a final update to notify listeners (like SameHeight) that carousel is ready
|
|
257
|
+
requestAnimationFrame(() => {
|
|
258
|
+
if (this.instance) {
|
|
259
|
+
this.instance.update();
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
private handleWindowResize(): void {
|
|
265
|
+
if (this.resizeRafId) {
|
|
266
|
+
cancelAnimationFrame(this.resizeRafId);
|
|
132
267
|
}
|
|
268
|
+
|
|
269
|
+
this.resizeRafId = requestAnimationFrame(() => {
|
|
270
|
+
this.resizeRafId = undefined;
|
|
271
|
+
|
|
272
|
+
if (!this.instance || !this.viewport) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (this.viewport.clientWidth <= 0) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
this.instance.update();
|
|
281
|
+
this.updateCarouselEnabledState();
|
|
282
|
+
this.bleedResizeHandler?.();
|
|
283
|
+
this.updateExternalControlsState();
|
|
284
|
+
this.instance.scrollbar?.updateSize();
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Sync scrollbar position with current slide.
|
|
290
|
+
* This ensures the scrollbar reflects the correct position when carousel is initialized with initialSlide.
|
|
291
|
+
*/
|
|
292
|
+
syncScrollbar() {
|
|
293
|
+
requestAnimationFrame(() => {
|
|
294
|
+
if (this.instance?.scrollbar) {
|
|
295
|
+
this.instance.scrollbar.updateSize();
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
private observeVisibilityChanges(): void {
|
|
301
|
+
if (typeof ResizeObserver === "undefined") {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
this.resizeObserver?.disconnect();
|
|
306
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
307
|
+
if (!this.instance || !this.viewport) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (this.viewport.clientWidth <= 0) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
this.instance.update();
|
|
316
|
+
this.updateCarouselEnabledState();
|
|
317
|
+
this.instance.scrollbar?.updateSize();
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
this.resizeObserver.observe(this.viewport);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Fix scrollbar drag size and position for bleed-right carousels.
|
|
325
|
+
* Overrides Swiper's default scrollbar calculations to work correctly with bleed-right layouts.
|
|
326
|
+
*/
|
|
327
|
+
fixBleedRightScrollbar() {
|
|
328
|
+
const updateScrollbar = () => {
|
|
329
|
+
const viewportWrapper = this.getViewportWrapper();
|
|
330
|
+
const scrollbar = this.instance?.scrollbar;
|
|
331
|
+
const swiper = this.instance;
|
|
332
|
+
|
|
333
|
+
if (!viewportWrapper || !scrollbar || !scrollbar.dragEl || !swiper) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const hasScrollableContent = this.hasScrollableContent(viewportWrapper);
|
|
338
|
+
|
|
339
|
+
if (!hasScrollableContent) {
|
|
340
|
+
this.setScrollbarVisible(false);
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
this.setScrollbarVisible(true);
|
|
345
|
+
|
|
346
|
+
const scrollbarWidth = scrollbar.el.offsetWidth;
|
|
347
|
+
const viewportWidth =
|
|
348
|
+
this.instance?.width ||
|
|
349
|
+
this.element.clientWidth ||
|
|
350
|
+
viewportWrapper.clientWidth;
|
|
351
|
+
const contentWidth = this.getSlidesContentWidth();
|
|
352
|
+
const minTranslate =
|
|
353
|
+
typeof swiper.minTranslate === "function" ? swiper.minTranslate() : 0;
|
|
354
|
+
const maxTranslate =
|
|
355
|
+
typeof swiper.maxTranslate === "function" ? swiper.maxTranslate() : 0;
|
|
356
|
+
const translateRange = Math.max(Math.abs(maxTranslate - minTranslate), 0);
|
|
357
|
+
const normalizedContentWidth = Math.max(
|
|
358
|
+
contentWidth,
|
|
359
|
+
viewportWidth + translateRange,
|
|
360
|
+
);
|
|
361
|
+
|
|
362
|
+
const visibleRatio =
|
|
363
|
+
normalizedContentWidth > 0
|
|
364
|
+
? Math.min(viewportWidth / normalizedContentWidth, 1)
|
|
365
|
+
: 1;
|
|
366
|
+
const dragSize = visibleRatio * scrollbarWidth;
|
|
367
|
+
const finalDragSize = Math.max(dragSize, 30);
|
|
368
|
+
|
|
369
|
+
scrollbar.dragEl.style.width = `${finalDragSize}px`;
|
|
370
|
+
scrollbar.dragEl.style.display = "";
|
|
371
|
+
|
|
372
|
+
const scrollRatio = Math.min(Math.max(swiper.progress || 0, 0), 1);
|
|
373
|
+
const maxDragTranslate = Math.max(scrollbarWidth - finalDragSize, 0);
|
|
374
|
+
const dragTranslateX = scrollRatio * maxDragTranslate;
|
|
375
|
+
|
|
376
|
+
scrollbar.dragEl.style.transform = `translate3d(${dragTranslateX}px, 0, 0)`;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
// Initial update (double requestAnimationFrame ensures DOM is fully ready)
|
|
380
|
+
requestAnimationFrame(() => {
|
|
381
|
+
requestAnimationFrame(updateScrollbar);
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
// Keep scrollbar in sync with carousel state changes
|
|
385
|
+
this.instance.on("progress", updateScrollbar);
|
|
386
|
+
this.instance.on("slideChange", updateScrollbar);
|
|
387
|
+
this.instance.on("resize", updateScrollbar);
|
|
388
|
+
this.instance.on("update", updateScrollbar);
|
|
389
|
+
this.instance.on("setTranslate", updateScrollbar);
|
|
133
390
|
}
|
|
134
391
|
|
|
135
392
|
getElements() {
|
|
136
393
|
this.viewport = this.element.querySelector(SELECTOR_VIEWPORT)!;
|
|
137
394
|
this.track = this.viewport.querySelector(SELECTOR_TRACK)!;
|
|
138
395
|
|
|
139
|
-
// Ensure pagination container has proper role
|
|
140
396
|
const paginationEl = this.element.querySelector(
|
|
141
397
|
SELECTOR_DOTS,
|
|
142
398
|
) as HTMLElement | null;
|
|
@@ -178,70 +434,143 @@ export default class Carousel {
|
|
|
178
434
|
};
|
|
179
435
|
}
|
|
180
436
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
437
|
+
/**
|
|
438
|
+
* Enable or disable the carousel based on whether content requires scrolling.
|
|
439
|
+
* Carousel is enabled only when there are more slides than can fit in the current viewport.
|
|
440
|
+
*/
|
|
441
|
+
private updateCarouselEnabledState(): void {
|
|
442
|
+
if (!this.instance || !this.instance.params) return;
|
|
184
443
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if (!container || !this.instance) return;
|
|
190
|
-
|
|
191
|
-
// Calculate the actual bleed amount with limits to match CSS
|
|
192
|
-
const containerWidth = container.offsetWidth;
|
|
193
|
-
const halfViewportWidth = window.innerWidth / 2;
|
|
194
|
-
const halfContainerWidth = containerWidth / 2;
|
|
195
|
-
let bleedAmount = halfViewportWidth - halfContainerWidth;
|
|
196
|
-
|
|
197
|
-
// On very large screens (above 2K), stop the bleeding effect entirely
|
|
198
|
-
if (window.innerWidth >= 2560) {
|
|
199
|
-
bleedAmount = 0;
|
|
200
|
-
}
|
|
444
|
+
const viewportWrapper = this.getViewportWrapper();
|
|
445
|
+
const hasScrollableContent = this.hasScrollableContent(
|
|
446
|
+
viewportWrapper || undefined,
|
|
447
|
+
);
|
|
201
448
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
} else {
|
|
208
|
-
// Remove offset if no bleeding should occur
|
|
209
|
-
this.instance.params.slidesOffsetAfter = 0;
|
|
210
|
-
this.instance.update();
|
|
211
|
-
}
|
|
449
|
+
if (hasScrollableContent) {
|
|
450
|
+
this.instance.enable();
|
|
451
|
+
} else {
|
|
452
|
+
this.instance.disable();
|
|
453
|
+
}
|
|
212
454
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
if (this.instance && container) {
|
|
216
|
-
const newContainerWidth = container.offsetWidth;
|
|
217
|
-
const newHalfViewportWidth = window.innerWidth / 2;
|
|
218
|
-
const newHalfContainerWidth = newContainerWidth / 2;
|
|
219
|
-
let newBleedAmount = newHalfViewportWidth - newHalfContainerWidth;
|
|
220
|
-
|
|
221
|
-
// Apply same limits as above
|
|
222
|
-
if (window.innerWidth >= 2560) {
|
|
223
|
-
newBleedAmount = 0;
|
|
224
|
-
}
|
|
455
|
+
this.setScrollbarVisible(this.instance.enabled);
|
|
456
|
+
}
|
|
225
457
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
458
|
+
private applyBleedInsets(viewportWrapper: HTMLElement): void {
|
|
459
|
+
if (!this.instance || !this.instance.params) {
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
const containerWidth =
|
|
464
|
+
this.element.clientWidth || viewportWrapper.clientWidth || 0;
|
|
465
|
+
const viewportWidth =
|
|
466
|
+
document.documentElement?.clientWidth || window.innerWidth || 0;
|
|
467
|
+
const wrapperRect = viewportWrapper.getBoundingClientRect();
|
|
468
|
+
const rootRect = this.element.getBoundingClientRect();
|
|
469
|
+
const stableLeftInsetSource =
|
|
470
|
+
rootRect.left > 0 ? rootRect.left : wrapperRect.left;
|
|
471
|
+
const leftInset = Math.max(Math.floor(stableLeftInsetSource), 0);
|
|
472
|
+
const shellWidth = Math.max(Math.floor(viewportWidth), containerWidth, 0);
|
|
473
|
+
const shellMarginLeft = -leftInset;
|
|
474
|
+
const bleedViewportWidth = Math.max(
|
|
475
|
+
shellWidth - leftInset,
|
|
476
|
+
containerWidth,
|
|
477
|
+
0,
|
|
478
|
+
);
|
|
479
|
+
|
|
480
|
+
const projectedContentWidth = this.getSlidesContentWidth();
|
|
481
|
+
const projectedOverflowWidth = projectedContentWidth - containerWidth;
|
|
482
|
+
const slidesPerView = this.getSlidesPerView();
|
|
483
|
+
const slidesCount = this.instance.slides.length;
|
|
484
|
+
const hasIntrinsicOverflow =
|
|
485
|
+
projectedContentWidth > 0
|
|
486
|
+
? projectedOverflowWidth > Carousel.OVERFLOW_EPSILON_PX
|
|
487
|
+
: slidesCount > slidesPerView;
|
|
488
|
+
const shouldDisableBleed = !hasIntrinsicOverflow;
|
|
489
|
+
const shouldEnableBleedClass = !shouldDisableBleed;
|
|
490
|
+
const hadBleedClass = this.element.classList.contains(CLASS_BLEED_RIGHT);
|
|
491
|
+
const nextBleedViewportWidth = shouldDisableBleed
|
|
492
|
+
? "100%"
|
|
493
|
+
: `${bleedViewportWidth}px`;
|
|
494
|
+
const nextBleedMarginLeft = shouldDisableBleed ? "0px" : `${leftInset}px`;
|
|
495
|
+
const nextBleedShellWidth = shouldDisableBleed ? "100%" : `${shellWidth}px`;
|
|
496
|
+
const nextBleedShellMarginLeft = shouldDisableBleed
|
|
497
|
+
? "0px"
|
|
498
|
+
: `${shellMarginLeft}px`;
|
|
499
|
+
const geometryChanged =
|
|
500
|
+
hadBleedClass !== shouldEnableBleedClass ||
|
|
501
|
+
this.instance.params.width !==
|
|
502
|
+
(shouldDisableBleed ? undefined : containerWidth) ||
|
|
503
|
+
this.element.style.getPropertyValue("--carousel-bleed-viewport-width") !==
|
|
504
|
+
nextBleedViewportWidth ||
|
|
505
|
+
this.element.style.getPropertyValue("--carousel-bleed-margin-left") !==
|
|
506
|
+
nextBleedMarginLeft ||
|
|
507
|
+
this.element.style.getPropertyValue("--carousel-bleed-shell-width") !==
|
|
508
|
+
nextBleedShellWidth ||
|
|
509
|
+
this.element.style.getPropertyValue(
|
|
510
|
+
"--carousel-bleed-shell-margin-left",
|
|
511
|
+
) !== nextBleedShellMarginLeft;
|
|
512
|
+
|
|
513
|
+
this.element.classList.toggle(CLASS_BLEED_RIGHT, shouldEnableBleedClass);
|
|
514
|
+
|
|
515
|
+
const baseWidth = shouldDisableBleed ? undefined : containerWidth;
|
|
516
|
+
this.instance.params.width = baseWidth;
|
|
517
|
+
if (this.instance.originalParams) {
|
|
518
|
+
this.instance.originalParams.width = baseWidth;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
this.instance.params.slidesOffsetBefore = 0;
|
|
522
|
+
this.instance.params.slidesOffsetAfter = 0;
|
|
523
|
+
this.element.style.setProperty(
|
|
524
|
+
"--carousel-bleed-viewport-width",
|
|
525
|
+
nextBleedViewportWidth,
|
|
526
|
+
);
|
|
527
|
+
this.element.style.setProperty(
|
|
528
|
+
"--carousel-bleed-margin-left",
|
|
529
|
+
nextBleedMarginLeft,
|
|
530
|
+
);
|
|
531
|
+
this.element.style.setProperty(
|
|
532
|
+
"--carousel-bleed-shell-width",
|
|
533
|
+
nextBleedShellWidth,
|
|
534
|
+
);
|
|
535
|
+
this.element.style.setProperty(
|
|
536
|
+
"--carousel-bleed-shell-margin-left",
|
|
537
|
+
nextBleedShellMarginLeft,
|
|
538
|
+
);
|
|
539
|
+
|
|
540
|
+
if (geometryChanged) {
|
|
541
|
+
this.instance.update();
|
|
542
|
+
}
|
|
543
|
+
this.updateCarouselEnabledState();
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* Configure bleed-right carousel to extend beyond the container edge.
|
|
548
|
+
* Calculates the exact offset needed for the carousel to reach the viewport edge
|
|
549
|
+
* while keeping the last slide aligned with the container edge when scrolled to the end.
|
|
550
|
+
* When slidesPerView is a whole number (integer), the bleed effect is disabled.
|
|
551
|
+
*/
|
|
552
|
+
adjustConfigForBleedRight() {
|
|
553
|
+
requestAnimationFrame(() => {
|
|
554
|
+
if (!this.instance) return;
|
|
555
|
+
|
|
556
|
+
const viewportWrapper = this.getViewportWrapper();
|
|
557
|
+
if (!viewportWrapper) return;
|
|
558
|
+
|
|
559
|
+
const updateBleedState = () => {
|
|
560
|
+
this.applyBleedInsets(viewportWrapper);
|
|
233
561
|
};
|
|
234
562
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
563
|
+
this.bleedResizeHandler = updateBleedState;
|
|
564
|
+
|
|
565
|
+
updateBleedState();
|
|
566
|
+
|
|
567
|
+
this.instance.on("resize", updateBleedState);
|
|
238
568
|
});
|
|
239
569
|
}
|
|
240
570
|
|
|
241
571
|
/**
|
|
242
|
-
*
|
|
243
|
-
* Updates
|
|
244
|
-
* Also updates accessibility attributes for pagination buttons.
|
|
572
|
+
* Handle carousel slide change events.
|
|
573
|
+
* Updates tooltip positions and accessibility states for the active slide.
|
|
245
574
|
*/
|
|
246
575
|
handleSlideChange() {
|
|
247
576
|
const activeSlide = this.track.querySelector(SELECTOR_ACTIVE);
|
|
@@ -256,11 +585,12 @@ export default class Carousel {
|
|
|
256
585
|
if (nonActiveSlides.length > 0) {
|
|
257
586
|
this.hideAllTooltips(nonActiveSlides);
|
|
258
587
|
}
|
|
588
|
+
|
|
589
|
+
this.updateExternalControlsState();
|
|
259
590
|
}
|
|
260
591
|
|
|
261
592
|
/**
|
|
262
|
-
*
|
|
263
|
-
* @param {HTMLElement} element - The element containing tooltip triggers.
|
|
593
|
+
* Update tooltip positions for elements within a slide.
|
|
264
594
|
*/
|
|
265
595
|
updateTooltipPosition(element: HTMLElement) {
|
|
266
596
|
const tooltipTriggers = element.querySelectorAll(
|
|
@@ -283,8 +613,7 @@ export default class Carousel {
|
|
|
283
613
|
}
|
|
284
614
|
|
|
285
615
|
/**
|
|
286
|
-
*
|
|
287
|
-
* @param {NodeListOf<HTMLElement>} elements - The elements containing tooltip triggers.
|
|
616
|
+
* Hide all tooltips for non-active slides.
|
|
288
617
|
*/
|
|
289
618
|
hideAllTooltips(elements: NodeListOf<Element>) {
|
|
290
619
|
elements.forEach((element) => {
|
|
@@ -309,10 +638,218 @@ export default class Carousel {
|
|
|
309
638
|
});
|
|
310
639
|
}
|
|
311
640
|
|
|
641
|
+
/**
|
|
642
|
+
* Initialize external navigation controls that reference this carousel via data attributes.
|
|
643
|
+
* Supports prev/next buttons placed anywhere in the DOM.
|
|
644
|
+
*/
|
|
645
|
+
initExternalControls() {
|
|
646
|
+
const carouselId = this.element.dataset.carouselId || this.element.id;
|
|
647
|
+
|
|
648
|
+
if (!carouselId) {
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
this.carouselId = carouselId;
|
|
653
|
+
|
|
654
|
+
const controlElements = document.querySelectorAll(
|
|
655
|
+
`[data-carousel-controls="${carouselId}"]`,
|
|
656
|
+
);
|
|
657
|
+
|
|
658
|
+
controlElements.forEach((control) => {
|
|
659
|
+
const htmlControl = control as HTMLElement;
|
|
660
|
+
|
|
661
|
+
if (htmlControl.hasAttribute("data-carousel-initialized")) {
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if ((htmlControl as any)._carouselClickHandler) {
|
|
666
|
+
htmlControl.removeEventListener(
|
|
667
|
+
"click",
|
|
668
|
+
(htmlControl as any)._carouselClickHandler,
|
|
669
|
+
);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
const action = htmlControl.dataset.carouselAction;
|
|
673
|
+
|
|
674
|
+
const clickHandler = (e: Event) => {
|
|
675
|
+
e.preventDefault();
|
|
676
|
+
if (htmlControl.hasAttribute("disabled")) {
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
if (action === "next") {
|
|
680
|
+
this.slideNext();
|
|
681
|
+
} else if (action === "prev") {
|
|
682
|
+
this.slidePrev();
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
|
|
686
|
+
if (action === "next" || action === "prev") {
|
|
687
|
+
htmlControl.addEventListener("click", clickHandler);
|
|
688
|
+
|
|
689
|
+
htmlControl.setAttribute(
|
|
690
|
+
"aria-label",
|
|
691
|
+
action === "next"
|
|
692
|
+
? (typeof this.config.a11y === "object"
|
|
693
|
+
? this.config.a11y?.nextSlideMessage
|
|
694
|
+
: undefined) || "Nasledujúci snímok"
|
|
695
|
+
: (typeof this.config.a11y === "object"
|
|
696
|
+
? this.config.a11y?.prevSlideMessage
|
|
697
|
+
: undefined) || "Predchádzajúci snímok",
|
|
698
|
+
);
|
|
699
|
+
htmlControl.setAttribute("type", "button");
|
|
700
|
+
|
|
701
|
+
(htmlControl as any)._carouselClickHandler = clickHandler;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
htmlControl.setAttribute("data-carousel-initialized", "true");
|
|
705
|
+
});
|
|
706
|
+
|
|
707
|
+
this.updateExternalControlsState();
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Update the disabled state of external navigation controls.
|
|
712
|
+
* Controls are disabled at the start/end of the carousel based on slide position.
|
|
713
|
+
*/
|
|
714
|
+
updateExternalControlsState(force = false) {
|
|
715
|
+
if (!this.carouselId || !this.instance) {
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
if (!this.instance.params) {
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
if (this.isScrollbarDragging && !force) {
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
const isDisabled = !this.instance.enabled;
|
|
728
|
+
const isAtStart = isDisabled || this.instance.isBeginning;
|
|
729
|
+
const isAtEnd = isDisabled || this.instance.isEnd;
|
|
730
|
+
|
|
731
|
+
this.externalControlsState = { isAtStart, isAtEnd };
|
|
732
|
+
|
|
733
|
+
this.applyExternalControlsState(this.externalControlsState);
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
private applyExternalControlsState(state: ExternalControlsState) {
|
|
737
|
+
const { isAtStart, isAtEnd } = state;
|
|
738
|
+
|
|
739
|
+
const prevControls = document.querySelectorAll(
|
|
740
|
+
`[data-carousel-controls="${this.carouselId}"][data-carousel-action="prev"]`,
|
|
741
|
+
);
|
|
742
|
+
|
|
743
|
+
const nextControls = document.querySelectorAll(
|
|
744
|
+
`[data-carousel-controls="${this.carouselId}"][data-carousel-action="next"]`,
|
|
745
|
+
);
|
|
746
|
+
|
|
747
|
+
prevControls.forEach((control) => {
|
|
748
|
+
const htmlControl = control as HTMLElement;
|
|
749
|
+
if (isAtStart) {
|
|
750
|
+
htmlControl.setAttribute("disabled", "true");
|
|
751
|
+
htmlControl.setAttribute("aria-disabled", "true");
|
|
752
|
+
htmlControl.style.cursor = "not-allowed";
|
|
753
|
+
} else {
|
|
754
|
+
htmlControl.removeAttribute("disabled");
|
|
755
|
+
htmlControl.setAttribute("aria-disabled", "false");
|
|
756
|
+
htmlControl.style.cursor = "pointer";
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
|
|
760
|
+
nextControls.forEach((control) => {
|
|
761
|
+
const htmlControl = control as HTMLElement;
|
|
762
|
+
if (isAtEnd) {
|
|
763
|
+
htmlControl.setAttribute("disabled", "true");
|
|
764
|
+
htmlControl.setAttribute("aria-disabled", "true");
|
|
765
|
+
htmlControl.style.cursor = "not-allowed";
|
|
766
|
+
} else {
|
|
767
|
+
htmlControl.removeAttribute("disabled");
|
|
768
|
+
htmlControl.setAttribute("aria-disabled", "false");
|
|
769
|
+
htmlControl.style.cursor = "pointer";
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Navigate to the next slide.
|
|
776
|
+
*/
|
|
777
|
+
slideNext() {
|
|
778
|
+
if (this.instance) {
|
|
779
|
+
this.instance.slideNext();
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* Navigate to the previous slide.
|
|
785
|
+
*/
|
|
786
|
+
slidePrev() {
|
|
787
|
+
if (this.instance) {
|
|
788
|
+
this.instance.slidePrev();
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* Get the current active slide index.
|
|
794
|
+
*/
|
|
795
|
+
getActiveIndex(): number {
|
|
796
|
+
return this.instance ? this.instance.activeIndex : 0;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Register a callback for slide change events.
|
|
801
|
+
*/
|
|
802
|
+
onSlideChange(callback: (activeIndex: number) => void) {
|
|
803
|
+
if (this.instance) {
|
|
804
|
+
this.instance.on("slideChange", () => {
|
|
805
|
+
callback(this.instance.activeIndex);
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
|
|
312
810
|
destroy() {
|
|
811
|
+
// Clean up external controls
|
|
812
|
+
if (this.carouselId) {
|
|
813
|
+
const controlElements = document.querySelectorAll(
|
|
814
|
+
`[data-carousel-controls="${this.carouselId}"]`,
|
|
815
|
+
);
|
|
816
|
+
controlElements.forEach((control) => {
|
|
817
|
+
const htmlControl = control as HTMLElement;
|
|
818
|
+
if ((htmlControl as any)._carouselClickHandler) {
|
|
819
|
+
htmlControl.removeEventListener(
|
|
820
|
+
"click",
|
|
821
|
+
(htmlControl as any)._carouselClickHandler,
|
|
822
|
+
);
|
|
823
|
+
delete (htmlControl as any)._carouselClickHandler;
|
|
824
|
+
}
|
|
825
|
+
htmlControl.removeAttribute("data-carousel-initialized");
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
window.removeEventListener("resize", this.boundWindowResizeHandler);
|
|
830
|
+
|
|
831
|
+
if (this.resizeRafId) {
|
|
832
|
+
cancelAnimationFrame(this.resizeRafId);
|
|
833
|
+
this.resizeRafId = undefined;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
if (this.instance && this.bleedResizeHandler) {
|
|
837
|
+
this.instance.off("resize", this.bleedResizeHandler);
|
|
838
|
+
this.bleedResizeHandler = undefined;
|
|
839
|
+
}
|
|
840
|
+
|
|
313
841
|
if (this.instance) {
|
|
314
842
|
this.instance.destroy();
|
|
315
843
|
}
|
|
844
|
+
|
|
845
|
+
this.isScrollbarDragging = false;
|
|
846
|
+
this.externalControlsState = null;
|
|
847
|
+
this.resizeObserver?.disconnect();
|
|
848
|
+
this.resizeObserver = undefined;
|
|
849
|
+
|
|
850
|
+
if ((this.element as any).ODS_Carousel === this) {
|
|
851
|
+
delete (this.element as any).ODS_Carousel;
|
|
852
|
+
}
|
|
316
853
|
}
|
|
317
854
|
|
|
318
855
|
update() {
|
|
@@ -324,4 +861,14 @@ export default class Carousel {
|
|
|
324
861
|
static getInstance(el: HTMLElement): Carousel | null {
|
|
325
862
|
return el && (el as any).ODS_Carousel ? (el as any).ODS_Carousel : null;
|
|
326
863
|
}
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Find a carousel instance by its ID or data-carousel-id attribute.
|
|
867
|
+
*/
|
|
868
|
+
static getInstanceById(carouselId: string): Carousel | null {
|
|
869
|
+
const element =
|
|
870
|
+
document.querySelector(`[data-carousel-id="${carouselId}"]`) ||
|
|
871
|
+
document.getElementById(carouselId);
|
|
872
|
+
return element ? this.getInstance(element as HTMLElement) : null;
|
|
873
|
+
}
|
|
327
874
|
}
|