rk-designsystem 1.3.1 → 1.3.2

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.
@@ -25,7 +25,7 @@ const ae = ({
25
25
  const r = "rk-carousel-inline-styles";
26
26
  if (typeof document > "u" || document.getElementById(r)) return;
27
27
  const o = ie(a), i = document.createElement("style");
28
- i.id = r, i.textContent = o, document.head.appendChild(i);
28
+ i.id = r, i.textContent = o, document.head.prepend(i);
29
29
  }, []);
30
30
  const R = {
31
31
  loop: !0,
@@ -42,13 +42,13 @@ const ae = ({
42
42
  })
43
43
  );
44
44
  }, [D]);
45
- const C = h((r) => {
45
+ const N = h((r) => {
46
46
  I((o) => {
47
47
  if (o[r]) return o;
48
48
  const i = [...o];
49
49
  return i[r] = !0, i;
50
50
  });
51
- }, []), N = Q(() => b * 1e3, [b]), c = h(() => {
51
+ }, []), C = Q(() => b * 1e3, [b]), c = h(() => {
52
52
  t && O(t.selectedScrollSnap());
53
53
  }, [t]), H = h((r) => t && t.scrollTo(r), [t]), K = h(() => t && t.scrollPrev(), [t]), U = h(() => t && t.scrollNext(), [t]);
54
54
  p(() => {
@@ -64,11 +64,11 @@ const ae = ({
64
64
  if (!j || !t || !e || e.length <= 1) return;
65
65
  const r = window.setInterval(() => {
66
66
  t.canScrollNext() && t.scrollNext();
67
- }, N);
67
+ }, C);
68
68
  return () => {
69
69
  window.clearInterval(r);
70
70
  };
71
- }, [j, N, t, e]);
71
+ }, [j, C, t, e]);
72
72
  const E = Math.max(1, $), G = `${100 / E}%`, m = y / 2;
73
73
  return /* @__PURE__ */ u(
74
74
  "div",
@@ -117,9 +117,9 @@ const ae = ({
117
117
  alt: r.alt,
118
118
  loading: o < E ? "eager" : "lazy",
119
119
  crossOrigin: "anonymous",
120
- onLoad: () => C(o),
120
+ onLoad: () => N(o),
121
121
  onError: (i) => {
122
- i.target.style.display = "none", C(o);
122
+ i.target.style.display = "none", N(o);
123
123
  }
124
124
  }
125
125
  )
@@ -1,24 +1,24 @@
1
1
  "use client";
2
2
  import { jsxs as S, jsx as g } from "react/jsx-runtime";
3
3
  import pe, { forwardRef as be, useEffect as O, useRef as P, useCallback as k, useState as me, useId as ve } from "react";
4
- import { parse as ge, isValid as he } from "date-fns";
4
+ import { parse as ge, isValid as xe } from "date-fns";
5
5
  import a from "./styles.module.css.js";
6
- import { useLanguageOptional as xe } from "../../context/LanguageContext.js";
7
- const h = (e) => {
8
- const n = e.slice(0, 2), x = e.slice(2, 4), o = e.slice(4, 8);
9
- return e.length > 4 ? `${n}.${x}.${o}` : e.length > 2 ? `${n}.${x}` : e.length > 0 ? n : "";
6
+ import { useLanguageOptional as he } from "../../context/LanguageContext.js";
7
+ const x = (e) => {
8
+ const n = e.slice(0, 2), h = e.slice(2, 4), o = e.slice(4, 8);
9
+ return e.length > 4 ? `${n}.${h}.${o}` : e.length > 2 ? `${n}.${h}` : e.length > 0 ? n : "";
10
10
  }, N = (e) => (e || "").replace(/\D/g, "").slice(0, 8), q = (e) => {
11
11
  if (e.length < 8) return null;
12
- const n = ge(h(e), "dd.MM.yyyy", /* @__PURE__ */ new Date());
13
- return he(n);
12
+ const n = ge(x(e), "dd.MM.yyyy", /* @__PURE__ */ new Date());
13
+ return xe(n);
14
14
  }, ye = be(
15
15
  (e, n) => {
16
- const { t: x } = xe();
16
+ const { t: h } = he();
17
17
  O(() => {
18
- const t = "rk-dateinput-inline-styles";
19
- if (typeof document > "u" || document.getElementById(t)) return;
20
- const r = Ie(a), m = document.createElement("style");
21
- m.id = t, m.textContent = r, document.head.appendChild(m);
18
+ const r = "rk-dateinput-inline-styles";
19
+ if (typeof document > "u" || document.getElementById(r)) return;
20
+ const t = Ie(a), m = document.createElement("style");
21
+ m.id = r, m.textContent = t, document.head.prepend(m);
22
22
  }, []);
23
23
  const {
24
24
  label: o,
@@ -46,44 +46,44 @@ const h = (e) => {
46
46
  description: C,
47
47
  error: u,
48
48
  "data-color": ee,
49
- "data-size": te,
50
- ...re
49
+ "data-size": re,
50
+ ...te
51
51
  } = e, B = y !== void 0, f = P(null);
52
52
  pe.useImperativeHandle(
53
53
  n,
54
54
  () => f.current
55
55
  );
56
56
  const R = P(null), i = k(
57
- (t, r) => {
58
- t !== R.current && (R.current = t, $ == null || $(t, r));
57
+ (r, t) => {
58
+ r !== R.current && (R.current = r, $ == null || $(r, t));
59
59
  },
60
60
  [$]
61
61
  ), D = k(
62
- (t) => h(N(t)),
62
+ (r) => x(N(r)),
63
63
  []
64
64
  ), [p, E] = me(
65
65
  () => D(y ?? J)
66
66
  );
67
67
  O(() => {
68
68
  if (B) {
69
- const t = D(y);
70
- t !== p && (E(t), f.current && f.current.value !== t && (f.current.value = t));
69
+ const r = D(y);
70
+ r !== p && (E(r), f.current && f.current.value !== r && (f.current.value = r));
71
71
  }
72
72
  }, [y, B, p, D]);
73
73
  const oe = k(
74
- (t) => {
75
- const r = t.target, m = p, d = N(r.value), s = h(d);
74
+ (r) => {
75
+ const t = r.target, m = p, s = N(t.value), d = x(s);
76
76
  let l = 0;
77
- const v = d.length;
78
- v <= 2 ? l = v : v <= 4 ? l = v + 1 : l = v + 2, l = Math.min(l, s.length), E(s), r.value = s, r.setSelectionRange(l, l), (s !== m || B) && (I == null || I(t, s));
79
- const fe = q(d);
80
- (d.length === 0 || d.length === 8) && i(d.length === 0 ? null : fe, s);
77
+ const v = s.length;
78
+ v <= 2 ? l = v : v <= 4 ? l = v + 1 : l = v + 2, l = Math.min(l, d.length), E(d), t.value = d, t.setSelectionRange(l, l), (d !== m || B) && (I == null || I(r, d));
79
+ const fe = q(s);
80
+ (s.length === 0 || s.length === 8) && i(s.length === 0 ? null : fe, d);
81
81
  },
82
82
  [p, B, I, i]
83
83
  ), ae = k(
84
- (t) => {
85
- const r = N(t.target.value);
86
- r.length === 0 ? i(null, "") : r.length < 8 ? i(!1, h(r)) : i(q(r), h(r)), z == null || z(t);
84
+ (r) => {
85
+ const t = N(r.target.value);
86
+ t.length === 0 ? i(null, "") : t.length < 8 ? i(!1, x(t)) : i(q(t), x(t)), z == null || z(r);
87
87
  },
88
88
  [z, i]
89
89
  ), ne = [a.fieldset, A].filter(Boolean).join(" "), le = [
@@ -92,12 +92,12 @@ const h = (e) => {
92
92
  u ? a.inputWrapperError : ""
93
93
  ].filter(Boolean).join(" "), ie = [
94
94
  G
95
- ].filter(Boolean).join(" "), de = [
95
+ ].filter(Boolean).join(" "), se = [
96
96
  a.suffixButton,
97
97
  c ? a.suffixButtonInteractive : ""
98
98
  ].filter(Boolean).join(" ");
99
99
  !o && !j && !W && console.warn("Advarsel: DateInput-komponenten bør ha label, aria-label, eller aria-labelledby for tilgjengelighet.");
100
- const se = ve(), b = T ?? `dateinput${se}`, F = o && typeof o == "string" ? `${b}-label` : void 0, L = C ? `${b}-desc` : void 0, M = u ? `${b}-err` : void 0, ce = [L, M].filter(Boolean).join(" ") || void 0, ue = W ?? F;
100
+ const de = ve(), b = T ?? `dateinput${de}`, F = o && typeof o == "string" ? `${b}-label` : void 0, L = C ? `${b}-desc` : void 0, M = u ? `${b}-err` : void 0, ce = [L, M].filter(Boolean).join(" ") || void 0, ue = W ?? F;
101
101
  return (
102
102
  // --- Bruk data-color og data-size på den ytre wrapperen ---
103
103
  /* @__PURE__ */ S(
@@ -105,7 +105,7 @@ const h = (e) => {
105
105
  {
106
106
  className: ne,
107
107
  "data-color": ee,
108
- "data-size": te,
108
+ "data-size": re,
109
109
  children: [
110
110
  o && typeof o == "string" ? /* @__PURE__ */ g("label", { id: F, htmlFor: b, children: o }) : o,
111
111
  C && /* @__PURE__ */ g("p", { id: L, className: a.description, children: C }),
@@ -135,19 +135,19 @@ const h = (e) => {
135
135
  "aria-describedby": ce,
136
136
  "aria-invalid": !!u,
137
137
  className: ie,
138
- ...re
138
+ ...te
139
139
  }
140
140
  ),
141
141
  V && /* @__PURE__ */ g(
142
142
  "button",
143
143
  {
144
144
  type: "button",
145
- className: de,
145
+ className: se,
146
146
  onClick: w ? void 0 : c,
147
147
  tabIndex: c && !w ? 0 : -1,
148
148
  "aria-hidden": !c,
149
149
  disabled: w,
150
- "aria-label": c ? x("dateInput.openDatePicker") : void 0,
150
+ "aria-label": c ? h("dateInput.openDatePicker") : void 0,
151
151
  children: V
152
152
  }
153
153
  )
@@ -1,141 +1,141 @@
1
1
  "use client";
2
2
  import { jsxs as y, jsx as i } from "react/jsx-runtime";
3
- import { useEffect as N, useState as B, useRef as R, useMemo as D, useCallback as g, useId as ee } from "react";
3
+ import { useEffect as N, useState as B, useRef as R, useMemo as D, useCallback as b, useId as te } from "react";
4
4
  import { Button as A } from "@digdir/designsystemet-react";
5
- import { startOfMonth as u, isValid as w, isSameMonth as C, format as f, startOfWeek as I, addDays as h, subMonths as S, addMonths as W, endOfWeek as te, isSameDay as F, isToday as re, eachDayOfInterval as oe, getDaysInMonth as ae, setDate as ne } from "date-fns";
6
- import { nb as c } from "date-fns/locale";
7
- import { ChevronLeftIcon as ie } from "../../assets/images/ChevronLeftIcon.js";
8
- import { ChevronRightIcon as se } from "../../assets/images/ChevronRightIcon.js";
5
+ import { startOfMonth as f, isValid as w, isSameMonth as C, format as u, startOfWeek as I, addDays as g, subMonths as S, addMonths as W, endOfWeek as L, isSameDay as F, isToday as re, endOfMonth as oe, eachDayOfInterval as ae, getDaysInMonth as ne, setDate as ie } from "date-fns";
6
+ import { nb as d } from "date-fns/locale";
7
+ import { ChevronLeftIcon as se } from "../../assets/images/ChevronLeftIcon.js";
8
+ import { ChevronRightIcon as de } from "../../assets/images/ChevronRightIcon.js";
9
9
  import n from "./styles.module.css.js";
10
- import { useLanguageOptional as de } from "../../context/LanguageContext.js";
11
- const le = (r) => {
12
- const o = u(r), s = I(o, { locale: c }), z = h(s, 41);
13
- return oe({ start: s, end: z });
14
- }, H = (r) => r && r.charAt(0).toUpperCase() + r.slice(1), v = (r, o) => {
15
- const s = Math.min(r.getDate(), ae(o));
16
- return ne(u(o), s);
17
- }, ce = ({
18
- initialDate: r = /* @__PURE__ */ new Date(),
10
+ import { useLanguageOptional as le } from "../../context/LanguageContext.js";
11
+ const ce = (t) => {
12
+ const o = f(t), l = I(o, { locale: d }), z = L(oe(t), { locale: d });
13
+ return ae({ start: l, end: z });
14
+ }, H = (t) => t && t.charAt(0).toUpperCase() + t.slice(1), v = (t, o) => {
15
+ const l = Math.min(t.getDate(), ne(o));
16
+ return ie(f(o), l);
17
+ }, ue = ({
18
+ initialDate: t = /* @__PURE__ */ new Date(),
19
19
  selectedDate: o = null,
20
- onDateSelect: s,
20
+ onDateSelect: l,
21
21
  "data-color": z,
22
- "data-size": L
22
+ "data-size": Y
23
23
  }) => {
24
- const { t: E } = de();
24
+ const { t: E } = le();
25
25
  N(() => {
26
- const t = "rk-datepicker-inline-styles";
27
- if (typeof document > "u" || document.getElementById(t)) return;
26
+ const r = "rk-datepicker-inline-styles";
27
+ if (typeof document > "u" || document.getElementById(r)) return;
28
28
  const e = fe(n), a = document.createElement("style");
29
- a.id = t, a.textContent = e, document.head.appendChild(a);
29
+ a.id = r, a.textContent = e, document.head.prepend(a);
30
30
  }, []);
31
- const [l, x] = B(
32
- u(o && w(o) ? o : r)
33
- ), [p, m] = B(
34
- () => o && w(o) ? o : r
31
+ const [c, x] = B(
32
+ f(o && w(o) ? o : t)
33
+ ), [h, p] = B(
34
+ () => o && w(o) ? o : t
35
35
  ), P = R(null), $ = R(!1);
36
36
  N(() => {
37
37
  if (o && w(o)) {
38
- m(o);
39
- const t = u(o);
38
+ p(o);
39
+ const r = f(o);
40
40
  x(
41
- (e) => C(t, e) ? e : t
41
+ (e) => C(r, e) ? e : r
42
42
  );
43
43
  }
44
44
  }, [o]), N(() => {
45
45
  var e;
46
46
  if (!$.current) return;
47
47
  $.current = !1;
48
- const t = (e = P.current) == null ? void 0 : e.querySelector(
49
- `[data-date="${f(p, "yyyy-MM-dd")}"]`
48
+ const r = (e = P.current) == null ? void 0 : e.querySelector(
49
+ `[data-date="${u(h, "yyyy-MM-dd")}"]`
50
50
  );
51
- t == null || t.focus();
52
- }, [p, l]);
51
+ r == null || r.focus();
52
+ }, [h, c]);
53
53
  const M = D(
54
- () => le(l),
55
- [l]
56
- ), Y = D(() => {
57
- const t = [];
54
+ () => ce(c),
55
+ [c]
56
+ ), U = D(() => {
57
+ const r = [];
58
58
  for (let e = 0; e < M.length; e += 7)
59
- t.push(M.slice(e, e + 7));
60
- return t;
61
- }, [M]), U = D(() => {
62
- const t = I(/* @__PURE__ */ new Date(), { locale: c });
59
+ r.push(M.slice(e, e + 7));
60
+ return r;
61
+ }, [M]), K = D(() => {
62
+ const r = I(/* @__PURE__ */ new Date(), { locale: d });
63
63
  return Array.from({ length: 7 }).map((e, a) => {
64
- const b = f(h(t, a), "EEEEEE", { locale: c });
65
- return H(b);
64
+ const m = u(g(r, a), "EEEEEE", { locale: d });
65
+ return H(m);
66
66
  });
67
- }, []), K = g(() => {
68
- x((t) => {
69
- const e = u(S(t, 1));
70
- return m((a) => v(a, e)), e;
67
+ }, []), T = b(() => {
68
+ x((r) => {
69
+ const e = f(S(r, 1));
70
+ return p((a) => v(a, e)), e;
71
71
  });
72
- }, []), T = g(() => {
73
- x((t) => {
74
- const e = u(W(t, 1));
75
- return m((a) => v(a, e)), e;
72
+ }, []), q = b(() => {
73
+ x((r) => {
74
+ const e = f(W(r, 1));
75
+ return p((a) => v(a, e)), e;
76
76
  });
77
- }, []), k = g(
78
- (t) => {
79
- m(t), s == null || s(t);
77
+ }, []), k = b(
78
+ (r) => {
79
+ p(r), l == null || l(r);
80
80
  },
81
- [s]
82
- ), d = g((t) => {
83
- $.current = !0, m(t), x(
84
- (e) => C(t, e) ? e : u(t)
81
+ [l]
82
+ ), s = b((r) => {
83
+ $.current = !0, p(r), x(
84
+ (e) => C(r, e) ? e : f(r)
85
85
  );
86
- }, []), q = g(
87
- (t, e) => {
88
- switch (t.key) {
86
+ }, []), V = b(
87
+ (r, e) => {
88
+ switch (r.key) {
89
89
  case "Enter":
90
90
  case " ":
91
- t.preventDefault(), k(e);
91
+ r.preventDefault(), k(e);
92
92
  return;
93
93
  case "ArrowLeft":
94
- t.preventDefault(), d(h(e, -1));
94
+ r.preventDefault(), s(g(e, -1));
95
95
  return;
96
96
  case "ArrowRight":
97
- t.preventDefault(), d(h(e, 1));
97
+ r.preventDefault(), s(g(e, 1));
98
98
  return;
99
99
  case "ArrowUp":
100
- t.preventDefault(), d(h(e, -7));
100
+ r.preventDefault(), s(g(e, -7));
101
101
  return;
102
102
  case "ArrowDown":
103
- t.preventDefault(), d(h(e, 7));
103
+ r.preventDefault(), s(g(e, 7));
104
104
  return;
105
105
  case "Home":
106
- t.preventDefault(), d(I(e, { locale: c }));
106
+ r.preventDefault(), s(I(e, { locale: d }));
107
107
  return;
108
108
  case "End":
109
- t.preventDefault(), d(te(e, { locale: c }));
109
+ r.preventDefault(), s(L(e, { locale: d }));
110
110
  return;
111
111
  case "PageUp":
112
- t.preventDefault(), d(v(e, S(e, 1)));
112
+ r.preventDefault(), s(v(e, S(e, 1)));
113
113
  return;
114
114
  case "PageDown":
115
- t.preventDefault(), d(v(e, W(e, 1)));
115
+ r.preventDefault(), s(v(e, W(e, 1)));
116
116
  return;
117
117
  }
118
118
  },
119
- [k, d]
120
- ), V = f(l, "MMMM", { locale: c }), _ = f(l, "yyyy", { locale: c }), G = `${H(V)} ${_}`, O = ee(), J = C(p, l) ? p : v(p, l);
119
+ [k, s]
120
+ ), _ = u(c, "MMMM", { locale: d }), G = u(c, "yyyy", { locale: d }), J = `${H(_)} ${G}`, O = te(), Q = C(h, c) ? h : v(h, c);
121
121
  return /* @__PURE__ */ y(
122
122
  "div",
123
123
  {
124
124
  className: n.calendarContainer,
125
125
  "data-color": z,
126
- "data-size": L,
126
+ "data-size": Y,
127
127
  children: [
128
128
  /* @__PURE__ */ y("div", { className: n.calendarHeader, children: [
129
- /* @__PURE__ */ i("span", { className: n.monthYear, id: O, "aria-live": "polite", children: G }),
129
+ /* @__PURE__ */ i("span", { className: n.monthYear, id: O, "aria-live": "polite", children: J }),
130
130
  /* @__PURE__ */ y("div", { className: n.navigationButtons, children: [
131
131
  /* @__PURE__ */ i(
132
132
  A,
133
133
  {
134
134
  variant: "tertiary",
135
135
  icon: !0,
136
- onClick: K,
136
+ onClick: T,
137
137
  "aria-label": E("datePicker.previousMonth"),
138
- children: /* @__PURE__ */ i(ie, {})
138
+ children: /* @__PURE__ */ i(se, {})
139
139
  }
140
140
  ),
141
141
  /* @__PURE__ */ i(
@@ -143,49 +143,49 @@ const le = (r) => {
143
143
  {
144
144
  variant: "tertiary",
145
145
  icon: !0,
146
- onClick: T,
146
+ onClick: q,
147
147
  "aria-label": E("datePicker.nextMonth"),
148
- children: /* @__PURE__ */ i(se, {})
148
+ children: /* @__PURE__ */ i(de, {})
149
149
  }
150
150
  )
151
151
  ] })
152
152
  ] }),
153
153
  /* @__PURE__ */ y("div", { role: "grid", "aria-labelledby": O, className: n.gridWrapper, ref: P, children: [
154
- /* @__PURE__ */ i("div", { role: "row", className: n.gridRow, children: U.map((t) => /* @__PURE__ */ i("div", { role: "columnheader", className: n.dayNameCell, children: t }, t)) }),
155
- Y.map((t) => /* @__PURE__ */ i("div", { role: "row", className: n.gridRow, children: t.map((e) => {
156
- const a = C(e, l), b = o && w(o) && F(e, o), j = re(e), Q = a && F(e, J), X = [
154
+ /* @__PURE__ */ i("div", { role: "row", className: n.gridRow, children: K.map((r) => /* @__PURE__ */ i("div", { role: "columnheader", className: n.dayNameCell, children: r }, r)) }),
155
+ U.map((r) => /* @__PURE__ */ i("div", { role: "row", className: n.gridRow, children: r.map((e) => {
156
+ const a = C(e, c), m = o && w(o) && F(e, o), j = re(e), X = a && F(e, Q), Z = [
157
157
  n.dateCell,
158
158
  a ? "" : n.otherMonth,
159
- b ? n.selectedDate : "",
160
- j && !b ? n.todayDate : ""
159
+ m ? n.selectedDate : "",
160
+ j && !m ? n.todayDate : ""
161
161
  ].filter(Boolean).join(" ");
162
162
  return /* @__PURE__ */ i(
163
163
  "div",
164
164
  {
165
165
  role: "gridcell",
166
- className: X,
167
- "data-date": f(e, "yyyy-MM-dd"),
166
+ className: Z,
167
+ "data-date": u(e, "yyyy-MM-dd"),
168
168
  onClick: a ? () => k(e) : void 0,
169
- onKeyDown: a ? (Z) => q(Z, e) : void 0,
170
- tabIndex: a ? Q ? 0 : -1 : void 0,
171
- "aria-selected": a ? !!b : void 0,
169
+ onKeyDown: a ? (ee) => V(ee, e) : void 0,
170
+ tabIndex: a ? X ? 0 : -1 : void 0,
171
+ "aria-selected": a ? !!m : void 0,
172
172
  "aria-disabled": !a || void 0,
173
173
  "aria-current": j ? "date" : void 0,
174
- "aria-label": f(e, "PPP", { locale: c }),
175
- children: /* @__PURE__ */ i("span", { className: n.dateNumberContainer, children: f(e, "d") })
174
+ "aria-label": u(e, "PPP", { locale: d }),
175
+ children: /* @__PURE__ */ i("span", { className: n.dateNumberContainer, children: u(e, "d") })
176
176
  },
177
177
  e.toISOString()
178
178
  );
179
- }) }, t[0].toISOString()))
179
+ }) }, r[0].toISOString()))
180
180
  ] })
181
181
  ]
182
182
  }
183
183
  );
184
184
  };
185
- ce.displayName = "DatePicker";
186
- function fe(r) {
185
+ ue.displayName = "DatePicker";
186
+ function fe(t) {
187
187
  return `
188
- .${r.calendarContainer} {
188
+ .${t.calendarContainer} {
189
189
  display: inline-flex;
190
190
  padding: var(--ds-size-8, 32px);
191
191
  flex-direction: column;
@@ -199,13 +199,13 @@ function fe(r) {
199
199
  max-width: 100%;
200
200
  box-sizing: border-box;
201
201
  }
202
- .${r.calendarHeader} {
202
+ .${t.calendarHeader} {
203
203
  display: flex;
204
204
  justify-content: space-between;
205
205
  align-items: center;
206
206
  align-self: stretch;
207
207
  }
208
- .${r.monthYear} {
208
+ .${t.monthYear} {
209
209
  color: var(--ds-color-text-default, #2b2b2b);
210
210
  font-family: var(--ds-font-family, sans-serif);
211
211
  font-size: var(--ds-heading-sm-font-size, 1.5rem);
@@ -213,24 +213,24 @@ function fe(r) {
213
213
  line-height: var(--ds-heading-sm-line-height, 1.3);
214
214
  margin: 0;
215
215
  }
216
- .${r.navigationButtons} {
216
+ .${t.navigationButtons} {
217
217
  display: flex;
218
218
  gap: var(--ds-size-1, 4px);
219
219
  }
220
- .${r.navigationButtons} > button:disabled svg {
220
+ .${t.navigationButtons} > button:disabled svg {
221
221
  opacity: var(--ds-opacity-disabled, 0.3);
222
222
  }
223
- .${r.gridWrapper} {
223
+ .${t.gridWrapper} {
224
224
  width: 100%;
225
225
  overflow: hidden;
226
226
  }
227
- .${r.gridRow} {
227
+ .${t.gridRow} {
228
228
  display: grid;
229
229
  grid-template-columns: repeat(7, 1fr);
230
230
  width: 100%;
231
231
  text-align: center;
232
232
  }
233
- .${r.dayNameCell} {
233
+ .${t.dayNameCell} {
234
234
  display: flex;
235
235
  padding: var(--ds-size-2, 8px);
236
236
  flex-direction: column;
@@ -245,7 +245,7 @@ function fe(r) {
245
245
  box-sizing: border-box;
246
246
  min-width: 0;
247
247
  }
248
- .${r.dateCell} {
248
+ .${t.dateCell} {
249
249
  display: flex;
250
250
  padding: var(--ds-size-5, 22px);
251
251
  flex-direction: column;
@@ -265,13 +265,13 @@ function fe(r) {
265
265
  user-select: none;
266
266
  min-width: 0;
267
267
  }
268
- .${r.dateCell}:focus-visible {
268
+ .${t.dateCell}:focus-visible {
269
269
  outline: var(--ds-border-width-focus, 3px) solid var(--ds-color-focus-outer, #2b2b2b);
270
270
  outline-offset: calc(-1 * var(--ds-border-width-focus, 3px));
271
271
  position: relative;
272
272
  z-index: 2;
273
273
  }
274
- .${r.dateNumberContainer} {
274
+ .${t.dateNumberContainer} {
275
275
  display: flex;
276
276
  justify-content: center;
277
277
  align-items: center;
@@ -283,69 +283,72 @@ function fe(r) {
283
283
  box-sizing: border-box;
284
284
  background-color: transparent;
285
285
  }
286
- .${r.dateCell}:hover:not(.${r.otherMonth}):not(.${r.disabled}) {
286
+ .${t.dateCell}:hover:not(.${t.otherMonth}):not(.${t.disabled}) {
287
287
  background-color: var(--ds-color-surface-hover, #eee);
288
288
  position: relative;
289
289
  z-index: 1;
290
290
  }
291
- .${r.otherMonth} {
292
- color: var(--ds-color-text-subtle, #aaa);
291
+ .${t.otherMonth} {
292
+ /* Neutral-scoped tokens on purpose: under the red color scope the
293
+ scope-relative tints turn pink, which emphasized the outside days
294
+ instead of muting them. */
295
+ color: var(--ds-color-neutral-text-subtle, #aaa);
293
296
  cursor: default;
294
297
  pointer-events: none;
295
- background-color: var(--ds-color-surface-tinted, #e8e8e8);
296
- border: var(--ds-border-width-default, 1px) solid var(--ds-color-border-subtle, #bcbcbc);
298
+ background-color: var(--ds-color-neutral-surface-tinted, #e8e8e8);
299
+ border: var(--ds-border-width-default, 1px) solid var(--ds-color-neutral-border-subtle, #bcbcbc);
297
300
  margin: -0.5px;
298
301
  }
299
- .${r.selectedDate} {
302
+ .${t.selectedDate} {
300
303
  background-color: var(--ds-color-base-default, #C30000);
301
304
  border-color: var(--ds-color-base-default, #C30000);
302
305
  color: var(--ds-color-base-contrast-default, #fff);
303
306
  position: relative;
304
307
  z-index: 1;
305
308
  }
306
- .${r.selectedDate} .${r.dateNumberContainer} {
309
+ .${t.selectedDate} .${t.dateNumberContainer} {
307
310
  color: var(--ds-color-base-contrast-default, #fff);
308
311
  font-weight: var(--ds-font-weight-semibold, 600);
309
312
  background-color: transparent;
310
313
  }
311
- .${r.todayDate} .${r.dateNumberContainer} {
314
+ .${t.todayDate} .${t.dateNumberContainer} {
312
315
  font-weight: var(--ds-font-weight-semibold, 600);
313
316
  }
314
317
  @media (max-width: 480px) {
315
- .${r.calendarContainer} {
318
+ .${t.calendarContainer} {
316
319
  padding: var(--ds-size-4, 16px);
317
320
  gap: var(--ds-size-2, 8px);
318
321
  width: 100%;
319
322
  }
320
- .${r.monthYear} {
323
+ .${t.monthYear} {
321
324
  font-size: var(--ds-heading-xs-font-size, 1.125rem);
322
325
  }
323
- .${r.dayNameCell} {
326
+ .${t.dayNameCell} {
324
327
  padding: var(--ds-size-1, 4px);
325
328
  font-size: var(--ds-font-size-1, 12px);
326
329
  }
327
- .${r.dateCell} {
330
+ .${t.dateCell} {
328
331
  padding: var(--ds-size-2, 8px);
329
332
  font-size: var(--ds-font-size-1, 12px);
330
333
  }
331
- .${r.dateNumberContainer} {
334
+ .${t.dateNumberContainer} {
332
335
  width: 20px;
333
336
  height: 20px;
334
337
  }
335
338
  }
336
339
  @media (max-width: 360px) {
337
- .${r.calendarContainer} {
340
+ .${t.calendarContainer} {
338
341
  padding: var(--ds-size-2, 8px);
339
342
  }
340
- .${r.dayNameCell} {
343
+ .${t.dayNameCell} {
341
344
  padding: 2px;
342
345
  font-size: 10px;
343
346
  }
344
- .${r.dateCell} {
347
+ .${t.dateCell} {
345
348
  padding: var(--ds-size-1, 4px);
346
349
  font-size: 11px;
347
350
  }
348
- .${r.dateNumberContainer} {
351
+ .${t.dateNumberContainer} {
349
352
  width: 16px;
350
353
  height: 16px;
351
354
  }
@@ -353,5 +356,5 @@ function fe(r) {
353
356
  `;
354
357
  }
355
358
  export {
356
- ce as DatePicker
359
+ ue as DatePicker
357
360
  };