rk-designsystem 1.1.30 → 1.1.32

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.
@@ -1,7 +1,7 @@
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
- var ie = { exports: {} }, J = {};
1
+ import ye, { forwardRef as R, useState as _e, useEffect as we, useMemo as ie, useCallback as V, 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 de, 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 at, usePagination as rt, Paragraph as nt, Popover as ot, Radio as st, useRadioGroup as it, Search as lt, Select as ct, Skeleton as ut, SkipLink as dt, 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 I, isValid as ce, isSameMonth as me, startOfWeek as xe, format as J, addDays as Pe, subMonths as Ct, addMonths as xt, isSameDay as Pt, isToday as Et, eachDayOfInterval as jt } from "date-fns";
4
+ var le = { exports: {} }, U = {};
5
5
  /**
6
6
  * @license React
7
7
  * react-jsx-runtime.production.js
@@ -13,27 +13,27 @@ var ie = { exports: {} }, J = {};
13
13
  */
14
14
  var fe;
15
15
  function Nt() {
16
- if (fe) return J;
16
+ if (fe) return U;
17
17
  fe = 1;
18
- var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
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
- for (var m in s)
24
- m !== "key" && (u[m] = s[m]);
25
- } else u = s;
26
- return s = u.ref, {
27
- $$typeof: e,
18
+ var t = Symbol.for("react.transitional.element"), a = Symbol.for("react.fragment");
19
+ function r(o, i, m) {
20
+ var u = null;
21
+ if (m !== void 0 && (u = "" + m), i.key !== void 0 && (u = "" + i.key), "key" in i) {
22
+ m = {};
23
+ for (var h in i)
24
+ h !== "key" && (m[h] = i[h]);
25
+ } else m = i;
26
+ return i = m.ref, {
27
+ $$typeof: t,
28
28
  type: o,
29
- key: d,
30
- ref: s !== void 0 ? s : null,
31
- props: u
29
+ key: u,
30
+ ref: i !== void 0 ? i : null,
31
+ props: m
32
32
  };
33
33
  }
34
- return J.Fragment = r, J.jsx = a, J.jsxs = a, J;
34
+ return U.Fragment = a, U.jsx = r, U.jsxs = r, U;
35
35
  }
36
- var U = {};
36
+ var Q = {};
37
37
  /**
38
38
  * @license React
39
39
  * react-jsx-runtime.development.js
@@ -46,314 +46,312 @@ var U = {};
46
46
  var he;
47
47
  function Rt() {
48
48
  return he || (he = 1, process.env.NODE_ENV !== "production" && (function() {
49
- function e(t) {
50
- if (t == null) return null;
51
- if (typeof t == "function")
52
- return t.$$typeof === B ? null : t.displayName || t.name || null;
53
- if (typeof t == "string") return t;
54
- switch (t) {
55
- case $:
49
+ function t(e) {
50
+ if (e == null) return null;
51
+ if (typeof e == "function")
52
+ return e.$$typeof === _ ? null : e.displayName || e.name || null;
53
+ if (typeof e == "string") return e;
54
+ switch (e) {
55
+ case s:
56
56
  return "Fragment";
57
- case R:
57
+ case w:
58
58
  return "Profiler";
59
- case i:
59
+ case x:
60
60
  return "StrictMode";
61
- case L:
61
+ case te:
62
62
  return "Suspense";
63
- case ee:
63
+ case z:
64
64
  return "SuspenseList";
65
- case le:
65
+ case L:
66
66
  return "Activity";
67
67
  }
68
- if (typeof t == "object")
69
- switch (typeof t.tag == "number" && console.error(
68
+ if (typeof e == "object")
69
+ switch (typeof e.tag == "number" && console.error(
70
70
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
71
- ), t.$$typeof) {
72
- case H:
71
+ ), e.$$typeof) {
72
+ case Y:
73
73
  return "Portal";
74
- case M:
75
- return (t.displayName || "Context") + ".Provider";
76
- case P:
77
- return (t._context.displayName || "Context") + ".Consumer";
78
- case z:
79
- var n = t.render;
80
- return t = t.displayName, t || (t = n.displayName || n.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
81
- case G:
82
- return n = t.displayName || null, n !== null ? n : e(t.type) || "Memo";
74
+ case H:
75
+ return e.displayName || "Context";
83
76
  case T:
84
- n = t._payload, t = t._init;
77
+ return (e._context.displayName || "Context") + ".Consumer";
78
+ case W:
79
+ var n = e.render;
80
+ return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
81
+ case S:
82
+ return n = e.displayName || null, n !== null ? n : t(e.type) || "Memo";
83
+ case G:
84
+ n = e._payload, e = e._init;
85
85
  try {
86
- return e(t(n));
86
+ return t(e(n));
87
87
  } catch {
88
88
  }
89
89
  }
90
90
  return null;
91
91
  }
92
- function r(t) {
93
- return "" + t;
92
+ function a(e) {
93
+ return "" + e;
94
94
  }
95
- function a(t) {
95
+ function r(e) {
96
96
  try {
97
- r(t);
97
+ a(e);
98
98
  var n = !1;
99
99
  } catch {
100
100
  n = !0;
101
101
  }
102
102
  if (n) {
103
103
  n = console;
104
- var c = n.error, f = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
105
- return c.call(
104
+ var d = n.error, c = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
105
+ return d.call(
106
106
  n,
107
107
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
108
- f
109
- ), r(t);
108
+ c
109
+ ), a(e);
110
110
  }
111
111
  }
112
- function o(t) {
113
- if (t === $) return "<>";
114
- if (typeof t == "object" && t !== null && t.$$typeof === T)
112
+ function o(e) {
113
+ if (e === s) return "<>";
114
+ if (typeof e == "object" && e !== null && e.$$typeof === G)
115
115
  return "<...>";
116
116
  try {
117
- var n = e(t);
117
+ var n = t(e);
118
118
  return n ? "<" + n + ">" : "<...>";
119
119
  } catch {
120
120
  return "<...>";
121
121
  }
122
122
  }
123
- function s() {
124
- var t = g.A;
125
- return t === null ? null : t.getOwner();
123
+ function i() {
124
+ var e = P.A;
125
+ return e === null ? null : e.getOwner();
126
126
  }
127
- function u() {
127
+ function m() {
128
128
  return Error("react-stack-top-frame");
129
129
  }
130
- function d(t) {
131
- if (D.call(t, "key")) {
132
- var n = Object.getOwnPropertyDescriptor(t, "key").get;
130
+ function u(e) {
131
+ if (E.call(e, "key")) {
132
+ var n = Object.getOwnPropertyDescriptor(e, "key").get;
133
133
  if (n && n.isReactWarning) return !1;
134
134
  }
135
- return t.key !== void 0;
135
+ return e.key !== void 0;
136
136
  }
137
- function m(t, n) {
138
- function c() {
139
- te || (te = !0, console.error(
137
+ function h(e, n) {
138
+ function d() {
139
+ re || (re = !0, console.error(
140
140
  "%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)",
141
141
  n
142
142
  ));
143
143
  }
144
- c.isReactWarning = !0, Object.defineProperty(t, "key", {
145
- get: c,
144
+ d.isReactWarning = !0, Object.defineProperty(e, "key", {
145
+ get: d,
146
146
  configurable: !0
147
147
  });
148
148
  }
149
- function y() {
150
- var t = e(this.type);
151
- return re[t] || (re[t] = !0, console.error(
149
+ function g() {
150
+ var e = t(this.type);
151
+ return ne[e] || (ne[e] = !0, console.error(
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
- )), t = this.props.ref, t !== void 0 ? t : null;
153
+ )), e = this.props.ref, e !== void 0 ? e : null;
154
154
  }
155
- function _(t, n, c, f, h, b, O, q) {
156
- return c = b.ref, t = {
157
- $$typeof: C,
158
- type: t,
155
+ function k(e, n, d, c, C, $) {
156
+ var f = d.ref;
157
+ return e = {
158
+ $$typeof: O,
159
+ type: e,
159
160
  key: n,
160
- props: b,
161
- _owner: h
162
- }, (c !== void 0 ? c : null) !== null ? Object.defineProperty(t, "ref", {
161
+ props: d,
162
+ _owner: c
163
+ }, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
163
164
  enumerable: !1,
164
- get: y
165
- }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
165
+ get: g
166
+ }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
166
167
  configurable: !1,
167
168
  enumerable: !1,
168
169
  writable: !0,
169
170
  value: 0
170
- }), Object.defineProperty(t, "_debugInfo", {
171
+ }), Object.defineProperty(e, "_debugInfo", {
171
172
  configurable: !1,
172
173
  enumerable: !1,
173
174
  writable: !0,
174
175
  value: null
175
- }), Object.defineProperty(t, "_debugStack", {
176
+ }), Object.defineProperty(e, "_debugStack", {
176
177
  configurable: !1,
177
178
  enumerable: !1,
178
179
  writable: !0,
179
- value: O
180
- }), Object.defineProperty(t, "_debugTask", {
180
+ value: C
181
+ }), Object.defineProperty(e, "_debugTask", {
181
182
  configurable: !1,
182
183
  enumerable: !1,
183
184
  writable: !0,
184
- value: q
185
- }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
185
+ value: $
186
+ }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
186
187
  }
187
- function w(t, n, c, f, h, b, O, q) {
188
- var p = n.children;
189
- if (p !== void 0)
190
- if (f)
191
- if (A(p)) {
192
- for (f = 0; f < p.length; f++)
193
- v(p[f]);
194
- Object.freeze && Object.freeze(p);
188
+ function y(e, n, d, c, C, $) {
189
+ var f = n.children;
190
+ if (f !== void 0)
191
+ if (c)
192
+ if (ae(f)) {
193
+ for (c = 0; c < f.length; c++)
194
+ p(f[c]);
195
+ Object.freeze && Object.freeze(f);
195
196
  } else
196
197
  console.error(
197
198
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
198
199
  );
199
- else v(p);
200
- if (D.call(n, "key")) {
201
- p = e(t);
202
- var E = Object.keys(n).filter(function(j) {
203
- return j !== "key";
200
+ else p(f);
201
+ if (E.call(n, "key")) {
202
+ f = t(e);
203
+ var j = Object.keys(n).filter(function(N) {
204
+ return N !== "key";
204
205
  });
205
- f = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", oe[p + f] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
206
+ c = 0 < j.length ? "{key: someKey, " + j.join(": ..., ") + ": ...}" : "{key: someKey}", X[f + c] || (j = 0 < j.length ? "{" + j.join(": ..., ") + ": ...}" : "{}", console.error(
206
207
  `A props object containing a "key" prop is being spread into JSX:
207
208
  let props = %s;
208
209
  <%s {...props} />
209
210
  React keys must be passed directly to JSX without using spread:
210
211
  let props = %s;
211
212
  <%s key={someKey} {...props} />`,
213
+ c,
212
214
  f,
213
- p,
214
- E,
215
- p
216
- ), oe[p + f] = !0);
215
+ j,
216
+ f
217
+ ), X[f + c] = !0);
217
218
  }
218
- if (p = null, c !== void 0 && (a(c), p = "" + c), d(n) && (a(n.key), p = "" + n.key), "key" in n) {
219
- c = {};
220
- for (var x in n)
221
- x !== "key" && (c[x] = n[x]);
222
- } else c = n;
223
- return p && m(
224
- c,
225
- typeof t == "function" ? t.displayName || t.name || "Unknown" : t
226
- ), _(
227
- t,
228
- p,
229
- b,
230
- h,
231
- s(),
232
- c,
233
- O,
234
- q
219
+ if (f = null, d !== void 0 && (r(d), f = "" + d), u(n) && (r(n.key), f = "" + n.key), "key" in n) {
220
+ d = {};
221
+ for (var B in n)
222
+ B !== "key" && (d[B] = n[B]);
223
+ } else d = n;
224
+ return f && h(
225
+ d,
226
+ typeof e == "function" ? e.displayName || e.name || "Unknown" : e
227
+ ), k(
228
+ e,
229
+ f,
230
+ d,
231
+ i(),
232
+ C,
233
+ $
235
234
  );
236
235
  }
237
- function v(t) {
238
- typeof t == "object" && t !== null && t.$$typeof === C && t._store && (t._store.validated = 1);
236
+ function p(e) {
237
+ A(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === G && (e._payload.status === "fulfilled" ? A(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
239
238
  }
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() {
239
+ function A(e) {
240
+ return typeof e == "object" && e !== null && e.$$typeof === O;
241
+ }
242
+ var b = ye, O = Symbol.for("react.transitional.element"), Y = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), H = Symbol.for("react.context"), W = Symbol.for("react.forward_ref"), te = Symbol.for("react.suspense"), z = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), G = Symbol.for("react.lazy"), L = Symbol.for("react.activity"), _ = Symbol.for("react.client.reference"), P = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, E = Object.prototype.hasOwnProperty, ae = Array.isArray, q = console.createTask ? console.createTask : function() {
241
243
  return null;
242
244
  };
243
- N = {
244
- react_stack_bottom_frame: function(t) {
245
- return t();
245
+ b = {
246
+ react_stack_bottom_frame: function(e) {
247
+ return e();
246
248
  }
247
249
  };
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
- var b = 1e4 > g.recentlyCreatedOwnerStacks++;
254
- return w(
255
- t,
250
+ var re, ne = {}, oe = b.react_stack_bottom_frame.bind(
251
+ b,
252
+ m
253
+ )(), se = q(o(m)), X = {};
254
+ Q.Fragment = s, Q.jsx = function(e, n, d) {
255
+ var c = 1e4 > P.recentlyCreatedOwnerStacks++;
256
+ return y(
257
+ e,
256
258
  n,
257
- c,
259
+ d,
258
260
  !1,
259
- f,
260
- h,
261
- b ? Error("react-stack-top-frame") : ae,
262
- b ? I(o(t)) : ne
261
+ c ? Error("react-stack-top-frame") : oe,
262
+ c ? q(o(e)) : se
263
263
  );
264
- }, U.jsxs = function(t, n, c, f, h) {
265
- var b = 1e4 > g.recentlyCreatedOwnerStacks++;
266
- return w(
267
- t,
264
+ }, Q.jsxs = function(e, n, d) {
265
+ var c = 1e4 > P.recentlyCreatedOwnerStacks++;
266
+ return y(
267
+ e,
268
268
  n,
269
- c,
269
+ d,
270
270
  !0,
271
- f,
272
- h,
273
- b ? Error("react-stack-top-frame") : ae,
274
- b ? I(o(t)) : ne
271
+ c ? Error("react-stack-top-frame") : oe,
272
+ c ? q(o(e)) : se
275
273
  );
276
274
  };
277
- })()), U;
275
+ })()), Q;
278
276
  }
279
277
  var pe;
280
278
  function Tt() {
281
- return pe || (pe = 1, process.env.NODE_ENV === "production" ? ie.exports = Nt() : ie.exports = Rt()), ie.exports;
279
+ return pe || (pe = 1, process.env.NODE_ENV === "production" ? le.exports = Nt() : le.exports = Rt()), le.exports;
282
280
  }
283
281
  var l = Tt();
284
- const St = S((e, r) => /* @__PURE__ */ l.jsx(Te, { ref: r, ...e }));
282
+ const St = R((t, a) => /* @__PURE__ */ l.jsx(Te, { ref: a, ...t }));
285
283
  St.displayName = "Alert";
286
- const $t = S((e, r) => /* @__PURE__ */ l.jsx(Se, { ref: r, ...e }));
284
+ const $t = R((t, a) => /* @__PURE__ */ l.jsx(Se, { ref: a, ...t }));
287
285
  $t.displayName = "Avatar";
288
- const Mt = S((e, r) => /* @__PURE__ */ l.jsx($e, { ref: r, ...e }));
286
+ const Mt = R((t, a) => /* @__PURE__ */ l.jsx($e, { ref: a, ...t }));
289
287
  Mt.displayName = "Badge";
290
- const zr = Me, Gr = De, qr = Ae, Xr = Oe, Kr = We, Dt = ue;
288
+ const za = Me, Ga = De, qa = Ae, Xa = Oe, Ka = We, Dt = de;
291
289
  Dt.displayName = "Button";
292
- const At = Le, Jr = Be;
290
+ const At = Le, Ja = Be;
293
291
  At.displayName = "Card";
294
- const Ot = Ie, Wt = Ce, Ur = Fe;
292
+ const Ot = Ie, Wt = Ce, Ua = Fe;
295
293
  Ot.displayName = "Checkbox";
296
294
  Wt.displayName = "Fieldset";
297
- const Qr = Ve;
298
- function de(e) {
299
- return (r = {}) => {
300
- const a = r.width ? String(r.width) : e.defaultWidth;
301
- return e.formats[a] || e.formats[e.defaultWidth];
295
+ const Qa = Ve;
296
+ function ue(t) {
297
+ return (a = {}) => {
298
+ const r = a.width ? String(a.width) : t.defaultWidth;
299
+ return t.formats[r] || t.formats[t.defaultWidth];
302
300
  };
303
301
  }
304
- function Q(e) {
305
- return (r, a) => {
306
- const o = a != null && a.context ? String(a.context) : "standalone";
307
- let s;
308
- if (o === "formatting" && 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];
302
+ function Z(t) {
303
+ return (a, r) => {
304
+ const o = r != null && r.context ? String(r.context) : "standalone";
305
+ let i;
306
+ if (o === "formatting" && t.formattingValues) {
307
+ const u = t.defaultFormattingWidth || t.defaultWidth, h = r != null && r.width ? String(r.width) : u;
308
+ i = t.formattingValues[h] || t.formattingValues[u];
311
309
  } else {
312
- const d = e.defaultWidth, m = a != null && a.width ? String(a.width) : e.defaultWidth;
313
- s = e.values[m] || e.values[d];
310
+ const u = t.defaultWidth, h = r != null && r.width ? String(r.width) : t.defaultWidth;
311
+ i = t.values[h] || t.values[u];
314
312
  }
315
- const u = e.argumentCallback ? e.argumentCallback(r) : r;
316
- return s[u];
313
+ const m = t.argumentCallback ? t.argumentCallback(a) : a;
314
+ return i[m];
317
315
  };
318
316
  }
319
- function Z(e) {
320
- return (r, a = {}) => {
321
- const o = a.width, s = o && e.matchPatterns[o] || e.matchPatterns[e.defaultMatchWidth], u = r.match(s);
322
- if (!u)
317
+ function ee(t) {
318
+ return (a, r = {}) => {
319
+ const o = r.width, i = o && t.matchPatterns[o] || t.matchPatterns[t.defaultMatchWidth], m = a.match(i);
320
+ if (!m)
323
321
  return null;
324
- const d = u[0], m = o && e.parsePatterns[o] || e.parsePatterns[e.defaultParseWidth], y = Array.isArray(m) ? Bt(m, (v) => v.test(d)) : (
322
+ const u = m[0], h = o && t.parsePatterns[o] || t.parsePatterns[t.defaultParseWidth], g = Array.isArray(h) ? Bt(h, (p) => p.test(u)) : (
325
323
  // [TODO] -- I challenge you to fix the type
326
- Lt(m, (v) => v.test(d))
324
+ Lt(h, (p) => p.test(u))
327
325
  );
328
- let _;
329
- _ = e.valueCallback ? e.valueCallback(y) : y, _ = a.valueCallback ? (
326
+ let k;
327
+ k = t.valueCallback ? t.valueCallback(g) : g, k = r.valueCallback ? (
330
328
  // [TODO] -- I challenge you to fix the type
331
- a.valueCallback(_)
332
- ) : _;
333
- const w = r.slice(d.length);
334
- return { value: _, rest: w };
329
+ r.valueCallback(k)
330
+ ) : k;
331
+ const y = a.slice(u.length);
332
+ return { value: k, rest: y };
335
333
  };
336
334
  }
337
- function Lt(e, r) {
338
- for (const a in e)
339
- if (Object.prototype.hasOwnProperty.call(e, a) && r(e[a]))
340
- return a;
335
+ function Lt(t, a) {
336
+ for (const r in t)
337
+ if (Object.prototype.hasOwnProperty.call(t, r) && a(t[r]))
338
+ return r;
341
339
  }
342
- function Bt(e, r) {
343
- for (let a = 0; a < e.length; a++)
344
- if (r(e[a]))
345
- return a;
340
+ function Bt(t, a) {
341
+ for (let r = 0; r < t.length; r++)
342
+ if (a(t[r]))
343
+ return r;
346
344
  }
347
- function It(e) {
348
- return (r, a = {}) => {
349
- const o = r.match(e.matchPattern);
345
+ function It(t) {
346
+ return (a, r = {}) => {
347
+ const o = a.match(t.matchPattern);
350
348
  if (!o) return null;
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
- const m = r.slice(s.length);
356
- return { value: d, rest: m };
349
+ const i = o[0], m = a.match(t.parsePattern);
350
+ if (!m) return null;
351
+ let u = t.valueCallback ? t.valueCallback(m[0]) : m[0];
352
+ u = r.valueCallback ? r.valueCallback(u) : u;
353
+ const h = a.slice(i.length);
354
+ return { value: u, rest: h };
357
355
  };
358
356
  }
359
357
  const Ft = {
@@ -418,10 +416,10 @@ const Ft = {
418
416
  one: "nesten ett år",
419
417
  other: "nesten {{count}} år"
420
418
  }
421
- }, Vt = (e, r, a) => {
419
+ }, Vt = (t, a, r) => {
422
420
  let o;
423
- const s = Ft[e];
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;
421
+ const i = Ft[t];
422
+ return typeof i == "string" ? o = i : a === 1 ? o = i.one : o = i.other.replace("{{count}}", String(a)), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "om " + o : o + " siden" : o;
425
423
  }, Yt = {
426
424
  full: "EEEE d. MMMM y",
427
425
  long: "d. MMMM y",
@@ -438,15 +436,15 @@ const Ft = {
438
436
  medium: "{{date}} {{time}}",
439
437
  short: "{{date}} {{time}}"
440
438
  }, Gt = {
441
- date: de({
439
+ date: ue({
442
440
  formats: Yt,
443
441
  defaultWidth: "full"
444
442
  }),
445
- time: de({
443
+ time: ue({
446
444
  formats: Ht,
447
445
  defaultWidth: "full"
448
446
  }),
449
- dateTime: de({
447
+ dateTime: ue({
450
448
  formats: zt,
451
449
  defaultWidth: "full"
452
450
  })
@@ -457,7 +455,7 @@ const Ft = {
457
455
  tomorrow: "'i morgen kl.' p",
458
456
  nextWeek: "EEEE 'kl.' p",
459
457
  other: "P"
460
- }, Xt = (e, r, a, o) => qt[e], Kt = {
458
+ }, Xt = (t, a, r, o) => qt[t], Kt = {
461
459
  narrow: ["f.Kr.", "e.Kr."],
462
460
  abbreviated: ["f.Kr.", "e.Kr."],
463
461
  wide: ["før Kristus", "etter Kristus"]
@@ -539,46 +537,46 @@ const Ft = {
539
537
  evening: "på kvelden",
540
538
  night: "på natten"
541
539
  }
542
- }, er = (e, r) => Number(e) + ".", tr = {
543
- ordinalNumber: er,
544
- era: Q({
540
+ }, ea = (t, a) => Number(t) + ".", ta = {
541
+ ordinalNumber: ea,
542
+ era: Z({
545
543
  values: Kt,
546
544
  defaultWidth: "wide"
547
545
  }),
548
- quarter: Q({
546
+ quarter: Z({
549
547
  values: Jt,
550
548
  defaultWidth: "wide",
551
- argumentCallback: (e) => e - 1
549
+ argumentCallback: (t) => t - 1
552
550
  }),
553
- month: Q({
551
+ month: Z({
554
552
  values: Ut,
555
553
  defaultWidth: "wide"
556
554
  }),
557
- day: Q({
555
+ day: Z({
558
556
  values: Qt,
559
557
  defaultWidth: "wide"
560
558
  }),
561
- dayPeriod: Q({
559
+ dayPeriod: Z({
562
560
  values: Zt,
563
561
  defaultWidth: "wide"
564
562
  })
565
- }, rr = /^(\d+)\.?/i, ar = /\d+/i, nr = {
563
+ }, aa = /^(\d+)\.?/i, ra = /\d+/i, na = {
566
564
  narrow: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
567
565
  abbreviated: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
568
566
  wide: /^(før Kristus|før vår tid|etter Kristus|vår tid)/i
569
- }, or = {
567
+ }, oa = {
570
568
  any: [/^f/i, /^e/i]
571
- }, sr = {
569
+ }, sa = {
572
570
  narrow: /^[1234]/i,
573
571
  abbreviated: /^q[1234]/i,
574
572
  wide: /^[1234](\.)? kvartal/i
575
- }, ir = {
573
+ }, ia = {
576
574
  any: [/1/i, /2/i, /3/i, /4/i]
577
- }, lr = {
575
+ }, la = {
578
576
  narrow: /^[jfmasond]/i,
579
577
  abbreviated: /^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,
580
578
  wide: /^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i
581
- }, cr = {
579
+ }, ca = {
582
580
  narrow: [
583
581
  /^j/i,
584
582
  /^f/i,
@@ -607,17 +605,17 @@ const Ft = {
607
605
  /^n/i,
608
606
  /^d/i
609
607
  ]
610
- }, dr = {
608
+ }, ua = {
611
609
  narrow: /^[smtofl]/i,
612
610
  short: /^(sø|ma|ti|on|to|fr|lø)/i,
613
611
  abbreviated: /^(søn|man|tir|ons|tor|fre|lør)/i,
614
612
  wide: /^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i
615
- }, ur = {
613
+ }, da = {
616
614
  any: [/^s/i, /^m/i, /^ti/i, /^o/i, /^to/i, /^f/i, /^l/i]
617
- }, mr = {
615
+ }, ma = {
618
616
  narrow: /^(midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten)|[ap])/i,
619
617
  any: /^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten))/i
620
- }, fr = {
618
+ }, fa = {
621
619
  any: {
622
620
  am: /^a(\.?\s?m\.?)?$/i,
623
621
  pm: /^p(\.?\s?m\.?)?$/i,
@@ -628,55 +626,55 @@ const Ft = {
628
626
  evening: /kveld/i,
629
627
  night: /natt/i
630
628
  }
631
- }, hr = {
629
+ }, ha = {
632
630
  ordinalNumber: It({
633
- matchPattern: rr,
634
- parsePattern: ar,
635
- valueCallback: (e) => parseInt(e, 10)
631
+ matchPattern: aa,
632
+ parsePattern: ra,
633
+ valueCallback: (t) => parseInt(t, 10)
636
634
  }),
637
- era: Z({
638
- matchPatterns: nr,
635
+ era: ee({
636
+ matchPatterns: na,
639
637
  defaultMatchWidth: "wide",
640
- parsePatterns: or,
638
+ parsePatterns: oa,
641
639
  defaultParseWidth: "any"
642
640
  }),
643
- quarter: Z({
644
- matchPatterns: sr,
641
+ quarter: ee({
642
+ matchPatterns: sa,
645
643
  defaultMatchWidth: "wide",
646
- parsePatterns: ir,
644
+ parsePatterns: ia,
647
645
  defaultParseWidth: "any",
648
- valueCallback: (e) => e + 1
646
+ valueCallback: (t) => t + 1
649
647
  }),
650
- month: Z({
651
- matchPatterns: lr,
648
+ month: ee({
649
+ matchPatterns: la,
652
650
  defaultMatchWidth: "wide",
653
- parsePatterns: cr,
651
+ parsePatterns: ca,
654
652
  defaultParseWidth: "any"
655
653
  }),
656
- day: Z({
657
- matchPatterns: dr,
654
+ day: ee({
655
+ matchPatterns: ua,
658
656
  defaultMatchWidth: "wide",
659
- parsePatterns: ur,
657
+ parsePatterns: da,
660
658
  defaultParseWidth: "any"
661
659
  }),
662
- dayPeriod: Z({
663
- matchPatterns: mr,
660
+ dayPeriod: ee({
661
+ matchPatterns: ma,
664
662
  defaultMatchWidth: "any",
665
- parsePatterns: fr,
663
+ parsePatterns: fa,
666
664
  defaultParseWidth: "any"
667
665
  })
668
- }, V = {
666
+ }, F = {
669
667
  code: "nb",
670
668
  formatDistance: Vt,
671
669
  formatLong: Gt,
672
670
  formatRelative: Xt,
673
- localize: tr,
674
- match: hr,
671
+ localize: ta,
672
+ match: ha,
675
673
  options: {
676
674
  weekStartsOn: 1,
677
675
  firstWeekContainsDate: 4
678
676
  }
679
- }, Ee = ({ title: e, ...r }) => /* @__PURE__ */ l.jsxs(
677
+ }, Ee = ({ title: t, ...a }) => /* @__PURE__ */ l.jsxs(
680
678
  "svg",
681
679
  {
682
680
  xmlns: "http://www.w3.org/2000/svg",
@@ -684,11 +682,11 @@ const Ft = {
684
682
  height: "1em",
685
683
  viewBox: "0 0 28 28",
686
684
  fill: "none",
687
- "aria-hidden": e ? void 0 : !0,
685
+ "aria-hidden": t ? void 0 : !0,
688
686
  focusable: "false",
689
- ...r,
687
+ ...a,
690
688
  children: [
691
- e && /* @__PURE__ */ l.jsx("title", { children: e }),
689
+ t && /* @__PURE__ */ l.jsx("title", { children: t }),
692
690
  /* @__PURE__ */ l.jsx(
693
691
  "path",
694
692
  {
@@ -702,7 +700,7 @@ const Ft = {
702
700
  }
703
701
  );
704
702
  Ee.displayName = "ChevronLeftIcon";
705
- const je = ({ title: e, ...r }) => /* @__PURE__ */ l.jsxs(
703
+ const je = ({ title: t, ...a }) => /* @__PURE__ */ l.jsxs(
706
704
  "svg",
707
705
  {
708
706
  xmlns: "http://www.w3.org/2000/svg",
@@ -710,11 +708,11 @@ const je = ({ title: e, ...r }) => /* @__PURE__ */ l.jsxs(
710
708
  height: "1em",
711
709
  viewBox: "0 0 28 28",
712
710
  fill: "none",
713
- "aria-hidden": e ? void 0 : !0,
711
+ "aria-hidden": t ? void 0 : !0,
714
712
  focusable: "false",
715
- ...r,
713
+ ...a,
716
714
  children: [
717
- e && /* @__PURE__ */ l.jsx("title", { children: e }),
715
+ t && /* @__PURE__ */ l.jsx("title", { children: t }),
718
716
  /* @__PURE__ */ l.jsx(
719
717
  "path",
720
718
  {
@@ -728,351 +726,351 @@ const je = ({ title: e, ...r }) => /* @__PURE__ */ l.jsxs(
728
726
  }
729
727
  );
730
728
  je.displayName = "ChevronRightIcon";
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
- initialDate: e = /* @__PURE__ */ new Date(),
747
- selectedDate: r = null,
729
+ const pa = "_calendarContainer_160wn_3", ba = "_calendarHeader_160wn_17", va = "_monthYear_160wn_24", ga = "_navigationButtons_160wn_36", ka = "_grid_160wn_45", ya = "_dayNameCell_160wn_53", _a = "_dateCell_160wn_72", wa = "_dateNumberContainer_160wn_107", Ca = "_otherMonth_160wn_125", xa = "_selectedDate_160wn_157", v = {
730
+ calendarContainer: pa,
731
+ calendarHeader: ba,
732
+ monthYear: va,
733
+ navigationButtons: ga,
734
+ grid: ka,
735
+ dayNameCell: ya,
736
+ dateCell: _a,
737
+ dateNumberContainer: wa,
738
+ otherMonth: Ca,
739
+ selectedDate: xa
740
+ }, Pa = (t) => {
741
+ const a = I(t), r = xe(a, { locale: F }), o = Pe(r, 41);
742
+ return jt({ start: r, end: o });
743
+ }, be = (t) => t && t.charAt(0).toUpperCase() + t.slice(1), Ea = ({
744
+ initialDate: t = /* @__PURE__ */ new Date(),
745
+ selectedDate: a = null,
748
746
  // Prop for selected date
749
- onDateSelect: a
747
+ onDateSelect: r
750
748
  }) => {
751
- const [o, s] = _e(
749
+ const [o, i] = _e(
752
750
  // Initialize with selectedDate's month if valid, otherwise initialDate's month
753
- F(r && ce(r) ? r : e)
751
+ I(a && ce(a) ? a : t)
754
752
  );
755
753
  we(() => {
756
- if (r && ce(r)) {
757
- const i = F(r);
758
- me(i, o) || s(i);
754
+ if (a && ce(a)) {
755
+ const s = I(a);
756
+ me(s, o) || i(s);
759
757
  }
760
- }, [r]);
761
- const u = se(() => F(/* @__PURE__ */ new Date()), []), d = se(() => !1, [o, u]), m = se(
762
- () => Pr(o),
758
+ }, [a]);
759
+ const m = ie(() => I(/* @__PURE__ */ new Date()), []), u = ie(() => !1, [o, m]), h = ie(
760
+ () => Pa(o),
763
761
  [o]
764
- ), y = se(() => {
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);
762
+ ), g = ie(() => {
763
+ const s = xe(/* @__PURE__ */ new Date(), { locale: F });
764
+ return Array.from({ length: 7 }).map((x, w) => {
765
+ const T = J(Pe(s, w), "EEEEEE", { locale: F });
766
+ return be(T);
769
767
  });
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
- (i) => {
776
- a && a(i);
768
+ }, []), k = V(() => {
769
+ u || i((s) => I(Ct(s, 1)));
770
+ }, [u]), y = V(() => {
771
+ i((s) => I(xt(s, 1)));
772
+ }, []), p = V(
773
+ (s) => {
774
+ r && r(s);
777
775
  },
778
- [a]
779
- ), N = Y(
780
- (i, R) => {
781
- (i.key === "Enter" || i.key === " ") && (i.preventDefault(), v(R));
776
+ [r]
777
+ ), A = V(
778
+ (s, x) => {
779
+ (s.key === "Enter" || s.key === " ") && (s.preventDefault(), p(x));
782
780
  },
783
- [v]
784
- ), C = K(o, "MMMM", { locale: V }), H = K(o, "yyyy", { locale: V }), $ = `${be(C)} ${H}`;
785
- return /* @__PURE__ */ l.jsxs("div", { className: k.calendarContainer, children: [
786
- /* @__PURE__ */ l.jsxs("div", { className: k.calendarHeader, children: [
787
- /* @__PURE__ */ l.jsx("span", { className: k.monthYear, children: $ }),
788
- /* @__PURE__ */ l.jsxs("div", { className: k.navigationButtons, children: [
781
+ [p]
782
+ ), b = J(o, "MMMM", { locale: F }), O = J(o, "yyyy", { locale: F }), Y = `${be(b)} ${O}`;
783
+ return /* @__PURE__ */ l.jsxs("div", { className: v.calendarContainer, children: [
784
+ /* @__PURE__ */ l.jsxs("div", { className: v.calendarHeader, children: [
785
+ /* @__PURE__ */ l.jsx("span", { className: v.monthYear, children: Y }),
786
+ /* @__PURE__ */ l.jsxs("div", { className: v.navigationButtons, children: [
789
787
  /* @__PURE__ */ l.jsx(
790
- ue,
788
+ de,
791
789
  {
792
790
  variant: "tertiary",
793
791
  icon: !0,
794
- onClick: _,
792
+ onClick: k,
795
793
  "aria-label": "Forrige måned",
796
- disabled: d,
794
+ disabled: u,
797
795
  children: /* @__PURE__ */ l.jsx(Ee, {})
798
796
  }
799
797
  ),
800
798
  /* @__PURE__ */ l.jsx(
801
- ue,
799
+ de,
802
800
  {
803
801
  variant: "tertiary",
804
802
  icon: !0,
805
- onClick: w,
803
+ onClick: y,
806
804
  "aria-label": "Neste måned",
807
805
  children: /* @__PURE__ */ l.jsx(je, {})
808
806
  }
809
807
  )
810
808
  ] })
811
809
  ] }),
812
- /* @__PURE__ */ l.jsx("div", { className: k.grid, children: y.map((i) => /* @__PURE__ */ l.jsx("div", { className: k.dayNameCell, children: i }, i)) }),
813
- /* @__PURE__ */ l.jsx("div", { className: k.grid, children: m.map((i) => {
814
- const R = me(i, o), P = r && ce(r) && Pt(i, r), M = Et(i), z = [
815
- k.dateCell,
816
- R ? "" : k.otherMonth,
817
- P ? k.selectedDate : "",
810
+ /* @__PURE__ */ l.jsx("div", { className: v.grid, children: g.map((s) => /* @__PURE__ */ l.jsx("div", { className: v.dayNameCell, children: s }, s)) }),
811
+ /* @__PURE__ */ l.jsx("div", { className: v.grid, children: h.map((s) => {
812
+ const x = me(s, o), w = a && ce(a) && Pt(s, a), T = Et(s), H = [
813
+ v.dateCell,
814
+ x ? "" : v.otherMonth,
815
+ w ? v.selectedDate : "",
818
816
  // Highlighting based on prop
819
- M && !P ? k.todayDate : ""
817
+ T && !w ? v.todayDate : ""
820
818
  ].filter(Boolean).join(" ");
821
819
  return /* @__PURE__ */ l.jsx(
822
820
  "div",
823
821
  {
824
- className: z,
825
- onClick: () => v(i),
826
- onKeyDown: (L) => N(L, i),
822
+ className: H,
823
+ onClick: () => p(s),
824
+ onKeyDown: (W) => A(W, s),
827
825
  role: "button",
828
826
  tabIndex: 0,
829
- "aria-pressed": P ?? !1,
830
- "aria-label": K(i, "PPP", { locale: V }),
831
- children: /* @__PURE__ */ l.jsx("span", { className: k.dateNumberContainer, children: K(i, "d") })
827
+ "aria-pressed": w ?? !1,
828
+ "aria-label": J(s, "PPP", { locale: F }),
829
+ children: /* @__PURE__ */ l.jsx("span", { className: v.dateNumberContainer, children: J(s, "d") })
832
830
  },
833
- i.toISOString()
831
+ s.toISOString()
834
832
  );
835
833
  }) })
836
834
  ] });
837
835
  };
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
- error: Rr,
843
- inputWrapper: Tr,
844
- inputWrapperError: Sr,
845
- suffixButton: $r,
846
- suffixButtonInteractive: Mr
847
- }, ve = (e) => {
848
- const r = e.slice(0, 2), a = e.slice(2, 4), o = e.slice(4, 8);
849
- return e.length > 4 ? `${r}.${a}.${o}` : e.length > 2 ? `${r}.${a}` : e.length > 0 ? r : "";
850
- }, ge = (e) => (e || "").replace(/\D/g, ""), ke = (e) => {
851
- let r = e;
852
- if (r.length >= 2) {
853
- const a = parseInt(r.substring(0, 2), 10);
854
- !isNaN(a) && a > 31 && (r = "31" + r.substring(2));
836
+ Ea.displayName = "DatePicker";
837
+ const ja = "_fieldset_17wt1_4", Na = "_description_17wt1_15", Ra = "_error_17wt1_22", Ta = "_inputWrapper_17wt1_30", Sa = "_inputWrapperError_17wt1_42", $a = "_suffixButton_17wt1_100", Ma = "_suffixButtonInteractive_17wt1_120", D = {
838
+ fieldset: ja,
839
+ description: Na,
840
+ error: Ra,
841
+ inputWrapper: Ta,
842
+ inputWrapperError: Sa,
843
+ suffixButton: $a,
844
+ suffixButtonInteractive: Ma
845
+ }, ve = (t) => {
846
+ const a = t.slice(0, 2), r = t.slice(2, 4), o = t.slice(4, 8);
847
+ return t.length > 4 ? `${a}.${r}.${o}` : t.length > 2 ? `${a}.${r}` : t.length > 0 ? a : "";
848
+ }, ge = (t) => (t || "").replace(/\D/g, ""), ke = (t) => {
849
+ let a = t;
850
+ if (a.length >= 2) {
851
+ const r = parseInt(a.substring(0, 2), 10);
852
+ !isNaN(r) && r > 31 && (a = "31" + a.substring(2));
855
853
  }
856
- if (r.length >= 4) {
857
- const a = parseInt(r.substring(2, 4), 10);
858
- !isNaN(a) && a > 12 && (r = r.substring(0, 2) + "12" + r.substring(4));
854
+ if (a.length >= 4) {
855
+ const r = parseInt(a.substring(2, 4), 10);
856
+ !isNaN(r) && r > 12 && (a = a.substring(0, 2) + "12" + a.substring(4));
859
857
  }
860
- return r.slice(0, 8);
861
- }, Dr = S(
862
- (e, r) => {
858
+ return a.slice(0, 8);
859
+ }, Da = R(
860
+ (t, a) => {
863
861
  const {
864
- label: a,
862
+ label: r,
865
863
  suffixIcon: o,
866
- onSuffixClick: s,
867
- className: u,
864
+ onSuffixClick: i,
865
+ className: m,
868
866
  // For outer fieldset
869
- inputWrapperClassName: d,
867
+ inputWrapperClassName: u,
870
868
  // For input wrapper div
871
- inputClassName: m,
869
+ inputClassName: h,
872
870
  // For the actual input element
873
- value: y,
874
- defaultValue: _,
875
- onChange: w,
876
- readOnly: v,
877
- placeholder: N = "dd.mm.åååå",
878
- id: C,
879
- name: H,
880
- required: $,
881
- disabled: i,
882
- onClick: R,
883
- onFocus: P,
871
+ value: g,
872
+ defaultValue: k,
873
+ onChange: y,
874
+ readOnly: p,
875
+ placeholder: A = "dd.mm.åååå",
876
+ id: b,
877
+ name: O,
878
+ required: Y,
879
+ disabled: s,
880
+ onClick: x,
881
+ onFocus: w,
884
882
  // Pass external onFocus
885
- onBlur: M,
883
+ onBlur: T,
886
884
  // Pass external onBlur
887
- autoComplete: z = "off",
888
- "aria-label": L,
889
- "aria-labelledby": ee,
890
- description: G,
891
- error: T,
885
+ autoComplete: H = "off",
886
+ "aria-label": W,
887
+ "aria-labelledby": te,
888
+ description: z,
889
+ error: S,
892
890
  // Use error prop for styling
893
- ...le
894
- } = e, B = y !== void 0, g = Re(null);
891
+ ...G
892
+ } = t, L = g !== void 0, _ = Re(null);
895
893
  ye.useImperativeHandle(
896
- r,
897
- () => g.current
894
+ a,
895
+ () => _.current
898
896
  );
899
- const D = Y(
900
- (h) => {
901
- const b = ge(h), O = ke(b);
902
- return ve(O);
897
+ const P = V(
898
+ (c) => {
899
+ const C = ge(c), $ = ke(C);
900
+ return ve($);
903
901
  },
904
902
  []
905
- ), [A, I] = _e(
906
- () => D(y ?? _)
903
+ ), [E, ae] = _e(
904
+ () => P(g ?? k)
907
905
  );
908
906
  we(() => {
909
- if (B) {
910
- const h = D(y);
911
- h !== A && (I(h), g.current && g.current.value !== h && (g.current.value = h));
907
+ if (L) {
908
+ const c = P(g);
909
+ c !== E && (ae(c), _.current && _.current.value !== c && (_.current.value = c));
912
910
  }
913
- }, [y, B, A, D]);
914
- const te = Y(
915
- (h) => {
916
- const b = h.target, O = b.value, q = A, p = ge(O).slice(0, 8), E = ke(p), x = ve(E);
917
- let j = 0;
918
- const X = E.length;
919
- X <= 2 ? j = X : X <= 4 ? j = X + 1 : j = X + 2, j = Math.min(j, x.length), requestAnimationFrame(() => {
920
- if (g.current && (I(x), g.current.value = x, g.current.setSelectionRange(j, j), (x !== q || B) && w)) {
911
+ }, [g, L, E, P]);
912
+ const q = V(
913
+ (c) => {
914
+ const C = c.target, $ = C.value, f = E, j = ge($).slice(0, 8), B = ke(j), N = ve(B);
915
+ let M = 0;
916
+ const K = B.length;
917
+ K <= 2 ? M = K : K <= 4 ? M = K + 1 : M = K + 2, M = Math.min(M, N.length), requestAnimationFrame(() => {
918
+ if (_.current && (ae(N), _.current.value = N, _.current.setSelectionRange(M, M), (N !== f || L) && y)) {
921
919
  const Ne = {
922
- ...h,
923
- target: { ...b, value: x }
920
+ ...c,
921
+ target: { ...C, value: N }
924
922
  };
925
- w(Ne, x);
923
+ y(Ne, N);
926
924
  }
927
925
  });
928
926
  },
929
- [A, B, w, D]
927
+ [E, L, y, P]
930
928
  // Added isControlled and getFormattedValue
931
- ), re = [W.fieldset, u].filter(Boolean).join(" "), ae = [
932
- W.inputWrapper,
929
+ ), re = [D.fieldset, m].filter(Boolean).join(" "), ne = [
930
+ D.inputWrapper,
933
931
  // Base style from InputField CSS
934
- d,
932
+ u,
935
933
  // Allow external override/extension
936
- T ? W.inputWrapperError : ""
934
+ S ? D.inputWrapperError : ""
937
935
  // Apply error class based on prop
938
936
  // Add disabled class if your CSS defines one for the wrapper
939
937
  // disabled ? styles.inputWrapperDisabled : '',
940
- ].filter(Boolean).join(" "), ne = [
938
+ ].filter(Boolean).join(" "), oe = [
941
939
  // styles.input, // This class might not exist in InputField/styles.module.css
942
- m
940
+ h
943
941
  // Allow external override/extension
944
- ].filter(Boolean).join(" "), oe = [
945
- W.suffixButton,
942
+ ].filter(Boolean).join(" "), se = [
943
+ D.suffixButton,
946
944
  // Base style from InputField CSS
947
- s ? W.suffixButtonInteractive : ""
945
+ i ? D.suffixButtonInteractive : ""
948
946
  // Add interactive class if clickable
949
947
  // Add disabled class if your CSS defines one for the button
950
948
  // disabled ? styles.suffixButtonDisabled : '',
951
949
  ].filter(Boolean).join(" ");
952
- !a && !L && !ee && console.warn("Warning: DateInput component should have a label, aria-label, or aria-labelledby for accessibility.");
953
- const t = a && typeof a == "string" ? ee || `${C}-label` : void 0, n = G ? `${C}-desc` : void 0, c = T ? `${C}-err` : void 0, f = [n, c].filter(Boolean).join(" ") || void 0;
950
+ !r && !W && !te && console.warn("Warning: DateInput component should have a label, aria-label, or aria-labelledby for accessibility.");
951
+ const X = r && typeof r == "string" ? te || `${b}-label` : void 0, e = z ? `${b}-desc` : void 0, n = S ? `${b}-err` : void 0, d = [e, n].filter(Boolean).join(" ") || void 0;
954
952
  return (
955
953
  // Use the fieldset structure and classes from InputField CSS
956
954
  /* @__PURE__ */ l.jsxs("div", { className: re, children: [
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: W.description, children: [
955
+ r && typeof r == "string" ? /* @__PURE__ */ l.jsx("label", { id: X, htmlFor: b, children: r }) : r,
956
+ z && /* @__PURE__ */ l.jsxs("p", { id: e, className: D.description, children: [
959
957
  " ",
960
- G
958
+ z
961
959
  ] }),
962
- /* @__PURE__ */ l.jsxs("div", { className: ae, children: [
960
+ /* @__PURE__ */ l.jsxs("div", { className: ne, children: [
963
961
  /* @__PURE__ */ l.jsx(
964
962
  "input",
965
963
  {
966
- ref: g,
964
+ ref: _,
967
965
  type: "text",
968
966
  inputMode: "numeric",
969
967
  pattern: "\\d{2}\\.\\d{2}\\.\\d{4}",
970
968
  maxLength: 10,
971
- value: A,
972
- readOnly: v,
973
- placeholder: N,
974
- id: C,
975
- name: H,
976
- required: $,
977
- disabled: i,
978
- onClick: R,
979
- onChange: te,
980
- onFocus: P,
981
- onBlur: M,
982
- autoComplete: z,
983
- "aria-label": L,
984
- "aria-labelledby": t,
985
- "aria-describedby": f,
986
- "aria-invalid": !!T,
987
- className: ne,
988
- ...le
969
+ value: E,
970
+ readOnly: p,
971
+ placeholder: A,
972
+ id: b,
973
+ name: O,
974
+ required: Y,
975
+ disabled: s,
976
+ onClick: x,
977
+ onChange: q,
978
+ onFocus: w,
979
+ onBlur: T,
980
+ autoComplete: H,
981
+ "aria-label": W,
982
+ "aria-labelledby": X,
983
+ "aria-describedby": d,
984
+ "aria-invalid": !!S,
985
+ className: oe,
986
+ ...G
989
987
  }
990
988
  ),
991
989
  o && /* @__PURE__ */ l.jsx(
992
990
  "button",
993
991
  {
994
992
  type: "button",
995
- className: oe,
996
- onClick: i ? void 0 : s,
997
- tabIndex: s && !i ? 0 : -1,
998
- "aria-hidden": !s,
999
- disabled: i,
1000
- "aria-label": s ? "Åpne datovelger" : void 0,
993
+ className: se,
994
+ onClick: s ? void 0 : i,
995
+ tabIndex: i && !s ? 0 : -1,
996
+ "aria-hidden": !i,
997
+ disabled: s,
998
+ "aria-label": i ? "Åpne datovelger" : void 0,
1001
999
  children: o
1002
1000
  }
1003
1001
  )
1004
1002
  ] }),
1005
- T && /* @__PURE__ */ l.jsx("p", { id: c, className: W.error, role: "alert", children: T })
1003
+ S && /* @__PURE__ */ l.jsx("p", { id: n, className: D.error, role: "alert", children: S })
1006
1004
  ] })
1007
1005
  );
1008
1006
  }
1009
1007
  );
1010
- Dr.displayName = "DateInput";
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
- (e, r) => /* @__PURE__ */ l.jsx(nt, { ref: r, ...e })
1008
+ Da.displayName = "DateInput";
1009
+ const Za = Ye, er = He, tr = ze, ar = Ge, rr = qe, nr = Je, Aa = Xe, Oa = Ke;
1010
+ Aa.displayName = "Field.Description";
1011
+ Oa.displayName = "Field.Counter";
1012
+ const or = Ce, Wa = R((t, a) => /* @__PURE__ */ l.jsx(Ue, { ref: a, ...t }));
1013
+ Wa.displayName = "Heading";
1014
+ const sr = Qe, La = R((t, a) => /* @__PURE__ */ l.jsx(Ze, { ref: a, ...t }));
1015
+ La.displayName = "Label";
1016
+ const ir = et, lr = tt, cr = at, ur = rt, Ba = R(
1017
+ (t, a) => /* @__PURE__ */ l.jsx(nt, { ref: a, ...t })
1020
1018
  );
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";
1019
+ Ba.displayName = "Paragraph";
1020
+ const dr = ot, mr = st, fr = it, hr = lt, pr = ct, br = ut, vr = dt, gr = mt, Ia = ft;
1021
+ Ia.displayName = "Suggestion";
1022
+ const kr = ht, yr = pt, _r = bt, wr = vt, Cr = gt, xr = kt, Pr = yt, Er = _t, Fa = R((t, a) => /* @__PURE__ */ l.jsx(wt, { ref: a, ...t }));
1023
+ Fa.displayName = "ValidationMessage";
1026
1024
  export {
1027
1025
  St as Alert,
1028
1026
  $t as Avatar,
1029
1027
  Mt as Badge,
1030
- zr as BadgePosition,
1031
- Gr as Breadcrumbs,
1032
- Xr as BreadcrumbsItem,
1033
- Kr as BreadcrumbsLink,
1034
- qr as BreadcrumbsList,
1028
+ za as BadgePosition,
1029
+ Ga as Breadcrumbs,
1030
+ Xa as BreadcrumbsItem,
1031
+ Ka as BreadcrumbsLink,
1032
+ qa as BreadcrumbsList,
1035
1033
  Dt as Button,
1036
1034
  At as Card,
1037
- Jr as CardBlock,
1035
+ Ja as CardBlock,
1038
1036
  Ot as Checkbox,
1039
- Qr as Chip,
1040
- Dr as DateInput,
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
1037
+ Qa as Chip,
1038
+ Da as DateInput,
1039
+ Ea as DatePicker,
1040
+ Za as Details,
1041
+ er as Dialog,
1042
+ tr as Divider,
1043
+ ar as Dropdown,
1044
+ rr as ErrorSummary,
1045
+ nr as Field,
1046
+ Oa as FieldCounter,
1047
+ Aa as FieldDescription,
1048
+ or as Fieldset,
1049
+ Wa as Heading,
1050
+ sr as Input,
1051
+ La as Label,
1052
+ ir as Link,
1053
+ lr as List,
1054
+ cr as Pagination,
1055
+ Ba as Paragraph,
1056
+ dr as Popover,
1057
+ mr as Radio,
1058
+ hr as Search,
1059
+ pr as Select,
1060
+ br as SkeletonLoader,
1061
+ vr as SkipLink,
1062
+ gr as Spinner,
1063
+ Ia as Suggestion,
1064
+ kr as Switch,
1065
+ yr as Table,
1066
+ _r as Tabs,
1067
+ wr as Tag,
1068
+ Cr as Textarea,
1069
+ xr as Textfield,
1070
+ Pr as ToggleGroup,
1071
+ Er as Tooltip,
1072
+ Fa as ValidationMessage,
1073
+ Ua as useCheckboxGroup,
1074
+ ur as usePagination,
1075
+ fr as useRadioGroup
1078
1076
  };