@jfrader/ui 0.2.0 → 0.4.0
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/accordion-Bd-j04hW.js +198 -0
- package/dist/accordion.js +1 -1
- package/dist/alert-BBqaKI4k.js +135 -0
- package/dist/alert.js +1 -1
- package/dist/avatar-BahDVO9t.js +132 -0
- package/dist/avatar.js +1 -1
- package/dist/badge-B_sLygxU.js +108 -0
- package/dist/badge.js +1 -1
- package/dist/breadcrumbs-DVAOxfvL.js +141 -0
- package/dist/breadcrumbs.js +1 -1
- package/dist/button-P2e7_44z.js +200 -0
- package/dist/button.js +1 -1
- package/dist/calendar-C9Yad_-w.js +394 -0
- package/dist/calendar.js +1 -1
- package/dist/card-D-aI2QHx.js +158 -0
- package/dist/card.js +1 -1
- package/dist/checkbox-COYG6L7d.js +140 -0
- package/dist/checkbox.js +1 -1
- package/dist/{choice-control-ByFogYcT.js → choice-control-5kJkLXgv.js} +1 -1
- package/dist/{collection-registry-1l9f3XJZ.js → collection-registry-BTYi6zGh.js} +1 -1
- package/dist/combobox-DiMC2g_u.js +327 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-V_2pEay7.js +379 -0
- package/dist/command-palette.js +1 -1
- package/dist/container-BOaSptJa.js +41 -0
- package/dist/container.js +1 -1
- package/dist/date-picker-C29Uo4Tx.js +250 -0
- package/dist/date-picker.js +1 -1
- package/dist/dialog-xaydbXl2.js +218 -0
- package/dist/dialog.js +1 -1
- package/dist/divider-DYoJf0I_.js +84 -0
- package/dist/divider.js +1 -1
- package/dist/field-anatomy-D2ToMeRa.js +109 -0
- package/dist/flex-Dh-_J5-U.js +28 -0
- package/dist/flex.js +1 -1
- package/dist/{icon-wrapper-CFWzew5m.js → icon-wrapper-stN8sD7R.js} +1 -1
- package/dist/index.js +38 -37
- package/dist/kbd-C3ACoMoE.js +71 -0
- package/dist/kbd.js +1 -1
- package/dist/{layout-style-7ZTOiWGR.js → layout-style-Cbd1Vilw.js} +1 -1
- package/dist/{loading-ring-BpdB0aFi.js → loading-ring-B8-30Dl1.js} +1 -1
- package/dist/menu-CGPTNRnF.js +216 -0
- package/dist/menu.js +1 -1
- package/dist/navigation-DhnKriOp.js +197 -0
- package/dist/navigation.js +1 -1
- package/dist/pagination-DYdwsxwe.js +156 -0
- package/dist/pagination.js +1 -1
- package/dist/pill-DO2gHzMb.js +56 -0
- package/dist/pill.js +1 -1
- package/dist/popover-CdRXjQqI.js +113 -0
- package/dist/popover.js +1 -1
- package/dist/progress-BpJswTG4.js +90 -0
- package/dist/progress.js +1 -1
- package/dist/radio-group-Ce0_IWQr.js +145 -0
- package/dist/radio-group.js +1 -1
- package/dist/select-BgG7WgSh.js +286 -0
- package/dist/select.js +1 -1
- package/dist/skeleton-OoFlOEXO.js +54 -0
- package/dist/skeleton.js +1 -1
- package/dist/spinner-C2YDoiMn.js +56 -0
- package/dist/spinner.js +1 -1
- package/dist/stack-DC3IbtWk.js +27 -0
- package/dist/stack.js +1 -1
- package/dist/switch-Dr-qjmT4.js +142 -0
- package/dist/switch.js +1 -1
- package/dist/sx-Dx9JUKp5.js +23 -0
- package/dist/tabs-CK_g1RKa.js +203 -0
- package/dist/tabs.js +1 -1
- package/dist/{text-field-8PQAqRpM.js → text-field-D60ok14S.js} +19 -18
- package/dist/text-field.js +1 -1
- package/dist/{textarea-CcGWuntL.js → textarea-DyfjtP0A.js} +19 -18
- package/dist/textarea.js +1 -1
- package/dist/theme-root-BbTBuLMQ.js +46 -0
- package/dist/theme-root.js +1 -1
- package/dist/theme-scope-t7nAKc2c.js +27 -0
- package/dist/toast-CjmELMZZ.js +283 -0
- package/dist/toast.js +1 -1
- package/dist/toggle-group-CI0e7hFm.js +166 -0
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-CaL3rKbV.js +108 -0
- package/dist/tooltip.js +1 -1
- package/dist/{trigger-style-B1GFmH7M.js → trigger-style-B1KVC8O1.js} +1 -1
- package/dist/types/components/accordion/accordion.d.ts +9 -8
- package/dist/types/components/alert/alert.d.ts +3 -2
- package/dist/types/components/avatar/avatar.d.ts +3 -2
- package/dist/types/components/badge/badge.d.ts +3 -2
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +5 -4
- package/dist/types/components/button/button.d.ts +3 -2
- package/dist/types/components/calendar/calendar.d.ts +7 -6
- package/dist/types/components/card/card.d.ts +13 -12
- package/dist/types/components/checkbox/checkbox.d.ts +3 -2
- package/dist/types/components/combobox/combobox.d.ts +8 -7
- package/dist/types/components/command-palette/command-palette.d.ts +15 -14
- package/dist/types/components/container/container.d.ts +3 -2
- package/dist/types/components/date-picker/date-picker.d.ts +3 -2
- package/dist/types/components/dialog/dialog.d.ts +11 -10
- package/dist/types/components/divider/divider.d.ts +3 -2
- package/dist/types/components/field/field-anatomy.d.ts +3 -2
- package/dist/types/components/flex/flex.d.ts +3 -2
- package/dist/types/components/kbd/kbd.d.ts +5 -4
- package/dist/types/components/menu/menu.d.ts +9 -8
- package/dist/types/components/navigation/navigation.d.ts +7 -6
- package/dist/types/components/pagination/pagination.d.ts +3 -2
- package/dist/types/components/pill/pill.d.ts +3 -2
- package/dist/types/components/popover/popover.d.ts +5 -4
- package/dist/types/components/progress/progress.d.ts +3 -2
- package/dist/types/components/radio-group/radio-group.d.ts +5 -4
- package/dist/types/components/select/select.d.ts +9 -8
- package/dist/types/components/skeleton/skeleton.d.ts +3 -2
- package/dist/types/components/spinner/spinner.d.ts +3 -2
- package/dist/types/components/stack/stack.d.ts +1 -1
- package/dist/types/components/switch/switch.d.ts +3 -2
- package/dist/types/components/tabs/tabs.d.ts +9 -8
- package/dist/types/components/text-field/text-field.d.ts +3 -2
- package/dist/types/components/textarea/textarea.d.ts +3 -2
- package/dist/types/components/theme-provider/theme-provider.d.ts +11 -0
- package/dist/types/components/theme-root/theme-root.d.ts +11 -4
- package/dist/types/components/toast/toast.d.ts +3 -2
- package/dist/types/components/toggle-group/toggle-group.d.ts +5 -4
- package/dist/types/components/tooltip/tooltip.d.ts +5 -4
- package/dist/types/index.d.ts +4 -0
- package/dist/types/overlay/overlay-portal.d.ts +7 -0
- package/dist/types/styling/css.d.ts +3 -2
- package/dist/types/styling/styled.d.ts +1 -0
- package/dist/types/styling/sx.d.ts +16 -0
- package/dist/types/styling/theme-scope.d.ts +19 -0
- package/dist/types/styling/theme.d.ts +98 -0
- package/dist/use-overlay-floating-Bit-f0FU.js +31 -0
- package/dist/{visually-hidden-DCWhf0Cb.js → visually-hidden-BJdvqqvn.js} +1 -1
- package/package.json +3 -2
- package/dist/accordion-CkOZ-tvs.js +0 -178
- package/dist/alert-Dsjx14UW.js +0 -131
- package/dist/avatar-BRGKkoSr.js +0 -127
- package/dist/badge-DLxUMsCx.js +0 -104
- package/dist/breadcrumbs-694hF_hm.js +0 -131
- package/dist/button-CoaIcykB.js +0 -190
- package/dist/calendar-Doj7PTdG.js +0 -379
- package/dist/card-2IM71XZj.js +0 -134
- package/dist/checkbox-B7xGNFzp.js +0 -136
- package/dist/combobox-Bjhxv5U3.js +0 -311
- package/dist/command-palette-BhJwm6cS.js +0 -344
- package/dist/container-BhnrGPu-.js +0 -36
- package/dist/css-Cgj6sCHn.js +0 -2
- package/dist/date-picker-Jk8SpoiO.js +0 -245
- package/dist/dialog-fhS07G41.js +0 -187
- package/dist/divider-v_78HYF5.js +0 -79
- package/dist/field-anatomy-BzGw1Ch9.js +0 -105
- package/dist/flex-COZzFqI8.js +0 -22
- package/dist/kbd-CeP8Kfvp.js +0 -61
- package/dist/menu-B6KCbLCr.js +0 -196
- package/dist/navigation-BDht6S2-.js +0 -182
- package/dist/pagination-B50PCaDU.js +0 -151
- package/dist/pill-2_XzBdkD.js +0 -51
- package/dist/popover-DRHbeIVq.js +0 -103
- package/dist/progress-CpsskKTD.js +0 -85
- package/dist/radio-group-DPI5KUCj.js +0 -136
- package/dist/select-C1xGrOhT.js +0 -266
- package/dist/skeleton-DitdP-yz.js +0 -49
- package/dist/spinner-CFq5HPoo.js +0 -51
- package/dist/stack-D_g6NJzo.js +0 -21
- package/dist/switch-B5TTU-oJ.js +0 -138
- package/dist/tabs-C26PWl2c.js +0 -183
- package/dist/theme-root-BRLIA4eb.js +0 -22
- package/dist/toast-B1PXuwZ4.js +0 -277
- package/dist/toggle-group-N_owicT0.js +0 -156
- package/dist/tooltip-BJPisf60.js +0 -98
- package/dist/use-overlay-floating-efeqppiw.js +0 -19
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { r as e } from "./sx-Dx9JUKp5.js";
|
|
3
3
|
import { t } from "./part-id-D0zksy32.js";
|
|
4
4
|
import { useCallback as n, useLayoutEffect as r, useMemo as i, useState as a } from "react";
|
|
5
5
|
import { vars as o } from "@jfrader/tokens/vars";
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n, t as r } from "./use-controlled-state-CVXDa-qM.js";
|
|
4
|
+
import { t as i } from "./renderable-DzcIj1Lo.js";
|
|
5
|
+
import { a, c as o, d as s, f as c, l, o as u, r as d, s as f, t as p, u as m } from "./collection-registry-BTYi6zGh.js";
|
|
6
|
+
import { n as h, t as g } from "./use-overlay-floating-Bit-f0FU.js";
|
|
7
|
+
import { t as _ } from "./text-field-D60ok14S.js";
|
|
8
|
+
import { createContext as v, useCallback as y, useContext as b, useId as x, useLayoutEffect as S, useMemo as C, useRef as w, useState as T } from "react";
|
|
9
|
+
import { vars as E } from "@jfrader/tokens/vars";
|
|
10
|
+
import { jsx as D, jsxs as O } from "@emotion/react/jsx-runtime";
|
|
11
|
+
import { FloatingList as k, useDismiss as ee, useInteractions as A, useListNavigation as j, useMergeRefs as M } from "@floating-ui/react";
|
|
12
|
+
//#region src/components/combobox/combobox.tsx
|
|
13
|
+
var N = "bottom-start", P = "✓", F = "No results", te = (e, t) => e.toLocaleLowerCase().includes(t.toLocaleLowerCase()), I = v(null), L = v(!1);
|
|
14
|
+
function R(e) {
|
|
15
|
+
let t = b(I);
|
|
16
|
+
if (!t) throw Error(`Combobox.${e} must be rendered inside <Combobox>.`);
|
|
17
|
+
return t;
|
|
18
|
+
}
|
|
19
|
+
function z(e) {
|
|
20
|
+
let t = R(e);
|
|
21
|
+
if (!b(L)) throw Error(`Combobox.${e} must be rendered inside <Combobox.List>.`);
|
|
22
|
+
return t;
|
|
23
|
+
}
|
|
24
|
+
var B = e({ "&[hidden]": { display: "none" } }), ne = e({
|
|
25
|
+
paddingBlock: E.space[1],
|
|
26
|
+
paddingInline: E.space[2],
|
|
27
|
+
fontSize: E.textSize.sm,
|
|
28
|
+
color: E.color.textMuted
|
|
29
|
+
});
|
|
30
|
+
function V({ value: e, defaultValue: t, onValueChange: i, open: o, defaultOpen: s = !1, onOpenChange: c, name: l, filter: u = te, onInputChange: d, children: f }) {
|
|
31
|
+
let p = x(), [m, h] = T(`${p}-listbox`), [_, v] = T(!1), [b = null, S] = r(e, t ?? null, i), [E = !1, k] = r(o, s, c), [M, P] = T(null), [F, L] = T(""), [R, z] = a(), [B, ne] = T(null), V = w([]), H = w(null), U = n(d), W = y((e, t) => t === "" || u(e, t), [u]), { valuesByIndex: G, skippedIndices: K, matchCount: re } = C(() => {
|
|
32
|
+
let e = [], t = /* @__PURE__ */ new Set(), n = 0;
|
|
33
|
+
return R.forEach((r, i) => {
|
|
34
|
+
if (r.index === -1) return;
|
|
35
|
+
e[r.index] = i;
|
|
36
|
+
let a = W(r.label, F);
|
|
37
|
+
a && (n += 1), (r.disabled || !a) && t.add(r.index);
|
|
38
|
+
}), {
|
|
39
|
+
valuesByIndex: e,
|
|
40
|
+
skippedIndices: t,
|
|
41
|
+
matchCount: n
|
|
42
|
+
};
|
|
43
|
+
}, [
|
|
44
|
+
R,
|
|
45
|
+
F,
|
|
46
|
+
W
|
|
47
|
+
]), { refs: q, floatingStyles: J, context: Y } = g({
|
|
48
|
+
open: E,
|
|
49
|
+
placement: N,
|
|
50
|
+
onOpenChange: (e) => k(e)
|
|
51
|
+
}), X = ee(Y, {
|
|
52
|
+
escapeKey: !0,
|
|
53
|
+
outsidePress: !0
|
|
54
|
+
}), ie = j(Y, {
|
|
55
|
+
listRef: V,
|
|
56
|
+
activeIndex: M,
|
|
57
|
+
onNavigate: P,
|
|
58
|
+
virtual: !0,
|
|
59
|
+
loop: !0,
|
|
60
|
+
disabledIndices: (e) => K.has(e)
|
|
61
|
+
}), { getReferenceProps: Z, getFloatingProps: Q, getItemProps: $ } = A([X, ie]), ae = C(() => {
|
|
62
|
+
let e = (e) => {
|
|
63
|
+
S(e), k(!1), H.current?.commitLabel(R.get(e)?.label ?? "");
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
baseId: p,
|
|
67
|
+
listId: m,
|
|
68
|
+
setListId: h,
|
|
69
|
+
setInputDisabled: v,
|
|
70
|
+
open: E,
|
|
71
|
+
selectedValue: b,
|
|
72
|
+
activeIndex: M,
|
|
73
|
+
options: R,
|
|
74
|
+
matchCount: re,
|
|
75
|
+
inputLabelling: B,
|
|
76
|
+
inputHandleRef: H,
|
|
77
|
+
refs: q,
|
|
78
|
+
floatingStyles: J,
|
|
79
|
+
elementsRef: V,
|
|
80
|
+
getReferenceProps: Z,
|
|
81
|
+
getFloatingProps: Q,
|
|
82
|
+
getItemProps: $,
|
|
83
|
+
onInputChange: U,
|
|
84
|
+
isVisible: (e) => W(e, F),
|
|
85
|
+
findMatches: (e) => {
|
|
86
|
+
let t = 0, n = null, r = null;
|
|
87
|
+
return R.forEach((i) => {
|
|
88
|
+
i.index !== -1 && W(i.label, e) && (t += 1, !i.disabled && ((n === null || i.index < n) && (n = i.index), (r === null || i.index > r) && (r = i.index)));
|
|
89
|
+
}), {
|
|
90
|
+
count: t,
|
|
91
|
+
first: n,
|
|
92
|
+
last: r
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
setQuery: L,
|
|
96
|
+
setActiveIndex: P,
|
|
97
|
+
selectValue: e,
|
|
98
|
+
selectIndex: (t) => {
|
|
99
|
+
let n = G[t];
|
|
100
|
+
n === void 0 || K.has(t) || e(n);
|
|
101
|
+
},
|
|
102
|
+
clearValue: () => S(null),
|
|
103
|
+
requestOpenChange: k,
|
|
104
|
+
registration: z,
|
|
105
|
+
setInputLabelling: ne
|
|
106
|
+
};
|
|
107
|
+
}, [
|
|
108
|
+
p,
|
|
109
|
+
m,
|
|
110
|
+
E,
|
|
111
|
+
b,
|
|
112
|
+
M,
|
|
113
|
+
R,
|
|
114
|
+
F,
|
|
115
|
+
re,
|
|
116
|
+
B,
|
|
117
|
+
q,
|
|
118
|
+
J,
|
|
119
|
+
Z,
|
|
120
|
+
Q,
|
|
121
|
+
$,
|
|
122
|
+
U,
|
|
123
|
+
W,
|
|
124
|
+
G,
|
|
125
|
+
K,
|
|
126
|
+
S,
|
|
127
|
+
k,
|
|
128
|
+
z
|
|
129
|
+
]);
|
|
130
|
+
return /* @__PURE__ */ O(I.Provider, {
|
|
131
|
+
value: ae,
|
|
132
|
+
children: [f, l !== void 0 && /* @__PURE__ */ D("input", {
|
|
133
|
+
type: "hidden",
|
|
134
|
+
name: l,
|
|
135
|
+
value: b ?? "",
|
|
136
|
+
disabled: _
|
|
137
|
+
})]
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
V.displayName = "Combobox";
|
|
141
|
+
function H({ ref: e, inputValue: t, defaultInputValue: n, label: a, description: o, error: s, size: c, slotProps: l, className: u, sx: d, id: f, onChange: p, onKeyDown: m, onBlur: h, disabled: g = !1, ...v }) {
|
|
142
|
+
let { listId: y, open: b, selectedValue: C, activeIndex: w, options: E, inputHandleRef: O, refs: k, getReferenceProps: ee, onInputChange: A, findMatches: j, setQuery: N, setActiveIndex: P, selectIndex: F, clearValue: te, requestOpenChange: I, setInputLabelling: L, setInputDisabled: z } = R("Input"), B = M([k.setReference, e]), ne = x(), V = f ?? ne, H = `${V}-label`, U = i(a), W = v["aria-labelledby"], G = v["aria-label"], [K, re] = T(n), [q, J] = T(() => (t ?? n) !== void 0), Y = C === null ? void 0 : E.get(C)?.label, X = t ?? (q ? K ?? "" : Y ?? K ?? ""), [, ie] = r(X, void 0, A), Z = (e) => {
|
|
143
|
+
ie(e), t === void 0 && re(e);
|
|
144
|
+
}, Q = t !== void 0 || q ? X : "", $ = (e) => {
|
|
145
|
+
J(!1), Z(e);
|
|
146
|
+
};
|
|
147
|
+
S(() => {
|
|
148
|
+
N(Q);
|
|
149
|
+
}, [Q, N]), S(() => (z(g), () => z(!1)), [g, z]), S(() => (O.current = { commitLabel: $ }, () => {
|
|
150
|
+
O.current = null;
|
|
151
|
+
})), S(() => (L(W !== void 0 || !U ? {
|
|
152
|
+
labelledBy: W,
|
|
153
|
+
label: G
|
|
154
|
+
} : { labelledBy: H }), () => L(null)), [
|
|
155
|
+
W,
|
|
156
|
+
G,
|
|
157
|
+
U,
|
|
158
|
+
H,
|
|
159
|
+
L
|
|
160
|
+
]);
|
|
161
|
+
let ae = (e) => {
|
|
162
|
+
p?.(e);
|
|
163
|
+
let n = e.currentTarget.value;
|
|
164
|
+
J(!0), Z(n), n === "" && te();
|
|
165
|
+
let r = t ?? n;
|
|
166
|
+
if (r === "") {
|
|
167
|
+
P(null), I(!1);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
let i = j(r);
|
|
171
|
+
P(i.first), i.count > 0 && I(!0);
|
|
172
|
+
}, oe = (e) => {
|
|
173
|
+
if (m?.(e), !e.defaultPrevented) {
|
|
174
|
+
if (e.key === "Escape") q && Y !== void 0 && $(Y);
|
|
175
|
+
else if (b) {
|
|
176
|
+
if (e.key === "Enter" && w !== null) e.preventDefault(), F(w);
|
|
177
|
+
else if (e.key === "Home" || e.key === "End") {
|
|
178
|
+
let t = j(Q), n = e.key === "Home" ? t.first : t.last;
|
|
179
|
+
if (n === null) return;
|
|
180
|
+
e.preventDefault(), P(n);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}, se = (e) => {
|
|
185
|
+
h?.(e), b && I(!1);
|
|
186
|
+
};
|
|
187
|
+
return /* @__PURE__ */ D(_, {
|
|
188
|
+
...ee({
|
|
189
|
+
...v,
|
|
190
|
+
onKeyDown: oe,
|
|
191
|
+
onBlur: se
|
|
192
|
+
}),
|
|
193
|
+
ref: B,
|
|
194
|
+
id: V,
|
|
195
|
+
label: U ? /* @__PURE__ */ D("span", {
|
|
196
|
+
id: H,
|
|
197
|
+
children: a
|
|
198
|
+
}) : a,
|
|
199
|
+
description: o,
|
|
200
|
+
error: s,
|
|
201
|
+
size: c,
|
|
202
|
+
slotProps: l,
|
|
203
|
+
className: u,
|
|
204
|
+
sx: d,
|
|
205
|
+
value: X,
|
|
206
|
+
disabled: g,
|
|
207
|
+
onChange: ae,
|
|
208
|
+
role: "combobox",
|
|
209
|
+
autoComplete: "off",
|
|
210
|
+
"aria-autocomplete": "list",
|
|
211
|
+
"aria-expanded": b,
|
|
212
|
+
"aria-controls": b ? y : void 0,
|
|
213
|
+
"data-state": b ? "open" : "closed",
|
|
214
|
+
"data-ui": "combobox-input"
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
H.displayName = "Combobox.Input";
|
|
218
|
+
function U({ ref: e, id: n, style: r, onMouseDown: i, children: a, className: o, sx: l, ...u }) {
|
|
219
|
+
let { baseId: d, setListId: f, open: p, inputLabelling: m, refs: g, floatingStyles: _, elementsRef: v, getFloatingProps: y } = R("List"), b = n ?? `${d}-listbox`;
|
|
220
|
+
S(() => (f(b), () => f(`${d}-listbox`)), [
|
|
221
|
+
d,
|
|
222
|
+
b,
|
|
223
|
+
f
|
|
224
|
+
]);
|
|
225
|
+
let x = M([p ? g.setFloating : null, e]), C = u["aria-labelledby"] !== void 0 || u["aria-label"] !== void 0 ? {} : m?.labelledBy === void 0 ? { "aria-label": m?.label } : { "aria-labelledby": m.labelledBy }, w = (e) => {
|
|
226
|
+
i?.(e), e.preventDefault();
|
|
227
|
+
};
|
|
228
|
+
return /* @__PURE__ */ D(h, { children: /* @__PURE__ */ D(t, {
|
|
229
|
+
className: o,
|
|
230
|
+
styles: [c, s],
|
|
231
|
+
sx: l,
|
|
232
|
+
children: (e) => /* @__PURE__ */ D("div", {
|
|
233
|
+
...y({
|
|
234
|
+
id: b,
|
|
235
|
+
...C,
|
|
236
|
+
...u,
|
|
237
|
+
onMouseDown: w
|
|
238
|
+
}),
|
|
239
|
+
ref: x,
|
|
240
|
+
role: "listbox",
|
|
241
|
+
hidden: !p,
|
|
242
|
+
"data-state": p ? "open" : "closed",
|
|
243
|
+
"data-ui": "combobox-list",
|
|
244
|
+
style: {
|
|
245
|
+
...r,
|
|
246
|
+
..._
|
|
247
|
+
},
|
|
248
|
+
className: e,
|
|
249
|
+
children: /* @__PURE__ */ D(k, {
|
|
250
|
+
elementsRef: v,
|
|
251
|
+
children: /* @__PURE__ */ D(L.Provider, {
|
|
252
|
+
value: !0,
|
|
253
|
+
children: a
|
|
254
|
+
})
|
|
255
|
+
})
|
|
256
|
+
})
|
|
257
|
+
}) });
|
|
258
|
+
}
|
|
259
|
+
U.displayName = "Combobox.List";
|
|
260
|
+
function W({ ref: e, value: n, disabled: r = !1, onClick: i, children: a, className: s, sx: c, ...h }) {
|
|
261
|
+
let { baseId: g, selectedValue: _, activeIndex: v, options: y, isVisible: b, getItemProps: x, selectValue: S, registration: C } = z("Item"), T = w(null), { ref: E, index: k } = d(n, C, T, (e, t) => ({
|
|
262
|
+
index: e,
|
|
263
|
+
label: t,
|
|
264
|
+
disabled: r
|
|
265
|
+
})), ee = M([E, e]), A = y.get(n)?.label, j = A !== void 0 && !b(A), N = k !== -1 && v === k, F = _ === n, te = (e) => {
|
|
266
|
+
i?.(e), !(r || e.defaultPrevented) && S(n);
|
|
267
|
+
};
|
|
268
|
+
return /* @__PURE__ */ D(t, {
|
|
269
|
+
className: s,
|
|
270
|
+
styles: [
|
|
271
|
+
f,
|
|
272
|
+
u,
|
|
273
|
+
l,
|
|
274
|
+
B
|
|
275
|
+
],
|
|
276
|
+
sx: c,
|
|
277
|
+
children: (e) => /* @__PURE__ */ O("div", {
|
|
278
|
+
...x({
|
|
279
|
+
id: p(g, n),
|
|
280
|
+
...h,
|
|
281
|
+
onClick: te
|
|
282
|
+
}),
|
|
283
|
+
ref: ee,
|
|
284
|
+
role: "option",
|
|
285
|
+
hidden: j,
|
|
286
|
+
"aria-selected": F,
|
|
287
|
+
"aria-disabled": r || void 0,
|
|
288
|
+
"data-active": N || void 0,
|
|
289
|
+
"data-ui": "combobox-item",
|
|
290
|
+
className: e,
|
|
291
|
+
children: [/* @__PURE__ */ D("span", {
|
|
292
|
+
ref: T,
|
|
293
|
+
css: m,
|
|
294
|
+
children: a
|
|
295
|
+
}), F && /* @__PURE__ */ D("span", {
|
|
296
|
+
"aria-hidden": "true",
|
|
297
|
+
css: o,
|
|
298
|
+
children: P
|
|
299
|
+
})]
|
|
300
|
+
})
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
W.displayName = "Combobox.Item";
|
|
304
|
+
function G({ ref: e, children: n, className: r, sx: a, ...o }) {
|
|
305
|
+
let { matchCount: s } = z("Empty");
|
|
306
|
+
return s > 0 ? null : /* @__PURE__ */ D(t, {
|
|
307
|
+
className: r,
|
|
308
|
+
styles: ne,
|
|
309
|
+
sx: a,
|
|
310
|
+
children: (t) => /* @__PURE__ */ D("div", {
|
|
311
|
+
...o,
|
|
312
|
+
ref: e,
|
|
313
|
+
"data-ui": "combobox-empty",
|
|
314
|
+
className: t,
|
|
315
|
+
children: i(n) ? n : F
|
|
316
|
+
})
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
G.displayName = "Combobox.Empty";
|
|
320
|
+
var K = Object.assign(V, {
|
|
321
|
+
Input: H,
|
|
322
|
+
List: U,
|
|
323
|
+
Item: W,
|
|
324
|
+
Empty: G
|
|
325
|
+
});
|
|
326
|
+
//#endregion
|
|
327
|
+
export { K as t };
|
package/dist/combobox.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Combobox } from "./combobox-
|
|
2
|
+
export { t as Combobox } from "./combobox-DiMC2g_u.js";
|