rk-designsystem 1.1.31 → 1.1.33

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 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,29 +11,29 @@ var ie = { exports: {} }, J = {};
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 J;
17
- fe = 1;
18
- var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
19
- function a(o, s, u) {
14
+ var pe;
15
+ function Tt() {
16
+ if (pe) return U;
17
+ pe = 1;
18
+ var t = Symbol.for("react.transitional.element"), a = Symbol.for("react.fragment");
19
+ function r(o, i, c) {
20
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,
21
+ if (c !== void 0 && (d = "" + c), i.key !== void 0 && (d = "" + i.key), "key" in i) {
22
+ c = {};
23
+ for (var h in i)
24
+ h !== "key" && (c[h] = i[h]);
25
+ } else c = i;
26
+ return i = c.ref, {
27
+ $$typeof: t,
28
28
  type: o,
29
29
  key: d,
30
- ref: s !== void 0 ? s : null,
31
- props: u
30
+ ref: i !== void 0 ? i : null,
31
+ props: c
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
@@ -43,166 +43,167 @@ var U = {};
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() {
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 $:
46
+ var be;
47
+ function St() {
48
+ return be || (be = 1, process.env.NODE_ENV !== "production" && (function() {
49
+ function t(e) {
50
+ if (e == null) return null;
51
+ if (typeof e == "function")
52
+ return e.$$typeof === le ? null : e.displayName || e.name || null;
53
+ if (typeof e == "string") return e;
54
+ switch (e) {
55
+ case C:
56
56
  return "Fragment";
57
- case R:
57
+ case l:
58
58
  return "Profiler";
59
- case i:
59
+ case z:
60
60
  return "StrictMode";
61
- case L:
61
+ case W:
62
62
  return "Suspense";
63
- case ee:
63
+ case S:
64
64
  return "SuspenseList";
65
- case le:
65
+ case ie:
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) {
71
+ ), e.$$typeof) {
72
72
  case H:
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;
74
+ case w:
75
+ return e.displayName || "Context";
76
+ case j:
77
+ return (e._context.displayName || "Context") + ".Consumer";
78
+ case N:
79
+ var n = e.render;
80
+ return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
81
+ case $:
82
+ return n = e.displayName || null, n !== null ? n : t(e.type) || "Memo";
81
83
  case G:
82
- return n = t.displayName || null, n !== null ? n : e(t.type) || "Memo";
83
- case T:
84
- n = t._payload, t = t._init;
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 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
108
  f
109
- ), r(t);
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 === C) 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 = R.A;
125
+ return e === null ? null : e.getOwner();
126
126
  }
127
- function u() {
127
+ function c() {
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 d(e) {
131
+ if (y.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 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
- c.isReactWarning = !0, Object.defineProperty(t, "key", {
145
- get: c,
144
+ u.isReactWarning = !0, Object.defineProperty(e, "key", {
145
+ get: u,
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 b() {
150
+ var e = t(this.type);
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
- )), 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, u, f, B, v) {
156
+ var m = u.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: u,
162
+ _owner: f
163
+ }, (m !== void 0 ? m : 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: b
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: B
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: v
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)
188
+ function _(e, n, u, f, B, v) {
189
+ var m = n.children;
190
+ if (m !== void 0)
190
191
  if (f)
191
- if (A(p)) {
192
- for (f = 0; f < p.length; f++)
193
- v(p[f]);
194
- Object.freeze && Object.freeze(p);
192
+ if (L(m)) {
193
+ for (f = 0; f < m.length; f++)
194
+ x(m[f]);
195
+ Object.freeze && Object.freeze(m);
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 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";
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
+ f = 0 < P.length ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}", ne[m + f] || (P = 0 < P.length ? "{" + P.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} />
@@ -210,153 +211,150 @@ React keys must be passed directly to JSX without using spread:
210
211
  let props = %s;
211
212
  <%s key={someKey} {...props} />`,
212
213
  f,
213
- p,
214
- E,
215
- p
216
- ), oe[p + f] = !0);
214
+ m,
215
+ P,
216
+ m
217
+ ), ne[m + f] = !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 (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
+ typeof e == "function" ? e.displayName || e.name || "Unknown" : e
227
+ ), k(
228
+ e,
229
+ m,
230
+ u,
231
+ i(),
232
+ B,
233
+ v
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 x(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 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() {
241
243
  return null;
242
244
  };
243
- N = {
244
- react_stack_bottom_frame: function(t) {
245
- return t();
245
+ p = {
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 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
+ e,
256
258
  n,
257
- c,
259
+ u,
258
260
  !1,
259
- f,
260
- h,
261
- b ? Error("react-stack-top-frame") : ae,
262
- b ? I(o(t)) : ne
261
+ f ? Error("react-stack-top-frame") : ae,
262
+ f ? E(o(e)) : re
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, u) {
265
+ var f = 1e4 > R.recentlyCreatedOwnerStacks++;
266
+ return _(
267
+ e,
268
268
  n,
269
- c,
269
+ u,
270
270
  !0,
271
- f,
272
- h,
273
- b ? Error("react-stack-top-frame") : ae,
274
- b ? I(o(t)) : ne
271
+ f ? Error("react-stack-top-frame") : ae,
272
+ f ? E(o(e)) : re
275
273
  );
276
274
  };
277
- })()), U;
275
+ })()), Q;
278
276
  }
279
- var pe;
280
- function Tt() {
281
- return pe || (pe = 1, process.env.NODE_ENV === "production" ? ie.exports = Nt() : ie.exports = Rt()), ie.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;
282
280
  }
283
- var l = Tt();
284
- const St = S((e, r) => /* @__PURE__ */ l.jsx(Te, { ref: r, ...e }));
285
- St.displayName = "Alert";
286
- const $t = S((e, r) => /* @__PURE__ */ l.jsx(Se, { ref: r, ...e }));
287
- $t.displayName = "Avatar";
288
- const Mt = S((e, r) => /* @__PURE__ */ l.jsx($e, { ref: r, ...e }));
289
- Mt.displayName = "Badge";
290
- const zr = Me, Gr = De, qr = Ae, Xr = Oe, Kr = We, Dt = ue;
291
- Dt.displayName = "Button";
292
- const At = Le, Jr = Be;
293
- At.displayName = "Card";
294
- const Ot = Ie, Wt = Ce, Ur = Fe;
295
- Ot.displayName = "Checkbox";
296
- Wt.displayName = "Fieldset";
297
- const Qr = Ve;
298
- function de(e) {
299
- return (r = {}) => {
300
- const a = r.width ? String(r.width) : e.defaultWidth;
301
- return e.formats[a] || e.formats[e.defaultWidth];
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
+ 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 d = t.defaultFormattingWidth || t.defaultWidth, h = r != null && r.width ? String(r.width) : d;
308
+ i = t.formattingValues[h] || t.formattingValues[d];
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 d = t.defaultWidth, h = r != null && r.width ? String(r.width) : t.defaultWidth;
311
+ i = t.values[h] || t.values[d];
314
312
  }
315
- const u = e.argumentCallback ? e.argumentCallback(r) : r;
316
- return s[u];
313
+ const c = t.argumentCallback ? t.argumentCallback(a) : a;
314
+ return i[c];
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], c = a.match(i);
320
+ if (!c)
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 d = c[0], h = o && t.parsePatterns[o] || t.parsePatterns[t.defaultParseWidth], b = Array.isArray(h) ? Ft(h, (x) => x.test(d)) : (
325
323
  // [TODO] -- I challenge you to fix the type
326
- Lt(m, (v) => v.test(d))
324
+ It(h, (x) => x.test(d))
327
325
  );
328
- let _;
329
- _ = e.valueCallback ? e.valueCallback(y) : y, _ = a.valueCallback ? (
326
+ let k;
327
+ k = t.valueCallback ? t.valueCallback(b) : b, 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 _ = a.slice(d.length);
332
+ return { value: k, rest: _ };
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 It(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 Ft(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 Vt(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], 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
+ const h = a.slice(i.length);
354
+ return { value: d, rest: h };
357
355
  };
358
356
  }
359
- const Ft = {
357
+ const Yt = {
360
358
  lessThanXSeconds: {
361
359
  one: "mindre enn ett sekund",
362
360
  other: "mindre enn {{count}} sekunder"
@@ -418,54 +416,54 @@ const Ft = {
418
416
  one: "nesten ett år",
419
417
  other: "nesten {{count}} år"
420
418
  }
421
- }, Vt = (e, r, a) => {
419
+ }, Ht = (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;
425
- }, Yt = {
421
+ const i = Yt[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;
423
+ }, zt = {
426
424
  full: "EEEE d. MMMM y",
427
425
  long: "d. MMMM y",
428
426
  medium: "d. MMM y",
429
427
  short: "dd.MM.y"
430
- }, Ht = {
428
+ }, Gt = {
431
429
  full: "'kl'. HH:mm:ss zzzz",
432
430
  long: "HH:mm:ss z",
433
431
  medium: "HH:mm:ss",
434
432
  short: "HH:mm"
435
- }, zt = {
433
+ }, qt = {
436
434
  full: "{{date}} 'kl.' {{time}}",
437
435
  long: "{{date}} 'kl.' {{time}}",
438
436
  medium: "{{date}} {{time}}",
439
437
  short: "{{date}} {{time}}"
440
- }, Gt = {
441
- date: de({
442
- formats: Yt,
438
+ }, Xt = {
439
+ date: ue({
440
+ formats: zt,
443
441
  defaultWidth: "full"
444
442
  }),
445
- time: de({
446
- formats: Ht,
443
+ time: ue({
444
+ formats: Gt,
447
445
  defaultWidth: "full"
448
446
  }),
449
- dateTime: de({
450
- formats: zt,
447
+ dateTime: ue({
448
+ formats: qt,
451
449
  defaultWidth: "full"
452
450
  })
453
- }, qt = {
451
+ }, Kt = {
454
452
  lastWeek: "'forrige' eeee 'kl.' p",
455
453
  yesterday: "'i går kl.' p",
456
454
  today: "'i dag kl.' p",
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
+ }, Jt = (t, a, r, o) => Kt[t], Ut = {
461
459
  narrow: ["f.Kr.", "e.Kr."],
462
460
  abbreviated: ["f.Kr.", "e.Kr."],
463
461
  wide: ["før Kristus", "etter Kristus"]
464
- }, Jt = {
462
+ }, Qt = {
465
463
  narrow: ["1", "2", "3", "4"],
466
464
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
467
465
  wide: ["1. kvartal", "2. kvartal", "3. kvartal", "4. kvartal"]
468
- }, Ut = {
466
+ }, Zt = {
469
467
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
470
468
  abbreviated: [
471
469
  "jan.",
@@ -495,7 +493,7 @@ const Ft = {
495
493
  "november",
496
494
  "desember"
497
495
  ]
498
- }, Qt = {
496
+ }, ea = {
499
497
  narrow: ["S", "M", "T", "O", "T", "F", "L"],
500
498
  short: ["sø", "ma", "ti", "on", "to", "fr", "lø"],
501
499
  abbreviated: ["søn", "man", "tir", "ons", "tor", "fre", "lør"],
@@ -508,7 +506,7 @@ const Ft = {
508
506
  "fredag",
509
507
  "lørdag"
510
508
  ]
511
- }, Zt = {
509
+ }, ta = {
512
510
  narrow: {
513
511
  am: "a",
514
512
  pm: "p",
@@ -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({
545
- values: Kt,
540
+ }, aa = (t, a) => Number(t) + ".", ra = {
541
+ ordinalNumber: aa,
542
+ era: Z({
543
+ values: Ut,
546
544
  defaultWidth: "wide"
547
545
  }),
548
- quarter: Q({
549
- values: Jt,
546
+ quarter: Z({
547
+ values: Qt,
550
548
  defaultWidth: "wide",
551
- argumentCallback: (e) => e - 1
549
+ argumentCallback: (t) => t - 1
552
550
  }),
553
- month: Q({
554
- values: Ut,
551
+ month: Z({
552
+ values: Zt,
555
553
  defaultWidth: "wide"
556
554
  }),
557
- day: Q({
558
- values: Qt,
555
+ day: Z({
556
+ values: ea,
559
557
  defaultWidth: "wide"
560
558
  }),
561
- dayPeriod: Q({
562
- values: Zt,
559
+ dayPeriod: Z({
560
+ values: ta,
563
561
  defaultWidth: "wide"
564
562
  })
565
- }, rr = /^(\d+)\.?/i, ar = /\d+/i, nr = {
563
+ }, na = /^(\d+)\.?/i, oa = /\d+/i, sa = {
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
+ }, ia = {
570
568
  any: [/^f/i, /^e/i]
571
- }, sr = {
569
+ }, la = {
572
570
  narrow: /^[1234]/i,
573
571
  abbreviated: /^q[1234]/i,
574
572
  wide: /^[1234](\.)? kvartal/i
575
- }, ir = {
573
+ }, ca = {
576
574
  any: [/1/i, /2/i, /3/i, /4/i]
577
- }, lr = {
575
+ }, da = {
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
+ }, ua = {
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
+ }, ma = {
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
+ }, fa = {
616
614
  any: [/^s/i, /^m/i, /^ti/i, /^o/i, /^to/i, /^f/i, /^l/i]
617
- }, mr = {
615
+ }, ha = {
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
+ }, pa = {
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 = {
632
- ordinalNumber: It({
633
- matchPattern: rr,
634
- parsePattern: ar,
635
- valueCallback: (e) => parseInt(e, 10)
629
+ }, ba = {
630
+ ordinalNumber: Vt({
631
+ matchPattern: na,
632
+ parsePattern: oa,
633
+ valueCallback: (t) => parseInt(t, 10)
636
634
  }),
637
- era: Z({
638
- matchPatterns: nr,
635
+ era: ee({
636
+ matchPatterns: sa,
639
637
  defaultMatchWidth: "wide",
640
- parsePatterns: or,
638
+ parsePatterns: ia,
641
639
  defaultParseWidth: "any"
642
640
  }),
643
- quarter: Z({
644
- matchPatterns: sr,
641
+ quarter: ee({
642
+ matchPatterns: la,
645
643
  defaultMatchWidth: "wide",
646
- parsePatterns: ir,
644
+ parsePatterns: ca,
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: da,
652
650
  defaultMatchWidth: "wide",
653
- parsePatterns: cr,
651
+ parsePatterns: ua,
654
652
  defaultParseWidth: "any"
655
653
  }),
656
- day: Z({
657
- matchPatterns: dr,
654
+ day: ee({
655
+ matchPatterns: ma,
658
656
  defaultMatchWidth: "wide",
659
- parsePatterns: ur,
657
+ parsePatterns: fa,
660
658
  defaultParseWidth: "any"
661
659
  }),
662
- dayPeriod: Z({
663
- matchPatterns: mr,
660
+ dayPeriod: ee({
661
+ matchPatterns: ha,
664
662
  defaultMatchWidth: "any",
665
- parsePatterns: fr,
663
+ parsePatterns: pa,
666
664
  defaultParseWidth: "any"
667
665
  })
668
666
  }, V = {
669
667
  code: "nb",
670
- formatDistance: Vt,
671
- formatLong: Gt,
672
- formatRelative: Xt,
673
- localize: tr,
674
- match: hr,
668
+ formatDistance: Ht,
669
+ formatLong: Xt,
670
+ formatRelative: Jt,
671
+ localize: ra,
672
+ match: ba,
675
673
  options: {
676
674
  weekStartsOn: 1,
677
675
  firstWeekContainsDate: 4
678
676
  }
679
- }, Ee = ({ title: e, ...r }) => /* @__PURE__ */ l.jsxs(
677
+ }, Ne = ({ title: t, ...a }) => /* @__PURE__ */ s.jsxs(
680
678
  "svg",
681
679
  {
682
680
  xmlns: "http://www.w3.org/2000/svg",
@@ -684,12 +682,12 @@ 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 }),
692
- /* @__PURE__ */ l.jsx(
689
+ t && /* @__PURE__ */ s.jsx("title", { children: t }),
690
+ /* @__PURE__ */ s.jsx(
693
691
  "path",
694
692
  {
695
693
  fillRule: "evenodd",
@@ -701,8 +699,8 @@ const Ft = {
701
699
  ]
702
700
  }
703
701
  );
704
- Ee.displayName = "ChevronLeftIcon";
705
- const je = ({ title: e, ...r }) => /* @__PURE__ */ l.jsxs(
702
+ Ne.displayName = "ChevronLeftIcon";
703
+ const Re = ({ title: t, ...a }) => /* @__PURE__ */ s.jsxs(
706
704
  "svg",
707
705
  {
708
706
  xmlns: "http://www.w3.org/2000/svg",
@@ -710,12 +708,12 @@ 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 }),
718
- /* @__PURE__ */ l.jsx(
715
+ t && /* @__PURE__ */ s.jsx("title", { children: t }),
716
+ /* @__PURE__ */ s.jsx(
719
717
  "path",
720
718
  {
721
719
  fillRule: "evenodd",
@@ -727,352 +725,360 @@ const je = ({ title: e, ...r }) => /* @__PURE__ */ l.jsxs(
727
725
  ]
728
726
  }
729
727
  );
730
- 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,
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
+ initialDate: t = /* @__PURE__ */ new Date(),
745
+ selectedDate: a = null,
748
746
  // Prop for selected date
749
- onDateSelect: a
747
+ onDateSelect: r,
748
+ "data-color": o,
749
+ // <-- Destructured
750
+ "data-size": i
751
+ // <-- Destructured
750
752
  }) => {
751
- const [o, s] = _e(
752
- // Initialize with selectedDate's month if valid, otherwise initialDate's month
753
- F(r && ce(r) ? r : e)
753
+ const [c, d] = Ce(
754
+ F(a && de(a) ? a : t)
754
755
  );
755
- we(() => {
756
- if (r && ce(r)) {
757
- const i = F(r);
758
- me(i, o) || s(i);
756
+ Pe(() => {
757
+ if (a && de(a)) {
758
+ const l = F(a);
759
+ he(l, c) || d(l);
759
760
  }
760
- }, [r]);
761
- const u = se(() => F(/* @__PURE__ */ new Date()), []), d = se(() => !1, [o, u]), m = se(
762
- () => Pr(o),
763
- [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);
761
+ }, [a]);
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);
769
770
  });
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);
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);
777
778
  },
778
- [a]
779
- ), N = Y(
780
- (i, R) => {
781
- (i.key === "Enter" || i.key === " ") && (i.preventDefault(), v(R));
779
+ [r]
780
+ ), O = Y(
781
+ (l, j) => {
782
+ (l.key === "Enter" || l.key === " ") && (l.preventDefault(), p(j));
782
783
  },
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: [
789
- /* @__PURE__ */ l.jsx(
790
- ue,
791
- {
792
- variant: "tertiary",
793
- icon: !0,
794
- onClick: _,
795
- "aria-label": "Forrige måned",
796
- disabled: d,
797
- children: /* @__PURE__ */ l.jsx(Ee, {})
798
- }
799
- ),
800
- /* @__PURE__ */ l.jsx(
801
- ue,
802
- {
803
- variant: "tertiary",
804
- icon: !0,
805
- onClick: w,
806
- "aria-label": "Neste måned",
807
- children: /* @__PURE__ */ l.jsx(je, {})
808
- }
809
- )
810
- ] })
811
- ] }),
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 : "",
818
- // Highlighting based on prop
819
- M && !P ? k.todayDate : ""
820
- ].filter(Boolean).join(" ");
821
- return /* @__PURE__ */ l.jsx(
822
- "div",
823
- {
824
- className: z,
825
- onClick: () => v(i),
826
- onKeyDown: (L) => N(L, i),
827
- role: "button",
828
- 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") })
832
- },
833
- i.toISOString()
834
- );
835
- }) })
836
- ] });
784
+ [p]
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
+ );
837
846
  };
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));
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) => {
857
+ const a = t.slice(0, 2), r = t.slice(2, 4), o = t.slice(4, 8);
858
+ return t.length > 4 ? `${a}.${r}.${o}` : t.length > 2 ? `${a}.${r}` : t.length > 0 ? a : "";
859
+ }, ye = (t) => (t || "").replace(/\D/g, ""), _e = (t) => {
860
+ let a = t;
861
+ if (a.length >= 2) {
862
+ const r = parseInt(a.substring(0, 2), 10);
863
+ !isNaN(r) && r > 31 && (a = "31" + a.substring(2));
855
864
  }
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));
865
+ if (a.length >= 4) {
866
+ const r = parseInt(a.substring(2, 4), 10);
867
+ !isNaN(r) && r > 12 && (a = a.substring(0, 2) + "12" + a.substring(4));
859
868
  }
860
- return r.slice(0, 8);
861
- }, Dr = S(
862
- (e, r) => {
869
+ return a.slice(0, 8);
870
+ }, Oa = T(
871
+ (t, a) => {
863
872
  const {
864
- label: a,
873
+ label: r,
865
874
  suffixIcon: o,
866
- onSuffixClick: s,
867
- className: u,
875
+ onSuffixClick: i,
876
+ className: c,
868
877
  // For outer fieldset
869
878
  inputWrapperClassName: d,
870
879
  // For input wrapper div
871
- inputClassName: m,
880
+ inputClassName: h,
872
881
  // 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,
882
+ value: b,
883
+ defaultValue: k,
884
+ onChange: _,
885
+ readOnly: x,
886
+ placeholder: A = "dd.mm.åååå",
887
+ id: p,
888
+ name: O,
889
+ required: H,
890
+ disabled: C,
891
+ onClick: z,
892
+ onFocus: l,
884
893
  // Pass external onFocus
885
- onBlur: M,
894
+ onBlur: j,
886
895
  // Pass external onBlur
887
- autoComplete: z = "off",
888
- "aria-label": L,
889
- "aria-labelledby": ee,
890
- description: G,
891
- error: T,
896
+ autoComplete: w = "off",
897
+ "aria-label": N,
898
+ "aria-labelledby": W,
899
+ description: S,
900
+ error: $,
892
901
  // Use error prop for styling
902
+ "data-color": G,
903
+ // <-- Destructure
904
+ "data-size": ie,
905
+ // <-- Destructure
893
906
  ...le
894
- } = e, B = y !== void 0, g = Re(null);
895
- ye.useImperativeHandle(
896
- r,
897
- () => g.current
907
+ } = t, R = b !== void 0, y = Se(null);
908
+ xe.useImperativeHandle(
909
+ a,
910
+ () => y.current
898
911
  );
899
- const D = Y(
900
- (h) => {
901
- const b = ge(h), O = ke(b);
902
- return ve(O);
912
+ const L = Y(
913
+ (v) => {
914
+ const m = ye(v), P = _e(m);
915
+ return ke(P);
903
916
  },
904
917
  []
905
- ), [A, I] = _e(
906
- () => D(y ?? _)
918
+ ), [E, q] = Ce(
919
+ () => L(b ?? k)
907
920
  );
908
- we(() => {
909
- if (B) {
910
- const h = D(y);
911
- h !== A && (I(h), g.current && g.current.value !== h && (g.current.value = h));
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));
912
925
  }
913
- }, [y, B, A, D]);
926
+ }, [b, R, E, L]);
914
927
  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)) {
921
- const Ne = {
922
- ...h,
923
- target: { ...b, value: x }
928
+ (v) => {
929
+ const m = v.target, P = m.value, X = E, ce = ye(P).slice(0, 8), fe = _e(ce), I = ke(fe);
930
+ let M = 0;
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 }
924
937
  };
925
- w(Ne, x);
938
+ _(Te, I);
926
939
  }
927
940
  });
928
941
  },
929
- [A, B, w, D]
930
- // Added isControlled and getFormattedValue
931
- ), re = [W.fieldset, u].filter(Boolean).join(" "), ae = [
932
- W.inputWrapper,
933
- // Base style from InputField CSS
942
+ [E, R, _, L]
943
+ ), ae = [D.fieldset, c].filter(Boolean).join(" "), re = [
944
+ D.inputWrapper,
934
945
  d,
935
- // Allow external override/extension
936
- T ? W.inputWrapperError : ""
937
- // Apply error class based on prop
938
- // Add disabled class if your CSS defines one for the wrapper
939
- // disabled ? styles.inputWrapperDisabled : '',
946
+ $ ? D.inputWrapperError : ""
940
947
  ].filter(Boolean).join(" "), ne = [
941
- // styles.input, // This class might not exist in InputField/styles.module.css
942
- m
943
- // Allow external override/extension
944
- ].filter(Boolean).join(" "), oe = [
945
- W.suffixButton,
946
- // Base style from InputField CSS
947
- s ? W.suffixButtonInteractive : ""
948
- // Add interactive class if clickable
949
- // Add disabled class if your CSS defines one for the button
950
- // disabled ? styles.suffixButtonDisabled : '',
948
+ h
949
+ ].filter(Boolean).join(" "), e = [
950
+ D.suffixButton,
951
+ i ? D.suffixButtonInteractive : ""
951
952
  ].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;
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;
954
955
  return (
955
- // Use the fieldset structure and classes from InputField CSS
956
- /* @__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: [
959
- " ",
960
- G
961
- ] }),
962
- /* @__PURE__ */ l.jsxs("div", { className: ae, children: [
963
- /* @__PURE__ */ l.jsx(
964
- "input",
965
- {
966
- ref: g,
967
- type: "text",
968
- inputMode: "numeric",
969
- pattern: "\\d{2}\\.\\d{2}\\.\\d{4}",
970
- 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
989
- }
990
- ),
991
- o && /* @__PURE__ */ l.jsx(
992
- "button",
993
- {
994
- 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,
1001
- children: o
1002
- }
1003
- )
1004
- ] }),
1005
- T && /* @__PURE__ */ l.jsx("p", { id: c, className: W.error, role: "alert", children: T })
1006
- ] })
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
+ )
1007
1013
  );
1008
1014
  }
1009
1015
  );
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 })
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 })
1020
1026
  );
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";
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";
1026
1032
  export {
1027
- St as Alert,
1028
- $t as Avatar,
1029
- Mt as Badge,
1030
- zr as BadgePosition,
1031
- Gr as Breadcrumbs,
1032
- Xr as BreadcrumbsItem,
1033
- Kr as BreadcrumbsLink,
1034
- qr as BreadcrumbsList,
1035
- Dt as Button,
1036
- At as Card,
1037
- Jr as CardBlock,
1038
- 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
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
1078
1084
  };