@alfadocs/ui-kit 0.1.9 → 0.2.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 +30 -0
- package/dist/_chunks/accordion-DOmxGEWU.js +228 -0
- package/dist/_chunks/{agenda-card-DwLIxgi7.js → agenda-card-CalZqycc.js} +12 -3
- package/dist/_chunks/{agenda-tray-DUvengGQ.js → agenda-tray-3ffFDQZC.js} +54 -51
- package/dist/_chunks/{ai-prompt-input.agent-0NHYLTWD.js → ai-prompt-input-BBiDlEIS.js} +231 -231
- package/dist/_chunks/{alert-BlOUMkXj.js → alert-B1sj8Ss0.js} +24 -14
- package/dist/_chunks/{apexcharts-theme-BkSShpEy.js → apexcharts-theme-BJigns_V.js} +7 -2
- package/dist/_chunks/{app-frame-6d7Lu4ea.js → app-frame-CDJOgPXe.js} +7 -16
- package/dist/_chunks/{audio-recorder.agent--VKeykUp.js → audio-recorder-B4U1LuiQ.js} +161 -162
- package/dist/_chunks/{audio-visualiser-CeMPCZkd.js → audio-visualiser-ByDEFLNm.js} +25 -19
- package/dist/_chunks/autocomplete-D4oUZbsP.js +466 -0
- package/dist/_chunks/{badge-mrstWxve.js → badge-DKFbntoa.js} +16 -13
- package/dist/_chunks/{balance-cell-renderer-5CA7zpAi.js → balance-cell-renderer-B8zgIM-m.js} +63 -44
- package/dist/_chunks/{breadcrumb.agent-GM2hAKFX.js → breadcrumb-D1snXjPb.js} +165 -157
- package/dist/_chunks/{button-7mLWcMp_.js → button-DD_0Xdmr.js} +12 -2
- package/dist/_chunks/{calendar-nGEgelJs.js → calendar-zy0tUUVG.js} +13 -18
- package/dist/_chunks/{card-BEy58ZKp.js → card-CWzuTLYE.js} +40 -34
- package/dist/_chunks/{chart.agent-_pRYS17d.js → chart-BLvFl169.js} +147 -131
- package/dist/_chunks/chat-container-ClzsWXp2.js +220 -0
- package/dist/_chunks/chat-input-DOlsB1fm.js +333 -0
- package/dist/_chunks/{chat-message-ByouZpPP.js → chat-message-DoAhgUTj.js} +23 -13
- package/dist/_chunks/{collapsible.agent-DkS1jVyn.js → collapsible-CuxUBoHJ.js} +97 -99
- package/dist/_chunks/{color-picker-94qcBZqZ.js → color-picker-CTIcHlDF.js} +111 -45
- package/dist/_chunks/combobox-DCNXqbC7.js +460 -0
- package/dist/_chunks/command-palette-C_vgSgrI.js +441 -0
- package/dist/_chunks/{date-picker-BqPTn7bO.js → date-picker-B1PO1ZQP.js} +190 -181
- package/dist/_chunks/{date-range-picker-B2hGsffw.js → date-range-picker-mix2nEVC.js} +21 -8
- package/dist/_chunks/{date-time-picker-Bzt0S8yO.js → date-time-picker-Dnong_BY.js} +30 -15
- package/dist/_chunks/{description-list-DvJbp6Yg.js → description-list-BYA77Yud.js} +26 -23
- package/dist/_chunks/dialog-BPD7wlGE.js +211 -0
- package/dist/_chunks/dropdown-menu-CpiF6CPz.js +300 -0
- package/dist/_chunks/{empty-state-DQPtRp2b.js → empty-state-3CLJIXSj.js} +132 -101
- package/dist/_chunks/file-upload-C947ACDK.js +829 -0
- package/dist/_chunks/{floating-action-button-Cnw-f6AG.js → floating-action-button-C8OYj8mE.js} +9 -2
- package/dist/_chunks/{form-field-BfsPLTSc.js → form-field-Bmkeh7WY.js} +12 -11
- package/dist/_chunks/{form-field-context-94LwgYTQ.js → form-field-context-B3APVHKx.js} +4 -2
- package/dist/_chunks/{freemium-paywall.agent-_nQqLyRF.js → freemium-paywall-CnvceDav.js} +124 -117
- package/dist/_chunks/{header-BGn1mRp8.js → header-D0ULgQl3.js} +69 -68
- package/dist/_chunks/{icon-button-Wnnde5lc.js → icon-button-C4CGcYuz.js} +11 -3
- package/dist/_chunks/{kbd-8baVw3KU.js → kbd-Cglkd7CY.js} +6 -2
- package/dist/_chunks/{key-value-pair-JRFS9Xrh.js → key-value-pair-CgWvAIGb.js} +2 -2
- package/dist/_chunks/{leo-sidebar-BwINPdix.js → leo-sidebar-CfEY-xi2.js} +16 -20
- package/dist/_chunks/{link-QheANk74.js → link-8QmFjIz2.js} +2 -5
- package/dist/_chunks/list-qP6p0NTw.js +434 -0
- package/dist/_chunks/{logo-BpFoCL-s.js → logo-_Z-jLq80.js} +155 -26
- package/dist/_chunks/{matrix-rain-BEkvux64.js → matrix-rain-CRPMXcVx.js} +8 -2
- package/dist/_chunks/{message-card-qhoGv947.js → message-card-ChCX9Iv6.js} +63 -60
- package/dist/_chunks/{message-tray-xHUCra-Y.js → message-tray-n8q9ITXI.js} +71 -76
- package/dist/_chunks/{multi-select.agent-Do6CeQUT.js → multi-select-wqqrgjUQ.js} +326 -291
- package/dist/_chunks/{navigation-menu.agent-D69ND6Qq.js → navigation-menu-ClbHeawy.js} +136 -123
- package/dist/_chunks/{notification-card-CsVEYJE-.js → notification-card-hBlPN1-c.js} +3 -3
- package/dist/_chunks/{notification-tray-DTXMq42J.js → notification-tray-C5cnXbl9.js} +70 -66
- package/dist/_chunks/{number-input-fvGmnRy9.js → number-input-Q7wkHnvQ.js} +7 -3
- package/dist/_chunks/{otp-input-EglXOUue.js → otp-input-C9gUByF0.js} +6 -3
- package/dist/_chunks/{pagination.agent-BkZQl45y.js → pagination-3AC4zTsi.js} +234 -194
- package/dist/_chunks/{password-input-D6kuYXmr.js → password-input-C4LmjIH1.js} +6 -9
- package/dist/_chunks/{patient-shell-BRmrrUUW.js → patient-shell-BlsEUKWB.js} +10 -15
- package/dist/_chunks/{payment-form-BWaXas8z.js → payment-form-C3vT_npe.js} +195 -186
- package/dist/_chunks/{pdf-viewer.agent-BaGEDheA.js → pdf-viewer-CZIfY08H.js} +270 -241
- package/dist/_chunks/{phone-input-C8Op4sEc.js → phone-input-CSHJOJ13.js} +4 -9
- package/dist/_chunks/popover-DekUKNBk.js +293 -0
- package/dist/_chunks/{privacy-lock.agent-C1i1-T58.js → privacy-lock-BKsI6ReN.js} +117 -109
- package/dist/_chunks/progress-C11tqhoI.js +298 -0
- package/dist/_chunks/{recaptcha-widget.agent-BGHpU5zD.js → recaptcha-widget-NyfOfLII.js} +95 -86
- package/dist/_chunks/resizable-mpXXyIsN.js +483 -0
- package/dist/_chunks/{rich-text-editor.agent-DnE125Tz.js → rich-text-editor-C7TCIlQO.js} +298 -209
- package/dist/_chunks/{scroll-area-DLr5w9Dd.js → scroll-area-DEDU-lp-.js} +67 -54
- package/dist/_chunks/{search-bar.agent-DxFAxctc.js → search-bar-BTDfgYtg.js} +291 -268
- package/dist/_chunks/{search-input-Xw3cdWXW.js → search-input-CdJIEjFo.js} +116 -107
- package/dist/_chunks/{select-DY1Cb2Tg.js → select-y6bXV1f1.js} +84 -83
- package/dist/_chunks/{separator-B4wXDLNC.js → separator-CYU_bGFn.js} +2 -5
- package/dist/_chunks/{sheet-B9kH9pcI.js → sheet-4tgMFwj0.js} +135 -60
- package/dist/_chunks/{sidebar-CHF5xr_P.js → sidebar-Bx3wCDyy.js} +546 -457
- package/dist/_chunks/{sign-in-with-alfadocs-button-BN_FPGHT.js → sign-in-with-alfadocs-button-B9UrqOqH.js} +9 -5
- package/dist/_chunks/{signature-capture.agent-BpeDwFht.js → signature-capture-DjMlFOzS.js} +210 -212
- package/dist/_chunks/{skeleton-dtqyF09N.js → skeleton-CZbwyJAA.js} +9 -3
- package/dist/_chunks/{slider-CcsQTZTA.js → slider-BT2bZWsy.js} +138 -134
- package/dist/_chunks/{slot-grid-D_l5VsHG.js → slot-grid-CgpYgBkW.js} +105 -95
- package/dist/_chunks/{sparkline.agent-56Sj7nOP.js → sparkline-_gy8aJDG.js} +107 -100
- package/dist/_chunks/{spinner-GCcv67vh.js → spinner-DLaYfLPl.js} +66 -14
- package/dist/_chunks/{stat-DUB6g90R.js → stat-B9PHSPbN.js} +45 -27
- package/dist/_chunks/{stepper-calendar.agent-9iT3ClIB.js → stepper-calendar-BLOJUE0-.js} +189 -187
- package/dist/_chunks/stepper-progress-jFY8BSf7.js +208 -0
- package/dist/_chunks/{suggestion-chip-DhFrkRPj.js → suggestion-chip-C4Jz0LrM.js} +50 -52
- package/dist/_chunks/{switch-BYEH8I53.js → switch-C0psfIQF.js} +2 -2
- package/dist/_chunks/{tabs.agent-h7NvsTR1.js → tabs-DaFA3Muo.js} +183 -155
- package/dist/_chunks/{tag-BqidXKo3.js → tag-DuLMjRbF.js} +90 -32
- package/dist/_chunks/{task-card-CY5ztNkU.js → task-card-Dw_ZJDL8.js} +5 -2
- package/dist/_chunks/{task-tray-CCoUdorl.js → task-tray-XlIW9ueh.js} +50 -49
- package/dist/_chunks/{text-area-C_M8wliK.js → text-area-CO9Dz0qX.js} +2 -2
- package/dist/_chunks/{text-input-BX39e6T6.js → text-input-DZwt9L8H.js} +65 -62
- package/dist/_chunks/{theme-root-DDb0TJjd.js → theme-root-CSKD5ZRm.js} +9 -2
- package/dist/_chunks/{theme-toggle.agent-btmXTWdW.js → theme-toggle-B9zzCnvl.js} +179 -177
- package/dist/_chunks/{time-picker-B8AMIrX7.js → time-picker-DvPUmHH-.js} +95 -93
- package/dist/_chunks/{timeline.agent-CRPza9wc.js → timeline-BvmnQadS.js} +96 -96
- package/dist/_chunks/{toast.agent-BjEGuq1Z.js → toast.agent-BwKXA0km.js} +46 -8
- package/dist/_chunks/{tooth-scheme.agent-CWrQBjJM.js → tooth-scheme-3mITSXiZ.js} +146 -162
- package/dist/_chunks/{transcript-panel.agent-BXEYP6w-.js → transcript-panel-Bx5ANMsv.js} +110 -101
- package/dist/_chunks/{typing-indicator-CbUBf-Dx.js → typing-indicator-BZ5jXZPn.js} +27 -5
- package/dist/_chunks/{use-theme-BMUhembX.js → use-theme-B1cwAXJR.js} +2 -5
- package/dist/_chunks/{visually-hidden-Bw7vBHLm.js → visually-hidden-BHxEUGyT.js} +11 -2
- package/dist/_chunks/{warning-stack-8Pa3pekh.js → warning-stack-VygGHSqC.js} +11 -13
- package/dist/_chunks/{workflow-map-D2A7rTEG.js → workflow-map-C-nlogPC.js} +430 -452
- package/dist/agent-catalog.json +580 -15
- package/dist/components/_shared/index.d.ts +2 -2
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/index.js +5 -6
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/agenda-tray.d.ts +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-prompt-input/ai-prompt-input.d.ts +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/alert/index.d.ts +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/app-frame/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/audio-visualiser/index.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/chart/index.d.ts +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/chat-container/chat-container.d.ts +1 -1
- package/dist/components/chat-container/index.js +2 -3
- package/dist/components/chat-input/chat-input.d.ts +1 -1
- package/dist/components/chat-input/index.js +3 -4
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/checkbox-group/index.d.ts +1 -1
- package/dist/components/collapsible/collapsible.d.ts +1 -1
- package/dist/components/collapsible/index.d.ts +1 -1
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/command-palette.d.ts +46 -13
- package/dist/components/command-palette/index.js +1 -1
- package/dist/components/data-table/data-table.d.ts +3 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/data-table/toolbar.d.ts +6 -5
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/date-picker/index.d.ts +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.d.ts +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/description-list/description-list.d.ts +1 -2
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +11 -16
- package/dist/components/dropdown-menu/index.js +3 -4
- package/dist/components/empty-state/index.js +1 -1
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/floating-action-button/index.js +1 -1
- package/dist/components/form-field/index.js +2 -2
- package/dist/components/freemium-paywall/freemium-paywall.d.ts +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/header/index.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/kbd/index.js +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/list/index.js +1 -1
- package/dist/components/logo/index.js +1 -1
- package/dist/components/matrix-rain/index.js +1 -1
- package/dist/components/message-card/index.d.ts +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/message-tray/message-tray.d.ts +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/navigation-menu/navigation-menu.d.ts +1 -1
- package/dist/components/notification-card/index.d.ts +1 -1
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/notification-tray/notification-tray.d.ts +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/pagination.d.ts +4 -6
- package/dist/components/password-input/index.js +1 -1
- package/dist/components/payment-form/index.js +7 -8
- package/dist/components/payment-form/payment-form.d.ts +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/phone-input/index.d.ts +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/popover/index.js +3 -4
- package/dist/components/privacy-lock/index.js +1 -1
- package/dist/components/privacy-lock/privacy-lock.d.ts +1 -1
- package/dist/components/progress/index.js +3 -4
- package/dist/components/recaptcha-widget/index.js +1 -1
- package/dist/components/resizable/index.d.ts +1 -1
- package/dist/components/resizable/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/search-bar/search-bar.d.ts +1 -1
- package/dist/components/search-input/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/separator/index.js +1 -1
- package/dist/components/sheet/index.js +3 -4
- package/dist/components/sheet/sheet.d.ts +2 -2
- package/dist/components/sidebar/index.js +7 -8
- package/dist/components/sidebar/sidebar.d.ts +0 -2
- package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
- package/dist/components/signature-capture/index.js +1 -1
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/spinner/index.js +1 -1
- package/dist/components/stat/index.js +1 -1
- package/dist/components/stepper-calendar/index.js +1 -1
- package/dist/components/stepper-calendar/stepper-calendar.d.ts +1 -1
- package/dist/components/stepper-progress/index.d.ts +1 -1
- package/dist/components/stepper-progress/index.js +1 -2
- package/dist/components/stepper-progress/stepper-progress.d.ts +1 -1
- package/dist/components/suggestion-chip/index.js +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/task-tray/task-tray.d.ts +1 -1
- package/dist/components/text-area/index.js +1 -1
- package/dist/components/text-input/index.js +1 -1
- package/dist/components/theme-root/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/theme-toggle/theme-toggle.d.ts +1 -1
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/timeline/timeline.d.ts +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/tooth-scheme/tooth-scheme.d.ts +1 -1
- package/dist/components/transcript-panel/index.js +1 -1
- package/dist/components/transcript-panel/transcript-panel.d.ts +1 -1
- package/dist/components/typing-indicator/index.js +1 -1
- package/dist/components/visually-hidden/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/components/workflow/workflow-editor.d.ts +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/index.js +392 -402
- package/dist/patterns/leo-assistant/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/safe-html/index.js +20 -3
- package/dist/tokens.css +2 -2
- package/package.json +12 -2
- package/dist/_chunks/accordion-BEnrZmAn.js +0 -120
- package/dist/_chunks/accordion.agent-BTjeO1Sx.js +0 -52
- package/dist/_chunks/autocomplete.agent-Dh7KioS6.js +0 -432
- package/dist/_chunks/chat-container-Dl0Kfy5a.js +0 -175
- package/dist/_chunks/chat-container.agent-CM4WModE.js +0 -27
- package/dist/_chunks/chat-input-C_tMQv92.js +0 -252
- package/dist/_chunks/chat-input.agent-Bsz3ckGa.js +0 -69
- package/dist/_chunks/combobox.agent-CAvUkkIe.js +0 -410
- package/dist/_chunks/command-palette.agent-HatEt_EM.js +0 -391
- package/dist/_chunks/dialog.agent-Daf1TTko.js +0 -179
- package/dist/_chunks/dropdown-menu-C7AZipNz.js +0 -219
- package/dist/_chunks/dropdown-menu.agent-BcxIKOjK.js +0 -43
- package/dist/_chunks/file-upload.agent-DJaH2dHg.js +0 -681
- package/dist/_chunks/list.agent-D0iWt4VI.js +0 -420
- package/dist/_chunks/payment-form.agent-kuIfodCj.js +0 -31
- package/dist/_chunks/popover-kFN8s84V.js +0 -229
- package/dist/_chunks/popover.agent-K_d1cfbj.js +0 -39
- package/dist/_chunks/progress-wNsqkw8I.js +0 -253
- package/dist/_chunks/progress.agent-C68rDOXL.js +0 -27
- package/dist/_chunks/resizable.agent-CMwZzvsi.js +0 -456
- package/dist/_chunks/sheet.agent-QAyTOxgk.js +0 -46
- package/dist/_chunks/sidebar.agent-C9TM_ZDZ.js +0 -49
- package/dist/_chunks/stepper-progress-Bmen-YXB.js +0 -149
- package/dist/_chunks/stepper-progress.agent-q9InWca4.js +0 -61
|
@@ -1,34 +1,106 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import * as
|
|
1
|
+
import { jsx as n, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Me, useContext as Pe, useState as L, useRef as k, useMemo as O, useEffect as Q, useCallback as je, useLayoutEffect as $e } from "react";
|
|
3
|
+
import * as z from "@radix-ui/react-popover";
|
|
4
4
|
import { _ as u } from "./index-4xgbg-sn.js";
|
|
5
|
-
import { c as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { u as
|
|
8
|
-
import { T as
|
|
9
|
-
import { c as
|
|
10
|
-
import { g as
|
|
11
|
-
import { b as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
5
|
+
import { c as ue } from "./index-D2ZczOXr.js";
|
|
6
|
+
import { useTranslation as Be } from "react-i18next";
|
|
7
|
+
import { u as Ke, F as Ue } from "./form-field-context-B3APVHKx.js";
|
|
8
|
+
import { T as de } from "./tooltip-DHik5yRI.js";
|
|
9
|
+
import { c as Qe } from "./compose-refs-C0k0tdqF.js";
|
|
10
|
+
import { g as Ye } from "./group-options-BvKhQ3xb.js";
|
|
11
|
+
import { b as Y, c as Ge } from "./input-surface-u4QB0lxe.js";
|
|
12
|
+
import { u as He } from "./registry-C9nwlNyL.js";
|
|
13
|
+
import { X as Xe } from "./x-CCcI3eJp.js";
|
|
14
|
+
import { C as Je } from "./check-DPdL_Sm7.js";
|
|
15
|
+
const We = {
|
|
16
|
+
id: "multi-select",
|
|
17
|
+
capabilities: ["select_multiple", "filter", "open", "close"],
|
|
18
|
+
state: {
|
|
19
|
+
selection: {
|
|
20
|
+
type: "string[]",
|
|
21
|
+
description: "Values of currently-selected options.",
|
|
22
|
+
read: (i) => i.getSelection()
|
|
23
|
+
},
|
|
24
|
+
query: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Current filter query.",
|
|
27
|
+
read: (i) => i.getQuery()
|
|
28
|
+
},
|
|
29
|
+
isOpen: {
|
|
30
|
+
type: "boolean",
|
|
31
|
+
description: "True when the option list is visible.",
|
|
32
|
+
read: (i) => i.getIsOpen()
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
actions: {
|
|
36
|
+
set_selection: {
|
|
37
|
+
safety: "read",
|
|
38
|
+
argsType: "{ values: string[] }",
|
|
39
|
+
description: "Replace the current selection with the given list of values.",
|
|
40
|
+
invoke: (i, c) => {
|
|
41
|
+
i.setSelection(c.values);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
clear_selection: {
|
|
45
|
+
safety: "read",
|
|
46
|
+
description: "Clear the current selection.",
|
|
47
|
+
invoke: (i) => {
|
|
48
|
+
i.clearSelection();
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
apply_filter: {
|
|
52
|
+
safety: "read",
|
|
53
|
+
argsType: "{ query: string }",
|
|
54
|
+
description: "Set the filter query for the option list.",
|
|
55
|
+
invoke: (i, c) => {
|
|
56
|
+
i.setQuery(c.query);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
open: {
|
|
60
|
+
safety: "read",
|
|
61
|
+
description: "Open the option list.",
|
|
62
|
+
invoke: (i) => {
|
|
63
|
+
i.open();
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
close: {
|
|
67
|
+
safety: "read",
|
|
68
|
+
description: "Close the option list.",
|
|
69
|
+
invoke: (i) => {
|
|
70
|
+
i.close();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
domHooks: {
|
|
75
|
+
root: { attr: "data-component", value: "multi-select" },
|
|
76
|
+
instanceId: {
|
|
77
|
+
attr: "data-component-id",
|
|
78
|
+
sourceProp: "id",
|
|
79
|
+
description: "Sourced from the id prop."
|
|
80
|
+
},
|
|
81
|
+
item: {
|
|
82
|
+
attr: "data-option-id",
|
|
83
|
+
description: "Each option emits its value as data-option-id."
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}, Ze = ue(
|
|
15
87
|
[
|
|
16
88
|
"ds:inline-flex ds:flex-wrap ds:items-center ds:gap-1 ds:w-full",
|
|
17
|
-
|
|
89
|
+
Ge,
|
|
18
90
|
"ds:aria-[invalid=true]:border-destructive",
|
|
19
91
|
"ds:aria-disabled:cursor-not-allowed ds:aria-disabled:opacity-50"
|
|
20
92
|
],
|
|
21
93
|
{
|
|
22
94
|
variants: {
|
|
23
95
|
size: {
|
|
24
|
-
sm: `ds:min-h-8 ds:ps-2 ds:pe-2 ds:py-1 ${
|
|
25
|
-
md: `ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:py-1.5 ${
|
|
26
|
-
lg: `ds:min-h-12 ds:ps-4 ds:pe-4 ds:py-2 ${
|
|
96
|
+
sm: `ds:min-h-8 ds:ps-2 ds:pe-2 ds:py-1 ${Y.sm}`,
|
|
97
|
+
md: `ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:py-1.5 ${Y.md}`,
|
|
98
|
+
lg: `ds:min-h-12 ds:ps-4 ds:pe-4 ds:py-2 ${Y.lg}`
|
|
27
99
|
}
|
|
28
100
|
},
|
|
29
101
|
defaultVariants: { size: "md" }
|
|
30
102
|
}
|
|
31
|
-
),
|
|
103
|
+
), le = ue(
|
|
32
104
|
[
|
|
33
105
|
"ds:inline-flex ds:items-center ds:gap-1",
|
|
34
106
|
"ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-muted",
|
|
@@ -48,7 +120,7 @@ const Ke = oe(
|
|
|
48
120
|
},
|
|
49
121
|
defaultVariants: { size: "md" }
|
|
50
122
|
}
|
|
51
|
-
),
|
|
123
|
+
), et = [
|
|
52
124
|
"ds:inline-flex ds:items-center ds:justify-center ds:shrink-0",
|
|
53
125
|
"ds:rounded-[var(--radius-sm)]",
|
|
54
126
|
"ds:text-muted-foreground ds:hover:text-foreground",
|
|
@@ -57,7 +129,7 @@ const Ke = oe(
|
|
|
57
129
|
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
58
130
|
"ds:size-4",
|
|
59
131
|
'ds:relative ds:before:absolute ds:before:inset-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""]'
|
|
60
|
-
].join(" "),
|
|
132
|
+
].join(" "), tt = [
|
|
61
133
|
"ds:z-[var(--z-dropdown)] ds:overflow-hidden",
|
|
62
134
|
"ds:min-w-[var(--radix-popover-trigger-width)]",
|
|
63
135
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground",
|
|
@@ -68,258 +140,292 @@ const Ke = oe(
|
|
|
68
140
|
"ds:data-[side=bottom]:slide-in-from-top-2",
|
|
69
141
|
"ds:data-[side=top]:slide-in-from-bottom-2",
|
|
70
142
|
"ds:motion-reduce:animate-none"
|
|
71
|
-
].join(" "),
|
|
143
|
+
].join(" "), st = [
|
|
72
144
|
"ds:relative ds:flex ds:cursor-pointer ds:items-center",
|
|
73
145
|
"ds:rounded-[var(--radius-sm)] ds:ps-2 ds:pe-2 ds:py-1.5",
|
|
74
146
|
"ds:text-[var(--font-size-sm)] ds:text-foreground ds:outline-none ds:select-none",
|
|
75
147
|
"ds:data-[selected=true]:bg-muted ds:data-[selected=true]:text-foreground",
|
|
76
148
|
"ds:aria-[disabled=true]:pointer-events-none ds:aria-[disabled=true]:opacity-50",
|
|
77
149
|
"ds:data-[disabled=true]:pointer-events-none ds:data-[disabled=true]:opacity-50"
|
|
78
|
-
].join(" "),
|
|
150
|
+
].join(" "), ce = [
|
|
79
151
|
"ds:relative ds:flex ds:cursor-pointer ds:items-center",
|
|
80
152
|
"ds:rounded-[var(--radius-sm)] ds:ps-2 ds:pe-2 ds:py-1.5",
|
|
81
153
|
"ds:text-[var(--font-size-sm)] ds:font-medium ds:text-primary ds:outline-none ds:select-none",
|
|
82
154
|
"ds:data-[selected=true]:bg-muted"
|
|
83
|
-
].join(" "),
|
|
155
|
+
].join(" "), rt = "__ui-multiselect-select-all__", nt = "__ui-multiselect-clear-all__", fe = Me(
|
|
84
156
|
function({
|
|
85
157
|
options: c,
|
|
86
|
-
value:
|
|
87
|
-
defaultValue:
|
|
88
|
-
onChange:
|
|
89
|
-
onComplete:
|
|
90
|
-
placeholder:
|
|
91
|
-
maxSelections:
|
|
92
|
-
allowSelectAll:
|
|
93
|
-
allowClear:
|
|
94
|
-
filter:
|
|
95
|
-
size:
|
|
96
|
-
disabled:
|
|
97
|
-
className:
|
|
98
|
-
id:
|
|
99
|
-
...
|
|
100
|
-
},
|
|
101
|
-
const { t: f } =
|
|
102
|
-
|
|
103
|
-
),
|
|
158
|
+
value: G,
|
|
159
|
+
defaultValue: me,
|
|
160
|
+
onChange: v,
|
|
161
|
+
onComplete: q,
|
|
162
|
+
placeholder: pe,
|
|
163
|
+
maxSelections: b,
|
|
164
|
+
allowSelectAll: H = !1,
|
|
165
|
+
allowClear: X = !1,
|
|
166
|
+
filter: M,
|
|
167
|
+
size: T = "md",
|
|
168
|
+
disabled: he,
|
|
169
|
+
className: ve,
|
|
170
|
+
id: P,
|
|
171
|
+
...ge
|
|
172
|
+
}, be) {
|
|
173
|
+
const { t: f } = Be(), y = Ke(), S = Pe(Ue) !== null, [ye, J] = L(
|
|
174
|
+
me ?? []
|
|
175
|
+
), E = G !== void 0, r = E ? G : ye, [A, m] = L(!1), [p, j] = L(""), w = k(null), I = k([]), W = k(null), we = Qe(be, W), g = S && y.disabled || !!he, Ie = S && y.required, Z = S && y.invalid, xe = S && y.describedBy ? y.describedBy : void 0, ke = P ?? (S ? y.id : void 0), Se = O(() => {
|
|
104
176
|
const e = /* @__PURE__ */ new Map();
|
|
105
177
|
for (const t of c) e.set(t.value, t.label);
|
|
106
178
|
return e;
|
|
107
|
-
}, [c]),
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
if (
|
|
111
|
-
|
|
179
|
+
}, [c]), ee = typeof b == "number" && r.length >= b, N = (e) => {
|
|
180
|
+
E || J(e), v == null || v(e);
|
|
181
|
+
}, Ae = (e) => {
|
|
182
|
+
if (r.includes(e)) {
|
|
183
|
+
N(r.filter((t) => t !== e));
|
|
112
184
|
return;
|
|
113
185
|
}
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
const t =
|
|
117
|
-
return
|
|
118
|
-
},
|
|
119
|
-
const e = c.filter((s) => !s.disabled).map((s) => s.value), t = typeof
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
186
|
+
ee || N([...r, e]);
|
|
187
|
+
}, $ = (e) => {
|
|
188
|
+
const t = r.filter((s, o) => o !== e);
|
|
189
|
+
return N(t), t;
|
|
190
|
+
}, Ne = () => {
|
|
191
|
+
const e = c.filter((s) => !s.disabled).map((s) => s.value), t = typeof b == "number" ? b : e.length;
|
|
192
|
+
N(e.slice(0, t));
|
|
193
|
+
}, _e = () => {
|
|
194
|
+
N([]);
|
|
195
|
+
}, te = k(r);
|
|
196
|
+
Q(() => {
|
|
197
|
+
te.current = r;
|
|
198
|
+
}, [r]);
|
|
199
|
+
const se = k(p);
|
|
200
|
+
Q(() => {
|
|
201
|
+
se.current = p;
|
|
202
|
+
}, [p]);
|
|
203
|
+
const re = k(A);
|
|
204
|
+
Q(() => {
|
|
205
|
+
re.current = A;
|
|
206
|
+
}, [A]);
|
|
207
|
+
const B = je(
|
|
208
|
+
(e) => {
|
|
209
|
+
E || J(e), v == null || v(e);
|
|
210
|
+
},
|
|
211
|
+
[E, v]
|
|
212
|
+
), Re = O(
|
|
213
|
+
() => ({
|
|
214
|
+
getSelection: () => [...te.current],
|
|
215
|
+
getQuery: () => se.current,
|
|
216
|
+
getIsOpen: () => re.current,
|
|
217
|
+
setSelection: (e) => B(e),
|
|
218
|
+
clearSelection: () => B([]),
|
|
219
|
+
setQuery: (e) => j(e),
|
|
220
|
+
open: () => m(!0),
|
|
221
|
+
close: () => m(!1)
|
|
222
|
+
}),
|
|
223
|
+
[B]
|
|
224
|
+
);
|
|
225
|
+
He(We, Re, P);
|
|
226
|
+
const ne = pe ?? f("ui.inputs.multiSelect.placeholder", "Select…"), oe = O(() => {
|
|
227
|
+
if (!p) return c;
|
|
228
|
+
const e = p.toLowerCase();
|
|
229
|
+
return c.filter((t) => M ? M(p, t) : t.label.toLowerCase().includes(e));
|
|
230
|
+
}, [c, p, M]), Ce = O(
|
|
231
|
+
() => Ye(oe),
|
|
232
|
+
[oe]
|
|
233
|
+
), Te = (e) => {
|
|
131
234
|
var o;
|
|
132
235
|
const t = e.currentTarget;
|
|
133
|
-
if (e.key === "Backspace" &&
|
|
236
|
+
if (e.key === "Backspace" && p === "" && r.length > 0) {
|
|
134
237
|
e.preventDefault();
|
|
135
|
-
const
|
|
238
|
+
const a = r.length - 1, l = $(a).length - 1;
|
|
136
239
|
l >= 0 && requestAnimationFrame(() => {
|
|
137
|
-
var
|
|
138
|
-
(
|
|
240
|
+
var h;
|
|
241
|
+
(h = I.current[l]) == null || h.focus();
|
|
139
242
|
});
|
|
140
243
|
return;
|
|
141
244
|
}
|
|
142
245
|
const s = t.selectionStart === 0 && t.selectionEnd === 0;
|
|
143
|
-
if ((e.key === "ArrowLeft" || e.key === "ArrowRight") && s &&
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
246
|
+
if ((e.key === "ArrowLeft" || e.key === "ArrowRight") && s && r.length > 0) {
|
|
247
|
+
const a = document.dir === "rtl" || t.dir === "rtl";
|
|
248
|
+
if (a && e.key === "ArrowRight" || !a && e.key === "ArrowLeft") {
|
|
146
249
|
e.preventDefault();
|
|
147
|
-
const l =
|
|
148
|
-
(o =
|
|
250
|
+
const l = r.length - 1;
|
|
251
|
+
(o = I.current[l]) == null || o.focus();
|
|
149
252
|
}
|
|
150
253
|
return;
|
|
151
254
|
}
|
|
152
255
|
if (e.key === "Escape") {
|
|
153
|
-
|
|
256
|
+
m(!1);
|
|
154
257
|
return;
|
|
155
258
|
}
|
|
156
|
-
!
|
|
157
|
-
},
|
|
158
|
-
var
|
|
259
|
+
!A && (e.key === "ArrowDown" || e.key === "Enter") && m(!0);
|
|
260
|
+
}, Ee = (e) => (t) => {
|
|
261
|
+
var d, l, h, R;
|
|
159
262
|
if (t.key === "Backspace" || t.key === "Delete" || t.key === "Enter" || t.key === " ") {
|
|
160
263
|
t.preventDefault(), t.stopPropagation();
|
|
161
|
-
const
|
|
162
|
-
if (
|
|
264
|
+
const D = $(e);
|
|
265
|
+
if (D.length === 0) {
|
|
163
266
|
requestAnimationFrame(() => {
|
|
164
267
|
var C;
|
|
165
|
-
return (C =
|
|
268
|
+
return (C = w.current) == null ? void 0 : C.focus();
|
|
166
269
|
});
|
|
167
270
|
return;
|
|
168
271
|
}
|
|
169
|
-
const
|
|
272
|
+
const qe = Math.min(e, D.length - 1);
|
|
170
273
|
requestAnimationFrame(() => {
|
|
171
274
|
var C;
|
|
172
|
-
(C =
|
|
275
|
+
(C = I.current[qe]) == null || C.focus();
|
|
173
276
|
});
|
|
174
277
|
return;
|
|
175
278
|
}
|
|
176
|
-
const s = document.dir === "rtl", o = s ? "ArrowRight" : "ArrowLeft",
|
|
279
|
+
const s = document.dir === "rtl", o = s ? "ArrowRight" : "ArrowLeft", a = s ? "ArrowLeft" : "ArrowRight";
|
|
177
280
|
if (t.key === o) {
|
|
178
281
|
t.preventDefault();
|
|
179
|
-
const
|
|
180
|
-
(
|
|
282
|
+
const D = Math.max(0, e - 1);
|
|
283
|
+
(d = I.current[D]) == null || d.focus();
|
|
181
284
|
return;
|
|
182
285
|
}
|
|
183
|
-
if (t.key ===
|
|
184
|
-
t.preventDefault(), e <
|
|
286
|
+
if (t.key === a) {
|
|
287
|
+
t.preventDefault(), e < r.length - 1 ? (l = I.current[e + 1]) == null || l.focus() : (h = w.current) == null || h.focus();
|
|
185
288
|
return;
|
|
186
289
|
}
|
|
187
|
-
t.key === "Escape" && (
|
|
188
|
-
}, [
|
|
290
|
+
t.key === "Escape" && (m(!1), (R = w.current) == null || R.focus());
|
|
291
|
+
}, [V, K] = L(
|
|
189
292
|
Number.POSITIVE_INFINITY
|
|
190
293
|
);
|
|
191
|
-
|
|
192
|
-
const e =
|
|
294
|
+
$e(() => {
|
|
295
|
+
const e = W.current;
|
|
193
296
|
if (!e) return;
|
|
194
297
|
const t = () => {
|
|
195
298
|
const o = Array.from(
|
|
196
299
|
e.querySelectorAll('[data-ui-chip="true"]')
|
|
197
300
|
);
|
|
198
301
|
if (o.length === 0) {
|
|
199
|
-
|
|
302
|
+
K(Number.POSITIVE_INFINITY);
|
|
200
303
|
return;
|
|
201
304
|
}
|
|
202
|
-
const
|
|
203
|
-
let
|
|
305
|
+
const a = o[0].offsetTop;
|
|
306
|
+
let d = 0;
|
|
204
307
|
for (const l of o)
|
|
205
|
-
if (l.offsetTop ===
|
|
308
|
+
if (l.offsetTop === a) d++;
|
|
206
309
|
else break;
|
|
207
|
-
|
|
310
|
+
d === o.length ? K(Number.POSITIVE_INFINITY) : K(Math.max(1, d - 1));
|
|
208
311
|
};
|
|
209
312
|
t();
|
|
210
313
|
const s = new ResizeObserver(t);
|
|
211
314
|
return s.observe(e), () => s.disconnect();
|
|
212
|
-
}, [
|
|
213
|
-
const
|
|
315
|
+
}, [r.length, T]);
|
|
316
|
+
const F = r.map((e) => ({
|
|
214
317
|
value: e,
|
|
215
|
-
label:
|
|
216
|
-
})),
|
|
318
|
+
label: Se.get(e) ?? e
|
|
319
|
+
})), ie = V === Number.POSITIVE_INFINITY || V >= F.length, Ve = ie ? F : F.slice(0, V), ae = ie ? [] : F.slice(V), _ = ae.length, Fe = (e) => {
|
|
217
320
|
var s;
|
|
218
|
-
if (
|
|
321
|
+
if (g) return;
|
|
219
322
|
const t = e.target;
|
|
220
|
-
t.closest('[data-ui-chip="true"]') || t.closest('[data-ui-chip-dismiss="true"]') || (
|
|
221
|
-
},
|
|
222
|
-
if (
|
|
223
|
-
|
|
323
|
+
t.closest('[data-ui-chip="true"]') || t.closest('[data-ui-chip-dismiss="true"]') || (m(!0), (s = w.current) == null || s.focus());
|
|
324
|
+
}, De = (e) => {
|
|
325
|
+
if (g) {
|
|
326
|
+
m(!1);
|
|
224
327
|
return;
|
|
225
328
|
}
|
|
226
|
-
|
|
227
|
-
},
|
|
228
|
-
count:
|
|
229
|
-
defaultValue: `${
|
|
230
|
-
}), { onClick:
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */
|
|
329
|
+
m(e), e || (j(""), q == null || q(r));
|
|
330
|
+
}, Le = H || X, Oe = f("ui.inputs.multiSelect.selected", {
|
|
331
|
+
count: r.length,
|
|
332
|
+
defaultValue: `${r.length} selected`
|
|
333
|
+
}), { onClick: U, ...ze } = ge;
|
|
334
|
+
return /* @__PURE__ */ n(u, { shouldFilter: !1, label: Oe, children: /* @__PURE__ */ x(z.Root, { open: A, onOpenChange: De, children: [
|
|
335
|
+
/* @__PURE__ */ n(z.Anchor, { asChild: !0, children: /* @__PURE__ */ x(
|
|
233
336
|
"div",
|
|
234
337
|
{
|
|
235
|
-
ref:
|
|
236
|
-
className:
|
|
237
|
-
"aria-disabled":
|
|
238
|
-
"aria-invalid":
|
|
338
|
+
ref: we,
|
|
339
|
+
className: Ze({ size: T, className: ve }),
|
|
340
|
+
"aria-disabled": g || void 0,
|
|
341
|
+
"aria-invalid": Z || void 0,
|
|
239
342
|
"data-component": "multi-select",
|
|
240
|
-
"data-component-id":
|
|
343
|
+
"data-component-id": P,
|
|
241
344
|
onClick: (e) => {
|
|
242
|
-
|
|
345
|
+
U == null || U(e), Fe(e);
|
|
243
346
|
},
|
|
244
|
-
...
|
|
347
|
+
...ze,
|
|
245
348
|
children: [
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
349
|
+
Ve.map((e, t) => (
|
|
350
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions -- chip pill receives focus via roving tabindex; chip removal uses an inner button
|
|
351
|
+
/* @__PURE__ */ x(
|
|
352
|
+
"span",
|
|
353
|
+
{
|
|
354
|
+
ref: (s) => {
|
|
355
|
+
I.current[t] = s;
|
|
356
|
+
},
|
|
357
|
+
tabIndex: g ? -1 : 0,
|
|
358
|
+
"data-ui-chip": "true",
|
|
359
|
+
className: le({ size: T }),
|
|
360
|
+
onKeyDown: Ee(t),
|
|
361
|
+
"aria-label": e.label,
|
|
362
|
+
children: [
|
|
363
|
+
/* @__PURE__ */ n("span", { children: e.label }),
|
|
364
|
+
/* @__PURE__ */ n(
|
|
365
|
+
"button",
|
|
366
|
+
{
|
|
367
|
+
type: "button",
|
|
368
|
+
tabIndex: -1,
|
|
369
|
+
"data-ui-chip-dismiss": "true",
|
|
370
|
+
"aria-label": f("ui.inputs.multiSelect.remove", {
|
|
371
|
+
label: e.label,
|
|
372
|
+
defaultValue: `Remove ${e.label}`
|
|
373
|
+
}),
|
|
374
|
+
disabled: g,
|
|
375
|
+
onClick: (s) => {
|
|
376
|
+
s.stopPropagation(), $(t), requestAnimationFrame(() => {
|
|
377
|
+
var o;
|
|
378
|
+
return (o = w.current) == null ? void 0 : o.focus();
|
|
379
|
+
});
|
|
380
|
+
},
|
|
381
|
+
className: et,
|
|
382
|
+
children: /* @__PURE__ */ n(Xe, { "aria-hidden": "true", className: "ds:size-3.5" })
|
|
383
|
+
}
|
|
384
|
+
)
|
|
385
|
+
]
|
|
251
386
|
},
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
className: re({ size: S }),
|
|
255
|
-
onKeyDown: Ae(t),
|
|
256
|
-
"aria-label": e.label,
|
|
257
|
-
children: [
|
|
258
|
-
/* @__PURE__ */ r("span", { children: e.label }),
|
|
259
|
-
/* @__PURE__ */ r(
|
|
260
|
-
"button",
|
|
261
|
-
{
|
|
262
|
-
type: "button",
|
|
263
|
-
tabIndex: -1,
|
|
264
|
-
"data-ui-chip-dismiss": "true",
|
|
265
|
-
"aria-label": f("ui.inputs.multiSelect.remove", {
|
|
266
|
-
label: e.label,
|
|
267
|
-
defaultValue: `Remove ${e.label}`
|
|
268
|
-
}),
|
|
269
|
-
disabled: h,
|
|
270
|
-
onClick: (s) => {
|
|
271
|
-
s.stopPropagation(), z(t), requestAnimationFrame(() => {
|
|
272
|
-
var o;
|
|
273
|
-
return (o = y.current) == null ? void 0 : o.focus();
|
|
274
|
-
});
|
|
275
|
-
},
|
|
276
|
-
className: Ue,
|
|
277
|
-
children: /* @__PURE__ */ r($e, { "aria-hidden": "true", className: "ds:size-3.5" })
|
|
278
|
-
}
|
|
279
|
-
)
|
|
280
|
-
]
|
|
281
|
-
},
|
|
282
|
-
e.value
|
|
387
|
+
e.value
|
|
388
|
+
)
|
|
283
389
|
)),
|
|
284
|
-
|
|
285
|
-
|
|
390
|
+
_ > 0 ? /* @__PURE__ */ n(
|
|
391
|
+
de,
|
|
286
392
|
{
|
|
287
|
-
label:
|
|
393
|
+
label: ae.map((e) => e.label).join(", "),
|
|
288
394
|
delayDuration: 200,
|
|
289
|
-
children: /* @__PURE__ */
|
|
395
|
+
children: /* @__PURE__ */ n(
|
|
290
396
|
"span",
|
|
291
397
|
{
|
|
292
|
-
className:
|
|
398
|
+
className: le({ size: T }),
|
|
293
399
|
tabIndex: 0,
|
|
294
400
|
role: "button",
|
|
295
401
|
"aria-label": f("ui.inputs.multiSelect.overflow", {
|
|
296
|
-
count:
|
|
297
|
-
defaultValue: `+${
|
|
402
|
+
count: _,
|
|
403
|
+
defaultValue: `+${_} more`
|
|
298
404
|
}),
|
|
299
|
-
children: /* @__PURE__ */
|
|
300
|
-
count:
|
|
301
|
-
defaultValue: `+${
|
|
405
|
+
children: /* @__PURE__ */ n("span", { children: f("ui.inputs.multiSelect.overflow", {
|
|
406
|
+
count: _,
|
|
407
|
+
defaultValue: `+${_} more`
|
|
302
408
|
}) })
|
|
303
409
|
}
|
|
304
410
|
)
|
|
305
411
|
}
|
|
306
412
|
) : null,
|
|
307
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ n(
|
|
308
414
|
u.Input,
|
|
309
415
|
{
|
|
310
|
-
ref:
|
|
311
|
-
value:
|
|
312
|
-
onValueChange:
|
|
313
|
-
onKeyDown:
|
|
416
|
+
ref: w,
|
|
417
|
+
value: p,
|
|
418
|
+
onValueChange: j,
|
|
419
|
+
onKeyDown: Te,
|
|
314
420
|
onFocus: () => {
|
|
315
|
-
|
|
421
|
+
g || m(!0);
|
|
316
422
|
},
|
|
317
|
-
placeholder:
|
|
318
|
-
id:
|
|
319
|
-
"aria-describedby":
|
|
320
|
-
"aria-invalid":
|
|
321
|
-
"aria-required":
|
|
322
|
-
disabled:
|
|
423
|
+
placeholder: r.length === 0 ? ne : "",
|
|
424
|
+
id: ke,
|
|
425
|
+
"aria-describedby": xe,
|
|
426
|
+
"aria-invalid": Z || void 0,
|
|
427
|
+
"aria-required": Ie || void 0,
|
|
428
|
+
disabled: g,
|
|
323
429
|
className: [
|
|
324
430
|
"ds:flex-1 ds:min-w-[6rem] ds:bg-transparent ds:outline-none",
|
|
325
431
|
"ds:placeholder:text-muted-foreground ds:text-start",
|
|
@@ -330,88 +436,88 @@ const Ke = oe(
|
|
|
330
436
|
]
|
|
331
437
|
}
|
|
332
438
|
) }),
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
|
|
439
|
+
/* @__PURE__ */ n(z.Portal, { children: /* @__PURE__ */ n(
|
|
440
|
+
z.Content,
|
|
335
441
|
{
|
|
336
442
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
337
443
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
338
444
|
align: "start",
|
|
339
445
|
sideOffset: 4,
|
|
340
|
-
className:
|
|
341
|
-
children: /* @__PURE__ */
|
|
446
|
+
className: tt,
|
|
447
|
+
children: /* @__PURE__ */ x(
|
|
342
448
|
u.List,
|
|
343
449
|
{
|
|
344
450
|
role: "listbox",
|
|
345
451
|
"aria-multiselectable": "true",
|
|
346
|
-
"aria-label":
|
|
452
|
+
"aria-label": ne,
|
|
347
453
|
className: "ds:max-h-[20rem] ds:overflow-y-auto ds:p-1",
|
|
348
454
|
children: [
|
|
349
|
-
|
|
350
|
-
|
|
455
|
+
Le ? /* @__PURE__ */ x(u.Group, { children: [
|
|
456
|
+
H ? /* @__PURE__ */ n(
|
|
351
457
|
u.Item,
|
|
352
458
|
{
|
|
353
|
-
value:
|
|
354
|
-
onSelect:
|
|
355
|
-
className:
|
|
459
|
+
value: rt,
|
|
460
|
+
onSelect: Ne,
|
|
461
|
+
className: ce,
|
|
356
462
|
children: f("ui.inputs.multiSelect.selectAll", "Select all")
|
|
357
463
|
}
|
|
358
464
|
) : null,
|
|
359
|
-
|
|
465
|
+
X ? /* @__PURE__ */ n(
|
|
360
466
|
u.Item,
|
|
361
467
|
{
|
|
362
|
-
value:
|
|
363
|
-
onSelect:
|
|
364
|
-
className:
|
|
468
|
+
value: nt,
|
|
469
|
+
onSelect: _e,
|
|
470
|
+
className: ce,
|
|
365
471
|
children: f("ui.inputs.multiSelect.clearAll", "Clear all")
|
|
366
472
|
}
|
|
367
473
|
) : null
|
|
368
474
|
] }) : null,
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
|
|
371
|
-
const o = t.map((
|
|
372
|
-
const
|
|
475
|
+
/* @__PURE__ */ n(u.Empty, { className: "ds:ps-2 ds:pe-2 ds:py-2 type-body-sm ds:text-muted-foreground", children: f("ui.inputs.multiSelect.noOptions", "No options found") }),
|
|
476
|
+
Ce.map(({ group: e, items: t }, s) => {
|
|
477
|
+
const o = t.map((a) => {
|
|
478
|
+
const d = r.includes(a.value), l = !d && ee, h = !!a.disabled || l, R = /* @__PURE__ */ x(
|
|
373
479
|
u.Item,
|
|
374
480
|
{
|
|
375
|
-
value:
|
|
376
|
-
disabled:
|
|
481
|
+
value: a.value,
|
|
482
|
+
disabled: h,
|
|
377
483
|
onSelect: () => {
|
|
378
|
-
|
|
484
|
+
h || Ae(a.value);
|
|
379
485
|
},
|
|
380
|
-
"aria-selected":
|
|
381
|
-
"aria-disabled":
|
|
382
|
-
className:
|
|
486
|
+
"aria-selected": d,
|
|
487
|
+
"aria-disabled": h || void 0,
|
|
488
|
+
className: st,
|
|
383
489
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ n(
|
|
385
491
|
"span",
|
|
386
492
|
{
|
|
387
493
|
className: [
|
|
388
494
|
"ds:inline-flex ds:items-center ds:justify-center ds:me-2 ds:shrink-0",
|
|
389
495
|
"ds:size-4 ds:rounded-[var(--radius-sm)] ds:border ds:border-border",
|
|
390
|
-
|
|
496
|
+
d ? "ds:bg-primary ds:border-primary ds:text-primary-foreground" : "ds:bg-background"
|
|
391
497
|
].join(" "),
|
|
392
498
|
"aria-hidden": "true",
|
|
393
|
-
children:
|
|
499
|
+
children: d ? /* @__PURE__ */ n(Je, { className: "ds:size-3.5" }) : null
|
|
394
500
|
}
|
|
395
501
|
),
|
|
396
|
-
/* @__PURE__ */
|
|
502
|
+
/* @__PURE__ */ n("span", { className: "ds:flex-1 ds:text-start", children: a.label })
|
|
397
503
|
]
|
|
398
504
|
},
|
|
399
|
-
|
|
505
|
+
a.value
|
|
400
506
|
);
|
|
401
|
-
return l ? /* @__PURE__ */
|
|
402
|
-
|
|
507
|
+
return l ? /* @__PURE__ */ n(
|
|
508
|
+
de,
|
|
403
509
|
{
|
|
404
510
|
label: f("ui.inputs.multiSelect.maxReached", {
|
|
405
|
-
count:
|
|
406
|
-
defaultValue: `Maximum ${
|
|
511
|
+
count: b,
|
|
512
|
+
defaultValue: `Maximum ${b} selections`
|
|
407
513
|
}),
|
|
408
514
|
delayDuration: 200,
|
|
409
|
-
children:
|
|
515
|
+
children: R
|
|
410
516
|
},
|
|
411
|
-
|
|
412
|
-
) :
|
|
517
|
+
a.value
|
|
518
|
+
) : R;
|
|
413
519
|
});
|
|
414
|
-
return e ? /* @__PURE__ */
|
|
520
|
+
return e ? /* @__PURE__ */ n(
|
|
415
521
|
u.Group,
|
|
416
522
|
{
|
|
417
523
|
heading: e,
|
|
@@ -419,7 +525,7 @@ const Ke = oe(
|
|
|
419
525
|
children: o
|
|
420
526
|
},
|
|
421
527
|
`group-${e}`
|
|
422
|
-
) : /* @__PURE__ */
|
|
528
|
+
) : /* @__PURE__ */ n(u.Group, { children: o }, `group-${s}`);
|
|
423
529
|
})
|
|
424
530
|
]
|
|
425
531
|
}
|
|
@@ -429,82 +535,11 @@ const Ke = oe(
|
|
|
429
535
|
] }) });
|
|
430
536
|
}
|
|
431
537
|
);
|
|
432
|
-
|
|
433
|
-
const
|
|
434
|
-
id: "multi-select",
|
|
435
|
-
capabilities: ["select_multiple", "filter", "open", "close"],
|
|
436
|
-
state: {
|
|
437
|
-
selection: {
|
|
438
|
-
type: "string[]",
|
|
439
|
-
description: "Values of currently-selected options.",
|
|
440
|
-
read: (i) => i.getSelection()
|
|
441
|
-
},
|
|
442
|
-
query: {
|
|
443
|
-
type: "string",
|
|
444
|
-
description: "Current filter query.",
|
|
445
|
-
read: (i) => i.getQuery()
|
|
446
|
-
},
|
|
447
|
-
isOpen: {
|
|
448
|
-
type: "boolean",
|
|
449
|
-
description: "True when the option list is visible.",
|
|
450
|
-
read: (i) => i.getIsOpen()
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
actions: {
|
|
454
|
-
set_selection: {
|
|
455
|
-
safety: "read",
|
|
456
|
-
argsType: "{ values: string[] }",
|
|
457
|
-
description: "Replace the current selection with the given list of values.",
|
|
458
|
-
invoke: (i, c) => {
|
|
459
|
-
i.setSelection(c.values);
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
|
-
clear_selection: {
|
|
463
|
-
safety: "read",
|
|
464
|
-
description: "Clear the current selection.",
|
|
465
|
-
invoke: (i) => {
|
|
466
|
-
i.clearSelection();
|
|
467
|
-
}
|
|
468
|
-
},
|
|
469
|
-
apply_filter: {
|
|
470
|
-
safety: "read",
|
|
471
|
-
argsType: "{ query: string }",
|
|
472
|
-
description: "Set the filter query for the option list.",
|
|
473
|
-
invoke: (i, c) => {
|
|
474
|
-
i.setQuery(c.query);
|
|
475
|
-
}
|
|
476
|
-
},
|
|
477
|
-
open: {
|
|
478
|
-
safety: "read",
|
|
479
|
-
description: "Open the option list.",
|
|
480
|
-
invoke: (i) => {
|
|
481
|
-
i.open();
|
|
482
|
-
}
|
|
483
|
-
},
|
|
484
|
-
close: {
|
|
485
|
-
safety: "read",
|
|
486
|
-
description: "Close the option list.",
|
|
487
|
-
invoke: (i) => {
|
|
488
|
-
i.close();
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
},
|
|
492
|
-
domHooks: {
|
|
493
|
-
root: { attr: "data-component", value: "multi-select" },
|
|
494
|
-
instanceId: {
|
|
495
|
-
attr: "data-component-id",
|
|
496
|
-
sourceProp: "id",
|
|
497
|
-
description: "Sourced from the id prop."
|
|
498
|
-
},
|
|
499
|
-
item: {
|
|
500
|
-
attr: "data-option-id",
|
|
501
|
-
description: "Each option emits its value as data-option-id."
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
};
|
|
538
|
+
fe.displayName = "MultiSelect";
|
|
539
|
+
const bt = fe;
|
|
505
540
|
export {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
541
|
+
bt as M,
|
|
542
|
+
Ze as a,
|
|
543
|
+
We as m
|
|
509
544
|
};
|
|
510
|
-
//# sourceMappingURL=multi-select
|
|
545
|
+
//# sourceMappingURL=multi-select-wqqrgjUQ.js.map
|