@wrdagency/blockout 1.0.30 → 1.0.31

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 (35) hide show
  1. package/dist/assets/style20.css +1 -1
  2. package/dist/components/controls/select-control/select.js +47 -44
  3. package/dist/components/data-view/api.d.ts +2 -2
  4. package/dist/components/data-view/api.js +14 -17
  5. package/dist/components/data-view/data/normalize.d.ts +0 -2
  6. package/dist/components/data-view/data/normalize.js +24 -36
  7. package/dist/components/data-view/layouts/grid/group.js +3 -2
  8. package/dist/components/data-view/layouts/kanban/group.js +3 -2
  9. package/dist/components/data-view/layouts/list/group.js +3 -2
  10. package/dist/components/data-view/layouts/table/empty.js +3 -2
  11. package/dist/components/data-view/layouts/table/group.js +3 -2
  12. package/dist/components/data-view/layouts/table/root.js +3 -2
  13. package/dist/components/data-view/layouts/tile/group.js +3 -2
  14. package/dist/components/data-view/parts/controls/index.js +3 -2
  15. package/dist/components/data-view/parts/controls/search.js +3 -2
  16. package/dist/components/data-view/parts/footer/actions.js +43 -62
  17. package/dist/components/data-view/parts/footer/index.js +3 -2
  18. package/dist/components/data-view/parts/footer/selection.js +3 -2
  19. package/dist/components/data-view/parts/view-control/index.js +18 -17
  20. package/dist/components/data-view/root.js +3 -2
  21. package/dist/components/data-view/slots/item/actions.js +20 -34
  22. package/dist/components/data-view/types/actions.d.ts +4 -14
  23. package/dist/components/menu/context.d.ts +7 -0
  24. package/dist/components/menu/context.js +10 -0
  25. package/dist/components/menu/index.d.ts +5 -4
  26. package/dist/components/menu/index.js +19 -17
  27. package/dist/components/menu/item.d.ts +1 -1
  28. package/dist/components/menu/items/action.d.ts +1 -1
  29. package/dist/components/menu/items/action.js +10 -7
  30. package/dist/components/menu/items/submenu.d.ts +1 -1
  31. package/dist/components/menu/items/toggle.d.ts +1 -1
  32. package/dist/components/menu/items/toggle.js +20 -19
  33. package/dist/components/menu/types.d.ts +9 -9
  34. package/dist/types/options.d.ts +1 -0
  35. package/package.json +1 -1
@@ -1,10 +1,9 @@
1
- import { jsxs as u, jsx as p } from "react/jsx-runtime";
2
- import { Button as v } from "../../../button/index.js";
3
- import { Menu as k } from "../../../menu/index.js";
4
- import * as c from "react";
5
- import { useMemo as b } from "react";
6
- import { p as F } from "../../../../IconBase.es-rM5tt24D.js";
7
- import { a as A } from "../../../../DotsThreeVertical.es-uadrGk3y.js";
1
+ import { jsxs as s, jsx as p } from "react/jsx-runtime";
2
+ import { Button as c } from "../../../button/index.js";
3
+ import { Menu as f } from "../../../menu/index.js";
4
+ import * as l from "react";
5
+ import { p as d } from "../../../../IconBase.es-rM5tt24D.js";
6
+ import { a as u } from "../../../../DotsThreeVertical.es-uadrGk3y.js";
8
7
  import '../../../../assets/style26.css';import '../../../../assets/styles3.css';import '../../../../assets/style18.css';import '../../../../assets/style17.css';import '../../../../assets/styles5.css';import '../../../../assets/styles4.css';import '../../../../assets/style16.css';import '../../../../assets/style19.css';import '../../../../assets/style15.css';import '../../../../assets/style14.css';import '../../../../assets/style13.css';import '../../../../assets/prosemirror.css';import '../../../../assets/style12.css';import '../../../../assets/style11.css';import '../../../../assets/style9.css';import '../../../../assets/styles.css';import '../../../../assets/style6.css';import '../../../../assets/style5.css';import '../../../../assets/style4.css';import '../../../../assets/style3.css';import '../../../../assets/style2.css';import '../../../../assets/style.css';import '../../../../assets/style10.css';import '../../../../assets/style7.css';import '../../../../assets/style8.css';import '../../../../assets/styles2.css';/* empty css */
9
8
  import "../../../../style-CWAa57kN.js";
10
9
  /* empty css */
@@ -39,67 +38,49 @@ import "../../../../match-sorter.esm-MNVE8H_6.js";
39
38
  /* empty css */
40
39
  /* empty css */
41
40
  /* empty css */
42
- import { R as w } from "../../../../index-CLl-PPjx.js";
41
+ import { R as h } from "../../../../index-CLl-PPjx.js";
43
42
  import "../../slots/group/context.js";
44
43
  import "../../slots/item/context.js";
45
44
  import "../../slots/property/context.js";
46
45
  /* empty css */
47
46
  import "../../../tag/index.js";
48
- const h = c.forwardRef((m, e) => /* @__PURE__ */ c.createElement(F, { ref: e, ...m, weights: A }));
49
- h.displayName = "DotsThreeVerticalIcon";
50
- const hr = ({}) => {
51
- const { items: m, primaryKey: e, selection: i, actions: o } = w.use(), s = i && i.count() > 1, l = i && i.count() === 1, g = b(
52
- () => o.filter((r) => r.variant === "primary").filter(
53
- (r) => s && !!r.bulkFn || l && !!r.singleFn
47
+ const n = l.forwardRef((i, m) => /* @__PURE__ */ l.createElement(d, { ref: m, ...i, weights: u }));
48
+ n.displayName = "DotsThreeVerticalIcon";
49
+ const ar = ({}) => {
50
+ const { items: i, primaryKey: m, selection: t, actions: o } = h.use();
51
+ if (!t || t.count() === 0 || o.length < 1)
52
+ return;
53
+ const e = i.filter(
54
+ (r) => t == null ? void 0 : t.has(r[m])
55
+ );
56
+ return /* @__PURE__ */ s("div", { className: "data-view-part-footer__actions", children: [
57
+ o.length > 0 && /* @__PURE__ */ p(
58
+ f,
59
+ {
60
+ iconOnly: !0,
61
+ variant: "quiet",
62
+ "aria-label": "More Actions",
63
+ context: e,
64
+ items: o,
65
+ children: /* @__PURE__ */ p(n, {})
66
+ }
54
67
  ),
55
- [o, i]
56
- ), n = b(
57
- () => o.filter((r) => r.variant === "secondary").filter(
58
- (r) => s && !!r.bulkFn || l && !!r.singleFn
59
- ),
60
- [o, i]
61
- ), a = (r) => {
62
- var d, f;
63
- const t = m.filter(
64
- (y) => i == null ? void 0 : i.has(y[e])
65
- );
66
- t.length > 1 ? (d = r.bulkFn) == null || d.call(r, t) : t.length === 1 && ((f = r.singleFn) == null || f.call(r, t[0]));
67
- };
68
- if (!(!i || i.count() === 0 || o.length < 1))
69
- return /* @__PURE__ */ u("div", { className: "data-view-part-footer__actions", children: [
70
- n.length > 0 && /* @__PURE__ */ p(
71
- k,
72
- {
73
- iconOnly: !0,
74
- variant: "quiet",
75
- "aria-label": "More Actions",
76
- items: n.map((r) => ({
77
- id: r.id,
78
- type: "action",
79
- label: r.label,
80
- icon: r.icon,
81
- disabled: r.disabled,
82
- onClick: () => a(r)
83
- })),
84
- children: /* @__PURE__ */ p(h, {})
85
- }
86
- ),
87
- g.reverse().map((r, t) => /* @__PURE__ */ u(
88
- v,
89
- {
90
- variant: t === 0 ? "neutral" : "quiet",
91
- size: "small",
92
- onClick: () => a(r),
93
- disabled: r.disabled,
94
- children: [
95
- r.icon && /* @__PURE__ */ p(r.icon, {}),
96
- r.label
97
- ]
98
- },
99
- r.id
100
- ))
101
- ] });
68
+ o.filter((r) => r.type === "action").filter((r) => r.primary).reverse().map((r, a) => /* @__PURE__ */ s(
69
+ c,
70
+ {
71
+ variant: a === 0 ? "neutral" : "quiet",
72
+ size: "small",
73
+ onClick: () => r.onClick(e),
74
+ disabled: r.disabled,
75
+ children: [
76
+ r.icon && /* @__PURE__ */ p(r.icon, {}),
77
+ r.label
78
+ ]
79
+ },
80
+ a
81
+ ))
82
+ ] });
102
83
  };
103
84
  export {
104
- hr as Actions
85
+ ar as Actions
105
86
  };
@@ -38,6 +38,7 @@ import "../../../../match-sorter.esm-MNVE8H_6.js";
38
38
  /* empty css */
39
39
  import { R as n } from "../../../../index-CLl-PPjx.js";
40
40
  import "../../slots/group/context.js";
41
+ import "../../../menu/context.js";
41
42
  /* empty css */
42
43
  import "../../slots/item/context.js";
43
44
  import "../../slots/property/context.js";
@@ -45,7 +46,7 @@ import "../../slots/property/context.js";
45
46
  import "../../../tag/index.js";
46
47
  import { Actions as s } from "./actions.js";
47
48
  import { Selection as g } from "./selection.js";
48
- const po = ({}) => {
49
+ const mo = ({}) => {
49
50
  const { view: o, items: r, setView: i } = n.use(), p = (m) => {
50
51
  i({ ...o, page: m });
51
52
  };
@@ -65,5 +66,5 @@ const po = ({}) => {
65
66
  ] });
66
67
  };
67
68
  export {
68
- po as Footer
69
+ mo as Footer
69
70
  };
@@ -37,12 +37,13 @@ import "../../../../match-sorter.esm-MNVE8H_6.js";
37
37
  /* empty css */
38
38
  import { R as m } from "../../../../index-CLl-PPjx.js";
39
39
  import "../../slots/group/context.js";
40
+ import "../../../menu/context.js";
40
41
  /* empty css */
41
42
  import "../../slots/item/context.js";
42
43
  import "../../slots/property/context.js";
43
44
  /* empty css */
44
45
  import "../../../tag/index.js";
45
- const U = ({}) => {
46
+ const W = ({}) => {
46
47
  const { selection: o } = m.use();
47
48
  if (o)
48
49
  return /* @__PURE__ */ r("div", { className: "data-view-part-footer__selection", children: [
@@ -58,5 +59,5 @@ const U = ({}) => {
58
59
  ] });
59
60
  };
60
61
  export {
61
- U as Selection
62
+ W as Selection
62
63
  };
@@ -41,6 +41,7 @@ import { ToggleGroupControl as n } from "../../../controls/toggle-group-control/
41
41
  import { viewFieldsToListItems as _, getLayoutOptions as y, getSortDirectionOptions as H, getRelationshipVisiblityOptions as C, listItemsToViewFields as F } from "../../data/options.js";
42
42
  import { R as N } from "../../../../index-CLl-PPjx.js";
43
43
  import "../../slots/group/context.js";
44
+ import "../../../menu/context.js";
44
45
  /* empty css */
45
46
  import "../../slots/item/context.js";
46
47
  import "../../slots/property/context.js";
@@ -100,27 +101,27 @@ const S = /* @__PURE__ */ new Map([
100
101
  ]
101
102
  ]), A = a.forwardRef((m, t) => /* @__PURE__ */ a.createElement(u, { ref: t, ...m, weights: S }));
102
103
  A.displayName = "SelectionSlashIcon";
103
- const _0 = ({ className: m }) => {
104
- const { view: t, setView: d, fields: r, hierarchy: g } = N.use(), l = (e, w) => {
104
+ const y0 = ({ className: m }) => {
105
+ const { view: t, setView: d, fields: l, hierarchy: g } = N.use(), r = (e, w) => {
105
106
  d({
106
107
  ...t,
107
108
  [e]: w
108
109
  });
109
110
  }, V = c(
110
- () => r.filter((e) => e.sorting.sortable).map((e) => ({
111
+ () => l.filter((e) => e.sorting.sortable).map((e) => ({
111
112
  value: e.id,
112
113
  label: e.display.label
113
114
  })),
114
- [t, r]
115
+ [t, l]
115
116
  ), i = c(
116
- () => r.filter((e) => e.sorting.groupable).map((e) => ({
117
+ () => l.filter((e) => e.sorting.groupable).map((e) => ({
117
118
  value: e.id,
118
119
  label: e.display.label
119
120
  })),
120
- [r]
121
+ [l]
121
122
  ), M = c(
122
- () => _(t.fields, r),
123
- [r]
123
+ () => _(t.fields, l),
124
+ [l]
124
125
  ), p = !!t.search;
125
126
  return /* @__PURE__ */ s("div", { className: b("component-view-control", m), children: [
126
127
  /* @__PURE__ */ o("fieldset", { className: "component-view-control__row", children: /* @__PURE__ */ o(
@@ -128,7 +129,7 @@ const _0 = ({ className: m }) => {
128
129
  {
129
130
  label: "Layout",
130
131
  value: t.layout,
131
- onChangeValue: (e) => l("layout", e),
132
+ onChangeValue: (e) => r("layout", e),
132
133
  options: y(i.length > 0)
133
134
  }
134
135
  ) }),
@@ -139,7 +140,7 @@ const _0 = ({ className: m }) => {
139
140
  className: "component-view-control__row__grow",
140
141
  label: "Sort by",
141
142
  value: t.sortBy,
142
- onChangeValue: (e) => l("sortBy", e),
143
+ onChangeValue: (e) => r("sortBy", e),
143
144
  options: V,
144
145
  disabled: p,
145
146
  help: p && "Sorting by search relevance."
@@ -149,7 +150,7 @@ const _0 = ({ className: m }) => {
149
150
  n,
150
151
  {
151
152
  value: t.sortOrder,
152
- onChangeValue: (e) => l("sortOrder", e),
153
+ onChangeValue: (e) => r("sortOrder", e),
153
154
  options: H(),
154
155
  disabled: p,
155
156
  noLabels: !0
@@ -163,7 +164,7 @@ const _0 = ({ className: m }) => {
163
164
  className: "component-view-control__row__grow",
164
165
  label: "Group by",
165
166
  value: t.groupBy || "",
166
- onChangeValue: (e) => l("groupBy", e),
167
+ onChangeValue: (e) => r("groupBy", e),
167
168
  options: [{ value: "", label: "" }, ...i]
168
169
  }
169
170
  ),
@@ -174,7 +175,7 @@ const _0 = ({ className: m }) => {
174
175
  onLabel: /* @__PURE__ */ o(v, {}),
175
176
  offLabel: /* @__PURE__ */ o(A, {}),
176
177
  value: !t.includeEmptyGroups,
177
- onChangeValue: (e) => l("includeEmptyGroups", !e),
178
+ onChangeValue: (e) => r("includeEmptyGroups", !e),
178
179
  disabled: !t.groupBy
179
180
  }
180
181
  ) }),
@@ -182,7 +183,7 @@ const _0 = ({ className: m }) => {
182
183
  n,
183
184
  {
184
185
  value: t.groupOrder,
185
- onChangeValue: (e) => l("groupOrder", e),
186
+ onChangeValue: (e) => r("groupOrder", e),
186
187
  options: H(),
187
188
  noLabels: !0,
188
189
  disabled: !t.groupBy
@@ -195,7 +196,7 @@ const _0 = ({ className: m }) => {
195
196
  className: "component-view-control__row__grow",
196
197
  label: "Sub-items",
197
198
  value: t.relationships,
198
- onChangeValue: (e) => l("relationships", e),
199
+ onChangeValue: (e) => r("relationships", e),
199
200
  options: C()
200
201
  }
201
202
  ) }),
@@ -205,12 +206,12 @@ const _0 = ({ className: m }) => {
205
206
  className: "component-view-control__row__grow",
206
207
  label: "Properties",
207
208
  value: M,
208
- onChangeValue: (e) => l("fields", F(e)),
209
+ onChangeValue: (e) => r("fields", F(e)),
209
210
  multiple: !0
210
211
  }
211
212
  ) })
212
213
  ] });
213
214
  };
214
215
  export {
215
- _0 as ViewControl
216
+ y0 as ViewControl
216
217
  };
@@ -47,13 +47,14 @@ import "../../match-sorter.esm-MNVE8H_6.js";
47
47
  /* empty css */
48
48
  import { R as N } from "../../index-CLl-PPjx.js";
49
49
  import "./slots/group/context.js";
50
+ import "../menu/context.js";
50
51
  /* empty css */
51
52
  import "./slots/item/context.js";
52
53
  import "./slots/property/context.js";
53
54
  /* empty css */
54
55
  import "../tag/index.js";
55
56
  import "./parts/view-control/index.js";
56
- const qo = ({
57
+ const yo = ({
57
58
  className: s,
58
59
  items: p,
59
60
  primaryKey: i,
@@ -106,5 +107,5 @@ const qo = ({
106
107
  ] }) });
107
108
  };
108
109
  export {
109
- qo as Root
110
+ yo as Root
110
111
  };
@@ -1,44 +1,30 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { Menu as c } from "../../../menu/index.js";
3
- import { cn as f } from "../../../../utils/css.js";
4
- import * as i from "react";
5
- import { useMemo as p } from "react";
6
- import { w as d } from "../../../../SSRBase.es-BUXS72ra.js";
7
- import { a as u } from "../../../../DotsThreeVertical.es-uadrGk3y.js";
8
- import { R as h } from "../../../../index-CLl-PPjx.js";
9
- import { useItem as b } from "./context.js";
10
- const n = i.forwardRef((t, o) => /* @__PURE__ */ i.createElement(d, { ref: o, ...t, weights: u }));
11
- n.displayName = "DotsThreeVerticalIcon";
12
- const v = ({ className: t }) => {
13
- const { actions: o } = h.use(), { item: l } = b(), r = p(
14
- () => o.filter((e) => !!e.singleFn).map(
15
- (e) => ({
16
- type: "action",
17
- label: e.label,
18
- icon: e.icon,
19
- disabled: e.disabled,
20
- onClick: () => a(e)
21
- })
22
- ),
23
- [o]
24
- ), a = (e) => {
25
- var s;
26
- (s = e.singleFn) == null || s.call(e, l);
27
- };
28
- if (r.length !== 0)
29
- return /* @__PURE__ */ m(
30
- c,
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Menu as s } from "../../../menu/index.js";
3
+ import { cn as a } from "../../../../utils/css.js";
4
+ import * as e from "react";
5
+ import { w as n } from "../../../../SSRBase.es-BUXS72ra.js";
6
+ import { a as c } from "../../../../DotsThreeVertical.es-uadrGk3y.js";
7
+ import { R as l } from "../../../../index-CLl-PPjx.js";
8
+ import { useItem as f } from "./context.js";
9
+ const i = e.forwardRef((o, t) => /* @__PURE__ */ e.createElement(n, { ref: t, ...o, weights: c }));
10
+ i.displayName = "DotsThreeVerticalIcon";
11
+ const x = ({ className: o }) => {
12
+ const { actions: t } = l.use(), { item: m } = f();
13
+ if (t.length !== 0)
14
+ return /* @__PURE__ */ r(
15
+ s,
31
16
  {
32
- className: f("data-view-slot__item__actions", t),
17
+ className: a("data-view-slot__item__actions", o),
33
18
  iconOnly: !0,
34
19
  variant: "ghost",
35
20
  size: "small",
36
21
  "aria-label": "More Actions",
37
- items: r,
38
- children: /* @__PURE__ */ m(n, {})
22
+ context: [m],
23
+ items: t,
24
+ children: /* @__PURE__ */ r(i, {})
39
25
  }
40
26
  );
41
27
  };
42
28
  export {
43
- v as Actions
29
+ x as Actions
44
30
  };
@@ -1,15 +1,5 @@
1
- import { FC } from 'react';
2
- export type Action<TData extends object = object> = {
3
- id: string;
4
- label: string;
5
- variant: "primary" | "secondary";
6
- icon?: FC<{
7
- className?: string;
8
- }>;
9
- disabled: boolean;
10
- singleFn?: (item: TData) => Promise<void> | void;
11
- bulkFn?: (item: TData[]) => Promise<void> | void;
12
- };
13
- export type PartialAction<TData extends object = object> = Partial<Action<TData>> & {
14
- id: string;
1
+ import { AnyMenuItem } from '../../menu/types';
2
+ export type Action<TData extends object = object> = AnyMenuItem<TData[]> & {
3
+ primary?: boolean;
4
+ disabled?: boolean;
15
5
  };
@@ -0,0 +1,7 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ type MenuContext<Context = any> = {
3
+ actionContext: Context;
4
+ };
5
+ export declare const MenuProvider: FC<PropsWithChildren & MenuContext>;
6
+ export declare const useMenu: () => MenuContext<any>;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { createContext as n, useContext as s } from "react";
3
+ const e = n(void 0), c = ({
4
+ children: o,
5
+ actionContext: r
6
+ }) => /* @__PURE__ */ t(e.Provider, { value: { actionContext: r }, children: o }), m = () => s(e);
7
+ export {
8
+ c as MenuProvider,
9
+ m as useMenu
10
+ };
@@ -1,12 +1,13 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  import { ButtonProps } from '../button/button';
3
3
  import { AnyMenuItem } from './types';
4
- interface MenuProps extends PropsWithChildren {
4
+ interface MenuProps<Context> extends PropsWithChildren {
5
5
  className?: string;
6
6
  iconOnly?: boolean;
7
7
  variant?: ButtonProps["variant"];
8
8
  size?: ButtonProps["size"];
9
- items: AnyMenuItem[];
9
+ items: AnyMenuItem<Context>[];
10
+ context?: Context;
10
11
  }
11
- export declare const Menu: FC<MenuProps>;
12
+ export declare function Menu<Context>({ className, iconOnly, items, variant, size, children, context, }: MenuProps<Context>): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -1,30 +1,32 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import { cn as d } from "../../utils/css.js";
3
- import { useState as M } from "react";
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import { cn as M } from "../../utils/css.js";
3
+ import { useState as w } from "react";
4
4
  import { Button as r } from "../button/index.js";
5
- import { M as w } from "../../item-CmTk8eHD.js";
5
+ import { MenuProvider as _ } from "./context.js";
6
+ import { M as h } from "../../item-CmTk8eHD.js";
6
7
  import '../../assets/style20.css';/* empty css */
7
- import { M as _, a as h, b as v } from "../../menu-button-GQO5dB3U.js";
8
- const I = ({
8
+ import { M as v, a as x, b as P } from "../../menu-button-GQO5dB3U.js";
9
+ function C({
9
10
  className: n,
10
11
  iconOnly: t = !1,
11
12
  items: m,
12
13
  variant: s,
13
14
  size: a,
14
- children: p
15
- }) => {
16
- const [o, u] = M(!1), c = t ? r.Icon : r;
17
- return /* @__PURE__ */ l(_, { open: o, setOpen: u, children: [
15
+ children: p,
16
+ context: i
17
+ }) {
18
+ const [o, u] = w(!1), c = t ? r.Icon : r;
19
+ return /* @__PURE__ */ e(_, { actionContext: i, children: /* @__PURE__ */ l(v, { open: o, setOpen: u, children: [
18
20
  /* @__PURE__ */ e(
19
- h,
21
+ x,
20
22
  {
21
- className: d("component-menu__button", n),
23
+ className: M("component-menu__button", n),
22
24
  render: /* @__PURE__ */ e(c, { variant: s, size: a }),
23
25
  children: p
24
26
  }
25
27
  ),
26
28
  o && /* @__PURE__ */ e(
27
- v,
29
+ P,
28
30
  {
29
31
  wrapperProps: {
30
32
  className: "component-menu__menu-wrapper"
@@ -34,11 +36,11 @@ const I = ({
34
36
  gutter: 8,
35
37
  overflowPadding: 4,
36
38
  className: "component-menu__window",
37
- children: m.map((i, f) => /* @__PURE__ */ e(w, { item: i }, f))
39
+ children: m.map((f, d) => /* @__PURE__ */ e(h, { item: f }, d))
38
40
  }
39
41
  )
40
- ] });
41
- };
42
+ ] }) });
43
+ }
42
44
  export {
43
- I as Menu
45
+ C as Menu
44
46
  };
@@ -1,7 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { AnyMenuItem } from './types';
3
3
  interface MenuItemProps {
4
- item: AnyMenuItem;
4
+ item: AnyMenuItem<any>;
5
5
  }
6
6
  export declare const MenuItem: FC<MenuItemProps>;
7
7
  export {};
@@ -1,7 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { MenuItemAction } from '../types';
3
3
  interface ActionMenuItemProps {
4
- item: MenuItemAction;
4
+ item: MenuItemAction<any>;
5
5
  }
6
6
  export declare const ActionMenuItem: FC<ActionMenuItemProps>;
7
7
  export {};
@@ -1,13 +1,16 @@
1
1
  import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import { EmptyIcon as c } from "../icon.js";
3
- import { M as t } from "../../../2NBKRL7C-DBbnghCe.js";
4
- const l = ({ item: n }) => {
5
- const m = n.icon || c;
2
+ import { useMenu as t } from "../context.js";
3
+ import { EmptyIcon as i } from "../icon.js";
4
+ import { M as _ } from "../../../2NBKRL7C-DBbnghCe.js";
5
+ const d = ({ item: n }) => {
6
+ const { actionContext: c } = t(), m = n.icon || i;
6
7
  return /* @__PURE__ */ o(
7
- t,
8
+ _,
8
9
  {
9
10
  className: "component-menu__item component-menu__item--action",
10
- onClick: n.onClick,
11
+ onClick: () => {
12
+ n.onClick(c);
13
+ },
11
14
  disabled: n.disabled,
12
15
  children: [
13
16
  /* @__PURE__ */ e(m, { className: "component-menu__item__icon component-menu__item__icon--pictoral" }),
@@ -20,5 +23,5 @@ const l = ({ item: n }) => {
20
23
  );
21
24
  };
22
25
  export {
23
- l as ActionMenuItem
26
+ d as ActionMenuItem
24
27
  };
@@ -1,7 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { MenuItemSubmenu } from '../types';
3
3
  interface SubmenuMenuItemProps {
4
- item: MenuItemSubmenu;
4
+ item: MenuItemSubmenu<any>;
5
5
  }
6
6
  export declare const SubmenuMenuItem: FC<SubmenuMenuItemProps>;
7
7
  export {};
@@ -1,7 +1,7 @@
1
1
  import { FC } from 'react';
2
2
  import { MenuItemToggle } from '../types';
3
3
  interface ToggleMenuItemProps {
4
- item: MenuItemToggle;
4
+ item: MenuItemToggle<any>;
5
5
  }
6
6
  export declare const ToggleMenuItem: FC<ToggleMenuItemProps>;
7
7
  export {};
@@ -1,29 +1,30 @@
1
- import { jsxs as o, jsx as n } from "react/jsx-runtime";
2
- import { cn as r } from "../../../utils/css.js";
3
- import { r as a, a as i } from "../../../Square.es-KJLdY11q.js";
1
+ import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
+ import { cn as i } from "../../../utils/css.js";
3
+ import { r as a, a as p } from "../../../Square.es-KJLdY11q.js";
4
4
  import "react";
5
- import { EmptyIcon as p } from "../icon.js";
6
- import { M as d } from "../../../2NBKRL7C-DBbnghCe.js";
7
- const x = ({ item: e }) => {
8
- const t = e.icon || p, s = () => {
9
- var _, m, l;
10
- const c = !e.checked;
11
- return (_ = e.onToggle) == null || _.call(e, c), c ? (m = e.onCheck) == null ? void 0 : m.call(e) : (l = e.onUncheck) == null ? void 0 : l.call(e);
5
+ import { useMenu as d } from "../context.js";
6
+ import { EmptyIcon as u } from "../icon.js";
7
+ import { M as h } from "../../../2NBKRL7C-DBbnghCe.js";
8
+ const I = ({ item: e }) => {
9
+ const { actionContext: o } = d(), l = e.icon || u, r = () => {
10
+ var m, t, s;
11
+ const _ = !e.checked;
12
+ return (m = e.onToggle) == null || m.call(e, _, o), _ ? (t = e.onCheck) == null ? void 0 : t.call(e, o) : (s = e.onUncheck) == null ? void 0 : s.call(e, o);
12
13
  };
13
- return /* @__PURE__ */ o(
14
- d,
14
+ return /* @__PURE__ */ c(
15
+ h,
15
16
  {
16
17
  hideOnClick: !1,
17
- className: r(
18
+ className: i(
18
19
  "component-menu__item component-menu__item--toggle",
19
20
  e.checked && "component-menu__item--toggle--checked"
20
21
  ),
21
22
  disabled: e.disabled,
22
- onClick: s,
23
+ onClick: r,
23
24
  children: [
24
- /* @__PURE__ */ n(t, { className: "component-menu__item__icon component-menu__item__icon--pictoral" }),
25
- /* @__PURE__ */ o("div", { className: "component-menu__item__text", children: [
26
- /* @__PURE__ */ o("div", { className: "component-menu__item__text__header", children: [
25
+ /* @__PURE__ */ n(l, { className: "component-menu__item__icon component-menu__item__icon--pictoral" }),
26
+ /* @__PURE__ */ c("div", { className: "component-menu__item__text", children: [
27
+ /* @__PURE__ */ c("div", { className: "component-menu__item__text__header", children: [
27
28
  /* @__PURE__ */ n("div", { className: "component-menu__item__label", children: e.label }),
28
29
  e.checked ? /* @__PURE__ */ n(
29
30
  a,
@@ -31,7 +32,7 @@ const x = ({ item: e }) => {
31
32
  weight: "fill",
32
33
  className: "component-menu__item__icon component-menu__item__icon--checkbox"
33
34
  }
34
- ) : /* @__PURE__ */ n(i, { className: "component-menu__item__icon component-menu__item__icon--checkbox" })
35
+ ) : /* @__PURE__ */ n(p, { className: "component-menu__item__icon component-menu__item__icon--checkbox" })
35
36
  ] }),
36
37
  /* @__PURE__ */ n("p", { className: "component-menu__item__description", children: e.description })
37
38
  ] })
@@ -40,5 +41,5 @@ const x = ({ item: e }) => {
40
41
  );
41
42
  };
42
43
  export {
43
- x as ToggleMenuItem
44
+ I as ToggleMenuItem
44
45
  };