@norges-domstoler/dds-components 0.0.0-dev-20250902141644 → 0.0.0-dev-20250904074636
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 +178 -164
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -10
- 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
|
]
|
|
@@ -6740,9 +6740,7 @@ function DateInput({
|
|
|
6740
6740
|
/* @__PURE__ */ (0, import_jsx_runtime233.jsxs)(
|
|
6741
6741
|
Box,
|
|
6742
6742
|
{
|
|
6743
|
-
...fieldProps,
|
|
6744
6743
|
style,
|
|
6745
|
-
ref: internalRef,
|
|
6746
6744
|
width: getInputWidth(width, "fit-content"),
|
|
6747
6745
|
className: cn(
|
|
6748
6746
|
Input_default.input,
|
|
@@ -6762,7 +6760,15 @@ function DateInput({
|
|
|
6762
6760
|
),
|
|
6763
6761
|
children: [
|
|
6764
6762
|
button,
|
|
6765
|
-
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
6763
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)(
|
|
6764
|
+
"div",
|
|
6765
|
+
{
|
|
6766
|
+
...fieldProps,
|
|
6767
|
+
ref: internalRef,
|
|
6768
|
+
className: DateInput_default["date-segment-container"],
|
|
6769
|
+
children
|
|
6770
|
+
}
|
|
6771
|
+
),
|
|
6766
6772
|
suffixEl
|
|
6767
6773
|
]
|
|
6768
6774
|
}
|
|
@@ -9295,6 +9301,7 @@ var NavigationItem = ({ isCurrent, ...rest }) => /* @__PURE__ */ (0, import_jsx_
|
|
|
9295
9301
|
|
|
9296
9302
|
// src/components/InternalHeader/InternalHeader.tsx
|
|
9297
9303
|
var import_jsx_runtime277 = require("react/jsx-runtime");
|
|
9304
|
+
var import_react67 = require("react");
|
|
9298
9305
|
var InternalHeader = (props) => {
|
|
9299
9306
|
const {
|
|
9300
9307
|
applicationDesc,
|
|
@@ -9329,7 +9336,7 @@ var InternalHeader = (props) => {
|
|
|
9329
9336
|
as: StylelessList,
|
|
9330
9337
|
hideBelow: hasSmallScreenBreakpoint ? smallScreenBreakpoint : void 0,
|
|
9331
9338
|
className: cn(InternalHeader_default["nav-list"]),
|
|
9332
|
-
children: navItems.map((item,
|
|
9339
|
+
children: navItems.map((item, i) => {
|
|
9333
9340
|
const { href, ...rest2 } = item;
|
|
9334
9341
|
const isCurrent = href === currentPage;
|
|
9335
9342
|
return /* @__PURE__ */ (0, import_jsx_runtime277.jsx)("li", { className: InternalHeader_default["nav-list__item"], children: /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(
|
|
@@ -9340,7 +9347,7 @@ var InternalHeader = (props) => {
|
|
|
9340
9347
|
isCurrent,
|
|
9341
9348
|
onClick: () => handleCurrentPageChange(href)
|
|
9342
9349
|
}
|
|
9343
|
-
) },
|
|
9350
|
+
) }, i);
|
|
9344
9351
|
})
|
|
9345
9352
|
}
|
|
9346
9353
|
) }) : null;
|
|
@@ -9398,7 +9405,7 @@ var InternalHeader = (props) => {
|
|
|
9398
9405
|
as: "nav",
|
|
9399
9406
|
"aria-label": t(texts16.siteNavigation),
|
|
9400
9407
|
showBelow: smallScreenBreakpoint,
|
|
9401
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(OverflowMenuList, { children: navItems.map((item) => /* @__PURE__ */ (0,
|
|
9408
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(OverflowMenuList, { children: navItems.map((item, i) => /* @__PURE__ */ (0, import_react67.createElement)(OverflowMenuLink, { ...item, key: `nav-${i}` })) })
|
|
9402
9409
|
}
|
|
9403
9410
|
),
|
|
9404
9411
|
hasNavInContextMenu && hasContextMenuElements && /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(
|
|
@@ -9408,11 +9415,18 @@ var InternalHeader = (props) => {
|
|
|
9408
9415
|
showBelow: smallScreenBreakpoint
|
|
9409
9416
|
}
|
|
9410
9417
|
),
|
|
9411
|
-
hasContextMenuElements && /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(OverflowMenuList, { children: contextMenuItems.map((item) => {
|
|
9412
|
-
return item.href ? /* @__PURE__ */ (0,
|
|
9418
|
+
hasContextMenuElements && /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(OverflowMenuList, { children: contextMenuItems.map((item, i) => {
|
|
9419
|
+
return item.href ? /* @__PURE__ */ (0, import_react67.createElement)(
|
|
9420
|
+
OverflowMenuLink,
|
|
9421
|
+
{
|
|
9422
|
+
...item,
|
|
9423
|
+
key: `context-${i}`
|
|
9424
|
+
}
|
|
9425
|
+
) : /* @__PURE__ */ (0, import_react67.createElement)(
|
|
9413
9426
|
OverflowMenuButton,
|
|
9414
9427
|
{
|
|
9415
|
-
...item
|
|
9428
|
+
...item,
|
|
9429
|
+
key: `context-${i}`
|
|
9416
9430
|
}
|
|
9417
9431
|
);
|
|
9418
9432
|
}) })
|
|
@@ -9482,7 +9496,7 @@ var ListItem = ({ className, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtim
|
|
|
9482
9496
|
ListItem.displayName = "ListItem";
|
|
9483
9497
|
|
|
9484
9498
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
9485
|
-
var
|
|
9499
|
+
var import_react68 = require("react");
|
|
9486
9500
|
|
|
9487
9501
|
// src/components/LocalMessage/LocalMessage.module.css
|
|
9488
9502
|
var LocalMessage_default = {
|
|
@@ -9525,7 +9539,7 @@ var LocalMessage = ({
|
|
|
9525
9539
|
...rest
|
|
9526
9540
|
}) => {
|
|
9527
9541
|
const { t } = useTranslation();
|
|
9528
|
-
const [isClosed, setClosed] = (0,
|
|
9542
|
+
const [isClosed, setClosed] = (0, import_react68.useState)(false);
|
|
9529
9543
|
if (isClosed) {
|
|
9530
9544
|
return /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(import_jsx_runtime280.Fragment, {});
|
|
9531
9545
|
}
|
|
@@ -9579,7 +9593,7 @@ var LocalMessage = ({
|
|
|
9579
9593
|
LocalMessage.displayName = "LocalMessage";
|
|
9580
9594
|
|
|
9581
9595
|
// src/components/Modal/Modal.tsx
|
|
9582
|
-
var
|
|
9596
|
+
var import_react69 = require("react");
|
|
9583
9597
|
var import_react_dom4 = require("react-dom");
|
|
9584
9598
|
|
|
9585
9599
|
// src/components/Modal/Modal.module.css
|
|
@@ -9609,7 +9623,7 @@ var Modal = ({
|
|
|
9609
9623
|
ref,
|
|
9610
9624
|
...rest
|
|
9611
9625
|
}) => {
|
|
9612
|
-
const generatedId = (0,
|
|
9626
|
+
const generatedId = (0, import_react69.useId)();
|
|
9613
9627
|
const modalId = id != null ? id : `${generatedId}-modal`;
|
|
9614
9628
|
const headerId = `${modalId}-header`;
|
|
9615
9629
|
const modalRef = useFocusTrap(isOpen, initialFocusRef);
|
|
@@ -9621,13 +9635,13 @@ var Modal = ({
|
|
|
9621
9635
|
onClose();
|
|
9622
9636
|
}
|
|
9623
9637
|
};
|
|
9624
|
-
const themeContext = (0,
|
|
9638
|
+
const themeContext = (0, import_react69.useContext)(ThemeContext);
|
|
9625
9639
|
if (!themeContext) {
|
|
9626
9640
|
throw new Error("Modal must be used within a ThemeProvider");
|
|
9627
9641
|
}
|
|
9628
9642
|
const { t } = useTranslation();
|
|
9629
9643
|
const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
|
|
9630
|
-
(0,
|
|
9644
|
+
(0, import_react69.useEffect)(() => {
|
|
9631
9645
|
if (isOpen) {
|
|
9632
9646
|
handleElementWithBackdropMount(document.body);
|
|
9633
9647
|
} else {
|
|
@@ -9635,7 +9649,7 @@ var Modal = ({
|
|
|
9635
9649
|
}
|
|
9636
9650
|
return () => handleElementWithBackdropUnmount(document.body);
|
|
9637
9651
|
}, [isOpen]);
|
|
9638
|
-
const backdropRef = (0,
|
|
9652
|
+
const backdropRef = (0, import_react69.useRef)(null);
|
|
9639
9653
|
const onBackdropClick = (event) => {
|
|
9640
9654
|
if (event.target === backdropRef.current && isOpen) {
|
|
9641
9655
|
handleClose();
|
|
@@ -9752,7 +9766,7 @@ var ModalActions = (props) => /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(Box
|
|
|
9752
9766
|
ModalActions.displayName = "ModalActions";
|
|
9753
9767
|
|
|
9754
9768
|
// src/components/Pagination/Pagination.tsx
|
|
9755
|
-
var
|
|
9769
|
+
var import_react73 = require("react");
|
|
9756
9770
|
|
|
9757
9771
|
// src/components/Pagination/Pagination.module.css
|
|
9758
9772
|
var Pagination_default = {
|
|
@@ -9797,7 +9811,7 @@ function PaginationGenerator(pagesAmount, activePage) {
|
|
|
9797
9811
|
}
|
|
9798
9812
|
|
|
9799
9813
|
// src/components/Select/Select.tsx
|
|
9800
|
-
var
|
|
9814
|
+
var import_react71 = require("react");
|
|
9801
9815
|
var import_react_select2 = __toESM(require("react-select"));
|
|
9802
9816
|
|
|
9803
9817
|
// src/components/Select/Select.module.css
|
|
@@ -10077,7 +10091,7 @@ var getCustomStyles = (size2, hasError, hasIcon, isReadOnly) => ({
|
|
|
10077
10091
|
});
|
|
10078
10092
|
|
|
10079
10093
|
// src/components/Select/SelectComponents.tsx
|
|
10080
|
-
var
|
|
10094
|
+
var import_react70 = __toESM(require("react"));
|
|
10081
10095
|
var import_react_select = require("react-select");
|
|
10082
10096
|
var import_jsx_runtime284 = require("react/jsx-runtime");
|
|
10083
10097
|
var {
|
|
@@ -10107,7 +10121,7 @@ var DDSOption = ({
|
|
|
10107
10121
|
props.isSelected && /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(Icon, { icon: CheckIcon, iconSize: getFormInputIconSize(componentSize) }),
|
|
10108
10122
|
props.children
|
|
10109
10123
|
] });
|
|
10110
|
-
var CustomOption = (props) => /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(Option, { ...props, children:
|
|
10124
|
+
var CustomOption = (props) => /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(Option, { ...props, children: import_react70.default.createElement(props.customElement, props) });
|
|
10111
10125
|
var CustomSingleValue = ({
|
|
10112
10126
|
id,
|
|
10113
10127
|
Element,
|
|
@@ -10224,12 +10238,12 @@ function Select({
|
|
|
10224
10238
|
instanceId,
|
|
10225
10239
|
...rest
|
|
10226
10240
|
}) {
|
|
10227
|
-
const themeContext = (0,
|
|
10241
|
+
const themeContext = (0, import_react71.useContext)(ThemeContext);
|
|
10228
10242
|
if (!themeContext) {
|
|
10229
10243
|
throw new Error("Select must be used within a ThemeProvider");
|
|
10230
10244
|
}
|
|
10231
10245
|
const portalTarget = menuPortalTarget != null ? menuPortalTarget : themeContext == null ? void 0 : themeContext.el;
|
|
10232
|
-
const generatedId = (0,
|
|
10246
|
+
const generatedId = (0, import_react71.useId)();
|
|
10233
10247
|
const uniqueId = id != null ? id : `${generatedId}-select`;
|
|
10234
10248
|
const singleValueId = !isMulti ? `${uniqueId}-singleValue` : void 0;
|
|
10235
10249
|
const hasLabel = !!label;
|
|
@@ -10242,7 +10256,7 @@ function Select({
|
|
|
10242
10256
|
width,
|
|
10243
10257
|
componentSize === "xsmall" && "var(--dds-input-default-width-xsmall)"
|
|
10244
10258
|
);
|
|
10245
|
-
const customInput = (0,
|
|
10259
|
+
const customInput = (0, import_react71.useCallback)(
|
|
10246
10260
|
(props) => /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(
|
|
10247
10261
|
DDSInput,
|
|
10248
10262
|
{
|
|
@@ -10260,7 +10274,7 @@ function Select({
|
|
|
10260
10274
|
),
|
|
10261
10275
|
[]
|
|
10262
10276
|
);
|
|
10263
|
-
const customSingleValue = (0,
|
|
10277
|
+
const customSingleValue = (0, import_react71.useCallback)(
|
|
10264
10278
|
(props) => /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(
|
|
10265
10279
|
CustomSingleValue,
|
|
10266
10280
|
{
|
|
@@ -10271,15 +10285,15 @@ function Select({
|
|
|
10271
10285
|
),
|
|
10272
10286
|
[]
|
|
10273
10287
|
);
|
|
10274
|
-
const customClearIndicator = (0,
|
|
10288
|
+
const customClearIndicator = (0, import_react71.useCallback)(
|
|
10275
10289
|
(props) => /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(DDSClearIndicator, { ...props, size: componentSize }),
|
|
10276
10290
|
[componentSize]
|
|
10277
10291
|
);
|
|
10278
|
-
const customDropdownIndicator = (0,
|
|
10292
|
+
const customDropdownIndicator = (0, import_react71.useCallback)(
|
|
10279
10293
|
(props) => /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(DDSDropdownIndicator, { ...props, componentSize }),
|
|
10280
10294
|
[componentSize]
|
|
10281
10295
|
);
|
|
10282
|
-
const customControl = (0,
|
|
10296
|
+
const customControl = (0, import_react71.useCallback)(
|
|
10283
10297
|
(props) => /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(
|
|
10284
10298
|
DDSControl,
|
|
10285
10299
|
{
|
|
@@ -10292,7 +10306,7 @@ function Select({
|
|
|
10292
10306
|
),
|
|
10293
10307
|
[componentSize, readOnly, icon, dataTestId]
|
|
10294
10308
|
);
|
|
10295
|
-
const customOptionComponent = (0,
|
|
10309
|
+
const customOptionComponent = (0, import_react71.useCallback)(
|
|
10296
10310
|
(props) => {
|
|
10297
10311
|
if (customOptionElement) {
|
|
10298
10312
|
return /* @__PURE__ */ (0, import_jsx_runtime285.jsx)(CustomOption, { ...props, customElement: customOptionElement });
|
|
@@ -10311,7 +10325,7 @@ function Select({
|
|
|
10311
10325
|
placeholder: placeholder ? placeholder : "",
|
|
10312
10326
|
closeMenuOnSelect: closeMenuOnSelect ? closeMenuOnSelect : isMulti ? false : true,
|
|
10313
10327
|
isMulti,
|
|
10314
|
-
instanceId: instanceId != null ? instanceId : (0,
|
|
10328
|
+
instanceId: instanceId != null ? instanceId : (0, import_react71.useId)(),
|
|
10315
10329
|
inputId: uniqueId,
|
|
10316
10330
|
name: uniqueId,
|
|
10317
10331
|
menuPortalTarget: portalTarget,
|
|
@@ -10374,7 +10388,7 @@ function Select({
|
|
|
10374
10388
|
Select.displayName = "Select";
|
|
10375
10389
|
|
|
10376
10390
|
// src/components/Select/NativeSelect/NativeSelect.tsx
|
|
10377
|
-
var
|
|
10391
|
+
var import_react72 = require("react");
|
|
10378
10392
|
|
|
10379
10393
|
// src/components/Select/NativeSelect/NativeSelect.module.css
|
|
10380
10394
|
var NativeSelect_default = {
|
|
@@ -10416,14 +10430,14 @@ var NativeSelect = ({
|
|
|
10416
10430
|
...rest
|
|
10417
10431
|
}) => {
|
|
10418
10432
|
const { t } = useTranslation();
|
|
10419
|
-
const selectRef = (0,
|
|
10420
|
-
const [hasValue, setHasValue] = (0,
|
|
10421
|
-
(0,
|
|
10433
|
+
const selectRef = (0, import_react72.useRef)(null);
|
|
10434
|
+
const [hasValue, setHasValue] = (0, import_react72.useState)(false);
|
|
10435
|
+
(0, import_react72.useEffect)(() => {
|
|
10422
10436
|
var _a, _b;
|
|
10423
10437
|
const selectedIndex = (_b = (_a = selectRef.current) == null ? void 0 : _a.selectedIndex) != null ? _b : -1;
|
|
10424
10438
|
setHasValue(selectedIndex !== 0);
|
|
10425
10439
|
}, []);
|
|
10426
|
-
(0,
|
|
10440
|
+
(0, import_react72.useEffect)(() => {
|
|
10427
10441
|
var _a;
|
|
10428
10442
|
if (clearable) {
|
|
10429
10443
|
const firstOption = (_a = selectRef.current) == null ? void 0 : _a.options[0];
|
|
@@ -10436,7 +10450,7 @@ var NativeSelect = ({
|
|
|
10436
10450
|
}
|
|
10437
10451
|
}
|
|
10438
10452
|
}, [clearable]);
|
|
10439
|
-
const generatedId = (0,
|
|
10453
|
+
const generatedId = (0, import_react72.useId)();
|
|
10440
10454
|
const uniqueId = id != null ? id : `${generatedId}-native-select`;
|
|
10441
10455
|
const hasErrorMessage = !!errorMessage;
|
|
10442
10456
|
const hasTip = !!tip;
|
|
@@ -10561,8 +10575,8 @@ var Pagination = ({
|
|
|
10561
10575
|
...rest
|
|
10562
10576
|
}) => {
|
|
10563
10577
|
const { t } = useTranslation();
|
|
10564
|
-
const [activePage, setActivePage] = (0,
|
|
10565
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
10578
|
+
const [activePage, setActivePage] = (0, import_react73.useState)(defaultActivePage);
|
|
10579
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react73.useState)(defaultItemsPerPage);
|
|
10566
10580
|
const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
|
|
10567
10581
|
const items = PaginationGenerator(pagesLength, activePage);
|
|
10568
10582
|
const onPageChange = (event, page) => {
|
|
@@ -10862,7 +10876,7 @@ var texts17 = createTexts({
|
|
|
10862
10876
|
});
|
|
10863
10877
|
|
|
10864
10878
|
// src/components/PhoneInput/PhoneInput.tsx
|
|
10865
|
-
var
|
|
10879
|
+
var import_react74 = require("react");
|
|
10866
10880
|
|
|
10867
10881
|
// src/components/PhoneInput/constants.ts
|
|
10868
10882
|
var COUNTRIES = {
|
|
@@ -11323,7 +11337,7 @@ var PhoneInput = ({
|
|
|
11323
11337
|
const { t } = useTranslation();
|
|
11324
11338
|
const tGroupLabel = groupLabel != null ? groupLabel : t(texts18.countryCodeAndPhoneNumber);
|
|
11325
11339
|
const tSelectLabel = selectLabel != null ? selectLabel : t(texts18.countryCode);
|
|
11326
|
-
const generatedId = (0,
|
|
11340
|
+
const generatedId = (0, import_react74.useId)();
|
|
11327
11341
|
const uniqueId = (_a = props.id) != null ? _a : generatedId;
|
|
11328
11342
|
const phoneInputId = `${uniqueId}-phone-input`;
|
|
11329
11343
|
const phoneNumberId = `${uniqueId}-phone-number`;
|
|
@@ -11334,27 +11348,27 @@ var PhoneInput = ({
|
|
|
11334
11348
|
const hasMessage = hasErrorMessage || hasTip;
|
|
11335
11349
|
const tipId = derivativeIdGenerator(phoneInputId, "tip");
|
|
11336
11350
|
const errorMessageId = derivativeIdGenerator(phoneInputId, "errorMessage");
|
|
11337
|
-
const [callingCode, setCallingCode] = (0,
|
|
11338
|
-
const [selectedCountryCodeText, setSelectedCountryCodeText] = (0,
|
|
11339
|
-
const [internalValue, setInternalValue] = (0,
|
|
11351
|
+
const [callingCode, setCallingCode] = (0, import_react74.useState)("");
|
|
11352
|
+
const [selectedCountryCodeText, setSelectedCountryCodeText] = (0, import_react74.useState)("");
|
|
11353
|
+
const [internalValue, setInternalValue] = (0, import_react74.useState)(
|
|
11340
11354
|
defaultValue != null ? defaultValue : {
|
|
11341
11355
|
countryCode: "",
|
|
11342
11356
|
phoneNumber: ""
|
|
11343
11357
|
}
|
|
11344
11358
|
);
|
|
11345
11359
|
const isControlled = value !== void 0;
|
|
11346
|
-
const [callingCodeWidth, setCallingCodeWidth] = (0,
|
|
11347
|
-
const callingCodeRef = (0,
|
|
11348
|
-
(0,
|
|
11360
|
+
const [callingCodeWidth, setCallingCodeWidth] = (0, import_react74.useState)(0);
|
|
11361
|
+
const callingCodeRef = (0, import_react74.useRef)(null);
|
|
11362
|
+
(0, import_react74.useLayoutEffect)(() => {
|
|
11349
11363
|
if (callingCodeRef.current) {
|
|
11350
11364
|
setCallingCodeWidth(callingCodeRef.current.offsetWidth);
|
|
11351
11365
|
}
|
|
11352
11366
|
}, [callingCode]);
|
|
11353
11367
|
const callingCodeInlineStart = callingCodeWidth ? `calc(var(--dds-spacing-x1) + ${callingCodeWidth}px)` : void 0;
|
|
11354
|
-
const internalSelectRef = (0,
|
|
11368
|
+
const internalSelectRef = (0, import_react74.useRef)(null);
|
|
11355
11369
|
const combinedSelectRef = useCombinedRef(selectRef, internalSelectRef);
|
|
11356
11370
|
const displayedValue = isControlled ? value : internalValue;
|
|
11357
|
-
(0,
|
|
11371
|
+
(0, import_react74.useEffect)(() => {
|
|
11358
11372
|
const selectEl = internalSelectRef.current;
|
|
11359
11373
|
if (selectEl && selectEl.value) {
|
|
11360
11374
|
const { options, selectedIndex } = selectEl;
|
|
@@ -11516,7 +11530,7 @@ var texts18 = createTexts({
|
|
|
11516
11530
|
});
|
|
11517
11531
|
|
|
11518
11532
|
// src/components/Popover/Popover.tsx
|
|
11519
|
-
var
|
|
11533
|
+
var import_react76 = require("react");
|
|
11520
11534
|
var import_react_dom5 = require("react-dom");
|
|
11521
11535
|
|
|
11522
11536
|
// src/components/Popover/Popover.module.css
|
|
@@ -11528,9 +11542,9 @@ var Popover_default = {
|
|
|
11528
11542
|
};
|
|
11529
11543
|
|
|
11530
11544
|
// src/components/Popover/Popover.context.tsx
|
|
11531
|
-
var
|
|
11532
|
-
var PopoverContext = (0,
|
|
11533
|
-
var usePopoverContext = () => (0,
|
|
11545
|
+
var import_react75 = require("react");
|
|
11546
|
+
var PopoverContext = (0, import_react75.createContext)({});
|
|
11547
|
+
var usePopoverContext = () => (0, import_react75.useContext)(PopoverContext);
|
|
11534
11548
|
|
|
11535
11549
|
// src/components/Popover/Popover.tsx
|
|
11536
11550
|
var import_jsx_runtime289 = require("react/jsx-runtime");
|
|
@@ -11560,7 +11574,7 @@ var Popover = ({
|
|
|
11560
11574
|
});
|
|
11561
11575
|
const { maxHeight, maxWidth, minHeight, minWidth, height, width } = sizeProps;
|
|
11562
11576
|
const context = usePopoverContext();
|
|
11563
|
-
const themeContext = (0,
|
|
11577
|
+
const themeContext = (0, import_react76.useContext)(ThemeContext);
|
|
11564
11578
|
const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
|
|
11565
11579
|
const {
|
|
11566
11580
|
floatStyling: contextFloatStyling,
|
|
@@ -11573,7 +11587,7 @@ var Popover = ({
|
|
|
11573
11587
|
} = context;
|
|
11574
11588
|
const { t } = useTranslation();
|
|
11575
11589
|
const hasContext = !isEmpty(context);
|
|
11576
|
-
const generatedId = (0,
|
|
11590
|
+
const generatedId = (0, import_react76.useId)();
|
|
11577
11591
|
const uniquePopoverId = id != null ? id : `${generatedId}-popover`;
|
|
11578
11592
|
const [
|
|
11579
11593
|
popoverId,
|
|
@@ -11610,7 +11624,7 @@ var Popover = ({
|
|
|
11610
11624
|
anchorEl && anchorEl
|
|
11611
11625
|
);
|
|
11612
11626
|
const multiRef = useCombinedRef(ref, popoverRef, floatingRef);
|
|
11613
|
-
(0,
|
|
11627
|
+
(0, import_react76.useEffect)(() => {
|
|
11614
11628
|
setFloatOptions == null ? void 0 : setFloatOptions({ placement, offset });
|
|
11615
11629
|
}, [placement, offset]);
|
|
11616
11630
|
useOnClickOutside([popoverRef.current, anchorEl], () => {
|
|
@@ -11679,7 +11693,7 @@ var Popover = ({
|
|
|
11679
11693
|
Popover.displayName = "Popover";
|
|
11680
11694
|
|
|
11681
11695
|
// src/components/Popover/PopoverGroup.tsx
|
|
11682
|
-
var
|
|
11696
|
+
var import_react77 = require("react");
|
|
11683
11697
|
var import_jsx_runtime290 = require("react/jsx-runtime");
|
|
11684
11698
|
var PopoverGroup = ({
|
|
11685
11699
|
isOpen: propIsOpen,
|
|
@@ -11691,12 +11705,12 @@ var PopoverGroup = ({
|
|
|
11691
11705
|
popoverId
|
|
11692
11706
|
}) => {
|
|
11693
11707
|
var _a;
|
|
11694
|
-
const [internalIsOpen, internalSetIsOpen] = (0,
|
|
11708
|
+
const [internalIsOpen, internalSetIsOpen] = (0, import_react77.useState)(isInitiallyOpen);
|
|
11695
11709
|
const open = propIsOpen != null ? propIsOpen : internalIsOpen;
|
|
11696
11710
|
const setOpen = propSetIsOpen != null ? propSetIsOpen : internalSetIsOpen;
|
|
11697
|
-
const generatedId = (0,
|
|
11711
|
+
const generatedId = (0, import_react77.useId)();
|
|
11698
11712
|
const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
|
|
11699
|
-
const [floatOptions, setFloatOptions] = (0,
|
|
11713
|
+
const [floatOptions, setFloatOptions] = (0, import_react77.useState)();
|
|
11700
11714
|
const { refs, styles: positionStyles } = useFloatPosition(null, floatOptions);
|
|
11701
11715
|
const handleClose = () => {
|
|
11702
11716
|
setOpen(false);
|
|
@@ -11713,10 +11727,10 @@ var PopoverGroup = ({
|
|
|
11713
11727
|
handleOpen();
|
|
11714
11728
|
}
|
|
11715
11729
|
};
|
|
11716
|
-
const buttonRef = (0,
|
|
11730
|
+
const buttonRef = (0, import_react77.useRef)(null);
|
|
11717
11731
|
const anchorRef = refs.setReference;
|
|
11718
11732
|
const combinedAnchorRef = useCombinedRef(buttonRef, anchorRef);
|
|
11719
|
-
const popoverRef = (0,
|
|
11733
|
+
const popoverRef = (0, import_react77.useRef)(null);
|
|
11720
11734
|
const floatingRef = refs.setFloating;
|
|
11721
11735
|
const combinedPopoverRef = useCombinedRef(popoverRef, floatingRef);
|
|
11722
11736
|
useOnKeyDown(["Esc", "Escape"], () => {
|
|
@@ -11732,8 +11746,8 @@ var PopoverGroup = ({
|
|
|
11732
11746
|
if (open) handleClose();
|
|
11733
11747
|
});
|
|
11734
11748
|
const isAnchorChild = (i) => i === 0;
|
|
11735
|
-
const Children7 =
|
|
11736
|
-
return (0,
|
|
11749
|
+
const Children7 = import_react77.Children.map(children, (child, childIndex) => {
|
|
11750
|
+
return (0, import_react77.isValidElement)(child) && (isAnchorChild(childIndex) ? (0, import_react77.cloneElement)(child, {
|
|
11737
11751
|
"aria-haspopup": "dialog",
|
|
11738
11752
|
"aria-controls": uniquePopoverId,
|
|
11739
11753
|
"aria-expanded": open,
|
|
@@ -11760,17 +11774,17 @@ var PopoverGroup = ({
|
|
|
11760
11774
|
PopoverGroup.displayName = "PopoverGroup";
|
|
11761
11775
|
|
|
11762
11776
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
11763
|
-
var
|
|
11777
|
+
var import_react80 = require("react");
|
|
11764
11778
|
|
|
11765
11779
|
// src/components/ProgressTracker/ProgressTracker.context.tsx
|
|
11766
|
-
var
|
|
11767
|
-
var ProgressTrackerContext = (0,
|
|
11780
|
+
var import_react78 = require("react");
|
|
11781
|
+
var ProgressTrackerContext = (0, import_react78.createContext)(
|
|
11768
11782
|
{
|
|
11769
11783
|
activeStep: 0,
|
|
11770
11784
|
direction: "column"
|
|
11771
11785
|
}
|
|
11772
11786
|
);
|
|
11773
|
-
var useProgressTrackerContext = () => (0,
|
|
11787
|
+
var useProgressTrackerContext = () => (0, import_react78.useContext)(ProgressTrackerContext);
|
|
11774
11788
|
|
|
11775
11789
|
// src/components/ProgressTracker/ProgressTracker.module.css
|
|
11776
11790
|
var ProgressTracker_default = {
|
|
@@ -11795,7 +11809,7 @@ var ProgressTracker_default = {
|
|
|
11795
11809
|
};
|
|
11796
11810
|
|
|
11797
11811
|
// src/components/ProgressTracker/ProgressTrackerItem.tsx
|
|
11798
|
-
var
|
|
11812
|
+
var import_react79 = require("react");
|
|
11799
11813
|
var import_jsx_runtime291 = require("react/jsx-runtime");
|
|
11800
11814
|
var toItemState = (active, completed, disabled) => {
|
|
11801
11815
|
if (disabled) {
|
|
@@ -11837,7 +11851,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
11837
11851
|
handleStepChange == null ? void 0 : handleStepChange(index);
|
|
11838
11852
|
}
|
|
11839
11853
|
};
|
|
11840
|
-
const stepNumberContent = (0,
|
|
11854
|
+
const stepNumberContent = (0, import_react79.useMemo)(() => {
|
|
11841
11855
|
if (completed) {
|
|
11842
11856
|
return /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(Icon, { icon: CheckIcon, iconSize: "small" });
|
|
11843
11857
|
}
|
|
@@ -11949,17 +11963,17 @@ var ProgressTracker = (() => {
|
|
|
11949
11963
|
...rest
|
|
11950
11964
|
}) => {
|
|
11951
11965
|
const { t } = useTranslation();
|
|
11952
|
-
const [thisActiveStep, setActiveStep] = (0,
|
|
11966
|
+
const [thisActiveStep, setActiveStep] = (0, import_react80.useState)(activeStep);
|
|
11953
11967
|
const handleChange = (step) => {
|
|
11954
11968
|
setActiveStep(step);
|
|
11955
11969
|
onStepChange == null ? void 0 : onStepChange(step);
|
|
11956
11970
|
};
|
|
11957
|
-
(0,
|
|
11971
|
+
(0, import_react80.useEffect)(() => {
|
|
11958
11972
|
if (activeStep !== void 0 && activeStep != thisActiveStep) {
|
|
11959
11973
|
setActiveStep(activeStep);
|
|
11960
11974
|
}
|
|
11961
11975
|
}, [activeStep, thisActiveStep]);
|
|
11962
|
-
const steps = (0,
|
|
11976
|
+
const steps = (0, import_react80.useMemo)(() => {
|
|
11963
11977
|
const validChildren = removeInvalidChildren(children);
|
|
11964
11978
|
const itemsWithIndex = passIndexPropToProgressTrackerItem(validChildren);
|
|
11965
11979
|
return itemsWithIndex;
|
|
@@ -12004,12 +12018,12 @@ var ProgressTracker = (() => {
|
|
|
12004
12018
|
return Res;
|
|
12005
12019
|
})();
|
|
12006
12020
|
function removeInvalidChildren(children) {
|
|
12007
|
-
return
|
|
12021
|
+
return import_react80.Children.toArray(children).filter(import_react80.isValidElement);
|
|
12008
12022
|
}
|
|
12009
12023
|
function passIndexPropToProgressTrackerItem(children) {
|
|
12010
|
-
return
|
|
12024
|
+
return import_react80.Children.map(
|
|
12011
12025
|
children,
|
|
12012
|
-
(item, index) => (0,
|
|
12026
|
+
(item, index) => (0, import_react80.cloneElement)(item, {
|
|
12013
12027
|
...item.props,
|
|
12014
12028
|
index
|
|
12015
12029
|
})
|
|
@@ -12025,7 +12039,7 @@ var texts20 = createTexts({
|
|
|
12025
12039
|
});
|
|
12026
12040
|
|
|
12027
12041
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
12028
|
-
var
|
|
12042
|
+
var import_react81 = require("react");
|
|
12029
12043
|
|
|
12030
12044
|
// src/components/ProgressBar/ProgressBar.module.css
|
|
12031
12045
|
var ProgressBar_default = {
|
|
@@ -12054,7 +12068,7 @@ var ProgressBar = ({
|
|
|
12054
12068
|
style,
|
|
12055
12069
|
...rest
|
|
12056
12070
|
}) => {
|
|
12057
|
-
const generatedId = (0,
|
|
12071
|
+
const generatedId = (0, import_react81.useId)();
|
|
12058
12072
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
12059
12073
|
const hasErrorMessage = !!errorMessage;
|
|
12060
12074
|
const hasTip = !!tip;
|
|
@@ -12110,13 +12124,13 @@ var ProgressBar = ({
|
|
|
12110
12124
|
ProgressBar.displayName = "ProgressBar";
|
|
12111
12125
|
|
|
12112
12126
|
// src/components/Search/Search.tsx
|
|
12113
|
-
var
|
|
12127
|
+
var import_react84 = require("react");
|
|
12114
12128
|
|
|
12115
12129
|
// src/components/Search/AutocompleteSearch.context.tsx
|
|
12116
|
-
var
|
|
12117
|
-
var AutocompleteSearchContext = (0,
|
|
12130
|
+
var import_react82 = require("react");
|
|
12131
|
+
var AutocompleteSearchContext = (0, import_react82.createContext)({});
|
|
12118
12132
|
var useAutocompleteSearch = () => {
|
|
12119
|
-
return (0,
|
|
12133
|
+
return (0, import_react82.useContext)(AutocompleteSearchContext);
|
|
12120
12134
|
};
|
|
12121
12135
|
|
|
12122
12136
|
// src/components/Search/Search.module.css
|
|
@@ -12137,7 +12151,7 @@ var typographyTypes2 = {
|
|
|
12137
12151
|
};
|
|
12138
12152
|
|
|
12139
12153
|
// src/components/Search/SearchSuggestionItem.tsx
|
|
12140
|
-
var
|
|
12154
|
+
var import_react83 = require("react");
|
|
12141
12155
|
var import_jsx_runtime294 = require("react/jsx-runtime");
|
|
12142
12156
|
var SearchSuggestionItem = ({
|
|
12143
12157
|
focus,
|
|
@@ -12145,9 +12159,9 @@ var SearchSuggestionItem = ({
|
|
|
12145
12159
|
ref,
|
|
12146
12160
|
...rest
|
|
12147
12161
|
}) => {
|
|
12148
|
-
const itemRef = (0,
|
|
12162
|
+
const itemRef = (0, import_react83.useRef)(null);
|
|
12149
12163
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
12150
|
-
(0,
|
|
12164
|
+
(0, import_react83.useEffect)(() => {
|
|
12151
12165
|
var _a;
|
|
12152
12166
|
if (focus) {
|
|
12153
12167
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
@@ -12302,7 +12316,7 @@ var Search = ({
|
|
|
12302
12316
|
...rest
|
|
12303
12317
|
}) => {
|
|
12304
12318
|
var _a;
|
|
12305
|
-
const generatedId = (0,
|
|
12319
|
+
const generatedId = (0, import_react84.useId)();
|
|
12306
12320
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
12307
12321
|
const hasLabel = !!label;
|
|
12308
12322
|
const tipId = derivativeIdGenerator(uniqueId, "tip");
|
|
@@ -12312,7 +12326,7 @@ var Search = ({
|
|
|
12312
12326
|
"suggestions-description"
|
|
12313
12327
|
);
|
|
12314
12328
|
const { t } = useTranslation();
|
|
12315
|
-
const [hasValue, setHasValue] = (0,
|
|
12329
|
+
const [hasValue, setHasValue] = (0, import_react84.useState)(!!value);
|
|
12316
12330
|
const context = useAutocompleteSearch();
|
|
12317
12331
|
const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
|
|
12318
12332
|
const handleChange = (e) => {
|
|
@@ -12460,7 +12474,7 @@ var texts22 = createTexts({
|
|
|
12460
12474
|
});
|
|
12461
12475
|
|
|
12462
12476
|
// src/components/Search/SearchAutocompleteWrapper.tsx
|
|
12463
|
-
var
|
|
12477
|
+
var import_react85 = require("react");
|
|
12464
12478
|
var import_jsx_runtime297 = require("react/jsx-runtime");
|
|
12465
12479
|
var SearchAutocompleteWrapper = (props) => {
|
|
12466
12480
|
const {
|
|
@@ -12472,12 +12486,12 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
12472
12486
|
onSuggestionSelection,
|
|
12473
12487
|
children
|
|
12474
12488
|
} = props;
|
|
12475
|
-
const [inputValue, setInputValue] = (0,
|
|
12476
|
-
const [suggestions, setSuggestions] = (0,
|
|
12477
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
12489
|
+
const [inputValue, setInputValue] = (0, import_react85.useState)(value != null ? value : "");
|
|
12490
|
+
const [suggestions, setSuggestions] = (0, import_react85.useState)([]);
|
|
12491
|
+
const [showSuggestions, setShowSuggestions] = (0, import_react85.useState)(false);
|
|
12478
12492
|
const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
|
|
12479
12493
|
const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
|
|
12480
|
-
(0,
|
|
12494
|
+
(0, import_react85.useEffect)(() => {
|
|
12481
12495
|
if (suggestions.length > 0) {
|
|
12482
12496
|
openSuggestions();
|
|
12483
12497
|
} else {
|
|
@@ -12522,8 +12536,8 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
12522
12536
|
const handleSetInputValue = (value2) => {
|
|
12523
12537
|
setInputValue(value2 != null ? value2 : "");
|
|
12524
12538
|
};
|
|
12525
|
-
const inputRef = (0,
|
|
12526
|
-
const suggestionsRef = (0,
|
|
12539
|
+
const inputRef = (0, import_react85.useRef)(null);
|
|
12540
|
+
const suggestionsRef = (0, import_react85.useRef)(null);
|
|
12527
12541
|
useOnClickOutside([inputRef.current, suggestionsRef.current], () => {
|
|
12528
12542
|
closeSuggestions();
|
|
12529
12543
|
});
|
|
@@ -12605,7 +12619,7 @@ var SkipToContent = ({
|
|
|
12605
12619
|
SkipToContent.displayName = "SkipToContent";
|
|
12606
12620
|
|
|
12607
12621
|
// src/components/SplitButton/SplitButton.tsx
|
|
12608
|
-
var
|
|
12622
|
+
var import_react86 = require("react");
|
|
12609
12623
|
|
|
12610
12624
|
// src/components/SplitButton/SplitButton.module.css
|
|
12611
12625
|
var SplitButton_default = {
|
|
@@ -12626,7 +12640,7 @@ var SplitButton = ({
|
|
|
12626
12640
|
...rest
|
|
12627
12641
|
}) => {
|
|
12628
12642
|
const { t } = useTranslation();
|
|
12629
|
-
const [isOpen, setIsOpen] = (0,
|
|
12643
|
+
const [isOpen, setIsOpen] = (0, import_react86.useState)(false);
|
|
12630
12644
|
const buttonStyleProps = {
|
|
12631
12645
|
purpose,
|
|
12632
12646
|
size: size2
|
|
@@ -12671,15 +12685,15 @@ var texts23 = createTexts({
|
|
|
12671
12685
|
});
|
|
12672
12686
|
|
|
12673
12687
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
12674
|
-
var
|
|
12688
|
+
var import_react90 = require("react");
|
|
12675
12689
|
|
|
12676
12690
|
// src/components/Table/collapsible/Table.context.tsx
|
|
12677
|
-
var
|
|
12678
|
-
var CollapsibleTableContext = (0,
|
|
12691
|
+
var import_react87 = require("react");
|
|
12692
|
+
var CollapsibleTableContext = (0, import_react87.createContext)({
|
|
12679
12693
|
headerValues: [],
|
|
12680
12694
|
definingColumnIndex: [0]
|
|
12681
12695
|
});
|
|
12682
|
-
var useCollapsibleTableContext = () => (0,
|
|
12696
|
+
var useCollapsibleTableContext = () => (0, import_react87.useContext)(CollapsibleTableContext);
|
|
12683
12697
|
|
|
12684
12698
|
// src/components/Table/normal/Body.tsx
|
|
12685
12699
|
var import_jsx_runtime301 = require("react/jsx-runtime");
|
|
@@ -12687,12 +12701,12 @@ var Body = (props) => /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("tbody", {
|
|
|
12687
12701
|
Body.displayName = "Table.Body";
|
|
12688
12702
|
|
|
12689
12703
|
// src/components/Table/normal/Head.tsx
|
|
12690
|
-
var
|
|
12704
|
+
var import_react88 = require("react");
|
|
12691
12705
|
var import_jsx_runtime302 = require("react/jsx-runtime");
|
|
12692
12706
|
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,
|
|
12707
|
+
var HeadContext = (0, import_react88.createContext)(false);
|
|
12694
12708
|
function useIsInTableHead() {
|
|
12695
|
-
const isInTableHead = (0,
|
|
12709
|
+
const isInTableHead = (0, import_react88.useContext)(HeadContext);
|
|
12696
12710
|
return isInTableHead;
|
|
12697
12711
|
}
|
|
12698
12712
|
|
|
@@ -12868,26 +12882,26 @@ var Table = ({
|
|
|
12868
12882
|
Table.displayName = "Table";
|
|
12869
12883
|
|
|
12870
12884
|
// src/components/Table/normal/TableWrapper.tsx
|
|
12871
|
-
var
|
|
12885
|
+
var import_react89 = require("react");
|
|
12872
12886
|
var import_jsx_runtime308 = require("react/jsx-runtime");
|
|
12873
12887
|
var TableWrapper = ({ className, ...rest }) => {
|
|
12874
|
-
const themeContext = (0,
|
|
12888
|
+
const themeContext = (0, import_react89.useContext)(ThemeContext);
|
|
12875
12889
|
const container2 = themeContext == null ? void 0 : themeContext.el;
|
|
12876
12890
|
const containerWidth = container2 ? container2.clientWidth : 0;
|
|
12877
|
-
const [overflowX, setOverflowX] = (0,
|
|
12878
|
-
const [themeContainerWidth, setThemeContainerWidth] = (0,
|
|
12891
|
+
const [overflowX, setOverflowX] = (0, import_react89.useState)(false);
|
|
12892
|
+
const [themeContainerWidth, setThemeContainerWidth] = (0, import_react89.useState)(containerWidth);
|
|
12879
12893
|
function isOverflowingX(event) {
|
|
12880
12894
|
return event.offsetWidth < event.scrollWidth;
|
|
12881
12895
|
}
|
|
12882
|
-
const wrapperRef = (0,
|
|
12883
|
-
(0,
|
|
12896
|
+
const wrapperRef = (0, import_react89.useRef)(null);
|
|
12897
|
+
(0, import_react89.useEffect)(() => {
|
|
12884
12898
|
if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
|
|
12885
12899
|
setOverflowX(true);
|
|
12886
12900
|
return;
|
|
12887
12901
|
}
|
|
12888
12902
|
setOverflowX(false);
|
|
12889
12903
|
}, [themeContainerWidth]);
|
|
12890
|
-
(0,
|
|
12904
|
+
(0, import_react89.useEffect)(() => {
|
|
12891
12905
|
function handleResize() {
|
|
12892
12906
|
setThemeContainerWidth(containerWidth);
|
|
12893
12907
|
}
|
|
@@ -12936,8 +12950,8 @@ var CollapsibleRow = ({
|
|
|
12936
12950
|
const isInHead = useIsInTableHead();
|
|
12937
12951
|
const type = _type != null ? _type : isInHead ? "head" : "body";
|
|
12938
12952
|
const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
|
|
12939
|
-
const [childrenCollapsed, setChildrenCollapsed] = (0,
|
|
12940
|
-
(0,
|
|
12953
|
+
const [childrenCollapsed, setChildrenCollapsed] = (0, import_react90.useState)(true);
|
|
12954
|
+
(0, import_react90.useEffect)(() => {
|
|
12941
12955
|
if (!isCollapsed) setChildrenCollapsed(true);
|
|
12942
12956
|
}, [isCollapsed]);
|
|
12943
12957
|
const rowProps = (isOpenCollapsibleHeader) => {
|
|
@@ -12955,7 +12969,7 @@ var CollapsibleRow = ({
|
|
|
12955
12969
|
const collapsedHeaderValues = headerValues.filter(
|
|
12956
12970
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
12957
12971
|
);
|
|
12958
|
-
const childrenArray =
|
|
12972
|
+
const childrenArray = import_react90.Children.toArray(children);
|
|
12959
12973
|
const collapsedChildren = childrenArray.filter(
|
|
12960
12974
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
12961
12975
|
);
|
|
@@ -12964,9 +12978,9 @@ var CollapsibleRow = ({
|
|
|
12964
12978
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
12965
12979
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
12966
12980
|
collapsibleIds.push(id);
|
|
12967
|
-
return /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(
|
|
12981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(import_react90.Fragment, { children: [
|
|
12968
12982
|
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
|
|
12969
|
-
(0,
|
|
12983
|
+
(0, import_react90.isValidElement)(child) && (0, import_react90.cloneElement)(child, {
|
|
12970
12984
|
collapsibleProps: { isCollapsibleChild: true }
|
|
12971
12985
|
})
|
|
12972
12986
|
] }, `DL-${index}`);
|
|
@@ -13060,11 +13074,11 @@ var CollapsibleTable2 = CollapsibleTable;
|
|
|
13060
13074
|
CollapsibleTable2.Row = CollapsibleRow;
|
|
13061
13075
|
|
|
13062
13076
|
// src/components/Tabs/AddTabButton.tsx
|
|
13063
|
-
var
|
|
13077
|
+
var import_react93 = require("react");
|
|
13064
13078
|
|
|
13065
13079
|
// src/components/Tabs/Tabs.context.tsx
|
|
13066
|
-
var
|
|
13067
|
-
var TabsContext = (0,
|
|
13080
|
+
var import_react91 = require("react");
|
|
13081
|
+
var TabsContext = (0, import_react91.createContext)({
|
|
13068
13082
|
activeTab: 0,
|
|
13069
13083
|
tabsId: "",
|
|
13070
13084
|
size: "small",
|
|
@@ -13076,7 +13090,7 @@ var TabsContext = (0, import_react90.createContext)({
|
|
|
13076
13090
|
tabContentDirection: "row",
|
|
13077
13091
|
addTabButtonProps: void 0
|
|
13078
13092
|
});
|
|
13079
|
-
var useTabsContext = () => (0,
|
|
13093
|
+
var useTabsContext = () => (0, import_react91.useContext)(TabsContext);
|
|
13080
13094
|
|
|
13081
13095
|
// src/components/Tabs/Tabs.module.css
|
|
13082
13096
|
var Tabs_default = {
|
|
@@ -13094,9 +13108,9 @@ var Tabs_default = {
|
|
|
13094
13108
|
};
|
|
13095
13109
|
|
|
13096
13110
|
// src/components/Tabs/TabWidthContext.tsx
|
|
13097
|
-
var
|
|
13111
|
+
var import_react92 = require("react");
|
|
13098
13112
|
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
13099
|
-
var TabContext = (0,
|
|
13113
|
+
var TabContext = (0, import_react92.createContext)(null);
|
|
13100
13114
|
function TabWidthContextProvider({
|
|
13101
13115
|
children,
|
|
13102
13116
|
onChangeWidths
|
|
@@ -13125,8 +13139,8 @@ function TabWidthContextProvider({
|
|
|
13125
13139
|
);
|
|
13126
13140
|
}
|
|
13127
13141
|
function useSetTabWidth(index, width) {
|
|
13128
|
-
const context = (0,
|
|
13129
|
-
(0,
|
|
13142
|
+
const context = (0, import_react92.useContext)(TabContext);
|
|
13143
|
+
(0, import_react92.useLayoutEffect)(() => {
|
|
13130
13144
|
context == null ? void 0 : context.updateWidth(index, width);
|
|
13131
13145
|
return () => context == null ? void 0 : context.removeTab(index);
|
|
13132
13146
|
}, [index, width]);
|
|
@@ -13143,7 +13157,7 @@ var AddTabButton = ({
|
|
|
13143
13157
|
...rest
|
|
13144
13158
|
}) => {
|
|
13145
13159
|
useSetTabWidth(index, width);
|
|
13146
|
-
const buttonRef = (0,
|
|
13160
|
+
const buttonRef = (0, import_react93.useRef)(null);
|
|
13147
13161
|
const combinedRef = useCombinedRef(ref, buttonRef);
|
|
13148
13162
|
const { tabContentDirection, size: size2 } = useTabsContext();
|
|
13149
13163
|
return /* @__PURE__ */ (0, import_jsx_runtime312.jsxs)(
|
|
@@ -13168,7 +13182,7 @@ var AddTabButton = ({
|
|
|
13168
13182
|
AddTabButton.displayName = "AddTabButton";
|
|
13169
13183
|
|
|
13170
13184
|
// src/components/Tabs/Tabs.tsx
|
|
13171
|
-
var
|
|
13185
|
+
var import_react94 = require("react");
|
|
13172
13186
|
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
13173
13187
|
var TABS_SIZES = createSizes("small", "medium");
|
|
13174
13188
|
var Tabs = ({
|
|
@@ -13184,17 +13198,17 @@ var Tabs = ({
|
|
|
13184
13198
|
htmlProps,
|
|
13185
13199
|
...rest
|
|
13186
13200
|
}) => {
|
|
13187
|
-
const generatedId = (0,
|
|
13201
|
+
const generatedId = (0, import_react94.useId)();
|
|
13188
13202
|
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,
|
|
13203
|
+
const [thisActiveTab, setActiveTab] = (0, import_react94.useState)(activeTab != null ? activeTab : 0);
|
|
13204
|
+
const [hasTabFocus, setHasTabFocus] = (0, import_react94.useState)(false);
|
|
13205
|
+
const tabListRef = (0, import_react94.useRef)(null);
|
|
13206
|
+
const tabPanelsRef = (0, import_react94.useRef)(null);
|
|
13193
13207
|
const handleTabChange = (index) => {
|
|
13194
13208
|
setActiveTab(index);
|
|
13195
13209
|
onChange == null ? void 0 : onChange(index);
|
|
13196
13210
|
};
|
|
13197
|
-
(0,
|
|
13211
|
+
(0, import_react94.useEffect)(() => {
|
|
13198
13212
|
if (activeTab !== void 0 && activeTab !== thisActiveTab) {
|
|
13199
13213
|
setActiveTab(activeTab);
|
|
13200
13214
|
}
|
|
@@ -13228,7 +13242,7 @@ var Tabs = ({
|
|
|
13228
13242
|
Tabs.displayName = "Tabs";
|
|
13229
13243
|
|
|
13230
13244
|
// src/components/Tabs/Tab.tsx
|
|
13231
|
-
var
|
|
13245
|
+
var import_react95 = require("react");
|
|
13232
13246
|
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
13233
13247
|
var Tab = ({
|
|
13234
13248
|
active = false,
|
|
@@ -13247,18 +13261,18 @@ var Tab = ({
|
|
|
13247
13261
|
...rest
|
|
13248
13262
|
}) => {
|
|
13249
13263
|
useSetTabWidth(index, width);
|
|
13250
|
-
const itemRef = (0,
|
|
13264
|
+
const itemRef = (0, import_react95.useRef)(null);
|
|
13251
13265
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
13252
13266
|
const { tabContentDirection, size: size2 } = useTabsContext();
|
|
13253
13267
|
const { type = "button", ...restHtmlProps } = htmlProps;
|
|
13254
13268
|
const fixedHtmlProps = { type, ...restHtmlProps };
|
|
13255
|
-
(0,
|
|
13269
|
+
(0, import_react95.useEffect)(() => {
|
|
13256
13270
|
var _a;
|
|
13257
13271
|
if (focus) {
|
|
13258
13272
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
13259
13273
|
}
|
|
13260
13274
|
}, [focus]);
|
|
13261
|
-
const handleSelect = (0,
|
|
13275
|
+
const handleSelect = (0, import_react95.useCallback)(() => {
|
|
13262
13276
|
if (setFocus && index) {
|
|
13263
13277
|
setFocus(index);
|
|
13264
13278
|
}
|
|
@@ -13304,7 +13318,7 @@ var Tab = ({
|
|
|
13304
13318
|
Tab.displayName = "Tab";
|
|
13305
13319
|
|
|
13306
13320
|
// src/components/Tabs/TabList.tsx
|
|
13307
|
-
var
|
|
13321
|
+
var import_react96 = require("react");
|
|
13308
13322
|
var import_jsx_runtime315 = require("react/jsx-runtime");
|
|
13309
13323
|
var TabList = ({
|
|
13310
13324
|
children,
|
|
@@ -13324,15 +13338,15 @@ var TabList = ({
|
|
|
13324
13338
|
addTabButtonProps
|
|
13325
13339
|
} = useTabsContext();
|
|
13326
13340
|
const uniqueId = id != null ? id : `${tabsId}-tablist`;
|
|
13327
|
-
const childrenArray =
|
|
13341
|
+
const childrenArray = import_react96.Children.toArray(children).length;
|
|
13328
13342
|
const [focus, setFocus] = useRoveFocus(childrenArray, hasTabFocus, "row");
|
|
13329
13343
|
const combinedRef = useCombinedRef(ref, tabListRef);
|
|
13330
13344
|
const hasButton = addTabButtonProps ? true : false;
|
|
13331
|
-
const tabListChildren =
|
|
13345
|
+
const tabListChildren = import_react96.Children ? import_react96.Children.map(children, (child, index) => {
|
|
13332
13346
|
const handleThisTabChange = () => {
|
|
13333
13347
|
handleTabChange(index);
|
|
13334
13348
|
};
|
|
13335
|
-
return (0,
|
|
13349
|
+
return (0, import_react96.isValidElement)(child) && (0, import_react96.cloneElement)(child, {
|
|
13336
13350
|
id: `${tabsId}-tab-${index}`,
|
|
13337
13351
|
htmlProps: {
|
|
13338
13352
|
...child.props.htmlProps,
|
|
@@ -13345,7 +13359,7 @@ var TabList = ({
|
|
|
13345
13359
|
onClick: combineHandlers(handleThisTabChange, child.props.onClick)
|
|
13346
13360
|
});
|
|
13347
13361
|
}) : [];
|
|
13348
|
-
const [widths, setWidths] = (0,
|
|
13362
|
+
const [widths, setWidths] = (0, import_react96.useState)([]);
|
|
13349
13363
|
const handleOnFocus = (event) => {
|
|
13350
13364
|
setHasTabFocus(true);
|
|
13351
13365
|
onFocus == null ? void 0 : onFocus(event);
|
|
@@ -13420,14 +13434,14 @@ var TabPanel = ({
|
|
|
13420
13434
|
TabPanel.displayName = "TabPanel";
|
|
13421
13435
|
|
|
13422
13436
|
// src/components/Tabs/TabPanels.tsx
|
|
13423
|
-
var
|
|
13437
|
+
var import_react97 = require("react");
|
|
13424
13438
|
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
13425
13439
|
var TabPanels = ({ children, ref, ...rest }) => {
|
|
13426
13440
|
const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
|
|
13427
13441
|
const combinedRef = useCombinedRef(ref, tabPanelsRef);
|
|
13428
|
-
const panelChildren =
|
|
13442
|
+
const panelChildren = import_react97.Children.map(children, (child, index) => {
|
|
13429
13443
|
const active = index === activeTab;
|
|
13430
|
-
return (0,
|
|
13444
|
+
return (0, import_react97.isValidElement)(child) && (0, import_react97.cloneElement)(child, {
|
|
13431
13445
|
id: `${tabsId}-panel-${index}`,
|
|
13432
13446
|
active,
|
|
13433
13447
|
htmlProps: {
|
|
@@ -13502,7 +13516,7 @@ var Tag = ({
|
|
|
13502
13516
|
Tag.displayName = "Tag";
|
|
13503
13517
|
|
|
13504
13518
|
// src/components/TextInput/TextInput.tsx
|
|
13505
|
-
var
|
|
13519
|
+
var import_react98 = require("react");
|
|
13506
13520
|
|
|
13507
13521
|
// src/components/TextInput/TextInput.module.css
|
|
13508
13522
|
var TextInput_default = {
|
|
@@ -13551,12 +13565,12 @@ var TextInput = ({
|
|
|
13551
13565
|
ref,
|
|
13552
13566
|
...rest
|
|
13553
13567
|
}) => {
|
|
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,
|
|
13568
|
+
const [text, setText] = (0, import_react98.useState)(getDefaultText(value, defaultValue));
|
|
13569
|
+
const prefixRef = (0, import_react98.useRef)(null);
|
|
13570
|
+
const suffixRef = (0, import_react98.useRef)(null);
|
|
13571
|
+
const [prefixLength, setPrefixLength] = (0, import_react98.useState)(0);
|
|
13572
|
+
const [suffixLength, setSuffixLength] = (0, import_react98.useState)(0);
|
|
13573
|
+
(0, import_react98.useLayoutEffect)(() => {
|
|
13560
13574
|
requestAnimationFrame(() => {
|
|
13561
13575
|
if (prefixRef.current) {
|
|
13562
13576
|
setPrefixLength(prefixRef.current.offsetWidth);
|
|
@@ -13572,7 +13586,7 @@ var TextInput = ({
|
|
|
13572
13586
|
onChange(event);
|
|
13573
13587
|
}
|
|
13574
13588
|
};
|
|
13575
|
-
const generatedId = (0,
|
|
13589
|
+
const generatedId = (0, import_react98.useId)();
|
|
13576
13590
|
const uniqueId = id != null ? id : `${generatedId}-textInput`;
|
|
13577
13591
|
const hasErrorMessage = !!errorMessage;
|
|
13578
13592
|
const hasTip = !!tip;
|
|
@@ -13742,7 +13756,7 @@ var TextInput = ({
|
|
|
13742
13756
|
TextInput.displayName = "TextInput";
|
|
13743
13757
|
|
|
13744
13758
|
// src/components/Toggle/Toggle.tsx
|
|
13745
|
-
var
|
|
13759
|
+
var import_react99 = require("react");
|
|
13746
13760
|
|
|
13747
13761
|
// src/components/Toggle/Toggle.module.css
|
|
13748
13762
|
var Toggle_default = {
|
|
@@ -13777,7 +13791,7 @@ var Toggle = ({
|
|
|
13777
13791
|
...rest
|
|
13778
13792
|
}) => {
|
|
13779
13793
|
const { t } = useTranslation();
|
|
13780
|
-
const generatedId = (0,
|
|
13794
|
+
const generatedId = (0, import_react99.useId)();
|
|
13781
13795
|
const uniqueId = id != null ? id : `${generatedId}-toggle`;
|
|
13782
13796
|
const iconSize = size2 === "large" ? "medium" : "small";
|
|
13783
13797
|
const [checked, setChecked] = useControllableState({
|
|
@@ -13848,14 +13862,14 @@ var Toggle = ({
|
|
|
13848
13862
|
Toggle.displayName = "Toggle";
|
|
13849
13863
|
|
|
13850
13864
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
13851
|
-
var
|
|
13865
|
+
var import_react101 = require("react");
|
|
13852
13866
|
|
|
13853
13867
|
// src/components/ToggleBar/ToggleBar.context.tsx
|
|
13854
|
-
var
|
|
13855
|
-
var ToggleBarContext = (0,
|
|
13868
|
+
var import_react100 = require("react");
|
|
13869
|
+
var ToggleBarContext = (0, import_react100.createContext)({
|
|
13856
13870
|
size: "medium"
|
|
13857
13871
|
});
|
|
13858
|
-
var useToggleBarContext = () => (0,
|
|
13872
|
+
var useToggleBarContext = () => (0, import_react100.useContext)(ToggleBarContext);
|
|
13859
13873
|
|
|
13860
13874
|
// src/components/ToggleBar/ToggleBar.module.css
|
|
13861
13875
|
var ToggleBar_default = {
|
|
@@ -13888,9 +13902,9 @@ var ToggleBar = (props) => {
|
|
|
13888
13902
|
id,
|
|
13889
13903
|
...rest
|
|
13890
13904
|
} = props;
|
|
13891
|
-
const generatedId = (0,
|
|
13905
|
+
const generatedId = (0, import_react101.useId)();
|
|
13892
13906
|
const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
|
|
13893
|
-
const [groupValue, setGroupValue] = (0,
|
|
13907
|
+
const [groupValue, setGroupValue] = (0, import_react101.useState)(value);
|
|
13894
13908
|
const handleChange = combineHandlers(
|
|
13895
13909
|
(e) => setGroupValue(e.target.value),
|
|
13896
13910
|
(e) => onChange && onChange(e, e.target.value)
|
|
@@ -13925,7 +13939,7 @@ var ToggleBar = (props) => {
|
|
|
13925
13939
|
ToggleBar.displayName = "ToggleBar";
|
|
13926
13940
|
|
|
13927
13941
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
13928
|
-
var
|
|
13942
|
+
var import_react102 = require("react");
|
|
13929
13943
|
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
13930
13944
|
var typographyTypes3 = {
|
|
13931
13945
|
large: "bodyLarge",
|
|
@@ -13957,7 +13971,7 @@ var ToggleRadio = ({
|
|
|
13957
13971
|
id,
|
|
13958
13972
|
...rest
|
|
13959
13973
|
}) => {
|
|
13960
|
-
const generatedId = (0,
|
|
13974
|
+
const generatedId = (0, import_react102.useId)();
|
|
13961
13975
|
const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
|
|
13962
13976
|
const group = useToggleBarContext();
|
|
13963
13977
|
const handleChange = (event) => {
|
|
@@ -14006,7 +14020,7 @@ var ToggleRadio = ({
|
|
|
14006
14020
|
ToggleRadio.displayName = "ToggleRadio";
|
|
14007
14021
|
|
|
14008
14022
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
14009
|
-
var
|
|
14023
|
+
var import_react103 = require("react");
|
|
14010
14024
|
|
|
14011
14025
|
// src/components/ToggleButton/ToggleButton.module.css
|
|
14012
14026
|
var ToggleButton_default = {
|
|
@@ -14027,7 +14041,7 @@ var ToggleButton = ({
|
|
|
14027
14041
|
htmlProps,
|
|
14028
14042
|
...rest
|
|
14029
14043
|
}) => {
|
|
14030
|
-
const generatedId = (0,
|
|
14044
|
+
const generatedId = (0, import_react103.useId)();
|
|
14031
14045
|
const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
|
|
14032
14046
|
const hasIcon = !!icon;
|
|
14033
14047
|
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(Box, { as: "label", htmlFor: uniqueId, width: "fit-content", children: [
|
|
@@ -14065,7 +14079,7 @@ var ToggleButton = ({
|
|
|
14065
14079
|
ToggleButton.displayName = "ToggleButton";
|
|
14066
14080
|
|
|
14067
14081
|
// src/components/ToggleButton/ToggleButtonGroup.tsx
|
|
14068
|
-
var
|
|
14082
|
+
var import_react104 = require("react");
|
|
14069
14083
|
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
14070
14084
|
var ToggleButtonGroup = (props) => {
|
|
14071
14085
|
const {
|
|
@@ -14078,7 +14092,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
14078
14092
|
htmlProps,
|
|
14079
14093
|
...rest
|
|
14080
14094
|
} = props;
|
|
14081
|
-
const generatedId = (0,
|
|
14095
|
+
const generatedId = (0, import_react104.useId)();
|
|
14082
14096
|
const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
|
|
14083
14097
|
return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)(
|
|
14084
14098
|
VStack,
|