@arc-ui/components 11.14.0 → 11.16.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/Breadcrumbs/Breadcrumbs.cjs.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +1 -1
- package/dist/Checkbox/Checkbox.cjs.js +2 -2
- package/dist/Checkbox/Checkbox.esm.js +2 -2
- package/dist/FormControl/FormControl.cjs.js +1 -1
- package/dist/FormControl/FormControl.esm.js +1 -1
- package/dist/InformationCard/InformationCard.cjs.js +25 -43
- package/dist/InformationCard/InformationCard.esm.js +24 -42
- package/dist/Modal/Modal.cjs.js +16 -40
- package/dist/Modal/Modal.esm.js +6 -30
- package/dist/PaginationSimple/PaginationSimple.cjs.js +19 -16
- package/dist/PaginationSimple/PaginationSimple.esm.js +19 -16
- package/dist/RadioGroup/RadioGroup.cjs.js +2 -2
- package/dist/RadioGroup/RadioGroup.esm.js +2 -2
- package/dist/Select/Select.cjs.js +2736 -619
- package/dist/Select/Select.esm.js +2535 -418
- package/dist/Switch/Switch.cjs.js +335 -11
- package/dist/Switch/Switch.esm.js +328 -4
- package/dist/Tabs/Tabs.cjs.js +7 -4
- package/dist/Tabs/Tabs.esm.js +7 -4
- package/dist/TextArea/TextArea.cjs.js +17 -12
- package/dist/TextArea/TextArea.esm.js +17 -12
- package/dist/TextInput/TextInput.cjs.js +2 -2
- package/dist/TextInput/TextInput.esm.js +2 -2
- package/dist/Toast/Toast.cjs.js +7 -4
- package/dist/Toast/Toast.esm.js +7 -4
- package/dist/TypographyCard/TypographyCard.cjs.js +93 -0
- package/dist/TypographyCard/TypographyCard.esm.js +85 -0
- package/dist/TypographyCard/package.json +7 -0
- package/dist/UniversalHeader/UniversalHeader.cjs.js +1 -1
- package/dist/UniversalHeader/UniversalHeader.esm.js +1 -1
- package/dist/_shared/cjs/{Breadcrumbs-ed70e75a.js → Breadcrumbs-ef659d2b.js} +5 -5
- package/dist/_shared/cjs/BtIconArrowRight.esm-8e8ac316.js +30 -0
- package/dist/_shared/cjs/BtIconArrowRightFill.esm-435cf4bd.js +26 -0
- package/dist/_shared/cjs/{Checkbox-b126194e.js → Checkbox-904ad028.js} +1 -1
- package/dist/_shared/cjs/{FormControl-7daf8110.js → FormControl-166e0957.js} +5 -1
- package/dist/_shared/cjs/{RadioGroup-56e3b0e5.js → RadioGroup-1eddf86f.js} +1 -1
- package/dist/_shared/cjs/{Tabs-2d2a517d.js → Tabs-cc77dabb.js} +17 -37
- package/dist/_shared/cjs/{TextInput-bf1fe052.js → TextInput-fd9c756f.js} +10 -4
- package/dist/_shared/cjs/{Toast-69108261.js → Toast-91e96744.js} +36 -54
- package/dist/_shared/cjs/{UniversalHeader-5e43d320.js → UniversalHeader-b8389447.js} +4 -2
- package/dist/_shared/cjs/index-1641d0b4.js +27 -0
- package/dist/_shared/cjs/{index-43458549.js → index-3d69ea00.js} +28 -1
- package/dist/_shared/cjs/index-49c72a87.js +131 -0
- package/dist/_shared/cjs/{index-6b2a9ac3.js → index-4ecad2dd.js} +6 -22
- package/dist/_shared/cjs/{index.module-dd1d7d0b.js → index-56a040f4.js} +87 -104
- package/dist/_shared/cjs/index-6542b467.js +23 -0
- package/dist/_shared/cjs/{index-adbb63da.js → index-84e6a68f.js} +1 -1
- package/dist/_shared/cjs/{index-b2fd6338.js → index-d31f2b65.js} +1 -1
- package/dist/_shared/cjs/index-dcfdd5da.js +11 -0
- package/dist/_shared/esm/{Breadcrumbs-87e2bd46.js → Breadcrumbs-36edfb3d.js} +5 -5
- package/dist/_shared/esm/BtIconArrowRight.esm-267916a4.js +24 -0
- package/dist/_shared/esm/BtIconArrowRightFill.esm-99019d1a.js +20 -0
- package/dist/_shared/esm/{Checkbox-d6ec5024.js → Checkbox-8a5bb9a1.js} +1 -1
- package/dist/_shared/esm/{FormControl-351e5f1b.js → FormControl-9d4ddfec.js} +5 -1
- package/dist/_shared/esm/{RadioGroup-c838764c.js → RadioGroup-238db88d.js} +1 -1
- package/dist/_shared/esm/{Tabs-f903187a.js → Tabs-8719d952.js} +7 -27
- package/dist/_shared/esm/{TextInput-991804b6.js → TextInput-c1e2a1dd.js} +10 -4
- package/dist/_shared/esm/{Toast-37549e68.js → Toast-7cb1e544.js} +6 -24
- package/dist/_shared/esm/{UniversalHeader-b4c1577c.js → UniversalHeader-80c7313f.js} +4 -2
- package/dist/_shared/esm/{index.module-44714d3f.js → index-12f3a407.js} +89 -105
- package/dist/_shared/esm/index-246b4f18.js +21 -0
- package/dist/_shared/esm/{index-a1d2d9b3.js → index-39019a9b.js} +1 -1
- package/dist/_shared/esm/{index-41d7af2b.js → index-3e2bc99d.js} +29 -3
- package/dist/_shared/esm/index-6b7b075c.js +25 -0
- package/dist/_shared/esm/{index-efd9ef1c.js → index-936b5179.js} +1 -1
- package/dist/_shared/esm/index-a624de47.js +9 -0
- package/dist/_shared/esm/{index-3797d77e.js → index-d0307140.js} +5 -21
- package/dist/_shared/esm/index-db47e95a.js +129 -0
- package/dist/index.es.js +3062 -865
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +3062 -864
- package/dist/index.js.map +1 -1
- package/dist/styles.css +5 -5
- package/dist/types/components/MediaCard/MediaCard.d.ts +24 -30
- package/dist/types/components/Select/Select.d.ts +49 -0
- package/dist/types/components/TextInput/TextInput.d.ts +12 -1
- package/dist/types/components/TypographyCard/TypographyCard.d.ts +48 -0
- package/dist/types/components/TypographyCard/index.d.ts +1 -0
- package/dist/types/components/UniversalHeader/UniversalHeader.d.ts +4 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/internal-components/ConditionalWrapper/ConditionalWrapper.d.ts +6 -0
- package/dist/types/internal-components/ConditionalWrapper/index.d.ts +1 -0
- package/dist/types/internal-components/index.d.ts +1 -0
- package/dist/types/styles.d.ts +2 -1
- package/package.json +2 -2
- package/dist/_shared/cjs/index-c575a255.js +0 -490
- package/dist/_shared/esm/index-13d575cc.js +0 -479
- package/dist/types/components/MediaCard/MediaCard.stories-wip.d.ts +0 -15
package/dist/index.js
CHANGED
|
@@ -1264,10 +1264,10 @@ const BtIconChevronRight2Px = (props) =>
|
|
|
1264
1264
|
var BreadcrumbsItem = function (_a) {
|
|
1265
1265
|
var spacerIconAfter = _a.spacerIconAfter, spacerIconBefore = _a.spacerIconBefore, children = _a.children, props = __rest(_a, ["spacerIconAfter", "spacerIconBefore", "children"]);
|
|
1266
1266
|
return (React__default["default"].createElement("li", __assign({ className: "arc-Breadcrumbs-item" }, filterDataAttrs(props)),
|
|
1267
|
-
spacerIconBefore && (React__default["default"].createElement("div", { className: "arc-Breadcrumbs-spacerIcon", "data-testid": "arc-chevron-left-2px" },
|
|
1267
|
+
spacerIconBefore && (React__default["default"].createElement("div", { className: "arc-Breadcrumbs-spacerIcon", "data-testid": "arc-chevron-left-2px", "aria-hidden": "true" },
|
|
1268
1268
|
React__default["default"].createElement(Icon, { icon: BtIconChevronLeft2Px }))),
|
|
1269
1269
|
children,
|
|
1270
|
-
spacerIconAfter && (React__default["default"].createElement("div", { className: "arc-Breadcrumbs-spacerIcon" },
|
|
1270
|
+
spacerIconAfter && (React__default["default"].createElement("div", { className: "arc-Breadcrumbs-spacerIcon", "aria-hidden": "true" },
|
|
1271
1271
|
React__default["default"].createElement(Icon, { icon: BtIconChevronRight2Px })))));
|
|
1272
1272
|
};
|
|
1273
1273
|
|
|
@@ -1285,7 +1285,7 @@ var handleLinkClick = function (_a) {
|
|
|
1285
1285
|
|
|
1286
1286
|
var BreadcrumbsLink = React__default["default"].forwardRef(function (_a, ref) {
|
|
1287
1287
|
var onClick = _a.onClick, href = _a.href, isActive = _a.isActive, children = _a.children, props = __rest(_a, ["onClick", "href", "isActive", "children"]);
|
|
1288
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null, isActive || href === undefined ? (React__default["default"].createElement("span", __assign({
|
|
1288
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, isActive || href === undefined ? (React__default["default"].createElement("span", __assign({ onClick: onClick, className: classNames({
|
|
1289
1289
|
"arc-Breadcrumbs-text": true,
|
|
1290
1290
|
"arc-Breadcrumbs-text--active": isActive
|
|
1291
1291
|
}) }, filterDataAttrs(props)), children)) : (React__default["default"].createElement("a", __assign({}, (onClick && ref
|
|
@@ -1334,11 +1334,11 @@ var Breadcrumbs = function (_a) {
|
|
|
1334
1334
|
// eslint-disable-next-line
|
|
1335
1335
|
}, []);
|
|
1336
1336
|
var items = React__default["default"].Children.toArray(children);
|
|
1337
|
-
return (React__default["default"].createElement("nav", __assign({ "aria-label": "Breadcrumbs",
|
|
1337
|
+
return (React__default["default"].createElement("nav", __assign({ "aria-label": "Breadcrumbs", className: classNames({
|
|
1338
1338
|
"arc-Breadcrumbs": true,
|
|
1339
1339
|
"arc-Breadcrumbs--light": isLight
|
|
1340
1340
|
}) }, filterDataAttrs(props)),
|
|
1341
|
-
React__default["default"].createElement("
|
|
1341
|
+
React__default["default"].createElement("ol", { className: "arc-Breadcrumbs-list", ref: breadcrumbsList }, showBackTrail ? (React__default["default"].createElement(React__default["default"].Fragment, null, items.length < 3 ? (React__default["default"].createElement(Breadcrumbs.Item, { spacerIconBefore: true }, items[0].props.children)) : (React__default["default"].createElement(Breadcrumbs.Item, { spacerIconBefore: true }, items[items.length - 2].props.children)))) : (React__default["default"].createElement(React__default["default"].Fragment, null, isCompressed ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1342
1342
|
React__default["default"].createElement(Breadcrumbs.Item, { spacerIconAfter: true }, items[0].props.children),
|
|
1343
1343
|
React__default["default"].createElement(Breadcrumbs.Item, { spacerIconAfter: true },
|
|
1344
1344
|
React__default["default"].createElement("button", { className: "arc-Breadcrumbs-expand arc-Breadcrumbs-text", onClick: function () { return setIsCompressed(false); }, "aria-label": "Expand Breadcrumbs", type: "button", "data-testid": "expand-ellipsis" }, "...")),
|
|
@@ -1763,6 +1763,8 @@ var FormControl = function (_a) {
|
|
|
1763
1763
|
else {
|
|
1764
1764
|
elementProps["aria-describedby"] = ariaDescribedby;
|
|
1765
1765
|
}
|
|
1766
|
+
var hasInfo = !helperUnderLabel &&
|
|
1767
|
+
Boolean(errorMessage || disclosureTitle || helper || supplementaryInfo);
|
|
1766
1768
|
return (React__default["default"].createElement(Provider$3, { value: { requirementStatus: requirementStatus } },
|
|
1767
1769
|
React__default["default"].createElement(ElementType, __assign({ className: classNames({
|
|
1768
1770
|
"arc-FormControl": true,
|
|
@@ -1775,7 +1777,9 @@ var FormControl = function (_a) {
|
|
|
1775
1777
|
requirementStatus === "optional" && (React__default["default"].createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
|
|
1776
1778
|
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)))),
|
|
1777
1779
|
children,
|
|
1778
|
-
React__default["default"].createElement("div", { className: "arc-FormControl-info"
|
|
1780
|
+
React__default["default"].createElement("div", { className: classNames("arc-FormControl-info", {
|
|
1781
|
+
"arc-FormControl-info--hasContent": hasInfo
|
|
1782
|
+
}) },
|
|
1779
1783
|
!helperUnderLabel && (React__default["default"].createElement("div", { className: "arc-FormControl-helperContainer" }, errorMessage ? (React__default["default"].createElement("div", { className: "arc-FormControl-error", id: idError },
|
|
1780
1784
|
React__default["default"].createElement("span", { className: "arc-FormControl-error--icon" },
|
|
1781
1785
|
React__default["default"].createElement(BtIconAlert, null)),
|
|
@@ -2229,27 +2233,29 @@ var InformationCard = function (_a) {
|
|
|
2229
2233
|
"arc-InformationCard--interactive": cardUrl
|
|
2230
2234
|
}) }, filterDataAttrs(props)),
|
|
2231
2235
|
React__default["default"].createElement(Surface, { growVertically: true, padding: containerSpacing, background: "white" },
|
|
2232
|
-
|
|
2233
|
-
React__default["default"].createElement(
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
React__default["default"].createElement(
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
React__default["default"].createElement("
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
React__default["default"].createElement(
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2236
|
+
React__default["default"].createElement("div", null,
|
|
2237
|
+
image && (React__default["default"].createElement("div", { className: "arc-InformationCard-img" },
|
|
2238
|
+
React__default["default"].createElement(Image, __assign({}, image)),
|
|
2239
|
+
React__default["default"].createElement(VerticalSpace, { size: assetSpacing }))),
|
|
2240
|
+
icon && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2241
|
+
React__default["default"].createElement(Icon, { testId: "information-card-icon", icon: icon, size: 96 }),
|
|
2242
|
+
React__default["default"].createElement(VerticalSpace, { size: assetSpacing }))),
|
|
2243
|
+
label && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2244
|
+
React__default["default"].createElement("span", { className: "arc-InformationCard-label" }, label),
|
|
2245
|
+
React__default["default"].createElement(VerticalSpace, { size: headingSpacing }))),
|
|
2246
|
+
React__default["default"].createElement(HeadingElement, { className: "arc-InformationCard-heading" }, cardUrl ? (React__default["default"].createElement("a", { className: "arc-InformationCard-headingLink", href: cardUrl, onClick: onClick }, heading)) : (heading))),
|
|
2247
|
+
React__default["default"].createElement("div", { className: "arc-InformationCard-contentContainer" },
|
|
2248
|
+
text && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2249
|
+
React__default["default"].createElement(VerticalSpace, { size: headingSpacing }),
|
|
2250
|
+
React__default["default"].createElement(Text, null, text),
|
|
2251
|
+
(button || tags || footerLogo) && React__default["default"].createElement(VerticalSpace, { size: "24" }))),
|
|
2252
|
+
tags && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2253
|
+
React__default["default"].createElement("div", { className: "arc-InformationCard-tagContainer" }, tags.map(function (_a, i) {
|
|
2254
|
+
var text = _a.text, tagProps = __rest(_a, ["text"]);
|
|
2255
|
+
return (React__default["default"].createElement("div", { className: "arc-InformationCard-tag", key: "information-card-tag-".concat(i) },
|
|
2256
|
+
React__default["default"].createElement(Tag, __assign({}, tagProps), text)));
|
|
2257
|
+
})),
|
|
2258
|
+
(button || footerLogo) && React__default["default"].createElement(VerticalSpace, { size: "24" })))),
|
|
2253
2259
|
React__default["default"].createElement("div", { className: "arc-InformationCard-footer" },
|
|
2254
2260
|
button && !cardUrl && (React__default["default"].createElement("div", { className: "arc-InformationCard-footerButtonContainer" },
|
|
2255
2261
|
React__default["default"].createElement(Button, __assign({}, button, { iconPosition: "beforeText", fill: "flat", icon: BtIconArrowRight })))),
|
|
@@ -2270,18 +2276,112 @@ var Markup = function (_a) {
|
|
|
2270
2276
|
}) }, filterDataAttrs(props)), children));
|
|
2271
2277
|
};
|
|
2272
2278
|
|
|
2273
|
-
|
|
2279
|
+
const BtIconPlay = (props) =>
|
|
2280
|
+
/*#__PURE__*/ React__default["default"].createElement(
|
|
2281
|
+
"svg",
|
|
2282
|
+
Object.assign(
|
|
2283
|
+
{
|
|
2284
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2285
|
+
viewBox: "0 0 32 32",
|
|
2286
|
+
},
|
|
2287
|
+
props,
|
|
2288
|
+
),
|
|
2289
|
+
/*#__PURE__*/ React__default["default"].createElement("defs", null),
|
|
2290
|
+
/*#__PURE__*/ React__default["default"].createElement("path", {
|
|
2291
|
+
d: "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",
|
|
2292
|
+
fill: "currentColor",
|
|
2293
|
+
}),
|
|
2294
|
+
/*#__PURE__*/ React__default["default"].createElement("path", {
|
|
2295
|
+
d: "M20.83887,15.03955,13.66113,10.896A1.107,1.107,0,0,0,12,11.85449v8.2876a1.10534,1.10534,0,0,0,1.66113.95947L20.83887,16.957a1.10688,1.10688,0,0,0,0-1.91748Zm-.5,1.05176-7.17774,4.14453a.10437.10437,0,0,1-.10742-.00049A.10314.10314,0,0,1,13,20.14209v-8.2876a.10229.10229,0,0,1,.05371-.09277.10284.10284,0,0,1,.10742,0l7.17774,4.14307a.10421.10421,0,0,1,.05371.09375A.10285.10285,0,0,1,20.33887,16.09131Z",
|
|
2296
|
+
fill: "currentColor",
|
|
2297
|
+
}),
|
|
2298
|
+
);
|
|
2299
|
+
|
|
2300
|
+
const BtIconArrowRightFill = (props) =>
|
|
2301
|
+
/*#__PURE__*/ React__default["default"].createElement(
|
|
2302
|
+
"svg",
|
|
2303
|
+
Object.assign(
|
|
2304
|
+
{
|
|
2305
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2306
|
+
viewBox: "0 0 32 32",
|
|
2307
|
+
},
|
|
2308
|
+
props,
|
|
2309
|
+
),
|
|
2310
|
+
/*#__PURE__*/ React__default["default"].createElement("defs", null),
|
|
2311
|
+
/*#__PURE__*/ React__default["default"].createElement("path", {
|
|
2312
|
+
d: "M2,16A14,14,0,1,0,16,2,14,14,0,0,0,2,16Zm16.85352-4.35352L23.207,16l-4.35351,4.35352a.5.5,0,0,1-.707-.707L21.293,16.5H9.5a.5.5,0,0,1,0-1H21.293l-3.14649-3.14648a.5.5,0,0,1,.707-.707Z",
|
|
2313
|
+
fill: "currentColor",
|
|
2314
|
+
}),
|
|
2315
|
+
);
|
|
2316
|
+
|
|
2317
|
+
const BtIconPlayFill = (props) =>
|
|
2318
|
+
/*#__PURE__*/ React__default["default"].createElement(
|
|
2319
|
+
"svg",
|
|
2320
|
+
Object.assign(
|
|
2321
|
+
{
|
|
2322
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2323
|
+
viewBox: "0 0 32 32",
|
|
2324
|
+
},
|
|
2325
|
+
props,
|
|
2326
|
+
),
|
|
2327
|
+
/*#__PURE__*/ React__default["default"].createElement("defs", null),
|
|
2328
|
+
/*#__PURE__*/ React__default["default"].createElement("path", {
|
|
2329
|
+
d: "M13.16113,11.76172a.10284.10284,0,0,0-.10742,0A.10229.10229,0,0,0,13,11.85449v8.2876a.10314.10314,0,0,0,.05371.09326.10451.10451,0,0,0,.10742.00049l7.17774-4.14453a.10285.10285,0,0,0,.05371-.09277.10421.10421,0,0,0-.05371-.09375Z",
|
|
2330
|
+
fill: "currentColor",
|
|
2331
|
+
}),
|
|
2332
|
+
/*#__PURE__*/ React__default["default"].createElement("path", {
|
|
2333
|
+
d: "M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm4.83887,14.957-7.17774,4.14453A1.10791,1.10791,0,0,1,12,20.14209v-8.2876a1.107,1.107,0,0,1,1.66113-.95849l7.17774,4.14355a1.10688,1.10688,0,0,1,0,1.91748Z",
|
|
2334
|
+
fill: "currentColor",
|
|
2335
|
+
}),
|
|
2336
|
+
);
|
|
2337
|
+
|
|
2338
|
+
var ConditionalWrapper = function (_a) {
|
|
2339
|
+
var condition = _a.condition, wrapper = _a.wrapper, children = _a.children;
|
|
2340
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, condition ? wrapper(children) : children));
|
|
2341
|
+
};
|
|
2342
|
+
|
|
2274
2343
|
/**
|
|
2275
2344
|
* Use `MediaCard` to contain content and an image about a single subject.
|
|
2276
2345
|
*/
|
|
2277
2346
|
var MediaCard = function (_a) {
|
|
2278
|
-
var
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2347
|
+
var img = _a.img, url = _a.url, onClick = _a.onClick, heading = _a.heading, label = _a.label, text = _a.text, metaText = _a.metaText, _b = _a.buttonIcon, buttonIcon = _b === void 0 ? "arrow" : _b, _c = _a.isContained, isContained = _c === void 0 ? true : _c, _d = _a.headingLevel, headingLevel = _d === void 0 ? "2" : _d, props = __rest(_a, ["img", "url", "onClick", "heading", "label", "text", "metaText", "buttonIcon", "isContained", "headingLevel"]);
|
|
2348
|
+
var isMinWidthArcBreakpointS = useMediaQuery("(min-width: ".concat(ArcBreakpointS, "px)"));
|
|
2349
|
+
var headingSpacing = isMinWidthArcBreakpointS ? "16" : "8";
|
|
2350
|
+
var HeadingElement = "h".concat(headingLevel);
|
|
2351
|
+
var icons = {
|
|
2352
|
+
arrow: {
|
|
2353
|
+
regular: BtIconArrowRight,
|
|
2354
|
+
hover: BtIconArrowRightFill
|
|
2355
|
+
},
|
|
2356
|
+
play: {
|
|
2357
|
+
regular: BtIconPlay,
|
|
2358
|
+
hover: BtIconPlayFill
|
|
2359
|
+
}
|
|
2360
|
+
};
|
|
2361
|
+
return (React__default["default"].createElement("div", __assign({ className: classNames("arc-MediaCard", {
|
|
2362
|
+
"arc-MediaCard--interactive": url,
|
|
2363
|
+
"arc-MediaCard--contained": isContained
|
|
2364
|
+
}) }, filterDataAttrs(props)),
|
|
2365
|
+
React__default["default"].createElement(ConditionalWrapper, { condition: isContained, wrapper: function (children) { return (React__default["default"].createElement(Surface, { growVertically: true, background: "white" }, children)); } },
|
|
2366
|
+
React__default["default"].createElement("div", { className: "arc-MediaCard-imgContainer" },
|
|
2367
|
+
React__default["default"].createElement(Image, __assign({}, img))),
|
|
2368
|
+
React__default["default"].createElement("div", { className: "arc-MediaCard-content" },
|
|
2369
|
+
label && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2370
|
+
React__default["default"].createElement("span", { className: "arc-MediaCard-label" }, label),
|
|
2371
|
+
React__default["default"].createElement(VerticalSpace, { size: headingSpacing }))),
|
|
2372
|
+
React__default["default"].createElement(HeadingElement, { className: "arc-MediaCard-heading" }, url ? (React__default["default"].createElement("a", { className: "arc-MediaCard-headingLink", href: url, onClick: onClick }, heading)) : (heading)),
|
|
2373
|
+
React__default["default"].createElement("div", { className: "arc-MediaCard-textContainer" }, text && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2374
|
+
React__default["default"].createElement(VerticalSpace, { size: headingSpacing }),
|
|
2375
|
+
React__default["default"].createElement(Text, null, text),
|
|
2376
|
+
(url || metaText) && React__default["default"].createElement(VerticalSpace, { size: "24" })))),
|
|
2377
|
+
React__default["default"].createElement("div", { className: "arc-MediaCard-footer" },
|
|
2378
|
+
React__default["default"].createElement("div", { className: "arc-MediaCard-metaTextContainer" }, metaText && (React__default["default"].createElement("span", { className: "arc-MediaCard-metaText" }, metaText))),
|
|
2379
|
+
url && (React__default["default"].createElement("div", null,
|
|
2380
|
+
React__default["default"].createElement("div", { className: "arc-MediaCard-footerButton" },
|
|
2381
|
+
React__default["default"].createElement("div", { className: classNames("arc-MediaCard-footerButtonIcon", "arc-MediaCard-footerButtonIcon--regular") },
|
|
2382
|
+
React__default["default"].createElement(Icon, { icon: icons[buttonIcon].regular, size: 40 })),
|
|
2383
|
+
React__default["default"].createElement("div", { className: "arc-MediaCard-footerButtonIcon arc-MediaCard-footerButtonIcon--hover" },
|
|
2384
|
+
React__default["default"].createElement(Icon, { icon: icons[buttonIcon].hover, size: 40 }))))))))));
|
|
2285
2385
|
};
|
|
2286
2386
|
|
|
2287
2387
|
function _extends() {
|
|
@@ -2434,13 +2534,13 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(originalEventHandler, ourEv
|
|
|
2434
2534
|
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
2435
2535
|
*/ const $9f79659886946c16$export$e5c5a5f917a5871c$1 = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? React.useLayoutEffect : ()=>{};
|
|
2436
2536
|
|
|
2437
|
-
const $1746a345f3d73bb7$var$useReactId
|
|
2537
|
+
const $1746a345f3d73bb7$var$useReactId = React__namespace['useId'.toString()] || (()=>undefined
|
|
2438
2538
|
);
|
|
2439
|
-
let $1746a345f3d73bb7$var$count
|
|
2440
|
-
function $1746a345f3d73bb7$export$f680877a34711e37
|
|
2441
|
-
const [id, setId] = React__namespace.useState($1746a345f3d73bb7$var$useReactId
|
|
2539
|
+
let $1746a345f3d73bb7$var$count = 0;
|
|
2540
|
+
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
2541
|
+
const [id, setId] = React__namespace.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
|
|
2442
2542
|
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
2443
|
-
if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count
|
|
2543
|
+
if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
|
|
2444
2544
|
);
|
|
2445
2545
|
}, [
|
|
2446
2546
|
deterministicId
|
|
@@ -33521,14 +33621,14 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
33521
33621
|
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
|
|
33522
33622
|
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
|
|
33523
33623
|
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
|
|
33524
|
-
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f
|
|
33624
|
+
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
|
|
33525
33625
|
if (target) reactDom.exports.flushSync(()=>target.dispatchEvent(event)
|
|
33526
33626
|
);
|
|
33527
33627
|
}
|
|
33528
33628
|
|
|
33529
33629
|
/**
|
|
33530
33630
|
* Listens for when the escape key is down
|
|
33531
|
-
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765
|
|
33631
|
+
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
33532
33632
|
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onEscapeKeyDownProp);
|
|
33533
33633
|
React.useEffect(()=>{
|
|
33534
33634
|
const handleKeyDown = (event)=>{
|
|
@@ -33591,7 +33691,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ React.forwardR
|
|
|
33591
33691
|
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
33592
33692
|
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
33593
33693
|
}, ownerDocument);
|
|
33594
|
-
$addc16e1bbe58fd0$export$3a72a57244d6e765
|
|
33694
|
+
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
33595
33695
|
const isHighestLayer = index === context.layers.size - 1;
|
|
33596
33696
|
if (!isHighestLayer) return;
|
|
33597
33697
|
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
@@ -33786,7 +33886,7 @@ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent$1(name, handler, det
|
|
|
33786
33886
|
if (handler) target.addEventListener(name, handler, {
|
|
33787
33887
|
once: true
|
|
33788
33888
|
});
|
|
33789
|
-
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f
|
|
33889
|
+
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
33790
33890
|
else target.dispatchEvent(event);
|
|
33791
33891
|
}
|
|
33792
33892
|
const $5cb92bef7577960e$export$be92b6f5f03c0fe9 = $5cb92bef7577960e$export$177fb62ff3ec1f22$1;
|
|
@@ -34196,25 +34296,25 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
|
|
|
34196
34296
|
return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';
|
|
34197
34297
|
}
|
|
34198
34298
|
|
|
34199
|
-
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count
|
|
34299
|
+
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
|
|
34200
34300
|
/**
|
|
34201
34301
|
* Injects a pair of focus guards at the edges of the whole DOM tree
|
|
34202
34302
|
* to ensure `focusin` & `focusout` events can be caught consistently.
|
|
34203
|
-
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c
|
|
34303
|
+
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
34204
34304
|
React.useEffect(()=>{
|
|
34205
34305
|
var _edgeGuards$, _edgeGuards$2;
|
|
34206
34306
|
const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
|
|
34207
|
-
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard
|
|
34208
|
-
document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard
|
|
34209
|
-
$3db38b7d1fb3fe6a$var$count
|
|
34307
|
+
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
34308
|
+
document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
34309
|
+
$3db38b7d1fb3fe6a$var$count++;
|
|
34210
34310
|
return ()=>{
|
|
34211
|
-
if ($3db38b7d1fb3fe6a$var$count
|
|
34311
|
+
if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
|
|
34212
34312
|
);
|
|
34213
|
-
$3db38b7d1fb3fe6a$var$count
|
|
34313
|
+
$3db38b7d1fb3fe6a$var$count--;
|
|
34214
34314
|
};
|
|
34215
34315
|
}, []);
|
|
34216
34316
|
}
|
|
34217
|
-
function $3db38b7d1fb3fe6a$var$createFocusGuard
|
|
34317
|
+
function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
34218
34318
|
const element = document.createElement('span');
|
|
34219
34319
|
element.setAttribute('data-radix-focus-guard', '');
|
|
34220
34320
|
element.tabIndex = 0;
|
|
@@ -34999,9 +35099,9 @@ const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{
|
|
|
34999
35099
|
scope: __scopeDialog,
|
|
35000
35100
|
triggerRef: triggerRef,
|
|
35001
35101
|
contentRef: contentRef,
|
|
35002
|
-
contentId: $1746a345f3d73bb7$export$f680877a34711e37
|
|
35003
|
-
titleId: $1746a345f3d73bb7$export$f680877a34711e37
|
|
35004
|
-
descriptionId: $1746a345f3d73bb7$export$f680877a34711e37
|
|
35102
|
+
contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
35103
|
+
titleId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
35104
|
+
descriptionId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
35005
35105
|
open: open,
|
|
35006
35106
|
onOpenChange: setOpen,
|
|
35007
35107
|
onOpenToggle: React.useCallback(()=>setOpen((prevOpen)=>!prevOpen
|
|
@@ -35156,7 +35256,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ React.forwardRef
|
|
|
35156
35256
|
const contentRef = React.useRef(null);
|
|
35157
35257
|
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
|
|
35158
35258
|
// the last element in the DOM (beacuse of the `Portal`)
|
|
35159
|
-
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c
|
|
35259
|
+
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
35160
35260
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement($d3863c46a17e8a28$export$20e40289641fbbb6$1, {
|
|
35161
35261
|
asChild: true,
|
|
35162
35262
|
loop: true,
|
|
@@ -35334,22 +35434,25 @@ var PaginationSimple = function (_a) {
|
|
|
35334
35434
|
"arc-PaginationSimple--fluid": isFluid,
|
|
35335
35435
|
"arc-PaginationSimple--centered": !isFluid
|
|
35336
35436
|
}) }, filterDataAttrs(props)),
|
|
35337
|
-
React__default["default"].createElement("
|
|
35338
|
-
|
|
35339
|
-
|
|
35340
|
-
|
|
35341
|
-
|
|
35342
|
-
|
|
35343
|
-
|
|
35344
|
-
|
|
35345
|
-
|
|
35346
|
-
|
|
35347
|
-
|
|
35348
|
-
|
|
35349
|
-
|
|
35350
|
-
|
|
35351
|
-
|
|
35352
|
-
|
|
35437
|
+
React__default["default"].createElement("ul", { className: "arc-PaginationSimple-list" },
|
|
35438
|
+
React__default["default"].createElement("li", { className: "arc-PaginationSimple-listItem" },
|
|
35439
|
+
React__default["default"].createElement("button", { className: classNames("arc-PaginationSimple-navigationButton", {
|
|
35440
|
+
"arc-PaginationSimple-navigationButton--hidden": hidePrev
|
|
35441
|
+
}), onClick: function () {
|
|
35442
|
+
onPrevPage();
|
|
35443
|
+
} },
|
|
35444
|
+
React__default["default"].createElement("div", { className: "arc-PaginationSimple-iconContainer arc-PaginationSimple-iconContainer--left" },
|
|
35445
|
+
React__default["default"].createElement(Icon, { color: "brand", size: 32, icon: BtIconChevronLeftMid })),
|
|
35446
|
+
React__default["default"].createElement("span", { className: "arc-PaginationSimple-prevText" }, "Prev"))),
|
|
35447
|
+
React__default["default"].createElement("li", { className: "arc-PaginationSimple-listItem" },
|
|
35448
|
+
React__default["default"].createElement("button", { className: classNames("arc-PaginationSimple-navigationButton", {
|
|
35449
|
+
"arc-PaginationSimple-navigationButton--hidden": hideNext
|
|
35450
|
+
}), onClick: function () {
|
|
35451
|
+
onNextPage();
|
|
35452
|
+
} },
|
|
35453
|
+
React__default["default"].createElement("span", { className: "arc-PaginationSimple-nextText" }, "Next"),
|
|
35454
|
+
React__default["default"].createElement("div", { className: "arc-PaginationSimple-iconContainer arc-PaginationSimple-iconContainer--right" },
|
|
35455
|
+
React__default["default"].createElement(Icon, { color: "brand", size: 32, icon: BtIconChevronRightMid })))))));
|
|
35353
35456
|
};
|
|
35354
35457
|
|
|
35355
35458
|
var PosterImage = function (_a) {
|
|
@@ -35717,218 +35820,15 @@ function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(value, [min, max]) {
|
|
|
35717
35820
|
return Math.min(max, Math.max(min, value));
|
|
35718
35821
|
}
|
|
35719
35822
|
|
|
35720
|
-
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
|
|
35721
|
-
return function handleEvent(event) {
|
|
35722
|
-
originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
|
|
35723
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
|
|
35724
|
-
};
|
|
35725
|
-
}
|
|
35726
|
-
|
|
35727
|
-
/* -------------------------------------------------------------------------------------------------
|
|
35728
|
-
* createContextScope
|
|
35729
|
-
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
|
|
35730
|
-
let defaultContexts = [];
|
|
35731
|
-
/* -----------------------------------------------------------------------------------------------
|
|
35732
|
-
* createContext
|
|
35733
|
-
* ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
|
|
35734
|
-
const BaseContext = /*#__PURE__*/ React.createContext(defaultContext);
|
|
35735
|
-
const index = defaultContexts.length;
|
|
35736
|
-
defaultContexts = [
|
|
35737
|
-
...defaultContexts,
|
|
35738
|
-
defaultContext
|
|
35739
|
-
];
|
|
35740
|
-
function Provider(props) {
|
|
35741
|
-
const { scope: scope , children: children , ...context } = props;
|
|
35742
|
-
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
|
|
35743
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35744
|
-
const value = React.useMemo(()=>context
|
|
35745
|
-
, Object.values(context));
|
|
35746
|
-
return /*#__PURE__*/ React.createElement(Context.Provider, {
|
|
35747
|
-
value: value
|
|
35748
|
-
}, children);
|
|
35749
|
-
}
|
|
35750
|
-
function useContext(consumerName, scope) {
|
|
35751
|
-
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
|
|
35752
|
-
const context = React.useContext(Context);
|
|
35753
|
-
if (context) return context;
|
|
35754
|
-
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
|
|
35755
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
35756
|
-
}
|
|
35757
|
-
Provider.displayName = rootComponentName + 'Provider';
|
|
35758
|
-
return [
|
|
35759
|
-
Provider,
|
|
35760
|
-
useContext
|
|
35761
|
-
];
|
|
35762
|
-
}
|
|
35763
|
-
/* -----------------------------------------------------------------------------------------------
|
|
35764
|
-
* createScope
|
|
35765
|
-
* ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
|
|
35766
|
-
const scopeContexts = defaultContexts.map((defaultContext)=>{
|
|
35767
|
-
return /*#__PURE__*/ React.createContext(defaultContext);
|
|
35768
|
-
});
|
|
35769
|
-
return function useScope(scope) {
|
|
35770
|
-
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
|
|
35771
|
-
return React.useMemo(()=>({
|
|
35772
|
-
[`__scope${scopeName}`]: {
|
|
35773
|
-
...scope,
|
|
35774
|
-
[scopeName]: contexts
|
|
35775
|
-
}
|
|
35776
|
-
})
|
|
35777
|
-
, [
|
|
35778
|
-
scope,
|
|
35779
|
-
contexts
|
|
35780
|
-
]);
|
|
35781
|
-
};
|
|
35782
|
-
};
|
|
35783
|
-
createScope.scopeName = scopeName;
|
|
35784
|
-
return [
|
|
35785
|
-
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
35786
|
-
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
|
|
35787
|
-
];
|
|
35788
|
-
}
|
|
35789
|
-
/* -------------------------------------------------------------------------------------------------
|
|
35790
|
-
* composeContextScopes
|
|
35791
|
-
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
|
35792
|
-
const baseScope = scopes[0];
|
|
35793
|
-
if (scopes.length === 1) return baseScope;
|
|
35794
|
-
const createScope1 = ()=>{
|
|
35795
|
-
const scopeHooks = scopes.map((createScope)=>({
|
|
35796
|
-
useScope: createScope(),
|
|
35797
|
-
scopeName: createScope.scopeName
|
|
35798
|
-
})
|
|
35799
|
-
);
|
|
35800
|
-
return function useComposedScopes(overrideScopes) {
|
|
35801
|
-
const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
|
|
35802
|
-
// We are calling a hook inside a callback which React warns against to avoid inconsistent
|
|
35803
|
-
// renders, however, scoping doesn't have render side effects so we ignore the rule.
|
|
35804
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
35805
|
-
const scopeProps = useScope(overrideScopes);
|
|
35806
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
35807
|
-
return {
|
|
35808
|
-
...nextScopes,
|
|
35809
|
-
...currentScope
|
|
35810
|
-
};
|
|
35811
|
-
}, {});
|
|
35812
|
-
return React.useMemo(()=>({
|
|
35813
|
-
[`__scope${baseScope.scopeName}`]: nextScopes1
|
|
35814
|
-
})
|
|
35815
|
-
, [
|
|
35816
|
-
nextScopes1
|
|
35817
|
-
]);
|
|
35818
|
-
};
|
|
35819
|
-
};
|
|
35820
|
-
createScope1.scopeName = baseScope.scopeName;
|
|
35821
|
-
return createScope1;
|
|
35822
|
-
}
|
|
35823
|
-
|
|
35824
|
-
/**
|
|
35825
|
-
* Set a given ref to a given value
|
|
35826
|
-
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
35827
|
-
*/ function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
35828
|
-
if (typeof ref === 'function') ref(value);
|
|
35829
|
-
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
35830
|
-
}
|
|
35831
|
-
/**
|
|
35832
|
-
* A utility to compose multiple refs together
|
|
35833
|
-
* Accepts callback refs and RefObject(s)
|
|
35834
|
-
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
35835
|
-
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
|
|
35836
|
-
)
|
|
35837
|
-
;
|
|
35838
|
-
}
|
|
35839
|
-
/**
|
|
35840
|
-
* A custom hook that composes multiple refs
|
|
35841
|
-
* Accepts callback refs and RefObject(s)
|
|
35842
|
-
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
35843
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35844
|
-
return React.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
35845
|
-
}
|
|
35846
|
-
|
|
35847
|
-
/* -------------------------------------------------------------------------------------------------
|
|
35848
|
-
* Slot
|
|
35849
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
35850
|
-
const { children: children , ...slotProps } = props;
|
|
35851
|
-
const childrenArray = React.Children.toArray(children);
|
|
35852
|
-
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
35853
|
-
if (slottable) {
|
|
35854
|
-
// the new element to render is the one passed as a child of `Slottable`
|
|
35855
|
-
const newElement = slottable.props.children;
|
|
35856
|
-
const newChildren = childrenArray.map((child)=>{
|
|
35857
|
-
if (child === slottable) {
|
|
35858
|
-
// because the new element will be the one rendered, we are only interested
|
|
35859
|
-
// in grabbing its children (`newElement.props.children`)
|
|
35860
|
-
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
35861
|
-
return /*#__PURE__*/ React.isValidElement(newElement) ? newElement.props.children : null;
|
|
35862
|
-
} else return child;
|
|
35863
|
-
});
|
|
35864
|
-
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
35865
|
-
ref: forwardedRef
|
|
35866
|
-
}), /*#__PURE__*/ React.isValidElement(newElement) ? /*#__PURE__*/ React.cloneElement(newElement, undefined, newChildren) : null);
|
|
35867
|
-
}
|
|
35868
|
-
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
35869
|
-
ref: forwardedRef
|
|
35870
|
-
}), children);
|
|
35871
|
-
});
|
|
35872
|
-
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
|
35873
|
-
/* -------------------------------------------------------------------------------------------------
|
|
35874
|
-
* SlotClone
|
|
35875
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
35876
|
-
const { children: children , ...slotProps } = props;
|
|
35877
|
-
if (/*#__PURE__*/ React.isValidElement(children)) return /*#__PURE__*/ React.cloneElement(children, {
|
|
35878
|
-
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
35879
|
-
ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref)
|
|
35880
|
-
});
|
|
35881
|
-
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
35882
|
-
});
|
|
35883
|
-
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
|
|
35884
|
-
/* -------------------------------------------------------------------------------------------------
|
|
35885
|
-
* Slottable
|
|
35886
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
|
|
35887
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, children);
|
|
35888
|
-
};
|
|
35889
|
-
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
35890
|
-
return /*#__PURE__*/ React.isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
35891
|
-
}
|
|
35892
|
-
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
35893
|
-
// all child props should override
|
|
35894
|
-
const overrideProps = {
|
|
35895
|
-
...childProps
|
|
35896
|
-
};
|
|
35897
|
-
for(const propName in childProps){
|
|
35898
|
-
const slotPropValue = slotProps[propName];
|
|
35899
|
-
const childPropValue = childProps[propName];
|
|
35900
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
35901
|
-
if (isHandler) {
|
|
35902
|
-
// if the handler exists on both, we compose them
|
|
35903
|
-
if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{
|
|
35904
|
-
childPropValue(...args);
|
|
35905
|
-
slotPropValue(...args);
|
|
35906
|
-
};
|
|
35907
|
-
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
35908
|
-
} else if (propName === 'style') overrideProps[propName] = {
|
|
35909
|
-
...slotPropValue,
|
|
35910
|
-
...childPropValue
|
|
35911
|
-
};
|
|
35912
|
-
else if (propName === 'className') overrideProps[propName] = [
|
|
35913
|
-
slotPropValue,
|
|
35914
|
-
childPropValue
|
|
35915
|
-
].filter(Boolean).join(' ');
|
|
35916
|
-
}
|
|
35917
|
-
return {
|
|
35918
|
-
...slotProps,
|
|
35919
|
-
...overrideProps
|
|
35920
|
-
};
|
|
35921
|
-
}
|
|
35922
|
-
|
|
35923
35823
|
// We have resorted to returning slots directly rather than exposing primitives that can then
|
|
35924
35824
|
// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
|
|
35925
35825
|
// This is because we encountered issues with generic types that cannot be statically analysed
|
|
35926
35826
|
// due to creating them dynamically via createCollection.
|
|
35927
|
-
function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2
|
|
35827
|
+
function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
35928
35828
|
/* -----------------------------------------------------------------------------------------------
|
|
35929
35829
|
* CollectionProvider
|
|
35930
35830
|
* ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
|
|
35931
|
-
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
|
|
35831
|
+
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1(PROVIDER_NAME);
|
|
35932
35832
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
35933
35833
|
collectionRef: {
|
|
35934
35834
|
current: null
|
|
@@ -35951,8 +35851,8 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2$1(name) {
|
|
|
35951
35851
|
const CollectionSlot = /*#__PURE__*/ React__default["default"].forwardRef((props, forwardedRef)=>{
|
|
35952
35852
|
const { scope: scope , children: children } = props;
|
|
35953
35853
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
35954
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
|
|
35955
|
-
return /*#__PURE__*/ React__default["default"].createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
35854
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.collectionRef);
|
|
35855
|
+
return /*#__PURE__*/ React__default["default"].createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360$1, {
|
|
35956
35856
|
ref: composedRefs
|
|
35957
35857
|
}, children);
|
|
35958
35858
|
});
|
|
@@ -35963,7 +35863,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2$1(name) {
|
|
|
35963
35863
|
const CollectionItemSlot = /*#__PURE__*/ React__default["default"].forwardRef((props, forwardedRef)=>{
|
|
35964
35864
|
const { scope: scope , children: children , ...itemData } = props;
|
|
35965
35865
|
const ref = React__default["default"].useRef(null);
|
|
35966
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
35866
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
35967
35867
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
35968
35868
|
React__default["default"].useEffect(()=>{
|
|
35969
35869
|
context.itemMap.set(ref, {
|
|
@@ -35973,7 +35873,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2$1(name) {
|
|
|
35973
35873
|
return ()=>void context.itemMap.delete(ref)
|
|
35974
35874
|
;
|
|
35975
35875
|
});
|
|
35976
|
-
return /*#__PURE__*/ React__default["default"].createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
35876
|
+
return /*#__PURE__*/ React__default["default"].createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360$1, {
|
|
35977
35877
|
[ITEM_DATA_ATTR]: '',
|
|
35978
35878
|
ref: composedRefs
|
|
35979
35879
|
}, children);
|
|
@@ -36007,123 +35907,12 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2$1(name) {
|
|
|
36007
35907
|
];
|
|
36008
35908
|
}
|
|
36009
35909
|
|
|
36010
|
-
const $f631663db3294ace$var$DirectionContext
|
|
36011
|
-
/* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3
|
|
36012
|
-
const globalDir = React.useContext($f631663db3294ace$var$DirectionContext
|
|
35910
|
+
const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ React.createContext(undefined);
|
|
35911
|
+
/* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
|
|
35912
|
+
const globalDir = React.useContext($f631663db3294ace$var$DirectionContext);
|
|
36013
35913
|
return localDir || globalDir || 'ltr';
|
|
36014
35914
|
}
|
|
36015
35915
|
|
|
36016
|
-
const $8927f6f2acc4f386$var$NODES = [
|
|
36017
|
-
'a',
|
|
36018
|
-
'button',
|
|
36019
|
-
'div',
|
|
36020
|
-
'h2',
|
|
36021
|
-
'h3',
|
|
36022
|
-
'img',
|
|
36023
|
-
'label',
|
|
36024
|
-
'li',
|
|
36025
|
-
'nav',
|
|
36026
|
-
'ol',
|
|
36027
|
-
'p',
|
|
36028
|
-
'span',
|
|
36029
|
-
'svg',
|
|
36030
|
-
'ul'
|
|
36031
|
-
]; // Temporary while we await merge of this fix:
|
|
36032
|
-
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
|
|
36033
|
-
// prettier-ignore
|
|
36034
|
-
/* -------------------------------------------------------------------------------------------------
|
|
36035
|
-
* Primitive
|
|
36036
|
-
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
|
|
36037
|
-
const Node = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
36038
|
-
const { asChild: asChild , ...primitiveProps } = props;
|
|
36039
|
-
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
36040
|
-
React.useEffect(()=>{
|
|
36041
|
-
window[Symbol.for('radix-ui')] = true;
|
|
36042
|
-
}, []);
|
|
36043
|
-
return /*#__PURE__*/ React.createElement(Comp, _extends({}, primitiveProps, {
|
|
36044
|
-
ref: forwardedRef
|
|
36045
|
-
}));
|
|
36046
|
-
});
|
|
36047
|
-
Node.displayName = `Primitive.${node}`;
|
|
36048
|
-
return {
|
|
36049
|
-
...primitive,
|
|
36050
|
-
[node]: Node
|
|
36051
|
-
};
|
|
36052
|
-
}, {});
|
|
36053
|
-
/* -------------------------------------------------------------------------------------------------
|
|
36054
|
-
* Utils
|
|
36055
|
-
* -----------------------------------------------------------------------------------------------*/ /**
|
|
36056
|
-
* Flush custom event dispatch
|
|
36057
|
-
* https://github.com/radix-ui/primitives/pull/1378
|
|
36058
|
-
*
|
|
36059
|
-
* React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.
|
|
36060
|
-
*
|
|
36061
|
-
* Internally, React prioritises events in the following order:
|
|
36062
|
-
* - discrete
|
|
36063
|
-
* - continuous
|
|
36064
|
-
* - default
|
|
36065
|
-
*
|
|
36066
|
-
* https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350
|
|
36067
|
-
*
|
|
36068
|
-
* `discrete` is an important distinction as updates within these events are applied immediately.
|
|
36069
|
-
* React however, is not able to infer the priority of custom event types due to how they are detected internally.
|
|
36070
|
-
* Because of this, it's possible for updates from custom events to be unexpectedly batched when
|
|
36071
|
-
* dispatched by another `discrete` event.
|
|
36072
|
-
*
|
|
36073
|
-
* In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.
|
|
36074
|
-
* This utility should be used when dispatching a custom event from within another `discrete` event, this utility
|
|
36075
|
-
* is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.
|
|
36076
|
-
* For example:
|
|
36077
|
-
*
|
|
36078
|
-
* dispatching a known click 👎
|
|
36079
|
-
* target.dispatchEvent(new Event(‘click’))
|
|
36080
|
-
*
|
|
36081
|
-
* dispatching a custom type within a non-discrete event 👎
|
|
36082
|
-
* onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}
|
|
36083
|
-
*
|
|
36084
|
-
* dispatching a custom type within a `discrete` event 👍
|
|
36085
|
-
* onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}
|
|
36086
|
-
*
|
|
36087
|
-
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
|
|
36088
|
-
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
|
|
36089
|
-
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
|
|
36090
|
-
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
|
|
36091
|
-
if (target) reactDom.exports.flushSync(()=>target.dispatchEvent(event)
|
|
36092
|
-
);
|
|
36093
|
-
}
|
|
36094
|
-
|
|
36095
|
-
/**
|
|
36096
|
-
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
36097
|
-
* prop or avoid re-executing effects when passed as a dependency
|
|
36098
|
-
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
36099
|
-
const callbackRef = React.useRef(callback);
|
|
36100
|
-
React.useEffect(()=>{
|
|
36101
|
-
callbackRef.current = callback;
|
|
36102
|
-
}); // https://github.com/facebook/react/issues/19240
|
|
36103
|
-
return React.useMemo(()=>(...args)=>{
|
|
36104
|
-
var _callbackRef$current;
|
|
36105
|
-
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
36106
|
-
}
|
|
36107
|
-
, []);
|
|
36108
|
-
}
|
|
36109
|
-
|
|
36110
|
-
/**
|
|
36111
|
-
* Listens for when the escape key is down
|
|
36112
|
-
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
36113
|
-
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
36114
|
-
React.useEffect(()=>{
|
|
36115
|
-
const handleKeyDown = (event)=>{
|
|
36116
|
-
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
36117
|
-
};
|
|
36118
|
-
ownerDocument.addEventListener('keydown', handleKeyDown);
|
|
36119
|
-
return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
|
|
36120
|
-
;
|
|
36121
|
-
}, [
|
|
36122
|
-
onEscapeKeyDown,
|
|
36123
|
-
ownerDocument
|
|
36124
|
-
]);
|
|
36125
|
-
}
|
|
36126
|
-
|
|
36127
35916
|
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
36128
35917
|
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
36129
35918
|
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
@@ -36140,7 +35929,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
36140
35929
|
const [node1, setNode] = React.useState(null);
|
|
36141
35930
|
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;
|
|
36142
35931
|
const [, force] = React.useState({});
|
|
36143
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
35932
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setNode(node)
|
|
36144
35933
|
);
|
|
36145
35934
|
const layers = Array.from(context.layers);
|
|
36146
35935
|
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
@@ -36224,15 +36013,15 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
36224
36013
|
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
36225
36014
|
;
|
|
36226
36015
|
}, []);
|
|
36227
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
|
36016
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, layerProps, {
|
|
36228
36017
|
ref: composedRefs,
|
|
36229
36018
|
style: {
|
|
36230
36019
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
36231
36020
|
...props.style
|
|
36232
36021
|
},
|
|
36233
|
-
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
36234
|
-
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
36235
|
-
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
36022
|
+
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
36023
|
+
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
36024
|
+
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
36236
36025
|
}));
|
|
36237
36026
|
});
|
|
36238
36027
|
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
@@ -36240,7 +36029,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
36240
36029
|
* to mimic layer dismissing behaviour present in OS.
|
|
36241
36030
|
* Returns props to pass to the node we want to check for outside events.
|
|
36242
36031
|
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
36243
|
-
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
36032
|
+
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onPointerDownOutside);
|
|
36244
36033
|
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
36245
36034
|
const handleClickRef = React.useRef(()=>{});
|
|
36246
36035
|
React.useEffect(()=>{
|
|
@@ -36272,7 +36061,9 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
36272
36061
|
once: true
|
|
36273
36062
|
});
|
|
36274
36063
|
} else handleAndDispatchPointerDownOutsideEvent();
|
|
36275
|
-
}
|
|
36064
|
+
} else // We need to remove the event listener in case the outside click has been canceled.
|
|
36065
|
+
// See: https://github.com/radix-ui/primitives/issues/2171
|
|
36066
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
36276
36067
|
isPointerInsideReactTreeRef.current = false;
|
|
36277
36068
|
};
|
|
36278
36069
|
/**
|
|
@@ -36308,7 +36099,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef
|
|
|
36308
36099
|
* Listens for when focus happens outside a react subtree.
|
|
36309
36100
|
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
36310
36101
|
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
36311
|
-
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
36102
|
+
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onFocusOutside);
|
|
36312
36103
|
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
36313
36104
|
React.useEffect(()=>{
|
|
36314
36105
|
const handleFocus = (event)=>{
|
|
@@ -36352,32 +36143,6 @@ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detai
|
|
|
36352
36143
|
else target.dispatchEvent(event);
|
|
36353
36144
|
}
|
|
36354
36145
|
|
|
36355
|
-
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
|
|
36356
|
-
/**
|
|
36357
|
-
* Injects a pair of focus guards at the edges of the whole DOM tree
|
|
36358
|
-
* to ensure `focusin` & `focusout` events can be caught consistently.
|
|
36359
|
-
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
36360
|
-
React.useEffect(()=>{
|
|
36361
|
-
var _edgeGuards$, _edgeGuards$2;
|
|
36362
|
-
const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
|
|
36363
|
-
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
36364
|
-
document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
36365
|
-
$3db38b7d1fb3fe6a$var$count++;
|
|
36366
|
-
return ()=>{
|
|
36367
|
-
if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
|
|
36368
|
-
);
|
|
36369
|
-
$3db38b7d1fb3fe6a$var$count--;
|
|
36370
|
-
};
|
|
36371
|
-
}, []);
|
|
36372
|
-
}
|
|
36373
|
-
function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
36374
|
-
const element = document.createElement('span');
|
|
36375
|
-
element.setAttribute('data-radix-focus-guard', '');
|
|
36376
|
-
element.tabIndex = 0;
|
|
36377
|
-
element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
|
|
36378
|
-
return element;
|
|
36379
|
-
}
|
|
36380
|
-
|
|
36381
36146
|
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
|
|
36382
36147
|
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
|
|
36383
36148
|
const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
@@ -36387,10 +36152,10 @@ const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
|
36387
36152
|
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
36388
36153
|
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
36389
36154
|
const [container1, setContainer] = React.useState(null);
|
|
36390
|
-
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
36391
|
-
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
36155
|
+
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onMountAutoFocusProp);
|
|
36156
|
+
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onUnmountAutoFocusProp);
|
|
36392
36157
|
const lastFocusedElementRef = React.useRef(null);
|
|
36393
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
|
36158
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContainer(node)
|
|
36394
36159
|
);
|
|
36395
36160
|
const focusScope = React.useRef({
|
|
36396
36161
|
paused: false,
|
|
@@ -36413,15 +36178,40 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React.forwardRef
|
|
|
36413
36178
|
}
|
|
36414
36179
|
function handleFocusOut(event) {
|
|
36415
36180
|
if (focusScope.paused || !container1) return;
|
|
36416
|
-
|
|
36181
|
+
const relatedTarget = event.relatedTarget; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:
|
|
36182
|
+
//
|
|
36183
|
+
// 1. When the user switches app/tabs/windows/the browser itself loses focus.
|
|
36184
|
+
// 2. In Google Chrome, when the focused element is removed from the DOM.
|
|
36185
|
+
//
|
|
36186
|
+
// We let the browser do its thing here because:
|
|
36187
|
+
//
|
|
36188
|
+
// 1. The browser already keeps a memory of what's focused for when the page gets refocused.
|
|
36189
|
+
// 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it
|
|
36190
|
+
// throws the CPU to 100%, so we avoid doing anything for this reason here too.
|
|
36191
|
+
if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)
|
|
36192
|
+
// that is outside the container, we move focus to the last valid focused element inside.
|
|
36193
|
+
if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
36417
36194
|
select: true
|
|
36418
36195
|
});
|
|
36196
|
+
} // When the focused element gets removed from the DOM, browsers move focus
|
|
36197
|
+
// back to the document.body. In this case, we move focus to the container
|
|
36198
|
+
// to keep focus trapped correctly.
|
|
36199
|
+
function handleMutations(mutations) {
|
|
36200
|
+
const focusedElement = document.activeElement;
|
|
36201
|
+
if (focusedElement !== document.body) return;
|
|
36202
|
+
for (const mutation of mutations)if (mutation.removedNodes.length > 0) $d3863c46a17e8a28$var$focus(container1);
|
|
36419
36203
|
}
|
|
36420
36204
|
document.addEventListener('focusin', handleFocusIn);
|
|
36421
36205
|
document.addEventListener('focusout', handleFocusOut);
|
|
36206
|
+
const mutationObserver = new MutationObserver(handleMutations);
|
|
36207
|
+
if (container1) mutationObserver.observe(container1, {
|
|
36208
|
+
childList: true,
|
|
36209
|
+
subtree: true
|
|
36210
|
+
});
|
|
36422
36211
|
return ()=>{
|
|
36423
36212
|
document.removeEventListener('focusin', handleFocusIn);
|
|
36424
36213
|
document.removeEventListener('focusout', handleFocusOut);
|
|
36214
|
+
mutationObserver.disconnect();
|
|
36425
36215
|
};
|
|
36426
36216
|
}
|
|
36427
36217
|
}, [
|
|
@@ -36498,7 +36288,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React.forwardRef
|
|
|
36498
36288
|
trapped,
|
|
36499
36289
|
focusScope.paused
|
|
36500
36290
|
]);
|
|
36501
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
36291
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
36502
36292
|
tabIndex: -1
|
|
36503
36293
|
}, scopeProps, {
|
|
36504
36294
|
ref: composedRefs,
|
|
@@ -36622,80 +36412,2163 @@ function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
|
36622
36412
|
);
|
|
36623
36413
|
}
|
|
36624
36414
|
|
|
36415
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
36416
|
+
const min = Math.min;
|
|
36417
|
+
const max = Math.max;
|
|
36418
|
+
const round = Math.round;
|
|
36419
|
+
const floor = Math.floor;
|
|
36420
|
+
const createCoords = v => ({
|
|
36421
|
+
x: v,
|
|
36422
|
+
y: v
|
|
36423
|
+
});
|
|
36424
|
+
const oppositeSideMap = {
|
|
36425
|
+
left: 'right',
|
|
36426
|
+
right: 'left',
|
|
36427
|
+
bottom: 'top',
|
|
36428
|
+
top: 'bottom'
|
|
36429
|
+
};
|
|
36430
|
+
const oppositeAlignmentMap = {
|
|
36431
|
+
start: 'end',
|
|
36432
|
+
end: 'start'
|
|
36433
|
+
};
|
|
36434
|
+
function clamp(start, value, end) {
|
|
36435
|
+
return max(start, min(value, end));
|
|
36436
|
+
}
|
|
36437
|
+
function evaluate(value, param) {
|
|
36438
|
+
return typeof value === 'function' ? value(param) : value;
|
|
36439
|
+
}
|
|
36440
|
+
function getSide(placement) {
|
|
36441
|
+
return placement.split('-')[0];
|
|
36442
|
+
}
|
|
36443
|
+
function getAlignment(placement) {
|
|
36444
|
+
return placement.split('-')[1];
|
|
36445
|
+
}
|
|
36446
|
+
function getOppositeAxis(axis) {
|
|
36447
|
+
return axis === 'x' ? 'y' : 'x';
|
|
36448
|
+
}
|
|
36449
|
+
function getAxisLength(axis) {
|
|
36450
|
+
return axis === 'y' ? 'height' : 'width';
|
|
36451
|
+
}
|
|
36452
|
+
function getSideAxis(placement) {
|
|
36453
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
36454
|
+
}
|
|
36455
|
+
function getAlignmentAxis(placement) {
|
|
36456
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
36457
|
+
}
|
|
36458
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
36459
|
+
if (rtl === void 0) {
|
|
36460
|
+
rtl = false;
|
|
36461
|
+
}
|
|
36462
|
+
const alignment = getAlignment(placement);
|
|
36463
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
36464
|
+
const length = getAxisLength(alignmentAxis);
|
|
36465
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
36466
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
36467
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
36468
|
+
}
|
|
36469
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
36470
|
+
}
|
|
36471
|
+
function getExpandedPlacements(placement) {
|
|
36472
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
36473
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
36474
|
+
}
|
|
36475
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
36476
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
36477
|
+
}
|
|
36478
|
+
function getSideList(side, isStart, rtl) {
|
|
36479
|
+
const lr = ['left', 'right'];
|
|
36480
|
+
const rl = ['right', 'left'];
|
|
36481
|
+
const tb = ['top', 'bottom'];
|
|
36482
|
+
const bt = ['bottom', 'top'];
|
|
36483
|
+
switch (side) {
|
|
36484
|
+
case 'top':
|
|
36485
|
+
case 'bottom':
|
|
36486
|
+
if (rtl) return isStart ? rl : lr;
|
|
36487
|
+
return isStart ? lr : rl;
|
|
36488
|
+
case 'left':
|
|
36489
|
+
case 'right':
|
|
36490
|
+
return isStart ? tb : bt;
|
|
36491
|
+
default:
|
|
36492
|
+
return [];
|
|
36493
|
+
}
|
|
36494
|
+
}
|
|
36495
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
36496
|
+
const alignment = getAlignment(placement);
|
|
36497
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
36498
|
+
if (alignment) {
|
|
36499
|
+
list = list.map(side => side + "-" + alignment);
|
|
36500
|
+
if (flipAlignment) {
|
|
36501
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
36502
|
+
}
|
|
36503
|
+
}
|
|
36504
|
+
return list;
|
|
36505
|
+
}
|
|
36506
|
+
function getOppositePlacement(placement) {
|
|
36507
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
36508
|
+
}
|
|
36509
|
+
function expandPaddingObject(padding) {
|
|
36510
|
+
return {
|
|
36511
|
+
top: 0,
|
|
36512
|
+
right: 0,
|
|
36513
|
+
bottom: 0,
|
|
36514
|
+
left: 0,
|
|
36515
|
+
...padding
|
|
36516
|
+
};
|
|
36517
|
+
}
|
|
36518
|
+
function getPaddingObject(padding) {
|
|
36519
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
36520
|
+
top: padding,
|
|
36521
|
+
right: padding,
|
|
36522
|
+
bottom: padding,
|
|
36523
|
+
left: padding
|
|
36524
|
+
};
|
|
36525
|
+
}
|
|
36526
|
+
function rectToClientRect(rect) {
|
|
36527
|
+
return {
|
|
36528
|
+
...rect,
|
|
36529
|
+
top: rect.y,
|
|
36530
|
+
left: rect.x,
|
|
36531
|
+
right: rect.x + rect.width,
|
|
36532
|
+
bottom: rect.y + rect.height
|
|
36533
|
+
};
|
|
36534
|
+
}
|
|
36535
|
+
|
|
36536
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
36537
|
+
let {
|
|
36538
|
+
reference,
|
|
36539
|
+
floating
|
|
36540
|
+
} = _ref;
|
|
36541
|
+
const sideAxis = getSideAxis(placement);
|
|
36542
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
36543
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
36544
|
+
const side = getSide(placement);
|
|
36545
|
+
const isVertical = sideAxis === 'y';
|
|
36546
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
36547
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
36548
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
36549
|
+
let coords;
|
|
36550
|
+
switch (side) {
|
|
36551
|
+
case 'top':
|
|
36552
|
+
coords = {
|
|
36553
|
+
x: commonX,
|
|
36554
|
+
y: reference.y - floating.height
|
|
36555
|
+
};
|
|
36556
|
+
break;
|
|
36557
|
+
case 'bottom':
|
|
36558
|
+
coords = {
|
|
36559
|
+
x: commonX,
|
|
36560
|
+
y: reference.y + reference.height
|
|
36561
|
+
};
|
|
36562
|
+
break;
|
|
36563
|
+
case 'right':
|
|
36564
|
+
coords = {
|
|
36565
|
+
x: reference.x + reference.width,
|
|
36566
|
+
y: commonY
|
|
36567
|
+
};
|
|
36568
|
+
break;
|
|
36569
|
+
case 'left':
|
|
36570
|
+
coords = {
|
|
36571
|
+
x: reference.x - floating.width,
|
|
36572
|
+
y: commonY
|
|
36573
|
+
};
|
|
36574
|
+
break;
|
|
36575
|
+
default:
|
|
36576
|
+
coords = {
|
|
36577
|
+
x: reference.x,
|
|
36578
|
+
y: reference.y
|
|
36579
|
+
};
|
|
36580
|
+
}
|
|
36581
|
+
switch (getAlignment(placement)) {
|
|
36582
|
+
case 'start':
|
|
36583
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
36584
|
+
break;
|
|
36585
|
+
case 'end':
|
|
36586
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
36587
|
+
break;
|
|
36588
|
+
}
|
|
36589
|
+
return coords;
|
|
36590
|
+
}
|
|
36591
|
+
|
|
36625
36592
|
/**
|
|
36626
|
-
*
|
|
36627
|
-
*
|
|
36628
|
-
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
36593
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
36594
|
+
* next to a reference element when it is given a certain positioning strategy.
|
|
36629
36595
|
*
|
|
36630
|
-
*
|
|
36631
|
-
|
|
36596
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
36597
|
+
* write one for the platform you are using Floating UI with.
|
|
36598
|
+
*/
|
|
36599
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
36600
|
+
const {
|
|
36601
|
+
placement = 'bottom',
|
|
36602
|
+
strategy = 'absolute',
|
|
36603
|
+
middleware = [],
|
|
36604
|
+
platform
|
|
36605
|
+
} = config;
|
|
36606
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
36607
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
36608
|
+
let rects = await platform.getElementRects({
|
|
36609
|
+
reference,
|
|
36610
|
+
floating,
|
|
36611
|
+
strategy
|
|
36612
|
+
});
|
|
36613
|
+
let {
|
|
36614
|
+
x,
|
|
36615
|
+
y
|
|
36616
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
36617
|
+
let statefulPlacement = placement;
|
|
36618
|
+
let middlewareData = {};
|
|
36619
|
+
let resetCount = 0;
|
|
36620
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
36621
|
+
const {
|
|
36622
|
+
name,
|
|
36623
|
+
fn
|
|
36624
|
+
} = validMiddleware[i];
|
|
36625
|
+
const {
|
|
36626
|
+
x: nextX,
|
|
36627
|
+
y: nextY,
|
|
36628
|
+
data,
|
|
36629
|
+
reset
|
|
36630
|
+
} = await fn({
|
|
36631
|
+
x,
|
|
36632
|
+
y,
|
|
36633
|
+
initialPlacement: placement,
|
|
36634
|
+
placement: statefulPlacement,
|
|
36635
|
+
strategy,
|
|
36636
|
+
middlewareData,
|
|
36637
|
+
rects,
|
|
36638
|
+
platform,
|
|
36639
|
+
elements: {
|
|
36640
|
+
reference,
|
|
36641
|
+
floating
|
|
36642
|
+
}
|
|
36643
|
+
});
|
|
36644
|
+
x = nextX != null ? nextX : x;
|
|
36645
|
+
y = nextY != null ? nextY : y;
|
|
36646
|
+
middlewareData = {
|
|
36647
|
+
...middlewareData,
|
|
36648
|
+
[name]: {
|
|
36649
|
+
...middlewareData[name],
|
|
36650
|
+
...data
|
|
36651
|
+
}
|
|
36652
|
+
};
|
|
36653
|
+
if (reset && resetCount <= 50) {
|
|
36654
|
+
resetCount++;
|
|
36655
|
+
if (typeof reset === 'object') {
|
|
36656
|
+
if (reset.placement) {
|
|
36657
|
+
statefulPlacement = reset.placement;
|
|
36658
|
+
}
|
|
36659
|
+
if (reset.rects) {
|
|
36660
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
36661
|
+
reference,
|
|
36662
|
+
floating,
|
|
36663
|
+
strategy
|
|
36664
|
+
}) : reset.rects;
|
|
36665
|
+
}
|
|
36666
|
+
({
|
|
36667
|
+
x,
|
|
36668
|
+
y
|
|
36669
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
36670
|
+
}
|
|
36671
|
+
i = -1;
|
|
36672
|
+
continue;
|
|
36673
|
+
}
|
|
36674
|
+
}
|
|
36675
|
+
return {
|
|
36676
|
+
x,
|
|
36677
|
+
y,
|
|
36678
|
+
placement: statefulPlacement,
|
|
36679
|
+
strategy,
|
|
36680
|
+
middlewareData
|
|
36681
|
+
};
|
|
36682
|
+
};
|
|
36632
36683
|
|
|
36633
|
-
|
|
36634
|
-
|
|
36635
|
-
|
|
36636
|
-
|
|
36637
|
-
|
|
36638
|
-
|
|
36639
|
-
|
|
36640
|
-
|
|
36641
|
-
|
|
36642
|
-
|
|
36643
|
-
|
|
36644
|
-
|
|
36684
|
+
/**
|
|
36685
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
36686
|
+
* element is overflowing a given clipping boundary on each side.
|
|
36687
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
36688
|
+
* - negative = how many pixels left before it will overflow
|
|
36689
|
+
* - 0 = lies flush with the boundary
|
|
36690
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
36691
|
+
*/
|
|
36692
|
+
async function detectOverflow(state, options) {
|
|
36693
|
+
var _await$platform$isEle;
|
|
36694
|
+
if (options === void 0) {
|
|
36695
|
+
options = {};
|
|
36696
|
+
}
|
|
36697
|
+
const {
|
|
36698
|
+
x,
|
|
36699
|
+
y,
|
|
36700
|
+
platform,
|
|
36701
|
+
rects,
|
|
36702
|
+
elements,
|
|
36703
|
+
strategy
|
|
36704
|
+
} = state;
|
|
36705
|
+
const {
|
|
36706
|
+
boundary = 'clippingAncestors',
|
|
36707
|
+
rootBoundary = 'viewport',
|
|
36708
|
+
elementContext = 'floating',
|
|
36709
|
+
altBoundary = false,
|
|
36710
|
+
padding = 0
|
|
36711
|
+
} = evaluate(options, state);
|
|
36712
|
+
const paddingObject = getPaddingObject(padding);
|
|
36713
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
36714
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
36715
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
36716
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
36717
|
+
boundary,
|
|
36718
|
+
rootBoundary,
|
|
36719
|
+
strategy
|
|
36720
|
+
}));
|
|
36721
|
+
const rect = elementContext === 'floating' ? {
|
|
36722
|
+
...rects.floating,
|
|
36723
|
+
x,
|
|
36724
|
+
y
|
|
36725
|
+
} : rects.reference;
|
|
36726
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
36727
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
36728
|
+
x: 1,
|
|
36729
|
+
y: 1
|
|
36730
|
+
} : {
|
|
36731
|
+
x: 1,
|
|
36732
|
+
y: 1
|
|
36733
|
+
};
|
|
36734
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
36735
|
+
rect,
|
|
36736
|
+
offsetParent,
|
|
36737
|
+
strategy
|
|
36738
|
+
}) : rect);
|
|
36739
|
+
return {
|
|
36740
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
36741
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
36742
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
36743
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
36744
|
+
};
|
|
36645
36745
|
}
|
|
36646
36746
|
|
|
36647
|
-
|
|
36648
|
-
|
|
36649
|
-
|
|
36650
|
-
|
|
36651
|
-
|
|
36652
|
-
|
|
36747
|
+
/**
|
|
36748
|
+
* Provides data to position an inner element of the floating element so that it
|
|
36749
|
+
* appears centered to the reference element.
|
|
36750
|
+
* @see https://floating-ui.com/docs/arrow
|
|
36751
|
+
*/
|
|
36752
|
+
const arrow$1 = options => ({
|
|
36753
|
+
name: 'arrow',
|
|
36754
|
+
options,
|
|
36755
|
+
async fn(state) {
|
|
36756
|
+
const {
|
|
36757
|
+
x,
|
|
36758
|
+
y,
|
|
36759
|
+
placement,
|
|
36760
|
+
rects,
|
|
36761
|
+
platform,
|
|
36762
|
+
elements,
|
|
36763
|
+
middlewareData
|
|
36764
|
+
} = state;
|
|
36765
|
+
// Since `element` is required, we don't Partial<> the type.
|
|
36766
|
+
const {
|
|
36767
|
+
element,
|
|
36768
|
+
padding = 0
|
|
36769
|
+
} = evaluate(options, state) || {};
|
|
36770
|
+
if (element == null) {
|
|
36771
|
+
return {};
|
|
36772
|
+
}
|
|
36773
|
+
const paddingObject = getPaddingObject(padding);
|
|
36774
|
+
const coords = {
|
|
36775
|
+
x,
|
|
36776
|
+
y
|
|
36777
|
+
};
|
|
36778
|
+
const axis = getAlignmentAxis(placement);
|
|
36779
|
+
const length = getAxisLength(axis);
|
|
36780
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
36781
|
+
const isYAxis = axis === 'y';
|
|
36782
|
+
const minProp = isYAxis ? 'top' : 'left';
|
|
36783
|
+
const maxProp = isYAxis ? 'bottom' : 'right';
|
|
36784
|
+
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
36785
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
36786
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
36787
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
36788
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
36789
|
+
|
|
36790
|
+
// DOM platform can return `window` as the `offsetParent`.
|
|
36791
|
+
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
|
36792
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
36793
|
+
}
|
|
36794
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
36795
|
+
|
|
36796
|
+
// If the padding is large enough that it causes the arrow to no longer be
|
|
36797
|
+
// centered, modify the padding so that it is centered.
|
|
36798
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
36799
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
36800
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
36801
|
+
|
|
36802
|
+
// Make sure the arrow doesn't overflow the floating element if the center
|
|
36803
|
+
// point is outside the floating element's bounds.
|
|
36804
|
+
const min$1 = minPadding;
|
|
36805
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
36806
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
36807
|
+
const offset = clamp(min$1, center, max);
|
|
36808
|
+
|
|
36809
|
+
// If the reference is small enough that the arrow's padding causes it to
|
|
36810
|
+
// to point to nothing for an aligned placement, adjust the offset of the
|
|
36811
|
+
// floating element itself. To ensure `shift()` continues to take action,
|
|
36812
|
+
// a single reset is performed when this is true.
|
|
36813
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
36814
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
|
36815
|
+
return {
|
|
36816
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
36817
|
+
data: {
|
|
36818
|
+
[axis]: offset,
|
|
36819
|
+
centerOffset: center - offset - alignmentOffset,
|
|
36820
|
+
...(shouldAddOffset && {
|
|
36821
|
+
alignmentOffset
|
|
36822
|
+
})
|
|
36823
|
+
},
|
|
36824
|
+
reset: shouldAddOffset
|
|
36825
|
+
};
|
|
36826
|
+
}
|
|
36653
36827
|
});
|
|
36654
36828
|
|
|
36655
|
-
|
|
36656
|
-
|
|
36657
|
-
|
|
36658
|
-
|
|
36829
|
+
/**
|
|
36830
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
36831
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
36832
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
36833
|
+
* @see https://floating-ui.com/docs/flip
|
|
36834
|
+
*/
|
|
36835
|
+
const flip = function (options) {
|
|
36836
|
+
if (options === void 0) {
|
|
36837
|
+
options = {};
|
|
36838
|
+
}
|
|
36839
|
+
return {
|
|
36840
|
+
name: 'flip',
|
|
36841
|
+
options,
|
|
36842
|
+
async fn(state) {
|
|
36843
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
36844
|
+
const {
|
|
36845
|
+
placement,
|
|
36846
|
+
middlewareData,
|
|
36847
|
+
rects,
|
|
36848
|
+
initialPlacement,
|
|
36849
|
+
platform,
|
|
36850
|
+
elements
|
|
36851
|
+
} = state;
|
|
36852
|
+
const {
|
|
36853
|
+
mainAxis: checkMainAxis = true,
|
|
36854
|
+
crossAxis: checkCrossAxis = true,
|
|
36855
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
36856
|
+
fallbackStrategy = 'bestFit',
|
|
36857
|
+
fallbackAxisSideDirection = 'none',
|
|
36858
|
+
flipAlignment = true,
|
|
36859
|
+
...detectOverflowOptions
|
|
36860
|
+
} = evaluate(options, state);
|
|
36861
|
+
|
|
36862
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
36863
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
36864
|
+
// work.
|
|
36865
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
36866
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
36867
|
+
return {};
|
|
36868
|
+
}
|
|
36869
|
+
const side = getSide(placement);
|
|
36870
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
36871
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
36872
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
36873
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
|
|
36874
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
36875
|
+
}
|
|
36876
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
36877
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
36878
|
+
const overflows = [];
|
|
36879
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
36880
|
+
if (checkMainAxis) {
|
|
36881
|
+
overflows.push(overflow[side]);
|
|
36882
|
+
}
|
|
36883
|
+
if (checkCrossAxis) {
|
|
36884
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
36885
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
36886
|
+
}
|
|
36887
|
+
overflowsData = [...overflowsData, {
|
|
36888
|
+
placement,
|
|
36889
|
+
overflows
|
|
36890
|
+
}];
|
|
36891
|
+
|
|
36892
|
+
// One or more sides is overflowing.
|
|
36893
|
+
if (!overflows.every(side => side <= 0)) {
|
|
36894
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
36895
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
36896
|
+
const nextPlacement = placements[nextIndex];
|
|
36897
|
+
if (nextPlacement) {
|
|
36898
|
+
// Try next placement and re-run the lifecycle.
|
|
36899
|
+
return {
|
|
36900
|
+
data: {
|
|
36901
|
+
index: nextIndex,
|
|
36902
|
+
overflows: overflowsData
|
|
36903
|
+
},
|
|
36904
|
+
reset: {
|
|
36905
|
+
placement: nextPlacement
|
|
36906
|
+
}
|
|
36907
|
+
};
|
|
36908
|
+
}
|
|
36909
|
+
|
|
36910
|
+
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
36911
|
+
// then find the placement that fits the best on the main crossAxis side.
|
|
36912
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
36913
|
+
|
|
36914
|
+
// Otherwise fallback.
|
|
36915
|
+
if (!resetPlacement) {
|
|
36916
|
+
switch (fallbackStrategy) {
|
|
36917
|
+
case 'bestFit':
|
|
36918
|
+
{
|
|
36919
|
+
var _overflowsData$map$so;
|
|
36920
|
+
const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
|
|
36921
|
+
if (placement) {
|
|
36922
|
+
resetPlacement = placement;
|
|
36923
|
+
}
|
|
36924
|
+
break;
|
|
36925
|
+
}
|
|
36926
|
+
case 'initialPlacement':
|
|
36927
|
+
resetPlacement = initialPlacement;
|
|
36928
|
+
break;
|
|
36929
|
+
}
|
|
36930
|
+
}
|
|
36931
|
+
if (placement !== resetPlacement) {
|
|
36932
|
+
return {
|
|
36933
|
+
reset: {
|
|
36934
|
+
placement: resetPlacement
|
|
36935
|
+
}
|
|
36936
|
+
};
|
|
36937
|
+
}
|
|
36938
|
+
}
|
|
36939
|
+
return {};
|
|
36940
|
+
}
|
|
36941
|
+
};
|
|
36942
|
+
};
|
|
36943
|
+
|
|
36944
|
+
function getSideOffsets(overflow, rect) {
|
|
36945
|
+
return {
|
|
36946
|
+
top: overflow.top - rect.height,
|
|
36947
|
+
right: overflow.right - rect.width,
|
|
36948
|
+
bottom: overflow.bottom - rect.height,
|
|
36949
|
+
left: overflow.left - rect.width
|
|
36950
|
+
};
|
|
36951
|
+
}
|
|
36952
|
+
function isAnySideFullyClipped(overflow) {
|
|
36953
|
+
return sides.some(side => overflow[side] >= 0);
|
|
36954
|
+
}
|
|
36955
|
+
/**
|
|
36956
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
36957
|
+
* when it is not in the same clipping context as the reference element.
|
|
36958
|
+
* @see https://floating-ui.com/docs/hide
|
|
36959
|
+
*/
|
|
36960
|
+
const hide = function (options) {
|
|
36961
|
+
if (options === void 0) {
|
|
36962
|
+
options = {};
|
|
36963
|
+
}
|
|
36964
|
+
return {
|
|
36965
|
+
name: 'hide',
|
|
36966
|
+
options,
|
|
36967
|
+
async fn(state) {
|
|
36968
|
+
const {
|
|
36969
|
+
rects
|
|
36970
|
+
} = state;
|
|
36971
|
+
const {
|
|
36972
|
+
strategy = 'referenceHidden',
|
|
36973
|
+
...detectOverflowOptions
|
|
36974
|
+
} = evaluate(options, state);
|
|
36975
|
+
switch (strategy) {
|
|
36976
|
+
case 'referenceHidden':
|
|
36977
|
+
{
|
|
36978
|
+
const overflow = await detectOverflow(state, {
|
|
36979
|
+
...detectOverflowOptions,
|
|
36980
|
+
elementContext: 'reference'
|
|
36981
|
+
});
|
|
36982
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
36983
|
+
return {
|
|
36984
|
+
data: {
|
|
36985
|
+
referenceHiddenOffsets: offsets,
|
|
36986
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
36987
|
+
}
|
|
36988
|
+
};
|
|
36989
|
+
}
|
|
36990
|
+
case 'escaped':
|
|
36991
|
+
{
|
|
36992
|
+
const overflow = await detectOverflow(state, {
|
|
36993
|
+
...detectOverflowOptions,
|
|
36994
|
+
altBoundary: true
|
|
36995
|
+
});
|
|
36996
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
36997
|
+
return {
|
|
36998
|
+
data: {
|
|
36999
|
+
escapedOffsets: offsets,
|
|
37000
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
37001
|
+
}
|
|
37002
|
+
};
|
|
37003
|
+
}
|
|
37004
|
+
default:
|
|
37005
|
+
{
|
|
37006
|
+
return {};
|
|
37007
|
+
}
|
|
37008
|
+
}
|
|
37009
|
+
}
|
|
37010
|
+
};
|
|
37011
|
+
};
|
|
37012
|
+
|
|
37013
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
37014
|
+
// Derivable.
|
|
37015
|
+
async function convertValueToCoords(state, options) {
|
|
37016
|
+
const {
|
|
37017
|
+
placement,
|
|
37018
|
+
platform,
|
|
37019
|
+
elements
|
|
37020
|
+
} = state;
|
|
37021
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
37022
|
+
const side = getSide(placement);
|
|
37023
|
+
const alignment = getAlignment(placement);
|
|
37024
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
37025
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
37026
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
37027
|
+
const rawValue = evaluate(options, state);
|
|
37028
|
+
|
|
37029
|
+
// eslint-disable-next-line prefer-const
|
|
37030
|
+
let {
|
|
37031
|
+
mainAxis,
|
|
37032
|
+
crossAxis,
|
|
37033
|
+
alignmentAxis
|
|
37034
|
+
} = typeof rawValue === 'number' ? {
|
|
37035
|
+
mainAxis: rawValue,
|
|
37036
|
+
crossAxis: 0,
|
|
37037
|
+
alignmentAxis: null
|
|
37038
|
+
} : {
|
|
37039
|
+
mainAxis: 0,
|
|
37040
|
+
crossAxis: 0,
|
|
37041
|
+
alignmentAxis: null,
|
|
37042
|
+
...rawValue
|
|
37043
|
+
};
|
|
37044
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
37045
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
37046
|
+
}
|
|
37047
|
+
return isVertical ? {
|
|
37048
|
+
x: crossAxis * crossAxisMulti,
|
|
37049
|
+
y: mainAxis * mainAxisMulti
|
|
37050
|
+
} : {
|
|
37051
|
+
x: mainAxis * mainAxisMulti,
|
|
37052
|
+
y: crossAxis * crossAxisMulti
|
|
37053
|
+
};
|
|
37054
|
+
}
|
|
37055
|
+
|
|
37056
|
+
/**
|
|
37057
|
+
* Modifies the placement by translating the floating element along the
|
|
37058
|
+
* specified axes.
|
|
37059
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
37060
|
+
* object may be passed.
|
|
37061
|
+
* @see https://floating-ui.com/docs/offset
|
|
37062
|
+
*/
|
|
37063
|
+
const offset = function (options) {
|
|
37064
|
+
if (options === void 0) {
|
|
37065
|
+
options = 0;
|
|
37066
|
+
}
|
|
37067
|
+
return {
|
|
37068
|
+
name: 'offset',
|
|
37069
|
+
options,
|
|
37070
|
+
async fn(state) {
|
|
37071
|
+
const {
|
|
37072
|
+
x,
|
|
37073
|
+
y
|
|
37074
|
+
} = state;
|
|
37075
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
37076
|
+
return {
|
|
37077
|
+
x: x + diffCoords.x,
|
|
37078
|
+
y: y + diffCoords.y,
|
|
37079
|
+
data: diffCoords
|
|
37080
|
+
};
|
|
37081
|
+
}
|
|
37082
|
+
};
|
|
37083
|
+
};
|
|
37084
|
+
|
|
37085
|
+
/**
|
|
37086
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
37087
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
37088
|
+
* @see https://floating-ui.com/docs/shift
|
|
37089
|
+
*/
|
|
37090
|
+
const shift = function (options) {
|
|
37091
|
+
if (options === void 0) {
|
|
37092
|
+
options = {};
|
|
37093
|
+
}
|
|
37094
|
+
return {
|
|
37095
|
+
name: 'shift',
|
|
37096
|
+
options,
|
|
37097
|
+
async fn(state) {
|
|
37098
|
+
const {
|
|
37099
|
+
x,
|
|
37100
|
+
y,
|
|
37101
|
+
placement
|
|
37102
|
+
} = state;
|
|
37103
|
+
const {
|
|
37104
|
+
mainAxis: checkMainAxis = true,
|
|
37105
|
+
crossAxis: checkCrossAxis = false,
|
|
37106
|
+
limiter = {
|
|
37107
|
+
fn: _ref => {
|
|
37108
|
+
let {
|
|
37109
|
+
x,
|
|
37110
|
+
y
|
|
37111
|
+
} = _ref;
|
|
37112
|
+
return {
|
|
37113
|
+
x,
|
|
37114
|
+
y
|
|
37115
|
+
};
|
|
37116
|
+
}
|
|
37117
|
+
},
|
|
37118
|
+
...detectOverflowOptions
|
|
37119
|
+
} = evaluate(options, state);
|
|
37120
|
+
const coords = {
|
|
37121
|
+
x,
|
|
37122
|
+
y
|
|
37123
|
+
};
|
|
37124
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
37125
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
37126
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
37127
|
+
let mainAxisCoord = coords[mainAxis];
|
|
37128
|
+
let crossAxisCoord = coords[crossAxis];
|
|
37129
|
+
if (checkMainAxis) {
|
|
37130
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
37131
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
37132
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
37133
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
37134
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
37135
|
+
}
|
|
37136
|
+
if (checkCrossAxis) {
|
|
37137
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
37138
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
37139
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
37140
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
37141
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
37142
|
+
}
|
|
37143
|
+
const limitedCoords = limiter.fn({
|
|
37144
|
+
...state,
|
|
37145
|
+
[mainAxis]: mainAxisCoord,
|
|
37146
|
+
[crossAxis]: crossAxisCoord
|
|
37147
|
+
});
|
|
37148
|
+
return {
|
|
37149
|
+
...limitedCoords,
|
|
37150
|
+
data: {
|
|
37151
|
+
x: limitedCoords.x - x,
|
|
37152
|
+
y: limitedCoords.y - y
|
|
37153
|
+
}
|
|
37154
|
+
};
|
|
37155
|
+
}
|
|
37156
|
+
};
|
|
37157
|
+
};
|
|
37158
|
+
/**
|
|
37159
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
37160
|
+
*/
|
|
37161
|
+
const limitShift = function (options) {
|
|
37162
|
+
if (options === void 0) {
|
|
37163
|
+
options = {};
|
|
37164
|
+
}
|
|
37165
|
+
return {
|
|
37166
|
+
options,
|
|
37167
|
+
fn(state) {
|
|
37168
|
+
const {
|
|
37169
|
+
x,
|
|
37170
|
+
y,
|
|
37171
|
+
placement,
|
|
37172
|
+
rects,
|
|
37173
|
+
middlewareData
|
|
37174
|
+
} = state;
|
|
37175
|
+
const {
|
|
37176
|
+
offset = 0,
|
|
37177
|
+
mainAxis: checkMainAxis = true,
|
|
37178
|
+
crossAxis: checkCrossAxis = true
|
|
37179
|
+
} = evaluate(options, state);
|
|
37180
|
+
const coords = {
|
|
37181
|
+
x,
|
|
37182
|
+
y
|
|
37183
|
+
};
|
|
37184
|
+
const crossAxis = getSideAxis(placement);
|
|
37185
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
37186
|
+
let mainAxisCoord = coords[mainAxis];
|
|
37187
|
+
let crossAxisCoord = coords[crossAxis];
|
|
37188
|
+
const rawOffset = evaluate(offset, state);
|
|
37189
|
+
const computedOffset = typeof rawOffset === 'number' ? {
|
|
37190
|
+
mainAxis: rawOffset,
|
|
37191
|
+
crossAxis: 0
|
|
37192
|
+
} : {
|
|
37193
|
+
mainAxis: 0,
|
|
37194
|
+
crossAxis: 0,
|
|
37195
|
+
...rawOffset
|
|
37196
|
+
};
|
|
37197
|
+
if (checkMainAxis) {
|
|
37198
|
+
const len = mainAxis === 'y' ? 'height' : 'width';
|
|
37199
|
+
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
|
37200
|
+
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
|
37201
|
+
if (mainAxisCoord < limitMin) {
|
|
37202
|
+
mainAxisCoord = limitMin;
|
|
37203
|
+
} else if (mainAxisCoord > limitMax) {
|
|
37204
|
+
mainAxisCoord = limitMax;
|
|
37205
|
+
}
|
|
37206
|
+
}
|
|
37207
|
+
if (checkCrossAxis) {
|
|
37208
|
+
var _middlewareData$offse, _middlewareData$offse2;
|
|
37209
|
+
const len = mainAxis === 'y' ? 'width' : 'height';
|
|
37210
|
+
const isOriginSide = ['top', 'left'].includes(getSide(placement));
|
|
37211
|
+
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
37212
|
+
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
37213
|
+
if (crossAxisCoord < limitMin) {
|
|
37214
|
+
crossAxisCoord = limitMin;
|
|
37215
|
+
} else if (crossAxisCoord > limitMax) {
|
|
37216
|
+
crossAxisCoord = limitMax;
|
|
37217
|
+
}
|
|
37218
|
+
}
|
|
37219
|
+
return {
|
|
37220
|
+
[mainAxis]: mainAxisCoord,
|
|
37221
|
+
[crossAxis]: crossAxisCoord
|
|
37222
|
+
};
|
|
37223
|
+
}
|
|
37224
|
+
};
|
|
37225
|
+
};
|
|
37226
|
+
|
|
37227
|
+
/**
|
|
37228
|
+
* Provides data that allows you to change the size of the floating element —
|
|
37229
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
37230
|
+
* width of the reference element.
|
|
37231
|
+
* @see https://floating-ui.com/docs/size
|
|
37232
|
+
*/
|
|
37233
|
+
const size = function (options) {
|
|
37234
|
+
if (options === void 0) {
|
|
37235
|
+
options = {};
|
|
37236
|
+
}
|
|
37237
|
+
return {
|
|
37238
|
+
name: 'size',
|
|
37239
|
+
options,
|
|
37240
|
+
async fn(state) {
|
|
37241
|
+
const {
|
|
37242
|
+
placement,
|
|
37243
|
+
rects,
|
|
37244
|
+
platform,
|
|
37245
|
+
elements
|
|
37246
|
+
} = state;
|
|
37247
|
+
const {
|
|
37248
|
+
apply = () => {},
|
|
37249
|
+
...detectOverflowOptions
|
|
37250
|
+
} = evaluate(options, state);
|
|
37251
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
37252
|
+
const side = getSide(placement);
|
|
37253
|
+
const alignment = getAlignment(placement);
|
|
37254
|
+
const isYAxis = getSideAxis(placement) === 'y';
|
|
37255
|
+
const {
|
|
37256
|
+
width,
|
|
37257
|
+
height
|
|
37258
|
+
} = rects.floating;
|
|
37259
|
+
let heightSide;
|
|
37260
|
+
let widthSide;
|
|
37261
|
+
if (side === 'top' || side === 'bottom') {
|
|
37262
|
+
heightSide = side;
|
|
37263
|
+
widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
|
|
37264
|
+
} else {
|
|
37265
|
+
widthSide = side;
|
|
37266
|
+
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
37267
|
+
}
|
|
37268
|
+
const overflowAvailableHeight = height - overflow[heightSide];
|
|
37269
|
+
const overflowAvailableWidth = width - overflow[widthSide];
|
|
37270
|
+
const noShift = !state.middlewareData.shift;
|
|
37271
|
+
let availableHeight = overflowAvailableHeight;
|
|
37272
|
+
let availableWidth = overflowAvailableWidth;
|
|
37273
|
+
if (isYAxis) {
|
|
37274
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
37275
|
+
availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
|
|
37276
|
+
} else {
|
|
37277
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
37278
|
+
availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
|
37279
|
+
}
|
|
37280
|
+
if (noShift && !alignment) {
|
|
37281
|
+
const xMin = max(overflow.left, 0);
|
|
37282
|
+
const xMax = max(overflow.right, 0);
|
|
37283
|
+
const yMin = max(overflow.top, 0);
|
|
37284
|
+
const yMax = max(overflow.bottom, 0);
|
|
37285
|
+
if (isYAxis) {
|
|
37286
|
+
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
37287
|
+
} else {
|
|
37288
|
+
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
37289
|
+
}
|
|
37290
|
+
}
|
|
37291
|
+
await apply({
|
|
37292
|
+
...state,
|
|
37293
|
+
availableWidth,
|
|
37294
|
+
availableHeight
|
|
37295
|
+
});
|
|
37296
|
+
const nextDimensions = await platform.getDimensions(elements.floating);
|
|
37297
|
+
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
37298
|
+
return {
|
|
37299
|
+
reset: {
|
|
37300
|
+
rects: true
|
|
37301
|
+
}
|
|
37302
|
+
};
|
|
37303
|
+
}
|
|
37304
|
+
return {};
|
|
37305
|
+
}
|
|
37306
|
+
};
|
|
37307
|
+
};
|
|
37308
|
+
|
|
37309
|
+
function getNodeName(node) {
|
|
37310
|
+
if (isNode(node)) {
|
|
37311
|
+
return (node.nodeName || '').toLowerCase();
|
|
37312
|
+
}
|
|
37313
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
|
37314
|
+
// returning `#document` an infinite loop won't occur.
|
|
37315
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
37316
|
+
return '#document';
|
|
37317
|
+
}
|
|
37318
|
+
function getWindow(node) {
|
|
37319
|
+
var _node$ownerDocument;
|
|
37320
|
+
return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
37321
|
+
}
|
|
37322
|
+
function getDocumentElement(node) {
|
|
37323
|
+
var _ref;
|
|
37324
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
37325
|
+
}
|
|
37326
|
+
function isNode(value) {
|
|
37327
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
37328
|
+
}
|
|
37329
|
+
function isElement(value) {
|
|
37330
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
37331
|
+
}
|
|
37332
|
+
function isHTMLElement(value) {
|
|
37333
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
37334
|
+
}
|
|
37335
|
+
function isShadowRoot(value) {
|
|
37336
|
+
// Browsers without `ShadowRoot` support.
|
|
37337
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
37338
|
+
return false;
|
|
37339
|
+
}
|
|
37340
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
37341
|
+
}
|
|
37342
|
+
function isOverflowElement(element) {
|
|
37343
|
+
const {
|
|
37344
|
+
overflow,
|
|
37345
|
+
overflowX,
|
|
37346
|
+
overflowY,
|
|
37347
|
+
display
|
|
37348
|
+
} = getComputedStyle$1(element);
|
|
37349
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
37350
|
+
}
|
|
37351
|
+
function isTableElement(element) {
|
|
37352
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
37353
|
+
}
|
|
37354
|
+
function isContainingBlock(element) {
|
|
37355
|
+
const webkit = isWebKit();
|
|
37356
|
+
const css = getComputedStyle$1(element);
|
|
37357
|
+
|
|
37358
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
37359
|
+
return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
37360
|
+
}
|
|
37361
|
+
function getContainingBlock(element) {
|
|
37362
|
+
let currentNode = getParentNode(element);
|
|
37363
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
37364
|
+
if (isContainingBlock(currentNode)) {
|
|
37365
|
+
return currentNode;
|
|
37366
|
+
} else {
|
|
37367
|
+
currentNode = getParentNode(currentNode);
|
|
37368
|
+
}
|
|
37369
|
+
}
|
|
37370
|
+
return null;
|
|
37371
|
+
}
|
|
37372
|
+
function isWebKit() {
|
|
37373
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
37374
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
37375
|
+
}
|
|
37376
|
+
function isLastTraversableNode(node) {
|
|
37377
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
37378
|
+
}
|
|
37379
|
+
function getComputedStyle$1(element) {
|
|
37380
|
+
return getWindow(element).getComputedStyle(element);
|
|
37381
|
+
}
|
|
37382
|
+
function getNodeScroll(element) {
|
|
37383
|
+
if (isElement(element)) {
|
|
37384
|
+
return {
|
|
37385
|
+
scrollLeft: element.scrollLeft,
|
|
37386
|
+
scrollTop: element.scrollTop
|
|
37387
|
+
};
|
|
37388
|
+
}
|
|
37389
|
+
return {
|
|
37390
|
+
scrollLeft: element.pageXOffset,
|
|
37391
|
+
scrollTop: element.pageYOffset
|
|
37392
|
+
};
|
|
37393
|
+
}
|
|
37394
|
+
function getParentNode(node) {
|
|
37395
|
+
if (getNodeName(node) === 'html') {
|
|
37396
|
+
return node;
|
|
37397
|
+
}
|
|
37398
|
+
const result =
|
|
37399
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
37400
|
+
node.assignedSlot ||
|
|
37401
|
+
// DOM Element detected.
|
|
37402
|
+
node.parentNode ||
|
|
37403
|
+
// ShadowRoot detected.
|
|
37404
|
+
isShadowRoot(node) && node.host ||
|
|
37405
|
+
// Fallback.
|
|
37406
|
+
getDocumentElement(node);
|
|
37407
|
+
return isShadowRoot(result) ? result.host : result;
|
|
37408
|
+
}
|
|
37409
|
+
function getNearestOverflowAncestor(node) {
|
|
37410
|
+
const parentNode = getParentNode(node);
|
|
37411
|
+
if (isLastTraversableNode(parentNode)) {
|
|
37412
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
37413
|
+
}
|
|
37414
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
37415
|
+
return parentNode;
|
|
37416
|
+
}
|
|
37417
|
+
return getNearestOverflowAncestor(parentNode);
|
|
37418
|
+
}
|
|
37419
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
37420
|
+
var _node$ownerDocument2;
|
|
37421
|
+
if (list === void 0) {
|
|
37422
|
+
list = [];
|
|
37423
|
+
}
|
|
37424
|
+
if (traverseIframes === void 0) {
|
|
37425
|
+
traverseIframes = true;
|
|
37426
|
+
}
|
|
37427
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
37428
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
37429
|
+
const win = getWindow(scrollableAncestor);
|
|
37430
|
+
if (isBody) {
|
|
37431
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
37432
|
+
}
|
|
37433
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
37434
|
+
}
|
|
37435
|
+
|
|
37436
|
+
function getCssDimensions(element) {
|
|
37437
|
+
const css = getComputedStyle$1(element);
|
|
37438
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
37439
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
37440
|
+
let width = parseFloat(css.width) || 0;
|
|
37441
|
+
let height = parseFloat(css.height) || 0;
|
|
37442
|
+
const hasOffset = isHTMLElement(element);
|
|
37443
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
37444
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
37445
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
37446
|
+
if (shouldFallback) {
|
|
37447
|
+
width = offsetWidth;
|
|
37448
|
+
height = offsetHeight;
|
|
37449
|
+
}
|
|
37450
|
+
return {
|
|
37451
|
+
width,
|
|
37452
|
+
height,
|
|
37453
|
+
$: shouldFallback
|
|
37454
|
+
};
|
|
37455
|
+
}
|
|
37456
|
+
|
|
37457
|
+
function unwrapElement(element) {
|
|
37458
|
+
return !isElement(element) ? element.contextElement : element;
|
|
37459
|
+
}
|
|
37460
|
+
|
|
37461
|
+
function getScale(element) {
|
|
37462
|
+
const domElement = unwrapElement(element);
|
|
37463
|
+
if (!isHTMLElement(domElement)) {
|
|
37464
|
+
return createCoords(1);
|
|
37465
|
+
}
|
|
37466
|
+
const rect = domElement.getBoundingClientRect();
|
|
37467
|
+
const {
|
|
37468
|
+
width,
|
|
37469
|
+
height,
|
|
37470
|
+
$
|
|
37471
|
+
} = getCssDimensions(domElement);
|
|
37472
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
37473
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
37474
|
+
|
|
37475
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
37476
|
+
|
|
37477
|
+
if (!x || !Number.isFinite(x)) {
|
|
37478
|
+
x = 1;
|
|
37479
|
+
}
|
|
37480
|
+
if (!y || !Number.isFinite(y)) {
|
|
37481
|
+
y = 1;
|
|
37482
|
+
}
|
|
37483
|
+
return {
|
|
37484
|
+
x,
|
|
37485
|
+
y
|
|
37486
|
+
};
|
|
37487
|
+
}
|
|
37488
|
+
|
|
37489
|
+
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
37490
|
+
function getVisualOffsets(element) {
|
|
37491
|
+
const win = getWindow(element);
|
|
37492
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
37493
|
+
return noOffsets;
|
|
37494
|
+
}
|
|
37495
|
+
return {
|
|
37496
|
+
x: win.visualViewport.offsetLeft,
|
|
37497
|
+
y: win.visualViewport.offsetTop
|
|
37498
|
+
};
|
|
37499
|
+
}
|
|
37500
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
37501
|
+
if (isFixed === void 0) {
|
|
37502
|
+
isFixed = false;
|
|
37503
|
+
}
|
|
37504
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
37505
|
+
return false;
|
|
37506
|
+
}
|
|
37507
|
+
return isFixed;
|
|
37508
|
+
}
|
|
37509
|
+
|
|
37510
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
37511
|
+
if (includeScale === void 0) {
|
|
37512
|
+
includeScale = false;
|
|
37513
|
+
}
|
|
37514
|
+
if (isFixedStrategy === void 0) {
|
|
37515
|
+
isFixedStrategy = false;
|
|
37516
|
+
}
|
|
37517
|
+
const clientRect = element.getBoundingClientRect();
|
|
37518
|
+
const domElement = unwrapElement(element);
|
|
37519
|
+
let scale = createCoords(1);
|
|
37520
|
+
if (includeScale) {
|
|
37521
|
+
if (offsetParent) {
|
|
37522
|
+
if (isElement(offsetParent)) {
|
|
37523
|
+
scale = getScale(offsetParent);
|
|
37524
|
+
}
|
|
37525
|
+
} else {
|
|
37526
|
+
scale = getScale(element);
|
|
37527
|
+
}
|
|
37528
|
+
}
|
|
37529
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
37530
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
37531
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
37532
|
+
let width = clientRect.width / scale.x;
|
|
37533
|
+
let height = clientRect.height / scale.y;
|
|
37534
|
+
if (domElement) {
|
|
37535
|
+
const win = getWindow(domElement);
|
|
37536
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
37537
|
+
let currentIFrame = win.frameElement;
|
|
37538
|
+
while (currentIFrame && offsetParent && offsetWin !== win) {
|
|
37539
|
+
const iframeScale = getScale(currentIFrame);
|
|
37540
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
37541
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
37542
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
37543
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
37544
|
+
x *= iframeScale.x;
|
|
37545
|
+
y *= iframeScale.y;
|
|
37546
|
+
width *= iframeScale.x;
|
|
37547
|
+
height *= iframeScale.y;
|
|
37548
|
+
x += left;
|
|
37549
|
+
y += top;
|
|
37550
|
+
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
37551
|
+
}
|
|
37552
|
+
}
|
|
37553
|
+
return rectToClientRect({
|
|
37554
|
+
width,
|
|
37555
|
+
height,
|
|
37556
|
+
x,
|
|
37557
|
+
y
|
|
37558
|
+
});
|
|
37559
|
+
}
|
|
37560
|
+
|
|
37561
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
37562
|
+
let {
|
|
37563
|
+
rect,
|
|
37564
|
+
offsetParent,
|
|
37565
|
+
strategy
|
|
37566
|
+
} = _ref;
|
|
37567
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
37568
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
37569
|
+
if (offsetParent === documentElement) {
|
|
37570
|
+
return rect;
|
|
37571
|
+
}
|
|
37572
|
+
let scroll = {
|
|
37573
|
+
scrollLeft: 0,
|
|
37574
|
+
scrollTop: 0
|
|
37575
|
+
};
|
|
37576
|
+
let scale = createCoords(1);
|
|
37577
|
+
const offsets = createCoords(0);
|
|
37578
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
37579
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
37580
|
+
scroll = getNodeScroll(offsetParent);
|
|
37581
|
+
}
|
|
37582
|
+
if (isHTMLElement(offsetParent)) {
|
|
37583
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
37584
|
+
scale = getScale(offsetParent);
|
|
37585
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
37586
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
37587
|
+
}
|
|
37588
|
+
}
|
|
37589
|
+
return {
|
|
37590
|
+
width: rect.width * scale.x,
|
|
37591
|
+
height: rect.height * scale.y,
|
|
37592
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
37593
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
37594
|
+
};
|
|
37595
|
+
}
|
|
37596
|
+
|
|
37597
|
+
function getClientRects(element) {
|
|
37598
|
+
return Array.from(element.getClientRects());
|
|
37599
|
+
}
|
|
37600
|
+
|
|
37601
|
+
function getWindowScrollBarX(element) {
|
|
37602
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
37603
|
+
// incorrect for RTL.
|
|
37604
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
37605
|
+
}
|
|
37606
|
+
|
|
37607
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
37608
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
37609
|
+
function getDocumentRect(element) {
|
|
37610
|
+
const html = getDocumentElement(element);
|
|
37611
|
+
const scroll = getNodeScroll(element);
|
|
37612
|
+
const body = element.ownerDocument.body;
|
|
37613
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
37614
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
37615
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
37616
|
+
const y = -scroll.scrollTop;
|
|
37617
|
+
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
37618
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
37619
|
+
}
|
|
37620
|
+
return {
|
|
37621
|
+
width,
|
|
37622
|
+
height,
|
|
37623
|
+
x,
|
|
37624
|
+
y
|
|
37625
|
+
};
|
|
37626
|
+
}
|
|
37627
|
+
|
|
37628
|
+
function getViewportRect(element, strategy) {
|
|
37629
|
+
const win = getWindow(element);
|
|
37630
|
+
const html = getDocumentElement(element);
|
|
37631
|
+
const visualViewport = win.visualViewport;
|
|
37632
|
+
let width = html.clientWidth;
|
|
37633
|
+
let height = html.clientHeight;
|
|
37634
|
+
let x = 0;
|
|
37635
|
+
let y = 0;
|
|
37636
|
+
if (visualViewport) {
|
|
37637
|
+
width = visualViewport.width;
|
|
37638
|
+
height = visualViewport.height;
|
|
37639
|
+
const visualViewportBased = isWebKit();
|
|
37640
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
37641
|
+
x = visualViewport.offsetLeft;
|
|
37642
|
+
y = visualViewport.offsetTop;
|
|
37643
|
+
}
|
|
37644
|
+
}
|
|
37645
|
+
return {
|
|
37646
|
+
width,
|
|
37647
|
+
height,
|
|
37648
|
+
x,
|
|
37649
|
+
y
|
|
37650
|
+
};
|
|
37651
|
+
}
|
|
37652
|
+
|
|
37653
|
+
// Returns the inner client rect, subtracting scrollbars if present.
|
|
37654
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
37655
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
37656
|
+
const top = clientRect.top + element.clientTop;
|
|
37657
|
+
const left = clientRect.left + element.clientLeft;
|
|
37658
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
37659
|
+
const width = element.clientWidth * scale.x;
|
|
37660
|
+
const height = element.clientHeight * scale.y;
|
|
37661
|
+
const x = left * scale.x;
|
|
37662
|
+
const y = top * scale.y;
|
|
37663
|
+
return {
|
|
37664
|
+
width,
|
|
37665
|
+
height,
|
|
37666
|
+
x,
|
|
37667
|
+
y
|
|
37668
|
+
};
|
|
37669
|
+
}
|
|
37670
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
37671
|
+
let rect;
|
|
37672
|
+
if (clippingAncestor === 'viewport') {
|
|
37673
|
+
rect = getViewportRect(element, strategy);
|
|
37674
|
+
} else if (clippingAncestor === 'document') {
|
|
37675
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
37676
|
+
} else if (isElement(clippingAncestor)) {
|
|
37677
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
37678
|
+
} else {
|
|
37679
|
+
const visualOffsets = getVisualOffsets(element);
|
|
37680
|
+
rect = {
|
|
37681
|
+
...clippingAncestor,
|
|
37682
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
37683
|
+
y: clippingAncestor.y - visualOffsets.y
|
|
37684
|
+
};
|
|
37685
|
+
}
|
|
37686
|
+
return rectToClientRect(rect);
|
|
37687
|
+
}
|
|
37688
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
37689
|
+
const parentNode = getParentNode(element);
|
|
37690
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
37691
|
+
return false;
|
|
37692
|
+
}
|
|
37693
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
37694
|
+
}
|
|
37695
|
+
|
|
37696
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
37697
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
37698
|
+
// of the given element up the tree.
|
|
37699
|
+
function getClippingElementAncestors(element, cache) {
|
|
37700
|
+
const cachedResult = cache.get(element);
|
|
37701
|
+
if (cachedResult) {
|
|
37702
|
+
return cachedResult;
|
|
37703
|
+
}
|
|
37704
|
+
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
37705
|
+
let currentContainingBlockComputedStyle = null;
|
|
37706
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
37707
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
37708
|
+
|
|
37709
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
37710
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
37711
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
37712
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
37713
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
37714
|
+
currentContainingBlockComputedStyle = null;
|
|
37715
|
+
}
|
|
37716
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
37717
|
+
if (shouldDropCurrentNode) {
|
|
37718
|
+
// Drop non-containing blocks.
|
|
37719
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
37720
|
+
} else {
|
|
37721
|
+
// Record last containing block for next iteration.
|
|
37722
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
37723
|
+
}
|
|
37724
|
+
currentNode = getParentNode(currentNode);
|
|
37725
|
+
}
|
|
37726
|
+
cache.set(element, result);
|
|
37727
|
+
return result;
|
|
37728
|
+
}
|
|
37729
|
+
|
|
37730
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
37731
|
+
// clipping ancestors.
|
|
37732
|
+
function getClippingRect(_ref) {
|
|
37733
|
+
let {
|
|
37734
|
+
element,
|
|
37735
|
+
boundary,
|
|
37736
|
+
rootBoundary,
|
|
37737
|
+
strategy
|
|
37738
|
+
} = _ref;
|
|
37739
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
37740
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
37741
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
37742
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
37743
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
37744
|
+
accRect.top = max(rect.top, accRect.top);
|
|
37745
|
+
accRect.right = min(rect.right, accRect.right);
|
|
37746
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
37747
|
+
accRect.left = max(rect.left, accRect.left);
|
|
37748
|
+
return accRect;
|
|
37749
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
37750
|
+
return {
|
|
37751
|
+
width: clippingRect.right - clippingRect.left,
|
|
37752
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
37753
|
+
x: clippingRect.left,
|
|
37754
|
+
y: clippingRect.top
|
|
37755
|
+
};
|
|
37756
|
+
}
|
|
37757
|
+
|
|
37758
|
+
function getDimensions(element) {
|
|
37759
|
+
return getCssDimensions(element);
|
|
37760
|
+
}
|
|
37761
|
+
|
|
37762
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
37763
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
37764
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
37765
|
+
const isFixed = strategy === 'fixed';
|
|
37766
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
37767
|
+
let scroll = {
|
|
37768
|
+
scrollLeft: 0,
|
|
37769
|
+
scrollTop: 0
|
|
37770
|
+
};
|
|
37771
|
+
const offsets = createCoords(0);
|
|
37772
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
37773
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
37774
|
+
scroll = getNodeScroll(offsetParent);
|
|
37775
|
+
}
|
|
37776
|
+
if (isOffsetParentAnElement) {
|
|
37777
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
37778
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
37779
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
37780
|
+
} else if (documentElement) {
|
|
37781
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
37782
|
+
}
|
|
37783
|
+
}
|
|
37784
|
+
return {
|
|
37785
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
37786
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
37787
|
+
width: rect.width,
|
|
37788
|
+
height: rect.height
|
|
37789
|
+
};
|
|
37790
|
+
}
|
|
37791
|
+
|
|
37792
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
37793
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
37794
|
+
return null;
|
|
37795
|
+
}
|
|
37796
|
+
if (polyfill) {
|
|
37797
|
+
return polyfill(element);
|
|
37798
|
+
}
|
|
37799
|
+
return element.offsetParent;
|
|
37800
|
+
}
|
|
37801
|
+
|
|
37802
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
37803
|
+
// such as table ancestors and cross browser bugs.
|
|
37804
|
+
function getOffsetParent(element, polyfill) {
|
|
37805
|
+
const window = getWindow(element);
|
|
37806
|
+
if (!isHTMLElement(element)) {
|
|
37807
|
+
return window;
|
|
37808
|
+
}
|
|
37809
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
37810
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
|
37811
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
37812
|
+
}
|
|
37813
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
37814
|
+
return window;
|
|
37815
|
+
}
|
|
37816
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
37817
|
+
}
|
|
37818
|
+
|
|
37819
|
+
const getElementRects = async function (_ref) {
|
|
37820
|
+
let {
|
|
37821
|
+
reference,
|
|
37822
|
+
floating,
|
|
37823
|
+
strategy
|
|
37824
|
+
} = _ref;
|
|
37825
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
37826
|
+
const getDimensionsFn = this.getDimensions;
|
|
37827
|
+
return {
|
|
37828
|
+
reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
|
|
37829
|
+
floating: {
|
|
37830
|
+
x: 0,
|
|
37831
|
+
y: 0,
|
|
37832
|
+
...(await getDimensionsFn(floating))
|
|
37833
|
+
}
|
|
37834
|
+
};
|
|
37835
|
+
};
|
|
37836
|
+
|
|
37837
|
+
function isRTL(element) {
|
|
37838
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
37839
|
+
}
|
|
37840
|
+
|
|
37841
|
+
const platform = {
|
|
37842
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
37843
|
+
getDocumentElement,
|
|
37844
|
+
getClippingRect,
|
|
37845
|
+
getOffsetParent,
|
|
37846
|
+
getElementRects,
|
|
37847
|
+
getClientRects,
|
|
37848
|
+
getDimensions,
|
|
37849
|
+
getScale,
|
|
37850
|
+
isElement,
|
|
37851
|
+
isRTL
|
|
37852
|
+
};
|
|
37853
|
+
|
|
37854
|
+
// https://samthor.au/2021/observing-dom/
|
|
37855
|
+
function observeMove(element, onMove) {
|
|
37856
|
+
let io = null;
|
|
37857
|
+
let timeoutId;
|
|
37858
|
+
const root = getDocumentElement(element);
|
|
37859
|
+
function cleanup() {
|
|
37860
|
+
clearTimeout(timeoutId);
|
|
37861
|
+
io && io.disconnect();
|
|
37862
|
+
io = null;
|
|
37863
|
+
}
|
|
37864
|
+
function refresh(skip, threshold) {
|
|
37865
|
+
if (skip === void 0) {
|
|
37866
|
+
skip = false;
|
|
37867
|
+
}
|
|
37868
|
+
if (threshold === void 0) {
|
|
37869
|
+
threshold = 1;
|
|
37870
|
+
}
|
|
37871
|
+
cleanup();
|
|
37872
|
+
const {
|
|
37873
|
+
left,
|
|
37874
|
+
top,
|
|
37875
|
+
width,
|
|
37876
|
+
height
|
|
37877
|
+
} = element.getBoundingClientRect();
|
|
37878
|
+
if (!skip) {
|
|
37879
|
+
onMove();
|
|
37880
|
+
}
|
|
37881
|
+
if (!width || !height) {
|
|
37882
|
+
return;
|
|
37883
|
+
}
|
|
37884
|
+
const insetTop = floor(top);
|
|
37885
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
37886
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
37887
|
+
const insetLeft = floor(left);
|
|
37888
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
37889
|
+
const options = {
|
|
37890
|
+
rootMargin,
|
|
37891
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
37892
|
+
};
|
|
37893
|
+
let isFirstUpdate = true;
|
|
37894
|
+
function handleObserve(entries) {
|
|
37895
|
+
const ratio = entries[0].intersectionRatio;
|
|
37896
|
+
if (ratio !== threshold) {
|
|
37897
|
+
if (!isFirstUpdate) {
|
|
37898
|
+
return refresh();
|
|
37899
|
+
}
|
|
37900
|
+
if (!ratio) {
|
|
37901
|
+
timeoutId = setTimeout(() => {
|
|
37902
|
+
refresh(false, 1e-7);
|
|
37903
|
+
}, 100);
|
|
37904
|
+
} else {
|
|
37905
|
+
refresh(false, ratio);
|
|
37906
|
+
}
|
|
37907
|
+
}
|
|
37908
|
+
isFirstUpdate = false;
|
|
37909
|
+
}
|
|
37910
|
+
|
|
37911
|
+
// Older browsers don't support a `document` as the root and will throw an
|
|
37912
|
+
// error.
|
|
37913
|
+
try {
|
|
37914
|
+
io = new IntersectionObserver(handleObserve, {
|
|
37915
|
+
...options,
|
|
37916
|
+
// Handle <iframe>s
|
|
37917
|
+
root: root.ownerDocument
|
|
37918
|
+
});
|
|
37919
|
+
} catch (e) {
|
|
37920
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
37921
|
+
}
|
|
37922
|
+
io.observe(element);
|
|
37923
|
+
}
|
|
37924
|
+
refresh(true);
|
|
37925
|
+
return cleanup;
|
|
37926
|
+
}
|
|
37927
|
+
|
|
37928
|
+
/**
|
|
37929
|
+
* Automatically updates the position of the floating element when necessary.
|
|
37930
|
+
* Should only be called when the floating element is mounted on the DOM or
|
|
37931
|
+
* visible on the screen.
|
|
37932
|
+
* @returns cleanup function that should be invoked when the floating element is
|
|
37933
|
+
* removed from the DOM or hidden from the screen.
|
|
37934
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
37935
|
+
*/
|
|
37936
|
+
function autoUpdate(reference, floating, update, options) {
|
|
37937
|
+
if (options === void 0) {
|
|
37938
|
+
options = {};
|
|
37939
|
+
}
|
|
37940
|
+
const {
|
|
37941
|
+
ancestorScroll = true,
|
|
37942
|
+
ancestorResize = true,
|
|
37943
|
+
elementResize = typeof ResizeObserver === 'function',
|
|
37944
|
+
layoutShift = typeof IntersectionObserver === 'function',
|
|
37945
|
+
animationFrame = false
|
|
37946
|
+
} = options;
|
|
37947
|
+
const referenceEl = unwrapElement(reference);
|
|
37948
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
|
|
37949
|
+
ancestors.forEach(ancestor => {
|
|
37950
|
+
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
37951
|
+
passive: true
|
|
36659
37952
|
});
|
|
36660
|
-
|
|
36661
|
-
|
|
36662
|
-
|
|
36663
|
-
|
|
36664
|
-
|
|
36665
|
-
|
|
36666
|
-
|
|
36667
|
-
|
|
36668
|
-
|
|
37953
|
+
ancestorResize && ancestor.addEventListener('resize', update);
|
|
37954
|
+
});
|
|
37955
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
37956
|
+
let reobserveFrame = -1;
|
|
37957
|
+
let resizeObserver = null;
|
|
37958
|
+
if (elementResize) {
|
|
37959
|
+
resizeObserver = new ResizeObserver(_ref => {
|
|
37960
|
+
let [firstEntry] = _ref;
|
|
37961
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
37962
|
+
// Prevent update loops when using the `size` middleware.
|
|
37963
|
+
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
37964
|
+
resizeObserver.unobserve(floating);
|
|
37965
|
+
cancelAnimationFrame(reobserveFrame);
|
|
37966
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
37967
|
+
resizeObserver && resizeObserver.observe(floating);
|
|
37968
|
+
});
|
|
37969
|
+
}
|
|
37970
|
+
update();
|
|
37971
|
+
});
|
|
37972
|
+
if (referenceEl && !animationFrame) {
|
|
37973
|
+
resizeObserver.observe(referenceEl);
|
|
37974
|
+
}
|
|
37975
|
+
resizeObserver.observe(floating);
|
|
37976
|
+
}
|
|
37977
|
+
let frameId;
|
|
37978
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
37979
|
+
if (animationFrame) {
|
|
37980
|
+
frameLoop();
|
|
37981
|
+
}
|
|
37982
|
+
function frameLoop() {
|
|
37983
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
37984
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
37985
|
+
update();
|
|
37986
|
+
}
|
|
37987
|
+
prevRefRect = nextRefRect;
|
|
37988
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
37989
|
+
}
|
|
37990
|
+
update();
|
|
37991
|
+
return () => {
|
|
37992
|
+
ancestors.forEach(ancestor => {
|
|
37993
|
+
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
37994
|
+
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
37995
|
+
});
|
|
37996
|
+
cleanupIo && cleanupIo();
|
|
37997
|
+
resizeObserver && resizeObserver.disconnect();
|
|
37998
|
+
resizeObserver = null;
|
|
37999
|
+
if (animationFrame) {
|
|
38000
|
+
cancelAnimationFrame(frameId);
|
|
38001
|
+
}
|
|
38002
|
+
};
|
|
38003
|
+
}
|
|
38004
|
+
|
|
38005
|
+
/**
|
|
38006
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
38007
|
+
* next to a reference element when it is given a certain CSS positioning
|
|
38008
|
+
* strategy.
|
|
38009
|
+
*/
|
|
38010
|
+
const computePosition = (reference, floating, options) => {
|
|
38011
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
38012
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
38013
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
38014
|
+
const cache = new Map();
|
|
38015
|
+
const mergedOptions = {
|
|
38016
|
+
platform,
|
|
38017
|
+
...options
|
|
38018
|
+
};
|
|
38019
|
+
const platformWithCache = {
|
|
38020
|
+
...mergedOptions.platform,
|
|
38021
|
+
_c: cache
|
|
38022
|
+
};
|
|
38023
|
+
return computePosition$1(reference, floating, {
|
|
38024
|
+
...mergedOptions,
|
|
38025
|
+
platform: platformWithCache
|
|
38026
|
+
});
|
|
38027
|
+
};
|
|
38028
|
+
|
|
38029
|
+
/**
|
|
38030
|
+
* Provides data to position an inner element of the floating element so that it
|
|
38031
|
+
* appears centered to the reference element.
|
|
38032
|
+
* This wraps the core `arrow` middleware to allow React refs as the element.
|
|
38033
|
+
* @see https://floating-ui.com/docs/arrow
|
|
38034
|
+
*/
|
|
38035
|
+
const arrow = options => {
|
|
38036
|
+
function isRef(value) {
|
|
38037
|
+
return {}.hasOwnProperty.call(value, 'current');
|
|
38038
|
+
}
|
|
38039
|
+
return {
|
|
38040
|
+
name: 'arrow',
|
|
38041
|
+
options,
|
|
38042
|
+
fn(state) {
|
|
38043
|
+
const {
|
|
38044
|
+
element,
|
|
38045
|
+
padding
|
|
38046
|
+
} = typeof options === 'function' ? options(state) : options;
|
|
38047
|
+
if (element && isRef(element)) {
|
|
38048
|
+
if (element.current != null) {
|
|
38049
|
+
return arrow$1({
|
|
38050
|
+
element: element.current,
|
|
38051
|
+
padding
|
|
38052
|
+
}).fn(state);
|
|
38053
|
+
}
|
|
38054
|
+
return {};
|
|
38055
|
+
} else if (element) {
|
|
38056
|
+
return arrow$1({
|
|
38057
|
+
element,
|
|
38058
|
+
padding
|
|
38059
|
+
}).fn(state);
|
|
38060
|
+
}
|
|
38061
|
+
return {};
|
|
38062
|
+
}
|
|
38063
|
+
};
|
|
38064
|
+
};
|
|
38065
|
+
|
|
38066
|
+
var index = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
38067
|
+
|
|
38068
|
+
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
|
38069
|
+
// functions
|
|
38070
|
+
function deepEqual(a, b) {
|
|
38071
|
+
if (a === b) {
|
|
38072
|
+
return true;
|
|
38073
|
+
}
|
|
38074
|
+
if (typeof a !== typeof b) {
|
|
38075
|
+
return false;
|
|
38076
|
+
}
|
|
38077
|
+
if (typeof a === 'function' && a.toString() === b.toString()) {
|
|
38078
|
+
return true;
|
|
38079
|
+
}
|
|
38080
|
+
let length, i, keys;
|
|
38081
|
+
if (a && b && typeof a == 'object') {
|
|
38082
|
+
if (Array.isArray(a)) {
|
|
38083
|
+
length = a.length;
|
|
38084
|
+
if (length != b.length) return false;
|
|
38085
|
+
for (i = length; i-- !== 0;) {
|
|
38086
|
+
if (!deepEqual(a[i], b[i])) {
|
|
38087
|
+
return false;
|
|
38088
|
+
}
|
|
38089
|
+
}
|
|
38090
|
+
return true;
|
|
38091
|
+
}
|
|
38092
|
+
keys = Object.keys(a);
|
|
38093
|
+
length = keys.length;
|
|
38094
|
+
if (length !== Object.keys(b).length) {
|
|
38095
|
+
return false;
|
|
38096
|
+
}
|
|
38097
|
+
for (i = length; i-- !== 0;) {
|
|
38098
|
+
if (!{}.hasOwnProperty.call(b, keys[i])) {
|
|
38099
|
+
return false;
|
|
38100
|
+
}
|
|
38101
|
+
}
|
|
38102
|
+
for (i = length; i-- !== 0;) {
|
|
38103
|
+
const key = keys[i];
|
|
38104
|
+
if (key === '_owner' && a.$$typeof) {
|
|
38105
|
+
continue;
|
|
38106
|
+
}
|
|
38107
|
+
if (!deepEqual(a[key], b[key])) {
|
|
38108
|
+
return false;
|
|
38109
|
+
}
|
|
38110
|
+
}
|
|
38111
|
+
return true;
|
|
38112
|
+
}
|
|
38113
|
+
return a !== a && b !== b;
|
|
38114
|
+
}
|
|
38115
|
+
|
|
38116
|
+
function getDPR(element) {
|
|
38117
|
+
if (typeof window === 'undefined') {
|
|
38118
|
+
return 1;
|
|
38119
|
+
}
|
|
38120
|
+
const win = element.ownerDocument.defaultView || window;
|
|
38121
|
+
return win.devicePixelRatio || 1;
|
|
38122
|
+
}
|
|
38123
|
+
|
|
38124
|
+
function roundByDPR(element, value) {
|
|
38125
|
+
const dpr = getDPR(element);
|
|
38126
|
+
return Math.round(value * dpr) / dpr;
|
|
38127
|
+
}
|
|
38128
|
+
|
|
38129
|
+
function useLatestRef(value) {
|
|
38130
|
+
const ref = React__namespace.useRef(value);
|
|
38131
|
+
index(() => {
|
|
38132
|
+
ref.current = value;
|
|
38133
|
+
});
|
|
38134
|
+
return ref;
|
|
38135
|
+
}
|
|
38136
|
+
|
|
38137
|
+
/**
|
|
38138
|
+
* Provides data to position a floating element.
|
|
38139
|
+
* @see https://floating-ui.com/docs/react
|
|
38140
|
+
*/
|
|
38141
|
+
function useFloating(options) {
|
|
38142
|
+
if (options === void 0) {
|
|
38143
|
+
options = {};
|
|
38144
|
+
}
|
|
38145
|
+
const {
|
|
38146
|
+
placement = 'bottom',
|
|
38147
|
+
strategy = 'absolute',
|
|
38148
|
+
middleware = [],
|
|
38149
|
+
platform,
|
|
38150
|
+
elements: {
|
|
38151
|
+
reference: externalReference,
|
|
38152
|
+
floating: externalFloating
|
|
38153
|
+
} = {},
|
|
38154
|
+
transform = true,
|
|
38155
|
+
whileElementsMounted,
|
|
38156
|
+
open
|
|
38157
|
+
} = options;
|
|
38158
|
+
const [data, setData] = React__namespace.useState({
|
|
38159
|
+
x: 0,
|
|
38160
|
+
y: 0,
|
|
38161
|
+
strategy,
|
|
38162
|
+
placement,
|
|
38163
|
+
middlewareData: {},
|
|
38164
|
+
isPositioned: false
|
|
38165
|
+
});
|
|
38166
|
+
const [latestMiddleware, setLatestMiddleware] = React__namespace.useState(middleware);
|
|
38167
|
+
if (!deepEqual(latestMiddleware, middleware)) {
|
|
38168
|
+
setLatestMiddleware(middleware);
|
|
38169
|
+
}
|
|
38170
|
+
const [_reference, _setReference] = React__namespace.useState(null);
|
|
38171
|
+
const [_floating, _setFloating] = React__namespace.useState(null);
|
|
38172
|
+
const setReference = React__namespace.useCallback(node => {
|
|
38173
|
+
if (node != referenceRef.current) {
|
|
38174
|
+
referenceRef.current = node;
|
|
38175
|
+
_setReference(node);
|
|
38176
|
+
}
|
|
38177
|
+
}, [_setReference]);
|
|
38178
|
+
const setFloating = React__namespace.useCallback(node => {
|
|
38179
|
+
if (node !== floatingRef.current) {
|
|
38180
|
+
floatingRef.current = node;
|
|
38181
|
+
_setFloating(node);
|
|
38182
|
+
}
|
|
38183
|
+
}, [_setFloating]);
|
|
38184
|
+
const referenceEl = externalReference || _reference;
|
|
38185
|
+
const floatingEl = externalFloating || _floating;
|
|
38186
|
+
const referenceRef = React__namespace.useRef(null);
|
|
38187
|
+
const floatingRef = React__namespace.useRef(null);
|
|
38188
|
+
const dataRef = React__namespace.useRef(data);
|
|
38189
|
+
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
38190
|
+
const platformRef = useLatestRef(platform);
|
|
38191
|
+
const update = React__namespace.useCallback(() => {
|
|
38192
|
+
if (!referenceRef.current || !floatingRef.current) {
|
|
38193
|
+
return;
|
|
38194
|
+
}
|
|
38195
|
+
const config = {
|
|
38196
|
+
placement,
|
|
38197
|
+
strategy,
|
|
38198
|
+
middleware: latestMiddleware
|
|
38199
|
+
};
|
|
38200
|
+
if (platformRef.current) {
|
|
38201
|
+
config.platform = platformRef.current;
|
|
38202
|
+
}
|
|
38203
|
+
computePosition(referenceRef.current, floatingRef.current, config).then(data => {
|
|
38204
|
+
const fullData = {
|
|
38205
|
+
...data,
|
|
38206
|
+
isPositioned: true
|
|
38207
|
+
};
|
|
38208
|
+
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
38209
|
+
dataRef.current = fullData;
|
|
38210
|
+
reactDom.exports.flushSync(() => {
|
|
38211
|
+
setData(fullData);
|
|
38212
|
+
});
|
|
38213
|
+
}
|
|
38214
|
+
});
|
|
38215
|
+
}, [latestMiddleware, placement, strategy, platformRef]);
|
|
38216
|
+
index(() => {
|
|
38217
|
+
if (open === false && dataRef.current.isPositioned) {
|
|
38218
|
+
dataRef.current.isPositioned = false;
|
|
38219
|
+
setData(data => ({
|
|
38220
|
+
...data,
|
|
38221
|
+
isPositioned: false
|
|
38222
|
+
}));
|
|
38223
|
+
}
|
|
38224
|
+
}, [open]);
|
|
38225
|
+
const isMountedRef = React__namespace.useRef(false);
|
|
38226
|
+
index(() => {
|
|
38227
|
+
isMountedRef.current = true;
|
|
38228
|
+
return () => {
|
|
38229
|
+
isMountedRef.current = false;
|
|
38230
|
+
};
|
|
38231
|
+
}, []);
|
|
38232
|
+
index(() => {
|
|
38233
|
+
if (referenceEl) referenceRef.current = referenceEl;
|
|
38234
|
+
if (floatingEl) floatingRef.current = floatingEl;
|
|
38235
|
+
if (referenceEl && floatingEl) {
|
|
38236
|
+
if (whileElementsMountedRef.current) {
|
|
38237
|
+
return whileElementsMountedRef.current(referenceEl, floatingEl, update);
|
|
38238
|
+
} else {
|
|
38239
|
+
update();
|
|
38240
|
+
}
|
|
38241
|
+
}
|
|
38242
|
+
}, [referenceEl, floatingEl, update, whileElementsMountedRef]);
|
|
38243
|
+
const refs = React__namespace.useMemo(() => ({
|
|
38244
|
+
reference: referenceRef,
|
|
38245
|
+
floating: floatingRef,
|
|
38246
|
+
setReference,
|
|
38247
|
+
setFloating
|
|
38248
|
+
}), [setReference, setFloating]);
|
|
38249
|
+
const elements = React__namespace.useMemo(() => ({
|
|
38250
|
+
reference: referenceEl,
|
|
38251
|
+
floating: floatingEl
|
|
38252
|
+
}), [referenceEl, floatingEl]);
|
|
38253
|
+
const floatingStyles = React__namespace.useMemo(() => {
|
|
38254
|
+
const initialStyles = {
|
|
38255
|
+
position: strategy,
|
|
38256
|
+
left: 0,
|
|
38257
|
+
top: 0
|
|
38258
|
+
};
|
|
38259
|
+
if (!elements.floating) {
|
|
38260
|
+
return initialStyles;
|
|
38261
|
+
}
|
|
38262
|
+
const x = roundByDPR(elements.floating, data.x);
|
|
38263
|
+
const y = roundByDPR(elements.floating, data.y);
|
|
38264
|
+
if (transform) {
|
|
38265
|
+
return {
|
|
38266
|
+
...initialStyles,
|
|
38267
|
+
transform: "translate(" + x + "px, " + y + "px)",
|
|
38268
|
+
...(getDPR(elements.floating) >= 1.5 && {
|
|
38269
|
+
willChange: 'transform'
|
|
38270
|
+
})
|
|
38271
|
+
};
|
|
38272
|
+
}
|
|
38273
|
+
return {
|
|
38274
|
+
position: strategy,
|
|
38275
|
+
left: x,
|
|
38276
|
+
top: y
|
|
38277
|
+
};
|
|
38278
|
+
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
38279
|
+
return React__namespace.useMemo(() => ({
|
|
38280
|
+
...data,
|
|
38281
|
+
update,
|
|
38282
|
+
refs,
|
|
38283
|
+
elements,
|
|
38284
|
+
floatingStyles
|
|
38285
|
+
}), [data, update, refs, elements, floatingStyles]);
|
|
38286
|
+
}
|
|
38287
|
+
|
|
38288
|
+
function $db6c3485150b8e66$export$1ab7ae714698c4b8$1(element) {
|
|
38289
|
+
const [size, setSize] = React.useState(undefined);
|
|
38290
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
38291
|
+
if (element) {
|
|
38292
|
+
// provide size as early as possible
|
|
38293
|
+
setSize({
|
|
38294
|
+
width: element.offsetWidth,
|
|
38295
|
+
height: element.offsetHeight
|
|
38296
|
+
});
|
|
38297
|
+
const resizeObserver = new ResizeObserver((entries)=>{
|
|
38298
|
+
if (!Array.isArray(entries)) return;
|
|
38299
|
+
// Since we only observe the one element, we don't need to loop over the
|
|
38300
|
+
// array
|
|
38301
|
+
if (!entries.length) return;
|
|
38302
|
+
const entry = entries[0];
|
|
38303
|
+
let width;
|
|
38304
|
+
let height;
|
|
38305
|
+
if ('borderBoxSize' in entry) {
|
|
38306
|
+
const borderSizeEntry = entry['borderBoxSize']; // iron out differences between browsers
|
|
38307
|
+
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
38308
|
+
width = borderSize['inlineSize'];
|
|
38309
|
+
height = borderSize['blockSize'];
|
|
38310
|
+
} else {
|
|
38311
|
+
// for browsers that don't support `borderBoxSize`
|
|
38312
|
+
// we calculate it ourselves to get the correct border box.
|
|
38313
|
+
width = element.offsetWidth;
|
|
38314
|
+
height = element.offsetHeight;
|
|
38315
|
+
}
|
|
38316
|
+
setSize({
|
|
38317
|
+
width: width,
|
|
38318
|
+
height: height
|
|
38319
|
+
});
|
|
38320
|
+
});
|
|
38321
|
+
resizeObserver.observe(element, {
|
|
38322
|
+
box: 'border-box'
|
|
38323
|
+
});
|
|
38324
|
+
return ()=>resizeObserver.unobserve(element)
|
|
38325
|
+
;
|
|
38326
|
+
} else // We only want to reset to `undefined` when the element becomes `null`,
|
|
38327
|
+
// not if it changes to another element.
|
|
38328
|
+
setSize(undefined);
|
|
36669
38329
|
}, [
|
|
36670
|
-
|
|
36671
|
-
prop,
|
|
36672
|
-
setUncontrolledProp,
|
|
36673
|
-
handleChange
|
|
38330
|
+
element
|
|
36674
38331
|
]);
|
|
36675
|
-
return
|
|
36676
|
-
value1,
|
|
36677
|
-
setValue
|
|
36678
|
-
];
|
|
38332
|
+
return size;
|
|
36679
38333
|
}
|
|
36680
|
-
|
|
36681
|
-
|
|
36682
|
-
|
|
36683
|
-
|
|
36684
|
-
|
|
38334
|
+
|
|
38335
|
+
/* -------------------------------------------------------------------------------------------------
|
|
38336
|
+
* Popper
|
|
38337
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME = 'Popper';
|
|
38338
|
+
const [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
38339
|
+
const [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
38340
|
+
const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props)=>{
|
|
38341
|
+
const { __scopePopper: __scopePopper , children: children } = props;
|
|
38342
|
+
const [anchor, setAnchor] = React.useState(null);
|
|
38343
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperProvider, {
|
|
38344
|
+
scope: __scopePopper,
|
|
38345
|
+
anchor: anchor,
|
|
38346
|
+
onAnchorChange: setAnchor
|
|
38347
|
+
}, children);
|
|
38348
|
+
};
|
|
38349
|
+
/* -------------------------------------------------------------------------------------------------
|
|
38350
|
+
* PopperAnchor
|
|
38351
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME = 'PopperAnchor';
|
|
38352
|
+
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
38353
|
+
const { __scopePopper: __scopePopper , virtualRef: virtualRef , ...anchorProps } = props;
|
|
38354
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
|
|
38355
|
+
const ref = React.useRef(null);
|
|
38356
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
36685
38357
|
React.useEffect(()=>{
|
|
36686
|
-
|
|
36687
|
-
|
|
36688
|
-
|
|
36689
|
-
|
|
38358
|
+
// Consumer can anchor the popper to something that isn't
|
|
38359
|
+
// a DOM node e.g. pointer position, so we override the
|
|
38360
|
+
// `anchorRef` with their virtual ref in this case.
|
|
38361
|
+
context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
|
|
38362
|
+
});
|
|
38363
|
+
return virtualRef ? null : /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, anchorProps, {
|
|
38364
|
+
ref: composedRefs
|
|
38365
|
+
}));
|
|
38366
|
+
});
|
|
38367
|
+
/* -------------------------------------------------------------------------------------------------
|
|
38368
|
+
* PopperContent
|
|
38369
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME = 'PopperContent';
|
|
38370
|
+
const [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
|
|
38371
|
+
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
38372
|
+
var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$trans, _middlewareData$trans2, _middlewareData$hide;
|
|
38373
|
+
const { __scopePopper: __scopePopper , side: side = 'bottom' , sideOffset: sideOffset = 0 , align: align = 'center' , alignOffset: alignOffset = 0 , arrowPadding: arrowPadding = 0 , avoidCollisions: avoidCollisions = true , collisionBoundary: collisionBoundary = [] , collisionPadding: collisionPaddingProp = 0 , sticky: sticky = 'partial' , hideWhenDetached: hideWhenDetached = false , updatePositionStrategy: updatePositionStrategy = 'optimized' , onPlaced: onPlaced , ...contentProps } = props;
|
|
38374
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
|
|
38375
|
+
const [content, setContent] = React.useState(null);
|
|
38376
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContent(node)
|
|
38377
|
+
);
|
|
38378
|
+
const [arrow$1, setArrow] = React.useState(null);
|
|
38379
|
+
const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8$1(arrow$1);
|
|
38380
|
+
const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
|
|
38381
|
+
const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
|
|
38382
|
+
const desiredPlacement = side + (align !== 'center' ? '-' + align : '');
|
|
38383
|
+
const collisionPadding = typeof collisionPaddingProp === 'number' ? collisionPaddingProp : {
|
|
38384
|
+
top: 0,
|
|
38385
|
+
right: 0,
|
|
38386
|
+
bottom: 0,
|
|
38387
|
+
left: 0,
|
|
38388
|
+
...collisionPaddingProp
|
|
38389
|
+
};
|
|
38390
|
+
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [
|
|
38391
|
+
collisionBoundary
|
|
38392
|
+
];
|
|
38393
|
+
const hasExplicitBoundaries = boundary.length > 0;
|
|
38394
|
+
const detectOverflowOptions = {
|
|
38395
|
+
padding: collisionPadding,
|
|
38396
|
+
boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull),
|
|
38397
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
38398
|
+
altBoundary: hasExplicitBoundaries
|
|
38399
|
+
};
|
|
38400
|
+
const { refs: refs , floatingStyles: floatingStyles , placement: placement , isPositioned: isPositioned , middlewareData: middlewareData } = useFloating({
|
|
38401
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
38402
|
+
strategy: 'fixed',
|
|
38403
|
+
placement: desiredPlacement,
|
|
38404
|
+
whileElementsMounted: (...args)=>{
|
|
38405
|
+
const cleanup = autoUpdate(...args, {
|
|
38406
|
+
animationFrame: updatePositionStrategy === 'always'
|
|
38407
|
+
});
|
|
38408
|
+
return cleanup;
|
|
38409
|
+
},
|
|
38410
|
+
elements: {
|
|
38411
|
+
reference: context.anchor
|
|
38412
|
+
},
|
|
38413
|
+
middleware: [
|
|
38414
|
+
offset({
|
|
38415
|
+
mainAxis: sideOffset + arrowHeight,
|
|
38416
|
+
alignmentAxis: alignOffset
|
|
38417
|
+
}),
|
|
38418
|
+
avoidCollisions && shift({
|
|
38419
|
+
mainAxis: true,
|
|
38420
|
+
crossAxis: false,
|
|
38421
|
+
limiter: sticky === 'partial' ? limitShift() : undefined,
|
|
38422
|
+
...detectOverflowOptions
|
|
38423
|
+
}),
|
|
38424
|
+
avoidCollisions && flip({
|
|
38425
|
+
...detectOverflowOptions
|
|
38426
|
+
}),
|
|
38427
|
+
size({
|
|
38428
|
+
...detectOverflowOptions,
|
|
38429
|
+
apply: ({ elements: elements , rects: rects , availableWidth: availableWidth , availableHeight: availableHeight })=>{
|
|
38430
|
+
const { width: anchorWidth , height: anchorHeight } = rects.reference;
|
|
38431
|
+
const contentStyle = elements.floating.style;
|
|
38432
|
+
contentStyle.setProperty('--radix-popper-available-width', `${availableWidth}px`);
|
|
38433
|
+
contentStyle.setProperty('--radix-popper-available-height', `${availableHeight}px`);
|
|
38434
|
+
contentStyle.setProperty('--radix-popper-anchor-width', `${anchorWidth}px`);
|
|
38435
|
+
contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);
|
|
38436
|
+
}
|
|
38437
|
+
}),
|
|
38438
|
+
arrow$1 && arrow({
|
|
38439
|
+
element: arrow$1,
|
|
38440
|
+
padding: arrowPadding
|
|
38441
|
+
}),
|
|
38442
|
+
$cf1ac5d9fe0e8206$var$transformOrigin({
|
|
38443
|
+
arrowWidth: arrowWidth,
|
|
38444
|
+
arrowHeight: arrowHeight
|
|
38445
|
+
}),
|
|
38446
|
+
hideWhenDetached && hide({
|
|
38447
|
+
strategy: 'referenceHidden',
|
|
38448
|
+
...detectOverflowOptions
|
|
38449
|
+
})
|
|
38450
|
+
]
|
|
38451
|
+
});
|
|
38452
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
38453
|
+
const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onPlaced);
|
|
38454
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
38455
|
+
if (isPositioned) handlePlaced === null || handlePlaced === void 0 || handlePlaced();
|
|
36690
38456
|
}, [
|
|
36691
|
-
|
|
36692
|
-
|
|
36693
|
-
handleChange
|
|
38457
|
+
isPositioned,
|
|
38458
|
+
handlePlaced
|
|
36694
38459
|
]);
|
|
36695
|
-
|
|
38460
|
+
const arrowX = (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x;
|
|
38461
|
+
const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y;
|
|
38462
|
+
const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0;
|
|
38463
|
+
const [contentZIndex, setContentZIndex] = React.useState();
|
|
38464
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
38465
|
+
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
38466
|
+
}, [
|
|
38467
|
+
content
|
|
38468
|
+
]);
|
|
38469
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
38470
|
+
ref: refs.setFloating,
|
|
38471
|
+
"data-radix-popper-content-wrapper": "",
|
|
38472
|
+
style: {
|
|
38473
|
+
...floatingStyles,
|
|
38474
|
+
transform: isPositioned ? floatingStyles.transform : 'translate(0, -200%)',
|
|
38475
|
+
// keep off the page when measuring
|
|
38476
|
+
minWidth: 'max-content',
|
|
38477
|
+
zIndex: contentZIndex,
|
|
38478
|
+
['--radix-popper-transform-origin']: [
|
|
38479
|
+
(_middlewareData$trans = middlewareData.transformOrigin) === null || _middlewareData$trans === void 0 ? void 0 : _middlewareData$trans.x,
|
|
38480
|
+
(_middlewareData$trans2 = middlewareData.transformOrigin) === null || _middlewareData$trans2 === void 0 ? void 0 : _middlewareData$trans2.y
|
|
38481
|
+
].join(' ')
|
|
38482
|
+
} // Floating UI interally calculates logical alignment based the `dir` attribute on
|
|
38483
|
+
,
|
|
38484
|
+
dir: props.dir
|
|
38485
|
+
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider, {
|
|
38486
|
+
scope: __scopePopper,
|
|
38487
|
+
placedSide: placedSide,
|
|
38488
|
+
onArrowChange: setArrow,
|
|
38489
|
+
arrowX: arrowX,
|
|
38490
|
+
arrowY: arrowY,
|
|
38491
|
+
shouldHideArrow: cannotCenterArrow
|
|
38492
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
38493
|
+
"data-side": placedSide,
|
|
38494
|
+
"data-align": placedAlign
|
|
38495
|
+
}, contentProps, {
|
|
38496
|
+
ref: composedRefs,
|
|
38497
|
+
style: {
|
|
38498
|
+
...contentProps.style,
|
|
38499
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
38500
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
38501
|
+
animation: !isPositioned ? 'none' : undefined,
|
|
38502
|
+
// hide the content if using the hide middleware and should be hidden
|
|
38503
|
+
opacity: (_middlewareData$hide = middlewareData.hide) !== null && _middlewareData$hide !== void 0 && _middlewareData$hide.referenceHidden ? 0 : undefined
|
|
38504
|
+
}
|
|
38505
|
+
}))));
|
|
38506
|
+
});
|
|
38507
|
+
/* -----------------------------------------------------------------------------------------------*/ function $cf1ac5d9fe0e8206$var$isNotNull(value) {
|
|
38508
|
+
return value !== null;
|
|
38509
|
+
}
|
|
38510
|
+
const $cf1ac5d9fe0e8206$var$transformOrigin = (options)=>({
|
|
38511
|
+
name: 'transformOrigin',
|
|
38512
|
+
options: options,
|
|
38513
|
+
fn (data) {
|
|
38514
|
+
var _middlewareData$arrow4, _middlewareData$arrow5, _middlewareData$arrow6, _middlewareData$arrow7, _middlewareData$arrow8;
|
|
38515
|
+
const { placement: placement , rects: rects , middlewareData: middlewareData } = data;
|
|
38516
|
+
const cannotCenterArrow = ((_middlewareData$arrow4 = middlewareData.arrow) === null || _middlewareData$arrow4 === void 0 ? void 0 : _middlewareData$arrow4.centerOffset) !== 0;
|
|
38517
|
+
const isArrowHidden = cannotCenterArrow;
|
|
38518
|
+
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
38519
|
+
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
38520
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
38521
|
+
const noArrowAlign = {
|
|
38522
|
+
start: '0%',
|
|
38523
|
+
center: '50%',
|
|
38524
|
+
end: '100%'
|
|
38525
|
+
}[placedAlign];
|
|
38526
|
+
const arrowXCenter = ((_middlewareData$arrow5 = (_middlewareData$arrow6 = middlewareData.arrow) === null || _middlewareData$arrow6 === void 0 ? void 0 : _middlewareData$arrow6.x) !== null && _middlewareData$arrow5 !== void 0 ? _middlewareData$arrow5 : 0) + arrowWidth / 2;
|
|
38527
|
+
const arrowYCenter = ((_middlewareData$arrow7 = (_middlewareData$arrow8 = middlewareData.arrow) === null || _middlewareData$arrow8 === void 0 ? void 0 : _middlewareData$arrow8.y) !== null && _middlewareData$arrow7 !== void 0 ? _middlewareData$arrow7 : 0) + arrowHeight / 2;
|
|
38528
|
+
let x = '';
|
|
38529
|
+
let y = '';
|
|
38530
|
+
if (placedSide === 'bottom') {
|
|
38531
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
38532
|
+
y = `${-arrowHeight}px`;
|
|
38533
|
+
} else if (placedSide === 'top') {
|
|
38534
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
38535
|
+
y = `${rects.floating.height + arrowHeight}px`;
|
|
38536
|
+
} else if (placedSide === 'right') {
|
|
38537
|
+
x = `${-arrowHeight}px`;
|
|
38538
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
38539
|
+
} else if (placedSide === 'left') {
|
|
38540
|
+
x = `${rects.floating.width + arrowHeight}px`;
|
|
38541
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
38542
|
+
}
|
|
38543
|
+
return {
|
|
38544
|
+
data: {
|
|
38545
|
+
x: x,
|
|
38546
|
+
y: y
|
|
38547
|
+
}
|
|
38548
|
+
};
|
|
38549
|
+
}
|
|
38550
|
+
})
|
|
38551
|
+
;
|
|
38552
|
+
function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement) {
|
|
38553
|
+
const [side, align = 'center'] = placement.split('-');
|
|
38554
|
+
return [
|
|
38555
|
+
side,
|
|
38556
|
+
align
|
|
38557
|
+
];
|
|
36696
38558
|
}
|
|
38559
|
+
const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9;
|
|
38560
|
+
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
38561
|
+
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
36697
38562
|
|
|
36698
|
-
|
|
38563
|
+
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
38564
|
+
var _globalThis$document;
|
|
38565
|
+
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;
|
|
38566
|
+
return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, portalProps, {
|
|
38567
|
+
ref: forwardedRef
|
|
38568
|
+
})), container) : null;
|
|
38569
|
+
});
|
|
38570
|
+
|
|
38571
|
+
function $010c2913dbd2fe3d$export$5cae361ad82dce8b$1(value) {
|
|
36699
38572
|
const ref = React.useRef({
|
|
36700
38573
|
value: value,
|
|
36701
38574
|
previous: value
|
|
@@ -36713,8 +38586,8 @@ function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
|
|
|
36713
38586
|
]);
|
|
36714
38587
|
}
|
|
36715
38588
|
|
|
36716
|
-
const $ea1ef594cf570d83$export$439d29a4e110a164
|
|
36717
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
|
|
38589
|
+
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
38590
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({}, props, {
|
|
36718
38591
|
ref: forwardedRef,
|
|
36719
38592
|
style: {
|
|
36720
38593
|
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
@@ -36746,24 +38619,27 @@ const $cc7e05a45900e73f$var$SELECTION_KEYS = [
|
|
|
36746
38619
|
/* -------------------------------------------------------------------------------------------------
|
|
36747
38620
|
* Select
|
|
36748
38621
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SELECT_NAME = 'Select';
|
|
36749
|
-
const [$cc7e05a45900e73f$var$Collection, $cc7e05a45900e73f$var$useCollection, $cc7e05a45900e73f$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2
|
|
36750
|
-
const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cc7e05a45900e73f$var$SELECT_NAME, [
|
|
36751
|
-
$cc7e05a45900e73f$var$createCollectionScope
|
|
38622
|
+
const [$cc7e05a45900e73f$var$Collection, $cc7e05a45900e73f$var$useCollection, $cc7e05a45900e73f$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($cc7e05a45900e73f$var$SELECT_NAME);
|
|
38623
|
+
const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($cc7e05a45900e73f$var$SELECT_NAME, [
|
|
38624
|
+
$cc7e05a45900e73f$var$createCollectionScope,
|
|
38625
|
+
$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
36752
38626
|
]);
|
|
38627
|
+
const $cc7e05a45900e73f$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
|
|
36753
38628
|
const [$cc7e05a45900e73f$var$SelectProvider, $cc7e05a45900e73f$var$useSelectContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
|
|
36754
38629
|
const [$cc7e05a45900e73f$var$SelectNativeOptionsProvider, $cc7e05a45900e73f$var$useSelectNativeOptionsContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
|
|
36755
38630
|
const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
36756
38631
|
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;
|
|
38632
|
+
const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
|
|
36757
38633
|
const [trigger, setTrigger] = React.useState(null);
|
|
36758
38634
|
const [valueNode, setValueNode] = React.useState(null);
|
|
36759
38635
|
const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);
|
|
36760
|
-
const direction = $f631663db3294ace$export$b39126d51d94e6f3
|
|
36761
|
-
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
38636
|
+
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
38637
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
|
36762
38638
|
prop: openProp,
|
|
36763
38639
|
defaultProp: defaultOpen,
|
|
36764
38640
|
onChange: onOpenChange
|
|
36765
38641
|
});
|
|
36766
|
-
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
38642
|
+
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
|
36767
38643
|
prop: valueProp,
|
|
36768
38644
|
defaultProp: defaultValue,
|
|
36769
38645
|
onChange: onValueChange
|
|
@@ -36777,7 +38653,7 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
36777
38653
|
// each time the options change.
|
|
36778
38654
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option)=>option.props.value
|
|
36779
38655
|
).join(';');
|
|
36780
|
-
return /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectProvider, {
|
|
38656
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectProvider, {
|
|
36781
38657
|
required: required,
|
|
36782
38658
|
scope: __scopeSelect,
|
|
36783
38659
|
trigger: trigger,
|
|
@@ -36823,16 +38699,17 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
36823
38699
|
disabled: disabled
|
|
36824
38700
|
}, value === undefined ? /*#__PURE__*/ React.createElement("option", {
|
|
36825
38701
|
value: ""
|
|
36826
|
-
}) : null, Array.from(nativeOptionsSet)) : null);
|
|
38702
|
+
}) : null, Array.from(nativeOptionsSet)) : null));
|
|
36827
38703
|
};
|
|
36828
38704
|
/* -------------------------------------------------------------------------------------------------
|
|
36829
38705
|
* SelectTrigger
|
|
36830
38706
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$TRIGGER_NAME = 'SelectTrigger';
|
|
36831
38707
|
const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
36832
38708
|
const { __scopeSelect: __scopeSelect , disabled: disabled = false , ...triggerProps } = props;
|
|
38709
|
+
const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
|
|
36833
38710
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$TRIGGER_NAME, __scopeSelect);
|
|
36834
38711
|
const isDisabled = context.disabled || disabled;
|
|
36835
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onTriggerChange);
|
|
38712
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.onTriggerChange);
|
|
36836
38713
|
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
36837
38714
|
const [searchRef, handleTypeaheadSearch, resetTypeahead] = $cc7e05a45900e73f$var$useTypeaheadSearch((search)=>{
|
|
36838
38715
|
const enabledItems = getItems().filter((item)=>!item.disabled
|
|
@@ -36848,7 +38725,9 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
36848
38725
|
resetTypeahead();
|
|
36849
38726
|
}
|
|
36850
38727
|
};
|
|
36851
|
-
return /*#__PURE__*/ React.createElement($
|
|
38728
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
|
|
38729
|
+
asChild: true
|
|
38730
|
+
}, popperScope), /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.button, _extends({
|
|
36852
38731
|
type: "button",
|
|
36853
38732
|
role: "combobox",
|
|
36854
38733
|
"aria-controls": context.contentId,
|
|
@@ -36859,11 +38738,11 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
36859
38738
|
"data-state": context.open ? 'open' : 'closed',
|
|
36860
38739
|
disabled: isDisabled,
|
|
36861
38740
|
"data-disabled": isDisabled ? '' : undefined,
|
|
36862
|
-
"data-placeholder": context.value
|
|
38741
|
+
"data-placeholder": $cc7e05a45900e73f$var$shouldShowPlaceholder(context.value) ? '' : undefined
|
|
36863
38742
|
}, triggerProps, {
|
|
36864
38743
|
ref: composedRefs // Enable compatibility with native label or custom `Label` "click" for Safari:
|
|
36865
38744
|
,
|
|
36866
|
-
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onClick, (event)=>{
|
|
38745
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(triggerProps.onClick, (event)=>{
|
|
36867
38746
|
// Whilst browsers generally have no issue focusing the trigger when clicking
|
|
36868
38747
|
// on a label, Safari seems to struggle with the fact that there's no `onClick`.
|
|
36869
38748
|
// We force `focus` in this case. Note: this doesn't create any other side-effect
|
|
@@ -36871,7 +38750,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
36871
38750
|
// this only runs for a label "click"
|
|
36872
38751
|
event.currentTarget.focus();
|
|
36873
38752
|
}),
|
|
36874
|
-
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onPointerDown, (event)=>{
|
|
38753
|
+
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(triggerProps.onPointerDown, (event)=>{
|
|
36875
38754
|
// prevent implicit pointer capture
|
|
36876
38755
|
// https://www.w3.org/TR/pointerevents3/#implicit-pointer-capture
|
|
36877
38756
|
const target = event.target;
|
|
@@ -36887,7 +38766,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
36887
38766
|
event.preventDefault();
|
|
36888
38767
|
}
|
|
36889
38768
|
}),
|
|
36890
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onKeyDown, (event)=>{
|
|
38769
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(triggerProps.onKeyDown, (event)=>{
|
|
36891
38770
|
const isTypingAhead = searchRef.current !== '';
|
|
36892
38771
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
36893
38772
|
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
|
@@ -36897,35 +38776,35 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
36897
38776
|
event.preventDefault();
|
|
36898
38777
|
}
|
|
36899
38778
|
})
|
|
36900
|
-
}));
|
|
38779
|
+
})));
|
|
36901
38780
|
});
|
|
36902
38781
|
/* -------------------------------------------------------------------------------------------------
|
|
36903
38782
|
* SelectValue
|
|
36904
38783
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$VALUE_NAME = 'SelectValue';
|
|
36905
38784
|
const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
36906
38785
|
// We ignore `className` and `style` as this part shouldn't be styled.
|
|
36907
|
-
const { __scopeSelect: __scopeSelect , className: className , style: style , children: children , placeholder: placeholder , ...valueProps } = props;
|
|
38786
|
+
const { __scopeSelect: __scopeSelect , className: className , style: style , children: children , placeholder: placeholder = '' , ...valueProps } = props;
|
|
36908
38787
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$VALUE_NAME, __scopeSelect);
|
|
36909
38788
|
const { onValueNodeHasChildrenChange: onValueNodeHasChildrenChange } = context;
|
|
36910
38789
|
const hasChildren = children !== undefined;
|
|
36911
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onValueNodeChange);
|
|
36912
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
38790
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.onValueNodeChange);
|
|
38791
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
36913
38792
|
onValueNodeHasChildrenChange(hasChildren);
|
|
36914
38793
|
}, [
|
|
36915
38794
|
onValueNodeHasChildrenChange,
|
|
36916
38795
|
hasChildren
|
|
36917
38796
|
]);
|
|
36918
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, valueProps, {
|
|
38797
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({}, valueProps, {
|
|
36919
38798
|
ref: composedRefs // we don't want events from the portalled `SelectValue` children to bubble
|
|
36920
38799
|
,
|
|
36921
38800
|
style: {
|
|
36922
38801
|
pointerEvents: 'none'
|
|
36923
38802
|
}
|
|
36924
|
-
}), context.value
|
|
38803
|
+
}), $cc7e05a45900e73f$var$shouldShowPlaceholder(context.value) ? /*#__PURE__*/ React.createElement(React.Fragment, null, placeholder) : children);
|
|
36925
38804
|
});
|
|
36926
38805
|
const $cc7e05a45900e73f$export$99b400cabb58c515 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
36927
38806
|
const { __scopeSelect: __scopeSelect , children: children , ...iconProps } = props;
|
|
36928
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
38807
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({
|
|
36929
38808
|
"aria-hidden": true
|
|
36930
38809
|
}, iconProps, {
|
|
36931
38810
|
ref: forwardedRef
|
|
@@ -36942,33 +38821,39 @@ const $cc7e05a45900e73f$export$b2af6c9944296213 = (props)=>{
|
|
|
36942
38821
|
const $cc7e05a45900e73f$export$c973a4b3cb86a03d = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
36943
38822
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, props.__scopeSelect);
|
|
36944
38823
|
const [fragment, setFragment] = React.useState(); // setting the fragment in `useLayoutEffect` as `DocumentFragment` doesn't exist on the server
|
|
36945
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
38824
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
36946
38825
|
setFragment(new DocumentFragment());
|
|
36947
38826
|
}, []);
|
|
36948
|
-
|
|
38827
|
+
if (!context.open) {
|
|
38828
|
+
const frag = fragment;
|
|
38829
|
+
return frag ? /*#__PURE__*/ reactDom.exports.createPortal(/*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectContentProvider, {
|
|
38830
|
+
scope: props.__scopeSelect
|
|
38831
|
+
}, /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
38832
|
+
scope: props.__scopeSelect
|
|
38833
|
+
}, /*#__PURE__*/ React.createElement("div", null, props.children))), frag) : null;
|
|
38834
|
+
}
|
|
38835
|
+
return /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectContentImpl, _extends({}, props, {
|
|
36949
38836
|
ref: forwardedRef
|
|
36950
|
-
}))
|
|
36951
|
-
scope: props.__scopeSelect
|
|
36952
|
-
}, /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
36953
|
-
scope: props.__scopeSelect
|
|
36954
|
-
}, /*#__PURE__*/ React.createElement("div", null, props.children))), fragment) : null);
|
|
38837
|
+
}));
|
|
36955
38838
|
});
|
|
36956
|
-
|
|
38839
|
+
/* -------------------------------------------------------------------------------------------------
|
|
38840
|
+
* SelectContentImpl
|
|
38841
|
+
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$CONTENT_MARGIN = 10;
|
|
36957
38842
|
const [$cc7e05a45900e73f$var$SelectContentProvider, $cc7e05a45900e73f$var$useSelectContentContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$CONTENT_NAME);
|
|
36958
38843
|
const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
36959
|
-
const { __scopeSelect: __scopeSelect , onCloseAutoFocus: onCloseAutoFocus ,
|
|
38844
|
+
const { __scopeSelect: __scopeSelect , position: position = 'item-aligned' , onCloseAutoFocus: onCloseAutoFocus , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , side: //
|
|
38845
|
+
// PopperContent props
|
|
38846
|
+
side , sideOffset: sideOffset , align: align , alignOffset: alignOffset , arrowPadding: arrowPadding , collisionBoundary: collisionBoundary , collisionPadding: collisionPadding , sticky: sticky , hideWhenDetached: hideWhenDetached , avoidCollisions: avoidCollisions , //
|
|
38847
|
+
...contentProps } = props;
|
|
36960
38848
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
|
|
36961
|
-
const [contentWrapper, setContentWrapper] = React.useState(null);
|
|
36962
38849
|
const [content, setContent] = React.useState(null);
|
|
36963
38850
|
const [viewport, setViewport] = React.useState(null);
|
|
36964
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
38851
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContent(node)
|
|
36965
38852
|
);
|
|
36966
38853
|
const [selectedItem, setSelectedItem] = React.useState(null);
|
|
36967
38854
|
const [selectedItemText, setSelectedItemText] = React.useState(null);
|
|
36968
38855
|
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
36969
38856
|
const [isPositioned, setIsPositioned] = React.useState(false);
|
|
36970
|
-
const shouldRepositionRef = React.useRef(true);
|
|
36971
|
-
const shouldExpandOnScrollRef = React.useRef(false);
|
|
36972
38857
|
const firstValidItemFoundRef = React.useRef(false); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
36973
38858
|
React.useEffect(()=>{
|
|
36974
38859
|
if (content) return hideOthers(content);
|
|
@@ -36977,12 +38862,6 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
36977
38862
|
]); // Make sure the whole tree has focus guards as our `Select` may be
|
|
36978
38863
|
// the last element in the DOM (because of the `Portal`)
|
|
36979
38864
|
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
36980
|
-
const [contentZIndex, setContentZIndex] = React.useState();
|
|
36981
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
36982
|
-
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
36983
|
-
}, [
|
|
36984
|
-
content
|
|
36985
|
-
]);
|
|
36986
38865
|
const focusFirst = React.useCallback((candidates)=>{
|
|
36987
38866
|
const [firstItem, ...restItems] = getItems().map((item)=>item.ref.current
|
|
36988
38867
|
);
|
|
@@ -37003,101 +38882,6 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
37003
38882
|
getItems,
|
|
37004
38883
|
viewport
|
|
37005
38884
|
]);
|
|
37006
|
-
const position = React.useCallback(()=>{
|
|
37007
|
-
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
37008
|
-
const triggerRect = context.trigger.getBoundingClientRect(); // -----------------------------------------------------------------------------------------
|
|
37009
|
-
// Horizontal positioning
|
|
37010
|
-
// -----------------------------------------------------------------------------------------
|
|
37011
|
-
const contentRect = content.getBoundingClientRect();
|
|
37012
|
-
const valueNodeRect = context.valueNode.getBoundingClientRect();
|
|
37013
|
-
const itemTextRect = selectedItemText.getBoundingClientRect();
|
|
37014
|
-
if (context.dir !== 'rtl') {
|
|
37015
|
-
const itemTextOffset = itemTextRect.left - contentRect.left;
|
|
37016
|
-
const left = valueNodeRect.left - itemTextOffset;
|
|
37017
|
-
const leftDelta = triggerRect.left - left;
|
|
37018
|
-
const minContentWidth = triggerRect.width + leftDelta;
|
|
37019
|
-
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
37020
|
-
const rightEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
37021
|
-
const clampedLeft = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(left, [
|
|
37022
|
-
$cc7e05a45900e73f$var$CONTENT_MARGIN,
|
|
37023
|
-
rightEdge - contentWidth
|
|
37024
|
-
]);
|
|
37025
|
-
contentWrapper.style.minWidth = minContentWidth + 'px';
|
|
37026
|
-
contentWrapper.style.left = clampedLeft + 'px';
|
|
37027
|
-
} else {
|
|
37028
|
-
const itemTextOffset = contentRect.right - itemTextRect.right;
|
|
37029
|
-
const right = window.innerWidth - valueNodeRect.right - itemTextOffset;
|
|
37030
|
-
const rightDelta = window.innerWidth - triggerRect.right - right;
|
|
37031
|
-
const minContentWidth = triggerRect.width + rightDelta;
|
|
37032
|
-
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
37033
|
-
const leftEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
37034
|
-
const clampedRight = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(right, [
|
|
37035
|
-
$cc7e05a45900e73f$var$CONTENT_MARGIN,
|
|
37036
|
-
leftEdge - contentWidth
|
|
37037
|
-
]);
|
|
37038
|
-
contentWrapper.style.minWidth = minContentWidth + 'px';
|
|
37039
|
-
contentWrapper.style.right = clampedRight + 'px';
|
|
37040
|
-
} // -----------------------------------------------------------------------------------------
|
|
37041
|
-
// Vertical positioning
|
|
37042
|
-
// -----------------------------------------------------------------------------------------
|
|
37043
|
-
const items = getItems();
|
|
37044
|
-
const availableHeight = window.innerHeight - $cc7e05a45900e73f$var$CONTENT_MARGIN * 2;
|
|
37045
|
-
const itemsHeight = viewport.scrollHeight;
|
|
37046
|
-
const contentStyles = window.getComputedStyle(content);
|
|
37047
|
-
const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);
|
|
37048
|
-
const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);
|
|
37049
|
-
const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);
|
|
37050
|
-
const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);
|
|
37051
|
-
const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth; // prettier-ignore
|
|
37052
|
-
const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);
|
|
37053
|
-
const viewportStyles = window.getComputedStyle(viewport);
|
|
37054
|
-
const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);
|
|
37055
|
-
const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);
|
|
37056
|
-
const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
37057
|
-
const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;
|
|
37058
|
-
const selectedItemHalfHeight = selectedItem.offsetHeight / 2;
|
|
37059
|
-
const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;
|
|
37060
|
-
const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;
|
|
37061
|
-
const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;
|
|
37062
|
-
const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;
|
|
37063
|
-
if (willAlignWithoutTopOverflow) {
|
|
37064
|
-
const isLastItem = selectedItem === items[items.length - 1].ref.current;
|
|
37065
|
-
contentWrapper.style.bottom = "0px";
|
|
37066
|
-
const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;
|
|
37067
|
-
const clampedTriggerMiddleToBottomEdge = Math.max(triggerMiddleToBottomEdge, selectedItemHalfHeight + (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth);
|
|
37068
|
-
const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;
|
|
37069
|
-
contentWrapper.style.height = height + 'px';
|
|
37070
|
-
} else {
|
|
37071
|
-
const isFirstItem = selectedItem === items[0].ref.current;
|
|
37072
|
-
contentWrapper.style.top = "0px";
|
|
37073
|
-
const clampedTopEdgeToTriggerMiddle = Math.max(topEdgeToTriggerMiddle, contentBorderTopWidth + viewport.offsetTop + (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight);
|
|
37074
|
-
const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;
|
|
37075
|
-
contentWrapper.style.height = height + 'px';
|
|
37076
|
-
viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;
|
|
37077
|
-
}
|
|
37078
|
-
contentWrapper.style.margin = `${$cc7e05a45900e73f$var$CONTENT_MARGIN}px 0`;
|
|
37079
|
-
contentWrapper.style.minHeight = minContentHeight + 'px';
|
|
37080
|
-
contentWrapper.style.maxHeight = availableHeight + 'px'; // -----------------------------------------------------------------------------------------
|
|
37081
|
-
setIsPositioned(true); // we don't want the initial scroll position adjustment to trigger "expand on scroll"
|
|
37082
|
-
// so we explicitly turn it on only after they've registered.
|
|
37083
|
-
requestAnimationFrame(()=>shouldExpandOnScrollRef.current = true
|
|
37084
|
-
);
|
|
37085
|
-
}
|
|
37086
|
-
}, [
|
|
37087
|
-
getItems,
|
|
37088
|
-
context.trigger,
|
|
37089
|
-
context.valueNode,
|
|
37090
|
-
contentWrapper,
|
|
37091
|
-
content,
|
|
37092
|
-
viewport,
|
|
37093
|
-
selectedItem,
|
|
37094
|
-
selectedItemText,
|
|
37095
|
-
context.dir
|
|
37096
|
-
]);
|
|
37097
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>position()
|
|
37098
|
-
, [
|
|
37099
|
-
position
|
|
37100
|
-
]);
|
|
37101
38885
|
const focusSelectedItem = React.useCallback(()=>focusFirst([
|
|
37102
38886
|
selectedItem,
|
|
37103
38887
|
content
|
|
@@ -37113,19 +38897,6 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
37113
38897
|
}, [
|
|
37114
38898
|
isPositioned,
|
|
37115
38899
|
focusSelectedItem
|
|
37116
|
-
]); // When the viewport becomes scrollable at the top, the scroll up button will mount.
|
|
37117
|
-
// Because it is part of the normal flow, it will push down the viewport, thus throwing our
|
|
37118
|
-
// trigger => selectedItem alignment off by the amount the viewport was pushed down.
|
|
37119
|
-
// We wait for this to happen and then re-run the positining logic one more time to account for it.
|
|
37120
|
-
const handleScrollButtonChange = React.useCallback((node)=>{
|
|
37121
|
-
if (node && shouldRepositionRef.current === true) {
|
|
37122
|
-
position();
|
|
37123
|
-
focusSelectedItem();
|
|
37124
|
-
shouldRepositionRef.current = false;
|
|
37125
|
-
}
|
|
37126
|
-
}, [
|
|
37127
|
-
position,
|
|
37128
|
-
focusSelectedItem
|
|
37129
38900
|
]); // prevent selecting items on `pointerup` in some cases after opening from `pointerdown`
|
|
37130
38901
|
// and close on `pointerup` outside.
|
|
37131
38902
|
const { onOpenChange: onOpenChange , triggerPointerDownPosRef: triggerPointerDownPosRef } = context;
|
|
@@ -37214,9 +38985,21 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
37214
38985
|
}, [
|
|
37215
38986
|
context.value
|
|
37216
38987
|
]);
|
|
38988
|
+
const SelectPosition = position === 'popper' ? $cc7e05a45900e73f$var$SelectPopperPosition : $cc7e05a45900e73f$var$SelectItemAlignedPosition; // Silently ignore props that are not supported by `SelectItemAlignedPosition`
|
|
38989
|
+
const popperContentProps = SelectPosition === $cc7e05a45900e73f$var$SelectPopperPosition ? {
|
|
38990
|
+
side: side,
|
|
38991
|
+
sideOffset: sideOffset,
|
|
38992
|
+
align: align,
|
|
38993
|
+
alignOffset: alignOffset,
|
|
38994
|
+
arrowPadding: arrowPadding,
|
|
38995
|
+
collisionBoundary: collisionBoundary,
|
|
38996
|
+
collisionPadding: collisionPadding,
|
|
38997
|
+
sticky: sticky,
|
|
38998
|
+
hideWhenDetached: hideWhenDetached,
|
|
38999
|
+
avoidCollisions: avoidCollisions
|
|
39000
|
+
} : {};
|
|
37217
39001
|
return /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectContentProvider, {
|
|
37218
39002
|
scope: __scopeSelect,
|
|
37219
|
-
contentWrapper: contentWrapper,
|
|
37220
39003
|
content: content,
|
|
37221
39004
|
viewport: viewport,
|
|
37222
39005
|
onViewportChange: setViewport,
|
|
@@ -37224,22 +39007,14 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
37224
39007
|
selectedItem: selectedItem,
|
|
37225
39008
|
onItemLeave: handleItemLeave,
|
|
37226
39009
|
itemTextRefCallback: itemTextRefCallback,
|
|
39010
|
+
focusSelectedItem: focusSelectedItem,
|
|
37227
39011
|
selectedItemText: selectedItemText,
|
|
37228
|
-
|
|
39012
|
+
position: position,
|
|
37229
39013
|
isPositioned: isPositioned,
|
|
37230
|
-
shouldExpandOnScrollRef: shouldExpandOnScrollRef,
|
|
37231
39014
|
searchRef: searchRef
|
|
37232
39015
|
}, /*#__PURE__*/ React.createElement($01b9c$RemoveScroll, {
|
|
37233
|
-
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
39016
|
+
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360$1,
|
|
37234
39017
|
allowPinchZoom: true
|
|
37235
|
-
}, /*#__PURE__*/ React.createElement("div", {
|
|
37236
|
-
ref: setContentWrapper,
|
|
37237
|
-
style: {
|
|
37238
|
-
display: 'flex',
|
|
37239
|
-
flexDirection: 'column',
|
|
37240
|
-
position: 'fixed',
|
|
37241
|
-
zIndex: contentZIndex
|
|
37242
|
-
}
|
|
37243
39018
|
}, /*#__PURE__*/ React.createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
37244
39019
|
asChild: true // we make sure we're not trapping once it's been closed
|
|
37245
39020
|
,
|
|
@@ -37248,38 +39023,41 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
37248
39023
|
// we prevent open autofocus because we manually focus the selected item
|
|
37249
39024
|
event.preventDefault();
|
|
37250
39025
|
},
|
|
37251
|
-
onUnmountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onCloseAutoFocus, (event)=>{
|
|
39026
|
+
onUnmountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(onCloseAutoFocus, (event)=>{
|
|
37252
39027
|
var _context$trigger;
|
|
37253
39028
|
(_context$trigger = context.trigger) === null || _context$trigger === void 0 || _context$trigger.focus({
|
|
37254
39029
|
preventScroll: true
|
|
37255
39030
|
});
|
|
37256
39031
|
event.preventDefault();
|
|
37257
39032
|
})
|
|
37258
|
-
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22,
|
|
39033
|
+
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
39034
|
+
asChild: true,
|
|
39035
|
+
disableOutsidePointerEvents: true,
|
|
39036
|
+
onEscapeKeyDown: onEscapeKeyDown,
|
|
39037
|
+
onPointerDownOutside: onPointerDownOutside // When focus is trapped, a focusout event may still happen.
|
|
39038
|
+
,
|
|
39039
|
+
onFocusOutside: (event)=>event.preventDefault()
|
|
39040
|
+
,
|
|
39041
|
+
onDismiss: ()=>context.onOpenChange(false)
|
|
39042
|
+
}, /*#__PURE__*/ React.createElement(SelectPosition, _extends({
|
|
37259
39043
|
role: "listbox",
|
|
37260
39044
|
id: context.contentId,
|
|
37261
39045
|
"data-state": context.open ? 'open' : 'closed',
|
|
37262
39046
|
dir: context.dir,
|
|
37263
39047
|
onContextMenu: (event)=>event.preventDefault()
|
|
37264
|
-
}, contentProps, {
|
|
39048
|
+
}, contentProps, popperContentProps, {
|
|
39049
|
+
onPlaced: ()=>setIsPositioned(true)
|
|
39050
|
+
,
|
|
37265
39051
|
ref: composedRefs,
|
|
37266
39052
|
style: {
|
|
39053
|
+
// flex layout so we can place the scroll buttons properly
|
|
37267
39054
|
display: 'flex',
|
|
37268
39055
|
flexDirection: 'column',
|
|
37269
|
-
//
|
|
37270
|
-
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
37271
|
-
boxSizing: 'border-box',
|
|
37272
|
-
maxHeight: '100%',
|
|
39056
|
+
// reset the outline by default as the content MAY get focused
|
|
37273
39057
|
outline: 'none',
|
|
37274
39058
|
...contentProps.style
|
|
37275
39059
|
},
|
|
37276
|
-
|
|
37277
|
-
,
|
|
37278
|
-
onFocusOutside: (event)=>event.preventDefault()
|
|
37279
|
-
,
|
|
37280
|
-
onDismiss: ()=>context.onOpenChange(false)
|
|
37281
|
-
,
|
|
37282
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event)=>{
|
|
39060
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(contentProps.onKeyDown, (event)=>{
|
|
37283
39061
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; // select should not be navigated using tab key so we prevent it
|
|
37284
39062
|
if (event.key === 'Tab') event.preventDefault();
|
|
37285
39063
|
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
|
@@ -37315,13 +39093,186 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
37315
39093
|
})
|
|
37316
39094
|
}))))));
|
|
37317
39095
|
});
|
|
39096
|
+
const $cc7e05a45900e73f$var$SelectItemAlignedPosition = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
39097
|
+
const { __scopeSelect: __scopeSelect , onPlaced: onPlaced , ...popperProps } = props;
|
|
39098
|
+
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
|
|
39099
|
+
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
|
|
39100
|
+
const [contentWrapper, setContentWrapper] = React.useState(null);
|
|
39101
|
+
const [content, setContent] = React.useState(null);
|
|
39102
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContent(node)
|
|
39103
|
+
);
|
|
39104
|
+
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
39105
|
+
const shouldExpandOnScrollRef = React.useRef(false);
|
|
39106
|
+
const shouldRepositionRef = React.useRef(true);
|
|
39107
|
+
const { viewport: viewport , selectedItem: selectedItem , selectedItemText: selectedItemText , focusSelectedItem: focusSelectedItem } = contentContext;
|
|
39108
|
+
const position = React.useCallback(()=>{
|
|
39109
|
+
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
39110
|
+
const triggerRect = context.trigger.getBoundingClientRect(); // -----------------------------------------------------------------------------------------
|
|
39111
|
+
// Horizontal positioning
|
|
39112
|
+
// -----------------------------------------------------------------------------------------
|
|
39113
|
+
const contentRect = content.getBoundingClientRect();
|
|
39114
|
+
const valueNodeRect = context.valueNode.getBoundingClientRect();
|
|
39115
|
+
const itemTextRect = selectedItemText.getBoundingClientRect();
|
|
39116
|
+
if (context.dir !== 'rtl') {
|
|
39117
|
+
const itemTextOffset = itemTextRect.left - contentRect.left;
|
|
39118
|
+
const left = valueNodeRect.left - itemTextOffset;
|
|
39119
|
+
const leftDelta = triggerRect.left - left;
|
|
39120
|
+
const minContentWidth = triggerRect.width + leftDelta;
|
|
39121
|
+
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
39122
|
+
const rightEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
39123
|
+
const clampedLeft = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(left, [
|
|
39124
|
+
$cc7e05a45900e73f$var$CONTENT_MARGIN,
|
|
39125
|
+
rightEdge - contentWidth
|
|
39126
|
+
]);
|
|
39127
|
+
contentWrapper.style.minWidth = minContentWidth + 'px';
|
|
39128
|
+
contentWrapper.style.left = clampedLeft + 'px';
|
|
39129
|
+
} else {
|
|
39130
|
+
const itemTextOffset = contentRect.right - itemTextRect.right;
|
|
39131
|
+
const right = window.innerWidth - valueNodeRect.right - itemTextOffset;
|
|
39132
|
+
const rightDelta = window.innerWidth - triggerRect.right - right;
|
|
39133
|
+
const minContentWidth = triggerRect.width + rightDelta;
|
|
39134
|
+
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
39135
|
+
const leftEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
39136
|
+
const clampedRight = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(right, [
|
|
39137
|
+
$cc7e05a45900e73f$var$CONTENT_MARGIN,
|
|
39138
|
+
leftEdge - contentWidth
|
|
39139
|
+
]);
|
|
39140
|
+
contentWrapper.style.minWidth = minContentWidth + 'px';
|
|
39141
|
+
contentWrapper.style.right = clampedRight + 'px';
|
|
39142
|
+
} // -----------------------------------------------------------------------------------------
|
|
39143
|
+
// Vertical positioning
|
|
39144
|
+
// -----------------------------------------------------------------------------------------
|
|
39145
|
+
const items = getItems();
|
|
39146
|
+
const availableHeight = window.innerHeight - $cc7e05a45900e73f$var$CONTENT_MARGIN * 2;
|
|
39147
|
+
const itemsHeight = viewport.scrollHeight;
|
|
39148
|
+
const contentStyles = window.getComputedStyle(content);
|
|
39149
|
+
const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);
|
|
39150
|
+
const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);
|
|
39151
|
+
const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);
|
|
39152
|
+
const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);
|
|
39153
|
+
const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth; // prettier-ignore
|
|
39154
|
+
const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);
|
|
39155
|
+
const viewportStyles = window.getComputedStyle(viewport);
|
|
39156
|
+
const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);
|
|
39157
|
+
const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);
|
|
39158
|
+
const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
39159
|
+
const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;
|
|
39160
|
+
const selectedItemHalfHeight = selectedItem.offsetHeight / 2;
|
|
39161
|
+
const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;
|
|
39162
|
+
const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;
|
|
39163
|
+
const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;
|
|
39164
|
+
const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;
|
|
39165
|
+
if (willAlignWithoutTopOverflow) {
|
|
39166
|
+
const isLastItem = selectedItem === items[items.length - 1].ref.current;
|
|
39167
|
+
contentWrapper.style.bottom = "0px";
|
|
39168
|
+
const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;
|
|
39169
|
+
const clampedTriggerMiddleToBottomEdge = Math.max(triggerMiddleToBottomEdge, selectedItemHalfHeight + (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth);
|
|
39170
|
+
const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;
|
|
39171
|
+
contentWrapper.style.height = height + 'px';
|
|
39172
|
+
} else {
|
|
39173
|
+
const isFirstItem = selectedItem === items[0].ref.current;
|
|
39174
|
+
contentWrapper.style.top = "0px";
|
|
39175
|
+
const clampedTopEdgeToTriggerMiddle = Math.max(topEdgeToTriggerMiddle, contentBorderTopWidth + viewport.offsetTop + (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight);
|
|
39176
|
+
const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;
|
|
39177
|
+
contentWrapper.style.height = height + 'px';
|
|
39178
|
+
viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;
|
|
39179
|
+
}
|
|
39180
|
+
contentWrapper.style.margin = `${$cc7e05a45900e73f$var$CONTENT_MARGIN}px 0`;
|
|
39181
|
+
contentWrapper.style.minHeight = minContentHeight + 'px';
|
|
39182
|
+
contentWrapper.style.maxHeight = availableHeight + 'px'; // -----------------------------------------------------------------------------------------
|
|
39183
|
+
onPlaced === null || onPlaced === void 0 || onPlaced(); // we don't want the initial scroll position adjustment to trigger "expand on scroll"
|
|
39184
|
+
// so we explicitly turn it on only after they've registered.
|
|
39185
|
+
requestAnimationFrame(()=>shouldExpandOnScrollRef.current = true
|
|
39186
|
+
);
|
|
39187
|
+
}
|
|
39188
|
+
}, [
|
|
39189
|
+
getItems,
|
|
39190
|
+
context.trigger,
|
|
39191
|
+
context.valueNode,
|
|
39192
|
+
contentWrapper,
|
|
39193
|
+
content,
|
|
39194
|
+
viewport,
|
|
39195
|
+
selectedItem,
|
|
39196
|
+
selectedItemText,
|
|
39197
|
+
context.dir,
|
|
39198
|
+
onPlaced
|
|
39199
|
+
]);
|
|
39200
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>position()
|
|
39201
|
+
, [
|
|
39202
|
+
position
|
|
39203
|
+
]); // copy z-index from content to wrapper
|
|
39204
|
+
const [contentZIndex, setContentZIndex] = React.useState();
|
|
39205
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
39206
|
+
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
39207
|
+
}, [
|
|
39208
|
+
content
|
|
39209
|
+
]); // When the viewport becomes scrollable at the top, the scroll up button will mount.
|
|
39210
|
+
// Because it is part of the normal flow, it will push down the viewport, thus throwing our
|
|
39211
|
+
// trigger => selectedItem alignment off by the amount the viewport was pushed down.
|
|
39212
|
+
// We wait for this to happen and then re-run the positining logic one more time to account for it.
|
|
39213
|
+
const handleScrollButtonChange = React.useCallback((node)=>{
|
|
39214
|
+
if (node && shouldRepositionRef.current === true) {
|
|
39215
|
+
position();
|
|
39216
|
+
focusSelectedItem === null || focusSelectedItem === void 0 || focusSelectedItem();
|
|
39217
|
+
shouldRepositionRef.current = false;
|
|
39218
|
+
}
|
|
39219
|
+
}, [
|
|
39220
|
+
position,
|
|
39221
|
+
focusSelectedItem
|
|
39222
|
+
]);
|
|
39223
|
+
return /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectViewportProvider, {
|
|
39224
|
+
scope: __scopeSelect,
|
|
39225
|
+
contentWrapper: contentWrapper,
|
|
39226
|
+
shouldExpandOnScrollRef: shouldExpandOnScrollRef,
|
|
39227
|
+
onScrollButtonChange: handleScrollButtonChange
|
|
39228
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
39229
|
+
ref: setContentWrapper,
|
|
39230
|
+
style: {
|
|
39231
|
+
display: 'flex',
|
|
39232
|
+
flexDirection: 'column',
|
|
39233
|
+
position: 'fixed',
|
|
39234
|
+
zIndex: contentZIndex
|
|
39235
|
+
}
|
|
39236
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, popperProps, {
|
|
39237
|
+
ref: composedRefs,
|
|
39238
|
+
style: {
|
|
39239
|
+
// When we get the height of the content, it includes borders. If we were to set
|
|
39240
|
+
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
39241
|
+
boxSizing: 'border-box',
|
|
39242
|
+
// We need to ensure the content doesn't get taller than the wrapper
|
|
39243
|
+
maxHeight: '100%',
|
|
39244
|
+
...popperProps.style
|
|
39245
|
+
}
|
|
39246
|
+
}))));
|
|
39247
|
+
});
|
|
39248
|
+
const $cc7e05a45900e73f$var$SelectPopperPosition = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
39249
|
+
const { __scopeSelect: __scopeSelect , align: align = 'start' , collisionPadding: collisionPadding = $cc7e05a45900e73f$var$CONTENT_MARGIN , ...popperProps } = props;
|
|
39250
|
+
const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
|
|
39251
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({}, popperScope, popperProps, {
|
|
39252
|
+
ref: forwardedRef,
|
|
39253
|
+
align: align,
|
|
39254
|
+
collisionPadding: collisionPadding,
|
|
39255
|
+
style: {
|
|
39256
|
+
// Ensure border-box for floating-ui calculations
|
|
39257
|
+
boxSizing: 'border-box',
|
|
39258
|
+
...popperProps.style,
|
|
39259
|
+
'--radix-select-content-transform-origin': 'var(--radix-popper-transform-origin)',
|
|
39260
|
+
'--radix-select-content-available-width': 'var(--radix-popper-available-width)',
|
|
39261
|
+
'--radix-select-content-available-height': 'var(--radix-popper-available-height)',
|
|
39262
|
+
'--radix-select-trigger-width': 'var(--radix-popper-anchor-width)',
|
|
39263
|
+
'--radix-select-trigger-height': 'var(--radix-popper-anchor-height)'
|
|
39264
|
+
}
|
|
39265
|
+
}));
|
|
39266
|
+
});
|
|
37318
39267
|
/* -------------------------------------------------------------------------------------------------
|
|
37319
39268
|
* SelectViewport
|
|
37320
|
-
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$
|
|
39269
|
+
* -----------------------------------------------------------------------------------------------*/ const [$cc7e05a45900e73f$var$SelectViewportProvider, $cc7e05a45900e73f$var$useSelectViewportContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, {});
|
|
39270
|
+
const $cc7e05a45900e73f$var$VIEWPORT_NAME = 'SelectViewport';
|
|
37321
39271
|
const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
37322
39272
|
const { __scopeSelect: __scopeSelect , ...viewportProps } = props;
|
|
37323
39273
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
|
|
37324
|
-
const
|
|
39274
|
+
const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
|
|
39275
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, contentContext.onViewportChange);
|
|
37325
39276
|
const prevScrollTopRef = React.useRef(0);
|
|
37326
39277
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("style", {
|
|
37327
39278
|
dangerouslySetInnerHTML: {
|
|
@@ -37329,7 +39280,7 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React.forwardRef
|
|
|
37329
39280
|
}
|
|
37330
39281
|
}), /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
37331
39282
|
scope: __scopeSelect
|
|
37332
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
39283
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
37333
39284
|
"data-radix-select-viewport": "",
|
|
37334
39285
|
role: "presentation"
|
|
37335
39286
|
}, viewportProps, {
|
|
@@ -37343,9 +39294,9 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React.forwardRef
|
|
|
37343
39294
|
overflow: 'auto',
|
|
37344
39295
|
...viewportProps.style
|
|
37345
39296
|
},
|
|
37346
|
-
onScroll: $e42e1063c40fb3ef$export$b9ecd428b558ff10(viewportProps.onScroll, (event)=>{
|
|
39297
|
+
onScroll: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(viewportProps.onScroll, (event)=>{
|
|
37347
39298
|
const viewport = event.currentTarget;
|
|
37348
|
-
const { contentWrapper: contentWrapper , shouldExpandOnScrollRef: shouldExpandOnScrollRef } =
|
|
39299
|
+
const { contentWrapper: contentWrapper , shouldExpandOnScrollRef: shouldExpandOnScrollRef } = viewportContext;
|
|
37349
39300
|
if (shouldExpandOnScrollRef !== null && shouldExpandOnScrollRef !== void 0 && shouldExpandOnScrollRef.current && contentWrapper) {
|
|
37350
39301
|
const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);
|
|
37351
39302
|
if (scrolledBy > 0) {
|
|
@@ -37384,7 +39335,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
37384
39335
|
const isSelected = context.value === value;
|
|
37385
39336
|
const [textValue, setTextValue] = React.useState(textValueProp !== null && textValueProp !== void 0 ? textValueProp : '');
|
|
37386
39337
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
37387
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>{
|
|
39338
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>{
|
|
37388
39339
|
var _contentContext$itemR;
|
|
37389
39340
|
return (_contentContext$itemR = contentContext.itemRefCallback) === null || _contentContext$itemR === void 0 ? void 0 : _contentContext$itemR.call(contentContext, node, value, disabled);
|
|
37390
39341
|
});
|
|
@@ -37395,6 +39346,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
37395
39346
|
context.onOpenChange(false);
|
|
37396
39347
|
}
|
|
37397
39348
|
};
|
|
39349
|
+
if (value === '') throw new Error('A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.');
|
|
37398
39350
|
return /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectItemContextProvider, {
|
|
37399
39351
|
scope: __scopeSelect,
|
|
37400
39352
|
value: value,
|
|
@@ -37412,7 +39364,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
37412
39364
|
value: value,
|
|
37413
39365
|
disabled: disabled,
|
|
37414
39366
|
textValue: textValue
|
|
37415
|
-
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
39367
|
+
}, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
37416
39368
|
role: "option",
|
|
37417
39369
|
"aria-labelledby": textId,
|
|
37418
39370
|
"data-highlighted": isFocused ? '' : undefined // `isFocused` caveat fixes stuttering in VoiceOver
|
|
@@ -37424,12 +39376,12 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
37424
39376
|
tabIndex: disabled ? undefined : -1
|
|
37425
39377
|
}, itemProps, {
|
|
37426
39378
|
ref: composedRefs,
|
|
37427
|
-
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onFocus, ()=>setIsFocused(true)
|
|
39379
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onFocus, ()=>setIsFocused(true)
|
|
37428
39380
|
),
|
|
37429
|
-
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onBlur, ()=>setIsFocused(false)
|
|
39381
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onBlur, ()=>setIsFocused(false)
|
|
37430
39382
|
),
|
|
37431
|
-
onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerUp, handleSelect),
|
|
37432
|
-
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerMove, (event)=>{
|
|
39383
|
+
onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onPointerUp, handleSelect),
|
|
39384
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onPointerMove, (event)=>{
|
|
37433
39385
|
if (disabled) {
|
|
37434
39386
|
var _contentContext$onIte;
|
|
37435
39387
|
(_contentContext$onIte = contentContext.onItemLeave) === null || _contentContext$onIte === void 0 || _contentContext$onIte.call(contentContext);
|
|
@@ -37439,13 +39391,13 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
37439
39391
|
preventScroll: true
|
|
37440
39392
|
});
|
|
37441
39393
|
}),
|
|
37442
|
-
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerLeave, (event)=>{
|
|
39394
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onPointerLeave, (event)=>{
|
|
37443
39395
|
if (event.currentTarget === document.activeElement) {
|
|
37444
39396
|
var _contentContext$onIte2;
|
|
37445
39397
|
(_contentContext$onIte2 = contentContext.onItemLeave) === null || _contentContext$onIte2 === void 0 || _contentContext$onIte2.call(contentContext);
|
|
37446
39398
|
}
|
|
37447
39399
|
}),
|
|
37448
|
-
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onKeyDown, (event)=>{
|
|
39400
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onKeyDown, (event)=>{
|
|
37449
39401
|
var _contentContext$searc;
|
|
37450
39402
|
const isTypingAhead = ((_contentContext$searc = contentContext.searchRef) === null || _contentContext$searc === void 0 ? void 0 : _contentContext$searc.current) !== '';
|
|
37451
39403
|
if (isTypingAhead && event.key === ' ') return;
|
|
@@ -37465,7 +39417,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React.forwardRef
|
|
|
37465
39417
|
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
37466
39418
|
const nativeOptionsContext = $cc7e05a45900e73f$var$useSelectNativeOptionsContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
37467
39419
|
const [itemTextNode, setItemTextNode] = React.useState(null);
|
|
37468
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setItemTextNode(node)
|
|
39420
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setItemTextNode(node)
|
|
37469
39421
|
, itemContext.onItemTextChange, (node)=>{
|
|
37470
39422
|
var _contentContext$itemT;
|
|
37471
39423
|
return (_contentContext$itemT = contentContext.itemTextRefCallback) === null || _contentContext$itemT === void 0 ? void 0 : _contentContext$itemT.call(contentContext, node, itemContext.value, itemContext.disabled);
|
|
@@ -37482,7 +39434,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React.forwardRef
|
|
|
37482
39434
|
textContent
|
|
37483
39435
|
]);
|
|
37484
39436
|
const { onNativeOptionAdd: onNativeOptionAdd , onNativeOptionRemove: onNativeOptionRemove } = nativeOptionsContext;
|
|
37485
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
39437
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
37486
39438
|
onNativeOptionAdd(nativeOption);
|
|
37487
39439
|
return ()=>onNativeOptionRemove(nativeOption)
|
|
37488
39440
|
;
|
|
@@ -37491,7 +39443,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React.forwardRef
|
|
|
37491
39443
|
onNativeOptionRemove,
|
|
37492
39444
|
nativeOption
|
|
37493
39445
|
]);
|
|
37494
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
39446
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({
|
|
37495
39447
|
id: itemContext.textId
|
|
37496
39448
|
}, itemTextProps, {
|
|
37497
39449
|
ref: composedRefs
|
|
@@ -37503,7 +39455,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React.forwardRef
|
|
|
37503
39455
|
const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
37504
39456
|
const { __scopeSelect: __scopeSelect , ...itemIndicatorProps } = props;
|
|
37505
39457
|
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_INDICATOR_NAME, __scopeSelect);
|
|
37506
|
-
return itemContext.isSelected ? /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
39458
|
+
return itemContext.isSelected ? /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({
|
|
37507
39459
|
"aria-hidden": true
|
|
37508
39460
|
}, itemIndicatorProps, {
|
|
37509
39461
|
ref: forwardedRef
|
|
@@ -37514,9 +39466,10 @@ const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ React.forwardRef
|
|
|
37514
39466
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME = 'SelectScrollUpButton';
|
|
37515
39467
|
const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
37516
39468
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
39469
|
+
const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
37517
39470
|
const [canScrollUp1, setCanScrollUp] = React.useState(false);
|
|
37518
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef,
|
|
37519
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
39471
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, viewportContext.onScrollButtonChange);
|
|
39472
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
37520
39473
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
37521
39474
|
const viewport = contentContext.viewport;
|
|
37522
39475
|
function handleScroll() {
|
|
@@ -37545,9 +39498,10 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React.forwardRef
|
|
|
37545
39498
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME = 'SelectScrollDownButton';
|
|
37546
39499
|
const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
37547
39500
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
39501
|
+
const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
37548
39502
|
const [canScrollDown1, setCanScrollDown] = React.useState(false);
|
|
37549
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef,
|
|
37550
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
39503
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, viewportContext.onScrollButtonChange);
|
|
39504
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
37551
39505
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
37552
39506
|
const viewport = contentContext.viewport;
|
|
37553
39507
|
function handleScroll() {
|
|
@@ -37593,7 +39547,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
37593
39547
|
// Because it is part of the normal flow, it will push down (top button) or shrink (bottom button)
|
|
37594
39548
|
// the viewport, potentially causing the active item to now be partially out of view.
|
|
37595
39549
|
// We re-run the `scrollIntoView` logic to make sure it stays within the viewport.
|
|
37596
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
39550
|
+
$9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
|
|
37597
39551
|
var _activeItem$ref$curre;
|
|
37598
39552
|
const activeItem = getItems().find((item)=>item.ref.current === document.activeElement
|
|
37599
39553
|
);
|
|
@@ -37603,7 +39557,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
37603
39557
|
}, [
|
|
37604
39558
|
getItems
|
|
37605
39559
|
]);
|
|
37606
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
39560
|
+
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
|
|
37607
39561
|
"aria-hidden": true
|
|
37608
39562
|
}, scrollIndicatorProps, {
|
|
37609
39563
|
ref: forwardedRef,
|
|
@@ -37611,21 +39565,27 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
37611
39565
|
flexShrink: 0,
|
|
37612
39566
|
...scrollIndicatorProps.style
|
|
37613
39567
|
},
|
|
37614
|
-
|
|
39568
|
+
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(scrollIndicatorProps.onPointerDown, ()=>{
|
|
39569
|
+
if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
39570
|
+
}),
|
|
39571
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(scrollIndicatorProps.onPointerMove, ()=>{
|
|
37615
39572
|
var _contentContext$onIte3;
|
|
37616
39573
|
(_contentContext$onIte3 = contentContext.onItemLeave) === null || _contentContext$onIte3 === void 0 || _contentContext$onIte3.call(contentContext);
|
|
37617
39574
|
if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
37618
39575
|
}),
|
|
37619
|
-
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerLeave, ()=>{
|
|
39576
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(scrollIndicatorProps.onPointerLeave, ()=>{
|
|
37620
39577
|
clearAutoScrollTimer();
|
|
37621
39578
|
})
|
|
37622
39579
|
}));
|
|
37623
39580
|
});
|
|
37624
|
-
/* -----------------------------------------------------------------------------------------------*/
|
|
39581
|
+
/* -----------------------------------------------------------------------------------------------*/ function $cc7e05a45900e73f$var$shouldShowPlaceholder(value) {
|
|
39582
|
+
return value === '' || value === undefined;
|
|
39583
|
+
}
|
|
39584
|
+
const $cc7e05a45900e73f$var$BubbleSelect = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
37625
39585
|
const { value: value , ...selectProps } = props;
|
|
37626
39586
|
const ref = React.useRef(null);
|
|
37627
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
37628
|
-
const prevValue = $010c2913dbd2fe3d$export$5cae361ad82dce8b(value); // Bubble value change to parents (e.g form change event)
|
|
39587
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
39588
|
+
const prevValue = $010c2913dbd2fe3d$export$5cae361ad82dce8b$1(value); // Bubble value change to parents (e.g form change event)
|
|
37629
39589
|
React.useEffect(()=>{
|
|
37630
39590
|
const select = ref.current;
|
|
37631
39591
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
@@ -37653,7 +39613,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
37653
39613
|
*
|
|
37654
39614
|
* We use `VisuallyHidden` rather than `display: "none"` because Safari autofill
|
|
37655
39615
|
* won't work otherwise.
|
|
37656
|
-
*/ return /*#__PURE__*/ React.createElement($ea1ef594cf570d83$export$439d29a4e110a164
|
|
39616
|
+
*/ return /*#__PURE__*/ React.createElement($ea1ef594cf570d83$export$439d29a4e110a164, {
|
|
37657
39617
|
asChild: true
|
|
37658
39618
|
}, /*#__PURE__*/ React.createElement("select", _extends({}, selectProps, {
|
|
37659
39619
|
ref: composedRefs,
|
|
@@ -37662,7 +39622,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
37662
39622
|
});
|
|
37663
39623
|
$cc7e05a45900e73f$var$BubbleSelect.displayName = 'BubbleSelect';
|
|
37664
39624
|
function $cc7e05a45900e73f$var$useTypeaheadSearch(onSearchChange) {
|
|
37665
|
-
const handleSearchChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onSearchChange);
|
|
39625
|
+
const handleSearchChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onSearchChange);
|
|
37666
39626
|
const searchRef = React.useRef('');
|
|
37667
39627
|
const timerRef = React.useRef(0);
|
|
37668
39628
|
const handleTypeaheadSearch = React.useCallback((key)=>{
|
|
@@ -37760,7 +39720,7 @@ const BtIconChevronUp2Px = (props) =>
|
|
|
37760
39720
|
/** Use `Select` to choose from a dropdown list of options. */
|
|
37761
39721
|
var Select = function (_a) {
|
|
37762
39722
|
var _b;
|
|
37763
|
-
var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, _c = _a.ariaLabel, ariaLabel = _c === void 0 ? label : _c, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, name = _a.name, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, _d = _a.selectSize, selectSize = _d === void 0 ? "m" : _d, props = __rest(_a, ["isRequired", "isDisabled", "placeholder", "label", "ariaLabel", "options", "onOpenChange", "isDefaultOpen", "defaultValue", "errorMessage", "labelSize", "helper", "name", "isFluid", "onBlur", "onChange", "disclosureTitle", "disclosureText", "onClickDisclosure", "selectSize"]);
|
|
39723
|
+
var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, _c = _a.ariaLabel, ariaLabel = _c === void 0 ? label : _c, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, name = _a.name, width = _a.width, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, _d = _a.selectSize, selectSize = _d === void 0 ? "m" : _d, props = __rest(_a, ["isRequired", "isDisabled", "placeholder", "label", "ariaLabel", "options", "onOpenChange", "isDefaultOpen", "defaultValue", "errorMessage", "labelSize", "helper", "name", "width", "isFluid", "onBlur", "onChange", "disclosureTitle", "disclosureText", "onClickDisclosure", "selectSize"]);
|
|
37764
39724
|
var id = React.useId();
|
|
37765
39725
|
var arcRootElement = React.useContext(ArcRootElementContext);
|
|
37766
39726
|
var surface = React.useContext(Context$3).surface;
|
|
@@ -37785,33 +39745,34 @@ var Select = function (_a) {
|
|
|
37785
39745
|
};
|
|
37786
39746
|
return (React__default["default"].createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", isDisabled: isDisabled, disclosureText: disclosureText, disclosureTitle: disclosureTitle, onClickDisclosure: onClickDisclosure },
|
|
37787
39747
|
React__default["default"].createElement($cc7e05a45900e73f$export$be92b6f5f03c0fe9, { name: name, required: isRequired, disabled: isDisabled, defaultOpen: isDefaultOpen, value: selectedValue, onOpenChange: onOpenChange, onValueChange: function (value) { return onValueChange(value); } },
|
|
37788
|
-
React__default["default"].createElement(
|
|
37789
|
-
|
|
37790
|
-
|
|
37791
|
-
|
|
37792
|
-
|
|
37793
|
-
|
|
37794
|
-
|
|
37795
|
-
|
|
37796
|
-
|
|
37797
|
-
React__default["default"].createElement(
|
|
37798
|
-
|
|
37799
|
-
React__default["default"].createElement($cc7e05a45900e73f$export$
|
|
37800
|
-
|
|
37801
|
-
|
|
37802
|
-
|
|
37803
|
-
React__default["default"].createElement(
|
|
37804
|
-
|
|
37805
|
-
|
|
37806
|
-
|
|
37807
|
-
React__default["default"].createElement(
|
|
37808
|
-
React__default["default"].createElement(
|
|
37809
|
-
React__default["default"].createElement(
|
|
37810
|
-
|
|
37811
|
-
React__default["default"].createElement(
|
|
37812
|
-
|
|
37813
|
-
|
|
37814
|
-
React__default["default"].createElement(
|
|
39748
|
+
React__default["default"].createElement("div", { className: "arc-Select-wrapper" },
|
|
39749
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$41fb9f06171c75f4, __assign({ id: id, name: name, onBlur: onBlur, "aria-label": ariaLabel, style: { width: width }, className: classNames("arc-Select-trigger", (_b = {
|
|
39750
|
+
"arc-Select-trigger--constrained": !isFluid,
|
|
39751
|
+
"arc-Select-trigger--onDarkSurface": surface === "dark",
|
|
39752
|
+
"arc-Select-trigger--invalid": errorMessage
|
|
39753
|
+
},
|
|
39754
|
+
_b["arc-Select-trigger--size".concat(selectSize && selectSize.toUpperCase())] = selectSize && selectSize !== "m",
|
|
39755
|
+
_b)) }, filterDataAttrs(props)),
|
|
39756
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$4c8d1a57a761ef94, { className: "arc-Select-triggerText", placeholder: placeholder, "aria-label": getSelectedValueName(selectedValue) }),
|
|
39757
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$f04a61298a47a40f, { className: "arc-Select-triggerIcon" },
|
|
39758
|
+
React__default["default"].createElement(Icon, { icon: BtIconChevronDown2Px, size: getIconSize(selectSize) }))),
|
|
39759
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$602eac185826482c, { container: arcRootElement || undefined },
|
|
39760
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$7c6e2c02157bb7d2, { sideOffset: 5, position: "popper", className: classNames("arc-Select-content", {
|
|
39761
|
+
"arc-Select-content--onDarkSurface": surface === "dark"
|
|
39762
|
+
}) },
|
|
39763
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$2f60d3ec9ad468f2, { className: "arc-Select-scrollButton" },
|
|
39764
|
+
React__default["default"].createElement(Icon, { icon: BtIconChevronUp2Px, size: 16 })),
|
|
39765
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$d5c6c08dc2d3ca7, null, options.map(function (_a, i) {
|
|
39766
|
+
var name = _a.name, value = _a.value;
|
|
39767
|
+
return (React__default["default"].createElement($cc7e05a45900e73f$export$6d08773d2e66f8f2, { className: "arc-Select-item", key: "select-item-".concat(i), value: value },
|
|
39768
|
+
React__default["default"].createElement("div", { className: "arc-Select-itemTextWrapper" },
|
|
39769
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$d6e5bf9c43ea9319, { asChild: true },
|
|
39770
|
+
React__default["default"].createElement("span", { className: "arc-Select-itemText" }, name))),
|
|
39771
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$c3468e2714d175fa, null,
|
|
39772
|
+
React__default["default"].createElement(Icon, { icon: BtIconTickAlt2Px, size: 20 }))));
|
|
39773
|
+
})),
|
|
39774
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$bf1aedc3039c8d63, { className: "arc-Select-scrollButton" },
|
|
39775
|
+
React__default["default"].createElement(Icon, { icon: BtIconChevronDown2Px, size: 16 }))))))));
|
|
37815
39776
|
};
|
|
37816
39777
|
|
|
37817
39778
|
/**
|
|
@@ -38533,6 +40494,217 @@ SiteHeaderRehydrator.NavItemRehydrator = NavItemRehydrator;
|
|
|
38533
40494
|
SiteHeaderRehydrator.NavItemWithSubNavRehydrator = NavItemWithSubNavRehydrator;
|
|
38534
40495
|
SiteHeaderRehydrator.SubNavItemRehydrator = SubNavItemRehydrator;
|
|
38535
40496
|
|
|
40497
|
+
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
|
|
40498
|
+
return function handleEvent(event) {
|
|
40499
|
+
originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
|
|
40500
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
|
|
40501
|
+
};
|
|
40502
|
+
}
|
|
40503
|
+
|
|
40504
|
+
/**
|
|
40505
|
+
* Set a given ref to a given value
|
|
40506
|
+
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
40507
|
+
*/ function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
40508
|
+
if (typeof ref === 'function') ref(value);
|
|
40509
|
+
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
40510
|
+
}
|
|
40511
|
+
/**
|
|
40512
|
+
* A utility to compose multiple refs together
|
|
40513
|
+
* Accepts callback refs and RefObject(s)
|
|
40514
|
+
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
40515
|
+
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
|
|
40516
|
+
)
|
|
40517
|
+
;
|
|
40518
|
+
}
|
|
40519
|
+
/**
|
|
40520
|
+
* A custom hook that composes multiple refs
|
|
40521
|
+
* Accepts callback refs and RefObject(s)
|
|
40522
|
+
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
40523
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40524
|
+
return React.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
40525
|
+
}
|
|
40526
|
+
|
|
40527
|
+
/* -------------------------------------------------------------------------------------------------
|
|
40528
|
+
* createContextScope
|
|
40529
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
|
|
40530
|
+
let defaultContexts = [];
|
|
40531
|
+
/* -----------------------------------------------------------------------------------------------
|
|
40532
|
+
* createContext
|
|
40533
|
+
* ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
|
|
40534
|
+
const BaseContext = /*#__PURE__*/ React.createContext(defaultContext);
|
|
40535
|
+
const index = defaultContexts.length;
|
|
40536
|
+
defaultContexts = [
|
|
40537
|
+
...defaultContexts,
|
|
40538
|
+
defaultContext
|
|
40539
|
+
];
|
|
40540
|
+
function Provider(props) {
|
|
40541
|
+
const { scope: scope , children: children , ...context } = props;
|
|
40542
|
+
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
|
|
40543
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40544
|
+
const value = React.useMemo(()=>context
|
|
40545
|
+
, Object.values(context));
|
|
40546
|
+
return /*#__PURE__*/ React.createElement(Context.Provider, {
|
|
40547
|
+
value: value
|
|
40548
|
+
}, children);
|
|
40549
|
+
}
|
|
40550
|
+
function useContext(consumerName, scope) {
|
|
40551
|
+
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
|
|
40552
|
+
const context = React.useContext(Context);
|
|
40553
|
+
if (context) return context;
|
|
40554
|
+
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
|
|
40555
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
40556
|
+
}
|
|
40557
|
+
Provider.displayName = rootComponentName + 'Provider';
|
|
40558
|
+
return [
|
|
40559
|
+
Provider,
|
|
40560
|
+
useContext
|
|
40561
|
+
];
|
|
40562
|
+
}
|
|
40563
|
+
/* -----------------------------------------------------------------------------------------------
|
|
40564
|
+
* createScope
|
|
40565
|
+
* ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
|
|
40566
|
+
const scopeContexts = defaultContexts.map((defaultContext)=>{
|
|
40567
|
+
return /*#__PURE__*/ React.createContext(defaultContext);
|
|
40568
|
+
});
|
|
40569
|
+
return function useScope(scope) {
|
|
40570
|
+
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
|
|
40571
|
+
return React.useMemo(()=>({
|
|
40572
|
+
[`__scope${scopeName}`]: {
|
|
40573
|
+
...scope,
|
|
40574
|
+
[scopeName]: contexts
|
|
40575
|
+
}
|
|
40576
|
+
})
|
|
40577
|
+
, [
|
|
40578
|
+
scope,
|
|
40579
|
+
contexts
|
|
40580
|
+
]);
|
|
40581
|
+
};
|
|
40582
|
+
};
|
|
40583
|
+
createScope.scopeName = scopeName;
|
|
40584
|
+
return [
|
|
40585
|
+
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
40586
|
+
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
|
|
40587
|
+
];
|
|
40588
|
+
}
|
|
40589
|
+
/* -------------------------------------------------------------------------------------------------
|
|
40590
|
+
* composeContextScopes
|
|
40591
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
|
40592
|
+
const baseScope = scopes[0];
|
|
40593
|
+
if (scopes.length === 1) return baseScope;
|
|
40594
|
+
const createScope1 = ()=>{
|
|
40595
|
+
const scopeHooks = scopes.map((createScope)=>({
|
|
40596
|
+
useScope: createScope(),
|
|
40597
|
+
scopeName: createScope.scopeName
|
|
40598
|
+
})
|
|
40599
|
+
);
|
|
40600
|
+
return function useComposedScopes(overrideScopes) {
|
|
40601
|
+
const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
|
|
40602
|
+
// We are calling a hook inside a callback which React warns against to avoid inconsistent
|
|
40603
|
+
// renders, however, scoping doesn't have render side effects so we ignore the rule.
|
|
40604
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
40605
|
+
const scopeProps = useScope(overrideScopes);
|
|
40606
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
40607
|
+
return {
|
|
40608
|
+
...nextScopes,
|
|
40609
|
+
...currentScope
|
|
40610
|
+
};
|
|
40611
|
+
}, {});
|
|
40612
|
+
return React.useMemo(()=>({
|
|
40613
|
+
[`__scope${baseScope.scopeName}`]: nextScopes1
|
|
40614
|
+
})
|
|
40615
|
+
, [
|
|
40616
|
+
nextScopes1
|
|
40617
|
+
]);
|
|
40618
|
+
};
|
|
40619
|
+
};
|
|
40620
|
+
createScope1.scopeName = baseScope.scopeName;
|
|
40621
|
+
return createScope1;
|
|
40622
|
+
}
|
|
40623
|
+
|
|
40624
|
+
/**
|
|
40625
|
+
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
40626
|
+
* prop or avoid re-executing effects when passed as a dependency
|
|
40627
|
+
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
40628
|
+
const callbackRef = React.useRef(callback);
|
|
40629
|
+
React.useEffect(()=>{
|
|
40630
|
+
callbackRef.current = callback;
|
|
40631
|
+
}); // https://github.com/facebook/react/issues/19240
|
|
40632
|
+
return React.useMemo(()=>(...args)=>{
|
|
40633
|
+
var _callbackRef$current;
|
|
40634
|
+
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
40635
|
+
}
|
|
40636
|
+
, []);
|
|
40637
|
+
}
|
|
40638
|
+
|
|
40639
|
+
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
|
|
40640
|
+
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
40641
|
+
defaultProp: defaultProp,
|
|
40642
|
+
onChange: onChange
|
|
40643
|
+
});
|
|
40644
|
+
const isControlled = prop !== undefined;
|
|
40645
|
+
const value1 = isControlled ? prop : uncontrolledProp;
|
|
40646
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
40647
|
+
const setValue = React.useCallback((nextValue)=>{
|
|
40648
|
+
if (isControlled) {
|
|
40649
|
+
const setter = nextValue;
|
|
40650
|
+
const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
|
|
40651
|
+
if (value !== prop) handleChange(value);
|
|
40652
|
+
} else setUncontrolledProp(nextValue);
|
|
40653
|
+
}, [
|
|
40654
|
+
isControlled,
|
|
40655
|
+
prop,
|
|
40656
|
+
setUncontrolledProp,
|
|
40657
|
+
handleChange
|
|
40658
|
+
]);
|
|
40659
|
+
return [
|
|
40660
|
+
value1,
|
|
40661
|
+
setValue
|
|
40662
|
+
];
|
|
40663
|
+
}
|
|
40664
|
+
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
|
40665
|
+
const uncontrolledState = React.useState(defaultProp);
|
|
40666
|
+
const [value] = uncontrolledState;
|
|
40667
|
+
const prevValueRef = React.useRef(value);
|
|
40668
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
40669
|
+
React.useEffect(()=>{
|
|
40670
|
+
if (prevValueRef.current !== value) {
|
|
40671
|
+
handleChange(value);
|
|
40672
|
+
prevValueRef.current = value;
|
|
40673
|
+
}
|
|
40674
|
+
}, [
|
|
40675
|
+
value,
|
|
40676
|
+
prevValueRef,
|
|
40677
|
+
handleChange
|
|
40678
|
+
]);
|
|
40679
|
+
return uncontrolledState;
|
|
40680
|
+
}
|
|
40681
|
+
|
|
40682
|
+
function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
|
|
40683
|
+
const ref = React.useRef({
|
|
40684
|
+
value: value,
|
|
40685
|
+
previous: value
|
|
40686
|
+
}); // We compare values before making an update to ensure that
|
|
40687
|
+
// a change has been made. This ensures the previous value is
|
|
40688
|
+
// persisted correctly between renders.
|
|
40689
|
+
return React.useMemo(()=>{
|
|
40690
|
+
if (ref.current.value !== value) {
|
|
40691
|
+
ref.current.previous = ref.current.value;
|
|
40692
|
+
ref.current.value = value;
|
|
40693
|
+
}
|
|
40694
|
+
return ref.current.previous;
|
|
40695
|
+
}, [
|
|
40696
|
+
value
|
|
40697
|
+
]);
|
|
40698
|
+
}
|
|
40699
|
+
|
|
40700
|
+
/**
|
|
40701
|
+
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
40702
|
+
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
40703
|
+
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
40704
|
+
*
|
|
40705
|
+
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
40706
|
+
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? React.useLayoutEffect : ()=>{};
|
|
40707
|
+
|
|
38536
40708
|
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
38537
40709
|
const [size, setSize] = React.useState(undefined);
|
|
38538
40710
|
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
@@ -38580,6 +40752,120 @@ function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
|
38580
40752
|
return size;
|
|
38581
40753
|
}
|
|
38582
40754
|
|
|
40755
|
+
/* -------------------------------------------------------------------------------------------------
|
|
40756
|
+
* Slot
|
|
40757
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
40758
|
+
const { children: children , ...slotProps } = props;
|
|
40759
|
+
const childrenArray = React.Children.toArray(children);
|
|
40760
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
40761
|
+
if (slottable) {
|
|
40762
|
+
// the new element to render is the one passed as a child of `Slottable`
|
|
40763
|
+
const newElement = slottable.props.children;
|
|
40764
|
+
const newChildren = childrenArray.map((child)=>{
|
|
40765
|
+
if (child === slottable) {
|
|
40766
|
+
// because the new element will be the one rendered, we are only interested
|
|
40767
|
+
// in grabbing its children (`newElement.props.children`)
|
|
40768
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
40769
|
+
return /*#__PURE__*/ React.isValidElement(newElement) ? newElement.props.children : null;
|
|
40770
|
+
} else return child;
|
|
40771
|
+
});
|
|
40772
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
40773
|
+
ref: forwardedRef
|
|
40774
|
+
}), /*#__PURE__*/ React.isValidElement(newElement) ? /*#__PURE__*/ React.cloneElement(newElement, undefined, newChildren) : null);
|
|
40775
|
+
}
|
|
40776
|
+
return /*#__PURE__*/ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
40777
|
+
ref: forwardedRef
|
|
40778
|
+
}), children);
|
|
40779
|
+
});
|
|
40780
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
|
40781
|
+
/* -------------------------------------------------------------------------------------------------
|
|
40782
|
+
* SlotClone
|
|
40783
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
40784
|
+
const { children: children , ...slotProps } = props;
|
|
40785
|
+
if (/*#__PURE__*/ React.isValidElement(children)) return /*#__PURE__*/ React.cloneElement(children, {
|
|
40786
|
+
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
40787
|
+
ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref)
|
|
40788
|
+
});
|
|
40789
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
40790
|
+
});
|
|
40791
|
+
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
|
|
40792
|
+
/* -------------------------------------------------------------------------------------------------
|
|
40793
|
+
* Slottable
|
|
40794
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
|
|
40795
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, children);
|
|
40796
|
+
};
|
|
40797
|
+
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
40798
|
+
return /*#__PURE__*/ React.isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
40799
|
+
}
|
|
40800
|
+
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
40801
|
+
// all child props should override
|
|
40802
|
+
const overrideProps = {
|
|
40803
|
+
...childProps
|
|
40804
|
+
};
|
|
40805
|
+
for(const propName in childProps){
|
|
40806
|
+
const slotPropValue = slotProps[propName];
|
|
40807
|
+
const childPropValue = childProps[propName];
|
|
40808
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
40809
|
+
if (isHandler) {
|
|
40810
|
+
// if the handler exists on both, we compose them
|
|
40811
|
+
if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{
|
|
40812
|
+
childPropValue(...args);
|
|
40813
|
+
slotPropValue(...args);
|
|
40814
|
+
};
|
|
40815
|
+
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
40816
|
+
} else if (propName === 'style') overrideProps[propName] = {
|
|
40817
|
+
...slotPropValue,
|
|
40818
|
+
...childPropValue
|
|
40819
|
+
};
|
|
40820
|
+
else if (propName === 'className') overrideProps[propName] = [
|
|
40821
|
+
slotPropValue,
|
|
40822
|
+
childPropValue
|
|
40823
|
+
].filter(Boolean).join(' ');
|
|
40824
|
+
}
|
|
40825
|
+
return {
|
|
40826
|
+
...slotProps,
|
|
40827
|
+
...overrideProps
|
|
40828
|
+
};
|
|
40829
|
+
}
|
|
40830
|
+
|
|
40831
|
+
const $8927f6f2acc4f386$var$NODES = [
|
|
40832
|
+
'a',
|
|
40833
|
+
'button',
|
|
40834
|
+
'div',
|
|
40835
|
+
'h2',
|
|
40836
|
+
'h3',
|
|
40837
|
+
'img',
|
|
40838
|
+
'label',
|
|
40839
|
+
'li',
|
|
40840
|
+
'nav',
|
|
40841
|
+
'ol',
|
|
40842
|
+
'p',
|
|
40843
|
+
'span',
|
|
40844
|
+
'svg',
|
|
40845
|
+
'ul'
|
|
40846
|
+
]; // Temporary while we await merge of this fix:
|
|
40847
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
|
|
40848
|
+
// prettier-ignore
|
|
40849
|
+
/* -------------------------------------------------------------------------------------------------
|
|
40850
|
+
* Primitive
|
|
40851
|
+
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
|
|
40852
|
+
const Node = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
40853
|
+
const { asChild: asChild , ...primitiveProps } = props;
|
|
40854
|
+
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
40855
|
+
React.useEffect(()=>{
|
|
40856
|
+
window[Symbol.for('radix-ui')] = true;
|
|
40857
|
+
}, []);
|
|
40858
|
+
return /*#__PURE__*/ React.createElement(Comp, _extends({}, primitiveProps, {
|
|
40859
|
+
ref: forwardedRef
|
|
40860
|
+
}));
|
|
40861
|
+
});
|
|
40862
|
+
Node.displayName = `Primitive.${node}`;
|
|
40863
|
+
return {
|
|
40864
|
+
...primitive,
|
|
40865
|
+
[node]: Node
|
|
40866
|
+
};
|
|
40867
|
+
}, {});
|
|
40868
|
+
|
|
38583
40869
|
/* -------------------------------------------------------------------------------------------------
|
|
38584
40870
|
* Switch
|
|
38585
40871
|
* -----------------------------------------------------------------------------------------------*/ const $6be4966fd9bbc698$var$SWITCH_NAME = 'Switch';
|
|
@@ -38721,99 +41007,6 @@ var Switch = function (_a) {
|
|
|
38721
41007
|
" ")))));
|
|
38722
41008
|
};
|
|
38723
41009
|
|
|
38724
|
-
// We have resorted to returning slots directly rather than exposing primitives that can then
|
|
38725
|
-
// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
|
|
38726
|
-
// This is because we encountered issues with generic types that cannot be statically analysed
|
|
38727
|
-
// due to creating them dynamically via createCollection.
|
|
38728
|
-
function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
38729
|
-
/* -----------------------------------------------------------------------------------------------
|
|
38730
|
-
* CollectionProvider
|
|
38731
|
-
* ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
|
|
38732
|
-
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1(PROVIDER_NAME);
|
|
38733
|
-
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
38734
|
-
collectionRef: {
|
|
38735
|
-
current: null
|
|
38736
|
-
},
|
|
38737
|
-
itemMap: new Map()
|
|
38738
|
-
});
|
|
38739
|
-
const CollectionProvider = (props)=>{
|
|
38740
|
-
const { scope: scope , children: children } = props;
|
|
38741
|
-
const ref = React__default["default"].useRef(null);
|
|
38742
|
-
const itemMap = React__default["default"].useRef(new Map()).current;
|
|
38743
|
-
return /*#__PURE__*/ React__default["default"].createElement(CollectionProviderImpl, {
|
|
38744
|
-
scope: scope,
|
|
38745
|
-
itemMap: itemMap,
|
|
38746
|
-
collectionRef: ref
|
|
38747
|
-
}, children);
|
|
38748
|
-
};
|
|
38749
|
-
/* -----------------------------------------------------------------------------------------------
|
|
38750
|
-
* CollectionSlot
|
|
38751
|
-
* ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot';
|
|
38752
|
-
const CollectionSlot = /*#__PURE__*/ React__default["default"].forwardRef((props, forwardedRef)=>{
|
|
38753
|
-
const { scope: scope , children: children } = props;
|
|
38754
|
-
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
38755
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.collectionRef);
|
|
38756
|
-
return /*#__PURE__*/ React__default["default"].createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360$1, {
|
|
38757
|
-
ref: composedRefs
|
|
38758
|
-
}, children);
|
|
38759
|
-
});
|
|
38760
|
-
/* -----------------------------------------------------------------------------------------------
|
|
38761
|
-
* CollectionItem
|
|
38762
|
-
* ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot';
|
|
38763
|
-
const ITEM_DATA_ATTR = 'data-radix-collection-item';
|
|
38764
|
-
const CollectionItemSlot = /*#__PURE__*/ React__default["default"].forwardRef((props, forwardedRef)=>{
|
|
38765
|
-
const { scope: scope , children: children , ...itemData } = props;
|
|
38766
|
-
const ref = React__default["default"].useRef(null);
|
|
38767
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
38768
|
-
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
38769
|
-
React__default["default"].useEffect(()=>{
|
|
38770
|
-
context.itemMap.set(ref, {
|
|
38771
|
-
ref: ref,
|
|
38772
|
-
...itemData
|
|
38773
|
-
});
|
|
38774
|
-
return ()=>void context.itemMap.delete(ref)
|
|
38775
|
-
;
|
|
38776
|
-
});
|
|
38777
|
-
return /*#__PURE__*/ React__default["default"].createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360$1, {
|
|
38778
|
-
[ITEM_DATA_ATTR]: '',
|
|
38779
|
-
ref: composedRefs
|
|
38780
|
-
}, children);
|
|
38781
|
-
});
|
|
38782
|
-
/* -----------------------------------------------------------------------------------------------
|
|
38783
|
-
* useCollection
|
|
38784
|
-
* ---------------------------------------------------------------------------------------------*/ function useCollection(scope) {
|
|
38785
|
-
const context = useCollectionContext(name + 'CollectionConsumer', scope);
|
|
38786
|
-
const getItems = React__default["default"].useCallback(()=>{
|
|
38787
|
-
const collectionNode = context.collectionRef.current;
|
|
38788
|
-
if (!collectionNode) return [];
|
|
38789
|
-
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
38790
|
-
const items = Array.from(context.itemMap.values());
|
|
38791
|
-
const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
38792
|
-
);
|
|
38793
|
-
return orderedItems;
|
|
38794
|
-
}, [
|
|
38795
|
-
context.collectionRef,
|
|
38796
|
-
context.itemMap
|
|
38797
|
-
]);
|
|
38798
|
-
return getItems;
|
|
38799
|
-
}
|
|
38800
|
-
return [
|
|
38801
|
-
{
|
|
38802
|
-
Provider: CollectionProvider,
|
|
38803
|
-
Slot: CollectionSlot,
|
|
38804
|
-
ItemSlot: CollectionItemSlot
|
|
38805
|
-
},
|
|
38806
|
-
useCollection,
|
|
38807
|
-
createCollectionScope
|
|
38808
|
-
];
|
|
38809
|
-
}
|
|
38810
|
-
|
|
38811
|
-
const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ React.createContext(undefined);
|
|
38812
|
-
/* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
|
|
38813
|
-
const globalDir = React.useContext($f631663db3294ace$var$DirectionContext);
|
|
38814
|
-
return localDir || globalDir || 'ltr';
|
|
38815
|
-
}
|
|
38816
|
-
|
|
38817
41010
|
const $d7bdfb9eb0fdf311$var$ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';
|
|
38818
41011
|
const $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = {
|
|
38819
41012
|
bubbles: false,
|
|
@@ -38928,7 +41121,7 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ React.forwardRef
|
|
|
38928
41121
|
* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$ITEM_NAME = 'RovingFocusGroupItem';
|
|
38929
41122
|
const $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
38930
41123
|
const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , focusable: focusable = true , active: active = false , tabStopId: tabStopId , ...itemProps } = props;
|
|
38931
|
-
const autoId = $1746a345f3d73bb7$export$f680877a34711e37
|
|
41124
|
+
const autoId = $1746a345f3d73bb7$export$f680877a34711e37();
|
|
38932
41125
|
const id = tabStopId || autoId;
|
|
38933
41126
|
const context = $d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME, __scopeRovingFocusGroup);
|
|
38934
41127
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
@@ -39055,7 +41248,7 @@ const $69cb30bb0017df05$export$b2539bed5023c21c = /*#__PURE__*/ React.forwardRef
|
|
|
39055
41248
|
});
|
|
39056
41249
|
return /*#__PURE__*/ React.createElement($69cb30bb0017df05$var$TabsProvider, {
|
|
39057
41250
|
scope: __scopeTabs,
|
|
39058
|
-
baseId: $1746a345f3d73bb7$export$f680877a34711e37
|
|
41251
|
+
baseId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
39059
41252
|
value: value,
|
|
39060
41253
|
onValueChange: setValue,
|
|
39061
41254
|
orientation: orientation,
|
|
@@ -39200,23 +41393,6 @@ var TabContent = function (_a) {
|
|
|
39200
41393
|
return (React__default["default"].createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { className: "arc-Tab-content", value: value }, children));
|
|
39201
41394
|
};
|
|
39202
41395
|
|
|
39203
|
-
const BtIconArrowRightFill = (props) =>
|
|
39204
|
-
/*#__PURE__*/ React__default["default"].createElement(
|
|
39205
|
-
"svg",
|
|
39206
|
-
Object.assign(
|
|
39207
|
-
{
|
|
39208
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
39209
|
-
viewBox: "0 0 32 32",
|
|
39210
|
-
},
|
|
39211
|
-
props,
|
|
39212
|
-
),
|
|
39213
|
-
/*#__PURE__*/ React__default["default"].createElement("defs", null),
|
|
39214
|
-
/*#__PURE__*/ React__default["default"].createElement("path", {
|
|
39215
|
-
d: "M2,16A14,14,0,1,0,16,2,14,14,0,0,0,2,16Zm16.85352-4.35352L23.207,16l-4.35351,4.35352a.5.5,0,0,1-.707-.707L21.293,16.5H9.5a.5.5,0,0,1,0-1H21.293l-3.14649-3.14648a.5.5,0,0,1,.707-.707Z",
|
|
39216
|
-
fill: "currentColor",
|
|
39217
|
-
}),
|
|
39218
|
-
);
|
|
39219
|
-
|
|
39220
41396
|
const BtIconArrowLeftFill = (props) =>
|
|
39221
41397
|
/*#__PURE__*/ React__default["default"].createElement(
|
|
39222
41398
|
"svg",
|
|
@@ -39336,9 +41512,9 @@ var TextArea = React.forwardRef(function (_a, ref) {
|
|
|
39336
41512
|
*/
|
|
39337
41513
|
var TextInput = React.forwardRef(function (_a, ref) {
|
|
39338
41514
|
var _b;
|
|
39339
|
-
var _c = _a.defaultValue, defaultValue = _c === void 0 ? "" : _c, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, inputMode = _a.inputMode, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.isReadOnly, isReadOnly = _e === void 0 ? false : _e, _f = _a.isRequired, isRequired = _f === void 0 ? false : _f, label = _a.label, _g = _a.labelSize, labelSize = _g === void 0 ? "l" : _g, maxLength = _a.maxLength, minLength = _a.minLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, pattern = _a.pattern, _h = _a.type, type = _h === void 0 ? "text" : _h, _j = _a.showPassword, showPassword = _j === void 0 ? false : _j, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, _k = _a.inputSize, inputSize = _k === void 0 ? "m" : _k, props = __rest(_a, ["defaultValue", "errorMessage", "helper", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "labelSize", "maxLength", "minLength", "name", "onBlur", "onChange", "onClickDisclosure", "pattern", "type", "showPassword", "value", "disclosureTitle", "disclosureText", "inputSize"]);
|
|
41515
|
+
var _c = _a.defaultValue, defaultValue = _c === void 0 ? "" : _c, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, inputMode = _a.inputMode, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.isReadOnly, isReadOnly = _e === void 0 ? false : _e, _f = _a.isRequired, isRequired = _f === void 0 ? false : _f, label = _a.label, _g = _a.labelSize, labelSize = _g === void 0 ? "l" : _g, maxLength = _a.maxLength, minLength = _a.minLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, pattern = _a.pattern, _h = _a.type, type = _h === void 0 ? "text" : _h, _j = _a.showPassword, showPassword = _j === void 0 ? false : _j, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, _k = _a.inputSize, inputSize = _k === void 0 ? "m" : _k, prefix = _a.prefix, suffix = _a.suffix, _l = _a.inputAlignment, inputAlignment = _l === void 0 ? "left" : _l, props = __rest(_a, ["defaultValue", "errorMessage", "helper", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "labelSize", "maxLength", "minLength", "name", "onBlur", "onChange", "onClickDisclosure", "pattern", "type", "showPassword", "value", "disclosureTitle", "disclosureText", "inputSize", "prefix", "suffix", "inputAlignment"]);
|
|
39340
41516
|
var surface = React.useContext(Context$3).surface;
|
|
39341
|
-
var
|
|
41517
|
+
var _m = React.useState(false), showPasswordToggle = _m[0], setShowPasswordToggle = _m[1];
|
|
39342
41518
|
var inferredInputProps = useNumericInput({
|
|
39343
41519
|
inputMode: inputMode,
|
|
39344
41520
|
pattern: pattern,
|
|
@@ -39353,15 +41529,21 @@ var TextInput = React.forwardRef(function (_a, ref) {
|
|
|
39353
41529
|
}).ariaDescribedby;
|
|
39354
41530
|
return (React__default["default"].createElement("div", __assign({ className: classNames((_b = {
|
|
39355
41531
|
"arc-TextInput": true,
|
|
41532
|
+
"arc-TextInput--alignRight": inputAlignment === "right",
|
|
39356
41533
|
"arc-TextInput--withPasswordToggle": showPassword,
|
|
41534
|
+
"arc-TextInput--isDisabled": isDisabled,
|
|
39357
41535
|
"arc-TextInput--invalid": errorMessage,
|
|
39358
|
-
"arc-TextInput--onDarkSurface": surface === "dark"
|
|
41536
|
+
"arc-TextInput--onDarkSurface": surface === "dark",
|
|
41537
|
+
"arc-TextInput--withPrefix": prefix,
|
|
41538
|
+
"arc-TextInput--withSuffix": suffix
|
|
39359
41539
|
},
|
|
39360
41540
|
_b["arc-TextInput--size".concat(inputSize && inputSize.toUpperCase())] = inputSize && inputSize !== "m",
|
|
39361
41541
|
_b)) }, filterDataAttrs(props)),
|
|
39362
41542
|
React__default["default"].createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure },
|
|
39363
41543
|
React__default["default"].createElement("div", { className: "arc-TextInput-inputWrapper" },
|
|
41544
|
+
prefix && (React__default["default"].createElement("span", { className: "arc-TextInput-prefix", "aria-hidden": true }, prefix)),
|
|
39364
41545
|
React__default["default"].createElement("input", __assign({ "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", className: "arc-TextInput-input", defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled, id: id, maxLength: maxLength, minLength: minLength, name: name, onChange: onChange, onBlur: onBlur, readOnly: isReadOnly, ref: ref, required: isRequired, value: typeof value !== "undefined" ? value : undefined }, inferredInputProps)),
|
|
41546
|
+
suffix && !showPassword ? (React__default["default"].createElement("span", { className: "arc-TextInput-suffix", "aria-hidden": true }, suffix)) : null,
|
|
39365
41547
|
showPassword && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
39366
41548
|
React__default["default"].createElement("button", { className: "arc-TextInput-passwordToggle", onClick: function () { return setShowPasswordToggle(function (p) { return !p; }); }, type: "button" }, showPasswordToggle ? "Hide" : "Show"),
|
|
39367
41549
|
React__default["default"].createElement(VisuallyHidden, null,
|
|
@@ -39371,26 +41553,6 @@ var TextInput = React.forwardRef(function (_a, ref) {
|
|
|
39371
41553
|
: "Your password is hidden")))))))));
|
|
39372
41554
|
});
|
|
39373
41555
|
|
|
39374
|
-
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
39375
|
-
return /*#__PURE__*/ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({}, props, {
|
|
39376
|
-
ref: forwardedRef,
|
|
39377
|
-
style: {
|
|
39378
|
-
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
39379
|
-
position: 'absolute',
|
|
39380
|
-
border: 0,
|
|
39381
|
-
width: 1,
|
|
39382
|
-
height: 1,
|
|
39383
|
-
padding: 0,
|
|
39384
|
-
margin: -1,
|
|
39385
|
-
overflow: 'hidden',
|
|
39386
|
-
clip: 'rect(0, 0, 0, 0)',
|
|
39387
|
-
whiteSpace: 'nowrap',
|
|
39388
|
-
wordWrap: 'normal',
|
|
39389
|
-
...props.style
|
|
39390
|
-
}
|
|
39391
|
-
}));
|
|
39392
|
-
});
|
|
39393
|
-
|
|
39394
41556
|
/* -------------------------------------------------------------------------------------------------
|
|
39395
41557
|
* ToastProvider
|
|
39396
41558
|
* -----------------------------------------------------------------------------------------------*/ const $054eb8030ebde76e$var$PROVIDER_NAME = 'ToastProvider';
|
|
@@ -39980,7 +42142,7 @@ function $054eb8030ebde76e$var$getAnnounceTextContent(container) {
|
|
|
39980
42142
|
if (handler) currentTarget.addEventListener(name, handler, {
|
|
39981
42143
|
once: true
|
|
39982
42144
|
});
|
|
39983
|
-
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f
|
|
42145
|
+
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(currentTarget, event);
|
|
39984
42146
|
else currentTarget.dispatchEvent(event);
|
|
39985
42147
|
}
|
|
39986
42148
|
const $054eb8030ebde76e$var$isDeltaInDirection = (delta, direction, threshold = 0)=>{
|
|
@@ -40087,11 +42249,44 @@ var Truncate = function (_a) {
|
|
|
40087
42249
|
return (React__default["default"].createElement("div", __assign({ className: "arc-Truncate", style: { maxWidth: "".concat(maxWidth, "%") }, title: title }, filterDataAttrs(props)), children));
|
|
40088
42250
|
};
|
|
40089
42251
|
|
|
42252
|
+
// move arrow to right all the time when no meta text
|
|
42253
|
+
// 1 typography card + 2 media cards
|
|
42254
|
+
var TypographyCard = function (_a) {
|
|
42255
|
+
var url = _a.url, onClick = _a.onClick, heading = _a.heading, metaText = _a.metaText, label = _a.label, _b = _a.linkData, linkData = _b === void 0 ? {} : _b, _c = _a.pathway, pathway = _c === void 0 ? "light" : _c, _d = _a.buttonIcon, buttonIcon = _d === void 0 ? "arrow" : _d, _e = _a.headingLevel, headingLevel = _e === void 0 ? "2" : _e, props = __rest(_a, ["url", "onClick", "heading", "metaText", "label", "linkData", "pathway", "buttonIcon", "headingLevel"]);
|
|
42256
|
+
var HeadingElement = "h".concat(headingLevel);
|
|
42257
|
+
var icons = {
|
|
42258
|
+
arrow: {
|
|
42259
|
+
regular: BtIconArrowRight,
|
|
42260
|
+
hover: BtIconArrowRightFill
|
|
42261
|
+
},
|
|
42262
|
+
play: {
|
|
42263
|
+
regular: BtIconPlay,
|
|
42264
|
+
hover: BtIconPlayFill
|
|
42265
|
+
}
|
|
42266
|
+
};
|
|
42267
|
+
return (React__default["default"].createElement("div", __assign({ className: classNames("arc-TypographyCard", {
|
|
42268
|
+
"arc-TypographyCard--darkPathway": pathway === "dark",
|
|
42269
|
+
"arc-TypographyCard--lightPathway": pathway === "light"
|
|
42270
|
+
}) }, filterDataAttrs(props)),
|
|
42271
|
+
React__default["default"].createElement("div", { className: "arc-TypographyCard-contentContainer" },
|
|
42272
|
+
label && (React__default["default"].createElement("div", { className: "arc-TypographyCard-labelContainer" },
|
|
42273
|
+
React__default["default"].createElement("span", { className: "arc-TypographyCard-label" }, label))),
|
|
42274
|
+
React__default["default"].createElement(HeadingElement, { className: "arc-TypographyCard-heading" },
|
|
42275
|
+
React__default["default"].createElement("a", __assign({ className: "arc-TypographyCard-headingLink", href: url, onClick: onClick }, filterDataAttrs(linkData)), heading))),
|
|
42276
|
+
React__default["default"].createElement("div", { className: "arc-TypographyCard-footer" },
|
|
42277
|
+
React__default["default"].createElement("div", { className: "arc-TypographyCard-metaTextContainer" }, metaText && (React__default["default"].createElement("span", { className: "arc-TypographyCard-metaText" }, metaText))),
|
|
42278
|
+
React__default["default"].createElement("div", { className: "arc-TypographyCard-footerButton" },
|
|
42279
|
+
React__default["default"].createElement("div", { className: classNames("arc-TypographyCard-footerButtonIcon", "arc-TypographyCard-footerButtonIcon--regular") },
|
|
42280
|
+
React__default["default"].createElement(Icon, { icon: icons[buttonIcon].regular, size: 40 })),
|
|
42281
|
+
React__default["default"].createElement("div", { className: "arc-TypographyCard-footerButtonIcon arc-TypographyCard-footerButtonIcon--hover" },
|
|
42282
|
+
React__default["default"].createElement(Icon, { icon: icons[buttonIcon].hover, size: 40 }))))));
|
|
42283
|
+
};
|
|
42284
|
+
|
|
40090
42285
|
/**
|
|
40091
42286
|
* Use `UniversalHeader` to display a group-level page header.
|
|
40092
42287
|
*/
|
|
40093
42288
|
var UniversalHeader = function (_a) {
|
|
40094
|
-
var children = _a.children, props = __rest(_a, ["children"]);
|
|
42289
|
+
var children = _a.children, ContentSlot = _a.ContentSlot, props = __rest(_a, ["children", "ContentSlot"]);
|
|
40095
42290
|
React.useEffect(function () {
|
|
40096
42291
|
React__default["default"].Children.map(children, function (item) {
|
|
40097
42292
|
if (item && item.type !== UniversalHeaderItem) {
|
|
@@ -40101,7 +42296,9 @@ var UniversalHeader = function (_a) {
|
|
|
40101
42296
|
}, [children]);
|
|
40102
42297
|
return (React__default["default"].createElement("nav", __assign({ className: "arc-UniversalHeader" }, filterDataAttrs(props)),
|
|
40103
42298
|
React__default["default"].createElement(Surface, { background: "light" },
|
|
40104
|
-
React__default["default"].createElement("ul", { className: "arc-UniversalHeader-items" },
|
|
42299
|
+
React__default["default"].createElement("ul", { className: "arc-UniversalHeader-items" },
|
|
42300
|
+
children,
|
|
42301
|
+
ContentSlot && (React__default["default"].createElement("li", { className: "arc-UniversalHeader-contentSlot" }, ContentSlot))))));
|
|
40105
42302
|
};
|
|
40106
42303
|
var UniversalHeaderItem = function (_a) {
|
|
40107
42304
|
var children = _a.children, href = _a.href, props = __rest(_a, ["children", "href"]);
|
|
@@ -40161,6 +42358,7 @@ exports.TextArea = TextArea;
|
|
|
40161
42358
|
exports.TextInput = TextInput;
|
|
40162
42359
|
exports.Toast = Toast;
|
|
40163
42360
|
exports.Truncate = Truncate;
|
|
42361
|
+
exports.TypographyCard = TypographyCard;
|
|
40164
42362
|
exports.UniversalHeader = UniversalHeader;
|
|
40165
42363
|
exports.VerticalSpace = VerticalSpace;
|
|
40166
42364
|
exports.VisuallyHidden = VisuallyHidden;
|