@arc-ui/components 12.0.0 → 13.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/lib/Alert/styles.css +1 -1
- package/lib/Align/styles.css +1 -1
- package/lib/AppButton/styles.css +1 -1
- package/lib/Avatar/styles.css +1 -1
- package/lib/AvatarGroup/styles.css +1 -1
- package/lib/Badge/styles.css +1 -1
- package/lib/Banner/Banner.cjs +3 -3
- package/lib/Banner/Banner.mjs +3 -3
- package/lib/Box/styles.css +1 -1
- package/lib/BrandLogo/styles.css +1 -1
- package/lib/Breadcrumbs/Breadcrumbs.cjs +7 -7
- package/lib/Breadcrumbs/Breadcrumbs.mjs +7 -7
- package/lib/Breadcrumbs/styles.css +1 -1
- package/lib/Button/Button.cjs +1 -1
- package/lib/Button/Button.mjs +1 -1
- package/lib/Button/styles.css +1 -1
- package/lib/ButtonGroup/ButtonGroup.cjs +6 -3
- package/lib/ButtonGroup/ButtonGroup.mjs +6 -3
- package/lib/ButtonGroup/styles.css +1 -1
- package/lib/ButtonV2/ButtonV2.cjs +1 -1
- package/lib/ButtonV2/ButtonV2.mjs +1 -1
- package/lib/ButtonV2/styles.css +1 -1
- package/lib/Calendar/Calendar.cjs +6 -6
- package/lib/Calendar/Calendar.mjs +6 -6
- package/lib/Calendar/styles.css +1 -1
- package/lib/CardFooter/styles.css +1 -1
- package/lib/CardHeading/CardHeading.cjs +1 -1
- package/lib/CardHeading/CardHeading.mjs +1 -1
- package/lib/CardHeading/styles.css +1 -1
- package/lib/Carousel/Carousel.cjs +348 -8
- package/lib/Carousel/Carousel.mjs +348 -8
- package/lib/Carousel/styles.css +1 -1
- package/lib/Checkbox/Checkbox.cjs +7 -7
- package/lib/Checkbox/Checkbox.mjs +8 -8
- package/lib/Checkbox/styles.css +1 -1
- package/lib/CheckboxIcon/CheckboxIcon.cjs +1 -1
- package/lib/CheckboxIcon/CheckboxIcon.mjs +1 -1
- package/lib/CheckboxIcon/styles.css +1 -1
- package/lib/Columns/styles.css +1 -1
- package/lib/ComboBox/ComboBox.cjs +13 -13
- package/lib/ComboBox/ComboBox.mjs +14 -14
- package/lib/ComboBox/styles.css +1 -1
- package/lib/ContentSwitcher/ContentSwitcher.cjs +1 -1
- package/lib/ContentSwitcher/ContentSwitcher.mjs +4 -4
- package/lib/ContentSwitcher/styles.css +1 -1
- package/lib/ContentSwitcherDropdown/ContentSwitcherDropdown.cjs +7 -7
- package/lib/ContentSwitcherDropdown/ContentSwitcherDropdown.mjs +7 -7
- package/lib/ContentSwitcherDropdown/styles.css +1 -1
- package/lib/DatePicker/DatePicker.cjs +18 -18
- package/lib/DatePicker/DatePicker.mjs +19 -19
- package/lib/DatePicker/styles.css +1 -1
- package/lib/Disclosure/styles.css +1 -1
- package/lib/DisclosureMini/styles.css +1 -1
- package/lib/Download/styles.css +1 -1
- package/lib/Drawer/Drawer.cjs +36 -28
- package/lib/Drawer/Drawer.mjs +36 -28
- package/lib/Drawer/styles.css +1 -1
- package/lib/Elevation/styles.css +1 -1
- package/lib/Filter/styles.css +1 -1
- package/lib/FormControl/styles.css +1 -1
- package/lib/GhostedHeroBanner/GhostedHeroBanner.cjs +2 -2
- package/lib/GhostedHeroBanner/GhostedHeroBanner.mjs +2 -2
- package/lib/GhostedHeroBanner/styles.css +1 -1
- package/lib/GradientPageBackground/GradientPageBackground.cjs +3 -3
- package/lib/GradientPageBackground/GradientPageBackground.mjs +3 -3
- package/lib/GradientPageBackground/styles.css +1 -1
- package/lib/Grid/styles.css +1 -1
- package/lib/Group/styles.css +1 -1
- package/lib/Heading/styles.css +1 -1
- package/lib/HeroBanner/HeroBanner.cjs +3 -3
- package/lib/HeroBanner/HeroBanner.mjs +3 -3
- package/lib/HeroBanner/styles.css +1 -1
- package/lib/HeroButton/HeroButton.cjs +3 -3
- package/lib/HeroButton/HeroButton.mjs +4 -4
- package/lib/HeroButton/styles.css +1 -1
- package/lib/Hidden/styles.css +1 -1
- package/lib/HorizontalCard/HorizontalCard.cjs +1 -1
- package/lib/HorizontalCard/HorizontalCard.mjs +1 -1
- package/lib/HorizontalCard/styles.css +1 -1
- package/lib/Icon/styles.css +1 -1
- package/lib/Image/styles.css +1 -1
- package/lib/ImpactCard/ImpactCard.cjs +4 -4
- package/lib/ImpactCard/ImpactCard.mjs +4 -4
- package/lib/ImpactCard/styles.css +1 -1
- package/lib/InformationCard/InformationCard.cjs +7 -7
- package/lib/InformationCard/InformationCard.mjs +7 -7
- package/lib/InformationCard/styles.css +1 -1
- package/lib/Link/styles.css +1 -1
- package/lib/Markup/styles.css +1 -1
- package/lib/MediaCard/MediaCard.cjs +5 -5
- package/lib/MediaCard/MediaCard.mjs +5 -5
- package/lib/MediaCard/styles.css +1 -1
- package/lib/Menu/Menu.cjs +17 -16
- package/lib/Menu/Menu.mjs +17 -16
- package/lib/Menu/styles.css +1 -1
- package/lib/Modal/Modal.cjs +7 -7
- package/lib/Modal/Modal.mjs +7 -7
- package/lib/Modal/styles.css +1 -1
- package/lib/NavigationHeader/NavigationHeader.cjs +38 -50
- package/lib/NavigationHeader/NavigationHeader.mjs +39 -51
- package/lib/NavigationHeader/styles.css +1 -1
- package/lib/Pagination/styles.css +1 -1
- package/lib/PaginationSimple/styles.css +1 -1
- package/lib/Popover/Popover.cjs +7 -7
- package/lib/Popover/Popover.mjs +7 -7
- package/lib/Popover/styles.css +1 -1
- package/lib/Poster/styles.css +1 -1
- package/lib/ProgressBar/ProgressBar.cjs +2 -2
- package/lib/ProgressBar/ProgressBar.mjs +2 -2
- package/lib/ProgressBar/styles.css +1 -1
- package/lib/ProgressStepper/ProgressStepper.cjs +2 -2
- package/lib/ProgressStepper/ProgressStepper.mjs +2 -2
- package/lib/ProgressStepper/styles.css +1 -1
- package/lib/ProgressStepperOverflow/ProgressStepperOverflow.cjs +76 -121
- package/lib/ProgressStepperOverflow/ProgressStepperOverflow.mjs +77 -123
- package/lib/ProgressStepperOverflow/styles.css +1 -1
- package/lib/RadioCardGroup/RadioCardGroup.cjs +12 -8
- package/lib/RadioCardGroup/RadioCardGroup.mjs +12 -8
- package/lib/RadioCardGroup/styles.css +1 -1
- package/lib/RadioGroup/RadioGroup.cjs +6 -6
- package/lib/RadioGroup/RadioGroup.mjs +7 -7
- package/lib/RadioGroup/styles.css +1 -1
- package/lib/Rule/Rule.cjs +1 -1
- package/lib/Rule/Rule.mjs +1 -1
- package/lib/Rule/styles.css +1 -1
- package/lib/ScrollToTop/ScrollToTop.cjs +1 -1
- package/lib/ScrollToTop/ScrollToTop.mjs +1 -1
- package/lib/ScrollToTop/styles.css +1 -1
- package/lib/Section/styles.css +1 -1
- package/lib/Select/Select.cjs +6 -6
- package/lib/Select/Select.mjs +6 -6
- package/lib/Select/styles.css +1 -1
- package/lib/SemanticHeading/styles.css +1 -1
- package/lib/SiteFooter/styles.css +1 -1
- package/lib/SiteFooterV2/SiteFooterV2.cjs +1 -1
- package/lib/SiteFooterV2/SiteFooterV2.mjs +1 -1
- package/lib/SiteFooterV2/styles.css +1 -1
- package/lib/SiteHeaderV2/SiteHeaderV2.cjs +13 -9
- package/lib/SiteHeaderV2/SiteHeaderV2.mjs +13 -9
- package/lib/SiteHeaderV2/styles.css +1 -1
- package/lib/Skeleton/styles.css +1 -1
- package/lib/SkipLink/SkipLink.cjs +2 -2
- package/lib/SkipLink/SkipLink.mjs +3 -3
- package/lib/SkipLink/styles.css +1 -1
- package/lib/Spinner/styles.css +1 -1
- package/lib/Surface/styles.css +1 -1
- package/lib/Switch/Switch.mjs +1 -1
- package/lib/Switch/styles.css +1 -1
- package/lib/TabbedBanner/TabbedBanner.cjs +9 -9
- package/lib/TabbedBanner/TabbedBanner.mjs +12 -12
- package/lib/TabbedBanner/styles.css +1 -1
- package/lib/Tabs/Tabs.mjs +3 -3
- package/lib/Tabs/styles.css +1 -1
- package/lib/Tag/styles.css +1 -1
- package/lib/TemplateBanner/TemplateBanner.cjs +1 -1
- package/lib/TemplateBanner/TemplateBanner.mjs +1 -1
- package/lib/TemplateBanner/styles.css +1 -1
- package/lib/Text/styles.css +1 -1
- package/lib/TextArea/TextArea.cjs +3 -3
- package/lib/TextArea/TextArea.mjs +4 -4
- package/lib/TextArea/styles.css +1 -1
- package/lib/TextInput/TextInput.cjs +4 -4
- package/lib/TextInput/TextInput.mjs +4 -4
- package/lib/TextInput/styles.css +1 -1
- package/lib/Theme/Theme.cjs +1 -1
- package/lib/Theme/Theme.mjs +1 -1
- package/lib/Theme/styles.css +1 -1
- package/lib/ThemeIcon/styles.css +1 -1
- package/lib/ThumbnailSignpost/ThumbnailSignpost.cjs +1 -1
- package/lib/ThumbnailSignpost/ThumbnailSignpost.mjs +1 -1
- package/lib/ThumbnailSignpost/styles.css +1 -1
- package/lib/Toast/Toast.mjs +2 -2
- package/lib/Toast/styles.css +1 -1
- package/lib/Tooltip/Tooltip.cjs +3 -3
- package/lib/Tooltip/Tooltip.mjs +3 -3
- package/lib/Tooltip/styles.css +1 -1
- package/lib/Truncate/styles.css +1 -1
- package/lib/TypographyCard/TypographyCard.cjs +4 -4
- package/lib/TypographyCard/TypographyCard.mjs +4 -4
- package/lib/TypographyCard/styles.css +1 -1
- package/lib/UniversalHeader/styles.css +1 -1
- package/lib/VerticalSpace/styles.css +1 -1
- package/lib/VideoPlayer/VideoPlayer.cjs +3 -3
- package/lib/VideoPlayer/VideoPlayer.mjs +3 -3
- package/lib/VideoPlayer/styles.css +1 -1
- package/lib/Visible/styles.css +1 -1
- package/lib/VisuallyHidden/styles.css +1 -1
- package/lib/_shared/cjs/{Button-BN4jUsg5.cjs → Button-CrevzrTg.cjs} +3 -3
- package/lib/_shared/cjs/{ButtonV2-bUu36xW8.cjs → ButtonV2-CxyploaQ.cjs} +3 -3
- package/lib/_shared/cjs/{Calendar-BvPNEvfm.cjs → Calendar-CdLn9iv6.cjs} +7 -7
- package/lib/_shared/cjs/{CardHeading-lGy1u6eD.cjs → CardHeading-C84m67_F.cjs} +2 -2
- package/lib/_shared/cjs/{CheckboxIcon-BTkdXfpp.cjs → CheckboxIcon-BzY1S_ud.cjs} +6 -5
- package/lib/_shared/cjs/{Combination-6m6aOXZq.cjs → Combination-Cm62lfyr.cjs} +1 -1
- package/lib/_shared/cjs/{ContentSwitcherDropdown-BLXyhXVS.cjs → ContentSwitcherDropdown-6IGRpV54.cjs} +2 -2
- package/lib/_shared/cjs/{ContentSwitcherList-BgAW2IhJ.cjs → ContentSwitcherList-Di7RS8ue.cjs} +28 -17
- package/lib/_shared/cjs/{Popover-CYcqjefw.cjs → Popover-BtvRErpC.cjs} +7 -4
- package/lib/_shared/cjs/{ProgressStepper-DTZQabiV.cjs → ProgressStepper-Cs6vX7Th.cjs} +19 -18
- package/lib/_shared/cjs/{Rule-jmvOpci7.cjs → Rule-essaguo_.cjs} +2 -2
- package/lib/_shared/cjs/{TemplateBanner-CzDAL0lq.cjs → TemplateBanner-DyXBKuMw.cjs} +2 -2
- package/lib/_shared/cjs/{TextInput-BHzuoI7E.cjs → TextInput-C_K2PLf5.cjs} +6 -6
- package/lib/_shared/cjs/{Tooltip-CEb7YEP2.cjs → Tooltip-CdmWvrnr.cjs} +2 -2
- package/lib/_shared/cjs/{arc-breakpoints-Cl4-g1TC.cjs → arc-breakpoints-uADxN-b4.cjs} +1 -1
- package/lib/_shared/cjs/{index-BGGFOAAx.cjs → index-BBDa9gnQ.cjs} +2 -2
- package/lib/_shared/cjs/{index-D9onmVh5.cjs → index-BDUrOKEW.cjs} +3 -3
- package/lib/_shared/cjs/{index-CklPiHsS.cjs → index-B_WZUATb.cjs} +2 -2
- package/lib/_shared/cjs/{index-B11wQrRa.cjs → index-BdJeAKfz.cjs} +1 -1
- package/lib/_shared/cjs/{index-CDVpHNP8.cjs → index-Dgn0408w.cjs} +4 -4
- package/lib/_shared/cjs/{index-DXNM3D1d.cjs → index-DlWZZNwu.cjs} +2 -2
- package/lib/_shared/cjs/{index-BWfgSvRQ.cjs → index-DsqYRMfM.cjs} +4 -4
- package/lib/_shared/cjs/{index-KrMgv4q_.cjs → index-WO7l1Mfx.cjs} +3 -3
- package/lib/_shared/cjs/{index.es-Dbvw_3_e.cjs → index.es-BAsay4oe.cjs} +1 -1
- package/lib/_shared/cjs/{use-media-query-DqZqShGX.cjs → use-media-query-BJV2IbHi.cjs} +4 -4
- package/lib/_shared/esm/{Button-DTiOFT9M.mjs → Button-Benn9Qop.mjs} +4 -4
- package/lib/_shared/esm/{ButtonV2-ByW5P8Hq.mjs → ButtonV2-CgjYgfZA.mjs} +4 -4
- package/lib/_shared/esm/{Calendar-DzsQqJlh.mjs → Calendar-CzFIMyD1.mjs} +8 -8
- package/lib/_shared/esm/{CardHeading-CfPEEmBO.mjs → CardHeading-CV14vmox.mjs} +2 -2
- package/lib/_shared/esm/{CheckboxIcon-BcVQe6mC.mjs → CheckboxIcon-CzRn1j8X.mjs} +6 -5
- package/lib/_shared/esm/{Combination-BQ4XBtF-.mjs → Combination-BW0YAEZD.mjs} +1 -1
- package/lib/_shared/esm/{ContentSwitcherDropdown-ckPG4pry.mjs → ContentSwitcherDropdown-CwoMd63a.mjs} +2 -2
- package/lib/_shared/esm/{ContentSwitcherList-i4m4nAzP.mjs → ContentSwitcherList-Bvp9Zl85.mjs} +30 -19
- package/lib/_shared/esm/{Popover-BHCEpLSa.mjs → Popover-DRQSgAog.mjs} +7 -4
- package/lib/_shared/esm/{ProgressStepper-CujHLQsm.mjs → ProgressStepper-DTPHHVFe.mjs} +20 -19
- package/lib/_shared/esm/{Rule-I1w3EaZi.mjs → Rule-Bz3QPezk.mjs} +3 -3
- package/lib/_shared/esm/{TemplateBanner-CZSTdma0.mjs → TemplateBanner-BPzuH5bz.mjs} +2 -2
- package/lib/_shared/esm/{TextInput-CZaNXVHl.mjs → TextInput-BCvKXfM_.mjs} +8 -8
- package/lib/_shared/esm/{Tooltip-BpSzN3Tx.mjs → Tooltip-DY8nS1to.mjs} +2 -2
- package/lib/_shared/esm/{arc-breakpoints-Br78xe-f.mjs → arc-breakpoints-ChQgbftE.mjs} +1 -1
- package/lib/_shared/esm/{index-u47CK8Y0.mjs → index-B3ewsmrD.mjs} +2 -2
- package/lib/_shared/esm/{index-GCEHSsY8.mjs → index-BMmvMegf.mjs} +2 -2
- package/lib/_shared/esm/{index-DXHprNQ6.mjs → index-C_mwuZg6.mjs} +1 -1
- package/lib/_shared/esm/{index-BWkI4Dwz.mjs → index-CfXVJXLq.mjs} +3 -3
- package/lib/_shared/esm/{index-CWHcEz3_.mjs → index-Cgsjp3NL.mjs} +1 -1
- package/lib/_shared/esm/{index-CN4hP3Wu.mjs → index-CjeQnMcn.mjs} +3 -3
- package/lib/_shared/esm/{index-BFKdmv_g.mjs → index-DNvlT7G_.mjs} +3 -3
- package/lib/_shared/esm/{index-Do2wfP-X.mjs → index-Dd3yZ_Kk.mjs} +4 -4
- package/lib/_shared/esm/{index-vnVJe9rH.mjs → index-Dfz5UgHo.mjs} +4 -4
- package/lib/_shared/esm/{index-Bz2JQq34.mjs → index-DkAfUbDx.mjs} +2 -2
- package/lib/_shared/esm/{index-6HtUz28p.mjs → index-Drb5ngQr.mjs} +1 -1
- package/lib/_shared/esm/{index.es-f0R-yhhl.mjs → index.es-99J0r2va.mjs} +2 -2
- package/lib/_shared/esm/{use-media-query-BmsMeo2M.mjs → use-media-query-l6Sou0dd.mjs} +4 -4
- package/lib/index.cjs +662 -346
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1063 -328
- package/lib/index.d.mts +1063 -328
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +663 -348
- package/lib/index.mjs.map +1 -1
- package/lib/styles.css +2 -2
- package/lib/use-media-query/use-media-query.cjs +1 -1
- package/lib/use-media-query/use-media-query.mjs +1 -1
- package/package.json +14 -12
- package/lib/_shared/cjs/capitalise-first-letter-CdhexpSx.cjs +0 -8
- package/lib/_shared/esm/capitalise-first-letter-Cubg2CS1.mjs +0 -6
|
@@ -1,17 +1,142 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var tslib_es6 = require('../_shared/cjs/tslib.es6-CCZ3TN_7.cjs');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var index = require('../_shared/cjs/index-CTlXMLug.cjs');
|
|
6
|
-
var
|
|
7
|
-
var useMediaQuery = require('../_shared/cjs/use-media-query-DqZqShGX.cjs');
|
|
7
|
+
var useMediaQuery = require('../_shared/cjs/use-media-query-BJV2IbHi.cjs');
|
|
8
8
|
var ThemeIcon = require('../_shared/cjs/ThemeIcon-CwYN77IF.cjs');
|
|
9
|
-
var index_es = require('../_shared/cjs/index.es-
|
|
9
|
+
var index_es = require('../_shared/cjs/index.es-BAsay4oe.cjs');
|
|
10
10
|
require('../_shared/cjs/suffix-modifier-DLUGR-yG.cjs');
|
|
11
11
|
require('../_shared/cjs/index-DR8Rkav9.cjs');
|
|
12
12
|
require('../_shared/cjs/filter-attrs-D19P2s1V.cjs');
|
|
13
13
|
require('../_shared/cjs/Surface-DIU5ciDT.cjs');
|
|
14
14
|
|
|
15
|
+
const defaultOptions$2 = {
|
|
16
|
+
active: true,
|
|
17
|
+
breakpoints: {},
|
|
18
|
+
snapped: 'is-snapped',
|
|
19
|
+
inView: 'is-in-view',
|
|
20
|
+
draggable: 'is-draggable',
|
|
21
|
+
dragging: 'is-dragging',
|
|
22
|
+
loop: 'is-loop'
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function normalizeClassNames(classNames) {
|
|
26
|
+
const normalized = Array.isArray(classNames) ? classNames : [classNames];
|
|
27
|
+
return normalized.filter(Boolean);
|
|
28
|
+
}
|
|
29
|
+
function removeClass(node, classNames) {
|
|
30
|
+
if (!node || !classNames.length) return;
|
|
31
|
+
node.classList.remove(...classNames);
|
|
32
|
+
}
|
|
33
|
+
function addClass(node, classNames) {
|
|
34
|
+
if (!node || !classNames.length) return;
|
|
35
|
+
node.classList.add(...classNames);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function ClassNames(userOptions = {}) {
|
|
39
|
+
let options;
|
|
40
|
+
let emblaApi;
|
|
41
|
+
let root;
|
|
42
|
+
let slides;
|
|
43
|
+
let snappedIndexes = [];
|
|
44
|
+
let inViewIndexes = [];
|
|
45
|
+
const selectedEvents = ['select'];
|
|
46
|
+
const draggingEvents = ['pointerDown', 'pointerUp'];
|
|
47
|
+
const inViewEvents = ['slidesInView'];
|
|
48
|
+
const classNames = {
|
|
49
|
+
snapped: [],
|
|
50
|
+
inView: [],
|
|
51
|
+
draggable: [],
|
|
52
|
+
dragging: [],
|
|
53
|
+
loop: []
|
|
54
|
+
};
|
|
55
|
+
function init(emblaApiInstance, optionsHandler) {
|
|
56
|
+
emblaApi = emblaApiInstance;
|
|
57
|
+
const {
|
|
58
|
+
mergeOptions,
|
|
59
|
+
optionsAtMedia
|
|
60
|
+
} = optionsHandler;
|
|
61
|
+
const optionsBase = mergeOptions(defaultOptions$2, ClassNames.globalOptions);
|
|
62
|
+
const allOptions = mergeOptions(optionsBase, userOptions);
|
|
63
|
+
options = optionsAtMedia(allOptions);
|
|
64
|
+
root = emblaApi.rootNode();
|
|
65
|
+
slides = emblaApi.slideNodes();
|
|
66
|
+
const {
|
|
67
|
+
watchDrag,
|
|
68
|
+
loop
|
|
69
|
+
} = emblaApi.internalEngine().options;
|
|
70
|
+
const isDraggable = !!watchDrag;
|
|
71
|
+
if (options.loop && loop) {
|
|
72
|
+
classNames.loop = normalizeClassNames(options.loop);
|
|
73
|
+
addClass(root, classNames.loop);
|
|
74
|
+
}
|
|
75
|
+
if (options.draggable && isDraggable) {
|
|
76
|
+
classNames.draggable = normalizeClassNames(options.draggable);
|
|
77
|
+
addClass(root, classNames.draggable);
|
|
78
|
+
}
|
|
79
|
+
if (options.dragging) {
|
|
80
|
+
classNames.dragging = normalizeClassNames(options.dragging);
|
|
81
|
+
draggingEvents.forEach(evt => emblaApi.on(evt, toggleDraggingClass));
|
|
82
|
+
}
|
|
83
|
+
if (options.snapped) {
|
|
84
|
+
classNames.snapped = normalizeClassNames(options.snapped);
|
|
85
|
+
selectedEvents.forEach(evt => emblaApi.on(evt, toggleSnappedClasses));
|
|
86
|
+
toggleSnappedClasses();
|
|
87
|
+
}
|
|
88
|
+
if (options.inView) {
|
|
89
|
+
classNames.inView = normalizeClassNames(options.inView);
|
|
90
|
+
inViewEvents.forEach(evt => emblaApi.on(evt, toggleInViewClasses));
|
|
91
|
+
toggleInViewClasses();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function destroy() {
|
|
95
|
+
draggingEvents.forEach(evt => emblaApi.off(evt, toggleDraggingClass));
|
|
96
|
+
selectedEvents.forEach(evt => emblaApi.off(evt, toggleSnappedClasses));
|
|
97
|
+
inViewEvents.forEach(evt => emblaApi.off(evt, toggleInViewClasses));
|
|
98
|
+
removeClass(root, classNames.loop);
|
|
99
|
+
removeClass(root, classNames.draggable);
|
|
100
|
+
removeClass(root, classNames.dragging);
|
|
101
|
+
toggleSlideClasses([], snappedIndexes, classNames.snapped);
|
|
102
|
+
toggleSlideClasses([], inViewIndexes, classNames.inView);
|
|
103
|
+
Object.keys(classNames).forEach(classNameKey => {
|
|
104
|
+
const key = classNameKey;
|
|
105
|
+
classNames[key] = [];
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function toggleDraggingClass(_, evt) {
|
|
109
|
+
const toggleClass = evt === 'pointerDown' ? addClass : removeClass;
|
|
110
|
+
toggleClass(root, classNames.dragging);
|
|
111
|
+
}
|
|
112
|
+
function toggleSlideClasses(addClassIndexes = [], removeClassIndexes = [], classNames) {
|
|
113
|
+
const removeClassSlides = removeClassIndexes.map(index => slides[index]);
|
|
114
|
+
const addClassSlides = addClassIndexes.map(index => slides[index]);
|
|
115
|
+
removeClassSlides.forEach(slide => removeClass(slide, classNames));
|
|
116
|
+
addClassSlides.forEach(slide => addClass(slide, classNames));
|
|
117
|
+
return addClassIndexes;
|
|
118
|
+
}
|
|
119
|
+
function toggleSnappedClasses() {
|
|
120
|
+
const {
|
|
121
|
+
slideRegistry
|
|
122
|
+
} = emblaApi.internalEngine();
|
|
123
|
+
const newSnappedIndexes = slideRegistry[emblaApi.selectedScrollSnap()];
|
|
124
|
+
snappedIndexes = toggleSlideClasses(newSnappedIndexes, snappedIndexes, classNames.snapped);
|
|
125
|
+
}
|
|
126
|
+
function toggleInViewClasses() {
|
|
127
|
+
const newInViewIndexes = emblaApi.slidesInView();
|
|
128
|
+
inViewIndexes = toggleSlideClasses(newInViewIndexes, inViewIndexes, classNames.inView);
|
|
129
|
+
}
|
|
130
|
+
const self = {
|
|
131
|
+
name: 'classNames',
|
|
132
|
+
options: userOptions,
|
|
133
|
+
init,
|
|
134
|
+
destroy
|
|
135
|
+
};
|
|
136
|
+
return self;
|
|
137
|
+
}
|
|
138
|
+
ClassNames.globalOptions = undefined;
|
|
139
|
+
|
|
15
140
|
function isObject$1(subject) {
|
|
16
141
|
return Object.prototype.toString.call(subject) === '[object Object]';
|
|
17
142
|
}
|
|
@@ -1463,7 +1588,7 @@ function EventHandler() {
|
|
|
1463
1588
|
return self;
|
|
1464
1589
|
}
|
|
1465
1590
|
|
|
1466
|
-
const defaultOptions = {
|
|
1591
|
+
const defaultOptions$1 = {
|
|
1467
1592
|
align: 'center',
|
|
1468
1593
|
axis: 'x',
|
|
1469
1594
|
container: null,
|
|
@@ -1547,7 +1672,7 @@ function EmblaCarousel(root, userOptions, userPlugins) {
|
|
|
1547
1672
|
const reInit = reActivate;
|
|
1548
1673
|
let destroyed = false;
|
|
1549
1674
|
let engine;
|
|
1550
|
-
let optionsBase = mergeOptions(defaultOptions, EmblaCarousel.globalOptions);
|
|
1675
|
+
let optionsBase = mergeOptions(defaultOptions$1, EmblaCarousel.globalOptions);
|
|
1551
1676
|
let options = mergeOptions(optionsBase);
|
|
1552
1677
|
let pluginList = [];
|
|
1553
1678
|
let pluginApis;
|
|
@@ -1738,6 +1863,199 @@ function useEmblaCarousel(options = {}, plugins = []) {
|
|
|
1738
1863
|
}
|
|
1739
1864
|
useEmblaCarousel.globalOptions = undefined;
|
|
1740
1865
|
|
|
1866
|
+
const defaultOptions = {
|
|
1867
|
+
active: true,
|
|
1868
|
+
breakpoints: {},
|
|
1869
|
+
delay: 4000,
|
|
1870
|
+
jump: false,
|
|
1871
|
+
playOnInit: true,
|
|
1872
|
+
stopOnFocusIn: true,
|
|
1873
|
+
stopOnInteraction: true,
|
|
1874
|
+
stopOnMouseEnter: false,
|
|
1875
|
+
stopOnLastSnap: false,
|
|
1876
|
+
rootNode: null
|
|
1877
|
+
};
|
|
1878
|
+
|
|
1879
|
+
function normalizeDelay(emblaApi, delay) {
|
|
1880
|
+
const scrollSnaps = emblaApi.scrollSnapList();
|
|
1881
|
+
if (typeof delay === 'number') {
|
|
1882
|
+
return scrollSnaps.map(() => delay);
|
|
1883
|
+
}
|
|
1884
|
+
return delay(scrollSnaps, emblaApi);
|
|
1885
|
+
}
|
|
1886
|
+
function getAutoplayRootNode(emblaApi, rootNode) {
|
|
1887
|
+
const emblaRootNode = emblaApi.rootNode();
|
|
1888
|
+
return rootNode && rootNode(emblaRootNode) || emblaRootNode;
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
function Autoplay(userOptions = {}) {
|
|
1892
|
+
let options;
|
|
1893
|
+
let emblaApi;
|
|
1894
|
+
let destroyed;
|
|
1895
|
+
let delay;
|
|
1896
|
+
let timerStartTime = null;
|
|
1897
|
+
let timerId = 0;
|
|
1898
|
+
let autoplayActive = false;
|
|
1899
|
+
let mouseIsOver = false;
|
|
1900
|
+
let playOnDocumentVisible = false;
|
|
1901
|
+
let jump = false;
|
|
1902
|
+
function init(emblaApiInstance, optionsHandler) {
|
|
1903
|
+
emblaApi = emblaApiInstance;
|
|
1904
|
+
const {
|
|
1905
|
+
mergeOptions,
|
|
1906
|
+
optionsAtMedia
|
|
1907
|
+
} = optionsHandler;
|
|
1908
|
+
const optionsBase = mergeOptions(defaultOptions, Autoplay.globalOptions);
|
|
1909
|
+
const allOptions = mergeOptions(optionsBase, userOptions);
|
|
1910
|
+
options = optionsAtMedia(allOptions);
|
|
1911
|
+
if (emblaApi.scrollSnapList().length <= 1) return;
|
|
1912
|
+
jump = options.jump;
|
|
1913
|
+
destroyed = false;
|
|
1914
|
+
delay = normalizeDelay(emblaApi, options.delay);
|
|
1915
|
+
const {
|
|
1916
|
+
eventStore,
|
|
1917
|
+
ownerDocument
|
|
1918
|
+
} = emblaApi.internalEngine();
|
|
1919
|
+
const isDraggable = !!emblaApi.internalEngine().options.watchDrag;
|
|
1920
|
+
const root = getAutoplayRootNode(emblaApi, options.rootNode);
|
|
1921
|
+
eventStore.add(ownerDocument, 'visibilitychange', visibilityChange);
|
|
1922
|
+
if (isDraggable) {
|
|
1923
|
+
emblaApi.on('pointerDown', pointerDown);
|
|
1924
|
+
}
|
|
1925
|
+
if (isDraggable && !options.stopOnInteraction) {
|
|
1926
|
+
emblaApi.on('pointerUp', pointerUp);
|
|
1927
|
+
}
|
|
1928
|
+
if (options.stopOnMouseEnter) {
|
|
1929
|
+
eventStore.add(root, 'mouseenter', mouseEnter);
|
|
1930
|
+
}
|
|
1931
|
+
if (options.stopOnMouseEnter && !options.stopOnInteraction) {
|
|
1932
|
+
eventStore.add(root, 'mouseleave', mouseLeave);
|
|
1933
|
+
}
|
|
1934
|
+
if (options.stopOnFocusIn) {
|
|
1935
|
+
emblaApi.on('slideFocusStart', stopAutoplay);
|
|
1936
|
+
}
|
|
1937
|
+
if (options.stopOnFocusIn && !options.stopOnInteraction) {
|
|
1938
|
+
eventStore.add(emblaApi.containerNode(), 'focusout', startAutoplay);
|
|
1939
|
+
}
|
|
1940
|
+
if (options.playOnInit) startAutoplay();
|
|
1941
|
+
}
|
|
1942
|
+
function destroy() {
|
|
1943
|
+
emblaApi.off('pointerDown', pointerDown).off('pointerUp', pointerUp).off('slideFocusStart', stopAutoplay);
|
|
1944
|
+
stopAutoplay();
|
|
1945
|
+
destroyed = true;
|
|
1946
|
+
autoplayActive = false;
|
|
1947
|
+
}
|
|
1948
|
+
function setTimer() {
|
|
1949
|
+
const {
|
|
1950
|
+
ownerWindow
|
|
1951
|
+
} = emblaApi.internalEngine();
|
|
1952
|
+
ownerWindow.clearTimeout(timerId);
|
|
1953
|
+
timerId = ownerWindow.setTimeout(next, delay[emblaApi.selectedScrollSnap()]);
|
|
1954
|
+
timerStartTime = new Date().getTime();
|
|
1955
|
+
emblaApi.emit('autoplay:timerset');
|
|
1956
|
+
}
|
|
1957
|
+
function clearTimer() {
|
|
1958
|
+
const {
|
|
1959
|
+
ownerWindow
|
|
1960
|
+
} = emblaApi.internalEngine();
|
|
1961
|
+
ownerWindow.clearTimeout(timerId);
|
|
1962
|
+
timerId = 0;
|
|
1963
|
+
timerStartTime = null;
|
|
1964
|
+
emblaApi.emit('autoplay:timerstopped');
|
|
1965
|
+
}
|
|
1966
|
+
function startAutoplay() {
|
|
1967
|
+
if (destroyed) return;
|
|
1968
|
+
if (documentIsHidden()) {
|
|
1969
|
+
playOnDocumentVisible = true;
|
|
1970
|
+
return;
|
|
1971
|
+
}
|
|
1972
|
+
if (!autoplayActive) emblaApi.emit('autoplay:play');
|
|
1973
|
+
setTimer();
|
|
1974
|
+
autoplayActive = true;
|
|
1975
|
+
}
|
|
1976
|
+
function stopAutoplay() {
|
|
1977
|
+
if (destroyed) return;
|
|
1978
|
+
if (autoplayActive) emblaApi.emit('autoplay:stop');
|
|
1979
|
+
clearTimer();
|
|
1980
|
+
autoplayActive = false;
|
|
1981
|
+
}
|
|
1982
|
+
function visibilityChange() {
|
|
1983
|
+
if (documentIsHidden()) {
|
|
1984
|
+
playOnDocumentVisible = autoplayActive;
|
|
1985
|
+
return stopAutoplay();
|
|
1986
|
+
}
|
|
1987
|
+
if (playOnDocumentVisible) startAutoplay();
|
|
1988
|
+
}
|
|
1989
|
+
function documentIsHidden() {
|
|
1990
|
+
const {
|
|
1991
|
+
ownerDocument
|
|
1992
|
+
} = emblaApi.internalEngine();
|
|
1993
|
+
return ownerDocument.visibilityState === 'hidden';
|
|
1994
|
+
}
|
|
1995
|
+
function pointerDown() {
|
|
1996
|
+
if (!mouseIsOver) stopAutoplay();
|
|
1997
|
+
}
|
|
1998
|
+
function pointerUp() {
|
|
1999
|
+
if (!mouseIsOver) startAutoplay();
|
|
2000
|
+
}
|
|
2001
|
+
function mouseEnter() {
|
|
2002
|
+
mouseIsOver = true;
|
|
2003
|
+
stopAutoplay();
|
|
2004
|
+
}
|
|
2005
|
+
function mouseLeave() {
|
|
2006
|
+
mouseIsOver = false;
|
|
2007
|
+
startAutoplay();
|
|
2008
|
+
}
|
|
2009
|
+
function play(jumpOverride) {
|
|
2010
|
+
if (typeof jumpOverride !== 'undefined') jump = jumpOverride;
|
|
2011
|
+
startAutoplay();
|
|
2012
|
+
}
|
|
2013
|
+
function stop() {
|
|
2014
|
+
if (autoplayActive) stopAutoplay();
|
|
2015
|
+
}
|
|
2016
|
+
function reset() {
|
|
2017
|
+
if (autoplayActive) startAutoplay();
|
|
2018
|
+
}
|
|
2019
|
+
function isPlaying() {
|
|
2020
|
+
return autoplayActive;
|
|
2021
|
+
}
|
|
2022
|
+
function next() {
|
|
2023
|
+
const {
|
|
2024
|
+
index
|
|
2025
|
+
} = emblaApi.internalEngine();
|
|
2026
|
+
const nextIndex = index.clone().add(1).get();
|
|
2027
|
+
const lastIndex = emblaApi.scrollSnapList().length - 1;
|
|
2028
|
+
const kill = options.stopOnLastSnap && nextIndex === lastIndex;
|
|
2029
|
+
if (emblaApi.canScrollNext()) {
|
|
2030
|
+
emblaApi.scrollNext(jump);
|
|
2031
|
+
} else {
|
|
2032
|
+
emblaApi.scrollTo(0, jump);
|
|
2033
|
+
}
|
|
2034
|
+
emblaApi.emit('autoplay:select');
|
|
2035
|
+
if (kill) return stopAutoplay();
|
|
2036
|
+
startAutoplay();
|
|
2037
|
+
}
|
|
2038
|
+
function timeUntilNext() {
|
|
2039
|
+
if (!timerStartTime) return null;
|
|
2040
|
+
const currentDelay = delay[emblaApi.selectedScrollSnap()];
|
|
2041
|
+
const timePastSinceStart = new Date().getTime() - timerStartTime;
|
|
2042
|
+
return currentDelay - timePastSinceStart;
|
|
2043
|
+
}
|
|
2044
|
+
const self = {
|
|
2045
|
+
name: 'autoplay',
|
|
2046
|
+
options: userOptions,
|
|
2047
|
+
init,
|
|
2048
|
+
destroy,
|
|
2049
|
+
play,
|
|
2050
|
+
stop,
|
|
2051
|
+
reset,
|
|
2052
|
+
isPlaying,
|
|
2053
|
+
timeUntilNext
|
|
2054
|
+
};
|
|
2055
|
+
return self;
|
|
2056
|
+
}
|
|
2057
|
+
Autoplay.globalOptions = undefined;
|
|
2058
|
+
|
|
1741
2059
|
var XS_BREAKPOINT = "(min-width: ".concat(index_es.ArcSizeBreakpointsXs, ")");
|
|
1742
2060
|
var S_BREAKPOINT = "(min-width: ".concat(index_es.ArcSizeBreakpointsS, ")");
|
|
1743
2061
|
var M_BREAKPOINT = "(min-width: ".concat(index_es.ArcSizeBreakpointsM, ")");
|
|
@@ -1812,9 +2130,29 @@ var KeyNames;
|
|
|
1812
2130
|
})(KeyNames || (KeyNames = {}));
|
|
1813
2131
|
|
|
1814
2132
|
var Carousel = function (_a) {
|
|
1815
|
-
var children = _a.children, responsive = _a.responsive, _b = _a.itemsToScroll, itemsToScroll = _b === void 0 ? 1 : _b, _c = _a.itemsPerSlide, itemsPerSlide = _c === void 0 ? 1 : _c, _d = _a.withGutter, withGutter = _d === void 0 ? true : _d, _e = _a.loop, loop = _e === void 0 ? false : _e, _f = _a.isPartialVisible, isPartialVisible = _f === void 0 ? false : _f;
|
|
2133
|
+
var children = _a.children, responsive = _a.responsive, _b = _a.itemsToScroll, itemsToScroll = _b === void 0 ? 1 : _b, _c = _a.itemsPerSlide, itemsPerSlide = _c === void 0 ? 1 : _c, _d = _a.withGutter, withGutter = _d === void 0 ? true : _d, _e = _a.loop, loop = _e === void 0 ? false : _e, _f = _a.isPartialVisible, isPartialVisible = _f === void 0 ? false : _f, autoplay = _a.autoplay, isPlaying = _a.isPlaying, fade = _a.fade;
|
|
1816
2134
|
var id = React.useId();
|
|
1817
|
-
var
|
|
2135
|
+
var autoPlayOptions = autoplay
|
|
2136
|
+
? tslib_es6.__assign({ playOnInit: true, delay: 3000, stopOnInteraction: true, stopOnMouseEnter: false, stopOnFocusIn: true, stopOnLastSnap: false }, autoplay) : undefined;
|
|
2137
|
+
var _g = useEmblaCarousel(tslib_es6.__assign(tslib_es6.__assign({}, getOptions(itemsToScroll, loop, responsive)), (fade ? { inViewThreshold: 0.74 } : {})), tslib_es6.__spreadArray(tslib_es6.__spreadArray([], (autoPlayOptions ? [Autoplay(autoPlayOptions)] : []), true), (fade
|
|
2138
|
+
? [
|
|
2139
|
+
ClassNames({
|
|
2140
|
+
inView: "arc-Carousel-slide--isInView",
|
|
2141
|
+
}),
|
|
2142
|
+
]
|
|
2143
|
+
: []), true)), emblaRef = _g[0], emblaApi = _g[1];
|
|
2144
|
+
React.useEffect(function () {
|
|
2145
|
+
var _a;
|
|
2146
|
+
if (!emblaApi || !autoplay)
|
|
2147
|
+
return;
|
|
2148
|
+
var autoplayPlugin = (_a = emblaApi === null || emblaApi === void 0 ? void 0 : emblaApi.plugins()) === null || _a === void 0 ? void 0 : _a.autoplay;
|
|
2149
|
+
if (isPlaying) {
|
|
2150
|
+
autoplayPlugin.play();
|
|
2151
|
+
}
|
|
2152
|
+
if (isPlaying == false) {
|
|
2153
|
+
autoplayPlugin.stop();
|
|
2154
|
+
}
|
|
2155
|
+
}, [emblaApi, isPlaying, autoplay]);
|
|
1818
2156
|
var _h = React.useState(), dotButtonFocusIndex = _h[0], setCarouselDotButtonFocusIndex = _h[1];
|
|
1819
2157
|
var prevButtonRef = React.useRef(null);
|
|
1820
2158
|
var _j = React.useState(0), visibleSlideIndex = _j[0], setVisibleSlideIndex = _j[1];
|
|
@@ -1892,7 +2230,9 @@ var Carousel = function (_a) {
|
|
|
1892
2230
|
React.createElement("div", { ref: emblaRef, className: index.classNames("arc-Carousel-viewport", {
|
|
1893
2231
|
"arc-Carousel-viewport--gutter": withGutter,
|
|
1894
2232
|
}) },
|
|
1895
|
-
React.createElement("div", { className: "arc-Carousel-slider", role: "region", "aria-roledescription": "carousel" }, React.Children.map(children, function (child, i) { return (React.createElement("div", { onKeyDown: onSlideKeyDown, style: { flex: "0 0 ".concat(slideWidth, "%"), width: "".concat(slideWidth, "%") }, className: "arc-Carousel-slide",
|
|
2233
|
+
React.createElement("div", { className: "arc-Carousel-slider", role: "region", "aria-roledescription": "carousel" }, React.Children.map(children, function (child, i) { return (React.createElement("div", { onKeyDown: onSlideKeyDown, style: { flex: "0 0 ".concat(slideWidth, "%"), width: "".concat(slideWidth, "%") }, className: index.classNames("arc-Carousel-slide", {
|
|
2234
|
+
"arc-Carousel-slide--fade": fade,
|
|
2235
|
+
}), key: "".concat(id, "-option-").concat(i), role: "group", "aria-roledescription": "slide" }, child)); })))),
|
|
1896
2236
|
React.createElement("div", { className: "arc-Carousel-nav" },
|
|
1897
2237
|
React.createElement("button", { "data-testid": "previous-button", ref: prevButtonRef, className: index.classNames("arc-Carousel-navButton", {
|
|
1898
2238
|
"arc-Carousel-navButton--hidden": !prevButtonEnabled,
|