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,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { useId as
|
|
3
|
+
import { useId as K, useState as u, useEffect as Q } from "react";
|
|
4
4
|
import { Tabs as s } from "../Tabs/index.js";
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Textfield as
|
|
7
|
-
import { Paragraph as
|
|
8
|
-
import { Link as
|
|
5
|
+
import { Button as X } from "../Button/index.js";
|
|
6
|
+
import { Textfield as Y } from "../Textfield/index.js";
|
|
7
|
+
import { Paragraph as A } from "../Paragraph/index.js";
|
|
8
|
+
import { Link as ee } from "../Link/index.js";
|
|
9
9
|
import i from "./styles.module.css.js";
|
|
10
|
-
const
|
|
10
|
+
const k = () => /* @__PURE__ */ t(
|
|
11
11
|
"svg",
|
|
12
12
|
{
|
|
13
13
|
width: "19",
|
|
@@ -25,7 +25,7 @@ const L = () => /* @__PURE__ */ t(
|
|
|
25
25
|
}
|
|
26
26
|
)
|
|
27
27
|
}
|
|
28
|
-
),
|
|
28
|
+
), te = () => /* @__PURE__ */ t(
|
|
29
29
|
"svg",
|
|
30
30
|
{
|
|
31
31
|
width: "16",
|
|
@@ -43,7 +43,7 @@ const L = () => /* @__PURE__ */ t(
|
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
45
|
}
|
|
46
|
-
),
|
|
46
|
+
), ie = () => /* @__PURE__ */ t(
|
|
47
47
|
"svg",
|
|
48
48
|
{
|
|
49
49
|
width: "64",
|
|
@@ -61,79 +61,82 @@ const L = () => /* @__PURE__ */ t(
|
|
|
61
61
|
}
|
|
62
62
|
)
|
|
63
63
|
}
|
|
64
|
-
),
|
|
64
|
+
), ae = [
|
|
65
65
|
{ value: 220, label: "220 kr" },
|
|
66
66
|
{ value: 345, label: "345 kr" },
|
|
67
67
|
{ value: 660, label: "660 kr" }
|
|
68
|
-
],
|
|
68
|
+
], N = (e) => {
|
|
69
|
+
const d = Number(e);
|
|
70
|
+
return Number.isSafeInteger(d) && d > 0 ? d : null;
|
|
71
|
+
}, ue = ({
|
|
69
72
|
"data-color": e = "primary-color-red",
|
|
70
|
-
amounts:
|
|
71
|
-
defaultAmount:
|
|
73
|
+
amounts: d = ae,
|
|
74
|
+
defaultAmount: z = 345,
|
|
72
75
|
oneTimeLabel: B = "En gang",
|
|
73
|
-
monthlyLabel:
|
|
76
|
+
monthlyLabel: I = "Hver måned",
|
|
74
77
|
customAmountPlaceholder: x = "Valgfritt beløp",
|
|
75
|
-
amountLabel:
|
|
78
|
+
amountLabel: S = "Velg ønsket beløp:",
|
|
76
79
|
impactMessage: M = "En gave på {amount} bidrar til ...",
|
|
77
|
-
vippsButtonLabel:
|
|
78
|
-
avtalegiroLabel:
|
|
79
|
-
avtalegiroHref:
|
|
80
|
-
currencySuffix:
|
|
80
|
+
vippsButtonLabel: v = "Gi med",
|
|
81
|
+
avtalegiroLabel: H = "Gi med avtalegiro",
|
|
82
|
+
avtalegiroHref: Z = "#",
|
|
83
|
+
currencySuffix: T = "kr",
|
|
81
84
|
onVippsClick: f,
|
|
82
|
-
onAvtalegiroClick:
|
|
85
|
+
onAvtalegiroClick: p,
|
|
83
86
|
onAmountChange: r,
|
|
84
|
-
showVippsButton:
|
|
87
|
+
showVippsButton: j = !0,
|
|
85
88
|
showAvtalegiroLink: V = !0,
|
|
86
|
-
showImpactMessage:
|
|
87
|
-
heartVariant:
|
|
89
|
+
showImpactMessage: E = !0,
|
|
90
|
+
heartVariant: F = "outlined"
|
|
88
91
|
}) => {
|
|
89
|
-
const
|
|
90
|
-
|
|
92
|
+
const g = K(), [c, P] = u("monthly"), [b, D] = u(z), [C, w] = u(""), [y, h] = u(!1);
|
|
93
|
+
Q(() => {
|
|
91
94
|
const a = "rk-donor-inline-styles";
|
|
92
95
|
if (typeof document > "u" || document.getElementById(a)) return;
|
|
93
|
-
const n =
|
|
96
|
+
const n = ne(i), o = document.createElement("style");
|
|
94
97
|
o.id = a, o.textContent = n, document.head.prepend(o);
|
|
95
98
|
}, []);
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
+
const $ = N(C), m = y && $ !== null ? $ : b, W = (a) => {
|
|
100
|
+
D(a), h(!1), w(""), r == null || r(a, c);
|
|
101
|
+
}, q = (a) => {
|
|
99
102
|
const n = a.target.value;
|
|
100
|
-
|
|
101
|
-
const o =
|
|
102
|
-
o
|
|
103
|
-
},
|
|
103
|
+
w(n), h(!0);
|
|
104
|
+
const o = N(n);
|
|
105
|
+
o !== null && (r == null || r(o, c));
|
|
106
|
+
}, R = () => {
|
|
104
107
|
h(!0);
|
|
105
108
|
}, G = (a) => {
|
|
106
109
|
const n = a;
|
|
107
|
-
|
|
108
|
-
}, R = () => {
|
|
109
|
-
p > 0 && (f == null || f(p, d));
|
|
110
|
+
P(n), r == null || r(m, n);
|
|
110
111
|
}, U = () => {
|
|
111
|
-
|
|
112
|
+
m > 0 && (f == null || f(m, c));
|
|
112
113
|
}, O = () => {
|
|
113
|
-
|
|
114
|
+
p == null || p();
|
|
115
|
+
}, _ = () => {
|
|
116
|
+
const a = `${m} ${T}`, n = M.split("{amount}");
|
|
114
117
|
return /* @__PURE__ */ l("span", { children: [
|
|
115
118
|
n[0],
|
|
116
119
|
/* @__PURE__ */ t("span", { className: i.impactAmount, children: a }),
|
|
117
120
|
n[1] || ""
|
|
118
121
|
] });
|
|
119
|
-
},
|
|
122
|
+
}, L = /* @__PURE__ */ l("div", { className: i.content, children: [
|
|
120
123
|
/* @__PURE__ */ l("div", { className: i.amountSection, children: [
|
|
121
|
-
/* @__PURE__ */ t(
|
|
124
|
+
/* @__PURE__ */ t(A, { className: i.amountLabel, "data-size": "sm", id: g, children: S }),
|
|
122
125
|
/* @__PURE__ */ t(
|
|
123
126
|
"div",
|
|
124
127
|
{
|
|
125
128
|
className: i.amountButtons,
|
|
126
129
|
role: "group",
|
|
127
|
-
"aria-labelledby":
|
|
128
|
-
children:
|
|
129
|
-
const n = !
|
|
130
|
+
"aria-labelledby": g,
|
|
131
|
+
children: d.map((a) => {
|
|
132
|
+
const n = !y && b === a.value;
|
|
130
133
|
return /* @__PURE__ */ t(
|
|
131
|
-
|
|
134
|
+
X,
|
|
132
135
|
{
|
|
133
136
|
variant: n ? "primary" : "secondary",
|
|
134
137
|
"data-color": n ? "primary-color-red" : "neutral",
|
|
135
138
|
"aria-pressed": n,
|
|
136
|
-
onClick: () =>
|
|
139
|
+
onClick: () => W(a.value),
|
|
137
140
|
children: a.label
|
|
138
141
|
},
|
|
139
142
|
a.value
|
|
@@ -142,52 +145,52 @@ const L = () => /* @__PURE__ */ t(
|
|
|
142
145
|
}
|
|
143
146
|
),
|
|
144
147
|
/* @__PURE__ */ t("div", { className: i.customAmountField, children: /* @__PURE__ */ t(
|
|
145
|
-
|
|
148
|
+
Y,
|
|
146
149
|
{
|
|
147
150
|
"aria-label": x,
|
|
148
151
|
placeholder: x,
|
|
149
|
-
value:
|
|
150
|
-
onChange:
|
|
151
|
-
onFocus:
|
|
152
|
+
value: C,
|
|
153
|
+
onChange: q,
|
|
154
|
+
onFocus: R,
|
|
152
155
|
type: "number",
|
|
153
156
|
min: 1
|
|
154
157
|
}
|
|
155
158
|
) })
|
|
156
159
|
] }),
|
|
157
|
-
|
|
158
|
-
/* @__PURE__ */ t("div", { className: i.heartIcon, children:
|
|
159
|
-
/* @__PURE__ */ t("p", { className: i.impactText, children:
|
|
160
|
+
E && /* @__PURE__ */ l("div", { className: i.impactRow, children: [
|
|
161
|
+
/* @__PURE__ */ t("div", { className: i.heartIcon, children: F === "filled" ? /* @__PURE__ */ t(k, {}) : /* @__PURE__ */ t(te, {}) }),
|
|
162
|
+
/* @__PURE__ */ t("p", { className: i.impactText, children: _() })
|
|
160
163
|
] }),
|
|
161
164
|
/* @__PURE__ */ l("div", { className: i.actionsSection, children: [
|
|
162
|
-
|
|
165
|
+
j && /* @__PURE__ */ l(
|
|
163
166
|
"button",
|
|
164
167
|
{
|
|
165
168
|
className: i.vippsButton,
|
|
166
|
-
onClick:
|
|
169
|
+
onClick: U,
|
|
167
170
|
type: "button",
|
|
168
|
-
"aria-label": `${
|
|
171
|
+
"aria-label": `${v} Vipps`,
|
|
169
172
|
"data-brand-exception": "vipps",
|
|
170
173
|
children: [
|
|
171
|
-
/* @__PURE__ */ t("span", { className: i.vippsButtonLabel, children:
|
|
172
|
-
/* @__PURE__ */ t("span", { className: i.vippsLogo, children: /* @__PURE__ */ t(
|
|
174
|
+
/* @__PURE__ */ t("span", { className: i.vippsButtonLabel, children: v }),
|
|
175
|
+
/* @__PURE__ */ t("span", { className: i.vippsLogo, children: /* @__PURE__ */ t(ie, {}) })
|
|
173
176
|
]
|
|
174
177
|
}
|
|
175
178
|
),
|
|
176
179
|
V && /* @__PURE__ */ t(
|
|
177
|
-
|
|
180
|
+
ee,
|
|
178
181
|
{
|
|
179
|
-
href:
|
|
182
|
+
href: Z,
|
|
180
183
|
"data-color": "neutral",
|
|
181
184
|
className: i.avtalegiroLink,
|
|
182
185
|
onClick: (a) => {
|
|
183
|
-
|
|
186
|
+
p && (a.preventDefault(), O());
|
|
184
187
|
},
|
|
185
|
-
children:
|
|
188
|
+
children: H
|
|
186
189
|
}
|
|
187
190
|
)
|
|
188
191
|
] })
|
|
189
|
-
] }),
|
|
190
|
-
return /* @__PURE__ */ t("div", { className: i.donor, "data-color":
|
|
192
|
+
] }), J = e === "primary" ? "primary-color-red" : e;
|
|
193
|
+
return /* @__PURE__ */ t("div", { className: i.donor, "data-color": J, children: /* @__PURE__ */ l(
|
|
191
194
|
s,
|
|
192
195
|
{
|
|
193
196
|
defaultValue: "monthly",
|
|
@@ -198,17 +201,17 @@ const L = () => /* @__PURE__ */ t(
|
|
|
198
201
|
/* @__PURE__ */ l(s.List, { children: [
|
|
199
202
|
/* @__PURE__ */ t(s.Tab, { value: "one-time", children: B }),
|
|
200
203
|
/* @__PURE__ */ l(s.Tab, { value: "monthly", children: [
|
|
201
|
-
/* @__PURE__ */ t("span", { className: i.tabHeartIcon, children: /* @__PURE__ */ t(
|
|
202
|
-
|
|
204
|
+
/* @__PURE__ */ t("span", { className: i.tabHeartIcon, children: /* @__PURE__ */ t(k, {}) }),
|
|
205
|
+
I
|
|
203
206
|
] })
|
|
204
207
|
] }),
|
|
205
|
-
/* @__PURE__ */ t(s.Panel, { value: "one-time", className: i.tabPanel, children:
|
|
206
|
-
/* @__PURE__ */ t(s.Panel, { value: "monthly", className: i.tabPanel, children:
|
|
208
|
+
/* @__PURE__ */ t(s.Panel, { value: "one-time", className: i.tabPanel, children: c === "one-time" ? L : null }),
|
|
209
|
+
/* @__PURE__ */ t(s.Panel, { value: "monthly", className: i.tabPanel, children: c === "monthly" ? L : null })
|
|
207
210
|
]
|
|
208
211
|
}
|
|
209
212
|
) });
|
|
210
213
|
};
|
|
211
|
-
function
|
|
214
|
+
function ne(e) {
|
|
212
215
|
return `
|
|
213
216
|
.${e.donor} {
|
|
214
217
|
border-radius: 16px;
|
|
@@ -325,7 +328,7 @@ function ae(e) {
|
|
|
325
328
|
justify-content: center;
|
|
326
329
|
width: 300px;
|
|
327
330
|
height: 44px;
|
|
328
|
-
padding: 12px 16px;
|
|
331
|
+
padding: var(--ds-size-3, 12px) var(--ds-size-4, 16px);
|
|
329
332
|
background-color: #ff5b24;
|
|
330
333
|
border: none;
|
|
331
334
|
border-radius: var(--ds-border-radius-xl, 12px);
|
|
@@ -368,15 +371,26 @@ function ae(e) {
|
|
|
368
371
|
.${e.tabHeartIcon} {
|
|
369
372
|
display: inline-flex;
|
|
370
373
|
align-items: center;
|
|
371
|
-
margin-right: 4px;
|
|
374
|
+
margin-right: var(--ds-size-1, 4px);
|
|
372
375
|
vertical-align: middle;
|
|
373
376
|
}
|
|
374
377
|
.${e.tabHeartIcon} svg {
|
|
375
378
|
width: 16px;
|
|
376
379
|
height: 15px;
|
|
377
380
|
}
|
|
381
|
+
|
|
382
|
+
/* Mobil: uten disse fikk en konsument som ikke importerer stilarket
|
|
383
|
+
skrivebordsbreddene på telefon — kortet låst til 344px på en 390px-skjerm.
|
|
384
|
+
Speiler @media-blokken i styles.module.css. */
|
|
385
|
+
@media (max-width: 480px) {
|
|
386
|
+
.${e.donor} { max-width: 100%; }
|
|
387
|
+
.${e.amountSection},
|
|
388
|
+
.${e.impactRow},
|
|
389
|
+
.${e.actionsSection} { width: 100%; }
|
|
390
|
+
.${e.vippsButton} { width: 100%; max-width: 300px; }
|
|
391
|
+
}
|
|
378
392
|
`;
|
|
379
393
|
}
|
|
380
394
|
export {
|
|
381
|
-
|
|
395
|
+
ue as Donor
|
|
382
396
|
};
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const t = "
|
|
2
|
+
const t = "_donor_5kh8b_1", o = "_tabsWrapper_5kh8b_14", n = "_content_5kh8b_35", a = "_amountSection_5kh8b_47", _ = "_amountLabel_5kh8b_55", c = "_amountButtons_5kh8b_64", s = "_customAmountField_5kh8b_75", e = "_impactRow_5kh8b_80", i = "_heartIcon_5kh8b_88", p = "_impactText_5kh8b_102", b = "_impactAmount_5kh8b_112", u = "_actionsSection_5kh8b_117", m = "_vippsButton_5kh8b_127", h = "_vippsButtonLabel_5kh8b_157", k = "_vippsLogo_5kh8b_166", r = "_avtalegiroLink_5kh8b_179", l = "_tabHeartIcon_5kh8b_184", v = "_tabPanel_5kh8b_214", L = {
|
|
3
3
|
donor: t,
|
|
4
4
|
tabsWrapper: o,
|
|
5
|
-
content:
|
|
6
|
-
amountSection:
|
|
5
|
+
content: n,
|
|
6
|
+
amountSection: a,
|
|
7
7
|
amountLabel: _,
|
|
8
8
|
amountButtons: c,
|
|
9
9
|
customAmountField: s,
|
|
10
10
|
impactRow: e,
|
|
11
11
|
heartIcon: i,
|
|
12
12
|
impactText: p,
|
|
13
|
-
impactAmount:
|
|
14
|
-
actionsSection:
|
|
15
|
-
vippsButton:
|
|
16
|
-
vippsButtonLabel:
|
|
17
|
-
vippsLogo:
|
|
18
|
-
avtalegiroLink:
|
|
19
|
-
tabHeartIcon:
|
|
20
|
-
tabPanel:
|
|
13
|
+
impactAmount: b,
|
|
14
|
+
actionsSection: u,
|
|
15
|
+
vippsButton: m,
|
|
16
|
+
vippsButtonLabel: h,
|
|
17
|
+
vippsLogo: k,
|
|
18
|
+
avtalegiroLink: r,
|
|
19
|
+
tabHeartIcon: l,
|
|
20
|
+
tabPanel: v
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
u as actionsSection,
|
|
24
24
|
c as amountButtons,
|
|
25
25
|
_ as amountLabel,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
a as amountSection,
|
|
27
|
+
r as avtalegiroLink,
|
|
28
|
+
n as content,
|
|
29
29
|
s as customAmountField,
|
|
30
|
-
|
|
30
|
+
L as default,
|
|
31
31
|
t as donor,
|
|
32
32
|
i as heartIcon,
|
|
33
|
-
|
|
33
|
+
b as impactAmount,
|
|
34
34
|
e as impactRow,
|
|
35
35
|
p as impactText,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
l as tabHeartIcon,
|
|
37
|
+
v as tabPanel,
|
|
38
38
|
o as tabsWrapper,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
m as vippsButton,
|
|
40
|
+
h as vippsButtonLabel,
|
|
41
|
+
k as vippsLogo
|
|
42
42
|
};
|