@kommo-crm/crm-react-ui-kit 1.1.1-beta.7 → 1.1.1-beta.8

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 (56) hide show
  1. package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
  2. package/dist/components/ContextMenu/ContextMenu.js +84 -75
  3. package/dist/components/ContextMenu/ContextMenu.props.d.ts +8 -0
  4. package/dist/components/ContextMenu/ContextMenu.props.d.ts.map +1 -1
  5. package/dist/components/ContextMenu/components/Arrow/Arrow.js +1 -1
  6. package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.d.ts +1 -0
  7. package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.d.ts.map +1 -1
  8. package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.js +45 -40
  9. package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.props.d.ts +4 -0
  10. package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.props.d.ts.map +1 -1
  11. package/dist/components/ContextMenu/components/Content/Content.js +2 -2
  12. package/dist/components/ContextMenu/components/Content/index.js +1 -1
  13. package/dist/components/ContextMenu/components/Group/Group.js +1 -1
  14. package/dist/components/ContextMenu/components/Item/Item.d.ts.map +1 -1
  15. package/dist/components/ContextMenu/components/Item/Item.js +69 -68
  16. package/dist/components/ContextMenu/components/Item/Item.props.d.ts +6 -0
  17. package/dist/components/ContextMenu/components/Item/Item.props.d.ts.map +1 -1
  18. package/dist/components/ContextMenu/components/ItemIndicator/ItemIndicator.js +1 -1
  19. package/dist/components/ContextMenu/components/Label/Label.js +1 -1
  20. package/dist/components/ContextMenu/components/Portal/Portal.js +1 -1
  21. package/dist/components/ContextMenu/components/RadioGroup/RadioGroup.js +1 -1
  22. package/dist/components/ContextMenu/components/RadioItem/RadioItem.d.ts +1 -0
  23. package/dist/components/ContextMenu/components/RadioItem/RadioItem.d.ts.map +1 -1
  24. package/dist/components/ContextMenu/components/RadioItem/RadioItem.js +50 -45
  25. package/dist/components/ContextMenu/components/RadioItem/RadioItem.props.d.ts +4 -0
  26. package/dist/components/ContextMenu/components/RadioItem/RadioItem.props.d.ts.map +1 -1
  27. package/dist/components/ContextMenu/components/Separator/Separator.js +1 -1
  28. package/dist/components/ContextMenu/components/Sub/Sub.d.ts +5 -5
  29. package/dist/components/ContextMenu/components/Sub/Sub.d.ts.map +1 -1
  30. package/dist/components/ContextMenu/components/Sub/Sub.js +53 -55
  31. package/dist/components/ContextMenu/components/Sub/Sub.types.d.ts +7 -0
  32. package/dist/components/ContextMenu/components/Sub/Sub.types.d.ts.map +1 -0
  33. package/dist/components/ContextMenu/components/Sub/Sub.types.js +1 -0
  34. package/dist/components/ContextMenu/components/Sub/index.d.ts +1 -0
  35. package/dist/components/ContextMenu/components/Sub/index.d.ts.map +1 -1
  36. package/dist/components/ContextMenu/components/SubContent/SubContent.d.ts.map +1 -1
  37. package/dist/components/ContextMenu/components/SubContent/SubContent.js +26 -25
  38. package/dist/components/ContextMenu/components/SubRoot/SubRoot.d.ts.map +1 -1
  39. package/dist/components/ContextMenu/components/SubRoot/SubRoot.js +45 -43
  40. package/dist/components/ContextMenu/components/SubRoot/SubRoot.props.d.ts +4 -0
  41. package/dist/components/ContextMenu/components/SubRoot/SubRoot.props.d.ts.map +1 -1
  42. package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.js +2 -2
  43. package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.js +2 -2
  44. package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.js +2 -2
  45. package/dist/components/ContextMenu/components/Trigger/Trigger.js +1 -1
  46. package/dist/components/ContextMenu/hooks/index.js +1 -1
  47. package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.js +1 -1
  48. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.js +1 -1
  49. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.js +1 -1
  50. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.js +1 -1
  51. package/dist/components/ContextMenu/index.d.ts +1 -0
  52. package/dist/components/ContextMenu/index.d.ts.map +1 -1
  53. package/dist/components/ContextMenu/index.js +1 -1
  54. package/dist/{index-BA3njR2k.mjs → index-CYWNqEqR.mjs} +1 -1
  55. package/dist/{useContentPositioning-DAKfbddS.mjs → useContentPositioning-BLEFxO0N.mjs} +1 -1
  56. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAiCA,OAAO,EAAqB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKzE,eAAO,MAAM,WAAW,EAmEnB,eAAe,CAAC"}
1
+ {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenu.tsx"],"names":[],"mappings":"AAiCA,OAAO,EAAqB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKzE,eAAO,MAAM,WAAW,EA+EnB,eAAe,CAAC"}
@@ -1,83 +1,92 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as v, useImperativeHandle as x } from "react";
3
- import { R as y } from "../../index-BA3njR2k.mjs";
4
- import { useContextMenu as D } from "./hooks/useContextMenu/useContextMenu.js";
2
+ import { forwardRef as x, useImperativeHandle as y } from "react";
3
+ import { R as D } from "../../index-CYWNqEqR.mjs";
4
+ import { useContextMenu as T } from "./hooks/useContextMenu/useContextMenu.js";
5
5
  import "./providers/LevelProvider/LevelProvider.js";
6
- import { ContextMenuRootProvider as T, ContextMenuProvider as L, DISPLAY_NAME as E } from "./ContextMenu.context.js";
7
- import { C as N } from "../../useContentPositioning-DAKfbddS.mjs";
6
+ import { ContextMenuRootProvider as L, ContextMenuProvider as E, DISPLAY_NAME as N } from "./ContextMenu.context.js";
7
+ import { C as P } from "../../useContentPositioning-BLEFxO0N.mjs";
8
8
  import "./components/Content/Content.utils.js";
9
- import { Trigger as P } from "./components/Trigger/Trigger.js";
10
- import { Portal as w } from "./components/Portal/Portal.js";
11
- import { Sub as G } from "./components/Sub/Sub.js";
12
- import { SubTrigger as H } from "./components/SubTrigger/SubTrigger.js";
13
- import { SubContent as _ } from "./components/SubContent/SubContent.js";
14
- import { Arrow as k } from "./components/Arrow/Arrow.js";
15
- import { Item as Y } from "./components/Item/Item.js";
16
- import { ItemRightSlot as j } from "./components/ItemRightSlot/ItemRightSlot.js";
17
- import { Group as B } from "./components/Group/Group.js";
18
- import { Label as K } from "./components/Label/Label.js";
19
- import { CheckboxItem as U } from "./components/CheckboxItem/CheckboxItem.js";
20
- import { ItemIndicator as V } from "./components/ItemIndicator/ItemIndicator.js";
21
- import { RadioGroup as q } from "./components/RadioGroup/RadioGroup.js";
22
- import { RadioItem as z } from "./components/RadioItem/RadioItem.js";
23
- import { Separator as F } from "./components/Separator/Separator.js";
24
- import { ItemIcon as J } from "./components/ItemIcon/ItemIcon.js";
25
- import { SubRoot as Q } from "./components/SubRoot/SubRoot.js";
26
- const W = 200, X = 150, o = v(
27
- ({ children: n, mode: p, onOpen: a, defaultOpen: f, onAnimatedOpen: l, ...u }, d) => {
9
+ import { Trigger as w } from "./components/Trigger/Trigger.js";
10
+ import { Portal as G } from "./components/Portal/Portal.js";
11
+ import { Sub as H } from "./components/Sub/Sub.js";
12
+ import { SubTrigger as _ } from "./components/SubTrigger/SubTrigger.js";
13
+ import { SubContent as k } from "./components/SubContent/SubContent.js";
14
+ import { Arrow as Y } from "./components/Arrow/Arrow.js";
15
+ import { Item as j } from "./components/Item/Item.js";
16
+ import { ItemRightSlot as B } from "./components/ItemRightSlot/ItemRightSlot.js";
17
+ import { Group as K } from "./components/Group/Group.js";
18
+ import { Label as U } from "./components/Label/Label.js";
19
+ import { CheckboxItem as V } from "./components/CheckboxItem/CheckboxItem.js";
20
+ import { ItemIndicator as q } from "./components/ItemIndicator/ItemIndicator.js";
21
+ import { RadioGroup as z } from "./components/RadioGroup/RadioGroup.js";
22
+ import { RadioItem as F } from "./components/RadioItem/RadioItem.js";
23
+ import { Separator as J } from "./components/Separator/Separator.js";
24
+ import { ItemIcon as Q } from "./components/ItemIcon/ItemIcon.js";
25
+ import { SubRoot as W } from "./components/SubRoot/SubRoot.js";
26
+ const X = 200, Z = 150, o = x(
27
+ ({
28
+ children: n,
29
+ mode: p,
30
+ onOpen: a,
31
+ defaultOpen: f,
32
+ onAnimatedOpen: u,
33
+ isCloseOnClick: l = !0,
34
+ ...d
35
+ }, I) => {
28
36
  const {
29
- mode: I,
37
+ mode: C,
30
38
  open: e,
31
- onOpenChange: C,
32
- triggerRef: s,
33
- contentRef: R,
34
- inheritedArrowColor: c,
35
- animatedOpen: b,
36
- animationDuration: S,
37
- hoverCloseDelay: g,
38
- temporaryHoverClose: h,
39
+ onOpenChange: s,
40
+ triggerRef: R,
41
+ contentRef: c,
42
+ inheritedArrowColor: b,
43
+ animatedOpen: S,
44
+ animationDuration: g,
45
+ hoverCloseDelay: h,
46
+ temporaryHoverClose: M,
39
47
  closeMenuImmediately: t,
40
- onMouseEnter: M,
41
- onMouseLeave: A,
48
+ onMouseEnter: A,
49
+ onMouseLeave: O,
42
50
  enableTemporaryHoverClose: m,
43
51
  onOpenByKeyboard: i,
44
- onChildClickOpen: O
45
- } = D({
52
+ onChildClickOpen: v
53
+ } = T({
46
54
  mode: p,
47
55
  defaultOpen: f,
48
56
  onOpen: a,
49
- onAnimatedOpen: l,
50
- animationDuration: X,
51
- hoverCloseDelay: W
57
+ onAnimatedOpen: u,
58
+ animationDuration: Z,
59
+ hoverCloseDelay: X
52
60
  });
53
- return x(d, () => ({
61
+ return y(I, () => ({
54
62
  closeMenuImmediately: t,
55
63
  enableTemporaryHoverClose: m,
56
64
  onOpenByKeyboard: i
57
- })), /* @__PURE__ */ r(T, { onChildClickOpen: O, children: /* @__PURE__ */ r(
58
- L,
65
+ })), /* @__PURE__ */ r(L, { onChildClickOpen: v, children: /* @__PURE__ */ r(
66
+ E,
59
67
  {
60
- mode: I,
61
- triggerRef: s,
62
- contentRef: R,
63
- inheritedArrowColor: c,
64
- animatedOpen: b,
65
- animationDuration: S,
66
- hoverCloseDelay: g,
67
- temporaryHoverClose: h,
68
+ mode: C,
69
+ triggerRef: R,
70
+ contentRef: c,
71
+ inheritedArrowColor: b,
72
+ animatedOpen: S,
73
+ animationDuration: g,
74
+ hoverCloseDelay: h,
75
+ temporaryHoverClose: M,
68
76
  closeMenuImmediately: t,
69
- onMouseEnter: M,
70
- onMouseLeave: A,
77
+ onMouseEnter: A,
78
+ onMouseLeave: O,
71
79
  enableTemporaryHoverClose: m,
72
80
  onOpenByKeyboard: i,
81
+ isCloseOnClick: l,
73
82
  isOpen: e,
74
83
  children: /* @__PURE__ */ r(
75
- y,
84
+ D,
76
85
  {
77
86
  open: e,
78
- onOpenChange: C,
87
+ onOpenChange: s,
79
88
  modal: !1,
80
- ...u,
89
+ ...d,
81
90
  children: n
82
91
  }
83
92
  )
@@ -85,26 +94,26 @@ const W = 200, X = 150, o = v(
85
94
  ) });
86
95
  }
87
96
  );
88
- o.displayName = E;
97
+ o.displayName = N;
89
98
  o.Root = o;
90
- o.SubRoot = Q;
91
- o.Trigger = P;
92
- o.Content = N;
93
- o.Portal = w;
94
- o.Sub = G;
95
- o.SubTrigger = H;
96
- o.SubContent = _;
97
- o.Arrow = k;
98
- o.Item = Y;
99
- o.ItemRightSlot = j;
100
- o.Group = B;
101
- o.Label = K;
102
- o.CheckboxItem = U;
103
- o.RadioGroup = q;
104
- o.RadioItem = z;
105
- o.ItemIndicator = V;
106
- o.Separator = F;
107
- o.ItemIcon = J;
99
+ o.SubRoot = W;
100
+ o.Trigger = w;
101
+ o.Content = P;
102
+ o.Portal = G;
103
+ o.Sub = H;
104
+ o.SubTrigger = _;
105
+ o.SubContent = k;
106
+ o.Arrow = Y;
107
+ o.Item = j;
108
+ o.ItemRightSlot = B;
109
+ o.Group = K;
110
+ o.Label = U;
111
+ o.CheckboxItem = V;
112
+ o.RadioGroup = z;
113
+ o.RadioItem = F;
114
+ o.ItemIndicator = q;
115
+ o.Separator = J;
116
+ o.ItemIcon = Q;
108
117
  export {
109
118
  o as ContextMenu
110
119
  };
@@ -25,6 +25,10 @@ export type ContextMenuRootProps = Omit<RadixDropdownMenuRootProps, 'onOpenChang
25
25
  * Whether the menu is a submenu.
26
26
  */
27
27
  isSubmenu?: boolean;
28
+ /**
29
+ * Whether the menu should close when clicked.
30
+ */
31
+ isCloseOnClick?: boolean;
28
32
  };
29
33
  export interface ContextMenuContextProps {
30
34
  /**
@@ -113,6 +117,10 @@ export interface ContextMenuContextProps {
113
117
  * Whether the menu is open.
114
118
  */
115
119
  isOpen: boolean;
120
+ /**
121
+ * Whether the menu should close when clicked.
122
+ */
123
+ isCloseOnClick: boolean;
116
124
  }
117
125
  export interface ContextMenuRootContextProps {
118
126
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.props.d.ts","sourceRoot":"","sources":["../../../src/components/ContextMenu/ContextMenu.props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,IAAI,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAErG,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,0BAA0B,EAC1B,cAAc,GAAG,OAAO,CACzB,GAAG;IACF;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;;;;OAKG;IACH,IAAI,EAAE,mBAAmB,CAAC;IAC1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC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IACxD;;OAEG;IACH,YAAY,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD;;OAEG;IACH,YAAY,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C"}
@@ -1,6 +1,6 @@
1
1
  import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
2
  import { forwardRef as _ } from "react";
3
- import { A as e } from "../../../../index-BA3njR2k.mjs";
3
+ import { A as e } from "../../../../index-CYWNqEqR.mjs";
4
4
  import { c as s } from "../../../../index-L8X2o7IH.mjs";
5
5
  import { useContextMenuContext as c } from "../../ContextMenu.context.js";
6
6
  import '../../../../assets/Arrow.css';const i = "_arrow_udm9h_1", f = "_arrow_border_udm9h_8", n = {
@@ -276,5 +276,6 @@ export declare const CheckboxItem: React.ForwardRefExoticComponent<{
276
276
  isDisabled?: boolean;
277
277
  isChecked?: boolean;
278
278
  hasIconCheckFn?: (children: React.ReactNode) => boolean;
279
+ isCloseMenuOnClick?: boolean;
279
280
  } & React.RefAttributes<HTMLDivElement>>;
280
281
  //# sourceMappingURL=CheckboxItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/CheckboxItem/CheckboxItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAkB1D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAJM,WAAW;;;sCAkBpC,SACN;wCAuEC,CAAC"}
1
+ {"version":3,"file":"CheckboxItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/CheckboxItem/CheckboxItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAkB1D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAJM,WAAW;;;sCAkBpC,SAAQ;;wCAuFb,CAAC"}
@@ -1,78 +1,83 @@
1
- import { jsx as A } from "react/jsx-runtime";
2
- import { forwardRef as u, useId as v, useMemo as w } from "react";
3
- import { d as H } from "../../../../index-BA3njR2k.mjs";
4
- import { c as P } from "../../../../index-L8X2o7IH.mjs";
5
- import { useLevelContext as R } from "../../providers/LevelProvider/LevelProvider.js";
6
- import { useContextMenuContext as W } from "../../ContextMenu.context.js";
7
- import { hasItemIcon as Y } from "../../utils/hasItemIcon/hasItemIcon.js";
8
- import "../../../../useContentPositioning-DAKfbddS.mjs";
1
+ import { jsx as w } from "react/jsx-runtime";
2
+ import { forwardRef as D, useId as H, useMemo as P } from "react";
3
+ import { d as R } from "../../../../index-CYWNqEqR.mjs";
4
+ import { c as W } from "../../../../index-L8X2o7IH.mjs";
5
+ import { useLevelContext as Y } from "../../providers/LevelProvider/LevelProvider.js";
6
+ import { useContextMenuContext as q } from "../../ContextMenu.context.js";
7
+ import { hasItemIcon as z } from "../../utils/hasItemIcon/hasItemIcon.js";
8
+ import "../../../../useContentPositioning-BLEFxO0N.mjs";
9
9
  import "../Content/Content.utils.js";
10
- import { useContextMenuItemFocus as q } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
11
- import '../../../../assets/CheckboxItem.css';const z = "_checkbox_item_j9dmr_1", D = {
12
- checkbox_item: z
13
- }, m = "ContextMenu.CheckboxItem", G = u(
10
+ import { useContextMenuItemFocus as G } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
11
+ import '../../../../assets/CheckboxItem.css';const J = "_checkbox_item_j9dmr_1", K = {
12
+ checkbox_item: J
13
+ }, m = "ContextMenu.CheckboxItem", O = D(
14
14
  ({
15
15
  className: k,
16
16
  children: o,
17
17
  onChange: h,
18
- isDisabled: f,
18
+ isDisabled: I,
19
19
  isChecked: C,
20
- hasIconCheckFn: n = Y,
21
- onFocus: c,
20
+ hasIconCheckFn: n = z,
21
+ onFocus: e,
22
22
  onMouseEnter: i,
23
- onBlur: e,
23
+ onBlur: c,
24
24
  onMouseLeave: r,
25
25
  onSelect: s,
26
- ...I
27
- }, _) => {
28
- const b = v(), { hasItemWithIcon: g } = R(m), { closeMenuImmediately: N } = W(m), {
29
- dataHighlighted: y,
30
- onFocus: a,
31
- onMouseEnter: x,
26
+ onClick: a,
27
+ isCloseMenuOnClick: _ = !0,
28
+ ...N
29
+ }, u) => {
30
+ const y = H(), { hasItemWithIcon: j } = Y(m), { closeMenuImmediately: b, isCloseOnClick: g } = q(m), {
31
+ dataHighlighted: v,
32
+ onFocus: x,
33
+ onMouseEnter: f,
32
34
  onBlur: p,
33
35
  onMouseLeave: d
34
- } = q({
36
+ } = G({
35
37
  displayName: m,
36
- id: b,
37
- isDisabled: f
38
- }), j = w(() => n(o), [o]);
39
- return /* @__PURE__ */ A(
40
- H,
38
+ id: y,
39
+ isDisabled: I
40
+ }), A = P(() => n(o), [o]);
41
+ return /* @__PURE__ */ w(
42
+ R,
41
43
  {
42
- ref: _,
43
- className: P(D.checkbox_item, k),
44
- disabled: f,
44
+ ref: u,
45
+ className: W(K.checkbox_item, k),
46
+ disabled: I,
45
47
  checked: C,
46
48
  "data-item": !0,
47
- "data-no-icon-align": j || !g ? "" : void 0,
49
+ "data-no-icon-align": A || !j ? "" : void 0,
48
50
  onCheckedChange: (t) => {
49
51
  h && h({
50
52
  target: { checked: t }
51
53
  });
52
54
  },
53
- "data-highlighted": y,
55
+ "data-highlighted": v,
54
56
  onSelect: (t) => {
55
- N(!0), s == null || s(t);
57
+ s == null || s(t), g && _ && b(!0);
58
+ },
59
+ onClick: (t) => {
60
+ t.preventDefault(), a == null || a(t), g && _ && b(!0);
56
61
  },
57
62
  onFocus: (t) => {
58
- a == null || a(), c == null || c(t);
63
+ x == null || x(), e == null || e(t);
59
64
  },
60
65
  onMouseEnter: (t) => {
61
- x == null || x(t), i == null || i(t);
66
+ f == null || f(t), i == null || i(t);
62
67
  },
63
68
  onBlur: (t) => {
64
- p == null || p(), e == null || e(t);
69
+ p == null || p(), c == null || c(t);
65
70
  },
66
71
  onMouseLeave: (t) => {
67
72
  d == null || d(t), r == null || r(t);
68
73
  },
69
- ...I,
74
+ ...N,
70
75
  children: o
71
76
  }
72
77
  );
73
78
  }
74
79
  );
75
- G.displayName = m;
80
+ O.displayName = m;
76
81
  export {
77
- G as CheckboxItem
82
+ O as CheckboxItem
78
83
  };
@@ -21,6 +21,10 @@ export type CheckboxItemProps = RadixCheckboxItemProps & {
21
21
  * By default, the `hasItemIcon` from utils is used.
22
22
  */
23
23
  hasIconCheckFn?: (children: React.ReactNode) => boolean;
24
+ /**
25
+ * Whether the CheckboxItem should close the menu when clicked.
26
+ */
27
+ isCloseMenuOnClick?: boolean;
24
28
  };
25
29
  export {};
26
30
  //# sourceMappingURL=CheckboxItem.props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxItem.props.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/CheckboxItem/CheckboxItem.props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,IAAI,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAEnG,KAAK,sBAAsB,GAAG,IAAI,CAChC,wBAAwB,CAAC,OAAO,6BAA6B,CAAC,EAC9D,UAAU,GAAG,SAAS,GAAG,iBAAiB,CAC3C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,GAAG;IACvD;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,KAAK,OAAO,CAAC;CACzD,CAAC"}
1
+ {"version":3,"file":"CheckboxItem.props.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/CheckboxItem/CheckboxItem.props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,IAAI,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAEnG,KAAK,sBAAsB,GAAG,IAAI,CAChC,wBAAwB,CAAC,OAAO,6BAA6B,CAAC,EAC9D,UAAU,GAAG,SAAS,GAAG,iBAAiB,CAC3C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,GAAG;IACvD;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,KAAK,OAAO,CAAC;IACxD;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC"}
@@ -1,13 +1,13 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import "../../../../index-BA3njR2k.mjs";
3
+ import "../../../../index-CYWNqEqR.mjs";
4
4
  import "../../../../index-L8X2o7IH.mjs";
5
5
  import "../../../../react-spring_web.modern-Dnq1lqN5.mjs";
6
6
  import "../../../../lib/utils.js";
7
7
  import "../../providers/LevelProvider/LevelProvider.js";
8
8
  import "../../ContextMenu.context.js";
9
9
  import "../../ContextMenu.enums.js";
10
- import { C as b } from "../../../../useContentPositioning-DAKfbddS.mjs";
10
+ import { C as b } from "../../../../useContentPositioning-BLEFxO0N.mjs";
11
11
  import "./Content.enums.js";
12
12
  import "./Content.utils.js";
13
13
  export {
@@ -1,4 +1,4 @@
1
- import { C as e } from "../../../../useContentPositioning-DAKfbddS.mjs";
1
+ import { C as e } from "../../../../useContentPositioning-BLEFxO0N.mjs";
2
2
  import { Direction as i } from "./Content.enums.js";
3
3
  import { directionToSide as f } from "./Content.utils.js";
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { G as o } from "../../../../index-BA3njR2k.mjs";
1
+ import { G as o } from "../../../../index-CYWNqEqR.mjs";
2
2
  const p = "ContextMenu.Group", r = o;
3
3
  r.displayName = p;
4
4
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Item/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAcf,OAAO,KAAK,EAAa,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAQnE,eAAO,MAAM,IAAI,wKAwJf,CAAC"}
1
+ {"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Item/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAcf,OAAO,KAAK,EAAa,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAQnE,eAAO,MAAM,IAAI,wKA8Jf,CAAC"}
@@ -1,97 +1,98 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { forwardRef as W, useMemo as y, useId as Y, useState as k, useRef as G, useEffect as J } from "react";
3
- import { I as Q } from "../../../../index-BA3njR2k.mjs";
4
- import { c as D } from "../../../../index-L8X2o7IH.mjs";
5
- import { mergeRefs as T } from "../../../../lib/utils.js";
6
- import { useLevelContext as U } from "../../providers/LevelProvider/LevelProvider.js";
7
- import { useContextMenuContext as V } from "../../ContextMenu.context.js";
8
- import { hasItemIcon as R } from "../../utils/hasItemIcon/hasItemIcon.js";
9
- import "../../../../useContentPositioning-DAKfbddS.mjs";
1
+ import { jsx as b } from "react/jsx-runtime";
2
+ import { forwardRef as G, useMemo as D, useId as J, useState as R, useRef as Q, useEffect as T } from "react";
3
+ import { I as U } from "../../../../index-CYWNqEqR.mjs";
4
+ import { c as F } from "../../../../index-L8X2o7IH.mjs";
5
+ import { mergeRefs as V } from "../../../../lib/utils.js";
6
+ import { useLevelContext as X } from "../../providers/LevelProvider/LevelProvider.js";
7
+ import { useContextMenuContext as Z } from "../../ContextMenu.context.js";
8
+ import { hasItemIcon as O } from "../../utils/hasItemIcon/hasItemIcon.js";
9
+ import "../../../../useContentPositioning-BLEFxO0N.mjs";
10
10
  import "../Content/Content.utils.js";
11
- import { useContextMenuItemFocus as X } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
12
- import { ContextMenuItemProvider as Z } from "./Item.context.js";
13
- import '../../../../assets/Item2.css';const $ = "_item_zkanf_1", F = {
14
- item: $
15
- }, s = "ContextMenu.Item", ee = W((t, x) => {
16
- const { hasItemWithIcon: C } = U(s);
11
+ import { useContextMenuItemFocus as $ } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
12
+ import { ContextMenuItemProvider as ee } from "./Item.context.js";
13
+ import '../../../../assets/Item2.css';const te = "_item_zkanf_1", _ = {
14
+ item: te
15
+ }, s = "ContextMenu.Item", ne = G((t, p) => {
16
+ const { hasItemWithIcon: M } = X(s);
17
17
  if ("isSelectable" in t && t.isSelectable === !1) {
18
18
  const {
19
19
  className: e,
20
- children: b,
21
- isSelectable: q,
22
- hasIconCheckFn: z = R,
23
- ...B
24
- } = t, K = y(() => z(b), [b]);
25
- return /* @__PURE__ */ p(
20
+ children: C,
21
+ isSelectable: B,
22
+ hasIconCheckFn: K = O,
23
+ ...W
24
+ } = t, Y = D(() => K(C), [C]);
25
+ return /* @__PURE__ */ b(
26
26
  "div",
27
27
  {
28
- ref: x,
29
- className: D(F.item, e),
30
- "data-not-selectable": !q,
31
- "data-no-icon-align": K || !C ? "" : void 0,
32
- ...B,
33
- children: b
28
+ ref: p,
29
+ className: F(_.item, e),
30
+ "data-not-selectable": !B,
31
+ "data-no-icon-align": Y || !M ? "" : void 0,
32
+ ...W,
33
+ children: C
34
34
  }
35
35
  );
36
36
  }
37
37
  const {
38
- className: _,
39
- children: a,
40
- isDisabled: M,
41
- isDanger: w,
42
- hasIconCheckFn: A = R,
43
- onSelect: i,
38
+ className: w,
39
+ children: i,
40
+ isDisabled: x,
41
+ isDanger: A,
42
+ hasIconCheckFn: E = O,
43
+ onSelect: a,
44
44
  onClick: r,
45
45
  onFocus: c,
46
46
  onMouseEnter: m,
47
47
  onBlur: u,
48
48
  onMouseLeave: l,
49
49
  onKeyDown: d,
50
- ...E
51
- } = t, H = Y(), [S, v] = k(!1), [o, L] = k(!1), n = G(null), O = y(() => A(a), [a]), { closeMenuImmediately: N } = V(s), {
52
- dataHighlighted: P,
50
+ isCloseMenuOnClick: S = !0,
51
+ ...H
52
+ } = t, L = J(), [v, N] = R(!1), [n, P] = R(!1), o = Q(null), j = D(() => E(i), [i]), { closeMenuImmediately: k, isCloseOnClick: y } = Z(s), {
53
+ dataHighlighted: q,
53
54
  onFocus: f,
54
55
  onMouseEnter: h,
55
56
  onBlur: g,
56
57
  onMouseLeave: I
57
- } = X({
58
+ } = $({
58
59
  displayName: s,
59
- id: H,
60
- isDisabled: M,
61
- hasSubmenu: o
60
+ id: L,
61
+ isDisabled: x,
62
+ hasSubmenu: n
62
63
  });
63
- J(() => {
64
- if (!n.current)
64
+ T(() => {
65
+ if (!o.current)
65
66
  return;
66
- const e = n.current.querySelector("[data-submenu-trigger]");
67
- L(!!e);
68
- }, [n]);
69
- const j = (e) => {
70
- o && e.key === "ArrowRight" && v(!0), d == null || d(e);
67
+ const e = o.current.querySelector("[data-submenu-trigger]");
68
+ P(!!e);
69
+ }, [o]);
70
+ const z = (e) => {
71
+ n && e.key === "ArrowRight" && N(!0), d == null || d(e);
71
72
  };
72
- return /* @__PURE__ */ p(
73
- Z,
73
+ return /* @__PURE__ */ b(
74
+ ee,
74
75
  {
75
- hasSubmenu: o,
76
- subMenuOpen: S,
77
- setSubMenuOpen: v,
78
- children: /* @__PURE__ */ p(
79
- Q,
76
+ hasSubmenu: n,
77
+ subMenuOpen: v,
78
+ setSubMenuOpen: N,
79
+ children: /* @__PURE__ */ b(
80
+ U,
80
81
  {
81
- ref: T(x, n),
82
- className: D(F.item, _),
83
- disabled: M,
82
+ ref: V(p, o),
83
+ className: F(_.item, w),
84
+ disabled: x,
84
85
  "data-item": !0,
85
- "data-danger": w ? "" : void 0,
86
- "data-no-icon-align": O || !C ? "" : void 0,
87
- "data-has-submenu": o ? "" : void 0,
86
+ "data-danger": A ? "" : void 0,
87
+ "data-no-icon-align": j || !M ? "" : void 0,
88
+ "data-has-submenu": n ? "" : void 0,
88
89
  onSelect: (e) => {
89
- i == null || i(e), N(!0);
90
+ a == null || a(e), y && S && k(!0);
90
91
  },
91
92
  onClick: (e) => {
92
- e.preventDefault(), r == null || r(e), N(!0);
93
+ e.preventDefault(), r == null || r(e), y && S && k(!0);
93
94
  },
94
- "data-highlighted": S || P,
95
+ "data-highlighted": v || q,
95
96
  onFocus: (e) => {
96
97
  f == null || f(), c == null || c(e);
97
98
  },
@@ -104,15 +105,15 @@ import '../../../../assets/Item2.css';const $ = "_item_zkanf_1", F = {
104
105
  onMouseLeave: (e) => {
105
106
  I == null || I(e), l == null || l(e);
106
107
  },
107
- onKeyDown: j,
108
- ...E,
109
- children: a
108
+ onKeyDown: z,
109
+ ...H,
110
+ children: i
110
111
  }
111
112
  )
112
113
  }
113
114
  );
114
115
  });
115
- ee.displayName = s;
116
+ ne.displayName = s;
116
117
  export {
117
- ee as Item
118
+ ne as Item
118
119
  };
@@ -15,6 +15,12 @@ export type SelectableItemProps = RadixItemProps & {
15
15
  * By default, the `hasItemIcon` from utils is used.
16
16
  */
17
17
  hasIconCheckFn?: (children: React.ReactNode) => boolean;
18
+ /**
19
+ * Whether the item should close the menu when clicked.
20
+ *
21
+ * @default true
22
+ */
23
+ isCloseMenuOnClick?: boolean;
18
24
  };
19
25
  export type NotSelectableItemProps = React.ComponentPropsWithRef<'div'> & {
20
26
  /**