@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
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { i as e, r as t, t as n } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as a } from "./use-controlled-state-DpeVQZNR.js";
|
|
5
|
+
import { t as o } from "./visually-hidden-BJdvqqvn.js";
|
|
6
|
+
import { t as s } from "./renderable-DzcIj1Lo.js";
|
|
7
|
+
import { t as c } from "./trigger-style-B1KVC8O1.js";
|
|
8
|
+
import { t as l } from "./overlay-layer-qEbpEtb8.js";
|
|
9
|
+
import { a as u, i as d, n as f, o as p, r as m, s as h, t as g } from "./listbox-style-WX-RASp1.js";
|
|
10
|
+
import { a as _, r as v, t as y } from "./collection-registry-k6JcD3Jr.js";
|
|
11
|
+
import { t as b } from "./overlay-portal-C4JZFq2M.js";
|
|
12
|
+
import { t as x } from "./use-overlay-floating-Bx2jBKAA.js";
|
|
13
|
+
import { createContext as S, useContext as C, useId as w, useLayoutEffect as T, useMemo as E, useRef as D, useState as O } from "react";
|
|
14
|
+
import { vars as k } from "@jfrader/tokens/vars";
|
|
15
|
+
import { Fragment as A, jsx as j, jsxs as M } from "@emotion/react/jsx-runtime";
|
|
16
|
+
import { FloatingList as ee, useDismiss as te, useInteractions as ne, useListNavigation as re, useMergeRefs as N, useRole as ie } from "@floating-ui/react";
|
|
17
|
+
//#region src/components/multi-select/multi-select.tsx
|
|
18
|
+
var ae = [], oe = 500, se = t({
|
|
19
|
+
minInlineSize: 0,
|
|
20
|
+
maxInlineSize: "100%",
|
|
21
|
+
justifyContent: "flex-start",
|
|
22
|
+
"&[aria-invalid=\"true\"]": { borderColor: k.color.dangerText }
|
|
23
|
+
}), ce = {
|
|
24
|
+
sm: t({ minBlockSize: k.space[8] }),
|
|
25
|
+
md: t({ minBlockSize: k.space[10] }),
|
|
26
|
+
lg: t({ minBlockSize: k.space[12] })
|
|
27
|
+
}, le = t({
|
|
28
|
+
display: "flex",
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
gap: k.space[1],
|
|
31
|
+
minInlineSize: 0,
|
|
32
|
+
overflow: "hidden",
|
|
33
|
+
"&[data-placeholder]": { color: k.color.textMuted }
|
|
34
|
+
}), P = t({
|
|
35
|
+
borderRadius: k.radius.full,
|
|
36
|
+
paddingInline: k.space[2],
|
|
37
|
+
backgroundColor: k.color.accentSoft,
|
|
38
|
+
color: k.color.accentText,
|
|
39
|
+
overflow: "hidden",
|
|
40
|
+
textOverflow: "ellipsis",
|
|
41
|
+
whiteSpace: "nowrap",
|
|
42
|
+
minInlineSize: 0,
|
|
43
|
+
[r]: { border: "1px solid CanvasText" }
|
|
44
|
+
}), F = t({
|
|
45
|
+
fontFamily: k.font.sans,
|
|
46
|
+
fontSize: k.textSize.sm,
|
|
47
|
+
color: k.color.text
|
|
48
|
+
}), ue = t({ color: k.color.dangerText }), I = e({
|
|
49
|
+
from: { opacity: 0 },
|
|
50
|
+
to: { opacity: 1 }
|
|
51
|
+
}), de = t({
|
|
52
|
+
minInlineSize: 0,
|
|
53
|
+
maxInlineSize: "100vw",
|
|
54
|
+
borderColor: k.color.borderControl,
|
|
55
|
+
animation: `${I} ${k.motion.duration.base} ${k.motion.easeStandard}`,
|
|
56
|
+
[i]: { animation: "none" },
|
|
57
|
+
[r]: {
|
|
58
|
+
borderColor: "CanvasText",
|
|
59
|
+
backgroundColor: "Canvas",
|
|
60
|
+
color: "CanvasText"
|
|
61
|
+
}
|
|
62
|
+
}), fe = t({
|
|
63
|
+
overflowWrap: "anywhere",
|
|
64
|
+
[r]: { "&[data-active]": { outlineColor: "Highlight" } }
|
|
65
|
+
}), L = t({
|
|
66
|
+
minBlockSize: k.space[6],
|
|
67
|
+
minInlineSize: k.space[6]
|
|
68
|
+
});
|
|
69
|
+
function pe({ value: e, defaultValue: t = ae, onValueChange: n, open: r, defaultOpen: i = !1, onOpenChange: o, disabled: s = !1, required: c = !1, locale: l, messages: u, placement: d = "bottom-start" }) {
|
|
70
|
+
let f = w(), [p, m] = O(`${f}-listbox`), [h, g] = O("ltr"), [v = ae, y] = a(e, t, (e) => n?.([...e])), b = E(() => [...new Set(v)], [v]), [S = !1, C] = a(r, i, o), [k, A] = _(), [j, M] = O(null), [ee, N] = O(null), [oe, se] = O(), [ce, le] = O(), [P, F] = O(), [ue, I] = O(!1), [de, fe] = O({
|
|
71
|
+
width: 0,
|
|
72
|
+
height: 0
|
|
73
|
+
}), L = D([]), pe = D([]), R = D(null), z = D(null), B = D({
|
|
74
|
+
value: [...new Set(t)],
|
|
75
|
+
open: i
|
|
76
|
+
}), V = E(() => ({
|
|
77
|
+
list: new Intl.ListFormat(l),
|
|
78
|
+
number: new Intl.NumberFormat(l),
|
|
79
|
+
plural: new Intl.PluralRules(l),
|
|
80
|
+
collator: new Intl.Collator(l, {
|
|
81
|
+
usage: "search",
|
|
82
|
+
sensitivity: "base"
|
|
83
|
+
})
|
|
84
|
+
}), [l]), H = E(() => ({
|
|
85
|
+
clearLabel: "Clear selection",
|
|
86
|
+
empty: "No options",
|
|
87
|
+
required: "Select at least one option",
|
|
88
|
+
selected: (e) => `${V.number.format(e.length)} ${V.plural.select(e.length) === "one" ? "option" : "options"} selected${e.length ? `: ${V.list.format([...e])}` : ""}`,
|
|
89
|
+
toggled: (e, t) => `${e} ${t ? "selected" : "deselected"}`,
|
|
90
|
+
...u
|
|
91
|
+
}), [V, u]), U = E(() => {
|
|
92
|
+
let e = [];
|
|
93
|
+
return k.forEach((t, n) => {
|
|
94
|
+
t.index >= 0 && (e[t.index] = n);
|
|
95
|
+
}), e;
|
|
96
|
+
}, [k]), W = j === null ? void 0 : U[j], G = S && !s && W !== void 0 && !k.get(W)?.disabled ? k.get(W)?.id : void 0, K = b.map((e) => k.get(e)).find((e) => e && !e.disabled && e.index >= 0)?.index ?? null, q = x({
|
|
97
|
+
open: S,
|
|
98
|
+
placement: d,
|
|
99
|
+
onOpenChange: (e) => {
|
|
100
|
+
s || C(e);
|
|
101
|
+
},
|
|
102
|
+
onAvailableSize: fe
|
|
103
|
+
}), J = ie(q.context, { role: "listbox" }), Y = te(q.context, {
|
|
104
|
+
enabled: !s,
|
|
105
|
+
outsidePress: (e) => !z.current?.contains(e.target)
|
|
106
|
+
}), X = re(q.context, {
|
|
107
|
+
enabled: !s,
|
|
108
|
+
listRef: L,
|
|
109
|
+
activeIndex: j,
|
|
110
|
+
onNavigate: M,
|
|
111
|
+
virtual: !0,
|
|
112
|
+
loop: !0,
|
|
113
|
+
selectedIndex: K,
|
|
114
|
+
focusItemOnOpen: !0,
|
|
115
|
+
disabledIndices: (e) => {
|
|
116
|
+
let t = U[e];
|
|
117
|
+
return t === void 0 || k.get(t)?.disabled === !0;
|
|
118
|
+
}
|
|
119
|
+
}), Z = ne([
|
|
120
|
+
J,
|
|
121
|
+
Y,
|
|
122
|
+
X
|
|
123
|
+
]), Q = ({ onKeyDown: e, ...t } = {}) => {
|
|
124
|
+
let n = Z.getReferenceProps(t), r = n.onKeyDown;
|
|
125
|
+
return {
|
|
126
|
+
...n,
|
|
127
|
+
onKeyDown: (t) => {
|
|
128
|
+
e?.(t), !t.defaultPrevented && !t.nativeEvent.isComposing && r?.(t);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}, $ = (e) => {
|
|
132
|
+
let t = [...new Set(e)];
|
|
133
|
+
t.length === b.length && t.every((e, t) => e === b[t]) || y(t);
|
|
134
|
+
};
|
|
135
|
+
return T(() => {
|
|
136
|
+
let e = R.current;
|
|
137
|
+
e && e.setCustomValidity(c && !s && b.length === 0 ? H.required : "");
|
|
138
|
+
}, [
|
|
139
|
+
c,
|
|
140
|
+
s,
|
|
141
|
+
b.length,
|
|
142
|
+
H.required
|
|
143
|
+
]), T(() => {
|
|
144
|
+
let t = R.current?.form;
|
|
145
|
+
if (!t) return;
|
|
146
|
+
let n = (t) => {
|
|
147
|
+
queueMicrotask(() => {
|
|
148
|
+
t.defaultPrevented || (I(!1), e === void 0 && $(B.current.value), r === void 0 && C(B.current.open));
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
return t.addEventListener("reset", n), () => t.removeEventListener("reset", n);
|
|
152
|
+
}), T(() => {
|
|
153
|
+
G && L.current[j]?.scrollIntoView({ block: "nearest" });
|
|
154
|
+
}, [G, j]), {
|
|
155
|
+
baseId: f,
|
|
156
|
+
listId: p,
|
|
157
|
+
setListId: m,
|
|
158
|
+
direction: h,
|
|
159
|
+
setDirection: g,
|
|
160
|
+
selected: b,
|
|
161
|
+
open: S,
|
|
162
|
+
disabled: s,
|
|
163
|
+
required: c,
|
|
164
|
+
options: k,
|
|
165
|
+
registration: A,
|
|
166
|
+
activeIndex: j,
|
|
167
|
+
activeId: G,
|
|
168
|
+
setActiveIndex: M,
|
|
169
|
+
triggerName: ee,
|
|
170
|
+
setTriggerName: N,
|
|
171
|
+
labelId: oe,
|
|
172
|
+
setLabelId: se,
|
|
173
|
+
descriptionId: ce,
|
|
174
|
+
setDescriptionId: le,
|
|
175
|
+
errorId: P,
|
|
176
|
+
setErrorId: F,
|
|
177
|
+
invalid: c && !s && ue && b.length === 0,
|
|
178
|
+
setInvalidAttempt: I,
|
|
179
|
+
available: de,
|
|
180
|
+
elementsRef: L,
|
|
181
|
+
labelsRef: pe,
|
|
182
|
+
proxyRef: R,
|
|
183
|
+
clearRef: z,
|
|
184
|
+
formatters: V,
|
|
185
|
+
messages: H,
|
|
186
|
+
byIndex: U,
|
|
187
|
+
change: $,
|
|
188
|
+
toggle: (e) => {
|
|
189
|
+
s || k.get(e)?.disabled || $(b.includes(e) ? b.filter((t) => t !== e) : [...b, e]);
|
|
190
|
+
},
|
|
191
|
+
requestOpen: C,
|
|
192
|
+
...q,
|
|
193
|
+
...Z,
|
|
194
|
+
getReferenceProps: Q
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
var R = S(null), z = S(!1);
|
|
198
|
+
function B(e) {
|
|
199
|
+
let t = C(R);
|
|
200
|
+
if (!t) throw Error(`MultiSelect.${e} must be rendered inside <MultiSelect>.`);
|
|
201
|
+
return t;
|
|
202
|
+
}
|
|
203
|
+
var V = (...e) => e.filter(Boolean).join(" ") || void 0;
|
|
204
|
+
function H(e) {
|
|
205
|
+
let t = pe(e), n = t.selected.map((e) => t.options.get(e)?.label ?? e), r = D(t.selected), [i, a] = O("");
|
|
206
|
+
return T(() => {
|
|
207
|
+
let e = r.current;
|
|
208
|
+
if (e.length === t.selected.length && e.every((e, n) => e === t.selected[n])) return;
|
|
209
|
+
let i = [...e.filter((e) => !t.selected.includes(e)), ...t.selected.filter((t) => !e.includes(t))], o = i[0];
|
|
210
|
+
a(i.length === 1 && o !== void 0 ? t.messages.toggled(t.options.get(o)?.label ?? o, t.selected.includes(o)) : t.messages.selected(n)), r.current = t.selected;
|
|
211
|
+
}, [
|
|
212
|
+
t.selected,
|
|
213
|
+
t.messages,
|
|
214
|
+
t.options,
|
|
215
|
+
n
|
|
216
|
+
]), /* @__PURE__ */ M(R.Provider, {
|
|
217
|
+
value: t,
|
|
218
|
+
children: [
|
|
219
|
+
e.children,
|
|
220
|
+
/* @__PURE__ */ j("span", {
|
|
221
|
+
id: `${t.baseId}-summary`,
|
|
222
|
+
css: o,
|
|
223
|
+
children: t.messages.selected(n)
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ j("span", {
|
|
226
|
+
css: o,
|
|
227
|
+
role: "status",
|
|
228
|
+
"aria-atomic": "true",
|
|
229
|
+
children: i
|
|
230
|
+
}),
|
|
231
|
+
e.name !== void 0 && t.selected.map((n) => /* @__PURE__ */ j("input", {
|
|
232
|
+
type: "hidden",
|
|
233
|
+
name: e.name,
|
|
234
|
+
value: n,
|
|
235
|
+
disabled: t.disabled,
|
|
236
|
+
form: t.triggerName?.form
|
|
237
|
+
}, n)),
|
|
238
|
+
/* @__PURE__ */ j("input", {
|
|
239
|
+
ref: t.proxyRef,
|
|
240
|
+
form: t.triggerName?.form,
|
|
241
|
+
type: "text",
|
|
242
|
+
css: o,
|
|
243
|
+
tabIndex: -1,
|
|
244
|
+
"aria-label": t.messages.required,
|
|
245
|
+
required: t.required,
|
|
246
|
+
disabled: t.disabled,
|
|
247
|
+
value: t.selected.length ? "selected" : "",
|
|
248
|
+
onChange: (e) => {
|
|
249
|
+
e.currentTarget.value = t.selected.length ? "selected" : "";
|
|
250
|
+
},
|
|
251
|
+
onInvalid: (e) => {
|
|
252
|
+
e.preventDefault(), t.setInvalidAttempt(!0), a(t.messages.required), t.refs.domReference.current?.focus();
|
|
253
|
+
}
|
|
254
|
+
})
|
|
255
|
+
]
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
function U(e) {
|
|
259
|
+
return /* @__PURE__ */ j(l, { children: /* @__PURE__ */ j(H, { ...e }) });
|
|
260
|
+
}
|
|
261
|
+
U.displayName = "MultiSelect";
|
|
262
|
+
function W({ ref: e, id: t, size: r = "md", disabled: i, onKeyDown: a, onKeyUp: o, onClick: s, onBlur: l, className: u, sx: d, ...f }) {
|
|
263
|
+
let p = B("Trigger"), m = N([p.refs.setReference, e]), h = t ?? `${p.baseId}-trigger`, g = V(f["aria-labelledby"], p.labelId), _ = f["aria-label"], v = D({
|
|
264
|
+
text: "",
|
|
265
|
+
time: 0
|
|
266
|
+
}), y = D(!1);
|
|
267
|
+
T(() => {
|
|
268
|
+
p.setTriggerName({
|
|
269
|
+
id: h,
|
|
270
|
+
labelledBy: g,
|
|
271
|
+
label: _,
|
|
272
|
+
form: f.form
|
|
273
|
+
});
|
|
274
|
+
let e = p.refs.domReference.current;
|
|
275
|
+
return e && p.setDirection(e.ownerDocument.defaultView?.getComputedStyle(e).direction ?? "ltr"), () => p.setTriggerName(null);
|
|
276
|
+
}, [
|
|
277
|
+
h,
|
|
278
|
+
g,
|
|
279
|
+
_,
|
|
280
|
+
f.form,
|
|
281
|
+
p.setTriggerName
|
|
282
|
+
]);
|
|
283
|
+
let b = (e) => {
|
|
284
|
+
if (a?.(e), !(e.defaultPrevented || p.disabled || i || e.nativeEvent.isComposing)) {
|
|
285
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
286
|
+
if (e.preventDefault(), e.repeat || y.current) return;
|
|
287
|
+
if (y.current = !0, !p.open) p.requestOpen(!0);
|
|
288
|
+
else if (p.activeIndex !== null) {
|
|
289
|
+
let e = p.byIndex[p.activeIndex];
|
|
290
|
+
e !== void 0 && p.toggle(e);
|
|
291
|
+
}
|
|
292
|
+
} else if (e.key === "Tab") p.requestOpen(!1);
|
|
293
|
+
else if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
294
|
+
let t = performance.now(), n = (t - v.current.time > oe ? "" : v.current.text) + e.key;
|
|
295
|
+
v.current = {
|
|
296
|
+
text: n,
|
|
297
|
+
time: t
|
|
298
|
+
};
|
|
299
|
+
for (let e = 1; e <= p.byIndex.length; e++) {
|
|
300
|
+
let t = ((p.activeIndex ?? -1) + e) % p.byIndex.length, r = p.byIndex[t], i = r === void 0 ? void 0 : p.options.get(r);
|
|
301
|
+
if (i && !i.disabled && p.formatters.collator.compare(i.label.slice(0, n.length), n) === 0) {
|
|
302
|
+
p.requestOpen(!0), p.setActiveIndex(t);
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
return /* @__PURE__ */ j(n, {
|
|
310
|
+
className: u,
|
|
311
|
+
styles: [
|
|
312
|
+
c,
|
|
313
|
+
se,
|
|
314
|
+
ce[r]
|
|
315
|
+
],
|
|
316
|
+
sx: d,
|
|
317
|
+
children: (e) => /* @__PURE__ */ j("button", {
|
|
318
|
+
...p.getReferenceProps({
|
|
319
|
+
...f,
|
|
320
|
+
id: h,
|
|
321
|
+
disabled: p.disabled || i,
|
|
322
|
+
onKeyDown: b,
|
|
323
|
+
onKeyUp: (e) => {
|
|
324
|
+
o?.(e), (e.key === "Enter" || e.key === " ") && (y.current = !1), e.key === " " && e.preventDefault();
|
|
325
|
+
},
|
|
326
|
+
onClick: (e) => {
|
|
327
|
+
s?.(e), !e.defaultPrevented && !p.disabled && !i && p.requestOpen(!p.open);
|
|
328
|
+
},
|
|
329
|
+
onBlur: (e) => {
|
|
330
|
+
y.current = !1, l?.(e);
|
|
331
|
+
}
|
|
332
|
+
}),
|
|
333
|
+
type: "button",
|
|
334
|
+
ref: m,
|
|
335
|
+
role: "combobox",
|
|
336
|
+
"aria-haspopup": "listbox",
|
|
337
|
+
"aria-expanded": p.open,
|
|
338
|
+
"aria-controls": p.listId,
|
|
339
|
+
"aria-activedescendant": p.activeId,
|
|
340
|
+
"aria-labelledby": g,
|
|
341
|
+
"aria-describedby": V(f["aria-describedby"], `${p.baseId}-summary`, p.descriptionId, p.errorId),
|
|
342
|
+
"aria-required": p.required || void 0,
|
|
343
|
+
"aria-invalid": p.errorId || p.invalid ? !0 : f["aria-invalid"],
|
|
344
|
+
"data-ui": "multi-select",
|
|
345
|
+
"data-state": p.open ? "open" : "closed",
|
|
346
|
+
className: e
|
|
347
|
+
})
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
W.displayName = "MultiSelect.Trigger";
|
|
351
|
+
function G({ ref: e, maxVisible: t = 2, placeholder: r, className: i, sx: a, ...o }) {
|
|
352
|
+
let s = B("Value");
|
|
353
|
+
if (!Number.isFinite(t) || !Number.isInteger(t) || t < 0) throw RangeError("MultiSelect.Value maxVisible must be a finite nonnegative integer.");
|
|
354
|
+
let c = s.selected.map((e) => s.options.get(e)?.label ?? e), l = Math.max(0, c.length - t);
|
|
355
|
+
return /* @__PURE__ */ j(n, {
|
|
356
|
+
className: i,
|
|
357
|
+
styles: le,
|
|
358
|
+
sx: a,
|
|
359
|
+
children: (n) => /* @__PURE__ */ j("span", {
|
|
360
|
+
...o,
|
|
361
|
+
ref: e,
|
|
362
|
+
"aria-hidden": "true",
|
|
363
|
+
"data-ui": "multi-select-value",
|
|
364
|
+
"data-placeholder": !c.length || void 0,
|
|
365
|
+
className: n,
|
|
366
|
+
children: c.length ? /* @__PURE__ */ M(A, { children: [c.slice(0, t).map((e, t) => /* @__PURE__ */ j("span", {
|
|
367
|
+
css: P,
|
|
368
|
+
children: e
|
|
369
|
+
}, s.selected[t])), l > 0 && /* @__PURE__ */ M("span", {
|
|
370
|
+
css: P,
|
|
371
|
+
children: ["+", s.formatters.number.format(l)]
|
|
372
|
+
})] }) : r
|
|
373
|
+
})
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
G.displayName = "MultiSelect.Value";
|
|
377
|
+
function K({ ref: e, id: t, children: r, style: i, onMouseDown: a, className: o, sx: s, ...c }) {
|
|
378
|
+
let l = B("Content"), u = t ?? `${l.baseId}-listbox`;
|
|
379
|
+
T(() => (l.setListId(u), () => l.setListId(`${l.baseId}-listbox`)), [
|
|
380
|
+
u,
|
|
381
|
+
l.baseId,
|
|
382
|
+
l.setListId
|
|
383
|
+
]);
|
|
384
|
+
let d = N([l.open ? l.refs.setFloating : null, e]), f = c["aria-label"] !== void 0 || c["aria-labelledby"] !== void 0 ? {} : {
|
|
385
|
+
"aria-label": l.triggerName?.label,
|
|
386
|
+
"aria-labelledby": l.triggerName?.labelledBy ?? (l.triggerName?.label ? void 0 : l.triggerName?.id)
|
|
387
|
+
};
|
|
388
|
+
return /* @__PURE__ */ j(b, { children: /* @__PURE__ */ j(n, {
|
|
389
|
+
className: o,
|
|
390
|
+
styles: [
|
|
391
|
+
h,
|
|
392
|
+
p,
|
|
393
|
+
de
|
|
394
|
+
],
|
|
395
|
+
sx: s,
|
|
396
|
+
children: (e) => /* @__PURE__ */ j("div", {
|
|
397
|
+
...l.getFloatingProps({
|
|
398
|
+
...f,
|
|
399
|
+
...c,
|
|
400
|
+
onMouseDown: (e) => {
|
|
401
|
+
a?.(e), e.preventDefault();
|
|
402
|
+
}
|
|
403
|
+
}),
|
|
404
|
+
id: u,
|
|
405
|
+
dir: c.dir ?? l.direction,
|
|
406
|
+
ref: d,
|
|
407
|
+
role: "listbox",
|
|
408
|
+
"aria-multiselectable": "true",
|
|
409
|
+
hidden: !l.open,
|
|
410
|
+
"data-ui": "multi-select-content",
|
|
411
|
+
className: e,
|
|
412
|
+
style: {
|
|
413
|
+
...i,
|
|
414
|
+
...l.floatingStyles,
|
|
415
|
+
inlineSize: l.refs.domReference.current?.getBoundingClientRect().width,
|
|
416
|
+
maxBlockSize: l.available.height || void 0,
|
|
417
|
+
maxInlineSize: l.available.width || void 0
|
|
418
|
+
},
|
|
419
|
+
children: /* @__PURE__ */ j(ee, {
|
|
420
|
+
elementsRef: l.elementsRef,
|
|
421
|
+
children: /* @__PURE__ */ j(z.Provider, {
|
|
422
|
+
value: !0,
|
|
423
|
+
children: r
|
|
424
|
+
})
|
|
425
|
+
})
|
|
426
|
+
})
|
|
427
|
+
}) });
|
|
428
|
+
}
|
|
429
|
+
K.displayName = "MultiSelect.Content";
|
|
430
|
+
function q({ ref: e, id: t, value: r, disabled: i = !1, textValue: a, onClick: o, children: s, className: c, sx: l, ...p }) {
|
|
431
|
+
let h = B("Item");
|
|
432
|
+
if (!C(z)) throw Error("MultiSelect.Item must be rendered inside MultiSelect.Content.");
|
|
433
|
+
let _ = D(null), b = t ?? y(h.baseId, r), x = v(r, h.registration, _, (e, t) => ({
|
|
434
|
+
index: e,
|
|
435
|
+
label: a ?? t,
|
|
436
|
+
disabled: i,
|
|
437
|
+
id: b
|
|
438
|
+
})), S = N([x.ref, e]), w = h.selected.includes(r);
|
|
439
|
+
return /* @__PURE__ */ j(n, {
|
|
440
|
+
className: c,
|
|
441
|
+
styles: [
|
|
442
|
+
f,
|
|
443
|
+
g,
|
|
444
|
+
d,
|
|
445
|
+
fe
|
|
446
|
+
],
|
|
447
|
+
sx: l,
|
|
448
|
+
children: (e) => /* @__PURE__ */ M("div", {
|
|
449
|
+
...h.getItemProps({
|
|
450
|
+
...p,
|
|
451
|
+
onClick: (e) => {
|
|
452
|
+
o?.(e), e.defaultPrevented || h.toggle(r);
|
|
453
|
+
}
|
|
454
|
+
}),
|
|
455
|
+
id: b,
|
|
456
|
+
ref: S,
|
|
457
|
+
role: "option",
|
|
458
|
+
"aria-selected": w,
|
|
459
|
+
"aria-disabled": h.disabled || i || void 0,
|
|
460
|
+
"data-active": x.index >= 0 && h.activeIndex === x.index && !h.disabled || void 0,
|
|
461
|
+
"data-ui": "multi-select-item",
|
|
462
|
+
className: e,
|
|
463
|
+
children: [/* @__PURE__ */ j("span", {
|
|
464
|
+
ref: _,
|
|
465
|
+
css: u,
|
|
466
|
+
children: s
|
|
467
|
+
}), w && /* @__PURE__ */ j("span", {
|
|
468
|
+
"aria-hidden": "true",
|
|
469
|
+
css: m,
|
|
470
|
+
children: "✓"
|
|
471
|
+
})]
|
|
472
|
+
})
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
q.displayName = "MultiSelect.Item";
|
|
476
|
+
function J({ ref: e, disabled: t, onClick: r, children: i, className: a, sx: o, ...s }) {
|
|
477
|
+
let l = B("Clear"), u = l.selected.filter((e) => l.options.get(e)?.disabled), d = D(null), [, f] = O(0), p = N([l.clearRef, e]);
|
|
478
|
+
return T(() => {
|
|
479
|
+
d.current && !l.open && d.current.length === l.selected.length && d.current.every((e, t) => e === l.selected[t]) && l.refs.domReference.current?.focus(), d.current = null;
|
|
480
|
+
}), /* @__PURE__ */ j(n, {
|
|
481
|
+
className: a,
|
|
482
|
+
styles: [c, L],
|
|
483
|
+
sx: o,
|
|
484
|
+
children: (e) => /* @__PURE__ */ j("button", {
|
|
485
|
+
...s,
|
|
486
|
+
ref: p,
|
|
487
|
+
type: "button",
|
|
488
|
+
disabled: l.disabled || t || u.length === l.selected.length,
|
|
489
|
+
"aria-label": s["aria-label"] ?? l.messages.clearLabel,
|
|
490
|
+
"data-ui": "multi-select-clear",
|
|
491
|
+
className: e,
|
|
492
|
+
onClick: (e) => {
|
|
493
|
+
r?.(e), !e.defaultPrevented && (d.current = u, l.change(u), l.requestOpen(!1), f((e) => e + 1));
|
|
494
|
+
},
|
|
495
|
+
children: i === void 0 ? "×" : i
|
|
496
|
+
})
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
J.displayName = "MultiSelect.Clear";
|
|
500
|
+
function Y({ ref: e, id: t, children: r, className: i, sx: a, ...o }) {
|
|
501
|
+
let c = B("Label"), l = t ?? `${c.baseId}-label`, u = s(r);
|
|
502
|
+
return T(() => {
|
|
503
|
+
if (u) return c.setLabelId(l), () => c.setLabelId(void 0);
|
|
504
|
+
}, [
|
|
505
|
+
l,
|
|
506
|
+
u,
|
|
507
|
+
c.setLabelId
|
|
508
|
+
]), u ? /* @__PURE__ */ j(n, {
|
|
509
|
+
className: i,
|
|
510
|
+
styles: F,
|
|
511
|
+
sx: a,
|
|
512
|
+
children: (t) => /* @__PURE__ */ j("label", {
|
|
513
|
+
htmlFor: c.triggerName?.id ?? `${c.baseId}-trigger`,
|
|
514
|
+
...o,
|
|
515
|
+
id: l,
|
|
516
|
+
ref: e,
|
|
517
|
+
"data-ui": "multi-select-label",
|
|
518
|
+
className: t,
|
|
519
|
+
children: r
|
|
520
|
+
})
|
|
521
|
+
}) : null;
|
|
522
|
+
}
|
|
523
|
+
Y.displayName = "MultiSelect.Label";
|
|
524
|
+
function X({ part: e, error: t = !1, ref: r, id: i, children: a, className: o, sx: c, ...l }) {
|
|
525
|
+
let u = B(e), d = i ?? `${u.baseId}-${e}`, f = s(a), p = t ? u.setErrorId : u.setDescriptionId;
|
|
526
|
+
return T(() => {
|
|
527
|
+
if (f) return p(d), () => p(void 0);
|
|
528
|
+
}, [
|
|
529
|
+
d,
|
|
530
|
+
f,
|
|
531
|
+
p
|
|
532
|
+
]), f ? /* @__PURE__ */ j(n, {
|
|
533
|
+
className: o,
|
|
534
|
+
styles: [F, t && ue],
|
|
535
|
+
sx: c,
|
|
536
|
+
children: (n) => /* @__PURE__ */ j("span", {
|
|
537
|
+
...l,
|
|
538
|
+
ref: r,
|
|
539
|
+
id: d,
|
|
540
|
+
role: t ? "alert" : l.role,
|
|
541
|
+
"data-ui": `multi-select-${e}`,
|
|
542
|
+
className: n,
|
|
543
|
+
children: a
|
|
544
|
+
})
|
|
545
|
+
}) : null;
|
|
546
|
+
}
|
|
547
|
+
function Z(e) {
|
|
548
|
+
return /* @__PURE__ */ j(X, {
|
|
549
|
+
...e,
|
|
550
|
+
part: "description"
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
Z.displayName = "MultiSelect.Description";
|
|
554
|
+
function Q(e) {
|
|
555
|
+
return /* @__PURE__ */ j(X, {
|
|
556
|
+
...e,
|
|
557
|
+
part: "error",
|
|
558
|
+
error: !0
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
Q.displayName = "MultiSelect.Error";
|
|
562
|
+
function $({ ref: e, children: t, className: r, sx: i, ...a }) {
|
|
563
|
+
let c = B("Empty");
|
|
564
|
+
if (c.options.size) return null;
|
|
565
|
+
let l = t === void 0 ? c.messages.empty : t;
|
|
566
|
+
return s(l) ? /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(n, {
|
|
567
|
+
className: r,
|
|
568
|
+
styles: F,
|
|
569
|
+
sx: i,
|
|
570
|
+
children: (t) => /* @__PURE__ */ j("div", {
|
|
571
|
+
...a,
|
|
572
|
+
ref: e,
|
|
573
|
+
"aria-hidden": "true",
|
|
574
|
+
"data-ui": "multi-select-empty",
|
|
575
|
+
className: t,
|
|
576
|
+
children: l
|
|
577
|
+
})
|
|
578
|
+
}), /* @__PURE__ */ j(b, { children: /* @__PURE__ */ j("div", {
|
|
579
|
+
role: "status",
|
|
580
|
+
css: o,
|
|
581
|
+
hidden: !c.open,
|
|
582
|
+
children: l
|
|
583
|
+
}) })] }) : null;
|
|
584
|
+
}
|
|
585
|
+
$.displayName = "MultiSelect.Empty";
|
|
586
|
+
var me = Object.assign(U, {
|
|
587
|
+
Trigger: W,
|
|
588
|
+
Value: G,
|
|
589
|
+
Content: K,
|
|
590
|
+
Item: q,
|
|
591
|
+
Clear: J,
|
|
592
|
+
Label: Y,
|
|
593
|
+
Description: Z,
|
|
594
|
+
Error: Q,
|
|
595
|
+
Empty: $
|
|
596
|
+
});
|
|
597
|
+
//#endregion
|
|
598
|
+
export { me as t };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
3
|
import { t as n } from "./disclosure-caret-C5T3fcl6.js";
|
|
4
4
|
import { t as r } from "./focus-ring-BK5W5_NY.js";
|
|
5
|
-
import { n as i,
|
|
5
|
+
import { n as i, r as a } from "./media-8yrN85VT.js";
|
|
6
6
|
import { t as o } from "./renderable-DzcIj1Lo.js";
|
|
7
7
|
import { t as s } from "./icon-wrapper-stN8sD7R.js";
|
|
8
8
|
import { useId as c } from "react";
|
|
@@ -11,6 +11,8 @@ import { Fragment as u, jsx as d, jsxs as f } from "@emotion/react/jsx-runtime";
|
|
|
11
11
|
//#region src/components/navigation/navigation.tsx
|
|
12
12
|
var p = l.space[8], m = "0.06em", h = e({
|
|
13
13
|
display: "grid",
|
|
14
|
+
minInlineSize: 0,
|
|
15
|
+
overflowWrap: "anywhere",
|
|
14
16
|
gap: l.space[4],
|
|
15
17
|
fontFamily: l.font.sans
|
|
16
18
|
}), g = e({
|
|
@@ -49,10 +51,14 @@ var p = l.space[8], m = "0.06em", h = e({
|
|
|
49
51
|
color: l.color.text
|
|
50
52
|
},
|
|
51
53
|
"&:focus-visible": { ...r },
|
|
52
|
-
[
|
|
54
|
+
[a]: {
|
|
53
55
|
transitionDuration: "0s",
|
|
54
56
|
"&::after": { transitionDuration: "0s" }
|
|
55
|
-
}
|
|
57
|
+
},
|
|
58
|
+
[i]: { "&::after": {
|
|
59
|
+
forcedColorAdjust: "none",
|
|
60
|
+
color: "ButtonText"
|
|
61
|
+
} }
|
|
56
62
|
}), y = e({
|
|
57
63
|
display: "grid",
|
|
58
64
|
gap: l.space[1],
|
|
@@ -87,8 +93,8 @@ var p = l.space[8], m = "0.06em", h = e({
|
|
|
87
93
|
pointerEvents: "none"
|
|
88
94
|
},
|
|
89
95
|
"&:focus-visible": { ...r },
|
|
90
|
-
[
|
|
91
|
-
[
|
|
96
|
+
[a]: { transitionDuration: "0s" },
|
|
97
|
+
[i]: { "&[aria-current=\"page\"]": {
|
|
92
98
|
forcedColorAdjust: "none",
|
|
93
99
|
backgroundColor: "SelectedItem",
|
|
94
100
|
color: "SelectedItemText"
|
|
@@ -102,7 +108,7 @@ function x({ ref: e, label: n = "Main", className: r, sx: i, ...a }) {
|
|
|
102
108
|
children: (t) => /* @__PURE__ */ d("nav", {
|
|
103
109
|
...a,
|
|
104
110
|
ref: e,
|
|
105
|
-
"aria-label": n,
|
|
111
|
+
"aria-label": a["aria-label"] ?? n,
|
|
106
112
|
"data-ui": "navigation",
|
|
107
113
|
className: t
|
|
108
114
|
})
|
|
@@ -149,16 +155,16 @@ function S({ ref: e, label: n, collapsible: r = !1, defaultOpen: i, children: a,
|
|
|
149
155
|
}
|
|
150
156
|
S.displayName = "Navigation.Group";
|
|
151
157
|
function C({ ref: e, href: n, active: r = !1, disabled: i = !1, icon: a, children: c, className: l, sx: p, ...m }) {
|
|
152
|
-
let h = /* @__PURE__ */ f(u, { children: [o(a) && /* @__PURE__ */ d("span", {
|
|
158
|
+
let h = i || m["aria-disabled"] === !0 || m["aria-disabled"] === "true", g = /* @__PURE__ */ f(u, { children: [o(a) && /* @__PURE__ */ d("span", {
|
|
153
159
|
"aria-hidden": "true",
|
|
154
160
|
"data-ui": "navigation-item-icon",
|
|
155
161
|
css: s,
|
|
156
162
|
children: a
|
|
157
|
-
}), c] }),
|
|
158
|
-
"aria-current": r ? "page" :
|
|
159
|
-
"aria-disabled":
|
|
160
|
-
tabIndex:
|
|
161
|
-
onClick:
|
|
163
|
+
}), c] }), _ = {
|
|
164
|
+
"aria-current": r ? "page" : m["aria-current"],
|
|
165
|
+
"aria-disabled": h || m["aria-disabled"],
|
|
166
|
+
tabIndex: h ? -1 : m.tabIndex,
|
|
167
|
+
onClick: h ? (e) => {
|
|
162
168
|
e.preventDefault();
|
|
163
169
|
} : m.onClick
|
|
164
170
|
};
|
|
@@ -170,20 +176,20 @@ function C({ ref: e, href: n, active: r = !1, disabled: i = !1, icon: a, childre
|
|
|
170
176
|
sx: p,
|
|
171
177
|
children: (t) => n === void 0 ? /* @__PURE__ */ d("span", {
|
|
172
178
|
...m,
|
|
173
|
-
...
|
|
179
|
+
..._,
|
|
174
180
|
ref: e,
|
|
175
181
|
"data-ui": "navigation-item",
|
|
176
182
|
className: t,
|
|
177
|
-
children:
|
|
183
|
+
children: g
|
|
178
184
|
}) : /* @__PURE__ */ d("a", {
|
|
179
185
|
...m,
|
|
180
|
-
...
|
|
186
|
+
..._,
|
|
181
187
|
ref: e,
|
|
182
|
-
href:
|
|
183
|
-
role:
|
|
188
|
+
href: h ? void 0 : n,
|
|
189
|
+
role: h ? "link" : void 0,
|
|
184
190
|
"data-ui": "navigation-item",
|
|
185
191
|
className: t,
|
|
186
|
-
children:
|
|
192
|
+
children: g
|
|
187
193
|
})
|
|
188
194
|
})
|
|
189
195
|
});
|
package/dist/navigation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Navigation } from "./navigation-
|
|
2
|
+
export { t as Navigation } from "./navigation-CC26JDr-.js";
|