@norges-domstoler/dds-components 0.0.0-dev-20240306143134 → 0.0.0-dev-20240307085413
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.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +681 -655
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +437 -412
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -150,6 +150,7 @@ __export(src_exports, {
|
|
|
150
150
|
Icon: () => Icon,
|
|
151
151
|
ImageIcon: () => ImageIcon,
|
|
152
152
|
InfoIcon: () => InfoIcon,
|
|
153
|
+
InlineButton: () => InlineButton,
|
|
153
154
|
InlineEditInput: () => InlineEditInput,
|
|
154
155
|
InlineEditTextArea: () => InlineEditTextArea,
|
|
155
156
|
Input: () => Input,
|
|
@@ -5973,6 +5974,7 @@ ChipGroup.displayName = "ChipGroup";
|
|
|
5973
5974
|
// src/components/date-inputs/DatePicker/Calendar/Calendar.tsx
|
|
5974
5975
|
var import_date4 = require("@internationalized/date");
|
|
5975
5976
|
var import_calendar3 = require("@react-aria/calendar");
|
|
5977
|
+
var import_i18n2 = require("@react-aria/i18n");
|
|
5976
5978
|
var import_calendar4 = require("@react-stately/calendar");
|
|
5977
5979
|
var import_react40 = require("react");
|
|
5978
5980
|
var import_styled_components36 = __toESM(require("styled-components"));
|
|
@@ -5980,6 +5982,7 @@ var import_styled_components36 = __toESM(require("styled-components"));
|
|
|
5980
5982
|
// src/components/date-inputs/DatePicker/Calendar/CalendarGrid.tsx
|
|
5981
5983
|
var import_date3 = require("@internationalized/date");
|
|
5982
5984
|
var import_calendar2 = require("@react-aria/calendar");
|
|
5985
|
+
var import_i18n = require("@react-aria/i18n");
|
|
5983
5986
|
var import_styled_components35 = __toESM(require("styled-components"));
|
|
5984
5987
|
|
|
5985
5988
|
// src/components/date-inputs/DatePicker/Calendar/Calendar.tokens.ts
|
|
@@ -6265,11 +6268,12 @@ var WeekNumber = import_styled_components35.default.td`
|
|
|
6265
6268
|
justify-content: center;
|
|
6266
6269
|
`;
|
|
6267
6270
|
function CalendarGrid({ state, ...props }) {
|
|
6271
|
+
const { locale: locale2 } = (0, import_i18n.useLocale)();
|
|
6268
6272
|
const {
|
|
6269
6273
|
gridProps: { onKeyDown, ...gridProps },
|
|
6270
6274
|
headerProps
|
|
6271
6275
|
} = (0, import_calendar2.useCalendarGrid)(props, state);
|
|
6272
|
-
const weeksInMonth = (0, import_date3.getWeeksInMonth)(state.visibleRange.start,
|
|
6276
|
+
const weeksInMonth = (0, import_date3.getWeeksInMonth)(state.visibleRange.start, locale2);
|
|
6273
6277
|
const weekDays = ["Ma", "Ti", "On", "To", "Fr", "L\xF8", "S\xF8"];
|
|
6274
6278
|
return /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)(
|
|
6275
6279
|
"table",
|
|
@@ -6334,10 +6338,11 @@ function createCalendar(identifier) {
|
|
|
6334
6338
|
}
|
|
6335
6339
|
}
|
|
6336
6340
|
function Calendar(props) {
|
|
6341
|
+
const { locale: locale2 } = (0, import_i18n2.useLocale)();
|
|
6337
6342
|
const state = (0, import_calendar4.useCalendarState)({
|
|
6338
6343
|
...props,
|
|
6339
6344
|
createCalendar,
|
|
6340
|
-
locale
|
|
6345
|
+
locale: locale2
|
|
6341
6346
|
});
|
|
6342
6347
|
const {
|
|
6343
6348
|
calendarProps,
|
|
@@ -6387,12 +6392,14 @@ Calendar.displayName = "Calendar";
|
|
|
6387
6392
|
|
|
6388
6393
|
// src/components/date-inputs/DatePicker/DatePicker.tsx
|
|
6389
6394
|
var import_datepicker4 = require("@react-aria/datepicker");
|
|
6395
|
+
var import_i18n4 = require("@react-aria/i18n");
|
|
6390
6396
|
var import_datepicker5 = require("@react-stately/datepicker");
|
|
6391
6397
|
var import_react46 = require("react");
|
|
6392
6398
|
|
|
6393
6399
|
// src/components/date-inputs/DatePicker/DateField/DateField.tsx
|
|
6394
6400
|
var import_date5 = require("@internationalized/date");
|
|
6395
6401
|
var import_datepicker2 = require("@react-aria/datepicker");
|
|
6402
|
+
var import_i18n3 = require("@react-aria/i18n");
|
|
6396
6403
|
var import_datepicker3 = require("@react-stately/datepicker");
|
|
6397
6404
|
var import_react44 = require("react");
|
|
6398
6405
|
|
|
@@ -6741,9 +6748,10 @@ function _DateField({
|
|
|
6741
6748
|
groupProps,
|
|
6742
6749
|
...props
|
|
6743
6750
|
}, forwardedRef) {
|
|
6751
|
+
const { locale: locale2 } = (0, import_i18n3.useLocale)();
|
|
6744
6752
|
const state = (0, import_datepicker3.useDateFieldState)({
|
|
6745
6753
|
...props,
|
|
6746
|
-
locale,
|
|
6754
|
+
locale: locale2,
|
|
6747
6755
|
createCalendar: import_date5.createCalendar
|
|
6748
6756
|
});
|
|
6749
6757
|
const ref = (0, import_react44.useRef)(null);
|
|
@@ -6824,7 +6832,7 @@ function _DatePicker({ errorMessage, componentSize, tip, style, width, ...props
|
|
|
6824
6832
|
state,
|
|
6825
6833
|
ref
|
|
6826
6834
|
);
|
|
6827
|
-
return /* @__PURE__ */ (0, import_jsx_runtime200.jsxs)(CalendarPopover, { isOpen: state.isOpen, onClose: state.close, children: [
|
|
6835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(import_i18n4.I18nProvider, { locale, children: /* @__PURE__ */ (0, import_jsx_runtime200.jsxs)(CalendarPopover, { isOpen: state.isOpen, onClose: state.close, children: [
|
|
6828
6836
|
/* @__PURE__ */ (0, import_jsx_runtime200.jsx)(CalendarPopoverAnchor, { children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
6829
6837
|
DateField,
|
|
6830
6838
|
{
|
|
@@ -6842,7 +6850,7 @@ function _DatePicker({ errorMessage, componentSize, tip, style, width, ...props
|
|
|
6842
6850
|
}
|
|
6843
6851
|
) }),
|
|
6844
6852
|
/* @__PURE__ */ (0, import_jsx_runtime200.jsx)(CalendarPopoverContent, { children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(Calendar, { ...calendarProps }) })
|
|
6845
|
-
] });
|
|
6853
|
+
] }) });
|
|
6846
6854
|
}
|
|
6847
6855
|
var DatePicker = (0, import_react46.forwardRef)(_DatePicker);
|
|
6848
6856
|
DatePicker.displayName = "DatePicker";
|
|
@@ -9011,12 +9019,29 @@ var GridChild = (props) => {
|
|
|
9011
9019
|
};
|
|
9012
9020
|
GridChild.displayName = "GridChild";
|
|
9013
9021
|
|
|
9022
|
+
// src/components/InlineButton/InlineButton.tsx
|
|
9023
|
+
var import_react65 = require("react");
|
|
9024
|
+
var import_styled_components60 = __toESM(require("styled-components"));
|
|
9025
|
+
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
9026
|
+
var StyledInlineButton = import_styled_components60.default.button`
|
|
9027
|
+
${normalizeButton}
|
|
9028
|
+
${removeButtonStyling}
|
|
9029
|
+
display: inline;
|
|
9030
|
+
${getAnchorStyling()}
|
|
9031
|
+
`;
|
|
9032
|
+
var InlineButton = (0, import_react65.forwardRef)(
|
|
9033
|
+
(props, ref) => {
|
|
9034
|
+
const { children, ...rest } = props;
|
|
9035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)(StyledInlineButton, { ref, ...rest, children });
|
|
9036
|
+
}
|
|
9037
|
+
);
|
|
9038
|
+
|
|
9014
9039
|
// src/components/InlineEdit/InlineEditTextArea.tsx
|
|
9015
|
-
var
|
|
9040
|
+
var import_react68 = require("react");
|
|
9016
9041
|
|
|
9017
9042
|
// src/components/InlineEdit/InlineEdit.tsx
|
|
9018
|
-
var
|
|
9019
|
-
var
|
|
9043
|
+
var import_react66 = require("react");
|
|
9044
|
+
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
9020
9045
|
var InlineEdit = (props) => {
|
|
9021
9046
|
const {
|
|
9022
9047
|
emptiable,
|
|
@@ -9028,8 +9053,8 @@ var InlineEdit = (props) => {
|
|
|
9028
9053
|
inputRef,
|
|
9029
9054
|
children
|
|
9030
9055
|
} = props;
|
|
9031
|
-
const [editingValue, setEditingValue] = (0,
|
|
9032
|
-
const [isEditing, setIsEditing] = (0,
|
|
9056
|
+
const [editingValue, setEditingValue] = (0, import_react66.useState)(value != null ? value : "");
|
|
9057
|
+
const [isEditing, setIsEditing] = (0, import_react66.useState)(false);
|
|
9033
9058
|
const onChangeHandler = (e) => {
|
|
9034
9059
|
setEditingValue(e.target.value);
|
|
9035
9060
|
onChange && onChange();
|
|
@@ -9056,8 +9081,8 @@ var InlineEdit = (props) => {
|
|
|
9056
9081
|
useOnKeyDown(["Enter"], () => onExitHandler());
|
|
9057
9082
|
useOnKeyDown(["Escape"], () => onExitHandler());
|
|
9058
9083
|
useOnClickOutside(inputRef.current, () => onExitHandler());
|
|
9059
|
-
const inputChild =
|
|
9060
|
-
(0,
|
|
9084
|
+
const inputChild = import_react66.Children.only(
|
|
9085
|
+
(0, import_react66.isValidElement)(children) && (0, import_react66.cloneElement)(children, {
|
|
9061
9086
|
onChange: onChangeHandler,
|
|
9062
9087
|
onBlur: onBlurHandler,
|
|
9063
9088
|
onFocus: onFocusHandler,
|
|
@@ -9066,15 +9091,15 @@ var InlineEdit = (props) => {
|
|
|
9066
9091
|
emptiable
|
|
9067
9092
|
})
|
|
9068
9093
|
);
|
|
9069
|
-
return /* @__PURE__ */ (0,
|
|
9094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_jsx_runtime224.Fragment, { children: inputChild });
|
|
9070
9095
|
};
|
|
9071
9096
|
InlineEdit.displayName = "InlineEdit";
|
|
9072
9097
|
|
|
9073
9098
|
// src/components/InlineEdit/InlineTextArea.tsx
|
|
9074
|
-
var
|
|
9099
|
+
var import_react67 = require("react");
|
|
9075
9100
|
|
|
9076
9101
|
// src/components/InlineEdit/InlineEdit.styles.tsx
|
|
9077
|
-
var
|
|
9102
|
+
var import_styled_components61 = __toESM(require("styled-components"));
|
|
9078
9103
|
|
|
9079
9104
|
// src/components/InlineEdit/InlineEdit.tokens.ts
|
|
9080
9105
|
var import_dds_design_tokens42 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -9105,14 +9130,14 @@ var inlineEditTokens = {
|
|
|
9105
9130
|
// src/components/InlineEdit/InlineEdit.styles.tsx
|
|
9106
9131
|
var { inlineEdit: inlineEdit2, iconWrapper: iconWrapper2 } = inlineEditTokens;
|
|
9107
9132
|
var defaultWidth3 = "140px";
|
|
9108
|
-
var StyledInlineInput = (0,
|
|
9133
|
+
var StyledInlineInput = (0, import_styled_components61.default)(StatefulInput).withConfig({
|
|
9109
9134
|
shouldForwardProp: (prop) => prop !== "isEditing" && prop !== "hideIcon"
|
|
9110
9135
|
})`
|
|
9111
9136
|
border-color: transparent;
|
|
9112
9137
|
background-color: ${inlineEdit2.backgroundColor};
|
|
9113
9138
|
padding: ${inlineEdit2.padding};
|
|
9114
9139
|
${inlineEdit2.font};
|
|
9115
|
-
${({ isEditing, hideIcon }) => !isEditing && !hideIcon &&
|
|
9140
|
+
${({ isEditing, hideIcon }) => !isEditing && !hideIcon && import_styled_components61.css`
|
|
9116
9141
|
padding-left: ${inlineEdit2.withIcon.paddingLeft};
|
|
9117
9142
|
`}
|
|
9118
9143
|
|
|
@@ -9125,14 +9150,14 @@ var StyledInlineInput = (0, import_styled_components60.default)(StatefulInput).w
|
|
|
9125
9150
|
background-color: ${inlineEdit2.focus.backgroundColor};
|
|
9126
9151
|
}
|
|
9127
9152
|
`;
|
|
9128
|
-
var StyledInlineTextArea = (0,
|
|
9153
|
+
var StyledInlineTextArea = (0, import_styled_components61.default)(StyledInlineInput).attrs({
|
|
9129
9154
|
as: "textarea"
|
|
9130
9155
|
})`
|
|
9131
9156
|
resize: vertical;
|
|
9132
9157
|
${scrollbarStyling.webkit}
|
|
9133
9158
|
${scrollbarStyling.firefox}
|
|
9134
9159
|
`;
|
|
9135
|
-
var IconWrapper2 =
|
|
9160
|
+
var IconWrapper2 = import_styled_components61.default.span`
|
|
9136
9161
|
position: absolute;
|
|
9137
9162
|
left: ${iconWrapper2.left};
|
|
9138
9163
|
top: ${iconWrapper2.top};
|
|
@@ -9143,16 +9168,16 @@ var IconWrapper2 = import_styled_components60.default.span`
|
|
|
9143
9168
|
`;
|
|
9144
9169
|
|
|
9145
9170
|
// src/components/InlineEdit/InlineEdit.utils.tsx
|
|
9146
|
-
var
|
|
9147
|
-
var inlineEditVisuallyHidden = (id, emptiable) => /* @__PURE__ */ (0,
|
|
9171
|
+
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
9172
|
+
var inlineEditVisuallyHidden = (id, emptiable) => /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(VisuallyHidden, { id, as: "span", children: [
|
|
9148
9173
|
"Escape, Enter eller Tab for \xE5 lagre.",
|
|
9149
9174
|
" ",
|
|
9150
9175
|
!emptiable && "Inputfeltet er ikke t\xF8mmbar."
|
|
9151
9176
|
] });
|
|
9152
9177
|
|
|
9153
9178
|
// src/components/InlineEdit/InlineTextArea.tsx
|
|
9154
|
-
var
|
|
9155
|
-
var InlineTextArea = (0,
|
|
9179
|
+
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
9180
|
+
var InlineTextArea = (0, import_react67.forwardRef)((props, ref) => {
|
|
9156
9181
|
const {
|
|
9157
9182
|
id,
|
|
9158
9183
|
error,
|
|
@@ -9164,26 +9189,26 @@ var InlineTextArea = (0, import_react66.forwardRef)((props, ref) => {
|
|
|
9164
9189
|
hideIcon,
|
|
9165
9190
|
...rest
|
|
9166
9191
|
} = props;
|
|
9167
|
-
const genereatedId = (0,
|
|
9192
|
+
const genereatedId = (0, import_react67.useId)();
|
|
9168
9193
|
const uniqueId = id != null ? id : `${genereatedId}-InlineTextArea`;
|
|
9169
9194
|
const hasErrorMessage = !!errorMessage;
|
|
9170
9195
|
const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
|
|
9171
9196
|
const descId = derivativeIdGenerator(uniqueId, "desc");
|
|
9172
|
-
const inputRef = (0,
|
|
9197
|
+
const inputRef = (0, import_react67.useRef)(null);
|
|
9173
9198
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
9174
|
-
return /* @__PURE__ */ (0,
|
|
9175
|
-
/* @__PURE__ */ (0,
|
|
9176
|
-
!isEditing && !hideIcon && /* @__PURE__ */ (0,
|
|
9199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(OuterInputContainer, { $width: width, children: [
|
|
9200
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsxs)(InputContainer, { children: [
|
|
9201
|
+
!isEditing && !hideIcon && /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
9177
9202
|
IconWrapper2,
|
|
9178
9203
|
{
|
|
9179
9204
|
onClick: () => {
|
|
9180
9205
|
var _a;
|
|
9181
9206
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
9182
9207
|
},
|
|
9183
|
-
children: /* @__PURE__ */ (0,
|
|
9208
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Icon, { icon: EditIcon, iconSize: "small" })
|
|
9184
9209
|
}
|
|
9185
9210
|
),
|
|
9186
|
-
/* @__PURE__ */ (0,
|
|
9211
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
9187
9212
|
StyledInlineTextArea,
|
|
9188
9213
|
{
|
|
9189
9214
|
...rest,
|
|
@@ -9207,12 +9232,12 @@ var InlineTextArea = (0, import_react66.forwardRef)((props, ref) => {
|
|
|
9207
9232
|
InlineTextArea.displayName = "InlineTextArea";
|
|
9208
9233
|
|
|
9209
9234
|
// src/components/InlineEdit/InlineEditTextArea.tsx
|
|
9210
|
-
var
|
|
9211
|
-
var InlineEditTextArea = (0,
|
|
9235
|
+
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
9236
|
+
var InlineEditTextArea = (0, import_react68.forwardRef)((props, ref) => {
|
|
9212
9237
|
const { onSetValue, emptiable, value, onFocus, onChange, onBlur, ...rest } = props;
|
|
9213
|
-
const textareaRef = (0,
|
|
9238
|
+
const textareaRef = (0, import_react68.useRef)(null);
|
|
9214
9239
|
const combinedRef = useCombinedRef(ref, textareaRef);
|
|
9215
|
-
return /* @__PURE__ */ (0,
|
|
9240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
9216
9241
|
InlineEdit,
|
|
9217
9242
|
{
|
|
9218
9243
|
onSetValue,
|
|
@@ -9222,18 +9247,18 @@ var InlineEditTextArea = (0, import_react67.forwardRef)((props, ref) => {
|
|
|
9222
9247
|
onFocus,
|
|
9223
9248
|
onChange,
|
|
9224
9249
|
onBlur,
|
|
9225
|
-
children: /* @__PURE__ */ (0,
|
|
9250
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(InlineTextArea, { ref: combinedRef, ...rest })
|
|
9226
9251
|
}
|
|
9227
9252
|
);
|
|
9228
9253
|
});
|
|
9229
9254
|
|
|
9230
9255
|
// src/components/InlineEdit/InlineEditInput.tsx
|
|
9231
|
-
var
|
|
9256
|
+
var import_react70 = require("react");
|
|
9232
9257
|
|
|
9233
9258
|
// src/components/InlineEdit/InlineInput.tsx
|
|
9234
|
-
var
|
|
9235
|
-
var
|
|
9236
|
-
var InlineInput = (0,
|
|
9259
|
+
var import_react69 = require("react");
|
|
9260
|
+
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
9261
|
+
var InlineInput = (0, import_react69.forwardRef)(
|
|
9237
9262
|
(props, ref) => {
|
|
9238
9263
|
const {
|
|
9239
9264
|
id,
|
|
@@ -9246,28 +9271,28 @@ var InlineInput = (0, import_react68.forwardRef)(
|
|
|
9246
9271
|
hideIcon,
|
|
9247
9272
|
...rest
|
|
9248
9273
|
} = props;
|
|
9249
|
-
const genereatedId = (0,
|
|
9274
|
+
const genereatedId = (0, import_react69.useId)();
|
|
9250
9275
|
const uniqueId = id != null ? id : `${genereatedId}-InlineInput`;
|
|
9251
9276
|
const hasErrorMessage = !!errorMessage;
|
|
9252
9277
|
const hasError = !!error;
|
|
9253
9278
|
const hasErrorState = hasError || hasErrorMessage;
|
|
9254
9279
|
const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
|
|
9255
9280
|
const descId = derivativeIdGenerator(uniqueId, "desc");
|
|
9256
|
-
const inputRef = (0,
|
|
9281
|
+
const inputRef = (0, import_react69.useRef)(null);
|
|
9257
9282
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
9258
|
-
return /* @__PURE__ */ (0,
|
|
9259
|
-
/* @__PURE__ */ (0,
|
|
9260
|
-
!isEditing && !hideIcon && /* @__PURE__ */ (0,
|
|
9283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime228.jsxs)(OuterInputContainer, { $width: width, children: [
|
|
9284
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsxs)(InputContainer, { children: [
|
|
9285
|
+
!isEditing && !hideIcon && /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
9261
9286
|
IconWrapper2,
|
|
9262
9287
|
{
|
|
9263
9288
|
onClick: () => {
|
|
9264
9289
|
var _a;
|
|
9265
9290
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
9266
9291
|
},
|
|
9267
|
-
children: /* @__PURE__ */ (0,
|
|
9292
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(Icon, { icon: EditIcon, iconSize: "small" })
|
|
9268
9293
|
}
|
|
9269
9294
|
),
|
|
9270
|
-
/* @__PURE__ */ (0,
|
|
9295
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
9271
9296
|
StyledInlineInput,
|
|
9272
9297
|
{
|
|
9273
9298
|
...rest,
|
|
@@ -9293,12 +9318,12 @@ var InlineInput = (0, import_react68.forwardRef)(
|
|
|
9293
9318
|
InlineInput.displayName = "InlineInput";
|
|
9294
9319
|
|
|
9295
9320
|
// src/components/InlineEdit/InlineEditInput.tsx
|
|
9296
|
-
var
|
|
9297
|
-
var InlineEditInput = (0,
|
|
9321
|
+
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
9322
|
+
var InlineEditInput = (0, import_react70.forwardRef)((props, ref) => {
|
|
9298
9323
|
const { onSetValue, emptiable, value, onFocus, onChange, onBlur, ...rest } = props;
|
|
9299
|
-
const inputRef = (0,
|
|
9324
|
+
const inputRef = (0, import_react70.useRef)(null);
|
|
9300
9325
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
9301
|
-
return /* @__PURE__ */ (0,
|
|
9326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
9302
9327
|
InlineEdit,
|
|
9303
9328
|
{
|
|
9304
9329
|
onSetValue,
|
|
@@ -9308,16 +9333,16 @@ var InlineEditInput = (0, import_react69.forwardRef)((props, ref) => {
|
|
|
9308
9333
|
onFocus,
|
|
9309
9334
|
onChange,
|
|
9310
9335
|
onBlur,
|
|
9311
|
-
children: /* @__PURE__ */ (0,
|
|
9336
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(InlineInput, { ...rest, ref: combinedRef })
|
|
9312
9337
|
}
|
|
9313
9338
|
);
|
|
9314
9339
|
});
|
|
9315
9340
|
|
|
9316
9341
|
// src/components/InternalHeader/InternalHeader.tsx
|
|
9317
|
-
var
|
|
9342
|
+
var import_react72 = require("react");
|
|
9318
9343
|
|
|
9319
9344
|
// src/components/InternalHeader/InternalHeader.styles.tsx
|
|
9320
|
-
var
|
|
9345
|
+
var import_styled_components62 = __toESM(require("styled-components"));
|
|
9321
9346
|
|
|
9322
9347
|
// src/components/InternalHeader/InternalHeader.tokens.tsx
|
|
9323
9348
|
var import_dds_design_tokens43 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -9341,7 +9366,7 @@ var internalHeaderTokens = {
|
|
|
9341
9366
|
|
|
9342
9367
|
// src/components/InternalHeader/InternalHeader.styles.tsx
|
|
9343
9368
|
var { bar: bar2, separator: separator2 } = internalHeaderTokens;
|
|
9344
|
-
var Bar2 =
|
|
9369
|
+
var Bar2 = import_styled_components62.default.div`
|
|
9345
9370
|
*::selection {
|
|
9346
9371
|
${selection}
|
|
9347
9372
|
}
|
|
@@ -9354,21 +9379,21 @@ var Bar2 = import_styled_components61.default.div`
|
|
|
9354
9379
|
padding-left: ${bar2.paddingLeft};
|
|
9355
9380
|
padding-right: ${bar2.paddingRight};
|
|
9356
9381
|
|
|
9357
|
-
${({ $hasNavigation }) => $hasNavigation ?
|
|
9382
|
+
${({ $hasNavigation }) => $hasNavigation ? import_styled_components62.css`
|
|
9358
9383
|
${ContextMenuGroup} {
|
|
9359
9384
|
margin-left: auto;
|
|
9360
9385
|
}
|
|
9361
|
-
` :
|
|
9386
|
+
` : import_styled_components62.css`
|
|
9362
9387
|
${BarSeparator} {
|
|
9363
9388
|
margin-left: auto;
|
|
9364
9389
|
}
|
|
9365
9390
|
`}
|
|
9366
9391
|
`;
|
|
9367
|
-
var BarSeparator =
|
|
9392
|
+
var BarSeparator = import_styled_components62.default.div`
|
|
9368
9393
|
border-left: ${separator2.width} solid ${separator2.color};
|
|
9369
9394
|
align-self: stretch;
|
|
9370
9395
|
`;
|
|
9371
|
-
var AppNameLink =
|
|
9396
|
+
var AppNameLink = import_styled_components62.default.a`
|
|
9372
9397
|
${inheritLinkStyling}
|
|
9373
9398
|
transition: ${focusVisibleTransitionValue};
|
|
9374
9399
|
&:focus-visible,
|
|
@@ -9376,13 +9401,13 @@ var AppNameLink = import_styled_components61.default.a`
|
|
|
9376
9401
|
${focusVisible}
|
|
9377
9402
|
}
|
|
9378
9403
|
`;
|
|
9379
|
-
var NavigationList =
|
|
9404
|
+
var NavigationList = import_styled_components62.default.ul`
|
|
9380
9405
|
box-sizing: border-box;
|
|
9381
9406
|
display: flex;
|
|
9382
9407
|
gap: ${bar2.itemGap};
|
|
9383
9408
|
align-items: center;
|
|
9384
9409
|
width: 100%;
|
|
9385
|
-
${({ smallScreen }) => smallScreen &&
|
|
9410
|
+
${({ smallScreen }) => smallScreen && import_styled_components62.css`
|
|
9386
9411
|
align-items: initial;
|
|
9387
9412
|
flex-direction: column;
|
|
9388
9413
|
`}
|
|
@@ -9390,17 +9415,17 @@ var NavigationList = import_styled_components61.default.ul`
|
|
|
9390
9415
|
padding: 0;
|
|
9391
9416
|
margin: 0;
|
|
9392
9417
|
`;
|
|
9393
|
-
var ContextMenuGroup =
|
|
9394
|
-
var StyledOverflowMenu = (0,
|
|
9418
|
+
var ContextMenuGroup = import_styled_components62.default.div``;
|
|
9419
|
+
var StyledOverflowMenu = (0, import_styled_components62.default)(OverflowMenu)`
|
|
9395
9420
|
max-height: calc(100vh - 110px);
|
|
9396
9421
|
`;
|
|
9397
|
-
var NavLi =
|
|
9422
|
+
var NavLi = import_styled_components62.default.li`
|
|
9398
9423
|
display: flex;
|
|
9399
9424
|
`;
|
|
9400
9425
|
|
|
9401
9426
|
// src/components/InternalHeader/NavigationItem.tsx
|
|
9402
|
-
var
|
|
9403
|
-
var
|
|
9427
|
+
var import_react71 = require("react");
|
|
9428
|
+
var import_styled_components63 = __toESM(require("styled-components"));
|
|
9404
9429
|
|
|
9405
9430
|
// src/components/InternalHeader/NavigationItem.tokens.ts
|
|
9406
9431
|
var import_dds_design_tokens44 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -9441,8 +9466,8 @@ function getNavTokens({ active }) {
|
|
|
9441
9466
|
}
|
|
9442
9467
|
|
|
9443
9468
|
// src/components/InternalHeader/NavigationItem.tsx
|
|
9444
|
-
var
|
|
9445
|
-
var Link3 =
|
|
9469
|
+
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
9470
|
+
var Link3 = import_styled_components63.default.a`
|
|
9446
9471
|
${getFontStyling("bodySans02")}
|
|
9447
9472
|
text-decoration: none;
|
|
9448
9473
|
|
|
@@ -9469,8 +9494,8 @@ var Link3 = import_styled_components62.default.a`
|
|
|
9469
9494
|
transition: background-color 0.2s;
|
|
9470
9495
|
}
|
|
9471
9496
|
`;
|
|
9472
|
-
var NavigationItem2 = (0,
|
|
9473
|
-
return /* @__PURE__ */ (0,
|
|
9497
|
+
var NavigationItem2 = (0, import_react71.forwardRef)(({ title: title3, isCurrent, ...rest }, ref) => {
|
|
9498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
9474
9499
|
Link3,
|
|
9475
9500
|
{
|
|
9476
9501
|
...rest,
|
|
@@ -9483,7 +9508,7 @@ var NavigationItem2 = (0, import_react70.forwardRef)(({ title: title3, isCurrent
|
|
|
9483
9508
|
});
|
|
9484
9509
|
|
|
9485
9510
|
// src/components/InternalHeader/InternalHeader.tsx
|
|
9486
|
-
var
|
|
9511
|
+
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
9487
9512
|
var InternalHeader = (props) => {
|
|
9488
9513
|
const {
|
|
9489
9514
|
applicationDesc,
|
|
@@ -9500,11 +9525,11 @@ var InternalHeader = (props) => {
|
|
|
9500
9525
|
htmlProps,
|
|
9501
9526
|
...rest
|
|
9502
9527
|
} = props;
|
|
9503
|
-
const [contextMenuIsClosed, setContextMenuIsClosed] = (0,
|
|
9504
|
-
const [currentPage, setCurrentPage] = (0,
|
|
9528
|
+
const [contextMenuIsClosed, setContextMenuIsClosed] = (0, import_react72.useState)(true);
|
|
9529
|
+
const [currentPage, setCurrentPage] = (0, import_react72.useState)(
|
|
9505
9530
|
currentPageHref
|
|
9506
9531
|
);
|
|
9507
|
-
const buttonRef = (0,
|
|
9532
|
+
const buttonRef = (0, import_react72.useRef)(null);
|
|
9508
9533
|
const handleCurrentPageChange = (href) => {
|
|
9509
9534
|
setCurrentPage(href);
|
|
9510
9535
|
onCurrentPageChange && onCurrentPageChange();
|
|
@@ -9516,10 +9541,10 @@ var InternalHeader = (props) => {
|
|
|
9516
9541
|
const hasNavigationElements = !!navigationElements && navigationElements.length > 0;
|
|
9517
9542
|
const hasContextMenuElements = !!contextMenuElements && contextMenuElements.length > 0;
|
|
9518
9543
|
const hasNavInContextMenu = smallScreen && hasNavigationElements;
|
|
9519
|
-
const navigation2 = hasNavigationElements && !smallScreen ? /* @__PURE__ */ (0,
|
|
9544
|
+
const navigation2 = hasNavigationElements && !smallScreen ? /* @__PURE__ */ (0, import_jsx_runtime231.jsx)("nav", { "aria-label": "sidenavigasjon", children: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(NavigationList, { children: navigationElements.map((item, index) => {
|
|
9520
9545
|
const { href, ...rest2 } = item;
|
|
9521
9546
|
const isCurrent = href === currentPage;
|
|
9522
|
-
return /* @__PURE__ */ (0,
|
|
9547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(NavLi, { children: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
|
|
9523
9548
|
NavigationItem2,
|
|
9524
9549
|
{
|
|
9525
9550
|
href,
|
|
@@ -9530,18 +9555,18 @@ var InternalHeader = (props) => {
|
|
|
9530
9555
|
) }, index);
|
|
9531
9556
|
}) }) }) : null;
|
|
9532
9557
|
const hasContextMenu = hasContextMenuElements || !!userProps || hasNavInContextMenu;
|
|
9533
|
-
return /* @__PURE__ */ (0,
|
|
9558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(
|
|
9534
9559
|
Bar2,
|
|
9535
9560
|
{
|
|
9536
9561
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
9537
9562
|
$hasNavigation: !!navigation2,
|
|
9538
9563
|
children: [
|
|
9539
|
-
/* @__PURE__ */ (0,
|
|
9540
|
-
/* @__PURE__ */ (0,
|
|
9541
|
-
(hasContextMenu || navigation2 !== null) && /* @__PURE__ */ (0,
|
|
9564
|
+
/* @__PURE__ */ (0, import_jsx_runtime231.jsx)(Typography, { typographyType: "bodySans02", bold: true, as: "span", children: applicationHref ? /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(AppNameLink, { href: applicationHref, rel: "noopener noreferrer", children: applicationName }) : applicationName }),
|
|
9565
|
+
/* @__PURE__ */ (0, import_jsx_runtime231.jsx)(Typography, { typographyType: "bodySans02", as: "span", children: applicationDesc }),
|
|
9566
|
+
(hasContextMenu || navigation2 !== null) && /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(BarSeparator, {}),
|
|
9542
9567
|
navigation2,
|
|
9543
|
-
hasContextMenu && /* @__PURE__ */ (0,
|
|
9544
|
-
/* @__PURE__ */ (0,
|
|
9568
|
+
hasContextMenu && /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(ContextMenuGroup, { children: [
|
|
9569
|
+
/* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
|
|
9545
9570
|
Button,
|
|
9546
9571
|
{
|
|
9547
9572
|
ref: buttonRef,
|
|
@@ -9554,7 +9579,7 @@ var InternalHeader = (props) => {
|
|
|
9554
9579
|
"aria-label": "\xE5pne meny"
|
|
9555
9580
|
}
|
|
9556
9581
|
),
|
|
9557
|
-
/* @__PURE__ */ (0,
|
|
9582
|
+
/* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
|
|
9558
9583
|
StyledOverflowMenu,
|
|
9559
9584
|
{
|
|
9560
9585
|
isOpen: !contextMenuIsClosed,
|
|
@@ -9573,8 +9598,8 @@ var InternalHeader = (props) => {
|
|
|
9573
9598
|
InternalHeader.displayName = "InternalHeader";
|
|
9574
9599
|
|
|
9575
9600
|
// src/components/List/List.tsx
|
|
9576
|
-
var
|
|
9577
|
-
var
|
|
9601
|
+
var import_react73 = require("react");
|
|
9602
|
+
var import_styled_components64 = __toESM(require("styled-components"));
|
|
9578
9603
|
|
|
9579
9604
|
// src/components/List/bullets/jordskifterett_bullet1.svg
|
|
9580
9605
|
var jordskifterett_bullet1_default = 'data:image/svg+xml,<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<circle cx="6.7085" cy="6.7085" r="2.625" fill="%230B0D0E"/>%0A</svg>%0A';
|
|
@@ -9620,9 +9645,9 @@ var listTokens = {
|
|
|
9620
9645
|
};
|
|
9621
9646
|
|
|
9622
9647
|
// src/components/List/List.tsx
|
|
9623
|
-
var
|
|
9648
|
+
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
9624
9649
|
var { list: list6, listItem: listItem4, bullet: bullet2 } = listTokens;
|
|
9625
|
-
var StyledList =
|
|
9650
|
+
var StyledList = import_styled_components64.default.ul`
|
|
9626
9651
|
margin: ${list6.base.margin};
|
|
9627
9652
|
color: ${list6.base.color};
|
|
9628
9653
|
ul,
|
|
@@ -9633,13 +9658,13 @@ var StyledList = import_styled_components63.default.ul`
|
|
|
9633
9658
|
${selection}
|
|
9634
9659
|
}
|
|
9635
9660
|
|
|
9636
|
-
${({ $typographyType }) => $typographyType === "inherit" ?
|
|
9661
|
+
${({ $typographyType }) => $typographyType === "inherit" ? import_styled_components64.css`
|
|
9637
9662
|
font: inherit;
|
|
9638
|
-
` :
|
|
9663
|
+
` : import_styled_components64.css`
|
|
9639
9664
|
${getFontStyling($typographyType)}
|
|
9640
9665
|
`}
|
|
9641
9666
|
|
|
9642
|
-
${({ $listType }) => $listType === "unordered" ?
|
|
9667
|
+
${({ $listType }) => $listType === "unordered" ? import_styled_components64.css`
|
|
9643
9668
|
padding-left: ${list6.ul.paddingLeft};
|
|
9644
9669
|
list-style: none;
|
|
9645
9670
|
li {
|
|
@@ -9664,7 +9689,7 @@ var StyledList = import_styled_components63.default.ul`
|
|
|
9664
9689
|
background-image: ${`url('${tingrett_bullet3_default}')`};
|
|
9665
9690
|
}
|
|
9666
9691
|
}
|
|
9667
|
-
` :
|
|
9692
|
+
` : import_styled_components64.css`
|
|
9668
9693
|
padding-left: ${list6.ol.paddingLeft};
|
|
9669
9694
|
& > li > ol {
|
|
9670
9695
|
list-style-type: lower-alpha;
|
|
@@ -9674,7 +9699,7 @@ var StyledList = import_styled_components63.default.ul`
|
|
|
9674
9699
|
}
|
|
9675
9700
|
`}
|
|
9676
9701
|
`;
|
|
9677
|
-
var List2 = (0,
|
|
9702
|
+
var List2 = (0, import_react73.forwardRef)(
|
|
9678
9703
|
(props, ref) => {
|
|
9679
9704
|
const {
|
|
9680
9705
|
listType = "unordered",
|
|
@@ -9686,7 +9711,7 @@ var List2 = (0, import_react72.forwardRef)(
|
|
|
9686
9711
|
...rest
|
|
9687
9712
|
} = props;
|
|
9688
9713
|
const as = listType === "ordered" ? "ol" : "ul";
|
|
9689
|
-
return /* @__PURE__ */ (0,
|
|
9714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
9690
9715
|
StyledList,
|
|
9691
9716
|
{
|
|
9692
9717
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -9702,22 +9727,22 @@ var List2 = (0, import_react72.forwardRef)(
|
|
|
9702
9727
|
List2.displayName = "List";
|
|
9703
9728
|
|
|
9704
9729
|
// src/components/List/ListItem.tsx
|
|
9705
|
-
var
|
|
9706
|
-
var
|
|
9707
|
-
var
|
|
9708
|
-
var StyledListItem =
|
|
9730
|
+
var import_react74 = require("react");
|
|
9731
|
+
var import_styled_components65 = __toESM(require("styled-components"));
|
|
9732
|
+
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
9733
|
+
var StyledListItem = import_styled_components65.default.li`
|
|
9709
9734
|
line-height: ${listTokens.listItem.lineHeight};
|
|
9710
9735
|
`;
|
|
9711
|
-
var ListItem2 = (0,
|
|
9736
|
+
var ListItem2 = (0, import_react74.forwardRef)(
|
|
9712
9737
|
({ children, ...rest }, ref) => {
|
|
9713
|
-
return /* @__PURE__ */ (0,
|
|
9738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(StyledListItem, { ref, ...rest, children });
|
|
9714
9739
|
}
|
|
9715
9740
|
);
|
|
9716
9741
|
ListItem2.displayName = "ListItem";
|
|
9717
9742
|
|
|
9718
9743
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
9719
|
-
var
|
|
9720
|
-
var
|
|
9744
|
+
var import_react75 = require("react");
|
|
9745
|
+
var import_styled_components66 = __toESM(require("styled-components"));
|
|
9721
9746
|
|
|
9722
9747
|
// src/components/LocalMessage/LocalMessage.tokens.tsx
|
|
9723
9748
|
var import_dds_design_tokens46 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -9817,9 +9842,9 @@ var localMessageTokens = {
|
|
|
9817
9842
|
};
|
|
9818
9843
|
|
|
9819
9844
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
9820
|
-
var
|
|
9845
|
+
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
9821
9846
|
var { container: container10, content: content4, icon: icon6, purposeVariants: purposeVariants3 } = localMessageTokens;
|
|
9822
|
-
var Container8 =
|
|
9847
|
+
var Container8 = import_styled_components66.default.div.withConfig({
|
|
9823
9848
|
shouldForwardProp: (prop) => {
|
|
9824
9849
|
const styleOnlyProps = [
|
|
9825
9850
|
"layout",
|
|
@@ -9845,7 +9870,7 @@ var Container8 = import_styled_components65.default.div.withConfig({
|
|
|
9845
9870
|
*::selection {
|
|
9846
9871
|
${selection}
|
|
9847
9872
|
}
|
|
9848
|
-
${({ purpose }) => purpose &&
|
|
9873
|
+
${({ purpose }) => purpose && import_styled_components66.css`
|
|
9849
9874
|
border-color: ${container10.purpose[purpose].borderColor};
|
|
9850
9875
|
background-color: ${container10.purpose[purpose].backgroundColor};
|
|
9851
9876
|
`}
|
|
@@ -9870,18 +9895,18 @@ function getGridTemplateColumns(layout, closable) {
|
|
|
9870
9895
|
}
|
|
9871
9896
|
return layout === "horisontal" ? "min-content 1fr" : "1fr";
|
|
9872
9897
|
}
|
|
9873
|
-
var MessageIconWrapper2 = (0,
|
|
9898
|
+
var MessageIconWrapper2 = (0, import_styled_components66.default)(Icon)`
|
|
9874
9899
|
grid-area: icon;
|
|
9875
9900
|
`;
|
|
9876
|
-
var TextContainer2 =
|
|
9901
|
+
var TextContainer2 = import_styled_components66.default.div`
|
|
9877
9902
|
grid-area: text;
|
|
9878
9903
|
padding-right: ${content4.base.paddingRight};
|
|
9879
9904
|
`;
|
|
9880
|
-
var CloseButton = (0,
|
|
9905
|
+
var CloseButton = (0, import_styled_components66.default)(Button)`
|
|
9881
9906
|
grid-area: closeButton;
|
|
9882
9907
|
margin: -${container10.base.padding} 0;
|
|
9883
9908
|
`;
|
|
9884
|
-
var LocalMessage = (0,
|
|
9909
|
+
var LocalMessage = (0, import_react75.forwardRef)(
|
|
9885
9910
|
(props, ref) => {
|
|
9886
9911
|
const {
|
|
9887
9912
|
message: message2,
|
|
@@ -9896,7 +9921,7 @@ var LocalMessage = (0, import_react74.forwardRef)(
|
|
|
9896
9921
|
htmlProps,
|
|
9897
9922
|
...rest
|
|
9898
9923
|
} = props;
|
|
9899
|
-
const [isClosed, setClosed] = (0,
|
|
9924
|
+
const [isClosed, setClosed] = (0, import_react75.useState)(false);
|
|
9900
9925
|
const containerProps = {
|
|
9901
9926
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
9902
9927
|
purpose,
|
|
@@ -9906,18 +9931,18 @@ var LocalMessage = (0, import_react74.forwardRef)(
|
|
|
9906
9931
|
ref
|
|
9907
9932
|
};
|
|
9908
9933
|
if (isClosed) {
|
|
9909
|
-
return /* @__PURE__ */ (0,
|
|
9934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(import_jsx_runtime234.Fragment, {});
|
|
9910
9935
|
}
|
|
9911
|
-
return /* @__PURE__ */ (0,
|
|
9912
|
-
/* @__PURE__ */ (0,
|
|
9936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(Container8, { ...containerProps, children: [
|
|
9937
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
9913
9938
|
MessageIconWrapper2,
|
|
9914
9939
|
{
|
|
9915
9940
|
icon: purposeVariants3[purpose].icon,
|
|
9916
9941
|
color: icon6[purpose].color
|
|
9917
9942
|
}
|
|
9918
9943
|
),
|
|
9919
|
-
/* @__PURE__ */ (0,
|
|
9920
|
-
closable && /* @__PURE__ */ (0,
|
|
9944
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(TextContainer2, { children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Typography, { as: "span", children: message2 }) }),
|
|
9945
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
9921
9946
|
CloseButton,
|
|
9922
9947
|
{
|
|
9923
9948
|
icon: CloseIcon,
|
|
@@ -9937,14 +9962,14 @@ var LocalMessage = (0, import_react74.forwardRef)(
|
|
|
9937
9962
|
LocalMessage.displayName = "LocalMessage";
|
|
9938
9963
|
|
|
9939
9964
|
// src/components/Modal/Modal.tsx
|
|
9940
|
-
var
|
|
9965
|
+
var import_react76 = require("react");
|
|
9941
9966
|
var import_react_dom3 = require("react-dom");
|
|
9942
|
-
var
|
|
9967
|
+
var import_styled_components68 = __toESM(require("styled-components"));
|
|
9943
9968
|
|
|
9944
9969
|
// src/components/Modal/Backdrop/Backdrop.tsx
|
|
9945
9970
|
var import_dds_design_tokens47 = require("@norges-domstoler/dds-design-tokens");
|
|
9946
|
-
var
|
|
9947
|
-
var Backdrop =
|
|
9971
|
+
var import_styled_components67 = __toESM(require("styled-components"));
|
|
9972
|
+
var Backdrop = import_styled_components67.default.div.withConfig({
|
|
9948
9973
|
shouldForwardProp: (prop) => prop !== "isOpen"
|
|
9949
9974
|
})`
|
|
9950
9975
|
position: fixed;
|
|
@@ -10008,9 +10033,9 @@ var modalTokens = {
|
|
|
10008
10033
|
};
|
|
10009
10034
|
|
|
10010
10035
|
// src/components/Modal/Modal.tsx
|
|
10011
|
-
var
|
|
10036
|
+
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
10012
10037
|
var { container: container12, contentContainer: contentContainer6 } = modalTokens;
|
|
10013
|
-
var Container9 = (0,
|
|
10038
|
+
var Container9 = (0, import_styled_components68.default)(Paper)`
|
|
10014
10039
|
display: flex;
|
|
10015
10040
|
flex-direction: column-reverse;
|
|
10016
10041
|
min-width: 200px;
|
|
@@ -10024,16 +10049,16 @@ var Container9 = (0, import_styled_components67.default)(Paper)`
|
|
|
10024
10049
|
${focusVisible}
|
|
10025
10050
|
}
|
|
10026
10051
|
`;
|
|
10027
|
-
var ContentContainer3 =
|
|
10052
|
+
var ContentContainer3 = import_styled_components68.default.div`
|
|
10028
10053
|
display: grid;
|
|
10029
10054
|
padding-right: ${contentContainer6.paddingRight};
|
|
10030
10055
|
gap: ${contentContainer6.gap};
|
|
10031
10056
|
`;
|
|
10032
|
-
var HeaderContainer3 =
|
|
10033
|
-
var StyledButton4 = (0,
|
|
10057
|
+
var HeaderContainer3 = import_styled_components68.default.div``;
|
|
10058
|
+
var StyledButton4 = (0, import_styled_components68.default)(Button)`
|
|
10034
10059
|
align-self: flex-end;
|
|
10035
10060
|
`;
|
|
10036
|
-
var Modal = (0,
|
|
10061
|
+
var Modal = (0, import_react76.forwardRef)((props, ref) => {
|
|
10037
10062
|
const {
|
|
10038
10063
|
isOpen = false,
|
|
10039
10064
|
parentElement = document.body,
|
|
@@ -10047,7 +10072,7 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
10047
10072
|
htmlProps,
|
|
10048
10073
|
...rest
|
|
10049
10074
|
} = props;
|
|
10050
|
-
const generatedId = (0,
|
|
10075
|
+
const generatedId = (0, import_react76.useId)();
|
|
10051
10076
|
const modalId = id != null ? id : `${generatedId}-modal`;
|
|
10052
10077
|
const headerId = `${modalId}-header`;
|
|
10053
10078
|
const modalRef = useFocusTrap(isOpen, initialFocusRef);
|
|
@@ -10059,7 +10084,7 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
10059
10084
|
onClose();
|
|
10060
10085
|
}
|
|
10061
10086
|
};
|
|
10062
|
-
(0,
|
|
10087
|
+
(0, import_react76.useEffect)(() => {
|
|
10063
10088
|
if (isOpen) {
|
|
10064
10089
|
handleElementWithBackdropMount(document.body);
|
|
10065
10090
|
} else {
|
|
@@ -10071,7 +10096,7 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
10071
10096
|
useOnKeyDown(["Escape", "Esc"], () => handleClose());
|
|
10072
10097
|
const hasTransitionedIn = useMountTransition(isOpen, 200);
|
|
10073
10098
|
return isOpen || hasTransitionedIn ? (0, import_react_dom3.createPortal)(
|
|
10074
|
-
/* @__PURE__ */ (0,
|
|
10099
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(Backdrop, { isOpen: hasTransitionedIn && isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(
|
|
10075
10100
|
Container9,
|
|
10076
10101
|
{
|
|
10077
10102
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -10084,11 +10109,11 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
10084
10109
|
id: modalId,
|
|
10085
10110
|
elevation: 4,
|
|
10086
10111
|
children: [
|
|
10087
|
-
/* @__PURE__ */ (0,
|
|
10088
|
-
header3 && /* @__PURE__ */ (0,
|
|
10112
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(ContentContainer3, { children: [
|
|
10113
|
+
header3 && /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(HeaderContainer3, { id: headerId, children: typeof header3 === "string" ? /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(Typography, { typographyType: "headingSans03", children: header3 }) : header3 }),
|
|
10089
10114
|
children
|
|
10090
10115
|
] }),
|
|
10091
|
-
onClose && /* @__PURE__ */ (0,
|
|
10116
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
10092
10117
|
StyledButton4,
|
|
10093
10118
|
{
|
|
10094
10119
|
size: "small",
|
|
@@ -10108,45 +10133,45 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
10108
10133
|
Modal.displayName = "Modal";
|
|
10109
10134
|
|
|
10110
10135
|
// src/components/Modal/ModalBody.tsx
|
|
10111
|
-
var
|
|
10112
|
-
var
|
|
10113
|
-
var
|
|
10114
|
-
var Container10 =
|
|
10115
|
-
var ModalBody = (0,
|
|
10136
|
+
var import_react77 = require("react");
|
|
10137
|
+
var import_styled_components69 = __toESM(require("styled-components"));
|
|
10138
|
+
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
10139
|
+
var Container10 = import_styled_components69.default.div``;
|
|
10140
|
+
var ModalBody = (0, import_react77.forwardRef)(
|
|
10116
10141
|
(props, ref) => {
|
|
10117
10142
|
const { children, scrollable, id, className, htmlProps, height, ...rest } = props;
|
|
10118
10143
|
const containerProps = {
|
|
10119
10144
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
10120
10145
|
ref
|
|
10121
10146
|
};
|
|
10122
|
-
return scrollable ? /* @__PURE__ */ (0,
|
|
10147
|
+
return scrollable ? /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Container10, { ...containerProps, children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(ScrollableContainer, { contentHeight: height, children }) }) : /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Container10, { ...containerProps, children });
|
|
10123
10148
|
}
|
|
10124
10149
|
);
|
|
10125
10150
|
ModalBody.displayName = "ModalBody";
|
|
10126
10151
|
|
|
10127
10152
|
// src/components/Modal/ModalActions.tsx
|
|
10128
|
-
var
|
|
10129
|
-
var
|
|
10130
|
-
var
|
|
10131
|
-
var Container11 =
|
|
10153
|
+
var import_react78 = require("react");
|
|
10154
|
+
var import_styled_components70 = __toESM(require("styled-components"));
|
|
10155
|
+
var import_jsx_runtime237 = require("react/jsx-runtime");
|
|
10156
|
+
var Container11 = import_styled_components70.default.div`
|
|
10132
10157
|
display: flex;
|
|
10133
10158
|
flex-wrap: wrap;
|
|
10134
10159
|
gap: ${modalTokens.actionsContainer.gap};
|
|
10135
10160
|
`;
|
|
10136
|
-
var ModalActions = (0,
|
|
10161
|
+
var ModalActions = (0, import_react78.forwardRef)(
|
|
10137
10162
|
({ children, ...rest }, ref) => {
|
|
10138
10163
|
const containerProps = {
|
|
10139
10164
|
ref,
|
|
10140
10165
|
...rest
|
|
10141
10166
|
};
|
|
10142
|
-
return /* @__PURE__ */ (0,
|
|
10167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Container11, { ...containerProps, children });
|
|
10143
10168
|
}
|
|
10144
10169
|
);
|
|
10145
10170
|
ModalActions.displayName = "ModalActions";
|
|
10146
10171
|
|
|
10147
10172
|
// src/components/Pagination/Pagination.tsx
|
|
10148
|
-
var
|
|
10149
|
-
var
|
|
10173
|
+
var import_react80 = require("react");
|
|
10174
|
+
var import_styled_components72 = __toESM(require("styled-components"));
|
|
10150
10175
|
|
|
10151
10176
|
// src/components/Pagination/Pagination.tokens.tsx
|
|
10152
10177
|
var import_dds_design_tokens49 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -10204,11 +10229,11 @@ function PaginationGenerator(pagesAmount, activePage) {
|
|
|
10204
10229
|
}
|
|
10205
10230
|
|
|
10206
10231
|
// src/components/Select/Select.tsx
|
|
10207
|
-
var
|
|
10232
|
+
var import_react79 = require("react");
|
|
10208
10233
|
var import_react_select2 = __toESM(require("react-select"));
|
|
10209
10234
|
|
|
10210
10235
|
// src/components/Select/Select.styles.ts
|
|
10211
|
-
var
|
|
10236
|
+
var import_styled_components71 = __toESM(require("styled-components"));
|
|
10212
10237
|
|
|
10213
10238
|
// src/components/Select/Select.tokens.tsx
|
|
10214
10239
|
var import_dds_design_tokens50 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -10398,7 +10423,7 @@ var prefix = "dds-select";
|
|
|
10398
10423
|
function getContainerControlPadding(componentSize, isMulti) {
|
|
10399
10424
|
return isMulti ? control2.isMulti.sizes[componentSize].padding : control2.sizes[componentSize].padding;
|
|
10400
10425
|
}
|
|
10401
|
-
var Container12 =
|
|
10426
|
+
var Container12 = import_styled_components71.default.div`
|
|
10402
10427
|
margin: 0;
|
|
10403
10428
|
width: ${({ $width }) => $width};
|
|
10404
10429
|
position: relative;
|
|
@@ -10407,7 +10432,7 @@ var Container12 = import_styled_components70.default.div`
|
|
|
10407
10432
|
${selection}
|
|
10408
10433
|
}
|
|
10409
10434
|
|
|
10410
|
-
${({ $componentSize, $isMulti }) =>
|
|
10435
|
+
${({ $componentSize, $isMulti }) => import_styled_components71.css`
|
|
10411
10436
|
.${prefix}__control {
|
|
10412
10437
|
padding: ${getContainerControlPadding($componentSize, $isMulti)};
|
|
10413
10438
|
${getFontStyling(typographyTypes3.control[$componentSize], true)}
|
|
@@ -10423,7 +10448,7 @@ var Container12 = import_styled_components70.default.div`
|
|
|
10423
10448
|
}
|
|
10424
10449
|
`}
|
|
10425
10450
|
|
|
10426
|
-
${({ $errorMessage }) => $errorMessage &&
|
|
10451
|
+
${({ $errorMessage }) => $errorMessage && import_styled_components71.css`
|
|
10427
10452
|
.${prefix}__control {
|
|
10428
10453
|
${dangerInputfield}
|
|
10429
10454
|
}
|
|
@@ -10442,7 +10467,7 @@ var Container12 = import_styled_components70.default.div`
|
|
|
10442
10467
|
color: ${dropdownIndicator2.hover.color};
|
|
10443
10468
|
}
|
|
10444
10469
|
|
|
10445
|
-
${({ $isDisabled, $readOnly }) => $readOnly ?
|
|
10470
|
+
${({ $isDisabled, $readOnly }) => $readOnly ? import_styled_components71.css`
|
|
10446
10471
|
.${prefix}__control {
|
|
10447
10472
|
border-color: ${control2.readOnly.borderColor};
|
|
10448
10473
|
background-color: ${control2.readOnly.backgroundColor};
|
|
@@ -10454,7 +10479,7 @@ var Container12 = import_styled_components70.default.div`
|
|
|
10454
10479
|
.${prefix}__dropdown-indicator {
|
|
10455
10480
|
color: ${dropdownIndicator2.readOnly.color};
|
|
10456
10481
|
}
|
|
10457
|
-
` : $isDisabled ?
|
|
10482
|
+
` : $isDisabled ? import_styled_components71.css`
|
|
10458
10483
|
cursor: not-allowed;
|
|
10459
10484
|
.${prefix}__control {
|
|
10460
10485
|
border-color: ${control2.disabled.borderColor};
|
|
@@ -10465,14 +10490,14 @@ var Container12 = import_styled_components70.default.div`
|
|
|
10465
10490
|
}
|
|
10466
10491
|
` : ""}
|
|
10467
10492
|
`;
|
|
10468
|
-
var InnerSingleValue =
|
|
10493
|
+
var InnerSingleValue = import_styled_components71.default.div`
|
|
10469
10494
|
overflow: hidden;
|
|
10470
10495
|
text-overflow: ellipsis;
|
|
10471
10496
|
white-space: nowrap;
|
|
10472
10497
|
box-sizing: border-box;
|
|
10473
10498
|
max-width: 100%;
|
|
10474
10499
|
`;
|
|
10475
|
-
var StyledIcon3 = (0,
|
|
10500
|
+
var StyledIcon3 = (0, import_styled_components71.default)(Icon)`
|
|
10476
10501
|
margin-right: ${icon8.marginRight};
|
|
10477
10502
|
`;
|
|
10478
10503
|
var getCustomStyles = (size2) => ({
|
|
@@ -10637,7 +10662,7 @@ var getCustomStyles = (size2) => ({
|
|
|
10637
10662
|
|
|
10638
10663
|
// src/components/Select/SelectComponents.tsx
|
|
10639
10664
|
var import_react_select = require("react-select");
|
|
10640
|
-
var
|
|
10665
|
+
var import_jsx_runtime238 = require("react/jsx-runtime");
|
|
10641
10666
|
var {
|
|
10642
10667
|
Option,
|
|
10643
10668
|
NoOptionsMessage,
|
|
@@ -10648,17 +10673,17 @@ var {
|
|
|
10648
10673
|
MultiValueRemove,
|
|
10649
10674
|
Control
|
|
10650
10675
|
} = import_react_select.components;
|
|
10651
|
-
var DDSOption = (props, componentSize) => /* @__PURE__ */ (0,
|
|
10652
|
-
props.isSelected && /* @__PURE__ */ (0,
|
|
10676
|
+
var DDSOption = (props, componentSize) => /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(Option, { ...props, children: [
|
|
10677
|
+
props.isSelected && /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Icon, { icon: CheckIcon, iconSize: getFormInputIconSize(componentSize) }),
|
|
10653
10678
|
props.children
|
|
10654
10679
|
] });
|
|
10655
|
-
var CustomOption = (props, Element) => /* @__PURE__ */ (0,
|
|
10656
|
-
var CustomSingleValue = (props, id, Element) => /* @__PURE__ */ (0,
|
|
10657
|
-
var DDSNoOptionsMessage = (props) => /* @__PURE__ */ (0,
|
|
10658
|
-
var DDSClearIndicator = (props, size2) => /* @__PURE__ */ (0,
|
|
10659
|
-
var DDSMultiValueRemove = (props) => /* @__PURE__ */ (0,
|
|
10660
|
-
var DDSDropdownIndicator = (props, size2) => /* @__PURE__ */ (0,
|
|
10661
|
-
var DDSInput = (props, ariaInvalid, ariaDescribedby) => /* @__PURE__ */ (0,
|
|
10680
|
+
var CustomOption = (props, Element) => /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Option, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Element, { ...props }) });
|
|
10681
|
+
var CustomSingleValue = (props, id, Element) => /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(SingleValue, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(InnerSingleValue, { id, children: Element ? /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Element, { ...props }) : props.children }) });
|
|
10682
|
+
var DDSNoOptionsMessage = (props) => /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(NoOptionsMessage, { ...props, children: "Ingen treff" });
|
|
10683
|
+
var DDSClearIndicator = (props, size2) => /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(ClearIndicator, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Icon, { icon: CloseSmallIcon, iconSize: getFormInputIconSize(size2) }) });
|
|
10684
|
+
var DDSMultiValueRemove = (props) => /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(MultiValueRemove, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Icon, { icon: CloseSmallIcon, iconSize: "small" }) });
|
|
10685
|
+
var DDSDropdownIndicator = (props, size2) => /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(DropdownIndicator, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(Icon, { icon: ChevronDownIcon, iconSize: getFormInputIconSize(size2) }) });
|
|
10686
|
+
var DDSInput = (props, ariaInvalid, ariaDescribedby) => /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(
|
|
10662
10687
|
Input2,
|
|
10663
10688
|
{
|
|
10664
10689
|
...props,
|
|
@@ -10666,13 +10691,13 @@ var DDSInput = (props, ariaInvalid, ariaDescribedby) => /* @__PURE__ */ (0, impo
|
|
|
10666
10691
|
"aria-describedby": ariaDescribedby
|
|
10667
10692
|
}
|
|
10668
10693
|
);
|
|
10669
|
-
var DDSControl = (props, componentSize, icon11) => /* @__PURE__ */ (0,
|
|
10670
|
-
icon11 && /* @__PURE__ */ (0,
|
|
10694
|
+
var DDSControl = (props, componentSize, icon11) => /* @__PURE__ */ (0, import_jsx_runtime238.jsxs)(Control, { ...props, children: [
|
|
10695
|
+
icon11 && /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(StyledIcon3, { icon: icon11, iconSize: getFormInputIconSize(componentSize) }),
|
|
10671
10696
|
props.children
|
|
10672
10697
|
] });
|
|
10673
10698
|
|
|
10674
10699
|
// src/components/Select/Select.tsx
|
|
10675
|
-
var
|
|
10700
|
+
var import_jsx_runtime239 = require("react/jsx-runtime");
|
|
10676
10701
|
var defaultWidth4 = "320px";
|
|
10677
10702
|
var getPlaceholder = (placeholder3, isMulti) => placeholder3 ? placeholder3 : isMulti ? "-- Velg en eller flere --" : "-- Velg fra listen --";
|
|
10678
10703
|
function SelectInner(props, ref) {
|
|
@@ -10701,7 +10726,7 @@ function SelectInner(props, ref) {
|
|
|
10701
10726
|
customSingleValueElement,
|
|
10702
10727
|
...rest
|
|
10703
10728
|
} = props;
|
|
10704
|
-
const generatedId = (0,
|
|
10729
|
+
const generatedId = (0, import_react79.useId)();
|
|
10705
10730
|
const uniqueId = id != null ? id : `${generatedId}-select`;
|
|
10706
10731
|
const singleValueId = !isMulti ? `${uniqueId}-singleValue` : void 0;
|
|
10707
10732
|
const hasLabel = !!label3;
|
|
@@ -10759,57 +10784,57 @@ function SelectInner(props, ref) {
|
|
|
10759
10784
|
menuPortalTarget: document == null ? void 0 : document.body,
|
|
10760
10785
|
...rest
|
|
10761
10786
|
};
|
|
10762
|
-
return /* @__PURE__ */ (0,
|
|
10763
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
10764
|
-
/* @__PURE__ */ (0,
|
|
10787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime239.jsxs)(Container12, { ...containerProps, children: [
|
|
10788
|
+
hasLabel && /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(Label, { htmlFor: uniqueId, showRequiredStyling, children: label3 }),
|
|
10789
|
+
/* @__PURE__ */ (0, import_jsx_runtime239.jsx)(import_react_select2.default, { ...reactSelectProps, ref }),
|
|
10765
10790
|
renderInputMessage(tip, tipId, errorMessage, errorMessageId)
|
|
10766
10791
|
] });
|
|
10767
10792
|
}
|
|
10768
|
-
var Select = (0,
|
|
10793
|
+
var Select = (0, import_react79.forwardRef)(SelectInner);
|
|
10769
10794
|
Select.displayName = "Select";
|
|
10770
10795
|
|
|
10771
10796
|
// src/components/Select/utils.ts
|
|
10772
10797
|
var createSelectOptions = (...args) => args.map((v) => ({ label: v, value: v }));
|
|
10773
10798
|
|
|
10774
10799
|
// src/components/Pagination/Pagination.tsx
|
|
10775
|
-
var
|
|
10800
|
+
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
10776
10801
|
var { outerContainer: outerContainer4, indicatorsContainer: indicatorsContainer2, truncationIcon: truncationIcon2, list: list8 } = paginationTokens;
|
|
10777
|
-
var Nav =
|
|
10802
|
+
var Nav = import_styled_components72.default.nav`
|
|
10778
10803
|
display: flex;
|
|
10779
10804
|
align-items: center;
|
|
10780
10805
|
`;
|
|
10781
|
-
var List3 =
|
|
10806
|
+
var List3 = import_styled_components72.default.ol`
|
|
10782
10807
|
display: grid;
|
|
10783
10808
|
grid-auto-flow: column;
|
|
10784
10809
|
gap: ${list8.gap};
|
|
10785
10810
|
margin: 0;
|
|
10786
10811
|
padding: 0;
|
|
10787
10812
|
`;
|
|
10788
|
-
var ListItem3 =
|
|
10813
|
+
var ListItem3 = import_styled_components72.default.li`
|
|
10789
10814
|
display: inline-grid;
|
|
10790
10815
|
align-content: center;
|
|
10791
|
-
${({ $isHidden }) => $isHidden &&
|
|
10816
|
+
${({ $isHidden }) => $isHidden && import_styled_components72.css`
|
|
10792
10817
|
visibility: hidden;
|
|
10793
10818
|
`}
|
|
10794
10819
|
`;
|
|
10795
|
-
var OuterContainer =
|
|
10820
|
+
var OuterContainer = import_styled_components72.default.div`
|
|
10796
10821
|
display: flex;
|
|
10797
10822
|
gap: ${outerContainer4.gap};
|
|
10798
|
-
${({ $smallScreen }) => $smallScreen ?
|
|
10823
|
+
${({ $smallScreen }) => $smallScreen ? import_styled_components72.css`
|
|
10799
10824
|
flex-direction: column;
|
|
10800
10825
|
align-items: center;
|
|
10801
|
-
` :
|
|
10826
|
+
` : import_styled_components72.css`
|
|
10802
10827
|
justify-content: space-between;
|
|
10803
10828
|
flex-wrap: wrap;
|
|
10804
10829
|
`}
|
|
10805
10830
|
`;
|
|
10806
|
-
var IndicatorsContainer =
|
|
10831
|
+
var IndicatorsContainer = import_styled_components72.default.div`
|
|
10807
10832
|
display: grid;
|
|
10808
10833
|
grid-auto-flow: column;
|
|
10809
10834
|
align-items: center;
|
|
10810
10835
|
gap: ${indicatorsContainer2.gap};
|
|
10811
10836
|
`;
|
|
10812
|
-
var Pagination = (0,
|
|
10837
|
+
var Pagination = (0, import_react80.forwardRef)(
|
|
10813
10838
|
(props, ref) => {
|
|
10814
10839
|
const {
|
|
10815
10840
|
itemsAmount,
|
|
@@ -10832,8 +10857,8 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10832
10857
|
htmlProps,
|
|
10833
10858
|
...rest
|
|
10834
10859
|
} = props;
|
|
10835
|
-
const [activePage, setActivePage] = (0,
|
|
10836
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
10860
|
+
const [activePage, setActivePage] = (0, import_react80.useState)(defaultActivePage);
|
|
10861
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react80.useState)(defaultItemsPerPage);
|
|
10837
10862
|
const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
|
|
10838
10863
|
const items = PaginationGenerator(pagesLength, activePage);
|
|
10839
10864
|
const onPageChange = (event, page) => {
|
|
@@ -10852,7 +10877,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10852
10877
|
};
|
|
10853
10878
|
const listItems = items.length > 0 ? items.map((item, i) => {
|
|
10854
10879
|
const isActive = item === activePage;
|
|
10855
|
-
return /* @__PURE__ */ (0,
|
|
10880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ListItem3, { children: item !== "truncator" ? /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
10856
10881
|
Button,
|
|
10857
10882
|
{
|
|
10858
10883
|
purpose: isActive ? "primary" : "secondary",
|
|
@@ -10864,7 +10889,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10864
10889
|
"aria-label": isActive ? `N\xE5v\xE6rende side (side ${item})` : `G\xE5 til side ${item}`,
|
|
10865
10890
|
children: item
|
|
10866
10891
|
}
|
|
10867
|
-
) : /* @__PURE__ */ (0,
|
|
10892
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
10868
10893
|
Icon,
|
|
10869
10894
|
{
|
|
10870
10895
|
icon: MoreHorizontalIcon,
|
|
@@ -10872,7 +10897,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10872
10897
|
}
|
|
10873
10898
|
) }, `pagination-item-${i}`);
|
|
10874
10899
|
}) : void 0;
|
|
10875
|
-
const previousPageButton = /* @__PURE__ */ (0,
|
|
10900
|
+
const previousPageButton = /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
10876
10901
|
Button,
|
|
10877
10902
|
{
|
|
10878
10903
|
purpose: "secondary",
|
|
@@ -10885,7 +10910,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10885
10910
|
"aria-label": "G\xE5 til forrige siden"
|
|
10886
10911
|
}
|
|
10887
10912
|
);
|
|
10888
|
-
const nextPageButton = /* @__PURE__ */ (0,
|
|
10913
|
+
const nextPageButton = /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
10889
10914
|
Button,
|
|
10890
10915
|
{
|
|
10891
10916
|
purpose: "secondary",
|
|
@@ -10907,13 +10932,13 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10907
10932
|
};
|
|
10908
10933
|
const isOnFirstPage = activePage === 1;
|
|
10909
10934
|
const isOnLastPage = activePage === pagesLength;
|
|
10910
|
-
const navigation2 = withPagination ? /* @__PURE__ */ (0,
|
|
10911
|
-
/* @__PURE__ */ (0,
|
|
10935
|
+
const navigation2 = withPagination ? /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(Nav, { ref, "aria-label": "paginering", ...navProps, children: /* @__PURE__ */ (0, import_jsx_runtime240.jsxs)(List3, { children: [
|
|
10936
|
+
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ListItem3, { $isHidden: isOnFirstPage, "aria-hidden": isOnFirstPage, children: previousPageButton }),
|
|
10912
10937
|
listItems,
|
|
10913
|
-
/* @__PURE__ */ (0,
|
|
10938
|
+
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ListItem3, { $isHidden: isOnLastPage, "aria-hidden": isOnLastPage, children: nextPageButton })
|
|
10914
10939
|
] }) }) : null;
|
|
10915
|
-
const smallScreenNavigation = withPagination ? /* @__PURE__ */ (0,
|
|
10916
|
-
/* @__PURE__ */ (0,
|
|
10940
|
+
const smallScreenNavigation = withPagination ? /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(Nav, { ref, "aria-label": "paginering", ...navProps, children: /* @__PURE__ */ (0, import_jsx_runtime240.jsxs)(List3, { children: [
|
|
10941
|
+
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ListItem3, { $isHidden: isOnFirstPage, "aria-hidden": isOnFirstPage, children: /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
10917
10942
|
Button,
|
|
10918
10943
|
{
|
|
10919
10944
|
purpose: "secondary",
|
|
@@ -10926,8 +10951,8 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10926
10951
|
"aria-label": "G\xE5 til f\xF8rste siden"
|
|
10927
10952
|
}
|
|
10928
10953
|
) }),
|
|
10929
|
-
/* @__PURE__ */ (0,
|
|
10930
|
-
/* @__PURE__ */ (0,
|
|
10954
|
+
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ListItem3, { $isHidden: isOnFirstPage, "aria-hidden": isOnFirstPage, children: previousPageButton }),
|
|
10955
|
+
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ListItem3, { children: /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
10931
10956
|
Button,
|
|
10932
10957
|
{
|
|
10933
10958
|
size: "small",
|
|
@@ -10937,8 +10962,8 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10937
10962
|
children: activePage
|
|
10938
10963
|
}
|
|
10939
10964
|
) }),
|
|
10940
|
-
/* @__PURE__ */ (0,
|
|
10941
|
-
/* @__PURE__ */ (0,
|
|
10965
|
+
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ListItem3, { $isHidden: isOnLastPage, "aria-hidden": isOnLastPage, children: nextPageButton }),
|
|
10966
|
+
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ListItem3, { $isHidden: isOnLastPage, "aria-hidden": isOnLastPage, children: /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
10942
10967
|
Button,
|
|
10943
10968
|
{
|
|
10944
10969
|
purpose: "secondary",
|
|
@@ -10955,9 +10980,9 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10955
10980
|
const activePageFirstItem = activePage === 1 ? 1 : activePage * itemsPerPage - itemsPerPage + 1;
|
|
10956
10981
|
const activePageLastItem = activePage === pagesLength ? itemsAmount : activePage * itemsPerPage;
|
|
10957
10982
|
const navigationToBeRendered = smallScreen ? smallScreenNavigation : navigation2;
|
|
10958
|
-
return !withCounter && !withSelect ? navigationToBeRendered : /* @__PURE__ */ (0,
|
|
10959
|
-
/* @__PURE__ */ (0,
|
|
10960
|
-
withSelect && /* @__PURE__ */ (0,
|
|
10983
|
+
return !withCounter && !withSelect ? navigationToBeRendered : /* @__PURE__ */ (0, import_jsx_runtime240.jsxs)(OuterContainer, { ...containerProps, children: [
|
|
10984
|
+
/* @__PURE__ */ (0, import_jsx_runtime240.jsxs)(IndicatorsContainer, { children: [
|
|
10985
|
+
withSelect && /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
10961
10986
|
Select,
|
|
10962
10987
|
{
|
|
10963
10988
|
options: selectOptions,
|
|
@@ -10972,7 +10997,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10972
10997
|
"aria-label": "Antall elementer per side"
|
|
10973
10998
|
}
|
|
10974
10999
|
),
|
|
10975
|
-
withCounter && /* @__PURE__ */ (0,
|
|
11000
|
+
withCounter && /* @__PURE__ */ (0, import_jsx_runtime240.jsxs)(Typography, { typographyType: "supportingStyleLabel01", as: "p", children: [
|
|
10976
11001
|
"Viser ",
|
|
10977
11002
|
activePageFirstItem,
|
|
10978
11003
|
"-",
|
|
@@ -10989,8 +11014,8 @@ Pagination.displayName = "Pagination";
|
|
|
10989
11014
|
|
|
10990
11015
|
// src/components/Popover/Popover.tsx
|
|
10991
11016
|
var import_dds_design_tokens52 = require("@norges-domstoler/dds-design-tokens");
|
|
10992
|
-
var
|
|
10993
|
-
var
|
|
11017
|
+
var import_react81 = require("react");
|
|
11018
|
+
var import_styled_components73 = __toESM(require("styled-components"));
|
|
10994
11019
|
|
|
10995
11020
|
// src/components/Popover/Popover.tokens.tsx
|
|
10996
11021
|
var import_dds_design_tokens51 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -11018,10 +11043,10 @@ var popoverTokens2 = {
|
|
|
11018
11043
|
};
|
|
11019
11044
|
|
|
11020
11045
|
// src/components/Popover/Popover.tsx
|
|
11021
|
-
var
|
|
11046
|
+
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
11022
11047
|
var { spacing: Spacing } = import_dds_design_tokens52.ddsBaseTokens;
|
|
11023
11048
|
var { wrapper: wrapper4, content: content6, closeButton: closeButton2, title: title2 } = popoverTokens2;
|
|
11024
|
-
var Wrapper4 = (0,
|
|
11049
|
+
var Wrapper4 = (0, import_styled_components73.default)(Paper)`
|
|
11025
11050
|
opacity: 0;
|
|
11026
11051
|
${({ $hasTransitionedIn, $isOpen }) => $hasTransitionedIn && visibilityTransition($hasTransitionedIn && $isOpen)}
|
|
11027
11052
|
position: absolute;
|
|
@@ -11032,7 +11057,7 @@ var Wrapper4 = (0, import_styled_components72.default)(Paper)`
|
|
|
11032
11057
|
&:focus-visible {
|
|
11033
11058
|
${focusVisible}
|
|
11034
11059
|
}
|
|
11035
|
-
${({ $sizeProps }) => $sizeProps &&
|
|
11060
|
+
${({ $sizeProps }) => $sizeProps && import_styled_components73.css`
|
|
11036
11061
|
width: ${$sizeProps.width};
|
|
11037
11062
|
height: ${$sizeProps.height};
|
|
11038
11063
|
min-width: ${$sizeProps.minWidth};
|
|
@@ -11041,20 +11066,20 @@ var Wrapper4 = (0, import_styled_components72.default)(Paper)`
|
|
|
11041
11066
|
max-height: ${$sizeProps.maxHeight};
|
|
11042
11067
|
`}
|
|
11043
11068
|
`;
|
|
11044
|
-
var TitleContainer =
|
|
11069
|
+
var TitleContainer = import_styled_components73.default.div`
|
|
11045
11070
|
margin-right: ${title2.marginRight};
|
|
11046
11071
|
`;
|
|
11047
|
-
var ContentContainer4 =
|
|
11048
|
-
${({ $withCloseButton, $hasTitle }) => $withCloseButton && !$hasTitle &&
|
|
11072
|
+
var ContentContainer4 = import_styled_components73.default.div`
|
|
11073
|
+
${({ $withCloseButton, $hasTitle }) => $withCloseButton && !$hasTitle && import_styled_components73.css`
|
|
11049
11074
|
margin-top: ${content6.noTitle.marginTop};
|
|
11050
11075
|
`}
|
|
11051
11076
|
`;
|
|
11052
|
-
var StyledButton5 = (0,
|
|
11077
|
+
var StyledButton5 = (0, import_styled_components73.default)(Button)`
|
|
11053
11078
|
position: absolute;
|
|
11054
11079
|
top: ${closeButton2.top};
|
|
11055
11080
|
right: ${closeButton2.right};
|
|
11056
11081
|
`;
|
|
11057
|
-
var Popover = (0,
|
|
11082
|
+
var Popover = (0, import_react81.forwardRef)(
|
|
11058
11083
|
(props, ref) => {
|
|
11059
11084
|
const {
|
|
11060
11085
|
title: title3,
|
|
@@ -11094,7 +11119,7 @@ var Popover = (0, import_react80.forwardRef)(
|
|
|
11094
11119
|
if (isOpen)
|
|
11095
11120
|
onClose && onClose();
|
|
11096
11121
|
});
|
|
11097
|
-
return isOpen || hasTransitionedIn ? /* @__PURE__ */ (0,
|
|
11122
|
+
return isOpen || hasTransitionedIn ? /* @__PURE__ */ (0, import_jsx_runtime241.jsxs)(
|
|
11098
11123
|
Wrapper4,
|
|
11099
11124
|
{
|
|
11100
11125
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -11107,8 +11132,8 @@ var Popover = (0, import_react80.forwardRef)(
|
|
|
11107
11132
|
elevation: 3,
|
|
11108
11133
|
border: "light",
|
|
11109
11134
|
children: [
|
|
11110
|
-
title3 && /* @__PURE__ */ (0,
|
|
11111
|
-
/* @__PURE__ */ (0,
|
|
11135
|
+
title3 && /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(TitleContainer, { children: typeof title3 === "string" ? /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(Typography, { typographyType: "headingSans02", children: title3 }) : title3 }),
|
|
11136
|
+
/* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
11112
11137
|
ContentContainer4,
|
|
11113
11138
|
{
|
|
11114
11139
|
$hasTitle: !!title3,
|
|
@@ -11116,7 +11141,7 @@ var Popover = (0, import_react80.forwardRef)(
|
|
|
11116
11141
|
children
|
|
11117
11142
|
}
|
|
11118
11143
|
),
|
|
11119
|
-
withCloseButton && /* @__PURE__ */ (0,
|
|
11144
|
+
withCloseButton && /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
11120
11145
|
StyledButton5,
|
|
11121
11146
|
{
|
|
11122
11147
|
icon: CloseIcon,
|
|
@@ -11135,8 +11160,8 @@ var Popover = (0, import_react80.forwardRef)(
|
|
|
11135
11160
|
Popover.displayName = "Popover";
|
|
11136
11161
|
|
|
11137
11162
|
// src/components/Popover/PopoverGroup.tsx
|
|
11138
|
-
var
|
|
11139
|
-
var
|
|
11163
|
+
var import_react82 = require("react");
|
|
11164
|
+
var import_jsx_runtime242 = require("react/jsx-runtime");
|
|
11140
11165
|
var PopoverGroup = ({
|
|
11141
11166
|
isOpen = false,
|
|
11142
11167
|
onCloseButtonClick,
|
|
@@ -11144,8 +11169,8 @@ var PopoverGroup = ({
|
|
|
11144
11169
|
children,
|
|
11145
11170
|
popoverId
|
|
11146
11171
|
}) => {
|
|
11147
|
-
const [open, setOpen] = (0,
|
|
11148
|
-
const generatedId = (0,
|
|
11172
|
+
const [open, setOpen] = (0, import_react82.useState)(isOpen);
|
|
11173
|
+
const generatedId = (0, import_react82.useId)();
|
|
11149
11174
|
const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
|
|
11150
11175
|
const handleOnCloseButtonClick = () => {
|
|
11151
11176
|
setOpen(false);
|
|
@@ -11155,8 +11180,8 @@ var PopoverGroup = ({
|
|
|
11155
11180
|
setOpen(!open);
|
|
11156
11181
|
onTriggerClick && onTriggerClick();
|
|
11157
11182
|
};
|
|
11158
|
-
const buttonRef = (0,
|
|
11159
|
-
const popoverRef = (0,
|
|
11183
|
+
const buttonRef = (0, import_react82.useRef)(null);
|
|
11184
|
+
const popoverRef = (0, import_react82.useRef)(null);
|
|
11160
11185
|
useOnKeyDown(["Esc", "Escape"], () => {
|
|
11161
11186
|
var _a;
|
|
11162
11187
|
if (open) {
|
|
@@ -11165,14 +11190,14 @@ var PopoverGroup = ({
|
|
|
11165
11190
|
}
|
|
11166
11191
|
});
|
|
11167
11192
|
const handleClose = () => setOpen(false);
|
|
11168
|
-
const Children9 =
|
|
11169
|
-
return (0,
|
|
11193
|
+
const Children9 = import_react82.Children.map(children, (child, childIndex) => {
|
|
11194
|
+
return (0, import_react82.isValidElement)(child) && (childIndex === 0 ? (0, import_react82.cloneElement)(child, {
|
|
11170
11195
|
"aria-haspopup": "dialog",
|
|
11171
11196
|
"aria-controls": uniquePopoverId,
|
|
11172
11197
|
"aria-expanded": open,
|
|
11173
11198
|
onClick: handleOnTriggerClick,
|
|
11174
11199
|
ref: buttonRef
|
|
11175
|
-
}) : (0,
|
|
11200
|
+
}) : (0, import_react82.cloneElement)(child, {
|
|
11176
11201
|
isOpen: open,
|
|
11177
11202
|
"aria-hidden": !open,
|
|
11178
11203
|
id: uniquePopoverId,
|
|
@@ -11182,22 +11207,22 @@ var PopoverGroup = ({
|
|
|
11182
11207
|
onClose: handleClose
|
|
11183
11208
|
}));
|
|
11184
11209
|
});
|
|
11185
|
-
return /* @__PURE__ */ (0,
|
|
11210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(import_jsx_runtime242.Fragment, { children: Children9 });
|
|
11186
11211
|
};
|
|
11187
11212
|
PopoverGroup.displayName = "PopoverGroup";
|
|
11188
11213
|
|
|
11189
11214
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
11190
|
-
var
|
|
11191
|
-
var
|
|
11215
|
+
var import_react85 = require("react");
|
|
11216
|
+
var import_styled_components75 = __toESM(require("styled-components"));
|
|
11192
11217
|
|
|
11193
11218
|
// src/components/ProgressTracker/ProgressTracker.context.tsx
|
|
11194
|
-
var
|
|
11195
|
-
var ProgressTrackerContext = (0,
|
|
11219
|
+
var import_react83 = require("react");
|
|
11220
|
+
var ProgressTrackerContext = (0, import_react83.createContext)(
|
|
11196
11221
|
{
|
|
11197
11222
|
activeStep: 0
|
|
11198
11223
|
}
|
|
11199
11224
|
);
|
|
11200
|
-
var useProgressTrackerContext = () => (0,
|
|
11225
|
+
var useProgressTrackerContext = () => (0, import_react83.useContext)(ProgressTrackerContext);
|
|
11201
11226
|
|
|
11202
11227
|
// src/components/ProgressTracker/ProgressTracker.tokens.tsx
|
|
11203
11228
|
var import_dds_design_tokens53 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -11315,9 +11340,9 @@ var progressTrackerTokens = {
|
|
|
11315
11340
|
};
|
|
11316
11341
|
|
|
11317
11342
|
// src/components/ProgressTracker/ProgressTrackerItem.tsx
|
|
11318
|
-
var
|
|
11319
|
-
var
|
|
11320
|
-
var
|
|
11343
|
+
var import_react84 = require("react");
|
|
11344
|
+
var import_styled_components74 = __toESM(require("styled-components"));
|
|
11345
|
+
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
11321
11346
|
var toItemState = (active, completed, disabled) => {
|
|
11322
11347
|
if (disabled) {
|
|
11323
11348
|
return "disabled";
|
|
@@ -11329,13 +11354,13 @@ var toItemState = (active, completed, disabled) => {
|
|
|
11329
11354
|
}
|
|
11330
11355
|
};
|
|
11331
11356
|
var { itemNumber: itemNumber2, itemText: itemText2, itemContentWrapper: itemContentWrapper2 } = progressTrackerTokens;
|
|
11332
|
-
var ItemWrapper =
|
|
11357
|
+
var ItemWrapper = import_styled_components74.default.li`
|
|
11333
11358
|
flex: 1;
|
|
11334
11359
|
position: relative;
|
|
11335
11360
|
display: flex;
|
|
11336
11361
|
justify-content: center;
|
|
11337
11362
|
`;
|
|
11338
|
-
var ItemNumber =
|
|
11363
|
+
var ItemNumber = import_styled_components74.default.div`
|
|
11339
11364
|
transition:
|
|
11340
11365
|
background-color 0.2s,
|
|
11341
11366
|
border-color 0.2s,
|
|
@@ -11351,24 +11376,24 @@ var ItemNumber = import_styled_components73.default.div`
|
|
|
11351
11376
|
${getFontStyling(typographyTypes4.number)}
|
|
11352
11377
|
font-weight: 600;
|
|
11353
11378
|
|
|
11354
|
-
${({ $state: state }) => state &&
|
|
11379
|
+
${({ $state: state }) => state && import_styled_components74.css`
|
|
11355
11380
|
border-color: ${itemNumber2[state].borderColor};
|
|
11356
11381
|
color: ${itemNumber2[state].color};
|
|
11357
11382
|
background-color: ${itemNumber2[state].backgroundColor};
|
|
11358
11383
|
`}
|
|
11359
11384
|
`;
|
|
11360
|
-
var ItemText =
|
|
11385
|
+
var ItemText = import_styled_components74.default.div`
|
|
11361
11386
|
${getFontStyling(typographyTypes4.label)}
|
|
11362
11387
|
text-align: start;
|
|
11363
11388
|
text-decoration: ${itemText2.textDecoration};
|
|
11364
11389
|
transition: text-decoration-color 0.2s;
|
|
11365
11390
|
|
|
11366
|
-
${({ $state: state }) => state &&
|
|
11391
|
+
${({ $state: state }) => state && import_styled_components74.css`
|
|
11367
11392
|
color: ${itemText2[state].color};
|
|
11368
11393
|
text-decoration-color: ${itemText2[state].textDecorationColor};
|
|
11369
11394
|
`};
|
|
11370
11395
|
`;
|
|
11371
|
-
var ItemContentWrapper =
|
|
11396
|
+
var ItemContentWrapper = import_styled_components74.default.button`
|
|
11372
11397
|
background: none;
|
|
11373
11398
|
border: none;
|
|
11374
11399
|
margin: 0;
|
|
@@ -11386,7 +11411,7 @@ var ItemContentWrapper = import_styled_components73.default.button`
|
|
|
11386
11411
|
${focusVisible}
|
|
11387
11412
|
}
|
|
11388
11413
|
|
|
11389
|
-
${({ $state: state }) => state !== "disabled" &&
|
|
11414
|
+
${({ $state: state }) => state !== "disabled" && import_styled_components74.css`
|
|
11390
11415
|
cursor: pointer;
|
|
11391
11416
|
&:hover > ${ItemText} {
|
|
11392
11417
|
color: ${itemText2[state].hover.color};
|
|
@@ -11412,16 +11437,16 @@ var ProgressTrackerItem = (props) => {
|
|
|
11412
11437
|
const styleProps = {
|
|
11413
11438
|
$state: toItemState(active, completed, disabled)
|
|
11414
11439
|
};
|
|
11415
|
-
const stepNumberContent = (0,
|
|
11440
|
+
const stepNumberContent = (0, import_react84.useMemo)(() => {
|
|
11416
11441
|
if (completed) {
|
|
11417
|
-
return /* @__PURE__ */ (0,
|
|
11442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(Icon, { icon: CheckIcon, iconSize: itemNumber2.iconSize });
|
|
11418
11443
|
}
|
|
11419
11444
|
if (icon11 !== void 0) {
|
|
11420
|
-
return /* @__PURE__ */ (0,
|
|
11445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(Icon, { icon: icon11, iconSize: itemNumber2.iconSize });
|
|
11421
11446
|
}
|
|
11422
11447
|
return index + 1;
|
|
11423
11448
|
}, [completed, icon11, index]);
|
|
11424
|
-
return /* @__PURE__ */ (0,
|
|
11449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(ItemWrapper, { "aria-current": active ? "step" : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(
|
|
11425
11450
|
ItemContentWrapper,
|
|
11426
11451
|
{
|
|
11427
11452
|
...styleProps,
|
|
@@ -11429,9 +11454,9 @@ var ProgressTrackerItem = (props) => {
|
|
|
11429
11454
|
onClick: !disabled && handleStepChange ? () => handleStepChange(index) : void 0,
|
|
11430
11455
|
disabled,
|
|
11431
11456
|
children: [
|
|
11432
|
-
/* @__PURE__ */ (0,
|
|
11433
|
-
/* @__PURE__ */ (0,
|
|
11434
|
-
/* @__PURE__ */ (0,
|
|
11457
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(ItemNumber, { ...styleProps, "aria-hidden": true, children: stepNumberContent }),
|
|
11458
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(ItemText, { ...styleProps, children: [
|
|
11459
|
+
/* @__PURE__ */ (0, import_jsx_runtime243.jsx)(VisuallyHidden, { as: "span", children: getVisuallyHiddenText(active, completed, index) }),
|
|
11435
11460
|
children
|
|
11436
11461
|
] })
|
|
11437
11462
|
]
|
|
@@ -11441,8 +11466,8 @@ var ProgressTrackerItem = (props) => {
|
|
|
11441
11466
|
ProgressTrackerItem.displayName = "ProgressTracker.Item";
|
|
11442
11467
|
|
|
11443
11468
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
11444
|
-
var
|
|
11445
|
-
var ItemsWrapper =
|
|
11469
|
+
var import_jsx_runtime244 = require("react/jsx-runtime");
|
|
11470
|
+
var ItemsWrapper = import_styled_components75.default.ol`
|
|
11446
11471
|
display: flex;
|
|
11447
11472
|
flex-direction: column;
|
|
11448
11473
|
align-items: flex-start;
|
|
@@ -11450,7 +11475,7 @@ var ItemsWrapper = import_styled_components74.default.ol`
|
|
|
11450
11475
|
margin: 0;
|
|
11451
11476
|
padding: 0;
|
|
11452
11477
|
`;
|
|
11453
|
-
var ProgressTrackerConnector =
|
|
11478
|
+
var ProgressTrackerConnector = import_styled_components75.default.div`
|
|
11454
11479
|
margin-left: calc(
|
|
11455
11480
|
(${progressTrackerTokens.itemNumber.size} / 2) -
|
|
11456
11481
|
(${progressTrackerTokens.connector.width} / 2)
|
|
@@ -11460,7 +11485,7 @@ var ProgressTrackerConnector = import_styled_components74.default.div`
|
|
|
11460
11485
|
${progressTrackerTokens.connector.color};
|
|
11461
11486
|
`;
|
|
11462
11487
|
var ProgressTracker = (() => {
|
|
11463
|
-
const Res = (0,
|
|
11488
|
+
const Res = (0, import_react85.forwardRef)((props, ref) => {
|
|
11464
11489
|
const {
|
|
11465
11490
|
id,
|
|
11466
11491
|
activeStep = 0,
|
|
@@ -11470,12 +11495,12 @@ var ProgressTracker = (() => {
|
|
|
11470
11495
|
htmlProps,
|
|
11471
11496
|
...rest
|
|
11472
11497
|
} = props;
|
|
11473
|
-
const [thisActiveStep, setActiveStep] = (0,
|
|
11498
|
+
const [thisActiveStep, setActiveStep] = (0, import_react85.useState)(activeStep);
|
|
11474
11499
|
const handleChange = (step) => {
|
|
11475
11500
|
setActiveStep(step);
|
|
11476
11501
|
onStepChange && onStepChange(step);
|
|
11477
11502
|
};
|
|
11478
|
-
(0,
|
|
11503
|
+
(0, import_react85.useEffect)(() => {
|
|
11479
11504
|
if (activeStep !== void 0 && activeStep != thisActiveStep) {
|
|
11480
11505
|
setActiveStep(activeStep);
|
|
11481
11506
|
}
|
|
@@ -11484,20 +11509,20 @@ var ProgressTracker = (() => {
|
|
|
11484
11509
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
11485
11510
|
ref
|
|
11486
11511
|
};
|
|
11487
|
-
const steps = (0,
|
|
11512
|
+
const steps = (0, import_react85.useMemo)(() => {
|
|
11488
11513
|
const validChildren = removeInvalidChildren(children);
|
|
11489
11514
|
const itemsWithIndex = passIndexPropToProgressTrackerItem(validChildren);
|
|
11490
11515
|
const itemsWithConnectorsBetween = intersperseItemsWithConnector(itemsWithIndex);
|
|
11491
11516
|
return itemsWithConnectorsBetween;
|
|
11492
11517
|
}, [children]);
|
|
11493
|
-
return /* @__PURE__ */ (0,
|
|
11518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
11494
11519
|
ProgressTrackerContext.Provider,
|
|
11495
11520
|
{
|
|
11496
11521
|
value: {
|
|
11497
11522
|
activeStep: thisActiveStep,
|
|
11498
11523
|
handleStepChange: handleChange
|
|
11499
11524
|
},
|
|
11500
|
-
children: /* @__PURE__ */ (0,
|
|
11525
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime244.jsx)("div", { role: "group", "aria-label": "progress", ...containerProps, children: /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(ItemsWrapper, { children: steps }) })
|
|
11501
11526
|
}
|
|
11502
11527
|
);
|
|
11503
11528
|
});
|
|
@@ -11506,36 +11531,36 @@ var ProgressTracker = (() => {
|
|
|
11506
11531
|
return Res;
|
|
11507
11532
|
})();
|
|
11508
11533
|
function removeInvalidChildren(children) {
|
|
11509
|
-
return
|
|
11534
|
+
return import_react85.Children.toArray(children).filter(import_react85.isValidElement);
|
|
11510
11535
|
}
|
|
11511
11536
|
function passIndexPropToProgressTrackerItem(children) {
|
|
11512
|
-
return
|
|
11537
|
+
return import_react85.Children.map(
|
|
11513
11538
|
children,
|
|
11514
|
-
(item, index) => (0,
|
|
11539
|
+
(item, index) => (0, import_react85.cloneElement)(item, {
|
|
11515
11540
|
...item.props,
|
|
11516
11541
|
index
|
|
11517
11542
|
})
|
|
11518
11543
|
);
|
|
11519
11544
|
}
|
|
11520
|
-
var intersperseItemsWithConnector = (children) =>
|
|
11545
|
+
var intersperseItemsWithConnector = (children) => import_react85.Children.map(children, (child, index) => {
|
|
11521
11546
|
if (index === 0) {
|
|
11522
11547
|
return child;
|
|
11523
11548
|
}
|
|
11524
|
-
return /* @__PURE__ */ (0,
|
|
11525
|
-
/* @__PURE__ */ (0,
|
|
11549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(import_react85.Fragment, { children: [
|
|
11550
|
+
/* @__PURE__ */ (0, import_jsx_runtime244.jsx)(ProgressTrackerConnector, { "aria-hidden": true }),
|
|
11526
11551
|
child
|
|
11527
11552
|
] }, index);
|
|
11528
11553
|
});
|
|
11529
11554
|
|
|
11530
11555
|
// src/components/Search/Search.tsx
|
|
11531
|
-
var
|
|
11532
|
-
var
|
|
11556
|
+
var import_react88 = require("react");
|
|
11557
|
+
var import_styled_components77 = __toESM(require("styled-components"));
|
|
11533
11558
|
|
|
11534
11559
|
// src/components/Search/AutocompleteSearch.context.tsx
|
|
11535
|
-
var
|
|
11536
|
-
var AutocompleteSearchContext = (0,
|
|
11560
|
+
var import_react86 = require("react");
|
|
11561
|
+
var AutocompleteSearchContext = (0, import_react86.createContext)({});
|
|
11537
11562
|
var useAutocompleteSearch = () => {
|
|
11538
|
-
return (0,
|
|
11563
|
+
return (0, import_react86.useContext)(AutocompleteSearchContext);
|
|
11539
11564
|
};
|
|
11540
11565
|
|
|
11541
11566
|
// src/components/Search/Search.tokens.tsx
|
|
@@ -11645,11 +11670,11 @@ function createEmptyChangeEvent(inputElementId) {
|
|
|
11645
11670
|
}
|
|
11646
11671
|
|
|
11647
11672
|
// src/components/Search/SearchSuggestions.tsx
|
|
11648
|
-
var
|
|
11649
|
-
var
|
|
11650
|
-
var
|
|
11673
|
+
var import_react87 = require("react");
|
|
11674
|
+
var import_styled_components76 = __toESM(require("styled-components"));
|
|
11675
|
+
var import_jsx_runtime245 = require("react/jsx-runtime");
|
|
11651
11676
|
var { suggestionsContainer: suggestionsContainer2, suggestionsHeader: suggestionsHeader2 } = searchTokens;
|
|
11652
|
-
var SuggestionsContainer = (0,
|
|
11677
|
+
var SuggestionsContainer = (0, import_styled_components76.default)(Paper)`
|
|
11653
11678
|
${({ $isHidden }) => visibilityTransition(!$isHidden)};
|
|
11654
11679
|
position: absolute;
|
|
11655
11680
|
top: 100%;
|
|
@@ -11663,16 +11688,16 @@ var SuggestionsContainer = (0, import_styled_components75.default)(Paper)`
|
|
|
11663
11688
|
${scrollbarStyling.firefox}
|
|
11664
11689
|
${scrollbarStyling.webkit}
|
|
11665
11690
|
`;
|
|
11666
|
-
var MenuItem = (0,
|
|
11691
|
+
var MenuItem = (0, import_styled_components76.default)(OverflowMenuItem)`
|
|
11667
11692
|
${({ $size }) => $size && getFontStyling(typographyTypes5[$size])}
|
|
11668
11693
|
`;
|
|
11669
|
-
var SuggestionsList =
|
|
11694
|
+
var SuggestionsList = import_styled_components76.default.ul`
|
|
11670
11695
|
${removeListStyling}
|
|
11671
11696
|
`;
|
|
11672
|
-
var SuggestionsHeader = (0,
|
|
11697
|
+
var SuggestionsHeader = (0, import_styled_components76.default)(Typography)`
|
|
11673
11698
|
padding-left: ${suggestionsHeader2.paddingLeft};
|
|
11674
11699
|
`;
|
|
11675
|
-
var SearchSuggestions = (0,
|
|
11700
|
+
var SearchSuggestions = (0, import_react87.forwardRef)((props, ref) => {
|
|
11676
11701
|
const {
|
|
11677
11702
|
id,
|
|
11678
11703
|
searchId,
|
|
@@ -11691,8 +11716,8 @@ var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
|
11691
11716
|
);
|
|
11692
11717
|
const [focus] = useRoveFocus(suggestions == null ? void 0 : suggestions.length, showSuggestions);
|
|
11693
11718
|
const suggestionsToRender = maxSuggestions ? suggestions == null ? void 0 : suggestions.slice(maxSuggestions) : suggestions;
|
|
11694
|
-
const renderedSuggestions = /* @__PURE__ */ (0,
|
|
11695
|
-
return /* @__PURE__ */ (0,
|
|
11719
|
+
const renderedSuggestions = /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(SuggestionsList, { role: "listbox", "aria-labelledby": suggestionsHeaderId, children: suggestionsToRender.map((suggestion, index) => {
|
|
11720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)("li", { role: "option", children: /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
|
|
11696
11721
|
MenuItem,
|
|
11697
11722
|
{
|
|
11698
11723
|
index,
|
|
@@ -11707,7 +11732,7 @@ var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
|
11707
11732
|
) }, index);
|
|
11708
11733
|
}) });
|
|
11709
11734
|
const isHidden = !showSuggestions;
|
|
11710
|
-
return /* @__PURE__ */ (0,
|
|
11735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime245.jsxs)(
|
|
11711
11736
|
SuggestionsContainer,
|
|
11712
11737
|
{
|
|
11713
11738
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -11715,7 +11740,7 @@ var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
|
11715
11740
|
$isHidden: isHidden,
|
|
11716
11741
|
"aria-hidden": isHidden,
|
|
11717
11742
|
children: [
|
|
11718
|
-
/* @__PURE__ */ (0,
|
|
11743
|
+
/* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
|
|
11719
11744
|
SuggestionsHeader,
|
|
11720
11745
|
{
|
|
11721
11746
|
typographyType: "supportingStyleTiny01",
|
|
@@ -11732,7 +11757,7 @@ var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
|
11732
11757
|
SearchSuggestions.displayName = "SearchSuggestions";
|
|
11733
11758
|
|
|
11734
11759
|
// src/components/Search/Search.tsx
|
|
11735
|
-
var
|
|
11760
|
+
var import_jsx_runtime246 = require("react/jsx-runtime");
|
|
11736
11761
|
var { input: input4, outerContainer: outerContainer6, horisontalContainer: horisontalContainer2, searchIcon: searchIcon2, clearButton: clearButton2 } = searchTokens;
|
|
11737
11762
|
var getIconSize = (size2) => {
|
|
11738
11763
|
switch (size2) {
|
|
@@ -11744,7 +11769,7 @@ var getIconSize = (size2) => {
|
|
|
11744
11769
|
return "small";
|
|
11745
11770
|
}
|
|
11746
11771
|
};
|
|
11747
|
-
var Input3 = (0,
|
|
11772
|
+
var Input3 = (0, import_styled_components77.default)(Input)`
|
|
11748
11773
|
&[type='search']::-webkit-search-decoration,
|
|
11749
11774
|
&[type='search']::-webkit-search-cancel-button,
|
|
11750
11775
|
&[type='search']::-webkit-search-results-button,
|
|
@@ -11753,45 +11778,45 @@ var Input3 = (0, import_styled_components76.default)(Input)`
|
|
|
11753
11778
|
}
|
|
11754
11779
|
padding-right: ${input4.base.paddingRight};
|
|
11755
11780
|
|
|
11756
|
-
${({ $componentSize }) =>
|
|
11781
|
+
${({ $componentSize }) => import_styled_components77.css`
|
|
11757
11782
|
padding-top: ${input4.sizes[$componentSize].paddingTop};
|
|
11758
11783
|
padding-bottom: ${input4.sizes[$componentSize].paddingBottom};
|
|
11759
11784
|
padding-left: ${input4.sizes[$componentSize].paddingLeft};
|
|
11760
11785
|
${getFontStyling(typographyTypes5[$componentSize])}
|
|
11761
11786
|
`}
|
|
11762
11787
|
`;
|
|
11763
|
-
var StyledSearchIcon = (0,
|
|
11788
|
+
var StyledSearchIcon = (0, import_styled_components77.default)(Icon)`
|
|
11764
11789
|
position: absolute;
|
|
11765
11790
|
left: ${searchIcon2.base.left};
|
|
11766
11791
|
color: ${searchIcon2.base.color};
|
|
11767
|
-
${({ $size }) =>
|
|
11792
|
+
${({ $size }) => import_styled_components77.css`
|
|
11768
11793
|
top: ${searchTokens.searchIcon[$size].top};
|
|
11769
11794
|
`}
|
|
11770
11795
|
z-index: 1;
|
|
11771
11796
|
`;
|
|
11772
|
-
var StyledClearButton = (0,
|
|
11797
|
+
var StyledClearButton = (0, import_styled_components77.default)(Button)`
|
|
11773
11798
|
position: absolute;
|
|
11774
11799
|
right: ${clearButton2.right};
|
|
11775
11800
|
color: ${clearButton2.color};
|
|
11776
11801
|
top: ${clearButton2.top};
|
|
11777
11802
|
`;
|
|
11778
|
-
var OuterContainer2 =
|
|
11803
|
+
var OuterContainer2 = import_styled_components77.default.div`
|
|
11779
11804
|
display: flex;
|
|
11780
11805
|
flex-direction: column;
|
|
11781
11806
|
gap: ${outerContainer6.gap};
|
|
11782
11807
|
`;
|
|
11783
|
-
var HorisontalContainer =
|
|
11784
|
-
${(props) => props.$hasSearchButton &&
|
|
11808
|
+
var HorisontalContainer = import_styled_components77.default.div`
|
|
11809
|
+
${(props) => props.$hasSearchButton && import_styled_components77.css`
|
|
11785
11810
|
display: grid;
|
|
11786
11811
|
grid-template-columns: 1fr auto;
|
|
11787
11812
|
gap: ${horisontalContainer2.gap};
|
|
11788
11813
|
`}
|
|
11789
11814
|
`;
|
|
11790
|
-
var InputContainer2 =
|
|
11815
|
+
var InputContainer2 = import_styled_components77.default.div`
|
|
11791
11816
|
position: relative;
|
|
11792
11817
|
display: flex;
|
|
11793
11818
|
`;
|
|
11794
|
-
var Search = (0,
|
|
11819
|
+
var Search = (0, import_react88.forwardRef)(
|
|
11795
11820
|
({
|
|
11796
11821
|
componentSize = "medium",
|
|
11797
11822
|
buttonProps,
|
|
@@ -11807,7 +11832,7 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11807
11832
|
...rest
|
|
11808
11833
|
}, ref) => {
|
|
11809
11834
|
var _a;
|
|
11810
|
-
const generatedId = (0,
|
|
11835
|
+
const generatedId = (0, import_react88.useId)();
|
|
11811
11836
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
11812
11837
|
const hasLabel = !!label3;
|
|
11813
11838
|
const tipId = derivativeIdGenerator(uniqueId, "tip");
|
|
@@ -11816,7 +11841,7 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11816
11841
|
uniqueId,
|
|
11817
11842
|
"suggestions-description"
|
|
11818
11843
|
);
|
|
11819
|
-
const [hasValue, setHasValue] = (0,
|
|
11844
|
+
const [hasValue, setHasValue] = (0, import_react88.useState)(!!value);
|
|
11820
11845
|
const context = useAutocompleteSearch();
|
|
11821
11846
|
const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
|
|
11822
11847
|
const handleChange = (e) => {
|
|
@@ -11835,18 +11860,18 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11835
11860
|
} = buttonProps != null ? buttonProps : {};
|
|
11836
11861
|
const hasSuggestions = !!context.suggestions;
|
|
11837
11862
|
const showSearchButton = !!buttonProps && !!onClick;
|
|
11838
|
-
return /* @__PURE__ */ (0,
|
|
11839
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
11840
|
-
/* @__PURE__ */ (0,
|
|
11841
|
-
/* @__PURE__ */ (0,
|
|
11863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(OuterContainer2, { children: [
|
|
11864
|
+
hasLabel && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(Label, { htmlFor: uniqueId, children: label3 }),
|
|
11865
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsxs)("div", { children: [
|
|
11866
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(
|
|
11842
11867
|
HorisontalContainer,
|
|
11843
11868
|
{
|
|
11844
11869
|
$hasSearchButton: showSearchButton,
|
|
11845
11870
|
className,
|
|
11846
11871
|
style,
|
|
11847
11872
|
children: [
|
|
11848
|
-
/* @__PURE__ */ (0,
|
|
11849
|
-
/* @__PURE__ */ (0,
|
|
11873
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(InputContainer2, { children: [
|
|
11874
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
11850
11875
|
StyledSearchIcon,
|
|
11851
11876
|
{
|
|
11852
11877
|
icon: SearchIcon,
|
|
@@ -11854,7 +11879,7 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11854
11879
|
iconSize: getIconSize(componentSize)
|
|
11855
11880
|
}
|
|
11856
11881
|
),
|
|
11857
|
-
/* @__PURE__ */ (0,
|
|
11882
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
11858
11883
|
Input3,
|
|
11859
11884
|
{
|
|
11860
11885
|
...rest,
|
|
@@ -11877,8 +11902,8 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11877
11902
|
role: hasSuggestions ? "combobox" : void 0
|
|
11878
11903
|
}
|
|
11879
11904
|
),
|
|
11880
|
-
hasSuggestions && /* @__PURE__ */ (0,
|
|
11881
|
-
/* @__PURE__ */ (0,
|
|
11905
|
+
hasSuggestions && /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(import_jsx_runtime246.Fragment, { children: [
|
|
11906
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
11882
11907
|
SearchSuggestions,
|
|
11883
11908
|
{
|
|
11884
11909
|
id: suggestionsId,
|
|
@@ -11890,9 +11915,9 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11890
11915
|
componentSize
|
|
11891
11916
|
}
|
|
11892
11917
|
),
|
|
11893
|
-
/* @__PURE__ */ (0,
|
|
11918
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(VisuallyHidden, { id: suggestionsDescriptionId, as: "span", children: "Bla i s\xF8keforslag med piltaster n\xE5r listen er utvidet." })
|
|
11894
11919
|
] }),
|
|
11895
|
-
hasValue && /* @__PURE__ */ (0,
|
|
11920
|
+
hasValue && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
11896
11921
|
StyledClearButton,
|
|
11897
11922
|
{
|
|
11898
11923
|
icon: CloseSmallIcon,
|
|
@@ -11904,7 +11929,7 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11904
11929
|
}
|
|
11905
11930
|
)
|
|
11906
11931
|
] }),
|
|
11907
|
-
showSearchButton && /* @__PURE__ */ (0,
|
|
11932
|
+
showSearchButton && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
11908
11933
|
Button,
|
|
11909
11934
|
{
|
|
11910
11935
|
size: componentSize,
|
|
@@ -11924,8 +11949,8 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11924
11949
|
Search.displayName = "Search";
|
|
11925
11950
|
|
|
11926
11951
|
// src/components/Search/SearchAutocompleteWrapper.tsx
|
|
11927
|
-
var
|
|
11928
|
-
var
|
|
11952
|
+
var import_react89 = require("react");
|
|
11953
|
+
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
11929
11954
|
var SearchAutocompleteWrapper = (props) => {
|
|
11930
11955
|
const {
|
|
11931
11956
|
value,
|
|
@@ -11936,12 +11961,12 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
11936
11961
|
onSuggestionSelection,
|
|
11937
11962
|
children
|
|
11938
11963
|
} = props;
|
|
11939
|
-
const [inputValue, setInputValue] = (0,
|
|
11940
|
-
const [suggestions, setSuggestions] = (0,
|
|
11941
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
11964
|
+
const [inputValue, setInputValue] = (0, import_react89.useState)(value != null ? value : "");
|
|
11965
|
+
const [suggestions, setSuggestions] = (0, import_react89.useState)([]);
|
|
11966
|
+
const [showSuggestions, setShowSuggestions] = (0, import_react89.useState)(false);
|
|
11942
11967
|
const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
|
|
11943
11968
|
const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
|
|
11944
|
-
(0,
|
|
11969
|
+
(0, import_react89.useEffect)(() => {
|
|
11945
11970
|
if (suggestions.length > 0) {
|
|
11946
11971
|
openSuggestions();
|
|
11947
11972
|
} else {
|
|
@@ -11986,8 +12011,8 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
11986
12011
|
const handleSetInputValue = (value2) => {
|
|
11987
12012
|
setInputValue(value2 != null ? value2 : "");
|
|
11988
12013
|
};
|
|
11989
|
-
const inputRef = (0,
|
|
11990
|
-
const suggestionsRef = (0,
|
|
12014
|
+
const inputRef = (0, import_react89.useRef)(null);
|
|
12015
|
+
const suggestionsRef = (0, import_react89.useRef)(null);
|
|
11991
12016
|
useOnClickOutside([inputRef.current, suggestionsRef.current], () => {
|
|
11992
12017
|
closeSuggestions();
|
|
11993
12018
|
});
|
|
@@ -12001,7 +12026,7 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
12001
12026
|
inputValue,
|
|
12002
12027
|
onSugggestionClick: handleSuggestionClick
|
|
12003
12028
|
};
|
|
12004
|
-
return /* @__PURE__ */ (0,
|
|
12029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(AutocompleteSearchContext.Provider, { value: contextProps, children });
|
|
12005
12030
|
};
|
|
12006
12031
|
SearchAutocompleteWrapper.displayName = "SearchAutocompleteWrapper";
|
|
12007
12032
|
|
|
@@ -12011,17 +12036,17 @@ Search2.AutocompleteWrapper = SearchAutocompleteWrapper;
|
|
|
12011
12036
|
Search2.Suggestions = SearchSuggestions;
|
|
12012
12037
|
|
|
12013
12038
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
12014
|
-
var
|
|
12039
|
+
var import_react91 = require("react");
|
|
12015
12040
|
|
|
12016
12041
|
// src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
|
|
12017
|
-
var
|
|
12018
|
-
var CheckboxGroupContext = (0,
|
|
12042
|
+
var import_react90 = require("react");
|
|
12043
|
+
var CheckboxGroupContext = (0, import_react90.createContext)(null);
|
|
12019
12044
|
var useCheckboxGroup = () => {
|
|
12020
|
-
return (0,
|
|
12045
|
+
return (0, import_react90.useContext)(CheckboxGroupContext);
|
|
12021
12046
|
};
|
|
12022
12047
|
|
|
12023
12048
|
// src/components/SelectionControl/SelectionControl.styles.tsx
|
|
12024
|
-
var
|
|
12049
|
+
var import_styled_components78 = __toESM(require("styled-components"));
|
|
12025
12050
|
|
|
12026
12051
|
// src/components/SelectionControl/SelectionControl.tokens.tsx
|
|
12027
12052
|
var import_dds_design_tokens55 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -12141,7 +12166,7 @@ var {
|
|
|
12141
12166
|
groupContainer: groupContainer2,
|
|
12142
12167
|
outerGroupContainer: outerGroupContainer2
|
|
12143
12168
|
} = selectionControlTokens;
|
|
12144
|
-
var CustomSelectionControl =
|
|
12169
|
+
var CustomSelectionControl = import_styled_components78.default.span`
|
|
12145
12170
|
position: absolute;
|
|
12146
12171
|
left: 0;
|
|
12147
12172
|
box-sizing: border-box;
|
|
@@ -12151,7 +12176,7 @@ var CustomSelectionControl = import_styled_components77.default.span`
|
|
|
12151
12176
|
border-radius: ${selectionControl2.base.borderRadius};
|
|
12152
12177
|
height: ${selectionControl2.base.height};
|
|
12153
12178
|
width: ${selectionControl2.base.width};
|
|
12154
|
-
${({ $controlType }) => $controlType === "radio" &&
|
|
12179
|
+
${({ $controlType }) => $controlType === "radio" && import_styled_components78.css`
|
|
12155
12180
|
border-radius: 50%;
|
|
12156
12181
|
`}
|
|
12157
12182
|
&:after {
|
|
@@ -12160,7 +12185,7 @@ var CustomSelectionControl = import_styled_components77.default.span`
|
|
|
12160
12185
|
display: none;
|
|
12161
12186
|
}
|
|
12162
12187
|
`;
|
|
12163
|
-
var Container13 =
|
|
12188
|
+
var Container13 = import_styled_components78.default.label`
|
|
12164
12189
|
position: relative;
|
|
12165
12190
|
display: flex;
|
|
12166
12191
|
align-items: center;
|
|
@@ -12168,9 +12193,9 @@ var Container13 = import_styled_components77.default.label`
|
|
|
12168
12193
|
user-select: none;
|
|
12169
12194
|
width: fit-content;
|
|
12170
12195
|
color: ${container14.color};
|
|
12171
|
-
${({ $hasLabel }) => $hasLabel ?
|
|
12196
|
+
${({ $hasLabel }) => $hasLabel ? import_styled_components78.css`
|
|
12172
12197
|
padding-left: ${container14.withLabel.paddingLeft};
|
|
12173
|
-
` :
|
|
12198
|
+
` : import_styled_components78.css`
|
|
12174
12199
|
padding: ${container14.noLabel.padding};
|
|
12175
12200
|
`}
|
|
12176
12201
|
|
|
@@ -12214,7 +12239,7 @@ var Container13 = import_styled_components77.default.label`
|
|
|
12214
12239
|
border-color: ${selectionControl2.checked.hover.borderColor};
|
|
12215
12240
|
}
|
|
12216
12241
|
|
|
12217
|
-
${({ $error }) => $error &&
|
|
12242
|
+
${({ $error }) => $error && import_styled_components78.css`
|
|
12218
12243
|
&:hover input:enabled ~ ${CustomSelectionControl} {
|
|
12219
12244
|
background-color: ${selectionControl2.hover.danger.backgroundColor};
|
|
12220
12245
|
box-shadow: ${selectionControl2.hover.danger.boxShadow};
|
|
@@ -12248,14 +12273,14 @@ var Container13 = import_styled_components77.default.label`
|
|
|
12248
12273
|
display: block;
|
|
12249
12274
|
}
|
|
12250
12275
|
|
|
12251
|
-
${({ $readOnly }) => $readOnly &&
|
|
12276
|
+
${({ $readOnly }) => $readOnly && import_styled_components78.css`
|
|
12252
12277
|
cursor: default;
|
|
12253
12278
|
`}
|
|
12254
|
-
${({ disabled }) => disabled &&
|
|
12279
|
+
${({ disabled }) => disabled && import_styled_components78.css`
|
|
12255
12280
|
cursor: not-allowed;
|
|
12256
12281
|
color: ${container14.disabled.color};
|
|
12257
12282
|
`}
|
|
12258
|
-
${({ $controlType }) => $controlType === "checkbox" ?
|
|
12283
|
+
${({ $controlType }) => $controlType === "checkbox" ? import_styled_components78.css`
|
|
12259
12284
|
${CustomSelectionControl}:after {
|
|
12260
12285
|
border: solid ${checkmark2.checkbox.borderColor};
|
|
12261
12286
|
|
|
@@ -12274,7 +12299,7 @@ var Container13 = import_styled_components77.default.label`
|
|
|
12274
12299
|
height: 1px;
|
|
12275
12300
|
transform: none;
|
|
12276
12301
|
}
|
|
12277
|
-
` :
|
|
12302
|
+
` : import_styled_components78.css`
|
|
12278
12303
|
${CustomSelectionControl}:after {
|
|
12279
12304
|
border-radius: 50%;
|
|
12280
12305
|
background-color: ${checkmark2.radio.backgroundColor};
|
|
@@ -12285,22 +12310,22 @@ var Container13 = import_styled_components77.default.label`
|
|
|
12285
12310
|
}
|
|
12286
12311
|
`}
|
|
12287
12312
|
`;
|
|
12288
|
-
var OuterGroupContainer =
|
|
12313
|
+
var OuterGroupContainer = import_styled_components78.default.div`
|
|
12289
12314
|
display: flex;
|
|
12290
12315
|
flex-direction: column;
|
|
12291
12316
|
gap: ${outerGroupContainer2.gap};
|
|
12292
12317
|
`;
|
|
12293
|
-
var GroupContainer =
|
|
12318
|
+
var GroupContainer = import_styled_components78.default.div`
|
|
12294
12319
|
display: flex;
|
|
12295
|
-
${({ $direction }) =>
|
|
12320
|
+
${({ $direction }) => import_styled_components78.css`
|
|
12296
12321
|
flex-direction: ${$direction};
|
|
12297
12322
|
gap: ${groupContainer2[$direction].gap};
|
|
12298
12323
|
`}
|
|
12299
12324
|
`;
|
|
12300
12325
|
|
|
12301
12326
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
12302
|
-
var
|
|
12303
|
-
var Checkbox = (0,
|
|
12327
|
+
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
12328
|
+
var Checkbox = (0, import_react91.forwardRef)(
|
|
12304
12329
|
(props, ref) => {
|
|
12305
12330
|
const {
|
|
12306
12331
|
id,
|
|
@@ -12315,7 +12340,7 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12315
12340
|
htmlProps = {},
|
|
12316
12341
|
...rest
|
|
12317
12342
|
} = props;
|
|
12318
|
-
const generatedId = (0,
|
|
12343
|
+
const generatedId = (0, import_react91.useId)();
|
|
12319
12344
|
const uniqueId = id != null ? id : `${generatedId}-checkbox`;
|
|
12320
12345
|
const checkboxGroup = useCheckboxGroup();
|
|
12321
12346
|
const hasLabel = !!label3;
|
|
@@ -12324,7 +12349,7 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12324
12349
|
className: htmlPropsClassName,
|
|
12325
12350
|
...restHtmlProps
|
|
12326
12351
|
} = htmlProps;
|
|
12327
|
-
return /* @__PURE__ */ (0,
|
|
12352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime248.jsxs)(
|
|
12328
12353
|
Container13,
|
|
12329
12354
|
{
|
|
12330
12355
|
$error: error || (checkboxGroup == null ? void 0 : checkboxGroup.error),
|
|
@@ -12336,7 +12361,7 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12336
12361
|
className: cn(className, htmlPropsClassName),
|
|
12337
12362
|
style,
|
|
12338
12363
|
children: [
|
|
12339
|
-
/* @__PURE__ */ (0,
|
|
12364
|
+
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(
|
|
12340
12365
|
HiddenInput,
|
|
12341
12366
|
{
|
|
12342
12367
|
...getBaseHTMLProps(uniqueId, restHtmlProps, rest),
|
|
@@ -12356,8 +12381,8 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12356
12381
|
"data-indeterminate": indeterminate
|
|
12357
12382
|
}
|
|
12358
12383
|
),
|
|
12359
|
-
/* @__PURE__ */ (0,
|
|
12360
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
12384
|
+
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(CustomSelectionControl, { $controlType: "checkbox" }),
|
|
12385
|
+
hasLabel && /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(Typography, { ...selectionControlTypographyProps, children: label3 })
|
|
12361
12386
|
]
|
|
12362
12387
|
}
|
|
12363
12388
|
);
|
|
@@ -12366,8 +12391,8 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12366
12391
|
Checkbox.displayName = "Checkbox";
|
|
12367
12392
|
|
|
12368
12393
|
// src/components/SelectionControl/Checkbox/CheckboxGroup.tsx
|
|
12369
|
-
var
|
|
12370
|
-
var
|
|
12394
|
+
var import_react92 = require("react");
|
|
12395
|
+
var import_jsx_runtime249 = require("react/jsx-runtime");
|
|
12371
12396
|
var CheckboxGroup = (props) => {
|
|
12372
12397
|
const {
|
|
12373
12398
|
label: label3,
|
|
@@ -12385,7 +12410,7 @@ var CheckboxGroup = (props) => {
|
|
|
12385
12410
|
...rest
|
|
12386
12411
|
} = props;
|
|
12387
12412
|
const { "aria-required": ariaRequired } = htmlProps;
|
|
12388
|
-
const generatedId = (0,
|
|
12413
|
+
const generatedId = (0, import_react92.useId)();
|
|
12389
12414
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-checkboxGroup`;
|
|
12390
12415
|
const hasErrorMessage = !!errorMessage;
|
|
12391
12416
|
const showRequiredMarker = required || ariaRequired;
|
|
@@ -12399,7 +12424,7 @@ var CheckboxGroup = (props) => {
|
|
|
12399
12424
|
disabled,
|
|
12400
12425
|
readOnly
|
|
12401
12426
|
};
|
|
12402
|
-
return /* @__PURE__ */ (0,
|
|
12427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
|
|
12403
12428
|
OuterGroupContainer,
|
|
12404
12429
|
{
|
|
12405
12430
|
...getBaseHTMLProps(
|
|
@@ -12409,7 +12434,7 @@ var CheckboxGroup = (props) => {
|
|
|
12409
12434
|
rest
|
|
12410
12435
|
),
|
|
12411
12436
|
children: [
|
|
12412
|
-
/* @__PURE__ */ (0,
|
|
12437
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
|
|
12413
12438
|
Typography,
|
|
12414
12439
|
{
|
|
12415
12440
|
as: "span",
|
|
@@ -12418,12 +12443,12 @@ var CheckboxGroup = (props) => {
|
|
|
12418
12443
|
children: [
|
|
12419
12444
|
label3,
|
|
12420
12445
|
" ",
|
|
12421
|
-
showRequiredMarker && /* @__PURE__ */ (0,
|
|
12446
|
+
showRequiredMarker && /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(RequiredMarker, {})
|
|
12422
12447
|
]
|
|
12423
12448
|
}
|
|
12424
12449
|
),
|
|
12425
12450
|
renderInputMessage(tip, tipId),
|
|
12426
|
-
/* @__PURE__ */ (0,
|
|
12451
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsx)(CheckboxGroupContext.Provider, { value: { ...contextProps }, children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
12427
12452
|
GroupContainer,
|
|
12428
12453
|
{
|
|
12429
12454
|
role: "group",
|
|
@@ -12441,17 +12466,17 @@ var CheckboxGroup = (props) => {
|
|
|
12441
12466
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
12442
12467
|
|
|
12443
12468
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
12444
|
-
var
|
|
12469
|
+
var import_react94 = require("react");
|
|
12445
12470
|
|
|
12446
12471
|
// src/components/SelectionControl/RadioButton/RadioButtonGroupContext.tsx
|
|
12447
|
-
var
|
|
12448
|
-
var RadioButtonGroupContext = (0,
|
|
12472
|
+
var import_react93 = require("react");
|
|
12473
|
+
var RadioButtonGroupContext = (0, import_react93.createContext)(null);
|
|
12449
12474
|
var useRadioButtonGroup = () => {
|
|
12450
|
-
return (0,
|
|
12475
|
+
return (0, import_react93.useContext)(RadioButtonGroupContext);
|
|
12451
12476
|
};
|
|
12452
12477
|
|
|
12453
12478
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
12454
|
-
var
|
|
12479
|
+
var import_jsx_runtime250 = require("react/jsx-runtime");
|
|
12455
12480
|
var isValueEqualToGroupValueOrFalsy = (value, group4) => {
|
|
12456
12481
|
if (typeof value !== "undefined" && value !== null && group4) {
|
|
12457
12482
|
if (typeof value === "number") {
|
|
@@ -12461,7 +12486,7 @@ var isValueEqualToGroupValueOrFalsy = (value, group4) => {
|
|
|
12461
12486
|
}
|
|
12462
12487
|
return !!value;
|
|
12463
12488
|
};
|
|
12464
|
-
var RadioButton = (0,
|
|
12489
|
+
var RadioButton = (0, import_react94.forwardRef)(
|
|
12465
12490
|
(props, ref) => {
|
|
12466
12491
|
const {
|
|
12467
12492
|
id,
|
|
@@ -12485,7 +12510,7 @@ var RadioButton = (0, import_react93.forwardRef)(
|
|
|
12485
12510
|
style,
|
|
12486
12511
|
...restHtmlProps
|
|
12487
12512
|
} = htmlProps;
|
|
12488
|
-
const generatedId = (0,
|
|
12513
|
+
const generatedId = (0, import_react94.useId)();
|
|
12489
12514
|
const uniqueId = id != null ? id : `${generatedId}-radioButton`;
|
|
12490
12515
|
const hasLabel = !!label3;
|
|
12491
12516
|
const radioButtonGroup = useRadioButtonGroup();
|
|
@@ -12510,7 +12535,7 @@ var RadioButton = (0, import_react93.forwardRef)(
|
|
|
12510
12535
|
"aria-describedby": describedByIds.length > 0 ? describedByIds.join(" ") : void 0,
|
|
12511
12536
|
"aria-invalid": error || (radioButtonGroup == null ? void 0 : radioButtonGroup.error) ? true : void 0
|
|
12512
12537
|
};
|
|
12513
|
-
return /* @__PURE__ */ (0,
|
|
12538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)(
|
|
12514
12539
|
Container13,
|
|
12515
12540
|
{
|
|
12516
12541
|
$error: error || (radioButtonGroup == null ? void 0 : radioButtonGroup.error),
|
|
@@ -12522,9 +12547,9 @@ var RadioButton = (0, import_react93.forwardRef)(
|
|
|
12522
12547
|
htmlFor: uniqueId,
|
|
12523
12548
|
$controlType: "radio",
|
|
12524
12549
|
children: [
|
|
12525
|
-
/* @__PURE__ */ (0,
|
|
12526
|
-
/* @__PURE__ */ (0,
|
|
12527
|
-
/* @__PURE__ */ (0,
|
|
12550
|
+
/* @__PURE__ */ (0, import_jsx_runtime250.jsx)(HiddenInput, { ...inputProps, ref }),
|
|
12551
|
+
/* @__PURE__ */ (0, import_jsx_runtime250.jsx)(CustomSelectionControl, { $controlType: "radio" }),
|
|
12552
|
+
/* @__PURE__ */ (0, import_jsx_runtime250.jsx)(Typography, { ...selectionControlTypographyProps, children: children != null ? children : label3 })
|
|
12528
12553
|
]
|
|
12529
12554
|
}
|
|
12530
12555
|
);
|
|
@@ -12533,8 +12558,8 @@ var RadioButton = (0, import_react93.forwardRef)(
|
|
|
12533
12558
|
RadioButton.displayName = "RadioButton";
|
|
12534
12559
|
|
|
12535
12560
|
// src/components/SelectionControl/RadioButton/RadioButtonGroup.tsx
|
|
12536
|
-
var
|
|
12537
|
-
var
|
|
12561
|
+
var import_react95 = require("react");
|
|
12562
|
+
var import_jsx_runtime251 = require("react/jsx-runtime");
|
|
12538
12563
|
var RadioButtonGroupInner = (props, ref) => {
|
|
12539
12564
|
const {
|
|
12540
12565
|
name,
|
|
@@ -12555,8 +12580,8 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12555
12580
|
...rest
|
|
12556
12581
|
} = props;
|
|
12557
12582
|
const { "aria-required": ariaRequired = false } = htmlProps;
|
|
12558
|
-
const [groupValue, setGroupValue] = (0,
|
|
12559
|
-
const generatedId = (0,
|
|
12583
|
+
const [groupValue, setGroupValue] = (0, import_react95.useState)(value);
|
|
12584
|
+
const generatedId = (0, import_react95.useId)();
|
|
12560
12585
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-radioButtonGroup`;
|
|
12561
12586
|
const handleChange = combineHandlers(
|
|
12562
12587
|
(e) => setGroupValue(e.target.value),
|
|
@@ -12576,7 +12601,7 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12576
12601
|
value: groupValue,
|
|
12577
12602
|
onChange: handleChange
|
|
12578
12603
|
};
|
|
12579
|
-
return /* @__PURE__ */ (0,
|
|
12604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(
|
|
12580
12605
|
OuterGroupContainer,
|
|
12581
12606
|
{
|
|
12582
12607
|
...getBaseHTMLProps(
|
|
@@ -12587,7 +12612,7 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12587
12612
|
),
|
|
12588
12613
|
ref,
|
|
12589
12614
|
children: [
|
|
12590
|
-
/* @__PURE__ */ (0,
|
|
12615
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(
|
|
12591
12616
|
Typography,
|
|
12592
12617
|
{
|
|
12593
12618
|
as: "span",
|
|
@@ -12596,12 +12621,12 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12596
12621
|
children: [
|
|
12597
12622
|
label3,
|
|
12598
12623
|
" ",
|
|
12599
|
-
showRequiredMarker && /* @__PURE__ */ (0,
|
|
12624
|
+
showRequiredMarker && /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(RequiredMarker, {})
|
|
12600
12625
|
]
|
|
12601
12626
|
}
|
|
12602
12627
|
),
|
|
12603
12628
|
renderInputMessage(tip, tipId),
|
|
12604
|
-
/* @__PURE__ */ (0,
|
|
12629
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(RadioButtonGroupContext.Provider, { value: { ...contextProps }, children: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
|
|
12605
12630
|
GroupContainer,
|
|
12606
12631
|
{
|
|
12607
12632
|
role: "radiogroup",
|
|
@@ -12617,12 +12642,12 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12617
12642
|
}
|
|
12618
12643
|
);
|
|
12619
12644
|
};
|
|
12620
|
-
var RadioButtonGroup = (0,
|
|
12645
|
+
var RadioButtonGroup = (0, import_react95.forwardRef)(RadioButtonGroupInner);
|
|
12621
12646
|
RadioButtonGroup.displayName = "RadioButtonGroup";
|
|
12622
12647
|
|
|
12623
12648
|
// src/components/SkipToContent/SkipToContent.tsx
|
|
12624
|
-
var
|
|
12625
|
-
var
|
|
12649
|
+
var import_react96 = require("react");
|
|
12650
|
+
var import_styled_components79 = __toESM(require("styled-components"));
|
|
12626
12651
|
|
|
12627
12652
|
// src/components/SkipToContent/SkipToContent.tokens.tsx
|
|
12628
12653
|
var import_dds_design_tokens56 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -12645,9 +12670,9 @@ var skipToContentTokens = {
|
|
|
12645
12670
|
};
|
|
12646
12671
|
|
|
12647
12672
|
// src/components/SkipToContent/SkipToContent.tsx
|
|
12648
|
-
var
|
|
12673
|
+
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
12649
12674
|
var { wrapper: wrapper6, link: link5 } = skipToContentTokens;
|
|
12650
|
-
var Wrapper5 =
|
|
12675
|
+
var Wrapper5 = import_styled_components79.default.div`
|
|
12651
12676
|
box-sizing: border-box;
|
|
12652
12677
|
position: absolute;
|
|
12653
12678
|
top: ${({ $top: top }) => top};
|
|
@@ -12674,7 +12699,7 @@ var Wrapper5 = import_styled_components78.default.div`
|
|
|
12674
12699
|
opacity: 1;
|
|
12675
12700
|
}
|
|
12676
12701
|
`;
|
|
12677
|
-
var Link4 =
|
|
12702
|
+
var Link4 = import_styled_components79.default.a`
|
|
12678
12703
|
text-decoration: none;
|
|
12679
12704
|
color: ${link5.base.color};
|
|
12680
12705
|
${getFontStyling(defaultTypographyType)}
|
|
@@ -12689,7 +12714,7 @@ var Link4 = import_styled_components78.default.a`
|
|
|
12689
12714
|
color: ${link5.base.color};
|
|
12690
12715
|
}
|
|
12691
12716
|
`;
|
|
12692
|
-
var SkipToContent = (0,
|
|
12717
|
+
var SkipToContent = (0, import_react96.forwardRef)(
|
|
12693
12718
|
(props, ref) => {
|
|
12694
12719
|
const {
|
|
12695
12720
|
text = "Til hovedinnhold",
|
|
@@ -12704,13 +12729,13 @@ var SkipToContent = (0, import_react95.forwardRef)(
|
|
|
12704
12729
|
style,
|
|
12705
12730
|
...restHtmlProps
|
|
12706
12731
|
} = htmlProps;
|
|
12707
|
-
return /* @__PURE__ */ (0,
|
|
12732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
12708
12733
|
Wrapper5,
|
|
12709
12734
|
{
|
|
12710
12735
|
$top: top,
|
|
12711
12736
|
className: cn(className, htmlPropsClassName),
|
|
12712
12737
|
style,
|
|
12713
|
-
children: /* @__PURE__ */ (0,
|
|
12738
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(Link4, { ...getBaseHTMLProps(id, restHtmlProps, rest), ref, children: text })
|
|
12714
12739
|
}
|
|
12715
12740
|
);
|
|
12716
12741
|
}
|
|
@@ -12718,8 +12743,8 @@ var SkipToContent = (0, import_react95.forwardRef)(
|
|
|
12718
12743
|
SkipToContent.displayName = "SkipToContent";
|
|
12719
12744
|
|
|
12720
12745
|
// src/components/SplitButton/SplitButton.tsx
|
|
12721
|
-
var
|
|
12722
|
-
var
|
|
12746
|
+
var import_react97 = require("react");
|
|
12747
|
+
var import_styled_components80 = __toESM(require("styled-components"));
|
|
12723
12748
|
|
|
12724
12749
|
// src/components/SplitButton/SplitButton.tokens.ts
|
|
12725
12750
|
var import_dds_design_tokens57 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -12733,11 +12758,11 @@ var tokens3 = {
|
|
|
12733
12758
|
};
|
|
12734
12759
|
|
|
12735
12760
|
// src/components/SplitButton/SplitButton.tsx
|
|
12736
|
-
var
|
|
12737
|
-
var Container14 =
|
|
12761
|
+
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
12762
|
+
var Container14 = import_styled_components80.default.div`
|
|
12738
12763
|
display: flex;
|
|
12739
12764
|
`;
|
|
12740
|
-
var MainButton = (0,
|
|
12765
|
+
var MainButton = (0, import_styled_components80.default)(Button)`
|
|
12741
12766
|
border-top-right-radius: 0;
|
|
12742
12767
|
border-bottom-right-radius: 0;
|
|
12743
12768
|
border-right: none;
|
|
@@ -12746,7 +12771,7 @@ var MainButton = (0, import_styled_components79.default)(Button)`
|
|
|
12746
12771
|
z-index: 0;
|
|
12747
12772
|
}
|
|
12748
12773
|
`;
|
|
12749
|
-
var OptionButton = (0,
|
|
12774
|
+
var OptionButton = (0, import_styled_components80.default)(Button)`
|
|
12750
12775
|
border-top-left-radius: 0;
|
|
12751
12776
|
border-bottom-left-radius: 0;
|
|
12752
12777
|
|
|
@@ -12764,7 +12789,7 @@ var OptionButton = (0, import_styled_components79.default)(Button)`
|
|
|
12764
12789
|
${(props) => props.purpose === "primary" && `border-left: ${tokens3.mainButton.primary.borderLeft}`};
|
|
12765
12790
|
}
|
|
12766
12791
|
`;
|
|
12767
|
-
var SplitButton = (0,
|
|
12792
|
+
var SplitButton = (0, import_react97.forwardRef)(
|
|
12768
12793
|
(props, ref) => {
|
|
12769
12794
|
const {
|
|
12770
12795
|
size: size2,
|
|
@@ -12772,14 +12797,14 @@ var SplitButton = (0, import_react96.forwardRef)(
|
|
|
12772
12797
|
secondaryActions,
|
|
12773
12798
|
purpose = "primary"
|
|
12774
12799
|
} = props;
|
|
12775
|
-
const [isOpen, setIsOpen] = (0,
|
|
12800
|
+
const [isOpen, setIsOpen] = (0, import_react97.useState)(false);
|
|
12776
12801
|
const buttonStyleProps = {
|
|
12777
12802
|
appearance: "filled",
|
|
12778
12803
|
purpose,
|
|
12779
12804
|
size: size2
|
|
12780
12805
|
};
|
|
12781
|
-
return /* @__PURE__ */ (0,
|
|
12782
|
-
/* @__PURE__ */ (0,
|
|
12806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(Container14, { ref, children: [
|
|
12807
|
+
/* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
|
|
12783
12808
|
MainButton,
|
|
12784
12809
|
{
|
|
12785
12810
|
...buttonStyleProps,
|
|
@@ -12787,8 +12812,8 @@ var SplitButton = (0, import_react96.forwardRef)(
|
|
|
12787
12812
|
iconPosition: "left"
|
|
12788
12813
|
}
|
|
12789
12814
|
),
|
|
12790
|
-
/* @__PURE__ */ (0,
|
|
12791
|
-
/* @__PURE__ */ (0,
|
|
12815
|
+
/* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(OverflowMenuGroup, { onToggle: () => setIsOpen(!isOpen), children: [
|
|
12816
|
+
/* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
|
|
12792
12817
|
OptionButton,
|
|
12793
12818
|
{
|
|
12794
12819
|
...buttonStyleProps,
|
|
@@ -12797,7 +12822,7 @@ var SplitButton = (0, import_react96.forwardRef)(
|
|
|
12797
12822
|
purpose
|
|
12798
12823
|
}
|
|
12799
12824
|
),
|
|
12800
|
-
/* @__PURE__ */ (0,
|
|
12825
|
+
/* @__PURE__ */ (0, import_jsx_runtime253.jsx)(OverflowMenu, { items: secondaryActions, placement: "bottom-end" })
|
|
12801
12826
|
] })
|
|
12802
12827
|
] });
|
|
12803
12828
|
}
|
|
@@ -12805,50 +12830,50 @@ var SplitButton = (0, import_react96.forwardRef)(
|
|
|
12805
12830
|
SplitButton.displayName = "SplitButton";
|
|
12806
12831
|
|
|
12807
12832
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
12808
|
-
var
|
|
12809
|
-
var
|
|
12833
|
+
var import_react107 = require("react");
|
|
12834
|
+
var import_styled_components89 = __toESM(require("styled-components"));
|
|
12810
12835
|
|
|
12811
12836
|
// src/components/Table/collapsible/Table.context.tsx
|
|
12812
|
-
var
|
|
12813
|
-
var CollapsibleTableContext = (0,
|
|
12837
|
+
var import_react98 = require("react");
|
|
12838
|
+
var CollapsibleTableContext = (0, import_react98.createContext)({
|
|
12814
12839
|
headerValues: [],
|
|
12815
12840
|
definingColumnIndex: [0]
|
|
12816
12841
|
});
|
|
12817
|
-
var useCollapsibleTableContext = () => (0,
|
|
12842
|
+
var useCollapsibleTableContext = () => (0, import_react98.useContext)(CollapsibleTableContext);
|
|
12818
12843
|
|
|
12819
12844
|
// src/components/Table/normal/Body.tsx
|
|
12820
|
-
var
|
|
12821
|
-
var
|
|
12822
|
-
var
|
|
12823
|
-
var StyledBody =
|
|
12824
|
-
var Body2 = (0,
|
|
12845
|
+
var import_react99 = require("react");
|
|
12846
|
+
var import_styled_components81 = __toESM(require("styled-components"));
|
|
12847
|
+
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
12848
|
+
var StyledBody = import_styled_components81.default.tbody``;
|
|
12849
|
+
var Body2 = (0, import_react99.forwardRef)(
|
|
12825
12850
|
({ children, ...rest }, ref) => {
|
|
12826
12851
|
const bodyProps = {
|
|
12827
12852
|
...rest
|
|
12828
12853
|
};
|
|
12829
|
-
return /* @__PURE__ */ (0,
|
|
12854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(StyledBody, { ref, ...bodyProps, children });
|
|
12830
12855
|
}
|
|
12831
12856
|
);
|
|
12832
12857
|
Body2.displayName = "Table.Body";
|
|
12833
12858
|
|
|
12834
12859
|
// src/components/Table/normal/Cell.tsx
|
|
12835
|
-
var
|
|
12836
|
-
var
|
|
12860
|
+
var import_react101 = require("react");
|
|
12861
|
+
var import_styled_components83 = __toESM(require("styled-components"));
|
|
12837
12862
|
|
|
12838
12863
|
// src/components/Table/normal/Head.tsx
|
|
12839
|
-
var
|
|
12840
|
-
var
|
|
12841
|
-
var
|
|
12842
|
-
var StyledHead =
|
|
12843
|
-
var Head = (0,
|
|
12864
|
+
var import_react100 = require("react");
|
|
12865
|
+
var import_styled_components82 = __toESM(require("styled-components"));
|
|
12866
|
+
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
12867
|
+
var StyledHead = import_styled_components82.default.thead``;
|
|
12868
|
+
var Head = (0, import_react100.forwardRef)(
|
|
12844
12869
|
({ children, ...rest }, ref) => {
|
|
12845
|
-
return /* @__PURE__ */ (0,
|
|
12870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(StyledHead, { ref, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(HeadContext.Provider, { value: true, children }) });
|
|
12846
12871
|
}
|
|
12847
12872
|
);
|
|
12848
12873
|
Head.displayName = "Table.Head";
|
|
12849
|
-
var HeadContext = (0,
|
|
12874
|
+
var HeadContext = (0, import_react100.createContext)(false);
|
|
12850
12875
|
function useIsInTableHead() {
|
|
12851
|
-
const isInTableHead = (0,
|
|
12876
|
+
const isInTableHead = (0, import_react100.useContext)(HeadContext);
|
|
12852
12877
|
return isInTableHead;
|
|
12853
12878
|
}
|
|
12854
12879
|
|
|
@@ -12925,20 +12950,20 @@ var tableTokens = {
|
|
|
12925
12950
|
};
|
|
12926
12951
|
|
|
12927
12952
|
// src/components/Table/normal/Cell.tsx
|
|
12928
|
-
var
|
|
12953
|
+
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
12929
12954
|
var { cell: cell3 } = tableTokens;
|
|
12930
12955
|
var getLayoutStyle = (layout) => {
|
|
12931
12956
|
switch (layout) {
|
|
12932
12957
|
case "center":
|
|
12933
|
-
return
|
|
12958
|
+
return import_styled_components83.css`
|
|
12934
12959
|
justify-content: center;
|
|
12935
12960
|
`;
|
|
12936
12961
|
case "right":
|
|
12937
|
-
return
|
|
12962
|
+
return import_styled_components83.css`
|
|
12938
12963
|
justify-content: flex-end;
|
|
12939
12964
|
`;
|
|
12940
12965
|
case "text and icon":
|
|
12941
|
-
return
|
|
12966
|
+
return import_styled_components83.css`
|
|
12942
12967
|
gap: ${cell3.layout.textAndIcon.gap};
|
|
12943
12968
|
`;
|
|
12944
12969
|
default:
|
|
@@ -12946,12 +12971,12 @@ var getLayoutStyle = (layout) => {
|
|
|
12946
12971
|
return;
|
|
12947
12972
|
}
|
|
12948
12973
|
};
|
|
12949
|
-
var StyledCell =
|
|
12950
|
-
${({ $type: type }) => type === "head" &&
|
|
12974
|
+
var StyledCell = import_styled_components83.default.td`
|
|
12975
|
+
${({ $type: type }) => type === "head" && import_styled_components83.css`
|
|
12951
12976
|
background-color: ${cell3.head.backgroundColor};
|
|
12952
12977
|
`}
|
|
12953
12978
|
`;
|
|
12954
|
-
var InnerCell =
|
|
12979
|
+
var InnerCell = import_styled_components83.default.div`
|
|
12955
12980
|
display: flex;
|
|
12956
12981
|
align-items: center;
|
|
12957
12982
|
${({ $layout: layout }) => getLayoutStyle(layout)}
|
|
@@ -12965,49 +12990,49 @@ var getTableCellType = (type) => {
|
|
|
12965
12990
|
return "td";
|
|
12966
12991
|
}
|
|
12967
12992
|
};
|
|
12968
|
-
var Cell2 = (0,
|
|
12993
|
+
var Cell2 = (0, import_react101.forwardRef)(
|
|
12969
12994
|
({ children, type: _type, layout = "left", collapsibleProps, ...rest }, ref) => {
|
|
12970
12995
|
const isInHead = useIsInTableHead();
|
|
12971
12996
|
const type = _type != null ? _type : isInHead ? "head" : "data";
|
|
12972
12997
|
const as = getTableCellType(type);
|
|
12973
12998
|
const { isCollapsibleChild } = collapsibleProps != null ? collapsibleProps : {};
|
|
12974
|
-
return isCollapsibleChild ? /* @__PURE__ */ (0,
|
|
12999
|
+
return isCollapsibleChild ? /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(DescriptionListDesc, { children }) : /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(StyledCell, { as, ref, $type: type, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(InnerCell, { $layout: layout, children }) });
|
|
12975
13000
|
}
|
|
12976
13001
|
);
|
|
12977
13002
|
Cell2.displayName = "Table.Cell";
|
|
12978
13003
|
|
|
12979
13004
|
// src/components/Table/normal/Foot.tsx
|
|
12980
|
-
var
|
|
12981
|
-
var
|
|
12982
|
-
var
|
|
12983
|
-
var StyledFoot =
|
|
12984
|
-
var Foot = (0,
|
|
13005
|
+
var import_react102 = require("react");
|
|
13006
|
+
var import_styled_components84 = __toESM(require("styled-components"));
|
|
13007
|
+
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
13008
|
+
var StyledFoot = import_styled_components84.default.tfoot``;
|
|
13009
|
+
var Foot = (0, import_react102.forwardRef)(
|
|
12985
13010
|
({ children, ...rest }, ref) => {
|
|
12986
|
-
return /* @__PURE__ */ (0,
|
|
13011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledFoot, { ref, ...rest, children });
|
|
12987
13012
|
}
|
|
12988
13013
|
);
|
|
12989
13014
|
Foot.displayName = "Table.Foot";
|
|
12990
13015
|
|
|
12991
13016
|
// src/components/Table/normal/Row.tsx
|
|
12992
|
-
var
|
|
13017
|
+
var import_react103 = require("react");
|
|
12993
13018
|
|
|
12994
13019
|
// src/components/Table/normal/Table.styles.tsx
|
|
12995
|
-
var
|
|
13020
|
+
var import_styled_components85 = __toESM(require("styled-components"));
|
|
12996
13021
|
var { row: row2 } = tableTokens;
|
|
12997
13022
|
var bodyRowStyles = (mode, selected) => {
|
|
12998
|
-
return
|
|
12999
|
-
${mode === "sum" &&
|
|
13023
|
+
return import_styled_components85.css`
|
|
13024
|
+
${mode === "sum" && import_styled_components85.css`
|
|
13000
13025
|
font-weight: 600;
|
|
13001
13026
|
border-top: ${row2.body.mode.sum.borderTop};
|
|
13002
13027
|
border-bottom: ${row2.body.mode.sum.borderBottom};
|
|
13003
13028
|
background-color: ${row2.body.mode.sum.backgroundColor};
|
|
13004
13029
|
`}
|
|
13005
|
-
${selected &&
|
|
13030
|
+
${selected && import_styled_components85.css`
|
|
13006
13031
|
background-color: ${row2.body.selected.backgroundColor};
|
|
13007
13032
|
`}
|
|
13008
13033
|
`;
|
|
13009
13034
|
};
|
|
13010
|
-
var StyledRow =
|
|
13035
|
+
var StyledRow = import_styled_components85.default.tr`
|
|
13011
13036
|
@media (prefers-reduced-motion: no-preference) {
|
|
13012
13037
|
transition:
|
|
13013
13038
|
background-color 0.2s,
|
|
@@ -13017,11 +13042,11 @@ var StyledRow = import_styled_components84.default.tr`
|
|
|
13017
13042
|
|
|
13018
13043
|
${getFontStyling(defaultTypographyType, true)}
|
|
13019
13044
|
|
|
13020
|
-
${({ type }) => type === "head" &&
|
|
13045
|
+
${({ type }) => type === "head" && import_styled_components85.css`
|
|
13021
13046
|
font-weight: 600;
|
|
13022
13047
|
text-align: left;
|
|
13023
13048
|
`}
|
|
13024
|
-
${({ type, $mode: mode, $selected: selected, $hoverable: hoverable }) => type === "body" &&
|
|
13049
|
+
${({ type, $mode: mode, $selected: selected, $hoverable: hoverable }) => type === "body" && import_styled_components85.css`
|
|
13025
13050
|
&:nth-of-type(even) {
|
|
13026
13051
|
background-color: ${row2.body.even.backgroundColor};
|
|
13027
13052
|
${bodyRowStyles(mode, selected)}
|
|
@@ -13032,7 +13057,7 @@ var StyledRow = import_styled_components84.default.tr`
|
|
|
13032
13057
|
${bodyRowStyles(mode, selected)}
|
|
13033
13058
|
}
|
|
13034
13059
|
|
|
13035
|
-
${hoverable &&
|
|
13060
|
+
${hoverable && import_styled_components85.css`
|
|
13036
13061
|
&:hover {
|
|
13037
13062
|
background-color: ${row2.body.hover.backgroundColor};
|
|
13038
13063
|
}
|
|
@@ -13044,12 +13069,12 @@ var StyledRow = import_styled_components84.default.tr`
|
|
|
13044
13069
|
`;
|
|
13045
13070
|
|
|
13046
13071
|
// src/components/Table/normal/Row.tsx
|
|
13047
|
-
var
|
|
13048
|
-
var Row = (0,
|
|
13072
|
+
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
13073
|
+
var Row = (0, import_react103.forwardRef)(
|
|
13049
13074
|
({ type: _type, mode = "normal", hoverable, selected, children, ...rest }, ref) => {
|
|
13050
13075
|
const isInHeader = useIsInTableHead();
|
|
13051
13076
|
const type = _type != null ? _type : isInHeader ? "head" : "body";
|
|
13052
|
-
return /* @__PURE__ */ (0,
|
|
13077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(
|
|
13053
13078
|
StyledRow,
|
|
13054
13079
|
{
|
|
13055
13080
|
type,
|
|
@@ -13066,11 +13091,11 @@ var Row = (0, import_react102.forwardRef)(
|
|
|
13066
13091
|
Row.displayName = "Table.Row";
|
|
13067
13092
|
|
|
13068
13093
|
// src/components/Table/normal/SortCell.tsx
|
|
13069
|
-
var
|
|
13070
|
-
var
|
|
13071
|
-
var
|
|
13094
|
+
var import_react104 = require("react");
|
|
13095
|
+
var import_styled_components86 = __toESM(require("styled-components"));
|
|
13096
|
+
var import_jsx_runtime259 = require("react/jsx-runtime");
|
|
13072
13097
|
var { cell: cell4 } = tableTokens;
|
|
13073
|
-
var StyledButton6 =
|
|
13098
|
+
var StyledButton6 = import_styled_components86.default.button`
|
|
13074
13099
|
${normalizeButton}
|
|
13075
13100
|
user-select: text;
|
|
13076
13101
|
${removeButtonStyling}
|
|
@@ -13083,19 +13108,19 @@ var StyledButton6 = import_styled_components85.default.button`
|
|
|
13083
13108
|
`;
|
|
13084
13109
|
var makeSortIcon = (isSorted, sortOrder) => {
|
|
13085
13110
|
if (!isSorted || !sortOrder) {
|
|
13086
|
-
return /* @__PURE__ */ (0,
|
|
13111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(Icon, { icon: UnfoldMoreIcon, iconSize: "inherit" });
|
|
13087
13112
|
}
|
|
13088
|
-
return sortOrder === "ascending" ? /* @__PURE__ */ (0,
|
|
13113
|
+
return sortOrder === "ascending" ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(Icon, { icon: ChevronDownIcon, iconSize: "inherit" }) : /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(Icon, { icon: ChevronUpIcon, iconSize: "inherit" });
|
|
13089
13114
|
};
|
|
13090
|
-
var SortCell = (0,
|
|
13091
|
-
({ isSorted, sortOrder, onClick, children, ...rest }, ref) => /* @__PURE__ */ (0,
|
|
13115
|
+
var SortCell = (0, import_react104.forwardRef)(
|
|
13116
|
+
({ isSorted, sortOrder, onClick, children, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
13092
13117
|
Cell2,
|
|
13093
13118
|
{
|
|
13094
13119
|
ref,
|
|
13095
13120
|
type: "head",
|
|
13096
13121
|
"aria-sort": isSorted && sortOrder ? sortOrder : void 0,
|
|
13097
13122
|
...rest,
|
|
13098
|
-
children: /* @__PURE__ */ (0,
|
|
13123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(
|
|
13099
13124
|
StyledButton6,
|
|
13100
13125
|
{
|
|
13101
13126
|
onClick,
|
|
@@ -13113,11 +13138,11 @@ var SortCell = (0, import_react103.forwardRef)(
|
|
|
13113
13138
|
SortCell.displayName = "Table.SortCell";
|
|
13114
13139
|
|
|
13115
13140
|
// src/components/Table/normal/Table.tsx
|
|
13116
|
-
var
|
|
13117
|
-
var
|
|
13118
|
-
var
|
|
13141
|
+
var import_react105 = require("react");
|
|
13142
|
+
var import_styled_components87 = __toESM(require("styled-components"));
|
|
13143
|
+
var import_jsx_runtime260 = require("react/jsx-runtime");
|
|
13119
13144
|
var { cell: cell5, row: row3 } = tableTokens;
|
|
13120
|
-
var StyledTable =
|
|
13145
|
+
var StyledTable = import_styled_components87.default.table`
|
|
13121
13146
|
border-spacing: 0;
|
|
13122
13147
|
border-collapse: collapse;
|
|
13123
13148
|
*::selection {
|
|
@@ -13125,13 +13150,13 @@ var StyledTable = import_styled_components86.default.table`
|
|
|
13125
13150
|
}
|
|
13126
13151
|
${scrollbarStyling.webkit}
|
|
13127
13152
|
${scrollbarStyling.firefox}
|
|
13128
|
-
${({ $density }) =>
|
|
13153
|
+
${({ $density }) => import_styled_components87.css`
|
|
13129
13154
|
td,
|
|
13130
13155
|
th {
|
|
13131
13156
|
padding: ${cell5.density[$density].padding};
|
|
13132
13157
|
}
|
|
13133
13158
|
`}
|
|
13134
|
-
${({ $density }) => $density === "extraCompact" &&
|
|
13159
|
+
${({ $density }) => $density === "extraCompact" && import_styled_components87.css`
|
|
13135
13160
|
th {
|
|
13136
13161
|
background-color: ${row3.head.extraCompact.backgroundColor};
|
|
13137
13162
|
font-size: ${row3.head.extraCompact.fontSize};
|
|
@@ -13145,7 +13170,7 @@ var StyledTable = import_styled_components86.default.table`
|
|
|
13145
13170
|
}
|
|
13146
13171
|
}
|
|
13147
13172
|
`}
|
|
13148
|
-
${({ $stickyHeader }) => $stickyHeader &&
|
|
13173
|
+
${({ $stickyHeader }) => $stickyHeader && import_styled_components87.css`
|
|
13149
13174
|
tr[type='head'] {
|
|
13150
13175
|
th[type='head'] {
|
|
13151
13176
|
position: sticky;
|
|
@@ -13154,15 +13179,15 @@ var StyledTable = import_styled_components86.default.table`
|
|
|
13154
13179
|
}
|
|
13155
13180
|
}
|
|
13156
13181
|
`}
|
|
13157
|
-
${({ $withDividers }) => $withDividers &&
|
|
13182
|
+
${({ $withDividers }) => $withDividers && import_styled_components87.css`
|
|
13158
13183
|
tr[type='body'] {
|
|
13159
13184
|
border-bottom: ${row3.body.withDividers.borderBottom};
|
|
13160
13185
|
}
|
|
13161
13186
|
`}
|
|
13162
13187
|
`;
|
|
13163
|
-
var Table = (0,
|
|
13188
|
+
var Table = (0, import_react105.forwardRef)(
|
|
13164
13189
|
({ density = "normal", stickyHeader, withDividers, children, ...rest }, ref) => {
|
|
13165
|
-
return /* @__PURE__ */ (0,
|
|
13190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(
|
|
13166
13191
|
StyledTable,
|
|
13167
13192
|
{
|
|
13168
13193
|
...rest,
|
|
@@ -13178,38 +13203,38 @@ var Table = (0, import_react104.forwardRef)(
|
|
|
13178
13203
|
Table.displayName = "Table";
|
|
13179
13204
|
|
|
13180
13205
|
// src/components/Table/normal/TableWrapper.tsx
|
|
13181
|
-
var
|
|
13182
|
-
var
|
|
13183
|
-
var
|
|
13184
|
-
var Wrapper6 =
|
|
13185
|
-
${({ $overflowX }) => $overflowX &&
|
|
13206
|
+
var import_react106 = require("react");
|
|
13207
|
+
var import_styled_components88 = __toESM(require("styled-components"));
|
|
13208
|
+
var import_jsx_runtime261 = require("react/jsx-runtime");
|
|
13209
|
+
var Wrapper6 = import_styled_components88.default.div`
|
|
13210
|
+
${({ $overflowX }) => $overflowX && import_styled_components88.css`
|
|
13186
13211
|
overflow-x: auto;
|
|
13187
13212
|
`}
|
|
13188
13213
|
${scrollbarStyling.webkit}
|
|
13189
13214
|
${scrollbarStyling.firefox}
|
|
13190
13215
|
`;
|
|
13191
13216
|
var TableWrapper = ({ children, ...rest }) => {
|
|
13192
|
-
const [overflowX, setOverflowX] = (0,
|
|
13193
|
-
const [windowWidth, setWindowWidth] = (0,
|
|
13217
|
+
const [overflowX, setOverflowX] = (0, import_react106.useState)(false);
|
|
13218
|
+
const [windowWidth, setWindowWidth] = (0, import_react106.useState)(window.innerWidth);
|
|
13194
13219
|
function isOverflowingX(event) {
|
|
13195
13220
|
return event.offsetWidth < event.scrollWidth;
|
|
13196
13221
|
}
|
|
13197
|
-
const wrapperRef = (0,
|
|
13198
|
-
(0,
|
|
13222
|
+
const wrapperRef = (0, import_react106.useRef)(null);
|
|
13223
|
+
(0, import_react106.useEffect)(() => {
|
|
13199
13224
|
if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
|
|
13200
13225
|
setOverflowX(true);
|
|
13201
13226
|
return;
|
|
13202
13227
|
}
|
|
13203
13228
|
setOverflowX(false);
|
|
13204
13229
|
}, [windowWidth]);
|
|
13205
|
-
(0,
|
|
13230
|
+
(0, import_react106.useEffect)(() => {
|
|
13206
13231
|
function handleResize() {
|
|
13207
13232
|
setWindowWidth(window.innerWidth);
|
|
13208
13233
|
}
|
|
13209
13234
|
window.addEventListener("resize", handleResize);
|
|
13210
13235
|
return () => window.removeEventListener("resize", handleResize);
|
|
13211
13236
|
});
|
|
13212
|
-
return /* @__PURE__ */ (0,
|
|
13237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(Wrapper6, { $overflowX: overflowX, ref: wrapperRef, ...rest, children });
|
|
13213
13238
|
};
|
|
13214
13239
|
TableWrapper.displayName = "Table.Wrapper";
|
|
13215
13240
|
|
|
@@ -13224,9 +13249,9 @@ Table2.Row = Row;
|
|
|
13224
13249
|
Table2.Foot = Foot;
|
|
13225
13250
|
|
|
13226
13251
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
13227
|
-
var
|
|
13252
|
+
var import_jsx_runtime262 = require("react/jsx-runtime");
|
|
13228
13253
|
var { collapseButton: collapseButton2 } = tableTokens;
|
|
13229
|
-
var CollapseButton =
|
|
13254
|
+
var CollapseButton = import_styled_components89.default.button`
|
|
13230
13255
|
${removeButtonStyling}
|
|
13231
13256
|
margin-left: auto;
|
|
13232
13257
|
margin-right: auto;
|
|
@@ -13241,12 +13266,12 @@ var CollapseButton = import_styled_components88.default.button`
|
|
|
13241
13266
|
${focusVisible}
|
|
13242
13267
|
}
|
|
13243
13268
|
`;
|
|
13244
|
-
var DescriptionListCell = (0,
|
|
13269
|
+
var DescriptionListCell = (0, import_styled_components89.default)(Cell2)`
|
|
13245
13270
|
& > div {
|
|
13246
13271
|
display: block;
|
|
13247
13272
|
}
|
|
13248
13273
|
`;
|
|
13249
|
-
var CollapsibleRow = (0,
|
|
13274
|
+
var CollapsibleRow = (0, import_react107.forwardRef)(
|
|
13250
13275
|
({ type: _type, mode = "normal", selected, hoverable, children, ...rest }, ref) => {
|
|
13251
13276
|
const isInHead = useIsInTableHead();
|
|
13252
13277
|
const type = _type != null ? _type : isInHead ? "head" : "body";
|
|
@@ -13258,14 +13283,14 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13258
13283
|
...rest
|
|
13259
13284
|
};
|
|
13260
13285
|
const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
|
|
13261
|
-
const [childrenCollapsed, setChildrenCollapsed] = (0,
|
|
13262
|
-
(0,
|
|
13286
|
+
const [childrenCollapsed, setChildrenCollapsed] = (0, import_react107.useState)(true);
|
|
13287
|
+
(0, import_react107.useEffect)(() => {
|
|
13263
13288
|
!isCollapsed && setChildrenCollapsed(true);
|
|
13264
13289
|
}, [isCollapsed]);
|
|
13265
13290
|
const collapsedHeaderValues = headerValues.filter(
|
|
13266
13291
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
13267
13292
|
);
|
|
13268
|
-
const childrenArray =
|
|
13293
|
+
const childrenArray = import_react107.Children.toArray(children);
|
|
13269
13294
|
const collapsedChildren = childrenArray.filter(
|
|
13270
13295
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
13271
13296
|
);
|
|
@@ -13274,25 +13299,25 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13274
13299
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
13275
13300
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
13276
13301
|
collapsibleIds.push(id);
|
|
13277
|
-
return /* @__PURE__ */ (0,
|
|
13278
|
-
/* @__PURE__ */ (0,
|
|
13279
|
-
(0,
|
|
13302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_react107.Fragment, { children: [
|
|
13303
|
+
/* @__PURE__ */ (0, import_jsx_runtime262.jsx)(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
|
|
13304
|
+
(0, import_react107.isValidElement)(child) && (0, import_react107.cloneElement)(child, {
|
|
13280
13305
|
collapsibleProps: { isCollapsibleChild: true }
|
|
13281
13306
|
})
|
|
13282
13307
|
] }, `DL-${index}`);
|
|
13283
13308
|
}) : null;
|
|
13284
|
-
const collapsedRows = collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0,
|
|
13309
|
+
const collapsedRows = collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(StyledRow, { type, children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(DescriptionListCell, { colSpan: definingColumnIndex.length + 1, children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(DescriptionList, { children: collapsedRenderedChildren }) }) }) : null;
|
|
13285
13310
|
const definingColumnCells = childrenArray.slice().filter((column, index) => definingColumnIndex.indexOf(index) > -1).sort((a2, b) => {
|
|
13286
13311
|
return definingColumnIndex.indexOf(childrenArray.indexOf(a2)) - definingColumnIndex.indexOf(childrenArray.indexOf(b));
|
|
13287
13312
|
});
|
|
13288
13313
|
const headerRow = () => {
|
|
13289
13314
|
if (type !== "head" || !isCollapsed)
|
|
13290
13315
|
return null;
|
|
13291
|
-
return /* @__PURE__ */ (0,
|
|
13316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(StyledRow, { ref, type, ...rowProps, children: /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [
|
|
13292
13317
|
definingColumnCells,
|
|
13293
|
-
/* @__PURE__ */ (0,
|
|
13318
|
+
/* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(Table2.Cell, { type: "head", layout: "center", children: [
|
|
13294
13319
|
"Utvid",
|
|
13295
|
-
/* @__PURE__ */ (0,
|
|
13320
|
+
/* @__PURE__ */ (0, import_jsx_runtime262.jsx)(VisuallyHidden, { as: "span", children: "raden" })
|
|
13296
13321
|
] })
|
|
13297
13322
|
] }) });
|
|
13298
13323
|
};
|
|
@@ -13300,7 +13325,7 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13300
13325
|
const rowWithChevron = () => {
|
|
13301
13326
|
if (type !== "body" || !isCollapsed)
|
|
13302
13327
|
return null;
|
|
13303
|
-
return /* @__PURE__ */ (0,
|
|
13328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(
|
|
13304
13329
|
StyledRow,
|
|
13305
13330
|
{
|
|
13306
13331
|
ref,
|
|
@@ -13309,13 +13334,13 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13309
13334
|
"data-isopencollapsibleheader": !childrenCollapsed && true,
|
|
13310
13335
|
children: [
|
|
13311
13336
|
definingColumnCells,
|
|
13312
|
-
/* @__PURE__ */ (0,
|
|
13337
|
+
/* @__PURE__ */ (0, import_jsx_runtime262.jsx)(Table2.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(
|
|
13313
13338
|
CollapseButton,
|
|
13314
13339
|
{
|
|
13315
13340
|
onClick: () => setChildrenCollapsed(!childrenCollapsed),
|
|
13316
13341
|
"aria-expanded": !childrenCollapsed,
|
|
13317
13342
|
"aria-controls": idList,
|
|
13318
|
-
children: /* @__PURE__ */ (0,
|
|
13343
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(
|
|
13319
13344
|
AnimatedChevronUpDown,
|
|
13320
13345
|
{
|
|
13321
13346
|
isUp: childrenCollapsed ? false : true,
|
|
@@ -13329,30 +13354,30 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13329
13354
|
}
|
|
13330
13355
|
);
|
|
13331
13356
|
};
|
|
13332
|
-
return isCollapsed && collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0,
|
|
13357
|
+
return isCollapsed && collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [
|
|
13333
13358
|
headerRow(),
|
|
13334
|
-
type === "body" && /* @__PURE__ */ (0,
|
|
13359
|
+
type === "body" && /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [
|
|
13335
13360
|
rowWithChevron(),
|
|
13336
13361
|
childrenCollapsed ? null : collapsedRows
|
|
13337
13362
|
] })
|
|
13338
|
-
] }) : /* @__PURE__ */ (0,
|
|
13363
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(StyledRow, { ref, type, ...rowProps, children });
|
|
13339
13364
|
}
|
|
13340
13365
|
);
|
|
13341
13366
|
CollapsibleRow.displayName = "CollapsibleTable.Row";
|
|
13342
13367
|
|
|
13343
13368
|
// src/components/Table/collapsible/CollapsibleTable.tsx
|
|
13344
|
-
var
|
|
13345
|
-
var
|
|
13346
|
-
var
|
|
13347
|
-
var StyledTable2 = (0,
|
|
13369
|
+
var import_react108 = require("react");
|
|
13370
|
+
var import_styled_components90 = __toESM(require("styled-components"));
|
|
13371
|
+
var import_jsx_runtime263 = require("react/jsx-runtime");
|
|
13372
|
+
var StyledTable2 = (0, import_styled_components90.default)(Table2)`
|
|
13348
13373
|
width: 100%;
|
|
13349
|
-
${({ withDividers }) => withDividers &&
|
|
13374
|
+
${({ withDividers }) => withDividers && import_styled_components90.css`
|
|
13350
13375
|
tr[data-isopencollapsibleheader='true'] {
|
|
13351
13376
|
border-bottom: none;
|
|
13352
13377
|
}
|
|
13353
13378
|
`}
|
|
13354
13379
|
`;
|
|
13355
|
-
var CollapsibleTable = (0,
|
|
13380
|
+
var CollapsibleTable = (0, import_react108.forwardRef)((props, ref) => {
|
|
13356
13381
|
const {
|
|
13357
13382
|
density = "normal",
|
|
13358
13383
|
children,
|
|
@@ -13361,7 +13386,7 @@ var CollapsibleTable = (0, import_react107.forwardRef)((props, ref) => {
|
|
|
13361
13386
|
definingColumnIndex = [0],
|
|
13362
13387
|
...rest
|
|
13363
13388
|
} = props;
|
|
13364
|
-
return /* @__PURE__ */ (0,
|
|
13389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(
|
|
13365
13390
|
CollapsibleTableContext.Provider,
|
|
13366
13391
|
{
|
|
13367
13392
|
value: {
|
|
@@ -13369,7 +13394,7 @@ var CollapsibleTable = (0, import_react107.forwardRef)((props, ref) => {
|
|
|
13369
13394
|
headerValues,
|
|
13370
13395
|
definingColumnIndex
|
|
13371
13396
|
},
|
|
13372
|
-
children: /* @__PURE__ */ (0,
|
|
13397
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(StyledTable2, { ref, density, ...rest, children })
|
|
13373
13398
|
}
|
|
13374
13399
|
);
|
|
13375
13400
|
});
|
|
@@ -13380,12 +13405,12 @@ var CollapsibleTable2 = CollapsibleTable;
|
|
|
13380
13405
|
CollapsibleTable2.Row = CollapsibleRow;
|
|
13381
13406
|
|
|
13382
13407
|
// src/components/Tabs/Tabs.tsx
|
|
13383
|
-
var
|
|
13384
|
-
var
|
|
13408
|
+
var import_react110 = require("react");
|
|
13409
|
+
var import_styled_components91 = __toESM(require("styled-components"));
|
|
13385
13410
|
|
|
13386
13411
|
// src/components/Tabs/Tabs.context.tsx
|
|
13387
|
-
var
|
|
13388
|
-
var TabsContext = (0,
|
|
13412
|
+
var import_react109 = require("react");
|
|
13413
|
+
var TabsContext = (0, import_react109.createContext)({
|
|
13389
13414
|
activeTab: 0,
|
|
13390
13415
|
tabsId: "",
|
|
13391
13416
|
handleTabChange: () => null,
|
|
@@ -13395,16 +13420,16 @@ var TabsContext = (0, import_react108.createContext)({
|
|
|
13395
13420
|
setHasTabFocus: () => null,
|
|
13396
13421
|
tabContentDirection: "row"
|
|
13397
13422
|
});
|
|
13398
|
-
var useTabsContext = () => (0,
|
|
13423
|
+
var useTabsContext = () => (0, import_react109.useContext)(TabsContext);
|
|
13399
13424
|
|
|
13400
13425
|
// src/components/Tabs/Tabs.tsx
|
|
13401
|
-
var
|
|
13402
|
-
var Container15 =
|
|
13403
|
-
${({ $width }) => $width &&
|
|
13426
|
+
var import_jsx_runtime264 = require("react/jsx-runtime");
|
|
13427
|
+
var Container15 = import_styled_components91.default.div`
|
|
13428
|
+
${({ $width }) => $width && import_styled_components91.css`
|
|
13404
13429
|
width: ${$width};
|
|
13405
13430
|
`};
|
|
13406
13431
|
`;
|
|
13407
|
-
var Tabs = (0,
|
|
13432
|
+
var Tabs = (0, import_react110.forwardRef)((props, ref) => {
|
|
13408
13433
|
const {
|
|
13409
13434
|
id,
|
|
13410
13435
|
activeTab,
|
|
@@ -13416,17 +13441,17 @@ var Tabs = (0, import_react109.forwardRef)((props, ref) => {
|
|
|
13416
13441
|
htmlProps,
|
|
13417
13442
|
...rest
|
|
13418
13443
|
} = props;
|
|
13419
|
-
const generatedId = (0,
|
|
13444
|
+
const generatedId = (0, import_react110.useId)();
|
|
13420
13445
|
const uniqueId = id != null ? id : `${generatedId}-tabs`;
|
|
13421
|
-
const [thisActiveTab, setActiveTab] = (0,
|
|
13422
|
-
const [hasTabFocus, setHasTabFocus] = (0,
|
|
13423
|
-
const tabListRef = (0,
|
|
13424
|
-
const tabPanelsRef = (0,
|
|
13446
|
+
const [thisActiveTab, setActiveTab] = (0, import_react110.useState)(activeTab != null ? activeTab : 0);
|
|
13447
|
+
const [hasTabFocus, setHasTabFocus] = (0, import_react110.useState)(false);
|
|
13448
|
+
const tabListRef = (0, import_react110.useRef)(null);
|
|
13449
|
+
const tabPanelsRef = (0, import_react110.useRef)(null);
|
|
13425
13450
|
const handleTabChange = (index) => {
|
|
13426
13451
|
setActiveTab(index);
|
|
13427
13452
|
onChange && onChange(index);
|
|
13428
13453
|
};
|
|
13429
|
-
(0,
|
|
13454
|
+
(0, import_react110.useEffect)(() => {
|
|
13430
13455
|
if (activeTab !== void 0 && activeTab !== thisActiveTab) {
|
|
13431
13456
|
setActiveTab(activeTab);
|
|
13432
13457
|
}
|
|
@@ -13435,7 +13460,7 @@ var Tabs = (0, import_react109.forwardRef)((props, ref) => {
|
|
|
13435
13460
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
13436
13461
|
ref
|
|
13437
13462
|
};
|
|
13438
|
-
return /* @__PURE__ */ (0,
|
|
13463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(
|
|
13439
13464
|
TabsContext.Provider,
|
|
13440
13465
|
{
|
|
13441
13466
|
value: {
|
|
@@ -13448,15 +13473,15 @@ var Tabs = (0, import_react109.forwardRef)((props, ref) => {
|
|
|
13448
13473
|
setHasTabFocus,
|
|
13449
13474
|
tabContentDirection
|
|
13450
13475
|
},
|
|
13451
|
-
children: /* @__PURE__ */ (0,
|
|
13476
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(Container15, { ...containerProps, $width: width, children })
|
|
13452
13477
|
}
|
|
13453
13478
|
);
|
|
13454
13479
|
});
|
|
13455
13480
|
Tabs.displayName = "Tabs";
|
|
13456
13481
|
|
|
13457
13482
|
// src/components/Tabs/Tab.tsx
|
|
13458
|
-
var
|
|
13459
|
-
var
|
|
13483
|
+
var import_react112 = require("react");
|
|
13484
|
+
var import_styled_components92 = __toESM(require("styled-components"));
|
|
13460
13485
|
|
|
13461
13486
|
// src/components/Tabs/Tabs.tokens.tsx
|
|
13462
13487
|
var import_dds_design_tokens59 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -13498,14 +13523,14 @@ var tabsTokens = {
|
|
|
13498
13523
|
};
|
|
13499
13524
|
|
|
13500
13525
|
// src/components/Tabs/TabWidthContext.tsx
|
|
13501
|
-
var
|
|
13502
|
-
var
|
|
13503
|
-
var TabContext = (0,
|
|
13526
|
+
var import_react111 = require("react");
|
|
13527
|
+
var import_jsx_runtime265 = require("react/jsx-runtime");
|
|
13528
|
+
var TabContext = (0, import_react111.createContext)(null);
|
|
13504
13529
|
function TabWidthContextProvider({
|
|
13505
13530
|
children,
|
|
13506
13531
|
onChangeWidths
|
|
13507
13532
|
}) {
|
|
13508
|
-
return /* @__PURE__ */ (0,
|
|
13533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
13509
13534
|
TabContext.Provider,
|
|
13510
13535
|
{
|
|
13511
13536
|
value: {
|
|
@@ -13529,17 +13554,17 @@ function TabWidthContextProvider({
|
|
|
13529
13554
|
);
|
|
13530
13555
|
}
|
|
13531
13556
|
function useSetTabWidth(index, width) {
|
|
13532
|
-
const context = (0,
|
|
13533
|
-
(0,
|
|
13557
|
+
const context = (0, import_react111.useContext)(TabContext);
|
|
13558
|
+
(0, import_react111.useLayoutEffect)(() => {
|
|
13534
13559
|
context == null ? void 0 : context.updateWidth(index, width);
|
|
13535
13560
|
return () => context == null ? void 0 : context.removeTab(index);
|
|
13536
13561
|
}, [index, width]);
|
|
13537
13562
|
}
|
|
13538
13563
|
|
|
13539
13564
|
// src/components/Tabs/Tab.tsx
|
|
13540
|
-
var
|
|
13565
|
+
var import_jsx_runtime266 = require("react/jsx-runtime");
|
|
13541
13566
|
var { tab: tab2 } = tabsTokens;
|
|
13542
|
-
var Button2 =
|
|
13567
|
+
var Button2 = import_styled_components92.default.button`
|
|
13543
13568
|
${normalizeButton}
|
|
13544
13569
|
${removeButtonStyling}
|
|
13545
13570
|
user-select: text;
|
|
@@ -13559,12 +13584,12 @@ var Button2 = import_styled_components91.default.button`
|
|
|
13559
13584
|
${focusVisibleTransitionValue};
|
|
13560
13585
|
}
|
|
13561
13586
|
|
|
13562
|
-
${({ $direction }) =>
|
|
13587
|
+
${({ $direction }) => import_styled_components92.css`
|
|
13563
13588
|
flex-direction: ${$direction};
|
|
13564
13589
|
gap: ${tab2[$direction].gap};
|
|
13565
13590
|
`};
|
|
13566
13591
|
|
|
13567
|
-
${({ $active }) => $active &&
|
|
13592
|
+
${({ $active }) => $active && import_styled_components92.css`
|
|
13568
13593
|
background-color: ${tab2.active.backgroundColor};
|
|
13569
13594
|
border-color: ${tab2.active.borderColor};
|
|
13570
13595
|
color: ${tab2.active.color};
|
|
@@ -13582,7 +13607,7 @@ var Button2 = import_styled_components91.default.button`
|
|
|
13582
13607
|
box-shadow: ${tab2.hover.boxShadow};
|
|
13583
13608
|
}
|
|
13584
13609
|
`;
|
|
13585
|
-
var Tab = (0,
|
|
13610
|
+
var Tab = (0, import_react112.forwardRef)((props, ref) => {
|
|
13586
13611
|
const {
|
|
13587
13612
|
active = false,
|
|
13588
13613
|
icon: icon11,
|
|
@@ -13599,16 +13624,16 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13599
13624
|
...rest
|
|
13600
13625
|
} = props;
|
|
13601
13626
|
useSetTabWidth(index, width);
|
|
13602
|
-
const itemRef = (0,
|
|
13627
|
+
const itemRef = (0, import_react112.useRef)(null);
|
|
13603
13628
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
13604
13629
|
const { tabContentDirection } = useTabsContext();
|
|
13605
|
-
(0,
|
|
13630
|
+
(0, import_react112.useEffect)(() => {
|
|
13606
13631
|
var _a;
|
|
13607
13632
|
if (focus) {
|
|
13608
13633
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
13609
13634
|
}
|
|
13610
13635
|
}, [focus]);
|
|
13611
|
-
const handleSelect = (0,
|
|
13636
|
+
const handleSelect = (0, import_react112.useCallback)(() => {
|
|
13612
13637
|
if (setFocus && index) {
|
|
13613
13638
|
setFocus(index);
|
|
13614
13639
|
}
|
|
@@ -13621,7 +13646,7 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13621
13646
|
handleSelect();
|
|
13622
13647
|
onKeyDown && onKeyDown(e);
|
|
13623
13648
|
};
|
|
13624
|
-
return /* @__PURE__ */ (0,
|
|
13649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime266.jsxs)(
|
|
13625
13650
|
Button2,
|
|
13626
13651
|
{
|
|
13627
13652
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -13634,8 +13659,8 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13634
13659
|
onKeyDown: handleOnKeyDown,
|
|
13635
13660
|
tabIndex: focus ? 0 : -1,
|
|
13636
13661
|
children: [
|
|
13637
|
-
icon11 && /* @__PURE__ */ (0,
|
|
13638
|
-
/* @__PURE__ */ (0,
|
|
13662
|
+
icon11 && /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(Icon, { icon: icon11, iconSize: "inherit" }),
|
|
13663
|
+
/* @__PURE__ */ (0, import_jsx_runtime266.jsx)("span", { children })
|
|
13639
13664
|
]
|
|
13640
13665
|
}
|
|
13641
13666
|
);
|
|
@@ -13643,18 +13668,18 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13643
13668
|
Tab.displayName = "Tab";
|
|
13644
13669
|
|
|
13645
13670
|
// src/components/Tabs/TabList.tsx
|
|
13646
|
-
var
|
|
13647
|
-
var
|
|
13648
|
-
var
|
|
13671
|
+
var import_react113 = require("react");
|
|
13672
|
+
var import_styled_components93 = __toESM(require("styled-components"));
|
|
13673
|
+
var import_jsx_runtime267 = require("react/jsx-runtime");
|
|
13649
13674
|
var { tabList: tabList2 } = tabsTokens;
|
|
13650
|
-
var autoFlow =
|
|
13675
|
+
var autoFlow = import_styled_components93.css`
|
|
13651
13676
|
grid-auto-flow: column;
|
|
13652
13677
|
grid-auto-columns: 1fr;
|
|
13653
13678
|
`;
|
|
13654
|
-
var templateColumns = (templateColumns2) =>
|
|
13679
|
+
var templateColumns = (templateColumns2) => import_styled_components93.css`
|
|
13655
13680
|
grid-template-columns: ${templateColumns2};
|
|
13656
13681
|
`;
|
|
13657
|
-
var TabRow =
|
|
13682
|
+
var TabRow = import_styled_components93.default.div`
|
|
13658
13683
|
border-bottom: ${tabList2.borderBottom};
|
|
13659
13684
|
display: grid;
|
|
13660
13685
|
${({ $gridTemplateColumns }) => $gridTemplateColumns === "" ? autoFlow : templateColumns($gridTemplateColumns)}
|
|
@@ -13673,7 +13698,7 @@ var TabRow = import_styled_components92.default.div`
|
|
|
13673
13698
|
outline: none;
|
|
13674
13699
|
}
|
|
13675
13700
|
`;
|
|
13676
|
-
var TabList = (0,
|
|
13701
|
+
var TabList = (0, import_react113.forwardRef)(
|
|
13677
13702
|
({ children, id, onFocus, ...rest }, ref) => {
|
|
13678
13703
|
const {
|
|
13679
13704
|
activeTab,
|
|
@@ -13684,11 +13709,11 @@ var TabList = (0, import_react112.forwardRef)(
|
|
|
13684
13709
|
setHasTabFocus
|
|
13685
13710
|
} = useTabsContext();
|
|
13686
13711
|
const uniqueId = id != null ? id : `${tabsId}-tablist`;
|
|
13687
|
-
const childrenArray =
|
|
13712
|
+
const childrenArray = import_react113.Children.toArray(children).length;
|
|
13688
13713
|
const [focus, setFocus] = useRoveFocus(childrenArray, hasTabFocus, "row");
|
|
13689
13714
|
const combinedRef = useCombinedRef(ref, tabListRef);
|
|
13690
|
-
const tabListChildren =
|
|
13691
|
-
return (0,
|
|
13715
|
+
const tabListChildren = import_react113.Children.map(children, (child, index) => {
|
|
13716
|
+
return (0, import_react113.isValidElement)(child) && (0, import_react113.cloneElement)(child, {
|
|
13692
13717
|
id: `${tabsId}-tab-${index}`,
|
|
13693
13718
|
"aria-controls": `${tabsId}-panel-${index}`,
|
|
13694
13719
|
active: activeTab === index,
|
|
@@ -13698,7 +13723,7 @@ var TabList = (0, import_react112.forwardRef)(
|
|
|
13698
13723
|
onClick: () => handleTabChange(index)
|
|
13699
13724
|
});
|
|
13700
13725
|
});
|
|
13701
|
-
const [widths, setWidths] = (0,
|
|
13726
|
+
const [widths, setWidths] = (0, import_react113.useState)([]);
|
|
13702
13727
|
const handleOnFocus = (event) => {
|
|
13703
13728
|
setHasTabFocus(true);
|
|
13704
13729
|
onFocus && onFocus(event);
|
|
@@ -13712,7 +13737,7 @@ var TabList = (0, import_react112.forwardRef)(
|
|
|
13712
13737
|
setHasTabFocus(false);
|
|
13713
13738
|
}
|
|
13714
13739
|
};
|
|
13715
|
-
return /* @__PURE__ */ (0,
|
|
13740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(TabWidthContextProvider, { onChangeWidths: setWidths, children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
13716
13741
|
TabRow,
|
|
13717
13742
|
{
|
|
13718
13743
|
...rest,
|
|
@@ -13732,26 +13757,26 @@ var TabList = (0, import_react112.forwardRef)(
|
|
|
13732
13757
|
TabList.displayName = "TabList";
|
|
13733
13758
|
|
|
13734
13759
|
// src/components/Tabs/TabPanel.tsx
|
|
13735
|
-
var
|
|
13736
|
-
var
|
|
13737
|
-
var
|
|
13760
|
+
var import_react114 = require("react");
|
|
13761
|
+
var import_styled_components94 = __toESM(require("styled-components"));
|
|
13762
|
+
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
13738
13763
|
var { panel: panel2 } = tabsTokens;
|
|
13739
|
-
var Panel =
|
|
13764
|
+
var Panel = import_styled_components94.default.div`
|
|
13740
13765
|
padding: ${panel2.padding};
|
|
13741
13766
|
@media (prefers-reduced-motion: no-preference) {
|
|
13742
13767
|
transition: ${focusVisibleTransitionValue};
|
|
13743
13768
|
}
|
|
13744
13769
|
|
|
13745
|
-
${({ $active }) => !$active &&
|
|
13770
|
+
${({ $active }) => !$active && import_styled_components94.css`
|
|
13746
13771
|
display: none;
|
|
13747
13772
|
`}
|
|
13748
13773
|
&:focus-visible {
|
|
13749
13774
|
${focusVisible}
|
|
13750
13775
|
}
|
|
13751
13776
|
`;
|
|
13752
|
-
var TabPanel = (0,
|
|
13777
|
+
var TabPanel = (0, import_react114.forwardRef)(
|
|
13753
13778
|
({ active = false, children, id, className, htmlProps, ...rest }, ref) => {
|
|
13754
|
-
return /* @__PURE__ */ (0,
|
|
13779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(
|
|
13755
13780
|
Panel,
|
|
13756
13781
|
{
|
|
13757
13782
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -13767,29 +13792,29 @@ var TabPanel = (0, import_react113.forwardRef)(
|
|
|
13767
13792
|
TabPanel.displayName = "TabPanel";
|
|
13768
13793
|
|
|
13769
13794
|
// src/components/Tabs/TabPanels.tsx
|
|
13770
|
-
var
|
|
13771
|
-
var
|
|
13772
|
-
var TabPanels = (0,
|
|
13795
|
+
var import_react115 = require("react");
|
|
13796
|
+
var import_jsx_runtime269 = require("react/jsx-runtime");
|
|
13797
|
+
var TabPanels = (0, import_react115.forwardRef)(
|
|
13773
13798
|
({ children, ...rest }, ref) => {
|
|
13774
13799
|
const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
|
|
13775
13800
|
const combinedRef = useCombinedRef(ref, tabPanelsRef);
|
|
13776
|
-
const panelChildren =
|
|
13801
|
+
const panelChildren = import_react115.Children.map(children, (child, index) => {
|
|
13777
13802
|
const active = index === activeTab;
|
|
13778
|
-
return (0,
|
|
13803
|
+
return (0, import_react115.isValidElement)(child) && (0, import_react115.cloneElement)(child, {
|
|
13779
13804
|
id: `${tabsId}-panel-${index}`,
|
|
13780
13805
|
"aria-labelledby": `${tabsId}-tab-${index}`,
|
|
13781
13806
|
active,
|
|
13782
13807
|
"aria-expanded": active
|
|
13783
13808
|
});
|
|
13784
13809
|
});
|
|
13785
|
-
return /* @__PURE__ */ (0,
|
|
13810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime269.jsx)("div", { ref: combinedRef, ...rest, children: panelChildren });
|
|
13786
13811
|
}
|
|
13787
13812
|
);
|
|
13788
13813
|
TabPanels.displayName = "TabPanels";
|
|
13789
13814
|
|
|
13790
13815
|
// src/components/Tag/Tag.tsx
|
|
13791
|
-
var
|
|
13792
|
-
var
|
|
13816
|
+
var import_react116 = require("react");
|
|
13817
|
+
var import_styled_components95 = __toESM(require("styled-components"));
|
|
13793
13818
|
|
|
13794
13819
|
// src/components/Tag/Tag.tokens.tsx
|
|
13795
13820
|
var import_dds_design_tokens60 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -13894,9 +13919,9 @@ var tagTokens = {
|
|
|
13894
13919
|
};
|
|
13895
13920
|
|
|
13896
13921
|
// src/components/Tag/Tag.tsx
|
|
13897
|
-
var
|
|
13922
|
+
var import_jsx_runtime270 = require("react/jsx-runtime");
|
|
13898
13923
|
var { wrapper: wrapper8 } = tagTokens;
|
|
13899
|
-
var Wrapper7 = (0,
|
|
13924
|
+
var Wrapper7 = (0, import_styled_components95.default)(TextOverflowEllipsisWrapper)`
|
|
13900
13925
|
display: inline-flex;
|
|
13901
13926
|
align-items: center;
|
|
13902
13927
|
gap: ${tagTokens.wrapper.icon.gap};
|
|
@@ -13904,18 +13929,18 @@ var Wrapper7 = (0, import_styled_components94.default)(TextOverflowEllipsisWrapp
|
|
|
13904
13929
|
border-radius: ${wrapper8.borderRadius};
|
|
13905
13930
|
padding: ${({ $withIcon }) => $withIcon ? wrapper8.icon.padding : wrapper8.padding};
|
|
13906
13931
|
${getFontStyling(typographyType5)}
|
|
13907
|
-
${({ $purpose, $strong }) =>
|
|
13932
|
+
${({ $purpose, $strong }) => import_styled_components95.css`
|
|
13908
13933
|
background-color: ${wrapper8.purpose[$purpose][$strong ? "strong" : "base"].backgroundColor};
|
|
13909
13934
|
border-color: ${wrapper8.purpose[$purpose][$strong ? "strong" : "base"].borderColor};
|
|
13910
13935
|
`}
|
|
13911
13936
|
`;
|
|
13912
|
-
var StyledIcon4 = (0,
|
|
13937
|
+
var StyledIcon4 = (0, import_styled_components95.default)(Icon)`
|
|
13913
13938
|
color: ${({ $purpose, $strong }) => {
|
|
13914
13939
|
var _a;
|
|
13915
13940
|
return (_a = wrapper8.purpose[$purpose][$strong ? "strong" : "base"].icon) == null ? void 0 : _a.color;
|
|
13916
13941
|
}};
|
|
13917
13942
|
`;
|
|
13918
|
-
var Tag = (0,
|
|
13943
|
+
var Tag = (0, import_react116.forwardRef)((props, ref) => {
|
|
13919
13944
|
const {
|
|
13920
13945
|
text,
|
|
13921
13946
|
purpose = "default",
|
|
@@ -13928,7 +13953,7 @@ var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
|
13928
13953
|
...rest
|
|
13929
13954
|
} = props;
|
|
13930
13955
|
const icon11 = tagTokens.wrapper.purpose[purpose].icon;
|
|
13931
|
-
return /* @__PURE__ */ (0,
|
|
13956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(
|
|
13932
13957
|
Wrapper7,
|
|
13933
13958
|
{
|
|
13934
13959
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -13937,7 +13962,7 @@ var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
|
13937
13962
|
$strong: strong,
|
|
13938
13963
|
$withIcon: Boolean(withIcon && icon11),
|
|
13939
13964
|
children: [
|
|
13940
|
-
withIcon && icon11 && /* @__PURE__ */ (0,
|
|
13965
|
+
withIcon && icon11 && /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(
|
|
13941
13966
|
StyledIcon4,
|
|
13942
13967
|
{
|
|
13943
13968
|
$purpose: purpose,
|
|
@@ -13946,7 +13971,7 @@ var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
|
13946
13971
|
iconSize: tagTokens.wrapper.icon.size
|
|
13947
13972
|
}
|
|
13948
13973
|
),
|
|
13949
|
-
/* @__PURE__ */ (0,
|
|
13974
|
+
/* @__PURE__ */ (0, import_jsx_runtime270.jsx)(TextOverflowEllipsisInner, { children: children != null ? children : text })
|
|
13950
13975
|
]
|
|
13951
13976
|
}
|
|
13952
13977
|
);
|
|
@@ -13954,21 +13979,21 @@ var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
|
13954
13979
|
Tag.displayName = "Tag";
|
|
13955
13980
|
|
|
13956
13981
|
// src/components/TextInput/TextInput.tsx
|
|
13957
|
-
var
|
|
13958
|
-
var
|
|
13982
|
+
var import_react118 = require("react");
|
|
13983
|
+
var import_styled_components98 = __toESM(require("styled-components"));
|
|
13959
13984
|
|
|
13960
13985
|
// src/components/TextInput/CharCounter.tsx
|
|
13961
|
-
var
|
|
13962
|
-
var
|
|
13963
|
-
var
|
|
13964
|
-
var Wrapper8 = (0,
|
|
13986
|
+
var import_react117 = require("react");
|
|
13987
|
+
var import_styled_components96 = __toESM(require("styled-components"));
|
|
13988
|
+
var import_jsx_runtime271 = require("react/jsx-runtime");
|
|
13989
|
+
var Wrapper8 = (0, import_styled_components96.default)(Typography)`
|
|
13965
13990
|
margin-left: auto;
|
|
13966
13991
|
`;
|
|
13967
13992
|
function CharCounter(props) {
|
|
13968
13993
|
const { current, max, id, className, htmlProps, ...rest } = props;
|
|
13969
|
-
const generatedId = (0,
|
|
13994
|
+
const generatedId = (0, import_react117.useId)();
|
|
13970
13995
|
const uniqueId = id != null ? id : `${generatedId}-characterCounter`;
|
|
13971
|
-
return /* @__PURE__ */ (0,
|
|
13996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(
|
|
13972
13997
|
Wrapper8,
|
|
13973
13998
|
{
|
|
13974
13999
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
@@ -13987,7 +14012,7 @@ var CharCounter_default = CharCounter;
|
|
|
13987
14012
|
|
|
13988
14013
|
// src/components/TextInput/TextInput.styles.tsx
|
|
13989
14014
|
var import_dds_design_tokens62 = require("@norges-domstoler/dds-design-tokens");
|
|
13990
|
-
var
|
|
14015
|
+
var import_styled_components97 = __toESM(require("styled-components"));
|
|
13991
14016
|
|
|
13992
14017
|
// src/components/TextInput/TextInput.tokens.tsx
|
|
13993
14018
|
var import_dds_design_tokens61 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -14036,31 +14061,31 @@ var textInputTokens = {
|
|
|
14036
14061
|
// src/components/TextInput/TextInput.styles.tsx
|
|
14037
14062
|
var { iconSizes: iconSizes5 } = import_dds_design_tokens62.ddsBaseTokens;
|
|
14038
14063
|
var { input: input6, icon: icon10 } = textInputTokens;
|
|
14039
|
-
var MessageContainer2 =
|
|
14064
|
+
var MessageContainer2 = import_styled_components97.default.div`
|
|
14040
14065
|
display: flex;
|
|
14041
14066
|
justify-content: space-between;
|
|
14042
14067
|
`;
|
|
14043
|
-
var StyledIcon5 = (0,
|
|
14068
|
+
var StyledIcon5 = (0, import_styled_components97.default)(Icon)`
|
|
14044
14069
|
position: absolute;
|
|
14045
14070
|
color: ${icon10.color};
|
|
14046
|
-
${({ $size, iconSize }) =>
|
|
14071
|
+
${({ $size, iconSize }) => import_styled_components97.css`
|
|
14047
14072
|
left: ${icon10.sizes[$size].left};
|
|
14048
|
-
${iconSize === "small" ?
|
|
14073
|
+
${iconSize === "small" ? import_styled_components97.css`
|
|
14049
14074
|
top: ${`calc(50% - ${iconSizes5.DdsIconsizeSmallNumberPx / 2}px)`};
|
|
14050
|
-
` :
|
|
14075
|
+
` : import_styled_components97.css`
|
|
14051
14076
|
top: ${`calc(50% - ${iconSizes5.DdsIconsizeMediumNumberPx / 2}px)`};
|
|
14052
14077
|
`}
|
|
14053
14078
|
`}
|
|
14054
14079
|
z-index: 1;
|
|
14055
14080
|
`;
|
|
14056
|
-
var StyledInput = (0,
|
|
14057
|
-
${({ componentSize, $hasIcon }) => $hasIcon && componentSize &&
|
|
14081
|
+
var StyledInput = (0, import_styled_components97.default)(StatefulInput)`
|
|
14082
|
+
${({ componentSize, $hasIcon }) => $hasIcon && componentSize && import_styled_components97.css`
|
|
14058
14083
|
padding-left: ${input6.withIcon[componentSize].paddingLeft};
|
|
14059
14084
|
`}
|
|
14060
14085
|
`;
|
|
14061
14086
|
|
|
14062
14087
|
// src/components/TextInput/TextInput.tsx
|
|
14063
|
-
var
|
|
14088
|
+
var import_jsx_runtime272 = require("react/jsx-runtime");
|
|
14064
14089
|
var defaultWidth5 = "320px";
|
|
14065
14090
|
var defaultTinyWidth = "210px";
|
|
14066
14091
|
var getWidth = (size2, width) => {
|
|
@@ -14071,7 +14096,7 @@ var getWidth = (size2, width) => {
|
|
|
14071
14096
|
}
|
|
14072
14097
|
return defaultWidth5;
|
|
14073
14098
|
};
|
|
14074
|
-
var Affix =
|
|
14099
|
+
var Affix = import_styled_components98.default.span`
|
|
14075
14100
|
position: absolute;
|
|
14076
14101
|
height: 100%;
|
|
14077
14102
|
top: 50%;
|
|
@@ -14081,31 +14106,31 @@ var Affix = import_styled_components97.default.span`
|
|
|
14081
14106
|
pointer-events: none;
|
|
14082
14107
|
z-index: 1;
|
|
14083
14108
|
`;
|
|
14084
|
-
var Prefix = (0,
|
|
14109
|
+
var Prefix = (0, import_styled_components98.default)(Affix)`
|
|
14085
14110
|
left: 0;
|
|
14086
14111
|
margin-left: 8px;
|
|
14087
14112
|
padding-right: 8px;
|
|
14088
14113
|
border-right: 1px solid ${textInputTokens.affix.border.color};
|
|
14089
14114
|
|
|
14090
|
-
${({ readOnly }) => readOnly &&
|
|
14115
|
+
${({ readOnly }) => readOnly && import_styled_components98.css`
|
|
14091
14116
|
margin-left: 0;
|
|
14092
14117
|
padding-right: 0.5ch;
|
|
14093
14118
|
border-right: none;
|
|
14094
14119
|
`};
|
|
14095
14120
|
`;
|
|
14096
|
-
var Suffix = (0,
|
|
14121
|
+
var Suffix = (0, import_styled_components98.default)(Affix)`
|
|
14097
14122
|
right: 0;
|
|
14098
14123
|
margin-right: 8px;
|
|
14099
14124
|
padding-left: 8px;
|
|
14100
14125
|
border-left: 1px solid ${textInputTokens.affix.border.color};
|
|
14101
14126
|
|
|
14102
|
-
${({ readOnly }) => readOnly &&
|
|
14127
|
+
${({ readOnly }) => readOnly && import_styled_components98.css`
|
|
14103
14128
|
margin-right: 0;
|
|
14104
14129
|
padding-left: 0.5ch;
|
|
14105
14130
|
border-left: none;
|
|
14106
14131
|
`};
|
|
14107
14132
|
`;
|
|
14108
|
-
var TextInput2 = (0,
|
|
14133
|
+
var TextInput2 = (0, import_react118.forwardRef)(
|
|
14109
14134
|
({
|
|
14110
14135
|
label: label3,
|
|
14111
14136
|
disabled,
|
|
@@ -14131,14 +14156,14 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14131
14156
|
suffix,
|
|
14132
14157
|
...rest
|
|
14133
14158
|
}, ref) => {
|
|
14134
|
-
const [text, setText] = (0,
|
|
14159
|
+
const [text, setText] = (0, import_react118.useState)(
|
|
14135
14160
|
getDefaultText(value, defaultValue)
|
|
14136
14161
|
);
|
|
14137
|
-
const prefixRef = (0,
|
|
14138
|
-
const suffixRef = (0,
|
|
14139
|
-
const [prefixLength, setPrefixLength] = (0,
|
|
14140
|
-
const [suffixLength, setSuffixLength] = (0,
|
|
14141
|
-
(0,
|
|
14162
|
+
const prefixRef = (0, import_react118.useRef)(null);
|
|
14163
|
+
const suffixRef = (0, import_react118.useRef)(null);
|
|
14164
|
+
const [prefixLength, setPrefixLength] = (0, import_react118.useState)(0);
|
|
14165
|
+
const [suffixLength, setSuffixLength] = (0, import_react118.useState)(0);
|
|
14166
|
+
(0, import_react118.useLayoutEffect)(() => {
|
|
14142
14167
|
if (prefixRef.current) {
|
|
14143
14168
|
setPrefixLength(prefixRef.current.offsetWidth);
|
|
14144
14169
|
}
|
|
@@ -14152,7 +14177,7 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14152
14177
|
onChange(event);
|
|
14153
14178
|
}
|
|
14154
14179
|
};
|
|
14155
|
-
const generatedId = (0,
|
|
14180
|
+
const generatedId = (0, import_react118.useId)();
|
|
14156
14181
|
const uniqueId = id != null ? id : `${generatedId}-textInput`;
|
|
14157
14182
|
const hasErrorMessage = !!errorMessage;
|
|
14158
14183
|
const hasTip = !!tip;
|
|
@@ -14194,8 +14219,8 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14194
14219
|
const showRequiredStyling = !!(required || ariaRequired);
|
|
14195
14220
|
let extendedInput = null;
|
|
14196
14221
|
if (hasIcon) {
|
|
14197
|
-
extendedInput = /* @__PURE__ */ (0,
|
|
14198
|
-
/* @__PURE__ */ (0,
|
|
14222
|
+
extendedInput = /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(InputContainer, { children: [
|
|
14223
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14199
14224
|
StyledIcon5,
|
|
14200
14225
|
{
|
|
14201
14226
|
icon: icon11,
|
|
@@ -14203,7 +14228,7 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14203
14228
|
$size: componentSize
|
|
14204
14229
|
}
|
|
14205
14230
|
),
|
|
14206
|
-
/* @__PURE__ */ (0,
|
|
14231
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14207
14232
|
StyledInput,
|
|
14208
14233
|
{
|
|
14209
14234
|
ref,
|
|
@@ -14216,9 +14241,9 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14216
14241
|
)
|
|
14217
14242
|
] });
|
|
14218
14243
|
} else if (hasAffix) {
|
|
14219
|
-
extendedInput = /* @__PURE__ */ (0,
|
|
14220
|
-
prefix2 && /* @__PURE__ */ (0,
|
|
14221
|
-
/* @__PURE__ */ (0,
|
|
14244
|
+
extendedInput = /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(InputAffixContainer, { children: [
|
|
14245
|
+
prefix2 && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(Prefix, { readOnly, ref: prefixRef, "aria-hidden": true, children: prefix2 }),
|
|
14246
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14222
14247
|
StatefulInput,
|
|
14223
14248
|
{
|
|
14224
14249
|
ref,
|
|
@@ -14230,12 +14255,12 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14230
14255
|
...generalInputProps
|
|
14231
14256
|
}
|
|
14232
14257
|
),
|
|
14233
|
-
suffix && /* @__PURE__ */ (0,
|
|
14258
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(Suffix, { readOnly, ref: suffixRef, "aria-hidden": true, children: suffix })
|
|
14234
14259
|
] });
|
|
14235
14260
|
}
|
|
14236
|
-
return /* @__PURE__ */ (0,
|
|
14237
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
14238
|
-
extendedInput ? extendedInput : /* @__PURE__ */ (0,
|
|
14261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(OuterInputContainer, { ...outerInputContainerProps, children: [
|
|
14262
|
+
hasLabel && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(Label, { htmlFor: uniqueId, showRequiredStyling, children: label3 }),
|
|
14263
|
+
extendedInput ? extendedInput : /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14239
14264
|
StatefulInput,
|
|
14240
14265
|
{
|
|
14241
14266
|
ref,
|
|
@@ -14245,9 +14270,9 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14245
14270
|
...generalInputProps
|
|
14246
14271
|
}
|
|
14247
14272
|
),
|
|
14248
|
-
hasMessage && /* @__PURE__ */ (0,
|
|
14273
|
+
hasMessage && /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(MessageContainer2, { children: [
|
|
14249
14274
|
renderInputMessage(tip, tipId, errorMessage, errorMessageId),
|
|
14250
|
-
maxLength && Number.isInteger(maxLength) && maxLength > 0 && withCharacterCounter && /* @__PURE__ */ (0,
|
|
14275
|
+
maxLength && Number.isInteger(maxLength) && maxLength > 0 && withCharacterCounter && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14251
14276
|
CharCounter_default,
|
|
14252
14277
|
{
|
|
14253
14278
|
id: characterCounterId,
|
|
@@ -14262,15 +14287,15 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14262
14287
|
TextInput2.displayName = "TextInput";
|
|
14263
14288
|
|
|
14264
14289
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
14265
|
-
var
|
|
14266
|
-
var
|
|
14290
|
+
var import_react120 = require("react");
|
|
14291
|
+
var import_styled_components99 = __toESM(require("styled-components"));
|
|
14267
14292
|
|
|
14268
14293
|
// src/components/ToggleBar/ToggleBar.context.tsx
|
|
14269
|
-
var
|
|
14270
|
-
var ToggleBarContext = (0,
|
|
14294
|
+
var import_react119 = require("react");
|
|
14295
|
+
var ToggleBarContext = (0, import_react119.createContext)({
|
|
14271
14296
|
size: "medium"
|
|
14272
14297
|
});
|
|
14273
|
-
var useToggleBarContext = () => (0,
|
|
14298
|
+
var useToggleBarContext = () => (0, import_react119.useContext)(ToggleBarContext);
|
|
14274
14299
|
|
|
14275
14300
|
// src/components/ToggleBar/ToggleBar.tokens.tsx
|
|
14276
14301
|
var import_dds_design_tokens63 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -14379,8 +14404,8 @@ var toggleBarTokens = {
|
|
|
14379
14404
|
};
|
|
14380
14405
|
|
|
14381
14406
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
14382
|
-
var
|
|
14383
|
-
var OuterContainer3 =
|
|
14407
|
+
var import_jsx_runtime273 = require("react/jsx-runtime");
|
|
14408
|
+
var OuterContainer3 = import_styled_components99.default.div`
|
|
14384
14409
|
display: flex;
|
|
14385
14410
|
flex-direction: column;
|
|
14386
14411
|
gap: ${toggleBarTokens.outerContainer.gap};
|
|
@@ -14388,11 +14413,11 @@ var OuterContainer3 = import_styled_components98.default.div`
|
|
|
14388
14413
|
*::selection {
|
|
14389
14414
|
${selection}
|
|
14390
14415
|
}
|
|
14391
|
-
${({ $width }) => $width &&
|
|
14416
|
+
${({ $width }) => $width && import_styled_components99.css`
|
|
14392
14417
|
width: ${$width};
|
|
14393
14418
|
`}
|
|
14394
14419
|
`;
|
|
14395
|
-
var Bar3 =
|
|
14420
|
+
var Bar3 = import_styled_components99.default.div`
|
|
14396
14421
|
display: grid;
|
|
14397
14422
|
grid-auto-flow: column;
|
|
14398
14423
|
grid-auto-columns: 1fr;
|
|
@@ -14411,15 +14436,15 @@ var ToggleBar = (props) => {
|
|
|
14411
14436
|
id,
|
|
14412
14437
|
...rest
|
|
14413
14438
|
} = props;
|
|
14414
|
-
const generatedId = (0,
|
|
14439
|
+
const generatedId = (0, import_react120.useId)();
|
|
14415
14440
|
const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
|
|
14416
|
-
const [groupValue, setGroupValue] = (0,
|
|
14441
|
+
const [groupValue, setGroupValue] = (0, import_react120.useState)(value);
|
|
14417
14442
|
const handleChange = combineHandlers(
|
|
14418
14443
|
(e) => setGroupValue(e.target.value),
|
|
14419
14444
|
(e) => onChange && onChange(e, e.target.value)
|
|
14420
14445
|
);
|
|
14421
14446
|
const labelId = label3 && `${uniqueId}-label`;
|
|
14422
|
-
return /* @__PURE__ */ (0,
|
|
14447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
|
|
14423
14448
|
ToggleBarContext.Provider,
|
|
14424
14449
|
{
|
|
14425
14450
|
value: {
|
|
@@ -14428,7 +14453,7 @@ var ToggleBar = (props) => {
|
|
|
14428
14453
|
name,
|
|
14429
14454
|
value: groupValue
|
|
14430
14455
|
},
|
|
14431
|
-
children: /* @__PURE__ */ (0,
|
|
14456
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(
|
|
14432
14457
|
OuterContainer3,
|
|
14433
14458
|
{
|
|
14434
14459
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -14436,8 +14461,8 @@ var ToggleBar = (props) => {
|
|
|
14436
14461
|
"aria-labelledby": labelId != null ? labelId : htmlProps == null ? void 0 : htmlProps["aria-labelledby"],
|
|
14437
14462
|
$width: width,
|
|
14438
14463
|
children: [
|
|
14439
|
-
label3 && /* @__PURE__ */ (0,
|
|
14440
|
-
/* @__PURE__ */ (0,
|
|
14464
|
+
label3 && /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(Typography, { typographyType: "supportingStyleLabel01", id: labelId, children: label3 }),
|
|
14465
|
+
/* @__PURE__ */ (0, import_jsx_runtime273.jsx)(Bar3, { children })
|
|
14441
14466
|
]
|
|
14442
14467
|
}
|
|
14443
14468
|
)
|
|
@@ -14447,12 +14472,12 @@ var ToggleBar = (props) => {
|
|
|
14447
14472
|
ToggleBar.displayName = "ToggleBar";
|
|
14448
14473
|
|
|
14449
14474
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
14450
|
-
var
|
|
14475
|
+
var import_react121 = require("react");
|
|
14451
14476
|
|
|
14452
14477
|
// src/components/ToggleBar/ToggleRadio.styles.tsx
|
|
14453
|
-
var
|
|
14478
|
+
var import_styled_components100 = __toESM(require("styled-components"));
|
|
14454
14479
|
var { content: content8, label: label2 } = toggleBarTokens;
|
|
14455
|
-
var Content2 =
|
|
14480
|
+
var Content2 = import_styled_components100.default.span`
|
|
14456
14481
|
display: flex;
|
|
14457
14482
|
justify-content: center;
|
|
14458
14483
|
align-items: center;
|
|
@@ -14470,18 +14495,18 @@ var Content2 = import_styled_components99.default.span`
|
|
|
14470
14495
|
}
|
|
14471
14496
|
background-color: ${content8.base.backgroundColor};
|
|
14472
14497
|
|
|
14473
|
-
${({ $size, $justIcon }) =>
|
|
14474
|
-
${$justIcon ?
|
|
14498
|
+
${({ $size, $justIcon }) => import_styled_components100.css`
|
|
14499
|
+
${$justIcon ? import_styled_components100.css`
|
|
14475
14500
|
font-size: ${content8.size[$size].justIcon.fontSize};
|
|
14476
14501
|
padding: ${content8.size[$size].justIcon.padding};
|
|
14477
|
-
` :
|
|
14502
|
+
` : import_styled_components100.css`
|
|
14478
14503
|
gap: ${content8.size[$size].withText.gap};
|
|
14479
14504
|
padding: ${content8.size[$size].withText.padding};
|
|
14480
14505
|
${getFontStyling(typographyTypes6[$size])}
|
|
14481
14506
|
`}
|
|
14482
14507
|
`}
|
|
14483
14508
|
`;
|
|
14484
|
-
var Label3 =
|
|
14509
|
+
var Label3 = import_styled_components100.default.label`
|
|
14485
14510
|
${Content2} {
|
|
14486
14511
|
border-right: ${label2.base.borderRight};
|
|
14487
14512
|
border-top: ${label2.base.borderTop};
|
|
@@ -14519,7 +14544,7 @@ var Label3 = import_styled_components99.default.label`
|
|
|
14519
14544
|
`;
|
|
14520
14545
|
|
|
14521
14546
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
14522
|
-
var
|
|
14547
|
+
var import_jsx_runtime274 = require("react/jsx-runtime");
|
|
14523
14548
|
var calculateChecked = (value, group4, checked) => {
|
|
14524
14549
|
if (typeof checked !== "undefined")
|
|
14525
14550
|
return checked;
|
|
@@ -14531,7 +14556,7 @@ var calculateChecked = (value, group4, checked) => {
|
|
|
14531
14556
|
}
|
|
14532
14557
|
return !!value;
|
|
14533
14558
|
};
|
|
14534
|
-
var ToggleRadio = (0,
|
|
14559
|
+
var ToggleRadio = (0, import_react121.forwardRef)(
|
|
14535
14560
|
(props, ref) => {
|
|
14536
14561
|
const {
|
|
14537
14562
|
value,
|
|
@@ -14547,15 +14572,15 @@ var ToggleRadio = (0, import_react120.forwardRef)(
|
|
|
14547
14572
|
id,
|
|
14548
14573
|
...rest
|
|
14549
14574
|
} = props;
|
|
14550
|
-
const generatedId = (0,
|
|
14575
|
+
const generatedId = (0, import_react121.useId)();
|
|
14551
14576
|
const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
|
|
14552
14577
|
const group4 = useToggleBarContext();
|
|
14553
14578
|
const handleChange = (event) => {
|
|
14554
14579
|
onChange && onChange(event);
|
|
14555
14580
|
(group4 == null ? void 0 : group4.onChange) && group4.onChange(event);
|
|
14556
14581
|
};
|
|
14557
|
-
return /* @__PURE__ */ (0,
|
|
14558
|
-
/* @__PURE__ */ (0,
|
|
14582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime274.jsxs)(Label3, { size: group4.size, htmlFor: uniqueId, children: [
|
|
14583
|
+
/* @__PURE__ */ (0, import_jsx_runtime274.jsx)(
|
|
14559
14584
|
HiddenInput,
|
|
14560
14585
|
{
|
|
14561
14586
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
@@ -14569,9 +14594,9 @@ var ToggleRadio = (0, import_react120.forwardRef)(
|
|
|
14569
14594
|
"aria-labelledby": ariaLabelledBy
|
|
14570
14595
|
}
|
|
14571
14596
|
),
|
|
14572
|
-
/* @__PURE__ */ (0,
|
|
14573
|
-
icon11 && /* @__PURE__ */ (0,
|
|
14574
|
-
label3 && /* @__PURE__ */ (0,
|
|
14597
|
+
/* @__PURE__ */ (0, import_jsx_runtime274.jsxs)(Content2, { $size: group4.size, $justIcon: !!icon11 && !label3, children: [
|
|
14598
|
+
icon11 && /* @__PURE__ */ (0, import_jsx_runtime274.jsx)(Icon, { icon: icon11, iconSize: "inherit" }),
|
|
14599
|
+
label3 && /* @__PURE__ */ (0, import_jsx_runtime274.jsx)("span", { children: label3 })
|
|
14575
14600
|
] })
|
|
14576
14601
|
] });
|
|
14577
14602
|
}
|
|
@@ -14579,8 +14604,8 @@ var ToggleRadio = (0, import_react120.forwardRef)(
|
|
|
14579
14604
|
ToggleRadio.displayName = "ToggleRadio";
|
|
14580
14605
|
|
|
14581
14606
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
14582
|
-
var
|
|
14583
|
-
var
|
|
14607
|
+
var import_react122 = require("react");
|
|
14608
|
+
var import_styled_components101 = __toESM(require("styled-components"));
|
|
14584
14609
|
|
|
14585
14610
|
// src/components/ToggleButton/ToggleButton.tokens.tsx
|
|
14586
14611
|
var import_dds_design_tokens64 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -14615,9 +14640,9 @@ var toggleButtonTokens = {
|
|
|
14615
14640
|
};
|
|
14616
14641
|
|
|
14617
14642
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
14618
|
-
var
|
|
14643
|
+
var import_jsx_runtime275 = require("react/jsx-runtime");
|
|
14619
14644
|
var { toggleButton: toggleButton2 } = toggleButtonTokens;
|
|
14620
|
-
var Content3 =
|
|
14645
|
+
var Content3 = import_styled_components101.default.span`
|
|
14621
14646
|
display: flex;
|
|
14622
14647
|
align-items: center;
|
|
14623
14648
|
width: 100%;
|
|
@@ -14639,7 +14664,7 @@ var Content3 = import_styled_components100.default.span`
|
|
|
14639
14664
|
${focusVisibleTransitionValue};
|
|
14640
14665
|
}
|
|
14641
14666
|
|
|
14642
|
-
${({ $hasIcon }) => $hasIcon &&
|
|
14667
|
+
${({ $hasIcon }) => $hasIcon && import_styled_components101.css`
|
|
14643
14668
|
gap: ${toggleButton2.gap};
|
|
14644
14669
|
`}
|
|
14645
14670
|
|
|
@@ -14653,7 +14678,7 @@ var Content3 = import_styled_components100.default.span`
|
|
|
14653
14678
|
border-color: ${toggleButton2.hover.borderColor};
|
|
14654
14679
|
}
|
|
14655
14680
|
`;
|
|
14656
|
-
var Container16 =
|
|
14681
|
+
var Container16 = import_styled_components101.default.label`
|
|
14657
14682
|
width: fit-content;
|
|
14658
14683
|
${HiddenInput}:checked + ${Content3} {
|
|
14659
14684
|
background-color: ${toggleButton2.checked.backgroundColor};
|
|
@@ -14669,12 +14694,12 @@ var Container16 = import_styled_components100.default.label`
|
|
|
14669
14694
|
${focusVisible}
|
|
14670
14695
|
}
|
|
14671
14696
|
`;
|
|
14672
|
-
var ToggleButton = (0,
|
|
14697
|
+
var ToggleButton = (0, import_react122.forwardRef)(
|
|
14673
14698
|
({ id, label: label3, icon: icon11, className, htmlProps, ...rest }, ref) => {
|
|
14674
|
-
const generatedId = (0,
|
|
14699
|
+
const generatedId = (0, import_react122.useId)();
|
|
14675
14700
|
const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
|
|
14676
|
-
return /* @__PURE__ */ (0,
|
|
14677
|
-
/* @__PURE__ */ (0,
|
|
14701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)(Container16, { htmlFor: uniqueId, children: [
|
|
14702
|
+
/* @__PURE__ */ (0, import_jsx_runtime275.jsx)(
|
|
14678
14703
|
HiddenInput,
|
|
14679
14704
|
{
|
|
14680
14705
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
@@ -14682,8 +14707,8 @@ var ToggleButton = (0, import_react121.forwardRef)(
|
|
|
14682
14707
|
type: "checkbox"
|
|
14683
14708
|
}
|
|
14684
14709
|
),
|
|
14685
|
-
/* @__PURE__ */ (0,
|
|
14686
|
-
icon11 && /* @__PURE__ */ (0,
|
|
14710
|
+
/* @__PURE__ */ (0, import_jsx_runtime275.jsxs)(Content3, { $hasIcon: !!icon11, children: [
|
|
14711
|
+
icon11 && /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(Icon, { icon: icon11, iconSize: "inherit" }),
|
|
14687
14712
|
" ",
|
|
14688
14713
|
label3
|
|
14689
14714
|
] })
|
|
@@ -14693,18 +14718,18 @@ var ToggleButton = (0, import_react121.forwardRef)(
|
|
|
14693
14718
|
ToggleButton.displayName = "ToggleButton";
|
|
14694
14719
|
|
|
14695
14720
|
// src/components/ToggleButton/ToggleButtonGroup.tsx
|
|
14696
|
-
var
|
|
14697
|
-
var
|
|
14698
|
-
var
|
|
14699
|
-
var Group2 =
|
|
14721
|
+
var import_react123 = require("react");
|
|
14722
|
+
var import_styled_components102 = __toESM(require("styled-components"));
|
|
14723
|
+
var import_jsx_runtime276 = require("react/jsx-runtime");
|
|
14724
|
+
var Group2 = import_styled_components102.default.div`
|
|
14700
14725
|
gap: ${toggleButtonTokens.group.gap};
|
|
14701
14726
|
display: flex;
|
|
14702
14727
|
flex-wrap: wrap;
|
|
14703
|
-
${({ direction }) =>
|
|
14728
|
+
${({ direction }) => import_styled_components102.css`
|
|
14704
14729
|
flex-direction: ${direction};
|
|
14705
14730
|
`}
|
|
14706
14731
|
`;
|
|
14707
|
-
var Container17 =
|
|
14732
|
+
var Container17 = import_styled_components102.default.div`
|
|
14708
14733
|
display: flex;
|
|
14709
14734
|
flex-direction: column;
|
|
14710
14735
|
gap: ${toggleButtonTokens.container.gap};
|
|
@@ -14720,7 +14745,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
14720
14745
|
htmlProps,
|
|
14721
14746
|
...rest
|
|
14722
14747
|
} = props;
|
|
14723
|
-
const generatedId = (0,
|
|
14748
|
+
const generatedId = (0, import_react123.useId)();
|
|
14724
14749
|
const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
|
|
14725
14750
|
const groupProps = {
|
|
14726
14751
|
direction
|
|
@@ -14730,8 +14755,8 @@ var ToggleButtonGroup = (props) => {
|
|
|
14730
14755
|
role: "group",
|
|
14731
14756
|
"aria-labelledby": label3 ? uniqueLabelId : void 0
|
|
14732
14757
|
};
|
|
14733
|
-
return /* @__PURE__ */ (0,
|
|
14734
|
-
!!label3 && /* @__PURE__ */ (0,
|
|
14758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime276.jsxs)(Container17, { ...containerProps, children: [
|
|
14759
|
+
!!label3 && /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(
|
|
14735
14760
|
Typography,
|
|
14736
14761
|
{
|
|
14737
14762
|
as: "span",
|
|
@@ -14740,7 +14765,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
14740
14765
|
children: label3
|
|
14741
14766
|
}
|
|
14742
14767
|
),
|
|
14743
|
-
/* @__PURE__ */ (0,
|
|
14768
|
+
/* @__PURE__ */ (0, import_jsx_runtime276.jsx)(Group2, { ...groupProps, children })
|
|
14744
14769
|
] });
|
|
14745
14770
|
};
|
|
14746
14771
|
ToggleButtonGroup.displayName = "ToggleButtonGroup";
|
|
@@ -14866,6 +14891,7 @@ ToggleButtonGroup.displayName = "ToggleButtonGroup";
|
|
|
14866
14891
|
Icon,
|
|
14867
14892
|
ImageIcon,
|
|
14868
14893
|
InfoIcon,
|
|
14894
|
+
InlineButton,
|
|
14869
14895
|
InlineEditInput,
|
|
14870
14896
|
InlineEditTextArea,
|
|
14871
14897
|
Input,
|