@televet/kibble-ui 5.0.2-beta.menu.1 → 5.0.2-beta.menu.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.
- package/dist/chunks/{avatarGroup.component-DSvRgDWo.js → avatarGroup.component-BpwmnR02.js} +2 -2
- package/dist/chunks/{avatarGroup.component-DSvRgDWo.js.map → avatarGroup.component-BpwmnR02.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-D2U1URML.js → avatarGroup.component-DvpCFAzZ.js} +2 -2
- package/dist/chunks/{avatarGroup.component-D2U1URML.js.map → avatarGroup.component-DvpCFAzZ.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-D1zl9wyM.js → buttonGroup.component-CmdgeMRX.js} +2 -2
- package/dist/chunks/{buttonGroup.component-D1zl9wyM.js.map → buttonGroup.component-CmdgeMRX.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-BWZfUx2E.js → buttonGroup.component-DJ7RLC9Y.js} +2 -2
- package/dist/chunks/{buttonGroup.component-BWZfUx2E.js.map → buttonGroup.component-DJ7RLC9Y.js.map} +1 -1
- package/dist/chunks/{calendar.component-BTiJi3ZE.js → calendar.component-BKYpZfH3.js} +2 -2
- package/dist/chunks/{calendar.component-BTiJi3ZE.js.map → calendar.component-BKYpZfH3.js.map} +1 -1
- package/dist/chunks/{calendar.component-CqcL9gQD.js → calendar.component-Dm6b_z9j.js} +2 -2
- package/dist/chunks/{calendar.component-CqcL9gQD.js.map → calendar.component-Dm6b_z9j.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-OTLcFGND.js → conversationCard.component-BIYLeiiS.js} +2 -2
- package/dist/chunks/{conversationCard.component-OTLcFGND.js.map → conversationCard.component-BIYLeiiS.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-o0x-PRyR.js → conversationCard.component-Yb7McOBu.js} +2 -2
- package/dist/chunks/{conversationCard.component-o0x-PRyR.js.map → conversationCard.component-Yb7McOBu.js.map} +1 -1
- package/dist/chunks/{datePicker.component-DDlH8JLD.js → datePicker.component-BgZaBVYt.js} +2 -2
- package/dist/chunks/{datePicker.component-DDlH8JLD.js.map → datePicker.component-BgZaBVYt.js.map} +1 -1
- package/dist/chunks/{datePicker.component-C9u3joo2.js → datePicker.component-DzTQdhru.js} +2 -2
- package/dist/chunks/{datePicker.component-C9u3joo2.js.map → datePicker.component-DzTQdhru.js.map} +1 -1
- package/dist/chunks/{datePicker.provider-Q_wJ5IPm.js → datePicker.provider-BIYTNRtD.js} +2 -2
- package/dist/chunks/{datePicker.provider-Q_wJ5IPm.js.map → datePicker.provider-BIYTNRtD.js.map} +1 -1
- package/dist/chunks/{datePicker.provider--9ovHuHv.js → datePicker.provider-D5C-lpgW.js} +2 -2
- package/dist/chunks/{datePicker.provider--9ovHuHv.js.map → datePicker.provider-D5C-lpgW.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-DklOdWT-.js → dateTimePicker.component-Bj_1PBnq.js} +2 -2
- package/dist/chunks/{dateTimePicker.component-DklOdWT-.js.map → dateTimePicker.component-Bj_1PBnq.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-B-72OFcp.js → dateTimePicker.component-CEMqEKXq.js} +2 -2
- package/dist/chunks/{dateTimePicker.component-B-72OFcp.js.map → dateTimePicker.component-CEMqEKXq.js.map} +1 -1
- package/dist/chunks/menu.component-DXw7H-8j.js +2 -0
- package/dist/chunks/menu.component-DXw7H-8j.js.map +1 -0
- package/dist/chunks/{menu.component-Dd4ePEAs.js → menu.component-DgJSzOB8.js} +87 -84
- package/dist/chunks/menu.component-DgJSzOB8.js.map +1 -0
- package/dist/chunks/{radioGroup.types-_TTBbP2R.js → radioGroup.types-3WDwvOcO.js} +2 -2
- package/dist/chunks/{radioGroup.types-_TTBbP2R.js.map → radioGroup.types-3WDwvOcO.js.map} +1 -1
- package/dist/chunks/{radioGroup.types-C27z0u3-.js → radioGroup.types-DR0BEU8s.js} +2 -2
- package/dist/chunks/{radioGroup.types-C27z0u3-.js.map → radioGroup.types-DR0BEU8s.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-CNqS6gR_.js → tagBlock.component-C88f0ff4.js} +2 -2
- package/dist/chunks/{tagBlock.component-CNqS6gR_.js.map → tagBlock.component-C88f0ff4.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-0kUeaXlw.js → tagBlock.component-qIaw8BI-.js} +2 -2
- package/dist/chunks/{tagBlock.component-0kUeaXlw.js.map → tagBlock.component-qIaw8BI-.js.map} +1 -1
- package/dist/cjs/components/AvatarGroup/index.cjs +1 -1
- package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
- package/dist/cjs/components/Calendar/index.cjs +1 -1
- package/dist/cjs/components/ConversationCard/index.cjs +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -1
- package/dist/cjs/components/DateTimePicker/index.cjs +1 -1
- package/dist/cjs/components/Menu/index.cjs +1 -1
- package/dist/cjs/components/RadioGroup/index.cjs +1 -1
- package/dist/cjs/components/TagBlock/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/AvatarGroup/index.js +1 -1
- package/dist/esm/components/ButtonGroup/index.js +1 -1
- package/dist/esm/components/Calendar/index.js +1 -1
- package/dist/esm/components/ConversationCard/index.js +1 -1
- package/dist/esm/components/DatePicker/index.js +2 -2
- package/dist/esm/components/DateTimePicker/index.js +1 -1
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/RadioGroup/index.js +1 -1
- package/dist/esm/components/TagBlock/index.js +1 -1
- package/dist/esm/components/index.js +10 -10
- package/dist/esm/index.js +10 -10
- package/package.json +1 -1
- package/dist/chunks/menu.component-DWJeIuGD.js +0 -2
- package/dist/chunks/menu.component-DWJeIuGD.js.map +0 -1
- package/dist/chunks/menu.component-Dd4ePEAs.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import st, { forwardRef as
|
|
2
|
+
import st, { forwardRef as h, useEffect as G, useId as Y, useRef as le, useCallback as j, useState as B, useMemo as D } from "react";
|
|
3
3
|
import { B as T } from "./index-9BerxEcw.js";
|
|
4
4
|
import { B as Z } from "./button.component-BO6oee_V.js";
|
|
5
|
-
import { I as
|
|
5
|
+
import { I as he } from "./icon.component-PV_nHBId.js";
|
|
6
6
|
import { W as ee } from "./text.component-CdTyTFds.js";
|
|
7
7
|
import { T as ge } from "./tooltip.component-C_NS-AoH.js";
|
|
8
8
|
import { F as z } from "./flex-CX-8gE9T.js";
|
|
@@ -12,35 +12,35 @@ import { u as it } from "./usePortalContentRef-DO_jc4W9.js";
|
|
|
12
12
|
import { u as te, s as fe, c as Me, d as Pe, P as ut } from "./index-C9UYIjEB.js";
|
|
13
13
|
import { c as lt } from "./create-slot-recipe-context-D_FXDJGp.js";
|
|
14
14
|
import { d as dt } from "./icons-CoSqruIn.js";
|
|
15
|
-
import { a as
|
|
15
|
+
import { a as _, d as g, b as O, e as pt, u as mt, f as xt, g as ht, n as gt } from "./use-locale-context-Bw4Gg9Z0.js";
|
|
16
16
|
import { m as ft, c as Mt } from "./index-CbVKVxMW.js";
|
|
17
17
|
import { a6 as p } from "./index-fHSGm2nC.js";
|
|
18
18
|
import { W as Pt } from "./checkbox.component-DE35wBj-.js";
|
|
19
|
-
const [ve, m] =
|
|
19
|
+
const [ve, m] = _({
|
|
20
20
|
name: "MenuContext",
|
|
21
21
|
hookName: "useMenuContext",
|
|
22
22
|
providerName: "<MenuProvider />",
|
|
23
23
|
strict: !1
|
|
24
|
-
}), je =
|
|
24
|
+
}), je = h((o, n) => {
|
|
25
25
|
const t = m(), s = p(t.getArrowProps(), o);
|
|
26
26
|
return /* @__PURE__ */ e.jsx(g.div, { ...s, ref: n });
|
|
27
27
|
});
|
|
28
28
|
je.displayName = "MenuArrow";
|
|
29
|
-
const Ce =
|
|
29
|
+
const Ce = h((o, n) => {
|
|
30
30
|
const t = m(), s = p(t.getArrowTipProps(), o);
|
|
31
31
|
return /* @__PURE__ */ e.jsx(g.div, { ...s, ref: n });
|
|
32
32
|
});
|
|
33
33
|
Ce.displayName = "MenuArrowTip";
|
|
34
|
-
const [ne, Zt] =
|
|
34
|
+
const [ne, Zt] = _({
|
|
35
35
|
name: "MenuItemContext",
|
|
36
36
|
hookName: "useMenuItemContext",
|
|
37
37
|
providerName: "<MenuItemProvider />"
|
|
38
|
-
}), [oe, Ie] =
|
|
38
|
+
}), [oe, Ie] = _({
|
|
39
39
|
name: "MenuItemPropsContext",
|
|
40
40
|
hookName: "useMenuItemPropsContext",
|
|
41
41
|
providerName: "<MenuItemPropsProvider />"
|
|
42
|
-
}), be =
|
|
43
|
-
const [t, s] =
|
|
42
|
+
}), be = h((o, n) => {
|
|
43
|
+
const [t, s] = O()(o, [
|
|
44
44
|
"checked",
|
|
45
45
|
"closeOnSelect",
|
|
46
46
|
"disabled",
|
|
@@ -54,63 +54,63 @@ const [ne, Zt] = G({
|
|
|
54
54
|
return /* @__PURE__ */ e.jsx(oe, { value: c, children: /* @__PURE__ */ e.jsx(ne, { value: i, children: /* @__PURE__ */ e.jsx(g.div, { ...a, ref: n }) }) });
|
|
55
55
|
});
|
|
56
56
|
be.displayName = "MenuCheckboxItem";
|
|
57
|
-
const ke =
|
|
57
|
+
const ke = h((o, n) => {
|
|
58
58
|
const t = m(), s = te(), c = p(t.getContentProps(), s.getPresenceProps(), o);
|
|
59
59
|
return s.unmounted ? null : /* @__PURE__ */ e.jsx(g.div, { ...c, ref: pt(s.ref, n) });
|
|
60
60
|
});
|
|
61
61
|
ke.displayName = "MenuContent";
|
|
62
|
-
const Se =
|
|
62
|
+
const Se = h((o, n) => {
|
|
63
63
|
const t = m(), s = p(t.getContextTriggerProps(), o);
|
|
64
64
|
return /* @__PURE__ */ e.jsx(g.button, { ...s, ref: n });
|
|
65
65
|
});
|
|
66
66
|
Se.displayName = "MenuContextTrigger";
|
|
67
|
-
const we =
|
|
67
|
+
const we = h((o, n) => {
|
|
68
68
|
const t = m(), s = p(t.getIndicatorProps(), o);
|
|
69
69
|
return /* @__PURE__ */ e.jsx(g.div, { ...s, ref: n });
|
|
70
70
|
});
|
|
71
71
|
we.displayName = "MenuIndicator";
|
|
72
|
-
const Ne =
|
|
73
|
-
const [t, s] =
|
|
72
|
+
const Ne = h((o, n) => {
|
|
73
|
+
const [t, s] = O()(o, [
|
|
74
74
|
"closeOnSelect",
|
|
75
75
|
"disabled",
|
|
76
76
|
"value",
|
|
77
77
|
"valueText",
|
|
78
78
|
"onSelect"
|
|
79
79
|
]), c = m(), u = p(c.getItemProps(t), s), a = c.getItemState(t);
|
|
80
|
-
return
|
|
80
|
+
return G(() => c.addItemListener({ id: a.id, onSelect: t.onSelect }), [a.id, t.onSelect]), /* @__PURE__ */ e.jsx(oe, { value: t, children: /* @__PURE__ */ e.jsx(ne, { value: a, children: /* @__PURE__ */ e.jsx(g.div, { ...u, ref: n }) }) });
|
|
81
81
|
});
|
|
82
82
|
Ne.displayName = "MenuItem";
|
|
83
|
-
const [ye, Ae] =
|
|
83
|
+
const [ye, Ae] = _({
|
|
84
84
|
name: "MenuItemGroupContext",
|
|
85
85
|
hookName: "useMenuItemGroupContext",
|
|
86
86
|
providerName: "<MenuItemGroupProvider />"
|
|
87
|
-
}), Te =
|
|
88
|
-
const [t, s] =
|
|
87
|
+
}), Te = h((o, n) => {
|
|
88
|
+
const [t, s] = O()(o, ["id"]), c = m(), a = { id: Y(), ...t }, i = p(c.getItemGroupProps(a), s);
|
|
89
89
|
return /* @__PURE__ */ e.jsx(ye, { value: a, children: /* @__PURE__ */ e.jsx(g.div, { ...i, ref: n }) });
|
|
90
90
|
});
|
|
91
91
|
Te.displayName = "MenuItemGroup";
|
|
92
|
-
const Ge =
|
|
92
|
+
const Ge = h((o, n) => {
|
|
93
93
|
const t = m(), s = Ae(), c = p(t.getItemGroupLabelProps({ htmlFor: s.id }), o);
|
|
94
94
|
return /* @__PURE__ */ e.jsx(g.div, { ...c, ref: n });
|
|
95
95
|
});
|
|
96
96
|
Ge.displayName = "MenuItemGroupLabel";
|
|
97
|
-
const _e =
|
|
97
|
+
const _e = h((o, n) => {
|
|
98
98
|
const t = m(), s = Ie(), c = p(t.getItemIndicatorProps(s), o);
|
|
99
99
|
return /* @__PURE__ */ e.jsx(g.div, { ...c, ref: n });
|
|
100
100
|
});
|
|
101
101
|
_e.displayName = "MenuItemIndicator";
|
|
102
|
-
const Oe =
|
|
102
|
+
const Oe = h((o, n) => {
|
|
103
103
|
const t = m(), s = Ie(), c = p(t.getItemTextProps(s), o);
|
|
104
104
|
return /* @__PURE__ */ e.jsx(g.div, { ...c, ref: n });
|
|
105
105
|
});
|
|
106
106
|
Oe.displayName = "MenuItemText";
|
|
107
|
-
const $e =
|
|
107
|
+
const $e = h((o, n) => {
|
|
108
108
|
const t = m(), s = p(t.getPositionerProps(), o);
|
|
109
109
|
return te().unmounted ? null : /* @__PURE__ */ e.jsx(g.div, { ...s, ref: n });
|
|
110
110
|
});
|
|
111
111
|
$e.displayName = "MenuPositioner";
|
|
112
|
-
const Re =
|
|
113
|
-
const [t, s] =
|
|
112
|
+
const Re = h((o, n) => {
|
|
113
|
+
const [t, s] = O()(o, [
|
|
114
114
|
"closeOnSelect",
|
|
115
115
|
"disabled",
|
|
116
116
|
"value",
|
|
@@ -124,8 +124,8 @@ const Re = x((o, n) => {
|
|
|
124
124
|
return /* @__PURE__ */ e.jsx(oe, { value: a, children: /* @__PURE__ */ e.jsx(ne, { value: f, children: /* @__PURE__ */ e.jsx(g.div, { ...i, ref: n }) }) });
|
|
125
125
|
});
|
|
126
126
|
Re.displayName = "MenuRadioItem";
|
|
127
|
-
const Le =
|
|
128
|
-
const [t, s] =
|
|
127
|
+
const Le = h((o, n) => {
|
|
128
|
+
const [t, s] = O()(o, [
|
|
129
129
|
"id",
|
|
130
130
|
"onValueChange",
|
|
131
131
|
"value"
|
|
@@ -135,31 +135,31 @@ const Le = x((o, n) => {
|
|
|
135
135
|
Le.displayName = "MenuRadioItemGroup";
|
|
136
136
|
const Be = (o) => {
|
|
137
137
|
const n = le(o), t = le(!1);
|
|
138
|
-
|
|
138
|
+
G(() => {
|
|
139
139
|
n.current = o;
|
|
140
|
-
}),
|
|
140
|
+
}), G(() => {
|
|
141
141
|
t.current !== !0 && (t.current = !0, n.current());
|
|
142
142
|
}, []);
|
|
143
143
|
}, vt = (o) => {
|
|
144
|
-
const n = Y(), { getRootNode: t } = mt(), { dir: s } =
|
|
144
|
+
const n = Y(), { getRootNode: t } = mt(), { dir: s } = xt(), c = {
|
|
145
145
|
id: n,
|
|
146
146
|
dir: s,
|
|
147
147
|
getRootNode: t,
|
|
148
148
|
...o
|
|
149
|
-
}, u =
|
|
149
|
+
}, u = ht(ft, c);
|
|
150
150
|
return { api: Mt(u, gt), service: u };
|
|
151
|
-
}, [ze, Fe] =
|
|
151
|
+
}, [ze, Fe] = _({
|
|
152
152
|
name: "MenuMachineContext",
|
|
153
153
|
hookName: "useMenuMachineContext",
|
|
154
154
|
providerName: "<MenuMachineProvider />",
|
|
155
155
|
strict: !1
|
|
156
|
-
}), [We, jt] =
|
|
156
|
+
}), [We, jt] = _({
|
|
157
157
|
name: "MenuMachineContext",
|
|
158
158
|
hookName: "useMenuMachineContext",
|
|
159
159
|
providerName: "<MenuMachineProvider />",
|
|
160
160
|
strict: !1
|
|
161
161
|
}), Ct = (o) => {
|
|
162
|
-
const [n, t] = fe(o), [s, c] =
|
|
162
|
+
const [n, t] = fe(o), [s, c] = O()(t, [
|
|
163
163
|
"anchorPoint",
|
|
164
164
|
"aria-label",
|
|
165
165
|
"closeOnSelect",
|
|
@@ -194,12 +194,12 @@ const Be = (o) => {
|
|
|
194
194
|
});
|
|
195
195
|
const N = j(() => n?.getTriggerItemProps(a), [a, n]);
|
|
196
196
|
return /* @__PURE__ */ e.jsx(We, { value: N, children: /* @__PURE__ */ e.jsx(ze, { value: i, children: /* @__PURE__ */ e.jsx(ve, { value: a, children: /* @__PURE__ */ e.jsx(Pe, { value: f, children: u }) }) }) });
|
|
197
|
-
}, Ee =
|
|
197
|
+
}, Ee = h((o, n) => {
|
|
198
198
|
const t = m(), s = p(t.getSeparatorProps(), o);
|
|
199
199
|
return /* @__PURE__ */ e.jsx(g.hr, { ...s, ref: n });
|
|
200
200
|
});
|
|
201
201
|
Ee.displayName = "MenuSeparator";
|
|
202
|
-
const De =
|
|
202
|
+
const De = h((o, n) => {
|
|
203
203
|
const t = m(), s = te(), c = p(
|
|
204
204
|
{
|
|
205
205
|
...t.getTriggerProps(),
|
|
@@ -210,80 +210,80 @@ const De = x((o, n) => {
|
|
|
210
210
|
return /* @__PURE__ */ e.jsx(g.button, { ...c, ref: n });
|
|
211
211
|
});
|
|
212
212
|
De.displayName = "MenuTrigger";
|
|
213
|
-
const Ve =
|
|
213
|
+
const Ve = h((o, n) => {
|
|
214
214
|
const t = jt(), s = p(t?.() ?? {}, o);
|
|
215
215
|
return /* @__PURE__ */ e.jsx(g.div, { ...s, ref: n });
|
|
216
216
|
});
|
|
217
217
|
Ve.displayName = "MenuTriggerItem";
|
|
218
218
|
const {
|
|
219
219
|
withRootProvider: He,
|
|
220
|
-
withContext:
|
|
220
|
+
withContext: x
|
|
221
221
|
} = lt({ key: "menu" });
|
|
222
222
|
He(
|
|
223
223
|
It
|
|
224
224
|
);
|
|
225
225
|
const bt = He(Ct, {
|
|
226
226
|
defaultProps: { lazyMount: !0, unmountOnExit: !0 }
|
|
227
|
-
}), kt =
|
|
227
|
+
}), kt = x(
|
|
228
228
|
De,
|
|
229
229
|
"trigger",
|
|
230
230
|
{ forwardAsChild: !0 }
|
|
231
231
|
);
|
|
232
|
-
|
|
233
|
-
const St =
|
|
232
|
+
x(Se, "contextTrigger", { forwardAsChild: !0 });
|
|
233
|
+
const St = x(
|
|
234
234
|
$e,
|
|
235
235
|
"positioner",
|
|
236
236
|
{ forwardAsChild: !0 }
|
|
237
237
|
);
|
|
238
|
-
|
|
238
|
+
x(
|
|
239
239
|
Ee,
|
|
240
240
|
"separator",
|
|
241
241
|
{ forwardAsChild: !0 }
|
|
242
242
|
);
|
|
243
|
-
const wt =
|
|
243
|
+
const wt = x(
|
|
244
244
|
ke,
|
|
245
245
|
"content",
|
|
246
246
|
{ forwardAsChild: !0 }
|
|
247
|
-
), Nt =
|
|
247
|
+
), Nt = x(
|
|
248
248
|
Ce,
|
|
249
249
|
"arrowTip",
|
|
250
250
|
{ forwardAsChild: !0 }
|
|
251
251
|
);
|
|
252
|
-
|
|
252
|
+
x(
|
|
253
253
|
je,
|
|
254
254
|
"arrow",
|
|
255
255
|
{ forwardAsChild: !0, defaultProps: { children: /* @__PURE__ */ e.jsx(Nt, {}) } }
|
|
256
256
|
);
|
|
257
|
-
|
|
257
|
+
x(
|
|
258
258
|
we,
|
|
259
259
|
"indicator",
|
|
260
260
|
{ forwardAsChild: !0 }
|
|
261
261
|
);
|
|
262
|
-
const yt =
|
|
262
|
+
const yt = x(
|
|
263
263
|
Te,
|
|
264
264
|
"itemGroup",
|
|
265
265
|
{ forwardAsChild: !0 }
|
|
266
|
-
), At =
|
|
266
|
+
), At = x(Ge, "itemGroupLabel", { forwardAsChild: !0 }), de = x(
|
|
267
267
|
Ne,
|
|
268
268
|
"item",
|
|
269
269
|
{ forwardAsChild: !0 }
|
|
270
|
-
), Tt =
|
|
271
|
-
|
|
270
|
+
), Tt = x(Ve, "item", { forwardAsChild: !0 });
|
|
271
|
+
x(
|
|
272
272
|
Oe,
|
|
273
273
|
"itemText",
|
|
274
274
|
{ forwardAsChild: !0 }
|
|
275
275
|
);
|
|
276
|
-
|
|
276
|
+
x(
|
|
277
277
|
"kbd",
|
|
278
278
|
"itemCommand"
|
|
279
279
|
);
|
|
280
|
-
|
|
280
|
+
x(_e, "itemIndicator", {
|
|
281
281
|
forwardAsChild: !0,
|
|
282
282
|
defaultProps: { children: /* @__PURE__ */ e.jsx(dt, { boxSize: "4" }) }
|
|
283
283
|
});
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
284
|
+
x(be, "item", { forwardAsChild: !0 });
|
|
285
|
+
x(Le, "itemGroup", { forwardAsChild: !0 });
|
|
286
|
+
x(
|
|
287
287
|
Re,
|
|
288
288
|
"item",
|
|
289
289
|
{ forwardAsChild: !0 }
|
|
@@ -323,16 +323,16 @@ const Ke = ({
|
|
|
323
323
|
children: t
|
|
324
324
|
}
|
|
325
325
|
),
|
|
326
|
-
!o && /* @__PURE__ */ e.jsx(z, { className: "Menu__ButtonCaret", "data-testid": `${a}-caret`, children: /* @__PURE__ */ e.jsx(
|
|
326
|
+
!o && /* @__PURE__ */ e.jsx(z, { className: "Menu__ButtonCaret", "data-testid": `${a}-caret`, children: /* @__PURE__ */ e.jsx(he, { name: "chevronDown", size: n === "lg" ? "sm" : "xs" }) })
|
|
327
327
|
]
|
|
328
328
|
}
|
|
329
329
|
), Gt = ({ tooltipProps: o, isMenuOpen: n, ...t }) => {
|
|
330
|
-
const [s, c] =
|
|
330
|
+
const [s, c] = B(!1), u = j(() => {
|
|
331
331
|
n || c(!0);
|
|
332
332
|
}, [n]), a = j(() => {
|
|
333
333
|
n || c(!1);
|
|
334
334
|
}, [n]);
|
|
335
|
-
return
|
|
335
|
+
return G(() => {
|
|
336
336
|
n && c(!1);
|
|
337
337
|
}, [n]), /* @__PURE__ */ e.jsx(ge, { label: t.text || "", open: s && !n, ...o, children: /* @__PURE__ */ e.jsx(
|
|
338
338
|
T,
|
|
@@ -355,7 +355,7 @@ const Ke = ({
|
|
|
355
355
|
["data-testid"]: a = "kibble-menu-item",
|
|
356
356
|
...i
|
|
357
357
|
}) => {
|
|
358
|
-
const [f, N] =
|
|
358
|
+
const [f, N] = B(!1), y = j(() => {
|
|
359
359
|
t && t(i.value);
|
|
360
360
|
}, [t, i.value]);
|
|
361
361
|
if (c === "submenu") {
|
|
@@ -368,7 +368,7 @@ const Ke = ({
|
|
|
368
368
|
lazyMount: I = !0,
|
|
369
369
|
unmountOnExit: V = !0
|
|
370
370
|
} = i;
|
|
371
|
-
return /* @__PURE__ */ e.jsx(
|
|
371
|
+
return console.log("positionerProps", M), /* @__PURE__ */ e.jsx(
|
|
372
372
|
Ot,
|
|
373
373
|
{
|
|
374
374
|
lazyMount: I,
|
|
@@ -394,7 +394,7 @@ const Ke = ({
|
|
|
394
394
|
variant: u
|
|
395
395
|
}
|
|
396
396
|
),
|
|
397
|
-
/* @__PURE__ */ e.jsx(
|
|
397
|
+
/* @__PURE__ */ e.jsx(he, { name: "chevronRight", size: "sm" })
|
|
398
398
|
]
|
|
399
399
|
}
|
|
400
400
|
),
|
|
@@ -479,11 +479,11 @@ const Ke = ({
|
|
|
479
479
|
["data-testid"]: s = "kibble-menu-toggle-buttons"
|
|
480
480
|
}) => {
|
|
481
481
|
const c = !!o;
|
|
482
|
-
return /* @__PURE__ */ e.jsx(T, { className: "Menu__ToggleButtons", "data-testid": s, ...c && { textAlign: "right", w: "50%" }, children: c ? /* @__PURE__ */ e.jsx(e.Fragment, { children: n ? /* @__PURE__ */ e.jsx(
|
|
482
|
+
return /* @__PURE__ */ e.jsx(T, { className: "Menu__ToggleButtons", "data-testid": s, ...c && { textAlign: "right", w: "50%" }, children: c ? /* @__PURE__ */ e.jsx(e.Fragment, { children: n ? /* @__PURE__ */ e.jsx(xe, { hasSelectedItems: n, groupName: o, onToggle: t }) : /* @__PURE__ */ e.jsx(me, { groupName: o, onToggle: t }) }) : /* @__PURE__ */ e.jsxs(z, { justifyContent: "space-between", children: [
|
|
483
483
|
/* @__PURE__ */ e.jsx(me, { groupName: o, onToggle: t }),
|
|
484
|
-
/* @__PURE__ */ e.jsx(
|
|
484
|
+
/* @__PURE__ */ e.jsx(xe, { hasSelectedItems: n, groupName: o, onToggle: t })
|
|
485
485
|
] }) });
|
|
486
|
-
}, me = ({ groupName: o, onToggle: n }) => /* @__PURE__ */ e.jsx(Z, { variant: "ghost", size: "xs", onClick: () => n({ groupName: o, clear: !1 }), children: "Select All" }),
|
|
486
|
+
}, me = ({ groupName: o, onToggle: n }) => /* @__PURE__ */ e.jsx(Z, { variant: "ghost", size: "xs", onClick: () => n({ groupName: o, clear: !1 }), children: "Select All" }), xe = ({ hasSelectedItems: o, groupName: n, onToggle: t }) => /* @__PURE__ */ e.jsx(
|
|
487
487
|
Z,
|
|
488
488
|
{
|
|
489
489
|
variant: "ghostNeutral",
|
|
@@ -520,7 +520,11 @@ const Ke = ({
|
|
|
520
520
|
searchPlaceholder: qe = "Search...",
|
|
521
521
|
shouldTruncateText: Je,
|
|
522
522
|
...se
|
|
523
|
-
} = n || {}, [Qe, Ue] =
|
|
523
|
+
} = n || {}, [Qe, Ue] = B(!1), [q, J] = B(""), [F, Q] = B(I);
|
|
524
|
+
G(() => {
|
|
525
|
+
console.log("positionerProps", t);
|
|
526
|
+
}, [t]);
|
|
527
|
+
const ce = D(() => {
|
|
524
528
|
const r = {};
|
|
525
529
|
return F?.forEach((l) => {
|
|
526
530
|
const d = l.groupLabel || "default", P = l.type === "checkbox" ? "checkbox" : "default";
|
|
@@ -532,10 +536,10 @@ const Ke = ({
|
|
|
532
536
|
const P = M.indexOf(l), v = M.indexOf(d);
|
|
533
537
|
return P !== -1 && v !== -1 ? P - v : P !== -1 ? -1 : v !== -1 ? 1 : 0;
|
|
534
538
|
});
|
|
535
|
-
}, [ce, M]),
|
|
536
|
-
(r) =>
|
|
537
|
-
[
|
|
538
|
-
), b = D(() =>
|
|
539
|
+
}, [ce, M]), $ = D(() => I?.filter((r) => r.type === "checkbox") || [], [I]), U = j(
|
|
540
|
+
(r) => $.some((l) => l.value === r && l.checked),
|
|
541
|
+
[$]
|
|
542
|
+
), b = D(() => $.filter((r) => r.checked), [$]), ie = j(
|
|
539
543
|
({ groupName: r, clear: l }) => {
|
|
540
544
|
let d;
|
|
541
545
|
const P = F.filter((v) => v.type === "checkbox" && !v.disabled);
|
|
@@ -547,7 +551,7 @@ const Ke = ({
|
|
|
547
551
|
);
|
|
548
552
|
} else
|
|
549
553
|
d = l ? [] : P.map((v) => ({ ...v, checked: !0 }));
|
|
550
|
-
|
|
554
|
+
re?.({ allSelectedItems: d });
|
|
551
555
|
},
|
|
552
556
|
[re, F, b]
|
|
553
557
|
), Xe = j(
|
|
@@ -570,9 +574,8 @@ const Ke = ({
|
|
|
570
574
|
[H, U, b]
|
|
571
575
|
), ue = j((r, l) => r === "" || !r ? l : l.filter((d) => !!(typeof d.label == "string" ? d.label : d.valueText)?.toLowerCase().includes(r.toLowerCase())), []), Ye = j(
|
|
572
576
|
(r) => {
|
|
573
|
-
console.log("e.target.value", r.target.value);
|
|
574
577
|
const l = r.target.value;
|
|
575
|
-
|
|
578
|
+
J(l), w && w(r);
|
|
576
579
|
},
|
|
577
580
|
[w]
|
|
578
581
|
), Ze = j(() => {
|
|
@@ -585,7 +588,7 @@ const Ke = ({
|
|
|
585
588
|
},
|
|
586
589
|
[I, a, b]
|
|
587
590
|
);
|
|
588
|
-
return
|
|
591
|
+
return G(() => {
|
|
589
592
|
Q(w ? I : ue(q, I));
|
|
590
593
|
}, [q, w, ue, I]), /* @__PURE__ */ e.jsxs(
|
|
591
594
|
bt,
|
|
@@ -647,7 +650,7 @@ const Ke = ({
|
|
|
647
650
|
"data-testid": `${i}-checkbox-group-header`,
|
|
648
651
|
px: 3,
|
|
649
652
|
mt: K ? 1 : 2,
|
|
650
|
-
children: y &&
|
|
653
|
+
children: y && !!$.length && /* @__PURE__ */ e.jsx(
|
|
651
654
|
pe,
|
|
652
655
|
{
|
|
653
656
|
onToggle: ie,
|
|
@@ -658,8 +661,8 @@ const Ke = ({
|
|
|
658
661
|
),
|
|
659
662
|
A && /* @__PURE__ */ e.jsx(z, { justifyContent: "center", py: 5, children: /* @__PURE__ */ e.jsx(at, { fullScreen: !0 }) }),
|
|
660
663
|
/* @__PURE__ */ e.jsx(T, { className: "Menu__List", "data-testid": `${i}-list`, children: ae.length ? /* @__PURE__ */ e.jsx(e.Fragment, { children: ae.map(([r, l]) => {
|
|
661
|
-
const d = r === "default", P = Object.keys(l), v = d ? st.Fragment : yt, tt = l.checkbox?.map((
|
|
662
|
-
(
|
|
664
|
+
const d = r === "default", P = Object.keys(l), v = d ? st.Fragment : yt, tt = l.checkbox?.map((R) => R.value)?.some(
|
|
665
|
+
(R) => b.some((E) => E.value === R && E.checked)
|
|
663
666
|
);
|
|
664
667
|
return /* @__PURE__ */ e.jsxs(v, { children: [
|
|
665
668
|
!d && /* @__PURE__ */ e.jsx(At, { children: /* @__PURE__ */ e.jsxs(z, { alignItems: "center", justifyContent: "space-between", children: [
|
|
@@ -674,20 +677,20 @@ const Ke = ({
|
|
|
674
677
|
)
|
|
675
678
|
] }) }),
|
|
676
679
|
Object.entries(l).map(
|
|
677
|
-
([
|
|
678
|
-
const { groupLabel: ot, ...rt } =
|
|
680
|
+
([R, E]) => E.map((L, nt) => {
|
|
681
|
+
const { groupLabel: ot, ...rt } = L;
|
|
679
682
|
return /* @__PURE__ */ e.jsx(
|
|
680
683
|
_t,
|
|
681
684
|
{
|
|
682
685
|
...rt,
|
|
683
686
|
shouldTruncateText: Je,
|
|
684
|
-
...
|
|
685
|
-
checked: U(
|
|
687
|
+
...L.type === "checkbox" && {
|
|
688
|
+
checked: U(L.value)
|
|
686
689
|
},
|
|
687
|
-
"data-testid": `${i}-item-${
|
|
688
|
-
onSelect: () => Xe(
|
|
690
|
+
"data-testid": `${i}-item-${L.label}`,
|
|
691
|
+
onSelect: () => Xe(L)
|
|
689
692
|
},
|
|
690
|
-
`menu-item-${ot}-${
|
|
693
|
+
`menu-item-${ot}-${R}-${nt}`
|
|
691
694
|
);
|
|
692
695
|
})
|
|
693
696
|
)
|
|
@@ -703,4 +706,4 @@ const Ke = ({
|
|
|
703
706
|
export {
|
|
704
707
|
Ot as M
|
|
705
708
|
};
|
|
706
|
-
//# sourceMappingURL=menu.component-
|
|
709
|
+
//# sourceMappingURL=menu.component-DgJSzOB8.js.map
|