@arc-ui/components 11.2.0 → 11.3.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/Checkbox/Checkbox.cjs.js +8 -27
- package/dist/Checkbox/Checkbox.esm.js +3 -22
- package/dist/FormControl/FormControl.cjs.d.ts +1 -1
- package/dist/FormControl/FormControl.cjs.js +1 -1
- package/dist/FormControl/FormControl.esm.d.ts +1 -1
- package/dist/FormControl/FormControl.esm.js +1 -1
- package/dist/RadioGroup/RadioGroup.cjs.d.ts +2 -2
- package/dist/RadioGroup/RadioGroup.cjs.js +2 -2
- package/dist/RadioGroup/RadioGroup.esm.d.ts +2 -2
- package/dist/RadioGroup/RadioGroup.esm.js +2 -2
- package/dist/Select/Select.cjs.d.ts +2 -2
- package/dist/Select/Select.cjs.js +75 -74
- package/dist/Select/Select.esm.d.ts +2 -2
- package/dist/Select/Select.esm.js +3 -2
- package/dist/Switch/Switch.cjs.d.ts +1 -1
- package/dist/Switch/Switch.cjs.js +12 -11
- package/dist/Switch/Switch.esm.d.ts +1 -1
- package/dist/Switch/Switch.esm.js +3 -2
- package/dist/TextInput/TextInput.cjs.d.ts +2 -2
- package/dist/TextInput/TextInput.cjs.js +1 -1
- package/dist/TextInput/TextInput.esm.d.ts +2 -2
- package/dist/TextInput/TextInput.esm.js +1 -1
- package/dist/_shared/cjs/BtIconTickAlt2Px-bdf06f8c.js +29 -0
- package/dist/_shared/{esm/FormControl-84c9ace6.d.ts → cjs/FormControl-d4d9c665.d.ts} +4 -0
- package/dist/_shared/cjs/{FormControl-e6b7d7c5.js → FormControl-d4d9c665.js} +6 -5
- package/dist/_shared/cjs/VerticalSpace-65ad083c.d.ts +1 -1
- package/dist/_shared/cjs/index-c81c9401.d.ts +1 -1
- package/dist/_shared/cjs/{BtIconTickAlt2Px-b12ecc78.js → index.module-af7c85f2.js} +34 -59
- package/dist/_shared/esm/BtIconTickAlt2Px-da97e9ae.js +23 -0
- package/dist/_shared/{cjs/FormControl-e6b7d7c5.d.ts → esm/FormControl-2cb96de7.d.ts} +4 -0
- package/dist/_shared/esm/{FormControl-84c9ace6.js → FormControl-2cb96de7.js} +6 -5
- package/dist/_shared/esm/VerticalSpace-6b4f5e50.d.ts +1 -1
- package/dist/_shared/esm/index-c81c9401.d.ts +1 -1
- package/dist/_shared/esm/{BtIconTickAlt2Px-2c4ec3be.js → index.module-599b86dd.js} +2 -22
- package/dist/index.es.js +77 -96
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +305 -324
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/FormControl/FormControl.d.ts +4 -0
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts +1 -1
- package/dist/types/components/TextInput/TextInput.d.ts +1 -1
- package/dist/types/components/VerticalSpace/VerticalSpace.d.ts +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var React$
|
|
5
|
+
var React$9 = require('react');
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -24,8 +24,8 @@ function _interopNamespace(e) {
|
|
|
24
24
|
return Object.freeze(n);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React$
|
|
28
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React$
|
|
27
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React$9);
|
|
28
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React$9);
|
|
29
29
|
|
|
30
30
|
/*! *****************************************************************************
|
|
31
31
|
Copyright (c) Microsoft Corporation.
|
|
@@ -329,7 +329,7 @@ var AlignItem = function (_a) {
|
|
|
329
329
|
return React__default["default"].createElement("div", { className: "arc-Align-item" }, children);
|
|
330
330
|
};
|
|
331
331
|
|
|
332
|
-
var ArcRootElementContext = React$
|
|
332
|
+
var ArcRootElementContext = React$9.createContext(null);
|
|
333
333
|
/**
|
|
334
334
|
* Use `Base` as the root component of the arc system.
|
|
335
335
|
*/
|
|
@@ -879,9 +879,9 @@ function debounce(func, wait, options) {
|
|
|
879
879
|
|
|
880
880
|
var debounce_1 = debounce;
|
|
881
881
|
|
|
882
|
-
const React$
|
|
882
|
+
const React$8 = React__default["default"];
|
|
883
883
|
const BtIconChevronLeft2Px = props =>
|
|
884
|
-
/*#__PURE__*/ React$
|
|
884
|
+
/*#__PURE__*/ React$8.createElement(
|
|
885
885
|
"svg",
|
|
886
886
|
Object.assign(
|
|
887
887
|
{
|
|
@@ -890,8 +890,8 @@ const BtIconChevronLeft2Px = props =>
|
|
|
890
890
|
},
|
|
891
891
|
props
|
|
892
892
|
),
|
|
893
|
-
/*#__PURE__*/ React$
|
|
894
|
-
/*#__PURE__*/ React$
|
|
893
|
+
/*#__PURE__*/ React$8.createElement("defs", null),
|
|
894
|
+
/*#__PURE__*/ React$8.createElement("path", {
|
|
895
895
|
d:
|
|
896
896
|
"M22.5,29.99854a.99676.99676,0,0,1-.707-.293L8.08594,15.99268,21.793,2.294A1.00023,1.00023,0,0,1,23.207,3.709l-12.293,12.28467L23.207,28.2915a1,1,0,0,1-.707,1.707Z",
|
|
897
897
|
fill: "currentColor"
|
|
@@ -899,9 +899,9 @@ const BtIconChevronLeft2Px = props =>
|
|
|
899
899
|
);
|
|
900
900
|
var BtIconChevronLeft2Px_2 = BtIconChevronLeft2Px;
|
|
901
901
|
|
|
902
|
-
const React$
|
|
902
|
+
const React$7 = React__default["default"];
|
|
903
903
|
const BtIconChevronRight2Px = props =>
|
|
904
|
-
/*#__PURE__*/ React$
|
|
904
|
+
/*#__PURE__*/ React$7.createElement(
|
|
905
905
|
"svg",
|
|
906
906
|
Object.assign(
|
|
907
907
|
{
|
|
@@ -910,8 +910,8 @@ const BtIconChevronRight2Px = props =>
|
|
|
910
910
|
},
|
|
911
911
|
props
|
|
912
912
|
),
|
|
913
|
-
/*#__PURE__*/ React$
|
|
914
|
-
/*#__PURE__*/ React$
|
|
913
|
+
/*#__PURE__*/ React$7.createElement("defs", null),
|
|
914
|
+
/*#__PURE__*/ React$7.createElement("path", {
|
|
915
915
|
d:
|
|
916
916
|
"M9.5,29.99854A1.00025,1.00025,0,0,1,8.793,28.291l12.293-12.28467L8.793,3.7085A.99989.99989,0,0,1,10.207,2.29443l13.707,13.71289L10.207,29.70605A.99827.99827,0,0,1,9.5,29.99854Z",
|
|
917
917
|
fill: "currentColor"
|
|
@@ -919,9 +919,9 @@ const BtIconChevronRight2Px = props =>
|
|
|
919
919
|
);
|
|
920
920
|
var BtIconChevronRight2Px_2 = BtIconChevronRight2Px;
|
|
921
921
|
|
|
922
|
-
const React$
|
|
922
|
+
const React$6 = React__default["default"];
|
|
923
923
|
const ArcIconArc = props =>
|
|
924
|
-
/*#__PURE__*/ React$
|
|
924
|
+
/*#__PURE__*/ React$6.createElement(
|
|
925
925
|
"svg",
|
|
926
926
|
Object.assign(
|
|
927
927
|
{
|
|
@@ -930,7 +930,7 @@ const ArcIconArc = props =>
|
|
|
930
930
|
},
|
|
931
931
|
props
|
|
932
932
|
),
|
|
933
|
-
/*#__PURE__*/ React$
|
|
933
|
+
/*#__PURE__*/ React$6.createElement("path", {
|
|
934
934
|
fill: "none",
|
|
935
935
|
d: "M3.472 11.69a6.5 6.5 0 012.321-6.839A6.5 6.5 0 0113 4.38",
|
|
936
936
|
stroke: "currentColor"
|
|
@@ -939,7 +939,7 @@ const ArcIconArc = props =>
|
|
|
939
939
|
var ArcIconArc_2 = ArcIconArc;
|
|
940
940
|
|
|
941
941
|
var defaultContext$3 = { surface: "light" };
|
|
942
|
-
var Context$3 = React$
|
|
942
|
+
var Context$3 = React$9.createContext(defaultContext$3);
|
|
943
943
|
var Provider$4 = Context$3.Provider;
|
|
944
944
|
/**
|
|
945
945
|
* Use `Surface` to compose content using the Arc system.
|
|
@@ -988,7 +988,7 @@ __spreadArray$1([], backgroundsShared, true);
|
|
|
988
988
|
var Icon = function (_a) {
|
|
989
989
|
var _b;
|
|
990
990
|
var testId = _a.testId, _c = _a.color, color = _c === void 0 ? "auto" : _c, _d = _a.icon, icon = _d === void 0 ? ArcIconArc_2 : _d, _e = _a.isInline, isInline = _e === void 0 ? false : _e, label = _a.label, size = _a.size, props = __rest$2(_a, ["testId", "color", "icon", "isInline", "label", "size"]);
|
|
991
|
-
var surface = React$
|
|
991
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
992
992
|
var Icon = icon;
|
|
993
993
|
return (React__default["default"].createElement("span", __assign$2({ "data-testid": testId, "aria-label": label, className: classNames((_b = {},
|
|
994
994
|
_b["arc-Icon"] = true,
|
|
@@ -1037,17 +1037,17 @@ var BreadcrumbsLink = React__default["default"].forwardRef(function (_a, ref) {
|
|
|
1037
1037
|
/** Use `Breadcrumbs` to add a secondary navigation scheme that reveals the user’s location. Each item should be wrapped with `Breadcrumbs.Item` */
|
|
1038
1038
|
var Breadcrumbs = function (_a) {
|
|
1039
1039
|
var isLight = _a.isLight, children = _a.children;
|
|
1040
|
-
var breadcrumbsList = React$
|
|
1041
|
-
var _b = React$
|
|
1042
|
-
var _c = React$
|
|
1043
|
-
React$
|
|
1040
|
+
var breadcrumbsList = React$9.useRef(null);
|
|
1041
|
+
var _b = React$9.useState(false), isCompressed = _b[0], setIsCompressed = _b[1];
|
|
1042
|
+
var _c = React$9.useState(false), showBackTrail = _c[0], setShowBackTrail = _c[1];
|
|
1043
|
+
React$9.useEffect(function () {
|
|
1044
1044
|
React__default["default"].Children.map(children, function (item) {
|
|
1045
1045
|
if (item && item.type !== BreadcrumbsItem) {
|
|
1046
1046
|
throw new Error("Illegal child passed to <Breadcrumbs />. Ensure to only use <Breadcrumbs.Item />");
|
|
1047
1047
|
}
|
|
1048
1048
|
});
|
|
1049
1049
|
}, [children]);
|
|
1050
|
-
React$
|
|
1050
|
+
React$9.useEffect(function () {
|
|
1051
1051
|
var handleResize = debounce_1(function () {
|
|
1052
1052
|
var _a;
|
|
1053
1053
|
setShowBackTrail(false);
|
|
@@ -1111,7 +1111,7 @@ Breadcrumbs.Link = BreadcrumbsLink;
|
|
|
1111
1111
|
var BrandLogo = function (_a) {
|
|
1112
1112
|
var _b;
|
|
1113
1113
|
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$2(_a, ["color", "label", "size", "subBrand"]);
|
|
1114
|
-
var surface = React$
|
|
1114
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1115
1115
|
return (React__default["default"].createElement("div", __assign$2({ className: classNames((_b = {
|
|
1116
1116
|
"arc-BrandLogo": true,
|
|
1117
1117
|
"arc-BrandLogo--colorBrand": color === "brand",
|
|
@@ -1123,9 +1123,9 @@ var BrandLogo = function (_a) {
|
|
|
1123
1123
|
} }, filterDataAttrs(props)), label ? React__default["default"].createElement("span", { className: "arc-BrandLogo-text" }, label) : null));
|
|
1124
1124
|
};
|
|
1125
1125
|
|
|
1126
|
-
const React$
|
|
1126
|
+
const React$5 = React__default["default"];
|
|
1127
1127
|
const BtIconChevronLeftMid = props =>
|
|
1128
|
-
/*#__PURE__*/ React$
|
|
1128
|
+
/*#__PURE__*/ React$5.createElement(
|
|
1129
1129
|
"svg",
|
|
1130
1130
|
Object.assign(
|
|
1131
1131
|
{
|
|
@@ -1135,7 +1135,7 @@ const BtIconChevronLeftMid = props =>
|
|
|
1135
1135
|
},
|
|
1136
1136
|
props
|
|
1137
1137
|
),
|
|
1138
|
-
/*#__PURE__*/ React$
|
|
1138
|
+
/*#__PURE__*/ React$5.createElement("path", {
|
|
1139
1139
|
fillRule: "evenodd",
|
|
1140
1140
|
clipRule: "evenodd",
|
|
1141
1141
|
d:
|
|
@@ -1145,9 +1145,9 @@ const BtIconChevronLeftMid = props =>
|
|
|
1145
1145
|
);
|
|
1146
1146
|
var BtIconChevronLeftMid_2 = BtIconChevronLeftMid;
|
|
1147
1147
|
|
|
1148
|
-
const React$
|
|
1148
|
+
const React$4 = React__default["default"];
|
|
1149
1149
|
const BtIconChevronRightMid = props =>
|
|
1150
|
-
/*#__PURE__*/ React$
|
|
1150
|
+
/*#__PURE__*/ React$4.createElement(
|
|
1151
1151
|
"svg",
|
|
1152
1152
|
Object.assign(
|
|
1153
1153
|
{
|
|
@@ -1157,7 +1157,7 @@ const BtIconChevronRightMid = props =>
|
|
|
1157
1157
|
},
|
|
1158
1158
|
props
|
|
1159
1159
|
),
|
|
1160
|
-
/*#__PURE__*/ React$
|
|
1160
|
+
/*#__PURE__*/ React$4.createElement("path", {
|
|
1161
1161
|
fillRule: "evenodd",
|
|
1162
1162
|
clipRule: "evenodd",
|
|
1163
1163
|
d:
|
|
@@ -1170,10 +1170,10 @@ var BtIconChevronRightMid_2 = BtIconChevronRightMid;
|
|
|
1170
1170
|
/**
|
|
1171
1171
|
* Use `Button` to allow users to take actions with clicks and taps.
|
|
1172
1172
|
*/
|
|
1173
|
-
var Button = React$
|
|
1173
|
+
var Button = React$9.forwardRef(function (_a, ref) {
|
|
1174
1174
|
var _b;
|
|
1175
1175
|
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, supportingText = _a.supportingText, target = _a.target, type = _a.type, props = __rest$2(_a, ["ariaLabel", "fill", "href", "icon", "iconPosition", "id", "isDisabled", "isDisplayBlock", "isFullWidth", "label", "onClick", "rel", "supportingText", "target", "type"]);
|
|
1176
|
-
var surface = React$
|
|
1176
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1177
1177
|
var buttonClasses = classNames((_b = {
|
|
1178
1178
|
"arc-Button": true,
|
|
1179
1179
|
"arc-Button--displayBlock": isDisplayBlock
|
|
@@ -1217,7 +1217,7 @@ var ButtonIcon = function (_a) {
|
|
|
1217
1217
|
var Image = function (_a) {
|
|
1218
1218
|
var _b;
|
|
1219
1219
|
var alt = _a.alt, _c = _a.anchor, anchor = _c === void 0 ? "C" : _c, children = _a.children, fillColor = _a.fillColor, fit = _a.fit, height = _a.height, loading = _a.loading, overlay = _a.overlay, sizes = _a.sizes, src = _a.src, srcSet = _a.srcSet, width = _a.width, props = __rest$2(_a, ["alt", "anchor", "children", "fillColor", "fit", "height", "loading", "overlay", "sizes", "src", "srcSet", "width"]);
|
|
1220
|
-
React$
|
|
1220
|
+
React$9.useEffect(function () {
|
|
1221
1221
|
React__default["default"].Children.map(children, function (item) {
|
|
1222
1222
|
if (item && item.type !== ImageSource) {
|
|
1223
1223
|
throw new Error("Illegal child passed to <Image />. Ensure to only use <Image.Source />.");
|
|
@@ -1249,7 +1249,7 @@ Image.Source = ImageSource;
|
|
|
1249
1249
|
var Heading = function (_a) {
|
|
1250
1250
|
var _b;
|
|
1251
1251
|
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, props = __rest$2(_a, ["align", "casing", "children", "color", "level", "size"]);
|
|
1252
|
-
var surface = React$
|
|
1252
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1253
1253
|
var Element = "span";
|
|
1254
1254
|
if (level) {
|
|
1255
1255
|
Element = "h".concat(level);
|
|
@@ -1302,8 +1302,8 @@ var useAriaDescribedby = function (_a) {
|
|
|
1302
1302
|
* Detect interaction mode
|
|
1303
1303
|
*/
|
|
1304
1304
|
var useInteractionMode = function () {
|
|
1305
|
-
var _a = React$
|
|
1306
|
-
React$
|
|
1305
|
+
var _a = React$9.useState("pointer"), interactionMode = _a[0], setInteractionMode = _a[1];
|
|
1306
|
+
React$9.useEffect(function () {
|
|
1307
1307
|
var onKeyDown = function (event) {
|
|
1308
1308
|
if (event.altKey || event.ctrlKey || event.metaKey) {
|
|
1309
1309
|
return;
|
|
@@ -1346,13 +1346,13 @@ var useInteractionMode = function () {
|
|
|
1346
1346
|
*/
|
|
1347
1347
|
var useMediaQuery = function (mediaQuery) {
|
|
1348
1348
|
var mediaQueryList = typeof window !== "undefined" ? window.matchMedia(mediaQuery) : undefined;
|
|
1349
|
-
var _a = React$
|
|
1350
|
-
React$
|
|
1349
|
+
var _a = React$9.useState(false), matches = _a[0], setMatches = _a[1];
|
|
1350
|
+
React$9.useEffect(function () {
|
|
1351
1351
|
setMatches(typeof window !== "undefined"
|
|
1352
1352
|
? window.matchMedia(mediaQuery).matches
|
|
1353
1353
|
: false);
|
|
1354
1354
|
}, [mediaQuery]);
|
|
1355
|
-
React$
|
|
1355
|
+
React$9.useEffect(function () {
|
|
1356
1356
|
var onMatchMedia = function (event) { return setMatches(event.matches); };
|
|
1357
1357
|
// Using deprecated addListener methods here for IE & Safari 13 support
|
|
1358
1358
|
if (mediaQueryList) {
|
|
@@ -1396,7 +1396,7 @@ var useNumericInput = function (props) {
|
|
|
1396
1396
|
var Card = function (_a) {
|
|
1397
1397
|
var _b;
|
|
1398
1398
|
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$2(_a, ["actionId", "actionLabel", "children", "fill", "href", "imageAlt", "imageHeight", "imageLoading", "imageSrc", "imageSrcSet", "linkData", "minHeight", "onClick", "target", "title", "titleSize"]);
|
|
1399
|
-
var surface = React$
|
|
1399
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1400
1400
|
var interactionMode = useInteractionMode().interactionMode;
|
|
1401
1401
|
var Wrapper = function (_a) {
|
|
1402
1402
|
var children = _a.children;
|
|
@@ -1455,7 +1455,7 @@ Card.Image = CardImage;
|
|
|
1455
1455
|
*/
|
|
1456
1456
|
var CardLink = function (_a) {
|
|
1457
1457
|
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;
|
|
1458
|
-
var surface = React$
|
|
1458
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1459
1459
|
return (React__default["default"].createElement("a", __assign$2({ onClick: handleLinkClick({ handler: onClick }), "aria-describedby": actionId, className: classNames({
|
|
1460
1460
|
"arc-Card-link": true,
|
|
1461
1461
|
"arc-Card-link--button": isButton,
|
|
@@ -1467,9 +1467,9 @@ var CardLink = function (_a) {
|
|
|
1467
1467
|
React__default["default"].createElement(Icon, { testId: "cardIcon", icon: BtIconChevronRightMid_2, size: 16 })))));
|
|
1468
1468
|
};
|
|
1469
1469
|
|
|
1470
|
-
const React$
|
|
1471
|
-
const
|
|
1472
|
-
/*#__PURE__*/ React$
|
|
1470
|
+
const React$3 = React__default["default"];
|
|
1471
|
+
const BtIconTickAlt2Px = props =>
|
|
1472
|
+
/*#__PURE__*/ React$3.createElement(
|
|
1473
1473
|
"svg",
|
|
1474
1474
|
Object.assign(
|
|
1475
1475
|
{
|
|
@@ -1478,18 +1478,18 @@ const BtIconTickVariant = props =>
|
|
|
1478
1478
|
},
|
|
1479
1479
|
props
|
|
1480
1480
|
),
|
|
1481
|
-
/*#__PURE__*/ React$
|
|
1482
|
-
/*#__PURE__*/ React$
|
|
1481
|
+
/*#__PURE__*/ React$3.createElement("defs", null),
|
|
1482
|
+
/*#__PURE__*/ React$3.createElement("path", {
|
|
1483
1483
|
d:
|
|
1484
|
-
"M13.
|
|
1484
|
+
"M13.49963,21.91418l-4.707-4.707a1.0014,1.0014,0,0,1,0-1.41406,1.02353,1.02353,0,0,1,1.41406,0l3.293,3.293,8.293-8.293a.99989.99989,0,1,1,1.41406,1.41406Z",
|
|
1485
1485
|
fill: "currentColor"
|
|
1486
1486
|
})
|
|
1487
1487
|
);
|
|
1488
|
-
var
|
|
1488
|
+
var BtIconTickAlt2Px_2 = BtIconTickAlt2Px;
|
|
1489
1489
|
|
|
1490
|
-
const React$
|
|
1490
|
+
const React$2 = React__default["default"];
|
|
1491
1491
|
const BtIconAlert = props =>
|
|
1492
|
-
/*#__PURE__*/ React$
|
|
1492
|
+
/*#__PURE__*/ React$2.createElement(
|
|
1493
1493
|
"svg",
|
|
1494
1494
|
Object.assign(
|
|
1495
1495
|
{
|
|
@@ -1498,17 +1498,17 @@ const BtIconAlert = props =>
|
|
|
1498
1498
|
},
|
|
1499
1499
|
props
|
|
1500
1500
|
),
|
|
1501
|
-
/*#__PURE__*/ React$
|
|
1502
|
-
/*#__PURE__*/ React$
|
|
1501
|
+
/*#__PURE__*/ React$2.createElement("defs", null),
|
|
1502
|
+
/*#__PURE__*/ React$2.createElement("path", {
|
|
1503
1503
|
d:
|
|
1504
1504
|
"M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,27A13,13,0,1,1,29,16,13.01474,13.01474,0,0,1,16,29Z",
|
|
1505
1505
|
fill: "currentColor"
|
|
1506
1506
|
}),
|
|
1507
|
-
/*#__PURE__*/ React$
|
|
1507
|
+
/*#__PURE__*/ React$2.createElement("path", {
|
|
1508
1508
|
fill: "currentColor",
|
|
1509
1509
|
d: "M16 20.99335A1 1 0 1 0 16 22.99335 1 1 0 1 0 16 20.99335z"
|
|
1510
1510
|
}),
|
|
1511
|
-
/*#__PURE__*/ React$
|
|
1511
|
+
/*#__PURE__*/ React$2.createElement("path", {
|
|
1512
1512
|
d:
|
|
1513
1513
|
"M16.00488,19.00977a.49972.49972,0,0,0,.5-.5L16.50684,9.5a.5.5,0,0,0-1,0l-.002,9.00977A.5.5,0,0,0,16.00488,19.00977Z",
|
|
1514
1514
|
fill: "currentColor"
|
|
@@ -1522,7 +1522,7 @@ var BtIconAlert_2 = BtIconAlert;
|
|
|
1522
1522
|
var Text = function (_a) {
|
|
1523
1523
|
var _b;
|
|
1524
1524
|
var _c = _a.align, align = _c === void 0 ? "left" : _c, children = _a.children, _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$2(_a, ["align", "children", "isInline", "isMeasured", "size", "tone"]);
|
|
1525
|
-
var surface = React$
|
|
1525
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1526
1526
|
return (React__default["default"].createElement("span", __assign$2({ className: classNames((_b = {
|
|
1527
1527
|
"arc-Text": true
|
|
1528
1528
|
},
|
|
@@ -1541,8 +1541,8 @@ var Text = function (_a) {
|
|
|
1541
1541
|
*/
|
|
1542
1542
|
var FormControlDisclosure = function (_a) {
|
|
1543
1543
|
var children = _a.children, summary = _a.summary, onClick = _a.onClick, _b = _a.size, size = _b === void 0 ? "l" : _b, id = _a.id, props = __rest$2(_a, ["children", "summary", "onClick", "size", "id"]);
|
|
1544
|
-
var surface = React$
|
|
1545
|
-
var _c = React$
|
|
1544
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1545
|
+
var _c = React$9.useState(false), disclousreState = _c[0], setDisclosureState = _c[1];
|
|
1546
1546
|
var handleOnClick = function () {
|
|
1547
1547
|
onClick && onClick();
|
|
1548
1548
|
setDisclosureState(function (prevState) { return !prevState; });
|
|
@@ -1563,20 +1563,20 @@ var FormControlDisclosure = function (_a) {
|
|
|
1563
1563
|
var defaultContext$2 = {
|
|
1564
1564
|
requirementStatus: null
|
|
1565
1565
|
};
|
|
1566
|
-
var Context$2 = React$
|
|
1566
|
+
var Context$2 = React$9.createContext(defaultContext$2);
|
|
1567
1567
|
var Provider$3 = Context$2.Provider;
|
|
1568
1568
|
/**
|
|
1569
1569
|
* Use `FormControl` to provide inputs with labels, helper text and error messages
|
|
1570
1570
|
*/
|
|
1571
1571
|
var FormControl = function (_a) {
|
|
1572
|
-
var children = _a.children, _b = _a.elementType, ElementType = _b === void 0 ? "div" : _b, errorMessage = _a.errorMessage, helper = _a.helper, htmlFor = _a.htmlFor, id = _a.id, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, _d = _a.requirementStatus, requirementStatus = _d === void 0 ? "optional" : _d, isDisabled = _a.isDisabled, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, props = __rest$2(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "id", "label", "labelSize", "requirementStatus", "isDisabled", "disclosureTitle", "disclosureText", "onClickDisclosure"]);
|
|
1573
|
-
var surface = React$
|
|
1574
|
-
var
|
|
1572
|
+
var children = _a.children, _b = _a.elementType, ElementType = _b === void 0 ? "div" : _b, errorMessage = _a.errorMessage, helper = _a.helper, htmlFor = _a.htmlFor, 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$2(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "id", "label", "labelSize", "requirementStatus", "helperUnderLabel", "isDisabled", "disclosureTitle", "disclosureText", "onClickDisclosure"]);
|
|
1573
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1574
|
+
var _f = useAriaDescribedby({
|
|
1575
1575
|
disclosureText: disclosureText,
|
|
1576
1576
|
errorMessage: errorMessage,
|
|
1577
1577
|
helper: helper,
|
|
1578
1578
|
id: htmlFor || id // `htmlFor` is preference to keep this deterministic with TextInput
|
|
1579
|
-
}), ariaDescribedby =
|
|
1579
|
+
}), ariaDescribedby = _f.ariaDescribedby, idError = _f.idError, idHelper = _f.idHelper, idDisclosure = _f.idDisclosure;
|
|
1580
1580
|
var LabelType = ElementType === "div" ? "label" : "legend";
|
|
1581
1581
|
var elementProps = {};
|
|
1582
1582
|
var labelProps = {};
|
|
@@ -1602,20 +1602,21 @@ var FormControl = function (_a) {
|
|
|
1602
1602
|
React__default["default"].createElement(LabelType, __assign$2({ className: "arc-FormControl-label" }, labelProps),
|
|
1603
1603
|
label,
|
|
1604
1604
|
requirementStatus === "optional" && (React__default["default"].createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
|
|
1605
|
+
helperUnderLabel && (React__default["default"].createElement(React__default["default"].Fragment, null, helper && (React__default["default"].createElement("div", { className: "arc-FormControl-helper arc-FormControl-helper--underLabel", id: idHelper }, helper)))),
|
|
1605
1606
|
children,
|
|
1606
|
-
errorMessage ? (React__default["default"].createElement("div", { className: "arc-FormControl-error", id: idError },
|
|
1607
|
+
!helperUnderLabel && (React__default["default"].createElement(React__default["default"].Fragment, null, errorMessage ? (React__default["default"].createElement("div", { className: "arc-FormControl-error", id: idError },
|
|
1607
1608
|
React__default["default"].createElement("span", { className: "arc-FormControl-error--icon" },
|
|
1608
1609
|
React__default["default"].createElement(BtIconAlert_2, null)),
|
|
1609
|
-
errorMessage)) : disclosureTitle ? (React__default["default"].createElement(FormControlDisclosure, { onClick: onClickDisclosure, summary: disclosureTitle, size: labelSize, id: idDisclosure }, disclosureText)) : (helper && (React__default["default"].createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper))))));
|
|
1610
|
+
errorMessage)) : disclosureTitle ? (React__default["default"].createElement(FormControlDisclosure, { onClick: onClickDisclosure, summary: disclosureTitle, size: labelSize, id: idDisclosure }, disclosureText)) : (helper && (React__default["default"].createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper))))))));
|
|
1610
1611
|
};
|
|
1611
1612
|
|
|
1612
1613
|
/**
|
|
1613
1614
|
* Use `Checkbox` to allow users to select individual options.
|
|
1614
1615
|
*/
|
|
1615
|
-
var Checkbox = React$
|
|
1616
|
+
var Checkbox = React$9.forwardRef(function (_a, ref) {
|
|
1616
1617
|
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, props = __rest$2(_a, ["checked", "errorMessage", "helper", "id", "isDisabled", "isRequired", "label", "name", "onBlur", "onChange", "size", "value"]);
|
|
1617
|
-
var requirementStatus = React$
|
|
1618
|
-
var surface = React$
|
|
1618
|
+
var requirementStatus = React$9.useContext(Context$2).requirementStatus;
|
|
1619
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1619
1620
|
var _f = useAriaDescribedby({
|
|
1620
1621
|
id: id,
|
|
1621
1622
|
errorMessage: errorMessage
|
|
@@ -1641,7 +1642,7 @@ var Checkbox = React$a.forwardRef(function (_a, ref) {
|
|
|
1641
1642
|
React__default["default"].createElement("label", { id: idLabel, htmlFor: id, className: "arc-Checkbox-label" },
|
|
1642
1643
|
React__default["default"].createElement("input", __assign$2({ "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", className: "arc-Checkbox-input" }, checkedProps, { disabled: isDisabled, id: id, name: name, onBlur: onBlur, onChange: onChange, ref: ref, required: isRequired, type: "checkbox", value: value }, filterDataAttrs(props))),
|
|
1643
1644
|
React__default["default"].createElement("span", { className: "arc-Checkbox-box" },
|
|
1644
|
-
React__default["default"].createElement(
|
|
1645
|
+
React__default["default"].createElement(BtIconTickAlt2Px_2, null)),
|
|
1645
1646
|
React__default["default"].createElement("span", null,
|
|
1646
1647
|
label,
|
|
1647
1648
|
!isRequired && requirementStatus !== "optional" ? (React__default["default"].createElement("span", { className: "arc-Checkbox-labelOptional" }, "(optional)")) : null,
|
|
@@ -1657,9 +1658,9 @@ var Checkbox = React$a.forwardRef(function (_a, ref) {
|
|
|
1657
1658
|
*/
|
|
1658
1659
|
var Clock = function (_a) {
|
|
1659
1660
|
var _b = _a.locale, locale = _b === void 0 ? "en-GB" : _b, props = __rest$2(_a, ["locale"]);
|
|
1660
|
-
var _c = React$
|
|
1661
|
-
var _d = React$
|
|
1662
|
-
React$
|
|
1661
|
+
var _c = React$9.useState(new Date()), time = _c[0], setTime = _c[1];
|
|
1662
|
+
var _d = React$9.useState(time.toLocaleTimeString(locale)), humanTime = _d[0], setHumanTime = _d[1];
|
|
1663
|
+
React$9.useEffect(function () {
|
|
1663
1664
|
var tick = function () {
|
|
1664
1665
|
var newTime = new Date();
|
|
1665
1666
|
setTime(newTime);
|
|
@@ -1687,7 +1688,7 @@ var Clock_rehydrator = (function (el) { return __awaiter(void 0, void 0, void 0,
|
|
|
1687
1688
|
*/
|
|
1688
1689
|
var Columns = function (_a) {
|
|
1689
1690
|
var children = _a.children, _b = _a.isGutterless, isGutterless = _b === void 0 ? false : _b, props = __rest$2(_a, ["children", "isGutterless"]);
|
|
1690
|
-
React$
|
|
1691
|
+
React$9.useEffect(function () {
|
|
1691
1692
|
React__default["default"].Children.map(children, function (item) {
|
|
1692
1693
|
if (item && item.type !== Col) {
|
|
1693
1694
|
throw new Error("Illegal child passed to <Columns />. Ensure to only use <Columns.Col />.");
|
|
@@ -1745,9 +1746,9 @@ var Curve = function (_a) {
|
|
|
1745
1746
|
_b)) }, filterDataAttrs(props))));
|
|
1746
1747
|
};
|
|
1747
1748
|
|
|
1748
|
-
const React$
|
|
1749
|
+
const React$1 = React__default["default"];
|
|
1749
1750
|
const BtIconChevronDown2Px = props =>
|
|
1750
|
-
/*#__PURE__*/ React$
|
|
1751
|
+
/*#__PURE__*/ React$1.createElement(
|
|
1751
1752
|
"svg",
|
|
1752
1753
|
Object.assign(
|
|
1753
1754
|
{
|
|
@@ -1756,8 +1757,8 @@ const BtIconChevronDown2Px = props =>
|
|
|
1756
1757
|
},
|
|
1757
1758
|
props
|
|
1758
1759
|
),
|
|
1759
|
-
/*#__PURE__*/ React$
|
|
1760
|
-
/*#__PURE__*/ React$
|
|
1760
|
+
/*#__PURE__*/ React$1.createElement("defs", null),
|
|
1761
|
+
/*#__PURE__*/ React$1.createElement("path", {
|
|
1761
1762
|
d:
|
|
1762
1763
|
"M15.99316,23.91406,2.294,10.207A.99989.99989,0,1,1,3.708,8.793l12.28515,12.293L28.292,8.793A.99989.99989,0,1,1,29.70605,10.207Z",
|
|
1763
1764
|
fill: "currentColor"
|
|
@@ -1771,7 +1772,7 @@ var BtIconChevronDown2Px_2 = BtIconChevronDown2Px;
|
|
|
1771
1772
|
*/
|
|
1772
1773
|
var Disclosure = function (_a) {
|
|
1773
1774
|
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$2(_a, ["children", "headingLevel", "indentDetails", "isOpen", "summary"]);
|
|
1774
|
-
var surface = React$
|
|
1775
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1775
1776
|
return (React__default["default"].createElement("details", __assign$2({ className: classNames({
|
|
1776
1777
|
"arc-Disclosure": true,
|
|
1777
1778
|
"arc-Disclosure--indentDetails": indentDetails,
|
|
@@ -1802,8 +1803,8 @@ var Elevation = function (_a) {
|
|
|
1802
1803
|
var Group = function (_a) {
|
|
1803
1804
|
var _b;
|
|
1804
1805
|
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$2(_a, ["children", "grow", "growEqual", "gutterBorder", "noWrap"]);
|
|
1805
|
-
var surface = React$
|
|
1806
|
-
React$
|
|
1806
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1807
|
+
React$9.useEffect(function () {
|
|
1807
1808
|
React__default["default"].Children.map(children, function (item) {
|
|
1808
1809
|
if (item && item.type !== GroupItem) {
|
|
1809
1810
|
throw new Error("Illegal child passed to <Group />. Ensure to only use <Group.Item />.");
|
|
@@ -1837,7 +1838,7 @@ Group.Item = GroupItem;
|
|
|
1837
1838
|
*/
|
|
1838
1839
|
var Markup = function (_a) {
|
|
1839
1840
|
var children = _a.children, _b = _a.isMeasured, isMeasured = _b === void 0 ? false : _b, props = __rest$2(_a, ["children", "isMeasured"]);
|
|
1840
|
-
var surface = React$
|
|
1841
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1841
1842
|
return (React__default["default"].createElement("div", __assign$2({ className: classNames({
|
|
1842
1843
|
"arc-Markup": true,
|
|
1843
1844
|
"arc-Markup--measured": isMeasured,
|
|
@@ -1850,7 +1851,7 @@ var Markup = function (_a) {
|
|
|
1850
1851
|
*/
|
|
1851
1852
|
var UniversalHeader = function (_a) {
|
|
1852
1853
|
var children = _a.children, props = __rest$2(_a, ["children"]);
|
|
1853
|
-
React$
|
|
1854
|
+
React$9.useEffect(function () {
|
|
1854
1855
|
React__default["default"].Children.map(children, function (item) {
|
|
1855
1856
|
if (item && item.type !== UniversalHeaderItem) {
|
|
1856
1857
|
throw new Error("Illegal child passed to <UniversalHeader />. Ensure to only use <UniversalHeader.Item />.");
|
|
@@ -1905,20 +1906,20 @@ Poster.Image = PosterImage;
|
|
|
1905
1906
|
PosterVideo.displayName = "Poster.Video";
|
|
1906
1907
|
Poster.Video = PosterVideo;
|
|
1907
1908
|
|
|
1908
|
-
var RadioContext = React$
|
|
1909
|
+
var RadioContext = React$9.createContext({});
|
|
1909
1910
|
var Provider$2 = RadioContext.Provider;
|
|
1910
1911
|
var useRadioContext = function () {
|
|
1911
|
-
var context = React$
|
|
1912
|
+
var context = React$9.useContext(RadioContext);
|
|
1912
1913
|
return context;
|
|
1913
1914
|
};
|
|
1914
1915
|
|
|
1915
1916
|
/**
|
|
1916
1917
|
* Radio Button component.
|
|
1917
1918
|
*/
|
|
1918
|
-
var RadioButton = React$
|
|
1919
|
+
var RadioButton = React$9.forwardRef(function (_a, ref) {
|
|
1919
1920
|
var helper = _a.helper, id = _a.id, isDisabled = _a.isDisabled, label = _a.label, value = _a.value, props = __rest$2(_a, ["helper", "id", "isDisabled", "label", "value"]);
|
|
1920
1921
|
var _b = useRadioContext(), blurEvent = _b.blurEvent, changeEvent = _b.changeEvent, groupDisabled = _b.groupDisabled, checkedValue = _b.checkedValue, labelSize = _b.labelSize, name = _b.name, size = _b.size;
|
|
1921
|
-
var surface = React$
|
|
1922
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1922
1923
|
var idLabel = "".concat(id, "-label");
|
|
1923
1924
|
var checked = checkedValue === value ? true : false;
|
|
1924
1925
|
return (React__default["default"].createElement("div", __assign$2({ className: classNames({
|
|
@@ -1940,7 +1941,7 @@ var RadioButton = React$a.forwardRef(function (_a, ref) {
|
|
|
1940
1941
|
*/
|
|
1941
1942
|
var RadioGroup = function (_a) {
|
|
1942
1943
|
var children = _a.children, checkedValue = _a.checkedValue, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, id = _a.id, helper = _a.helper, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, _d = _a.size, size = _d === void 0 ? "l" : _d, props = __rest$2(_a, ["children", "checkedValue", "isDisabled", "id", "helper", "label", "labelSize", "name", "onBlur", "onChange", "size"]);
|
|
1943
|
-
React$
|
|
1944
|
+
React$9.useEffect(function () {
|
|
1944
1945
|
React__default["default"].Children.map(children, function (item) {
|
|
1945
1946
|
if (item && item.type !== RadioButton) {
|
|
1946
1947
|
throw new Error("Illegal child passed to <RadioGroup />. Ensure to only use <RadioGroup.RadioButton />.");
|
|
@@ -1957,7 +1958,7 @@ var RadioGroup = function (_a) {
|
|
|
1957
1958
|
size: size
|
|
1958
1959
|
} },
|
|
1959
1960
|
React__default["default"].createElement("div", __assign$2({ className: "arc-RadioGroup" }, filterDataAttrs(props)),
|
|
1960
|
-
React__default["default"].createElement(FormControl, { elementType: "fieldset", label: label, labelSize: labelSize, helper: helper, id: id, requirementStatus: "not-applicable" }, children))));
|
|
1961
|
+
React__default["default"].createElement(FormControl, { elementType: "fieldset", label: label, labelSize: labelSize, helper: helper, id: id, requirementStatus: "not-applicable", helperUnderLabel: true }, children))));
|
|
1961
1962
|
};
|
|
1962
1963
|
RadioButton.displayName = "RadioGroup.RadioButton";
|
|
1963
1964
|
RadioGroup.RadioButton = RadioButton;
|
|
@@ -1966,7 +1967,7 @@ RadioGroup.RadioButton = RadioButton;
|
|
|
1966
1967
|
* Use `Rule` to display a horizontal rule.
|
|
1967
1968
|
*/
|
|
1968
1969
|
var Rule = function (props) {
|
|
1969
|
-
var surface = React$
|
|
1970
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
1970
1971
|
return (React__default["default"].createElement("hr", __assign$2({ className: classNames({
|
|
1971
1972
|
"arc-Rule": true,
|
|
1972
1973
|
"arc-Rule--onDarkSurface": surface === "dark"
|
|
@@ -32882,7 +32883,7 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
32882
32883
|
/* -----------------------------------------------------------------------------------------------
|
|
32883
32884
|
* createContext
|
|
32884
32885
|
* ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
|
|
32885
|
-
const BaseContext = /*#__PURE__*/ React$
|
|
32886
|
+
const BaseContext = /*#__PURE__*/ React$9.createContext(defaultContext);
|
|
32886
32887
|
const index = defaultContexts.length;
|
|
32887
32888
|
defaultContexts = [
|
|
32888
32889
|
...defaultContexts,
|
|
@@ -32892,15 +32893,15 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
32892
32893
|
const { scope: scope , children: children , ...context } = props;
|
|
32893
32894
|
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
|
|
32894
32895
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32895
|
-
const value = React$
|
|
32896
|
+
const value = React$9.useMemo(()=>context
|
|
32896
32897
|
, Object.values(context));
|
|
32897
|
-
return /*#__PURE__*/ React$
|
|
32898
|
+
return /*#__PURE__*/ React$9.createElement(Context.Provider, {
|
|
32898
32899
|
value: value
|
|
32899
32900
|
}, children);
|
|
32900
32901
|
}
|
|
32901
32902
|
function useContext(consumerName, scope) {
|
|
32902
32903
|
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
|
|
32903
|
-
const context = React$
|
|
32904
|
+
const context = React$9.useContext(Context);
|
|
32904
32905
|
if (context) return context;
|
|
32905
32906
|
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
|
|
32906
32907
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -32915,11 +32916,11 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
32915
32916
|
* createScope
|
|
32916
32917
|
* ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
|
|
32917
32918
|
const scopeContexts = defaultContexts.map((defaultContext)=>{
|
|
32918
|
-
return /*#__PURE__*/ React$
|
|
32919
|
+
return /*#__PURE__*/ React$9.createContext(defaultContext);
|
|
32919
32920
|
});
|
|
32920
32921
|
return function useScope(scope) {
|
|
32921
32922
|
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
|
|
32922
|
-
return React$
|
|
32923
|
+
return React$9.useMemo(()=>({
|
|
32923
32924
|
[`__scope${scopeName}`]: {
|
|
32924
32925
|
...scope,
|
|
32925
32926
|
[scopeName]: contexts
|
|
@@ -32960,7 +32961,7 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
32960
32961
|
...currentScope
|
|
32961
32962
|
};
|
|
32962
32963
|
}, {});
|
|
32963
|
-
return React$
|
|
32964
|
+
return React$9.useMemo(()=>({
|
|
32964
32965
|
[`__scope${baseScope.scopeName}`]: nextScopes1
|
|
32965
32966
|
})
|
|
32966
32967
|
, [
|
|
@@ -32992,14 +32993,14 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
32992
32993
|
* Accepts callback refs and RefObject(s)
|
|
32993
32994
|
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
32994
32995
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32995
|
-
return React$
|
|
32996
|
+
return React$9.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
32996
32997
|
}
|
|
32997
32998
|
|
|
32998
32999
|
/* -------------------------------------------------------------------------------------------------
|
|
32999
33000
|
* Slot
|
|
33000
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ React$
|
|
33001
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
33001
33002
|
const { children: children , ...slotProps } = props;
|
|
33002
|
-
const childrenArray = React$
|
|
33003
|
+
const childrenArray = React$9.Children.toArray(children);
|
|
33003
33004
|
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
33004
33005
|
if (slottable) {
|
|
33005
33006
|
// the new element to render is the one passed as a child of `Slottable`
|
|
@@ -33008,37 +33009,37 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
33008
33009
|
if (child === slottable) {
|
|
33009
33010
|
// because the new element will be the one rendered, we are only interested
|
|
33010
33011
|
// in grabbing its children (`newElement.props.children`)
|
|
33011
|
-
if (React$
|
|
33012
|
-
return /*#__PURE__*/ React$
|
|
33012
|
+
if (React$9.Children.count(newElement) > 1) return React$9.Children.only(null);
|
|
33013
|
+
return /*#__PURE__*/ React$9.isValidElement(newElement) ? newElement.props.children : null;
|
|
33013
33014
|
} else return child;
|
|
33014
33015
|
});
|
|
33015
|
-
return /*#__PURE__*/ React$
|
|
33016
|
+
return /*#__PURE__*/ React$9.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
33016
33017
|
ref: forwardedRef
|
|
33017
|
-
}), /*#__PURE__*/ React$
|
|
33018
|
+
}), /*#__PURE__*/ React$9.isValidElement(newElement) ? /*#__PURE__*/ React$9.cloneElement(newElement, undefined, newChildren) : null);
|
|
33018
33019
|
}
|
|
33019
|
-
return /*#__PURE__*/ React$
|
|
33020
|
+
return /*#__PURE__*/ React$9.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
33020
33021
|
ref: forwardedRef
|
|
33021
33022
|
}), children);
|
|
33022
33023
|
});
|
|
33023
33024
|
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
|
33024
33025
|
/* -------------------------------------------------------------------------------------------------
|
|
33025
33026
|
* SlotClone
|
|
33026
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ React$
|
|
33027
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
33027
33028
|
const { children: children , ...slotProps } = props;
|
|
33028
|
-
if (/*#__PURE__*/ React$
|
|
33029
|
+
if (/*#__PURE__*/ React$9.isValidElement(children)) return /*#__PURE__*/ React$9.cloneElement(children, {
|
|
33029
33030
|
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
33030
33031
|
ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref)
|
|
33031
33032
|
});
|
|
33032
|
-
return React$
|
|
33033
|
+
return React$9.Children.count(children) > 1 ? React$9.Children.only(null) : null;
|
|
33033
33034
|
});
|
|
33034
33035
|
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
|
|
33035
33036
|
/* -------------------------------------------------------------------------------------------------
|
|
33036
33037
|
* Slottable
|
|
33037
33038
|
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
|
|
33038
|
-
return /*#__PURE__*/ React$
|
|
33039
|
+
return /*#__PURE__*/ React$9.createElement(React$9.Fragment, null, children);
|
|
33039
33040
|
};
|
|
33040
33041
|
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
33041
|
-
return /*#__PURE__*/ React$
|
|
33042
|
+
return /*#__PURE__*/ React$9.isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
33042
33043
|
}
|
|
33043
33044
|
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
33044
33045
|
// all child props should override
|
|
@@ -33158,9 +33159,9 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
33158
33159
|
];
|
|
33159
33160
|
}
|
|
33160
33161
|
|
|
33161
|
-
const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ React$
|
|
33162
|
+
const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ React$9.createContext(undefined);
|
|
33162
33163
|
/* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
|
|
33163
|
-
const globalDir = React$
|
|
33164
|
+
const globalDir = React$9.useContext($f631663db3294ace$var$DirectionContext);
|
|
33164
33165
|
return localDir || globalDir || 'ltr';
|
|
33165
33166
|
}
|
|
33166
33167
|
|
|
@@ -33185,13 +33186,13 @@ const $8927f6f2acc4f386$var$NODES = [
|
|
|
33185
33186
|
/* -------------------------------------------------------------------------------------------------
|
|
33186
33187
|
* Primitive
|
|
33187
33188
|
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
|
|
33188
|
-
const Node = /*#__PURE__*/ React$
|
|
33189
|
+
const Node = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
33189
33190
|
const { asChild: asChild , ...primitiveProps } = props;
|
|
33190
33191
|
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
33191
|
-
React$
|
|
33192
|
+
React$9.useEffect(()=>{
|
|
33192
33193
|
window[Symbol.for('radix-ui')] = true;
|
|
33193
33194
|
}, []);
|
|
33194
|
-
return /*#__PURE__*/ React$
|
|
33195
|
+
return /*#__PURE__*/ React$9.createElement(Comp, _extends({}, primitiveProps, {
|
|
33195
33196
|
ref: forwardedRef
|
|
33196
33197
|
}));
|
|
33197
33198
|
});
|
|
@@ -33247,11 +33248,11 @@ const $8927f6f2acc4f386$var$NODES = [
|
|
|
33247
33248
|
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
33248
33249
|
* prop or avoid re-executing effects when passed as a dependency
|
|
33249
33250
|
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
33250
|
-
const callbackRef = React$
|
|
33251
|
-
React$
|
|
33251
|
+
const callbackRef = React$9.useRef(callback);
|
|
33252
|
+
React$9.useEffect(()=>{
|
|
33252
33253
|
callbackRef.current = callback;
|
|
33253
33254
|
}); // https://github.com/facebook/react/issues/19240
|
|
33254
|
-
return React$
|
|
33255
|
+
return React$9.useMemo(()=>(...args)=>{
|
|
33255
33256
|
var _callbackRef$current;
|
|
33256
33257
|
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
33257
33258
|
}
|
|
@@ -33262,7 +33263,7 @@ const $8927f6f2acc4f386$var$NODES = [
|
|
|
33262
33263
|
* Listens for when the escape key is down
|
|
33263
33264
|
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
33264
33265
|
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
33265
|
-
React$
|
|
33266
|
+
React$9.useEffect(()=>{
|
|
33266
33267
|
const handleKeyDown = (event)=>{
|
|
33267
33268
|
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
33268
33269
|
};
|
|
@@ -33279,18 +33280,18 @@ const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
|
33279
33280
|
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
33280
33281
|
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
33281
33282
|
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
33282
|
-
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ React$
|
|
33283
|
+
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ React$9.createContext({
|
|
33283
33284
|
layers: new Set(),
|
|
33284
33285
|
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
33285
33286
|
branches: new Set()
|
|
33286
33287
|
});
|
|
33287
|
-
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$
|
|
33288
|
+
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
33288
33289
|
var _node$ownerDocument;
|
|
33289
33290
|
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
33290
|
-
const context = React$
|
|
33291
|
-
const [node1, setNode] = React$
|
|
33291
|
+
const context = React$9.useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
33292
|
+
const [node1, setNode] = React$9.useState(null);
|
|
33292
33293
|
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;
|
|
33293
|
-
const [, force] = React$
|
|
33294
|
+
const [, force] = React$9.useState({});
|
|
33294
33295
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
33295
33296
|
);
|
|
33296
33297
|
const layers = Array.from(context.layers);
|
|
@@ -33332,7 +33333,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$a.forwardR
|
|
|
33332
33333
|
onDismiss();
|
|
33333
33334
|
}
|
|
33334
33335
|
}, ownerDocument);
|
|
33335
|
-
React$
|
|
33336
|
+
React$9.useEffect(()=>{
|
|
33336
33337
|
if (!node1) return;
|
|
33337
33338
|
if (disableOutsidePointerEvents) {
|
|
33338
33339
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -33357,7 +33358,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$a.forwardR
|
|
|
33357
33358
|
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
|
33358
33359
|
* and add it to the end again so the layering order wouldn't be _creation order_.
|
|
33359
33360
|
* We only want them to be removed from context stacks when unmounted.
|
|
33360
|
-
*/ React$
|
|
33361
|
+
*/ React$9.useEffect(()=>{
|
|
33361
33362
|
return ()=>{
|
|
33362
33363
|
if (!node1) return;
|
|
33363
33364
|
context.layers.delete(node1);
|
|
@@ -33368,14 +33369,14 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$a.forwardR
|
|
|
33368
33369
|
node1,
|
|
33369
33370
|
context
|
|
33370
33371
|
]);
|
|
33371
|
-
React$
|
|
33372
|
+
React$9.useEffect(()=>{
|
|
33372
33373
|
const handleUpdate = ()=>force({})
|
|
33373
33374
|
;
|
|
33374
33375
|
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
33375
33376
|
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
33376
33377
|
;
|
|
33377
33378
|
}, []);
|
|
33378
|
-
return /*#__PURE__*/ React$
|
|
33379
|
+
return /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
|
33379
33380
|
ref: composedRefs,
|
|
33380
33381
|
style: {
|
|
33381
33382
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
@@ -33392,9 +33393,9 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$a.forwardR
|
|
|
33392
33393
|
* Returns props to pass to the node we want to check for outside events.
|
|
33393
33394
|
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
33394
33395
|
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
33395
|
-
const isPointerInsideReactTreeRef = React$
|
|
33396
|
-
const handleClickRef = React$
|
|
33397
|
-
React$
|
|
33396
|
+
const isPointerInsideReactTreeRef = React$9.useRef(false);
|
|
33397
|
+
const handleClickRef = React$9.useRef(()=>{});
|
|
33398
|
+
React$9.useEffect(()=>{
|
|
33398
33399
|
const handlePointerDown = (event)=>{
|
|
33399
33400
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
33400
33401
|
const eventDetail = {
|
|
@@ -33460,8 +33461,8 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$a.forwardR
|
|
|
33460
33461
|
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
33461
33462
|
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
33462
33463
|
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
33463
|
-
const isFocusInsideReactTreeRef = React$
|
|
33464
|
-
React$
|
|
33464
|
+
const isFocusInsideReactTreeRef = React$9.useRef(false);
|
|
33465
|
+
React$9.useEffect(()=>{
|
|
33465
33466
|
const handleFocus = (event)=>{
|
|
33466
33467
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
33467
33468
|
const eventDetail = {
|
|
@@ -33508,7 +33509,7 @@ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detai
|
|
|
33508
33509
|
* Injects a pair of focus guards at the edges of the whole DOM tree
|
|
33509
33510
|
* to ensure `focusin` & `focusout` events can be caught consistently.
|
|
33510
33511
|
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
33511
|
-
React$
|
|
33512
|
+
React$9.useEffect(()=>{
|
|
33512
33513
|
var _edgeGuards$, _edgeGuards$2;
|
|
33513
33514
|
const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
|
|
33514
33515
|
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
@@ -33535,15 +33536,15 @@ const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
|
33535
33536
|
bubbles: false,
|
|
33536
33537
|
cancelable: true
|
|
33537
33538
|
};
|
|
33538
|
-
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React$
|
|
33539
|
+
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
33539
33540
|
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
33540
|
-
const [container1, setContainer] = React$
|
|
33541
|
+
const [container1, setContainer] = React$9.useState(null);
|
|
33541
33542
|
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
33542
33543
|
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
33543
|
-
const lastFocusedElementRef = React$
|
|
33544
|
+
const lastFocusedElementRef = React$9.useRef(null);
|
|
33544
33545
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
|
33545
33546
|
);
|
|
33546
|
-
const focusScope = React$
|
|
33547
|
+
const focusScope = React$9.useRef({
|
|
33547
33548
|
paused: false,
|
|
33548
33549
|
pause () {
|
|
33549
33550
|
this.paused = true;
|
|
@@ -33552,7 +33553,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React$a.forwardR
|
|
|
33552
33553
|
this.paused = false;
|
|
33553
33554
|
}
|
|
33554
33555
|
}).current; // Takes care of trapping focus if focus is moved outside programmatically for example
|
|
33555
|
-
React$
|
|
33556
|
+
React$9.useEffect(()=>{
|
|
33556
33557
|
if (trapped) {
|
|
33557
33558
|
function handleFocusIn(event) {
|
|
33558
33559
|
if (focusScope.paused || !container1) return;
|
|
@@ -33580,7 +33581,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React$a.forwardR
|
|
|
33580
33581
|
container1,
|
|
33581
33582
|
focusScope.paused
|
|
33582
33583
|
]);
|
|
33583
|
-
React$
|
|
33584
|
+
React$9.useEffect(()=>{
|
|
33584
33585
|
if (container1) {
|
|
33585
33586
|
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
|
|
33586
33587
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -33619,7 +33620,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React$a.forwardR
|
|
|
33619
33620
|
onUnmountAutoFocus,
|
|
33620
33621
|
focusScope
|
|
33621
33622
|
]); // Takes care of looping focus (when tabbing whilst at the edges)
|
|
33622
|
-
const handleKeyDown = React$
|
|
33623
|
+
const handleKeyDown = React$9.useCallback((event)=>{
|
|
33623
33624
|
if (!loop && !trapped) return;
|
|
33624
33625
|
if (focusScope.paused) return;
|
|
33625
33626
|
const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
@@ -33649,7 +33650,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React$a.forwardR
|
|
|
33649
33650
|
trapped,
|
|
33650
33651
|
focusScope.paused
|
|
33651
33652
|
]);
|
|
33652
|
-
return /*#__PURE__*/ React$
|
|
33653
|
+
return /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
33653
33654
|
tabIndex: -1
|
|
33654
33655
|
}, scopeProps, {
|
|
33655
33656
|
ref: composedRefs,
|
|
@@ -33779,7 +33780,7 @@ function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
|
33779
33780
|
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
33780
33781
|
*
|
|
33781
33782
|
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
33782
|
-
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? React$
|
|
33783
|
+
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? React$9.useLayoutEffect : ()=>{};
|
|
33783
33784
|
|
|
33784
33785
|
const $1746a345f3d73bb7$var$useReactId = React__namespace['useId'.toString()] || (()=>undefined
|
|
33785
33786
|
);
|
|
@@ -33795,10 +33796,10 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
|
33795
33796
|
return deterministicId || (id ? `radix-${id}` : '');
|
|
33796
33797
|
}
|
|
33797
33798
|
|
|
33798
|
-
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React$
|
|
33799
|
+
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
33799
33800
|
var _globalThis$document;
|
|
33800
33801
|
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;
|
|
33801
|
-
return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ React$
|
|
33802
|
+
return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
33802
33803
|
ref: forwardedRef
|
|
33803
33804
|
})), container) : null;
|
|
33804
33805
|
});
|
|
@@ -33811,7 +33812,7 @@ function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: de
|
|
|
33811
33812
|
const isControlled = prop !== undefined;
|
|
33812
33813
|
const value1 = isControlled ? prop : uncontrolledProp;
|
|
33813
33814
|
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
33814
|
-
const setValue = React$
|
|
33815
|
+
const setValue = React$9.useCallback((nextValue)=>{
|
|
33815
33816
|
if (isControlled) {
|
|
33816
33817
|
const setter = nextValue;
|
|
33817
33818
|
const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
|
|
@@ -33829,11 +33830,11 @@ function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: de
|
|
|
33829
33830
|
];
|
|
33830
33831
|
}
|
|
33831
33832
|
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
|
33832
|
-
const uncontrolledState = React$
|
|
33833
|
+
const uncontrolledState = React$9.useState(defaultProp);
|
|
33833
33834
|
const [value] = uncontrolledState;
|
|
33834
|
-
const prevValueRef = React$
|
|
33835
|
+
const prevValueRef = React$9.useRef(value);
|
|
33835
33836
|
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
33836
|
-
React$
|
|
33837
|
+
React$9.useEffect(()=>{
|
|
33837
33838
|
if (prevValueRef.current !== value) {
|
|
33838
33839
|
handleChange(value);
|
|
33839
33840
|
prevValueRef.current = value;
|
|
@@ -33847,13 +33848,13 @@ function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp ,
|
|
|
33847
33848
|
}
|
|
33848
33849
|
|
|
33849
33850
|
function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
|
|
33850
|
-
const ref = React$
|
|
33851
|
+
const ref = React$9.useRef({
|
|
33851
33852
|
value: value,
|
|
33852
33853
|
previous: value
|
|
33853
33854
|
}); // We compare values before making an update to ensure that
|
|
33854
33855
|
// a change has been made. This ensures the previous value is
|
|
33855
33856
|
// persisted correctly between renders.
|
|
33856
|
-
return React$
|
|
33857
|
+
return React$9.useMemo(()=>{
|
|
33857
33858
|
if (ref.current.value !== value) {
|
|
33858
33859
|
ref.current.previous = ref.current.value;
|
|
33859
33860
|
ref.current.value = value;
|
|
@@ -33864,8 +33865,8 @@ function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
|
|
|
33864
33865
|
]);
|
|
33865
33866
|
}
|
|
33866
33867
|
|
|
33867
|
-
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ React$
|
|
33868
|
-
return /*#__PURE__*/ React$
|
|
33868
|
+
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
33869
|
+
return /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
|
|
33869
33870
|
ref: forwardedRef,
|
|
33870
33871
|
style: {
|
|
33871
33872
|
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
@@ -34107,7 +34108,7 @@ function assignRef(ref, value) {
|
|
|
34107
34108
|
* @returns {MutableRefObject}
|
|
34108
34109
|
*/
|
|
34109
34110
|
function useCallbackRef(initialValue, callback) {
|
|
34110
|
-
var ref = React$
|
|
34111
|
+
var ref = React$9.useState(function () { return ({
|
|
34111
34112
|
// value
|
|
34112
34113
|
value: initialValue,
|
|
34113
34114
|
// last callback
|
|
@@ -34748,9 +34749,9 @@ const [$cc7e05a45900e73f$var$SelectProvider, $cc7e05a45900e73f$var$useSelectCont
|
|
|
34748
34749
|
const [$cc7e05a45900e73f$var$SelectNativeOptionsProvider, $cc7e05a45900e73f$var$useSelectNativeOptionsContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
|
|
34749
34750
|
const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
34750
34751
|
const { __scopeSelect: __scopeSelect , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , value: valueProp , defaultValue: defaultValue , onValueChange: onValueChange , dir: dir , name: name , autoComplete: autoComplete , disabled: disabled , required: required } = props;
|
|
34751
|
-
const [trigger, setTrigger] = React$
|
|
34752
|
-
const [valueNode, setValueNode] = React$
|
|
34753
|
-
const [valueNodeHasChildren, setValueNodeHasChildren] = React$
|
|
34752
|
+
const [trigger, setTrigger] = React$9.useState(null);
|
|
34753
|
+
const [valueNode, setValueNode] = React$9.useState(null);
|
|
34754
|
+
const [valueNodeHasChildren, setValueNodeHasChildren] = React$9.useState(false);
|
|
34754
34755
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
34755
34756
|
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
34756
34757
|
prop: openProp,
|
|
@@ -34762,16 +34763,16 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
34762
34763
|
defaultProp: defaultValue,
|
|
34763
34764
|
onChange: onValueChange
|
|
34764
34765
|
});
|
|
34765
|
-
const triggerPointerDownPosRef = React$
|
|
34766
|
+
const triggerPointerDownPosRef = React$9.useRef(null); // We set this to true by default so that events bubble to forms without JS (SSR)
|
|
34766
34767
|
const isFormControl = trigger ? Boolean(trigger.closest('form')) : true;
|
|
34767
|
-
const [nativeOptionsSet, setNativeOptionsSet] = React$
|
|
34768
|
+
const [nativeOptionsSet, setNativeOptionsSet] = React$9.useState(new Set()); // The native `select` only associates the correct default value if the corresponding
|
|
34768
34769
|
// `option` is rendered as a child **at the same time** as itself.
|
|
34769
34770
|
// Because it might take a few renders for our items to gather the information to build
|
|
34770
34771
|
// the native `option`(s), we generate a key on the `select` to make sure React re-builds it
|
|
34771
34772
|
// each time the options change.
|
|
34772
34773
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option)=>option.props.value
|
|
34773
34774
|
).join(';');
|
|
34774
|
-
return /*#__PURE__*/ React$
|
|
34775
|
+
return /*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$SelectProvider, {
|
|
34775
34776
|
required: required,
|
|
34776
34777
|
scope: __scopeSelect,
|
|
34777
34778
|
trigger: trigger,
|
|
@@ -34788,22 +34789,22 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
34788
34789
|
dir: direction,
|
|
34789
34790
|
triggerPointerDownPosRef: triggerPointerDownPosRef,
|
|
34790
34791
|
disabled: disabled
|
|
34791
|
-
}, /*#__PURE__*/ React$
|
|
34792
|
+
}, /*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$Collection.Provider, {
|
|
34792
34793
|
scope: __scopeSelect
|
|
34793
|
-
}, /*#__PURE__*/ React$
|
|
34794
|
+
}, /*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$SelectNativeOptionsProvider, {
|
|
34794
34795
|
scope: props.__scopeSelect,
|
|
34795
|
-
onNativeOptionAdd: React$
|
|
34796
|
+
onNativeOptionAdd: React$9.useCallback((option)=>{
|
|
34796
34797
|
setNativeOptionsSet((prev)=>new Set(prev).add(option)
|
|
34797
34798
|
);
|
|
34798
34799
|
}, []),
|
|
34799
|
-
onNativeOptionRemove: React$
|
|
34800
|
+
onNativeOptionRemove: React$9.useCallback((option)=>{
|
|
34800
34801
|
setNativeOptionsSet((prev)=>{
|
|
34801
34802
|
const optionsSet = new Set(prev);
|
|
34802
34803
|
optionsSet.delete(option);
|
|
34803
34804
|
return optionsSet;
|
|
34804
34805
|
});
|
|
34805
34806
|
}, [])
|
|
34806
|
-
}, children)), isFormControl ? /*#__PURE__*/ React$
|
|
34807
|
+
}, children)), isFormControl ? /*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$BubbleSelect, {
|
|
34807
34808
|
key: nativeSelectKey,
|
|
34808
34809
|
"aria-hidden": true,
|
|
34809
34810
|
required: required,
|
|
@@ -34815,14 +34816,14 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
34815
34816
|
onChange: (event)=>setValue(event.target.value)
|
|
34816
34817
|
,
|
|
34817
34818
|
disabled: disabled
|
|
34818
|
-
}, value === undefined ? /*#__PURE__*/ React$
|
|
34819
|
+
}, value === undefined ? /*#__PURE__*/ React$9.createElement("option", {
|
|
34819
34820
|
value: ""
|
|
34820
34821
|
}) : null, Array.from(nativeOptionsSet)) : null);
|
|
34821
34822
|
};
|
|
34822
34823
|
/* -------------------------------------------------------------------------------------------------
|
|
34823
34824
|
* SelectTrigger
|
|
34824
34825
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$TRIGGER_NAME = 'SelectTrigger';
|
|
34825
|
-
const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$
|
|
34826
|
+
const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
34826
34827
|
const { __scopeSelect: __scopeSelect , disabled: disabled = false , ...triggerProps } = props;
|
|
34827
34828
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$TRIGGER_NAME, __scopeSelect);
|
|
34828
34829
|
const isDisabled = context.disabled || disabled;
|
|
@@ -34842,7 +34843,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$a.forwardRe
|
|
|
34842
34843
|
resetTypeahead();
|
|
34843
34844
|
}
|
|
34844
34845
|
};
|
|
34845
|
-
return /*#__PURE__*/ React$
|
|
34846
|
+
return /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
34846
34847
|
type: "button",
|
|
34847
34848
|
role: "combobox",
|
|
34848
34849
|
"aria-controls": context.contentId,
|
|
@@ -34896,7 +34897,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$a.forwardRe
|
|
|
34896
34897
|
/* -------------------------------------------------------------------------------------------------
|
|
34897
34898
|
* SelectValue
|
|
34898
34899
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$VALUE_NAME = 'SelectValue';
|
|
34899
|
-
const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ React$
|
|
34900
|
+
const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
34900
34901
|
// We ignore `className` and `style` as this part shouldn't be styled.
|
|
34901
34902
|
const { __scopeSelect: __scopeSelect , className: className , style: style , children: children , placeholder: placeholder , ...valueProps } = props;
|
|
34902
34903
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$VALUE_NAME, __scopeSelect);
|
|
@@ -34909,7 +34910,7 @@ const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ React$a.forwardR
|
|
|
34909
34910
|
onValueNodeHasChildrenChange,
|
|
34910
34911
|
hasChildren
|
|
34911
34912
|
]);
|
|
34912
|
-
return /*#__PURE__*/ React$
|
|
34913
|
+
return /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, valueProps, {
|
|
34913
34914
|
ref: composedRefs // we don't want events from the portalled `SelectValue` children to bubble
|
|
34914
34915
|
,
|
|
34915
34916
|
style: {
|
|
@@ -34917,67 +34918,67 @@ const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ React$a.forwardR
|
|
|
34917
34918
|
}
|
|
34918
34919
|
}), context.value === undefined && placeholder !== undefined ? placeholder : children);
|
|
34919
34920
|
});
|
|
34920
|
-
const $cc7e05a45900e73f$export$99b400cabb58c515 = /*#__PURE__*/ React$
|
|
34921
|
+
const $cc7e05a45900e73f$export$99b400cabb58c515 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
34921
34922
|
const { __scopeSelect: __scopeSelect , children: children , ...iconProps } = props;
|
|
34922
|
-
return /*#__PURE__*/ React$
|
|
34923
|
+
return /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
34923
34924
|
"aria-hidden": true
|
|
34924
34925
|
}, iconProps, {
|
|
34925
34926
|
ref: forwardedRef
|
|
34926
34927
|
}), children || '▼');
|
|
34927
34928
|
});
|
|
34928
34929
|
const $cc7e05a45900e73f$export$b2af6c9944296213 = (props)=>{
|
|
34929
|
-
return /*#__PURE__*/ React$
|
|
34930
|
+
return /*#__PURE__*/ React$9.createElement($f1701beae083dbae$export$602eac185826482c, _extends({
|
|
34930
34931
|
asChild: true
|
|
34931
34932
|
}, props));
|
|
34932
34933
|
};
|
|
34933
34934
|
/* -------------------------------------------------------------------------------------------------
|
|
34934
34935
|
* SelectContent
|
|
34935
34936
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$CONTENT_NAME = 'SelectContent';
|
|
34936
|
-
const $cc7e05a45900e73f$export$c973a4b3cb86a03d = /*#__PURE__*/ React$
|
|
34937
|
+
const $cc7e05a45900e73f$export$c973a4b3cb86a03d = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
34937
34938
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, props.__scopeSelect);
|
|
34938
|
-
const [fragment, setFragment] = React$
|
|
34939
|
+
const [fragment, setFragment] = React$9.useState(); // setting the fragment in `useLayoutEffect` as `DocumentFragment` doesn't exist on the server
|
|
34939
34940
|
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
34940
34941
|
setFragment(new DocumentFragment());
|
|
34941
34942
|
}, []);
|
|
34942
|
-
return /*#__PURE__*/ React$
|
|
34943
|
+
return /*#__PURE__*/ React$9.createElement(React$9.Fragment, null, context.open ? /*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$SelectContentImpl, _extends({}, props, {
|
|
34943
34944
|
ref: forwardedRef
|
|
34944
|
-
})) : fragment ? /*#__PURE__*/ reactDom.exports.createPortal(/*#__PURE__*/ React$
|
|
34945
|
+
})) : fragment ? /*#__PURE__*/ reactDom.exports.createPortal(/*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$SelectContentProvider, {
|
|
34945
34946
|
scope: props.__scopeSelect
|
|
34946
|
-
}, /*#__PURE__*/ React$
|
|
34947
|
+
}, /*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
34947
34948
|
scope: props.__scopeSelect
|
|
34948
|
-
}, /*#__PURE__*/ React$
|
|
34949
|
+
}, /*#__PURE__*/ React$9.createElement("div", null, props.children))), fragment) : null);
|
|
34949
34950
|
});
|
|
34950
34951
|
const $cc7e05a45900e73f$var$CONTENT_MARGIN = 10;
|
|
34951
34952
|
const [$cc7e05a45900e73f$var$SelectContentProvider, $cc7e05a45900e73f$var$useSelectContentContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$CONTENT_NAME);
|
|
34952
|
-
const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$
|
|
34953
|
+
const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
34953
34954
|
const { __scopeSelect: __scopeSelect , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
|
|
34954
34955
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
|
|
34955
|
-
const [contentWrapper, setContentWrapper] = React$
|
|
34956
|
-
const [content, setContent] = React$
|
|
34957
|
-
const [viewport, setViewport] = React$
|
|
34956
|
+
const [contentWrapper, setContentWrapper] = React$9.useState(null);
|
|
34957
|
+
const [content, setContent] = React$9.useState(null);
|
|
34958
|
+
const [viewport, setViewport] = React$9.useState(null);
|
|
34958
34959
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
34959
34960
|
);
|
|
34960
|
-
const [selectedItem, setSelectedItem] = React$
|
|
34961
|
-
const [selectedItemText, setSelectedItemText] = React$
|
|
34961
|
+
const [selectedItem, setSelectedItem] = React$9.useState(null);
|
|
34962
|
+
const [selectedItemText, setSelectedItemText] = React$9.useState(null);
|
|
34962
34963
|
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
34963
|
-
const [isPositioned, setIsPositioned] = React$
|
|
34964
|
-
const shouldRepositionRef = React$
|
|
34965
|
-
const shouldExpandOnScrollRef = React$
|
|
34966
|
-
const firstValidItemFoundRef = React$
|
|
34967
|
-
React$
|
|
34964
|
+
const [isPositioned, setIsPositioned] = React$9.useState(false);
|
|
34965
|
+
const shouldRepositionRef = React$9.useRef(true);
|
|
34966
|
+
const shouldExpandOnScrollRef = React$9.useRef(false);
|
|
34967
|
+
const firstValidItemFoundRef = React$9.useRef(false); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
34968
|
+
React$9.useEffect(()=>{
|
|
34968
34969
|
if (content) return hideOthers(content);
|
|
34969
34970
|
}, [
|
|
34970
34971
|
content
|
|
34971
34972
|
]); // Make sure the whole tree has focus guards as our `Select` may be
|
|
34972
34973
|
// the last element in the DOM (because of the `Portal`)
|
|
34973
34974
|
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
34974
|
-
const [contentZIndex, setContentZIndex] = React$
|
|
34975
|
+
const [contentZIndex, setContentZIndex] = React$9.useState();
|
|
34975
34976
|
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
34976
34977
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
34977
34978
|
}, [
|
|
34978
34979
|
content
|
|
34979
34980
|
]);
|
|
34980
|
-
const focusFirst = React$
|
|
34981
|
+
const focusFirst = React$9.useCallback((candidates)=>{
|
|
34981
34982
|
const [firstItem, ...restItems] = getItems().map((item)=>item.ref.current
|
|
34982
34983
|
);
|
|
34983
34984
|
const [lastItem] = restItems.slice(-1);
|
|
@@ -34997,7 +34998,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$a.forwardRef
|
|
|
34997
34998
|
getItems,
|
|
34998
34999
|
viewport
|
|
34999
35000
|
]);
|
|
35000
|
-
const position = React$
|
|
35001
|
+
const position = React$9.useCallback(()=>{
|
|
35001
35002
|
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
35002
35003
|
const triggerRect = context.trigger.getBoundingClientRect(); // -----------------------------------------------------------------------------------------
|
|
35003
35004
|
// Horizontal positioning
|
|
@@ -35092,7 +35093,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$a.forwardRef
|
|
|
35092
35093
|
, [
|
|
35093
35094
|
position
|
|
35094
35095
|
]);
|
|
35095
|
-
const focusSelectedItem = React$
|
|
35096
|
+
const focusSelectedItem = React$9.useCallback(()=>focusFirst([
|
|
35096
35097
|
selectedItem,
|
|
35097
35098
|
content
|
|
35098
35099
|
])
|
|
@@ -35102,7 +35103,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$a.forwardRef
|
|
|
35102
35103
|
content
|
|
35103
35104
|
]); // Since this is not dependent on layout, we want to ensure this runs at the same time as
|
|
35104
35105
|
// other effects across components. Hence why we don't call `focusSelectedItem` inside `position`.
|
|
35105
|
-
React$
|
|
35106
|
+
React$9.useEffect(()=>{
|
|
35106
35107
|
if (isPositioned) focusSelectedItem();
|
|
35107
35108
|
}, [
|
|
35108
35109
|
isPositioned,
|
|
@@ -35111,7 +35112,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$a.forwardRef
|
|
|
35111
35112
|
// Because it is part of the normal flow, it will push down the viewport, thus throwing our
|
|
35112
35113
|
// trigger => selectedItem alignment off by the amount the viewport was pushed down.
|
|
35113
35114
|
// We wait for this to happen and then re-run the positining logic one more time to account for it.
|
|
35114
|
-
const handleScrollButtonChange = React$
|
|
35115
|
+
const handleScrollButtonChange = React$9.useCallback((node)=>{
|
|
35115
35116
|
if (node && shouldRepositionRef.current === true) {
|
|
35116
35117
|
position();
|
|
35117
35118
|
focusSelectedItem();
|
|
@@ -35123,7 +35124,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$a.forwardRef
|
|
|
35123
35124
|
]); // prevent selecting items on `pointerup` in some cases after opening from `pointerdown`
|
|
35124
35125
|
// and close on `pointerup` outside.
|
|
35125
35126
|
const { onOpenChange: onOpenChange , triggerPointerDownPosRef: triggerPointerDownPosRef } = context;
|
|
35126
|
-
React$
|
|
35127
|
+
React$9.useEffect(()=>{
|
|
35127
35128
|
if (content) {
|
|
35128
35129
|
let pointerMoveDelta = {
|
|
35129
35130
|
x: 0,
|
|
@@ -35163,7 +35164,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$a.forwardRef
|
|
|
35163
35164
|
onOpenChange,
|
|
35164
35165
|
triggerPointerDownPosRef
|
|
35165
35166
|
]);
|
|
35166
|
-
React$
|
|
35167
|
+
React$9.useEffect(()=>{
|
|
35167
35168
|
const close = ()=>onOpenChange(false)
|
|
35168
35169
|
;
|
|
35169
35170
|
window.addEventListener('blur', close);
|
|
@@ -35187,7 +35188,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$a.forwardRef
|
|
|
35187
35188
|
*/ setTimeout(()=>nextItem.ref.current.focus()
|
|
35188
35189
|
);
|
|
35189
35190
|
});
|
|
35190
|
-
const itemRefCallback = React$
|
|
35191
|
+
const itemRefCallback = React$9.useCallback((node, value, disabled)=>{
|
|
35191
35192
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
35192
35193
|
const isSelectedItem = context.value !== undefined && context.value === value;
|
|
35193
35194
|
if (isSelectedItem || isFirstValidItem) {
|
|
@@ -35197,18 +35198,18 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$a.forwardRef
|
|
|
35197
35198
|
}, [
|
|
35198
35199
|
context.value
|
|
35199
35200
|
]);
|
|
35200
|
-
const handleItemLeave = React$
|
|
35201
|
+
const handleItemLeave = React$9.useCallback(()=>content === null || content === void 0 ? void 0 : content.focus()
|
|
35201
35202
|
, [
|
|
35202
35203
|
content
|
|
35203
35204
|
]);
|
|
35204
|
-
const itemTextRefCallback = React$
|
|
35205
|
+
const itemTextRefCallback = React$9.useCallback((node, value, disabled)=>{
|
|
35205
35206
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
35206
35207
|
const isSelectedItem = context.value !== undefined && context.value === value;
|
|
35207
35208
|
if (isSelectedItem || isFirstValidItem) setSelectedItemText(node);
|
|
35208
35209
|
}, [
|
|
35209
35210
|
context.value
|
|
35210
35211
|
]);
|
|
35211
|
-
return /*#__PURE__*/ React$
|
|
35212
|
+
return /*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$SelectContentProvider, {
|
|
35212
35213
|
scope: __scopeSelect,
|
|
35213
35214
|
contentWrapper: contentWrapper,
|
|
35214
35215
|
content: content,
|
|
@@ -35223,10 +35224,10 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$a.forwardRef
|
|
|
35223
35224
|
isPositioned: isPositioned,
|
|
35224
35225
|
shouldExpandOnScrollRef: shouldExpandOnScrollRef,
|
|
35225
35226
|
searchRef: searchRef
|
|
35226
|
-
}, /*#__PURE__*/ React$
|
|
35227
|
+
}, /*#__PURE__*/ React$9.createElement($01b9c$RemoveScroll, {
|
|
35227
35228
|
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
35228
35229
|
allowPinchZoom: true
|
|
35229
|
-
}, /*#__PURE__*/ React$
|
|
35230
|
+
}, /*#__PURE__*/ React$9.createElement("div", {
|
|
35230
35231
|
ref: setContentWrapper,
|
|
35231
35232
|
style: {
|
|
35232
35233
|
display: 'flex',
|
|
@@ -35234,7 +35235,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$a.forwardRef
|
|
|
35234
35235
|
position: 'fixed',
|
|
35235
35236
|
zIndex: contentZIndex
|
|
35236
35237
|
}
|
|
35237
|
-
}, /*#__PURE__*/ React$
|
|
35238
|
+
}, /*#__PURE__*/ React$9.createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
35238
35239
|
asChild: true // we make sure we're not trapping once it's been closed
|
|
35239
35240
|
,
|
|
35240
35241
|
trapped: context.open,
|
|
@@ -35249,7 +35250,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$a.forwardRef
|
|
|
35249
35250
|
});
|
|
35250
35251
|
event.preventDefault();
|
|
35251
35252
|
})
|
|
35252
|
-
}, /*#__PURE__*/ React$
|
|
35253
|
+
}, /*#__PURE__*/ React$9.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends({
|
|
35253
35254
|
role: "listbox",
|
|
35254
35255
|
id: context.contentId,
|
|
35255
35256
|
"data-state": context.open ? 'open' : 'closed',
|
|
@@ -35312,18 +35313,18 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$a.forwardRef
|
|
|
35312
35313
|
/* -------------------------------------------------------------------------------------------------
|
|
35313
35314
|
* SelectViewport
|
|
35314
35315
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$VIEWPORT_NAME = 'SelectViewport';
|
|
35315
|
-
const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React$
|
|
35316
|
+
const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
35316
35317
|
const { __scopeSelect: __scopeSelect , ...viewportProps } = props;
|
|
35317
35318
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
|
|
35318
35319
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onViewportChange);
|
|
35319
|
-
const prevScrollTopRef = React$
|
|
35320
|
-
return /*#__PURE__*/ React$
|
|
35320
|
+
const prevScrollTopRef = React$9.useRef(0);
|
|
35321
|
+
return /*#__PURE__*/ React$9.createElement(React$9.Fragment, null, /*#__PURE__*/ React$9.createElement("style", {
|
|
35321
35322
|
dangerouslySetInnerHTML: {
|
|
35322
35323
|
__html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`
|
|
35323
35324
|
}
|
|
35324
|
-
}), /*#__PURE__*/ React$
|
|
35325
|
+
}), /*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
35325
35326
|
scope: __scopeSelect
|
|
35326
|
-
}, /*#__PURE__*/ React$
|
|
35327
|
+
}, /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
35327
35328
|
"data-radix-select-viewport": "",
|
|
35328
35329
|
role: "presentation"
|
|
35329
35330
|
}, viewportProps, {
|
|
@@ -35371,13 +35372,13 @@ $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$GROUP_NAME);
|
|
|
35371
35372
|
* SelectItem
|
|
35372
35373
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$ITEM_NAME = 'SelectItem';
|
|
35373
35374
|
const [$cc7e05a45900e73f$var$SelectItemContextProvider, $cc7e05a45900e73f$var$useSelectItemContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$ITEM_NAME);
|
|
35374
|
-
const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React$
|
|
35375
|
+
const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
35375
35376
|
const { __scopeSelect: __scopeSelect , value: value , disabled: disabled = false , textValue: textValueProp , ...itemProps } = props;
|
|
35376
35377
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$ITEM_NAME, __scopeSelect);
|
|
35377
35378
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$ITEM_NAME, __scopeSelect);
|
|
35378
35379
|
const isSelected = context.value === value;
|
|
35379
|
-
const [textValue, setTextValue] = React$
|
|
35380
|
-
const [isFocused, setIsFocused] = React$
|
|
35380
|
+
const [textValue, setTextValue] = React$9.useState(textValueProp !== null && textValueProp !== void 0 ? textValueProp : '');
|
|
35381
|
+
const [isFocused, setIsFocused] = React$9.useState(false);
|
|
35381
35382
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>{
|
|
35382
35383
|
var _contentContext$itemR;
|
|
35383
35384
|
return (_contentContext$itemR = contentContext.itemRefCallback) === null || _contentContext$itemR === void 0 ? void 0 : _contentContext$itemR.call(contentContext, node, value, disabled);
|
|
@@ -35389,24 +35390,24 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React$a.forwardR
|
|
|
35389
35390
|
context.onOpenChange(false);
|
|
35390
35391
|
}
|
|
35391
35392
|
};
|
|
35392
|
-
return /*#__PURE__*/ React$
|
|
35393
|
+
return /*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$SelectItemContextProvider, {
|
|
35393
35394
|
scope: __scopeSelect,
|
|
35394
35395
|
value: value,
|
|
35395
35396
|
disabled: disabled,
|
|
35396
35397
|
textId: textId,
|
|
35397
35398
|
isSelected: isSelected,
|
|
35398
|
-
onItemTextChange: React$
|
|
35399
|
+
onItemTextChange: React$9.useCallback((node)=>{
|
|
35399
35400
|
setTextValue((prevTextValue)=>{
|
|
35400
35401
|
var _node$textContent;
|
|
35401
35402
|
return prevTextValue || ((_node$textContent = node === null || node === void 0 ? void 0 : node.textContent) !== null && _node$textContent !== void 0 ? _node$textContent : '').trim();
|
|
35402
35403
|
});
|
|
35403
35404
|
}, [])
|
|
35404
|
-
}, /*#__PURE__*/ React$
|
|
35405
|
+
}, /*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$Collection.ItemSlot, {
|
|
35405
35406
|
scope: __scopeSelect,
|
|
35406
35407
|
value: value,
|
|
35407
35408
|
disabled: disabled,
|
|
35408
35409
|
textValue: textValue
|
|
35409
|
-
}, /*#__PURE__*/ React$
|
|
35410
|
+
}, /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
35410
35411
|
role: "option",
|
|
35411
35412
|
"aria-labelledby": textId,
|
|
35412
35413
|
"data-highlighted": isFocused ? '' : undefined // `isFocused` caveat fixes stuttering in VoiceOver
|
|
@@ -35451,21 +35452,21 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React$a.forwardR
|
|
|
35451
35452
|
/* -------------------------------------------------------------------------------------------------
|
|
35452
35453
|
* SelectItemText
|
|
35453
35454
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$ITEM_TEXT_NAME = 'SelectItemText';
|
|
35454
|
-
const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React$
|
|
35455
|
+
const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
35455
35456
|
// We ignore `className` and `style` as this part shouldn't be styled.
|
|
35456
35457
|
const { __scopeSelect: __scopeSelect , className: className , style: style , ...itemTextProps } = props;
|
|
35457
35458
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
35458
35459
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
35459
35460
|
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
35460
35461
|
const nativeOptionsContext = $cc7e05a45900e73f$var$useSelectNativeOptionsContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
35461
|
-
const [itemTextNode, setItemTextNode] = React$
|
|
35462
|
+
const [itemTextNode, setItemTextNode] = React$9.useState(null);
|
|
35462
35463
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setItemTextNode(node)
|
|
35463
35464
|
, itemContext.onItemTextChange, (node)=>{
|
|
35464
35465
|
var _contentContext$itemT;
|
|
35465
35466
|
return (_contentContext$itemT = contentContext.itemTextRefCallback) === null || _contentContext$itemT === void 0 ? void 0 : _contentContext$itemT.call(contentContext, node, itemContext.value, itemContext.disabled);
|
|
35466
35467
|
});
|
|
35467
35468
|
const textContent = itemTextNode === null || itemTextNode === void 0 ? void 0 : itemTextNode.textContent;
|
|
35468
|
-
const nativeOption = React$
|
|
35469
|
+
const nativeOption = React$9.useMemo(()=>/*#__PURE__*/ React$9.createElement("option", {
|
|
35469
35470
|
key: itemContext.value,
|
|
35470
35471
|
value: itemContext.value,
|
|
35471
35472
|
disabled: itemContext.disabled
|
|
@@ -35485,7 +35486,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React$a.forwardR
|
|
|
35485
35486
|
onNativeOptionRemove,
|
|
35486
35487
|
nativeOption
|
|
35487
35488
|
]);
|
|
35488
|
-
return /*#__PURE__*/ React$
|
|
35489
|
+
return /*#__PURE__*/ React$9.createElement(React$9.Fragment, null, /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
35489
35490
|
id: itemContext.textId
|
|
35490
35491
|
}, itemTextProps, {
|
|
35491
35492
|
ref: composedRefs
|
|
@@ -35494,10 +35495,10 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React$a.forwardR
|
|
|
35494
35495
|
/* -------------------------------------------------------------------------------------------------
|
|
35495
35496
|
* SelectItemIndicator
|
|
35496
35497
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$ITEM_INDICATOR_NAME = 'SelectItemIndicator';
|
|
35497
|
-
const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ React$
|
|
35498
|
+
const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
35498
35499
|
const { __scopeSelect: __scopeSelect , ...itemIndicatorProps } = props;
|
|
35499
35500
|
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_INDICATOR_NAME, __scopeSelect);
|
|
35500
|
-
return itemContext.isSelected ? /*#__PURE__*/ React$
|
|
35501
|
+
return itemContext.isSelected ? /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
35501
35502
|
"aria-hidden": true
|
|
35502
35503
|
}, itemIndicatorProps, {
|
|
35503
35504
|
ref: forwardedRef
|
|
@@ -35506,9 +35507,9 @@ const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ React$a.forwardR
|
|
|
35506
35507
|
/* -------------------------------------------------------------------------------------------------
|
|
35507
35508
|
* SelectScrollUpButton
|
|
35508
35509
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME = 'SelectScrollUpButton';
|
|
35509
|
-
const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React$
|
|
35510
|
+
const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
35510
35511
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
35511
|
-
const [canScrollUp1, setCanScrollUp] = React$
|
|
35512
|
+
const [canScrollUp1, setCanScrollUp] = React$9.useState(false);
|
|
35512
35513
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onScrollButtonChange);
|
|
35513
35514
|
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
35514
35515
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -35526,7 +35527,7 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React$a.forwardR
|
|
|
35526
35527
|
contentContext.viewport,
|
|
35527
35528
|
contentContext.isPositioned
|
|
35528
35529
|
]);
|
|
35529
|
-
return canScrollUp1 ? /*#__PURE__*/ React$
|
|
35530
|
+
return canScrollUp1 ? /*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, _extends({}, props, {
|
|
35530
35531
|
ref: composedRefs,
|
|
35531
35532
|
onAutoScroll: ()=>{
|
|
35532
35533
|
const { viewport: viewport , selectedItem: selectedItem } = contentContext;
|
|
@@ -35537,9 +35538,9 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React$a.forwardR
|
|
|
35537
35538
|
/* -------------------------------------------------------------------------------------------------
|
|
35538
35539
|
* SelectScrollDownButton
|
|
35539
35540
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME = 'SelectScrollDownButton';
|
|
35540
|
-
const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React$
|
|
35541
|
+
const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
35541
35542
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
35542
|
-
const [canScrollDown1, setCanScrollDown] = React$
|
|
35543
|
+
const [canScrollDown1, setCanScrollDown] = React$9.useState(false);
|
|
35543
35544
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onScrollButtonChange);
|
|
35544
35545
|
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
35545
35546
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -35559,7 +35560,7 @@ const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React$a.forwardRe
|
|
|
35559
35560
|
contentContext.viewport,
|
|
35560
35561
|
contentContext.isPositioned
|
|
35561
35562
|
]);
|
|
35562
|
-
return canScrollDown1 ? /*#__PURE__*/ React$
|
|
35563
|
+
return canScrollDown1 ? /*#__PURE__*/ React$9.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, _extends({}, props, {
|
|
35563
35564
|
ref: composedRefs,
|
|
35564
35565
|
onAutoScroll: ()=>{
|
|
35565
35566
|
const { viewport: viewport , selectedItem: selectedItem } = contentContext;
|
|
@@ -35567,18 +35568,18 @@ const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React$a.forwardRe
|
|
|
35567
35568
|
}
|
|
35568
35569
|
})) : null;
|
|
35569
35570
|
});
|
|
35570
|
-
const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$
|
|
35571
|
+
const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
35571
35572
|
const { __scopeSelect: __scopeSelect , onAutoScroll: onAutoScroll , ...scrollIndicatorProps } = props;
|
|
35572
35573
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext('SelectScrollButton', __scopeSelect);
|
|
35573
|
-
const autoScrollTimerRef = React$
|
|
35574
|
+
const autoScrollTimerRef = React$9.useRef(null);
|
|
35574
35575
|
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
35575
|
-
const clearAutoScrollTimer = React$
|
|
35576
|
+
const clearAutoScrollTimer = React$9.useCallback(()=>{
|
|
35576
35577
|
if (autoScrollTimerRef.current !== null) {
|
|
35577
35578
|
window.clearInterval(autoScrollTimerRef.current);
|
|
35578
35579
|
autoScrollTimerRef.current = null;
|
|
35579
35580
|
}
|
|
35580
35581
|
}, []);
|
|
35581
|
-
React$
|
|
35582
|
+
React$9.useEffect(()=>{
|
|
35582
35583
|
return ()=>clearAutoScrollTimer()
|
|
35583
35584
|
;
|
|
35584
35585
|
}, [
|
|
@@ -35597,7 +35598,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$a.forwa
|
|
|
35597
35598
|
}, [
|
|
35598
35599
|
getItems
|
|
35599
35600
|
]);
|
|
35600
|
-
return /*#__PURE__*/ React$
|
|
35601
|
+
return /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
35601
35602
|
"aria-hidden": true
|
|
35602
35603
|
}, scrollIndicatorProps, {
|
|
35603
35604
|
ref: forwardedRef,
|
|
@@ -35615,12 +35616,12 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$a.forwa
|
|
|
35615
35616
|
})
|
|
35616
35617
|
}));
|
|
35617
35618
|
});
|
|
35618
|
-
/* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$BubbleSelect = /*#__PURE__*/ React$
|
|
35619
|
+
/* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$BubbleSelect = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
35619
35620
|
const { value: value , ...selectProps } = props;
|
|
35620
|
-
const ref = React$
|
|
35621
|
+
const ref = React$9.useRef(null);
|
|
35621
35622
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
35622
35623
|
const prevValue = $010c2913dbd2fe3d$export$5cae361ad82dce8b(value); // Bubble value change to parents (e.g form change event)
|
|
35623
|
-
React$
|
|
35624
|
+
React$9.useEffect(()=>{
|
|
35624
35625
|
const select = ref.current;
|
|
35625
35626
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
35626
35627
|
const descriptor = Object.getOwnPropertyDescriptor(selectProto, 'value');
|
|
@@ -35647,9 +35648,9 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$a.forwa
|
|
|
35647
35648
|
*
|
|
35648
35649
|
* We use `VisuallyHidden` rather than `display: "none"` because Safari autofill
|
|
35649
35650
|
* won't work otherwise.
|
|
35650
|
-
*/ return /*#__PURE__*/ React$
|
|
35651
|
+
*/ return /*#__PURE__*/ React$9.createElement($ea1ef594cf570d83$export$439d29a4e110a164, {
|
|
35651
35652
|
asChild: true
|
|
35652
|
-
}, /*#__PURE__*/ React$
|
|
35653
|
+
}, /*#__PURE__*/ React$9.createElement("select", _extends({}, selectProps, {
|
|
35653
35654
|
ref: composedRefs,
|
|
35654
35655
|
defaultValue: value
|
|
35655
35656
|
})));
|
|
@@ -35657,9 +35658,9 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$a.forwa
|
|
|
35657
35658
|
$cc7e05a45900e73f$var$BubbleSelect.displayName = 'BubbleSelect';
|
|
35658
35659
|
function $cc7e05a45900e73f$var$useTypeaheadSearch(onSearchChange) {
|
|
35659
35660
|
const handleSearchChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onSearchChange);
|
|
35660
|
-
const searchRef = React$
|
|
35661
|
-
const timerRef = React$
|
|
35662
|
-
const handleTypeaheadSearch = React$
|
|
35661
|
+
const searchRef = React$9.useRef('');
|
|
35662
|
+
const timerRef = React$9.useRef(0);
|
|
35663
|
+
const handleTypeaheadSearch = React$9.useCallback((key)=>{
|
|
35663
35664
|
const search = searchRef.current + key;
|
|
35664
35665
|
handleSearchChange(search);
|
|
35665
35666
|
(function updateSearch(value) {
|
|
@@ -35671,11 +35672,11 @@ function $cc7e05a45900e73f$var$useTypeaheadSearch(onSearchChange) {
|
|
|
35671
35672
|
}, [
|
|
35672
35673
|
handleSearchChange
|
|
35673
35674
|
]);
|
|
35674
|
-
const resetTypeahead = React$
|
|
35675
|
+
const resetTypeahead = React$9.useCallback(()=>{
|
|
35675
35676
|
searchRef.current = '';
|
|
35676
35677
|
window.clearTimeout(timerRef.current);
|
|
35677
35678
|
}, []);
|
|
35678
|
-
React$
|
|
35679
|
+
React$9.useEffect(()=>{
|
|
35679
35680
|
return ()=>window.clearTimeout(timerRef.current)
|
|
35680
35681
|
;
|
|
35681
35682
|
}, []);
|
|
@@ -35734,28 +35735,8 @@ const $cc7e05a45900e73f$export$c3468e2714d175fa = $cc7e05a45900e73f$export$6b919
|
|
|
35734
35735
|
const $cc7e05a45900e73f$export$2f60d3ec9ad468f2 = $cc7e05a45900e73f$export$d8117927658af6d7;
|
|
35735
35736
|
const $cc7e05a45900e73f$export$bf1aedc3039c8d63 = $cc7e05a45900e73f$export$ff951e476c12189;
|
|
35736
35737
|
|
|
35737
|
-
const React$1 = React__default["default"];
|
|
35738
|
-
const BtIconChevronUp2Px = props =>
|
|
35739
|
-
/*#__PURE__*/ React$1.createElement(
|
|
35740
|
-
"svg",
|
|
35741
|
-
Object.assign(
|
|
35742
|
-
{
|
|
35743
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
35744
|
-
viewBox: "0 0 32 32"
|
|
35745
|
-
},
|
|
35746
|
-
props
|
|
35747
|
-
),
|
|
35748
|
-
/*#__PURE__*/ React$1.createElement("defs", null),
|
|
35749
|
-
/*#__PURE__*/ React$1.createElement("path", {
|
|
35750
|
-
d:
|
|
35751
|
-
"M28.999,23.5a.99676.99676,0,0,1-.707-.293l-12.28515-12.293L3.708,23.207A.99989.99989,0,0,1,2.294,21.793l13.71289-13.707L29.70605,21.793a.99976.99976,0,0,1-.707,1.707Z",
|
|
35752
|
-
fill: "currentColor"
|
|
35753
|
-
})
|
|
35754
|
-
);
|
|
35755
|
-
var BtIconChevronUp2Px_2 = BtIconChevronUp2Px;
|
|
35756
|
-
|
|
35757
35738
|
const React = React__default["default"];
|
|
35758
|
-
const
|
|
35739
|
+
const BtIconChevronUp2Px = props =>
|
|
35759
35740
|
/*#__PURE__*/ React.createElement(
|
|
35760
35741
|
"svg",
|
|
35761
35742
|
Object.assign(
|
|
@@ -35768,19 +35749,19 @@ const BtIconTickAlt2Px = props =>
|
|
|
35768
35749
|
/*#__PURE__*/ React.createElement("defs", null),
|
|
35769
35750
|
/*#__PURE__*/ React.createElement("path", {
|
|
35770
35751
|
d:
|
|
35771
|
-
"
|
|
35752
|
+
"M28.999,23.5a.99676.99676,0,0,1-.707-.293l-12.28515-12.293L3.708,23.207A.99989.99989,0,0,1,2.294,21.793l13.71289-13.707L29.70605,21.793a.99976.99976,0,0,1-.707,1.707Z",
|
|
35772
35753
|
fill: "currentColor"
|
|
35773
35754
|
})
|
|
35774
35755
|
);
|
|
35775
|
-
var
|
|
35756
|
+
var BtIconChevronUp2Px_2 = BtIconChevronUp2Px;
|
|
35776
35757
|
|
|
35777
35758
|
/** Use `Select` to choose from a dropdown list of options. */
|
|
35778
35759
|
var Select = function (_a) {
|
|
35779
35760
|
var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, name = _a.name, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure;
|
|
35780
|
-
var id = React$
|
|
35781
|
-
var arcRootElement = React$
|
|
35782
|
-
var surface = React$
|
|
35783
|
-
var _b = React$
|
|
35761
|
+
var id = React$9.useId();
|
|
35762
|
+
var arcRootElement = React$9.useContext(ArcRootElementContext);
|
|
35763
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
35764
|
+
var _b = React$9.useState(defaultValue), selectedValue = _b[0], setSelectedValue = _b[1];
|
|
35784
35765
|
var onValueChange = function (value) {
|
|
35785
35766
|
onChange && onChange(value);
|
|
35786
35767
|
setSelectedValue(value);
|
|
@@ -35830,7 +35811,7 @@ var ArcBreakpointL = 1024;
|
|
|
35830
35811
|
*/
|
|
35831
35812
|
var SiteFooter = function (_a) {
|
|
35832
35813
|
var children = _a.children, currentYear = _a.currentYear, _b = _a.curve, curve = _b === void 0 ? true : _b, logoLabel = _a.logoLabel, main = _a.main, siteName = _a.siteName, props = __rest$2(_a, ["children", "currentYear", "curve", "logoLabel", "main", "siteName"]);
|
|
35833
|
-
React$
|
|
35814
|
+
React$9.useEffect(function () {
|
|
35834
35815
|
React__default["default"].Children.map(children, function (item) {
|
|
35835
35816
|
if (item && item.type !== SiteFooterItem) {
|
|
35836
35817
|
throw new Error("Illegal child passed to <SiteFooter />. Ensure to only use <SiteFooter.Item />.");
|
|
@@ -35857,9 +35838,9 @@ var SiteFooter = function (_a) {
|
|
|
35857
35838
|
var SiteFooterItemGroup = function (_a) {
|
|
35858
35839
|
var children = _a.children, title = _a.title;
|
|
35859
35840
|
var isMinWidthArcBreakpointM = useMediaQuery("(min-width: ".concat(ArcBreakpointM, "px)"));
|
|
35860
|
-
React$
|
|
35841
|
+
React$9.useEffect(function () {
|
|
35861
35842
|
React__default["default"].Children.map(children, function (item) {
|
|
35862
|
-
if (item && item.type !== SiteFooterItem && item.type !== React$
|
|
35843
|
+
if (item && item.type !== SiteFooterItem && item.type !== React$9.Fragment) {
|
|
35863
35844
|
throw new Error("Illegal child passed to <SiteFooterItemGroup />. Ensure to only use <SiteFooter.Item />.");
|
|
35864
35845
|
}
|
|
35865
35846
|
});
|
|
@@ -35917,16 +35898,16 @@ var Item = function (_a) {
|
|
|
35917
35898
|
|
|
35918
35899
|
var ItemGroup = function (_a) {
|
|
35919
35900
|
var children = _a.children, href = _a.href, title = _a.title, onClick = _a.onClick, viewAllTitle = _a.viewAllTitle, props = __rest$2(_a, ["children", "href", "title", "onClick", "viewAllTitle"]);
|
|
35920
|
-
var _b = React$
|
|
35901
|
+
var _b = React$9.useState(false), hasClientSideJavaScript = _b[0], setHasClientSideJavaScript = _b[1];
|
|
35921
35902
|
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
35922
|
-
React$
|
|
35903
|
+
React$9.useEffect(function () {
|
|
35923
35904
|
React__default["default"].Children.map(children, function (item) {
|
|
35924
|
-
if (item && item.type !== Item && item.type !== React$
|
|
35905
|
+
if (item && item.type !== Item && item.type !== React$9.Fragment) {
|
|
35925
35906
|
throw new Error("Illegal child passed to <SiteHeader.ItemGroup />. Ensure to only use <SiteHeader.Item />.");
|
|
35926
35907
|
}
|
|
35927
35908
|
});
|
|
35928
35909
|
}, [children]);
|
|
35929
|
-
React$
|
|
35910
|
+
React$9.useEffect(function () {
|
|
35930
35911
|
// useEffect does not run in ReactDomServer renders
|
|
35931
35912
|
setHasClientSideJavaScript(true);
|
|
35932
35913
|
}, [setHasClientSideJavaScript]);
|
|
@@ -35982,7 +35963,7 @@ var ItemGroupRehydrator = (function (el, hydrate) { return __awaiter(void 0, voi
|
|
|
35982
35963
|
|
|
35983
35964
|
var Column = function (_a) {
|
|
35984
35965
|
var children = _a.children, props = __rest$2(_a, ["children"]);
|
|
35985
|
-
React$
|
|
35966
|
+
React$9.useEffect(function () {
|
|
35986
35967
|
React__default["default"].Children.map(children, function (item) {
|
|
35987
35968
|
if (item && item.type !== ItemGroup) {
|
|
35988
35969
|
throw new Error("Illegal child passed to <SiteHeader.Column />. Ensure to only use <SiteHeader.ItemGroup />.");
|
|
@@ -36006,8 +35987,8 @@ var BackButton = function (_a) {
|
|
|
36006
35987
|
var Panel = function (_a) {
|
|
36007
35988
|
var _b;
|
|
36008
35989
|
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$2(_a, ["children", "navItemRef", "open", "promo", "setOpen", "subNavItemRef", "subNavLink", "title", "viewAll", "withSubNav"]);
|
|
36009
|
-
var transparent = React$
|
|
36010
|
-
React$
|
|
35990
|
+
var transparent = React$9.useContext(Context).transparent;
|
|
35991
|
+
React$9.useEffect(function () {
|
|
36011
35992
|
// Where appropriate, close the Panel when clicking outside of it,
|
|
36012
35993
|
// by listening to clicks on the entire document and acting accordingly.
|
|
36013
35994
|
var handleClick = function (e) {
|
|
@@ -36043,7 +36024,7 @@ var Panel = function (_a) {
|
|
|
36043
36024
|
document.removeEventListener("click", handleClick);
|
|
36044
36025
|
};
|
|
36045
36026
|
}, [navItemRef, setOpen, subNavItemRef, subNavLink]);
|
|
36046
|
-
React$
|
|
36027
|
+
React$9.useEffect(function () {
|
|
36047
36028
|
var handleKeydown = function (e) {
|
|
36048
36029
|
// Check the viewport width at time of press
|
|
36049
36030
|
var isMinWidthArcBreakpointL = window.matchMedia("(min-width: ".concat(ArcBreakpointL, "px)")).matches;
|
|
@@ -36091,15 +36072,15 @@ Panel.ViewAll = ViewAll;
|
|
|
36091
36072
|
var NavItem = function (_a) {
|
|
36092
36073
|
var _b, _c;
|
|
36093
36074
|
var children = _a.children, href = _a.href, isCurrent = _a.isCurrent, onClick = _a.onClick, promo = _a.promo, title = _a.title, viewAllTitle = _a.viewAllTitle, props = __rest$2(_a, ["children", "href", "isCurrent", "onClick", "promo", "title", "viewAllTitle"]);
|
|
36094
|
-
var navItem = React$
|
|
36095
|
-
var _d = React$
|
|
36075
|
+
var navItem = React$9.useRef();
|
|
36076
|
+
var _d = React$9.useState(false), panelOpen = _d[0], setPanelOpen = _d[1];
|
|
36096
36077
|
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
36097
|
-
React$
|
|
36078
|
+
React$9.useEffect(function () {
|
|
36098
36079
|
React__default["default"].Children.map(children, function (item) {
|
|
36099
36080
|
if (item &&
|
|
36100
36081
|
item.type !== ItemGroup &&
|
|
36101
36082
|
item.type !== Column &&
|
|
36102
|
-
item.type !== React$
|
|
36083
|
+
item.type !== React$9.Fragment) {
|
|
36103
36084
|
throw new Error("Illegal child passed to <SiteHeader.NavItem />. Ensure to only use <SiteHeader.ItemGroup /> or <SiteHeader.Column />.");
|
|
36104
36085
|
}
|
|
36105
36086
|
});
|
|
@@ -36167,21 +36148,21 @@ var NavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, void
|
|
|
36167
36148
|
var SubNavItem = function (_a) {
|
|
36168
36149
|
var _b, _c;
|
|
36169
36150
|
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$2(_a, ["children", "isDefaultItem", "href", "onClick", "offsetXL", "promo", "subTitle", "title", "viewAllTitle"]);
|
|
36170
|
-
var navItem = React$
|
|
36171
|
-
var subNavItem = React$
|
|
36172
|
-
var _e = React$
|
|
36151
|
+
var navItem = React$9.useContext(Context$1).navItem;
|
|
36152
|
+
var subNavItem = React$9.useRef();
|
|
36153
|
+
var _e = React$9.useState(false), panelOpen = _e[0], setPanelOpen = _e[1];
|
|
36173
36154
|
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
36174
|
-
React$
|
|
36155
|
+
React$9.useEffect(function () {
|
|
36175
36156
|
React__default["default"].Children.map(children, function (item) {
|
|
36176
36157
|
if (item &&
|
|
36177
36158
|
item.type !== ItemGroup &&
|
|
36178
36159
|
item.type !== Column &&
|
|
36179
|
-
item.type !== React$
|
|
36160
|
+
item.type !== React$9.Fragment) {
|
|
36180
36161
|
throw new Error("Illegal child passed to <SiteHeader.SubNavItem />. Ensure to only use <SiteHeader.ItemGroup /> or <SiteHeader.Column />.");
|
|
36181
36162
|
}
|
|
36182
36163
|
});
|
|
36183
36164
|
}, [children]);
|
|
36184
|
-
React$
|
|
36165
|
+
React$9.useEffect(function () {
|
|
36185
36166
|
if (isDefaultItem && isMinWidthArcBreakpointL) {
|
|
36186
36167
|
setPanelOpen(true);
|
|
36187
36168
|
}
|
|
@@ -36268,18 +36249,18 @@ var SubNavItemRehydrator = (function (el, hydrate) { return __awaiter(void 0, vo
|
|
|
36268
36249
|
}); });
|
|
36269
36250
|
|
|
36270
36251
|
var defaultContext$1 = { navItem: null, subTitle: null };
|
|
36271
|
-
var Context$1 = React$
|
|
36252
|
+
var Context$1 = React$9.createContext(defaultContext$1);
|
|
36272
36253
|
var Provider$1 = Context$1.Provider;
|
|
36273
36254
|
var NavItemWithSubNav = function (_a) {
|
|
36274
36255
|
var _b, _c;
|
|
36275
36256
|
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$2(_a, ["href", "slot1", "slot2", "slot3", "subTitle", "title", "onViewAllClick", "viewAllTitle"]);
|
|
36276
|
-
var navItem = React$
|
|
36277
|
-
var _e = React$
|
|
36278
|
-
var _f = React$
|
|
36257
|
+
var navItem = React$9.useRef();
|
|
36258
|
+
var _e = React$9.useState(true), defaultItem = _e[0], setDefaultItem = _e[1];
|
|
36259
|
+
var _f = React$9.useState(false), panelOpen = _f[0], setPanelOpen = _f[1];
|
|
36279
36260
|
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
36280
|
-
React$
|
|
36261
|
+
React$9.useEffect(function () {
|
|
36281
36262
|
React__default["default"].Children.map(slot1, function (item) {
|
|
36282
|
-
if (item && item.type !== SubNavItem && item.type !== React$
|
|
36263
|
+
if (item && item.type !== SubNavItem && item.type !== React$9.Fragment) {
|
|
36283
36264
|
throw new Error("Illegal child passed to <SiteHeader.NavItemWithSubNav /> `slot1` prop. Ensure to only use <SiteHeader.SubNavItem />.");
|
|
36284
36265
|
}
|
|
36285
36266
|
if (item.props.isDefaultItem) {
|
|
@@ -36287,7 +36268,7 @@ var NavItemWithSubNav = function (_a) {
|
|
|
36287
36268
|
}
|
|
36288
36269
|
});
|
|
36289
36270
|
React__default["default"].Children.map(slot2, function (item) {
|
|
36290
|
-
if (item && item.type !== SubNavItem && item.type !== React$
|
|
36271
|
+
if (item && item.type !== SubNavItem && item.type !== React$9.Fragment) {
|
|
36291
36272
|
throw new Error("Illegal child passed to <SiteHeader.NavItemWithSubNav /> `slot2` prop. Ensure to only use <SiteHeader.SubNavItem />.");
|
|
36292
36273
|
}
|
|
36293
36274
|
if (item.props.isDefaultItem) {
|
|
@@ -36295,7 +36276,7 @@ var NavItemWithSubNav = function (_a) {
|
|
|
36295
36276
|
}
|
|
36296
36277
|
});
|
|
36297
36278
|
React__default["default"].Children.map(slot3, function (item) {
|
|
36298
|
-
if (item && item.type !== SubNavItem && item.type !== React$
|
|
36279
|
+
if (item && item.type !== SubNavItem && item.type !== React$9.Fragment) {
|
|
36299
36280
|
throw new Error("Illegal child passed to <SiteHeader.NavItemWithSubNav /> `slot3` prop. Ensure to only use <SiteHeader.SubNavItem />.");
|
|
36300
36281
|
}
|
|
36301
36282
|
if (item.props.isDefaultItem) {
|
|
@@ -36395,7 +36376,7 @@ var MenuButton = function (_a) {
|
|
|
36395
36376
|
};
|
|
36396
36377
|
|
|
36397
36378
|
var defaultContext = { transparent: false };
|
|
36398
|
-
var Context = React$
|
|
36379
|
+
var Context = React$9.createContext(defaultContext);
|
|
36399
36380
|
var Provider = Context.Provider;
|
|
36400
36381
|
/**
|
|
36401
36382
|
* Use `SiteHeader` to display brand logo and navigation at the top of a page.
|
|
@@ -36403,20 +36384,20 @@ var Provider = Context.Provider;
|
|
|
36403
36384
|
var SiteHeader = function (_a) {
|
|
36404
36385
|
var _b;
|
|
36405
36386
|
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$2(_a, ["children", "basket", "hasLogin", "isTransparent", "loginHref", "logoOnClick", "loginOnClick", "loginTitle", "logoHref", "logoLabel", "search", "subBrand"]);
|
|
36406
|
-
var _j = React$
|
|
36407
|
-
var _k = React$
|
|
36387
|
+
var _j = React$9.useState(false), hasClientSideJavaScript = _j[0], setHasClientSideJavaScript = _j[1];
|
|
36388
|
+
var _k = React$9.useState(false), menuOpen = _k[0], setMenuOpen = _k[1];
|
|
36408
36389
|
var isMinWidthArcBreakpointL = useMediaQuery("(min-width: ".concat(ArcBreakpointL, "px)"));
|
|
36409
|
-
React$
|
|
36390
|
+
React$9.useEffect(function () {
|
|
36410
36391
|
React__default["default"].Children.map(children, function (item) {
|
|
36411
36392
|
if (item &&
|
|
36412
36393
|
item.type !== NavItem &&
|
|
36413
36394
|
item.type !== NavItemWithSubNav &&
|
|
36414
|
-
item.type !== React$
|
|
36395
|
+
item.type !== React$9.Fragment) {
|
|
36415
36396
|
throw new Error("Illegal child passed to <SiteHeader />. Ensure to only use <SiteHeader.NavItem /> or <SiteHeader.NavItemWithSubNav />");
|
|
36416
36397
|
}
|
|
36417
36398
|
});
|
|
36418
36399
|
}, [children]);
|
|
36419
|
-
React$
|
|
36400
|
+
React$9.useEffect(function () {
|
|
36420
36401
|
if (!isMinWidthArcBreakpointL && menuOpen) {
|
|
36421
36402
|
document.body.classList.add("arc-body--overflowHidden");
|
|
36422
36403
|
}
|
|
@@ -36427,7 +36408,7 @@ var SiteHeader = function (_a) {
|
|
|
36427
36408
|
document.body.classList.remove("arc-body--overflowHidden");
|
|
36428
36409
|
};
|
|
36429
36410
|
}, [isMinWidthArcBreakpointL, menuOpen]);
|
|
36430
|
-
React$
|
|
36411
|
+
React$9.useEffect(function () {
|
|
36431
36412
|
var handleKeydown = function (e) {
|
|
36432
36413
|
if (e.key === "Escape" || e.keyCode === 27) {
|
|
36433
36414
|
setMenuOpen(false);
|
|
@@ -36438,7 +36419,7 @@ var SiteHeader = function (_a) {
|
|
|
36438
36419
|
window.removeEventListener("keydown", handleKeydown);
|
|
36439
36420
|
};
|
|
36440
36421
|
}, [setMenuOpen]);
|
|
36441
|
-
React$
|
|
36422
|
+
React$9.useEffect(function () {
|
|
36442
36423
|
var handleClick = function (e) {
|
|
36443
36424
|
if (e.target.getAttribute("href")) {
|
|
36444
36425
|
setMenuOpen(false);
|
|
@@ -36449,7 +36430,7 @@ var SiteHeader = function (_a) {
|
|
|
36449
36430
|
document.removeEventListener("click", handleClick);
|
|
36450
36431
|
};
|
|
36451
36432
|
}, [setMenuOpen]);
|
|
36452
|
-
React$
|
|
36433
|
+
React$9.useEffect(function () {
|
|
36453
36434
|
// useEffect does not run in ReactDomServer renders
|
|
36454
36435
|
setHasClientSideJavaScript(true);
|
|
36455
36436
|
}, [setHasClientSideJavaScript]);
|
|
@@ -36547,7 +36528,7 @@ SiteHeaderRehydrator.NavItemWithSubNavRehydrator = NavItemWithSubNavRehydrator;
|
|
|
36547
36528
|
SiteHeaderRehydrator.SubNavItemRehydrator = SubNavItemRehydrator;
|
|
36548
36529
|
|
|
36549
36530
|
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
36550
|
-
const [size, setSize] = React$
|
|
36531
|
+
const [size, setSize] = React$9.useState(undefined);
|
|
36551
36532
|
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
36552
36533
|
if (element) {
|
|
36553
36534
|
// provide size as early as possible
|
|
@@ -36598,23 +36579,23 @@ function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
|
36598
36579
|
* -----------------------------------------------------------------------------------------------*/ const $6be4966fd9bbc698$var$SWITCH_NAME = 'Switch';
|
|
36599
36580
|
const [$6be4966fd9bbc698$var$createSwitchContext, $6be4966fd9bbc698$export$cf7f5f17f69cbd43] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($6be4966fd9bbc698$var$SWITCH_NAME);
|
|
36600
36581
|
const [$6be4966fd9bbc698$var$SwitchProvider, $6be4966fd9bbc698$var$useSwitchContext] = $6be4966fd9bbc698$var$createSwitchContext($6be4966fd9bbc698$var$SWITCH_NAME);
|
|
36601
|
-
const $6be4966fd9bbc698$export$b5d5cf8927ab7262 = /*#__PURE__*/ React$
|
|
36582
|
+
const $6be4966fd9bbc698$export$b5d5cf8927ab7262 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
36602
36583
|
const { __scopeSwitch: __scopeSwitch , name: name , checked: checkedProp , defaultChecked: defaultChecked , required: required , disabled: disabled , value: value = 'on' , onCheckedChange: onCheckedChange , ...switchProps } = props;
|
|
36603
|
-
const [button, setButton] = React$
|
|
36584
|
+
const [button, setButton] = React$9.useState(null);
|
|
36604
36585
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setButton(node)
|
|
36605
36586
|
);
|
|
36606
|
-
const hasConsumerStoppedPropagationRef = React$
|
|
36587
|
+
const hasConsumerStoppedPropagationRef = React$9.useRef(false); // We set this to true by default so that events bubble to forms without JS (SSR)
|
|
36607
36588
|
const isFormControl = button ? Boolean(button.closest('form')) : true;
|
|
36608
36589
|
const [checked = false, setChecked] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
36609
36590
|
prop: checkedProp,
|
|
36610
36591
|
defaultProp: defaultChecked,
|
|
36611
36592
|
onChange: onCheckedChange
|
|
36612
36593
|
});
|
|
36613
|
-
return /*#__PURE__*/ React$
|
|
36594
|
+
return /*#__PURE__*/ React$9.createElement($6be4966fd9bbc698$var$SwitchProvider, {
|
|
36614
36595
|
scope: __scopeSwitch,
|
|
36615
36596
|
checked: checked,
|
|
36616
36597
|
disabled: disabled
|
|
36617
|
-
}, /*#__PURE__*/ React$
|
|
36598
|
+
}, /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
36618
36599
|
type: "button",
|
|
36619
36600
|
role: "switch",
|
|
36620
36601
|
"aria-checked": checked,
|
|
@@ -36635,7 +36616,7 @@ const $6be4966fd9bbc698$export$b5d5cf8927ab7262 = /*#__PURE__*/ React$a.forwardR
|
|
|
36635
36616
|
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
|
36636
36617
|
}
|
|
36637
36618
|
})
|
|
36638
|
-
})), isFormControl && /*#__PURE__*/ React$
|
|
36619
|
+
})), isFormControl && /*#__PURE__*/ React$9.createElement($6be4966fd9bbc698$var$BubbleInput, {
|
|
36639
36620
|
control: button,
|
|
36640
36621
|
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
36641
36622
|
name: name,
|
|
@@ -36652,10 +36633,10 @@ const $6be4966fd9bbc698$export$b5d5cf8927ab7262 = /*#__PURE__*/ React$a.forwardR
|
|
|
36652
36633
|
/* -------------------------------------------------------------------------------------------------
|
|
36653
36634
|
* SwitchThumb
|
|
36654
36635
|
* -----------------------------------------------------------------------------------------------*/ const $6be4966fd9bbc698$var$THUMB_NAME = 'SwitchThumb';
|
|
36655
|
-
const $6be4966fd9bbc698$export$4d07bf653ea69106 = /*#__PURE__*/ React$
|
|
36636
|
+
const $6be4966fd9bbc698$export$4d07bf653ea69106 = /*#__PURE__*/ React$9.forwardRef((props, forwardedRef)=>{
|
|
36656
36637
|
const { __scopeSwitch: __scopeSwitch , ...thumbProps } = props;
|
|
36657
36638
|
const context = $6be4966fd9bbc698$var$useSwitchContext($6be4966fd9bbc698$var$THUMB_NAME, __scopeSwitch);
|
|
36658
|
-
return /*#__PURE__*/ React$
|
|
36639
|
+
return /*#__PURE__*/ React$9.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
36659
36640
|
"data-state": $6be4966fd9bbc698$var$getState(context.checked),
|
|
36660
36641
|
"data-disabled": context.disabled ? '' : undefined
|
|
36661
36642
|
}, thumbProps, {
|
|
@@ -36664,10 +36645,10 @@ const $6be4966fd9bbc698$export$4d07bf653ea69106 = /*#__PURE__*/ React$a.forwardR
|
|
|
36664
36645
|
});
|
|
36665
36646
|
/* ---------------------------------------------------------------------------------------------- */ const $6be4966fd9bbc698$var$BubbleInput = (props)=>{
|
|
36666
36647
|
const { control: control , checked: checked , bubbles: bubbles = true , ...inputProps } = props;
|
|
36667
|
-
const ref = React$
|
|
36648
|
+
const ref = React$9.useRef(null);
|
|
36668
36649
|
const prevChecked = $010c2913dbd2fe3d$export$5cae361ad82dce8b(checked);
|
|
36669
36650
|
const controlSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(control); // Bubble checked change to parents (e.g form change event)
|
|
36670
|
-
React$
|
|
36651
|
+
React$9.useEffect(()=>{
|
|
36671
36652
|
const input = ref.current;
|
|
36672
36653
|
const inputProto = window.HTMLInputElement.prototype;
|
|
36673
36654
|
const descriptor = Object.getOwnPropertyDescriptor(inputProto, 'checked');
|
|
@@ -36684,7 +36665,7 @@ const $6be4966fd9bbc698$export$4d07bf653ea69106 = /*#__PURE__*/ React$a.forwardR
|
|
|
36684
36665
|
checked,
|
|
36685
36666
|
bubbles
|
|
36686
36667
|
]);
|
|
36687
|
-
return /*#__PURE__*/ React$
|
|
36668
|
+
return /*#__PURE__*/ React$9.createElement("input", _extends({
|
|
36688
36669
|
type: "checkbox",
|
|
36689
36670
|
"aria-hidden": true,
|
|
36690
36671
|
defaultChecked: checked
|
|
@@ -36724,7 +36705,7 @@ var VerticalSpace = function (_a) {
|
|
|
36724
36705
|
/** Use `Switch` to toggle between checked and not checked. */
|
|
36725
36706
|
var Switch = function (_a) {
|
|
36726
36707
|
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;
|
|
36727
|
-
var surface = React$
|
|
36708
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
36728
36709
|
return (React__default["default"].createElement(FormControl, { errorMessage: errorMessage, htmlFor: id, isDisabled: isDisabled, label: hideLabel ? "" : label, labelSize: labelSize, requirementStatus: "not-applicable" },
|
|
36729
36710
|
!hideLabel && React__default["default"].createElement(VerticalSpace, { size: "8" }),
|
|
36730
36711
|
React__default["default"].createElement("div", { className: "arc-Switch-container" },
|
|
@@ -36752,7 +36733,7 @@ var Switch = function (_a) {
|
|
|
36752
36733
|
var Badge = function (_a) {
|
|
36753
36734
|
var _b, _c;
|
|
36754
36735
|
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;
|
|
36755
|
-
var surface = React$
|
|
36736
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
36756
36737
|
return (React__default["default"].createElement("div", __assign$2({}, (ariaLabel && { "aria-label": ariaLabel }), { className: classNames((_b = {
|
|
36757
36738
|
"arc-Badge": true,
|
|
36758
36739
|
"arc-Badge--onDarkSurface": surface === "dark",
|
|
@@ -36780,10 +36761,10 @@ var VisuallyHidden = function (_a) {
|
|
|
36780
36761
|
/**
|
|
36781
36762
|
* Use `TextInput` to allow custom user text entry with a keyboard.
|
|
36782
36763
|
*/
|
|
36783
|
-
var TextInput = React$
|
|
36764
|
+
var TextInput = React$9.forwardRef(function (_a, ref) {
|
|
36784
36765
|
var _b = _a.defaultValue, defaultValue = _b === void 0 ? "" : _b, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, inputMode = _a.inputMode, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isReadOnly, isReadOnly = _d === void 0 ? false : _d, _e = _a.isRequired, isRequired = _e === void 0 ? false : _e, label = _a.label, _f = _a.labelSize, labelSize = _f === void 0 ? "l" : _f, maxLength = _a.maxLength, minLength = _a.minLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, pattern = _a.pattern, _g = _a.type, type = _g === void 0 ? "text" : _g, _h = _a.showPassword, showPassword = _h === void 0 ? false : _h, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, props = __rest$2(_a, ["defaultValue", "errorMessage", "helper", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "labelSize", "maxLength", "minLength", "name", "onBlur", "onChange", "onClickDisclosure", "pattern", "type", "showPassword", "value", "disclosureTitle", "disclosureText"]);
|
|
36785
|
-
var surface = React$
|
|
36786
|
-
var _j = React$
|
|
36766
|
+
var surface = React$9.useContext(Context$3).surface;
|
|
36767
|
+
var _j = React$9.useState(false), showPasswordToggle = _j[0], setShowPasswordToggle = _j[1];
|
|
36787
36768
|
var inferredInputProps = useNumericInput({
|
|
36788
36769
|
inputMode: inputMode,
|
|
36789
36770
|
pattern: pattern,
|