@televet/kibble-ui 5.0.2-beta.menu.2 → 5.0.2-beta.menu.4
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-BFUSjNmk.js → avatarGroup.component-BsSYSCvd.js} +2 -2
- package/dist/chunks/{avatarGroup.component-BFUSjNmk.js.map → avatarGroup.component-BsSYSCvd.js.map} +1 -1
- package/dist/chunks/{avatarGroup.component-DA9oxHzN.js → avatarGroup.component-DlZ_W4X2.js} +2 -2
- package/dist/chunks/{avatarGroup.component-DA9oxHzN.js.map → avatarGroup.component-DlZ_W4X2.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-C9E7CNtN.js → buttonGroup.component-BNz4WUw7.js} +2 -2
- package/dist/chunks/{buttonGroup.component-C9E7CNtN.js.map → buttonGroup.component-BNz4WUw7.js.map} +1 -1
- package/dist/chunks/{buttonGroup.component-Dx5Up1b3.js → buttonGroup.component-usIh5lX2.js} +2 -2
- package/dist/chunks/{buttonGroup.component-Dx5Up1b3.js.map → buttonGroup.component-usIh5lX2.js.map} +1 -1
- package/dist/chunks/{calendar.component-BpTI3X-F.js → calendar.component-D6J2i_cO.js} +2 -2
- package/dist/chunks/{calendar.component-BpTI3X-F.js.map → calendar.component-D6J2i_cO.js.map} +1 -1
- package/dist/chunks/{calendar.component-eEgkPzrv.js → calendar.component-DVRqqMvE.js} +2 -2
- package/dist/chunks/{calendar.component-eEgkPzrv.js.map → calendar.component-DVRqqMvE.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-DXJP2DXs.js → conversationCard.component-CHjyfNdi.js} +2 -2
- package/dist/chunks/{conversationCard.component-DXJP2DXs.js.map → conversationCard.component-CHjyfNdi.js.map} +1 -1
- package/dist/chunks/{conversationCard.component-Bzlz30CE.js → conversationCard.component-JT-22yfm.js} +2 -2
- package/dist/chunks/{conversationCard.component-Bzlz30CE.js.map → conversationCard.component-JT-22yfm.js.map} +1 -1
- package/dist/chunks/{datePicker.component-DN8FZf1_.js → datePicker.component-CMdflzUQ.js} +2 -2
- package/dist/chunks/{datePicker.component-DN8FZf1_.js.map → datePicker.component-CMdflzUQ.js.map} +1 -1
- package/dist/chunks/{datePicker.component-cDWhkkZq.js → datePicker.component-JPVhk_HN.js} +2 -2
- package/dist/chunks/{datePicker.component-cDWhkkZq.js.map → datePicker.component-JPVhk_HN.js.map} +1 -1
- package/dist/chunks/{datePicker.provider-BiABe0BU.js → datePicker.provider-B6P-8oYG.js} +2 -2
- package/dist/chunks/{datePicker.provider-BiABe0BU.js.map → datePicker.provider-B6P-8oYG.js.map} +1 -1
- package/dist/chunks/{datePicker.provider-ZStG7Yw_.js → datePicker.provider-GATPk0cu.js} +2 -2
- package/dist/chunks/{datePicker.provider-ZStG7Yw_.js.map → datePicker.provider-GATPk0cu.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-CBWcOxGE.js → dateTimePicker.component-Cvabv683.js} +2 -2
- package/dist/chunks/{dateTimePicker.component-CBWcOxGE.js.map → dateTimePicker.component-Cvabv683.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-53T6FuCE.js → dateTimePicker.component-DZMiafCE.js} +2 -2
- package/dist/chunks/{dateTimePicker.component-53T6FuCE.js.map → dateTimePicker.component-DZMiafCE.js.map} +1 -1
- package/dist/chunks/menu.component-DLmcpMoj.js +2 -0
- package/dist/chunks/{menu.component-CateT8pX.js.map → menu.component-DLmcpMoj.js.map} +1 -1
- package/dist/chunks/{menu.component-CFt2LRsh.js → menu.component-D_Fd8OGb.js} +44 -37
- package/dist/chunks/{menu.component-CFt2LRsh.js.map → menu.component-D_Fd8OGb.js.map} +1 -1
- package/dist/chunks/{radioGroup.types-CqismOCU.js → radioGroup.types-BR_YJiyV.js} +2 -2
- package/dist/chunks/{radioGroup.types-CqismOCU.js.map → radioGroup.types-BR_YJiyV.js.map} +1 -1
- package/dist/chunks/{radioGroup.types-BB6dxsci.js → radioGroup.types-D8hjIwAr.js} +2 -2
- package/dist/chunks/{radioGroup.types-BB6dxsci.js.map → radioGroup.types-D8hjIwAr.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-DzX3dRdg.js → tagBlock.component-BE1G-gUo.js} +2 -2
- package/dist/chunks/{tagBlock.component-DzX3dRdg.js.map → tagBlock.component-BE1G-gUo.js.map} +1 -1
- package/dist/chunks/{tagBlock.component-D1FgHMkq.js → tagBlock.component-CbqCZu-K.js} +2 -2
- package/dist/chunks/{tagBlock.component-D1FgHMkq.js.map → tagBlock.component-CbqCZu-K.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-CateT8pX.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import st, { forwardRef as h, useEffect as
|
|
2
|
+
import st, { forwardRef as h, useEffect as _, 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
5
|
import { I as he } from "./icon.component-PV_nHBId.js";
|
|
@@ -12,11 +12,11 @@ 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 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 [ve, m] =
|
|
19
|
+
const [ve, m] = O({
|
|
20
20
|
name: "MenuContext",
|
|
21
21
|
hookName: "useMenuContext",
|
|
22
22
|
providerName: "<MenuProvider />",
|
|
@@ -31,16 +31,16 @@ const Ce = h((o, n) => {
|
|
|
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] = O({
|
|
35
35
|
name: "MenuItemContext",
|
|
36
36
|
hookName: "useMenuItemContext",
|
|
37
37
|
providerName: "<MenuItemProvider />"
|
|
38
|
-
}), [oe, Ie] =
|
|
38
|
+
}), [oe, Ie] = O({
|
|
39
39
|
name: "MenuItemPropsContext",
|
|
40
40
|
hookName: "useMenuItemPropsContext",
|
|
41
41
|
providerName: "<MenuItemPropsProvider />"
|
|
42
42
|
}), be = h((o, n) => {
|
|
43
|
-
const [t, s] =
|
|
43
|
+
const [t, s] = $()(o, [
|
|
44
44
|
"checked",
|
|
45
45
|
"closeOnSelect",
|
|
46
46
|
"disabled",
|
|
@@ -70,22 +70,22 @@ const we = h((o, n) => {
|
|
|
70
70
|
});
|
|
71
71
|
we.displayName = "MenuIndicator";
|
|
72
72
|
const Ne = h((o, n) => {
|
|
73
|
-
const [t, s] =
|
|
73
|
+
const [t, s] = $()(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 _(() => 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] = O({
|
|
84
84
|
name: "MenuItemGroupContext",
|
|
85
85
|
hookName: "useMenuItemGroupContext",
|
|
86
86
|
providerName: "<MenuItemGroupProvider />"
|
|
87
87
|
}), Te = h((o, n) => {
|
|
88
|
-
const [t, s] =
|
|
88
|
+
const [t, s] = $()(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";
|
|
@@ -110,7 +110,7 @@ const $e = h((o, n) => {
|
|
|
110
110
|
});
|
|
111
111
|
$e.displayName = "MenuPositioner";
|
|
112
112
|
const Re = h((o, n) => {
|
|
113
|
-
const [t, s] =
|
|
113
|
+
const [t, s] = $()(o, [
|
|
114
114
|
"closeOnSelect",
|
|
115
115
|
"disabled",
|
|
116
116
|
"value",
|
|
@@ -125,7 +125,7 @@ const Re = h((o, n) => {
|
|
|
125
125
|
});
|
|
126
126
|
Re.displayName = "MenuRadioItem";
|
|
127
127
|
const Le = h((o, n) => {
|
|
128
|
-
const [t, s] =
|
|
128
|
+
const [t, s] = $()(o, [
|
|
129
129
|
"id",
|
|
130
130
|
"onValueChange",
|
|
131
131
|
"value"
|
|
@@ -135,9 +135,9 @@ const Le = h((o, n) => {
|
|
|
135
135
|
Le.displayName = "MenuRadioItemGroup";
|
|
136
136
|
const Be = (o) => {
|
|
137
137
|
const n = le(o), t = le(!1);
|
|
138
|
-
|
|
138
|
+
_(() => {
|
|
139
139
|
n.current = o;
|
|
140
|
-
}),
|
|
140
|
+
}), _(() => {
|
|
141
141
|
t.current !== !0 && (t.current = !0, n.current());
|
|
142
142
|
}, []);
|
|
143
143
|
}, vt = (o) => {
|
|
@@ -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
|
-
}, [ze, Fe] =
|
|
151
|
+
}, [ze, Fe] = O({
|
|
152
152
|
name: "MenuMachineContext",
|
|
153
153
|
hookName: "useMenuMachineContext",
|
|
154
154
|
providerName: "<MenuMachineProvider />",
|
|
155
155
|
strict: !1
|
|
156
|
-
}), [We, jt] =
|
|
156
|
+
}), [We, 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] = fe(o), [s, c] =
|
|
162
|
+
const [n, t] = fe(o), [s, c] = $()(t, [
|
|
163
163
|
"anchorPoint",
|
|
164
164
|
"aria-label",
|
|
165
165
|
"closeOnSelect",
|
|
@@ -327,12 +327,12 @@ const Ke = ({
|
|
|
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 _(() => {
|
|
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") {
|
|
@@ -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
|
+
_(() => {
|
|
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]), R = D(() => I?.filter((r) => r.type === "checkbox") || [], [I]), U = j(
|
|
540
|
+
(r) => R.some((l) => l.value === r && l.checked),
|
|
541
|
+
[R]
|
|
542
|
+
), b = D(() => R.filter((r) => r.checked), [R]), ie = j(
|
|
539
543
|
({ groupName: r, clear: l }) => {
|
|
540
544
|
let d;
|
|
541
545
|
const P = F.filter((v) => v.type === "checkbox" && !v.disabled);
|
|
@@ -584,7 +588,7 @@ const Ke = ({
|
|
|
584
588
|
},
|
|
585
589
|
[I, a, b]
|
|
586
590
|
);
|
|
587
|
-
return
|
|
591
|
+
return _(() => {
|
|
588
592
|
Q(w ? I : ue(q, I));
|
|
589
593
|
}, [q, w, ue, I]), /* @__PURE__ */ e.jsxs(
|
|
590
594
|
bt,
|
|
@@ -646,7 +650,7 @@ const Ke = ({
|
|
|
646
650
|
"data-testid": `${i}-checkbox-group-header`,
|
|
647
651
|
px: 3,
|
|
648
652
|
mt: K ? 1 : 2,
|
|
649
|
-
children: y && !!
|
|
653
|
+
children: y && !!R.length && /* @__PURE__ */ e.jsx(
|
|
650
654
|
pe,
|
|
651
655
|
{
|
|
652
656
|
onToggle: ie,
|
|
@@ -657,8 +661,8 @@ const Ke = ({
|
|
|
657
661
|
),
|
|
658
662
|
A && /* @__PURE__ */ e.jsx(z, { justifyContent: "center", py: 5, children: /* @__PURE__ */ e.jsx(at, { fullScreen: !0 }) }),
|
|
659
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]) => {
|
|
660
|
-
const d = r === "default", P = Object.keys(l), v = d ? st.Fragment : yt, tt = l.checkbox?.map((
|
|
661
|
-
(
|
|
664
|
+
const d = r === "default", P = Object.keys(l), v = d ? st.Fragment : yt, tt = l.checkbox?.map((L) => L.value)?.some(
|
|
665
|
+
(L) => b.some((E) => E.value === L && E.checked)
|
|
662
666
|
);
|
|
663
667
|
return /* @__PURE__ */ e.jsxs(v, { children: [
|
|
664
668
|
!d && /* @__PURE__ */ e.jsx(At, { children: /* @__PURE__ */ e.jsxs(z, { alignItems: "center", justifyContent: "space-between", children: [
|
|
@@ -673,20 +677,23 @@ const Ke = ({
|
|
|
673
677
|
)
|
|
674
678
|
] }) }),
|
|
675
679
|
Object.entries(l).map(
|
|
676
|
-
([
|
|
677
|
-
const { groupLabel: ot, ...rt } =
|
|
680
|
+
([L, E]) => E.map((G, nt) => {
|
|
681
|
+
const { groupLabel: ot, ...rt } = G;
|
|
678
682
|
return /* @__PURE__ */ e.jsx(
|
|
679
683
|
_t,
|
|
680
684
|
{
|
|
681
685
|
...rt,
|
|
682
686
|
shouldTruncateText: Je,
|
|
683
|
-
...
|
|
684
|
-
checked: U(
|
|
687
|
+
...G.type === "checkbox" && {
|
|
688
|
+
checked: U(G.value)
|
|
685
689
|
},
|
|
686
|
-
"data-testid": `${i}-item-${
|
|
687
|
-
onSelect: () => Xe(
|
|
690
|
+
"data-testid": `${i}-item-${G.label}`,
|
|
691
|
+
onSelect: () => Xe(G),
|
|
692
|
+
...G.type === "submenu" && {
|
|
693
|
+
positionerProps: t
|
|
694
|
+
}
|
|
688
695
|
},
|
|
689
|
-
`menu-item-${ot}-${
|
|
696
|
+
`menu-item-${ot}-${L}-${nt}`
|
|
690
697
|
);
|
|
691
698
|
})
|
|
692
699
|
)
|
|
@@ -702,4 +709,4 @@ const Ke = ({
|
|
|
702
709
|
export {
|
|
703
710
|
Ot as M
|
|
704
711
|
};
|
|
705
|
-
//# sourceMappingURL=menu.component-
|
|
712
|
+
//# sourceMappingURL=menu.component-D_Fd8OGb.js.map
|