@arc-ui/components 12.0.0-beta.18 → 12.0.0-beta.20
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/Alert.cjs +1 -1
- package/lib/Alert/Alert.mjs +1 -1
- package/lib/Alert/styles.css +1 -1
- package/lib/Align/styles.css +1 -1
- package/lib/AppButton/styles.css +1 -1
- package/lib/Avatar/Avatar.cjs +2 -1
- package/lib/Avatar/Avatar.mjs +2 -1
- package/lib/Avatar/styles.css +1 -1
- package/lib/AvatarGroup/AvatarGroup.cjs +2 -1
- package/lib/AvatarGroup/AvatarGroup.mjs +2 -1
- package/lib/AvatarGroup/styles.css +1 -1
- package/lib/Badge/styles.css +1 -1
- package/lib/Banner/Banner.cjs +2 -3
- package/lib/Banner/Banner.mjs +2 -3
- package/lib/Box/styles.css +1 -1
- package/lib/BrandLogo/styles.css +1 -1
- package/lib/Breadcrumbs/Breadcrumbs.cjs +2 -1
- package/lib/Breadcrumbs/Breadcrumbs.mjs +2 -1
- package/lib/Breadcrumbs/styles.css +1 -1
- package/lib/Button/Button.cjs +2 -2
- package/lib/Button/Button.mjs +2 -2
- package/lib/Button/styles.css +1 -1
- package/lib/ButtonGroup/ButtonGroup.cjs +3 -3
- package/lib/ButtonGroup/ButtonGroup.mjs +3 -3
- package/lib/ButtonGroup/styles.css +1 -1
- package/lib/ButtonV2/ButtonV2.cjs +2 -2
- package/lib/ButtonV2/ButtonV2.mjs +2 -2
- package/lib/ButtonV2/styles.css +1 -1
- package/lib/Calendar/Calendar.cjs +3 -3
- package/lib/Calendar/Calendar.mjs +3 -3
- package/lib/Calendar/styles.css +1 -1
- package/lib/CardFooter/CardFooter.cjs +2 -2
- package/lib/CardFooter/CardFooter.mjs +2 -2
- package/lib/CardFooter/styles.css +1 -1
- package/lib/CardHeading/styles.css +1 -1
- package/lib/Carousel/Carousel.cjs +1 -1
- package/lib/Carousel/Carousel.mjs +1 -1
- package/lib/Carousel/styles.css +1 -1
- package/lib/Checkbox/Checkbox.cjs +2 -2
- package/lib/Checkbox/Checkbox.mjs +2 -2
- package/lib/Checkbox/styles.css +1 -1
- package/lib/Columns/styles.css +1 -1
- package/lib/ComboBox/ComboBox.cjs +3 -3
- package/lib/ComboBox/ComboBox.mjs +3 -3
- package/lib/ComboBox/styles.css +1 -1
- package/lib/ContentSwitcher/ContentSwitcher.cjs +1 -1
- package/lib/ContentSwitcher/ContentSwitcher.mjs +1 -1
- package/lib/ContentSwitcher/styles.css +1 -1
- package/lib/ContentSwitcherDropdown/ContentSwitcherDropdown.cjs +1 -1
- package/lib/ContentSwitcherDropdown/ContentSwitcherDropdown.mjs +1 -1
- package/lib/ContentSwitcherDropdown/styles.css +1 -1
- package/lib/DatePicker/DatePicker.cjs +196 -17
- package/lib/DatePicker/DatePicker.mjs +200 -17
- 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 +46 -323
- package/lib/Drawer/Drawer.mjs +44 -306
- package/lib/Drawer/styles.css +1 -1
- package/lib/Elevation/styles.css +1 -1
- package/lib/Filter/styles.css +1 -1
- package/lib/FormControl/FormControl.cjs +1 -1
- package/lib/FormControl/FormControl.mjs +1 -1
- package/lib/FormControl/styles.css +1 -1
- package/lib/GhostedHeroBanner/GhostedHeroBanner.cjs +1 -1
- package/lib/GhostedHeroBanner/GhostedHeroBanner.mjs +1 -1
- package/lib/GhostedHeroBanner/styles.css +1 -1
- package/lib/GradientPageBackground/GradientPageBackground.cjs +257 -0
- package/lib/GradientPageBackground/GradientPageBackground.mjs +237 -0
- package/lib/GradientPageBackground/styles.css +1 -0
- 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 +2 -3
- package/lib/HeroBanner/HeroBanner.mjs +2 -3
- package/lib/HeroBanner/styles.css +1 -1
- package/lib/HeroButton/HeroButton.cjs +2 -2
- package/lib/HeroButton/HeroButton.mjs +2 -2
- package/lib/HeroButton/styles.css +1 -1
- package/lib/Hidden/styles.css +1 -1
- package/lib/HorizontalCard/HorizontalCard.cjs +3 -2
- package/lib/HorizontalCard/HorizontalCard.mjs +3 -2
- package/lib/HorizontalCard/styles.css +1 -1
- package/lib/Icon/Icon.cjs +1 -1
- package/lib/Icon/Icon.mjs +1 -1
- package/lib/Icon/styles.css +1 -1
- package/lib/Image/styles.css +1 -1
- package/lib/ImpactCard/ImpactCard.cjs +7 -4
- package/lib/ImpactCard/ImpactCard.mjs +7 -4
- package/lib/ImpactCard/styles.css +1 -1
- package/lib/InformationCard/InformationCard.cjs +7 -5
- package/lib/InformationCard/InformationCard.mjs +7 -5
- package/lib/InformationCard/styles.css +1 -1
- package/lib/Link/Link.cjs +1 -1
- package/lib/Link/Link.mjs +1 -1
- package/lib/Link/styles.css +1 -1
- package/lib/Markup/styles.css +1 -1
- package/lib/MediaCard/MediaCard.cjs +3 -5
- package/lib/MediaCard/MediaCard.mjs +3 -5
- package/lib/MediaCard/styles.css +1 -1
- package/lib/Menu/Menu.cjs +35 -48
- package/lib/Menu/Menu.mjs +21 -34
- package/lib/Menu/styles.css +1 -1
- package/lib/Modal/Modal.cjs +2 -2
- package/lib/Modal/Modal.mjs +2 -2
- package/lib/Modal/styles.css +1 -1
- package/lib/Pagination/styles.css +1 -1
- package/lib/PaginationSimple/PaginationSimple.cjs +1 -1
- package/lib/PaginationSimple/PaginationSimple.mjs +1 -1
- package/lib/PaginationSimple/styles.css +1 -1
- package/lib/Popover/styles.css +1 -1
- package/lib/Poster/styles.css +1 -1
- package/lib/ProgressBar/styles.css +1 -1
- package/lib/ProgressStepper/ProgressStepper.cjs +10 -72
- package/lib/ProgressStepper/ProgressStepper.mjs +8 -74
- package/lib/ProgressStepper/styles.css +1 -1
- package/lib/ProgressStepperOverflow/ProgressStepperOverflow.cjs +20 -0
- package/lib/ProgressStepperOverflow/ProgressStepperOverflow.mjs +14 -0
- package/lib/ProgressStepperOverflow/styles.css +1 -0
- package/lib/RadioCardGroup/RadioCardGroup.cjs +3 -3
- package/lib/RadioCardGroup/RadioCardGroup.mjs +4 -4
- package/lib/RadioCardGroup/styles.css +1 -1
- package/lib/RadioGroup/RadioGroup.cjs +4 -5
- package/lib/RadioGroup/RadioGroup.mjs +5 -6
- package/lib/RadioGroup/styles.css +1 -1
- package/lib/Rule/styles.css +1 -1
- package/lib/ScrollToTop/ScrollToTop.cjs +5 -2
- package/lib/ScrollToTop/ScrollToTop.mjs +5 -2
- package/lib/ScrollToTop/styles.css +1 -1
- package/lib/Section/styles.css +1 -1
- package/lib/Select/Select.cjs +11 -15
- package/lib/Select/Select.mjs +12 -16
- package/lib/Select/styles.css +1 -1
- package/lib/SiteFooter/SiteFooter.cjs +10 -7
- package/lib/SiteFooter/SiteFooter.mjs +10 -7
- package/lib/SiteFooter/styles.css +1 -1
- package/lib/SiteFooterV2/SiteFooterV2.cjs +19 -22
- package/lib/SiteFooterV2/SiteFooterV2.mjs +19 -22
- package/lib/SiteFooterV2/styles.css +1 -1
- package/lib/SiteHeaderV2/SiteHeaderV2.cjs +4 -4
- package/lib/SiteHeaderV2/SiteHeaderV2.mjs +5 -5
- package/lib/SiteHeaderV2/styles.css +1 -1
- package/lib/Skeleton/styles.css +1 -1
- 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.cjs +17 -14
- package/lib/Switch/Switch.mjs +17 -14
- package/lib/Switch/styles.css +1 -1
- package/lib/TabbedBanner/TabbedBanner.cjs +9 -6
- package/lib/TabbedBanner/TabbedBanner.mjs +9 -6
- package/lib/TabbedBanner/styles.css +1 -1
- package/lib/Tabs/Tabs.cjs +1 -1
- package/lib/Tabs/Tabs.mjs +1 -1
- package/lib/Tabs/styles.css +1 -1
- package/lib/Tag/Tag.cjs +1 -1
- package/lib/Tag/Tag.mjs +1 -1
- package/lib/Tag/styles.css +1 -1
- package/lib/TemplateBanner/TemplateBanner.cjs +2 -3
- package/lib/TemplateBanner/TemplateBanner.mjs +2 -3
- package/lib/TemplateBanner/styles.css +1 -1
- package/lib/Text/styles.css +1 -1
- package/lib/TextArea/TextArea.cjs +19 -17
- package/lib/TextArea/TextArea.mjs +19 -17
- package/lib/TextArea/styles.css +1 -1
- package/lib/TextInput/TextInput.cjs +2 -2
- package/lib/TextInput/TextInput.mjs +2 -2
- 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 +5 -8
- package/lib/ThumbnailSignpost/ThumbnailSignpost.mjs +5 -8
- package/lib/ThumbnailSignpost/styles.css +1 -1
- package/lib/Toast/styles.css +1 -1
- package/lib/Tooltip/Tooltip.cjs +1 -1
- package/lib/Tooltip/Tooltip.mjs +1 -1
- package/lib/Tooltip/styles.css +1 -1
- package/lib/Truncate/styles.css +1 -1
- package/lib/TypographyCard/TypographyCard.cjs +7 -4
- package/lib/TypographyCard/TypographyCard.mjs +7 -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 +1 -1
- package/lib/VideoPlayer/VideoPlayer.mjs +1 -1
- package/lib/VideoPlayer/styles.css +1 -1
- package/lib/Visible/Visible.cjs +6 -14
- package/lib/Visible/Visible.mjs +4 -16
- package/lib/Visible/styles.css +1 -1
- package/lib/VisuallyHidden/styles.css +1 -1
- package/lib/_shared/cjs/{Avatar-CxbjOB_b.cjs → Avatar-CrUioj_6.cjs} +4 -1
- package/lib/_shared/cjs/{Button-CKTa6bQL.cjs → Button-uD9mR8w-.cjs} +1 -1
- package/lib/_shared/cjs/{ButtonV2-CRNNZ_nd.cjs → ButtonV2-Bta5SVVY.cjs} +2 -2
- package/lib/_shared/cjs/{Calendar-C5C0evEy.cjs → Calendar-D4ZSaHHU.cjs} +3 -3
- package/lib/_shared/cjs/{CardFooter-DwE-u0Om.cjs → CardFooter-ChphRFHe.cjs} +1 -1
- package/lib/_shared/cjs/{Checkbox-D2UQsmiB.cjs → Checkbox-DfZMjO1Y.cjs} +1 -1
- package/lib/_shared/cjs/{ComboBox-BIMxZhJp.cjs → ComboBox-BGUhlqx1.cjs} +2 -2
- package/lib/_shared/cjs/{ContentSwitcherDropdown-CAWaAMZN.cjs → ContentSwitcherDropdown-U5ZTbJTe.cjs} +1 -1
- package/lib/_shared/cjs/{ContentSwitcherList-I7jCZn8C.cjs → ContentSwitcherList-nlxMHXs-.cjs} +3 -2
- package/lib/_shared/cjs/{DatePicker-BgU6iidG.cjs → DatePicker-DS6fAvxD.cjs} +48 -30
- package/lib/_shared/cjs/{FormControl-D3-JbAVb.cjs → FormControl-BPnKQrCm.cjs} +19 -13
- package/lib/_shared/cjs/{HeroButton-CiIygZ16.cjs → HeroButton-CrzkTUwP.cjs} +1 -1
- package/lib/_shared/cjs/{Icon-KMACQ1i3.cjs → Icon-CzhyKqMd.cjs} +1 -1
- package/lib/_shared/cjs/{MediaCard-kcqfmeue.cjs → MediaCard-BEZFbiYO.cjs} +5 -9
- package/lib/_shared/cjs/{MenuSubContent-Bs2_ebS3.cjs → MenuItemMultiLevelContent-vLr6hSBm.cjs} +7 -9
- package/lib/_shared/cjs/ProgressStepper-BL9Y5c4X.cjs +77 -0
- package/lib/_shared/cjs/ProgressStepperOverflow-v-TyS5Sp.cjs +142 -0
- package/lib/_shared/cjs/{RadioCardGroupInput-BmntgyWB.cjs → RadioCardGroupInput-CeUM3yPS.cjs} +1 -1
- package/lib/_shared/cjs/{RadioGroupInput-D3trTxB5.cjs → RadioGroupInput-w2qkfsnG.cjs} +2 -2
- package/lib/_shared/cjs/{SiteHeaderV2NavItemWithSubNav-DgoCW2W3.cjs → SiteHeaderV2NavItemWithSubNav-fQPk0gZU.cjs} +3 -3
- package/lib/_shared/cjs/{TemplateBanner-BMi77IGK.cjs → TemplateBanner-CGtTUy81.cjs} +13 -6
- package/lib/_shared/cjs/{TextInput-DT4hi02U.cjs → TextInput-ByySubi5.cjs} +7 -7
- package/lib/_shared/cjs/Visible-Dx__9oZG.cjs +18 -0
- package/lib/_shared/cjs/{index.es-sqSQUWYg.cjs → index.es-DBEGtWPg.cjs} +1 -1
- package/lib/_shared/esm/{Avatar-B8aoUhmE.mjs → Avatar-Fb1E5MA9.mjs} +4 -1
- package/lib/_shared/esm/{Button-9L4AksQP.mjs → Button-BxuM3_gz.mjs} +1 -1
- package/lib/_shared/esm/{ButtonV2-2U4PvnpS.mjs → ButtonV2-DwYBAojW.mjs} +2 -2
- package/lib/_shared/esm/{Calendar-L6u3D8xb.mjs → Calendar-CjqPM7ta.mjs} +3 -3
- package/lib/_shared/esm/{CardFooter-CgDDDI7Z.mjs → CardFooter-fsAY4cc6.mjs} +1 -1
- package/lib/_shared/esm/{Checkbox-NxnK40uZ.mjs → Checkbox-CwOHzlQF.mjs} +1 -1
- package/lib/_shared/esm/{ComboBox-DUTrEu0N.mjs → ComboBox-CRlJjeev.mjs} +2 -2
- package/lib/_shared/esm/{ContentSwitcherDropdown-dktkyAjY.mjs → ContentSwitcherDropdown-BCkuAfwC.mjs} +1 -1
- package/lib/_shared/esm/{ContentSwitcherList-OnZoE86O.mjs → ContentSwitcherList-DKPD9GfN.mjs} +3 -2
- package/lib/_shared/esm/{DatePicker-CccSfg17.mjs → DatePicker-3sYJ3wGn.mjs} +46 -31
- package/lib/_shared/esm/{FormControl-B9fp1ilz.mjs → FormControl-CWyrVi1u.mjs} +19 -13
- package/lib/_shared/esm/{HeroButton-HYskwyvn.mjs → HeroButton-jdjjV_Gf.mjs} +1 -1
- package/lib/_shared/esm/{Icon-MZfaoOo9.mjs → Icon-CcPOJcQm.mjs} +1 -1
- package/lib/_shared/esm/{MediaCard-CjTDOvmx.mjs → MediaCard-DqMaNWsE.mjs} +5 -9
- package/lib/_shared/esm/{MenuSubContent-Cv9mSn58.mjs → MenuItemMultiLevelContent-JTOHqpzg.mjs} +7 -8
- package/lib/_shared/esm/ProgressStepper-CLBtBNy2.mjs +74 -0
- package/lib/_shared/esm/ProgressStepperOverflow-B9ba8ljs.mjs +140 -0
- package/lib/_shared/esm/{RadioCardGroupInput-Cy1r7M8l.mjs → RadioCardGroupInput-D7W28geB.mjs} +1 -1
- package/lib/_shared/esm/{RadioGroupInput-DiRS2jwQ.mjs → RadioGroupInput-zAWSV29m.mjs} +2 -2
- package/lib/_shared/esm/{SiteHeaderV2NavItemWithSubNav-BLqiSeEC.mjs → SiteHeaderV2NavItemWithSubNav-BMoBdUxK.mjs} +3 -3
- package/lib/_shared/esm/{TemplateBanner-zc4VmeeW.mjs → TemplateBanner-Up6cR-3_.mjs} +14 -7
- package/lib/_shared/esm/{TextInput-Vp_cBbpQ.mjs → TextInput-Dk7qNGoh.mjs} +7 -7
- package/lib/_shared/esm/Visible-C-jVXUWp.mjs +16 -0
- package/lib/_shared/esm/{index.es-C3WGtwrW.mjs → index.es-DCvYtQfu.mjs} +2 -2
- package/lib/index.cjs +1177 -877
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +193 -63
- package/lib/index.d.mts +193 -63
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1167 -872
- package/lib/index.mjs.map +1 -1
- package/lib/styles.css +8 -22
- package/package.json +8 -8
- package/lib/GradientBackground/GradientBackground.cjs +0 -19
- package/lib/GradientBackground/GradientBackground.mjs +0 -17
- package/lib/GradientBackground/styles.css +0 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var filterAttrs = require('./filter-attrs-eK6E_34o.cjs');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var debounce = require('./debounce-BeIT3oyF.cjs');
|
|
6
|
+
var ProgressStepper = require('./ProgressStepper-BL9Y5c4X.cjs');
|
|
7
|
+
|
|
8
|
+
/** Use `ProgressStepperOverflow` to wrap `ProgressStepperItem`s and allow overflow behaviour. */
|
|
9
|
+
var ProgressStepperOverflow = React.forwardRef(function (_a, stepperRef) {
|
|
10
|
+
var children = _a.children, onIndexChange = _a.onIndexChange, onLoadStep = _a.onLoadStep, size = _a.size, invertLabelPosition = _a.invertLabelPosition, _b = _a.offsetLeft, offsetLeft = _b === void 0 ? 24 : _b, props = filterAttrs.__rest(_a, ["children", "onIndexChange", "onLoadStep", "size", "invertLabelPosition", "offsetLeft"]);
|
|
11
|
+
var _c = React.useState(onLoadStep ? onLoadStep : 0), activeIndex = _c[0], setActiveIndex = _c[1];
|
|
12
|
+
var _d = React.useState(0), closestScrolledIndex = _d[0], setClosestScrolledIndex = _d[1];
|
|
13
|
+
var _e = React.useState(true), lastStepVisible = _e[0], setLastStepVisible = _e[1];
|
|
14
|
+
var containerRef = React.useRef(null);
|
|
15
|
+
React.useImperativeHandle(stepperRef, function () { return ({
|
|
16
|
+
handleStepScroll: handleStepScroll,
|
|
17
|
+
scrollToStep: scrollToStep,
|
|
18
|
+
handleViewScroll: handleViewScroll,
|
|
19
|
+
isLastChildVisible: isLastChildVisible,
|
|
20
|
+
}); });
|
|
21
|
+
// Add Horizontal Scroll Event Listener
|
|
22
|
+
React.useEffect(function () {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
var checkClosest = debounce.debounce(function () {
|
|
25
|
+
var closestIndex = findClosestIndex();
|
|
26
|
+
setClosestScrolledIndex(closestIndex);
|
|
27
|
+
}, 100);
|
|
28
|
+
var checkLastChild = debounce.debounce(function () {
|
|
29
|
+
var lastVisible = isLastChildVisible();
|
|
30
|
+
if (lastVisible) {
|
|
31
|
+
setLastStepVisible(true);
|
|
32
|
+
}
|
|
33
|
+
else
|
|
34
|
+
setLastStepVisible(false);
|
|
35
|
+
}, 100);
|
|
36
|
+
(_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener("scroll", checkLastChild);
|
|
37
|
+
(_b = containerRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener("scroll", checkClosest);
|
|
38
|
+
return function () {
|
|
39
|
+
var _a;
|
|
40
|
+
(_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener("scroll", checkClosest);
|
|
41
|
+
checkLastChild.cancel();
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
// Scroll to activeIndex
|
|
45
|
+
React.useEffect(function () {
|
|
46
|
+
scrollTo();
|
|
47
|
+
}, [activeIndex]);
|
|
48
|
+
// Exposing changes in activeIndex outside of component
|
|
49
|
+
React.useEffect(function () {
|
|
50
|
+
onIndexChange === null || onIndexChange === void 0 ? void 0 : onIndexChange(closestScrolledIndex);
|
|
51
|
+
isLastChildVisible();
|
|
52
|
+
}, [closestScrolledIndex, onIndexChange, lastStepVisible]);
|
|
53
|
+
// helper functions - start
|
|
54
|
+
var getProgressStepper = function () { var _a; return (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.firstChild; };
|
|
55
|
+
var getStepChildren = function () {
|
|
56
|
+
var _a;
|
|
57
|
+
return Array.from(((_a = getProgressStepper()) === null || _a === void 0 ? void 0 : _a.children) || []);
|
|
58
|
+
};
|
|
59
|
+
var getLeftRects = function (children) {
|
|
60
|
+
var container = getProgressStepper();
|
|
61
|
+
if (!container)
|
|
62
|
+
return [];
|
|
63
|
+
var parentRect = container.getBoundingClientRect();
|
|
64
|
+
return children.map(function (child) {
|
|
65
|
+
var childRect = child.getBoundingClientRect();
|
|
66
|
+
return {
|
|
67
|
+
left: childRect.left - parentRect.left,
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
var indexOfClosest = function (values) {
|
|
72
|
+
return values.indexOf(Math.min.apply(Math, values));
|
|
73
|
+
};
|
|
74
|
+
// helper functions - end
|
|
75
|
+
var isLastChildVisible = function () {
|
|
76
|
+
var _a;
|
|
77
|
+
var steps = getStepChildren();
|
|
78
|
+
var lastStep = steps[steps.length - 1];
|
|
79
|
+
var rect = lastStep.getBoundingClientRect();
|
|
80
|
+
var containerRect = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
81
|
+
return rect.right <= containerRect.right;
|
|
82
|
+
};
|
|
83
|
+
// Used for onScroll function of scrolling without buttons
|
|
84
|
+
var findClosestIndex = function () {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
var children = getStepChildren();
|
|
87
|
+
var scrolledAmount = (_b = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.scrollLeft) !== null && _b !== void 0 ? _b : 0;
|
|
88
|
+
// compare the scrolled amount to the intial left edge distance for each step
|
|
89
|
+
var getScrollDistances = function (children, scrolledAmount) {
|
|
90
|
+
return getLeftRects(children).map(function (rect) {
|
|
91
|
+
return Math.abs(scrolledAmount - rect.left);
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
var closestIndex = indexOfClosest(getScrollDistances(children, scrolledAmount));
|
|
95
|
+
return closestIndex;
|
|
96
|
+
};
|
|
97
|
+
// Scroll active step to the far left of the page
|
|
98
|
+
var scrollTo = function () {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
var activeStep = (_a = getProgressStepper()) === null || _a === void 0 ? void 0 : _a.children[activeIndex];
|
|
101
|
+
if (activeStep) {
|
|
102
|
+
(_b = containerRef.current) === null || _b === void 0 ? void 0 : _b.scrollTo({
|
|
103
|
+
left: activeStep.offsetLeft - offsetLeft,
|
|
104
|
+
behavior: "smooth",
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
var handleStepScroll = function (increment) {
|
|
109
|
+
// Account for any manual scrolling set closest index to active index
|
|
110
|
+
setActiveIndex(closestScrolledIndex);
|
|
111
|
+
var newIndex = closestScrolledIndex + increment;
|
|
112
|
+
setActiveIndex(newIndex);
|
|
113
|
+
// If clicking backwards to include half visible step
|
|
114
|
+
if (closestScrolledIndex + increment === activeIndex) {
|
|
115
|
+
scrollTo();
|
|
116
|
+
}
|
|
117
|
+
if (closestScrolledIndex + increment < 0) {
|
|
118
|
+
setActiveIndex(0);
|
|
119
|
+
scrollTo();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
// Used to scroll by Parent width
|
|
123
|
+
var handleViewScroll = function (direction) {
|
|
124
|
+
var _a;
|
|
125
|
+
var clientWidth = ((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0;
|
|
126
|
+
var stepper = containerRef.current;
|
|
127
|
+
if (!stepper)
|
|
128
|
+
return;
|
|
129
|
+
stepper.scrollBy({
|
|
130
|
+
left: direction ? clientWidth : -clientWidth,
|
|
131
|
+
behavior: "smooth",
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
// Used to set a specific step to jump to on a button click
|
|
135
|
+
var scrollToStep = function (step) {
|
|
136
|
+
setActiveIndex(step);
|
|
137
|
+
};
|
|
138
|
+
return (React.createElement("div", filterAttrs.__assign({ ref: containerRef, className: "arc-ProgressStepperOverflow", style: { paddingLeft: offsetLeft } }, filterAttrs.filterAttrs(props)),
|
|
139
|
+
React.createElement(ProgressStepper.ProgressStepper, { size: size, invertLabelPosition: invertLabelPosition, isFluid: false }, children)));
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
exports.ProgressStepperOverflow = ProgressStepperOverflow;
|
package/lib/_shared/cjs/{RadioCardGroupInput-BmntgyWB.cjs → RadioCardGroupInput-CeUM3yPS.cjs}
RENAMED
|
@@ -5,7 +5,7 @@ var React = require('react');
|
|
|
5
5
|
var index = require('./index-CTlXMLug.cjs');
|
|
6
6
|
var capitaliseFirstLetter = require('./capitalise-first-letter-CdhexpSx.cjs');
|
|
7
7
|
var Surface = require('./Surface-BFx1yNsq.cjs');
|
|
8
|
-
var Icon = require('./Icon-
|
|
8
|
+
var Icon = require('./Icon-CzhyKqMd.cjs');
|
|
9
9
|
|
|
10
10
|
var RadioContext = React.createContext({});
|
|
11
11
|
var Provider = RadioContext.Provider;
|
|
@@ -42,11 +42,11 @@ var RadioGroupButton = React.forwardRef(function (_a, ref) {
|
|
|
42
42
|
*/
|
|
43
43
|
var RadioGroupInput = React.forwardRef(function (_a, ref) {
|
|
44
44
|
var helper = _a.helper, id = _a.id, isDisabled = _a.isDisabled, label = _a.label, _b = _a.radioButtonAlignment, radioButtonAlignment = _b === void 0 ? "center" : _b, value = _a.value, props = filterAttrs.__rest(_a, ["helper", "id", "isDisabled", "label", "radioButtonAlignment", "value"]);
|
|
45
|
-
var _c = useRadioContext(), blurEvent = _c.blurEvent, changeEvent = _c.changeEvent, groupDisabled = _c.groupDisabled, checkedValue = _c.checkedValue,
|
|
45
|
+
var _c = useRadioContext(), blurEvent = _c.blurEvent, changeEvent = _c.changeEvent, groupDisabled = _c.groupDisabled, checkedValue = _c.checkedValue, name = _c.name, size = _c.size;
|
|
46
46
|
var isChecked = checkedValue === value ? true : false;
|
|
47
47
|
var checked = typeof changeEvent !== "function" ? undefined : isChecked;
|
|
48
48
|
var defaultChecked = typeof changeEvent !== "function" ? isChecked : undefined;
|
|
49
|
-
return (React.createElement(RadioGroupButton, filterAttrs.__assign({ withMargin: true, ref: ref, id: id, name: name, helper: helper, isDisabled: isDisabled || groupDisabled,
|
|
49
|
+
return (React.createElement(RadioGroupButton, filterAttrs.__assign({ withMargin: true, ref: ref, id: id, name: name, helper: helper, isDisabled: isDisabled || groupDisabled, size: size, radioButtonAlignment: radioButtonAlignment, label: label, defaultChecked: defaultChecked, checked: checked, changeEvent: changeEvent, blurEvent: blurEvent, value: value }, props)));
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
exports.Provider = Provider;
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
var filterAttrs = require('./filter-attrs-eK6E_34o.cjs');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var index = require('./index-CTlXMLug.cjs');
|
|
6
|
-
var index_es = require('./index.es-
|
|
6
|
+
var index_es = require('./index.es-DBEGtWPg.cjs');
|
|
7
7
|
var BtIconChevronRight2Px = require('./BtIconChevronRight2Px-CIRaur2B.cjs');
|
|
8
8
|
var useMediaQuery = require('./use-media-query-BsUfHjPZ.cjs');
|
|
9
|
-
var Icon = require('./Icon-
|
|
9
|
+
var Icon = require('./Icon-CzhyKqMd.cjs');
|
|
10
10
|
var Surface = require('./Surface-BFx1yNsq.cjs');
|
|
11
|
-
var ButtonV2 = require('./ButtonV2-
|
|
11
|
+
var ButtonV2 = require('./ButtonV2-Bta5SVVY.cjs');
|
|
12
12
|
var handleLinkClick = require('./handle-link-click-C7BvOIYa.cjs');
|
|
13
13
|
var BrandLogo = require('./BrandLogo-D5wlIFmm.cjs');
|
|
14
14
|
|
|
@@ -3,17 +3,25 @@
|
|
|
3
3
|
var filterAttrs = require('./filter-attrs-eK6E_34o.cjs');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var index = require('./index-CTlXMLug.cjs');
|
|
6
|
-
var index_es = require('./index.es-sqSQUWYg.cjs');
|
|
7
|
-
var useMediaQuery = require('./use-media-query-BsUfHjPZ.cjs');
|
|
8
6
|
var VerticalSpace = require('./VerticalSpace-BJvST6WP.cjs');
|
|
9
7
|
var Box = require('./Box-COPXU1Jf.cjs');
|
|
10
8
|
var Heading = require('./Heading-BEMSkLYR.cjs');
|
|
11
9
|
var GridRow = require('./GridRow-BW2ZGtND.cjs');
|
|
10
|
+
require('./index-DR8Rkav9.cjs');
|
|
12
11
|
var BannerImage = require('./BannerImage-kdAKagG-.cjs');
|
|
12
|
+
var Visible = require('./Visible-Dx__9oZG.cjs');
|
|
13
|
+
|
|
14
|
+
var BannerRow = function (_a) {
|
|
15
|
+
var isReversed = _a.isReversed, children = _a.children;
|
|
16
|
+
return (React.createElement(React.Fragment, null,
|
|
17
|
+
React.createElement(Visible.Visible, { xs: true, s: true },
|
|
18
|
+
React.createElement(GridRow.GridRow, { "data-testid": "arc-TemplateBanner-gridRow-mobile" }, children)),
|
|
19
|
+
React.createElement(Visible.Visible, { m: true, l: true, xl: true },
|
|
20
|
+
React.createElement(GridRow.GridRow, { "data-testid": "arc-TemplateBanner-gridRow-desktop", direction: isReversed ? "row-reverse" : "row" }, children))));
|
|
21
|
+
};
|
|
13
22
|
|
|
14
23
|
var TemplateBanner = function (_a) {
|
|
15
24
|
var heading = _a.heading, label = _a.label, text = _a.text, img = _a.img, _b = _a.contentRatio, contentRatio = _b === void 0 ? "1/1" : _b, children = _a.children, _c = _a.alignment, alignment = _c === void 0 ? "center" : _c, additionalTopMargin = _a.additionalTopMargin, _d = _a.minHeight, minHeight = _d === void 0 ? 454 : _d, _e = _a.headingSize, headingSize = _e === void 0 ? "xl" : _e, _f = _a.isReversed, isReversed = _f === void 0 ? false : _f, _g = _a.isElevated, isElevated = _g === void 0 ? false : _g, _h = _a.headingLevel, headingLevel = _h === void 0 ? "2" : _h, _j = _a.type, type = _j === void 0 ? "light" : _j, props = filterAttrs.__rest(_a, ["heading", "label", "text", "img", "contentRatio", "children", "alignment", "additionalTopMargin", "minHeight", "headingSize", "isReversed", "isElevated", "headingLevel", "type"]);
|
|
16
|
-
var isMinWidthArcBreakpointM = useMediaQuery.useMediaQuery("(min-width: ".concat(index_es.ArcSizeBreakpointsM, ")"));
|
|
17
25
|
var backgrounds = {
|
|
18
26
|
dark: "dark-brand-02",
|
|
19
27
|
light: "light-white",
|
|
@@ -26,7 +34,6 @@ var TemplateBanner = function (_a) {
|
|
|
26
34
|
};
|
|
27
35
|
var isContained = type === "contained";
|
|
28
36
|
var borderWidth = isContained && !isElevated ? "thin" : undefined;
|
|
29
|
-
var direction = isReversed && isMinWidthArcBreakpointM ? "row-reverse" : "row";
|
|
30
37
|
var columnWithImgWidths = {
|
|
31
38
|
"1/0": 12,
|
|
32
39
|
"2/3": 8,
|
|
@@ -37,7 +44,7 @@ var TemplateBanner = function (_a) {
|
|
|
37
44
|
}) }, filterAttrs.filterAttrs(props)),
|
|
38
45
|
React.createElement(Box.Box, { isBorderRadius: true, "data-testid": "arc-TemplateBanner-box", borderWidth: borderWidth, surface: backgrounds[type], isSurfaceTransparent: !isContained },
|
|
39
46
|
React.createElement(GridRow.Grid, { isGutterless: true, isFluid: true },
|
|
40
|
-
React.createElement(
|
|
47
|
+
React.createElement(BannerRow, { "data-testid": "arc-TemplateBanner-gridRow", isReversed: isReversed },
|
|
41
48
|
React.createElement(GridRow.GridCol, { "data-testid": "arc-TemplateBanner-contentCol", align: {
|
|
42
49
|
m: alignment === "start" ? "start" : "center",
|
|
43
50
|
xs: !img || contentRatio === "1/0" ? "center" : "start",
|
|
@@ -46,7 +53,7 @@ var TemplateBanner = function (_a) {
|
|
|
46
53
|
"arc-TemplateBanner-content--additionalTopMargin": additionalTopMargin && alignment === "start",
|
|
47
54
|
}) },
|
|
48
55
|
label && (React.createElement(React.Fragment, null,
|
|
49
|
-
React.createElement(Heading.Heading, {
|
|
56
|
+
React.createElement(Heading.Heading, { level: "3", fontStyle: "overline" }, label),
|
|
50
57
|
React.createElement(VerticalSpace.VerticalSpace, { size: "8" }))),
|
|
51
58
|
React.createElement(Heading.Heading, { level: headingLevel, size: headingSize }, heading),
|
|
52
59
|
text && (React.createElement(React.Fragment, null,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var filterAttrs = require('./filter-attrs-eK6E_34o.cjs');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var index = require('./index-CTlXMLug.cjs');
|
|
6
|
-
var FormControl = require('./FormControl-
|
|
6
|
+
var FormControl = require('./FormControl-BPnKQrCm.cjs');
|
|
7
7
|
var Surface = require('./Surface-BFx1yNsq.cjs');
|
|
8
8
|
var VisuallyHidden = require('./VisuallyHidden-B4XCvPYP.cjs');
|
|
9
9
|
var ThemeIcon = require('./ThemeIcon-BoxbjTaQ.cjs');
|
|
@@ -38,9 +38,9 @@ var useNumericInput = function (props) {
|
|
|
38
38
|
|
|
39
39
|
var TextInputComponent = React.forwardRef(function (_a, ref) {
|
|
40
40
|
var _b;
|
|
41
|
-
var _c = _a.defaultValue, defaultValue = _c === void 0 ? "" : _c, errorMessage = _a.errorMessage, helper = _a.helper, hideLabel = _a.hideLabel, id = _a.id, inputMode = _a.inputMode, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.isReadOnly, isReadOnly = _e === void 0 ? false : _e, _f = _a.isRequired, isRequired = _f === void 0 ? false : _f, label = _a.label,
|
|
41
|
+
var _c = _a.defaultValue, defaultValue = _c === void 0 ? "" : _c, errorMessage = _a.errorMessage, helper = _a.helper, hideLabel = _a.hideLabel, id = _a.id, inputMode = _a.inputMode, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.isReadOnly, isReadOnly = _e === void 0 ? false : _e, _f = _a.isRequired, isRequired = _f === void 0 ? false : _f, label = _a.label, maxLength = _a.maxLength, minLength = _a.minLength, name = _a.name, onBlur = _a.onBlur, onFocus = _a.onFocus, onChange = _a.onChange, placeholder = _a.placeholder, onClickDisclosure = _a.onClickDisclosure, pattern = _a.pattern, _g = _a.type, type = _g === void 0 ? "text" : _g, _h = _a.showPassword, showPassword = _h === void 0 ? false : _h, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, _j = _a.size, size = _j === void 0 ? "m" : _j, iconButton = _a.iconButton, prefix = _a.prefix, suffix = _a.suffix, _k = _a.inputAlignment, inputAlignment = _k === void 0 ? "left" : _k, width = _a.width, autoComplete = _a.autoComplete, isLoading = _a.isLoading, props = filterAttrs.__rest(_a, ["defaultValue", "errorMessage", "helper", "hideLabel", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "maxLength", "minLength", "name", "onBlur", "onFocus", "onChange", "placeholder", "onClickDisclosure", "pattern", "type", "showPassword", "value", "disclosureTitle", "disclosureText", "size", "iconButton", "prefix", "suffix", "inputAlignment", "width", "autoComplete", "isLoading"]);
|
|
42
42
|
var surface = React.useContext(Surface.Context).surface;
|
|
43
|
-
var
|
|
43
|
+
var _l = React.useState(false), showPasswordToggle = _l[0], setShowPasswordToggle = _l[1];
|
|
44
44
|
var inferredInputProps = useNumericInput({
|
|
45
45
|
inputMode: inputMode,
|
|
46
46
|
pattern: pattern,
|
|
@@ -74,9 +74,9 @@ var TextInputComponent = React.forwardRef(function (_a, ref) {
|
|
|
74
74
|
"arc-TextInput--withPrefix": prefix,
|
|
75
75
|
"arc-TextInput--withSuffix": suffix
|
|
76
76
|
},
|
|
77
|
-
_b["arc-TextInput--size".concat(
|
|
77
|
+
_b["arc-TextInput--size".concat(size && size.toUpperCase())] = size && size !== "m",
|
|
78
78
|
_b)) }, filterAttrs.filterAttrs(props)),
|
|
79
|
-
React.createElement(FormControl.FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, hideLabel: hideLabel, labelSize:
|
|
79
|
+
React.createElement(FormControl.FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, hideLabel: hideLabel, labelSize: size, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure },
|
|
80
80
|
React.createElement("div", { className: "arc-TextInput-inputWrapper", style: { width: width, marginTop: hideLabel ? 0 : undefined } },
|
|
81
81
|
prefix && (React.createElement("span", { className: "arc-TextInput-prefix", "aria-hidden": true }, prefix)),
|
|
82
82
|
React.createElement("input", filterAttrs.__assign({ placeholder: placeholder, "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", className: "arc-TextInput-input", defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled || isLoading, id: id, maxLength: maxLength, minLength: minLength, name: name, onChange: onChange, onBlur: onBlur, onFocus: onFocus, readOnly: isReadOnly, ref: ref, required: isRequired, value: typeof value !== "undefined" ? value : undefined, autoComplete: autoComplete }, inferredInputProps)),
|
|
@@ -85,7 +85,7 @@ var TextInputComponent = React.forwardRef(function (_a, ref) {
|
|
|
85
85
|
e.preventDefault();
|
|
86
86
|
iconButton.onClick();
|
|
87
87
|
} },
|
|
88
|
-
React.createElement(ThemeIcon.ThemeIcon, { icon: iconButton.icon, size: buttonIconSize[
|
|
88
|
+
React.createElement(ThemeIcon.ThemeIcon, { icon: iconButton.icon, size: buttonIconSize[size] })))),
|
|
89
89
|
suffix && !showPassword ? (React.createElement("span", { className: "arc-TextInput-suffix", "aria-hidden": true }, suffix)) : null,
|
|
90
90
|
showPassword && (React.createElement("div", { className: "arc-TextInput-additionalControl" },
|
|
91
91
|
React.createElement("button", { className: "arc-TextInput-passwordToggle", onClick: function () { return setShowPasswordToggle(function (p) { return !p; }); }, type: "button" }, showPasswordToggle ? "Hide" : "Show"),
|
|
@@ -95,7 +95,7 @@ var TextInputComponent = React.forwardRef(function (_a, ref) {
|
|
|
95
95
|
? "Your password is shown"
|
|
96
96
|
: "Your password is hidden"))))),
|
|
97
97
|
isLoading && (React.createElement("span", { className: "arc-TextInput-spinner" },
|
|
98
|
-
React.createElement(Spinner.Spinner, { size: spinnerSize[
|
|
98
|
+
React.createElement(Spinner.Spinner, { size: spinnerSize[size] })))))));
|
|
99
99
|
});
|
|
100
100
|
/**
|
|
101
101
|
* Use `TextInput` to allow users to enter short form text.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var filterAttrs = require('./filter-attrs-eK6E_34o.cjs');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var index = require('./index-CTlXMLug.cjs');
|
|
6
|
+
|
|
7
|
+
var Visible = function (_a) {
|
|
8
|
+
var children = _a.children, xs = _a.xs, s = _a.s, m = _a.m, l = _a.l, xl = _a.xl, props = filterAttrs.__rest(_a, ["children", "xs", "s", "m", "l", "xl"]);
|
|
9
|
+
return (React.createElement("div", filterAttrs.__assign({ className: index.classNames("arc-Visible", {
|
|
10
|
+
"arc-Visible--xs": xs,
|
|
11
|
+
"arc-Visible--s": s,
|
|
12
|
+
"arc-Visible--m": m,
|
|
13
|
+
"arc-Visible--l": l,
|
|
14
|
+
"arc-Visible--xl": xl,
|
|
15
|
+
}) }, filterAttrs.filterAttrs(props)), children));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.Visible = Visible;
|
|
@@ -2,6 +2,7 @@ import { a as __assign, _ as __rest, f as filterAttrs } from './filter-attrs-B6C
|
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { c as classNames } from './index-5C0-U8cc.mjs';
|
|
4
4
|
import { C as ConditionalWrapper } from './ConditionalWrapper-WoJxFYwS.mjs';
|
|
5
|
+
import { V as VisuallyHidden } from './VisuallyHidden-DqAgoqJo.mjs';
|
|
5
6
|
import { T as ThemeIcon } from './ThemeIcon-CN_Ed5b1.mjs';
|
|
6
7
|
import { I as Image } from './Image-Dl8oH1Rn.mjs';
|
|
7
8
|
import { H as Heading } from './Heading-CxHWefi7.mjs';
|
|
@@ -35,7 +36,9 @@ var Avatar = function (_a) {
|
|
|
35
36
|
var wrapperAttrs = __assign({ className: classNames("arc-Avatar", "arc-Avatar--".concat(size), {
|
|
36
37
|
"arc-Avatar--img": Boolean(img),
|
|
37
38
|
}) }, filterAttrs(props));
|
|
38
|
-
return (React__default.createElement(ConditionalWrapper, { condition: Boolean(href), wrapper: function (children) { return (React__default.createElement("a", __assign({ href: href, "aria-label": ariaLabel, onClick: onClick, title: title }, wrapperAttrs), children)); }, fallback: function (children) { return React__default.createElement(
|
|
39
|
+
return (React__default.createElement(ConditionalWrapper, { condition: Boolean(href), wrapper: function (children) { return (React__default.createElement("a", __assign({ href: href, "aria-label": ariaLabel, onClick: onClick, title: title }, wrapperAttrs), children)); }, fallback: function (children) { return (React__default.createElement(React__default.Fragment, null,
|
|
40
|
+
React__default.createElement("div", __assign({}, wrapperAttrs), children),
|
|
41
|
+
ariaLabel && React__default.createElement(VisuallyHidden, null, ariaLabel))); } },
|
|
39
42
|
React__default.createElement(AvatarContent, { size: size, img: img, initials: initials })));
|
|
40
43
|
};
|
|
41
44
|
|
|
@@ -2,7 +2,7 @@ import { _ as __rest, a as __assign, f as filterAttrs } from './filter-attrs-B6C
|
|
|
2
2
|
import React__default, { forwardRef, useContext } from 'react';
|
|
3
3
|
import { c as classNames } from './index-5C0-U8cc.mjs';
|
|
4
4
|
import { s as suffixModifier } from './suffix-modifier-B_pO0UkF.mjs';
|
|
5
|
-
import { I as Icon } from './Icon-
|
|
5
|
+
import { I as Icon } from './Icon-CcPOJcQm.mjs';
|
|
6
6
|
import { C as Context } from './Surface-Colbp3Zx.mjs';
|
|
7
7
|
import { T as ThemeIcon } from './ThemeIcon-CN_Ed5b1.mjs';
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign, f as filterAttrs } from './filter-attrs-B6CM-NUr.mjs';
|
|
2
2
|
import React__default, { forwardRef, useContext } from 'react';
|
|
3
3
|
import { c as classNames } from './index-5C0-U8cc.mjs';
|
|
4
|
-
import { I as Icon } from './Icon-
|
|
4
|
+
import { I as Icon } from './Icon-CcPOJcQm.mjs';
|
|
5
5
|
import { C as Context } from './Surface-Colbp3Zx.mjs';
|
|
6
6
|
import { S as Spinner } from './Spinner-Cd7LiPTy.mjs';
|
|
7
7
|
|
|
@@ -28,7 +28,7 @@ var ButtonV2 = forwardRef(function (_a, ref) {
|
|
|
28
28
|
case "compact":
|
|
29
29
|
case "secondary":
|
|
30
30
|
case "tertiary":
|
|
31
|
-
return
|
|
31
|
+
return "brand-alt";
|
|
32
32
|
default:
|
|
33
33
|
return "auto";
|
|
34
34
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { b as __spreadArray, a as __assign, _ as __rest, f as filterAttrs } from './filter-attrs-B6CM-NUr.mjs';
|
|
2
2
|
import React__default, { createContext, forwardRef, useContext, useCallback, useRef, useState, useReducer, useEffect } from 'react';
|
|
3
3
|
import { r as requiredArgs, t as toDate, b as toInteger, _ as _typeof, g as getDefaultOptions, f as format } from './index-Cr6KeQLU.mjs';
|
|
4
|
-
import { A as ArcSizeBreakpointsM } from './index.es-
|
|
4
|
+
import { A as ArcSizeBreakpointsM } from './index.es-DCvYtQfu.mjs';
|
|
5
5
|
import { u as useMediaQuery } from './use-media-query-DmKuIDEM.mjs';
|
|
6
6
|
import { c as classNames } from './index-5C0-U8cc.mjs';
|
|
7
7
|
import { T as Text } from './Text-CBlnm5CT.mjs';
|
|
@@ -10,7 +10,7 @@ import './index-Spae4j7j.mjs';
|
|
|
10
10
|
import { S as Surface } from './Surface-Colbp3Zx.mjs';
|
|
11
11
|
import { H as Heading } from './Heading-CxHWefi7.mjs';
|
|
12
12
|
import { B as BtIconChevronRightMid } from './BtIconChevronRightMid-DE4lmVaG.mjs';
|
|
13
|
-
import { I as Icon } from './Icon-
|
|
13
|
+
import { I as Icon } from './Icon-CcPOJcQm.mjs';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @name addMonths
|
|
@@ -1132,7 +1132,7 @@ var CalendarDayNumber = forwardRef(function (_a, autoFocusRef) {
|
|
|
1132
1132
|
*/
|
|
1133
1133
|
|
|
1134
1134
|
const BtIconChevronDownMid =
|
|
1135
|
-
"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg'
|
|
1135
|
+
"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3e%3cpath fill='currentColor' d='m16 18.09 5.704-5.696a1.347 1.347 0 0 1 2.296.949 1.34 1.34 0 0 1-.393.95L16.95 20.94a1.347 1.347 0 0 1-1.902 0l-6.656-6.648A1.342 1.342 0 0 1 9.345 12c.356 0 .699.142.951.393z'/%3e%3c/svg%3e";
|
|
1136
1136
|
|
|
1137
1137
|
var CalendarDateSelect = function (_a) {
|
|
1138
1138
|
var ariaLabel = _a.ariaLabel, onChange = _a.onChange, name = _a.name, value = _a.value, displayValue = _a.displayValue, options = _a.options;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { c as classNames } from './index-5C0-U8cc.mjs';
|
|
3
|
-
import { I as Icon } from './Icon-
|
|
3
|
+
import { I as Icon } from './Icon-CcPOJcQm.mjs';
|
|
4
4
|
import { i as isDate, f as format } from './index-Cr6KeQLU.mjs';
|
|
5
5
|
|
|
6
6
|
var ArrowRight = "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3e%3cpath d='M18.146 11.646a.5.5 0 0 0 0 .707l3.147 3.147H9.5a.5.5 0 0 0 0 1h11.793l-3.146 3.146a.5.5 0 1 0 .707.707L23.207 16l-4.354-4.354a.5.5 0 0 0-.707 0'/%3e%3c/svg%3e";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign, f as filterAttrs } from './filter-attrs-B6CM-NUr.mjs';
|
|
2
2
|
import React__default, { forwardRef, useContext, useRef, useEffect } from 'react';
|
|
3
3
|
import { c as classNames } from './index-5C0-U8cc.mjs';
|
|
4
|
-
import { C as Context, u as useAriaDescribedby } from './FormControl-
|
|
4
|
+
import { C as Context, u as useAriaDescribedby } from './FormControl-CWyrVi1u.mjs';
|
|
5
5
|
import { C as Context$1 } from './Surface-Colbp3Zx.mjs';
|
|
6
6
|
import { T as ThemeIcon } from './ThemeIcon-CN_Ed5b1.mjs';
|
|
7
7
|
import { V as VisuallyHidden } from './VisuallyHidden-DqAgoqJo.mjs';
|
|
@@ -2,10 +2,10 @@ import { b as __spreadArray, a as __assign, _ as __rest, f as filterAttrs } from
|
|
|
2
2
|
import React__default, { forwardRef, useId, useRef, useReducer } from 'react';
|
|
3
3
|
import { R as Root2, A as Anchor2, P as Portal, C as Content2 } from './index-CxrL7jIX.mjs';
|
|
4
4
|
import { c as classNames } from './index-5C0-U8cc.mjs';
|
|
5
|
-
import { u as useAriaDescribedby, F as FormControl } from './FormControl-
|
|
5
|
+
import { u as useAriaDescribedby, F as FormControl } from './FormControl-CWyrVi1u.mjs';
|
|
6
6
|
import { e as useThemeElement } from './index-Bz2JQq34.mjs';
|
|
7
7
|
import { B as Box } from './Box-BYm_GTct.mjs';
|
|
8
|
-
import { I as Icon } from './Icon-
|
|
8
|
+
import { I as Icon } from './Icon-CcPOJcQm.mjs';
|
|
9
9
|
import { T as ThemeIcon } from './ThemeIcon-CN_Ed5b1.mjs';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -59,7 +59,7 @@ var ContentSwitcherDropdown = function (_a) {
|
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
61
61
|
var isActive = child.props.value === selectValue;
|
|
62
|
-
return (React__default.createElement("div", __assign({ role: "tabpanel", className: "arc-ContentSwitcherDropdown-content", id: "arc-content-switcher-dropdown-content-".concat(child.props.value), "aria-labelledby": "arc-content-switcher-dropdown-trigger-".concat(child.props.value), "data-state": isActive ? "active" : "inactive", tabIndex:
|
|
62
|
+
return (React__default.createElement("div", __assign({ role: "tabpanel", className: "arc-ContentSwitcherDropdown-content", id: "arc-content-switcher-dropdown-content-".concat(child.props.value), "aria-labelledby": "arc-content-switcher-dropdown-trigger-".concat(child.props.value), "data-state": isActive ? "active" : "inactive", tabIndex: -1, hidden: !isActive }, filterAttrs(child.props)), child));
|
|
63
63
|
})));
|
|
64
64
|
};
|
|
65
65
|
var ContentSwitcherDropdownContent = function (_a) {
|
package/lib/_shared/esm/{ContentSwitcherList-OnZoE86O.mjs → ContentSwitcherList-DKPD9GfN.mjs}
RENAMED
|
@@ -13,7 +13,7 @@ var ContentSwitcher = function (_a) {
|
|
|
13
13
|
|
|
14
14
|
var ContentSwitcherContent = function (_a) {
|
|
15
15
|
var children = _a.children, value = _a.value;
|
|
16
|
-
return (React__default.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { className: "arc-ContentSwitcherContent", value: value },
|
|
16
|
+
return (React__default.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { className: "arc-ContentSwitcherContent", value: value, tabIndex: -1 },
|
|
17
17
|
React__default.createElement("div", { className: "arc-ContentSwitcherContent-wrapper" }, children)));
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -64,11 +64,12 @@ var ContentSwitcherList = function (_a) {
|
|
|
64
64
|
list.removeEventListener("scroll", checkOverflow);
|
|
65
65
|
}
|
|
66
66
|
window.removeEventListener("resize", updateLayout);
|
|
67
|
+
handleResize.cancel();
|
|
67
68
|
};
|
|
68
69
|
}, [children, checkOverflow, handleResize]);
|
|
69
70
|
return (React__default.createElement("span", { className: classNames("arc-ContentSwitcherList-wrapper", {
|
|
70
71
|
"arc-ContentSwitcherList-wrapper--isInset": isInset,
|
|
71
|
-
}) },
|
|
72
|
+
}), tabIndex: -1 },
|
|
72
73
|
React__default.createElement($69cb30bb0017df05$export$54c2e3dc7acea9f5, __assign({ className: classNames("arc-ContentSwitcherList", {
|
|
73
74
|
"arc-ContentSwitcherList--contained": type === "contained",
|
|
74
75
|
"arc-ContentSwitcherList--isJustified": isJustified,
|
|
@@ -2,10 +2,10 @@ import { b as __spreadArray, _ as __rest, a as __assign, f as filterAttrs } from
|
|
|
2
2
|
import React__default, { forwardRef, useState, useRef, useEffect } from 'react';
|
|
3
3
|
import { c as classNames } from './index-5C0-U8cc.mjs';
|
|
4
4
|
import { R as Root2, A as Anchor2, P as Portal, C as Content2 } from './index-CxrL7jIX.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { i as isBefore, a as isAfter, c as compareAsc, C as Calendar } from './Calendar-CjqPM7ta.mjs';
|
|
6
6
|
import { r as requiredArgs, t as toDate, a as isValid, f as format } from './index-Cr6KeQLU.mjs';
|
|
7
7
|
import { e as useThemeElement } from './index-Bz2JQq34.mjs';
|
|
8
|
-
import { a as TextInputWithPlaceHolder } from './TextInput-
|
|
8
|
+
import { a as TextInputWithPlaceHolder } from './TextInput-Dk7qNGoh.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @name startOfDay
|
|
@@ -138,11 +138,43 @@ var convertRangeStringToDates = function (value) {
|
|
|
138
138
|
: []), true);
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
+
function validateRangeOnBlur(_a) {
|
|
142
|
+
var value = _a.value, minDate = _a.minDate, maxDate = _a.maxDate, disabledDates = _a.disabledDates, previousValidValue = _a.previousValidValue, dispatchChangeEvent = _a.dispatchChangeEvent, blurEvent = _a.blurEvent;
|
|
143
|
+
if (!isRangeValid(value))
|
|
144
|
+
return;
|
|
145
|
+
var _b = convertRangeStringToDates(value), start = _b[0], end = _b[1];
|
|
146
|
+
var isStartBeforeMin = minDate && isBefore(start, minDate);
|
|
147
|
+
var isEndAfterMax = maxDate && isAfter(end, maxDate);
|
|
148
|
+
var isStartDisabled = isDisabledDate(disabledDates, start);
|
|
149
|
+
var isEndDisabled = isDisabledDate(disabledDates, end);
|
|
150
|
+
if (isStartBeforeMin && isEndAfterMax) {
|
|
151
|
+
return dispatchChangeEvent(blurEvent, "".concat(formatDate(minDate), " - ").concat(formatDate(maxDate)));
|
|
152
|
+
}
|
|
153
|
+
if (isStartBeforeMin) {
|
|
154
|
+
return dispatchChangeEvent(blurEvent, "".concat(formatDate(minDate), " - ").concat(formatDate(end)));
|
|
155
|
+
}
|
|
156
|
+
if (isEndAfterMax) {
|
|
157
|
+
return dispatchChangeEvent(blurEvent, "".concat(formatDate(start), " - ").concat(formatDate(maxDate)));
|
|
158
|
+
}
|
|
159
|
+
if (isStartDisabled || isEndDisabled) {
|
|
160
|
+
var _c = previousValidValue
|
|
161
|
+
? convertRangeStringToDates(previousValidValue)
|
|
162
|
+
: [], prevStart = _c[0], prevEnd = _c[1];
|
|
163
|
+
return dispatchChangeEvent(blurEvent, prevStart && prevEnd
|
|
164
|
+
? "".concat(formatDate(prevStart), " - ").concat(formatDate(prevEnd))
|
|
165
|
+
: "");
|
|
166
|
+
}
|
|
167
|
+
if (isAfter(start, end)) {
|
|
168
|
+
var _d = [start, end].sort(compareAsc), orderedStart = _d[0], orderedEnd = _d[1];
|
|
169
|
+
return dispatchChangeEvent(blurEvent, "".concat(formatDate(orderedStart), " - ").concat(formatDate(orderedEnd)));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
141
173
|
/**
|
|
142
174
|
* Use `DatePicker` to clearly present available dates and allow users to choose a way to enter information.
|
|
143
175
|
*/
|
|
144
176
|
var DatePicker = forwardRef(function (_a, ref) {
|
|
145
|
-
var errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, label = _a.label, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, isRequired = _a.isRequired,
|
|
177
|
+
var errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, label = _a.label, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, isRequired = _a.isRequired, size = _a.size, _b = _a.value, value = _b === void 0 ? "" : _b, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onDateSelect = _a.onDateSelect, onRangeSelect = _a.onRangeSelect, onClickDisclosure = _a.onClickDisclosure, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, type = _a.type, _c = _a.isFluid, isFluid = _c === void 0 ? false : _c, _d = _a.selectionType, selectionType = _d === void 0 ? "single" : _d, disabledDates = _a.disabledDates, minDate = _a.minDate, maxDate = _a.maxDate, props = __rest(_a, ["errorMessage", "helper", "id", "label", "isDisabled", "isReadOnly", "isRequired", "size", "value", "name", "onBlur", "onChange", "onDateSelect", "onRangeSelect", "onClickDisclosure", "disclosureTitle", "disclosureText", "type", "isFluid", "selectionType", "disabledDates", "minDate", "maxDate"]);
|
|
146
178
|
var _e = useThemeElement(), themeElement = _e[0], setThemeElement = _e[1];
|
|
147
179
|
var _f = useState("Choose date"), ariaLabel = _f[0], setAriaLabel = _f[1];
|
|
148
180
|
var _g = useState(false), showCalendar = _g[0], setShowCalendar = _g[1];
|
|
@@ -216,32 +248,15 @@ var DatePicker = forwardRef(function (_a, ref) {
|
|
|
216
248
|
}
|
|
217
249
|
};
|
|
218
250
|
var handleRangeSelectionBlur = function (e) {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
if (isStartDateBeforeMinDate) {
|
|
229
|
-
return dispatchChangeEvent(e, "".concat(formatDate(minDate), " - ").concat(formatDate(end)));
|
|
230
|
-
}
|
|
231
|
-
if (isEndDateAfterMaxDate) {
|
|
232
|
-
return dispatchChangeEvent(e, "".concat(formatDate(start), " - ").concat(formatDate(maxDate)));
|
|
233
|
-
}
|
|
234
|
-
if (isStartDateDisabled || isEndDateDisabled) {
|
|
235
|
-
var _b = previousValidValue.current
|
|
236
|
-
? convertRangeStringToDates(previousValidValue.current)
|
|
237
|
-
: [], start_1 = _b[0], end_1 = _b[1];
|
|
238
|
-
return dispatchChangeEvent(e, start_1 && end_1 ? "".concat(formatDate(start_1), " - ").concat(formatDate(end_1)) : "");
|
|
239
|
-
}
|
|
240
|
-
if (isAfter(start, end)) {
|
|
241
|
-
var _c = [start, end].sort(compareAsc), orderedStart = _c[0], orderedEnd = _c[1];
|
|
242
|
-
return dispatchChangeEvent(e, "".concat(formatDate(orderedStart), " - ").concat(formatDate(orderedEnd)));
|
|
243
|
-
}
|
|
244
|
-
}
|
|
251
|
+
validateRangeOnBlur({
|
|
252
|
+
value: value,
|
|
253
|
+
minDate: minDate,
|
|
254
|
+
maxDate: maxDate,
|
|
255
|
+
disabledDates: disabledDates,
|
|
256
|
+
previousValidValue: previousValidValue.current,
|
|
257
|
+
dispatchChangeEvent: dispatchChangeEvent,
|
|
258
|
+
blurEvent: e,
|
|
259
|
+
});
|
|
245
260
|
};
|
|
246
261
|
var handleBlur = function (e) {
|
|
247
262
|
onBlur && onBlur(e);
|
|
@@ -298,7 +313,7 @@ var DatePicker = forwardRef(function (_a, ref) {
|
|
|
298
313
|
icon: "datePickerCalendar",
|
|
299
314
|
label: ariaLabel,
|
|
300
315
|
ref: buttonRef,
|
|
301
|
-
}, placeholder: placeHolder, errorMessage: errorMessage, helper: helper, id: id, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, label: label,
|
|
316
|
+
}, placeholder: placeHolder, errorMessage: errorMessage, helper: helper, id: id, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, label: label, maxLength: selectionType === "range" ? 23 : 10, name: name, onBlur: handleBlur, onChange: handleChange, onClickDisclosure: onClickDisclosure, type: "text", value: value, disclosureTitle: disclosureTitle, disclosureText: disclosureText, size: size }, props, filterAttrs(props))),
|
|
302
317
|
React__default.createElement(Root2, __assign({ open: showCalendar, onOpenChange: handleCalendarOpenChange }, filterAttrs(props)),
|
|
303
318
|
React__default.createElement(Anchor2, null),
|
|
304
319
|
React__default.createElement(Portal, { container: themeElement },
|
|
@@ -306,4 +321,4 @@ var DatePicker = forwardRef(function (_a, ref) {
|
|
|
306
321
|
React__default.createElement(Calendar, { autoFocusOnMount: true, type: type, onCancelClick: onCancelClick, selectionType: selectionType, selectedDate: convertDateStringToDate(value), selectedRange: convertRangeStringToDates(value), disabledDates: disabledDates, minDate: minDate, maxDate: maxDate, onDateSelect: handleDateSelect, onRangeSelect: handleRangeSelect }))))));
|
|
307
322
|
});
|
|
308
323
|
|
|
309
|
-
export { DATE_FORMAT as D,
|
|
324
|
+
export { DATE_FORMAT as D, isRangeValid as a, parseDateString as b, convertRangeStringToDates as c, DatePicker as d, formatDate as f, isDateValid as i, parseRangeString as p, validateRangeOnBlur as v };
|