@norges-domstoler/dds-components 0.0.0-dev-20250902141644 → 0.0.0-dev-20250904073534
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/index.js +169 -161
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5909,7 +5909,7 @@ function CookieBanner({
|
|
|
5909
5909
|
gap: styleUpToBreakpoint("x1", "sm", "x1.5"),
|
|
5910
5910
|
flexWrap: "wrap",
|
|
5911
5911
|
paddingBlock: "x0.25 0",
|
|
5912
|
-
children: buttons.map((props) => /* @__PURE__ */ (0,
|
|
5912
|
+
children: buttons.map((props, i) => /* @__PURE__ */ (0, import_react37.createElement)(Button, { ...props, size: "medium", purpose: "secondary", key: i }))
|
|
5913
5913
|
}
|
|
5914
5914
|
)
|
|
5915
5915
|
]
|
|
@@ -9295,6 +9295,7 @@ var NavigationItem = ({ isCurrent, ...rest }) => /* @__PURE__ */ (0, import_jsx_
|
|
|
9295
9295
|
|
|
9296
9296
|
// src/components/InternalHeader/InternalHeader.tsx
|
|
9297
9297
|
var import_jsx_runtime277 = require("react/jsx-runtime");
|
|
9298
|
+
var import_react67 = require("react");
|
|
9298
9299
|
var InternalHeader = (props) => {
|
|
9299
9300
|
const {
|
|
9300
9301
|
applicationDesc,
|
|
@@ -9329,7 +9330,7 @@ var InternalHeader = (props) => {
|
|
|
9329
9330
|
as: StylelessList,
|
|
9330
9331
|
hideBelow: hasSmallScreenBreakpoint ? smallScreenBreakpoint : void 0,
|
|
9331
9332
|
className: cn(InternalHeader_default["nav-list"]),
|
|
9332
|
-
children: navItems.map((item,
|
|
9333
|
+
children: navItems.map((item, i) => {
|
|
9333
9334
|
const { href, ...rest2 } = item;
|
|
9334
9335
|
const isCurrent = href === currentPage;
|
|
9335
9336
|
return /* @__PURE__ */ (0, import_jsx_runtime277.jsx)("li", { className: InternalHeader_default["nav-list__item"], children: /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(
|
|
@@ -9340,7 +9341,7 @@ var InternalHeader = (props) => {
|
|
|
9340
9341
|
isCurrent,
|
|
9341
9342
|
onClick: () => handleCurrentPageChange(href)
|
|
9342
9343
|
}
|
|
9343
|
-
) },
|
|
9344
|
+
) }, i);
|
|
9344
9345
|
})
|
|
9345
9346
|
}
|
|
9346
9347
|
) }) : null;
|
|
@@ -9398,7 +9399,7 @@ var InternalHeader = (props) => {
|
|
|
9398
9399
|
as: "nav",
|
|
9399
9400
|
"aria-label": t(texts16.siteNavigation),
|
|
9400
9401
|
showBelow: smallScreenBreakpoint,
|
|
9401
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(OverflowMenuList, { children: navItems.map((item) => /* @__PURE__ */ (0,
|
|
9402
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(OverflowMenuList, { children: navItems.map((item, i) => /* @__PURE__ */ (0, import_react67.createElement)(OverflowMenuLink, { ...item, key: `nav-${i}` })) })
|
|
9402
9403
|
}
|
|
9403
9404
|
),
|
|
9404
9405
|
hasNavInContextMenu && hasContextMenuElements && /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(
|
|
@@ -9408,11 +9409,18 @@ var InternalHeader = (props) => {
|
|
|
9408
9409
|
showBelow: smallScreenBreakpoint
|
|
9409
9410
|
}
|
|
9410
9411
|
),
|
|
9411
|
-
hasContextMenuElements && /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(OverflowMenuList, { children: contextMenuItems.map((item) => {
|
|
9412
|
-
return item.href ? /* @__PURE__ */ (0,
|
|
9412
|
+
hasContextMenuElements && /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(OverflowMenuList, { children: contextMenuItems.map((item, i) => {
|
|
9413
|
+
return item.href ? /* @__PURE__ */ (0, import_react67.createElement)(
|
|
9414
|
+
OverflowMenuLink,
|
|
9415
|
+
{
|
|
9416
|
+
...item,
|
|
9417
|
+
key: `context-${i}`
|
|
9418
|
+
}
|
|
9419
|
+
) : /* @__PURE__ */ (0, import_react67.createElement)(
|
|
9413
9420
|
OverflowMenuButton,
|
|
9414
9421
|
{
|
|
9415
|
-
...item
|
|
9422
|
+
...item,
|
|
9423
|
+
key: `context-${i}`
|
|
9416
9424
|
}
|
|
9417
9425
|
);
|
|
9418
9426
|
}) })
|
|
@@ -9482,7 +9490,7 @@ var ListItem = ({ className, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtim
|
|
|
9482
9490
|
ListItem.displayName = "ListItem";
|
|
9483
9491
|
|
|
9484
9492
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
9485
|
-
var
|
|
9493
|
+
var import_react68 = require("react");
|
|
9486
9494
|
|
|
9487
9495
|
// src/components/LocalMessage/LocalMessage.module.css
|
|
9488
9496
|
var LocalMessage_default = {
|
|
@@ -9525,7 +9533,7 @@ var LocalMessage = ({
|
|
|
9525
9533
|
...rest
|
|
9526
9534
|
}) => {
|
|
9527
9535
|
const { t } = useTranslation();
|
|
9528
|
-
const [isClosed, setClosed] = (0,
|
|
9536
|
+
const [isClosed, setClosed] = (0, import_react68.useState)(false);
|
|
9529
9537
|
if (isClosed) {
|
|
9530
9538
|
return /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(import_jsx_runtime280.Fragment, {});
|
|
9531
9539
|
}
|
|
@@ -9579,7 +9587,7 @@ var LocalMessage = ({
|
|
|
9579
9587
|
LocalMessage.displayName = "LocalMessage";
|
|
9580
9588
|
|
|
9581
9589
|
// src/components/Modal/Modal.tsx
|
|
9582
|
-
var
|
|
9590
|
+
var import_react69 = require("react");
|
|
9583
9591
|
var import_react_dom4 = require("react-dom");
|
|
9584
9592
|
|
|
9585
9593
|
// src/components/Modal/Modal.module.css
|
|
@@ -9609,7 +9617,7 @@ var Modal = ({
|
|
|
9609
9617
|
ref,
|
|
9610
9618
|
...rest
|
|
9611
9619
|
}) => {
|
|
9612
|
-
const generatedId = (0,
|
|
9620
|
+
const generatedId = (0, import_react69.useId)();
|
|
9613
9621
|
const modalId = id != null ? id : `${generatedId}-modal`;
|
|
9614
9622
|
const headerId = `${modalId}-header`;
|
|
9615
9623
|
const modalRef = useFocusTrap(isOpen, initialFocusRef);
|
|
@@ -9621,13 +9629,13 @@ var Modal = ({
|
|
|
9621
9629
|
onClose();
|
|
9622
9630
|
}
|
|
9623
9631
|
};
|
|
9624
|
-
const themeContext = (0,
|
|
9632
|
+
const themeContext = (0, import_react69.useContext)(ThemeContext);
|
|
9625
9633
|
if (!themeContext) {
|
|
9626
9634
|
throw new Error("Modal must be used within a ThemeProvider");
|
|
9627
9635
|
}
|
|
9628
9636
|
const { t } = useTranslation();
|
|
9629
9637
|
const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
|
|
9630
|
-
(0,
|
|
9638
|
+
(0, import_react69.useEffect)(() => {
|
|
9631
9639
|
if (isOpen) {
|
|
9632
9640
|
handleElementWithBackdropMount(document.body);
|
|
9633
9641
|
} else {
|
|
@@ -9635,7 +9643,7 @@ var Modal = ({
|
|
|
9635
9643
|
}
|
|
9636
9644
|
return () => handleElementWithBackdropUnmount(document.body);
|
|
9637
9645
|
}, [isOpen]);
|
|
9638
|
-
const backdropRef = (0,
|
|
9646
|
+
const backdropRef = (0, import_react69.useRef)(null);
|
|
9639
9647
|
const onBackdropClick = (event) => {
|
|
9640
9648
|
if (event.target === backdropRef.current && isOpen) {
|
|
9641
9649
|
handleClose();
|
|
@@ -9752,7 +9760,7 @@ var ModalActions = (props) => /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(Box
|
|
|
9752
9760
|
ModalActions.displayName = "ModalActions";
|
|
9753
9761
|
|
|
9754
9762
|
// src/components/Pagination/Pagination.tsx
|
|
9755
|
-
var
|
|
9763
|
+
var import_react73 = require("react");
|
|
9756
9764
|
|
|
9757
9765
|
// src/components/Pagination/Pagination.module.css
|
|
9758
9766
|
var Pagination_default = {
|
|
@@ -9797,7 +9805,7 @@ function PaginationGenerator(pagesAmount, activePage) {
|
|
|
9797
9805
|
}
|
|
9798
9806
|
|
|
9799
9807
|
// src/components/Select/Select.tsx
|
|
9800
|
-
var
|
|
9808
|
+
var import_react71 = require("react");
|
|
9801
9809
|
var import_react_select2 = __toESM(require("react-select"));
|
|
9802
9810
|
|
|
9803
9811
|
// src/components/Select/Select.module.css
|
|
@@ -10077,7 +10085,7 @@ var getCustomStyles = (size2, hasError, hasIcon, isReadOnly) => ({
|
|
|
10077
10085
|
});
|
|
10078
10086
|
|
|
10079
10087
|
// src/components/Select/SelectComponents.tsx
|
|
10080
|
-
var
|
|
10088
|
+
var import_react70 = __toESM(require("react"));
|
|
10081
10089
|
var import_react_select = require("react-select");
|
|
10082
10090
|
var import_jsx_runtime284 = require("react/jsx-runtime");
|
|
10083
10091
|
var {
|
|
@@ -10107,7 +10115,7 @@ var DDSOption = ({
|
|
|
10107
10115
|
props.isSelected && /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(Icon, { icon: CheckIcon, iconSize: getFormInputIconSize(componentSize) }),
|
|
10108
10116
|
props.children
|
|
10109
10117
|
] });
|
|
10110
|
-
var CustomOption = (props) => /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(Option, { ...props, children:
|
|
10118
|
+
var CustomOption = (props) => /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(Option, { ...props, children: import_react70.default.createElement(props.customElement, props) });
|
|
10111
10119
|
var CustomSingleValue = ({
|
|
10112
10120
|
id,
|
|
10113
10121
|
Element,
|
|
@@ -10224,12 +10232,12 @@ function Select({
|
|
|
10224
10232
|
instanceId,
|
|
10225
10233
|
...rest
|
|
10226
10234
|
}) {
|
|
10227
|
-
const themeContext = (0,
|
|
10235
|
+
const themeContext = (0, import_react71.useContext)(ThemeContext);
|
|
10228
10236
|
if (!themeContext) {
|
|
10229
10237
|
throw new Error("Select must be used within a ThemeProvider");
|
|
10230
10238
|
}
|
|
10231
10239
|
const portalTarget = menuPortalTarget != null ? menuPortalTarget : themeContext == null ? void 0 : themeContext.el;
|
|
10232
|
-
const generatedId = (0,
|
|
10240
|
+
const generatedId = (0, import_react71.useId)();
|
|
10233
10241
|
const uniqueId = id != null ? id : `${generatedId}-select`;
|
|
10234
10242
|
const singleValueId = !isMulti ? `${uniqueId}-singleValue` : void 0;
|
|
10235
10243
|
const hasLabel = !!label;
|
|
@@ -10242,7 +10250,7 @@ function Select({
|
|
|
10242
10250
|
width,
|
|
10243
10251
|
componentSize === "xsmall" && "var(--dds-input-default-width-xsmall)"
|
|
10244
10252
|
);
|
|
10245
|
-
const customInput = (0,
|
|
10253
|
+
const customInput = (0, import_react71.useCallback)(
|
|
10246
10254
|
(props) => /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(
|
|
10247
10255
|
DDSInput,
|
|
10248
10256
|
{
|
|
@@ -10260,7 +10268,7 @@ function Select({
|
|
|
10260
10268
|
),
|
|
10261
10269
|
[]
|
|
10262
10270
|
);
|
|
10263
|
-
const customSingleValue = (0,
|
|
10271
|
+
const customSingleValue = (0, import_react71.useCallback)(
|
|
10264
10272
|
(props) => /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(
|
|
10265
10273
|
CustomSingleValue,
|
|
10266
10274
|
{
|
|
@@ -10271,15 +10279,15 @@ function Select({
|
|
|
10271
10279
|
),
|
|
10272
10280
|
[]
|
|
10273
10281
|
);
|
|
10274
|
-
const customClearIndicator = (0,
|
|
10282
|
+
const customClearIndicator = (0, import_react71.useCallback)(
|
|
10275
10283
|
(props) => /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(DDSClearIndicator, { ...props, size: componentSize }),
|
|
10276
10284
|
[componentSize]
|
|
10277
10285
|
);
|
|
10278
|
-
const customDropdownIndicator = (0,
|
|
10286
|
+
const customDropdownIndicator = (0, import_react71.useCallback)(
|
|
10279
10287
|
(props) => /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(DDSDropdownIndicator, { ...props, componentSize }),
|
|
10280
10288
|
[componentSize]
|
|
10281
10289
|
);
|
|
10282
|
-
const customControl = (0,
|
|
10290
|
+
const customControl = (0, import_react71.useCallback)(
|
|
10283
10291
|
(props) => /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(
|
|
10284
10292
|
DDSControl,
|
|
10285
10293
|
{
|
|
@@ -10292,7 +10300,7 @@ function Select({
|
|
|
10292
10300
|
),
|
|
10293
10301
|
[componentSize, readOnly, icon, dataTestId]
|
|
10294
10302
|
);
|
|
10295
|
-
const customOptionComponent = (0,
|
|
10303
|
+
const customOptionComponent = (0, import_react71.useCallback)(
|
|
10296
10304
|
(props) => {
|
|
10297
10305
|
if (customOptionElement) {
|
|
10298
10306
|
return /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(CustomOption, { ...props, customElement: customOptionElement });
|
|
@@ -10311,7 +10319,7 @@ function Select({
|
|
|
10311
10319
|
placeholder: placeholder ? placeholder : "",
|
|
10312
10320
|
closeMenuOnSelect: closeMenuOnSelect ? closeMenuOnSelect : isMulti ? false : true,
|
|
10313
10321
|
isMulti,
|
|
10314
|
-
instanceId: instanceId != null ? instanceId : (0,
|
|
10322
|
+
instanceId: instanceId != null ? instanceId : (0, import_react71.useId)(),
|
|
10315
10323
|
inputId: uniqueId,
|
|
10316
10324
|
name: uniqueId,
|
|
10317
10325
|
menuPortalTarget: portalTarget,
|
|
@@ -10374,7 +10382,7 @@ function Select({
|
|
|
10374
10382
|
Select.displayName = "Select";
|
|
10375
10383
|
|
|
10376
10384
|
// src/components/Select/NativeSelect/NativeSelect.tsx
|
|
10377
|
-
var
|
|
10385
|
+
var import_react72 = require("react");
|
|
10378
10386
|
|
|
10379
10387
|
// src/components/Select/NativeSelect/NativeSelect.module.css
|
|
10380
10388
|
var NativeSelect_default = {
|
|
@@ -10416,14 +10424,14 @@ var NativeSelect = ({
|
|
|
10416
10424
|
...rest
|
|
10417
10425
|
}) => {
|
|
10418
10426
|
const { t } = useTranslation();
|
|
10419
|
-
const selectRef = (0,
|
|
10420
|
-
const [hasValue, setHasValue] = (0,
|
|
10421
|
-
(0,
|
|
10427
|
+
const selectRef = (0, import_react72.useRef)(null);
|
|
10428
|
+
const [hasValue, setHasValue] = (0, import_react72.useState)(false);
|
|
10429
|
+
(0, import_react72.useEffect)(() => {
|
|
10422
10430
|
var _a, _b;
|
|
10423
10431
|
const selectedIndex = (_b = (_a = selectRef.current) == null ? void 0 : _a.selectedIndex) != null ? _b : -1;
|
|
10424
10432
|
setHasValue(selectedIndex !== 0);
|
|
10425
10433
|
}, []);
|
|
10426
|
-
(0,
|
|
10434
|
+
(0, import_react72.useEffect)(() => {
|
|
10427
10435
|
var _a;
|
|
10428
10436
|
if (clearable) {
|
|
10429
10437
|
const firstOption = (_a = selectRef.current) == null ? void 0 : _a.options[0];
|
|
@@ -10436,7 +10444,7 @@ var NativeSelect = ({
|
|
|
10436
10444
|
}
|
|
10437
10445
|
}
|
|
10438
10446
|
}, [clearable]);
|
|
10439
|
-
const generatedId = (0,
|
|
10447
|
+
const generatedId = (0, import_react72.useId)();
|
|
10440
10448
|
const uniqueId = id != null ? id : `${generatedId}-native-select`;
|
|
10441
10449
|
const hasErrorMessage = !!errorMessage;
|
|
10442
10450
|
const hasTip = !!tip;
|
|
@@ -10561,8 +10569,8 @@ var Pagination = ({
|
|
|
10561
10569
|
...rest
|
|
10562
10570
|
}) => {
|
|
10563
10571
|
const { t } = useTranslation();
|
|
10564
|
-
const [activePage, setActivePage] = (0,
|
|
10565
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
10572
|
+
const [activePage, setActivePage] = (0, import_react73.useState)(defaultActivePage);
|
|
10573
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react73.useState)(defaultItemsPerPage);
|
|
10566
10574
|
const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
|
|
10567
10575
|
const items = PaginationGenerator(pagesLength, activePage);
|
|
10568
10576
|
const onPageChange = (event, page) => {
|
|
@@ -10862,7 +10870,7 @@ var texts17 = createTexts({
|
|
|
10862
10870
|
});
|
|
10863
10871
|
|
|
10864
10872
|
// src/components/PhoneInput/PhoneInput.tsx
|
|
10865
|
-
var
|
|
10873
|
+
var import_react74 = require("react");
|
|
10866
10874
|
|
|
10867
10875
|
// src/components/PhoneInput/constants.ts
|
|
10868
10876
|
var COUNTRIES = {
|
|
@@ -11323,7 +11331,7 @@ var PhoneInput = ({
|
|
|
11323
11331
|
const { t } = useTranslation();
|
|
11324
11332
|
const tGroupLabel = groupLabel != null ? groupLabel : t(texts18.countryCodeAndPhoneNumber);
|
|
11325
11333
|
const tSelectLabel = selectLabel != null ? selectLabel : t(texts18.countryCode);
|
|
11326
|
-
const generatedId = (0,
|
|
11334
|
+
const generatedId = (0, import_react74.useId)();
|
|
11327
11335
|
const uniqueId = (_a = props.id) != null ? _a : generatedId;
|
|
11328
11336
|
const phoneInputId = `${uniqueId}-phone-input`;
|
|
11329
11337
|
const phoneNumberId = `${uniqueId}-phone-number`;
|
|
@@ -11334,27 +11342,27 @@ var PhoneInput = ({
|
|
|
11334
11342
|
const hasMessage = hasErrorMessage || hasTip;
|
|
11335
11343
|
const tipId = derivativeIdGenerator(phoneInputId, "tip");
|
|
11336
11344
|
const errorMessageId = derivativeIdGenerator(phoneInputId, "errorMessage");
|
|
11337
|
-
const [callingCode, setCallingCode] = (0,
|
|
11338
|
-
const [selectedCountryCodeText, setSelectedCountryCodeText] = (0,
|
|
11339
|
-
const [internalValue, setInternalValue] = (0,
|
|
11345
|
+
const [callingCode, setCallingCode] = (0, import_react74.useState)("");
|
|
11346
|
+
const [selectedCountryCodeText, setSelectedCountryCodeText] = (0, import_react74.useState)("");
|
|
11347
|
+
const [internalValue, setInternalValue] = (0, import_react74.useState)(
|
|
11340
11348
|
defaultValue != null ? defaultValue : {
|
|
11341
11349
|
countryCode: "",
|
|
11342
11350
|
phoneNumber: ""
|
|
11343
11351
|
}
|
|
11344
11352
|
);
|
|
11345
11353
|
const isControlled = value !== void 0;
|
|
11346
|
-
const [callingCodeWidth, setCallingCodeWidth] = (0,
|
|
11347
|
-
const callingCodeRef = (0,
|
|
11348
|
-
(0,
|
|
11354
|
+
const [callingCodeWidth, setCallingCodeWidth] = (0, import_react74.useState)(0);
|
|
11355
|
+
const callingCodeRef = (0, import_react74.useRef)(null);
|
|
11356
|
+
(0, import_react74.useLayoutEffect)(() => {
|
|
11349
11357
|
if (callingCodeRef.current) {
|
|
11350
11358
|
setCallingCodeWidth(callingCodeRef.current.offsetWidth);
|
|
11351
11359
|
}
|
|
11352
11360
|
}, [callingCode]);
|
|
11353
11361
|
const callingCodeInlineStart = callingCodeWidth ? `calc(var(--dds-spacing-x1) + ${callingCodeWidth}px)` : void 0;
|
|
11354
|
-
const internalSelectRef = (0,
|
|
11362
|
+
const internalSelectRef = (0, import_react74.useRef)(null);
|
|
11355
11363
|
const combinedSelectRef = useCombinedRef(selectRef, internalSelectRef);
|
|
11356
11364
|
const displayedValue = isControlled ? value : internalValue;
|
|
11357
|
-
(0,
|
|
11365
|
+
(0, import_react74.useEffect)(() => {
|
|
11358
11366
|
const selectEl = internalSelectRef.current;
|
|
11359
11367
|
if (selectEl && selectEl.value) {
|
|
11360
11368
|
const { options, selectedIndex } = selectEl;
|
|
@@ -11516,7 +11524,7 @@ var texts18 = createTexts({
|
|
|
11516
11524
|
});
|
|
11517
11525
|
|
|
11518
11526
|
// src/components/Popover/Popover.tsx
|
|
11519
|
-
var
|
|
11527
|
+
var import_react76 = require("react");
|
|
11520
11528
|
var import_react_dom5 = require("react-dom");
|
|
11521
11529
|
|
|
11522
11530
|
// src/components/Popover/Popover.module.css
|
|
@@ -11528,9 +11536,9 @@ var Popover_default = {
|
|
|
11528
11536
|
};
|
|
11529
11537
|
|
|
11530
11538
|
// src/components/Popover/Popover.context.tsx
|
|
11531
|
-
var
|
|
11532
|
-
var PopoverContext = (0,
|
|
11533
|
-
var usePopoverContext = () => (0,
|
|
11539
|
+
var import_react75 = require("react");
|
|
11540
|
+
var PopoverContext = (0, import_react75.createContext)({});
|
|
11541
|
+
var usePopoverContext = () => (0, import_react75.useContext)(PopoverContext);
|
|
11534
11542
|
|
|
11535
11543
|
// src/components/Popover/Popover.tsx
|
|
11536
11544
|
var import_jsx_runtime289 = require("react/jsx-runtime");
|
|
@@ -11560,7 +11568,7 @@ var Popover = ({
|
|
|
11560
11568
|
});
|
|
11561
11569
|
const { maxHeight, maxWidth, minHeight, minWidth, height, width } = sizeProps;
|
|
11562
11570
|
const context = usePopoverContext();
|
|
11563
|
-
const themeContext = (0,
|
|
11571
|
+
const themeContext = (0, import_react76.useContext)(ThemeContext);
|
|
11564
11572
|
const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
|
|
11565
11573
|
const {
|
|
11566
11574
|
floatStyling: contextFloatStyling,
|
|
@@ -11573,7 +11581,7 @@ var Popover = ({
|
|
|
11573
11581
|
} = context;
|
|
11574
11582
|
const { t } = useTranslation();
|
|
11575
11583
|
const hasContext = !isEmpty(context);
|
|
11576
|
-
const generatedId = (0,
|
|
11584
|
+
const generatedId = (0, import_react76.useId)();
|
|
11577
11585
|
const uniquePopoverId = id != null ? id : `${generatedId}-popover`;
|
|
11578
11586
|
const [
|
|
11579
11587
|
popoverId,
|
|
@@ -11610,7 +11618,7 @@ var Popover = ({
|
|
|
11610
11618
|
anchorEl && anchorEl
|
|
11611
11619
|
);
|
|
11612
11620
|
const multiRef = useCombinedRef(ref, popoverRef, floatingRef);
|
|
11613
|
-
(0,
|
|
11621
|
+
(0, import_react76.useEffect)(() => {
|
|
11614
11622
|
setFloatOptions == null ? void 0 : setFloatOptions({ placement, offset });
|
|
11615
11623
|
}, [placement, offset]);
|
|
11616
11624
|
useOnClickOutside([popoverRef.current, anchorEl], () => {
|
|
@@ -11679,7 +11687,7 @@ var Popover = ({
|
|
|
11679
11687
|
Popover.displayName = "Popover";
|
|
11680
11688
|
|
|
11681
11689
|
// src/components/Popover/PopoverGroup.tsx
|
|
11682
|
-
var
|
|
11690
|
+
var import_react77 = require("react");
|
|
11683
11691
|
var import_jsx_runtime290 = require("react/jsx-runtime");
|
|
11684
11692
|
var PopoverGroup = ({
|
|
11685
11693
|
isOpen: propIsOpen,
|
|
@@ -11691,12 +11699,12 @@ var PopoverGroup = ({
|
|
|
11691
11699
|
popoverId
|
|
11692
11700
|
}) => {
|
|
11693
11701
|
var _a;
|
|
11694
|
-
const [internalIsOpen, internalSetIsOpen] = (0,
|
|
11702
|
+
const [internalIsOpen, internalSetIsOpen] = (0, import_react77.useState)(isInitiallyOpen);
|
|
11695
11703
|
const open = propIsOpen != null ? propIsOpen : internalIsOpen;
|
|
11696
11704
|
const setOpen = propSetIsOpen != null ? propSetIsOpen : internalSetIsOpen;
|
|
11697
|
-
const generatedId = (0,
|
|
11705
|
+
const generatedId = (0, import_react77.useId)();
|
|
11698
11706
|
const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
|
|
11699
|
-
const [floatOptions, setFloatOptions] = (0,
|
|
11707
|
+
const [floatOptions, setFloatOptions] = (0, import_react77.useState)();
|
|
11700
11708
|
const { refs, styles: positionStyles } = useFloatPosition(null, floatOptions);
|
|
11701
11709
|
const handleClose = () => {
|
|
11702
11710
|
setOpen(false);
|
|
@@ -11713,10 +11721,10 @@ var PopoverGroup = ({
|
|
|
11713
11721
|
handleOpen();
|
|
11714
11722
|
}
|
|
11715
11723
|
};
|
|
11716
|
-
const buttonRef = (0,
|
|
11724
|
+
const buttonRef = (0, import_react77.useRef)(null);
|
|
11717
11725
|
const anchorRef = refs.setReference;
|
|
11718
11726
|
const combinedAnchorRef = useCombinedRef(buttonRef, anchorRef);
|
|
11719
|
-
const popoverRef = (0,
|
|
11727
|
+
const popoverRef = (0, import_react77.useRef)(null);
|
|
11720
11728
|
const floatingRef = refs.setFloating;
|
|
11721
11729
|
const combinedPopoverRef = useCombinedRef(popoverRef, floatingRef);
|
|
11722
11730
|
useOnKeyDown(["Esc", "Escape"], () => {
|
|
@@ -11732,8 +11740,8 @@ var PopoverGroup = ({
|
|
|
11732
11740
|
if (open) handleClose();
|
|
11733
11741
|
});
|
|
11734
11742
|
const isAnchorChild = (i) => i === 0;
|
|
11735
|
-
const Children7 =
|
|
11736
|
-
return (0,
|
|
11743
|
+
const Children7 = import_react77.Children.map(children, (child, childIndex) => {
|
|
11744
|
+
return (0, import_react77.isValidElement)(child) && (isAnchorChild(childIndex) ? (0, import_react77.cloneElement)(child, {
|
|
11737
11745
|
"aria-haspopup": "dialog",
|
|
11738
11746
|
"aria-controls": uniquePopoverId,
|
|
11739
11747
|
"aria-expanded": open,
|
|
@@ -11760,17 +11768,17 @@ var PopoverGroup = ({
|
|
|
11760
11768
|
PopoverGroup.displayName = "PopoverGroup";
|
|
11761
11769
|
|
|
11762
11770
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
11763
|
-
var
|
|
11771
|
+
var import_react80 = require("react");
|
|
11764
11772
|
|
|
11765
11773
|
// src/components/ProgressTracker/ProgressTracker.context.tsx
|
|
11766
|
-
var
|
|
11767
|
-
var ProgressTrackerContext = (0,
|
|
11774
|
+
var import_react78 = require("react");
|
|
11775
|
+
var ProgressTrackerContext = (0, import_react78.createContext)(
|
|
11768
11776
|
{
|
|
11769
11777
|
activeStep: 0,
|
|
11770
11778
|
direction: "column"
|
|
11771
11779
|
}
|
|
11772
11780
|
);
|
|
11773
|
-
var useProgressTrackerContext = () => (0,
|
|
11781
|
+
var useProgressTrackerContext = () => (0, import_react78.useContext)(ProgressTrackerContext);
|
|
11774
11782
|
|
|
11775
11783
|
// src/components/ProgressTracker/ProgressTracker.module.css
|
|
11776
11784
|
var ProgressTracker_default = {
|
|
@@ -11795,7 +11803,7 @@ var ProgressTracker_default = {
|
|
|
11795
11803
|
};
|
|
11796
11804
|
|
|
11797
11805
|
// src/components/ProgressTracker/ProgressTrackerItem.tsx
|
|
11798
|
-
var
|
|
11806
|
+
var import_react79 = require("react");
|
|
11799
11807
|
var import_jsx_runtime291 = require("react/jsx-runtime");
|
|
11800
11808
|
var toItemState = (active, completed, disabled) => {
|
|
11801
11809
|
if (disabled) {
|
|
@@ -11837,7 +11845,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
11837
11845
|
handleStepChange == null ? void 0 : handleStepChange(index);
|
|
11838
11846
|
}
|
|
11839
11847
|
};
|
|
11840
|
-
const stepNumberContent = (0,
|
|
11848
|
+
const stepNumberContent = (0, import_react79.useMemo)(() => {
|
|
11841
11849
|
if (completed) {
|
|
11842
11850
|
return /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(Icon, { icon: CheckIcon, iconSize: "small" });
|
|
11843
11851
|
}
|
|
@@ -11949,17 +11957,17 @@ var ProgressTracker = (() => {
|
|
|
11949
11957
|
...rest
|
|
11950
11958
|
}) => {
|
|
11951
11959
|
const { t } = useTranslation();
|
|
11952
|
-
const [thisActiveStep, setActiveStep] = (0,
|
|
11960
|
+
const [thisActiveStep, setActiveStep] = (0, import_react80.useState)(activeStep);
|
|
11953
11961
|
const handleChange = (step) => {
|
|
11954
11962
|
setActiveStep(step);
|
|
11955
11963
|
onStepChange == null ? void 0 : onStepChange(step);
|
|
11956
11964
|
};
|
|
11957
|
-
(0,
|
|
11965
|
+
(0, import_react80.useEffect)(() => {
|
|
11958
11966
|
if (activeStep !== void 0 && activeStep != thisActiveStep) {
|
|
11959
11967
|
setActiveStep(activeStep);
|
|
11960
11968
|
}
|
|
11961
11969
|
}, [activeStep, thisActiveStep]);
|
|
11962
|
-
const steps = (0,
|
|
11970
|
+
const steps = (0, import_react80.useMemo)(() => {
|
|
11963
11971
|
const validChildren = removeInvalidChildren(children);
|
|
11964
11972
|
const itemsWithIndex = passIndexPropToProgressTrackerItem(validChildren);
|
|
11965
11973
|
return itemsWithIndex;
|
|
@@ -12004,12 +12012,12 @@ var ProgressTracker = (() => {
|
|
|
12004
12012
|
return Res;
|
|
12005
12013
|
})();
|
|
12006
12014
|
function removeInvalidChildren(children) {
|
|
12007
|
-
return
|
|
12015
|
+
return import_react80.Children.toArray(children).filter(import_react80.isValidElement);
|
|
12008
12016
|
}
|
|
12009
12017
|
function passIndexPropToProgressTrackerItem(children) {
|
|
12010
|
-
return
|
|
12018
|
+
return import_react80.Children.map(
|
|
12011
12019
|
children,
|
|
12012
|
-
(item, index) => (0,
|
|
12020
|
+
(item, index) => (0, import_react80.cloneElement)(item, {
|
|
12013
12021
|
...item.props,
|
|
12014
12022
|
index
|
|
12015
12023
|
})
|
|
@@ -12025,7 +12033,7 @@ var texts20 = createTexts({
|
|
|
12025
12033
|
});
|
|
12026
12034
|
|
|
12027
12035
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
12028
|
-
var
|
|
12036
|
+
var import_react81 = require("react");
|
|
12029
12037
|
|
|
12030
12038
|
// src/components/ProgressBar/ProgressBar.module.css
|
|
12031
12039
|
var ProgressBar_default = {
|
|
@@ -12054,7 +12062,7 @@ var ProgressBar = ({
|
|
|
12054
12062
|
style,
|
|
12055
12063
|
...rest
|
|
12056
12064
|
}) => {
|
|
12057
|
-
const generatedId = (0,
|
|
12065
|
+
const generatedId = (0, import_react81.useId)();
|
|
12058
12066
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
12059
12067
|
const hasErrorMessage = !!errorMessage;
|
|
12060
12068
|
const hasTip = !!tip;
|
|
@@ -12110,13 +12118,13 @@ var ProgressBar = ({
|
|
|
12110
12118
|
ProgressBar.displayName = "ProgressBar";
|
|
12111
12119
|
|
|
12112
12120
|
// src/components/Search/Search.tsx
|
|
12113
|
-
var
|
|
12121
|
+
var import_react84 = require("react");
|
|
12114
12122
|
|
|
12115
12123
|
// src/components/Search/AutocompleteSearch.context.tsx
|
|
12116
|
-
var
|
|
12117
|
-
var AutocompleteSearchContext = (0,
|
|
12124
|
+
var import_react82 = require("react");
|
|
12125
|
+
var AutocompleteSearchContext = (0, import_react82.createContext)({});
|
|
12118
12126
|
var useAutocompleteSearch = () => {
|
|
12119
|
-
return (0,
|
|
12127
|
+
return (0, import_react82.useContext)(AutocompleteSearchContext);
|
|
12120
12128
|
};
|
|
12121
12129
|
|
|
12122
12130
|
// src/components/Search/Search.module.css
|
|
@@ -12137,7 +12145,7 @@ var typographyTypes2 = {
|
|
|
12137
12145
|
};
|
|
12138
12146
|
|
|
12139
12147
|
// src/components/Search/SearchSuggestionItem.tsx
|
|
12140
|
-
var
|
|
12148
|
+
var import_react83 = require("react");
|
|
12141
12149
|
var import_jsx_runtime294 = require("react/jsx-runtime");
|
|
12142
12150
|
var SearchSuggestionItem = ({
|
|
12143
12151
|
focus,
|
|
@@ -12145,9 +12153,9 @@ var SearchSuggestionItem = ({
|
|
|
12145
12153
|
ref,
|
|
12146
12154
|
...rest
|
|
12147
12155
|
}) => {
|
|
12148
|
-
const itemRef = (0,
|
|
12156
|
+
const itemRef = (0, import_react83.useRef)(null);
|
|
12149
12157
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
12150
|
-
(0,
|
|
12158
|
+
(0, import_react83.useEffect)(() => {
|
|
12151
12159
|
var _a;
|
|
12152
12160
|
if (focus) {
|
|
12153
12161
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
@@ -12302,7 +12310,7 @@ var Search = ({
|
|
|
12302
12310
|
...rest
|
|
12303
12311
|
}) => {
|
|
12304
12312
|
var _a;
|
|
12305
|
-
const generatedId = (0,
|
|
12313
|
+
const generatedId = (0, import_react84.useId)();
|
|
12306
12314
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
12307
12315
|
const hasLabel = !!label;
|
|
12308
12316
|
const tipId = derivativeIdGenerator(uniqueId, "tip");
|
|
@@ -12312,7 +12320,7 @@ var Search = ({
|
|
|
12312
12320
|
"suggestions-description"
|
|
12313
12321
|
);
|
|
12314
12322
|
const { t } = useTranslation();
|
|
12315
|
-
const [hasValue, setHasValue] = (0,
|
|
12323
|
+
const [hasValue, setHasValue] = (0, import_react84.useState)(!!value);
|
|
12316
12324
|
const context = useAutocompleteSearch();
|
|
12317
12325
|
const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
|
|
12318
12326
|
const handleChange = (e) => {
|
|
@@ -12460,7 +12468,7 @@ var texts22 = createTexts({
|
|
|
12460
12468
|
});
|
|
12461
12469
|
|
|
12462
12470
|
// src/components/Search/SearchAutocompleteWrapper.tsx
|
|
12463
|
-
var
|
|
12471
|
+
var import_react85 = require("react");
|
|
12464
12472
|
var import_jsx_runtime297 = require("react/jsx-runtime");
|
|
12465
12473
|
var SearchAutocompleteWrapper = (props) => {
|
|
12466
12474
|
const {
|
|
@@ -12472,12 +12480,12 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
12472
12480
|
onSuggestionSelection,
|
|
12473
12481
|
children
|
|
12474
12482
|
} = props;
|
|
12475
|
-
const [inputValue, setInputValue] = (0,
|
|
12476
|
-
const [suggestions, setSuggestions] = (0,
|
|
12477
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
12483
|
+
const [inputValue, setInputValue] = (0, import_react85.useState)(value != null ? value : "");
|
|
12484
|
+
const [suggestions, setSuggestions] = (0, import_react85.useState)([]);
|
|
12485
|
+
const [showSuggestions, setShowSuggestions] = (0, import_react85.useState)(false);
|
|
12478
12486
|
const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
|
|
12479
12487
|
const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
|
|
12480
|
-
(0,
|
|
12488
|
+
(0, import_react85.useEffect)(() => {
|
|
12481
12489
|
if (suggestions.length > 0) {
|
|
12482
12490
|
openSuggestions();
|
|
12483
12491
|
} else {
|
|
@@ -12522,8 +12530,8 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
12522
12530
|
const handleSetInputValue = (value2) => {
|
|
12523
12531
|
setInputValue(value2 != null ? value2 : "");
|
|
12524
12532
|
};
|
|
12525
|
-
const inputRef = (0,
|
|
12526
|
-
const suggestionsRef = (0,
|
|
12533
|
+
const inputRef = (0, import_react85.useRef)(null);
|
|
12534
|
+
const suggestionsRef = (0, import_react85.useRef)(null);
|
|
12527
12535
|
useOnClickOutside([inputRef.current, suggestionsRef.current], () => {
|
|
12528
12536
|
closeSuggestions();
|
|
12529
12537
|
});
|
|
@@ -12605,7 +12613,7 @@ var SkipToContent = ({
|
|
|
12605
12613
|
SkipToContent.displayName = "SkipToContent";
|
|
12606
12614
|
|
|
12607
12615
|
// src/components/SplitButton/SplitButton.tsx
|
|
12608
|
-
var
|
|
12616
|
+
var import_react86 = require("react");
|
|
12609
12617
|
|
|
12610
12618
|
// src/components/SplitButton/SplitButton.module.css
|
|
12611
12619
|
var SplitButton_default = {
|
|
@@ -12626,7 +12634,7 @@ var SplitButton = ({
|
|
|
12626
12634
|
...rest
|
|
12627
12635
|
}) => {
|
|
12628
12636
|
const { t } = useTranslation();
|
|
12629
|
-
const [isOpen, setIsOpen] = (0,
|
|
12637
|
+
const [isOpen, setIsOpen] = (0, import_react86.useState)(false);
|
|
12630
12638
|
const buttonStyleProps = {
|
|
12631
12639
|
purpose,
|
|
12632
12640
|
size: size2
|
|
@@ -12671,15 +12679,15 @@ var texts23 = createTexts({
|
|
|
12671
12679
|
});
|
|
12672
12680
|
|
|
12673
12681
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
12674
|
-
var
|
|
12682
|
+
var import_react90 = require("react");
|
|
12675
12683
|
|
|
12676
12684
|
// src/components/Table/collapsible/Table.context.tsx
|
|
12677
|
-
var
|
|
12678
|
-
var CollapsibleTableContext = (0,
|
|
12685
|
+
var import_react87 = require("react");
|
|
12686
|
+
var CollapsibleTableContext = (0, import_react87.createContext)({
|
|
12679
12687
|
headerValues: [],
|
|
12680
12688
|
definingColumnIndex: [0]
|
|
12681
12689
|
});
|
|
12682
|
-
var useCollapsibleTableContext = () => (0,
|
|
12690
|
+
var useCollapsibleTableContext = () => (0, import_react87.useContext)(CollapsibleTableContext);
|
|
12683
12691
|
|
|
12684
12692
|
// src/components/Table/normal/Body.tsx
|
|
12685
12693
|
var import_jsx_runtime301 = require("react/jsx-runtime");
|
|
@@ -12687,12 +12695,12 @@ var Body = (props) => /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("tbody", {
|
|
|
12687
12695
|
Body.displayName = "Table.Body";
|
|
12688
12696
|
|
|
12689
12697
|
// src/components/Table/normal/Head.tsx
|
|
12690
|
-
var
|
|
12698
|
+
var import_react88 = require("react");
|
|
12691
12699
|
var import_jsx_runtime302 = require("react/jsx-runtime");
|
|
12692
12700
|
var Head = ({ children, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("thead", { ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(HeadContext, { value: true, children }) });
|
|
12693
|
-
var HeadContext = (0,
|
|
12701
|
+
var HeadContext = (0, import_react88.createContext)(false);
|
|
12694
12702
|
function useIsInTableHead() {
|
|
12695
|
-
const isInTableHead = (0,
|
|
12703
|
+
const isInTableHead = (0, import_react88.useContext)(HeadContext);
|
|
12696
12704
|
return isInTableHead;
|
|
12697
12705
|
}
|
|
12698
12706
|
|
|
@@ -12868,26 +12876,26 @@ var Table = ({
|
|
|
12868
12876
|
Table.displayName = "Table";
|
|
12869
12877
|
|
|
12870
12878
|
// src/components/Table/normal/TableWrapper.tsx
|
|
12871
|
-
var
|
|
12879
|
+
var import_react89 = require("react");
|
|
12872
12880
|
var import_jsx_runtime308 = require("react/jsx-runtime");
|
|
12873
12881
|
var TableWrapper = ({ className, ...rest }) => {
|
|
12874
|
-
const themeContext = (0,
|
|
12882
|
+
const themeContext = (0, import_react89.useContext)(ThemeContext);
|
|
12875
12883
|
const container2 = themeContext == null ? void 0 : themeContext.el;
|
|
12876
12884
|
const containerWidth = container2 ? container2.clientWidth : 0;
|
|
12877
|
-
const [overflowX, setOverflowX] = (0,
|
|
12878
|
-
const [themeContainerWidth, setThemeContainerWidth] = (0,
|
|
12885
|
+
const [overflowX, setOverflowX] = (0, import_react89.useState)(false);
|
|
12886
|
+
const [themeContainerWidth, setThemeContainerWidth] = (0, import_react89.useState)(containerWidth);
|
|
12879
12887
|
function isOverflowingX(event) {
|
|
12880
12888
|
return event.offsetWidth < event.scrollWidth;
|
|
12881
12889
|
}
|
|
12882
|
-
const wrapperRef = (0,
|
|
12883
|
-
(0,
|
|
12890
|
+
const wrapperRef = (0, import_react89.useRef)(null);
|
|
12891
|
+
(0, import_react89.useEffect)(() => {
|
|
12884
12892
|
if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
|
|
12885
12893
|
setOverflowX(true);
|
|
12886
12894
|
return;
|
|
12887
12895
|
}
|
|
12888
12896
|
setOverflowX(false);
|
|
12889
12897
|
}, [themeContainerWidth]);
|
|
12890
|
-
(0,
|
|
12898
|
+
(0, import_react89.useEffect)(() => {
|
|
12891
12899
|
function handleResize() {
|
|
12892
12900
|
setThemeContainerWidth(containerWidth);
|
|
12893
12901
|
}
|
|
@@ -12936,8 +12944,8 @@ var CollapsibleRow = ({
|
|
|
12936
12944
|
const isInHead = useIsInTableHead();
|
|
12937
12945
|
const type = _type != null ? _type : isInHead ? "head" : "body";
|
|
12938
12946
|
const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
|
|
12939
|
-
const [childrenCollapsed, setChildrenCollapsed] = (0,
|
|
12940
|
-
(0,
|
|
12947
|
+
const [childrenCollapsed, setChildrenCollapsed] = (0, import_react90.useState)(true);
|
|
12948
|
+
(0, import_react90.useEffect)(() => {
|
|
12941
12949
|
if (!isCollapsed) setChildrenCollapsed(true);
|
|
12942
12950
|
}, [isCollapsed]);
|
|
12943
12951
|
const rowProps = (isOpenCollapsibleHeader) => {
|
|
@@ -12955,7 +12963,7 @@ var CollapsibleRow = ({
|
|
|
12955
12963
|
const collapsedHeaderValues = headerValues.filter(
|
|
12956
12964
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
12957
12965
|
);
|
|
12958
|
-
const childrenArray =
|
|
12966
|
+
const childrenArray = import_react90.Children.toArray(children);
|
|
12959
12967
|
const collapsedChildren = childrenArray.filter(
|
|
12960
12968
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
12961
12969
|
);
|
|
@@ -12964,9 +12972,9 @@ var CollapsibleRow = ({
|
|
|
12964
12972
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
12965
12973
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
12966
12974
|
collapsibleIds.push(id);
|
|
12967
|
-
return /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(
|
|
12975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(import_react90.Fragment, { children: [
|
|
12968
12976
|
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
|
|
12969
|
-
(0,
|
|
12977
|
+
(0, import_react90.isValidElement)(child) && (0, import_react90.cloneElement)(child, {
|
|
12970
12978
|
collapsibleProps: { isCollapsibleChild: true }
|
|
12971
12979
|
})
|
|
12972
12980
|
] }, `DL-${index}`);
|
|
@@ -13060,11 +13068,11 @@ var CollapsibleTable2 = CollapsibleTable;
|
|
|
13060
13068
|
CollapsibleTable2.Row = CollapsibleRow;
|
|
13061
13069
|
|
|
13062
13070
|
// src/components/Tabs/AddTabButton.tsx
|
|
13063
|
-
var
|
|
13071
|
+
var import_react93 = require("react");
|
|
13064
13072
|
|
|
13065
13073
|
// src/components/Tabs/Tabs.context.tsx
|
|
13066
|
-
var
|
|
13067
|
-
var TabsContext = (0,
|
|
13074
|
+
var import_react91 = require("react");
|
|
13075
|
+
var TabsContext = (0, import_react91.createContext)({
|
|
13068
13076
|
activeTab: 0,
|
|
13069
13077
|
tabsId: "",
|
|
13070
13078
|
size: "small",
|
|
@@ -13076,7 +13084,7 @@ var TabsContext = (0, import_react90.createContext)({
|
|
|
13076
13084
|
tabContentDirection: "row",
|
|
13077
13085
|
addTabButtonProps: void 0
|
|
13078
13086
|
});
|
|
13079
|
-
var useTabsContext = () => (0,
|
|
13087
|
+
var useTabsContext = () => (0, import_react91.useContext)(TabsContext);
|
|
13080
13088
|
|
|
13081
13089
|
// src/components/Tabs/Tabs.module.css
|
|
13082
13090
|
var Tabs_default = {
|
|
@@ -13094,9 +13102,9 @@ var Tabs_default = {
|
|
|
13094
13102
|
};
|
|
13095
13103
|
|
|
13096
13104
|
// src/components/Tabs/TabWidthContext.tsx
|
|
13097
|
-
var
|
|
13105
|
+
var import_react92 = require("react");
|
|
13098
13106
|
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
13099
|
-
var TabContext = (0,
|
|
13107
|
+
var TabContext = (0, import_react92.createContext)(null);
|
|
13100
13108
|
function TabWidthContextProvider({
|
|
13101
13109
|
children,
|
|
13102
13110
|
onChangeWidths
|
|
@@ -13125,8 +13133,8 @@ function TabWidthContextProvider({
|
|
|
13125
13133
|
);
|
|
13126
13134
|
}
|
|
13127
13135
|
function useSetTabWidth(index, width) {
|
|
13128
|
-
const context = (0,
|
|
13129
|
-
(0,
|
|
13136
|
+
const context = (0, import_react92.useContext)(TabContext);
|
|
13137
|
+
(0, import_react92.useLayoutEffect)(() => {
|
|
13130
13138
|
context == null ? void 0 : context.updateWidth(index, width);
|
|
13131
13139
|
return () => context == null ? void 0 : context.removeTab(index);
|
|
13132
13140
|
}, [index, width]);
|
|
@@ -13143,7 +13151,7 @@ var AddTabButton = ({
|
|
|
13143
13151
|
...rest
|
|
13144
13152
|
}) => {
|
|
13145
13153
|
useSetTabWidth(index, width);
|
|
13146
|
-
const buttonRef = (0,
|
|
13154
|
+
const buttonRef = (0, import_react93.useRef)(null);
|
|
13147
13155
|
const combinedRef = useCombinedRef(ref, buttonRef);
|
|
13148
13156
|
const { tabContentDirection, size: size2 } = useTabsContext();
|
|
13149
13157
|
return /* @__PURE__ */ (0, import_jsx_runtime312.jsxs)(
|
|
@@ -13168,7 +13176,7 @@ var AddTabButton = ({
|
|
|
13168
13176
|
AddTabButton.displayName = "AddTabButton";
|
|
13169
13177
|
|
|
13170
13178
|
// src/components/Tabs/Tabs.tsx
|
|
13171
|
-
var
|
|
13179
|
+
var import_react94 = require("react");
|
|
13172
13180
|
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
13173
13181
|
var TABS_SIZES = createSizes("small", "medium");
|
|
13174
13182
|
var Tabs = ({
|
|
@@ -13184,17 +13192,17 @@ var Tabs = ({
|
|
|
13184
13192
|
htmlProps,
|
|
13185
13193
|
...rest
|
|
13186
13194
|
}) => {
|
|
13187
|
-
const generatedId = (0,
|
|
13195
|
+
const generatedId = (0, import_react94.useId)();
|
|
13188
13196
|
const uniqueId = id != null ? id : `${generatedId}-tabs`;
|
|
13189
|
-
const [thisActiveTab, setActiveTab] = (0,
|
|
13190
|
-
const [hasTabFocus, setHasTabFocus] = (0,
|
|
13191
|
-
const tabListRef = (0,
|
|
13192
|
-
const tabPanelsRef = (0,
|
|
13197
|
+
const [thisActiveTab, setActiveTab] = (0, import_react94.useState)(activeTab != null ? activeTab : 0);
|
|
13198
|
+
const [hasTabFocus, setHasTabFocus] = (0, import_react94.useState)(false);
|
|
13199
|
+
const tabListRef = (0, import_react94.useRef)(null);
|
|
13200
|
+
const tabPanelsRef = (0, import_react94.useRef)(null);
|
|
13193
13201
|
const handleTabChange = (index) => {
|
|
13194
13202
|
setActiveTab(index);
|
|
13195
13203
|
onChange == null ? void 0 : onChange(index);
|
|
13196
13204
|
};
|
|
13197
|
-
(0,
|
|
13205
|
+
(0, import_react94.useEffect)(() => {
|
|
13198
13206
|
if (activeTab !== void 0 && activeTab !== thisActiveTab) {
|
|
13199
13207
|
setActiveTab(activeTab);
|
|
13200
13208
|
}
|
|
@@ -13228,7 +13236,7 @@ var Tabs = ({
|
|
|
13228
13236
|
Tabs.displayName = "Tabs";
|
|
13229
13237
|
|
|
13230
13238
|
// src/components/Tabs/Tab.tsx
|
|
13231
|
-
var
|
|
13239
|
+
var import_react95 = require("react");
|
|
13232
13240
|
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
13233
13241
|
var Tab = ({
|
|
13234
13242
|
active = false,
|
|
@@ -13247,18 +13255,18 @@ var Tab = ({
|
|
|
13247
13255
|
...rest
|
|
13248
13256
|
}) => {
|
|
13249
13257
|
useSetTabWidth(index, width);
|
|
13250
|
-
const itemRef = (0,
|
|
13258
|
+
const itemRef = (0, import_react95.useRef)(null);
|
|
13251
13259
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
13252
13260
|
const { tabContentDirection, size: size2 } = useTabsContext();
|
|
13253
13261
|
const { type = "button", ...restHtmlProps } = htmlProps;
|
|
13254
13262
|
const fixedHtmlProps = { type, ...restHtmlProps };
|
|
13255
|
-
(0,
|
|
13263
|
+
(0, import_react95.useEffect)(() => {
|
|
13256
13264
|
var _a;
|
|
13257
13265
|
if (focus) {
|
|
13258
13266
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
13259
13267
|
}
|
|
13260
13268
|
}, [focus]);
|
|
13261
|
-
const handleSelect = (0,
|
|
13269
|
+
const handleSelect = (0, import_react95.useCallback)(() => {
|
|
13262
13270
|
if (setFocus && index) {
|
|
13263
13271
|
setFocus(index);
|
|
13264
13272
|
}
|
|
@@ -13304,7 +13312,7 @@ var Tab = ({
|
|
|
13304
13312
|
Tab.displayName = "Tab";
|
|
13305
13313
|
|
|
13306
13314
|
// src/components/Tabs/TabList.tsx
|
|
13307
|
-
var
|
|
13315
|
+
var import_react96 = require("react");
|
|
13308
13316
|
var import_jsx_runtime315 = require("react/jsx-runtime");
|
|
13309
13317
|
var TabList = ({
|
|
13310
13318
|
children,
|
|
@@ -13324,15 +13332,15 @@ var TabList = ({
|
|
|
13324
13332
|
addTabButtonProps
|
|
13325
13333
|
} = useTabsContext();
|
|
13326
13334
|
const uniqueId = id != null ? id : `${tabsId}-tablist`;
|
|
13327
|
-
const childrenArray =
|
|
13335
|
+
const childrenArray = import_react96.Children.toArray(children).length;
|
|
13328
13336
|
const [focus, setFocus] = useRoveFocus(childrenArray, hasTabFocus, "row");
|
|
13329
13337
|
const combinedRef = useCombinedRef(ref, tabListRef);
|
|
13330
13338
|
const hasButton = addTabButtonProps ? true : false;
|
|
13331
|
-
const tabListChildren =
|
|
13339
|
+
const tabListChildren = import_react96.Children ? import_react96.Children.map(children, (child, index) => {
|
|
13332
13340
|
const handleThisTabChange = () => {
|
|
13333
13341
|
handleTabChange(index);
|
|
13334
13342
|
};
|
|
13335
|
-
return (0,
|
|
13343
|
+
return (0, import_react96.isValidElement)(child) && (0, import_react96.cloneElement)(child, {
|
|
13336
13344
|
id: `${tabsId}-tab-${index}`,
|
|
13337
13345
|
htmlProps: {
|
|
13338
13346
|
...child.props.htmlProps,
|
|
@@ -13345,7 +13353,7 @@ var TabList = ({
|
|
|
13345
13353
|
onClick: combineHandlers(handleThisTabChange, child.props.onClick)
|
|
13346
13354
|
});
|
|
13347
13355
|
}) : [];
|
|
13348
|
-
const [widths, setWidths] = (0,
|
|
13356
|
+
const [widths, setWidths] = (0, import_react96.useState)([]);
|
|
13349
13357
|
const handleOnFocus = (event) => {
|
|
13350
13358
|
setHasTabFocus(true);
|
|
13351
13359
|
onFocus == null ? void 0 : onFocus(event);
|
|
@@ -13420,14 +13428,14 @@ var TabPanel = ({
|
|
|
13420
13428
|
TabPanel.displayName = "TabPanel";
|
|
13421
13429
|
|
|
13422
13430
|
// src/components/Tabs/TabPanels.tsx
|
|
13423
|
-
var
|
|
13431
|
+
var import_react97 = require("react");
|
|
13424
13432
|
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
13425
13433
|
var TabPanels = ({ children, ref, ...rest }) => {
|
|
13426
13434
|
const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
|
|
13427
13435
|
const combinedRef = useCombinedRef(ref, tabPanelsRef);
|
|
13428
|
-
const panelChildren =
|
|
13436
|
+
const panelChildren = import_react97.Children.map(children, (child, index) => {
|
|
13429
13437
|
const active = index === activeTab;
|
|
13430
|
-
return (0,
|
|
13438
|
+
return (0, import_react97.isValidElement)(child) && (0, import_react97.cloneElement)(child, {
|
|
13431
13439
|
id: `${tabsId}-panel-${index}`,
|
|
13432
13440
|
active,
|
|
13433
13441
|
htmlProps: {
|
|
@@ -13502,7 +13510,7 @@ var Tag = ({
|
|
|
13502
13510
|
Tag.displayName = "Tag";
|
|
13503
13511
|
|
|
13504
13512
|
// src/components/TextInput/TextInput.tsx
|
|
13505
|
-
var
|
|
13513
|
+
var import_react98 = require("react");
|
|
13506
13514
|
|
|
13507
13515
|
// src/components/TextInput/TextInput.module.css
|
|
13508
13516
|
var TextInput_default = {
|
|
@@ -13551,12 +13559,12 @@ var TextInput = ({
|
|
|
13551
13559
|
ref,
|
|
13552
13560
|
...rest
|
|
13553
13561
|
}) => {
|
|
13554
|
-
const [text, setText] = (0,
|
|
13555
|
-
const prefixRef = (0,
|
|
13556
|
-
const suffixRef = (0,
|
|
13557
|
-
const [prefixLength, setPrefixLength] = (0,
|
|
13558
|
-
const [suffixLength, setSuffixLength] = (0,
|
|
13559
|
-
(0,
|
|
13562
|
+
const [text, setText] = (0, import_react98.useState)(getDefaultText(value, defaultValue));
|
|
13563
|
+
const prefixRef = (0, import_react98.useRef)(null);
|
|
13564
|
+
const suffixRef = (0, import_react98.useRef)(null);
|
|
13565
|
+
const [prefixLength, setPrefixLength] = (0, import_react98.useState)(0);
|
|
13566
|
+
const [suffixLength, setSuffixLength] = (0, import_react98.useState)(0);
|
|
13567
|
+
(0, import_react98.useLayoutEffect)(() => {
|
|
13560
13568
|
requestAnimationFrame(() => {
|
|
13561
13569
|
if (prefixRef.current) {
|
|
13562
13570
|
setPrefixLength(prefixRef.current.offsetWidth);
|
|
@@ -13572,7 +13580,7 @@ var TextInput = ({
|
|
|
13572
13580
|
onChange(event);
|
|
13573
13581
|
}
|
|
13574
13582
|
};
|
|
13575
|
-
const generatedId = (0,
|
|
13583
|
+
const generatedId = (0, import_react98.useId)();
|
|
13576
13584
|
const uniqueId = id != null ? id : `${generatedId}-textInput`;
|
|
13577
13585
|
const hasErrorMessage = !!errorMessage;
|
|
13578
13586
|
const hasTip = !!tip;
|
|
@@ -13742,7 +13750,7 @@ var TextInput = ({
|
|
|
13742
13750
|
TextInput.displayName = "TextInput";
|
|
13743
13751
|
|
|
13744
13752
|
// src/components/Toggle/Toggle.tsx
|
|
13745
|
-
var
|
|
13753
|
+
var import_react99 = require("react");
|
|
13746
13754
|
|
|
13747
13755
|
// src/components/Toggle/Toggle.module.css
|
|
13748
13756
|
var Toggle_default = {
|
|
@@ -13777,7 +13785,7 @@ var Toggle = ({
|
|
|
13777
13785
|
...rest
|
|
13778
13786
|
}) => {
|
|
13779
13787
|
const { t } = useTranslation();
|
|
13780
|
-
const generatedId = (0,
|
|
13788
|
+
const generatedId = (0, import_react99.useId)();
|
|
13781
13789
|
const uniqueId = id != null ? id : `${generatedId}-toggle`;
|
|
13782
13790
|
const iconSize = size2 === "large" ? "medium" : "small";
|
|
13783
13791
|
const [checked, setChecked] = useControllableState({
|
|
@@ -13848,14 +13856,14 @@ var Toggle = ({
|
|
|
13848
13856
|
Toggle.displayName = "Toggle";
|
|
13849
13857
|
|
|
13850
13858
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
13851
|
-
var
|
|
13859
|
+
var import_react101 = require("react");
|
|
13852
13860
|
|
|
13853
13861
|
// src/components/ToggleBar/ToggleBar.context.tsx
|
|
13854
|
-
var
|
|
13855
|
-
var ToggleBarContext = (0,
|
|
13862
|
+
var import_react100 = require("react");
|
|
13863
|
+
var ToggleBarContext = (0, import_react100.createContext)({
|
|
13856
13864
|
size: "medium"
|
|
13857
13865
|
});
|
|
13858
|
-
var useToggleBarContext = () => (0,
|
|
13866
|
+
var useToggleBarContext = () => (0, import_react100.useContext)(ToggleBarContext);
|
|
13859
13867
|
|
|
13860
13868
|
// src/components/ToggleBar/ToggleBar.module.css
|
|
13861
13869
|
var ToggleBar_default = {
|
|
@@ -13888,9 +13896,9 @@ var ToggleBar = (props) => {
|
|
|
13888
13896
|
id,
|
|
13889
13897
|
...rest
|
|
13890
13898
|
} = props;
|
|
13891
|
-
const generatedId = (0,
|
|
13899
|
+
const generatedId = (0, import_react101.useId)();
|
|
13892
13900
|
const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
|
|
13893
|
-
const [groupValue, setGroupValue] = (0,
|
|
13901
|
+
const [groupValue, setGroupValue] = (0, import_react101.useState)(value);
|
|
13894
13902
|
const handleChange = combineHandlers(
|
|
13895
13903
|
(e) => setGroupValue(e.target.value),
|
|
13896
13904
|
(e) => onChange && onChange(e, e.target.value)
|
|
@@ -13925,7 +13933,7 @@ var ToggleBar = (props) => {
|
|
|
13925
13933
|
ToggleBar.displayName = "ToggleBar";
|
|
13926
13934
|
|
|
13927
13935
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
13928
|
-
var
|
|
13936
|
+
var import_react102 = require("react");
|
|
13929
13937
|
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
13930
13938
|
var typographyTypes3 = {
|
|
13931
13939
|
large: "bodyLarge",
|
|
@@ -13957,7 +13965,7 @@ var ToggleRadio = ({
|
|
|
13957
13965
|
id,
|
|
13958
13966
|
...rest
|
|
13959
13967
|
}) => {
|
|
13960
|
-
const generatedId = (0,
|
|
13968
|
+
const generatedId = (0, import_react102.useId)();
|
|
13961
13969
|
const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
|
|
13962
13970
|
const group = useToggleBarContext();
|
|
13963
13971
|
const handleChange = (event) => {
|
|
@@ -14006,7 +14014,7 @@ var ToggleRadio = ({
|
|
|
14006
14014
|
ToggleRadio.displayName = "ToggleRadio";
|
|
14007
14015
|
|
|
14008
14016
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
14009
|
-
var
|
|
14017
|
+
var import_react103 = require("react");
|
|
14010
14018
|
|
|
14011
14019
|
// src/components/ToggleButton/ToggleButton.module.css
|
|
14012
14020
|
var ToggleButton_default = {
|
|
@@ -14027,7 +14035,7 @@ var ToggleButton = ({
|
|
|
14027
14035
|
htmlProps,
|
|
14028
14036
|
...rest
|
|
14029
14037
|
}) => {
|
|
14030
|
-
const generatedId = (0,
|
|
14038
|
+
const generatedId = (0, import_react103.useId)();
|
|
14031
14039
|
const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
|
|
14032
14040
|
const hasIcon = !!icon;
|
|
14033
14041
|
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(Box, { as: "label", htmlFor: uniqueId, width: "fit-content", children: [
|
|
@@ -14065,7 +14073,7 @@ var ToggleButton = ({
|
|
|
14065
14073
|
ToggleButton.displayName = "ToggleButton";
|
|
14066
14074
|
|
|
14067
14075
|
// src/components/ToggleButton/ToggleButtonGroup.tsx
|
|
14068
|
-
var
|
|
14076
|
+
var import_react104 = require("react");
|
|
14069
14077
|
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
14070
14078
|
var ToggleButtonGroup = (props) => {
|
|
14071
14079
|
const {
|
|
@@ -14078,7 +14086,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
14078
14086
|
htmlProps,
|
|
14079
14087
|
...rest
|
|
14080
14088
|
} = props;
|
|
14081
|
-
const generatedId = (0,
|
|
14089
|
+
const generatedId = (0, import_react104.useId)();
|
|
14082
14090
|
const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
|
|
14083
14091
|
return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)(
|
|
14084
14092
|
VStack,
|