@norges-domstoler/dds-components 0.0.0-dev-20240306143937 → 0.0.0-dev-20240307131621
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 +669 -650
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +425 -407
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -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,
|
|
@@ -9018,12 +9019,29 @@ var GridChild = (props) => {
|
|
|
9018
9019
|
};
|
|
9019
9020
|
GridChild.displayName = "GridChild";
|
|
9020
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
|
+
|
|
9021
9039
|
// src/components/InlineEdit/InlineEditTextArea.tsx
|
|
9022
|
-
var
|
|
9040
|
+
var import_react68 = require("react");
|
|
9023
9041
|
|
|
9024
9042
|
// src/components/InlineEdit/InlineEdit.tsx
|
|
9025
|
-
var
|
|
9026
|
-
var
|
|
9043
|
+
var import_react66 = require("react");
|
|
9044
|
+
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
9027
9045
|
var InlineEdit = (props) => {
|
|
9028
9046
|
const {
|
|
9029
9047
|
emptiable,
|
|
@@ -9035,8 +9053,8 @@ var InlineEdit = (props) => {
|
|
|
9035
9053
|
inputRef,
|
|
9036
9054
|
children
|
|
9037
9055
|
} = props;
|
|
9038
|
-
const [editingValue, setEditingValue] = (0,
|
|
9039
|
-
const [isEditing, setIsEditing] = (0,
|
|
9056
|
+
const [editingValue, setEditingValue] = (0, import_react66.useState)(value != null ? value : "");
|
|
9057
|
+
const [isEditing, setIsEditing] = (0, import_react66.useState)(false);
|
|
9040
9058
|
const onChangeHandler = (e) => {
|
|
9041
9059
|
setEditingValue(e.target.value);
|
|
9042
9060
|
onChange && onChange();
|
|
@@ -9063,8 +9081,8 @@ var InlineEdit = (props) => {
|
|
|
9063
9081
|
useOnKeyDown(["Enter"], () => onExitHandler());
|
|
9064
9082
|
useOnKeyDown(["Escape"], () => onExitHandler());
|
|
9065
9083
|
useOnClickOutside(inputRef.current, () => onExitHandler());
|
|
9066
|
-
const inputChild =
|
|
9067
|
-
(0,
|
|
9084
|
+
const inputChild = import_react66.Children.only(
|
|
9085
|
+
(0, import_react66.isValidElement)(children) && (0, import_react66.cloneElement)(children, {
|
|
9068
9086
|
onChange: onChangeHandler,
|
|
9069
9087
|
onBlur: onBlurHandler,
|
|
9070
9088
|
onFocus: onFocusHandler,
|
|
@@ -9073,15 +9091,15 @@ var InlineEdit = (props) => {
|
|
|
9073
9091
|
emptiable
|
|
9074
9092
|
})
|
|
9075
9093
|
);
|
|
9076
|
-
return /* @__PURE__ */ (0,
|
|
9094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_jsx_runtime224.Fragment, { children: inputChild });
|
|
9077
9095
|
};
|
|
9078
9096
|
InlineEdit.displayName = "InlineEdit";
|
|
9079
9097
|
|
|
9080
9098
|
// src/components/InlineEdit/InlineTextArea.tsx
|
|
9081
|
-
var
|
|
9099
|
+
var import_react67 = require("react");
|
|
9082
9100
|
|
|
9083
9101
|
// src/components/InlineEdit/InlineEdit.styles.tsx
|
|
9084
|
-
var
|
|
9102
|
+
var import_styled_components61 = __toESM(require("styled-components"));
|
|
9085
9103
|
|
|
9086
9104
|
// src/components/InlineEdit/InlineEdit.tokens.ts
|
|
9087
9105
|
var import_dds_design_tokens42 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -9112,14 +9130,14 @@ var inlineEditTokens = {
|
|
|
9112
9130
|
// src/components/InlineEdit/InlineEdit.styles.tsx
|
|
9113
9131
|
var { inlineEdit: inlineEdit2, iconWrapper: iconWrapper2 } = inlineEditTokens;
|
|
9114
9132
|
var defaultWidth3 = "140px";
|
|
9115
|
-
var StyledInlineInput = (0,
|
|
9133
|
+
var StyledInlineInput = (0, import_styled_components61.default)(StatefulInput).withConfig({
|
|
9116
9134
|
shouldForwardProp: (prop) => prop !== "isEditing" && prop !== "hideIcon"
|
|
9117
9135
|
})`
|
|
9118
9136
|
border-color: transparent;
|
|
9119
9137
|
background-color: ${inlineEdit2.backgroundColor};
|
|
9120
9138
|
padding: ${inlineEdit2.padding};
|
|
9121
9139
|
${inlineEdit2.font};
|
|
9122
|
-
${({ isEditing, hideIcon }) => !isEditing && !hideIcon &&
|
|
9140
|
+
${({ isEditing, hideIcon }) => !isEditing && !hideIcon && import_styled_components61.css`
|
|
9123
9141
|
padding-left: ${inlineEdit2.withIcon.paddingLeft};
|
|
9124
9142
|
`}
|
|
9125
9143
|
|
|
@@ -9132,14 +9150,14 @@ var StyledInlineInput = (0, import_styled_components60.default)(StatefulInput).w
|
|
|
9132
9150
|
background-color: ${inlineEdit2.focus.backgroundColor};
|
|
9133
9151
|
}
|
|
9134
9152
|
`;
|
|
9135
|
-
var StyledInlineTextArea = (0,
|
|
9153
|
+
var StyledInlineTextArea = (0, import_styled_components61.default)(StyledInlineInput).attrs({
|
|
9136
9154
|
as: "textarea"
|
|
9137
9155
|
})`
|
|
9138
9156
|
resize: vertical;
|
|
9139
9157
|
${scrollbarStyling.webkit}
|
|
9140
9158
|
${scrollbarStyling.firefox}
|
|
9141
9159
|
`;
|
|
9142
|
-
var IconWrapper2 =
|
|
9160
|
+
var IconWrapper2 = import_styled_components61.default.span`
|
|
9143
9161
|
position: absolute;
|
|
9144
9162
|
left: ${iconWrapper2.left};
|
|
9145
9163
|
top: ${iconWrapper2.top};
|
|
@@ -9150,16 +9168,16 @@ var IconWrapper2 = import_styled_components60.default.span`
|
|
|
9150
9168
|
`;
|
|
9151
9169
|
|
|
9152
9170
|
// src/components/InlineEdit/InlineEdit.utils.tsx
|
|
9153
|
-
var
|
|
9154
|
-
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: [
|
|
9155
9173
|
"Escape, Enter eller Tab for \xE5 lagre.",
|
|
9156
9174
|
" ",
|
|
9157
9175
|
!emptiable && "Inputfeltet er ikke t\xF8mmbar."
|
|
9158
9176
|
] });
|
|
9159
9177
|
|
|
9160
9178
|
// src/components/InlineEdit/InlineTextArea.tsx
|
|
9161
|
-
var
|
|
9162
|
-
var InlineTextArea = (0,
|
|
9179
|
+
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
9180
|
+
var InlineTextArea = (0, import_react67.forwardRef)((props, ref) => {
|
|
9163
9181
|
const {
|
|
9164
9182
|
id,
|
|
9165
9183
|
error,
|
|
@@ -9171,26 +9189,26 @@ var InlineTextArea = (0, import_react66.forwardRef)((props, ref) => {
|
|
|
9171
9189
|
hideIcon,
|
|
9172
9190
|
...rest
|
|
9173
9191
|
} = props;
|
|
9174
|
-
const genereatedId = (0,
|
|
9192
|
+
const genereatedId = (0, import_react67.useId)();
|
|
9175
9193
|
const uniqueId = id != null ? id : `${genereatedId}-InlineTextArea`;
|
|
9176
9194
|
const hasErrorMessage = !!errorMessage;
|
|
9177
9195
|
const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
|
|
9178
9196
|
const descId = derivativeIdGenerator(uniqueId, "desc");
|
|
9179
|
-
const inputRef = (0,
|
|
9197
|
+
const inputRef = (0, import_react67.useRef)(null);
|
|
9180
9198
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
9181
|
-
return /* @__PURE__ */ (0,
|
|
9182
|
-
/* @__PURE__ */ (0,
|
|
9183
|
-
!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)(
|
|
9184
9202
|
IconWrapper2,
|
|
9185
9203
|
{
|
|
9186
9204
|
onClick: () => {
|
|
9187
9205
|
var _a;
|
|
9188
9206
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
9189
9207
|
},
|
|
9190
|
-
children: /* @__PURE__ */ (0,
|
|
9208
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(Icon, { icon: EditIcon, iconSize: "small" })
|
|
9191
9209
|
}
|
|
9192
9210
|
),
|
|
9193
|
-
/* @__PURE__ */ (0,
|
|
9211
|
+
/* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
9194
9212
|
StyledInlineTextArea,
|
|
9195
9213
|
{
|
|
9196
9214
|
...rest,
|
|
@@ -9214,12 +9232,12 @@ var InlineTextArea = (0, import_react66.forwardRef)((props, ref) => {
|
|
|
9214
9232
|
InlineTextArea.displayName = "InlineTextArea";
|
|
9215
9233
|
|
|
9216
9234
|
// src/components/InlineEdit/InlineEditTextArea.tsx
|
|
9217
|
-
var
|
|
9218
|
-
var InlineEditTextArea = (0,
|
|
9235
|
+
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
9236
|
+
var InlineEditTextArea = (0, import_react68.forwardRef)((props, ref) => {
|
|
9219
9237
|
const { onSetValue, emptiable, value, onFocus, onChange, onBlur, ...rest } = props;
|
|
9220
|
-
const textareaRef = (0,
|
|
9238
|
+
const textareaRef = (0, import_react68.useRef)(null);
|
|
9221
9239
|
const combinedRef = useCombinedRef(ref, textareaRef);
|
|
9222
|
-
return /* @__PURE__ */ (0,
|
|
9240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(
|
|
9223
9241
|
InlineEdit,
|
|
9224
9242
|
{
|
|
9225
9243
|
onSetValue,
|
|
@@ -9229,18 +9247,18 @@ var InlineEditTextArea = (0, import_react67.forwardRef)((props, ref) => {
|
|
|
9229
9247
|
onFocus,
|
|
9230
9248
|
onChange,
|
|
9231
9249
|
onBlur,
|
|
9232
|
-
children: /* @__PURE__ */ (0,
|
|
9250
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(InlineTextArea, { ref: combinedRef, ...rest })
|
|
9233
9251
|
}
|
|
9234
9252
|
);
|
|
9235
9253
|
});
|
|
9236
9254
|
|
|
9237
9255
|
// src/components/InlineEdit/InlineEditInput.tsx
|
|
9238
|
-
var
|
|
9256
|
+
var import_react70 = require("react");
|
|
9239
9257
|
|
|
9240
9258
|
// src/components/InlineEdit/InlineInput.tsx
|
|
9241
|
-
var
|
|
9242
|
-
var
|
|
9243
|
-
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)(
|
|
9244
9262
|
(props, ref) => {
|
|
9245
9263
|
const {
|
|
9246
9264
|
id,
|
|
@@ -9253,28 +9271,28 @@ var InlineInput = (0, import_react68.forwardRef)(
|
|
|
9253
9271
|
hideIcon,
|
|
9254
9272
|
...rest
|
|
9255
9273
|
} = props;
|
|
9256
|
-
const genereatedId = (0,
|
|
9274
|
+
const genereatedId = (0, import_react69.useId)();
|
|
9257
9275
|
const uniqueId = id != null ? id : `${genereatedId}-InlineInput`;
|
|
9258
9276
|
const hasErrorMessage = !!errorMessage;
|
|
9259
9277
|
const hasError = !!error;
|
|
9260
9278
|
const hasErrorState = hasError || hasErrorMessage;
|
|
9261
9279
|
const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
|
|
9262
9280
|
const descId = derivativeIdGenerator(uniqueId, "desc");
|
|
9263
|
-
const inputRef = (0,
|
|
9281
|
+
const inputRef = (0, import_react69.useRef)(null);
|
|
9264
9282
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
9265
|
-
return /* @__PURE__ */ (0,
|
|
9266
|
-
/* @__PURE__ */ (0,
|
|
9267
|
-
!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)(
|
|
9268
9286
|
IconWrapper2,
|
|
9269
9287
|
{
|
|
9270
9288
|
onClick: () => {
|
|
9271
9289
|
var _a;
|
|
9272
9290
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
9273
9291
|
},
|
|
9274
|
-
children: /* @__PURE__ */ (0,
|
|
9292
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(Icon, { icon: EditIcon, iconSize: "small" })
|
|
9275
9293
|
}
|
|
9276
9294
|
),
|
|
9277
|
-
/* @__PURE__ */ (0,
|
|
9295
|
+
/* @__PURE__ */ (0, import_jsx_runtime228.jsx)(
|
|
9278
9296
|
StyledInlineInput,
|
|
9279
9297
|
{
|
|
9280
9298
|
...rest,
|
|
@@ -9300,12 +9318,12 @@ var InlineInput = (0, import_react68.forwardRef)(
|
|
|
9300
9318
|
InlineInput.displayName = "InlineInput";
|
|
9301
9319
|
|
|
9302
9320
|
// src/components/InlineEdit/InlineEditInput.tsx
|
|
9303
|
-
var
|
|
9304
|
-
var InlineEditInput = (0,
|
|
9321
|
+
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
9322
|
+
var InlineEditInput = (0, import_react70.forwardRef)((props, ref) => {
|
|
9305
9323
|
const { onSetValue, emptiable, value, onFocus, onChange, onBlur, ...rest } = props;
|
|
9306
|
-
const inputRef = (0,
|
|
9324
|
+
const inputRef = (0, import_react70.useRef)(null);
|
|
9307
9325
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
9308
|
-
return /* @__PURE__ */ (0,
|
|
9326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(
|
|
9309
9327
|
InlineEdit,
|
|
9310
9328
|
{
|
|
9311
9329
|
onSetValue,
|
|
@@ -9315,16 +9333,16 @@ var InlineEditInput = (0, import_react69.forwardRef)((props, ref) => {
|
|
|
9315
9333
|
onFocus,
|
|
9316
9334
|
onChange,
|
|
9317
9335
|
onBlur,
|
|
9318
|
-
children: /* @__PURE__ */ (0,
|
|
9336
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(InlineInput, { ...rest, ref: combinedRef })
|
|
9319
9337
|
}
|
|
9320
9338
|
);
|
|
9321
9339
|
});
|
|
9322
9340
|
|
|
9323
9341
|
// src/components/InternalHeader/InternalHeader.tsx
|
|
9324
|
-
var
|
|
9342
|
+
var import_react72 = require("react");
|
|
9325
9343
|
|
|
9326
9344
|
// src/components/InternalHeader/InternalHeader.styles.tsx
|
|
9327
|
-
var
|
|
9345
|
+
var import_styled_components62 = __toESM(require("styled-components"));
|
|
9328
9346
|
|
|
9329
9347
|
// src/components/InternalHeader/InternalHeader.tokens.tsx
|
|
9330
9348
|
var import_dds_design_tokens43 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -9348,7 +9366,7 @@ var internalHeaderTokens = {
|
|
|
9348
9366
|
|
|
9349
9367
|
// src/components/InternalHeader/InternalHeader.styles.tsx
|
|
9350
9368
|
var { bar: bar2, separator: separator2 } = internalHeaderTokens;
|
|
9351
|
-
var Bar2 =
|
|
9369
|
+
var Bar2 = import_styled_components62.default.div`
|
|
9352
9370
|
*::selection {
|
|
9353
9371
|
${selection}
|
|
9354
9372
|
}
|
|
@@ -9361,21 +9379,21 @@ var Bar2 = import_styled_components61.default.div`
|
|
|
9361
9379
|
padding-left: ${bar2.paddingLeft};
|
|
9362
9380
|
padding-right: ${bar2.paddingRight};
|
|
9363
9381
|
|
|
9364
|
-
${({ $hasNavigation }) => $hasNavigation ?
|
|
9382
|
+
${({ $hasNavigation }) => $hasNavigation ? import_styled_components62.css`
|
|
9365
9383
|
${ContextMenuGroup} {
|
|
9366
9384
|
margin-left: auto;
|
|
9367
9385
|
}
|
|
9368
|
-
` :
|
|
9386
|
+
` : import_styled_components62.css`
|
|
9369
9387
|
${BarSeparator} {
|
|
9370
9388
|
margin-left: auto;
|
|
9371
9389
|
}
|
|
9372
9390
|
`}
|
|
9373
9391
|
`;
|
|
9374
|
-
var BarSeparator =
|
|
9392
|
+
var BarSeparator = import_styled_components62.default.div`
|
|
9375
9393
|
border-left: ${separator2.width} solid ${separator2.color};
|
|
9376
9394
|
align-self: stretch;
|
|
9377
9395
|
`;
|
|
9378
|
-
var AppNameLink =
|
|
9396
|
+
var AppNameLink = import_styled_components62.default.a`
|
|
9379
9397
|
${inheritLinkStyling}
|
|
9380
9398
|
transition: ${focusVisibleTransitionValue};
|
|
9381
9399
|
&:focus-visible,
|
|
@@ -9383,13 +9401,13 @@ var AppNameLink = import_styled_components61.default.a`
|
|
|
9383
9401
|
${focusVisible}
|
|
9384
9402
|
}
|
|
9385
9403
|
`;
|
|
9386
|
-
var NavigationList =
|
|
9404
|
+
var NavigationList = import_styled_components62.default.ul`
|
|
9387
9405
|
box-sizing: border-box;
|
|
9388
9406
|
display: flex;
|
|
9389
9407
|
gap: ${bar2.itemGap};
|
|
9390
9408
|
align-items: center;
|
|
9391
9409
|
width: 100%;
|
|
9392
|
-
${({ smallScreen }) => smallScreen &&
|
|
9410
|
+
${({ smallScreen }) => smallScreen && import_styled_components62.css`
|
|
9393
9411
|
align-items: initial;
|
|
9394
9412
|
flex-direction: column;
|
|
9395
9413
|
`}
|
|
@@ -9397,17 +9415,17 @@ var NavigationList = import_styled_components61.default.ul`
|
|
|
9397
9415
|
padding: 0;
|
|
9398
9416
|
margin: 0;
|
|
9399
9417
|
`;
|
|
9400
|
-
var ContextMenuGroup =
|
|
9401
|
-
var StyledOverflowMenu = (0,
|
|
9418
|
+
var ContextMenuGroup = import_styled_components62.default.div``;
|
|
9419
|
+
var StyledOverflowMenu = (0, import_styled_components62.default)(OverflowMenu)`
|
|
9402
9420
|
max-height: calc(100vh - 110px);
|
|
9403
9421
|
`;
|
|
9404
|
-
var NavLi =
|
|
9422
|
+
var NavLi = import_styled_components62.default.li`
|
|
9405
9423
|
display: flex;
|
|
9406
9424
|
`;
|
|
9407
9425
|
|
|
9408
9426
|
// src/components/InternalHeader/NavigationItem.tsx
|
|
9409
|
-
var
|
|
9410
|
-
var
|
|
9427
|
+
var import_react71 = require("react");
|
|
9428
|
+
var import_styled_components63 = __toESM(require("styled-components"));
|
|
9411
9429
|
|
|
9412
9430
|
// src/components/InternalHeader/NavigationItem.tokens.ts
|
|
9413
9431
|
var import_dds_design_tokens44 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -9448,8 +9466,8 @@ function getNavTokens({ active }) {
|
|
|
9448
9466
|
}
|
|
9449
9467
|
|
|
9450
9468
|
// src/components/InternalHeader/NavigationItem.tsx
|
|
9451
|
-
var
|
|
9452
|
-
var Link3 =
|
|
9469
|
+
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
9470
|
+
var Link3 = import_styled_components63.default.a`
|
|
9453
9471
|
${getFontStyling("bodySans02")}
|
|
9454
9472
|
text-decoration: none;
|
|
9455
9473
|
|
|
@@ -9476,8 +9494,8 @@ var Link3 = import_styled_components62.default.a`
|
|
|
9476
9494
|
transition: background-color 0.2s;
|
|
9477
9495
|
}
|
|
9478
9496
|
`;
|
|
9479
|
-
var NavigationItem2 = (0,
|
|
9480
|
-
return /* @__PURE__ */ (0,
|
|
9497
|
+
var NavigationItem2 = (0, import_react71.forwardRef)(({ title: title3, isCurrent, ...rest }, ref) => {
|
|
9498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(
|
|
9481
9499
|
Link3,
|
|
9482
9500
|
{
|
|
9483
9501
|
...rest,
|
|
@@ -9490,7 +9508,7 @@ var NavigationItem2 = (0, import_react70.forwardRef)(({ title: title3, isCurrent
|
|
|
9490
9508
|
});
|
|
9491
9509
|
|
|
9492
9510
|
// src/components/InternalHeader/InternalHeader.tsx
|
|
9493
|
-
var
|
|
9511
|
+
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
9494
9512
|
var InternalHeader = (props) => {
|
|
9495
9513
|
const {
|
|
9496
9514
|
applicationDesc,
|
|
@@ -9507,11 +9525,11 @@ var InternalHeader = (props) => {
|
|
|
9507
9525
|
htmlProps,
|
|
9508
9526
|
...rest
|
|
9509
9527
|
} = props;
|
|
9510
|
-
const [contextMenuIsClosed, setContextMenuIsClosed] = (0,
|
|
9511
|
-
const [currentPage, setCurrentPage] = (0,
|
|
9528
|
+
const [contextMenuIsClosed, setContextMenuIsClosed] = (0, import_react72.useState)(true);
|
|
9529
|
+
const [currentPage, setCurrentPage] = (0, import_react72.useState)(
|
|
9512
9530
|
currentPageHref
|
|
9513
9531
|
);
|
|
9514
|
-
const buttonRef = (0,
|
|
9532
|
+
const buttonRef = (0, import_react72.useRef)(null);
|
|
9515
9533
|
const handleCurrentPageChange = (href) => {
|
|
9516
9534
|
setCurrentPage(href);
|
|
9517
9535
|
onCurrentPageChange && onCurrentPageChange();
|
|
@@ -9523,10 +9541,10 @@ var InternalHeader = (props) => {
|
|
|
9523
9541
|
const hasNavigationElements = !!navigationElements && navigationElements.length > 0;
|
|
9524
9542
|
const hasContextMenuElements = !!contextMenuElements && contextMenuElements.length > 0;
|
|
9525
9543
|
const hasNavInContextMenu = smallScreen && hasNavigationElements;
|
|
9526
|
-
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) => {
|
|
9527
9545
|
const { href, ...rest2 } = item;
|
|
9528
9546
|
const isCurrent = href === currentPage;
|
|
9529
|
-
return /* @__PURE__ */ (0,
|
|
9547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(NavLi, { children: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
|
|
9530
9548
|
NavigationItem2,
|
|
9531
9549
|
{
|
|
9532
9550
|
href,
|
|
@@ -9537,18 +9555,18 @@ var InternalHeader = (props) => {
|
|
|
9537
9555
|
) }, index);
|
|
9538
9556
|
}) }) }) : null;
|
|
9539
9557
|
const hasContextMenu = hasContextMenuElements || !!userProps || hasNavInContextMenu;
|
|
9540
|
-
return /* @__PURE__ */ (0,
|
|
9558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(
|
|
9541
9559
|
Bar2,
|
|
9542
9560
|
{
|
|
9543
9561
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
9544
9562
|
$hasNavigation: !!navigation2,
|
|
9545
9563
|
children: [
|
|
9546
|
-
/* @__PURE__ */ (0,
|
|
9547
|
-
/* @__PURE__ */ (0,
|
|
9548
|
-
(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, {}),
|
|
9549
9567
|
navigation2,
|
|
9550
|
-
hasContextMenu && /* @__PURE__ */ (0,
|
|
9551
|
-
/* @__PURE__ */ (0,
|
|
9568
|
+
hasContextMenu && /* @__PURE__ */ (0, import_jsx_runtime231.jsxs)(ContextMenuGroup, { children: [
|
|
9569
|
+
/* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
|
|
9552
9570
|
Button,
|
|
9553
9571
|
{
|
|
9554
9572
|
ref: buttonRef,
|
|
@@ -9561,7 +9579,7 @@ var InternalHeader = (props) => {
|
|
|
9561
9579
|
"aria-label": "\xE5pne meny"
|
|
9562
9580
|
}
|
|
9563
9581
|
),
|
|
9564
|
-
/* @__PURE__ */ (0,
|
|
9582
|
+
/* @__PURE__ */ (0, import_jsx_runtime231.jsx)(
|
|
9565
9583
|
StyledOverflowMenu,
|
|
9566
9584
|
{
|
|
9567
9585
|
isOpen: !contextMenuIsClosed,
|
|
@@ -9580,8 +9598,8 @@ var InternalHeader = (props) => {
|
|
|
9580
9598
|
InternalHeader.displayName = "InternalHeader";
|
|
9581
9599
|
|
|
9582
9600
|
// src/components/List/List.tsx
|
|
9583
|
-
var
|
|
9584
|
-
var
|
|
9601
|
+
var import_react73 = require("react");
|
|
9602
|
+
var import_styled_components64 = __toESM(require("styled-components"));
|
|
9585
9603
|
|
|
9586
9604
|
// src/components/List/bullets/jordskifterett_bullet1.svg
|
|
9587
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';
|
|
@@ -9627,9 +9645,9 @@ var listTokens = {
|
|
|
9627
9645
|
};
|
|
9628
9646
|
|
|
9629
9647
|
// src/components/List/List.tsx
|
|
9630
|
-
var
|
|
9648
|
+
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
9631
9649
|
var { list: list6, listItem: listItem4, bullet: bullet2 } = listTokens;
|
|
9632
|
-
var StyledList =
|
|
9650
|
+
var StyledList = import_styled_components64.default.ul`
|
|
9633
9651
|
margin: ${list6.base.margin};
|
|
9634
9652
|
color: ${list6.base.color};
|
|
9635
9653
|
ul,
|
|
@@ -9640,13 +9658,13 @@ var StyledList = import_styled_components63.default.ul`
|
|
|
9640
9658
|
${selection}
|
|
9641
9659
|
}
|
|
9642
9660
|
|
|
9643
|
-
${({ $typographyType }) => $typographyType === "inherit" ?
|
|
9661
|
+
${({ $typographyType }) => $typographyType === "inherit" ? import_styled_components64.css`
|
|
9644
9662
|
font: inherit;
|
|
9645
|
-
` :
|
|
9663
|
+
` : import_styled_components64.css`
|
|
9646
9664
|
${getFontStyling($typographyType)}
|
|
9647
9665
|
`}
|
|
9648
9666
|
|
|
9649
|
-
${({ $listType }) => $listType === "unordered" ?
|
|
9667
|
+
${({ $listType }) => $listType === "unordered" ? import_styled_components64.css`
|
|
9650
9668
|
padding-left: ${list6.ul.paddingLeft};
|
|
9651
9669
|
list-style: none;
|
|
9652
9670
|
li {
|
|
@@ -9671,7 +9689,7 @@ var StyledList = import_styled_components63.default.ul`
|
|
|
9671
9689
|
background-image: ${`url('${tingrett_bullet3_default}')`};
|
|
9672
9690
|
}
|
|
9673
9691
|
}
|
|
9674
|
-
` :
|
|
9692
|
+
` : import_styled_components64.css`
|
|
9675
9693
|
padding-left: ${list6.ol.paddingLeft};
|
|
9676
9694
|
& > li > ol {
|
|
9677
9695
|
list-style-type: lower-alpha;
|
|
@@ -9681,7 +9699,7 @@ var StyledList = import_styled_components63.default.ul`
|
|
|
9681
9699
|
}
|
|
9682
9700
|
`}
|
|
9683
9701
|
`;
|
|
9684
|
-
var List2 = (0,
|
|
9702
|
+
var List2 = (0, import_react73.forwardRef)(
|
|
9685
9703
|
(props, ref) => {
|
|
9686
9704
|
const {
|
|
9687
9705
|
listType = "unordered",
|
|
@@ -9693,7 +9711,7 @@ var List2 = (0, import_react72.forwardRef)(
|
|
|
9693
9711
|
...rest
|
|
9694
9712
|
} = props;
|
|
9695
9713
|
const as = listType === "ordered" ? "ol" : "ul";
|
|
9696
|
-
return /* @__PURE__ */ (0,
|
|
9714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(
|
|
9697
9715
|
StyledList,
|
|
9698
9716
|
{
|
|
9699
9717
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -9709,22 +9727,22 @@ var List2 = (0, import_react72.forwardRef)(
|
|
|
9709
9727
|
List2.displayName = "List";
|
|
9710
9728
|
|
|
9711
9729
|
// src/components/List/ListItem.tsx
|
|
9712
|
-
var
|
|
9713
|
-
var
|
|
9714
|
-
var
|
|
9715
|
-
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`
|
|
9716
9734
|
line-height: ${listTokens.listItem.lineHeight};
|
|
9717
9735
|
`;
|
|
9718
|
-
var ListItem2 = (0,
|
|
9736
|
+
var ListItem2 = (0, import_react74.forwardRef)(
|
|
9719
9737
|
({ children, ...rest }, ref) => {
|
|
9720
|
-
return /* @__PURE__ */ (0,
|
|
9738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(StyledListItem, { ref, ...rest, children });
|
|
9721
9739
|
}
|
|
9722
9740
|
);
|
|
9723
9741
|
ListItem2.displayName = "ListItem";
|
|
9724
9742
|
|
|
9725
9743
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
9726
|
-
var
|
|
9727
|
-
var
|
|
9744
|
+
var import_react75 = require("react");
|
|
9745
|
+
var import_styled_components66 = __toESM(require("styled-components"));
|
|
9728
9746
|
|
|
9729
9747
|
// src/components/LocalMessage/LocalMessage.tokens.tsx
|
|
9730
9748
|
var import_dds_design_tokens46 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -9824,9 +9842,9 @@ var localMessageTokens = {
|
|
|
9824
9842
|
};
|
|
9825
9843
|
|
|
9826
9844
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
9827
|
-
var
|
|
9845
|
+
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
9828
9846
|
var { container: container10, content: content4, icon: icon6, purposeVariants: purposeVariants3 } = localMessageTokens;
|
|
9829
|
-
var Container8 =
|
|
9847
|
+
var Container8 = import_styled_components66.default.div.withConfig({
|
|
9830
9848
|
shouldForwardProp: (prop) => {
|
|
9831
9849
|
const styleOnlyProps = [
|
|
9832
9850
|
"layout",
|
|
@@ -9852,7 +9870,7 @@ var Container8 = import_styled_components65.default.div.withConfig({
|
|
|
9852
9870
|
*::selection {
|
|
9853
9871
|
${selection}
|
|
9854
9872
|
}
|
|
9855
|
-
${({ purpose }) => purpose &&
|
|
9873
|
+
${({ purpose }) => purpose && import_styled_components66.css`
|
|
9856
9874
|
border-color: ${container10.purpose[purpose].borderColor};
|
|
9857
9875
|
background-color: ${container10.purpose[purpose].backgroundColor};
|
|
9858
9876
|
`}
|
|
@@ -9877,18 +9895,18 @@ function getGridTemplateColumns(layout, closable) {
|
|
|
9877
9895
|
}
|
|
9878
9896
|
return layout === "horisontal" ? "min-content 1fr" : "1fr";
|
|
9879
9897
|
}
|
|
9880
|
-
var MessageIconWrapper2 = (0,
|
|
9898
|
+
var MessageIconWrapper2 = (0, import_styled_components66.default)(Icon)`
|
|
9881
9899
|
grid-area: icon;
|
|
9882
9900
|
`;
|
|
9883
|
-
var TextContainer2 =
|
|
9901
|
+
var TextContainer2 = import_styled_components66.default.div`
|
|
9884
9902
|
grid-area: text;
|
|
9885
9903
|
padding-right: ${content4.base.paddingRight};
|
|
9886
9904
|
`;
|
|
9887
|
-
var CloseButton = (0,
|
|
9905
|
+
var CloseButton = (0, import_styled_components66.default)(Button)`
|
|
9888
9906
|
grid-area: closeButton;
|
|
9889
9907
|
margin: -${container10.base.padding} 0;
|
|
9890
9908
|
`;
|
|
9891
|
-
var LocalMessage = (0,
|
|
9909
|
+
var LocalMessage = (0, import_react75.forwardRef)(
|
|
9892
9910
|
(props, ref) => {
|
|
9893
9911
|
const {
|
|
9894
9912
|
message: message2,
|
|
@@ -9903,7 +9921,7 @@ var LocalMessage = (0, import_react74.forwardRef)(
|
|
|
9903
9921
|
htmlProps,
|
|
9904
9922
|
...rest
|
|
9905
9923
|
} = props;
|
|
9906
|
-
const [isClosed, setClosed] = (0,
|
|
9924
|
+
const [isClosed, setClosed] = (0, import_react75.useState)(false);
|
|
9907
9925
|
const containerProps = {
|
|
9908
9926
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
9909
9927
|
purpose,
|
|
@@ -9913,18 +9931,18 @@ var LocalMessage = (0, import_react74.forwardRef)(
|
|
|
9913
9931
|
ref
|
|
9914
9932
|
};
|
|
9915
9933
|
if (isClosed) {
|
|
9916
|
-
return /* @__PURE__ */ (0,
|
|
9934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(import_jsx_runtime234.Fragment, {});
|
|
9917
9935
|
}
|
|
9918
|
-
return /* @__PURE__ */ (0,
|
|
9919
|
-
/* @__PURE__ */ (0,
|
|
9936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(Container8, { ...containerProps, children: [
|
|
9937
|
+
/* @__PURE__ */ (0, import_jsx_runtime234.jsx)(
|
|
9920
9938
|
MessageIconWrapper2,
|
|
9921
9939
|
{
|
|
9922
9940
|
icon: purposeVariants3[purpose].icon,
|
|
9923
9941
|
color: icon6[purpose].color
|
|
9924
9942
|
}
|
|
9925
9943
|
),
|
|
9926
|
-
/* @__PURE__ */ (0,
|
|
9927
|
-
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)(
|
|
9928
9946
|
CloseButton,
|
|
9929
9947
|
{
|
|
9930
9948
|
icon: CloseIcon,
|
|
@@ -9944,14 +9962,14 @@ var LocalMessage = (0, import_react74.forwardRef)(
|
|
|
9944
9962
|
LocalMessage.displayName = "LocalMessage";
|
|
9945
9963
|
|
|
9946
9964
|
// src/components/Modal/Modal.tsx
|
|
9947
|
-
var
|
|
9965
|
+
var import_react76 = require("react");
|
|
9948
9966
|
var import_react_dom3 = require("react-dom");
|
|
9949
|
-
var
|
|
9967
|
+
var import_styled_components68 = __toESM(require("styled-components"));
|
|
9950
9968
|
|
|
9951
9969
|
// src/components/Modal/Backdrop/Backdrop.tsx
|
|
9952
9970
|
var import_dds_design_tokens47 = require("@norges-domstoler/dds-design-tokens");
|
|
9953
|
-
var
|
|
9954
|
-
var Backdrop =
|
|
9971
|
+
var import_styled_components67 = __toESM(require("styled-components"));
|
|
9972
|
+
var Backdrop = import_styled_components67.default.div.withConfig({
|
|
9955
9973
|
shouldForwardProp: (prop) => prop !== "isOpen"
|
|
9956
9974
|
})`
|
|
9957
9975
|
position: fixed;
|
|
@@ -10015,9 +10033,9 @@ var modalTokens = {
|
|
|
10015
10033
|
};
|
|
10016
10034
|
|
|
10017
10035
|
// src/components/Modal/Modal.tsx
|
|
10018
|
-
var
|
|
10036
|
+
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
10019
10037
|
var { container: container12, contentContainer: contentContainer6 } = modalTokens;
|
|
10020
|
-
var Container9 = (0,
|
|
10038
|
+
var Container9 = (0, import_styled_components68.default)(Paper)`
|
|
10021
10039
|
display: flex;
|
|
10022
10040
|
flex-direction: column-reverse;
|
|
10023
10041
|
min-width: 200px;
|
|
@@ -10031,16 +10049,16 @@ var Container9 = (0, import_styled_components67.default)(Paper)`
|
|
|
10031
10049
|
${focusVisible}
|
|
10032
10050
|
}
|
|
10033
10051
|
`;
|
|
10034
|
-
var ContentContainer3 =
|
|
10052
|
+
var ContentContainer3 = import_styled_components68.default.div`
|
|
10035
10053
|
display: grid;
|
|
10036
10054
|
padding-right: ${contentContainer6.paddingRight};
|
|
10037
10055
|
gap: ${contentContainer6.gap};
|
|
10038
10056
|
`;
|
|
10039
|
-
var HeaderContainer3 =
|
|
10040
|
-
var StyledButton4 = (0,
|
|
10057
|
+
var HeaderContainer3 = import_styled_components68.default.div``;
|
|
10058
|
+
var StyledButton4 = (0, import_styled_components68.default)(Button)`
|
|
10041
10059
|
align-self: flex-end;
|
|
10042
10060
|
`;
|
|
10043
|
-
var Modal = (0,
|
|
10061
|
+
var Modal = (0, import_react76.forwardRef)((props, ref) => {
|
|
10044
10062
|
const {
|
|
10045
10063
|
isOpen = false,
|
|
10046
10064
|
parentElement = document.body,
|
|
@@ -10054,7 +10072,7 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
10054
10072
|
htmlProps,
|
|
10055
10073
|
...rest
|
|
10056
10074
|
} = props;
|
|
10057
|
-
const generatedId = (0,
|
|
10075
|
+
const generatedId = (0, import_react76.useId)();
|
|
10058
10076
|
const modalId = id != null ? id : `${generatedId}-modal`;
|
|
10059
10077
|
const headerId = `${modalId}-header`;
|
|
10060
10078
|
const modalRef = useFocusTrap(isOpen, initialFocusRef);
|
|
@@ -10066,7 +10084,7 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
10066
10084
|
onClose();
|
|
10067
10085
|
}
|
|
10068
10086
|
};
|
|
10069
|
-
(0,
|
|
10087
|
+
(0, import_react76.useEffect)(() => {
|
|
10070
10088
|
if (isOpen) {
|
|
10071
10089
|
handleElementWithBackdropMount(document.body);
|
|
10072
10090
|
} else {
|
|
@@ -10078,7 +10096,7 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
10078
10096
|
useOnKeyDown(["Escape", "Esc"], () => handleClose());
|
|
10079
10097
|
const hasTransitionedIn = useMountTransition(isOpen, 200);
|
|
10080
10098
|
return isOpen || hasTransitionedIn ? (0, import_react_dom3.createPortal)(
|
|
10081
|
-
/* @__PURE__ */ (0,
|
|
10099
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)(Backdrop, { isOpen: hasTransitionedIn && isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)(
|
|
10082
10100
|
Container9,
|
|
10083
10101
|
{
|
|
10084
10102
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -10091,11 +10109,11 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
10091
10109
|
id: modalId,
|
|
10092
10110
|
elevation: 4,
|
|
10093
10111
|
children: [
|
|
10094
|
-
/* @__PURE__ */ (0,
|
|
10095
|
-
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 }),
|
|
10096
10114
|
children
|
|
10097
10115
|
] }),
|
|
10098
|
-
onClose && /* @__PURE__ */ (0,
|
|
10116
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
|
|
10099
10117
|
StyledButton4,
|
|
10100
10118
|
{
|
|
10101
10119
|
size: "small",
|
|
@@ -10115,45 +10133,45 @@ var Modal = (0, import_react75.forwardRef)((props, ref) => {
|
|
|
10115
10133
|
Modal.displayName = "Modal";
|
|
10116
10134
|
|
|
10117
10135
|
// src/components/Modal/ModalBody.tsx
|
|
10118
|
-
var
|
|
10119
|
-
var
|
|
10120
|
-
var
|
|
10121
|
-
var Container10 =
|
|
10122
|
-
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)(
|
|
10123
10141
|
(props, ref) => {
|
|
10124
10142
|
const { children, scrollable, id, className, htmlProps, height, ...rest } = props;
|
|
10125
10143
|
const containerProps = {
|
|
10126
10144
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
10127
10145
|
ref
|
|
10128
10146
|
};
|
|
10129
|
-
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 });
|
|
10130
10148
|
}
|
|
10131
10149
|
);
|
|
10132
10150
|
ModalBody.displayName = "ModalBody";
|
|
10133
10151
|
|
|
10134
10152
|
// src/components/Modal/ModalActions.tsx
|
|
10135
|
-
var
|
|
10136
|
-
var
|
|
10137
|
-
var
|
|
10138
|
-
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`
|
|
10139
10157
|
display: flex;
|
|
10140
10158
|
flex-wrap: wrap;
|
|
10141
10159
|
gap: ${modalTokens.actionsContainer.gap};
|
|
10142
10160
|
`;
|
|
10143
|
-
var ModalActions = (0,
|
|
10161
|
+
var ModalActions = (0, import_react78.forwardRef)(
|
|
10144
10162
|
({ children, ...rest }, ref) => {
|
|
10145
10163
|
const containerProps = {
|
|
10146
10164
|
ref,
|
|
10147
10165
|
...rest
|
|
10148
10166
|
};
|
|
10149
|
-
return /* @__PURE__ */ (0,
|
|
10167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime237.jsx)(Container11, { ...containerProps, children });
|
|
10150
10168
|
}
|
|
10151
10169
|
);
|
|
10152
10170
|
ModalActions.displayName = "ModalActions";
|
|
10153
10171
|
|
|
10154
10172
|
// src/components/Pagination/Pagination.tsx
|
|
10155
|
-
var
|
|
10156
|
-
var
|
|
10173
|
+
var import_react80 = require("react");
|
|
10174
|
+
var import_styled_components72 = __toESM(require("styled-components"));
|
|
10157
10175
|
|
|
10158
10176
|
// src/components/Pagination/Pagination.tokens.tsx
|
|
10159
10177
|
var import_dds_design_tokens49 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -10211,11 +10229,11 @@ function PaginationGenerator(pagesAmount, activePage) {
|
|
|
10211
10229
|
}
|
|
10212
10230
|
|
|
10213
10231
|
// src/components/Select/Select.tsx
|
|
10214
|
-
var
|
|
10232
|
+
var import_react79 = require("react");
|
|
10215
10233
|
var import_react_select2 = __toESM(require("react-select"));
|
|
10216
10234
|
|
|
10217
10235
|
// src/components/Select/Select.styles.ts
|
|
10218
|
-
var
|
|
10236
|
+
var import_styled_components71 = __toESM(require("styled-components"));
|
|
10219
10237
|
|
|
10220
10238
|
// src/components/Select/Select.tokens.tsx
|
|
10221
10239
|
var import_dds_design_tokens50 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -10405,7 +10423,7 @@ var prefix = "dds-select";
|
|
|
10405
10423
|
function getContainerControlPadding(componentSize, isMulti) {
|
|
10406
10424
|
return isMulti ? control2.isMulti.sizes[componentSize].padding : control2.sizes[componentSize].padding;
|
|
10407
10425
|
}
|
|
10408
|
-
var Container12 =
|
|
10426
|
+
var Container12 = import_styled_components71.default.div`
|
|
10409
10427
|
margin: 0;
|
|
10410
10428
|
width: ${({ $width }) => $width};
|
|
10411
10429
|
position: relative;
|
|
@@ -10414,7 +10432,7 @@ var Container12 = import_styled_components70.default.div`
|
|
|
10414
10432
|
${selection}
|
|
10415
10433
|
}
|
|
10416
10434
|
|
|
10417
|
-
${({ $componentSize, $isMulti }) =>
|
|
10435
|
+
${({ $componentSize, $isMulti }) => import_styled_components71.css`
|
|
10418
10436
|
.${prefix}__control {
|
|
10419
10437
|
padding: ${getContainerControlPadding($componentSize, $isMulti)};
|
|
10420
10438
|
${getFontStyling(typographyTypes3.control[$componentSize], true)}
|
|
@@ -10430,7 +10448,7 @@ var Container12 = import_styled_components70.default.div`
|
|
|
10430
10448
|
}
|
|
10431
10449
|
`}
|
|
10432
10450
|
|
|
10433
|
-
${({ $errorMessage }) => $errorMessage &&
|
|
10451
|
+
${({ $errorMessage }) => $errorMessage && import_styled_components71.css`
|
|
10434
10452
|
.${prefix}__control {
|
|
10435
10453
|
${dangerInputfield}
|
|
10436
10454
|
}
|
|
@@ -10449,7 +10467,7 @@ var Container12 = import_styled_components70.default.div`
|
|
|
10449
10467
|
color: ${dropdownIndicator2.hover.color};
|
|
10450
10468
|
}
|
|
10451
10469
|
|
|
10452
|
-
${({ $isDisabled, $readOnly }) => $readOnly ?
|
|
10470
|
+
${({ $isDisabled, $readOnly }) => $readOnly ? import_styled_components71.css`
|
|
10453
10471
|
.${prefix}__control {
|
|
10454
10472
|
border-color: ${control2.readOnly.borderColor};
|
|
10455
10473
|
background-color: ${control2.readOnly.backgroundColor};
|
|
@@ -10461,7 +10479,7 @@ var Container12 = import_styled_components70.default.div`
|
|
|
10461
10479
|
.${prefix}__dropdown-indicator {
|
|
10462
10480
|
color: ${dropdownIndicator2.readOnly.color};
|
|
10463
10481
|
}
|
|
10464
|
-
` : $isDisabled ?
|
|
10482
|
+
` : $isDisabled ? import_styled_components71.css`
|
|
10465
10483
|
cursor: not-allowed;
|
|
10466
10484
|
.${prefix}__control {
|
|
10467
10485
|
border-color: ${control2.disabled.borderColor};
|
|
@@ -10472,14 +10490,14 @@ var Container12 = import_styled_components70.default.div`
|
|
|
10472
10490
|
}
|
|
10473
10491
|
` : ""}
|
|
10474
10492
|
`;
|
|
10475
|
-
var InnerSingleValue =
|
|
10493
|
+
var InnerSingleValue = import_styled_components71.default.div`
|
|
10476
10494
|
overflow: hidden;
|
|
10477
10495
|
text-overflow: ellipsis;
|
|
10478
10496
|
white-space: nowrap;
|
|
10479
10497
|
box-sizing: border-box;
|
|
10480
10498
|
max-width: 100%;
|
|
10481
10499
|
`;
|
|
10482
|
-
var StyledIcon3 = (0,
|
|
10500
|
+
var StyledIcon3 = (0, import_styled_components71.default)(Icon)`
|
|
10483
10501
|
margin-right: ${icon8.marginRight};
|
|
10484
10502
|
`;
|
|
10485
10503
|
var getCustomStyles = (size2) => ({
|
|
@@ -10644,7 +10662,7 @@ var getCustomStyles = (size2) => ({
|
|
|
10644
10662
|
|
|
10645
10663
|
// src/components/Select/SelectComponents.tsx
|
|
10646
10664
|
var import_react_select = require("react-select");
|
|
10647
|
-
var
|
|
10665
|
+
var import_jsx_runtime238 = require("react/jsx-runtime");
|
|
10648
10666
|
var {
|
|
10649
10667
|
Option,
|
|
10650
10668
|
NoOptionsMessage,
|
|
@@ -10655,17 +10673,17 @@ var {
|
|
|
10655
10673
|
MultiValueRemove,
|
|
10656
10674
|
Control
|
|
10657
10675
|
} = import_react_select.components;
|
|
10658
|
-
var DDSOption = (props, componentSize) => /* @__PURE__ */ (0,
|
|
10659
|
-
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) }),
|
|
10660
10678
|
props.children
|
|
10661
10679
|
] });
|
|
10662
|
-
var CustomOption = (props, Element) => /* @__PURE__ */ (0,
|
|
10663
|
-
var CustomSingleValue = (props, id, Element) => /* @__PURE__ */ (0,
|
|
10664
|
-
var DDSNoOptionsMessage = (props) => /* @__PURE__ */ (0,
|
|
10665
|
-
var DDSClearIndicator = (props, size2) => /* @__PURE__ */ (0,
|
|
10666
|
-
var DDSMultiValueRemove = (props) => /* @__PURE__ */ (0,
|
|
10667
|
-
var DDSDropdownIndicator = (props, size2) => /* @__PURE__ */ (0,
|
|
10668
|
-
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)(
|
|
10669
10687
|
Input2,
|
|
10670
10688
|
{
|
|
10671
10689
|
...props,
|
|
@@ -10673,13 +10691,13 @@ var DDSInput = (props, ariaInvalid, ariaDescribedby) => /* @__PURE__ */ (0, impo
|
|
|
10673
10691
|
"aria-describedby": ariaDescribedby
|
|
10674
10692
|
}
|
|
10675
10693
|
);
|
|
10676
|
-
var DDSControl = (props, componentSize, icon11) => /* @__PURE__ */ (0,
|
|
10677
|
-
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) }),
|
|
10678
10696
|
props.children
|
|
10679
10697
|
] });
|
|
10680
10698
|
|
|
10681
10699
|
// src/components/Select/Select.tsx
|
|
10682
|
-
var
|
|
10700
|
+
var import_jsx_runtime239 = require("react/jsx-runtime");
|
|
10683
10701
|
var defaultWidth4 = "320px";
|
|
10684
10702
|
var getPlaceholder = (placeholder3, isMulti) => placeholder3 ? placeholder3 : isMulti ? "-- Velg en eller flere --" : "-- Velg fra listen --";
|
|
10685
10703
|
function SelectInner(props, ref) {
|
|
@@ -10708,7 +10726,7 @@ function SelectInner(props, ref) {
|
|
|
10708
10726
|
customSingleValueElement,
|
|
10709
10727
|
...rest
|
|
10710
10728
|
} = props;
|
|
10711
|
-
const generatedId = (0,
|
|
10729
|
+
const generatedId = (0, import_react79.useId)();
|
|
10712
10730
|
const uniqueId = id != null ? id : `${generatedId}-select`;
|
|
10713
10731
|
const singleValueId = !isMulti ? `${uniqueId}-singleValue` : void 0;
|
|
10714
10732
|
const hasLabel = !!label3;
|
|
@@ -10766,57 +10784,57 @@ function SelectInner(props, ref) {
|
|
|
10766
10784
|
menuPortalTarget: document == null ? void 0 : document.body,
|
|
10767
10785
|
...rest
|
|
10768
10786
|
};
|
|
10769
|
-
return /* @__PURE__ */ (0,
|
|
10770
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
10771
|
-
/* @__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 }),
|
|
10772
10790
|
renderInputMessage(tip, tipId, errorMessage, errorMessageId)
|
|
10773
10791
|
] });
|
|
10774
10792
|
}
|
|
10775
|
-
var Select = (0,
|
|
10793
|
+
var Select = (0, import_react79.forwardRef)(SelectInner);
|
|
10776
10794
|
Select.displayName = "Select";
|
|
10777
10795
|
|
|
10778
10796
|
// src/components/Select/utils.ts
|
|
10779
10797
|
var createSelectOptions = (...args) => args.map((v) => ({ label: v, value: v }));
|
|
10780
10798
|
|
|
10781
10799
|
// src/components/Pagination/Pagination.tsx
|
|
10782
|
-
var
|
|
10800
|
+
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
10783
10801
|
var { outerContainer: outerContainer4, indicatorsContainer: indicatorsContainer2, truncationIcon: truncationIcon2, list: list8 } = paginationTokens;
|
|
10784
|
-
var Nav =
|
|
10802
|
+
var Nav = import_styled_components72.default.nav`
|
|
10785
10803
|
display: flex;
|
|
10786
10804
|
align-items: center;
|
|
10787
10805
|
`;
|
|
10788
|
-
var List3 =
|
|
10806
|
+
var List3 = import_styled_components72.default.ol`
|
|
10789
10807
|
display: grid;
|
|
10790
10808
|
grid-auto-flow: column;
|
|
10791
10809
|
gap: ${list8.gap};
|
|
10792
10810
|
margin: 0;
|
|
10793
10811
|
padding: 0;
|
|
10794
10812
|
`;
|
|
10795
|
-
var ListItem3 =
|
|
10813
|
+
var ListItem3 = import_styled_components72.default.li`
|
|
10796
10814
|
display: inline-grid;
|
|
10797
10815
|
align-content: center;
|
|
10798
|
-
${({ $isHidden }) => $isHidden &&
|
|
10816
|
+
${({ $isHidden }) => $isHidden && import_styled_components72.css`
|
|
10799
10817
|
visibility: hidden;
|
|
10800
10818
|
`}
|
|
10801
10819
|
`;
|
|
10802
|
-
var OuterContainer =
|
|
10820
|
+
var OuterContainer = import_styled_components72.default.div`
|
|
10803
10821
|
display: flex;
|
|
10804
10822
|
gap: ${outerContainer4.gap};
|
|
10805
|
-
${({ $smallScreen }) => $smallScreen ?
|
|
10823
|
+
${({ $smallScreen }) => $smallScreen ? import_styled_components72.css`
|
|
10806
10824
|
flex-direction: column;
|
|
10807
10825
|
align-items: center;
|
|
10808
|
-
` :
|
|
10826
|
+
` : import_styled_components72.css`
|
|
10809
10827
|
justify-content: space-between;
|
|
10810
10828
|
flex-wrap: wrap;
|
|
10811
10829
|
`}
|
|
10812
10830
|
`;
|
|
10813
|
-
var IndicatorsContainer =
|
|
10831
|
+
var IndicatorsContainer = import_styled_components72.default.div`
|
|
10814
10832
|
display: grid;
|
|
10815
10833
|
grid-auto-flow: column;
|
|
10816
10834
|
align-items: center;
|
|
10817
10835
|
gap: ${indicatorsContainer2.gap};
|
|
10818
10836
|
`;
|
|
10819
|
-
var Pagination = (0,
|
|
10837
|
+
var Pagination = (0, import_react80.forwardRef)(
|
|
10820
10838
|
(props, ref) => {
|
|
10821
10839
|
const {
|
|
10822
10840
|
itemsAmount,
|
|
@@ -10839,8 +10857,8 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10839
10857
|
htmlProps,
|
|
10840
10858
|
...rest
|
|
10841
10859
|
} = props;
|
|
10842
|
-
const [activePage, setActivePage] = (0,
|
|
10843
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
10860
|
+
const [activePage, setActivePage] = (0, import_react80.useState)(defaultActivePage);
|
|
10861
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react80.useState)(defaultItemsPerPage);
|
|
10844
10862
|
const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
|
|
10845
10863
|
const items = PaginationGenerator(pagesLength, activePage);
|
|
10846
10864
|
const onPageChange = (event, page) => {
|
|
@@ -10859,7 +10877,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10859
10877
|
};
|
|
10860
10878
|
const listItems = items.length > 0 ? items.map((item, i) => {
|
|
10861
10879
|
const isActive = item === activePage;
|
|
10862
|
-
return /* @__PURE__ */ (0,
|
|
10880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ListItem3, { children: item !== "truncator" ? /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
10863
10881
|
Button,
|
|
10864
10882
|
{
|
|
10865
10883
|
purpose: isActive ? "primary" : "secondary",
|
|
@@ -10871,7 +10889,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10871
10889
|
"aria-label": isActive ? `N\xE5v\xE6rende side (side ${item})` : `G\xE5 til side ${item}`,
|
|
10872
10890
|
children: item
|
|
10873
10891
|
}
|
|
10874
|
-
) : /* @__PURE__ */ (0,
|
|
10892
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
10875
10893
|
Icon,
|
|
10876
10894
|
{
|
|
10877
10895
|
icon: MoreHorizontalIcon,
|
|
@@ -10879,7 +10897,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10879
10897
|
}
|
|
10880
10898
|
) }, `pagination-item-${i}`);
|
|
10881
10899
|
}) : void 0;
|
|
10882
|
-
const previousPageButton = /* @__PURE__ */ (0,
|
|
10900
|
+
const previousPageButton = /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
10883
10901
|
Button,
|
|
10884
10902
|
{
|
|
10885
10903
|
purpose: "secondary",
|
|
@@ -10892,7 +10910,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10892
10910
|
"aria-label": "G\xE5 til forrige siden"
|
|
10893
10911
|
}
|
|
10894
10912
|
);
|
|
10895
|
-
const nextPageButton = /* @__PURE__ */ (0,
|
|
10913
|
+
const nextPageButton = /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
10896
10914
|
Button,
|
|
10897
10915
|
{
|
|
10898
10916
|
purpose: "secondary",
|
|
@@ -10914,13 +10932,13 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10914
10932
|
};
|
|
10915
10933
|
const isOnFirstPage = activePage === 1;
|
|
10916
10934
|
const isOnLastPage = activePage === pagesLength;
|
|
10917
|
-
const navigation2 = withPagination ? /* @__PURE__ */ (0,
|
|
10918
|
-
/* @__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 }),
|
|
10919
10937
|
listItems,
|
|
10920
|
-
/* @__PURE__ */ (0,
|
|
10938
|
+
/* @__PURE__ */ (0, import_jsx_runtime240.jsx)(ListItem3, { $isHidden: isOnLastPage, "aria-hidden": isOnLastPage, children: nextPageButton })
|
|
10921
10939
|
] }) }) : null;
|
|
10922
|
-
const smallScreenNavigation = withPagination ? /* @__PURE__ */ (0,
|
|
10923
|
-
/* @__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)(
|
|
10924
10942
|
Button,
|
|
10925
10943
|
{
|
|
10926
10944
|
purpose: "secondary",
|
|
@@ -10933,8 +10951,8 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10933
10951
|
"aria-label": "G\xE5 til f\xF8rste siden"
|
|
10934
10952
|
}
|
|
10935
10953
|
) }),
|
|
10936
|
-
/* @__PURE__ */ (0,
|
|
10937
|
-
/* @__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)(
|
|
10938
10956
|
Button,
|
|
10939
10957
|
{
|
|
10940
10958
|
size: "small",
|
|
@@ -10944,8 +10962,8 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10944
10962
|
children: activePage
|
|
10945
10963
|
}
|
|
10946
10964
|
) }),
|
|
10947
|
-
/* @__PURE__ */ (0,
|
|
10948
|
-
/* @__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)(
|
|
10949
10967
|
Button,
|
|
10950
10968
|
{
|
|
10951
10969
|
purpose: "secondary",
|
|
@@ -10962,9 +10980,9 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10962
10980
|
const activePageFirstItem = activePage === 1 ? 1 : activePage * itemsPerPage - itemsPerPage + 1;
|
|
10963
10981
|
const activePageLastItem = activePage === pagesLength ? itemsAmount : activePage * itemsPerPage;
|
|
10964
10982
|
const navigationToBeRendered = smallScreen ? smallScreenNavigation : navigation2;
|
|
10965
|
-
return !withCounter && !withSelect ? navigationToBeRendered : /* @__PURE__ */ (0,
|
|
10966
|
-
/* @__PURE__ */ (0,
|
|
10967
|
-
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)(
|
|
10968
10986
|
Select,
|
|
10969
10987
|
{
|
|
10970
10988
|
options: selectOptions,
|
|
@@ -10979,7 +10997,7 @@ var Pagination = (0, import_react79.forwardRef)(
|
|
|
10979
10997
|
"aria-label": "Antall elementer per side"
|
|
10980
10998
|
}
|
|
10981
10999
|
),
|
|
10982
|
-
withCounter && /* @__PURE__ */ (0,
|
|
11000
|
+
withCounter && /* @__PURE__ */ (0, import_jsx_runtime240.jsxs)(Typography, { typographyType: "supportingStyleLabel01", as: "p", children: [
|
|
10983
11001
|
"Viser ",
|
|
10984
11002
|
activePageFirstItem,
|
|
10985
11003
|
"-",
|
|
@@ -10996,8 +11014,8 @@ Pagination.displayName = "Pagination";
|
|
|
10996
11014
|
|
|
10997
11015
|
// src/components/Popover/Popover.tsx
|
|
10998
11016
|
var import_dds_design_tokens52 = require("@norges-domstoler/dds-design-tokens");
|
|
10999
|
-
var
|
|
11000
|
-
var
|
|
11017
|
+
var import_react81 = require("react");
|
|
11018
|
+
var import_styled_components73 = __toESM(require("styled-components"));
|
|
11001
11019
|
|
|
11002
11020
|
// src/components/Popover/Popover.tokens.tsx
|
|
11003
11021
|
var import_dds_design_tokens51 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -11025,10 +11043,10 @@ var popoverTokens2 = {
|
|
|
11025
11043
|
};
|
|
11026
11044
|
|
|
11027
11045
|
// src/components/Popover/Popover.tsx
|
|
11028
|
-
var
|
|
11046
|
+
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
11029
11047
|
var { spacing: Spacing } = import_dds_design_tokens52.ddsBaseTokens;
|
|
11030
11048
|
var { wrapper: wrapper4, content: content6, closeButton: closeButton2, title: title2 } = popoverTokens2;
|
|
11031
|
-
var Wrapper4 = (0,
|
|
11049
|
+
var Wrapper4 = (0, import_styled_components73.default)(Paper)`
|
|
11032
11050
|
opacity: 0;
|
|
11033
11051
|
${({ $hasTransitionedIn, $isOpen }) => $hasTransitionedIn && visibilityTransition($hasTransitionedIn && $isOpen)}
|
|
11034
11052
|
position: absolute;
|
|
@@ -11039,7 +11057,7 @@ var Wrapper4 = (0, import_styled_components72.default)(Paper)`
|
|
|
11039
11057
|
&:focus-visible {
|
|
11040
11058
|
${focusVisible}
|
|
11041
11059
|
}
|
|
11042
|
-
${({ $sizeProps }) => $sizeProps &&
|
|
11060
|
+
${({ $sizeProps }) => $sizeProps && import_styled_components73.css`
|
|
11043
11061
|
width: ${$sizeProps.width};
|
|
11044
11062
|
height: ${$sizeProps.height};
|
|
11045
11063
|
min-width: ${$sizeProps.minWidth};
|
|
@@ -11048,20 +11066,20 @@ var Wrapper4 = (0, import_styled_components72.default)(Paper)`
|
|
|
11048
11066
|
max-height: ${$sizeProps.maxHeight};
|
|
11049
11067
|
`}
|
|
11050
11068
|
`;
|
|
11051
|
-
var TitleContainer =
|
|
11069
|
+
var TitleContainer = import_styled_components73.default.div`
|
|
11052
11070
|
margin-right: ${title2.marginRight};
|
|
11053
11071
|
`;
|
|
11054
|
-
var ContentContainer4 =
|
|
11055
|
-
${({ $withCloseButton, $hasTitle }) => $withCloseButton && !$hasTitle &&
|
|
11072
|
+
var ContentContainer4 = import_styled_components73.default.div`
|
|
11073
|
+
${({ $withCloseButton, $hasTitle }) => $withCloseButton && !$hasTitle && import_styled_components73.css`
|
|
11056
11074
|
margin-top: ${content6.noTitle.marginTop};
|
|
11057
11075
|
`}
|
|
11058
11076
|
`;
|
|
11059
|
-
var StyledButton5 = (0,
|
|
11077
|
+
var StyledButton5 = (0, import_styled_components73.default)(Button)`
|
|
11060
11078
|
position: absolute;
|
|
11061
11079
|
top: ${closeButton2.top};
|
|
11062
11080
|
right: ${closeButton2.right};
|
|
11063
11081
|
`;
|
|
11064
|
-
var Popover = (0,
|
|
11082
|
+
var Popover = (0, import_react81.forwardRef)(
|
|
11065
11083
|
(props, ref) => {
|
|
11066
11084
|
const {
|
|
11067
11085
|
title: title3,
|
|
@@ -11101,7 +11119,7 @@ var Popover = (0, import_react80.forwardRef)(
|
|
|
11101
11119
|
if (isOpen)
|
|
11102
11120
|
onClose && onClose();
|
|
11103
11121
|
});
|
|
11104
|
-
return isOpen || hasTransitionedIn ? /* @__PURE__ */ (0,
|
|
11122
|
+
return isOpen || hasTransitionedIn ? /* @__PURE__ */ (0, import_jsx_runtime241.jsxs)(
|
|
11105
11123
|
Wrapper4,
|
|
11106
11124
|
{
|
|
11107
11125
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -11114,8 +11132,8 @@ var Popover = (0, import_react80.forwardRef)(
|
|
|
11114
11132
|
elevation: 3,
|
|
11115
11133
|
border: "light",
|
|
11116
11134
|
children: [
|
|
11117
|
-
title3 && /* @__PURE__ */ (0,
|
|
11118
|
-
/* @__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)(
|
|
11119
11137
|
ContentContainer4,
|
|
11120
11138
|
{
|
|
11121
11139
|
$hasTitle: !!title3,
|
|
@@ -11123,7 +11141,7 @@ var Popover = (0, import_react80.forwardRef)(
|
|
|
11123
11141
|
children
|
|
11124
11142
|
}
|
|
11125
11143
|
),
|
|
11126
|
-
withCloseButton && /* @__PURE__ */ (0,
|
|
11144
|
+
withCloseButton && /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
|
|
11127
11145
|
StyledButton5,
|
|
11128
11146
|
{
|
|
11129
11147
|
icon: CloseIcon,
|
|
@@ -11142,8 +11160,8 @@ var Popover = (0, import_react80.forwardRef)(
|
|
|
11142
11160
|
Popover.displayName = "Popover";
|
|
11143
11161
|
|
|
11144
11162
|
// src/components/Popover/PopoverGroup.tsx
|
|
11145
|
-
var
|
|
11146
|
-
var
|
|
11163
|
+
var import_react82 = require("react");
|
|
11164
|
+
var import_jsx_runtime242 = require("react/jsx-runtime");
|
|
11147
11165
|
var PopoverGroup = ({
|
|
11148
11166
|
isOpen = false,
|
|
11149
11167
|
onCloseButtonClick,
|
|
@@ -11151,8 +11169,8 @@ var PopoverGroup = ({
|
|
|
11151
11169
|
children,
|
|
11152
11170
|
popoverId
|
|
11153
11171
|
}) => {
|
|
11154
|
-
const [open, setOpen] = (0,
|
|
11155
|
-
const generatedId = (0,
|
|
11172
|
+
const [open, setOpen] = (0, import_react82.useState)(isOpen);
|
|
11173
|
+
const generatedId = (0, import_react82.useId)();
|
|
11156
11174
|
const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
|
|
11157
11175
|
const handleOnCloseButtonClick = () => {
|
|
11158
11176
|
setOpen(false);
|
|
@@ -11162,8 +11180,8 @@ var PopoverGroup = ({
|
|
|
11162
11180
|
setOpen(!open);
|
|
11163
11181
|
onTriggerClick && onTriggerClick();
|
|
11164
11182
|
};
|
|
11165
|
-
const buttonRef = (0,
|
|
11166
|
-
const popoverRef = (0,
|
|
11183
|
+
const buttonRef = (0, import_react82.useRef)(null);
|
|
11184
|
+
const popoverRef = (0, import_react82.useRef)(null);
|
|
11167
11185
|
useOnKeyDown(["Esc", "Escape"], () => {
|
|
11168
11186
|
var _a;
|
|
11169
11187
|
if (open) {
|
|
@@ -11172,14 +11190,14 @@ var PopoverGroup = ({
|
|
|
11172
11190
|
}
|
|
11173
11191
|
});
|
|
11174
11192
|
const handleClose = () => setOpen(false);
|
|
11175
|
-
const Children9 =
|
|
11176
|
-
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, {
|
|
11177
11195
|
"aria-haspopup": "dialog",
|
|
11178
11196
|
"aria-controls": uniquePopoverId,
|
|
11179
11197
|
"aria-expanded": open,
|
|
11180
11198
|
onClick: handleOnTriggerClick,
|
|
11181
11199
|
ref: buttonRef
|
|
11182
|
-
}) : (0,
|
|
11200
|
+
}) : (0, import_react82.cloneElement)(child, {
|
|
11183
11201
|
isOpen: open,
|
|
11184
11202
|
"aria-hidden": !open,
|
|
11185
11203
|
id: uniquePopoverId,
|
|
@@ -11189,22 +11207,22 @@ var PopoverGroup = ({
|
|
|
11189
11207
|
onClose: handleClose
|
|
11190
11208
|
}));
|
|
11191
11209
|
});
|
|
11192
|
-
return /* @__PURE__ */ (0,
|
|
11210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(import_jsx_runtime242.Fragment, { children: Children9 });
|
|
11193
11211
|
};
|
|
11194
11212
|
PopoverGroup.displayName = "PopoverGroup";
|
|
11195
11213
|
|
|
11196
11214
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
11197
|
-
var
|
|
11198
|
-
var
|
|
11215
|
+
var import_react85 = require("react");
|
|
11216
|
+
var import_styled_components75 = __toESM(require("styled-components"));
|
|
11199
11217
|
|
|
11200
11218
|
// src/components/ProgressTracker/ProgressTracker.context.tsx
|
|
11201
|
-
var
|
|
11202
|
-
var ProgressTrackerContext = (0,
|
|
11219
|
+
var import_react83 = require("react");
|
|
11220
|
+
var ProgressTrackerContext = (0, import_react83.createContext)(
|
|
11203
11221
|
{
|
|
11204
11222
|
activeStep: 0
|
|
11205
11223
|
}
|
|
11206
11224
|
);
|
|
11207
|
-
var useProgressTrackerContext = () => (0,
|
|
11225
|
+
var useProgressTrackerContext = () => (0, import_react83.useContext)(ProgressTrackerContext);
|
|
11208
11226
|
|
|
11209
11227
|
// src/components/ProgressTracker/ProgressTracker.tokens.tsx
|
|
11210
11228
|
var import_dds_design_tokens53 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -11322,9 +11340,9 @@ var progressTrackerTokens = {
|
|
|
11322
11340
|
};
|
|
11323
11341
|
|
|
11324
11342
|
// src/components/ProgressTracker/ProgressTrackerItem.tsx
|
|
11325
|
-
var
|
|
11326
|
-
var
|
|
11327
|
-
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");
|
|
11328
11346
|
var toItemState = (active, completed, disabled) => {
|
|
11329
11347
|
if (disabled) {
|
|
11330
11348
|
return "disabled";
|
|
@@ -11336,13 +11354,13 @@ var toItemState = (active, completed, disabled) => {
|
|
|
11336
11354
|
}
|
|
11337
11355
|
};
|
|
11338
11356
|
var { itemNumber: itemNumber2, itemText: itemText2, itemContentWrapper: itemContentWrapper2 } = progressTrackerTokens;
|
|
11339
|
-
var ItemWrapper =
|
|
11357
|
+
var ItemWrapper = import_styled_components74.default.li`
|
|
11340
11358
|
flex: 1;
|
|
11341
11359
|
position: relative;
|
|
11342
11360
|
display: flex;
|
|
11343
11361
|
justify-content: center;
|
|
11344
11362
|
`;
|
|
11345
|
-
var ItemNumber =
|
|
11363
|
+
var ItemNumber = import_styled_components74.default.div`
|
|
11346
11364
|
transition:
|
|
11347
11365
|
background-color 0.2s,
|
|
11348
11366
|
border-color 0.2s,
|
|
@@ -11358,24 +11376,24 @@ var ItemNumber = import_styled_components73.default.div`
|
|
|
11358
11376
|
${getFontStyling(typographyTypes4.number)}
|
|
11359
11377
|
font-weight: 600;
|
|
11360
11378
|
|
|
11361
|
-
${({ $state: state }) => state &&
|
|
11379
|
+
${({ $state: state }) => state && import_styled_components74.css`
|
|
11362
11380
|
border-color: ${itemNumber2[state].borderColor};
|
|
11363
11381
|
color: ${itemNumber2[state].color};
|
|
11364
11382
|
background-color: ${itemNumber2[state].backgroundColor};
|
|
11365
11383
|
`}
|
|
11366
11384
|
`;
|
|
11367
|
-
var ItemText =
|
|
11385
|
+
var ItemText = import_styled_components74.default.div`
|
|
11368
11386
|
${getFontStyling(typographyTypes4.label)}
|
|
11369
11387
|
text-align: start;
|
|
11370
11388
|
text-decoration: ${itemText2.textDecoration};
|
|
11371
11389
|
transition: text-decoration-color 0.2s;
|
|
11372
11390
|
|
|
11373
|
-
${({ $state: state }) => state &&
|
|
11391
|
+
${({ $state: state }) => state && import_styled_components74.css`
|
|
11374
11392
|
color: ${itemText2[state].color};
|
|
11375
11393
|
text-decoration-color: ${itemText2[state].textDecorationColor};
|
|
11376
11394
|
`};
|
|
11377
11395
|
`;
|
|
11378
|
-
var ItemContentWrapper =
|
|
11396
|
+
var ItemContentWrapper = import_styled_components74.default.button`
|
|
11379
11397
|
background: none;
|
|
11380
11398
|
border: none;
|
|
11381
11399
|
margin: 0;
|
|
@@ -11393,7 +11411,7 @@ var ItemContentWrapper = import_styled_components73.default.button`
|
|
|
11393
11411
|
${focusVisible}
|
|
11394
11412
|
}
|
|
11395
11413
|
|
|
11396
|
-
${({ $state: state }) => state !== "disabled" &&
|
|
11414
|
+
${({ $state: state }) => state !== "disabled" && import_styled_components74.css`
|
|
11397
11415
|
cursor: pointer;
|
|
11398
11416
|
&:hover > ${ItemText} {
|
|
11399
11417
|
color: ${itemText2[state].hover.color};
|
|
@@ -11419,16 +11437,16 @@ var ProgressTrackerItem = (props) => {
|
|
|
11419
11437
|
const styleProps = {
|
|
11420
11438
|
$state: toItemState(active, completed, disabled)
|
|
11421
11439
|
};
|
|
11422
|
-
const stepNumberContent = (0,
|
|
11440
|
+
const stepNumberContent = (0, import_react84.useMemo)(() => {
|
|
11423
11441
|
if (completed) {
|
|
11424
|
-
return /* @__PURE__ */ (0,
|
|
11442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(Icon, { icon: CheckIcon, iconSize: itemNumber2.iconSize });
|
|
11425
11443
|
}
|
|
11426
11444
|
if (icon11 !== void 0) {
|
|
11427
|
-
return /* @__PURE__ */ (0,
|
|
11445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(Icon, { icon: icon11, iconSize: itemNumber2.iconSize });
|
|
11428
11446
|
}
|
|
11429
11447
|
return index + 1;
|
|
11430
11448
|
}, [completed, icon11, index]);
|
|
11431
|
-
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)(
|
|
11432
11450
|
ItemContentWrapper,
|
|
11433
11451
|
{
|
|
11434
11452
|
...styleProps,
|
|
@@ -11436,9 +11454,9 @@ var ProgressTrackerItem = (props) => {
|
|
|
11436
11454
|
onClick: !disabled && handleStepChange ? () => handleStepChange(index) : void 0,
|
|
11437
11455
|
disabled,
|
|
11438
11456
|
children: [
|
|
11439
|
-
/* @__PURE__ */ (0,
|
|
11440
|
-
/* @__PURE__ */ (0,
|
|
11441
|
-
/* @__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) }),
|
|
11442
11460
|
children
|
|
11443
11461
|
] })
|
|
11444
11462
|
]
|
|
@@ -11448,8 +11466,8 @@ var ProgressTrackerItem = (props) => {
|
|
|
11448
11466
|
ProgressTrackerItem.displayName = "ProgressTracker.Item";
|
|
11449
11467
|
|
|
11450
11468
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
11451
|
-
var
|
|
11452
|
-
var ItemsWrapper =
|
|
11469
|
+
var import_jsx_runtime244 = require("react/jsx-runtime");
|
|
11470
|
+
var ItemsWrapper = import_styled_components75.default.ol`
|
|
11453
11471
|
display: flex;
|
|
11454
11472
|
flex-direction: column;
|
|
11455
11473
|
align-items: flex-start;
|
|
@@ -11457,7 +11475,7 @@ var ItemsWrapper = import_styled_components74.default.ol`
|
|
|
11457
11475
|
margin: 0;
|
|
11458
11476
|
padding: 0;
|
|
11459
11477
|
`;
|
|
11460
|
-
var ProgressTrackerConnector =
|
|
11478
|
+
var ProgressTrackerConnector = import_styled_components75.default.div`
|
|
11461
11479
|
margin-left: calc(
|
|
11462
11480
|
(${progressTrackerTokens.itemNumber.size} / 2) -
|
|
11463
11481
|
(${progressTrackerTokens.connector.width} / 2)
|
|
@@ -11467,7 +11485,7 @@ var ProgressTrackerConnector = import_styled_components74.default.div`
|
|
|
11467
11485
|
${progressTrackerTokens.connector.color};
|
|
11468
11486
|
`;
|
|
11469
11487
|
var ProgressTracker = (() => {
|
|
11470
|
-
const Res = (0,
|
|
11488
|
+
const Res = (0, import_react85.forwardRef)((props, ref) => {
|
|
11471
11489
|
const {
|
|
11472
11490
|
id,
|
|
11473
11491
|
activeStep = 0,
|
|
@@ -11477,12 +11495,12 @@ var ProgressTracker = (() => {
|
|
|
11477
11495
|
htmlProps,
|
|
11478
11496
|
...rest
|
|
11479
11497
|
} = props;
|
|
11480
|
-
const [thisActiveStep, setActiveStep] = (0,
|
|
11498
|
+
const [thisActiveStep, setActiveStep] = (0, import_react85.useState)(activeStep);
|
|
11481
11499
|
const handleChange = (step) => {
|
|
11482
11500
|
setActiveStep(step);
|
|
11483
11501
|
onStepChange && onStepChange(step);
|
|
11484
11502
|
};
|
|
11485
|
-
(0,
|
|
11503
|
+
(0, import_react85.useEffect)(() => {
|
|
11486
11504
|
if (activeStep !== void 0 && activeStep != thisActiveStep) {
|
|
11487
11505
|
setActiveStep(activeStep);
|
|
11488
11506
|
}
|
|
@@ -11491,20 +11509,20 @@ var ProgressTracker = (() => {
|
|
|
11491
11509
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
11492
11510
|
ref
|
|
11493
11511
|
};
|
|
11494
|
-
const steps = (0,
|
|
11512
|
+
const steps = (0, import_react85.useMemo)(() => {
|
|
11495
11513
|
const validChildren = removeInvalidChildren(children);
|
|
11496
11514
|
const itemsWithIndex = passIndexPropToProgressTrackerItem(validChildren);
|
|
11497
11515
|
const itemsWithConnectorsBetween = intersperseItemsWithConnector(itemsWithIndex);
|
|
11498
11516
|
return itemsWithConnectorsBetween;
|
|
11499
11517
|
}, [children]);
|
|
11500
|
-
return /* @__PURE__ */ (0,
|
|
11518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
11501
11519
|
ProgressTrackerContext.Provider,
|
|
11502
11520
|
{
|
|
11503
11521
|
value: {
|
|
11504
11522
|
activeStep: thisActiveStep,
|
|
11505
11523
|
handleStepChange: handleChange
|
|
11506
11524
|
},
|
|
11507
|
-
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 }) })
|
|
11508
11526
|
}
|
|
11509
11527
|
);
|
|
11510
11528
|
});
|
|
@@ -11513,36 +11531,36 @@ var ProgressTracker = (() => {
|
|
|
11513
11531
|
return Res;
|
|
11514
11532
|
})();
|
|
11515
11533
|
function removeInvalidChildren(children) {
|
|
11516
|
-
return
|
|
11534
|
+
return import_react85.Children.toArray(children).filter(import_react85.isValidElement);
|
|
11517
11535
|
}
|
|
11518
11536
|
function passIndexPropToProgressTrackerItem(children) {
|
|
11519
|
-
return
|
|
11537
|
+
return import_react85.Children.map(
|
|
11520
11538
|
children,
|
|
11521
|
-
(item, index) => (0,
|
|
11539
|
+
(item, index) => (0, import_react85.cloneElement)(item, {
|
|
11522
11540
|
...item.props,
|
|
11523
11541
|
index
|
|
11524
11542
|
})
|
|
11525
11543
|
);
|
|
11526
11544
|
}
|
|
11527
|
-
var intersperseItemsWithConnector = (children) =>
|
|
11545
|
+
var intersperseItemsWithConnector = (children) => import_react85.Children.map(children, (child, index) => {
|
|
11528
11546
|
if (index === 0) {
|
|
11529
11547
|
return child;
|
|
11530
11548
|
}
|
|
11531
|
-
return /* @__PURE__ */ (0,
|
|
11532
|
-
/* @__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 }),
|
|
11533
11551
|
child
|
|
11534
11552
|
] }, index);
|
|
11535
11553
|
});
|
|
11536
11554
|
|
|
11537
11555
|
// src/components/Search/Search.tsx
|
|
11538
|
-
var
|
|
11539
|
-
var
|
|
11556
|
+
var import_react88 = require("react");
|
|
11557
|
+
var import_styled_components77 = __toESM(require("styled-components"));
|
|
11540
11558
|
|
|
11541
11559
|
// src/components/Search/AutocompleteSearch.context.tsx
|
|
11542
|
-
var
|
|
11543
|
-
var AutocompleteSearchContext = (0,
|
|
11560
|
+
var import_react86 = require("react");
|
|
11561
|
+
var AutocompleteSearchContext = (0, import_react86.createContext)({});
|
|
11544
11562
|
var useAutocompleteSearch = () => {
|
|
11545
|
-
return (0,
|
|
11563
|
+
return (0, import_react86.useContext)(AutocompleteSearchContext);
|
|
11546
11564
|
};
|
|
11547
11565
|
|
|
11548
11566
|
// src/components/Search/Search.tokens.tsx
|
|
@@ -11652,11 +11670,11 @@ function createEmptyChangeEvent(inputElementId) {
|
|
|
11652
11670
|
}
|
|
11653
11671
|
|
|
11654
11672
|
// src/components/Search/SearchSuggestions.tsx
|
|
11655
|
-
var
|
|
11656
|
-
var
|
|
11657
|
-
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");
|
|
11658
11676
|
var { suggestionsContainer: suggestionsContainer2, suggestionsHeader: suggestionsHeader2 } = searchTokens;
|
|
11659
|
-
var SuggestionsContainer = (0,
|
|
11677
|
+
var SuggestionsContainer = (0, import_styled_components76.default)(Paper)`
|
|
11660
11678
|
${({ $isHidden }) => visibilityTransition(!$isHidden)};
|
|
11661
11679
|
position: absolute;
|
|
11662
11680
|
top: 100%;
|
|
@@ -11670,16 +11688,16 @@ var SuggestionsContainer = (0, import_styled_components75.default)(Paper)`
|
|
|
11670
11688
|
${scrollbarStyling.firefox}
|
|
11671
11689
|
${scrollbarStyling.webkit}
|
|
11672
11690
|
`;
|
|
11673
|
-
var MenuItem = (0,
|
|
11691
|
+
var MenuItem = (0, import_styled_components76.default)(OverflowMenuItem)`
|
|
11674
11692
|
${({ $size }) => $size && getFontStyling(typographyTypes5[$size])}
|
|
11675
11693
|
`;
|
|
11676
|
-
var SuggestionsList =
|
|
11694
|
+
var SuggestionsList = import_styled_components76.default.ul`
|
|
11677
11695
|
${removeListStyling}
|
|
11678
11696
|
`;
|
|
11679
|
-
var SuggestionsHeader = (0,
|
|
11697
|
+
var SuggestionsHeader = (0, import_styled_components76.default)(Typography)`
|
|
11680
11698
|
padding-left: ${suggestionsHeader2.paddingLeft};
|
|
11681
11699
|
`;
|
|
11682
|
-
var SearchSuggestions = (0,
|
|
11700
|
+
var SearchSuggestions = (0, import_react87.forwardRef)((props, ref) => {
|
|
11683
11701
|
const {
|
|
11684
11702
|
id,
|
|
11685
11703
|
searchId,
|
|
@@ -11698,8 +11716,8 @@ var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
|
11698
11716
|
);
|
|
11699
11717
|
const [focus] = useRoveFocus(suggestions == null ? void 0 : suggestions.length, showSuggestions);
|
|
11700
11718
|
const suggestionsToRender = maxSuggestions ? suggestions == null ? void 0 : suggestions.slice(maxSuggestions) : suggestions;
|
|
11701
|
-
const renderedSuggestions = /* @__PURE__ */ (0,
|
|
11702
|
-
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)(
|
|
11703
11721
|
MenuItem,
|
|
11704
11722
|
{
|
|
11705
11723
|
index,
|
|
@@ -11714,7 +11732,7 @@ var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
|
11714
11732
|
) }, index);
|
|
11715
11733
|
}) });
|
|
11716
11734
|
const isHidden = !showSuggestions;
|
|
11717
|
-
return /* @__PURE__ */ (0,
|
|
11735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime245.jsxs)(
|
|
11718
11736
|
SuggestionsContainer,
|
|
11719
11737
|
{
|
|
11720
11738
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -11722,7 +11740,7 @@ var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
|
11722
11740
|
$isHidden: isHidden,
|
|
11723
11741
|
"aria-hidden": isHidden,
|
|
11724
11742
|
children: [
|
|
11725
|
-
/* @__PURE__ */ (0,
|
|
11743
|
+
/* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
|
|
11726
11744
|
SuggestionsHeader,
|
|
11727
11745
|
{
|
|
11728
11746
|
typographyType: "supportingStyleTiny01",
|
|
@@ -11739,7 +11757,7 @@ var SearchSuggestions = (0, import_react86.forwardRef)((props, ref) => {
|
|
|
11739
11757
|
SearchSuggestions.displayName = "SearchSuggestions";
|
|
11740
11758
|
|
|
11741
11759
|
// src/components/Search/Search.tsx
|
|
11742
|
-
var
|
|
11760
|
+
var import_jsx_runtime246 = require("react/jsx-runtime");
|
|
11743
11761
|
var { input: input4, outerContainer: outerContainer6, horisontalContainer: horisontalContainer2, searchIcon: searchIcon2, clearButton: clearButton2 } = searchTokens;
|
|
11744
11762
|
var getIconSize = (size2) => {
|
|
11745
11763
|
switch (size2) {
|
|
@@ -11751,7 +11769,7 @@ var getIconSize = (size2) => {
|
|
|
11751
11769
|
return "small";
|
|
11752
11770
|
}
|
|
11753
11771
|
};
|
|
11754
|
-
var Input3 = (0,
|
|
11772
|
+
var Input3 = (0, import_styled_components77.default)(Input)`
|
|
11755
11773
|
&[type='search']::-webkit-search-decoration,
|
|
11756
11774
|
&[type='search']::-webkit-search-cancel-button,
|
|
11757
11775
|
&[type='search']::-webkit-search-results-button,
|
|
@@ -11760,45 +11778,45 @@ var Input3 = (0, import_styled_components76.default)(Input)`
|
|
|
11760
11778
|
}
|
|
11761
11779
|
padding-right: ${input4.base.paddingRight};
|
|
11762
11780
|
|
|
11763
|
-
${({ $componentSize }) =>
|
|
11781
|
+
${({ $componentSize }) => import_styled_components77.css`
|
|
11764
11782
|
padding-top: ${input4.sizes[$componentSize].paddingTop};
|
|
11765
11783
|
padding-bottom: ${input4.sizes[$componentSize].paddingBottom};
|
|
11766
11784
|
padding-left: ${input4.sizes[$componentSize].paddingLeft};
|
|
11767
11785
|
${getFontStyling(typographyTypes5[$componentSize])}
|
|
11768
11786
|
`}
|
|
11769
11787
|
`;
|
|
11770
|
-
var StyledSearchIcon = (0,
|
|
11788
|
+
var StyledSearchIcon = (0, import_styled_components77.default)(Icon)`
|
|
11771
11789
|
position: absolute;
|
|
11772
11790
|
left: ${searchIcon2.base.left};
|
|
11773
11791
|
color: ${searchIcon2.base.color};
|
|
11774
|
-
${({ $size }) =>
|
|
11792
|
+
${({ $size }) => import_styled_components77.css`
|
|
11775
11793
|
top: ${searchTokens.searchIcon[$size].top};
|
|
11776
11794
|
`}
|
|
11777
11795
|
z-index: 1;
|
|
11778
11796
|
`;
|
|
11779
|
-
var StyledClearButton = (0,
|
|
11797
|
+
var StyledClearButton = (0, import_styled_components77.default)(Button)`
|
|
11780
11798
|
position: absolute;
|
|
11781
11799
|
right: ${clearButton2.right};
|
|
11782
11800
|
color: ${clearButton2.color};
|
|
11783
11801
|
top: ${clearButton2.top};
|
|
11784
11802
|
`;
|
|
11785
|
-
var OuterContainer2 =
|
|
11803
|
+
var OuterContainer2 = import_styled_components77.default.div`
|
|
11786
11804
|
display: flex;
|
|
11787
11805
|
flex-direction: column;
|
|
11788
11806
|
gap: ${outerContainer6.gap};
|
|
11789
11807
|
`;
|
|
11790
|
-
var HorisontalContainer =
|
|
11791
|
-
${(props) => props.$hasSearchButton &&
|
|
11808
|
+
var HorisontalContainer = import_styled_components77.default.div`
|
|
11809
|
+
${(props) => props.$hasSearchButton && import_styled_components77.css`
|
|
11792
11810
|
display: grid;
|
|
11793
11811
|
grid-template-columns: 1fr auto;
|
|
11794
11812
|
gap: ${horisontalContainer2.gap};
|
|
11795
11813
|
`}
|
|
11796
11814
|
`;
|
|
11797
|
-
var InputContainer2 =
|
|
11815
|
+
var InputContainer2 = import_styled_components77.default.div`
|
|
11798
11816
|
position: relative;
|
|
11799
11817
|
display: flex;
|
|
11800
11818
|
`;
|
|
11801
|
-
var Search = (0,
|
|
11819
|
+
var Search = (0, import_react88.forwardRef)(
|
|
11802
11820
|
({
|
|
11803
11821
|
componentSize = "medium",
|
|
11804
11822
|
buttonProps,
|
|
@@ -11814,7 +11832,7 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11814
11832
|
...rest
|
|
11815
11833
|
}, ref) => {
|
|
11816
11834
|
var _a;
|
|
11817
|
-
const generatedId = (0,
|
|
11835
|
+
const generatedId = (0, import_react88.useId)();
|
|
11818
11836
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
11819
11837
|
const hasLabel = !!label3;
|
|
11820
11838
|
const tipId = derivativeIdGenerator(uniqueId, "tip");
|
|
@@ -11823,7 +11841,7 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11823
11841
|
uniqueId,
|
|
11824
11842
|
"suggestions-description"
|
|
11825
11843
|
);
|
|
11826
|
-
const [hasValue, setHasValue] = (0,
|
|
11844
|
+
const [hasValue, setHasValue] = (0, import_react88.useState)(!!value);
|
|
11827
11845
|
const context = useAutocompleteSearch();
|
|
11828
11846
|
const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
|
|
11829
11847
|
const handleChange = (e) => {
|
|
@@ -11842,18 +11860,18 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11842
11860
|
} = buttonProps != null ? buttonProps : {};
|
|
11843
11861
|
const hasSuggestions = !!context.suggestions;
|
|
11844
11862
|
const showSearchButton = !!buttonProps && !!onClick;
|
|
11845
|
-
return /* @__PURE__ */ (0,
|
|
11846
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
11847
|
-
/* @__PURE__ */ (0,
|
|
11848
|
-
/* @__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)(
|
|
11849
11867
|
HorisontalContainer,
|
|
11850
11868
|
{
|
|
11851
11869
|
$hasSearchButton: showSearchButton,
|
|
11852
11870
|
className,
|
|
11853
11871
|
style,
|
|
11854
11872
|
children: [
|
|
11855
|
-
/* @__PURE__ */ (0,
|
|
11856
|
-
/* @__PURE__ */ (0,
|
|
11873
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(InputContainer2, { children: [
|
|
11874
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
11857
11875
|
StyledSearchIcon,
|
|
11858
11876
|
{
|
|
11859
11877
|
icon: SearchIcon,
|
|
@@ -11861,7 +11879,7 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11861
11879
|
iconSize: getIconSize(componentSize)
|
|
11862
11880
|
}
|
|
11863
11881
|
),
|
|
11864
|
-
/* @__PURE__ */ (0,
|
|
11882
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
11865
11883
|
Input3,
|
|
11866
11884
|
{
|
|
11867
11885
|
...rest,
|
|
@@ -11884,8 +11902,8 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11884
11902
|
role: hasSuggestions ? "combobox" : void 0
|
|
11885
11903
|
}
|
|
11886
11904
|
),
|
|
11887
|
-
hasSuggestions && /* @__PURE__ */ (0,
|
|
11888
|
-
/* @__PURE__ */ (0,
|
|
11905
|
+
hasSuggestions && /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(import_jsx_runtime246.Fragment, { children: [
|
|
11906
|
+
/* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
11889
11907
|
SearchSuggestions,
|
|
11890
11908
|
{
|
|
11891
11909
|
id: suggestionsId,
|
|
@@ -11897,9 +11915,9 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11897
11915
|
componentSize
|
|
11898
11916
|
}
|
|
11899
11917
|
),
|
|
11900
|
-
/* @__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." })
|
|
11901
11919
|
] }),
|
|
11902
|
-
hasValue && /* @__PURE__ */ (0,
|
|
11920
|
+
hasValue && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
11903
11921
|
StyledClearButton,
|
|
11904
11922
|
{
|
|
11905
11923
|
icon: CloseSmallIcon,
|
|
@@ -11911,7 +11929,7 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11911
11929
|
}
|
|
11912
11930
|
)
|
|
11913
11931
|
] }),
|
|
11914
|
-
showSearchButton && /* @__PURE__ */ (0,
|
|
11932
|
+
showSearchButton && /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
11915
11933
|
Button,
|
|
11916
11934
|
{
|
|
11917
11935
|
size: componentSize,
|
|
@@ -11931,8 +11949,8 @@ var Search = (0, import_react87.forwardRef)(
|
|
|
11931
11949
|
Search.displayName = "Search";
|
|
11932
11950
|
|
|
11933
11951
|
// src/components/Search/SearchAutocompleteWrapper.tsx
|
|
11934
|
-
var
|
|
11935
|
-
var
|
|
11952
|
+
var import_react89 = require("react");
|
|
11953
|
+
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
11936
11954
|
var SearchAutocompleteWrapper = (props) => {
|
|
11937
11955
|
const {
|
|
11938
11956
|
value,
|
|
@@ -11943,12 +11961,12 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
11943
11961
|
onSuggestionSelection,
|
|
11944
11962
|
children
|
|
11945
11963
|
} = props;
|
|
11946
|
-
const [inputValue, setInputValue] = (0,
|
|
11947
|
-
const [suggestions, setSuggestions] = (0,
|
|
11948
|
-
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);
|
|
11949
11967
|
const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
|
|
11950
11968
|
const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
|
|
11951
|
-
(0,
|
|
11969
|
+
(0, import_react89.useEffect)(() => {
|
|
11952
11970
|
if (suggestions.length > 0) {
|
|
11953
11971
|
openSuggestions();
|
|
11954
11972
|
} else {
|
|
@@ -11993,8 +12011,8 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
11993
12011
|
const handleSetInputValue = (value2) => {
|
|
11994
12012
|
setInputValue(value2 != null ? value2 : "");
|
|
11995
12013
|
};
|
|
11996
|
-
const inputRef = (0,
|
|
11997
|
-
const suggestionsRef = (0,
|
|
12014
|
+
const inputRef = (0, import_react89.useRef)(null);
|
|
12015
|
+
const suggestionsRef = (0, import_react89.useRef)(null);
|
|
11998
12016
|
useOnClickOutside([inputRef.current, suggestionsRef.current], () => {
|
|
11999
12017
|
closeSuggestions();
|
|
12000
12018
|
});
|
|
@@ -12008,7 +12026,7 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
12008
12026
|
inputValue,
|
|
12009
12027
|
onSugggestionClick: handleSuggestionClick
|
|
12010
12028
|
};
|
|
12011
|
-
return /* @__PURE__ */ (0,
|
|
12029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(AutocompleteSearchContext.Provider, { value: contextProps, children });
|
|
12012
12030
|
};
|
|
12013
12031
|
SearchAutocompleteWrapper.displayName = "SearchAutocompleteWrapper";
|
|
12014
12032
|
|
|
@@ -12018,17 +12036,17 @@ Search2.AutocompleteWrapper = SearchAutocompleteWrapper;
|
|
|
12018
12036
|
Search2.Suggestions = SearchSuggestions;
|
|
12019
12037
|
|
|
12020
12038
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
12021
|
-
var
|
|
12039
|
+
var import_react91 = require("react");
|
|
12022
12040
|
|
|
12023
12041
|
// src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
|
|
12024
|
-
var
|
|
12025
|
-
var CheckboxGroupContext = (0,
|
|
12042
|
+
var import_react90 = require("react");
|
|
12043
|
+
var CheckboxGroupContext = (0, import_react90.createContext)(null);
|
|
12026
12044
|
var useCheckboxGroup = () => {
|
|
12027
|
-
return (0,
|
|
12045
|
+
return (0, import_react90.useContext)(CheckboxGroupContext);
|
|
12028
12046
|
};
|
|
12029
12047
|
|
|
12030
12048
|
// src/components/SelectionControl/SelectionControl.styles.tsx
|
|
12031
|
-
var
|
|
12049
|
+
var import_styled_components78 = __toESM(require("styled-components"));
|
|
12032
12050
|
|
|
12033
12051
|
// src/components/SelectionControl/SelectionControl.tokens.tsx
|
|
12034
12052
|
var import_dds_design_tokens55 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -12148,7 +12166,7 @@ var {
|
|
|
12148
12166
|
groupContainer: groupContainer2,
|
|
12149
12167
|
outerGroupContainer: outerGroupContainer2
|
|
12150
12168
|
} = selectionControlTokens;
|
|
12151
|
-
var CustomSelectionControl =
|
|
12169
|
+
var CustomSelectionControl = import_styled_components78.default.span`
|
|
12152
12170
|
position: absolute;
|
|
12153
12171
|
left: 0;
|
|
12154
12172
|
box-sizing: border-box;
|
|
@@ -12158,7 +12176,7 @@ var CustomSelectionControl = import_styled_components77.default.span`
|
|
|
12158
12176
|
border-radius: ${selectionControl2.base.borderRadius};
|
|
12159
12177
|
height: ${selectionControl2.base.height};
|
|
12160
12178
|
width: ${selectionControl2.base.width};
|
|
12161
|
-
${({ $controlType }) => $controlType === "radio" &&
|
|
12179
|
+
${({ $controlType }) => $controlType === "radio" && import_styled_components78.css`
|
|
12162
12180
|
border-radius: 50%;
|
|
12163
12181
|
`}
|
|
12164
12182
|
&:after {
|
|
@@ -12167,7 +12185,7 @@ var CustomSelectionControl = import_styled_components77.default.span`
|
|
|
12167
12185
|
display: none;
|
|
12168
12186
|
}
|
|
12169
12187
|
`;
|
|
12170
|
-
var Container13 =
|
|
12188
|
+
var Container13 = import_styled_components78.default.label`
|
|
12171
12189
|
position: relative;
|
|
12172
12190
|
display: flex;
|
|
12173
12191
|
align-items: center;
|
|
@@ -12175,9 +12193,9 @@ var Container13 = import_styled_components77.default.label`
|
|
|
12175
12193
|
user-select: none;
|
|
12176
12194
|
width: fit-content;
|
|
12177
12195
|
color: ${container14.color};
|
|
12178
|
-
${({ $hasLabel }) => $hasLabel ?
|
|
12196
|
+
${({ $hasLabel }) => $hasLabel ? import_styled_components78.css`
|
|
12179
12197
|
padding-left: ${container14.withLabel.paddingLeft};
|
|
12180
|
-
` :
|
|
12198
|
+
` : import_styled_components78.css`
|
|
12181
12199
|
padding: ${container14.noLabel.padding};
|
|
12182
12200
|
`}
|
|
12183
12201
|
|
|
@@ -12221,7 +12239,7 @@ var Container13 = import_styled_components77.default.label`
|
|
|
12221
12239
|
border-color: ${selectionControl2.checked.hover.borderColor};
|
|
12222
12240
|
}
|
|
12223
12241
|
|
|
12224
|
-
${({ $error }) => $error &&
|
|
12242
|
+
${({ $error }) => $error && import_styled_components78.css`
|
|
12225
12243
|
&:hover input:enabled ~ ${CustomSelectionControl} {
|
|
12226
12244
|
background-color: ${selectionControl2.hover.danger.backgroundColor};
|
|
12227
12245
|
box-shadow: ${selectionControl2.hover.danger.boxShadow};
|
|
@@ -12255,14 +12273,14 @@ var Container13 = import_styled_components77.default.label`
|
|
|
12255
12273
|
display: block;
|
|
12256
12274
|
}
|
|
12257
12275
|
|
|
12258
|
-
${({ $readOnly }) => $readOnly &&
|
|
12276
|
+
${({ $readOnly }) => $readOnly && import_styled_components78.css`
|
|
12259
12277
|
cursor: default;
|
|
12260
12278
|
`}
|
|
12261
|
-
${({ disabled }) => disabled &&
|
|
12279
|
+
${({ disabled }) => disabled && import_styled_components78.css`
|
|
12262
12280
|
cursor: not-allowed;
|
|
12263
12281
|
color: ${container14.disabled.color};
|
|
12264
12282
|
`}
|
|
12265
|
-
${({ $controlType }) => $controlType === "checkbox" ?
|
|
12283
|
+
${({ $controlType }) => $controlType === "checkbox" ? import_styled_components78.css`
|
|
12266
12284
|
${CustomSelectionControl}:after {
|
|
12267
12285
|
border: solid ${checkmark2.checkbox.borderColor};
|
|
12268
12286
|
|
|
@@ -12281,7 +12299,7 @@ var Container13 = import_styled_components77.default.label`
|
|
|
12281
12299
|
height: 1px;
|
|
12282
12300
|
transform: none;
|
|
12283
12301
|
}
|
|
12284
|
-
` :
|
|
12302
|
+
` : import_styled_components78.css`
|
|
12285
12303
|
${CustomSelectionControl}:after {
|
|
12286
12304
|
border-radius: 50%;
|
|
12287
12305
|
background-color: ${checkmark2.radio.backgroundColor};
|
|
@@ -12292,22 +12310,22 @@ var Container13 = import_styled_components77.default.label`
|
|
|
12292
12310
|
}
|
|
12293
12311
|
`}
|
|
12294
12312
|
`;
|
|
12295
|
-
var OuterGroupContainer =
|
|
12313
|
+
var OuterGroupContainer = import_styled_components78.default.div`
|
|
12296
12314
|
display: flex;
|
|
12297
12315
|
flex-direction: column;
|
|
12298
12316
|
gap: ${outerGroupContainer2.gap};
|
|
12299
12317
|
`;
|
|
12300
|
-
var GroupContainer =
|
|
12318
|
+
var GroupContainer = import_styled_components78.default.div`
|
|
12301
12319
|
display: flex;
|
|
12302
|
-
${({ $direction }) =>
|
|
12320
|
+
${({ $direction }) => import_styled_components78.css`
|
|
12303
12321
|
flex-direction: ${$direction};
|
|
12304
12322
|
gap: ${groupContainer2[$direction].gap};
|
|
12305
12323
|
`}
|
|
12306
12324
|
`;
|
|
12307
12325
|
|
|
12308
12326
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
12309
|
-
var
|
|
12310
|
-
var Checkbox = (0,
|
|
12327
|
+
var import_jsx_runtime248 = require("react/jsx-runtime");
|
|
12328
|
+
var Checkbox = (0, import_react91.forwardRef)(
|
|
12311
12329
|
(props, ref) => {
|
|
12312
12330
|
const {
|
|
12313
12331
|
id,
|
|
@@ -12322,7 +12340,7 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12322
12340
|
htmlProps = {},
|
|
12323
12341
|
...rest
|
|
12324
12342
|
} = props;
|
|
12325
|
-
const generatedId = (0,
|
|
12343
|
+
const generatedId = (0, import_react91.useId)();
|
|
12326
12344
|
const uniqueId = id != null ? id : `${generatedId}-checkbox`;
|
|
12327
12345
|
const checkboxGroup = useCheckboxGroup();
|
|
12328
12346
|
const hasLabel = !!label3;
|
|
@@ -12331,7 +12349,7 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12331
12349
|
className: htmlPropsClassName,
|
|
12332
12350
|
...restHtmlProps
|
|
12333
12351
|
} = htmlProps;
|
|
12334
|
-
return /* @__PURE__ */ (0,
|
|
12352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime248.jsxs)(
|
|
12335
12353
|
Container13,
|
|
12336
12354
|
{
|
|
12337
12355
|
$error: error || (checkboxGroup == null ? void 0 : checkboxGroup.error),
|
|
@@ -12343,7 +12361,7 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12343
12361
|
className: cn(className, htmlPropsClassName),
|
|
12344
12362
|
style,
|
|
12345
12363
|
children: [
|
|
12346
|
-
/* @__PURE__ */ (0,
|
|
12364
|
+
/* @__PURE__ */ (0, import_jsx_runtime248.jsx)(
|
|
12347
12365
|
HiddenInput,
|
|
12348
12366
|
{
|
|
12349
12367
|
...getBaseHTMLProps(uniqueId, restHtmlProps, rest),
|
|
@@ -12363,8 +12381,8 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12363
12381
|
"data-indeterminate": indeterminate
|
|
12364
12382
|
}
|
|
12365
12383
|
),
|
|
12366
|
-
/* @__PURE__ */ (0,
|
|
12367
|
-
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 })
|
|
12368
12386
|
]
|
|
12369
12387
|
}
|
|
12370
12388
|
);
|
|
@@ -12373,8 +12391,8 @@ var Checkbox = (0, import_react90.forwardRef)(
|
|
|
12373
12391
|
Checkbox.displayName = "Checkbox";
|
|
12374
12392
|
|
|
12375
12393
|
// src/components/SelectionControl/Checkbox/CheckboxGroup.tsx
|
|
12376
|
-
var
|
|
12377
|
-
var
|
|
12394
|
+
var import_react92 = require("react");
|
|
12395
|
+
var import_jsx_runtime249 = require("react/jsx-runtime");
|
|
12378
12396
|
var CheckboxGroup = (props) => {
|
|
12379
12397
|
const {
|
|
12380
12398
|
label: label3,
|
|
@@ -12392,7 +12410,7 @@ var CheckboxGroup = (props) => {
|
|
|
12392
12410
|
...rest
|
|
12393
12411
|
} = props;
|
|
12394
12412
|
const { "aria-required": ariaRequired } = htmlProps;
|
|
12395
|
-
const generatedId = (0,
|
|
12413
|
+
const generatedId = (0, import_react92.useId)();
|
|
12396
12414
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-checkboxGroup`;
|
|
12397
12415
|
const hasErrorMessage = !!errorMessage;
|
|
12398
12416
|
const showRequiredMarker = required || ariaRequired;
|
|
@@ -12406,7 +12424,7 @@ var CheckboxGroup = (props) => {
|
|
|
12406
12424
|
disabled,
|
|
12407
12425
|
readOnly
|
|
12408
12426
|
};
|
|
12409
|
-
return /* @__PURE__ */ (0,
|
|
12427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
|
|
12410
12428
|
OuterGroupContainer,
|
|
12411
12429
|
{
|
|
12412
12430
|
...getBaseHTMLProps(
|
|
@@ -12416,7 +12434,7 @@ var CheckboxGroup = (props) => {
|
|
|
12416
12434
|
rest
|
|
12417
12435
|
),
|
|
12418
12436
|
children: [
|
|
12419
|
-
/* @__PURE__ */ (0,
|
|
12437
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(
|
|
12420
12438
|
Typography,
|
|
12421
12439
|
{
|
|
12422
12440
|
as: "span",
|
|
@@ -12425,12 +12443,12 @@ var CheckboxGroup = (props) => {
|
|
|
12425
12443
|
children: [
|
|
12426
12444
|
label3,
|
|
12427
12445
|
" ",
|
|
12428
|
-
showRequiredMarker && /* @__PURE__ */ (0,
|
|
12446
|
+
showRequiredMarker && /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(RequiredMarker, {})
|
|
12429
12447
|
]
|
|
12430
12448
|
}
|
|
12431
12449
|
),
|
|
12432
12450
|
renderInputMessage(tip, tipId),
|
|
12433
|
-
/* @__PURE__ */ (0,
|
|
12451
|
+
/* @__PURE__ */ (0, import_jsx_runtime249.jsx)(CheckboxGroupContext.Provider, { value: { ...contextProps }, children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
|
|
12434
12452
|
GroupContainer,
|
|
12435
12453
|
{
|
|
12436
12454
|
role: "group",
|
|
@@ -12448,17 +12466,17 @@ var CheckboxGroup = (props) => {
|
|
|
12448
12466
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
12449
12467
|
|
|
12450
12468
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
12451
|
-
var
|
|
12469
|
+
var import_react94 = require("react");
|
|
12452
12470
|
|
|
12453
12471
|
// src/components/SelectionControl/RadioButton/RadioButtonGroupContext.tsx
|
|
12454
|
-
var
|
|
12455
|
-
var RadioButtonGroupContext = (0,
|
|
12472
|
+
var import_react93 = require("react");
|
|
12473
|
+
var RadioButtonGroupContext = (0, import_react93.createContext)(null);
|
|
12456
12474
|
var useRadioButtonGroup = () => {
|
|
12457
|
-
return (0,
|
|
12475
|
+
return (0, import_react93.useContext)(RadioButtonGroupContext);
|
|
12458
12476
|
};
|
|
12459
12477
|
|
|
12460
12478
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
12461
|
-
var
|
|
12479
|
+
var import_jsx_runtime250 = require("react/jsx-runtime");
|
|
12462
12480
|
var isValueEqualToGroupValueOrFalsy = (value, group4) => {
|
|
12463
12481
|
if (typeof value !== "undefined" && value !== null && group4) {
|
|
12464
12482
|
if (typeof value === "number") {
|
|
@@ -12468,7 +12486,7 @@ var isValueEqualToGroupValueOrFalsy = (value, group4) => {
|
|
|
12468
12486
|
}
|
|
12469
12487
|
return !!value;
|
|
12470
12488
|
};
|
|
12471
|
-
var RadioButton = (0,
|
|
12489
|
+
var RadioButton = (0, import_react94.forwardRef)(
|
|
12472
12490
|
(props, ref) => {
|
|
12473
12491
|
const {
|
|
12474
12492
|
id,
|
|
@@ -12492,7 +12510,7 @@ var RadioButton = (0, import_react93.forwardRef)(
|
|
|
12492
12510
|
style,
|
|
12493
12511
|
...restHtmlProps
|
|
12494
12512
|
} = htmlProps;
|
|
12495
|
-
const generatedId = (0,
|
|
12513
|
+
const generatedId = (0, import_react94.useId)();
|
|
12496
12514
|
const uniqueId = id != null ? id : `${generatedId}-radioButton`;
|
|
12497
12515
|
const hasLabel = !!label3;
|
|
12498
12516
|
const radioButtonGroup = useRadioButtonGroup();
|
|
@@ -12517,7 +12535,7 @@ var RadioButton = (0, import_react93.forwardRef)(
|
|
|
12517
12535
|
"aria-describedby": describedByIds.length > 0 ? describedByIds.join(" ") : void 0,
|
|
12518
12536
|
"aria-invalid": error || (radioButtonGroup == null ? void 0 : radioButtonGroup.error) ? true : void 0
|
|
12519
12537
|
};
|
|
12520
|
-
return /* @__PURE__ */ (0,
|
|
12538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)(
|
|
12521
12539
|
Container13,
|
|
12522
12540
|
{
|
|
12523
12541
|
$error: error || (radioButtonGroup == null ? void 0 : radioButtonGroup.error),
|
|
@@ -12529,9 +12547,9 @@ var RadioButton = (0, import_react93.forwardRef)(
|
|
|
12529
12547
|
htmlFor: uniqueId,
|
|
12530
12548
|
$controlType: "radio",
|
|
12531
12549
|
children: [
|
|
12532
|
-
/* @__PURE__ */ (0,
|
|
12533
|
-
/* @__PURE__ */ (0,
|
|
12534
|
-
/* @__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 })
|
|
12535
12553
|
]
|
|
12536
12554
|
}
|
|
12537
12555
|
);
|
|
@@ -12540,8 +12558,8 @@ var RadioButton = (0, import_react93.forwardRef)(
|
|
|
12540
12558
|
RadioButton.displayName = "RadioButton";
|
|
12541
12559
|
|
|
12542
12560
|
// src/components/SelectionControl/RadioButton/RadioButtonGroup.tsx
|
|
12543
|
-
var
|
|
12544
|
-
var
|
|
12561
|
+
var import_react95 = require("react");
|
|
12562
|
+
var import_jsx_runtime251 = require("react/jsx-runtime");
|
|
12545
12563
|
var RadioButtonGroupInner = (props, ref) => {
|
|
12546
12564
|
const {
|
|
12547
12565
|
name,
|
|
@@ -12562,8 +12580,8 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12562
12580
|
...rest
|
|
12563
12581
|
} = props;
|
|
12564
12582
|
const { "aria-required": ariaRequired = false } = htmlProps;
|
|
12565
|
-
const [groupValue, setGroupValue] = (0,
|
|
12566
|
-
const generatedId = (0,
|
|
12583
|
+
const [groupValue, setGroupValue] = (0, import_react95.useState)(value);
|
|
12584
|
+
const generatedId = (0, import_react95.useId)();
|
|
12567
12585
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-radioButtonGroup`;
|
|
12568
12586
|
const handleChange = combineHandlers(
|
|
12569
12587
|
(e) => setGroupValue(e.target.value),
|
|
@@ -12583,7 +12601,7 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12583
12601
|
value: groupValue,
|
|
12584
12602
|
onChange: handleChange
|
|
12585
12603
|
};
|
|
12586
|
-
return /* @__PURE__ */ (0,
|
|
12604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(
|
|
12587
12605
|
OuterGroupContainer,
|
|
12588
12606
|
{
|
|
12589
12607
|
...getBaseHTMLProps(
|
|
@@ -12594,7 +12612,7 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12594
12612
|
),
|
|
12595
12613
|
ref,
|
|
12596
12614
|
children: [
|
|
12597
|
-
/* @__PURE__ */ (0,
|
|
12615
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsxs)(
|
|
12598
12616
|
Typography,
|
|
12599
12617
|
{
|
|
12600
12618
|
as: "span",
|
|
@@ -12603,12 +12621,12 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12603
12621
|
children: [
|
|
12604
12622
|
label3,
|
|
12605
12623
|
" ",
|
|
12606
|
-
showRequiredMarker && /* @__PURE__ */ (0,
|
|
12624
|
+
showRequiredMarker && /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(RequiredMarker, {})
|
|
12607
12625
|
]
|
|
12608
12626
|
}
|
|
12609
12627
|
),
|
|
12610
12628
|
renderInputMessage(tip, tipId),
|
|
12611
|
-
/* @__PURE__ */ (0,
|
|
12629
|
+
/* @__PURE__ */ (0, import_jsx_runtime251.jsx)(RadioButtonGroupContext.Provider, { value: { ...contextProps }, children: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
|
|
12612
12630
|
GroupContainer,
|
|
12613
12631
|
{
|
|
12614
12632
|
role: "radiogroup",
|
|
@@ -12624,12 +12642,12 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
12624
12642
|
}
|
|
12625
12643
|
);
|
|
12626
12644
|
};
|
|
12627
|
-
var RadioButtonGroup = (0,
|
|
12645
|
+
var RadioButtonGroup = (0, import_react95.forwardRef)(RadioButtonGroupInner);
|
|
12628
12646
|
RadioButtonGroup.displayName = "RadioButtonGroup";
|
|
12629
12647
|
|
|
12630
12648
|
// src/components/SkipToContent/SkipToContent.tsx
|
|
12631
|
-
var
|
|
12632
|
-
var
|
|
12649
|
+
var import_react96 = require("react");
|
|
12650
|
+
var import_styled_components79 = __toESM(require("styled-components"));
|
|
12633
12651
|
|
|
12634
12652
|
// src/components/SkipToContent/SkipToContent.tokens.tsx
|
|
12635
12653
|
var import_dds_design_tokens56 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -12652,9 +12670,9 @@ var skipToContentTokens = {
|
|
|
12652
12670
|
};
|
|
12653
12671
|
|
|
12654
12672
|
// src/components/SkipToContent/SkipToContent.tsx
|
|
12655
|
-
var
|
|
12673
|
+
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
12656
12674
|
var { wrapper: wrapper6, link: link5 } = skipToContentTokens;
|
|
12657
|
-
var Wrapper5 =
|
|
12675
|
+
var Wrapper5 = import_styled_components79.default.div`
|
|
12658
12676
|
box-sizing: border-box;
|
|
12659
12677
|
position: absolute;
|
|
12660
12678
|
top: ${({ $top: top }) => top};
|
|
@@ -12681,7 +12699,7 @@ var Wrapper5 = import_styled_components78.default.div`
|
|
|
12681
12699
|
opacity: 1;
|
|
12682
12700
|
}
|
|
12683
12701
|
`;
|
|
12684
|
-
var Link4 =
|
|
12702
|
+
var Link4 = import_styled_components79.default.a`
|
|
12685
12703
|
text-decoration: none;
|
|
12686
12704
|
color: ${link5.base.color};
|
|
12687
12705
|
${getFontStyling(defaultTypographyType)}
|
|
@@ -12696,7 +12714,7 @@ var Link4 = import_styled_components78.default.a`
|
|
|
12696
12714
|
color: ${link5.base.color};
|
|
12697
12715
|
}
|
|
12698
12716
|
`;
|
|
12699
|
-
var SkipToContent = (0,
|
|
12717
|
+
var SkipToContent = (0, import_react96.forwardRef)(
|
|
12700
12718
|
(props, ref) => {
|
|
12701
12719
|
const {
|
|
12702
12720
|
text = "Til hovedinnhold",
|
|
@@ -12711,13 +12729,13 @@ var SkipToContent = (0, import_react95.forwardRef)(
|
|
|
12711
12729
|
style,
|
|
12712
12730
|
...restHtmlProps
|
|
12713
12731
|
} = htmlProps;
|
|
12714
|
-
return /* @__PURE__ */ (0,
|
|
12732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
|
|
12715
12733
|
Wrapper5,
|
|
12716
12734
|
{
|
|
12717
12735
|
$top: top,
|
|
12718
12736
|
className: cn(className, htmlPropsClassName),
|
|
12719
12737
|
style,
|
|
12720
|
-
children: /* @__PURE__ */ (0,
|
|
12738
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(Link4, { ...getBaseHTMLProps(id, restHtmlProps, rest), ref, children: text })
|
|
12721
12739
|
}
|
|
12722
12740
|
);
|
|
12723
12741
|
}
|
|
@@ -12725,8 +12743,8 @@ var SkipToContent = (0, import_react95.forwardRef)(
|
|
|
12725
12743
|
SkipToContent.displayName = "SkipToContent";
|
|
12726
12744
|
|
|
12727
12745
|
// src/components/SplitButton/SplitButton.tsx
|
|
12728
|
-
var
|
|
12729
|
-
var
|
|
12746
|
+
var import_react97 = require("react");
|
|
12747
|
+
var import_styled_components80 = __toESM(require("styled-components"));
|
|
12730
12748
|
|
|
12731
12749
|
// src/components/SplitButton/SplitButton.tokens.ts
|
|
12732
12750
|
var import_dds_design_tokens57 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -12740,11 +12758,11 @@ var tokens3 = {
|
|
|
12740
12758
|
};
|
|
12741
12759
|
|
|
12742
12760
|
// src/components/SplitButton/SplitButton.tsx
|
|
12743
|
-
var
|
|
12744
|
-
var Container14 =
|
|
12761
|
+
var import_jsx_runtime253 = require("react/jsx-runtime");
|
|
12762
|
+
var Container14 = import_styled_components80.default.div`
|
|
12745
12763
|
display: flex;
|
|
12746
12764
|
`;
|
|
12747
|
-
var MainButton = (0,
|
|
12765
|
+
var MainButton = (0, import_styled_components80.default)(Button)`
|
|
12748
12766
|
border-top-right-radius: 0;
|
|
12749
12767
|
border-bottom-right-radius: 0;
|
|
12750
12768
|
border-right: none;
|
|
@@ -12753,7 +12771,7 @@ var MainButton = (0, import_styled_components79.default)(Button)`
|
|
|
12753
12771
|
z-index: 0;
|
|
12754
12772
|
}
|
|
12755
12773
|
`;
|
|
12756
|
-
var OptionButton = (0,
|
|
12774
|
+
var OptionButton = (0, import_styled_components80.default)(Button)`
|
|
12757
12775
|
border-top-left-radius: 0;
|
|
12758
12776
|
border-bottom-left-radius: 0;
|
|
12759
12777
|
|
|
@@ -12771,7 +12789,7 @@ var OptionButton = (0, import_styled_components79.default)(Button)`
|
|
|
12771
12789
|
${(props) => props.purpose === "primary" && `border-left: ${tokens3.mainButton.primary.borderLeft}`};
|
|
12772
12790
|
}
|
|
12773
12791
|
`;
|
|
12774
|
-
var SplitButton = (0,
|
|
12792
|
+
var SplitButton = (0, import_react97.forwardRef)(
|
|
12775
12793
|
(props, ref) => {
|
|
12776
12794
|
const {
|
|
12777
12795
|
size: size2,
|
|
@@ -12779,14 +12797,14 @@ var SplitButton = (0, import_react96.forwardRef)(
|
|
|
12779
12797
|
secondaryActions,
|
|
12780
12798
|
purpose = "primary"
|
|
12781
12799
|
} = props;
|
|
12782
|
-
const [isOpen, setIsOpen] = (0,
|
|
12800
|
+
const [isOpen, setIsOpen] = (0, import_react97.useState)(false);
|
|
12783
12801
|
const buttonStyleProps = {
|
|
12784
12802
|
appearance: "filled",
|
|
12785
12803
|
purpose,
|
|
12786
12804
|
size: size2
|
|
12787
12805
|
};
|
|
12788
|
-
return /* @__PURE__ */ (0,
|
|
12789
|
-
/* @__PURE__ */ (0,
|
|
12806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(Container14, { ref, children: [
|
|
12807
|
+
/* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
|
|
12790
12808
|
MainButton,
|
|
12791
12809
|
{
|
|
12792
12810
|
...buttonStyleProps,
|
|
@@ -12794,8 +12812,8 @@ var SplitButton = (0, import_react96.forwardRef)(
|
|
|
12794
12812
|
iconPosition: "left"
|
|
12795
12813
|
}
|
|
12796
12814
|
),
|
|
12797
|
-
/* @__PURE__ */ (0,
|
|
12798
|
-
/* @__PURE__ */ (0,
|
|
12815
|
+
/* @__PURE__ */ (0, import_jsx_runtime253.jsxs)(OverflowMenuGroup, { onToggle: () => setIsOpen(!isOpen), children: [
|
|
12816
|
+
/* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
|
|
12799
12817
|
OptionButton,
|
|
12800
12818
|
{
|
|
12801
12819
|
...buttonStyleProps,
|
|
@@ -12804,7 +12822,7 @@ var SplitButton = (0, import_react96.forwardRef)(
|
|
|
12804
12822
|
purpose
|
|
12805
12823
|
}
|
|
12806
12824
|
),
|
|
12807
|
-
/* @__PURE__ */ (0,
|
|
12825
|
+
/* @__PURE__ */ (0, import_jsx_runtime253.jsx)(OverflowMenu, { items: secondaryActions, placement: "bottom-end" })
|
|
12808
12826
|
] })
|
|
12809
12827
|
] });
|
|
12810
12828
|
}
|
|
@@ -12812,50 +12830,50 @@ var SplitButton = (0, import_react96.forwardRef)(
|
|
|
12812
12830
|
SplitButton.displayName = "SplitButton";
|
|
12813
12831
|
|
|
12814
12832
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
12815
|
-
var
|
|
12816
|
-
var
|
|
12833
|
+
var import_react107 = require("react");
|
|
12834
|
+
var import_styled_components89 = __toESM(require("styled-components"));
|
|
12817
12835
|
|
|
12818
12836
|
// src/components/Table/collapsible/Table.context.tsx
|
|
12819
|
-
var
|
|
12820
|
-
var CollapsibleTableContext = (0,
|
|
12837
|
+
var import_react98 = require("react");
|
|
12838
|
+
var CollapsibleTableContext = (0, import_react98.createContext)({
|
|
12821
12839
|
headerValues: [],
|
|
12822
12840
|
definingColumnIndex: [0]
|
|
12823
12841
|
});
|
|
12824
|
-
var useCollapsibleTableContext = () => (0,
|
|
12842
|
+
var useCollapsibleTableContext = () => (0, import_react98.useContext)(CollapsibleTableContext);
|
|
12825
12843
|
|
|
12826
12844
|
// src/components/Table/normal/Body.tsx
|
|
12827
|
-
var
|
|
12828
|
-
var
|
|
12829
|
-
var
|
|
12830
|
-
var StyledBody =
|
|
12831
|
-
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)(
|
|
12832
12850
|
({ children, ...rest }, ref) => {
|
|
12833
12851
|
const bodyProps = {
|
|
12834
12852
|
...rest
|
|
12835
12853
|
};
|
|
12836
|
-
return /* @__PURE__ */ (0,
|
|
12854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(StyledBody, { ref, ...bodyProps, children });
|
|
12837
12855
|
}
|
|
12838
12856
|
);
|
|
12839
12857
|
Body2.displayName = "Table.Body";
|
|
12840
12858
|
|
|
12841
12859
|
// src/components/Table/normal/Cell.tsx
|
|
12842
|
-
var
|
|
12843
|
-
var
|
|
12860
|
+
var import_react101 = require("react");
|
|
12861
|
+
var import_styled_components83 = __toESM(require("styled-components"));
|
|
12844
12862
|
|
|
12845
12863
|
// src/components/Table/normal/Head.tsx
|
|
12846
|
-
var
|
|
12847
|
-
var
|
|
12848
|
-
var
|
|
12849
|
-
var StyledHead =
|
|
12850
|
-
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)(
|
|
12851
12869
|
({ children, ...rest }, ref) => {
|
|
12852
|
-
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 }) });
|
|
12853
12871
|
}
|
|
12854
12872
|
);
|
|
12855
12873
|
Head.displayName = "Table.Head";
|
|
12856
|
-
var HeadContext = (0,
|
|
12874
|
+
var HeadContext = (0, import_react100.createContext)(false);
|
|
12857
12875
|
function useIsInTableHead() {
|
|
12858
|
-
const isInTableHead = (0,
|
|
12876
|
+
const isInTableHead = (0, import_react100.useContext)(HeadContext);
|
|
12859
12877
|
return isInTableHead;
|
|
12860
12878
|
}
|
|
12861
12879
|
|
|
@@ -12932,20 +12950,20 @@ var tableTokens = {
|
|
|
12932
12950
|
};
|
|
12933
12951
|
|
|
12934
12952
|
// src/components/Table/normal/Cell.tsx
|
|
12935
|
-
var
|
|
12953
|
+
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
12936
12954
|
var { cell: cell3 } = tableTokens;
|
|
12937
12955
|
var getLayoutStyle = (layout) => {
|
|
12938
12956
|
switch (layout) {
|
|
12939
12957
|
case "center":
|
|
12940
|
-
return
|
|
12958
|
+
return import_styled_components83.css`
|
|
12941
12959
|
justify-content: center;
|
|
12942
12960
|
`;
|
|
12943
12961
|
case "right":
|
|
12944
|
-
return
|
|
12962
|
+
return import_styled_components83.css`
|
|
12945
12963
|
justify-content: flex-end;
|
|
12946
12964
|
`;
|
|
12947
12965
|
case "text and icon":
|
|
12948
|
-
return
|
|
12966
|
+
return import_styled_components83.css`
|
|
12949
12967
|
gap: ${cell3.layout.textAndIcon.gap};
|
|
12950
12968
|
`;
|
|
12951
12969
|
default:
|
|
@@ -12953,12 +12971,12 @@ var getLayoutStyle = (layout) => {
|
|
|
12953
12971
|
return;
|
|
12954
12972
|
}
|
|
12955
12973
|
};
|
|
12956
|
-
var StyledCell =
|
|
12957
|
-
${({ $type: type }) => type === "head" &&
|
|
12974
|
+
var StyledCell = import_styled_components83.default.td`
|
|
12975
|
+
${({ $type: type }) => type === "head" && import_styled_components83.css`
|
|
12958
12976
|
background-color: ${cell3.head.backgroundColor};
|
|
12959
12977
|
`}
|
|
12960
12978
|
`;
|
|
12961
|
-
var InnerCell =
|
|
12979
|
+
var InnerCell = import_styled_components83.default.div`
|
|
12962
12980
|
display: flex;
|
|
12963
12981
|
align-items: center;
|
|
12964
12982
|
${({ $layout: layout }) => getLayoutStyle(layout)}
|
|
@@ -12972,49 +12990,49 @@ var getTableCellType = (type) => {
|
|
|
12972
12990
|
return "td";
|
|
12973
12991
|
}
|
|
12974
12992
|
};
|
|
12975
|
-
var Cell2 = (0,
|
|
12993
|
+
var Cell2 = (0, import_react101.forwardRef)(
|
|
12976
12994
|
({ children, type: _type, layout = "left", collapsibleProps, ...rest }, ref) => {
|
|
12977
12995
|
const isInHead = useIsInTableHead();
|
|
12978
12996
|
const type = _type != null ? _type : isInHead ? "head" : "data";
|
|
12979
12997
|
const as = getTableCellType(type);
|
|
12980
12998
|
const { isCollapsibleChild } = collapsibleProps != null ? collapsibleProps : {};
|
|
12981
|
-
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 }) });
|
|
12982
13000
|
}
|
|
12983
13001
|
);
|
|
12984
13002
|
Cell2.displayName = "Table.Cell";
|
|
12985
13003
|
|
|
12986
13004
|
// src/components/Table/normal/Foot.tsx
|
|
12987
|
-
var
|
|
12988
|
-
var
|
|
12989
|
-
var
|
|
12990
|
-
var StyledFoot =
|
|
12991
|
-
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)(
|
|
12992
13010
|
({ children, ...rest }, ref) => {
|
|
12993
|
-
return /* @__PURE__ */ (0,
|
|
13011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledFoot, { ref, ...rest, children });
|
|
12994
13012
|
}
|
|
12995
13013
|
);
|
|
12996
13014
|
Foot.displayName = "Table.Foot";
|
|
12997
13015
|
|
|
12998
13016
|
// src/components/Table/normal/Row.tsx
|
|
12999
|
-
var
|
|
13017
|
+
var import_react103 = require("react");
|
|
13000
13018
|
|
|
13001
13019
|
// src/components/Table/normal/Table.styles.tsx
|
|
13002
|
-
var
|
|
13020
|
+
var import_styled_components85 = __toESM(require("styled-components"));
|
|
13003
13021
|
var { row: row2 } = tableTokens;
|
|
13004
13022
|
var bodyRowStyles = (mode, selected) => {
|
|
13005
|
-
return
|
|
13006
|
-
${mode === "sum" &&
|
|
13023
|
+
return import_styled_components85.css`
|
|
13024
|
+
${mode === "sum" && import_styled_components85.css`
|
|
13007
13025
|
font-weight: 600;
|
|
13008
13026
|
border-top: ${row2.body.mode.sum.borderTop};
|
|
13009
13027
|
border-bottom: ${row2.body.mode.sum.borderBottom};
|
|
13010
13028
|
background-color: ${row2.body.mode.sum.backgroundColor};
|
|
13011
13029
|
`}
|
|
13012
|
-
${selected &&
|
|
13030
|
+
${selected && import_styled_components85.css`
|
|
13013
13031
|
background-color: ${row2.body.selected.backgroundColor};
|
|
13014
13032
|
`}
|
|
13015
13033
|
`;
|
|
13016
13034
|
};
|
|
13017
|
-
var StyledRow =
|
|
13035
|
+
var StyledRow = import_styled_components85.default.tr`
|
|
13018
13036
|
@media (prefers-reduced-motion: no-preference) {
|
|
13019
13037
|
transition:
|
|
13020
13038
|
background-color 0.2s,
|
|
@@ -13024,11 +13042,11 @@ var StyledRow = import_styled_components84.default.tr`
|
|
|
13024
13042
|
|
|
13025
13043
|
${getFontStyling(defaultTypographyType, true)}
|
|
13026
13044
|
|
|
13027
|
-
${({ type }) => type === "head" &&
|
|
13045
|
+
${({ type }) => type === "head" && import_styled_components85.css`
|
|
13028
13046
|
font-weight: 600;
|
|
13029
13047
|
text-align: left;
|
|
13030
13048
|
`}
|
|
13031
|
-
${({ type, $mode: mode, $selected: selected, $hoverable: hoverable }) => type === "body" &&
|
|
13049
|
+
${({ type, $mode: mode, $selected: selected, $hoverable: hoverable }) => type === "body" && import_styled_components85.css`
|
|
13032
13050
|
&:nth-of-type(even) {
|
|
13033
13051
|
background-color: ${row2.body.even.backgroundColor};
|
|
13034
13052
|
${bodyRowStyles(mode, selected)}
|
|
@@ -13039,7 +13057,7 @@ var StyledRow = import_styled_components84.default.tr`
|
|
|
13039
13057
|
${bodyRowStyles(mode, selected)}
|
|
13040
13058
|
}
|
|
13041
13059
|
|
|
13042
|
-
${hoverable &&
|
|
13060
|
+
${hoverable && import_styled_components85.css`
|
|
13043
13061
|
&:hover {
|
|
13044
13062
|
background-color: ${row2.body.hover.backgroundColor};
|
|
13045
13063
|
}
|
|
@@ -13051,12 +13069,12 @@ var StyledRow = import_styled_components84.default.tr`
|
|
|
13051
13069
|
`;
|
|
13052
13070
|
|
|
13053
13071
|
// src/components/Table/normal/Row.tsx
|
|
13054
|
-
var
|
|
13055
|
-
var Row = (0,
|
|
13072
|
+
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
13073
|
+
var Row = (0, import_react103.forwardRef)(
|
|
13056
13074
|
({ type: _type, mode = "normal", hoverable, selected, children, ...rest }, ref) => {
|
|
13057
13075
|
const isInHeader = useIsInTableHead();
|
|
13058
13076
|
const type = _type != null ? _type : isInHeader ? "head" : "body";
|
|
13059
|
-
return /* @__PURE__ */ (0,
|
|
13077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(
|
|
13060
13078
|
StyledRow,
|
|
13061
13079
|
{
|
|
13062
13080
|
type,
|
|
@@ -13073,11 +13091,11 @@ var Row = (0, import_react102.forwardRef)(
|
|
|
13073
13091
|
Row.displayName = "Table.Row";
|
|
13074
13092
|
|
|
13075
13093
|
// src/components/Table/normal/SortCell.tsx
|
|
13076
|
-
var
|
|
13077
|
-
var
|
|
13078
|
-
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");
|
|
13079
13097
|
var { cell: cell4 } = tableTokens;
|
|
13080
|
-
var StyledButton6 =
|
|
13098
|
+
var StyledButton6 = import_styled_components86.default.button`
|
|
13081
13099
|
${normalizeButton}
|
|
13082
13100
|
user-select: text;
|
|
13083
13101
|
${removeButtonStyling}
|
|
@@ -13090,19 +13108,19 @@ var StyledButton6 = import_styled_components85.default.button`
|
|
|
13090
13108
|
`;
|
|
13091
13109
|
var makeSortIcon = (isSorted, sortOrder) => {
|
|
13092
13110
|
if (!isSorted || !sortOrder) {
|
|
13093
|
-
return /* @__PURE__ */ (0,
|
|
13111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(Icon, { icon: UnfoldMoreIcon, iconSize: "inherit" });
|
|
13094
13112
|
}
|
|
13095
|
-
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" });
|
|
13096
13114
|
};
|
|
13097
|
-
var SortCell = (0,
|
|
13098
|
-
({ 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)(
|
|
13099
13117
|
Cell2,
|
|
13100
13118
|
{
|
|
13101
13119
|
ref,
|
|
13102
13120
|
type: "head",
|
|
13103
13121
|
"aria-sort": isSorted && sortOrder ? sortOrder : void 0,
|
|
13104
13122
|
...rest,
|
|
13105
|
-
children: /* @__PURE__ */ (0,
|
|
13123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(
|
|
13106
13124
|
StyledButton6,
|
|
13107
13125
|
{
|
|
13108
13126
|
onClick,
|
|
@@ -13120,11 +13138,11 @@ var SortCell = (0, import_react103.forwardRef)(
|
|
|
13120
13138
|
SortCell.displayName = "Table.SortCell";
|
|
13121
13139
|
|
|
13122
13140
|
// src/components/Table/normal/Table.tsx
|
|
13123
|
-
var
|
|
13124
|
-
var
|
|
13125
|
-
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");
|
|
13126
13144
|
var { cell: cell5, row: row3 } = tableTokens;
|
|
13127
|
-
var StyledTable =
|
|
13145
|
+
var StyledTable = import_styled_components87.default.table`
|
|
13128
13146
|
border-spacing: 0;
|
|
13129
13147
|
border-collapse: collapse;
|
|
13130
13148
|
*::selection {
|
|
@@ -13132,13 +13150,13 @@ var StyledTable = import_styled_components86.default.table`
|
|
|
13132
13150
|
}
|
|
13133
13151
|
${scrollbarStyling.webkit}
|
|
13134
13152
|
${scrollbarStyling.firefox}
|
|
13135
|
-
${({ $density }) =>
|
|
13153
|
+
${({ $density }) => import_styled_components87.css`
|
|
13136
13154
|
td,
|
|
13137
13155
|
th {
|
|
13138
13156
|
padding: ${cell5.density[$density].padding};
|
|
13139
13157
|
}
|
|
13140
13158
|
`}
|
|
13141
|
-
${({ $density }) => $density === "extraCompact" &&
|
|
13159
|
+
${({ $density }) => $density === "extraCompact" && import_styled_components87.css`
|
|
13142
13160
|
th {
|
|
13143
13161
|
background-color: ${row3.head.extraCompact.backgroundColor};
|
|
13144
13162
|
font-size: ${row3.head.extraCompact.fontSize};
|
|
@@ -13152,7 +13170,7 @@ var StyledTable = import_styled_components86.default.table`
|
|
|
13152
13170
|
}
|
|
13153
13171
|
}
|
|
13154
13172
|
`}
|
|
13155
|
-
${({ $stickyHeader }) => $stickyHeader &&
|
|
13173
|
+
${({ $stickyHeader }) => $stickyHeader && import_styled_components87.css`
|
|
13156
13174
|
tr[type='head'] {
|
|
13157
13175
|
th[type='head'] {
|
|
13158
13176
|
position: sticky;
|
|
@@ -13161,15 +13179,15 @@ var StyledTable = import_styled_components86.default.table`
|
|
|
13161
13179
|
}
|
|
13162
13180
|
}
|
|
13163
13181
|
`}
|
|
13164
|
-
${({ $withDividers }) => $withDividers &&
|
|
13182
|
+
${({ $withDividers }) => $withDividers && import_styled_components87.css`
|
|
13165
13183
|
tr[type='body'] {
|
|
13166
13184
|
border-bottom: ${row3.body.withDividers.borderBottom};
|
|
13167
13185
|
}
|
|
13168
13186
|
`}
|
|
13169
13187
|
`;
|
|
13170
|
-
var Table = (0,
|
|
13188
|
+
var Table = (0, import_react105.forwardRef)(
|
|
13171
13189
|
({ density = "normal", stickyHeader, withDividers, children, ...rest }, ref) => {
|
|
13172
|
-
return /* @__PURE__ */ (0,
|
|
13190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(
|
|
13173
13191
|
StyledTable,
|
|
13174
13192
|
{
|
|
13175
13193
|
...rest,
|
|
@@ -13185,38 +13203,38 @@ var Table = (0, import_react104.forwardRef)(
|
|
|
13185
13203
|
Table.displayName = "Table";
|
|
13186
13204
|
|
|
13187
13205
|
// src/components/Table/normal/TableWrapper.tsx
|
|
13188
|
-
var
|
|
13189
|
-
var
|
|
13190
|
-
var
|
|
13191
|
-
var Wrapper6 =
|
|
13192
|
-
${({ $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`
|
|
13193
13211
|
overflow-x: auto;
|
|
13194
13212
|
`}
|
|
13195
13213
|
${scrollbarStyling.webkit}
|
|
13196
13214
|
${scrollbarStyling.firefox}
|
|
13197
13215
|
`;
|
|
13198
13216
|
var TableWrapper = ({ children, ...rest }) => {
|
|
13199
|
-
const [overflowX, setOverflowX] = (0,
|
|
13200
|
-
const [windowWidth, setWindowWidth] = (0,
|
|
13217
|
+
const [overflowX, setOverflowX] = (0, import_react106.useState)(false);
|
|
13218
|
+
const [windowWidth, setWindowWidth] = (0, import_react106.useState)(window.innerWidth);
|
|
13201
13219
|
function isOverflowingX(event) {
|
|
13202
13220
|
return event.offsetWidth < event.scrollWidth;
|
|
13203
13221
|
}
|
|
13204
|
-
const wrapperRef = (0,
|
|
13205
|
-
(0,
|
|
13222
|
+
const wrapperRef = (0, import_react106.useRef)(null);
|
|
13223
|
+
(0, import_react106.useEffect)(() => {
|
|
13206
13224
|
if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
|
|
13207
13225
|
setOverflowX(true);
|
|
13208
13226
|
return;
|
|
13209
13227
|
}
|
|
13210
13228
|
setOverflowX(false);
|
|
13211
13229
|
}, [windowWidth]);
|
|
13212
|
-
(0,
|
|
13230
|
+
(0, import_react106.useEffect)(() => {
|
|
13213
13231
|
function handleResize() {
|
|
13214
13232
|
setWindowWidth(window.innerWidth);
|
|
13215
13233
|
}
|
|
13216
13234
|
window.addEventListener("resize", handleResize);
|
|
13217
13235
|
return () => window.removeEventListener("resize", handleResize);
|
|
13218
13236
|
});
|
|
13219
|
-
return /* @__PURE__ */ (0,
|
|
13237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(Wrapper6, { $overflowX: overflowX, ref: wrapperRef, ...rest, children });
|
|
13220
13238
|
};
|
|
13221
13239
|
TableWrapper.displayName = "Table.Wrapper";
|
|
13222
13240
|
|
|
@@ -13231,9 +13249,9 @@ Table2.Row = Row;
|
|
|
13231
13249
|
Table2.Foot = Foot;
|
|
13232
13250
|
|
|
13233
13251
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
13234
|
-
var
|
|
13252
|
+
var import_jsx_runtime262 = require("react/jsx-runtime");
|
|
13235
13253
|
var { collapseButton: collapseButton2 } = tableTokens;
|
|
13236
|
-
var CollapseButton =
|
|
13254
|
+
var CollapseButton = import_styled_components89.default.button`
|
|
13237
13255
|
${removeButtonStyling}
|
|
13238
13256
|
margin-left: auto;
|
|
13239
13257
|
margin-right: auto;
|
|
@@ -13248,12 +13266,12 @@ var CollapseButton = import_styled_components88.default.button`
|
|
|
13248
13266
|
${focusVisible}
|
|
13249
13267
|
}
|
|
13250
13268
|
`;
|
|
13251
|
-
var DescriptionListCell = (0,
|
|
13269
|
+
var DescriptionListCell = (0, import_styled_components89.default)(Cell2)`
|
|
13252
13270
|
& > div {
|
|
13253
13271
|
display: block;
|
|
13254
13272
|
}
|
|
13255
13273
|
`;
|
|
13256
|
-
var CollapsibleRow = (0,
|
|
13274
|
+
var CollapsibleRow = (0, import_react107.forwardRef)(
|
|
13257
13275
|
({ type: _type, mode = "normal", selected, hoverable, children, ...rest }, ref) => {
|
|
13258
13276
|
const isInHead = useIsInTableHead();
|
|
13259
13277
|
const type = _type != null ? _type : isInHead ? "head" : "body";
|
|
@@ -13265,14 +13283,14 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13265
13283
|
...rest
|
|
13266
13284
|
};
|
|
13267
13285
|
const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
|
|
13268
|
-
const [childrenCollapsed, setChildrenCollapsed] = (0,
|
|
13269
|
-
(0,
|
|
13286
|
+
const [childrenCollapsed, setChildrenCollapsed] = (0, import_react107.useState)(true);
|
|
13287
|
+
(0, import_react107.useEffect)(() => {
|
|
13270
13288
|
!isCollapsed && setChildrenCollapsed(true);
|
|
13271
13289
|
}, [isCollapsed]);
|
|
13272
13290
|
const collapsedHeaderValues = headerValues.filter(
|
|
13273
13291
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
13274
13292
|
);
|
|
13275
|
-
const childrenArray =
|
|
13293
|
+
const childrenArray = import_react107.Children.toArray(children);
|
|
13276
13294
|
const collapsedChildren = childrenArray.filter(
|
|
13277
13295
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
13278
13296
|
);
|
|
@@ -13281,25 +13299,25 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13281
13299
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
13282
13300
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
13283
13301
|
collapsibleIds.push(id);
|
|
13284
|
-
return /* @__PURE__ */ (0,
|
|
13285
|
-
/* @__PURE__ */ (0,
|
|
13286
|
-
(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, {
|
|
13287
13305
|
collapsibleProps: { isCollapsibleChild: true }
|
|
13288
13306
|
})
|
|
13289
13307
|
] }, `DL-${index}`);
|
|
13290
13308
|
}) : null;
|
|
13291
|
-
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;
|
|
13292
13310
|
const definingColumnCells = childrenArray.slice().filter((column, index) => definingColumnIndex.indexOf(index) > -1).sort((a2, b) => {
|
|
13293
13311
|
return definingColumnIndex.indexOf(childrenArray.indexOf(a2)) - definingColumnIndex.indexOf(childrenArray.indexOf(b));
|
|
13294
13312
|
});
|
|
13295
13313
|
const headerRow = () => {
|
|
13296
13314
|
if (type !== "head" || !isCollapsed)
|
|
13297
13315
|
return null;
|
|
13298
|
-
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: [
|
|
13299
13317
|
definingColumnCells,
|
|
13300
|
-
/* @__PURE__ */ (0,
|
|
13318
|
+
/* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(Table2.Cell, { type: "head", layout: "center", children: [
|
|
13301
13319
|
"Utvid",
|
|
13302
|
-
/* @__PURE__ */ (0,
|
|
13320
|
+
/* @__PURE__ */ (0, import_jsx_runtime262.jsx)(VisuallyHidden, { as: "span", children: "raden" })
|
|
13303
13321
|
] })
|
|
13304
13322
|
] }) });
|
|
13305
13323
|
};
|
|
@@ -13307,7 +13325,7 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13307
13325
|
const rowWithChevron = () => {
|
|
13308
13326
|
if (type !== "body" || !isCollapsed)
|
|
13309
13327
|
return null;
|
|
13310
|
-
return /* @__PURE__ */ (0,
|
|
13328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(
|
|
13311
13329
|
StyledRow,
|
|
13312
13330
|
{
|
|
13313
13331
|
ref,
|
|
@@ -13316,13 +13334,13 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13316
13334
|
"data-isopencollapsibleheader": !childrenCollapsed && true,
|
|
13317
13335
|
children: [
|
|
13318
13336
|
definingColumnCells,
|
|
13319
|
-
/* @__PURE__ */ (0,
|
|
13337
|
+
/* @__PURE__ */ (0, import_jsx_runtime262.jsx)(Table2.Cell, { children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(
|
|
13320
13338
|
CollapseButton,
|
|
13321
13339
|
{
|
|
13322
13340
|
onClick: () => setChildrenCollapsed(!childrenCollapsed),
|
|
13323
13341
|
"aria-expanded": !childrenCollapsed,
|
|
13324
13342
|
"aria-controls": idList,
|
|
13325
|
-
children: /* @__PURE__ */ (0,
|
|
13343
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(
|
|
13326
13344
|
AnimatedChevronUpDown,
|
|
13327
13345
|
{
|
|
13328
13346
|
isUp: childrenCollapsed ? false : true,
|
|
@@ -13336,30 +13354,30 @@ var CollapsibleRow = (0, import_react106.forwardRef)(
|
|
|
13336
13354
|
}
|
|
13337
13355
|
);
|
|
13338
13356
|
};
|
|
13339
|
-
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: [
|
|
13340
13358
|
headerRow(),
|
|
13341
|
-
type === "body" && /* @__PURE__ */ (0,
|
|
13359
|
+
type === "body" && /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)(import_jsx_runtime262.Fragment, { children: [
|
|
13342
13360
|
rowWithChevron(),
|
|
13343
13361
|
childrenCollapsed ? null : collapsedRows
|
|
13344
13362
|
] })
|
|
13345
|
-
] }) : /* @__PURE__ */ (0,
|
|
13363
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(StyledRow, { ref, type, ...rowProps, children });
|
|
13346
13364
|
}
|
|
13347
13365
|
);
|
|
13348
13366
|
CollapsibleRow.displayName = "CollapsibleTable.Row";
|
|
13349
13367
|
|
|
13350
13368
|
// src/components/Table/collapsible/CollapsibleTable.tsx
|
|
13351
|
-
var
|
|
13352
|
-
var
|
|
13353
|
-
var
|
|
13354
|
-
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)`
|
|
13355
13373
|
width: 100%;
|
|
13356
|
-
${({ withDividers }) => withDividers &&
|
|
13374
|
+
${({ withDividers }) => withDividers && import_styled_components90.css`
|
|
13357
13375
|
tr[data-isopencollapsibleheader='true'] {
|
|
13358
13376
|
border-bottom: none;
|
|
13359
13377
|
}
|
|
13360
13378
|
`}
|
|
13361
13379
|
`;
|
|
13362
|
-
var CollapsibleTable = (0,
|
|
13380
|
+
var CollapsibleTable = (0, import_react108.forwardRef)((props, ref) => {
|
|
13363
13381
|
const {
|
|
13364
13382
|
density = "normal",
|
|
13365
13383
|
children,
|
|
@@ -13368,7 +13386,7 @@ var CollapsibleTable = (0, import_react107.forwardRef)((props, ref) => {
|
|
|
13368
13386
|
definingColumnIndex = [0],
|
|
13369
13387
|
...rest
|
|
13370
13388
|
} = props;
|
|
13371
|
-
return /* @__PURE__ */ (0,
|
|
13389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(
|
|
13372
13390
|
CollapsibleTableContext.Provider,
|
|
13373
13391
|
{
|
|
13374
13392
|
value: {
|
|
@@ -13376,7 +13394,7 @@ var CollapsibleTable = (0, import_react107.forwardRef)((props, ref) => {
|
|
|
13376
13394
|
headerValues,
|
|
13377
13395
|
definingColumnIndex
|
|
13378
13396
|
},
|
|
13379
|
-
children: /* @__PURE__ */ (0,
|
|
13397
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(StyledTable2, { ref, density, ...rest, children })
|
|
13380
13398
|
}
|
|
13381
13399
|
);
|
|
13382
13400
|
});
|
|
@@ -13387,12 +13405,12 @@ var CollapsibleTable2 = CollapsibleTable;
|
|
|
13387
13405
|
CollapsibleTable2.Row = CollapsibleRow;
|
|
13388
13406
|
|
|
13389
13407
|
// src/components/Tabs/Tabs.tsx
|
|
13390
|
-
var
|
|
13391
|
-
var
|
|
13408
|
+
var import_react110 = require("react");
|
|
13409
|
+
var import_styled_components91 = __toESM(require("styled-components"));
|
|
13392
13410
|
|
|
13393
13411
|
// src/components/Tabs/Tabs.context.tsx
|
|
13394
|
-
var
|
|
13395
|
-
var TabsContext = (0,
|
|
13412
|
+
var import_react109 = require("react");
|
|
13413
|
+
var TabsContext = (0, import_react109.createContext)({
|
|
13396
13414
|
activeTab: 0,
|
|
13397
13415
|
tabsId: "",
|
|
13398
13416
|
handleTabChange: () => null,
|
|
@@ -13402,16 +13420,16 @@ var TabsContext = (0, import_react108.createContext)({
|
|
|
13402
13420
|
setHasTabFocus: () => null,
|
|
13403
13421
|
tabContentDirection: "row"
|
|
13404
13422
|
});
|
|
13405
|
-
var useTabsContext = () => (0,
|
|
13423
|
+
var useTabsContext = () => (0, import_react109.useContext)(TabsContext);
|
|
13406
13424
|
|
|
13407
13425
|
// src/components/Tabs/Tabs.tsx
|
|
13408
|
-
var
|
|
13409
|
-
var Container15 =
|
|
13410
|
-
${({ $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`
|
|
13411
13429
|
width: ${$width};
|
|
13412
13430
|
`};
|
|
13413
13431
|
`;
|
|
13414
|
-
var Tabs = (0,
|
|
13432
|
+
var Tabs = (0, import_react110.forwardRef)((props, ref) => {
|
|
13415
13433
|
const {
|
|
13416
13434
|
id,
|
|
13417
13435
|
activeTab,
|
|
@@ -13423,17 +13441,17 @@ var Tabs = (0, import_react109.forwardRef)((props, ref) => {
|
|
|
13423
13441
|
htmlProps,
|
|
13424
13442
|
...rest
|
|
13425
13443
|
} = props;
|
|
13426
|
-
const generatedId = (0,
|
|
13444
|
+
const generatedId = (0, import_react110.useId)();
|
|
13427
13445
|
const uniqueId = id != null ? id : `${generatedId}-tabs`;
|
|
13428
|
-
const [thisActiveTab, setActiveTab] = (0,
|
|
13429
|
-
const [hasTabFocus, setHasTabFocus] = (0,
|
|
13430
|
-
const tabListRef = (0,
|
|
13431
|
-
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);
|
|
13432
13450
|
const handleTabChange = (index) => {
|
|
13433
13451
|
setActiveTab(index);
|
|
13434
13452
|
onChange && onChange(index);
|
|
13435
13453
|
};
|
|
13436
|
-
(0,
|
|
13454
|
+
(0, import_react110.useEffect)(() => {
|
|
13437
13455
|
if (activeTab !== void 0 && activeTab !== thisActiveTab) {
|
|
13438
13456
|
setActiveTab(activeTab);
|
|
13439
13457
|
}
|
|
@@ -13442,7 +13460,7 @@ var Tabs = (0, import_react109.forwardRef)((props, ref) => {
|
|
|
13442
13460
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
13443
13461
|
ref
|
|
13444
13462
|
};
|
|
13445
|
-
return /* @__PURE__ */ (0,
|
|
13463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(
|
|
13446
13464
|
TabsContext.Provider,
|
|
13447
13465
|
{
|
|
13448
13466
|
value: {
|
|
@@ -13455,15 +13473,15 @@ var Tabs = (0, import_react109.forwardRef)((props, ref) => {
|
|
|
13455
13473
|
setHasTabFocus,
|
|
13456
13474
|
tabContentDirection
|
|
13457
13475
|
},
|
|
13458
|
-
children: /* @__PURE__ */ (0,
|
|
13476
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(Container15, { ...containerProps, $width: width, children })
|
|
13459
13477
|
}
|
|
13460
13478
|
);
|
|
13461
13479
|
});
|
|
13462
13480
|
Tabs.displayName = "Tabs";
|
|
13463
13481
|
|
|
13464
13482
|
// src/components/Tabs/Tab.tsx
|
|
13465
|
-
var
|
|
13466
|
-
var
|
|
13483
|
+
var import_react112 = require("react");
|
|
13484
|
+
var import_styled_components92 = __toESM(require("styled-components"));
|
|
13467
13485
|
|
|
13468
13486
|
// src/components/Tabs/Tabs.tokens.tsx
|
|
13469
13487
|
var import_dds_design_tokens59 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -13505,14 +13523,14 @@ var tabsTokens = {
|
|
|
13505
13523
|
};
|
|
13506
13524
|
|
|
13507
13525
|
// src/components/Tabs/TabWidthContext.tsx
|
|
13508
|
-
var
|
|
13509
|
-
var
|
|
13510
|
-
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);
|
|
13511
13529
|
function TabWidthContextProvider({
|
|
13512
13530
|
children,
|
|
13513
13531
|
onChangeWidths
|
|
13514
13532
|
}) {
|
|
13515
|
-
return /* @__PURE__ */ (0,
|
|
13533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(
|
|
13516
13534
|
TabContext.Provider,
|
|
13517
13535
|
{
|
|
13518
13536
|
value: {
|
|
@@ -13536,17 +13554,17 @@ function TabWidthContextProvider({
|
|
|
13536
13554
|
);
|
|
13537
13555
|
}
|
|
13538
13556
|
function useSetTabWidth(index, width) {
|
|
13539
|
-
const context = (0,
|
|
13540
|
-
(0,
|
|
13557
|
+
const context = (0, import_react111.useContext)(TabContext);
|
|
13558
|
+
(0, import_react111.useLayoutEffect)(() => {
|
|
13541
13559
|
context == null ? void 0 : context.updateWidth(index, width);
|
|
13542
13560
|
return () => context == null ? void 0 : context.removeTab(index);
|
|
13543
13561
|
}, [index, width]);
|
|
13544
13562
|
}
|
|
13545
13563
|
|
|
13546
13564
|
// src/components/Tabs/Tab.tsx
|
|
13547
|
-
var
|
|
13565
|
+
var import_jsx_runtime266 = require("react/jsx-runtime");
|
|
13548
13566
|
var { tab: tab2 } = tabsTokens;
|
|
13549
|
-
var Button2 =
|
|
13567
|
+
var Button2 = import_styled_components92.default.button`
|
|
13550
13568
|
${normalizeButton}
|
|
13551
13569
|
${removeButtonStyling}
|
|
13552
13570
|
user-select: text;
|
|
@@ -13566,12 +13584,12 @@ var Button2 = import_styled_components91.default.button`
|
|
|
13566
13584
|
${focusVisibleTransitionValue};
|
|
13567
13585
|
}
|
|
13568
13586
|
|
|
13569
|
-
${({ $direction }) =>
|
|
13587
|
+
${({ $direction }) => import_styled_components92.css`
|
|
13570
13588
|
flex-direction: ${$direction};
|
|
13571
13589
|
gap: ${tab2[$direction].gap};
|
|
13572
13590
|
`};
|
|
13573
13591
|
|
|
13574
|
-
${({ $active }) => $active &&
|
|
13592
|
+
${({ $active }) => $active && import_styled_components92.css`
|
|
13575
13593
|
background-color: ${tab2.active.backgroundColor};
|
|
13576
13594
|
border-color: ${tab2.active.borderColor};
|
|
13577
13595
|
color: ${tab2.active.color};
|
|
@@ -13589,7 +13607,7 @@ var Button2 = import_styled_components91.default.button`
|
|
|
13589
13607
|
box-shadow: ${tab2.hover.boxShadow};
|
|
13590
13608
|
}
|
|
13591
13609
|
`;
|
|
13592
|
-
var Tab = (0,
|
|
13610
|
+
var Tab = (0, import_react112.forwardRef)((props, ref) => {
|
|
13593
13611
|
const {
|
|
13594
13612
|
active = false,
|
|
13595
13613
|
icon: icon11,
|
|
@@ -13606,16 +13624,16 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13606
13624
|
...rest
|
|
13607
13625
|
} = props;
|
|
13608
13626
|
useSetTabWidth(index, width);
|
|
13609
|
-
const itemRef = (0,
|
|
13627
|
+
const itemRef = (0, import_react112.useRef)(null);
|
|
13610
13628
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
13611
13629
|
const { tabContentDirection } = useTabsContext();
|
|
13612
|
-
(0,
|
|
13630
|
+
(0, import_react112.useEffect)(() => {
|
|
13613
13631
|
var _a;
|
|
13614
13632
|
if (focus) {
|
|
13615
13633
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
13616
13634
|
}
|
|
13617
13635
|
}, [focus]);
|
|
13618
|
-
const handleSelect = (0,
|
|
13636
|
+
const handleSelect = (0, import_react112.useCallback)(() => {
|
|
13619
13637
|
if (setFocus && index) {
|
|
13620
13638
|
setFocus(index);
|
|
13621
13639
|
}
|
|
@@ -13628,7 +13646,7 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13628
13646
|
handleSelect();
|
|
13629
13647
|
onKeyDown && onKeyDown(e);
|
|
13630
13648
|
};
|
|
13631
|
-
return /* @__PURE__ */ (0,
|
|
13649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime266.jsxs)(
|
|
13632
13650
|
Button2,
|
|
13633
13651
|
{
|
|
13634
13652
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -13641,8 +13659,8 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13641
13659
|
onKeyDown: handleOnKeyDown,
|
|
13642
13660
|
tabIndex: focus ? 0 : -1,
|
|
13643
13661
|
children: [
|
|
13644
|
-
icon11 && /* @__PURE__ */ (0,
|
|
13645
|
-
/* @__PURE__ */ (0,
|
|
13662
|
+
icon11 && /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(Icon, { icon: icon11, iconSize: "inherit" }),
|
|
13663
|
+
/* @__PURE__ */ (0, import_jsx_runtime266.jsx)("span", { children })
|
|
13646
13664
|
]
|
|
13647
13665
|
}
|
|
13648
13666
|
);
|
|
@@ -13650,18 +13668,18 @@ var Tab = (0, import_react111.forwardRef)((props, ref) => {
|
|
|
13650
13668
|
Tab.displayName = "Tab";
|
|
13651
13669
|
|
|
13652
13670
|
// src/components/Tabs/TabList.tsx
|
|
13653
|
-
var
|
|
13654
|
-
var
|
|
13655
|
-
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");
|
|
13656
13674
|
var { tabList: tabList2 } = tabsTokens;
|
|
13657
|
-
var autoFlow =
|
|
13675
|
+
var autoFlow = import_styled_components93.css`
|
|
13658
13676
|
grid-auto-flow: column;
|
|
13659
13677
|
grid-auto-columns: 1fr;
|
|
13660
13678
|
`;
|
|
13661
|
-
var templateColumns = (templateColumns2) =>
|
|
13679
|
+
var templateColumns = (templateColumns2) => import_styled_components93.css`
|
|
13662
13680
|
grid-template-columns: ${templateColumns2};
|
|
13663
13681
|
`;
|
|
13664
|
-
var TabRow =
|
|
13682
|
+
var TabRow = import_styled_components93.default.div`
|
|
13665
13683
|
border-bottom: ${tabList2.borderBottom};
|
|
13666
13684
|
display: grid;
|
|
13667
13685
|
${({ $gridTemplateColumns }) => $gridTemplateColumns === "" ? autoFlow : templateColumns($gridTemplateColumns)}
|
|
@@ -13680,7 +13698,7 @@ var TabRow = import_styled_components92.default.div`
|
|
|
13680
13698
|
outline: none;
|
|
13681
13699
|
}
|
|
13682
13700
|
`;
|
|
13683
|
-
var TabList = (0,
|
|
13701
|
+
var TabList = (0, import_react113.forwardRef)(
|
|
13684
13702
|
({ children, id, onFocus, ...rest }, ref) => {
|
|
13685
13703
|
const {
|
|
13686
13704
|
activeTab,
|
|
@@ -13691,11 +13709,11 @@ var TabList = (0, import_react112.forwardRef)(
|
|
|
13691
13709
|
setHasTabFocus
|
|
13692
13710
|
} = useTabsContext();
|
|
13693
13711
|
const uniqueId = id != null ? id : `${tabsId}-tablist`;
|
|
13694
|
-
const childrenArray =
|
|
13712
|
+
const childrenArray = import_react113.Children.toArray(children).length;
|
|
13695
13713
|
const [focus, setFocus] = useRoveFocus(childrenArray, hasTabFocus, "row");
|
|
13696
13714
|
const combinedRef = useCombinedRef(ref, tabListRef);
|
|
13697
|
-
const tabListChildren =
|
|
13698
|
-
return (0,
|
|
13715
|
+
const tabListChildren = import_react113.Children.map(children, (child, index) => {
|
|
13716
|
+
return (0, import_react113.isValidElement)(child) && (0, import_react113.cloneElement)(child, {
|
|
13699
13717
|
id: `${tabsId}-tab-${index}`,
|
|
13700
13718
|
"aria-controls": `${tabsId}-panel-${index}`,
|
|
13701
13719
|
active: activeTab === index,
|
|
@@ -13705,7 +13723,7 @@ var TabList = (0, import_react112.forwardRef)(
|
|
|
13705
13723
|
onClick: () => handleTabChange(index)
|
|
13706
13724
|
});
|
|
13707
13725
|
});
|
|
13708
|
-
const [widths, setWidths] = (0,
|
|
13726
|
+
const [widths, setWidths] = (0, import_react113.useState)([]);
|
|
13709
13727
|
const handleOnFocus = (event) => {
|
|
13710
13728
|
setHasTabFocus(true);
|
|
13711
13729
|
onFocus && onFocus(event);
|
|
@@ -13719,7 +13737,7 @@ var TabList = (0, import_react112.forwardRef)(
|
|
|
13719
13737
|
setHasTabFocus(false);
|
|
13720
13738
|
}
|
|
13721
13739
|
};
|
|
13722
|
-
return /* @__PURE__ */ (0,
|
|
13740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(TabWidthContextProvider, { onChangeWidths: setWidths, children: /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(
|
|
13723
13741
|
TabRow,
|
|
13724
13742
|
{
|
|
13725
13743
|
...rest,
|
|
@@ -13739,26 +13757,26 @@ var TabList = (0, import_react112.forwardRef)(
|
|
|
13739
13757
|
TabList.displayName = "TabList";
|
|
13740
13758
|
|
|
13741
13759
|
// src/components/Tabs/TabPanel.tsx
|
|
13742
|
-
var
|
|
13743
|
-
var
|
|
13744
|
-
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");
|
|
13745
13763
|
var { panel: panel2 } = tabsTokens;
|
|
13746
|
-
var Panel =
|
|
13764
|
+
var Panel = import_styled_components94.default.div`
|
|
13747
13765
|
padding: ${panel2.padding};
|
|
13748
13766
|
@media (prefers-reduced-motion: no-preference) {
|
|
13749
13767
|
transition: ${focusVisibleTransitionValue};
|
|
13750
13768
|
}
|
|
13751
13769
|
|
|
13752
|
-
${({ $active }) => !$active &&
|
|
13770
|
+
${({ $active }) => !$active && import_styled_components94.css`
|
|
13753
13771
|
display: none;
|
|
13754
13772
|
`}
|
|
13755
13773
|
&:focus-visible {
|
|
13756
13774
|
${focusVisible}
|
|
13757
13775
|
}
|
|
13758
13776
|
`;
|
|
13759
|
-
var TabPanel = (0,
|
|
13777
|
+
var TabPanel = (0, import_react114.forwardRef)(
|
|
13760
13778
|
({ active = false, children, id, className, htmlProps, ...rest }, ref) => {
|
|
13761
|
-
return /* @__PURE__ */ (0,
|
|
13779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(
|
|
13762
13780
|
Panel,
|
|
13763
13781
|
{
|
|
13764
13782
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -13774,29 +13792,29 @@ var TabPanel = (0, import_react113.forwardRef)(
|
|
|
13774
13792
|
TabPanel.displayName = "TabPanel";
|
|
13775
13793
|
|
|
13776
13794
|
// src/components/Tabs/TabPanels.tsx
|
|
13777
|
-
var
|
|
13778
|
-
var
|
|
13779
|
-
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)(
|
|
13780
13798
|
({ children, ...rest }, ref) => {
|
|
13781
13799
|
const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
|
|
13782
13800
|
const combinedRef = useCombinedRef(ref, tabPanelsRef);
|
|
13783
|
-
const panelChildren =
|
|
13801
|
+
const panelChildren = import_react115.Children.map(children, (child, index) => {
|
|
13784
13802
|
const active = index === activeTab;
|
|
13785
|
-
return (0,
|
|
13803
|
+
return (0, import_react115.isValidElement)(child) && (0, import_react115.cloneElement)(child, {
|
|
13786
13804
|
id: `${tabsId}-panel-${index}`,
|
|
13787
13805
|
"aria-labelledby": `${tabsId}-tab-${index}`,
|
|
13788
13806
|
active,
|
|
13789
13807
|
"aria-expanded": active
|
|
13790
13808
|
});
|
|
13791
13809
|
});
|
|
13792
|
-
return /* @__PURE__ */ (0,
|
|
13810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime269.jsx)("div", { ref: combinedRef, ...rest, children: panelChildren });
|
|
13793
13811
|
}
|
|
13794
13812
|
);
|
|
13795
13813
|
TabPanels.displayName = "TabPanels";
|
|
13796
13814
|
|
|
13797
13815
|
// src/components/Tag/Tag.tsx
|
|
13798
|
-
var
|
|
13799
|
-
var
|
|
13816
|
+
var import_react116 = require("react");
|
|
13817
|
+
var import_styled_components95 = __toESM(require("styled-components"));
|
|
13800
13818
|
|
|
13801
13819
|
// src/components/Tag/Tag.tokens.tsx
|
|
13802
13820
|
var import_dds_design_tokens60 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -13901,9 +13919,9 @@ var tagTokens = {
|
|
|
13901
13919
|
};
|
|
13902
13920
|
|
|
13903
13921
|
// src/components/Tag/Tag.tsx
|
|
13904
|
-
var
|
|
13922
|
+
var import_jsx_runtime270 = require("react/jsx-runtime");
|
|
13905
13923
|
var { wrapper: wrapper8 } = tagTokens;
|
|
13906
|
-
var Wrapper7 = (0,
|
|
13924
|
+
var Wrapper7 = (0, import_styled_components95.default)(TextOverflowEllipsisWrapper)`
|
|
13907
13925
|
display: inline-flex;
|
|
13908
13926
|
align-items: center;
|
|
13909
13927
|
gap: ${tagTokens.wrapper.icon.gap};
|
|
@@ -13911,18 +13929,18 @@ var Wrapper7 = (0, import_styled_components94.default)(TextOverflowEllipsisWrapp
|
|
|
13911
13929
|
border-radius: ${wrapper8.borderRadius};
|
|
13912
13930
|
padding: ${({ $withIcon }) => $withIcon ? wrapper8.icon.padding : wrapper8.padding};
|
|
13913
13931
|
${getFontStyling(typographyType5)}
|
|
13914
|
-
${({ $purpose, $strong }) =>
|
|
13932
|
+
${({ $purpose, $strong }) => import_styled_components95.css`
|
|
13915
13933
|
background-color: ${wrapper8.purpose[$purpose][$strong ? "strong" : "base"].backgroundColor};
|
|
13916
13934
|
border-color: ${wrapper8.purpose[$purpose][$strong ? "strong" : "base"].borderColor};
|
|
13917
13935
|
`}
|
|
13918
13936
|
`;
|
|
13919
|
-
var StyledIcon4 = (0,
|
|
13937
|
+
var StyledIcon4 = (0, import_styled_components95.default)(Icon)`
|
|
13920
13938
|
color: ${({ $purpose, $strong }) => {
|
|
13921
13939
|
var _a;
|
|
13922
13940
|
return (_a = wrapper8.purpose[$purpose][$strong ? "strong" : "base"].icon) == null ? void 0 : _a.color;
|
|
13923
13941
|
}};
|
|
13924
13942
|
`;
|
|
13925
|
-
var Tag = (0,
|
|
13943
|
+
var Tag = (0, import_react116.forwardRef)((props, ref) => {
|
|
13926
13944
|
const {
|
|
13927
13945
|
text,
|
|
13928
13946
|
purpose = "default",
|
|
@@ -13935,7 +13953,7 @@ var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
|
13935
13953
|
...rest
|
|
13936
13954
|
} = props;
|
|
13937
13955
|
const icon11 = tagTokens.wrapper.purpose[purpose].icon;
|
|
13938
|
-
return /* @__PURE__ */ (0,
|
|
13956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(
|
|
13939
13957
|
Wrapper7,
|
|
13940
13958
|
{
|
|
13941
13959
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -13944,7 +13962,7 @@ var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
|
13944
13962
|
$strong: strong,
|
|
13945
13963
|
$withIcon: Boolean(withIcon && icon11),
|
|
13946
13964
|
children: [
|
|
13947
|
-
withIcon && icon11 && /* @__PURE__ */ (0,
|
|
13965
|
+
withIcon && icon11 && /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(
|
|
13948
13966
|
StyledIcon4,
|
|
13949
13967
|
{
|
|
13950
13968
|
$purpose: purpose,
|
|
@@ -13953,7 +13971,7 @@ var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
|
13953
13971
|
iconSize: tagTokens.wrapper.icon.size
|
|
13954
13972
|
}
|
|
13955
13973
|
),
|
|
13956
|
-
/* @__PURE__ */ (0,
|
|
13974
|
+
/* @__PURE__ */ (0, import_jsx_runtime270.jsx)(TextOverflowEllipsisInner, { children: children != null ? children : text })
|
|
13957
13975
|
]
|
|
13958
13976
|
}
|
|
13959
13977
|
);
|
|
@@ -13961,21 +13979,21 @@ var Tag = (0, import_react115.forwardRef)((props, ref) => {
|
|
|
13961
13979
|
Tag.displayName = "Tag";
|
|
13962
13980
|
|
|
13963
13981
|
// src/components/TextInput/TextInput.tsx
|
|
13964
|
-
var
|
|
13965
|
-
var
|
|
13982
|
+
var import_react118 = require("react");
|
|
13983
|
+
var import_styled_components98 = __toESM(require("styled-components"));
|
|
13966
13984
|
|
|
13967
13985
|
// src/components/TextInput/CharCounter.tsx
|
|
13968
|
-
var
|
|
13969
|
-
var
|
|
13970
|
-
var
|
|
13971
|
-
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)`
|
|
13972
13990
|
margin-left: auto;
|
|
13973
13991
|
`;
|
|
13974
13992
|
function CharCounter(props) {
|
|
13975
13993
|
const { current, max, id, className, htmlProps, ...rest } = props;
|
|
13976
|
-
const generatedId = (0,
|
|
13994
|
+
const generatedId = (0, import_react117.useId)();
|
|
13977
13995
|
const uniqueId = id != null ? id : `${generatedId}-characterCounter`;
|
|
13978
|
-
return /* @__PURE__ */ (0,
|
|
13996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(
|
|
13979
13997
|
Wrapper8,
|
|
13980
13998
|
{
|
|
13981
13999
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
@@ -13994,7 +14012,7 @@ var CharCounter_default = CharCounter;
|
|
|
13994
14012
|
|
|
13995
14013
|
// src/components/TextInput/TextInput.styles.tsx
|
|
13996
14014
|
var import_dds_design_tokens62 = require("@norges-domstoler/dds-design-tokens");
|
|
13997
|
-
var
|
|
14015
|
+
var import_styled_components97 = __toESM(require("styled-components"));
|
|
13998
14016
|
|
|
13999
14017
|
// src/components/TextInput/TextInput.tokens.tsx
|
|
14000
14018
|
var import_dds_design_tokens61 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -14043,31 +14061,31 @@ var textInputTokens = {
|
|
|
14043
14061
|
// src/components/TextInput/TextInput.styles.tsx
|
|
14044
14062
|
var { iconSizes: iconSizes5 } = import_dds_design_tokens62.ddsBaseTokens;
|
|
14045
14063
|
var { input: input6, icon: icon10 } = textInputTokens;
|
|
14046
|
-
var MessageContainer2 =
|
|
14064
|
+
var MessageContainer2 = import_styled_components97.default.div`
|
|
14047
14065
|
display: flex;
|
|
14048
14066
|
justify-content: space-between;
|
|
14049
14067
|
`;
|
|
14050
|
-
var StyledIcon5 = (0,
|
|
14068
|
+
var StyledIcon5 = (0, import_styled_components97.default)(Icon)`
|
|
14051
14069
|
position: absolute;
|
|
14052
14070
|
color: ${icon10.color};
|
|
14053
|
-
${({ $size, iconSize }) =>
|
|
14071
|
+
${({ $size, iconSize }) => import_styled_components97.css`
|
|
14054
14072
|
left: ${icon10.sizes[$size].left};
|
|
14055
|
-
${iconSize === "small" ?
|
|
14073
|
+
${iconSize === "small" ? import_styled_components97.css`
|
|
14056
14074
|
top: ${`calc(50% - ${iconSizes5.DdsIconsizeSmallNumberPx / 2}px)`};
|
|
14057
|
-
` :
|
|
14075
|
+
` : import_styled_components97.css`
|
|
14058
14076
|
top: ${`calc(50% - ${iconSizes5.DdsIconsizeMediumNumberPx / 2}px)`};
|
|
14059
14077
|
`}
|
|
14060
14078
|
`}
|
|
14061
14079
|
z-index: 1;
|
|
14062
14080
|
`;
|
|
14063
|
-
var StyledInput = (0,
|
|
14064
|
-
${({ componentSize, $hasIcon }) => $hasIcon && componentSize &&
|
|
14081
|
+
var StyledInput = (0, import_styled_components97.default)(StatefulInput)`
|
|
14082
|
+
${({ componentSize, $hasIcon }) => $hasIcon && componentSize && import_styled_components97.css`
|
|
14065
14083
|
padding-left: ${input6.withIcon[componentSize].paddingLeft};
|
|
14066
14084
|
`}
|
|
14067
14085
|
`;
|
|
14068
14086
|
|
|
14069
14087
|
// src/components/TextInput/TextInput.tsx
|
|
14070
|
-
var
|
|
14088
|
+
var import_jsx_runtime272 = require("react/jsx-runtime");
|
|
14071
14089
|
var defaultWidth5 = "320px";
|
|
14072
14090
|
var defaultTinyWidth = "210px";
|
|
14073
14091
|
var getWidth = (size2, width) => {
|
|
@@ -14078,7 +14096,7 @@ var getWidth = (size2, width) => {
|
|
|
14078
14096
|
}
|
|
14079
14097
|
return defaultWidth5;
|
|
14080
14098
|
};
|
|
14081
|
-
var Affix =
|
|
14099
|
+
var Affix = import_styled_components98.default.span`
|
|
14082
14100
|
position: absolute;
|
|
14083
14101
|
height: 100%;
|
|
14084
14102
|
top: 50%;
|
|
@@ -14088,31 +14106,31 @@ var Affix = import_styled_components97.default.span`
|
|
|
14088
14106
|
pointer-events: none;
|
|
14089
14107
|
z-index: 1;
|
|
14090
14108
|
`;
|
|
14091
|
-
var Prefix = (0,
|
|
14109
|
+
var Prefix = (0, import_styled_components98.default)(Affix)`
|
|
14092
14110
|
left: 0;
|
|
14093
14111
|
margin-left: 8px;
|
|
14094
14112
|
padding-right: 8px;
|
|
14095
14113
|
border-right: 1px solid ${textInputTokens.affix.border.color};
|
|
14096
14114
|
|
|
14097
|
-
${({ readOnly }) => readOnly &&
|
|
14115
|
+
${({ readOnly }) => readOnly && import_styled_components98.css`
|
|
14098
14116
|
margin-left: 0;
|
|
14099
14117
|
padding-right: 0.5ch;
|
|
14100
14118
|
border-right: none;
|
|
14101
14119
|
`};
|
|
14102
14120
|
`;
|
|
14103
|
-
var Suffix = (0,
|
|
14121
|
+
var Suffix = (0, import_styled_components98.default)(Affix)`
|
|
14104
14122
|
right: 0;
|
|
14105
14123
|
margin-right: 8px;
|
|
14106
14124
|
padding-left: 8px;
|
|
14107
14125
|
border-left: 1px solid ${textInputTokens.affix.border.color};
|
|
14108
14126
|
|
|
14109
|
-
${({ readOnly }) => readOnly &&
|
|
14127
|
+
${({ readOnly }) => readOnly && import_styled_components98.css`
|
|
14110
14128
|
margin-right: 0;
|
|
14111
14129
|
padding-left: 0.5ch;
|
|
14112
14130
|
border-left: none;
|
|
14113
14131
|
`};
|
|
14114
14132
|
`;
|
|
14115
|
-
var TextInput2 = (0,
|
|
14133
|
+
var TextInput2 = (0, import_react118.forwardRef)(
|
|
14116
14134
|
({
|
|
14117
14135
|
label: label3,
|
|
14118
14136
|
disabled,
|
|
@@ -14138,14 +14156,14 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14138
14156
|
suffix,
|
|
14139
14157
|
...rest
|
|
14140
14158
|
}, ref) => {
|
|
14141
|
-
const [text, setText] = (0,
|
|
14159
|
+
const [text, setText] = (0, import_react118.useState)(
|
|
14142
14160
|
getDefaultText(value, defaultValue)
|
|
14143
14161
|
);
|
|
14144
|
-
const prefixRef = (0,
|
|
14145
|
-
const suffixRef = (0,
|
|
14146
|
-
const [prefixLength, setPrefixLength] = (0,
|
|
14147
|
-
const [suffixLength, setSuffixLength] = (0,
|
|
14148
|
-
(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)(() => {
|
|
14149
14167
|
if (prefixRef.current) {
|
|
14150
14168
|
setPrefixLength(prefixRef.current.offsetWidth);
|
|
14151
14169
|
}
|
|
@@ -14159,7 +14177,7 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14159
14177
|
onChange(event);
|
|
14160
14178
|
}
|
|
14161
14179
|
};
|
|
14162
|
-
const generatedId = (0,
|
|
14180
|
+
const generatedId = (0, import_react118.useId)();
|
|
14163
14181
|
const uniqueId = id != null ? id : `${generatedId}-textInput`;
|
|
14164
14182
|
const hasErrorMessage = !!errorMessage;
|
|
14165
14183
|
const hasTip = !!tip;
|
|
@@ -14201,8 +14219,8 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14201
14219
|
const showRequiredStyling = !!(required || ariaRequired);
|
|
14202
14220
|
let extendedInput = null;
|
|
14203
14221
|
if (hasIcon) {
|
|
14204
|
-
extendedInput = /* @__PURE__ */ (0,
|
|
14205
|
-
/* @__PURE__ */ (0,
|
|
14222
|
+
extendedInput = /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(InputContainer, { children: [
|
|
14223
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14206
14224
|
StyledIcon5,
|
|
14207
14225
|
{
|
|
14208
14226
|
icon: icon11,
|
|
@@ -14210,7 +14228,7 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14210
14228
|
$size: componentSize
|
|
14211
14229
|
}
|
|
14212
14230
|
),
|
|
14213
|
-
/* @__PURE__ */ (0,
|
|
14231
|
+
/* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14214
14232
|
StyledInput,
|
|
14215
14233
|
{
|
|
14216
14234
|
ref,
|
|
@@ -14223,9 +14241,9 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14223
14241
|
)
|
|
14224
14242
|
] });
|
|
14225
14243
|
} else if (hasAffix) {
|
|
14226
|
-
extendedInput = /* @__PURE__ */ (0,
|
|
14227
|
-
prefix2 && /* @__PURE__ */ (0,
|
|
14228
|
-
/* @__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)(
|
|
14229
14247
|
StatefulInput,
|
|
14230
14248
|
{
|
|
14231
14249
|
ref,
|
|
@@ -14237,12 +14255,12 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14237
14255
|
...generalInputProps
|
|
14238
14256
|
}
|
|
14239
14257
|
),
|
|
14240
|
-
suffix && /* @__PURE__ */ (0,
|
|
14258
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(Suffix, { readOnly, ref: suffixRef, "aria-hidden": true, children: suffix })
|
|
14241
14259
|
] });
|
|
14242
14260
|
}
|
|
14243
|
-
return /* @__PURE__ */ (0,
|
|
14244
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
14245
|
-
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)(
|
|
14246
14264
|
StatefulInput,
|
|
14247
14265
|
{
|
|
14248
14266
|
ref,
|
|
@@ -14252,9 +14270,9 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14252
14270
|
...generalInputProps
|
|
14253
14271
|
}
|
|
14254
14272
|
),
|
|
14255
|
-
hasMessage && /* @__PURE__ */ (0,
|
|
14273
|
+
hasMessage && /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(MessageContainer2, { children: [
|
|
14256
14274
|
renderInputMessage(tip, tipId, errorMessage, errorMessageId),
|
|
14257
|
-
maxLength && Number.isInteger(maxLength) && maxLength > 0 && withCharacterCounter && /* @__PURE__ */ (0,
|
|
14275
|
+
maxLength && Number.isInteger(maxLength) && maxLength > 0 && withCharacterCounter && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
14258
14276
|
CharCounter_default,
|
|
14259
14277
|
{
|
|
14260
14278
|
id: characterCounterId,
|
|
@@ -14269,15 +14287,15 @@ var TextInput2 = (0, import_react117.forwardRef)(
|
|
|
14269
14287
|
TextInput2.displayName = "TextInput";
|
|
14270
14288
|
|
|
14271
14289
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
14272
|
-
var
|
|
14273
|
-
var
|
|
14290
|
+
var import_react120 = require("react");
|
|
14291
|
+
var import_styled_components99 = __toESM(require("styled-components"));
|
|
14274
14292
|
|
|
14275
14293
|
// src/components/ToggleBar/ToggleBar.context.tsx
|
|
14276
|
-
var
|
|
14277
|
-
var ToggleBarContext = (0,
|
|
14294
|
+
var import_react119 = require("react");
|
|
14295
|
+
var ToggleBarContext = (0, import_react119.createContext)({
|
|
14278
14296
|
size: "medium"
|
|
14279
14297
|
});
|
|
14280
|
-
var useToggleBarContext = () => (0,
|
|
14298
|
+
var useToggleBarContext = () => (0, import_react119.useContext)(ToggleBarContext);
|
|
14281
14299
|
|
|
14282
14300
|
// src/components/ToggleBar/ToggleBar.tokens.tsx
|
|
14283
14301
|
var import_dds_design_tokens63 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -14386,8 +14404,8 @@ var toggleBarTokens = {
|
|
|
14386
14404
|
};
|
|
14387
14405
|
|
|
14388
14406
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
14389
|
-
var
|
|
14390
|
-
var OuterContainer3 =
|
|
14407
|
+
var import_jsx_runtime273 = require("react/jsx-runtime");
|
|
14408
|
+
var OuterContainer3 = import_styled_components99.default.div`
|
|
14391
14409
|
display: flex;
|
|
14392
14410
|
flex-direction: column;
|
|
14393
14411
|
gap: ${toggleBarTokens.outerContainer.gap};
|
|
@@ -14395,11 +14413,11 @@ var OuterContainer3 = import_styled_components98.default.div`
|
|
|
14395
14413
|
*::selection {
|
|
14396
14414
|
${selection}
|
|
14397
14415
|
}
|
|
14398
|
-
${({ $width }) => $width &&
|
|
14416
|
+
${({ $width }) => $width && import_styled_components99.css`
|
|
14399
14417
|
width: ${$width};
|
|
14400
14418
|
`}
|
|
14401
14419
|
`;
|
|
14402
|
-
var Bar3 =
|
|
14420
|
+
var Bar3 = import_styled_components99.default.div`
|
|
14403
14421
|
display: grid;
|
|
14404
14422
|
grid-auto-flow: column;
|
|
14405
14423
|
grid-auto-columns: 1fr;
|
|
@@ -14418,15 +14436,15 @@ var ToggleBar = (props) => {
|
|
|
14418
14436
|
id,
|
|
14419
14437
|
...rest
|
|
14420
14438
|
} = props;
|
|
14421
|
-
const generatedId = (0,
|
|
14439
|
+
const generatedId = (0, import_react120.useId)();
|
|
14422
14440
|
const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
|
|
14423
|
-
const [groupValue, setGroupValue] = (0,
|
|
14441
|
+
const [groupValue, setGroupValue] = (0, import_react120.useState)(value);
|
|
14424
14442
|
const handleChange = combineHandlers(
|
|
14425
14443
|
(e) => setGroupValue(e.target.value),
|
|
14426
14444
|
(e) => onChange && onChange(e, e.target.value)
|
|
14427
14445
|
);
|
|
14428
14446
|
const labelId = label3 && `${uniqueId}-label`;
|
|
14429
|
-
return /* @__PURE__ */ (0,
|
|
14447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
|
|
14430
14448
|
ToggleBarContext.Provider,
|
|
14431
14449
|
{
|
|
14432
14450
|
value: {
|
|
@@ -14435,7 +14453,7 @@ var ToggleBar = (props) => {
|
|
|
14435
14453
|
name,
|
|
14436
14454
|
value: groupValue
|
|
14437
14455
|
},
|
|
14438
|
-
children: /* @__PURE__ */ (0,
|
|
14456
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(
|
|
14439
14457
|
OuterContainer3,
|
|
14440
14458
|
{
|
|
14441
14459
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
@@ -14443,8 +14461,8 @@ var ToggleBar = (props) => {
|
|
|
14443
14461
|
"aria-labelledby": labelId != null ? labelId : htmlProps == null ? void 0 : htmlProps["aria-labelledby"],
|
|
14444
14462
|
$width: width,
|
|
14445
14463
|
children: [
|
|
14446
|
-
label3 && /* @__PURE__ */ (0,
|
|
14447
|
-
/* @__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 })
|
|
14448
14466
|
]
|
|
14449
14467
|
}
|
|
14450
14468
|
)
|
|
@@ -14454,12 +14472,12 @@ var ToggleBar = (props) => {
|
|
|
14454
14472
|
ToggleBar.displayName = "ToggleBar";
|
|
14455
14473
|
|
|
14456
14474
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
14457
|
-
var
|
|
14475
|
+
var import_react121 = require("react");
|
|
14458
14476
|
|
|
14459
14477
|
// src/components/ToggleBar/ToggleRadio.styles.tsx
|
|
14460
|
-
var
|
|
14478
|
+
var import_styled_components100 = __toESM(require("styled-components"));
|
|
14461
14479
|
var { content: content8, label: label2 } = toggleBarTokens;
|
|
14462
|
-
var Content2 =
|
|
14480
|
+
var Content2 = import_styled_components100.default.span`
|
|
14463
14481
|
display: flex;
|
|
14464
14482
|
justify-content: center;
|
|
14465
14483
|
align-items: center;
|
|
@@ -14477,18 +14495,18 @@ var Content2 = import_styled_components99.default.span`
|
|
|
14477
14495
|
}
|
|
14478
14496
|
background-color: ${content8.base.backgroundColor};
|
|
14479
14497
|
|
|
14480
|
-
${({ $size, $justIcon }) =>
|
|
14481
|
-
${$justIcon ?
|
|
14498
|
+
${({ $size, $justIcon }) => import_styled_components100.css`
|
|
14499
|
+
${$justIcon ? import_styled_components100.css`
|
|
14482
14500
|
font-size: ${content8.size[$size].justIcon.fontSize};
|
|
14483
14501
|
padding: ${content8.size[$size].justIcon.padding};
|
|
14484
|
-
` :
|
|
14502
|
+
` : import_styled_components100.css`
|
|
14485
14503
|
gap: ${content8.size[$size].withText.gap};
|
|
14486
14504
|
padding: ${content8.size[$size].withText.padding};
|
|
14487
14505
|
${getFontStyling(typographyTypes6[$size])}
|
|
14488
14506
|
`}
|
|
14489
14507
|
`}
|
|
14490
14508
|
`;
|
|
14491
|
-
var Label3 =
|
|
14509
|
+
var Label3 = import_styled_components100.default.label`
|
|
14492
14510
|
${Content2} {
|
|
14493
14511
|
border-right: ${label2.base.borderRight};
|
|
14494
14512
|
border-top: ${label2.base.borderTop};
|
|
@@ -14526,7 +14544,7 @@ var Label3 = import_styled_components99.default.label`
|
|
|
14526
14544
|
`;
|
|
14527
14545
|
|
|
14528
14546
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
14529
|
-
var
|
|
14547
|
+
var import_jsx_runtime274 = require("react/jsx-runtime");
|
|
14530
14548
|
var calculateChecked = (value, group4, checked) => {
|
|
14531
14549
|
if (typeof checked !== "undefined")
|
|
14532
14550
|
return checked;
|
|
@@ -14538,7 +14556,7 @@ var calculateChecked = (value, group4, checked) => {
|
|
|
14538
14556
|
}
|
|
14539
14557
|
return !!value;
|
|
14540
14558
|
};
|
|
14541
|
-
var ToggleRadio = (0,
|
|
14559
|
+
var ToggleRadio = (0, import_react121.forwardRef)(
|
|
14542
14560
|
(props, ref) => {
|
|
14543
14561
|
const {
|
|
14544
14562
|
value,
|
|
@@ -14554,15 +14572,15 @@ var ToggleRadio = (0, import_react120.forwardRef)(
|
|
|
14554
14572
|
id,
|
|
14555
14573
|
...rest
|
|
14556
14574
|
} = props;
|
|
14557
|
-
const generatedId = (0,
|
|
14575
|
+
const generatedId = (0, import_react121.useId)();
|
|
14558
14576
|
const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
|
|
14559
14577
|
const group4 = useToggleBarContext();
|
|
14560
14578
|
const handleChange = (event) => {
|
|
14561
14579
|
onChange && onChange(event);
|
|
14562
14580
|
(group4 == null ? void 0 : group4.onChange) && group4.onChange(event);
|
|
14563
14581
|
};
|
|
14564
|
-
return /* @__PURE__ */ (0,
|
|
14565
|
-
/* @__PURE__ */ (0,
|
|
14582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime274.jsxs)(Label3, { size: group4.size, htmlFor: uniqueId, children: [
|
|
14583
|
+
/* @__PURE__ */ (0, import_jsx_runtime274.jsx)(
|
|
14566
14584
|
HiddenInput,
|
|
14567
14585
|
{
|
|
14568
14586
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
@@ -14576,9 +14594,9 @@ var ToggleRadio = (0, import_react120.forwardRef)(
|
|
|
14576
14594
|
"aria-labelledby": ariaLabelledBy
|
|
14577
14595
|
}
|
|
14578
14596
|
),
|
|
14579
|
-
/* @__PURE__ */ (0,
|
|
14580
|
-
icon11 && /* @__PURE__ */ (0,
|
|
14581
|
-
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 })
|
|
14582
14600
|
] })
|
|
14583
14601
|
] });
|
|
14584
14602
|
}
|
|
@@ -14586,8 +14604,8 @@ var ToggleRadio = (0, import_react120.forwardRef)(
|
|
|
14586
14604
|
ToggleRadio.displayName = "ToggleRadio";
|
|
14587
14605
|
|
|
14588
14606
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
14589
|
-
var
|
|
14590
|
-
var
|
|
14607
|
+
var import_react122 = require("react");
|
|
14608
|
+
var import_styled_components101 = __toESM(require("styled-components"));
|
|
14591
14609
|
|
|
14592
14610
|
// src/components/ToggleButton/ToggleButton.tokens.tsx
|
|
14593
14611
|
var import_dds_design_tokens64 = require("@norges-domstoler/dds-design-tokens");
|
|
@@ -14622,9 +14640,9 @@ var toggleButtonTokens = {
|
|
|
14622
14640
|
};
|
|
14623
14641
|
|
|
14624
14642
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
14625
|
-
var
|
|
14643
|
+
var import_jsx_runtime275 = require("react/jsx-runtime");
|
|
14626
14644
|
var { toggleButton: toggleButton2 } = toggleButtonTokens;
|
|
14627
|
-
var Content3 =
|
|
14645
|
+
var Content3 = import_styled_components101.default.span`
|
|
14628
14646
|
display: flex;
|
|
14629
14647
|
align-items: center;
|
|
14630
14648
|
width: 100%;
|
|
@@ -14646,7 +14664,7 @@ var Content3 = import_styled_components100.default.span`
|
|
|
14646
14664
|
${focusVisibleTransitionValue};
|
|
14647
14665
|
}
|
|
14648
14666
|
|
|
14649
|
-
${({ $hasIcon }) => $hasIcon &&
|
|
14667
|
+
${({ $hasIcon }) => $hasIcon && import_styled_components101.css`
|
|
14650
14668
|
gap: ${toggleButton2.gap};
|
|
14651
14669
|
`}
|
|
14652
14670
|
|
|
@@ -14660,7 +14678,7 @@ var Content3 = import_styled_components100.default.span`
|
|
|
14660
14678
|
border-color: ${toggleButton2.hover.borderColor};
|
|
14661
14679
|
}
|
|
14662
14680
|
`;
|
|
14663
|
-
var Container16 =
|
|
14681
|
+
var Container16 = import_styled_components101.default.label`
|
|
14664
14682
|
width: fit-content;
|
|
14665
14683
|
${HiddenInput}:checked + ${Content3} {
|
|
14666
14684
|
background-color: ${toggleButton2.checked.backgroundColor};
|
|
@@ -14676,12 +14694,12 @@ var Container16 = import_styled_components100.default.label`
|
|
|
14676
14694
|
${focusVisible}
|
|
14677
14695
|
}
|
|
14678
14696
|
`;
|
|
14679
|
-
var ToggleButton = (0,
|
|
14697
|
+
var ToggleButton = (0, import_react122.forwardRef)(
|
|
14680
14698
|
({ id, label: label3, icon: icon11, className, htmlProps, ...rest }, ref) => {
|
|
14681
|
-
const generatedId = (0,
|
|
14699
|
+
const generatedId = (0, import_react122.useId)();
|
|
14682
14700
|
const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
|
|
14683
|
-
return /* @__PURE__ */ (0,
|
|
14684
|
-
/* @__PURE__ */ (0,
|
|
14701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)(Container16, { htmlFor: uniqueId, children: [
|
|
14702
|
+
/* @__PURE__ */ (0, import_jsx_runtime275.jsx)(
|
|
14685
14703
|
HiddenInput,
|
|
14686
14704
|
{
|
|
14687
14705
|
...getBaseHTMLProps(uniqueId, className, htmlProps, rest),
|
|
@@ -14689,8 +14707,8 @@ var ToggleButton = (0, import_react121.forwardRef)(
|
|
|
14689
14707
|
type: "checkbox"
|
|
14690
14708
|
}
|
|
14691
14709
|
),
|
|
14692
|
-
/* @__PURE__ */ (0,
|
|
14693
|
-
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" }),
|
|
14694
14712
|
" ",
|
|
14695
14713
|
label3
|
|
14696
14714
|
] })
|
|
@@ -14700,18 +14718,18 @@ var ToggleButton = (0, import_react121.forwardRef)(
|
|
|
14700
14718
|
ToggleButton.displayName = "ToggleButton";
|
|
14701
14719
|
|
|
14702
14720
|
// src/components/ToggleButton/ToggleButtonGroup.tsx
|
|
14703
|
-
var
|
|
14704
|
-
var
|
|
14705
|
-
var
|
|
14706
|
-
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`
|
|
14707
14725
|
gap: ${toggleButtonTokens.group.gap};
|
|
14708
14726
|
display: flex;
|
|
14709
14727
|
flex-wrap: wrap;
|
|
14710
|
-
${({ direction }) =>
|
|
14728
|
+
${({ direction }) => import_styled_components102.css`
|
|
14711
14729
|
flex-direction: ${direction};
|
|
14712
14730
|
`}
|
|
14713
14731
|
`;
|
|
14714
|
-
var Container17 =
|
|
14732
|
+
var Container17 = import_styled_components102.default.div`
|
|
14715
14733
|
display: flex;
|
|
14716
14734
|
flex-direction: column;
|
|
14717
14735
|
gap: ${toggleButtonTokens.container.gap};
|
|
@@ -14727,7 +14745,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
14727
14745
|
htmlProps,
|
|
14728
14746
|
...rest
|
|
14729
14747
|
} = props;
|
|
14730
|
-
const generatedId = (0,
|
|
14748
|
+
const generatedId = (0, import_react123.useId)();
|
|
14731
14749
|
const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
|
|
14732
14750
|
const groupProps = {
|
|
14733
14751
|
direction
|
|
@@ -14737,8 +14755,8 @@ var ToggleButtonGroup = (props) => {
|
|
|
14737
14755
|
role: "group",
|
|
14738
14756
|
"aria-labelledby": label3 ? uniqueLabelId : void 0
|
|
14739
14757
|
};
|
|
14740
|
-
return /* @__PURE__ */ (0,
|
|
14741
|
-
!!label3 && /* @__PURE__ */ (0,
|
|
14758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime276.jsxs)(Container17, { ...containerProps, children: [
|
|
14759
|
+
!!label3 && /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(
|
|
14742
14760
|
Typography,
|
|
14743
14761
|
{
|
|
14744
14762
|
as: "span",
|
|
@@ -14747,7 +14765,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
14747
14765
|
children: label3
|
|
14748
14766
|
}
|
|
14749
14767
|
),
|
|
14750
|
-
/* @__PURE__ */ (0,
|
|
14768
|
+
/* @__PURE__ */ (0, import_jsx_runtime276.jsx)(Group2, { ...groupProps, children })
|
|
14751
14769
|
] });
|
|
14752
14770
|
};
|
|
14753
14771
|
ToggleButtonGroup.displayName = "ToggleButtonGroup";
|
|
@@ -14873,6 +14891,7 @@ ToggleButtonGroup.displayName = "ToggleButtonGroup";
|
|
|
14873
14891
|
Icon,
|
|
14874
14892
|
ImageIcon,
|
|
14875
14893
|
InfoIcon,
|
|
14894
|
+
InlineButton,
|
|
14876
14895
|
InlineEditInput,
|
|
14877
14896
|
InlineEditTextArea,
|
|
14878
14897
|
Input,
|