rk-designsystem 1.3.1 → 1.3.4
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/dist/assets/logos/RedCrossLogo.js +30 -0
- package/dist/components/Carousel/index.js +18 -17
- package/dist/components/Carousel/styles.module.css.js +24 -24
- package/dist/components/DateInput/index.js +34 -34
- package/dist/components/DatePicker/index.js +127 -124
- package/dist/components/DatePicker/styles.module.css.js +22 -20
- package/dist/components/Donor/index.js +36 -25
- package/dist/components/Footer/index.js +180 -185
- package/dist/components/Footer/styles.module.css.js +66 -66
- package/dist/components/GraphicElement/index.js +6 -6
- package/dist/components/Header/index.js +282 -279
- package/dist/components/Header/styles.module.css.js +47 -47
- package/dist/rk-designsystem.css +1 -1
- package/package.json +7 -13
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as r, jsx as C } from "react/jsx-runtime";
|
|
3
|
+
const t = ({ className: l }) => /* @__PURE__ */ r(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
width: "170",
|
|
7
|
+
height: "119",
|
|
8
|
+
viewBox: "24 0 170 119",
|
|
9
|
+
fill: "none",
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
"aria-hidden": !0,
|
|
12
|
+
focusable: "false",
|
|
13
|
+
className: l,
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ C("path", { d: "M76.1036 48.1397C77.8925 47.8781 79.6984 47.7525 81.5061 47.7639C84.1713 47.7639 86.0396 48.1669 87.3182 49.1857C87.8735 49.639 88.3149 50.2176 88.6067 50.8744C88.8984 51.5312 89.0323 52.2479 88.9974 52.9665C88.9839 53.9451 88.6724 54.896 88.1049 55.691C87.5373 56.4861 86.7411 57.087 85.8235 57.4129V57.4944C87.0796 58.006 87.7684 59.2104 88.2231 60.8722C88.7813 62.9097 89.3441 65.2688 89.6907 65.9661H85.5309C85.2382 65.4544 84.7835 63.9829 84.2793 61.7597C83.7751 59.5365 83.0097 58.8527 81.344 58.8527H80.1284V65.9661H76.1036V48.1397ZM80.1284 55.9141H81.7312C83.7526 55.9141 84.9546 54.8954 84.9546 53.3151C84.9546 51.6534 83.8336 50.8202 81.9698 50.7931C81.3532 50.7814 80.7368 50.8268 80.1284 50.9289V55.9141Z", fill: "currentColor" }),
|
|
16
|
+
/* @__PURE__ */ C("path", { d: "M97.8528 52.5633C98.9439 52.5351 100.026 52.7744 101.004 53.2606L102.256 51.4087L103.669 52.4003L102.467 54.2115C103.188 54.8589 103.758 55.6585 104.137 56.5531C104.515 57.4478 104.692 58.4154 104.655 59.3869C104.655 64.0506 101.243 66.2738 97.8573 66.2738C96.7852 66.2984 95.7234 66.059 94.7644 65.5765L93.4543 67.4556L92.1037 66.387L93.2787 64.6438C91.8651 63.4892 91.0277 61.7233 91.0277 59.414C91.0277 55.2891 93.7965 52.5543 97.8213 52.5543L97.8528 52.5633ZM99.2934 55.9411C98.8798 55.6237 98.3731 55.4533 97.8528 55.4566C95.7458 55.4566 94.949 57.5757 94.949 59.4005C94.9265 60.126 95.0909 60.845 95.4262 61.4878L95.4802 61.515L99.2934 55.9411ZM96.4932 62.8552C96.8653 63.1843 97.3486 63.3576 97.8438 63.3397C99.6446 63.3397 100.748 61.7821 100.748 59.4774C100.76 58.7777 100.625 58.0833 100.351 57.4399L100.27 57.4127L96.4932 62.8552Z", fill: "currentColor" }),
|
|
17
|
+
/* @__PURE__ */ C("path", { d: "M119.76 46.9351V62.0537C119.76 63.5253 119.814 65.0829 119.868 65.9659H116.266L116.077 64.037H116.01C115.593 64.7375 114.998 65.3131 114.285 65.7041C113.573 66.095 112.769 66.287 111.958 66.2602C108.865 66.2602 106.384 63.6068 106.384 59.5317C106.384 55.1079 109.085 52.5632 112.237 52.5632C113.835 52.5632 115.087 53.1247 115.676 54.0393H115.726V46.9351H119.76ZM115.708 58.4088C115.708 58.1914 115.681 57.8971 115.658 57.6843C115.556 57.1295 115.266 56.6274 114.838 56.2627C114.41 55.8981 113.869 55.6933 113.308 55.683C111.467 55.683 110.508 57.3447 110.508 59.4094C110.508 61.6327 111.602 63.0318 113.281 63.0318C113.838 63.0337 114.378 62.8389 114.807 62.4814C115.235 62.1239 115.526 61.6264 115.627 61.0757C115.702 60.7676 115.737 60.451 115.73 60.1339L115.708 58.4088Z", fill: "currentColor" }),
|
|
18
|
+
/* @__PURE__ */ C("path", { d: "M126.13 60.6869C126.265 62.3758 127.931 63.1772 129.808 63.1772C131.029 63.1934 132.245 63.013 133.41 62.6429L133.946 65.4049C132.438 65.9752 130.838 66.2562 129.227 66.2335C124.802 66.2335 122.272 63.6345 122.272 59.5322C122.272 56.2088 124.325 52.5366 128.854 52.5366C133.063 52.5366 134.666 55.8329 134.666 59.0794C134.666 59.6271 134.62 60.1738 134.531 60.714L126.13 60.6869ZM130.902 57.8977C130.902 56.9061 130.475 55.2443 128.611 55.2443C126.904 55.2443 126.211 56.8246 126.103 57.8977H130.902Z", fill: "currentColor" }),
|
|
19
|
+
/* @__PURE__ */ C("path", { d: "M142.603 47.8994H146.623V55.8866H146.7C147.1 55.1893 147.501 54.5283 147.929 53.9034L151.981 47.8994H156.978L151.035 55.5969L157.297 65.9703H152.57L148.172 58.1687L146.623 60.0704V65.9567H142.598L142.603 47.8994Z", fill: "currentColor" }),
|
|
20
|
+
/* @__PURE__ */ C("path", { d: "M164.294 66.2599C160.485 66.2599 157.541 63.7424 157.541 59.5043C157.541 55.2662 160.309 52.563 164.496 52.563C168.494 52.563 171.159 55.325 171.159 59.2643C171.159 64.0639 167.774 66.2599 164.307 66.2599H164.294ZM164.375 63.3394C165.946 63.3394 166.959 61.7592 166.959 59.4001C166.959 57.4395 166.216 55.4563 164.375 55.4563C162.43 55.4563 161.709 57.4667 161.709 59.4001C161.709 61.6641 162.641 63.3394 164.348 63.3394H164.375Z", fill: "currentColor" }),
|
|
21
|
+
/* @__PURE__ */ C("path", { d: "M173.676 57.1727C173.676 55.2438 173.622 54.0031 173.568 52.8576H177.062L177.197 55.271H177.3C177.535 54.507 178 53.8353 178.63 53.3486C179.261 52.8619 180.026 52.5843 180.821 52.5542C181.105 52.5425 181.391 52.5607 181.672 52.6086V56.4392C181.303 56.3736 180.93 56.3387 180.555 56.335C179.06 56.335 178.048 57.1365 177.782 58.3997C177.726 58.6983 177.699 59.0015 177.701 59.3053V65.9659H173.649L173.676 57.1727Z", fill: "currentColor" }),
|
|
22
|
+
/* @__PURE__ */ C("path", { d: "M183.752 62.4023C184.824 62.9936 186.018 63.3283 187.241 63.3803C188.47 63.3803 188.974 62.9275 188.974 62.28C188.974 61.6325 188.573 61.2613 187.056 60.7768C184.355 59.8712 183.351 58.3951 183.351 56.8375C183.351 54.3969 185.404 52.5496 188.654 52.5496C189.92 52.5283 191.175 52.7848 192.332 53.3012L191.612 56.1357C190.741 55.6712 189.775 55.4155 188.789 55.3886C187.803 55.3886 187.241 55.787 187.241 56.4571C187.241 57.1273 187.749 57.4216 189.348 57.9604C191.828 58.8162 192.868 60.0795 192.891 62.0084C192.891 64.4444 190.973 66.2691 187.241 66.2691C185.784 66.2951 184.341 65.974 183.031 65.3318L183.752 62.4023Z", fill: "currentColor" }),
|
|
23
|
+
/* @__PURE__ */ C("path", { d: "M50.1985 39.8037H37.1426V79.1965H50.1985V39.8037Z", fill: "#D52B1E" }),
|
|
24
|
+
/* @__PURE__ */ C("path", { d: "M63.2545 52.9331H24.0869V66.0625H63.2545V52.9331Z", fill: "#D52B1E" })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
export {
|
|
29
|
+
t as RedCrossLogo
|
|
30
|
+
};
|
|
@@ -4,7 +4,7 @@ import { useEffect as p, useState as d, useRef as J, useCallback as h, useMemo a
|
|
|
4
4
|
import Y from "embla-carousel-react";
|
|
5
5
|
import a from "./styles.module.css.js";
|
|
6
6
|
import { ChevronLeftIcon as Z, ChevronRightIcon as V, PlayIcon as ee, PauseIcon as te } from "@navikt/aksel-icons";
|
|
7
|
-
import { Button as
|
|
7
|
+
import { Button as P } from "../Button/index.js";
|
|
8
8
|
import { Spinner as re } from "../SpinnerLoader/index.js";
|
|
9
9
|
import { useLanguageOptional as oe } from "../../context/LanguageContext.js";
|
|
10
10
|
const ae = ({
|
|
@@ -13,9 +13,9 @@ const ae = ({
|
|
|
13
13
|
autoDelay: b = 5,
|
|
14
14
|
showArrows: v = !0,
|
|
15
15
|
showDots: x = !0,
|
|
16
|
-
variant:
|
|
17
|
-
slidesPerView:
|
|
18
|
-
slideSpacing:
|
|
16
|
+
variant: B,
|
|
17
|
+
slidesPerView: y = 1,
|
|
18
|
+
slideSpacing: $ = 16,
|
|
19
19
|
cornerRadius: g = 0,
|
|
20
20
|
"data-color": A,
|
|
21
21
|
"data-size": F
|
|
@@ -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.
|
|
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
|
|
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
|
-
}, []),
|
|
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(() => {
|
|
@@ -58,25 +58,25 @@ const ae = ({
|
|
|
58
58
|
};
|
|
59
59
|
}, [t, c]), p(() => {
|
|
60
60
|
t && (t.reInit(), w(t.scrollSnapList()));
|
|
61
|
-
}, [t, e,
|
|
61
|
+
}, [t, e, y, $]);
|
|
62
62
|
const [f, W] = d(!1), [X, S] = d(!1), [q, L] = d(!1), j = l && !f && !X && !q;
|
|
63
63
|
p(() => {
|
|
64
64
|
if (!j || !t || !e || e.length <= 1) return;
|
|
65
65
|
const r = window.setInterval(() => {
|
|
66
66
|
t.canScrollNext() && t.scrollNext();
|
|
67
|
-
},
|
|
67
|
+
}, C);
|
|
68
68
|
return () => {
|
|
69
69
|
window.clearInterval(r);
|
|
70
70
|
};
|
|
71
|
-
}, [j,
|
|
72
|
-
const E = Math.max(1,
|
|
71
|
+
}, [j, C, t, e]);
|
|
72
|
+
const E = Math.max(1, y), G = `${100 / E}%`, m = $ / 2;
|
|
73
73
|
return /* @__PURE__ */ u(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
76
|
className: a.carouselContainer,
|
|
77
77
|
"data-color": A,
|
|
78
78
|
"data-size": F,
|
|
79
|
-
"data-variant":
|
|
79
|
+
"data-variant": B,
|
|
80
80
|
onMouseEnter: l ? () => S(!0) : void 0,
|
|
81
81
|
onMouseLeave: l ? () => S(!1) : void 0,
|
|
82
82
|
onFocus: l ? () => L(!0) : void 0,
|
|
@@ -117,9 +117,9 @@ const ae = ({
|
|
|
117
117
|
alt: r.alt,
|
|
118
118
|
loading: o < E ? "eager" : "lazy",
|
|
119
119
|
crossOrigin: "anonymous",
|
|
120
|
-
onLoad: () =>
|
|
120
|
+
onLoad: () => N(o),
|
|
121
121
|
onError: (i) => {
|
|
122
|
-
i.target.style.display = "none",
|
|
122
|
+
i.target.style.display = "none", N(o);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
)
|
|
@@ -132,7 +132,7 @@ const ae = ({
|
|
|
132
132
|
(v || x && e && e.length > 1) && /* @__PURE__ */ u("div", { className: a.controls, "aria-hidden": "false", children: [
|
|
133
133
|
v && /* @__PURE__ */ u("div", { className: a.arrows, children: [
|
|
134
134
|
/* @__PURE__ */ n(
|
|
135
|
-
|
|
135
|
+
P,
|
|
136
136
|
{
|
|
137
137
|
variant: "primary",
|
|
138
138
|
icon: !0,
|
|
@@ -143,7 +143,7 @@ const ae = ({
|
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
145
|
/* @__PURE__ */ n(
|
|
146
|
-
|
|
146
|
+
P,
|
|
147
147
|
{
|
|
148
148
|
variant: "primary",
|
|
149
149
|
icon: !0,
|
|
@@ -317,7 +317,8 @@ function ie(e) {
|
|
|
317
317
|
border-radius: 999px;
|
|
318
318
|
border: var(--ds-border-width-default, 1px) solid var(--ds-color-border-subtle, #d6d6d6);
|
|
319
319
|
background-color: rgba(255, 255, 255, 0.85);
|
|
320
|
-
|
|
320
|
+
/* Pinned to match the hardcoded pill — see styles.module.css. */
|
|
321
|
+
color: #1e1e1e;
|
|
321
322
|
padding: 0;
|
|
322
323
|
margin: 0;
|
|
323
324
|
cursor: pointer;
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const
|
|
3
|
-
carouselContainer:
|
|
4
|
-
viewport:
|
|
2
|
+
const t = "_carouselContainer_1xdt6_1", o = "_viewport_1xdt6_14", s = "_slides_1xdt6_20", _ = "_slide_1xdt6_20", d = "_slideInner_1xdt6_40", e = "_loaderOverlay_1xdt6_48", n = "_image_1xdt6_58", l = "_loaded_1xdt6_69", a = "_loading_1xdt6_73", r = "_empty_1xdt6_81", c = "_controls_1xdt6_87", i = "_arrows_1xdt6_97", x = "_dots_1xdt6_107", p = "_playPause_1xdt6_122", y = "_dot_1xdt6_107", v = "_dotActive_1xdt6_158", u = {
|
|
3
|
+
carouselContainer: t,
|
|
4
|
+
viewport: o,
|
|
5
5
|
slides: s,
|
|
6
6
|
slide: _,
|
|
7
|
-
slideInner:
|
|
8
|
-
loaderOverlay:
|
|
7
|
+
slideInner: d,
|
|
8
|
+
loaderOverlay: e,
|
|
9
9
|
image: n,
|
|
10
10
|
loaded: l,
|
|
11
11
|
loading: a,
|
|
12
|
-
empty:
|
|
13
|
-
controls:
|
|
14
|
-
arrows:
|
|
15
|
-
dots:
|
|
16
|
-
playPause:
|
|
17
|
-
dot:
|
|
18
|
-
dotActive:
|
|
12
|
+
empty: r,
|
|
13
|
+
controls: c,
|
|
14
|
+
arrows: i,
|
|
15
|
+
dots: x,
|
|
16
|
+
playPause: p,
|
|
17
|
+
dot: y,
|
|
18
|
+
dotActive: v
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
i as arrows,
|
|
22
|
+
t as carouselContainer,
|
|
23
|
+
c as controls,
|
|
24
|
+
u as default,
|
|
25
|
+
y as dot,
|
|
26
|
+
v as dotActive,
|
|
27
|
+
x as dots,
|
|
28
|
+
r as empty,
|
|
29
29
|
n as image,
|
|
30
30
|
l as loaded,
|
|
31
|
-
|
|
31
|
+
e as loaderOverlay,
|
|
32
32
|
a as loading,
|
|
33
|
-
|
|
33
|
+
p as playPause,
|
|
34
34
|
_ as slide,
|
|
35
|
-
|
|
35
|
+
d as slideInner,
|
|
36
36
|
s as slides,
|
|
37
|
-
|
|
37
|
+
o as viewport
|
|
38
38
|
};
|
|
@@ -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
|
|
4
|
+
import { parse as ge, isValid as xe } from "date-fns";
|
|
5
5
|
import a from "./styles.module.css.js";
|
|
6
|
-
import { useLanguageOptional as
|
|
7
|
-
const
|
|
8
|
-
const n = e.slice(0, 2),
|
|
9
|
-
return e.length > 4 ? `${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(
|
|
13
|
-
return
|
|
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:
|
|
16
|
+
const { t: h } = he();
|
|
17
17
|
O(() => {
|
|
18
|
-
const
|
|
19
|
-
if (typeof document > "u" || document.getElementById(
|
|
20
|
-
const
|
|
21
|
-
m.id =
|
|
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":
|
|
50
|
-
...
|
|
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
|
-
(
|
|
58
|
-
|
|
57
|
+
(r, t) => {
|
|
58
|
+
r !== R.current && (R.current = r, $ == null || $(r, t));
|
|
59
59
|
},
|
|
60
60
|
[$]
|
|
61
61
|
), D = k(
|
|
62
|
-
(
|
|
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
|
|
70
|
-
|
|
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
|
-
(
|
|
75
|
-
const
|
|
74
|
+
(r) => {
|
|
75
|
+
const t = r.target, m = p, s = N(t.value), d = x(s);
|
|
76
76
|
let l = 0;
|
|
77
|
-
const v =
|
|
78
|
-
v <= 2 ? l = v : v <= 4 ? l = v + 1 : l = v + 2, l = Math.min(l,
|
|
79
|
-
const fe = q(
|
|
80
|
-
(
|
|
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
|
-
(
|
|
85
|
-
const
|
|
86
|
-
|
|
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(" "),
|
|
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
|
|
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":
|
|
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
|
-
...
|
|
138
|
+
...te
|
|
139
139
|
}
|
|
140
140
|
),
|
|
141
141
|
V && /* @__PURE__ */ g(
|
|
142
142
|
"button",
|
|
143
143
|
{
|
|
144
144
|
type: "button",
|
|
145
|
-
className:
|
|
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 ?
|
|
150
|
+
"aria-label": c ? h("dateInput.openDatePicker") : void 0,
|
|
151
151
|
children: V
|
|
152
152
|
}
|
|
153
153
|
)
|