@norges-domstoler/dds-components 0.0.0-dev-20240304122815 → 0.0.0-dev-20240305134743
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 +405 -403
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +122 -118
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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) => {
|
|
@@ -8284,18 +8286,18 @@ var useFileUploader = (props) => {
|
|
|
8284
8286
|
disabled,
|
|
8285
8287
|
errorMessage
|
|
8286
8288
|
} = props;
|
|
8287
|
-
const rootRef = (0,
|
|
8288
|
-
const inputRef = (0,
|
|
8289
|
-
const buttonRef = (0,
|
|
8289
|
+
const rootRef = (0, import_react61.useRef)(null);
|
|
8290
|
+
const inputRef = (0, import_react61.useRef)(null);
|
|
8291
|
+
const buttonRef = (0, import_react61.useRef)(null);
|
|
8290
8292
|
const isControlled = !!value;
|
|
8291
|
-
const initialFileUploaderFiles = (0,
|
|
8293
|
+
const initialFileUploaderFiles = (0, import_react61.useMemo)(
|
|
8292
8294
|
() => (initialFiles != null ? initialFiles : []).map((f) => ({
|
|
8293
8295
|
file: f,
|
|
8294
8296
|
errors: []
|
|
8295
8297
|
})),
|
|
8296
8298
|
[initialFiles]
|
|
8297
8299
|
);
|
|
8298
|
-
const [state, dispatch] = (0,
|
|
8300
|
+
const [state, dispatch] = (0, import_react61.useReducer)(fileUploaderReducer, {
|
|
8299
8301
|
files: initialFileUploaderFiles,
|
|
8300
8302
|
isFocused: false,
|
|
8301
8303
|
isFileDialogActive: false,
|
|
@@ -8307,7 +8309,7 @@ var useFileUploader = (props) => {
|
|
|
8307
8309
|
)
|
|
8308
8310
|
});
|
|
8309
8311
|
const { files: stateFiles } = state;
|
|
8310
|
-
(0,
|
|
8312
|
+
(0, import_react61.useEffect)(() => {
|
|
8311
8313
|
if (isControlled) {
|
|
8312
8314
|
const files = value.map((file) => {
|
|
8313
8315
|
const accepted2 = isFileAccepted(file, accept);
|
|
@@ -8322,18 +8324,18 @@ var useFileUploader = (props) => {
|
|
|
8322
8324
|
});
|
|
8323
8325
|
}
|
|
8324
8326
|
}, [value, isControlled, accept, dispatch]);
|
|
8325
|
-
(0,
|
|
8327
|
+
(0, import_react61.useEffect)(() => {
|
|
8326
8328
|
dispatch({
|
|
8327
8329
|
type: "setRootErrors",
|
|
8328
8330
|
payload: calcRootErrors(stateFiles, maxFiles, errorMessage)
|
|
8329
8331
|
});
|
|
8330
8332
|
}, [dispatch, stateFiles, maxFiles, errorMessage]);
|
|
8331
|
-
const onRootFocus = (0,
|
|
8333
|
+
const onRootFocus = (0, import_react61.useCallback)(
|
|
8332
8334
|
() => dispatch({ type: "focus" }),
|
|
8333
8335
|
[dispatch]
|
|
8334
8336
|
);
|
|
8335
|
-
const onRootBlur = (0,
|
|
8336
|
-
const onRootDragEnter = (0,
|
|
8337
|
+
const onRootBlur = (0, import_react61.useCallback)(() => dispatch({ type: "blur" }), [dispatch]);
|
|
8338
|
+
const onRootDragEnter = (0, import_react61.useCallback)(
|
|
8337
8339
|
async (evt) => {
|
|
8338
8340
|
preventDefaults(evt);
|
|
8339
8341
|
if (isEventWithFiles(evt)) {
|
|
@@ -8346,7 +8348,7 @@ var useFileUploader = (props) => {
|
|
|
8346
8348
|
},
|
|
8347
8349
|
[dispatch, accept, maxFiles]
|
|
8348
8350
|
);
|
|
8349
|
-
const onRootDragOver = (0,
|
|
8351
|
+
const onRootDragOver = (0, import_react61.useCallback)((evt) => {
|
|
8350
8352
|
preventDefaults(evt);
|
|
8351
8353
|
const hasFiles = isEventWithFiles(evt);
|
|
8352
8354
|
if (hasFiles && evt.dataTransfer) {
|
|
@@ -8356,7 +8358,7 @@ var useFileUploader = (props) => {
|
|
|
8356
8358
|
}
|
|
8357
8359
|
}
|
|
8358
8360
|
}, []);
|
|
8359
|
-
const onRootDragLeave = (0,
|
|
8361
|
+
const onRootDragLeave = (0, import_react61.useCallback)(
|
|
8360
8362
|
(evt) => {
|
|
8361
8363
|
preventDefaults(evt);
|
|
8362
8364
|
if (evt.currentTarget.contains(evt.relatedTarget))
|
|
@@ -8365,7 +8367,7 @@ var useFileUploader = (props) => {
|
|
|
8365
8367
|
},
|
|
8366
8368
|
[dispatch]
|
|
8367
8369
|
);
|
|
8368
|
-
const setFiles = (0,
|
|
8370
|
+
const setFiles = (0, import_react61.useCallback)(
|
|
8369
8371
|
async (evt) => {
|
|
8370
8372
|
evt.preventDefault();
|
|
8371
8373
|
if (isEventWithFiles(evt)) {
|
|
@@ -8399,13 +8401,13 @@ var useFileUploader = (props) => {
|
|
|
8399
8401
|
dispatch
|
|
8400
8402
|
]
|
|
8401
8403
|
);
|
|
8402
|
-
const openFileDialog = (0,
|
|
8404
|
+
const openFileDialog = (0, import_react61.useCallback)(() => {
|
|
8403
8405
|
if (inputRef.current) {
|
|
8404
8406
|
inputRef.current.value = "";
|
|
8405
8407
|
inputRef.current.click();
|
|
8406
8408
|
}
|
|
8407
8409
|
}, [inputRef]);
|
|
8408
|
-
const removeFile = (0,
|
|
8410
|
+
const removeFile = (0, import_react61.useCallback)(
|
|
8409
8411
|
(file) => {
|
|
8410
8412
|
const newFiles = [...stateFiles];
|
|
8411
8413
|
newFiles.splice(stateFiles.indexOf(file), 1);
|
|
@@ -8419,7 +8421,7 @@ var useFileUploader = (props) => {
|
|
|
8419
8421
|
},
|
|
8420
8422
|
[stateFiles, isControlled, maxFiles, errorMessage, onChange, dispatch]
|
|
8421
8423
|
);
|
|
8422
|
-
const getRootProps = (0,
|
|
8424
|
+
const getRootProps = (0, import_react61.useCallback)(
|
|
8423
8425
|
() => ({
|
|
8424
8426
|
onBlur: onRootBlur,
|
|
8425
8427
|
onFocus: onRootFocus,
|
|
@@ -8441,14 +8443,14 @@ var useFileUploader = (props) => {
|
|
|
8441
8443
|
disabled
|
|
8442
8444
|
]
|
|
8443
8445
|
);
|
|
8444
|
-
const getButtonProps = (0,
|
|
8446
|
+
const getButtonProps = (0, import_react61.useCallback)(
|
|
8445
8447
|
() => ({
|
|
8446
8448
|
onClick: openFileDialog,
|
|
8447
8449
|
ref: buttonRef
|
|
8448
8450
|
}),
|
|
8449
8451
|
[openFileDialog, buttonRef]
|
|
8450
8452
|
);
|
|
8451
|
-
const getInputProps = (0,
|
|
8453
|
+
const getInputProps = (0, import_react61.useCallback)(
|
|
8452
8454
|
() => ({
|
|
8453
8455
|
type: "file",
|
|
8454
8456
|
style: { display: "none" },
|
|
@@ -8537,7 +8539,7 @@ var FileUploader = (props) => {
|
|
|
8537
8539
|
width,
|
|
8538
8540
|
errorMessage
|
|
8539
8541
|
} = props;
|
|
8540
|
-
const generatedId = (0,
|
|
8542
|
+
const generatedId = (0, import_react62.useId)();
|
|
8541
8543
|
const uniqueId = id != null ? id : `${generatedId}-fileUploader`;
|
|
8542
8544
|
const {
|
|
8543
8545
|
state: { files: stateFiles, isDragActive, rootErrors },
|
|
@@ -8623,7 +8625,7 @@ var FileUploader = (props) => {
|
|
|
8623
8625
|
FileUploader.displayName = "FileUploader";
|
|
8624
8626
|
|
|
8625
8627
|
// src/components/GlobalMessage/GlobalMessage.tsx
|
|
8626
|
-
var
|
|
8628
|
+
var import_react63 = require("react");
|
|
8627
8629
|
var import_styled_components57 = __toESM(require("styled-components"));
|
|
8628
8630
|
|
|
8629
8631
|
// src/components/GlobalMessage/GlobalMessage.tokens.tsx
|
|
@@ -8717,7 +8719,7 @@ var ContentContainer2 = import_styled_components57.default.div`
|
|
|
8717
8719
|
padding-bottom: ${contentContainer4.paddingBottom};
|
|
8718
8720
|
padding-right: ${({ $closable }) => $closable ? contentContainer4.withClosable.paddingRight : contentContainer4.paddingRight};
|
|
8719
8721
|
`;
|
|
8720
|
-
var GlobalMessage = (0,
|
|
8722
|
+
var GlobalMessage = (0, import_react63.forwardRef)(
|
|
8721
8723
|
(props, ref) => {
|
|
8722
8724
|
const {
|
|
8723
8725
|
message: message2,
|
|
@@ -8730,7 +8732,7 @@ var GlobalMessage = (0, import_react62.forwardRef)(
|
|
|
8730
8732
|
htmlProps,
|
|
8731
8733
|
...rest
|
|
8732
8734
|
} = props;
|
|
8733
|
-
const [isClosed, setClosed] = (0,
|
|
8735
|
+
const [isClosed, setClosed] = (0, import_react63.useState)(false);
|
|
8734
8736
|
return !isClosed ? /* @__PURE__ */ (0, import_jsx_runtime220.jsxs)(
|
|
8735
8737
|
Container7,
|
|
8736
8738
|
{
|
|
@@ -8773,12 +8775,12 @@ GlobalMessage.displayName = "GlobalMessage";
|
|
|
8773
8775
|
var import_styled_components58 = __toESM(require("styled-components"));
|
|
8774
8776
|
|
|
8775
8777
|
// src/components/Grid/Grid.context.tsx
|
|
8776
|
-
var
|
|
8777
|
-
var GridContext = (0,
|
|
8778
|
+
var import_react64 = require("react");
|
|
8779
|
+
var GridContext = (0, import_react64.createContext)({
|
|
8778
8780
|
screenSize: 3 /* Large */
|
|
8779
8781
|
});
|
|
8780
8782
|
var useGridContext = () => {
|
|
8781
|
-
return (0,
|
|
8783
|
+
return (0, import_react64.useContext)(GridContext);
|
|
8782
8784
|
};
|
|
8783
8785
|
|
|
8784
8786
|
// src/components/Grid/Grid.tokens.tsx
|
|
@@ -8966,10 +8968,10 @@ var GridChild = (props) => {
|
|
|
8966
8968
|
GridChild.displayName = "GridChild";
|
|
8967
8969
|
|
|
8968
8970
|
// src/components/InlineEdit/InlineEditTextArea.tsx
|
|
8969
|
-
var
|
|
8971
|
+
var import_react67 = require("react");
|
|
8970
8972
|
|
|
8971
8973
|
// src/components/InlineEdit/InlineEdit.tsx
|
|
8972
|
-
var
|
|
8974
|
+
var import_react65 = require("react");
|
|
8973
8975
|
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
8974
8976
|
var InlineEdit = (props) => {
|
|
8975
8977
|
const {
|
|
@@ -8982,8 +8984,8 @@ var InlineEdit = (props) => {
|
|
|
8982
8984
|
inputRef,
|
|
8983
8985
|
children
|
|
8984
8986
|
} = props;
|
|
8985
|
-
const [editingValue, setEditingValue] = (0,
|
|
8986
|
-
const [isEditing, setIsEditing] = (0,
|
|
8987
|
+
const [editingValue, setEditingValue] = (0, import_react65.useState)(value != null ? value : "");
|
|
8988
|
+
const [isEditing, setIsEditing] = (0, import_react65.useState)(false);
|
|
8987
8989
|
const onChangeHandler = (e) => {
|
|
8988
8990
|
setEditingValue(e.target.value);
|
|
8989
8991
|
onChange && onChange();
|
|
@@ -9010,8 +9012,8 @@ var InlineEdit = (props) => {
|
|
|
9010
9012
|
useOnKeyDown(["Enter"], () => onExitHandler());
|
|
9011
9013
|
useOnKeyDown(["Escape"], () => onExitHandler());
|
|
9012
9014
|
useOnClickOutside(inputRef.current, () => onExitHandler());
|
|
9013
|
-
const inputChild =
|
|
9014
|
-
(0,
|
|
9015
|
+
const inputChild = import_react65.Children.only(
|
|
9016
|
+
(0, import_react65.isValidElement)(children) && (0, import_react65.cloneElement)(children, {
|
|
9015
9017
|
onChange: onChangeHandler,
|
|
9016
9018
|
onBlur: onBlurHandler,
|
|
9017
9019
|
onFocus: onFocusHandler,
|
|
@@ -9025,7 +9027,7 @@ var InlineEdit = (props) => {
|
|
|
9025
9027
|
InlineEdit.displayName = "InlineEdit";
|
|
9026
9028
|
|
|
9027
9029
|
// src/components/InlineEdit/InlineTextArea.tsx
|
|
9028
|
-
var
|
|
9030
|
+
var import_react66 = require("react");
|
|
9029
9031
|
|
|
9030
9032
|
// src/components/InlineEdit/InlineEdit.styles.tsx
|
|
9031
9033
|
var import_styled_components60 = __toESM(require("styled-components"));
|
|
@@ -9106,7 +9108,7 @@ var inlineEditVisuallyHidden = (id, emptiable) => /* @__PURE__ */ (0, import_jsx
|
|
|
9106
9108
|
|
|
9107
9109
|
// src/components/InlineEdit/InlineTextArea.tsx
|
|
9108
9110
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9109
|
-
var InlineTextArea = (0,
|
|
9111
|
+
var InlineTextArea = (0, import_react66.forwardRef)((props, ref) => {
|
|
9110
9112
|
const {
|
|
9111
9113
|
id,
|
|
9112
9114
|
error,
|
|
@@ -9118,12 +9120,12 @@ var InlineTextArea = (0, import_react65.forwardRef)((props, ref) => {
|
|
|
9118
9120
|
hideIcon,
|
|
9119
9121
|
...rest
|
|
9120
9122
|
} = props;
|
|
9121
|
-
const genereatedId = (0,
|
|
9123
|
+
const genereatedId = (0, import_react66.useId)();
|
|
9122
9124
|
const uniqueId = id != null ? id : `${genereatedId}-InlineTextArea`;
|
|
9123
9125
|
const hasErrorMessage = !!errorMessage;
|
|
9124
9126
|
const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
|
|
9125
9127
|
const descId = derivativeIdGenerator(uniqueId, "desc");
|
|
9126
|
-
const inputRef = (0,
|
|
9128
|
+
const inputRef = (0, import_react66.useRef)(null);
|
|
9127
9129
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
9128
9130
|
return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(OuterInputContainer, { $width: width, children: [
|
|
9129
9131
|
/* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(InputContainer, { children: [
|
|
@@ -9162,9 +9164,9 @@ InlineTextArea.displayName = "InlineTextArea";
|
|
|
9162
9164
|
|
|
9163
9165
|
// src/components/InlineEdit/InlineEditTextArea.tsx
|
|
9164
9166
|
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
9165
|
-
var InlineEditTextArea = (0,
|
|
9167
|
+
var InlineEditTextArea = (0, import_react67.forwardRef)((props, ref) => {
|
|
9166
9168
|
const { onSetValue, emptiable, value, onFocus, onChange, onBlur, ...rest } = props;
|
|
9167
|
-
const textareaRef = (0,
|
|
9169
|
+
const textareaRef = (0, import_react67.useRef)(null);
|
|
9168
9170
|
const combinedRef = useCombinedRef(ref, textareaRef);
|
|
9169
9171
|
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
9170
9172
|
InlineEdit,
|
|
@@ -9182,12 +9184,12 @@ var InlineEditTextArea = (0, import_react66.forwardRef)((props, ref) => {
|
|
|
9182
9184
|
});
|
|
9183
9185
|
|
|
9184
9186
|
// src/components/InlineEdit/InlineEditInput.tsx
|
|
9185
|
-
var
|
|
9187
|
+
var import_react69 = require("react");
|
|
9186
9188
|
|
|
9187
9189
|
// src/components/InlineEdit/InlineInput.tsx
|
|
9188
|
-
var
|
|
9190
|
+
var import_react68 = require("react");
|
|
9189
9191
|
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
9190
|
-
var InlineInput = (0,
|
|
9192
|
+
var InlineInput = (0, import_react68.forwardRef)(
|
|
9191
9193
|
(props, ref) => {
|
|
9192
9194
|
const {
|
|
9193
9195
|
id,
|
|
@@ -9200,14 +9202,14 @@ var InlineInput = (0, import_react67.forwardRef)(
|
|
|
9200
9202
|
hideIcon,
|
|
9201
9203
|
...rest
|
|
9202
9204
|
} = props;
|
|
9203
|
-
const genereatedId = (0,
|
|
9205
|
+
const genereatedId = (0, import_react68.useId)();
|
|
9204
9206
|
const uniqueId = id != null ? id : `${genereatedId}-InlineInput`;
|
|
9205
9207
|
const hasErrorMessage = !!errorMessage;
|
|
9206
9208
|
const hasError = !!error;
|
|
9207
9209
|
const hasErrorState = hasError || hasErrorMessage;
|
|
9208
9210
|
const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
|
|
9209
9211
|
const descId = derivativeIdGenerator(uniqueId, "desc");
|
|
9210
|
-
const inputRef = (0,
|
|
9212
|
+
const inputRef = (0, import_react68.useRef)(null);
|
|
9211
9213
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
9212
9214
|
return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(OuterInputContainer, { $width: width, children: [
|
|
9213
9215
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsxs)(InputContainer, { children: [
|
|
@@ -9248,9 +9250,9 @@ InlineInput.displayName = "InlineInput";
|
|
|
9248
9250
|
|
|
9249
9251
|
// src/components/InlineEdit/InlineEditInput.tsx
|
|
9250
9252
|
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
9251
|
-
var InlineEditInput = (0,
|
|
9253
|
+
var InlineEditInput = (0, import_react69.forwardRef)((props, ref) => {
|
|
9252
9254
|
const { onSetValue, emptiable, value, onFocus, onChange, onBlur, ...rest } = props;
|
|
9253
|
-
const inputRef = (0,
|
|
9255
|
+
const inputRef = (0, import_react69.useRef)(null);
|
|
9254
9256
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
9255
9257
|
return /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
9256
9258
|
InlineEdit,
|
|
@@ -9268,7 +9270,7 @@ var InlineEditInput = (0, import_react68.forwardRef)((props, ref) => {
|
|
|
9268
9270
|
});
|
|
9269
9271
|
|
|
9270
9272
|
// src/components/InternalHeader/InternalHeader.tsx
|
|
9271
|
-
var
|
|
9273
|
+
var import_react71 = require("react");
|
|
9272
9274
|
|
|
9273
9275
|
// src/components/InternalHeader/InternalHeader.styles.tsx
|
|
9274
9276
|
var import_styled_components61 = __toESM(require("styled-components"));
|
|
@@ -9353,7 +9355,7 @@ var NavLi = import_styled_components61.default.li`
|
|
|
9353
9355
|
`;
|
|
9354
9356
|
|
|
9355
9357
|
// src/components/InternalHeader/NavigationItem.tsx
|
|
9356
|
-
var
|
|
9358
|
+
var import_react70 = require("react");
|
|
9357
9359
|
var import_styled_components62 = __toESM(require("styled-components"));
|
|
9358
9360
|
|
|
9359
9361
|
// src/components/InternalHeader/NavigationItem.tokens.ts
|
|
@@ -9423,7 +9425,7 @@ var Link3 = import_styled_components62.default.a`
|
|
|
9423
9425
|
transition: background-color 0.2s;
|
|
9424
9426
|
}
|
|
9425
9427
|
`;
|
|
9426
|
-
var NavigationItem2 = (0,
|
|
9428
|
+
var NavigationItem2 = (0, import_react70.forwardRef)(({ title: title3, isCurrent, ...rest }, ref) => {
|
|
9427
9429
|
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
9428
9430
|
Link3,
|
|
9429
9431
|
{
|
|
@@ -9454,11 +9456,11 @@ var InternalHeader = (props) => {
|
|
|
9454
9456
|
htmlProps,
|
|
9455
9457
|
...rest
|
|
9456
9458
|
} = props;
|
|
9457
|
-
const [contextMenuIsClosed, setContextMenuIsClosed] = (0,
|
|
9458
|
-
const [currentPage, setCurrentPage] = (0,
|
|
9459
|
+
const [contextMenuIsClosed, setContextMenuIsClosed] = (0, import_react71.useState)(true);
|
|
9460
|
+
const [currentPage, setCurrentPage] = (0, import_react71.useState)(
|
|
9459
9461
|
currentPageHref
|
|
9460
9462
|
);
|
|
9461
|
-
const buttonRef = (0,
|
|
9463
|
+
const buttonRef = (0, import_react71.useRef)(null);
|
|
9462
9464
|
const handleCurrentPageChange = (href) => {
|
|
9463
9465
|
setCurrentPage(href);
|
|
9464
9466
|
onCurrentPageChange && onCurrentPageChange();
|
|
@@ -9527,7 +9529,7 @@ var InternalHeader = (props) => {
|
|
|
9527
9529
|
InternalHeader.displayName = "InternalHeader";
|
|
9528
9530
|
|
|
9529
9531
|
// src/components/List/List.tsx
|
|
9530
|
-
var
|
|
9532
|
+
var import_react72 = require("react");
|
|
9531
9533
|
var import_styled_components63 = __toESM(require("styled-components"));
|
|
9532
9534
|
|
|
9533
9535
|
// src/components/List/bullets/jordskifterett_bullet1.svg
|
|
@@ -9628,7 +9630,7 @@ var StyledList = import_styled_components63.default.ul`
|
|
|
9628
9630
|
}
|
|
9629
9631
|
`}
|
|
9630
9632
|
`;
|
|
9631
|
-
var List2 = (0,
|
|
9633
|
+
var List2 = (0, import_react72.forwardRef)(
|
|
9632
9634
|
(props, ref) => {
|
|
9633
9635
|
const {
|
|
9634
9636
|
listType = "unordered",
|
|
@@ -9656,13 +9658,13 @@ var List2 = (0, import_react71.forwardRef)(
|
|
|
9656
9658
|
List2.displayName = "List";
|
|
9657
9659
|
|
|
9658
9660
|
// src/components/List/ListItem.tsx
|
|
9659
|
-
var
|
|
9661
|
+
var import_react73 = require("react");
|
|
9660
9662
|
var import_styled_components64 = __toESM(require("styled-components"));
|
|
9661
9663
|
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
9662
9664
|
var StyledListItem = import_styled_components64.default.li`
|
|
9663
9665
|
line-height: ${listTokens.listItem.lineHeight};
|
|
9664
9666
|
`;
|
|
9665
|
-
var ListItem2 = (0,
|
|
9667
|
+
var ListItem2 = (0, import_react73.forwardRef)(
|
|
9666
9668
|
({ children, ...rest }, ref) => {
|
|
9667
9669
|
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(StyledListItem, { ref, ...rest, children });
|
|
9668
9670
|
}
|
|
@@ -9670,7 +9672,7 @@ var ListItem2 = (0, import_react72.forwardRef)(
|
|
|
9670
9672
|
ListItem2.displayName = "ListItem";
|
|
9671
9673
|
|
|
9672
9674
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
9673
|
-
var
|
|
9675
|
+
var import_react74 = require("react");
|
|
9674
9676
|
var import_styled_components65 = __toESM(require("styled-components"));
|
|
9675
9677
|
|
|
9676
9678
|
// src/components/LocalMessage/LocalMessage.tokens.tsx
|
|
@@ -9835,7 +9837,7 @@ var CloseButton = (0, import_styled_components65.default)(Button)`
|
|
|
9835
9837
|
grid-area: closeButton;
|
|
9836
9838
|
margin: -${container10.base.padding} 0;
|
|
9837
9839
|
`;
|
|
9838
|
-
var LocalMessage = (0,
|
|
9840
|
+
var LocalMessage = (0, import_react74.forwardRef)(
|
|
9839
9841
|
(props, ref) => {
|
|
9840
9842
|
const {
|
|
9841
9843
|
message: message2,
|
|
@@ -9850,7 +9852,7 @@ var LocalMessage = (0, import_react73.forwardRef)(
|
|
|
9850
9852
|
htmlProps,
|
|
9851
9853
|
...rest
|
|
9852
9854
|
} = props;
|
|
9853
|
-
const [isClosed, setClosed] = (0,
|
|
9855
|
+
const [isClosed, setClosed] = (0, import_react74.useState)(false);
|
|
9854
9856
|
const containerProps = {
|
|
9855
9857
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
9856
9858
|
purpose,
|
|
@@ -9891,7 +9893,7 @@ var LocalMessage = (0, import_react73.forwardRef)(
|
|
|
9891
9893
|
LocalMessage.displayName = "LocalMessage";
|
|
9892
9894
|
|
|
9893
9895
|
// src/components/Modal/Modal.tsx
|
|
9894
|
-
var
|
|
9896
|
+
var import_react75 = require("react");
|
|
9895
9897
|
var import_react_dom3 = require("react-dom");
|
|
9896
9898
|
var import_styled_components67 = __toESM(require("styled-components"));
|
|
9897
9899
|
|
|
@@ -9987,7 +9989,7 @@ var HeaderContainer3 = import_styled_components67.default.div``;
|
|
|
9987
9989
|
var StyledButton4 = (0, import_styled_components67.default)(Button)`
|
|
9988
9990
|
align-self: flex-end;
|
|
9989
9991
|
`;
|
|
9990
|
-
var Modal = (0,
|
|
9992
|
+
var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
9991
9993
|
const {
|
|
9992
9994
|
isOpen = false,
|
|
9993
9995
|
parentElement = document.body,
|
|
@@ -10001,7 +10003,7 @@ var Modal = (0, import_react74.forwardRef)((props, ref) => {
|
|
|
10001
10003
|
htmlProps,
|
|
10002
10004
|
...rest
|
|
10003
10005
|
} = props;
|
|
10004
|
-
const generatedId = (0,
|
|
10006
|
+
const generatedId = (0, import_react75.useId)();
|
|
10005
10007
|
const modalId = id != null ? id : `${generatedId}-modal`;
|
|
10006
10008
|
const headerId = `${modalId}-header`;
|
|
10007
10009
|
const modalRef = useFocusTrap(isOpen, initialFocusRef);
|
|
@@ -10013,7 +10015,7 @@ var Modal = (0, import_react74.forwardRef)((props, ref) => {
|
|
|
10013
10015
|
onClose();
|
|
10014
10016
|
}
|
|
10015
10017
|
};
|
|
10016
|
-
(0,
|
|
10018
|
+
(0, import_react75.useEffect)(() => {
|
|
10017
10019
|
if (isOpen) {
|
|
10018
10020
|
handleElementWithBackdropMount(document.body);
|
|
10019
10021
|
} else {
|
|
@@ -10062,11 +10064,11 @@ var Modal = (0, import_react74.forwardRef)((props, ref) => {
|
|
|
10062
10064
|
Modal.displayName = "Modal";
|
|
10063
10065
|
|
|
10064
10066
|
// src/components/Modal/ModalBody.tsx
|
|
10065
|
-
var
|
|
10067
|
+
var import_react76 = require("react");
|
|
10066
10068
|
var import_styled_components68 = __toESM(require("styled-components"));
|
|
10067
10069
|
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
10068
10070
|
var Container10 = import_styled_components68.default.div``;
|
|
10069
|
-
var ModalBody = (0,
|
|
10071
|
+
var ModalBody = (0, import_react76.forwardRef)(
|
|
10070
10072
|
(props, ref) => {
|
|
10071
10073
|
const { children, scrollable, id, className, htmlProps, height, ...rest } = props;
|
|
10072
10074
|
const containerProps = {
|
|
@@ -10079,7 +10081,7 @@ var ModalBody = (0, import_react75.forwardRef)(
|
|
|
10079
10081
|
ModalBody.displayName = "ModalBody";
|
|
10080
10082
|
|
|
10081
10083
|
// src/components/Modal/ModalActions.tsx
|
|
10082
|
-
var
|
|
10084
|
+
var import_react77 = require("react");
|
|
10083
10085
|
var import_styled_components69 = __toESM(require("styled-components"));
|
|
10084
10086
|
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
10085
10087
|
var Container11 = import_styled_components69.default.div`
|
|
@@ -10087,7 +10089,7 @@ var Container11 = import_styled_components69.default.div`
|
|
|
10087
10089
|
flex-wrap: wrap;
|
|
10088
10090
|
gap: ${modalTokens.actionsContainer.gap};
|
|
10089
10091
|
`;
|
|
10090
|
-
var ModalActions = (0,
|
|
10092
|
+
var ModalActions = (0, import_react77.forwardRef)(
|
|
10091
10093
|
({ children, ...rest }, ref) => {
|
|
10092
10094
|
const containerProps = {
|
|
10093
10095
|
ref,
|
|
@@ -10099,7 +10101,7 @@ var ModalActions = (0, import_react76.forwardRef)(
|
|
|
10099
10101
|
ModalActions.displayName = "ModalActions";
|
|
10100
10102
|
|
|
10101
10103
|
// src/components/Pagination/Pagination.tsx
|
|
10102
|
-
var
|
|
10104
|
+
var import_react79 = require("react");
|
|
10103
10105
|
var import_styled_components71 = __toESM(require("styled-components"));
|
|
10104
10106
|
|
|
10105
10107
|
// src/components/Pagination/Pagination.tokens.tsx
|
|
@@ -10158,7 +10160,7 @@ function PaginationGenerator(pagesAmount, activePage) {
|
|
|
10158
10160
|
}
|
|
10159
10161
|
|
|
10160
10162
|
// src/components/Select/Select.tsx
|
|
10161
|
-
var
|
|
10163
|
+
var import_react78 = require("react");
|
|
10162
10164
|
var import_react_select2 = __toESM(require("react-select"));
|
|
10163
10165
|
|
|
10164
10166
|
// src/components/Select/Select.styles.ts
|
|
@@ -10655,7 +10657,7 @@ function SelectInner(props, ref) {
|
|
|
10655
10657
|
customSingleValueElement,
|
|
10656
10658
|
...rest
|
|
10657
10659
|
} = props;
|
|
10658
|
-
const generatedId = (0,
|
|
10660
|
+
const generatedId = (0, import_react78.useId)();
|
|
10659
10661
|
const uniqueId = id != null ? id : `${generatedId}-select`;
|
|
10660
10662
|
const singleValueId = !isMulti ? `${uniqueId}-singleValue` : void 0;
|
|
10661
10663
|
const hasLabel = !!label3;
|
|
@@ -10719,7 +10721,7 @@ function SelectInner(props, ref) {
|
|
|
10719
10721
|
renderInputMessage(tip, tipId, errorMessage, errorMessageId)
|
|
10720
10722
|
] });
|
|
10721
10723
|
}
|
|
10722
|
-
var Select = (0,
|
|
10724
|
+
var Select = (0, import_react78.forwardRef)(SelectInner);
|
|
10723
10725
|
Select.displayName = "Select";
|
|
10724
10726
|
|
|
10725
10727
|
// src/components/Select/utils.ts
|
|
@@ -10763,7 +10765,7 @@ var IndicatorsContainer = import_styled_components71.default.div`
|
|
|
10763
10765
|
align-items: center;
|
|
10764
10766
|
gap: ${indicatorsContainer2.gap};
|
|
10765
10767
|
`;
|
|
10766
|
-
var Pagination = (0,
|
|
10768
|
+
var Pagination = (0, import_react79.forwardRef)(
|
|
10767
10769
|
(props, ref) => {
|
|
10768
10770
|
const {
|
|
10769
10771
|
itemsAmount,
|
|
@@ -10786,8 +10788,8 @@ var Pagination = (0, import_react78.forwardRef)(
|
|
|
10786
10788
|
htmlProps,
|
|
10787
10789
|
...rest
|
|
10788
10790
|
} = props;
|
|
10789
|
-
const [activePage, setActivePage] = (0,
|
|
10790
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
10791
|
+
const [activePage, setActivePage] = (0, import_react79.useState)(defaultActivePage);
|
|
10792
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react79.useState)(defaultItemsPerPage);
|
|
10791
10793
|
const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
|
|
10792
10794
|
const items = PaginationGenerator(pagesLength, activePage);
|
|
10793
10795
|
const onPageChange = (event, page) => {
|
|
@@ -10943,7 +10945,7 @@ Pagination.displayName = "Pagination";
|
|
|
10943
10945
|
|
|
10944
10946
|
// src/components/Popover/Popover.tsx
|
|
10945
10947
|
var import_dds_design_tokens52 = require("@norges-domstoler/dds-design-tokens");
|
|
10946
|
-
var
|
|
10948
|
+
var import_react80 = require("react");
|
|
10947
10949
|
var import_styled_components72 = __toESM(require("styled-components"));
|
|
10948
10950
|
|
|
10949
10951
|
// src/components/Popover/Popover.tokens.tsx
|
|
@@ -11008,7 +11010,7 @@ var StyledButton5 = (0, import_styled_components72.default)(Button)`
|
|
|
11008
11010
|
top: ${closeButton2.top};
|
|
11009
11011
|
right: ${closeButton2.right};
|
|
11010
11012
|
`;
|
|
11011
|
-
var Popover = (0,
|
|
11013
|
+
var Popover = (0, import_react80.forwardRef)(
|
|
11012
11014
|
(props, ref) => {
|
|
11013
11015
|
const {
|
|
11014
11016
|
title: title3,
|
|
@@ -11089,7 +11091,7 @@ var Popover = (0, import_react79.forwardRef)(
|
|
|
11089
11091
|
Popover.displayName = "Popover";
|
|
11090
11092
|
|
|
11091
11093
|
// src/components/Popover/PopoverGroup.tsx
|
|
11092
|
-
var
|
|
11094
|
+
var import_react81 = require("react");
|
|
11093
11095
|
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
11094
11096
|
var PopoverGroup = ({
|
|
11095
11097
|
isOpen = false,
|
|
@@ -11098,8 +11100,8 @@ var PopoverGroup = ({
|
|
|
11098
11100
|
children,
|
|
11099
11101
|
popoverId
|
|
11100
11102
|
}) => {
|
|
11101
|
-
const [open, setOpen] = (0,
|
|
11102
|
-
const generatedId = (0,
|
|
11103
|
+
const [open, setOpen] = (0, import_react81.useState)(isOpen);
|
|
11104
|
+
const generatedId = (0, import_react81.useId)();
|
|
11103
11105
|
const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
|
|
11104
11106
|
const handleOnCloseButtonClick = () => {
|
|
11105
11107
|
setOpen(false);
|
|
@@ -11109,8 +11111,8 @@ var PopoverGroup = ({
|
|
|
11109
11111
|
setOpen(!open);
|
|
11110
11112
|
onTriggerClick && onTriggerClick();
|
|
11111
11113
|
};
|
|
11112
|
-
const buttonRef = (0,
|
|
11113
|
-
const popoverRef = (0,
|
|
11114
|
+
const buttonRef = (0, import_react81.useRef)(null);
|
|
11115
|
+
const popoverRef = (0, import_react81.useRef)(null);
|
|
11114
11116
|
useOnKeyDown(["Esc", "Escape"], () => {
|
|
11115
11117
|
var _a;
|
|
11116
11118
|
if (open) {
|
|
@@ -11119,14 +11121,14 @@ var PopoverGroup = ({
|
|
|
11119
11121
|
}
|
|
11120
11122
|
});
|
|
11121
11123
|
const handleClose = () => setOpen(false);
|
|
11122
|
-
const Children9 =
|
|
11123
|
-
return (0,
|
|
11124
|
+
const Children9 = import_react81.Children.map(children, (child, childIndex) => {
|
|
11125
|
+
return (0, import_react81.isValidElement)(child) && (childIndex === 0 ? (0, import_react81.cloneElement)(child, {
|
|
11124
11126
|
"aria-haspopup": "dialog",
|
|
11125
11127
|
"aria-controls": uniquePopoverId,
|
|
11126
11128
|
"aria-expanded": open,
|
|
11127
11129
|
onClick: handleOnTriggerClick,
|
|
11128
11130
|
ref: buttonRef
|
|
11129
|
-
}) : (0,
|
|
11131
|
+
}) : (0, import_react81.cloneElement)(child, {
|
|
11130
11132
|
isOpen: open,
|
|
11131
11133
|
"aria-hidden": !open,
|
|
11132
11134
|
id: uniquePopoverId,
|
|
@@ -11141,17 +11143,17 @@ var PopoverGroup = ({
|
|
|
11141
11143
|
PopoverGroup.displayName = "PopoverGroup";
|
|
11142
11144
|
|
|
11143
11145
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
11144
|
-
var
|
|
11146
|
+
var import_react84 = require("react");
|
|
11145
11147
|
var import_styled_components74 = __toESM(require("styled-components"));
|
|
11146
11148
|
|
|
11147
11149
|
// src/components/ProgressTracker/ProgressTracker.context.tsx
|
|
11148
|
-
var
|
|
11149
|
-
var ProgressTrackerContext = (0,
|
|
11150
|
+
var import_react82 = require("react");
|
|
11151
|
+
var ProgressTrackerContext = (0, import_react82.createContext)(
|
|
11150
11152
|
{
|
|
11151
11153
|
activeStep: 0
|
|
11152
11154
|
}
|
|
11153
11155
|
);
|
|
11154
|
-
var useProgressTrackerContext = () => (0,
|
|
11156
|
+
var useProgressTrackerContext = () => (0, import_react82.useContext)(ProgressTrackerContext);
|
|
11155
11157
|
|
|
11156
11158
|
// src/components/ProgressTracker/ProgressTracker.tokens.tsx
|
|
11157
11159
|
var import_dds_design_tokens53 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -11269,7 +11271,7 @@ var progressTrackerTokens = {
|
|
|
11269
11271
|
};
|
|
11270
11272
|
|
|
11271
11273
|
// src/components/ProgressTracker/ProgressTrackerItem.tsx
|
|
11272
|
-
var
|
|
11274
|
+
var import_react83 = require("react");
|
|
11273
11275
|
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11274
11276
|
var import_jsx_runtime242 = require("react/jsx-runtime");
|
|
11275
11277
|
var toItemState = (active, completed, disabled) => {
|
|
@@ -11366,7 +11368,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
11366
11368
|
const styleProps = {
|
|
11367
11369
|
$state: toItemState(active, completed, disabled)
|
|
11368
11370
|
};
|
|
11369
|
-
const stepNumberContent = (0,
|
|
11371
|
+
const stepNumberContent = (0, import_react83.useMemo)(() => {
|
|
11370
11372
|
if (completed) {
|
|
11371
11373
|
return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(Icon, { icon: CheckIcon, iconSize: itemNumber2.iconSize });
|
|
11372
11374
|
}
|
|
@@ -11414,7 +11416,7 @@ var ProgressTrackerConnector = import_styled_components74.default.div`
|
|
|
11414
11416
|
${progressTrackerTokens.connector.color};
|
|
11415
11417
|
`;
|
|
11416
11418
|
var ProgressTracker = (() => {
|
|
11417
|
-
const Res = (0,
|
|
11419
|
+
const Res = (0, import_react84.forwardRef)((props, ref) => {
|
|
11418
11420
|
const {
|
|
11419
11421
|
id,
|
|
11420
11422
|
activeStep = 0,
|
|
@@ -11424,12 +11426,12 @@ var ProgressTracker = (() => {
|
|
|
11424
11426
|
htmlProps,
|
|
11425
11427
|
...rest
|
|
11426
11428
|
} = props;
|
|
11427
|
-
const [thisActiveStep, setActiveStep] = (0,
|
|
11429
|
+
const [thisActiveStep, setActiveStep] = (0, import_react84.useState)(activeStep);
|
|
11428
11430
|
const handleChange = (step) => {
|
|
11429
11431
|
setActiveStep(step);
|
|
11430
11432
|
onStepChange && onStepChange(step);
|
|
11431
11433
|
};
|
|
11432
|
-
(0,
|
|
11434
|
+
(0, import_react84.useEffect)(() => {
|
|
11433
11435
|
if (activeStep !== void 0 && activeStep != thisActiveStep) {
|
|
11434
11436
|
setActiveStep(activeStep);
|
|
11435
11437
|
}
|
|
@@ -11438,7 +11440,7 @@ var ProgressTracker = (() => {
|
|
|
11438
11440
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
11439
11441
|
ref
|
|
11440
11442
|
};
|
|
11441
|
-
const steps = (0,
|
|
11443
|
+
const steps = (0, import_react84.useMemo)(() => {
|
|
11442
11444
|
const validChildren = removeInvalidChildren(children);
|
|
11443
11445
|
const itemsWithIndex = passIndexPropToProgressTrackerItem(validChildren);
|
|
11444
11446
|
const itemsWithConnectorsBetween = intersperseItemsWithConnector(itemsWithIndex);
|
|
@@ -11460,36 +11462,36 @@ var ProgressTracker = (() => {
|
|
|
11460
11462
|
return Res;
|
|
11461
11463
|
})();
|
|
11462
11464
|
function removeInvalidChildren(children) {
|
|
11463
|
-
return
|
|
11465
|
+
return import_react84.Children.toArray(children).filter(import_react84.isValidElement);
|
|
11464
11466
|
}
|
|
11465
11467
|
function passIndexPropToProgressTrackerItem(children) {
|
|
11466
|
-
return
|
|
11468
|
+
return import_react84.Children.map(
|
|
11467
11469
|
children,
|
|
11468
|
-
(item, index) => (0,
|
|
11470
|
+
(item, index) => (0, import_react84.cloneElement)(item, {
|
|
11469
11471
|
...item.props,
|
|
11470
11472
|
index
|
|
11471
11473
|
})
|
|
11472
11474
|
);
|
|
11473
11475
|
}
|
|
11474
|
-
var intersperseItemsWithConnector = (children) =>
|
|
11476
|
+
var intersperseItemsWithConnector = (children) => import_react84.Children.map(children, (child, index) => {
|
|
11475
11477
|
if (index === 0) {
|
|
11476
11478
|
return child;
|
|
11477
11479
|
}
|
|
11478
|
-
return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(
|
|
11480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(import_react84.Fragment, { children: [
|
|
11479
11481
|
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(ProgressTrackerConnector, { "aria-hidden": true }),
|
|
11480
11482
|
child
|
|
11481
11483
|
] }, index);
|
|
11482
11484
|
});
|
|
11483
11485
|
|
|
11484
11486
|
// src/components/Search/Search.tsx
|
|
11485
|
-
var
|
|
11487
|
+
var import_react87 = require("react");
|
|
11486
11488
|
var import_styled_components76 = __toESM(require("styled-components"));
|
|
11487
11489
|
|
|
11488
11490
|
// src/components/Search/AutocompleteSearch.context.tsx
|
|
11489
|
-
var
|
|
11490
|
-
var AutocompleteSearchContext = (0,
|
|
11491
|
+
var import_react85 = require("react");
|
|
11492
|
+
var AutocompleteSearchContext = (0, import_react85.createContext)({});
|
|
11491
11493
|
var useAutocompleteSearch = () => {
|
|
11492
|
-
return (0,
|
|
11494
|
+
return (0, import_react85.useContext)(AutocompleteSearchContext);
|
|
11493
11495
|
};
|
|
11494
11496
|
|
|
11495
11497
|
// src/components/Search/Search.tokens.tsx
|
|
@@ -11599,7 +11601,7 @@ function createEmptyChangeEvent(inputElementId) {
|
|
|
11599
11601
|
}
|
|
11600
11602
|
|
|
11601
11603
|
// src/components/Search/SearchSuggestions.tsx
|
|
11602
|
-
var
|
|
11604
|
+
var import_react86 = require("react");
|
|
11603
11605
|
var import_styled_components75 = __toESM(require("styled-components"));
|
|
11604
11606
|
var import_jsx_runtime244 = require("react/jsx-runtime");
|
|
11605
11607
|
var { suggestionsContainer: suggestionsContainer2, suggestionsHeader: suggestionsHeader2 } = searchTokens;
|
|
@@ -11626,7 +11628,7 @@ var SuggestionsList = import_styled_components75.default.ul`
|
|
|
11626
11628
|
var SuggestionsHeader = (0, import_styled_components75.default)(Typography)`
|
|
11627
11629
|
padding-left: ${suggestionsHeader2.paddingLeft};
|
|
11628
11630
|
`;
|
|
11629
|
-
var SearchSuggestions = (0,
|
|
11631
|
+
var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
11630
11632
|
const {
|
|
11631
11633
|
id,
|
|
11632
11634
|
searchId,
|
|
@@ -11745,7 +11747,7 @@ var InputContainer2 = import_styled_components76.default.div`
|
|
|
11745
11747
|
position: relative;
|
|
11746
11748
|
display: flex;
|
|
11747
11749
|
`;
|
|
11748
|
-
var Search = (0,
|
|
11750
|
+
var Search = (0, import_react87.forwardRef)(
|
|
11749
11751
|
({
|
|
11750
11752
|
componentSize = "medium",
|
|
11751
11753
|
buttonProps,
|
|
@@ -11761,7 +11763,7 @@ var Search = (0, import_react86.forwardRef)(
|
|
|
11761
11763
|
...rest
|
|
11762
11764
|
}, ref) => {
|
|
11763
11765
|
var _a;
|
|
11764
|
-
const generatedId = (0,
|
|
11766
|
+
const generatedId = (0, import_react87.useId)();
|
|
11765
11767
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
11766
11768
|
const hasLabel = !!label3;
|
|
11767
11769
|
const tipId = derivativeIdGenerator(uniqueId, "tip");
|
|
@@ -11770,7 +11772,7 @@ var Search = (0, import_react86.forwardRef)(
|
|
|
11770
11772
|
uniqueId,
|
|
11771
11773
|
"suggestions-description"
|
|
11772
11774
|
);
|
|
11773
|
-
const [hasValue, setHasValue] = (0,
|
|
11775
|
+
const [hasValue, setHasValue] = (0, import_react87.useState)(!!value);
|
|
11774
11776
|
const context = useAutocompleteSearch();
|
|
11775
11777
|
const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
|
|
11776
11778
|
const handleChange = (e) => {
|
|
@@ -11878,7 +11880,7 @@ var Search = (0, import_react86.forwardRef)(
|
|
|
11878
11880
|
Search.displayName = "Search";
|
|
11879
11881
|
|
|
11880
11882
|
// src/components/Search/SearchAutocompleteWrapper.tsx
|
|
11881
|
-
var
|
|
11883
|
+
var import_react88 = require("react");
|
|
11882
11884
|
var import_jsx_runtime246 = require("react/jsx-runtime");
|
|
11883
11885
|
var SearchAutocompleteWrapper = (props) => {
|
|
11884
11886
|
const {
|
|
@@ -11890,12 +11892,12 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
11890
11892
|
onSuggestionSelection,
|
|
11891
11893
|
children
|
|
11892
11894
|
} = props;
|
|
11893
|
-
const [inputValue, setInputValue] = (0,
|
|
11894
|
-
const [suggestions, setSuggestions] = (0,
|
|
11895
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
11895
|
+
const [inputValue, setInputValue] = (0, import_react88.useState)(value != null ? value : "");
|
|
11896
|
+
const [suggestions, setSuggestions] = (0, import_react88.useState)([]);
|
|
11897
|
+
const [showSuggestions, setShowSuggestions] = (0, import_react88.useState)(false);
|
|
11896
11898
|
const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
|
|
11897
11899
|
const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
|
|
11898
|
-
(0,
|
|
11900
|
+
(0, import_react88.useEffect)(() => {
|
|
11899
11901
|
if (suggestions.length > 0) {
|
|
11900
11902
|
openSuggestions();
|
|
11901
11903
|
} else {
|
|
@@ -11940,8 +11942,8 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
11940
11942
|
const handleSetInputValue = (value2) => {
|
|
11941
11943
|
setInputValue(value2 != null ? value2 : "");
|
|
11942
11944
|
};
|
|
11943
|
-
const inputRef = (0,
|
|
11944
|
-
const suggestionsRef = (0,
|
|
11945
|
+
const inputRef = (0, import_react88.useRef)(null);
|
|
11946
|
+
const suggestionsRef = (0, import_react88.useRef)(null);
|
|
11945
11947
|
useOnClickOutside([inputRef.current, suggestionsRef.current], () => {
|
|
11946
11948
|
closeSuggestions();
|
|
11947
11949
|
});
|
|
@@ -11965,13 +11967,13 @@ Search2.AutocompleteWrapper = SearchAutocompleteWrapper;
|
|
|
11965
11967
|
Search2.Suggestions = SearchSuggestions;
|
|
11966
11968
|
|
|
11967
11969
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
11968
|
-
var
|
|
11970
|
+
var import_react90 = require("react");
|
|
11969
11971
|
|
|
11970
11972
|
// src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
|
|
11971
|
-
var
|
|
11972
|
-
var CheckboxGroupContext = (0,
|
|
11973
|
+
var import_react89 = require("react");
|
|
11974
|
+
var CheckboxGroupContext = (0, import_react89.createContext)(null);
|
|
11973
11975
|
var useCheckboxGroup = () => {
|
|
11974
|
-
return (0,
|
|
11976
|
+
return (0, import_react89.useContext)(CheckboxGroupContext);
|
|
11975
11977
|
};
|
|
11976
11978
|
|
|
11977
11979
|
// src/components/SelectionControl/SelectionControl.styles.tsx
|
|
@@ -12254,7 +12256,7 @@ var GroupContainer = import_styled_components77.default.div`
|
|
|
12254
12256
|
|
|
12255
12257
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
12256
12258
|
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
12257
|
-
var Checkbox = (0,
|
|
12259
|
+
var Checkbox = (0, import_react90.forwardRef)(
|
|
12258
12260
|
(props, ref) => {
|
|
12259
12261
|
const {
|
|
12260
12262
|
id,
|
|
@@ -12269,7 +12271,7 @@ var Checkbox = (0, import_react89.forwardRef)(
|
|
|
12269
12271
|
htmlProps = {},
|
|
12270
12272
|
...rest
|
|
12271
12273
|
} = props;
|
|
12272
|
-
const generatedId = (0,
|
|
12274
|
+
const generatedId = (0, import_react90.useId)();
|
|
12273
12275
|
const uniqueId = id != null ? id : `${generatedId}-checkbox`;
|
|
12274
12276
|
const checkboxGroup = useCheckboxGroup();
|
|
12275
12277
|
const hasLabel = !!label3;
|
|
@@ -12320,7 +12322,7 @@ var Checkbox = (0, import_react89.forwardRef)(
|
|
|
12320
12322
|
Checkbox.displayName = "Checkbox";
|
|
12321
12323
|
|
|
12322
12324
|
// src/components/SelectionControl/Checkbox/CheckboxGroup.tsx
|
|
12323
|
-
var
|
|
12325
|
+
var import_react91 = require("react");
|
|
12324
12326
|
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
12325
12327
|
var CheckboxGroup = (props) => {
|
|
12326
12328
|
const {
|
|
@@ -12339,7 +12341,7 @@ var CheckboxGroup = (props) => {
|
|
|
12339
12341
|
...rest
|
|
12340
12342
|
} = props;
|
|
12341
12343
|
const { "aria-required": ariaRequired } = htmlProps;
|
|
12342
|
-
const generatedId = (0,
|
|
12344
|
+
const generatedId = (0, import_react91.useId)();
|
|
12343
12345
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-checkboxGroup`;
|
|
12344
12346
|
const hasErrorMessage = !!errorMessage;
|
|
12345
12347
|
const showRequiredMarker = required || ariaRequired;
|
|
@@ -12395,13 +12397,13 @@ var CheckboxGroup = (props) => {
|
|
|
12395
12397
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
12396
12398
|
|
|
12397
12399
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
12398
|
-
var
|
|
12400
|
+
var import_react93 = require("react");
|
|
12399
12401
|
|
|
12400
12402
|
// src/components/SelectionControl/RadioButton/RadioButtonGroupContext.tsx
|
|
12401
|
-
var
|
|
12402
|
-
var RadioButtonGroupContext = (0,
|
|
12403
|
+
var import_react92 = require("react");
|
|
12404
|
+
var RadioButtonGroupContext = (0, import_react92.createContext)(null);
|
|
12403
12405
|
var useRadioButtonGroup = () => {
|
|
12404
|
-
return (0,
|
|
12406
|
+
return (0, import_react92.useContext)(RadioButtonGroupContext);
|
|
12405
12407
|
};
|
|
12406
12408
|
|
|
12407
12409
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
@@ -12415,7 +12417,7 @@ var isValueEqualToGroupValueOrFalsy = (value, group4) => {
|
|
|
12415
12417
|
}
|
|
12416
12418
|
return !!value;
|
|
12417
12419
|
};
|
|
12418
|
-
var RadioButton = (0,
|
|
12420
|
+
var RadioButton = (0, import_react93.forwardRef)(
|
|
12419
12421
|
(props, ref) => {
|
|
12420
12422
|
const {
|
|
12421
12423
|
id,
|
|
@@ -12439,7 +12441,7 @@ var RadioButton = (0, import_react92.forwardRef)(
|
|
|
12439
12441
|
style,
|
|
12440
12442
|
...restHtmlProps
|
|
12441
12443
|
} = htmlProps;
|
|
12442
|
-
const generatedId = (0,
|
|
12444
|
+
const generatedId = (0, import_react93.useId)();
|
|
12443
12445
|
const uniqueId = id != null ? id : `${generatedId}-radioButton`;
|
|
12444
12446
|
const hasLabel = !!label3;
|
|
12445
12447
|
const radioButtonGroup = useRadioButtonGroup();
|
|
@@ -12487,7 +12489,7 @@ var RadioButton = (0, import_react92.forwardRef)(
|
|
|
12487
12489
|
RadioButton.displayName = "RadioButton";
|
|
12488
12490
|
|
|
12489
12491
|
// src/components/SelectionControl/RadioButton/RadioButtonGroup.tsx
|
|
12490
|
-
var
|
|
12492
|
+
var import_react94 = require("react");
|
|
12491
12493
|
var import_jsx_runtime250 = require("react/jsx-runtime");
|
|
12492
12494
|
var RadioButtonGroupInner = (props, ref) => {
|
|
12493
12495
|
const {
|
|
@@ -12509,8 +12511,8 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12509
12511
|
...rest
|
|
12510
12512
|
} = props;
|
|
12511
12513
|
const { "aria-required": ariaRequired = false } = htmlProps;
|
|
12512
|
-
const [groupValue, setGroupValue] = (0,
|
|
12513
|
-
const generatedId = (0,
|
|
12514
|
+
const [groupValue, setGroupValue] = (0, import_react94.useState)(value);
|
|
12515
|
+
const generatedId = (0, import_react94.useId)();
|
|
12514
12516
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-radioButtonGroup`;
|
|
12515
12517
|
const handleChange = combineHandlers(
|
|
12516
12518
|
(e) => setGroupValue(e.target.value),
|
|
@@ -12571,11 +12573,11 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12571
12573
|
}
|
|
12572
12574
|
);
|
|
12573
12575
|
};
|
|
12574
|
-
var RadioButtonGroup = (0,
|
|
12576
|
+
var RadioButtonGroup = (0, import_react94.forwardRef)(RadioButtonGroupInner);
|
|
12575
12577
|
RadioButtonGroup.displayName = "RadioButtonGroup";
|
|
12576
12578
|
|
|
12577
12579
|
// src/components/SkipToContent/SkipToContent.tsx
|
|
12578
|
-
var
|
|
12580
|
+
var import_react95 = require("react");
|
|
12579
12581
|
var import_styled_components78 = __toESM(require("styled-components"));
|
|
12580
12582
|
|
|
12581
12583
|
// src/components/SkipToContent/SkipToContent.tokens.tsx
|
|
@@ -12643,7 +12645,7 @@ var Link4 = import_styled_components78.default.a`
|
|
|
12643
12645
|
color: ${link5.base.color};
|
|
12644
12646
|
}
|
|
12645
12647
|
`;
|
|
12646
|
-
var SkipToContent = (0,
|
|
12648
|
+
var SkipToContent = (0, import_react95.forwardRef)(
|
|
12647
12649
|
(props, ref) => {
|
|
12648
12650
|
const {
|
|
12649
12651
|
text = "Til hovedinnhold",
|
|
@@ -12672,7 +12674,7 @@ var SkipToContent = (0, import_react94.forwardRef)(
|
|
|
12672
12674
|
SkipToContent.displayName = "SkipToContent";
|
|
12673
12675
|
|
|
12674
12676
|
// src/components/SplitButton/SplitButton.tsx
|
|
12675
|
-
var
|
|
12677
|
+
var import_react96 = require("react");
|
|
12676
12678
|
var import_styled_components79 = __toESM(require("styled-components"));
|
|
12677
12679
|
|
|
12678
12680
|
// src/components/SplitButton/SplitButton.tokens.ts
|
|
@@ -12718,7 +12720,7 @@ var OptionButton = (0, import_styled_components79.default)(Button)`
|
|
|
12718
12720
|
${(props) => props.purpose === "primary" && `border-left: ${tokens3.mainButton.primary.borderLeft}`};
|
|
12719
12721
|
}
|
|
12720
12722
|
`;
|
|
12721
|
-
var SplitButton = (0,
|
|
12723
|
+
var SplitButton = (0, import_react96.forwardRef)(
|
|
12722
12724
|
(props, ref) => {
|
|
12723
12725
|
const {
|
|
12724
12726
|
size: size2,
|
|
@@ -12726,7 +12728,7 @@ var SplitButton = (0, import_react95.forwardRef)(
|
|
|
12726
12728
|
secondaryActions,
|
|
12727
12729
|
purpose = "primary"
|
|
12728
12730
|
} = props;
|
|
12729
|
-
const [isOpen, setIsOpen] = (0,
|
|
12731
|
+
const [isOpen, setIsOpen] = (0, import_react96.useState)(false);
|
|
12730
12732
|
const buttonStyleProps = {
|
|
12731
12733
|
appearance: "filled",
|
|
12732
12734
|
purpose,
|
|
@@ -12759,23 +12761,23 @@ var SplitButton = (0, import_react95.forwardRef)(
|
|
|
12759
12761
|
SplitButton.displayName = "SplitButton";
|
|
12760
12762
|
|
|
12761
12763
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
12762
|
-
var
|
|
12764
|
+
var import_react106 = require("react");
|
|
12763
12765
|
var import_styled_components88 = __toESM(require("styled-components"));
|
|
12764
12766
|
|
|
12765
12767
|
// src/components/Table/collapsible/Table.context.tsx
|
|
12766
|
-
var
|
|
12767
|
-
var CollapsibleTableContext = (0,
|
|
12768
|
+
var import_react97 = require("react");
|
|
12769
|
+
var CollapsibleTableContext = (0, import_react97.createContext)({
|
|
12768
12770
|
headerValues: [],
|
|
12769
12771
|
definingColumnIndex: [0]
|
|
12770
12772
|
});
|
|
12771
|
-
var useCollapsibleTableContext = () => (0,
|
|
12773
|
+
var useCollapsibleTableContext = () => (0, import_react97.useContext)(CollapsibleTableContext);
|
|
12772
12774
|
|
|
12773
12775
|
// src/components/Table/normal/Body.tsx
|
|
12774
|
-
var
|
|
12776
|
+
var import_react98 = require("react");
|
|
12775
12777
|
var import_styled_components80 = __toESM(require("styled-components"));
|
|
12776
12778
|
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
12777
12779
|
var StyledBody = import_styled_components80.default.tbody``;
|
|
12778
|
-
var Body2 = (0,
|
|
12780
|
+
var Body2 = (0, import_react98.forwardRef)(
|
|
12779
12781
|
({ children, ...rest }, ref) => {
|
|
12780
12782
|
const bodyProps = {
|
|
12781
12783
|
...rest
|
|
@@ -12786,23 +12788,23 @@ var Body2 = (0, import_react97.forwardRef)(
|
|
|
12786
12788
|
Body2.displayName = "Table.Body";
|
|
12787
12789
|
|
|
12788
12790
|
// src/components/Table/normal/Cell.tsx
|
|
12789
|
-
var
|
|
12791
|
+
var import_react100 = require("react");
|
|
12790
12792
|
var import_styled_components82 = __toESM(require("styled-components"));
|
|
12791
12793
|
|
|
12792
12794
|
// src/components/Table/normal/Head.tsx
|
|
12793
|
-
var
|
|
12795
|
+
var import_react99 = require("react");
|
|
12794
12796
|
var import_styled_components81 = __toESM(require("styled-components"));
|
|
12795
12797
|
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
12796
12798
|
var StyledHead = import_styled_components81.default.thead``;
|
|
12797
|
-
var Head = (0,
|
|
12799
|
+
var Head = (0, import_react99.forwardRef)(
|
|
12798
12800
|
({ children, ...rest }, ref) => {
|
|
12799
12801
|
return /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(StyledHead, { ref, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(HeadContext.Provider, { value: true, children }) });
|
|
12800
12802
|
}
|
|
12801
12803
|
);
|
|
12802
12804
|
Head.displayName = "Table.Head";
|
|
12803
|
-
var HeadContext = (0,
|
|
12805
|
+
var HeadContext = (0, import_react99.createContext)(false);
|
|
12804
12806
|
function useIsInTableHead() {
|
|
12805
|
-
const isInTableHead = (0,
|
|
12807
|
+
const isInTableHead = (0, import_react99.useContext)(HeadContext);
|
|
12806
12808
|
return isInTableHead;
|
|
12807
12809
|
}
|
|
12808
12810
|
|
|
@@ -12919,7 +12921,7 @@ var getTableCellType = (type) => {
|
|
|
12919
12921
|
return "td";
|
|
12920
12922
|
}
|
|
12921
12923
|
};
|
|
12922
|
-
var Cell2 = (0,
|
|
12924
|
+
var Cell2 = (0, import_react100.forwardRef)(
|
|
12923
12925
|
({ children, type: _type, layout = "left", collapsibleProps, ...rest }, ref) => {
|
|
12924
12926
|
const isInHead = useIsInTableHead();
|
|
12925
12927
|
const type = _type != null ? _type : isInHead ? "head" : "data";
|
|
@@ -12931,11 +12933,11 @@ var Cell2 = (0, import_react99.forwardRef)(
|
|
|
12931
12933
|
Cell2.displayName = "Table.Cell";
|
|
12932
12934
|
|
|
12933
12935
|
// src/components/Table/normal/Foot.tsx
|
|
12934
|
-
var
|
|
12936
|
+
var import_react101 = require("react");
|
|
12935
12937
|
var import_styled_components83 = __toESM(require("styled-components"));
|
|
12936
12938
|
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
12937
12939
|
var StyledFoot = import_styled_components83.default.tfoot``;
|
|
12938
|
-
var Foot = (0,
|
|
12940
|
+
var Foot = (0, import_react101.forwardRef)(
|
|
12939
12941
|
({ children, ...rest }, ref) => {
|
|
12940
12942
|
return /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(StyledFoot, { ref, ...rest, children });
|
|
12941
12943
|
}
|
|
@@ -12943,7 +12945,7 @@ var Foot = (0, import_react100.forwardRef)(
|
|
|
12943
12945
|
Foot.displayName = "Table.Foot";
|
|
12944
12946
|
|
|
12945
12947
|
// src/components/Table/normal/Row.tsx
|
|
12946
|
-
var
|
|
12948
|
+
var import_react102 = require("react");
|
|
12947
12949
|
|
|
12948
12950
|
// src/components/Table/normal/Table.styles.tsx
|
|
12949
12951
|
var import_styled_components84 = __toESM(require("styled-components"));
|
|
@@ -12999,7 +13001,7 @@ var StyledRow = import_styled_components84.default.tr`
|
|
|
12999
13001
|
|
|
13000
13002
|
// src/components/Table/normal/Row.tsx
|
|
13001
13003
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
13002
|
-
var Row = (0,
|
|
13004
|
+
var Row = (0, import_react102.forwardRef)(
|
|
13003
13005
|
({ type: _type, mode = "normal", hoverable, selected, children, ...rest }, ref) => {
|
|
13004
13006
|
const isInHeader = useIsInTableHead();
|
|
13005
13007
|
const type = _type != null ? _type : isInHeader ? "head" : "body";
|
|
@@ -13020,7 +13022,7 @@ var Row = (0, import_react101.forwardRef)(
|
|
|
13020
13022
|
Row.displayName = "Table.Row";
|
|
13021
13023
|
|
|
13022
13024
|
// src/components/Table/normal/SortCell.tsx
|
|
13023
|
-
var
|
|
13025
|
+
var import_react103 = require("react");
|
|
13024
13026
|
var import_styled_components85 = __toESM(require("styled-components"));
|
|
13025
13027
|
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
13026
13028
|
var { cell: cell4 } = tableTokens;
|
|
@@ -13041,7 +13043,7 @@ var makeSortIcon = (isSorted, sortOrder) => {
|
|
|
13041
13043
|
}
|
|
13042
13044
|
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
13045
|
};
|
|
13044
|
-
var SortCell = (0,
|
|
13046
|
+
var SortCell = (0, import_react103.forwardRef)(
|
|
13045
13047
|
({ isSorted, sortOrder, onClick, children, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(
|
|
13046
13048
|
Cell2,
|
|
13047
13049
|
{
|
|
@@ -13067,7 +13069,7 @@ var SortCell = (0, import_react102.forwardRef)(
|
|
|
13067
13069
|
SortCell.displayName = "Table.SortCell";
|
|
13068
13070
|
|
|
13069
13071
|
// src/components/Table/normal/Table.tsx
|
|
13070
|
-
var
|
|
13072
|
+
var import_react104 = require("react");
|
|
13071
13073
|
var import_styled_components86 = __toESM(require("styled-components"));
|
|
13072
13074
|
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
13073
13075
|
var { cell: cell5, row: row3 } = tableTokens;
|
|
@@ -13114,7 +13116,7 @@ var StyledTable = import_styled_components86.default.table`
|
|
|
13114
13116
|
}
|
|
13115
13117
|
`}
|
|
13116
13118
|
`;
|
|
13117
|
-
var Table = (0,
|
|
13119
|
+
var Table = (0, import_react104.forwardRef)(
|
|
13118
13120
|
({ density = "normal", stickyHeader, withDividers, children, ...rest }, ref) => {
|
|
13119
13121
|
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
13120
13122
|
StyledTable,
|
|
@@ -13132,7 +13134,7 @@ var Table = (0, import_react103.forwardRef)(
|
|
|
13132
13134
|
Table.displayName = "Table";
|
|
13133
13135
|
|
|
13134
13136
|
// src/components/Table/normal/TableWrapper.tsx
|
|
13135
|
-
var
|
|
13137
|
+
var import_react105 = require("react");
|
|
13136
13138
|
var import_styled_components87 = __toESM(require("styled-components"));
|
|
13137
13139
|
var import_jsx_runtime260 = require("react/jsx-runtime");
|
|
13138
13140
|
var Wrapper6 = import_styled_components87.default.div`
|
|
@@ -13143,20 +13145,20 @@ var Wrapper6 = import_styled_components87.default.div`
|
|
|
13143
13145
|
${scrollbarStyling.firefox}
|
|
13144
13146
|
`;
|
|
13145
13147
|
var TableWrapper = ({ children, ...rest }) => {
|
|
13146
|
-
const [overflowX, setOverflowX] = (0,
|
|
13147
|
-
const [windowWidth, setWindowWidth] = (0,
|
|
13148
|
+
const [overflowX, setOverflowX] = (0, import_react105.useState)(false);
|
|
13149
|
+
const [windowWidth, setWindowWidth] = (0, import_react105.useState)(window.innerWidth);
|
|
13148
13150
|
function isOverflowingX(event) {
|
|
13149
13151
|
return event.offsetWidth < event.scrollWidth;
|
|
13150
13152
|
}
|
|
13151
|
-
const wrapperRef = (0,
|
|
13152
|
-
(0,
|
|
13153
|
+
const wrapperRef = (0, import_react105.useRef)(null);
|
|
13154
|
+
(0, import_react105.useEffect)(() => {
|
|
13153
13155
|
if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
|
|
13154
13156
|
setOverflowX(true);
|
|
13155
13157
|
return;
|
|
13156
13158
|
}
|
|
13157
13159
|
setOverflowX(false);
|
|
13158
13160
|
}, [windowWidth]);
|
|
13159
|
-
(0,
|
|
13161
|
+
(0, import_react105.useEffect)(() => {
|
|
13160
13162
|
function handleResize() {
|
|
13161
13163
|
setWindowWidth(window.innerWidth);
|
|
13162
13164
|
}
|
|
@@ -13200,7 +13202,7 @@ var DescriptionListCell = (0, import_styled_components88.default)(Cell2)`
|
|
|
13200
13202
|
display: block;
|
|
13201
13203
|
}
|
|
13202
13204
|
`;
|
|
13203
|
-
var CollapsibleRow = (0,
|
|
13205
|
+
var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
13204
13206
|
({ type: _type, mode = "normal", selected, hoverable, children, ...rest }, ref) => {
|
|
13205
13207
|
const isInHead = useIsInTableHead();
|
|
13206
13208
|
const type = _type != null ? _type : isInHead ? "head" : "body";
|
|
@@ -13212,14 +13214,14 @@ var CollapsibleRow = (0, import_react105.forwardRef)(
|
|
|
13212
13214
|
...rest
|
|
13213
13215
|
};
|
|
13214
13216
|
const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
|
|
13215
|
-
const [childrenCollapsed, setChildrenCollapsed] = (0,
|
|
13216
|
-
(0,
|
|
13217
|
+
const [childrenCollapsed, setChildrenCollapsed] = (0, import_react106.useState)(true);
|
|
13218
|
+
(0, import_react106.useEffect)(() => {
|
|
13217
13219
|
!isCollapsed && setChildrenCollapsed(true);
|
|
13218
13220
|
}, [isCollapsed]);
|
|
13219
13221
|
const collapsedHeaderValues = headerValues.filter(
|
|
13220
13222
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
13221
13223
|
);
|
|
13222
|
-
const childrenArray =
|
|
13224
|
+
const childrenArray = import_react106.Children.toArray(children);
|
|
13223
13225
|
const collapsedChildren = childrenArray.filter(
|
|
13224
13226
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
13225
13227
|
);
|
|
@@ -13228,9 +13230,9 @@ var CollapsibleRow = (0, import_react105.forwardRef)(
|
|
|
13228
13230
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
13229
13231
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
13230
13232
|
collapsibleIds.push(id);
|
|
13231
|
-
return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(
|
|
13233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(import_react106.Fragment, { children: [
|
|
13232
13234
|
/* @__PURE__ */ (0, import_jsx_runtime261.jsx)(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
|
|
13233
|
-
(0,
|
|
13235
|
+
(0, import_react106.isValidElement)(child) && (0, import_react106.cloneElement)(child, {
|
|
13234
13236
|
collapsibleProps: { isCollapsibleChild: true }
|
|
13235
13237
|
})
|
|
13236
13238
|
] }, `DL-${index}`);
|
|
@@ -13295,7 +13297,7 @@ var CollapsibleRow = (0, import_react105.forwardRef)(
|
|
|
13295
13297
|
CollapsibleRow.displayName = "CollapsibleTable.Row";
|
|
13296
13298
|
|
|
13297
13299
|
// src/components/Table/collapsible/CollapsibleTable.tsx
|
|
13298
|
-
var
|
|
13300
|
+
var import_react107 = require("react");
|
|
13299
13301
|
var import_styled_components89 = __toESM(require("styled-components"));
|
|
13300
13302
|
var import_jsx_runtime262 = require("react/jsx-runtime");
|
|
13301
13303
|
var StyledTable2 = (0, import_styled_components89.default)(Table2)`
|
|
@@ -13306,7 +13308,7 @@ var StyledTable2 = (0, import_styled_components89.default)(Table2)`
|
|
|
13306
13308
|
}
|
|
13307
13309
|
`}
|
|
13308
13310
|
`;
|
|
13309
|
-
var CollapsibleTable = (0,
|
|
13311
|
+
var CollapsibleTable = (0, import_react107.forwardRef)((props, ref) => {
|
|
13310
13312
|
const {
|
|
13311
13313
|
density = "normal",
|
|
13312
13314
|
children,
|
|
@@ -13334,12 +13336,12 @@ var CollapsibleTable2 = CollapsibleTable;
|
|
|
13334
13336
|
CollapsibleTable2.Row = CollapsibleRow;
|
|
13335
13337
|
|
|
13336
13338
|
// src/components/Tabs/Tabs.tsx
|
|
13337
|
-
var
|
|
13339
|
+
var import_react109 = require("react");
|
|
13338
13340
|
var import_styled_components90 = __toESM(require("styled-components"));
|
|
13339
13341
|
|
|
13340
13342
|
// src/components/Tabs/Tabs.context.tsx
|
|
13341
|
-
var
|
|
13342
|
-
var TabsContext = (0,
|
|
13343
|
+
var import_react108 = require("react");
|
|
13344
|
+
var TabsContext = (0, import_react108.createContext)({
|
|
13343
13345
|
activeTab: 0,
|
|
13344
13346
|
tabsId: "",
|
|
13345
13347
|
handleTabChange: () => null,
|
|
@@ -13349,7 +13351,7 @@ var TabsContext = (0, import_react107.createContext)({
|
|
|
13349
13351
|
setHasTabFocus: () => null,
|
|
13350
13352
|
tabContentDirection: "row"
|
|
13351
13353
|
});
|
|
13352
|
-
var useTabsContext = () => (0,
|
|
13354
|
+
var useTabsContext = () => (0, import_react108.useContext)(TabsContext);
|
|
13353
13355
|
|
|
13354
13356
|
// src/components/Tabs/Tabs.tsx
|
|
13355
13357
|
var import_jsx_runtime263 = require("react/jsx-runtime");
|
|
@@ -13358,7 +13360,7 @@ var Container15 = import_styled_components90.default.div`
|
|
|
13358
13360
|
width: ${$width};
|
|
13359
13361
|
`};
|
|
13360
13362
|
`;
|
|
13361
|
-
var Tabs = (0,
|
|
13363
|
+
var Tabs = (0, import_react109.forwardRef)((props, ref) => {
|
|
13362
13364
|
const {
|
|
13363
13365
|
id,
|
|
13364
13366
|
activeTab,
|
|
@@ -13370,17 +13372,17 @@ var Tabs = (0, import_react108.forwardRef)((props, ref) => {
|
|
|
13370
13372
|
htmlProps,
|
|
13371
13373
|
...rest
|
|
13372
13374
|
} = props;
|
|
13373
|
-
const generatedId = (0,
|
|
13375
|
+
const generatedId = (0, import_react109.useId)();
|
|
13374
13376
|
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,
|
|
13377
|
+
const [thisActiveTab, setActiveTab] = (0, import_react109.useState)(activeTab != null ? activeTab : 0);
|
|
13378
|
+
const [hasTabFocus, setHasTabFocus] = (0, import_react109.useState)(false);
|
|
13379
|
+
const tabListRef = (0, import_react109.useRef)(null);
|
|
13380
|
+
const tabPanelsRef = (0, import_react109.useRef)(null);
|
|
13379
13381
|
const handleTabChange = (index) => {
|
|
13380
13382
|
setActiveTab(index);
|
|
13381
13383
|
onChange && onChange(index);
|
|
13382
13384
|
};
|
|
13383
|
-
(0,
|
|
13385
|
+
(0, import_react109.useEffect)(() => {
|
|
13384
13386
|
if (activeTab !== void 0 && activeTab !== thisActiveTab) {
|
|
13385
13387
|
setActiveTab(activeTab);
|
|
13386
13388
|
}
|
|
@@ -13409,7 +13411,7 @@ var Tabs = (0, import_react108.forwardRef)((props, ref) => {
|
|
|
13409
13411
|
Tabs.displayName = "Tabs";
|
|
13410
13412
|
|
|
13411
13413
|
// src/components/Tabs/Tab.tsx
|
|
13412
|
-
var
|
|
13414
|
+
var import_react111 = require("react");
|
|
13413
13415
|
var import_styled_components91 = __toESM(require("styled-components"));
|
|
13414
13416
|
|
|
13415
13417
|
// src/components/Tabs/Tabs.tokens.tsx
|
|
@@ -13452,9 +13454,9 @@ var tabsTokens = {
|
|
|
13452
13454
|
};
|
|
13453
13455
|
|
|
13454
13456
|
// src/components/Tabs/TabWidthContext.tsx
|
|
13455
|
-
var
|
|
13457
|
+
var import_react110 = require("react");
|
|
13456
13458
|
var import_jsx_runtime264 = require("react/jsx-runtime");
|
|
13457
|
-
var TabContext = (0,
|
|
13459
|
+
var TabContext = (0, import_react110.createContext)(null);
|
|
13458
13460
|
function TabWidthContextProvider({
|
|
13459
13461
|
children,
|
|
13460
13462
|
onChangeWidths
|
|
@@ -13483,8 +13485,8 @@ function TabWidthContextProvider({
|
|
|
13483
13485
|
);
|
|
13484
13486
|
}
|
|
13485
13487
|
function useSetTabWidth(index, width) {
|
|
13486
|
-
const context = (0,
|
|
13487
|
-
(0,
|
|
13488
|
+
const context = (0, import_react110.useContext)(TabContext);
|
|
13489
|
+
(0, import_react110.useLayoutEffect)(() => {
|
|
13488
13490
|
context == null ? void 0 : context.updateWidth(index, width);
|
|
13489
13491
|
return () => context == null ? void 0 : context.removeTab(index);
|
|
13490
13492
|
}, [index, width]);
|
|
@@ -13536,7 +13538,7 @@ var Button2 = import_styled_components91.default.button`
|
|
|
13536
13538
|
box-shadow: ${tab2.hover.boxShadow};
|
|
13537
13539
|
}
|
|
13538
13540
|
`;
|
|
13539
|
-
var Tab = (0,
|
|
13541
|
+
var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
13540
13542
|
const {
|
|
13541
13543
|
active = false,
|
|
13542
13544
|
icon: icon11,
|
|
@@ -13553,16 +13555,16 @@ var Tab = (0, import_react110.forwardRef)((props, ref) => {
|
|
|
13553
13555
|
...rest
|
|
13554
13556
|
} = props;
|
|
13555
13557
|
useSetTabWidth(index, width);
|
|
13556
|
-
const itemRef = (0,
|
|
13558
|
+
const itemRef = (0, import_react111.useRef)(null);
|
|
13557
13559
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
13558
13560
|
const { tabContentDirection } = useTabsContext();
|
|
13559
|
-
(0,
|
|
13561
|
+
(0, import_react111.useEffect)(() => {
|
|
13560
13562
|
var _a;
|
|
13561
13563
|
if (focus) {
|
|
13562
13564
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
13563
13565
|
}
|
|
13564
13566
|
}, [focus]);
|
|
13565
|
-
const handleSelect = (0,
|
|
13567
|
+
const handleSelect = (0, import_react111.useCallback)(() => {
|
|
13566
13568
|
if (setFocus && index) {
|
|
13567
13569
|
setFocus(index);
|
|
13568
13570
|
}
|
|
@@ -13597,7 +13599,7 @@ var Tab = (0, import_react110.forwardRef)((props, ref) => {
|
|
|
13597
13599
|
Tab.displayName = "Tab";
|
|
13598
13600
|
|
|
13599
13601
|
// src/components/Tabs/TabList.tsx
|
|
13600
|
-
var
|
|
13602
|
+
var import_react112 = require("react");
|
|
13601
13603
|
var import_styled_components92 = __toESM(require("styled-components"));
|
|
13602
13604
|
var import_jsx_runtime266 = require("react/jsx-runtime");
|
|
13603
13605
|
var { tabList: tabList2 } = tabsTokens;
|
|
@@ -13627,7 +13629,7 @@ var TabRow = import_styled_components92.default.div`
|
|
|
13627
13629
|
outline: none;
|
|
13628
13630
|
}
|
|
13629
13631
|
`;
|
|
13630
|
-
var TabList = (0,
|
|
13632
|
+
var TabList = (0, import_react112.forwardRef)(
|
|
13631
13633
|
({ children, id, onFocus, ...rest }, ref) => {
|
|
13632
13634
|
const {
|
|
13633
13635
|
activeTab,
|
|
@@ -13638,11 +13640,11 @@ var TabList = (0, import_react111.forwardRef)(
|
|
|
13638
13640
|
setHasTabFocus
|
|
13639
13641
|
} = useTabsContext();
|
|
13640
13642
|
const uniqueId = id != null ? id : `${tabsId}-tablist`;
|
|
13641
|
-
const childrenArray =
|
|
13643
|
+
const childrenArray = import_react112.Children.toArray(children).length;
|
|
13642
13644
|
const [focus, setFocus] = useRoveFocus(childrenArray, hasTabFocus, "row");
|
|
13643
13645
|
const combinedRef = useCombinedRef(ref, tabListRef);
|
|
13644
|
-
const tabListChildren =
|
|
13645
|
-
return (0,
|
|
13646
|
+
const tabListChildren = import_react112.Children.map(children, (child, index) => {
|
|
13647
|
+
return (0, import_react112.isValidElement)(child) && (0, import_react112.cloneElement)(child, {
|
|
13646
13648
|
id: `${tabsId}-tab-${index}`,
|
|
13647
13649
|
"aria-controls": `${tabsId}-panel-${index}`,
|
|
13648
13650
|
active: activeTab === index,
|
|
@@ -13652,7 +13654,7 @@ var TabList = (0, import_react111.forwardRef)(
|
|
|
13652
13654
|
onClick: () => handleTabChange(index)
|
|
13653
13655
|
});
|
|
13654
13656
|
});
|
|
13655
|
-
const [widths, setWidths] = (0,
|
|
13657
|
+
const [widths, setWidths] = (0, import_react112.useState)([]);
|
|
13656
13658
|
const handleOnFocus = (event) => {
|
|
13657
13659
|
setHasTabFocus(true);
|
|
13658
13660
|
onFocus && onFocus(event);
|
|
@@ -13686,7 +13688,7 @@ var TabList = (0, import_react111.forwardRef)(
|
|
|
13686
13688
|
TabList.displayName = "TabList";
|
|
13687
13689
|
|
|
13688
13690
|
// src/components/Tabs/TabPanel.tsx
|
|
13689
|
-
var
|
|
13691
|
+
var import_react113 = require("react");
|
|
13690
13692
|
var import_styled_components93 = __toESM(require("styled-components"));
|
|
13691
13693
|
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
13692
13694
|
var { panel: panel2 } = tabsTokens;
|
|
@@ -13703,7 +13705,7 @@ var Panel = import_styled_components93.default.div`
|
|
|
13703
13705
|
${focusVisible}
|
|
13704
13706
|
}
|
|
13705
13707
|
`;
|
|
13706
|
-
var TabPanel = (0,
|
|
13708
|
+
var TabPanel = (0, import_react113.forwardRef)(
|
|
13707
13709
|
({ active = false, children, id, className, htmlProps, ...rest }, ref) => {
|
|
13708
13710
|
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
13709
13711
|
Panel,
|
|
@@ -13721,15 +13723,15 @@ var TabPanel = (0, import_react112.forwardRef)(
|
|
|
13721
13723
|
TabPanel.displayName = "TabPanel";
|
|
13722
13724
|
|
|
13723
13725
|
// src/components/Tabs/TabPanels.tsx
|
|
13724
|
-
var
|
|
13726
|
+
var import_react114 = require("react");
|
|
13725
13727
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
13726
|
-
var TabPanels = (0,
|
|
13728
|
+
var TabPanels = (0, import_react114.forwardRef)(
|
|
13727
13729
|
({ children, ...rest }, ref) => {
|
|
13728
13730
|
const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
|
|
13729
13731
|
const combinedRef = useCombinedRef(ref, tabPanelsRef);
|
|
13730
|
-
const panelChildren =
|
|
13732
|
+
const panelChildren = import_react114.Children.map(children, (child, index) => {
|
|
13731
13733
|
const active = index === activeTab;
|
|
13732
|
-
return (0,
|
|
13734
|
+
return (0, import_react114.isValidElement)(child) && (0, import_react114.cloneElement)(child, {
|
|
13733
13735
|
id: `${tabsId}-panel-${index}`,
|
|
13734
13736
|
"aria-labelledby": `${tabsId}-tab-${index}`,
|
|
13735
13737
|
active,
|
|
@@ -13742,7 +13744,7 @@ var TabPanels = (0, import_react113.forwardRef)(
|
|
|
13742
13744
|
TabPanels.displayName = "TabPanels";
|
|
13743
13745
|
|
|
13744
13746
|
// src/components/Tag/Tag.tsx
|
|
13745
|
-
var
|
|
13747
|
+
var import_react115 = require("react");
|
|
13746
13748
|
var import_styled_components94 = __toESM(require("styled-components"));
|
|
13747
13749
|
|
|
13748
13750
|
// src/components/Tag/Tag.tokens.tsx
|
|
@@ -13869,7 +13871,7 @@ var StyledIcon4 = (0, import_styled_components94.default)(Icon)`
|
|
|
13869
13871
|
return (_a = wrapper8.purpose[$purpose][$strong ? "strong" : "base"].icon) == null ? void 0 : _a.color;
|
|
13870
13872
|
}};
|
|
13871
13873
|
`;
|
|
13872
|
-
var Tag = (0,
|
|
13874
|
+
var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
13873
13875
|
const {
|
|
13874
13876
|
text,
|
|
13875
13877
|
purpose = "default",
|
|
@@ -13908,11 +13910,11 @@ var Tag = (0, import_react114.forwardRef)((props, ref) => {
|
|
|
13908
13910
|
Tag.displayName = "Tag";
|
|
13909
13911
|
|
|
13910
13912
|
// src/components/TextInput/TextInput.tsx
|
|
13911
|
-
var
|
|
13913
|
+
var import_react117 = require("react");
|
|
13912
13914
|
var import_styled_components97 = __toESM(require("styled-components"));
|
|
13913
13915
|
|
|
13914
13916
|
// src/components/TextInput/CharCounter.tsx
|
|
13915
|
-
var
|
|
13917
|
+
var import_react116 = require("react");
|
|
13916
13918
|
var import_styled_components95 = __toESM(require("styled-components"));
|
|
13917
13919
|
var import_jsx_runtime270 = require("react/jsx-runtime");
|
|
13918
13920
|
var Wrapper8 = (0, import_styled_components95.default)(Typography)`
|
|
@@ -13920,7 +13922,7 @@ var Wrapper8 = (0, import_styled_components95.default)(Typography)`
|
|
|
13920
13922
|
`;
|
|
13921
13923
|
function CharCounter(props) {
|
|
13922
13924
|
const { current, max, id, className, htmlProps, ...rest } = props;
|
|
13923
|
-
const generatedId = (0,
|
|
13925
|
+
const generatedId = (0, import_react116.useId)();
|
|
13924
13926
|
const uniqueId = id != null ? id : `${generatedId}-characterCounter`;
|
|
13925
13927
|
return /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(
|
|
13926
13928
|
Wrapper8,
|
|
@@ -14059,7 +14061,7 @@ var Suffix = (0, import_styled_components97.default)(Affix)`
|
|
|
14059
14061
|
border-left: none;
|
|
14060
14062
|
`};
|
|
14061
14063
|
`;
|
|
14062
|
-
var TextInput2 = (0,
|
|
14064
|
+
var TextInput2 = (0, import_react117.forwardRef)(
|
|
14063
14065
|
({
|
|
14064
14066
|
label: label3,
|
|
14065
14067
|
disabled,
|
|
@@ -14085,14 +14087,14 @@ var TextInput2 = (0, import_react116.forwardRef)(
|
|
|
14085
14087
|
suffix,
|
|
14086
14088
|
...rest
|
|
14087
14089
|
}, ref) => {
|
|
14088
|
-
const [text, setText] = (0,
|
|
14090
|
+
const [text, setText] = (0, import_react117.useState)(
|
|
14089
14091
|
getDefaultText(value, defaultValue)
|
|
14090
14092
|
);
|
|
14091
|
-
const prefixRef = (0,
|
|
14092
|
-
const suffixRef = (0,
|
|
14093
|
-
const [prefixLength, setPrefixLength] = (0,
|
|
14094
|
-
const [suffixLength, setSuffixLength] = (0,
|
|
14095
|
-
(0,
|
|
14093
|
+
const prefixRef = (0, import_react117.useRef)(null);
|
|
14094
|
+
const suffixRef = (0, import_react117.useRef)(null);
|
|
14095
|
+
const [prefixLength, setPrefixLength] = (0, import_react117.useState)(0);
|
|
14096
|
+
const [suffixLength, setSuffixLength] = (0, import_react117.useState)(0);
|
|
14097
|
+
(0, import_react117.useLayoutEffect)(() => {
|
|
14096
14098
|
if (prefixRef.current) {
|
|
14097
14099
|
setPrefixLength(prefixRef.current.offsetWidth);
|
|
14098
14100
|
}
|
|
@@ -14106,7 +14108,7 @@ var TextInput2 = (0, import_react116.forwardRef)(
|
|
|
14106
14108
|
onChange(event);
|
|
14107
14109
|
}
|
|
14108
14110
|
};
|
|
14109
|
-
const generatedId = (0,
|
|
14111
|
+
const generatedId = (0, import_react117.useId)();
|
|
14110
14112
|
const uniqueId = id != null ? id : `${generatedId}-textInput`;
|
|
14111
14113
|
const hasErrorMessage = !!errorMessage;
|
|
14112
14114
|
const hasTip = !!tip;
|
|
@@ -14216,15 +14218,15 @@ var TextInput2 = (0, import_react116.forwardRef)(
|
|
|
14216
14218
|
TextInput2.displayName = "TextInput";
|
|
14217
14219
|
|
|
14218
14220
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
14219
|
-
var
|
|
14221
|
+
var import_react119 = require("react");
|
|
14220
14222
|
var import_styled_components98 = __toESM(require("styled-components"));
|
|
14221
14223
|
|
|
14222
14224
|
// src/components/ToggleBar/ToggleBar.context.tsx
|
|
14223
|
-
var
|
|
14224
|
-
var ToggleBarContext = (0,
|
|
14225
|
+
var import_react118 = require("react");
|
|
14226
|
+
var ToggleBarContext = (0, import_react118.createContext)({
|
|
14225
14227
|
size: "medium"
|
|
14226
14228
|
});
|
|
14227
|
-
var useToggleBarContext = () => (0,
|
|
14229
|
+
var useToggleBarContext = () => (0, import_react118.useContext)(ToggleBarContext);
|
|
14228
14230
|
|
|
14229
14231
|
// src/components/ToggleBar/ToggleBar.tokens.tsx
|
|
14230
14232
|
var import_dds_design_tokens63 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -14365,9 +14367,9 @@ var ToggleBar = (props) => {
|
|
|
14365
14367
|
id,
|
|
14366
14368
|
...rest
|
|
14367
14369
|
} = props;
|
|
14368
|
-
const generatedId = (0,
|
|
14370
|
+
const generatedId = (0, import_react119.useId)();
|
|
14369
14371
|
const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
|
|
14370
|
-
const [groupValue, setGroupValue] = (0,
|
|
14372
|
+
const [groupValue, setGroupValue] = (0, import_react119.useState)(value);
|
|
14371
14373
|
const handleChange = combineHandlers(
|
|
14372
14374
|
(e) => setGroupValue(e.target.value),
|
|
14373
14375
|
(e) => onChange && onChange(e, e.target.value)
|
|
@@ -14401,7 +14403,7 @@ var ToggleBar = (props) => {
|
|
|
14401
14403
|
ToggleBar.displayName = "ToggleBar";
|
|
14402
14404
|
|
|
14403
14405
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
14404
|
-
var
|
|
14406
|
+
var import_react120 = require("react");
|
|
14405
14407
|
|
|
14406
14408
|
// src/components/ToggleBar/ToggleRadio.styles.tsx
|
|
14407
14409
|
var import_styled_components99 = __toESM(require("styled-components"));
|
|
@@ -14485,7 +14487,7 @@ var calculateChecked = (value, group4, checked) => {
|
|
|
14485
14487
|
}
|
|
14486
14488
|
return !!value;
|
|
14487
14489
|
};
|
|
14488
|
-
var ToggleRadio = (0,
|
|
14490
|
+
var ToggleRadio = (0, import_react120.forwardRef)(
|
|
14489
14491
|
(props, ref) => {
|
|
14490
14492
|
const {
|
|
14491
14493
|
value,
|
|
@@ -14501,7 +14503,7 @@ var ToggleRadio = (0, import_react119.forwardRef)(
|
|
|
14501
14503
|
id,
|
|
14502
14504
|
...rest
|
|
14503
14505
|
} = props;
|
|
14504
|
-
const generatedId = (0,
|
|
14506
|
+
const generatedId = (0, import_react120.useId)();
|
|
14505
14507
|
const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
|
|
14506
14508
|
const group4 = useToggleBarContext();
|
|
14507
14509
|
const handleChange = (event) => {
|
|
@@ -14533,7 +14535,7 @@ var ToggleRadio = (0, import_react119.forwardRef)(
|
|
|
14533
14535
|
ToggleRadio.displayName = "ToggleRadio";
|
|
14534
14536
|
|
|
14535
14537
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
14536
|
-
var
|
|
14538
|
+
var import_react121 = require("react");
|
|
14537
14539
|
var import_styled_components100 = __toESM(require("styled-components"));
|
|
14538
14540
|
|
|
14539
14541
|
// src/components/ToggleButton/ToggleButton.tokens.tsx
|
|
@@ -14623,9 +14625,9 @@ var Container16 = import_styled_components100.default.label`
|
|
|
14623
14625
|
${focusVisible}
|
|
14624
14626
|
}
|
|
14625
14627
|
`;
|
|
14626
|
-
var ToggleButton = (0,
|
|
14628
|
+
var ToggleButton = (0, import_react121.forwardRef)(
|
|
14627
14629
|
({ id, label: label3, icon: icon11, className, htmlProps, ...rest }, ref) => {
|
|
14628
|
-
const generatedId = (0,
|
|
14630
|
+
const generatedId = (0, import_react121.useId)();
|
|
14629
14631
|
const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
|
|
14630
14632
|
return /* @__PURE__ */ (0, import_jsx_runtime274.jsxs)(Container16, { htmlFor: uniqueId, children: [
|
|
14631
14633
|
/* @__PURE__ */ (0, import_jsx_runtime274.jsx)(
|
|
@@ -14647,7 +14649,7 @@ var ToggleButton = (0, import_react120.forwardRef)(
|
|
|
14647
14649
|
ToggleButton.displayName = "ToggleButton";
|
|
14648
14650
|
|
|
14649
14651
|
// src/components/ToggleButton/ToggleButtonGroup.tsx
|
|
14650
|
-
var
|
|
14652
|
+
var import_react122 = require("react");
|
|
14651
14653
|
var import_styled_components101 = __toESM(require("styled-components"));
|
|
14652
14654
|
var import_jsx_runtime275 = require("react/jsx-runtime");
|
|
14653
14655
|
var Group2 = import_styled_components101.default.div`
|
|
@@ -14674,7 +14676,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
14674
14676
|
htmlProps,
|
|
14675
14677
|
...rest
|
|
14676
14678
|
} = props;
|
|
14677
|
-
const generatedId = (0,
|
|
14679
|
+
const generatedId = (0, import_react122.useId)();
|
|
14678
14680
|
const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
|
|
14679
14681
|
const groupProps = {
|
|
14680
14682
|
direction
|