@altinn/altinn-components 0.56.27 → 0.56.28

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,35 +1,36 @@
1
- import { jsx as r, jsxs as d } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as c } from "react/jsx-runtime";
2
2
  import { Button as u } from "../Button/Button.js";
3
3
  import "../../index-p1eeF8LQ.js";
4
4
  import "react";
5
- import { Dropdown as c } from "../Dropdown/Dropdown.js";
5
+ import { Dropdown as b } from "../Dropdown/Dropdown.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import { M as b } from "../../SearchField-QTfebYdU.js";
8
- import { useDropdownMenuController as f } from "../Menu/useDropdownMenuController.js";
7
+ import { M as f } from "../../SearchField-QTfebYdU.js";
8
+ import { useDropdownMenuController as h } from "../Menu/useDropdownMenuController.js";
9
9
  import "../Snackbar/useSnackbar.js";
10
- import { S as h } from "../../ChevronUpDown-DqGsU4MC.js";
11
- const D = ({
12
- title: a = "Title",
10
+ import { S as g } from "../../ChevronUpDown-DqGsU4MC.js";
11
+ const I = ({
12
+ title: s = "Title",
13
13
  label: i = "Label",
14
- items: s = [],
15
- dropdownSize: l = "sm",
16
- onSelectId: p,
14
+ items: l = [],
15
+ dropdownSize: p = "sm",
16
+ id: t = "toolbar-menu",
17
+ onSelectId: m,
17
18
  ...e
18
19
  }) => {
19
- const o = f({ id: "toolbar-menu", returnFocusOnClose: !0 }), t = e.searchable ? "combobox" : "menu", m = s.map((n) => ({
20
+ const o = h({ id: t, returnFocusOnClose: !0 }), a = e.searchable ? "combobox" : "menu", d = l.map((n) => ({
20
21
  ...n,
21
22
  onClick: () => {
22
- p?.(n?.id ?? ""), n?.role !== "checkbox" && o.setOpen(!1);
23
+ m?.(n?.id ?? ""), n?.role !== "checkbox" && o.setOpen(!1);
23
24
  }
24
25
  }));
25
26
  return /* @__PURE__ */ r(
26
- c,
27
+ b,
27
28
  {
28
- id: "toolbar-menu",
29
+ id: t,
29
30
  variant: "drawer-dropdown",
30
- title: a,
31
- size: l,
32
- trigger: /* @__PURE__ */ d(
31
+ title: s,
32
+ size: p,
33
+ trigger: /* @__PURE__ */ c(
33
34
  u,
34
35
  {
35
36
  variant: "solid",
@@ -40,7 +41,7 @@ const D = ({
40
41
  ref: o.triggerRef,
41
42
  children: [
42
43
  /* @__PURE__ */ r("span", { children: i }),
43
- /* @__PURE__ */ r(h, { "aria-hidden": "true", focusable: "false" })
44
+ /* @__PURE__ */ r(g, { "aria-hidden": "true", focusable: "false" })
44
45
  ]
45
46
  }
46
47
  ),
@@ -48,20 +49,20 @@ const D = ({
48
49
  onClose: () => o.setOpen(!1),
49
50
  ...e?.searchable ? {} : o.dropdownA11yProps,
50
51
  children: /* @__PURE__ */ r(
51
- b,
52
+ f,
52
53
  {
53
54
  ...e,
54
- items: m,
55
+ items: d,
55
56
  keyboardEvents: o.open,
56
- a11yMode: t,
57
+ a11yMode: a,
57
58
  open: o.open,
58
59
  scrollToTopOnOpen: e.virtualized,
59
- ...t === "combobox" ? { id: o.menuId } : o.menuA11yProps
60
+ ...a === "combobox" ? { id: o.menuId } : o.menuA11yProps
60
61
  }
61
62
  )
62
63
  }
63
64
  );
64
65
  };
65
66
  export {
66
- D as ToolbarMenu
67
+ I as ToolbarMenu
67
68
  };
@@ -6,4 +6,4 @@ export interface ToolbarMenuProps extends Omit<MenuProps, 'variant'> {
6
6
  dropdownSize?: DropdownProps['size'];
7
7
  onSelectId?: (id: string) => void;
8
8
  }
9
- export declare const ToolbarMenu: ({ title, label, items, dropdownSize, onSelectId, ...props }: ToolbarMenuProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const ToolbarMenu: ({ title, label, items, dropdownSize, id, onSelectId, ...props }: ToolbarMenuProps) => 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.27",
3
+ "version": "0.56.28",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",