@altinn/altinn-components 0.43.4 → 0.43.5

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,44 +1,45 @@
1
- import { jsxs as g, jsx as p } from "react/jsx-runtime";
2
- import { createElement as x } from "react";
1
+ import { jsxs as x, jsx as p } from "react/jsx-runtime";
2
+ import { createElement as b } from "react";
3
3
  import "../../index-L8X2o7IH.js";
4
- import { AccountMenu as b } from "../Account/AccountMenu.js";
5
- import { useRootContext as k } from "../RootProvider/RootProvider.js";
6
- import { DrawerOrDropdown as I } from "../Dropdown/DrawerOrDropdown.js";
7
- import { useIsDesktop as h } from "../../hooks/useIsDesktop.js";
4
+ import { AccountMenu as k } from "../Account/AccountMenu.js";
5
+ import { useRootContext as I } from "../RootProvider/RootProvider.js";
6
+ import { DrawerOrDropdown as h } from "../Dropdown/DrawerOrDropdown.js";
7
+ import { useIsDesktop as w } from "../../hooks/useIsDesktop.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
- import { ToolbarButton as w } from "./ToolbarButton.js";
10
- import { ToolbarFilterBase as B } from "./ToolbarFilterBase.js";
11
- const R = ({
9
+ import { ToolbarButton as B } from "./ToolbarButton.js";
10
+ import { ToolbarFilterBase as C } from "./ToolbarFilterBase.js";
11
+ const q = ({
12
12
  currentAccount: o,
13
- id: a = "toolbar-accounts",
13
+ id: s = "toolbar-accounts",
14
14
  onSelectAccount: t,
15
- buttonTestId: n,
16
- ...d
15
+ buttonTestId: d,
16
+ title: l = "Endre aktør",
17
+ ...n
17
18
  }) => {
18
- const { currentId: i, toggleId: l, closeAll: s } = k(), f = h(), T = () => l(a), e = i === a;
19
- return /* @__PURE__ */ g(B, { expanded: e, onBlurCapture: (r) => {
20
- const m = r.relatedTarget;
21
- (!m || !r.currentTarget.contains(m)) && s();
19
+ const { currentId: i, toggleId: f, closeAll: a } = I(), T = w(), g = () => f(s), r = i === s;
20
+ return /* @__PURE__ */ x(C, { expanded: r, onBlurCapture: (e) => {
21
+ const m = e.relatedTarget;
22
+ (!m || !e.currentTarget.contains(m)) && a();
22
23
  }, dataTestId: "filter-base-accounts", children: [
23
24
  /* @__PURE__ */ p(
24
- w,
25
+ B,
25
26
  {
26
27
  type: "switch",
27
- onToggle: T,
28
+ onToggle: g,
28
29
  active: !!o,
29
- dataTestId: n,
30
- "aria-expanded": e,
30
+ dataTestId: d,
31
+ "aria-expanded": r,
31
32
  children: o == null ? void 0 : o.name
32
33
  }
33
34
  ),
34
- /* @__PURE__ */ p(I, { open: e, size: "lg", drawerTitle: "Endre konto", onClose: s, children: /* @__PURE__ */ x(
35
- b,
35
+ /* @__PURE__ */ p(h, { open: r, size: "lg", drawerTitle: l, onClose: a, children: /* @__PURE__ */ b(
36
+ k,
36
37
  {
37
- ...d,
38
- keyboardEvents: e && f,
38
+ ...n,
39
+ keyboardEvents: r && T,
39
40
  key: i,
40
- onSelectAccount: (r) => {
41
- t == null || t(r), s();
41
+ onSelectAccount: (e) => {
42
+ t == null || t(e), a();
42
43
  },
43
44
  currentAccount: o
44
45
  }
@@ -46,5 +47,5 @@ const R = ({
46
47
  ] });
47
48
  };
48
49
  export {
49
- R as ToolbarAccountMenu
50
+ q as ToolbarAccountMenu
50
51
  };
@@ -3,5 +3,6 @@ export interface ToolbarAccountMenuProps extends AccountMenuProps {
3
3
  id?: string;
4
4
  isVirtualized?: boolean;
5
5
  buttonTestId?: string;
6
+ title?: string;
6
7
  }
7
- export declare const ToolbarAccountMenu: ({ currentAccount, id, onSelectAccount, buttonTestId, ...rest }: ToolbarAccountMenuProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const ToolbarAccountMenu: ({ currentAccount, id, onSelectAccount, buttonTestId, title, ...rest }: ToolbarAccountMenuProps) => 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.43.4",
3
+ "version": "0.43.5",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",