@altinn/altinn-components 0.47.0 → 0.47.1

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,33 +1,32 @@
1
1
  "use client";
2
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
3
- import { useState as B, useEffect as h, useMemo as u } from "react";
2
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
3
+ import { useState as L, useEffect as B, useMemo as h } from "react";
4
4
  import "../../index-L8X2o7IH.js";
5
5
  import "../RootProvider/RootProvider.js";
6
- import { LocaleSwitcher as G } from "./LocaleSwitcher.js";
6
+ import { LocaleSwitcher as u } from "./LocaleSwitcher.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
- import { MenuListItem as x } from "../Menu/MenuBase.js";
9
- import { Menu as j } from "../Menu/Menu.js";
10
- import { BackButton as v } from "./BackButton.js";
11
- import { GlobalMenuBase as M, GlobalMenuHeader as y, GlobalMenuFooter as A } from "./GlobalMenuBase.js";
12
- import { LocaleButton as S } from "./LocaleButton.js";
13
- import { LogoutButton as T } from "./LogoutButton.js";
14
- const Q = ({
8
+ import { MenuListItem as G } from "../Menu/MenuBase.js";
9
+ import { Menu as x } from "../Menu/Menu.js";
10
+ import { BackButton as j } from "./BackButton.js";
11
+ import { GlobalMenuBase as k, GlobalMenuHeader as v, GlobalMenuFooter as y } from "./GlobalMenuBase.js";
12
+ import { LocaleButton as A } from "./LocaleButton.js";
13
+ import { LogoutButton as S } from "./LogoutButton.js";
14
+ const P = ({
15
15
  menu: a,
16
- backLabel: d = "Back",
16
+ backLabel: M = "Back",
17
17
  onClose: i,
18
- logoutButton: l,
18
+ logoutButton: e,
19
19
  ariaLabel: f = "Menu",
20
- localeSwitcher: e,
21
- isOpen: p = !1,
22
- color: n = "person"
20
+ localeSwitcher: c,
21
+ isOpen: p = !1
23
22
  }) => {
24
- const [g, m] = B(!1), s = () => {
25
- m((r) => !r);
23
+ const [d, n] = L(!1), m = () => {
24
+ n((r) => !r);
26
25
  };
27
- h(() => {
28
- p || m(!1);
26
+ B(() => {
27
+ p || n(!1);
29
28
  }, [p]);
30
- const L = u(() => ((a == null ? void 0 : a.items) ?? []).map((r) => ({
29
+ const g = h(() => ((a == null ? void 0 : a.items) ?? []).map((r) => ({
31
30
  ...r,
32
31
  onClick: () => {
33
32
  var o;
@@ -36,23 +35,23 @@ const Q = ({
36
35
  items: Array.isArray(r.items) ? r.items.map((o) => ({
37
36
  ...o,
38
37
  onClick: () => {
39
- var k;
40
- (k = o.onClick) == null || k.call(o), i == null || i();
38
+ var s;
39
+ (s = o.onClick) == null || s.call(o), i == null || i();
41
40
  }
42
41
  })) : void 0
43
42
  })), [a, i]);
44
- return g ? /* @__PURE__ */ c(M, { "aria-label": f, color: n, children: [
45
- /* @__PURE__ */ c(y, { children: [
46
- /* @__PURE__ */ t(v, { onClick: s, label: d }),
47
- e && /* @__PURE__ */ t(G, { ...e })
43
+ return d ? /* @__PURE__ */ l(k, { "aria-label": f, children: [
44
+ /* @__PURE__ */ l(v, { children: [
45
+ /* @__PURE__ */ t(j, { onClick: m, label: M }),
46
+ c && /* @__PURE__ */ t(u, { ...c })
48
47
  ] }),
49
- /* @__PURE__ */ t(x, { as: "div", role: "separator" })
50
- ] }) : /* @__PURE__ */ c(M, { "aria-label": f, color: n, children: [
51
- a && /* @__PURE__ */ t(j, { ...a, items: L }),
52
- e && /* @__PURE__ */ t(S, { onClick: s }),
53
- l && /* @__PURE__ */ t(A, { children: /* @__PURE__ */ t(T, { ...l }) })
48
+ /* @__PURE__ */ t(G, { as: "div", role: "separator" })
49
+ ] }) : /* @__PURE__ */ l(k, { "aria-label": f, children: [
50
+ a && /* @__PURE__ */ t(x, { ...a, items: g }),
51
+ c && /* @__PURE__ */ t(A, { onClick: m }),
52
+ e && /* @__PURE__ */ t(y, { children: /* @__PURE__ */ t(S, { ...e }) })
54
53
  ] });
55
54
  };
56
55
  export {
57
- Q as GlobalMenu
56
+ P as GlobalMenu
58
57
  };
@@ -1,4 +1,3 @@
1
- import { Color } from '../';
2
1
  import { LocaleSwitcherProps } from '../Header';
3
2
  import { MenuProps } from '../Menu';
4
3
  import { LogoutButtonProps } from './LogoutButton';
@@ -14,6 +13,5 @@ export interface GlobalMenuProps {
14
13
  ariaLabel?: string;
15
14
  localeSwitcher?: LocaleSwitcherProps;
16
15
  isOpen?: boolean;
17
- color?: Color;
18
16
  }
19
- export declare const GlobalMenu: ({ menu, backLabel, onClose, logoutButton, ariaLabel, localeSwitcher, isOpen, color, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const GlobalMenu: ({ menu, backLabel, onClose, logoutButton, ariaLabel, localeSwitcher, isOpen, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import { MenuProps } from '../Menu';
3
3
  import { GlobalMenuProps } from './GlobalMenu';
4
4
  declare const meta: {
5
5
  title: string;
6
- component: ({ menu, backLabel, onClose, logoutButton, ariaLabel, localeSwitcher, isOpen, color, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
6
+ component: ({ menu, backLabel, onClose, logoutButton, ariaLabel, localeSwitcher, isOpen, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
7
7
  tags: string[];
8
8
  parameters: {};
9
9
  args: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.47.0",
3
+ "version": "0.47.1",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",