@jfrader/ui 0.3.0 → 0.5.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/README.md +2 -0
- package/dist/{accordion-Bd-j04hW.js → accordion-xCI_u0BV.js} +2 -2
- package/dist/accordion.js +1 -1
- package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
- package/dist/alert.js +1 -1
- package/dist/announcement-bar-B58xempt.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-group-DOQQuV51.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/bottom-sheet-DPJBFkie.js +673 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-Cfw_hgt2.js} +1 -1
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-C92uYFJW.js} +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar-B3Svu0X2.js +447 -0
- package/dist/calendar.js +1 -1
- package/dist/carousel-IvPqN-oM.js +472 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-cFquiSdy.js} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DTQd_M-G.js +289 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-ahnRi-g8.js +292 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-Bhzvu9ma.js +334 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BQ5LleGb.js +384 -0
- package/dist/command-palette.js +1 -1
- package/dist/copy-button-ByiA6D3R.js +252 -0
- package/dist/copy-button.js +2 -0
- package/dist/countdown-Dp_TD1VP.js +293 -0
- package/dist/countdown.js +2 -0
- package/dist/date-picker-5zKSSuFF.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-B5uFWsm-.js +562 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-ciiv9H2b.js} +19 -19
- package/dist/dialog.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-C-qJcZ14.js +340 -0
- package/dist/expandable-card.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-pR4v7owg.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-D5KEKTSe.js +312 -0
- package/dist/filter-toolbar.js +2 -0
- package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
- package/dist/hold-to-confirm.js +2 -0
- package/dist/hover-card-B-nrCIy2.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-ciuhPtQZ.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +79 -38
- package/dist/inline-edit-C0eeml65.js +535 -0
- package/dist/inline-edit.js +2 -0
- package/dist/input-control-DmMuAuPS.js +34 -0
- package/dist/json-viewer-BcySQfjZ.js +798 -0
- package/dist/json-viewer.js +2 -0
- package/dist/listbox-style-WX-RASp1.js +59 -0
- package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
- package/dist/mention-input-BcQKX2EJ.js +599 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-xwOOUtWP.js +275 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card-Bh9K4fZs.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-Pce_IYnz.js +590 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-sP5fiuQS.js} +4 -4
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-SeUyyEPD.js +64 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-DmXZ8E85.js} +1 -1
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/popover-QHcEvf9c.js +119 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-CbOWBUdA.js} +4 -4
- package/dist/progress.js +1 -1
- package/dist/radio-cards-D2QZENI_.js +455 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-E6mMRgo7.js} +4 -4
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-BhjUVXZZ.js +519 -0
- package/dist/resizable-panels.js +2 -0
- package/dist/scroll-area-CcZyiSOQ.js +371 -0
- package/dist/scroll-area.js +2 -0
- package/dist/search-field-IxF0IJXm.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-yO1K1nbi.js +326 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-n_H52W1Z.js +292 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-q2SAsrdD.js +640 -0
- package/dist/signature-pad.js +2 -0
- package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/slider-t0B5cecO.js +477 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-tirqlLY2.js +365 -0
- package/dist/sortable-data-table.js +2 -0
- package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
- package/dist/spinner.js +1 -1
- package/dist/split-button-Cb3EHs64.js +268 -0
- package/dist/split-button.js +2 -0
- package/dist/stepper-CruHbXxX.js +480 -0
- package/dist/stepper.js +2 -0
- package/dist/swipe-actions-DiZC57-3.js +418 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/{switch-Dr-qjmT4.js → switch-qwv8jQnR.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{tabs-CK_g1RKa.js → tabs-CAVJndX1.js} +2 -2
- package/dist/tabs.js +1 -1
- package/dist/tag-input-DSRCyrX2.js +418 -0
- package/dist/tag-input.js +2 -0
- package/dist/{text-field-D60ok14S.js → text-field-C8TWG-tY.js} +6 -5
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-BrW0XcG_.js} +6 -5
- 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/time-picker-Db8D49cP.js +305 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-k3nURuCP.js +618 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-BHxI32ZA.js +352 -0
- package/dist/toast-stack-DqrAzdg5.js +183 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-fcjzpifI.js} +4 -4
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-CkeiW9C1.js +113 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-C2liIxqy.js +360 -0
- package/dist/tree-view.js +2 -0
- package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
- package/dist/types/components/announcement-bar/index.d.ts +2 -0
- package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
- package/dist/types/components/avatar-group/index.d.ts +2 -0
- package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
- package/dist/types/components/bottom-sheet/index.d.ts +2 -0
- package/dist/types/components/calendar/calendar.d.ts +25 -1
- package/dist/types/components/calendar/index.d.ts +1 -1
- package/dist/types/components/carousel/carousel.d.ts +73 -0
- package/dist/types/components/carousel/index.d.ts +2 -0
- package/dist/types/components/chip-group/chip-group.d.ts +54 -0
- package/dist/types/components/chip-group/index.d.ts +1 -0
- package/dist/types/components/code-block/code-block.d.ts +58 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/components/code-block/shiki.d.ts +3 -0
- package/dist/types/components/combobox/combobox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +1 -1
- package/dist/types/components/copy-button/copy-button.d.ts +49 -0
- package/dist/types/components/copy-button/index.d.ts +2 -0
- package/dist/types/components/countdown/countdown.d.ts +37 -0
- package/dist/types/components/countdown/index.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +1 -1
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
- package/dist/types/components/date-range-picker/index.d.ts +2 -0
- package/dist/types/components/drawer/drawer.d.ts +59 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/empty-state/empty-state.d.ts +36 -0
- package/dist/types/components/empty-state/index.d.ts +2 -0
- package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
- package/dist/types/components/expandable-card/index.d.ts +2 -0
- package/dist/types/components/field/field-anatomy.d.ts +4 -2
- package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
- package/dist/types/components/file-dropzone/index.d.ts +2 -0
- package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
- package/dist/types/components/filter-toolbar/index.d.ts +1 -0
- package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
- package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
- package/dist/types/components/hover-card/hover-card.d.ts +97 -0
- package/dist/types/components/hover-card/index.d.ts +2 -0
- package/dist/types/components/image-compare/image-compare.d.ts +54 -0
- package/dist/types/components/image-compare/index.d.ts +1 -0
- package/dist/types/components/inline-edit/index.d.ts +2 -0
- package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
- package/dist/types/components/json-viewer/index.d.ts +2 -0
- package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
- package/dist/types/components/mention-input/index.d.ts +2 -0
- package/dist/types/components/mention-input/mention-input.d.ts +87 -0
- package/dist/types/components/menu/menu.d.ts +23 -5
- package/dist/types/components/metric-card/index.d.ts +1 -0
- package/dist/types/components/metric-card/metric-card.d.ts +37 -0
- package/dist/types/components/multi-select/index.d.ts +2 -0
- package/dist/types/components/multi-select/multi-select.d.ts +73 -0
- package/dist/types/components/password-field/index.d.ts +2 -0
- package/dist/types/components/password-field/password-field.d.ts +34 -0
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/radio-cards/index.d.ts +1 -0
- package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
- package/dist/types/components/resizable-panels/index.d.ts +2 -0
- package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
- package/dist/types/components/scroll-area/index.d.ts +2 -0
- package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
- package/dist/types/components/search-field/index.d.ts +1 -0
- package/dist/types/components/search-field/search-field.d.ts +31 -0
- package/dist/types/components/segmented-control/index.d.ts +2 -0
- package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/signature-pad/index.d.ts +2 -0
- package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
- package/dist/types/components/slider/index.d.ts +1 -0
- package/dist/types/components/slider/slider.d.ts +70 -0
- package/dist/types/components/sortable-data-table/index.d.ts +1 -0
- package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
- package/dist/types/components/split-button/index.d.ts +2 -0
- package/dist/types/components/split-button/split-button.d.ts +55 -0
- package/dist/types/components/stepper/index.d.ts +2 -0
- package/dist/types/components/stepper/stepper.d.ts +85 -0
- package/dist/types/components/swipe-actions/index.d.ts +2 -0
- package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
- package/dist/types/components/tag-input/index.d.ts +2 -0
- package/dist/types/components/tag-input/tag-input.d.ts +66 -0
- package/dist/types/components/theme-root/theme-root.d.ts +9 -3
- package/dist/types/components/time-picker/index.d.ts +2 -0
- package/dist/types/components/time-picker/time-picker.d.ts +48 -0
- package/dist/types/components/timeline/index.d.ts +2 -0
- package/dist/types/components/timeline/timeline.d.ts +66 -0
- package/dist/types/components/toast/toast.d.ts +37 -2
- package/dist/types/components/toast-stack/index.d.ts +2 -0
- package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
- package/dist/types/components/tooltip/tooltip.d.ts +1 -1
- package/dist/types/components/tree-view/index.d.ts +1 -0
- package/dist/types/components/tree-view/tree-view.d.ts +47 -0
- package/dist/types/components/usage-meter/index.d.ts +2 -0
- package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
- package/dist/types/index.d.ts +40 -0
- package/dist/types/overlay/overlay-layer.d.ts +33 -0
- package/dist/types/overlay/overlay-portal.d.ts +7 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +11 -1
- package/dist/types/styling/media.d.ts +1 -0
- package/dist/types/styling/theme-scope.d.ts +19 -0
- package/dist/types/styling/theme.d.ts +12 -0
- package/dist/types/utils/use-controlled-state.d.ts +2 -1
- package/dist/usage-meter-qyQ3rYVv.js +463 -0
- package/dist/usage-meter.js +2 -0
- package/dist/use-controlled-state-DpeVQZNR.js +20 -0
- package/dist/use-latest-callback-cj1OOQL6.js +11 -0
- package/dist/use-overlay-floating-DvJifLpF.js +31 -0
- package/package.json +175 -3
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/collection-registry-BTYi6zGh.js +0 -98
- package/dist/combobox-DrmjBbo7.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-ClUYBIBh.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-DU60SMdt.js +0 -216
- package/dist/popover-BtN_0ejj.js +0 -113
- package/dist/select-BCS0-LVW.js +0 -286
- package/dist/theme-root-BiXXvQvr.js +0 -42
- package/dist/toast-iqelR-r0.js +0 -282
- package/dist/tooltip-CB-HC1js.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-efeqppiw.js +0 -19
|
@@ -1,327 +0,0 @@
|
|
|
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 { t as h } from "./use-overlay-floating-efeqppiw.js";
|
|
7
|
-
import { t as g } from "./text-field-D60ok14S.js";
|
|
8
|
-
import { createContext as _, useCallback as v, useContext as y, useId as b, useLayoutEffect as x, useMemo as S, useRef as C, useState as w } from "react";
|
|
9
|
-
import { vars as T } from "@jfrader/tokens/vars";
|
|
10
|
-
import { jsx as E, jsxs as ee } from "@emotion/react/jsx-runtime";
|
|
11
|
-
import { FloatingList as D, FloatingPortal as O, useDismiss as te, useInteractions as k, 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", ne = (e, t) => e.toLocaleLowerCase().includes(t.toLocaleLowerCase()), F = _(null), I = _(!1);
|
|
14
|
-
function L(e) {
|
|
15
|
-
let t = y(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 (!y(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: T.space[1],
|
|
26
|
-
paddingInline: T.space[2],
|
|
27
|
-
fontSize: T.textSize.sm,
|
|
28
|
-
color: T.color.textMuted
|
|
29
|
-
});
|
|
30
|
-
function V({ value: e, defaultValue: t, onValueChange: i, open: o, defaultOpen: s = !1, onOpenChange: c, name: l, filter: u = ne, onInputChange: d, children: f }) {
|
|
31
|
-
let p = b(), [m, g] = w(`${p}-listbox`), [_, y] = w(!1), [x = null, T] = r(e, t ?? null, i), [D = !1, O] = r(o, s, c), [j, N] = w(null), [P, I] = w(""), [L, R] = a(), [z, B] = w(null), V = C([]), H = C(null), U = n(d), W = v((e, t) => t === "" || u(e, t), [u]), { valuesByIndex: G, skippedIndices: K, matchCount: re } = S(() => {
|
|
32
|
-
let e = [], t = /* @__PURE__ */ new Set(), n = 0;
|
|
33
|
-
return L.forEach((r, i) => {
|
|
34
|
-
if (r.index === -1) return;
|
|
35
|
-
e[r.index] = i;
|
|
36
|
-
let a = W(r.label, P);
|
|
37
|
-
a && (n += 1), (r.disabled || !a) && t.add(r.index);
|
|
38
|
-
}), {
|
|
39
|
-
valuesByIndex: e,
|
|
40
|
-
skippedIndices: t,
|
|
41
|
-
matchCount: n
|
|
42
|
-
};
|
|
43
|
-
}, [
|
|
44
|
-
L,
|
|
45
|
-
P,
|
|
46
|
-
W
|
|
47
|
-
]), { refs: q, floatingStyles: J, context: Y } = h({
|
|
48
|
-
open: D,
|
|
49
|
-
placement: M,
|
|
50
|
-
onOpenChange: (e) => O(e)
|
|
51
|
-
}), X = te(Y, {
|
|
52
|
-
escapeKey: !0,
|
|
53
|
-
outsidePress: !0
|
|
54
|
-
}), ie = A(Y, {
|
|
55
|
-
listRef: V,
|
|
56
|
-
activeIndex: j,
|
|
57
|
-
onNavigate: N,
|
|
58
|
-
virtual: !0,
|
|
59
|
-
loop: !0,
|
|
60
|
-
disabledIndices: (e) => K.has(e)
|
|
61
|
-
}), { getReferenceProps: Z, getFloatingProps: Q, getItemProps: $ } = k([X, ie]), ae = S(() => {
|
|
62
|
-
let e = (e) => {
|
|
63
|
-
T(e), O(!1), H.current?.commitLabel(L.get(e)?.label ?? "");
|
|
64
|
-
};
|
|
65
|
-
return {
|
|
66
|
-
baseId: p,
|
|
67
|
-
listId: m,
|
|
68
|
-
setListId: g,
|
|
69
|
-
setInputDisabled: y,
|
|
70
|
-
open: D,
|
|
71
|
-
selectedValue: x,
|
|
72
|
-
activeIndex: j,
|
|
73
|
-
options: L,
|
|
74
|
-
matchCount: re,
|
|
75
|
-
inputLabelling: z,
|
|
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, P),
|
|
85
|
-
findMatches: (e) => {
|
|
86
|
-
let t = 0, n = null, r = null;
|
|
87
|
-
return L.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: I,
|
|
96
|
-
setActiveIndex: N,
|
|
97
|
-
selectValue: e,
|
|
98
|
-
selectIndex: (t) => {
|
|
99
|
-
let n = G[t];
|
|
100
|
-
n === void 0 || K.has(t) || e(n);
|
|
101
|
-
},
|
|
102
|
-
clearValue: () => T(null),
|
|
103
|
-
requestOpenChange: O,
|
|
104
|
-
registration: R,
|
|
105
|
-
setInputLabelling: B
|
|
106
|
-
};
|
|
107
|
-
}, [
|
|
108
|
-
p,
|
|
109
|
-
m,
|
|
110
|
-
D,
|
|
111
|
-
x,
|
|
112
|
-
j,
|
|
113
|
-
L,
|
|
114
|
-
P,
|
|
115
|
-
re,
|
|
116
|
-
z,
|
|
117
|
-
q,
|
|
118
|
-
J,
|
|
119
|
-
Z,
|
|
120
|
-
Q,
|
|
121
|
-
$,
|
|
122
|
-
U,
|
|
123
|
-
W,
|
|
124
|
-
G,
|
|
125
|
-
K,
|
|
126
|
-
T,
|
|
127
|
-
O,
|
|
128
|
-
R
|
|
129
|
-
]);
|
|
130
|
-
return /* @__PURE__ */ ee(F.Provider, {
|
|
131
|
-
value: ae,
|
|
132
|
-
children: [f, l !== void 0 && /* @__PURE__ */ E("input", {
|
|
133
|
-
type: "hidden",
|
|
134
|
-
name: l,
|
|
135
|
-
value: x ?? "",
|
|
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: _ = !1, ...v }) {
|
|
142
|
-
let { listId: y, open: S, selectedValue: C, activeIndex: T, options: ee, inputHandleRef: D, refs: O, getReferenceProps: te, onInputChange: k, findMatches: A, setQuery: M, setActiveIndex: N, selectIndex: P, clearValue: ne, requestOpenChange: F, setInputLabelling: I, setInputDisabled: R } = L("Input"), z = j([O.setReference, e]), B = b(), V = f ?? B, H = `${V}-label`, U = i(a), W = v["aria-labelledby"], G = v["aria-label"], [K, re] = w(n), [q, J] = w(() => (t ?? n) !== void 0), Y = C === null ? void 0 : ee.get(C)?.label, X = t ?? (q ? K ?? "" : Y ?? K ?? ""), [, ie] = r(X, void 0, k), 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
|
-
x(() => {
|
|
148
|
-
M(Q);
|
|
149
|
-
}, [Q, M]), x(() => (R(_), () => R(!1)), [_, R]), x(() => (D.current = { commitLabel: $ }, () => {
|
|
150
|
-
D.current = null;
|
|
151
|
-
})), x(() => (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 ae = (e) => {
|
|
162
|
-
p?.(e);
|
|
163
|
-
let n = e.currentTarget.value;
|
|
164
|
-
J(!0), Z(n), n === "" && ne();
|
|
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
|
-
}, oe = (e) => {
|
|
173
|
-
if (m?.(e), !e.defaultPrevented) {
|
|
174
|
-
if (e.key === "Escape") q && Y !== void 0 && $(Y);
|
|
175
|
-
else if (S) {
|
|
176
|
-
if (e.key === "Enter" && T !== null) e.preventDefault(), P(T);
|
|
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
|
-
}, se = (e) => {
|
|
185
|
-
h?.(e), S && F(!1);
|
|
186
|
-
};
|
|
187
|
-
return /* @__PURE__ */ E(g, {
|
|
188
|
-
...te({
|
|
189
|
-
...v,
|
|
190
|
-
onKeyDown: oe,
|
|
191
|
-
onBlur: se
|
|
192
|
-
}),
|
|
193
|
-
ref: z,
|
|
194
|
-
id: V,
|
|
195
|
-
label: U ? /* @__PURE__ */ E("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: _,
|
|
207
|
-
onChange: ae,
|
|
208
|
-
role: "combobox",
|
|
209
|
-
autoComplete: "off",
|
|
210
|
-
"aria-autocomplete": "list",
|
|
211
|
-
"aria-expanded": S,
|
|
212
|
-
"aria-controls": S ? y : void 0,
|
|
213
|
-
"data-state": S ? "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: h, floatingStyles: g, elementsRef: _, getFloatingProps: v } = L("List"), y = n ?? `${d}-listbox`;
|
|
220
|
-
x(() => (f(y), () => f(`${d}-listbox`)), [
|
|
221
|
-
d,
|
|
222
|
-
y,
|
|
223
|
-
f
|
|
224
|
-
]);
|
|
225
|
-
let b = j([p ? h.setFloating : null, e]), S = u["aria-labelledby"] !== void 0 || u["aria-label"] !== void 0 ? {} : m?.labelledBy === void 0 ? { "aria-label": m?.label } : { "aria-labelledby": m.labelledBy }, C = (e) => {
|
|
226
|
-
i?.(e), e.preventDefault();
|
|
227
|
-
};
|
|
228
|
-
return /* @__PURE__ */ E(O, { children: /* @__PURE__ */ E(t, {
|
|
229
|
-
className: o,
|
|
230
|
-
styles: [c, s],
|
|
231
|
-
sx: l,
|
|
232
|
-
children: (e) => /* @__PURE__ */ E("div", {
|
|
233
|
-
...v({
|
|
234
|
-
id: y,
|
|
235
|
-
...S,
|
|
236
|
-
...u,
|
|
237
|
-
onMouseDown: C
|
|
238
|
-
}),
|
|
239
|
-
ref: b,
|
|
240
|
-
role: "listbox",
|
|
241
|
-
hidden: !p,
|
|
242
|
-
"data-state": p ? "open" : "closed",
|
|
243
|
-
"data-ui": "combobox-list",
|
|
244
|
-
style: {
|
|
245
|
-
...r,
|
|
246
|
-
...g
|
|
247
|
-
},
|
|
248
|
-
className: e,
|
|
249
|
-
children: /* @__PURE__ */ E(D, {
|
|
250
|
-
elementsRef: _,
|
|
251
|
-
children: /* @__PURE__ */ E(I.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: w } = R("Item"), T = C(null), { ref: D, index: O } = d(n, w, T, (e, t) => ({
|
|
262
|
-
index: e,
|
|
263
|
-
label: t,
|
|
264
|
-
disabled: r
|
|
265
|
-
})), te = j([D, e]), k = y.get(n)?.label, A = k !== void 0 && !b(k), M = O !== -1 && v === O, P = _ === n, ne = (e) => {
|
|
266
|
-
i?.(e), !(r || e.defaultPrevented) && S(n);
|
|
267
|
-
};
|
|
268
|
-
return /* @__PURE__ */ E(t, {
|
|
269
|
-
className: s,
|
|
270
|
-
styles: [
|
|
271
|
-
f,
|
|
272
|
-
u,
|
|
273
|
-
l,
|
|
274
|
-
z
|
|
275
|
-
],
|
|
276
|
-
sx: c,
|
|
277
|
-
children: (e) => /* @__PURE__ */ ee("div", {
|
|
278
|
-
...x({
|
|
279
|
-
id: p(g, n),
|
|
280
|
-
...h,
|
|
281
|
-
onClick: ne
|
|
282
|
-
}),
|
|
283
|
-
ref: te,
|
|
284
|
-
role: "option",
|
|
285
|
-
hidden: A,
|
|
286
|
-
"aria-selected": P,
|
|
287
|
-
"aria-disabled": r || void 0,
|
|
288
|
-
"data-active": M || void 0,
|
|
289
|
-
"data-ui": "combobox-item",
|
|
290
|
-
className: e,
|
|
291
|
-
children: [/* @__PURE__ */ E("span", {
|
|
292
|
-
ref: T,
|
|
293
|
-
css: m,
|
|
294
|
-
children: a
|
|
295
|
-
}), P && /* @__PURE__ */ E("span", {
|
|
296
|
-
"aria-hidden": "true",
|
|
297
|
-
css: o,
|
|
298
|
-
children: N
|
|
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 } = R("Empty");
|
|
306
|
-
return s > 0 ? null : /* @__PURE__ */ E(t, {
|
|
307
|
-
className: r,
|
|
308
|
-
styles: B,
|
|
309
|
-
sx: a,
|
|
310
|
-
children: (t) => /* @__PURE__ */ E("div", {
|
|
311
|
-
...o,
|
|
312
|
-
ref: e,
|
|
313
|
-
"data-ui": "combobox-empty",
|
|
314
|
-
className: t,
|
|
315
|
-
children: i(n) ? n : P
|
|
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 };
|
|
@@ -1,379 +0,0 @@
|
|
|
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-CVXDa-qM.js";
|
|
5
|
-
import { t as i } from "./visually-hidden-BJdvqqvn.js";
|
|
6
|
-
import { t as a } from "./renderable-DzcIj1Lo.js";
|
|
7
|
-
import { a as o, r as s, s as c, t as l } from "./collection-registry-BTYi6zGh.js";
|
|
8
|
-
import { t as u } from "./trigger-style-B1KVC8O1.js";
|
|
9
|
-
import { i as d, r as f, t as p } from "./use-native-dialog-DWpIUVO1.js";
|
|
10
|
-
import { n as m, t as h } from "./surface-DZ4d-2aL.js";
|
|
11
|
-
import { createContext as g, useCallback as _, useContext as v, useId as y, useMemo as b, useRef as x, useState as S } from "react";
|
|
12
|
-
import { vars as C } from "@jfrader/tokens/vars";
|
|
13
|
-
import { jsx as w, jsxs as T } from "@emotion/react/jsx-runtime";
|
|
14
|
-
import { FloatingList as E, useFloatingRootContext as D, useInteractions as O, useListNavigation as ee, useMergeRefs as k } from "@floating-ui/react";
|
|
15
|
-
//#region src/components/command-palette/command-palette.styles.ts
|
|
16
|
-
var A = e({
|
|
17
|
-
...h,
|
|
18
|
-
marginBlockStart: C.space[12]
|
|
19
|
-
}), j = e({
|
|
20
|
-
...m,
|
|
21
|
-
display: "flex",
|
|
22
|
-
flexDirection: "column",
|
|
23
|
-
borderRadius: C.radius.lg,
|
|
24
|
-
boxShadow: C.shadow.floating,
|
|
25
|
-
inlineSize: "min(560px, calc(100vw - 32px))"
|
|
26
|
-
}), M = e({
|
|
27
|
-
boxSizing: "border-box",
|
|
28
|
-
inlineSize: "100%",
|
|
29
|
-
blockSize: "48px",
|
|
30
|
-
margin: 0,
|
|
31
|
-
border: 0,
|
|
32
|
-
borderBlockEnd: `1px solid ${C.color.borderControl}`,
|
|
33
|
-
borderStartStartRadius: C.radius.lg,
|
|
34
|
-
borderStartEndRadius: C.radius.lg,
|
|
35
|
-
backgroundColor: "transparent",
|
|
36
|
-
paddingInline: C.space[4],
|
|
37
|
-
font: "inherit",
|
|
38
|
-
fontSize: C.textSize.md,
|
|
39
|
-
color: C.color.text,
|
|
40
|
-
"&::placeholder": { color: C.color.textSubtle },
|
|
41
|
-
"&:focus-visible": { ...n }
|
|
42
|
-
}), N = e({
|
|
43
|
-
boxSizing: "border-box",
|
|
44
|
-
display: "flex",
|
|
45
|
-
flexDirection: "column",
|
|
46
|
-
maxBlockSize: "320px",
|
|
47
|
-
overflow: "auto",
|
|
48
|
-
padding: C.space[1],
|
|
49
|
-
"&[hidden]": { display: "none" }
|
|
50
|
-
}), P = e({
|
|
51
|
-
display: "flex",
|
|
52
|
-
flexDirection: "column",
|
|
53
|
-
"&[hidden]": { display: "none" }
|
|
54
|
-
}), F = e({
|
|
55
|
-
paddingBlock: C.space[1],
|
|
56
|
-
paddingInline: C.space[2],
|
|
57
|
-
fontSize: C.textSize.xs,
|
|
58
|
-
fontWeight: C.fontWeight.medium,
|
|
59
|
-
color: C.color.textMuted
|
|
60
|
-
}), te = e({
|
|
61
|
-
"&:hover, &[data-active]": { backgroundColor: C.color.surfaceHover },
|
|
62
|
-
"&[hidden]": { display: "none" }
|
|
63
|
-
}), I = e({
|
|
64
|
-
paddingBlock: C.space[6],
|
|
65
|
-
paddingInline: C.space[4],
|
|
66
|
-
textAlign: "center",
|
|
67
|
-
fontSize: C.textSize.sm,
|
|
68
|
-
color: C.color.textMuted
|
|
69
|
-
}), ne = "Command palette", re = "No results", L = new Intl.PluralRules("en"), ie = (e, t) => e.toLocaleLowerCase().includes(t.toLocaleLowerCase()), ae = (e) => `${e} ${L.select(e) === "one" ? "result" : "results"}`, R = g(null), z = g(null);
|
|
70
|
-
function B(e) {
|
|
71
|
-
let t = v(R);
|
|
72
|
-
if (!t) throw Error(`CommandPalette.${e} must be rendered inside <CommandPalette>.`);
|
|
73
|
-
return t;
|
|
74
|
-
}
|
|
75
|
-
var V = (e) => {
|
|
76
|
-
e?.setAttribute("autofocus", "");
|
|
77
|
-
};
|
|
78
|
-
function H({ open: e, defaultOpen: t = !1, onOpenChange: n, label: i = ne, filter: a = ie, emptyMessage: s = re, formatResultCount: c = ae, children: l }) {
|
|
79
|
-
let u = y(), [f = !1, p] = r(e, t, n), { dialogElementRef: m, setDialogElement: h, setOpen: g, requestClose: v, repairToken: C } = d(f, p), [T, E] = S(""), [k, A] = S(!1), [j, M] = S(null), [N, P] = o(), [F, te] = S(null), [I, L] = S(null), [z, B] = S(f), V = x([]);
|
|
80
|
-
f !== z && (B(f), f && (E(""), A(!1), M(null)));
|
|
81
|
-
let H = _(() => {
|
|
82
|
-
g(!(f && m.current?.open));
|
|
83
|
-
}, [
|
|
84
|
-
f,
|
|
85
|
-
g,
|
|
86
|
-
m
|
|
87
|
-
]), { matchedValues: U, matchedIndices: W, visibleGroupIds: G } = b(() => {
|
|
88
|
-
let e = /* @__PURE__ */ new Set(), t = [], n = /* @__PURE__ */ new Set();
|
|
89
|
-
return N.forEach((r, i) => {
|
|
90
|
-
r.index !== -1 && (T === "" || a(r.label, T) || r.keywords !== void 0 && a(r.keywords, T)) && (e.add(i), t.push(r.index), r.groupId !== null && n.add(r.groupId));
|
|
91
|
-
}), t.sort((e, t) => e - t), {
|
|
92
|
-
matchedValues: e,
|
|
93
|
-
matchedIndices: t,
|
|
94
|
-
visibleGroupIds: n
|
|
95
|
-
};
|
|
96
|
-
}, [
|
|
97
|
-
N,
|
|
98
|
-
T,
|
|
99
|
-
a
|
|
100
|
-
]), K = b(() => new Set(W), [W]), q = j !== null && K.has(j) ? j : W[0] ?? null, J = D({
|
|
101
|
-
open: f,
|
|
102
|
-
onOpenChange: (e) => g(e),
|
|
103
|
-
elements: {
|
|
104
|
-
reference: F,
|
|
105
|
-
floating: I
|
|
106
|
-
}
|
|
107
|
-
}), Y = ee(J, {
|
|
108
|
-
listRef: V,
|
|
109
|
-
activeIndex: q,
|
|
110
|
-
onNavigate: (e) => {
|
|
111
|
-
e !== null && M(e);
|
|
112
|
-
},
|
|
113
|
-
virtual: !0,
|
|
114
|
-
loop: !0,
|
|
115
|
-
focusItemOnOpen: !1,
|
|
116
|
-
disabledIndices: (e) => !K.has(e)
|
|
117
|
-
}), { getReferenceProps: X, getFloatingProps: Z, getItemProps: Q } = O([Y]), $ = W.length, oe = k ? c($) : "", se = b(() => ({
|
|
118
|
-
open: f,
|
|
119
|
-
setOpen: g,
|
|
120
|
-
toggleOpen: H,
|
|
121
|
-
requestClose: v,
|
|
122
|
-
repairToken: C,
|
|
123
|
-
setDialogElement: h,
|
|
124
|
-
label: i,
|
|
125
|
-
emptyMessage: s,
|
|
126
|
-
baseId: u,
|
|
127
|
-
listId: `${u}-list`,
|
|
128
|
-
query: T,
|
|
129
|
-
announcement: oe,
|
|
130
|
-
matchCount: $,
|
|
131
|
-
matchedValues: U,
|
|
132
|
-
visibleGroupIds: G,
|
|
133
|
-
activeIndex: q,
|
|
134
|
-
elementsRef: V,
|
|
135
|
-
setInputElement: te,
|
|
136
|
-
setListElement: L,
|
|
137
|
-
getReferenceProps: X,
|
|
138
|
-
getFloatingProps: Z,
|
|
139
|
-
getItemProps: Q,
|
|
140
|
-
changeQuery: (e) => {
|
|
141
|
-
E(e), A(!0), M(null);
|
|
142
|
-
},
|
|
143
|
-
moveToEdge: (e) => {
|
|
144
|
-
let t = e === "first" ? W[0] : W[W.length - 1];
|
|
145
|
-
t !== void 0 && M(t);
|
|
146
|
-
},
|
|
147
|
-
registration: P
|
|
148
|
-
}), [
|
|
149
|
-
f,
|
|
150
|
-
g,
|
|
151
|
-
H,
|
|
152
|
-
v,
|
|
153
|
-
C,
|
|
154
|
-
h,
|
|
155
|
-
i,
|
|
156
|
-
s,
|
|
157
|
-
u,
|
|
158
|
-
T,
|
|
159
|
-
oe,
|
|
160
|
-
$,
|
|
161
|
-
U,
|
|
162
|
-
W,
|
|
163
|
-
G,
|
|
164
|
-
q,
|
|
165
|
-
X,
|
|
166
|
-
Z,
|
|
167
|
-
Q,
|
|
168
|
-
P
|
|
169
|
-
]);
|
|
170
|
-
return /* @__PURE__ */ w(R.Provider, {
|
|
171
|
-
value: se,
|
|
172
|
-
children: l
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
H.displayName = "CommandPalette";
|
|
176
|
-
function U({ ref: e, onClick: n, className: r, sx: i, ...a }) {
|
|
177
|
-
let { open: o, toggleOpen: s } = B("Trigger"), c = (e) => {
|
|
178
|
-
n?.(e), e.defaultPrevented || s();
|
|
179
|
-
};
|
|
180
|
-
return /* @__PURE__ */ w(t, {
|
|
181
|
-
className: r,
|
|
182
|
-
styles: u,
|
|
183
|
-
sx: i,
|
|
184
|
-
children: (t) => /* @__PURE__ */ w("button", {
|
|
185
|
-
type: "button",
|
|
186
|
-
...a,
|
|
187
|
-
ref: e,
|
|
188
|
-
"data-ui": "command-palette-trigger",
|
|
189
|
-
"aria-haspopup": "dialog",
|
|
190
|
-
"aria-expanded": o,
|
|
191
|
-
onClick: c,
|
|
192
|
-
className: t
|
|
193
|
-
})
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
U.displayName = "CommandPalette.Trigger";
|
|
197
|
-
function W({ ref: e, className: n, sx: r, ...a }) {
|
|
198
|
-
let { children: o, onCancel: s, onClick: c, onClose: l, ...u } = p(a), d = B("Content"), { label: m, announcement: h } = d, g = f(d, {
|
|
199
|
-
onCancel: s,
|
|
200
|
-
onClick: c,
|
|
201
|
-
onClose: l
|
|
202
|
-
}, e);
|
|
203
|
-
return /* @__PURE__ */ w(t, {
|
|
204
|
-
className: n,
|
|
205
|
-
styles: A,
|
|
206
|
-
sx: r,
|
|
207
|
-
children: (e) => /* @__PURE__ */ w("dialog", {
|
|
208
|
-
"aria-label": m,
|
|
209
|
-
...u,
|
|
210
|
-
...g,
|
|
211
|
-
"data-ui": "command-palette",
|
|
212
|
-
"aria-modal": "true",
|
|
213
|
-
className: e,
|
|
214
|
-
children: /* @__PURE__ */ T("div", {
|
|
215
|
-
css: j,
|
|
216
|
-
children: [o, /* @__PURE__ */ w("div", {
|
|
217
|
-
role: "status",
|
|
218
|
-
"aria-live": "polite",
|
|
219
|
-
"aria-atomic": "true",
|
|
220
|
-
css: i,
|
|
221
|
-
children: h
|
|
222
|
-
})]
|
|
223
|
-
})
|
|
224
|
-
})
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
W.displayName = "CommandPalette.Content";
|
|
228
|
-
function G({ ref: e, onChange: n, onKeyDown: r, className: i, sx: a, ...o }) {
|
|
229
|
-
let { label: s, listId: c, query: l, matchCount: u, activeIndex: d, elementsRef: f, requestClose: p, setInputElement: m, getReferenceProps: h, changeQuery: g, moveToEdge: _ } = B("Input"), v = k([
|
|
230
|
-
m,
|
|
231
|
-
V,
|
|
232
|
-
e
|
|
233
|
-
]), y = (e) => {
|
|
234
|
-
n?.(e), g(e.currentTarget.value);
|
|
235
|
-
}, b = (e) => {
|
|
236
|
-
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()));
|
|
237
|
-
};
|
|
238
|
-
return /* @__PURE__ */ w(t, {
|
|
239
|
-
className: i,
|
|
240
|
-
styles: M,
|
|
241
|
-
sx: a,
|
|
242
|
-
children: (e) => /* @__PURE__ */ w("input", {
|
|
243
|
-
"aria-label": s,
|
|
244
|
-
autoComplete: "off",
|
|
245
|
-
spellCheck: !1,
|
|
246
|
-
...h({
|
|
247
|
-
...o,
|
|
248
|
-
onChange: y,
|
|
249
|
-
onKeyDown: b
|
|
250
|
-
}),
|
|
251
|
-
ref: v,
|
|
252
|
-
type: "text",
|
|
253
|
-
value: l,
|
|
254
|
-
role: "combobox",
|
|
255
|
-
"aria-autocomplete": "list",
|
|
256
|
-
"aria-expanded": u > 0,
|
|
257
|
-
"aria-controls": c,
|
|
258
|
-
"data-ui": "command-palette-input",
|
|
259
|
-
className: e
|
|
260
|
-
})
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
G.displayName = "CommandPalette.Input";
|
|
264
|
-
function K({ ref: e, onMouseDown: n, children: r, className: i, sx: a, ...o }) {
|
|
265
|
-
let { label: s, listId: c, matchCount: l, elementsRef: u, setListElement: d, getFloatingProps: f } = B("List"), p = k([d, e]), m = (e) => {
|
|
266
|
-
n?.(e), e.preventDefault();
|
|
267
|
-
};
|
|
268
|
-
return /* @__PURE__ */ w(t, {
|
|
269
|
-
className: i,
|
|
270
|
-
styles: N,
|
|
271
|
-
sx: a,
|
|
272
|
-
children: (e) => /* @__PURE__ */ w("div", {
|
|
273
|
-
"aria-label": s,
|
|
274
|
-
...f({
|
|
275
|
-
...o,
|
|
276
|
-
onMouseDown: m
|
|
277
|
-
}),
|
|
278
|
-
ref: p,
|
|
279
|
-
id: c,
|
|
280
|
-
role: "listbox",
|
|
281
|
-
hidden: l === 0,
|
|
282
|
-
"data-ui": "command-palette-list",
|
|
283
|
-
className: e,
|
|
284
|
-
children: /* @__PURE__ */ w(E, {
|
|
285
|
-
elementsRef: u,
|
|
286
|
-
children: r
|
|
287
|
-
})
|
|
288
|
-
})
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
K.displayName = "CommandPalette.List";
|
|
292
|
-
function q({ ref: e, children: n, className: r, sx: i, ...o }) {
|
|
293
|
-
let { matchCount: s, emptyMessage: c } = B("Empty");
|
|
294
|
-
return s > 0 ? null : /* @__PURE__ */ w(t, {
|
|
295
|
-
className: r,
|
|
296
|
-
styles: I,
|
|
297
|
-
sx: i,
|
|
298
|
-
children: (t) => /* @__PURE__ */ w("div", {
|
|
299
|
-
...o,
|
|
300
|
-
ref: e,
|
|
301
|
-
"data-ui": "command-palette-empty",
|
|
302
|
-
className: t,
|
|
303
|
-
children: a(n) ? n : c
|
|
304
|
-
})
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
q.displayName = "CommandPalette.Empty";
|
|
308
|
-
function J({ ref: e, label: n, children: r, "aria-labelledby": i, className: a, sx: o, ...s }) {
|
|
309
|
-
let { visibleGroupIds: c } = B("Group"), l = y(), u = `${l}-heading`;
|
|
310
|
-
return /* @__PURE__ */ w(t, {
|
|
311
|
-
className: a,
|
|
312
|
-
styles: P,
|
|
313
|
-
sx: o,
|
|
314
|
-
children: (t) => /* @__PURE__ */ T("div", {
|
|
315
|
-
...s,
|
|
316
|
-
ref: e,
|
|
317
|
-
role: "group",
|
|
318
|
-
"aria-labelledby": [i, u].filter(Boolean).join(" "),
|
|
319
|
-
hidden: !c.has(l),
|
|
320
|
-
"data-ui": "command-palette-group",
|
|
321
|
-
className: t,
|
|
322
|
-
children: [/* @__PURE__ */ w("div", {
|
|
323
|
-
id: u,
|
|
324
|
-
css: F,
|
|
325
|
-
children: n
|
|
326
|
-
}), /* @__PURE__ */ w(z.Provider, {
|
|
327
|
-
value: l,
|
|
328
|
-
children: r
|
|
329
|
-
})]
|
|
330
|
-
})
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
J.displayName = "CommandPalette.Group";
|
|
334
|
-
function Y({ ref: e, value: n, onSelect: r, keywords: i, onClick: a, children: o, className: u, sx: d, ...f }) {
|
|
335
|
-
let { baseId: p, activeIndex: m, matchedValues: h, getItemProps: g, setOpen: _, registration: y } = B("Item"), b = v(z), S = x(null), { ref: C, index: T } = s(n, y, S, (e, t) => ({
|
|
336
|
-
index: e,
|
|
337
|
-
label: t,
|
|
338
|
-
keywords: i,
|
|
339
|
-
groupId: b
|
|
340
|
-
})), E = k([
|
|
341
|
-
C,
|
|
342
|
-
S,
|
|
343
|
-
e
|
|
344
|
-
]), D = T !== -1 && m === T, O = (e) => {
|
|
345
|
-
a?.(e), !e.defaultPrevented && (r?.(), _(!1));
|
|
346
|
-
};
|
|
347
|
-
return /* @__PURE__ */ w(t, {
|
|
348
|
-
className: u,
|
|
349
|
-
styles: [c, te],
|
|
350
|
-
sx: d,
|
|
351
|
-
children: (e) => /* @__PURE__ */ w("div", {
|
|
352
|
-
...g({
|
|
353
|
-
id: l(p, n),
|
|
354
|
-
...f,
|
|
355
|
-
onClick: O
|
|
356
|
-
}),
|
|
357
|
-
ref: E,
|
|
358
|
-
role: "option",
|
|
359
|
-
"aria-selected": D,
|
|
360
|
-
hidden: !h.has(n),
|
|
361
|
-
"data-active": D || void 0,
|
|
362
|
-
"data-ui": "command-palette-item",
|
|
363
|
-
className: e,
|
|
364
|
-
children: o
|
|
365
|
-
})
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
Y.displayName = "CommandPalette.Item";
|
|
369
|
-
var X = Object.assign(H, {
|
|
370
|
-
Trigger: U,
|
|
371
|
-
Content: W,
|
|
372
|
-
Input: G,
|
|
373
|
-
List: K,
|
|
374
|
-
Empty: q,
|
|
375
|
-
Group: J,
|
|
376
|
-
Item: Y
|
|
377
|
-
});
|
|
378
|
-
//#endregion
|
|
379
|
-
export { X as t };
|