@norges-domstoler/dds-components 0.0.0-dev-20250620065347 → 0.0.0-dev-20250623090038
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 +177 -164
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7578,7 +7578,9 @@ var TextArea = ({
|
|
|
7578
7578
|
const [text, setText] = (0, import_react55.useState)(getDefaultText(value, defaultValue));
|
|
7579
7579
|
(0, import_react55.useEffect)(() => {
|
|
7580
7580
|
if (textAreaRef == null ? void 0 : textAreaRef.current) {
|
|
7581
|
-
|
|
7581
|
+
const el = textAreaRef.current;
|
|
7582
|
+
el.style.height = "auto";
|
|
7583
|
+
el.style.height = `${el.scrollHeight + 2}px`;
|
|
7582
7584
|
}
|
|
7583
7585
|
}, [text]);
|
|
7584
7586
|
const onChangeHandler = (event) => {
|
|
@@ -9609,7 +9611,7 @@ var ModalActions = (props) => /* @__PURE__ */ (0, import_jsx_runtime282.jsx)(Box
|
|
|
9609
9611
|
ModalActions.displayName = "ModalActions";
|
|
9610
9612
|
|
|
9611
9613
|
// src/components/Pagination/Pagination.tsx
|
|
9612
|
-
var
|
|
9614
|
+
var import_react72 = require("react");
|
|
9613
9615
|
|
|
9614
9616
|
// src/components/Pagination/Pagination.module.css
|
|
9615
9617
|
var Pagination_default = {
|
|
@@ -9654,7 +9656,7 @@ function PaginationGenerator(pagesAmount, activePage) {
|
|
|
9654
9656
|
}
|
|
9655
9657
|
|
|
9656
9658
|
// src/components/Select/Select.tsx
|
|
9657
|
-
var
|
|
9659
|
+
var import_react70 = require("react");
|
|
9658
9660
|
var import_react_select2 = __toESM(require("react-select"));
|
|
9659
9661
|
|
|
9660
9662
|
// src/components/Select/Select.module.css
|
|
@@ -9934,6 +9936,7 @@ var getCustomStyles = (size2, hasError, hasIcon, isReadOnly) => ({
|
|
|
9934
9936
|
});
|
|
9935
9937
|
|
|
9936
9938
|
// src/components/Select/SelectComponents.tsx
|
|
9939
|
+
var import_react69 = require("react");
|
|
9937
9940
|
var import_react_select = require("react-select");
|
|
9938
9941
|
var import_jsx_runtime283 = require("react/jsx-runtime");
|
|
9939
9942
|
var {
|
|
@@ -9984,35 +9987,45 @@ var DDSInput = (props, ariaInvalid, ariaDescribedby) => /* @__PURE__ */ (0, impo
|
|
|
9984
9987
|
"aria-describedby": ariaDescribedby
|
|
9985
9988
|
}
|
|
9986
9989
|
);
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
icon,
|
|
10004
|
-
iconSize: getFormInputIconSize(componentSize),
|
|
10005
|
-
className: cn(
|
|
10006
|
-
Input_default["input-group__absolute-element"],
|
|
10007
|
-
Select_default[`icon--${componentSize}`]
|
|
10008
|
-
)
|
|
10009
|
-
}
|
|
9990
|
+
function createDDSControl(componentSize, readOnly, icon, dataTestId) {
|
|
9991
|
+
return function DDSControlWrapper(props) {
|
|
9992
|
+
const { className, children, innerProps, ...rest } = props;
|
|
9993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)(
|
|
9994
|
+
Control,
|
|
9995
|
+
{
|
|
9996
|
+
...rest,
|
|
9997
|
+
innerProps: {
|
|
9998
|
+
...innerProps,
|
|
9999
|
+
"data-testid": dataTestId ? dataTestId + "-control" : void 0
|
|
10000
|
+
},
|
|
10001
|
+
className: cn(
|
|
10002
|
+
className,
|
|
10003
|
+
Select_default.control,
|
|
10004
|
+
rest.isDisabled && Select_default["control--disabled"],
|
|
10005
|
+
readOnly && Select_default["control--readonly"]
|
|
10010
10006
|
),
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10007
|
+
children: [
|
|
10008
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
|
|
10009
|
+
Icon,
|
|
10010
|
+
{
|
|
10011
|
+
icon,
|
|
10012
|
+
iconSize: getFormInputIconSize(componentSize),
|
|
10013
|
+
className: cn(
|
|
10014
|
+
Input_default["input-group__absolute-element"],
|
|
10015
|
+
Select_default[`icon--${componentSize}`]
|
|
10016
|
+
)
|
|
10017
|
+
}
|
|
10018
|
+
),
|
|
10019
|
+
children
|
|
10020
|
+
]
|
|
10021
|
+
}
|
|
10022
|
+
);
|
|
10023
|
+
};
|
|
10024
|
+
}
|
|
10025
|
+
var DDSControl = (componentSize, readOnly, icon, dataTestId) => (0, import_react69.useMemo)(
|
|
10026
|
+
() => createDDSControl(componentSize, readOnly, icon, dataTestId),
|
|
10027
|
+
[componentSize, readOnly, icon, dataTestId]
|
|
10028
|
+
);
|
|
10016
10029
|
|
|
10017
10030
|
// src/components/Select/Select.tsx
|
|
10018
10031
|
var import_jsx_runtime284 = require("react/jsx-runtime");
|
|
@@ -10046,12 +10059,12 @@ function Select({
|
|
|
10046
10059
|
ref,
|
|
10047
10060
|
...rest
|
|
10048
10061
|
}) {
|
|
10049
|
-
const themeContext = (0,
|
|
10062
|
+
const themeContext = (0, import_react70.useContext)(ThemeContext);
|
|
10050
10063
|
if (!themeContext) {
|
|
10051
10064
|
throw new Error("Select must be used within a ThemeProvider");
|
|
10052
10065
|
}
|
|
10053
10066
|
const portalTarget = menuPortalTarget != null ? menuPortalTarget : themeContext == null ? void 0 : themeContext.el;
|
|
10054
|
-
const generatedId = (0,
|
|
10067
|
+
const generatedId = (0, import_react70.useId)();
|
|
10055
10068
|
const uniqueId = id != null ? id : `${generatedId}-select`;
|
|
10056
10069
|
const singleValueId = !isMulti ? `${uniqueId}-singleValue` : void 0;
|
|
10057
10070
|
const hasLabel = !!label;
|
|
@@ -10107,7 +10120,7 @@ function Select({
|
|
|
10107
10120
|
ClearIndicator: (props) => DDSClearIndicator(props, componentSize),
|
|
10108
10121
|
DropdownIndicator: (props) => DDSDropdownIndicator(props, componentSize),
|
|
10109
10122
|
MultiValueRemove: DDSMultiValueRemove,
|
|
10110
|
-
Control:
|
|
10123
|
+
Control: DDSControl(componentSize, readOnly, icon, dataTestId)
|
|
10111
10124
|
},
|
|
10112
10125
|
"aria-invalid": hasErrorMessage ? true : void 0,
|
|
10113
10126
|
required,
|
|
@@ -10147,7 +10160,7 @@ function Select({
|
|
|
10147
10160
|
Select.displayName = "Select";
|
|
10148
10161
|
|
|
10149
10162
|
// src/components/Select/NativeSelect/NativeSelect.tsx
|
|
10150
|
-
var
|
|
10163
|
+
var import_react71 = require("react");
|
|
10151
10164
|
|
|
10152
10165
|
// src/components/Select/NativeSelect/NativeSelect.module.css
|
|
10153
10166
|
var NativeSelect_default = {
|
|
@@ -10181,7 +10194,7 @@ var NativeSelect = ({
|
|
|
10181
10194
|
onMouseDown,
|
|
10182
10195
|
...rest
|
|
10183
10196
|
}) => {
|
|
10184
|
-
const generatedId = (0,
|
|
10197
|
+
const generatedId = (0, import_react71.useId)();
|
|
10185
10198
|
const uniqueId = id != null ? id : `${generatedId}-native-select`;
|
|
10186
10199
|
const hasErrorMessage = !!errorMessage;
|
|
10187
10200
|
const hasTip = !!tip;
|
|
@@ -10283,8 +10296,8 @@ var Pagination = ({
|
|
|
10283
10296
|
...rest
|
|
10284
10297
|
}) => {
|
|
10285
10298
|
const { t } = useTranslation();
|
|
10286
|
-
const [activePage, setActivePage] = (0,
|
|
10287
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
10299
|
+
const [activePage, setActivePage] = (0, import_react72.useState)(defaultActivePage);
|
|
10300
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react72.useState)(defaultItemsPerPage);
|
|
10288
10301
|
const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
|
|
10289
10302
|
const items = PaginationGenerator(pagesLength, activePage);
|
|
10290
10303
|
const onPageChange = (event, page) => {
|
|
@@ -10584,7 +10597,7 @@ var texts16 = createTexts({
|
|
|
10584
10597
|
});
|
|
10585
10598
|
|
|
10586
10599
|
// src/components/PhoneInput/PhoneInput.tsx
|
|
10587
|
-
var
|
|
10600
|
+
var import_react73 = require("react");
|
|
10588
10601
|
|
|
10589
10602
|
// src/components/PhoneInput/constants.ts
|
|
10590
10603
|
var COUNTRIES = {
|
|
@@ -11045,7 +11058,7 @@ var PhoneInput = ({
|
|
|
11045
11058
|
const { t } = useTranslation();
|
|
11046
11059
|
const tGroupLabel = groupLabel != null ? groupLabel : t(texts17.countryCodeAndPhoneNumber);
|
|
11047
11060
|
const tSelectLabel = selectLabel != null ? selectLabel : t(texts17.countryCode);
|
|
11048
|
-
const generatedId = (0,
|
|
11061
|
+
const generatedId = (0, import_react73.useId)();
|
|
11049
11062
|
const uniqueId = (_a = props.id) != null ? _a : generatedId;
|
|
11050
11063
|
const phoneInputId = `${uniqueId}-phone-input`;
|
|
11051
11064
|
const phoneNumberId = `${uniqueId}-phone-number`;
|
|
@@ -11056,27 +11069,27 @@ var PhoneInput = ({
|
|
|
11056
11069
|
const hasMessage = hasErrorMessage || hasTip;
|
|
11057
11070
|
const tipId = derivativeIdGenerator(phoneInputId, "tip");
|
|
11058
11071
|
const errorMessageId = derivativeIdGenerator(phoneInputId, "errorMessage");
|
|
11059
|
-
const [callingCode, setCallingCode] = (0,
|
|
11060
|
-
const [selectedCountryCodeText, setSelectedCountryCodeText] = (0,
|
|
11061
|
-
const [internalValue, setInternalValue] = (0,
|
|
11072
|
+
const [callingCode, setCallingCode] = (0, import_react73.useState)("");
|
|
11073
|
+
const [selectedCountryCodeText, setSelectedCountryCodeText] = (0, import_react73.useState)("");
|
|
11074
|
+
const [internalValue, setInternalValue] = (0, import_react73.useState)(
|
|
11062
11075
|
defaultValue != null ? defaultValue : {
|
|
11063
11076
|
countryCode: "",
|
|
11064
11077
|
phoneNumber: ""
|
|
11065
11078
|
}
|
|
11066
11079
|
);
|
|
11067
11080
|
const isControlled = value !== void 0;
|
|
11068
|
-
const [callingCodeWidth, setCallingCodeWidth] = (0,
|
|
11069
|
-
const callingCodeRef = (0,
|
|
11070
|
-
(0,
|
|
11081
|
+
const [callingCodeWidth, setCallingCodeWidth] = (0, import_react73.useState)(0);
|
|
11082
|
+
const callingCodeRef = (0, import_react73.useRef)(null);
|
|
11083
|
+
(0, import_react73.useLayoutEffect)(() => {
|
|
11071
11084
|
if (callingCodeRef.current) {
|
|
11072
11085
|
setCallingCodeWidth(callingCodeRef.current.offsetWidth);
|
|
11073
11086
|
}
|
|
11074
11087
|
}, [callingCode]);
|
|
11075
11088
|
const callingCodeInlineStart = callingCodeWidth ? `calc(var(--dds-spacing-x1) + ${callingCodeWidth}px)` : void 0;
|
|
11076
|
-
const internalSelectRef = (0,
|
|
11089
|
+
const internalSelectRef = (0, import_react73.useRef)(null);
|
|
11077
11090
|
const combinedSelectRef = useCombinedRef(selectRef, internalSelectRef);
|
|
11078
11091
|
const displayedValue = isControlled ? value : internalValue;
|
|
11079
|
-
(0,
|
|
11092
|
+
(0, import_react73.useEffect)(() => {
|
|
11080
11093
|
const selectEl = internalSelectRef.current;
|
|
11081
11094
|
if (selectEl && selectEl.value) {
|
|
11082
11095
|
const { options, selectedIndex } = selectEl;
|
|
@@ -11238,7 +11251,7 @@ var texts17 = createTexts({
|
|
|
11238
11251
|
});
|
|
11239
11252
|
|
|
11240
11253
|
// src/components/Popover/Popover.tsx
|
|
11241
|
-
var
|
|
11254
|
+
var import_react75 = require("react");
|
|
11242
11255
|
var import_react_dom5 = require("react-dom");
|
|
11243
11256
|
|
|
11244
11257
|
// src/components/Popover/Popover.module.css
|
|
@@ -11250,9 +11263,9 @@ var Popover_default = {
|
|
|
11250
11263
|
};
|
|
11251
11264
|
|
|
11252
11265
|
// src/components/Popover/Popover.context.tsx
|
|
11253
|
-
var
|
|
11254
|
-
var PopoverContext = (0,
|
|
11255
|
-
var usePopoverContext = () => (0,
|
|
11266
|
+
var import_react74 = require("react");
|
|
11267
|
+
var PopoverContext = (0, import_react74.createContext)({});
|
|
11268
|
+
var usePopoverContext = () => (0, import_react74.useContext)(PopoverContext);
|
|
11256
11269
|
|
|
11257
11270
|
// src/components/Popover/Popover.tsx
|
|
11258
11271
|
var import_jsx_runtime288 = require("react/jsx-runtime");
|
|
@@ -11282,7 +11295,7 @@ var Popover = ({
|
|
|
11282
11295
|
});
|
|
11283
11296
|
const { maxHeight, maxWidth, minHeight, minWidth, height, width } = sizeProps;
|
|
11284
11297
|
const context = usePopoverContext();
|
|
11285
|
-
const themeContext = (0,
|
|
11298
|
+
const themeContext = (0, import_react75.useContext)(ThemeContext);
|
|
11286
11299
|
const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
|
|
11287
11300
|
const {
|
|
11288
11301
|
floatStyling: contextFloatStyling,
|
|
@@ -11295,7 +11308,7 @@ var Popover = ({
|
|
|
11295
11308
|
} = context;
|
|
11296
11309
|
const { t } = useTranslation();
|
|
11297
11310
|
const hasContext = !isEmpty(context);
|
|
11298
|
-
const generatedId = (0,
|
|
11311
|
+
const generatedId = (0, import_react75.useId)();
|
|
11299
11312
|
const uniquePopoverId = id != null ? id : `${generatedId}-popover`;
|
|
11300
11313
|
const [
|
|
11301
11314
|
popoverId,
|
|
@@ -11332,7 +11345,7 @@ var Popover = ({
|
|
|
11332
11345
|
anchorEl && anchorEl
|
|
11333
11346
|
);
|
|
11334
11347
|
const multiRef = useCombinedRef(ref, popoverRef, floatingRef);
|
|
11335
|
-
(0,
|
|
11348
|
+
(0, import_react75.useEffect)(() => {
|
|
11336
11349
|
setFloatOptions && setFloatOptions({ placement, offset });
|
|
11337
11350
|
}, [placement, offset]);
|
|
11338
11351
|
useOnClickOutside([popoverRef.current, anchorEl], () => {
|
|
@@ -11401,7 +11414,7 @@ var Popover = ({
|
|
|
11401
11414
|
Popover.displayName = "Popover";
|
|
11402
11415
|
|
|
11403
11416
|
// src/components/Popover/PopoverGroup.tsx
|
|
11404
|
-
var
|
|
11417
|
+
var import_react76 = require("react");
|
|
11405
11418
|
var import_jsx_runtime289 = require("react/jsx-runtime");
|
|
11406
11419
|
var PopoverGroup = ({
|
|
11407
11420
|
isOpen: propIsOpen,
|
|
@@ -11413,12 +11426,12 @@ var PopoverGroup = ({
|
|
|
11413
11426
|
popoverId
|
|
11414
11427
|
}) => {
|
|
11415
11428
|
var _a;
|
|
11416
|
-
const [internalIsOpen, internalSetIsOpen] = (0,
|
|
11429
|
+
const [internalIsOpen, internalSetIsOpen] = (0, import_react76.useState)(isInitiallyOpen);
|
|
11417
11430
|
const open = propIsOpen != null ? propIsOpen : internalIsOpen;
|
|
11418
11431
|
const setOpen = propSetIsOpen != null ? propSetIsOpen : internalSetIsOpen;
|
|
11419
|
-
const generatedId = (0,
|
|
11432
|
+
const generatedId = (0, import_react76.useId)();
|
|
11420
11433
|
const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
|
|
11421
|
-
const [floatOptions, setFloatOptions] = (0,
|
|
11434
|
+
const [floatOptions, setFloatOptions] = (0, import_react76.useState)();
|
|
11422
11435
|
const { refs, styles: positionStyles } = useFloatPosition(null, floatOptions);
|
|
11423
11436
|
const handleClose = () => {
|
|
11424
11437
|
setOpen(false);
|
|
@@ -11435,10 +11448,10 @@ var PopoverGroup = ({
|
|
|
11435
11448
|
handleOpen();
|
|
11436
11449
|
}
|
|
11437
11450
|
};
|
|
11438
|
-
const buttonRef = (0,
|
|
11451
|
+
const buttonRef = (0, import_react76.useRef)(null);
|
|
11439
11452
|
const anchorRef = refs.setReference;
|
|
11440
11453
|
const combinedAnchorRef = useCombinedRef(buttonRef, anchorRef);
|
|
11441
|
-
const popoverRef = (0,
|
|
11454
|
+
const popoverRef = (0, import_react76.useRef)(null);
|
|
11442
11455
|
const floatingRef = refs.setFloating;
|
|
11443
11456
|
const combinedPopoverRef = useCombinedRef(popoverRef, floatingRef);
|
|
11444
11457
|
useOnKeyDown(["Esc", "Escape"], () => {
|
|
@@ -11454,8 +11467,8 @@ var PopoverGroup = ({
|
|
|
11454
11467
|
if (open) handleClose();
|
|
11455
11468
|
});
|
|
11456
11469
|
const isAnchorChild = (i) => i === 0;
|
|
11457
|
-
const Children7 =
|
|
11458
|
-
return (0,
|
|
11470
|
+
const Children7 = import_react76.Children.map(children, (child, childIndex) => {
|
|
11471
|
+
return (0, import_react76.isValidElement)(child) && (isAnchorChild(childIndex) ? (0, import_react76.cloneElement)(child, {
|
|
11459
11472
|
"aria-haspopup": "dialog",
|
|
11460
11473
|
"aria-controls": uniquePopoverId,
|
|
11461
11474
|
"aria-expanded": open,
|
|
@@ -11482,17 +11495,17 @@ var PopoverGroup = ({
|
|
|
11482
11495
|
PopoverGroup.displayName = "PopoverGroup";
|
|
11483
11496
|
|
|
11484
11497
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
11485
|
-
var
|
|
11498
|
+
var import_react79 = require("react");
|
|
11486
11499
|
|
|
11487
11500
|
// src/components/ProgressTracker/ProgressTracker.context.tsx
|
|
11488
|
-
var
|
|
11489
|
-
var ProgressTrackerContext = (0,
|
|
11501
|
+
var import_react77 = require("react");
|
|
11502
|
+
var ProgressTrackerContext = (0, import_react77.createContext)(
|
|
11490
11503
|
{
|
|
11491
11504
|
activeStep: 0,
|
|
11492
11505
|
direction: "column"
|
|
11493
11506
|
}
|
|
11494
11507
|
);
|
|
11495
|
-
var useProgressTrackerContext = () => (0,
|
|
11508
|
+
var useProgressTrackerContext = () => (0, import_react77.useContext)(ProgressTrackerContext);
|
|
11496
11509
|
|
|
11497
11510
|
// src/components/ProgressTracker/ProgressTracker.module.css
|
|
11498
11511
|
var ProgressTracker_default = {
|
|
@@ -11517,7 +11530,7 @@ var ProgressTracker_default = {
|
|
|
11517
11530
|
};
|
|
11518
11531
|
|
|
11519
11532
|
// src/components/ProgressTracker/ProgressTrackerItem.tsx
|
|
11520
|
-
var
|
|
11533
|
+
var import_react78 = require("react");
|
|
11521
11534
|
var import_jsx_runtime290 = require("react/jsx-runtime");
|
|
11522
11535
|
var toItemState = (active, completed, disabled) => {
|
|
11523
11536
|
if (disabled) {
|
|
@@ -11559,7 +11572,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
11559
11572
|
handleStepChange && handleStepChange(index);
|
|
11560
11573
|
}
|
|
11561
11574
|
};
|
|
11562
|
-
const stepNumberContent = (0,
|
|
11575
|
+
const stepNumberContent = (0, import_react78.useMemo)(() => {
|
|
11563
11576
|
if (completed) {
|
|
11564
11577
|
return /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(Icon, { icon: CheckIcon, iconSize: "small" });
|
|
11565
11578
|
}
|
|
@@ -11671,17 +11684,17 @@ var ProgressTracker = (() => {
|
|
|
11671
11684
|
...rest
|
|
11672
11685
|
}) => {
|
|
11673
11686
|
const { t } = useTranslation();
|
|
11674
|
-
const [thisActiveStep, setActiveStep] = (0,
|
|
11687
|
+
const [thisActiveStep, setActiveStep] = (0, import_react79.useState)(activeStep);
|
|
11675
11688
|
const handleChange = (step) => {
|
|
11676
11689
|
setActiveStep(step);
|
|
11677
11690
|
onStepChange && onStepChange(step);
|
|
11678
11691
|
};
|
|
11679
|
-
(0,
|
|
11692
|
+
(0, import_react79.useEffect)(() => {
|
|
11680
11693
|
if (activeStep !== void 0 && activeStep != thisActiveStep) {
|
|
11681
11694
|
setActiveStep(activeStep);
|
|
11682
11695
|
}
|
|
11683
11696
|
}, [activeStep, thisActiveStep]);
|
|
11684
|
-
const steps = (0,
|
|
11697
|
+
const steps = (0, import_react79.useMemo)(() => {
|
|
11685
11698
|
const validChildren = removeInvalidChildren(children);
|
|
11686
11699
|
const itemsWithIndex = passIndexPropToProgressTrackerItem(validChildren);
|
|
11687
11700
|
return itemsWithIndex;
|
|
@@ -11726,12 +11739,12 @@ var ProgressTracker = (() => {
|
|
|
11726
11739
|
return Res;
|
|
11727
11740
|
})();
|
|
11728
11741
|
function removeInvalidChildren(children) {
|
|
11729
|
-
return
|
|
11742
|
+
return import_react79.Children.toArray(children).filter(import_react79.isValidElement);
|
|
11730
11743
|
}
|
|
11731
11744
|
function passIndexPropToProgressTrackerItem(children) {
|
|
11732
|
-
return
|
|
11745
|
+
return import_react79.Children.map(
|
|
11733
11746
|
children,
|
|
11734
|
-
(item, index) => (0,
|
|
11747
|
+
(item, index) => (0, import_react79.cloneElement)(item, {
|
|
11735
11748
|
...item.props,
|
|
11736
11749
|
index
|
|
11737
11750
|
})
|
|
@@ -11747,7 +11760,7 @@ var texts19 = createTexts({
|
|
|
11747
11760
|
});
|
|
11748
11761
|
|
|
11749
11762
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
11750
|
-
var
|
|
11763
|
+
var import_react80 = require("react");
|
|
11751
11764
|
|
|
11752
11765
|
// src/components/ProgressBar/ProgressBar.module.css
|
|
11753
11766
|
var ProgressBar_default = {
|
|
@@ -11775,7 +11788,7 @@ var ProgressBar = ({
|
|
|
11775
11788
|
style,
|
|
11776
11789
|
...rest
|
|
11777
11790
|
}) => {
|
|
11778
|
-
const generatedId = (0,
|
|
11791
|
+
const generatedId = (0, import_react80.useId)();
|
|
11779
11792
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
11780
11793
|
const hasErrorMessage = !!errorMessage;
|
|
11781
11794
|
const hasTip = !!tip;
|
|
@@ -11831,13 +11844,13 @@ var ProgressBar = ({
|
|
|
11831
11844
|
ProgressBar.displayName = "ProgressBar";
|
|
11832
11845
|
|
|
11833
11846
|
// src/components/Search/Search.tsx
|
|
11834
|
-
var
|
|
11847
|
+
var import_react83 = require("react");
|
|
11835
11848
|
|
|
11836
11849
|
// src/components/Search/AutocompleteSearch.context.tsx
|
|
11837
|
-
var
|
|
11838
|
-
var AutocompleteSearchContext = (0,
|
|
11850
|
+
var import_react81 = require("react");
|
|
11851
|
+
var AutocompleteSearchContext = (0, import_react81.createContext)({});
|
|
11839
11852
|
var useAutocompleteSearch = () => {
|
|
11840
|
-
return (0,
|
|
11853
|
+
return (0, import_react81.useContext)(AutocompleteSearchContext);
|
|
11841
11854
|
};
|
|
11842
11855
|
|
|
11843
11856
|
// src/components/Search/Search.module.css
|
|
@@ -11881,7 +11894,7 @@ function createEmptyChangeEvent(inputElementId) {
|
|
|
11881
11894
|
}
|
|
11882
11895
|
|
|
11883
11896
|
// src/components/Search/SearchSuggestionItem.tsx
|
|
11884
|
-
var
|
|
11897
|
+
var import_react82 = require("react");
|
|
11885
11898
|
var import_jsx_runtime293 = require("react/jsx-runtime");
|
|
11886
11899
|
var SearchSuggestionItem = ({
|
|
11887
11900
|
focus,
|
|
@@ -11889,9 +11902,9 @@ var SearchSuggestionItem = ({
|
|
|
11889
11902
|
ref,
|
|
11890
11903
|
...rest
|
|
11891
11904
|
}) => {
|
|
11892
|
-
const itemRef = (0,
|
|
11905
|
+
const itemRef = (0, import_react82.useRef)(null);
|
|
11893
11906
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
11894
|
-
(0,
|
|
11907
|
+
(0, import_react82.useEffect)(() => {
|
|
11895
11908
|
var _a;
|
|
11896
11909
|
if (focus) {
|
|
11897
11910
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
@@ -12046,7 +12059,7 @@ var Search = ({
|
|
|
12046
12059
|
...rest
|
|
12047
12060
|
}) => {
|
|
12048
12061
|
var _a;
|
|
12049
|
-
const generatedId = (0,
|
|
12062
|
+
const generatedId = (0, import_react83.useId)();
|
|
12050
12063
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
12051
12064
|
const hasLabel = !!label;
|
|
12052
12065
|
const tipId = derivativeIdGenerator(uniqueId, "tip");
|
|
@@ -12056,7 +12069,7 @@ var Search = ({
|
|
|
12056
12069
|
"suggestions-description"
|
|
12057
12070
|
);
|
|
12058
12071
|
const { t } = useTranslation();
|
|
12059
|
-
const [hasValue, setHasValue] = (0,
|
|
12072
|
+
const [hasValue, setHasValue] = (0, import_react83.useState)(!!value);
|
|
12060
12073
|
const context = useAutocompleteSearch();
|
|
12061
12074
|
const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
|
|
12062
12075
|
const handleChange = (e) => {
|
|
@@ -12199,7 +12212,7 @@ var texts21 = createTexts({
|
|
|
12199
12212
|
});
|
|
12200
12213
|
|
|
12201
12214
|
// src/components/Search/SearchAutocompleteWrapper.tsx
|
|
12202
|
-
var
|
|
12215
|
+
var import_react84 = require("react");
|
|
12203
12216
|
var import_jsx_runtime296 = require("react/jsx-runtime");
|
|
12204
12217
|
var SearchAutocompleteWrapper = (props) => {
|
|
12205
12218
|
const {
|
|
@@ -12211,12 +12224,12 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
12211
12224
|
onSuggestionSelection,
|
|
12212
12225
|
children
|
|
12213
12226
|
} = props;
|
|
12214
|
-
const [inputValue, setInputValue] = (0,
|
|
12215
|
-
const [suggestions, setSuggestions] = (0,
|
|
12216
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
12227
|
+
const [inputValue, setInputValue] = (0, import_react84.useState)(value != null ? value : "");
|
|
12228
|
+
const [suggestions, setSuggestions] = (0, import_react84.useState)([]);
|
|
12229
|
+
const [showSuggestions, setShowSuggestions] = (0, import_react84.useState)(false);
|
|
12217
12230
|
const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
|
|
12218
12231
|
const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
|
|
12219
|
-
(0,
|
|
12232
|
+
(0, import_react84.useEffect)(() => {
|
|
12220
12233
|
if (suggestions.length > 0) {
|
|
12221
12234
|
openSuggestions();
|
|
12222
12235
|
} else {
|
|
@@ -12261,8 +12274,8 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
12261
12274
|
const handleSetInputValue = (value2) => {
|
|
12262
12275
|
setInputValue(value2 != null ? value2 : "");
|
|
12263
12276
|
};
|
|
12264
|
-
const inputRef = (0,
|
|
12265
|
-
const suggestionsRef = (0,
|
|
12277
|
+
const inputRef = (0, import_react84.useRef)(null);
|
|
12278
|
+
const suggestionsRef = (0, import_react84.useRef)(null);
|
|
12266
12279
|
useOnClickOutside([inputRef.current, suggestionsRef.current], () => {
|
|
12267
12280
|
closeSuggestions();
|
|
12268
12281
|
});
|
|
@@ -12344,7 +12357,7 @@ var SkipToContent = ({
|
|
|
12344
12357
|
SkipToContent.displayName = "SkipToContent";
|
|
12345
12358
|
|
|
12346
12359
|
// src/components/SplitButton/SplitButton.tsx
|
|
12347
|
-
var
|
|
12360
|
+
var import_react85 = require("react");
|
|
12348
12361
|
|
|
12349
12362
|
// src/components/SplitButton/SplitButton.module.css
|
|
12350
12363
|
var SplitButton_default = {
|
|
@@ -12365,7 +12378,7 @@ var SplitButton = ({
|
|
|
12365
12378
|
...rest
|
|
12366
12379
|
}) => {
|
|
12367
12380
|
const { t } = useTranslation();
|
|
12368
|
-
const [isOpen, setIsOpen] = (0,
|
|
12381
|
+
const [isOpen, setIsOpen] = (0, import_react85.useState)(false);
|
|
12369
12382
|
const buttonStyleProps = {
|
|
12370
12383
|
purpose,
|
|
12371
12384
|
size: size2
|
|
@@ -12410,15 +12423,15 @@ var texts22 = createTexts({
|
|
|
12410
12423
|
});
|
|
12411
12424
|
|
|
12412
12425
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
12413
|
-
var
|
|
12426
|
+
var import_react89 = require("react");
|
|
12414
12427
|
|
|
12415
12428
|
// src/components/Table/collapsible/Table.context.tsx
|
|
12416
|
-
var
|
|
12417
|
-
var CollapsibleTableContext = (0,
|
|
12429
|
+
var import_react86 = require("react");
|
|
12430
|
+
var CollapsibleTableContext = (0, import_react86.createContext)({
|
|
12418
12431
|
headerValues: [],
|
|
12419
12432
|
definingColumnIndex: [0]
|
|
12420
12433
|
});
|
|
12421
|
-
var useCollapsibleTableContext = () => (0,
|
|
12434
|
+
var useCollapsibleTableContext = () => (0, import_react86.useContext)(CollapsibleTableContext);
|
|
12422
12435
|
|
|
12423
12436
|
// src/components/Table/normal/Body.tsx
|
|
12424
12437
|
var import_jsx_runtime300 = require("react/jsx-runtime");
|
|
@@ -12426,12 +12439,12 @@ var Body = (props) => /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("tbody", {
|
|
|
12426
12439
|
Body.displayName = "Table.Body";
|
|
12427
12440
|
|
|
12428
12441
|
// src/components/Table/normal/Head.tsx
|
|
12429
|
-
var
|
|
12442
|
+
var import_react87 = require("react");
|
|
12430
12443
|
var import_jsx_runtime301 = require("react/jsx-runtime");
|
|
12431
12444
|
var Head = ({ children, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("thead", { ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(HeadContext, { value: true, children }) });
|
|
12432
|
-
var HeadContext = (0,
|
|
12445
|
+
var HeadContext = (0, import_react87.createContext)(false);
|
|
12433
12446
|
function useIsInTableHead() {
|
|
12434
|
-
const isInTableHead = (0,
|
|
12447
|
+
const isInTableHead = (0, import_react87.useContext)(HeadContext);
|
|
12435
12448
|
return isInTableHead;
|
|
12436
12449
|
}
|
|
12437
12450
|
|
|
@@ -12607,26 +12620,26 @@ var Table = ({
|
|
|
12607
12620
|
Table.displayName = "Table";
|
|
12608
12621
|
|
|
12609
12622
|
// src/components/Table/normal/TableWrapper.tsx
|
|
12610
|
-
var
|
|
12623
|
+
var import_react88 = require("react");
|
|
12611
12624
|
var import_jsx_runtime307 = require("react/jsx-runtime");
|
|
12612
12625
|
var TableWrapper = ({ className, ...rest }) => {
|
|
12613
|
-
const themeContext = (0,
|
|
12626
|
+
const themeContext = (0, import_react88.useContext)(ThemeContext);
|
|
12614
12627
|
const container2 = themeContext == null ? void 0 : themeContext.el;
|
|
12615
12628
|
const containerWidth = container2 ? container2.clientWidth : 0;
|
|
12616
|
-
const [overflowX, setOverflowX] = (0,
|
|
12617
|
-
const [themeContainerWidth, setThemeContainerWidth] = (0,
|
|
12629
|
+
const [overflowX, setOverflowX] = (0, import_react88.useState)(false);
|
|
12630
|
+
const [themeContainerWidth, setThemeContainerWidth] = (0, import_react88.useState)(containerWidth);
|
|
12618
12631
|
function isOverflowingX(event) {
|
|
12619
12632
|
return event.offsetWidth < event.scrollWidth;
|
|
12620
12633
|
}
|
|
12621
|
-
const wrapperRef = (0,
|
|
12622
|
-
(0,
|
|
12634
|
+
const wrapperRef = (0, import_react88.useRef)(null);
|
|
12635
|
+
(0, import_react88.useEffect)(() => {
|
|
12623
12636
|
if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
|
|
12624
12637
|
setOverflowX(true);
|
|
12625
12638
|
return;
|
|
12626
12639
|
}
|
|
12627
12640
|
setOverflowX(false);
|
|
12628
12641
|
}, [themeContainerWidth]);
|
|
12629
|
-
(0,
|
|
12642
|
+
(0, import_react88.useEffect)(() => {
|
|
12630
12643
|
function handleResize() {
|
|
12631
12644
|
setThemeContainerWidth(containerWidth);
|
|
12632
12645
|
}
|
|
@@ -12675,8 +12688,8 @@ var CollapsibleRow = ({
|
|
|
12675
12688
|
const isInHead = useIsInTableHead();
|
|
12676
12689
|
const type = _type != null ? _type : isInHead ? "head" : "body";
|
|
12677
12690
|
const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
|
|
12678
|
-
const [childrenCollapsed, setChildrenCollapsed] = (0,
|
|
12679
|
-
(0,
|
|
12691
|
+
const [childrenCollapsed, setChildrenCollapsed] = (0, import_react89.useState)(true);
|
|
12692
|
+
(0, import_react89.useEffect)(() => {
|
|
12680
12693
|
!isCollapsed && setChildrenCollapsed(true);
|
|
12681
12694
|
}, [isCollapsed]);
|
|
12682
12695
|
const rowProps = (isOpenCollapsibleHeader) => {
|
|
@@ -12694,7 +12707,7 @@ var CollapsibleRow = ({
|
|
|
12694
12707
|
const collapsedHeaderValues = headerValues.filter(
|
|
12695
12708
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
12696
12709
|
);
|
|
12697
|
-
const childrenArray =
|
|
12710
|
+
const childrenArray = import_react89.Children.toArray(children);
|
|
12698
12711
|
const collapsedChildren = childrenArray.filter(
|
|
12699
12712
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
12700
12713
|
);
|
|
@@ -12703,9 +12716,9 @@ var CollapsibleRow = ({
|
|
|
12703
12716
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
12704
12717
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
12705
12718
|
collapsibleIds.push(id);
|
|
12706
|
-
return /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(
|
|
12719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(import_react89.Fragment, { children: [
|
|
12707
12720
|
/* @__PURE__ */ (0, import_jsx_runtime308.jsx)(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
|
|
12708
|
-
(0,
|
|
12721
|
+
(0, import_react89.isValidElement)(child) && (0, import_react89.cloneElement)(child, {
|
|
12709
12722
|
collapsibleProps: { isCollapsibleChild: true }
|
|
12710
12723
|
})
|
|
12711
12724
|
] }, `DL-${index}`);
|
|
@@ -12799,11 +12812,11 @@ var CollapsibleTable2 = CollapsibleTable;
|
|
|
12799
12812
|
CollapsibleTable2.Row = CollapsibleRow;
|
|
12800
12813
|
|
|
12801
12814
|
// src/components/Tabs/AddTabButton.tsx
|
|
12802
|
-
var
|
|
12815
|
+
var import_react92 = require("react");
|
|
12803
12816
|
|
|
12804
12817
|
// src/components/Tabs/Tabs.context.tsx
|
|
12805
|
-
var
|
|
12806
|
-
var TabsContext = (0,
|
|
12818
|
+
var import_react90 = require("react");
|
|
12819
|
+
var TabsContext = (0, import_react90.createContext)({
|
|
12807
12820
|
activeTab: 0,
|
|
12808
12821
|
tabsId: "",
|
|
12809
12822
|
size: "small",
|
|
@@ -12815,7 +12828,7 @@ var TabsContext = (0, import_react89.createContext)({
|
|
|
12815
12828
|
tabContentDirection: "row",
|
|
12816
12829
|
addTabButtonProps: void 0
|
|
12817
12830
|
});
|
|
12818
|
-
var useTabsContext = () => (0,
|
|
12831
|
+
var useTabsContext = () => (0, import_react90.useContext)(TabsContext);
|
|
12819
12832
|
|
|
12820
12833
|
// src/components/Tabs/Tabs.module.css
|
|
12821
12834
|
var Tabs_default = {
|
|
@@ -12834,9 +12847,9 @@ var Tabs_default = {
|
|
|
12834
12847
|
};
|
|
12835
12848
|
|
|
12836
12849
|
// src/components/Tabs/TabWidthContext.tsx
|
|
12837
|
-
var
|
|
12850
|
+
var import_react91 = require("react");
|
|
12838
12851
|
var import_jsx_runtime310 = require("react/jsx-runtime");
|
|
12839
|
-
var TabContext = (0,
|
|
12852
|
+
var TabContext = (0, import_react91.createContext)(null);
|
|
12840
12853
|
function TabWidthContextProvider({
|
|
12841
12854
|
children,
|
|
12842
12855
|
onChangeWidths
|
|
@@ -12865,8 +12878,8 @@ function TabWidthContextProvider({
|
|
|
12865
12878
|
);
|
|
12866
12879
|
}
|
|
12867
12880
|
function useSetTabWidth(index, width) {
|
|
12868
|
-
const context = (0,
|
|
12869
|
-
(0,
|
|
12881
|
+
const context = (0, import_react91.useContext)(TabContext);
|
|
12882
|
+
(0, import_react91.useLayoutEffect)(() => {
|
|
12870
12883
|
context == null ? void 0 : context.updateWidth(index, width);
|
|
12871
12884
|
return () => context == null ? void 0 : context.removeTab(index);
|
|
12872
12885
|
}, [index, width]);
|
|
@@ -12883,7 +12896,7 @@ var AddTabButton = ({
|
|
|
12883
12896
|
...rest
|
|
12884
12897
|
}) => {
|
|
12885
12898
|
useSetTabWidth(index, width);
|
|
12886
|
-
const buttonRef = (0,
|
|
12899
|
+
const buttonRef = (0, import_react92.useRef)(null);
|
|
12887
12900
|
const combinedRef = useCombinedRef(ref, buttonRef);
|
|
12888
12901
|
const { tabContentDirection, size: size2 } = useTabsContext();
|
|
12889
12902
|
return /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)(
|
|
@@ -12908,7 +12921,7 @@ var AddTabButton = ({
|
|
|
12908
12921
|
AddTabButton.displayName = "AddTabButton";
|
|
12909
12922
|
|
|
12910
12923
|
// src/components/Tabs/Tabs.tsx
|
|
12911
|
-
var
|
|
12924
|
+
var import_react93 = require("react");
|
|
12912
12925
|
var import_jsx_runtime312 = require("react/jsx-runtime");
|
|
12913
12926
|
var Tabs = ({
|
|
12914
12927
|
id,
|
|
@@ -12923,17 +12936,17 @@ var Tabs = ({
|
|
|
12923
12936
|
htmlProps,
|
|
12924
12937
|
...rest
|
|
12925
12938
|
}) => {
|
|
12926
|
-
const generatedId = (0,
|
|
12939
|
+
const generatedId = (0, import_react93.useId)();
|
|
12927
12940
|
const uniqueId = id != null ? id : `${generatedId}-tabs`;
|
|
12928
|
-
const [thisActiveTab, setActiveTab] = (0,
|
|
12929
|
-
const [hasTabFocus, setHasTabFocus] = (0,
|
|
12930
|
-
const tabListRef = (0,
|
|
12931
|
-
const tabPanelsRef = (0,
|
|
12941
|
+
const [thisActiveTab, setActiveTab] = (0, import_react93.useState)(activeTab != null ? activeTab : 0);
|
|
12942
|
+
const [hasTabFocus, setHasTabFocus] = (0, import_react93.useState)(false);
|
|
12943
|
+
const tabListRef = (0, import_react93.useRef)(null);
|
|
12944
|
+
const tabPanelsRef = (0, import_react93.useRef)(null);
|
|
12932
12945
|
const handleTabChange = (index) => {
|
|
12933
12946
|
setActiveTab(index);
|
|
12934
12947
|
onChange && onChange(index);
|
|
12935
12948
|
};
|
|
12936
|
-
(0,
|
|
12949
|
+
(0, import_react93.useEffect)(() => {
|
|
12937
12950
|
if (activeTab !== void 0 && activeTab !== thisActiveTab) {
|
|
12938
12951
|
setActiveTab(activeTab);
|
|
12939
12952
|
}
|
|
@@ -12972,7 +12985,7 @@ var Tabs = ({
|
|
|
12972
12985
|
Tabs.displayName = "Tabs";
|
|
12973
12986
|
|
|
12974
12987
|
// src/components/Tabs/Tab.tsx
|
|
12975
|
-
var
|
|
12988
|
+
var import_react94 = require("react");
|
|
12976
12989
|
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
12977
12990
|
var Tab = ({
|
|
12978
12991
|
active = false,
|
|
@@ -12991,18 +13004,18 @@ var Tab = ({
|
|
|
12991
13004
|
...rest
|
|
12992
13005
|
}) => {
|
|
12993
13006
|
useSetTabWidth(index, width);
|
|
12994
|
-
const itemRef = (0,
|
|
13007
|
+
const itemRef = (0, import_react94.useRef)(null);
|
|
12995
13008
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
12996
13009
|
const { tabContentDirection, size: size2 } = useTabsContext();
|
|
12997
13010
|
const { type = "button", ...restHtmlProps } = htmlProps;
|
|
12998
13011
|
const fixedHtmlProps = { type, ...restHtmlProps };
|
|
12999
|
-
(0,
|
|
13012
|
+
(0, import_react94.useEffect)(() => {
|
|
13000
13013
|
var _a;
|
|
13001
13014
|
if (focus) {
|
|
13002
13015
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
13003
13016
|
}
|
|
13004
13017
|
}, [focus]);
|
|
13005
|
-
const handleSelect = (0,
|
|
13018
|
+
const handleSelect = (0, import_react94.useCallback)(() => {
|
|
13006
13019
|
if (setFocus && index) {
|
|
13007
13020
|
setFocus(index);
|
|
13008
13021
|
}
|
|
@@ -13048,7 +13061,7 @@ var Tab = ({
|
|
|
13048
13061
|
Tab.displayName = "Tab";
|
|
13049
13062
|
|
|
13050
13063
|
// src/components/Tabs/TabList.tsx
|
|
13051
|
-
var
|
|
13064
|
+
var import_react95 = require("react");
|
|
13052
13065
|
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
13053
13066
|
var TabList = ({
|
|
13054
13067
|
children,
|
|
@@ -13068,15 +13081,15 @@ var TabList = ({
|
|
|
13068
13081
|
addTabButtonProps
|
|
13069
13082
|
} = useTabsContext();
|
|
13070
13083
|
const uniqueId = id != null ? id : `${tabsId}-tablist`;
|
|
13071
|
-
const childrenArray =
|
|
13084
|
+
const childrenArray = import_react95.Children.toArray(children).length;
|
|
13072
13085
|
const [focus, setFocus] = useRoveFocus(childrenArray, hasTabFocus, "row");
|
|
13073
13086
|
const combinedRef = useCombinedRef(ref, tabListRef);
|
|
13074
13087
|
const hasButton = addTabButtonProps ? true : false;
|
|
13075
|
-
const tabListChildren =
|
|
13088
|
+
const tabListChildren = import_react95.Children ? import_react95.Children.map(children, (child, index) => {
|
|
13076
13089
|
const handleThisTabChange = () => {
|
|
13077
13090
|
handleTabChange(index);
|
|
13078
13091
|
};
|
|
13079
|
-
return (0,
|
|
13092
|
+
return (0, import_react95.isValidElement)(child) && (0, import_react95.cloneElement)(child, {
|
|
13080
13093
|
id: `${tabsId}-tab-${index}`,
|
|
13081
13094
|
htmlProps: {
|
|
13082
13095
|
...child.props.htmlProps,
|
|
@@ -13089,7 +13102,7 @@ var TabList = ({
|
|
|
13089
13102
|
onClick: combineHandlers(handleThisTabChange, child.props.onClick)
|
|
13090
13103
|
});
|
|
13091
13104
|
}) : [];
|
|
13092
|
-
const [widths, setWidths] = (0,
|
|
13105
|
+
const [widths, setWidths] = (0, import_react95.useState)([]);
|
|
13093
13106
|
const handleOnFocus = (event) => {
|
|
13094
13107
|
setHasTabFocus(true);
|
|
13095
13108
|
onFocus && onFocus(event);
|
|
@@ -13163,14 +13176,14 @@ var TabPanel = ({
|
|
|
13163
13176
|
TabPanel.displayName = "TabPanel";
|
|
13164
13177
|
|
|
13165
13178
|
// src/components/Tabs/TabPanels.tsx
|
|
13166
|
-
var
|
|
13179
|
+
var import_react96 = require("react");
|
|
13167
13180
|
var import_jsx_runtime316 = require("react/jsx-runtime");
|
|
13168
13181
|
var TabPanels = ({ children, ref, ...rest }) => {
|
|
13169
13182
|
const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
|
|
13170
13183
|
const combinedRef = useCombinedRef(ref, tabPanelsRef);
|
|
13171
|
-
const panelChildren =
|
|
13184
|
+
const panelChildren = import_react96.Children.map(children, (child, index) => {
|
|
13172
13185
|
const active = index === activeTab;
|
|
13173
|
-
return (0,
|
|
13186
|
+
return (0, import_react96.isValidElement)(child) && (0, import_react96.cloneElement)(child, {
|
|
13174
13187
|
id: `${tabsId}-panel-${index}`,
|
|
13175
13188
|
active,
|
|
13176
13189
|
htmlProps: {
|
|
@@ -13245,7 +13258,7 @@ var Tag = ({
|
|
|
13245
13258
|
Tag.displayName = "Tag";
|
|
13246
13259
|
|
|
13247
13260
|
// src/components/TextInput/TextInput.tsx
|
|
13248
|
-
var
|
|
13261
|
+
var import_react97 = require("react");
|
|
13249
13262
|
|
|
13250
13263
|
// src/components/TextInput/TextInput.module.css
|
|
13251
13264
|
var TextInput_default = {
|
|
@@ -13294,12 +13307,12 @@ var TextInput = ({
|
|
|
13294
13307
|
ref,
|
|
13295
13308
|
...rest
|
|
13296
13309
|
}) => {
|
|
13297
|
-
const [text, setText] = (0,
|
|
13298
|
-
const prefixRef = (0,
|
|
13299
|
-
const suffixRef = (0,
|
|
13300
|
-
const [prefixLength, setPrefixLength] = (0,
|
|
13301
|
-
const [suffixLength, setSuffixLength] = (0,
|
|
13302
|
-
(0,
|
|
13310
|
+
const [text, setText] = (0, import_react97.useState)(getDefaultText(value, defaultValue));
|
|
13311
|
+
const prefixRef = (0, import_react97.useRef)(null);
|
|
13312
|
+
const suffixRef = (0, import_react97.useRef)(null);
|
|
13313
|
+
const [prefixLength, setPrefixLength] = (0, import_react97.useState)(0);
|
|
13314
|
+
const [suffixLength, setSuffixLength] = (0, import_react97.useState)(0);
|
|
13315
|
+
(0, import_react97.useLayoutEffect)(() => {
|
|
13303
13316
|
if (prefixRef.current) {
|
|
13304
13317
|
setPrefixLength(prefixRef.current.offsetWidth);
|
|
13305
13318
|
}
|
|
@@ -13313,7 +13326,7 @@ var TextInput = ({
|
|
|
13313
13326
|
onChange(event);
|
|
13314
13327
|
}
|
|
13315
13328
|
};
|
|
13316
|
-
const generatedId = (0,
|
|
13329
|
+
const generatedId = (0, import_react97.useId)();
|
|
13317
13330
|
const uniqueId = id != null ? id : `${generatedId}-textInput`;
|
|
13318
13331
|
const hasErrorMessage = !!errorMessage;
|
|
13319
13332
|
const hasTip = !!tip;
|
|
@@ -13483,7 +13496,7 @@ var TextInput = ({
|
|
|
13483
13496
|
TextInput.displayName = "TextInput";
|
|
13484
13497
|
|
|
13485
13498
|
// src/components/Toggle/Toggle.tsx
|
|
13486
|
-
var
|
|
13499
|
+
var import_react98 = require("react");
|
|
13487
13500
|
|
|
13488
13501
|
// src/components/Toggle/Toggle.module.css
|
|
13489
13502
|
var Toggle_default = {
|
|
@@ -13517,7 +13530,7 @@ var Toggle = ({
|
|
|
13517
13530
|
...rest
|
|
13518
13531
|
}) => {
|
|
13519
13532
|
const { t } = useTranslation();
|
|
13520
|
-
const generatedId = (0,
|
|
13533
|
+
const generatedId = (0, import_react98.useId)();
|
|
13521
13534
|
const uniqueId = id != null ? id : `${generatedId}-toggle`;
|
|
13522
13535
|
const iconSize = size2 === "large" ? "medium" : "small";
|
|
13523
13536
|
const [checked, setChecked] = useControllableState({
|
|
@@ -13592,14 +13605,14 @@ var Toggle = ({
|
|
|
13592
13605
|
Toggle.displayName = "Toggle";
|
|
13593
13606
|
|
|
13594
13607
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
13595
|
-
var
|
|
13608
|
+
var import_react100 = require("react");
|
|
13596
13609
|
|
|
13597
13610
|
// src/components/ToggleBar/ToggleBar.context.tsx
|
|
13598
|
-
var
|
|
13599
|
-
var ToggleBarContext = (0,
|
|
13611
|
+
var import_react99 = require("react");
|
|
13612
|
+
var ToggleBarContext = (0, import_react99.createContext)({
|
|
13600
13613
|
size: "medium"
|
|
13601
13614
|
});
|
|
13602
|
-
var useToggleBarContext = () => (0,
|
|
13615
|
+
var useToggleBarContext = () => (0, import_react99.useContext)(ToggleBarContext);
|
|
13603
13616
|
|
|
13604
13617
|
// src/components/ToggleBar/ToggleBar.module.css
|
|
13605
13618
|
var ToggleBar_default = {
|
|
@@ -13632,9 +13645,9 @@ var ToggleBar = (props) => {
|
|
|
13632
13645
|
id,
|
|
13633
13646
|
...rest
|
|
13634
13647
|
} = props;
|
|
13635
|
-
const generatedId = (0,
|
|
13648
|
+
const generatedId = (0, import_react100.useId)();
|
|
13636
13649
|
const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
|
|
13637
|
-
const [groupValue, setGroupValue] = (0,
|
|
13650
|
+
const [groupValue, setGroupValue] = (0, import_react100.useState)(value);
|
|
13638
13651
|
const handleChange = combineHandlers(
|
|
13639
13652
|
(e) => setGroupValue(e.target.value),
|
|
13640
13653
|
(e) => onChange && onChange(e, e.target.value)
|
|
@@ -13669,7 +13682,7 @@ var ToggleBar = (props) => {
|
|
|
13669
13682
|
ToggleBar.displayName = "ToggleBar";
|
|
13670
13683
|
|
|
13671
13684
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
13672
|
-
var
|
|
13685
|
+
var import_react101 = require("react");
|
|
13673
13686
|
var import_jsx_runtime321 = require("react/jsx-runtime");
|
|
13674
13687
|
var typographyTypes3 = {
|
|
13675
13688
|
large: "bodyLarge",
|
|
@@ -13701,7 +13714,7 @@ var ToggleRadio = ({
|
|
|
13701
13714
|
id,
|
|
13702
13715
|
...rest
|
|
13703
13716
|
}) => {
|
|
13704
|
-
const generatedId = (0,
|
|
13717
|
+
const generatedId = (0, import_react101.useId)();
|
|
13705
13718
|
const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
|
|
13706
13719
|
const group = useToggleBarContext();
|
|
13707
13720
|
const handleChange = (event) => {
|
|
@@ -13753,7 +13766,7 @@ var ToggleRadio = ({
|
|
|
13753
13766
|
ToggleRadio.displayName = "ToggleRadio";
|
|
13754
13767
|
|
|
13755
13768
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
13756
|
-
var
|
|
13769
|
+
var import_react102 = require("react");
|
|
13757
13770
|
|
|
13758
13771
|
// src/components/ToggleButton/ToggleButton.module.css
|
|
13759
13772
|
var ToggleButton_default = {
|
|
@@ -13774,7 +13787,7 @@ var ToggleButton = ({
|
|
|
13774
13787
|
htmlProps,
|
|
13775
13788
|
...rest
|
|
13776
13789
|
}) => {
|
|
13777
|
-
const generatedId = (0,
|
|
13790
|
+
const generatedId = (0, import_react102.useId)();
|
|
13778
13791
|
const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
|
|
13779
13792
|
const hasIcon = !!icon;
|
|
13780
13793
|
return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)(Box, { as: "label", htmlFor: uniqueId, width: "fit-content", children: [
|
|
@@ -13816,7 +13829,7 @@ var ToggleButton = ({
|
|
|
13816
13829
|
ToggleButton.displayName = "ToggleButton";
|
|
13817
13830
|
|
|
13818
13831
|
// src/components/ToggleButton/ToggleButtonGroup.tsx
|
|
13819
|
-
var
|
|
13832
|
+
var import_react103 = require("react");
|
|
13820
13833
|
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
13821
13834
|
var ToggleButtonGroup = (props) => {
|
|
13822
13835
|
const {
|
|
@@ -13829,7 +13842,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
13829
13842
|
htmlProps,
|
|
13830
13843
|
...rest
|
|
13831
13844
|
} = props;
|
|
13832
|
-
const generatedId = (0,
|
|
13845
|
+
const generatedId = (0, import_react103.useId)();
|
|
13833
13846
|
const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
|
|
13834
13847
|
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(
|
|
13835
13848
|
VStack,
|