@altinn/altinn-components 0.56.1 → 0.56.3

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.
Files changed (37) hide show
  1. package/dist/{SearchField-BUp4_VIq.js → SearchField-CN2mo8ck.js} +42 -42
  2. package/dist/assets/Dropdown.css +1 -1
  3. package/dist/assets/LayoutSidebar.css +1 -1
  4. package/dist/assets/QueryLabel.css +1 -1
  5. package/dist/assets/SearchField.css +1 -1
  6. package/dist/components/Account/AccountMenu.js +1 -1
  7. package/dist/components/ContextMenu/ContextMenu.js +1 -1
  8. package/dist/components/Dialog/DialogActions.js +1 -1
  9. package/dist/components/Dropdown/Dropdown.js +32 -32
  10. package/dist/components/Forms/SearchField.js +1 -1
  11. package/dist/components/Forms/index.js +1 -1
  12. package/dist/components/GlobalHeader/AccountSelector.js +1 -1
  13. package/dist/components/GlobalMenu/GlobalMenu.js +1 -1
  14. package/dist/components/GlobalMenu/LocaleSwitcher.js +1 -1
  15. package/dist/components/GlobalMenu_old/GlobalMenu.js +1 -1
  16. package/dist/components/Header/LocaleSwitcher.js +1 -1
  17. package/dist/components/Layout/Layout.js +28 -37
  18. package/dist/components/Layout/LayoutSidebar.js +8 -25
  19. package/dist/components/Menu/Menu.js +1 -1
  20. package/dist/components/Menu/MenuItems.js +1 -1
  21. package/dist/components/Menu/MenuListSearch.js +1 -1
  22. package/dist/components/Menu/VirtualizedMenuItems.js +1 -1
  23. package/dist/components/Menu/index.js +1 -1
  24. package/dist/components/Searchbar/QueryLabel.js +5 -5
  25. package/dist/components/Toolbar/SelectDateFilter.js +1 -1
  26. package/dist/components/Toolbar/ToolbarFilter.js +33 -34
  27. package/dist/components/Toolbar/ToolbarFilterAddMenu.js +24 -22
  28. package/dist/components/Toolbar/ToolbarFilterMenu.js +53 -50
  29. package/dist/components/Toolbar/ToolbarMenu.js +19 -17
  30. package/dist/components/Toolbar/ToolbarSearch.js +1 -1
  31. package/dist/components/index.js +1 -1
  32. package/dist/index.js +1 -1
  33. package/dist/types/lib/components/Layout/LayoutSidebar.d.ts +1 -2
  34. package/dist/types/lib/components/Toolbar/ToolbarFilterAddMenu.d.ts +3 -1
  35. package/dist/types/lib/components/Toolbar/ToolbarFilterMenu.d.ts +3 -1
  36. package/dist/types/lib/components/Toolbar/ToolbarMenu.d.ts +3 -1
  37. package/package.json +1 -1
@@ -1,57 +1,48 @@
1
1
  "use client";
2
2
  import { jsxs as m, jsx as r } from "react/jsx-runtime";
3
- import { LayoutBase as s } from "./LayoutBase.js";
4
- import { LayoutBody as y } from "./LayoutBody.js";
5
- import { LayoutContent as x } from "./LayoutContent.js";
6
- import { LayoutSidebar as L } from "./LayoutSidebar.js";
7
- import { Footer as a } from "../Footer/Footer.js";
8
- import { GlobalHeader as d } from "../GlobalHeader/GlobalHeader.js";
3
+ import { LayoutBase as h } from "./LayoutBase.js";
4
+ import { LayoutBody as a } from "./LayoutBody.js";
5
+ import { LayoutContent as y } from "./LayoutContent.js";
6
+ import { LayoutSidebar as d } from "./LayoutSidebar.js";
7
+ import { Footer as x } from "../Footer/Footer.js";
8
+ import { GlobalHeader as L } from "../GlobalHeader/GlobalHeader.js";
9
9
  import "../../index-p1eeF8LQ.js";
10
10
  import "react";
11
11
  import "../Button/Button.js";
12
- import { M as S } from "../../SearchField-BUp4_VIq.js";
12
+ import { M as S } from "../../SearchField-CN2mo8ck.js";
13
13
  import { useRootContext as j } from "../RootProvider/RootProvider.js";
14
14
  import { Header as B } from "../Header/Header.js";
15
15
  import "../Snackbar/useSnackbar.js";
16
16
  import { InboxSearch as C } from "../InboxSearch/InboxSearch.js";
17
17
  import { SkipLink as F } from "../SkipLink/SkipLink.js";
18
- const O = ({
18
+ const N = ({
19
19
  color: f,
20
- theme: u = "subtle",
20
+ theme: l = "subtle",
21
21
  header: t,
22
- footer: c,
22
+ footer: i,
23
23
  sidebar: o,
24
- content: l = {},
25
- children: h,
26
- skipLink: p,
27
- useGlobalHeader: n = !1
24
+ content: u = {},
25
+ children: s,
26
+ skipLink: c,
27
+ useGlobalHeader: e = !1
28
28
  }) => {
29
- const { currentId: i } = j(), e = t && "search" in t ? t.search : void 0;
30
- return /* @__PURE__ */ m(s, { color: f, theme: i === "accountFullscreen" ? "default" : u, currentId: i, children: [
31
- p && /* @__PURE__ */ r(F, { ...p }),
32
- t && (n ? /* @__PURE__ */ r(d, { ...t }) : /* @__PURE__ */ r(B, { ...t })),
33
- /* @__PURE__ */ m(y, { currentId: i, children: [
34
- o && /* @__PURE__ */ m(
35
- L,
36
- {
37
- hidden: o?.hidden,
38
- color: o?.color,
39
- footer: o?.footer,
40
- useGlobalHeader: n,
41
- children: [
42
- o?.menu && /* @__PURE__ */ r(S, { ...o?.menu }),
43
- o?.children
44
- ]
45
- }
46
- ),
47
- /* @__PURE__ */ m(x, { color: l?.color, id: "main-content", children: [
48
- n && e && /* @__PURE__ */ r(C, { search: e }),
49
- h
29
+ const { currentId: n } = j(), p = t && "search" in t ? t.search : void 0;
30
+ return /* @__PURE__ */ m(h, { color: f, theme: n === "accountFullscreen" ? "default" : l, currentId: n, children: [
31
+ c && /* @__PURE__ */ r(F, { ...c }),
32
+ t && (e ? /* @__PURE__ */ r(L, { ...t }) : /* @__PURE__ */ r(B, { ...t })),
33
+ /* @__PURE__ */ m(a, { currentId: n, children: [
34
+ o && /* @__PURE__ */ m(d, { hidden: o?.hidden, color: o?.color, footer: o?.footer, children: [
35
+ o?.menu && /* @__PURE__ */ r(S, { ...o?.menu }),
36
+ o?.children
37
+ ] }),
38
+ /* @__PURE__ */ m(y, { color: u?.color, id: "main-content", children: [
39
+ e && p && /* @__PURE__ */ r(C, { search: p }),
40
+ s
50
41
  ] })
51
42
  ] }),
52
- c && /* @__PURE__ */ r(a, { ...c })
43
+ i && /* @__PURE__ */ r(x, { ...i })
53
44
  ] });
54
45
  };
55
46
  export {
56
- O as Layout
47
+ N as Layout
57
48
  };
@@ -1,28 +1,11 @@
1
- import { jsxs as i, jsx as c } from "react/jsx-runtime";
2
- import '../../assets/LayoutSidebar.css';const l = "_sidebar_16tee_1", n = "_footer_16tee_9", a = {
3
- sidebar: l,
1
+ import { jsxs as d, jsx as i } from "react/jsx-runtime";
2
+ import '../../assets/LayoutSidebar.css';const c = "_sidebar_1yk7j_1", n = "_footer_1yk7j_9", a = {
3
+ sidebar: c,
4
4
  footer: n
5
- }, f = ({
6
- color: s,
7
- hidden: r = !1,
8
- sticky: t,
9
- children: o,
10
- footer: e,
11
- useGlobalHeader: d = !1
12
- }) => /* @__PURE__ */ i(
13
- "aside",
14
- {
15
- className: a.sidebar,
16
- "data-color": s,
17
- "data-sticky": t,
18
- "data-use-global-header": d,
19
- "aria-hidden": r,
20
- children: [
21
- o,
22
- e && /* @__PURE__ */ c("div", { className: a.footer, children: e })
23
- ]
24
- }
25
- );
5
+ }, _ = ({ color: e, hidden: r = !1, sticky: o, children: t, footer: s }) => /* @__PURE__ */ d("aside", { className: a.sidebar, "data-color": e, "data-sticky": o, "aria-hidden": r, children: [
6
+ t,
7
+ s && /* @__PURE__ */ i("div", { className: a.footer, children: s })
8
+ ] });
26
9
  export {
27
- f as LayoutSidebar
10
+ _ as LayoutSidebar
28
11
  };
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { M as t } from "../../SearchField-BUp4_VIq.js";
2
+ import { M as t } from "../../SearchField-CN2mo8ck.js";
3
3
  import "./useMenuSearch.js";
4
4
  export {
5
5
  t as Menu
@@ -4,7 +4,7 @@ import "../../index-p1eeF8LQ.js";
4
4
  import "../../hooks/useMenu.js";
5
5
  import "../Button/Button.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import { a as b } from "../../SearchField-BUp4_VIq.js";
7
+ import { a as b } from "../../SearchField-CN2mo8ck.js";
8
8
  import "./MenuItem.js";
9
9
  import "./MenuList.js";
10
10
  import "./MenuListItem.js";
@@ -3,7 +3,7 @@ import "../../index-p1eeF8LQ.js";
3
3
  import "react";
4
4
  import "../Button/Button.js";
5
5
  import "../RootProvider/RootProvider.js";
6
- import { b as s } from "../../SearchField-BUp4_VIq.js";
6
+ import { b as s } from "../../SearchField-CN2mo8ck.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
8
  export {
9
9
  s as MenuListSearch
@@ -4,7 +4,7 @@ import "../../index-p1eeF8LQ.js";
4
4
  import "../../hooks/useMenu.js";
5
5
  import "../Button/Button.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import { V as z } from "../../SearchField-BUp4_VIq.js";
7
+ import { V as z } from "../../SearchField-CN2mo8ck.js";
8
8
  import "./MenuItem.js";
9
9
  import "./MenuList.js";
10
10
  import "./MenuListItem.js";
@@ -1,4 +1,4 @@
1
- import { M as t, a as o, b as n, V as u } from "../../SearchField-BUp4_VIq.js";
1
+ import { M as t, a as o, b as n, V as u } from "../../SearchField-CN2mo8ck.js";
2
2
  import { MenuItem as M } from "./MenuItem.js";
3
3
  import { MenuList as s } from "./MenuList.js";
4
4
  import { MenuListItem as a } from "./MenuListItem.js";
@@ -1,12 +1,12 @@
1
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
2
- import '../../assets/QueryLabel.css';const n = "_label_1jqye_1", o = "_group_1jqye_25", p = "_plus_1jqye_31", m = "_item_1jqye_35", l = {
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import '../../assets/QueryLabel.css';const n = "_label_yf5z4_1", o = "_group_yf5z4_25", p = "_plus_yf5z4_31", m = "_item_yf5z4_35", l = {
3
3
  label: n,
4
4
  group: o,
5
5
  plus: p,
6
6
  item: m
7
- }, u = ({ type: e = "search", label: t }) => /* @__PURE__ */ s("span", { className: l.item, "data-type": e, children: t }), i = ({ params: e = [], size: t = "sm" }) => /* @__PURE__ */ s("div", { className: l.label, "data-size": t, children: e.map((r, a) => /* @__PURE__ */ c("div", { className: l.group, children: [
8
- /* @__PURE__ */ s(u, { ...r }),
9
- e[a + 1] && /* @__PURE__ */ s("span", { className: l.plus, children: "+" })
7
+ }, u = ({ type: s = "search", label: t }) => /* @__PURE__ */ e("span", { className: l.item, "data-type": s, children: t }), i = ({ params: s = [], size: t = "sm" }) => /* @__PURE__ */ e("div", { className: l.label, "data-size": t, children: s.map((r, a) => /* @__PURE__ */ c("div", { className: l.group, children: [
8
+ /* @__PURE__ */ e(u, { ...r }),
9
+ s[a + 1] && /* @__PURE__ */ e("span", { className: l.plus, children: "+" })
10
10
  ] }, a)) });
11
11
  export {
12
12
  u as QueryItem,
@@ -1,6 +1,6 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
2
  import { useState as b } from "react";
3
- import { M as g } from "../../SearchField-BUp4_VIq.js";
3
+ import { M as g } from "../../SearchField-CN2mo8ck.js";
4
4
  import "../../index-p1eeF8LQ.js";
5
5
  import "../Button/Button.js";
6
6
  import "../RootProvider/RootProvider.js";
@@ -1,79 +1,78 @@
1
- import { jsxs as g, jsx as m } from "react/jsx-runtime";
2
- import { useState as C, createElement as M } from "react";
3
- import { Button as w } from "../Button/Button.js";
1
+ import { jsxs as g, Fragment as f, jsx as l } from "react/jsx-runtime";
2
+ import { useState as B, createElement as I } from "react";
3
+ import { Button as L } from "../Button/Button.js";
4
4
  import "../../index-p1eeF8LQ.js";
5
5
  import "../RootProvider/RootProvider.js";
6
6
  import "../Snackbar/useSnackbar.js";
7
- import { useFilter as I } from "./useFilter.js";
8
- import { ButtonGroup as L } from "../Button/ButtonGroup.js";
9
- import { ToolbarFilterAddMenu as N } from "./ToolbarFilterAddMenu.js";
10
- import { ToolbarFilterMenu as O } from "./ToolbarFilterMenu.js";
7
+ import { useFilter as N } from "./useFilter.js";
8
+ import { ToolbarFilterAddMenu as O } from "./ToolbarFilterAddMenu.js";
9
+ import { ToolbarFilterMenu as w } from "./ToolbarFilterMenu.js";
11
10
  import { S as y } from "../../XMark-tKk6aExO.js";
12
- const V = ({
11
+ const U = ({
13
12
  filters: n,
14
13
  filterState: e = {},
15
14
  onFilterStateChange: r,
16
- addLabel: u = "Legg til filter",
17
- addNextLabel: b = "Legg til",
18
- resetLabel: v = "Nullstill",
19
- removeLabel: h = "Fjern filter",
20
- submitLabel: F,
15
+ addLabel: b = "Legg til filter",
16
+ addNextLabel: v = "Legg til",
17
+ resetLabel: u = "Nullstill",
18
+ removeLabel: F = "Fjern filter",
19
+ submitLabel: h,
21
20
  getFilterLabel: T,
22
21
  virtualized: j
23
22
  }) => {
24
- const { visibleFilters: l, hiddenFilters: s, onFilterAdd: x, onFilterChange: R, onFilterRemove: i } = I({
23
+ const { visibleFilters: m, hiddenFilters: s, onFilterAdd: R, onFilterChange: k, onFilterRemove: i } = N({
25
24
  filters: n,
26
25
  filterState: e,
27
26
  onFilterStateChange: r
28
- }), f = (n?.filter((o) => o.removable)?.length || 0) > 0 && Object.values(e)?.some((o) => o && o?.length > 0), k = n?.filter((o) => o.removable)?.map((o) => o.name) ?? [], [a, d] = C(void 0), p = (o) => {
27
+ }), x = (n?.filter((o) => o.removable)?.length || 0) > 0 && Object.values(e)?.some((o) => o && o?.length > 0), A = n?.filter((o) => o.removable)?.map((o) => o.name) ?? [], [a, d] = B(void 0), p = (o) => {
29
28
  d((t) => t === o ? void 0 : o);
30
29
  }, c = () => {
31
30
  d(void 0);
32
- }, A = () => {
33
- for (const o of k)
31
+ }, C = () => {
32
+ for (const o of A)
34
33
  i(o);
35
34
  r?.({});
36
35
  };
37
- return /* @__PURE__ */ g(L, { size: "xs", wrap: !0, children: [
38
- l?.map((o, t) => {
39
- const B = T?.(o?.name, e?.[o?.id]) ?? o?.label;
40
- return /* @__PURE__ */ M(
41
- O,
36
+ return /* @__PURE__ */ g(f, { children: [
37
+ m?.map((o, t) => {
38
+ const M = T?.(o?.name, e?.[o?.id]) ?? o?.label;
39
+ return /* @__PURE__ */ I(
40
+ w,
42
41
  {
43
42
  ...o,
44
- submitLabel: F,
43
+ submitLabel: h,
45
44
  key: t,
46
45
  onToggle: () => p(o.name),
47
46
  onClose: c,
48
47
  open: a === o.name,
49
- label: B,
48
+ label: M,
50
49
  onRemove: () => i(o.name),
51
- removeLabel: h,
52
- onFilterChange: R,
50
+ removeLabel: F,
51
+ onFilterChange: k,
53
52
  onFilterStateChange: r,
54
53
  filterState: e
55
54
  }
56
55
  );
57
56
  }),
58
- s?.length > 0 && /* @__PURE__ */ m(
59
- N,
57
+ s?.length > 0 && /* @__PURE__ */ l(
58
+ O,
60
59
  {
61
60
  name: "add",
62
61
  onToggle: () => p("add"),
63
62
  onClose: c,
64
63
  open: a === "add",
65
64
  items: s,
66
- onAdd: x,
67
- label: l?.length > 0 ? b : u,
65
+ onAdd: R,
66
+ label: m?.length > 0 ? v : b,
68
67
  virtualized: j
69
68
  }
70
69
  ),
71
- f && /* @__PURE__ */ g(w, { onClick: A, variant: "ghost", children: [
72
- /* @__PURE__ */ m(y, { "aria-hidden": "true" }),
73
- /* @__PURE__ */ m("span", { children: v })
70
+ x && /* @__PURE__ */ g(L, { onClick: C, variant: "ghost", children: [
71
+ /* @__PURE__ */ l(y, { "aria-hidden": "true" }),
72
+ /* @__PURE__ */ l("span", { children: u })
74
73
  ] })
75
74
  ] });
76
75
  };
77
76
  export {
78
- V as ToolbarFilter
77
+ U as ToolbarFilter
79
78
  };
@@ -1,15 +1,15 @@
1
1
  "use client";
2
- import { jsx as s, jsxs as h } from "react/jsx-runtime";
3
- import u, { forwardRef as v, useRef as m, useEffect as y } from "react";
4
- import { Button as w } from "../Button/Button.js";
2
+ import { jsx as s, jsxs as v } from "react/jsx-runtime";
3
+ import u, { forwardRef as y, useRef as m, useEffect as w } from "react";
4
+ import { Button as b } from "../Button/Button.js";
5
5
  import "../../index-p1eeF8LQ.js";
6
- import { Dropdown as b } from "../Dropdown/Dropdown.js";
6
+ import { Dropdown as O } from "../Dropdown/Dropdown.js";
7
7
  import "../RootProvider/RootProvider.js";
8
- import { M as O } from "../../SearchField-BUp4_VIq.js";
9
- import { useDropdownMenuController as I } from "../Menu/useDropdownMenuController.js";
8
+ import { M as I } from "../../SearchField-CN2mo8ck.js";
9
+ import { useDropdownMenuController as x } from "../Menu/useDropdownMenuController.js";
10
10
  import "../Snackbar/useSnackbar.js";
11
- import { u as x } from "../../useId-BVFxCjkq.js";
12
- var R = function(t, a) {
11
+ import { u as R } from "../../useId-BVFxCjkq.js";
12
+ var j = function(t, a) {
13
13
  var o = {};
14
14
  for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && a.indexOf(e) < 0 && (o[e] = t[e]);
15
15
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
@@ -17,9 +17,9 @@ var R = function(t, a) {
17
17
  a.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[r]) && (o[e[r]] = t[e[r]]);
18
18
  return o;
19
19
  };
20
- const j = v((t, a) => {
21
- var { title: o, titleId: e } = t, r = R(t, ["title", "titleId"]);
22
- let i = x();
20
+ const C = y((t, a) => {
21
+ var { title: o, titleId: e } = t, r = j(t, ["title", "titleId"]);
22
+ let i = R();
23
23
  return i = o ? e || "title-" + i : void 0, u.createElement(
24
24
  "svg",
25
25
  Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: a, "aria-labelledby": i }, r),
@@ -33,28 +33,30 @@ const j = v((t, a) => {
33
33
  onAdd: e,
34
34
  onToggle: r,
35
35
  onClose: i,
36
- open: n
36
+ open: n,
37
+ dropdownSize: p = "sm"
37
38
  }) => {
38
- const l = I({ id: "tool-filter-add" }), f = m(n), p = m(!1), c = a?.map((d) => ({
39
+ const l = x({ id: "tool-filter-add" }), f = m(n), g = m(!1), c = a?.map((d) => ({
39
40
  linkIcon: !0,
40
41
  ...d,
41
42
  onClick: () => e?.(d?.name ?? "")
42
43
  }));
43
- if (y(() => {
44
+ if (w(() => {
44
45
  const d = f.current;
45
46
  f.current = n, d && !n && l?.triggerRef?.current?.focus();
46
47
  }, [n, l.triggerRef]), !c?.length)
47
48
  return null;
48
- const g = () => {
49
+ const h = () => {
49
50
  const d = document.getElementById(l.menuId);
50
- p.current = !!d?.querySelector('[aria-haspopup="menu"][aria-expanded="true"]'), i();
51
+ g.current = !!d?.querySelector('[aria-haspopup="menu"][aria-expanded="true"]'), i();
51
52
  };
52
53
  return /* @__PURE__ */ s(
53
- b,
54
+ O,
54
55
  {
55
56
  variant: "drawer-dropdown",
56
- trigger: /* @__PURE__ */ h(
57
- w,
57
+ size: p,
58
+ trigger: /* @__PURE__ */ v(
59
+ b,
58
60
  {
59
61
  variant: "secondary",
60
62
  style: {
@@ -66,15 +68,15 @@ const j = v((t, a) => {
66
68
  onClick: r,
67
69
  ref: l.triggerRef,
68
70
  children: [
69
- /* @__PURE__ */ s(j, { "aria-hidden": "true", focusable: "false" }),
71
+ /* @__PURE__ */ s(C, { "aria-hidden": "true", focusable: "false" }),
70
72
  /* @__PURE__ */ s("span", { children: t })
71
73
  ]
72
74
  }
73
75
  ),
74
76
  open: n,
75
- onClose: g,
77
+ onClose: h,
76
78
  ...l.dropdownA11yProps,
77
- children: /* @__PURE__ */ s(O, { groups: o, items: c, maxLevels: 1, keyboardEvents: n, open: n, ...l.menuA11yProps })
79
+ children: /* @__PURE__ */ s(I, { groups: o, items: c, maxLevels: 1, keyboardEvents: n, open: n, ...l.menuA11yProps })
78
80
  }
79
81
  );
80
82
  };
@@ -1,116 +1,119 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { useRef as T, useEffect as q } from "react";
2
+ import { useRef as q, useEffect as G } from "react";
3
3
  import "../../index-p1eeF8LQ.js";
4
4
  import "../Button/Button.js";
5
- import { M as G } from "../../SearchField-BUp4_VIq.js";
6
- import { useDropdownMenuController as H } from "../Menu/useDropdownMenuController.js";
5
+ import { M as H } from "../../SearchField-CN2mo8ck.js";
6
+ import { useDropdownMenuController as J } from "../Menu/useDropdownMenuController.js";
7
7
  import "../RootProvider/RootProvider.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
- import { Dropdown as A } from "../Dropdown/Dropdown.js";
10
- import { ToolbarFilterButton as I } from "./ToolbarFilterButton.js";
9
+ import { Dropdown as I } from "../Dropdown/Dropdown.js";
10
+ import { ToolbarFilterButton as R } from "./ToolbarFilterButton.js";
11
11
  const L = ({
12
- as: R,
13
- size: a,
12
+ as: F,
13
+ size: s,
14
14
  name: n,
15
- label: s = "",
16
- searchable: d,
15
+ label: a = "",
16
+ searchable: m,
17
17
  groups: f,
18
18
  items: l,
19
- removable: F,
20
- removeLabel: P = "Fjern filter",
21
- filterState: m,
19
+ removable: P,
20
+ removeLabel: E = "Fjern filter",
21
+ filterState: d,
22
22
  onFilterStateChange: p,
23
- onFilterChange: E,
24
- onRemove: j,
23
+ onFilterChange: j,
24
+ onRemove: C,
25
25
  open: t,
26
26
  onToggle: g,
27
27
  onClose: u,
28
28
  submitLabel: v,
29
- search: w,
30
- virtualized: y,
29
+ search: y,
30
+ virtualized: w,
31
31
  title: b,
32
- variant: C
32
+ variant: D,
33
+ dropdownSize: x = "sm"
33
34
  }) => {
34
- const x = T(t), o = H({ id: "toolbar-filter-menu" });
35
- q(() => {
36
- const r = x.current;
37
- x.current = t, r && !t && o?.triggerRef?.current?.focus();
35
+ const M = q(t), o = J({ id: "toolbar-filter-menu" });
36
+ G(() => {
37
+ const r = M.current;
38
+ M.current = t, r && !t && o?.triggerRef?.current?.focus();
38
39
  }, [t, o.triggerRef]);
39
- const D = (r) => {
40
- const c = r.target.type, V = r.target.name, B = r.target.value;
41
- E?.(c, V, B), c === "radio" && u();
42
- }, M = l?.map((r) => ({
40
+ const O = (r) => {
41
+ const c = r.target.type, B = r.target.name, T = r.target.value;
42
+ j?.(c, B, T), c === "radio" && u();
43
+ }, h = l?.map((r) => ({
43
44
  ...r,
44
- onChange: (c) => D(c)
45
- })), O = (l?.filter((r) => r.checked)?.map((r) => r.value || "true")).length > 0 || m?.[n]?.length, h = C || O ? "tinted" : "outline", k = R || G, i = d ? "combobox" : "menu";
46
- return F ? /* @__PURE__ */ e(
47
- A,
45
+ onChange: (c) => O(c)
46
+ })), V = (l?.filter((r) => r.checked)?.map((r) => r.value || "true")).length > 0 || d?.[n]?.length, k = D || V ? "tinted" : "outline", A = F || H, i = m ? "combobox" : "menu";
47
+ return P ? /* @__PURE__ */ e(
48
+ I,
48
49
  {
49
50
  submitLabel: v,
50
51
  title: b,
51
52
  variant: "drawer-dropdown",
53
+ size: x,
52
54
  trigger: /* @__PURE__ */ e(
53
- I,
55
+ R,
54
56
  {
55
57
  name: n,
56
58
  onClick: g,
57
- onRemove: j,
59
+ onRemove: C,
58
60
  removable: !0,
59
- variant: h,
60
- removeLabel: P,
61
+ variant: k,
62
+ removeLabel: E,
61
63
  open: t,
62
64
  "aria-expanded": t,
63
65
  "aria-controls": o.menuId,
64
66
  ref: o.triggerRef,
65
- children: s
67
+ children: a
66
68
  }
67
69
  ),
68
70
  open: t,
69
71
  onClose: u,
70
72
  ...o.dropdownA11yProps,
71
73
  children: /* @__PURE__ */ e(
72
- k,
74
+ A,
73
75
  {
74
- search: w,
76
+ search: y,
75
77
  name: n,
76
- filterState: m,
78
+ filterState: d,
77
79
  onFilterStateChange: p,
78
- size: a,
79
- searchable: d,
80
+ size: s,
81
+ searchable: m,
80
82
  groups: f,
81
- items: M,
83
+ items: h,
82
84
  keyboardEvents: t,
83
85
  a11yMode: i,
84
86
  ...i === "combobox" ? { id: o.menuId } : o.menuA11yProps,
85
- virtualized: y
87
+ virtualized: w
86
88
  }
87
89
  )
88
90
  }
89
91
  ) : /* @__PURE__ */ e(
90
- A,
92
+ I,
91
93
  {
94
+ size: x,
92
95
  title: b,
93
96
  variant: "drawer-dropdown",
94
97
  submitLabel: v,
95
- trigger: /* @__PURE__ */ e(I, { name: n, onClick: g, variant: h, children: s }),
98
+ trigger: /* @__PURE__ */ e(R, { name: n, onClick: g, variant: k, children: a }),
96
99
  open: t,
97
100
  onClose: u,
98
101
  ...o.dropdownA11yProps,
99
102
  children: /* @__PURE__ */ e(
100
- k,
103
+ A,
101
104
  {
102
- search: w,
105
+ search: y,
103
106
  name: n,
104
- filterState: m,
107
+ filterState: d,
105
108
  onFilterStateChange: p,
106
- size: a,
107
- searchable: d,
109
+ size: s,
110
+ searchable: m,
108
111
  groups: f,
109
- items: M,
112
+ items: h,
110
113
  keyboardEvents: t,
111
114
  a11yMode: i,
112
115
  ...i === "combobox" ? { id: o.menuId } : o.menuA11yProps,
113
- virtualized: y
116
+ virtualized: w
114
117
  }
115
118
  )
116
119
  }