fictoan-react 1.11.12 → 1.11.14
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/{Heading-rqGgiuKe.js → Modal-eaK0YswF.js} +765 -732
- package/dist/components/Drawer/Drawer.d.ts +10 -4
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +56 -52
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +59 -55
- package/package.json +1 -1
|
@@ -882,10 +882,10 @@ function _typeof$5(o) {
|
|
|
882
882
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
883
883
|
}, _typeof$5(o);
|
|
884
884
|
}
|
|
885
|
-
function _slicedToArray$
|
|
886
|
-
return _arrayWithHoles$
|
|
885
|
+
function _slicedToArray$c(r, e) {
|
|
886
|
+
return _arrayWithHoles$c(r) || _iterableToArrayLimit$c(r, e) || _unsupportedIterableToArray$f(r, e) || _nonIterableRest$c();
|
|
887
887
|
}
|
|
888
|
-
function _nonIterableRest$
|
|
888
|
+
function _nonIterableRest$c() {
|
|
889
889
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
890
890
|
}
|
|
891
891
|
function _unsupportedIterableToArray$f(r, a) {
|
|
@@ -900,7 +900,7 @@ function _arrayLikeToArray$f(r, a) {
|
|
|
900
900
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
901
901
|
return n;
|
|
902
902
|
}
|
|
903
|
-
function _iterableToArrayLimit$
|
|
903
|
+
function _iterableToArrayLimit$c(r, l) {
|
|
904
904
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
905
905
|
if (null != t) {
|
|
906
906
|
var e, n, i, u, a = [], f = true, o = false;
|
|
@@ -921,7 +921,7 @@ function _iterableToArrayLimit$d(r, l) {
|
|
|
921
921
|
return a;
|
|
922
922
|
}
|
|
923
923
|
}
|
|
924
|
-
function _arrayWithHoles$
|
|
924
|
+
function _arrayWithHoles$c(r) {
|
|
925
925
|
if (Array.isArray(r)) return r;
|
|
926
926
|
}
|
|
927
927
|
function _objectWithoutProperties$H(e, t) {
|
|
@@ -944,10 +944,10 @@ function _objectWithoutPropertiesLoose$H(r, e) {
|
|
|
944
944
|
}
|
|
945
945
|
var CodeBlock = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
946
946
|
var children = _ref.children, source = _ref.source, _ref$language = _ref.language, language = _ref$language === void 0 ? "json" : _ref$language, showCopyButton = _ref.showCopyButton, showLineNumbers = _ref.showLineNumbers, description = _ref.description, _ref$withSyntaxHighli = _ref.withSyntaxHighlighting, withSyntaxHighlighting = _ref$withSyntaxHighli === void 0 ? false : _ref$withSyntaxHighli, _ref$makeEditable = _ref.makeEditable, makeEditable = _ref$makeEditable === void 0 ? false : _ref$makeEditable, onChange = _ref.onChange, props = _objectWithoutProperties$H(_ref, _excluded$H);
|
|
947
|
-
var _useState = useState(false), _useState2 = _slicedToArray$
|
|
948
|
-
var _useState3 = useState(null), _useState4 = _slicedToArray$
|
|
949
|
-
var _useState5 = useState(withSyntaxHighlighting), _useState6 = _slicedToArray$
|
|
950
|
-
var _useState7 = useState(null), _useState8 = _slicedToArray$
|
|
947
|
+
var _useState = useState(false), _useState2 = _slicedToArray$c(_useState, 2), isCodeCopied = _useState2[0], setIsCodeCopied = _useState2[1];
|
|
948
|
+
var _useState3 = useState(null), _useState4 = _slicedToArray$c(_useState3, 2), prismModule = _useState4[0], setPrismModule = _useState4[1];
|
|
949
|
+
var _useState5 = useState(withSyntaxHighlighting), _useState6 = _slicedToArray$c(_useState5, 2), isLoading = _useState6[0], setIsLoading = _useState6[1];
|
|
950
|
+
var _useState7 = useState(null), _useState8 = _slicedToArray$c(_useState7, 2), codeElement = _useState8[0], setCodeElement = _useState8[1];
|
|
951
951
|
var preRef = useRef(null);
|
|
952
952
|
var initialCode = typeof children === "string" ? children : React.Children.toArray(children).join("");
|
|
953
953
|
if (!children) {
|
|
@@ -967,7 +967,7 @@ var CodeBlock = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
967
967
|
return Promise.all([import("prismjs"), language !== "plain" ? import("prismjs/components/prism-".concat(language)) : Promise.resolve()]);
|
|
968
968
|
case 4:
|
|
969
969
|
_yield$Promise$all = _context.sent;
|
|
970
|
-
_yield$Promise$all2 = _slicedToArray$
|
|
970
|
+
_yield$Promise$all2 = _slicedToArray$c(_yield$Promise$all, 1);
|
|
971
971
|
prism = _yield$Promise$all2[0];
|
|
972
972
|
setPrismModule(prism["default"]);
|
|
973
973
|
_context.next = 13;
|
|
@@ -1225,7 +1225,7 @@ var useClickOutside = function useClickOutside2(ref, handler) {
|
|
|
1225
1225
|
};
|
|
1226
1226
|
}, [ref, memoizedHandler]);
|
|
1227
1227
|
};
|
|
1228
|
-
var _excluded$F = ["
|
|
1228
|
+
var _excluded$F = ["id", "children", "position", "size", "padding", "bgColor", "bgColour", "isDismissible", "showOverlay", "blurOverlay", "closeOnClickOutside", "label", "description", "classNames"];
|
|
1229
1229
|
function _extends$G() {
|
|
1230
1230
|
return _extends$G = Object.assign ? Object.assign.bind() : function(n) {
|
|
1231
1231
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -1235,11 +1235,11 @@ function _extends$G() {
|
|
|
1235
1235
|
return n;
|
|
1236
1236
|
}, _extends$G.apply(null, arguments);
|
|
1237
1237
|
}
|
|
1238
|
-
function
|
|
1239
|
-
return
|
|
1238
|
+
function _toConsumableArray$6(r) {
|
|
1239
|
+
return _arrayWithoutHoles$6(r) || _iterableToArray$6(r) || _unsupportedIterableToArray$e(r) || _nonIterableSpread$6();
|
|
1240
1240
|
}
|
|
1241
|
-
function
|
|
1242
|
-
throw new TypeError("Invalid attempt to
|
|
1241
|
+
function _nonIterableSpread$6() {
|
|
1242
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1243
1243
|
}
|
|
1244
1244
|
function _unsupportedIterableToArray$e(r, a) {
|
|
1245
1245
|
if (r) {
|
|
@@ -1248,33 +1248,17 @@ function _unsupportedIterableToArray$e(r, a) {
|
|
|
1248
1248
|
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$e(r, a) : void 0;
|
|
1249
1249
|
}
|
|
1250
1250
|
}
|
|
1251
|
+
function _iterableToArray$6(r) {
|
|
1252
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
1253
|
+
}
|
|
1254
|
+
function _arrayWithoutHoles$6(r) {
|
|
1255
|
+
if (Array.isArray(r)) return _arrayLikeToArray$e(r);
|
|
1256
|
+
}
|
|
1251
1257
|
function _arrayLikeToArray$e(r, a) {
|
|
1252
1258
|
(null == a || a > r.length) && (a = r.length);
|
|
1253
1259
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
1254
1260
|
return n;
|
|
1255
1261
|
}
|
|
1256
|
-
function _iterableToArrayLimit$c(r, l) {
|
|
1257
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
1258
|
-
if (null != t) {
|
|
1259
|
-
var e, n, i, u, a = [], f = true, o = false;
|
|
1260
|
-
try {
|
|
1261
|
-
if (i = (t = t.call(r)).next, 0 === l) ;
|
|
1262
|
-
else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
|
|
1263
|
-
} catch (r2) {
|
|
1264
|
-
o = true, n = r2;
|
|
1265
|
-
} finally {
|
|
1266
|
-
try {
|
|
1267
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
1268
|
-
} finally {
|
|
1269
|
-
if (o) throw n;
|
|
1270
|
-
}
|
|
1271
|
-
}
|
|
1272
|
-
return a;
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
function _arrayWithHoles$c(r) {
|
|
1276
|
-
if (Array.isArray(r)) return r;
|
|
1277
|
-
}
|
|
1278
1262
|
function _objectWithoutProperties$F(e, t) {
|
|
1279
1263
|
if (null == e) return {};
|
|
1280
1264
|
var o, r, i = _objectWithoutPropertiesLoose$F(e, t);
|
|
@@ -1294,78 +1278,123 @@ function _objectWithoutPropertiesLoose$F(r, e) {
|
|
|
1294
1278
|
return t;
|
|
1295
1279
|
}
|
|
1296
1280
|
var Drawer = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
1297
|
-
var
|
|
1298
|
-
var
|
|
1281
|
+
var id = _ref.id, children = _ref.children, _ref$position = _ref.position, position = _ref$position === void 0 ? "right" : _ref$position, _ref$size = _ref.size, size = _ref$size === void 0 ? "medium" : _ref$size, _ref$padding = _ref.padding, padding = _ref$padding === void 0 ? "micro" : _ref$padding, bgColor = _ref.bgColor, bgColour = _ref.bgColour, _ref$isDismissible = _ref.isDismissible, isDismissible = _ref$isDismissible === void 0 ? true : _ref$isDismissible, _ref$showOverlay = _ref.showOverlay, showOverlay = _ref$showOverlay === void 0 ? true : _ref$showOverlay, _ref$blurOverlay = _ref.blurOverlay, blurOverlay = _ref$blurOverlay === void 0 ? false : _ref$blurOverlay, _ref$closeOnClickOuts = _ref.closeOnClickOutside, closeOnClickOutside = _ref$closeOnClickOuts === void 0 ? true : _ref$closeOnClickOuts, label = _ref.label, description = _ref.description, _ref$classNames = _ref.classNames, classNames = _ref$classNames === void 0 ? [] : _ref$classNames, props = _objectWithoutProperties$F(_ref, _excluded$F);
|
|
1282
|
+
var drawerId = "".concat(id);
|
|
1283
|
+
var descriptionId = description ? "".concat(drawerId, "-description") : void 0;
|
|
1299
1284
|
var drawerRef = useRef(null);
|
|
1300
1285
|
var effectiveRef = ref || drawerRef;
|
|
1286
|
+
var drawerClasses = ["drawer", position, size].concat(_toConsumableArray$6(showOverlay ? ["with-overlay"] : []), _toConsumableArray$6(blurOverlay ? ["blur-overlay"] : []), _toConsumableArray$6(classNames));
|
|
1301
1287
|
useEffect(function() {
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1288
|
+
var handleEscape = function handleEscape2(e) {
|
|
1289
|
+
if (e.key === "Escape" && isDismissible) {
|
|
1290
|
+
var drawer = document.querySelector("#".concat(id, "[data-drawer]"));
|
|
1291
|
+
if (drawer !== null && drawer !== void 0 && drawer.classList.contains("open")) {
|
|
1292
|
+
hideDrawer(id);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
};
|
|
1296
|
+
document.addEventListener("keydown", handleEscape);
|
|
1297
|
+
return function() {
|
|
1298
|
+
return document.removeEventListener("keydown", handleEscape);
|
|
1299
|
+
};
|
|
1300
|
+
}, [id, isDismissible]);
|
|
1301
|
+
useClickOutside(effectiveRef, function() {
|
|
1302
|
+
if (closeOnClickOutside && isDismissible) {
|
|
1303
|
+
var drawer = effectiveRef.current;
|
|
1304
|
+
if (drawer !== null && drawer !== void 0 && drawer.classList.contains("open")) {
|
|
1305
|
+
hideDrawer(id);
|
|
1306
|
+
}
|
|
1309
1307
|
}
|
|
1310
|
-
};
|
|
1311
|
-
var classNames = ["drawer"];
|
|
1312
|
-
if (position) {
|
|
1313
|
-
classNames.push(position);
|
|
1314
|
-
}
|
|
1315
|
-
if (openWhen) {
|
|
1316
|
-
classNames.push("open");
|
|
1317
|
-
} else if (shouldRender) {
|
|
1318
|
-
classNames.push("close");
|
|
1319
|
-
}
|
|
1320
|
-
if (size) {
|
|
1321
|
-
classNames.push(size);
|
|
1322
|
-
}
|
|
1323
|
-
var closeDrawer = function closeDrawer2() {
|
|
1324
|
-
return closeWhen === null || closeWhen === void 0 ? void 0 : closeWhen();
|
|
1325
|
-
};
|
|
1326
|
-
useClickOutside(effectiveRef, closeOnClickOutside ? closeDrawer : function() {
|
|
1327
1308
|
});
|
|
1328
|
-
var
|
|
1329
|
-
if (e.
|
|
1330
|
-
|
|
1309
|
+
var handleAnimationEnd = function handleAnimationEnd2(e) {
|
|
1310
|
+
if (e.animationName.includes("slide-out") || e.animationName.includes("fade-out")) {
|
|
1311
|
+
e.currentTarget.classList.remove("closing");
|
|
1331
1312
|
}
|
|
1332
1313
|
};
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1314
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, showOverlay && /* @__PURE__ */ React.createElement(Div, {
|
|
1315
|
+
className: "drawer-overlay ".concat(blurOverlay ? "blur" : ""),
|
|
1316
|
+
"data-drawer-overlay-for": id,
|
|
1317
|
+
"aria-hidden": "true",
|
|
1318
|
+
onClick: closeOnClickOutside && isDismissible ? function() {
|
|
1319
|
+
return hideDrawer(id);
|
|
1320
|
+
} : void 0
|
|
1321
|
+
}), /* @__PURE__ */ React.createElement(Element, _extends$G({
|
|
1337
1322
|
as: "div",
|
|
1323
|
+
id: drawerId,
|
|
1338
1324
|
"data-drawer": true,
|
|
1339
1325
|
ref: effectiveRef,
|
|
1340
|
-
classNames,
|
|
1341
|
-
onAnimationEnd,
|
|
1342
|
-
onKeyDown: handleKeyDown,
|
|
1326
|
+
classNames: drawerClasses,
|
|
1327
|
+
onAnimationEnd: handleAnimationEnd,
|
|
1343
1328
|
role: "dialog",
|
|
1344
1329
|
"aria-modal": "true",
|
|
1345
1330
|
"aria-label": label || "Drawer",
|
|
1331
|
+
"aria-describedby": descriptionId,
|
|
1346
1332
|
tabIndex: -1
|
|
1347
|
-
}, props),
|
|
1348
|
-
className: "rest-of-page-overlay ".concat(openWhen ? "visible" : ""),
|
|
1349
|
-
"aria-hidden": "true",
|
|
1350
|
-
onClick: closeOnClickOutside ? closeDrawer : void 0
|
|
1351
|
-
}), /* @__PURE__ */ React.createElement(Div, {
|
|
1352
|
-
className: "drawer-wrapper"
|
|
1353
|
-
}, /* @__PURE__ */ React.createElement(Div, {
|
|
1354
|
-
className: "drawer-content-wrapper",
|
|
1355
|
-
padding,
|
|
1356
|
-
bgColor,
|
|
1357
|
-
bgColour,
|
|
1358
|
-
role: "document",
|
|
1359
|
-
onClick: handleContentClick
|
|
1360
|
-
}, /* @__PURE__ */ React.createElement(Div, {
|
|
1361
|
-
className: "drawer-inner-content"
|
|
1362
|
-
}, children)), isDismissible && /* @__PURE__ */ React.createElement("button", {
|
|
1333
|
+
}, props), isDismissible && /* @__PURE__ */ React.createElement("button", {
|
|
1363
1334
|
className: "drawer-dismiss-button",
|
|
1364
|
-
onClick:
|
|
1335
|
+
onClick: function onClick() {
|
|
1336
|
+
return hideDrawer(id);
|
|
1337
|
+
},
|
|
1365
1338
|
"aria-label": "Close drawer",
|
|
1366
1339
|
tabIndex: 0
|
|
1367
|
-
})
|
|
1340
|
+
}, "×"), /* @__PURE__ */ React.createElement(Div, {
|
|
1341
|
+
className: "drawer-content",
|
|
1342
|
+
padding,
|
|
1343
|
+
bgColor,
|
|
1344
|
+
bgColour
|
|
1345
|
+
}, description && /* @__PURE__ */ React.createElement("div", {
|
|
1346
|
+
id: descriptionId,
|
|
1347
|
+
className: "sr-only"
|
|
1348
|
+
}, description), /* @__PURE__ */ React.createElement("div", {
|
|
1349
|
+
role: "document"
|
|
1350
|
+
}, children))));
|
|
1368
1351
|
});
|
|
1352
|
+
var showDrawer = function showDrawer2(drawerId) {
|
|
1353
|
+
var drawer = document.querySelector("#".concat(drawerId, "[data-drawer]"));
|
|
1354
|
+
var overlay = document.querySelector('[data-drawer-overlay-for="'.concat(drawerId, '"]'));
|
|
1355
|
+
if (drawer) {
|
|
1356
|
+
drawer.classList.remove("closing");
|
|
1357
|
+
drawer.classList.add("open");
|
|
1358
|
+
if (overlay) {
|
|
1359
|
+
overlay.classList.add("visible");
|
|
1360
|
+
}
|
|
1361
|
+
drawer.focus();
|
|
1362
|
+
var activeElement = document.activeElement;
|
|
1363
|
+
if (activeElement) {
|
|
1364
|
+
drawer.setAttribute("data-trigger-element", activeElement.id || "");
|
|
1365
|
+
}
|
|
1366
|
+
document.body.style.overflow = "hidden";
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
var hideDrawer = function hideDrawer2(drawerId) {
|
|
1370
|
+
var drawer = document.querySelector("#".concat(drawerId, "[data-drawer]"));
|
|
1371
|
+
var overlay = document.querySelector('[data-drawer-overlay-for="'.concat(drawerId, '"]'));
|
|
1372
|
+
if (drawer && drawer.classList.contains("open")) {
|
|
1373
|
+
drawer.classList.add("closing");
|
|
1374
|
+
drawer.classList.remove("open");
|
|
1375
|
+
if (overlay) {
|
|
1376
|
+
overlay.classList.remove("visible");
|
|
1377
|
+
}
|
|
1378
|
+
document.body.style.overflow = "";
|
|
1379
|
+
var triggerId = drawer.getAttribute("data-trigger-element");
|
|
1380
|
+
if (triggerId) {
|
|
1381
|
+
var triggerElement = document.getElementById(triggerId);
|
|
1382
|
+
if (triggerElement) {
|
|
1383
|
+
triggerElement.focus();
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
};
|
|
1388
|
+
var toggleDrawer = function toggleDrawer2(drawerId) {
|
|
1389
|
+
var drawer = document.querySelector("#".concat(drawerId, "[data-drawer]"));
|
|
1390
|
+
if (drawer) {
|
|
1391
|
+
drawer.classList.contains("open") ? hideDrawer(drawerId) : showDrawer(drawerId);
|
|
1392
|
+
}
|
|
1393
|
+
};
|
|
1394
|
+
var isDrawerOpen = function isDrawerOpen2(drawerId) {
|
|
1395
|
+
var drawer = document.querySelector("#".concat(drawerId, "[data-drawer]"));
|
|
1396
|
+
return drawer ? drawer.classList.contains("open") : false;
|
|
1397
|
+
};
|
|
1369
1398
|
var _excluded$E = ["label", "hideLabel", "htmlFor"];
|
|
1370
1399
|
function _extends$F() {
|
|
1371
1400
|
return _extends$F = Object.assign ? Object.assign.bind() : function(n) {
|
|
@@ -3794,7 +3823,7 @@ var Meter = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
3794
3823
|
className: "sr-only"
|
|
3795
3824
|
}, description));
|
|
3796
3825
|
});
|
|
3797
|
-
var _excluded$j = ["
|
|
3826
|
+
var _excluded$j = ["position", "anchor", "order", "children", "label"];
|
|
3798
3827
|
function _extends$j() {
|
|
3799
3828
|
return _extends$j = Object.assign ? Object.assign.bind() : function(n) {
|
|
3800
3829
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -3822,114 +3851,15 @@ function _objectWithoutPropertiesLoose$j(r, e) {
|
|
|
3822
3851
|
}
|
|
3823
3852
|
return t;
|
|
3824
3853
|
}
|
|
3825
|
-
var Modal = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
3826
|
-
var id = _ref.id, children = _ref.children, _ref$classNames = _ref.classNames, classNames = _ref$classNames === void 0 ? [] : _ref$classNames, _ref$isDismissible = _ref.isDismissible, isDismissible = _ref$isDismissible === void 0 ? true : _ref$isDismissible, showBackdrop = _ref.showBackdrop, blurBackdrop = _ref.blurBackdrop, label = _ref.label, description = _ref.description, props = _objectWithoutProperties$j(_ref, _excluded$j);
|
|
3827
|
-
var modalId = "".concat(id);
|
|
3828
|
-
var descriptionId = description ? "".concat(modalId, "-description") : void 0;
|
|
3829
|
-
if (showBackdrop) {
|
|
3830
|
-
classNames.push("show-backdrop");
|
|
3831
|
-
}
|
|
3832
|
-
if (blurBackdrop) {
|
|
3833
|
-
classNames.push("blur-backdrop");
|
|
3834
|
-
}
|
|
3835
|
-
useEffect(function() {
|
|
3836
|
-
var handleEscape = function handleEscape2(e) {
|
|
3837
|
-
if (e.key === "Escape" && isDismissible) {
|
|
3838
|
-
hideModal(id);
|
|
3839
|
-
}
|
|
3840
|
-
};
|
|
3841
|
-
document.addEventListener("keydown", handleEscape);
|
|
3842
|
-
return function() {
|
|
3843
|
-
return document.removeEventListener("keydown", handleEscape);
|
|
3844
|
-
};
|
|
3845
|
-
}, [id, isDismissible]);
|
|
3846
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$j({
|
|
3847
|
-
as: "dialog",
|
|
3848
|
-
id: modalId,
|
|
3849
|
-
"data-modal": true,
|
|
3850
|
-
popover: isDismissible ? "auto" : "manual",
|
|
3851
|
-
ref,
|
|
3852
|
-
classNames,
|
|
3853
|
-
role: "dialog",
|
|
3854
|
-
"aria-modal": "true",
|
|
3855
|
-
"aria-label": label || "Modal dialog",
|
|
3856
|
-
"aria-describedby": descriptionId
|
|
3857
|
-
}, props), isDismissible && /* @__PURE__ */ React.createElement(Text, {
|
|
3858
|
-
className: "dismiss-button",
|
|
3859
|
-
onClick: function onClick() {
|
|
3860
|
-
return hideModal(id);
|
|
3861
|
-
},
|
|
3862
|
-
"aria-label": "Close modal",
|
|
3863
|
-
tabIndex: 0
|
|
3864
|
-
}, "×"), description && /* @__PURE__ */ React.createElement("div", {
|
|
3865
|
-
id: descriptionId,
|
|
3866
|
-
className: "sr-only"
|
|
3867
|
-
}, description), /* @__PURE__ */ React.createElement("div", {
|
|
3868
|
-
role: "document"
|
|
3869
|
-
}, children));
|
|
3870
|
-
});
|
|
3871
|
-
var showModal = function showModal2(modalId) {
|
|
3872
|
-
var modal = document.querySelector("#".concat(modalId, "[data-modal]"));
|
|
3873
|
-
if (modal instanceof HTMLElement) {
|
|
3874
|
-
modal.showPopover();
|
|
3875
|
-
var focusableElements = modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
3876
|
-
if (focusableElements.length) {
|
|
3877
|
-
focusableElements[0].focus();
|
|
3878
|
-
}
|
|
3879
|
-
}
|
|
3880
|
-
};
|
|
3881
|
-
var hideModal = function hideModal2(modalId) {
|
|
3882
|
-
var modal = document.querySelector("#".concat(modalId, "[data-modal]"));
|
|
3883
|
-
if (modal instanceof HTMLElement) {
|
|
3884
|
-
modal.hidePopover();
|
|
3885
|
-
if (document.activeElement instanceof HTMLElement) {
|
|
3886
|
-
document.activeElement.blur();
|
|
3887
|
-
}
|
|
3888
|
-
}
|
|
3889
|
-
};
|
|
3890
|
-
var toggleModal = function toggleModal2(modalId) {
|
|
3891
|
-
var modal = document.querySelector("#".concat(modalId, "[data-modal]"));
|
|
3892
|
-
if (modal instanceof HTMLElement) {
|
|
3893
|
-
modal.matches(":popover-open") ? hideModal(modalId) : showModal(modalId);
|
|
3894
|
-
}
|
|
3895
|
-
};
|
|
3896
|
-
var _excluded$i = ["position", "anchor", "order", "children", "label"];
|
|
3897
|
-
function _extends$i() {
|
|
3898
|
-
return _extends$i = Object.assign ? Object.assign.bind() : function(n) {
|
|
3899
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
3900
|
-
var t = arguments[e];
|
|
3901
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
3902
|
-
}
|
|
3903
|
-
return n;
|
|
3904
|
-
}, _extends$i.apply(null, arguments);
|
|
3905
|
-
}
|
|
3906
|
-
function _objectWithoutProperties$i(e, t) {
|
|
3907
|
-
if (null == e) return {};
|
|
3908
|
-
var o, r, i = _objectWithoutPropertiesLoose$i(e, t);
|
|
3909
|
-
if (Object.getOwnPropertySymbols) {
|
|
3910
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
3911
|
-
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
3912
|
-
}
|
|
3913
|
-
return i;
|
|
3914
|
-
}
|
|
3915
|
-
function _objectWithoutPropertiesLoose$i(r, e) {
|
|
3916
|
-
if (null == r) return {};
|
|
3917
|
-
var t = {};
|
|
3918
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
3919
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
3920
|
-
t[n] = r[n];
|
|
3921
|
-
}
|
|
3922
|
-
return t;
|
|
3923
|
-
}
|
|
3924
3854
|
var NotificationsWrapper = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
3925
|
-
var _ref$position = _ref.position, position = _ref$position === void 0 ? "right" : _ref$position, _ref$anchor = _ref.anchor, anchor = _ref$anchor === void 0 ? "top" : _ref$anchor, _ref$order = _ref.order, order = _ref$order === void 0 ? "new-on-top" : _ref$order, children = _ref.children, label = _ref.label, props = _objectWithoutProperties$
|
|
3855
|
+
var _ref$position = _ref.position, position = _ref$position === void 0 ? "right" : _ref$position, _ref$anchor = _ref.anchor, anchor = _ref$anchor === void 0 ? "top" : _ref$anchor, _ref$order = _ref.order, order = _ref$order === void 0 ? "new-on-top" : _ref$order, children = _ref.children, label = _ref.label, props = _objectWithoutProperties$j(_ref, _excluded$j);
|
|
3926
3856
|
var classNames = [];
|
|
3927
3857
|
if (position) classNames.push(position);
|
|
3928
3858
|
if (anchor) classNames.push(anchor);
|
|
3929
3859
|
if (order) classNames.push(order);
|
|
3930
3860
|
var childrenCount = React.Children.count(children);
|
|
3931
3861
|
if (childrenCount === 0) return null;
|
|
3932
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
3862
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$j({
|
|
3933
3863
|
as: "section",
|
|
3934
3864
|
"data-notifications-wrapper": true,
|
|
3935
3865
|
ref,
|
|
@@ -3939,15 +3869,15 @@ var NotificationsWrapper = /* @__PURE__ */ React.forwardRef(function(_ref, ref)
|
|
|
3939
3869
|
role: "log"
|
|
3940
3870
|
}, props), children);
|
|
3941
3871
|
});
|
|
3942
|
-
var _excluded$
|
|
3943
|
-
function _extends$
|
|
3944
|
-
return _extends$
|
|
3872
|
+
var _excluded$i = ["showWhen", "closeWhen", "kind", "children", "isDismissible", "secondsToShowFor", "title", "description"];
|
|
3873
|
+
function _extends$i() {
|
|
3874
|
+
return _extends$i = Object.assign ? Object.assign.bind() : function(n) {
|
|
3945
3875
|
for (var e = 1; e < arguments.length; e++) {
|
|
3946
3876
|
var t = arguments[e];
|
|
3947
3877
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
3948
3878
|
}
|
|
3949
3879
|
return n;
|
|
3950
|
-
}, _extends$
|
|
3880
|
+
}, _extends$i.apply(null, arguments);
|
|
3951
3881
|
}
|
|
3952
3882
|
function _slicedToArray$6(r, e) {
|
|
3953
3883
|
return _arrayWithHoles$6(r) || _iterableToArrayLimit$6(r, e) || _unsupportedIterableToArray$8(r, e) || _nonIterableRest$6();
|
|
@@ -3989,16 +3919,16 @@ function _iterableToArrayLimit$6(r, l) {
|
|
|
3989
3919
|
function _arrayWithHoles$6(r) {
|
|
3990
3920
|
if (Array.isArray(r)) return r;
|
|
3991
3921
|
}
|
|
3992
|
-
function _objectWithoutProperties$
|
|
3922
|
+
function _objectWithoutProperties$i(e, t) {
|
|
3993
3923
|
if (null == e) return {};
|
|
3994
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
3924
|
+
var o, r, i = _objectWithoutPropertiesLoose$i(e, t);
|
|
3995
3925
|
if (Object.getOwnPropertySymbols) {
|
|
3996
3926
|
var n = Object.getOwnPropertySymbols(e);
|
|
3997
3927
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
3998
3928
|
}
|
|
3999
3929
|
return i;
|
|
4000
3930
|
}
|
|
4001
|
-
function _objectWithoutPropertiesLoose$
|
|
3931
|
+
function _objectWithoutPropertiesLoose$i(r, e) {
|
|
4002
3932
|
if (null == r) return {};
|
|
4003
3933
|
var t = {};
|
|
4004
3934
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -4008,7 +3938,7 @@ function _objectWithoutPropertiesLoose$h(r, e) {
|
|
|
4008
3938
|
return t;
|
|
4009
3939
|
}
|
|
4010
3940
|
var NotificationItem = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
4011
|
-
var showWhen = _ref.showWhen, closeWhen = _ref.closeWhen, _ref$kind = _ref.kind, kind = _ref$kind === void 0 ? "info" : _ref$kind, children = _ref.children, isDismissible = _ref.isDismissible, secondsToShowFor = _ref.secondsToShowFor, title = _ref.title, description = _ref.description, props = _objectWithoutProperties$
|
|
3941
|
+
var showWhen = _ref.showWhen, closeWhen = _ref.closeWhen, _ref$kind = _ref.kind, kind = _ref$kind === void 0 ? "info" : _ref$kind, children = _ref.children, isDismissible = _ref.isDismissible, secondsToShowFor = _ref.secondsToShowFor, title = _ref.title, description = _ref.description, props = _objectWithoutProperties$i(_ref, _excluded$i);
|
|
4012
3942
|
var classNames = [];
|
|
4013
3943
|
var _useState = useState(showWhen), _useState2 = _slicedToArray$6(_useState, 2), isVisible = _useState2[0], setIsVisible = _useState2[1];
|
|
4014
3944
|
useEffect(function() {
|
|
@@ -4047,7 +3977,7 @@ var NotificationItem = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
4047
3977
|
error: "alert",
|
|
4048
3978
|
success: "status"
|
|
4049
3979
|
};
|
|
4050
|
-
return isVisible && /* @__PURE__ */ React.createElement(Element, _extends$
|
|
3980
|
+
return isVisible && /* @__PURE__ */ React.createElement(Element, _extends$i({
|
|
4051
3981
|
as: "div",
|
|
4052
3982
|
"data-notification-item": true,
|
|
4053
3983
|
ref,
|
|
@@ -4071,331 +4001,26 @@ var NotificationItem = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
4071
4001
|
className: "sr-only"
|
|
4072
4002
|
}, "Close notification")));
|
|
4073
4003
|
});
|
|
4074
|
-
var _excluded$
|
|
4075
|
-
function _extends$
|
|
4076
|
-
return _extends$
|
|
4004
|
+
var _excluded$h = ["size", "loadingText"];
|
|
4005
|
+
function _extends$h() {
|
|
4006
|
+
return _extends$h = Object.assign ? Object.assign.bind() : function(n) {
|
|
4077
4007
|
for (var e = 1; e < arguments.length; e++) {
|
|
4078
4008
|
var t = arguments[e];
|
|
4079
4009
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
4080
4010
|
}
|
|
4081
4011
|
return n;
|
|
4082
|
-
}, _extends$
|
|
4083
|
-
}
|
|
4084
|
-
function _slicedToArray$5(r, e) {
|
|
4085
|
-
return _arrayWithHoles$5(r) || _iterableToArrayLimit$5(r, e) || _unsupportedIterableToArray$7(r, e) || _nonIterableRest$5();
|
|
4086
|
-
}
|
|
4087
|
-
function _nonIterableRest$5() {
|
|
4088
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4089
|
-
}
|
|
4090
|
-
function _unsupportedIterableToArray$7(r, a) {
|
|
4091
|
-
if (r) {
|
|
4092
|
-
if ("string" == typeof r) return _arrayLikeToArray$7(r, a);
|
|
4093
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
4094
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$7(r, a) : void 0;
|
|
4095
|
-
}
|
|
4096
|
-
}
|
|
4097
|
-
function _arrayLikeToArray$7(r, a) {
|
|
4098
|
-
(null == a || a > r.length) && (a = r.length);
|
|
4099
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
4100
|
-
return n;
|
|
4101
|
-
}
|
|
4102
|
-
function _iterableToArrayLimit$5(r, l) {
|
|
4103
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
4104
|
-
if (null != t) {
|
|
4105
|
-
var e, n, i, u, a = [], f = true, o = false;
|
|
4106
|
-
try {
|
|
4107
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
4108
|
-
if (Object(t) !== t) return;
|
|
4109
|
-
f = false;
|
|
4110
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
|
|
4111
|
-
} catch (r2) {
|
|
4112
|
-
o = true, n = r2;
|
|
4113
|
-
} finally {
|
|
4114
|
-
try {
|
|
4115
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
4116
|
-
} finally {
|
|
4117
|
-
if (o) throw n;
|
|
4118
|
-
}
|
|
4119
|
-
}
|
|
4120
|
-
return a;
|
|
4121
|
-
}
|
|
4122
|
-
}
|
|
4123
|
-
function _arrayWithHoles$5(r) {
|
|
4124
|
-
if (Array.isArray(r)) return r;
|
|
4012
|
+
}, _extends$h.apply(null, arguments);
|
|
4125
4013
|
}
|
|
4126
|
-
function _objectWithoutProperties$
|
|
4014
|
+
function _objectWithoutProperties$h(e, t) {
|
|
4127
4015
|
if (null == e) return {};
|
|
4128
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
4016
|
+
var o, r, i = _objectWithoutPropertiesLoose$h(e, t);
|
|
4129
4017
|
if (Object.getOwnPropertySymbols) {
|
|
4130
4018
|
var n = Object.getOwnPropertySymbols(e);
|
|
4131
4019
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
4132
4020
|
}
|
|
4133
4021
|
return i;
|
|
4134
4022
|
}
|
|
4135
|
-
function _objectWithoutPropertiesLoose$
|
|
4136
|
-
if (null == r) return {};
|
|
4137
|
-
var t = {};
|
|
4138
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
4139
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
4140
|
-
t[n] = r[n];
|
|
4141
|
-
}
|
|
4142
|
-
return t;
|
|
4143
|
-
}
|
|
4144
|
-
var OptionCardsContext = /* @__PURE__ */ createContext({
|
|
4145
|
-
isSelected: function isSelected() {
|
|
4146
|
-
return false;
|
|
4147
|
-
},
|
|
4148
|
-
toggleSelection: function toggleSelection() {
|
|
4149
|
-
},
|
|
4150
|
-
showTickIcon: false,
|
|
4151
|
-
tickPosition: "top-right",
|
|
4152
|
-
selectAllOptions: function selectAllOptions() {
|
|
4153
|
-
},
|
|
4154
|
-
clearAllOptions: function clearAllOptions() {
|
|
4155
|
-
},
|
|
4156
|
-
setSelectedOptions: function setSelectedOptions() {
|
|
4157
|
-
},
|
|
4158
|
-
setSelectedIds: function setSelectedIds() {
|
|
4159
|
-
},
|
|
4160
|
-
registerOption: function registerOption() {
|
|
4161
|
-
},
|
|
4162
|
-
unregisterOption: function unregisterOption() {
|
|
4163
|
-
}
|
|
4164
|
-
});
|
|
4165
|
-
var OptionCardsGroup = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
4166
|
-
var children = _ref.children, _ref$allowMultipleSel = _ref.allowMultipleSelections, allowMultipleSelections = _ref$allowMultipleSel === void 0 ? false : _ref$allowMultipleSel, showTickIcon = _ref.showTickIcon, onSelectionChange = _ref.onSelectionChange, _ref$tickPosition = _ref.tickPosition, tickPosition = _ref$tickPosition === void 0 ? "top-right" : _ref$tickPosition, selectionLimit = _ref.selectionLimit, defaultSelectedIds = _ref.defaultSelectedIds;
|
|
4167
|
-
_objectWithoutProperties$g(_ref, _excluded$g);
|
|
4168
|
-
var _useState = useState(defaultSelectedIds ? new Set(defaultSelectedIds) : /* @__PURE__ */ new Set()), _useState2 = _slicedToArray$5(_useState, 2), selectedIds = _useState2[0], setSelectedIds2 = _useState2[1];
|
|
4169
|
-
var availableOptionsRef = useRef(/* @__PURE__ */ new Map());
|
|
4170
|
-
useEffect(function() {
|
|
4171
|
-
if (defaultSelectedIds && defaultSelectedIds.size > 0) {
|
|
4172
|
-
setSelectedIds2(new Set(defaultSelectedIds));
|
|
4173
|
-
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange(new Set(defaultSelectedIds));
|
|
4174
|
-
}
|
|
4175
|
-
}, [defaultSelectedIds, onSelectionChange]);
|
|
4176
|
-
var registerOption2 = useCallback(function(id, disabled) {
|
|
4177
|
-
availableOptionsRef.current.set(id, disabled);
|
|
4178
|
-
}, []);
|
|
4179
|
-
var unregisterOption2 = useCallback(function(id) {
|
|
4180
|
-
availableOptionsRef.current["delete"](id);
|
|
4181
|
-
}, []);
|
|
4182
|
-
var toggleSelection2 = useCallback(function(id) {
|
|
4183
|
-
setSelectedIds2(function(prevSelectedIds) {
|
|
4184
|
-
var newSelectedIds = new Set(prevSelectedIds);
|
|
4185
|
-
if (allowMultipleSelections) {
|
|
4186
|
-
if (newSelectedIds.has(id)) {
|
|
4187
|
-
newSelectedIds["delete"](id);
|
|
4188
|
-
} else {
|
|
4189
|
-
if (selectionLimit && newSelectedIds.size >= selectionLimit) {
|
|
4190
|
-
return prevSelectedIds;
|
|
4191
|
-
}
|
|
4192
|
-
newSelectedIds.add(id);
|
|
4193
|
-
}
|
|
4194
|
-
} else {
|
|
4195
|
-
if (newSelectedIds.has(id) && prevSelectedIds.size === 1) {
|
|
4196
|
-
newSelectedIds.clear();
|
|
4197
|
-
} else {
|
|
4198
|
-
newSelectedIds.clear();
|
|
4199
|
-
newSelectedIds.add(id);
|
|
4200
|
-
}
|
|
4201
|
-
}
|
|
4202
|
-
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange(newSelectedIds);
|
|
4203
|
-
return newSelectedIds;
|
|
4204
|
-
});
|
|
4205
|
-
}, [allowMultipleSelections, onSelectionChange, selectionLimit]);
|
|
4206
|
-
var selectAllOptions2 = useCallback(function() {
|
|
4207
|
-
if (!allowMultipleSelections) return;
|
|
4208
|
-
setSelectedIds2(function(prevSelectedIds) {
|
|
4209
|
-
var newSelectedIds = new Set(prevSelectedIds);
|
|
4210
|
-
var enabledOptions = Array.from(availableOptionsRef.current.entries()).filter(function(_ref2) {
|
|
4211
|
-
var _ref3 = _slicedToArray$5(_ref2, 2);
|
|
4212
|
-
_ref3[0];
|
|
4213
|
-
var disabled = _ref3[1];
|
|
4214
|
-
return !disabled;
|
|
4215
|
-
}).map(function(_ref4) {
|
|
4216
|
-
var _ref5 = _slicedToArray$5(_ref4, 1), id = _ref5[0];
|
|
4217
|
-
return id;
|
|
4218
|
-
});
|
|
4219
|
-
var optionsToAdd = selectionLimit ? enabledOptions.slice(0, selectionLimit) : enabledOptions;
|
|
4220
|
-
optionsToAdd.forEach(function(id) {
|
|
4221
|
-
return newSelectedIds.add(id);
|
|
4222
|
-
});
|
|
4223
|
-
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange(newSelectedIds);
|
|
4224
|
-
return newSelectedIds;
|
|
4225
|
-
});
|
|
4226
|
-
}, [allowMultipleSelections, selectionLimit, onSelectionChange]);
|
|
4227
|
-
var clearAllOptions2 = useCallback(function() {
|
|
4228
|
-
setSelectedIds2(/* @__PURE__ */ new Set());
|
|
4229
|
-
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange(/* @__PURE__ */ new Set());
|
|
4230
|
-
}, [onSelectionChange]);
|
|
4231
|
-
var setSelectedOptions2 = useCallback(function(ids) {
|
|
4232
|
-
if (ids) {
|
|
4233
|
-
console.log("Setting selected options:", ids);
|
|
4234
|
-
setSelectedIds2(function() {
|
|
4235
|
-
var newSet = new Set(ids);
|
|
4236
|
-
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange(newSet);
|
|
4237
|
-
return newSet;
|
|
4238
|
-
});
|
|
4239
|
-
}
|
|
4240
|
-
}, [onSelectionChange]);
|
|
4241
|
-
var setSelectedIdSet = useCallback(function(ids) {
|
|
4242
|
-
if (ids) {
|
|
4243
|
-
console.log("Setting selected ids:", Array.from(ids));
|
|
4244
|
-
setSelectedIds2(function() {
|
|
4245
|
-
var newSet = new Set(ids);
|
|
4246
|
-
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange(newSet);
|
|
4247
|
-
return newSet;
|
|
4248
|
-
});
|
|
4249
|
-
}
|
|
4250
|
-
}, [onSelectionChange]);
|
|
4251
|
-
var isSelected2 = useCallback(function(id) {
|
|
4252
|
-
return selectedIds.has(id);
|
|
4253
|
-
}, [selectedIds]);
|
|
4254
|
-
React.useImperativeHandle(ref, function() {
|
|
4255
|
-
return {
|
|
4256
|
-
selectAllOptions: selectAllOptions2,
|
|
4257
|
-
clearAllOptions: clearAllOptions2,
|
|
4258
|
-
setSelectedOptions: setSelectedOptions2,
|
|
4259
|
-
setSelectedIds: setSelectedIdSet
|
|
4260
|
-
};
|
|
4261
|
-
}, [selectAllOptions2, clearAllOptions2, setSelectedOptions2, setSelectedIdSet]);
|
|
4262
|
-
var contextValue = {
|
|
4263
|
-
isSelected: isSelected2,
|
|
4264
|
-
toggleSelection: toggleSelection2,
|
|
4265
|
-
showTickIcon,
|
|
4266
|
-
tickPosition,
|
|
4267
|
-
selectAllOptions: selectAllOptions2,
|
|
4268
|
-
clearAllOptions: clearAllOptions2,
|
|
4269
|
-
setSelectedOptions: setSelectedOptions2,
|
|
4270
|
-
setSelectedIds: setSelectedIdSet,
|
|
4271
|
-
registerOption: registerOption2,
|
|
4272
|
-
unregisterOption: unregisterOption2
|
|
4273
|
-
};
|
|
4274
|
-
return /* @__PURE__ */ React.createElement(OptionCardsContext.Provider, {
|
|
4275
|
-
value: contextValue
|
|
4276
|
-
}, /* @__PURE__ */ React.createElement(Div, {
|
|
4277
|
-
"data-option-cards-group": true,
|
|
4278
|
-
className: "tick-".concat(tickPosition)
|
|
4279
|
-
}, children));
|
|
4280
|
-
});
|
|
4281
|
-
var useOptionCard = function useOptionCard2(id) {
|
|
4282
|
-
var context = useContext(OptionCardsContext);
|
|
4283
|
-
return {
|
|
4284
|
-
isSelected: context.isSelected(id),
|
|
4285
|
-
toggleSelection: function toggleSelection2() {
|
|
4286
|
-
return context.toggleSelection(id);
|
|
4287
|
-
},
|
|
4288
|
-
showTickIcon: context.showTickIcon
|
|
4289
|
-
};
|
|
4290
|
-
};
|
|
4291
|
-
var useOptionCardsGroup = function useOptionCardsGroup2() {
|
|
4292
|
-
var _useContext = useContext(OptionCardsContext), selectAllOptions2 = _useContext.selectAllOptions, clearAllOptions2 = _useContext.clearAllOptions, setSelectedOptions2 = _useContext.setSelectedOptions, setSelectedIds2 = _useContext.setSelectedIds;
|
|
4293
|
-
return {
|
|
4294
|
-
selectAllOptions: selectAllOptions2,
|
|
4295
|
-
clearAllOptions: clearAllOptions2,
|
|
4296
|
-
setSelectedOptions: setSelectedOptions2,
|
|
4297
|
-
setSelectedIds: setSelectedIds2
|
|
4298
|
-
};
|
|
4299
|
-
};
|
|
4300
|
-
var OptionCard = function OptionCard2(_ref6) {
|
|
4301
|
-
var id = _ref6.id, children = _ref6.children, _ref6$disabled = _ref6.disabled, disabled = _ref6$disabled === void 0 ? false : _ref6$disabled, props = _objectWithoutProperties$g(_ref6, _excluded2$2);
|
|
4302
|
-
var _useContext2 = useContext(OptionCardsContext), isSelected2 = _useContext2.isSelected, toggleSelection2 = _useContext2.toggleSelection, showTickIcon = _useContext2.showTickIcon, registerOption2 = _useContext2.registerOption, unregisterOption2 = _useContext2.unregisterOption;
|
|
4303
|
-
var _useState3 = useState(false), _useState4 = _slicedToArray$5(_useState3, 2), showDeselect = _useState4[0], setShowDeselect = _useState4[1];
|
|
4304
|
-
var _useState5 = useState(true), _useState6 = _slicedToArray$5(_useState5, 2), isInitialHover = _useState6[0], setIsInitialHover = _useState6[1];
|
|
4305
|
-
React.useEffect(function() {
|
|
4306
|
-
registerOption2(id, disabled);
|
|
4307
|
-
return function() {
|
|
4308
|
-
return unregisterOption2(id);
|
|
4309
|
-
};
|
|
4310
|
-
}, [id, disabled, registerOption2, unregisterOption2]);
|
|
4311
|
-
var classNames = [];
|
|
4312
|
-
if (isSelected2(id)) {
|
|
4313
|
-
classNames.push("selected");
|
|
4314
|
-
}
|
|
4315
|
-
if (disabled) {
|
|
4316
|
-
classNames.push("disabled");
|
|
4317
|
-
}
|
|
4318
|
-
if (showDeselect) {
|
|
4319
|
-
classNames.push("show-deselect");
|
|
4320
|
-
}
|
|
4321
|
-
var handleMouseEnter = function handleMouseEnter2() {
|
|
4322
|
-
if (isSelected2(id) && !isInitialHover) {
|
|
4323
|
-
setShowDeselect(true);
|
|
4324
|
-
}
|
|
4325
|
-
};
|
|
4326
|
-
var handleMouseLeave = function handleMouseLeave2() {
|
|
4327
|
-
setShowDeselect(false);
|
|
4328
|
-
setIsInitialHover(false);
|
|
4329
|
-
};
|
|
4330
|
-
var handleClick = function handleClick2(e) {
|
|
4331
|
-
if (!disabled) {
|
|
4332
|
-
var _props$onClick;
|
|
4333
|
-
setIsInitialHover(true);
|
|
4334
|
-
setShowDeselect(false);
|
|
4335
|
-
toggleSelection2(id);
|
|
4336
|
-
(_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, e);
|
|
4337
|
-
}
|
|
4338
|
-
};
|
|
4339
|
-
var handleKeyDown = function handleKeyDown2(e) {
|
|
4340
|
-
if ((e.key === "Enter" || e.key === " ") && !disabled) {
|
|
4341
|
-
e.preventDefault();
|
|
4342
|
-
setIsInitialHover(true);
|
|
4343
|
-
setShowDeselect(false);
|
|
4344
|
-
toggleSelection2(id);
|
|
4345
|
-
}
|
|
4346
|
-
};
|
|
4347
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$g({
|
|
4348
|
-
as: Card,
|
|
4349
|
-
"data-option-card": true,
|
|
4350
|
-
role: "button",
|
|
4351
|
-
tabIndex: disabled ? -1 : 0,
|
|
4352
|
-
"aria-disabled": disabled ? "true" : "false",
|
|
4353
|
-
"aria-selected": isSelected2(id) ? "true" : "false",
|
|
4354
|
-
classNames,
|
|
4355
|
-
onClick: handleClick,
|
|
4356
|
-
onKeyDown: handleKeyDown,
|
|
4357
|
-
onMouseEnter: handleMouseEnter,
|
|
4358
|
-
onMouseLeave: handleMouseLeave
|
|
4359
|
-
}, props), showTickIcon && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("svg", {
|
|
4360
|
-
viewBox: "0 0 24 24",
|
|
4361
|
-
className: "tick-icon"
|
|
4362
|
-
}, /* @__PURE__ */ React.createElement("circle", {
|
|
4363
|
-
cx: "12",
|
|
4364
|
-
cy: "12",
|
|
4365
|
-
r: "11"
|
|
4366
|
-
}), /* @__PURE__ */ React.createElement("path", {
|
|
4367
|
-
d: "M8 13 L11 15 L16 9"
|
|
4368
|
-
})), /* @__PURE__ */ React.createElement("svg", {
|
|
4369
|
-
viewBox: "0 0 24 24",
|
|
4370
|
-
className: "deselect-icon"
|
|
4371
|
-
}, /* @__PURE__ */ React.createElement("circle", {
|
|
4372
|
-
cx: "12",
|
|
4373
|
-
cy: "12",
|
|
4374
|
-
r: "11"
|
|
4375
|
-
}), /* @__PURE__ */ React.createElement("path", {
|
|
4376
|
-
d: "M8 8 L16 16 M16 8 L8 16"
|
|
4377
|
-
}))), children);
|
|
4378
|
-
};
|
|
4379
|
-
var _excluded$f = ["size", "loadingText"];
|
|
4380
|
-
function _extends$f() {
|
|
4381
|
-
return _extends$f = Object.assign ? Object.assign.bind() : function(n) {
|
|
4382
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
4383
|
-
var t = arguments[e];
|
|
4384
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
4385
|
-
}
|
|
4386
|
-
return n;
|
|
4387
|
-
}, _extends$f.apply(null, arguments);
|
|
4388
|
-
}
|
|
4389
|
-
function _objectWithoutProperties$f(e, t) {
|
|
4390
|
-
if (null == e) return {};
|
|
4391
|
-
var o, r, i = _objectWithoutPropertiesLoose$f(e, t);
|
|
4392
|
-
if (Object.getOwnPropertySymbols) {
|
|
4393
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
4394
|
-
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
4395
|
-
}
|
|
4396
|
-
return i;
|
|
4397
|
-
}
|
|
4398
|
-
function _objectWithoutPropertiesLoose$f(r, e) {
|
|
4023
|
+
function _objectWithoutPropertiesLoose$h(r, e) {
|
|
4399
4024
|
if (null == r) return {};
|
|
4400
4025
|
var t = {};
|
|
4401
4026
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -4405,12 +4030,12 @@ function _objectWithoutPropertiesLoose$f(r, e) {
|
|
|
4405
4030
|
return t;
|
|
4406
4031
|
}
|
|
4407
4032
|
var Spinner = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
4408
|
-
var _ref$size = _ref.size, size = _ref$size === void 0 ? "medium" : _ref$size, _ref$loadingText = _ref.loadingText, loadingText = _ref$loadingText === void 0 ? "Loading..." : _ref$loadingText, props = _objectWithoutProperties$
|
|
4033
|
+
var _ref$size = _ref.size, size = _ref$size === void 0 ? "medium" : _ref$size, _ref$loadingText = _ref.loadingText, loadingText = _ref$loadingText === void 0 ? "Loading..." : _ref$loadingText, props = _objectWithoutProperties$h(_ref, _excluded$h);
|
|
4409
4034
|
var classNames = [];
|
|
4410
4035
|
if (size) {
|
|
4411
4036
|
classNames.push("size-".concat(size));
|
|
4412
4037
|
}
|
|
4413
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
4038
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$h({
|
|
4414
4039
|
as: "div",
|
|
4415
4040
|
"data-spinner": true,
|
|
4416
4041
|
ref,
|
|
@@ -4422,25 +4047,25 @@ var Spinner = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
4422
4047
|
}, props));
|
|
4423
4048
|
});
|
|
4424
4049
|
function _toConsumableArray$1(r) {
|
|
4425
|
-
return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$
|
|
4050
|
+
return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$7(r) || _nonIterableSpread$1();
|
|
4426
4051
|
}
|
|
4427
4052
|
function _nonIterableSpread$1() {
|
|
4428
4053
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4429
4054
|
}
|
|
4430
|
-
function _unsupportedIterableToArray$
|
|
4055
|
+
function _unsupportedIterableToArray$7(r, a) {
|
|
4431
4056
|
if (r) {
|
|
4432
|
-
if ("string" == typeof r) return _arrayLikeToArray$
|
|
4057
|
+
if ("string" == typeof r) return _arrayLikeToArray$7(r, a);
|
|
4433
4058
|
var t = {}.toString.call(r).slice(8, -1);
|
|
4434
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$
|
|
4059
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$7(r, a) : void 0;
|
|
4435
4060
|
}
|
|
4436
4061
|
}
|
|
4437
4062
|
function _iterableToArray$1(r) {
|
|
4438
4063
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
4439
4064
|
}
|
|
4440
4065
|
function _arrayWithoutHoles$1(r) {
|
|
4441
|
-
if (Array.isArray(r)) return _arrayLikeToArray$
|
|
4066
|
+
if (Array.isArray(r)) return _arrayLikeToArray$7(r);
|
|
4442
4067
|
}
|
|
4443
|
-
function _arrayLikeToArray$
|
|
4068
|
+
function _arrayLikeToArray$7(r, a) {
|
|
4444
4069
|
(null == a || a > r.length) && (a = r.length);
|
|
4445
4070
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
4446
4071
|
return n;
|
|
@@ -4498,26 +4123,26 @@ function _typeof$1(o) {
|
|
|
4498
4123
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
4499
4124
|
}, _typeof$1(o);
|
|
4500
4125
|
}
|
|
4501
|
-
var _excluded$
|
|
4502
|
-
function _slicedToArray$
|
|
4503
|
-
return _arrayWithHoles$
|
|
4126
|
+
var _excluded$g = ["type", "page", "selected", "disabled", "onClick", "key"], _excluded2$2 = ["totalItems", "currentPage", "onPageChange", "itemsToShowEachSide", "kind", "showGoToFirstItemButton", "showGoToLastItemButton", "showPreviousButton", "showNextButton", "showGoToInput", "disabled", "hideDisabledButtons", "renderItem", "isLoading", "loadingText", "emptyText", "itemDisplayText"];
|
|
4127
|
+
function _slicedToArray$5(r, e) {
|
|
4128
|
+
return _arrayWithHoles$5(r) || _iterableToArrayLimit$5(r, e) || _unsupportedIterableToArray$6(r, e) || _nonIterableRest$5();
|
|
4504
4129
|
}
|
|
4505
|
-
function _nonIterableRest$
|
|
4130
|
+
function _nonIterableRest$5() {
|
|
4506
4131
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4507
4132
|
}
|
|
4508
|
-
function _unsupportedIterableToArray$
|
|
4133
|
+
function _unsupportedIterableToArray$6(r, a) {
|
|
4509
4134
|
if (r) {
|
|
4510
|
-
if ("string" == typeof r) return _arrayLikeToArray$
|
|
4135
|
+
if ("string" == typeof r) return _arrayLikeToArray$6(r, a);
|
|
4511
4136
|
var t = {}.toString.call(r).slice(8, -1);
|
|
4512
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$
|
|
4137
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$6(r, a) : void 0;
|
|
4513
4138
|
}
|
|
4514
4139
|
}
|
|
4515
|
-
function _arrayLikeToArray$
|
|
4140
|
+
function _arrayLikeToArray$6(r, a) {
|
|
4516
4141
|
(null == a || a > r.length) && (a = r.length);
|
|
4517
4142
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
4518
4143
|
return n;
|
|
4519
4144
|
}
|
|
4520
|
-
function _iterableToArrayLimit$
|
|
4145
|
+
function _iterableToArrayLimit$5(r, l) {
|
|
4521
4146
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
4522
4147
|
if (null != t) {
|
|
4523
4148
|
var e, n, i, u, a = [], f = true, o = false;
|
|
@@ -4536,17 +4161,17 @@ function _iterableToArrayLimit$4(r, l) {
|
|
|
4536
4161
|
return a;
|
|
4537
4162
|
}
|
|
4538
4163
|
}
|
|
4539
|
-
function _arrayWithHoles$
|
|
4164
|
+
function _arrayWithHoles$5(r) {
|
|
4540
4165
|
if (Array.isArray(r)) return r;
|
|
4541
4166
|
}
|
|
4542
|
-
function _extends$
|
|
4543
|
-
return _extends$
|
|
4167
|
+
function _extends$g() {
|
|
4168
|
+
return _extends$g = Object.assign ? Object.assign.bind() : function(n) {
|
|
4544
4169
|
for (var e = 1; e < arguments.length; e++) {
|
|
4545
4170
|
var t = arguments[e];
|
|
4546
4171
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
4547
4172
|
}
|
|
4548
4173
|
return n;
|
|
4549
|
-
}, _extends$
|
|
4174
|
+
}, _extends$g.apply(null, arguments);
|
|
4550
4175
|
}
|
|
4551
4176
|
function ownKeys$1(e, r) {
|
|
4552
4177
|
var t = Object.keys(e);
|
|
@@ -4586,16 +4211,16 @@ function _toPrimitive$1(t, r) {
|
|
|
4586
4211
|
}
|
|
4587
4212
|
return ("string" === r ? String : Number)(t);
|
|
4588
4213
|
}
|
|
4589
|
-
function _objectWithoutProperties$
|
|
4214
|
+
function _objectWithoutProperties$g(e, t) {
|
|
4590
4215
|
if (null == e) return {};
|
|
4591
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
4216
|
+
var o, r, i = _objectWithoutPropertiesLoose$g(e, t);
|
|
4592
4217
|
if (Object.getOwnPropertySymbols) {
|
|
4593
4218
|
var n = Object.getOwnPropertySymbols(e);
|
|
4594
4219
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
4595
4220
|
}
|
|
4596
4221
|
return i;
|
|
4597
4222
|
}
|
|
4598
|
-
function _objectWithoutPropertiesLoose$
|
|
4223
|
+
function _objectWithoutPropertiesLoose$g(r, e) {
|
|
4599
4224
|
if (null == r) return {};
|
|
4600
4225
|
var t = {};
|
|
4601
4226
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -4607,7 +4232,7 @@ function _objectWithoutPropertiesLoose$e(r, e) {
|
|
|
4607
4232
|
var defaultRenderItem = function defaultRenderItem2(_ref) {
|
|
4608
4233
|
var type = _ref.type, page = _ref.page, selected = _ref.selected, disabled = _ref.disabled, onClick = _ref.onClick;
|
|
4609
4234
|
_ref.key;
|
|
4610
|
-
var props = _objectWithoutProperties$
|
|
4235
|
+
var props = _objectWithoutProperties$g(_ref, _excluded$g);
|
|
4611
4236
|
if (type === "ellipsis") {
|
|
4612
4237
|
return /* @__PURE__ */ React.createElement(Text, {
|
|
4613
4238
|
className: "pagination-ellipsis"
|
|
@@ -4682,18 +4307,18 @@ var defaultRenderItem = function defaultRenderItem2(_ref) {
|
|
|
4682
4307
|
default:
|
|
4683
4308
|
content = page;
|
|
4684
4309
|
}
|
|
4685
|
-
return /* @__PURE__ */ React.createElement(Button, _extends$
|
|
4310
|
+
return /* @__PURE__ */ React.createElement(Button, _extends$g({
|
|
4686
4311
|
kind: "custom"
|
|
4687
4312
|
}, paginationItemProps), content);
|
|
4688
4313
|
};
|
|
4689
4314
|
var Pagination = /* @__PURE__ */ React.forwardRef(function(_ref2, ref) {
|
|
4690
|
-
var totalItems = _ref2.totalItems, currentPage = _ref2.currentPage, onPageChange = _ref2.onPageChange, _ref2$itemsToShowEach = _ref2.itemsToShowEachSide, itemsToShowEachSide = _ref2$itemsToShowEach === void 0 ? 1 : _ref2$itemsToShowEach, _ref2$kind = _ref2.kind, kind = _ref2$kind === void 0 ? "plain" : _ref2$kind, _ref2$showGoToFirstIt = _ref2.showGoToFirstItemButton, showGoToFirstItemButton = _ref2$showGoToFirstIt === void 0 ? true : _ref2$showGoToFirstIt, _ref2$showGoToLastIte = _ref2.showGoToLastItemButton, showGoToLastItemButton = _ref2$showGoToLastIte === void 0 ? true : _ref2$showGoToLastIte, _ref2$showPreviousBut = _ref2.showPreviousButton, showPreviousButton = _ref2$showPreviousBut === void 0 ? true : _ref2$showPreviousBut, _ref2$showNextButton = _ref2.showNextButton, showNextButton = _ref2$showNextButton === void 0 ? true : _ref2$showNextButton, _ref2$showGoToInput = _ref2.showGoToInput, showGoToInput = _ref2$showGoToInput === void 0 ? false : _ref2$showGoToInput, _ref2$disabled = _ref2.disabled, disabled = _ref2$disabled === void 0 ? false : _ref2$disabled, _ref2$hideDisabledBut = _ref2.hideDisabledButtons, hideDisabledButtons = _ref2$hideDisabledBut === void 0 ? false : _ref2$hideDisabledBut, _ref2$renderItem = _ref2.renderItem, renderItem = _ref2$renderItem === void 0 ? defaultRenderItem : _ref2$renderItem, _ref2$isLoading = _ref2.isLoading, isLoading = _ref2$isLoading === void 0 ? false : _ref2$isLoading, loadingText = _ref2.loadingText, emptyText = _ref2.emptyText, _ref2$itemDisplayText = _ref2.itemDisplayText, itemDisplayText = _ref2$itemDisplayText === void 0 ? "page" : _ref2$itemDisplayText, props = _objectWithoutProperties$
|
|
4315
|
+
var totalItems = _ref2.totalItems, currentPage = _ref2.currentPage, onPageChange = _ref2.onPageChange, _ref2$itemsToShowEach = _ref2.itemsToShowEachSide, itemsToShowEachSide = _ref2$itemsToShowEach === void 0 ? 1 : _ref2$itemsToShowEach, _ref2$kind = _ref2.kind, kind = _ref2$kind === void 0 ? "plain" : _ref2$kind, _ref2$showGoToFirstIt = _ref2.showGoToFirstItemButton, showGoToFirstItemButton = _ref2$showGoToFirstIt === void 0 ? true : _ref2$showGoToFirstIt, _ref2$showGoToLastIte = _ref2.showGoToLastItemButton, showGoToLastItemButton = _ref2$showGoToLastIte === void 0 ? true : _ref2$showGoToLastIte, _ref2$showPreviousBut = _ref2.showPreviousButton, showPreviousButton = _ref2$showPreviousBut === void 0 ? true : _ref2$showPreviousBut, _ref2$showNextButton = _ref2.showNextButton, showNextButton = _ref2$showNextButton === void 0 ? true : _ref2$showNextButton, _ref2$showGoToInput = _ref2.showGoToInput, showGoToInput = _ref2$showGoToInput === void 0 ? false : _ref2$showGoToInput, _ref2$disabled = _ref2.disabled, disabled = _ref2$disabled === void 0 ? false : _ref2$disabled, _ref2$hideDisabledBut = _ref2.hideDisabledButtons, hideDisabledButtons = _ref2$hideDisabledBut === void 0 ? false : _ref2$hideDisabledBut, _ref2$renderItem = _ref2.renderItem, renderItem = _ref2$renderItem === void 0 ? defaultRenderItem : _ref2$renderItem, _ref2$isLoading = _ref2.isLoading, isLoading = _ref2$isLoading === void 0 ? false : _ref2$isLoading, loadingText = _ref2.loadingText, emptyText = _ref2.emptyText, _ref2$itemDisplayText = _ref2.itemDisplayText, itemDisplayText = _ref2$itemDisplayText === void 0 ? "page" : _ref2$itemDisplayText, props = _objectWithoutProperties$g(_ref2, _excluded2$2);
|
|
4691
4316
|
var _usePagination = usePagination({
|
|
4692
4317
|
totalItems,
|
|
4693
4318
|
currentPage,
|
|
4694
4319
|
itemsToShowEachSide
|
|
4695
4320
|
}), items = _usePagination.items, totalPages = _usePagination.totalPages, rangeStart = _usePagination.rangeStart, hasPrevPage = _usePagination.hasPrevPage, hasNextPage = _usePagination.hasNextPage;
|
|
4696
|
-
var _React$useState = React.useState(""), _React$useState2 = _slicedToArray$
|
|
4321
|
+
var _React$useState = React.useState(""), _React$useState2 = _slicedToArray$5(_React$useState, 2), goToPage = _React$useState2[0], setGoToPage = _React$useState2[1];
|
|
4697
4322
|
var handlePageInputChange = function handlePageInputChange2(e) {
|
|
4698
4323
|
setGoToPage(e.target.value);
|
|
4699
4324
|
};
|
|
@@ -4721,7 +4346,7 @@ var Pagination = /* @__PURE__ */ React.forwardRef(function(_ref2, ref) {
|
|
|
4721
4346
|
if (isLoading) {
|
|
4722
4347
|
classNames.push("loading");
|
|
4723
4348
|
}
|
|
4724
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
4349
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$g({
|
|
4725
4350
|
as: "nav",
|
|
4726
4351
|
"data-pagination": true,
|
|
4727
4352
|
ref,
|
|
@@ -4798,26 +4423,26 @@ var Pagination = /* @__PURE__ */ React.forwardRef(function(_ref2, ref) {
|
|
|
4798
4423
|
disabled
|
|
4799
4424
|
}))));
|
|
4800
4425
|
});
|
|
4801
|
-
var _excluded$
|
|
4802
|
-
function _extends$
|
|
4803
|
-
return _extends$
|
|
4426
|
+
var _excluded$f = ["label", "value", "height", "max"];
|
|
4427
|
+
function _extends$f() {
|
|
4428
|
+
return _extends$f = Object.assign ? Object.assign.bind() : function(n) {
|
|
4804
4429
|
for (var e = 1; e < arguments.length; e++) {
|
|
4805
4430
|
var t = arguments[e];
|
|
4806
4431
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
4807
4432
|
}
|
|
4808
4433
|
return n;
|
|
4809
|
-
}, _extends$
|
|
4434
|
+
}, _extends$f.apply(null, arguments);
|
|
4810
4435
|
}
|
|
4811
|
-
function _objectWithoutProperties$
|
|
4436
|
+
function _objectWithoutProperties$f(e, t) {
|
|
4812
4437
|
if (null == e) return {};
|
|
4813
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
4438
|
+
var o, r, i = _objectWithoutPropertiesLoose$f(e, t);
|
|
4814
4439
|
if (Object.getOwnPropertySymbols) {
|
|
4815
4440
|
var n = Object.getOwnPropertySymbols(e);
|
|
4816
4441
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
4817
4442
|
}
|
|
4818
4443
|
return i;
|
|
4819
4444
|
}
|
|
4820
|
-
function _objectWithoutPropertiesLoose$
|
|
4445
|
+
function _objectWithoutPropertiesLoose$f(r, e) {
|
|
4821
4446
|
if (null == r) return {};
|
|
4822
4447
|
var t = {};
|
|
4823
4448
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -4827,14 +4452,14 @@ function _objectWithoutPropertiesLoose$d(r, e) {
|
|
|
4827
4452
|
return t;
|
|
4828
4453
|
}
|
|
4829
4454
|
var ProgressBar = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
4830
|
-
var label = _ref.label, value = _ref.value, height = _ref.height, _ref$max = _ref.max, max = _ref$max === void 0 ? 100 : _ref$max, props = _objectWithoutProperties$
|
|
4455
|
+
var label = _ref.label, value = _ref.value, height = _ref.height, _ref$max = _ref.max, max = _ref$max === void 0 ? 100 : _ref$max, props = _objectWithoutProperties$f(_ref, _excluded$f);
|
|
4831
4456
|
var validValue = Math.max(0, Math.min(max, Number(value) || 0));
|
|
4832
4457
|
var progressText = "".concat(validValue).concat(props.suffix || "");
|
|
4833
4458
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, label && /* @__PURE__ */ React.createElement(Element, {
|
|
4834
4459
|
as: "div",
|
|
4835
4460
|
"data-progress-bar-meta": true,
|
|
4836
4461
|
"aria-hidden": "true"
|
|
4837
|
-
}, /* @__PURE__ */ React.createElement(Text, null, label), /* @__PURE__ */ React.createElement(Text, null, progressText)), /* @__PURE__ */ React.createElement(Element, _extends$
|
|
4462
|
+
}, /* @__PURE__ */ React.createElement(Text, null, label), /* @__PURE__ */ React.createElement(Text, null, progressText)), /* @__PURE__ */ React.createElement(Element, _extends$f({
|
|
4838
4463
|
as: "progress",
|
|
4839
4464
|
"data-progress-bar": true,
|
|
4840
4465
|
ref,
|
|
@@ -4851,26 +4476,331 @@ var ProgressBar = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
4851
4476
|
}
|
|
4852
4477
|
})));
|
|
4853
4478
|
});
|
|
4854
|
-
var _excluded$
|
|
4855
|
-
function _extends$
|
|
4856
|
-
return _extends$
|
|
4479
|
+
var _excluded$e = ["children", "allowMultipleSelections", "showTickIcon", "onSelectionChange", "tickPosition", "selectionLimit", "defaultSelectedIds"], _excluded2$1 = ["id", "children", "disabled"];
|
|
4480
|
+
function _extends$e() {
|
|
4481
|
+
return _extends$e = Object.assign ? Object.assign.bind() : function(n) {
|
|
4857
4482
|
for (var e = 1; e < arguments.length; e++) {
|
|
4858
4483
|
var t = arguments[e];
|
|
4859
4484
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
4860
4485
|
}
|
|
4861
4486
|
return n;
|
|
4862
|
-
}, _extends$
|
|
4487
|
+
}, _extends$e.apply(null, arguments);
|
|
4863
4488
|
}
|
|
4864
|
-
function
|
|
4489
|
+
function _slicedToArray$4(r, e) {
|
|
4490
|
+
return _arrayWithHoles$4(r) || _iterableToArrayLimit$4(r, e) || _unsupportedIterableToArray$5(r, e) || _nonIterableRest$4();
|
|
4491
|
+
}
|
|
4492
|
+
function _nonIterableRest$4() {
|
|
4493
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4494
|
+
}
|
|
4495
|
+
function _unsupportedIterableToArray$5(r, a) {
|
|
4496
|
+
if (r) {
|
|
4497
|
+
if ("string" == typeof r) return _arrayLikeToArray$5(r, a);
|
|
4498
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
4499
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$5(r, a) : void 0;
|
|
4500
|
+
}
|
|
4501
|
+
}
|
|
4502
|
+
function _arrayLikeToArray$5(r, a) {
|
|
4503
|
+
(null == a || a > r.length) && (a = r.length);
|
|
4504
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
4505
|
+
return n;
|
|
4506
|
+
}
|
|
4507
|
+
function _iterableToArrayLimit$4(r, l) {
|
|
4508
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
4509
|
+
if (null != t) {
|
|
4510
|
+
var e, n, i, u, a = [], f = true, o = false;
|
|
4511
|
+
try {
|
|
4512
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
4513
|
+
if (Object(t) !== t) return;
|
|
4514
|
+
f = false;
|
|
4515
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
|
|
4516
|
+
} catch (r2) {
|
|
4517
|
+
o = true, n = r2;
|
|
4518
|
+
} finally {
|
|
4519
|
+
try {
|
|
4520
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
4521
|
+
} finally {
|
|
4522
|
+
if (o) throw n;
|
|
4523
|
+
}
|
|
4524
|
+
}
|
|
4525
|
+
return a;
|
|
4526
|
+
}
|
|
4527
|
+
}
|
|
4528
|
+
function _arrayWithHoles$4(r) {
|
|
4529
|
+
if (Array.isArray(r)) return r;
|
|
4530
|
+
}
|
|
4531
|
+
function _objectWithoutProperties$e(e, t) {
|
|
4865
4532
|
if (null == e) return {};
|
|
4866
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
4533
|
+
var o, r, i = _objectWithoutPropertiesLoose$e(e, t);
|
|
4867
4534
|
if (Object.getOwnPropertySymbols) {
|
|
4868
4535
|
var n = Object.getOwnPropertySymbols(e);
|
|
4869
4536
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
4870
4537
|
}
|
|
4871
4538
|
return i;
|
|
4872
4539
|
}
|
|
4873
|
-
function _objectWithoutPropertiesLoose$
|
|
4540
|
+
function _objectWithoutPropertiesLoose$e(r, e) {
|
|
4541
|
+
if (null == r) return {};
|
|
4542
|
+
var t = {};
|
|
4543
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
4544
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
4545
|
+
t[n] = r[n];
|
|
4546
|
+
}
|
|
4547
|
+
return t;
|
|
4548
|
+
}
|
|
4549
|
+
var OptionCardsContext = /* @__PURE__ */ createContext({
|
|
4550
|
+
isSelected: function isSelected() {
|
|
4551
|
+
return false;
|
|
4552
|
+
},
|
|
4553
|
+
toggleSelection: function toggleSelection() {
|
|
4554
|
+
},
|
|
4555
|
+
showTickIcon: false,
|
|
4556
|
+
tickPosition: "top-right",
|
|
4557
|
+
selectAllOptions: function selectAllOptions() {
|
|
4558
|
+
},
|
|
4559
|
+
clearAllOptions: function clearAllOptions() {
|
|
4560
|
+
},
|
|
4561
|
+
setSelectedOptions: function setSelectedOptions() {
|
|
4562
|
+
},
|
|
4563
|
+
setSelectedIds: function setSelectedIds() {
|
|
4564
|
+
},
|
|
4565
|
+
registerOption: function registerOption() {
|
|
4566
|
+
},
|
|
4567
|
+
unregisterOption: function unregisterOption() {
|
|
4568
|
+
}
|
|
4569
|
+
});
|
|
4570
|
+
var OptionCardsGroup = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
4571
|
+
var children = _ref.children, _ref$allowMultipleSel = _ref.allowMultipleSelections, allowMultipleSelections = _ref$allowMultipleSel === void 0 ? false : _ref$allowMultipleSel, showTickIcon = _ref.showTickIcon, onSelectionChange = _ref.onSelectionChange, _ref$tickPosition = _ref.tickPosition, tickPosition = _ref$tickPosition === void 0 ? "top-right" : _ref$tickPosition, selectionLimit = _ref.selectionLimit, defaultSelectedIds = _ref.defaultSelectedIds;
|
|
4572
|
+
_objectWithoutProperties$e(_ref, _excluded$e);
|
|
4573
|
+
var _useState = useState(defaultSelectedIds ? new Set(defaultSelectedIds) : /* @__PURE__ */ new Set()), _useState2 = _slicedToArray$4(_useState, 2), selectedIds = _useState2[0], setSelectedIds2 = _useState2[1];
|
|
4574
|
+
var availableOptionsRef = useRef(/* @__PURE__ */ new Map());
|
|
4575
|
+
useEffect(function() {
|
|
4576
|
+
if (defaultSelectedIds && defaultSelectedIds.size > 0) {
|
|
4577
|
+
setSelectedIds2(new Set(defaultSelectedIds));
|
|
4578
|
+
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange(new Set(defaultSelectedIds));
|
|
4579
|
+
}
|
|
4580
|
+
}, [defaultSelectedIds, onSelectionChange]);
|
|
4581
|
+
var registerOption2 = useCallback(function(id, disabled) {
|
|
4582
|
+
availableOptionsRef.current.set(id, disabled);
|
|
4583
|
+
}, []);
|
|
4584
|
+
var unregisterOption2 = useCallback(function(id) {
|
|
4585
|
+
availableOptionsRef.current["delete"](id);
|
|
4586
|
+
}, []);
|
|
4587
|
+
var toggleSelection2 = useCallback(function(id) {
|
|
4588
|
+
setSelectedIds2(function(prevSelectedIds) {
|
|
4589
|
+
var newSelectedIds = new Set(prevSelectedIds);
|
|
4590
|
+
if (allowMultipleSelections) {
|
|
4591
|
+
if (newSelectedIds.has(id)) {
|
|
4592
|
+
newSelectedIds["delete"](id);
|
|
4593
|
+
} else {
|
|
4594
|
+
if (selectionLimit && newSelectedIds.size >= selectionLimit) {
|
|
4595
|
+
return prevSelectedIds;
|
|
4596
|
+
}
|
|
4597
|
+
newSelectedIds.add(id);
|
|
4598
|
+
}
|
|
4599
|
+
} else {
|
|
4600
|
+
if (newSelectedIds.has(id) && prevSelectedIds.size === 1) {
|
|
4601
|
+
newSelectedIds.clear();
|
|
4602
|
+
} else {
|
|
4603
|
+
newSelectedIds.clear();
|
|
4604
|
+
newSelectedIds.add(id);
|
|
4605
|
+
}
|
|
4606
|
+
}
|
|
4607
|
+
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange(newSelectedIds);
|
|
4608
|
+
return newSelectedIds;
|
|
4609
|
+
});
|
|
4610
|
+
}, [allowMultipleSelections, onSelectionChange, selectionLimit]);
|
|
4611
|
+
var selectAllOptions2 = useCallback(function() {
|
|
4612
|
+
if (!allowMultipleSelections) return;
|
|
4613
|
+
setSelectedIds2(function(prevSelectedIds) {
|
|
4614
|
+
var newSelectedIds = new Set(prevSelectedIds);
|
|
4615
|
+
var enabledOptions = Array.from(availableOptionsRef.current.entries()).filter(function(_ref2) {
|
|
4616
|
+
var _ref3 = _slicedToArray$4(_ref2, 2);
|
|
4617
|
+
_ref3[0];
|
|
4618
|
+
var disabled = _ref3[1];
|
|
4619
|
+
return !disabled;
|
|
4620
|
+
}).map(function(_ref4) {
|
|
4621
|
+
var _ref5 = _slicedToArray$4(_ref4, 1), id = _ref5[0];
|
|
4622
|
+
return id;
|
|
4623
|
+
});
|
|
4624
|
+
var optionsToAdd = selectionLimit ? enabledOptions.slice(0, selectionLimit) : enabledOptions;
|
|
4625
|
+
optionsToAdd.forEach(function(id) {
|
|
4626
|
+
return newSelectedIds.add(id);
|
|
4627
|
+
});
|
|
4628
|
+
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange(newSelectedIds);
|
|
4629
|
+
return newSelectedIds;
|
|
4630
|
+
});
|
|
4631
|
+
}, [allowMultipleSelections, selectionLimit, onSelectionChange]);
|
|
4632
|
+
var clearAllOptions2 = useCallback(function() {
|
|
4633
|
+
setSelectedIds2(/* @__PURE__ */ new Set());
|
|
4634
|
+
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange(/* @__PURE__ */ new Set());
|
|
4635
|
+
}, [onSelectionChange]);
|
|
4636
|
+
var setSelectedOptions2 = useCallback(function(ids) {
|
|
4637
|
+
if (ids) {
|
|
4638
|
+
console.log("Setting selected options:", ids);
|
|
4639
|
+
setSelectedIds2(function() {
|
|
4640
|
+
var newSet = new Set(ids);
|
|
4641
|
+
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange(newSet);
|
|
4642
|
+
return newSet;
|
|
4643
|
+
});
|
|
4644
|
+
}
|
|
4645
|
+
}, [onSelectionChange]);
|
|
4646
|
+
var setSelectedIdSet = useCallback(function(ids) {
|
|
4647
|
+
if (ids) {
|
|
4648
|
+
console.log("Setting selected ids:", Array.from(ids));
|
|
4649
|
+
setSelectedIds2(function() {
|
|
4650
|
+
var newSet = new Set(ids);
|
|
4651
|
+
onSelectionChange === null || onSelectionChange === void 0 || onSelectionChange(newSet);
|
|
4652
|
+
return newSet;
|
|
4653
|
+
});
|
|
4654
|
+
}
|
|
4655
|
+
}, [onSelectionChange]);
|
|
4656
|
+
var isSelected2 = useCallback(function(id) {
|
|
4657
|
+
return selectedIds.has(id);
|
|
4658
|
+
}, [selectedIds]);
|
|
4659
|
+
React.useImperativeHandle(ref, function() {
|
|
4660
|
+
return {
|
|
4661
|
+
selectAllOptions: selectAllOptions2,
|
|
4662
|
+
clearAllOptions: clearAllOptions2,
|
|
4663
|
+
setSelectedOptions: setSelectedOptions2,
|
|
4664
|
+
setSelectedIds: setSelectedIdSet
|
|
4665
|
+
};
|
|
4666
|
+
}, [selectAllOptions2, clearAllOptions2, setSelectedOptions2, setSelectedIdSet]);
|
|
4667
|
+
var contextValue = {
|
|
4668
|
+
isSelected: isSelected2,
|
|
4669
|
+
toggleSelection: toggleSelection2,
|
|
4670
|
+
showTickIcon,
|
|
4671
|
+
tickPosition,
|
|
4672
|
+
selectAllOptions: selectAllOptions2,
|
|
4673
|
+
clearAllOptions: clearAllOptions2,
|
|
4674
|
+
setSelectedOptions: setSelectedOptions2,
|
|
4675
|
+
setSelectedIds: setSelectedIdSet,
|
|
4676
|
+
registerOption: registerOption2,
|
|
4677
|
+
unregisterOption: unregisterOption2
|
|
4678
|
+
};
|
|
4679
|
+
return /* @__PURE__ */ React.createElement(OptionCardsContext.Provider, {
|
|
4680
|
+
value: contextValue
|
|
4681
|
+
}, /* @__PURE__ */ React.createElement(Div, {
|
|
4682
|
+
"data-option-cards-group": true,
|
|
4683
|
+
className: "tick-".concat(tickPosition)
|
|
4684
|
+
}, children));
|
|
4685
|
+
});
|
|
4686
|
+
var useOptionCard = function useOptionCard2(id) {
|
|
4687
|
+
var context = useContext(OptionCardsContext);
|
|
4688
|
+
return {
|
|
4689
|
+
isSelected: context.isSelected(id),
|
|
4690
|
+
toggleSelection: function toggleSelection2() {
|
|
4691
|
+
return context.toggleSelection(id);
|
|
4692
|
+
},
|
|
4693
|
+
showTickIcon: context.showTickIcon
|
|
4694
|
+
};
|
|
4695
|
+
};
|
|
4696
|
+
var useOptionCardsGroup = function useOptionCardsGroup2() {
|
|
4697
|
+
var _useContext = useContext(OptionCardsContext), selectAllOptions2 = _useContext.selectAllOptions, clearAllOptions2 = _useContext.clearAllOptions, setSelectedOptions2 = _useContext.setSelectedOptions, setSelectedIds2 = _useContext.setSelectedIds;
|
|
4698
|
+
return {
|
|
4699
|
+
selectAllOptions: selectAllOptions2,
|
|
4700
|
+
clearAllOptions: clearAllOptions2,
|
|
4701
|
+
setSelectedOptions: setSelectedOptions2,
|
|
4702
|
+
setSelectedIds: setSelectedIds2
|
|
4703
|
+
};
|
|
4704
|
+
};
|
|
4705
|
+
var OptionCard = function OptionCard2(_ref6) {
|
|
4706
|
+
var id = _ref6.id, children = _ref6.children, _ref6$disabled = _ref6.disabled, disabled = _ref6$disabled === void 0 ? false : _ref6$disabled, props = _objectWithoutProperties$e(_ref6, _excluded2$1);
|
|
4707
|
+
var _useContext2 = useContext(OptionCardsContext), isSelected2 = _useContext2.isSelected, toggleSelection2 = _useContext2.toggleSelection, showTickIcon = _useContext2.showTickIcon, registerOption2 = _useContext2.registerOption, unregisterOption2 = _useContext2.unregisterOption;
|
|
4708
|
+
var _useState3 = useState(false), _useState4 = _slicedToArray$4(_useState3, 2), showDeselect = _useState4[0], setShowDeselect = _useState4[1];
|
|
4709
|
+
var _useState5 = useState(true), _useState6 = _slicedToArray$4(_useState5, 2), isInitialHover = _useState6[0], setIsInitialHover = _useState6[1];
|
|
4710
|
+
React.useEffect(function() {
|
|
4711
|
+
registerOption2(id, disabled);
|
|
4712
|
+
return function() {
|
|
4713
|
+
return unregisterOption2(id);
|
|
4714
|
+
};
|
|
4715
|
+
}, [id, disabled, registerOption2, unregisterOption2]);
|
|
4716
|
+
var classNames = [];
|
|
4717
|
+
if (isSelected2(id)) {
|
|
4718
|
+
classNames.push("selected");
|
|
4719
|
+
}
|
|
4720
|
+
if (disabled) {
|
|
4721
|
+
classNames.push("disabled");
|
|
4722
|
+
}
|
|
4723
|
+
if (showDeselect) {
|
|
4724
|
+
classNames.push("show-deselect");
|
|
4725
|
+
}
|
|
4726
|
+
var handleMouseEnter = function handleMouseEnter2() {
|
|
4727
|
+
if (isSelected2(id) && !isInitialHover) {
|
|
4728
|
+
setShowDeselect(true);
|
|
4729
|
+
}
|
|
4730
|
+
};
|
|
4731
|
+
var handleMouseLeave = function handleMouseLeave2() {
|
|
4732
|
+
setShowDeselect(false);
|
|
4733
|
+
setIsInitialHover(false);
|
|
4734
|
+
};
|
|
4735
|
+
var handleClick = function handleClick2(e) {
|
|
4736
|
+
if (!disabled) {
|
|
4737
|
+
var _props$onClick;
|
|
4738
|
+
setIsInitialHover(true);
|
|
4739
|
+
setShowDeselect(false);
|
|
4740
|
+
toggleSelection2(id);
|
|
4741
|
+
(_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, e);
|
|
4742
|
+
}
|
|
4743
|
+
};
|
|
4744
|
+
var handleKeyDown = function handleKeyDown2(e) {
|
|
4745
|
+
if ((e.key === "Enter" || e.key === " ") && !disabled) {
|
|
4746
|
+
e.preventDefault();
|
|
4747
|
+
setIsInitialHover(true);
|
|
4748
|
+
setShowDeselect(false);
|
|
4749
|
+
toggleSelection2(id);
|
|
4750
|
+
}
|
|
4751
|
+
};
|
|
4752
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$e({
|
|
4753
|
+
as: Card,
|
|
4754
|
+
"data-option-card": true,
|
|
4755
|
+
role: "button",
|
|
4756
|
+
tabIndex: disabled ? -1 : 0,
|
|
4757
|
+
"aria-disabled": disabled ? "true" : "false",
|
|
4758
|
+
"aria-selected": isSelected2(id) ? "true" : "false",
|
|
4759
|
+
classNames,
|
|
4760
|
+
onClick: handleClick,
|
|
4761
|
+
onKeyDown: handleKeyDown,
|
|
4762
|
+
onMouseEnter: handleMouseEnter,
|
|
4763
|
+
onMouseLeave: handleMouseLeave
|
|
4764
|
+
}, props), showTickIcon && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("svg", {
|
|
4765
|
+
viewBox: "0 0 24 24",
|
|
4766
|
+
className: "tick-icon"
|
|
4767
|
+
}, /* @__PURE__ */ React.createElement("circle", {
|
|
4768
|
+
cx: "12",
|
|
4769
|
+
cy: "12",
|
|
4770
|
+
r: "11"
|
|
4771
|
+
}), /* @__PURE__ */ React.createElement("path", {
|
|
4772
|
+
d: "M8 13 L11 15 L16 9"
|
|
4773
|
+
})), /* @__PURE__ */ React.createElement("svg", {
|
|
4774
|
+
viewBox: "0 0 24 24",
|
|
4775
|
+
className: "deselect-icon"
|
|
4776
|
+
}, /* @__PURE__ */ React.createElement("circle", {
|
|
4777
|
+
cx: "12",
|
|
4778
|
+
cy: "12",
|
|
4779
|
+
r: "11"
|
|
4780
|
+
}), /* @__PURE__ */ React.createElement("path", {
|
|
4781
|
+
d: "M8 8 L16 16 M16 8 L8 16"
|
|
4782
|
+
}))), children);
|
|
4783
|
+
};
|
|
4784
|
+
var _excluded$d = ["collapsed", "closeOnClickOutside", "showMobileSidebar"];
|
|
4785
|
+
function _extends$d() {
|
|
4786
|
+
return _extends$d = Object.assign ? Object.assign.bind() : function(n) {
|
|
4787
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
4788
|
+
var t = arguments[e];
|
|
4789
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
4790
|
+
}
|
|
4791
|
+
return n;
|
|
4792
|
+
}, _extends$d.apply(null, arguments);
|
|
4793
|
+
}
|
|
4794
|
+
function _objectWithoutProperties$d(e, t) {
|
|
4795
|
+
if (null == e) return {};
|
|
4796
|
+
var o, r, i = _objectWithoutPropertiesLoose$d(e, t);
|
|
4797
|
+
if (Object.getOwnPropertySymbols) {
|
|
4798
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
4799
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
4800
|
+
}
|
|
4801
|
+
return i;
|
|
4802
|
+
}
|
|
4803
|
+
function _objectWithoutPropertiesLoose$d(r, e) {
|
|
4874
4804
|
if (null == r) return {};
|
|
4875
4805
|
var t = {};
|
|
4876
4806
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -4880,7 +4810,7 @@ function _objectWithoutPropertiesLoose$c(r, e) {
|
|
|
4880
4810
|
return t;
|
|
4881
4811
|
}
|
|
4882
4812
|
var SidebarWrapper = /* @__PURE__ */ React.forwardRef(function(_ref, forwardedRef) {
|
|
4883
|
-
var collapsed = _ref.collapsed, closeOnClickOutside = _ref.closeOnClickOutside, showMobileSidebar = _ref.showMobileSidebar, props = _objectWithoutProperties$
|
|
4813
|
+
var collapsed = _ref.collapsed, closeOnClickOutside = _ref.closeOnClickOutside, showMobileSidebar = _ref.showMobileSidebar, props = _objectWithoutProperties$d(_ref, _excluded$d);
|
|
4884
4814
|
var internalRef = useRef(null);
|
|
4885
4815
|
useImperativeHandle(forwardedRef, function() {
|
|
4886
4816
|
return internalRef.current;
|
|
@@ -4897,33 +4827,33 @@ var SidebarWrapper = /* @__PURE__ */ React.forwardRef(function(_ref, forwardedRe
|
|
|
4897
4827
|
if (showMobileSidebar) {
|
|
4898
4828
|
classNames.push("show-sidebar");
|
|
4899
4829
|
}
|
|
4900
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
4830
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$d({
|
|
4901
4831
|
as: "aside",
|
|
4902
4832
|
"data-sidebar-wrapper": true,
|
|
4903
4833
|
ref: internalRef,
|
|
4904
4834
|
classNames
|
|
4905
4835
|
}, props));
|
|
4906
|
-
});
|
|
4907
|
-
var _excluded$
|
|
4908
|
-
function _extends$
|
|
4909
|
-
return _extends$
|
|
4836
|
+
});
|
|
4837
|
+
var _excluded$c = ["label"];
|
|
4838
|
+
function _extends$c() {
|
|
4839
|
+
return _extends$c = Object.assign ? Object.assign.bind() : function(n) {
|
|
4910
4840
|
for (var e = 1; e < arguments.length; e++) {
|
|
4911
4841
|
var t = arguments[e];
|
|
4912
4842
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
4913
4843
|
}
|
|
4914
4844
|
return n;
|
|
4915
|
-
}, _extends$
|
|
4845
|
+
}, _extends$c.apply(null, arguments);
|
|
4916
4846
|
}
|
|
4917
|
-
function _objectWithoutProperties$
|
|
4847
|
+
function _objectWithoutProperties$c(e, t) {
|
|
4918
4848
|
if (null == e) return {};
|
|
4919
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
4849
|
+
var o, r, i = _objectWithoutPropertiesLoose$c(e, t);
|
|
4920
4850
|
if (Object.getOwnPropertySymbols) {
|
|
4921
4851
|
var n = Object.getOwnPropertySymbols(e);
|
|
4922
4852
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
4923
4853
|
}
|
|
4924
4854
|
return i;
|
|
4925
4855
|
}
|
|
4926
|
-
function _objectWithoutPropertiesLoose$
|
|
4856
|
+
function _objectWithoutPropertiesLoose$c(r, e) {
|
|
4927
4857
|
if (null == r) return {};
|
|
4928
4858
|
var t = {};
|
|
4929
4859
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -4933,8 +4863,8 @@ function _objectWithoutPropertiesLoose$b(r, e) {
|
|
|
4933
4863
|
return t;
|
|
4934
4864
|
}
|
|
4935
4865
|
var ContentWrapper = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
4936
|
-
var label = _ref.label, props = _objectWithoutProperties$
|
|
4937
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
4866
|
+
var label = _ref.label, props = _objectWithoutProperties$c(_ref, _excluded$c);
|
|
4867
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$c({
|
|
4938
4868
|
as: "main",
|
|
4939
4869
|
"data-content-wrapper": true,
|
|
4940
4870
|
ref,
|
|
@@ -4942,26 +4872,26 @@ var ContentWrapper = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
4942
4872
|
"aria-label": label || "Main content"
|
|
4943
4873
|
}, props));
|
|
4944
4874
|
});
|
|
4945
|
-
var _excluded$
|
|
4946
|
-
function _extends$
|
|
4947
|
-
return _extends$
|
|
4875
|
+
var _excluded$b = ["isSticky"];
|
|
4876
|
+
function _extends$b() {
|
|
4877
|
+
return _extends$b = Object.assign ? Object.assign.bind() : function(n) {
|
|
4948
4878
|
for (var e = 1; e < arguments.length; e++) {
|
|
4949
4879
|
var t = arguments[e];
|
|
4950
4880
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
4951
4881
|
}
|
|
4952
4882
|
return n;
|
|
4953
|
-
}, _extends$
|
|
4883
|
+
}, _extends$b.apply(null, arguments);
|
|
4954
4884
|
}
|
|
4955
|
-
function _objectWithoutProperties$
|
|
4885
|
+
function _objectWithoutProperties$b(e, t) {
|
|
4956
4886
|
if (null == e) return {};
|
|
4957
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
4887
|
+
var o, r, i = _objectWithoutPropertiesLoose$b(e, t);
|
|
4958
4888
|
if (Object.getOwnPropertySymbols) {
|
|
4959
4889
|
var n = Object.getOwnPropertySymbols(e);
|
|
4960
4890
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
4961
4891
|
}
|
|
4962
4892
|
return i;
|
|
4963
4893
|
}
|
|
4964
|
-
function _objectWithoutPropertiesLoose$
|
|
4894
|
+
function _objectWithoutPropertiesLoose$b(r, e) {
|
|
4965
4895
|
if (null == r) return {};
|
|
4966
4896
|
var t = {};
|
|
4967
4897
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -4971,38 +4901,38 @@ function _objectWithoutPropertiesLoose$a(r, e) {
|
|
|
4971
4901
|
return t;
|
|
4972
4902
|
}
|
|
4973
4903
|
var SidebarHeader = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
4974
|
-
var isSticky = _ref.isSticky, props = _objectWithoutProperties$
|
|
4904
|
+
var isSticky = _ref.isSticky, props = _objectWithoutProperties$b(_ref, _excluded$b);
|
|
4975
4905
|
var classNames = [];
|
|
4976
4906
|
if (isSticky) {
|
|
4977
4907
|
classNames.push("is-sticky");
|
|
4978
4908
|
}
|
|
4979
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
4909
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$b({
|
|
4980
4910
|
as: "header",
|
|
4981
4911
|
"data-sidebar-header": true,
|
|
4982
4912
|
ref,
|
|
4983
4913
|
classNames
|
|
4984
4914
|
}, props));
|
|
4985
4915
|
});
|
|
4986
|
-
var _excluded$
|
|
4987
|
-
function _extends$
|
|
4988
|
-
return _extends$
|
|
4916
|
+
var _excluded$a = ["hasAlert", "hasEmptyIcon", "hasNoIcon", "children"];
|
|
4917
|
+
function _extends$a() {
|
|
4918
|
+
return _extends$a = Object.assign ? Object.assign.bind() : function(n) {
|
|
4989
4919
|
for (var e = 1; e < arguments.length; e++) {
|
|
4990
4920
|
var t = arguments[e];
|
|
4991
4921
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
4992
4922
|
}
|
|
4993
4923
|
return n;
|
|
4994
|
-
}, _extends$
|
|
4924
|
+
}, _extends$a.apply(null, arguments);
|
|
4995
4925
|
}
|
|
4996
|
-
function _objectWithoutProperties$
|
|
4926
|
+
function _objectWithoutProperties$a(e, t) {
|
|
4997
4927
|
if (null == e) return {};
|
|
4998
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
4928
|
+
var o, r, i = _objectWithoutPropertiesLoose$a(e, t);
|
|
4999
4929
|
if (Object.getOwnPropertySymbols) {
|
|
5000
4930
|
var n = Object.getOwnPropertySymbols(e);
|
|
5001
4931
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
5002
4932
|
}
|
|
5003
4933
|
return i;
|
|
5004
4934
|
}
|
|
5005
|
-
function _objectWithoutPropertiesLoose$
|
|
4935
|
+
function _objectWithoutPropertiesLoose$a(r, e) {
|
|
5006
4936
|
if (null == r) return {};
|
|
5007
4937
|
var t = {};
|
|
5008
4938
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -5012,7 +4942,7 @@ function _objectWithoutPropertiesLoose$9(r, e) {
|
|
|
5012
4942
|
return t;
|
|
5013
4943
|
}
|
|
5014
4944
|
var SidebarItem = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
5015
|
-
var hasAlert = _ref.hasAlert, hasEmptyIcon = _ref.hasEmptyIcon, hasNoIcon = _ref.hasNoIcon, children = _ref.children, props = _objectWithoutProperties$
|
|
4945
|
+
var hasAlert = _ref.hasAlert, hasEmptyIcon = _ref.hasEmptyIcon, hasNoIcon = _ref.hasNoIcon, children = _ref.children, props = _objectWithoutProperties$a(_ref, _excluded$a);
|
|
5016
4946
|
var classNames = [];
|
|
5017
4947
|
if (hasAlert) {
|
|
5018
4948
|
classNames.push("has-alert");
|
|
@@ -5022,7 +4952,7 @@ var SidebarItem = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5022
4952
|
} else if (hasNoIcon) {
|
|
5023
4953
|
classNames.push("has-no-icon");
|
|
5024
4954
|
}
|
|
5025
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
4955
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$a({
|
|
5026
4956
|
as: "div",
|
|
5027
4957
|
"data-sidebar-item": true,
|
|
5028
4958
|
ref,
|
|
@@ -5031,26 +4961,26 @@ var SidebarItem = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5031
4961
|
className: "empty-icon-wrapper"
|
|
5032
4962
|
}), children);
|
|
5033
4963
|
});
|
|
5034
|
-
var _excluded$
|
|
5035
|
-
function _extends$
|
|
5036
|
-
return _extends$
|
|
4964
|
+
var _excluded$9 = ["isSticky"];
|
|
4965
|
+
function _extends$9() {
|
|
4966
|
+
return _extends$9 = Object.assign ? Object.assign.bind() : function(n) {
|
|
5037
4967
|
for (var e = 1; e < arguments.length; e++) {
|
|
5038
4968
|
var t = arguments[e];
|
|
5039
4969
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
5040
4970
|
}
|
|
5041
4971
|
return n;
|
|
5042
|
-
}, _extends$
|
|
4972
|
+
}, _extends$9.apply(null, arguments);
|
|
5043
4973
|
}
|
|
5044
|
-
function _objectWithoutProperties$
|
|
4974
|
+
function _objectWithoutProperties$9(e, t) {
|
|
5045
4975
|
if (null == e) return {};
|
|
5046
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
4976
|
+
var o, r, i = _objectWithoutPropertiesLoose$9(e, t);
|
|
5047
4977
|
if (Object.getOwnPropertySymbols) {
|
|
5048
4978
|
var n = Object.getOwnPropertySymbols(e);
|
|
5049
4979
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
5050
4980
|
}
|
|
5051
4981
|
return i;
|
|
5052
4982
|
}
|
|
5053
|
-
function _objectWithoutPropertiesLoose$
|
|
4983
|
+
function _objectWithoutPropertiesLoose$9(r, e) {
|
|
5054
4984
|
if (null == r) return {};
|
|
5055
4985
|
var t = {};
|
|
5056
4986
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -5060,12 +4990,12 @@ function _objectWithoutPropertiesLoose$8(r, e) {
|
|
|
5060
4990
|
return t;
|
|
5061
4991
|
}
|
|
5062
4992
|
var SidebarFooter = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
5063
|
-
var isSticky = _ref.isSticky, props = _objectWithoutProperties$
|
|
4993
|
+
var isSticky = _ref.isSticky, props = _objectWithoutProperties$9(_ref, _excluded$9);
|
|
5064
4994
|
var classNames = [];
|
|
5065
4995
|
if (isSticky) {
|
|
5066
4996
|
classNames.push("is-sticky");
|
|
5067
4997
|
}
|
|
5068
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
4998
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$9({
|
|
5069
4999
|
as: "footer",
|
|
5070
5000
|
"data-sidebar-footer": true,
|
|
5071
5001
|
ref,
|
|
@@ -5080,7 +5010,7 @@ function _typeof(o) {
|
|
|
5080
5010
|
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
5081
5011
|
}, _typeof(o);
|
|
5082
5012
|
}
|
|
5083
|
-
var _excluded$
|
|
5013
|
+
var _excluded$8 = ["variant", "width", "height", "shape", "effect", "loadingLabel"], _excluded2 = ["effect", "spacing", "animate", "repeat", "direction", "children", "classNames", "loadingLabel"];
|
|
5084
5014
|
function _toConsumableArray(r) {
|
|
5085
5015
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$4(r) || _nonIterableSpread();
|
|
5086
5016
|
}
|
|
@@ -5105,14 +5035,14 @@ function _arrayLikeToArray$4(r, a) {
|
|
|
5105
5035
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
5106
5036
|
return n;
|
|
5107
5037
|
}
|
|
5108
|
-
function _extends$
|
|
5109
|
-
return _extends$
|
|
5038
|
+
function _extends$8() {
|
|
5039
|
+
return _extends$8 = Object.assign ? Object.assign.bind() : function(n) {
|
|
5110
5040
|
for (var e = 1; e < arguments.length; e++) {
|
|
5111
5041
|
var t = arguments[e];
|
|
5112
5042
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
5113
5043
|
}
|
|
5114
5044
|
return n;
|
|
5115
|
-
}, _extends$
|
|
5045
|
+
}, _extends$8.apply(null, arguments);
|
|
5116
5046
|
}
|
|
5117
5047
|
function ownKeys(e, r) {
|
|
5118
5048
|
var t = Object.keys(e);
|
|
@@ -5152,16 +5082,16 @@ function _toPrimitive(t, r) {
|
|
|
5152
5082
|
}
|
|
5153
5083
|
return ("string" === r ? String : Number)(t);
|
|
5154
5084
|
}
|
|
5155
|
-
function _objectWithoutProperties$
|
|
5085
|
+
function _objectWithoutProperties$8(e, t) {
|
|
5156
5086
|
if (null == e) return {};
|
|
5157
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
5087
|
+
var o, r, i = _objectWithoutPropertiesLoose$8(e, t);
|
|
5158
5088
|
if (Object.getOwnPropertySymbols) {
|
|
5159
5089
|
var n = Object.getOwnPropertySymbols(e);
|
|
5160
5090
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
5161
5091
|
}
|
|
5162
5092
|
return i;
|
|
5163
5093
|
}
|
|
5164
|
-
function _objectWithoutPropertiesLoose$
|
|
5094
|
+
function _objectWithoutPropertiesLoose$8(r, e) {
|
|
5165
5095
|
if (null == r) return {};
|
|
5166
5096
|
var t = {};
|
|
5167
5097
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -5175,7 +5105,7 @@ var SkeletonContext = /* @__PURE__ */ createContext({
|
|
|
5175
5105
|
animate: true
|
|
5176
5106
|
});
|
|
5177
5107
|
var Skeleton = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
5178
|
-
var _ref$variant = _ref.variant, variant = _ref$variant === void 0 ? "line" : _ref$variant, width = _ref.width, height = _ref.height, shape = _ref.shape, localEffect = _ref.effect, loadingLabel = _ref.loadingLabel, props = _objectWithoutProperties$
|
|
5108
|
+
var _ref$variant = _ref.variant, variant = _ref$variant === void 0 ? "line" : _ref$variant, width = _ref.width, height = _ref.height, shape = _ref.shape, localEffect = _ref.effect, loadingLabel = _ref.loadingLabel, props = _objectWithoutProperties$8(_ref, _excluded$8);
|
|
5179
5109
|
var groupContext = useContext(SkeletonContext);
|
|
5180
5110
|
var effectiveEffect = localEffect || groupContext.effect;
|
|
5181
5111
|
var effectiveLabel = loadingLabel || groupContext.loadingLabel || "Loading...";
|
|
@@ -5196,7 +5126,7 @@ var Skeleton = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5196
5126
|
height: computedHeight,
|
|
5197
5127
|
aspectRatio: variant === "circle" ? "1 / 1" : "auto"
|
|
5198
5128
|
}, props.style);
|
|
5199
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
5129
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$8({
|
|
5200
5130
|
as: "div",
|
|
5201
5131
|
"data-skeleton": true,
|
|
5202
5132
|
ref,
|
|
@@ -5211,7 +5141,7 @@ var Skeleton = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5211
5141
|
}, props));
|
|
5212
5142
|
});
|
|
5213
5143
|
var SkeletonGroup = /* @__PURE__ */ React.forwardRef(function(_ref2, ref) {
|
|
5214
|
-
var _ref2$effect = _ref2.effect, effect = _ref2$effect === void 0 ? "wave" : _ref2$effect, _ref2$spacing = _ref2.spacing, spacing = _ref2$spacing === void 0 ? "small" : _ref2$spacing, _ref2$animate = _ref2.animate, animate = _ref2$animate === void 0 ? true : _ref2$animate, _ref2$repeat = _ref2.repeat, repeat = _ref2$repeat === void 0 ? 1 : _ref2$repeat, _ref2$direction = _ref2.direction, direction = _ref2$direction === void 0 ? "vertical" : _ref2$direction, children = _ref2.children, _ref2$classNames = _ref2.classNames, classNames = _ref2$classNames === void 0 ? [] : _ref2$classNames, _ref2$loadingLabel = _ref2.loadingLabel, loadingLabel = _ref2$loadingLabel === void 0 ? "Loading content..." : _ref2$loadingLabel, props = _objectWithoutProperties$
|
|
5144
|
+
var _ref2$effect = _ref2.effect, effect = _ref2$effect === void 0 ? "wave" : _ref2$effect, _ref2$spacing = _ref2.spacing, spacing = _ref2$spacing === void 0 ? "small" : _ref2$spacing, _ref2$animate = _ref2.animate, animate = _ref2$animate === void 0 ? true : _ref2$animate, _ref2$repeat = _ref2.repeat, repeat = _ref2$repeat === void 0 ? 1 : _ref2$repeat, _ref2$direction = _ref2.direction, direction = _ref2$direction === void 0 ? "vertical" : _ref2$direction, children = _ref2.children, _ref2$classNames = _ref2.classNames, classNames = _ref2$classNames === void 0 ? [] : _ref2$classNames, _ref2$loadingLabel = _ref2.loadingLabel, loadingLabel = _ref2$loadingLabel === void 0 ? "Loading content..." : _ref2$loadingLabel, props = _objectWithoutProperties$8(_ref2, _excluded2);
|
|
5215
5145
|
var groupClassNames = ["direction-".concat(direction), effect && "effect-".concat(effect)].concat(_toConsumableArray(classNames));
|
|
5216
5146
|
if (spacing) {
|
|
5217
5147
|
groupClassNames.push("spacing-".concat(spacing));
|
|
@@ -5222,7 +5152,7 @@ var SkeletonGroup = /* @__PURE__ */ React.forwardRef(function(_ref2, ref) {
|
|
|
5222
5152
|
animate,
|
|
5223
5153
|
loadingLabel
|
|
5224
5154
|
}
|
|
5225
|
-
}, /* @__PURE__ */ React.createElement(Element, _extends$
|
|
5155
|
+
}, /* @__PURE__ */ React.createElement(Element, _extends$8({
|
|
5226
5156
|
as: "div",
|
|
5227
5157
|
ref,
|
|
5228
5158
|
"data-skeleton-group": true,
|
|
@@ -5236,26 +5166,26 @@ var SkeletonGroup = /* @__PURE__ */ React.forwardRef(function(_ref2, ref) {
|
|
|
5236
5166
|
});
|
|
5237
5167
|
})));
|
|
5238
5168
|
});
|
|
5239
|
-
var _excluded$
|
|
5240
|
-
function _extends$
|
|
5241
|
-
return _extends$
|
|
5169
|
+
var _excluded$7 = ["bordersFor", "isStriped", "highlightRowOnHover", "isFullWidth", "alignText", "caption", "summary", "hasColSpan", "children"];
|
|
5170
|
+
function _extends$7() {
|
|
5171
|
+
return _extends$7 = Object.assign ? Object.assign.bind() : function(n) {
|
|
5242
5172
|
for (var e = 1; e < arguments.length; e++) {
|
|
5243
5173
|
var t = arguments[e];
|
|
5244
5174
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
5245
5175
|
}
|
|
5246
5176
|
return n;
|
|
5247
|
-
}, _extends$
|
|
5177
|
+
}, _extends$7.apply(null, arguments);
|
|
5248
5178
|
}
|
|
5249
|
-
function _objectWithoutProperties$
|
|
5179
|
+
function _objectWithoutProperties$7(e, t) {
|
|
5250
5180
|
if (null == e) return {};
|
|
5251
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
5181
|
+
var o, r, i = _objectWithoutPropertiesLoose$7(e, t);
|
|
5252
5182
|
if (Object.getOwnPropertySymbols) {
|
|
5253
5183
|
var n = Object.getOwnPropertySymbols(e);
|
|
5254
5184
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
5255
5185
|
}
|
|
5256
5186
|
return i;
|
|
5257
5187
|
}
|
|
5258
|
-
function _objectWithoutPropertiesLoose$
|
|
5188
|
+
function _objectWithoutPropertiesLoose$7(r, e) {
|
|
5259
5189
|
if (null == r) return {};
|
|
5260
5190
|
var t = {};
|
|
5261
5191
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -5265,7 +5195,7 @@ function _objectWithoutPropertiesLoose$6(r, e) {
|
|
|
5265
5195
|
return t;
|
|
5266
5196
|
}
|
|
5267
5197
|
var Table = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
5268
|
-
var bordersFor = _ref.bordersFor, isStriped = _ref.isStriped, highlightRowOnHover = _ref.highlightRowOnHover, isFullWidth = _ref.isFullWidth, alignText = _ref.alignText, caption = _ref.caption, summary = _ref.summary, hasColSpan = _ref.hasColSpan, children = _ref.children, props = _objectWithoutProperties$
|
|
5198
|
+
var bordersFor = _ref.bordersFor, isStriped = _ref.isStriped, highlightRowOnHover = _ref.highlightRowOnHover, isFullWidth = _ref.isFullWidth, alignText = _ref.alignText, caption = _ref.caption, summary = _ref.summary, hasColSpan = _ref.hasColSpan, children = _ref.children, props = _objectWithoutProperties$7(_ref, _excluded$7);
|
|
5269
5199
|
var classNames = [];
|
|
5270
5200
|
if (bordersFor) {
|
|
5271
5201
|
classNames.push("bordered-".concat(bordersFor));
|
|
@@ -5291,7 +5221,7 @@ var Table = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5291
5221
|
}
|
|
5292
5222
|
return void 0;
|
|
5293
5223
|
};
|
|
5294
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
5224
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$7({
|
|
5295
5225
|
as: "table",
|
|
5296
5226
|
classNames,
|
|
5297
5227
|
ref,
|
|
@@ -5301,15 +5231,15 @@ var Table = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5301
5231
|
summary
|
|
5302
5232
|
}, props), caption && /* @__PURE__ */ React.createElement("caption", null, caption), children);
|
|
5303
5233
|
});
|
|
5304
|
-
var _excluded$
|
|
5305
|
-
function _extends$
|
|
5306
|
-
return _extends$
|
|
5234
|
+
var _excluded$6 = ["tabs", "additionalNavContentWrapper", "defaultActiveTab", "align"];
|
|
5235
|
+
function _extends$6() {
|
|
5236
|
+
return _extends$6 = Object.assign ? Object.assign.bind() : function(n) {
|
|
5307
5237
|
for (var e = 1; e < arguments.length; e++) {
|
|
5308
5238
|
var t = arguments[e];
|
|
5309
5239
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
5310
5240
|
}
|
|
5311
5241
|
return n;
|
|
5312
|
-
}, _extends$
|
|
5242
|
+
}, _extends$6.apply(null, arguments);
|
|
5313
5243
|
}
|
|
5314
5244
|
function _slicedToArray$3(r, e) {
|
|
5315
5245
|
return _arrayWithHoles$3(r) || _iterableToArrayLimit$3(r, e) || _unsupportedIterableToArray$3(r, e) || _nonIterableRest$3();
|
|
@@ -5351,16 +5281,16 @@ function _iterableToArrayLimit$3(r, l) {
|
|
|
5351
5281
|
function _arrayWithHoles$3(r) {
|
|
5352
5282
|
if (Array.isArray(r)) return r;
|
|
5353
5283
|
}
|
|
5354
|
-
function _objectWithoutProperties$
|
|
5284
|
+
function _objectWithoutProperties$6(e, t) {
|
|
5355
5285
|
if (null == e) return {};
|
|
5356
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
5286
|
+
var o, r, i = _objectWithoutPropertiesLoose$6(e, t);
|
|
5357
5287
|
if (Object.getOwnPropertySymbols) {
|
|
5358
5288
|
var n = Object.getOwnPropertySymbols(e);
|
|
5359
5289
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
5360
5290
|
}
|
|
5361
5291
|
return i;
|
|
5362
5292
|
}
|
|
5363
|
-
function _objectWithoutPropertiesLoose$
|
|
5293
|
+
function _objectWithoutPropertiesLoose$6(r, e) {
|
|
5364
5294
|
if (null == r) return {};
|
|
5365
5295
|
var t = {};
|
|
5366
5296
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -5370,7 +5300,7 @@ function _objectWithoutPropertiesLoose$5(r, e) {
|
|
|
5370
5300
|
return t;
|
|
5371
5301
|
}
|
|
5372
5302
|
var Tabs = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
5373
|
-
var tabs = _ref.tabs, additionalNavContentWrapper = _ref.additionalNavContentWrapper, defaultActiveTab = _ref.defaultActiveTab, _ref$align = _ref.align, align = _ref$align === void 0 ? "left" : _ref$align, props = _objectWithoutProperties$
|
|
5303
|
+
var tabs = _ref.tabs, additionalNavContentWrapper = _ref.additionalNavContentWrapper, defaultActiveTab = _ref.defaultActiveTab, _ref$align = _ref.align, align = _ref$align === void 0 ? "left" : _ref$align, props = _objectWithoutProperties$6(_ref, _excluded$6);
|
|
5374
5304
|
var index = tabs.findIndex(function(tab) {
|
|
5375
5305
|
return tab.key === defaultActiveTab;
|
|
5376
5306
|
});
|
|
@@ -5403,7 +5333,7 @@ var Tabs = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5403
5333
|
setActiveTab(void 0);
|
|
5404
5334
|
}
|
|
5405
5335
|
}, [tabs, activeTab === null || activeTab === void 0 ? void 0 : activeTab.key]);
|
|
5406
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
5336
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$6({
|
|
5407
5337
|
as: "div",
|
|
5408
5338
|
"data-tabs": true,
|
|
5409
5339
|
ref
|
|
@@ -5429,15 +5359,15 @@ var Tabs = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5429
5359
|
className: "tabs-content ".concat(isExiting ? "exiting" : "")
|
|
5430
5360
|
}, activeTab.content)) : /* @__PURE__ */ React.createElement(React.Fragment, null));
|
|
5431
5361
|
});
|
|
5432
|
-
var _excluded$
|
|
5433
|
-
function _extends$
|
|
5434
|
-
return _extends$
|
|
5362
|
+
var _excluded$5 = ["currentTheme", "themeList", "children"];
|
|
5363
|
+
function _extends$5() {
|
|
5364
|
+
return _extends$5 = Object.assign ? Object.assign.bind() : function(n) {
|
|
5435
5365
|
for (var e = 1; e < arguments.length; e++) {
|
|
5436
5366
|
var t = arguments[e];
|
|
5437
5367
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
5438
5368
|
}
|
|
5439
5369
|
return n;
|
|
5440
|
-
}, _extends$
|
|
5370
|
+
}, _extends$5.apply(null, arguments);
|
|
5441
5371
|
}
|
|
5442
5372
|
function _slicedToArray$2(r, e) {
|
|
5443
5373
|
return _arrayWithHoles$2(r) || _iterableToArrayLimit$2(r, e) || _unsupportedIterableToArray$2(r, e) || _nonIterableRest$2();
|
|
@@ -5479,16 +5409,16 @@ function _iterableToArrayLimit$2(r, l) {
|
|
|
5479
5409
|
function _arrayWithHoles$2(r) {
|
|
5480
5410
|
if (Array.isArray(r)) return r;
|
|
5481
5411
|
}
|
|
5482
|
-
function _objectWithoutProperties$
|
|
5412
|
+
function _objectWithoutProperties$5(e, t) {
|
|
5483
5413
|
if (null == e) return {};
|
|
5484
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
5414
|
+
var o, r, i = _objectWithoutPropertiesLoose$5(e, t);
|
|
5485
5415
|
if (Object.getOwnPropertySymbols) {
|
|
5486
5416
|
var n = Object.getOwnPropertySymbols(e);
|
|
5487
5417
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
5488
5418
|
}
|
|
5489
5419
|
return i;
|
|
5490
5420
|
}
|
|
5491
|
-
function _objectWithoutPropertiesLoose$
|
|
5421
|
+
function _objectWithoutPropertiesLoose$5(r, e) {
|
|
5492
5422
|
if (null == r) return {};
|
|
5493
5423
|
var t = {};
|
|
5494
5424
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -5517,7 +5447,7 @@ var getTheme = function getTheme2(key, fallback) {
|
|
|
5517
5447
|
return theme || fallback;
|
|
5518
5448
|
};
|
|
5519
5449
|
var ThemeProvider = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
5520
|
-
var currentTheme = _ref.currentTheme, themeList = _ref.themeList, children = _ref.children, props = _objectWithoutProperties$
|
|
5450
|
+
var currentTheme = _ref.currentTheme, themeList = _ref.themeList, children = _ref.children, props = _objectWithoutProperties$5(_ref, _excluded$5);
|
|
5521
5451
|
var _useState = useState(false), _useState2 = _slicedToArray$2(_useState, 2), shouldRender = _useState2[0], setShouldRender = _useState2[1];
|
|
5522
5452
|
var _useState3 = useState(function() {
|
|
5523
5453
|
return getTheme(storageKey) || currentTheme;
|
|
@@ -5552,32 +5482,32 @@ var ThemeProvider = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5552
5482
|
}, [currentTheme, setTheme]);
|
|
5553
5483
|
return /* @__PURE__ */ React.createElement(ThemeContext.Provider, {
|
|
5554
5484
|
value: [themeState, setTheme]
|
|
5555
|
-
}, /* @__PURE__ */ React.createElement(Element, _extends$
|
|
5485
|
+
}, /* @__PURE__ */ React.createElement(Element, _extends$5({
|
|
5556
5486
|
as: "div",
|
|
5557
5487
|
"data-theme-provider": true,
|
|
5558
5488
|
ref
|
|
5559
5489
|
}, props), shouldRender && children));
|
|
5560
5490
|
});
|
|
5561
|
-
var _excluded$
|
|
5562
|
-
function _extends$
|
|
5563
|
-
return _extends$
|
|
5491
|
+
var _excluded$4 = ["position"];
|
|
5492
|
+
function _extends$4() {
|
|
5493
|
+
return _extends$4 = Object.assign ? Object.assign.bind() : function(n) {
|
|
5564
5494
|
for (var e = 1; e < arguments.length; e++) {
|
|
5565
5495
|
var t = arguments[e];
|
|
5566
5496
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
5567
5497
|
}
|
|
5568
5498
|
return n;
|
|
5569
|
-
}, _extends$
|
|
5499
|
+
}, _extends$4.apply(null, arguments);
|
|
5570
5500
|
}
|
|
5571
|
-
function _objectWithoutProperties$
|
|
5501
|
+
function _objectWithoutProperties$4(e, t) {
|
|
5572
5502
|
if (null == e) return {};
|
|
5573
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
5503
|
+
var o, r, i = _objectWithoutPropertiesLoose$4(e, t);
|
|
5574
5504
|
if (Object.getOwnPropertySymbols) {
|
|
5575
5505
|
var n = Object.getOwnPropertySymbols(e);
|
|
5576
5506
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
5577
5507
|
}
|
|
5578
5508
|
return i;
|
|
5579
5509
|
}
|
|
5580
|
-
function _objectWithoutPropertiesLoose$
|
|
5510
|
+
function _objectWithoutPropertiesLoose$4(r, e) {
|
|
5581
5511
|
if (null == r) return {};
|
|
5582
5512
|
var t = {};
|
|
5583
5513
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -5587,27 +5517,27 @@ function _objectWithoutPropertiesLoose$3(r, e) {
|
|
|
5587
5517
|
return t;
|
|
5588
5518
|
}
|
|
5589
5519
|
var ToastsWrapper = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
5590
|
-
var position = _ref.position, props = _objectWithoutProperties$
|
|
5520
|
+
var position = _ref.position, props = _objectWithoutProperties$4(_ref, _excluded$4);
|
|
5591
5521
|
var classNames = [];
|
|
5592
5522
|
if (position) {
|
|
5593
5523
|
classNames.push(position);
|
|
5594
5524
|
}
|
|
5595
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
5525
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$4({
|
|
5596
5526
|
as: "div",
|
|
5597
5527
|
"data-toasts-wrapper": true,
|
|
5598
5528
|
ref,
|
|
5599
5529
|
classNames
|
|
5600
5530
|
}, props));
|
|
5601
5531
|
});
|
|
5602
|
-
var _excluded$
|
|
5603
|
-
function _extends$
|
|
5604
|
-
return _extends$
|
|
5532
|
+
var _excluded$3 = ["showWhen", "children", "secondsToShowFor", "closeWhen"];
|
|
5533
|
+
function _extends$3() {
|
|
5534
|
+
return _extends$3 = Object.assign ? Object.assign.bind() : function(n) {
|
|
5605
5535
|
for (var e = 1; e < arguments.length; e++) {
|
|
5606
5536
|
var t = arguments[e];
|
|
5607
5537
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
5608
5538
|
}
|
|
5609
5539
|
return n;
|
|
5610
|
-
}, _extends$
|
|
5540
|
+
}, _extends$3.apply(null, arguments);
|
|
5611
5541
|
}
|
|
5612
5542
|
function _slicedToArray$1(r, e) {
|
|
5613
5543
|
return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest$1();
|
|
@@ -5649,16 +5579,16 @@ function _iterableToArrayLimit$1(r, l) {
|
|
|
5649
5579
|
function _arrayWithHoles$1(r) {
|
|
5650
5580
|
if (Array.isArray(r)) return r;
|
|
5651
5581
|
}
|
|
5652
|
-
function _objectWithoutProperties$
|
|
5582
|
+
function _objectWithoutProperties$3(e, t) {
|
|
5653
5583
|
if (null == e) return {};
|
|
5654
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
5584
|
+
var o, r, i = _objectWithoutPropertiesLoose$3(e, t);
|
|
5655
5585
|
if (Object.getOwnPropertySymbols) {
|
|
5656
5586
|
var n = Object.getOwnPropertySymbols(e);
|
|
5657
5587
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
5658
5588
|
}
|
|
5659
5589
|
return i;
|
|
5660
5590
|
}
|
|
5661
|
-
function _objectWithoutPropertiesLoose$
|
|
5591
|
+
function _objectWithoutPropertiesLoose$3(r, e) {
|
|
5662
5592
|
if (null == r) return {};
|
|
5663
5593
|
var t = {};
|
|
5664
5594
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -5668,7 +5598,7 @@ function _objectWithoutPropertiesLoose$2(r, e) {
|
|
|
5668
5598
|
return t;
|
|
5669
5599
|
}
|
|
5670
5600
|
var ToastItem = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
5671
|
-
var showWhen = _ref.showWhen, children = _ref.children, secondsToShowFor = _ref.secondsToShowFor, closeWhen = _ref.closeWhen, props = _objectWithoutProperties$
|
|
5601
|
+
var showWhen = _ref.showWhen, children = _ref.children, secondsToShowFor = _ref.secondsToShowFor, closeWhen = _ref.closeWhen, props = _objectWithoutProperties$3(_ref, _excluded$3);
|
|
5672
5602
|
var classNames = [];
|
|
5673
5603
|
var _useState = useState(showWhen !== null && showWhen !== void 0 ? showWhen : false), _useState2 = _slicedToArray$1(_useState, 2), isVisible = _useState2[0], setIsVisible = _useState2[1];
|
|
5674
5604
|
useEffect(function() {
|
|
@@ -5685,7 +5615,7 @@ var ToastItem = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5685
5615
|
var onTransitionEnd = function onTransitionEnd2() {
|
|
5686
5616
|
if (!showWhen) setIsVisible(false);
|
|
5687
5617
|
};
|
|
5688
|
-
return isVisible && /* @__PURE__ */ React.createElement(Element, _extends$
|
|
5618
|
+
return isVisible && /* @__PURE__ */ React.createElement(Element, _extends$3({
|
|
5689
5619
|
as: "div",
|
|
5690
5620
|
"data-toast-item": true,
|
|
5691
5621
|
classNames: [].concat(classNames, [showWhen ? "visible" : ""]),
|
|
@@ -5693,15 +5623,15 @@ var ToastItem = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5693
5623
|
shadow: "soft"
|
|
5694
5624
|
}, props), children);
|
|
5695
5625
|
});
|
|
5696
|
-
var _excluded$
|
|
5697
|
-
function _extends$
|
|
5698
|
-
return _extends$
|
|
5626
|
+
var _excluded$2 = ["children", "isTooltipFor", "showOn", "position", "className"];
|
|
5627
|
+
function _extends$2() {
|
|
5628
|
+
return _extends$2 = Object.assign ? Object.assign.bind() : function(n) {
|
|
5699
5629
|
for (var e = 1; e < arguments.length; e++) {
|
|
5700
5630
|
var t = arguments[e];
|
|
5701
5631
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
5702
5632
|
}
|
|
5703
5633
|
return n;
|
|
5704
|
-
}, _extends$
|
|
5634
|
+
}, _extends$2.apply(null, arguments);
|
|
5705
5635
|
}
|
|
5706
5636
|
function _slicedToArray(r, e) {
|
|
5707
5637
|
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
@@ -5743,16 +5673,16 @@ function _iterableToArrayLimit(r, l) {
|
|
|
5743
5673
|
function _arrayWithHoles(r) {
|
|
5744
5674
|
if (Array.isArray(r)) return r;
|
|
5745
5675
|
}
|
|
5746
|
-
function _objectWithoutProperties$
|
|
5676
|
+
function _objectWithoutProperties$2(e, t) {
|
|
5747
5677
|
if (null == e) return {};
|
|
5748
|
-
var o, r, i = _objectWithoutPropertiesLoose$
|
|
5678
|
+
var o, r, i = _objectWithoutPropertiesLoose$2(e, t);
|
|
5749
5679
|
if (Object.getOwnPropertySymbols) {
|
|
5750
5680
|
var n = Object.getOwnPropertySymbols(e);
|
|
5751
5681
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
5752
5682
|
}
|
|
5753
5683
|
return i;
|
|
5754
5684
|
}
|
|
5755
|
-
function _objectWithoutPropertiesLoose$
|
|
5685
|
+
function _objectWithoutPropertiesLoose$2(r, e) {
|
|
5756
5686
|
if (null == r) return {};
|
|
5757
5687
|
var t = {};
|
|
5758
5688
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -5820,7 +5750,7 @@ var calculatePosition = function calculatePosition2(tooltipElement, targetElemen
|
|
|
5820
5750
|
var Tooltip = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
5821
5751
|
var children = _ref.children, isTooltipFor = _ref.isTooltipFor, _ref$showOn = _ref.showOn, showOn = _ref$showOn === void 0 ? "hover" : _ref$showOn, _ref$position = _ref.position, position = _ref$position === void 0 ? "top" : _ref$position;
|
|
5822
5752
|
_ref.className;
|
|
5823
|
-
var props = _objectWithoutProperties$
|
|
5753
|
+
var props = _objectWithoutProperties$2(_ref, _excluded$2);
|
|
5824
5754
|
var _useState = useState(false), _useState2 = _slicedToArray(_useState, 2), isVisible = _useState2[0], setIsVisible = _useState2[1];
|
|
5825
5755
|
var _useState3 = useState({
|
|
5826
5756
|
top: -9999,
|
|
@@ -5881,7 +5811,7 @@ var Tooltip = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5881
5811
|
window.removeEventListener("resize", updatePosition);
|
|
5882
5812
|
};
|
|
5883
5813
|
}, [isTooltipFor, showOn, position]);
|
|
5884
|
-
return /* @__PURE__ */ React.createElement(Element, _extends$
|
|
5814
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$2({
|
|
5885
5815
|
as: "div",
|
|
5886
5816
|
"data-tooltip": true,
|
|
5887
5817
|
ref: effectiveRef,
|
|
@@ -5895,26 +5825,26 @@ var Tooltip = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5895
5825
|
}
|
|
5896
5826
|
}, props), children);
|
|
5897
5827
|
});
|
|
5898
|
-
var _excluded = ["fontStyle", "weight", "align"];
|
|
5899
|
-
function _extends() {
|
|
5900
|
-
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
5828
|
+
var _excluded$1 = ["fontStyle", "weight", "align"];
|
|
5829
|
+
function _extends$1() {
|
|
5830
|
+
return _extends$1 = Object.assign ? Object.assign.bind() : function(n) {
|
|
5901
5831
|
for (var e = 1; e < arguments.length; e++) {
|
|
5902
5832
|
var t = arguments[e];
|
|
5903
5833
|
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
5904
5834
|
}
|
|
5905
5835
|
return n;
|
|
5906
|
-
}, _extends.apply(null, arguments);
|
|
5836
|
+
}, _extends$1.apply(null, arguments);
|
|
5907
5837
|
}
|
|
5908
|
-
function _objectWithoutProperties(e, t) {
|
|
5838
|
+
function _objectWithoutProperties$1(e, t) {
|
|
5909
5839
|
if (null == e) return {};
|
|
5910
|
-
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
5840
|
+
var o, r, i = _objectWithoutPropertiesLoose$1(e, t);
|
|
5911
5841
|
if (Object.getOwnPropertySymbols) {
|
|
5912
5842
|
var n = Object.getOwnPropertySymbols(e);
|
|
5913
5843
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
5914
5844
|
}
|
|
5915
5845
|
return i;
|
|
5916
5846
|
}
|
|
5917
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
5847
|
+
function _objectWithoutPropertiesLoose$1(r, e) {
|
|
5918
5848
|
if (null == r) return {};
|
|
5919
5849
|
var t = {};
|
|
5920
5850
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -5924,7 +5854,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
5924
5854
|
return t;
|
|
5925
5855
|
}
|
|
5926
5856
|
var Heading = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
5927
|
-
var _ref$fontStyle = _ref.fontStyle, fontStyle = _ref$fontStyle === void 0 ? "sans-serif" : _ref$fontStyle, weight = _ref.weight, align = _ref.align, props = _objectWithoutProperties(_ref, _excluded);
|
|
5857
|
+
var _ref$fontStyle = _ref.fontStyle, fontStyle = _ref$fontStyle === void 0 ? "sans-serif" : _ref$fontStyle, weight = _ref.weight, align = _ref.align, props = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
5928
5858
|
var classNames = [];
|
|
5929
5859
|
if (weight) {
|
|
5930
5860
|
classNames.push("weight-".concat(weight));
|
|
@@ -5935,122 +5865,225 @@ var Heading = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
|
5935
5865
|
if (align) {
|
|
5936
5866
|
classNames.push("text-".concat(align));
|
|
5937
5867
|
}
|
|
5938
|
-
return /* @__PURE__ */ React.createElement(Element, _extends({
|
|
5868
|
+
return /* @__PURE__ */ React.createElement(Element, _extends$1({
|
|
5939
5869
|
ref,
|
|
5940
5870
|
classNames
|
|
5941
5871
|
}, props));
|
|
5942
5872
|
});
|
|
5943
5873
|
var Heading1 = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
5944
|
-
return /* @__PURE__ */ React.createElement(Heading, _extends({
|
|
5874
|
+
return /* @__PURE__ */ React.createElement(Heading, _extends$1({
|
|
5945
5875
|
as: "h1",
|
|
5946
5876
|
ref
|
|
5947
5877
|
}, props));
|
|
5948
5878
|
});
|
|
5949
5879
|
var Heading2 = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
5950
|
-
return /* @__PURE__ */ React.createElement(Heading, _extends({
|
|
5880
|
+
return /* @__PURE__ */ React.createElement(Heading, _extends$1({
|
|
5951
5881
|
as: "h2",
|
|
5952
5882
|
ref
|
|
5953
5883
|
}, props));
|
|
5954
5884
|
});
|
|
5955
5885
|
var Heading3 = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
5956
|
-
return /* @__PURE__ */ React.createElement(Heading, _extends({
|
|
5886
|
+
return /* @__PURE__ */ React.createElement(Heading, _extends$1({
|
|
5957
5887
|
as: "h3",
|
|
5958
5888
|
ref
|
|
5959
5889
|
}, props));
|
|
5960
5890
|
});
|
|
5961
5891
|
var Heading4 = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
5962
|
-
return /* @__PURE__ */ React.createElement(Heading, _extends({
|
|
5892
|
+
return /* @__PURE__ */ React.createElement(Heading, _extends$1({
|
|
5963
5893
|
as: "h4",
|
|
5964
5894
|
ref
|
|
5965
5895
|
}, props));
|
|
5966
5896
|
});
|
|
5967
5897
|
var Heading5 = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
5968
|
-
return /* @__PURE__ */ React.createElement(Heading, _extends({
|
|
5898
|
+
return /* @__PURE__ */ React.createElement(Heading, _extends$1({
|
|
5969
5899
|
as: "h5",
|
|
5970
5900
|
ref
|
|
5971
5901
|
}, props));
|
|
5972
5902
|
});
|
|
5973
5903
|
var Heading6 = /* @__PURE__ */ React.forwardRef(function(props, ref) {
|
|
5974
|
-
return /* @__PURE__ */ React.createElement(Heading, _extends({
|
|
5904
|
+
return /* @__PURE__ */ React.createElement(Heading, _extends$1({
|
|
5975
5905
|
as: "h6",
|
|
5976
5906
|
ref
|
|
5977
5907
|
}, props));
|
|
5978
5908
|
});
|
|
5909
|
+
var _excluded = ["id", "children", "classNames", "isDismissible", "showBackdrop", "blurBackdrop", "label", "description"];
|
|
5910
|
+
function _extends() {
|
|
5911
|
+
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
5912
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
5913
|
+
var t = arguments[e];
|
|
5914
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
5915
|
+
}
|
|
5916
|
+
return n;
|
|
5917
|
+
}, _extends.apply(null, arguments);
|
|
5918
|
+
}
|
|
5919
|
+
function _objectWithoutProperties(e, t) {
|
|
5920
|
+
if (null == e) return {};
|
|
5921
|
+
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
5922
|
+
if (Object.getOwnPropertySymbols) {
|
|
5923
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
5924
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
5925
|
+
}
|
|
5926
|
+
return i;
|
|
5927
|
+
}
|
|
5928
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
5929
|
+
if (null == r) return {};
|
|
5930
|
+
var t = {};
|
|
5931
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
5932
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
5933
|
+
t[n] = r[n];
|
|
5934
|
+
}
|
|
5935
|
+
return t;
|
|
5936
|
+
}
|
|
5937
|
+
var Modal = /* @__PURE__ */ React.forwardRef(function(_ref, ref) {
|
|
5938
|
+
var id = _ref.id, children = _ref.children, _ref$classNames = _ref.classNames, classNames = _ref$classNames === void 0 ? [] : _ref$classNames, _ref$isDismissible = _ref.isDismissible, isDismissible = _ref$isDismissible === void 0 ? true : _ref$isDismissible, showBackdrop = _ref.showBackdrop, blurBackdrop = _ref.blurBackdrop, label = _ref.label, description = _ref.description, props = _objectWithoutProperties(_ref, _excluded);
|
|
5939
|
+
var modalId = "".concat(id);
|
|
5940
|
+
var descriptionId = description ? "".concat(modalId, "-description") : void 0;
|
|
5941
|
+
if (showBackdrop) {
|
|
5942
|
+
classNames.push("show-backdrop");
|
|
5943
|
+
}
|
|
5944
|
+
if (blurBackdrop) {
|
|
5945
|
+
classNames.push("blur-backdrop");
|
|
5946
|
+
}
|
|
5947
|
+
useEffect(function() {
|
|
5948
|
+
var handleEscape = function handleEscape2(e) {
|
|
5949
|
+
if (e.key === "Escape" && isDismissible) {
|
|
5950
|
+
hideModal(id);
|
|
5951
|
+
}
|
|
5952
|
+
};
|
|
5953
|
+
document.addEventListener("keydown", handleEscape);
|
|
5954
|
+
return function() {
|
|
5955
|
+
return document.removeEventListener("keydown", handleEscape);
|
|
5956
|
+
};
|
|
5957
|
+
}, [id, isDismissible]);
|
|
5958
|
+
return /* @__PURE__ */ React.createElement(Element, _extends({
|
|
5959
|
+
as: "dialog",
|
|
5960
|
+
id: modalId,
|
|
5961
|
+
"data-modal": true,
|
|
5962
|
+
popover: isDismissible ? "auto" : "manual",
|
|
5963
|
+
ref,
|
|
5964
|
+
classNames,
|
|
5965
|
+
role: "dialog",
|
|
5966
|
+
"aria-modal": "true",
|
|
5967
|
+
"aria-label": label || "Modal dialog",
|
|
5968
|
+
"aria-describedby": descriptionId
|
|
5969
|
+
}, props), isDismissible && /* @__PURE__ */ React.createElement(Text, {
|
|
5970
|
+
className: "dismiss-button",
|
|
5971
|
+
onClick: function onClick() {
|
|
5972
|
+
return hideModal(id);
|
|
5973
|
+
},
|
|
5974
|
+
"aria-label": "Close modal",
|
|
5975
|
+
tabIndex: 0
|
|
5976
|
+
}, "×"), description && /* @__PURE__ */ React.createElement("div", {
|
|
5977
|
+
id: descriptionId,
|
|
5978
|
+
className: "sr-only"
|
|
5979
|
+
}, description), /* @__PURE__ */ React.createElement("div", {
|
|
5980
|
+
role: "document"
|
|
5981
|
+
}, children));
|
|
5982
|
+
});
|
|
5983
|
+
var showModal = function showModal2(modalId) {
|
|
5984
|
+
var modal = document.querySelector("#".concat(modalId, "[data-modal]"));
|
|
5985
|
+
if (modal instanceof HTMLElement) {
|
|
5986
|
+
modal.showPopover();
|
|
5987
|
+
var focusableElements = modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
5988
|
+
if (focusableElements.length) {
|
|
5989
|
+
focusableElements[0].focus();
|
|
5990
|
+
}
|
|
5991
|
+
}
|
|
5992
|
+
};
|
|
5993
|
+
var hideModal = function hideModal2(modalId) {
|
|
5994
|
+
var modal = document.querySelector("#".concat(modalId, "[data-modal]"));
|
|
5995
|
+
if (modal instanceof HTMLElement) {
|
|
5996
|
+
modal.hidePopover();
|
|
5997
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
5998
|
+
document.activeElement.blur();
|
|
5999
|
+
}
|
|
6000
|
+
}
|
|
6001
|
+
};
|
|
6002
|
+
var toggleModal = function toggleModal2(modalId) {
|
|
6003
|
+
var modal = document.querySelector("#".concat(modalId, "[data-modal]"));
|
|
6004
|
+
if (modal instanceof HTMLElement) {
|
|
6005
|
+
modal.matches(":popover-open") ? hideModal(modalId) : showModal(modalId);
|
|
6006
|
+
}
|
|
6007
|
+
};
|
|
5979
6008
|
export {
|
|
5980
|
-
|
|
6009
|
+
useOptionCard as $,
|
|
5981
6010
|
Accordion as A,
|
|
5982
6011
|
Badge as B,
|
|
5983
6012
|
Callout as C,
|
|
5984
6013
|
Drawer as D,
|
|
5985
6014
|
Element as E,
|
|
5986
6015
|
Footer as F,
|
|
5987
|
-
|
|
6016
|
+
Range as G,
|
|
5988
6017
|
Header as H,
|
|
5989
6018
|
InputField as I,
|
|
5990
|
-
|
|
5991
|
-
|
|
6019
|
+
RadioTabGroup as J,
|
|
6020
|
+
Meter as K,
|
|
5992
6021
|
ListBox as L,
|
|
5993
6022
|
Main as M,
|
|
5994
6023
|
Nav as N,
|
|
5995
|
-
|
|
6024
|
+
Modal as O,
|
|
5996
6025
|
PinInputField as P,
|
|
5997
|
-
|
|
6026
|
+
NotificationsWrapper as Q,
|
|
5998
6027
|
RadioGroup as R,
|
|
5999
6028
|
Section as S,
|
|
6000
6029
|
TextArea as T,
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6030
|
+
NotificationItem as U,
|
|
6031
|
+
Pagination as V,
|
|
6032
|
+
Portion as W,
|
|
6033
|
+
ProgressBar as X,
|
|
6034
|
+
Row as Y,
|
|
6035
|
+
OptionCard as Z,
|
|
6036
|
+
OptionCardsGroup as _,
|
|
6008
6037
|
Button as a,
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6038
|
+
useOptionCardsGroup as a0,
|
|
6039
|
+
SidebarWrapper as a1,
|
|
6040
|
+
ContentWrapper as a2,
|
|
6041
|
+
SidebarHeader as a3,
|
|
6042
|
+
SidebarItem as a4,
|
|
6043
|
+
SidebarFooter as a5,
|
|
6044
|
+
Skeleton as a6,
|
|
6045
|
+
SkeletonGroup as a7,
|
|
6046
|
+
Spinner as a8,
|
|
6047
|
+
Table as a9,
|
|
6048
|
+
Tabs as aa,
|
|
6049
|
+
ThemeProvider as ab,
|
|
6050
|
+
useTheme as ac,
|
|
6051
|
+
ToastsWrapper as ad,
|
|
6052
|
+
ToastItem as ae,
|
|
6053
|
+
Tooltip as af,
|
|
6054
|
+
Heading1 as ag,
|
|
6055
|
+
Heading2 as ah,
|
|
6056
|
+
Heading3 as ai,
|
|
6057
|
+
Heading4 as aj,
|
|
6058
|
+
Heading5 as ak,
|
|
6059
|
+
Heading6 as al,
|
|
6060
|
+
Text as am,
|
|
6061
|
+
showModal as an,
|
|
6062
|
+
hideModal as ao,
|
|
6063
|
+
toggleModal as ap,
|
|
6031
6064
|
Breadcrumbs as b,
|
|
6032
6065
|
Card as c,
|
|
6033
6066
|
CodeBlock as d,
|
|
6034
6067
|
Divider as e,
|
|
6035
6068
|
Div as f,
|
|
6036
6069
|
Article as g,
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6070
|
+
hideDrawer as h,
|
|
6071
|
+
isDrawerOpen as i,
|
|
6072
|
+
Aside as j,
|
|
6073
|
+
Body as k,
|
|
6074
|
+
Span as l,
|
|
6075
|
+
Hyperlink as m,
|
|
6076
|
+
Form as n,
|
|
6077
|
+
FormItem as o,
|
|
6078
|
+
FormItemGroup as p,
|
|
6079
|
+
InputLabel as q,
|
|
6080
|
+
Select as r,
|
|
6081
|
+
showDrawer as s,
|
|
6082
|
+
toggleDrawer as t,
|
|
6083
|
+
FileUpload as u,
|
|
6084
|
+
RadioButton as v,
|
|
6085
|
+
Checkbox as w,
|
|
6086
|
+
CheckboxGroup as x,
|
|
6087
|
+
Switch as y,
|
|
6088
|
+
SwitchGroup as z
|
|
6056
6089
|
};
|