@arc-ui/components 11.16.0 → 11.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Calendar/Calendar.cjs.js +21 -0
- package/dist/Calendar/Calendar.esm.js +13 -0
- package/dist/Calendar/package.json +7 -0
- package/dist/Checkbox/Checkbox.cjs.js +3 -2
- package/dist/Checkbox/Checkbox.esm.js +3 -2
- package/dist/DatePicker/DatePicker.cjs.js +565 -0
- package/dist/DatePicker/DatePicker.esm.js +552 -0
- package/dist/DatePicker/package.json +7 -0
- package/dist/FormControl/FormControl.cjs.js +2 -1
- package/dist/FormControl/FormControl.esm.js +2 -1
- package/dist/InformationCard/InformationCard.cjs.js +10 -9
- package/dist/InformationCard/InformationCard.esm.js +8 -7
- package/dist/MediaCard/MediaCard.cjs.js +56 -0
- package/dist/MediaCard/MediaCard.esm.js +48 -0
- package/dist/MediaCard/package.json +7 -0
- package/dist/Modal/Modal.cjs.js +13 -286
- package/dist/Modal/Modal.esm.js +6 -279
- package/dist/RadioGroup/RadioGroup.cjs.js +3 -2
- package/dist/RadioGroup/RadioGroup.esm.js +3 -2
- package/dist/Select/Select.cjs.js +31 -2705
- package/dist/Select/Select.esm.js +13 -2668
- package/dist/SiteFooter/SiteFooter.cjs.js +2 -2
- package/dist/SiteFooter/SiteFooter.esm.js +3 -3
- package/dist/SiteHeader/SiteHeader.cjs.js +2 -2
- package/dist/SiteHeader/SiteHeader.esm.js +2 -2
- package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +23 -0
- package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +15 -0
- package/dist/SiteHeaderV2/package.json +7 -0
- package/dist/Switch/Switch.cjs.js +4 -3
- package/dist/Switch/Switch.esm.js +4 -3
- package/dist/Tabs/Tabs.cjs.js +5 -5
- package/dist/Tabs/Tabs.esm.js +5 -5
- package/dist/TextArea/TextArea.cjs.js +20 -20
- package/dist/TextArea/TextArea.esm.js +20 -20
- package/dist/TextInput/TextInput.cjs.js +3 -2
- package/dist/TextInput/TextInput.esm.js +3 -2
- package/dist/Toast/Toast.cjs.js +6 -7
- package/dist/Toast/Toast.esm.js +6 -7
- package/dist/TypographyCard/TypographyCard.cjs.js +13 -70
- package/dist/TypographyCard/TypographyCard.esm.js +14 -71
- package/dist/_shared/cjs/Calendar-18e255f8.js +4106 -0
- package/dist/_shared/cjs/CardFooter-43c32239.js +80 -0
- package/dist/_shared/cjs/CardLabel-768abf20.js +54 -0
- package/dist/_shared/cjs/{Checkbox-904ad028.js → Checkbox-4d4b432f.js} +1 -1
- package/dist/_shared/cjs/{index-3d69ea00.js → Combination-9974f2e2.js} +662 -145
- package/dist/_shared/cjs/{FormControl-166e0957.js → FormControl-b26ad353.js} +8 -5
- package/dist/_shared/cjs/{RadioGroup-1eddf86f.js → RadioGroup-23c964ae.js} +1 -1
- package/dist/_shared/cjs/{SiteFooter-97c27b29.js → SiteFooter-65b6360c.js} +2 -2
- package/dist/_shared/cjs/{SiteHeader.rehydrator-af3dddef.js → SiteHeader.rehydrator-df053a52.js} +8 -8
- package/dist/_shared/cjs/SiteHeaderV2-8ce6d4fc.js +610 -0
- package/dist/_shared/cjs/{Tabs-cc77dabb.js → Tabs-34db6bc1.js} +4 -4
- package/dist/_shared/cjs/{TextInput-fd9c756f.js → TextInput-d0370fa8.js} +19 -6
- package/dist/_shared/cjs/{Toast-91e96744.js → Toast-392b1d60.js} +292 -34
- package/dist/_shared/cjs/{index-84e6a68f.js → index-6eb396a3.js} +1 -1
- package/dist/_shared/cjs/{index-6542b467.js → index-74004a9c.js} +1 -1
- package/dist/_shared/cjs/index-77ab5c6a.js +2180 -0
- package/dist/_shared/cjs/{index-d31f2b65.js → index-9f99d686.js} +1 -1
- package/dist/_shared/cjs/{index-1641d0b4.js → index-a31e64a9.js} +1 -1
- package/dist/_shared/cjs/{index-49c72a87.js → index-d38f1bd0.js} +1 -1
- package/dist/_shared/esm/Calendar-4033fa48.js +4093 -0
- package/dist/_shared/esm/CardFooter-dd8d4000.js +74 -0
- package/dist/_shared/esm/CardLabel-d6d71407.js +46 -0
- package/dist/_shared/esm/{Checkbox-8a5bb9a1.js → Checkbox-720b074d.js} +1 -1
- package/dist/_shared/esm/{index-3e2bc99d.js → Combination-e9f7e64e.js} +643 -132
- package/dist/_shared/esm/{FormControl-9d4ddfec.js → FormControl-f0b8fe91.js} +8 -5
- package/dist/_shared/esm/{RadioGroup-238db88d.js → RadioGroup-37fdb06b.js} +1 -1
- package/dist/_shared/esm/{SiteFooter-94316b8b.js → SiteFooter-38ee1536.js} +1 -1
- package/dist/_shared/esm/{SiteHeader.rehydrator-1b507253.js → SiteHeader.rehydrator-32bdcd88.js} +2 -2
- package/dist/_shared/esm/SiteHeaderV2-f8377627.js +604 -0
- package/dist/_shared/esm/{Tabs-8719d952.js → Tabs-df9965dd.js} +4 -4
- package/dist/_shared/esm/{TextInput-c1e2a1dd.js → TextInput-abbab56b.js} +19 -6
- package/dist/_shared/esm/{Toast-7cb1e544.js → Toast-5d66e13f.js} +264 -7
- package/dist/_shared/esm/{index-39019a9b.js → index-044da8d0.js} +1 -1
- package/dist/_shared/esm/{index-6b7b075c.js → index-25a5b393.js} +1 -1
- package/dist/_shared/esm/{index-246b4f18.js → index-2cfab9f2.js} +1 -1
- package/dist/_shared/esm/{index-12f3a407.js → index-7b531fa7.js} +68 -68
- package/dist/_shared/esm/index-b84a20c6.js +2155 -0
- package/dist/_shared/esm/{index-db47e95a.js → index-ca72c9d5.js} +1 -1
- package/dist/_shared/esm/{index-936b5179.js → index-efa9be1a.js} +1 -1
- package/dist/_shared/esm/{index.es-c552c0ea.js → use-media-query-4c807227.js} +9 -9
- package/dist/index.es.js +1135 -791
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1136 -791
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -4
- package/dist/types/components/Calendar/Calendar.d.ts +49 -0
- package/dist/types/components/Calendar/Calendar.provider.d.ts +21 -0
- package/dist/types/components/Calendar/components/CalendarDateSelect/CalendarDateSelect.d.ts +15 -0
- package/dist/types/components/Calendar/components/CalendarDateSelect/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarDayGrid/CalendarDayGrid.d.ts +6 -0
- package/dist/types/components/Calendar/components/CalendarDayGrid/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarDayNumber/CalendarDayNumber.d.ts +8 -0
- package/dist/types/components/Calendar/components/CalendarDayNumber/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarDoubleMonthView/CalendarDoubleMonthView.d.ts +9 -0
- package/dist/types/components/Calendar/components/CalendarDoubleMonthView/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarFooter/CalendarFooter.d.ts +6 -0
- package/dist/types/components/Calendar/components/CalendarFooter/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarMonthView/CalendarMonthView.d.ts +9 -0
- package/dist/types/components/Calendar/components/CalendarMonthView/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarMonthYearView/CalendarMonthYearView.d.ts +11 -0
- package/dist/types/components/Calendar/components/CalendarMonthYearView/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarNavButton/CalendarNavButton.d.ts +10 -0
- package/dist/types/components/Calendar/components/CalendarNavButton/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarWrapper/CalendarWrapper.d.ts +5 -0
- package/dist/types/components/Calendar/components/CalendarWrapper/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/index.d.ts +6 -0
- package/dist/types/components/Calendar/constants/day-names.d.ts +5 -0
- package/dist/types/components/Calendar/constants/index.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/contains-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/contains-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/date-without-time.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/date-without-time.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-calendar-type.d.ts +2 -0
- package/dist/types/components/Calendar/helpers/get-calendar-type.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-dates-in-month.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-dates-in-month.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-double-month-display-range.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-double-month-display-range.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-focus-date.d.ts +5 -0
- package/dist/types/components/Calendar/helpers/get-focus-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-highlighted-range.d.ts +6 -0
- package/dist/types/components/Calendar/helpers/get-highlighted-range.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-keydown-date.d.ts +6 -0
- package/dist/types/components/Calendar/helpers/get-keydown-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/index.d.ts +13 -0
- package/dist/types/components/Calendar/helpers/is-day.d.ts +2 -0
- package/dist/types/components/Calendar/helpers/is-day.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-disabled-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-disabled-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-after-max-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-after-max-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-before-min-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-before-min-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/process-selected-range.d.ts +9 -0
- package/dist/types/components/Calendar/helpers/process-selected-range.test.d.ts +1 -0
- package/dist/types/components/Calendar/index.d.ts +2 -0
- package/dist/types/components/Calendar/state/handlers/calendar-keydown-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/day-grid-leave-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/day-number-select-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/default-handler.d.ts +2 -0
- package/dist/types/components/Calendar/state/handlers/dropdown-change-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/dropdown-change-year-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/highlight-range-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/index.d.ts +12 -0
- package/dist/types/components/Calendar/state/handlers/range-select-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-next-double-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-next-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-previous-double-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-previous-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/index.d.ts +2 -0
- package/dist/types/components/Calendar/state/reducer.d.ts +3 -0
- package/dist/types/components/Calendar/state/reducer.test.d.ts +1 -0
- package/dist/types/components/Calendar/state/types/actions.d.ts +81 -0
- package/dist/types/components/Calendar/state/types/state-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/types/state.d.ts +5 -0
- package/dist/types/components/Calendar/types/calendar-type.d.ts +1 -0
- package/dist/types/components/Calendar/types/date-select-value.d.ts +2 -0
- package/dist/types/components/Calendar/types/index.d.ts +6 -0
- package/dist/types/components/Calendar/types/key-names.d.ts +13 -0
- package/dist/types/components/Calendar/types/range-selection.d.ts +10 -0
- package/dist/types/components/Calendar/types/selection-type.d.ts +1 -0
- package/dist/types/components/Calendar/types/week-days.d.ts +18 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +17 -0
- package/dist/types/components/DatePicker/constants/date-format.d.ts +1 -0
- package/dist/types/components/DatePicker/constants/index.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-date-string-to-date.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-date-string-to-date.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-range-string-to-dates.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-range-string-to-dates.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/format-date.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/format-date.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/index.d.ts +8 -0
- package/dist/types/components/DatePicker/helpers/is-date-valid.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-date-valid.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-disabled-date.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-disabled-date.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-range-valid.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-range-valid.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/parse-date-string.d.ts +5 -0
- package/dist/types/components/DatePicker/helpers/parse-date-string.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/parse-range-string.d.ts +14 -0
- package/dist/types/components/DatePicker/helpers/parse-range-string.test.d.ts +1 -0
- package/dist/types/components/DatePicker/index.d.ts +6 -0
- package/dist/types/components/FormControl/FormControl.d.ts +4 -0
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/types/components/SiteHeaderV2/SiteHeaderV2.d.ts +77 -0
- package/dist/types/components/SiteHeaderV2/components/BackButton/BackButton.d.ts +5 -0
- package/dist/types/components/SiteHeaderV2/components/BackButton/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/Column/Column.d.ts +8 -0
- package/dist/types/components/SiteHeaderV2/components/Column/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/HorizontalPanel/HorizontalPanel.d.ts +13 -0
- package/dist/types/components/SiteHeaderV2/components/HorizontalPanel/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/Item/Item.d.ts +20 -0
- package/dist/types/components/SiteHeaderV2/components/Item/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/ItemGroup/ItemGroup.d.ts +27 -0
- package/dist/types/components/SiteHeaderV2/components/ItemGroup/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/MenuButton/MenuButton.d.ts +6 -0
- package/dist/types/components/SiteHeaderV2/components/MenuButton/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/NavItem/NavItem.d.ts +40 -0
- package/dist/types/components/SiteHeaderV2/components/NavItem/NavItemWithSubNav.d.ts +55 -0
- package/dist/types/components/SiteHeaderV2/components/NavItem/index.d.ts +2 -0
- package/dist/types/components/SiteHeaderV2/components/NodeItem/NodeItem.d.ts +8 -0
- package/dist/types/components/SiteHeaderV2/components/Panel/Panel.d.ts +26 -0
- package/dist/types/components/SiteHeaderV2/components/Panel/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/SubNavItem/SubNavItem.d.ts +45 -0
- package/dist/types/components/SiteHeaderV2/components/SubNavItem/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/VerticalDivider/VerticalDivider.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/VerticalDivider/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/index.d.ts +1 -0
- package/dist/types/components/TextArea/TextArea.d.ts +4 -0
- package/dist/types/components/TextInput/TextInput.d.ts +22 -3
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/private-components/CardFooter/CardFooter.d.ts +11 -0
- package/dist/types/private-components/CardFooter/index.d.ts +1 -0
- package/dist/types/private-components/CardHeading/CardHeading.d.ts +19 -0
- package/dist/types/private-components/CardHeading/index.d.ts +1 -0
- package/dist/types/private-components/CardLabel/CardLabel.d.ts +10 -0
- package/dist/types/private-components/CardLabel/index.d.ts +1 -0
- package/dist/types/private-components/index.d.ts +4 -0
- package/dist/types/styles.d.ts +6 -0
- package/package.json +4 -2
- package/dist/_shared/cjs/BtIconArrowRight.esm-8e8ac316.js +0 -30
- package/dist/_shared/cjs/index-4ecad2dd.js +0 -273
- package/dist/_shared/esm/BtIconArrowRight.esm-267916a4.js +0 -24
- package/dist/_shared/esm/index-d0307140.js +0 -264
- package/dist/types/internal-components/index.d.ts +0 -1
- package/dist/_shared/cjs/{index-56a040f4.js → index-dd1d18ea.js} +66 -66
- package/dist/_shared/cjs/{index.es-26dd8c5d.js → use-media-query-e61881d8.js} +8 -8
- /package/dist/types/{internal-components → private-components}/ConditionalWrapper/ConditionalWrapper.d.ts +0 -0
- /package/dist/types/{internal-components → private-components}/ConditionalWrapper/index.d.ts +0 -0
package/dist/index.es.js
CHANGED
|
@@ -316,9 +316,9 @@ var AlignItem = function (_a) {
|
|
|
316
316
|
return React__default.createElement("div", { className: "arc-Align-item" }, children);
|
|
317
317
|
};
|
|
318
318
|
|
|
319
|
-
var defaultContext$
|
|
320
|
-
var Context$
|
|
321
|
-
var Provider$
|
|
319
|
+
var defaultContext$5 = { surface: "light" };
|
|
320
|
+
var Context$5 = createContext(defaultContext$5);
|
|
321
|
+
var Provider$6 = Context$5.Provider;
|
|
322
322
|
/**
|
|
323
323
|
* Use `Surface` to compose content using the Arc system.
|
|
324
324
|
*/
|
|
@@ -333,7 +333,7 @@ var Surface = function (_a) {
|
|
|
333
333
|
background === "darker") {
|
|
334
334
|
surface = "dark";
|
|
335
335
|
}
|
|
336
|
-
return (React__default.createElement(Provider$
|
|
336
|
+
return (React__default.createElement(Provider$6, { value: { surface: surface } },
|
|
337
337
|
React__default.createElement("div", __assign({ "data-testid": "arc-surface", className: classNames((_b = {
|
|
338
338
|
"arc-Surface": true
|
|
339
339
|
},
|
|
@@ -382,7 +382,7 @@ const ArcIconArc = (props) =>
|
|
|
382
382
|
var Icon = function (_a) {
|
|
383
383
|
var _b;
|
|
384
384
|
var testId = _a.testId, _c = _a.color, color = _c === void 0 ? "auto" : _c, _d = _a.icon, icon = _d === void 0 ? ArcIconArc : _d, _e = _a.isInline, isInline = _e === void 0 ? false : _e, label = _a.label, size = _a.size, props = __rest(_a, ["testId", "color", "icon", "isInline", "label", "size"]);
|
|
385
|
-
var surface = useContext(Context$
|
|
385
|
+
var surface = useContext(Context$5).surface;
|
|
386
386
|
var Icon = icon;
|
|
387
387
|
return (React__default.createElement("span", __assign({ "data-testid": testId, "aria-label": label, className: classNames((_b = {},
|
|
388
388
|
_b["arc-Icon"] = true,
|
|
@@ -402,7 +402,7 @@ var Icon = function (_a) {
|
|
|
402
402
|
var Heading = function (_a) {
|
|
403
403
|
var _b;
|
|
404
404
|
var _c = _a.align, align = _c === void 0 ? "left" : _c, _d = _a.casing, casing = _d === void 0 ? "auto" : _d, children = _a.children, _e = _a.color, color = _e === void 0 ? "auto" : _e, level = _a.level, size = _a.size, id = _a.id, props = __rest(_a, ["align", "casing", "children", "color", "level", "size", "id"]);
|
|
405
|
-
var surface = useContext(Context$
|
|
405
|
+
var surface = useContext(Context$5).surface;
|
|
406
406
|
var Element = "span";
|
|
407
407
|
if (level) {
|
|
408
408
|
Element = "h".concat(level);
|
|
@@ -429,7 +429,7 @@ Heading.Proposition = HeadingProposition;
|
|
|
429
429
|
var Text = function (_a) {
|
|
430
430
|
var _b;
|
|
431
431
|
var _c = _a.align, align = _c === void 0 ? "left" : _c, children = _a.children, id = _a.id, _d = _a.isInline, isInline = _d === void 0 ? false : _d, _e = _a.isMeasured, isMeasured = _e === void 0 ? false : _e, _f = _a.size, size = _f === void 0 ? "m" : _f, _g = _a.tone, tone = _g === void 0 ? "default" : _g, props = __rest(_a, ["align", "children", "id", "isInline", "isMeasured", "size", "tone"]);
|
|
432
|
-
var surface = useContext(Context$
|
|
432
|
+
var surface = useContext(Context$5).surface;
|
|
433
433
|
return (React__default.createElement("span", __assign({ id: id, className: classNames((_b = {
|
|
434
434
|
"arc-Text": true
|
|
435
435
|
},
|
|
@@ -557,7 +557,7 @@ const BtIconTick = (props) =>
|
|
|
557
557
|
var Alert = function (_a) {
|
|
558
558
|
var _b;
|
|
559
559
|
var heading = _a.heading, description = _a.description, link = _a.link, linkText = _a.linkText, linkAriaLabel = _a.linkAriaLabel, type = _a.type, _c = _a.status, status = _c === void 0 ? "general" : _c, isDismissable = _a.isDismissable, headingLevel = _a.headingLevel, onDismiss = _a.onDismiss, onLinkClick = _a.onLinkClick, icon = _a.icon, props = __rest(_a, ["heading", "description", "link", "linkText", "linkAriaLabel", "type", "status", "isDismissable", "headingLevel", "onDismiss", "onLinkClick", "icon"]);
|
|
560
|
-
var surface = useContext(Context$
|
|
560
|
+
var surface = useContext(Context$5).surface;
|
|
561
561
|
var _d = useState(false), isDismissed = _d[0], setIsDismissed = _d[1];
|
|
562
562
|
var onDismissHandler = function () {
|
|
563
563
|
setIsDismissed(true);
|
|
@@ -599,7 +599,7 @@ var Alert = function (_a) {
|
|
|
599
599
|
var Badge = function (_a) {
|
|
600
600
|
var _b, _c;
|
|
601
601
|
var children = _a.children, _d = _a.state, state = _d === void 0 ? "default" : _d, _e = _a.size, size = _e === void 0 ? "default" : _e, _f = _a.fill, fill = _f === void 0 ? "solid" : _f, ariaLabel = _a.ariaLabel, ariaRole = _a.ariaRole, props = __rest(_a, ["children", "state", "size", "fill", "ariaLabel", "ariaRole"]);
|
|
602
|
-
var surface = useContext(Context$
|
|
602
|
+
var surface = useContext(Context$5).surface;
|
|
603
603
|
return (React__default.createElement("div", __assign({ className: classNames((_b = {
|
|
604
604
|
"arc-Badge": true,
|
|
605
605
|
"arc-Badge--onDarkSurface": surface === "dark",
|
|
@@ -650,7 +650,7 @@ var Box = function (_a) {
|
|
|
650
650
|
var BrandLogo = function (_a) {
|
|
651
651
|
var _b;
|
|
652
652
|
var _c = _a.color, color = _c === void 0 ? "auto" : _c, label = _a.label, _d = _a.size, size = _d === void 0 ? 34 : _d, subBrand = _a.subBrand, props = __rest(_a, ["color", "label", "size", "subBrand"]);
|
|
653
|
-
var surface = useContext(Context$
|
|
653
|
+
var surface = useContext(Context$5).surface;
|
|
654
654
|
return (React__default.createElement("div", __assign({ className: classNames((_b = {
|
|
655
655
|
"arc-BrandLogo": true,
|
|
656
656
|
"arc-BrandLogo--colorBrand": color === "brand",
|
|
@@ -1380,7 +1380,7 @@ const BtIconChevronRightMid = (props) =>
|
|
|
1380
1380
|
var Button = forwardRef(function (_a, ref) {
|
|
1381
1381
|
var _b;
|
|
1382
1382
|
var ariaLabel = _a.ariaLabel, _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", "fill", "href", "icon", "iconPosition", "id", "isDisabled", "isDisplayBlock", "isFullWidth", "label", "onClick", "rel", "size", "supportingText", "target", "type", "form"]);
|
|
1383
|
-
var surface = useContext(Context$
|
|
1383
|
+
var surface = useContext(Context$5).surface;
|
|
1384
1384
|
var buttonClasses = classNames((_b = {
|
|
1385
1385
|
"arc-Button": true,
|
|
1386
1386
|
"arc-Button--displayBlock": isDisplayBlock
|
|
@@ -1572,7 +1572,7 @@ var useNumericInput = function (props) {
|
|
|
1572
1572
|
var Card = function (_a) {
|
|
1573
1573
|
var _b;
|
|
1574
1574
|
var actionId = _a.actionId, _c = _a.actionLabel, actionLabel = _c === void 0 ? "Read more" : _c, children = _a.children, _d = _a.fill, fill = _d === void 0 ? "solid" : _d, href = _a.href, imageAlt = _a.imageAlt, imageHeight = _a.imageHeight, imageLoading = _a.imageLoading, imageSrc = _a.imageSrc, imageSrcSet = _a.imageSrcSet, linkData = _a.linkData, minHeight = _a.minHeight, onClick = _a.onClick, target = _a.target, title = _a.title, _e = _a.titleSize, titleSize = _e === void 0 ? "s" : _e, props = __rest(_a, ["actionId", "actionLabel", "children", "fill", "href", "imageAlt", "imageHeight", "imageLoading", "imageSrc", "imageSrcSet", "linkData", "minHeight", "onClick", "target", "title", "titleSize"]);
|
|
1575
|
-
var surface = useContext(Context$
|
|
1575
|
+
var surface = useContext(Context$5).surface;
|
|
1576
1576
|
var interactionMode = useInteractionMode().interactionMode;
|
|
1577
1577
|
var Wrapper = function (_a) {
|
|
1578
1578
|
var children = _a.children;
|
|
@@ -1629,7 +1629,7 @@ Card.Image = CardImage;
|
|
|
1629
1629
|
*/
|
|
1630
1630
|
var CardLink = function (_a) {
|
|
1631
1631
|
var actionId = _a.actionId, isButton = _a.isButton, children = _a.children, fill = _a.fill, href = _a.href, _b = _a.linkData, linkData = _b === void 0 ? {} : _b, onClick = _a.onClick, stretch = _a.stretch, target = _a.target;
|
|
1632
|
-
var surface = useContext(Context$
|
|
1632
|
+
var surface = useContext(Context$5).surface;
|
|
1633
1633
|
return (React__default.createElement("a", __assign({ onClick: handleLinkClick({ handler: onClick }), "aria-describedby": actionId, className: classNames({
|
|
1634
1634
|
"arc-Card-link": true,
|
|
1635
1635
|
"arc-Card-link--button": isButton,
|
|
@@ -1681,7 +1681,7 @@ const BtIconChevronDown2Px = (props) =>
|
|
|
1681
1681
|
*/
|
|
1682
1682
|
var DisclosureMini = function (_a) {
|
|
1683
1683
|
var children = _a.children, summary = _a.summary, onClick = _a.onClick, id = _a.id, _b = _a.isOpen, isOpen = _b === void 0 ? false : _b, _c = _a.iconPosition, iconPosition = _c === void 0 ? "left" : _c, _d = _a.size, size = _d === void 0 ? "l" : _d, props = __rest(_a, ["children", "summary", "onClick", "id", "isOpen", "iconPosition", "size"]);
|
|
1684
|
-
var surface = useContext(Context$
|
|
1684
|
+
var surface = useContext(Context$5).surface;
|
|
1685
1685
|
var _e = useState(false), disclousreState = _e[0], setDisclosureState = _e[1];
|
|
1686
1686
|
var handleOnClick = function () {
|
|
1687
1687
|
onClick && onClick();
|
|
@@ -1705,23 +1705,31 @@ var DisclosureMini = function (_a) {
|
|
|
1705
1705
|
React__default.createElement("span", { id: id }, children)))));
|
|
1706
1706
|
};
|
|
1707
1707
|
|
|
1708
|
-
|
|
1708
|
+
/**
|
|
1709
|
+
* Provides text for screen readers that is visually hidden.
|
|
1710
|
+
*/
|
|
1711
|
+
var VisuallyHidden = function (_a) {
|
|
1712
|
+
var children = _a.children;
|
|
1713
|
+
return (React__default.createElement("span", { "data-testid": "visually-hidden", className: "arc-VisuallyHidden" }, children));
|
|
1714
|
+
};
|
|
1715
|
+
|
|
1716
|
+
var defaultContext$4 = {
|
|
1709
1717
|
requirementStatus: null
|
|
1710
1718
|
};
|
|
1711
|
-
var Context$
|
|
1712
|
-
var Provider$
|
|
1719
|
+
var Context$4 = createContext(defaultContext$4);
|
|
1720
|
+
var Provider$5 = Context$4.Provider;
|
|
1713
1721
|
/**
|
|
1714
1722
|
* Use `FormControl` to provide inputs with labels, helper text and error messages
|
|
1715
1723
|
*/
|
|
1716
1724
|
var FormControl = function (_a) {
|
|
1717
|
-
var children = _a.children, _b = _a.elementType, ElementType = _b === void 0 ? "div" : _b, errorMessage = _a.errorMessage, helper = _a.helper, htmlFor = _a.htmlFor, supplementaryInfo = _a.supplementaryInfo, id = _a.id, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, _d = _a.requirementStatus, requirementStatus = _d === void 0 ? "optional" : _d, _e = _a.helperUnderLabel, helperUnderLabel = _e === void 0 ? false : _e, isDisabled = _a.isDisabled, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, props = __rest(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "supplementaryInfo", "id", "label", "labelSize", "requirementStatus", "helperUnderLabel", "isDisabled", "disclosureTitle", "disclosureText", "onClickDisclosure"]);
|
|
1718
|
-
var surface = useContext(Context$
|
|
1719
|
-
var
|
|
1725
|
+
var children = _a.children, _b = _a.elementType, ElementType = _b === void 0 ? "div" : _b, errorMessage = _a.errorMessage, helper = _a.helper, htmlFor = _a.htmlFor, supplementaryInfo = _a.supplementaryInfo, id = _a.id, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, _d = _a.requirementStatus, requirementStatus = _d === void 0 ? "optional" : _d, _e = _a.helperUnderLabel, helperUnderLabel = _e === void 0 ? false : _e, isDisabled = _a.isDisabled, _f = _a.hideLabel, hideLabel = _f === void 0 ? false : _f, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, props = __rest(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "supplementaryInfo", "id", "label", "labelSize", "requirementStatus", "helperUnderLabel", "isDisabled", "hideLabel", "disclosureTitle", "disclosureText", "onClickDisclosure"]);
|
|
1726
|
+
var surface = useContext(Context$5).surface;
|
|
1727
|
+
var _g = useAriaDescribedby({
|
|
1720
1728
|
disclosureText: disclosureText,
|
|
1721
1729
|
errorMessage: errorMessage,
|
|
1722
1730
|
helper: helper,
|
|
1723
1731
|
id: htmlFor || id
|
|
1724
|
-
}), ariaDescribedby =
|
|
1732
|
+
}), ariaDescribedby = _g.ariaDescribedby, idError = _g.idError, idHelper = _g.idHelper, idDisclosure = _g.idDisclosure;
|
|
1725
1733
|
var LabelType = ElementType === "div" ? "label" : "legend";
|
|
1726
1734
|
var elementProps = {};
|
|
1727
1735
|
var labelProps = {};
|
|
@@ -1739,16 +1747,18 @@ var FormControl = function (_a) {
|
|
|
1739
1747
|
}
|
|
1740
1748
|
var hasInfo = !helperUnderLabel &&
|
|
1741
1749
|
Boolean(errorMessage || disclosureTitle || helper || supplementaryInfo);
|
|
1742
|
-
return (React__default.createElement(Provider$
|
|
1750
|
+
return (React__default.createElement(Provider$5, { value: { requirementStatus: requirementStatus } },
|
|
1743
1751
|
React__default.createElement(ElementType, __assign({ className: classNames({
|
|
1744
1752
|
"arc-FormControl": true,
|
|
1745
1753
|
"arc-FormControl--isDisabled": isDisabled,
|
|
1746
1754
|
"arc-FormControl--smallLabel": labelSize === "s",
|
|
1747
1755
|
"arc-FormControl--onDarkSurface": surface === "dark"
|
|
1748
1756
|
}), id: id }, elementProps, filterDataAttrs(props)),
|
|
1749
|
-
React__default.createElement(LabelType, __assign({ className: "arc-FormControl-label" }, labelProps),
|
|
1757
|
+
React__default.createElement(LabelType, __assign({ className: "arc-FormControl-label" }, labelProps), hideLabel === true ? (React__default.createElement(VisuallyHidden, null,
|
|
1758
|
+
label,
|
|
1759
|
+
requirementStatus === "optional" && (React__default.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)")))) : (React__default.createElement(React__default.Fragment, null,
|
|
1750
1760
|
label,
|
|
1751
|
-
requirementStatus === "optional" && (React__default.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
|
|
1761
|
+
requirementStatus === "optional" && (React__default.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))))),
|
|
1752
1762
|
helperUnderLabel && (React__default.createElement(React__default.Fragment, null, helper && (React__default.createElement("div", { className: "arc-FormControl-helper arc-FormControl-helper--underLabel", id: idHelper }, helper)))),
|
|
1753
1763
|
children,
|
|
1754
1764
|
React__default.createElement("div", { className: classNames("arc-FormControl-info", {
|
|
@@ -1767,8 +1777,8 @@ var FormControl = function (_a) {
|
|
|
1767
1777
|
*/
|
|
1768
1778
|
var Checkbox = forwardRef(function (_a, ref) {
|
|
1769
1779
|
var _b = _a.checked, checked = _b === void 0 ? false : _b, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isRequired, isRequired = _d === void 0 ? false : _d, label = _a.label, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, _e = _a.size, size = _e === void 0 ? "l" : _e, value = _a.value, _f = _a.checkboxAlignment, checkboxAlignment = _f === void 0 ? "center" : _f, props = __rest(_a, ["checked", "errorMessage", "helper", "id", "isDisabled", "isRequired", "label", "name", "onBlur", "onChange", "size", "value", "checkboxAlignment"]);
|
|
1770
|
-
var requirementStatus = useContext(Context$
|
|
1771
|
-
var surface = useContext(Context$
|
|
1780
|
+
var requirementStatus = useContext(Context$4).requirementStatus;
|
|
1781
|
+
var surface = useContext(Context$5).surface;
|
|
1772
1782
|
var _g = useAriaDescribedby({
|
|
1773
1783
|
id: id,
|
|
1774
1784
|
errorMessage: errorMessage
|
|
@@ -1910,7 +1920,7 @@ var Curve = function (_a) {
|
|
|
1910
1920
|
*/
|
|
1911
1921
|
var Disclosure = function (_a) {
|
|
1912
1922
|
var children = _a.children, headingLevel = _a.headingLevel, _b = _a.indentDetails, indentDetails = _b === void 0 ? false : _b, _c = _a.isOpen, isOpen = _c === void 0 ? false : _c, summary = _a.summary, props = __rest(_a, ["children", "headingLevel", "indentDetails", "isOpen", "summary"]);
|
|
1913
|
-
var surface = useContext(Context$
|
|
1923
|
+
var surface = useContext(Context$5).surface;
|
|
1914
1924
|
return (React__default.createElement("details", __assign({ className: classNames({
|
|
1915
1925
|
"arc-Disclosure": true,
|
|
1916
1926
|
"arc-Disclosure--indentDetails": indentDetails,
|
|
@@ -1939,7 +1949,7 @@ var Elevation = function (_a) {
|
|
|
1939
1949
|
|
|
1940
1950
|
var FilterControl = function (_a) {
|
|
1941
1951
|
var children = _a.children, onClick = _a.onClick, _b = _a.isSelected, isSelected = _b === void 0 ? false : _b;
|
|
1942
|
-
var surface = useContext(Context$
|
|
1952
|
+
var surface = useContext(Context$5).surface;
|
|
1943
1953
|
var _c = useState(isSelected), selected = _c[0], setSelected = _c[1];
|
|
1944
1954
|
var onClickHandler = function () {
|
|
1945
1955
|
onClick && onClick();
|
|
@@ -2048,7 +2058,7 @@ Filter.Item = FilterItem;
|
|
|
2048
2058
|
var Group = function (_a) {
|
|
2049
2059
|
var _b;
|
|
2050
2060
|
var children = _a.children, _c = _a.grow, grow = _c === void 0 ? false : _c, _d = _a.growEqual, growEqual = _d === void 0 ? false : _d, _e = _a.gutterBorder, gutterBorder = _e === void 0 ? false : _e, _f = _a.noWrap, noWrap = _f === void 0 ? false : _f, props = __rest(_a, ["children", "grow", "growEqual", "gutterBorder", "noWrap"]);
|
|
2051
|
-
var surface = useContext(Context$
|
|
2061
|
+
var surface = useContext(Context$5).surface;
|
|
2052
2062
|
useEffect(function () {
|
|
2053
2063
|
React__default.Children.map(children, function (item) {
|
|
2054
2064
|
if (item && item.type !== Group.Item) {
|
|
@@ -2149,7 +2159,7 @@ const BtIconCrossFill = (props) =>
|
|
|
2149
2159
|
*/
|
|
2150
2160
|
var Tag = function (_a) {
|
|
2151
2161
|
var children = _a.children, isRemovable = _a.isRemovable, link = _a.link, icon = _a.icon, onClick = _a.onClick, onRemove = _a.onRemove, props = __rest(_a, ["children", "isRemovable", "link", "icon", "onClick", "onRemove"]);
|
|
2152
|
-
var surface = useContext(Context$
|
|
2162
|
+
var surface = useContext(Context$5).surface;
|
|
2153
2163
|
var _b = useState(false), isRemoved = _b[0], setIsRemoved = _b[1];
|
|
2154
2164
|
var onRemoveHandler = function () {
|
|
2155
2165
|
setIsRemoved(function (p) { return !p; });
|
|
@@ -2195,59 +2205,23 @@ var VerticalSpace = function (_a) {
|
|
|
2195
2205
|
_b)) }, filterDataAttrs(props))));
|
|
2196
2206
|
};
|
|
2197
2207
|
|
|
2198
|
-
var
|
|
2199
|
-
var
|
|
2200
|
-
var isMinWidthArcBreakpointS = useMediaQuery("(min-width: ".concat(ArcBreakpointS, "px)"));
|
|
2201
|
-
var isMinWidthArcBreakpointM = useMediaQuery("(min-width: ".concat(ArcBreakpointM, "px)"));
|
|
2202
|
-
var headingSpacing = isMinWidthArcBreakpointS ? "16" : "8";
|
|
2203
|
-
var assetSpacing = isMinWidthArcBreakpointM ? "24" : "20";
|
|
2204
|
-
var containerSpacing = isMinWidthArcBreakpointS ? "32" : "24";
|
|
2208
|
+
var CardHeading = function (_a) {
|
|
2209
|
+
var onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onBlur = _a.onBlur, onFocus = _a.onFocus, href = _a.href, heading = _a.heading, _b = _a.size, size = _b === void 0 ? "s" : _b, _c = _a.isDarkPathway, isDarkPathway = _c === void 0 ? false : _c, _d = _a.linkData, linkData = _d === void 0 ? {} : _d, _e = _a.headingLevel, headingLevel = _e === void 0 ? "2" : _e;
|
|
2205
2210
|
var HeadingElement = "h".concat(headingLevel);
|
|
2206
|
-
return (React__default.createElement(
|
|
2207
|
-
"arc-
|
|
2208
|
-
}) }, filterDataAttrs(
|
|
2209
|
-
React__default.createElement(Surface, { growVertically: true, padding: containerSpacing, background: "white" },
|
|
2210
|
-
React__default.createElement("div", null,
|
|
2211
|
-
image && (React__default.createElement("div", { className: "arc-InformationCard-img" },
|
|
2212
|
-
React__default.createElement(Image, __assign({}, image)),
|
|
2213
|
-
React__default.createElement(VerticalSpace, { size: assetSpacing }))),
|
|
2214
|
-
icon && (React__default.createElement(React__default.Fragment, null,
|
|
2215
|
-
React__default.createElement(Icon, { testId: "information-card-icon", icon: icon, size: 96 }),
|
|
2216
|
-
React__default.createElement(VerticalSpace, { size: assetSpacing }))),
|
|
2217
|
-
label && (React__default.createElement(React__default.Fragment, null,
|
|
2218
|
-
React__default.createElement("span", { className: "arc-InformationCard-label" }, label),
|
|
2219
|
-
React__default.createElement(VerticalSpace, { size: headingSpacing }))),
|
|
2220
|
-
React__default.createElement(HeadingElement, { className: "arc-InformationCard-heading" }, cardUrl ? (React__default.createElement("a", { className: "arc-InformationCard-headingLink", href: cardUrl, onClick: onClick }, heading)) : (heading))),
|
|
2221
|
-
React__default.createElement("div", { className: "arc-InformationCard-contentContainer" },
|
|
2222
|
-
text && (React__default.createElement(React__default.Fragment, null,
|
|
2223
|
-
React__default.createElement(VerticalSpace, { size: headingSpacing }),
|
|
2224
|
-
React__default.createElement(Text, null, text),
|
|
2225
|
-
(button || tags || footerLogo) && React__default.createElement(VerticalSpace, { size: "24" }))),
|
|
2226
|
-
tags && (React__default.createElement(React__default.Fragment, null,
|
|
2227
|
-
React__default.createElement("div", { className: "arc-InformationCard-tagContainer" }, tags.map(function (_a, i) {
|
|
2228
|
-
var text = _a.text, tagProps = __rest(_a, ["text"]);
|
|
2229
|
-
return (React__default.createElement("div", { className: "arc-InformationCard-tag", key: "information-card-tag-".concat(i) },
|
|
2230
|
-
React__default.createElement(Tag, __assign({}, tagProps), text)));
|
|
2231
|
-
})),
|
|
2232
|
-
(button || footerLogo) && React__default.createElement(VerticalSpace, { size: "24" })))),
|
|
2233
|
-
React__default.createElement("div", { className: "arc-InformationCard-footer" },
|
|
2234
|
-
button && !cardUrl && (React__default.createElement("div", { className: "arc-InformationCard-footerButtonContainer" },
|
|
2235
|
-
React__default.createElement(Button, __assign({}, button, { iconPosition: "beforeText", fill: "flat", icon: BtIconArrowRight })))),
|
|
2236
|
-
footerLogo && (React__default.createElement("div", { className: "arc-InformationCard-footerLogoContainer" },
|
|
2237
|
-
React__default.createElement(Image, __assign({}, footerLogo))))))));
|
|
2211
|
+
return (React__default.createElement(HeadingElement, { className: classNames("arc-CardHeading", "arc-CardHeading--".concat(size), {
|
|
2212
|
+
"arc-CardHeading--darkPathway": isDarkPathway
|
|
2213
|
+
}) }, href ? (React__default.createElement("a", __assign({ className: "arc-CardHeading-link", href: href, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: onFocus, onBlur: onBlur }, filterDataAttrs(linkData)), heading)) : (heading)));
|
|
2238
2214
|
};
|
|
2239
2215
|
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
"arc-Markup--onDarkSurface": surface === "dark"
|
|
2250
|
-
}) }, filterDataAttrs(props)), children));
|
|
2216
|
+
var CardLabel = function (_a) {
|
|
2217
|
+
var _b;
|
|
2218
|
+
var text = _a.text, _c = _a.color, color = _c === void 0 ? "muted" : _c, _d = _a.isBold, isBold = _d === void 0 ? true : _d, _e = _a.isDarkPathway, isDarkPathway = _e === void 0 ? false : _e;
|
|
2219
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
2220
|
+
React__default.createElement("span", { className: classNames("arc-CardLabel", (_b = {},
|
|
2221
|
+
_b[suffixModifier("arc-CardLabel--color", color)] = !isDarkPathway,
|
|
2222
|
+
_b["arc-CardLabel--bold"] = isBold,
|
|
2223
|
+
_b["arc-CardLabel--darkPathway"] = isDarkPathway,
|
|
2224
|
+
_b)) }, text)));
|
|
2251
2225
|
};
|
|
2252
2226
|
|
|
2253
2227
|
const BtIconPlay = (props) =>
|
|
@@ -2309,31 +2283,103 @@ const BtIconPlayFill = (props) =>
|
|
|
2309
2283
|
}),
|
|
2310
2284
|
);
|
|
2311
2285
|
|
|
2286
|
+
var CardFooter = function (_a) {
|
|
2287
|
+
var metaText = _a.metaText, _b = _a.buttonIcon, buttonIcon = _b === void 0 ? "arrow" : _b, _c = _a.isDarkPathway, isDarkPathway = _c === void 0 ? false : _c, _d = _a.showButton, showButton = _d === void 0 ? true : _d, _e = _a.showFilledIcon, showFilledIcon = _e === void 0 ? false : _e;
|
|
2288
|
+
var icons = {
|
|
2289
|
+
arrow: {
|
|
2290
|
+
regular: BtIconArrowRight,
|
|
2291
|
+
filled: BtIconArrowRightFill
|
|
2292
|
+
},
|
|
2293
|
+
play: {
|
|
2294
|
+
regular: BtIconPlay,
|
|
2295
|
+
filled: BtIconPlayFill
|
|
2296
|
+
}
|
|
2297
|
+
};
|
|
2298
|
+
return (React__default.createElement("div", { className: classNames("arc-CardFooter", {
|
|
2299
|
+
"arc-CardFooter--darkPathway": isDarkPathway,
|
|
2300
|
+
"arc-CardFooter--showFilledIcon": showFilledIcon
|
|
2301
|
+
}) },
|
|
2302
|
+
React__default.createElement("div", { className: "arc-CardFooter-metaTextContainer" }, metaText && (React__default.createElement("span", { className: "arc-CardFooter-metaText" }, metaText))),
|
|
2303
|
+
showButton && (React__default.createElement("div", null,
|
|
2304
|
+
React__default.createElement("div", { className: "arc-CardFooter-button" },
|
|
2305
|
+
React__default.createElement("div", { className: classNames("arc-CardFooter-buttonIcon", "arc-CardFooter-buttonIcon--regular") },
|
|
2306
|
+
React__default.createElement(Icon, { icon: icons[buttonIcon].regular, size: 40 })),
|
|
2307
|
+
React__default.createElement("div", { className: "arc-CardFooter-buttonIcon arc-CardFooter-buttonIcon--filled" },
|
|
2308
|
+
React__default.createElement(Icon, { icon: icons[buttonIcon].filled, size: 40 })))))));
|
|
2309
|
+
};
|
|
2310
|
+
|
|
2312
2311
|
var ConditionalWrapper = function (_a) {
|
|
2313
2312
|
var condition = _a.condition, wrapper = _a.wrapper, children = _a.children;
|
|
2314
2313
|
return (React__default.createElement(React__default.Fragment, null, condition ? wrapper(children) : children));
|
|
2315
2314
|
};
|
|
2316
2315
|
|
|
2316
|
+
var InformationCard = function (_a) {
|
|
2317
|
+
var cardUrl = _a.cardUrl, onClick = _a.onClick, heading = _a.heading, text = _a.text, label = _a.label, footerLogo = _a.footerLogo, button = _a.button, image = _a.image, tags = _a.tags, icon = _a.icon, _b = _a.headingLevel, headingLevel = _b === void 0 ? "2" : _b, props = __rest(_a, ["cardUrl", "onClick", "heading", "text", "label", "footerLogo", "button", "image", "tags", "icon", "headingLevel"]);
|
|
2318
|
+
var isMinWidthArcBreakpointS = useMediaQuery("(min-width: ".concat(ArcBreakpointS, "px)"));
|
|
2319
|
+
var isMinWidthArcBreakpointM = useMediaQuery("(min-width: ".concat(ArcBreakpointM, "px)"));
|
|
2320
|
+
var _c = useState(false), showHoverState = _c[0], setShowHoverState = _c[1];
|
|
2321
|
+
var headingSpacing = isMinWidthArcBreakpointS ? "16" : "8";
|
|
2322
|
+
var assetSpacing = isMinWidthArcBreakpointM ? "24" : "20";
|
|
2323
|
+
var containerSpacing = isMinWidthArcBreakpointS ? "32" : "24";
|
|
2324
|
+
var handleShowHoverState = function (show) { return function () { return setShowHoverState(show); }; };
|
|
2325
|
+
return (React__default.createElement("div", __assign({ className: classNames("arc-InformationCard", {
|
|
2326
|
+
"arc-InformationCard--outlined": cardUrl && showHoverState
|
|
2327
|
+
}) }, filterDataAttrs(props)),
|
|
2328
|
+
React__default.createElement(Surface, { growVertically: true, padding: containerSpacing, background: "white" },
|
|
2329
|
+
React__default.createElement("div", null,
|
|
2330
|
+
image && (React__default.createElement("div", { className: "arc-InformationCard-img" },
|
|
2331
|
+
React__default.createElement(Image, __assign({}, image)),
|
|
2332
|
+
React__default.createElement(VerticalSpace, { size: assetSpacing }))),
|
|
2333
|
+
icon && (React__default.createElement(React__default.Fragment, null,
|
|
2334
|
+
React__default.createElement(Icon, { testId: "information-card-icon", icon: icon, size: 96 }),
|
|
2335
|
+
React__default.createElement(VerticalSpace, { size: assetSpacing }))),
|
|
2336
|
+
label && (React__default.createElement(React__default.Fragment, null,
|
|
2337
|
+
React__default.createElement(CardLabel, { color: "supporting", text: label }),
|
|
2338
|
+
React__default.createElement(VerticalSpace, { size: headingSpacing }))),
|
|
2339
|
+
React__default.createElement(CardHeading, { heading: heading, headingLevel: headingLevel, href: cardUrl, onClick: onClick, onMouseEnter: handleShowHoverState(true), onMouseLeave: handleShowHoverState(false), onFocus: handleShowHoverState(true), onBlur: handleShowHoverState(false) })),
|
|
2340
|
+
React__default.createElement("div", { className: "arc-InformationCard-contentContainer" },
|
|
2341
|
+
text && (React__default.createElement(React__default.Fragment, null,
|
|
2342
|
+
React__default.createElement(VerticalSpace, { size: headingSpacing }),
|
|
2343
|
+
React__default.createElement(Text, null, text),
|
|
2344
|
+
(button || tags || footerLogo) && React__default.createElement(VerticalSpace, { size: "24" }))),
|
|
2345
|
+
tags && (React__default.createElement(React__default.Fragment, null,
|
|
2346
|
+
React__default.createElement("div", { className: "arc-InformationCard-tagContainer" }, tags.map(function (_a, i) {
|
|
2347
|
+
var text = _a.text, tagProps = __rest(_a, ["text"]);
|
|
2348
|
+
return (React__default.createElement("div", { className: "arc-InformationCard-tag", key: "information-card-tag-".concat(i) },
|
|
2349
|
+
React__default.createElement(Tag, __assign({}, tagProps), text)));
|
|
2350
|
+
})),
|
|
2351
|
+
(button || footerLogo) && React__default.createElement(VerticalSpace, { size: "24" })))),
|
|
2352
|
+
React__default.createElement("div", { className: "arc-InformationCard-footer" },
|
|
2353
|
+
button && !cardUrl && (React__default.createElement("div", { className: "arc-InformationCard-footerButtonContainer" },
|
|
2354
|
+
React__default.createElement(Button, __assign({}, button, { iconPosition: "beforeText", fill: "flat", icon: BtIconArrowRight })))),
|
|
2355
|
+
footerLogo && (React__default.createElement("div", { className: "arc-InformationCard-footerLogoContainer" },
|
|
2356
|
+
React__default.createElement(Image, __assign({}, footerLogo))))))));
|
|
2357
|
+
};
|
|
2358
|
+
|
|
2359
|
+
/**
|
|
2360
|
+
* Use `Markup` to display HTML-formatted text.
|
|
2361
|
+
*/
|
|
2362
|
+
var Markup = function (_a) {
|
|
2363
|
+
var children = _a.children, _b = _a.isMeasured, isMeasured = _b === void 0 ? false : _b, props = __rest(_a, ["children", "isMeasured"]);
|
|
2364
|
+
var surface = useContext(Context$5).surface;
|
|
2365
|
+
return (React__default.createElement("div", __assign({ className: classNames({
|
|
2366
|
+
"arc-Markup": true,
|
|
2367
|
+
"arc-Markup--measured": isMeasured,
|
|
2368
|
+
"arc-Markup--onDarkSurface": surface === "dark"
|
|
2369
|
+
}) }, filterDataAttrs(props)), children));
|
|
2370
|
+
};
|
|
2371
|
+
|
|
2317
2372
|
/**
|
|
2318
2373
|
* Use `MediaCard` to contain content and an image about a single subject.
|
|
2319
2374
|
*/
|
|
2320
2375
|
var MediaCard = function (_a) {
|
|
2321
2376
|
var img = _a.img, url = _a.url, onClick = _a.onClick, heading = _a.heading, label = _a.label, text = _a.text, metaText = _a.metaText, _b = _a.buttonIcon, buttonIcon = _b === void 0 ? "arrow" : _b, _c = _a.isContained, isContained = _c === void 0 ? true : _c, _d = _a.headingLevel, headingLevel = _d === void 0 ? "2" : _d, props = __rest(_a, ["img", "url", "onClick", "heading", "label", "text", "metaText", "buttonIcon", "isContained", "headingLevel"]);
|
|
2377
|
+
var _e = useState(false), showHoverState = _e[0], setShowHoverState = _e[1];
|
|
2322
2378
|
var isMinWidthArcBreakpointS = useMediaQuery("(min-width: ".concat(ArcBreakpointS, "px)"));
|
|
2323
2379
|
var headingSpacing = isMinWidthArcBreakpointS ? "16" : "8";
|
|
2324
|
-
var
|
|
2325
|
-
var icons = {
|
|
2326
|
-
arrow: {
|
|
2327
|
-
regular: BtIconArrowRight,
|
|
2328
|
-
hover: BtIconArrowRightFill
|
|
2329
|
-
},
|
|
2330
|
-
play: {
|
|
2331
|
-
regular: BtIconPlay,
|
|
2332
|
-
hover: BtIconPlayFill
|
|
2333
|
-
}
|
|
2334
|
-
};
|
|
2380
|
+
var handleShowHoverState = function (show) { return function () { return setShowHoverState(show); }; };
|
|
2335
2381
|
return (React__default.createElement("div", __assign({ className: classNames("arc-MediaCard", {
|
|
2336
|
-
"arc-MediaCard--
|
|
2382
|
+
"arc-MediaCard--outlined": url && isContained && showHoverState,
|
|
2337
2383
|
"arc-MediaCard--contained": isContained
|
|
2338
2384
|
}) }, filterDataAttrs(props)),
|
|
2339
2385
|
React__default.createElement(ConditionalWrapper, { condition: isContained, wrapper: function (children) { return (React__default.createElement(Surface, { growVertically: true, background: "white" }, children)); } },
|
|
@@ -2341,21 +2387,14 @@ var MediaCard = function (_a) {
|
|
|
2341
2387
|
React__default.createElement(Image, __assign({}, img))),
|
|
2342
2388
|
React__default.createElement("div", { className: "arc-MediaCard-content" },
|
|
2343
2389
|
label && (React__default.createElement(React__default.Fragment, null,
|
|
2344
|
-
React__default.createElement(
|
|
2390
|
+
React__default.createElement(CardLabel, { text: label }),
|
|
2345
2391
|
React__default.createElement(VerticalSpace, { size: headingSpacing }))),
|
|
2346
|
-
React__default.createElement(
|
|
2392
|
+
React__default.createElement(CardHeading, { heading: heading, headingLevel: headingLevel, href: url, onClick: onClick, onMouseEnter: handleShowHoverState(true), onMouseLeave: handleShowHoverState(false), onFocus: handleShowHoverState(true), onBlur: handleShowHoverState(false) }),
|
|
2347
2393
|
React__default.createElement("div", { className: "arc-MediaCard-textContainer" }, text && (React__default.createElement(React__default.Fragment, null,
|
|
2348
2394
|
React__default.createElement(VerticalSpace, { size: headingSpacing }),
|
|
2349
2395
|
React__default.createElement(Text, null, text),
|
|
2350
2396
|
(url || metaText) && React__default.createElement(VerticalSpace, { size: "24" })))),
|
|
2351
|
-
React__default.createElement(
|
|
2352
|
-
React__default.createElement("div", { className: "arc-MediaCard-metaTextContainer" }, metaText && (React__default.createElement("span", { className: "arc-MediaCard-metaText" }, metaText))),
|
|
2353
|
-
url && (React__default.createElement("div", null,
|
|
2354
|
-
React__default.createElement("div", { className: "arc-MediaCard-footerButton" },
|
|
2355
|
-
React__default.createElement("div", { className: classNames("arc-MediaCard-footerButtonIcon", "arc-MediaCard-footerButtonIcon--regular") },
|
|
2356
|
-
React__default.createElement(Icon, { icon: icons[buttonIcon].regular, size: 40 })),
|
|
2357
|
-
React__default.createElement("div", { className: "arc-MediaCard-footerButtonIcon arc-MediaCard-footerButtonIcon--hover" },
|
|
2358
|
-
React__default.createElement(Icon, { icon: icons[buttonIcon].hover, size: 40 }))))))))));
|
|
2397
|
+
React__default.createElement(CardFooter, { showFilledIcon: showHoverState, buttonIcon: buttonIcon, metaText: metaText, showButton: Boolean(url) })))));
|
|
2359
2398
|
};
|
|
2360
2399
|
|
|
2361
2400
|
function _extends() {
|
|
@@ -33728,25 +33767,6 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
33728
33767
|
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
33729
33768
|
}));
|
|
33730
33769
|
});
|
|
33731
|
-
const $5cb92bef7577960e$export$4d5eb2109db14228 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
33732
|
-
const context = useContext($5cb92bef7577960e$var$DismissableLayerContext$1);
|
|
33733
|
-
const ref = useRef(null);
|
|
33734
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
33735
|
-
useEffect(()=>{
|
|
33736
|
-
const node = ref.current;
|
|
33737
|
-
if (node) {
|
|
33738
|
-
context.branches.add(node);
|
|
33739
|
-
return ()=>{
|
|
33740
|
-
context.branches.delete(node);
|
|
33741
|
-
};
|
|
33742
|
-
}
|
|
33743
|
-
}, [
|
|
33744
|
-
context.branches
|
|
33745
|
-
]);
|
|
33746
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, props, {
|
|
33747
|
-
ref: composedRefs
|
|
33748
|
-
}));
|
|
33749
|
-
});
|
|
33750
33770
|
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
33751
33771
|
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
33752
33772
|
* to mimic layer dismissing behaviour present in OS.
|
|
@@ -33784,7 +33804,9 @@ const $5cb92bef7577960e$export$4d5eb2109db14228 = /*#__PURE__*/ forwardRef((prop
|
|
|
33784
33804
|
once: true
|
|
33785
33805
|
});
|
|
33786
33806
|
} else handleAndDispatchPointerDownOutsideEvent();
|
|
33787
|
-
}
|
|
33807
|
+
} else // We need to remove the event listener in case the outside click has been canceled.
|
|
33808
|
+
// See: https://github.com/radix-ui/primitives/issues/2171
|
|
33809
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
33788
33810
|
isPointerInsideReactTreeRef.current = false;
|
|
33789
33811
|
};
|
|
33790
33812
|
/**
|
|
@@ -33863,16 +33885,14 @@ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent$1(name, handler, det
|
|
|
33863
33885
|
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
33864
33886
|
else target.dispatchEvent(event);
|
|
33865
33887
|
}
|
|
33866
|
-
const $5cb92bef7577960e$export$be92b6f5f03c0fe9 = $5cb92bef7577960e$export$177fb62ff3ec1f22$1;
|
|
33867
|
-
const $5cb92bef7577960e$export$aecb2ddcb55c95be = $5cb92bef7577960e$export$4d5eb2109db14228;
|
|
33868
33888
|
|
|
33869
|
-
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT
|
|
33870
|
-
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT
|
|
33871
|
-
const $d3863c46a17e8a28$var$EVENT_OPTIONS
|
|
33889
|
+
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
|
|
33890
|
+
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
|
|
33891
|
+
const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
33872
33892
|
bubbles: false,
|
|
33873
33893
|
cancelable: true
|
|
33874
33894
|
};
|
|
33875
|
-
const $d3863c46a17e8a28$export$20e40289641fbbb6
|
|
33895
|
+
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
33876
33896
|
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
33877
33897
|
const [container1, setContainer] = useState(null);
|
|
33878
33898
|
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onMountAutoFocusProp);
|
|
@@ -33895,7 +33915,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
33895
33915
|
if (focusScope.paused || !container1) return;
|
|
33896
33916
|
const target = event.target;
|
|
33897
33917
|
if (container1.contains(target)) lastFocusedElementRef.current = target;
|
|
33898
|
-
else $d3863c46a17e8a28$var$focus
|
|
33918
|
+
else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
33899
33919
|
select: true
|
|
33900
33920
|
});
|
|
33901
33921
|
}
|
|
@@ -33913,7 +33933,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
33913
33933
|
// throws the CPU to 100%, so we avoid doing anything for this reason here too.
|
|
33914
33934
|
if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)
|
|
33915
33935
|
// that is outside the container, we move focus to the last valid focused element inside.
|
|
33916
|
-
if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus
|
|
33936
|
+
if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
33917
33937
|
select: true
|
|
33918
33938
|
});
|
|
33919
33939
|
} // When the focused element gets removed from the DOM, browsers move focus
|
|
@@ -33921,11 +33941,8 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
33921
33941
|
// to keep focus trapped correctly.
|
|
33922
33942
|
function handleMutations(mutations) {
|
|
33923
33943
|
const focusedElement = document.activeElement;
|
|
33924
|
-
|
|
33925
|
-
|
|
33926
|
-
if (!(container1 !== null && container1 !== void 0 && container1.contains(focusedElement))) $d3863c46a17e8a28$var$focus$1(container1);
|
|
33927
|
-
}
|
|
33928
|
-
}
|
|
33944
|
+
if (focusedElement !== document.body) return;
|
|
33945
|
+
for (const mutation of mutations)if (mutation.removedNodes.length > 0) $d3863c46a17e8a28$var$focus(container1);
|
|
33929
33946
|
}
|
|
33930
33947
|
document.addEventListener('focusin', handleFocusIn);
|
|
33931
33948
|
document.addEventListener('focusout', handleFocusOut);
|
|
@@ -33947,34 +33964,34 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
33947
33964
|
]);
|
|
33948
33965
|
useEffect(()=>{
|
|
33949
33966
|
if (container1) {
|
|
33950
|
-
$d3863c46a17e8a28$var$focusScopesStack
|
|
33967
|
+
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
|
|
33951
33968
|
const previouslyFocusedElement = document.activeElement;
|
|
33952
33969
|
const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
|
|
33953
33970
|
if (!hasFocusedCandidate) {
|
|
33954
|
-
const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT
|
|
33955
|
-
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT
|
|
33971
|
+
const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
33972
|
+
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
33956
33973
|
container1.dispatchEvent(mountEvent);
|
|
33957
33974
|
if (!mountEvent.defaultPrevented) {
|
|
33958
|
-
$d3863c46a17e8a28$var$focusFirst
|
|
33975
|
+
$d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
|
|
33959
33976
|
select: true
|
|
33960
33977
|
});
|
|
33961
|
-
if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus
|
|
33978
|
+
if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
|
|
33962
33979
|
}
|
|
33963
33980
|
}
|
|
33964
33981
|
return ()=>{
|
|
33965
|
-
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT
|
|
33982
|
+
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
|
|
33966
33983
|
// We need to delay the focus a little to get around it for now.
|
|
33967
33984
|
// See: https://github.com/facebook/react/issues/17894
|
|
33968
33985
|
setTimeout(()=>{
|
|
33969
|
-
const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT
|
|
33970
|
-
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT
|
|
33986
|
+
const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
33987
|
+
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
33971
33988
|
container1.dispatchEvent(unmountEvent);
|
|
33972
|
-
if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus
|
|
33989
|
+
if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
|
|
33973
33990
|
select: true
|
|
33974
33991
|
});
|
|
33975
33992
|
// we need to remove the listener after we `dispatchEvent`
|
|
33976
|
-
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT
|
|
33977
|
-
$d3863c46a17e8a28$var$focusScopesStack
|
|
33993
|
+
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
33994
|
+
$d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
|
|
33978
33995
|
}, 0);
|
|
33979
33996
|
};
|
|
33980
33997
|
}
|
|
@@ -33991,19 +34008,19 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
33991
34008
|
const focusedElement = document.activeElement;
|
|
33992
34009
|
if (isTabKey && focusedElement) {
|
|
33993
34010
|
const container = event.currentTarget;
|
|
33994
|
-
const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges
|
|
34011
|
+
const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container);
|
|
33995
34012
|
const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges
|
|
33996
34013
|
if (!hasTabbableElementsInside) {
|
|
33997
34014
|
if (focusedElement === container) event.preventDefault();
|
|
33998
34015
|
} else {
|
|
33999
34016
|
if (!event.shiftKey && focusedElement === last) {
|
|
34000
34017
|
event.preventDefault();
|
|
34001
|
-
if (loop) $d3863c46a17e8a28$var$focus
|
|
34018
|
+
if (loop) $d3863c46a17e8a28$var$focus(first, {
|
|
34002
34019
|
select: true
|
|
34003
34020
|
});
|
|
34004
34021
|
} else if (event.shiftKey && focusedElement === first) {
|
|
34005
34022
|
event.preventDefault();
|
|
34006
|
-
if (loop) $d3863c46a17e8a28$var$focus
|
|
34023
|
+
if (loop) $d3863c46a17e8a28$var$focus(last, {
|
|
34007
34024
|
select: true
|
|
34008
34025
|
});
|
|
34009
34026
|
}
|
|
@@ -34026,10 +34043,10 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
34026
34043
|
* -----------------------------------------------------------------------------------------------*/ /**
|
|
34027
34044
|
* Attempts focusing the first element in a list of candidates.
|
|
34028
34045
|
* Stops when focus has actually moved.
|
|
34029
|
-
*/ function $d3863c46a17e8a28$var$focusFirst
|
|
34046
|
+
*/ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) {
|
|
34030
34047
|
const previouslyFocusedElement = document.activeElement;
|
|
34031
34048
|
for (const candidate of candidates){
|
|
34032
|
-
$d3863c46a17e8a28$var$focus
|
|
34049
|
+
$d3863c46a17e8a28$var$focus(candidate, {
|
|
34033
34050
|
select: select
|
|
34034
34051
|
});
|
|
34035
34052
|
if (document.activeElement !== previouslyFocusedElement) return;
|
|
@@ -34037,10 +34054,10 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
34037
34054
|
}
|
|
34038
34055
|
/**
|
|
34039
34056
|
* Returns the first and last tabbable elements inside a container.
|
|
34040
|
-
*/ function $d3863c46a17e8a28$var$getTabbableEdges
|
|
34041
|
-
const candidates = $d3863c46a17e8a28$var$getTabbableCandidates
|
|
34042
|
-
const first = $d3863c46a17e8a28$var$findVisible
|
|
34043
|
-
const last = $d3863c46a17e8a28$var$findVisible
|
|
34057
|
+
*/ function $d3863c46a17e8a28$var$getTabbableEdges(container) {
|
|
34058
|
+
const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container);
|
|
34059
|
+
const first = $d3863c46a17e8a28$var$findVisible(candidates, container);
|
|
34060
|
+
const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container);
|
|
34044
34061
|
return [
|
|
34045
34062
|
first,
|
|
34046
34063
|
last
|
|
@@ -34055,7 +34072,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
34055
34072
|
*
|
|
34056
34073
|
* See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
|
|
34057
34074
|
* Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
|
|
34058
|
-
*/ function $d3863c46a17e8a28$var$getTabbableCandidates
|
|
34075
|
+
*/ function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
|
|
34059
34076
|
const nodes = [];
|
|
34060
34077
|
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
34061
34078
|
acceptNode: (node)=>{
|
|
@@ -34073,15 +34090,15 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6$1 = /*#__PURE__*/ forwardRef((pr
|
|
|
34073
34090
|
/**
|
|
34074
34091
|
* Returns the first visible element in a list.
|
|
34075
34092
|
* NOTE: Only checks visibility up to the `container`.
|
|
34076
|
-
*/ function $d3863c46a17e8a28$var$findVisible
|
|
34093
|
+
*/ function $d3863c46a17e8a28$var$findVisible(elements, container) {
|
|
34077
34094
|
for (const element of elements){
|
|
34078
34095
|
// we stop checking if it's hidden at the `container` level (excluding)
|
|
34079
|
-
if (!$d3863c46a17e8a28$var$isHidden
|
|
34096
|
+
if (!$d3863c46a17e8a28$var$isHidden(element, {
|
|
34080
34097
|
upTo: container
|
|
34081
34098
|
})) return element;
|
|
34082
34099
|
}
|
|
34083
34100
|
}
|
|
34084
|
-
function $d3863c46a17e8a28$var$isHidden
|
|
34101
|
+
function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) {
|
|
34085
34102
|
if (getComputedStyle(node).visibility === 'hidden') return true;
|
|
34086
34103
|
while(node){
|
|
34087
34104
|
// we stop at `upTo` (excluding it)
|
|
@@ -34091,23 +34108,23 @@ function $d3863c46a17e8a28$var$isHidden$1(node, { upTo: upTo }) {
|
|
|
34091
34108
|
}
|
|
34092
34109
|
return false;
|
|
34093
34110
|
}
|
|
34094
|
-
function $d3863c46a17e8a28$var$isSelectableInput
|
|
34111
|
+
function $d3863c46a17e8a28$var$isSelectableInput(element) {
|
|
34095
34112
|
return element instanceof HTMLInputElement && 'select' in element;
|
|
34096
34113
|
}
|
|
34097
|
-
function $d3863c46a17e8a28$var$focus
|
|
34114
|
+
function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) {
|
|
34098
34115
|
// only focus if that element is focusable
|
|
34099
34116
|
if (element && element.focus) {
|
|
34100
34117
|
const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users
|
|
34101
34118
|
element.focus({
|
|
34102
34119
|
preventScroll: true
|
|
34103
34120
|
}); // only select if its not the same element, it supports selection and we need to select
|
|
34104
|
-
if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput
|
|
34121
|
+
if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select();
|
|
34105
34122
|
}
|
|
34106
34123
|
}
|
|
34107
34124
|
/* -------------------------------------------------------------------------------------------------
|
|
34108
34125
|
* FocusScope stack
|
|
34109
|
-
* -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack
|
|
34110
|
-
function $d3863c46a17e8a28$var$createFocusScopesStack
|
|
34126
|
+
* -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
|
|
34127
|
+
function $d3863c46a17e8a28$var$createFocusScopesStack() {
|
|
34111
34128
|
/** A stack of focus scopes, with the active one at the top */ let stack = [];
|
|
34112
34129
|
return {
|
|
34113
34130
|
add (focusScope) {
|
|
@@ -34115,17 +34132,17 @@ function $d3863c46a17e8a28$var$createFocusScopesStack$1() {
|
|
|
34115
34132
|
const activeFocusScope = stack[0];
|
|
34116
34133
|
if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
|
|
34117
34134
|
// remove in case it already exists (because we'll re-add it at the top of the stack)
|
|
34118
|
-
stack = $d3863c46a17e8a28$var$arrayRemove
|
|
34135
|
+
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
34119
34136
|
stack.unshift(focusScope);
|
|
34120
34137
|
},
|
|
34121
34138
|
remove (focusScope) {
|
|
34122
34139
|
var _stack$;
|
|
34123
|
-
stack = $d3863c46a17e8a28$var$arrayRemove
|
|
34140
|
+
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
34124
34141
|
(_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
|
|
34125
34142
|
}
|
|
34126
34143
|
};
|
|
34127
34144
|
}
|
|
34128
|
-
function $d3863c46a17e8a28$var$arrayRemove
|
|
34145
|
+
function $d3863c46a17e8a28$var$arrayRemove(array, item) {
|
|
34129
34146
|
const updatedArray = [
|
|
34130
34147
|
...array
|
|
34131
34148
|
];
|
|
@@ -34133,7 +34150,7 @@ function $d3863c46a17e8a28$var$arrayRemove$1(array, item) {
|
|
|
34133
34150
|
if (index !== -1) updatedArray.splice(index, 1);
|
|
34134
34151
|
return updatedArray;
|
|
34135
34152
|
}
|
|
34136
|
-
function $d3863c46a17e8a28$var$removeLinks
|
|
34153
|
+
function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
34137
34154
|
return items.filter((item)=>item.tagName !== 'A'
|
|
34138
34155
|
);
|
|
34139
34156
|
}
|
|
@@ -35231,7 +35248,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ forwardRef((prop
|
|
|
35231
35248
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
|
|
35232
35249
|
// the last element in the DOM (beacuse of the `Portal`)
|
|
35233
35250
|
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
35234
|
-
return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement($d3863c46a17e8a28$export$20e40289641fbbb6
|
|
35251
|
+
return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
35235
35252
|
asChild: true,
|
|
35236
35253
|
loop: true,
|
|
35237
35254
|
trapped: trapFocus,
|
|
@@ -35369,7 +35386,7 @@ var usePagination = function (pageCount, selectedPage) {
|
|
|
35369
35386
|
*/
|
|
35370
35387
|
var Pagination = function (_a) {
|
|
35371
35388
|
var pageCount = _a.pageCount, onPageChange = _a.onPageChange, _b = _a.defaultSelectedPage, defaultSelectedPage = _b === void 0 ? 1 : _b, props = __rest(_a, ["pageCount", "onPageChange", "defaultSelectedPage"]);
|
|
35372
|
-
var surface = useContext(Context$
|
|
35389
|
+
var surface = useContext(Context$5).surface;
|
|
35373
35390
|
var _c = useState(defaultSelectedPage), selectedPage = _c[0], setSelectedPage = _c[1];
|
|
35374
35391
|
var pageRange = usePagination(pageCount, selectedPage);
|
|
35375
35392
|
var handlePagechange = function (pageToSelect) { return function () {
|
|
@@ -35402,7 +35419,7 @@ var Pagination = function (_a) {
|
|
|
35402
35419
|
*/
|
|
35403
35420
|
var PaginationSimple = function (_a) {
|
|
35404
35421
|
var hidePrev = _a.hidePrev, hideNext = _a.hideNext, onPrevPage = _a.onPrevPage, onNextPage = _a.onNextPage, isFluid = _a.isFluid, props = __rest(_a, ["hidePrev", "hideNext", "onPrevPage", "onNextPage", "isFluid"]);
|
|
35405
|
-
var surface = useContext(Context$
|
|
35422
|
+
var surface = useContext(Context$5).surface;
|
|
35406
35423
|
return (React__default.createElement("nav", __assign({ className: classNames("arc-PaginationSimple", {
|
|
35407
35424
|
"arc-PaginationSimple--onDarkSurface": surface === "dark",
|
|
35408
35425
|
"arc-PaginationSimple--fluid": isFluid,
|
|
@@ -35504,7 +35521,7 @@ var getProgressBarProps = function (isIndeterminate, progressValue, ariaLabel) {
|
|
|
35504
35521
|
|
|
35505
35522
|
var ProgressBar = function (_a) {
|
|
35506
35523
|
var _b = _a.state, state = _b === void 0 ? "loading" : _b, _c = _a.value, value = _c === void 0 ? 0 : _c, _d = _a.isIndeterminate, isIndeterminate = _d === void 0 ? false : _d, headline = _a.headline, ariaLabel = _a.ariaLabel, action = _a.action, title = _a.title, description = _a.description, displayValue = _a.displayValue, props = __rest(_a, ["state", "value", "isIndeterminate", "headline", "ariaLabel", "action", "title", "description", "displayValue"]);
|
|
35507
|
-
var surface = useContext(Context$
|
|
35524
|
+
var surface = useContext(Context$5).surface;
|
|
35508
35525
|
var progressValue = Math.min(100, Math.max(0, value));
|
|
35509
35526
|
return (React__default.createElement("div", __assign({ "data-testid": "progress", className: classNames("arc-ProgressBar", "arc-ProgressBar--".concat(state), {
|
|
35510
35527
|
"arc-ProgressBar--onDarkSurface": surface === "dark"
|
|
@@ -35583,18 +35600,10 @@ const BtIconCircle = (props) =>
|
|
|
35583
35600
|
}),
|
|
35584
35601
|
);
|
|
35585
35602
|
|
|
35586
|
-
/**
|
|
35587
|
-
* Provides text for screen readers that is visually hidden.
|
|
35588
|
-
*/
|
|
35589
|
-
var VisuallyHidden = function (_a) {
|
|
35590
|
-
var children = _a.children;
|
|
35591
|
-
return (React__default.createElement("span", { "data-testid": "visually-hidden", className: "arc-VisuallyHidden" }, children));
|
|
35592
|
-
};
|
|
35593
|
-
|
|
35594
35603
|
var ProgressStepperItem = function (_a) {
|
|
35595
35604
|
var _b, _c, _d;
|
|
35596
35605
|
var title = _a.title, titleHref = _a.titleHref, subTitle = _a.subTitle, _e = _a.direction, direction = _e === void 0 ? "horizontal" : _e, _f = _a.status, status = _f === void 0 ? "todo" : _f, _g = _a.size, size = _g === void 0 ? "large" : _g, _h = _a.position, position = _h === void 0 ? "middle" : _h, isFluid = _a.isFluid, ariaLabel = _a.ariaLabel, onClick = _a.onClick, previousStep = _a.previousStep, isExpandable = _a.isExpandable, stepContent = _a.stepContent, isStepContentHidden = _a.isStepContentHidden, props = __rest(_a, ["title", "titleHref", "subTitle", "direction", "status", "size", "position", "isFluid", "ariaLabel", "onClick", "previousStep", "isExpandable", "stepContent", "isStepContentHidden"]);
|
|
35597
|
-
var surface = useContext(Context$
|
|
35606
|
+
var surface = useContext(Context$5).surface;
|
|
35598
35607
|
var statusIcons = {
|
|
35599
35608
|
completed: BtIconTickVariant,
|
|
35600
35609
|
current: BtIconCircle,
|
|
@@ -35664,7 +35673,7 @@ var ProgressStepper = function (_a) {
|
|
|
35664
35673
|
ProgressStepper.Item = ProgressStepperItem;
|
|
35665
35674
|
|
|
35666
35675
|
var RadioContext = createContext({});
|
|
35667
|
-
var Provider$
|
|
35676
|
+
var Provider$4 = RadioContext.Provider;
|
|
35668
35677
|
var useRadioContext = function () {
|
|
35669
35678
|
var context = useContext(RadioContext);
|
|
35670
35679
|
return context;
|
|
@@ -35676,7 +35685,7 @@ var useRadioContext = function () {
|
|
|
35676
35685
|
var RadioButton = forwardRef(function (_a, ref) {
|
|
35677
35686
|
var helper = _a.helper, id = _a.id, isDisabled = _a.isDisabled, label = _a.label, value = _a.value, props = __rest(_a, ["helper", "id", "isDisabled", "label", "value"]);
|
|
35678
35687
|
var _b = useRadioContext(), blurEvent = _b.blurEvent, changeEvent = _b.changeEvent, groupDisabled = _b.groupDisabled, checkedValue = _b.checkedValue, labelSize = _b.labelSize, name = _b.name, size = _b.size;
|
|
35679
|
-
var surface = useContext(Context$
|
|
35688
|
+
var surface = useContext(Context$5).surface;
|
|
35680
35689
|
var idLabel = "".concat(id, "-label");
|
|
35681
35690
|
var checked = checkedValue === value ? true : false;
|
|
35682
35691
|
return (React__default.createElement("div", __assign({ className: classNames({
|
|
@@ -35705,7 +35714,7 @@ var RadioGroup = function (_a) {
|
|
|
35705
35714
|
}
|
|
35706
35715
|
});
|
|
35707
35716
|
}, [children]);
|
|
35708
|
-
return (React__default.createElement(Provider$
|
|
35717
|
+
return (React__default.createElement(Provider$4, { value: {
|
|
35709
35718
|
blurEvent: onBlur,
|
|
35710
35719
|
changeEvent: onChange,
|
|
35711
35720
|
groupDisabled: isDisabled,
|
|
@@ -35723,7 +35732,7 @@ RadioGroup.RadioButton = RadioButton;
|
|
|
35723
35732
|
* Use `Rule` to display a horizontal rule.
|
|
35724
35733
|
*/
|
|
35725
35734
|
var Rule = function (props) {
|
|
35726
|
-
var surface = useContext(Context$
|
|
35735
|
+
var surface = useContext(Context$5).surface;
|
|
35727
35736
|
return (React__default.createElement("hr", __assign({ className: classNames({
|
|
35728
35737
|
"arc-Rule": true,
|
|
35729
35738
|
"arc-Rule--onDarkSurface": surface === "dark"
|
|
@@ -35887,505 +35896,6 @@ const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ createContext(undef
|
|
|
35887
35896
|
return localDir || globalDir || 'ltr';
|
|
35888
35897
|
}
|
|
35889
35898
|
|
|
35890
|
-
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
35891
|
-
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
35892
|
-
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
35893
|
-
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
35894
|
-
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ createContext({
|
|
35895
|
-
layers: new Set(),
|
|
35896
|
-
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
35897
|
-
branches: new Set()
|
|
35898
|
-
});
|
|
35899
|
-
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
35900
|
-
var _node$ownerDocument;
|
|
35901
|
-
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
35902
|
-
const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
35903
|
-
const [node1, setNode] = useState(null);
|
|
35904
|
-
const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
|
|
35905
|
-
const [, force] = useState({});
|
|
35906
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setNode(node)
|
|
35907
|
-
);
|
|
35908
|
-
const layers = Array.from(context.layers);
|
|
35909
|
-
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
35910
|
-
...context.layersWithOutsidePointerEventsDisabled
|
|
35911
|
-
].slice(-1); // prettier-ignore
|
|
35912
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
|
|
35913
|
-
const index = node1 ? layers.indexOf(node1) : -1;
|
|
35914
|
-
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
35915
|
-
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
35916
|
-
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
35917
|
-
const target = event.target;
|
|
35918
|
-
const isPointerDownOnBranch = [
|
|
35919
|
-
...context.branches
|
|
35920
|
-
].some((branch)=>branch.contains(target)
|
|
35921
|
-
);
|
|
35922
|
-
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
35923
|
-
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
35924
|
-
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
35925
|
-
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
35926
|
-
}, ownerDocument);
|
|
35927
|
-
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
35928
|
-
const target = event.target;
|
|
35929
|
-
const isFocusInBranch = [
|
|
35930
|
-
...context.branches
|
|
35931
|
-
].some((branch)=>branch.contains(target)
|
|
35932
|
-
);
|
|
35933
|
-
if (isFocusInBranch) return;
|
|
35934
|
-
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
|
|
35935
|
-
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
35936
|
-
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
35937
|
-
}, ownerDocument);
|
|
35938
|
-
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
35939
|
-
const isHighestLayer = index === context.layers.size - 1;
|
|
35940
|
-
if (!isHighestLayer) return;
|
|
35941
|
-
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
35942
|
-
if (!event.defaultPrevented && onDismiss) {
|
|
35943
|
-
event.preventDefault();
|
|
35944
|
-
onDismiss();
|
|
35945
|
-
}
|
|
35946
|
-
}, ownerDocument);
|
|
35947
|
-
useEffect(()=>{
|
|
35948
|
-
if (!node1) return;
|
|
35949
|
-
if (disableOutsidePointerEvents) {
|
|
35950
|
-
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
35951
|
-
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
35952
|
-
ownerDocument.body.style.pointerEvents = 'none';
|
|
35953
|
-
}
|
|
35954
|
-
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
35955
|
-
}
|
|
35956
|
-
context.layers.add(node1);
|
|
35957
|
-
$5cb92bef7577960e$var$dispatchUpdate();
|
|
35958
|
-
return ()=>{
|
|
35959
|
-
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
35960
|
-
};
|
|
35961
|
-
}, [
|
|
35962
|
-
node1,
|
|
35963
|
-
ownerDocument,
|
|
35964
|
-
disableOutsidePointerEvents,
|
|
35965
|
-
context
|
|
35966
|
-
]);
|
|
35967
|
-
/**
|
|
35968
|
-
* We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
|
|
35969
|
-
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
|
35970
|
-
* and add it to the end again so the layering order wouldn't be _creation order_.
|
|
35971
|
-
* We only want them to be removed from context stacks when unmounted.
|
|
35972
|
-
*/ useEffect(()=>{
|
|
35973
|
-
return ()=>{
|
|
35974
|
-
if (!node1) return;
|
|
35975
|
-
context.layers.delete(node1);
|
|
35976
|
-
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
35977
|
-
$5cb92bef7577960e$var$dispatchUpdate();
|
|
35978
|
-
};
|
|
35979
|
-
}, [
|
|
35980
|
-
node1,
|
|
35981
|
-
context
|
|
35982
|
-
]);
|
|
35983
|
-
useEffect(()=>{
|
|
35984
|
-
const handleUpdate = ()=>force({})
|
|
35985
|
-
;
|
|
35986
|
-
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
35987
|
-
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
35988
|
-
;
|
|
35989
|
-
}, []);
|
|
35990
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, layerProps, {
|
|
35991
|
-
ref: composedRefs,
|
|
35992
|
-
style: {
|
|
35993
|
-
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
35994
|
-
...props.style
|
|
35995
|
-
},
|
|
35996
|
-
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
35997
|
-
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
35998
|
-
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
35999
|
-
}));
|
|
36000
|
-
});
|
|
36001
|
-
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
36002
|
-
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
36003
|
-
* to mimic layer dismissing behaviour present in OS.
|
|
36004
|
-
* Returns props to pass to the node we want to check for outside events.
|
|
36005
|
-
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
36006
|
-
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onPointerDownOutside);
|
|
36007
|
-
const isPointerInsideReactTreeRef = useRef(false);
|
|
36008
|
-
const handleClickRef = useRef(()=>{});
|
|
36009
|
-
useEffect(()=>{
|
|
36010
|
-
const handlePointerDown = (event)=>{
|
|
36011
|
-
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
36012
|
-
const eventDetail = {
|
|
36013
|
-
originalEvent: event
|
|
36014
|
-
};
|
|
36015
|
-
function handleAndDispatchPointerDownOutsideEvent() {
|
|
36016
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
36017
|
-
discrete: true
|
|
36018
|
-
});
|
|
36019
|
-
}
|
|
36020
|
-
/**
|
|
36021
|
-
* On touch devices, we need to wait for a click event because browsers implement
|
|
36022
|
-
* a ~350ms delay between the time the user stops touching the display and when the
|
|
36023
|
-
* browser executres events. We need to ensure we don't reactivate pointer-events within
|
|
36024
|
-
* this timeframe otherwise the browser may execute events that should have been prevented.
|
|
36025
|
-
*
|
|
36026
|
-
* Additionally, this also lets us deal automatically with cancellations when a click event
|
|
36027
|
-
* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
|
|
36028
|
-
*
|
|
36029
|
-
* This is why we also continuously remove the previous listener, because we cannot be
|
|
36030
|
-
* certain that it was raised, and therefore cleaned-up.
|
|
36031
|
-
*/ if (event.pointerType === 'touch') {
|
|
36032
|
-
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
36033
|
-
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
36034
|
-
ownerDocument.addEventListener('click', handleClickRef.current, {
|
|
36035
|
-
once: true
|
|
36036
|
-
});
|
|
36037
|
-
} else handleAndDispatchPointerDownOutsideEvent();
|
|
36038
|
-
} else // We need to remove the event listener in case the outside click has been canceled.
|
|
36039
|
-
// See: https://github.com/radix-ui/primitives/issues/2171
|
|
36040
|
-
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
36041
|
-
isPointerInsideReactTreeRef.current = false;
|
|
36042
|
-
};
|
|
36043
|
-
/**
|
|
36044
|
-
* if this hook executes in a component that mounts via a `pointerdown` event, the event
|
|
36045
|
-
* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
|
|
36046
|
-
* this by delaying the event listener registration on the document.
|
|
36047
|
-
* This is not React specific, but rather how the DOM works, ie:
|
|
36048
|
-
* ```
|
|
36049
|
-
* button.addEventListener('pointerdown', () => {
|
|
36050
|
-
* console.log('I will log');
|
|
36051
|
-
* document.addEventListener('pointerdown', () => {
|
|
36052
|
-
* console.log('I will also log');
|
|
36053
|
-
* })
|
|
36054
|
-
* });
|
|
36055
|
-
*/ const timerId = window.setTimeout(()=>{
|
|
36056
|
-
ownerDocument.addEventListener('pointerdown', handlePointerDown);
|
|
36057
|
-
}, 0);
|
|
36058
|
-
return ()=>{
|
|
36059
|
-
window.clearTimeout(timerId);
|
|
36060
|
-
ownerDocument.removeEventListener('pointerdown', handlePointerDown);
|
|
36061
|
-
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
36062
|
-
};
|
|
36063
|
-
}, [
|
|
36064
|
-
ownerDocument,
|
|
36065
|
-
handlePointerDownOutside
|
|
36066
|
-
]);
|
|
36067
|
-
return {
|
|
36068
|
-
// ensures we check React component tree (not just DOM tree)
|
|
36069
|
-
onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
|
|
36070
|
-
};
|
|
36071
|
-
}
|
|
36072
|
-
/**
|
|
36073
|
-
* Listens for when focus happens outside a react subtree.
|
|
36074
|
-
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
36075
|
-
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
36076
|
-
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onFocusOutside);
|
|
36077
|
-
const isFocusInsideReactTreeRef = useRef(false);
|
|
36078
|
-
useEffect(()=>{
|
|
36079
|
-
const handleFocus = (event)=>{
|
|
36080
|
-
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
36081
|
-
const eventDetail = {
|
|
36082
|
-
originalEvent: event
|
|
36083
|
-
};
|
|
36084
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
36085
|
-
discrete: false
|
|
36086
|
-
});
|
|
36087
|
-
}
|
|
36088
|
-
};
|
|
36089
|
-
ownerDocument.addEventListener('focusin', handleFocus);
|
|
36090
|
-
return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
|
|
36091
|
-
;
|
|
36092
|
-
}, [
|
|
36093
|
-
ownerDocument,
|
|
36094
|
-
handleFocusOutside
|
|
36095
|
-
]);
|
|
36096
|
-
return {
|
|
36097
|
-
onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
|
|
36098
|
-
,
|
|
36099
|
-
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
36100
|
-
};
|
|
36101
|
-
}
|
|
36102
|
-
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
36103
|
-
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
36104
|
-
document.dispatchEvent(event);
|
|
36105
|
-
}
|
|
36106
|
-
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
36107
|
-
const target = detail.originalEvent.target;
|
|
36108
|
-
const event = new CustomEvent(name, {
|
|
36109
|
-
bubbles: false,
|
|
36110
|
-
cancelable: true,
|
|
36111
|
-
detail: detail
|
|
36112
|
-
});
|
|
36113
|
-
if (handler) target.addEventListener(name, handler, {
|
|
36114
|
-
once: true
|
|
36115
|
-
});
|
|
36116
|
-
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
36117
|
-
else target.dispatchEvent(event);
|
|
36118
|
-
}
|
|
36119
|
-
|
|
36120
|
-
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
|
|
36121
|
-
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
|
|
36122
|
-
const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
36123
|
-
bubbles: false,
|
|
36124
|
-
cancelable: true
|
|
36125
|
-
};
|
|
36126
|
-
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
36127
|
-
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
36128
|
-
const [container1, setContainer] = useState(null);
|
|
36129
|
-
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onMountAutoFocusProp);
|
|
36130
|
-
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onUnmountAutoFocusProp);
|
|
36131
|
-
const lastFocusedElementRef = useRef(null);
|
|
36132
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContainer(node)
|
|
36133
|
-
);
|
|
36134
|
-
const focusScope = useRef({
|
|
36135
|
-
paused: false,
|
|
36136
|
-
pause () {
|
|
36137
|
-
this.paused = true;
|
|
36138
|
-
},
|
|
36139
|
-
resume () {
|
|
36140
|
-
this.paused = false;
|
|
36141
|
-
}
|
|
36142
|
-
}).current; // Takes care of trapping focus if focus is moved outside programmatically for example
|
|
36143
|
-
useEffect(()=>{
|
|
36144
|
-
if (trapped) {
|
|
36145
|
-
function handleFocusIn(event) {
|
|
36146
|
-
if (focusScope.paused || !container1) return;
|
|
36147
|
-
const target = event.target;
|
|
36148
|
-
if (container1.contains(target)) lastFocusedElementRef.current = target;
|
|
36149
|
-
else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
36150
|
-
select: true
|
|
36151
|
-
});
|
|
36152
|
-
}
|
|
36153
|
-
function handleFocusOut(event) {
|
|
36154
|
-
if (focusScope.paused || !container1) return;
|
|
36155
|
-
const relatedTarget = event.relatedTarget; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:
|
|
36156
|
-
//
|
|
36157
|
-
// 1. When the user switches app/tabs/windows/the browser itself loses focus.
|
|
36158
|
-
// 2. In Google Chrome, when the focused element is removed from the DOM.
|
|
36159
|
-
//
|
|
36160
|
-
// We let the browser do its thing here because:
|
|
36161
|
-
//
|
|
36162
|
-
// 1. The browser already keeps a memory of what's focused for when the page gets refocused.
|
|
36163
|
-
// 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it
|
|
36164
|
-
// throws the CPU to 100%, so we avoid doing anything for this reason here too.
|
|
36165
|
-
if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)
|
|
36166
|
-
// that is outside the container, we move focus to the last valid focused element inside.
|
|
36167
|
-
if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
36168
|
-
select: true
|
|
36169
|
-
});
|
|
36170
|
-
} // When the focused element gets removed from the DOM, browsers move focus
|
|
36171
|
-
// back to the document.body. In this case, we move focus to the container
|
|
36172
|
-
// to keep focus trapped correctly.
|
|
36173
|
-
function handleMutations(mutations) {
|
|
36174
|
-
const focusedElement = document.activeElement;
|
|
36175
|
-
if (focusedElement !== document.body) return;
|
|
36176
|
-
for (const mutation of mutations)if (mutation.removedNodes.length > 0) $d3863c46a17e8a28$var$focus(container1);
|
|
36177
|
-
}
|
|
36178
|
-
document.addEventListener('focusin', handleFocusIn);
|
|
36179
|
-
document.addEventListener('focusout', handleFocusOut);
|
|
36180
|
-
const mutationObserver = new MutationObserver(handleMutations);
|
|
36181
|
-
if (container1) mutationObserver.observe(container1, {
|
|
36182
|
-
childList: true,
|
|
36183
|
-
subtree: true
|
|
36184
|
-
});
|
|
36185
|
-
return ()=>{
|
|
36186
|
-
document.removeEventListener('focusin', handleFocusIn);
|
|
36187
|
-
document.removeEventListener('focusout', handleFocusOut);
|
|
36188
|
-
mutationObserver.disconnect();
|
|
36189
|
-
};
|
|
36190
|
-
}
|
|
36191
|
-
}, [
|
|
36192
|
-
trapped,
|
|
36193
|
-
container1,
|
|
36194
|
-
focusScope.paused
|
|
36195
|
-
]);
|
|
36196
|
-
useEffect(()=>{
|
|
36197
|
-
if (container1) {
|
|
36198
|
-
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
|
|
36199
|
-
const previouslyFocusedElement = document.activeElement;
|
|
36200
|
-
const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
|
|
36201
|
-
if (!hasFocusedCandidate) {
|
|
36202
|
-
const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
36203
|
-
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
36204
|
-
container1.dispatchEvent(mountEvent);
|
|
36205
|
-
if (!mountEvent.defaultPrevented) {
|
|
36206
|
-
$d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
|
|
36207
|
-
select: true
|
|
36208
|
-
});
|
|
36209
|
-
if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
|
|
36210
|
-
}
|
|
36211
|
-
}
|
|
36212
|
-
return ()=>{
|
|
36213
|
-
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
|
|
36214
|
-
// We need to delay the focus a little to get around it for now.
|
|
36215
|
-
// See: https://github.com/facebook/react/issues/17894
|
|
36216
|
-
setTimeout(()=>{
|
|
36217
|
-
const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
36218
|
-
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
36219
|
-
container1.dispatchEvent(unmountEvent);
|
|
36220
|
-
if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
|
|
36221
|
-
select: true
|
|
36222
|
-
});
|
|
36223
|
-
// we need to remove the listener after we `dispatchEvent`
|
|
36224
|
-
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
36225
|
-
$d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
|
|
36226
|
-
}, 0);
|
|
36227
|
-
};
|
|
36228
|
-
}
|
|
36229
|
-
}, [
|
|
36230
|
-
container1,
|
|
36231
|
-
onMountAutoFocus,
|
|
36232
|
-
onUnmountAutoFocus,
|
|
36233
|
-
focusScope
|
|
36234
|
-
]); // Takes care of looping focus (when tabbing whilst at the edges)
|
|
36235
|
-
const handleKeyDown = useCallback((event)=>{
|
|
36236
|
-
if (!loop && !trapped) return;
|
|
36237
|
-
if (focusScope.paused) return;
|
|
36238
|
-
const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
36239
|
-
const focusedElement = document.activeElement;
|
|
36240
|
-
if (isTabKey && focusedElement) {
|
|
36241
|
-
const container = event.currentTarget;
|
|
36242
|
-
const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container);
|
|
36243
|
-
const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges
|
|
36244
|
-
if (!hasTabbableElementsInside) {
|
|
36245
|
-
if (focusedElement === container) event.preventDefault();
|
|
36246
|
-
} else {
|
|
36247
|
-
if (!event.shiftKey && focusedElement === last) {
|
|
36248
|
-
event.preventDefault();
|
|
36249
|
-
if (loop) $d3863c46a17e8a28$var$focus(first, {
|
|
36250
|
-
select: true
|
|
36251
|
-
});
|
|
36252
|
-
} else if (event.shiftKey && focusedElement === first) {
|
|
36253
|
-
event.preventDefault();
|
|
36254
|
-
if (loop) $d3863c46a17e8a28$var$focus(last, {
|
|
36255
|
-
select: true
|
|
36256
|
-
});
|
|
36257
|
-
}
|
|
36258
|
-
}
|
|
36259
|
-
}
|
|
36260
|
-
}, [
|
|
36261
|
-
loop,
|
|
36262
|
-
trapped,
|
|
36263
|
-
focusScope.paused
|
|
36264
|
-
]);
|
|
36265
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
36266
|
-
tabIndex: -1
|
|
36267
|
-
}, scopeProps, {
|
|
36268
|
-
ref: composedRefs,
|
|
36269
|
-
onKeyDown: handleKeyDown
|
|
36270
|
-
}));
|
|
36271
|
-
});
|
|
36272
|
-
/* -------------------------------------------------------------------------------------------------
|
|
36273
|
-
* Utils
|
|
36274
|
-
* -----------------------------------------------------------------------------------------------*/ /**
|
|
36275
|
-
* Attempts focusing the first element in a list of candidates.
|
|
36276
|
-
* Stops when focus has actually moved.
|
|
36277
|
-
*/ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) {
|
|
36278
|
-
const previouslyFocusedElement = document.activeElement;
|
|
36279
|
-
for (const candidate of candidates){
|
|
36280
|
-
$d3863c46a17e8a28$var$focus(candidate, {
|
|
36281
|
-
select: select
|
|
36282
|
-
});
|
|
36283
|
-
if (document.activeElement !== previouslyFocusedElement) return;
|
|
36284
|
-
}
|
|
36285
|
-
}
|
|
36286
|
-
/**
|
|
36287
|
-
* Returns the first and last tabbable elements inside a container.
|
|
36288
|
-
*/ function $d3863c46a17e8a28$var$getTabbableEdges(container) {
|
|
36289
|
-
const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container);
|
|
36290
|
-
const first = $d3863c46a17e8a28$var$findVisible(candidates, container);
|
|
36291
|
-
const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container);
|
|
36292
|
-
return [
|
|
36293
|
-
first,
|
|
36294
|
-
last
|
|
36295
|
-
];
|
|
36296
|
-
}
|
|
36297
|
-
/**
|
|
36298
|
-
* Returns a list of potential tabbable candidates.
|
|
36299
|
-
*
|
|
36300
|
-
* NOTE: This is only a close approximation. For example it doesn't take into account cases like when
|
|
36301
|
-
* elements are not visible. This cannot be worked out easily by just reading a property, but rather
|
|
36302
|
-
* necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.
|
|
36303
|
-
*
|
|
36304
|
-
* See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
|
|
36305
|
-
* Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
|
|
36306
|
-
*/ function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
|
|
36307
|
-
const nodes = [];
|
|
36308
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
36309
|
-
acceptNode: (node)=>{
|
|
36310
|
-
const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';
|
|
36311
|
-
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
|
|
36312
|
-
// runtime's understanding of tabbability, so this automatically accounts
|
|
36313
|
-
// for any kind of element that could be tabbed to.
|
|
36314
|
-
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
36315
|
-
}
|
|
36316
|
-
});
|
|
36317
|
-
while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it
|
|
36318
|
-
// hinders accessibility to have tab order different from visual order.
|
|
36319
|
-
return nodes;
|
|
36320
|
-
}
|
|
36321
|
-
/**
|
|
36322
|
-
* Returns the first visible element in a list.
|
|
36323
|
-
* NOTE: Only checks visibility up to the `container`.
|
|
36324
|
-
*/ function $d3863c46a17e8a28$var$findVisible(elements, container) {
|
|
36325
|
-
for (const element of elements){
|
|
36326
|
-
// we stop checking if it's hidden at the `container` level (excluding)
|
|
36327
|
-
if (!$d3863c46a17e8a28$var$isHidden(element, {
|
|
36328
|
-
upTo: container
|
|
36329
|
-
})) return element;
|
|
36330
|
-
}
|
|
36331
|
-
}
|
|
36332
|
-
function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) {
|
|
36333
|
-
if (getComputedStyle(node).visibility === 'hidden') return true;
|
|
36334
|
-
while(node){
|
|
36335
|
-
// we stop at `upTo` (excluding it)
|
|
36336
|
-
if (upTo !== undefined && node === upTo) return false;
|
|
36337
|
-
if (getComputedStyle(node).display === 'none') return true;
|
|
36338
|
-
node = node.parentElement;
|
|
36339
|
-
}
|
|
36340
|
-
return false;
|
|
36341
|
-
}
|
|
36342
|
-
function $d3863c46a17e8a28$var$isSelectableInput(element) {
|
|
36343
|
-
return element instanceof HTMLInputElement && 'select' in element;
|
|
36344
|
-
}
|
|
36345
|
-
function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) {
|
|
36346
|
-
// only focus if that element is focusable
|
|
36347
|
-
if (element && element.focus) {
|
|
36348
|
-
const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users
|
|
36349
|
-
element.focus({
|
|
36350
|
-
preventScroll: true
|
|
36351
|
-
}); // only select if its not the same element, it supports selection and we need to select
|
|
36352
|
-
if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select();
|
|
36353
|
-
}
|
|
36354
|
-
}
|
|
36355
|
-
/* -------------------------------------------------------------------------------------------------
|
|
36356
|
-
* FocusScope stack
|
|
36357
|
-
* -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
|
|
36358
|
-
function $d3863c46a17e8a28$var$createFocusScopesStack() {
|
|
36359
|
-
/** A stack of focus scopes, with the active one at the top */ let stack = [];
|
|
36360
|
-
return {
|
|
36361
|
-
add (focusScope) {
|
|
36362
|
-
// pause the currently active focus scope (at the top of the stack)
|
|
36363
|
-
const activeFocusScope = stack[0];
|
|
36364
|
-
if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
|
|
36365
|
-
// remove in case it already exists (because we'll re-add it at the top of the stack)
|
|
36366
|
-
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
36367
|
-
stack.unshift(focusScope);
|
|
36368
|
-
},
|
|
36369
|
-
remove (focusScope) {
|
|
36370
|
-
var _stack$;
|
|
36371
|
-
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
36372
|
-
(_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
|
|
36373
|
-
}
|
|
36374
|
-
};
|
|
36375
|
-
}
|
|
36376
|
-
function $d3863c46a17e8a28$var$arrayRemove(array, item) {
|
|
36377
|
-
const updatedArray = [
|
|
36378
|
-
...array
|
|
36379
|
-
];
|
|
36380
|
-
const index = updatedArray.indexOf(item);
|
|
36381
|
-
if (index !== -1) updatedArray.splice(index, 1);
|
|
36382
|
-
return updatedArray;
|
|
36383
|
-
}
|
|
36384
|
-
function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
36385
|
-
return items.filter((item)=>item.tagName !== 'A'
|
|
36386
|
-
);
|
|
36387
|
-
}
|
|
36388
|
-
|
|
36389
35899
|
const sides = ['top', 'right', 'bottom', 'left'];
|
|
36390
35900
|
const min = Math.min;
|
|
36391
35901
|
const max = Math.max;
|
|
@@ -38534,14 +38044,6 @@ const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac
|
|
|
38534
38044
|
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
38535
38045
|
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
38536
38046
|
|
|
38537
|
-
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
38538
|
-
var _globalThis$document;
|
|
38539
|
-
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
|
|
38540
|
-
return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, portalProps, {
|
|
38541
|
-
ref: forwardedRef
|
|
38542
|
-
})), container) : null;
|
|
38543
|
-
});
|
|
38544
|
-
|
|
38545
38047
|
function $010c2913dbd2fe3d$export$5cae361ad82dce8b$1(value) {
|
|
38546
38048
|
const ref = useRef({
|
|
38547
38049
|
value: value,
|
|
@@ -38785,7 +38287,7 @@ const $cc7e05a45900e73f$export$99b400cabb58c515 = /*#__PURE__*/ forwardRef((prop
|
|
|
38785
38287
|
}), children || '▼');
|
|
38786
38288
|
});
|
|
38787
38289
|
const $cc7e05a45900e73f$export$b2af6c9944296213 = (props)=>{
|
|
38788
|
-
return /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c, _extends({
|
|
38290
|
+
return /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c$1, _extends({
|
|
38789
38291
|
asChild: true
|
|
38790
38292
|
}, props));
|
|
38791
38293
|
};
|
|
@@ -39004,7 +38506,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props,
|
|
|
39004
38506
|
});
|
|
39005
38507
|
event.preventDefault();
|
|
39006
38508
|
})
|
|
39007
|
-
}, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
38509
|
+
}, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22$1, {
|
|
39008
38510
|
asChild: true,
|
|
39009
38511
|
disableOutsidePointerEvents: true,
|
|
39010
38512
|
onEscapeKeyDown: onEscapeKeyDown,
|
|
@@ -39694,10 +39196,10 @@ const BtIconChevronUp2Px = (props) =>
|
|
|
39694
39196
|
/** Use `Select` to choose from a dropdown list of options. */
|
|
39695
39197
|
var Select = function (_a) {
|
|
39696
39198
|
var _b;
|
|
39697
|
-
var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, _c = _a.ariaLabel, ariaLabel = _c === void 0 ? label : _c, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, name = _a.name, width = _a.width, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, _d = _a.selectSize, selectSize = _d === void 0 ? "m" : _d, props = __rest(_a, ["isRequired", "isDisabled", "placeholder", "label", "ariaLabel", "options", "onOpenChange", "isDefaultOpen", "defaultValue", "errorMessage", "labelSize", "helper", "name", "width", "isFluid", "onBlur", "onChange", "disclosureTitle", "disclosureText", "onClickDisclosure", "selectSize"]);
|
|
39199
|
+
var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, _c = _a.ariaLabel, ariaLabel = _c === void 0 ? label : _c, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, hideLabel = _a.hideLabel, name = _a.name, width = _a.width, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, _d = _a.selectSize, selectSize = _d === void 0 ? "m" : _d, props = __rest(_a, ["isRequired", "isDisabled", "placeholder", "label", "ariaLabel", "options", "onOpenChange", "isDefaultOpen", "defaultValue", "errorMessage", "labelSize", "helper", "hideLabel", "name", "width", "isFluid", "onBlur", "onChange", "disclosureTitle", "disclosureText", "onClickDisclosure", "selectSize"]);
|
|
39698
39200
|
var id = useId();
|
|
39699
39201
|
var arcRootElement = useContext(ArcRootElementContext);
|
|
39700
|
-
var surface = useContext(Context$
|
|
39202
|
+
var surface = useContext(Context$5).surface;
|
|
39701
39203
|
var _e = useState(defaultValue), selectedValue = _e[0], setSelectedValue = _e[1];
|
|
39702
39204
|
var onValueChange = function (value) {
|
|
39703
39205
|
onChange && onChange(value);
|
|
@@ -39717,7 +39219,7 @@ var Select = function (_a) {
|
|
|
39717
39219
|
return 20;
|
|
39718
39220
|
}
|
|
39719
39221
|
};
|
|
39720
|
-
return (React__default.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", isDisabled: isDisabled, disclosureText: disclosureText, disclosureTitle: disclosureTitle, onClickDisclosure: onClickDisclosure },
|
|
39222
|
+
return (React__default.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, label: label, hideLabel: hideLabel, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", isDisabled: isDisabled, disclosureText: disclosureText, disclosureTitle: disclosureTitle, onClickDisclosure: onClickDisclosure },
|
|
39721
39223
|
React__default.createElement($cc7e05a45900e73f$export$be92b6f5f03c0fe9, { name: name, required: isRequired, disabled: isDisabled, defaultOpen: isDefaultOpen, value: selectedValue, onOpenChange: onOpenChange, onValueChange: function (value) { return onValueChange(value); } },
|
|
39722
39224
|
React__default.createElement("div", { className: "arc-Select-wrapper" },
|
|
39723
39225
|
React__default.createElement($cc7e05a45900e73f$export$41fb9f06171c75f4, __assign({ id: id, name: name, onBlur: onBlur, "aria-label": ariaLabel, style: { width: width }, className: classNames("arc-Select-trigger", (_b = {
|
|
@@ -39824,7 +39326,7 @@ var SiteFooter_rehydrator = (function (el, rehydrateChildren) { return __awaiter
|
|
|
39824
39326
|
});
|
|
39825
39327
|
}); });
|
|
39826
39328
|
|
|
39827
|
-
var Item = function (_a) {
|
|
39329
|
+
var Item$1 = function (_a) {
|
|
39828
39330
|
var _b;
|
|
39829
39331
|
var children = _a.children, href = _a.href, isEmphasised = _a.isEmphasised, onClick = _a.onClick, props = __rest(_a, ["children", "href", "isEmphasised", "onClick"]);
|
|
39830
39332
|
return (React__default.createElement("li", __assign({ className: classNames((_b = {},
|
|
@@ -39837,13 +39339,13 @@ var Item = function (_a) {
|
|
|
39837
39339
|
children)));
|
|
39838
39340
|
};
|
|
39839
39341
|
|
|
39840
|
-
var ItemGroup = function (_a) {
|
|
39342
|
+
var ItemGroup$1 = function (_a) {
|
|
39841
39343
|
var children = _a.children, href = _a.href, title = _a.title, onClick = _a.onClick, viewAllTitle = _a.viewAllTitle, props = __rest(_a, ["children", "href", "title", "onClick", "viewAllTitle"]);
|
|
39842
39344
|
var _b = useState(false), hasClientSideJavaScript = _b[0], setHasClientSideJavaScript = _b[1];
|
|
39843
39345
|
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
39844
39346
|
useEffect(function () {
|
|
39845
39347
|
React__default.Children.map(children, function (item) {
|
|
39846
|
-
if (item && item.type !== Item && item.type !== Fragment) {
|
|
39348
|
+
if (item && item.type !== Item$1 && item.type !== Fragment) {
|
|
39847
39349
|
throw new Error("Illegal child passed to <SiteHeader.ItemGroup />. Ensure to only use <SiteHeader.Item />.");
|
|
39848
39350
|
}
|
|
39849
39351
|
});
|
|
@@ -39897,16 +39399,16 @@ var ItemGroupRehydrator = (function (el, hydrate) { return __awaiter(void 0, voi
|
|
|
39897
39399
|
title: title,
|
|
39898
39400
|
viewAllTitle: viewAllTitle
|
|
39899
39401
|
};
|
|
39900
|
-
return [2 /*return*/, React__default.createElement(ItemGroup, __assign({}, props), children)];
|
|
39402
|
+
return [2 /*return*/, React__default.createElement(ItemGroup$1, __assign({}, props), children)];
|
|
39901
39403
|
}
|
|
39902
39404
|
});
|
|
39903
39405
|
}); });
|
|
39904
39406
|
|
|
39905
|
-
var Column = function (_a) {
|
|
39407
|
+
var Column$1 = function (_a) {
|
|
39906
39408
|
var children = _a.children, props = __rest(_a, ["children"]);
|
|
39907
39409
|
useEffect(function () {
|
|
39908
39410
|
React__default.Children.map(children, function (item) {
|
|
39909
|
-
if (item && item.type !== ItemGroup) {
|
|
39411
|
+
if (item && item.type !== ItemGroup$1) {
|
|
39910
39412
|
throw new Error("Illegal child passed to <SiteHeader.Column />. Ensure to only use <SiteHeader.ItemGroup />.");
|
|
39911
39413
|
}
|
|
39912
39414
|
});
|
|
@@ -39915,7 +39417,7 @@ var Column = function (_a) {
|
|
|
39915
39417
|
React__default.createElement("ul", { className: "arc-SiteHeaderColumn-items" }, children)));
|
|
39916
39418
|
};
|
|
39917
39419
|
|
|
39918
|
-
var BackButton = function (_a) {
|
|
39420
|
+
var BackButton$1 = function (_a) {
|
|
39919
39421
|
var setOpen = _a.setOpen;
|
|
39920
39422
|
return (React__default.createElement("button", { className: "arc-SiteHeaderBackButton", onClick: function () {
|
|
39921
39423
|
setOpen(false);
|
|
@@ -39925,10 +39427,10 @@ var BackButton = function (_a) {
|
|
|
39925
39427
|
React__default.createElement("span", { className: "arc-SiteHeaderBackButton-text" }, "Back")));
|
|
39926
39428
|
};
|
|
39927
39429
|
|
|
39928
|
-
var Panel = function (_a) {
|
|
39430
|
+
var Panel$1 = function (_a) {
|
|
39929
39431
|
var _b;
|
|
39930
39432
|
var children = _a.children, navItemRef = _a.navItemRef, open = _a.open, promo = _a.promo, setOpen = _a.setOpen, subNavItemRef = _a.subNavItemRef, _c = _a.subNavLink, subNavLink = _c === void 0 ? "" : _c, title = _a.title, viewAll = _a.viewAll, withSubNav = _a.withSubNav, props = __rest(_a, ["children", "navItemRef", "open", "promo", "setOpen", "subNavItemRef", "subNavLink", "title", "viewAll", "withSubNav"]);
|
|
39931
|
-
var transparent = useContext(Context).transparent;
|
|
39433
|
+
var transparent = useContext(Context$2).transparent;
|
|
39932
39434
|
useEffect(function () {
|
|
39933
39435
|
// Where appropriate, close the Panel when clicking outside of it,
|
|
39934
39436
|
// by listening to clicks on the entire document and acting accordingly.
|
|
@@ -39990,7 +39492,7 @@ var Panel = function (_a) {
|
|
|
39990
39492
|
_b["arc-SiteHeaderPanel--withSubNav"] = withSubNav,
|
|
39991
39493
|
_b)) }, filterDataAttrs(props)),
|
|
39992
39494
|
React__default.createElement(Surface, { background: "white", growVertically: true },
|
|
39993
|
-
React__default.createElement(BackButton, { setOpen: setOpen }),
|
|
39495
|
+
React__default.createElement(BackButton$1, { setOpen: setOpen }),
|
|
39994
39496
|
React__default.createElement("div", { className: "arc-SiteHeaderPanel-inner" },
|
|
39995
39497
|
React__default.createElement("div", { className: "arc-SiteHeaderPanel-main" },
|
|
39996
39498
|
React__default.createElement("div", { className: "arc-SiteHeaderPanel-mainInner" },
|
|
@@ -40000,16 +39502,16 @@ var Panel = function (_a) {
|
|
|
40000
39502
|
viewAll),
|
|
40001
39503
|
promo && React__default.createElement("div", { className: "arc-SiteHeaderPanel-promo" }, promo)))));
|
|
40002
39504
|
};
|
|
40003
|
-
var ViewAll = function (_a) {
|
|
39505
|
+
var ViewAll$1 = function (_a) {
|
|
40004
39506
|
var href = _a.href, title = _a.title, onClick = _a.onClick;
|
|
40005
39507
|
return (React__default.createElement("a", { onClick: handleLinkClick({ handler: onClick }), className: "arc-SiteHeaderPanel-viewAll", href: href },
|
|
40006
39508
|
title,
|
|
40007
39509
|
React__default.createElement("span", { className: "arc-SiteHeaderPanel-viewAllIcon" },
|
|
40008
39510
|
React__default.createElement(BtIconChevronRight2Px, null))));
|
|
40009
39511
|
};
|
|
40010
|
-
Panel.ViewAll = ViewAll;
|
|
39512
|
+
Panel$1.ViewAll = ViewAll$1;
|
|
40011
39513
|
|
|
40012
|
-
var NavItem = function (_a) {
|
|
39514
|
+
var NavItem$1 = function (_a) {
|
|
40013
39515
|
var _b, _c;
|
|
40014
39516
|
var children = _a.children, href = _a.href, isCurrent = _a.isCurrent, onClick = _a.onClick, promo = _a.promo, title = _a.title, viewAllTitle = _a.viewAllTitle, props = __rest(_a, ["children", "href", "isCurrent", "onClick", "promo", "title", "viewAllTitle"]);
|
|
40015
39517
|
var navItem = useRef();
|
|
@@ -40018,8 +39520,8 @@ var NavItem = function (_a) {
|
|
|
40018
39520
|
useEffect(function () {
|
|
40019
39521
|
React__default.Children.map(children, function (item) {
|
|
40020
39522
|
if (item &&
|
|
40021
|
-
item.type !== ItemGroup &&
|
|
40022
|
-
item.type !== Column &&
|
|
39523
|
+
item.type !== ItemGroup$1 &&
|
|
39524
|
+
item.type !== Column$1 &&
|
|
40023
39525
|
item.type !== Fragment) {
|
|
40024
39526
|
throw new Error("Illegal child passed to <SiteHeader.NavItem />. Ensure to only use <SiteHeader.ItemGroup /> or <SiteHeader.Column />.");
|
|
40025
39527
|
}
|
|
@@ -40040,7 +39542,7 @@ var NavItem = function (_a) {
|
|
|
40040
39542
|
} },
|
|
40041
39543
|
React__default.createElement("span", null, title),
|
|
40042
39544
|
React__default.createElement("span", { className: "arc-SiteHeaderNavItem-linkIcon" }, isMinWidthArcBreakpointL ? (React__default.createElement(BtIconChevronDown2Px, null)) : (React__default.createElement(BtIconChevronRight2Px, null)))),
|
|
40043
|
-
React__default.createElement(Panel, { navItemRef: navItem, open: panelOpen, promo: promo, setOpen: setPanelOpen, viewAll: href ? (React__default.createElement(Panel.ViewAll, { href: href, onClick: onClick, title: viewAllTitle || "View all ".concat(title.toLowerCase()) })) : undefined }, children)))));
|
|
39545
|
+
React__default.createElement(Panel$1, { navItemRef: navItem, open: panelOpen, promo: promo, setOpen: setPanelOpen, viewAll: href ? (React__default.createElement(Panel$1.ViewAll, { href: href, onClick: onClick, title: viewAllTitle || "View all ".concat(title.toLowerCase()) })) : undefined }, children)))));
|
|
40044
39546
|
};
|
|
40045
39547
|
|
|
40046
39548
|
var NavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -40080,23 +39582,23 @@ var NavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, void
|
|
|
40080
39582
|
title: title,
|
|
40081
39583
|
viewAllTitle: (viewAll === null || viewAll === void 0 ? void 0 : viewAll.textContent) || undefined
|
|
40082
39584
|
};
|
|
40083
|
-
return [2 /*return*/, React__default.createElement(NavItem, __assign({}, props), children)];
|
|
39585
|
+
return [2 /*return*/, React__default.createElement(NavItem$1, __assign({}, props), children)];
|
|
40084
39586
|
}
|
|
40085
39587
|
});
|
|
40086
39588
|
}); });
|
|
40087
39589
|
|
|
40088
|
-
var SubNavItem = function (_a) {
|
|
39590
|
+
var SubNavItem$1 = function (_a) {
|
|
40089
39591
|
var _b, _c;
|
|
40090
39592
|
var children = _a.children, _d = _a.isDefaultItem, isDefaultItem = _d === void 0 ? false : _d, href = _a.href, onClick = _a.onClick, offsetXL = _a.offsetXL, promo = _a.promo, subTitle = _a.subTitle, title = _a.title, viewAllTitle = _a.viewAllTitle, props = __rest(_a, ["children", "isDefaultItem", "href", "onClick", "offsetXL", "promo", "subTitle", "title", "viewAllTitle"]);
|
|
40091
|
-
var navItem = useContext(Context$
|
|
39593
|
+
var navItem = useContext(Context$3).navItem;
|
|
40092
39594
|
var subNavItem = useRef();
|
|
40093
39595
|
var _e = useState(false), panelOpen = _e[0], setPanelOpen = _e[1];
|
|
40094
39596
|
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
40095
39597
|
useEffect(function () {
|
|
40096
39598
|
React__default.Children.map(children, function (item) {
|
|
40097
39599
|
if (item &&
|
|
40098
|
-
item.type !== ItemGroup &&
|
|
40099
|
-
item.type !== Column &&
|
|
39600
|
+
item.type !== ItemGroup$1 &&
|
|
39601
|
+
item.type !== Column$1 &&
|
|
40100
39602
|
item.type !== Fragment) {
|
|
40101
39603
|
throw new Error("Illegal child passed to <SiteHeader.SubNavItem />. Ensure to only use <SiteHeader.ItemGroup /> or <SiteHeader.Column />.");
|
|
40102
39604
|
}
|
|
@@ -40127,9 +39629,9 @@ var SubNavItem = function (_a) {
|
|
|
40127
39629
|
linkTitle,
|
|
40128
39630
|
children && (React__default.createElement("span", { className: "arc-SiteHeaderSubNavItem-linkIcon" },
|
|
40129
39631
|
React__default.createElement(BtIconChevronRight2Px, null)))),
|
|
40130
|
-
React__default.createElement(Panel, { navItemRef: navItem, open: panelOpen, setOpen: setPanelOpen, subNavItemRef: subNavItem, subNavLink: "arc-SiteHeaderSubNavItem-link", promo: promo, title: React__default.createElement("span", null,
|
|
39632
|
+
React__default.createElement(Panel$1, { navItemRef: navItem, open: panelOpen, setOpen: setPanelOpen, subNavItemRef: subNavItem, subNavLink: "arc-SiteHeaderSubNavItem-link", promo: promo, title: React__default.createElement("span", null,
|
|
40131
39633
|
title,
|
|
40132
|
-
subTitle && (React__default.createElement(Text, { size: "xs", tone: "supporting" }, subTitle))), viewAll: href ? (React__default.createElement(Panel.ViewAll, { href: href, onClick: onClick, title: viewAllTitle || "View all ".concat(title.toLowerCase()) })) : undefined }, children)))));
|
|
39634
|
+
subTitle && (React__default.createElement(Text, { size: "xs", tone: "supporting" }, subTitle))), viewAll: href ? (React__default.createElement(Panel$1.ViewAll, { href: href, onClick: onClick, title: viewAllTitle || "View all ".concat(title.toLowerCase()) })) : undefined }, children)))));
|
|
40133
39635
|
};
|
|
40134
39636
|
|
|
40135
39637
|
var SubNavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -40183,15 +39685,15 @@ var SubNavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, vo
|
|
|
40183
39685
|
title: title,
|
|
40184
39686
|
viewAllTitle: (viewAll === null || viewAll === void 0 ? void 0 : viewAll.textContent) || undefined
|
|
40185
39687
|
};
|
|
40186
|
-
return [2 /*return*/, React__default.createElement(SubNavItem, __assign({}, props), children)];
|
|
39688
|
+
return [2 /*return*/, React__default.createElement(SubNavItem$1, __assign({}, props), children)];
|
|
40187
39689
|
}
|
|
40188
39690
|
});
|
|
40189
39691
|
}); });
|
|
40190
39692
|
|
|
40191
|
-
var defaultContext$
|
|
40192
|
-
var Context$
|
|
40193
|
-
var Provider$
|
|
40194
|
-
var NavItemWithSubNav = function (_a) {
|
|
39693
|
+
var defaultContext$3 = { navItem: null, subTitle: null };
|
|
39694
|
+
var Context$3 = createContext(defaultContext$3);
|
|
39695
|
+
var Provider$3 = Context$3.Provider;
|
|
39696
|
+
var NavItemWithSubNav$1 = function (_a) {
|
|
40195
39697
|
var _b, _c;
|
|
40196
39698
|
var href = _a.href, slot1 = _a.slot1, slot2 = _a.slot2, slot3 = _a.slot3, _d = _a.subTitle, subTitle = _d === void 0 ? null : _d, title = _a.title, onViewAllClick = _a.onViewAllClick, viewAllTitle = _a.viewAllTitle, props = __rest(_a, ["href", "slot1", "slot2", "slot3", "subTitle", "title", "onViewAllClick", "viewAllTitle"]);
|
|
40197
39699
|
var navItem = useRef();
|
|
@@ -40200,7 +39702,7 @@ var NavItemWithSubNav = function (_a) {
|
|
|
40200
39702
|
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
40201
39703
|
useEffect(function () {
|
|
40202
39704
|
React__default.Children.map(slot1, function (item) {
|
|
40203
|
-
if (item && item.type !== SubNavItem && item.type !== Fragment) {
|
|
39705
|
+
if (item && item.type !== SubNavItem$1 && item.type !== Fragment) {
|
|
40204
39706
|
throw new Error("Illegal child passed to <SiteHeader.NavItemWithSubNav /> `slot1` prop. Ensure to only use <SiteHeader.SubNavItem />.");
|
|
40205
39707
|
}
|
|
40206
39708
|
if (item.props.isDefaultItem) {
|
|
@@ -40208,7 +39710,7 @@ var NavItemWithSubNav = function (_a) {
|
|
|
40208
39710
|
}
|
|
40209
39711
|
});
|
|
40210
39712
|
React__default.Children.map(slot2, function (item) {
|
|
40211
|
-
if (item && item.type !== SubNavItem && item.type !== Fragment) {
|
|
39713
|
+
if (item && item.type !== SubNavItem$1 && item.type !== Fragment) {
|
|
40212
39714
|
throw new Error("Illegal child passed to <SiteHeader.NavItemWithSubNav /> `slot2` prop. Ensure to only use <SiteHeader.SubNavItem />.");
|
|
40213
39715
|
}
|
|
40214
39716
|
if (item.props.isDefaultItem) {
|
|
@@ -40216,7 +39718,7 @@ var NavItemWithSubNav = function (_a) {
|
|
|
40216
39718
|
}
|
|
40217
39719
|
});
|
|
40218
39720
|
React__default.Children.map(slot3, function (item) {
|
|
40219
|
-
if (item && item.type !== SubNavItem && item.type !== Fragment) {
|
|
39721
|
+
if (item && item.type !== SubNavItem$1 && item.type !== Fragment) {
|
|
40220
39722
|
throw new Error("Illegal child passed to <SiteHeader.NavItemWithSubNav /> `slot3` prop. Ensure to only use <SiteHeader.SubNavItem />.");
|
|
40221
39723
|
}
|
|
40222
39724
|
if (item.props.isDefaultItem) {
|
|
@@ -40224,7 +39726,7 @@ var NavItemWithSubNav = function (_a) {
|
|
|
40224
39726
|
}
|
|
40225
39727
|
});
|
|
40226
39728
|
}, [slot1, slot2, slot3]);
|
|
40227
|
-
return (React__default.createElement(Provider$
|
|
39729
|
+
return (React__default.createElement(Provider$3, { value: { navItem: navItem, subTitle: subTitle } },
|
|
40228
39730
|
React__default.createElement("li", __assign({ className: classNames((_b = {},
|
|
40229
39731
|
_b["arc-SiteHeaderNavItemWithSubNav"] = true,
|
|
40230
39732
|
_b["arc-SiteHeaderNavItem--linkSelected"] = panelOpen,
|
|
@@ -40238,7 +39740,7 @@ var NavItemWithSubNav = function (_a) {
|
|
|
40238
39740
|
} },
|
|
40239
39741
|
title,
|
|
40240
39742
|
React__default.createElement("span", { className: "arc-SiteHeaderNavItem-linkIcon" }, isMinWidthArcBreakpointL ? (React__default.createElement(BtIconChevronDown2Px, null)) : (React__default.createElement(BtIconChevronRight2Px, null)))),
|
|
40241
|
-
React__default.createElement(Panel, { navItemRef: navItem, open: panelOpen, setOpen: setPanelOpen, title: subTitle, viewAll: href ? (React__default.createElement(Panel.ViewAll, { href: href, onClick: onViewAllClick, title: viewAllTitle || "View all ".concat(title.toLowerCase()) })) : undefined, withSubNav: true },
|
|
39743
|
+
React__default.createElement(Panel$1, { navItemRef: navItem, open: panelOpen, setOpen: setPanelOpen, title: subTitle, viewAll: href ? (React__default.createElement(Panel$1.ViewAll, { href: href, onClick: onViewAllClick, title: viewAllTitle || "View all ".concat(title.toLowerCase()) })) : undefined, withSubNav: true },
|
|
40242
39744
|
defaultItem
|
|
40243
39745
|
? React__default.cloneElement(slot1, { isDefaultItem: defaultItem })
|
|
40244
39746
|
: slot1,
|
|
@@ -40296,17 +39798,17 @@ var NavItemWithSubNavRehydrator = (function (el, hydrate) { return __awaiter(voi
|
|
|
40296
39798
|
title: title,
|
|
40297
39799
|
viewAllTitle: (viewAll === null || viewAll === void 0 ? void 0 : viewAll.textContent) || undefined
|
|
40298
39800
|
};
|
|
40299
|
-
return [2 /*return*/, React__default.createElement(NavItemWithSubNav, __assign({}, props))];
|
|
39801
|
+
return [2 /*return*/, React__default.createElement(NavItemWithSubNav$1, __assign({}, props))];
|
|
40300
39802
|
}
|
|
40301
39803
|
});
|
|
40302
39804
|
}); });
|
|
40303
39805
|
|
|
40304
|
-
var NodeItem = function (_a) {
|
|
39806
|
+
var NodeItem$1 = function (_a) {
|
|
40305
39807
|
var children = _a.children, props = __rest(_a, ["children"]);
|
|
40306
39808
|
return (React__default.createElement(React__default.Fragment, __assign({}, filterDataAttrs(props)), children));
|
|
40307
39809
|
};
|
|
40308
39810
|
|
|
40309
|
-
var MenuButton = function (_a) {
|
|
39811
|
+
var MenuButton$1 = function (_a) {
|
|
40310
39812
|
var _b;
|
|
40311
39813
|
var menuOpen = _a.menuOpen, setMenuOpen = _a.setMenuOpen;
|
|
40312
39814
|
return (React__default.createElement("button", { "aria-expanded": menuOpen, className: classNames((_b = {},
|
|
@@ -40320,9 +39822,9 @@ var MenuButton = function (_a) {
|
|
|
40320
39822
|
React__default.createElement("span", { className: "arc-MenuButton-text" }, "Menu"))));
|
|
40321
39823
|
};
|
|
40322
39824
|
|
|
40323
|
-
var defaultContext = { transparent: false };
|
|
40324
|
-
var Context = createContext(defaultContext);
|
|
40325
|
-
var Provider = Context.Provider;
|
|
39825
|
+
var defaultContext$2 = { transparent: false };
|
|
39826
|
+
var Context$2 = createContext(defaultContext$2);
|
|
39827
|
+
var Provider$2 = Context$2.Provider;
|
|
40326
39828
|
/**
|
|
40327
39829
|
* Use `SiteHeader` to display brand logo and navigation at the top of a page.
|
|
40328
39830
|
*/
|
|
@@ -40335,9 +39837,9 @@ var SiteHeader = function (_a) {
|
|
|
40335
39837
|
useEffect(function () {
|
|
40336
39838
|
React__default.Children.map(children, function (item) {
|
|
40337
39839
|
if (item &&
|
|
40338
|
-
item.type !== NodeItem &&
|
|
40339
|
-
item.type !== NavItem &&
|
|
40340
|
-
item.type !== NavItemWithSubNav &&
|
|
39840
|
+
item.type !== NodeItem$1 &&
|
|
39841
|
+
item.type !== NavItem$1 &&
|
|
39842
|
+
item.type !== NavItemWithSubNav$1 &&
|
|
40341
39843
|
item.type !== Fragment) {
|
|
40342
39844
|
throw new Error("Illegal child passed to <SiteHeader />. Ensure to only use <SiteHeader.NavItem /> or <SiteHeader.NavItemWithSubNav />");
|
|
40343
39845
|
}
|
|
@@ -40380,7 +39882,7 @@ var SiteHeader = function (_a) {
|
|
|
40380
39882
|
// useEffect does not run in ReactDomServer renders
|
|
40381
39883
|
setHasClientSideJavaScript(true);
|
|
40382
39884
|
}, [setHasClientSideJavaScript]);
|
|
40383
|
-
return (React__default.createElement(Provider, { value: { transparent: isTransparent } },
|
|
39885
|
+
return (React__default.createElement(Provider$2, { value: { transparent: isTransparent } },
|
|
40384
39886
|
React__default.createElement("div", __assign({ className: classNames((_b = {},
|
|
40385
39887
|
_b["arc-SiteHeader"] = true,
|
|
40386
39888
|
_b["arc-SiteHeader--menuOpen"] = menuOpen,
|
|
@@ -40393,10 +39895,10 @@ var SiteHeader = function (_a) {
|
|
|
40393
39895
|
React__default.createElement("a", { className: "arc-SiteHeader-brand", onClick: handleLinkClick({
|
|
40394
39896
|
handler: logoOnClick
|
|
40395
39897
|
}), href: logoHref },
|
|
40396
|
-
React__default.createElement(BrandLogo, { label: logoLabel, subBrand: subBrand })),
|
|
39898
|
+
React__default.createElement(BrandLogo, { label: logoLabel, subBrand: subBrand, size: 40 })),
|
|
40397
39899
|
children && (React__default.createElement("nav", { className: "arc-SiteHeader-nav" },
|
|
40398
39900
|
React__default.createElement("div", { className: "arc-SiteHeader-menuButton" },
|
|
40399
|
-
React__default.createElement(MenuButton, { menuOpen: menuOpen, setMenuOpen: setMenuOpen })),
|
|
39901
|
+
React__default.createElement(MenuButton$1, { menuOpen: menuOpen, setMenuOpen: setMenuOpen })),
|
|
40400
39902
|
React__default.createElement("div", { className: "arc-SiteHeader-main" },
|
|
40401
39903
|
React__default.createElement("ul", { className: "arc-SiteHeader-navItems" }, children),
|
|
40402
39904
|
hasLogin && (React__default.createElement(React__default.Fragment, null, loginOnClick ? (React__default.createElement("div", { className: "arc-SiteHeader-loginButton" },
|
|
@@ -40407,13 +39909,13 @@ var SiteHeader = function (_a) {
|
|
|
40407
39909
|
basket ? (React__default.createElement("div", { className: "arc-SiteHeader-basket" }, basket)) : null,
|
|
40408
39910
|
hasLogin && (React__default.createElement(React__default.Fragment, null, loginOnClick ? (React__default.createElement("div", { className: "arc-SiteHeader-loginLink arc-SiteHeader-loginLink--function", onClick: loginOnClick }, loginTitle)) : (React__default.createElement("a", { className: "arc-SiteHeader-loginLink", href: loginHref }, loginTitle)))))))))));
|
|
40409
39911
|
};
|
|
40410
|
-
SiteHeader.Column = Column;
|
|
40411
|
-
SiteHeader.Item = Item;
|
|
40412
|
-
SiteHeader.ItemGroup = ItemGroup;
|
|
40413
|
-
SiteHeader.NavItem = NavItem;
|
|
40414
|
-
SiteHeader.NodeItem = NodeItem;
|
|
40415
|
-
SiteHeader.NavItemWithSubNav = NavItemWithSubNav;
|
|
40416
|
-
SiteHeader.SubNavItem = SubNavItem;
|
|
39912
|
+
SiteHeader.Column = Column$1;
|
|
39913
|
+
SiteHeader.Item = Item$1;
|
|
39914
|
+
SiteHeader.ItemGroup = ItemGroup$1;
|
|
39915
|
+
SiteHeader.NavItem = NavItem$1;
|
|
39916
|
+
SiteHeader.NodeItem = NodeItem$1;
|
|
39917
|
+
SiteHeader.NavItemWithSubNav = NavItemWithSubNav$1;
|
|
39918
|
+
SiteHeader.SubNavItem = SubNavItem$1;
|
|
40417
39919
|
|
|
40418
39920
|
var SiteHeaderRehydrator = function (el, hydrate) { return __awaiter(void 0, void 0, void 0, function () {
|
|
40419
39921
|
var children, basket, search, brand, login, logoHref, logoLabel, props;
|
|
@@ -40468,6 +39970,595 @@ SiteHeaderRehydrator.NavItemRehydrator = NavItemRehydrator;
|
|
|
40468
39970
|
SiteHeaderRehydrator.NavItemWithSubNavRehydrator = NavItemWithSubNavRehydrator;
|
|
40469
39971
|
SiteHeaderRehydrator.SubNavItemRehydrator = SubNavItemRehydrator;
|
|
40470
39972
|
|
|
39973
|
+
var Item = function (_a) {
|
|
39974
|
+
var _b;
|
|
39975
|
+
var children = _a.children, href = _a.href; _a.isEmphasised; var onClick = _a.onClick, props = __rest(_a, ["children", "href", "isEmphasised", "onClick"]);
|
|
39976
|
+
return (React__default.createElement("li", __assign({ className: classNames((_b = {},
|
|
39977
|
+
_b["arc-SiteHeaderV2Item"] = true,
|
|
39978
|
+
_b["arc-SiteHeaderV2Item--emphasised"] = true,
|
|
39979
|
+
_b)) }, filterDataAttrs(props)),
|
|
39980
|
+
React__default.createElement("a", { onClick: handleLinkClick({ handler: onClick }), className: "arc-SiteHeaderV2Item-link", href: href },
|
|
39981
|
+
React__default.createElement("span", { className: "arc-SiteHeaderV2Item-linkIcon" },
|
|
39982
|
+
React__default.createElement(BtIconChevronRightMid, null)),
|
|
39983
|
+
children)));
|
|
39984
|
+
};
|
|
39985
|
+
|
|
39986
|
+
var ItemGroup = function (_a) {
|
|
39987
|
+
var children = _a.children, href = _a.href, title = _a.title, subtitle = _a.subtitle, onClick = _a.onClick, viewAllTitle = _a.viewAllTitle, props = __rest(_a, ["children", "href", "title", "subtitle", "onClick", "viewAllTitle"]);
|
|
39988
|
+
var _b = useState(false), hasClientSideJavaScript = _b[0], setHasClientSideJavaScript = _b[1];
|
|
39989
|
+
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
39990
|
+
useEffect(function () {
|
|
39991
|
+
React__default.Children.map(children, function (item) {
|
|
39992
|
+
if (item && item.type !== Item && item.type !== Fragment) {
|
|
39993
|
+
throw new Error("Illegal child passed to <SiteHeaderV2.ItemGroup />. Ensure to only use <SiteHeaderV2.Item />.");
|
|
39994
|
+
}
|
|
39995
|
+
});
|
|
39996
|
+
}, [children]);
|
|
39997
|
+
useEffect(function () {
|
|
39998
|
+
// useEffect does not run in ReactDomServer renders
|
|
39999
|
+
setHasClientSideJavaScript(true);
|
|
40000
|
+
}, [setHasClientSideJavaScript]);
|
|
40001
|
+
var ElementType = "div";
|
|
40002
|
+
if (title) {
|
|
40003
|
+
ElementType = "details";
|
|
40004
|
+
}
|
|
40005
|
+
return (React__default.createElement("li", { className: "arc-SiteHeaderV2ItemGroup" },
|
|
40006
|
+
React__default.createElement(ElementType, __assign({ className: "arc-SiteHeaderV2ItemGroup-details", open: Boolean(title && isMinWidthArcBreakpointL) }, filterDataAttrs(props)),
|
|
40007
|
+
title ? (React__default.createElement(React__default.Fragment, null,
|
|
40008
|
+
React__default.createElement("summary", { className: "arc-SiteHeaderV2ItemGroup-summary", tabIndex: isMinWidthArcBreakpointL ? -1 : 0 }, href ? (React__default.createElement("div", { className: "arc-SiteHeaderV2ItemGroup-heading" },
|
|
40009
|
+
React__default.createElement("a", { onClick: handleLinkClick({
|
|
40010
|
+
handler: onClick
|
|
40011
|
+
}), className: "arc-SiteHeaderV2ItemGroup-title", href: href, tabIndex: !hasClientSideJavaScript || isMinWidthArcBreakpointL
|
|
40012
|
+
? 0
|
|
40013
|
+
: -1 }, title),
|
|
40014
|
+
React__default.createElement("span", { className: "arc-SiteHeaderV2ItemGroup-titleIcon" },
|
|
40015
|
+
React__default.createElement(BtIconChevronRightMid, { size: 16 })))) : (React__default.createElement("div", { className: "arc-SiteHeaderV2ItemGroup-title" }, title))),
|
|
40016
|
+
React__default.createElement("span", { className: "arc-SiteHeaderV2ItemGroup-subtitle" }, subtitle))) : null,
|
|
40017
|
+
React__default.createElement("ul", { className: "arc-SiteHeaderV2ItemGroup-items" },
|
|
40018
|
+
children,
|
|
40019
|
+
href && title ? (React__default.createElement("li", { className: "arc-SiteHeaderV2Item arc-SiteHeaderV2Item--viewAll" },
|
|
40020
|
+
React__default.createElement("a", { className: "arc-SiteHeaderV2Item-link", onClick: handleLinkClick({
|
|
40021
|
+
handler: onClick
|
|
40022
|
+
}), href: href }, viewAllTitle || "View all ".concat(title.toLowerCase())))) : null))));
|
|
40023
|
+
};
|
|
40024
|
+
|
|
40025
|
+
var Column = function (_a) {
|
|
40026
|
+
var children = _a.children, props = __rest(_a, ["children"]);
|
|
40027
|
+
useEffect(function () {
|
|
40028
|
+
React__default.Children.map(children, function (item) {
|
|
40029
|
+
if (item && item.type !== ItemGroup) {
|
|
40030
|
+
throw new Error("Illegal child passed to <SiteHeaderV2.Column />. Ensure to only use <SiteHeaderV2.ItemGroup />.");
|
|
40031
|
+
}
|
|
40032
|
+
});
|
|
40033
|
+
}, [children]);
|
|
40034
|
+
return (React__default.createElement("li", __assign({ className: "arc-SiteHeaderV2Column" }, filterDataAttrs(props)),
|
|
40035
|
+
React__default.createElement("ul", { className: "arc-SiteHeaderV2Column-items" }, children)));
|
|
40036
|
+
};
|
|
40037
|
+
|
|
40038
|
+
var BackButton = function (_a) {
|
|
40039
|
+
var setOpen = _a.setOpen;
|
|
40040
|
+
return (React__default.createElement("button", { className: "arc-SiteHeaderV2BackButton", onClick: function () {
|
|
40041
|
+
setOpen(false);
|
|
40042
|
+
} },
|
|
40043
|
+
React__default.createElement("span", { className: "arc-SiteHeaderV2BackButton-icon" },
|
|
40044
|
+
React__default.createElement(BtIconChevronLeft2Px, null)),
|
|
40045
|
+
React__default.createElement("span", { className: "arc-SiteHeaderV2BackButton-text" }, "Back")));
|
|
40046
|
+
};
|
|
40047
|
+
|
|
40048
|
+
var Panel = function (_a) {
|
|
40049
|
+
var _b, _c, _d, _e, _f;
|
|
40050
|
+
var children = _a.children, navItemRef = _a.navItemRef, isNavItem = _a.isNavItem, open = _a.open, setOpen = _a.setOpen, subNavItemRef = _a.subNavItemRef, _g = _a.subNavLink, subNavLink = _g === void 0 ? "" : _g, title = _a.title, subtitle = _a.subtitle, viewAll = _a.viewAll, withSubNav = _a.withSubNav, fade = _a.fade, isPrimary = _a.isPrimary, props = __rest(_a, ["children", "navItemRef", "isNavItem", "open", "setOpen", "subNavItemRef", "subNavLink", "title", "subtitle", "viewAll", "withSubNav", "fade", "isPrimary"]);
|
|
40051
|
+
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
40052
|
+
useEffect(function () {
|
|
40053
|
+
// Where appropriate, close the Panel when clicking outside of it,
|
|
40054
|
+
// by listening to clicks on the entire document and acting accordingly.
|
|
40055
|
+
var handleClick = function (e) {
|
|
40056
|
+
var _a, _b;
|
|
40057
|
+
// Don't close the Panel…
|
|
40058
|
+
if (
|
|
40059
|
+
// The click is inside the current SubNavItem.
|
|
40060
|
+
((_a = subNavItemRef === null || subNavItemRef === void 0 ? void 0 : subNavItemRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) ||
|
|
40061
|
+
// The click is inside the current NavItem
|
|
40062
|
+
// and the Panel is not inside a SubNavItem.
|
|
40063
|
+
// and the target is not a link
|
|
40064
|
+
(((_b = navItemRef === null || navItemRef === void 0 ? void 0 : navItemRef.current) === null || _b === void 0 ? void 0 : _b.contains(e.target)) &&
|
|
40065
|
+
!subNavItemRef &&
|
|
40066
|
+
!e.target.getAttribute("href")) ||
|
|
40067
|
+
// The Panel is inside a SubNavItem
|
|
40068
|
+
// and the click is not on a SubNavItem-link.
|
|
40069
|
+
// This ensures that one SubNavItem Panel per NavItem always remains open.
|
|
40070
|
+
(subNavItemRef &&
|
|
40071
|
+
!e.target.classList.contains(subNavLink) &&
|
|
40072
|
+
!e.target.classList.contains("".concat(subNavLink, "Title")) &&
|
|
40073
|
+
!e.target.classList.contains("".concat(subNavLink, "SubTitle"))) ||
|
|
40074
|
+
// Panel is inside a SubNavItem
|
|
40075
|
+
// and the click is not inside the Panel's NavItem parent.
|
|
40076
|
+
// This prevents SubNavItem Panels in sibling NavItems from being closed.
|
|
40077
|
+
(subNavItemRef && !(navItemRef === null || navItemRef === void 0 ? void 0 : navItemRef.current.contains(e.target)))) {
|
|
40078
|
+
return;
|
|
40079
|
+
}
|
|
40080
|
+
// Close the panel.
|
|
40081
|
+
setOpen(false);
|
|
40082
|
+
};
|
|
40083
|
+
document.addEventListener("click", handleClick);
|
|
40084
|
+
return function () {
|
|
40085
|
+
document.removeEventListener("click", handleClick);
|
|
40086
|
+
};
|
|
40087
|
+
}, [navItemRef, setOpen, subNavItemRef, subNavLink]);
|
|
40088
|
+
useEffect(function () {
|
|
40089
|
+
var handleKeydown = function (e) {
|
|
40090
|
+
// Check the viewport width at time of press
|
|
40091
|
+
var isMinWidthArcBreakpointL = window.matchMedia("(min-width: ".concat(ArcBreakpointL, "px)")).matches;
|
|
40092
|
+
if (e.key === "Escape" || e.keyCode === 27) {
|
|
40093
|
+
if (isMinWidthArcBreakpointL && subNavItemRef) {
|
|
40094
|
+
// Don't close Panels inside SubNavItems when viewport width is above
|
|
40095
|
+
// the "desktop" breakpoint.
|
|
40096
|
+
return false;
|
|
40097
|
+
}
|
|
40098
|
+
return setOpen(false);
|
|
40099
|
+
}
|
|
40100
|
+
};
|
|
40101
|
+
window.addEventListener("keydown", handleKeydown);
|
|
40102
|
+
return function () {
|
|
40103
|
+
window.removeEventListener("keydown", handleKeydown);
|
|
40104
|
+
};
|
|
40105
|
+
}, [setOpen, subNavItemRef]);
|
|
40106
|
+
return (React__default.createElement("div", { style: { display: "flex" } },
|
|
40107
|
+
React__default.createElement("div", __assign({ className: classNames((_b = {},
|
|
40108
|
+
_b["arc-SiteHeaderV2Panel"] = true,
|
|
40109
|
+
_b["arc-SiteHeaderV2Panel--open"] = open,
|
|
40110
|
+
_b["arc-SiteHeaderV2Panel--withSubNav"] = withSubNav,
|
|
40111
|
+
_b)) }, filterDataAttrs(props)),
|
|
40112
|
+
React__default.createElement(Surface, { background: "white" },
|
|
40113
|
+
React__default.createElement(BackButton, { setOpen: setOpen }),
|
|
40114
|
+
React__default.createElement("div", { className: classNames((_c = {},
|
|
40115
|
+
_c["arc-SiteHeaderV2Panel-inner"] = !isNavItem && withSubNav,
|
|
40116
|
+
_c["arc-SiteHeaderV2Panel-innerWithoutSubNav"] = !isNavItem && !withSubNav,
|
|
40117
|
+
_c["arc-SiteHeaderV2NavItemWithSubNav-fadeIn"] = !isNavItem && !withSubNav,
|
|
40118
|
+
_c["arc-SiteHeaderV2Panel-innerNavItems"] = isNavItem,
|
|
40119
|
+
_c)) },
|
|
40120
|
+
React__default.createElement("div", { className: classNames((_d = {},
|
|
40121
|
+
_d["arc-SiteHeaderV2Panel-main"] = !isNavItem && !withSubNav,
|
|
40122
|
+
_d)) },
|
|
40123
|
+
React__default.createElement("div", { className: classNames((_e = {},
|
|
40124
|
+
_e["arc-SiteHeaderV2Panel-mainInnerWithoutSubNav"] = !isNavItem && !withSubNav,
|
|
40125
|
+
_e["arc-SiteHeaderV2Panel-mainInner"] = !isNavItem,
|
|
40126
|
+
_e["arc-SiteHeaderV2Panel-mainInnerNavItems"] = isNavItem,
|
|
40127
|
+
_e)) },
|
|
40128
|
+
withSubNav && (React__default.createElement("div", { className: "arc-SiteHeaderV2Panel-subNavArea" })),
|
|
40129
|
+
!isMinWidthArcBreakpointL && title && (React__default.createElement("div", { className: "arc-SiteHeaderV2Panel-mobileTitleBlock" },
|
|
40130
|
+
React__default.createElement("div", { className: "arc-SiteHeaderV2Panel-mobileTitle" },
|
|
40131
|
+
title && (React__default.createElement("div", { className: "arc-SiteHeaderV2Panel-title" }, title)),
|
|
40132
|
+
React__default.createElement("div", { className: "arc-SiteHeaderV2Panel-subTitle" }, subtitle)))),
|
|
40133
|
+
React__default.createElement("ul", { className: classNames((_f = {},
|
|
40134
|
+
_f["arc-SiteHeaderV2Panel-items"] = !isNavItem,
|
|
40135
|
+
_f["arc-SiteHeaderV2Panel-itemsNavItems"] = isNavItem,
|
|
40136
|
+
_f["arc-SiteHeaderV2NavItemWithSubNav-fadeIn"] = isNavItem && fade && !isPrimary,
|
|
40137
|
+
_f)) }, children),
|
|
40138
|
+
!withSubNav && viewAll)),
|
|
40139
|
+
withSubNav && viewAll)))));
|
|
40140
|
+
};
|
|
40141
|
+
var ViewAll = function (_a) {
|
|
40142
|
+
var href = _a.href, title = _a.title, onClick = _a.onClick, fill = _a.fill;
|
|
40143
|
+
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
40144
|
+
if (fill === "outlined") {
|
|
40145
|
+
return isMinWidthArcBreakpointL ? (React__default.createElement("div", { className: "arc-SiteHeaderV2Panel-viewAllOutlined" },
|
|
40146
|
+
React__default.createElement(Button, { fill: fill, label: title !== null && title !== void 0 ? title : "", href: href, onClick: onClick }),
|
|
40147
|
+
" ")) : (React__default.createElement("div", { className: "arc-SiteHeaderV2Panel-mobileViewAll arc-SiteHeaderV2Panel-mobileViewAllOutlined" },
|
|
40148
|
+
React__default.createElement("a", { className: "arc-SiteHeaderV2Item-link", onClick: handleLinkClick({
|
|
40149
|
+
handler: onClick
|
|
40150
|
+
}), href: href }, title)));
|
|
40151
|
+
}
|
|
40152
|
+
else {
|
|
40153
|
+
return isMinWidthArcBreakpointL ? (React__default.createElement("div", { className: "arc-SiteHeaderV2Panel-viewAll" },
|
|
40154
|
+
" ",
|
|
40155
|
+
React__default.createElement(Button, { fill: fill, label: title !== null && title !== void 0 ? title : "", isFullWidth: true, href: href, onClick: onClick }),
|
|
40156
|
+
" ")) : (React__default.createElement("div", { className: "arc-SiteHeaderV2Panel-mobileViewAll" },
|
|
40157
|
+
React__default.createElement("a", { className: "arc-SiteHeaderV2Item-link", onClick: handleLinkClick({
|
|
40158
|
+
handler: onClick
|
|
40159
|
+
}), href: href }, title)));
|
|
40160
|
+
}
|
|
40161
|
+
};
|
|
40162
|
+
Panel.ViewAll = ViewAll;
|
|
40163
|
+
|
|
40164
|
+
var NavItem = function (_a) {
|
|
40165
|
+
var _b, _c, _d, _e, _f;
|
|
40166
|
+
var children = _a.children, href = _a.href, isCurrent = _a.isCurrent, onClick = _a.onClick, title = _a.title; _a.viewAllTitle; var isPrimary = _a.isPrimary, subTitle = _a.subTitle, props = __rest(_a, ["children", "href", "isCurrent", "onClick", "title", "viewAllTitle", "isPrimary", "subTitle"]);
|
|
40167
|
+
var navItem = useRef();
|
|
40168
|
+
var _g = useState(false), panelOpen = _g[0], setPanelOpen = _g[1];
|
|
40169
|
+
var _h = useState(false), animation = _h[0], setAnimation = _h[1];
|
|
40170
|
+
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
40171
|
+
useEffect(function () {
|
|
40172
|
+
React__default.Children.map(children, function (item) {
|
|
40173
|
+
if (item &&
|
|
40174
|
+
item.type !== ItemGroup &&
|
|
40175
|
+
item.type !== Column &&
|
|
40176
|
+
item.type !== Fragment) {
|
|
40177
|
+
throw new Error("Illegal child passed to <SiteHeaderV2.NavItem />. Ensure to only use <SiteHeaderV2.ItemGroup /> or <SiteHeaderV2.Column />.");
|
|
40178
|
+
}
|
|
40179
|
+
});
|
|
40180
|
+
}, [children]);
|
|
40181
|
+
return (React__default.createElement("li", __assign({ className: classNames((_b = {},
|
|
40182
|
+
_b["arc-SiteHeaderV2NavItem-primary"] = isPrimary,
|
|
40183
|
+
_b["arc-SiteHeaderV2NavItemWithSubNav-Secondary"] = !isPrimary,
|
|
40184
|
+
_b["arc-SiteHeaderV2NavItem"] = !subTitle && !isPrimary,
|
|
40185
|
+
_b["arc-SiteHeaderV2NavItem--linkSelected"] = (children && panelOpen) || (!children && href && isCurrent),
|
|
40186
|
+
_b["arc-SiteHeaderV2NavItemWithSubNav-active"] = !isPrimary && panelOpen,
|
|
40187
|
+
_b)), ref: navItem }, filterDataAttrs(props)), !children ? (href ? (React__default.createElement("a", { onClick: handleLinkClick({
|
|
40188
|
+
handler: onClick
|
|
40189
|
+
}), className: "arc-SiteHeaderV2NavItem-link", href: href }, title)) : null) : (React__default.createElement(React__default.Fragment, null,
|
|
40190
|
+
React__default.createElement("div", { className: "arc-SiteHeaderV2NavItemWithSubNav-buttonContainer" },
|
|
40191
|
+
React__default.createElement("button", { "aria-expanded": panelOpen, className: classNames((_c = {},
|
|
40192
|
+
_c["arc-SiteHeaderV2NavItem-link"] = true,
|
|
40193
|
+
_c["arc-SiteHeaderV2NavItem-link--itemHasChildren"] = true,
|
|
40194
|
+
_c["arc-SiteHeaderV2NavItem-horizontalPanelLink"] = !isPrimary && !isMinWidthArcBreakpointL,
|
|
40195
|
+
_c)), onClick: function (e) {
|
|
40196
|
+
e.preventDefault();
|
|
40197
|
+
setPanelOpen(!panelOpen);
|
|
40198
|
+
setAnimation(true);
|
|
40199
|
+
}, onAnimationEnd: function () { return setAnimation(false); } },
|
|
40200
|
+
React__default.createElement("div", { className: classNames((_d = {},
|
|
40201
|
+
_d["arc-SiteHeaderV2NavItem-title"] = !subTitle,
|
|
40202
|
+
_d)) }, title),
|
|
40203
|
+
React__default.createElement("span", { className: "arc-SiteHeaderV2-mobileChevron" },
|
|
40204
|
+
React__default.createElement(BtIconChevronRight2Px, null)),
|
|
40205
|
+
subTitle && !isPrimary && isMinWidthArcBreakpointL ? (React__default.createElement("div", { className: classNames((_e = {},
|
|
40206
|
+
_e["arc-SiteHeaderV2NavItemWithSubNav-text"] = !isPrimary,
|
|
40207
|
+
_e)) }, subTitle)) : null,
|
|
40208
|
+
React__default.createElement("div", { className: classNames((_f = {},
|
|
40209
|
+
_f["arc-SiteHeaderV2NavItemWithSubNav-buttonUnderline"] = panelOpen,
|
|
40210
|
+
_f["arc-SiteHeaderV2NavItemWithSubNav-primaryButtonUnderline"] = isPrimary && panelOpen,
|
|
40211
|
+
_f["arc-SiteHeaderV2NavItemWithSubNav-buttonUnderlineActive"] = !isPrimary && panelOpen,
|
|
40212
|
+
_f)) }))),
|
|
40213
|
+
React__default.createElement(Panel, { navItemRef: navItem, isNavItem: true, isPrimary: isPrimary, open: panelOpen, setOpen: setPanelOpen, fade: animation, viewAll: href ? (React__default.createElement(Panel.ViewAll, { href: href, onClick: onClick, title: "See all solutions", fill: "solid" })) : undefined }, children)))));
|
|
40214
|
+
};
|
|
40215
|
+
|
|
40216
|
+
var HorizontalPanel = function (_a) {
|
|
40217
|
+
var _b, _c, _d;
|
|
40218
|
+
var children = _a.children, navItemRef = _a.navItemRef, open = _a.open, setOpen = _a.setOpen, subNavItemRef = _a.subNavItemRef, _e = _a.subNavLink, subNavLink = _e === void 0 ? "" : _e, title = _a.title, withSubNav = _a.withSubNav; _a.animation; var props = __rest(_a, ["children", "navItemRef", "open", "setOpen", "subNavItemRef", "subNavLink", "title", "withSubNav", "animation"]);
|
|
40219
|
+
useEffect(function () {
|
|
40220
|
+
// Where appropriate, close the Panel when clicking outside of it,
|
|
40221
|
+
// by listening to clicks on the entire document and acting accordingly.
|
|
40222
|
+
var handleClick = function (e) {
|
|
40223
|
+
var _a, _b;
|
|
40224
|
+
// Don't close the Panel…
|
|
40225
|
+
if (
|
|
40226
|
+
// The click is inside the current SubNavItem.
|
|
40227
|
+
((_a = subNavItemRef === null || subNavItemRef === void 0 ? void 0 : subNavItemRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) ||
|
|
40228
|
+
// The click is inside the current NavItem
|
|
40229
|
+
// and the Panel is not inside a SubNavItem.
|
|
40230
|
+
// and the target is not a link
|
|
40231
|
+
(((_b = navItemRef === null || navItemRef === void 0 ? void 0 : navItemRef.current) === null || _b === void 0 ? void 0 : _b.contains(e.target)) &&
|
|
40232
|
+
!subNavItemRef &&
|
|
40233
|
+
!e.target.getAttribute("href")) ||
|
|
40234
|
+
// The Panel is inside a SubNavItem
|
|
40235
|
+
// and the click is not on a SubNavItem-link.
|
|
40236
|
+
// This ensures that one SubNavItem Panel per NavItem always remains open.
|
|
40237
|
+
(subNavItemRef &&
|
|
40238
|
+
!e.target.classList.contains(subNavLink) &&
|
|
40239
|
+
!e.target.classList.contains("".concat(subNavLink, "Title")) &&
|
|
40240
|
+
!e.target.classList.contains("".concat(subNavLink, "SubTitle"))) ||
|
|
40241
|
+
// Panel is inside a SubNavItem
|
|
40242
|
+
// and the click is not inside the Panel's NavItem parent.
|
|
40243
|
+
// This prevents SubNavItem Panels in sibling NavItems from being closed.
|
|
40244
|
+
(subNavItemRef && !(navItemRef === null || navItemRef === void 0 ? void 0 : navItemRef.current.contains(e.target)))) {
|
|
40245
|
+
return;
|
|
40246
|
+
}
|
|
40247
|
+
// Close the panel.
|
|
40248
|
+
setOpen(false);
|
|
40249
|
+
};
|
|
40250
|
+
document.addEventListener("click", handleClick);
|
|
40251
|
+
return function () {
|
|
40252
|
+
document.removeEventListener("click", handleClick);
|
|
40253
|
+
};
|
|
40254
|
+
}, [navItemRef, setOpen, subNavItemRef, subNavLink]);
|
|
40255
|
+
useEffect(function () {
|
|
40256
|
+
var handleKeydown = function (e) {
|
|
40257
|
+
// Check the viewport width at time of press
|
|
40258
|
+
var isMinWidthArcBreakpointL = window.matchMedia("(min-width: ".concat(ArcBreakpointL, "px)")).matches;
|
|
40259
|
+
if (e.key === "Escape" || e.keyCode === 27) {
|
|
40260
|
+
if (isMinWidthArcBreakpointL && subNavItemRef) {
|
|
40261
|
+
// Don't close Panels inside SubNavItems when viewport width is above
|
|
40262
|
+
// the "desktop" breakpoint.
|
|
40263
|
+
return false;
|
|
40264
|
+
}
|
|
40265
|
+
return setOpen(false);
|
|
40266
|
+
}
|
|
40267
|
+
};
|
|
40268
|
+
window.addEventListener("keydown", handleKeydown);
|
|
40269
|
+
return function () {
|
|
40270
|
+
window.removeEventListener("keydown", handleKeydown);
|
|
40271
|
+
};
|
|
40272
|
+
}, [setOpen, subNavItemRef]);
|
|
40273
|
+
return (React__default.createElement("div", __assign({ className: classNames((_b = {},
|
|
40274
|
+
_b["arc-SiteHeaderV2HorizontalPanel"] = true,
|
|
40275
|
+
_b["arc-SiteHeaderV2HorizontalPanel--open"] = open,
|
|
40276
|
+
_b["arc-SiteHeaderV2HorizontalPanel--withSubNav"] = withSubNav,
|
|
40277
|
+
_b)) }, filterDataAttrs(props)),
|
|
40278
|
+
React__default.createElement(Surface, { background: "light" },
|
|
40279
|
+
React__default.createElement("div", { className: classNames((_c = {},
|
|
40280
|
+
_c["arc-SiteHeaderV2HorizontalPanel-container"] = true,
|
|
40281
|
+
_c)) },
|
|
40282
|
+
React__default.createElement(BackButton, { setOpen: setOpen }),
|
|
40283
|
+
title && (React__default.createElement("div", { className: "arc-SiteHeaderV2Panel-selectedTitle" }, title)),
|
|
40284
|
+
React__default.createElement("ul", { className: classNames((_d = {},
|
|
40285
|
+
_d["arc-SiteHeaderV2HorizontalPanel-items"] = true,
|
|
40286
|
+
_d)) }, children)))));
|
|
40287
|
+
};
|
|
40288
|
+
|
|
40289
|
+
var defaultContext$1 = { navItem: null, subTitle: null };
|
|
40290
|
+
var Context$1 = createContext(defaultContext$1);
|
|
40291
|
+
var Provider$1 = Context$1.Provider;
|
|
40292
|
+
var NavItemWithSubNav = function (_a) {
|
|
40293
|
+
var _b, _c, _d, _e, _f;
|
|
40294
|
+
var href = _a.href, slot1 = _a.slot1, slot2 = _a.slot2, slot3 = _a.slot3, slot4 = _a.slot4, slot5 = _a.slot5, slot6 = _a.slot6, _g = _a.subTitle, subTitle = _g === void 0 ? null : _g, title = _a.title, onViewAllClick = _a.onViewAllClick, isPrimary = _a.isPrimary, viewAllTitle = _a.viewAllTitle, props = __rest(_a, ["href", "slot1", "slot2", "slot3", "slot4", "slot5", "slot6", "subTitle", "title", "onViewAllClick", "isPrimary", "viewAllTitle"]);
|
|
40295
|
+
var navItem = useRef();
|
|
40296
|
+
var _h = useState(true), defaultItem = _h[0], setDefaultItem = _h[1];
|
|
40297
|
+
var _j = useState(false), panelOpen = _j[0], setPanelOpen = _j[1];
|
|
40298
|
+
var _k = useState(false), horizontalPanelOpen = _k[0], setHorizontalPanelOpen = _k[1];
|
|
40299
|
+
var _l = useState(false), animation = _l[0], setAnimation = _l[1];
|
|
40300
|
+
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
40301
|
+
useEffect(function () {
|
|
40302
|
+
React__default.Children.map(slot1, function (item) {
|
|
40303
|
+
if (item.props.isDefaultItem) {
|
|
40304
|
+
setDefaultItem(false);
|
|
40305
|
+
}
|
|
40306
|
+
});
|
|
40307
|
+
React__default.Children.map(slot2, function (item) {
|
|
40308
|
+
if (item.props.isDefaultItem) {
|
|
40309
|
+
setDefaultItem(false);
|
|
40310
|
+
}
|
|
40311
|
+
});
|
|
40312
|
+
React__default.Children.map(slot3, function (item) {
|
|
40313
|
+
if (item.props.isDefaultItem) {
|
|
40314
|
+
setDefaultItem(false);
|
|
40315
|
+
}
|
|
40316
|
+
});
|
|
40317
|
+
React__default.Children.map(slot4, function (item) {
|
|
40318
|
+
if (item.props.isDefaultItem) {
|
|
40319
|
+
setDefaultItem(false);
|
|
40320
|
+
}
|
|
40321
|
+
});
|
|
40322
|
+
React__default.Children.map(slot5, function (item) {
|
|
40323
|
+
if (item.props.isDefaultItem) {
|
|
40324
|
+
setDefaultItem(false);
|
|
40325
|
+
}
|
|
40326
|
+
});
|
|
40327
|
+
}, [slot1, slot2, slot3, slot4, slot5]);
|
|
40328
|
+
return (React__default.createElement(Provider$1, { value: { navItem: navItem, subTitle: subTitle } },
|
|
40329
|
+
React__default.createElement("li", __assign({ className: classNames((_b = {},
|
|
40330
|
+
_b["arc-SiteHeaderV2NavItemWithSubNav"] = true,
|
|
40331
|
+
_b["arc-SiteHeaderV2NavItemWithSubNav-Secondary"] = !isPrimary,
|
|
40332
|
+
_b["arc-SiteHeaderV2NavItem-primary"] = isPrimary,
|
|
40333
|
+
_b["arc-SiteHeaderV2NavItem--linkSelected"] = isPrimary
|
|
40334
|
+
? horizontalPanelOpen
|
|
40335
|
+
: panelOpen,
|
|
40336
|
+
_b["arc-SiteHeaderV2NavItemWithSubNav-active"] = panelOpen,
|
|
40337
|
+
_b)), ref: navItem }, filterDataAttrs(props)),
|
|
40338
|
+
React__default.createElement("div", { className: "arc-SiteHeaderV2NavItemWithSubNav-buttonContainer" },
|
|
40339
|
+
React__default.createElement("button", { "aria-expanded": horizontalPanelOpen, className: classNames((_c = {},
|
|
40340
|
+
_c["arc-SiteHeaderV2NavItem-link"] = true,
|
|
40341
|
+
_c["arc-SiteHeaderV2NavItem-link--itemHasChildren"] = true,
|
|
40342
|
+
_c["arc-SiteHeaderV2NavItem-horizontalPanelLink"] = !isPrimary && !isMinWidthArcBreakpointL,
|
|
40343
|
+
_c)), onClick: function (e) {
|
|
40344
|
+
e.preventDefault();
|
|
40345
|
+
isPrimary
|
|
40346
|
+
? setHorizontalPanelOpen(!horizontalPanelOpen)
|
|
40347
|
+
: setPanelOpen(!horizontalPanelOpen);
|
|
40348
|
+
setAnimation(true);
|
|
40349
|
+
}, onAnimationEnd: function () { return setAnimation(false); } },
|
|
40350
|
+
React__default.createElement("div", { className: classNames((_d = {},
|
|
40351
|
+
_d["arc-SiteHeaderV2NavItem-title"] = isPrimary,
|
|
40352
|
+
_d)) }, title),
|
|
40353
|
+
React__default.createElement("span", { className: "arc-SiteHeaderV2-mobileChevron" },
|
|
40354
|
+
React__default.createElement(BtIconChevronRight2Px, null)),
|
|
40355
|
+
subTitle && !isPrimary && isMinWidthArcBreakpointL ? (React__default.createElement("div", { className: classNames((_e = {},
|
|
40356
|
+
_e["arc-SiteHeaderV2NavItemWithSubNav-text"] = !isPrimary,
|
|
40357
|
+
_e)) }, subTitle)) : null,
|
|
40358
|
+
React__default.createElement("div", { className: classNames((_f = {},
|
|
40359
|
+
_f["arc-SiteHeaderV2NavItemWithSubNav-buttonUnderline"] = isPrimary
|
|
40360
|
+
? horizontalPanelOpen
|
|
40361
|
+
: panelOpen,
|
|
40362
|
+
_f["arc-SiteHeaderV2NavItemWithSubNav-primaryButtonUnderline"] = isPrimary && horizontalPanelOpen,
|
|
40363
|
+
_f["arc-SiteHeaderV2NavItemWithSubNav-buttonUnderlineActive "] = !isPrimary && panelOpen,
|
|
40364
|
+
_f)) }))),
|
|
40365
|
+
isPrimary && (React__default.createElement(HorizontalPanel, { animation: animation, navItemRef: navItem, open: horizontalPanelOpen, setOpen: setHorizontalPanelOpen, title: !isMinWidthArcBreakpointL && title },
|
|
40366
|
+
slot1,
|
|
40367
|
+
slot2,
|
|
40368
|
+
slot3,
|
|
40369
|
+
slot4,
|
|
40370
|
+
slot5)),
|
|
40371
|
+
React__default.createElement(Panel, { navItemRef: navItem, open: panelOpen, fade: animation, setOpen: setPanelOpen, title: !isMinWidthArcBreakpointL && title, subtitle: subTitle, viewAll: href ? (React__default.createElement(Panel.ViewAll, { href: href, onClick: onViewAllClick, title: viewAllTitle, fill: "solid" })) : undefined, withSubNav: true, isNavItem: false },
|
|
40372
|
+
defaultItem
|
|
40373
|
+
? React__default.cloneElement(slot1, { isDefaultItem: defaultItem })
|
|
40374
|
+
: slot1,
|
|
40375
|
+
slot2,
|
|
40376
|
+
slot3,
|
|
40377
|
+
slot4,
|
|
40378
|
+
slot5,
|
|
40379
|
+
slot6))));
|
|
40380
|
+
};
|
|
40381
|
+
|
|
40382
|
+
var NodeItem = function (_a) {
|
|
40383
|
+
var children = _a.children, props = __rest(_a, ["children"]);
|
|
40384
|
+
return (React__default.createElement(React__default.Fragment, __assign({}, filterDataAttrs(props)), children));
|
|
40385
|
+
};
|
|
40386
|
+
|
|
40387
|
+
var MenuButton = function (_a) {
|
|
40388
|
+
var _b;
|
|
40389
|
+
var menuOpen = _a.menuOpen, setMenuOpen = _a.setMenuOpen;
|
|
40390
|
+
return (React__default.createElement("button", { "aria-expanded": menuOpen, className: classNames((_b = {},
|
|
40391
|
+
_b["arc-MenuButton"] = true,
|
|
40392
|
+
_b["arc-MenuButton--menuOpen"] = menuOpen,
|
|
40393
|
+
_b)), onClick: function () {
|
|
40394
|
+
setMenuOpen(!menuOpen);
|
|
40395
|
+
}, type: "button" },
|
|
40396
|
+
React__default.createElement("span", { className: "arc-MenuButton-box" },
|
|
40397
|
+
React__default.createElement("span", { className: "arc-MenuButton-inner" }),
|
|
40398
|
+
React__default.createElement("span", { className: "arc-MenuButton-text" }, "Menu"))));
|
|
40399
|
+
};
|
|
40400
|
+
|
|
40401
|
+
var SubNavItem = function (_a) {
|
|
40402
|
+
var _b, _c;
|
|
40403
|
+
var children = _a.children, _d = _a.isDefaultItem, isDefaultItem = _d === void 0 ? false : _d, href = _a.href, onClick = _a.onClick, offsetXL = _a.offsetXL, subTitle = _a.subTitle, title = _a.title, viewAllTitle = _a.viewAllTitle, icon = _a.icon, props = __rest(_a, ["children", "isDefaultItem", "href", "onClick", "offsetXL", "subTitle", "title", "viewAllTitle", "icon"]);
|
|
40404
|
+
var navItem = useContext(Context$1).navItem;
|
|
40405
|
+
var subNavItem = useRef();
|
|
40406
|
+
var _e = useState(false), panelOpen = _e[0], setPanelOpen = _e[1];
|
|
40407
|
+
var _f = useState(false), fade = _f[0], setFade = _f[1];
|
|
40408
|
+
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
40409
|
+
useEffect(function () {
|
|
40410
|
+
React__default.Children.map(children, function (item) {
|
|
40411
|
+
if (item &&
|
|
40412
|
+
item.type !== ItemGroup &&
|
|
40413
|
+
item.type !== Column &&
|
|
40414
|
+
item.type !== Fragment) {
|
|
40415
|
+
throw new Error("Illegal child passed to <SiteHeaderV2.SubNavItem />. Ensure to only use <SiteHeaderV2.ItemGroup /> or <SiteHeaderV2.Column />.");
|
|
40416
|
+
}
|
|
40417
|
+
});
|
|
40418
|
+
}, [children]);
|
|
40419
|
+
useEffect(function () {
|
|
40420
|
+
if (isDefaultItem && isMinWidthArcBreakpointL) {
|
|
40421
|
+
setPanelOpen(true);
|
|
40422
|
+
}
|
|
40423
|
+
else {
|
|
40424
|
+
setPanelOpen(false);
|
|
40425
|
+
}
|
|
40426
|
+
}, [isDefaultItem, isMinWidthArcBreakpointL]);
|
|
40427
|
+
var linkTitle = (React__default.createElement(React__default.Fragment, null,
|
|
40428
|
+
React__default.createElement("span", { className: "arc-SiteHeaderV2SubNavItem-linkTitle" }, title),
|
|
40429
|
+
children && panelOpen && (React__default.createElement("span", { className: "arc-SiteHeaderV2SubNavItem-linkIcon" },
|
|
40430
|
+
React__default.createElement(BtIconChevronRight2Px, null))),
|
|
40431
|
+
children && !isMinWidthArcBreakpointL && (React__default.createElement("span", { className: "arc-SiteHeaderV2SubNavItem-linkIcon" },
|
|
40432
|
+
React__default.createElement(BtIconChevronRight2Px, null))),
|
|
40433
|
+
subTitle ? (React__default.createElement("span", { className: "arc-SiteHeaderV2SubNavItem-linkSubTitle" }, subTitle)) : null));
|
|
40434
|
+
return (React__default.createElement("li", __assign({ className: classNames((_b = {},
|
|
40435
|
+
_b["arc-SiteHeaderV2SubNavItem"] = true,
|
|
40436
|
+
_b["arc-SiteHeaderV2SubNavItem--linkSelected"] = children && panelOpen,
|
|
40437
|
+
_b["arc-SiteHeaderV2SubNavItem--linkNotSelected"] = children && !panelOpen,
|
|
40438
|
+
_b[suffixModifier("arc-SiteHeaderV2SubNavItem--offsetXL", offsetXL || "")] = offsetXL,
|
|
40439
|
+
_b)), ref: subNavItem }, filterDataAttrs(props), { "data-default-item": isDefaultItem || null }), !children ? (href ? (React__default.createElement("a", { className: "arc-SiteHeaderV2SubNavItem-link", onClick: handleLinkClick({ handler: onClick }), href: href }, linkTitle)) : null) : (React__default.createElement(React__default.Fragment, null,
|
|
40440
|
+
React__default.createElement("button", { "aria-expanded": panelOpen, className: classNames((_c = {},
|
|
40441
|
+
_c["arc-SiteHeaderV2SubNavItem-link"] = true,
|
|
40442
|
+
_c["arc-SiteHeaderV2SubNavItem-link--itemHasChildren"] = children,
|
|
40443
|
+
_c)), onClick: function (e) {
|
|
40444
|
+
e.preventDefault();
|
|
40445
|
+
setPanelOpen(true);
|
|
40446
|
+
setFade(true);
|
|
40447
|
+
}, onAnimationEnd: function () { return setFade(false); } },
|
|
40448
|
+
React__default.createElement("div", { className: "arc-SiteHeaderV2SubNavItem-icon" },
|
|
40449
|
+
icon && (React__default.createElement("span", { className: "arc-SiteHeaderV2SubNavItem-panelIcon" }, isMinWidthArcBreakpointL && React__default.createElement(Icon, { icon: icon, size: 48 }))),
|
|
40450
|
+
React__default.createElement("span", { "data-cy": "linkTitle", className: "arc-SiteHeaderV2SubNavItem-title" }, linkTitle))),
|
|
40451
|
+
React__default.createElement(Panel, { navItemRef: navItem, open: panelOpen, setOpen: setPanelOpen, subNavItemRef: subNavItem, subNavLink: "arc-SiteHeaderV2SubNavItem-link", title: React__default.createElement("span", null,
|
|
40452
|
+
title,
|
|
40453
|
+
subTitle && (React__default.createElement(Text, { size: "xs", tone: "supporting" }, subTitle))), viewAll: href ? (React__default.createElement(Panel.ViewAll, { href: href, onClick: onClick, title: viewAllTitle || "See all ".concat(title), fill: "outlined" })) : undefined, isNavItem: false, fade: fade }, children)))));
|
|
40454
|
+
};
|
|
40455
|
+
|
|
40456
|
+
var VerticalDivider = function () {
|
|
40457
|
+
return React__default.createElement("li", { className: "arc-SiteHeaderV2VerticalDivider-line" });
|
|
40458
|
+
};
|
|
40459
|
+
|
|
40460
|
+
var defaultContext = { transparent: false };
|
|
40461
|
+
var Context = createContext(defaultContext);
|
|
40462
|
+
var Provider = Context.Provider;
|
|
40463
|
+
/**
|
|
40464
|
+
* Use `SiteHeaderV2` to display brand logo and navigation at the top of a page.
|
|
40465
|
+
*/
|
|
40466
|
+
var SiteHeaderV2 = function (_a) {
|
|
40467
|
+
var _b;
|
|
40468
|
+
var children = _a.children, basket = _a.basket, _c = _a.hasLogin, hasLogin = _c === void 0 ? true : _c, _d = _a.isTransparent, isTransparent = _d === void 0 ? false : _d, _e = _a.loginHref, loginHref = _e === void 0 ? "/login" : _e, logoOnClick = _a.logoOnClick, loginOnClick = _a.loginOnClick, _f = _a.loginTitle, loginTitle = _f === void 0 ? "Log in / Register" : _f, _g = _a.logoHref, logoHref = _g === void 0 ? "/" : _g, _h = _a.logoLabel, logoLabel = _h === void 0 ? "Home" : _h, search = _a.search, subBrand = _a.subBrand, props = __rest(_a, ["children", "basket", "hasLogin", "isTransparent", "loginHref", "logoOnClick", "loginOnClick", "loginTitle", "logoHref", "logoLabel", "search", "subBrand"]);
|
|
40469
|
+
var _j = useState(false), hasClientSideJavaScript = _j[0], setHasClientSideJavaScript = _j[1];
|
|
40470
|
+
var _k = useState(false), menuOpen = _k[0], setMenuOpen = _k[1];
|
|
40471
|
+
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
40472
|
+
useEffect(function () {
|
|
40473
|
+
React__default.Children.map(children, function (item) {
|
|
40474
|
+
if (item &&
|
|
40475
|
+
item.type !== NodeItem &&
|
|
40476
|
+
item.type !== NavItem &&
|
|
40477
|
+
item.type !== NavItemWithSubNav &&
|
|
40478
|
+
item.type !== Fragment) {
|
|
40479
|
+
throw new Error("Illegal child passed to <SiteHeaderV2 />. Ensure to only use <SiteHeaderV2.NavItem /> or <SiteHeaderV2.NavItemWithSubNav />");
|
|
40480
|
+
}
|
|
40481
|
+
});
|
|
40482
|
+
}, [children]);
|
|
40483
|
+
useEffect(function () {
|
|
40484
|
+
if (!isMinWidthArcBreakpointL && menuOpen) {
|
|
40485
|
+
document.body.classList.add("arc-body--overflowHidden");
|
|
40486
|
+
}
|
|
40487
|
+
else {
|
|
40488
|
+
document.body.classList.remove("arc-body--overflowHidden");
|
|
40489
|
+
}
|
|
40490
|
+
return function () {
|
|
40491
|
+
document.body.classList.remove("arc-body--overflowHidden");
|
|
40492
|
+
};
|
|
40493
|
+
}, [isMinWidthArcBreakpointL, menuOpen]);
|
|
40494
|
+
useEffect(function () {
|
|
40495
|
+
var handleKeydown = function (e) {
|
|
40496
|
+
if (e.key === "Escape" || e.keyCode === 27) {
|
|
40497
|
+
setMenuOpen(false);
|
|
40498
|
+
}
|
|
40499
|
+
};
|
|
40500
|
+
window.addEventListener("keydown", handleKeydown);
|
|
40501
|
+
return function () {
|
|
40502
|
+
window.removeEventListener("keydown", handleKeydown);
|
|
40503
|
+
};
|
|
40504
|
+
}, [setMenuOpen]);
|
|
40505
|
+
useEffect(function () {
|
|
40506
|
+
var handleClick = function (e) {
|
|
40507
|
+
if (e.target.getAttribute("href")) {
|
|
40508
|
+
setMenuOpen(false);
|
|
40509
|
+
}
|
|
40510
|
+
};
|
|
40511
|
+
document.addEventListener("click", handleClick);
|
|
40512
|
+
return function () {
|
|
40513
|
+
document.removeEventListener("click", handleClick);
|
|
40514
|
+
};
|
|
40515
|
+
}, [setMenuOpen]);
|
|
40516
|
+
useEffect(function () {
|
|
40517
|
+
// useEffect does not run in ReactDomServer renders
|
|
40518
|
+
setHasClientSideJavaScript(true);
|
|
40519
|
+
}, [setHasClientSideJavaScript]);
|
|
40520
|
+
return (React__default.createElement(Provider, { value: { transparent: isTransparent } },
|
|
40521
|
+
React__default.createElement("div", __assign({ className: classNames((_b = {},
|
|
40522
|
+
_b["arc-SiteHeaderV2"] = true,
|
|
40523
|
+
_b["arc-SiteHeaderV2--menuOpen"] = menuOpen,
|
|
40524
|
+
_b["arc-no-js"] = !hasClientSideJavaScript,
|
|
40525
|
+
_b)) }, filterDataAttrs(props), { "data-transparent": isTransparent || null }),
|
|
40526
|
+
React__default.createElement(Surface, { background: !isTransparent || (menuOpen && !isMinWidthArcBreakpointL)
|
|
40527
|
+
? "brand-flat"
|
|
40528
|
+
: undefined },
|
|
40529
|
+
React__default.createElement("div", { className: "arc-SiteHeaderV2-inner" },
|
|
40530
|
+
React__default.createElement("a", { className: "arc-SiteHeaderV2-brand", onClick: handleLinkClick({
|
|
40531
|
+
handler: logoOnClick
|
|
40532
|
+
}), href: logoHref },
|
|
40533
|
+
React__default.createElement(BrandLogo, { label: logoLabel, subBrand: subBrand, size: 40 })),
|
|
40534
|
+
children && (React__default.createElement("nav", { className: "arc-SiteHeaderV2-nav" },
|
|
40535
|
+
React__default.createElement("div", { className: "arc-SiteHeaderV2-menuButton" },
|
|
40536
|
+
React__default.createElement(MenuButton, { menuOpen: menuOpen, setMenuOpen: setMenuOpen })),
|
|
40537
|
+
React__default.createElement("div", { className: "arc-SiteHeaderV2-main" },
|
|
40538
|
+
React__default.createElement("ul", { className: "arc-SiteHeaderV2-navItems" }, children),
|
|
40539
|
+
hasLogin && (React__default.createElement(React__default.Fragment, null, loginOnClick ? (React__default.createElement("div", { className: "arc-SiteHeaderV2-mobileButtonContainer" },
|
|
40540
|
+
React__default.createElement("button", { className: "arc-SiteHeaderV2-mobileLogin", onClick: loginOnClick },
|
|
40541
|
+
loginTitle,
|
|
40542
|
+
React__default.createElement("span", { className: "arc-SiteHeaderV2-mobileChevron" },
|
|
40543
|
+
React__default.createElement(BtIconChevronRight2Px, null))))) : (React__default.createElement("div", { className: "arc-SiteHeaderV2-mobileButtonContainer" },
|
|
40544
|
+
React__default.createElement("a", { className: "arc-SiteHeaderV2-mobileLogin", href: loginHref },
|
|
40545
|
+
loginTitle,
|
|
40546
|
+
React__default.createElement("span", { className: "arc-SiteHeaderV2-mobileChevron" },
|
|
40547
|
+
React__default.createElement(BtIconChevronRight2Px, null)))))))))),
|
|
40548
|
+
(basket || hasLogin || search) && (React__default.createElement("div", { className: "arc-SiteHeaderV2-secondary" },
|
|
40549
|
+
search ? (React__default.createElement("div", { className: "arc-SiteHeaderV2-search" }, search)) : null,
|
|
40550
|
+
basket ? (React__default.createElement("div", { className: "arc-SiteHeaderV2-basket" }, basket)) : null,
|
|
40551
|
+
hasLogin && (React__default.createElement(React__default.Fragment, null, loginOnClick ? (React__default.createElement("div", { className: "arc-SiteHeaderV2-loginLink arc-SiteHeaderV2-loginLink--function", onClick: loginOnClick }, loginTitle)) : (React__default.createElement("a", { className: "arc-SiteHeaderV2-loginLink", href: loginHref }, loginTitle)))))))))));
|
|
40552
|
+
};
|
|
40553
|
+
SiteHeaderV2.Column = Column;
|
|
40554
|
+
SiteHeaderV2.Item = Item;
|
|
40555
|
+
SiteHeaderV2.ItemGroup = ItemGroup;
|
|
40556
|
+
SiteHeaderV2.NavItem = NavItem;
|
|
40557
|
+
SiteHeaderV2.NodeItem = NodeItem;
|
|
40558
|
+
SiteHeaderV2.NavItemWithSubNav = NavItemWithSubNav;
|
|
40559
|
+
SiteHeaderV2.SubNavItem = SubNavItem;
|
|
40560
|
+
SiteHeaderV2.VerticalDivider = VerticalDivider;
|
|
40561
|
+
|
|
40471
40562
|
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
|
|
40472
40563
|
return function handleEvent(event) {
|
|
40473
40564
|
originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
|
|
@@ -40957,11 +41048,11 @@ const $6be4966fd9bbc698$export$6521433ed15a34db = $6be4966fd9bbc698$export$4d07b
|
|
|
40957
41048
|
/** Use `Switch` to toggle between checked and not checked. */
|
|
40958
41049
|
var Switch = function (_a) {
|
|
40959
41050
|
var defaultChecked = _a.defaultChecked, onCheckedChange = _a.onCheckedChange, label = _a.label, name = _a.name, onBlur = _a.onBlur, value = _a.value, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, errorMessage = _a.errorMessage, id = _a.id, _c = _a.labelSize, labelSize = _c === void 0 ? "s" : _c, statusText = _a.statusText, _d = _a.hideLabel, hideLabel = _d === void 0 ? false : _d, props = __rest(_a, ["defaultChecked", "onCheckedChange", "label", "name", "onBlur", "value", "isDisabled", "errorMessage", "id", "labelSize", "statusText", "hideLabel"]);
|
|
40960
|
-
var surface = useContext(Context$
|
|
40961
|
-
return (React__default.createElement(FormControl, { errorMessage: errorMessage, htmlFor: id, isDisabled: isDisabled, label: hideLabel
|
|
41051
|
+
var surface = useContext(Context$5).surface;
|
|
41052
|
+
return (React__default.createElement(FormControl, { errorMessage: errorMessage, htmlFor: id, isDisabled: isDisabled, label: label, hideLabel: hideLabel, labelSize: labelSize, requirementStatus: "not-applicable" },
|
|
40962
41053
|
!hideLabel && React__default.createElement(VerticalSpace, { size: "8" }),
|
|
40963
41054
|
React__default.createElement("div", { className: "arc-Switch-container" },
|
|
40964
|
-
React__default.createElement($6be4966fd9bbc698$export$be92b6f5f03c0fe9, __assign({ id: id,
|
|
41055
|
+
React__default.createElement($6be4966fd9bbc698$export$be92b6f5f03c0fe9, __assign({ id: id, defaultChecked: defaultChecked, name: name, value: value, onBlur: onBlur, onCheckedChange: onCheckedChange, disabled: isDisabled, className: classNames("arc-Switch", {
|
|
40965
41056
|
"arc-Switch--large": labelSize === "l",
|
|
40966
41057
|
"arc-Switch--isDisabled": isDisabled,
|
|
40967
41058
|
"arc-Switch--onDarkSurface": surface === "dark"
|
|
@@ -41350,7 +41441,7 @@ const $69cb30bb0017df05$export$7c6e2c02157bb7d2 = $69cb30bb0017df05$export$bd905
|
|
|
41350
41441
|
|
|
41351
41442
|
var Tab = function (_a) {
|
|
41352
41443
|
var label = _a.label, value = _a.value, icon = _a.icon, iconActive = _a.iconActive, props = __rest(_a, ["label", "value", "icon", "iconActive"]);
|
|
41353
|
-
var surface = useContext(Context$
|
|
41444
|
+
var surface = useContext(Context$5).surface;
|
|
41354
41445
|
return (React__default.createElement($69cb30bb0017df05$export$41fb9f06171c75f4, __assign({ className: classNames("arc-Tab-trigger", {
|
|
41355
41446
|
"arc-Tab-trigger--onDarkSurface": surface === "dark",
|
|
41356
41447
|
"arc-Tab-trigger--hasIcon": icon || iconActive
|
|
@@ -41386,7 +41477,7 @@ const BtIconArrowLeftFill = (props) =>
|
|
|
41386
41477
|
|
|
41387
41478
|
var TabsList = function (_a) {
|
|
41388
41479
|
var children = _a.children, type = _a.type, isJustified = _a.isJustified, ariaLabel = _a.ariaLabel, props = __rest(_a, ["children", "type", "isJustified", "ariaLabel"]);
|
|
41389
|
-
var surface = useContext(Context$
|
|
41480
|
+
var surface = useContext(Context$5).surface;
|
|
41390
41481
|
var tabsRef = useRef(null);
|
|
41391
41482
|
var _b = useState(false), rightOverflow = _b[0], setRightOverflow = _b[1];
|
|
41392
41483
|
var _c = useState(false), leftOverflow = _c[0], setLeftOverflow = _c[1];
|
|
@@ -41444,8 +41535,8 @@ Tabs.Content = TabContent;
|
|
|
41444
41535
|
|
|
41445
41536
|
/** Use `TextArea` to allow custom user text entry via keyboard, for long-form and multi-line descriptions */
|
|
41446
41537
|
var TextArea = forwardRef(function (_a, ref) {
|
|
41447
|
-
var _b = _a.defaultValue, defaultValue = _b === void 0 ? "" : _b, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, _c = _a.resize, resize = _c === void 0 ? "manual" : _c, _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, _g = _a.showCharacterCount, showCharacterCount = _g === void 0 ? true : _g, label = _a.label, _h = _a.labelSize, labelSize = _h === void 0 ? "l" : _h, maxLength = _a.maxLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, props = __rest(_a, ["defaultValue", "errorMessage", "helper", "id", "resize", "isDisabled", "isReadOnly", "isRequired", "showCharacterCount", "label", "labelSize", "maxLength", "name", "onBlur", "onChange", "onClickDisclosure", "value", "disclosureTitle", "disclosureText"]);
|
|
41448
|
-
var surface = useContext(Context$
|
|
41538
|
+
var _b = _a.defaultValue, defaultValue = _b === void 0 ? "" : _b, errorMessage = _a.errorMessage, helper = _a.helper, hideLabel = _a.hideLabel, id = _a.id, _c = _a.resize, resize = _c === void 0 ? "manual" : _c, _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, _g = _a.showCharacterCount, showCharacterCount = _g === void 0 ? true : _g, label = _a.label, _h = _a.labelSize, labelSize = _h === void 0 ? "l" : _h, maxLength = _a.maxLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, width = _a.width, props = __rest(_a, ["defaultValue", "errorMessage", "helper", "hideLabel", "id", "resize", "isDisabled", "isReadOnly", "isRequired", "showCharacterCount", "label", "labelSize", "maxLength", "name", "onBlur", "onChange", "onClickDisclosure", "value", "disclosureTitle", "disclosureText", "width"]);
|
|
41539
|
+
var surface = useContext(Context$5).surface;
|
|
41449
41540
|
var ourRef = useRef(null);
|
|
41450
41541
|
var _j = useState((value && value.length) || (defaultValue && defaultValue.length) || 0), characterCount = _j[0], setCharacterCount = _j[1];
|
|
41451
41542
|
var setSmartHeight = function (el) {
|
|
@@ -41467,7 +41558,7 @@ var TextArea = forwardRef(function (_a, ref) {
|
|
|
41467
41558
|
onChange && onChange(e);
|
|
41468
41559
|
setCharacterCount(e.target.value.length);
|
|
41469
41560
|
};
|
|
41470
|
-
return (React__default.createElement(FormControl, __assign({ errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure, supplementaryInfo: maxLength &&
|
|
41561
|
+
return (React__default.createElement(FormControl, __assign({ errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, hideLabel: hideLabel, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure, supplementaryInfo: maxLength &&
|
|
41471
41562
|
showCharacterCount && (React__default.createElement(React__default.Fragment, null,
|
|
41472
41563
|
React__default.createElement(Text, { tone: isDisabled ? "muted" : "default" },
|
|
41473
41564
|
React__default.createElement("span", { className: "arc-TextArea-characterCount" },
|
|
@@ -41478,7 +41569,7 @@ var TextArea = forwardRef(function (_a, ref) {
|
|
|
41478
41569
|
"arc-TextArea--noResize": resize !== "manual",
|
|
41479
41570
|
"arc-TextArea--onDarkSurface": surface === "dark",
|
|
41480
41571
|
"arc-TextArea--invalid": errorMessage
|
|
41481
|
-
}), defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled, value: value, readOnly: isReadOnly, maxLength: maxLength, name: name, onChange: handleOnChange, onBlur: onBlur, ref: getTextAreaRef })));
|
|
41572
|
+
}), defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled, value: value, readOnly: isReadOnly, maxLength: maxLength, name: name, onChange: handleOnChange, onBlur: onBlur, ref: getTextAreaRef, style: { width: width } })));
|
|
41482
41573
|
});
|
|
41483
41574
|
|
|
41484
41575
|
/**
|
|
@@ -41486,8 +41577,8 @@ var TextArea = forwardRef(function (_a, ref) {
|
|
|
41486
41577
|
*/
|
|
41487
41578
|
var TextInput = forwardRef(function (_a, ref) {
|
|
41488
41579
|
var _b;
|
|
41489
|
-
var _c = _a.defaultValue, defaultValue = _c === void 0 ? "" : _c, errorMessage = _a.errorMessage, helper = _a.helper, 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, _g = _a.labelSize, labelSize = _g === void 0 ? "l" : _g, maxLength = _a.maxLength, minLength = _a.minLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, pattern = _a.pattern, _h = _a.type, type = _h === void 0 ? "text" : _h, _j = _a.showPassword, showPassword = _j === void 0 ? false : _j, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, _k = _a.inputSize, inputSize = _k === void 0 ? "m" : _k, prefix = _a.prefix, suffix = _a.suffix, _l = _a.inputAlignment, inputAlignment = _l === void 0 ? "left" : _l, props = __rest(_a, ["defaultValue", "errorMessage", "helper", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "labelSize", "maxLength", "minLength", "name", "onBlur", "onChange", "onClickDisclosure", "pattern", "type", "showPassword", "value", "disclosureTitle", "disclosureText", "inputSize", "prefix", "suffix", "inputAlignment"]);
|
|
41490
|
-
var surface = useContext(Context$
|
|
41580
|
+
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, _g = _a.labelSize, labelSize = _g === void 0 ? "l" : _g, maxLength = _a.maxLength, minLength = _a.minLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, placeholder = _a.placeholder, onClickDisclosure = _a.onClickDisclosure, pattern = _a.pattern, _h = _a.type, type = _h === void 0 ? "text" : _h, _j = _a.showPassword, showPassword = _j === void 0 ? false : _j, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, _k = _a.inputSize, inputSize = _k === void 0 ? "m" : _k, iconButton = _a.iconButton, prefix = _a.prefix, suffix = _a.suffix, _l = _a.inputAlignment, inputAlignment = _l === void 0 ? "left" : _l, width = _a.width, props = __rest(_a, ["defaultValue", "errorMessage", "helper", "hideLabel", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "labelSize", "maxLength", "minLength", "name", "onBlur", "onChange", "placeholder", "onClickDisclosure", "pattern", "type", "showPassword", "value", "disclosureTitle", "disclosureText", "inputSize", "iconButton", "prefix", "suffix", "inputAlignment", "width"]);
|
|
41581
|
+
var surface = useContext(Context$5).surface;
|
|
41491
41582
|
var _m = useState(false), showPasswordToggle = _m[0], setShowPasswordToggle = _m[1];
|
|
41492
41583
|
var inferredInputProps = useNumericInput({
|
|
41493
41584
|
inputMode: inputMode,
|
|
@@ -41501,8 +41592,14 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
41501
41592
|
helper: helper,
|
|
41502
41593
|
disclosureText: disclosureText
|
|
41503
41594
|
}).ariaDescribedby;
|
|
41595
|
+
var buttonIconSize = {
|
|
41596
|
+
s: 24,
|
|
41597
|
+
m: 32,
|
|
41598
|
+
l: 40
|
|
41599
|
+
};
|
|
41504
41600
|
return (React__default.createElement("div", __assign({ className: classNames((_b = {
|
|
41505
41601
|
"arc-TextInput": true,
|
|
41602
|
+
"arc-TextInput--withAdditionalControl": showPassword || iconButton,
|
|
41506
41603
|
"arc-TextInput--alignRight": inputAlignment === "right",
|
|
41507
41604
|
"arc-TextInput--withPasswordToggle": showPassword,
|
|
41508
41605
|
"arc-TextInput--isDisabled": isDisabled,
|
|
@@ -41513,12 +41610,18 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
41513
41610
|
},
|
|
41514
41611
|
_b["arc-TextInput--size".concat(inputSize && inputSize.toUpperCase())] = inputSize && inputSize !== "m",
|
|
41515
41612
|
_b)) }, filterDataAttrs(props)),
|
|
41516
|
-
React__default.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure },
|
|
41517
|
-
React__default.createElement("div", { className: "arc-TextInput-inputWrapper" },
|
|
41613
|
+
React__default.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, hideLabel: hideLabel, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure },
|
|
41614
|
+
React__default.createElement("div", { className: "arc-TextInput-inputWrapper", style: { width: width } },
|
|
41518
41615
|
prefix && (React__default.createElement("span", { className: "arc-TextInput-prefix", "aria-hidden": true }, prefix)),
|
|
41519
|
-
React__default.createElement("input", __assign({ "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, readOnly: isReadOnly, ref: ref, required: isRequired, value: typeof value !== "undefined" ? value : undefined }, inferredInputProps)),
|
|
41616
|
+
React__default.createElement("input", __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, readOnly: isReadOnly, ref: ref, required: isRequired, value: typeof value !== "undefined" ? value : undefined }, inferredInputProps)),
|
|
41617
|
+
iconButton && !showPassword && (React__default.createElement("div", { className: "arc-TextInput-additionalControl" },
|
|
41618
|
+
React__default.createElement("button", { ref: iconButton.ref, className: "arc-TextInput-iconButton", disabled: isReadOnly || isDisabled, "aria-label": iconButton.label, onFocus: iconButton.onFocus, onClick: function (e) {
|
|
41619
|
+
e.preventDefault();
|
|
41620
|
+
iconButton.onClick();
|
|
41621
|
+
} },
|
|
41622
|
+
React__default.createElement(Icon, { icon: iconButton.icon, size: buttonIconSize[inputSize] })))),
|
|
41520
41623
|
suffix && !showPassword ? (React__default.createElement("span", { className: "arc-TextInput-suffix", "aria-hidden": true }, suffix)) : null,
|
|
41521
|
-
showPassword && (React__default.createElement(
|
|
41624
|
+
showPassword && (React__default.createElement("div", { className: "arc-TextInput-additionalControl" },
|
|
41522
41625
|
React__default.createElement("button", { className: "arc-TextInput-passwordToggle", onClick: function () { return setShowPasswordToggle(function (p) { return !p; }); }, type: "button" }, showPasswordToggle ? "Hide" : "Show"),
|
|
41523
41626
|
React__default.createElement(VisuallyHidden, null,
|
|
41524
41627
|
React__default.createElement("div", { "aria-live": "polite" },
|
|
@@ -41527,6 +41630,263 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
41527
41630
|
: "Your password is hidden")))))))));
|
|
41528
41631
|
});
|
|
41529
41632
|
|
|
41633
|
+
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
41634
|
+
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
41635
|
+
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
41636
|
+
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
41637
|
+
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ createContext({
|
|
41638
|
+
layers: new Set(),
|
|
41639
|
+
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
41640
|
+
branches: new Set()
|
|
41641
|
+
});
|
|
41642
|
+
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
41643
|
+
var _node$ownerDocument;
|
|
41644
|
+
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
41645
|
+
const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
41646
|
+
const [node1, setNode] = useState(null);
|
|
41647
|
+
const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
|
|
41648
|
+
const [, force] = useState({});
|
|
41649
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setNode(node)
|
|
41650
|
+
);
|
|
41651
|
+
const layers = Array.from(context.layers);
|
|
41652
|
+
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
41653
|
+
...context.layersWithOutsidePointerEventsDisabled
|
|
41654
|
+
].slice(-1); // prettier-ignore
|
|
41655
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
|
|
41656
|
+
const index = node1 ? layers.indexOf(node1) : -1;
|
|
41657
|
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
41658
|
+
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
41659
|
+
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
41660
|
+
const target = event.target;
|
|
41661
|
+
const isPointerDownOnBranch = [
|
|
41662
|
+
...context.branches
|
|
41663
|
+
].some((branch)=>branch.contains(target)
|
|
41664
|
+
);
|
|
41665
|
+
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
41666
|
+
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
41667
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
41668
|
+
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
41669
|
+
}, ownerDocument);
|
|
41670
|
+
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
41671
|
+
const target = event.target;
|
|
41672
|
+
const isFocusInBranch = [
|
|
41673
|
+
...context.branches
|
|
41674
|
+
].some((branch)=>branch.contains(target)
|
|
41675
|
+
);
|
|
41676
|
+
if (isFocusInBranch) return;
|
|
41677
|
+
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
|
|
41678
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
41679
|
+
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
41680
|
+
}, ownerDocument);
|
|
41681
|
+
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
41682
|
+
const isHighestLayer = index === context.layers.size - 1;
|
|
41683
|
+
if (!isHighestLayer) return;
|
|
41684
|
+
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
41685
|
+
if (!event.defaultPrevented && onDismiss) {
|
|
41686
|
+
event.preventDefault();
|
|
41687
|
+
onDismiss();
|
|
41688
|
+
}
|
|
41689
|
+
}, ownerDocument);
|
|
41690
|
+
useEffect(()=>{
|
|
41691
|
+
if (!node1) return;
|
|
41692
|
+
if (disableOutsidePointerEvents) {
|
|
41693
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
41694
|
+
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
41695
|
+
ownerDocument.body.style.pointerEvents = 'none';
|
|
41696
|
+
}
|
|
41697
|
+
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
41698
|
+
}
|
|
41699
|
+
context.layers.add(node1);
|
|
41700
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
41701
|
+
return ()=>{
|
|
41702
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
41703
|
+
};
|
|
41704
|
+
}, [
|
|
41705
|
+
node1,
|
|
41706
|
+
ownerDocument,
|
|
41707
|
+
disableOutsidePointerEvents,
|
|
41708
|
+
context
|
|
41709
|
+
]);
|
|
41710
|
+
/**
|
|
41711
|
+
* We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
|
|
41712
|
+
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
|
41713
|
+
* and add it to the end again so the layering order wouldn't be _creation order_.
|
|
41714
|
+
* We only want them to be removed from context stacks when unmounted.
|
|
41715
|
+
*/ useEffect(()=>{
|
|
41716
|
+
return ()=>{
|
|
41717
|
+
if (!node1) return;
|
|
41718
|
+
context.layers.delete(node1);
|
|
41719
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
41720
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
41721
|
+
};
|
|
41722
|
+
}, [
|
|
41723
|
+
node1,
|
|
41724
|
+
context
|
|
41725
|
+
]);
|
|
41726
|
+
useEffect(()=>{
|
|
41727
|
+
const handleUpdate = ()=>force({})
|
|
41728
|
+
;
|
|
41729
|
+
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
41730
|
+
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
41731
|
+
;
|
|
41732
|
+
}, []);
|
|
41733
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, layerProps, {
|
|
41734
|
+
ref: composedRefs,
|
|
41735
|
+
style: {
|
|
41736
|
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
41737
|
+
...props.style
|
|
41738
|
+
},
|
|
41739
|
+
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
41740
|
+
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
41741
|
+
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
41742
|
+
}));
|
|
41743
|
+
});
|
|
41744
|
+
const $5cb92bef7577960e$export$4d5eb2109db14228 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
41745
|
+
const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
41746
|
+
const ref = useRef(null);
|
|
41747
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
41748
|
+
useEffect(()=>{
|
|
41749
|
+
const node = ref.current;
|
|
41750
|
+
if (node) {
|
|
41751
|
+
context.branches.add(node);
|
|
41752
|
+
return ()=>{
|
|
41753
|
+
context.branches.delete(node);
|
|
41754
|
+
};
|
|
41755
|
+
}
|
|
41756
|
+
}, [
|
|
41757
|
+
context.branches
|
|
41758
|
+
]);
|
|
41759
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, props, {
|
|
41760
|
+
ref: composedRefs
|
|
41761
|
+
}));
|
|
41762
|
+
});
|
|
41763
|
+
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
41764
|
+
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
41765
|
+
* to mimic layer dismissing behaviour present in OS.
|
|
41766
|
+
* Returns props to pass to the node we want to check for outside events.
|
|
41767
|
+
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
41768
|
+
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onPointerDownOutside);
|
|
41769
|
+
const isPointerInsideReactTreeRef = useRef(false);
|
|
41770
|
+
const handleClickRef = useRef(()=>{});
|
|
41771
|
+
useEffect(()=>{
|
|
41772
|
+
const handlePointerDown = (event)=>{
|
|
41773
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
41774
|
+
const eventDetail = {
|
|
41775
|
+
originalEvent: event
|
|
41776
|
+
};
|
|
41777
|
+
function handleAndDispatchPointerDownOutsideEvent() {
|
|
41778
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
41779
|
+
discrete: true
|
|
41780
|
+
});
|
|
41781
|
+
}
|
|
41782
|
+
/**
|
|
41783
|
+
* On touch devices, we need to wait for a click event because browsers implement
|
|
41784
|
+
* a ~350ms delay between the time the user stops touching the display and when the
|
|
41785
|
+
* browser executres events. We need to ensure we don't reactivate pointer-events within
|
|
41786
|
+
* this timeframe otherwise the browser may execute events that should have been prevented.
|
|
41787
|
+
*
|
|
41788
|
+
* Additionally, this also lets us deal automatically with cancellations when a click event
|
|
41789
|
+
* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
|
|
41790
|
+
*
|
|
41791
|
+
* This is why we also continuously remove the previous listener, because we cannot be
|
|
41792
|
+
* certain that it was raised, and therefore cleaned-up.
|
|
41793
|
+
*/ if (event.pointerType === 'touch') {
|
|
41794
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
41795
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
41796
|
+
ownerDocument.addEventListener('click', handleClickRef.current, {
|
|
41797
|
+
once: true
|
|
41798
|
+
});
|
|
41799
|
+
} else handleAndDispatchPointerDownOutsideEvent();
|
|
41800
|
+
}
|
|
41801
|
+
isPointerInsideReactTreeRef.current = false;
|
|
41802
|
+
};
|
|
41803
|
+
/**
|
|
41804
|
+
* if this hook executes in a component that mounts via a `pointerdown` event, the event
|
|
41805
|
+
* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
|
|
41806
|
+
* this by delaying the event listener registration on the document.
|
|
41807
|
+
* This is not React specific, but rather how the DOM works, ie:
|
|
41808
|
+
* ```
|
|
41809
|
+
* button.addEventListener('pointerdown', () => {
|
|
41810
|
+
* console.log('I will log');
|
|
41811
|
+
* document.addEventListener('pointerdown', () => {
|
|
41812
|
+
* console.log('I will also log');
|
|
41813
|
+
* })
|
|
41814
|
+
* });
|
|
41815
|
+
*/ const timerId = window.setTimeout(()=>{
|
|
41816
|
+
ownerDocument.addEventListener('pointerdown', handlePointerDown);
|
|
41817
|
+
}, 0);
|
|
41818
|
+
return ()=>{
|
|
41819
|
+
window.clearTimeout(timerId);
|
|
41820
|
+
ownerDocument.removeEventListener('pointerdown', handlePointerDown);
|
|
41821
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
41822
|
+
};
|
|
41823
|
+
}, [
|
|
41824
|
+
ownerDocument,
|
|
41825
|
+
handlePointerDownOutside
|
|
41826
|
+
]);
|
|
41827
|
+
return {
|
|
41828
|
+
// ensures we check React component tree (not just DOM tree)
|
|
41829
|
+
onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
|
|
41830
|
+
};
|
|
41831
|
+
}
|
|
41832
|
+
/**
|
|
41833
|
+
* Listens for when focus happens outside a react subtree.
|
|
41834
|
+
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
41835
|
+
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
41836
|
+
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onFocusOutside);
|
|
41837
|
+
const isFocusInsideReactTreeRef = useRef(false);
|
|
41838
|
+
useEffect(()=>{
|
|
41839
|
+
const handleFocus = (event)=>{
|
|
41840
|
+
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
41841
|
+
const eventDetail = {
|
|
41842
|
+
originalEvent: event
|
|
41843
|
+
};
|
|
41844
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
41845
|
+
discrete: false
|
|
41846
|
+
});
|
|
41847
|
+
}
|
|
41848
|
+
};
|
|
41849
|
+
ownerDocument.addEventListener('focusin', handleFocus);
|
|
41850
|
+
return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
|
|
41851
|
+
;
|
|
41852
|
+
}, [
|
|
41853
|
+
ownerDocument,
|
|
41854
|
+
handleFocusOutside
|
|
41855
|
+
]);
|
|
41856
|
+
return {
|
|
41857
|
+
onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
|
|
41858
|
+
,
|
|
41859
|
+
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
41860
|
+
};
|
|
41861
|
+
}
|
|
41862
|
+
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
41863
|
+
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
41864
|
+
document.dispatchEvent(event);
|
|
41865
|
+
}
|
|
41866
|
+
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
41867
|
+
const target = detail.originalEvent.target;
|
|
41868
|
+
const event = new CustomEvent(name, {
|
|
41869
|
+
bubbles: false,
|
|
41870
|
+
cancelable: true,
|
|
41871
|
+
detail: detail
|
|
41872
|
+
});
|
|
41873
|
+
if (handler) target.addEventListener(name, handler, {
|
|
41874
|
+
once: true
|
|
41875
|
+
});
|
|
41876
|
+
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
41877
|
+
else target.dispatchEvent(event);
|
|
41878
|
+
}
|
|
41879
|
+
const $5cb92bef7577960e$export$be92b6f5f03c0fe9 = $5cb92bef7577960e$export$177fb62ff3ec1f22;
|
|
41880
|
+
const $5cb92bef7577960e$export$aecb2ddcb55c95be = $5cb92bef7577960e$export$4d5eb2109db14228;
|
|
41881
|
+
|
|
41882
|
+
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
41883
|
+
var _globalThis$document;
|
|
41884
|
+
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
|
|
41885
|
+
return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, portalProps, {
|
|
41886
|
+
ref: forwardedRef
|
|
41887
|
+
})), container) : null;
|
|
41888
|
+
});
|
|
41889
|
+
|
|
41530
41890
|
/* -------------------------------------------------------------------------------------------------
|
|
41531
41891
|
* ToastProvider
|
|
41532
41892
|
* -----------------------------------------------------------------------------------------------*/ const $054eb8030ebde76e$var$PROVIDER_NAME = 'ToastProvider';
|
|
@@ -42034,7 +42394,7 @@ $054eb8030ebde76e$var$ToastImpl.propTypes = {
|
|
|
42034
42394
|
return ()=>window.clearTimeout(timer)
|
|
42035
42395
|
;
|
|
42036
42396
|
}, []);
|
|
42037
|
-
return isAnnounced ? null : /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c
|
|
42397
|
+
return isAnnounced ? null : /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c, {
|
|
42038
42398
|
asChild: true
|
|
42039
42399
|
}, /*#__PURE__*/ createElement($ea1ef594cf570d83$export$439d29a4e110a164, announceProps, renderAnnounceText && /*#__PURE__*/ createElement(Fragment, null, context.label, " ", children)));
|
|
42040
42400
|
};
|
|
@@ -42223,37 +42583,21 @@ var Truncate = function (_a) {
|
|
|
42223
42583
|
return (React__default.createElement("div", __assign({ className: "arc-Truncate", style: { maxWidth: "".concat(maxWidth, "%") }, title: title }, filterDataAttrs(props)), children));
|
|
42224
42584
|
};
|
|
42225
42585
|
|
|
42226
|
-
// move arrow to right all the time when no meta text
|
|
42227
|
-
// 1 typography card + 2 media cards
|
|
42228
42586
|
var TypographyCard = function (_a) {
|
|
42229
42587
|
var url = _a.url, onClick = _a.onClick, heading = _a.heading, metaText = _a.metaText, label = _a.label, _b = _a.linkData, linkData = _b === void 0 ? {} : _b, _c = _a.pathway, pathway = _c === void 0 ? "light" : _c, _d = _a.buttonIcon, buttonIcon = _d === void 0 ? "arrow" : _d, _e = _a.headingLevel, headingLevel = _e === void 0 ? "2" : _e, props = __rest(_a, ["url", "onClick", "heading", "metaText", "label", "linkData", "pathway", "buttonIcon", "headingLevel"]);
|
|
42230
|
-
var
|
|
42231
|
-
var
|
|
42232
|
-
|
|
42233
|
-
regular: BtIconArrowRight,
|
|
42234
|
-
hover: BtIconArrowRightFill
|
|
42235
|
-
},
|
|
42236
|
-
play: {
|
|
42237
|
-
regular: BtIconPlay,
|
|
42238
|
-
hover: BtIconPlayFill
|
|
42239
|
-
}
|
|
42240
|
-
};
|
|
42588
|
+
var _f = useState(false), showHoverState = _f[0], setShowHoverState = _f[1];
|
|
42589
|
+
var handleShowHoverState = function (show) { return function () { return setShowHoverState(show); }; };
|
|
42590
|
+
var isDarkPathway = pathway === "dark";
|
|
42241
42591
|
return (React__default.createElement("div", __assign({ className: classNames("arc-TypographyCard", {
|
|
42242
|
-
"arc-TypographyCard--
|
|
42243
|
-
"arc-TypographyCard--
|
|
42592
|
+
"arc-TypographyCard--outlined": showHoverState,
|
|
42593
|
+
"arc-TypographyCard--darkPathway": isDarkPathway,
|
|
42594
|
+
"arc-TypographyCard--lightPathway": !isDarkPathway
|
|
42244
42595
|
}) }, filterDataAttrs(props)),
|
|
42245
42596
|
React__default.createElement("div", { className: "arc-TypographyCard-contentContainer" },
|
|
42246
42597
|
label && (React__default.createElement("div", { className: "arc-TypographyCard-labelContainer" },
|
|
42247
|
-
React__default.createElement(
|
|
42248
|
-
React__default.createElement(
|
|
42249
|
-
|
|
42250
|
-
React__default.createElement("div", { className: "arc-TypographyCard-footer" },
|
|
42251
|
-
React__default.createElement("div", { className: "arc-TypographyCard-metaTextContainer" }, metaText && (React__default.createElement("span", { className: "arc-TypographyCard-metaText" }, metaText))),
|
|
42252
|
-
React__default.createElement("div", { className: "arc-TypographyCard-footerButton" },
|
|
42253
|
-
React__default.createElement("div", { className: classNames("arc-TypographyCard-footerButtonIcon", "arc-TypographyCard-footerButtonIcon--regular") },
|
|
42254
|
-
React__default.createElement(Icon, { icon: icons[buttonIcon].regular, size: 40 })),
|
|
42255
|
-
React__default.createElement("div", { className: "arc-TypographyCard-footerButtonIcon arc-TypographyCard-footerButtonIcon--hover" },
|
|
42256
|
-
React__default.createElement(Icon, { icon: icons[buttonIcon].hover, size: 40 }))))));
|
|
42598
|
+
React__default.createElement(CardLabel, { isDarkPathway: isDarkPathway, isBold: false, text: label }))),
|
|
42599
|
+
React__default.createElement(CardHeading, { size: "m", linkData: linkData, heading: heading, headingLevel: headingLevel, href: url, onClick: onClick, isDarkPathway: isDarkPathway, onMouseEnter: handleShowHoverState(true), onMouseLeave: handleShowHoverState(false), onFocus: handleShowHoverState(true), onBlur: handleShowHoverState(false) })),
|
|
42600
|
+
React__default.createElement(CardFooter, { showButton: true, isDarkPathway: isDarkPathway, showFilledIcon: showHoverState, buttonIcon: buttonIcon, metaText: metaText })));
|
|
42257
42601
|
};
|
|
42258
42602
|
|
|
42259
42603
|
/**
|
|
@@ -42281,5 +42625,5 @@ var UniversalHeaderItem = function (_a) {
|
|
|
42281
42625
|
};
|
|
42282
42626
|
UniversalHeader.Item = UniversalHeaderItem;
|
|
42283
42627
|
|
|
42284
|
-
export { Alert, Align, Badge, Base, Box, BrandLogo, Breadcrumbs, Button, Card, Checkbox, Clock, Clock_rehydrator as ClockRehydrator, Columns, Curve, Disclosure, DisclosureMini, Elevation, Filter, FormControl, Group, Heading, Icon, Image, InformationCard, Markup, MediaCard, Modal, Pagination, PaginationSimple, Poster, ProgressBar, ProgressStepper, RadioGroup, Rule, ScrollToTop, Section, Select, SiteFooter, SiteFooter_rehydrator as SiteFooterRehydrator, SiteHeader, SiteHeaderRehydrator, Surface, Context$
|
|
42628
|
+
export { Alert, Align, Badge, Base, Box, BrandLogo, Breadcrumbs, Button, Card, Checkbox, Clock, Clock_rehydrator as ClockRehydrator, Columns, Curve, Disclosure, DisclosureMini, Elevation, Filter, FormControl, Group, Heading, Icon, Image, InformationCard, Markup, MediaCard, Modal, Pagination, PaginationSimple, Poster, ProgressBar, ProgressStepper, RadioGroup, Rule, ScrollToTop, Section, Select, SiteFooter, SiteFooter_rehydrator as SiteFooterRehydrator, SiteHeader, SiteHeaderRehydrator, SiteHeaderV2, Surface, Context$5 as SurfaceContext, Switch, Tabs, Tag, Text, TextArea, TextInput, Toast, Truncate, TypographyCard, UniversalHeader, VerticalSpace, VisuallyHidden };
|
|
42285
42629
|
//# sourceMappingURL=index.es.js.map
|