@arc-ui/components 12.1.0 → 13.1.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 +7 -3
- package/lib/Banner/Banner.mjs +7 -3
- package/lib/Box/styles.css +1 -1
- package/lib/BrandLogo/styles.css +1 -1
- package/lib/Breadcrumbs/Breadcrumbs.cjs +6 -6
- package/lib/Breadcrumbs/Breadcrumbs.mjs +6 -6
- 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 +5 -5
- package/lib/Calendar/Calendar.mjs +5 -5
- 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 +26 -14
- package/lib/Carousel/Carousel.mjs +26 -14
- 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/ClientSideVisible/ClientSideVisible.cjs +1 -0
- package/lib/ClientSideVisible/ClientSideVisible.mjs +1 -0
- package/lib/Columns/styles.css +1 -1
- package/lib/ComboBox/ComboBox.cjs +537 -143
- package/lib/ComboBox/ComboBox.mjs +537 -143
- package/lib/ComboBox/styles.css +1 -1
- package/lib/ConditionalWrapper/ConditionalWrapper.cjs +1 -0
- package/lib/ConditionalWrapper/ConditionalWrapper.mjs +1 -0
- 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 +16 -16
- package/lib/DatePicker/DatePicker.mjs +17 -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 +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 +2 -2
- package/lib/GradientPageBackground/GradientPageBackground.mjs +2 -2
- package/lib/GradientPageBackground/styles.css +1 -1
- package/lib/Grid/Grid.cjs +1 -0
- package/lib/Grid/Grid.mjs +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 +7 -3
- package/lib/HeroBanner/HeroBanner.mjs +7 -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 +30 -17
- package/lib/ImpactCard/ImpactCard.mjs +31 -18
- package/lib/ImpactCard/styles.css +1 -1
- package/lib/InformationCard/InformationCard.cjs +59 -35
- package/lib/InformationCard/InformationCard.mjs +61 -37
- 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 +43 -24
- package/lib/MediaCard/MediaCard.mjs +44 -25
- 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 +18 -18
- package/lib/NavigationHeader/NavigationHeader.mjs +19 -19
- 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 +1 -1
- package/lib/ProgressStepper/ProgressStepper.mjs +1 -1
- package/lib/ProgressStepper/styles.css +1 -1
- package/lib/ProgressStepperOverflow/ProgressStepperOverflow.cjs +4 -4
- package/lib/ProgressStepperOverflow/ProgressStepperOverflow.mjs +5 -5
- package/lib/ProgressStepperOverflow/styles.css +1 -1
- package/lib/RadioCardGroup/RadioCardGroup.cjs +6 -6
- package/lib/RadioCardGroup/RadioCardGroup.mjs +7 -7
- package/lib/RadioCardGroup/styles.css +1 -1
- package/lib/RadioGroup/RadioGroup.cjs +8 -7
- package/lib/RadioGroup/RadioGroup.mjs +9 -8
- 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 +4 -3
- package/lib/SiteFooterV2/SiteFooterV2.mjs +4 -3
- package/lib/SiteFooterV2/styles.css +1 -1
- package/lib/SiteHeaderV2/SiteHeaderV2.cjs +9 -6
- package/lib/SiteHeaderV2/SiteHeaderV2.mjs +9 -6
- package/lib/SiteHeaderV2/styles.css +1 -1
- package/lib/Skeleton/styles.css +1 -1
- package/lib/SkipLink/SkipLink.cjs +3 -2
- package/lib/SkipLink/SkipLink.mjs +4 -3
- package/lib/SkipLink/styles.css +1 -1
- package/lib/Spacing/Spacing.cjs +38 -0
- package/lib/Spacing/Spacing.mjs +36 -0
- package/lib/Spacing/styles.css +1 -0
- 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 +13 -11
- package/lib/TabbedBanner/TabbedBanner.mjs +16 -14
- package/lib/TabbedBanner/styles.css +1 -1
- package/lib/Tabs/Tabs.cjs +57 -25
- package/lib/Tabs/Tabs.mjs +60 -28
- package/lib/Tabs/styles.css +1 -1
- package/lib/Tag/styles.css +1 -1
- package/lib/TemplateBanner/TemplateBanner.cjs +5 -1
- package/lib/TemplateBanner/TemplateBanner.mjs +5 -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 +40 -16
- package/lib/TypographyCard/TypographyCard.mjs +41 -17
- 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-D_jZ0cgf.cjs → Calendar-CLWtKvPh.cjs} +6 -6
- 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-DgychllS.cjs → ContentSwitcherList-Di7RS8ue.cjs} +20 -9
- package/lib/_shared/cjs/{Popover-CYcqjefw.cjs → Popover-BxuQPltF.cjs} +8 -5
- package/lib/_shared/cjs/{ProgressStepper-mTgKZYEl.cjs → ProgressStepper-Cs6vX7Th.cjs} +3 -3
- package/lib/_shared/cjs/{Rule-jmvOpci7.cjs → Rule-essaguo_.cjs} +2 -2
- package/lib/_shared/cjs/{TemplateBanner-CzDAL0lq.cjs → TemplateBanner-rdwgmFH_.cjs} +36 -6
- package/lib/_shared/cjs/{TextInput-BHzuoI7E.cjs → TextInput-CLkhL2KT.cjs} +45 -12
- package/lib/_shared/cjs/{Tooltip-CEb7YEP2.cjs → Tooltip-CdmWvrnr.cjs} +2 -2
- package/lib/_shared/cjs/{arc-breakpoints-DFPoWNR4.cjs → arc-breakpoints-JJMLGzht.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-B2ZfX2D7.cjs → index.es-CCJ64o4N.cjs} +1 -1
- 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-wG6UVDgO.mjs → Calendar-BcYEIJhA.mjs} +7 -7
- 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-CWZcMblg.mjs → ContentSwitcherList-Bvp9Zl85.mjs} +22 -11
- package/lib/_shared/esm/{Popover-BHCEpLSa.mjs → Popover-Pjtmu_TN.mjs} +8 -5
- package/lib/_shared/esm/{ProgressStepper-DxZrJR0q.mjs → ProgressStepper-DTPHHVFe.mjs} +4 -4
- package/lib/_shared/esm/{Rule-I1w3EaZi.mjs → Rule-Bz3QPezk.mjs} +3 -3
- package/lib/_shared/esm/{TemplateBanner-CZSTdma0.mjs → TemplateBanner-DzU9Edky.mjs} +37 -7
- package/lib/_shared/esm/{TextInput-CZaNXVHl.mjs → TextInput-WczTCUvp.mjs} +47 -14
- package/lib/_shared/esm/{Tooltip-BpSzN3Tx.mjs → Tooltip-DY8nS1to.mjs} +2 -2
- package/lib/_shared/esm/{arc-breakpoints-TEKN0W5t.mjs → arc-breakpoints-CQOgeFK_.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-Co1d96HB.mjs → index.es-BJl4zTyt.mjs} +1 -1
- package/lib/index.cjs +4993 -4362
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1221 -327
- package/lib/index.d.mts +1221 -327
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +4992 -4362
- package/lib/index.mjs.map +1 -1
- package/lib/styles.css +6 -2
- package/package.json +12 -12
|
@@ -9,15 +9,16 @@ var FormControl = require('./FormControl-TtboqHRx.cjs');
|
|
|
9
9
|
|
|
10
10
|
/** Use `CheckboxIcon` to display a visual checkbox indicator that reflects a checked, unchecked, or indeterminate state. */
|
|
11
11
|
var CheckboxIcon = function (_a) {
|
|
12
|
-
var id = _a.id, name = _a.name, checked = _a.checked, _b = _a.indeterminate, indeterminate = _b === void 0 ? false : _b, isDisabled = _a.isDisabled, isRequired = _a.isRequired, _c = _a.size, size = _c === void 0 ? "m" : _c, value = _a.value, error = _a.error, ariaDescribedBy = _a.ariaDescribedBy, onBlur = _a.onBlur, onChange = _a.onChange, props = tslib_es6.__rest(_a, ["id", "name", "checked", "indeterminate", "isDisabled", "isRequired", "size", "value", "error", "ariaDescribedBy", "onBlur", "onChange"]);
|
|
12
|
+
var id = _a.id, name = _a.name, checked = _a.checked, _b = _a.indeterminate, indeterminate = _b === void 0 ? false : _b, isDisabled = _a.isDisabled, isRequired = _a.isRequired, _c = _a.size, size = _c === void 0 ? "m" : _c, value = _a.value, error = _a.error, ariaDescribedBy = _a.ariaDescribedBy, onBlur = _a.onBlur, onChange = _a.onChange, ref = _a.ref, props = tslib_es6.__rest(_a, ["id", "name", "checked", "indeterminate", "isDisabled", "isRequired", "size", "value", "error", "ariaDescribedBy", "onBlur", "onChange", "ref"]);
|
|
13
13
|
var requirementStatus = React.useContext(FormControl.Context).requirementStatus;
|
|
14
14
|
var internalRef = React.useRef(null);
|
|
15
15
|
var surface = React.useContext(Surface.Context).surface;
|
|
16
|
+
var inputRef = (ref || internalRef);
|
|
16
17
|
React.useEffect(function () {
|
|
17
|
-
if (
|
|
18
|
-
|
|
18
|
+
if (inputRef.current) {
|
|
19
|
+
inputRef.current.indeterminate = indeterminate;
|
|
19
20
|
}
|
|
20
|
-
}, [indeterminate, checked]);
|
|
21
|
+
}, [indeterminate, checked, inputRef]);
|
|
21
22
|
var tickSize = {
|
|
22
23
|
s: 14,
|
|
23
24
|
m: 18,
|
|
@@ -45,7 +46,7 @@ var CheckboxIcon = function (_a) {
|
|
|
45
46
|
? true
|
|
46
47
|
: indeterminate && checked
|
|
47
48
|
? "mixed"
|
|
48
|
-
: false, className: index.classNames("arc-CheckboxIcon-input"), disabled: isDisabled, id: id, name: name, onBlur: onBlur, onChange: onChange, ref:
|
|
49
|
+
: false, className: index.classNames("arc-CheckboxIcon-input"), disabled: isDisabled, id: id, name: name, onBlur: onBlur, onChange: onChange, ref: inputRef, required: isRequired, type: "checkbox", value: value }, checkedProps, props)),
|
|
49
50
|
React.createElement("span", { className: index.classNames("arc-CheckboxIcon-box") }, indeterminate ? (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "none" },
|
|
50
51
|
React.createElement("rect", { x: "4", y: "8", width: "7.51", height: "1", rx: "0.5", fill: "currentColor" }))) : (React.createElement(ThemeIcon.ThemeIcon, { icon: "checkboxChecked", size: tickSize[size] })))));
|
|
51
52
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-DlWZZNwu.cjs');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var ReactDOM = require('react-dom');
|
|
8
8
|
var tslib_es6 = require('./tslib.es6-CCZ3TN_7.cjs');
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var tslib_es6 = require('./tslib.es6-CCZ3TN_7.cjs');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var index$2 = require('./index-CTlXMLug.cjs');
|
|
6
|
-
var index$1 = require('./index-
|
|
6
|
+
var index$1 = require('./index-Dgn0408w.cjs');
|
|
7
7
|
var filterAttrs = require('./filter-attrs-D19P2s1V.cjs');
|
|
8
8
|
var ThemeIcon = require('./ThemeIcon-CwYN77IF.cjs');
|
|
9
|
-
var index = require('./index-
|
|
9
|
+
var index = require('./index-DlWZZNwu.cjs');
|
|
10
10
|
var VisuallyHidden = require('./VisuallyHidden-CQg3cOVK.cjs');
|
|
11
11
|
|
|
12
12
|
// src/get-text-width/get-text-width.ts
|
package/lib/_shared/cjs/{ContentSwitcherList-DgychllS.cjs → ContentSwitcherList-Di7RS8ue.cjs}
RENAMED
|
@@ -5,6 +5,7 @@ var React = require('react');
|
|
|
5
5
|
var index = require('./index-BCu-VH8y.cjs');
|
|
6
6
|
var filterAttrs = require('./filter-attrs-D19P2s1V.cjs');
|
|
7
7
|
var Text = require('./Text-jwsn80lQ.cjs');
|
|
8
|
+
var Surface = require('./Surface-DIU5ciDT.cjs');
|
|
8
9
|
var debounce = require('./debounce-uPMetQ6J.cjs');
|
|
9
10
|
var index$1 = require('./index-CTlXMLug.cjs');
|
|
10
11
|
|
|
@@ -15,11 +16,12 @@ var ContentSwitcher = function (_a) {
|
|
|
15
16
|
React.createElement(index.$69cb30bb0017df05$export$be92b6f5f03c0fe9, tslib_es6.__assign({ className: "arc-ContentSwitcher-root", defaultValue: defaultValue, onValueChange: onValueChange, activationMode: activationMode, value: value }, filterAttrs.filterAttrs(props)), children)));
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
var ContentSwitcherTab =
|
|
19
|
-
var label = _a.label, value = _a.value, onClick = _a.onClick, onFocus = _a.onFocus, props = tslib_es6.__rest(_a, ["label", "value", "onClick", "onFocus"]);
|
|
20
|
-
return (React.createElement(
|
|
21
|
-
React.createElement(
|
|
22
|
-
});
|
|
19
|
+
var ContentSwitcherTab = function (_a) {
|
|
20
|
+
var label = _a.label, value = _a.value, onClick = _a.onClick, onFocus = _a.onFocus, ref = _a.ref, props = tslib_es6.__rest(_a, ["label", "value", "onClick", "onFocus", "ref"]);
|
|
21
|
+
return (React.createElement(Surface.Surface, { isTransparent: true },
|
|
22
|
+
React.createElement(index.$69cb30bb0017df05$export$41fb9f06171c75f4, tslib_es6.__assign({ className: "arc-ContentSwitcherTab", value: value, ref: ref, onClick: onClick, onFocus: onFocus }, filterAttrs.filterAttrs(props)),
|
|
23
|
+
React.createElement(Text.Text, { size: "m" }, label))));
|
|
24
|
+
};
|
|
23
25
|
|
|
24
26
|
var ContentSwitcherContent = function (_a) {
|
|
25
27
|
var children = _a.children, value = _a.value, _b = _a.hidden, hidden = _b === void 0 ? undefined : _b, _c = _a.forceMount, forceMount = _c === void 0 ? true : _c, props = tslib_es6.__rest(_a, ["children", "value", "hidden", "forceMount"]);
|
|
@@ -85,14 +87,23 @@ var ContentSwitcherList = function (_a) {
|
|
|
85
87
|
"arc-ContentSwitcherList--isJustified": isJustified,
|
|
86
88
|
}), ref: listRef, "aria-label": ariaLabel }, filterAttrs.filterAttrs(props)),
|
|
87
89
|
React.createElement("div", { className: "arc-ContentSwitcherList-inner" }, React.Children.map(children, function (child, index) {
|
|
88
|
-
if (
|
|
90
|
+
if (!React.isValidElement(child)) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
if (tabRefs.current[index] !== null) {
|
|
89
94
|
return React.cloneElement(child, {
|
|
90
|
-
ref: function (el) {
|
|
95
|
+
ref: function (el) {
|
|
96
|
+
tabRefs.current[index] = el;
|
|
97
|
+
},
|
|
91
98
|
onClick: function () {
|
|
92
|
-
|
|
99
|
+
var el = tabRefs.current[index];
|
|
100
|
+
if (el)
|
|
101
|
+
scrollTabIntoView({ current: el });
|
|
93
102
|
},
|
|
94
103
|
onFocus: function () {
|
|
95
|
-
|
|
104
|
+
var el = tabRefs.current[index];
|
|
105
|
+
if (el)
|
|
106
|
+
scrollTabIntoView({ current: el });
|
|
96
107
|
},
|
|
97
108
|
});
|
|
98
109
|
}
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
var tslib_es6 = require('./tslib.es6-CCZ3TN_7.cjs');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var index$2 = require('./index-CTlXMLug.cjs');
|
|
6
|
-
var index$1 = require('./index-
|
|
6
|
+
var index$1 = require('./index-DsqYRMfM.cjs');
|
|
7
7
|
var filterAttrs = require('./filter-attrs-D19P2s1V.cjs');
|
|
8
|
-
var index = require('./index-
|
|
8
|
+
var index = require('./index-DlWZZNwu.cjs');
|
|
9
9
|
var Surface = require('./Surface-DIU5ciDT.cjs');
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Use `Popover` to display content in a portal, triggered by a button.
|
|
13
13
|
*/
|
|
14
14
|
var Popover = function (_a) {
|
|
15
|
-
var align = _a.align, ariaLabel = _a.ariaLabel, alignOffset = _a.alignOffset, _b = _a.arrow, arrow = _b === void 0 ? true : _b, _c = _a.background, background = _c === void 0 ? "light" : _c, children = _a.children, content = _a.content, _d = _a.asChild, asChild = _d === void 0 ? false : _d, _e = _a.maxWidth, maxWidth = _e === void 0 ? 452 : _e, minHeight = _a.minHeight, onCloseAutoFocus = _a.onCloseAutoFocus, onEscapeKeyDown = _a.onEscapeKeyDown, onFocusOutside = _a.onFocusOutside, onInteractOutside = _a.onInteractOutside, onOpenAutoFocus = _a.onOpenAutoFocus, onPointerDownOutside = _a.onPointerDownOutside, onOpenChange = _a.onOpenChange, open = _a.open, _f = _a.constrainToViewport, constrainToViewport = _f === void 0 ? true : _f, side = _a.side, _g = _a.sideOffset, sideOffset = _g === void 0 ? 0 : _g, _h = _a.zIndex, zIndex = _h === void 0 ? 100 : _h, _j = _a.hideWhenDetached, hideWhenDetached = _j === void 0 ? false : _j, _k = _a.useBespokeTrigger, useBespokeTrigger = _k === void 0 ? false : _k, props = tslib_es6.__rest(_a, ["align", "ariaLabel", "alignOffset", "arrow", "background", "children", "content", "asChild", "maxWidth", "minHeight", "onCloseAutoFocus", "onEscapeKeyDown", "onFocusOutside", "onInteractOutside", "onOpenAutoFocus", "onPointerDownOutside", "onOpenChange", "open", "constrainToViewport", "side", "sideOffset", "zIndex", "hideWhenDetached", "useBespokeTrigger"]);
|
|
16
|
-
var
|
|
15
|
+
var align = _a.align, ariaLabel = _a.ariaLabel, alignOffset = _a.alignOffset, _b = _a.arrow, arrow = _b === void 0 ? true : _b, _c = _a.background, background = _c === void 0 ? "light" : _c, children = _a.children, content = _a.content, _d = _a.asChild, asChild = _d === void 0 ? false : _d, _e = _a.maxWidth, maxWidth = _e === void 0 ? 452 : _e, minHeight = _a.minHeight, onCloseAutoFocus = _a.onCloseAutoFocus, onEscapeKeyDown = _a.onEscapeKeyDown, onFocusOutside = _a.onFocusOutside, onInteractOutside = _a.onInteractOutside, onOpenAutoFocus = _a.onOpenAutoFocus, onPointerDownOutside = _a.onPointerDownOutside, onOpenChange = _a.onOpenChange, open = _a.open, _f = _a.constrainToViewport, constrainToViewport = _f === void 0 ? true : _f, side = _a.side, _g = _a.sideOffset, sideOffset = _g === void 0 ? 0 : _g, _h = _a.zIndex, zIndex = _h === void 0 ? 100 : _h, _j = _a.hideWhenDetached, hideWhenDetached = _j === void 0 ? false : _j, _k = _a.useBespokeTrigger, useBespokeTrigger = _k === void 0 ? false : _k, _l = _a.isFluidToViewport, isFluidToViewport = _l === void 0 ? false : _l, _m = _a.contentMargin, contentMargin = _m === void 0 ? false : _m, _o = _a.isFullBleed, isFullBleed = _o === void 0 ? false : _o, className = _a.className, props = tslib_es6.__rest(_a, ["align", "ariaLabel", "alignOffset", "arrow", "background", "children", "content", "asChild", "maxWidth", "minHeight", "onCloseAutoFocus", "onEscapeKeyDown", "onFocusOutside", "onInteractOutside", "onOpenAutoFocus", "onPointerDownOutside", "onOpenChange", "open", "constrainToViewport", "side", "sideOffset", "zIndex", "hideWhenDetached", "useBespokeTrigger", "isFluidToViewport", "contentMargin", "isFullBleed", "className"]);
|
|
16
|
+
var _p = index.useThemeElement(), themeElement = _p[0], setThemeElement = _p[1];
|
|
17
17
|
var alignOffsetDefault = align === "center" ? 0 : -16;
|
|
18
18
|
return (React.createElement("div", tslib_es6.__assign({ className: "arc-Popover" }, filterAttrs.filterAttrs(props)),
|
|
19
19
|
React.createElement(index$1.Root2, { open: open, onOpenChange: onOpenChange },
|
|
@@ -21,12 +21,15 @@ var Popover = function (_a) {
|
|
|
21
21
|
React.createElement("div", { ref: setThemeElement },
|
|
22
22
|
React.createElement(index$1.Portal, { container: themeElement },
|
|
23
23
|
React.createElement("div", { "data-cy": "z-index", style: { position: "absolute", zIndex: zIndex } },
|
|
24
|
-
React.createElement(index$1.Content2, { side: side, sideOffset: sideOffset, align: align, hideWhenDetached: hideWhenDetached, alignOffset: alignOffset !== null && alignOffset !== void 0 ? alignOffset : alignOffsetDefault, onOpenAutoFocus: onOpenAutoFocus, onCloseAutoFocus: onCloseAutoFocus, onEscapeKeyDown: onEscapeKeyDown, onPointerDownOutside: onPointerDownOutside, onFocusOutside: onFocusOutside, onInteractOutside: onInteractOutside },
|
|
24
|
+
React.createElement(index$1.Content2, { side: side, sideOffset: sideOffset, align: align, hideWhenDetached: hideWhenDetached, alignOffset: alignOffset !== null && alignOffset !== void 0 ? alignOffset : alignOffsetDefault, onOpenAutoFocus: onOpenAutoFocus, onCloseAutoFocus: onCloseAutoFocus, onEscapeKeyDown: onEscapeKeyDown, onPointerDownOutside: onPointerDownOutside, onFocusOutside: onFocusOutside, onInteractOutside: onInteractOutside, className: className },
|
|
25
25
|
React.createElement(Surface.Surface, { isTransparent: true, background: background === "light" ? "light-white" : "dark-black" },
|
|
26
26
|
React.createElement("div", { className: index$2.classNames("arc-Popover-content", {
|
|
27
27
|
"arc-Popover-content--dark": background === "dark",
|
|
28
28
|
"arc-Popover-content--brand": background === "brand",
|
|
29
29
|
"arc-Popover-content--constrainToViewport": constrainToViewport,
|
|
30
|
+
"arc-Popover-content--isFluidToViewport": isFluidToViewport,
|
|
31
|
+
"arc-Popover-content--contentMargin": contentMargin,
|
|
32
|
+
"arc-Popover-content--isFullBleed": isFullBleed,
|
|
30
33
|
}), style: { maxWidth: maxWidth, minHeight: minHeight }, "aria-labelledby": "popover-content" },
|
|
31
34
|
content && React.createElement("div", { id: "popover-content" }, content),
|
|
32
35
|
arrow && (React.createElement(index$1.PopoverArrow, { className: "arc-Popover-arrow" })))))))))));
|
|
@@ -193,8 +193,8 @@ var ProgressStepperItem = function (_a) {
|
|
|
193
193
|
};
|
|
194
194
|
|
|
195
195
|
/** Use `ProgressStepper` to provide an overview of a series of steps in a digital journey. */
|
|
196
|
-
var ProgressStepper =
|
|
197
|
-
var children = _a.children, size = _a.size, isFluid = _a.isFluid, direction = _a.direction, isExpandable = _a.isExpandable, invertLabelPosition = _a.invertLabelPosition, currentStep = _a.currentStep, props = tslib_es6.__rest(_a, ["children", "size", "isFluid", "direction", "isExpandable", "invertLabelPosition", "currentStep"]);
|
|
196
|
+
var ProgressStepper = function (_a) {
|
|
197
|
+
var ref = _a.ref, children = _a.children, size = _a.size, isFluid = _a.isFluid, direction = _a.direction, isExpandable = _a.isExpandable, invertLabelPosition = _a.invertLabelPosition, currentStep = _a.currentStep, props = tslib_es6.__rest(_a, ["ref", "children", "size", "isFluid", "direction", "isExpandable", "invertLabelPosition", "currentStep"]);
|
|
198
198
|
var items = React.Children.toArray(children);
|
|
199
199
|
var getStepStatus = function (item) {
|
|
200
200
|
var _a;
|
|
@@ -204,7 +204,7 @@ var ProgressStepper = React.forwardRef(function (_a, ref) {
|
|
|
204
204
|
"arc-ProgressStepper--vertical": direction === "vertical",
|
|
205
205
|
}) }, filterAttrs.filterAttrs(props)), items.map(function (item, index) { return (React.createElement(React.Fragment, { key: "StepperItem-".concat(index) },
|
|
206
206
|
React.createElement(ProgressStepperItem, tslib_es6.__assign({ title: item.props.title, titleHref: item.props.titleHref, subTitle: item.props.subTitle, status: item.props.status, stepContent: item.props.stepContent, ariaLabel: item.props.ariaLabel, isStepContentHidden: item.props.isStepContentHidden, onClick: item.props.onClick, isFluid: isFluid, invertLabelPosition: invertLabelPosition, direction: direction, isExpandable: isExpandable, size: size, isViewing: currentStep !== undefined ? currentStep === index : undefined, previousStep: getStepStatus(items[index - 1]) }, filterAttrs.filterAttrs(item.props))))); })));
|
|
207
|
-
}
|
|
207
|
+
};
|
|
208
208
|
|
|
209
209
|
exports.ProgressStepper = ProgressStepper;
|
|
210
210
|
exports.ProgressStepperItem = ProgressStepperItem;
|
|
@@ -9,9 +9,9 @@ var Surface = require('./Surface-DIU5ciDT.cjs');
|
|
|
9
9
|
/**
|
|
10
10
|
* Use `Rule` to display a horizontal or vertical rule.
|
|
11
11
|
*/
|
|
12
|
-
var Rule = function (_a
|
|
12
|
+
var Rule = function (_a) {
|
|
13
13
|
var _b;
|
|
14
|
-
var _c = _a.orientation, orientation = _c === void 0 ? "horizontal" : _c;
|
|
14
|
+
var _c = _a.orientation, orientation = _c === void 0 ? "horizontal" : _c, props = tslib_es6.__rest(_a, ["orientation"]);
|
|
15
15
|
var surface = React.useContext(Surface.Context).surface;
|
|
16
16
|
return (React.createElement("hr", tslib_es6.__assign({ className: index.classNames((_b = {
|
|
17
17
|
"arc-Rule": true
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
var tslib_es6 = require('./tslib.es6-CCZ3TN_7.cjs');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var index = require('./index-CTlXMLug.cjs');
|
|
6
|
+
var debounce = require('./debounce-uPMetQ6J.cjs');
|
|
6
7
|
var filterAttrs = require('./filter-attrs-D19P2s1V.cjs');
|
|
8
|
+
var arcBreakpoints = require('./arc-breakpoints-JJMLGzht.cjs');
|
|
7
9
|
var VerticalSpace = require('./VerticalSpace-DLQUYsvc.cjs');
|
|
8
10
|
var Box = require('./Box-Va2g7Gdp.cjs');
|
|
9
11
|
var Heading = require('./Heading-BYBmZkmS.cjs');
|
|
@@ -23,7 +25,7 @@ var BannerRow = function (_a) {
|
|
|
23
25
|
|
|
24
26
|
/** Use `TemplateBanner` as a base structure for banner components; other banner variants extend or consume this template. */
|
|
25
27
|
var TemplateBanner = function (_a) {
|
|
26
|
-
var heading = _a.heading, _b = _a.fontStyle, fontStyle = _b === void 0 ? "default" : _b, label = _a.label, _c = _a.labelLevel, labelLevel = _c === void 0 ? "3" : _c, text = _a.text, img = _a.img, _d = _a.contentRatio, contentRatio = _d === void 0 ? "1/1" : _d, children = _a.children, _e = _a.alignment, alignment = _e === void 0 ? "center" : _e, additionalTopMargin = _a.additionalTopMargin, _f = _a.minHeight, minHeight = _f === void 0 ? 454 : _f, minHeightM = _a.minHeightM, minHeightL = _a.minHeightL, minHeightXL = _a.minHeightXL, _g = _a.headingSize, headingSize = _g === void 0 ? "xl" : _g, _h = _a.isReversed, isReversed = _h === void 0 ? false : _h, _j = _a.isElevated, isElevated = _j === void 0 ? false : _j, _k = _a.headingLevel, headingLevel = _k === void 0 ? "2" : _k, _l = _a.type, type =
|
|
28
|
+
var heading = _a.heading, _b = _a.fontStyle, fontStyle = _b === void 0 ? "default" : _b, label = _a.label, _c = _a.labelLevel, labelLevel = _c === void 0 ? "3" : _c, text = _a.text, img = _a.img, _d = _a.contentRatio, contentRatio = _d === void 0 ? "1/1" : _d, contentRatios = _a.contentRatios, children = _a.children, _e = _a.alignment, alignment = _e === void 0 ? "center" : _e, additionalTopMargin = _a.additionalTopMargin, _f = _a.minHeight, minHeight = _f === void 0 ? 454 : _f, minHeightM = _a.minHeightM, minHeightL = _a.minHeightL, minHeightXL = _a.minHeightXL, _g = _a.headingSize, headingSize = _g === void 0 ? "xl" : _g, _h = _a.isReversed, isReversed = _h === void 0 ? false : _h, _j = _a.isElevated, isElevated = _j === void 0 ? false : _j, _k = _a.headingLevel, headingLevel = _k === void 0 ? "2" : _k, _l = _a.headingWordWrap, headingWordWrap = _l === void 0 ? false : _l, _m = _a.type, type = _m === void 0 ? "light" : _m, props = tslib_es6.__rest(_a, ["heading", "fontStyle", "label", "labelLevel", "text", "img", "contentRatio", "contentRatios", "children", "alignment", "additionalTopMargin", "minHeight", "minHeightM", "minHeightL", "minHeightXL", "headingSize", "isReversed", "isElevated", "headingLevel", "headingWordWrap", "type"]);
|
|
27
29
|
var backgrounds = {
|
|
28
30
|
dark: "dark-brand-02",
|
|
29
31
|
light: "light-white",
|
|
@@ -49,6 +51,30 @@ var TemplateBanner = function (_a) {
|
|
|
49
51
|
? "".concat(minHeightXL, "px")
|
|
50
52
|
: "auto",
|
|
51
53
|
};
|
|
54
|
+
var _o = React.useState("1/1"), contentRatiosPerBreakpoint = _o[0], setContentRatios = _o[1];
|
|
55
|
+
var checkContentRatio = debounce.debounce(function () {
|
|
56
|
+
if (contentRatios) {
|
|
57
|
+
for (var _i = 0, _a = Object.entries(arcBreakpoints.ArcBreakpoints); _i < _a.length; _i++) {
|
|
58
|
+
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
59
|
+
if (window.innerWidth > value) {
|
|
60
|
+
var ratio = contentRatios === null || contentRatios === void 0 ? void 0 : contentRatios[key];
|
|
61
|
+
if (ratio) {
|
|
62
|
+
setContentRatios(ratio);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
setContentRatios(contentRatio);
|
|
69
|
+
}, 100);
|
|
70
|
+
React.useEffect(function () {
|
|
71
|
+
checkContentRatio();
|
|
72
|
+
window.addEventListener("resize", checkContentRatio);
|
|
73
|
+
return function () {
|
|
74
|
+
window.removeEventListener("resize", checkContentRatio);
|
|
75
|
+
checkContentRatio.cancel();
|
|
76
|
+
};
|
|
77
|
+
}, [contentRatios, checkContentRatio]);
|
|
52
78
|
return (React.createElement("div", tslib_es6.__assign({ style: templateBannerStyles, className: index.classNames("arc-TemplateBanner arc-TemplateBanner-background--".concat(type), {
|
|
53
79
|
"arc-TemplateBanner--elevation": isElevated,
|
|
54
80
|
"arc-TemplateBanner--minHeightM": minHeightM,
|
|
@@ -60,24 +86,28 @@ var TemplateBanner = function (_a) {
|
|
|
60
86
|
React.createElement(BannerRow, { "data-testid": "arc-TemplateBanner-gridRow", isReversed: isReversed },
|
|
61
87
|
React.createElement(GridRow.GridCol, { "data-testid": "arc-TemplateBanner-contentCol", align: {
|
|
62
88
|
m: alignment === "start" ? "start" : "center",
|
|
63
|
-
xs: !img ||
|
|
64
|
-
|
|
89
|
+
xs: !img || contentRatiosPerBreakpoint === "1/0"
|
|
90
|
+
? "center"
|
|
91
|
+
: "start",
|
|
92
|
+
}, xs: 12, order: { xs: isContained && isReversed ? 1 : 0, m: 0 }, m: img ? columnWithImgWidths[contentRatiosPerBreakpoint] : 12 },
|
|
65
93
|
React.createElement("div", { className: index.classNames("arc-TemplateBanner-content", {
|
|
66
94
|
"arc-TemplateBanner-content--additionalTopMargin": additionalTopMargin && alignment === "start",
|
|
67
95
|
}) },
|
|
68
96
|
label && (React.createElement(React.Fragment, null,
|
|
69
97
|
React.createElement(Heading.Heading, { level: labelLevel, fontStyle: "overline", isWordWrap: false }, label),
|
|
70
98
|
React.createElement(VerticalSpace.VerticalSpace, { size: "8" }))),
|
|
71
|
-
React.createElement(Heading.Heading, { level: headingLevel, size: headingSize, fontStyle: fontStyle, isWordWrap:
|
|
99
|
+
React.createElement(Heading.Heading, { level: headingLevel, size: headingSize, fontStyle: fontStyle, isWordWrap: headingWordWrap }, heading),
|
|
72
100
|
text && (React.createElement(React.Fragment, null,
|
|
73
101
|
React.createElement(VerticalSpace.VerticalSpace, { size: "16" }),
|
|
74
102
|
React.createElement("span", { className: "arc-TemplateBanner-text" }, text))),
|
|
75
103
|
children && (React.createElement("span", null,
|
|
76
104
|
React.createElement(VerticalSpace.VerticalSpace, { size: "32" }),
|
|
77
105
|
children)))),
|
|
78
|
-
img &&
|
|
106
|
+
img && contentRatiosPerBreakpoint !== "1/0" && (React.createElement(GridRow.GridCol, tslib_es6.__assign({ "data-testid": "arc-TemplateBanner-imageCol", align: img.fit !== "cover"
|
|
79
107
|
? { m: imageAlignment[img.alignment || "center"] }
|
|
80
|
-
: undefined, xs: 12 }, (
|
|
108
|
+
: undefined, xs: 12 }, (contentRatiosPerBreakpoint === "2/3" && img
|
|
109
|
+
? { m: 4 }
|
|
110
|
+
: { m: 6 })),
|
|
81
111
|
React.createElement(BannerImage.BannerImage, tslib_es6.__assign({ ariaHidden: true }, img)))))))));
|
|
82
112
|
};
|
|
83
113
|
|
|
@@ -9,7 +9,7 @@ var Surface = require('./Surface-DIU5ciDT.cjs');
|
|
|
9
9
|
var VisuallyHidden = require('./VisuallyHidden-CQg3cOVK.cjs');
|
|
10
10
|
var Spinner = require('./Spinner-427lpnHI.cjs');
|
|
11
11
|
var Icon = require('./Icon-Dk2XHa7V.cjs');
|
|
12
|
-
var Tooltip = require('./Tooltip-
|
|
12
|
+
var Tooltip = require('./Tooltip-CdmWvrnr.cjs');
|
|
13
13
|
var ThemeIcon = require('./ThemeIcon-CwYN77IF.cjs');
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -62,7 +62,7 @@ var InputIcon = function (_a) {
|
|
|
62
62
|
"arc-TextInput-inputIcon": true,
|
|
63
63
|
"arc-TextInput-inputIcon--isReadOnly": isReadOnly,
|
|
64
64
|
"arc-TextInput-inputIcon--isDisabled": isDisabled,
|
|
65
|
-
}), disabled: isReadOnly || isDisabled, "aria-label": isButton.label, onFocus: isButton.onFocus, onClick: function (e) {
|
|
65
|
+
}), disabled: isReadOnly || isDisabled, "aria-label": isButton.label, onFocus: isButton.onFocus, onKeyDown: isButton.onKeyDown, onClick: function (e) {
|
|
66
66
|
var _a;
|
|
67
67
|
e.preventDefault();
|
|
68
68
|
(_a = isButton.onClick) === null || _a === void 0 ? void 0 : _a.call(isButton);
|
|
@@ -73,19 +73,42 @@ var InputIcon = function (_a) {
|
|
|
73
73
|
|
|
74
74
|
var TrailingSlot = function (_a) {
|
|
75
75
|
var _b;
|
|
76
|
-
var trailingSlot = _a.trailingSlot, showPassword = _a.showPassword, isPasswordVisible = _a.isPasswordVisible, onTogglePassword = _a.onTogglePassword, isLoading = _a.isLoading, clearButton = _a.clearButton, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, _c = _a.size, size = _c === void 0 ? "m" : _c;
|
|
76
|
+
var id = _a.id, trailingSlot = _a.trailingSlot, showPassword = _a.showPassword, isPasswordVisible = _a.isPasswordVisible, onTogglePassword = _a.onTogglePassword, isLoading = _a.isLoading, clearButton = _a.clearButton, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, _c = _a.size, size = _c === void 0 ? "m" : _c, inputRef = _a.inputRef;
|
|
77
77
|
var spinnerSizeMap = {
|
|
78
78
|
s: 16,
|
|
79
79
|
m: 24,
|
|
80
80
|
l: 24,
|
|
81
81
|
};
|
|
82
82
|
var spinnerSize = spinnerSizeMap[size];
|
|
83
|
-
|
|
83
|
+
var focusInput = function () {
|
|
84
|
+
var _a;
|
|
85
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
86
|
+
};
|
|
87
|
+
var clearInput = function () {
|
|
88
|
+
var _a;
|
|
89
|
+
if (inputRef.current) {
|
|
90
|
+
inputRef.current.value = "";
|
|
91
|
+
inputRef.current.dispatchEvent(new Event("input", { bubbles: true }));
|
|
92
|
+
}
|
|
93
|
+
(_a = clearButton === null || clearButton === void 0 ? void 0 : clearButton.onClick) === null || _a === void 0 ? void 0 : _a.call(clearButton);
|
|
94
|
+
};
|
|
95
|
+
var onClearButtonKeydown = function () {
|
|
96
|
+
clearInput();
|
|
97
|
+
focusInput();
|
|
98
|
+
};
|
|
99
|
+
return (React.createElement("span", { className: "arc-TextInput-trailingSlot", id: "trailingslot-".concat(id) },
|
|
84
100
|
trailingSlot && !showPassword && !isLoading && !clearButton && (React.createElement(React.Fragment, null, trailingSlot)),
|
|
85
101
|
(clearButton === null || clearButton === void 0 ? void 0 : clearButton.onClick) && !showPassword && !isLoading && (React.createElement(InputIcon, { themeIcon: "textInputClear", isReadOnly: isReadOnly, isDisabled: isDisabled, tooltip: {
|
|
86
102
|
title: (_b = clearButton.tooltipLabel) !== null && _b !== void 0 ? _b : "Clear",
|
|
87
103
|
side: "bottom",
|
|
88
|
-
}, isButton: {
|
|
104
|
+
}, isButton: {
|
|
105
|
+
onClick: function () {
|
|
106
|
+
clearInput();
|
|
107
|
+
focusInput();
|
|
108
|
+
},
|
|
109
|
+
label: "Clear Input",
|
|
110
|
+
onKeyDown: onClearButtonKeydown,
|
|
111
|
+
}, size: size })),
|
|
89
112
|
showPassword && !isLoading && (React.createElement(React.Fragment, null,
|
|
90
113
|
React.createElement(InputIcon, { isDisabled: isDisabled, isReadOnly: isReadOnly, themeIcon: isPasswordVisible
|
|
91
114
|
? "textInputShowPassword"
|
|
@@ -110,10 +133,20 @@ var TrailingSlot = function (_a) {
|
|
|
110
133
|
};
|
|
111
134
|
|
|
112
135
|
/** Use `TextInput` as a single-line field that allows users to enter short text, such as names, email, search queries or passwords. */
|
|
113
|
-
var TextInputComponent =
|
|
136
|
+
var TextInputComponent = function (_a) {
|
|
114
137
|
var _b;
|
|
115
|
-
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, leadingSlot = _a.leadingSlot, trailingSlot = _a.trailingSlot, _k = _a.inputAlignment, inputAlignment = _k === void 0 ? "left" : _k, width = _a.width, autoComplete = _a.autoComplete, isLoading = _a.isLoading, isErrorAlert = _a.isErrorAlert, prefix = _a.prefix, suffix = _a.suffix, clearButton = _a.clearButton, props = tslib_es6.__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", "leadingSlot", "trailingSlot", "inputAlignment", "width", "autoComplete", "isLoading", "isErrorAlert", "prefix", "suffix", "clearButton"]);
|
|
138
|
+
var ref = _a.ref, _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, leadingSlot = _a.leadingSlot, trailingSlot = _a.trailingSlot, _k = _a.inputAlignment, inputAlignment = _k === void 0 ? "left" : _k, width = _a.width, autoComplete = _a.autoComplete, isLoading = _a.isLoading, isErrorAlert = _a.isErrorAlert, prefix = _a.prefix, suffix = _a.suffix, clearButton = _a.clearButton, props = tslib_es6.__rest(_a, ["ref", "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", "leadingSlot", "trailingSlot", "inputAlignment", "width", "autoComplete", "isLoading", "isErrorAlert", "prefix", "suffix", "clearButton"]);
|
|
116
139
|
var _l = React.useState(false), showPasswordToggle = _l[0], setShowPasswordToggle = _l[1];
|
|
140
|
+
var inputRef = React.useRef(null);
|
|
141
|
+
var setInputRef = function (node) {
|
|
142
|
+
inputRef.current = node;
|
|
143
|
+
if (typeof ref === "function") {
|
|
144
|
+
ref(node);
|
|
145
|
+
}
|
|
146
|
+
else if (ref) {
|
|
147
|
+
ref.current = node;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
117
150
|
var inferredInputProps = useNumericInput({
|
|
118
151
|
inputMode: inputMode,
|
|
119
152
|
pattern: pattern,
|
|
@@ -145,18 +178,18 @@ var TextInputComponent = React.forwardRef(function (_a, ref) {
|
|
|
145
178
|
React.createElement("div", { className: "arc-TextInput-inputWrapper", style: { width: width, marginTop: hideLabel ? 0 : undefined } },
|
|
146
179
|
prefix && (React.createElement("span", { className: "arc-TextInput-prefix arc-TextInput-affixes", "aria-hidden": true }, prefix)),
|
|
147
180
|
leadingSlot && (React.createElement("span", { className: "arc-TextInput-leadingSlot" }, leadingSlot)),
|
|
148
|
-
React.createElement("input", tslib_es6.__assign({ placeholder: placeholder, "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", className: "arc-TextInput-input", defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled, id: id, maxLength: maxLength, minLength: minLength, name: name, onChange: onChange, onBlur: onBlur, onFocus: onFocus, readOnly: isReadOnly, ref:
|
|
181
|
+
React.createElement("input", tslib_es6.__assign({ placeholder: placeholder, "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", className: "arc-TextInput-input", defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled, id: id, maxLength: maxLength, minLength: minLength, name: name, onChange: onChange, onBlur: onBlur, onFocus: onFocus, readOnly: isReadOnly, ref: setInputRef, required: isRequired, value: typeof value !== "undefined" ? value : undefined, autoComplete: autoComplete }, inferredInputProps)),
|
|
149
182
|
(trailingSlot ||
|
|
150
183
|
showPassword ||
|
|
151
184
|
isLoading ||
|
|
152
|
-
(clearButton === null || clearButton === void 0 ? void 0 : clearButton.onClick)) && (React.createElement(TrailingSlot, { showPassword: showPassword, isReadOnly: isReadOnly, isLoading: isLoading, clearButton: clearButton, trailingSlot: trailingSlot, isPasswordVisible: showPasswordToggle, onTogglePassword: function () { return setShowPasswordToggle(function (prev) { return !prev; }); }, size: size, isDisabled: isDisabled })),
|
|
185
|
+
(clearButton === null || clearButton === void 0 ? void 0 : clearButton.onClick)) && (React.createElement(TrailingSlot, { id: id, showPassword: showPassword, isReadOnly: isReadOnly, isLoading: isLoading, clearButton: clearButton, trailingSlot: trailingSlot, isPasswordVisible: showPasswordToggle, onTogglePassword: function () { return setShowPasswordToggle(function (prev) { return !prev; }); }, size: size, isDisabled: isDisabled, inputRef: inputRef })),
|
|
153
186
|
suffix && (React.createElement("span", { className: "arc-TextInput-suffix arc-TextInput-affixes", "aria-hidden": true }, suffix))))));
|
|
154
|
-
}
|
|
187
|
+
};
|
|
155
188
|
/**
|
|
156
189
|
* Use `TextInput` to allow users to enter short form text.
|
|
157
190
|
*/
|
|
158
|
-
var TextInput =
|
|
159
|
-
var TextInputWithPlaceHolder =
|
|
191
|
+
var TextInput = function (props) { return (React.createElement(TextInputComponent, tslib_es6.__assign({}, props))); };
|
|
192
|
+
var TextInputWithPlaceHolder = function (props) { return React.createElement(TextInputComponent, tslib_es6.__assign({}, props)); };
|
|
160
193
|
|
|
161
194
|
exports.InputIcon = InputIcon;
|
|
162
195
|
exports.TextInput = TextInput;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
var tslib_es6 = require('./tslib.es6-CCZ3TN_7.cjs');
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-DlWZZNwu.cjs');
|
|
7
7
|
var ReactDOM = require('react-dom');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
var index$1 = require('./index-
|
|
9
|
+
var index$1 = require('./index-BdJeAKfz.cjs');
|
|
10
10
|
var filterAttrs = require('./filter-attrs-D19P2s1V.cjs');
|
|
11
11
|
var Surface = require('./Surface-DIU5ciDT.cjs');
|
|
12
12
|
var Icon = require('./Icon-Dk2XHa7V.cjs');
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var Combination = require('./Combination-
|
|
6
|
-
var index = require('./index-
|
|
5
|
+
var Combination = require('./Combination-Cm62lfyr.cjs');
|
|
6
|
+
var index = require('./index-DlWZZNwu.cjs');
|
|
7
7
|
|
|
8
8
|
function _interopNamespaceDefault(e) {
|
|
9
9
|
var n = Object.create(null);
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var Combination = require('./Combination-
|
|
6
|
-
var index = require('./index-
|
|
7
|
-
var index$1 = require('./index-
|
|
5
|
+
var Combination = require('./Combination-Cm62lfyr.cjs');
|
|
6
|
+
var index = require('./index-DlWZZNwu.cjs');
|
|
7
|
+
var index$1 = require('./index-BBDa9gnQ.cjs');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
|
|
10
10
|
function _interopNamespaceDefault(e) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var index = require('./index-
|
|
6
|
-
var Combination = require('./Combination-
|
|
5
|
+
var index = require('./index-DlWZZNwu.cjs');
|
|
6
|
+
var Combination = require('./Combination-Cm62lfyr.cjs');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
8
|
|
|
9
9
|
function _interopNamespaceDefault(e) {
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var ReactDOM = require('react-dom');
|
|
6
|
-
var Combination = require('./Combination-
|
|
7
|
-
var index = require('./index-
|
|
8
|
-
var index$1 = require('./index-
|
|
9
|
-
var index$2 = require('./index-
|
|
6
|
+
var Combination = require('./Combination-Cm62lfyr.cjs');
|
|
7
|
+
var index = require('./index-B_WZUATb.cjs');
|
|
8
|
+
var index$1 = require('./index-DlWZZNwu.cjs');
|
|
9
|
+
var index$2 = require('./index-WO7l1Mfx.cjs');
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
|
|
12
12
|
function _interopNamespaceDefault(e) {
|
|
@@ -139,9 +139,9 @@ var count = 0;
|
|
|
139
139
|
function useId(deterministicId) {
|
|
140
140
|
const [id, setId] = React__namespace.useState(useReactId());
|
|
141
141
|
useLayoutEffect2(() => {
|
|
142
|
-
|
|
142
|
+
setId((reactId) => reactId ?? String(count++));
|
|
143
143
|
}, [deterministicId]);
|
|
144
|
-
return
|
|
144
|
+
return (id ? `radix-${id}` : "");
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
// packages/react/use-controllable-state/src/useControllableState.tsx
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var Combination = require('./Combination-
|
|
6
|
-
var index = require('./index-
|
|
7
|
-
var index$1 = require('./index-
|
|
8
|
-
var index$2 = require('./index-
|
|
5
|
+
var Combination = require('./Combination-Cm62lfyr.cjs');
|
|
6
|
+
var index = require('./index-DlWZZNwu.cjs');
|
|
7
|
+
var index$1 = require('./index-WO7l1Mfx.cjs');
|
|
8
|
+
var index$2 = require('./index-BBDa9gnQ.cjs');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
|
|
11
11
|
function _interopNamespaceDefault(e) {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var index$1 = require('./index-
|
|
6
|
-
var Combination = require('./Combination-
|
|
5
|
+
var index$1 = require('./index-BdJeAKfz.cjs');
|
|
6
|
+
var Combination = require('./Combination-Cm62lfyr.cjs');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
var index = require('./index-
|
|
8
|
+
var index = require('./index-DlWZZNwu.cjs');
|
|
9
9
|
|
|
10
10
|
function _interopNamespaceDefault(e) {
|
|
11
11
|
var n = Object.create(null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign } from './tslib.es6-w7hdJ3oZ.mjs';
|
|
2
|
-
import React__default, {
|
|
2
|
+
import React__default, { 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
5
|
import { f as filterAttrs } from './filter-attrs-v_SweZXP.mjs';
|
|
@@ -10,9 +10,9 @@ import { T as ThemeIcon } from './ThemeIcon-B0n6cKRb.mjs';
|
|
|
10
10
|
/**
|
|
11
11
|
* Use `Button` to let a user complete an action like ‘Log in’ or ‘Register’.
|
|
12
12
|
*/
|
|
13
|
-
var Button =
|
|
13
|
+
var Button = function (_a) {
|
|
14
14
|
var _b;
|
|
15
|
-
var ariaLabel = _a.ariaLabel, ariaControls = _a.ariaControls, ariaExpanded = _a.ariaExpanded, ariaHasPopup = _a.ariaHasPopup, _c = _a.fill, fill = _c === void 0 ? "solid" : _c, href = _a.href, icon = _a.icon, _d = _a.iconPosition, iconPosition = _d === void 0 ? "afterText" : _d, id = _a.id, _e = _a.isDisabled, isDisabled = _e === void 0 ? false : _e, _f = _a.isDisplayBlock, isDisplayBlock = _f === void 0 ? false : _f, _g = _a.isFullWidth, isFullWidth = _g === void 0 ? false : _g, label = _a.label, onClick = _a.onClick, rel = _a.rel, _h = _a.size, size = _h === void 0 ? "m" : _h, supportingText = _a.supportingText, target = _a.target, type = _a.type, form = _a.form, props = __rest(_a, ["ariaLabel", "ariaControls", "ariaExpanded", "ariaHasPopup", "fill", "href", "icon", "iconPosition", "id", "isDisabled", "isDisplayBlock", "isFullWidth", "label", "onClick", "rel", "size", "supportingText", "target", "type", "form"]);
|
|
15
|
+
var ariaLabel = _a.ariaLabel, ariaControls = _a.ariaControls, ariaExpanded = _a.ariaExpanded, ariaHasPopup = _a.ariaHasPopup, _c = _a.fill, fill = _c === void 0 ? "solid" : _c, href = _a.href, icon = _a.icon, _d = _a.iconPosition, iconPosition = _d === void 0 ? "afterText" : _d, id = _a.id, _e = _a.isDisabled, isDisabled = _e === void 0 ? false : _e, _f = _a.isDisplayBlock, isDisplayBlock = _f === void 0 ? false : _f, _g = _a.isFullWidth, isFullWidth = _g === void 0 ? false : _g, label = _a.label, onClick = _a.onClick, rel = _a.rel, _h = _a.size, size = _h === void 0 ? "m" : _h, supportingText = _a.supportingText, target = _a.target, type = _a.type, form = _a.form, ref = _a.ref, props = __rest(_a, ["ariaLabel", "ariaControls", "ariaExpanded", "ariaHasPopup", "fill", "href", "icon", "iconPosition", "id", "isDisabled", "isDisplayBlock", "isFullWidth", "label", "onClick", "rel", "size", "supportingText", "target", "type", "form", "ref"]);
|
|
16
16
|
var surface = useContext(Context).surface;
|
|
17
17
|
var buttonClasses = classNames((_b = {
|
|
18
18
|
"arc-Button": true,
|
|
@@ -40,7 +40,7 @@ var Button = forwardRef(function (_a, ref) {
|
|
|
40
40
|
React__default.createElement("span", { className: "arc-Button-inner" },
|
|
41
41
|
buttonText,
|
|
42
42
|
buttonIcon)));
|
|
43
|
-
}
|
|
43
|
+
};
|
|
44
44
|
var ButtonIcon = function (_a) {
|
|
45
45
|
var icon = _a.icon, isChevron = _a.isChevron, isBeforeText = _a.isBeforeText;
|
|
46
46
|
return (React__default.createElement("span", { className: "arc-Button-icon" }, isChevron ? (React__default.createElement(ThemeIcon, { icon: isBeforeText ? "buttonLeft" : "buttonRight" })) : (React__default.createElement(Icon, { icon: icon }))));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign } from './tslib.es6-w7hdJ3oZ.mjs';
|
|
2
|
-
import React__default, {
|
|
2
|
+
import React__default, { useContext } from 'react';
|
|
3
3
|
import { c as classNames } from './index-5C0-U8cc.mjs';
|
|
4
4
|
import { f as filterAttrs } from './filter-attrs-v_SweZXP.mjs';
|
|
5
5
|
import { I as Icon } from './Icon-CCUbr_AO.mjs';
|
|
@@ -9,8 +9,8 @@ import { S as Spinner } from './Spinner-DvngCIwx.mjs';
|
|
|
9
9
|
/**
|
|
10
10
|
* Use `ButtonV2` for our most up to date Call To Action button, offering Primary, Secondary, Tertiary, Compact and Error states.
|
|
11
11
|
*/
|
|
12
|
-
var ButtonV2 =
|
|
13
|
-
var label = _a.label, _b = _a.buttonStyle, buttonStyle = _b === void 0 ? "primary" : _b, icon = _a.icon, iconActive = _a.iconActive, _c = _a.iconPosition, iconPosition = _c === void 0 ? "beforeText" : _c, _d = _a.size, size = _d === void 0 ? "m" : _d, ariaLabel = _a.ariaLabel, ariaControls = _a.ariaControls, ariaExpanded = _a.ariaExpanded, ariaHasPopup = _a.ariaHasPopup, _e = _a.isFullWidth, isFullWidth = _e === void 0 ? false : _e, _f = _a.isLoading, isLoading = _f === void 0 ? false : _f, isSpan = _a.isSpan, onClick = _a.onClick, href = _a.href, id = _a.id, rel = _a.rel, target = _a.target, type = _a.type, form = _a.form, props = __rest(_a, ["label", "buttonStyle", "icon", "iconActive", "iconPosition", "size", "ariaLabel", "ariaControls", "ariaExpanded", "ariaHasPopup", "isFullWidth", "isLoading", "isSpan", "onClick", "href", "id", "rel", "target", "type", "form"]);
|
|
12
|
+
var ButtonV2 = function (_a) {
|
|
13
|
+
var label = _a.label, _b = _a.buttonStyle, buttonStyle = _b === void 0 ? "primary" : _b, icon = _a.icon, iconActive = _a.iconActive, _c = _a.iconPosition, iconPosition = _c === void 0 ? "beforeText" : _c, _d = _a.size, size = _d === void 0 ? "m" : _d, ariaLabel = _a.ariaLabel, ariaControls = _a.ariaControls, ariaExpanded = _a.ariaExpanded, ariaHasPopup = _a.ariaHasPopup, _e = _a.isFullWidth, isFullWidth = _e === void 0 ? false : _e, _f = _a.isLoading, isLoading = _f === void 0 ? false : _f, isSpan = _a.isSpan, onClick = _a.onClick, href = _a.href, id = _a.id, rel = _a.rel, target = _a.target, type = _a.type, form = _a.form, ref = _a.ref, props = __rest(_a, ["label", "buttonStyle", "icon", "iconActive", "iconPosition", "size", "ariaLabel", "ariaControls", "ariaExpanded", "ariaHasPopup", "isFullWidth", "isLoading", "isSpan", "onClick", "href", "id", "rel", "target", "type", "form", "ref"]);
|
|
14
14
|
var surface = useContext(Context).surface;
|
|
15
15
|
var ButtonElement = isSpan ? "span" : "button";
|
|
16
16
|
var iconSizes = {
|
|
@@ -54,6 +54,6 @@ var ButtonV2 = forwardRef(function (_a, ref) {
|
|
|
54
54
|
return (React__default.createElement("a", __assign({}, commonProps, { className: ButtonV2Classes, href: href, rel: rel, "aria-haspopup": ariaHasPopup, "aria-controls": ariaControls, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, target: target }), renderButtonContent()));
|
|
55
55
|
}
|
|
56
56
|
return (React__default.createElement(ButtonElement, __assign({}, commonProps, { className: ButtonV2Classes, "aria-label": ariaLabel, "aria-haspopup": ariaHasPopup, "aria-controls": ariaControls, "aria-expanded": ariaExpanded, disabled: isLoading, type: type, form: form }), renderButtonContent()));
|
|
57
|
-
}
|
|
57
|
+
};
|
|
58
58
|
|
|
59
59
|
export { ButtonV2 as B };
|