@altinn/altinn-components 0.56.0 → 0.56.2

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/DatepickerTable.css +1 -1
  3. package/dist/assets/Dropdown.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/Datepicker/DatepickerTable.js +6 -6
  9. package/dist/components/Dialog/DialogActions.js +1 -1
  10. package/dist/components/Dropdown/Dropdown.js +32 -32
  11. package/dist/components/Forms/SearchField.js +1 -1
  12. package/dist/components/Forms/index.js +1 -1
  13. package/dist/components/GlobalHeader/AccountSelector.js +1 -1
  14. package/dist/components/GlobalMenu/GlobalMenu.js +1 -1
  15. package/dist/components/GlobalMenu/LocaleSwitcher.js +1 -1
  16. package/dist/components/GlobalMenu_old/GlobalMenu.js +1 -1
  17. package/dist/components/Header/LocaleSwitcher.js +1 -1
  18. package/dist/components/Layout/Layout.js +1 -1
  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/Settings/BookmarksSettingsList.js +25 -25
  26. package/dist/components/Toolbar/SelectDateFilter.js +20 -20
  27. package/dist/components/Toolbar/ToolbarFilter.js +33 -34
  28. package/dist/components/Toolbar/ToolbarFilterAddMenu.js +24 -22
  29. package/dist/components/Toolbar/ToolbarFilterMenu.js +53 -50
  30. package/dist/components/Toolbar/ToolbarMenu.js +19 -17
  31. package/dist/components/Toolbar/ToolbarSearch.js +1 -1
  32. package/dist/components/index.js +1 -1
  33. package/dist/index.js +1 -1
  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,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,44 +1,44 @@
1
- import { jsxs as i, Fragment as e, jsx as o } from "react/jsx-runtime";
2
- import { createElement as c } from "react";
1
+ import { jsxs as i, Fragment as s, jsx as o } from "react/jsx-runtime";
2
+ import { Fragment as c, createElement as g } from "react";
3
3
  import "../../index-p1eeF8LQ.js";
4
- import { Typography as g } from "../Typography/Typography.js";
5
- import { Heading as h } from "../Typography/Heading.js";
4
+ import { Typography as h } from "../Typography/Typography.js";
5
+ import { Heading as f } from "../Typography/Heading.js";
6
6
  import "../Button/Button.js";
7
7
  import "../RootProvider/RootProvider.js";
8
- import { Divider as f } from "../Divider/Divider.js";
9
- import { List as k } from "../List/List.js";
8
+ import { Divider as k } from "../Divider/Divider.js";
9
+ import { List as x } from "../List/List.js";
10
10
  import "../Snackbar/useSnackbar.js";
11
- import { Flex as x } from "../Page/Flex.js";
11
+ import { Flex as F } from "../Page/Flex.js";
12
12
  import { SettingsSection as S } from "./SettingsSection.js";
13
13
  import { BookmarksSettingsItem as u } from "./BookmarksSettingsItem.js";
14
- const U = ({
15
- loading: n,
16
- title: m,
17
- description: l,
14
+ const $ = ({
15
+ loading: e,
16
+ title: n,
17
+ description: m,
18
18
  items: t,
19
- untitled: p = "Untitled bookmark",
19
+ untitled: l = "Untitled bookmark",
20
20
  expandedId: d,
21
- onToggle: s
22
- }) => /* @__PURE__ */ i(e, { children: [
23
- /* @__PURE__ */ o(h, { size: "lg", children: m }),
24
- t.length > 0 && /* @__PURE__ */ i(x, { direction: "col", spacing: 4, children: [
25
- /* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(k, { size: "sm", children: t.map((r, a) => /* @__PURE__ */ i(e, { children: [
26
- a > 0 && /* @__PURE__ */ o(f, {}),
27
- /* @__PURE__ */ c(
21
+ onToggle: p
22
+ }) => /* @__PURE__ */ i(s, { children: [
23
+ /* @__PURE__ */ o(f, { size: "lg", children: n }),
24
+ t.length > 0 && /* @__PURE__ */ i(F, { direction: "col", spacing: 4, children: [
25
+ /* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(x, { size: "sm", children: t.map((r, a) => /* @__PURE__ */ i(c, { children: [
26
+ a > 0 && /* @__PURE__ */ o(k, {}),
27
+ /* @__PURE__ */ g(
28
28
  u,
29
29
  {
30
30
  ...r,
31
31
  key: r.id,
32
- title: r?.title || p,
33
- loading: n || r.loading,
34
- onToggle: () => s?.(r.id),
32
+ title: r?.title || l,
33
+ loading: e || r.loading,
34
+ onToggle: () => p?.(r.id),
35
35
  expanded: d === r.id
36
36
  }
37
37
  )
38
- ] })) }) }),
39
- /* @__PURE__ */ o(g, { color: "neutral", variant: "subtle", size: "xs", children: /* @__PURE__ */ o("p", { children: l }) })
38
+ ] }, r.id)) }) }),
39
+ /* @__PURE__ */ o(h, { color: "neutral", variant: "subtle", size: "xs", children: /* @__PURE__ */ o("p", { children: m }) })
40
40
  ] })
41
41
  ] });
42
42
  export {
43
- U as BookmarksSettingsList
43
+ $ as BookmarksSettingsList
44
44
  };
@@ -1,6 +1,6 @@
1
- import { jsx as c } from "react/jsx-runtime";
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";
@@ -9,42 +9,42 @@ import { DatepickerFilter as C } from "./DatepickerFilter.js";
9
9
  import { formatDateRange as h } from "./formatDateRange.js";
10
10
  const q = ({
11
11
  name: t = "time",
12
- size: m,
13
- searchable: s,
14
- keyboardEvents: D,
15
- items: f,
12
+ size: c,
13
+ searchable: m,
14
+ keyboardEvents: s,
15
+ items: D,
16
16
  groups: d,
17
- filterState: o = {},
17
+ filterState: e = {},
18
18
  onFilterStateChange: r
19
19
  }) => {
20
- const [u, i] = b(!1), a = o?.fromDate?.[0] || "", n = o?.toDate?.[0] || "", k = () => {
20
+ const [f, i] = b(!1), a = e?.fromDate?.[0] || "", n = e?.toDate?.[0] || "", u = () => {
21
21
  i(!1);
22
- }, l = (e) => {
22
+ }, k = (o) => {
23
23
  r?.({
24
- ...o,
25
- fromDate: e.fromDate ? [e.fromDate] : void 0,
26
- toDate: e.toDate ? [e.toDate] : void 0,
24
+ ...e,
25
+ fromDate: o.fromDate ? [o.fromDate] : void 0,
26
+ toDate: o.toDate ? [o.toDate] : void 0,
27
27
  [t]: ["fromAndToDate"]
28
28
  });
29
- }, p = h(a, n), v = f?.map((e) => e.role === "datepicker" ? {
30
- ...e,
31
- description: p,
32
- selected: !!p,
29
+ }, l = h(a, n), v = D?.map((o) => o.role === "datepicker" ? {
30
+ ...o,
31
+ description: l,
32
+ selected: e?.[t]?.[0] === "fromAndToDate",
33
33
  onClick: () => {
34
34
  i(!0);
35
35
  }
36
36
  } : {
37
- ...e,
37
+ ...o,
38
38
  onChange: () => {
39
39
  r?.({
40
- ...o,
40
+ ...e,
41
41
  fromDate: void 0,
42
42
  toDate: void 0,
43
- [t]: e?.value ? [e.value] : void 0
43
+ [t]: o?.value ? [o.value] : void 0
44
44
  });
45
45
  }
46
46
  });
47
- return u ? /* @__PURE__ */ c(C, { formData: { fromDate: a, toDate: n }, onChange: l, onSubmit: k }) : /* @__PURE__ */ c(g, { size: m, searchable: s, keyboardEvents: D, items: v, groups: d });
47
+ return f ? /* @__PURE__ */ p(C, { formData: { fromDate: a, toDate: n }, onChange: k, onSubmit: u }) : /* @__PURE__ */ p(g, { size: c, searchable: m, keyboardEvents: s, items: v, groups: d });
48
48
  };
49
49
  export {
50
50
  q as SelectDateFilter
@@ -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
  }