@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,136 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { t as e } from "./css-Cgj6sCHn.js";
|
|
3
|
-
import { n as t } from "./media-D_eA_I-e.js";
|
|
4
|
-
import { t as n } from "./renderable-DzcIj1Lo.js";
|
|
5
|
-
import { i as r, n as i, r as a, t as o } from "./choice-control-ByFogYcT.js";
|
|
6
|
-
import { useEffect as s, useId as c, useImperativeHandle as l, useRef as u } from "react";
|
|
7
|
-
import { vars as d } from "@jfrader/tokens/vars";
|
|
8
|
-
import { jsx as f, jsxs as p } from "@emotion/react/jsx-runtime";
|
|
9
|
-
//#region src/components/checkbox/checkbox.tsx
|
|
10
|
-
var m = {
|
|
11
|
-
sm: "16px",
|
|
12
|
-
md: "20px"
|
|
13
|
-
}, h = e({
|
|
14
|
-
"input:checked + span svg": { opacity: 1 },
|
|
15
|
-
"&[data-indeterminate] input + span": {
|
|
16
|
-
backgroundColor: d.color.accent,
|
|
17
|
-
borderColor: d.color.accent
|
|
18
|
-
},
|
|
19
|
-
"&[data-indeterminate] input + span svg": { opacity: 1 }
|
|
20
|
-
}), g = e({
|
|
21
|
-
display: "inline-flex",
|
|
22
|
-
alignItems: "center",
|
|
23
|
-
justifyContent: "center",
|
|
24
|
-
flexShrink: 0,
|
|
25
|
-
boxSizing: "border-box",
|
|
26
|
-
border: `1px solid ${d.color.borderControl}`,
|
|
27
|
-
borderRadius: d.radius.sm,
|
|
28
|
-
backgroundColor: d.color.surfaceRaised,
|
|
29
|
-
color: d.color.accentContrast,
|
|
30
|
-
transitionProperty: "background-color, border-color",
|
|
31
|
-
transitionDuration: d.motion.duration.fast,
|
|
32
|
-
transitionTimingFunction: d.motion.easeStandard,
|
|
33
|
-
"& svg": {
|
|
34
|
-
inlineSize: "75%",
|
|
35
|
-
blockSize: "75%",
|
|
36
|
-
opacity: 0
|
|
37
|
-
},
|
|
38
|
-
[t]: { transitionDuration: "0s" }
|
|
39
|
-
}), _ = {
|
|
40
|
-
sm: e({
|
|
41
|
-
inlineSize: m.sm,
|
|
42
|
-
blockSize: m.sm
|
|
43
|
-
}),
|
|
44
|
-
md: e({
|
|
45
|
-
inlineSize: m.md,
|
|
46
|
-
blockSize: m.md
|
|
47
|
-
})
|
|
48
|
-
}, v = {
|
|
49
|
-
sm: e({ fontSize: d.textSize.sm }),
|
|
50
|
-
md: e({ fontSize: d.textSize.md })
|
|
51
|
-
}, y = e({
|
|
52
|
-
fontSize: d.textSize.sm,
|
|
53
|
-
color: d.color.textMuted
|
|
54
|
-
}), b = {
|
|
55
|
-
sm: e({ marginInlineStart: `calc(${m.sm} + ${d.space[2]})` }),
|
|
56
|
-
md: e({ marginInlineStart: `calc(${m.md} + ${d.space[2]})` })
|
|
57
|
-
};
|
|
58
|
-
function x({ indeterminate: e }) {
|
|
59
|
-
return /* @__PURE__ */ f("svg", {
|
|
60
|
-
viewBox: "0 0 16 16",
|
|
61
|
-
fill: "none",
|
|
62
|
-
stroke: "currentColor",
|
|
63
|
-
strokeWidth: "2",
|
|
64
|
-
strokeLinecap: "round",
|
|
65
|
-
strokeLinejoin: "round",
|
|
66
|
-
children: e ? /* @__PURE__ */ f("line", {
|
|
67
|
-
x1: "4",
|
|
68
|
-
y1: "8",
|
|
69
|
-
x2: "12",
|
|
70
|
-
y2: "8"
|
|
71
|
-
}) : /* @__PURE__ */ f("polyline", { points: "3.5 8.5 6.5 11.5 12.5 4.5" })
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function S({ ref: e, label: t, description: d, indeterminate: m = !1, size: S = "md", onChange: C, onCheckedChange: w, slotProps: T, className: E, "aria-labelledby": D, "aria-describedby": O, ...k }) {
|
|
75
|
-
let A = u(null);
|
|
76
|
-
l(e, () => A.current, []), s(() => {
|
|
77
|
-
A.current && (A.current.indeterminate = m);
|
|
78
|
-
}, [m]);
|
|
79
|
-
let j = c(), M = `${j}-label`, N = `${j}-description`, P = n(t), F = n(d), I = [D, P && M].filter(Boolean).join(" ") || void 0, L = [O, F && N].filter(Boolean).join(" ") || void 0, R = [E, T?.root?.className].filter(Boolean).join(" ") || void 0, z = (e) => {
|
|
80
|
-
m && (e.currentTarget.indeterminate = !0), C?.(e), w?.(e.currentTarget.checked);
|
|
81
|
-
};
|
|
82
|
-
return /* @__PURE__ */ p("label", {
|
|
83
|
-
"data-ui": "checkbox",
|
|
84
|
-
"data-indeterminate": m || void 0,
|
|
85
|
-
className: R,
|
|
86
|
-
css: [
|
|
87
|
-
a,
|
|
88
|
-
h,
|
|
89
|
-
i,
|
|
90
|
-
T?.root?.css
|
|
91
|
-
],
|
|
92
|
-
children: [/* @__PURE__ */ p("span", {
|
|
93
|
-
css: r,
|
|
94
|
-
children: [
|
|
95
|
-
/* @__PURE__ */ f("input", {
|
|
96
|
-
...k,
|
|
97
|
-
ref: A,
|
|
98
|
-
type: "checkbox",
|
|
99
|
-
"aria-labelledby": I,
|
|
100
|
-
"aria-describedby": L,
|
|
101
|
-
"aria-checked": m ? "mixed" : void 0,
|
|
102
|
-
onChange: z,
|
|
103
|
-
css: o
|
|
104
|
-
}),
|
|
105
|
-
/* @__PURE__ */ f("span", {
|
|
106
|
-
"aria-hidden": "true",
|
|
107
|
-
className: T?.control?.className,
|
|
108
|
-
css: [
|
|
109
|
-
g,
|
|
110
|
-
_[S],
|
|
111
|
-
T?.control?.css
|
|
112
|
-
],
|
|
113
|
-
children: /* @__PURE__ */ f(x, { indeterminate: m })
|
|
114
|
-
}),
|
|
115
|
-
P && /* @__PURE__ */ f("span", {
|
|
116
|
-
id: M,
|
|
117
|
-
className: T?.label?.className,
|
|
118
|
-
css: [v[S], T?.label?.css],
|
|
119
|
-
children: t
|
|
120
|
-
})
|
|
121
|
-
]
|
|
122
|
-
}), F && /* @__PURE__ */ f("span", {
|
|
123
|
-
id: N,
|
|
124
|
-
className: T?.description?.className,
|
|
125
|
-
css: [
|
|
126
|
-
y,
|
|
127
|
-
b[S],
|
|
128
|
-
T?.description?.css
|
|
129
|
-
],
|
|
130
|
-
children: d
|
|
131
|
-
})]
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
S.displayName = "Checkbox";
|
|
135
|
-
//#endregion
|
|
136
|
-
export { S as t };
|
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { t as e } from "./css-Cgj6sCHn.js";
|
|
3
|
-
import { n as t, t as n } from "./use-controlled-state-CVXDa-qM.js";
|
|
4
|
-
import { t as r } from "./renderable-DzcIj1Lo.js";
|
|
5
|
-
import { a as i, c as a, d as o, f as s, l as c, o as l, r as u, s as d, t as f, u as p } from "./collection-registry-1l9f3XJZ.js";
|
|
6
|
-
import { t as m } from "./use-overlay-floating-efeqppiw.js";
|
|
7
|
-
import { t as h } from "./text-field-8PQAqRpM.js";
|
|
8
|
-
import { createContext as g, useCallback as _, useContext as v, useId as y, useLayoutEffect as b, useMemo as x, useRef as S, useState as C } from "react";
|
|
9
|
-
import { vars as w } from "@jfrader/tokens/vars";
|
|
10
|
-
import { jsx as T, jsxs as E } from "@emotion/react/jsx-runtime";
|
|
11
|
-
import { FloatingList as D, FloatingPortal as O, useDismiss as k, useInteractions as ee, useListNavigation as A, useMergeRefs as j } from "@floating-ui/react";
|
|
12
|
-
//#region src/components/combobox/combobox.tsx
|
|
13
|
-
var M = "bottom-start", N = "✓", P = "No results", te = (e, t) => e.toLocaleLowerCase().includes(t.toLocaleLowerCase()), F = g(null), I = g(!1);
|
|
14
|
-
function L(e) {
|
|
15
|
-
let t = v(F);
|
|
16
|
-
if (!t) throw Error(`Combobox.${e} must be rendered inside <Combobox>.`);
|
|
17
|
-
return t;
|
|
18
|
-
}
|
|
19
|
-
function R(e) {
|
|
20
|
-
let t = L(e);
|
|
21
|
-
if (!v(I)) throw Error(`Combobox.${e} must be rendered inside <Combobox.List>.`);
|
|
22
|
-
return t;
|
|
23
|
-
}
|
|
24
|
-
var z = e({ "&[hidden]": { display: "none" } }), B = e({
|
|
25
|
-
paddingBlock: w.space[1],
|
|
26
|
-
paddingInline: w.space[2],
|
|
27
|
-
fontSize: w.textSize.sm,
|
|
28
|
-
color: w.color.textMuted
|
|
29
|
-
});
|
|
30
|
-
function V({ value: e, defaultValue: r, onValueChange: a, open: o, defaultOpen: s = !1, onOpenChange: c, name: l, filter: u = te, onInputChange: d, children: f }) {
|
|
31
|
-
let p = y(), [h, g] = C(`${p}-listbox`), [v, b] = C(!1), [w = null, D] = n(e, r ?? null, a), [O = !1, j] = n(o, s, c), [N, P] = C(null), [I, L] = C(""), [R, z] = i(), [B, V] = C(null), H = S([]), U = S(null), W = t(d), G = _((e, t) => t === "" || u(e, t), [u]), { valuesByIndex: K, skippedIndices: q, matchCount: J } = x(() => {
|
|
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 = G(r.label, I);
|
|
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
|
-
I,
|
|
46
|
-
G
|
|
47
|
-
]), { refs: Y, floatingStyles: X, context: Z } = m({
|
|
48
|
-
open: O,
|
|
49
|
-
placement: M,
|
|
50
|
-
onOpenChange: (e) => j(e)
|
|
51
|
-
}), ne = k(Z, {
|
|
52
|
-
escapeKey: !0,
|
|
53
|
-
outsidePress: !0
|
|
54
|
-
}), re = A(Z, {
|
|
55
|
-
listRef: H,
|
|
56
|
-
activeIndex: N,
|
|
57
|
-
onNavigate: P,
|
|
58
|
-
virtual: !0,
|
|
59
|
-
loop: !0,
|
|
60
|
-
disabledIndices: (e) => q.has(e)
|
|
61
|
-
}), { getReferenceProps: Q, getFloatingProps: $, getItemProps: ie } = ee([ne, re]), ae = x(() => {
|
|
62
|
-
let e = (e) => {
|
|
63
|
-
D(e), j(!1), U.current?.commitLabel(R.get(e)?.label ?? "");
|
|
64
|
-
};
|
|
65
|
-
return {
|
|
66
|
-
baseId: p,
|
|
67
|
-
listId: h,
|
|
68
|
-
setListId: g,
|
|
69
|
-
setInputDisabled: b,
|
|
70
|
-
open: O,
|
|
71
|
-
selectedValue: w,
|
|
72
|
-
activeIndex: N,
|
|
73
|
-
options: R,
|
|
74
|
-
matchCount: J,
|
|
75
|
-
inputLabelling: B,
|
|
76
|
-
inputHandleRef: U,
|
|
77
|
-
refs: Y,
|
|
78
|
-
floatingStyles: X,
|
|
79
|
-
elementsRef: H,
|
|
80
|
-
getReferenceProps: Q,
|
|
81
|
-
getFloatingProps: $,
|
|
82
|
-
getItemProps: ie,
|
|
83
|
-
onInputChange: W,
|
|
84
|
-
isVisible: (e) => G(e, I),
|
|
85
|
-
findMatches: (e) => {
|
|
86
|
-
let t = 0, n = null, r = null;
|
|
87
|
-
return R.forEach((i) => {
|
|
88
|
-
i.index !== -1 && G(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 = K[t];
|
|
100
|
-
n === void 0 || q.has(t) || e(n);
|
|
101
|
-
},
|
|
102
|
-
clearValue: () => D(null),
|
|
103
|
-
requestOpenChange: j,
|
|
104
|
-
registration: z,
|
|
105
|
-
setInputLabelling: V
|
|
106
|
-
};
|
|
107
|
-
}, [
|
|
108
|
-
p,
|
|
109
|
-
h,
|
|
110
|
-
O,
|
|
111
|
-
w,
|
|
112
|
-
N,
|
|
113
|
-
R,
|
|
114
|
-
I,
|
|
115
|
-
J,
|
|
116
|
-
B,
|
|
117
|
-
Y,
|
|
118
|
-
X,
|
|
119
|
-
Q,
|
|
120
|
-
$,
|
|
121
|
-
ie,
|
|
122
|
-
W,
|
|
123
|
-
G,
|
|
124
|
-
K,
|
|
125
|
-
q,
|
|
126
|
-
D,
|
|
127
|
-
j,
|
|
128
|
-
z
|
|
129
|
-
]);
|
|
130
|
-
return /* @__PURE__ */ E(F.Provider, {
|
|
131
|
-
value: ae,
|
|
132
|
-
children: [f, l !== void 0 && /* @__PURE__ */ T("input", {
|
|
133
|
-
type: "hidden",
|
|
134
|
-
name: l,
|
|
135
|
-
value: w ?? "",
|
|
136
|
-
disabled: v
|
|
137
|
-
})]
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
V.displayName = "Combobox";
|
|
141
|
-
function H({ ref: e, inputValue: t, defaultInputValue: i, label: a, description: o, error: s, size: c, slotProps: l, className: u, id: d, onChange: f, onKeyDown: p, onBlur: m, disabled: g = !1, ..._ }) {
|
|
142
|
-
let { listId: v, open: x, selectedValue: S, activeIndex: w, options: E, inputHandleRef: D, refs: O, getReferenceProps: k, onInputChange: ee, findMatches: A, setQuery: M, setActiveIndex: N, selectIndex: P, clearValue: te, requestOpenChange: F, setInputLabelling: I, setInputDisabled: R } = L("Input"), z = j([O.setReference, e]), B = y(), V = d ?? B, H = `${V}-label`, U = r(a), W = _["aria-labelledby"], G = _["aria-label"], [K, q] = C(i), [J, Y] = C(() => (t ?? i) !== void 0), X = S === null ? void 0 : E.get(S)?.label, Z = t ?? (J ? K ?? "" : X ?? K ?? ""), [, ne] = n(Z, void 0, ee), re = (e) => {
|
|
143
|
-
ne(e), t === void 0 && q(e);
|
|
144
|
-
}, Q = t !== void 0 || J ? Z : "", $ = (e) => {
|
|
145
|
-
Y(!1), re(e);
|
|
146
|
-
};
|
|
147
|
-
b(() => {
|
|
148
|
-
M(Q);
|
|
149
|
-
}, [Q, M]), b(() => (R(g), () => R(!1)), [g, R]), b(() => (D.current = { commitLabel: $ }, () => {
|
|
150
|
-
D.current = null;
|
|
151
|
-
})), b(() => (I(W !== void 0 || !U ? {
|
|
152
|
-
labelledBy: W,
|
|
153
|
-
label: G
|
|
154
|
-
} : { labelledBy: H }), () => I(null)), [
|
|
155
|
-
W,
|
|
156
|
-
G,
|
|
157
|
-
U,
|
|
158
|
-
H,
|
|
159
|
-
I
|
|
160
|
-
]);
|
|
161
|
-
let ie = (e) => {
|
|
162
|
-
f?.(e);
|
|
163
|
-
let n = e.currentTarget.value;
|
|
164
|
-
Y(!0), re(n), n === "" && te();
|
|
165
|
-
let r = t ?? n;
|
|
166
|
-
if (r === "") {
|
|
167
|
-
N(null), F(!1);
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
let i = A(r);
|
|
171
|
-
N(i.first), i.count > 0 && F(!0);
|
|
172
|
-
}, ae = (e) => {
|
|
173
|
-
if (p?.(e), !e.defaultPrevented) {
|
|
174
|
-
if (e.key === "Escape") J && X !== void 0 && $(X);
|
|
175
|
-
else if (x) {
|
|
176
|
-
if (e.key === "Enter" && w !== null) e.preventDefault(), P(w);
|
|
177
|
-
else if (e.key === "Home" || e.key === "End") {
|
|
178
|
-
let t = A(Q), n = e.key === "Home" ? t.first : t.last;
|
|
179
|
-
if (n === null) return;
|
|
180
|
-
e.preventDefault(), N(n);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}, oe = (e) => {
|
|
185
|
-
m?.(e), x && F(!1);
|
|
186
|
-
};
|
|
187
|
-
return /* @__PURE__ */ T(h, {
|
|
188
|
-
...k({
|
|
189
|
-
..._,
|
|
190
|
-
onKeyDown: ae,
|
|
191
|
-
onBlur: oe
|
|
192
|
-
}),
|
|
193
|
-
ref: z,
|
|
194
|
-
id: V,
|
|
195
|
-
label: U ? /* @__PURE__ */ T("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
|
-
value: Z,
|
|
205
|
-
disabled: g,
|
|
206
|
-
onChange: ie,
|
|
207
|
-
role: "combobox",
|
|
208
|
-
autoComplete: "off",
|
|
209
|
-
"aria-autocomplete": "list",
|
|
210
|
-
"aria-expanded": x,
|
|
211
|
-
"aria-controls": x ? v : void 0,
|
|
212
|
-
"data-state": x ? "open" : "closed",
|
|
213
|
-
"data-ui": "combobox-input"
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
H.displayName = "Combobox.Input";
|
|
217
|
-
function U({ ref: e, id: t, style: n, onMouseDown: r, children: i, ...a }) {
|
|
218
|
-
let { baseId: c, setListId: l, open: u, inputLabelling: d, refs: f, floatingStyles: p, elementsRef: m, getFloatingProps: h } = L("List"), g = t ?? `${c}-listbox`;
|
|
219
|
-
b(() => (l(g), () => l(`${c}-listbox`)), [
|
|
220
|
-
c,
|
|
221
|
-
g,
|
|
222
|
-
l
|
|
223
|
-
]);
|
|
224
|
-
let _ = j([u ? f.setFloating : null, e]), v = a["aria-labelledby"] !== void 0 || a["aria-label"] !== void 0 ? {} : d?.labelledBy === void 0 ? { "aria-label": d?.label } : { "aria-labelledby": d.labelledBy }, y = (e) => {
|
|
225
|
-
r?.(e), e.preventDefault();
|
|
226
|
-
};
|
|
227
|
-
return /* @__PURE__ */ T(O, { children: /* @__PURE__ */ T("div", {
|
|
228
|
-
...h({
|
|
229
|
-
id: g,
|
|
230
|
-
...v,
|
|
231
|
-
...a,
|
|
232
|
-
onMouseDown: y
|
|
233
|
-
}),
|
|
234
|
-
ref: _,
|
|
235
|
-
role: "listbox",
|
|
236
|
-
hidden: !u,
|
|
237
|
-
"data-state": u ? "open" : "closed",
|
|
238
|
-
"data-ui": "combobox-list",
|
|
239
|
-
style: {
|
|
240
|
-
...n,
|
|
241
|
-
...p
|
|
242
|
-
},
|
|
243
|
-
css: [s, o],
|
|
244
|
-
children: /* @__PURE__ */ T(D, {
|
|
245
|
-
elementsRef: m,
|
|
246
|
-
children: /* @__PURE__ */ T(I.Provider, {
|
|
247
|
-
value: !0,
|
|
248
|
-
children: i
|
|
249
|
-
})
|
|
250
|
-
})
|
|
251
|
-
}) });
|
|
252
|
-
}
|
|
253
|
-
U.displayName = "Combobox.List";
|
|
254
|
-
function W({ ref: e, value: t, disabled: n = !1, onClick: r, children: i, ...o }) {
|
|
255
|
-
let { baseId: s, selectedValue: m, activeIndex: h, options: g, isVisible: _, getItemProps: v, selectValue: y, registration: b } = R("Item"), x = S(null), { ref: C, index: w } = u(t, b, x, (e, t) => ({
|
|
256
|
-
index: e,
|
|
257
|
-
label: t,
|
|
258
|
-
disabled: n
|
|
259
|
-
})), D = j([C, e]), O = g.get(t)?.label, k = O !== void 0 && !_(O), ee = w !== -1 && h === w, A = m === t, M = (e) => {
|
|
260
|
-
r?.(e), !(n || e.defaultPrevented) && y(t);
|
|
261
|
-
};
|
|
262
|
-
return /* @__PURE__ */ E("div", {
|
|
263
|
-
...v({
|
|
264
|
-
id: f(s, t),
|
|
265
|
-
...o,
|
|
266
|
-
onClick: M
|
|
267
|
-
}),
|
|
268
|
-
ref: D,
|
|
269
|
-
role: "option",
|
|
270
|
-
hidden: k,
|
|
271
|
-
"aria-selected": A,
|
|
272
|
-
"aria-disabled": n || void 0,
|
|
273
|
-
"data-active": ee || void 0,
|
|
274
|
-
"data-ui": "combobox-item",
|
|
275
|
-
css: [
|
|
276
|
-
d,
|
|
277
|
-
l,
|
|
278
|
-
c,
|
|
279
|
-
z
|
|
280
|
-
],
|
|
281
|
-
children: [/* @__PURE__ */ T("span", {
|
|
282
|
-
ref: x,
|
|
283
|
-
css: p,
|
|
284
|
-
children: i
|
|
285
|
-
}), A && /* @__PURE__ */ T("span", {
|
|
286
|
-
"aria-hidden": "true",
|
|
287
|
-
css: a,
|
|
288
|
-
children: N
|
|
289
|
-
})]
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
W.displayName = "Combobox.Item";
|
|
293
|
-
function G({ ref: e, children: t, ...n }) {
|
|
294
|
-
let { matchCount: i } = R("Empty");
|
|
295
|
-
return i > 0 ? null : /* @__PURE__ */ T("div", {
|
|
296
|
-
...n,
|
|
297
|
-
ref: e,
|
|
298
|
-
"data-ui": "combobox-empty",
|
|
299
|
-
css: B,
|
|
300
|
-
children: r(t) ? t : P
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
G.displayName = "Combobox.Empty";
|
|
304
|
-
var K = Object.assign(V, {
|
|
305
|
-
Input: H,
|
|
306
|
-
List: U,
|
|
307
|
-
Item: W,
|
|
308
|
-
Empty: G
|
|
309
|
-
});
|
|
310
|
-
//#endregion
|
|
311
|
-
export { K as t };
|