rk-designsystem 1.3.2 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/assets/logos/RedCrossLogo.js +30 -0
- package/dist/components/Carousel/index.js +217 -167
- package/dist/components/Carousel/styles.module.css.js +32 -28
- package/dist/components/DateInput/index.js +85 -87
- package/dist/components/DateInput/styles.module.css.js +1 -1
- package/dist/components/DatePicker/index.js +197 -175
- package/dist/components/DatePicker/styles.module.css.js +22 -20
- package/dist/components/Donor/index.js +84 -70
- package/dist/components/Donor/styles.module.css.js +22 -22
- package/dist/components/Footer/index.js +186 -189
- package/dist/components/Footer/styles.module.css.js +44 -44
- package/dist/components/GraphicElement/index.js +3 -3
- package/dist/components/Header/index.js +328 -314
- package/dist/components/Header/styles.module.css.js +52 -52
- package/dist/context/LanguageContext.js +17 -14
- package/dist/index.d.ts +42 -3
- package/dist/rk-designsystem.css +1 -1
- package/dist/translations/index.js +10 -2
- package/package.json +12 -20
- package/dist/utils/search-index.js +0 -106
|
@@ -1,261 +1,280 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useEffect as
|
|
2
|
+
import { jsxs as w, jsx as d } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect as P, useState as S, useRef as W, useMemo as E, useCallback as g, useId as oe } from "react";
|
|
4
4
|
import { Button as A } from "@digdir/designsystemet-react";
|
|
5
|
-
import { startOfMonth as
|
|
6
|
-
import { nb as
|
|
7
|
-
import { ChevronLeftIcon as
|
|
8
|
-
import { ChevronRightIcon as
|
|
9
|
-
import
|
|
10
|
-
import { useLanguageOptional as
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
return
|
|
14
|
-
},
|
|
15
|
-
const
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
initialDate:
|
|
19
|
-
selectedDate:
|
|
20
|
-
onDateSelect:
|
|
21
|
-
"data-color":
|
|
22
|
-
"data-size":
|
|
5
|
+
import { startOfMonth as p, isValid as k, isSameMonth as z, format as f, startOfWeek as B, addDays as v, subMonths as H, addMonths as L, endOfWeek as T, isSameDay as V, isToday as ne, endOfMonth as ie, eachDayOfInterval as se, getDaysInMonth as de, setDate as le } from "date-fns";
|
|
6
|
+
import { enGB as ce, nb as ue } from "date-fns/locale";
|
|
7
|
+
import { ChevronLeftIcon as he } from "../../assets/images/ChevronLeftIcon.js";
|
|
8
|
+
import { ChevronRightIcon as fe } from "../../assets/images/ChevronRightIcon.js";
|
|
9
|
+
import o from "./styles.module.css.js";
|
|
10
|
+
import { useLanguageOptional as pe } from "../../context/LanguageContext.js";
|
|
11
|
+
const me = (e, a) => {
|
|
12
|
+
const c = p(e), C = B(c, { locale: a }), $ = T(ie(e), { locale: a });
|
|
13
|
+
return se({ start: C, end: $ });
|
|
14
|
+
}, Y = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), x = (e, a) => {
|
|
15
|
+
const c = Math.min(e.getDate(), de(a));
|
|
16
|
+
return le(p(a), c);
|
|
17
|
+
}, be = ({
|
|
18
|
+
initialDate: e = /* @__PURE__ */ new Date(),
|
|
19
|
+
selectedDate: a = null,
|
|
20
|
+
onDateSelect: c,
|
|
21
|
+
"data-color": C,
|
|
22
|
+
"data-size": $
|
|
23
23
|
}) => {
|
|
24
|
-
const { t:
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
if (typeof document > "u" || document.getElementById(
|
|
28
|
-
const
|
|
29
|
-
|
|
24
|
+
const { t: O, language: U } = pe(), s = U === "EN" ? ce : ue;
|
|
25
|
+
P(() => {
|
|
26
|
+
const t = "rk-datepicker-inline-styles";
|
|
27
|
+
if (typeof document > "u" || document.getElementById(t)) return;
|
|
28
|
+
const r = ge(o), n = document.createElement("style");
|
|
29
|
+
n.id = t, n.textContent = r, document.head.prepend(n);
|
|
30
30
|
}, []);
|
|
31
|
-
const [
|
|
32
|
-
|
|
33
|
-
), [
|
|
34
|
-
() =>
|
|
35
|
-
),
|
|
36
|
-
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
(
|
|
31
|
+
const [u, y] = S(
|
|
32
|
+
p(a && k(a) ? a : e)
|
|
33
|
+
), [m, b] = S(
|
|
34
|
+
() => a && k(a) ? a : e
|
|
35
|
+
), j = W(null), M = W(!1);
|
|
36
|
+
P(() => {
|
|
37
|
+
if (a && k(a)) {
|
|
38
|
+
b(a);
|
|
39
|
+
const t = p(a);
|
|
40
|
+
y(
|
|
41
|
+
(r) => z(t, r) ? r : t
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
|
-
}, [
|
|
45
|
-
var
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
`[data-date="${
|
|
44
|
+
}, [a]), P(() => {
|
|
45
|
+
var r;
|
|
46
|
+
if (!M.current) return;
|
|
47
|
+
M.current = !1;
|
|
48
|
+
const t = (r = j.current) == null ? void 0 : r.querySelector(
|
|
49
|
+
`[data-date="${f(m, "yyyy-MM-dd")}"]`
|
|
50
50
|
);
|
|
51
|
-
|
|
52
|
-
}, [
|
|
53
|
-
const
|
|
54
|
-
() =>
|
|
55
|
-
[
|
|
56
|
-
),
|
|
57
|
-
const
|
|
58
|
-
for (let
|
|
59
|
-
|
|
60
|
-
return
|
|
61
|
-
}, [
|
|
62
|
-
const
|
|
63
|
-
return Array.from({ length: 7 }).map((
|
|
64
|
-
const
|
|
65
|
-
return
|
|
51
|
+
t == null || t.focus();
|
|
52
|
+
}, [m, u]);
|
|
53
|
+
const N = E(
|
|
54
|
+
() => me(u, s),
|
|
55
|
+
[u, s]
|
|
56
|
+
), G = E(() => {
|
|
57
|
+
const t = [];
|
|
58
|
+
for (let r = 0; r < N.length; r += 7)
|
|
59
|
+
t.push(N.slice(r, r + 7));
|
|
60
|
+
return t;
|
|
61
|
+
}, [N]), K = E(() => {
|
|
62
|
+
const t = B(/* @__PURE__ */ new Date(), { locale: s });
|
|
63
|
+
return Array.from({ length: 7 }).map((r, n) => {
|
|
64
|
+
const i = f(v(t, n), "EEEEEE", { locale: s });
|
|
65
|
+
return Y(i);
|
|
66
66
|
});
|
|
67
|
-
}, []),
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
return
|
|
67
|
+
}, [s]), q = g(() => {
|
|
68
|
+
y((t) => {
|
|
69
|
+
const r = p(H(t, 1));
|
|
70
|
+
return b((n) => x(n, r)), r;
|
|
71
71
|
});
|
|
72
|
-
}, []),
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
return
|
|
72
|
+
}, []), _ = g(() => {
|
|
73
|
+
y((t) => {
|
|
74
|
+
const r = p(L(t, 1));
|
|
75
|
+
return b((n) => x(n, r)), r;
|
|
76
76
|
});
|
|
77
|
-
}, []),
|
|
78
|
-
(
|
|
79
|
-
|
|
77
|
+
}, []), D = g(
|
|
78
|
+
(t) => {
|
|
79
|
+
b(t), c == null || c(t);
|
|
80
80
|
},
|
|
81
|
-
[
|
|
82
|
-
),
|
|
83
|
-
|
|
84
|
-
(
|
|
81
|
+
[c]
|
|
82
|
+
), l = g((t) => {
|
|
83
|
+
M.current = !0, b(t), y(
|
|
84
|
+
(r) => z(t, r) ? r : p(t)
|
|
85
85
|
);
|
|
86
|
-
}, []),
|
|
87
|
-
(
|
|
88
|
-
switch (
|
|
86
|
+
}, []), J = g(
|
|
87
|
+
(t, r) => {
|
|
88
|
+
switch (t.key) {
|
|
89
89
|
case "Enter":
|
|
90
90
|
case " ":
|
|
91
|
-
|
|
91
|
+
t.preventDefault(), D(r);
|
|
92
92
|
return;
|
|
93
93
|
case "ArrowLeft":
|
|
94
|
-
|
|
94
|
+
t.preventDefault(), l(v(r, -1));
|
|
95
95
|
return;
|
|
96
96
|
case "ArrowRight":
|
|
97
|
-
|
|
97
|
+
t.preventDefault(), l(v(r, 1));
|
|
98
98
|
return;
|
|
99
99
|
case "ArrowUp":
|
|
100
|
-
|
|
100
|
+
t.preventDefault(), l(v(r, -7));
|
|
101
101
|
return;
|
|
102
102
|
case "ArrowDown":
|
|
103
|
-
|
|
103
|
+
t.preventDefault(), l(v(r, 7));
|
|
104
104
|
return;
|
|
105
105
|
case "Home":
|
|
106
|
-
|
|
106
|
+
t.preventDefault(), l(B(r, { locale: s }));
|
|
107
107
|
return;
|
|
108
108
|
case "End":
|
|
109
|
-
|
|
109
|
+
t.preventDefault(), l(T(r, { locale: s }));
|
|
110
110
|
return;
|
|
111
111
|
case "PageUp":
|
|
112
|
-
|
|
112
|
+
t.preventDefault(), l(x(r, H(r, 1)));
|
|
113
113
|
return;
|
|
114
114
|
case "PageDown":
|
|
115
|
-
|
|
115
|
+
t.preventDefault(), l(x(r, L(r, 1)));
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
|
-
[
|
|
120
|
-
),
|
|
121
|
-
return /* @__PURE__ */
|
|
119
|
+
[D, l, s]
|
|
120
|
+
), Q = f(u, "MMMM", { locale: s }), X = f(u, "yyyy", { locale: s }), Z = `${Y(Q)} ${X}`, F = oe(), ee = z(m, u) ? m : x(m, u);
|
|
121
|
+
return /* @__PURE__ */ w(
|
|
122
122
|
"div",
|
|
123
123
|
{
|
|
124
|
-
className:
|
|
125
|
-
"data-color":
|
|
126
|
-
"data-size":
|
|
124
|
+
className: o.calendarContainer,
|
|
125
|
+
"data-color": C,
|
|
126
|
+
"data-size": $,
|
|
127
127
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ w("div", { className: o.calendarHeader, children: [
|
|
129
|
+
/* @__PURE__ */ d("span", { className: o.monthYear, id: F, "aria-live": "polite", children: Z }),
|
|
130
|
+
/* @__PURE__ */ w("div", { className: o.navigationButtons, children: [
|
|
131
|
+
/* @__PURE__ */ d(
|
|
132
132
|
A,
|
|
133
133
|
{
|
|
134
134
|
variant: "tertiary",
|
|
135
135
|
icon: !0,
|
|
136
|
-
onClick:
|
|
137
|
-
"aria-label":
|
|
138
|
-
children: /* @__PURE__ */
|
|
136
|
+
onClick: q,
|
|
137
|
+
"aria-label": O("datePicker.previousMonth"),
|
|
138
|
+
children: /* @__PURE__ */ d(he, {})
|
|
139
139
|
}
|
|
140
140
|
),
|
|
141
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ d(
|
|
142
142
|
A,
|
|
143
143
|
{
|
|
144
144
|
variant: "tertiary",
|
|
145
145
|
icon: !0,
|
|
146
|
-
onClick:
|
|
147
|
-
"aria-label":
|
|
148
|
-
children: /* @__PURE__ */
|
|
146
|
+
onClick: _,
|
|
147
|
+
"aria-label": O("datePicker.nextMonth"),
|
|
148
|
+
children: /* @__PURE__ */ d(fe, {})
|
|
149
149
|
}
|
|
150
150
|
)
|
|
151
151
|
] })
|
|
152
152
|
] }),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
a
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
"
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
153
|
+
/* @__PURE__ */ w("div", { role: "grid", "aria-labelledby": F, className: o.gridWrapper, ref: j, children: [
|
|
154
|
+
/* @__PURE__ */ d("div", { role: "row", className: o.gridRow, children: K.map((t) => /* @__PURE__ */ d("div", { role: "columnheader", className: o.dayNameCell, children: t }, t)) }),
|
|
155
|
+
G.map((t, r) => {
|
|
156
|
+
var n;
|
|
157
|
+
return /* @__PURE__ */ d("div", { role: "row", className: o.gridRow, children: t.map((i) => {
|
|
158
|
+
const h = z(i, u), I = a && k(a) && V(i, a), R = ne(i), te = h && V(i, ee), re = [
|
|
159
|
+
o.dateCell,
|
|
160
|
+
h ? "" : o.otherMonth,
|
|
161
|
+
I ? o.selectedDate : "",
|
|
162
|
+
R && !I ? o.todayDate : ""
|
|
163
|
+
].filter(Boolean).join(" ");
|
|
164
|
+
return /* @__PURE__ */ d(
|
|
165
|
+
"div",
|
|
166
|
+
{
|
|
167
|
+
role: "gridcell",
|
|
168
|
+
className: re,
|
|
169
|
+
"data-date": f(i, "yyyy-MM-dd"),
|
|
170
|
+
onClick: h ? () => D(i) : void 0,
|
|
171
|
+
onKeyDown: h ? (ae) => J(ae, i) : void 0,
|
|
172
|
+
tabIndex: h ? te ? 0 : -1 : void 0,
|
|
173
|
+
"aria-selected": h ? !!I : void 0,
|
|
174
|
+
"aria-disabled": !h || void 0,
|
|
175
|
+
"aria-current": R ? "date" : void 0,
|
|
176
|
+
"aria-label": f(i, "PPP", { locale: s }),
|
|
177
|
+
children: /* @__PURE__ */ d("span", { className: o.dateNumberContainer, children: f(i, "d") })
|
|
178
|
+
},
|
|
179
|
+
i.toISOString()
|
|
180
|
+
);
|
|
181
|
+
}) }, ((n = t[0]) == null ? void 0 : n.toISOString()) ?? r);
|
|
182
|
+
})
|
|
180
183
|
] })
|
|
181
184
|
]
|
|
182
185
|
}
|
|
183
186
|
);
|
|
184
187
|
};
|
|
185
|
-
|
|
186
|
-
function
|
|
188
|
+
be.displayName = "DatePicker";
|
|
189
|
+
function ge(e) {
|
|
187
190
|
return `
|
|
188
|
-
.${
|
|
191
|
+
.${e.calendarContainer} {
|
|
192
|
+
/* Half a cell border. The cells overlap each other by this much so two
|
|
193
|
+
adjacent 1px borders land on top of each other and read as one line; the
|
|
194
|
+
grid wrapper pays the same amount back as padding so the outermost edges
|
|
195
|
+
are not clipped. Both sides of that bargain must use the same number. */
|
|
196
|
+
--rk-calendar-border-overlap: 0.5px;
|
|
189
197
|
display: inline-flex;
|
|
190
|
-
padding: var(--ds-size-
|
|
198
|
+
padding: var(--ds-size-7, 28px);
|
|
191
199
|
flex-direction: column;
|
|
192
200
|
align-items: flex-start;
|
|
193
201
|
gap: var(--ds-size-3, 12px);
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
background-color: var(--ds-color-background-default, #fff);
|
|
202
|
+
/* No outer card — see styles.module.css. */
|
|
203
|
+
background-color: var(--ds-color-neutral-background-default, #fff);
|
|
197
204
|
font-family: var(--ds-font-family, sans-serif);
|
|
198
|
-
color: var(--ds-color-text-default, #2b2b2b);
|
|
205
|
+
color: var(--ds-color-neutral-text-default, #2b2b2b);
|
|
199
206
|
max-width: 100%;
|
|
200
207
|
box-sizing: border-box;
|
|
201
208
|
}
|
|
202
|
-
.${
|
|
209
|
+
.${e.calendarHeader} {
|
|
203
210
|
display: flex;
|
|
204
211
|
justify-content: space-between;
|
|
205
212
|
align-items: center;
|
|
206
213
|
align-self: stretch;
|
|
207
214
|
}
|
|
208
|
-
.${
|
|
209
|
-
color: var(--ds-color-text-default, #2b2b2b);
|
|
210
|
-
font-family: var(--ds-font-family, sans-serif);
|
|
215
|
+
.${e.monthYear} {
|
|
216
|
+
color: var(--ds-color-neutral-text-default, #2b2b2b);
|
|
217
|
+
font-family: var(--ds-font-family, 'Myriad VF', sans-serif);
|
|
211
218
|
font-size: var(--ds-heading-sm-font-size, 1.5rem);
|
|
212
219
|
font-weight: var(--ds-heading-sm-font-weight, 500);
|
|
213
220
|
line-height: var(--ds-heading-sm-line-height, 1.3);
|
|
214
221
|
margin: 0;
|
|
215
222
|
}
|
|
216
|
-
.${
|
|
223
|
+
.${e.navigationButtons} {
|
|
217
224
|
display: flex;
|
|
218
225
|
gap: var(--ds-size-1, 4px);
|
|
219
226
|
}
|
|
220
|
-
.${
|
|
227
|
+
.${e.navigationButtons} > button:disabled svg {
|
|
221
228
|
opacity: var(--ds-opacity-disabled, 0.3);
|
|
222
229
|
}
|
|
223
|
-
.${
|
|
230
|
+
.${e.gridWrapper} {
|
|
224
231
|
width: 100%;
|
|
232
|
+
/* Give back the half pixel the cells hang outside the grid by. Without it
|
|
233
|
+
overflow:hidden cuts the last row's bottom border and the last column's
|
|
234
|
+
right border, leaving the grid open on two sides — the container border
|
|
235
|
+
used to cover that up, so removing the border exposed it. */
|
|
236
|
+
padding: var(--rk-calendar-border-overlap, 0.5px);
|
|
225
237
|
overflow: hidden;
|
|
238
|
+
box-sizing: border-box;
|
|
226
239
|
}
|
|
227
|
-
.${
|
|
240
|
+
.${e.gridRow} {
|
|
228
241
|
display: grid;
|
|
229
|
-
|
|
230
|
-
|
|
242
|
+
/* See styles.module.css: a fixed track keeps the design's 64px cell and
|
|
243
|
+
keeps the weekday row aligned with the dates. */
|
|
244
|
+
grid-template-columns: repeat(7, var(--rk-calendar-cell, 64px));
|
|
245
|
+
width: max-content;
|
|
246
|
+
max-width: 100%;
|
|
231
247
|
text-align: center;
|
|
232
248
|
}
|
|
233
|
-
.${
|
|
249
|
+
.${e.dayNameCell} {
|
|
234
250
|
display: flex;
|
|
235
251
|
padding: var(--ds-size-2, 8px);
|
|
236
252
|
flex-direction: column;
|
|
237
253
|
justify-content: center;
|
|
238
254
|
align-items: center;
|
|
239
|
-
color: var(--ds-color-text-default, #2b2b2b);
|
|
255
|
+
color: var(--ds-color-neutral-text-default, #2b2b2b);
|
|
240
256
|
text-align: center;
|
|
241
|
-
font-family: var(--ds-font-family, sans-serif);
|
|
257
|
+
font-family: var(--ds-font-family, 'Myriad VF', sans-serif);
|
|
242
258
|
font-size: var(--ds-body-xs-font-size, 14px);
|
|
243
259
|
font-weight: var(--ds-font-weight-semibold, 600);
|
|
244
260
|
line-height: var(--ds-body-short-xs-line-height, 1.3);
|
|
245
261
|
box-sizing: border-box;
|
|
246
262
|
min-width: 0;
|
|
247
263
|
}
|
|
248
|
-
.${
|
|
264
|
+
.${e.dateCell} {
|
|
249
265
|
display: flex;
|
|
250
|
-
padding: var(--ds-size-5,
|
|
266
|
+
padding: var(--ds-size-5, 20px);
|
|
251
267
|
flex-direction: column;
|
|
252
268
|
justify-content: center;
|
|
253
269
|
align-items: center;
|
|
254
|
-
border: var(--ds-border-width-default, 1px) solid var(--ds-color-border-subtle, #bcbcbc);
|
|
270
|
+
border: var(--ds-border-width-default, 1px) solid var(--ds-color-neutral-border-subtle, #bcbcbc);
|
|
255
271
|
box-sizing: border-box;
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
272
|
+
/* Pull each cell half a border width up and left so its top/left border
|
|
273
|
+
coincides with the neighbour's bottom/right one instead of stacking into
|
|
274
|
+
a 2px line. Paid back by the grid wrapper's padding. */
|
|
275
|
+
margin: calc(-1 * var(--rk-calendar-border-overlap, 0.5px));
|
|
276
|
+
font-family: var(--ds-font-family, 'Myriad VF', sans-serif);
|
|
277
|
+
color: var(--ds-color-neutral-text-default, #2b2b2b);
|
|
259
278
|
text-align: center;
|
|
260
279
|
font-size: var(--ds-body-xs-font-size, 14px);
|
|
261
280
|
font-weight: var(--ds-body-xs-font-weight, 400);
|
|
@@ -265,13 +284,13 @@ function fe(t) {
|
|
|
265
284
|
user-select: none;
|
|
266
285
|
min-width: 0;
|
|
267
286
|
}
|
|
268
|
-
.${
|
|
287
|
+
.${e.dateCell}:focus-visible {
|
|
269
288
|
outline: var(--ds-border-width-focus, 3px) solid var(--ds-color-focus-outer, #2b2b2b);
|
|
270
289
|
outline-offset: calc(-1 * var(--ds-border-width-focus, 3px));
|
|
271
290
|
position: relative;
|
|
272
291
|
z-index: 2;
|
|
273
292
|
}
|
|
274
|
-
.${
|
|
293
|
+
.${e.dateNumberContainer} {
|
|
275
294
|
display: flex;
|
|
276
295
|
justify-content: center;
|
|
277
296
|
align-items: center;
|
|
@@ -283,12 +302,12 @@ function fe(t) {
|
|
|
283
302
|
box-sizing: border-box;
|
|
284
303
|
background-color: transparent;
|
|
285
304
|
}
|
|
286
|
-
.${
|
|
287
|
-
background-color: var(--ds-color-surface-hover, #eee);
|
|
305
|
+
.${e.dateCell}:hover:not(.${e.otherMonth}):not(.${e.disabled}) {
|
|
306
|
+
background-color: var(--ds-color-neutral-surface-hover, #eee);
|
|
288
307
|
position: relative;
|
|
289
308
|
z-index: 1;
|
|
290
309
|
}
|
|
291
|
-
.${
|
|
310
|
+
.${e.otherMonth} {
|
|
292
311
|
/* Neutral-scoped tokens on purpose: under the red color scope the
|
|
293
312
|
scope-relative tints turn pink, which emphasized the outside days
|
|
294
313
|
instead of muting them. */
|
|
@@ -297,58 +316,61 @@ function fe(t) {
|
|
|
297
316
|
pointer-events: none;
|
|
298
317
|
background-color: var(--ds-color-neutral-surface-tinted, #e8e8e8);
|
|
299
318
|
border: var(--ds-border-width-default, 1px) solid var(--ds-color-neutral-border-subtle, #bcbcbc);
|
|
300
|
-
margin: -0.5px;
|
|
319
|
+
margin: calc(-1 * var(--rk-calendar-border-overlap, 0.5px));
|
|
301
320
|
}
|
|
302
|
-
.${
|
|
321
|
+
.${e.selectedDate} {
|
|
303
322
|
background-color: var(--ds-color-base-default, #C30000);
|
|
304
323
|
border-color: var(--ds-color-base-default, #C30000);
|
|
305
324
|
color: var(--ds-color-base-contrast-default, #fff);
|
|
306
325
|
position: relative;
|
|
307
326
|
z-index: 1;
|
|
308
327
|
}
|
|
309
|
-
.${
|
|
328
|
+
.${e.selectedDate} .${e.dateNumberContainer} {
|
|
310
329
|
color: var(--ds-color-base-contrast-default, #fff);
|
|
311
330
|
font-weight: var(--ds-font-weight-semibold, 600);
|
|
312
331
|
background-color: transparent;
|
|
313
332
|
}
|
|
314
|
-
.${
|
|
333
|
+
.${e.todayDate} .${e.dateNumberContainer} {
|
|
315
334
|
font-weight: var(--ds-font-weight-semibold, 600);
|
|
316
335
|
}
|
|
336
|
+
@media (max-width: 600px) {
|
|
337
|
+
.${e.gridRow} { grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100%; }
|
|
338
|
+
}
|
|
317
339
|
@media (max-width: 480px) {
|
|
318
|
-
.${
|
|
340
|
+
.${e.calendarContainer} {
|
|
319
341
|
padding: var(--ds-size-4, 16px);
|
|
320
342
|
gap: var(--ds-size-2, 8px);
|
|
321
343
|
width: 100%;
|
|
322
344
|
}
|
|
323
|
-
.${
|
|
345
|
+
.${e.monthYear} {
|
|
324
346
|
font-size: var(--ds-heading-xs-font-size, 1.125rem);
|
|
325
347
|
}
|
|
326
|
-
.${
|
|
348
|
+
.${e.dayNameCell} {
|
|
327
349
|
padding: var(--ds-size-1, 4px);
|
|
328
350
|
font-size: var(--ds-font-size-1, 12px);
|
|
329
351
|
}
|
|
330
|
-
.${
|
|
352
|
+
.${e.dateCell} {
|
|
331
353
|
padding: var(--ds-size-2, 8px);
|
|
332
354
|
font-size: var(--ds-font-size-1, 12px);
|
|
333
355
|
}
|
|
334
|
-
.${
|
|
356
|
+
.${e.dateNumberContainer} {
|
|
335
357
|
width: 20px;
|
|
336
358
|
height: 20px;
|
|
337
359
|
}
|
|
338
360
|
}
|
|
339
361
|
@media (max-width: 360px) {
|
|
340
|
-
.${
|
|
362
|
+
.${e.calendarContainer} {
|
|
341
363
|
padding: var(--ds-size-2, 8px);
|
|
342
364
|
}
|
|
343
|
-
.${
|
|
365
|
+
.${e.dayNameCell} {
|
|
344
366
|
padding: 2px;
|
|
345
367
|
font-size: 10px;
|
|
346
368
|
}
|
|
347
|
-
.${
|
|
369
|
+
.${e.dateCell} {
|
|
348
370
|
padding: var(--ds-size-1, 4px);
|
|
349
371
|
font-size: 11px;
|
|
350
372
|
}
|
|
351
|
-
.${
|
|
373
|
+
.${e.dateNumberContainer} {
|
|
352
374
|
width: 16px;
|
|
353
375
|
height: 16px;
|
|
354
376
|
}
|
|
@@ -356,5 +378,5 @@ function fe(t) {
|
|
|
356
378
|
`;
|
|
357
379
|
}
|
|
358
380
|
export {
|
|
359
|
-
|
|
381
|
+
be as DatePicker
|
|
360
382
|
};
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e = "
|
|
2
|
+
const e = "_calendarContainer_ubequ_8", t = "_calendarHeader_ubequ_29", a = "_monthYear_ubequ_36", n = "_navigationButtons_ubequ_47", o = "_gridWrapper_ubequ_56", _ = "_gridRow_ubequ_67", d = "_dayNameCell_ubequ_83", r = "_dateCell_ubequ_101", u = "_dateNumberContainer_ubequ_137", l = "_otherMonth_ubequ_150", s = "_disabled_ubequ_150", c = "_selectedDate_ubequ_179", i = "_todayDate_ubequ_256", b = {
|
|
3
3
|
calendarContainer: e,
|
|
4
|
-
calendarHeader:
|
|
4
|
+
calendarHeader: t,
|
|
5
5
|
monthYear: a,
|
|
6
|
-
navigationButtons:
|
|
6
|
+
navigationButtons: n,
|
|
7
7
|
gridWrapper: o,
|
|
8
|
-
gridRow:
|
|
9
|
-
dayNameCell:
|
|
10
|
-
dateCell:
|
|
11
|
-
dateNumberContainer:
|
|
12
|
-
otherMonth:
|
|
13
|
-
disabled:
|
|
14
|
-
selectedDate:
|
|
8
|
+
gridRow: _,
|
|
9
|
+
dayNameCell: d,
|
|
10
|
+
dateCell: r,
|
|
11
|
+
dateNumberContainer: u,
|
|
12
|
+
otherMonth: l,
|
|
13
|
+
disabled: s,
|
|
14
|
+
selectedDate: c,
|
|
15
|
+
todayDate: i
|
|
15
16
|
};
|
|
16
17
|
export {
|
|
17
18
|
e as calendarContainer,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
t as calendarHeader,
|
|
20
|
+
r as dateCell,
|
|
21
|
+
u as dateNumberContainer,
|
|
22
|
+
d as dayNameCell,
|
|
23
|
+
b as default,
|
|
24
|
+
s as disabled,
|
|
25
|
+
_ as gridRow,
|
|
25
26
|
o as gridWrapper,
|
|
26
27
|
a as monthYear,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
n as navigationButtons,
|
|
29
|
+
l as otherMonth,
|
|
30
|
+
c as selectedDate,
|
|
31
|
+
i as todayDate
|
|
30
32
|
};
|