rk-designsystem 1.1.28 → 1.1.30
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/componentlibrary.es.js +261 -259
- package/dist/componentlibrary.umd.js +3 -3
- package/dist/index.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import ye, { forwardRef as
|
|
2
|
-
import { Alert as Te, Avatar as Se, Badge as $e, BadgePosition as
|
|
3
|
-
import { startOfMonth as F, isValid as ce, isSameMonth as me, startOfWeek as xe, format as K, addDays as Pe, subMonths as
|
|
1
|
+
import ye, { forwardRef as S, useState as _e, useEffect as we, useMemo as se, useCallback as Y, useRef as Re } from "react";
|
|
2
|
+
import { Alert as Te, Avatar as Se, Badge as $e, BadgePosition as Me, Breadcrumbs as De, BreadcrumbsList as Ae, BreadcrumbsItem as Oe, BreadcrumbsLink as We, Button as ue, Card as Le, CardBlock as Be, Checkbox as Ie, Fieldset as Ce, useCheckboxGroup as Fe, Chip as Ve, Details as Ye, Dialog as He, Divider as ze, Dropdown as Ge, ErrorSummary as qe, FieldDescription as Xe, FieldCounter as Ke, Field as Je, Heading as Ue, Input as Qe, Label as Ze, Link as et, List as tt, Pagination as rt, usePagination as at, Paragraph as nt, Popover as ot, Radio as st, useRadioGroup as it, Search as lt, Select as ct, Skeleton as dt, SkipLink as ut, Spinner as mt, EXPERIMENTAL_Suggestion as ft, Switch as ht, Table as pt, Tabs as bt, Tag as vt, Textarea as gt, Textfield as kt, ToggleGroup as yt, Tooltip as _t, ValidationMessage as wt } from "@digdir/designsystemet-react";
|
|
3
|
+
import { startOfMonth as F, isValid as ce, isSameMonth as me, startOfWeek as xe, format as K, addDays as Pe, subMonths as Ct, addMonths as xt, isSameDay as Pt, isToday as Et, eachDayOfInterval as jt } from "date-fns";
|
|
4
4
|
var ie = { exports: {} }, J = {};
|
|
5
5
|
/**
|
|
6
6
|
* @license React
|
|
@@ -12,23 +12,23 @@ var ie = { exports: {} }, J = {};
|
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
14
|
var fe;
|
|
15
|
-
function
|
|
15
|
+
function Nt() {
|
|
16
16
|
if (fe) return J;
|
|
17
17
|
fe = 1;
|
|
18
18
|
var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
19
|
-
function a(o, s,
|
|
20
|
-
var
|
|
21
|
-
if (
|
|
22
|
-
|
|
19
|
+
function a(o, s, u) {
|
|
20
|
+
var d = null;
|
|
21
|
+
if (u !== void 0 && (d = "" + u), s.key !== void 0 && (d = "" + s.key), "key" in s) {
|
|
22
|
+
u = {};
|
|
23
23
|
for (var m in s)
|
|
24
|
-
m !== "key" && (
|
|
25
|
-
} else
|
|
26
|
-
return s =
|
|
24
|
+
m !== "key" && (u[m] = s[m]);
|
|
25
|
+
} else u = s;
|
|
26
|
+
return s = u.ref, {
|
|
27
27
|
$$typeof: e,
|
|
28
28
|
type: o,
|
|
29
|
-
key:
|
|
29
|
+
key: d,
|
|
30
30
|
ref: s !== void 0 ? s : null,
|
|
31
|
-
props:
|
|
31
|
+
props: u
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
return J.Fragment = r, J.jsx = a, J.jsxs = a, J;
|
|
@@ -52,9 +52,9 @@ function Rt() {
|
|
|
52
52
|
return t.$$typeof === B ? null : t.displayName || t.name || null;
|
|
53
53
|
if (typeof t == "string") return t;
|
|
54
54
|
switch (t) {
|
|
55
|
-
case
|
|
55
|
+
case $:
|
|
56
56
|
return "Fragment";
|
|
57
|
-
case
|
|
57
|
+
case R:
|
|
58
58
|
return "Profiler";
|
|
59
59
|
case i:
|
|
60
60
|
return "StrictMode";
|
|
@@ -71,7 +71,7 @@ function Rt() {
|
|
|
71
71
|
), t.$$typeof) {
|
|
72
72
|
case H:
|
|
73
73
|
return "Portal";
|
|
74
|
-
case
|
|
74
|
+
case M:
|
|
75
75
|
return (t.displayName || "Context") + ".Provider";
|
|
76
76
|
case P:
|
|
77
77
|
return (t._context.displayName || "Context") + ".Consumer";
|
|
@@ -110,7 +110,7 @@ function Rt() {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
function o(t) {
|
|
113
|
-
if (t ===
|
|
113
|
+
if (t === $) return "<>";
|
|
114
114
|
if (typeof t == "object" && t !== null && t.$$typeof === T)
|
|
115
115
|
return "<...>";
|
|
116
116
|
try {
|
|
@@ -124,10 +124,10 @@ function Rt() {
|
|
|
124
124
|
var t = g.A;
|
|
125
125
|
return t === null ? null : t.getOwner();
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function u() {
|
|
128
128
|
return Error("react-stack-top-frame");
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function d(t) {
|
|
131
131
|
if (D.call(t, "key")) {
|
|
132
132
|
var n = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
133
133
|
if (n && n.isReactWarning) return !1;
|
|
@@ -152,7 +152,7 @@ function Rt() {
|
|
|
152
152
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
153
153
|
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
154
154
|
}
|
|
155
|
-
function _(t, n, c, f, h, b,
|
|
155
|
+
function _(t, n, c, f, h, b, O, q) {
|
|
156
156
|
return c = b.ref, t = {
|
|
157
157
|
$$typeof: C,
|
|
158
158
|
type: t,
|
|
@@ -176,7 +176,7 @@ function Rt() {
|
|
|
176
176
|
configurable: !1,
|
|
177
177
|
enumerable: !1,
|
|
178
178
|
writable: !0,
|
|
179
|
-
value:
|
|
179
|
+
value: O
|
|
180
180
|
}), Object.defineProperty(t, "_debugTask", {
|
|
181
181
|
configurable: !1,
|
|
182
182
|
enumerable: !1,
|
|
@@ -184,11 +184,11 @@ function Rt() {
|
|
|
184
184
|
value: q
|
|
185
185
|
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
186
186
|
}
|
|
187
|
-
function w(t, n, c, f, h, b,
|
|
187
|
+
function w(t, n, c, f, h, b, O, q) {
|
|
188
188
|
var p = n.children;
|
|
189
189
|
if (p !== void 0)
|
|
190
190
|
if (f)
|
|
191
|
-
if (
|
|
191
|
+
if (A(p)) {
|
|
192
192
|
for (f = 0; f < p.length; f++)
|
|
193
193
|
v(p[f]);
|
|
194
194
|
Object.freeze && Object.freeze(p);
|
|
@@ -215,7 +215,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
215
215
|
p
|
|
216
216
|
), oe[p + f] = !0);
|
|
217
217
|
}
|
|
218
|
-
if (p = null, c !== void 0 && (a(c), p = "" + c),
|
|
218
|
+
if (p = null, c !== void 0 && (a(c), p = "" + c), d(n) && (a(n.key), p = "" + n.key), "key" in n) {
|
|
219
219
|
c = {};
|
|
220
220
|
for (var x in n)
|
|
221
221
|
x !== "key" && (c[x] = n[x]);
|
|
@@ -230,26 +230,26 @@ React keys must be passed directly to JSX without using spread:
|
|
|
230
230
|
h,
|
|
231
231
|
s(),
|
|
232
232
|
c,
|
|
233
|
-
|
|
233
|
+
O,
|
|
234
234
|
q
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
237
|
function v(t) {
|
|
238
238
|
typeof t == "object" && t !== null && t.$$typeof === C && t._store && (t._store.validated = 1);
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var N = ye, C = Symbol.for("react.transitional.element"), H = Symbol.for("react.portal"), $ = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), P = Symbol.for("react.consumer"), M = Symbol.for("react.context"), z = Symbol.for("react.forward_ref"), L = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), G = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), le = Symbol.for("react.activity"), B = Symbol.for("react.client.reference"), g = N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, D = Object.prototype.hasOwnProperty, A = Array.isArray, I = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
|
-
|
|
243
|
+
N = {
|
|
244
244
|
react_stack_bottom_frame: function(t) {
|
|
245
245
|
return t();
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
|
-
var te, re = {}, ae =
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)(), ne = I(o(
|
|
252
|
-
U.Fragment =
|
|
248
|
+
var te, re = {}, ae = N.react_stack_bottom_frame.bind(
|
|
249
|
+
N,
|
|
250
|
+
u
|
|
251
|
+
)(), ne = I(o(u)), oe = {};
|
|
252
|
+
U.Fragment = $, U.jsx = function(t, n, c, f, h) {
|
|
253
253
|
var b = 1e4 > g.recentlyCreatedOwnerStacks++;
|
|
254
254
|
return w(
|
|
255
255
|
t,
|
|
@@ -277,25 +277,25 @@ React keys must be passed directly to JSX without using spread:
|
|
|
277
277
|
})()), U;
|
|
278
278
|
}
|
|
279
279
|
var pe;
|
|
280
|
-
function
|
|
281
|
-
return pe || (pe = 1, process.env.NODE_ENV === "production" ? ie.exports =
|
|
280
|
+
function Tt() {
|
|
281
|
+
return pe || (pe = 1, process.env.NODE_ENV === "production" ? ie.exports = Nt() : ie.exports = Rt()), ie.exports;
|
|
282
282
|
}
|
|
283
|
-
var l =
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
const
|
|
283
|
+
var l = Tt();
|
|
284
|
+
const St = S((e, r) => /* @__PURE__ */ l.jsx(Te, { ref: r, ...e }));
|
|
285
|
+
St.displayName = "Alert";
|
|
286
|
+
const $t = S((e, r) => /* @__PURE__ */ l.jsx(Se, { ref: r, ...e }));
|
|
287
|
+
$t.displayName = "Avatar";
|
|
288
|
+
const Mt = S((e, r) => /* @__PURE__ */ l.jsx($e, { ref: r, ...e }));
|
|
289
|
+
Mt.displayName = "Badge";
|
|
290
|
+
const zr = Me, Gr = De, qr = Ae, Xr = Oe, Kr = We, Dt = ue;
|
|
291
291
|
Dt.displayName = "Button";
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
const
|
|
298
|
-
function
|
|
292
|
+
const At = Le, Jr = Be;
|
|
293
|
+
At.displayName = "Card";
|
|
294
|
+
const Ot = Ie, Wt = Ce, Ur = Fe;
|
|
295
|
+
Ot.displayName = "Checkbox";
|
|
296
|
+
Wt.displayName = "Fieldset";
|
|
297
|
+
const Qr = Ve;
|
|
298
|
+
function de(e) {
|
|
299
299
|
return (r = {}) => {
|
|
300
300
|
const a = r.width ? String(r.width) : e.defaultWidth;
|
|
301
301
|
return e.formats[a] || e.formats[e.defaultWidth];
|
|
@@ -306,57 +306,57 @@ function Q(e) {
|
|
|
306
306
|
const o = a != null && a.context ? String(a.context) : "standalone";
|
|
307
307
|
let s;
|
|
308
308
|
if (o === "formatting" && e.formattingValues) {
|
|
309
|
-
const
|
|
310
|
-
s = e.formattingValues[m] || e.formattingValues[
|
|
309
|
+
const d = e.defaultFormattingWidth || e.defaultWidth, m = a != null && a.width ? String(a.width) : d;
|
|
310
|
+
s = e.formattingValues[m] || e.formattingValues[d];
|
|
311
311
|
} else {
|
|
312
|
-
const
|
|
313
|
-
s = e.values[m] || e.values[
|
|
312
|
+
const d = e.defaultWidth, m = a != null && a.width ? String(a.width) : e.defaultWidth;
|
|
313
|
+
s = e.values[m] || e.values[d];
|
|
314
314
|
}
|
|
315
|
-
const
|
|
316
|
-
return s[
|
|
315
|
+
const u = e.argumentCallback ? e.argumentCallback(r) : r;
|
|
316
|
+
return s[u];
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
319
|
function Z(e) {
|
|
320
320
|
return (r, a = {}) => {
|
|
321
|
-
const o = a.width, s = o && e.matchPatterns[o] || e.matchPatterns[e.defaultMatchWidth],
|
|
322
|
-
if (!
|
|
321
|
+
const o = a.width, s = o && e.matchPatterns[o] || e.matchPatterns[e.defaultMatchWidth], u = r.match(s);
|
|
322
|
+
if (!u)
|
|
323
323
|
return null;
|
|
324
|
-
const
|
|
324
|
+
const d = u[0], m = o && e.parsePatterns[o] || e.parsePatterns[e.defaultParseWidth], y = Array.isArray(m) ? Bt(m, (v) => v.test(d)) : (
|
|
325
325
|
// [TODO] -- I challenge you to fix the type
|
|
326
|
-
|
|
326
|
+
Lt(m, (v) => v.test(d))
|
|
327
327
|
);
|
|
328
328
|
let _;
|
|
329
329
|
_ = e.valueCallback ? e.valueCallback(y) : y, _ = a.valueCallback ? (
|
|
330
330
|
// [TODO] -- I challenge you to fix the type
|
|
331
331
|
a.valueCallback(_)
|
|
332
332
|
) : _;
|
|
333
|
-
const w = r.slice(
|
|
333
|
+
const w = r.slice(d.length);
|
|
334
334
|
return { value: _, rest: w };
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function Lt(e, r) {
|
|
338
338
|
for (const a in e)
|
|
339
339
|
if (Object.prototype.hasOwnProperty.call(e, a) && r(e[a]))
|
|
340
340
|
return a;
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function Bt(e, r) {
|
|
343
343
|
for (let a = 0; a < e.length; a++)
|
|
344
344
|
if (r(e[a]))
|
|
345
345
|
return a;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function It(e) {
|
|
348
348
|
return (r, a = {}) => {
|
|
349
349
|
const o = r.match(e.matchPattern);
|
|
350
350
|
if (!o) return null;
|
|
351
|
-
const s = o[0],
|
|
352
|
-
if (!
|
|
353
|
-
let
|
|
354
|
-
|
|
351
|
+
const s = o[0], u = r.match(e.parsePattern);
|
|
352
|
+
if (!u) return null;
|
|
353
|
+
let d = e.valueCallback ? e.valueCallback(u[0]) : u[0];
|
|
354
|
+
d = a.valueCallback ? a.valueCallback(d) : d;
|
|
355
355
|
const m = r.slice(s.length);
|
|
356
|
-
return { value:
|
|
356
|
+
return { value: d, rest: m };
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
|
-
const
|
|
359
|
+
const Ft = {
|
|
360
360
|
lessThanXSeconds: {
|
|
361
361
|
one: "mindre enn ett sekund",
|
|
362
362
|
other: "mindre enn {{count}} sekunder"
|
|
@@ -418,54 +418,54 @@ const It = {
|
|
|
418
418
|
one: "nesten ett år",
|
|
419
419
|
other: "nesten {{count}} år"
|
|
420
420
|
}
|
|
421
|
-
},
|
|
421
|
+
}, Vt = (e, r, a) => {
|
|
422
422
|
let o;
|
|
423
|
-
const s =
|
|
423
|
+
const s = Ft[e];
|
|
424
424
|
return typeof s == "string" ? o = s : r === 1 ? o = s.one : o = s.other.replace("{{count}}", String(r)), a != null && a.addSuffix ? a.comparison && a.comparison > 0 ? "om " + o : o + " siden" : o;
|
|
425
425
|
}, Yt = {
|
|
426
426
|
full: "EEEE d. MMMM y",
|
|
427
427
|
long: "d. MMMM y",
|
|
428
428
|
medium: "d. MMM y",
|
|
429
429
|
short: "dd.MM.y"
|
|
430
|
-
},
|
|
430
|
+
}, Ht = {
|
|
431
431
|
full: "'kl'. HH:mm:ss zzzz",
|
|
432
432
|
long: "HH:mm:ss z",
|
|
433
433
|
medium: "HH:mm:ss",
|
|
434
434
|
short: "HH:mm"
|
|
435
|
-
},
|
|
435
|
+
}, zt = {
|
|
436
436
|
full: "{{date}} 'kl.' {{time}}",
|
|
437
437
|
long: "{{date}} 'kl.' {{time}}",
|
|
438
438
|
medium: "{{date}} {{time}}",
|
|
439
439
|
short: "{{date}} {{time}}"
|
|
440
|
-
},
|
|
441
|
-
date:
|
|
440
|
+
}, Gt = {
|
|
441
|
+
date: de({
|
|
442
442
|
formats: Yt,
|
|
443
443
|
defaultWidth: "full"
|
|
444
444
|
}),
|
|
445
|
-
time:
|
|
446
|
-
formats:
|
|
445
|
+
time: de({
|
|
446
|
+
formats: Ht,
|
|
447
447
|
defaultWidth: "full"
|
|
448
448
|
}),
|
|
449
|
-
dateTime:
|
|
450
|
-
formats:
|
|
449
|
+
dateTime: de({
|
|
450
|
+
formats: zt,
|
|
451
451
|
defaultWidth: "full"
|
|
452
452
|
})
|
|
453
|
-
},
|
|
453
|
+
}, qt = {
|
|
454
454
|
lastWeek: "'forrige' eeee 'kl.' p",
|
|
455
455
|
yesterday: "'i går kl.' p",
|
|
456
456
|
today: "'i dag kl.' p",
|
|
457
457
|
tomorrow: "'i morgen kl.' p",
|
|
458
458
|
nextWeek: "EEEE 'kl.' p",
|
|
459
459
|
other: "P"
|
|
460
|
-
},
|
|
460
|
+
}, Xt = (e, r, a, o) => qt[e], Kt = {
|
|
461
461
|
narrow: ["f.Kr.", "e.Kr."],
|
|
462
462
|
abbreviated: ["f.Kr.", "e.Kr."],
|
|
463
463
|
wide: ["før Kristus", "etter Kristus"]
|
|
464
|
-
},
|
|
464
|
+
}, Jt = {
|
|
465
465
|
narrow: ["1", "2", "3", "4"],
|
|
466
466
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
467
467
|
wide: ["1. kvartal", "2. kvartal", "3. kvartal", "4. kvartal"]
|
|
468
|
-
},
|
|
468
|
+
}, Ut = {
|
|
469
469
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
470
470
|
abbreviated: [
|
|
471
471
|
"jan.",
|
|
@@ -495,7 +495,7 @@ const It = {
|
|
|
495
495
|
"november",
|
|
496
496
|
"desember"
|
|
497
497
|
]
|
|
498
|
-
},
|
|
498
|
+
}, Qt = {
|
|
499
499
|
narrow: ["S", "M", "T", "O", "T", "F", "L"],
|
|
500
500
|
short: ["sø", "ma", "ti", "on", "to", "fr", "lø"],
|
|
501
501
|
abbreviated: ["søn", "man", "tir", "ons", "tor", "fre", "lør"],
|
|
@@ -508,7 +508,7 @@ const It = {
|
|
|
508
508
|
"fredag",
|
|
509
509
|
"lørdag"
|
|
510
510
|
]
|
|
511
|
-
},
|
|
511
|
+
}, Zt = {
|
|
512
512
|
narrow: {
|
|
513
513
|
am: "a",
|
|
514
514
|
pm: "p",
|
|
@@ -539,46 +539,46 @@ const It = {
|
|
|
539
539
|
evening: "på kvelden",
|
|
540
540
|
night: "på natten"
|
|
541
541
|
}
|
|
542
|
-
},
|
|
543
|
-
ordinalNumber:
|
|
542
|
+
}, er = (e, r) => Number(e) + ".", tr = {
|
|
543
|
+
ordinalNumber: er,
|
|
544
544
|
era: Q({
|
|
545
|
-
values:
|
|
545
|
+
values: Kt,
|
|
546
546
|
defaultWidth: "wide"
|
|
547
547
|
}),
|
|
548
548
|
quarter: Q({
|
|
549
|
-
values:
|
|
549
|
+
values: Jt,
|
|
550
550
|
defaultWidth: "wide",
|
|
551
551
|
argumentCallback: (e) => e - 1
|
|
552
552
|
}),
|
|
553
553
|
month: Q({
|
|
554
|
-
values:
|
|
554
|
+
values: Ut,
|
|
555
555
|
defaultWidth: "wide"
|
|
556
556
|
}),
|
|
557
557
|
day: Q({
|
|
558
|
-
values:
|
|
558
|
+
values: Qt,
|
|
559
559
|
defaultWidth: "wide"
|
|
560
560
|
}),
|
|
561
561
|
dayPeriod: Q({
|
|
562
|
-
values:
|
|
562
|
+
values: Zt,
|
|
563
563
|
defaultWidth: "wide"
|
|
564
564
|
})
|
|
565
|
-
},
|
|
565
|
+
}, rr = /^(\d+)\.?/i, ar = /\d+/i, nr = {
|
|
566
566
|
narrow: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
|
|
567
567
|
abbreviated: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
|
|
568
568
|
wide: /^(før Kristus|før vår tid|etter Kristus|vår tid)/i
|
|
569
|
-
}, nr = {
|
|
570
|
-
any: [/^f/i, /^e/i]
|
|
571
569
|
}, or = {
|
|
570
|
+
any: [/^f/i, /^e/i]
|
|
571
|
+
}, sr = {
|
|
572
572
|
narrow: /^[1234]/i,
|
|
573
573
|
abbreviated: /^q[1234]/i,
|
|
574
574
|
wide: /^[1234](\.)? kvartal/i
|
|
575
|
-
}, sr = {
|
|
576
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
577
575
|
}, ir = {
|
|
576
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
577
|
+
}, lr = {
|
|
578
578
|
narrow: /^[jfmasond]/i,
|
|
579
579
|
abbreviated: /^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,
|
|
580
580
|
wide: /^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i
|
|
581
|
-
},
|
|
581
|
+
}, cr = {
|
|
582
582
|
narrow: [
|
|
583
583
|
/^j/i,
|
|
584
584
|
/^f/i,
|
|
@@ -607,17 +607,17 @@ const It = {
|
|
|
607
607
|
/^n/i,
|
|
608
608
|
/^d/i
|
|
609
609
|
]
|
|
610
|
-
},
|
|
610
|
+
}, dr = {
|
|
611
611
|
narrow: /^[smtofl]/i,
|
|
612
612
|
short: /^(sø|ma|ti|on|to|fr|lø)/i,
|
|
613
613
|
abbreviated: /^(søn|man|tir|ons|tor|fre|lør)/i,
|
|
614
614
|
wide: /^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i
|
|
615
615
|
}, ur = {
|
|
616
616
|
any: [/^s/i, /^m/i, /^ti/i, /^o/i, /^to/i, /^f/i, /^l/i]
|
|
617
|
-
},
|
|
617
|
+
}, mr = {
|
|
618
618
|
narrow: /^(midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten)|[ap])/i,
|
|
619
619
|
any: /^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten))/i
|
|
620
|
-
},
|
|
620
|
+
}, fr = {
|
|
621
621
|
any: {
|
|
622
622
|
am: /^a(\.?\s?m\.?)?$/i,
|
|
623
623
|
pm: /^p(\.?\s?m\.?)?$/i,
|
|
@@ -628,50 +628,50 @@ const It = {
|
|
|
628
628
|
evening: /kveld/i,
|
|
629
629
|
night: /natt/i
|
|
630
630
|
}
|
|
631
|
-
},
|
|
632
|
-
ordinalNumber:
|
|
633
|
-
matchPattern:
|
|
634
|
-
parsePattern:
|
|
631
|
+
}, hr = {
|
|
632
|
+
ordinalNumber: It({
|
|
633
|
+
matchPattern: rr,
|
|
634
|
+
parsePattern: ar,
|
|
635
635
|
valueCallback: (e) => parseInt(e, 10)
|
|
636
636
|
}),
|
|
637
637
|
era: Z({
|
|
638
|
-
matchPatterns:
|
|
638
|
+
matchPatterns: nr,
|
|
639
639
|
defaultMatchWidth: "wide",
|
|
640
|
-
parsePatterns:
|
|
640
|
+
parsePatterns: or,
|
|
641
641
|
defaultParseWidth: "any"
|
|
642
642
|
}),
|
|
643
643
|
quarter: Z({
|
|
644
|
-
matchPatterns:
|
|
644
|
+
matchPatterns: sr,
|
|
645
645
|
defaultMatchWidth: "wide",
|
|
646
|
-
parsePatterns:
|
|
646
|
+
parsePatterns: ir,
|
|
647
647
|
defaultParseWidth: "any",
|
|
648
648
|
valueCallback: (e) => e + 1
|
|
649
649
|
}),
|
|
650
650
|
month: Z({
|
|
651
|
-
matchPatterns:
|
|
651
|
+
matchPatterns: lr,
|
|
652
652
|
defaultMatchWidth: "wide",
|
|
653
|
-
parsePatterns:
|
|
653
|
+
parsePatterns: cr,
|
|
654
654
|
defaultParseWidth: "any"
|
|
655
655
|
}),
|
|
656
656
|
day: Z({
|
|
657
|
-
matchPatterns:
|
|
657
|
+
matchPatterns: dr,
|
|
658
658
|
defaultMatchWidth: "wide",
|
|
659
659
|
parsePatterns: ur,
|
|
660
660
|
defaultParseWidth: "any"
|
|
661
661
|
}),
|
|
662
662
|
dayPeriod: Z({
|
|
663
|
-
matchPatterns:
|
|
663
|
+
matchPatterns: mr,
|
|
664
664
|
defaultMatchWidth: "any",
|
|
665
|
-
parsePatterns:
|
|
665
|
+
parsePatterns: fr,
|
|
666
666
|
defaultParseWidth: "any"
|
|
667
667
|
})
|
|
668
|
-
},
|
|
668
|
+
}, V = {
|
|
669
669
|
code: "nb",
|
|
670
|
-
formatDistance:
|
|
671
|
-
formatLong:
|
|
672
|
-
formatRelative:
|
|
673
|
-
localize:
|
|
674
|
-
match:
|
|
670
|
+
formatDistance: Vt,
|
|
671
|
+
formatLong: Gt,
|
|
672
|
+
formatRelative: Xt,
|
|
673
|
+
localize: tr,
|
|
674
|
+
match: hr,
|
|
675
675
|
options: {
|
|
676
676
|
weekStartsOn: 1,
|
|
677
677
|
firstWeekContainsDate: 4
|
|
@@ -728,21 +728,21 @@ const je = ({ title: e, ...r }) => /* @__PURE__ */ l.jsxs(
|
|
|
728
728
|
}
|
|
729
729
|
);
|
|
730
730
|
je.displayName = "ChevronRightIcon";
|
|
731
|
-
const
|
|
732
|
-
calendarContainer:
|
|
733
|
-
calendarHeader:
|
|
734
|
-
monthYear:
|
|
735
|
-
navigationButtons:
|
|
736
|
-
grid:
|
|
737
|
-
dayNameCell:
|
|
738
|
-
dateCell:
|
|
739
|
-
dateNumberContainer:
|
|
740
|
-
otherMonth:
|
|
741
|
-
selectedDate:
|
|
742
|
-
},
|
|
743
|
-
const r = F(e), a = xe(r, { locale:
|
|
744
|
-
return
|
|
745
|
-
}, be = (e) => e && e.charAt(0).toUpperCase() + e.slice(1),
|
|
731
|
+
const pr = "_calendarContainer_160wn_3", br = "_calendarHeader_160wn_17", vr = "_monthYear_160wn_24", gr = "_navigationButtons_160wn_36", kr = "_grid_160wn_45", yr = "_dayNameCell_160wn_53", _r = "_dateCell_160wn_72", wr = "_dateNumberContainer_160wn_107", Cr = "_otherMonth_160wn_125", xr = "_selectedDate_160wn_157", k = {
|
|
732
|
+
calendarContainer: pr,
|
|
733
|
+
calendarHeader: br,
|
|
734
|
+
monthYear: vr,
|
|
735
|
+
navigationButtons: gr,
|
|
736
|
+
grid: kr,
|
|
737
|
+
dayNameCell: yr,
|
|
738
|
+
dateCell: _r,
|
|
739
|
+
dateNumberContainer: wr,
|
|
740
|
+
otherMonth: Cr,
|
|
741
|
+
selectedDate: xr
|
|
742
|
+
}, Pr = (e) => {
|
|
743
|
+
const r = F(e), a = xe(r, { locale: V }), o = Pe(a, 41);
|
|
744
|
+
return jt({ start: a, end: o });
|
|
745
|
+
}, be = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), Er = ({
|
|
746
746
|
initialDate: e = /* @__PURE__ */ new Date(),
|
|
747
747
|
selectedDate: r = null,
|
|
748
748
|
// Prop for selected date
|
|
@@ -758,47 +758,47 @@ const hr = "_calendarContainer_160wn_3", pr = "_calendarHeader_160wn_17", br = "
|
|
|
758
758
|
me(i, o) || s(i);
|
|
759
759
|
}
|
|
760
760
|
}, [r]);
|
|
761
|
-
const
|
|
762
|
-
() =>
|
|
761
|
+
const u = se(() => F(/* @__PURE__ */ new Date()), []), d = se(() => !1, [o, u]), m = se(
|
|
762
|
+
() => Pr(o),
|
|
763
763
|
[o]
|
|
764
764
|
), y = se(() => {
|
|
765
|
-
const i = xe(/* @__PURE__ */ new Date(), { locale:
|
|
766
|
-
return Array.from({ length: 7 }).map((
|
|
767
|
-
const
|
|
768
|
-
return be(
|
|
765
|
+
const i = xe(/* @__PURE__ */ new Date(), { locale: V });
|
|
766
|
+
return Array.from({ length: 7 }).map((R, P) => {
|
|
767
|
+
const M = K(Pe(i, P), "EEEEEE", { locale: V });
|
|
768
|
+
return be(M);
|
|
769
769
|
});
|
|
770
|
-
}, []), _ =
|
|
771
|
-
|
|
772
|
-
}, [
|
|
773
|
-
s((i) => F(
|
|
774
|
-
}, []), v =
|
|
770
|
+
}, []), _ = Y(() => {
|
|
771
|
+
d || s((i) => F(Ct(i, 1)));
|
|
772
|
+
}, [d]), w = Y(() => {
|
|
773
|
+
s((i) => F(xt(i, 1)));
|
|
774
|
+
}, []), v = Y(
|
|
775
775
|
(i) => {
|
|
776
776
|
a && a(i);
|
|
777
777
|
},
|
|
778
778
|
[a]
|
|
779
|
-
),
|
|
780
|
-
(i,
|
|
781
|
-
(i.key === "Enter" || i.key === " ") && (i.preventDefault(), v(
|
|
779
|
+
), N = Y(
|
|
780
|
+
(i, R) => {
|
|
781
|
+
(i.key === "Enter" || i.key === " ") && (i.preventDefault(), v(R));
|
|
782
782
|
},
|
|
783
783
|
[v]
|
|
784
|
-
), C = K(o, "MMMM", { locale:
|
|
784
|
+
), C = K(o, "MMMM", { locale: V }), H = K(o, "yyyy", { locale: V }), $ = `${be(C)} ${H}`;
|
|
785
785
|
return /* @__PURE__ */ l.jsxs("div", { className: k.calendarContainer, children: [
|
|
786
786
|
/* @__PURE__ */ l.jsxs("div", { className: k.calendarHeader, children: [
|
|
787
|
-
/* @__PURE__ */ l.jsx("span", { className: k.monthYear, children:
|
|
787
|
+
/* @__PURE__ */ l.jsx("span", { className: k.monthYear, children: $ }),
|
|
788
788
|
/* @__PURE__ */ l.jsxs("div", { className: k.navigationButtons, children: [
|
|
789
789
|
/* @__PURE__ */ l.jsx(
|
|
790
|
-
|
|
790
|
+
ue,
|
|
791
791
|
{
|
|
792
792
|
variant: "tertiary",
|
|
793
793
|
icon: !0,
|
|
794
794
|
onClick: _,
|
|
795
795
|
"aria-label": "Forrige måned",
|
|
796
|
-
disabled:
|
|
796
|
+
disabled: d,
|
|
797
797
|
children: /* @__PURE__ */ l.jsx(Ee, {})
|
|
798
798
|
}
|
|
799
799
|
),
|
|
800
800
|
/* @__PURE__ */ l.jsx(
|
|
801
|
-
|
|
801
|
+
ue,
|
|
802
802
|
{
|
|
803
803
|
variant: "tertiary",
|
|
804
804
|
icon: !0,
|
|
@@ -811,23 +811,23 @@ const hr = "_calendarContainer_160wn_3", pr = "_calendarHeader_160wn_17", br = "
|
|
|
811
811
|
] }),
|
|
812
812
|
/* @__PURE__ */ l.jsx("div", { className: k.grid, children: y.map((i) => /* @__PURE__ */ l.jsx("div", { className: k.dayNameCell, children: i }, i)) }),
|
|
813
813
|
/* @__PURE__ */ l.jsx("div", { className: k.grid, children: m.map((i) => {
|
|
814
|
-
const
|
|
814
|
+
const R = me(i, o), P = r && ce(r) && Pt(i, r), M = Et(i), z = [
|
|
815
815
|
k.dateCell,
|
|
816
|
-
|
|
816
|
+
R ? "" : k.otherMonth,
|
|
817
817
|
P ? k.selectedDate : "",
|
|
818
818
|
// Highlighting based on prop
|
|
819
|
-
|
|
819
|
+
M && !P ? k.todayDate : ""
|
|
820
820
|
].filter(Boolean).join(" ");
|
|
821
821
|
return /* @__PURE__ */ l.jsx(
|
|
822
822
|
"div",
|
|
823
823
|
{
|
|
824
824
|
className: z,
|
|
825
825
|
onClick: () => v(i),
|
|
826
|
-
onKeyDown: (L) =>
|
|
826
|
+
onKeyDown: (L) => N(L, i),
|
|
827
827
|
role: "button",
|
|
828
828
|
tabIndex: 0,
|
|
829
829
|
"aria-pressed": P ?? !1,
|
|
830
|
-
"aria-label": K(i, "PPP", { locale:
|
|
830
|
+
"aria-label": K(i, "PPP", { locale: V }),
|
|
831
831
|
children: /* @__PURE__ */ l.jsx("span", { className: k.dateNumberContainer, children: K(i, "d") })
|
|
832
832
|
},
|
|
833
833
|
i.toISOString()
|
|
@@ -835,15 +835,15 @@ const hr = "_calendarContainer_160wn_3", pr = "_calendarHeader_160wn_17", br = "
|
|
|
835
835
|
}) })
|
|
836
836
|
] });
|
|
837
837
|
};
|
|
838
|
-
|
|
839
|
-
const
|
|
840
|
-
fieldset:
|
|
841
|
-
description:
|
|
838
|
+
Er.displayName = "DatePicker";
|
|
839
|
+
const jr = "_fieldset_17wt1_4", Nr = "_description_17wt1_15", Rr = "_error_17wt1_22", Tr = "_inputWrapper_17wt1_30", Sr = "_inputWrapperError_17wt1_42", $r = "_suffixButton_17wt1_100", Mr = "_suffixButtonInteractive_17wt1_120", W = {
|
|
840
|
+
fieldset: jr,
|
|
841
|
+
description: Nr,
|
|
842
842
|
error: Rr,
|
|
843
|
-
inputWrapper:
|
|
844
|
-
inputWrapperError:
|
|
845
|
-
suffixButton:
|
|
846
|
-
suffixButtonInteractive:
|
|
843
|
+
inputWrapper: Tr,
|
|
844
|
+
inputWrapperError: Sr,
|
|
845
|
+
suffixButton: $r,
|
|
846
|
+
suffixButtonInteractive: Mr
|
|
847
847
|
}, ve = (e) => {
|
|
848
848
|
const r = e.slice(0, 2), a = e.slice(2, 4), o = e.slice(4, 8);
|
|
849
849
|
return e.length > 4 ? `${r}.${a}.${o}` : e.length > 2 ? `${r}.${a}` : e.length > 0 ? r : "";
|
|
@@ -858,15 +858,15 @@ const Er = "_fieldset_17wt1_4", jr = "_description_17wt1_15", Rr = "_error_17wt1
|
|
|
858
858
|
!isNaN(a) && a > 12 && (r = r.substring(0, 2) + "12" + r.substring(4));
|
|
859
859
|
}
|
|
860
860
|
return r.slice(0, 8);
|
|
861
|
-
}, Dr =
|
|
861
|
+
}, Dr = S(
|
|
862
862
|
(e, r) => {
|
|
863
863
|
const {
|
|
864
864
|
label: a,
|
|
865
865
|
suffixIcon: o,
|
|
866
866
|
onSuffixClick: s,
|
|
867
|
-
className:
|
|
867
|
+
className: u,
|
|
868
868
|
// For outer fieldset
|
|
869
|
-
inputWrapperClassName:
|
|
869
|
+
inputWrapperClassName: d,
|
|
870
870
|
// For input wrapper div
|
|
871
871
|
inputClassName: m,
|
|
872
872
|
// For the actual input element
|
|
@@ -874,15 +874,15 @@ const Er = "_fieldset_17wt1_4", jr = "_description_17wt1_15", Rr = "_error_17wt1
|
|
|
874
874
|
defaultValue: _,
|
|
875
875
|
onChange: w,
|
|
876
876
|
readOnly: v,
|
|
877
|
-
placeholder:
|
|
877
|
+
placeholder: N = "dd.mm.åååå",
|
|
878
878
|
id: C,
|
|
879
879
|
name: H,
|
|
880
|
-
required:
|
|
880
|
+
required: $,
|
|
881
881
|
disabled: i,
|
|
882
|
-
onClick:
|
|
882
|
+
onClick: R,
|
|
883
883
|
onFocus: P,
|
|
884
884
|
// Pass external onFocus
|
|
885
|
-
onBlur:
|
|
885
|
+
onBlur: M,
|
|
886
886
|
// Pass external onBlur
|
|
887
887
|
autoComplete: z = "off",
|
|
888
888
|
"aria-label": L,
|
|
@@ -891,49 +891,49 @@ const Er = "_fieldset_17wt1_4", jr = "_description_17wt1_15", Rr = "_error_17wt1
|
|
|
891
891
|
error: T,
|
|
892
892
|
// Use error prop for styling
|
|
893
893
|
...le
|
|
894
|
-
} = e, B = y !== void 0, g =
|
|
894
|
+
} = e, B = y !== void 0, g = Re(null);
|
|
895
895
|
ye.useImperativeHandle(
|
|
896
896
|
r,
|
|
897
897
|
() => g.current
|
|
898
898
|
);
|
|
899
|
-
const D =
|
|
899
|
+
const D = Y(
|
|
900
900
|
(h) => {
|
|
901
|
-
const b = ge(h),
|
|
902
|
-
return ve(
|
|
901
|
+
const b = ge(h), O = ke(b);
|
|
902
|
+
return ve(O);
|
|
903
903
|
},
|
|
904
904
|
[]
|
|
905
|
-
), [
|
|
905
|
+
), [A, I] = _e(
|
|
906
906
|
() => D(y ?? _)
|
|
907
907
|
);
|
|
908
908
|
we(() => {
|
|
909
909
|
if (B) {
|
|
910
910
|
const h = D(y);
|
|
911
|
-
h !==
|
|
911
|
+
h !== A && (I(h), g.current && g.current.value !== h && (g.current.value = h));
|
|
912
912
|
}
|
|
913
|
-
}, [y, B,
|
|
914
|
-
const te =
|
|
913
|
+
}, [y, B, A, D]);
|
|
914
|
+
const te = Y(
|
|
915
915
|
(h) => {
|
|
916
|
-
const b = h.target,
|
|
916
|
+
const b = h.target, O = b.value, q = A, p = ge(O).slice(0, 8), E = ke(p), x = ve(E);
|
|
917
917
|
let j = 0;
|
|
918
918
|
const X = E.length;
|
|
919
919
|
X <= 2 ? j = X : X <= 4 ? j = X + 1 : j = X + 2, j = Math.min(j, x.length), requestAnimationFrame(() => {
|
|
920
920
|
if (g.current && (I(x), g.current.value = x, g.current.setSelectionRange(j, j), (x !== q || B) && w)) {
|
|
921
|
-
const
|
|
921
|
+
const Ne = {
|
|
922
922
|
...h,
|
|
923
923
|
target: { ...b, value: x }
|
|
924
924
|
};
|
|
925
|
-
w(
|
|
925
|
+
w(Ne, x);
|
|
926
926
|
}
|
|
927
927
|
});
|
|
928
928
|
},
|
|
929
|
-
[
|
|
929
|
+
[A, B, w, D]
|
|
930
930
|
// Added isControlled and getFormattedValue
|
|
931
|
-
), re = [
|
|
932
|
-
|
|
931
|
+
), re = [W.fieldset, u].filter(Boolean).join(" "), ae = [
|
|
932
|
+
W.inputWrapper,
|
|
933
933
|
// Base style from InputField CSS
|
|
934
|
-
|
|
934
|
+
d,
|
|
935
935
|
// Allow external override/extension
|
|
936
|
-
T ?
|
|
936
|
+
T ? W.inputWrapperError : ""
|
|
937
937
|
// Apply error class based on prop
|
|
938
938
|
// Add disabled class if your CSS defines one for the wrapper
|
|
939
939
|
// disabled ? styles.inputWrapperDisabled : '',
|
|
@@ -942,9 +942,9 @@ const Er = "_fieldset_17wt1_4", jr = "_description_17wt1_15", Rr = "_error_17wt1
|
|
|
942
942
|
m
|
|
943
943
|
// Allow external override/extension
|
|
944
944
|
].filter(Boolean).join(" "), oe = [
|
|
945
|
-
|
|
945
|
+
W.suffixButton,
|
|
946
946
|
// Base style from InputField CSS
|
|
947
|
-
s ?
|
|
947
|
+
s ? W.suffixButtonInteractive : ""
|
|
948
948
|
// Add interactive class if clickable
|
|
949
949
|
// Add disabled class if your CSS defines one for the button
|
|
950
950
|
// disabled ? styles.suffixButtonDisabled : '',
|
|
@@ -955,7 +955,7 @@ const Er = "_fieldset_17wt1_4", jr = "_description_17wt1_15", Rr = "_error_17wt1
|
|
|
955
955
|
// Use the fieldset structure and classes from InputField CSS
|
|
956
956
|
/* @__PURE__ */ l.jsxs("div", { className: re, children: [
|
|
957
957
|
a && typeof a == "string" ? /* @__PURE__ */ l.jsx("label", { id: t, htmlFor: C, children: a }) : a,
|
|
958
|
-
G && /* @__PURE__ */ l.jsxs("p", { id: n, className:
|
|
958
|
+
G && /* @__PURE__ */ l.jsxs("p", { id: n, className: W.description, children: [
|
|
959
959
|
" ",
|
|
960
960
|
G
|
|
961
961
|
] }),
|
|
@@ -968,17 +968,17 @@ const Er = "_fieldset_17wt1_4", jr = "_description_17wt1_15", Rr = "_error_17wt1
|
|
|
968
968
|
inputMode: "numeric",
|
|
969
969
|
pattern: "\\d{2}\\.\\d{2}\\.\\d{4}",
|
|
970
970
|
maxLength: 10,
|
|
971
|
-
value:
|
|
971
|
+
value: A,
|
|
972
972
|
readOnly: v,
|
|
973
|
-
placeholder:
|
|
973
|
+
placeholder: N,
|
|
974
974
|
id: C,
|
|
975
975
|
name: H,
|
|
976
|
-
required:
|
|
976
|
+
required: $,
|
|
977
977
|
disabled: i,
|
|
978
|
-
onClick:
|
|
978
|
+
onClick: R,
|
|
979
979
|
onChange: te,
|
|
980
980
|
onFocus: P,
|
|
981
|
-
onBlur:
|
|
981
|
+
onBlur: M,
|
|
982
982
|
autoComplete: z,
|
|
983
983
|
"aria-label": L,
|
|
984
984
|
"aria-labelledby": t,
|
|
@@ -1002,75 +1002,77 @@ const Er = "_fieldset_17wt1_4", jr = "_description_17wt1_15", Rr = "_error_17wt1
|
|
|
1002
1002
|
}
|
|
1003
1003
|
)
|
|
1004
1004
|
] }),
|
|
1005
|
-
T && /* @__PURE__ */ l.jsx("p", { id: c, className:
|
|
1005
|
+
T && /* @__PURE__ */ l.jsx("p", { id: c, className: W.error, role: "alert", children: T })
|
|
1006
1006
|
] })
|
|
1007
1007
|
);
|
|
1008
1008
|
}
|
|
1009
1009
|
);
|
|
1010
1010
|
Dr.displayName = "DateInput";
|
|
1011
|
-
const
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1016
|
-
const
|
|
1017
|
-
|
|
1018
|
-
const
|
|
1011
|
+
const Zr = Ye, ea = He, ta = ze, ra = Ge, aa = qe, na = Je, Ar = Xe, Or = Ke;
|
|
1012
|
+
Ar.displayName = "Field.Description";
|
|
1013
|
+
Or.displayName = "Field.Counter";
|
|
1014
|
+
const oa = Ce, Wr = S((e, r) => /* @__PURE__ */ l.jsx(Ue, { ref: r, ...e }));
|
|
1015
|
+
Wr.displayName = "Heading";
|
|
1016
|
+
const sa = Qe, Lr = S((e, r) => /* @__PURE__ */ l.jsx(Ze, { ref: r, ...e }));
|
|
1017
|
+
Lr.displayName = "Label";
|
|
1018
|
+
const ia = et, la = tt, ca = rt, da = at, Br = S(
|
|
1019
1019
|
(e, r) => /* @__PURE__ */ l.jsx(nt, { ref: r, ...e })
|
|
1020
1020
|
);
|
|
1021
|
-
|
|
1022
|
-
const
|
|
1023
|
-
|
|
1024
|
-
const
|
|
1021
|
+
Br.displayName = "Paragraph";
|
|
1022
|
+
const ua = ot, ma = st, fa = it, ha = lt, pa = ct, ba = dt, va = ut, ga = mt, Ir = ft;
|
|
1023
|
+
Ir.displayName = "Suggestion";
|
|
1024
|
+
const ka = ht, ya = pt, _a = bt, wa = vt, Ca = gt, xa = kt, Pa = yt, Ea = _t, Fr = S((e, r) => /* @__PURE__ */ l.jsx(wt, { ref: r, ...e }));
|
|
1025
|
+
Fr.displayName = "ValidationMessage";
|
|
1025
1026
|
export {
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1027
|
+
St as Alert,
|
|
1028
|
+
$t as Avatar,
|
|
1029
|
+
Mt as Badge,
|
|
1030
|
+
zr as BadgePosition,
|
|
1031
|
+
Gr as Breadcrumbs,
|
|
1032
|
+
Xr as BreadcrumbsItem,
|
|
1033
|
+
Kr as BreadcrumbsLink,
|
|
1034
|
+
qr as BreadcrumbsList,
|
|
1034
1035
|
Dt as Button,
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1036
|
+
At as Card,
|
|
1037
|
+
Jr as CardBlock,
|
|
1038
|
+
Ot as Checkbox,
|
|
1039
|
+
Qr as Chip,
|
|
1039
1040
|
Dr as DateInput,
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
da as
|
|
1041
|
+
Er as DatePicker,
|
|
1042
|
+
Zr as Details,
|
|
1043
|
+
ea as Dialog,
|
|
1044
|
+
ta as Divider,
|
|
1045
|
+
ra as Dropdown,
|
|
1046
|
+
aa as ErrorSummary,
|
|
1047
|
+
na as Field,
|
|
1048
|
+
Or as FieldCounter,
|
|
1049
|
+
Ar as FieldDescription,
|
|
1050
|
+
oa as Fieldset,
|
|
1051
|
+
Wr as Heading,
|
|
1052
|
+
sa as Input,
|
|
1053
|
+
Lr as Label,
|
|
1054
|
+
ia as Link,
|
|
1055
|
+
la as List,
|
|
1056
|
+
ca as Pagination,
|
|
1057
|
+
Br as Paragraph,
|
|
1058
|
+
ua as Popover,
|
|
1059
|
+
ma as Radio,
|
|
1060
|
+
ha as Search,
|
|
1061
|
+
pa as Select,
|
|
1062
|
+
ba as SkeletonLoader,
|
|
1063
|
+
va as SkipLink,
|
|
1064
|
+
ga as Spinner,
|
|
1065
|
+
Ir as Suggestion,
|
|
1066
|
+
ka as Switch,
|
|
1067
|
+
ya as Table,
|
|
1068
|
+
_a as Tabs,
|
|
1069
|
+
wa as Tag,
|
|
1070
|
+
Ca as Textarea,
|
|
1071
|
+
xa as Textfield,
|
|
1072
|
+
Pa as ToggleGroup,
|
|
1073
|
+
Ea as Tooltip,
|
|
1074
|
+
Fr as ValidationMessage,
|
|
1075
|
+
Ur as useCheckboxGroup,
|
|
1076
|
+
da as usePagination,
|
|
1077
|
+
fa as useRadioGroup
|
|
1076
1078
|
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ue;function
|
|
9
|
+
*/var ue;function Oe(){if(ue)return G;ue=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(l,s,b){var h=null;if(b!==void 0&&(h=""+b),s.key!==void 0&&(h=""+s.key),"key"in s){b={};for(var p in s)p!=="key"&&(b[p]=s[p])}else b=s;return s=b.ref,{$$typeof:e,type:l,key:h,ref:s!==void 0?s:null,props:b}}return G.Fragment=r,G.jsx=n,G.jsxs=n,G}var X={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ce;function
|
|
17
|
+
*/var ce;function We(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&(function(){function e(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===H?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case B:return"Fragment";case O:return"Profiler";case c:return"StrictMode";case F:return"Suspense";case te:return"SuspenseList";case se:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case U:return"Portal";case L:return(t.displayName||"Context")+".Provider";case y:return(t._context.displayName||"Context")+".Consumer";case Q:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Z:return i=t.displayName||null,i!==null?i:e(t.type)||"Memo";case W:i=t._payload,t=t._init;try{return e(t(i))}catch{}}return null}function r(t){return""+t}function n(t){try{r(t);var i=!1}catch{i=!0}if(i){i=console;var f=i.error,v=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return f.call(i,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",v),r(t)}}function l(t){if(t===B)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===W)return"<...>";try{var i=e(t);return i?"<"+i+">":"<...>"}catch{return"<...>"}}function s(){var t=P.A;return t===null?null:t.getOwner()}function b(){return Error("react-stack-top-frame")}function h(t){if(I.call(t,"key")){var i=Object.getOwnPropertyDescriptor(t,"key").get;if(i&&i.isReactWarning)return!1}return t.key!==void 0}function p(t,i){function f(){re||(re=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",i))}f.isReactWarning=!0,Object.defineProperty(t,"key",{get:f,configurable:!0})}function E(){var t=e(this.type);return ne[t]||(ne[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function j(t,i,f,v,k,w,V,q){return f=w.ref,t={$$typeof:T,type:t,key:i,props:w,_owner:k},(f!==void 0?f:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:E}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function N(t,i,f,v,k,w,V,q){var g=i.children;if(g!==void 0)if(v)if(R(g)){for(v=0;v<g.length;v++)_(g[v]);Object.freeze&&Object.freeze(g)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(g);if(I.call(i,"key")){g=e(t);var M=Object.keys(i).filter(function(D){return D!=="key"});v=0<M.length?"{key: someKey, "+M.join(": ..., ")+": ...}":"{key: someKey}",ie[g+v]||(M=0<M.length?"{"+M.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,v,g,M,g),ie[g+v]=!0)}if(g=null,f!==void 0&&(n(f),g=""+f),h(i)&&(n(i.key),g=""+i.key),"key"in i){f={};for(var S in i)S!=="key"&&(f[S]=i[S])}else f=i;return g&&p(f,typeof t=="function"?t.displayName||t.name||"Unknown":t),j(t,g,w,k,s(),f,Y,q)}function _(t){typeof t=="object"&&t!==null&&t.$$typeof===T&&t._store&&(t._store.validated=1)}var x=d,T=Symbol.for("react.transitional.element"),U=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),L=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),P=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.prototype.hasOwnProperty,R=Array.isArray,z=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(t){return t()}};var re,ne={},ae=x.react_stack_bottom_frame.bind(x,b)(),oe=z(l(b)),ie={};X.Fragment=B,X.jsx=function(t,i,f,v,k){var w=1e4>P.recentlyCreatedOwnerStacks++;return N(t,i,f,!1,v,k,w?Error("react-stack-top-frame"):ae,w?z(l(t)):oe)},X.jsxs=function(t,i,f,v,k){var w=1e4>P.recentlyCreatedOwnerStacks++;return N(t,i,f,!0,v,k,w?Error("react-stack-top-frame"):ae,w?z(l(t)):oe)}})()),X}var de;function We(){return de||(de=1,process.env.NODE_ENV==="production"?ee.exports=xe():ee.exports=Oe()),ee.exports}var c=We();const fe=d.forwardRef((e,r)=>c.jsx(o.Alert,{ref:r,...e}));fe.displayName="Alert";const me=d.forwardRef((e,r)=>c.jsx(o.Avatar,{ref:r,...e}));me.displayName="Avatar";const he=d.forwardRef((e,r)=>c.jsx(o.Badge,{ref:r,...e}));he.displayName="Badge";const Ae=o.BadgePosition,Be=o.Breadcrumbs,Le=o.BreadcrumbsList,Ie=o.BreadcrumbsItem,Re=o.BreadcrumbsLink,be=o.Button;be.displayName="Button";const pe=o.Card,Ye=o.CardBlock;pe.displayName="Card";const ve=o.Checkbox,Ve=o.Fieldset,Fe=o.useCheckboxGroup;ve.displayName="Checkbox",Ve.displayName="Fieldset";const He=o.Chip;function le(e){return(r={})=>{const n=r.width?String(r.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function K(e){return(r,n)=>{const l=n!=null&&n.context?String(n.context):"standalone";let s;if(l==="formatting"&&e.formattingValues){const h=e.defaultFormattingWidth||e.defaultWidth,p=n!=null&&n.width?String(n.width):h;s=e.formattingValues[p]||e.formattingValues[h]}else{const h=e.defaultWidth,p=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[p]||e.values[h]}const b=e.argumentCallback?e.argumentCallback(r):r;return s[b]}}function J(e){return(r,n={})=>{const l=n.width,s=l&&e.matchPatterns[l]||e.matchPatterns[e.defaultMatchWidth],b=r.match(s);if(!b)return null;const h=b[0],p=l&&e.parsePatterns[l]||e.parsePatterns[e.defaultParseWidth],E=Array.isArray(p)?Ge(p,_=>_.test(h)):ze(p,_=>_.test(h));let j;j=e.valueCallback?e.valueCallback(E):E,j=n.valueCallback?n.valueCallback(j):j;const N=r.slice(h.length);return{value:j,rest:N}}}function ze(e,r){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&r(e[n]))return n}function Ge(e,r){for(let n=0;n<e.length;n++)if(r(e[n]))return n}function Xe(e){return(r,n={})=>{const l=r.match(e.matchPattern);if(!l)return null;const s=l[0],b=r.match(e.parsePattern);if(!b)return null;let h=e.valueCallback?e.valueCallback(b[0]):b[0];h=n.valueCallback?n.valueCallback(h):h;const p=r.slice(s.length);return{value:h,rest:p}}}const Ke={lessThanXSeconds:{one:"mindre enn ett sekund",other:"mindre enn {{count}} sekunder"},xSeconds:{one:"ett sekund",other:"{{count}} sekunder"},halfAMinute:"et halvt minutt",lessThanXMinutes:{one:"mindre enn ett minutt",other:"mindre enn {{count}} minutter"},xMinutes:{one:"ett minutt",other:"{{count}} minutter"},aboutXHours:{one:"omtrent en time",other:"omtrent {{count}} timer"},xHours:{one:"en time",other:"{{count}} timer"},xDays:{one:"en dag",other:"{{count}} dager"},aboutXWeeks:{one:"omtrent en uke",other:"omtrent {{count}} uker"},xWeeks:{one:"en uke",other:"{{count}} uker"},aboutXMonths:{one:"omtrent en måned",other:"omtrent {{count}} måneder"},xMonths:{one:"en måned",other:"{{count}} måneder"},aboutXYears:{one:"omtrent ett år",other:"omtrent {{count}} år"},xYears:{one:"ett år",other:"{{count}} år"},overXYears:{one:"over ett år",other:"over {{count}} år"},almostXYears:{one:"nesten ett år",other:"nesten {{count}} år"}},Je=(e,r,n)=>{let l;const s=Ke[e];return typeof s=="string"?l=s:r===1?l=s.one:l=s.other.replace("{{count}}",String(r)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"om "+l:l+" siden":l},Ue={full:"EEEE d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"dd.MM.y"},Qe={full:"'kl'. HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Ze={full:"{{date}} 'kl.' {{time}}",long:"{{date}} 'kl.' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},qe={date:le({formats:Ue,defaultWidth:"full"}),time:le({formats:Qe,defaultWidth:"full"}),dateTime:le({formats:Ze,defaultWidth:"full"})},$e={lastWeek:"'forrige' eeee 'kl.' p",yesterday:"'i går kl.' p",today:"'i dag kl.' p",tomorrow:"'i morgen kl.' p",nextWeek:"EEEE 'kl.' p",other:"P"},et=(e,r,n,l)=>$e[e],tt={narrow:["f.Kr.","e.Kr."],abbreviated:["f.Kr.","e.Kr."],wide:["før Kristus","etter Kristus"]},rt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. kvartal","2. kvartal","3. kvartal","4. kvartal"]},nt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mars","apr.","mai","juni","juli","aug.","sep.","okt.","nov.","des."],wide:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"]},at={narrow:["S","M","T","O","T","F","L"],short:["sø","ma","ti","on","to","fr","lø"],abbreviated:["søn","man","tir","ons","tor","fre","lør"],wide:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},ot={narrow:{am:"a",pm:"p",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på etterm.",evening:"på kvelden",night:"på natten"},abbreviated:{am:"a.m.",pm:"p.m.",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på etterm.",evening:"på kvelden",night:"på natten"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnatt",noon:"middag",morning:"på morgenen",afternoon:"på ettermiddagen",evening:"på kvelden",night:"på natten"}},it={ordinalNumber:(e,r)=>Number(e)+".",era:K({values:tt,defaultWidth:"wide"}),quarter:K({values:rt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:K({values:nt,defaultWidth:"wide"}),day:K({values:at,defaultWidth:"wide"}),dayPeriod:K({values:ot,defaultWidth:"wide"})},lt=/^(\d+)\.?/i,st=/\d+/i,ut={narrow:/^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,abbreviated:/^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,wide:/^(før Kristus|før vår tid|etter Kristus|vår tid)/i},ct={any:[/^f/i,/^e/i]},dt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? kvartal/i},ft={any:[/1/i,/2/i,/3/i,/4/i]},mt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,wide:/^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i},ht={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^aug/i,/^s/i,/^o/i,/^n/i,/^d/i]},bt={narrow:/^[smtofl]/i,short:/^(sø|ma|ti|on|to|fr|lø)/i,abbreviated:/^(søn|man|tir|ons|tor|fre|lør)/i,wide:/^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i},pt={any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},vt={narrow:/^(midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten)|[ap])/i,any:/^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten))/i},kt={any:{am:/^a(\.?\s?m\.?)?$/i,pm:/^p(\.?\s?m\.?)?$/i,midnight:/^midn/i,noon:/^midd/i,morning:/morgen/i,afternoon:/ettermiddag/i,evening:/kveld/i,night:/natt/i}},gt={ordinalNumber:Xe({matchPattern:lt,parsePattern:st,valueCallback:e=>parseInt(e,10)}),era:J({matchPatterns:ut,defaultMatchWidth:"wide",parsePatterns:ct,defaultParseWidth:"any"}),quarter:J({matchPatterns:dt,defaultMatchWidth:"wide",parsePatterns:ft,defaultParseWidth:"any",valueCallback:e=>e+1}),month:J({matchPatterns:mt,defaultMatchWidth:"wide",parsePatterns:ht,defaultParseWidth:"any"}),day:J({matchPatterns:bt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:vt,defaultMatchWidth:"any",parsePatterns:kt,defaultParseWidth:"any"})},V={code:"nb",formatDistance:Je,formatLong:qe,formatRelative:et,localize:it,match:gt,options:{weekStartsOn:1,firstWeekContainsDate:4}},ke=({title:e,...r})=>c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 28 28",fill:"none","aria-hidden":e?void 0:!0,focusable:"false",...r,children:[e&&c.jsx("title",{children:e}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.952 6.96459C16.6103 6.62289 16.0563 6.62289 15.7146 6.96459L9.2979 13.3813C8.95621 13.723 8.95621 14.277 9.2979 14.6187L15.7146 21.0354C16.0563 21.3771 16.6103 21.3771 16.952 21.0354C17.2937 20.6937 17.2937 20.1396 16.952 19.7979L11.1541 14L16.952 8.20203C17.2937 7.86032 17.2937 7.3063 16.952 6.96459Z",fill:"currentColor"})]});ke.displayName="ChevronLeftIcon";const ge=({title:e,...r})=>c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 28 28",fill:"none","aria-hidden":e?void 0:!0,focusable:"false",...r,children:[e&&c.jsx("title",{children:e}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.048 6.96459C11.3897 6.62289 11.9437 6.62289 12.2854 6.96459L18.7021 13.3813C19.0438 13.723 19.0438 14.277 18.7021 14.6187L12.2854 21.0354C11.9437 21.3771 11.3897 21.3771 11.048 21.0354C10.7063 20.6937 10.7063 20.1396 11.048 19.7979L16.8459 14L11.048 8.20203C10.7063 7.86032 10.7063 7.3063 11.048 6.96459Z",fill:"currentColor"})]});ge.displayName="ChevronRightIcon";const C={calendarContainer:"_calendarContainer_160wn_3",calendarHeader:"_calendarHeader_160wn_17",monthYear:"_monthYear_160wn_24",navigationButtons:"_navigationButtons_160wn_36",grid:"_grid_160wn_45",dayNameCell:"_dayNameCell_160wn_53",dateCell:"_dateCell_160wn_72",dateNumberContainer:"_dateNumberContainer_160wn_107",otherMonth:"_otherMonth_160wn_125",selectedDate:"_selectedDate_160wn_157"},wt=e=>{const r=m.startOfMonth(e),n=m.startOfWeek(r,{locale:V}),l=m.addDays(n,41);return m.eachDayOfInterval({start:n,end:l})},we=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),Ce=({initialDate:e=new Date,selectedDate:r=null,onDateSelect:n})=>{const[l,s]=d.useState(m.startOfMonth(r&&m.isValid(r)?r:e));d.useEffect(()=>{if(r&&m.isValid(r)){const u=m.startOfMonth(r);m.isSameMonth(u,l)||s(u)}},[r]);const b=d.useMemo(()=>m.startOfMonth(new Date),[]),h=d.useMemo(()=>!1,[l,b]),p=d.useMemo(()=>wt(l),[l]),E=d.useMemo(()=>{const u=m.startOfWeek(new Date,{locale:V});return Array.from({length:7}).map((O,y)=>{const L=m.format(m.addDays(u,y),"EEEEEE",{locale:V});return we(L)})},[]),j=d.useCallback(()=>{h||s(u=>m.startOfMonth(m.subMonths(u,1)))},[h]),N=d.useCallback(()=>{s(u=>m.startOfMonth(m.addMonths(u,1)))},[]),_=d.useCallback(u=>{n&&n(u)},[n]),x=d.useCallback((u,O)=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),_(O))},[_]),T=m.format(l,"MMMM",{locale:V}),U=m.format(l,"yyyy",{locale:V}),B=`${we(T)} ${U}`;return c.jsxs("div",{className:C.calendarContainer,children:[c.jsxs("div",{className:C.calendarHeader,children:[c.jsx("span",{className:C.monthYear,children:B}),c.jsxs("div",{className:C.navigationButtons,children:[c.jsx(o.Button,{variant:"tertiary",icon:!0,onClick:j,"aria-label":"Forrige måned",disabled:h,children:c.jsx(ke,{})}),c.jsx(o.Button,{variant:"tertiary",icon:!0,onClick:N,"aria-label":"Neste måned",children:c.jsx(ge,{})})]})]}),c.jsx("div",{className:C.grid,children:E.map(u=>c.jsx("div",{className:C.dayNameCell,children:u},u))}),c.jsx("div",{className:C.grid,children:p.map(u=>{const O=m.isSameMonth(u,l),y=r&&m.isValid(r)&&m.isSameDay(u,r),L=m.isToday(u),Q=[C.dateCell,O?"":C.otherMonth,y?C.selectedDate:"",L&&!y?C.todayDate:""].filter(Boolean).join(" ");return c.jsx("div",{className:Q,onClick:()=>_(u),onKeyDown:F=>x(F,u),role:"button",tabIndex:0,"aria-pressed":y??!1,"aria-label":m.format(u,"PPP",{locale:V}),children:c.jsx("span",{className:C.dateNumberContainer,children:m.format(u,"d")})},u.toISOString())})})]})};Ce.displayName="DatePicker";const A={fieldset:"_fieldset_17wt1_4",description:"_description_17wt1_15",error:"_error_17wt1_22",inputWrapper:"_inputWrapper_17wt1_30",inputWrapperError:"_inputWrapperError_17wt1_42",suffixButton:"_suffixButton_17wt1_100",suffixButtonInteractive:"_suffixButtonInteractive_17wt1_120"},_e=e=>{const r=e.slice(0,2),n=e.slice(2,4),l=e.slice(4,8);return e.length>4?`${r}.${n}.${l}`:e.length>2?`${r}.${n}`:e.length>0?r:""},Pe=e=>(e||"").replace(/\D/g,""),Ee=e=>{let r=e;if(r.length>=2){const n=parseInt(r.substring(0,2),10);!isNaN(n)&&n>31&&(r="31"+r.substring(2))}if(r.length>=4){const n=parseInt(r.substring(2,4),10);!isNaN(n)&&n>12&&(r=r.substring(0,2)+"12"+r.substring(4))}return r.slice(0,8)},je=d.forwardRef((e,r)=>{const{label:n,suffixIcon:l,onSuffixClick:s,className:b,inputWrapperClassName:h,inputClassName:p,value:E,defaultValue:j,onChange:N,readOnly:_,placeholder:x="dd.mm.åååå",id:T,name:U,required:B,disabled:u,onClick:O,onFocus:y,onBlur:L,autoComplete:Q="off","aria-label":F,"aria-labelledby":te,description:Z,error:W,...se}=e,H=E!==void 0,P=d.useRef(null);d.useImperativeHandle(r,()=>P.current);const I=d.useCallback(k=>{const w=Pe(k),Y=Ee(w);return _e(Y)},[]),[R,z]=d.useState(()=>I(E??j));d.useEffect(()=>{if(H){const k=I(E);k!==R&&(z(k),P.current&&P.current.value!==k&&(P.current.value=k))}},[E,H,R,I]);const re=d.useCallback(k=>{const w=k.target,Y=w.value,q=R,g=Pe(Y).slice(0,8),M=Ee(g),S=_e(M);let D=0;const $=M.length;$<=2?D=$:$<=4?D=$+1:D=$+2,D=Math.min(D,S.length),requestAnimationFrame(()=>{if(P.current&&(z(S),P.current.value=S,P.current.setSelectionRange(D,D),(S!==q||H)&&N)){const Ut={...k,target:{...w,value:S}};N(Ut,S)}})},[R,H,N,I]),ne=[A.fieldset,b].filter(Boolean).join(" "),ae=[A.inputWrapper,h,W?A.inputWrapperError:""].filter(Boolean).join(" "),oe=[p].filter(Boolean).join(" "),ie=[A.suffixButton,s?A.suffixButtonInteractive:""].filter(Boolean).join(" ");!n&&!F&&!te&&console.warn("Warning: DateInput component should have a label, aria-label, or aria-labelledby for accessibility.");const t=n&&typeof n=="string"?te||`${T}-label`:void 0,i=Z?`${T}-desc`:void 0,f=W?`${T}-err`:void 0,v=[i,f].filter(Boolean).join(" ")||void 0;return c.jsxs("div",{className:ne,children:[n&&typeof n=="string"?c.jsx("label",{id:t,htmlFor:T,children:n}):n,Z&&c.jsxs("p",{id:i,className:A.description,children:[" ",Z]}),c.jsxs("div",{className:ae,children:[c.jsx("input",{ref:P,type:"text",inputMode:"numeric",pattern:"\\d{2}\\.\\d{2}\\.\\d{4}",maxLength:10,value:R,readOnly:_,placeholder:x,id:T,name:U,required:B,disabled:u,onClick:O,onChange:re,onFocus:y,onBlur:L,autoComplete:Q,"aria-label":F,"aria-labelledby":t,"aria-describedby":v,"aria-invalid":!!W,className:oe,...se}),l&&c.jsx("button",{type:"button",className:ie,onClick:u?void 0:s,tabIndex:s&&!u?0:-1,"aria-hidden":!s,disabled:u,"aria-label":s?"Åpne datovelger":void 0,children:l})]}),W&&c.jsx("p",{id:f,className:A.error,role:"alert",children:W})]})});je.displayName="DateInput";const Ct=o.Details,_t=o.Dialog,Pt=o.Divider,Et=o.Dropdown,jt=o.ErrorSummary,Nt=o.Field,Ne=o.FieldDescription,Te=o.FieldCounter;Ne.displayName="Field.Description",Te.displayName="Field.Counter";const Tt=o.Fieldset,Se=d.forwardRef((e,r)=>c.jsx(o.Heading,{ref:r,...e}));Se.displayName="Heading";const St=o.Input,ye=d.forwardRef((e,r)=>c.jsx(o.Label,{ref:r,...e}));ye.displayName="Label";const yt=o.Link,Mt=o.List,Dt=o.Pagination,xt=o.usePagination,Me=d.forwardRef((e,r)=>c.jsx(o.Paragraph,{ref:r,...e}));Me.displayName="Paragraph";const Ot=o.Popover,Wt=o.Radio,At=o.useRadioGroup,Bt=o.Search,Lt=o.Select,It=o.Skeleton,Rt=o.SkipLink,Yt=o.Spinner,De=o.EXPERIMENTAL_Suggestion;De.displayName="Suggestion";const Vt=o.Switch,Ft=o.Table,Ht=o.Tabs,zt=o.Tag,Gt=o.Textarea,Xt=o.Textfield,Kt=o.ToggleGroup,Jt=o.Tooltip;a.Alert=fe,a.Avatar=me,a.Badge=he,a.BadgePosition=Ae,a.Breadcrumbs=Be,a.BreadcrumbsItem=Ie,a.BreadcrumbsLink=Re,a.BreadcrumbsList=Le,a.Button=be,a.Card=pe,a.CardBlock=Ye,a.Checkbox=ve,a.Chip=He,a.DateInput=je,a.DatePicker=Ce,a.Details=Ct,a.Dialog=_t,a.Divider=Pt,a.Dropdown=Et,a.ErrorSummary=jt,a.Field=Nt,a.FieldCounter=Te,a.FieldDescription=Ne,a.Fieldset=Tt,a.Heading=Se,a.Input=St,a.Label=ye,a.Link=yt,a.List=Mt,a.Pagination=Dt,a.Paragraph=Me,a.Popover=Ot,a.Radio=Wt,a.Search=Bt,a.Select=Lt,a.SkeletonLoader=It,a.SkipLink=Rt,a.Spinner=Yt,a.Suggestion=De,a.Switch=Vt,a.Table=Ft,a.Tabs=Ht,a.Tag=zt,a.Textarea=Gt,a.Textfield=Xt,a.ToggleGroup=Kt,a.Tooltip=Jt,a.useCheckboxGroup=Fe,a.usePagination=xt,a.useRadioGroup=At,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
|
|
22
|
+
<%s key={someKey} {...props} />`,v,g,M,g),ie[g+v]=!0)}if(g=null,f!==void 0&&(n(f),g=""+f),h(i)&&(n(i.key),g=""+i.key),"key"in i){f={};for(var S in i)S!=="key"&&(f[S]=i[S])}else f=i;return g&&p(f,typeof t=="function"?t.displayName||t.name||"Unknown":t),j(t,g,w,k,s(),f,V,q)}function _(t){typeof t=="object"&&t!==null&&t.$$typeof===T&&t._store&&(t._store.validated=1)}var x=d,T=Symbol.for("react.transitional.element"),U=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),L=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),P=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.prototype.hasOwnProperty,R=Array.isArray,z=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(t){return t()}};var re,ne={},ae=x.react_stack_bottom_frame.bind(x,b)(),oe=z(l(b)),ie={};X.Fragment=B,X.jsx=function(t,i,f,v,k){var w=1e4>P.recentlyCreatedOwnerStacks++;return N(t,i,f,!1,v,k,w?Error("react-stack-top-frame"):ae,w?z(l(t)):oe)},X.jsxs=function(t,i,f,v,k){var w=1e4>P.recentlyCreatedOwnerStacks++;return N(t,i,f,!0,v,k,w?Error("react-stack-top-frame"):ae,w?z(l(t)):oe)}})()),X}var de;function Ae(){return de||(de=1,process.env.NODE_ENV==="production"?ee.exports=Oe():ee.exports=We()),ee.exports}var u=Ae();const fe=d.forwardRef((e,r)=>u.jsx(o.Alert,{ref:r,...e}));fe.displayName="Alert";const me=d.forwardRef((e,r)=>u.jsx(o.Avatar,{ref:r,...e}));me.displayName="Avatar";const he=d.forwardRef((e,r)=>u.jsx(o.Badge,{ref:r,...e}));he.displayName="Badge";const Be=o.BadgePosition,Le=o.Breadcrumbs,Ie=o.BreadcrumbsList,Re=o.BreadcrumbsItem,Ve=o.BreadcrumbsLink,be=o.Button;be.displayName="Button";const pe=o.Card,Ye=o.CardBlock;pe.displayName="Card";const ve=o.Checkbox,Fe=o.Fieldset,He=o.useCheckboxGroup;ve.displayName="Checkbox",Fe.displayName="Fieldset";const ze=o.Chip;function le(e){return(r={})=>{const n=r.width?String(r.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function K(e){return(r,n)=>{const l=n!=null&&n.context?String(n.context):"standalone";let s;if(l==="formatting"&&e.formattingValues){const h=e.defaultFormattingWidth||e.defaultWidth,p=n!=null&&n.width?String(n.width):h;s=e.formattingValues[p]||e.formattingValues[h]}else{const h=e.defaultWidth,p=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[p]||e.values[h]}const b=e.argumentCallback?e.argumentCallback(r):r;return s[b]}}function J(e){return(r,n={})=>{const l=n.width,s=l&&e.matchPatterns[l]||e.matchPatterns[e.defaultMatchWidth],b=r.match(s);if(!b)return null;const h=b[0],p=l&&e.parsePatterns[l]||e.parsePatterns[e.defaultParseWidth],E=Array.isArray(p)?Xe(p,_=>_.test(h)):Ge(p,_=>_.test(h));let j;j=e.valueCallback?e.valueCallback(E):E,j=n.valueCallback?n.valueCallback(j):j;const N=r.slice(h.length);return{value:j,rest:N}}}function Ge(e,r){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&r(e[n]))return n}function Xe(e,r){for(let n=0;n<e.length;n++)if(r(e[n]))return n}function Ke(e){return(r,n={})=>{const l=r.match(e.matchPattern);if(!l)return null;const s=l[0],b=r.match(e.parsePattern);if(!b)return null;let h=e.valueCallback?e.valueCallback(b[0]):b[0];h=n.valueCallback?n.valueCallback(h):h;const p=r.slice(s.length);return{value:h,rest:p}}}const Je={lessThanXSeconds:{one:"mindre enn ett sekund",other:"mindre enn {{count}} sekunder"},xSeconds:{one:"ett sekund",other:"{{count}} sekunder"},halfAMinute:"et halvt minutt",lessThanXMinutes:{one:"mindre enn ett minutt",other:"mindre enn {{count}} minutter"},xMinutes:{one:"ett minutt",other:"{{count}} minutter"},aboutXHours:{one:"omtrent en time",other:"omtrent {{count}} timer"},xHours:{one:"en time",other:"{{count}} timer"},xDays:{one:"en dag",other:"{{count}} dager"},aboutXWeeks:{one:"omtrent en uke",other:"omtrent {{count}} uker"},xWeeks:{one:"en uke",other:"{{count}} uker"},aboutXMonths:{one:"omtrent en måned",other:"omtrent {{count}} måneder"},xMonths:{one:"en måned",other:"{{count}} måneder"},aboutXYears:{one:"omtrent ett år",other:"omtrent {{count}} år"},xYears:{one:"ett år",other:"{{count}} år"},overXYears:{one:"over ett år",other:"over {{count}} år"},almostXYears:{one:"nesten ett år",other:"nesten {{count}} år"}},Ue=(e,r,n)=>{let l;const s=Je[e];return typeof s=="string"?l=s:r===1?l=s.one:l=s.other.replace("{{count}}",String(r)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"om "+l:l+" siden":l},Qe={full:"EEEE d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"dd.MM.y"},Ze={full:"'kl'. HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},qe={full:"{{date}} 'kl.' {{time}}",long:"{{date}} 'kl.' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},$e={date:le({formats:Qe,defaultWidth:"full"}),time:le({formats:Ze,defaultWidth:"full"}),dateTime:le({formats:qe,defaultWidth:"full"})},et={lastWeek:"'forrige' eeee 'kl.' p",yesterday:"'i går kl.' p",today:"'i dag kl.' p",tomorrow:"'i morgen kl.' p",nextWeek:"EEEE 'kl.' p",other:"P"},tt=(e,r,n,l)=>et[e],rt={narrow:["f.Kr.","e.Kr."],abbreviated:["f.Kr.","e.Kr."],wide:["før Kristus","etter Kristus"]},nt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. kvartal","2. kvartal","3. kvartal","4. kvartal"]},at={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mars","apr.","mai","juni","juli","aug.","sep.","okt.","nov.","des."],wide:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"]},ot={narrow:["S","M","T","O","T","F","L"],short:["sø","ma","ti","on","to","fr","lø"],abbreviated:["søn","man","tir","ons","tor","fre","lør"],wide:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},it={narrow:{am:"a",pm:"p",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på etterm.",evening:"på kvelden",night:"på natten"},abbreviated:{am:"a.m.",pm:"p.m.",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på etterm.",evening:"på kvelden",night:"på natten"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnatt",noon:"middag",morning:"på morgenen",afternoon:"på ettermiddagen",evening:"på kvelden",night:"på natten"}},lt={ordinalNumber:(e,r)=>Number(e)+".",era:K({values:rt,defaultWidth:"wide"}),quarter:K({values:nt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:K({values:at,defaultWidth:"wide"}),day:K({values:ot,defaultWidth:"wide"}),dayPeriod:K({values:it,defaultWidth:"wide"})},st=/^(\d+)\.?/i,ut=/\d+/i,ct={narrow:/^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,abbreviated:/^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,wide:/^(før Kristus|før vår tid|etter Kristus|vår tid)/i},dt={any:[/^f/i,/^e/i]},ft={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? kvartal/i},mt={any:[/1/i,/2/i,/3/i,/4/i]},ht={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,wide:/^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i},bt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^aug/i,/^s/i,/^o/i,/^n/i,/^d/i]},pt={narrow:/^[smtofl]/i,short:/^(sø|ma|ti|on|to|fr|lø)/i,abbreviated:/^(søn|man|tir|ons|tor|fre|lør)/i,wide:/^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i},vt={any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},kt={narrow:/^(midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten)|[ap])/i,any:/^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten))/i},gt={any:{am:/^a(\.?\s?m\.?)?$/i,pm:/^p(\.?\s?m\.?)?$/i,midnight:/^midn/i,noon:/^midd/i,morning:/morgen/i,afternoon:/ettermiddag/i,evening:/kveld/i,night:/natt/i}},wt={ordinalNumber:Ke({matchPattern:st,parsePattern:ut,valueCallback:e=>parseInt(e,10)}),era:J({matchPatterns:ct,defaultMatchWidth:"wide",parsePatterns:dt,defaultParseWidth:"any"}),quarter:J({matchPatterns:ft,defaultMatchWidth:"wide",parsePatterns:mt,defaultParseWidth:"any",valueCallback:e=>e+1}),month:J({matchPatterns:ht,defaultMatchWidth:"wide",parsePatterns:bt,defaultParseWidth:"any"}),day:J({matchPatterns:pt,defaultMatchWidth:"wide",parsePatterns:vt,defaultParseWidth:"any"}),dayPeriod:J({matchPatterns:kt,defaultMatchWidth:"any",parsePatterns:gt,defaultParseWidth:"any"})},Y={code:"nb",formatDistance:Ue,formatLong:$e,formatRelative:tt,localize:lt,match:wt,options:{weekStartsOn:1,firstWeekContainsDate:4}},ke=({title:e,...r})=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 28 28",fill:"none","aria-hidden":e?void 0:!0,focusable:"false",...r,children:[e&&u.jsx("title",{children:e}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.952 6.96459C16.6103 6.62289 16.0563 6.62289 15.7146 6.96459L9.2979 13.3813C8.95621 13.723 8.95621 14.277 9.2979 14.6187L15.7146 21.0354C16.0563 21.3771 16.6103 21.3771 16.952 21.0354C17.2937 20.6937 17.2937 20.1396 16.952 19.7979L11.1541 14L16.952 8.20203C17.2937 7.86032 17.2937 7.3063 16.952 6.96459Z",fill:"currentColor"})]});ke.displayName="ChevronLeftIcon";const ge=({title:e,...r})=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 28 28",fill:"none","aria-hidden":e?void 0:!0,focusable:"false",...r,children:[e&&u.jsx("title",{children:e}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.048 6.96459C11.3897 6.62289 11.9437 6.62289 12.2854 6.96459L18.7021 13.3813C19.0438 13.723 19.0438 14.277 18.7021 14.6187L12.2854 21.0354C11.9437 21.3771 11.3897 21.3771 11.048 21.0354C10.7063 20.6937 10.7063 20.1396 11.048 19.7979L16.8459 14L11.048 8.20203C10.7063 7.86032 10.7063 7.3063 11.048 6.96459Z",fill:"currentColor"})]});ge.displayName="ChevronRightIcon";const C={calendarContainer:"_calendarContainer_160wn_3",calendarHeader:"_calendarHeader_160wn_17",monthYear:"_monthYear_160wn_24",navigationButtons:"_navigationButtons_160wn_36",grid:"_grid_160wn_45",dayNameCell:"_dayNameCell_160wn_53",dateCell:"_dateCell_160wn_72",dateNumberContainer:"_dateNumberContainer_160wn_107",otherMonth:"_otherMonth_160wn_125",selectedDate:"_selectedDate_160wn_157"},Ct=e=>{const r=m.startOfMonth(e),n=m.startOfWeek(r,{locale:Y}),l=m.addDays(n,41);return m.eachDayOfInterval({start:n,end:l})},we=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),Ce=({initialDate:e=new Date,selectedDate:r=null,onDateSelect:n})=>{const[l,s]=d.useState(m.startOfMonth(r&&m.isValid(r)?r:e));d.useEffect(()=>{if(r&&m.isValid(r)){const c=m.startOfMonth(r);m.isSameMonth(c,l)||s(c)}},[r]);const b=d.useMemo(()=>m.startOfMonth(new Date),[]),h=d.useMemo(()=>!1,[l,b]),p=d.useMemo(()=>Ct(l),[l]),E=d.useMemo(()=>{const c=m.startOfWeek(new Date,{locale:Y});return Array.from({length:7}).map((O,y)=>{const L=m.format(m.addDays(c,y),"EEEEEE",{locale:Y});return we(L)})},[]),j=d.useCallback(()=>{h||s(c=>m.startOfMonth(m.subMonths(c,1)))},[h]),N=d.useCallback(()=>{s(c=>m.startOfMonth(m.addMonths(c,1)))},[]),_=d.useCallback(c=>{n&&n(c)},[n]),x=d.useCallback((c,O)=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),_(O))},[_]),T=m.format(l,"MMMM",{locale:Y}),U=m.format(l,"yyyy",{locale:Y}),B=`${we(T)} ${U}`;return u.jsxs("div",{className:C.calendarContainer,children:[u.jsxs("div",{className:C.calendarHeader,children:[u.jsx("span",{className:C.monthYear,children:B}),u.jsxs("div",{className:C.navigationButtons,children:[u.jsx(o.Button,{variant:"tertiary",icon:!0,onClick:j,"aria-label":"Forrige måned",disabled:h,children:u.jsx(ke,{})}),u.jsx(o.Button,{variant:"tertiary",icon:!0,onClick:N,"aria-label":"Neste måned",children:u.jsx(ge,{})})]})]}),u.jsx("div",{className:C.grid,children:E.map(c=>u.jsx("div",{className:C.dayNameCell,children:c},c))}),u.jsx("div",{className:C.grid,children:p.map(c=>{const O=m.isSameMonth(c,l),y=r&&m.isValid(r)&&m.isSameDay(c,r),L=m.isToday(c),Q=[C.dateCell,O?"":C.otherMonth,y?C.selectedDate:"",L&&!y?C.todayDate:""].filter(Boolean).join(" ");return u.jsx("div",{className:Q,onClick:()=>_(c),onKeyDown:F=>x(F,c),role:"button",tabIndex:0,"aria-pressed":y??!1,"aria-label":m.format(c,"PPP",{locale:Y}),children:u.jsx("span",{className:C.dateNumberContainer,children:m.format(c,"d")})},c.toISOString())})})]})};Ce.displayName="DatePicker";const A={fieldset:"_fieldset_17wt1_4",description:"_description_17wt1_15",error:"_error_17wt1_22",inputWrapper:"_inputWrapper_17wt1_30",inputWrapperError:"_inputWrapperError_17wt1_42",suffixButton:"_suffixButton_17wt1_100",suffixButtonInteractive:"_suffixButtonInteractive_17wt1_120"},_e=e=>{const r=e.slice(0,2),n=e.slice(2,4),l=e.slice(4,8);return e.length>4?`${r}.${n}.${l}`:e.length>2?`${r}.${n}`:e.length>0?r:""},Pe=e=>(e||"").replace(/\D/g,""),Ee=e=>{let r=e;if(r.length>=2){const n=parseInt(r.substring(0,2),10);!isNaN(n)&&n>31&&(r="31"+r.substring(2))}if(r.length>=4){const n=parseInt(r.substring(2,4),10);!isNaN(n)&&n>12&&(r=r.substring(0,2)+"12"+r.substring(4))}return r.slice(0,8)},je=d.forwardRef((e,r)=>{const{label:n,suffixIcon:l,onSuffixClick:s,className:b,inputWrapperClassName:h,inputClassName:p,value:E,defaultValue:j,onChange:N,readOnly:_,placeholder:x="dd.mm.åååå",id:T,name:U,required:B,disabled:c,onClick:O,onFocus:y,onBlur:L,autoComplete:Q="off","aria-label":F,"aria-labelledby":te,description:Z,error:W,...se}=e,H=E!==void 0,P=d.useRef(null);d.useImperativeHandle(r,()=>P.current);const I=d.useCallback(k=>{const w=Pe(k),V=Ee(w);return _e(V)},[]),[R,z]=d.useState(()=>I(E??j));d.useEffect(()=>{if(H){const k=I(E);k!==R&&(z(k),P.current&&P.current.value!==k&&(P.current.value=k))}},[E,H,R,I]);const re=d.useCallback(k=>{const w=k.target,V=w.value,q=R,g=Pe(V).slice(0,8),M=Ee(g),S=_e(M);let D=0;const $=M.length;$<=2?D=$:$<=4?D=$+1:D=$+2,D=Math.min(D,S.length),requestAnimationFrame(()=>{if(P.current&&(z(S),P.current.value=S,P.current.setSelectionRange(D,D),(S!==q||H)&&N)){const Qt={...k,target:{...w,value:S}};N(Qt,S)}})},[R,H,N,I]),ne=[A.fieldset,b].filter(Boolean).join(" "),ae=[A.inputWrapper,h,W?A.inputWrapperError:""].filter(Boolean).join(" "),oe=[p].filter(Boolean).join(" "),ie=[A.suffixButton,s?A.suffixButtonInteractive:""].filter(Boolean).join(" ");!n&&!F&&!te&&console.warn("Warning: DateInput component should have a label, aria-label, or aria-labelledby for accessibility.");const t=n&&typeof n=="string"?te||`${T}-label`:void 0,i=Z?`${T}-desc`:void 0,f=W?`${T}-err`:void 0,v=[i,f].filter(Boolean).join(" ")||void 0;return u.jsxs("div",{className:ne,children:[n&&typeof n=="string"?u.jsx("label",{id:t,htmlFor:T,children:n}):n,Z&&u.jsxs("p",{id:i,className:A.description,children:[" ",Z]}),u.jsxs("div",{className:ae,children:[u.jsx("input",{ref:P,type:"text",inputMode:"numeric",pattern:"\\d{2}\\.\\d{2}\\.\\d{4}",maxLength:10,value:R,readOnly:_,placeholder:x,id:T,name:U,required:B,disabled:c,onClick:O,onChange:re,onFocus:y,onBlur:L,autoComplete:Q,"aria-label":F,"aria-labelledby":t,"aria-describedby":v,"aria-invalid":!!W,className:oe,...se}),l&&u.jsx("button",{type:"button",className:ie,onClick:c?void 0:s,tabIndex:s&&!c?0:-1,"aria-hidden":!s,disabled:c,"aria-label":s?"Åpne datovelger":void 0,children:l})]}),W&&u.jsx("p",{id:f,className:A.error,role:"alert",children:W})]})});je.displayName="DateInput";const _t=o.Details,Pt=o.Dialog,Et=o.Divider,jt=o.Dropdown,Nt=o.ErrorSummary,Tt=o.Field,Ne=o.FieldDescription,Te=o.FieldCounter;Ne.displayName="Field.Description",Te.displayName="Field.Counter";const St=o.Fieldset,Se=d.forwardRef((e,r)=>u.jsx(o.Heading,{ref:r,...e}));Se.displayName="Heading";const yt=o.Input,ye=d.forwardRef((e,r)=>u.jsx(o.Label,{ref:r,...e}));ye.displayName="Label";const Mt=o.Link,Dt=o.List,xt=o.Pagination,Ot=o.usePagination,Me=d.forwardRef((e,r)=>u.jsx(o.Paragraph,{ref:r,...e}));Me.displayName="Paragraph";const Wt=o.Popover,At=o.Radio,Bt=o.useRadioGroup,Lt=o.Search,It=o.Select,Rt=o.Skeleton,Vt=o.SkipLink,Yt=o.Spinner,De=o.EXPERIMENTAL_Suggestion;De.displayName="Suggestion";const Ft=o.Switch,Ht=o.Table,zt=o.Tabs,Gt=o.Tag,Xt=o.Textarea,Kt=o.Textfield,Jt=o.ToggleGroup,Ut=o.Tooltip,xe=d.forwardRef((e,r)=>u.jsx(o.ValidationMessage,{ref:r,...e}));xe.displayName="ValidationMessage",a.Alert=fe,a.Avatar=me,a.Badge=he,a.BadgePosition=Be,a.Breadcrumbs=Le,a.BreadcrumbsItem=Re,a.BreadcrumbsLink=Ve,a.BreadcrumbsList=Ie,a.Button=be,a.Card=pe,a.CardBlock=Ye,a.Checkbox=ve,a.Chip=ze,a.DateInput=je,a.DatePicker=Ce,a.Details=_t,a.Dialog=Pt,a.Divider=Et,a.Dropdown=jt,a.ErrorSummary=Nt,a.Field=Tt,a.FieldCounter=Te,a.FieldDescription=Ne,a.Fieldset=St,a.Heading=Se,a.Input=yt,a.Label=ye,a.Link=Mt,a.List=Dt,a.Pagination=xt,a.Paragraph=Me,a.Popover=Wt,a.Radio=At,a.Search=Lt,a.Select=It,a.SkeletonLoader=Rt,a.SkipLink=Vt,a.Spinner=Yt,a.Suggestion=De,a.Switch=Ft,a.Table=Ht,a.Tabs=zt,a.Tag=Gt,a.Textarea=Xt,a.Textfield=Kt,a.ToggleGroup=Jt,a.Tooltip=Ut,a.ValidationMessage=xe,a.useCheckboxGroup=He,a.usePagination=Ot,a.useRadioGroup=Bt,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ import { UHTMLComboboxElement } from '@u-elements/u-combobox';
|
|
|
96
96
|
import { useCheckboxGroup } from './components/Checkbox';
|
|
97
97
|
import { usePagination } from './components/Pagination';
|
|
98
98
|
import { useRadioGroup } from './components/Radio';
|
|
99
|
+
import { ValidationMessageProps as ValidationMessageProps_2 } from './components';
|
|
99
100
|
|
|
100
101
|
export declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
101
102
|
|
|
@@ -352,4 +353,10 @@ export { usePagination }
|
|
|
352
353
|
|
|
353
354
|
export { useRadioGroup }
|
|
354
355
|
|
|
356
|
+
export declare const ValidationMessage: React.ForwardRefExoticComponent<ValidationMessageProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
357
|
+
|
|
358
|
+
export declare interface ValidationMessageProps extends ValidationMessageProps_2 {
|
|
359
|
+
children?: ReactNode;
|
|
360
|
+
}
|
|
361
|
+
|
|
355
362
|
export { }
|