@altinn/altinn-components 0.61.0 → 0.61.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 (72) hide show
  1. package/dist/assets/HeaderLogo.css +1 -1
  2. package/dist/components/Footer/FooterLogo.js +1 -1
  3. package/dist/components/GlobalHeader/HeaderLogo.js +1 -1
  4. package/dist/components/GlobalMenu/GlobalMenu.js +57 -40
  5. package/dist/components/Layout/Layout.js +27 -29
  6. package/dist/components/Logo/index.js +4 -0
  7. package/dist/components/Pagination/Pagination.js +13 -13
  8. package/dist/components/index.js +355 -377
  9. package/dist/index.js +365 -387
  10. package/dist/types/lib/components/Account/Account.stories.d.ts +0 -3
  11. package/dist/types/lib/components/Dialog/DialogLayout.d.ts +7 -2
  12. package/dist/types/lib/components/GlobalHeader/GlobalHeader.stories.d.ts +5 -4
  13. package/dist/types/lib/components/GlobalMenu/GlobalMenu.stories.d.ts +9 -12
  14. package/dist/types/lib/components/Layout/Layout.d.ts +2 -4
  15. package/dist/types/lib/components/Layout/Layout.stories.d.ts +2 -8
  16. package/dist/types/lib/components/Logo/index.d.ts +1 -0
  17. package/dist/types/lib/components/Page/PageNav.d.ts +5 -2
  18. package/dist/types/lib/components/Pagination/Pagination.d.ts +3 -2
  19. package/dist/types/lib/components/Pagination/Pagination.stories.d.ts +5 -5
  20. package/dist/types/lib/components/index.d.ts +2 -2
  21. package/dist/types/lib/stories/Inbox.stories.d.ts +0 -4
  22. package/package.json +1 -1
  23. package/dist/Globe-BcPkcH4E.js +0 -24
  24. package/dist/PadlockLocked-XL1IB5Ae.js +0 -24
  25. package/dist/assets/EndUserLabel.css +0 -1
  26. package/dist/assets/GlobalMenuButton2.css +0 -1
  27. package/dist/assets/Header.css +0 -1
  28. package/dist/assets/HeaderBase.css +0 -1
  29. package/dist/assets/HeaderButton.css +0 -1
  30. package/dist/assets/HeaderGroup.css +0 -1
  31. package/dist/assets/HeaderLogo2.css +0 -1
  32. package/dist/assets/HeaderSearch.css +0 -1
  33. package/dist/assets/LocaleButton.css +0 -1
  34. package/dist/components/GlobalMenu_old/BackButton.js +0 -13
  35. package/dist/components/GlobalMenu_old/CurrentAccount.js +0 -24
  36. package/dist/components/GlobalMenu_old/EndUserLabel.js +0 -32
  37. package/dist/components/GlobalMenu_old/GlobalMenu.js +0 -81
  38. package/dist/components/GlobalMenu_old/GlobalMenuBase.js +0 -10
  39. package/dist/components/GlobalMenu_old/GlobalMenuButton.js +0 -58
  40. package/dist/components/GlobalMenu_old/LogoutButton.js +0 -14
  41. package/dist/components/GlobalMenu_old/index.js +0 -14
  42. package/dist/components/Header/Header.js +0 -101
  43. package/dist/components/Header/HeaderBase.js +0 -19
  44. package/dist/components/Header/HeaderButton.js +0 -51
  45. package/dist/components/Header/HeaderGroup.js +0 -8
  46. package/dist/components/Header/HeaderLogo.js +0 -17
  47. package/dist/components/Header/HeaderSearch.js +0 -12
  48. package/dist/components/Header/LocaleButton.js +0 -29
  49. package/dist/components/Header/LocaleSwitcher.js +0 -44
  50. package/dist/components/Header/index.js +0 -18
  51. package/dist/types/lib/components/GlobalMenu_old/BackButton.d.ts +0 -7
  52. package/dist/types/lib/components/GlobalMenu_old/CurrentAccount.d.ts +0 -16
  53. package/dist/types/lib/components/GlobalMenu_old/EndUserLabel.d.ts +0 -5
  54. package/dist/types/lib/components/GlobalMenu_old/GlobalMenu.d.ts +0 -18
  55. package/dist/types/lib/components/GlobalMenu_old/GlobalMenuBase.d.ts +0 -15
  56. package/dist/types/lib/components/GlobalMenu_old/GlobalMenuButton.d.ts +0 -13
  57. package/dist/types/lib/components/GlobalMenu_old/LogoutButton.d.ts +0 -7
  58. package/dist/types/lib/components/GlobalMenu_old/index.d.ts +0 -6
  59. package/dist/types/lib/components/Header/Header.d.ts +0 -18
  60. package/dist/types/lib/components/Header/Header.stories.d.ts +0 -29
  61. package/dist/types/lib/components/Header/HeaderBase.d.ts +0 -9
  62. package/dist/types/lib/components/Header/HeaderButton.d.ts +0 -11
  63. package/dist/types/lib/components/Header/HeaderButton.stories.d.ts +0 -17
  64. package/dist/types/lib/components/Header/HeaderGroup.d.ts +0 -7
  65. package/dist/types/lib/components/Header/HeaderLogo.d.ts +0 -11
  66. package/dist/types/lib/components/Header/HeaderSearch.d.ts +0 -7
  67. package/dist/types/lib/components/Header/LocaleButton.d.ts +0 -8
  68. package/dist/types/lib/components/Header/LocaleSwitcher.d.ts +0 -7
  69. package/dist/types/lib/components/Header/index.d.ts +0 -8
  70. package/dist/types/lib/stories/Beta/Beta.stories.d.ts +0 -15
  71. /package/dist/components/{Header → Logo}/DigdirLogomark.js +0 -0
  72. /package/dist/types/lib/components/{Header → Logo}/DigdirLogomark.d.ts +0 -0
@@ -1 +1 @@
1
- ._logo_mt7vd_1{display:flex;align-items:center;color:currentColor;text-decoration:none}._symbol_mt7vd_8{width:2rem;height:2rem;margin:0}@media(min-width:1024px){._symbol_mt7vd_8{margin:6px}}._riksSymbol_mt7vd_20{width:2.5rem;height:2.5rem;margin:0}._text_mt7vd_26{font-size:1.5rem;font-weight:500;padding:4px}
1
+ ._logo_1yxnd_1{display:flex;align-items:center;color:currentColor;text-decoration:none;height:3.25rem;min-width:3.25rem;padding:0 .5rem;-webkit-user-select:none;user-select:none}._logo_1yxnd_1:hover{background-color:transparent}._logomark_1yxnd_16{color:#0062b8;width:2rem;height:2rem;margin:0!important}._text_1yxnd_23{font-size:2rem;font-weight:400}
@@ -1,6 +1,6 @@
1
1
  import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
2
  import { c as i } from "../../index-p1eeF8LQ.js";
3
- import { DigdirLogomark as t } from "../Header/DigdirLogomark.js";
3
+ import { DigdirLogomark as t } from "../Logo/DigdirLogomark.js";
4
4
  import '../../assets/FooterLogo.css';const c = "_logo_127g0_1", e = "_symbol_127g0_9", s = {
5
5
  logo: c,
6
6
  symbol: e
@@ -7,7 +7,7 @@ import "../Typography/Link.js";
7
7
  import "react-dom";
8
8
  import "../Snackbar/useSnackbar.js";
9
9
  import { DigdirLogomark as x } from "./DigdirLogomark.js";
10
- import '../../assets/HeaderLogo2.css';const d = "_logo_1yxnd_1", _ = "_logomark_1yxnd_16", f = "_text_1yxnd_23", t = {
10
+ import '../../assets/HeaderLogo.css';const d = "_logo_1yxnd_1", _ = "_logomark_1yxnd_16", f = "_text_1yxnd_23", t = {
11
11
  logo: d,
12
12
  logomark: _,
13
13
  text: f
@@ -1,63 +1,80 @@
1
1
  "use client";
2
- import { jsxs as f, jsx as o } from "react/jsx-runtime";
3
- import { useState as d, useCallback as L, useEffect as C, useMemo as G } from "react";
4
- import { M as S } from "../../ToolbarSearch-56Sm2j7P.js";
2
+ import { jsxs as d, jsx as a } from "react/jsx-runtime";
3
+ import s, { forwardRef as y, useState as M, useCallback as k, useEffect as I, useMemo as O } from "react";
4
+ import { M as w } from "../../ToolbarSearch-56Sm2j7P.js";
5
5
  import "../../index-p1eeF8LQ.js";
6
6
  import "../Typography/Link.js";
7
7
  import "../Button/Button.js";
8
8
  import "react-dom";
9
- import { LocaleSwitcher as v } from "./LocaleSwitcher.js";
9
+ import { LocaleSwitcher as j } from "./LocaleSwitcher.js";
10
10
  import "../Snackbar/useSnackbar.js";
11
11
  import { MenuListItem as x } from "../Menu/MenuListItem.js";
12
- import { GlobalMenuBase as u, GlobalMenuFooter as I } from "./GlobalMenuBase.js";
13
- import { LogoutButton as T } from "./LogoutButton.js";
14
- import { S as h } from "../../Globe-BcPkcH4E.js";
15
- const N = ({
16
- menu: e,
17
- backLabel: g = "Back",
18
- onClose: s,
19
- logoutButton: a,
20
- ariaLabel: n = "Menu",
21
- localeSwitcher: r,
22
- isOpen: m = !1
12
+ import { GlobalMenuBase as g, GlobalMenuFooter as S } from "./GlobalMenuBase.js";
13
+ import { LogoutButton as _ } from "./LogoutButton.js";
14
+ import { u as C } from "../../useId-BVFxCjkq.js";
15
+ var E = function(t, i) {
16
+ var r = {};
17
+ for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && i.indexOf(e) < 0 && (r[e] = t[e]);
18
+ if (t != null && typeof Object.getOwnPropertySymbols == "function")
19
+ for (var o = 0, e = Object.getOwnPropertySymbols(t); o < e.length; o++)
20
+ i.indexOf(e[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[o]) && (r[e[o]] = t[e[o]]);
21
+ return r;
22
+ };
23
+ const L = y((t, i) => {
24
+ var { title: r, titleId: e } = t, o = E(t, ["title", "titleId"]);
25
+ let l = C();
26
+ return l = r ? e || "title-" + l : void 0, s.createElement(
27
+ "svg",
28
+ Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: i, "aria-labelledby": l }, o),
29
+ r ? s.createElement("title", { id: l }, r) : null,
30
+ s.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12m6.74-7.683A8.28 8.28 0 0 0 4.65 8.25h3.719a41 41 0 0 1 .62-3.934m1.63-.452a41 41 0 0 0-.742 4.385h4.245a41 41 0 0 0-.743-4.385 8.3 8.3 0 0 0-2.76 0M8.24 14.25a34.5 34.5 0 0 1 0-4.5H4.06A8.3 8.3 0 0 0 3.75 12c0 .78.108 1.535.31 2.25zm1.503 0a33 33 0 0 1 0-4.5h4.514c.103 1.51.103 2.997 0 4.5zm-.754 5.433a41 41 0 0 1-.62-3.933h-3.72a8.28 8.28 0 0 0 4.34 3.933m1.631.452a41 41 0 0 1-.743-4.385h4.246a41 41 0 0 1-.743 4.385 8.3 8.3 0 0 1-2.76 0m5.141-5.885c.098-1.502.098-2.99 0-4.5h4.179c.202.715.31 1.47.31 2.25a8.3 8.3 0 0 1-.31 2.25zm-.75-9.933a8.28 8.28 0 0 1 4.34 3.933h-3.72a41 41 0 0 0-.62-3.933m0 15.366c.276-1.344.483-2.648.62-3.933h3.72a8.28 8.28 0 0 1-4.34 3.933", clipRule: "evenodd" })
31
+ );
32
+ }), K = ({
33
+ menu: t,
34
+ backLabel: i = "Back",
35
+ onClose: r,
36
+ logoutButton: e,
37
+ ariaLabel: o = "Menu",
38
+ localeSwitcher: l,
39
+ isOpen: f = !1
23
40
  }) => {
24
- const [k, c] = d(!1), l = L(() => {
25
- c((t) => !t);
41
+ const [b, p] = M(!1), m = k(() => {
42
+ p((n) => !n);
26
43
  }, []);
27
- C(() => {
28
- m || c(!1);
29
- }, [m]);
30
- const M = G(() => {
31
- const t = (e?.items ?? []).map((i) => ({
32
- ...i,
44
+ I(() => {
45
+ f || p(!1);
46
+ }, [f]);
47
+ const h = O(() => {
48
+ const n = (t?.items ?? []).map((c) => ({
49
+ ...c,
33
50
  onClick: () => {
34
- i.onClick?.(), s?.();
51
+ c.onClick?.(), r?.();
35
52
  },
36
- items: Array.isArray(i.items) ? i.items.map((p) => ({
37
- ...p,
53
+ items: Array.isArray(c.items) ? c.items.map((u) => ({
54
+ ...u,
38
55
  onClick: () => {
39
- p.onClick?.(), s?.();
56
+ u.onClick?.(), r?.();
40
57
  }
41
58
  })) : void 0
42
59
  }));
43
- if (!r) return t;
44
- const b = {
60
+ if (!l) return n;
61
+ const v = {
45
62
  title: "Språk/language",
46
- icon: h,
63
+ icon: L,
47
64
  size: "sm",
48
- onClick: l,
65
+ onClick: m,
49
66
  linkIcon: !0
50
67
  };
51
- return [...t, b];
52
- }, [e, s, r, l]);
53
- return k ? /* @__PURE__ */ f(u, { "aria-label": n, children: [
54
- r && /* @__PURE__ */ o(v, { ...r, backLabel: g, onToggle: l }),
55
- /* @__PURE__ */ o(x, { as: "div", role: "separator" })
56
- ] }) : /* @__PURE__ */ f(u, { "aria-label": n, children: [
57
- e && /* @__PURE__ */ o(S, { ...e, items: M }),
58
- a && /* @__PURE__ */ o(I, { children: /* @__PURE__ */ o(T, { ...a }) })
68
+ return [...n, v];
69
+ }, [t, r, l, m]);
70
+ return b ? /* @__PURE__ */ d(g, { "aria-label": o, children: [
71
+ l && /* @__PURE__ */ a(j, { ...l, backLabel: i, onToggle: m }),
72
+ /* @__PURE__ */ a(x, { as: "div", role: "separator" })
73
+ ] }) : /* @__PURE__ */ d(g, { "aria-label": o, children: [
74
+ t && /* @__PURE__ */ a(w, { ...t, items: h }),
75
+ e && /* @__PURE__ */ a(S, { children: /* @__PURE__ */ a(_, { ...e }) })
59
76
  ] });
60
77
  };
61
78
  export {
62
- N as GlobalMenu
79
+ K as GlobalMenu
63
80
  };
@@ -1,60 +1,58 @@
1
1
  "use client";
2
2
  import { jsxs as r, jsx as t } from "react/jsx-runtime";
3
- import { LayoutBase as d } from "./LayoutBase.js";
4
- import { LayoutGrid as L } from "./LayoutGrid.js";
5
- import { LayoutBody as a } from "./LayoutBody.js";
6
- import { LayoutContent as h } from "./LayoutContent.js";
7
- import { LayoutSidebar as s } from "./LayoutSidebar.js";
8
- import { Breadcrumbs as x } from "../Breadcrumbs/Breadcrumbs.js";
3
+ import { LayoutBase as y } from "./LayoutBase.js";
4
+ import { LayoutGrid as d } from "./LayoutGrid.js";
5
+ import { LayoutBody as h } from "./LayoutBody.js";
6
+ import { LayoutContent as L } from "./LayoutContent.js";
7
+ import { LayoutSidebar as a } from "./LayoutSidebar.js";
8
+ import { Breadcrumbs as s } from "../Breadcrumbs/Breadcrumbs.js";
9
9
  import "../../index-p1eeF8LQ.js";
10
- import { Footer as B } from "../Footer/Footer.js";
11
- import { GlobalHeader as j } from "../GlobalHeader/GlobalHeader.js";
10
+ import { Footer as x } from "../Footer/Footer.js";
11
+ import { GlobalHeader as B } from "../GlobalHeader/GlobalHeader.js";
12
12
  import "react";
13
- import { u as k, M as C } from "../../ToolbarSearch-56Sm2j7P.js";
13
+ import { u as j, M as k } from "../../ToolbarSearch-56Sm2j7P.js";
14
14
  import "../Typography/Link.js";
15
15
  import "../Button/Button.js";
16
16
  import "react-dom";
17
- import { Header as G } from "../Header/Header.js";
18
17
  import "../Snackbar/useSnackbar.js";
19
- import { SkipLink as H } from "../SkipLink/SkipLink.js";
20
- const Q = ({
18
+ import { SkipLink as C } from "../SkipLink/SkipLink.js";
19
+ const N = ({
21
20
  color: c,
22
21
  theme: u = "subtle",
23
- header: m,
22
+ header: i,
24
23
  footer: n,
25
24
  sidebar: o,
26
- content: f = {},
27
- children: l,
25
+ content: l = {},
26
+ children: f,
28
27
  skipLink: p,
29
- breadcrumbs: e,
30
- useGlobalHeader: y = !0
28
+ breadcrumbs: e
31
29
  }) => {
32
- const { currentId: i } = k();
33
- return /* @__PURE__ */ r(d, { color: c, theme: u, currentId: i, children: [
34
- p && /* @__PURE__ */ t(H, { ...p }),
35
- m && (y ? /* @__PURE__ */ t(j, { ...m }) : /* @__PURE__ */ t(G, { ...m })),
36
- /* @__PURE__ */ r(L, { currentId: i, children: [
37
- e && /* @__PURE__ */ t(x, { ...e }),
38
- /* @__PURE__ */ r(a, { currentId: i, children: [
30
+ const { currentId: m } = j();
31
+ return /* @__PURE__ */ r(y, { color: c, theme: u, currentId: m, children: [
32
+ p && /* @__PURE__ */ t(C, { ...p }),
33
+ i && /* @__PURE__ */ t(B, { ...i }),
34
+ /* @__PURE__ */ r(d, { currentId: m, children: [
35
+ e && /* @__PURE__ */ t(s, { ...e }),
36
+ /* @__PURE__ */ r(h, { currentId: m, children: [
39
37
  o && /* @__PURE__ */ r(
40
- s,
38
+ a,
41
39
  {
42
40
  sticky: o?.sticky,
43
41
  hidden: o?.hidden,
44
42
  color: o?.color,
45
43
  footer: o?.footer,
46
44
  children: [
47
- o?.menu && /* @__PURE__ */ t(C, { ...o?.menu }),
45
+ o?.menu && /* @__PURE__ */ t(k, { ...o?.menu }),
48
46
  o?.children
49
47
  ]
50
48
  }
51
49
  ),
52
- /* @__PURE__ */ t(h, { color: f?.color, id: "main-content", children: l })
50
+ /* @__PURE__ */ t(L, { color: l?.color, id: "main-content", children: f })
53
51
  ] })
54
52
  ] }),
55
- n && /* @__PURE__ */ t(B, { ...n })
53
+ n && /* @__PURE__ */ t(x, { ...n })
56
54
  ] });
57
55
  };
58
56
  export {
59
- Q as Layout
57
+ N as Layout
60
58
  };
@@ -0,0 +1,4 @@
1
+ import { DigdirLogomark as g } from "./DigdirLogomark.js";
2
+ export {
3
+ g as DigdirLogomark
4
+ };
@@ -1,27 +1,27 @@
1
- import { jsx as i, jsxs as h } from "react/jsx-runtime";
2
- import { Button as r } from "../Button/Button.js";
1
+ import { jsx as i, jsxs as p } from "react/jsx-runtime";
2
+ import { Button as e } from "../Button/Button.js";
3
3
  import "../../index-p1eeF8LQ.js";
4
4
  import "react";
5
5
  import "../../ToolbarSearch-56Sm2j7P.js";
6
6
  import "../Typography/Link.js";
7
7
  import "react-dom";
8
8
  import "../Snackbar/useSnackbar.js";
9
- import '../../assets/Pagination.css';const m = "_pagination_jpqmb_1", g = "_list_jpqmb_5", o = {
10
- pagination: m,
11
- list: g
12
- }, x = ({
9
+ import '../../assets/Pagination.css';const b = "_pagination_jpqmb_1", m = "_list_jpqmb_5", t = {
10
+ pagination: b,
11
+ list: m
12
+ }, y = ({
13
13
  size: a,
14
- variant: t = "tinted",
14
+ variant: o = "tinted",
15
15
  selectedVariant: d = "solid",
16
- prev: e,
16
+ prev: r,
17
17
  next: n,
18
18
  items: s = [],
19
19
  "aria-label": c = "Velg side"
20
- }) => /* @__PURE__ */ i("nav", { className: o.pagination, "data-size": a, "aria-label": c, children: /* @__PURE__ */ h("ul", { className: o.list, children: [
21
- e && /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(r, { size: a, "aria-label": e["aria-label"] || "Forrige side", variant: t, children: e.title || "Forrige" }) }),
22
- s?.map((l, p) => /* @__PURE__ */ i("li", { "aria-hidden": l.hidden, children: l.hidden ? /* @__PURE__ */ i(r, { as: "div", size: a, variant: "ghost", children: "…" }) : /* @__PURE__ */ i(r, { ...l, size: a, variant: l?.selected ? d : t, children: l.title }) }, p)),
23
- n && /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(r, { size: a, "aria-label": n["aria-label"] || "Forrige side", variant: t, children: n.title || "Neste" }) })
20
+ }) => /* @__PURE__ */ i("nav", { className: t.pagination, "data-size": a, "aria-label": c, children: /* @__PURE__ */ p("ul", { className: t.list, children: [
21
+ r && /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(e, { ...r, size: a, "aria-label": r["aria-label"] || "Forrige side", variant: o, children: r.label || "Forrige" }) }),
22
+ s?.map((l, h) => /* @__PURE__ */ i("li", { "aria-hidden": l.hidden, children: l.hidden ? /* @__PURE__ */ i(e, { as: "div", size: a, variant: "ghost", children: "…" }) : /* @__PURE__ */ i(e, { ...l, size: a, variant: l?.selected ? d : o, children: l.label }) }, h)),
23
+ n && /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(e, { ...n, size: a, "aria-label": n["aria-label"] || "Forrige side", variant: o, children: n.label || "Neste" }) })
24
24
  ] }) });
25
25
  export {
26
- x as Pagination
26
+ y as Pagination
27
27
  };