@altinn/altinn-components 0.56.22 → 0.56.23

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.
@@ -1,63 +1,63 @@
1
1
  "use client";
2
- import { jsxs as f, jsx as e } from "react/jsx-runtime";
3
- import { useState as d, useCallback as G, useEffect as L, useMemo as C } from "react";
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
4
  import { M as S } from "../../SearchField-QTfebYdU.js";
5
5
  import "../../index-p1eeF8LQ.js";
6
6
  import "../Button/Button.js";
7
7
  import "react-dom";
8
8
  import "../RootProvider/RootProvider.js";
9
- import { LocaleSwitcher as h } from "./LocaleSwitcher.js";
9
+ import { LocaleSwitcher as v } from "./LocaleSwitcher.js";
10
10
  import "../Snackbar/useSnackbar.js";
11
- import { MenuListItem as v } from "../Menu/MenuListItem.js";
12
- import { GlobalMenuBase as u, GlobalMenuHeader as x, GlobalMenuFooter as I } from "./GlobalMenuBase.js";
11
+ import { MenuListItem as x } from "../Menu/MenuListItem.js";
12
+ import { GlobalMenuBase as u, GlobalMenuFooter as I } from "./GlobalMenuBase.js";
13
13
  import { LogoutButton as T } from "./LogoutButton.js";
14
- import { S as j } from "../../Globe-BcPkcH4E.js";
15
- const P = ({
16
- menu: o,
14
+ import { S as h } from "../../Globe-BcPkcH4E.js";
15
+ const N = ({
16
+ menu: e,
17
17
  backLabel: g = "Back",
18
- onClose: l,
18
+ onClose: s,
19
19
  logoutButton: a,
20
20
  ariaLabel: n = "Menu",
21
21
  localeSwitcher: r,
22
22
  isOpen: m = !1
23
23
  }) => {
24
- const [k, c] = d(!1), s = G(() => {
24
+ const [k, c] = d(!1), l = L(() => {
25
25
  c((t) => !t);
26
26
  }, []);
27
- L(() => {
27
+ C(() => {
28
28
  m || c(!1);
29
29
  }, [m]);
30
- const M = C(() => {
31
- const t = (o?.items ?? []).map((i) => ({
30
+ const M = G(() => {
31
+ const t = (e?.items ?? []).map((i) => ({
32
32
  ...i,
33
33
  onClick: () => {
34
- i.onClick?.(), l?.();
34
+ i.onClick?.(), s?.();
35
35
  },
36
36
  items: Array.isArray(i.items) ? i.items.map((p) => ({
37
37
  ...p,
38
38
  onClick: () => {
39
- p.onClick?.(), l?.();
39
+ p.onClick?.(), s?.();
40
40
  }
41
41
  })) : void 0
42
42
  }));
43
43
  if (!r) return t;
44
44
  const b = {
45
45
  title: "Språk/language",
46
- icon: j,
46
+ icon: h,
47
47
  size: "sm",
48
- onClick: s,
48
+ onClick: l,
49
49
  linkIcon: !0
50
50
  };
51
51
  return [...t, b];
52
- }, [o, l, r, s]);
52
+ }, [e, s, r, l]);
53
53
  return k ? /* @__PURE__ */ f(u, { "aria-label": n, children: [
54
- /* @__PURE__ */ e(x, { children: r && /* @__PURE__ */ e(h, { ...r, backLabel: g, onToggle: s }) }),
55
- /* @__PURE__ */ e(v, { as: "div", role: "separator" })
54
+ r && /* @__PURE__ */ o(v, { ...r, backLabel: g, onToggle: l }),
55
+ /* @__PURE__ */ o(x, { as: "div", role: "separator" })
56
56
  ] }) : /* @__PURE__ */ f(u, { "aria-label": n, children: [
57
- o && /* @__PURE__ */ e(S, { ...o, items: M }),
58
- a && /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(T, { ...a }) })
57
+ e && /* @__PURE__ */ o(S, { ...e, items: M }),
58
+ a && /* @__PURE__ */ o(I, { children: /* @__PURE__ */ o(T, { ...a }) })
59
59
  ] });
60
60
  };
61
61
  export {
62
- P as GlobalMenu
62
+ N as GlobalMenu
63
63
  };
@@ -1,10 +1,9 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import '../../assets/GlobalMenuBase.css';const n = "_nav_b7k4e_1", s = "_footer_b7k4e_6", a = {
3
- nav: n,
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import '../../assets/GlobalMenuBase.css';const r = "_nav_b7k4e_1", s = "_footer_b7k4e_6", t = {
3
+ nav: r,
4
4
  footer: s
5
- }, c = ({ color: e, children: r, ...t }) => /* @__PURE__ */ o("nav", { className: a.nav, "data-color": e, ...t, children: r }), f = ({ children: e }) => /* @__PURE__ */ o("header", { className: a.header, children: e }), u = ({ children: e }) => /* @__PURE__ */ o("footer", { className: a.footer, children: e });
5
+ }, l = ({ color: o, children: a, ...n }) => /* @__PURE__ */ e("nav", { className: t.nav, "data-color": o, ...n, children: a }), f = ({ children: o }) => /* @__PURE__ */ e("footer", { className: t.footer, children: o });
6
6
  export {
7
- c as GlobalMenuBase,
8
- u as GlobalMenuFooter,
9
- f as GlobalMenuHeader
7
+ l as GlobalMenuBase,
8
+ f as GlobalMenuFooter
10
9
  };
@@ -4,12 +4,8 @@ export type GlobalMenuBaseProps = {
4
4
  color?: Color;
5
5
  children: ReactNode;
6
6
  } & React.HTMLAttributes<HTMLElement>;
7
- export interface GlobalMenuHeaderProps {
8
- children: ReactNode;
9
- }
10
7
  export interface GlobalMenuFooterProps {
11
8
  children: ReactNode;
12
9
  }
13
10
  export declare const GlobalMenuBase: ({ color, children, ...rest }: GlobalMenuBaseProps) => import("react/jsx-runtime").JSX.Element;
14
- export declare const GlobalMenuHeader: ({ children }: GlobalMenuHeaderProps) => import("react/jsx-runtime").JSX.Element;
15
11
  export declare const GlobalMenuFooter: ({ children }: GlobalMenuFooterProps) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.56.22",
3
+ "version": "0.56.23",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",
@@ -32,11 +32,11 @@
32
32
  "devDependencies": {
33
33
  "@biomejs/biome": "1.9.4",
34
34
  "@chromatic-com/storybook": "4.1.3",
35
- "@storybook/addon-a11y": "10.1.11",
36
- "@storybook/addon-docs": "10.1.11",
37
- "@storybook/addon-themes": "10.1.11",
38
- "@storybook/addon-vitest": "^10.1.11",
39
- "@storybook/react-vite": "10.1.11",
35
+ "@storybook/addon-a11y": "10.2.10",
36
+ "@storybook/addon-docs": "10.2.10",
37
+ "@storybook/addon-themes": "10.2.10",
38
+ "@storybook/addon-vitest": "10.2.10",
39
+ "@storybook/react-vite": "10.2.10",
40
40
  "@testing-library/react": "^16.3.0",
41
41
  "@types/node": "^25.0.7",
42
42
  "@types/react": "^19.1.5",
@@ -47,11 +47,11 @@
47
47
  "@vitest/coverage-v8": "^4.0.0",
48
48
  "axe-core": "^4.10.3",
49
49
  "axe-playwright": "^2.1.0",
50
- "glob": "^13.0.0",
50
+ "glob": "^13.0.6",
51
51
  "lint-staged": "^15.5.2",
52
52
  "playwright": "^1.57.0",
53
53
  "rollup-preserve-directives": "^1.1.3",
54
- "storybook": "^10.1.11",
54
+ "storybook": "10.2.10",
55
55
  "storybook-addon-tag-badges": "^3.0.4",
56
56
  "storybook-addon-theme-provider": "^0.2.10",
57
57
  "tsx": "^4.21.0",