@norges-domstoler/dds-components 21.13.0 → 21.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +5 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +23 -21
- package/dist/index.d.ts +23 -21
- package/dist/index.js +274 -140
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +289 -155
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -312,6 +312,7 @@ var BACKGROUNDS = [
|
|
|
312
312
|
"surface-info-strong",
|
|
313
313
|
"surface-paper-default",
|
|
314
314
|
"surface-notification",
|
|
315
|
+
"surface-field-disabled",
|
|
315
316
|
"brand-primary-default",
|
|
316
317
|
"brand-primary-subtle",
|
|
317
318
|
"brand-primary-medium",
|
|
@@ -379,6 +380,8 @@ var readOnlyKeyDownHandler = (type, readOnly, onKeyDown) => {
|
|
|
379
380
|
evt.preventDefault();
|
|
380
381
|
} else if (type === "selectionControl" && evt.key === " ") {
|
|
381
382
|
evt.preventDefault();
|
|
383
|
+
} else if (type === "file" && (evt.key === " " || evt.key === "Enter")) {
|
|
384
|
+
evt.preventDefault();
|
|
382
385
|
}
|
|
383
386
|
} else onKeyDown == null ? void 0 : onKeyDown(evt);
|
|
384
387
|
};
|
|
@@ -2888,8 +2891,8 @@ function useTranslation() {
|
|
|
2888
2891
|
const t = (text) => text[lang];
|
|
2889
2892
|
return { t, lang };
|
|
2890
2893
|
}
|
|
2891
|
-
function createTexts(
|
|
2892
|
-
return
|
|
2894
|
+
function createTexts(texts27) {
|
|
2895
|
+
return texts27;
|
|
2893
2896
|
}
|
|
2894
2897
|
|
|
2895
2898
|
// src/DdsProvider/DdsProvider.tsx
|
|
@@ -5641,7 +5644,12 @@ var DateInput_default = {
|
|
|
5641
5644
|
};
|
|
5642
5645
|
|
|
5643
5646
|
// src/components/date-inputs/DatePicker/constants.ts
|
|
5644
|
-
var
|
|
5647
|
+
var LOCALE = {
|
|
5648
|
+
nb: "nb-NO",
|
|
5649
|
+
no: "no-NO",
|
|
5650
|
+
nn: "nn-NO",
|
|
5651
|
+
en: "en-GB"
|
|
5652
|
+
};
|
|
5645
5653
|
var timezone = "Europe/Oslo";
|
|
5646
5654
|
|
|
5647
5655
|
// src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
|
|
@@ -5885,12 +5893,12 @@ var CalendarPopoverContent = ({
|
|
|
5885
5893
|
import { jsx as jsx226, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
5886
5894
|
function CalendarGrid({ state, ...props }) {
|
|
5887
5895
|
const { t } = useTranslation();
|
|
5888
|
-
const { locale
|
|
5896
|
+
const { locale } = useLocale();
|
|
5889
5897
|
const {
|
|
5890
5898
|
gridProps: { onKeyDown, ...gridProps },
|
|
5891
5899
|
headerProps
|
|
5892
5900
|
} = useCalendarGrid(props, state);
|
|
5893
|
-
const weeksInMonth = getWeeksInMonth(state.visibleRange.start,
|
|
5901
|
+
const weeksInMonth = getWeeksInMonth(state.visibleRange.start, locale);
|
|
5894
5902
|
const weekDays = [
|
|
5895
5903
|
{ short: t(texts5.mo), full: t(texts5.monday) },
|
|
5896
5904
|
{ short: t(texts5.tu), full: t(texts5.tuesday) },
|
|
@@ -6072,11 +6080,11 @@ function createCalendar(identifier) {
|
|
|
6072
6080
|
}
|
|
6073
6081
|
function Calendar(props) {
|
|
6074
6082
|
const { t } = useTranslation();
|
|
6075
|
-
const { locale
|
|
6083
|
+
const { locale } = useLocale2();
|
|
6076
6084
|
const state = useCalendarState({
|
|
6077
6085
|
...props,
|
|
6078
6086
|
createCalendar,
|
|
6079
|
-
locale
|
|
6087
|
+
locale
|
|
6080
6088
|
});
|
|
6081
6089
|
const {
|
|
6082
6090
|
calendarProps,
|
|
@@ -6220,6 +6228,39 @@ function CalendarButton({
|
|
|
6220
6228
|
);
|
|
6221
6229
|
}
|
|
6222
6230
|
|
|
6231
|
+
// src/components/date-inputs/DatePicker/DateField/DateField.utils.tsx
|
|
6232
|
+
function formatDateFieldSegments(segments) {
|
|
6233
|
+
const daySegment = segments.find((segment) => segment.type === "day");
|
|
6234
|
+
const monthSegment = segments.find((segment) => segment.type === "month");
|
|
6235
|
+
const yearSegment = segments.find((segment) => segment.type === "year");
|
|
6236
|
+
const separatorSegment = segments.find((segment) => segment.type === "literal");
|
|
6237
|
+
if (!daySegment || !monthSegment || !yearSegment || !separatorSegment) {
|
|
6238
|
+
throw new Error("Invalid date field segments");
|
|
6239
|
+
}
|
|
6240
|
+
const formattedDaySegment = {
|
|
6241
|
+
...daySegment,
|
|
6242
|
+
text: daySegment.text.padStart(2, "0"),
|
|
6243
|
+
placeholder: "dd"
|
|
6244
|
+
};
|
|
6245
|
+
const formattedMonthSegment = {
|
|
6246
|
+
...monthSegment,
|
|
6247
|
+
text: monthSegment.text.padStart(2, "0"),
|
|
6248
|
+
placeholder: "mm"
|
|
6249
|
+
};
|
|
6250
|
+
const formattedYearSegment = {
|
|
6251
|
+
...yearSegment,
|
|
6252
|
+
placeholder: "\xE5\xE5\xE5\xE5"
|
|
6253
|
+
};
|
|
6254
|
+
const formattedSeparatorSegment = { ...separatorSegment, text: "." };
|
|
6255
|
+
return [
|
|
6256
|
+
formattedDaySegment,
|
|
6257
|
+
formattedSeparatorSegment,
|
|
6258
|
+
formattedMonthSegment,
|
|
6259
|
+
formattedSeparatorSegment,
|
|
6260
|
+
formattedYearSegment
|
|
6261
|
+
];
|
|
6262
|
+
}
|
|
6263
|
+
|
|
6223
6264
|
// src/components/date-inputs/DatePicker/DateField/DateSegment.tsx
|
|
6224
6265
|
import { useDateSegment } from "@react-aria/datepicker";
|
|
6225
6266
|
import { useRef as useRef14 } from "react";
|
|
@@ -6234,7 +6275,6 @@ function DateSegment({
|
|
|
6234
6275
|
state,
|
|
6235
6276
|
componentSize
|
|
6236
6277
|
}) {
|
|
6237
|
-
var _a;
|
|
6238
6278
|
const ref = useRef14(null);
|
|
6239
6279
|
const { segmentProps } = useDateSegment(segment, state, ref);
|
|
6240
6280
|
return /* @__PURE__ */ jsxs45(
|
|
@@ -6264,7 +6304,7 @@ function DateSegment({
|
|
|
6264
6304
|
children: segment.placeholder
|
|
6265
6305
|
}
|
|
6266
6306
|
),
|
|
6267
|
-
segment.isPlaceholder ? "" : segment.text
|
|
6307
|
+
segment.isPlaceholder ? "" : segment.text
|
|
6268
6308
|
]
|
|
6269
6309
|
}
|
|
6270
6310
|
);
|
|
@@ -6469,11 +6509,11 @@ function DateField({
|
|
|
6469
6509
|
clearable,
|
|
6470
6510
|
...props
|
|
6471
6511
|
}) {
|
|
6472
|
-
const { locale
|
|
6512
|
+
const { locale } = useLocale3();
|
|
6473
6513
|
const { t } = useTranslation();
|
|
6474
6514
|
const state = useDateFieldState({
|
|
6475
6515
|
...props,
|
|
6476
|
-
locale
|
|
6516
|
+
locale,
|
|
6477
6517
|
createCalendar: createCalendar2
|
|
6478
6518
|
});
|
|
6479
6519
|
const internalRef = useRef15(null);
|
|
@@ -6488,6 +6528,7 @@ function DateField({
|
|
|
6488
6528
|
const clearDate = () => {
|
|
6489
6529
|
state.setValue(null);
|
|
6490
6530
|
};
|
|
6531
|
+
const formattedSegments = formatDateFieldSegments(state.segments);
|
|
6491
6532
|
return /* @__PURE__ */ jsx235(
|
|
6492
6533
|
DateInput,
|
|
6493
6534
|
{
|
|
@@ -6526,7 +6567,7 @@ function DateField({
|
|
|
6526
6567
|
),
|
|
6527
6568
|
labelProps,
|
|
6528
6569
|
fieldProps,
|
|
6529
|
-
children:
|
|
6570
|
+
children: formattedSegments.map((segment, i) => /* @__PURE__ */ jsx235(
|
|
6530
6571
|
DateSegment,
|
|
6531
6572
|
{
|
|
6532
6573
|
"aria-readonly": props.isReadOnly,
|
|
@@ -6587,6 +6628,10 @@ function DatePicker({
|
|
|
6587
6628
|
ref,
|
|
6588
6629
|
...props
|
|
6589
6630
|
}) {
|
|
6631
|
+
const lang = useLanguage();
|
|
6632
|
+
if (!lang) {
|
|
6633
|
+
throw new Error("DatePicker must be used within a DdsProvider");
|
|
6634
|
+
}
|
|
6590
6635
|
const state = useDatePickerState(props);
|
|
6591
6636
|
const domRef = useFocusManagerRef(ref && refIsFocusable(ref) ? ref : null);
|
|
6592
6637
|
const internalRef = useRef17(null);
|
|
@@ -6596,7 +6641,7 @@ function DatePicker({
|
|
|
6596
6641
|
state,
|
|
6597
6642
|
internalRef
|
|
6598
6643
|
);
|
|
6599
|
-
return /* @__PURE__ */ jsx236(I18nProvider, { locale, children: /* @__PURE__ */ jsxs47(
|
|
6644
|
+
return /* @__PURE__ */ jsx236(I18nProvider, { locale: LOCALE[lang], children: /* @__PURE__ */ jsxs47(
|
|
6600
6645
|
CalendarPopover,
|
|
6601
6646
|
{
|
|
6602
6647
|
isOpen: state.isOpen,
|
|
@@ -6637,10 +6682,14 @@ function TimePicker({
|
|
|
6637
6682
|
ref,
|
|
6638
6683
|
...props
|
|
6639
6684
|
}) {
|
|
6685
|
+
const lang = useLanguage();
|
|
6686
|
+
if (!lang) {
|
|
6687
|
+
throw new Error("DatePicker must be used within a DdsProvider");
|
|
6688
|
+
}
|
|
6640
6689
|
const internalRef = useRef18(null);
|
|
6641
6690
|
const state = useTimeFieldState({
|
|
6642
6691
|
...props,
|
|
6643
|
-
locale
|
|
6692
|
+
locale: LOCALE[lang]
|
|
6644
6693
|
});
|
|
6645
6694
|
const { labelProps, fieldProps } = useTimeField(
|
|
6646
6695
|
{ ...props, hideTimeZone: true, granularity: "hour" },
|
|
@@ -7909,22 +7958,31 @@ var FileUploader_default = {
|
|
|
7909
7958
|
"input-container": "FileUploader_input-container",
|
|
7910
7959
|
"input-container--with-errors": "FileUploader_input-container--with-errors",
|
|
7911
7960
|
"input-container--drag-active": "FileUploader_input-container--drag-active",
|
|
7912
|
-
"input-container--no-drag-zone": "FileUploader_input-container--no-drag-zone",
|
|
7913
7961
|
"file--invalid": "FileUploader_file--invalid",
|
|
7914
7962
|
"file__icon--invalid": "FileUploader_file__icon--invalid",
|
|
7915
7963
|
"file__icon--valid": "FileUploader_file__icon--valid",
|
|
7916
|
-
file__name: "FileUploader_file__name"
|
|
7964
|
+
file__name: "FileUploader_file__name",
|
|
7965
|
+
"readonly--file-list": "FileUploader_readonly--file-list"
|
|
7917
7966
|
};
|
|
7918
7967
|
|
|
7919
7968
|
// src/components/FileUploader/File.tsx
|
|
7920
|
-
import { jsx as jsx259, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
7969
|
+
import { Fragment as Fragment6, jsx as jsx259, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
7921
7970
|
var File = (props) => {
|
|
7922
7971
|
const { t } = useTranslation();
|
|
7923
|
-
const {
|
|
7972
|
+
const {
|
|
7973
|
+
parentId,
|
|
7974
|
+
index,
|
|
7975
|
+
file: stateFile,
|
|
7976
|
+
removeFile,
|
|
7977
|
+
isValid,
|
|
7978
|
+
disabled,
|
|
7979
|
+
readOnly
|
|
7980
|
+
} = props;
|
|
7924
7981
|
const errorsList = stateFile.errors.map((e, errorIndex) => ({
|
|
7925
7982
|
id: derivativeIdGenerator(parentId, `file-${index}-error-${errorIndex}`),
|
|
7926
7983
|
message: e
|
|
7927
7984
|
}));
|
|
7985
|
+
const inactive = disabled || readOnly;
|
|
7928
7986
|
return /* @__PURE__ */ jsxs58("li", { children: [
|
|
7929
7987
|
/* @__PURE__ */ jsxs58(
|
|
7930
7988
|
Paper,
|
|
@@ -7935,42 +7993,46 @@ var File = (props) => {
|
|
|
7935
7993
|
gap: "x0.75",
|
|
7936
7994
|
marginBlock: "x0.5 0",
|
|
7937
7995
|
padding: "x0.5 x1",
|
|
7938
|
-
border: isValid ? "border-default" : "border-danger",
|
|
7939
|
-
background: "surface-subtle",
|
|
7996
|
+
border: disabled ? "border-subtle" : isValid ? "border-default" : "border-danger",
|
|
7997
|
+
background: inactive ? "surface-field-disabled" : "surface-subtle",
|
|
7940
7998
|
className: cn(!isValid && FileUploader_default["file--invalid"]),
|
|
7941
7999
|
children: [
|
|
7942
8000
|
/* @__PURE__ */ jsx259(
|
|
7943
|
-
|
|
8001
|
+
Typography,
|
|
7944
8002
|
{
|
|
7945
|
-
|
|
8003
|
+
as: "span",
|
|
8004
|
+
color: disabled ? "text-subtle" : readOnly ? "text-medium" : void 0,
|
|
8005
|
+
className: cn(FileUploader_default.file__name),
|
|
7946
8006
|
children: stateFile.file.name
|
|
7947
8007
|
}
|
|
7948
8008
|
),
|
|
7949
|
-
/* @__PURE__ */
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
),
|
|
7956
|
-
/* @__PURE__ */ jsx259(
|
|
7957
|
-
Button,
|
|
7958
|
-
{
|
|
7959
|
-
size: "small",
|
|
7960
|
-
purpose: "tertiary",
|
|
7961
|
-
type: "button",
|
|
7962
|
-
onClick: removeFile,
|
|
7963
|
-
icon: CloseIcon,
|
|
7964
|
-
htmlProps: {
|
|
7965
|
-
"aria-label": t(texts13.removeFile(stateFile.file.name)),
|
|
7966
|
-
"aria-invalid": !isValid ? true : void 0,
|
|
7967
|
-
"aria-errormessage": !isValid ? t(texts13.invalidFile) : void 0,
|
|
7968
|
-
"aria-describedby": spaceSeparatedIdListGenerator(
|
|
7969
|
-
errorsList.map((e) => e.id)
|
|
7970
|
-
)
|
|
8009
|
+
!inactive && /* @__PURE__ */ jsxs58(Fragment6, { children: [
|
|
8010
|
+
/* @__PURE__ */ jsx259(
|
|
8011
|
+
Icon,
|
|
8012
|
+
{
|
|
8013
|
+
icon: isValid ? CheckCircledIcon : ErrorIcon,
|
|
8014
|
+
className: FileUploader_default[`file__icon--${isValid ? "valid" : "invalid"}`]
|
|
7971
8015
|
}
|
|
7972
|
-
|
|
7973
|
-
|
|
8016
|
+
),
|
|
8017
|
+
/* @__PURE__ */ jsx259(
|
|
8018
|
+
Button,
|
|
8019
|
+
{
|
|
8020
|
+
size: "small",
|
|
8021
|
+
purpose: "tertiary",
|
|
8022
|
+
type: "button",
|
|
8023
|
+
onClick: removeFile,
|
|
8024
|
+
icon: CloseIcon,
|
|
8025
|
+
htmlProps: {
|
|
8026
|
+
"aria-label": t(texts13.removeFile(stateFile.file.name)),
|
|
8027
|
+
"aria-invalid": !isValid ? true : void 0,
|
|
8028
|
+
"aria-errormessage": !isValid ? t(texts13.invalidFile) : void 0,
|
|
8029
|
+
"aria-describedby": spaceSeparatedIdListGenerator(
|
|
8030
|
+
errorsList.map((e) => e.id)
|
|
8031
|
+
)
|
|
8032
|
+
}
|
|
8033
|
+
}
|
|
8034
|
+
)
|
|
8035
|
+
] })
|
|
7974
8036
|
]
|
|
7975
8037
|
}
|
|
7976
8038
|
),
|
|
@@ -8071,14 +8133,12 @@ var isEventWithFiles = (event) => {
|
|
|
8071
8133
|
var isFileAccepted = (file, accept) => {
|
|
8072
8134
|
return accept !== void 0 ? isAccepted(file, accept) : true;
|
|
8073
8135
|
};
|
|
8074
|
-
var getTooManyFilesErrorMessage = (maxFiles) => `For mange filer, maks ${maxFiles}stk`;
|
|
8075
|
-
var getInvalidFileTypeErrorMessage = () => "Ugyldig filtype";
|
|
8076
8136
|
|
|
8077
8137
|
// src/components/FileUploader/useFileUploader.ts
|
|
8078
|
-
var calcRootErrors = (files, maxFiles, errorMessage) => {
|
|
8138
|
+
var calcRootErrors = (maxFilesErrorMessage, files, maxFiles, errorMessage) => {
|
|
8079
8139
|
const errors = [];
|
|
8080
8140
|
if (maxFiles && maxFiles >= 1 && files.length > maxFiles) {
|
|
8081
|
-
errors.push(
|
|
8141
|
+
errors.push(maxFilesErrorMessage + maxFiles);
|
|
8082
8142
|
}
|
|
8083
8143
|
if (errorMessage) {
|
|
8084
8144
|
errors.push(errorMessage);
|
|
@@ -8090,11 +8150,14 @@ var useFileUploader = (props) => {
|
|
|
8090
8150
|
initialFiles,
|
|
8091
8151
|
value,
|
|
8092
8152
|
onChange,
|
|
8153
|
+
onKeyDown,
|
|
8093
8154
|
accept,
|
|
8094
8155
|
maxFiles,
|
|
8095
8156
|
disabled,
|
|
8157
|
+
readOnly,
|
|
8096
8158
|
errorMessage
|
|
8097
8159
|
} = props;
|
|
8160
|
+
const { t } = useTranslation();
|
|
8098
8161
|
const rootRef = useRef23(null);
|
|
8099
8162
|
const inputRef = useRef23(null);
|
|
8100
8163
|
const buttonRef = useRef23(null);
|
|
@@ -8112,6 +8175,7 @@ var useFileUploader = (props) => {
|
|
|
8112
8175
|
isFileDialogActive: false,
|
|
8113
8176
|
isDragActive: false,
|
|
8114
8177
|
rootErrors: calcRootErrors(
|
|
8178
|
+
t(texts14.invalidFileAmount),
|
|
8115
8179
|
initialFileUploaderFiles,
|
|
8116
8180
|
maxFiles,
|
|
8117
8181
|
errorMessage
|
|
@@ -8124,7 +8188,7 @@ var useFileUploader = (props) => {
|
|
|
8124
8188
|
const accepted = isFileAccepted(file, accept);
|
|
8125
8189
|
return {
|
|
8126
8190
|
file,
|
|
8127
|
-
errors: accepted ? [] : [
|
|
8191
|
+
errors: accepted ? [] : [t(texts14.invalidFileType)]
|
|
8128
8192
|
};
|
|
8129
8193
|
});
|
|
8130
8194
|
dispatch({
|
|
@@ -8136,7 +8200,12 @@ var useFileUploader = (props) => {
|
|
|
8136
8200
|
useEffect23(() => {
|
|
8137
8201
|
dispatch({
|
|
8138
8202
|
type: "setRootErrors",
|
|
8139
|
-
payload: calcRootErrors(
|
|
8203
|
+
payload: calcRootErrors(
|
|
8204
|
+
t(texts14.invalidFileAmount),
|
|
8205
|
+
stateFiles,
|
|
8206
|
+
maxFiles,
|
|
8207
|
+
errorMessage
|
|
8208
|
+
)
|
|
8140
8209
|
});
|
|
8141
8210
|
}, [dispatch, stateFiles, maxFiles, errorMessage]);
|
|
8142
8211
|
const onRootFocus = useCallback6(
|
|
@@ -8186,7 +8255,7 @@ var useFileUploader = (props) => {
|
|
|
8186
8255
|
const accepted = isFileAccepted(file, accept);
|
|
8187
8256
|
return {
|
|
8188
8257
|
file,
|
|
8189
|
-
errors: accepted ? [] : [
|
|
8258
|
+
errors: accepted ? [] : [t(texts14.invalidFileType)]
|
|
8190
8259
|
};
|
|
8191
8260
|
}).concat(stateFiles);
|
|
8192
8261
|
onChange(newFiles.map((f) => f.file));
|
|
@@ -8258,10 +8327,13 @@ var useFileUploader = (props) => {
|
|
|
8258
8327
|
const getInputProps = useCallback6(
|
|
8259
8328
|
() => ({
|
|
8260
8329
|
type: "file",
|
|
8261
|
-
|
|
8262
|
-
tabIndex: -1,
|
|
8330
|
+
tabIndex: readOnly ? void 0 : -1,
|
|
8263
8331
|
ref: inputRef,
|
|
8264
|
-
|
|
8332
|
+
disabled,
|
|
8333
|
+
"aria-hidden": readOnly ? void 0 : true,
|
|
8334
|
+
onChange: readOnlyChangeHandler(readOnly, setFiles),
|
|
8335
|
+
onKeyDown: readOnlyKeyDownHandler("file", readOnly, onKeyDown),
|
|
8336
|
+
readOnly,
|
|
8265
8337
|
multiple: !maxFiles || maxFiles > 1,
|
|
8266
8338
|
...accept ? { accept: accept.join(",") } : {}
|
|
8267
8339
|
}),
|
|
@@ -8275,6 +8347,20 @@ var useFileUploader = (props) => {
|
|
|
8275
8347
|
removeFile
|
|
8276
8348
|
};
|
|
8277
8349
|
};
|
|
8350
|
+
var texts14 = createTexts({
|
|
8351
|
+
invalidFileType: {
|
|
8352
|
+
nb: "Ugyldig filtype",
|
|
8353
|
+
no: "Ugyldig filtype",
|
|
8354
|
+
nn: "Ugyldig filtype",
|
|
8355
|
+
en: "Invalid file type"
|
|
8356
|
+
},
|
|
8357
|
+
invalidFileAmount: {
|
|
8358
|
+
nb: "For mange filer. Maksimalt antall er ",
|
|
8359
|
+
no: "For mange filer. Maksimalt antall er ",
|
|
8360
|
+
nn: "For mange filer. Maksimalt antall er ",
|
|
8361
|
+
en: "Too many files. The maximum allowed is "
|
|
8362
|
+
}
|
|
8363
|
+
});
|
|
8278
8364
|
|
|
8279
8365
|
// src/components/FileUploader/FileUploader.tsx
|
|
8280
8366
|
import { jsx as jsx260, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
@@ -8292,7 +8378,9 @@ var FileUploader = (props) => {
|
|
|
8292
8378
|
accept,
|
|
8293
8379
|
maxFiles,
|
|
8294
8380
|
disabled,
|
|
8381
|
+
readOnly,
|
|
8295
8382
|
onChange,
|
|
8383
|
+
onKeyDown,
|
|
8296
8384
|
width = "var(--dds-input-default-width)",
|
|
8297
8385
|
errorMessage,
|
|
8298
8386
|
hideFileList,
|
|
@@ -8300,7 +8388,7 @@ var FileUploader = (props) => {
|
|
|
8300
8388
|
...rest
|
|
8301
8389
|
} = props;
|
|
8302
8390
|
const { t } = useTranslation();
|
|
8303
|
-
const tDropAreaLabel = dropAreaLabel != null ? dropAreaLabel : t(
|
|
8391
|
+
const tDropAreaLabel = dropAreaLabel != null ? dropAreaLabel : t(texts15.dragAndDropOr);
|
|
8304
8392
|
const generatedId = useId14();
|
|
8305
8393
|
const uniqueId = id != null ? id : `${generatedId}-fileUploader`;
|
|
8306
8394
|
const {
|
|
@@ -8316,16 +8404,21 @@ var FileUploader = (props) => {
|
|
|
8316
8404
|
onChange,
|
|
8317
8405
|
accept,
|
|
8318
8406
|
disabled,
|
|
8407
|
+
readOnly,
|
|
8319
8408
|
maxFiles,
|
|
8320
|
-
errorMessage
|
|
8409
|
+
errorMessage,
|
|
8410
|
+
onKeyDown
|
|
8321
8411
|
});
|
|
8322
8412
|
const hasLabel = label !== void 0;
|
|
8323
8413
|
const hasTip = tip !== void 0;
|
|
8324
8414
|
const hasRootErrors = rootErrors.length > 0;
|
|
8415
|
+
const inactive = disabled || readOnly;
|
|
8325
8416
|
const labelId = derivativeIdGenerator(uniqueId, "label");
|
|
8326
8417
|
const tipId = derivativeIdGenerator(uniqueId, "tip");
|
|
8327
8418
|
const buttonId = derivativeIdGenerator(uniqueId, "button");
|
|
8328
8419
|
const inputId = derivativeIdGenerator(uniqueId, "input");
|
|
8420
|
+
const fileListId = derivativeIdGenerator(uniqueId, "file-list");
|
|
8421
|
+
const fileListNameId = derivativeIdGenerator(uniqueId, "file-list-name");
|
|
8329
8422
|
const fileListElements = stateFiles.map((stateFile, index) => /* @__PURE__ */ jsx260(
|
|
8330
8423
|
File,
|
|
8331
8424
|
{
|
|
@@ -8333,7 +8426,9 @@ var FileUploader = (props) => {
|
|
|
8333
8426
|
index,
|
|
8334
8427
|
file: stateFile,
|
|
8335
8428
|
isValid: stateFile.errors.length === 0,
|
|
8336
|
-
removeFile: () => removeFile(stateFile)
|
|
8429
|
+
removeFile: () => removeFile(stateFile),
|
|
8430
|
+
disabled,
|
|
8431
|
+
readOnly
|
|
8337
8432
|
},
|
|
8338
8433
|
stateFile.file.name
|
|
8339
8434
|
));
|
|
@@ -8361,6 +8456,16 @@ var FileUploader = (props) => {
|
|
|
8361
8456
|
children: btnLabel
|
|
8362
8457
|
}
|
|
8363
8458
|
);
|
|
8459
|
+
const input = /* @__PURE__ */ jsx260(
|
|
8460
|
+
HiddenInput,
|
|
8461
|
+
{
|
|
8462
|
+
...getInputProps(),
|
|
8463
|
+
className: cn(readOnly && focus_default["focusable-sibling"]),
|
|
8464
|
+
id: inputId,
|
|
8465
|
+
"data-testid": "file-uploader-input",
|
|
8466
|
+
"aria-describedby": fileListId
|
|
8467
|
+
}
|
|
8468
|
+
);
|
|
8364
8469
|
return /* @__PURE__ */ jsxs59(
|
|
8365
8470
|
Box,
|
|
8366
8471
|
{
|
|
@@ -8373,10 +8478,11 @@ var FileUploader = (props) => {
|
|
|
8373
8478
|
label,
|
|
8374
8479
|
id: labelId,
|
|
8375
8480
|
showRequiredStyling: required,
|
|
8376
|
-
htmlFor: inputId
|
|
8481
|
+
htmlFor: inputId,
|
|
8482
|
+
readOnly
|
|
8377
8483
|
}),
|
|
8378
8484
|
hasTip && /* @__PURE__ */ jsx260(InputMessage, { id: tipId, message: tip, messageType: "tip" }),
|
|
8379
|
-
withDragAndDrop ? /* @__PURE__ */ jsxs59(
|
|
8485
|
+
inactive ? input : withDragAndDrop ? /* @__PURE__ */ jsxs59(
|
|
8380
8486
|
VStack,
|
|
8381
8487
|
{
|
|
8382
8488
|
gap: "x1",
|
|
@@ -8388,31 +8494,45 @@ var FileUploader = (props) => {
|
|
|
8388
8494
|
isDragActive && FileUploader_default["input-container--drag-active"]
|
|
8389
8495
|
),
|
|
8390
8496
|
children: [
|
|
8391
|
-
|
|
8392
|
-
"input",
|
|
8393
|
-
{
|
|
8394
|
-
...getInputProps(),
|
|
8395
|
-
id: inputId,
|
|
8396
|
-
"data-testid": "file-uploader-input"
|
|
8397
|
-
}
|
|
8398
|
-
),
|
|
8497
|
+
input,
|
|
8399
8498
|
tDropAreaLabel,
|
|
8400
|
-
/* @__PURE__ */ jsx260(VisuallyHidden, { children: t(
|
|
8499
|
+
/* @__PURE__ */ jsx260(VisuallyHidden, { children: t(texts15.uploadFileWithButton) }),
|
|
8401
8500
|
button
|
|
8402
8501
|
]
|
|
8403
8502
|
}
|
|
8404
|
-
) : /* @__PURE__ */ jsxs59(
|
|
8405
|
-
|
|
8503
|
+
) : /* @__PURE__ */ jsxs59(Box, { padding: "x 0", children: [
|
|
8504
|
+
input,
|
|
8406
8505
|
button
|
|
8407
8506
|
] }),
|
|
8408
8507
|
/* @__PURE__ */ jsx260(ErrorList, { errors: rootErrorsList }),
|
|
8409
|
-
!hideFileList && /* @__PURE__ */
|
|
8508
|
+
!hideFileList && /* @__PURE__ */ jsxs59(
|
|
8509
|
+
"div",
|
|
8510
|
+
{
|
|
8511
|
+
id: fileListId,
|
|
8512
|
+
className: cn(
|
|
8513
|
+
readOnly && focus_default["focus-styled-sibling"],
|
|
8514
|
+
readOnly && FileUploader_default["readonly--file-list"]
|
|
8515
|
+
),
|
|
8516
|
+
children: [
|
|
8517
|
+
/* @__PURE__ */ jsx260(VisuallyHidden, { id: fileListNameId, children: t(texts15.uploadedFiles) }),
|
|
8518
|
+
inactive && fileListElements.length === 0 ? /* @__PURE__ */ jsx260(
|
|
8519
|
+
Typography,
|
|
8520
|
+
{
|
|
8521
|
+
italic: true,
|
|
8522
|
+
as: "span",
|
|
8523
|
+
color: disabled ? "text-subtle" : "text-medium",
|
|
8524
|
+
children: t(texts15.noFiles)
|
|
8525
|
+
}
|
|
8526
|
+
) : /* @__PURE__ */ jsx260(StylelessList, { "aria-labelledby": fileListNameId, children: fileListElements })
|
|
8527
|
+
]
|
|
8528
|
+
}
|
|
8529
|
+
)
|
|
8410
8530
|
]
|
|
8411
8531
|
}
|
|
8412
8532
|
);
|
|
8413
8533
|
};
|
|
8414
8534
|
FileUploader.displayName = "FileUploader";
|
|
8415
|
-
var
|
|
8535
|
+
var texts15 = createTexts({
|
|
8416
8536
|
dragAndDropOr: {
|
|
8417
8537
|
nb: "Dra og slipp filer her eller",
|
|
8418
8538
|
no: "Dra og slipp filer her eller",
|
|
@@ -8424,6 +8544,18 @@ var texts14 = createTexts({
|
|
|
8424
8544
|
no: "last opp en fil med den p\xE5f\xF8lgende knappen",
|
|
8425
8545
|
nn: "last opp ei fil med den p\xE5f\xF8lgjande knappen",
|
|
8426
8546
|
en: "upload using the following button"
|
|
8547
|
+
},
|
|
8548
|
+
noFiles: {
|
|
8549
|
+
nb: "Ingen filer.",
|
|
8550
|
+
no: "Ingen filer.",
|
|
8551
|
+
nn: "Ingen filer.",
|
|
8552
|
+
en: "No files."
|
|
8553
|
+
},
|
|
8554
|
+
uploadedFiles: {
|
|
8555
|
+
nb: "Opplastede filer",
|
|
8556
|
+
no: "Opplastede filer",
|
|
8557
|
+
nn: "Opplasta filer",
|
|
8558
|
+
en: "Uploaded files"
|
|
8427
8559
|
}
|
|
8428
8560
|
});
|
|
8429
8561
|
|
|
@@ -8694,11 +8826,11 @@ import { jsxs as jsxs61 } from "react/jsx-runtime";
|
|
|
8694
8826
|
var inlineEditVisuallyHidden = (id, clearable) => {
|
|
8695
8827
|
const { t } = useTranslation();
|
|
8696
8828
|
return /* @__PURE__ */ jsxs61(VisuallyHidden, { id, children: [
|
|
8697
|
-
t(
|
|
8698
|
-
!clearable && t(
|
|
8829
|
+
t(texts16.inlineEditInfo),
|
|
8830
|
+
!clearable && t(texts16.notClearable)
|
|
8699
8831
|
] });
|
|
8700
8832
|
};
|
|
8701
|
-
var
|
|
8833
|
+
var texts16 = createTexts({
|
|
8702
8834
|
inlineEditInfo: {
|
|
8703
8835
|
nb: "Escape, Enter eller Tab for \xE5 lagre.",
|
|
8704
8836
|
no: "Escape, Enter eller Tab for \xE5 lagre.",
|
|
@@ -8759,7 +8891,7 @@ function createClearChangeEvent(elementId) {
|
|
|
8759
8891
|
}
|
|
8760
8892
|
|
|
8761
8893
|
// src/components/InlineEdit/InlineField.tsx
|
|
8762
|
-
import { Fragment as
|
|
8894
|
+
import { Fragment as Fragment7, jsx as jsx272, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
8763
8895
|
function InlineField(props) {
|
|
8764
8896
|
const {
|
|
8765
8897
|
elementType,
|
|
@@ -8840,7 +8972,7 @@ function InlineField(props) {
|
|
|
8840
8972
|
}
|
|
8841
8973
|
);
|
|
8842
8974
|
case "select":
|
|
8843
|
-
return /* @__PURE__ */ jsxs62(
|
|
8975
|
+
return /* @__PURE__ */ jsxs62(Fragment7, { children: [
|
|
8844
8976
|
/* @__PURE__ */ jsx272(
|
|
8845
8977
|
"select",
|
|
8846
8978
|
{
|
|
@@ -9027,7 +9159,7 @@ var InternalHeader = (props) => {
|
|
|
9027
9159
|
const hasContextMenuElements = !!contextMenuItems && contextMenuItems.length > 0;
|
|
9028
9160
|
const hasSmallScreenBreakpoint = !!smallScreenBreakpoint;
|
|
9029
9161
|
const hasNavInContextMenu = hasSmallScreenBreakpoint && hasNavigationElements;
|
|
9030
|
-
const navigation = hasNavigationElements ? /* @__PURE__ */ jsx277("nav", { "aria-label": t(
|
|
9162
|
+
const navigation = hasNavigationElements ? /* @__PURE__ */ jsx277("nav", { "aria-label": t(texts17.siteNavigation), children: /* @__PURE__ */ jsx277(
|
|
9031
9163
|
ShowHide,
|
|
9032
9164
|
{
|
|
9033
9165
|
as: StylelessList,
|
|
@@ -9091,7 +9223,7 @@ var InternalHeader = (props) => {
|
|
|
9091
9223
|
{
|
|
9092
9224
|
icon: hasNavInContextMenu ? MenuIcon : MoreVerticalIcon,
|
|
9093
9225
|
purpose: "tertiary",
|
|
9094
|
-
"aria-label": t(
|
|
9226
|
+
"aria-label": t(texts17.openMenu)
|
|
9095
9227
|
}
|
|
9096
9228
|
),
|
|
9097
9229
|
/* @__PURE__ */ jsxs63(OverflowMenu, { className: InternalHeader_default["context-menu"], children: [
|
|
@@ -9100,7 +9232,7 @@ var InternalHeader = (props) => {
|
|
|
9100
9232
|
ShowHide,
|
|
9101
9233
|
{
|
|
9102
9234
|
as: "nav",
|
|
9103
|
-
"aria-label": t(
|
|
9235
|
+
"aria-label": t(texts17.siteNavigation),
|
|
9104
9236
|
showBelow: smallScreenBreakpoint,
|
|
9105
9237
|
children: /* @__PURE__ */ jsx277(OverflowMenuList, { children: navItems.map((item, i) => /* @__PURE__ */ createElement2(OverflowMenuLink, { ...item, key: `nav-${i}` })) })
|
|
9106
9238
|
}
|
|
@@ -9136,7 +9268,7 @@ var InternalHeader = (props) => {
|
|
|
9136
9268
|
);
|
|
9137
9269
|
};
|
|
9138
9270
|
InternalHeader.displayName = "InternalHeader";
|
|
9139
|
-
var
|
|
9271
|
+
var texts17 = createTexts({
|
|
9140
9272
|
openMenu: {
|
|
9141
9273
|
nb: "\xC5pne meny",
|
|
9142
9274
|
no: "\xC5pne meny",
|
|
@@ -9214,7 +9346,7 @@ var LocalMessage_default = {
|
|
|
9214
9346
|
};
|
|
9215
9347
|
|
|
9216
9348
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
9217
|
-
import { Fragment as
|
|
9349
|
+
import { Fragment as Fragment8, jsx as jsx280, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
9218
9350
|
var icons2 = {
|
|
9219
9351
|
info: InfoIcon,
|
|
9220
9352
|
danger: ErrorIcon,
|
|
@@ -9238,7 +9370,7 @@ var LocalMessage = ({
|
|
|
9238
9370
|
const { t } = useTranslation();
|
|
9239
9371
|
const [isClosed, setClosed] = useState20(false);
|
|
9240
9372
|
if (isClosed) {
|
|
9241
|
-
return /* @__PURE__ */ jsx280(
|
|
9373
|
+
return /* @__PURE__ */ jsx280(Fragment8, {});
|
|
9242
9374
|
}
|
|
9243
9375
|
return /* @__PURE__ */ jsxs64(
|
|
9244
9376
|
Box,
|
|
@@ -9757,7 +9889,7 @@ var getCustomStyles = (size2, hasError, hasIcon, isReadOnly) => ({
|
|
|
9757
9889
|
cursor: "pointer",
|
|
9758
9890
|
display: "flex",
|
|
9759
9891
|
alignItems: "center",
|
|
9760
|
-
gap: "var(--dds-spacing-x0-
|
|
9892
|
+
gap: "var(--dds-spacing-x0-25)",
|
|
9761
9893
|
padding: "var(--dds-spacing-x0-75)",
|
|
9762
9894
|
backgroundColor: "var(--dds-color-surface-default)",
|
|
9763
9895
|
...typography.option[size2],
|
|
@@ -9825,10 +9957,9 @@ var getIndicatorIconSize = (componentSize) => {
|
|
|
9825
9957
|
}
|
|
9826
9958
|
};
|
|
9827
9959
|
var DDSOption = ({
|
|
9828
|
-
componentSize,
|
|
9829
9960
|
...props
|
|
9830
9961
|
}) => /* @__PURE__ */ jsxs66(Option, { ...props, children: [
|
|
9831
|
-
props.isSelected && /* @__PURE__ */ jsx284(Icon, { icon: CheckIcon, iconSize:
|
|
9962
|
+
props.isSelected && /* @__PURE__ */ jsx284(Icon, { icon: CheckIcon, iconSize: "small" }),
|
|
9832
9963
|
props.children
|
|
9833
9964
|
] });
|
|
9834
9965
|
var CustomOption = (props) => /* @__PURE__ */ jsx284(Option, { ...props, children: React.createElement(props.customElement, props) });
|
|
@@ -10019,7 +10150,7 @@ function Select({
|
|
|
10019
10150
|
if (customOptionElement) {
|
|
10020
10151
|
return /* @__PURE__ */ jsx285(CustomOption, { ...props, customElement: customOptionElement });
|
|
10021
10152
|
} else {
|
|
10022
|
-
return /* @__PURE__ */ jsx285(DDSOption, { ...props
|
|
10153
|
+
return /* @__PURE__ */ jsx285(DDSOption, { ...props });
|
|
10023
10154
|
}
|
|
10024
10155
|
},
|
|
10025
10156
|
[customOptionElement, componentSize]
|
|
@@ -10254,6 +10385,7 @@ var Pagination = ({
|
|
|
10254
10385
|
itemsAmount,
|
|
10255
10386
|
defaultItemsPerPage = 10,
|
|
10256
10387
|
defaultActivePage = 1,
|
|
10388
|
+
activePage: activePageProp,
|
|
10257
10389
|
withPagination = true,
|
|
10258
10390
|
withCounter,
|
|
10259
10391
|
withSelect,
|
|
@@ -10273,7 +10405,15 @@ var Pagination = ({
|
|
|
10273
10405
|
...rest
|
|
10274
10406
|
}) => {
|
|
10275
10407
|
const { t } = useTranslation();
|
|
10276
|
-
|
|
10408
|
+
if (withSelect && !selectOptions.some((o) => o.value === defaultItemsPerPage)) {
|
|
10409
|
+
console.warn(
|
|
10410
|
+
`[Pagination] defaultItemsPerPage prop value (${defaultItemsPerPage}) is not included in customOptions prop. Please add it to ensure it appears in the dropdown.`
|
|
10411
|
+
);
|
|
10412
|
+
}
|
|
10413
|
+
const [activePage, setActivePage] = useControllableState({
|
|
10414
|
+
value: activePageProp,
|
|
10415
|
+
defaultValue: defaultActivePage
|
|
10416
|
+
});
|
|
10277
10417
|
const [itemsPerPage, setItemsPerPage] = useState22(defaultItemsPerPage);
|
|
10278
10418
|
const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
|
|
10279
10419
|
const items = PaginationGenerator(pagesLength, activePage);
|
|
@@ -10301,7 +10441,7 @@ var Pagination = ({
|
|
|
10301
10441
|
onClick: (event) => {
|
|
10302
10442
|
onPageChange(event, item);
|
|
10303
10443
|
},
|
|
10304
|
-
"aria-label": isActive ? t(
|
|
10444
|
+
"aria-label": isActive ? t(texts18.currentPage(item)) : t(texts18.page(item)),
|
|
10305
10445
|
children: item
|
|
10306
10446
|
}
|
|
10307
10447
|
) : /* @__PURE__ */ jsx287(
|
|
@@ -10321,7 +10461,7 @@ var Pagination = ({
|
|
|
10321
10461
|
onClick: (event) => {
|
|
10322
10462
|
onPageChange(event, activePage - 1);
|
|
10323
10463
|
},
|
|
10324
|
-
"aria-label": t(
|
|
10464
|
+
"aria-label": t(texts18.previousPage)
|
|
10325
10465
|
}
|
|
10326
10466
|
);
|
|
10327
10467
|
const nextPageButton = /* @__PURE__ */ jsx287(
|
|
@@ -10333,7 +10473,7 @@ var Pagination = ({
|
|
|
10333
10473
|
onClick: (event) => {
|
|
10334
10474
|
onPageChange(event, activePage + 1);
|
|
10335
10475
|
},
|
|
10336
|
-
"aria-label": t(
|
|
10476
|
+
"aria-label": t(texts18.nextPage)
|
|
10337
10477
|
}
|
|
10338
10478
|
);
|
|
10339
10479
|
const isOnFirstPage = activePage === 1;
|
|
@@ -10343,7 +10483,7 @@ var Pagination = ({
|
|
|
10343
10483
|
{
|
|
10344
10484
|
as: "nav",
|
|
10345
10485
|
ref,
|
|
10346
|
-
"aria-label": t(
|
|
10486
|
+
"aria-label": t(texts18.pagination),
|
|
10347
10487
|
display: "flex",
|
|
10348
10488
|
alignItems: "center",
|
|
10349
10489
|
...!withSelect && !withCounter && {
|
|
@@ -10407,7 +10547,7 @@ var Pagination = ({
|
|
|
10407
10547
|
onClick: (event) => {
|
|
10408
10548
|
onPageChange(event, 1);
|
|
10409
10549
|
},
|
|
10410
|
-
"aria-label": t(
|
|
10550
|
+
"aria-label": t(texts18.firstPage)
|
|
10411
10551
|
}
|
|
10412
10552
|
)
|
|
10413
10553
|
}
|
|
@@ -10461,7 +10601,7 @@ var Pagination = ({
|
|
|
10461
10601
|
onClick: (event) => {
|
|
10462
10602
|
onPageChange(event, pagesLength);
|
|
10463
10603
|
},
|
|
10464
|
-
"aria-label": t(
|
|
10604
|
+
"aria-label": t(texts18.lastPage)
|
|
10465
10605
|
}
|
|
10466
10606
|
)
|
|
10467
10607
|
}
|
|
@@ -10491,7 +10631,7 @@ var Pagination = ({
|
|
|
10491
10631
|
{
|
|
10492
10632
|
options: selectOptions,
|
|
10493
10633
|
isSearchable: false,
|
|
10494
|
-
width: "
|
|
10634
|
+
width: "90px",
|
|
10495
10635
|
defaultValue: {
|
|
10496
10636
|
label: itemsPerPage.toString(),
|
|
10497
10637
|
value: itemsPerPage
|
|
@@ -10499,11 +10639,11 @@ var Pagination = ({
|
|
|
10499
10639
|
isClearable: false,
|
|
10500
10640
|
onChange: handleSelectChange,
|
|
10501
10641
|
componentSize: "small",
|
|
10502
|
-
"aria-label": t(
|
|
10642
|
+
"aria-label": t(texts18.itemsPerPage)
|
|
10503
10643
|
}
|
|
10504
10644
|
),
|
|
10505
10645
|
withCounter && /* @__PURE__ */ jsx287(Paragraph, { children: t(
|
|
10506
|
-
|
|
10646
|
+
texts18.showsAmountOfTotalItems(
|
|
10507
10647
|
activePageFirstItem,
|
|
10508
10648
|
activePageLastItem,
|
|
10509
10649
|
itemsAmount
|
|
@@ -10516,7 +10656,7 @@ var Pagination = ({
|
|
|
10516
10656
|
);
|
|
10517
10657
|
};
|
|
10518
10658
|
Pagination.displayName = "Pagination";
|
|
10519
|
-
var
|
|
10659
|
+
var texts18 = createTexts({
|
|
10520
10660
|
pagination: {
|
|
10521
10661
|
nb: "Paginering",
|
|
10522
10662
|
no: "Paginering",
|
|
@@ -10660,12 +10800,12 @@ var COUNTRIES = {
|
|
|
10660
10800
|
CO: { name: "Colombia", id: "CO", dialCode: "+57" },
|
|
10661
10801
|
KM: { name: "Komorene (\u202B\u062C\u0632\u0631 \u0627\u0644\u0642\u0645\u0631\u202C\u200E)", id: "KM", dialCode: "+269" },
|
|
10662
10802
|
CD: {
|
|
10663
|
-
name: "Kongo
|
|
10803
|
+
name: "Kongo, den demokratiske republikken (R\xE9publique d\xE9mocratique du Congo)",
|
|
10664
10804
|
id: "CD",
|
|
10665
10805
|
dialCode: "+243"
|
|
10666
10806
|
},
|
|
10667
10807
|
CG: {
|
|
10668
|
-
name: "Kongo (
|
|
10808
|
+
name: "Kongo, republikken (R\xE9publique du Congo)",
|
|
10669
10809
|
id: "CG",
|
|
10670
10810
|
dialCode: "+242"
|
|
10671
10811
|
},
|
|
@@ -10743,7 +10883,7 @@ var COUNTRIES = {
|
|
|
10743
10883
|
IR: { name: "Iran (\u202B\u0627\u06CC\u0631\u0627\u0646\u202C\u200E)", id: "IR", dialCode: "+98" },
|
|
10744
10884
|
IQ: { name: "Irak (\u202B\u0627\u0644\u0639\u0631\u0627\u0642\u202C\u200E)", id: "IQ", dialCode: "+964" },
|
|
10745
10885
|
IE: { name: "Irland (\xC9ire)", id: "IE", dialCode: "+353" },
|
|
10746
|
-
IM: { name: "Isle of Man", id: "IM", dialCode: "+44" },
|
|
10886
|
+
IM: { name: "Man (Isle of Man)", id: "IM", dialCode: "+44" },
|
|
10747
10887
|
IL: { name: "Israel (\u202B\u05D9\u05E9\u05E8\u05D0\u05DC\u202C\u200E)", id: "IL", dialCode: "+972" },
|
|
10748
10888
|
IT: { name: "Italia", id: "IT", dialCode: "+39" },
|
|
10749
10889
|
JM: { name: "Jamaica", id: "JM", dialCode: "+1" },
|
|
@@ -10767,7 +10907,7 @@ var COUNTRIES = {
|
|
|
10767
10907
|
LU: { name: "Luxembourg", id: "LU", dialCode: "+352" },
|
|
10768
10908
|
MO: { name: "Macao (\u6FB3\u9580)", id: "MO", dialCode: "+853" },
|
|
10769
10909
|
MK: {
|
|
10770
|
-
name: "Nord-Makedonia (
|
|
10910
|
+
name: "Nord-Makedonia (\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0438\u0458\u0430)",
|
|
10771
10911
|
id: "MK",
|
|
10772
10912
|
dialCode: "+389"
|
|
10773
10913
|
},
|
|
@@ -10856,7 +10996,7 @@ var COUNTRIES = {
|
|
|
10856
10996
|
},
|
|
10857
10997
|
LC: { name: "Saint Lucia", id: "LC", dialCode: "+1758" },
|
|
10858
10998
|
MF: {
|
|
10859
|
-
name: "Saint
|
|
10999
|
+
name: "Saint-Martin (Collectivit\xE9 de Saint-Martin)",
|
|
10860
11000
|
id: "MF",
|
|
10861
11001
|
dialCode: "+590"
|
|
10862
11002
|
},
|
|
@@ -11039,8 +11179,8 @@ var PhoneInput = ({
|
|
|
11039
11179
|
}) => {
|
|
11040
11180
|
var _a;
|
|
11041
11181
|
const { t } = useTranslation();
|
|
11042
|
-
const tGroupLabel = groupLabel != null ? groupLabel : t(
|
|
11043
|
-
const tSelectLabel = selectLabel != null ? selectLabel : t(
|
|
11182
|
+
const tGroupLabel = groupLabel != null ? groupLabel : t(texts19.countryCodeAndPhoneNumber);
|
|
11183
|
+
const tSelectLabel = selectLabel != null ? selectLabel : t(texts19.countryCode);
|
|
11044
11184
|
const generatedId = useId19();
|
|
11045
11185
|
const uniqueId = (_a = props.id) != null ? _a : generatedId;
|
|
11046
11186
|
const phoneInputId = `${uniqueId}-phone-input`;
|
|
@@ -11213,7 +11353,7 @@ var getCallingCode = (s) => {
|
|
|
11213
11353
|
var _a;
|
|
11214
11354
|
return (_a = s.substring(s.indexOf("+"), s.length)) != null ? _a : "";
|
|
11215
11355
|
};
|
|
11216
|
-
var
|
|
11356
|
+
var texts19 = createTexts({
|
|
11217
11357
|
countryCode: {
|
|
11218
11358
|
nb: "Landskode",
|
|
11219
11359
|
no: "Landskode",
|
|
@@ -11526,7 +11666,7 @@ var ProgressTracker_default = {
|
|
|
11526
11666
|
|
|
11527
11667
|
// src/components/ProgressTracker/ProgressTrackerItem.tsx
|
|
11528
11668
|
import { useMemo as useMemo2 } from "react";
|
|
11529
|
-
import { Fragment as
|
|
11669
|
+
import { Fragment as Fragment9, jsx as jsx291, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
11530
11670
|
var toItemState = (active, completed, disabled) => {
|
|
11531
11671
|
if (disabled) {
|
|
11532
11672
|
return "disabled";
|
|
@@ -11558,6 +11698,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
11558
11698
|
...rest
|
|
11559
11699
|
} = props;
|
|
11560
11700
|
const { t } = useTranslation();
|
|
11701
|
+
const stepNumber = index + 1;
|
|
11561
11702
|
const { activeStep, handleStepChange, direction } = useProgressTrackerContext();
|
|
11562
11703
|
const active = activeStep === index;
|
|
11563
11704
|
const itemState = toItemState(active, completed, disabled);
|
|
@@ -11574,14 +11715,14 @@ var ProgressTrackerItem = (props) => {
|
|
|
11574
11715
|
if (icon !== void 0) {
|
|
11575
11716
|
return /* @__PURE__ */ jsx291(Icon, { icon, iconSize: "small" });
|
|
11576
11717
|
}
|
|
11577
|
-
return
|
|
11718
|
+
return stepNumber;
|
|
11578
11719
|
}, [completed, icon, index]);
|
|
11579
11720
|
function getTextColor2() {
|
|
11580
11721
|
if (disabled) return "text-subtle";
|
|
11581
11722
|
if (active) return "text-action-resting";
|
|
11582
11723
|
}
|
|
11583
11724
|
const isInactiveLink = disabled || active;
|
|
11584
|
-
const stepContent = /* @__PURE__ */ jsxs72(
|
|
11725
|
+
const stepContent = /* @__PURE__ */ jsxs72(Fragment9, { children: [
|
|
11585
11726
|
/* @__PURE__ */ jsx291(
|
|
11586
11727
|
Box,
|
|
11587
11728
|
{
|
|
@@ -11597,7 +11738,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
11597
11738
|
children: stepNumberContent
|
|
11598
11739
|
}
|
|
11599
11740
|
),
|
|
11600
|
-
/* @__PURE__ */
|
|
11741
|
+
/* @__PURE__ */ jsx291(
|
|
11601
11742
|
Typography,
|
|
11602
11743
|
{
|
|
11603
11744
|
as: "div",
|
|
@@ -11607,14 +11748,11 @@ var ProgressTrackerItem = (props) => {
|
|
|
11607
11748
|
isInactiveLink && ProgressTracker_default["item-text--inactive-link"]
|
|
11608
11749
|
),
|
|
11609
11750
|
color: getTextColor2(),
|
|
11610
|
-
children
|
|
11611
|
-
/* @__PURE__ */ jsx291(VisuallyHidden, { children: t(texts19.stepTextBefore(index + 1)) }),
|
|
11612
|
-
children,
|
|
11613
|
-
/* @__PURE__ */ jsx291(VisuallyHidden, { children: completed ? t(texts19.completed) : t(texts19.uncompleted) })
|
|
11614
|
-
]
|
|
11751
|
+
children
|
|
11615
11752
|
}
|
|
11616
11753
|
)
|
|
11617
11754
|
] });
|
|
11755
|
+
const ariaLabel = props["aria-label"] ? props["aria-label"] : `${children}, ${stepNumber}. ${completed ? t(texts20.completed) : t(texts20.uncompleted)}`;
|
|
11618
11756
|
return /* @__PURE__ */ jsx291(
|
|
11619
11757
|
Box,
|
|
11620
11758
|
{
|
|
@@ -11641,6 +11779,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
11641
11779
|
htmlProps,
|
|
11642
11780
|
rest
|
|
11643
11781
|
),
|
|
11782
|
+
"aria-label": ariaLabel,
|
|
11644
11783
|
onClick: () => handleClick(),
|
|
11645
11784
|
disabled,
|
|
11646
11785
|
children: stepContent
|
|
@@ -11654,6 +11793,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
11654
11793
|
htmlProps,
|
|
11655
11794
|
rest
|
|
11656
11795
|
),
|
|
11796
|
+
"aria-label": ariaLabel,
|
|
11657
11797
|
children: stepContent
|
|
11658
11798
|
}
|
|
11659
11799
|
)
|
|
@@ -11661,24 +11801,18 @@ var ProgressTrackerItem = (props) => {
|
|
|
11661
11801
|
);
|
|
11662
11802
|
};
|
|
11663
11803
|
ProgressTrackerItem.displayName = "ProgressTracker.Item";
|
|
11664
|
-
var
|
|
11665
|
-
stepTextBefore: (index) => ({
|
|
11666
|
-
nb: `${index}. trinn, `,
|
|
11667
|
-
no: `${index}. trinn, `,
|
|
11668
|
-
nn: `${index}. trinn, `,
|
|
11669
|
-
en: `${index}. step, `
|
|
11670
|
-
}),
|
|
11804
|
+
var texts20 = createTexts({
|
|
11671
11805
|
uncompleted: {
|
|
11672
|
-
nb: "
|
|
11673
|
-
no: "
|
|
11674
|
-
nn: "
|
|
11675
|
-
en: "uncompleted"
|
|
11806
|
+
nb: "trinn ikke ferdig",
|
|
11807
|
+
no: "trinn ikke ferdig",
|
|
11808
|
+
nn: "trinn ikkje ferdig",
|
|
11809
|
+
en: "step uncompleted"
|
|
11676
11810
|
},
|
|
11677
11811
|
completed: {
|
|
11678
|
-
nb: "
|
|
11679
|
-
no: "
|
|
11680
|
-
nn: "
|
|
11681
|
-
en: "
|
|
11812
|
+
nb: "trinn ferdig",
|
|
11813
|
+
no: "trinn ferdig",
|
|
11814
|
+
nn: "trinn ferdig",
|
|
11815
|
+
en: "step completed"
|
|
11682
11816
|
}
|
|
11683
11817
|
});
|
|
11684
11818
|
|
|
@@ -11724,7 +11858,7 @@ var ProgressTracker = (() => {
|
|
|
11724
11858
|
children: /* @__PURE__ */ jsx292(
|
|
11725
11859
|
"nav",
|
|
11726
11860
|
{
|
|
11727
|
-
"aria-label": ariaLabel != null ? ariaLabel : t(
|
|
11861
|
+
"aria-label": ariaLabel != null ? ariaLabel : t(texts21.stepProgression),
|
|
11728
11862
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
11729
11863
|
children: /* @__PURE__ */ jsx292(
|
|
11730
11864
|
Box,
|
|
@@ -11762,7 +11896,7 @@ function passIndexPropToProgressTrackerItem(children) {
|
|
|
11762
11896
|
})
|
|
11763
11897
|
);
|
|
11764
11898
|
}
|
|
11765
|
-
var
|
|
11899
|
+
var texts21 = createTexts({
|
|
11766
11900
|
stepProgression: {
|
|
11767
11901
|
nb: "Stegprogresjon",
|
|
11768
11902
|
no: "Stegprogresjon",
|
|
@@ -11983,7 +12117,7 @@ var SearchSuggestions = ({
|
|
|
11983
12117
|
{
|
|
11984
12118
|
index,
|
|
11985
12119
|
focus: focus === index && showSuggestions,
|
|
11986
|
-
"aria-label": t(
|
|
12120
|
+
"aria-label": t(texts22.search(suggestion)),
|
|
11987
12121
|
onClick: onSuggestionClick,
|
|
11988
12122
|
"aria-setsize": suggestionsToRender.length,
|
|
11989
12123
|
"aria-posinset": index,
|
|
@@ -11997,7 +12131,7 @@ var SearchSuggestions = ({
|
|
|
11997
12131
|
);
|
|
11998
12132
|
};
|
|
11999
12133
|
SearchSuggestions.displayName = "SearchSuggestions";
|
|
12000
|
-
var
|
|
12134
|
+
var texts22 = createTexts({
|
|
12001
12135
|
search: (suggestion) => ({
|
|
12002
12136
|
no: `${suggestion} s\xF8k`,
|
|
12003
12137
|
nb: `${suggestion} s\xF8k`,
|
|
@@ -12007,7 +12141,7 @@ var texts21 = createTexts({
|
|
|
12007
12141
|
});
|
|
12008
12142
|
|
|
12009
12143
|
// src/components/Search/Search.tsx
|
|
12010
|
-
import { Fragment as
|
|
12144
|
+
import { Fragment as Fragment10, jsx as jsx296, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
12011
12145
|
var getIconSize2 = (size2) => {
|
|
12012
12146
|
switch (size2) {
|
|
12013
12147
|
case "large":
|
|
@@ -12130,7 +12264,7 @@ var Search = ({
|
|
|
12130
12264
|
)
|
|
12131
12265
|
}
|
|
12132
12266
|
),
|
|
12133
|
-
hasSuggestions && /* @__PURE__ */ jsxs75(
|
|
12267
|
+
hasSuggestions && /* @__PURE__ */ jsxs75(Fragment10, { children: [
|
|
12134
12268
|
/* @__PURE__ */ jsx296(
|
|
12135
12269
|
SearchSuggestions,
|
|
12136
12270
|
{
|
|
@@ -12143,13 +12277,13 @@ var Search = ({
|
|
|
12143
12277
|
componentSize
|
|
12144
12278
|
}
|
|
12145
12279
|
),
|
|
12146
|
-
/* @__PURE__ */ jsx296(VisuallyHidden, { id: suggestionsDescriptionId, children: t(
|
|
12280
|
+
/* @__PURE__ */ jsx296(VisuallyHidden, { id: suggestionsDescriptionId, children: t(texts23.useArrowKeys) })
|
|
12147
12281
|
] }),
|
|
12148
12282
|
hasValue && /* @__PURE__ */ jsx296(
|
|
12149
12283
|
ClearButton,
|
|
12150
12284
|
{
|
|
12151
12285
|
size: getIconSize2(componentSize),
|
|
12152
|
-
"aria-label": t(
|
|
12286
|
+
"aria-label": t(texts23.clearSearch),
|
|
12153
12287
|
onClick: clearInput,
|
|
12154
12288
|
className: Search_default["clear-button"]
|
|
12155
12289
|
}
|
|
@@ -12178,7 +12312,7 @@ var Search = ({
|
|
|
12178
12312
|
size: componentSize,
|
|
12179
12313
|
onClick,
|
|
12180
12314
|
...otherButtonProps,
|
|
12181
|
-
children: buttonLabel != null ? buttonLabel : t(
|
|
12315
|
+
children: buttonLabel != null ? buttonLabel : t(texts23.search)
|
|
12182
12316
|
}
|
|
12183
12317
|
)
|
|
12184
12318
|
]
|
|
@@ -12189,7 +12323,7 @@ var Search = ({
|
|
|
12189
12323
|
] });
|
|
12190
12324
|
};
|
|
12191
12325
|
Search.displayName = "Search";
|
|
12192
|
-
var
|
|
12326
|
+
var texts23 = createTexts({
|
|
12193
12327
|
clearSearch: {
|
|
12194
12328
|
nb: "T\xF8m s\xF8k",
|
|
12195
12329
|
no: "T\xF8m s\xF8k",
|
|
@@ -12402,7 +12536,7 @@ var SplitButton = ({
|
|
|
12402
12536
|
{
|
|
12403
12537
|
...buttonStyleProps,
|
|
12404
12538
|
icon: isOpen ? ChevronUpIcon : ChevronDownIcon,
|
|
12405
|
-
"aria-label": t(
|
|
12539
|
+
"aria-label": t(texts24.moreActions),
|
|
12406
12540
|
purpose,
|
|
12407
12541
|
className: cn(
|
|
12408
12542
|
SplitButton_default.option,
|
|
@@ -12416,7 +12550,7 @@ var SplitButton = ({
|
|
|
12416
12550
|
] });
|
|
12417
12551
|
};
|
|
12418
12552
|
SplitButton.displayName = "SplitButton";
|
|
12419
|
-
var
|
|
12553
|
+
var texts24 = createTexts({
|
|
12420
12554
|
moreActions: {
|
|
12421
12555
|
nb: "Flere handlinger",
|
|
12422
12556
|
no: "Flere handlinger",
|
|
@@ -12428,7 +12562,7 @@ var texts23 = createTexts({
|
|
|
12428
12562
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
12429
12563
|
import {
|
|
12430
12564
|
Children as Children4,
|
|
12431
|
-
Fragment as
|
|
12565
|
+
Fragment as Fragment11,
|
|
12432
12566
|
cloneElement as cloneElement6,
|
|
12433
12567
|
isValidElement as isValidElement6,
|
|
12434
12568
|
useEffect as useEffect32,
|
|
@@ -12581,7 +12715,7 @@ var SortCell = ({
|
|
|
12581
12715
|
StylelessButton,
|
|
12582
12716
|
{
|
|
12583
12717
|
onClick,
|
|
12584
|
-
"aria-description": t(
|
|
12718
|
+
"aria-description": t(texts25.changeSort),
|
|
12585
12719
|
className: cn(Table_default["sort-button"], focusable),
|
|
12586
12720
|
children: [
|
|
12587
12721
|
children,
|
|
@@ -12594,7 +12728,7 @@ var SortCell = ({
|
|
|
12594
12728
|
);
|
|
12595
12729
|
};
|
|
12596
12730
|
SortCell.displayName = "Table.SortCell";
|
|
12597
|
-
var
|
|
12731
|
+
var texts25 = createTexts({
|
|
12598
12732
|
changeSort: {
|
|
12599
12733
|
nb: "Aktiver for \xE5 endre sorteringsrekkef\xF8lge",
|
|
12600
12734
|
no: "Aktiver for \xE5 endre sorteringsrekkef\xF8lge",
|
|
@@ -12688,7 +12822,7 @@ Table2.Row = Row;
|
|
|
12688
12822
|
Table2.Foot = Foot;
|
|
12689
12823
|
|
|
12690
12824
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
12691
|
-
import { Fragment as
|
|
12825
|
+
import { Fragment as Fragment12, jsx as jsx309, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
12692
12826
|
var CollapsibleRow = ({
|
|
12693
12827
|
type: _type,
|
|
12694
12828
|
className,
|
|
@@ -12731,7 +12865,7 @@ var CollapsibleRow = ({
|
|
|
12731
12865
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
12732
12866
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
12733
12867
|
collapsibleIds.push(id);
|
|
12734
|
-
return /* @__PURE__ */ jsxs78(
|
|
12868
|
+
return /* @__PURE__ */ jsxs78(Fragment11, { children: [
|
|
12735
12869
|
/* @__PURE__ */ jsx309(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
|
|
12736
12870
|
isValidElement6(child) && cloneElement6(child, {
|
|
12737
12871
|
collapsibleProps: { isCollapsibleChild: true }
|
|
@@ -12744,11 +12878,11 @@ var CollapsibleRow = ({
|
|
|
12744
12878
|
});
|
|
12745
12879
|
const headerRow = () => {
|
|
12746
12880
|
if (type !== "head" || !isCollapsed) return null;
|
|
12747
|
-
return /* @__PURE__ */ jsx309(Row, { ref, ...rowProps(), children: /* @__PURE__ */ jsxs78(
|
|
12881
|
+
return /* @__PURE__ */ jsx309(Row, { ref, ...rowProps(), children: /* @__PURE__ */ jsxs78(Fragment12, { children: [
|
|
12748
12882
|
definingColumnCells,
|
|
12749
12883
|
/* @__PURE__ */ jsxs78(Table2.Cell, { type: "head", layout: "center", children: [
|
|
12750
|
-
t(
|
|
12751
|
-
/* @__PURE__ */ jsx309(VisuallyHidden, { children: t(
|
|
12884
|
+
t(texts26.expand),
|
|
12885
|
+
/* @__PURE__ */ jsx309(VisuallyHidden, { children: t(texts26.row) })
|
|
12752
12886
|
] })
|
|
12753
12887
|
] }) });
|
|
12754
12888
|
};
|
|
@@ -12776,16 +12910,16 @@ var CollapsibleRow = ({
|
|
|
12776
12910
|
) })
|
|
12777
12911
|
] });
|
|
12778
12912
|
};
|
|
12779
|
-
return isCollapsed && collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ jsxs78(
|
|
12913
|
+
return isCollapsed && collapsedRenderedChildren && collapsedRenderedChildren.length > 0 ? /* @__PURE__ */ jsxs78(Fragment12, { children: [
|
|
12780
12914
|
headerRow(),
|
|
12781
|
-
type === "body" && /* @__PURE__ */ jsxs78(
|
|
12915
|
+
type === "body" && /* @__PURE__ */ jsxs78(Fragment12, { children: [
|
|
12782
12916
|
rowWithChevron(),
|
|
12783
12917
|
childrenCollapsed ? null : collapsedRows
|
|
12784
12918
|
] })
|
|
12785
12919
|
] }) : /* @__PURE__ */ jsx309(Row, { ref, ...rowProps(), children });
|
|
12786
12920
|
};
|
|
12787
12921
|
CollapsibleRow.displayName = "CollapsibleTable.Row";
|
|
12788
|
-
var
|
|
12922
|
+
var texts26 = createTexts({
|
|
12789
12923
|
expand: {
|
|
12790
12924
|
nb: "Utvid",
|
|
12791
12925
|
no: "Utvid",
|