rk-designsystem 1.1.32 → 1.1.34

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