@jfrader/ui 0.5.0 → 0.5.1
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-DLul6vIl.js +205 -0
- package/dist/accordion.js +1 -1
- package/dist/{announcement-bar-B58xempt.js → announcement-bar-Dlbq5-9D.js} +1 -1
- package/dist/announcement-bar.js +1 -1
- package/dist/avatar-CaGJHy1N.js +145 -0
- package/dist/{avatar-group-DOQQuV51.js → avatar-group-M1opAQEG.js} +1 -1
- package/dist/avatar-group.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge-CjM5Agqk.js +119 -0
- package/dist/badge.js +1 -1
- package/dist/{bottom-sheet-DPJBFkie.js → bottom-sheet-DjZOPq4k.js} +10 -9
- package/dist/bottom-sheet.js +1 -1
- package/dist/{breadcrumbs-Cfw_hgt2.js → breadcrumbs-BDK_LiwH.js} +10 -3
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-C92uYFJW.js → button-NLY0h6EJ.js} +7 -7
- package/dist/button.js +1 -1
- package/dist/{calendar-B3Svu0X2.js → calendar-BzJdv_SZ.js} +3 -1
- package/dist/calendar.js +1 -1
- package/dist/card-Ca4KQKYQ.js +154 -0
- package/dist/card.js +1 -1
- package/dist/carousel-B7OrvD6J.js +474 -0
- package/dist/carousel.js +1 -1
- package/dist/{checkbox-cFquiSdy.js → checkbox-DKSzExj2.js} +16 -15
- package/dist/checkbox.js +1 -1
- package/dist/{chip-group-DTQd_M-G.js → chip-group-DjQ0_6Y9.js} +2 -1
- package/dist/chip-group.js +1 -1
- package/dist/{code-block-ahnRi-g8.js → code-block-B5we2lZa.js} +75 -74
- package/dist/code-block.js +1 -1
- package/dist/{combobox-Bhzvu9ma.js → combobox-DFFqOBCi.js} +114 -109
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BmQu2w4H.js +391 -0
- package/dist/command-palette.js +1 -1
- package/dist/comment-thread-ASaXDcGo.js +1410 -0
- package/dist/comment-thread.js +2 -0
- package/dist/context-menu-__1c2Dk9.js +370 -0
- package/dist/context-menu.js +2 -0
- package/dist/{copy-button-ByiA6D3R.js → copy-button-DCSLcYS-.js} +1 -1
- package/dist/copy-button.js +1 -1
- package/dist/{date-picker-5zKSSuFF.js → date-picker-BiPN7yeK.js} +4 -4
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-DQpUeKqV.js +570 -0
- package/dist/date-range-picker.js +1 -1
- package/dist/{dialog-ciiv9H2b.js → dialog-BX1zYMs-.js} +2 -1
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
- package/dist/divider.js +1 -1
- package/dist/elastic-slider-BG6K019r.js +395 -0
- package/dist/elastic-slider.js +2 -0
- package/dist/{expandable-card-C-qJcZ14.js → expandable-card-rUATve0o.js} +8 -1
- package/dist/expandable-card.js +1 -1
- package/dist/expanding-search-BxOwtdwt.js +238 -0
- package/dist/expanding-search.js +2 -0
- package/dist/file-dropzone-BuXm3Tea.js +457 -0
- package/dist/file-dropzone.js +1 -1
- package/dist/{filter-toolbar-D5KEKTSe.js → filter-toolbar-Cy5Hqur-.js} +4 -2
- package/dist/filter-toolbar.js +1 -1
- package/dist/{hover-card-B-nrCIy2.js → hover-card-CoMJKg1g.js} +7 -7
- package/dist/hover-card.js +1 -1
- package/dist/{image-compare-ciuhPtQZ.js → image-compare-BxY8Ykzt.js} +1 -1
- package/dist/image-compare.js +1 -1
- package/dist/index.js +81 -76
- package/dist/{json-viewer-BcySQfjZ.js → json-viewer-DgWqyU75.js} +7 -3
- package/dist/json-viewer.js +1 -1
- package/dist/mention-input-sq61si9L.js +600 -0
- package/dist/mention-input.js +1 -1
- package/dist/menu-DDKgmK2F.js +295 -0
- package/dist/menu.js +1 -1
- package/dist/{metric-card-Bh9K4fZs.js → metric-card--lVTz5Wn.js} +2 -2
- package/dist/metric-card.js +1 -1
- package/dist/{multi-select-Pce_IYnz.js → multi-select-DG1BCFX7.js} +14 -6
- package/dist/multi-select.js +1 -1
- package/dist/{navigation-sP5fiuQS.js → navigation-CC26JDr-.js} +20 -14
- package/dist/navigation.js +1 -1
- package/dist/{overlay-layer-SeUyyEPD.js → overlay-layer-qEbpEtb8.js} +16 -2
- package/dist/{pagination-DmXZ8E85.js → pagination-BfkeWbmP.js} +23 -22
- package/dist/pagination.js +1 -1
- package/dist/pill-BaS-uIbn.js +58 -0
- package/dist/pill.js +1 -1
- package/dist/popover-CErIw2q3.js +125 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-CbOWBUdA.js → progress-DAQkfhPd.js} +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radio-cards-D2QZENI_.js → radio-cards-Cu9cBssN.js} +35 -34
- package/dist/radio-cards.js +1 -1
- package/dist/{radio-group-E6mMRgo7.js → radio-group-TIK0-iPX.js} +18 -15
- package/dist/radio-group.js +1 -1
- package/dist/{resizable-panels-BhjUVXZZ.js → resizable-panels-DUpQEpwG.js} +3 -2
- package/dist/resizable-panels.js +1 -1
- package/dist/{search-field-IxF0IJXm.js → search-field-DMvho0KQ.js} +2 -2
- package/dist/search-field.js +1 -1
- package/dist/{segmented-control-yO1K1nbi.js → segmented-control-8ZUGnsZm.js} +2 -1
- package/dist/segmented-control.js +1 -1
- package/dist/{select-n_H52W1Z.js → select-D5rhJ8gi.js} +3 -2
- package/dist/select.js +1 -1
- package/dist/{signature-pad-q2SAsrdD.js → signature-pad-_bTeguN9.js} +256 -251
- package/dist/signature-pad.js +1 -1
- package/dist/slider-DVG6-Awh.js +308 -0
- package/dist/slider.js +1 -1
- package/dist/{sortable-data-table-tirqlLY2.js → sortable-data-table-CYKT_Ng7.js} +2 -2
- package/dist/sortable-data-table.js +1 -1
- package/dist/{split-button-Cb3EHs64.js → split-button-BCw4zZom.js} +75 -81
- package/dist/split-button.js +1 -1
- package/dist/{swipe-actions-DiZC57-3.js → swipe-actions-CBuJREU1.js} +4 -2
- package/dist/swipe-actions.js +1 -1
- package/dist/switch-C1WrKrf-.js +145 -0
- package/dist/switch.js +1 -1
- package/dist/tabs-XluwRjgg.js +210 -0
- package/dist/tabs.js +1 -1
- package/dist/{text-field-C8TWG-tY.js → text-field-hU72iSVS.js} +15 -13
- package/dist/text-field.js +1 -1
- package/dist/{textarea-BrW0XcG_.js → textarea-3k4Y0QQ3.js} +18 -16
- package/dist/textarea.js +1 -1
- package/dist/theme-root.js +1 -1
- package/dist/theme-switch-C505TtU8.js +166 -0
- package/dist/theme-switch.js +2 -0
- package/dist/{time-picker-Db8D49cP.js → time-picker-CPlhW0tr.js} +26 -20
- package/dist/time-picker.js +1 -1
- package/dist/{timeline-k3nURuCP.js → timeline-B0uAAVfT.js} +8 -2
- package/dist/timeline.js +1 -1
- package/dist/{toast-BHxI32ZA.js → toast-B7wo3sX1.js} +98 -79
- package/dist/{toast-stack-DqrAzdg5.js → toast-stack-B40VpS4M.js} +18 -4
- package/dist/toast-stack.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-fcjzpifI.js → toggle-group-B2fpFZwV.js} +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BvgVTCTN.js +120 -0
- package/dist/tooltip.js +1 -1
- package/dist/{tree-view-C2liIxqy.js → tree-view-j8qLqkb_.js} +5 -1
- package/dist/tree-view.js +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +1 -1
- package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
- package/dist/types/components/comment-thread/index.d.ts +1 -0
- package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
- package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
- package/dist/types/components/context-menu/context-menu.d.ts +55 -0
- package/dist/types/components/context-menu/index.d.ts +2 -0
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +1 -1
- package/dist/types/components/elastic-slider/elastic-slider.d.ts +53 -0
- package/dist/types/components/elastic-slider/index.d.ts +1 -0
- package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
- package/dist/types/components/expanding-search/index.d.ts +1 -0
- package/dist/types/components/menu/menu.d.ts +50 -7
- package/dist/types/components/pagination/pagination.d.ts +1 -1
- package/dist/types/components/radio-cards/radio-cards.d.ts +1 -1
- package/dist/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/types/components/slider/slider-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +2 -10
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
- package/dist/types/components/split-button/split-button.d.ts +2 -2
- package/dist/types/components/tabs/tabs.d.ts +1 -1
- package/dist/types/components/text-field/text-field.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +1 -1
- package/dist/types/components/theme-switch/index.d.ts +1 -0
- package/dist/types/components/theme-switch/theme-switch.d.ts +33 -0
- package/dist/types/components/tooltip/tooltip.d.ts +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/overlay/overlay-layer.d.ts +20 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +9 -2
- package/dist/{use-overlay-floating-DvJifLpF.js → use-overlay-floating-Bx2jBKAA.js} +8 -6
- package/dist/use-slider-interaction-ChL-208h.js +234 -0
- package/package.json +22 -2
- package/dist/accordion-xCI_u0BV.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/card-D-aI2QHx.js +0 -158
- package/dist/carousel-IvPqN-oM.js +0 -472
- package/dist/command-palette-BQ5LleGb.js +0 -384
- package/dist/date-range-picker-B5uFWsm-.js +0 -562
- package/dist/file-dropzone-pR4v7owg.js +0 -457
- package/dist/mention-input-BcQKX2EJ.js +0 -599
- package/dist/menu-xwOOUtWP.js +0 -275
- package/dist/pill-DO2gHzMb.js +0 -56
- package/dist/popover-QHcEvf9c.js +0 -119
- package/dist/slider-t0B5cecO.js +0 -477
- package/dist/switch-qwv8jQnR.js +0 -142
- package/dist/tabs-CAVJndX1.js +0 -203
- package/dist/tooltip-CkeiW9C1.js +0 -113
- package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
|
@@ -3,12 +3,12 @@ import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
|
3
3
|
import { t as n } from "./use-latest-callback-cj1OOQL6.js";
|
|
4
4
|
import { t as r } from "./use-controlled-state-DpeVQZNR.js";
|
|
5
5
|
import { t as i } from "./renderable-DzcIj1Lo.js";
|
|
6
|
-
import { t as a } from "./overlay-layer-
|
|
6
|
+
import { t as a } from "./overlay-layer-qEbpEtb8.js";
|
|
7
7
|
import { a as o, i as s, n as c, o as l, r as u, s as d, t as f } from "./listbox-style-WX-RASp1.js";
|
|
8
8
|
import { a as p, r as m, t as h } from "./collection-registry-k6JcD3Jr.js";
|
|
9
9
|
import { t as g } from "./overlay-portal-C4JZFq2M.js";
|
|
10
|
-
import { t as _ } from "./use-overlay-floating-
|
|
11
|
-
import { t as v } from "./text-field-
|
|
10
|
+
import { t as _ } from "./use-overlay-floating-Bx2jBKAA.js";
|
|
11
|
+
import { t as v } from "./text-field-hU72iSVS.js";
|
|
12
12
|
import { createContext as y, useCallback as b, useContext as x, useId as S, useLayoutEffect as C, useMemo as w, useRef as T, useState as E } from "react";
|
|
13
13
|
import { vars as D } from "@jfrader/tokens/vars";
|
|
14
14
|
import { jsx as O, jsxs as ee } from "@emotion/react/jsx-runtime";
|
|
@@ -25,19 +25,19 @@ function B(e) {
|
|
|
25
25
|
if (!x(R)) throw Error(`Combobox.${e} must be rendered inside <Combobox.List>.`);
|
|
26
26
|
return t;
|
|
27
27
|
}
|
|
28
|
-
var
|
|
28
|
+
var V = e({ "&[hidden]": { display: "none" } }), H = e({
|
|
29
29
|
paddingBlock: D.space[1],
|
|
30
30
|
paddingInline: D.space[2],
|
|
31
31
|
fontSize: D.textSize.sm,
|
|
32
32
|
color: D.color.textMuted
|
|
33
33
|
});
|
|
34
|
-
function
|
|
35
|
-
let f = S(), [m, h] = E(`${f}-listbox`), [g, v] = E(!1), [y = null,
|
|
34
|
+
function U({ value: e, defaultValue: t, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, name: c, filter: l = I, onInputChange: u, children: d }) {
|
|
35
|
+
let f = S(), [m, h] = E(`${f}-listbox`), [g, v] = E(!1), [y, x] = E(), [C = null, D] = r(e, t ?? null, i), [k = !1, M] = r(a, o, s), [P, F] = E(null), [R, z] = E(""), [B, V] = p(), [H, U] = E(null), W = T([]), G = T(null), K = n(u), q = b((e, t) => t === "" || l(e, t), [l]), { valuesByIndex: J, skippedIndices: Y, matchCount: X } = w(() => {
|
|
36
36
|
let e = [], t = /* @__PURE__ */ new Set(), n = 0;
|
|
37
|
-
return
|
|
37
|
+
return B.forEach((r, i) => {
|
|
38
38
|
if (r.index === -1) return;
|
|
39
39
|
e[r.index] = i;
|
|
40
|
-
let a =
|
|
40
|
+
let a = q(r.label, R);
|
|
41
41
|
a && (n += 1), (r.disabled || !a) && t.add(r.index);
|
|
42
42
|
}), {
|
|
43
43
|
valuesByIndex: e,
|
|
@@ -45,130 +45,132 @@ function H({ value: e, defaultValue: t, onValueChange: i, open: a, defaultOpen:
|
|
|
45
45
|
matchCount: n
|
|
46
46
|
};
|
|
47
47
|
}, [
|
|
48
|
+
B,
|
|
48
49
|
R,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
open: C,
|
|
50
|
+
q
|
|
51
|
+
]), { refs: ne, floatingStyles: Z, context: Q } = _({
|
|
52
|
+
open: k,
|
|
53
53
|
placement: N,
|
|
54
|
-
onOpenChange: (e) =>
|
|
55
|
-
}),
|
|
54
|
+
onOpenChange: (e) => M(e)
|
|
55
|
+
}), re = te(Q, {
|
|
56
56
|
escapeKey: !0,
|
|
57
57
|
outsidePress: !0
|
|
58
|
-
}),
|
|
59
|
-
listRef:
|
|
60
|
-
activeIndex:
|
|
61
|
-
onNavigate:
|
|
58
|
+
}), ie = j(Q, {
|
|
59
|
+
listRef: W,
|
|
60
|
+
activeIndex: P,
|
|
61
|
+
onNavigate: F,
|
|
62
62
|
virtual: !0,
|
|
63
63
|
loop: !0,
|
|
64
|
-
disabledIndices: (e) =>
|
|
65
|
-
}), { getReferenceProps:
|
|
64
|
+
disabledIndices: (e) => Y.has(e)
|
|
65
|
+
}), { getReferenceProps: $, getFloatingProps: ae, getItemProps: oe } = A([re, ie]), se = w(() => {
|
|
66
66
|
let e = (e) => {
|
|
67
|
-
|
|
67
|
+
D(e), M(!1), G.current?.commitLabel(B.get(e)?.label ?? "");
|
|
68
68
|
};
|
|
69
69
|
return {
|
|
70
70
|
baseId: f,
|
|
71
71
|
listId: m,
|
|
72
72
|
setListId: h,
|
|
73
73
|
setInputDisabled: v,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
74
|
+
setInputForm: x,
|
|
75
|
+
open: k,
|
|
76
|
+
selectedValue: C,
|
|
77
|
+
activeIndex: P,
|
|
78
|
+
options: B,
|
|
79
|
+
matchCount: X,
|
|
80
|
+
inputLabelling: H,
|
|
81
|
+
inputHandleRef: G,
|
|
82
|
+
refs: ne,
|
|
83
|
+
floatingStyles: Z,
|
|
84
|
+
elementsRef: W,
|
|
85
|
+
getReferenceProps: $,
|
|
86
|
+
getFloatingProps: ae,
|
|
87
|
+
getItemProps: oe,
|
|
88
|
+
onInputChange: K,
|
|
89
|
+
isVisible: (e) => q(e, R),
|
|
89
90
|
findMatches: (e) => {
|
|
90
91
|
let t = 0, n = null, r = null;
|
|
91
|
-
return
|
|
92
|
-
i.index !== -1 &&
|
|
92
|
+
return B.forEach((i) => {
|
|
93
|
+
i.index !== -1 && q(i.label, e) && (t += 1, !i.disabled && ((n === null || i.index < n) && (n = i.index), (r === null || i.index > r) && (r = i.index)));
|
|
93
94
|
}), {
|
|
94
95
|
count: t,
|
|
95
96
|
first: n,
|
|
96
97
|
last: r
|
|
97
98
|
};
|
|
98
99
|
},
|
|
99
|
-
setQuery:
|
|
100
|
-
setActiveIndex:
|
|
100
|
+
setQuery: z,
|
|
101
|
+
setActiveIndex: F,
|
|
101
102
|
selectValue: e,
|
|
102
103
|
selectIndex: (t) => {
|
|
103
|
-
let n =
|
|
104
|
-
n === void 0 ||
|
|
104
|
+
let n = J[t];
|
|
105
|
+
n === void 0 || Y.has(t) || e(n);
|
|
105
106
|
},
|
|
106
|
-
clearValue: () =>
|
|
107
|
-
requestOpenChange:
|
|
108
|
-
registration:
|
|
109
|
-
setInputLabelling:
|
|
107
|
+
clearValue: () => D(null),
|
|
108
|
+
requestOpenChange: M,
|
|
109
|
+
registration: V,
|
|
110
|
+
setInputLabelling: U
|
|
110
111
|
};
|
|
111
112
|
}, [
|
|
112
113
|
f,
|
|
113
114
|
m,
|
|
114
|
-
C,
|
|
115
|
-
y,
|
|
116
115
|
k,
|
|
117
|
-
|
|
116
|
+
C,
|
|
118
117
|
P,
|
|
119
|
-
q,
|
|
120
118
|
B,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
R,
|
|
120
|
+
X,
|
|
121
|
+
H,
|
|
122
|
+
ne,
|
|
123
|
+
Z,
|
|
124
124
|
$,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
W,
|
|
128
|
-
G,
|
|
125
|
+
ae,
|
|
126
|
+
oe,
|
|
129
127
|
K,
|
|
130
|
-
|
|
128
|
+
q,
|
|
129
|
+
J,
|
|
130
|
+
Y,
|
|
131
131
|
D,
|
|
132
|
-
|
|
132
|
+
M,
|
|
133
|
+
V
|
|
133
134
|
]);
|
|
134
135
|
return /* @__PURE__ */ ee(L.Provider, {
|
|
135
|
-
value:
|
|
136
|
+
value: se,
|
|
136
137
|
children: [d, c !== void 0 && /* @__PURE__ */ O("input", {
|
|
137
138
|
type: "hidden",
|
|
138
139
|
name: c,
|
|
139
|
-
|
|
140
|
+
form: y,
|
|
141
|
+
value: C ?? "",
|
|
140
142
|
disabled: g
|
|
141
143
|
})]
|
|
142
144
|
});
|
|
143
145
|
}
|
|
144
|
-
function
|
|
145
|
-
return /* @__PURE__ */ O(a, { children: /* @__PURE__ */ O(
|
|
146
|
+
function W(e) {
|
|
147
|
+
return /* @__PURE__ */ O(a, { children: /* @__PURE__ */ O(U, { ...e }) });
|
|
146
148
|
}
|
|
147
|
-
|
|
148
|
-
function
|
|
149
|
-
let { listId: y, open: b, selectedValue: x, activeIndex: w, options: T, inputHandleRef: D, refs: ee, getReferenceProps: k, onInputChange: te, findMatches: A, setQuery: j, setActiveIndex: N, selectIndex: P, clearValue: F, requestOpenChange: I, setInputLabelling: L, setInputDisabled: R } = z("Input"),
|
|
150
|
-
re(e), t === void 0 &&
|
|
151
|
-
}, $ = t !== void 0 ||
|
|
152
|
-
|
|
149
|
+
W.displayName = "Combobox";
|
|
150
|
+
function G({ 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, ..._ }) {
|
|
151
|
+
let { listId: y, open: b, selectedValue: x, activeIndex: w, options: T, inputHandleRef: D, refs: ee, getReferenceProps: k, onInputChange: te, findMatches: A, setQuery: j, setActiveIndex: N, selectIndex: P, clearValue: F, requestOpenChange: I, setInputLabelling: L, setInputDisabled: R, setInputForm: B } = z("Input"), V = M([ee.setReference, e]), H = S(), U = f ?? H, W = `${U}-label`, G = i(a), K = _["aria-labelledby"], q = _["aria-label"], [J, Y] = E(n), [X, ne] = E(() => (t ?? n) !== void 0), Z = x === null ? void 0 : T.get(x)?.label, Q = t ?? (X ? J ?? "" : Z ?? J ?? ""), [, re] = r(Q, void 0, te), ie = (e) => {
|
|
152
|
+
re(e), t === void 0 && Y(e);
|
|
153
|
+
}, $ = t !== void 0 || X ? Q : "", ae = (e) => {
|
|
154
|
+
ne(!1), ie(e);
|
|
153
155
|
};
|
|
154
156
|
C(() => {
|
|
155
157
|
j($);
|
|
156
|
-
}, [$, j]), C(() => (R(g), () => R(!1)), [g, R]), C(() => (D.current = { commitLabel:
|
|
158
|
+
}, [$, j]), C(() => (R(g), () => R(!1)), [g, R]), C(() => (B(_.form), () => B(void 0)), [_.form, B]), C(() => (D.current = { commitLabel: ae }, () => {
|
|
157
159
|
D.current = null;
|
|
158
|
-
})), C(() => (L(
|
|
159
|
-
labelledBy:
|
|
160
|
-
label:
|
|
161
|
-
} : { labelledBy:
|
|
162
|
-
|
|
160
|
+
})), C(() => (L(K !== void 0 || !G ? {
|
|
161
|
+
labelledBy: K,
|
|
162
|
+
label: q
|
|
163
|
+
} : { labelledBy: W }), () => L(null)), [
|
|
164
|
+
K,
|
|
165
|
+
q,
|
|
163
166
|
G,
|
|
164
|
-
|
|
165
|
-
H,
|
|
167
|
+
W,
|
|
166
168
|
L
|
|
167
169
|
]);
|
|
168
|
-
let
|
|
170
|
+
let oe = (e) => {
|
|
169
171
|
p?.(e);
|
|
170
172
|
let n = e.currentTarget.value;
|
|
171
|
-
|
|
173
|
+
ne(!0), ie(n), n === "" && F();
|
|
172
174
|
let r = t ?? n;
|
|
173
175
|
if (r === "") {
|
|
174
176
|
N(null), I(!1);
|
|
@@ -176,9 +178,9 @@ function W({ ref: e, inputValue: t, defaultInputValue: n, label: a, description:
|
|
|
176
178
|
}
|
|
177
179
|
let i = A(r);
|
|
178
180
|
N(i.first), i.count > 0 && I(!0);
|
|
179
|
-
},
|
|
181
|
+
}, se = (e) => {
|
|
180
182
|
if (m?.(e), !e.defaultPrevented) {
|
|
181
|
-
if (e.key === "Escape")
|
|
183
|
+
if (e.key === "Escape") X && Z !== void 0 && ae(Z);
|
|
182
184
|
else if (b) {
|
|
183
185
|
if (e.key === "Enter" && w !== null) e.preventDefault(), P(w);
|
|
184
186
|
else if (e.key === "Home" || e.key === "End") {
|
|
@@ -188,19 +190,22 @@ function W({ ref: e, inputValue: t, defaultInputValue: n, label: a, description:
|
|
|
188
190
|
}
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
|
-
},
|
|
193
|
+
}, ce = (e) => {
|
|
192
194
|
h?.(e), b && I(!1);
|
|
193
|
-
}
|
|
195
|
+
}, le = k({
|
|
196
|
+
..._,
|
|
197
|
+
onKeyDown: se,
|
|
198
|
+
onBlur: ce
|
|
199
|
+
});
|
|
194
200
|
return /* @__PURE__ */ O(v, {
|
|
195
|
-
...
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
id: H,
|
|
201
|
+
...le,
|
|
202
|
+
onKeyDown: (e) => {
|
|
203
|
+
e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 ? m?.(e) : le.onKeyDown?.(e);
|
|
204
|
+
},
|
|
205
|
+
ref: V,
|
|
206
|
+
id: U,
|
|
207
|
+
label: G ? /* @__PURE__ */ O("span", {
|
|
208
|
+
id: W,
|
|
204
209
|
children: a
|
|
205
210
|
}) : a,
|
|
206
211
|
description: o,
|
|
@@ -209,9 +214,9 @@ function W({ ref: e, inputValue: t, defaultInputValue: n, label: a, description:
|
|
|
209
214
|
slotProps: l,
|
|
210
215
|
className: u,
|
|
211
216
|
sx: d,
|
|
212
|
-
value:
|
|
217
|
+
value: Q,
|
|
213
218
|
disabled: g,
|
|
214
|
-
onChange:
|
|
219
|
+
onChange: oe,
|
|
215
220
|
role: "combobox",
|
|
216
221
|
autoComplete: "off",
|
|
217
222
|
"aria-autocomplete": "list",
|
|
@@ -221,8 +226,8 @@ function W({ ref: e, inputValue: t, defaultInputValue: n, label: a, description:
|
|
|
221
226
|
"data-ui": "combobox-input"
|
|
222
227
|
});
|
|
223
228
|
}
|
|
224
|
-
|
|
225
|
-
function
|
|
229
|
+
G.displayName = "Combobox.Input";
|
|
230
|
+
function K({ ref: e, id: n, style: r, onMouseDown: i, children: a, className: o, sx: s, ...c }) {
|
|
226
231
|
let { baseId: u, setListId: f, open: p, inputLabelling: m, refs: h, floatingStyles: _, elementsRef: v, getFloatingProps: y } = z("List"), b = n ?? `${u}-listbox`;
|
|
227
232
|
C(() => (f(b), () => f(`${u}-listbox`)), [
|
|
228
233
|
u,
|
|
@@ -263,8 +268,8 @@ function G({ ref: e, id: n, style: r, onMouseDown: i, children: a, className: o,
|
|
|
263
268
|
})
|
|
264
269
|
}) });
|
|
265
270
|
}
|
|
266
|
-
|
|
267
|
-
function
|
|
271
|
+
K.displayName = "Combobox.List";
|
|
272
|
+
function q({ ref: e, value: n, disabled: r = !1, onClick: i, children: a, className: l, sx: d, ...p }) {
|
|
268
273
|
let { baseId: g, selectedValue: _, activeIndex: v, options: y, isVisible: b, getItemProps: x, selectValue: S, registration: C } = B("Item"), w = T(null), { ref: E, index: D } = m(n, C, w, (e, t) => ({
|
|
269
274
|
index: e,
|
|
270
275
|
label: t,
|
|
@@ -278,7 +283,7 @@ function K({ ref: e, value: n, disabled: r = !1, onClick: i, children: a, classN
|
|
|
278
283
|
c,
|
|
279
284
|
f,
|
|
280
285
|
s,
|
|
281
|
-
|
|
286
|
+
V
|
|
282
287
|
],
|
|
283
288
|
sx: d,
|
|
284
289
|
children: (e) => /* @__PURE__ */ ee("div", {
|
|
@@ -307,12 +312,12 @@ function K({ ref: e, value: n, disabled: r = !1, onClick: i, children: a, classN
|
|
|
307
312
|
})
|
|
308
313
|
});
|
|
309
314
|
}
|
|
310
|
-
|
|
311
|
-
function
|
|
315
|
+
q.displayName = "Combobox.Item";
|
|
316
|
+
function J({ ref: e, children: n, className: r, sx: a, ...o }) {
|
|
312
317
|
let { matchCount: s } = B("Empty");
|
|
313
318
|
return s > 0 ? null : /* @__PURE__ */ O(t, {
|
|
314
319
|
className: r,
|
|
315
|
-
styles:
|
|
320
|
+
styles: H,
|
|
316
321
|
sx: a,
|
|
317
322
|
children: (t) => /* @__PURE__ */ O("div", {
|
|
318
323
|
...o,
|
|
@@ -323,12 +328,12 @@ function q({ ref: e, children: n, className: r, sx: a, ...o }) {
|
|
|
323
328
|
})
|
|
324
329
|
});
|
|
325
330
|
}
|
|
326
|
-
|
|
327
|
-
var
|
|
328
|
-
Input:
|
|
329
|
-
List:
|
|
330
|
-
Item:
|
|
331
|
-
Empty:
|
|
331
|
+
J.displayName = "Combobox.Empty";
|
|
332
|
+
var Y = Object.assign(W, {
|
|
333
|
+
Input: G,
|
|
334
|
+
List: K,
|
|
335
|
+
Item: q,
|
|
336
|
+
Empty: J
|
|
332
337
|
});
|
|
333
338
|
//#endregion
|
|
334
|
-
export {
|
|
339
|
+
export { Y 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-DFFqOBCi.js";
|