@sonic-equipment/ui 1.1.7 → 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/dist/algolia/algolia-hits-provider.js +4 -1
- package/dist/algolia/algolia-insights-provider.js +3 -3
- package/dist/algolia/algolia-provider.d.ts +4 -1
- package/dist/algolia/algolia-provider.js +6 -3
- package/dist/algolia/algolia-search-provider.js +1 -1
- package/dist/algolia/algolia-searchclient-reserved-slots.d.ts +25 -0
- package/dist/algolia/algolia-searchclient-reserved-slots.js +67 -0
- package/dist/algolia/use-algolia-hits.d.ts +5 -2
- package/dist/algolia/use-algolia-hits.js +9 -5
- package/dist/algolia/use-algolia-insights.js +2 -2
- package/dist/algolia/use-algolia-search.js +2 -2
- package/dist/badges/tag/tag.d.ts +2 -1
- package/dist/badges/tag/tag.js +3 -2
- package/dist/base.css +28 -1
- package/dist/breadcrumbs/breadcrumb.d.ts +1 -1
- package/dist/breadcrumbs/breadcrumb.js +2 -2
- package/dist/buttons/button/button.d.ts +2 -1
- package/dist/buttons/button/button.js +10 -2
- package/dist/buttons/icon-button/icon-button.d.ts +8 -1
- package/dist/buttons/icon-button/icon-button.js +4 -5
- package/dist/buttons/invoice-download-buttons/invoice-download-buttons.d.ts +8 -0
- package/dist/buttons/invoice-download-buttons/invoice-download-buttons.js +29 -0
- package/dist/buttons/invoice-download-buttons/invoice-download-buttons.module.css.js +3 -0
- package/dist/buttons/invoice-download-buttons/invoice-download-url.d.ts +5 -0
- package/dist/buttons/invoice-download-buttons/invoice-download-url.js +9 -0
- package/dist/buttons/invoice-download-buttons/invoice-download-url.test.d.ts +1 -0
- package/dist/cards/data-card/data-card.js +1 -1
- package/dist/cards/product-card/product-card.js +2 -1
- package/dist/cards/product-card/product-card.module.css.js +1 -1
- package/dist/cards/table-card/table-card.d.ts +6 -1
- package/dist/cards/table-card/table-card.js +3 -4
- package/dist/carousel/card-carousel/card-carousel.d.ts +3 -1
- package/dist/carousel/card-carousel/card-carousel.js +5 -3
- package/dist/carousel/card-carousel/card-carousel.module.css.js +1 -1
- package/dist/carousel/carousel-navigation-button.d.ts +3 -1
- package/dist/carousel/carousel-navigation-button.js +2 -3
- package/dist/carousel/carousel.js +1 -1
- package/dist/carousel/usp-carousel/product-usp-carousel-slide.js +1 -1
- package/dist/carousel/usp-carousel/usp-carousel.d.ts +0 -1
- package/dist/cart-totals/cart-totals-summary.js +1 -1
- package/dist/cart-totals/cart-totals.d.ts +3 -1
- package/dist/cart-totals/cart-totals.js +9 -3
- package/dist/cart-totals/cart-totals.module.css.js +1 -1
- package/dist/client-case-banner/client-case-banner.d.ts +16 -0
- package/dist/client-case-banner/client-case-banner.js +13 -0
- package/dist/client-case-banner/client-case-banner.module.css.js +3 -0
- package/dist/collapsables/accordion/accordion-item.js +1 -1
- package/dist/collapsables/cascading-component/cascading-component-container-provider.js +1 -1
- package/dist/collapsables/cascading-component/use-cascading-component-container.js +2 -2
- package/dist/collapsables/collapsable/collapsable.d.ts +12 -0
- package/dist/collapsables/collapsable/collapsable.js +31 -0
- package/dist/collapsables/collapsable/collapsable.module.css.js +3 -0
- package/dist/collapsables/unmounter/unmounter.js +3 -3
- package/dist/cookies/cookie-provider.js +1 -1
- package/dist/cookies/use-cookie.js +2 -2
- package/dist/country-language-selection-list/country-language-selection-list.js +1 -1
- package/dist/country-language-selection-list/country-language-selection-list.module.css.js +1 -1
- package/dist/country-language-selector/connected-country-language-selector.d.ts +1 -2
- package/dist/country-language-selector/connected-country-language-selector.js +2 -2
- package/dist/country-language-selector/country-language-selector.d.ts +1 -2
- package/dist/country-language-selector/country-language-selector.js +12 -19
- package/dist/country-language-selector/country-language-selector.module.css.js +1 -1
- package/dist/country-language-selector/fixtures/fixtures.d.ts +13 -0
- package/dist/country-language-selector-button/country-language-selector-button.stories.d.ts +13 -0
- package/dist/display/details/details.d.ts +2 -1
- package/dist/display/details/details.js +2 -2
- package/dist/display/product-sku/product-sku.js +3 -1
- package/dist/exports.d.ts +67 -21
- package/dist/filters/pagination/pagination.d.ts +2 -1
- package/dist/filters/pagination/pagination.js +3 -2
- package/dist/fonts.css +58 -56
- package/dist/footer/fixtures/fixtures.d.ts +3 -0
- package/dist/footer/footer.js +3 -2
- package/dist/footer/footer.module.css.js +1 -1
- package/dist/forms/elements/input/input.js +4 -6
- package/dist/forms/elements/range-slider/range-slider.d.ts +18 -0
- package/dist/forms/elements/range-slider/range-slider.js +31 -0
- package/dist/forms/elements/range-slider/range-slider.module.css.js +3 -0
- package/dist/global-search/global-search.d.ts +6 -1
- package/dist/global-search/global-search.js +3 -2
- package/dist/global-search/search-highlight/highlight.d.ts +7 -7
- package/dist/global-search/search-highlight/highlight.js +9 -9
- package/dist/global-search/search-input/connected-search-input.js +4 -1
- package/dist/global-search/search-result-panel/panel-content.d.ts +3 -1
- package/dist/global-search/search-result-panel/panel-content.js +2 -2
- package/dist/global-search/search-result-panel/search-result-panel.d.ts +3 -1
- package/dist/global-search/search-result-panel/search-result-panel.js +2 -2
- package/dist/global-search/search-result-panel/sections/no-search-results.js +1 -3
- package/dist/global-search/search-result-panel/sections/no-search.d.ts +2 -1
- package/dist/global-search/search-result-panel/sections/no-search.js +7 -14
- package/dist/global-search/search-result-panel/sections/search-content.module.css.js +1 -1
- package/dist/global-search/search-result-panel/sections/section-container.js +2 -2
- package/dist/global-search/search-result-panel/sections/with-results.js +6 -6
- package/dist/header/drawers/desktop-navigation-drawer.js +2 -1
- package/dist/header/drawers/mobile-navigation-drawer.js +2 -1
- package/dist/header/drawers/search-drawer.d.ts +3 -1
- package/dist/header/drawers/search-drawer.js +3 -2
- package/dist/header/drawers/search-drawer.module.css.js +3 -0
- package/dist/header/fixtures/fixtures.d.ts +4 -0
- package/dist/header/header-layout/header-layout.d.ts +1 -1
- package/dist/header/header-layout/header-layout.js +2 -3
- package/dist/header/header-layout/header-layout.module.css.js +1 -1
- package/dist/header/header.d.ts +3 -2
- package/dist/header/header.js +3 -2
- package/dist/header/header.module.css.js +1 -1
- package/dist/hubspot-form/hubspot-form.d.ts +41 -0
- package/dist/hubspot-form/hubspot-form.js +125 -0
- package/dist/hubspot-form/hubspot-form.module.css.js +3 -0
- package/dist/icons/index.d.ts +86 -0
- package/dist/icons/index.js +86 -0
- package/dist/icons/other/media-captionsoff-icon.d.ts +1 -0
- package/dist/icons/other/media-captionsoff-icon.js +7 -0
- package/dist/icons/other/media-captionson-icon.d.ts +1 -0
- package/dist/icons/other/media-captionson-icon.js +7 -0
- package/dist/icons/other/media-chapters-icon.d.ts +1 -0
- package/dist/icons/other/media-chapters-icon.js +7 -0
- package/dist/icons/other/media-enterfullscreen-icon.d.ts +1 -0
- package/dist/icons/other/media-enterfullscreen-icon.js +7 -0
- package/dist/icons/other/media-exitfullscreen-icon.d.ts +1 -0
- package/dist/icons/other/media-exitfullscreen-icon.js +7 -0
- package/dist/icons/other/media-pause-icon.d.ts +1 -0
- package/dist/icons/other/media-pause-icon.js +7 -0
- package/dist/icons/other/media-play-icon.d.ts +1 -0
- package/dist/icons/other/media-play-icon.js +7 -0
- package/dist/icons/other/media-seekbackwards-icon.d.ts +1 -0
- package/dist/icons/other/media-seekbackwards-icon.js +7 -0
- package/dist/icons/other/media-seekforwards-icon.d.ts +1 -0
- package/dist/icons/other/media-seekforwards-icon.js +7 -0
- package/dist/icons/other/media-subsoff-icon.d.ts +1 -0
- package/dist/icons/other/media-subsoff-icon.js +7 -0
- package/dist/icons/other/media-subson-icon.d.ts +1 -0
- package/dist/icons/other/media-subson-icon.js +7 -0
- package/dist/icons/other/media-volumefull-icon.d.ts +1 -0
- package/dist/icons/other/media-volumefull-icon.js +7 -0
- package/dist/icons/other/media-volumelow-icon.d.ts +1 -0
- package/dist/icons/other/media-volumelow-icon.js +7 -0
- package/dist/icons/other/media-volumemedium-icon.d.ts +1 -0
- package/dist/icons/other/media-volumemedium-icon.js +7 -0
- package/dist/icons/other/media-volumemuted-icon.d.ts +1 -0
- package/dist/icons/other/media-volumemuted-icon.js +7 -0
- package/dist/icons/solid/solid-enterfullscreen-icon.d.ts +1 -0
- package/dist/icons/solid/solid-exitfullscreen-icon.d.ts +1 -0
- package/dist/icons/solid/solid-facebook-icon.js +7 -0
- package/dist/icons/solid/solid-instagram-icon.js +7 -0
- package/dist/icons/solid/solid-link-icon.js +7 -0
- package/dist/icons/solid/solid-linkedin-icon.js +7 -0
- package/dist/icons/solid/solid-tiktok-icon.js +7 -0
- package/dist/icons/solid/solid-youtube-icon.js +7 -0
- package/dist/icons/stroke/stroke-business-icon.js +7 -0
- package/dist/icons/stroke/stroke-captions-icon.d.ts +1 -0
- package/dist/icons/stroke/stroke-captions-icon.js +7 -0
- package/dist/icons/stroke/stroke-efficiency-icon.js +7 -0
- package/dist/icons/stroke/stroke-fallback-icon.js +7 -0
- package/dist/icons/stroke/stroke-happy-icon.js +7 -0
- package/dist/icons/stroke/stroke-innovate-icon.js +7 -0
- package/dist/icons/stroke/stroke-list-icon.d.ts +1 -0
- package/dist/icons/stroke/stroke-list-icon.js +7 -0
- package/dist/icons/stroke/stroke-modular-icon.js +7 -0
- package/dist/icons/stroke/stroke-okay-icon.js +7 -0
- package/dist/icons/stroke/stroke-package-icon.js +7 -0
- package/dist/icons/stroke/stroke-proactive-icon.js +7 -0
- package/dist/icons/stroke/stroke-productivity-icon.js +7 -0
- package/dist/icons/stroke/stroke-rating-icon.js +7 -0
- package/dist/icons/stroke/stroke-salecategory-icon.js +7 -0
- package/dist/icons/stroke/stroke-style-icon.js +7 -0
- package/dist/icons/stroke/stroke-support-icon.js +7 -0
- package/dist/icons/stroke/stroke-thumbsup-icon.js +7 -0
- package/dist/icons/stroke/stroke-warranty10y-icon.js +7 -0
- package/dist/icons/stroke/stroke-warranty1y-icon.js +7 -0
- package/dist/icons/stroke/stroke-warranty3y-icon.js +7 -0
- package/dist/icons/stroke/stroke-warranty5y-icon.js +7 -0
- package/dist/icons/stroke/stroke-warrantyconsumable-icon.js +7 -0
- package/dist/icons/stroke/stroke-warrantylifetime-icon.js +7 -0
- package/dist/image-banner/image-banner.d.ts +20 -0
- package/dist/image-banner/image-banner.js +15 -0
- package/dist/image-banner/image-banner.module.css.js +3 -0
- package/dist/index.js +78 -33
- package/dist/intl/intl-provider.js +1 -1
- package/dist/intl/missing-translation-provider.js +1 -1
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/intl/use-intl.js +2 -2
- package/dist/lists/download-document-list/download-document-list.js +2 -1
- package/dist/lists/menu-list/menu-list-provider.js +1 -1
- package/dist/lists/menu-list/use-menu-list.js +2 -2
- package/dist/lists/product-overview-grid/product-overview-grid.d.ts +17 -2
- package/dist/lists/product-overview-grid/product-overview-grid.js +20 -8
- package/dist/lists/product-overview-grid/product-overview-grid.module.css.js +1 -1
- package/dist/loading/dynamic-loading-overlay.js +1 -23
- package/dist/loading/dynamic-loading-overlay.module.css.js +1 -1
- package/dist/media/image-cdn/image-cdn-profile.d.ts +45 -0
- package/dist/media/image-cdn/image-cdn-profile.js +63 -0
- package/dist/media/image-cdn/image-cdn-profile.test.d.ts +1 -0
- package/dist/media/image-cdn/image-cdn-provider.d.ts +10 -0
- package/dist/media/image-cdn/image-cdn-provider.js +15 -0
- package/dist/media/image-cdn/storyblok-profile.d.ts +3 -0
- package/dist/media/image-cdn/storyblok-profile.js +37 -0
- package/dist/media/image-cdn/storyblok-profile.test.d.ts +1 -0
- package/dist/media/image-lightbox/image-lightbox.module.css.js +1 -1
- package/dist/media/media-controls/media-chapters-control/media-chapters-control.d.ts +8 -0
- package/dist/media/media-controls/media-chapters-control/media-chapters-control.js +63 -0
- package/dist/media/media-controls/media-control/media-control.d.ts +19 -0
- package/dist/media/media-controls/media-control/media-control.js +15 -0
- package/dist/media/media-controls/media-controls.d.ts +12 -0
- package/dist/media/media-controls/media-controls.js +17 -0
- package/dist/media/media-controls/media-controls.module.css.js +3 -0
- package/dist/media/media-controls/media-popover/media-popover.d.ts +12 -0
- package/dist/media/media-controls/media-popover/media-popover.js +67 -0
- package/dist/media/media-controls/media-progress-circle/media-progress-circle.d.ts +20 -0
- package/dist/media/media-controls/media-progress-circle/media-progress-circle.js +31 -0
- package/dist/media/media-controls/media-seek-control/media-seek-control.d.ts +6 -0
- package/dist/media/media-controls/media-seek-control/media-seek-control.js +30 -0
- package/dist/media/media-controls/media-subs-control/media-subs-control.d.ts +8 -0
- package/dist/media/media-controls/media-subs-control/media-subs-control.js +65 -0
- package/dist/media/media-controls/media-volume-control/media-volume-control.d.ts +7 -0
- package/dist/media/media-controls/media-volume-control/media-volume-control.js +103 -0
- package/dist/media/media-utils.d.ts +19 -0
- package/dist/media/media-utils.js +28 -0
- package/dist/media/responsive-image/responsive-image.d.ts +37 -0
- package/dist/media/responsive-image/responsive-image.js +119 -0
- package/dist/media/responsive-image/responsive-image.module.css.js +3 -0
- package/dist/media/responsive-video/responsive-video.d.ts +36 -0
- package/dist/media/responsive-video/responsive-video.js +365 -0
- package/dist/media/responsive-video/responsive-video.module.css.js +3 -0
- package/dist/modals/dialog/dialog.js +1 -1
- package/dist/navigation/panel-navigation/panel-navigation.js +1 -1
- package/dist/notifications/announcements/announcement-list.d.ts +10 -1
- package/dist/notifications/announcements/announcement-list.js +1 -13
- package/dist/notifications/announcements/announcement-list.module.css.js +1 -1
- package/dist/notifications/announcements/announcement.d.ts +13 -2
- package/dist/notifications/announcements/announcement.js +14 -6
- package/dist/notifications/announcements/fixtures/fixtures.d.ts +22 -0
- package/dist/page-layout/fixtures/fixtures.d.ts +15 -0
- package/dist/page-layout/page-layout.d.ts +2 -0
- package/dist/page-layout/page-layout.js +33 -0
- package/dist/page-layout/page-layout.module.css.js +3 -0
- package/dist/page-layout/types.d.ts +52 -0
- package/dist/pages/account/change-password-page/change-password-page.js +6 -2
- package/dist/pages/account/components/change-password-form/change-password-form.js +1 -5
- package/dist/pages/account/components/create-account-form/create-account-form.js +1 -4
- package/dist/pages/account/components/sign-in-form/sign-in-form.js +2 -6
- package/dist/pages/account/create-account-page/create-account-page.d.ts +1 -1
- package/dist/pages/account/create-account-page/create-account-page.js +8 -4
- package/dist/pages/account/sign-in-page/sign-in-page.d.ts +1 -1
- package/dist/pages/account/sign-in-page/sign-in-page.js +6 -4
- package/dist/pages/checkout/cart-page/cart-page.d.ts +1 -1
- package/dist/pages/checkout/cart-page/cart-page.js +35 -68
- package/dist/pages/checkout/components/billing-and-invoice-information.js +1 -1
- package/dist/pages/checkout/components/billing-and-invoice-information.module.css.js +1 -1
- package/dist/pages/checkout/{layouts/checkout-page-layout/components → components}/checkout-page-section-header.d.ts +1 -1
- package/dist/pages/checkout/{layouts/checkout-page-layout/components → components}/checkout-page-section-header.js +2 -2
- package/dist/pages/checkout/components/checkout-page-section.js +12 -0
- package/dist/pages/checkout/components/checkout-page-section.module.css.js +3 -0
- package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +50 -64
- package/dist/pages/checkout/payment-page/payment-page-content.js +25 -25
- package/dist/pages/checkout/shipping-page/components/edit-checkout-bill-to-address-form.js +2 -2
- package/dist/pages/checkout/shipping-page/components/readonly-address.js +3 -3
- package/dist/pages/checkout/shipping-page/components/readonly-address.module.css.js +1 -1
- package/dist/pages/checkout/shipping-page/shipping-page-content.js +12 -12
- package/dist/pages/components/page/page.js +1 -1
- package/dist/pages/countries-page/countries-page.js +7 -4
- package/dist/pages/error-page/error-page.js +2 -7
- package/dist/pages/my-sonic/navigation/connected-my-sonic-navigation.js +2 -1
- package/dist/pages/my-sonic/pages/create-ship-to-address-details-page/create-ship-to-address-details-page.d.ts +0 -3
- package/dist/pages/my-sonic/pages/create-ship-to-address-details-page/create-ship-to-address-details-page.js +16 -17
- package/dist/pages/my-sonic/pages/edit-bill-to-address-details-page/edit-bill-to-address-details-page.d.ts +0 -3
- package/dist/pages/my-sonic/pages/edit-bill-to-address-details-page/edit-bill-to-address-details-page.js +16 -17
- package/dist/pages/my-sonic/pages/edit-ship-to-address-details-page/edit-ship-to-address-details-page.d.ts +0 -4
- package/dist/pages/my-sonic/pages/edit-ship-to-address-details-page/edit-ship-to-address-details-page.js +16 -17
- package/dist/pages/my-sonic/pages/favorites/favorites-page.d.ts +0 -1
- package/dist/pages/my-sonic/pages/favorites/favorites-page.js +31 -33
- package/dist/pages/my-sonic/pages/favorites/favorites-page.module.css.js +3 -0
- package/dist/pages/my-sonic/pages/my-account/my-account-page.d.ts +0 -1
- package/dist/pages/my-sonic/pages/my-account/my-account-page.js +12 -12
- package/dist/pages/my-sonic/pages/order-details/order-details-content.d.ts +2 -1
- package/dist/pages/my-sonic/pages/order-details/order-details-content.js +4 -4
- package/dist/pages/my-sonic/pages/order-details/order-details-content.module.css.js +1 -1
- package/dist/pages/my-sonic/pages/order-details/order-details-page.d.ts +2 -4
- package/dist/pages/my-sonic/pages/order-details/order-details-page.js +19 -29
- package/dist/pages/my-sonic/pages/order-history/order-history-page.d.ts +0 -1
- package/dist/pages/my-sonic/pages/order-history/order-history-page.js +112 -116
- package/dist/pages/my-sonic/pages/upload-order-page/upload-order-page.d.ts +0 -1
- package/dist/pages/my-sonic/pages/upload-order-page/upload-order-page.js +12 -12
- package/dist/pages/product/components/product-overview.d.ts +11 -3
- package/dist/pages/product/components/product-overview.js +11 -7
- package/dist/pages/product/product-details-page/components/product-details-panel/product-details-panel.js +5 -7
- package/dist/pages/product/product-details-page/components/product-details-panel/product-details-panel.module.css.js +1 -1
- package/dist/pages/product/product-details-page/components/product-details-recently-viewed-section/product-details-recently-viewed-section.d.ts +3 -1
- package/dist/pages/product/product-details-page/components/product-details-recently-viewed-section/product-details-recently-viewed-section.js +9 -10
- package/dist/pages/product/product-details-page/product-details.js +18 -18
- package/dist/pages/product/product-details-page/product-details.module.css.js +3 -0
- package/dist/pages/product/product-listing-page/no-results/no-results.d.ts +3 -5
- package/dist/pages/product/product-listing-page/no-results/no-results.js +2 -4
- package/dist/pages/product/product-listing-page/no-results/no-results.module.css.js +1 -1
- package/dist/pages/product/product-listing-page/product-listing-page-category-carousel/product-listing-page-category-carousel.js +6 -4
- package/dist/pages/product/product-listing-page/product-listing-page-category-carousel/product-listing-page-category-carousel.module.css.js +3 -0
- package/dist/pages/product/product-listing-page/product-listing-page-provider/product-listing-page-provider.js +3 -3
- package/dist/pages/product/product-listing-page/product-listing-page.js +1 -1
- package/dist/pages/product/product-listing-page/product-listing-page.module.css.js +1 -1
- package/dist/pages/product/product-listing-page/product-listing-product-overview/product-listing-product-overview.d.ts +2 -1
- package/dist/pages/product/product-listing-page/product-listing-product-overview/product-listing-product-overview.js +2 -2
- package/dist/pages/product/product-listing-page/product-listing.d.ts +8 -1
- package/dist/pages/product/product-listing-page/product-listing.js +23 -23
- package/dist/pages/product/search-result-page/search-result-product-overview/search-result-product-overview.d.ts +2 -1
- package/dist/pages/product/search-result-page/search-result-product-overview/search-result-product-overview.js +2 -2
- package/dist/pages/product/search-result-page/search-results-page.js +20 -19
- package/dist/promos/promo-banners/promo-banners.js +2 -1
- package/dist/responsive-banner/responsive-banner.d.ts +30 -0
- package/dist/responsive-banner/responsive-banner.js +23 -0
- package/dist/responsive-banner/responsive-banner.module.css.js +3 -0
- package/dist/responsive-carousel/responsive-carousel.d.ts +18 -0
- package/dist/responsive-carousel/responsive-carousel.js +209 -0
- package/dist/responsive-carousel/responsive-carousel.module.css.js +3 -0
- package/dist/rich-text/rich-text.d.ts +7 -0
- package/dist/rich-text/rich-text.js +10 -0
- package/dist/rich-text/rich-text.module.css.js +3 -0
- package/dist/rte-asset/rte-asset.d.ts +8 -0
- package/dist/rte-asset/rte-asset.js +10 -0
- package/dist/rte-asset/rte-asset.module.css.js +3 -0
- package/dist/rte-blockquote/rte-blockquote.d.ts +8 -0
- package/dist/rte-blockquote/rte-blockquote.js +10 -0
- package/dist/rte-blockquote/rte-blockquote.module.css.js +3 -0
- package/dist/rte-details/rte-details.d.ts +7 -0
- package/dist/rte-details/rte-details.js +10 -0
- package/dist/rte-details/rte-details.module.css.js +3 -0
- package/dist/rte-ordered-list/rte-ordered-list.d.ts +14 -0
- package/dist/rte-ordered-list/rte-ordered-list.js +34 -0
- package/dist/rte-ordered-list/rte-ordered-list.module.css.js +3 -0
- package/dist/sections/about-section/about-section.d.ts +13 -0
- package/dist/sections/about-section/about-section.js +13 -0
- package/dist/sections/about-section/about-section.module.css.js +3 -0
- package/dist/sections/about-section/media-contact.d.ts +7 -0
- package/dist/sections/about-section/media-contact.js +12 -0
- package/dist/sections/banner-section/banner-section.d.ts +13 -0
- package/dist/sections/banner-section/banner-section.js +12 -0
- package/dist/sections/banner-section/banner-section.module.css.js +3 -0
- package/dist/sections/banner-section/fixtures/fixtures.d.ts +5 -0
- package/dist/sections/case-studies-listing-section/case-studies-listing-section.constants.d.ts +10 -0
- package/dist/sections/case-studies-listing-section/case-studies-listing-section.constants.js +12 -0
- package/dist/sections/case-studies-listing-section/case-studies-listing-section.d.ts +26 -0
- package/dist/sections/case-studies-listing-section/case-studies-listing-section.js +30 -0
- package/dist/sections/case-studies-listing-section/case-studies-listing-section.module.css.js +3 -0
- package/dist/sections/client-cases-carousel-section/client-cases-carousel-section.d.ts +13 -0
- package/dist/sections/client-cases-carousel-section/client-cases-carousel-section.js +13 -0
- package/dist/sections/client-cases-carousel-section/client-cases-carousel-section.module.css.js +3 -0
- package/dist/sections/downloadable-documents-section/downloadable-documents-section.d.ts +21 -0
- package/dist/sections/downloadable-documents-section/downloadable-documents-section.js +16 -0
- package/dist/sections/downloadable-documents-section/downloadable-documents-section.module.css.js +3 -0
- package/dist/sections/event-info-section/event-info-section.d.ts +9 -0
- package/dist/sections/event-info-section/event-info-section.js +23 -0
- package/dist/sections/event-info-section/event-info-section.module.css.js +3 -0
- package/dist/sections/faq-section/faq-section.d.ts +24 -0
- package/dist/sections/faq-section/faq-section.js +20 -0
- package/dist/sections/faq-section/faq-section.module.css.js +3 -0
- package/dist/sections/hero-section/hero-section.d.ts +22 -0
- package/dist/sections/hero-section/hero-section.js +16 -0
- package/dist/sections/hero-section/hero-section.module.css.js +3 -0
- package/dist/sections/hubspot-form-section/hubspot-form-section.d.ts +18 -0
- package/dist/sections/hubspot-form-section/hubspot-form-section.js +18 -0
- package/dist/sections/hubspot-form-section/hubspot-form-section.module.css.js +3 -0
- package/dist/sections/image-banner-carousel-section/image-banner-carousel-section.d.ts +12 -0
- package/dist/sections/image-banner-carousel-section/image-banner-carousel-section.js +13 -0
- package/dist/sections/image-banner-carousel-section/image-banner-carousel-section.module.css.js +3 -0
- package/dist/sections/image-banner-section/image-banner-section.d.ts +12 -0
- package/dist/sections/image-banner-section/image-banner-section.js +12 -0
- package/dist/sections/image-banner-section/image-banner-section.module.css.js +3 -0
- package/dist/sections/image-hubspot-section/image-hubspot-form-section.d.ts +21 -0
- package/dist/sections/image-hubspot-section/image-hubspot-form-section.js +19 -0
- package/dist/sections/image-hubspot-section/image-hubspot-form-section.module.css.js +3 -0
- package/dist/sections/image-section/image-section.d.ts +25 -0
- package/dist/sections/image-section/image-section.js +14 -0
- package/dist/sections/image-section/image-section.module.css.js +3 -0
- package/dist/sections/image-text-section/image-text-block.d.ts +13 -0
- package/dist/sections/image-text-section/image-text-block.js +13 -0
- package/dist/sections/image-text-section/image-text-section.d.ts +15 -0
- package/dist/sections/image-text-section/image-text-section.js +12 -0
- package/dist/sections/image-text-section/image-text-section.module.css.js +3 -0
- package/dist/sections/legal-section/legal-section.d.ts +10 -0
- package/dist/sections/legal-section/legal-section.js +13 -0
- package/dist/sections/legal-section/legal-section.module.css.js +3 -0
- package/dist/sections/multi-column-section/multi-column-section.d.ts +24 -0
- package/dist/sections/multi-column-section/multi-column-section.js +24 -0
- package/dist/sections/multi-column-section/multi-column-section.module.css.js +3 -0
- package/dist/sections/news-list-section/news-listing-section.d.ts +17 -0
- package/dist/sections/news-list-section/news-listing-section.js +27 -0
- package/dist/sections/news-list-section/news-listing-section.module.css.js +3 -0
- package/dist/sections/numbers-section/numbers-section.d.ts +18 -0
- package/dist/sections/numbers-section/numbers-section.js +15 -0
- package/dist/sections/numbers-section/numbers-section.module.css.js +3 -0
- package/dist/sections/page-meta-section/page-meta-section.d.ts +8 -0
- package/dist/sections/page-meta-section/page-meta-section.js +23 -0
- package/dist/sections/page-meta-section/page-meta-section.module.css.js +3 -0
- package/dist/sections/page-section/page-section.d.ts +297 -0
- package/dist/sections/page-section/page-section.js +23 -0
- package/dist/sections/page-section/page-section.module.css.js +3 -0
- package/dist/sections/percentages-section/percentages-section.d.ts +21 -0
- package/dist/sections/percentages-section/percentages-section.js +18 -0
- package/dist/sections/percentages-section/percentages-section.module.css.js +3 -0
- package/dist/sections/product-comparison-section/product-comparison-section.d.ts +17 -0
- package/dist/sections/product-comparison-section/product-comparison-section.js +19 -0
- package/dist/sections/product-comparison-section/product-comparison-section.module.css.js +3 -0
- package/dist/sections/rich-text-section/rich-text-section.d.ts +11 -0
- package/dist/sections/rich-text-section/rich-text-section.js +12 -0
- package/dist/sections/rich-text-section/rich-text-section.module.css.js +3 -0
- package/dist/sections/social-media-section/social-media-section.d.ts +20 -0
- package/dist/sections/social-media-section/social-media-section.js +27 -0
- package/dist/sections/social-media-section/social-media-section.module.css.js +3 -0
- package/dist/sections/subheadline-section/subheadline-section.d.ts +7 -0
- package/dist/sections/subheadline-section/subheadline-section.js +12 -0
- package/dist/sections/subheadline-section/subheadline-section.module.css.js +3 -0
- package/dist/sections/usp-section/usp-section.d.ts +19 -0
- package/dist/sections/usp-section/usp-section.js +17 -0
- package/dist/sections/usp-section/usp-section.module.css.js +3 -0
- package/dist/sections/video-section/video-section.d.ts +30 -0
- package/dist/sections/video-section/video-section.js +13 -0
- package/dist/sections/video-section/video-section.module.css.js +3 -0
- package/dist/shared/error/default-error-view.d.ts +1 -1
- package/dist/shared/error/default-error-view.js +4 -2
- package/dist/shared/error/default-error-view.module.css.js +1 -1
- package/dist/shared/error/global-unhandled-error-handler.js +3 -3
- package/dist/shared/feature-flags/use-feature-flags.d.ts +1 -0
- package/dist/shared/feature-flags/use-feature-flags.js +3 -2
- package/dist/shared/hooks/use-drag-scroll.d.ts +20 -0
- package/dist/shared/hooks/use-drag-scroll.js +107 -0
- package/dist/shared/local-storage/local-storage-provider.js +1 -1
- package/dist/shared/local-storage/use-local-storage.js +2 -2
- package/dist/shared/local-storage/use-session-storage.js +2 -2
- package/dist/shared/model/announcement.d.ts +1 -0
- package/dist/shared/model/image.d.ts +5 -0
- package/dist/shared/providers/global-state-provider.js +3 -3
- package/dist/shared/routing/route-provider.js +1 -1
- package/dist/shared/routing/use-router.js +2 -2
- package/dist/shared/utils/array.d.ts +1 -0
- package/dist/shared/utils/array.js +9 -1
- package/dist/shared/utils/array.test.d.ts +1 -0
- package/dist/sidebar/sidebar.js +2 -2
- package/dist/site-layout/site-layout.d.ts +15 -0
- package/dist/site-layout/site-layout.js +39 -0
- package/dist/site-layout/site-layout.module.css.js +3 -0
- package/dist/styles.css +10859 -3344
- package/dist/table/elements/table-provider.js +1 -1
- package/dist/table/elements/table-row-provider.js +1 -1
- package/dist/table/elements/table.js +2 -2
- package/dist/table/elements/use-table-row.js +2 -2
- package/dist/table/elements/use-table.js +2 -2
- package/dist/toast/toast.d.ts +6 -1
- package/dist/toast/toast.js +2 -3
- package/dist/typography/heading/heading.d.ts +18 -10
- package/dist/typography/heading/heading.js +28 -14
- package/dist/typography/heading/heading.module.css.js +1 -1
- package/package.json +6 -5
- package/dist/buttons/print-button/print-button.d.ts +0 -2
- package/dist/buttons/print-button/print-button.js +0 -10
- package/dist/footer/connected-footer.d.ts +0 -3
- package/dist/footer/connected-footer.js +0 -21
- package/dist/header/connected-header.d.ts +0 -3
- package/dist/header/connected-header.js +0 -21
- package/dist/notifications/announcements/connected-announcement-list.d.ts +0 -3
- package/dist/notifications/announcements/connected-announcement-list.js +0 -22
- package/dist/notifications/announcements/use-filter-announcements.d.ts +0 -2
- package/dist/notifications/announcements/use-filter-announcements.js +0 -35
- package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-background-image.d.ts +0 -6
- package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-background-image.js +0 -9
- package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.d.ts +0 -9
- package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.js +0 -12
- package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.module.css.js +0 -3
- package/dist/pages/checkout/cart-page/components/empty-cart-page.d.ts +0 -1
- package/dist/pages/checkout/cart-page/components/empty-cart-page.js +0 -12
- package/dist/pages/checkout/layouts/checkout-page-layout/checkout-page-layout.d.ts +0 -11
- package/dist/pages/checkout/layouts/checkout-page-layout/checkout-page-layout.js +0 -34
- package/dist/pages/checkout/layouts/checkout-page-layout/checkout-page-layout.module.css.js +0 -3
- package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section.js +0 -11
- package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section.module.css.js +0 -3
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-aside.d.ts +0 -4
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-aside.js +0 -9
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-breadcrumb.d.ts +0 -4
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-breadcrumb.js +0 -9
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-main.d.ts +0 -4
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-main.js +0 -9
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-page.d.ts +0 -5
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-page.js +0 -10
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-pre-aside.d.ts +0 -4
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-pre-aside.js +0 -9
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-title.d.ts +0 -4
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout-title.js +0 -10
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout.d.ts +0 -5
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout.js +0 -10
- package/dist/pages/my-sonic/layouts/my-sonic-layout/my-sonic-layout.module.css.js +0 -3
- package/dist/pages/product/layouts/product-details-page-layout/product-details-page-layout.d.ts +0 -9
- package/dist/pages/product/layouts/product-details-page-layout/product-details-page-layout.js +0 -10
- package/dist/pages/product/layouts/product-details-page-layout/product-details-page-layout.module.css.js +0 -3
- package/dist/pages/product/product-details-page/components/product-details-recently-viewed-section/product-details-recently-viewed-section.module.css.js +0 -3
- package/dist/pages/product/search-result-page/search-results-page.module.css.js +0 -3
- /package/dist/pages/checkout/{layouts/checkout-page-layout/components → components}/checkout-page-section-content.d.ts +0 -0
- /package/dist/pages/checkout/{layouts/checkout-page-layout/components → components}/checkout-page-section-content.js +0 -0
- /package/dist/pages/checkout/{layouts/checkout-page-layout/components → components}/checkout-page-section-link.d.ts +0 -0
- /package/dist/pages/checkout/{layouts/checkout-page-layout/components → components}/checkout-page-section-link.js +0 -0
- /package/dist/pages/checkout/{layouts/checkout-page-layout/components → components}/checkout-page-section.d.ts +0 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { use, useId, useRef, useState, useMemo, useEffect } from 'react';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
6
|
+
import { LocalStorageContext } from '../../shared/local-storage/local-storage-context.js';
|
|
7
|
+
import { MediaChaptersControl } from '../media-controls/media-chapters-control/media-chapters-control.js';
|
|
8
|
+
import { MediaControl } from '../media-controls/media-control/media-control.js';
|
|
9
|
+
import { MediaControls } from '../media-controls/media-controls.js';
|
|
10
|
+
import { MediaProgressCircle } from '../media-controls/media-progress-circle/media-progress-circle.js';
|
|
11
|
+
import { MediaSeekControl } from '../media-controls/media-seek-control/media-seek-control.js';
|
|
12
|
+
import { MediaSubsControl } from '../media-controls/media-subs-control/media-subs-control.js';
|
|
13
|
+
import { MediaVolumeControl } from '../media-controls/media-volume-control/media-volume-control.js';
|
|
14
|
+
import { createSubsTrackList, createChaptersList } from '../media-utils.js';
|
|
15
|
+
import { ResponsiveImage } from '../responsive-image/responsive-image.js';
|
|
16
|
+
import styles from './responsive-video.module.css.js';
|
|
17
|
+
|
|
18
|
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
19
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
20
|
+
/* eslint-disable @eslint-react/hooks-extra/no-direct-set-state-in-use-effect */
|
|
21
|
+
/* eslint-disable no-warning-comments */
|
|
22
|
+
const seekStep = 10; // number of seconds to seek forward/backward when clicking the seek controls
|
|
23
|
+
const hideUIInteractionDelay = 2000; // number of milliseconds of inactivity before hiding the UI when playing
|
|
24
|
+
let playbackTimer = null;
|
|
25
|
+
let interactionTimer = null;
|
|
26
|
+
let supportFullscreenControl;
|
|
27
|
+
function ResponsiveVideo({ ariaDescription, autoplay, captions, chapters, className, 'data-test-selector': dataTestSelector, filetype, fit = 'contain', hideControlsPlaying = true, lang, loadingEffect = 'shimmer', loop = false, maxHeight, maxWidth, muted, noControls, play, posterFocusPoint, posterImage, showChapterSelection = true, showControls = true, showFullscreenControl = true, showSeekControls = true, showSubtitlesSelection = true, showVolumeControl = true, sourceHeight, sourceWidth, src, subtitles, theme = 'light', }) {
|
|
28
|
+
const t = useFormattedMessage();
|
|
29
|
+
const { localStorage } = use(LocalStorageContext) ?? {};
|
|
30
|
+
const videoId = useId();
|
|
31
|
+
const loadingProgressId = `${videoId}-loading-progress`;
|
|
32
|
+
const descriptionId = ariaDescription ? `${videoId}-description` : undefined;
|
|
33
|
+
const sectionRef = useRef(null);
|
|
34
|
+
const videoRef = useRef(null);
|
|
35
|
+
const width = videoRef.current?.videoWidth || sourceWidth;
|
|
36
|
+
const height = videoRef.current?.videoHeight || sourceHeight;
|
|
37
|
+
const loadingProgressRef = useRef(null);
|
|
38
|
+
const playbackProgressRef = useRef(null);
|
|
39
|
+
const loadingProgress = useRef(0);
|
|
40
|
+
const [videoState, setVideoState] = useState('loading');
|
|
41
|
+
const [isPosterImageLoaded, setIsPosterImageLoaded] = useState(!posterImage);
|
|
42
|
+
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
43
|
+
const [chaptersList, setChaptersList] = useState({});
|
|
44
|
+
const [activeChapter, setActiveChapter] = useState('0');
|
|
45
|
+
const [subsTrackList, setSubsTrackList] = useState({});
|
|
46
|
+
const [activeSubsTrack, setActiveSubsTrack] = useState();
|
|
47
|
+
const [interactionIdle, setInteractionIdle] = useState(false);
|
|
48
|
+
const dimensions = () => {
|
|
49
|
+
const ratio = !!width && !!height ? height / width : 1;
|
|
50
|
+
const isRestrictingWidth = !!maxWidth && !!width && width > maxWidth;
|
|
51
|
+
const isRestrictingHeight = !!maxHeight && !!height && height > maxHeight;
|
|
52
|
+
if (isRestrictingWidth && isRestrictingHeight) {
|
|
53
|
+
return ratio * maxWidth <= maxHeight
|
|
54
|
+
? { height: ratio * maxWidth, width: maxWidth }
|
|
55
|
+
: { height: maxHeight, width: (1 / ratio) * maxHeight };
|
|
56
|
+
}
|
|
57
|
+
if (isRestrictingWidth && !isRestrictingHeight)
|
|
58
|
+
return { height: ratio * maxWidth, width: maxWidth };
|
|
59
|
+
if (!isRestrictingWidth && isRestrictingHeight)
|
|
60
|
+
return { height: maxHeight, width: (1 / ratio) * maxHeight };
|
|
61
|
+
return { height, width };
|
|
62
|
+
};
|
|
63
|
+
const initializeChapters = () => {
|
|
64
|
+
const textTracks = [...(videoRef.current?.textTracks || [])];
|
|
65
|
+
const chapterTrack = textTracks.find(track => track.kind === 'chapters');
|
|
66
|
+
if (chapterTrack) {
|
|
67
|
+
chapterTrack.mode = 'showing';
|
|
68
|
+
chapterTrack.addEventListener('cuechange', handleChapterChange); // TODO: issue here with unmounting?
|
|
69
|
+
setChaptersList(createChaptersList(chapterTrack.cues));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const initializeSubs = () => {
|
|
73
|
+
const textTracks = [...(videoRef.current?.textTracks || [])];
|
|
74
|
+
const subsTracks = textTracks.filter(track => track.kind === 'subtitles' || track.kind === 'captions');
|
|
75
|
+
if (subsTracks.length > 0) {
|
|
76
|
+
setSubsTrackList({
|
|
77
|
+
...createSubsTrackList(subsTracks),
|
|
78
|
+
'-1': { label: 'Off' },
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const isReady = useMemo(() => ['ready', 'playing', 'paused', 'ended'].includes(videoState), [videoState]);
|
|
83
|
+
const isStarted = useMemo(() => ['playing', 'paused', 'ended'].includes(videoState), [videoState]);
|
|
84
|
+
const isPlaying = useMemo(() => ['playing'].includes(videoState), [videoState]);
|
|
85
|
+
const controlsDisabled = useMemo(() => !(videoState !== 'loading' && isPosterImageLoaded), [videoState, isPosterImageLoaded]);
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
if (!videoRef.current)
|
|
88
|
+
return;
|
|
89
|
+
if (typeof HTMLMediaElement !== 'undefined' &&
|
|
90
|
+
videoRef.current.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA)
|
|
91
|
+
readyFn();
|
|
92
|
+
supportFullscreenControl = document?.fullscreenEnabled;
|
|
93
|
+
const textTracks = videoRef.current.textTracks;
|
|
94
|
+
if (textTracks.length > 0) {
|
|
95
|
+
initializeSubs();
|
|
96
|
+
textTracks.addEventListener('change', handleSubsTrackChange);
|
|
97
|
+
}
|
|
98
|
+
const chaptersTrackEl = videoRef.current.querySelector('track[kind="chapters"]');
|
|
99
|
+
if (chaptersTrackEl) {
|
|
100
|
+
chaptersTrackEl.track.mode = 'hidden';
|
|
101
|
+
chaptersTrackEl.addEventListener('load', initializeChapters);
|
|
102
|
+
}
|
|
103
|
+
document?.addEventListener('fullscreenchange', handleFullscreenChange);
|
|
104
|
+
return () => {
|
|
105
|
+
textTracks.removeEventListener('change', handleSubsTrackChange);
|
|
106
|
+
chaptersTrackEl?.removeEventListener('load', initializeChapters);
|
|
107
|
+
document?.removeEventListener('fullscreenchange', handleFullscreenChange);
|
|
108
|
+
};
|
|
109
|
+
}, []);
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (play)
|
|
112
|
+
playVideo();
|
|
113
|
+
else
|
|
114
|
+
pauseVideo();
|
|
115
|
+
}, [play]);
|
|
116
|
+
const readyFn = async () => {
|
|
117
|
+
handleLoadingProgress();
|
|
118
|
+
setVideoState('ready');
|
|
119
|
+
if (autoplay || play)
|
|
120
|
+
playVideo();
|
|
121
|
+
};
|
|
122
|
+
const playVideo = () => {
|
|
123
|
+
if (videoRef.current) {
|
|
124
|
+
videoRef.current.play();
|
|
125
|
+
restartInteractionIdle();
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const pauseVideo = () => {
|
|
129
|
+
if (videoRef.current) {
|
|
130
|
+
videoRef.current.pause();
|
|
131
|
+
resetInteractionIdle();
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const togglePlayback = () => {
|
|
135
|
+
if (isPlaying)
|
|
136
|
+
pauseVideo();
|
|
137
|
+
else
|
|
138
|
+
playVideo();
|
|
139
|
+
};
|
|
140
|
+
const seekBackwards = () => {
|
|
141
|
+
if (videoRef.current)
|
|
142
|
+
videoRef.current.currentTime = Math.max(videoRef.current.currentTime - seekStep, 0);
|
|
143
|
+
};
|
|
144
|
+
const seekForwards = () => {
|
|
145
|
+
if (videoRef.current)
|
|
146
|
+
videoRef.current.currentTime = Math.min(videoRef.current.currentTime + seekStep, videoRef.current.duration);
|
|
147
|
+
};
|
|
148
|
+
const toggleFullscreen = async () => {
|
|
149
|
+
if (!document ||
|
|
150
|
+
!showFullscreenControl ||
|
|
151
|
+
!supportFullscreenControl ||
|
|
152
|
+
!sectionRef.current)
|
|
153
|
+
return;
|
|
154
|
+
if (isFullscreen) {
|
|
155
|
+
await document.exitFullscreen();
|
|
156
|
+
setIsFullscreen(false);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
await sectionRef.current.requestFullscreen();
|
|
160
|
+
setIsFullscreen(true);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const toggleMuted = () => {
|
|
164
|
+
if (videoRef.current)
|
|
165
|
+
videoRef.current.muted = !videoRef.current.muted;
|
|
166
|
+
};
|
|
167
|
+
const changeVolume = (delta) => {
|
|
168
|
+
if (videoRef.current)
|
|
169
|
+
videoRef.current.volume = Math.min(Math.max(videoRef.current.volume + delta, 0), 1);
|
|
170
|
+
};
|
|
171
|
+
const restartInteractionIdle = () => {
|
|
172
|
+
resetInteractionIdle();
|
|
173
|
+
if (!videoRef.current?.paused)
|
|
174
|
+
interactionTimer =
|
|
175
|
+
window?.setTimeout(() => {
|
|
176
|
+
setInteractionIdle(true);
|
|
177
|
+
}, hideUIInteractionDelay) || null;
|
|
178
|
+
};
|
|
179
|
+
const resetInteractionIdle = () => {
|
|
180
|
+
clearTimeout(interactionTimer);
|
|
181
|
+
if (interactionIdle)
|
|
182
|
+
setInteractionIdle(false);
|
|
183
|
+
};
|
|
184
|
+
const handlePlaybackState = () => {
|
|
185
|
+
if (!videoRef.current)
|
|
186
|
+
return;
|
|
187
|
+
if (!isReady)
|
|
188
|
+
return;
|
|
189
|
+
setVideoState(videoRef.current.paused ? 'paused' : 'playing');
|
|
190
|
+
};
|
|
191
|
+
const handleLoadingProgress = () => {
|
|
192
|
+
if (!videoRef.current)
|
|
193
|
+
return;
|
|
194
|
+
const progress = videoRef.current.buffered.length > 0
|
|
195
|
+
? videoRef.current.buffered.end(0) / videoRef.current.duration
|
|
196
|
+
: 0;
|
|
197
|
+
loadingProgressRef.current?.update(progress);
|
|
198
|
+
loadingProgress.current = progress;
|
|
199
|
+
if (sectionRef.current)
|
|
200
|
+
sectionRef.current.dataset.progress = Math.ceil(progress * 100).toString();
|
|
201
|
+
};
|
|
202
|
+
const handlePlaybackProgress = () => {
|
|
203
|
+
if (!videoRef.current)
|
|
204
|
+
return;
|
|
205
|
+
const progress = videoRef.current.currentTime / videoRef.current.duration;
|
|
206
|
+
playbackProgressRef.current?.update(progress);
|
|
207
|
+
if (sectionRef.current)
|
|
208
|
+
sectionRef.current.dataset.playback = Math.ceil(progress * 100).toString();
|
|
209
|
+
};
|
|
210
|
+
const handleEnded = () => {
|
|
211
|
+
if (!videoRef.current)
|
|
212
|
+
return;
|
|
213
|
+
if (!loop) {
|
|
214
|
+
setVideoState('ended');
|
|
215
|
+
videoRef.current.currentTime = 0;
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
const handleKeyUp = (e) => {
|
|
219
|
+
if (noControls)
|
|
220
|
+
return;
|
|
221
|
+
switch (e.code) {
|
|
222
|
+
case 'Space':
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
togglePlayback();
|
|
225
|
+
break;
|
|
226
|
+
case 'KeyM':
|
|
227
|
+
e.preventDefault();
|
|
228
|
+
toggleMuted();
|
|
229
|
+
break;
|
|
230
|
+
case 'KeyF':
|
|
231
|
+
e.preventDefault();
|
|
232
|
+
toggleFullscreen();
|
|
233
|
+
break;
|
|
234
|
+
case 'ArrowRight':
|
|
235
|
+
e.preventDefault();
|
|
236
|
+
seekForwards();
|
|
237
|
+
break;
|
|
238
|
+
case 'ArrowLeft':
|
|
239
|
+
e.preventDefault();
|
|
240
|
+
seekBackwards();
|
|
241
|
+
break;
|
|
242
|
+
case 'ArrowUp':
|
|
243
|
+
e.preventDefault();
|
|
244
|
+
changeVolume(0.1);
|
|
245
|
+
break;
|
|
246
|
+
case 'ArrowDown':
|
|
247
|
+
e.preventDefault();
|
|
248
|
+
changeVolume(-0.1);
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
const handleClick = () => {
|
|
253
|
+
if (videoState !== 'loading') {
|
|
254
|
+
if (playbackTimer)
|
|
255
|
+
return;
|
|
256
|
+
playbackTimer = window
|
|
257
|
+
? window.setTimeout(() => {
|
|
258
|
+
playbackTimer = null;
|
|
259
|
+
togglePlayback();
|
|
260
|
+
}, 300)
|
|
261
|
+
: null;
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
const handleDoubleClick = () => {
|
|
265
|
+
if (videoState !== 'loading') {
|
|
266
|
+
if (playbackTimer) {
|
|
267
|
+
clearTimeout(playbackTimer);
|
|
268
|
+
playbackTimer = null;
|
|
269
|
+
}
|
|
270
|
+
toggleFullscreen();
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
const handleContextMenu = (e) => {
|
|
274
|
+
if (noControls)
|
|
275
|
+
e.preventDefault();
|
|
276
|
+
};
|
|
277
|
+
const handleChapterChange = (event) => {
|
|
278
|
+
const target = event.target;
|
|
279
|
+
const activeCues = target.activeCues ? [...target.activeCues] : [];
|
|
280
|
+
const activeChapterIndex = target.cues && activeCues[0]
|
|
281
|
+
? [...target.cues].indexOf(activeCues[0])
|
|
282
|
+
: -1;
|
|
283
|
+
setActiveChapter(String(activeChapterIndex));
|
|
284
|
+
};
|
|
285
|
+
const handleChapterSelection = (selected) => {
|
|
286
|
+
if (!videoRef.current)
|
|
287
|
+
return;
|
|
288
|
+
videoRef.current.currentTime = chaptersList[selected]?.startTime
|
|
289
|
+
? chaptersList[selected].startTime + 0.01
|
|
290
|
+
: 0;
|
|
291
|
+
};
|
|
292
|
+
const handleSubsTrackChange = () => {
|
|
293
|
+
if (!videoRef.current)
|
|
294
|
+
return;
|
|
295
|
+
const activeTrack = [...videoRef.current.textTracks]
|
|
296
|
+
.filter(track => track.kind === 'subtitles' || track.kind === 'captions')
|
|
297
|
+
.find(track => track.mode === 'showing');
|
|
298
|
+
setActiveSubsTrack(activeTrack ? `${activeTrack.kind}-${activeTrack.language}` : '-1');
|
|
299
|
+
localStorage?.setItem('mediaSubsLang', activeTrack?.language || '');
|
|
300
|
+
localStorage?.setItem('mediaSubsType', activeTrack?.kind || '');
|
|
301
|
+
};
|
|
302
|
+
const handleSubsTrackSelection = (selected) => {
|
|
303
|
+
if (!videoRef.current)
|
|
304
|
+
return;
|
|
305
|
+
[...videoRef.current.textTracks]
|
|
306
|
+
.filter(track => track.kind === 'subtitles' || track.kind === 'captions')
|
|
307
|
+
.forEach(track => {
|
|
308
|
+
track.mode =
|
|
309
|
+
selected === `${track.kind}-${track.language}` ? 'showing' : 'hidden';
|
|
310
|
+
});
|
|
311
|
+
};
|
|
312
|
+
const handleFullscreenChange = () => {
|
|
313
|
+
if (document)
|
|
314
|
+
setIsFullscreen(!!document.fullscreenElement);
|
|
315
|
+
};
|
|
316
|
+
return (jsxs("section", { ref: sectionRef, className: clsx(styles['responsive-video'], styles[`fit-${fit}`], videoState === 'loading' && styles['is-loading'], isReady && styles['is-ready'], isStarted && styles['is-started'], videoState === 'playing' && styles['is-playing'], interactionIdle && styles['is-interaction-idle'], hideControlsPlaying && styles['hide-controls-playing'], noControls && styles['no-controls'], className), "data-loading": videoState === 'loading', "data-playing": isPlaying, "data-ready": isReady, "data-test-selector": dataTestSelector, lang: lang, onFocus: restartInteractionIdle, onKeyUp: handleKeyUp, onMouseMove: restartInteractionIdle, style: {
|
|
317
|
+
'--h': dimensions().height
|
|
318
|
+
? Math.round(dimensions().height || 0)
|
|
319
|
+
: undefined,
|
|
320
|
+
'--w': dimensions().width
|
|
321
|
+
? Math.round(dimensions().width || 0)
|
|
322
|
+
: undefined,
|
|
323
|
+
}, children: [showControls && !noControls && (jsxs(MediaControls, { className: styles['controls'], secondary: jsxs(Fragment, { children: [showVolumeControl && isStarted && (
|
|
324
|
+
// Volume control
|
|
325
|
+
jsx(MediaVolumeControl, { mediaRef: videoRef, muted: muted, size: "md", theme: theme })), showSubtitlesSelection &&
|
|
326
|
+
Object.keys(subsTrackList).length > 0 &&
|
|
327
|
+
isStarted && (
|
|
328
|
+
// Subtitles/captions selection
|
|
329
|
+
jsx(MediaSubsControl, { label: t('Subtitles and captions'), onChange: handleSubsTrackSelection, options: subsTrackList, selectedOption: activeSubsTrack, size: "md", theme: theme, title: t('Subtitles and captions') })), showChapterSelection &&
|
|
330
|
+
Object.keys(chaptersList).length > 0 &&
|
|
331
|
+
isStarted && (
|
|
332
|
+
// Chapters selection
|
|
333
|
+
jsx(MediaChaptersControl, { label: t('Chapters'), onChange: handleChapterSelection, options: chaptersList, selectedOption: activeChapter, size: "md", theme: theme, title: t('Chapters') }))] }), tertiary: supportFullscreenControl &&
|
|
334
|
+
showFullscreenControl &&
|
|
335
|
+
isStarted && ( // Fullscreen toggle
|
|
336
|
+
jsx(MediaControl, { "data-test-selector": "video-fullscreen", disabled: controlsDisabled, icon: isFullscreen ? 'MediaExitFullscreen' : 'MediaEnterFullscreen', label: t('Toggle fullscreen'), onClick: toggleFullscreen, size: "sm", theme: theme, title: t('Toggle fullscreen') })), children: [showSeekControls && isStarted && (
|
|
337
|
+
// Seek backwards
|
|
338
|
+
jsx(MediaSeekControl, { "data-test-selector": "video-seek-backwards-button", direction: "backwards", disabled: controlsDisabled, onClick: seekBackwards, size: "md", step: seekStep, theme: theme })), jsx(MediaControl, { "data-test-selector": "video-play-button", disabled: controlsDisabled, icon: isPlaying ? 'MediaPause' : 'MediaPlay', label: isPlaying ? t('Pause') : t('Play'), onClick: togglePlayback, size: "md", theme: theme, title: isPlaying ? t('Pause') : t('Play'), children: jsxs(Fragment, { children: [isStarted && (
|
|
339
|
+
// Loading progress
|
|
340
|
+
jsx(MediaProgressCircle, { ref: loadingProgressRef, hideWhenDone: true, shimmer: true, color: "secondary", id: loadingProgressId, label: t('Loading progress'), variant: "edge" })), isStarted && (
|
|
341
|
+
// Playback progress
|
|
342
|
+
jsx(MediaProgressCircle, { ref: playbackProgressRef, label: t('Playback progress'), variant: "edge" }))] }) }), showSeekControls && isStarted && (
|
|
343
|
+
// Seek forwards
|
|
344
|
+
jsx(MediaSeekControl, { "data-test-selector": "video-seek-forwards-button", direction: "forwards", disabled: controlsDisabled, onClick: seekForwards, size: "md", step: seekStep, theme: theme }))] })), posterImage && (jsx("button", { className: styles['poster-image'], disabled: controlsDisabled, onClick: togglePlayback, tabIndex: -1, type: "button", children: jsx(ResponsiveImage, { "data-test-selector": "video-poster-image", fit: "cover", focusPoint: posterFocusPoint, loadingEffect: loadingEffect, onLoad: () => setIsPosterImageLoaded(true), sizes: "100vw", src: posterImage }) })), jsxs("video", { ref: videoRef, disablePictureInPicture: true, "aria-busy": videoState === 'loading', "aria-describedby": videoState === 'loading' ? loadingProgressId : descriptionId, autoPlay: autoplay, className: styles['video'], controls: false, height: dimensions().height ? Math.round(dimensions().height || 0) : undefined, id: videoId, loop: loop, muted: autoplay || muted, onClick: handleClick, onContextMenu: handleContextMenu, onDoubleClick: handleDoubleClick, onEnded: handleEnded, onLoadedMetadata: readyFn, onPause: handlePlaybackState, onPlay: handlePlaybackState, onProgress: handleLoadingProgress, onTimeUpdate: handlePlaybackProgress,
|
|
345
|
+
// onVolumeChange={handleVolumeChange}
|
|
346
|
+
playsInline: true, preload: "auto", tabIndex: 0, width: dimensions().width ? Math.round(dimensions().width || 0) : undefined, children: [jsx("source", { src: src, type: filetype }), chapters && showChapterSelection && (
|
|
347
|
+
// Chapters track
|
|
348
|
+
jsx("track", { kind: "chapters", label: t('Chapters'), src: chapters, srcLang: lang })), subtitles &&
|
|
349
|
+
showSubtitlesSelection &&
|
|
350
|
+
Object.entries(subtitles).map(([lang, src]) => (
|
|
351
|
+
// Subtitles tracks
|
|
352
|
+
jsx("track", { default: localStorage?.getItem('mediaSubsLang') === lang &&
|
|
353
|
+
localStorage.getItem('mediaSubsType') === 'subtitles'
|
|
354
|
+
? true
|
|
355
|
+
: undefined, kind: "subtitles", label: t(`clselector.language.${lang}.${lang}`), lang: lang, src: src, srcLang: lang }, lang))), captions &&
|
|
356
|
+
showSubtitlesSelection &&
|
|
357
|
+
Object.entries(captions).map(([lang, src]) => (
|
|
358
|
+
// Captions tracks
|
|
359
|
+
jsx("track", { default: localStorage?.getItem('mediaSubsLang') === lang &&
|
|
360
|
+
localStorage.getItem('mediaSubsType') === 'captions'
|
|
361
|
+
? true
|
|
362
|
+
: undefined, kind: "captions", label: t(`clselector.language.${lang}.${lang}`), lang: lang, src: src, srcLang: lang }, lang)))] }), ariaDescription && (jsx("div", { className: styles['aria-description'], id: descriptionId, children: ariaDescription }))] }));
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export { ResponsiveVideo };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"responsive-video":"responsive-video-module-wA0rs","video":"responsive-video-module-ox2ZD","controls":"responsive-video-module-HaFqA","poster-image":"responsive-video-module-ovmwO","aria-description":"responsive-video-module-D3csa","fit-cover":"responsive-video-module-bngmd","no-controls":"responsive-video-module-XcFaB","is-ready":"responsive-video-module-Rf2JO","is-started":"responsive-video-module-FhXOB","is-playing":"responsive-video-module-W7e-C","hide-controls-playing":"responsive-video-module-QMHiI","is-interaction-idle":"responsive-video-module-xaCYP"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -30,7 +30,7 @@ function Dialog({ allowClose = true, allowSubmit = true, cancelLabel = 'Close',
|
|
|
30
30
|
})
|
|
31
31
|
: footer }), header: jsxs(Fragment, { children: [!hideTitle && (jsx(Heading, { className: clsx(styles.heading, typeof className === 'string'
|
|
32
32
|
? undefined
|
|
33
|
-
: className?.heading), size: "
|
|
33
|
+
: className?.heading), size: "xxl", tag: "h2", children: title })), hasCloseButton && (jsx(IconButton, { className: styles.close, icon: "Close", isDisabled: !allowClose, label: t('Close'), onClick: close }))] }), onSubmit: onSubmit, validationErrors: validationErrors, children: jsx("div", { className: clsx(styles.content, typeof className === 'string' ? undefined : className?.content), children: children instanceof Function ? children({ close }) : children }) })) }) }));
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export { Dialog };
|
|
@@ -58,7 +58,7 @@ const NavigationMenu = ({ allowBack, back, children, className, header, id, isNa
|
|
|
58
58
|
};
|
|
59
59
|
NavigationMenu.displayName = 'NavigationMenu';
|
|
60
60
|
function PanelNavigation({ allowBack, children, className, 'data-test-selector': dataTestSelector, header, id, isNarrow, linkItems, variant, }) {
|
|
61
|
-
return (jsx("section", { className: clsx(styles['panel-navigation'], className), "data-test-selector": dataTestSelector, id: id, children: jsx(CascadingComponentContainer, { children: jsx("div", { className: clsx(styles['panels'], isNarrow && styles['narrow']), children: jsx(NavigationMenu, { allowBack: allowBack, className: children ? styles['top-panel'] : undefined, header: header, id: "panel-navigation-first-level", isNarrow: isNarrow, linkItems: linkItems, scrollable: children ? false : undefined, variant: variant, children: children }) }) }) }));
|
|
61
|
+
return (jsx("section", { className: clsx(styles['panel-navigation'], className), "data-test-selector": dataTestSelector, id: id, children: jsx(CascadingComponentContainer, { children: jsx("div", { className: clsx(styles['panels'], isNarrow && styles['narrow']), children: jsx(NavigationMenu, { allowBack: allowBack, className: clsx(styles['menu'], children ? styles['top-panel'] : undefined), header: header, id: "panel-navigation-first-level", isNarrow: isNarrow, linkItems: linkItems, scrollable: children ? false : undefined, variant: variant, children: children }) }) }) }));
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
export { PanelNavigation };
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { AnnouncementObject } from '../../shared/model/announcement';
|
|
2
2
|
export declare function AnnouncementList({ announcements, className, onDismiss, sticky, }: {
|
|
3
|
+
/**
|
|
4
|
+
* The announcements to show on load — already narrowed to the current
|
|
5
|
+
* start/end window and to what the viewer has not dismissed before, both of
|
|
6
|
+
* which the caller does.
|
|
7
|
+
*
|
|
8
|
+
* Dismissing does not come back through here: an announcement closes itself
|
|
9
|
+
* and stays in the DOM, inert, so there is nothing for the caller to remove.
|
|
10
|
+
*/
|
|
3
11
|
announcements: AnnouncementObject[];
|
|
4
12
|
className?: string;
|
|
5
|
-
|
|
13
|
+
/** Called with the announcement's id when the viewer closes it. May be async. */
|
|
14
|
+
onDismiss?: (id: string) => void | Promise<void>;
|
|
6
15
|
sticky?: boolean;
|
|
7
16
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useRef, useState } from 'react';
|
|
4
|
-
import { TransitionGroup, CSSTransition } from 'react-transition-group';
|
|
5
3
|
import clsx from 'clsx';
|
|
6
4
|
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
7
5
|
import { useResizeObserver } from '../../shared/hooks/use-resize-observer.js';
|
|
8
6
|
import { Announcement } from './announcement.js';
|
|
9
|
-
import { useFilterAnnouncements } from './use-filter-announcements.js';
|
|
10
7
|
import styles from './announcement-list.module.css.js';
|
|
11
8
|
|
|
12
9
|
function AnnouncementList({ announcements, className, onDismiss, sticky, }) {
|
|
13
10
|
const t = useFormattedMessage();
|
|
14
|
-
const filteredAnnouncements = useFilterAnnouncements(announcements);
|
|
15
|
-
const nodeRef = useRef(null);
|
|
16
|
-
const [isInitialized, setIsInitialized] = useState(false);
|
|
17
11
|
const { ref: announcementRef } = useResizeObserver((_, size) => {
|
|
18
12
|
const height = size.height;
|
|
19
13
|
document?.documentElement.style.setProperty('--announcements-height', `${height}px`);
|
|
20
|
-
setIsInitialized(true);
|
|
21
14
|
});
|
|
22
|
-
return (jsx("header", { ref: announcementRef, "aria-label": t('Announcements'), className: clsx(styles['announcement-list'], sticky && styles['sticky'],
|
|
23
|
-
enter: styles['enter'],
|
|
24
|
-
enterActive: styles['enter-active'],
|
|
25
|
-
exit: styles['exit'],
|
|
26
|
-
exitActive: styles['exit-active'],
|
|
27
|
-
}, nodeRef: nodeRef, timeout: 250, children: jsx(Announcement, { ref: nodeRef, announcement: announcement, className: styles['list-item'], onDismiss: onDismiss }) }, announcement.id))) }) }));
|
|
15
|
+
return (jsx("header", { ref: announcementRef, "aria-label": t('Announcements'), className: clsx(styles['announcement-list'], sticky && styles['sticky'], className), "data-test-selector": "announcementList", children: jsx("div", { className: styles['list'], role: "list", children: announcements.map(announcement => (jsx(Announcement, { announcement: announcement, className: styles['list-item'], onDismiss: onDismiss }, announcement.id))) }) }));
|
|
28
16
|
}
|
|
29
17
|
|
|
30
18
|
export { AnnouncementList };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var styles = {"announcement-list":"announcement-list-module-Nn6HC","
|
|
1
|
+
var styles = {"announcement-list":"announcement-list-module-Nn6HC","sticky":"announcement-list-module-icXq8","list":"announcement-list-module-cgFNU","list-item":"announcement-list-module-fUupi"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
@@ -2,6 +2,17 @@ import { AnnouncementObject } from '../../shared/model/announcement';
|
|
|
2
2
|
export interface AnnouncementProps {
|
|
3
3
|
announcement: AnnouncementObject;
|
|
4
4
|
className?: string;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Called with the announcement's id when the viewer closes it. May be async —
|
|
7
|
+
* a server action, say.
|
|
8
|
+
*
|
|
9
|
+
* Closing is the announcement's own business: it collapses itself and stays
|
|
10
|
+
* in the DOM, inert. Nothing here needs the caller to remove it, and a caller
|
|
11
|
+
* that does remove it cuts the animation short.
|
|
12
|
+
*/
|
|
13
|
+
onDismiss?: (id: string) => void | Promise<void>;
|
|
6
14
|
}
|
|
7
|
-
export declare const Announcement:
|
|
15
|
+
export declare const Announcement: {
|
|
16
|
+
({ announcement: { countryGate, href, id, subType, text, title, type }, className, onDismiss, }: AnnouncementProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { useState, useTransition } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { CloseButton } from '../../buttons/close-button/close-button.js';
|
|
6
6
|
import { Link } from '../../buttons/link/link.js';
|
|
7
7
|
import { Icon } from '../../icon/icon.js';
|
|
8
8
|
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
9
|
-
import { multiRef } from '../../shared/utils/refs.js';
|
|
10
9
|
import styles from './announcement.module.css.js';
|
|
11
10
|
|
|
12
11
|
const iconMap = {
|
|
@@ -18,11 +17,20 @@ const iconMap = {
|
|
|
18
17
|
notice: jsx(Icon, { name: "NoticeSolid" }),
|
|
19
18
|
sales: jsx(Icon, { name: "SaleSolid" }),
|
|
20
19
|
};
|
|
21
|
-
const Announcement =
|
|
20
|
+
const Announcement = ({ announcement: { countryGate, href, id, subType, text, title, type }, className, onDismiss, }) => {
|
|
22
21
|
const t = useFormattedMessage();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})
|
|
22
|
+
const [isDismissed, setIsDismissed] = useState(false);
|
|
23
|
+
const [, startTransition] = useTransition();
|
|
24
|
+
return (jsx("div", { className: clsx(styles.announcement, styles[type], styles[subType], className), "data-country-gate": countryGate, "data-dismissed": isDismissed || undefined, "data-id": id, "data-sub-type": subType, "data-test-selector": "announcement", "data-type": type, inert: isDismissed, role: "listitem", children: jsxs("div", { className: styles.wrapper, children: [jsx("div", { className: styles.icon, role: "presentation", children: iconMap[subType] }), jsxs("div", { className: styles.content, children: [jsx("h2", { className: styles.title, "data-test-selector": "announcementTitle", children: title }), text &&
|
|
25
|
+
(href ? (jsxs(Link, { className: styles.link, "data-test-selector": "announcementLink", href: href, children: [text, jsx(Icon, { name: "ArrowRight", size: "xxs" })] })) : (jsx("p", { className: styles.text, children: text })))] }), jsx(CloseButton, { className: styles['close'], "data-test-selector": `announcement-${title}-close`, label: t('Close and don’t show again'), onClick: () => {
|
|
26
|
+
// Urgent, so the collapse starts on this frame; only the caller's
|
|
27
|
+
// side of it — a server action, typically — is the transition.
|
|
28
|
+
setIsDismissed(true);
|
|
29
|
+
startTransition(async () => {
|
|
30
|
+
await onDismiss?.(id);
|
|
31
|
+
});
|
|
32
|
+
}, size: "sm", theme: type === 'promo' ? 'light' : undefined })] }) }));
|
|
33
|
+
};
|
|
26
34
|
Announcement.displayName = 'Announcement';
|
|
27
35
|
|
|
28
36
|
export { Announcement };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AnnouncementObject } from '../../../shared/model/announcement';
|
|
2
|
+
/**
|
|
3
|
+
* What `<AnnouncementList>` actually receives in the app: the CMS set, already
|
|
4
|
+
* narrowed to the current start/end window and to what the viewer has not
|
|
5
|
+
* dismissed. Both of those filters run on the server, so nothing here repeats
|
|
6
|
+
* them — the dates are carried only because they are part of the model.
|
|
7
|
+
*
|
|
8
|
+
* Relative to load rather than hardcoded, so the window stays open whenever a
|
|
9
|
+
* story happens to run.
|
|
10
|
+
*/
|
|
11
|
+
export declare const announcements: AnnouncementObject[];
|
|
12
|
+
/**
|
|
13
|
+
* The announcements bar as a page renders it, for stories that need one in the
|
|
14
|
+
* layout rather than as their subject.
|
|
15
|
+
*
|
|
16
|
+
* `onDismiss` only waits: dismissal is a server action in the app, and the
|
|
17
|
+
* point here is that it is slow and async. `<AnnouncementList>` keeps a
|
|
18
|
+
* dismissed announcement collapsed by itself, so there is no state to hold.
|
|
19
|
+
*/
|
|
20
|
+
export declare function FixtureAnnouncementList({ className }: {
|
|
21
|
+
className?: string;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const announcements: import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const countryLanguage: import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const footer: import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const header: import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const hero: import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const shortHero: import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const postAside: import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const breadcrumb: import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const smallRichTextSection: import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const largeRichTextSection: import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const genericPageSection: import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const narrowPageSection: import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const widePageSection: import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const fullPageSection: import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const widgets: import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { ResponsiveImage } from '../media/responsive-image/responsive-image.js';
|
|
6
|
+
import { useResizeObserver } from '../shared/hooks/use-resize-observer.js';
|
|
7
|
+
import { Heading } from '../typography/heading/heading.js';
|
|
8
|
+
import styles from './page-layout.module.css.js';
|
|
9
|
+
|
|
10
|
+
function PageLayout(props) {
|
|
11
|
+
const { aside, asideSticky, bgImageSrc, breadcrumb, children, className, 'data-test-selector': dataTestSelector, header, hero, mirror, postAside, preAside, title, titleHAlign = 'start', titleHidden, type = 'default', } = props;
|
|
12
|
+
const { ref: pageLayoutRef } = useResizeObserver((_, size) => {
|
|
13
|
+
const height = size.height;
|
|
14
|
+
document?.documentElement.style.setProperty('--page-layout-height', `${height}px`);
|
|
15
|
+
});
|
|
16
|
+
const isGateway = useMemo(() => {
|
|
17
|
+
return ['gateway'].includes(type);
|
|
18
|
+
}, [type]);
|
|
19
|
+
const headingSize = useMemo(() => {
|
|
20
|
+
if ([
|
|
21
|
+
'text-page',
|
|
22
|
+
'utility',
|
|
23
|
+
'gateway',
|
|
24
|
+
'dual-columns',
|
|
25
|
+
'dual-columns-wide',
|
|
26
|
+
].includes(type))
|
|
27
|
+
return 'xxxl';
|
|
28
|
+
return 'xxl';
|
|
29
|
+
}, [type]);
|
|
30
|
+
return (jsxs("div", { ref: pageLayoutRef, className: clsx(styles['page-layout'], styles[type], mirror && styles['mirrored'], `page-layout-${type}`, className), "data-test-selector": dataTestSelector, children: [jsxs("header", { className: clsx(styles['title'], styles[`h-align-${titleHAlign}`], titleHidden && styles['hidden']), children: [jsx(Heading, { italic: true, size: headingSize, tag: "h1", children: title }), header] }), breadcrumb && jsx("nav", { className: styles['breadcrumb'], children: breadcrumb }), hero && (jsx("header", { className: clsx(styles['hero'], 'page-layout-hero'), children: hero })), preAside && (jsx("aside", { className: clsx(styles['pre-aside'], 'page-layout-pre-aside'), children: preAside })), jsx("main", { className: clsx(styles['main'], 'page-layout-main'), children: children }), aside && (jsx("aside", { className: clsx(styles['aside'], asideSticky && styles['sticky'], asideSticky && 'page-layout-sticky-aside', 'page-layout-aside'), children: aside })), isGateway && bgImageSrc && (jsx("div", { className: styles['background-image'], role: "presentation", children: jsx(ResponsiveImage, { className: styles['image'], fit: "cover", sizes: "100vw", src: bgImageSrc }) })), postAside && (jsx("footer", { className: clsx(styles['post-aside'], 'page-layout-post-aside'), children: postAside }))] }));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { PageLayout };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"page-layout":"page-layout-module-0fixj","page-layout-scroll-y":"page-layout-module-BR-8D","aside":"page-layout-module-98laG","hero":"page-layout-module-J6goO","main":"page-layout-module-0R6na","post-aside":"page-layout-module-2rZfw","pre-aside":"page-layout-module-86yp-","breadcrumb":"page-layout-module-kKUTi","title":"page-layout-module-o4vfM","hidden":"page-layout-module-nZIsn","h-align-center":"page-layout-module-Dfq2O","sku":"page-layout-module-wiWFC","default":"page-layout-module-YmcYH","homepage":"page-layout-module-1XAJZ","text-page":"page-layout-module-UYwnK","product-details":"page-layout-module-pQBeK","product-listing":"page-layout-module-eNrjr","account":"page-layout-module-SSTKW","check-out":"page-layout-module-0QN9t","sticky":"page-layout-module-lk2zD","utility":"page-layout-module-FHdS-","gateway":"page-layout-module-5mBJl","background-image":"page-layout-module-ybVsV","image":"page-layout-module-kwzM3","dual-columns":"page-layout-module-n7eh8","dual-columns-wide":"page-layout-module-YyRWc","mirrored":"page-layout-module-DtoXL"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|