@holmdigital/components 2.1.0 → 2.1.2
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/AccessibilityStatement/AccessibilityStatement.js +116 -80
- package/dist/AccessibilityStatement/AccessibilityStatement.mjs +1 -1
- package/dist/FormField/FormField.js +11 -8
- package/dist/FormField/FormField.mjs +1 -1
- package/dist/{chunk-OFTOD72G.mjs → chunk-LBRVCJHL.mjs} +116 -80
- package/dist/{chunk-PLT5CAFO.mjs → chunk-ZO5YRJQG.mjs} +11 -8
- package/dist/index.js +127 -88
- package/dist/index.mjs +5 -5
- package/package.json +2 -2
|
@@ -105,7 +105,8 @@ var AccessibilityStatement = ({
|
|
|
105
105
|
badgeUrl,
|
|
106
106
|
publishDate
|
|
107
107
|
}) => {
|
|
108
|
-
const
|
|
108
|
+
const supportedLocales = { sv: "sv", no: "no", nb: "no" };
|
|
109
|
+
const lang = supportedLocales[locale] ?? "en";
|
|
109
110
|
const template = TEMPLATES[lang] || TEMPLATES.en;
|
|
110
111
|
const d = (date) => formatDiggDate(date, locale);
|
|
111
112
|
const enforcementBody = import_standards.ENFORCEMENT_BODIES[country] || import_standards.ENFORCEMENT_BODIES.EU;
|
|
@@ -196,15 +197,16 @@ var AccessibilityStatement = ({
|
|
|
196
197
|
} else if (section.id === "testing" || trimmed.includes("Hur vi testat") || trimmed.includes("How we tested") || trimmed.includes("Hvordan vi har testet") || trimmed.includes("Kuinka olemme testanneet") || trimmed.includes("Hoe wij de website hebben getest") || trimmed.includes("Erstellung dieser Erkl\xE4rung") || trimmed.includes("\xC9tablissement de cette d\xE9claration") || trimmed.includes("Preparaci\xF3n de la presente declaraci\xF3n")) {
|
|
197
198
|
IconNode = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckCircleIcon, {}) });
|
|
198
199
|
}
|
|
200
|
+
const SectionHeader = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h2", { style: styles.sectionTitle, children: [
|
|
201
|
+
IconNode,
|
|
202
|
+
section.title
|
|
203
|
+
] }, `h2-${i}`);
|
|
199
204
|
const blocks = trimmed.split("\n\n").map((block, bi) => {
|
|
200
205
|
const blockTrimmed = block.trim();
|
|
201
206
|
if (!blockTrimmed) return null;
|
|
202
207
|
if (blockTrimmed.startsWith("## ")) {
|
|
203
208
|
const title = blockTrimmed.replace("## ", "");
|
|
204
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
205
|
-
IconNode,
|
|
206
|
-
title
|
|
207
|
-
] }, `${i}-${bi}`);
|
|
209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { style: styles.sectionTitle, children: title }, `${i}-${bi}`);
|
|
208
210
|
}
|
|
209
211
|
if (blockTrimmed.startsWith("### ")) {
|
|
210
212
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { style: { ...styles.sectionTitle, fontSize: "1.4rem" }, children: blockTrimmed.replace("### ", "") }, `${i}-${bi}`);
|
|
@@ -226,7 +228,10 @@ var AccessibilityStatement = ({
|
|
|
226
228
|
}
|
|
227
229
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: styles.paragraph, children: blockTrimmed }, `${i}-${bi}`);
|
|
228
230
|
});
|
|
229
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { style: styles.section, children: [
|
|
232
|
+
SectionHeader,
|
|
233
|
+
blocks
|
|
234
|
+
] }, i);
|
|
230
235
|
});
|
|
231
236
|
};
|
|
232
237
|
const statementTools = (0, import_standards.getStatementToolsByCountry)(country);
|
|
@@ -243,152 +248,168 @@ var AccessibilityStatement = ({
|
|
|
243
248
|
display: "flex",
|
|
244
249
|
justifyContent: "space-between",
|
|
245
250
|
alignItems: "center",
|
|
246
|
-
marginBottom: "
|
|
247
|
-
paddingBottom: "
|
|
248
|
-
borderBottom: "1px solid #
|
|
251
|
+
marginBottom: "5rem",
|
|
252
|
+
paddingBottom: "2.5rem",
|
|
253
|
+
borderBottom: "1px solid #f8fafc"
|
|
249
254
|
},
|
|
250
255
|
logoContainer: {
|
|
251
256
|
display: "flex",
|
|
252
257
|
alignItems: "center",
|
|
253
258
|
textDecoration: "none",
|
|
254
|
-
marginRight: "
|
|
259
|
+
marginRight: "2rem"
|
|
255
260
|
},
|
|
256
261
|
divider: {
|
|
257
|
-
height: "
|
|
262
|
+
height: "2rem",
|
|
258
263
|
width: "1px",
|
|
259
264
|
backgroundColor: "#e2e8f0",
|
|
260
|
-
marginRight: "
|
|
265
|
+
marginRight: "2rem",
|
|
261
266
|
display: "block"
|
|
262
267
|
},
|
|
263
268
|
websiteContainer: {
|
|
264
269
|
display: "flex",
|
|
265
270
|
alignItems: "center",
|
|
266
|
-
gap: "0.
|
|
271
|
+
gap: "0.625rem",
|
|
267
272
|
textDecoration: "none",
|
|
268
|
-
color: "#
|
|
269
|
-
// Slate
|
|
270
|
-
fontWeight:
|
|
271
|
-
fontSize: "
|
|
273
|
+
color: "#64748b",
|
|
274
|
+
// Slate 500
|
|
275
|
+
fontWeight: 500,
|
|
276
|
+
fontSize: "0.925rem",
|
|
272
277
|
padding: "0.5rem 1rem",
|
|
273
278
|
backgroundColor: "#f8fafc",
|
|
274
|
-
borderRadius: "
|
|
279
|
+
borderRadius: "100px",
|
|
275
280
|
border: "1px solid #f1f5f9"
|
|
276
281
|
},
|
|
277
282
|
container: {
|
|
278
|
-
maxWidth: "
|
|
279
|
-
margin: "
|
|
280
|
-
padding: "
|
|
283
|
+
maxWidth: "1000px",
|
|
284
|
+
margin: "4rem auto",
|
|
285
|
+
padding: "6rem",
|
|
281
286
|
backgroundColor: "#ffffff",
|
|
282
|
-
borderRadius: "
|
|
283
|
-
boxShadow: "0
|
|
287
|
+
borderRadius: "32px",
|
|
288
|
+
boxShadow: "0 40px 100px -20px rgba(15, 23, 42, 0.08)",
|
|
284
289
|
border: "1px solid #f1f5f9",
|
|
285
290
|
fontFamily: '"Inter", system-ui, -apple-system, sans-serif',
|
|
286
291
|
color: "#1e293b",
|
|
287
292
|
// Slate 800
|
|
288
|
-
lineHeight: 1.
|
|
289
|
-
fontSize: "1.125rem"
|
|
293
|
+
lineHeight: 1.8,
|
|
294
|
+
fontSize: "1.125rem",
|
|
295
|
+
position: "relative",
|
|
296
|
+
overflow: "hidden"
|
|
290
297
|
},
|
|
291
298
|
mainHeading: {
|
|
292
|
-
fontSize: "
|
|
293
|
-
fontWeight:
|
|
294
|
-
color: "#
|
|
295
|
-
//
|
|
299
|
+
fontSize: "3.5rem",
|
|
300
|
+
fontWeight: 800,
|
|
301
|
+
color: "#0f172a",
|
|
302
|
+
// Slate 900
|
|
296
303
|
marginTop: "0",
|
|
297
|
-
marginBottom: "
|
|
298
|
-
letterSpacing: "-0.
|
|
299
|
-
lineHeight: 1.
|
|
304
|
+
marginBottom: "1.5rem",
|
|
305
|
+
letterSpacing: "-0.05em",
|
|
306
|
+
lineHeight: 1.05
|
|
300
307
|
},
|
|
301
308
|
metaData: {
|
|
302
309
|
color: "#64748b",
|
|
303
310
|
// Slate 500
|
|
304
311
|
fontSize: "0.925rem",
|
|
305
|
-
marginBottom: "
|
|
312
|
+
marginBottom: "5rem",
|
|
306
313
|
fontWeight: 500,
|
|
307
314
|
display: "flex",
|
|
308
|
-
gap: "
|
|
315
|
+
gap: "2rem",
|
|
316
|
+
padding: "1.25rem 2rem",
|
|
317
|
+
backgroundColor: "#f8fafc",
|
|
318
|
+
borderRadius: "1rem",
|
|
319
|
+
border: "1px solid #f1f5f9",
|
|
320
|
+
width: "fit-content"
|
|
309
321
|
},
|
|
310
322
|
section: {
|
|
311
|
-
marginBottom: "
|
|
323
|
+
marginBottom: "6rem"
|
|
312
324
|
},
|
|
313
325
|
sectionTitle: {
|
|
314
|
-
fontSize: "1.
|
|
315
|
-
fontWeight:
|
|
316
|
-
color: "#
|
|
317
|
-
|
|
318
|
-
marginBottom: "1.5rem",
|
|
326
|
+
fontSize: "1.875rem",
|
|
327
|
+
fontWeight: 700,
|
|
328
|
+
color: "#0f172a",
|
|
329
|
+
marginBottom: "2rem",
|
|
319
330
|
marginTop: 0,
|
|
320
|
-
letterSpacing: "-0.
|
|
331
|
+
letterSpacing: "-0.03em",
|
|
321
332
|
display: "flex",
|
|
322
333
|
alignItems: "center",
|
|
323
|
-
gap: "
|
|
334
|
+
gap: "1rem"
|
|
324
335
|
},
|
|
325
336
|
card: {
|
|
326
337
|
padding: "2.5rem",
|
|
327
|
-
backgroundColor: "#
|
|
328
|
-
// Primary 50
|
|
338
|
+
backgroundColor: "#ffffff",
|
|
329
339
|
borderRadius: "1.5rem",
|
|
330
|
-
border: "1px solid #
|
|
331
|
-
|
|
340
|
+
border: "1px solid #f1f5f9",
|
|
341
|
+
boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.02)",
|
|
342
|
+
marginBottom: "2.5rem",
|
|
343
|
+
display: "flex",
|
|
344
|
+
flexDirection: "column",
|
|
345
|
+
gap: "1rem"
|
|
332
346
|
},
|
|
333
347
|
paragraph: {
|
|
334
|
-
marginBottom: "1.
|
|
335
|
-
maxWidth: "
|
|
336
|
-
whiteSpace: "pre-line"
|
|
348
|
+
marginBottom: "1.75rem",
|
|
349
|
+
maxWidth: "70ch",
|
|
350
|
+
whiteSpace: "pre-line",
|
|
351
|
+
color: "#475569"
|
|
352
|
+
// Slate 600
|
|
337
353
|
},
|
|
338
354
|
link: {
|
|
339
|
-
color: "#
|
|
340
|
-
// Primary
|
|
355
|
+
color: "#0ea5e9",
|
|
356
|
+
// Primary 500
|
|
341
357
|
textDecoration: "none",
|
|
342
358
|
fontWeight: 600,
|
|
343
|
-
borderBottom: "
|
|
344
|
-
transition: "
|
|
359
|
+
borderBottom: "1.5px solid rgba(14, 165, 233, 0.2)",
|
|
360
|
+
transition: "all 0.2s",
|
|
345
361
|
cursor: "pointer"
|
|
346
362
|
},
|
|
347
363
|
list: {
|
|
348
364
|
listStyleType: "none",
|
|
349
365
|
paddingLeft: 0,
|
|
350
|
-
marginBottom: "
|
|
366
|
+
marginBottom: "2rem",
|
|
367
|
+
display: "flex",
|
|
368
|
+
flexDirection: "column",
|
|
369
|
+
gap: "1rem"
|
|
351
370
|
},
|
|
352
371
|
listItem: {
|
|
353
|
-
|
|
354
|
-
paddingLeft: "1.75rem",
|
|
372
|
+
padding: "1.25rem 1.75rem 1.25rem 3.5rem",
|
|
355
373
|
position: "relative",
|
|
356
|
-
|
|
374
|
+
backgroundColor: "#f8fafc",
|
|
375
|
+
borderRadius: "1rem",
|
|
376
|
+
border: "1px solid #f1f5f9",
|
|
377
|
+
fontSize: "1rem",
|
|
378
|
+
color: "#334155"
|
|
357
379
|
},
|
|
358
380
|
listBullet: {
|
|
359
381
|
position: "absolute",
|
|
360
|
-
left:
|
|
361
|
-
top: "
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
382
|
+
left: "1.5rem",
|
|
383
|
+
top: "50%",
|
|
384
|
+
transform: "translateY(-50%)",
|
|
385
|
+
width: "0.75rem",
|
|
386
|
+
height: "0.75rem",
|
|
387
|
+
borderRadius: "4px",
|
|
388
|
+
backgroundColor: "#0ea5e9",
|
|
389
|
+
opacity: 0.8
|
|
367
390
|
},
|
|
368
391
|
statusBadge: {
|
|
369
392
|
display: "inline-flex",
|
|
370
393
|
alignItems: "center",
|
|
371
|
-
padding: "0.
|
|
372
|
-
borderRadius: "
|
|
394
|
+
padding: "0.5rem 1.25rem",
|
|
395
|
+
borderRadius: "100px",
|
|
373
396
|
fontSize: "0.875rem",
|
|
374
|
-
fontWeight:
|
|
375
|
-
backgroundColor: complianceLevel === "full" ? "#
|
|
376
|
-
color: complianceLevel === "full" ? "#166534" : complianceLevel === "partial" ? "#
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
marginLeft: "0.5rem"
|
|
397
|
+
fontWeight: 600,
|
|
398
|
+
backgroundColor: complianceLevel === "full" ? "#f0fdf4" : complianceLevel === "partial" ? "#fffbeb" : "#fef2f2",
|
|
399
|
+
color: complianceLevel === "full" ? "#166534" : complianceLevel === "partial" ? "#92400e" : "#991b1b",
|
|
400
|
+
border: `1px solid ${complianceLevel === "full" ? "#dcfce7" : complianceLevel === "partial" ? "#fef3c7" : "#fee2e2"}`,
|
|
401
|
+
letterSpacing: "0.01em"
|
|
380
402
|
},
|
|
381
403
|
iconWrapper: {
|
|
382
404
|
display: "flex",
|
|
383
405
|
alignItems: "center",
|
|
384
406
|
justifyContent: "center",
|
|
385
|
-
width: "2.
|
|
386
|
-
height: "2.
|
|
387
|
-
borderRadius: "
|
|
388
|
-
backgroundColor: "#
|
|
389
|
-
boxShadow: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
407
|
+
width: "2.75rem",
|
|
408
|
+
height: "2.75rem",
|
|
409
|
+
borderRadius: "12px",
|
|
410
|
+
backgroundColor: "#f8fafc",
|
|
390
411
|
border: "1px solid #f1f5f9",
|
|
391
|
-
color: "#
|
|
412
|
+
color: "#0ea5e9"
|
|
392
413
|
}
|
|
393
414
|
};
|
|
394
415
|
const Logo = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
@@ -463,8 +484,23 @@ var AccessibilityStatement = ({
|
|
|
463
484
|
badgeUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: badgeUrl, alt: "Accessibility Badge", style: { height: "1.5rem", width: "auto" } }) })
|
|
464
485
|
] }),
|
|
465
486
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "statement-content", children: [
|
|
466
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
467
|
-
|
|
487
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { style: { marginBottom: "4rem" }, children: [
|
|
488
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { id: "a11y-statement-title", style: styles.mainHeading, children: renderTemplate(template.title) }),
|
|
489
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: styles.metaData, children: [
|
|
490
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
491
|
+
lang === "sv" ? "Status:" : "Status:",
|
|
492
|
+
" ",
|
|
493
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: styles.statusBadge, children: complianceLevel === "full" ? lang === "sv" ? "Fullt f\xF6renlig" : "Fully compliant" : complianceLevel === "partial" ? lang === "sv" ? "Delvis f\xF6renlig" : "Partially compliant" : lang === "sv" ? "Ej f\xF6renlig" : "Non-compliant" })
|
|
494
|
+
] }),
|
|
495
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { color: "#e2e8f0" }, children: "|" }),
|
|
496
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
497
|
+
lang === "sv" ? "Uppdaterad:" : "Updated:",
|
|
498
|
+
" ",
|
|
499
|
+
d(lastReviewDate)
|
|
500
|
+
] })
|
|
501
|
+
] })
|
|
502
|
+
] }),
|
|
503
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: { ...styles.paragraph, fontSize: "1.25rem", color: "#1e293b", fontWeight: 500, marginBottom: "4rem" }, children: renderTemplate(template.intro) }),
|
|
468
504
|
renderSections(template.sections)
|
|
469
505
|
] }),
|
|
470
506
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("footer", { style: { marginTop: "3rem", borderTop: "1px solid #e2e8f0", paddingTop: "1.5rem", fontSize: "0.875rem", color: "#64748b" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
|
|
@@ -25,6 +25,9 @@ __export(FormField_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(FormField_exports);
|
|
26
26
|
var import_react = require("react");
|
|
27
27
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
function sanitizeId(id) {
|
|
29
|
+
return id.replaceAll(":", "");
|
|
30
|
+
}
|
|
28
31
|
var FormField = (0, import_react.forwardRef)(
|
|
29
32
|
({
|
|
30
33
|
label,
|
|
@@ -36,7 +39,7 @@ var FormField = (0, import_react.forwardRef)(
|
|
|
36
39
|
style,
|
|
37
40
|
...props
|
|
38
41
|
}, ref) => {
|
|
39
|
-
const generatedId = (0, import_react.useId)();
|
|
42
|
+
const generatedId = sanitizeId((0, import_react.useId)());
|
|
40
43
|
const inputId = id || `input-${generatedId}`;
|
|
41
44
|
const helpTextId = `help-${generatedId}`;
|
|
42
45
|
const errorId = `error-${generatedId}`;
|
|
@@ -54,32 +57,33 @@ var FormField = (0, import_react.forwardRef)(
|
|
|
54
57
|
const labelStyle = {
|
|
55
58
|
marginBottom: "0.5rem",
|
|
56
59
|
fontWeight: "600",
|
|
57
|
-
color: "#
|
|
60
|
+
color: "#1e293b"
|
|
58
61
|
};
|
|
59
62
|
const inputStyle = {
|
|
60
63
|
padding: "0.5rem",
|
|
61
64
|
borderRadius: "4px",
|
|
62
|
-
border: error ? "2px solid #
|
|
65
|
+
border: error ? "2px solid #b91c1c" : "1px solid #94a3b8",
|
|
63
66
|
fontSize: "1rem",
|
|
67
|
+
color: "#0f172a",
|
|
64
68
|
minHeight: "44px"
|
|
65
69
|
// Touch target
|
|
66
70
|
};
|
|
67
71
|
const errorStyle = {
|
|
68
|
-
color: "#
|
|
72
|
+
color: "#b91c1c",
|
|
69
73
|
fontSize: "0.875rem",
|
|
70
74
|
marginTop: "0.25rem",
|
|
71
75
|
display: "flex",
|
|
72
76
|
alignItems: "center"
|
|
73
77
|
};
|
|
74
78
|
const helpStyle = {
|
|
75
|
-
color: "#
|
|
79
|
+
color: "#475569",
|
|
76
80
|
fontSize: "0.875rem",
|
|
77
81
|
marginTop: "0.25rem"
|
|
78
82
|
};
|
|
79
83
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: containerStyle, className, children: [
|
|
80
84
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { htmlFor: inputId, style: labelStyle, children: [
|
|
81
85
|
label,
|
|
82
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", style: { color: "#
|
|
86
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", style: { color: "#b91c1c", marginLeft: "4px" }, children: "*" }),
|
|
83
87
|
required && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: " (obligatoriskt)" })
|
|
84
88
|
] }),
|
|
85
89
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -87,9 +91,8 @@ var FormField = (0, import_react.forwardRef)(
|
|
|
87
91
|
{
|
|
88
92
|
ref,
|
|
89
93
|
id: inputId,
|
|
90
|
-
"aria-invalid":
|
|
94
|
+
"aria-invalid": error ? "true" : void 0,
|
|
91
95
|
"aria-describedby": describedBy || void 0,
|
|
92
|
-
"aria-required": required,
|
|
93
96
|
required,
|
|
94
97
|
style: inputStyle,
|
|
95
98
|
...props
|
|
@@ -84,7 +84,8 @@ var AccessibilityStatement = ({
|
|
|
84
84
|
badgeUrl,
|
|
85
85
|
publishDate
|
|
86
86
|
}) => {
|
|
87
|
-
const
|
|
87
|
+
const supportedLocales = { sv: "sv", no: "no", nb: "no" };
|
|
88
|
+
const lang = supportedLocales[locale] ?? "en";
|
|
88
89
|
const template = TEMPLATES[lang] || TEMPLATES.en;
|
|
89
90
|
const d = (date) => formatDiggDate(date, locale);
|
|
90
91
|
const enforcementBody = ENFORCEMENT_BODIES[country] || ENFORCEMENT_BODIES.EU;
|
|
@@ -175,15 +176,16 @@ var AccessibilityStatement = ({
|
|
|
175
176
|
} else if (section.id === "testing" || trimmed.includes("Hur vi testat") || trimmed.includes("How we tested") || trimmed.includes("Hvordan vi har testet") || trimmed.includes("Kuinka olemme testanneet") || trimmed.includes("Hoe wij de website hebben getest") || trimmed.includes("Erstellung dieser Erkl\xE4rung") || trimmed.includes("\xC9tablissement de cette d\xE9claration") || trimmed.includes("Preparaci\xF3n de la presente declaraci\xF3n")) {
|
|
176
177
|
IconNode = /* @__PURE__ */ jsx(IconWrapper, { children: /* @__PURE__ */ jsx(CheckCircleIcon, {}) });
|
|
177
178
|
}
|
|
179
|
+
const SectionHeader = /* @__PURE__ */ jsxs("h2", { style: styles.sectionTitle, children: [
|
|
180
|
+
IconNode,
|
|
181
|
+
section.title
|
|
182
|
+
] }, `h2-${i}`);
|
|
178
183
|
const blocks = trimmed.split("\n\n").map((block, bi) => {
|
|
179
184
|
const blockTrimmed = block.trim();
|
|
180
185
|
if (!blockTrimmed) return null;
|
|
181
186
|
if (blockTrimmed.startsWith("## ")) {
|
|
182
187
|
const title = blockTrimmed.replace("## ", "");
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
IconNode,
|
|
185
|
-
title
|
|
186
|
-
] }, `${i}-${bi}`);
|
|
188
|
+
return /* @__PURE__ */ jsx("h2", { style: styles.sectionTitle, children: title }, `${i}-${bi}`);
|
|
187
189
|
}
|
|
188
190
|
if (blockTrimmed.startsWith("### ")) {
|
|
189
191
|
return /* @__PURE__ */ jsx("h3", { style: { ...styles.sectionTitle, fontSize: "1.4rem" }, children: blockTrimmed.replace("### ", "") }, `${i}-${bi}`);
|
|
@@ -205,7 +207,10 @@ var AccessibilityStatement = ({
|
|
|
205
207
|
}
|
|
206
208
|
return /* @__PURE__ */ jsx("p", { style: styles.paragraph, children: blockTrimmed }, `${i}-${bi}`);
|
|
207
209
|
});
|
|
208
|
-
return /* @__PURE__ */
|
|
210
|
+
return /* @__PURE__ */ jsxs("section", { style: styles.section, children: [
|
|
211
|
+
SectionHeader,
|
|
212
|
+
blocks
|
|
213
|
+
] }, i);
|
|
209
214
|
});
|
|
210
215
|
};
|
|
211
216
|
const statementTools = getStatementToolsByCountry(country);
|
|
@@ -222,152 +227,168 @@ var AccessibilityStatement = ({
|
|
|
222
227
|
display: "flex",
|
|
223
228
|
justifyContent: "space-between",
|
|
224
229
|
alignItems: "center",
|
|
225
|
-
marginBottom: "
|
|
226
|
-
paddingBottom: "
|
|
227
|
-
borderBottom: "1px solid #
|
|
230
|
+
marginBottom: "5rem",
|
|
231
|
+
paddingBottom: "2.5rem",
|
|
232
|
+
borderBottom: "1px solid #f8fafc"
|
|
228
233
|
},
|
|
229
234
|
logoContainer: {
|
|
230
235
|
display: "flex",
|
|
231
236
|
alignItems: "center",
|
|
232
237
|
textDecoration: "none",
|
|
233
|
-
marginRight: "
|
|
238
|
+
marginRight: "2rem"
|
|
234
239
|
},
|
|
235
240
|
divider: {
|
|
236
|
-
height: "
|
|
241
|
+
height: "2rem",
|
|
237
242
|
width: "1px",
|
|
238
243
|
backgroundColor: "#e2e8f0",
|
|
239
|
-
marginRight: "
|
|
244
|
+
marginRight: "2rem",
|
|
240
245
|
display: "block"
|
|
241
246
|
},
|
|
242
247
|
websiteContainer: {
|
|
243
248
|
display: "flex",
|
|
244
249
|
alignItems: "center",
|
|
245
|
-
gap: "0.
|
|
250
|
+
gap: "0.625rem",
|
|
246
251
|
textDecoration: "none",
|
|
247
|
-
color: "#
|
|
248
|
-
// Slate
|
|
249
|
-
fontWeight:
|
|
250
|
-
fontSize: "
|
|
252
|
+
color: "#64748b",
|
|
253
|
+
// Slate 500
|
|
254
|
+
fontWeight: 500,
|
|
255
|
+
fontSize: "0.925rem",
|
|
251
256
|
padding: "0.5rem 1rem",
|
|
252
257
|
backgroundColor: "#f8fafc",
|
|
253
|
-
borderRadius: "
|
|
258
|
+
borderRadius: "100px",
|
|
254
259
|
border: "1px solid #f1f5f9"
|
|
255
260
|
},
|
|
256
261
|
container: {
|
|
257
|
-
maxWidth: "
|
|
258
|
-
margin: "
|
|
259
|
-
padding: "
|
|
262
|
+
maxWidth: "1000px",
|
|
263
|
+
margin: "4rem auto",
|
|
264
|
+
padding: "6rem",
|
|
260
265
|
backgroundColor: "#ffffff",
|
|
261
|
-
borderRadius: "
|
|
262
|
-
boxShadow: "0
|
|
266
|
+
borderRadius: "32px",
|
|
267
|
+
boxShadow: "0 40px 100px -20px rgba(15, 23, 42, 0.08)",
|
|
263
268
|
border: "1px solid #f1f5f9",
|
|
264
269
|
fontFamily: '"Inter", system-ui, -apple-system, sans-serif',
|
|
265
270
|
color: "#1e293b",
|
|
266
271
|
// Slate 800
|
|
267
|
-
lineHeight: 1.
|
|
268
|
-
fontSize: "1.125rem"
|
|
272
|
+
lineHeight: 1.8,
|
|
273
|
+
fontSize: "1.125rem",
|
|
274
|
+
position: "relative",
|
|
275
|
+
overflow: "hidden"
|
|
269
276
|
},
|
|
270
277
|
mainHeading: {
|
|
271
|
-
fontSize: "
|
|
272
|
-
fontWeight:
|
|
273
|
-
color: "#
|
|
274
|
-
//
|
|
278
|
+
fontSize: "3.5rem",
|
|
279
|
+
fontWeight: 800,
|
|
280
|
+
color: "#0f172a",
|
|
281
|
+
// Slate 900
|
|
275
282
|
marginTop: "0",
|
|
276
|
-
marginBottom: "
|
|
277
|
-
letterSpacing: "-0.
|
|
278
|
-
lineHeight: 1.
|
|
283
|
+
marginBottom: "1.5rem",
|
|
284
|
+
letterSpacing: "-0.05em",
|
|
285
|
+
lineHeight: 1.05
|
|
279
286
|
},
|
|
280
287
|
metaData: {
|
|
281
288
|
color: "#64748b",
|
|
282
289
|
// Slate 500
|
|
283
290
|
fontSize: "0.925rem",
|
|
284
|
-
marginBottom: "
|
|
291
|
+
marginBottom: "5rem",
|
|
285
292
|
fontWeight: 500,
|
|
286
293
|
display: "flex",
|
|
287
|
-
gap: "
|
|
294
|
+
gap: "2rem",
|
|
295
|
+
padding: "1.25rem 2rem",
|
|
296
|
+
backgroundColor: "#f8fafc",
|
|
297
|
+
borderRadius: "1rem",
|
|
298
|
+
border: "1px solid #f1f5f9",
|
|
299
|
+
width: "fit-content"
|
|
288
300
|
},
|
|
289
301
|
section: {
|
|
290
|
-
marginBottom: "
|
|
302
|
+
marginBottom: "6rem"
|
|
291
303
|
},
|
|
292
304
|
sectionTitle: {
|
|
293
|
-
fontSize: "1.
|
|
294
|
-
fontWeight:
|
|
295
|
-
color: "#
|
|
296
|
-
|
|
297
|
-
marginBottom: "1.5rem",
|
|
305
|
+
fontSize: "1.875rem",
|
|
306
|
+
fontWeight: 700,
|
|
307
|
+
color: "#0f172a",
|
|
308
|
+
marginBottom: "2rem",
|
|
298
309
|
marginTop: 0,
|
|
299
|
-
letterSpacing: "-0.
|
|
310
|
+
letterSpacing: "-0.03em",
|
|
300
311
|
display: "flex",
|
|
301
312
|
alignItems: "center",
|
|
302
|
-
gap: "
|
|
313
|
+
gap: "1rem"
|
|
303
314
|
},
|
|
304
315
|
card: {
|
|
305
316
|
padding: "2.5rem",
|
|
306
|
-
backgroundColor: "#
|
|
307
|
-
// Primary 50
|
|
317
|
+
backgroundColor: "#ffffff",
|
|
308
318
|
borderRadius: "1.5rem",
|
|
309
|
-
border: "1px solid #
|
|
310
|
-
|
|
319
|
+
border: "1px solid #f1f5f9",
|
|
320
|
+
boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.02)",
|
|
321
|
+
marginBottom: "2.5rem",
|
|
322
|
+
display: "flex",
|
|
323
|
+
flexDirection: "column",
|
|
324
|
+
gap: "1rem"
|
|
311
325
|
},
|
|
312
326
|
paragraph: {
|
|
313
|
-
marginBottom: "1.
|
|
314
|
-
maxWidth: "
|
|
315
|
-
whiteSpace: "pre-line"
|
|
327
|
+
marginBottom: "1.75rem",
|
|
328
|
+
maxWidth: "70ch",
|
|
329
|
+
whiteSpace: "pre-line",
|
|
330
|
+
color: "#475569"
|
|
331
|
+
// Slate 600
|
|
316
332
|
},
|
|
317
333
|
link: {
|
|
318
|
-
color: "#
|
|
319
|
-
// Primary
|
|
334
|
+
color: "#0ea5e9",
|
|
335
|
+
// Primary 500
|
|
320
336
|
textDecoration: "none",
|
|
321
337
|
fontWeight: 600,
|
|
322
|
-
borderBottom: "
|
|
323
|
-
transition: "
|
|
338
|
+
borderBottom: "1.5px solid rgba(14, 165, 233, 0.2)",
|
|
339
|
+
transition: "all 0.2s",
|
|
324
340
|
cursor: "pointer"
|
|
325
341
|
},
|
|
326
342
|
list: {
|
|
327
343
|
listStyleType: "none",
|
|
328
344
|
paddingLeft: 0,
|
|
329
|
-
marginBottom: "
|
|
345
|
+
marginBottom: "2rem",
|
|
346
|
+
display: "flex",
|
|
347
|
+
flexDirection: "column",
|
|
348
|
+
gap: "1rem"
|
|
330
349
|
},
|
|
331
350
|
listItem: {
|
|
332
|
-
|
|
333
|
-
paddingLeft: "1.75rem",
|
|
351
|
+
padding: "1.25rem 1.75rem 1.25rem 3.5rem",
|
|
334
352
|
position: "relative",
|
|
335
|
-
|
|
353
|
+
backgroundColor: "#f8fafc",
|
|
354
|
+
borderRadius: "1rem",
|
|
355
|
+
border: "1px solid #f1f5f9",
|
|
356
|
+
fontSize: "1rem",
|
|
357
|
+
color: "#334155"
|
|
336
358
|
},
|
|
337
359
|
listBullet: {
|
|
338
360
|
position: "absolute",
|
|
339
|
-
left:
|
|
340
|
-
top: "
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
361
|
+
left: "1.5rem",
|
|
362
|
+
top: "50%",
|
|
363
|
+
transform: "translateY(-50%)",
|
|
364
|
+
width: "0.75rem",
|
|
365
|
+
height: "0.75rem",
|
|
366
|
+
borderRadius: "4px",
|
|
367
|
+
backgroundColor: "#0ea5e9",
|
|
368
|
+
opacity: 0.8
|
|
346
369
|
},
|
|
347
370
|
statusBadge: {
|
|
348
371
|
display: "inline-flex",
|
|
349
372
|
alignItems: "center",
|
|
350
|
-
padding: "0.
|
|
351
|
-
borderRadius: "
|
|
373
|
+
padding: "0.5rem 1.25rem",
|
|
374
|
+
borderRadius: "100px",
|
|
352
375
|
fontSize: "0.875rem",
|
|
353
|
-
fontWeight:
|
|
354
|
-
backgroundColor: complianceLevel === "full" ? "#
|
|
355
|
-
color: complianceLevel === "full" ? "#166534" : complianceLevel === "partial" ? "#
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
marginLeft: "0.5rem"
|
|
376
|
+
fontWeight: 600,
|
|
377
|
+
backgroundColor: complianceLevel === "full" ? "#f0fdf4" : complianceLevel === "partial" ? "#fffbeb" : "#fef2f2",
|
|
378
|
+
color: complianceLevel === "full" ? "#166534" : complianceLevel === "partial" ? "#92400e" : "#991b1b",
|
|
379
|
+
border: `1px solid ${complianceLevel === "full" ? "#dcfce7" : complianceLevel === "partial" ? "#fef3c7" : "#fee2e2"}`,
|
|
380
|
+
letterSpacing: "0.01em"
|
|
359
381
|
},
|
|
360
382
|
iconWrapper: {
|
|
361
383
|
display: "flex",
|
|
362
384
|
alignItems: "center",
|
|
363
385
|
justifyContent: "center",
|
|
364
|
-
width: "2.
|
|
365
|
-
height: "2.
|
|
366
|
-
borderRadius: "
|
|
367
|
-
backgroundColor: "#
|
|
368
|
-
boxShadow: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
386
|
+
width: "2.75rem",
|
|
387
|
+
height: "2.75rem",
|
|
388
|
+
borderRadius: "12px",
|
|
389
|
+
backgroundColor: "#f8fafc",
|
|
369
390
|
border: "1px solid #f1f5f9",
|
|
370
|
-
color: "#
|
|
391
|
+
color: "#0ea5e9"
|
|
371
392
|
}
|
|
372
393
|
};
|
|
373
394
|
const Logo = () => /* @__PURE__ */ jsxs("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
@@ -442,8 +463,23 @@ var AccessibilityStatement = ({
|
|
|
442
463
|
badgeUrl && /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx("img", { src: badgeUrl, alt: "Accessibility Badge", style: { height: "1.5rem", width: "auto" } }) })
|
|
443
464
|
] }),
|
|
444
465
|
/* @__PURE__ */ jsxs("div", { className: "statement-content", children: [
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
-
|
|
466
|
+
/* @__PURE__ */ jsxs("header", { style: { marginBottom: "4rem" }, children: [
|
|
467
|
+
/* @__PURE__ */ jsx("h1", { id: "a11y-statement-title", style: styles.mainHeading, children: renderTemplate(template.title) }),
|
|
468
|
+
/* @__PURE__ */ jsxs("div", { style: styles.metaData, children: [
|
|
469
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
470
|
+
lang === "sv" ? "Status:" : "Status:",
|
|
471
|
+
" ",
|
|
472
|
+
/* @__PURE__ */ jsx("span", { style: styles.statusBadge, children: complianceLevel === "full" ? lang === "sv" ? "Fullt f\xF6renlig" : "Fully compliant" : complianceLevel === "partial" ? lang === "sv" ? "Delvis f\xF6renlig" : "Partially compliant" : lang === "sv" ? "Ej f\xF6renlig" : "Non-compliant" })
|
|
473
|
+
] }),
|
|
474
|
+
/* @__PURE__ */ jsx("span", { style: { color: "#e2e8f0" }, children: "|" }),
|
|
475
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
476
|
+
lang === "sv" ? "Uppdaterad:" : "Updated:",
|
|
477
|
+
" ",
|
|
478
|
+
d(lastReviewDate)
|
|
479
|
+
] })
|
|
480
|
+
] })
|
|
481
|
+
] }),
|
|
482
|
+
/* @__PURE__ */ jsx("p", { style: { ...styles.paragraph, fontSize: "1.25rem", color: "#1e293b", fontWeight: 500, marginBottom: "4rem" }, children: renderTemplate(template.intro) }),
|
|
447
483
|
renderSections(template.sections)
|
|
448
484
|
] }),
|
|
449
485
|
/* @__PURE__ */ jsx("footer", { style: { marginTop: "3rem", borderTop: "1px solid #e2e8f0", paddingTop: "1.5rem", fontSize: "0.875rem", color: "#64748b" }, children: /* @__PURE__ */ jsxs("p", { children: [
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// src/FormField/FormField.tsx
|
|
2
2
|
import { forwardRef, useId } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
function sanitizeId(id) {
|
|
5
|
+
return id.replaceAll(":", "");
|
|
6
|
+
}
|
|
4
7
|
var FormField = forwardRef(
|
|
5
8
|
({
|
|
6
9
|
label,
|
|
@@ -12,7 +15,7 @@ var FormField = forwardRef(
|
|
|
12
15
|
style,
|
|
13
16
|
...props
|
|
14
17
|
}, ref) => {
|
|
15
|
-
const generatedId = useId();
|
|
18
|
+
const generatedId = sanitizeId(useId());
|
|
16
19
|
const inputId = id || `input-${generatedId}`;
|
|
17
20
|
const helpTextId = `help-${generatedId}`;
|
|
18
21
|
const errorId = `error-${generatedId}`;
|
|
@@ -30,32 +33,33 @@ var FormField = forwardRef(
|
|
|
30
33
|
const labelStyle = {
|
|
31
34
|
marginBottom: "0.5rem",
|
|
32
35
|
fontWeight: "600",
|
|
33
|
-
color: "#
|
|
36
|
+
color: "#1e293b"
|
|
34
37
|
};
|
|
35
38
|
const inputStyle = {
|
|
36
39
|
padding: "0.5rem",
|
|
37
40
|
borderRadius: "4px",
|
|
38
|
-
border: error ? "2px solid #
|
|
41
|
+
border: error ? "2px solid #b91c1c" : "1px solid #94a3b8",
|
|
39
42
|
fontSize: "1rem",
|
|
43
|
+
color: "#0f172a",
|
|
40
44
|
minHeight: "44px"
|
|
41
45
|
// Touch target
|
|
42
46
|
};
|
|
43
47
|
const errorStyle = {
|
|
44
|
-
color: "#
|
|
48
|
+
color: "#b91c1c",
|
|
45
49
|
fontSize: "0.875rem",
|
|
46
50
|
marginTop: "0.25rem",
|
|
47
51
|
display: "flex",
|
|
48
52
|
alignItems: "center"
|
|
49
53
|
};
|
|
50
54
|
const helpStyle = {
|
|
51
|
-
color: "#
|
|
55
|
+
color: "#475569",
|
|
52
56
|
fontSize: "0.875rem",
|
|
53
57
|
marginTop: "0.25rem"
|
|
54
58
|
};
|
|
55
59
|
return /* @__PURE__ */ jsxs("div", { style: containerStyle, className, children: [
|
|
56
60
|
/* @__PURE__ */ jsxs("label", { htmlFor: inputId, style: labelStyle, children: [
|
|
57
61
|
label,
|
|
58
|
-
required && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: { color: "#
|
|
62
|
+
required && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: { color: "#b91c1c", marginLeft: "4px" }, children: "*" }),
|
|
59
63
|
required && /* @__PURE__ */ jsx("span", { className: "sr-only", children: " (obligatoriskt)" })
|
|
60
64
|
] }),
|
|
61
65
|
/* @__PURE__ */ jsx(
|
|
@@ -63,9 +67,8 @@ var FormField = forwardRef(
|
|
|
63
67
|
{
|
|
64
68
|
ref,
|
|
65
69
|
id: inputId,
|
|
66
|
-
"aria-invalid":
|
|
70
|
+
"aria-invalid": error ? "true" : void 0,
|
|
67
71
|
"aria-describedby": describedBy || void 0,
|
|
68
|
-
"aria-required": required,
|
|
69
72
|
required,
|
|
70
73
|
style: inputStyle,
|
|
71
74
|
...props
|
package/dist/index.js
CHANGED
|
@@ -169,6 +169,9 @@ Button.displayName = "Button";
|
|
|
169
169
|
// src/FormField/FormField.tsx
|
|
170
170
|
var import_react2 = require("react");
|
|
171
171
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
172
|
+
function sanitizeId(id) {
|
|
173
|
+
return id.replaceAll(":", "");
|
|
174
|
+
}
|
|
172
175
|
var FormField = (0, import_react2.forwardRef)(
|
|
173
176
|
({
|
|
174
177
|
label,
|
|
@@ -180,7 +183,7 @@ var FormField = (0, import_react2.forwardRef)(
|
|
|
180
183
|
style,
|
|
181
184
|
...props
|
|
182
185
|
}, ref) => {
|
|
183
|
-
const generatedId = (0, import_react2.useId)();
|
|
186
|
+
const generatedId = sanitizeId((0, import_react2.useId)());
|
|
184
187
|
const inputId = id || `input-${generatedId}`;
|
|
185
188
|
const helpTextId = `help-${generatedId}`;
|
|
186
189
|
const errorId = `error-${generatedId}`;
|
|
@@ -198,32 +201,33 @@ var FormField = (0, import_react2.forwardRef)(
|
|
|
198
201
|
const labelStyle = {
|
|
199
202
|
marginBottom: "0.5rem",
|
|
200
203
|
fontWeight: "600",
|
|
201
|
-
color: "#
|
|
204
|
+
color: "#1e293b"
|
|
202
205
|
};
|
|
203
206
|
const inputStyle = {
|
|
204
207
|
padding: "0.5rem",
|
|
205
208
|
borderRadius: "4px",
|
|
206
|
-
border: error ? "2px solid #
|
|
209
|
+
border: error ? "2px solid #b91c1c" : "1px solid #94a3b8",
|
|
207
210
|
fontSize: "1rem",
|
|
211
|
+
color: "#0f172a",
|
|
208
212
|
minHeight: "44px"
|
|
209
213
|
// Touch target
|
|
210
214
|
};
|
|
211
215
|
const errorStyle = {
|
|
212
|
-
color: "#
|
|
216
|
+
color: "#b91c1c",
|
|
213
217
|
fontSize: "0.875rem",
|
|
214
218
|
marginTop: "0.25rem",
|
|
215
219
|
display: "flex",
|
|
216
220
|
alignItems: "center"
|
|
217
221
|
};
|
|
218
222
|
const helpStyle = {
|
|
219
|
-
color: "#
|
|
223
|
+
color: "#475569",
|
|
220
224
|
fontSize: "0.875rem",
|
|
221
225
|
marginTop: "0.25rem"
|
|
222
226
|
};
|
|
223
227
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: containerStyle, className, children: [
|
|
224
228
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { htmlFor: inputId, style: labelStyle, children: [
|
|
225
229
|
label,
|
|
226
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": "true", style: { color: "#
|
|
230
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": "true", style: { color: "#b91c1c", marginLeft: "4px" }, children: "*" }),
|
|
227
231
|
required && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "sr-only", children: " (obligatoriskt)" })
|
|
228
232
|
] }),
|
|
229
233
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
@@ -231,9 +235,8 @@ var FormField = (0, import_react2.forwardRef)(
|
|
|
231
235
|
{
|
|
232
236
|
ref,
|
|
233
237
|
id: inputId,
|
|
234
|
-
"aria-invalid":
|
|
238
|
+
"aria-invalid": error ? "true" : void 0,
|
|
235
239
|
"aria-describedby": describedBy || void 0,
|
|
236
|
-
"aria-required": required,
|
|
237
240
|
required,
|
|
238
241
|
style: inputStyle,
|
|
239
242
|
...props
|
|
@@ -1330,7 +1333,8 @@ var AccessibilityStatement = ({
|
|
|
1330
1333
|
badgeUrl,
|
|
1331
1334
|
publishDate
|
|
1332
1335
|
}) => {
|
|
1333
|
-
const
|
|
1336
|
+
const supportedLocales = { sv: "sv", no: "no", nb: "no" };
|
|
1337
|
+
const lang = supportedLocales[locale] ?? "en";
|
|
1334
1338
|
const template = TEMPLATES[lang] || TEMPLATES.en;
|
|
1335
1339
|
const d = (date) => formatDiggDate(date, locale);
|
|
1336
1340
|
const enforcementBody = import_standards.ENFORCEMENT_BODIES[country] || import_standards.ENFORCEMENT_BODIES.EU;
|
|
@@ -1421,15 +1425,16 @@ var AccessibilityStatement = ({
|
|
|
1421
1425
|
} else if (section.id === "testing" || trimmed.includes("Hur vi testat") || trimmed.includes("How we tested") || trimmed.includes("Hvordan vi har testet") || trimmed.includes("Kuinka olemme testanneet") || trimmed.includes("Hoe wij de website hebben getest") || trimmed.includes("Erstellung dieser Erkl\xE4rung") || trimmed.includes("\xC9tablissement de cette d\xE9claration") || trimmed.includes("Preparaci\xF3n de la presente declaraci\xF3n")) {
|
|
1422
1426
|
IconNode = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IconWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CheckCircleIcon, {}) });
|
|
1423
1427
|
}
|
|
1428
|
+
const SectionHeader = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("h2", { style: styles.sectionTitle, children: [
|
|
1429
|
+
IconNode,
|
|
1430
|
+
section.title
|
|
1431
|
+
] }, `h2-${i}`);
|
|
1424
1432
|
const blocks = trimmed.split("\n\n").map((block, bi) => {
|
|
1425
1433
|
const blockTrimmed = block.trim();
|
|
1426
1434
|
if (!blockTrimmed) return null;
|
|
1427
1435
|
if (blockTrimmed.startsWith("## ")) {
|
|
1428
1436
|
const title = blockTrimmed.replace("## ", "");
|
|
1429
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.
|
|
1430
|
-
IconNode,
|
|
1431
|
-
title
|
|
1432
|
-
] }, `${i}-${bi}`);
|
|
1437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { style: styles.sectionTitle, children: title }, `${i}-${bi}`);
|
|
1433
1438
|
}
|
|
1434
1439
|
if (blockTrimmed.startsWith("### ")) {
|
|
1435
1440
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h3", { style: { ...styles.sectionTitle, fontSize: "1.4rem" }, children: blockTrimmed.replace("### ", "") }, `${i}-${bi}`);
|
|
@@ -1451,7 +1456,10 @@ var AccessibilityStatement = ({
|
|
|
1451
1456
|
}
|
|
1452
1457
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: styles.paragraph, children: blockTrimmed }, `${i}-${bi}`);
|
|
1453
1458
|
});
|
|
1454
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.
|
|
1459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("section", { style: styles.section, children: [
|
|
1460
|
+
SectionHeader,
|
|
1461
|
+
blocks
|
|
1462
|
+
] }, i);
|
|
1455
1463
|
});
|
|
1456
1464
|
};
|
|
1457
1465
|
const statementTools = (0, import_standards.getStatementToolsByCountry)(country);
|
|
@@ -1468,152 +1476,168 @@ var AccessibilityStatement = ({
|
|
|
1468
1476
|
display: "flex",
|
|
1469
1477
|
justifyContent: "space-between",
|
|
1470
1478
|
alignItems: "center",
|
|
1471
|
-
marginBottom: "
|
|
1472
|
-
paddingBottom: "
|
|
1473
|
-
borderBottom: "1px solid #
|
|
1479
|
+
marginBottom: "5rem",
|
|
1480
|
+
paddingBottom: "2.5rem",
|
|
1481
|
+
borderBottom: "1px solid #f8fafc"
|
|
1474
1482
|
},
|
|
1475
1483
|
logoContainer: {
|
|
1476
1484
|
display: "flex",
|
|
1477
1485
|
alignItems: "center",
|
|
1478
1486
|
textDecoration: "none",
|
|
1479
|
-
marginRight: "
|
|
1487
|
+
marginRight: "2rem"
|
|
1480
1488
|
},
|
|
1481
1489
|
divider: {
|
|
1482
|
-
height: "
|
|
1490
|
+
height: "2rem",
|
|
1483
1491
|
width: "1px",
|
|
1484
1492
|
backgroundColor: "#e2e8f0",
|
|
1485
|
-
marginRight: "
|
|
1493
|
+
marginRight: "2rem",
|
|
1486
1494
|
display: "block"
|
|
1487
1495
|
},
|
|
1488
1496
|
websiteContainer: {
|
|
1489
1497
|
display: "flex",
|
|
1490
1498
|
alignItems: "center",
|
|
1491
|
-
gap: "0.
|
|
1499
|
+
gap: "0.625rem",
|
|
1492
1500
|
textDecoration: "none",
|
|
1493
|
-
color: "#
|
|
1494
|
-
// Slate
|
|
1495
|
-
fontWeight:
|
|
1496
|
-
fontSize: "
|
|
1501
|
+
color: "#64748b",
|
|
1502
|
+
// Slate 500
|
|
1503
|
+
fontWeight: 500,
|
|
1504
|
+
fontSize: "0.925rem",
|
|
1497
1505
|
padding: "0.5rem 1rem",
|
|
1498
1506
|
backgroundColor: "#f8fafc",
|
|
1499
|
-
borderRadius: "
|
|
1507
|
+
borderRadius: "100px",
|
|
1500
1508
|
border: "1px solid #f1f5f9"
|
|
1501
1509
|
},
|
|
1502
1510
|
container: {
|
|
1503
|
-
maxWidth: "
|
|
1504
|
-
margin: "
|
|
1505
|
-
padding: "
|
|
1511
|
+
maxWidth: "1000px",
|
|
1512
|
+
margin: "4rem auto",
|
|
1513
|
+
padding: "6rem",
|
|
1506
1514
|
backgroundColor: "#ffffff",
|
|
1507
|
-
borderRadius: "
|
|
1508
|
-
boxShadow: "0
|
|
1515
|
+
borderRadius: "32px",
|
|
1516
|
+
boxShadow: "0 40px 100px -20px rgba(15, 23, 42, 0.08)",
|
|
1509
1517
|
border: "1px solid #f1f5f9",
|
|
1510
1518
|
fontFamily: '"Inter", system-ui, -apple-system, sans-serif',
|
|
1511
1519
|
color: "#1e293b",
|
|
1512
1520
|
// Slate 800
|
|
1513
|
-
lineHeight: 1.
|
|
1514
|
-
fontSize: "1.125rem"
|
|
1521
|
+
lineHeight: 1.8,
|
|
1522
|
+
fontSize: "1.125rem",
|
|
1523
|
+
position: "relative",
|
|
1524
|
+
overflow: "hidden"
|
|
1515
1525
|
},
|
|
1516
1526
|
mainHeading: {
|
|
1517
|
-
fontSize: "
|
|
1518
|
-
fontWeight:
|
|
1519
|
-
color: "#
|
|
1520
|
-
//
|
|
1527
|
+
fontSize: "3.5rem",
|
|
1528
|
+
fontWeight: 800,
|
|
1529
|
+
color: "#0f172a",
|
|
1530
|
+
// Slate 900
|
|
1521
1531
|
marginTop: "0",
|
|
1522
|
-
marginBottom: "
|
|
1523
|
-
letterSpacing: "-0.
|
|
1524
|
-
lineHeight: 1.
|
|
1532
|
+
marginBottom: "1.5rem",
|
|
1533
|
+
letterSpacing: "-0.05em",
|
|
1534
|
+
lineHeight: 1.05
|
|
1525
1535
|
},
|
|
1526
1536
|
metaData: {
|
|
1527
1537
|
color: "#64748b",
|
|
1528
1538
|
// Slate 500
|
|
1529
1539
|
fontSize: "0.925rem",
|
|
1530
|
-
marginBottom: "
|
|
1540
|
+
marginBottom: "5rem",
|
|
1531
1541
|
fontWeight: 500,
|
|
1532
1542
|
display: "flex",
|
|
1533
|
-
gap: "
|
|
1543
|
+
gap: "2rem",
|
|
1544
|
+
padding: "1.25rem 2rem",
|
|
1545
|
+
backgroundColor: "#f8fafc",
|
|
1546
|
+
borderRadius: "1rem",
|
|
1547
|
+
border: "1px solid #f1f5f9",
|
|
1548
|
+
width: "fit-content"
|
|
1534
1549
|
},
|
|
1535
1550
|
section: {
|
|
1536
|
-
marginBottom: "
|
|
1551
|
+
marginBottom: "6rem"
|
|
1537
1552
|
},
|
|
1538
1553
|
sectionTitle: {
|
|
1539
|
-
fontSize: "1.
|
|
1540
|
-
fontWeight:
|
|
1541
|
-
color: "#
|
|
1542
|
-
|
|
1543
|
-
marginBottom: "1.5rem",
|
|
1554
|
+
fontSize: "1.875rem",
|
|
1555
|
+
fontWeight: 700,
|
|
1556
|
+
color: "#0f172a",
|
|
1557
|
+
marginBottom: "2rem",
|
|
1544
1558
|
marginTop: 0,
|
|
1545
|
-
letterSpacing: "-0.
|
|
1559
|
+
letterSpacing: "-0.03em",
|
|
1546
1560
|
display: "flex",
|
|
1547
1561
|
alignItems: "center",
|
|
1548
|
-
gap: "
|
|
1562
|
+
gap: "1rem"
|
|
1549
1563
|
},
|
|
1550
1564
|
card: {
|
|
1551
1565
|
padding: "2.5rem",
|
|
1552
|
-
backgroundColor: "#
|
|
1553
|
-
// Primary 50
|
|
1566
|
+
backgroundColor: "#ffffff",
|
|
1554
1567
|
borderRadius: "1.5rem",
|
|
1555
|
-
border: "1px solid #
|
|
1556
|
-
|
|
1568
|
+
border: "1px solid #f1f5f9",
|
|
1569
|
+
boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.02)",
|
|
1570
|
+
marginBottom: "2.5rem",
|
|
1571
|
+
display: "flex",
|
|
1572
|
+
flexDirection: "column",
|
|
1573
|
+
gap: "1rem"
|
|
1557
1574
|
},
|
|
1558
1575
|
paragraph: {
|
|
1559
|
-
marginBottom: "1.
|
|
1560
|
-
maxWidth: "
|
|
1561
|
-
whiteSpace: "pre-line"
|
|
1576
|
+
marginBottom: "1.75rem",
|
|
1577
|
+
maxWidth: "70ch",
|
|
1578
|
+
whiteSpace: "pre-line",
|
|
1579
|
+
color: "#475569"
|
|
1580
|
+
// Slate 600
|
|
1562
1581
|
},
|
|
1563
1582
|
link: {
|
|
1564
|
-
color: "#
|
|
1565
|
-
// Primary
|
|
1583
|
+
color: "#0ea5e9",
|
|
1584
|
+
// Primary 500
|
|
1566
1585
|
textDecoration: "none",
|
|
1567
1586
|
fontWeight: 600,
|
|
1568
|
-
borderBottom: "
|
|
1569
|
-
transition: "
|
|
1587
|
+
borderBottom: "1.5px solid rgba(14, 165, 233, 0.2)",
|
|
1588
|
+
transition: "all 0.2s",
|
|
1570
1589
|
cursor: "pointer"
|
|
1571
1590
|
},
|
|
1572
1591
|
list: {
|
|
1573
1592
|
listStyleType: "none",
|
|
1574
1593
|
paddingLeft: 0,
|
|
1575
|
-
marginBottom: "
|
|
1594
|
+
marginBottom: "2rem",
|
|
1595
|
+
display: "flex",
|
|
1596
|
+
flexDirection: "column",
|
|
1597
|
+
gap: "1rem"
|
|
1576
1598
|
},
|
|
1577
1599
|
listItem: {
|
|
1578
|
-
|
|
1579
|
-
paddingLeft: "1.75rem",
|
|
1600
|
+
padding: "1.25rem 1.75rem 1.25rem 3.5rem",
|
|
1580
1601
|
position: "relative",
|
|
1581
|
-
|
|
1602
|
+
backgroundColor: "#f8fafc",
|
|
1603
|
+
borderRadius: "1rem",
|
|
1604
|
+
border: "1px solid #f1f5f9",
|
|
1605
|
+
fontSize: "1rem",
|
|
1606
|
+
color: "#334155"
|
|
1582
1607
|
},
|
|
1583
1608
|
listBullet: {
|
|
1584
1609
|
position: "absolute",
|
|
1585
|
-
left:
|
|
1586
|
-
top: "
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1610
|
+
left: "1.5rem",
|
|
1611
|
+
top: "50%",
|
|
1612
|
+
transform: "translateY(-50%)",
|
|
1613
|
+
width: "0.75rem",
|
|
1614
|
+
height: "0.75rem",
|
|
1615
|
+
borderRadius: "4px",
|
|
1616
|
+
backgroundColor: "#0ea5e9",
|
|
1617
|
+
opacity: 0.8
|
|
1592
1618
|
},
|
|
1593
1619
|
statusBadge: {
|
|
1594
1620
|
display: "inline-flex",
|
|
1595
1621
|
alignItems: "center",
|
|
1596
|
-
padding: "0.
|
|
1597
|
-
borderRadius: "
|
|
1622
|
+
padding: "0.5rem 1.25rem",
|
|
1623
|
+
borderRadius: "100px",
|
|
1598
1624
|
fontSize: "0.875rem",
|
|
1599
|
-
fontWeight:
|
|
1600
|
-
backgroundColor: complianceLevel === "full" ? "#
|
|
1601
|
-
color: complianceLevel === "full" ? "#166534" : complianceLevel === "partial" ? "#
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
marginLeft: "0.5rem"
|
|
1625
|
+
fontWeight: 600,
|
|
1626
|
+
backgroundColor: complianceLevel === "full" ? "#f0fdf4" : complianceLevel === "partial" ? "#fffbeb" : "#fef2f2",
|
|
1627
|
+
color: complianceLevel === "full" ? "#166534" : complianceLevel === "partial" ? "#92400e" : "#991b1b",
|
|
1628
|
+
border: `1px solid ${complianceLevel === "full" ? "#dcfce7" : complianceLevel === "partial" ? "#fef3c7" : "#fee2e2"}`,
|
|
1629
|
+
letterSpacing: "0.01em"
|
|
1605
1630
|
},
|
|
1606
1631
|
iconWrapper: {
|
|
1607
1632
|
display: "flex",
|
|
1608
1633
|
alignItems: "center",
|
|
1609
1634
|
justifyContent: "center",
|
|
1610
|
-
width: "2.
|
|
1611
|
-
height: "2.
|
|
1612
|
-
borderRadius: "
|
|
1613
|
-
backgroundColor: "#
|
|
1614
|
-
boxShadow: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
1635
|
+
width: "2.75rem",
|
|
1636
|
+
height: "2.75rem",
|
|
1637
|
+
borderRadius: "12px",
|
|
1638
|
+
backgroundColor: "#f8fafc",
|
|
1615
1639
|
border: "1px solid #f1f5f9",
|
|
1616
|
-
color: "#
|
|
1640
|
+
color: "#0ea5e9"
|
|
1617
1641
|
}
|
|
1618
1642
|
};
|
|
1619
1643
|
const Logo = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
@@ -1688,8 +1712,23 @@ var AccessibilityStatement = ({
|
|
|
1688
1712
|
badgeUrl && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { src: badgeUrl, alt: "Accessibility Badge", style: { height: "1.5rem", width: "auto" } }) })
|
|
1689
1713
|
] }),
|
|
1690
1714
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "statement-content", children: [
|
|
1691
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.
|
|
1692
|
-
|
|
1715
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("header", { style: { marginBottom: "4rem" }, children: [
|
|
1716
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h1", { id: "a11y-statement-title", style: styles.mainHeading, children: renderTemplate(template.title) }),
|
|
1717
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: styles.metaData, children: [
|
|
1718
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { children: [
|
|
1719
|
+
lang === "sv" ? "Status:" : "Status:",
|
|
1720
|
+
" ",
|
|
1721
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: styles.statusBadge, children: complianceLevel === "full" ? lang === "sv" ? "Fullt f\xF6renlig" : "Fully compliant" : complianceLevel === "partial" ? lang === "sv" ? "Delvis f\xF6renlig" : "Partially compliant" : lang === "sv" ? "Ej f\xF6renlig" : "Non-compliant" })
|
|
1722
|
+
] }),
|
|
1723
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { color: "#e2e8f0" }, children: "|" }),
|
|
1724
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { children: [
|
|
1725
|
+
lang === "sv" ? "Uppdaterad:" : "Updated:",
|
|
1726
|
+
" ",
|
|
1727
|
+
d(lastReviewDate)
|
|
1728
|
+
] })
|
|
1729
|
+
] })
|
|
1730
|
+
] }),
|
|
1731
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { ...styles.paragraph, fontSize: "1.25rem", color: "#1e293b", fontWeight: 500, marginBottom: "4rem" }, children: renderTemplate(template.intro) }),
|
|
1693
1732
|
renderSections(template.sections)
|
|
1694
1733
|
] }),
|
|
1695
1734
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("footer", { style: { marginTop: "3rem", borderTop: "1px solid #e2e8f0", paddingTop: "1.5rem", fontSize: "0.875rem", color: "#64748b" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { children: [
|
package/dist/index.mjs
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from "./chunk-P2IXX552.mjs";
|
|
35
35
|
import {
|
|
36
36
|
FormField
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-ZO5YRJQG.mjs";
|
|
38
38
|
import {
|
|
39
39
|
Heading
|
|
40
40
|
} from "./chunk-2RP6SWY7.mjs";
|
|
@@ -55,19 +55,19 @@ import {
|
|
|
55
55
|
} from "./chunk-GK4BYT56.mjs";
|
|
56
56
|
import {
|
|
57
57
|
AccessibilityStatement
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-LBRVCJHL.mjs";
|
|
59
59
|
import {
|
|
60
60
|
Button
|
|
61
61
|
} from "./chunk-MYXIUDCP.mjs";
|
|
62
62
|
import {
|
|
63
63
|
Checkbox
|
|
64
64
|
} from "./chunk-NOE5QKC2.mjs";
|
|
65
|
-
import {
|
|
66
|
-
Card
|
|
67
|
-
} from "./chunk-NECEXNCF.mjs";
|
|
68
65
|
import {
|
|
69
66
|
Combobox
|
|
70
67
|
} from "./chunk-OMSIXECN.mjs";
|
|
68
|
+
import {
|
|
69
|
+
Card
|
|
70
|
+
} from "./chunk-NECEXNCF.mjs";
|
|
71
71
|
import {
|
|
72
72
|
DataTable
|
|
73
73
|
} from "./chunk-HSUDZAQ6.mjs";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holmdigital/components",
|
|
3
3
|
"author": "Holm Digital AB",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.2",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"jsdom": "^28.0.0",
|
|
150
150
|
"react": "^18.2.0",
|
|
151
151
|
"react-dom": "^18.2.0",
|
|
152
|
-
"storybook": "^10.2.
|
|
152
|
+
"storybook": "^10.2.13",
|
|
153
153
|
"tsup": "^8.3.5",
|
|
154
154
|
"typescript": "^5.7.2"
|
|
155
155
|
},
|