@norges-domstoler/dds-components 22.10.0 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +33 -2
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +82 -24
- package/dist/index.d.ts +82 -24
- package/dist/index.js +500 -294
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +626 -421
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -243,6 +243,7 @@ __export(index_exports, {
|
|
|
243
243
|
MoreHorizontalIcon: () => MoreHorizontalIcon,
|
|
244
244
|
MoreVerticalIcon: () => MoreVerticalIcon,
|
|
245
245
|
NativeSelect: () => NativeSelect,
|
|
246
|
+
NewsPopover: () => NewsPopover,
|
|
246
247
|
NotarialIcon: () => NotarialIcon,
|
|
247
248
|
NotebookPenIcon: () => NotebookPenIcon,
|
|
248
249
|
NotificationsIcon: () => NotificationsIcon,
|
|
@@ -433,9 +434,7 @@ var typographyStyles_default = {
|
|
|
433
434
|
"a--nested__parent": "typographyStyles_a--nested__parent",
|
|
434
435
|
"a--nested__child": "typographyStyles_a--nested__child",
|
|
435
436
|
"a--margins": "typographyStyles_a--margins",
|
|
436
|
-
"a--
|
|
437
|
-
svg: "typographyStyles_svg",
|
|
438
|
-
a__icon: "typographyStyles_a__icon",
|
|
437
|
+
"a--with-icon": "typographyStyles_a--with-icon",
|
|
439
438
|
"a--visited": "typographyStyles_a--visited",
|
|
440
439
|
"body-short-xsmall": "typographyStyles_body-short-xsmall",
|
|
441
440
|
"body-short-xsmall--margins": "typographyStyles_body-short-xsmall--margins",
|
|
@@ -752,6 +751,21 @@ var TEXT_COLORS = [
|
|
|
752
751
|
"icon-subtle",
|
|
753
752
|
"icon-medium"
|
|
754
753
|
];
|
|
754
|
+
var ICON_COLORS = [
|
|
755
|
+
...TEXT_COLORS,
|
|
756
|
+
"brand-primary-default",
|
|
757
|
+
"brand-primary-strong",
|
|
758
|
+
"brand-primary-medium",
|
|
759
|
+
"brand-primary-subtle",
|
|
760
|
+
"brand-secondary-default",
|
|
761
|
+
"brand-secondary-strong",
|
|
762
|
+
"brand-secondary-medium",
|
|
763
|
+
"brand-secondary-subtle",
|
|
764
|
+
"brand-tertiary-default",
|
|
765
|
+
"brand-tertiary-strong",
|
|
766
|
+
"brand-tertiary-medium",
|
|
767
|
+
"brand-tertiary-subtle"
|
|
768
|
+
];
|
|
755
769
|
var TEXT_COLOR_VALUES = TEXT_COLORS.reduce(
|
|
756
770
|
(acc, key) => {
|
|
757
771
|
acc[key] = `var(--dds-color-${key})`;
|
|
@@ -759,6 +773,13 @@ var TEXT_COLOR_VALUES = TEXT_COLORS.reduce(
|
|
|
759
773
|
},
|
|
760
774
|
{}
|
|
761
775
|
);
|
|
776
|
+
var ICON_COLOR_VALUES = ICON_COLORS.reduce(
|
|
777
|
+
(acc, key) => {
|
|
778
|
+
acc[key] = `var(--dds-color-${key})`;
|
|
779
|
+
return acc;
|
|
780
|
+
},
|
|
781
|
+
{}
|
|
782
|
+
);
|
|
762
783
|
var isTextColor = (value) => {
|
|
763
784
|
return typeof value === "string" && TEXT_COLORS.includes(value);
|
|
764
785
|
};
|
|
@@ -766,6 +787,13 @@ var getTextColor = (color) => {
|
|
|
766
787
|
if (isTextColor(color)) return TEXT_COLOR_VALUES[color];
|
|
767
788
|
return color;
|
|
768
789
|
};
|
|
790
|
+
var isIconColor = (value) => {
|
|
791
|
+
return typeof value === "string" && ICON_COLORS.includes(value);
|
|
792
|
+
};
|
|
793
|
+
var getIconColor = (color) => {
|
|
794
|
+
if (isIconColor(color)) return ICON_COLOR_VALUES[color];
|
|
795
|
+
return color;
|
|
796
|
+
};
|
|
769
797
|
|
|
770
798
|
// src/utils/combineHandlers.tsx
|
|
771
799
|
var combineHandlers = (handler1, handler2) => {
|
|
@@ -956,7 +984,7 @@ var import_react8 = require("react");
|
|
|
956
984
|
function useOnClickOutside(element, handler) {
|
|
957
985
|
(0, import_react8.useEffect)(() => {
|
|
958
986
|
const listener = (event) => {
|
|
959
|
-
const elements = Array.isArray(element) ? element :
|
|
987
|
+
const elements = Array.isArray(element) ? element.map((ref) => ref == null ? void 0 : ref.current).filter((el) => Boolean(el)) : (element == null ? void 0 : element.current) ? [element.current] : [];
|
|
960
988
|
const hasClickedInside = elements.some(
|
|
961
989
|
(el) => el == null ? void 0 : el.contains(event.target)
|
|
962
990
|
);
|
|
@@ -1449,6 +1477,7 @@ var layout_default = {
|
|
|
1449
1477
|
"dds-a-i": "layout_dds-a-i",
|
|
1450
1478
|
"dds-a-c": "layout_dds-a-c",
|
|
1451
1479
|
"dds-j-i": "layout_dds-j-i",
|
|
1480
|
+
"dds-pl-i": "layout_dds-pl-i",
|
|
1452
1481
|
"dds-j-c": "layout_dds-j-c",
|
|
1453
1482
|
"dds-wrap": "layout_dds-wrap",
|
|
1454
1483
|
"dds-basis": "layout_dds-basis",
|
|
@@ -1617,6 +1646,7 @@ var Box = ({
|
|
|
1617
1646
|
alignItems,
|
|
1618
1647
|
alignContent,
|
|
1619
1648
|
justifyItems,
|
|
1649
|
+
placeItems,
|
|
1620
1650
|
justifyContent,
|
|
1621
1651
|
flexWrap,
|
|
1622
1652
|
flexBasis,
|
|
@@ -1655,6 +1685,7 @@ var Box = ({
|
|
|
1655
1685
|
...getResponsiveCSSProperties(alignItems, "r", "a-i"),
|
|
1656
1686
|
...getResponsiveCSSProperties(alignContent, "r", "a-c"),
|
|
1657
1687
|
...getResponsiveCSSProperties(justifyItems, "r", "j-i"),
|
|
1688
|
+
...getResponsiveCSSProperties(placeItems, "r", "pl-i"),
|
|
1658
1689
|
...getResponsiveCSSProperties(justifyContent, "r", "j-c"),
|
|
1659
1690
|
...getResponsiveCSSProperties(flexWrap, "r", "wrap"),
|
|
1660
1691
|
...getResponsiveCSSProperties(flexBasis, "r", "basis"),
|
|
@@ -1698,6 +1729,7 @@ var Box = ({
|
|
|
1698
1729
|
alignItems && layout_default["dds-a-i"],
|
|
1699
1730
|
justifyContent && layout_default["dds-j-c"],
|
|
1700
1731
|
justifyItems && layout_default["dds-j-i"],
|
|
1732
|
+
placeItems && layout_default["dds-pl-i"],
|
|
1701
1733
|
flexWrap && layout_default["dds-wrap"],
|
|
1702
1734
|
flexBasis && layout_default["dds-basis"],
|
|
1703
1735
|
flexFlow && layout_default["dds-flow"],
|
|
@@ -2016,7 +2048,42 @@ var commonTexts = createTexts({
|
|
|
2016
2048
|
nn: "Innlastning p\xE5g\xE5r",
|
|
2017
2049
|
en: "Loading",
|
|
2018
2050
|
se: "Vie\u017E\u017Eamin"
|
|
2019
|
-
}
|
|
2051
|
+
},
|
|
2052
|
+
nextPage: {
|
|
2053
|
+
nb: "Neste side",
|
|
2054
|
+
no: "Neste side",
|
|
2055
|
+
nn: "Neste side",
|
|
2056
|
+
en: "Next page",
|
|
2057
|
+
se: "Boahte siidu"
|
|
2058
|
+
},
|
|
2059
|
+
previousPage: {
|
|
2060
|
+
nb: "Forrige side",
|
|
2061
|
+
no: "Forrige side",
|
|
2062
|
+
nn: "F\xF8rre side",
|
|
2063
|
+
en: "Previous page",
|
|
2064
|
+
se: "Ovddit siidu"
|
|
2065
|
+
},
|
|
2066
|
+
page: (page) => ({
|
|
2067
|
+
nb: `Side ${page}`,
|
|
2068
|
+
no: `Side ${page}`,
|
|
2069
|
+
nn: `Side ${page}`,
|
|
2070
|
+
en: `Page ${page}`,
|
|
2071
|
+
se: `Siidu ${page}`
|
|
2072
|
+
}),
|
|
2073
|
+
currentPage: (page) => ({
|
|
2074
|
+
nb: `N\xE5v\xE6rende side (${page})`,
|
|
2075
|
+
no: `N\xE5v\xE6rende side (${page})`,
|
|
2076
|
+
nn: `Noverande side (${page})`,
|
|
2077
|
+
en: `Current page (${page})`,
|
|
2078
|
+
se: `D\xE1la siidu (${page})`
|
|
2079
|
+
}),
|
|
2080
|
+
pageOf: (current, max) => ({
|
|
2081
|
+
nb: `Side ${current} av ${max}`,
|
|
2082
|
+
no: `Side ${current} av ${max}`,
|
|
2083
|
+
nn: `Side ${current} ${max}`,
|
|
2084
|
+
en: `Page ${current} of ${max}`,
|
|
2085
|
+
se: `Siidu ${current} ${max}`
|
|
2086
|
+
})
|
|
2020
2087
|
});
|
|
2021
2088
|
|
|
2022
2089
|
// src/components/Spinner/Spinner.tsx
|
|
@@ -2475,7 +2542,7 @@ function SvgWrapper({
|
|
|
2475
2542
|
"svg",
|
|
2476
2543
|
{
|
|
2477
2544
|
...props,
|
|
2478
|
-
fill:
|
|
2545
|
+
fill: getIconColor(fill),
|
|
2479
2546
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2480
2547
|
viewBox: `0 0 ${size} ${size}`,
|
|
2481
2548
|
className: cn(className, Icon_default.svg),
|
|
@@ -4235,16 +4302,11 @@ var Typography = (props) => {
|
|
|
4235
4302
|
const as = propAs ? propAs : getElementType(typographyType);
|
|
4236
4303
|
const typographyCn = getTypographyCn(typographyType);
|
|
4237
4304
|
let relProp;
|
|
4238
|
-
let targetProp;
|
|
4239
|
-
let externalLinkProp;
|
|
4240
4305
|
if (isAnchorProps(props)) {
|
|
4241
|
-
const { externalLink, target } = props;
|
|
4242
4306
|
relProp = as === "a" ? "noopener noreferer" : void 0;
|
|
4243
|
-
targetProp = as !== "a" ? void 0 : externalLink ? "_blank" : target;
|
|
4244
|
-
externalLinkProp = as === "a" && externalLink ? externalLink : void 0;
|
|
4245
4307
|
}
|
|
4246
|
-
return /* @__PURE__ */ (0, import_jsx_runtime197.
|
|
4247
|
-
|
|
4308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(
|
|
4309
|
+
Box,
|
|
4248
4310
|
{
|
|
4249
4311
|
...getBaseHTMLProps(
|
|
4250
4312
|
id,
|
|
@@ -4252,7 +4314,6 @@ var Typography = (props) => {
|
|
|
4252
4314
|
className,
|
|
4253
4315
|
getColorCn(color),
|
|
4254
4316
|
Typography_default.container,
|
|
4255
|
-
externalLinkProp && typographyStyles_default["a--external"],
|
|
4256
4317
|
typographyStyles_default[typographyCn],
|
|
4257
4318
|
withMargins && typographyStyles_default[`${typographyCn}--margins`],
|
|
4258
4319
|
isLegend(as) && typographyStyles_default.legend,
|
|
@@ -4272,11 +4333,7 @@ var Typography = (props) => {
|
|
|
4272
4333
|
),
|
|
4273
4334
|
as,
|
|
4274
4335
|
rel: relProp,
|
|
4275
|
-
|
|
4276
|
-
children: [
|
|
4277
|
-
children,
|
|
4278
|
-
externalLinkProp && /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(Icon, { icon: OpenExternalIcon, iconSize: "inherit" })
|
|
4279
|
-
]
|
|
4336
|
+
children
|
|
4280
4337
|
}
|
|
4281
4338
|
);
|
|
4282
4339
|
};
|
|
@@ -4468,21 +4525,19 @@ var Link = ({
|
|
|
4468
4525
|
typographyType,
|
|
4469
4526
|
withMargins,
|
|
4470
4527
|
withVisited,
|
|
4471
|
-
external,
|
|
4472
|
-
target,
|
|
4473
4528
|
style,
|
|
4474
4529
|
color,
|
|
4475
4530
|
as: propAs,
|
|
4476
4531
|
isAnchor: propIsAnchor,
|
|
4532
|
+
withIconStyling,
|
|
4477
4533
|
...rest
|
|
4478
4534
|
}) => {
|
|
4479
4535
|
const as = propAs ? propAs : "a";
|
|
4480
4536
|
const isAnchor = as === "a" || propIsAnchor;
|
|
4481
4537
|
const aProps = isAnchor ? {
|
|
4482
|
-
rel: "noopener noreferrer"
|
|
4483
|
-
target: external ? "_blank" : target
|
|
4538
|
+
rel: "noopener noreferrer"
|
|
4484
4539
|
} : {};
|
|
4485
|
-
return /* @__PURE__ */ (0, import_jsx_runtime202.
|
|
4540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
4486
4541
|
ElementAs,
|
|
4487
4542
|
{
|
|
4488
4543
|
as,
|
|
@@ -4491,7 +4546,7 @@ var Link = ({
|
|
|
4491
4546
|
cn(
|
|
4492
4547
|
className,
|
|
4493
4548
|
typographyStyles_default.a,
|
|
4494
|
-
|
|
4549
|
+
withIconStyling && typographyStyles_default["a--with-icon"],
|
|
4495
4550
|
withVisited && typographyStyles_default["a--visited"],
|
|
4496
4551
|
typographyType && typographyStyles_default[getTypographyCn(typographyType)],
|
|
4497
4552
|
typographyType && withMargins && typographyStyles_default[`${getTypographyCn(typographyType)}--margins`],
|
|
@@ -4506,17 +4561,7 @@ var Link = ({
|
|
|
4506
4561
|
rest
|
|
4507
4562
|
),
|
|
4508
4563
|
...aProps,
|
|
4509
|
-
children
|
|
4510
|
-
children,
|
|
4511
|
-
external && /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
4512
|
-
Icon,
|
|
4513
|
-
{
|
|
4514
|
-
iconSize: "inherit",
|
|
4515
|
-
icon: OpenExternalIcon,
|
|
4516
|
-
className: typographyStyles_default.svg
|
|
4517
|
-
}
|
|
4518
|
-
)
|
|
4519
|
-
]
|
|
4564
|
+
children
|
|
4520
4565
|
}
|
|
4521
4566
|
);
|
|
4522
4567
|
};
|
|
@@ -5334,7 +5379,7 @@ var OverflowMenuGroup = ({
|
|
|
5334
5379
|
if (isOpen) onClose == null ? void 0 : onClose();
|
|
5335
5380
|
toggle();
|
|
5336
5381
|
};
|
|
5337
|
-
useOnClickOutside([menuRef
|
|
5382
|
+
useOnClickOutside([menuRef, buttonRef], () => {
|
|
5338
5383
|
handleClose();
|
|
5339
5384
|
});
|
|
5340
5385
|
useOnKeyDown(["Esc", "Escape"], () => {
|
|
@@ -6872,7 +6917,7 @@ var CalendarPopoverContent = ({
|
|
|
6872
6917
|
const hasTransitionedIn = useMountTransition(isOpen, 500);
|
|
6873
6918
|
const isMounted = isOpen && hasTransitionedIn;
|
|
6874
6919
|
const combinedRef = useCombinedRef(refs.setFloating, ref);
|
|
6875
|
-
useOnClickOutside([ref
|
|
6920
|
+
useOnClickOutside([ref, modalRef], onClose);
|
|
6876
6921
|
(0, import_react41.useEffect)(() => {
|
|
6877
6922
|
var _a;
|
|
6878
6923
|
refs.setReference((_a = anchorRef == null ? void 0 : anchorRef.current) != null ? _a : null);
|
|
@@ -8178,7 +8223,7 @@ var Drawer = ({
|
|
|
8178
8223
|
}
|
|
8179
8224
|
const { t } = useTranslation();
|
|
8180
8225
|
const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
|
|
8181
|
-
const { isOpen = false, onClose, drawerId,
|
|
8226
|
+
const { isOpen = false, onClose, drawerId, triggerRef } = useDrawerContext();
|
|
8182
8227
|
const hasHeader = !!header;
|
|
8183
8228
|
const headerId = hasHeader ? `${drawerId}-header` : void 0;
|
|
8184
8229
|
const drawerRef = useFocusTrap(isOpen);
|
|
@@ -8193,8 +8238,8 @@ var Drawer = ({
|
|
|
8193
8238
|
return () => handleElementWithBackdropUnmount(document.body);
|
|
8194
8239
|
}
|
|
8195
8240
|
}, [isOpen]);
|
|
8196
|
-
const elements = [drawerRef
|
|
8197
|
-
if (
|
|
8241
|
+
const elements = [drawerRef];
|
|
8242
|
+
if (triggerRef) elements.push(triggerRef);
|
|
8198
8243
|
useOnClickOutside(elements, () => {
|
|
8199
8244
|
if (isOpen && !withBackdrop) {
|
|
8200
8245
|
onClose == null ? void 0 : onClose();
|
|
@@ -8357,7 +8402,7 @@ var DrawerGroup = ({
|
|
|
8357
8402
|
drawerId: uniqueDrawerId,
|
|
8358
8403
|
isOpen,
|
|
8359
8404
|
onClose: handleClose,
|
|
8360
|
-
|
|
8405
|
+
triggerRef
|
|
8361
8406
|
},
|
|
8362
8407
|
children: Children7
|
|
8363
8408
|
}
|
|
@@ -9398,13 +9443,21 @@ var fileUploaderReducer = (state, action) => {
|
|
|
9398
9443
|
case "dragEnter":
|
|
9399
9444
|
return {
|
|
9400
9445
|
...state,
|
|
9446
|
+
dragCounter: state.dragCounter + 1,
|
|
9401
9447
|
isDragActive: true
|
|
9402
9448
|
};
|
|
9403
|
-
case "dragLeave":
|
|
9404
|
-
|
|
9449
|
+
case "dragLeave": {
|
|
9450
|
+
const newCounter = Math.max(0, state.dragCounter - 1);
|
|
9451
|
+
return {
|
|
9452
|
+
...state,
|
|
9453
|
+
dragCounter: newCounter,
|
|
9454
|
+
isDragActive: newCounter > 0
|
|
9455
|
+
};
|
|
9456
|
+
}
|
|
9405
9457
|
case "onSetFiles":
|
|
9406
9458
|
return {
|
|
9407
9459
|
...state,
|
|
9460
|
+
dragCounter: 0,
|
|
9408
9461
|
isDragActive: false,
|
|
9409
9462
|
files: action.payload
|
|
9410
9463
|
};
|
|
@@ -9511,6 +9564,7 @@ var useFileUploader = (props) => {
|
|
|
9511
9564
|
isFocused: false,
|
|
9512
9565
|
isFileDialogActive: false,
|
|
9513
9566
|
isDragActive: false,
|
|
9567
|
+
dragCounter: 0,
|
|
9514
9568
|
rootErrors: calcRootErrors(
|
|
9515
9569
|
t(texts17.invalidFileAmount),
|
|
9516
9570
|
initialFileUploaderFiles,
|
|
@@ -9559,16 +9613,13 @@ var useFileUploader = (props) => {
|
|
|
9559
9613
|
);
|
|
9560
9614
|
const onRootBlur = (0, import_react61.useCallback)(() => dispatch({ type: "blur" }), [dispatch]);
|
|
9561
9615
|
const onRootDragEnter = (0, import_react61.useCallback)(
|
|
9562
|
-
|
|
9616
|
+
(evt) => {
|
|
9563
9617
|
preventDefaults(evt);
|
|
9564
9618
|
if (isEventWithFiles(evt)) {
|
|
9565
|
-
const files = await (0, import_file_selector.fromEvent)(evt);
|
|
9566
|
-
const fileCount = files.length;
|
|
9567
|
-
if (fileCount === 0) return;
|
|
9568
9619
|
dispatch({ type: "dragEnter" });
|
|
9569
9620
|
}
|
|
9570
9621
|
},
|
|
9571
|
-
[dispatch
|
|
9622
|
+
[dispatch]
|
|
9572
9623
|
);
|
|
9573
9624
|
const onRootDragOver = (0, import_react61.useCallback)((evt) => {
|
|
9574
9625
|
preventDefaults(evt);
|
|
@@ -9583,7 +9634,6 @@ var useFileUploader = (props) => {
|
|
|
9583
9634
|
const onRootDragLeave = (0, import_react61.useCallback)(
|
|
9584
9635
|
(evt) => {
|
|
9585
9636
|
preventDefaults(evt);
|
|
9586
|
-
if (evt.currentTarget.contains(evt.relatedTarget)) return;
|
|
9587
9637
|
dispatch({ type: "dragLeave" });
|
|
9588
9638
|
},
|
|
9589
9639
|
[dispatch]
|
|
@@ -10274,7 +10324,7 @@ var InlineEditContextProvider = (props) => {
|
|
|
10274
10324
|
};
|
|
10275
10325
|
useOnKeyDown(["Enter"], () => onExitHandler());
|
|
10276
10326
|
useOnKeyDown(["Escape"], () => onExitHandler());
|
|
10277
|
-
useOnClickOutside(inputRef
|
|
10327
|
+
useOnClickOutside(inputRef, () => onExitHandler());
|
|
10278
10328
|
return /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(
|
|
10279
10329
|
InlineEditContext,
|
|
10280
10330
|
{
|
|
@@ -11069,6 +11119,189 @@ var import_jsx_runtime304 = require("react/jsx-runtime");
|
|
|
11069
11119
|
var ModalActions = (props) => /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(Box, { display: "flex", flexWrap: "wrap", gap: "x1", ...props });
|
|
11070
11120
|
ModalActions.displayName = "ModalActions";
|
|
11071
11121
|
|
|
11122
|
+
// src/components/NewsPopover/NewsPopover.module.css
|
|
11123
|
+
var NewsPopover_default = {
|
|
11124
|
+
"close-button": "NewsPopover_close-button",
|
|
11125
|
+
"img-wrapper": "NewsPopover_img-wrapper"
|
|
11126
|
+
};
|
|
11127
|
+
|
|
11128
|
+
// src/components/NewsPopover/NewsPopover.tsx
|
|
11129
|
+
var import_jsx_runtime305 = require("react/jsx-runtime");
|
|
11130
|
+
var NewsPopover = ({
|
|
11131
|
+
id,
|
|
11132
|
+
className,
|
|
11133
|
+
style,
|
|
11134
|
+
htmlProps,
|
|
11135
|
+
header,
|
|
11136
|
+
news,
|
|
11137
|
+
defaultActiveSlide = 0,
|
|
11138
|
+
activeSlide: activeSlideProp,
|
|
11139
|
+
setActiveSlide: setActiveSlideProp,
|
|
11140
|
+
isOpen: isOpenProp,
|
|
11141
|
+
isInitiallyOpen = true,
|
|
11142
|
+
setIsOpen: setIsOpenProp,
|
|
11143
|
+
smallScreenBreakpoint = "xs",
|
|
11144
|
+
closeOnClickOutside = true,
|
|
11145
|
+
ref,
|
|
11146
|
+
...rest
|
|
11147
|
+
}) => {
|
|
11148
|
+
if (news.length === 0) {
|
|
11149
|
+
throw new Error('NewsPopover must have at least one item in "news" prop');
|
|
11150
|
+
}
|
|
11151
|
+
if (header.length > 35) {
|
|
11152
|
+
console.warn(
|
|
11153
|
+
"[NewsPopover] header exceeds recommended length (about 35 characters). This may cause wrapping or layout issues depending on theme."
|
|
11154
|
+
);
|
|
11155
|
+
}
|
|
11156
|
+
news.forEach((n, i) => {
|
|
11157
|
+
if (n.heading.length > 35) {
|
|
11158
|
+
console.warn(
|
|
11159
|
+
`[NewsPopover] news[${i}].heading exceeds recommended length (about 35 characters). This may cause wrapping or layout issues depending on theme.`
|
|
11160
|
+
);
|
|
11161
|
+
}
|
|
11162
|
+
if (n.text.length > 135) {
|
|
11163
|
+
console.warn(
|
|
11164
|
+
`[NewsPopover] news[${i}].text exceeds recommended length (about 135 characters). This may cause wrapping or layout issues depending on theme.`
|
|
11165
|
+
);
|
|
11166
|
+
}
|
|
11167
|
+
});
|
|
11168
|
+
const { t } = useTranslation();
|
|
11169
|
+
const [activeSlide, setActiveSlide] = useControllableState({
|
|
11170
|
+
value: activeSlideProp,
|
|
11171
|
+
defaultValue: defaultActiveSlide,
|
|
11172
|
+
onChange: setActiveSlideProp
|
|
11173
|
+
});
|
|
11174
|
+
const [isOpen, setIsOpen] = useControllableState({
|
|
11175
|
+
onChange: setIsOpenProp,
|
|
11176
|
+
value: isOpenProp,
|
|
11177
|
+
defaultValue: isInitiallyOpen
|
|
11178
|
+
});
|
|
11179
|
+
function handleSlideChange(slide) {
|
|
11180
|
+
setActiveSlide(slide);
|
|
11181
|
+
}
|
|
11182
|
+
const popoverRef = useFocusTrap(true);
|
|
11183
|
+
const combinedRef = useCombinedRef(ref, popoverRef);
|
|
11184
|
+
useOnClickOutside(popoverRef, () => {
|
|
11185
|
+
if (closeOnClickOutside && isOpen) {
|
|
11186
|
+
setIsOpen(false);
|
|
11187
|
+
}
|
|
11188
|
+
});
|
|
11189
|
+
useOnKeyDown("Escape", () => setIsOpen(false));
|
|
11190
|
+
const isList = news.length > 1;
|
|
11191
|
+
const slideContent = (el, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(import_jsx_runtime305.Fragment, { children: [
|
|
11192
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
|
|
11193
|
+
Paper,
|
|
11194
|
+
{
|
|
11195
|
+
background: "brand-secondary-subtle",
|
|
11196
|
+
width: "100%",
|
|
11197
|
+
borderRadius: "0",
|
|
11198
|
+
display: "grid",
|
|
11199
|
+
placeItems: "center",
|
|
11200
|
+
paddingBlock: "x0.5",
|
|
11201
|
+
children: [
|
|
11202
|
+
i !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(VisuallyHidden, { children: t(commonTexts.pageOf(i + 1, news.length)) }),
|
|
11203
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(Box, { height: "113px", maxWidth: "380px", className: NewsPopover_default["img-wrapper"], children: el.image })
|
|
11204
|
+
]
|
|
11205
|
+
}
|
|
11206
|
+
),
|
|
11207
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(VStack, { gap: "x0.75", alignItems: "center", margin: "x0.75 x0.75 x1 x0.75", children: [
|
|
11208
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(Heading, { level: 3, children: el.heading }),
|
|
11209
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(Paragraph, { textAlign: "center", children: el.text })
|
|
11210
|
+
] })
|
|
11211
|
+
] });
|
|
11212
|
+
const content = isList ? /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(Box, { as: StylelessList, width: "100%", children: news.map((el, i) => {
|
|
11213
|
+
const active = activeSlide === i;
|
|
11214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("li", { "aria-current": active, hidden: !active, children: slideContent(el, i) }, i);
|
|
11215
|
+
}) }) : /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(Box, { width: "100%", children: slideContent(news[0]) });
|
|
11216
|
+
function handleNext() {
|
|
11217
|
+
if (activeSlide === news.length - 1) handleSlideChange(0);
|
|
11218
|
+
else handleSlideChange(activeSlide + 1);
|
|
11219
|
+
}
|
|
11220
|
+
function handlePrevious() {
|
|
11221
|
+
if (activeSlide === 0) handleSlideChange(news.length - 1);
|
|
11222
|
+
else handleSlideChange(activeSlide - 1);
|
|
11223
|
+
}
|
|
11224
|
+
const headerId = "dds-news-popover-header";
|
|
11225
|
+
return isOpen ? /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
|
|
11226
|
+
Paper,
|
|
11227
|
+
{
|
|
11228
|
+
...getBaseHTMLProps(
|
|
11229
|
+
id,
|
|
11230
|
+
cn(className, focusable),
|
|
11231
|
+
style,
|
|
11232
|
+
htmlProps,
|
|
11233
|
+
rest
|
|
11234
|
+
),
|
|
11235
|
+
ref: combinedRef,
|
|
11236
|
+
position: "relative",
|
|
11237
|
+
border: "border-subtle",
|
|
11238
|
+
role: "dialog",
|
|
11239
|
+
"aria-labelledby": headerId,
|
|
11240
|
+
height: isList ? "368px" : "327px",
|
|
11241
|
+
width: styleUpToBreakpoint("100%", smallScreenBreakpoint, "405px"),
|
|
11242
|
+
children: [
|
|
11243
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(HStack, { margin: "x0.75 x3 x0.75 x0.75", children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(Heading, { id: headerId, level: 2, typographyType: "headingSmall", children: header }) }),
|
|
11244
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
|
|
11245
|
+
VStack,
|
|
11246
|
+
{
|
|
11247
|
+
alignItems: "center",
|
|
11248
|
+
height: isList ? "299px" : void 0,
|
|
11249
|
+
"aria-live": "polite",
|
|
11250
|
+
children: [
|
|
11251
|
+
content,
|
|
11252
|
+
isList && /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(HStack, { alignItems: "center", gap: "x1", marginBlock: "auto 0", children: [
|
|
11253
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
11254
|
+
Button,
|
|
11255
|
+
{
|
|
11256
|
+
"aria-label": t(commonTexts.previousPage),
|
|
11257
|
+
size: "small",
|
|
11258
|
+
purpose: "tertiary",
|
|
11259
|
+
icon: ChevronLeftIcon,
|
|
11260
|
+
onClick: () => handlePrevious()
|
|
11261
|
+
}
|
|
11262
|
+
),
|
|
11263
|
+
news.map((slide, i) => {
|
|
11264
|
+
const active = activeSlide === i;
|
|
11265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
11266
|
+
Icon,
|
|
11267
|
+
{
|
|
11268
|
+
iconSize: "small",
|
|
11269
|
+
icon: CircleFilledIcon,
|
|
11270
|
+
color: active ? "brand-tertiary-default" : "brand-tertiary-subtle"
|
|
11271
|
+
}
|
|
11272
|
+
);
|
|
11273
|
+
}),
|
|
11274
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
11275
|
+
Button,
|
|
11276
|
+
{
|
|
11277
|
+
"aria-label": t(commonTexts.nextPage),
|
|
11278
|
+
size: "small",
|
|
11279
|
+
purpose: "tertiary",
|
|
11280
|
+
icon: ChevronRightIcon,
|
|
11281
|
+
onClick: () => handleNext()
|
|
11282
|
+
}
|
|
11283
|
+
)
|
|
11284
|
+
] }),
|
|
11285
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
11286
|
+
Button,
|
|
11287
|
+
{
|
|
11288
|
+
icon: CloseIcon,
|
|
11289
|
+
purpose: "tertiary",
|
|
11290
|
+
size: "small",
|
|
11291
|
+
"aria-label": t(commonTexts.close),
|
|
11292
|
+
onClick: () => setIsOpen(false),
|
|
11293
|
+
className: NewsPopover_default["close-button"]
|
|
11294
|
+
}
|
|
11295
|
+
)
|
|
11296
|
+
]
|
|
11297
|
+
}
|
|
11298
|
+
)
|
|
11299
|
+
]
|
|
11300
|
+
}
|
|
11301
|
+
) : null;
|
|
11302
|
+
};
|
|
11303
|
+
NewsPopover.displayName = "NewsPopover";
|
|
11304
|
+
|
|
11072
11305
|
// src/components/Pagination/Pagination.tsx
|
|
11073
11306
|
var import_react76 = require("react");
|
|
11074
11307
|
|
|
@@ -11372,7 +11605,7 @@ var getCustomStyles = (size2, hasError, isReadOnly) => ({
|
|
|
11372
11605
|
// src/components/Select/SelectComponents.tsx
|
|
11373
11606
|
var import_react73 = __toESM(require("react"));
|
|
11374
11607
|
var import_react_select = require("react-select");
|
|
11375
|
-
var
|
|
11608
|
+
var import_jsx_runtime306 = require("react/jsx-runtime");
|
|
11376
11609
|
var {
|
|
11377
11610
|
Option,
|
|
11378
11611
|
NoOptionsMessage,
|
|
@@ -11385,25 +11618,25 @@ var {
|
|
|
11385
11618
|
} = import_react_select.components;
|
|
11386
11619
|
var DDSOption = ({
|
|
11387
11620
|
...props
|
|
11388
|
-
}) => /* @__PURE__ */ (0,
|
|
11389
|
-
props.isSelected && /* @__PURE__ */ (0,
|
|
11621
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(Option, { ...props, children: [
|
|
11622
|
+
props.isSelected && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(Icon, { icon: CheckIcon, iconSize: "small" }),
|
|
11390
11623
|
props.children
|
|
11391
11624
|
] });
|
|
11392
|
-
var CustomOption = (props) => /* @__PURE__ */ (0,
|
|
11625
|
+
var CustomOption = (props) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(Option, { ...props, children: import_react73.default.createElement(props.customElement, props) });
|
|
11393
11626
|
var CustomSingleValue = ({
|
|
11394
11627
|
id,
|
|
11395
11628
|
Element,
|
|
11396
11629
|
...props
|
|
11397
|
-
}) => /* @__PURE__ */ (0,
|
|
11398
|
-
var DDSNoOptionsMessage = (props) => /* @__PURE__ */ (0,
|
|
11630
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(SingleValue, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { id, className: Select_default["inner-single-value"], children: Element ? /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(Element, { ...props }) : props.children }) });
|
|
11631
|
+
var DDSNoOptionsMessage = (props) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(NoOptionsMessage, { ...props, children: "Ingen treff" });
|
|
11399
11632
|
var DDSClearIndicator = ({
|
|
11400
11633
|
...props
|
|
11401
|
-
}) => /* @__PURE__ */ (0,
|
|
11402
|
-
var DDSMultiValueRemove = (props) => /* @__PURE__ */ (0,
|
|
11634
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(ClearIndicator, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(Icon, { icon: CloseSmallIcon, iconSize: "component" }) });
|
|
11635
|
+
var DDSMultiValueRemove = (props) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(MultiValueRemove, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(Icon, { icon: CloseSmallIcon, iconSize: "component" }) });
|
|
11403
11636
|
var DDSDropdownIndicator = (props) => {
|
|
11404
11637
|
const { className, componentSize, ...rest } = props;
|
|
11405
11638
|
const iconState = rest.selectProps.menuIsOpen ? "up" : "down";
|
|
11406
|
-
return /* @__PURE__ */ (0,
|
|
11639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
11407
11640
|
DropdownIndicator,
|
|
11408
11641
|
{
|
|
11409
11642
|
...rest,
|
|
@@ -11412,7 +11645,7 @@ var DDSDropdownIndicator = (props) => {
|
|
|
11412
11645
|
Select_default["dropdown-indicator"],
|
|
11413
11646
|
Input_default[`input-with-el-right--${componentSize}`]
|
|
11414
11647
|
),
|
|
11415
|
-
children: /* @__PURE__ */ (0,
|
|
11648
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
11416
11649
|
Icon,
|
|
11417
11650
|
{
|
|
11418
11651
|
icon: AnimatedChevronUpDownIcon,
|
|
@@ -11427,7 +11660,7 @@ var DDSInput = ({
|
|
|
11427
11660
|
ariaInvalid,
|
|
11428
11661
|
ariaDescribedby,
|
|
11429
11662
|
...props
|
|
11430
|
-
}) => /* @__PURE__ */ (0,
|
|
11663
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
11431
11664
|
Input2,
|
|
11432
11665
|
{
|
|
11433
11666
|
...props,
|
|
@@ -11447,7 +11680,7 @@ function DDSControl(props) {
|
|
|
11447
11680
|
...rest
|
|
11448
11681
|
} = props;
|
|
11449
11682
|
const hasIcon = !!icon;
|
|
11450
|
-
return /* @__PURE__ */ (0,
|
|
11683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
|
|
11451
11684
|
Control,
|
|
11452
11685
|
{
|
|
11453
11686
|
...rest,
|
|
@@ -11464,7 +11697,7 @@ function DDSControl(props) {
|
|
|
11464
11697
|
hasIcon && Input_default[`input-with-icon--${componentSize}`]
|
|
11465
11698
|
),
|
|
11466
11699
|
children: [
|
|
11467
|
-
hasIcon && /* @__PURE__ */ (0,
|
|
11700
|
+
hasIcon && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
11468
11701
|
Icon,
|
|
11469
11702
|
{
|
|
11470
11703
|
icon,
|
|
@@ -11482,7 +11715,7 @@ function DDSControl(props) {
|
|
|
11482
11715
|
}
|
|
11483
11716
|
|
|
11484
11717
|
// src/components/Select/Select.tsx
|
|
11485
|
-
var
|
|
11718
|
+
var import_jsx_runtime307 = require("react/jsx-runtime");
|
|
11486
11719
|
function Select({
|
|
11487
11720
|
id,
|
|
11488
11721
|
label,
|
|
@@ -11533,7 +11766,7 @@ function Select({
|
|
|
11533
11766
|
componentSize === "xsmall" && "var(--dds-input-default-width-xsmall)"
|
|
11534
11767
|
);
|
|
11535
11768
|
const customInput = (0, import_react74.useCallback)(
|
|
11536
|
-
(props) => /* @__PURE__ */ (0,
|
|
11769
|
+
(props) => /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
11537
11770
|
DDSInput,
|
|
11538
11771
|
{
|
|
11539
11772
|
...props,
|
|
@@ -11551,7 +11784,7 @@ function Select({
|
|
|
11551
11784
|
[]
|
|
11552
11785
|
);
|
|
11553
11786
|
const customSingleValue = (0, import_react74.useCallback)(
|
|
11554
|
-
(props) => /* @__PURE__ */ (0,
|
|
11787
|
+
(props) => /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
11555
11788
|
CustomSingleValue,
|
|
11556
11789
|
{
|
|
11557
11790
|
...props,
|
|
@@ -11562,15 +11795,15 @@ function Select({
|
|
|
11562
11795
|
[]
|
|
11563
11796
|
);
|
|
11564
11797
|
const customClearIndicator = (0, import_react74.useCallback)(
|
|
11565
|
-
(props) => /* @__PURE__ */ (0,
|
|
11798
|
+
(props) => /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(DDSClearIndicator, { ...props }),
|
|
11566
11799
|
[]
|
|
11567
11800
|
);
|
|
11568
11801
|
const customDropdownIndicator = (0, import_react74.useCallback)(
|
|
11569
|
-
(props) => /* @__PURE__ */ (0,
|
|
11802
|
+
(props) => /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(DDSDropdownIndicator, { ...props, componentSize }),
|
|
11570
11803
|
[]
|
|
11571
11804
|
);
|
|
11572
11805
|
const customControl = (0, import_react74.useCallback)(
|
|
11573
|
-
(props) => /* @__PURE__ */ (0,
|
|
11806
|
+
(props) => /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
11574
11807
|
DDSControl,
|
|
11575
11808
|
{
|
|
11576
11809
|
...props,
|
|
@@ -11585,9 +11818,9 @@ function Select({
|
|
|
11585
11818
|
const customOptionComponent = (0, import_react74.useCallback)(
|
|
11586
11819
|
(props) => {
|
|
11587
11820
|
if (customOptionElement) {
|
|
11588
|
-
return /* @__PURE__ */ (0,
|
|
11821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(CustomOption, { ...props, customElement: customOptionElement });
|
|
11589
11822
|
} else {
|
|
11590
|
-
return /* @__PURE__ */ (0,
|
|
11823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(DDSOption, { ...props });
|
|
11591
11824
|
}
|
|
11592
11825
|
},
|
|
11593
11826
|
[customOptionElement, componentSize]
|
|
@@ -11628,7 +11861,7 @@ function Select({
|
|
|
11628
11861
|
openMenuOnClick: readOnly ? false : openMenuOnClick ? openMenuOnClick : void 0,
|
|
11629
11862
|
...rest
|
|
11630
11863
|
};
|
|
11631
|
-
return /* @__PURE__ */ (0,
|
|
11864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)(
|
|
11632
11865
|
Box,
|
|
11633
11866
|
{
|
|
11634
11867
|
width: inputWidth,
|
|
@@ -11649,7 +11882,7 @@ function Select({
|
|
|
11649
11882
|
readOnly,
|
|
11650
11883
|
afterLabelContent
|
|
11651
11884
|
}),
|
|
11652
|
-
/* @__PURE__ */ (0,
|
|
11885
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)(import_react_select2.default, { ...reactSelectProps, ref }),
|
|
11653
11886
|
renderInputMessage({ tip, tipId, errorMessage, errorMessageId })
|
|
11654
11887
|
]
|
|
11655
11888
|
}
|
|
@@ -11678,7 +11911,7 @@ var NativeSelect_default = {
|
|
|
11678
11911
|
};
|
|
11679
11912
|
|
|
11680
11913
|
// src/components/Select/NativeSelect/NativeSelect.tsx
|
|
11681
|
-
var
|
|
11914
|
+
var import_jsx_runtime308 = require("react/jsx-runtime");
|
|
11682
11915
|
var NativeSelect = ({
|
|
11683
11916
|
ref,
|
|
11684
11917
|
id,
|
|
@@ -11747,7 +11980,7 @@ var NativeSelect = ({
|
|
|
11747
11980
|
const iconSize = componentSize === "medium" ? "medium" : "small";
|
|
11748
11981
|
const showClearButton = clearable && hasValue && !readOnly && !rest.disabled;
|
|
11749
11982
|
const hasIcon = !!icon;
|
|
11750
|
-
return /* @__PURE__ */ (0,
|
|
11983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)("div", { className, style, children: [
|
|
11751
11984
|
renderLabel({
|
|
11752
11985
|
label,
|
|
11753
11986
|
htmlFor: uniqueId,
|
|
@@ -11755,7 +11988,7 @@ var NativeSelect = ({
|
|
|
11755
11988
|
readOnly,
|
|
11756
11989
|
afterLabelContent
|
|
11757
11990
|
}),
|
|
11758
|
-
/* @__PURE__ */ (0,
|
|
11991
|
+
/* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(
|
|
11759
11992
|
Box,
|
|
11760
11993
|
{
|
|
11761
11994
|
position: "relative",
|
|
@@ -11765,7 +11998,7 @@ var NativeSelect = ({
|
|
|
11765
11998
|
Input_default["input-group"]
|
|
11766
11999
|
),
|
|
11767
12000
|
children: [
|
|
11768
|
-
hasIcon && /* @__PURE__ */ (0,
|
|
12001
|
+
hasIcon && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
|
|
11769
12002
|
Icon,
|
|
11770
12003
|
{
|
|
11771
12004
|
icon,
|
|
@@ -11776,7 +12009,7 @@ var NativeSelect = ({
|
|
|
11776
12009
|
iconSize: "component"
|
|
11777
12010
|
}
|
|
11778
12011
|
),
|
|
11779
|
-
/* @__PURE__ */ (0,
|
|
12012
|
+
/* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
|
|
11780
12013
|
"select",
|
|
11781
12014
|
{
|
|
11782
12015
|
ref: useCombinedRef(ref, selectRef),
|
|
@@ -11810,7 +12043,7 @@ var NativeSelect = ({
|
|
|
11810
12043
|
children
|
|
11811
12044
|
}
|
|
11812
12045
|
),
|
|
11813
|
-
showClearButton && /* @__PURE__ */ (0,
|
|
12046
|
+
showClearButton && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
|
|
11814
12047
|
ClearButton,
|
|
11815
12048
|
{
|
|
11816
12049
|
"aria-label": t(commonTexts.clearSelect),
|
|
@@ -11819,7 +12052,7 @@ var NativeSelect = ({
|
|
|
11819
12052
|
className: NativeSelect_default[`clear-button--${componentSize}`]
|
|
11820
12053
|
}
|
|
11821
12054
|
),
|
|
11822
|
-
!multiple && /* @__PURE__ */ (0,
|
|
12055
|
+
!multiple && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
|
|
11823
12056
|
Icon,
|
|
11824
12057
|
{
|
|
11825
12058
|
icon: ChevronDownIcon,
|
|
@@ -11842,7 +12075,7 @@ var NativeSelect = ({
|
|
|
11842
12075
|
var createSelectOptions = (...args) => args.map((v) => ({ label: v, value: v }));
|
|
11843
12076
|
|
|
11844
12077
|
// src/components/Pagination/Pagination.tsx
|
|
11845
|
-
var
|
|
12078
|
+
var import_jsx_runtime309 = require("react/jsx-runtime");
|
|
11846
12079
|
var Pagination = ({
|
|
11847
12080
|
itemsAmount,
|
|
11848
12081
|
defaultItemsPerPage = 10,
|
|
@@ -11897,7 +12130,7 @@ var Pagination = ({
|
|
|
11897
12130
|
};
|
|
11898
12131
|
const listItems = items.length > 0 ? items.map((item, i) => {
|
|
11899
12132
|
const isActive = item === activePage;
|
|
11900
|
-
return /* @__PURE__ */ (0,
|
|
12133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("li", { className: Pagination_default.list__item, children: item !== "truncator" && typeof item === "number" ? /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
11901
12134
|
Button,
|
|
11902
12135
|
{
|
|
11903
12136
|
purpose: isActive ? "primary" : "secondary",
|
|
@@ -11905,10 +12138,10 @@ var Pagination = ({
|
|
|
11905
12138
|
onClick: (event) => {
|
|
11906
12139
|
onPageChange(event, item);
|
|
11907
12140
|
},
|
|
11908
|
-
"aria-label": isActive ? t(
|
|
12141
|
+
"aria-label": isActive ? t(commonTexts.currentPage(item)) : t(commonTexts.page(item)),
|
|
11909
12142
|
children: item
|
|
11910
12143
|
}
|
|
11911
|
-
) : /* @__PURE__ */ (0,
|
|
12144
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
11912
12145
|
Icon,
|
|
11913
12146
|
{
|
|
11914
12147
|
icon: MoreHorizontalIcon,
|
|
@@ -11916,7 +12149,7 @@ var Pagination = ({
|
|
|
11916
12149
|
}
|
|
11917
12150
|
) }, `pagination-item-${i}`);
|
|
11918
12151
|
}) : void 0;
|
|
11919
|
-
const previousPageButton = /* @__PURE__ */ (0,
|
|
12152
|
+
const previousPageButton = /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
11920
12153
|
Button,
|
|
11921
12154
|
{
|
|
11922
12155
|
purpose: "secondary",
|
|
@@ -11925,10 +12158,10 @@ var Pagination = ({
|
|
|
11925
12158
|
onClick: (event) => {
|
|
11926
12159
|
onPageChange(event, activePage - 1);
|
|
11927
12160
|
},
|
|
11928
|
-
"aria-label": t(
|
|
12161
|
+
"aria-label": t(commonTexts.previousPage)
|
|
11929
12162
|
}
|
|
11930
12163
|
);
|
|
11931
|
-
const nextPageButton = /* @__PURE__ */ (0,
|
|
12164
|
+
const nextPageButton = /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
11932
12165
|
Button,
|
|
11933
12166
|
{
|
|
11934
12167
|
purpose: "secondary",
|
|
@@ -11937,13 +12170,13 @@ var Pagination = ({
|
|
|
11937
12170
|
onClick: (event) => {
|
|
11938
12171
|
onPageChange(event, activePage + 1);
|
|
11939
12172
|
},
|
|
11940
|
-
"aria-label": t(
|
|
12173
|
+
"aria-label": t(commonTexts.nextPage)
|
|
11941
12174
|
}
|
|
11942
12175
|
);
|
|
11943
12176
|
const isOnFirstPage = activePage === 1;
|
|
11944
12177
|
const isOnLastPage = activePage === pagesLength;
|
|
11945
12178
|
const baseHTMLProps = getBaseHTMLProps(id, className, style, htmlProps, rest);
|
|
11946
|
-
const navigation = withPagination ? /* @__PURE__ */ (0,
|
|
12179
|
+
const navigation = withPagination ? /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(
|
|
11947
12180
|
Box,
|
|
11948
12181
|
{
|
|
11949
12182
|
as: "nav",
|
|
@@ -11955,14 +12188,14 @@ var Pagination = ({
|
|
|
11955
12188
|
...baseHTMLProps
|
|
11956
12189
|
},
|
|
11957
12190
|
children: [
|
|
11958
|
-
/* @__PURE__ */ (0,
|
|
12191
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(
|
|
11959
12192
|
ShowHide,
|
|
11960
12193
|
{
|
|
11961
12194
|
as: "ol",
|
|
11962
12195
|
hideBelow: smallScreenBreakpoint,
|
|
11963
12196
|
className: Pagination_default.list,
|
|
11964
12197
|
children: [
|
|
11965
|
-
/* @__PURE__ */ (0,
|
|
12198
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
11966
12199
|
"li",
|
|
11967
12200
|
{
|
|
11968
12201
|
className: cn(
|
|
@@ -11974,7 +12207,7 @@ var Pagination = ({
|
|
|
11974
12207
|
}
|
|
11975
12208
|
),
|
|
11976
12209
|
listItems,
|
|
11977
|
-
/* @__PURE__ */ (0,
|
|
12210
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
11978
12211
|
"li",
|
|
11979
12212
|
{
|
|
11980
12213
|
className: cn(
|
|
@@ -11988,14 +12221,14 @@ var Pagination = ({
|
|
|
11988
12221
|
]
|
|
11989
12222
|
}
|
|
11990
12223
|
),
|
|
11991
|
-
!!smallScreenBreakpoint && /* @__PURE__ */ (0,
|
|
12224
|
+
!!smallScreenBreakpoint && /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(
|
|
11992
12225
|
ShowHide,
|
|
11993
12226
|
{
|
|
11994
12227
|
as: "ol",
|
|
11995
12228
|
showBelow: smallScreenBreakpoint,
|
|
11996
12229
|
className: Pagination_default.list,
|
|
11997
12230
|
children: [
|
|
11998
|
-
/* @__PURE__ */ (0,
|
|
12231
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
11999
12232
|
"li",
|
|
12000
12233
|
{
|
|
12001
12234
|
className: cn(
|
|
@@ -12003,7 +12236,7 @@ var Pagination = ({
|
|
|
12003
12236
|
isOnFirstPage && Pagination_default["list__item--hidden"]
|
|
12004
12237
|
),
|
|
12005
12238
|
"aria-hidden": isOnFirstPage,
|
|
12006
|
-
children: /* @__PURE__ */ (0,
|
|
12239
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
12007
12240
|
Button,
|
|
12008
12241
|
{
|
|
12009
12242
|
purpose: "secondary",
|
|
@@ -12017,7 +12250,7 @@ var Pagination = ({
|
|
|
12017
12250
|
)
|
|
12018
12251
|
}
|
|
12019
12252
|
),
|
|
12020
|
-
/* @__PURE__ */ (0,
|
|
12253
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
12021
12254
|
"li",
|
|
12022
12255
|
{
|
|
12023
12256
|
className: cn(
|
|
@@ -12028,7 +12261,7 @@ var Pagination = ({
|
|
|
12028
12261
|
children: previousPageButton
|
|
12029
12262
|
}
|
|
12030
12263
|
),
|
|
12031
|
-
/* @__PURE__ */ (0,
|
|
12264
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)("li", { className: Pagination_default.list__item, children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
12032
12265
|
Button,
|
|
12033
12266
|
{
|
|
12034
12267
|
size: "small",
|
|
@@ -12038,7 +12271,7 @@ var Pagination = ({
|
|
|
12038
12271
|
children: activePage
|
|
12039
12272
|
}
|
|
12040
12273
|
) }),
|
|
12041
|
-
/* @__PURE__ */ (0,
|
|
12274
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
12042
12275
|
"li",
|
|
12043
12276
|
{
|
|
12044
12277
|
className: cn(
|
|
@@ -12049,7 +12282,7 @@ var Pagination = ({
|
|
|
12049
12282
|
children: nextPageButton
|
|
12050
12283
|
}
|
|
12051
12284
|
),
|
|
12052
|
-
/* @__PURE__ */ (0,
|
|
12285
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
12053
12286
|
"li",
|
|
12054
12287
|
{
|
|
12055
12288
|
className: cn(
|
|
@@ -12057,7 +12290,7 @@ var Pagination = ({
|
|
|
12057
12290
|
isOnLastPage && Pagination_default["list__item--hidden"]
|
|
12058
12291
|
),
|
|
12059
12292
|
"aria-hidden": isOnLastPage,
|
|
12060
|
-
children: /* @__PURE__ */ (0,
|
|
12293
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
12061
12294
|
Button,
|
|
12062
12295
|
{
|
|
12063
12296
|
purpose: "secondary",
|
|
@@ -12079,7 +12312,7 @@ var Pagination = ({
|
|
|
12079
12312
|
) : null;
|
|
12080
12313
|
const activePageFirstItem = activePage === 1 ? 1 : activePage * itemsPerPage - itemsPerPage + 1;
|
|
12081
12314
|
const activePageLastItem = activePage === pagesLength ? itemsAmount : activePage * itemsPerPage;
|
|
12082
|
-
return !withCounter && !withSelect ? navigation : /* @__PURE__ */ (0,
|
|
12315
|
+
return !withCounter && !withSelect ? navigation : /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(
|
|
12083
12316
|
Box,
|
|
12084
12317
|
{
|
|
12085
12318
|
display: "flex",
|
|
@@ -12090,7 +12323,7 @@ var Pagination = ({
|
|
|
12090
12323
|
alignItems: styleUpToBreakpoint("center", smallScreenBreakpoint),
|
|
12091
12324
|
...baseHTMLProps,
|
|
12092
12325
|
children: [
|
|
12093
|
-
/* @__PURE__ */ (0,
|
|
12326
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(
|
|
12094
12327
|
Box,
|
|
12095
12328
|
{
|
|
12096
12329
|
display: "grid",
|
|
@@ -12098,7 +12331,7 @@ var Pagination = ({
|
|
|
12098
12331
|
alignItems: "center",
|
|
12099
12332
|
className: Pagination_default.indicators,
|
|
12100
12333
|
children: [
|
|
12101
|
-
withSelect && /* @__PURE__ */ (0,
|
|
12334
|
+
withSelect && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
12102
12335
|
Select,
|
|
12103
12336
|
{
|
|
12104
12337
|
options: tSelectOptions,
|
|
@@ -12114,7 +12347,7 @@ var Pagination = ({
|
|
|
12114
12347
|
"aria-label": t(texts22.itemsPerPage)
|
|
12115
12348
|
}
|
|
12116
12349
|
),
|
|
12117
|
-
withCounter && /* @__PURE__ */ (0,
|
|
12350
|
+
withCounter && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(Paragraph, { typographyType: "bodyShortMedium", children: t(
|
|
12118
12351
|
texts22.showsAmountOfTotalItems(
|
|
12119
12352
|
activePageFirstItem,
|
|
12120
12353
|
activePageLastItem,
|
|
@@ -12145,20 +12378,6 @@ var texts22 = createTexts({
|
|
|
12145
12378
|
en: "Items per page",
|
|
12146
12379
|
se: "Elementat juohki siidui"
|
|
12147
12380
|
},
|
|
12148
|
-
nextPage: {
|
|
12149
|
-
nb: "Neste side",
|
|
12150
|
-
no: "Neste side",
|
|
12151
|
-
nn: "Neste side",
|
|
12152
|
-
en: "Next page",
|
|
12153
|
-
se: "Boahte siidu"
|
|
12154
|
-
},
|
|
12155
|
-
previousPage: {
|
|
12156
|
-
nb: "Forrige side",
|
|
12157
|
-
no: "Forrige side",
|
|
12158
|
-
nn: "F\xF8rre side",
|
|
12159
|
-
en: "Previous page",
|
|
12160
|
-
se: "Ovddit siidu"
|
|
12161
|
-
},
|
|
12162
12381
|
firstPage: {
|
|
12163
12382
|
nb: "F\xF8rste side",
|
|
12164
12383
|
no: "F\xF8rste side",
|
|
@@ -12173,20 +12392,6 @@ var texts22 = createTexts({
|
|
|
12173
12392
|
en: "Last page",
|
|
12174
12393
|
se: "Ma\u014Bimu\u0161 siidu"
|
|
12175
12394
|
},
|
|
12176
|
-
currentPage: (page) => ({
|
|
12177
|
-
nb: `N\xE5v\xE6rende side (${page})`,
|
|
12178
|
-
no: `N\xE5v\xE6rende side (${page})`,
|
|
12179
|
-
nn: `Noverande side (${page})`,
|
|
12180
|
-
en: `Current page (${page})`,
|
|
12181
|
-
se: `D\xE1la siidu (${page})`
|
|
12182
|
-
}),
|
|
12183
|
-
page: (page) => ({
|
|
12184
|
-
nb: `Side ${page}`,
|
|
12185
|
-
no: `Side ${page}`,
|
|
12186
|
-
nn: `Side ${page}`,
|
|
12187
|
-
en: `Page ${page}`,
|
|
12188
|
-
se: `Siidu ${page}`
|
|
12189
|
-
}),
|
|
12190
12395
|
showsAmountOfTotalItems: (first, last, total) => ({
|
|
12191
12396
|
nb: `Viser ${first}-${last} av ${total}`,
|
|
12192
12397
|
no: `Viser ${first}-${last} av ${total}`,
|
|
@@ -12604,7 +12809,7 @@ var PhoneInput_default = {
|
|
|
12604
12809
|
};
|
|
12605
12810
|
|
|
12606
12811
|
// src/components/PhoneInput/PhoneInput.tsx
|
|
12607
|
-
var
|
|
12812
|
+
var import_jsx_runtime310 = require("react/jsx-runtime");
|
|
12608
12813
|
var prioritizedCountries = [
|
|
12609
12814
|
COUNTRIES.NO,
|
|
12610
12815
|
COUNTRIES.SE,
|
|
@@ -12742,7 +12947,7 @@ var PhoneInput = ({
|
|
|
12742
12947
|
const showRequiredStyling = !!(required || ariaRequired);
|
|
12743
12948
|
const bp = props.smallScreenBreakpoint;
|
|
12744
12949
|
const widthDefault = componentSize === "xsmall" && "var(--dds-input-default-width-xsmall)";
|
|
12745
|
-
return /* @__PURE__ */ (0,
|
|
12950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)("div", { className: cn(className, Input_default.container), style, children: [
|
|
12746
12951
|
renderLabel({
|
|
12747
12952
|
label,
|
|
12748
12953
|
htmlFor: phoneNumberId,
|
|
@@ -12750,7 +12955,7 @@ var PhoneInput = ({
|
|
|
12750
12955
|
readOnly,
|
|
12751
12956
|
afterLabelContent
|
|
12752
12957
|
}),
|
|
12753
|
-
/* @__PURE__ */ (0,
|
|
12958
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsxs)(
|
|
12754
12959
|
Box,
|
|
12755
12960
|
{
|
|
12756
12961
|
display: "flex",
|
|
@@ -12763,8 +12968,8 @@ var PhoneInput = ({
|
|
|
12763
12968
|
role: "group",
|
|
12764
12969
|
"aria-label": tGroupLabel,
|
|
12765
12970
|
children: [
|
|
12766
|
-
/* @__PURE__ */ (0,
|
|
12767
|
-
/* @__PURE__ */ (0,
|
|
12971
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsx)("label", { className: utilStyles_default["visually-hidden"], htmlFor: selectId, children: tSelectLabel }),
|
|
12972
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
12768
12973
|
NativeSelect,
|
|
12769
12974
|
{
|
|
12770
12975
|
width: styleUpToBreakpoint(
|
|
@@ -12785,11 +12990,11 @@ var PhoneInput = ({
|
|
|
12785
12990
|
hasTip ? tipId : void 0,
|
|
12786
12991
|
ariaDescribedby
|
|
12787
12992
|
]),
|
|
12788
|
-
children: countryOptions.map((item, index) => /* @__PURE__ */ (0,
|
|
12993
|
+
children: countryOptions.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime310.jsx)("option", { value: item.countryCode, children: item.label }, index))
|
|
12789
12994
|
}
|
|
12790
12995
|
),
|
|
12791
|
-
/* @__PURE__ */ (0,
|
|
12792
|
-
/* @__PURE__ */ (0,
|
|
12996
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsxs)(Box, { width: "100%", display: "flex", className: Input_default["input-group"], children: [
|
|
12997
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
12793
12998
|
"span",
|
|
12794
12999
|
{
|
|
12795
13000
|
className: cn(
|
|
@@ -12801,7 +13006,7 @@ var PhoneInput = ({
|
|
|
12801
13006
|
children: callingCode
|
|
12802
13007
|
}
|
|
12803
13008
|
),
|
|
12804
|
-
/* @__PURE__ */ (0,
|
|
13009
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
12805
13010
|
Box,
|
|
12806
13011
|
{
|
|
12807
13012
|
as: StatefulInput,
|
|
@@ -12874,7 +13079,7 @@ var PopoverContext = (0, import_react78.createContext)({});
|
|
|
12874
13079
|
var usePopoverContext = () => (0, import_react78.useContext)(PopoverContext);
|
|
12875
13080
|
|
|
12876
13081
|
// src/components/Popover/Popover.tsx
|
|
12877
|
-
var
|
|
13082
|
+
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
12878
13083
|
var Popover = ({
|
|
12879
13084
|
id,
|
|
12880
13085
|
header,
|
|
@@ -12955,7 +13160,7 @@ var Popover = ({
|
|
|
12955
13160
|
(0, import_react79.useEffect)(() => {
|
|
12956
13161
|
setFloatOptions == null ? void 0 : setFloatOptions({ placement, offset });
|
|
12957
13162
|
}, [placement, offset]);
|
|
12958
|
-
useOnClickOutside([popoverRef
|
|
13163
|
+
useOnClickOutside([popoverRef, anchorRef], () => {
|
|
12959
13164
|
if (isOpen && !hasContext) onClose == null ? void 0 : onClose();
|
|
12960
13165
|
});
|
|
12961
13166
|
useOnKeyDown("Escape", () => {
|
|
@@ -12963,7 +13168,7 @@ var Popover = ({
|
|
|
12963
13168
|
});
|
|
12964
13169
|
const hasTitle = !!header;
|
|
12965
13170
|
const openCn = hasTransitionedIn && isOpen ? "open" : "closed";
|
|
12966
|
-
const popover = /* @__PURE__ */ (0,
|
|
13171
|
+
const popover = /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)(
|
|
12967
13172
|
Paper,
|
|
12968
13173
|
{
|
|
12969
13174
|
...getBaseHTMLProps(
|
|
@@ -12994,15 +13199,15 @@ var Popover = ({
|
|
|
12994
13199
|
elevation: "large",
|
|
12995
13200
|
border: "border-subtle",
|
|
12996
13201
|
children: [
|
|
12997
|
-
header && /* @__PURE__ */ (0,
|
|
12998
|
-
/* @__PURE__ */ (0,
|
|
13202
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { className: Popover_default.header, children: typeof header === "string" ? /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(Heading, { level: 2, typographyType: "headingMedium", children: header }) : header }),
|
|
13203
|
+
/* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
|
|
12999
13204
|
"div",
|
|
13000
13205
|
{
|
|
13001
13206
|
className: !hasTitle && withCloseButton ? Popover_default["content--closable--no-header"] : "",
|
|
13002
13207
|
children
|
|
13003
13208
|
}
|
|
13004
13209
|
),
|
|
13005
|
-
withCloseButton && /* @__PURE__ */ (0,
|
|
13210
|
+
withCloseButton && /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
|
|
13006
13211
|
Button,
|
|
13007
13212
|
{
|
|
13008
13213
|
icon: CloseIcon,
|
|
@@ -13022,7 +13227,7 @@ Popover.displayName = "Popover";
|
|
|
13022
13227
|
|
|
13023
13228
|
// src/components/Popover/PopoverGroup.tsx
|
|
13024
13229
|
var import_react80 = require("react");
|
|
13025
|
-
var
|
|
13230
|
+
var import_jsx_runtime312 = require("react/jsx-runtime");
|
|
13026
13231
|
var PopoverGroup = ({
|
|
13027
13232
|
isOpen: propIsOpen,
|
|
13028
13233
|
setIsOpen: propSetIsOpen,
|
|
@@ -13068,8 +13273,8 @@ var PopoverGroup = ({
|
|
|
13068
13273
|
(_a2 = buttonRef.current) == null ? void 0 : _a2.focus();
|
|
13069
13274
|
}
|
|
13070
13275
|
});
|
|
13071
|
-
const elements = [popoverRef
|
|
13072
|
-
if (buttonRef
|
|
13276
|
+
const elements = [popoverRef];
|
|
13277
|
+
if (buttonRef) elements.push(buttonRef);
|
|
13073
13278
|
useOnClickOutside(elements, () => {
|
|
13074
13279
|
if (open) handleClose();
|
|
13075
13280
|
});
|
|
@@ -13083,7 +13288,7 @@ var PopoverGroup = ({
|
|
|
13083
13288
|
ref: combinedAnchorRef
|
|
13084
13289
|
}) : child);
|
|
13085
13290
|
});
|
|
13086
|
-
return /* @__PURE__ */ (0,
|
|
13291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
|
|
13087
13292
|
PopoverContext,
|
|
13088
13293
|
{
|
|
13089
13294
|
value: {
|
|
@@ -13134,7 +13339,7 @@ var ProgressTracker_default = {
|
|
|
13134
13339
|
|
|
13135
13340
|
// src/components/ProgressTracker/ProgressTrackerItem.tsx
|
|
13136
13341
|
var import_react82 = require("react");
|
|
13137
|
-
var
|
|
13342
|
+
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
13138
13343
|
var toItemState = (active, completed, disabled) => {
|
|
13139
13344
|
if (disabled) {
|
|
13140
13345
|
return "disabled";
|
|
@@ -13179,10 +13384,10 @@ var ProgressTrackerItem = (props) => {
|
|
|
13179
13384
|
};
|
|
13180
13385
|
const stepNumberContent = (0, import_react82.useMemo)(() => {
|
|
13181
13386
|
if (completed) {
|
|
13182
|
-
return /* @__PURE__ */ (0,
|
|
13387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(Icon, { icon: CheckIcon, iconSize: "small" });
|
|
13183
13388
|
}
|
|
13184
13389
|
if (icon !== void 0) {
|
|
13185
|
-
return /* @__PURE__ */ (0,
|
|
13390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(Icon, { icon, iconSize: "small" });
|
|
13186
13391
|
}
|
|
13187
13392
|
return stepNumber;
|
|
13188
13393
|
}, [completed, icon, index]);
|
|
@@ -13191,8 +13396,8 @@ var ProgressTrackerItem = (props) => {
|
|
|
13191
13396
|
if (active) return "text-action-resting";
|
|
13192
13397
|
}
|
|
13193
13398
|
const isInactiveLink = disabled || active;
|
|
13194
|
-
const stepContent = /* @__PURE__ */ (0,
|
|
13195
|
-
/* @__PURE__ */ (0,
|
|
13399
|
+
const stepContent = /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(import_jsx_runtime313.Fragment, { children: [
|
|
13400
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
13196
13401
|
Box,
|
|
13197
13402
|
{
|
|
13198
13403
|
display: "flex",
|
|
@@ -13207,7 +13412,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
13207
13412
|
children: stepNumberContent
|
|
13208
13413
|
}
|
|
13209
13414
|
),
|
|
13210
|
-
/* @__PURE__ */ (0,
|
|
13415
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
13211
13416
|
Typography,
|
|
13212
13417
|
{
|
|
13213
13418
|
as: "div",
|
|
@@ -13223,14 +13428,14 @@ var ProgressTrackerItem = (props) => {
|
|
|
13223
13428
|
)
|
|
13224
13429
|
] });
|
|
13225
13430
|
const ariaLabel = (htmlProps == null ? void 0 : htmlProps["aria-label"]) ? htmlProps == null ? void 0 : htmlProps["aria-label"] : `${children}, ${stepNumber}. ${completed ? t(texts24.completed) : t(texts24.uncompleted)}`;
|
|
13226
|
-
return /* @__PURE__ */ (0,
|
|
13431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
13227
13432
|
Box,
|
|
13228
13433
|
{
|
|
13229
13434
|
as: "li",
|
|
13230
13435
|
display: direction === "row" ? "flex" : void 0,
|
|
13231
13436
|
"aria-current": active ? "step" : void 0,
|
|
13232
13437
|
className: cn(ProgressTracker_default["list-item"], ProgressTracker_default[`list-item--${direction}`]),
|
|
13233
|
-
children: handleStepChange ? /* @__PURE__ */ (0,
|
|
13438
|
+
children: handleStepChange ? /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
13234
13439
|
Box,
|
|
13235
13440
|
{
|
|
13236
13441
|
as: StylelessButton,
|
|
@@ -13255,7 +13460,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
13255
13460
|
disabled,
|
|
13256
13461
|
children: stepContent
|
|
13257
13462
|
}
|
|
13258
|
-
) : /* @__PURE__ */ (0,
|
|
13463
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
13259
13464
|
"div",
|
|
13260
13465
|
{
|
|
13261
13466
|
...getBaseHTMLProps(
|
|
@@ -13291,7 +13496,7 @@ var texts24 = createTexts({
|
|
|
13291
13496
|
});
|
|
13292
13497
|
|
|
13293
13498
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
13294
|
-
var
|
|
13499
|
+
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
13295
13500
|
var ProgressTracker = (() => {
|
|
13296
13501
|
const Res = ({
|
|
13297
13502
|
id,
|
|
@@ -13322,7 +13527,7 @@ var ProgressTracker = (() => {
|
|
|
13322
13527
|
}, [children]);
|
|
13323
13528
|
const isRow = direction === "row";
|
|
13324
13529
|
const { "aria-label": ariaLabel } = htmlProps;
|
|
13325
|
-
return /* @__PURE__ */ (0,
|
|
13530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
13326
13531
|
ProgressTrackerContext,
|
|
13327
13532
|
{
|
|
13328
13533
|
value: {
|
|
@@ -13330,12 +13535,12 @@ var ProgressTracker = (() => {
|
|
|
13330
13535
|
handleStepChange: handleChange,
|
|
13331
13536
|
direction
|
|
13332
13537
|
},
|
|
13333
|
-
children: /* @__PURE__ */ (0,
|
|
13538
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
13334
13539
|
"nav",
|
|
13335
13540
|
{
|
|
13336
13541
|
"aria-label": ariaLabel != null ? ariaLabel : t(texts25.stepProgression),
|
|
13337
13542
|
...getBaseHTMLProps(id, className, style, htmlProps, rest),
|
|
13338
|
-
children: /* @__PURE__ */ (0,
|
|
13543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
13339
13544
|
Box,
|
|
13340
13545
|
{
|
|
13341
13546
|
as: StylelessOList,
|
|
@@ -13395,7 +13600,7 @@ var ProgressBar_default = {
|
|
|
13395
13600
|
};
|
|
13396
13601
|
|
|
13397
13602
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
13398
|
-
var
|
|
13603
|
+
var import_jsx_runtime315 = require("react/jsx-runtime");
|
|
13399
13604
|
var PROGRESS_BAR_SIZES = createSizes("small", "medium");
|
|
13400
13605
|
var ProgressBar = ({
|
|
13401
13606
|
label,
|
|
@@ -13421,9 +13626,9 @@ var ProgressBar = ({
|
|
|
13421
13626
|
const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
|
|
13422
13627
|
const fillPrecentage = hasValidValue && value / (max != null ? max : 1) * 100 + "%";
|
|
13423
13628
|
const isIndeterminate = !hasValidValue && !hasErrorMessage;
|
|
13424
|
-
return /* @__PURE__ */ (0,
|
|
13629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime315.jsxs)(Box, { width: "100%", className, style, children: [
|
|
13425
13630
|
renderLabel({ label, htmlFor: uniqueId }),
|
|
13426
|
-
/* @__PURE__ */ (0,
|
|
13631
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
13427
13632
|
"progress",
|
|
13428
13633
|
{
|
|
13429
13634
|
id: uniqueId,
|
|
@@ -13439,13 +13644,13 @@ var ProgressBar = ({
|
|
|
13439
13644
|
children: fillPrecentage
|
|
13440
13645
|
}
|
|
13441
13646
|
),
|
|
13442
|
-
/* @__PURE__ */ (0,
|
|
13647
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
13443
13648
|
Box,
|
|
13444
13649
|
{
|
|
13445
13650
|
width: getInputWidth(width),
|
|
13446
13651
|
height: size2 === "small" ? "x0.75" : "x1.5",
|
|
13447
13652
|
className: cn(ProgressBar_default.progress),
|
|
13448
|
-
children: /* @__PURE__ */ (0,
|
|
13653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
13449
13654
|
Box,
|
|
13450
13655
|
{
|
|
13451
13656
|
height: "100%",
|
|
@@ -13485,7 +13690,7 @@ var Search_default = {
|
|
|
13485
13690
|
|
|
13486
13691
|
// src/components/Search/SearchSuggestionItem.tsx
|
|
13487
13692
|
var import_react86 = require("react");
|
|
13488
|
-
var
|
|
13693
|
+
var import_jsx_runtime316 = require("react/jsx-runtime");
|
|
13489
13694
|
var SearchSuggestionItem = ({
|
|
13490
13695
|
focus,
|
|
13491
13696
|
ref,
|
|
@@ -13499,7 +13704,7 @@ var SearchSuggestionItem = ({
|
|
|
13499
13704
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
13500
13705
|
}
|
|
13501
13706
|
}, [focus]);
|
|
13502
|
-
return /* @__PURE__ */ (0,
|
|
13707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
13503
13708
|
DropdownItem,
|
|
13504
13709
|
{
|
|
13505
13710
|
as: StylelessButton,
|
|
@@ -13512,7 +13717,7 @@ var SearchSuggestionItem = ({
|
|
|
13512
13717
|
SearchSuggestionItem.displayName = "SearchSuggestionItem";
|
|
13513
13718
|
|
|
13514
13719
|
// src/components/Search/SearchSuggestions.tsx
|
|
13515
|
-
var
|
|
13720
|
+
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
13516
13721
|
var SearchSuggestions = ({
|
|
13517
13722
|
id,
|
|
13518
13723
|
searchId,
|
|
@@ -13532,7 +13737,7 @@ var SearchSuggestions = ({
|
|
|
13532
13737
|
const { t } = useTranslation();
|
|
13533
13738
|
const [focus] = useRoveFocus(suggestions == null ? void 0 : suggestions.length, showSuggestions);
|
|
13534
13739
|
const suggestionsToRender = maxSuggestions ? suggestions == null ? void 0 : suggestions.slice(maxSuggestions) : suggestions;
|
|
13535
|
-
return /* @__PURE__ */ (0,
|
|
13740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)(
|
|
13536
13741
|
Paper,
|
|
13537
13742
|
{
|
|
13538
13743
|
...getBaseHTMLProps(
|
|
@@ -13557,9 +13762,9 @@ var SearchSuggestions = ({
|
|
|
13557
13762
|
overflowY: "scroll",
|
|
13558
13763
|
marginBlock: "x0.25 0",
|
|
13559
13764
|
children: [
|
|
13560
|
-
/* @__PURE__ */ (0,
|
|
13561
|
-
/* @__PURE__ */ (0,
|
|
13562
|
-
return /* @__PURE__ */ (0,
|
|
13765
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsx)(DropdownHeader, { id: suggestionsHeaderId, children: t(texts26.searchSuggestions) }),
|
|
13766
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsx)(StylelessList, { role: "listbox", "aria-labelledby": suggestionsHeaderId, children: suggestionsToRender.map((suggestion, index) => {
|
|
13767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime317.jsx)("li", { role: "option", children: /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
13563
13768
|
SearchSuggestionItem,
|
|
13564
13769
|
{
|
|
13565
13770
|
index,
|
|
@@ -13595,7 +13800,7 @@ var texts26 = createTexts({
|
|
|
13595
13800
|
});
|
|
13596
13801
|
|
|
13597
13802
|
// src/components/Search/Search.tsx
|
|
13598
|
-
var
|
|
13803
|
+
var import_jsx_runtime318 = require("react/jsx-runtime");
|
|
13599
13804
|
var Search = ({
|
|
13600
13805
|
componentSize = "medium",
|
|
13601
13806
|
buttonProps,
|
|
@@ -13643,7 +13848,7 @@ var Search = ({
|
|
|
13643
13848
|
} = buttonProps != null ? buttonProps : {};
|
|
13644
13849
|
const hasSuggestions = !!context.suggestions;
|
|
13645
13850
|
const showSearchButton = !!buttonProps && !!onClick;
|
|
13646
|
-
const inputGroup = /* @__PURE__ */ (0,
|
|
13851
|
+
const inputGroup = /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)(
|
|
13647
13852
|
HStack,
|
|
13648
13853
|
{
|
|
13649
13854
|
position: "relative",
|
|
@@ -13654,7 +13859,7 @@ var Search = ({
|
|
|
13654
13859
|
Input_default["input-group"]
|
|
13655
13860
|
),
|
|
13656
13861
|
children: [
|
|
13657
|
-
showIcon && /* @__PURE__ */ (0,
|
|
13862
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
13658
13863
|
Icon,
|
|
13659
13864
|
{
|
|
13660
13865
|
icon: SearchIcon,
|
|
@@ -13665,7 +13870,7 @@ var Search = ({
|
|
|
13665
13870
|
)
|
|
13666
13871
|
}
|
|
13667
13872
|
),
|
|
13668
|
-
/* @__PURE__ */ (0,
|
|
13873
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
13669
13874
|
Box,
|
|
13670
13875
|
{
|
|
13671
13876
|
as: Input,
|
|
@@ -13695,8 +13900,8 @@ var Search = ({
|
|
|
13695
13900
|
)
|
|
13696
13901
|
}
|
|
13697
13902
|
),
|
|
13698
|
-
hasSuggestions && /* @__PURE__ */ (0,
|
|
13699
|
-
/* @__PURE__ */ (0,
|
|
13903
|
+
hasSuggestions && /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)(import_jsx_runtime318.Fragment, { children: [
|
|
13904
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
13700
13905
|
SearchSuggestions,
|
|
13701
13906
|
{
|
|
13702
13907
|
id: suggestionsId,
|
|
@@ -13707,9 +13912,9 @@ var Search = ({
|
|
|
13707
13912
|
showSuggestions: context.showSuggestions
|
|
13708
13913
|
}
|
|
13709
13914
|
),
|
|
13710
|
-
/* @__PURE__ */ (0,
|
|
13915
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(VisuallyHidden, { id: suggestionsDescriptionId, children: t(texts27.useArrowKeys) })
|
|
13711
13916
|
] }),
|
|
13712
|
-
hasValue && /* @__PURE__ */ (0,
|
|
13917
|
+
hasValue && /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
13713
13918
|
ClearButton,
|
|
13714
13919
|
{
|
|
13715
13920
|
size: "component",
|
|
@@ -13724,10 +13929,10 @@ var Search = ({
|
|
|
13724
13929
|
]
|
|
13725
13930
|
}
|
|
13726
13931
|
);
|
|
13727
|
-
return /* @__PURE__ */ (0,
|
|
13932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { children: [
|
|
13728
13933
|
renderLabel({ htmlFor: uniqueId, label }),
|
|
13729
|
-
/* @__PURE__ */ (0,
|
|
13730
|
-
showSearchButton ? /* @__PURE__ */ (0,
|
|
13934
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { children: [
|
|
13935
|
+
showSearchButton ? /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)(
|
|
13731
13936
|
Grid,
|
|
13732
13937
|
{
|
|
13733
13938
|
className,
|
|
@@ -13739,7 +13944,7 @@ var Search = ({
|
|
|
13739
13944
|
style,
|
|
13740
13945
|
children: [
|
|
13741
13946
|
inputGroup,
|
|
13742
|
-
/* @__PURE__ */ (0,
|
|
13947
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
13743
13948
|
Button,
|
|
13744
13949
|
{
|
|
13745
13950
|
size: componentSize,
|
|
@@ -13782,7 +13987,7 @@ var texts27 = createTexts({
|
|
|
13782
13987
|
|
|
13783
13988
|
// src/components/Search/SearchAutocompleteWrapper.tsx
|
|
13784
13989
|
var import_react88 = require("react");
|
|
13785
|
-
var
|
|
13990
|
+
var import_jsx_runtime319 = require("react/jsx-runtime");
|
|
13786
13991
|
var SearchAutocompleteWrapper = (props) => {
|
|
13787
13992
|
const {
|
|
13788
13993
|
value,
|
|
@@ -13845,7 +14050,7 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
13845
14050
|
};
|
|
13846
14051
|
const inputRef = (0, import_react88.useRef)(null);
|
|
13847
14052
|
const suggestionsRef = (0, import_react88.useRef)(null);
|
|
13848
|
-
useOnClickOutside([inputRef
|
|
14053
|
+
useOnClickOutside([inputRef, suggestionsRef], () => {
|
|
13849
14054
|
closeSuggestions();
|
|
13850
14055
|
});
|
|
13851
14056
|
useOnKeyDown("Tab", () => closeSuggestions());
|
|
@@ -13858,7 +14063,7 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
13858
14063
|
inputValue,
|
|
13859
14064
|
onSugggestionClick: handleSuggestionClick
|
|
13860
14065
|
};
|
|
13861
|
-
return /* @__PURE__ */ (0,
|
|
14066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(AutocompleteSearchContext, { value: contextProps, children });
|
|
13862
14067
|
};
|
|
13863
14068
|
SearchAutocompleteWrapper.displayName = "SearchAutocompleteWrapper";
|
|
13864
14069
|
|
|
@@ -13874,7 +14079,7 @@ var Skeleton_default = {
|
|
|
13874
14079
|
};
|
|
13875
14080
|
|
|
13876
14081
|
// src/components/Skeleton/Skeleton.tsx
|
|
13877
|
-
var
|
|
14082
|
+
var import_jsx_runtime320 = require("react/jsx-runtime");
|
|
13878
14083
|
var Skeleton = ({
|
|
13879
14084
|
width,
|
|
13880
14085
|
height,
|
|
@@ -13884,7 +14089,7 @@ var Skeleton = ({
|
|
|
13884
14089
|
ref,
|
|
13885
14090
|
...rest
|
|
13886
14091
|
}) => {
|
|
13887
|
-
return /* @__PURE__ */ (0,
|
|
14092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
13888
14093
|
Box,
|
|
13889
14094
|
{
|
|
13890
14095
|
width,
|
|
@@ -13904,7 +14109,7 @@ var SkipToContent_default = {
|
|
|
13904
14109
|
};
|
|
13905
14110
|
|
|
13906
14111
|
// src/components/SkipToContent/SkipToContent.tsx
|
|
13907
|
-
var
|
|
14112
|
+
var import_jsx_runtime321 = require("react/jsx-runtime");
|
|
13908
14113
|
var SkipToContent = ({
|
|
13909
14114
|
text = "Til hovedinnhold",
|
|
13910
14115
|
top = 0,
|
|
@@ -13914,7 +14119,7 @@ var SkipToContent = ({
|
|
|
13914
14119
|
style,
|
|
13915
14120
|
...rest
|
|
13916
14121
|
}) => {
|
|
13917
|
-
return /* @__PURE__ */ (0,
|
|
14122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
13918
14123
|
Contrast,
|
|
13919
14124
|
{
|
|
13920
14125
|
padding: "x0.25",
|
|
@@ -13926,7 +14131,7 @@ var SkipToContent = ({
|
|
|
13926
14131
|
className: cn(className, SkipToContent_default.wrapper),
|
|
13927
14132
|
style,
|
|
13928
14133
|
top,
|
|
13929
|
-
children: /* @__PURE__ */ (0,
|
|
14134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(Link, { ...rest, ...htmlProps, id, typographyType: "bodyShortMedium", children: text })
|
|
13930
14135
|
}
|
|
13931
14136
|
);
|
|
13932
14137
|
};
|
|
@@ -13944,7 +14149,7 @@ var SplitButton_default = {
|
|
|
13944
14149
|
};
|
|
13945
14150
|
|
|
13946
14151
|
// src/components/SplitButton/SplitButton.tsx
|
|
13947
|
-
var
|
|
14152
|
+
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
13948
14153
|
var SplitButton = ({
|
|
13949
14154
|
size: size2,
|
|
13950
14155
|
primaryAction,
|
|
@@ -13959,8 +14164,8 @@ var SplitButton = ({
|
|
|
13959
14164
|
purpose,
|
|
13960
14165
|
size: size2
|
|
13961
14166
|
};
|
|
13962
|
-
return /* @__PURE__ */ (0,
|
|
13963
|
-
/* @__PURE__ */ (0,
|
|
14167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: cn(className, SplitButton_default.container), ...rest, children: [
|
|
14168
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
13964
14169
|
Button,
|
|
13965
14170
|
{
|
|
13966
14171
|
...buttonStyleProps,
|
|
@@ -13969,8 +14174,8 @@ var SplitButton = ({
|
|
|
13969
14174
|
className: SplitButton_default.main
|
|
13970
14175
|
}
|
|
13971
14176
|
),
|
|
13972
|
-
/* @__PURE__ */ (0,
|
|
13973
|
-
/* @__PURE__ */ (0,
|
|
14177
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsxs)(OverflowMenuGroup, { isOpen, setIsOpen, children: [
|
|
14178
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
13974
14179
|
Button,
|
|
13975
14180
|
{
|
|
13976
14181
|
...buttonStyleProps,
|
|
@@ -13984,7 +14189,7 @@ var SplitButton = ({
|
|
|
13984
14189
|
type: "button"
|
|
13985
14190
|
}
|
|
13986
14191
|
),
|
|
13987
|
-
/* @__PURE__ */ (0,
|
|
14192
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(OverflowMenu, { placement: "bottom-end", children: /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(OverflowMenuList, { children: secondaryActions.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime322.jsx)(OverflowMenuButton, { ...item, children: item.children }, index)) }) })
|
|
13988
14193
|
] })
|
|
13989
14194
|
] });
|
|
13990
14195
|
};
|
|
@@ -14011,14 +14216,14 @@ var CollapsibleTableContext = (0, import_react90.createContext)({
|
|
|
14011
14216
|
var useCollapsibleTableContext = () => (0, import_react90.useContext)(CollapsibleTableContext);
|
|
14012
14217
|
|
|
14013
14218
|
// src/components/Table/normal/Body.tsx
|
|
14014
|
-
var
|
|
14015
|
-
var Body = (props) => /* @__PURE__ */ (0,
|
|
14219
|
+
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
14220
|
+
var Body = (props) => /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("tbody", { ...props });
|
|
14016
14221
|
Body.displayName = "Table.Body";
|
|
14017
14222
|
|
|
14018
14223
|
// src/components/Table/normal/Head.tsx
|
|
14019
14224
|
var import_react91 = require("react");
|
|
14020
|
-
var
|
|
14021
|
-
var Head = ({ children, ...rest }) => /* @__PURE__ */ (0,
|
|
14225
|
+
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
14226
|
+
var Head = ({ children, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("thead", { ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(HeadContext, { value: true, children }) });
|
|
14022
14227
|
var HeadContext = (0, import_react91.createContext)(false);
|
|
14023
14228
|
function useIsInTableHead() {
|
|
14024
14229
|
const isInTableHead = (0, import_react91.useContext)(HeadContext);
|
|
@@ -14026,7 +14231,7 @@ function useIsInTableHead() {
|
|
|
14026
14231
|
}
|
|
14027
14232
|
|
|
14028
14233
|
// src/components/Table/normal/Cell.tsx
|
|
14029
|
-
var
|
|
14234
|
+
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
14030
14235
|
var Cell = ({
|
|
14031
14236
|
children,
|
|
14032
14237
|
type: _type,
|
|
@@ -14039,7 +14244,7 @@ var Cell = ({
|
|
|
14039
14244
|
const type = _type != null ? _type : isInHead ? "head" : "data";
|
|
14040
14245
|
const { isCollapsibleChild } = collapsibleProps != null ? collapsibleProps : {};
|
|
14041
14246
|
const isComplexLayout = layout === "text and icon";
|
|
14042
|
-
return isCollapsibleChild ? /* @__PURE__ */ (0,
|
|
14247
|
+
return isCollapsibleChild ? /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(DescriptionListDesc, { children }) : type === "head" ? /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(
|
|
14043
14248
|
"th",
|
|
14044
14249
|
{
|
|
14045
14250
|
...rest,
|
|
@@ -14048,26 +14253,26 @@ var Cell = ({
|
|
|
14048
14253
|
!isComplexLayout && Table_default[`cell--${layout}`],
|
|
14049
14254
|
Table_default["cell--head"]
|
|
14050
14255
|
),
|
|
14051
|
-
children: isComplexLayout ? /* @__PURE__ */ (0,
|
|
14256
|
+
children: isComplexLayout ? /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: Table_default.cell__inner, children }) : children
|
|
14052
14257
|
}
|
|
14053
|
-
) : /* @__PURE__ */ (0,
|
|
14258
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(
|
|
14054
14259
|
"td",
|
|
14055
14260
|
{
|
|
14056
14261
|
...rest,
|
|
14057
14262
|
className: cn(className, !isComplexLayout && Table_default[`cell--${layout}`]),
|
|
14058
|
-
children: isComplexLayout ? /* @__PURE__ */ (0,
|
|
14263
|
+
children: isComplexLayout ? /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: Table_default.cell__inner, children }) : children
|
|
14059
14264
|
}
|
|
14060
14265
|
);
|
|
14061
14266
|
};
|
|
14062
14267
|
Cell.displayName = "Table.Cell";
|
|
14063
14268
|
|
|
14064
14269
|
// src/components/Table/normal/Foot.tsx
|
|
14065
|
-
var
|
|
14066
|
-
var Foot = (props) => /* @__PURE__ */ (0,
|
|
14270
|
+
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
14271
|
+
var Foot = (props) => /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("tfoot", { ...props });
|
|
14067
14272
|
Foot.displayName = "Table.Foot";
|
|
14068
14273
|
|
|
14069
14274
|
// src/components/Table/normal/Row.tsx
|
|
14070
|
-
var
|
|
14275
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
14071
14276
|
var Row = ({
|
|
14072
14277
|
type: _type,
|
|
14073
14278
|
mode = "normal",
|
|
@@ -14078,7 +14283,7 @@ var Row = ({
|
|
|
14078
14283
|
}) => {
|
|
14079
14284
|
const isInHeader = useIsInTableHead();
|
|
14080
14285
|
const type = _type != null ? _type : isInHeader ? "head" : "body";
|
|
14081
|
-
return /* @__PURE__ */ (0,
|
|
14286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
14082
14287
|
"tr",
|
|
14083
14288
|
{
|
|
14084
14289
|
className: cn(
|
|
@@ -14098,7 +14303,7 @@ var Row = ({
|
|
|
14098
14303
|
Row.displayName = "Table.Row";
|
|
14099
14304
|
|
|
14100
14305
|
// src/components/Table/normal/SortCell.tsx
|
|
14101
|
-
var
|
|
14306
|
+
var import_jsx_runtime328 = require("react/jsx-runtime");
|
|
14102
14307
|
var SortCell = ({
|
|
14103
14308
|
isSorted,
|
|
14104
14309
|
sortOrder,
|
|
@@ -14112,13 +14317,13 @@ var SortCell = ({
|
|
|
14112
14317
|
if (sortOrder === "ascending") return ChevronDownIcon;
|
|
14113
14318
|
return ChevronUpIcon;
|
|
14114
14319
|
};
|
|
14115
|
-
return /* @__PURE__ */ (0,
|
|
14320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
14116
14321
|
Cell,
|
|
14117
14322
|
{
|
|
14118
14323
|
type: "head",
|
|
14119
14324
|
"aria-sort": isSorted && sortOrder ? sortOrder : void 0,
|
|
14120
14325
|
...rest,
|
|
14121
|
-
children: /* @__PURE__ */ (0,
|
|
14326
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)(
|
|
14122
14327
|
StylelessButton,
|
|
14123
14328
|
{
|
|
14124
14329
|
onClick,
|
|
@@ -14127,7 +14332,7 @@ var SortCell = ({
|
|
|
14127
14332
|
children: [
|
|
14128
14333
|
children,
|
|
14129
14334
|
" ",
|
|
14130
|
-
/* @__PURE__ */ (0,
|
|
14335
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)(Icon, { icon: SortIcon(), iconSize: "component" })
|
|
14131
14336
|
]
|
|
14132
14337
|
}
|
|
14133
14338
|
)
|
|
@@ -14146,7 +14351,7 @@ var texts29 = createTexts({
|
|
|
14146
14351
|
});
|
|
14147
14352
|
|
|
14148
14353
|
// src/components/Table/normal/Table.tsx
|
|
14149
|
-
var
|
|
14354
|
+
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
14150
14355
|
var Table = ({
|
|
14151
14356
|
size: size2 = "medium",
|
|
14152
14357
|
stickyHeader,
|
|
@@ -14165,7 +14370,7 @@ var Table = ({
|
|
|
14165
14370
|
return "medium";
|
|
14166
14371
|
}
|
|
14167
14372
|
};
|
|
14168
|
-
return /* @__PURE__ */ (0,
|
|
14373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
14169
14374
|
"table",
|
|
14170
14375
|
{
|
|
14171
14376
|
...rest,
|
|
@@ -14187,7 +14392,7 @@ Table.displayName = "Table";
|
|
|
14187
14392
|
|
|
14188
14393
|
// src/components/Table/normal/TableWrapper.tsx
|
|
14189
14394
|
var import_react92 = require("react");
|
|
14190
|
-
var
|
|
14395
|
+
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
14191
14396
|
var TableWrapper = ({ className, ...rest }) => {
|
|
14192
14397
|
const themeContext = (0, import_react92.useContext)(ThemeContext);
|
|
14193
14398
|
const container2 = themeContext == null ? void 0 : themeContext.el;
|
|
@@ -14212,7 +14417,7 @@ var TableWrapper = ({ className, ...rest }) => {
|
|
|
14212
14417
|
window.addEventListener("resize", handleResize);
|
|
14213
14418
|
return () => window.removeEventListener("resize", handleResize);
|
|
14214
14419
|
});
|
|
14215
|
-
return /* @__PURE__ */ (0,
|
|
14420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime330.jsx)(
|
|
14216
14421
|
"div",
|
|
14217
14422
|
{
|
|
14218
14423
|
ref: wrapperRef,
|
|
@@ -14239,7 +14444,7 @@ Table2.Row = Row;
|
|
|
14239
14444
|
Table2.Foot = Foot;
|
|
14240
14445
|
|
|
14241
14446
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
14242
|
-
var
|
|
14447
|
+
var import_jsx_runtime331 = require("react/jsx-runtime");
|
|
14243
14448
|
var CollapsibleRow = ({
|
|
14244
14449
|
type: _type,
|
|
14245
14450
|
className,
|
|
@@ -14282,24 +14487,24 @@ var CollapsibleRow = ({
|
|
|
14282
14487
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
14283
14488
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
14284
14489
|
collapsibleIds.push(id);
|
|
14285
|
-
return /* @__PURE__ */ (0,
|
|
14286
|
-
/* @__PURE__ */ (0,
|
|
14490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)(import_react93.Fragment, { children: [
|
|
14491
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
|
|
14287
14492
|
(0, import_react93.isValidElement)(child) && (0, import_react93.cloneElement)(child, {
|
|
14288
14493
|
collapsibleProps: { isCollapsibleChild: true }
|
|
14289
14494
|
})
|
|
14290
14495
|
] }, `DL-${index}`);
|
|
14291
14496
|
}) : null;
|
|
14292
|
-
const collapsedRows = collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0,
|
|
14497
|
+
const collapsedRows = collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(Row, { ...rowProps(), children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(Cell, { colSpan: definingColumnIndex.length + 1, children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(DescriptionList, { children: collapsedRenderedChildren }) }) }) : null;
|
|
14293
14498
|
const definingColumnCells = childrenArray.slice().filter((column, index) => definingColumnIndex.indexOf(index) > -1).sort((a, b) => {
|
|
14294
14499
|
return definingColumnIndex.indexOf(childrenArray.indexOf(a)) - definingColumnIndex.indexOf(childrenArray.indexOf(b));
|
|
14295
14500
|
});
|
|
14296
14501
|
const headerRow = () => {
|
|
14297
14502
|
if (type !== "head" || !isCollapsed) return null;
|
|
14298
|
-
return /* @__PURE__ */ (0,
|
|
14503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(Row, { ref, ...rowProps(), children: /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)(import_jsx_runtime331.Fragment, { children: [
|
|
14299
14504
|
definingColumnCells,
|
|
14300
|
-
/* @__PURE__ */ (0,
|
|
14505
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsxs)(Table2.Cell, { type: "head", layout: "center", children: [
|
|
14301
14506
|
t(texts30.expand),
|
|
14302
|
-
/* @__PURE__ */ (0,
|
|
14507
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)(VisuallyHidden, { children: t(texts30.row) })
|
|
14303
14508
|
] })
|
|
14304
14509
|
] }) });
|
|
14305
14510
|
};
|
|
@@ -14307,16 +14512,16 @@ var CollapsibleRow = ({
|
|
|
14307
14512
|
const rowWithChevron = () => {
|
|
14308
14513
|
if (type !== "body" || !isCollapsed) return null;
|
|
14309
14514
|
const iconState = childrenCollapsed ? "down" : "up";
|
|
14310
|
-
return /* @__PURE__ */ (0,
|
|
14515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)(Row, { ref, ...rowProps(!childrenCollapsed && true), children: [
|
|
14311
14516
|
definingColumnCells,
|
|
14312
|
-
/* @__PURE__ */ (0,
|
|
14517
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)(Table2.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
14313
14518
|
StylelessButton,
|
|
14314
14519
|
{
|
|
14315
14520
|
onClick: () => setChildrenCollapsed(!childrenCollapsed),
|
|
14316
14521
|
"aria-expanded": !childrenCollapsed,
|
|
14317
14522
|
"aria-controls": idList,
|
|
14318
14523
|
className: cn(Table_default["collapse-button"], focusable),
|
|
14319
|
-
children: /* @__PURE__ */ (0,
|
|
14524
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(
|
|
14320
14525
|
Icon,
|
|
14321
14526
|
{
|
|
14322
14527
|
icon: AnimatedChevronUpDownIcon,
|
|
@@ -14328,13 +14533,13 @@ var CollapsibleRow = ({
|
|
|
14328
14533
|
) })
|
|
14329
14534
|
] });
|
|
14330
14535
|
};
|
|
14331
|
-
return isCollapsed && collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0,
|
|
14536
|
+
return isCollapsed && collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)(import_jsx_runtime331.Fragment, { children: [
|
|
14332
14537
|
headerRow(),
|
|
14333
|
-
type === "body" && /* @__PURE__ */ (0,
|
|
14538
|
+
type === "body" && /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)(import_jsx_runtime331.Fragment, { children: [
|
|
14334
14539
|
rowWithChevron(),
|
|
14335
14540
|
childrenCollapsed ? null : collapsedRows
|
|
14336
14541
|
] })
|
|
14337
|
-
] }) : /* @__PURE__ */ (0,
|
|
14542
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(Row, { ref, ...rowProps(), children });
|
|
14338
14543
|
};
|
|
14339
14544
|
CollapsibleRow.displayName = "CollapsibleTable.Row";
|
|
14340
14545
|
var texts30 = createTexts({
|
|
@@ -14355,14 +14560,14 @@ var texts30 = createTexts({
|
|
|
14355
14560
|
});
|
|
14356
14561
|
|
|
14357
14562
|
// src/components/Table/collapsible/CollapsibleTable.tsx
|
|
14358
|
-
var
|
|
14563
|
+
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
14359
14564
|
var CollapsibleTable = ({
|
|
14360
14565
|
isCollapsed,
|
|
14361
14566
|
headerValues,
|
|
14362
14567
|
definingColumnIndex = [0],
|
|
14363
14568
|
...rest
|
|
14364
14569
|
}) => {
|
|
14365
|
-
return /* @__PURE__ */ (0,
|
|
14570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
14366
14571
|
CollapsibleTableContext,
|
|
14367
14572
|
{
|
|
14368
14573
|
value: {
|
|
@@ -14370,7 +14575,7 @@ var CollapsibleTable = ({
|
|
|
14370
14575
|
headerValues,
|
|
14371
14576
|
definingColumnIndex
|
|
14372
14577
|
},
|
|
14373
|
-
children: /* @__PURE__ */ (0,
|
|
14578
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(Table2, { ...rest })
|
|
14374
14579
|
}
|
|
14375
14580
|
);
|
|
14376
14581
|
};
|
|
@@ -14416,13 +14621,13 @@ var Tabs_default = {
|
|
|
14416
14621
|
|
|
14417
14622
|
// src/components/Tabs/TabWidthContext.tsx
|
|
14418
14623
|
var import_react95 = require("react");
|
|
14419
|
-
var
|
|
14624
|
+
var import_jsx_runtime333 = require("react/jsx-runtime");
|
|
14420
14625
|
var TabContext = (0, import_react95.createContext)(null);
|
|
14421
14626
|
function TabWidthContextProvider({
|
|
14422
14627
|
children,
|
|
14423
14628
|
onChangeWidths
|
|
14424
14629
|
}) {
|
|
14425
|
-
return /* @__PURE__ */ (0,
|
|
14630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
14426
14631
|
TabContext,
|
|
14427
14632
|
{
|
|
14428
14633
|
value: {
|
|
@@ -14454,7 +14659,7 @@ function useSetTabWidth(index, width) {
|
|
|
14454
14659
|
}
|
|
14455
14660
|
|
|
14456
14661
|
// src/components/Tabs/AddTabButton.tsx
|
|
14457
|
-
var
|
|
14662
|
+
var import_jsx_runtime334 = require("react/jsx-runtime");
|
|
14458
14663
|
var AddTabButton = ({
|
|
14459
14664
|
ref,
|
|
14460
14665
|
children,
|
|
@@ -14467,7 +14672,7 @@ var AddTabButton = ({
|
|
|
14467
14672
|
const buttonRef = (0, import_react96.useRef)(null);
|
|
14468
14673
|
const combinedRef = useCombinedRef(ref, buttonRef);
|
|
14469
14674
|
const { tabContentDirection, size: size2 } = useTabsContext();
|
|
14470
|
-
return /* @__PURE__ */ (0,
|
|
14675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)(
|
|
14471
14676
|
"button",
|
|
14472
14677
|
{
|
|
14473
14678
|
...rest,
|
|
@@ -14480,8 +14685,8 @@ var AddTabButton = ({
|
|
|
14480
14685
|
focus_default["focusable--inset"]
|
|
14481
14686
|
),
|
|
14482
14687
|
children: [
|
|
14483
|
-
/* @__PURE__ */ (0,
|
|
14484
|
-
/* @__PURE__ */ (0,
|
|
14688
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)(Icon, { icon: PlusIcon, iconSize: "inherit" }),
|
|
14689
|
+
/* @__PURE__ */ (0, import_jsx_runtime334.jsx)("span", { children })
|
|
14485
14690
|
]
|
|
14486
14691
|
}
|
|
14487
14692
|
);
|
|
@@ -14490,7 +14695,7 @@ AddTabButton.displayName = "AddTabButton";
|
|
|
14490
14695
|
|
|
14491
14696
|
// src/components/Tabs/Tabs.tsx
|
|
14492
14697
|
var import_react97 = require("react");
|
|
14493
|
-
var
|
|
14698
|
+
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
14494
14699
|
var TABS_SIZES = createSizes("small", "medium");
|
|
14495
14700
|
var Tabs = ({
|
|
14496
14701
|
id,
|
|
@@ -14521,7 +14726,7 @@ var Tabs = ({
|
|
|
14521
14726
|
setActiveTab(activeTab);
|
|
14522
14727
|
}
|
|
14523
14728
|
}, [activeTab, thisActiveTab]);
|
|
14524
|
-
return /* @__PURE__ */ (0,
|
|
14729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
14525
14730
|
TabsContext,
|
|
14526
14731
|
{
|
|
14527
14732
|
value: {
|
|
@@ -14536,7 +14741,7 @@ var Tabs = ({
|
|
|
14536
14741
|
tabContentDirection,
|
|
14537
14742
|
addTabButtonProps
|
|
14538
14743
|
},
|
|
14539
|
-
children: /* @__PURE__ */ (0,
|
|
14744
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
14540
14745
|
Box,
|
|
14541
14746
|
{
|
|
14542
14747
|
...getBaseHTMLProps(uniqueId, className, style, htmlProps, rest),
|
|
@@ -14551,7 +14756,7 @@ Tabs.displayName = "Tabs";
|
|
|
14551
14756
|
|
|
14552
14757
|
// src/components/Tabs/Tab.tsx
|
|
14553
14758
|
var import_react98 = require("react");
|
|
14554
|
-
var
|
|
14759
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
14555
14760
|
var Tab = ({
|
|
14556
14761
|
active = false,
|
|
14557
14762
|
icon,
|
|
@@ -14594,7 +14799,7 @@ var Tab = ({
|
|
|
14594
14799
|
handleSelect();
|
|
14595
14800
|
onKeyDown == null ? void 0 : onKeyDown(e);
|
|
14596
14801
|
};
|
|
14597
|
-
return /* @__PURE__ */ (0,
|
|
14802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)(
|
|
14598
14803
|
"button",
|
|
14599
14804
|
{
|
|
14600
14805
|
...getBaseHTMLProps(
|
|
@@ -14619,8 +14824,8 @@ var Tab = ({
|
|
|
14619
14824
|
onKeyDown: handleOnKeyDown,
|
|
14620
14825
|
tabIndex: focus ? 0 : -1,
|
|
14621
14826
|
children: [
|
|
14622
|
-
icon && /* @__PURE__ */ (0,
|
|
14623
|
-
/* @__PURE__ */ (0,
|
|
14827
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime336.jsx)(Icon, { icon, iconSize: "component" }),
|
|
14828
|
+
/* @__PURE__ */ (0, import_jsx_runtime336.jsx)("span", { children })
|
|
14624
14829
|
]
|
|
14625
14830
|
}
|
|
14626
14831
|
);
|
|
@@ -14629,7 +14834,7 @@ Tab.displayName = "Tab";
|
|
|
14629
14834
|
|
|
14630
14835
|
// src/components/Tabs/TabList.tsx
|
|
14631
14836
|
var import_react99 = require("react");
|
|
14632
|
-
var
|
|
14837
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
14633
14838
|
var TabList = ({
|
|
14634
14839
|
children,
|
|
14635
14840
|
id,
|
|
@@ -14687,7 +14892,7 @@ var TabList = ({
|
|
|
14687
14892
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14688
14893
|
["--dds-tab-widths"]: widths.join(" ")
|
|
14689
14894
|
};
|
|
14690
|
-
return /* @__PURE__ */ (0,
|
|
14895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(TabWidthContextProvider, { onChangeWidths: setWidths, children: /* @__PURE__ */ (0, import_jsx_runtime337.jsxs)(
|
|
14691
14896
|
"div",
|
|
14692
14897
|
{
|
|
14693
14898
|
...rest,
|
|
@@ -14707,7 +14912,7 @@ var TabList = ({
|
|
|
14707
14912
|
style: { ...style, ...customWidths },
|
|
14708
14913
|
children: [
|
|
14709
14914
|
tabListChildren,
|
|
14710
|
-
hasButton && /* @__PURE__ */ (0,
|
|
14915
|
+
hasButton && /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
14711
14916
|
AddTabButton,
|
|
14712
14917
|
{
|
|
14713
14918
|
index: tabListChildren ? tabListChildren.length : 0,
|
|
@@ -14721,7 +14926,7 @@ var TabList = ({
|
|
|
14721
14926
|
TabList.displayName = "TabList";
|
|
14722
14927
|
|
|
14723
14928
|
// src/components/Tabs/TabPanel.tsx
|
|
14724
|
-
var
|
|
14929
|
+
var import_jsx_runtime338 = require("react/jsx-runtime");
|
|
14725
14930
|
var TabPanel = ({
|
|
14726
14931
|
active = false,
|
|
14727
14932
|
children,
|
|
@@ -14731,7 +14936,7 @@ var TabPanel = ({
|
|
|
14731
14936
|
htmlProps,
|
|
14732
14937
|
padding = "x0.25",
|
|
14733
14938
|
...rest
|
|
14734
|
-
}) => /* @__PURE__ */ (0,
|
|
14939
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime338.jsx)(
|
|
14735
14940
|
Box,
|
|
14736
14941
|
{
|
|
14737
14942
|
padding,
|
|
@@ -14746,7 +14951,7 @@ TabPanel.displayName = "TabPanel";
|
|
|
14746
14951
|
|
|
14747
14952
|
// src/components/Tabs/TabPanels.tsx
|
|
14748
14953
|
var import_react100 = require("react");
|
|
14749
|
-
var
|
|
14954
|
+
var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
14750
14955
|
var TabPanels = ({ children, ref, ...rest }) => {
|
|
14751
14956
|
const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
|
|
14752
14957
|
const combinedRef = useCombinedRef(ref, tabPanelsRef);
|
|
@@ -14761,7 +14966,7 @@ var TabPanels = ({ children, ref, ...rest }) => {
|
|
|
14761
14966
|
}
|
|
14762
14967
|
});
|
|
14763
14968
|
});
|
|
14764
|
-
return /* @__PURE__ */ (0,
|
|
14969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(Box, { ref: combinedRef, ...rest, children: panelChildren });
|
|
14765
14970
|
};
|
|
14766
14971
|
TabPanels.displayName = "TabPanels";
|
|
14767
14972
|
|
|
@@ -14782,7 +14987,7 @@ var Tag_default = {
|
|
|
14782
14987
|
};
|
|
14783
14988
|
|
|
14784
14989
|
// src/components/Tag/Tag.tsx
|
|
14785
|
-
var
|
|
14990
|
+
var import_jsx_runtime340 = require("react/jsx-runtime");
|
|
14786
14991
|
var icons3 = {
|
|
14787
14992
|
info: InfoIcon,
|
|
14788
14993
|
danger: ErrorIcon,
|
|
@@ -14809,7 +15014,7 @@ var Tag = ({
|
|
|
14809
15014
|
...rest
|
|
14810
15015
|
}) => {
|
|
14811
15016
|
const icon = icons3[purpose];
|
|
14812
|
-
return /* @__PURE__ */ (0,
|
|
15017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsxs)(
|
|
14813
15018
|
TextOverflowEllipsisWrapper,
|
|
14814
15019
|
{
|
|
14815
15020
|
...getBaseHTMLProps(
|
|
@@ -14826,8 +15031,8 @@ var Tag = ({
|
|
|
14826
15031
|
rest
|
|
14827
15032
|
),
|
|
14828
15033
|
children: [
|
|
14829
|
-
withIcon && icon && /* @__PURE__ */ (0,
|
|
14830
|
-
/* @__PURE__ */ (0,
|
|
15034
|
+
withIcon && icon && /* @__PURE__ */ (0, import_jsx_runtime340.jsx)(Icon, { icon, iconSize: "component" }),
|
|
15035
|
+
/* @__PURE__ */ (0, import_jsx_runtime340.jsx)(TextOverflowEllipsisInner, { children })
|
|
14831
15036
|
]
|
|
14832
15037
|
}
|
|
14833
15038
|
);
|
|
@@ -14850,7 +15055,7 @@ var TextInput_default = {
|
|
|
14850
15055
|
};
|
|
14851
15056
|
|
|
14852
15057
|
// src/components/TextInput/TextInput.tsx
|
|
14853
|
-
var
|
|
15058
|
+
var import_jsx_runtime341 = require("react/jsx-runtime");
|
|
14854
15059
|
var TextInput = ({
|
|
14855
15060
|
label,
|
|
14856
15061
|
afterLabelContent,
|
|
@@ -14950,7 +15155,7 @@ var TextInput = ({
|
|
|
14950
15155
|
disabled && TextInput_default["affix--disabled"]
|
|
14951
15156
|
];
|
|
14952
15157
|
if (hasIcon) {
|
|
14953
|
-
extendedInput = /* @__PURE__ */ (0,
|
|
15158
|
+
extendedInput = /* @__PURE__ */ (0, import_jsx_runtime341.jsxs)(
|
|
14954
15159
|
Box,
|
|
14955
15160
|
{
|
|
14956
15161
|
className: cn(
|
|
@@ -14959,7 +15164,7 @@ var TextInput = ({
|
|
|
14959
15164
|
),
|
|
14960
15165
|
width: inputWidth,
|
|
14961
15166
|
children: [
|
|
14962
|
-
/* @__PURE__ */ (0,
|
|
15167
|
+
/* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
14963
15168
|
Icon,
|
|
14964
15169
|
{
|
|
14965
15170
|
icon,
|
|
@@ -14970,7 +15175,7 @@ var TextInput = ({
|
|
|
14970
15175
|
)
|
|
14971
15176
|
}
|
|
14972
15177
|
),
|
|
14973
|
-
/* @__PURE__ */ (0,
|
|
15178
|
+
/* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
14974
15179
|
StatefulInput,
|
|
14975
15180
|
{
|
|
14976
15181
|
className: cn(
|
|
@@ -14984,7 +15189,7 @@ var TextInput = ({
|
|
|
14984
15189
|
}
|
|
14985
15190
|
);
|
|
14986
15191
|
} else if (hasAffix) {
|
|
14987
|
-
extendedInput = /* @__PURE__ */ (0,
|
|
15192
|
+
extendedInput = /* @__PURE__ */ (0, import_jsx_runtime341.jsxs)(
|
|
14988
15193
|
Box,
|
|
14989
15194
|
{
|
|
14990
15195
|
position: "relative",
|
|
@@ -14992,7 +15197,7 @@ var TextInput = ({
|
|
|
14992
15197
|
alignItems: "center",
|
|
14993
15198
|
width: inputWidth,
|
|
14994
15199
|
children: [
|
|
14995
|
-
prefix2 && /* @__PURE__ */ (0,
|
|
15200
|
+
prefix2 && /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
14996
15201
|
"span",
|
|
14997
15202
|
{
|
|
14998
15203
|
ref: prefixRef,
|
|
@@ -15005,7 +15210,7 @@ var TextInput = ({
|
|
|
15005
15210
|
children: prefix2
|
|
15006
15211
|
}
|
|
15007
15212
|
),
|
|
15008
|
-
/* @__PURE__ */ (0,
|
|
15213
|
+
/* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
15009
15214
|
StatefulInput,
|
|
15010
15215
|
{
|
|
15011
15216
|
style: {
|
|
@@ -15016,7 +15221,7 @@ var TextInput = ({
|
|
|
15016
15221
|
...generalInputProps
|
|
15017
15222
|
}
|
|
15018
15223
|
),
|
|
15019
|
-
suffix && /* @__PURE__ */ (0,
|
|
15224
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
15020
15225
|
"span",
|
|
15021
15226
|
{
|
|
15022
15227
|
ref: suffixRef,
|
|
@@ -15034,7 +15239,7 @@ var TextInput = ({
|
|
|
15034
15239
|
}
|
|
15035
15240
|
);
|
|
15036
15241
|
}
|
|
15037
|
-
return /* @__PURE__ */ (0,
|
|
15242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime341.jsxs)(
|
|
15038
15243
|
"div",
|
|
15039
15244
|
{
|
|
15040
15245
|
className: cn(
|
|
@@ -15053,8 +15258,8 @@ var TextInput = ({
|
|
|
15053
15258
|
readOnly,
|
|
15054
15259
|
afterLabelContent
|
|
15055
15260
|
}),
|
|
15056
|
-
extendedInput ? extendedInput : /* @__PURE__ */ (0,
|
|
15057
|
-
hasBottomContainer && /* @__PURE__ */ (0,
|
|
15261
|
+
extendedInput ? extendedInput : /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(Box, { as: StatefulInput, width: inputWidth, ...generalInputProps }),
|
|
15262
|
+
hasBottomContainer && /* @__PURE__ */ (0, import_jsx_runtime341.jsxs)(
|
|
15058
15263
|
Box,
|
|
15059
15264
|
{
|
|
15060
15265
|
display: "flex",
|
|
@@ -15099,7 +15304,7 @@ var ToggleBar_default = {
|
|
|
15099
15304
|
};
|
|
15100
15305
|
|
|
15101
15306
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
15102
|
-
var
|
|
15307
|
+
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
15103
15308
|
var ToggleBar = (props) => {
|
|
15104
15309
|
const {
|
|
15105
15310
|
children,
|
|
@@ -15124,7 +15329,7 @@ var ToggleBar = (props) => {
|
|
|
15124
15329
|
(e) => onChange && onChange(e, e.target.value)
|
|
15125
15330
|
);
|
|
15126
15331
|
const labelId = label && `${uniqueId}-label`;
|
|
15127
|
-
return /* @__PURE__ */ (0,
|
|
15332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
|
|
15128
15333
|
ToggleBarContext,
|
|
15129
15334
|
{
|
|
15130
15335
|
value: {
|
|
@@ -15134,7 +15339,7 @@ var ToggleBar = (props) => {
|
|
|
15134
15339
|
name,
|
|
15135
15340
|
value: groupValue
|
|
15136
15341
|
},
|
|
15137
|
-
children: /* @__PURE__ */ (0,
|
|
15342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime342.jsxs)(
|
|
15138
15343
|
VStack,
|
|
15139
15344
|
{
|
|
15140
15345
|
...getBaseHTMLProps(id, className, style, htmlProps, rest),
|
|
@@ -15143,8 +15348,8 @@ var ToggleBar = (props) => {
|
|
|
15143
15348
|
role: "radiogroup",
|
|
15144
15349
|
"aria-labelledby": labelId != null ? labelId : htmlProps == null ? void 0 : htmlProps["aria-labelledby"],
|
|
15145
15350
|
children: [
|
|
15146
|
-
label && /* @__PURE__ */ (0,
|
|
15147
|
-
/* @__PURE__ */ (0,
|
|
15351
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(Typography, { id: labelId, as: "span", typographyType: "labelMedium", children: label }),
|
|
15352
|
+
/* @__PURE__ */ (0, import_jsx_runtime342.jsx)("div", { className: ToggleBar_default.bar, children })
|
|
15148
15353
|
]
|
|
15149
15354
|
}
|
|
15150
15355
|
)
|
|
@@ -15155,7 +15360,7 @@ ToggleBar.displayName = "ToggleBar";
|
|
|
15155
15360
|
|
|
15156
15361
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
15157
15362
|
var import_react104 = require("react");
|
|
15158
|
-
var
|
|
15363
|
+
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
15159
15364
|
var typographyTypes = {
|
|
15160
15365
|
large: "bodyShortLarge",
|
|
15161
15366
|
medium: "bodyShortMedium",
|
|
@@ -15198,13 +15403,13 @@ var ToggleRadio = ({
|
|
|
15198
15403
|
const hasLabel = !!label;
|
|
15199
15404
|
const hasIcon = !!icon;
|
|
15200
15405
|
const contentTypeCn = !hasLabel ? "just-icon" : !hasIcon ? "just-text" : "with-text-and-icon";
|
|
15201
|
-
return /* @__PURE__ */ (0,
|
|
15406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime343.jsxs)(
|
|
15202
15407
|
"label",
|
|
15203
15408
|
{
|
|
15204
15409
|
htmlFor: uniqueId,
|
|
15205
15410
|
className: cn(ToggleBar_default.label, ToggleBar_default[`label--${group.purpose}`]),
|
|
15206
15411
|
children: [
|
|
15207
|
-
/* @__PURE__ */ (0,
|
|
15412
|
+
/* @__PURE__ */ (0, import_jsx_runtime343.jsx)(
|
|
15208
15413
|
HiddenInput,
|
|
15209
15414
|
{
|
|
15210
15415
|
...getBaseHTMLProps(
|
|
@@ -15223,7 +15428,7 @@ var ToggleRadio = ({
|
|
|
15223
15428
|
"aria-labelledby": ariaLabelledBy
|
|
15224
15429
|
}
|
|
15225
15430
|
),
|
|
15226
|
-
/* @__PURE__ */ (0,
|
|
15431
|
+
/* @__PURE__ */ (0, import_jsx_runtime343.jsxs)(
|
|
15227
15432
|
Typography,
|
|
15228
15433
|
{
|
|
15229
15434
|
as: "span",
|
|
@@ -15236,8 +15441,8 @@ var ToggleRadio = ({
|
|
|
15236
15441
|
focus_default["focus-styled-sibling"]
|
|
15237
15442
|
),
|
|
15238
15443
|
children: [
|
|
15239
|
-
icon && /* @__PURE__ */ (0,
|
|
15240
|
-
label && /* @__PURE__ */ (0,
|
|
15444
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime343.jsx)(Icon, { icon, iconSize: "component" }),
|
|
15445
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime343.jsx)("span", { children: label })
|
|
15241
15446
|
]
|
|
15242
15447
|
}
|
|
15243
15448
|
)
|
|
@@ -15259,7 +15464,7 @@ var ToggleButton_default = {
|
|
|
15259
15464
|
};
|
|
15260
15465
|
|
|
15261
15466
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
15262
|
-
var
|
|
15467
|
+
var import_jsx_runtime344 = require("react/jsx-runtime");
|
|
15263
15468
|
var ToggleButton = ({
|
|
15264
15469
|
id,
|
|
15265
15470
|
label,
|
|
@@ -15273,8 +15478,8 @@ var ToggleButton = ({
|
|
|
15273
15478
|
const generatedId = (0, import_react105.useId)();
|
|
15274
15479
|
const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
|
|
15275
15480
|
const hasIcon = !!icon;
|
|
15276
|
-
return /* @__PURE__ */ (0,
|
|
15277
|
-
/* @__PURE__ */ (0,
|
|
15481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime344.jsxs)(Box, { as: "label", htmlFor: uniqueId, width: "fit-content", children: [
|
|
15482
|
+
/* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
15278
15483
|
HiddenInput,
|
|
15279
15484
|
{
|
|
15280
15485
|
...getBaseHTMLProps(
|
|
@@ -15287,7 +15492,7 @@ var ToggleButton = ({
|
|
|
15287
15492
|
type: "checkbox"
|
|
15288
15493
|
}
|
|
15289
15494
|
),
|
|
15290
|
-
/* @__PURE__ */ (0,
|
|
15495
|
+
/* @__PURE__ */ (0, import_jsx_runtime344.jsxs)(
|
|
15291
15496
|
"span",
|
|
15292
15497
|
{
|
|
15293
15498
|
className: cn(
|
|
@@ -15298,7 +15503,7 @@ var ToggleButton = ({
|
|
|
15298
15503
|
focus_default["focus-styled-sibling"]
|
|
15299
15504
|
),
|
|
15300
15505
|
children: [
|
|
15301
|
-
hasIcon && /* @__PURE__ */ (0,
|
|
15506
|
+
hasIcon && /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(Icon, { icon, iconSize: "component" }),
|
|
15302
15507
|
" ",
|
|
15303
15508
|
label
|
|
15304
15509
|
]
|
|
@@ -15310,7 +15515,7 @@ ToggleButton.displayName = "ToggleButton";
|
|
|
15310
15515
|
|
|
15311
15516
|
// src/components/ToggleButton/ToggleButtonGroup.tsx
|
|
15312
15517
|
var import_react106 = require("react");
|
|
15313
|
-
var
|
|
15518
|
+
var import_jsx_runtime345 = require("react/jsx-runtime");
|
|
15314
15519
|
var ToggleButtonGroup = (props) => {
|
|
15315
15520
|
const {
|
|
15316
15521
|
children,
|
|
@@ -15325,7 +15530,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
15325
15530
|
} = props;
|
|
15326
15531
|
const generatedId = (0, import_react106.useId)();
|
|
15327
15532
|
const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
|
|
15328
|
-
return /* @__PURE__ */ (0,
|
|
15533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime345.jsxs)(
|
|
15329
15534
|
"div",
|
|
15330
15535
|
{
|
|
15331
15536
|
...getBaseHTMLProps(id, className, style, htmlProps, rest),
|
|
@@ -15333,7 +15538,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
15333
15538
|
"aria-labelledby": label ? uniqueLabelId : void 0,
|
|
15334
15539
|
children: [
|
|
15335
15540
|
renderGroupLabel({ label, id: uniqueLabelId }),
|
|
15336
|
-
/* @__PURE__ */ (0,
|
|
15541
|
+
/* @__PURE__ */ (0, import_jsx_runtime345.jsx)(Box, { display: "flex", flexWrap: "wrap", gap: "x0.75", flexDirection: direction, children })
|
|
15337
15542
|
]
|
|
15338
15543
|
}
|
|
15339
15544
|
);
|
|
@@ -15553,6 +15758,7 @@ ToggleButtonGroup.displayName = "ToggleButtonGroup";
|
|
|
15553
15758
|
MoreHorizontalIcon,
|
|
15554
15759
|
MoreVerticalIcon,
|
|
15555
15760
|
NativeSelect,
|
|
15761
|
+
NewsPopover,
|
|
15556
15762
|
NotarialIcon,
|
|
15557
15763
|
NotebookPenIcon,
|
|
15558
15764
|
NotificationsIcon,
|