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.
Files changed (64) hide show
  1. package/README.md +14 -7
  2. package/dist/assets/images/ChevronLeftIcon.js +31 -0
  3. package/dist/assets/images/ChevronRightIcon.js +31 -0
  4. package/dist/components/Alert/index.js +16 -0
  5. package/dist/components/Avatar/index.js +9 -0
  6. package/dist/components/Badge/index.js +11 -0
  7. package/dist/components/Breadcrumbs/index.js +9 -0
  8. package/dist/components/Button/index.js +11 -0
  9. package/dist/components/Card/index.js +8 -0
  10. package/dist/components/Carousel/index.js +379 -0
  11. package/dist/components/Carousel/styles.module.css.js +38 -0
  12. package/dist/components/Checkbox/index.js +10 -0
  13. package/dist/components/Chip/index.js +6 -0
  14. package/dist/components/DateInput/index.js +258 -0
  15. package/dist/components/DateInput/styles.module.css.js +20 -0
  16. package/dist/components/DatePicker/index.js +360 -0
  17. package/dist/components/DatePicker/styles.module.css.js +30 -0
  18. package/dist/components/Details/index.js +6 -0
  19. package/dist/components/Dialog/index.js +6 -0
  20. package/dist/components/Divider/index.js +6 -0
  21. package/dist/components/Donor/index.js +382 -0
  22. package/dist/components/Donor/styles.module.css.js +42 -0
  23. package/dist/components/Dropdown/index.js +12 -0
  24. package/dist/components/ErrorSummary/index.js +6 -0
  25. package/dist/components/Field/index.js +10 -0
  26. package/dist/components/Fieldset/index.js +6 -0
  27. package/dist/components/Footer/index.js +722 -0
  28. package/dist/components/Footer/styles.module.css.js +138 -0
  29. package/dist/components/GraphicElement/index.js +317 -0
  30. package/dist/components/GraphicElement/styles.module.css.js +16 -0
  31. package/dist/components/Header/index.js +677 -0
  32. package/dist/components/Header/styles.module.css.js +114 -0
  33. package/dist/components/Heading/index.js +9 -0
  34. package/dist/components/Input/index.js +7 -0
  35. package/dist/components/Label/index.js +9 -0
  36. package/dist/components/Link/index.js +6 -0
  37. package/dist/components/List/index.js +6 -0
  38. package/dist/components/Pagination/index.js +11 -0
  39. package/dist/components/Paragraph/index.js +11 -0
  40. package/dist/components/Popover/index.js +6 -0
  41. package/dist/components/Radio/index.js +7 -0
  42. package/dist/components/Search/index.js +10 -0
  43. package/dist/components/Select/index.js +6 -0
  44. package/dist/components/SkeletonLoader/index.js +6 -0
  45. package/dist/components/SkipLink/index.js +6 -0
  46. package/dist/components/SpinnerLoader/index.js +6 -0
  47. package/dist/components/Suggestion/index.js +7 -0
  48. package/dist/components/Switch/index.js +6 -0
  49. package/dist/components/Table/index.js +6 -0
  50. package/dist/components/Tabs/index.js +6 -0
  51. package/dist/components/Tag/index.js +14 -0
  52. package/dist/components/Textarea/index.js +6 -0
  53. package/dist/components/Textfield/index.js +6 -0
  54. package/dist/components/ToggleGroup/index.js +6 -0
  55. package/dist/components/Tooltip/index.js +6 -0
  56. package/dist/components/ValidationMessage/index.js +9 -0
  57. package/dist/context/LanguageContext.js +91 -0
  58. package/dist/index.d.ts +170 -147
  59. package/dist/index.js +118 -0
  60. package/dist/rk-designsystem.css +1 -1
  61. package/dist/{componentlibrary.es.js → translations/index.js} +267 -3904
  62. package/dist/utils/search-index.js +106 -0
  63. package/package.json +21 -35
  64. 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,7 @@
1
+ "use client";
2
+ import { Input as t } from "@digdir/designsystemet-react";
3
+ const p = t;
4
+ p.displayName = "Input";
5
+ export {
6
+ p as Input
7
+ };
@@ -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,6 @@
1
+ "use client";
2
+ import { Link as i } from "@digdir/designsystemet-react";
3
+ const o = i;
4
+ export {
5
+ o as Link
6
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { List as t } from "@digdir/designsystemet-react";
3
+ const i = t;
4
+ export {
5
+ i as List
6
+ };
@@ -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,6 @@
1
+ "use client";
2
+ import { Popover as o } from "@digdir/designsystemet-react";
3
+ const r = o;
4
+ export {
5
+ r as Popover
6
+ };
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { Radio as o, useRadioGroup as a } from "@digdir/designsystemet-react";
3
+ const s = o, u = a;
4
+ export {
5
+ s as Radio,
6
+ u as useRadioGroup
7
+ };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { Search as t, SearchInput as e, SearchClear as r, SearchButton as a } from "@digdir/designsystemet-react";
3
+ const n = Object.assign(t, {
4
+ Button: a,
5
+ ClearButton: r,
6
+ Input: e
7
+ });
8
+ export {
9
+ n as Search
10
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { Select as e } from "@digdir/designsystemet-react";
3
+ const c = e;
4
+ export {
5
+ c as Select
6
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { Skeleton as e } from "@digdir/designsystemet-react";
3
+ const t = e;
4
+ export {
5
+ t as SkeletonLoader
6
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { SkipLink as i } from "@digdir/designsystemet-react";
3
+ const n = i;
4
+ export {
5
+ n as SkipLink
6
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { Spinner as n } from "@digdir/designsystemet-react";
3
+ const r = n;
4
+ export {
5
+ r as Spinner
6
+ };
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { EXPERIMENTAL_Suggestion as e } from "@digdir/designsystemet-react";
3
+ const o = e;
4
+ o.displayName = "Suggestion";
5
+ export {
6
+ o as Suggestion
7
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { Switch as t } from "@digdir/designsystemet-react";
3
+ const i = t;
4
+ export {
5
+ i as Switch
6
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { Table as e } from "@digdir/designsystemet-react";
3
+ const l = e;
4
+ export {
5
+ l as Table
6
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { Tabs as s } from "@digdir/designsystemet-react";
3
+ const o = s;
4
+ export {
5
+ o as Tabs
6
+ };
@@ -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,6 @@
1
+ "use client";
2
+ import { Textarea as e } from "@digdir/designsystemet-react";
3
+ const t = e;
4
+ export {
5
+ t as Textarea
6
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { Textfield as e } from "@digdir/designsystemet-react";
3
+ const i = e;
4
+ export {
5
+ i as Textfield
6
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { ToggleGroup as o } from "@digdir/designsystemet-react";
3
+ const g = o;
4
+ export {
5
+ g as ToggleGroup
6
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { Tooltip as o } from "@digdir/designsystemet-react";
3
+ const i = o;
4
+ export {
5
+ i as Tooltip
6
+ };
@@ -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
+ };