@norges-domstoler/dds-components 0.0.0-dev-20240304142658 → 0.0.0-dev-20240305141413
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +437 -410
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +154 -125
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -5955,12 +5955,13 @@ ChipGroup.displayName = "ChipGroup";
|
|
|
5955
5955
|
var import_date4 = require("@internationalized/date");
|
|
5956
5956
|
var import_calendar3 = require("@react-aria/calendar");
|
|
5957
5957
|
var import_calendar4 = require("@react-stately/calendar");
|
|
5958
|
-
var
|
|
5958
|
+
var import_react40 = require("react");
|
|
5959
|
+
var import_styled_components36 = __toESM(require("styled-components"));
|
|
5959
5960
|
|
|
5960
5961
|
// src/components/date-inputs/DatePicker/Calendar/CalendarGrid.tsx
|
|
5961
5962
|
var import_date3 = require("@internationalized/date");
|
|
5962
5963
|
var import_calendar2 = require("@react-aria/calendar");
|
|
5963
|
-
var
|
|
5964
|
+
var import_styled_components35 = __toESM(require("styled-components"));
|
|
5964
5965
|
|
|
5965
5966
|
// src/components/date-inputs/DatePicker/Calendar/Calendar.tokens.ts
|
|
5966
5967
|
var import_dds_design_tokens28 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -6033,16 +6034,68 @@ var calendarTokens = { grid, cell, popover };
|
|
|
6033
6034
|
// src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
|
|
6034
6035
|
var import_date = require("@internationalized/date");
|
|
6035
6036
|
var import_calendar = require("@react-aria/calendar");
|
|
6037
|
+
var import_react39 = require("react");
|
|
6038
|
+
var import_styled_components34 = __toESM(require("styled-components"));
|
|
6039
|
+
|
|
6040
|
+
// src/components/date-inputs/DatePicker/CalendarPopover.tsx
|
|
6036
6041
|
var import_react38 = require("react");
|
|
6037
6042
|
var import_styled_components33 = __toESM(require("styled-components"));
|
|
6043
|
+
var import_jsx_runtime192 = require("react/jsx-runtime");
|
|
6044
|
+
var { popover: popoverTokens } = calendarTokens;
|
|
6045
|
+
var CalendarPopoverContext = (0, import_react38.createContext)({
|
|
6046
|
+
anchorRef: null,
|
|
6047
|
+
isOpen: false,
|
|
6048
|
+
onClose: () => null
|
|
6049
|
+
});
|
|
6050
|
+
var CalendarPopover = ({
|
|
6051
|
+
children,
|
|
6052
|
+
isOpen,
|
|
6053
|
+
onClose
|
|
6054
|
+
}) => {
|
|
6055
|
+
const anchorRef = (0, import_react38.useRef)(null);
|
|
6056
|
+
useOnKeyDown("Escape", onClose);
|
|
6057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(CalendarPopoverContext.Provider, { value: { anchorRef, isOpen, onClose }, children });
|
|
6058
|
+
};
|
|
6059
|
+
var Anchor = import_styled_components33.default.div``;
|
|
6060
|
+
var CalendarPopoverAnchor = ({
|
|
6061
|
+
children
|
|
6062
|
+
}) => {
|
|
6063
|
+
const { anchorRef } = (0, import_react38.useContext)(CalendarPopoverContext);
|
|
6064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(Anchor, { ref: anchorRef != null ? anchorRef : void 0, children });
|
|
6065
|
+
};
|
|
6066
|
+
var PopoverContentContainer = import_styled_components33.default.div`
|
|
6067
|
+
background-color: ${popoverTokens.backgroundColor};
|
|
6068
|
+
border: ${popoverTokens.border};
|
|
6069
|
+
border-radius: ${popoverTokens.borderRadius};
|
|
6070
|
+
padding: ${popoverTokens.padding};
|
|
6071
|
+
z-index: ${popoverTokens.zIndex};
|
|
6072
|
+
`;
|
|
6073
|
+
var CalendarPopoverContent = ({
|
|
6074
|
+
children
|
|
6075
|
+
}) => {
|
|
6076
|
+
const ref = (0, import_react38.useRef)(null);
|
|
6077
|
+
const { refs, styles } = useFloatPosition(null, {
|
|
6078
|
+
placement: "bottom-start"
|
|
6079
|
+
});
|
|
6080
|
+
const { isOpen, onClose, anchorRef } = (0, import_react38.useContext)(CalendarPopoverContext);
|
|
6081
|
+
const combinedRef = useCombinedRef(refs.setFloating, ref);
|
|
6082
|
+
useOnClickOutside(ref.current, onClose);
|
|
6083
|
+
(0, import_react38.useEffect)(() => {
|
|
6084
|
+
var _a;
|
|
6085
|
+
refs.setReference((_a = anchorRef == null ? void 0 : anchorRef.current) != null ? _a : null);
|
|
6086
|
+
}, []);
|
|
6087
|
+
if (!isOpen)
|
|
6088
|
+
return null;
|
|
6089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(PopoverContentContainer, { ref: combinedRef, style: styles.floating, children });
|
|
6090
|
+
};
|
|
6038
6091
|
|
|
6039
6092
|
// src/components/date-inputs/DatePicker/constants.ts
|
|
6040
6093
|
var locale = "no-NO";
|
|
6041
6094
|
var timezone = "Europe/Oslo";
|
|
6042
6095
|
|
|
6043
6096
|
// src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
|
|
6044
|
-
var
|
|
6045
|
-
var Cell =
|
|
6097
|
+
var import_jsx_runtime193 = require("react/jsx-runtime");
|
|
6098
|
+
var Cell = import_styled_components34.default.button`
|
|
6046
6099
|
${normalizeButton}
|
|
6047
6100
|
width: ${calendarTokens.cell.width};
|
|
6048
6101
|
height: ${calendarTokens.cell.height};
|
|
@@ -6070,7 +6123,7 @@ var Cell = import_styled_components33.default.button`
|
|
|
6070
6123
|
${({ $variant, $isToday }) => {
|
|
6071
6124
|
var _a;
|
|
6072
6125
|
const variantStyles = calendarTokens.cell.variants[$variant];
|
|
6073
|
-
return
|
|
6126
|
+
return import_styled_components34.css`
|
|
6074
6127
|
background-color: ${variantStyles.bg};
|
|
6075
6128
|
color: ${variantStyles.color};
|
|
6076
6129
|
border-color: ${variantStyles.borderColor};
|
|
@@ -6078,12 +6131,12 @@ var Cell = import_styled_components33.default.button`
|
|
|
6078
6131
|
text-decoration: ${variantStyles.textDecoration};
|
|
6079
6132
|
cursor: ${variantStyles.cursor};
|
|
6080
6133
|
|
|
6081
|
-
${() => variantStyles.today && $isToday &&
|
|
6134
|
+
${() => variantStyles.today && $isToday && import_styled_components34.css`
|
|
6082
6135
|
border-color: ${variantStyles.today.borderColor};
|
|
6083
6136
|
text-decoration: ${variantStyles.today.textDecoration};
|
|
6084
6137
|
`}
|
|
6085
6138
|
|
|
6086
|
-
${variantStyles.hover &&
|
|
6139
|
+
${variantStyles.hover && import_styled_components34.css`
|
|
6087
6140
|
&:hover {
|
|
6088
6141
|
background-color: ${variantStyles.hover.bg};
|
|
6089
6142
|
color: ${variantStyles.hover.color};
|
|
@@ -6094,7 +6147,7 @@ var Cell = import_styled_components33.default.button`
|
|
|
6094
6147
|
}}
|
|
6095
6148
|
`;
|
|
6096
6149
|
function CalendarCell({ date, state }) {
|
|
6097
|
-
const ref = (0,
|
|
6150
|
+
const ref = (0, import_react39.useRef)(null);
|
|
6098
6151
|
const {
|
|
6099
6152
|
buttonProps,
|
|
6100
6153
|
cellProps,
|
|
@@ -6105,10 +6158,16 @@ function CalendarCell({ date, state }) {
|
|
|
6105
6158
|
isUnavailable
|
|
6106
6159
|
} = (0, import_calendar.useCalendarCell)({ date }, state, ref);
|
|
6107
6160
|
if (isDisabled) {
|
|
6108
|
-
return /* @__PURE__ */ (0,
|
|
6161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)("td", { ...cellProps });
|
|
6109
6162
|
}
|
|
6163
|
+
const { onClose } = (0, import_react39.useContext)(CalendarPopoverContext);
|
|
6110
6164
|
const variant = isSelected ? "selected" : isUnavailable || isDisabled ? "unavailable" : "default";
|
|
6111
|
-
|
|
6165
|
+
const closeOnKeyboardBlurForward = (event) => {
|
|
6166
|
+
if (event.key === "Tab" && event.shiftKey === false) {
|
|
6167
|
+
onClose();
|
|
6168
|
+
}
|
|
6169
|
+
};
|
|
6170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)("td", { ...cellProps, children: /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
|
|
6112
6171
|
Cell,
|
|
6113
6172
|
{
|
|
6114
6173
|
...buttonProps,
|
|
@@ -6117,6 +6176,7 @@ function CalendarCell({ date, state }) {
|
|
|
6117
6176
|
$variant: variant,
|
|
6118
6177
|
ref,
|
|
6119
6178
|
hidden: isOutsideVisibleRange,
|
|
6179
|
+
onKeyDown: closeOnKeyboardBlurForward,
|
|
6120
6180
|
children: formattedDate
|
|
6121
6181
|
}
|
|
6122
6182
|
) });
|
|
@@ -6159,9 +6219,9 @@ function isLeapYear(date) {
|
|
|
6159
6219
|
}
|
|
6160
6220
|
|
|
6161
6221
|
// src/components/date-inputs/DatePicker/Calendar/CalendarGrid.tsx
|
|
6162
|
-
var
|
|
6222
|
+
var import_jsx_runtime194 = require("react/jsx-runtime");
|
|
6163
6223
|
var { grid: gridTokens } = calendarTokens;
|
|
6164
|
-
var Th =
|
|
6224
|
+
var Th = import_styled_components35.default.th`
|
|
6165
6225
|
font-family: ${gridTokens.headers.fontFamily};
|
|
6166
6226
|
font-size: ${gridTokens.headers.fontSize};
|
|
6167
6227
|
font-style: ${gridTokens.headers.fontStyle};
|
|
@@ -6170,7 +6230,7 @@ var Th = import_styled_components34.default.th`
|
|
|
6170
6230
|
line-height: ${gridTokens.headers.lineHeight};
|
|
6171
6231
|
color: ${gridTokens.headers.color};
|
|
6172
6232
|
`;
|
|
6173
|
-
var WeekNumber =
|
|
6233
|
+
var WeekNumber = import_styled_components35.default.td`
|
|
6174
6234
|
font-family: ${gridTokens.weekNumbers.fontFamily};
|
|
6175
6235
|
font-size: ${gridTokens.weekNumbers.fontSize};
|
|
6176
6236
|
font-style: ${gridTokens.weekNumbers.fontStyle};
|
|
@@ -6192,7 +6252,7 @@ function CalendarGrid({ state, ...props }) {
|
|
|
6192
6252
|
} = (0, import_calendar2.useCalendarGrid)(props, state);
|
|
6193
6253
|
const weeksInMonth = (0, import_date3.getWeeksInMonth)(state.visibleRange.start, locale);
|
|
6194
6254
|
const weekDays = ["Ma", "Ti", "On", "To", "Fr", "L\xF8", "S\xF8"];
|
|
6195
|
-
return /* @__PURE__ */ (0,
|
|
6255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)(
|
|
6196
6256
|
"table",
|
|
6197
6257
|
{
|
|
6198
6258
|
...gridProps,
|
|
@@ -6204,18 +6264,18 @@ function CalendarGrid({ state, ...props }) {
|
|
|
6204
6264
|
},
|
|
6205
6265
|
cellPadding: "0",
|
|
6206
6266
|
children: [
|
|
6207
|
-
/* @__PURE__ */ (0,
|
|
6208
|
-
/* @__PURE__ */ (0,
|
|
6209
|
-
weekDays.map((day, index) => /* @__PURE__ */ (0,
|
|
6267
|
+
/* @__PURE__ */ (0, import_jsx_runtime194.jsx)("thead", { ...headerProps, children: /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)("tr", { children: [
|
|
6268
|
+
/* @__PURE__ */ (0, import_jsx_runtime194.jsx)(Th, { children: "#" }),
|
|
6269
|
+
weekDays.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(Th, { children: day }, index))
|
|
6210
6270
|
] }) }),
|
|
6211
|
-
/* @__PURE__ */ (0,
|
|
6271
|
+
/* @__PURE__ */ (0, import_jsx_runtime194.jsx)("tbody", { children: [...new Array(weeksInMonth).keys()].map((weekIndex) => {
|
|
6212
6272
|
const datesInWeek = state.getDatesInWeek(weekIndex);
|
|
6213
6273
|
const firstExistingDay = datesInWeek.find(Boolean);
|
|
6214
6274
|
const weekNumber = firstExistingDay ? getWeekNumber(firstExistingDay) : "";
|
|
6215
|
-
return /* @__PURE__ */ (0,
|
|
6216
|
-
/* @__PURE__ */ (0,
|
|
6275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)("tr", { children: [
|
|
6276
|
+
/* @__PURE__ */ (0, import_jsx_runtime194.jsx)(WeekNumber, { children: weekNumber }),
|
|
6217
6277
|
datesInWeek.map(
|
|
6218
|
-
(date, i) => date ? /* @__PURE__ */ (0,
|
|
6278
|
+
(date, i) => date ? /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(CalendarCell, { state, date }, i) : /* @__PURE__ */ (0, import_jsx_runtime194.jsx)("td", {}, i)
|
|
6219
6279
|
)
|
|
6220
6280
|
] }, weekIndex);
|
|
6221
6281
|
}) })
|
|
@@ -6226,24 +6286,24 @@ function CalendarGrid({ state, ...props }) {
|
|
|
6226
6286
|
CalendarGrid.displayName = "CalendarGrid";
|
|
6227
6287
|
|
|
6228
6288
|
// src/components/date-inputs/DatePicker/Calendar/Calendar.tsx
|
|
6229
|
-
var
|
|
6230
|
-
var CalendarHeader =
|
|
6289
|
+
var import_jsx_runtime195 = require("react/jsx-runtime");
|
|
6290
|
+
var CalendarHeader = import_styled_components36.default.div`
|
|
6231
6291
|
display: flex;
|
|
6232
6292
|
justify-content: space-between;
|
|
6233
6293
|
align-items: center;
|
|
6234
6294
|
`;
|
|
6235
|
-
var CalendarContainer =
|
|
6295
|
+
var CalendarContainer = import_styled_components36.default.div`
|
|
6236
6296
|
display: flex;
|
|
6237
6297
|
flex-direction: column;
|
|
6238
6298
|
gap: 1rem;
|
|
6239
6299
|
`;
|
|
6240
|
-
var Month = (0,
|
|
6300
|
+
var Month = (0, import_styled_components36.default)(Heading).attrs({
|
|
6241
6301
|
level: 2,
|
|
6242
6302
|
typographyType: "headingSans02"
|
|
6243
6303
|
})`
|
|
6244
6304
|
text-transform: capitalize;
|
|
6245
6305
|
`;
|
|
6246
|
-
var StyledButton = (0,
|
|
6306
|
+
var StyledButton = (0, import_styled_components36.default)(Button)`
|
|
6247
6307
|
user-select: none;
|
|
6248
6308
|
`;
|
|
6249
6309
|
function createCalendar(identifier) {
|
|
@@ -6266,9 +6326,15 @@ function Calendar(props) {
|
|
|
6266
6326
|
nextButtonProps: { onPress: onNext, "aria-label": nextAriaLabel },
|
|
6267
6327
|
title: title3
|
|
6268
6328
|
} = (0, import_calendar3.useCalendar)(props, state);
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6329
|
+
const { onClose } = (0, import_react40.useContext)(CalendarPopoverContext);
|
|
6330
|
+
const closeOnKeyboardBlurBack = (event) => {
|
|
6331
|
+
if (event.key === "Tab" && event.shiftKey === true) {
|
|
6332
|
+
onClose();
|
|
6333
|
+
}
|
|
6334
|
+
};
|
|
6335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(CalendarContainer, { ...calendarProps, children: [
|
|
6336
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(CalendarHeader, { children: [
|
|
6337
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
6272
6338
|
StyledButton,
|
|
6273
6339
|
{
|
|
6274
6340
|
type: "button",
|
|
@@ -6277,11 +6343,12 @@ function Calendar(props) {
|
|
|
6277
6343
|
size: "small",
|
|
6278
6344
|
purpose: "secondary",
|
|
6279
6345
|
appearance: "borderless",
|
|
6280
|
-
icon: ArrowLeftIcon
|
|
6346
|
+
icon: ArrowLeftIcon,
|
|
6347
|
+
htmlProps: { onKeyDown: closeOnKeyboardBlurBack }
|
|
6281
6348
|
}
|
|
6282
6349
|
),
|
|
6283
|
-
/* @__PURE__ */ (0,
|
|
6284
|
-
/* @__PURE__ */ (0,
|
|
6350
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(Month, { children: title3 }),
|
|
6351
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
6285
6352
|
StyledButton,
|
|
6286
6353
|
{
|
|
6287
6354
|
type: "button",
|
|
@@ -6294,7 +6361,7 @@ function Calendar(props) {
|
|
|
6294
6361
|
}
|
|
6295
6362
|
)
|
|
6296
6363
|
] }),
|
|
6297
|
-
/* @__PURE__ */ (0,
|
|
6364
|
+
/* @__PURE__ */ (0, import_jsx_runtime195.jsx)(CalendarGrid, { state })
|
|
6298
6365
|
] });
|
|
6299
6366
|
}
|
|
6300
6367
|
Calendar.displayName = "Calendar";
|
|
@@ -6302,82 +6369,17 @@ Calendar.displayName = "Calendar";
|
|
|
6302
6369
|
// src/components/date-inputs/DatePicker/DatePicker.tsx
|
|
6303
6370
|
var import_datepicker4 = require("@react-aria/datepicker");
|
|
6304
6371
|
var import_datepicker5 = require("@react-stately/datepicker");
|
|
6305
|
-
var
|
|
6306
|
-
|
|
6307
|
-
// src/components/date-inputs/DatePicker/CalendarPopover.tsx
|
|
6308
|
-
var import_react39 = require("react");
|
|
6309
|
-
var import_styled_components36 = __toESM(require("styled-components"));
|
|
6310
|
-
var import_jsx_runtime195 = require("react/jsx-runtime");
|
|
6311
|
-
var { popover: popoverTokens } = calendarTokens;
|
|
6312
|
-
var CalendarPopoverContext = (0, import_react39.createContext)({
|
|
6313
|
-
anchorRef: null,
|
|
6314
|
-
isOpen: false,
|
|
6315
|
-
onClose: () => null
|
|
6316
|
-
});
|
|
6317
|
-
var CalendarPopover = ({
|
|
6318
|
-
children,
|
|
6319
|
-
isOpen,
|
|
6320
|
-
onClose
|
|
6321
|
-
}) => {
|
|
6322
|
-
const anchorRef = (0, import_react39.useRef)(null);
|
|
6323
|
-
useOnKeyDown("Escape", onClose);
|
|
6324
|
-
return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(CalendarPopoverContext.Provider, { value: { anchorRef, isOpen, onClose }, children });
|
|
6325
|
-
};
|
|
6326
|
-
var Anchor = import_styled_components36.default.div``;
|
|
6327
|
-
var CalendarPopoverAnchor = ({
|
|
6328
|
-
children
|
|
6329
|
-
}) => {
|
|
6330
|
-
const { anchorRef } = (0, import_react39.useContext)(CalendarPopoverContext);
|
|
6331
|
-
return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(Anchor, { ref: anchorRef != null ? anchorRef : void 0, children });
|
|
6332
|
-
};
|
|
6333
|
-
var PopoverContentContainer = import_styled_components36.default.div`
|
|
6334
|
-
background-color: ${popoverTokens.backgroundColor};
|
|
6335
|
-
border: ${popoverTokens.border};
|
|
6336
|
-
border-radius: ${popoverTokens.borderRadius};
|
|
6337
|
-
padding: ${popoverTokens.padding};
|
|
6338
|
-
z-index: ${popoverTokens.zIndex};
|
|
6339
|
-
`;
|
|
6340
|
-
var CalendarPopoverContent = ({
|
|
6341
|
-
children
|
|
6342
|
-
}) => {
|
|
6343
|
-
const ref = (0, import_react39.useRef)(null);
|
|
6344
|
-
const { refs, styles } = useFloatPosition(null, {
|
|
6345
|
-
placement: "bottom-start"
|
|
6346
|
-
});
|
|
6347
|
-
const { isOpen, onClose, anchorRef } = (0, import_react39.useContext)(CalendarPopoverContext);
|
|
6348
|
-
const combinedRef = useCombinedRef(refs.setFloating, ref);
|
|
6349
|
-
useOnClickOutside(ref.current, onClose);
|
|
6350
|
-
(0, import_react39.useEffect)(() => {
|
|
6351
|
-
var _a;
|
|
6352
|
-
refs.setReference((_a = anchorRef == null ? void 0 : anchorRef.current) != null ? _a : null);
|
|
6353
|
-
}, []);
|
|
6354
|
-
if (!isOpen)
|
|
6355
|
-
return null;
|
|
6356
|
-
return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(
|
|
6357
|
-
PopoverContentContainer,
|
|
6358
|
-
{
|
|
6359
|
-
ref: combinedRef,
|
|
6360
|
-
style: styles.floating,
|
|
6361
|
-
onBlur: (e) => {
|
|
6362
|
-
const newFocus = e.relatedTarget;
|
|
6363
|
-
if (ref.current && !ref.current.contains(newFocus)) {
|
|
6364
|
-
onClose();
|
|
6365
|
-
}
|
|
6366
|
-
},
|
|
6367
|
-
children
|
|
6368
|
-
}
|
|
6369
|
-
);
|
|
6370
|
-
};
|
|
6372
|
+
var import_react46 = require("react");
|
|
6371
6373
|
|
|
6372
6374
|
// src/components/date-inputs/DatePicker/DateField/DateField.tsx
|
|
6373
6375
|
var import_date5 = require("@internationalized/date");
|
|
6374
6376
|
var import_datepicker2 = require("@react-aria/datepicker");
|
|
6375
6377
|
var import_datepicker3 = require("@react-stately/datepicker");
|
|
6376
|
-
var
|
|
6378
|
+
var import_react44 = require("react");
|
|
6377
6379
|
|
|
6378
6380
|
// src/components/date-inputs/DatePicker/DateField/CalendarButton.tsx
|
|
6379
6381
|
var import_button = require("@react-aria/button");
|
|
6380
|
-
var
|
|
6382
|
+
var import_react41 = require("react");
|
|
6381
6383
|
var import_styled_components37 = __toESM(require("styled-components"));
|
|
6382
6384
|
|
|
6383
6385
|
// src/components/date-inputs/DatePicker/DatePicker.tokens.ts
|
|
@@ -6515,7 +6517,7 @@ function CalendarButton({
|
|
|
6515
6517
|
componentSize,
|
|
6516
6518
|
...props
|
|
6517
6519
|
}) {
|
|
6518
|
-
const ref = (0,
|
|
6520
|
+
const ref = (0, import_react41.useRef)(null);
|
|
6519
6521
|
const { buttonProps } = (0, import_button.useButton)(props, ref);
|
|
6520
6522
|
return /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
6521
6523
|
StyledButton2,
|
|
@@ -6545,7 +6547,7 @@ function CalendarButton({
|
|
|
6545
6547
|
|
|
6546
6548
|
// src/components/date-inputs/DatePicker/DateField/DateSegment.tsx
|
|
6547
6549
|
var import_datepicker = require("@react-aria/datepicker");
|
|
6548
|
-
var
|
|
6550
|
+
var import_react42 = require("react");
|
|
6549
6551
|
var import_styled_components38 = __toESM(require("styled-components"));
|
|
6550
6552
|
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
6551
6553
|
var {
|
|
@@ -6594,7 +6596,7 @@ function DateSegment({
|
|
|
6594
6596
|
componentSize
|
|
6595
6597
|
}) {
|
|
6596
6598
|
var _a;
|
|
6597
|
-
const ref = (0,
|
|
6599
|
+
const ref = (0, import_react42.useRef)(null);
|
|
6598
6600
|
const { segmentProps } = (0, import_datepicker.useDateSegment)(segment2, state, ref);
|
|
6599
6601
|
return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(
|
|
6600
6602
|
Segment,
|
|
@@ -6629,7 +6631,7 @@ function DateSegment({
|
|
|
6629
6631
|
DateSegment.displayName = "DateSegment";
|
|
6630
6632
|
|
|
6631
6633
|
// src/components/date-inputs/common/DateInput.tsx
|
|
6632
|
-
var
|
|
6634
|
+
var import_react43 = require("react");
|
|
6633
6635
|
var import_styled_components39 = __toESM(require("styled-components"));
|
|
6634
6636
|
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
6635
6637
|
var InputDiv = (0, import_styled_components39.default)(StatefulInput)`
|
|
@@ -6709,7 +6711,7 @@ function _DateInput({
|
|
|
6709
6711
|
}
|
|
6710
6712
|
);
|
|
6711
6713
|
}
|
|
6712
|
-
var DateInput = (0,
|
|
6714
|
+
var DateInput = (0, import_react43.forwardRef)(_DateInput);
|
|
6713
6715
|
DateInput.displayName = "DateInput";
|
|
6714
6716
|
|
|
6715
6717
|
// src/components/date-inputs/DatePicker/DateField/DateField.tsx
|
|
@@ -6725,7 +6727,7 @@ function _DateField({
|
|
|
6725
6727
|
locale,
|
|
6726
6728
|
createCalendar: import_date5.createCalendar
|
|
6727
6729
|
});
|
|
6728
|
-
const ref = (0,
|
|
6730
|
+
const ref = (0, import_react44.useRef)(null);
|
|
6729
6731
|
const { labelProps, fieldProps } = (0, import_datepicker2.useDateField)(props, state, ref);
|
|
6730
6732
|
const disabled = props.isDisabled || !!fieldProps["aria-disabled"];
|
|
6731
6733
|
return /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(
|
|
@@ -6762,15 +6764,15 @@ function _DateField({
|
|
|
6762
6764
|
}
|
|
6763
6765
|
);
|
|
6764
6766
|
}
|
|
6765
|
-
var DateField = (0,
|
|
6767
|
+
var DateField = (0, import_react44.forwardRef)(_DateField);
|
|
6766
6768
|
DateField.displayName = "DateField";
|
|
6767
6769
|
|
|
6768
6770
|
// src/components/date-inputs/utils/useFocusManagerRef.ts
|
|
6769
6771
|
var import_focus = require("@react-aria/focus");
|
|
6770
|
-
var
|
|
6772
|
+
var import_react45 = require("react");
|
|
6771
6773
|
function useFocusManagerRef(ref) {
|
|
6772
|
-
const domRef = (0,
|
|
6773
|
-
(0,
|
|
6774
|
+
const domRef = (0, import_react45.useRef)(null);
|
|
6775
|
+
(0, import_react45.useImperativeHandle)(ref, () => ({
|
|
6774
6776
|
...createDOMRef(domRef),
|
|
6775
6777
|
focus() {
|
|
6776
6778
|
(0, import_focus.createFocusManager)(domRef).focusFirst({ tabbable: true });
|
|
@@ -6794,9 +6796,9 @@ var refIsFocusable = (ref) => {
|
|
|
6794
6796
|
function _DatePicker({ errorMessage, componentSize, tip, style, width, ...props }, forwardedRef) {
|
|
6795
6797
|
const state = (0, import_datepicker5.useDatePickerState)(props);
|
|
6796
6798
|
const domRef = useFocusManagerRef(
|
|
6797
|
-
refIsFocusable(
|
|
6799
|
+
refIsFocusable(import_react46.forwardRef) ? forwardedRef : null
|
|
6798
6800
|
);
|
|
6799
|
-
const ref = (0,
|
|
6801
|
+
const ref = (0, import_react46.useRef)(null);
|
|
6800
6802
|
const combinedRef = useCombinedRef(ref, domRef);
|
|
6801
6803
|
const { buttonProps, calendarProps, fieldProps, groupProps } = (0, import_datepicker4.useDatePicker)(
|
|
6802
6804
|
{ ...props, granularity: "day" },
|
|
@@ -6823,13 +6825,13 @@ function _DatePicker({ errorMessage, componentSize, tip, style, width, ...props
|
|
|
6823
6825
|
/* @__PURE__ */ (0, import_jsx_runtime200.jsx)(CalendarPopoverContent, { children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(Calendar, { ...calendarProps }) })
|
|
6824
6826
|
] });
|
|
6825
6827
|
}
|
|
6826
|
-
var DatePicker = (0,
|
|
6828
|
+
var DatePicker = (0, import_react46.forwardRef)(_DatePicker);
|
|
6827
6829
|
DatePicker.displayName = "DatePicker";
|
|
6828
6830
|
|
|
6829
6831
|
// src/components/date-inputs/TimePicker/TimePicker.tsx
|
|
6830
6832
|
var import_datepicker6 = require("@react-aria/datepicker");
|
|
6831
6833
|
var import_datepicker7 = require("@react-stately/datepicker");
|
|
6832
|
-
var
|
|
6834
|
+
var import_react47 = require("react");
|
|
6833
6835
|
var import_styled_components40 = __toESM(require("styled-components"));
|
|
6834
6836
|
var import_jsx_runtime201 = require("react/jsx-runtime");
|
|
6835
6837
|
var TimePickerIcon = (0, import_styled_components40.default)(Icon)`
|
|
@@ -6838,7 +6840,7 @@ var TimePickerIcon = (0, import_styled_components40.default)(Icon)`
|
|
|
6838
6840
|
margin-left: -1px; // To align with TextInputs icons
|
|
6839
6841
|
`;
|
|
6840
6842
|
function _TimePicker({ componentSize = "medium", width, ...props }, forwardedRef) {
|
|
6841
|
-
const ref = (0,
|
|
6843
|
+
const ref = (0, import_react47.useRef)(null);
|
|
6842
6844
|
const state = (0, import_datepicker7.useTimeFieldState)({
|
|
6843
6845
|
...props,
|
|
6844
6846
|
locale
|
|
@@ -6882,7 +6884,7 @@ function _TimePicker({ componentSize = "medium", width, ...props }, forwardedRef
|
|
|
6882
6884
|
}
|
|
6883
6885
|
);
|
|
6884
6886
|
}
|
|
6885
|
-
var TimePicker = (0,
|
|
6887
|
+
var TimePicker = (0, import_react47.forwardRef)(_TimePicker);
|
|
6886
6888
|
TimePicker.displayName = "TimePicker";
|
|
6887
6889
|
|
|
6888
6890
|
// src/components/date-inputs/utils/transform.ts
|
|
@@ -6915,7 +6917,7 @@ function calendarDateToNativeDate(date, time = new import_date6.Time(12, 0, 0, 0
|
|
|
6915
6917
|
}
|
|
6916
6918
|
|
|
6917
6919
|
// src/components/DescriptionList/DescriptionList.tsx
|
|
6918
|
-
var
|
|
6920
|
+
var import_react48 = require("react");
|
|
6919
6921
|
var import_styled_components41 = __toESM(require("styled-components"));
|
|
6920
6922
|
|
|
6921
6923
|
// src/components/DescriptionList/DescriptionList.tokens.tsx
|
|
@@ -6999,7 +7001,7 @@ var DList = import_styled_components41.default.dl.withConfig({
|
|
|
6999
7001
|
margin-top: ${list4.beforeNextTerm.marginTop};
|
|
7000
7002
|
}
|
|
7001
7003
|
`;
|
|
7002
|
-
var DescriptionList = (0,
|
|
7004
|
+
var DescriptionList = (0, import_react48.forwardRef)((props, ref) => {
|
|
7003
7005
|
const {
|
|
7004
7006
|
appearance = "bold",
|
|
7005
7007
|
direction = "column",
|
|
@@ -7020,11 +7022,11 @@ var DescriptionList = (0, import_react47.forwardRef)((props, ref) => {
|
|
|
7020
7022
|
DescriptionList.displayName = "DescriptionList";
|
|
7021
7023
|
|
|
7022
7024
|
// src/components/DescriptionList/DescriptionListTerm.tsx
|
|
7023
|
-
var
|
|
7025
|
+
var import_react49 = require("react");
|
|
7024
7026
|
var import_styled_components42 = __toESM(require("styled-components"));
|
|
7025
7027
|
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
7026
7028
|
var DListTerm = import_styled_components42.default.dt``;
|
|
7027
|
-
var DescriptionListTerm = (0,
|
|
7029
|
+
var DescriptionListTerm = (0, import_react49.forwardRef)(({ children, ...rest }, ref) => {
|
|
7028
7030
|
const dListTermProps = {
|
|
7029
7031
|
ref,
|
|
7030
7032
|
...rest
|
|
@@ -7034,7 +7036,7 @@ var DescriptionListTerm = (0, import_react48.forwardRef)(({ children, ...rest },
|
|
|
7034
7036
|
DescriptionListTerm.displayName = "DescriptionListTerm";
|
|
7035
7037
|
|
|
7036
7038
|
// src/components/DescriptionList/DescriptionListDesc.tsx
|
|
7037
|
-
var
|
|
7039
|
+
var import_react50 = require("react");
|
|
7038
7040
|
var import_styled_components43 = __toESM(require("styled-components"));
|
|
7039
7041
|
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
7040
7042
|
var DListDesc = import_styled_components43.default.dd`
|
|
@@ -7044,7 +7046,7 @@ var DListDesc = import_styled_components43.default.dd`
|
|
|
7044
7046
|
color: ${descriptionListTokens.desc.base.color};
|
|
7045
7047
|
gap: ${descriptionListTokens.desc.base.gap};
|
|
7046
7048
|
`;
|
|
7047
|
-
var DescriptionListDesc = (0,
|
|
7049
|
+
var DescriptionListDesc = (0, import_react50.forwardRef)((props, ref) => {
|
|
7048
7050
|
const { children, icon: icon11, id, className, htmlProps, ...rest } = props;
|
|
7049
7051
|
const dListDescProps = {
|
|
7050
7052
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -7060,7 +7062,7 @@ var DescriptionListDesc = (0, import_react49.forwardRef)((props, ref) => {
|
|
|
7060
7062
|
DescriptionListDesc.displayName = "DescriptionListDesc";
|
|
7061
7063
|
|
|
7062
7064
|
// src/components/DescriptionList/DescriptionListGroup.tsx
|
|
7063
|
-
var
|
|
7065
|
+
var import_react51 = require("react");
|
|
7064
7066
|
var import_styled_components44 = __toESM(require("styled-components"));
|
|
7065
7067
|
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
7066
7068
|
var DListGroup = import_styled_components44.default.div`
|
|
@@ -7068,7 +7070,7 @@ var DListGroup = import_styled_components44.default.div`
|
|
|
7068
7070
|
${({ minWidth }) => minWidth && `min-width: ${minWidth}`}
|
|
7069
7071
|
${({ maxWidth }) => maxWidth && `max-width: ${maxWidth}`}
|
|
7070
7072
|
`;
|
|
7071
|
-
var DescriptionListGroup = (0,
|
|
7073
|
+
var DescriptionListGroup = (0, import_react51.forwardRef)((props, ref) => {
|
|
7072
7074
|
const {
|
|
7073
7075
|
children,
|
|
7074
7076
|
margin,
|
|
@@ -7092,7 +7094,7 @@ var DescriptionListGroup = (0, import_react50.forwardRef)((props, ref) => {
|
|
|
7092
7094
|
DescriptionListGroup.displayName = "DescriptionListGroup";
|
|
7093
7095
|
|
|
7094
7096
|
// src/components/Drawer/Drawer.tsx
|
|
7095
|
-
var
|
|
7097
|
+
var import_react52 = require("react");
|
|
7096
7098
|
var import_react_dom2 = require("react-dom");
|
|
7097
7099
|
var import_styled_components45 = __toESM(require("styled-components"));
|
|
7098
7100
|
|
|
@@ -7182,7 +7184,7 @@ var HeaderContainer2 = import_styled_components45.default.div``;
|
|
|
7182
7184
|
var StyledButton3 = (0, import_styled_components45.default)(Button)`
|
|
7183
7185
|
align-self: flex-end;
|
|
7184
7186
|
`;
|
|
7185
|
-
var Drawer = (0,
|
|
7187
|
+
var Drawer = (0, import_react52.forwardRef)((props, ref) => {
|
|
7186
7188
|
const {
|
|
7187
7189
|
children,
|
|
7188
7190
|
onClose,
|
|
@@ -7197,7 +7199,7 @@ var Drawer = (0, import_react51.forwardRef)((props, ref) => {
|
|
|
7197
7199
|
htmlProps,
|
|
7198
7200
|
...rest
|
|
7199
7201
|
} = props;
|
|
7200
|
-
const generatedId = (0,
|
|
7202
|
+
const generatedId = (0, import_react52.useId)();
|
|
7201
7203
|
const uniqueId = id != null ? id : `${generatedId}-drawer`;
|
|
7202
7204
|
const hasHeader = !!header3;
|
|
7203
7205
|
const headerId = hasHeader ? `${uniqueId}-header` : void 0;
|
|
@@ -7259,7 +7261,7 @@ var Drawer = (0, import_react51.forwardRef)((props, ref) => {
|
|
|
7259
7261
|
Drawer.displayName = "Drawer";
|
|
7260
7262
|
|
|
7261
7263
|
// src/components/Drawer/DrawerGroup.tsx
|
|
7262
|
-
var
|
|
7264
|
+
var import_react53 = require("react");
|
|
7263
7265
|
var import_jsx_runtime207 = require("react/jsx-runtime");
|
|
7264
7266
|
var DrawerGroup = ({
|
|
7265
7267
|
children,
|
|
@@ -7267,10 +7269,10 @@ var DrawerGroup = ({
|
|
|
7267
7269
|
onOpen,
|
|
7268
7270
|
onClose
|
|
7269
7271
|
}) => {
|
|
7270
|
-
const generatedId = (0,
|
|
7272
|
+
const generatedId = (0, import_react53.useId)();
|
|
7271
7273
|
const uniqueDrawerId = drawerId != null ? drawerId : `${generatedId}-drawer`;
|
|
7272
|
-
const buttonRef = (0,
|
|
7273
|
-
const [closed, setClosed] = (0,
|
|
7274
|
+
const buttonRef = (0, import_react53.useRef)(null);
|
|
7275
|
+
const [closed, setClosed] = (0, import_react53.useState)(true);
|
|
7274
7276
|
const open = () => setClosed(false);
|
|
7275
7277
|
const close = () => setClosed(true);
|
|
7276
7278
|
const handleOpen = () => {
|
|
@@ -7281,14 +7283,14 @@ var DrawerGroup = ({
|
|
|
7281
7283
|
close();
|
|
7282
7284
|
onClose && onClose();
|
|
7283
7285
|
};
|
|
7284
|
-
const Children9 =
|
|
7285
|
-
return (0,
|
|
7286
|
+
const Children9 = import_react53.Children.map(children, (child, childIndex) => {
|
|
7287
|
+
return (0, import_react53.isValidElement)(child) && (childIndex === 0 ? (0, import_react53.cloneElement)(child, {
|
|
7286
7288
|
"aria-haspopup": "dialog",
|
|
7287
7289
|
"aria-controls": uniqueDrawerId,
|
|
7288
7290
|
"aria-expanded": !closed,
|
|
7289
7291
|
ref: buttonRef,
|
|
7290
7292
|
onClick: handleOpen
|
|
7291
|
-
}) : (0,
|
|
7293
|
+
}) : (0, import_react53.cloneElement)(child, {
|
|
7292
7294
|
id: uniqueDrawerId,
|
|
7293
7295
|
triggerRef: buttonRef,
|
|
7294
7296
|
isOpen: !closed,
|
|
@@ -7339,7 +7341,7 @@ function EmptyContent({
|
|
|
7339
7341
|
EmptyContent.displayName = "EmptyContent";
|
|
7340
7342
|
|
|
7341
7343
|
// src/components/FavStar/FavStar.tsx
|
|
7342
|
-
var
|
|
7344
|
+
var import_react56 = require("react");
|
|
7343
7345
|
var import_styled_components47 = __toESM(require("styled-components"));
|
|
7344
7346
|
|
|
7345
7347
|
// src/components/FavStar/FavStar.tokens.ts
|
|
@@ -7378,16 +7380,16 @@ function favStarTokens(size2, variant) {
|
|
|
7378
7380
|
}
|
|
7379
7381
|
|
|
7380
7382
|
// src/hooks/useControllableState.ts
|
|
7381
|
-
var
|
|
7383
|
+
var import_react55 = require("react");
|
|
7382
7384
|
|
|
7383
7385
|
// src/hooks/useCallbackRef.ts
|
|
7384
|
-
var
|
|
7386
|
+
var import_react54 = require("react");
|
|
7385
7387
|
function useCallbackRef(callback, deps = []) {
|
|
7386
|
-
const callbackRef = (0,
|
|
7387
|
-
(0,
|
|
7388
|
+
const callbackRef = (0, import_react54.useRef)(callback);
|
|
7389
|
+
(0, import_react54.useEffect)(() => {
|
|
7388
7390
|
callbackRef.current = callback;
|
|
7389
7391
|
});
|
|
7390
|
-
return (0,
|
|
7392
|
+
return (0, import_react54.useCallback)((...args) => {
|
|
7391
7393
|
var _a;
|
|
7392
7394
|
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
7393
7395
|
}, deps);
|
|
@@ -7397,7 +7399,7 @@ function useCallbackRef(callback, deps = []) {
|
|
|
7397
7399
|
function useControllableState(props) {
|
|
7398
7400
|
const { value: valueProp, defaultValue, onChange } = props;
|
|
7399
7401
|
const onChangeProp = useCallbackRef(onChange);
|
|
7400
|
-
const [uncontrolledState, setUncontrolledState] = (0,
|
|
7402
|
+
const [uncontrolledState, setUncontrolledState] = (0, import_react55.useState)(defaultValue);
|
|
7401
7403
|
const controlled = valueProp !== void 0;
|
|
7402
7404
|
const value = controlled ? valueProp : uncontrolledState;
|
|
7403
7405
|
const setValue = useCallbackRef(
|
|
@@ -7475,7 +7477,7 @@ function getVariantStyle(size2, variant) {
|
|
|
7475
7477
|
border-radius: ${favStarTokens(size2, variant).borderRadius};
|
|
7476
7478
|
`;
|
|
7477
7479
|
}
|
|
7478
|
-
var FavStar = (0,
|
|
7480
|
+
var FavStar = (0, import_react56.forwardRef)(
|
|
7479
7481
|
({
|
|
7480
7482
|
id,
|
|
7481
7483
|
className,
|
|
@@ -7493,7 +7495,7 @@ var FavStar = (0, import_react55.forwardRef)(
|
|
|
7493
7495
|
htmlProps,
|
|
7494
7496
|
rest
|
|
7495
7497
|
);
|
|
7496
|
-
const generatedId = (0,
|
|
7498
|
+
const generatedId = (0, import_react56.useId)();
|
|
7497
7499
|
const [checked, setChecked] = useControllableState({
|
|
7498
7500
|
value: checkedProp,
|
|
7499
7501
|
defaultValue: defaultChecked != null ? defaultChecked : false,
|
|
@@ -7536,14 +7538,14 @@ var FavStar = (0, import_react55.forwardRef)(
|
|
|
7536
7538
|
FavStar.displayName = "FavStar";
|
|
7537
7539
|
|
|
7538
7540
|
// src/components/Feedback/Feedback.tsx
|
|
7539
|
-
var
|
|
7541
|
+
var import_react60 = require("react");
|
|
7540
7542
|
|
|
7541
7543
|
// src/components/Feedback/CommentComponent.tsx
|
|
7542
7544
|
var import_dds_design_tokens36 = require("@norges-domstoler/dds-design-tokens");
|
|
7543
7545
|
var import_styled_components50 = __toESM(require("styled-components"));
|
|
7544
7546
|
|
|
7545
7547
|
// src/components/Stack/Stack.tsx
|
|
7546
|
-
var
|
|
7548
|
+
var import_react57 = require("react");
|
|
7547
7549
|
var import_styled_components48 = __toESM(require("styled-components"));
|
|
7548
7550
|
|
|
7549
7551
|
// src/components/Stack/Stack.tokens.tsx
|
|
@@ -7598,7 +7600,7 @@ Stack.defaultProps = {
|
|
|
7598
7600
|
align: "center",
|
|
7599
7601
|
justify: "flex-start"
|
|
7600
7602
|
};
|
|
7601
|
-
var HStack = (0,
|
|
7603
|
+
var HStack = (0, import_react57.forwardRef)(
|
|
7602
7604
|
({ id, className, htmlProps, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
7603
7605
|
Stack,
|
|
7604
7606
|
{
|
|
@@ -7609,7 +7611,7 @@ var HStack = (0, import_react56.forwardRef)(
|
|
|
7609
7611
|
)
|
|
7610
7612
|
);
|
|
7611
7613
|
HStack.displayName = "HStack";
|
|
7612
|
-
var VStack = (0,
|
|
7614
|
+
var VStack = (0, import_react57.forwardRef)(
|
|
7613
7615
|
({ id, className, htmlProps, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
7614
7616
|
Stack,
|
|
7615
7617
|
{
|
|
@@ -7622,7 +7624,7 @@ var VStack = (0, import_react56.forwardRef)(
|
|
|
7622
7624
|
VStack.displayName = "VStack";
|
|
7623
7625
|
|
|
7624
7626
|
// src/components/TextArea/TextArea.tsx
|
|
7625
|
-
var
|
|
7627
|
+
var import_react58 = require("react");
|
|
7626
7628
|
var import_styled_components49 = __toESM(require("styled-components"));
|
|
7627
7629
|
|
|
7628
7630
|
// src/components/TextArea/TextArea.tokens.tsx
|
|
@@ -7648,7 +7650,7 @@ var StyledTextArea = (0, import_styled_components49.default)(StatefulInput)`
|
|
|
7648
7650
|
padding-bottom: ${textarea2.paddingBottom};
|
|
7649
7651
|
${getFontStyling(inputTypographyTypes.medium)}
|
|
7650
7652
|
`;
|
|
7651
|
-
var TextArea = (0,
|
|
7653
|
+
var TextArea = (0, import_react58.forwardRef)(
|
|
7652
7654
|
(props, ref) => {
|
|
7653
7655
|
const {
|
|
7654
7656
|
id,
|
|
@@ -7667,14 +7669,14 @@ var TextArea = (0, import_react57.forwardRef)(
|
|
|
7667
7669
|
width = defaultWidth,
|
|
7668
7670
|
...rest
|
|
7669
7671
|
} = props;
|
|
7670
|
-
const generatedId = (0,
|
|
7672
|
+
const generatedId = (0, import_react58.useId)();
|
|
7671
7673
|
const uniqueId = id != null ? id : `${generatedId}-textArea`;
|
|
7672
|
-
const textAreaRef = (0,
|
|
7674
|
+
const textAreaRef = (0, import_react58.useRef)(null);
|
|
7673
7675
|
const multiRef = useCombinedRef(ref, textAreaRef);
|
|
7674
|
-
const [text, setText] = (0,
|
|
7676
|
+
const [text, setText] = (0, import_react58.useState)(
|
|
7675
7677
|
getDefaultText(value, defaultValue)
|
|
7676
7678
|
);
|
|
7677
|
-
(0,
|
|
7679
|
+
(0, import_react58.useEffect)(() => {
|
|
7678
7680
|
if (textAreaRef == null ? void 0 : textAreaRef.current) {
|
|
7679
7681
|
textAreaRef.current.style.height = `${textAreaRef.current.scrollHeight + 2}px`;
|
|
7680
7682
|
}
|
|
@@ -7780,7 +7782,7 @@ var import_dds_design_tokens38 = require("@norges-domstoler/dds-design-tokens");
|
|
|
7780
7782
|
var import_styled_components52 = __toESM(require("styled-components"));
|
|
7781
7783
|
|
|
7782
7784
|
// src/components/Tooltip/Tooltip.tsx
|
|
7783
|
-
var
|
|
7785
|
+
var import_react59 = require("react");
|
|
7784
7786
|
|
|
7785
7787
|
// src/components/Tooltip/Tooltip.styles.tsx
|
|
7786
7788
|
var import_styled_components51 = __toESM(require("styled-components"));
|
|
@@ -7827,7 +7829,7 @@ var TooltipWrapper = (0, import_styled_components51.default)(Paper)`
|
|
|
7827
7829
|
// src/components/Tooltip/Tooltip.tsx
|
|
7828
7830
|
var import_jsx_runtime213 = require("react/jsx-runtime");
|
|
7829
7831
|
var { svgArrow: svgArrow2 } = tooltipTokens;
|
|
7830
|
-
var Tooltip = (0,
|
|
7832
|
+
var Tooltip = (0, import_react59.forwardRef)(
|
|
7831
7833
|
(props, ref) => {
|
|
7832
7834
|
const {
|
|
7833
7835
|
text,
|
|
@@ -7843,21 +7845,21 @@ var Tooltip = (0, import_react58.forwardRef)(
|
|
|
7843
7845
|
htmlProps,
|
|
7844
7846
|
...rest
|
|
7845
7847
|
} = props;
|
|
7846
|
-
const generatedId = (0,
|
|
7848
|
+
const generatedId = (0, import_react59.useId)();
|
|
7847
7849
|
const uniqueTooltipId = tooltipId != null ? tooltipId : `${generatedId}-tooltip`;
|
|
7848
|
-
const [open, setOpen] = (0,
|
|
7849
|
-
const [inView, setInView] = (0,
|
|
7850
|
-
const [arrowElement, setArrowElement] = (0,
|
|
7850
|
+
const [open, setOpen] = (0, import_react59.useState)(false);
|
|
7851
|
+
const [inView, setInView] = (0, import_react59.useState)(false);
|
|
7852
|
+
const [arrowElement, setArrowElement] = (0, import_react59.useState)(null);
|
|
7851
7853
|
const { refs, styles } = useFloatPosition(arrowElement, {
|
|
7852
7854
|
placement
|
|
7853
7855
|
});
|
|
7854
|
-
const tooltipRef = (0,
|
|
7856
|
+
const tooltipRef = (0, import_react59.useRef)(null);
|
|
7855
7857
|
const combinedRef = useCombinedRef(ref, refs.setFloating, tooltipRef);
|
|
7856
7858
|
const closeWhenNotInView = (entries) => {
|
|
7857
7859
|
const [entry] = entries;
|
|
7858
7860
|
entry.isIntersecting ? setInView(true) : setInView(false);
|
|
7859
7861
|
};
|
|
7860
|
-
(0,
|
|
7862
|
+
(0, import_react59.useEffect)(() => {
|
|
7861
7863
|
const options = {
|
|
7862
7864
|
root: null,
|
|
7863
7865
|
rootMargin: "0px"
|
|
@@ -7871,7 +7873,7 @@ var Tooltip = (0, import_react58.forwardRef)(
|
|
|
7871
7873
|
observer.unobserve(ref2);
|
|
7872
7874
|
};
|
|
7873
7875
|
}, [tooltipRef]);
|
|
7874
|
-
(0,
|
|
7876
|
+
(0, import_react59.useEffect)(() => {
|
|
7875
7877
|
if (tooltipRef.current) {
|
|
7876
7878
|
window.addEventListener("scroll", () => {
|
|
7877
7879
|
closeTooltip();
|
|
@@ -7884,7 +7886,7 @@ var Tooltip = (0, import_react58.forwardRef)(
|
|
|
7884
7886
|
};
|
|
7885
7887
|
}, []);
|
|
7886
7888
|
let timer;
|
|
7887
|
-
(0,
|
|
7889
|
+
(0, import_react59.useEffect)(() => {
|
|
7888
7890
|
return () => {
|
|
7889
7891
|
clearTimeout(timer);
|
|
7890
7892
|
};
|
|
@@ -7904,8 +7906,8 @@ var Tooltip = (0, import_react58.forwardRef)(
|
|
|
7904
7906
|
}
|
|
7905
7907
|
};
|
|
7906
7908
|
const anchorProps = children.props;
|
|
7907
|
-
const anchorElement =
|
|
7908
|
-
(0,
|
|
7909
|
+
const anchorElement = import_react59.Children.only(
|
|
7910
|
+
(0, import_react59.isValidElement)(children) && (0, import_react59.cloneElement)(children, {
|
|
7909
7911
|
ref: refs.setReference,
|
|
7910
7912
|
onFocus: combineHandlers(openTooltip, anchorProps.onFocus),
|
|
7911
7913
|
onBlur: combineHandlers(closeTooltip, anchorProps.onBlur),
|
|
@@ -8027,16 +8029,16 @@ var Feedback = ({
|
|
|
8027
8029
|
onFeedbackTextChange,
|
|
8028
8030
|
onSubmit
|
|
8029
8031
|
}) => {
|
|
8030
|
-
const [rating, setRating] = (0,
|
|
8031
|
-
const [feedbackText, setFeedbackText] = (0,
|
|
8032
|
-
const [isFeedbackSubmitted, setIsFeedbackSubmitted] = (0,
|
|
8033
|
-
(0,
|
|
8032
|
+
const [rating, setRating] = (0, import_react60.useState)(null);
|
|
8033
|
+
const [feedbackText, setFeedbackText] = (0, import_react60.useState)();
|
|
8034
|
+
const [isFeedbackSubmitted, setIsFeedbackSubmitted] = (0, import_react60.useState)(false);
|
|
8035
|
+
(0, import_react60.useEffect)(() => {
|
|
8034
8036
|
ratingProp !== void 0 && setRating(ratingProp);
|
|
8035
8037
|
}, [ratingProp]);
|
|
8036
|
-
(0,
|
|
8038
|
+
(0, import_react60.useEffect)(() => {
|
|
8037
8039
|
feedbackTextProp !== void 0 && setFeedbackText(feedbackTextProp);
|
|
8038
8040
|
}, [feedbackTextProp]);
|
|
8039
|
-
(0,
|
|
8041
|
+
(0, import_react60.useEffect)(() => {
|
|
8040
8042
|
isSubmittedProp !== void 0 && setIsFeedbackSubmitted(isSubmittedProp);
|
|
8041
8043
|
}, [isSubmittedProp]);
|
|
8042
8044
|
const handleRatingChange = (newRating) => {
|
|
@@ -8084,7 +8086,7 @@ var Feedback = ({
|
|
|
8084
8086
|
};
|
|
8085
8087
|
|
|
8086
8088
|
// src/components/FileUploader/FileUploader.tsx
|
|
8087
|
-
var
|
|
8089
|
+
var import_react62 = require("react");
|
|
8088
8090
|
var import_styled_components56 = __toESM(require("styled-components"));
|
|
8089
8091
|
|
|
8090
8092
|
// src/components/FileUploader/ErrorList.tsx
|
|
@@ -8204,7 +8206,7 @@ var File = (props) => {
|
|
|
8204
8206
|
|
|
8205
8207
|
// src/components/FileUploader/useFileUploader.ts
|
|
8206
8208
|
var import_file_selector = require("file-selector");
|
|
8207
|
-
var
|
|
8209
|
+
var import_react61 = require("react");
|
|
8208
8210
|
|
|
8209
8211
|
// src/components/FileUploader/fileUploaderReducer.ts
|
|
8210
8212
|
var fileUploaderReducer = (state, action) => {
|
|
@@ -8241,8 +8243,27 @@ var fileUploaderReducer = (state, action) => {
|
|
|
8241
8243
|
}
|
|
8242
8244
|
};
|
|
8243
8245
|
|
|
8246
|
+
// src/components/FileUploader/attr-accept.ts
|
|
8247
|
+
function isAccepted(file, acceptedFiles) {
|
|
8248
|
+
if (file && acceptedFiles) {
|
|
8249
|
+
const acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(",");
|
|
8250
|
+
const fileName = file.name || "";
|
|
8251
|
+
const mimeType = (file.type || "").toLowerCase();
|
|
8252
|
+
const baseMimeType = mimeType.replace(/\/.*$/, "");
|
|
8253
|
+
return acceptedFilesArray.some((type) => {
|
|
8254
|
+
const validType = type.trim().toLowerCase();
|
|
8255
|
+
if (validType.charAt(0) === ".") {
|
|
8256
|
+
return fileName.toLowerCase().endsWith(validType);
|
|
8257
|
+
} else if (validType.endsWith("/*")) {
|
|
8258
|
+
return baseMimeType === validType.replace(/\/.*$/, "");
|
|
8259
|
+
}
|
|
8260
|
+
return mimeType === validType;
|
|
8261
|
+
});
|
|
8262
|
+
}
|
|
8263
|
+
return true;
|
|
8264
|
+
}
|
|
8265
|
+
|
|
8244
8266
|
// src/components/FileUploader/utils.ts
|
|
8245
|
-
var import_attr_accept = __toESM(require("attr-accept"));
|
|
8246
8267
|
var preventDefaults = (event) => {
|
|
8247
8268
|
event.preventDefault();
|
|
8248
8269
|
event.stopPropagation();
|
|
@@ -8258,7 +8279,7 @@ var isEventWithFiles = (event) => {
|
|
|
8258
8279
|
return event.dataTransfer.types.includes("Files") || event.dataTransfer.types.includes("application/x-moz-file");
|
|
8259
8280
|
};
|
|
8260
8281
|
var isFileAccepted = (file, accept) => {
|
|
8261
|
-
return accept !== void 0 ? (
|
|
8282
|
+
return accept !== void 0 ? isAccepted(file, accept) : true;
|
|
8262
8283
|
};
|
|
8263
8284
|
var getTooManyFilesErrorMessage = (maxFiles) => `For mange filer, maks ${maxFiles}stk`;
|
|
8264
8285
|
var getInvalidFileTypeErrorMessage = () => "Ugyldig filtype";
|
|
@@ -8284,18 +8305,18 @@ var useFileUploader = (props) => {
|
|
|
8284
8305
|
disabled,
|
|
8285
8306
|
errorMessage
|
|
8286
8307
|
} = props;
|
|
8287
|
-
const rootRef = (0,
|
|
8288
|
-
const inputRef = (0,
|
|
8289
|
-
const buttonRef = (0,
|
|
8308
|
+
const rootRef = (0, import_react61.useRef)(null);
|
|
8309
|
+
const inputRef = (0, import_react61.useRef)(null);
|
|
8310
|
+
const buttonRef = (0, import_react61.useRef)(null);
|
|
8290
8311
|
const isControlled = !!value;
|
|
8291
|
-
const initialFileUploaderFiles = (0,
|
|
8312
|
+
const initialFileUploaderFiles = (0, import_react61.useMemo)(
|
|
8292
8313
|
() => (initialFiles != null ? initialFiles : []).map((f) => ({
|
|
8293
8314
|
file: f,
|
|
8294
8315
|
errors: []
|
|
8295
8316
|
})),
|
|
8296
8317
|
[initialFiles]
|
|
8297
8318
|
);
|
|
8298
|
-
const [state, dispatch] = (0,
|
|
8319
|
+
const [state, dispatch] = (0, import_react61.useReducer)(fileUploaderReducer, {
|
|
8299
8320
|
files: initialFileUploaderFiles,
|
|
8300
8321
|
isFocused: false,
|
|
8301
8322
|
isFileDialogActive: false,
|
|
@@ -8307,13 +8328,13 @@ var useFileUploader = (props) => {
|
|
|
8307
8328
|
)
|
|
8308
8329
|
});
|
|
8309
8330
|
const { files: stateFiles } = state;
|
|
8310
|
-
(0,
|
|
8331
|
+
(0, import_react61.useEffect)(() => {
|
|
8311
8332
|
if (isControlled) {
|
|
8312
8333
|
const files = value.map((file) => {
|
|
8313
|
-
const
|
|
8334
|
+
const accepted = isFileAccepted(file, accept);
|
|
8314
8335
|
return {
|
|
8315
8336
|
file,
|
|
8316
|
-
errors:
|
|
8337
|
+
errors: accepted ? [] : [getInvalidFileTypeErrorMessage()]
|
|
8317
8338
|
};
|
|
8318
8339
|
});
|
|
8319
8340
|
dispatch({
|
|
@@ -8322,18 +8343,18 @@ var useFileUploader = (props) => {
|
|
|
8322
8343
|
});
|
|
8323
8344
|
}
|
|
8324
8345
|
}, [value, isControlled, accept, dispatch]);
|
|
8325
|
-
(0,
|
|
8346
|
+
(0, import_react61.useEffect)(() => {
|
|
8326
8347
|
dispatch({
|
|
8327
8348
|
type: "setRootErrors",
|
|
8328
8349
|
payload: calcRootErrors(stateFiles, maxFiles, errorMessage)
|
|
8329
8350
|
});
|
|
8330
8351
|
}, [dispatch, stateFiles, maxFiles, errorMessage]);
|
|
8331
|
-
const onRootFocus = (0,
|
|
8352
|
+
const onRootFocus = (0, import_react61.useCallback)(
|
|
8332
8353
|
() => dispatch({ type: "focus" }),
|
|
8333
8354
|
[dispatch]
|
|
8334
8355
|
);
|
|
8335
|
-
const onRootBlur = (0,
|
|
8336
|
-
const onRootDragEnter = (0,
|
|
8356
|
+
const onRootBlur = (0, import_react61.useCallback)(() => dispatch({ type: "blur" }), [dispatch]);
|
|
8357
|
+
const onRootDragEnter = (0, import_react61.useCallback)(
|
|
8337
8358
|
async (evt) => {
|
|
8338
8359
|
preventDefaults(evt);
|
|
8339
8360
|
if (isEventWithFiles(evt)) {
|
|
@@ -8346,7 +8367,7 @@ var useFileUploader = (props) => {
|
|
|
8346
8367
|
},
|
|
8347
8368
|
[dispatch, accept, maxFiles]
|
|
8348
8369
|
);
|
|
8349
|
-
const onRootDragOver = (0,
|
|
8370
|
+
const onRootDragOver = (0, import_react61.useCallback)((evt) => {
|
|
8350
8371
|
preventDefaults(evt);
|
|
8351
8372
|
const hasFiles = isEventWithFiles(evt);
|
|
8352
8373
|
if (hasFiles && evt.dataTransfer) {
|
|
@@ -8356,7 +8377,7 @@ var useFileUploader = (props) => {
|
|
|
8356
8377
|
}
|
|
8357
8378
|
}
|
|
8358
8379
|
}, []);
|
|
8359
|
-
const onRootDragLeave = (0,
|
|
8380
|
+
const onRootDragLeave = (0, import_react61.useCallback)(
|
|
8360
8381
|
(evt) => {
|
|
8361
8382
|
preventDefaults(evt);
|
|
8362
8383
|
if (evt.currentTarget.contains(evt.relatedTarget))
|
|
@@ -8365,7 +8386,7 @@ var useFileUploader = (props) => {
|
|
|
8365
8386
|
},
|
|
8366
8387
|
[dispatch]
|
|
8367
8388
|
);
|
|
8368
|
-
const setFiles = (0,
|
|
8389
|
+
const setFiles = (0, import_react61.useCallback)(
|
|
8369
8390
|
async (evt) => {
|
|
8370
8391
|
evt.preventDefault();
|
|
8371
8392
|
if (isEventWithFiles(evt)) {
|
|
@@ -8374,10 +8395,10 @@ var useFileUploader = (props) => {
|
|
|
8374
8395
|
evt
|
|
8375
8396
|
);
|
|
8376
8397
|
const newFiles = filesFromEvent.filter((f) => !existingFileNames.includes(f.name)).map((file) => {
|
|
8377
|
-
const
|
|
8398
|
+
const accepted = isFileAccepted(file, accept);
|
|
8378
8399
|
return {
|
|
8379
8400
|
file,
|
|
8380
|
-
errors:
|
|
8401
|
+
errors: accepted ? [] : [getInvalidFileTypeErrorMessage()]
|
|
8381
8402
|
};
|
|
8382
8403
|
}).concat(stateFiles);
|
|
8383
8404
|
onChange(newFiles.map((f) => f.file));
|
|
@@ -8399,13 +8420,13 @@ var useFileUploader = (props) => {
|
|
|
8399
8420
|
dispatch
|
|
8400
8421
|
]
|
|
8401
8422
|
);
|
|
8402
|
-
const openFileDialog = (0,
|
|
8423
|
+
const openFileDialog = (0, import_react61.useCallback)(() => {
|
|
8403
8424
|
if (inputRef.current) {
|
|
8404
8425
|
inputRef.current.value = "";
|
|
8405
8426
|
inputRef.current.click();
|
|
8406
8427
|
}
|
|
8407
8428
|
}, [inputRef]);
|
|
8408
|
-
const removeFile = (0,
|
|
8429
|
+
const removeFile = (0, import_react61.useCallback)(
|
|
8409
8430
|
(file) => {
|
|
8410
8431
|
const newFiles = [...stateFiles];
|
|
8411
8432
|
newFiles.splice(stateFiles.indexOf(file), 1);
|
|
@@ -8419,7 +8440,7 @@ var useFileUploader = (props) => {
|
|
|
8419
8440
|
},
|
|
8420
8441
|
[stateFiles, isControlled, maxFiles, errorMessage, onChange, dispatch]
|
|
8421
8442
|
);
|
|
8422
|
-
const getRootProps = (0,
|
|
8443
|
+
const getRootProps = (0, import_react61.useCallback)(
|
|
8423
8444
|
() => ({
|
|
8424
8445
|
onBlur: onRootBlur,
|
|
8425
8446
|
onFocus: onRootFocus,
|
|
@@ -8441,14 +8462,14 @@ var useFileUploader = (props) => {
|
|
|
8441
8462
|
disabled
|
|
8442
8463
|
]
|
|
8443
8464
|
);
|
|
8444
|
-
const getButtonProps = (0,
|
|
8465
|
+
const getButtonProps = (0, import_react61.useCallback)(
|
|
8445
8466
|
() => ({
|
|
8446
8467
|
onClick: openFileDialog,
|
|
8447
8468
|
ref: buttonRef
|
|
8448
8469
|
}),
|
|
8449
8470
|
[openFileDialog, buttonRef]
|
|
8450
8471
|
);
|
|
8451
|
-
const getInputProps = (0,
|
|
8472
|
+
const getInputProps = (0, import_react61.useCallback)(
|
|
8452
8473
|
() => ({
|
|
8453
8474
|
type: "file",
|
|
8454
8475
|
style: { display: "none" },
|
|
@@ -8537,7 +8558,7 @@ var FileUploader = (props) => {
|
|
|
8537
8558
|
width,
|
|
8538
8559
|
errorMessage
|
|
8539
8560
|
} = props;
|
|
8540
|
-
const generatedId = (0,
|
|
8561
|
+
const generatedId = (0, import_react62.useId)();
|
|
8541
8562
|
const uniqueId = id != null ? id : `${generatedId}-fileUploader`;
|
|
8542
8563
|
const {
|
|
8543
8564
|
state: { files: stateFiles, isDragActive, rootErrors },
|
|
@@ -8605,7 +8626,13 @@ var FileUploader = (props) => {
|
|
|
8605
8626
|
$isDragActive: isDragActive,
|
|
8606
8627
|
$hasRootErrors: hasRootErrors,
|
|
8607
8628
|
children: [
|
|
8608
|
-
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
8629
|
+
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)(
|
|
8630
|
+
FileUploaderInput,
|
|
8631
|
+
{
|
|
8632
|
+
...getInputProps(),
|
|
8633
|
+
"data-testid": "file-uploader-input"
|
|
8634
|
+
}
|
|
8635
|
+
),
|
|
8609
8636
|
"Dra og slipp filer her eller",
|
|
8610
8637
|
" ",
|
|
8611
8638
|
/* @__PURE__ */ (0, import_jsx_runtime219.jsx)(VisuallyHidden, { as: "span", children: "velg fil med p\xE5f\xF8lgende knapp" }),
|
|
@@ -8623,7 +8650,7 @@ var FileUploader = (props) => {
|
|
|
8623
8650
|
FileUploader.displayName = "FileUploader";
|
|
8624
8651
|
|
|
8625
8652
|
// src/components/GlobalMessage/GlobalMessage.tsx
|
|
8626
|
-
var
|
|
8653
|
+
var import_react63 = require("react");
|
|
8627
8654
|
var import_styled_components57 = __toESM(require("styled-components"));
|
|
8628
8655
|
|
|
8629
8656
|
// src/components/GlobalMessage/GlobalMessage.tokens.tsx
|
|
@@ -8717,7 +8744,7 @@ var ContentContainer2 = import_styled_components57.default.div`
|
|
|
8717
8744
|
padding-bottom: ${contentContainer4.paddingBottom};
|
|
8718
8745
|
padding-right: ${({ $closable }) => $closable ? contentContainer4.withClosable.paddingRight : contentContainer4.paddingRight};
|
|
8719
8746
|
`;
|
|
8720
|
-
var GlobalMessage = (0,
|
|
8747
|
+
var GlobalMessage = (0, import_react63.forwardRef)(
|
|
8721
8748
|
(props, ref) => {
|
|
8722
8749
|
const {
|
|
8723
8750
|
message: message2,
|
|
@@ -8730,7 +8757,7 @@ var GlobalMessage = (0, import_react62.forwardRef)(
|
|
|
8730
8757
|
htmlProps,
|
|
8731
8758
|
...rest
|
|
8732
8759
|
} = props;
|
|
8733
|
-
const [isClosed, setClosed] = (0,
|
|
8760
|
+
const [isClosed, setClosed] = (0, import_react63.useState)(false);
|
|
8734
8761
|
return !isClosed ? /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)(
|
|
8735
8762
|
Container7,
|
|
8736
8763
|
{
|
|
@@ -8773,12 +8800,12 @@ GlobalMessage.displayName = "GlobalMessage";
|
|
|
8773
8800
|
var import_styled_components58 = __toESM(require("styled-components"));
|
|
8774
8801
|
|
|
8775
8802
|
// src/components/Grid/Grid.context.tsx
|
|
8776
|
-
var
|
|
8777
|
-
var GridContext = (0,
|
|
8803
|
+
var import_react64 = require("react");
|
|
8804
|
+
var GridContext = (0, import_react64.createContext)({
|
|
8778
8805
|
screenSize: 3 /* Large */
|
|
8779
8806
|
});
|
|
8780
8807
|
var useGridContext = () => {
|
|
8781
|
-
return (0,
|
|
8808
|
+
return (0, import_react64.useContext)(GridContext);
|
|
8782
8809
|
};
|
|
8783
8810
|
|
|
8784
8811
|
// src/components/Grid/Grid.tokens.tsx
|
|
@@ -8966,10 +8993,10 @@ var GridChild = (props) => {
|
|
|
8966
8993
|
GridChild.displayName = "GridChild";
|
|
8967
8994
|
|
|
8968
8995
|
// src/components/InlineEdit/InlineEditTextArea.tsx
|
|
8969
|
-
var
|
|
8996
|
+
var import_react67 = require("react");
|
|
8970
8997
|
|
|
8971
8998
|
// src/components/InlineEdit/InlineEdit.tsx
|
|
8972
|
-
var
|
|
8999
|
+
var import_react65 = require("react");
|
|
8973
9000
|
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
8974
9001
|
var InlineEdit = (props) => {
|
|
8975
9002
|
const {
|
|
@@ -8982,8 +9009,8 @@ var InlineEdit = (props) => {
|
|
|
8982
9009
|
inputRef,
|
|
8983
9010
|
children
|
|
8984
9011
|
} = props;
|
|
8985
|
-
const [editingValue, setEditingValue] = (0,
|
|
8986
|
-
const [isEditing, setIsEditing] = (0,
|
|
9012
|
+
const [editingValue, setEditingValue] = (0, import_react65.useState)(value != null ? value : "");
|
|
9013
|
+
const [isEditing, setIsEditing] = (0, import_react65.useState)(false);
|
|
8987
9014
|
const onChangeHandler = (e) => {
|
|
8988
9015
|
setEditingValue(e.target.value);
|
|
8989
9016
|
onChange && onChange();
|
|
@@ -9010,8 +9037,8 @@ var InlineEdit = (props) => {
|
|
|
9010
9037
|
useOnKeyDown(["Enter"], () => onExitHandler());
|
|
9011
9038
|
useOnKeyDown(["Escape"], () => onExitHandler());
|
|
9012
9039
|
useOnClickOutside(inputRef.current, () => onExitHandler());
|
|
9013
|
-
const inputChild =
|
|
9014
|
-
(0,
|
|
9040
|
+
const inputChild = import_react65.Children.only(
|
|
9041
|
+
(0, import_react65.isValidElement)(children) && (0, import_react65.cloneElement)(children, {
|
|
9015
9042
|
onChange: onChangeHandler,
|
|
9016
9043
|
onBlur: onBlurHandler,
|
|
9017
9044
|
onFocus: onFocusHandler,
|
|
@@ -9025,7 +9052,7 @@ var InlineEdit = (props) => {
|
|
|
9025
9052
|
InlineEdit.displayName = "InlineEdit";
|
|
9026
9053
|
|
|
9027
9054
|
// src/components/InlineEdit/InlineTextArea.tsx
|
|
9028
|
-
var
|
|
9055
|
+
var import_react66 = require("react");
|
|
9029
9056
|
|
|
9030
9057
|
// src/components/InlineEdit/InlineEdit.styles.tsx
|
|
9031
9058
|
var import_styled_components60 = __toESM(require("styled-components"));
|
|
@@ -9106,7 +9133,7 @@ var inlineEditVisuallyHidden = (id, emptiable) => /* @__PURE__ */ (0, import_jsx
|
|
|
9106
9133
|
|
|
9107
9134
|
// src/components/InlineEdit/InlineTextArea.tsx
|
|
9108
9135
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9109
|
-
var InlineTextArea = (0,
|
|
9136
|
+
var InlineTextArea = (0, import_react66.forwardRef)((props, ref) => {
|
|
9110
9137
|
const {
|
|
9111
9138
|
id,
|
|
9112
9139
|
error,
|
|
@@ -9118,12 +9145,12 @@ var InlineTextArea = (0, import_react65.forwardRef)((props, ref) => {
|
|
|
9118
9145
|
hideIcon,
|
|
9119
9146
|
...rest
|
|
9120
9147
|
} = props;
|
|
9121
|
-
const genereatedId = (0,
|
|
9148
|
+
const genereatedId = (0, import_react66.useId)();
|
|
9122
9149
|
const uniqueId = id != null ? id : `${genereatedId}-InlineTextArea`;
|
|
9123
9150
|
const hasErrorMessage = !!errorMessage;
|
|
9124
9151
|
const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
|
|
9125
9152
|
const descId = derivativeIdGenerator(uniqueId, "desc");
|
|
9126
|
-
const inputRef = (0,
|
|
9153
|
+
const inputRef = (0, import_react66.useRef)(null);
|
|
9127
9154
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
9128
9155
|
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(OuterInputContainer, { $width: width, children: [
|
|
9129
9156
|
/* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(InputContainer, { children: [
|
|
@@ -9162,9 +9189,9 @@ InlineTextArea.displayName = "InlineTextArea";
|
|
|
9162
9189
|
|
|
9163
9190
|
// src/components/InlineEdit/InlineEditTextArea.tsx
|
|
9164
9191
|
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
9165
|
-
var InlineEditTextArea = (0,
|
|
9192
|
+
var InlineEditTextArea = (0, import_react67.forwardRef)((props, ref) => {
|
|
9166
9193
|
const { onSetValue, emptiable, value, onFocus, onChange, onBlur, ...rest } = props;
|
|
9167
|
-
const textareaRef = (0,
|
|
9194
|
+
const textareaRef = (0, import_react67.useRef)(null);
|
|
9168
9195
|
const combinedRef = useCombinedRef(ref, textareaRef);
|
|
9169
9196
|
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
9170
9197
|
InlineEdit,
|
|
@@ -9182,12 +9209,12 @@ var InlineEditTextArea = (0, import_react66.forwardRef)((props, ref) => {
|
|
|
9182
9209
|
});
|
|
9183
9210
|
|
|
9184
9211
|
// src/components/InlineEdit/InlineEditInput.tsx
|
|
9185
|
-
var
|
|
9212
|
+
var import_react69 = require("react");
|
|
9186
9213
|
|
|
9187
9214
|
// src/components/InlineEdit/InlineInput.tsx
|
|
9188
|
-
var
|
|
9215
|
+
var import_react68 = require("react");
|
|
9189
9216
|
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
9190
|
-
var InlineInput = (0,
|
|
9217
|
+
var InlineInput = (0, import_react68.forwardRef)(
|
|
9191
9218
|
(props, ref) => {
|
|
9192
9219
|
const {
|
|
9193
9220
|
id,
|
|
@@ -9200,14 +9227,14 @@ var InlineInput = (0, import_react67.forwardRef)(
|
|
|
9200
9227
|
hideIcon,
|
|
9201
9228
|
...rest
|
|
9202
9229
|
} = props;
|
|
9203
|
-
const genereatedId = (0,
|
|
9230
|
+
const genereatedId = (0, import_react68.useId)();
|
|
9204
9231
|
const uniqueId = id != null ? id : `${genereatedId}-InlineInput`;
|
|
9205
9232
|
const hasErrorMessage = !!errorMessage;
|
|
9206
9233
|
const hasError = !!error;
|
|
9207
9234
|
const hasErrorState = hasError || hasErrorMessage;
|
|
9208
9235
|
const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
|
|
9209
9236
|
const descId = derivativeIdGenerator(uniqueId, "desc");
|
|
9210
|
-
const inputRef = (0,
|
|
9237
|
+
const inputRef = (0, import_react68.useRef)(null);
|
|
9211
9238
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
9212
9239
|
return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(OuterInputContainer, { $width: width, children: [
|
|
9213
9240
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(InputContainer, { children: [
|
|
@@ -9248,9 +9275,9 @@ InlineInput.displayName = "InlineInput";
|
|
|
9248
9275
|
|
|
9249
9276
|
// src/components/InlineEdit/InlineEditInput.tsx
|
|
9250
9277
|
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
9251
|
-
var InlineEditInput = (0,
|
|
9278
|
+
var InlineEditInput = (0, import_react69.forwardRef)((props, ref) => {
|
|
9252
9279
|
const { onSetValue, emptiable, value, onFocus, onChange, onBlur, ...rest } = props;
|
|
9253
|
-
const inputRef = (0,
|
|
9280
|
+
const inputRef = (0, import_react69.useRef)(null);
|
|
9254
9281
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
9255
9282
|
return /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
9256
9283
|
InlineEdit,
|
|
@@ -9268,7 +9295,7 @@ var InlineEditInput = (0, import_react68.forwardRef)((props, ref) => {
|
|
|
9268
9295
|
});
|
|
9269
9296
|
|
|
9270
9297
|
// src/components/InternalHeader/InternalHeader.tsx
|
|
9271
|
-
var
|
|
9298
|
+
var import_react71 = require("react");
|
|
9272
9299
|
|
|
9273
9300
|
// src/components/InternalHeader/InternalHeader.styles.tsx
|
|
9274
9301
|
var import_styled_components61 = __toESM(require("styled-components"));
|
|
@@ -9353,7 +9380,7 @@ var NavLi = import_styled_components61.default.li`
|
|
|
9353
9380
|
`;
|
|
9354
9381
|
|
|
9355
9382
|
// src/components/InternalHeader/NavigationItem.tsx
|
|
9356
|
-
var
|
|
9383
|
+
var import_react70 = require("react");
|
|
9357
9384
|
var import_styled_components62 = __toESM(require("styled-components"));
|
|
9358
9385
|
|
|
9359
9386
|
// src/components/InternalHeader/NavigationItem.tokens.ts
|
|
@@ -9423,7 +9450,7 @@ var Link3 = import_styled_components62.default.a`
|
|
|
9423
9450
|
transition: background-color 0.2s;
|
|
9424
9451
|
}
|
|
9425
9452
|
`;
|
|
9426
|
-
var NavigationItem2 = (0,
|
|
9453
|
+
var NavigationItem2 = (0, import_react70.forwardRef)(({ title: title3, isCurrent, ...rest }, ref) => {
|
|
9427
9454
|
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
9428
9455
|
Link3,
|
|
9429
9456
|
{
|
|
@@ -9454,11 +9481,11 @@ var InternalHeader = (props) => {
|
|
|
9454
9481
|
htmlProps,
|
|
9455
9482
|
...rest
|
|
9456
9483
|
} = props;
|
|
9457
|
-
const [contextMenuIsClosed, setContextMenuIsClosed] = (0,
|
|
9458
|
-
const [currentPage, setCurrentPage] = (0,
|
|
9484
|
+
const [contextMenuIsClosed, setContextMenuIsClosed] = (0, import_react71.useState)(true);
|
|
9485
|
+
const [currentPage, setCurrentPage] = (0, import_react71.useState)(
|
|
9459
9486
|
currentPageHref
|
|
9460
9487
|
);
|
|
9461
|
-
const buttonRef = (0,
|
|
9488
|
+
const buttonRef = (0, import_react71.useRef)(null);
|
|
9462
9489
|
const handleCurrentPageChange = (href) => {
|
|
9463
9490
|
setCurrentPage(href);
|
|
9464
9491
|
onCurrentPageChange && onCurrentPageChange();
|
|
@@ -9527,7 +9554,7 @@ var InternalHeader = (props) => {
|
|
|
9527
9554
|
InternalHeader.displayName = "InternalHeader";
|
|
9528
9555
|
|
|
9529
9556
|
// src/components/List/List.tsx
|
|
9530
|
-
var
|
|
9557
|
+
var import_react72 = require("react");
|
|
9531
9558
|
var import_styled_components63 = __toESM(require("styled-components"));
|
|
9532
9559
|
|
|
9533
9560
|
// src/components/List/bullets/jordskifterett_bullet1.svg
|
|
@@ -9628,7 +9655,7 @@ var StyledList = import_styled_components63.default.ul`
|
|
|
9628
9655
|
}
|
|
9629
9656
|
`}
|
|
9630
9657
|
`;
|
|
9631
|
-
var List2 = (0,
|
|
9658
|
+
var List2 = (0, import_react72.forwardRef)(
|
|
9632
9659
|
(props, ref) => {
|
|
9633
9660
|
const {
|
|
9634
9661
|
listType = "unordered",
|
|
@@ -9656,13 +9683,13 @@ var List2 = (0, import_react71.forwardRef)(
|
|
|
9656
9683
|
List2.displayName = "List";
|
|
9657
9684
|
|
|
9658
9685
|
// src/components/List/ListItem.tsx
|
|
9659
|
-
var
|
|
9686
|
+
var import_react73 = require("react");
|
|
9660
9687
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
9661
9688
|
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
9662
9689
|
var StyledListItem = import_styled_components64.default.li`
|
|
9663
9690
|
line-height: ${listTokens.listItem.lineHeight};
|
|
9664
9691
|
`;
|
|
9665
|
-
var ListItem2 = (0,
|
|
9692
|
+
var ListItem2 = (0, import_react73.forwardRef)(
|
|
9666
9693
|
({ children, ...rest }, ref) => {
|
|
9667
9694
|
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledListItem, { ref, ...rest, children });
|
|
9668
9695
|
}
|
|
@@ -9670,7 +9697,7 @@ var ListItem2 = (0, import_react72.forwardRef)(
|
|
|
9670
9697
|
ListItem2.displayName = "ListItem";
|
|
9671
9698
|
|
|
9672
9699
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
9673
|
-
var
|
|
9700
|
+
var import_react74 = require("react");
|
|
9674
9701
|
var import_styled_components65 = __toESM(require("styled-components"));
|
|
9675
9702
|
|
|
9676
9703
|
// src/components/LocalMessage/LocalMessage.tokens.tsx
|
|
@@ -9835,7 +9862,7 @@ var CloseButton = (0, import_styled_components65.default)(Button)`
|
|
|
9835
9862
|
grid-area: closeButton;
|
|
9836
9863
|
margin: -${container10.base.padding} 0;
|
|
9837
9864
|
`;
|
|
9838
|
-
var LocalMessage = (0,
|
|
9865
|
+
var LocalMessage = (0, import_react74.forwardRef)(
|
|
9839
9866
|
(props, ref) => {
|
|
9840
9867
|
const {
|
|
9841
9868
|
message: message2,
|
|
@@ -9850,7 +9877,7 @@ var LocalMessage = (0, import_react73.forwardRef)(
|
|
|
9850
9877
|
htmlProps,
|
|
9851
9878
|
...rest
|
|
9852
9879
|
} = props;
|
|
9853
|
-
const [isClosed, setClosed] = (0,
|
|
9880
|
+
const [isClosed, setClosed] = (0, import_react74.useState)(false);
|
|
9854
9881
|
const containerProps = {
|
|
9855
9882
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
9856
9883
|
purpose,
|
|
@@ -9891,7 +9918,7 @@ var LocalMessage = (0, import_react73.forwardRef)(
|
|
|
9891
9918
|
LocalMessage.displayName = "LocalMessage";
|
|
9892
9919
|
|
|
9893
9920
|
// src/components/Modal/Modal.tsx
|
|
9894
|
-
var
|
|
9921
|
+
var import_react75 = require("react");
|
|
9895
9922
|
var import_react_dom3 = require("react-dom");
|
|
9896
9923
|
var import_styled_components67 = __toESM(require("styled-components"));
|
|
9897
9924
|
|
|
@@ -9987,7 +10014,7 @@ var HeaderContainer3 = import_styled_components67.default.div``;
|
|
|
9987
10014
|
var StyledButton4 = (0, import_styled_components67.default)(Button)`
|
|
9988
10015
|
align-self: flex-end;
|
|
9989
10016
|
`;
|
|
9990
|
-
var Modal = (0,
|
|
10017
|
+
var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
9991
10018
|
const {
|
|
9992
10019
|
isOpen = false,
|
|
9993
10020
|
parentElement = document.body,
|
|
@@ -10001,7 +10028,7 @@ var Modal = (0, import_react74.forwardRef)((props, ref) => {
|
|
|
10001
10028
|
htmlProps,
|
|
10002
10029
|
...rest
|
|
10003
10030
|
} = props;
|
|
10004
|
-
const generatedId = (0,
|
|
10031
|
+
const generatedId = (0, import_react75.useId)();
|
|
10005
10032
|
const modalId = id != null ? id : `${generatedId}-modal`;
|
|
10006
10033
|
const headerId = `${modalId}-header`;
|
|
10007
10034
|
const modalRef = useFocusTrap(isOpen, initialFocusRef);
|
|
@@ -10013,7 +10040,7 @@ var Modal = (0, import_react74.forwardRef)((props, ref) => {
|
|
|
10013
10040
|
onClose();
|
|
10014
10041
|
}
|
|
10015
10042
|
};
|
|
10016
|
-
(0,
|
|
10043
|
+
(0, import_react75.useEffect)(() => {
|
|
10017
10044
|
if (isOpen) {
|
|
10018
10045
|
handleElementWithBackdropMount(document.body);
|
|
10019
10046
|
} else {
|
|
@@ -10062,11 +10089,11 @@ var Modal = (0, import_react74.forwardRef)((props, ref) => {
|
|
|
10062
10089
|
Modal.displayName = "Modal";
|
|
10063
10090
|
|
|
10064
10091
|
// src/components/Modal/ModalBody.tsx
|
|
10065
|
-
var
|
|
10092
|
+
var import_react76 = require("react");
|
|
10066
10093
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
10067
10094
|
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
10068
10095
|
var Container10 = import_styled_components68.default.div``;
|
|
10069
|
-
var ModalBody = (0,
|
|
10096
|
+
var ModalBody = (0, import_react76.forwardRef)(
|
|
10070
10097
|
(props, ref) => {
|
|
10071
10098
|
const { children, scrollable, id, className, htmlProps, height, ...rest } = props;
|
|
10072
10099
|
const containerProps = {
|
|
@@ -10079,7 +10106,7 @@ var ModalBody = (0, import_react75.forwardRef)(
|
|
|
10079
10106
|
ModalBody.displayName = "ModalBody";
|
|
10080
10107
|
|
|
10081
10108
|
// src/components/Modal/ModalActions.tsx
|
|
10082
|
-
var
|
|
10109
|
+
var import_react77 = require("react");
|
|
10083
10110
|
var import_styled_components69 = __toESM(require("styled-components"));
|
|
10084
10111
|
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
10085
10112
|
var Container11 = import_styled_components69.default.div`
|
|
@@ -10087,7 +10114,7 @@ var Container11 = import_styled_components69.default.div`
|
|
|
10087
10114
|
flex-wrap: wrap;
|
|
10088
10115
|
gap: ${modalTokens.actionsContainer.gap};
|
|
10089
10116
|
`;
|
|
10090
|
-
var ModalActions = (0,
|
|
10117
|
+
var ModalActions = (0, import_react77.forwardRef)(
|
|
10091
10118
|
({ children, ...rest }, ref) => {
|
|
10092
10119
|
const containerProps = {
|
|
10093
10120
|
ref,
|
|
@@ -10099,7 +10126,7 @@ var ModalActions = (0, import_react76.forwardRef)(
|
|
|
10099
10126
|
ModalActions.displayName = "ModalActions";
|
|
10100
10127
|
|
|
10101
10128
|
// src/components/Pagination/Pagination.tsx
|
|
10102
|
-
var
|
|
10129
|
+
var import_react79 = require("react");
|
|
10103
10130
|
var import_styled_components71 = __toESM(require("styled-components"));
|
|
10104
10131
|
|
|
10105
10132
|
// src/components/Pagination/Pagination.tokens.tsx
|
|
@@ -10158,7 +10185,7 @@ function PaginationGenerator(pagesAmount, activePage) {
|
|
|
10158
10185
|
}
|
|
10159
10186
|
|
|
10160
10187
|
// src/components/Select/Select.tsx
|
|
10161
|
-
var
|
|
10188
|
+
var import_react78 = require("react");
|
|
10162
10189
|
var import_react_select2 = __toESM(require("react-select"));
|
|
10163
10190
|
|
|
10164
10191
|
// src/components/Select/Select.styles.ts
|
|
@@ -10655,7 +10682,7 @@ function SelectInner(props, ref) {
|
|
|
10655
10682
|
customSingleValueElement,
|
|
10656
10683
|
...rest
|
|
10657
10684
|
} = props;
|
|
10658
|
-
const generatedId = (0,
|
|
10685
|
+
const generatedId = (0, import_react78.useId)();
|
|
10659
10686
|
const uniqueId = id != null ? id : `${generatedId}-select`;
|
|
10660
10687
|
const singleValueId = !isMulti ? `${uniqueId}-singleValue` : void 0;
|
|
10661
10688
|
const hasLabel = !!label3;
|
|
@@ -10719,7 +10746,7 @@ function SelectInner(props, ref) {
|
|
|
10719
10746
|
renderInputMessage(tip, tipId, errorMessage, errorMessageId)
|
|
10720
10747
|
] });
|
|
10721
10748
|
}
|
|
10722
|
-
var Select = (0,
|
|
10749
|
+
var Select = (0, import_react78.forwardRef)(SelectInner);
|
|
10723
10750
|
Select.displayName = "Select";
|
|
10724
10751
|
|
|
10725
10752
|
// src/components/Select/utils.ts
|
|
@@ -10763,7 +10790,7 @@ var IndicatorsContainer = import_styled_components71.default.div`
|
|
|
10763
10790
|
align-items: center;
|
|
10764
10791
|
gap: ${indicatorsContainer2.gap};
|
|
10765
10792
|
`;
|
|
10766
|
-
var Pagination = (0,
|
|
10793
|
+
var Pagination = (0, import_react79.forwardRef)(
|
|
10767
10794
|
(props, ref) => {
|
|
10768
10795
|
const {
|
|
10769
10796
|
itemsAmount,
|
|
@@ -10786,8 +10813,8 @@ var Pagination = (0, import_react78.forwardRef)(
|
|
|
10786
10813
|
htmlProps,
|
|
10787
10814
|
...rest
|
|
10788
10815
|
} = props;
|
|
10789
|
-
const [activePage, setActivePage] = (0,
|
|
10790
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
10816
|
+
const [activePage, setActivePage] = (0, import_react79.useState)(defaultActivePage);
|
|
10817
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react79.useState)(defaultItemsPerPage);
|
|
10791
10818
|
const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
|
|
10792
10819
|
const items = PaginationGenerator(pagesLength, activePage);
|
|
10793
10820
|
const onPageChange = (event, page) => {
|
|
@@ -10943,7 +10970,7 @@ Pagination.displayName = "Pagination";
|
|
|
10943
10970
|
|
|
10944
10971
|
// src/components/Popover/Popover.tsx
|
|
10945
10972
|
var import_dds_design_tokens52 = require("@norges-domstoler/dds-design-tokens");
|
|
10946
|
-
var
|
|
10973
|
+
var import_react80 = require("react");
|
|
10947
10974
|
var import_styled_components72 = __toESM(require("styled-components"));
|
|
10948
10975
|
|
|
10949
10976
|
// src/components/Popover/Popover.tokens.tsx
|
|
@@ -11008,7 +11035,7 @@ var StyledButton5 = (0, import_styled_components72.default)(Button)`
|
|
|
11008
11035
|
top: ${closeButton2.top};
|
|
11009
11036
|
right: ${closeButton2.right};
|
|
11010
11037
|
`;
|
|
11011
|
-
var Popover = (0,
|
|
11038
|
+
var Popover = (0, import_react80.forwardRef)(
|
|
11012
11039
|
(props, ref) => {
|
|
11013
11040
|
const {
|
|
11014
11041
|
title: title3,
|
|
@@ -11089,7 +11116,7 @@ var Popover = (0, import_react79.forwardRef)(
|
|
|
11089
11116
|
Popover.displayName = "Popover";
|
|
11090
11117
|
|
|
11091
11118
|
// src/components/Popover/PopoverGroup.tsx
|
|
11092
|
-
var
|
|
11119
|
+
var import_react81 = require("react");
|
|
11093
11120
|
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
11094
11121
|
var PopoverGroup = ({
|
|
11095
11122
|
isOpen = false,
|
|
@@ -11098,8 +11125,8 @@ var PopoverGroup = ({
|
|
|
11098
11125
|
children,
|
|
11099
11126
|
popoverId
|
|
11100
11127
|
}) => {
|
|
11101
|
-
const [open, setOpen] = (0,
|
|
11102
|
-
const generatedId = (0,
|
|
11128
|
+
const [open, setOpen] = (0, import_react81.useState)(isOpen);
|
|
11129
|
+
const generatedId = (0, import_react81.useId)();
|
|
11103
11130
|
const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
|
|
11104
11131
|
const handleOnCloseButtonClick = () => {
|
|
11105
11132
|
setOpen(false);
|
|
@@ -11109,8 +11136,8 @@ var PopoverGroup = ({
|
|
|
11109
11136
|
setOpen(!open);
|
|
11110
11137
|
onTriggerClick && onTriggerClick();
|
|
11111
11138
|
};
|
|
11112
|
-
const buttonRef = (0,
|
|
11113
|
-
const popoverRef = (0,
|
|
11139
|
+
const buttonRef = (0, import_react81.useRef)(null);
|
|
11140
|
+
const popoverRef = (0, import_react81.useRef)(null);
|
|
11114
11141
|
useOnKeyDown(["Esc", "Escape"], () => {
|
|
11115
11142
|
var _a;
|
|
11116
11143
|
if (open) {
|
|
@@ -11119,14 +11146,14 @@ var PopoverGroup = ({
|
|
|
11119
11146
|
}
|
|
11120
11147
|
});
|
|
11121
11148
|
const handleClose = () => setOpen(false);
|
|
11122
|
-
const Children9 =
|
|
11123
|
-
return (0,
|
|
11149
|
+
const Children9 = import_react81.Children.map(children, (child, childIndex) => {
|
|
11150
|
+
return (0, import_react81.isValidElement)(child) && (childIndex === 0 ? (0, import_react81.cloneElement)(child, {
|
|
11124
11151
|
"aria-haspopup": "dialog",
|
|
11125
11152
|
"aria-controls": uniquePopoverId,
|
|
11126
11153
|
"aria-expanded": open,
|
|
11127
11154
|
onClick: handleOnTriggerClick,
|
|
11128
11155
|
ref: buttonRef
|
|
11129
|
-
}) : (0,
|
|
11156
|
+
}) : (0, import_react81.cloneElement)(child, {
|
|
11130
11157
|
isOpen: open,
|
|
11131
11158
|
"aria-hidden": !open,
|
|
11132
11159
|
id: uniquePopoverId,
|
|
@@ -11141,17 +11168,17 @@ var PopoverGroup = ({
|
|
|
11141
11168
|
PopoverGroup.displayName = "PopoverGroup";
|
|
11142
11169
|
|
|
11143
11170
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
11144
|
-
var
|
|
11171
|
+
var import_react84 = require("react");
|
|
11145
11172
|
var import_styled_components74 = __toESM(require("styled-components"));
|
|
11146
11173
|
|
|
11147
11174
|
// src/components/ProgressTracker/ProgressTracker.context.tsx
|
|
11148
|
-
var
|
|
11149
|
-
var ProgressTrackerContext = (0,
|
|
11175
|
+
var import_react82 = require("react");
|
|
11176
|
+
var ProgressTrackerContext = (0, import_react82.createContext)(
|
|
11150
11177
|
{
|
|
11151
11178
|
activeStep: 0
|
|
11152
11179
|
}
|
|
11153
11180
|
);
|
|
11154
|
-
var useProgressTrackerContext = () => (0,
|
|
11181
|
+
var useProgressTrackerContext = () => (0, import_react82.useContext)(ProgressTrackerContext);
|
|
11155
11182
|
|
|
11156
11183
|
// src/components/ProgressTracker/ProgressTracker.tokens.tsx
|
|
11157
11184
|
var import_dds_design_tokens53 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -11269,7 +11296,7 @@ var progressTrackerTokens = {
|
|
|
11269
11296
|
};
|
|
11270
11297
|
|
|
11271
11298
|
// src/components/ProgressTracker/ProgressTrackerItem.tsx
|
|
11272
|
-
var
|
|
11299
|
+
var import_react83 = require("react");
|
|
11273
11300
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11274
11301
|
var import_jsx_runtime242 = require("react/jsx-runtime");
|
|
11275
11302
|
var toItemState = (active, completed, disabled) => {
|
|
@@ -11366,7 +11393,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
11366
11393
|
const styleProps = {
|
|
11367
11394
|
$state: toItemState(active, completed, disabled)
|
|
11368
11395
|
};
|
|
11369
|
-
const stepNumberContent = (0,
|
|
11396
|
+
const stepNumberContent = (0, import_react83.useMemo)(() => {
|
|
11370
11397
|
if (completed) {
|
|
11371
11398
|
return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(Icon, { icon: CheckIcon, iconSize: itemNumber2.iconSize });
|
|
11372
11399
|
}
|
|
@@ -11414,7 +11441,7 @@ var ProgressTrackerConnector = import_styled_components74.default.div`
|
|
|
11414
11441
|
${progressTrackerTokens.connector.color};
|
|
11415
11442
|
`;
|
|
11416
11443
|
var ProgressTracker = (() => {
|
|
11417
|
-
const Res = (0,
|
|
11444
|
+
const Res = (0, import_react84.forwardRef)((props, ref) => {
|
|
11418
11445
|
const {
|
|
11419
11446
|
id,
|
|
11420
11447
|
activeStep = 0,
|
|
@@ -11424,12 +11451,12 @@ var ProgressTracker = (() => {
|
|
|
11424
11451
|
htmlProps,
|
|
11425
11452
|
...rest
|
|
11426
11453
|
} = props;
|
|
11427
|
-
const [thisActiveStep, setActiveStep] = (0,
|
|
11454
|
+
const [thisActiveStep, setActiveStep] = (0, import_react84.useState)(activeStep);
|
|
11428
11455
|
const handleChange = (step) => {
|
|
11429
11456
|
setActiveStep(step);
|
|
11430
11457
|
onStepChange && onStepChange(step);
|
|
11431
11458
|
};
|
|
11432
|
-
(0,
|
|
11459
|
+
(0, import_react84.useEffect)(() => {
|
|
11433
11460
|
if (activeStep !== void 0 && activeStep != thisActiveStep) {
|
|
11434
11461
|
setActiveStep(activeStep);
|
|
11435
11462
|
}
|
|
@@ -11438,7 +11465,7 @@ var ProgressTracker = (() => {
|
|
|
11438
11465
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
11439
11466
|
ref
|
|
11440
11467
|
};
|
|
11441
|
-
const steps = (0,
|
|
11468
|
+
const steps = (0, import_react84.useMemo)(() => {
|
|
11442
11469
|
const validChildren = removeInvalidChildren(children);
|
|
11443
11470
|
const itemsWithIndex = passIndexPropToProgressTrackerItem(validChildren);
|
|
11444
11471
|
const itemsWithConnectorsBetween = intersperseItemsWithConnector(itemsWithIndex);
|
|
@@ -11460,36 +11487,36 @@ var ProgressTracker = (() => {
|
|
|
11460
11487
|
return Res;
|
|
11461
11488
|
})();
|
|
11462
11489
|
function removeInvalidChildren(children) {
|
|
11463
|
-
return
|
|
11490
|
+
return import_react84.Children.toArray(children).filter(import_react84.isValidElement);
|
|
11464
11491
|
}
|
|
11465
11492
|
function passIndexPropToProgressTrackerItem(children) {
|
|
11466
|
-
return
|
|
11493
|
+
return import_react84.Children.map(
|
|
11467
11494
|
children,
|
|
11468
|
-
(item, index) => (0,
|
|
11495
|
+
(item, index) => (0, import_react84.cloneElement)(item, {
|
|
11469
11496
|
...item.props,
|
|
11470
11497
|
index
|
|
11471
11498
|
})
|
|
11472
11499
|
);
|
|
11473
11500
|
}
|
|
11474
|
-
var intersperseItemsWithConnector = (children) =>
|
|
11501
|
+
var intersperseItemsWithConnector = (children) => import_react84.Children.map(children, (child, index) => {
|
|
11475
11502
|
if (index === 0) {
|
|
11476
11503
|
return child;
|
|
11477
11504
|
}
|
|
11478
|
-
return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(
|
|
11505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(import_react84.Fragment, { children: [
|
|
11479
11506
|
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(ProgressTrackerConnector, { "aria-hidden": true }),
|
|
11480
11507
|
child
|
|
11481
11508
|
] }, index);
|
|
11482
11509
|
});
|
|
11483
11510
|
|
|
11484
11511
|
// src/components/Search/Search.tsx
|
|
11485
|
-
var
|
|
11512
|
+
var import_react87 = require("react");
|
|
11486
11513
|
var import_styled_components76 = __toESM(require("styled-components"));
|
|
11487
11514
|
|
|
11488
11515
|
// src/components/Search/AutocompleteSearch.context.tsx
|
|
11489
|
-
var
|
|
11490
|
-
var AutocompleteSearchContext = (0,
|
|
11516
|
+
var import_react85 = require("react");
|
|
11517
|
+
var AutocompleteSearchContext = (0, import_react85.createContext)({});
|
|
11491
11518
|
var useAutocompleteSearch = () => {
|
|
11492
|
-
return (0,
|
|
11519
|
+
return (0, import_react85.useContext)(AutocompleteSearchContext);
|
|
11493
11520
|
};
|
|
11494
11521
|
|
|
11495
11522
|
// src/components/Search/Search.tokens.tsx
|
|
@@ -11599,7 +11626,7 @@ function createEmptyChangeEvent(inputElementId) {
|
|
|
11599
11626
|
}
|
|
11600
11627
|
|
|
11601
11628
|
// src/components/Search/SearchSuggestions.tsx
|
|
11602
|
-
var
|
|
11629
|
+
var import_react86 = require("react");
|
|
11603
11630
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
11604
11631
|
var import_jsx_runtime244 = require("react/jsx-runtime");
|
|
11605
11632
|
var { suggestionsContainer: suggestionsContainer2, suggestionsHeader: suggestionsHeader2 } = searchTokens;
|
|
@@ -11626,7 +11653,7 @@ var SuggestionsList = import_styled_components75.default.ul`
|
|
|
11626
11653
|
var SuggestionsHeader = (0, import_styled_components75.default)(Typography)`
|
|
11627
11654
|
padding-left: ${suggestionsHeader2.paddingLeft};
|
|
11628
11655
|
`;
|
|
11629
|
-
var SearchSuggestions = (0,
|
|
11656
|
+
var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
11630
11657
|
const {
|
|
11631
11658
|
id,
|
|
11632
11659
|
searchId,
|
|
@@ -11745,7 +11772,7 @@ var InputContainer2 = import_styled_components76.default.div`
|
|
|
11745
11772
|
position: relative;
|
|
11746
11773
|
display: flex;
|
|
11747
11774
|
`;
|
|
11748
|
-
var Search = (0,
|
|
11775
|
+
var Search = (0, import_react87.forwardRef)(
|
|
11749
11776
|
({
|
|
11750
11777
|
componentSize = "medium",
|
|
11751
11778
|
buttonProps,
|
|
@@ -11761,7 +11788,7 @@ var Search = (0, import_react86.forwardRef)(
|
|
|
11761
11788
|
...rest
|
|
11762
11789
|
}, ref) => {
|
|
11763
11790
|
var _a;
|
|
11764
|
-
const generatedId = (0,
|
|
11791
|
+
const generatedId = (0, import_react87.useId)();
|
|
11765
11792
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
11766
11793
|
const hasLabel = !!label3;
|
|
11767
11794
|
const tipId = derivativeIdGenerator(uniqueId, "tip");
|
|
@@ -11770,7 +11797,7 @@ var Search = (0, import_react86.forwardRef)(
|
|
|
11770
11797
|
uniqueId,
|
|
11771
11798
|
"suggestions-description"
|
|
11772
11799
|
);
|
|
11773
|
-
const [hasValue, setHasValue] = (0,
|
|
11800
|
+
const [hasValue, setHasValue] = (0, import_react87.useState)(!!value);
|
|
11774
11801
|
const context = useAutocompleteSearch();
|
|
11775
11802
|
const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
|
|
11776
11803
|
const handleChange = (e) => {
|
|
@@ -11878,7 +11905,7 @@ var Search = (0, import_react86.forwardRef)(
|
|
|
11878
11905
|
Search.displayName = "Search";
|
|
11879
11906
|
|
|
11880
11907
|
// src/components/Search/SearchAutocompleteWrapper.tsx
|
|
11881
|
-
var
|
|
11908
|
+
var import_react88 = require("react");
|
|
11882
11909
|
var import_jsx_runtime246 = require("react/jsx-runtime");
|
|
11883
11910
|
var SearchAutocompleteWrapper = (props) => {
|
|
11884
11911
|
const {
|
|
@@ -11890,12 +11917,12 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
11890
11917
|
onSuggestionSelection,
|
|
11891
11918
|
children
|
|
11892
11919
|
} = props;
|
|
11893
|
-
const [inputValue, setInputValue] = (0,
|
|
11894
|
-
const [suggestions, setSuggestions] = (0,
|
|
11895
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
11920
|
+
const [inputValue, setInputValue] = (0, import_react88.useState)(value != null ? value : "");
|
|
11921
|
+
const [suggestions, setSuggestions] = (0, import_react88.useState)([]);
|
|
11922
|
+
const [showSuggestions, setShowSuggestions] = (0, import_react88.useState)(false);
|
|
11896
11923
|
const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
|
|
11897
11924
|
const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
|
|
11898
|
-
(0,
|
|
11925
|
+
(0, import_react88.useEffect)(() => {
|
|
11899
11926
|
if (suggestions.length > 0) {
|
|
11900
11927
|
openSuggestions();
|
|
11901
11928
|
} else {
|
|
@@ -11940,8 +11967,8 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
11940
11967
|
const handleSetInputValue = (value2) => {
|
|
11941
11968
|
setInputValue(value2 != null ? value2 : "");
|
|
11942
11969
|
};
|
|
11943
|
-
const inputRef = (0,
|
|
11944
|
-
const suggestionsRef = (0,
|
|
11970
|
+
const inputRef = (0, import_react88.useRef)(null);
|
|
11971
|
+
const suggestionsRef = (0, import_react88.useRef)(null);
|
|
11945
11972
|
useOnClickOutside([inputRef.current, suggestionsRef.current], () => {
|
|
11946
11973
|
closeSuggestions();
|
|
11947
11974
|
});
|
|
@@ -11965,13 +11992,13 @@ Search2.AutocompleteWrapper = SearchAutocompleteWrapper;
|
|
|
11965
11992
|
Search2.Suggestions = SearchSuggestions;
|
|
11966
11993
|
|
|
11967
11994
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
11968
|
-
var
|
|
11995
|
+
var import_react90 = require("react");
|
|
11969
11996
|
|
|
11970
11997
|
// src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
|
|
11971
|
-
var
|
|
11972
|
-
var CheckboxGroupContext = (0,
|
|
11998
|
+
var import_react89 = require("react");
|
|
11999
|
+
var CheckboxGroupContext = (0, import_react89.createContext)(null);
|
|
11973
12000
|
var useCheckboxGroup = () => {
|
|
11974
|
-
return (0,
|
|
12001
|
+
return (0, import_react89.useContext)(CheckboxGroupContext);
|
|
11975
12002
|
};
|
|
11976
12003
|
|
|
11977
12004
|
// src/components/SelectionControl/SelectionControl.styles.tsx
|
|
@@ -12254,7 +12281,7 @@ var GroupContainer = import_styled_components77.default.div`
|
|
|
12254
12281
|
|
|
12255
12282
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
12256
12283
|
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
12257
|
-
var Checkbox = (0,
|
|
12284
|
+
var Checkbox = (0, import_react90.forwardRef)(
|
|
12258
12285
|
(props, ref) => {
|
|
12259
12286
|
const {
|
|
12260
12287
|
id,
|
|
@@ -12269,7 +12296,7 @@ var Checkbox = (0, import_react89.forwardRef)(
|
|
|
12269
12296
|
htmlProps = {},
|
|
12270
12297
|
...rest
|
|
12271
12298
|
} = props;
|
|
12272
|
-
const generatedId = (0,
|
|
12299
|
+
const generatedId = (0, import_react90.useId)();
|
|
12273
12300
|
const uniqueId = id != null ? id : `${generatedId}-checkbox`;
|
|
12274
12301
|
const checkboxGroup = useCheckboxGroup();
|
|
12275
12302
|
const hasLabel = !!label3;
|
|
@@ -12320,7 +12347,7 @@ var Checkbox = (0, import_react89.forwardRef)(
|
|
|
12320
12347
|
Checkbox.displayName = "Checkbox";
|
|
12321
12348
|
|
|
12322
12349
|
// src/components/SelectionControl/Checkbox/CheckboxGroup.tsx
|
|
12323
|
-
var
|
|
12350
|
+
var import_react91 = require("react");
|
|
12324
12351
|
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
12325
12352
|
var CheckboxGroup = (props) => {
|
|
12326
12353
|
const {
|
|
@@ -12339,7 +12366,7 @@ var CheckboxGroup = (props) => {
|
|
|
12339
12366
|
...rest
|
|
12340
12367
|
} = props;
|
|
12341
12368
|
const { "aria-required": ariaRequired } = htmlProps;
|
|
12342
|
-
const generatedId = (0,
|
|
12369
|
+
const generatedId = (0, import_react91.useId)();
|
|
12343
12370
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-checkboxGroup`;
|
|
12344
12371
|
const hasErrorMessage = !!errorMessage;
|
|
12345
12372
|
const showRequiredMarker = required || ariaRequired;
|
|
@@ -12395,13 +12422,13 @@ var CheckboxGroup = (props) => {
|
|
|
12395
12422
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
12396
12423
|
|
|
12397
12424
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
12398
|
-
var
|
|
12425
|
+
var import_react93 = require("react");
|
|
12399
12426
|
|
|
12400
12427
|
// src/components/SelectionControl/RadioButton/RadioButtonGroupContext.tsx
|
|
12401
|
-
var
|
|
12402
|
-
var RadioButtonGroupContext = (0,
|
|
12428
|
+
var import_react92 = require("react");
|
|
12429
|
+
var RadioButtonGroupContext = (0, import_react92.createContext)(null);
|
|
12403
12430
|
var useRadioButtonGroup = () => {
|
|
12404
|
-
return (0,
|
|
12431
|
+
return (0, import_react92.useContext)(RadioButtonGroupContext);
|
|
12405
12432
|
};
|
|
12406
12433
|
|
|
12407
12434
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
@@ -12415,7 +12442,7 @@ var isValueEqualToGroupValueOrFalsy = (value, group4) => {
|
|
|
12415
12442
|
}
|
|
12416
12443
|
return !!value;
|
|
12417
12444
|
};
|
|
12418
|
-
var RadioButton = (0,
|
|
12445
|
+
var RadioButton = (0, import_react93.forwardRef)(
|
|
12419
12446
|
(props, ref) => {
|
|
12420
12447
|
const {
|
|
12421
12448
|
id,
|
|
@@ -12439,7 +12466,7 @@ var RadioButton = (0, import_react92.forwardRef)(
|
|
|
12439
12466
|
style,
|
|
12440
12467
|
...restHtmlProps
|
|
12441
12468
|
} = htmlProps;
|
|
12442
|
-
const generatedId = (0,
|
|
12469
|
+
const generatedId = (0, import_react93.useId)();
|
|
12443
12470
|
const uniqueId = id != null ? id : `${generatedId}-radioButton`;
|
|
12444
12471
|
const hasLabel = !!label3;
|
|
12445
12472
|
const radioButtonGroup = useRadioButtonGroup();
|
|
@@ -12487,7 +12514,7 @@ var RadioButton = (0, import_react92.forwardRef)(
|
|
|
12487
12514
|
RadioButton.displayName = "RadioButton";
|
|
12488
12515
|
|
|
12489
12516
|
// src/components/SelectionControl/RadioButton/RadioButtonGroup.tsx
|
|
12490
|
-
var
|
|
12517
|
+
var import_react94 = require("react");
|
|
12491
12518
|
var import_jsx_runtime250 = require("react/jsx-runtime");
|
|
12492
12519
|
var RadioButtonGroupInner = (props, ref) => {
|
|
12493
12520
|
const {
|
|
@@ -12509,8 +12536,8 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12509
12536
|
...rest
|
|
12510
12537
|
} = props;
|
|
12511
12538
|
const { "aria-required": ariaRequired = false } = htmlProps;
|
|
12512
|
-
const [groupValue, setGroupValue] = (0,
|
|
12513
|
-
const generatedId = (0,
|
|
12539
|
+
const [groupValue, setGroupValue] = (0, import_react94.useState)(value);
|
|
12540
|
+
const generatedId = (0, import_react94.useId)();
|
|
12514
12541
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-radioButtonGroup`;
|
|
12515
12542
|
const handleChange = combineHandlers(
|
|
12516
12543
|
(e) => setGroupValue(e.target.value),
|
|
@@ -12571,11 +12598,11 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12571
12598
|
}
|
|
12572
12599
|
);
|
|
12573
12600
|
};
|
|
12574
|
-
var RadioButtonGroup = (0,
|
|
12601
|
+
var RadioButtonGroup = (0, import_react94.forwardRef)(RadioButtonGroupInner);
|
|
12575
12602
|
RadioButtonGroup.displayName = "RadioButtonGroup";
|
|
12576
12603
|
|
|
12577
12604
|
// src/components/SkipToContent/SkipToContent.tsx
|
|
12578
|
-
var
|
|
12605
|
+
var import_react95 = require("react");
|
|
12579
12606
|
var import_styled_components78 = __toESM(require("styled-components"));
|
|
12580
12607
|
|
|
12581
12608
|
// src/components/SkipToContent/SkipToContent.tokens.tsx
|
|
@@ -12643,7 +12670,7 @@ var Link4 = import_styled_components78.default.a`
|
|
|
12643
12670
|
color: ${link5.base.color};
|
|
12644
12671
|
}
|
|
12645
12672
|
`;
|
|
12646
|
-
var SkipToContent = (0,
|
|
12673
|
+
var SkipToContent = (0, import_react95.forwardRef)(
|
|
12647
12674
|
(props, ref) => {
|
|
12648
12675
|
const {
|
|
12649
12676
|
text = "Til hovedinnhold",
|
|
@@ -12672,7 +12699,7 @@ var SkipToContent = (0, import_react94.forwardRef)(
|
|
|
12672
12699
|
SkipToContent.displayName = "SkipToContent";
|
|
12673
12700
|
|
|
12674
12701
|
// src/components/SplitButton/SplitButton.tsx
|
|
12675
|
-
var
|
|
12702
|
+
var import_react96 = require("react");
|
|
12676
12703
|
var import_styled_components79 = __toESM(require("styled-components"));
|
|
12677
12704
|
|
|
12678
12705
|
// src/components/SplitButton/SplitButton.tokens.ts
|
|
@@ -12718,7 +12745,7 @@ var OptionButton = (0, import_styled_components79.default)(Button)`
|
|
|
12718
12745
|
${(props) => props.purpose === "primary" && `border-left: ${tokens3.mainButton.primary.borderLeft}`};
|
|
12719
12746
|
}
|
|
12720
12747
|
`;
|
|
12721
|
-
var SplitButton = (0,
|
|
12748
|
+
var SplitButton = (0, import_react96.forwardRef)(
|
|
12722
12749
|
(props, ref) => {
|
|
12723
12750
|
const {
|
|
12724
12751
|
size: size2,
|
|
@@ -12726,7 +12753,7 @@ var SplitButton = (0, import_react95.forwardRef)(
|
|
|
12726
12753
|
secondaryActions,
|
|
12727
12754
|
purpose = "primary"
|
|
12728
12755
|
} = props;
|
|
12729
|
-
const [isOpen, setIsOpen] = (0,
|
|
12756
|
+
const [isOpen, setIsOpen] = (0, import_react96.useState)(false);
|
|
12730
12757
|
const buttonStyleProps = {
|
|
12731
12758
|
appearance: "filled",
|
|
12732
12759
|
purpose,
|
|
@@ -12759,23 +12786,23 @@ var SplitButton = (0, import_react95.forwardRef)(
|
|
|
12759
12786
|
SplitButton.displayName = "SplitButton";
|
|
12760
12787
|
|
|
12761
12788
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
12762
|
-
var
|
|
12789
|
+
var import_react106 = require("react");
|
|
12763
12790
|
var import_styled_components88 = __toESM(require("styled-components"));
|
|
12764
12791
|
|
|
12765
12792
|
// src/components/Table/collapsible/Table.context.tsx
|
|
12766
|
-
var
|
|
12767
|
-
var CollapsibleTableContext = (0,
|
|
12793
|
+
var import_react97 = require("react");
|
|
12794
|
+
var CollapsibleTableContext = (0, import_react97.createContext)({
|
|
12768
12795
|
headerValues: [],
|
|
12769
12796
|
definingColumnIndex: [0]
|
|
12770
12797
|
});
|
|
12771
|
-
var useCollapsibleTableContext = () => (0,
|
|
12798
|
+
var useCollapsibleTableContext = () => (0, import_react97.useContext)(CollapsibleTableContext);
|
|
12772
12799
|
|
|
12773
12800
|
// src/components/Table/normal/Body.tsx
|
|
12774
|
-
var
|
|
12801
|
+
var import_react98 = require("react");
|
|
12775
12802
|
var import_styled_components80 = __toESM(require("styled-components"));
|
|
12776
12803
|
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
12777
12804
|
var StyledBody = import_styled_components80.default.tbody``;
|
|
12778
|
-
var Body2 = (0,
|
|
12805
|
+
var Body2 = (0, import_react98.forwardRef)(
|
|
12779
12806
|
({ children, ...rest }, ref) => {
|
|
12780
12807
|
const bodyProps = {
|
|
12781
12808
|
...rest
|
|
@@ -12786,23 +12813,23 @@ var Body2 = (0, import_react97.forwardRef)(
|
|
|
12786
12813
|
Body2.displayName = "Table.Body";
|
|
12787
12814
|
|
|
12788
12815
|
// src/components/Table/normal/Cell.tsx
|
|
12789
|
-
var
|
|
12816
|
+
var import_react100 = require("react");
|
|
12790
12817
|
var import_styled_components82 = __toESM(require("styled-components"));
|
|
12791
12818
|
|
|
12792
12819
|
// src/components/Table/normal/Head.tsx
|
|
12793
|
-
var
|
|
12820
|
+
var import_react99 = require("react");
|
|
12794
12821
|
var import_styled_components81 = __toESM(require("styled-components"));
|
|
12795
12822
|
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
12796
12823
|
var StyledHead = import_styled_components81.default.thead``;
|
|
12797
|
-
var Head = (0,
|
|
12824
|
+
var Head = (0, import_react99.forwardRef)(
|
|
12798
12825
|
({ children, ...rest }, ref) => {
|
|
12799
12826
|
return /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(StyledHead, { ref, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(HeadContext.Provider, { value: true, children }) });
|
|
12800
12827
|
}
|
|
12801
12828
|
);
|
|
12802
12829
|
Head.displayName = "Table.Head";
|
|
12803
|
-
var HeadContext = (0,
|
|
12830
|
+
var HeadContext = (0, import_react99.createContext)(false);
|
|
12804
12831
|
function useIsInTableHead() {
|
|
12805
|
-
const isInTableHead = (0,
|
|
12832
|
+
const isInTableHead = (0, import_react99.useContext)(HeadContext);
|
|
12806
12833
|
return isInTableHead;
|
|
12807
12834
|
}
|
|
12808
12835
|
|
|
@@ -12919,7 +12946,7 @@ var getTableCellType = (type) => {
|
|
|
12919
12946
|
return "td";
|
|
12920
12947
|
}
|
|
12921
12948
|
};
|
|
12922
|
-
var Cell2 = (0,
|
|
12949
|
+
var Cell2 = (0, import_react100.forwardRef)(
|
|
12923
12950
|
({ children, type: _type, layout = "left", collapsibleProps, ...rest }, ref) => {
|
|
12924
12951
|
const isInHead = useIsInTableHead();
|
|
12925
12952
|
const type = _type != null ? _type : isInHead ? "head" : "data";
|
|
@@ -12931,11 +12958,11 @@ var Cell2 = (0, import_react99.forwardRef)(
|
|
|
12931
12958
|
Cell2.displayName = "Table.Cell";
|
|
12932
12959
|
|
|
12933
12960
|
// src/components/Table/normal/Foot.tsx
|
|
12934
|
-
var
|
|
12961
|
+
var import_react101 = require("react");
|
|
12935
12962
|
var import_styled_components83 = __toESM(require("styled-components"));
|
|
12936
12963
|
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
12937
12964
|
var StyledFoot = import_styled_components83.default.tfoot``;
|
|
12938
|
-
var Foot = (0,
|
|
12965
|
+
var Foot = (0, import_react101.forwardRef)(
|
|
12939
12966
|
({ children, ...rest }, ref) => {
|
|
12940
12967
|
return /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(StyledFoot, { ref, ...rest, children });
|
|
12941
12968
|
}
|
|
@@ -12943,7 +12970,7 @@ var Foot = (0, import_react100.forwardRef)(
|
|
|
12943
12970
|
Foot.displayName = "Table.Foot";
|
|
12944
12971
|
|
|
12945
12972
|
// src/components/Table/normal/Row.tsx
|
|
12946
|
-
var
|
|
12973
|
+
var import_react102 = require("react");
|
|
12947
12974
|
|
|
12948
12975
|
// src/components/Table/normal/Table.styles.tsx
|
|
12949
12976
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
@@ -12999,7 +13026,7 @@ var StyledRow = import_styled_components84.default.tr`
|
|
|
12999
13026
|
|
|
13000
13027
|
// src/components/Table/normal/Row.tsx
|
|
13001
13028
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
13002
|
-
var Row = (0,
|
|
13029
|
+
var Row = (0, import_react102.forwardRef)(
|
|
13003
13030
|
({ type: _type, mode = "normal", hoverable, selected, children, ...rest }, ref) => {
|
|
13004
13031
|
const isInHeader = useIsInTableHead();
|
|
13005
13032
|
const type = _type != null ? _type : isInHeader ? "head" : "body";
|
|
@@ -13020,7 +13047,7 @@ var Row = (0, import_react101.forwardRef)(
|
|
|
13020
13047
|
Row.displayName = "Table.Row";
|
|
13021
13048
|
|
|
13022
13049
|
// src/components/Table/normal/SortCell.tsx
|
|
13023
|
-
var
|
|
13050
|
+
var import_react103 = require("react");
|
|
13024
13051
|
var import_styled_components85 = __toESM(require("styled-components"));
|
|
13025
13052
|
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
13026
13053
|
var { cell: cell4 } = tableTokens;
|
|
@@ -13041,7 +13068,7 @@ var makeSortIcon = (isSorted, sortOrder) => {
|
|
|
13041
13068
|
}
|
|
13042
13069
|
return sortOrder === "ascending" ? /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(Icon, { icon: ChevronDownIcon, iconSize: "inherit" }) : /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(Icon, { icon: ChevronUpIcon, iconSize: "inherit" });
|
|
13043
13070
|
};
|
|
13044
|
-
var SortCell = (0,
|
|
13071
|
+
var SortCell = (0, import_react103.forwardRef)(
|
|
13045
13072
|
({ isSorted, sortOrder, onClick, children, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(
|
|
13046
13073
|
Cell2,
|
|
13047
13074
|
{
|
|
@@ -13067,7 +13094,7 @@ var SortCell = (0, import_react102.forwardRef)(
|
|
|
13067
13094
|
SortCell.displayName = "Table.SortCell";
|
|
13068
13095
|
|
|
13069
13096
|
// src/components/Table/normal/Table.tsx
|
|
13070
|
-
var
|
|
13097
|
+
var import_react104 = require("react");
|
|
13071
13098
|
var import_styled_components86 = __toESM(require("styled-components"));
|
|
13072
13099
|
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
13073
13100
|
var { cell: cell5, row: row3 } = tableTokens;
|
|
@@ -13114,7 +13141,7 @@ var StyledTable = import_styled_components86.default.table`
|
|
|
13114
13141
|
}
|
|
13115
13142
|
`}
|
|
13116
13143
|
`;
|
|
13117
|
-
var Table = (0,
|
|
13144
|
+
var Table = (0, import_react104.forwardRef)(
|
|
13118
13145
|
({ density = "normal", stickyHeader, withDividers, children, ...rest }, ref) => {
|
|
13119
13146
|
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
13120
13147
|
StyledTable,
|
|
@@ -13132,7 +13159,7 @@ var Table = (0, import_react103.forwardRef)(
|
|
|
13132
13159
|
Table.displayName = "Table";
|
|
13133
13160
|
|
|
13134
13161
|
// src/components/Table/normal/TableWrapper.tsx
|
|
13135
|
-
var
|
|
13162
|
+
var import_react105 = require("react");
|
|
13136
13163
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
13137
13164
|
var import_jsx_runtime260 = require("react/jsx-runtime");
|
|
13138
13165
|
var Wrapper6 = import_styled_components87.default.div`
|
|
@@ -13143,20 +13170,20 @@ var Wrapper6 = import_styled_components87.default.div`
|
|
|
13143
13170
|
${scrollbarStyling.firefox}
|
|
13144
13171
|
`;
|
|
13145
13172
|
var TableWrapper = ({ children, ...rest }) => {
|
|
13146
|
-
const [overflowX, setOverflowX] = (0,
|
|
13147
|
-
const [windowWidth, setWindowWidth] = (0,
|
|
13173
|
+
const [overflowX, setOverflowX] = (0, import_react105.useState)(false);
|
|
13174
|
+
const [windowWidth, setWindowWidth] = (0, import_react105.useState)(window.innerWidth);
|
|
13148
13175
|
function isOverflowingX(event) {
|
|
13149
13176
|
return event.offsetWidth < event.scrollWidth;
|
|
13150
13177
|
}
|
|
13151
|
-
const wrapperRef = (0,
|
|
13152
|
-
(0,
|
|
13178
|
+
const wrapperRef = (0, import_react105.useRef)(null);
|
|
13179
|
+
(0, import_react105.useEffect)(() => {
|
|
13153
13180
|
if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
|
|
13154
13181
|
setOverflowX(true);
|
|
13155
13182
|
return;
|
|
13156
13183
|
}
|
|
13157
13184
|
setOverflowX(false);
|
|
13158
13185
|
}, [windowWidth]);
|
|
13159
|
-
(0,
|
|
13186
|
+
(0, import_react105.useEffect)(() => {
|
|
13160
13187
|
function handleResize() {
|
|
13161
13188
|
setWindowWidth(window.innerWidth);
|
|
13162
13189
|
}
|
|
@@ -13200,7 +13227,7 @@ var DescriptionListCell = (0, import_styled_components88.default)(Cell2)`
|
|
|
13200
13227
|
display: block;
|
|
13201
13228
|
}
|
|
13202
13229
|
`;
|
|
13203
|
-
var CollapsibleRow = (0,
|
|
13230
|
+
var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
13204
13231
|
({ type: _type, mode = "normal", selected, hoverable, children, ...rest }, ref) => {
|
|
13205
13232
|
const isInHead = useIsInTableHead();
|
|
13206
13233
|
const type = _type != null ? _type : isInHead ? "head" : "body";
|
|
@@ -13212,14 +13239,14 @@ var CollapsibleRow = (0, import_react105.forwardRef)(
|
|
|
13212
13239
|
...rest
|
|
13213
13240
|
};
|
|
13214
13241
|
const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
|
|
13215
|
-
const [childrenCollapsed, setChildrenCollapsed] = (0,
|
|
13216
|
-
(0,
|
|
13242
|
+
const [childrenCollapsed, setChildrenCollapsed] = (0, import_react106.useState)(true);
|
|
13243
|
+
(0, import_react106.useEffect)(() => {
|
|
13217
13244
|
!isCollapsed && setChildrenCollapsed(true);
|
|
13218
13245
|
}, [isCollapsed]);
|
|
13219
13246
|
const collapsedHeaderValues = headerValues.filter(
|
|
13220
13247
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
13221
13248
|
);
|
|
13222
|
-
const childrenArray =
|
|
13249
|
+
const childrenArray = import_react106.Children.toArray(children);
|
|
13223
13250
|
const collapsedChildren = childrenArray.filter(
|
|
13224
13251
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
13225
13252
|
);
|
|
@@ -13228,9 +13255,9 @@ var CollapsibleRow = (0, import_react105.forwardRef)(
|
|
|
13228
13255
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
13229
13256
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
13230
13257
|
collapsibleIds.push(id);
|
|
13231
|
-
return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(
|
|
13258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(import_react106.Fragment, { children: [
|
|
13232
13259
|
/* @__PURE__ */ (0, import_jsx_runtime261.jsx)(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
|
|
13233
|
-
(0,
|
|
13260
|
+
(0, import_react106.isValidElement)(child) && (0, import_react106.cloneElement)(child, {
|
|
13234
13261
|
collapsibleProps: { isCollapsibleChild: true }
|
|
13235
13262
|
})
|
|
13236
13263
|
] }, `DL-${index}`);
|
|
@@ -13295,7 +13322,7 @@ var CollapsibleRow = (0, import_react105.forwardRef)(
|
|
|
13295
13322
|
CollapsibleRow.displayName = "CollapsibleTable.Row";
|
|
13296
13323
|
|
|
13297
13324
|
// src/components/Table/collapsible/CollapsibleTable.tsx
|
|
13298
|
-
var
|
|
13325
|
+
var import_react107 = require("react");
|
|
13299
13326
|
var import_styled_components89 = __toESM(require("styled-components"));
|
|
13300
13327
|
var import_jsx_runtime262 = require("react/jsx-runtime");
|
|
13301
13328
|
var StyledTable2 = (0, import_styled_components89.default)(Table2)`
|
|
@@ -13306,7 +13333,7 @@ var StyledTable2 = (0, import_styled_components89.default)(Table2)`
|
|
|
13306
13333
|
}
|
|
13307
13334
|
`}
|
|
13308
13335
|
`;
|
|
13309
|
-
var CollapsibleTable = (0,
|
|
13336
|
+
var CollapsibleTable = (0, import_react107.forwardRef)((props, ref) => {
|
|
13310
13337
|
const {
|
|
13311
13338
|
density = "normal",
|
|
13312
13339
|
children,
|
|
@@ -13334,12 +13361,12 @@ var CollapsibleTable2 = CollapsibleTable;
|
|
|
13334
13361
|
CollapsibleTable2.Row = CollapsibleRow;
|
|
13335
13362
|
|
|
13336
13363
|
// src/components/Tabs/Tabs.tsx
|
|
13337
|
-
var
|
|
13364
|
+
var import_react109 = require("react");
|
|
13338
13365
|
var import_styled_components90 = __toESM(require("styled-components"));
|
|
13339
13366
|
|
|
13340
13367
|
// src/components/Tabs/Tabs.context.tsx
|
|
13341
|
-
var
|
|
13342
|
-
var TabsContext = (0,
|
|
13368
|
+
var import_react108 = require("react");
|
|
13369
|
+
var TabsContext = (0, import_react108.createContext)({
|
|
13343
13370
|
activeTab: 0,
|
|
13344
13371
|
tabsId: "",
|
|
13345
13372
|
handleTabChange: () => null,
|
|
@@ -13349,7 +13376,7 @@ var TabsContext = (0, import_react107.createContext)({
|
|
|
13349
13376
|
setHasTabFocus: () => null,
|
|
13350
13377
|
tabContentDirection: "row"
|
|
13351
13378
|
});
|
|
13352
|
-
var useTabsContext = () => (0,
|
|
13379
|
+
var useTabsContext = () => (0, import_react108.useContext)(TabsContext);
|
|
13353
13380
|
|
|
13354
13381
|
// src/components/Tabs/Tabs.tsx
|
|
13355
13382
|
var import_jsx_runtime263 = require("react/jsx-runtime");
|
|
@@ -13358,7 +13385,7 @@ var Container15 = import_styled_components90.default.div`
|
|
|
13358
13385
|
width: ${$width};
|
|
13359
13386
|
`};
|
|
13360
13387
|
`;
|
|
13361
|
-
var Tabs = (0,
|
|
13388
|
+
var Tabs = (0, import_react109.forwardRef)((props, ref) => {
|
|
13362
13389
|
const {
|
|
13363
13390
|
id,
|
|
13364
13391
|
activeTab,
|
|
@@ -13370,17 +13397,17 @@ var Tabs = (0, import_react108.forwardRef)((props, ref) => {
|
|
|
13370
13397
|
htmlProps,
|
|
13371
13398
|
...rest
|
|
13372
13399
|
} = props;
|
|
13373
|
-
const generatedId = (0,
|
|
13400
|
+
const generatedId = (0, import_react109.useId)();
|
|
13374
13401
|
const uniqueId = id != null ? id : `${generatedId}-tabs`;
|
|
13375
|
-
const [thisActiveTab, setActiveTab] = (0,
|
|
13376
|
-
const [hasTabFocus, setHasTabFocus] = (0,
|
|
13377
|
-
const tabListRef = (0,
|
|
13378
|
-
const tabPanelsRef = (0,
|
|
13402
|
+
const [thisActiveTab, setActiveTab] = (0, import_react109.useState)(activeTab != null ? activeTab : 0);
|
|
13403
|
+
const [hasTabFocus, setHasTabFocus] = (0, import_react109.useState)(false);
|
|
13404
|
+
const tabListRef = (0, import_react109.useRef)(null);
|
|
13405
|
+
const tabPanelsRef = (0, import_react109.useRef)(null);
|
|
13379
13406
|
const handleTabChange = (index) => {
|
|
13380
13407
|
setActiveTab(index);
|
|
13381
13408
|
onChange && onChange(index);
|
|
13382
13409
|
};
|
|
13383
|
-
(0,
|
|
13410
|
+
(0, import_react109.useEffect)(() => {
|
|
13384
13411
|
if (activeTab !== void 0 && activeTab !== thisActiveTab) {
|
|
13385
13412
|
setActiveTab(activeTab);
|
|
13386
13413
|
}
|
|
@@ -13409,7 +13436,7 @@ var Tabs = (0, import_react108.forwardRef)((props, ref) => {
|
|
|
13409
13436
|
Tabs.displayName = "Tabs";
|
|
13410
13437
|
|
|
13411
13438
|
// src/components/Tabs/Tab.tsx
|
|
13412
|
-
var
|
|
13439
|
+
var import_react111 = require("react");
|
|
13413
13440
|
var import_styled_components91 = __toESM(require("styled-components"));
|
|
13414
13441
|
|
|
13415
13442
|
// src/components/Tabs/Tabs.tokens.tsx
|
|
@@ -13452,9 +13479,9 @@ var tabsTokens = {
|
|
|
13452
13479
|
};
|
|
13453
13480
|
|
|
13454
13481
|
// src/components/Tabs/TabWidthContext.tsx
|
|
13455
|
-
var
|
|
13482
|
+
var import_react110 = require("react");
|
|
13456
13483
|
var import_jsx_runtime264 = require("react/jsx-runtime");
|
|
13457
|
-
var TabContext = (0,
|
|
13484
|
+
var TabContext = (0, import_react110.createContext)(null);
|
|
13458
13485
|
function TabWidthContextProvider({
|
|
13459
13486
|
children,
|
|
13460
13487
|
onChangeWidths
|
|
@@ -13483,8 +13510,8 @@ function TabWidthContextProvider({
|
|
|
13483
13510
|
);
|
|
13484
13511
|
}
|
|
13485
13512
|
function useSetTabWidth(index, width) {
|
|
13486
|
-
const context = (0,
|
|
13487
|
-
(0,
|
|
13513
|
+
const context = (0, import_react110.useContext)(TabContext);
|
|
13514
|
+
(0, import_react110.useLayoutEffect)(() => {
|
|
13488
13515
|
context == null ? void 0 : context.updateWidth(index, width);
|
|
13489
13516
|
return () => context == null ? void 0 : context.removeTab(index);
|
|
13490
13517
|
}, [index, width]);
|
|
@@ -13536,7 +13563,7 @@ var Button2 = import_styled_components91.default.button`
|
|
|
13536
13563
|
box-shadow: ${tab2.hover.boxShadow};
|
|
13537
13564
|
}
|
|
13538
13565
|
`;
|
|
13539
|
-
var Tab = (0,
|
|
13566
|
+
var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
13540
13567
|
const {
|
|
13541
13568
|
active = false,
|
|
13542
13569
|
icon: icon11,
|
|
@@ -13553,16 +13580,16 @@ var Tab = (0, import_react110.forwardRef)((props, ref) => {
|
|
|
13553
13580
|
...rest
|
|
13554
13581
|
} = props;
|
|
13555
13582
|
useSetTabWidth(index, width);
|
|
13556
|
-
const itemRef = (0,
|
|
13583
|
+
const itemRef = (0, import_react111.useRef)(null);
|
|
13557
13584
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
13558
13585
|
const { tabContentDirection } = useTabsContext();
|
|
13559
|
-
(0,
|
|
13586
|
+
(0, import_react111.useEffect)(() => {
|
|
13560
13587
|
var _a;
|
|
13561
13588
|
if (focus) {
|
|
13562
13589
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
13563
13590
|
}
|
|
13564
13591
|
}, [focus]);
|
|
13565
|
-
const handleSelect = (0,
|
|
13592
|
+
const handleSelect = (0, import_react111.useCallback)(() => {
|
|
13566
13593
|
if (setFocus && index) {
|
|
13567
13594
|
setFocus(index);
|
|
13568
13595
|
}
|
|
@@ -13597,7 +13624,7 @@ var Tab = (0, import_react110.forwardRef)((props, ref) => {
|
|
|
13597
13624
|
Tab.displayName = "Tab";
|
|
13598
13625
|
|
|
13599
13626
|
// src/components/Tabs/TabList.tsx
|
|
13600
|
-
var
|
|
13627
|
+
var import_react112 = require("react");
|
|
13601
13628
|
var import_styled_components92 = __toESM(require("styled-components"));
|
|
13602
13629
|
var import_jsx_runtime266 = require("react/jsx-runtime");
|
|
13603
13630
|
var { tabList: tabList2 } = tabsTokens;
|
|
@@ -13627,7 +13654,7 @@ var TabRow = import_styled_components92.default.div`
|
|
|
13627
13654
|
outline: none;
|
|
13628
13655
|
}
|
|
13629
13656
|
`;
|
|
13630
|
-
var TabList = (0,
|
|
13657
|
+
var TabList = (0, import_react112.forwardRef)(
|
|
13631
13658
|
({ children, id, onFocus, ...rest }, ref) => {
|
|
13632
13659
|
const {
|
|
13633
13660
|
activeTab,
|
|
@@ -13638,11 +13665,11 @@ var TabList = (0, import_react111.forwardRef)(
|
|
|
13638
13665
|
setHasTabFocus
|
|
13639
13666
|
} = useTabsContext();
|
|
13640
13667
|
const uniqueId = id != null ? id : `${tabsId}-tablist`;
|
|
13641
|
-
const childrenArray =
|
|
13668
|
+
const childrenArray = import_react112.Children.toArray(children).length;
|
|
13642
13669
|
const [focus, setFocus] = useRoveFocus(childrenArray, hasTabFocus, "row");
|
|
13643
13670
|
const combinedRef = useCombinedRef(ref, tabListRef);
|
|
13644
|
-
const tabListChildren =
|
|
13645
|
-
return (0,
|
|
13671
|
+
const tabListChildren = import_react112.Children.map(children, (child, index) => {
|
|
13672
|
+
return (0, import_react112.isValidElement)(child) && (0, import_react112.cloneElement)(child, {
|
|
13646
13673
|
id: `${tabsId}-tab-${index}`,
|
|
13647
13674
|
"aria-controls": `${tabsId}-panel-${index}`,
|
|
13648
13675
|
active: activeTab === index,
|
|
@@ -13652,7 +13679,7 @@ var TabList = (0, import_react111.forwardRef)(
|
|
|
13652
13679
|
onClick: () => handleTabChange(index)
|
|
13653
13680
|
});
|
|
13654
13681
|
});
|
|
13655
|
-
const [widths, setWidths] = (0,
|
|
13682
|
+
const [widths, setWidths] = (0, import_react112.useState)([]);
|
|
13656
13683
|
const handleOnFocus = (event) => {
|
|
13657
13684
|
setHasTabFocus(true);
|
|
13658
13685
|
onFocus && onFocus(event);
|
|
@@ -13686,7 +13713,7 @@ var TabList = (0, import_react111.forwardRef)(
|
|
|
13686
13713
|
TabList.displayName = "TabList";
|
|
13687
13714
|
|
|
13688
13715
|
// src/components/Tabs/TabPanel.tsx
|
|
13689
|
-
var
|
|
13716
|
+
var import_react113 = require("react");
|
|
13690
13717
|
var import_styled_components93 = __toESM(require("styled-components"));
|
|
13691
13718
|
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
13692
13719
|
var { panel: panel2 } = tabsTokens;
|
|
@@ -13703,7 +13730,7 @@ var Panel = import_styled_components93.default.div`
|
|
|
13703
13730
|
${focusVisible}
|
|
13704
13731
|
}
|
|
13705
13732
|
`;
|
|
13706
|
-
var TabPanel = (0,
|
|
13733
|
+
var TabPanel = (0, import_react113.forwardRef)(
|
|
13707
13734
|
({ active = false, children, id, className, htmlProps, ...rest }, ref) => {
|
|
13708
13735
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
13709
13736
|
Panel,
|
|
@@ -13721,15 +13748,15 @@ var TabPanel = (0, import_react112.forwardRef)(
|
|
|
13721
13748
|
TabPanel.displayName = "TabPanel";
|
|
13722
13749
|
|
|
13723
13750
|
// src/components/Tabs/TabPanels.tsx
|
|
13724
|
-
var
|
|
13751
|
+
var import_react114 = require("react");
|
|
13725
13752
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
13726
|
-
var TabPanels = (0,
|
|
13753
|
+
var TabPanels = (0, import_react114.forwardRef)(
|
|
13727
13754
|
({ children, ...rest }, ref) => {
|
|
13728
13755
|
const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
|
|
13729
13756
|
const combinedRef = useCombinedRef(ref, tabPanelsRef);
|
|
13730
|
-
const panelChildren =
|
|
13757
|
+
const panelChildren = import_react114.Children.map(children, (child, index) => {
|
|
13731
13758
|
const active = index === activeTab;
|
|
13732
|
-
return (0,
|
|
13759
|
+
return (0, import_react114.isValidElement)(child) && (0, import_react114.cloneElement)(child, {
|
|
13733
13760
|
id: `${tabsId}-panel-${index}`,
|
|
13734
13761
|
"aria-labelledby": `${tabsId}-tab-${index}`,
|
|
13735
13762
|
active,
|
|
@@ -13742,7 +13769,7 @@ var TabPanels = (0, import_react113.forwardRef)(
|
|
|
13742
13769
|
TabPanels.displayName = "TabPanels";
|
|
13743
13770
|
|
|
13744
13771
|
// src/components/Tag/Tag.tsx
|
|
13745
|
-
var
|
|
13772
|
+
var import_react115 = require("react");
|
|
13746
13773
|
var import_styled_components94 = __toESM(require("styled-components"));
|
|
13747
13774
|
|
|
13748
13775
|
// src/components/Tag/Tag.tokens.tsx
|
|
@@ -13869,7 +13896,7 @@ var StyledIcon4 = (0, import_styled_components94.default)(Icon)`
|
|
|
13869
13896
|
return (_a = wrapper8.purpose[$purpose][$strong ? "strong" : "base"].icon) == null ? void 0 : _a.color;
|
|
13870
13897
|
}};
|
|
13871
13898
|
`;
|
|
13872
|
-
var Tag = (0,
|
|
13899
|
+
var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
13873
13900
|
const {
|
|
13874
13901
|
text,
|
|
13875
13902
|
purpose = "default",
|
|
@@ -13908,11 +13935,11 @@ var Tag = (0, import_react114.forwardRef)((props, ref) => {
|
|
|
13908
13935
|
Tag.displayName = "Tag";
|
|
13909
13936
|
|
|
13910
13937
|
// src/components/TextInput/TextInput.tsx
|
|
13911
|
-
var
|
|
13938
|
+
var import_react117 = require("react");
|
|
13912
13939
|
var import_styled_components97 = __toESM(require("styled-components"));
|
|
13913
13940
|
|
|
13914
13941
|
// src/components/TextInput/CharCounter.tsx
|
|
13915
|
-
var
|
|
13942
|
+
var import_react116 = require("react");
|
|
13916
13943
|
var import_styled_components95 = __toESM(require("styled-components"));
|
|
13917
13944
|
var import_jsx_runtime270 = require("react/jsx-runtime");
|
|
13918
13945
|
var Wrapper8 = (0, import_styled_components95.default)(Typography)`
|
|
@@ -13920,7 +13947,7 @@ var Wrapper8 = (0, import_styled_components95.default)(Typography)`
|
|
|
13920
13947
|
`;
|
|
13921
13948
|
function CharCounter(props) {
|
|
13922
13949
|
const { current, max, id, className, htmlProps, ...rest } = props;
|
|
13923
|
-
const generatedId = (0,
|
|
13950
|
+
const generatedId = (0, import_react116.useId)();
|
|
13924
13951
|
const uniqueId = id != null ? id : `${generatedId}-characterCounter`;
|
|
13925
13952
|
return /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(
|
|
13926
13953
|
Wrapper8,
|
|
@@ -14059,7 +14086,7 @@ var Suffix = (0, import_styled_components97.default)(Affix)`
|
|
|
14059
14086
|
border-left: none;
|
|
14060
14087
|
`};
|
|
14061
14088
|
`;
|
|
14062
|
-
var TextInput2 = (0,
|
|
14089
|
+
var TextInput2 = (0, import_react117.forwardRef)(
|
|
14063
14090
|
({
|
|
14064
14091
|
label: label3,
|
|
14065
14092
|
disabled,
|
|
@@ -14085,14 +14112,14 @@ var TextInput2 = (0, import_react116.forwardRef)(
|
|
|
14085
14112
|
suffix,
|
|
14086
14113
|
...rest
|
|
14087
14114
|
}, ref) => {
|
|
14088
|
-
const [text, setText] = (0,
|
|
14115
|
+
const [text, setText] = (0, import_react117.useState)(
|
|
14089
14116
|
getDefaultText(value, defaultValue)
|
|
14090
14117
|
);
|
|
14091
|
-
const prefixRef = (0,
|
|
14092
|
-
const suffixRef = (0,
|
|
14093
|
-
const [prefixLength, setPrefixLength] = (0,
|
|
14094
|
-
const [suffixLength, setSuffixLength] = (0,
|
|
14095
|
-
(0,
|
|
14118
|
+
const prefixRef = (0, import_react117.useRef)(null);
|
|
14119
|
+
const suffixRef = (0, import_react117.useRef)(null);
|
|
14120
|
+
const [prefixLength, setPrefixLength] = (0, import_react117.useState)(0);
|
|
14121
|
+
const [suffixLength, setSuffixLength] = (0, import_react117.useState)(0);
|
|
14122
|
+
(0, import_react117.useLayoutEffect)(() => {
|
|
14096
14123
|
if (prefixRef.current) {
|
|
14097
14124
|
setPrefixLength(prefixRef.current.offsetWidth);
|
|
14098
14125
|
}
|
|
@@ -14106,7 +14133,7 @@ var TextInput2 = (0, import_react116.forwardRef)(
|
|
|
14106
14133
|
onChange(event);
|
|
14107
14134
|
}
|
|
14108
14135
|
};
|
|
14109
|
-
const generatedId = (0,
|
|
14136
|
+
const generatedId = (0, import_react117.useId)();
|
|
14110
14137
|
const uniqueId = id != null ? id : `${generatedId}-textInput`;
|
|
14111
14138
|
const hasErrorMessage = !!errorMessage;
|
|
14112
14139
|
const hasTip = !!tip;
|
|
@@ -14216,15 +14243,15 @@ var TextInput2 = (0, import_react116.forwardRef)(
|
|
|
14216
14243
|
TextInput2.displayName = "TextInput";
|
|
14217
14244
|
|
|
14218
14245
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
14219
|
-
var
|
|
14246
|
+
var import_react119 = require("react");
|
|
14220
14247
|
var import_styled_components98 = __toESM(require("styled-components"));
|
|
14221
14248
|
|
|
14222
14249
|
// src/components/ToggleBar/ToggleBar.context.tsx
|
|
14223
|
-
var
|
|
14224
|
-
var ToggleBarContext = (0,
|
|
14250
|
+
var import_react118 = require("react");
|
|
14251
|
+
var ToggleBarContext = (0, import_react118.createContext)({
|
|
14225
14252
|
size: "medium"
|
|
14226
14253
|
});
|
|
14227
|
-
var useToggleBarContext = () => (0,
|
|
14254
|
+
var useToggleBarContext = () => (0, import_react118.useContext)(ToggleBarContext);
|
|
14228
14255
|
|
|
14229
14256
|
// src/components/ToggleBar/ToggleBar.tokens.tsx
|
|
14230
14257
|
var import_dds_design_tokens63 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -14365,9 +14392,9 @@ var ToggleBar = (props) => {
|
|
|
14365
14392
|
id,
|
|
14366
14393
|
...rest
|
|
14367
14394
|
} = props;
|
|
14368
|
-
const generatedId = (0,
|
|
14395
|
+
const generatedId = (0, import_react119.useId)();
|
|
14369
14396
|
const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
|
|
14370
|
-
const [groupValue, setGroupValue] = (0,
|
|
14397
|
+
const [groupValue, setGroupValue] = (0, import_react119.useState)(value);
|
|
14371
14398
|
const handleChange = combineHandlers(
|
|
14372
14399
|
(e) => setGroupValue(e.target.value),
|
|
14373
14400
|
(e) => onChange && onChange(e, e.target.value)
|
|
@@ -14401,7 +14428,7 @@ var ToggleBar = (props) => {
|
|
|
14401
14428
|
ToggleBar.displayName = "ToggleBar";
|
|
14402
14429
|
|
|
14403
14430
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
14404
|
-
var
|
|
14431
|
+
var import_react120 = require("react");
|
|
14405
14432
|
|
|
14406
14433
|
// src/components/ToggleBar/ToggleRadio.styles.tsx
|
|
14407
14434
|
var import_styled_components99 = __toESM(require("styled-components"));
|
|
@@ -14485,7 +14512,7 @@ var calculateChecked = (value, group4, checked) => {
|
|
|
14485
14512
|
}
|
|
14486
14513
|
return !!value;
|
|
14487
14514
|
};
|
|
14488
|
-
var ToggleRadio = (0,
|
|
14515
|
+
var ToggleRadio = (0, import_react120.forwardRef)(
|
|
14489
14516
|
(props, ref) => {
|
|
14490
14517
|
const {
|
|
14491
14518
|
value,
|
|
@@ -14501,7 +14528,7 @@ var ToggleRadio = (0, import_react119.forwardRef)(
|
|
|
14501
14528
|
id,
|
|
14502
14529
|
...rest
|
|
14503
14530
|
} = props;
|
|
14504
|
-
const generatedId = (0,
|
|
14531
|
+
const generatedId = (0, import_react120.useId)();
|
|
14505
14532
|
const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
|
|
14506
14533
|
const group4 = useToggleBarContext();
|
|
14507
14534
|
const handleChange = (event) => {
|
|
@@ -14533,7 +14560,7 @@ var ToggleRadio = (0, import_react119.forwardRef)(
|
|
|
14533
14560
|
ToggleRadio.displayName = "ToggleRadio";
|
|
14534
14561
|
|
|
14535
14562
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
14536
|
-
var
|
|
14563
|
+
var import_react121 = require("react");
|
|
14537
14564
|
var import_styled_components100 = __toESM(require("styled-components"));
|
|
14538
14565
|
|
|
14539
14566
|
// src/components/ToggleButton/ToggleButton.tokens.tsx
|
|
@@ -14623,9 +14650,9 @@ var Container16 = import_styled_components100.default.label`
|
|
|
14623
14650
|
${focusVisible}
|
|
14624
14651
|
}
|
|
14625
14652
|
`;
|
|
14626
|
-
var ToggleButton = (0,
|
|
14653
|
+
var ToggleButton = (0, import_react121.forwardRef)(
|
|
14627
14654
|
({ id, label: label3, icon: icon11, className, htmlProps, ...rest }, ref) => {
|
|
14628
|
-
const generatedId = (0,
|
|
14655
|
+
const generatedId = (0, import_react121.useId)();
|
|
14629
14656
|
const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
|
|
14630
14657
|
return /* @__PURE__ */ (0, import_jsx_runtime274.jsxs)(Container16, { htmlFor: uniqueId, children: [
|
|
14631
14658
|
/* @__PURE__ */ (0, import_jsx_runtime274.jsx)(
|
|
@@ -14647,7 +14674,7 @@ var ToggleButton = (0, import_react120.forwardRef)(
|
|
|
14647
14674
|
ToggleButton.displayName = "ToggleButton";
|
|
14648
14675
|
|
|
14649
14676
|
// src/components/ToggleButton/ToggleButtonGroup.tsx
|
|
14650
|
-
var
|
|
14677
|
+
var import_react122 = require("react");
|
|
14651
14678
|
var import_styled_components101 = __toESM(require("styled-components"));
|
|
14652
14679
|
var import_jsx_runtime275 = require("react/jsx-runtime");
|
|
14653
14680
|
var Group2 = import_styled_components101.default.div`
|
|
@@ -14674,7 +14701,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
14674
14701
|
htmlProps,
|
|
14675
14702
|
...rest
|
|
14676
14703
|
} = props;
|
|
14677
|
-
const generatedId = (0,
|
|
14704
|
+
const generatedId = (0, import_react122.useId)();
|
|
14678
14705
|
const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
|
|
14679
14706
|
const groupProps = {
|
|
14680
14707
|
direction
|