rk-designsystem 1.3.0 → 1.3.1

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.
Files changed (64) hide show
  1. package/README.md +14 -7
  2. package/dist/assets/images/ChevronLeftIcon.js +31 -0
  3. package/dist/assets/images/ChevronRightIcon.js +31 -0
  4. package/dist/components/Alert/index.js +16 -0
  5. package/dist/components/Avatar/index.js +9 -0
  6. package/dist/components/Badge/index.js +11 -0
  7. package/dist/components/Breadcrumbs/index.js +9 -0
  8. package/dist/components/Button/index.js +11 -0
  9. package/dist/components/Card/index.js +8 -0
  10. package/dist/components/Carousel/index.js +379 -0
  11. package/dist/components/Carousel/styles.module.css.js +38 -0
  12. package/dist/components/Checkbox/index.js +10 -0
  13. package/dist/components/Chip/index.js +6 -0
  14. package/dist/components/DateInput/index.js +258 -0
  15. package/dist/components/DateInput/styles.module.css.js +20 -0
  16. package/dist/components/DatePicker/index.js +357 -0
  17. package/dist/components/DatePicker/styles.module.css.js +30 -0
  18. package/dist/components/Details/index.js +6 -0
  19. package/dist/components/Dialog/index.js +6 -0
  20. package/dist/components/Divider/index.js +6 -0
  21. package/dist/components/Donor/index.js +382 -0
  22. package/dist/components/Donor/styles.module.css.js +42 -0
  23. package/dist/components/Dropdown/index.js +12 -0
  24. package/dist/components/ErrorSummary/index.js +6 -0
  25. package/dist/components/Field/index.js +10 -0
  26. package/dist/components/Fieldset/index.js +6 -0
  27. package/dist/components/Footer/index.js +722 -0
  28. package/dist/components/Footer/styles.module.css.js +138 -0
  29. package/dist/components/GraphicElement/index.js +317 -0
  30. package/dist/components/GraphicElement/styles.module.css.js +16 -0
  31. package/dist/components/Header/index.js +653 -0
  32. package/dist/components/Header/styles.module.css.js +114 -0
  33. package/dist/components/Heading/index.js +9 -0
  34. package/dist/components/Input/index.js +7 -0
  35. package/dist/components/Label/index.js +9 -0
  36. package/dist/components/Link/index.js +6 -0
  37. package/dist/components/List/index.js +6 -0
  38. package/dist/components/Pagination/index.js +11 -0
  39. package/dist/components/Paragraph/index.js +11 -0
  40. package/dist/components/Popover/index.js +6 -0
  41. package/dist/components/Radio/index.js +7 -0
  42. package/dist/components/Search/index.js +10 -0
  43. package/dist/components/Select/index.js +6 -0
  44. package/dist/components/SkeletonLoader/index.js +6 -0
  45. package/dist/components/SkipLink/index.js +6 -0
  46. package/dist/components/SpinnerLoader/index.js +6 -0
  47. package/dist/components/Suggestion/index.js +7 -0
  48. package/dist/components/Switch/index.js +6 -0
  49. package/dist/components/Table/index.js +6 -0
  50. package/dist/components/Tabs/index.js +6 -0
  51. package/dist/components/Tag/index.js +14 -0
  52. package/dist/components/Textarea/index.js +6 -0
  53. package/dist/components/Textfield/index.js +6 -0
  54. package/dist/components/ToggleGroup/index.js +6 -0
  55. package/dist/components/Tooltip/index.js +6 -0
  56. package/dist/components/ValidationMessage/index.js +9 -0
  57. package/dist/context/LanguageContext.js +91 -0
  58. package/dist/index.d.ts +170 -147
  59. package/dist/index.js +118 -0
  60. package/dist/rk-designsystem.css +1 -1
  61. package/dist/{componentlibrary.es.js → translations/index.js} +267 -3904
  62. package/dist/utils/search-index.js +106 -0
  63. package/package.json +18 -26
  64. package/dist/componentlibrary.umd.js +0 -1266
@@ -0,0 +1,258 @@
1
+ "use client";
2
+ import { jsxs as S, jsx as g } from "react/jsx-runtime";
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";
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 : "";
10
+ }, N = (e) => (e || "").replace(/\D/g, "").slice(0, 8), q = (e) => {
11
+ if (e.length < 8) return null;
12
+ const n = ge(h(e), "dd.MM.yyyy", /* @__PURE__ */ new Date());
13
+ return he(n);
14
+ }, ye = be(
15
+ (e, n) => {
16
+ const { t: x } = xe();
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);
22
+ }, []);
23
+ const {
24
+ label: o,
25
+ suffixIcon: V,
26
+ onSuffixClick: c,
27
+ className: A,
28
+ inputWrapperClassName: H,
29
+ inputClassName: G,
30
+ value: y,
31
+ defaultValue: J,
32
+ onChange: I,
33
+ onValidationChange: $,
34
+ readOnly: K,
35
+ placeholder: Q = "dd.mm.åååå",
36
+ id: T,
37
+ name: U,
38
+ required: X,
39
+ disabled: w,
40
+ onClick: Y,
41
+ onFocus: Z,
42
+ onBlur: z,
43
+ autoComplete: _ = "off",
44
+ "aria-label": j,
45
+ "aria-labelledby": W,
46
+ description: C,
47
+ error: u,
48
+ "data-color": ee,
49
+ "data-size": te,
50
+ ...re
51
+ } = e, B = y !== void 0, f = P(null);
52
+ pe.useImperativeHandle(
53
+ n,
54
+ () => f.current
55
+ );
56
+ const R = P(null), i = k(
57
+ (t, r) => {
58
+ t !== R.current && (R.current = t, $ == null || $(t, r));
59
+ },
60
+ [$]
61
+ ), D = k(
62
+ (t) => h(N(t)),
63
+ []
64
+ ), [p, E] = me(
65
+ () => D(y ?? J)
66
+ );
67
+ O(() => {
68
+ if (B) {
69
+ const t = D(y);
70
+ t !== p && (E(t), f.current && f.current.value !== t && (f.current.value = t));
71
+ }
72
+ }, [y, B, p, D]);
73
+ const oe = k(
74
+ (t) => {
75
+ const r = t.target, m = p, d = N(r.value), s = h(d);
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);
81
+ },
82
+ [p, B, I, i]
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);
87
+ },
88
+ [z, i]
89
+ ), ne = [a.fieldset, A].filter(Boolean).join(" "), le = [
90
+ a.inputWrapper,
91
+ H,
92
+ u ? a.inputWrapperError : ""
93
+ ].filter(Boolean).join(" "), ie = [
94
+ G
95
+ ].filter(Boolean).join(" "), de = [
96
+ a.suffixButton,
97
+ c ? a.suffixButtonInteractive : ""
98
+ ].filter(Boolean).join(" ");
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;
101
+ return (
102
+ // --- Bruk data-color og data-size på den ytre wrapperen ---
103
+ /* @__PURE__ */ S(
104
+ "div",
105
+ {
106
+ className: ne,
107
+ "data-color": ee,
108
+ "data-size": te,
109
+ children: [
110
+ o && typeof o == "string" ? /* @__PURE__ */ g("label", { id: F, htmlFor: b, children: o }) : o,
111
+ C && /* @__PURE__ */ g("p", { id: L, className: a.description, children: C }),
112
+ /* @__PURE__ */ S("div", { className: le, children: [
113
+ /* @__PURE__ */ g(
114
+ "input",
115
+ {
116
+ ref: f,
117
+ type: "text",
118
+ inputMode: "numeric",
119
+ pattern: "\\d{2}\\.\\d{2}\\.\\d{4}",
120
+ maxLength: 10,
121
+ value: p,
122
+ readOnly: K,
123
+ placeholder: Q,
124
+ id: b,
125
+ name: U,
126
+ required: X,
127
+ disabled: w,
128
+ onClick: Y,
129
+ onChange: oe,
130
+ onFocus: Z,
131
+ onBlur: ae,
132
+ autoComplete: _,
133
+ "aria-label": j,
134
+ "aria-labelledby": ue,
135
+ "aria-describedby": ce,
136
+ "aria-invalid": !!u,
137
+ className: ie,
138
+ ...re
139
+ }
140
+ ),
141
+ V && /* @__PURE__ */ g(
142
+ "button",
143
+ {
144
+ type: "button",
145
+ className: de,
146
+ onClick: w ? void 0 : c,
147
+ tabIndex: c && !w ? 0 : -1,
148
+ "aria-hidden": !c,
149
+ disabled: w,
150
+ "aria-label": c ? x("dateInput.openDatePicker") : void 0,
151
+ children: V
152
+ }
153
+ )
154
+ ] }),
155
+ u && /* @__PURE__ */ g("p", { id: M, className: a.error, role: "alert", children: u })
156
+ ]
157
+ }
158
+ )
159
+ );
160
+ }
161
+ );
162
+ ye.displayName = "DateInput";
163
+ function Ie(e) {
164
+ return `
165
+ .${e.fieldset} {
166
+ margin-bottom: var(--ds-size-4, 16px);
167
+ }
168
+ .${e.fieldset} label {
169
+ display: block;
170
+ margin-bottom: var(--ds-size-1, 4px);
171
+ font-weight: var(--ds-font-weight-medium, 500);
172
+ color: var(--ds-color-text-default, #2b2b2b);
173
+ }
174
+ .${e.description} {
175
+ font-size: var(--ds-font-size-2, 14px);
176
+ color: var(--ds-color-text-subtle, #5d5d5d);
177
+ margin-top: var(--ds-size-1, 4px);
178
+ margin-bottom: var(--ds-size-2, 8px);
179
+ }
180
+ .${e.error} {
181
+ font-size: var(--ds-font-size-2, 14px);
182
+ color: var(--ds-color-danger-text-default, #c30000);
183
+ margin-top: var(--ds-size-1, 4px);
184
+ }
185
+ .${e.inputWrapper} {
186
+ display: flex;
187
+ align-items: stretch;
188
+ width: 100%;
189
+ position: relative;
190
+ border: var(--ds-border-width-default, 1px) solid var(--ds-color-border-default, #797979);
191
+ border-radius: var(--ds-border-radius-md, 4px);
192
+ overflow: hidden;
193
+ transition: border-color 0.1s ease-out, outline 0.1s ease-out;
194
+ }
195
+ .${e.inputWrapperError} {
196
+ border-color: var(--ds-color-danger-border-default, #c30000);
197
+ }
198
+ .${e.inputWrapper}:focus-within {
199
+ outline: var(--ds-border-width-focus, 3px) solid var(--ds-color-focus-outer, #2B2B2B);
200
+ outline-offset: var(--ds-border-width-focus, 2px);
201
+ }
202
+ .${e.inputWrapper} input {
203
+ box-sizing: border-box;
204
+ flex-grow: 1;
205
+ width: auto;
206
+ min-width: 0;
207
+ background-color: var(--ds-color-background-default, #fff);
208
+ color: var(--ds-color-text-default, #2b2b2b);
209
+ border: none;
210
+ border-radius: 0;
211
+ outline: none;
212
+ padding: var(--ds-size-2, 8px) var(--ds-size-3, 12px);
213
+ font-family: inherit;
214
+ font-size: inherit;
215
+ appearance: none;
216
+ -webkit-appearance: none;
217
+ }
218
+ .${e.inputWrapper} input:disabled {
219
+ opacity: var(--ds-opacity-disabled, 0.5);
220
+ cursor: not-allowed;
221
+ background-color: var(--ds-color-neutral-surface-tinted, #f0f0f0);
222
+ color: var(--ds-color-neutral-text-subtle, #5d5d5d);
223
+ }
224
+ .${e.suffixButton} {
225
+ display: inline-flex;
226
+ align-items: center;
227
+ justify-content: center;
228
+ flex-shrink: 0;
229
+ padding: 0 var(--ds-size-3, 12px);
230
+ margin: 0;
231
+ border: none;
232
+ border-radius: 0;
233
+ border-left: var(--ds-border-width-default, 1px) solid var(--ds-color-border-default, #797979);
234
+ background-color: var(--ds-color-surface-tinted, #e8e8e8);
235
+ color: var(--ds-color-text-subtle, #5d5d5d);
236
+ font-size: 1.25rem;
237
+ box-sizing: border-box;
238
+ cursor: default;
239
+ transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
240
+ }
241
+ .${e.suffixButtonInteractive} {
242
+ cursor: pointer;
243
+ }
244
+ .${e.suffixButtonInteractive}:hover:not(:disabled) {
245
+ color: var(--ds-color-text-default, #2b2b2b);
246
+ background-color: var(--ds-color-surface-hover, #dadada);
247
+ }
248
+ .${e.suffixButton}:disabled {
249
+ opacity: var(--ds-opacity-disabled, 0.3);
250
+ cursor: not-allowed;
251
+ background-color: var(--ds-color-neutral-surface-tinted, #e8e8e8);
252
+ border-left-color: var(--ds-color-neutral-border-default, #797979);
253
+ }
254
+ `;
255
+ }
256
+ export {
257
+ ye as DateInput
258
+ };
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ const t = "_fieldset_1d1ez_2", r = "_description_1d1ez_14", e = "_error_1d1ez_21", n = "_inputWrapper_1d1ez_30", i = "_inputWrapperError_1d1ez_42", o = "_suffixButton_1d1ez_80", s = "_suffixButtonInteractive_1d1ez_100", p = {
3
+ fieldset: t,
4
+ description: r,
5
+ error: e,
6
+ inputWrapper: n,
7
+ inputWrapperError: i,
8
+ suffixButton: o,
9
+ suffixButtonInteractive: s
10
+ };
11
+ export {
12
+ p as default,
13
+ r as description,
14
+ e as error,
15
+ t as fieldset,
16
+ n as inputWrapper,
17
+ i as inputWrapperError,
18
+ o as suffixButton,
19
+ s as suffixButtonInteractive
20
+ };
@@ -0,0 +1,357 @@
1
+ "use client";
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";
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";
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(),
19
+ selectedDate: o = null,
20
+ onDateSelect: s,
21
+ "data-color": z,
22
+ "data-size": L
23
+ }) => {
24
+ const { t: E } = de();
25
+ N(() => {
26
+ const t = "rk-datepicker-inline-styles";
27
+ if (typeof document > "u" || document.getElementById(t)) return;
28
+ const e = fe(n), a = document.createElement("style");
29
+ a.id = t, a.textContent = e, document.head.appendChild(a);
30
+ }, []);
31
+ const [l, x] = B(
32
+ u(o && w(o) ? o : r)
33
+ ), [p, m] = B(
34
+ () => o && w(o) ? o : r
35
+ ), P = R(null), $ = R(!1);
36
+ N(() => {
37
+ if (o && w(o)) {
38
+ m(o);
39
+ const t = u(o);
40
+ x(
41
+ (e) => C(t, e) ? e : t
42
+ );
43
+ }
44
+ }, [o]), N(() => {
45
+ var e;
46
+ if (!$.current) return;
47
+ $.current = !1;
48
+ const t = (e = P.current) == null ? void 0 : e.querySelector(
49
+ `[data-date="${f(p, "yyyy-MM-dd")}"]`
50
+ );
51
+ t == null || t.focus();
52
+ }, [p, l]);
53
+ const M = D(
54
+ () => le(l),
55
+ [l]
56
+ ), Y = D(() => {
57
+ const t = [];
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 });
63
+ return Array.from({ length: 7 }).map((e, a) => {
64
+ const b = f(h(t, a), "EEEEEE", { locale: c });
65
+ return H(b);
66
+ });
67
+ }, []), K = g(() => {
68
+ x((t) => {
69
+ const e = u(S(t, 1));
70
+ return m((a) => v(a, e)), e;
71
+ });
72
+ }, []), T = g(() => {
73
+ x((t) => {
74
+ const e = u(W(t, 1));
75
+ return m((a) => v(a, e)), e;
76
+ });
77
+ }, []), k = g(
78
+ (t) => {
79
+ m(t), s == null || s(t);
80
+ },
81
+ [s]
82
+ ), d = g((t) => {
83
+ $.current = !0, m(t), x(
84
+ (e) => C(t, e) ? e : u(t)
85
+ );
86
+ }, []), q = g(
87
+ (t, e) => {
88
+ switch (t.key) {
89
+ case "Enter":
90
+ case " ":
91
+ t.preventDefault(), k(e);
92
+ return;
93
+ case "ArrowLeft":
94
+ t.preventDefault(), d(h(e, -1));
95
+ return;
96
+ case "ArrowRight":
97
+ t.preventDefault(), d(h(e, 1));
98
+ return;
99
+ case "ArrowUp":
100
+ t.preventDefault(), d(h(e, -7));
101
+ return;
102
+ case "ArrowDown":
103
+ t.preventDefault(), d(h(e, 7));
104
+ return;
105
+ case "Home":
106
+ t.preventDefault(), d(I(e, { locale: c }));
107
+ return;
108
+ case "End":
109
+ t.preventDefault(), d(te(e, { locale: c }));
110
+ return;
111
+ case "PageUp":
112
+ t.preventDefault(), d(v(e, S(e, 1)));
113
+ return;
114
+ case "PageDown":
115
+ t.preventDefault(), d(v(e, W(e, 1)));
116
+ return;
117
+ }
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);
121
+ return /* @__PURE__ */ y(
122
+ "div",
123
+ {
124
+ className: n.calendarContainer,
125
+ "data-color": z,
126
+ "data-size": L,
127
+ children: [
128
+ /* @__PURE__ */ y("div", { className: n.calendarHeader, children: [
129
+ /* @__PURE__ */ i("span", { className: n.monthYear, id: O, "aria-live": "polite", children: G }),
130
+ /* @__PURE__ */ y("div", { className: n.navigationButtons, children: [
131
+ /* @__PURE__ */ i(
132
+ A,
133
+ {
134
+ variant: "tertiary",
135
+ icon: !0,
136
+ onClick: K,
137
+ "aria-label": E("datePicker.previousMonth"),
138
+ children: /* @__PURE__ */ i(ie, {})
139
+ }
140
+ ),
141
+ /* @__PURE__ */ i(
142
+ A,
143
+ {
144
+ variant: "tertiary",
145
+ icon: !0,
146
+ onClick: T,
147
+ "aria-label": E("datePicker.nextMonth"),
148
+ children: /* @__PURE__ */ i(se, {})
149
+ }
150
+ )
151
+ ] })
152
+ ] }),
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 = [
157
+ n.dateCell,
158
+ a ? "" : n.otherMonth,
159
+ b ? n.selectedDate : "",
160
+ j && !b ? n.todayDate : ""
161
+ ].filter(Boolean).join(" ");
162
+ return /* @__PURE__ */ i(
163
+ "div",
164
+ {
165
+ role: "gridcell",
166
+ className: X,
167
+ "data-date": f(e, "yyyy-MM-dd"),
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,
172
+ "aria-disabled": !a || void 0,
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") })
176
+ },
177
+ e.toISOString()
178
+ );
179
+ }) }, t[0].toISOString()))
180
+ ] })
181
+ ]
182
+ }
183
+ );
184
+ };
185
+ ce.displayName = "DatePicker";
186
+ function fe(r) {
187
+ return `
188
+ .${r.calendarContainer} {
189
+ display: inline-flex;
190
+ padding: var(--ds-size-8, 32px);
191
+ flex-direction: column;
192
+ align-items: flex-start;
193
+ gap: var(--ds-size-3, 12px);
194
+ border: 1px solid var(--ds-color-border-subtle, #ccc);
195
+ border-radius: var(--ds-border-radius-md, 4px);
196
+ background-color: var(--ds-color-background-default, #fff);
197
+ font-family: var(--ds-font-family, sans-serif);
198
+ color: var(--ds-color-text-default, #2b2b2b);
199
+ max-width: 100%;
200
+ box-sizing: border-box;
201
+ }
202
+ .${r.calendarHeader} {
203
+ display: flex;
204
+ justify-content: space-between;
205
+ align-items: center;
206
+ align-self: stretch;
207
+ }
208
+ .${r.monthYear} {
209
+ color: var(--ds-color-text-default, #2b2b2b);
210
+ font-family: var(--ds-font-family, sans-serif);
211
+ font-size: var(--ds-heading-sm-font-size, 1.5rem);
212
+ font-weight: var(--ds-heading-sm-font-weight, 500);
213
+ line-height: var(--ds-heading-sm-line-height, 1.3);
214
+ margin: 0;
215
+ }
216
+ .${r.navigationButtons} {
217
+ display: flex;
218
+ gap: var(--ds-size-1, 4px);
219
+ }
220
+ .${r.navigationButtons} > button:disabled svg {
221
+ opacity: var(--ds-opacity-disabled, 0.3);
222
+ }
223
+ .${r.gridWrapper} {
224
+ width: 100%;
225
+ overflow: hidden;
226
+ }
227
+ .${r.gridRow} {
228
+ display: grid;
229
+ grid-template-columns: repeat(7, 1fr);
230
+ width: 100%;
231
+ text-align: center;
232
+ }
233
+ .${r.dayNameCell} {
234
+ display: flex;
235
+ padding: var(--ds-size-2, 8px);
236
+ flex-direction: column;
237
+ justify-content: center;
238
+ align-items: center;
239
+ color: var(--ds-color-text-default, #2b2b2b);
240
+ text-align: center;
241
+ font-family: var(--ds-font-family, sans-serif);
242
+ font-size: var(--ds-body-xs-font-size, 14px);
243
+ font-weight: var(--ds-font-weight-semibold, 600);
244
+ line-height: var(--ds-body-short-xs-line-height, 1.3);
245
+ box-sizing: border-box;
246
+ min-width: 0;
247
+ }
248
+ .${r.dateCell} {
249
+ display: flex;
250
+ padding: var(--ds-size-5, 22px);
251
+ flex-direction: column;
252
+ justify-content: center;
253
+ align-items: center;
254
+ border: var(--ds-border-width-default, 1px) solid var(--ds-color-border-subtle, #bcbcbc);
255
+ box-sizing: border-box;
256
+ margin: -0.5px;
257
+ font-family: var(--ds-font-family, sans-serif);
258
+ color: var(--ds-color-text-default, #2b2b2b);
259
+ text-align: center;
260
+ font-size: var(--ds-body-xs-font-size, 14px);
261
+ font-weight: var(--ds-body-xs-font-weight, 400);
262
+ line-height: var(--ds-body-short-xs-line-height, 1.3);
263
+ cursor: pointer;
264
+ transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
265
+ user-select: none;
266
+ min-width: 0;
267
+ }
268
+ .${r.dateCell}:focus-visible {
269
+ outline: var(--ds-border-width-focus, 3px) solid var(--ds-color-focus-outer, #2b2b2b);
270
+ outline-offset: calc(-1 * var(--ds-border-width-focus, 3px));
271
+ position: relative;
272
+ z-index: 2;
273
+ }
274
+ .${r.dateNumberContainer} {
275
+ display: flex;
276
+ justify-content: center;
277
+ align-items: center;
278
+ width: 24px;
279
+ height: 24px;
280
+ border-radius: 50%;
281
+ transition: color 0.15s ease-in-out, font-weight 0.15s ease-in-out;
282
+ line-height: 1;
283
+ box-sizing: border-box;
284
+ background-color: transparent;
285
+ }
286
+ .${r.dateCell}:hover:not(.${r.otherMonth}):not(.${r.disabled}) {
287
+ background-color: var(--ds-color-surface-hover, #eee);
288
+ position: relative;
289
+ z-index: 1;
290
+ }
291
+ .${r.otherMonth} {
292
+ color: var(--ds-color-text-subtle, #aaa);
293
+ cursor: default;
294
+ 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);
297
+ margin: -0.5px;
298
+ }
299
+ .${r.selectedDate} {
300
+ background-color: var(--ds-color-base-default, #C30000);
301
+ border-color: var(--ds-color-base-default, #C30000);
302
+ color: var(--ds-color-base-contrast-default, #fff);
303
+ position: relative;
304
+ z-index: 1;
305
+ }
306
+ .${r.selectedDate} .${r.dateNumberContainer} {
307
+ color: var(--ds-color-base-contrast-default, #fff);
308
+ font-weight: var(--ds-font-weight-semibold, 600);
309
+ background-color: transparent;
310
+ }
311
+ .${r.todayDate} .${r.dateNumberContainer} {
312
+ font-weight: var(--ds-font-weight-semibold, 600);
313
+ }
314
+ @media (max-width: 480px) {
315
+ .${r.calendarContainer} {
316
+ padding: var(--ds-size-4, 16px);
317
+ gap: var(--ds-size-2, 8px);
318
+ width: 100%;
319
+ }
320
+ .${r.monthYear} {
321
+ font-size: var(--ds-heading-xs-font-size, 1.125rem);
322
+ }
323
+ .${r.dayNameCell} {
324
+ padding: var(--ds-size-1, 4px);
325
+ font-size: var(--ds-font-size-1, 12px);
326
+ }
327
+ .${r.dateCell} {
328
+ padding: var(--ds-size-2, 8px);
329
+ font-size: var(--ds-font-size-1, 12px);
330
+ }
331
+ .${r.dateNumberContainer} {
332
+ width: 20px;
333
+ height: 20px;
334
+ }
335
+ }
336
+ @media (max-width: 360px) {
337
+ .${r.calendarContainer} {
338
+ padding: var(--ds-size-2, 8px);
339
+ }
340
+ .${r.dayNameCell} {
341
+ padding: 2px;
342
+ font-size: 10px;
343
+ }
344
+ .${r.dateCell} {
345
+ padding: var(--ds-size-1, 4px);
346
+ font-size: 11px;
347
+ }
348
+ .${r.dateNumberContainer} {
349
+ width: 16px;
350
+ height: 16px;
351
+ }
352
+ }
353
+ `;
354
+ }
355
+ export {
356
+ ce as DatePicker
357
+ };
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ const e = "_calendarContainer_1ukqo_1", a = "_calendarHeader_1ukqo_16", t = "_monthYear_1ukqo_23", o = "_navigationButtons_1ukqo_34", n = "_gridWrapper_1ukqo_43", r = "_gridRow_1ukqo_48", _ = "_dayNameCell_1ukqo_55", d = "_dateCell_1ukqo_73", l = "_dateNumberContainer_1ukqo_106", s = "_otherMonth_1ukqo_119", c = "_disabled_1ukqo_119", i = "_selectedDate_1ukqo_145", u = {
3
+ calendarContainer: e,
4
+ calendarHeader: a,
5
+ monthYear: t,
6
+ navigationButtons: o,
7
+ gridWrapper: n,
8
+ gridRow: r,
9
+ dayNameCell: _,
10
+ dateCell: d,
11
+ dateNumberContainer: l,
12
+ otherMonth: s,
13
+ disabled: c,
14
+ selectedDate: i
15
+ };
16
+ export {
17
+ e as calendarContainer,
18
+ a as calendarHeader,
19
+ d as dateCell,
20
+ l as dateNumberContainer,
21
+ _ as dayNameCell,
22
+ u as default,
23
+ c as disabled,
24
+ r as gridRow,
25
+ n as gridWrapper,
26
+ t as monthYear,
27
+ o as navigationButtons,
28
+ s as otherMonth,
29
+ i as selectedDate
30
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { Details as t } from "@digdir/designsystemet-react";
3
+ const s = t;
4
+ export {
5
+ s as Details
6
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { Dialog as o } from "@digdir/designsystemet-react";
3
+ const a = o;
4
+ export {
5
+ a as Dialog
6
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { Divider as i } from "@digdir/designsystemet-react";
3
+ const r = i;
4
+ export {
5
+ r as Divider
6
+ };