@jfrader/ui 0.4.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/README.md +2 -0
- package/dist/accordion-DLul6vIl.js +205 -0
- 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-Dlbq5-9D.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-CaGJHy1N.js +145 -0
- package/dist/avatar-group-M1opAQEG.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/avatar.js +1 -1
- package/dist/badge-CjM5Agqk.js +119 -0
- package/dist/badge.js +1 -1
- package/dist/bottom-sheet-DjZOPq4k.js +674 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-BDK_LiwH.js} +11 -4
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-NLY0h6EJ.js} +8 -8
- package/dist/button.js +1 -1
- package/dist/calendar-BzJdv_SZ.js +449 -0
- 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 +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-DKSzExj2.js} +17 -16
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DjQ0_6Y9.js +290 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-B5we2lZa.js +293 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-DFFqOBCi.js +339 -0
- 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-DCSLcYS-.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-BiPN7yeK.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-DQpUeKqV.js +570 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-BX1zYMs-.js} +21 -20
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
- package/dist/divider.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/elastic-slider-BG6K019r.js +395 -0
- package/dist/elastic-slider.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-rUATve0o.js +347 -0
- package/dist/expandable-card.js +2 -0
- package/dist/expanding-search-BxOwtdwt.js +238 -0
- package/dist/expanding-search.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-BuXm3Tea.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-Cy5Hqur-.js +314 -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-CoMJKg1g.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-BxY8Ykzt.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +84 -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-DgWqyU75.js +802 -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-sq61si9L.js +600 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-DDKgmK2F.js +295 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card--lVTz5Wn.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-DG1BCFX7.js +598 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-CC26JDr-.js} +24 -18
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-qEbpEtb8.js +78 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-BfkeWbmP.js} +24 -23
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- 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-BpJswTG4.js → progress-DAQkfhPd.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/radio-cards-Cu9cBssN.js +456 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-TIK0-iPX.js} +22 -19
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-DUpQEpwG.js +520 -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-DMvho0KQ.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-8ZUGnsZm.js +327 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-D5rhJ8gi.js +293 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-_bTeguN9.js +645 -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-DVG6-Awh.js +308 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-CYKT_Ng7.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-BCw4zZom.js +262 -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-CBuJREU1.js +420 -0
- package/dist/swipe-actions.js +2 -0
- 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/tag-input-DSRCyrX2.js +418 -0
- package/dist/tag-input.js +2 -0
- package/dist/{text-field-D60ok14S.js → text-field-hU72iSVS.js} +20 -17
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-3k4Y0QQ3.js} +23 -20
- 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-CPlhW0tr.js +311 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-B0uAAVfT.js +624 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-B7wo3sX1.js +371 -0
- package/dist/toast-stack-B40VpS4M.js +197 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-B2fpFZwV.js} +5 -5
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BvgVTCTN.js +120 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-j8qLqkb_.js +364 -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/checkbox/checkbox.d.ts +1 -1
- 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 +2 -2
- 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/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/elastic-slider/elastic-slider.d.ts +53 -0
- package/dist/types/components/elastic-slider/index.d.ts +1 -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/expanding-search/expanding-search.d.ts +22 -0
- package/dist/types/components/expanding-search/index.d.ts +1 -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 +68 -7
- 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/pagination/pagination.d.ts +1 -1
- 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/radio-group/radio-group.d.ts +1 -1
- 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-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +62 -0
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -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/tabs/tabs.d.ts +1 -1
- 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/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/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 +2 -2
- 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 +45 -0
- package/dist/types/overlay/overlay-layer.d.ts +53 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +19 -2
- package/dist/types/styling/media.d.ts +1 -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-Bx2jBKAA.js +33 -0
- package/dist/use-slider-interaction-ChL-208h.js +234 -0
- package/package.json +195 -3
- package/dist/accordion-Bd-j04hW.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/card-D-aI2QHx.js +0 -158
- package/dist/collection-registry-BTYi6zGh.js +0 -98
- package/dist/combobox-DiMC2g_u.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-C29Uo4Tx.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-CGPTNRnF.js +0 -216
- package/dist/pill-DO2gHzMb.js +0 -56
- package/dist/popover-CdRXjQqI.js +0 -113
- package/dist/select-BgG7WgSh.js +0 -286
- package/dist/switch-Dr-qjmT4.js +0 -142
- package/dist/tabs-CK_g1RKa.js +0 -203
- package/dist/toast-CjmELMZZ.js +0 -283
- package/dist/tooltip-CaL3rKbV.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
- package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
|
@@ -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 { n as h, t as g } from "./use-overlay-floating-Bit-f0FU.js";
|
|
7
|
-
import { t as _ } from "./text-field-D60ok14S.js";
|
|
8
|
-
import { createContext as v, useCallback as y, useContext as b, useId as x, useLayoutEffect as S, useMemo as C, useRef as w, useState as T } from "react";
|
|
9
|
-
import { vars as E } from "@jfrader/tokens/vars";
|
|
10
|
-
import { jsx as D, jsxs as O } from "@emotion/react/jsx-runtime";
|
|
11
|
-
import { FloatingList as k, useDismiss as ee, useInteractions as A, useListNavigation as j, useMergeRefs as M } from "@floating-ui/react";
|
|
12
|
-
//#region src/components/combobox/combobox.tsx
|
|
13
|
-
var N = "bottom-start", P = "✓", F = "No results", te = (e, t) => e.toLocaleLowerCase().includes(t.toLocaleLowerCase()), I = v(null), L = v(!1);
|
|
14
|
-
function R(e) {
|
|
15
|
-
let t = b(I);
|
|
16
|
-
if (!t) throw Error(`Combobox.${e} must be rendered inside <Combobox>.`);
|
|
17
|
-
return t;
|
|
18
|
-
}
|
|
19
|
-
function z(e) {
|
|
20
|
-
let t = R(e);
|
|
21
|
-
if (!b(L)) throw Error(`Combobox.${e} must be rendered inside <Combobox.List>.`);
|
|
22
|
-
return t;
|
|
23
|
-
}
|
|
24
|
-
var B = e({ "&[hidden]": { display: "none" } }), ne = e({
|
|
25
|
-
paddingBlock: E.space[1],
|
|
26
|
-
paddingInline: E.space[2],
|
|
27
|
-
fontSize: E.textSize.sm,
|
|
28
|
-
color: E.color.textMuted
|
|
29
|
-
});
|
|
30
|
-
function V({ value: e, defaultValue: t, onValueChange: i, open: o, defaultOpen: s = !1, onOpenChange: c, name: l, filter: u = te, onInputChange: d, children: f }) {
|
|
31
|
-
let p = x(), [m, h] = T(`${p}-listbox`), [_, v] = T(!1), [b = null, S] = r(e, t ?? null, i), [E = !1, k] = r(o, s, c), [M, P] = T(null), [F, L] = T(""), [R, z] = a(), [B, ne] = T(null), V = w([]), H = w(null), U = n(d), W = y((e, t) => t === "" || u(e, t), [u]), { valuesByIndex: G, skippedIndices: K, matchCount: re } = C(() => {
|
|
32
|
-
let e = [], t = /* @__PURE__ */ new Set(), n = 0;
|
|
33
|
-
return R.forEach((r, i) => {
|
|
34
|
-
if (r.index === -1) return;
|
|
35
|
-
e[r.index] = i;
|
|
36
|
-
let a = W(r.label, F);
|
|
37
|
-
a && (n += 1), (r.disabled || !a) && t.add(r.index);
|
|
38
|
-
}), {
|
|
39
|
-
valuesByIndex: e,
|
|
40
|
-
skippedIndices: t,
|
|
41
|
-
matchCount: n
|
|
42
|
-
};
|
|
43
|
-
}, [
|
|
44
|
-
R,
|
|
45
|
-
F,
|
|
46
|
-
W
|
|
47
|
-
]), { refs: q, floatingStyles: J, context: Y } = g({
|
|
48
|
-
open: E,
|
|
49
|
-
placement: N,
|
|
50
|
-
onOpenChange: (e) => k(e)
|
|
51
|
-
}), X = ee(Y, {
|
|
52
|
-
escapeKey: !0,
|
|
53
|
-
outsidePress: !0
|
|
54
|
-
}), ie = j(Y, {
|
|
55
|
-
listRef: V,
|
|
56
|
-
activeIndex: M,
|
|
57
|
-
onNavigate: P,
|
|
58
|
-
virtual: !0,
|
|
59
|
-
loop: !0,
|
|
60
|
-
disabledIndices: (e) => K.has(e)
|
|
61
|
-
}), { getReferenceProps: Z, getFloatingProps: Q, getItemProps: $ } = A([X, ie]), ae = C(() => {
|
|
62
|
-
let e = (e) => {
|
|
63
|
-
S(e), k(!1), H.current?.commitLabel(R.get(e)?.label ?? "");
|
|
64
|
-
};
|
|
65
|
-
return {
|
|
66
|
-
baseId: p,
|
|
67
|
-
listId: m,
|
|
68
|
-
setListId: h,
|
|
69
|
-
setInputDisabled: v,
|
|
70
|
-
open: E,
|
|
71
|
-
selectedValue: b,
|
|
72
|
-
activeIndex: M,
|
|
73
|
-
options: R,
|
|
74
|
-
matchCount: re,
|
|
75
|
-
inputLabelling: B,
|
|
76
|
-
inputHandleRef: H,
|
|
77
|
-
refs: q,
|
|
78
|
-
floatingStyles: J,
|
|
79
|
-
elementsRef: V,
|
|
80
|
-
getReferenceProps: Z,
|
|
81
|
-
getFloatingProps: Q,
|
|
82
|
-
getItemProps: $,
|
|
83
|
-
onInputChange: U,
|
|
84
|
-
isVisible: (e) => W(e, F),
|
|
85
|
-
findMatches: (e) => {
|
|
86
|
-
let t = 0, n = null, r = null;
|
|
87
|
-
return R.forEach((i) => {
|
|
88
|
-
i.index !== -1 && W(i.label, e) && (t += 1, !i.disabled && ((n === null || i.index < n) && (n = i.index), (r === null || i.index > r) && (r = i.index)));
|
|
89
|
-
}), {
|
|
90
|
-
count: t,
|
|
91
|
-
first: n,
|
|
92
|
-
last: r
|
|
93
|
-
};
|
|
94
|
-
},
|
|
95
|
-
setQuery: L,
|
|
96
|
-
setActiveIndex: P,
|
|
97
|
-
selectValue: e,
|
|
98
|
-
selectIndex: (t) => {
|
|
99
|
-
let n = G[t];
|
|
100
|
-
n === void 0 || K.has(t) || e(n);
|
|
101
|
-
},
|
|
102
|
-
clearValue: () => S(null),
|
|
103
|
-
requestOpenChange: k,
|
|
104
|
-
registration: z,
|
|
105
|
-
setInputLabelling: ne
|
|
106
|
-
};
|
|
107
|
-
}, [
|
|
108
|
-
p,
|
|
109
|
-
m,
|
|
110
|
-
E,
|
|
111
|
-
b,
|
|
112
|
-
M,
|
|
113
|
-
R,
|
|
114
|
-
F,
|
|
115
|
-
re,
|
|
116
|
-
B,
|
|
117
|
-
q,
|
|
118
|
-
J,
|
|
119
|
-
Z,
|
|
120
|
-
Q,
|
|
121
|
-
$,
|
|
122
|
-
U,
|
|
123
|
-
W,
|
|
124
|
-
G,
|
|
125
|
-
K,
|
|
126
|
-
S,
|
|
127
|
-
k,
|
|
128
|
-
z
|
|
129
|
-
]);
|
|
130
|
-
return /* @__PURE__ */ O(I.Provider, {
|
|
131
|
-
value: ae,
|
|
132
|
-
children: [f, l !== void 0 && /* @__PURE__ */ D("input", {
|
|
133
|
-
type: "hidden",
|
|
134
|
-
name: l,
|
|
135
|
-
value: b ?? "",
|
|
136
|
-
disabled: _
|
|
137
|
-
})]
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
V.displayName = "Combobox";
|
|
141
|
-
function H({ ref: e, inputValue: t, defaultInputValue: n, label: a, description: o, error: s, size: c, slotProps: l, className: u, sx: d, id: f, onChange: p, onKeyDown: m, onBlur: h, disabled: g = !1, ...v }) {
|
|
142
|
-
let { listId: y, open: b, selectedValue: C, activeIndex: w, options: E, inputHandleRef: O, refs: k, getReferenceProps: ee, onInputChange: A, findMatches: j, setQuery: N, setActiveIndex: P, selectIndex: F, clearValue: te, requestOpenChange: I, setInputLabelling: L, setInputDisabled: z } = R("Input"), B = M([k.setReference, e]), ne = x(), V = f ?? ne, H = `${V}-label`, U = i(a), W = v["aria-labelledby"], G = v["aria-label"], [K, re] = T(n), [q, J] = T(() => (t ?? n) !== void 0), Y = C === null ? void 0 : E.get(C)?.label, X = t ?? (q ? K ?? "" : Y ?? K ?? ""), [, ie] = r(X, void 0, A), Z = (e) => {
|
|
143
|
-
ie(e), t === void 0 && re(e);
|
|
144
|
-
}, Q = t !== void 0 || q ? X : "", $ = (e) => {
|
|
145
|
-
J(!1), Z(e);
|
|
146
|
-
};
|
|
147
|
-
S(() => {
|
|
148
|
-
N(Q);
|
|
149
|
-
}, [Q, N]), S(() => (z(g), () => z(!1)), [g, z]), S(() => (O.current = { commitLabel: $ }, () => {
|
|
150
|
-
O.current = null;
|
|
151
|
-
})), S(() => (L(W !== void 0 || !U ? {
|
|
152
|
-
labelledBy: W,
|
|
153
|
-
label: G
|
|
154
|
-
} : { labelledBy: H }), () => L(null)), [
|
|
155
|
-
W,
|
|
156
|
-
G,
|
|
157
|
-
U,
|
|
158
|
-
H,
|
|
159
|
-
L
|
|
160
|
-
]);
|
|
161
|
-
let ae = (e) => {
|
|
162
|
-
p?.(e);
|
|
163
|
-
let n = e.currentTarget.value;
|
|
164
|
-
J(!0), Z(n), n === "" && te();
|
|
165
|
-
let r = t ?? n;
|
|
166
|
-
if (r === "") {
|
|
167
|
-
P(null), I(!1);
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
let i = j(r);
|
|
171
|
-
P(i.first), i.count > 0 && I(!0);
|
|
172
|
-
}, oe = (e) => {
|
|
173
|
-
if (m?.(e), !e.defaultPrevented) {
|
|
174
|
-
if (e.key === "Escape") q && Y !== void 0 && $(Y);
|
|
175
|
-
else if (b) {
|
|
176
|
-
if (e.key === "Enter" && w !== null) e.preventDefault(), F(w);
|
|
177
|
-
else if (e.key === "Home" || e.key === "End") {
|
|
178
|
-
let t = j(Q), n = e.key === "Home" ? t.first : t.last;
|
|
179
|
-
if (n === null) return;
|
|
180
|
-
e.preventDefault(), P(n);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}, se = (e) => {
|
|
185
|
-
h?.(e), b && I(!1);
|
|
186
|
-
};
|
|
187
|
-
return /* @__PURE__ */ D(_, {
|
|
188
|
-
...ee({
|
|
189
|
-
...v,
|
|
190
|
-
onKeyDown: oe,
|
|
191
|
-
onBlur: se
|
|
192
|
-
}),
|
|
193
|
-
ref: B,
|
|
194
|
-
id: V,
|
|
195
|
-
label: U ? /* @__PURE__ */ D("span", {
|
|
196
|
-
id: H,
|
|
197
|
-
children: a
|
|
198
|
-
}) : a,
|
|
199
|
-
description: o,
|
|
200
|
-
error: s,
|
|
201
|
-
size: c,
|
|
202
|
-
slotProps: l,
|
|
203
|
-
className: u,
|
|
204
|
-
sx: d,
|
|
205
|
-
value: X,
|
|
206
|
-
disabled: g,
|
|
207
|
-
onChange: ae,
|
|
208
|
-
role: "combobox",
|
|
209
|
-
autoComplete: "off",
|
|
210
|
-
"aria-autocomplete": "list",
|
|
211
|
-
"aria-expanded": b,
|
|
212
|
-
"aria-controls": b ? y : void 0,
|
|
213
|
-
"data-state": b ? "open" : "closed",
|
|
214
|
-
"data-ui": "combobox-input"
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
H.displayName = "Combobox.Input";
|
|
218
|
-
function U({ ref: e, id: n, style: r, onMouseDown: i, children: a, className: o, sx: l, ...u }) {
|
|
219
|
-
let { baseId: d, setListId: f, open: p, inputLabelling: m, refs: g, floatingStyles: _, elementsRef: v, getFloatingProps: y } = R("List"), b = n ?? `${d}-listbox`;
|
|
220
|
-
S(() => (f(b), () => f(`${d}-listbox`)), [
|
|
221
|
-
d,
|
|
222
|
-
b,
|
|
223
|
-
f
|
|
224
|
-
]);
|
|
225
|
-
let x = M([p ? g.setFloating : null, e]), C = u["aria-labelledby"] !== void 0 || u["aria-label"] !== void 0 ? {} : m?.labelledBy === void 0 ? { "aria-label": m?.label } : { "aria-labelledby": m.labelledBy }, w = (e) => {
|
|
226
|
-
i?.(e), e.preventDefault();
|
|
227
|
-
};
|
|
228
|
-
return /* @__PURE__ */ D(h, { children: /* @__PURE__ */ D(t, {
|
|
229
|
-
className: o,
|
|
230
|
-
styles: [c, s],
|
|
231
|
-
sx: l,
|
|
232
|
-
children: (e) => /* @__PURE__ */ D("div", {
|
|
233
|
-
...y({
|
|
234
|
-
id: b,
|
|
235
|
-
...C,
|
|
236
|
-
...u,
|
|
237
|
-
onMouseDown: w
|
|
238
|
-
}),
|
|
239
|
-
ref: x,
|
|
240
|
-
role: "listbox",
|
|
241
|
-
hidden: !p,
|
|
242
|
-
"data-state": p ? "open" : "closed",
|
|
243
|
-
"data-ui": "combobox-list",
|
|
244
|
-
style: {
|
|
245
|
-
...r,
|
|
246
|
-
..._
|
|
247
|
-
},
|
|
248
|
-
className: e,
|
|
249
|
-
children: /* @__PURE__ */ D(k, {
|
|
250
|
-
elementsRef: v,
|
|
251
|
-
children: /* @__PURE__ */ D(L.Provider, {
|
|
252
|
-
value: !0,
|
|
253
|
-
children: a
|
|
254
|
-
})
|
|
255
|
-
})
|
|
256
|
-
})
|
|
257
|
-
}) });
|
|
258
|
-
}
|
|
259
|
-
U.displayName = "Combobox.List";
|
|
260
|
-
function W({ ref: e, value: n, disabled: r = !1, onClick: i, children: a, className: s, sx: c, ...h }) {
|
|
261
|
-
let { baseId: g, selectedValue: _, activeIndex: v, options: y, isVisible: b, getItemProps: x, selectValue: S, registration: C } = z("Item"), T = w(null), { ref: E, index: k } = d(n, C, T, (e, t) => ({
|
|
262
|
-
index: e,
|
|
263
|
-
label: t,
|
|
264
|
-
disabled: r
|
|
265
|
-
})), ee = M([E, e]), A = y.get(n)?.label, j = A !== void 0 && !b(A), N = k !== -1 && v === k, F = _ === n, te = (e) => {
|
|
266
|
-
i?.(e), !(r || e.defaultPrevented) && S(n);
|
|
267
|
-
};
|
|
268
|
-
return /* @__PURE__ */ D(t, {
|
|
269
|
-
className: s,
|
|
270
|
-
styles: [
|
|
271
|
-
f,
|
|
272
|
-
u,
|
|
273
|
-
l,
|
|
274
|
-
B
|
|
275
|
-
],
|
|
276
|
-
sx: c,
|
|
277
|
-
children: (e) => /* @__PURE__ */ O("div", {
|
|
278
|
-
...x({
|
|
279
|
-
id: p(g, n),
|
|
280
|
-
...h,
|
|
281
|
-
onClick: te
|
|
282
|
-
}),
|
|
283
|
-
ref: ee,
|
|
284
|
-
role: "option",
|
|
285
|
-
hidden: j,
|
|
286
|
-
"aria-selected": F,
|
|
287
|
-
"aria-disabled": r || void 0,
|
|
288
|
-
"data-active": N || void 0,
|
|
289
|
-
"data-ui": "combobox-item",
|
|
290
|
-
className: e,
|
|
291
|
-
children: [/* @__PURE__ */ D("span", {
|
|
292
|
-
ref: T,
|
|
293
|
-
css: m,
|
|
294
|
-
children: a
|
|
295
|
-
}), F && /* @__PURE__ */ D("span", {
|
|
296
|
-
"aria-hidden": "true",
|
|
297
|
-
css: o,
|
|
298
|
-
children: P
|
|
299
|
-
})]
|
|
300
|
-
})
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
W.displayName = "Combobox.Item";
|
|
304
|
-
function G({ ref: e, children: n, className: r, sx: a, ...o }) {
|
|
305
|
-
let { matchCount: s } = z("Empty");
|
|
306
|
-
return s > 0 ? null : /* @__PURE__ */ D(t, {
|
|
307
|
-
className: r,
|
|
308
|
-
styles: ne,
|
|
309
|
-
sx: a,
|
|
310
|
-
children: (t) => /* @__PURE__ */ D("div", {
|
|
311
|
-
...o,
|
|
312
|
-
ref: e,
|
|
313
|
-
"data-ui": "combobox-empty",
|
|
314
|
-
className: t,
|
|
315
|
-
children: i(n) ? n : F
|
|
316
|
-
})
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
G.displayName = "Combobox.Empty";
|
|
320
|
-
var K = Object.assign(V, {
|
|
321
|
-
Input: H,
|
|
322
|
-
List: U,
|
|
323
|
-
Item: W,
|
|
324
|
-
Empty: G
|
|
325
|
-
});
|
|
326
|
-
//#endregion
|
|
327
|
-
export { K as t };
|
|
@@ -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 };
|