@rikstv/shared-components 3.2.1-2 → 3.2.1-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/components/accordion/Accordion-rewqLwCV.mjs +34 -0
- package/dist/components/alert/Alert-pjg9sCaq.mjs +68 -0
- package/dist/components/breadcrumb/Breadcrumb-BJNLZ7iB.mjs +21 -0
- package/dist/components/button/{ArrowButton-DMr9aNBX.mjs → ArrowButton-DqViaPQ-.mjs} +11 -11
- package/dist/components/button/BaseButton-Bhxc5Zyj.mjs +46 -0
- package/dist/components/button/BaseDecoratedButton-5on1OJrJ.mjs +15 -0
- package/dist/components/button/{BaseLinkButton-BsJ_29CO.mjs → BaseLinkButton-niQ474XP.mjs} +13 -13
- package/dist/components/button/Button-DGXKZhwG.mjs +19 -0
- package/dist/components/button/DecoratedButton-D1hX-3Iw.mjs +26 -0
- package/dist/components/button/IconButton-DVEZ8K3d.mjs +18 -0
- package/dist/components/checkbox/BaseCheckbox-BGkrjof6.mjs +41 -0
- package/dist/components/checkbox/Checkbox-Cl4PCYXu.mjs +22 -0
- package/dist/components/core/{Core-GV7d4sn7.mjs → Core-DVnHiJm2.mjs} +10 -10
- package/dist/components/core/LightMode-DPAa0Pv9.mjs +9 -0
- package/dist/components/core/RiksTV-CxHetJcp.mjs +6 -0
- package/dist/components/core/Strim-C1ajVDCm.mjs +6 -0
- package/dist/components/dropdown/Dropdown-CWVW7rKD.mjs +44 -0
- package/dist/components/icons/{Arrow-DpNA_SD7.mjs → Arrow-DlptGprM.mjs} +2 -2
- package/dist/components/icons/{Chevron-D7z5f5Ni.mjs → Chevron-BBlkokQX.mjs} +2 -2
- package/dist/components/icons/{HeartToggle-Buv7f9yB.mjs → HeartToggle-Bwgo4FxH.mjs} +3 -3
- package/dist/components/icons/{Icons-D0X7KrxA.mjs → Icons-CVv5JxOX.mjs} +3 -3
- package/dist/components/list/CheckmarkListItem-D86vlUxv.mjs +9 -0
- package/dist/components/list/CrossmarkListItem-CXIrUTPd.mjs +9 -0
- package/dist/components/list/{List-DbnDS6C4.mjs → List-4jHnUXn_.mjs} +3 -3
- package/dist/components/list/ListItem-ClQsSisn.mjs +34 -0
- package/dist/components/list/OrderedListItem-CphW2Aa0.mjs +5 -0
- package/dist/components/loader/Loader-gjL6yh1f.mjs +21 -0
- package/dist/components/loader/RawLoader-BpIpTIRJ.mjs +47 -0
- package/dist/components/notificationDot/{NotificationDot-pljIxRxJ.mjs → NotificationDot-C2_j4FdL.mjs} +6 -6
- package/dist/components/panel/Panel-CPz2fLQW.mjs +59 -0
- package/dist/components/progress/CircularProgress-CD_dLu6N.mjs +50 -0
- package/dist/components/progress/Progress-CjnegHvC.mjs +26 -0
- package/dist/components/spacing/Gutter-PXX_UdiX.mjs +5 -0
- package/dist/components/spacing/GutterPadding-Bd7tSm3F.mjs +5 -0
- package/dist/components/textfield/PasswordTextField-BfvT8zYj.mjs +22 -0
- package/dist/components/textfield/TextField-Ct-ceRzE.mjs +76 -0
- package/dist/components/toggle/FieldSet-BM_JN_UL.mjs +13 -0
- package/dist/components/toggle/RadioToggle-C_79eEFl.mjs +17 -0
- package/dist/components/toggleButton/ToggleButton-CGLyQll6.mjs +47 -0
- package/dist/components/toggleInlineButton/ToggleInlineButton-Cnet1doK.mjs +40 -0
- package/dist/components/toggleLinkButton/ToggleLinkButton-W1wyWc93.mjs +37 -0
- package/dist/components/typography/{Typography-BDz_QfCz.mjs → Typography-CXNJ1SFo.mjs} +18 -18
- package/dist/shared-components.mjs +33 -33
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/components/accordion/Accordion-C-Lu1AN3.mjs +0 -311
- package/dist/components/alert/Alert-D1ytM5Dq.mjs +0 -68
- package/dist/components/breadcrumb/Breadcrumb-Dpi45ZU-.mjs +0 -21
- package/dist/components/button/BaseButton-BDwLDH8l.mjs +0 -46
- package/dist/components/button/BaseDecoratedButton-ChPN1ek7.mjs +0 -15
- package/dist/components/button/Button-ChxzP0BI.mjs +0 -19
- package/dist/components/button/DecoratedButton-BPD31Ccf.mjs +0 -26
- package/dist/components/button/IconButton-DYRG4f36.mjs +0 -18
- package/dist/components/checkbox/BaseCheckbox-Ds7EbRAQ.mjs +0 -41
- package/dist/components/checkbox/Checkbox-DqG1H_l_.mjs +0 -22
- package/dist/components/core/LightMode-QGX5KWDc.mjs +0 -9
- package/dist/components/core/RiksTV-CLsPQKYj.mjs +0 -6
- package/dist/components/core/Strim-D7gNGKkV.mjs +0 -6
- package/dist/components/dropdown/Dropdown-U7w2rrui.mjs +0 -44
- package/dist/components/list/CheckmarkListItem-DDP1qoW4.mjs +0 -9
- package/dist/components/list/CrossmarkListItem-CbzfzRC4.mjs +0 -9
- package/dist/components/list/ListItem-CQZq9GfN.mjs +0 -34
- package/dist/components/list/OrderedListItem-CjcJ5-Li.mjs +0 -5
- package/dist/components/loader/Loader-D_bteiXh.mjs +0 -21
- package/dist/components/loader/RawLoader-5VXTs9nJ.mjs +0 -47
- package/dist/components/panel/Panel-CrtDgKD_.mjs +0 -59
- package/dist/components/progress/CircularProgress-CopS-z4L.mjs +0 -50
- package/dist/components/progress/Progress-_FQvkoIg.mjs +0 -26
- package/dist/components/spacing/Gutter-BG0NTrtn.mjs +0 -5
- package/dist/components/spacing/GutterPadding-n99wy2ws.mjs +0 -5
- package/dist/components/textfield/PasswordTextField-OBI71D--.mjs +0 -22
- package/dist/components/textfield/TextField-BCS5Ve2N.mjs +0 -76
- package/dist/components/toggle/FieldSet-DOEdpTZk.mjs +0 -13
- package/dist/components/toggle/RadioToggle-EoTh0Vv6.mjs +0 -17
- package/dist/components/toggleButton/ToggleButton-BYIO805O.mjs +0 -47
- package/dist/components/toggleInlineButton/ToggleInlineButton-BgOpE9Ya.mjs +0 -40
- package/dist/components/toggleLinkButton/ToggleLinkButton-DuHYN8Qo.mjs +0 -37
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { j as s } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import "react";
|
|
3
|
-
import "../icons/HeartToggle-Buv7f9yB.mjs";
|
|
4
|
-
import { S as o } from "../icons/Icons-D0X7KrxA.mjs";
|
|
5
|
-
import { L as m } from "./ListItem-CQZq9GfN.mjs";
|
|
6
|
-
const j = ({ children: t, ...r }) => /* @__PURE__ */ s.jsx(m, { testId: "rds-list-item--cross", icon: /* @__PURE__ */ s.jsx(o, {}), ...r, children: t });
|
|
7
|
-
export {
|
|
8
|
-
j as C
|
|
9
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { j as r } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
const n = (s) => {
|
|
3
|
-
switch (s) {
|
|
4
|
-
case "error":
|
|
5
|
-
return { "--mark-color": "var(--rds-feedback-error-dark)" };
|
|
6
|
-
case "success":
|
|
7
|
-
return { "--mark-color": "var(--rds-feedback-success)" };
|
|
8
|
-
case "faded":
|
|
9
|
-
return { "--mark-color": "var(--rds-foreground-secondary)" };
|
|
10
|
-
default:
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
}, u = ({
|
|
14
|
-
className: s = "",
|
|
15
|
-
children: e,
|
|
16
|
-
innerClassName: a = "",
|
|
17
|
-
icon: c,
|
|
18
|
-
testId: t = "rds-list-item",
|
|
19
|
-
style: o,
|
|
20
|
-
color: l,
|
|
21
|
-
...d
|
|
22
|
-
}) => {
|
|
23
|
-
const i = {
|
|
24
|
-
...o,
|
|
25
|
-
...n(l)
|
|
26
|
-
};
|
|
27
|
-
return /* @__PURE__ */ r.jsxs("li", { className: `rds-list__item ${s}`, "data-testid": t, style: i, ...d, children: [
|
|
28
|
-
/* @__PURE__ */ r.jsx("span", { className: "rds-list__item--svg-wrapper", children: c || /* @__PURE__ */ r.jsx("svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ r.jsx("circle", { cx: "12", cy: "12", r: "5", fill: "currentColor" }) }) }),
|
|
29
|
-
/* @__PURE__ */ r.jsx("span", { className: `${a}`, children: e })
|
|
30
|
-
] });
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
u as L
|
|
34
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { j as s } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
const a = ({ className: e = "", innerClassName: r = "", children: t, ...d }) => /* @__PURE__ */ s.jsx("li", { className: `rds-list__item__ordered ${e}`, "data-testid": "rds-ordered-list-item", ...d, children: /* @__PURE__ */ s.jsx("span", { className: `${r}`, children: t }) });
|
|
3
|
-
export {
|
|
4
|
-
a as O
|
|
5
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { j as n } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import { forwardRef as m, useState as u, useEffect as f } from "react";
|
|
3
|
-
import { R as s } from "./RawLoader-5VXTs9nJ.mjs";
|
|
4
|
-
const a = (r) => {
|
|
5
|
-
const [e, t] = u(r === 0);
|
|
6
|
-
return f(() => {
|
|
7
|
-
if (r === 0)
|
|
8
|
-
return;
|
|
9
|
-
const o = setTimeout(() => t(!0), r);
|
|
10
|
-
return () => {
|
|
11
|
-
clearTimeout(o);
|
|
12
|
-
};
|
|
13
|
-
}, [r]), [e];
|
|
14
|
-
}, p = m(({ delay: r = 200, ...e }, t) => {
|
|
15
|
-
const [o] = a(r);
|
|
16
|
-
return o ? /* @__PURE__ */ n.jsx(s, { ref: t, ...e }) : null;
|
|
17
|
-
});
|
|
18
|
-
p.displayName = "Loader";
|
|
19
|
-
export {
|
|
20
|
-
p as L
|
|
21
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { j as s } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import { forwardRef as d } from "react";
|
|
3
|
-
const o = d(
|
|
4
|
-
({ size: r = "small", className: n = "", lightBackground: e, label: a = "Laster", politeness: p = "polite", ...i }, t) => /* @__PURE__ */ s.jsx(
|
|
5
|
-
"div",
|
|
6
|
-
{
|
|
7
|
-
ref: t,
|
|
8
|
-
"aria-label": a,
|
|
9
|
-
"aria-busy": "true",
|
|
10
|
-
"aria-live": p,
|
|
11
|
-
role: "alert",
|
|
12
|
-
title: a,
|
|
13
|
-
className: `rds-loader-container ${e ? "rds-loader-container--light" : ""} ${n}`,
|
|
14
|
-
"data-testid": "rds-loader",
|
|
15
|
-
...i,
|
|
16
|
-
children: /* @__PURE__ */ s.jsxs(
|
|
17
|
-
"div",
|
|
18
|
-
{
|
|
19
|
-
"data-testid": "rds-spinner",
|
|
20
|
-
className: `rds-loader-container__spinner rds-loader-container__spinner__${r}`,
|
|
21
|
-
children: [
|
|
22
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
23
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
24
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
25
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
26
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
27
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
28
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
29
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
30
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
31
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
32
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
33
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
34
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
35
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
36
|
-
/* @__PURE__ */ s.jsx("span", {}),
|
|
37
|
-
/* @__PURE__ */ s.jsx("span", {})
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
);
|
|
44
|
-
o.displayName = "RawLoader";
|
|
45
|
-
export {
|
|
46
|
-
o as R
|
|
47
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { j as t } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import { forwardRef as j } from "react";
|
|
3
|
-
import { S as x } from "../typography/Typography-BDz_QfCz.mjs";
|
|
4
|
-
import "../icons/HeartToggle-Buv7f9yB.mjs";
|
|
5
|
-
import { b as c, c as u, a as v } from "../icons/Icons-D0X7KrxA.mjs";
|
|
6
|
-
const N = "_rds-panel_297es_1", b = "_content-and-buttons_297es_34", P = "_content_297es_34", y = "_title_297es_60", A = "_icon_297es_68", S = "_buttons_297es_75", n = {
|
|
7
|
-
rdsPanel: N,
|
|
8
|
-
contentAndButtons: b,
|
|
9
|
-
content: P,
|
|
10
|
-
title: y,
|
|
11
|
-
icon: A,
|
|
12
|
-
buttons: S
|
|
13
|
-
}, k = {
|
|
14
|
-
error: {
|
|
15
|
-
title: "Feil",
|
|
16
|
-
icon: /* @__PURE__ */ t.jsx(c, {})
|
|
17
|
-
},
|
|
18
|
-
info: {
|
|
19
|
-
title: "Informasjon",
|
|
20
|
-
icon: /* @__PURE__ */ t.jsx(c, {})
|
|
21
|
-
},
|
|
22
|
-
success: {
|
|
23
|
-
title: "Vellykket",
|
|
24
|
-
icon: /* @__PURE__ */ t.jsx(u, {})
|
|
25
|
-
},
|
|
26
|
-
warning: {
|
|
27
|
-
title: "Advarsel",
|
|
28
|
-
icon: /* @__PURE__ */ t.jsx(v, {})
|
|
29
|
-
}
|
|
30
|
-
}, B = j(
|
|
31
|
-
({ className: l = "", intent: e = "info", heading: s, action: o, id: r, children: i, ...a }, m) => {
|
|
32
|
-
const { title: _, icon: p } = k[e], d = typeof s == "string" ? s : (s == null ? void 0 : s.title) ?? _, f = typeof s == "string" ? "span" : (s == null ? void 0 : s.level) ?? "span";
|
|
33
|
-
return /* @__PURE__ */ t.jsxs(
|
|
34
|
-
"div",
|
|
35
|
-
{
|
|
36
|
-
id: r,
|
|
37
|
-
className: `${n.rdsPanel} ${l}`,
|
|
38
|
-
"data-testid": "rds-panel",
|
|
39
|
-
"data-intent": e,
|
|
40
|
-
ref: m,
|
|
41
|
-
...a,
|
|
42
|
-
children: [
|
|
43
|
-
/* @__PURE__ */ t.jsx("span", { className: n.icon, children: p }),
|
|
44
|
-
/* @__PURE__ */ t.jsxs("div", { className: n.contentAndButtons, children: [
|
|
45
|
-
/* @__PURE__ */ t.jsxs("div", { className: n.content, children: [
|
|
46
|
-
/* @__PURE__ */ t.jsx(f, { className: `${n.title} rds-title-4`, children: d }),
|
|
47
|
-
/* @__PURE__ */ t.jsx(x, { children: i })
|
|
48
|
-
] }),
|
|
49
|
-
o && /* @__PURE__ */ t.jsx("div", { className: n.buttons, children: o })
|
|
50
|
-
] })
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
B.displayName = "Panel";
|
|
57
|
-
export {
|
|
58
|
-
B as P
|
|
59
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { j as s } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import { forwardRef as x, useState as e, useEffect as g } from "react";
|
|
3
|
-
import { S as u } from "../typography/Typography-BDz_QfCz.mjs";
|
|
4
|
-
const m = ({ progressRatio: r }) => (1 - r) * 100 * Math.PI, j = x(
|
|
5
|
-
({ progressRatio: r, label: t, size: a = "small", className: l = "", children: c, ...d }, o) => {
|
|
6
|
-
const [i, n] = e(0), [p] = e(a === "small" ? "160px" : "260px");
|
|
7
|
-
return g(() => {
|
|
8
|
-
n(m({ progressRatio: r }));
|
|
9
|
-
}, [r]), /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
10
|
-
/* @__PURE__ */ s.jsxs("label", { className: "sr-only", "data-testid": "rds-progress__label", children: [
|
|
11
|
-
t,
|
|
12
|
-
/* @__PURE__ */ s.jsx("progress", { "data-testid": "rds-progress__progress", value: r, max: 1 })
|
|
13
|
-
] }),
|
|
14
|
-
/* @__PURE__ */ s.jsxs(
|
|
15
|
-
"div",
|
|
16
|
-
{
|
|
17
|
-
ref: o,
|
|
18
|
-
"data-testid": "rds-progress",
|
|
19
|
-
className: `rds-progress--circular ${l}`,
|
|
20
|
-
style: { "--progress-circle-size": p },
|
|
21
|
-
...d,
|
|
22
|
-
children: [
|
|
23
|
-
/* @__PURE__ */ s.jsx("div", { className: "rds-progress--circular__outer", "data-testid": "rds-progress__content", children: c || /* @__PURE__ */ s.jsx(u, { "data-testid": "rds-progress__default-text", lookLike: "title-3", children: r === 1 ? "Du er i mål!" : `${r * 100} %` }) }),
|
|
24
|
-
/* @__PURE__ */ s.jsxs(
|
|
25
|
-
"svg",
|
|
26
|
-
{
|
|
27
|
-
style: { "--calculated-progress": i, "--progress": `${r + 1}s` },
|
|
28
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
29
|
-
version: "1.1",
|
|
30
|
-
viewBox: "-10 0 120 100",
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ s.jsx("defs", { children: /* @__PURE__ */ s.jsxs("linearGradient", { id: "GradientColor", children: [
|
|
33
|
-
/* @__PURE__ */ s.jsx("stop", { offset: "0%", stopColor: "var(--rds-heading-accent)" }),
|
|
34
|
-
/* @__PURE__ */ s.jsx("stop", { offset: "100%", stopColor: "var(--rds-background-card)" })
|
|
35
|
-
] }) }),
|
|
36
|
-
/* @__PURE__ */ s.jsx("circle", { id: "path", cx: "50", cy: "50", r: "50", strokeLinecap: "round" }),
|
|
37
|
-
/* @__PURE__ */ s.jsx("circle", { id: "prog", cx: "50", cy: "50", r: "50", strokeLinecap: "round" })
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
] });
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
j.displayName = "CircularProgress";
|
|
48
|
-
export {
|
|
49
|
-
j as C
|
|
50
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { j as s } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import { forwardRef as g } from "react";
|
|
3
|
-
const i = g(
|
|
4
|
-
({ className: a = "", label: d, ratio: r, checkmarkOnDone: e = !1, animateIn: t = !1, ...o }, p) => {
|
|
5
|
-
const l = { "--progress": r };
|
|
6
|
-
return /* @__PURE__ */ s.jsxs(
|
|
7
|
-
"div",
|
|
8
|
-
{
|
|
9
|
-
"data-testid": "rds-progress__wrapper",
|
|
10
|
-
className: `rds-progress ${t ? "rds-progress--animate" : ""} ${a}`,
|
|
11
|
-
children: [
|
|
12
|
-
/* @__PURE__ */ s.jsxs("label", { "data-testid": "rds-progress__label", className: "sr-only", children: [
|
|
13
|
-
/* @__PURE__ */ s.jsx("progress", { "data-testid": "rds-progress__sr", max: 1, value: r, ref: p, ...o }),
|
|
14
|
-
d
|
|
15
|
-
] }),
|
|
16
|
-
r === 1 && e && /* @__PURE__ */ s.jsx("div", { "data-testid": "rds-progress__mark", className: "rds-progress--done" }),
|
|
17
|
-
(r !== 1 || !e) && /* @__PURE__ */ s.jsx("div", { className: "rds-progress__track", children: /* @__PURE__ */ s.jsx("div", { "data-testid": "rds-progress__bar", style: l, className: "rds-progress__progress" }) })
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
i.displayName = "Progress";
|
|
24
|
-
export {
|
|
25
|
-
i as P
|
|
26
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { j as t } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import { forwardRef as d, useState as a } from "react";
|
|
3
|
-
import { T as i } from "./TextField-BCS5Ve2N.mjs";
|
|
4
|
-
const n = d(({ ...o }, e) => {
|
|
5
|
-
const [s, r] = a(!1);
|
|
6
|
-
return /* @__PURE__ */ t.jsxs("div", { style: { position: "relative", boxSizing: "content-box" }, children: [
|
|
7
|
-
/* @__PURE__ */ t.jsx(i, { type: s ? "text" : "password", ref: e, ...o }),
|
|
8
|
-
/* @__PURE__ */ t.jsx(
|
|
9
|
-
"button",
|
|
10
|
-
{
|
|
11
|
-
type: "button",
|
|
12
|
-
onClick: () => r(!s),
|
|
13
|
-
className: `rds-password-textfield-button ${s ? "rds-password-textfield-button--hide" : "rds-password-textfield-button--show"}`,
|
|
14
|
-
children: /* @__PURE__ */ t.jsx("span", { className: "sr-only", children: s ? "Skjul passord" : "Vis passord" })
|
|
15
|
-
}
|
|
16
|
-
)
|
|
17
|
-
] });
|
|
18
|
-
});
|
|
19
|
-
n.displayName = "PasswordTextField";
|
|
20
|
-
export {
|
|
21
|
-
n as P
|
|
22
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { j as t } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import { forwardRef as j, useRef as w, useEffect as $ } from "react";
|
|
3
|
-
import { g as m } from "../checkbox/BaseCheckbox-Ds7EbRAQ.mjs";
|
|
4
|
-
const v = (i) => {
|
|
5
|
-
let e = i;
|
|
6
|
-
for (; e; ) {
|
|
7
|
-
const r = window.getComputedStyle(e);
|
|
8
|
-
if (r.backgroundColor !== "rgba(0, 0, 0, 0)" && r.backgroundColor !== "transparent")
|
|
9
|
-
return r.backgroundColor;
|
|
10
|
-
e = e.parentElement;
|
|
11
|
-
}
|
|
12
|
-
return "transparent";
|
|
13
|
-
}, C = j(
|
|
14
|
-
({
|
|
15
|
-
className: i = "",
|
|
16
|
-
id: e,
|
|
17
|
-
labelClass: r = "",
|
|
18
|
-
type: p = "text",
|
|
19
|
-
valid: a,
|
|
20
|
-
lightBackground: l = !1,
|
|
21
|
-
label: n,
|
|
22
|
-
errorMessage: d,
|
|
23
|
-
...h
|
|
24
|
-
}, b) => {
|
|
25
|
-
const o = m(), c = m(e), x = l === "white", f = !d && a, u = !!d || a === !1, s = w(null);
|
|
26
|
-
return $(() => {
|
|
27
|
-
s.current && (s.current.style.backgroundColor = v(s.current));
|
|
28
|
-
}, []), /* @__PURE__ */ t.jsxs("div", { className: i, children: [
|
|
29
|
-
/* @__PURE__ */ t.jsx(
|
|
30
|
-
"div",
|
|
31
|
-
{
|
|
32
|
-
className: `rds-textfield
|
|
33
|
-
${l ? "rds-light" : ""}
|
|
34
|
-
${x ? "rds-white" : ""}`,
|
|
35
|
-
children: /* @__PURE__ */ t.jsxs(
|
|
36
|
-
"label",
|
|
37
|
-
{
|
|
38
|
-
htmlFor: c,
|
|
39
|
-
className: `rds-textfield-label ${r} ${l ? "rds-light" : ""} ${x ? "rds-white" : ""}`,
|
|
40
|
-
"data-valid": f,
|
|
41
|
-
children: [
|
|
42
|
-
/* @__PURE__ */ t.jsx(
|
|
43
|
-
"input",
|
|
44
|
-
{
|
|
45
|
-
ref: b,
|
|
46
|
-
id: c,
|
|
47
|
-
className: `rds-textfield-input ${u ? "rds-textfield-input--error" : ""}`,
|
|
48
|
-
type: p,
|
|
49
|
-
placeholder: n,
|
|
50
|
-
"aria-invalid": u,
|
|
51
|
-
"aria-describedby": d ? o : void 0,
|
|
52
|
-
"data-valid": f,
|
|
53
|
-
...h
|
|
54
|
-
}
|
|
55
|
-
),
|
|
56
|
-
/* @__PURE__ */ t.jsx("span", { ref: s, className: "rds-textfield-label-text", children: n })
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
d && /* @__PURE__ */ t.jsx(
|
|
63
|
-
"span",
|
|
64
|
-
{
|
|
65
|
-
id: o,
|
|
66
|
-
className: `rds-textfield rds-textfield--error-text ${l ? "rds-light" : ""}`,
|
|
67
|
-
children: d
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
] });
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
C.displayName = "TextField";
|
|
74
|
-
export {
|
|
75
|
-
C as T
|
|
76
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { j as e } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import { createContext as o, forwardRef as n } from "react";
|
|
3
|
-
const m = o({ radioName: "" }), f = n(
|
|
4
|
-
({ legend: s, children: t, name: d, className: r = "", showLegend: a = !1, ...i }, l) => /* @__PURE__ */ e.jsx(m.Provider, { value: { radioName: d }, children: /* @__PURE__ */ e.jsxs("fieldset", { "data-testid": "fieldset", ...i, className: `rds-field-set ${r}`, ref: l, children: [
|
|
5
|
-
/* @__PURE__ */ e.jsx("legend", { className: `rds-field-set__legend ${a ? "" : "sr-only"}`, children: s }),
|
|
6
|
-
t
|
|
7
|
-
] }) })
|
|
8
|
-
);
|
|
9
|
-
f.displayName = "FieldSet";
|
|
10
|
-
export {
|
|
11
|
-
f as F,
|
|
12
|
-
m as R
|
|
13
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { j as o } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import { forwardRef as d, useContext as l } from "react";
|
|
3
|
-
import { R as m } from "./FieldSet-DOEdpTZk.mjs";
|
|
4
|
-
import "../button/ArrowButton-DMr9aNBX.mjs";
|
|
5
|
-
const n = d(
|
|
6
|
-
({ label: a, name: e, className: r = "", ...s }, t) => {
|
|
7
|
-
const { radioName: i } = l(m);
|
|
8
|
-
return /* @__PURE__ */ o.jsxs("label", { className: `rds-radio-toggle ${r}`, children: [
|
|
9
|
-
/* @__PURE__ */ o.jsx("input", { className: "rds-radio-toggle__input", ...s, ref: t, type: "radio", name: i || e }),
|
|
10
|
-
/* @__PURE__ */ o.jsx("span", { className: "rds-radio-toggle__label", children: a })
|
|
11
|
-
] });
|
|
12
|
-
}
|
|
13
|
-
);
|
|
14
|
-
n.displayName = "RadioToggleInput";
|
|
15
|
-
export {
|
|
16
|
-
n as R
|
|
17
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { j as t } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import { forwardRef as I, useRef as k, useState as C } from "react";
|
|
3
|
-
import { B as N } from "../checkbox/BaseCheckbox-Ds7EbRAQ.mjs";
|
|
4
|
-
const R = I(
|
|
5
|
-
({ children: s, className: _ = "", defaultChecked: l, icons: e, iconClass: i = "", id: h, onChange: a, alwaysShowLabel: x = !1, ...b }, f) => {
|
|
6
|
-
const m = k(null), [n, c] = C(!!l), g = e && "checkedIcon" in e ? e.checkedIcon : null, r = e && "uncheckedIcon" in e ? e.uncheckedIcon : null, d = e && "toggleIcon" in e ? e.toggleIcon : null, o = f || m, p = (j) => {
|
|
7
|
-
var u;
|
|
8
|
-
typeof a == "function" && a(j), c(typeof o != "function" ? !!((u = o.current) != null && u.checked) : !n);
|
|
9
|
-
};
|
|
10
|
-
return /* @__PURE__ */ t.jsx(
|
|
11
|
-
N,
|
|
12
|
-
{
|
|
13
|
-
id: h,
|
|
14
|
-
ref: o,
|
|
15
|
-
dataTestId: "toggle-button__label",
|
|
16
|
-
containerClassName: _ + " rds-toggle-button-container",
|
|
17
|
-
inputClassName: "rds-toggle-button__input",
|
|
18
|
-
labelClassName: "rds-toggle-button",
|
|
19
|
-
onChange: p,
|
|
20
|
-
defaultChecked: l,
|
|
21
|
-
...b,
|
|
22
|
-
children: /* @__PURE__ */ t.jsxs("span", { className: "rds-toggle-button__content", children: [
|
|
23
|
-
e && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
24
|
-
/* @__PURE__ */ t.jsxs("span", { className: `rds-toggle-button__icon ${i}`, children: [
|
|
25
|
-
d && /* @__PURE__ */ t.jsx(d, { checked: n }),
|
|
26
|
-
g && n && /* @__PURE__ */ t.jsx(g, {}),
|
|
27
|
-
r && !n && /* @__PURE__ */ t.jsx(r, {})
|
|
28
|
-
] }),
|
|
29
|
-
/* @__PURE__ */ t.jsx(
|
|
30
|
-
"span",
|
|
31
|
-
{
|
|
32
|
-
"data-testid": "toggle-button__icon__label__text",
|
|
33
|
-
className: `label-text__icon ${x ? "always-show-label" : ""}`,
|
|
34
|
-
children: s
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
] }),
|
|
38
|
-
!e && /* @__PURE__ */ t.jsx("span", { "data-testid": "toggle-button__label__text", children: s })
|
|
39
|
-
] })
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
R.displayName = "ToggleButton";
|
|
45
|
-
export {
|
|
46
|
-
R as T
|
|
47
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { j as l } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import { forwardRef as h, useRef as x, useState as C } from "react";
|
|
3
|
-
import { B as k } from "../checkbox/BaseCheckbox-Ds7EbRAQ.mjs";
|
|
4
|
-
const N = h(
|
|
5
|
-
({
|
|
6
|
-
defaultChecked: i,
|
|
7
|
-
lightBackground: a,
|
|
8
|
-
children: r,
|
|
9
|
-
onChange: t,
|
|
10
|
-
id: c,
|
|
11
|
-
className: u = "",
|
|
12
|
-
inputClassName: d = "",
|
|
13
|
-
labelClassName: g = "",
|
|
14
|
-
...f
|
|
15
|
-
}, m) => {
|
|
16
|
-
const p = x(null), [n, o] = C(!!i), e = m || p, _ = (b) => {
|
|
17
|
-
var s;
|
|
18
|
-
typeof t == "function" && t(b), o(typeof e != "function" ? !!((s = e.current) != null && s.checked) : !n);
|
|
19
|
-
};
|
|
20
|
-
return /* @__PURE__ */ l.jsx(
|
|
21
|
-
k,
|
|
22
|
-
{
|
|
23
|
-
id: c,
|
|
24
|
-
ref: e,
|
|
25
|
-
onChange: _,
|
|
26
|
-
checked: n,
|
|
27
|
-
dataTestId: "toggle-inline-button__label",
|
|
28
|
-
containerClassName: `rds-toggle-inline-button ${u}`,
|
|
29
|
-
inputClassName: `rds-toggle-inline-button__input ${d}`,
|
|
30
|
-
labelClassName: `${a ? "rds-light" : ""} ${g}`,
|
|
31
|
-
...f,
|
|
32
|
-
children: /* @__PURE__ */ l.jsx("span", { "data-testid": "toggle-inline-button__label__text", className: "rds-toggle-inline-button__content", children: r })
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
N.displayName = "ToggleInlineButton";
|
|
38
|
-
export {
|
|
39
|
-
N as T
|
|
40
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { j as e } from "../accordion/Accordion-C-Lu1AN3.mjs";
|
|
2
|
-
import { forwardRef as b, useRef as p, useState as h } from "react";
|
|
3
|
-
import { B as x } from "../checkbox/BaseCheckbox-Ds7EbRAQ.mjs";
|
|
4
|
-
import "../icons/HeartToggle-Buv7f9yB.mjs";
|
|
5
|
-
import { e as C, f as N } from "../icons/Icons-D0X7KrxA.mjs";
|
|
6
|
-
const j = b(
|
|
7
|
-
({ defaultChecked: a, toggledContentId: i, lightBackground: r, children: c, onChange: s, id: g, className: d = "", ...u }, _) => {
|
|
8
|
-
const f = p(null), [t, o] = h(!!a), n = _ || f, m = (k) => {
|
|
9
|
-
var l;
|
|
10
|
-
typeof s == "function" && s(k), o(typeof n != "function" ? !!((l = n.current) != null && l.checked) : !t);
|
|
11
|
-
};
|
|
12
|
-
return /* @__PURE__ */ e.jsx(
|
|
13
|
-
x,
|
|
14
|
-
{
|
|
15
|
-
id: g,
|
|
16
|
-
ref: n,
|
|
17
|
-
onChange: m,
|
|
18
|
-
checked: t,
|
|
19
|
-
"aria-controls": i,
|
|
20
|
-
dataTestId: "toggle-link-button__label",
|
|
21
|
-
containerClassName: "rds-toggle-link-button",
|
|
22
|
-
inputClassName: "rds-toggle-link-button__input",
|
|
23
|
-
labelClassName: `rds-toggle-link-button__label ${r ? "rds-light" : ""} ${d}`,
|
|
24
|
-
...u,
|
|
25
|
-
children: /* @__PURE__ */ e.jsxs("span", { className: "rds-toggle-link-button__label__content rds-link", "data-testid": "toggle-link-button__label__text", children: [
|
|
26
|
-
c,
|
|
27
|
-
!t && /* @__PURE__ */ e.jsx(C, { className: "rds-toggle-link-button__icon" }),
|
|
28
|
-
t && /* @__PURE__ */ e.jsx(N, { className: "rds-toggle-link-button__icon" })
|
|
29
|
-
] })
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
j.displayName = "ToggleLinkButton";
|
|
35
|
-
export {
|
|
36
|
-
j as T
|
|
37
|
-
};
|