@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
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { t as r } from "./use-controlled-state-DpeVQZNR.js";
|
|
5
|
+
import { t as i } from "./visually-hidden-BJdvqqvn.js";
|
|
6
|
+
import { t as a } from "./renderable-DzcIj1Lo.js";
|
|
7
|
+
import { n as o, t as s } from "./surface-DZ4d-2aL.js";
|
|
8
|
+
import { t as c } from "./trigger-style-B1KVC8O1.js";
|
|
9
|
+
import { t as l } from "./overlay-layer-qEbpEtb8.js";
|
|
10
|
+
import { i as u, r as d, t as f } from "./use-native-dialog-DWpIUVO1.js";
|
|
11
|
+
import { n as p, t as m } from "./listbox-style-WX-RASp1.js";
|
|
12
|
+
import { a as h, r as g, t as _ } from "./collection-registry-k6JcD3Jr.js";
|
|
13
|
+
import { createContext as v, useCallback as y, useContext as b, useId as x, useMemo as S, useRef as C, useState as w } from "react";
|
|
14
|
+
import { vars as T } from "@jfrader/tokens/vars";
|
|
15
|
+
import { jsx as E, jsxs as D } from "@emotion/react/jsx-runtime";
|
|
16
|
+
import { FloatingList as O, useFloatingRootContext as k, useInteractions as A, useListNavigation as j, useMergeRefs as M } from "@floating-ui/react";
|
|
17
|
+
//#region src/components/command-palette/command-palette.styles.ts
|
|
18
|
+
var N = e({
|
|
19
|
+
...s,
|
|
20
|
+
marginBlockStart: T.space[12]
|
|
21
|
+
}), P = e({
|
|
22
|
+
...o,
|
|
23
|
+
display: "flex",
|
|
24
|
+
flexDirection: "column",
|
|
25
|
+
borderRadius: T.radius.lg,
|
|
26
|
+
boxShadow: T.shadow.floating,
|
|
27
|
+
inlineSize: "min(560px, calc(100vw - 32px))"
|
|
28
|
+
}), F = e({
|
|
29
|
+
boxSizing: "border-box",
|
|
30
|
+
inlineSize: "100%",
|
|
31
|
+
blockSize: "48px",
|
|
32
|
+
margin: 0,
|
|
33
|
+
border: 0,
|
|
34
|
+
borderBlockEnd: `1px solid ${T.color.borderControl}`,
|
|
35
|
+
borderStartStartRadius: T.radius.lg,
|
|
36
|
+
borderStartEndRadius: T.radius.lg,
|
|
37
|
+
backgroundColor: "transparent",
|
|
38
|
+
paddingInline: T.space[4],
|
|
39
|
+
font: "inherit",
|
|
40
|
+
fontSize: T.textSize.md,
|
|
41
|
+
color: T.color.text,
|
|
42
|
+
"&::placeholder": { color: T.color.textSubtle },
|
|
43
|
+
"&:focus-visible": { ...n }
|
|
44
|
+
}), I = e({
|
|
45
|
+
boxSizing: "border-box",
|
|
46
|
+
display: "flex",
|
|
47
|
+
flexDirection: "column",
|
|
48
|
+
maxBlockSize: "320px",
|
|
49
|
+
overflow: "auto",
|
|
50
|
+
padding: T.space[1],
|
|
51
|
+
"&[hidden]": { display: "none" }
|
|
52
|
+
}), L = e({
|
|
53
|
+
display: "flex",
|
|
54
|
+
flexDirection: "column",
|
|
55
|
+
"&[hidden]": { display: "none" }
|
|
56
|
+
}), ee = e({
|
|
57
|
+
paddingBlock: T.space[1],
|
|
58
|
+
paddingInline: T.space[2],
|
|
59
|
+
fontSize: T.textSize.xs,
|
|
60
|
+
fontWeight: T.fontWeight.medium,
|
|
61
|
+
color: T.color.textMuted
|
|
62
|
+
}), te = e({
|
|
63
|
+
minInlineSize: 0,
|
|
64
|
+
overflowWrap: "anywhere",
|
|
65
|
+
"&[hidden]": { display: "none" }
|
|
66
|
+
}), R = e({
|
|
67
|
+
paddingBlock: T.space[6],
|
|
68
|
+
paddingInline: T.space[4],
|
|
69
|
+
textAlign: "center",
|
|
70
|
+
fontSize: T.textSize.sm,
|
|
71
|
+
color: T.color.textMuted
|
|
72
|
+
}), ne = "Command palette", re = "No results", z = new Intl.PluralRules("en"), ie = (e, t) => e.toLocaleLowerCase().includes(t.toLocaleLowerCase()), ae = (e) => `${e} ${z.select(e) === "one" ? "result" : "results"}`, B = v(null), V = v(null);
|
|
73
|
+
function H(e) {
|
|
74
|
+
let t = b(B);
|
|
75
|
+
if (!t) throw Error(`CommandPalette.${e} must be rendered inside <CommandPalette>.`);
|
|
76
|
+
return t;
|
|
77
|
+
}
|
|
78
|
+
var U = (e) => {
|
|
79
|
+
e?.setAttribute("autofocus", "");
|
|
80
|
+
};
|
|
81
|
+
function W({ open: e, defaultOpen: t = !1, onOpenChange: n, label: i = ne, filter: a = ie, emptyMessage: o = re, formatResultCount: s = ae, children: c }) {
|
|
82
|
+
let l = x(), [d = !1, f] = r(e, t, n), { dialogElementRef: p, setDialogElement: m, setOpen: g, requestClose: _, repairToken: v } = u(d, f), [b, T] = w(""), [D, O] = w(!1), [M, N] = w(null), [P, F] = h(), [I, L] = w(null), [ee, te] = w(null), [R, z] = w(d), V = C([]);
|
|
83
|
+
d !== R && (z(d), d && (T(""), O(!1), N(null)));
|
|
84
|
+
let H = y(() => {
|
|
85
|
+
g(!(d && p.current?.open));
|
|
86
|
+
}, [
|
|
87
|
+
d,
|
|
88
|
+
g,
|
|
89
|
+
p
|
|
90
|
+
]), { matchedValues: U, matchedIndices: W, visibleGroupIds: G } = S(() => {
|
|
91
|
+
let e = /* @__PURE__ */ new Set(), t = [], n = /* @__PURE__ */ new Set();
|
|
92
|
+
return P.forEach((r, i) => {
|
|
93
|
+
r.index !== -1 && (b === "" || a(r.label, b) || r.keywords !== void 0 && a(r.keywords, b)) && (e.add(i), r.disabled || t.push(r.index), r.groupId !== null && n.add(r.groupId));
|
|
94
|
+
}), t.sort((e, t) => e - t), {
|
|
95
|
+
matchedValues: e,
|
|
96
|
+
matchedIndices: t,
|
|
97
|
+
visibleGroupIds: n
|
|
98
|
+
};
|
|
99
|
+
}, [
|
|
100
|
+
P,
|
|
101
|
+
b,
|
|
102
|
+
a
|
|
103
|
+
]), K = S(() => new Set(W), [W]), q = M !== null && K.has(M) ? M : W[0] ?? null, J = k({
|
|
104
|
+
open: d,
|
|
105
|
+
onOpenChange: (e) => g(e),
|
|
106
|
+
elements: {
|
|
107
|
+
reference: I,
|
|
108
|
+
floating: ee
|
|
109
|
+
}
|
|
110
|
+
}), Y = j(J, {
|
|
111
|
+
listRef: V,
|
|
112
|
+
activeIndex: q,
|
|
113
|
+
onNavigate: (e) => {
|
|
114
|
+
e !== null && N(e);
|
|
115
|
+
},
|
|
116
|
+
virtual: !0,
|
|
117
|
+
loop: !0,
|
|
118
|
+
focusItemOnOpen: !1,
|
|
119
|
+
disabledIndices: (e) => !K.has(e)
|
|
120
|
+
}), { getReferenceProps: X, getFloatingProps: Z, getItemProps: Q } = A([Y]), $ = U.size, oe = D ? s($) : "", se = S(() => ({
|
|
121
|
+
open: d,
|
|
122
|
+
setOpen: g,
|
|
123
|
+
toggleOpen: H,
|
|
124
|
+
requestClose: _,
|
|
125
|
+
repairToken: v,
|
|
126
|
+
setDialogElement: m,
|
|
127
|
+
label: i,
|
|
128
|
+
emptyMessage: o,
|
|
129
|
+
baseId: l,
|
|
130
|
+
listId: `${l}-list`,
|
|
131
|
+
query: b,
|
|
132
|
+
announcement: oe,
|
|
133
|
+
matchCount: $,
|
|
134
|
+
matchedValues: U,
|
|
135
|
+
visibleGroupIds: G,
|
|
136
|
+
activeIndex: q,
|
|
137
|
+
elementsRef: V,
|
|
138
|
+
setInputElement: L,
|
|
139
|
+
setListElement: te,
|
|
140
|
+
getReferenceProps: X,
|
|
141
|
+
getFloatingProps: Z,
|
|
142
|
+
getItemProps: Q,
|
|
143
|
+
changeQuery: (e) => {
|
|
144
|
+
T(e), O(!0), N(null);
|
|
145
|
+
},
|
|
146
|
+
moveToEdge: (e) => {
|
|
147
|
+
let t = e === "first" ? W[0] : W[W.length - 1];
|
|
148
|
+
t !== void 0 && N(t);
|
|
149
|
+
},
|
|
150
|
+
registration: F
|
|
151
|
+
}), [
|
|
152
|
+
d,
|
|
153
|
+
g,
|
|
154
|
+
H,
|
|
155
|
+
_,
|
|
156
|
+
v,
|
|
157
|
+
m,
|
|
158
|
+
i,
|
|
159
|
+
o,
|
|
160
|
+
l,
|
|
161
|
+
b,
|
|
162
|
+
oe,
|
|
163
|
+
$,
|
|
164
|
+
U,
|
|
165
|
+
W,
|
|
166
|
+
G,
|
|
167
|
+
q,
|
|
168
|
+
X,
|
|
169
|
+
Z,
|
|
170
|
+
Q,
|
|
171
|
+
F
|
|
172
|
+
]);
|
|
173
|
+
return /* @__PURE__ */ E(B.Provider, {
|
|
174
|
+
value: se,
|
|
175
|
+
children: c
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
function G(e) {
|
|
179
|
+
return /* @__PURE__ */ E(l, { children: /* @__PURE__ */ E(W, { ...e }) });
|
|
180
|
+
}
|
|
181
|
+
G.displayName = "CommandPalette";
|
|
182
|
+
function K({ ref: e, onClick: n, className: r, sx: i, ...a }) {
|
|
183
|
+
let { open: o, toggleOpen: s } = H("Trigger"), l = (e) => {
|
|
184
|
+
n?.(e), e.defaultPrevented || s();
|
|
185
|
+
};
|
|
186
|
+
return /* @__PURE__ */ E(t, {
|
|
187
|
+
className: r,
|
|
188
|
+
styles: c,
|
|
189
|
+
sx: i,
|
|
190
|
+
children: (t) => /* @__PURE__ */ E("button", {
|
|
191
|
+
type: "button",
|
|
192
|
+
...a,
|
|
193
|
+
ref: e,
|
|
194
|
+
"data-ui": "command-palette-trigger",
|
|
195
|
+
"aria-haspopup": "dialog",
|
|
196
|
+
"aria-expanded": o,
|
|
197
|
+
onClick: l,
|
|
198
|
+
className: t
|
|
199
|
+
})
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
K.displayName = "CommandPalette.Trigger";
|
|
203
|
+
function q({ ref: e, className: n, sx: r, ...a }) {
|
|
204
|
+
let { children: o, onCancel: s, onClick: c, onClose: l, ...u } = f(a), p = H("Content"), { label: m, announcement: h } = p, g = d(p, {
|
|
205
|
+
onCancel: s,
|
|
206
|
+
onClick: c,
|
|
207
|
+
onClose: l
|
|
208
|
+
}, e);
|
|
209
|
+
return /* @__PURE__ */ E(t, {
|
|
210
|
+
className: n,
|
|
211
|
+
styles: N,
|
|
212
|
+
sx: r,
|
|
213
|
+
children: (e) => /* @__PURE__ */ E("dialog", {
|
|
214
|
+
"aria-label": m,
|
|
215
|
+
...u,
|
|
216
|
+
...g,
|
|
217
|
+
"data-ui": "command-palette",
|
|
218
|
+
"aria-modal": "true",
|
|
219
|
+
className: e,
|
|
220
|
+
children: /* @__PURE__ */ D("div", {
|
|
221
|
+
css: P,
|
|
222
|
+
children: [o, /* @__PURE__ */ E("div", {
|
|
223
|
+
role: "status",
|
|
224
|
+
"aria-live": "polite",
|
|
225
|
+
"aria-atomic": "true",
|
|
226
|
+
css: i,
|
|
227
|
+
children: h
|
|
228
|
+
})]
|
|
229
|
+
})
|
|
230
|
+
})
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
q.displayName = "CommandPalette.Content";
|
|
234
|
+
function J({ ref: e, onChange: n, onKeyDown: r, className: i, sx: a, ...o }) {
|
|
235
|
+
let { label: s, listId: c, query: l, matchCount: u, activeIndex: d, elementsRef: f, requestClose: p, setInputElement: m, getReferenceProps: h, changeQuery: g, moveToEdge: _ } = H("Input"), v = M([
|
|
236
|
+
m,
|
|
237
|
+
U,
|
|
238
|
+
e
|
|
239
|
+
]), y = (e) => {
|
|
240
|
+
n?.(e), g(e.currentTarget.value);
|
|
241
|
+
}, b = (e) => {
|
|
242
|
+
r?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing) && (e.key === "Escape" ? (e.preventDefault(), p()) : (e.key === "Home" || e.key === "End") && !e.shiftKey && !e.ctrlKey && !e.metaKey && !e.altKey ? (e.preventDefault(), _(e.key === "Home" ? "first" : "last")) : e.key === "Enter" && d !== null && (e.preventDefault(), f.current[d]?.click()));
|
|
243
|
+
};
|
|
244
|
+
return /* @__PURE__ */ E(t, {
|
|
245
|
+
className: i,
|
|
246
|
+
styles: F,
|
|
247
|
+
sx: a,
|
|
248
|
+
children: (e) => /* @__PURE__ */ E("input", {
|
|
249
|
+
"aria-label": s,
|
|
250
|
+
autoComplete: "off",
|
|
251
|
+
spellCheck: !1,
|
|
252
|
+
...h({
|
|
253
|
+
...o,
|
|
254
|
+
onChange: y,
|
|
255
|
+
onKeyDown: b
|
|
256
|
+
}),
|
|
257
|
+
ref: v,
|
|
258
|
+
type: "text",
|
|
259
|
+
value: l,
|
|
260
|
+
role: "combobox",
|
|
261
|
+
"aria-autocomplete": "list",
|
|
262
|
+
"aria-expanded": u > 0,
|
|
263
|
+
"aria-controls": c,
|
|
264
|
+
"data-ui": "command-palette-input",
|
|
265
|
+
className: e
|
|
266
|
+
})
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
J.displayName = "CommandPalette.Input";
|
|
270
|
+
function Y({ ref: e, onMouseDown: n, children: r, className: i, sx: a, ...o }) {
|
|
271
|
+
let { label: s, listId: c, matchCount: l, elementsRef: u, setListElement: d, getFloatingProps: f } = H("List"), p = M([d, e]), m = (e) => {
|
|
272
|
+
n?.(e), e.preventDefault();
|
|
273
|
+
};
|
|
274
|
+
return /* @__PURE__ */ E(t, {
|
|
275
|
+
className: i,
|
|
276
|
+
styles: I,
|
|
277
|
+
sx: a,
|
|
278
|
+
children: (e) => /* @__PURE__ */ E("div", {
|
|
279
|
+
"aria-label": s,
|
|
280
|
+
...f({
|
|
281
|
+
...o,
|
|
282
|
+
onMouseDown: m
|
|
283
|
+
}),
|
|
284
|
+
ref: p,
|
|
285
|
+
id: c,
|
|
286
|
+
role: "listbox",
|
|
287
|
+
hidden: l === 0,
|
|
288
|
+
"data-ui": "command-palette-list",
|
|
289
|
+
className: e,
|
|
290
|
+
children: /* @__PURE__ */ E(O, {
|
|
291
|
+
elementsRef: u,
|
|
292
|
+
children: r
|
|
293
|
+
})
|
|
294
|
+
})
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
Y.displayName = "CommandPalette.List";
|
|
298
|
+
function X({ ref: e, children: n, className: r, sx: i, ...o }) {
|
|
299
|
+
let { matchCount: s, emptyMessage: c } = H("Empty");
|
|
300
|
+
return s > 0 ? null : /* @__PURE__ */ E(t, {
|
|
301
|
+
className: r,
|
|
302
|
+
styles: R,
|
|
303
|
+
sx: i,
|
|
304
|
+
children: (t) => /* @__PURE__ */ E("div", {
|
|
305
|
+
...o,
|
|
306
|
+
ref: e,
|
|
307
|
+
"data-ui": "command-palette-empty",
|
|
308
|
+
className: t,
|
|
309
|
+
children: a(n) ? n : c
|
|
310
|
+
})
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
X.displayName = "CommandPalette.Empty";
|
|
314
|
+
function Z({ ref: e, label: n, children: r, "aria-labelledby": i, className: a, sx: o, ...s }) {
|
|
315
|
+
let { visibleGroupIds: c } = H("Group"), l = x(), u = `${l}-heading`;
|
|
316
|
+
return /* @__PURE__ */ E(t, {
|
|
317
|
+
className: a,
|
|
318
|
+
styles: L,
|
|
319
|
+
sx: o,
|
|
320
|
+
children: (t) => /* @__PURE__ */ D("div", {
|
|
321
|
+
...s,
|
|
322
|
+
ref: e,
|
|
323
|
+
role: "group",
|
|
324
|
+
"aria-labelledby": [i, u].filter(Boolean).join(" "),
|
|
325
|
+
hidden: !c.has(l),
|
|
326
|
+
"data-ui": "command-palette-group",
|
|
327
|
+
className: t,
|
|
328
|
+
children: [/* @__PURE__ */ E("div", {
|
|
329
|
+
id: u,
|
|
330
|
+
css: ee,
|
|
331
|
+
children: n
|
|
332
|
+
}), /* @__PURE__ */ E(V.Provider, {
|
|
333
|
+
value: l,
|
|
334
|
+
children: r
|
|
335
|
+
})]
|
|
336
|
+
})
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
Z.displayName = "CommandPalette.Group";
|
|
340
|
+
function Q({ ref: e, value: n, onSelect: r, keywords: i, "aria-disabled": a, onClick: o, children: s, className: c, sx: l, ...u }) {
|
|
341
|
+
let { baseId: d, activeIndex: f, matchedValues: h, getItemProps: v, setOpen: y, registration: x } = H("Item"), S = b(V), w = a === !0 || a === "true", T = C(null), { ref: D, index: O } = g(n, x, T, (e, t) => ({
|
|
342
|
+
index: e,
|
|
343
|
+
label: t,
|
|
344
|
+
disabled: w,
|
|
345
|
+
keywords: i,
|
|
346
|
+
groupId: S
|
|
347
|
+
})), k = M([
|
|
348
|
+
D,
|
|
349
|
+
T,
|
|
350
|
+
e
|
|
351
|
+
]), A = O !== -1 && f === O, j = (e) => {
|
|
352
|
+
o?.(e), !(e.defaultPrevented || w) && (r?.(), y(!1));
|
|
353
|
+
};
|
|
354
|
+
return /* @__PURE__ */ E(t, {
|
|
355
|
+
className: c,
|
|
356
|
+
styles: [
|
|
357
|
+
p,
|
|
358
|
+
m,
|
|
359
|
+
te
|
|
360
|
+
],
|
|
361
|
+
sx: l,
|
|
362
|
+
children: (e) => /* @__PURE__ */ E("div", {
|
|
363
|
+
...v({
|
|
364
|
+
id: _(d, n),
|
|
365
|
+
...u,
|
|
366
|
+
onClick: j
|
|
367
|
+
}),
|
|
368
|
+
ref: k,
|
|
369
|
+
role: "option",
|
|
370
|
+
"aria-disabled": a,
|
|
371
|
+
"aria-selected": A,
|
|
372
|
+
hidden: !h.has(n),
|
|
373
|
+
"data-active": A || void 0,
|
|
374
|
+
"data-ui": "command-palette-item",
|
|
375
|
+
className: e,
|
|
376
|
+
children: s
|
|
377
|
+
})
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
Q.displayName = "CommandPalette.Item";
|
|
381
|
+
var $ = Object.assign(G, {
|
|
382
|
+
Trigger: K,
|
|
383
|
+
Content: q,
|
|
384
|
+
Input: J,
|
|
385
|
+
List: Y,
|
|
386
|
+
Empty: X,
|
|
387
|
+
Group: Z,
|
|
388
|
+
Item: Q
|
|
389
|
+
});
|
|
390
|
+
//#endregion
|
|
391
|
+
export { $ as t };
|
package/dist/command-palette.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as CommandPalette } from "./command-palette-
|
|
2
|
+
export { t as CommandPalette } from "./command-palette-BmQu2w4H.js";
|