rk-designsystem 1.3.0 → 1.3.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/README.md +14 -7
- package/dist/assets/images/ChevronLeftIcon.js +31 -0
- package/dist/assets/images/ChevronRightIcon.js +31 -0
- package/dist/components/Alert/index.js +16 -0
- package/dist/components/Avatar/index.js +9 -0
- package/dist/components/Badge/index.js +11 -0
- package/dist/components/Breadcrumbs/index.js +9 -0
- package/dist/components/Button/index.js +11 -0
- package/dist/components/Card/index.js +8 -0
- package/dist/components/Carousel/index.js +379 -0
- package/dist/components/Carousel/styles.module.css.js +38 -0
- package/dist/components/Checkbox/index.js +10 -0
- package/dist/components/Chip/index.js +6 -0
- package/dist/components/DateInput/index.js +258 -0
- package/dist/components/DateInput/styles.module.css.js +20 -0
- package/dist/components/DatePicker/index.js +360 -0
- package/dist/components/DatePicker/styles.module.css.js +30 -0
- package/dist/components/Details/index.js +6 -0
- package/dist/components/Dialog/index.js +6 -0
- package/dist/components/Divider/index.js +6 -0
- package/dist/components/Donor/index.js +382 -0
- package/dist/components/Donor/styles.module.css.js +42 -0
- package/dist/components/Dropdown/index.js +12 -0
- package/dist/components/ErrorSummary/index.js +6 -0
- package/dist/components/Field/index.js +10 -0
- package/dist/components/Fieldset/index.js +6 -0
- package/dist/components/Footer/index.js +722 -0
- package/dist/components/Footer/styles.module.css.js +138 -0
- package/dist/components/GraphicElement/index.js +317 -0
- package/dist/components/GraphicElement/styles.module.css.js +16 -0
- package/dist/components/Header/index.js +677 -0
- package/dist/components/Header/styles.module.css.js +114 -0
- package/dist/components/Heading/index.js +9 -0
- package/dist/components/Input/index.js +7 -0
- package/dist/components/Label/index.js +9 -0
- package/dist/components/Link/index.js +6 -0
- package/dist/components/List/index.js +6 -0
- package/dist/components/Pagination/index.js +11 -0
- package/dist/components/Paragraph/index.js +11 -0
- package/dist/components/Popover/index.js +6 -0
- package/dist/components/Radio/index.js +7 -0
- package/dist/components/Search/index.js +10 -0
- package/dist/components/Select/index.js +6 -0
- package/dist/components/SkeletonLoader/index.js +6 -0
- package/dist/components/SkipLink/index.js +6 -0
- package/dist/components/SpinnerLoader/index.js +6 -0
- package/dist/components/Suggestion/index.js +7 -0
- package/dist/components/Switch/index.js +6 -0
- package/dist/components/Table/index.js +6 -0
- package/dist/components/Tabs/index.js +6 -0
- package/dist/components/Tag/index.js +14 -0
- package/dist/components/Textarea/index.js +6 -0
- package/dist/components/Textfield/index.js +6 -0
- package/dist/components/ToggleGroup/index.js +6 -0
- package/dist/components/Tooltip/index.js +6 -0
- package/dist/components/ValidationMessage/index.js +9 -0
- package/dist/context/LanguageContext.js +91 -0
- package/dist/index.d.ts +170 -147
- package/dist/index.js +118 -0
- package/dist/rk-designsystem.css +1 -1
- package/dist/{componentlibrary.es.js → translations/index.js} +267 -3904
- package/dist/utils/search-index.js +106 -0
- package/package.json +21 -35
- package/dist/componentlibrary.umd.js +0 -1266
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const e = "_header_1imer_1", n = "_languageSwitch_1imer_56", t = "_searchOverlay_1imer_60", o = "_headerExtension_1imer_65", s = "_headerExtensionTinted_1imer_93", i = "_languageLabel_1imer_101", _ = "_languageLink_1imer_106", r = "_extensionContent_1imer_111", m = "_extensionDivider_1imer_116", a = "_extensionContentWrapper_1imer_121", c = "_headerInner_1imer_201", l = "_logoWrapper_1imer_218", u = "_logo_1imer_218", g = "_secondaryLogoWrapper_1imer_241", h = "_slotComponent_1imer_250", L = "_slotContainer_1imer_260", d = "_slotText_1imer_268", x = "_secondaryLogo_1imer_241", p = "_redCrossLogo_1imer_295", C = "_primaryLogo_1imer_306", T = "_navItems_1imer_310", v = "_navLink_1imer_319", y = "_actions_1imer_332", k = "_ctaButton_1imer_340", I = "_themeToggle_1imer_345", B = "_userInfo_1imer_350", W = "_userName_1imer_356", R = "_loginLink_1imer_363", f = "_loginText_1imer_372", b = "_underline_1imer_379", w = "_searchButtonWrapper_1imer_385", E = "_buttonText_1imer_389", O = "_menuButton_1imer_394", S = "_menuOverlay_1imer_399", A = "_searchContent_1imer_433", D = "_menuContent_1imer_443", N = "_menuLeftColumn_1imer_452", U = "_menuRightColumn_1imer_458", j = "_slotContent_1imer_472", q = "_navList_1imer_485", z = "_menuUtilities_1imer_492", F = "_menuBrand_1imer_499", G = "_suggestionsSection_1imer_503", H = "_suggestionsTitle_1imer_509", J = "_searchResults_1imer_518", K = "_resultList_1imer_524", M = "_resultItem_1imer_530", P = "_resultLink_1imer_538", Q = "_suggestionIcon_1imer_552", V = "_suggestionText_1imer_565", X = "_highlightedText_1imer_572", Y = "_remainingText_1imer_577", Z = "_viewAllLink_1imer_590", $ = "_noResults_1imer_625", ee = {
|
|
3
|
+
header: e,
|
|
4
|
+
languageSwitch: n,
|
|
5
|
+
searchOverlay: t,
|
|
6
|
+
headerExtension: o,
|
|
7
|
+
headerExtensionTinted: s,
|
|
8
|
+
languageLabel: i,
|
|
9
|
+
languageLink: _,
|
|
10
|
+
extensionContent: r,
|
|
11
|
+
extensionDivider: m,
|
|
12
|
+
extensionContentWrapper: a,
|
|
13
|
+
headerInner: c,
|
|
14
|
+
logoWrapper: l,
|
|
15
|
+
logo: u,
|
|
16
|
+
secondaryLogoWrapper: g,
|
|
17
|
+
slotComponent: h,
|
|
18
|
+
slotContainer: L,
|
|
19
|
+
slotText: d,
|
|
20
|
+
secondaryLogo: x,
|
|
21
|
+
redCrossLogo: p,
|
|
22
|
+
primaryLogo: C,
|
|
23
|
+
navItems: T,
|
|
24
|
+
navLink: v,
|
|
25
|
+
actions: y,
|
|
26
|
+
ctaButton: k,
|
|
27
|
+
themeToggle: I,
|
|
28
|
+
userInfo: B,
|
|
29
|
+
userName: W,
|
|
30
|
+
loginLink: R,
|
|
31
|
+
loginText: f,
|
|
32
|
+
underline: b,
|
|
33
|
+
searchButtonWrapper: w,
|
|
34
|
+
buttonText: E,
|
|
35
|
+
menuButton: O,
|
|
36
|
+
menuOverlay: S,
|
|
37
|
+
searchContent: A,
|
|
38
|
+
menuContent: D,
|
|
39
|
+
menuLeftColumn: N,
|
|
40
|
+
menuRightColumn: U,
|
|
41
|
+
slotContent: j,
|
|
42
|
+
navList: q,
|
|
43
|
+
menuUtilities: z,
|
|
44
|
+
menuBrand: F,
|
|
45
|
+
suggestionsSection: G,
|
|
46
|
+
suggestionsTitle: H,
|
|
47
|
+
searchResults: J,
|
|
48
|
+
resultList: K,
|
|
49
|
+
resultItem: M,
|
|
50
|
+
resultLink: P,
|
|
51
|
+
suggestionIcon: Q,
|
|
52
|
+
suggestionText: V,
|
|
53
|
+
highlightedText: X,
|
|
54
|
+
remainingText: Y,
|
|
55
|
+
viewAllLink: Z,
|
|
56
|
+
noResults: $
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
y as actions,
|
|
60
|
+
E as buttonText,
|
|
61
|
+
k as ctaButton,
|
|
62
|
+
ee as default,
|
|
63
|
+
r as extensionContent,
|
|
64
|
+
a as extensionContentWrapper,
|
|
65
|
+
m as extensionDivider,
|
|
66
|
+
e as header,
|
|
67
|
+
o as headerExtension,
|
|
68
|
+
s as headerExtensionTinted,
|
|
69
|
+
c as headerInner,
|
|
70
|
+
X as highlightedText,
|
|
71
|
+
i as languageLabel,
|
|
72
|
+
_ as languageLink,
|
|
73
|
+
n as languageSwitch,
|
|
74
|
+
R as loginLink,
|
|
75
|
+
f as loginText,
|
|
76
|
+
u as logo,
|
|
77
|
+
l as logoWrapper,
|
|
78
|
+
F as menuBrand,
|
|
79
|
+
O as menuButton,
|
|
80
|
+
D as menuContent,
|
|
81
|
+
N as menuLeftColumn,
|
|
82
|
+
S as menuOverlay,
|
|
83
|
+
U as menuRightColumn,
|
|
84
|
+
z as menuUtilities,
|
|
85
|
+
T as navItems,
|
|
86
|
+
v as navLink,
|
|
87
|
+
q as navList,
|
|
88
|
+
$ as noResults,
|
|
89
|
+
C as primaryLogo,
|
|
90
|
+
p as redCrossLogo,
|
|
91
|
+
Y as remainingText,
|
|
92
|
+
M as resultItem,
|
|
93
|
+
P as resultLink,
|
|
94
|
+
K as resultList,
|
|
95
|
+
w as searchButtonWrapper,
|
|
96
|
+
A as searchContent,
|
|
97
|
+
t as searchOverlay,
|
|
98
|
+
J as searchResults,
|
|
99
|
+
x as secondaryLogo,
|
|
100
|
+
g as secondaryLogoWrapper,
|
|
101
|
+
h as slotComponent,
|
|
102
|
+
L as slotContainer,
|
|
103
|
+
j as slotContent,
|
|
104
|
+
d as slotText,
|
|
105
|
+
Q as suggestionIcon,
|
|
106
|
+
V as suggestionText,
|
|
107
|
+
G as suggestionsSection,
|
|
108
|
+
H as suggestionsTitle,
|
|
109
|
+
I as themeToggle,
|
|
110
|
+
b as underline,
|
|
111
|
+
B as userInfo,
|
|
112
|
+
W as userName,
|
|
113
|
+
Z as viewAllLink
|
|
114
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as o } from "react";
|
|
4
|
+
import { Heading as a } from "@digdir/designsystemet-react";
|
|
5
|
+
const m = o((r, e) => /* @__PURE__ */ i(a, { ref: e, ...r }));
|
|
6
|
+
m.displayName = "Heading";
|
|
7
|
+
export {
|
|
8
|
+
m as Heading
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
4
|
+
import { Label as m } from "@digdir/designsystemet-react";
|
|
5
|
+
const t = a((r, e) => /* @__PURE__ */ o(m, { ref: e, ...r }));
|
|
6
|
+
t.displayName = "Label";
|
|
7
|
+
export {
|
|
8
|
+
t as Label
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Pagination as n, PaginationButton as a, PaginationItem as i, PaginationList as t, usePagination as o } from "@digdir/designsystemet-react";
|
|
3
|
+
const s = n, P = t, e = i, u = a, c = o;
|
|
4
|
+
s.displayName = "Pagination";
|
|
5
|
+
export {
|
|
6
|
+
s as Pagination,
|
|
7
|
+
u as PaginationButton,
|
|
8
|
+
e as PaginationItem,
|
|
9
|
+
P as PaginationList,
|
|
10
|
+
c as usePagination
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as p } from "react";
|
|
4
|
+
import { Paragraph as m } from "@digdir/designsystemet-react";
|
|
5
|
+
const t = p(
|
|
6
|
+
(r, a) => /* @__PURE__ */ o(m, { ref: a, ...r })
|
|
7
|
+
);
|
|
8
|
+
t.displayName = "Paragraph";
|
|
9
|
+
export {
|
|
10
|
+
t as Paragraph
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { Tag as i } from "@digdir/designsystemet-react";
|
|
4
|
+
import { forwardRef as u } from "react";
|
|
5
|
+
const f = u(function({ shape: o, style: e, ...t }, a) {
|
|
6
|
+
const r = {};
|
|
7
|
+
o === "rounded" && (r.borderRadius = "var(--ds-border-radius-xl)");
|
|
8
|
+
const s = Object.keys(r).length === 0 && !e ? void 0 : { ...r, ...e }, d = {};
|
|
9
|
+
return o === "rounded" && (d["data-shape"] = "rounded"), /* @__PURE__ */ n(i, { ref: a, ...t, ...d, style: s });
|
|
10
|
+
});
|
|
11
|
+
f.displayName = "Tag";
|
|
12
|
+
export {
|
|
13
|
+
f as Tag
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as o } from "react";
|
|
4
|
+
import { ValidationMessage as s } from "@digdir/designsystemet-react";
|
|
5
|
+
const r = o((a, e) => /* @__PURE__ */ i(s, { ref: e, ...a }));
|
|
6
|
+
r.displayName = "ValidationMessage";
|
|
7
|
+
export {
|
|
8
|
+
r as ValidationMessage
|
|
9
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
3
|
+
import { useState as c, useContext as i, createContext as d } from "react";
|
|
4
|
+
import { translations as h } from "../translations/index.js";
|
|
5
|
+
const a = d(void 0), m = ({ children: e }) => {
|
|
6
|
+
const [o, s] = c("NO"), l = (t) => {
|
|
7
|
+
const u = t.split(".");
|
|
8
|
+
let r = h[o];
|
|
9
|
+
for (const n of u) {
|
|
10
|
+
if (r[n] === void 0)
|
|
11
|
+
return console.warn(`Translation missing for key: ${t} in language: ${o}`), t;
|
|
12
|
+
r = r[n];
|
|
13
|
+
}
|
|
14
|
+
return r;
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ g(a.Provider, { value: { language: o, setLanguage: s, t: l }, children: e });
|
|
17
|
+
}, L = () => {
|
|
18
|
+
const e = i(a);
|
|
19
|
+
if (e === void 0)
|
|
20
|
+
throw new Error("useLanguage must be used within a LanguageProvider");
|
|
21
|
+
return e;
|
|
22
|
+
}, v = () => {
|
|
23
|
+
const e = i(a);
|
|
24
|
+
return e === void 0 ? {
|
|
25
|
+
language: "NO",
|
|
26
|
+
setLanguage: () => {
|
|
27
|
+
console.warn("LanguageProvider is not available. Language changes will not work.");
|
|
28
|
+
},
|
|
29
|
+
t: (o) => ({
|
|
30
|
+
// Header translations
|
|
31
|
+
"header.darkMode": "Nattmodus",
|
|
32
|
+
"header.language": "Språk",
|
|
33
|
+
"header.selectLanguage": "Velg språk",
|
|
34
|
+
"header.homeAriaLabel": "Norges Røde Kors Hjem",
|
|
35
|
+
"header.login": "Logg inn",
|
|
36
|
+
"header.search": "Søk",
|
|
37
|
+
"header.close": "Lukk",
|
|
38
|
+
"header.closeSearch": "Lukk søk",
|
|
39
|
+
"header.openSearch": "Åpne søk",
|
|
40
|
+
"header.menu": "Meny",
|
|
41
|
+
"header.closeMenu": "Lukk meny",
|
|
42
|
+
"header.openMenu": "Åpne meny",
|
|
43
|
+
"header.supportUs": "Støtt oss",
|
|
44
|
+
"header.toggleTheme": "Bytt tema",
|
|
45
|
+
"header.searchPlaceholder": "Søk...",
|
|
46
|
+
"header.clearSearch": "Tøm søk",
|
|
47
|
+
"header.suggestions": "Forslag",
|
|
48
|
+
"header.viewAll": "Se alle",
|
|
49
|
+
"header.noResults": "Ingen resultater for",
|
|
50
|
+
"header.suggestionCount": "{count} forslag",
|
|
51
|
+
// Footer translations
|
|
52
|
+
"footer.shortcuts": "Snarveier",
|
|
53
|
+
"footer.shortcutsLinks.services": "Tilbudene",
|
|
54
|
+
"footer.shortcutsLinks.volunteer": "Bli frivillig",
|
|
55
|
+
"footer.shortcutsLinks.ourWork": "Vårt arbeid",
|
|
56
|
+
"footer.shortcutsLinks.about": "Om Røde Kors",
|
|
57
|
+
"footer.shortcutsLinks.support": "Støtt arbeidet",
|
|
58
|
+
"footer.shortcutsLinks.contact": "Kontakt oss",
|
|
59
|
+
"footer.contact.visitingAddress": "Besøks adresse",
|
|
60
|
+
"footer.contact.organizationNumber": "Organisasjonsnummer",
|
|
61
|
+
"footer.contact.email": "E-post",
|
|
62
|
+
"footer.contact.phone": "Telefon",
|
|
63
|
+
"footer.contact.title": "Kontakt",
|
|
64
|
+
"footer.followUs": "Følg oss",
|
|
65
|
+
"footer.links": "Lenker",
|
|
66
|
+
"footer.copyright": "Rødekors",
|
|
67
|
+
"footer.legal.privacy": "Personvern",
|
|
68
|
+
"footer.legal.press": "For presse",
|
|
69
|
+
"footer.legal.procurement": "Regler for innkjøp",
|
|
70
|
+
"footer.legal.whistleblowing": "Varsling/Misconduct",
|
|
71
|
+
// Carousel translations
|
|
72
|
+
"carousel.loading": "Laster bilde",
|
|
73
|
+
"carousel.previousImage": "Forrige bilde",
|
|
74
|
+
"carousel.nextImage": "Neste bilde",
|
|
75
|
+
"carousel.imagePosition": "Bildeposisjon",
|
|
76
|
+
"carousel.goToImage": "Gå til bilde",
|
|
77
|
+
"carousel.pauseAutoplay": "Pause automatisk avspilling",
|
|
78
|
+
"carousel.resumeAutoplay": "Start automatisk avspilling",
|
|
79
|
+
// DatePicker translations
|
|
80
|
+
"datePicker.previousMonth": "Forrige måned",
|
|
81
|
+
"datePicker.nextMonth": "Neste måned",
|
|
82
|
+
// DateInput translations
|
|
83
|
+
"dateInput.openDatePicker": "Åpne datovelger"
|
|
84
|
+
})[o] || o
|
|
85
|
+
} : e;
|
|
86
|
+
};
|
|
87
|
+
export {
|
|
88
|
+
m as LanguageProvider,
|
|
89
|
+
L as useLanguage,
|
|
90
|
+
v as useLanguageOptional
|
|
91
|
+
};
|