@televet/kibble-ui 5.0.2-beta.menu.4 → 5.0.2-beta.menu.5
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-BsSYSCvd.js → avatarGroup.component-CTzKVekY.js} +2 -2
- package/dist/chunks/{avatarGroup.component-BsSYSCvd.js.map → avatarGroup.component-CTzKVekY.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-DlZ_W4X2.js → avatarGroup.component-DkKPpSjz.js} +2 -2
- package/dist/chunks/{avatarGroup.component-DlZ_W4X2.js.map → avatarGroup.component-DkKPpSjz.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-BNz4WUw7.js → buttonGroup.component-C7qKrojm.js} +2 -2
- package/dist/chunks/{buttonGroup.component-BNz4WUw7.js.map → buttonGroup.component-C7qKrojm.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-usIh5lX2.js → buttonGroup.component-D5exJNjD.js} +2 -2
- package/dist/chunks/{buttonGroup.component-usIh5lX2.js.map → buttonGroup.component-D5exJNjD.js.map} +1 -1
- package/dist/chunks/{calendar.component-DVRqqMvE.js → calendar.component-CiZaNBUk.js} +2 -2
- package/dist/chunks/{calendar.component-DVRqqMvE.js.map → calendar.component-CiZaNBUk.js.map} +1 -1
- package/dist/chunks/{calendar.component-D6J2i_cO.js → calendar.component-D4YWcalj.js} +2 -2
- package/dist/chunks/{calendar.component-D6J2i_cO.js.map → calendar.component-D4YWcalj.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-JT-22yfm.js → conversationCard.component-Bey5HuaR.js} +2 -2
- package/dist/chunks/{conversationCard.component-JT-22yfm.js.map → conversationCard.component-Bey5HuaR.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-CHjyfNdi.js → conversationCard.component-C7XCNUme.js} +2 -2
- package/dist/chunks/{conversationCard.component-CHjyfNdi.js.map → conversationCard.component-C7XCNUme.js.map} +1 -1
- package/dist/chunks/{datePicker.component-JPVhk_HN.js → datePicker.component-BVolIuLC.js} +2 -2
- package/dist/chunks/{datePicker.component-JPVhk_HN.js.map → datePicker.component-BVolIuLC.js.map} +1 -1
- package/dist/chunks/{datePicker.component-CMdflzUQ.js → datePicker.component-D1sEVtWA.js} +2 -2
- package/dist/chunks/{datePicker.component-CMdflzUQ.js.map → datePicker.component-D1sEVtWA.js.map} +1 -1
- package/dist/chunks/{datePicker.provider-GATPk0cu.js → datePicker.provider-CrxEuFVx.js} +2 -2
- package/dist/chunks/{datePicker.provider-GATPk0cu.js.map → datePicker.provider-CrxEuFVx.js.map} +1 -1
- package/dist/chunks/{datePicker.provider-B6P-8oYG.js → datePicker.provider-D0UTCm7x.js} +2 -2
- package/dist/chunks/{datePicker.provider-B6P-8oYG.js.map → datePicker.provider-D0UTCm7x.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-Cvabv683.js → dateTimePicker.component-C7yN5puI.js} +2 -2
- package/dist/chunks/{dateTimePicker.component-Cvabv683.js.map → dateTimePicker.component-C7yN5puI.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-DZMiafCE.js → dateTimePicker.component-D34ZBE5S.js} +2 -2
- package/dist/chunks/{dateTimePicker.component-DZMiafCE.js.map → dateTimePicker.component-D34ZBE5S.js.map} +1 -1
- package/dist/chunks/menu.component-CUkHLGzY.js +2 -0
- package/dist/chunks/menu.component-CUkHLGzY.js.map +1 -0
- package/dist/chunks/{menu.component-D_Fd8OGb.js → menu.component-Di6p2OQm.js} +117 -117
- package/dist/chunks/menu.component-Di6p2OQm.js.map +1 -0
- package/dist/chunks/{radioGroup.types-D8hjIwAr.js → radioGroup.types-31031yF0.js} +2 -2
- package/dist/chunks/{radioGroup.types-D8hjIwAr.js.map → radioGroup.types-31031yF0.js.map} +1 -1
- package/dist/chunks/{radioGroup.types-BR_YJiyV.js → radioGroup.types-C9sQfIhO.js} +2 -2
- package/dist/chunks/{radioGroup.types-BR_YJiyV.js.map → radioGroup.types-C9sQfIhO.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-BE1G-gUo.js → tagBlock.component-6EiDFKRU.js} +2 -2
- package/dist/chunks/{tagBlock.component-BE1G-gUo.js.map → tagBlock.component-6EiDFKRU.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-CbqCZu-K.js → tagBlock.component-Ctiv0q_l.js} +2 -2
- package/dist/chunks/{tagBlock.component-CbqCZu-K.js.map → tagBlock.component-Ctiv0q_l.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-DLmcpMoj.js +0 -2
- package/dist/chunks/menu.component-DLmcpMoj.js.map +0 -1
- package/dist/chunks/menu.component-D_Fd8OGb.js.map +0 -1
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import st, { forwardRef as h, useEffect as _, useId as Y, useRef as
|
|
2
|
+
import st, { forwardRef as h, useEffect as _, useId as Y, useRef as de, 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 ge } from "./icon.component-PV_nHBId.js";
|
|
6
6
|
import { W as ee } from "./text.component-CdTyTFds.js";
|
|
7
|
-
import { T as
|
|
7
|
+
import { T as fe } from "./tooltip.component-C_NS-AoH.js";
|
|
8
8
|
import { F as z } from "./flex-CX-8gE9T.js";
|
|
9
9
|
import { W as ct } from "./textInput.component-BC0Hi8R_.js";
|
|
10
10
|
import { S as at } from "./spinner.component-B3dkvoO9.js";
|
|
11
11
|
import { u as it } from "./usePortalContentRef-DO_jc4W9.js";
|
|
12
|
-
import { u as te, s as
|
|
12
|
+
import { u as te, s as Me, c as Pe, d as ve, 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
15
|
import { a as O, d as g, b as $, 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 [
|
|
19
|
+
const [je, m] = O({
|
|
20
20
|
name: "MenuContext",
|
|
21
21
|
hookName: "useMenuContext",
|
|
22
22
|
providerName: "<MenuProvider />",
|
|
23
23
|
strict: !1
|
|
24
|
-
}),
|
|
24
|
+
}), Ce = 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
|
-
|
|
29
|
-
const
|
|
28
|
+
Ce.displayName = "MenuArrow";
|
|
29
|
+
const Ie = 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
|
+
Ie.displayName = "MenuArrowTip";
|
|
34
34
|
const [ne, Zt] = O({
|
|
35
35
|
name: "MenuItemContext",
|
|
36
36
|
hookName: "useMenuItemContext",
|
|
37
37
|
providerName: "<MenuItemProvider />"
|
|
38
|
-
}), [oe,
|
|
38
|
+
}), [oe, be] = O({
|
|
39
39
|
name: "MenuItemPropsContext",
|
|
40
40
|
hookName: "useMenuItemPropsContext",
|
|
41
41
|
providerName: "<MenuItemPropsProvider />"
|
|
42
|
-
}),
|
|
42
|
+
}), ke = h((o, n) => {
|
|
43
43
|
const [t, s] = $()(o, [
|
|
44
44
|
"checked",
|
|
45
45
|
"closeOnSelect",
|
|
@@ -53,23 +53,23 @@ const [ne, Zt] = O({
|
|
|
53
53
|
}, u = m(), a = p(u.getOptionItemProps(c), s), i = u.getOptionItemState(c);
|
|
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
|
-
|
|
57
|
-
const
|
|
56
|
+
ke.displayName = "MenuCheckboxItem";
|
|
57
|
+
const Se = 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
|
-
|
|
62
|
-
const
|
|
61
|
+
Se.displayName = "MenuContent";
|
|
62
|
+
const we = 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
|
-
|
|
67
|
-
const
|
|
66
|
+
we.displayName = "MenuContextTrigger";
|
|
67
|
+
const Ne = 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
|
-
|
|
72
|
-
const
|
|
71
|
+
Ne.displayName = "MenuIndicator";
|
|
72
|
+
const ye = h((o, n) => {
|
|
73
73
|
const [t, s] = $()(o, [
|
|
74
74
|
"closeOnSelect",
|
|
75
75
|
"disabled",
|
|
@@ -79,43 +79,43 @@ const Ne = h((o, n) => {
|
|
|
79
79
|
]), c = m(), u = p(c.getItemProps(t), s), a = c.getItemState(t);
|
|
80
80
|
return _(() => 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
|
-
|
|
83
|
-
const [
|
|
82
|
+
ye.displayName = "MenuItem";
|
|
83
|
+
const [Ae, Te] = O({
|
|
84
84
|
name: "MenuItemGroupContext",
|
|
85
85
|
hookName: "useMenuItemGroupContext",
|
|
86
86
|
providerName: "<MenuItemGroupProvider />"
|
|
87
|
-
}),
|
|
87
|
+
}), Ge = h((o, n) => {
|
|
88
88
|
const [t, s] = $()(o, ["id"]), c = m(), a = { id: Y(), ...t }, i = p(c.getItemGroupProps(a), s);
|
|
89
|
-
return /* @__PURE__ */ e.jsx(
|
|
89
|
+
return /* @__PURE__ */ e.jsx(Ae, { value: a, children: /* @__PURE__ */ e.jsx(g.div, { ...i, ref: n }) });
|
|
90
90
|
});
|
|
91
|
-
|
|
92
|
-
const Ge = h((o, n) => {
|
|
93
|
-
const t = m(), s = Ae(), c = p(t.getItemGroupLabelProps({ htmlFor: s.id }), o);
|
|
94
|
-
return /* @__PURE__ */ e.jsx(g.div, { ...c, ref: n });
|
|
95
|
-
});
|
|
96
|
-
Ge.displayName = "MenuItemGroupLabel";
|
|
91
|
+
Ge.displayName = "MenuItemGroup";
|
|
97
92
|
const _e = h((o, n) => {
|
|
98
|
-
const t = m(), s =
|
|
93
|
+
const t = m(), s = Te(), c = p(t.getItemGroupLabelProps({ htmlFor: s.id }), o);
|
|
99
94
|
return /* @__PURE__ */ e.jsx(g.div, { ...c, ref: n });
|
|
100
95
|
});
|
|
101
|
-
_e.displayName = "
|
|
96
|
+
_e.displayName = "MenuItemGroupLabel";
|
|
102
97
|
const Oe = h((o, n) => {
|
|
103
|
-
const t = m(), s =
|
|
98
|
+
const t = m(), s = be(), c = p(t.getItemIndicatorProps(s), o);
|
|
104
99
|
return /* @__PURE__ */ e.jsx(g.div, { ...c, ref: n });
|
|
105
100
|
});
|
|
106
|
-
Oe.displayName = "
|
|
101
|
+
Oe.displayName = "MenuItemIndicator";
|
|
107
102
|
const $e = h((o, n) => {
|
|
103
|
+
const t = m(), s = be(), c = p(t.getItemTextProps(s), o);
|
|
104
|
+
return /* @__PURE__ */ e.jsx(g.div, { ...c, ref: n });
|
|
105
|
+
});
|
|
106
|
+
$e.displayName = "MenuItemText";
|
|
107
|
+
const Re = 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
|
-
|
|
112
|
-
const
|
|
111
|
+
Re.displayName = "MenuPositioner";
|
|
112
|
+
const Le = h((o, n) => {
|
|
113
113
|
const [t, s] = $()(o, [
|
|
114
114
|
"closeOnSelect",
|
|
115
115
|
"disabled",
|
|
116
116
|
"value",
|
|
117
117
|
"valueText"
|
|
118
|
-
]), c = m(), u =
|
|
118
|
+
]), c = m(), u = Te(), a = {
|
|
119
119
|
...t,
|
|
120
120
|
checked: u.value === t.value,
|
|
121
121
|
type: "radio",
|
|
@@ -123,18 +123,18 @@ const Re = h((o, n) => {
|
|
|
123
123
|
}, i = p(c.getOptionItemProps(a), s), f = c.getOptionItemState(a);
|
|
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
|
-
|
|
127
|
-
const
|
|
126
|
+
Le.displayName = "MenuRadioItem";
|
|
127
|
+
const Be = h((o, n) => {
|
|
128
128
|
const [t, s] = $()(o, [
|
|
129
129
|
"id",
|
|
130
130
|
"onValueChange",
|
|
131
131
|
"value"
|
|
132
132
|
]), c = m(), a = { id: Y(), ...t }, i = p(c.getItemGroupProps({ id: a.id }), s);
|
|
133
|
-
return /* @__PURE__ */ e.jsx(
|
|
133
|
+
return /* @__PURE__ */ e.jsx(Ae, { value: a, children: /* @__PURE__ */ e.jsx(g.div, { ...i, ref: n }) });
|
|
134
134
|
});
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
const n =
|
|
135
|
+
Be.displayName = "MenuRadioItemGroup";
|
|
136
|
+
const ze = (o) => {
|
|
137
|
+
const n = de(o), t = de(!1);
|
|
138
138
|
_(() => {
|
|
139
139
|
n.current = o;
|
|
140
140
|
}), _(() => {
|
|
@@ -148,18 +148,18 @@ const Be = (o) => {
|
|
|
148
148
|
...o
|
|
149
149
|
}, u = ht(ft, c);
|
|
150
150
|
return { api: Mt(u, gt), service: u };
|
|
151
|
-
}, [
|
|
151
|
+
}, [Fe, We] = O({
|
|
152
152
|
name: "MenuMachineContext",
|
|
153
153
|
hookName: "useMenuMachineContext",
|
|
154
154
|
providerName: "<MenuMachineProvider />",
|
|
155
155
|
strict: !1
|
|
156
|
-
}), [
|
|
156
|
+
}), [Ee, jt] = O({
|
|
157
157
|
name: "MenuMachineContext",
|
|
158
158
|
hookName: "useMenuMachineContext",
|
|
159
159
|
providerName: "<MenuMachineProvider />",
|
|
160
160
|
strict: !1
|
|
161
161
|
}), Ct = (o) => {
|
|
162
|
-
const [n, t] =
|
|
162
|
+
const [n, t] = Me(o), [s, c] = $()(t, [
|
|
163
163
|
"anchorPoint",
|
|
164
164
|
"aria-label",
|
|
165
165
|
"closeOnSelect",
|
|
@@ -181,25 +181,25 @@ const Be = (o) => {
|
|
|
181
181
|
"open",
|
|
182
182
|
"positioning",
|
|
183
183
|
"typeahead"
|
|
184
|
-
]), u = m(), a =
|
|
185
|
-
|
|
184
|
+
]), u = m(), a = We(), { api: i, service: f } = vt(s), N = Pe(p({ present: i.open }, n));
|
|
185
|
+
ze(() => {
|
|
186
186
|
a && u && (u.setChild(f), i.setParent(a));
|
|
187
187
|
});
|
|
188
188
|
const y = j(() => u?.getTriggerItemProps(i), [i, u]);
|
|
189
|
-
return /* @__PURE__ */ e.jsx(
|
|
189
|
+
return /* @__PURE__ */ e.jsx(Ee, { value: y, children: /* @__PURE__ */ e.jsx(Fe, { value: f, children: /* @__PURE__ */ e.jsx(je, { value: i, children: /* @__PURE__ */ e.jsx(ve, { value: N, ...c }) }) }) });
|
|
190
190
|
}, It = (o) => {
|
|
191
|
-
const n = m(), t =
|
|
192
|
-
|
|
191
|
+
const n = m(), t = We(), [s, { value: c, children: u }] = Me(o), { api: a, service: i } = c, f = Pe(p({ present: a.open }, s));
|
|
192
|
+
ze(() => {
|
|
193
193
|
t && n && (n.setChild(i), a.setParent(t));
|
|
194
194
|
});
|
|
195
195
|
const N = j(() => n?.getTriggerItemProps(a), [a, n]);
|
|
196
|
-
return /* @__PURE__ */ e.jsx(
|
|
197
|
-
},
|
|
196
|
+
return /* @__PURE__ */ e.jsx(Ee, { value: N, children: /* @__PURE__ */ e.jsx(Fe, { value: i, children: /* @__PURE__ */ e.jsx(je, { value: a, children: /* @__PURE__ */ e.jsx(ve, { value: f, children: u }) }) }) });
|
|
197
|
+
}, De = 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
|
-
|
|
202
|
-
const
|
|
201
|
+
De.displayName = "MenuSeparator";
|
|
202
|
+
const Ve = h((o, n) => {
|
|
203
203
|
const t = m(), s = te(), c = p(
|
|
204
204
|
{
|
|
205
205
|
...t.getTriggerProps(),
|
|
@@ -209,67 +209,67 @@ const De = h((o, n) => {
|
|
|
209
209
|
);
|
|
210
210
|
return /* @__PURE__ */ e.jsx(g.button, { ...c, ref: n });
|
|
211
211
|
});
|
|
212
|
-
|
|
213
|
-
const
|
|
212
|
+
Ve.displayName = "MenuTrigger";
|
|
213
|
+
const He = 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
|
+
He.displayName = "MenuTriggerItem";
|
|
218
218
|
const {
|
|
219
|
-
withRootProvider:
|
|
219
|
+
withRootProvider: Ke,
|
|
220
220
|
withContext: x
|
|
221
221
|
} = lt({ key: "menu" });
|
|
222
|
-
|
|
222
|
+
Ke(
|
|
223
223
|
It
|
|
224
224
|
);
|
|
225
|
-
const bt =
|
|
225
|
+
const bt = Ke(Ct, {
|
|
226
226
|
defaultProps: { lazyMount: !0, unmountOnExit: !0 }
|
|
227
227
|
}), kt = x(
|
|
228
|
-
|
|
228
|
+
Ve,
|
|
229
229
|
"trigger",
|
|
230
230
|
{ forwardAsChild: !0 }
|
|
231
231
|
);
|
|
232
|
-
x(
|
|
232
|
+
x(we, "contextTrigger", { forwardAsChild: !0 });
|
|
233
233
|
const St = x(
|
|
234
|
-
|
|
234
|
+
Re,
|
|
235
235
|
"positioner",
|
|
236
236
|
{ forwardAsChild: !0 }
|
|
237
237
|
);
|
|
238
238
|
x(
|
|
239
|
-
|
|
239
|
+
De,
|
|
240
240
|
"separator",
|
|
241
241
|
{ forwardAsChild: !0 }
|
|
242
242
|
);
|
|
243
243
|
const wt = x(
|
|
244
|
-
|
|
244
|
+
Se,
|
|
245
245
|
"content",
|
|
246
246
|
{ forwardAsChild: !0 }
|
|
247
247
|
), Nt = x(
|
|
248
|
-
|
|
248
|
+
Ie,
|
|
249
249
|
"arrowTip",
|
|
250
250
|
{ forwardAsChild: !0 }
|
|
251
251
|
);
|
|
252
252
|
x(
|
|
253
|
-
|
|
253
|
+
Ce,
|
|
254
254
|
"arrow",
|
|
255
255
|
{ forwardAsChild: !0, defaultProps: { children: /* @__PURE__ */ e.jsx(Nt, {}) } }
|
|
256
256
|
);
|
|
257
257
|
x(
|
|
258
|
-
|
|
258
|
+
Ne,
|
|
259
259
|
"indicator",
|
|
260
260
|
{ forwardAsChild: !0 }
|
|
261
261
|
);
|
|
262
262
|
const yt = x(
|
|
263
|
-
|
|
263
|
+
Ge,
|
|
264
264
|
"itemGroup",
|
|
265
265
|
{ forwardAsChild: !0 }
|
|
266
|
-
), At = x(
|
|
267
|
-
|
|
266
|
+
), At = x(_e, "itemGroupLabel", { forwardAsChild: !0 }), pe = x(
|
|
267
|
+
ye,
|
|
268
268
|
"item",
|
|
269
269
|
{ forwardAsChild: !0 }
|
|
270
|
-
), Tt = x(
|
|
270
|
+
), Tt = x(He, "item", { forwardAsChild: !0 });
|
|
271
271
|
x(
|
|
272
|
-
|
|
272
|
+
$e,
|
|
273
273
|
"itemText",
|
|
274
274
|
{ forwardAsChild: !0 }
|
|
275
275
|
);
|
|
@@ -277,18 +277,18 @@ x(
|
|
|
277
277
|
"kbd",
|
|
278
278
|
"itemCommand"
|
|
279
279
|
);
|
|
280
|
-
x(
|
|
280
|
+
x(Oe, "itemIndicator", {
|
|
281
281
|
forwardAsChild: !0,
|
|
282
282
|
defaultProps: { children: /* @__PURE__ */ e.jsx(dt, { boxSize: "4" }) }
|
|
283
283
|
});
|
|
284
|
-
x(
|
|
285
|
-
x(
|
|
284
|
+
x(ke, "item", { forwardAsChild: !0 });
|
|
285
|
+
x(Be, "itemGroup", { forwardAsChild: !0 });
|
|
286
286
|
x(
|
|
287
|
-
|
|
287
|
+
Le,
|
|
288
288
|
"item",
|
|
289
289
|
{ forwardAsChild: !0 }
|
|
290
290
|
);
|
|
291
|
-
const
|
|
291
|
+
const qe = ({
|
|
292
292
|
hideCaret: o = !1,
|
|
293
293
|
size: n = "md",
|
|
294
294
|
text: t,
|
|
@@ -323,7 +323,7 @@ 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(ge, { name: "chevronDown", size: n === "lg" ? "sm" : "xs" }) })
|
|
327
327
|
]
|
|
328
328
|
}
|
|
329
329
|
), Gt = ({ tooltipProps: o, isMenuOpen: n, ...t }) => {
|
|
@@ -334,7 +334,7 @@ const Ke = ({
|
|
|
334
334
|
}, [n]);
|
|
335
335
|
return _(() => {
|
|
336
336
|
n && c(!1);
|
|
337
|
-
}, [n]), /* @__PURE__ */ e.jsx(
|
|
337
|
+
}, [n]), /* @__PURE__ */ e.jsx(fe, { label: t.text || "", open: s && !n, ...o, children: /* @__PURE__ */ e.jsx(
|
|
338
338
|
T,
|
|
339
339
|
{
|
|
340
340
|
onClick: (i) => {
|
|
@@ -342,7 +342,7 @@ const Ke = ({
|
|
|
342
342
|
},
|
|
343
343
|
onMouseEnter: u,
|
|
344
344
|
onMouseLeave: a,
|
|
345
|
-
children: /* @__PURE__ */ e.jsx(
|
|
345
|
+
children: /* @__PURE__ */ e.jsx(qe, { ...t })
|
|
346
346
|
}
|
|
347
347
|
) });
|
|
348
348
|
}, _t = ({
|
|
@@ -368,7 +368,7 @@ const Ke = ({
|
|
|
368
368
|
lazyMount: I = !0,
|
|
369
369
|
unmountOnExit: V = !0
|
|
370
370
|
} = i;
|
|
371
|
-
return console.log("positionerProps", M), /* @__PURE__ */ e.jsx(
|
|
371
|
+
return console.log("positionerProps inside menu item", 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(ge, { name: "chevronRight", size: "sm" })
|
|
398
398
|
]
|
|
399
399
|
}
|
|
400
400
|
),
|
|
@@ -408,7 +408,7 @@ const Ke = ({
|
|
|
408
408
|
if (c === "checkbox") {
|
|
409
409
|
const { checked: S, value: C, disabled: M, tooltipLabel: A, ...k } = i;
|
|
410
410
|
return /* @__PURE__ */ e.jsxs(
|
|
411
|
-
|
|
411
|
+
pe,
|
|
412
412
|
{
|
|
413
413
|
className: "Menu__Item--Checkbox",
|
|
414
414
|
"data-testid": `${a}-checkbox`,
|
|
@@ -437,7 +437,7 @@ const Ke = ({
|
|
|
437
437
|
if (c === "default") {
|
|
438
438
|
const { selected: S = !1, disabled: C, value: M, tooltipLabel: A, ...k } = i;
|
|
439
439
|
return /* @__PURE__ */ e.jsx(
|
|
440
|
-
|
|
440
|
+
pe,
|
|
441
441
|
{
|
|
442
442
|
className: "Menu__Item--Default",
|
|
443
443
|
"data-testid": `${a}-default`,
|
|
@@ -471,19 +471,19 @@ const Ke = ({
|
|
|
471
471
|
n,
|
|
472
472
|
typeof o == "string" ? /* @__PURE__ */ e.jsx(ee, { size: "sm", truncated: t, variant: s, children: o }) : o
|
|
473
473
|
] });
|
|
474
|
-
return c ? /* @__PURE__ */ e.jsx(
|
|
475
|
-
},
|
|
474
|
+
return c ? /* @__PURE__ */ e.jsx(fe, { label: c, children: u }) : u;
|
|
475
|
+
}, me = ({
|
|
476
476
|
groupName: o,
|
|
477
477
|
hasSelectedItems: n = !1,
|
|
478
478
|
onToggle: t,
|
|
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(
|
|
483
|
-
/* @__PURE__ */ e.jsx(
|
|
484
|
-
/* @__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(he, { hasSelectedItems: n, groupName: o, onToggle: t }) : /* @__PURE__ */ e.jsx(xe, { groupName: o, onToggle: t }) }) : /* @__PURE__ */ e.jsxs(z, { justifyContent: "space-between", children: [
|
|
483
|
+
/* @__PURE__ */ e.jsx(xe, { groupName: o, onToggle: t }),
|
|
484
|
+
/* @__PURE__ */ e.jsx(he, { hasSelectedItems: n, groupName: o, onToggle: t })
|
|
485
485
|
] }) });
|
|
486
|
-
},
|
|
486
|
+
}, xe = ({ groupName: o, onToggle: n }) => /* @__PURE__ */ e.jsx(Z, { variant: "ghost", size: "xs", onClick: () => n({ groupName: o, clear: !1 }), children: "Select All" }), he = ({ hasSelectedItems: o, groupName: n, onToggle: t }) => /* @__PURE__ */ e.jsx(
|
|
487
487
|
Z,
|
|
488
488
|
{
|
|
489
489
|
variant: "ghostNeutral",
|
|
@@ -517,12 +517,12 @@ const Ke = ({
|
|
|
517
517
|
onSelect: H,
|
|
518
518
|
onSelectAll: re,
|
|
519
519
|
searchable: K,
|
|
520
|
-
searchPlaceholder:
|
|
521
|
-
shouldTruncateText:
|
|
520
|
+
searchPlaceholder: Je = "Search...",
|
|
521
|
+
shouldTruncateText: Qe,
|
|
522
522
|
...se
|
|
523
|
-
} = n || {}, [
|
|
523
|
+
} = n || {}, [Ue, Xe] = B(!1), [q, J] = B(""), [F, Q] = B(I);
|
|
524
524
|
_(() => {
|
|
525
|
-
console.log("positionerProps", t);
|
|
525
|
+
console.log("positionerProps at root menu level", t);
|
|
526
526
|
}, [t]);
|
|
527
527
|
const ce = D(() => {
|
|
528
528
|
const r = {};
|
|
@@ -554,7 +554,7 @@ const Ke = ({
|
|
|
554
554
|
re?.({ allSelectedItems: d });
|
|
555
555
|
},
|
|
556
556
|
[re, F, b]
|
|
557
|
-
),
|
|
557
|
+
), Ye = j(
|
|
558
558
|
(r) => {
|
|
559
559
|
if (r.type === "checkbox") {
|
|
560
560
|
const l = U(r.value) ? b.filter((d) => d.value !== r.value) : [...b, r];
|
|
@@ -572,19 +572,19 @@ const Ke = ({
|
|
|
572
572
|
H?.({ item: r, allSelectedItems: [r] });
|
|
573
573
|
},
|
|
574
574
|
[H, U, b]
|
|
575
|
-
), ue = j((r, l) => r === "" || !r ? l : l.filter((d) => !!(typeof d.label == "string" ? d.label : d.valueText)?.toLowerCase().includes(r.toLowerCase())), []),
|
|
575
|
+
), ue = j((r, l) => r === "" || !r ? l : l.filter((d) => !!(typeof d.label == "string" ? d.label : d.valueText)?.toLowerCase().includes(r.toLowerCase())), []), Ze = j(
|
|
576
576
|
(r) => {
|
|
577
577
|
const l = r.target.value;
|
|
578
578
|
J(l), w && w(r);
|
|
579
579
|
},
|
|
580
580
|
[w]
|
|
581
|
-
),
|
|
581
|
+
), et = j(() => {
|
|
582
582
|
J(""), w && w({
|
|
583
583
|
target: { value: "" }
|
|
584
584
|
});
|
|
585
|
-
}, [w]),
|
|
585
|
+
}, [w]), tt = j(
|
|
586
586
|
(r) => {
|
|
587
|
-
|
|
587
|
+
Xe(r), r || (J(""), Q(I)), a && a({ open: r, allSelectedItems: b });
|
|
588
588
|
},
|
|
589
589
|
[I, a, b]
|
|
590
590
|
);
|
|
@@ -596,11 +596,11 @@ const Ke = ({
|
|
|
596
596
|
lazyMount: u,
|
|
597
597
|
unmountOnExit: u,
|
|
598
598
|
onOpenChange: (r) => {
|
|
599
|
-
|
|
599
|
+
tt(r.open);
|
|
600
600
|
},
|
|
601
601
|
...f,
|
|
602
602
|
children: [
|
|
603
|
-
c || /* @__PURE__ */ e.jsx(kt, { asChild: !0, className: "Menu__Trigger", "data-testid": `${i}-trigger`, children: o?.showTooltip ? /* @__PURE__ */ e.jsx(Gt, { isMenuOpen:
|
|
603
|
+
c || /* @__PURE__ */ e.jsx(kt, { asChild: !0, className: "Menu__Trigger", "data-testid": `${i}-trigger`, children: o?.showTooltip ? /* @__PURE__ */ e.jsx(Gt, { isMenuOpen: Ue, ...o }) : /* @__PURE__ */ e.jsx(qe, { ...o }) }),
|
|
604
604
|
/* @__PURE__ */ e.jsx(ut, { disabled: !s, container: N || void 0, children: /* @__PURE__ */ e.jsx(St, { className: "Menu", "data-testid": i, ...t, children: /* @__PURE__ */ e.jsxs(
|
|
605
605
|
wt,
|
|
606
606
|
{
|
|
@@ -630,12 +630,12 @@ const Ke = ({
|
|
|
630
630
|
{
|
|
631
631
|
className: "Menu__SearchBar",
|
|
632
632
|
"data-testid": `${i}-search-bar`,
|
|
633
|
-
placeholder:
|
|
634
|
-
onChange:
|
|
633
|
+
placeholder: Je,
|
|
634
|
+
onChange: Ze,
|
|
635
635
|
size: "sm",
|
|
636
636
|
value: q,
|
|
637
637
|
clearable: !0,
|
|
638
|
-
onClear:
|
|
638
|
+
onClear: et,
|
|
639
639
|
onKeyDown: (r) => {
|
|
640
640
|
r.code === "Space" && r.stopPropagation();
|
|
641
641
|
}
|
|
@@ -651,7 +651,7 @@ const Ke = ({
|
|
|
651
651
|
px: 3,
|
|
652
652
|
mt: K ? 1 : 2,
|
|
653
653
|
children: y && !!R.length && /* @__PURE__ */ e.jsx(
|
|
654
|
-
|
|
654
|
+
me,
|
|
655
655
|
{
|
|
656
656
|
onToggle: ie,
|
|
657
657
|
hasSelectedItems: !!b.length
|
|
@@ -661,39 +661,39 @@ const Ke = ({
|
|
|
661
661
|
),
|
|
662
662
|
A && /* @__PURE__ */ e.jsx(z, { justifyContent: "center", py: 5, children: /* @__PURE__ */ e.jsx(at, { fullScreen: !0 }) }),
|
|
663
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]) => {
|
|
664
|
-
const d = r === "default", P = Object.keys(l), v = d ? st.Fragment : yt,
|
|
664
|
+
const d = r === "default", P = Object.keys(l), v = d ? st.Fragment : yt, nt = l.checkbox?.map((L) => L.value)?.some(
|
|
665
665
|
(L) => b.some((E) => E.value === L && E.checked)
|
|
666
666
|
);
|
|
667
667
|
return /* @__PURE__ */ e.jsxs(v, { children: [
|
|
668
668
|
!d && /* @__PURE__ */ e.jsx(At, { children: /* @__PURE__ */ e.jsxs(z, { alignItems: "center", justifyContent: "space-between", children: [
|
|
669
669
|
r,
|
|
670
670
|
S && P.includes("checkbox") && /* @__PURE__ */ e.jsx(
|
|
671
|
-
|
|
671
|
+
me,
|
|
672
672
|
{
|
|
673
673
|
groupName: r,
|
|
674
674
|
onToggle: ie,
|
|
675
|
-
hasSelectedItems:
|
|
675
|
+
hasSelectedItems: nt
|
|
676
676
|
}
|
|
677
677
|
)
|
|
678
678
|
] }) }),
|
|
679
679
|
Object.entries(l).map(
|
|
680
|
-
([L, E]) => E.map((G,
|
|
681
|
-
const { groupLabel:
|
|
682
|
-
return /* @__PURE__ */ e.jsx(
|
|
680
|
+
([L, E]) => E.map((G, ot) => {
|
|
681
|
+
const { groupLabel: rt, ...le } = G;
|
|
682
|
+
return console.log("item props", le), console.log("positionerProps inside menu item", t), /* @__PURE__ */ e.jsx(
|
|
683
683
|
_t,
|
|
684
684
|
{
|
|
685
|
-
...
|
|
686
|
-
shouldTruncateText:
|
|
685
|
+
...le,
|
|
686
|
+
shouldTruncateText: Qe,
|
|
687
687
|
...G.type === "checkbox" && {
|
|
688
688
|
checked: U(G.value)
|
|
689
689
|
},
|
|
690
690
|
"data-testid": `${i}-item-${G.label}`,
|
|
691
|
-
onSelect: () =>
|
|
691
|
+
onSelect: () => Ye(G),
|
|
692
692
|
...G.type === "submenu" && {
|
|
693
693
|
positionerProps: t
|
|
694
694
|
}
|
|
695
695
|
},
|
|
696
|
-
`menu-item-${
|
|
696
|
+
`menu-item-${rt}-${L}-${ot}`
|
|
697
697
|
);
|
|
698
698
|
})
|
|
699
699
|
)
|
|
@@ -709,4 +709,4 @@ const Ke = ({
|
|
|
709
709
|
export {
|
|
710
710
|
Ot as M
|
|
711
711
|
};
|
|
712
|
-
//# sourceMappingURL=menu.component-
|
|
712
|
+
//# sourceMappingURL=menu.component-Di6p2OQm.js.map
|