@altinn/altinn-components 0.23.0 → 0.23.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 +1 @@
1
- ._item_1gk35_1{font:inherit;color:inherit;padding:0;border:0;text-align:inherit;text-decoration:none;line-height:normal;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;user-select:none;cursor:pointer;position:relative;width:100%;display:flex;align-items:center;column-gap:.25rem;margin:.5rem 0;border-radius:2px}._item_1gk35_1[aria-disabled=true]{opacity:.5;pointer-events:none}._item_1gk35_1[data-size=md]{min-height:56px}._item_1gk35_1[data-size=md]{min-height:44px}._item_1gk35_1[data-size=sm]{min-height:40px}._content_1gk35_45{display:flex;width:100%;align-items:center;column-gap:6px;padding:6px}._action_1gk35_53{display:flex;justify-content:center;align-items:center;padding:10px}._linkText_1gk35_60{font-size:.875rem;white-space:nowrap}._linkIcon_1gk35_65{font-size:1.5rem}._item_1gk35_1,._item_1gk35_1[data-theme]{background-color:transparent}[data-theme=subtle] ._item_1gk35_1:hover{background-color:var(--ds-color-surface-hover)}[data-theme=subtle] ._item_1gk35_1:active{background-color:var(--ds-color-surface-active)}[data-theme=subtle] ._item_1gk35_1[data-selected=true]{background-color:var(--ds-color-background-default)}[data-theme=default] ._item_1gk35_1:hover{background-color:var(--ds-color-surface-hover)}[data-theme=default] ._item_1gk35_1:active{background-color:var(--ds-color-surface-active)}[data-theme=default] ._item_1gk35_1[data-selected=true]{background-color:var(--ds-color-background-subtle)}
1
+ ._item_go19k_1{font:inherit;color:inherit;border:0;text-align:inherit;text-decoration:none;line-height:normal;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;user-select:none;cursor:pointer;position:relative;width:100%;display:flex;align-items:center;column-gap:.25rem;margin:.5rem 0;border-radius:2px}._item_go19k_1[aria-disabled=true]{opacity:.5;pointer-events:none}._item_go19k_1[data-size=md]{min-height:56px}._item_go19k_1[data-size=md]{min-height:44px}._item_go19k_1[data-size=sm]{min-height:40px}._content_go19k_44{display:flex;width:100%;align-items:center;column-gap:6px;padding:6px}._action_go19k_52{display:flex;justify-content:center;align-items:center;padding:10px}._linkText_go19k_59{font-size:.875rem;white-space:nowrap}._linkIcon_go19k_64{font-size:1.5rem}._item_go19k_1,._item_go19k_1[data-theme]{background-color:transparent}[data-theme=subtle] ._item_go19k_1:hover{background-color:var(--ds-color-surface-hover)}[data-theme=subtle] ._item_go19k_1:active{background-color:var(--ds-color-surface-active)}[data-theme=subtle] ._item_go19k_1[data-selected=true]{background-color:var(--ds-color-background-default)}[data-theme=default] ._item_go19k_1:hover{background-color:var(--ds-color-surface-hover)}[data-theme=default] ._item_go19k_1:active{background-color:var(--ds-color-surface-active)}[data-theme=default] ._item_go19k_1[data-selected=true]{background-color:var(--ds-color-background-subtle)}
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
  import { jsxs as i, jsx as r, Fragment as f } from "react/jsx-runtime";
3
- import { useState as F, useMemo as L } from "react";
3
+ import { useState as L, useMemo as H } from "react";
4
4
  import "../../index-L8X2o7IH.js";
5
5
  import "../RootProvider/RootProvider.js";
6
- import { AccountMenu as H } from "./AccountMenu.js";
7
- import { AccountButton as I } from "./AccountButton.js";
8
- import { BackButton as W } from "./BackButton.js";
6
+ import { AccountMenu as I } from "./AccountMenu.js";
7
+ import { AccountButton as W } from "./AccountButton.js";
8
+ import { BackButton as q } from "./BackButton.js";
9
9
  import { LogoutButton as M } from "./LogoutButton.js";
10
10
  import "../Search/AutocompleteBase.js";
11
11
  import "../Snackbar/useSnackbar.js";
12
12
  import { MenuListItem as n } from "../Menu/MenuBase.js";
13
13
  import { Menu as k } from "../Menu/Menu.js";
14
14
  import { GlobalMenuBase as c, GlobalMenuHeader as g, GlobalMenuFooter as b } from "./GlobalMenuBase.js";
15
- const S = ({
15
+ const U = ({
16
16
  accounts: p = [],
17
17
  accountGroups: v = {},
18
18
  accountSearch: x,
@@ -23,35 +23,37 @@ const S = ({
23
23
  currentAccount: m,
24
24
  onSelectAccount: l,
25
25
  onClose: t,
26
- logoutButton: a
26
+ logoutButton: a,
27
+ isVirtualized: T
27
28
  }) => {
28
- const [T, j] = F(!1), o = () => {
29
- j((e) => !e);
30
- }, A = (e) => {
29
+ const [j, A] = L(!1), o = () => {
30
+ A((e) => !e);
31
+ }, F = (e) => {
31
32
  o(), t == null || t(), l == null || l(e);
32
- }, h = L(() => d.map((e) => ({
33
+ }, h = H(() => d.map((e) => ({
33
34
  ...e,
34
35
  onClick: () => {
35
36
  var u;
36
37
  (u = e.onClick) == null || u.call(e), t == null || t();
37
38
  }
38
39
  })), [d, t]);
39
- return T ? /* @__PURE__ */ i(c, { children: [
40
- /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(W, { onClick: o, label: B }) }),
40
+ return j ? /* @__PURE__ */ i(c, { children: [
41
+ /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(q, { onClick: o, label: B }) }),
41
42
  /* @__PURE__ */ r(n, { as: "div", role: "separator" }),
42
43
  /* @__PURE__ */ r(
43
- H,
44
+ I,
44
45
  {
45
46
  currentAccount: m,
46
47
  accounts: p,
47
48
  accountGroups: v,
48
49
  accountSearch: x,
49
- onSelectAccount: A
50
+ onSelectAccount: F,
51
+ isVirtualized: T
50
52
  }
51
53
  )
52
54
  ] }) : m ? /* @__PURE__ */ i(c, { children: [
53
55
  /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(
54
- I,
56
+ W,
55
57
  {
56
58
  account: m,
57
59
  linkText: G,
@@ -74,5 +76,5 @@ const S = ({
74
76
  ] });
75
77
  };
76
78
  export {
77
- S as GlobalMenu
79
+ U as GlobalMenu
78
80
  };
@@ -6,7 +6,7 @@ import { Badge as T } from "../Badge/Badge.js";
6
6
  import "../RootProvider/RootProvider.js";
7
7
  import "../Search/AutocompleteBase.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
- import '../../assets/MenuItemBase.css';const j = "_item_1gk35_1", B = "_content_1gk35_45", E = "_action_1gk35_53", g = "_linkText_1gk35_60", z = "_linkIcon_1gk35_65", n = {
9
+ import '../../assets/MenuItemBase.css';const j = "_item_go19k_1", B = "_content_go19k_44", E = "_action_go19k_52", g = "_linkText_go19k_59", z = "_linkIcon_go19k_64", n = {
10
10
  item: j,
11
11
  content: B,
12
12
  action: E,
@@ -19,8 +19,8 @@ import '../../assets/MenuItemBase.css';const j = "_item_1gk35_1", B = "_content_
19
19
  size: d,
20
20
  className: h,
21
21
  href: x,
22
- onClick: e,
23
- onKeyPress: o,
22
+ onClick: o,
23
+ onKeyPress: e,
24
24
  tabIndex: f = 0,
25
25
  hidden: k,
26
26
  selected: I,
@@ -33,7 +33,7 @@ import '../../assets/MenuItemBase.css';const j = "_item_1gk35_1", B = "_content_
33
33
  _ || "a",
34
34
  {
35
35
  tabIndex: i ? "-1" : f ?? 0,
36
- className: u(h, n.item),
36
+ className: u(n.item, h),
37
37
  "data-size": d,
38
38
  "data-color": l,
39
39
  "data-theme": p,
@@ -42,9 +42,9 @@ import '../../assets/MenuItemBase.css';const j = "_item_1gk35_1", B = "_content_
42
42
  "data-selected": I,
43
43
  href: x,
44
44
  onKeyPress: (r) => {
45
- r.key === "Enter" && (e == null || e()), o == null || o(r);
45
+ r.key === "Enter" && (o == null || o()), e == null || e(r);
46
46
  },
47
- onClick: e,
47
+ onClick: o,
48
48
  children: [
49
49
  /* @__PURE__ */ c("div", { className: n.content, children: [
50
50
  N,
@@ -14,4 +14,4 @@ export interface GlobalMenuProps extends AccountMenuProps {
14
14
  onSelectAccount?: (id: string) => void;
15
15
  onClose?: () => void;
16
16
  }
17
- export declare const GlobalMenu: ({ accounts, accountGroups, accountSearch, items, groups, changeLabel, backLabel, currentAccount, onSelectAccount, onClose, logoutButton, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const GlobalMenu: ({ accounts, accountGroups, accountSearch, items, groups, changeLabel, backLabel, currentAccount, onSelectAccount, onClose, logoutButton, isVirtualized, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import { Account } from './AccountButton.tsx';
3
3
  import { GlobalMenuProps } from './GlobalMenu';
4
4
  declare const meta: {
5
5
  title: string;
6
- component: ({ accounts, accountGroups, accountSearch, items, groups, changeLabel, backLabel, currentAccount, onSelectAccount, onClose, logoutButton, }: GlobalMenuProps) => import("react/jsx-runtime").JSX.Element;
6
+ component: ({ accounts, accountGroups, accountSearch, items, groups, changeLabel, backLabel, currentAccount, onSelectAccount, onClose, logoutButton, isVirtualized, }: 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.23.0",
3
+ "version": "0.23.1",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",