@povio/ui 6.0.0-rc.12 → 6.0.0-rc.13
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 +469 -42
- package/dist/{Accordion-Cup5eRZz.d.ts → Accordion-CR9oomZY.d.ts} +29 -17
- package/dist/{Accordion-ORBin0EZ.js → Accordion-gUW7u1Zn.js} +41 -41
- package/dist/Alert-DwnALnFY.d.ts +36 -0
- package/dist/AlertDialog-BcRiqY_n.d.ts +70 -0
- package/dist/Autocomplete-CV4Aa1Ok.js +319 -0
- package/dist/Autocomplete-DRwQxx0U.d.ts +123 -0
- package/dist/Badge-CO-ZsmbR.d.ts +67 -0
- package/dist/{BottomSheet-CGipksM_.js → BottomSheet-APVu5TUd.js} +8 -8
- package/dist/BottomSheet-Be0HtQzP.d.ts +65 -0
- package/dist/{BottomSheet.lazy-CuJMUeJP.d.ts → BottomSheet.lazy-NNB7ivkW.d.ts} +1 -1
- package/dist/{Breadcrumbs-CcB0oOF8.d.ts → Breadcrumbs-Bn3fqVYx.d.ts} +6 -3
- package/dist/{Breadcrumbs-a1-q_he0.js → Breadcrumbs-Cd75RPbS.js} +33 -17
- package/dist/{Button-C1YB5dOw.js → Button-BJJkLVNj.js} +1 -5
- package/dist/{Button-BaODzvZd.js → Button-CzEs3tcV.js} +1 -1
- package/dist/{Button-0SswSdDg.d.ts → Button-Hk8zm9q_.d.ts} +2 -2
- package/dist/ButtonBase-Cp1w00t2.d.ts +47 -0
- package/dist/{ButtonBase-s-VV7oCa.js → ButtonBase-aGz6DYum.js} +10 -18
- package/dist/{ButtonContent-Dztbuz3q.js → ButtonContent-2KsbdWRO.js} +5 -5
- package/dist/{Calendar-yaQubCWK.js → Calendar-DN-i_b-_.js} +19 -17
- package/dist/{Calendar.lazy-DcVss9Bk.js → Calendar.lazy-CqmyDSND.js} +4 -4
- package/dist/{Checkbox-Bjsbx-wK.js → Checkbox-CzKXZw_w.js} +35 -9
- package/dist/Checkbox-D32MOIhF.d.ts +49 -0
- package/dist/CheckboxCheckmark-DDU_Ie7-.js +42 -0
- package/dist/CheckboxGroup-B5Mn1G3u.d.ts +52 -0
- package/dist/{CheckboxGroup-B3O3IUiu.js → CheckboxGroup-BqWt09kZ.js} +75 -35
- package/dist/DatePicker-CmoVbapu.d.ts +80 -0
- package/dist/{DatePicker-bme8zGBo.js → DatePicker-DQewd1By.js} +80 -41
- package/dist/{DatePickerInput-vLlL5ATh.d.ts → DatePickerInput-B9VnExeA.d.ts} +3 -3
- package/dist/{DatePickerInput-C2881tvS.js → DatePickerInput-Bp9ZIN5E.js} +37 -26
- package/dist/{DateRangePicker-Blg158JD.js → DateRangePicker-DRZ1hLlR.js} +86 -158
- package/dist/DateRangePicker-LX1VJlnD.d.ts +102 -0
- package/dist/DateTimePicker-D9pODhAj.d.ts +83 -0
- package/dist/{DateTimePicker-CdRFt8WM.js → DateTimePicker-DWtKPaE6.js} +70 -35
- package/dist/{Dialog-C9H9_BmK.js → Dialog-BJ13KRQo.js} +1 -1
- package/dist/{Dialog-DN5703sy.js → Dialog-BzQYDPJ9.js} +23 -19
- package/dist/Dialog-D0SeePPz.d.ts +66 -0
- package/dist/{Disclosure-BRSkMbZQ.js → Disclosure-Bjm5IOpg.js} +1 -1
- package/dist/Drawer-o018RqIt.d.ts +42 -0
- package/dist/DropdownMenu-DTr7b-XO.d.ts +51 -0
- package/dist/{DropdownMenu-DS0RaEfH.js → DropdownMenu-DrshB60h.js} +33 -21
- package/dist/{DropdownMenuDesktop-DGPIfex-.js → DropdownMenuDesktop-DxGA0yvx.js} +14 -8
- package/dist/FileInput-Bokcp9nH.d.ts +61 -0
- package/dist/{FileInput-BUwtAF2-.js → FileInput-LMhFxlqB.js} +75 -80
- package/dist/FileUpload-BqXd4_nz.d.ts +181 -0
- package/dist/FileUpload-CJZrkr_U.js +679 -0
- package/dist/{FormField-dduTMkNH.js → FormField-TI8Vx5aC.js} +10 -10
- package/dist/FormField-XQbjfGSv.d.ts +70 -0
- package/dist/{FormFieldError-BT4uxbKY.d.ts → FormFieldError-C7yOdjzQ.d.ts} +1 -0
- package/dist/FormFieldHeaderTooltip-DB7KrrcD.js +22 -0
- package/dist/HiddenFormValue-DZ2d9eoA.js +20 -0
- package/dist/IconButton-CQLHX8-Y.d.ts +24 -0
- package/dist/{IconSlot-CqNuZl0E.js → IconSlot-TAWTJ6iK.js} +2 -4
- package/dist/{InlineTooltipWrapper-CKTiFpZn.js → InlineTooltipWrapper-CjDUsi2I.js} +1 -1
- package/dist/{Input-CG5LQ0zs.js → Input-CeRJeAoR.js} +94 -59
- package/dist/Input-onUj0DKg.d.ts +56 -0
- package/dist/{InputContent-Fx2E4UXl.js → InputContent-B8OCdbVP.js} +15 -13
- package/dist/InputContent-D5ZkB9hO.d.ts +39 -0
- package/dist/Link-BdnWVYL9.d.ts +15 -0
- package/dist/{ListBox-DhR5kojP.js → ListBox-gR4iSV7N.js} +3 -3
- package/dist/{Modal-DcLWF9cB.js → Modal-DAMsCwzb.js} +1 -1
- package/dist/{NumberField-DxuikBcr.js → NumberField-6Q9LHGSo.js} +91 -62
- package/dist/NumberField-Sb30Qao3.d.ts +41 -0
- package/dist/{NumberRangeInput-8bOjNEnS.js → NumberRangeInput-BDSkcHVJ.js} +152 -101
- package/dist/NumberRangeInput-Dvq8mOUY.d.ts +89 -0
- package/dist/{PageHeader-DTfzf-dA.d.ts → PageHeader-eJk6GNK6.d.ts} +6 -5
- package/dist/{PasswordInput.bound-Dfq5c3JQ.js → PasswordInput-BcHpV0Ie.js} +6 -6
- package/dist/PasswordInput-VHzP4VPU.d.ts +16 -0
- package/dist/Popover-qplPGDnR.d.ts +51 -0
- package/dist/Progress-DH-w99MU.d.ts +26 -0
- package/dist/Progress-WzWvbvtp.js +180 -0
- package/dist/ProgressBar-BsSimmJF.js +46 -0
- package/dist/RadioGroup-CC8bKtBN.d.ts +52 -0
- package/dist/{RadioGroup-IL4Y8XHO.js → RadioGroup-PKqFHoKP.js} +66 -26
- package/dist/{RangeCalendar-DT63UD8K.js → RangeCalendar-DqCTlIuy.js} +12 -10
- package/dist/Select-CSyfDyxG.d.ts +248 -0
- package/dist/{Select-BM8PNrjC.js → Select-D3fuXwVt.js} +435 -184
- package/dist/{SelectListBox-BFSZxDSi.js → SelectListBox-DqAxkT1f.js} +46 -37
- package/dist/{SidebarWorkspaces-DJknAfS9.js → SidebarWorkspaces-BGl_PIsH.js} +280 -363
- package/dist/{SidebarWorkspaces-DDHJAdNH.d.ts → SidebarWorkspaces-CdtK2M-C.d.ts} +31 -17
- package/dist/{Slider-DCsCCPFx.js → Slider-BCUiALjE.js} +69 -12
- package/dist/Slider-DxalZD3o.d.ts +57 -0
- package/dist/Spinner-BTrEbNFy.d.ts +13 -0
- package/dist/SplitButton-Dv5l8p5t.d.ts +25 -0
- package/dist/Stepper-B1IOUcSI.d.ts +49 -0
- package/dist/{Stepper-Dyhxp0Tl.js → Stepper-DA2G546I.js} +116 -88
- package/dist/{Switch-BfpSMMpv.js → Switch-Ce-bJOVw.js} +54 -12
- package/dist/Switch-urNrop0P.d.ts +42 -0
- package/dist/{TabsFilters-DybNturW.js → TabsFilters-Cweij8He.js} +44 -33
- package/dist/TabsFilters-M5Ld7eb8.d.ts +59 -0
- package/dist/Tag-BKR1AZFa.d.ts +26 -0
- package/dist/TextArea-D7YVclaz.d.ts +33 -0
- package/dist/{TextArea-Blsip3ZC.js → TextArea-P8F0oD_A.js} +59 -32
- package/dist/TimePicker-Ai1M2TGW.d.ts +63 -0
- package/dist/{TimePicker-4hV5zbgd.js → TimePicker-l4Ysk2AX.js} +99 -50
- package/dist/{TimePickerForm-DD9VA_td.js → TimePickerForm-BMqNpDPT.js} +5 -5
- package/dist/{ToastContainer-Dd0LPykL.js → ToastContainer-BeklfvlK.js} +4 -4
- package/dist/{ToggleButton-HUZ8ij6i.d.ts → ToggleButton-DWw53pTt.d.ts} +2 -2
- package/dist/ToggleGroup-BQk3k0at.d.ts +95 -0
- package/dist/ToggleGroup-BdIgqoqA.js +500 -0
- package/dist/{Tooltip-DRB6lo0U.js → Tooltip-BkXPEBqw.js} +2 -2
- package/dist/Tooltip-H8OB7CqY.d.ts +33 -0
- package/dist/TooltipEllipsis-7QF00kXk.d.ts +21 -0
- package/dist/{TooltipWrapper-BSY31JMc.js → TooltipWrapper-ubbBHHVD.js} +6 -6
- package/dist/{Typography-DJojwiXV.d.ts → Typography-Cx1oRGxd.d.ts} +5 -1
- package/dist/{badgeButton.cva-t5PQOH4M.js → badge.cva-BpoxNggB.js} +20 -22
- package/dist/{button.cva-Ciga0rdG.js → button.cva-C2aoXMh-.js} +10 -16
- package/dist/{buttonContent.cva-BapnODby.d.ts → buttonContent.cva-Dyy_RUZU.d.ts} +1 -1
- package/dist/{checkbox.cva-aLJS7v4z.js → checkbox.cva-qU_q0lSX.js} +14 -14
- package/dist/components/accordion.d.ts +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert-dialog.d.ts +2 -2
- package/dist/components/alert-dialog.js +174 -128
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +17 -15
- package/dist/components/autocomplete.d.ts +2 -2
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.d.ts +2 -2
- package/dist/components/badge.js +159 -81
- package/dist/components/bottom-sheet-header.d.ts +1 -1
- package/dist/components/bottom-sheet-header.js +4 -4
- package/dist/components/bottom-sheet.d.ts +2 -2
- package/dist/components/bottom-sheet.js +2 -2
- package/dist/components/breadcrumbs.d.ts +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +1 -1
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/date-picker.d.ts +2 -2
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.d.ts +4 -41
- package/dist/components/date-range-picker.js +4 -2
- package/dist/components/date-range-presets.d.ts +2 -0
- package/dist/components/date-range-presets.js +3 -0
- package/dist/components/date-time-picker.d.ts +2 -2
- package/dist/components/date-time-picker.js +1 -1
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.d.ts +1 -1
- package/dist/components/drawer.js +16 -80
- package/dist/components/dropdown-menu.d.ts +2 -3
- package/dist/components/dropdown-menu.js +2 -3
- package/dist/components/file-input.d.ts +2 -2
- package/dist/components/file-input.js +1 -1
- package/dist/components/file-upload.d.ts +2 -3
- package/dist/components/file-upload.js +1 -1
- package/dist/components/form-field.d.ts +3 -2
- package/dist/components/form-field.js +1 -1
- package/dist/components/icon-button.d.ts +1 -1
- package/dist/components/icon-button.js +22 -25
- package/dist/components/icon-slot.d.ts +1 -2
- package/dist/components/icon-slot.js +2 -2
- package/dist/components/input-frame.d.ts +6 -10
- package/dist/components/input-frame.js +29 -26
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +2 -2
- package/dist/components/link.d.ts +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/number-field.d.ts +2 -2
- package/dist/components/number-field.js +2 -2
- package/dist/components/number-range-input.d.ts +2 -2
- package/dist/components/number-range-input.js +1 -1
- package/dist/components/page-header.d.ts +1 -1
- package/dist/components/page-header.js +5 -5
- package/dist/components/password-input.d.ts +2 -2
- package/dist/components/password-input.js +1 -22
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +105 -87
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +1 -1
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +1 -1
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +1 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +1 -1
- package/dist/components/spinner.d.ts +1 -1
- package/dist/components/spinner.js +71 -1
- package/dist/components/split-button.d.ts +1 -1
- package/dist/components/split-button.js +15 -4
- package/dist/components/stepper.d.ts +1 -1
- package/dist/components/stepper.js +1 -1
- package/dist/components/style-definitions.d.ts +2 -2
- package/dist/components/style-definitions.js +33 -18
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tabs-filters.d.ts +1 -1
- package/dist/components/tabs-filters.js +1 -1
- package/dist/components/tag.d.ts +1 -1
- package/dist/components/tag.js +50 -64
- package/dist/components/text-area.d.ts +2 -2
- package/dist/components/text-area.js +1 -1
- package/dist/components/time-picker.d.ts +2 -2
- package/dist/components/time-picker.js +1 -1
- package/dist/components/toast.d.ts +3 -3
- package/dist/components/toast.js +4 -3
- package/dist/components/toggle-button.d.ts +1 -1
- package/dist/components/toggle-button.js +1 -1
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/tooltip-ellipsis.d.ts +1 -1
- package/dist/components/tooltip-ellipsis.js +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/typography.d.ts +2 -2
- package/dist/components/use-toast.d.ts +2 -2
- package/dist/components/use-toast.js +1 -41
- package/dist/config/component-configuration.d.ts +1 -1
- package/dist/config/component-configuration.js +53 -2
- package/dist/config/confirmation.d.ts +1 -1
- package/dist/config/confirmation.js +1 -1
- package/dist/config/link-context.d.ts +3 -3
- package/dist/config/link-context.js +1 -1
- package/dist/config/resources.d.ts +1 -1
- package/dist/config/resources.js +1 -1
- package/dist/config/ui-config.d.ts +2 -2
- package/dist/config/ui-config.js +1 -1
- package/dist/config/ui-router.d.ts +1 -1
- package/dist/config/ui-router.js +1 -1
- package/dist/confirmation.context-BflM4Vxg.js +93 -0
- package/dist/confirmation.context-C_js9qNv.d.ts +32 -0
- package/dist/{datePickerInput.cva-Du0Zn04v.js → datePickerInput.cva-CWkV2fut.js} +1 -1
- package/dist/dateRangePreset.utils-Bnb-rjTt.js +116 -0
- package/dist/{dialog.cva-BIpz6HcA.js → dialog.cva-BjVggO5l.js} +1 -1
- package/dist/{dist-DEZzXa0W.js → dist-DZOoWaZz.js} +63 -38
- package/dist/{dropdownMenu.cva-DwSOcbmR.js → dropdownMenu.cva-BopsvbOy.js} +19 -7
- package/dist/{exports-BNrTn8Tj.js → exports-DeBGRThC.js} +3 -3
- package/dist/{file.utils-Crb-mIHs.d.ts → file.utils-DUADtzdt.d.ts} +3 -3
- package/dist/{file.utils-DqQxnuAm.js → file.utils-X6tkeWaz.js} +2 -6
- package/dist/fileInputButton.cva-gbqRUf1g.js +39 -0
- package/dist/{fileUpload.cva-BYzXGc9C.js → fileUpload.cva-MH5ziWUe.js} +2 -2
- package/dist/form-field-Bw7U_ZPI.d.ts +1 -0
- package/dist/form.binding-Brdjq2yr.js +161 -0
- package/dist/form.binding-DSXB2AOD.d.ts +127 -0
- package/dist/form.types-a2WVJDQX.d.ts +43 -0
- package/dist/formReset-CnZl_yze.js +35 -0
- package/dist/hints-B09_WDhL.d.ts +17 -0
- package/dist/hooks/use-async-list.d.ts +1 -1
- package/dist/hooks/use-async-list.js +1 -1
- package/dist/hooks/use-breakpoint.d.ts +3 -0
- package/dist/hooks/use-breakpoint.js +2 -0
- package/dist/hooks/use-filters.d.ts +2 -2
- package/dist/hooks/use-filters.js +1 -1
- package/dist/{i18n-DM-PUcxQ.d.ts → i18n-B3PeqBM7.d.ts} +100 -4
- package/dist/{i18n-D8vXIoiq.js → i18n-DQs7jPjv.js} +99 -9
- package/dist/iconSlot.cva-DyhOI7EK.js +5 -0
- package/dist/{import-C7W0Wv2r.js → import-C73fI3WD.js} +2 -2
- package/dist/index.d.ts +64 -83
- package/dist/index.js +55 -90
- package/dist/{input.cva-DZii82eS.js → input.cva-mm1dnfKP.js} +27 -23
- package/dist/inputLayout-CIVpuUBq.js +7 -0
- package/dist/inputRow.clsx-BbcaXVta.js +6 -0
- package/dist/{label.cva-DTfT6FrX.js → label.cva-DJ5Dmbz5.js} +7 -7
- package/dist/link.context-BcBuP9ZT.d.ts +20 -0
- package/dist/{link.context-TPjDtjw3.js → link.context-CD5h_b5O.js} +12 -11
- package/dist/link.cva-D6L1c2wq.d.ts +2157 -0
- package/dist/{logger-CqZjM-sn.js → logger-CW24po62.js} +10 -1
- package/dist/{progress.cva-CsGaGVJ-.js → progress.cva-mkJxrrac.js} +2 -2
- package/dist/{radio.cva-DistaZtZ.js → radio.cva-Dt5N2ul2.js} +7 -7
- package/dist/rich-text-editor.d.ts +44 -2
- package/dist/rich-text-editor.js +733 -1
- package/dist/router.context-B6j_M4cN.js +151 -0
- package/dist/router.context-CSd9JYQ4.d.ts +33 -0
- package/dist/{selectDesktop.cva-DStkOdwm.js → selectDesktop.cva-30JAvtgB.js} +1 -1
- package/dist/sidebar.cva-BgxTCejU.js +150 -0
- package/dist/spinner.cva-j4kGmIWC.js +17 -0
- package/dist/{staticDateTimeSegments-CVuAhDDl.js → staticDateTimeSegments-BYk1tcxs.js} +43 -13
- package/dist/{status.cva-CYgi3Htz.js → status.cva-WLEqUAjH.js} +9 -9
- package/dist/styles/input.d.ts +1 -1
- package/dist/tanstack/form.d.ts +3 -3
- package/dist/tanstack/form.js +3 -3
- package/dist/tanstack/table.d.ts +5 -3
- package/dist/tanstack/table.js +1 -1
- package/dist/tanstack-ABeiJISz.js +10 -0
- package/dist/tanstack-bLXoUPDY.d.ts +165 -0
- package/dist/tanstack.d.ts +64 -83
- package/dist/tanstack.js +55 -90
- package/dist/{toast.cva-B6NXTwbZ.js → toast.cva-C3oA7He3.js} +8 -8
- package/dist/toast.runtime-BHXdSTXV.js +25 -0
- package/dist/{toggleGroup.cva-CJ-3Ps7j.js → toggleGroup.cva-CvNS5QO1.js} +2 -2
- package/dist/uiConfig.context-CN_QgxGO.d.ts +19 -0
- package/dist/{uiConfig.context-3DN9w6oU.js → uiConfig.context-CjnLnQOo.js} +5 -7
- package/dist/{uiConfig.context-BnCORTNm.d.ts → uiConfig.types-B0sPL7nN.d.ts} +34 -34
- package/dist/{useAsyncList-Ct74ve3i.js → useAsyncList-CQgkDfjW.js} +140 -35
- package/dist/useAsyncList-F-328rtE.d.ts +25 -0
- package/dist/useAutoFocus-K-bfNxa2.js +16 -0
- package/dist/{useBreakpoint-CJ3mx7UF.js → useBreakpoint-BrJrvp9_.js} +5 -1
- package/dist/useBreakpoint-D-SVcBeQ.d.ts +9 -0
- package/dist/useDebounceCallback-BjePw6y4.js +90 -0
- package/dist/useFilters-CybBXUAA.js +217 -0
- package/dist/useFilters-DrfBFNLw.d.ts +57 -0
- package/dist/useFormAutosave-BN-zueci.js +419 -0
- package/dist/{useFormAutosave-BBLm3Ujo.d.ts → useFormAutosave-ClMnzVE7.d.ts} +1 -1
- package/dist/{useIntersectionObserver-DFAhTsV0.js → useIntersectionObserver-B8msnQTR.js} +15 -3
- package/dist/{numberStatic.utils-BIyZuILs.js → useLiveNumberFieldState-B7qGzySj.js} +103 -2
- package/dist/useRemoveButton-B6-IGvpY.js +98 -0
- package/dist/useResolveDateRangePreset-C_L-doA6.js +26 -0
- package/dist/useResolveDateRangePreset-DOSzJR-N.d.ts +64 -0
- package/dist/{useScrollableListBox-oYKqU3Hp.js → useScrollableListBox-C8chM7c-.js} +1 -1
- package/dist/{useStaticInputHandoff-BN0fOerH.js → useStaticInputHandoff-DrNFrvD7.js} +6 -1
- package/dist/{useTableColumnConfig-CXYgj5xi.js → useTableColumnConfig-B9cYBKo3.js} +956 -535
- package/dist/useTableNav-rP1wDkhV.d.ts +372 -0
- package/dist/useToast-D2C9pROU.d.ts +78 -0
- package/dist/useToast-DSoOiSw0.js +63 -0
- package/dist/utils/file.d.ts +1 -1
- package/dist/utils/file.js +1 -1
- package/dist/utils/logger.js +1 -1
- package/llms.txt +3116 -0
- package/package.json +13 -121
- package/MIGRATION.md +0 -655
- package/dist/Alert-D4X7OWiv.d.ts +0 -34
- package/dist/AlertDialog-DklLDjmw.d.ts +0 -26
- package/dist/Autocomplete-BgFz3kuR.d.ts +0 -23
- package/dist/Autocomplete-Bn13u0zu.js +0 -145
- package/dist/Autocomplete.bound-CpHZZ3C9.d.ts +0 -9
- package/dist/Autocomplete.bound-Dwh__y-Z.js +0 -28
- package/dist/Badge-Db1ndK67.d.ts +0 -30
- package/dist/BadgeButton-BPhWDAnc.d.ts +0 -15
- package/dist/BottomSheet-BZmDJBR-.d.ts +0 -33
- package/dist/ButtonBase-CZuEy3Pk.d.ts +0 -32
- package/dist/Checkbox-w2j5hLOQ.d.ts +0 -27
- package/dist/Checkbox.bound-D2nBglJz.js +0 -33
- package/dist/Checkbox.bound-DD_RCjVm.d.ts +0 -9
- package/dist/CheckboxCheckmark-DWsYVZuu.js +0 -25
- package/dist/CheckboxGroup-BYI15Y09.d.ts +0 -30
- package/dist/CheckboxGroup.bound-DY0HKGSh.js +0 -32
- package/dist/CheckboxGroup.bound-QiJ-P0KR.d.ts +0 -9
- package/dist/ComboBox-ChsdI0lt.js +0 -212
- package/dist/DatePicker-QzfQf21b.d.ts +0 -56
- package/dist/DatePicker.bound-DoCAqhM4.d.ts +0 -9
- package/dist/DatePicker.bound-M2cjR37s.js +0 -36
- package/dist/DateRangePicker-32D4pWJg.d.ts +0 -97
- package/dist/DateRangePicker.bound-CVtoVsho.d.ts +0 -9
- package/dist/DateRangePicker.bound-CkIDsAUf.js +0 -35
- package/dist/DateTimePicker-BTRIUagV.d.ts +0 -55
- package/dist/DateTimePicker.bound-X4DTyQ1b.d.ts +0 -9
- package/dist/DateTimePicker.bound-nSCVUqd0.js +0 -32
- package/dist/Dialog-CO9xljD3.d.ts +0 -21
- package/dist/Drawer-D1cHiBFO.d.ts +0 -18
- package/dist/DropdownMenu-D_9z9ond.d.ts +0 -25
- package/dist/FileInput-BEaECoBS.d.ts +0 -75
- package/dist/FileInput.bound-C12mOKpg.js +0 -30
- package/dist/FileInput.bound-D2HuuqSb.d.ts +0 -8
- package/dist/FileUpload-BUTSqHVk.d.ts +0 -11
- package/dist/FileUpload-D7FMYm-k.js +0 -749
- package/dist/FileUpload.bound-CGQXb4iT.d.ts +0 -16
- package/dist/FileUpload.bound-DmkuulOi.js +0 -30
- package/dist/FileUploadContainer-Dzg5aXXZ.d.ts +0 -5
- package/dist/FormField-DGyCDxOp.d.ts +0 -42
- package/dist/FormFieldHeaderTooltip-Dt-g40Tc.js +0 -17
- package/dist/IconButton-shH_9wcl.d.ts +0 -25
- package/dist/Input-CTp_9mS9.d.ts +0 -34
- package/dist/Input.bound-B9a62ylL.d.ts +0 -9
- package/dist/Input.bound-DYoXyRGy.js +0 -31
- package/dist/InputContent-BCNkN4Fx.d.ts +0 -27
- package/dist/Link-PvYB_M-j.d.ts +0 -30
- package/dist/MenuItem-U3-pu1j5.d.ts +0 -6
- package/dist/NumberField-WXebfxjK.d.ts +0 -34
- package/dist/NumberField.bound-ChJnNyJS.js +0 -32
- package/dist/NumberField.bound-Dy0A5iVc.d.ts +0 -9
- package/dist/NumberRangeInput-BCKQaGpy.d.ts +0 -50
- package/dist/NumberRangeInput.bound-BF6P_ega.js +0 -32
- package/dist/NumberRangeInput.bound-BNXxIQ0b.d.ts +0 -9
- package/dist/PasswordInput-EhQjYyJS.d.ts +0 -11
- package/dist/PasswordInput.bound-CK5GwKL4.d.ts +0 -9
- package/dist/Popover-D_t1XDPA.d.ts +0 -20
- package/dist/Progress-Ckfpi_-M.d.ts +0 -45
- package/dist/Progress-RiEGGxNG.js +0 -119
- package/dist/RadioGroup-6e-Z6jW8.d.ts +0 -26
- package/dist/RadioGroup.bound-BFWSq-on.js +0 -32
- package/dist/RadioGroup.bound-w3SZqSkH.d.ts +0 -9
- package/dist/RichTextEditor-DHhuBeT6.d.ts +0 -28
- package/dist/RichTextEditor-DfwVdm45.js +0 -651
- package/dist/Select-C34ENdjq.d.ts +0 -119
- package/dist/Select.bound--Az1Xwgm.js +0 -34
- package/dist/Select.bound-qOihchei.d.ts +0 -17
- package/dist/Slider-DRg8zKRM.d.ts +0 -23
- package/dist/Slider.bound-CByTXPTr.js +0 -31
- package/dist/Slider.bound-CaEF19um.d.ts +0 -9
- package/dist/Spinner-Cvy_6zgD.d.ts +0 -30
- package/dist/Spinner-DqjP06T1.js +0 -101
- package/dist/SplitButton-V1f2NWfh.d.ts +0 -15
- package/dist/Stepper-k91x_m-E.d.ts +0 -114
- package/dist/Switch-ELVPkPx0.d.ts +0 -24
- package/dist/Switch.bound-DeEdVvZV.d.ts +0 -9
- package/dist/Switch.bound-Dv0cHsMM.js +0 -33
- package/dist/TableDnd-CuHxANWh.js +0 -133
- package/dist/TableRowDetails-D8HFTghI.d.ts +0 -109
- package/dist/TabsFilters-DePddjCk.d.ts +0 -30
- package/dist/Tag-B2_ZiSE-.d.ts +0 -44
- package/dist/TextArea-iqUeB2QY.d.ts +0 -26
- package/dist/TextArea.bound-BJHyCogp.d.ts +0 -9
- package/dist/TextArea.bound-DeaskY6r.js +0 -28
- package/dist/TimePicker-BZ1ocsBX.d.ts +0 -45
- package/dist/TimePicker.bound-8DmjMXuE.d.ts +0 -9
- package/dist/TimePicker.bound-BFSXJvE_.js +0 -32
- package/dist/Toast-D9pdadZ4.d.ts +0 -16
- package/dist/ToggleGroup-CrDoeLN0.js +0 -333
- package/dist/ToggleGroup-DvjnSinl.d.ts +0 -42
- package/dist/ToggleGroup.bound-B03ISHQ8.d.ts +0 -9
- package/dist/ToggleGroup.bound-DCnYwmBt.js +0 -67
- package/dist/Tooltip-B8DTURLQ.d.ts +0 -16
- package/dist/TooltipEllipsis-Di9Dvd4x.d.ts +0 -11
- package/dist/badgeButton.cva-CBFIhr1S.d.ts +0 -41
- package/dist/button.cva-C8LGtNJ3.d.ts +0 -94
- package/dist/checkbox.cva-CCh_UlrC.d.ts +0 -76
- package/dist/components/badge-button.d.ts +0 -2
- package/dist/components/badge-button.js +0 -74
- package/dist/components/file-upload-container.d.ts +0 -3
- package/dist/components/file-upload-container.js +0 -15
- package/dist/confirmation.context-Bc2yEVp_.js +0 -114
- package/dist/confirmation.context-C_GDRn3a.d.ts +0 -23
- package/dist/fileUpload.types-C-ke21yY.d.ts +0 -110
- package/dist/form.binding-DOR5gIQf.js +0 -49
- package/dist/form.types-C8P4sznq.d.ts +0 -22
- package/dist/formFieldHelper.cva-DRmSyRZN.js +0 -14
- package/dist/iconSlot.cva-CLB5Tlsr.d.ts +0 -9
- package/dist/icons.d.ts +0 -4
- package/dist/icons.js +0 -3
- package/dist/input.cva-BjuHsDGy.d.ts +0 -80
- package/dist/inputLayout-KdAtunGk.js +0 -5
- package/dist/link.context-BCHn7NSy.d.ts +0 -12
- package/dist/radio.cva-D7M1hqLe.d.ts +0 -56
- package/dist/router.context-CtafjXV7.d.ts +0 -16
- package/dist/router.context-MckTbHw9.js +0 -63
- package/dist/routing.utils-DfxEt0_Y.js +0 -30
- package/dist/style-definitions-Dx6aFDiR.d.ts +0 -1038
- package/dist/switch.cva-r6vcS25Q.d.ts +0 -16
- package/dist/tanstack/autocomplete.d.ts +0 -3
- package/dist/tanstack/autocomplete.js +0 -2
- package/dist/tanstack/checkbox-group.d.ts +0 -3
- package/dist/tanstack/checkbox-group.js +0 -2
- package/dist/tanstack/checkbox.d.ts +0 -3
- package/dist/tanstack/checkbox.js +0 -2
- package/dist/tanstack/date-picker.d.ts +0 -3
- package/dist/tanstack/date-picker.js +0 -2
- package/dist/tanstack/date-range-picker.d.ts +0 -3
- package/dist/tanstack/date-range-picker.js +0 -2
- package/dist/tanstack/date-time-picker.d.ts +0 -3
- package/dist/tanstack/date-time-picker.js +0 -2
- package/dist/tanstack/file-input.d.ts +0 -3
- package/dist/tanstack/file-input.js +0 -2
- package/dist/tanstack/file-upload.d.ts +0 -4
- package/dist/tanstack/file-upload.js +0 -2
- package/dist/tanstack/input.d.ts +0 -3
- package/dist/tanstack/input.js +0 -2
- package/dist/tanstack/number-field.d.ts +0 -3
- package/dist/tanstack/number-field.js +0 -2
- package/dist/tanstack/number-range-input.d.ts +0 -3
- package/dist/tanstack/number-range-input.js +0 -2
- package/dist/tanstack/password-input.d.ts +0 -2
- package/dist/tanstack/password-input.js +0 -2
- package/dist/tanstack/radio-group.d.ts +0 -3
- package/dist/tanstack/radio-group.js +0 -2
- package/dist/tanstack/rich-text-editor.d.ts +0 -9
- package/dist/tanstack/rich-text-editor.js +0 -28
- package/dist/tanstack/select.d.ts +0 -3
- package/dist/tanstack/select.js +0 -2
- package/dist/tanstack/slider.d.ts +0 -3
- package/dist/tanstack/slider.js +0 -2
- package/dist/tanstack/switch.d.ts +0 -3
- package/dist/tanstack/switch.js +0 -2
- package/dist/tanstack/text-area.d.ts +0 -3
- package/dist/tanstack/text-area.js +0 -2
- package/dist/tanstack/time-picker.d.ts +0 -3
- package/dist/tanstack/time-picker.js +0 -2
- package/dist/tanstack/toggle-group.d.ts +0 -3
- package/dist/tanstack/toggle-group.js +0 -2
- package/dist/tanstack-Bgdv0qU1.js +0 -19
- package/dist/tanstack-wNbE6b-h.d.ts +0 -566
- package/dist/toast.cva-AmLw6Cf5.d.ts +0 -61
- package/dist/toast.runtime-Drd2IJ_j.js +0 -17
- package/dist/toastActivation.store-BELtcr76.js +0 -16
- package/dist/toggleGroup.cva-DA4U21gn.d.ts +0 -26
- package/dist/typography.cva-BCHlTHdM.d.ts +0 -36
- package/dist/useAsyncList-Cu-Y8If2.d.ts +0 -9
- package/dist/useFilters-BxRScJdn.d.ts +0 -11
- package/dist/useFilters-DMi94RZK.js +0 -190
- package/dist/useForm-Cb7KWLds.js +0 -217
- package/dist/useForm-I6z23FXf.d.ts +0 -51
- package/dist/useFormAutosave-BPGlChiY.js +0 -216
- package/dist/useTableNav-BusSFEVC.d.ts +0 -197
- package/dist/useToast-DsA8CVoY.d.ts +0 -16
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { t as clsx } from "./clsx-CnD0nOiA.js";
|
|
2
|
+
import { t as UIOverrides } from "./uiOverrides.context-DNEQlTx0.js";
|
|
3
|
+
import { l as $7230ffa83bc0c2cf$export$fabf2dc03a41866e } from "./utils-BkLF-JA3.js";
|
|
4
|
+
import { _ as $4b38b5b75ecc6208$export$698f465ec27e93df, g as $4b38b5b75ecc6208$export$2f2b9559550c7bbc, l as $542a13ca2fa5b484$export$5b6b19405a83ff9d } from "./Dialog-BJ13KRQo.js";
|
|
5
|
+
import { n as $41fb335299a4a39e$export$f5b8910cec6cf069 } from "./Input-BG0Xjw5X.js";
|
|
6
|
+
import { a as $928221da08ecbc62$export$a11e76429ed99b4, i as $928221da08ecbc62$export$8e6d031a08cf56a1, t as $928221da08ecbc62$export$41f133550aa26f48 } from "./ListBox-gR4iSV7N.js";
|
|
7
|
+
import { i as $a3be900807531178$re_export$useFilter, t as $a3be900807531178$re_export$Collection } from "./exports-DeBGRThC.js";
|
|
8
|
+
import { Spinner } from "./components/spinner.js";
|
|
9
|
+
import { t as UIConfig } from "./uiConfig.context-CjnLnQOo.js";
|
|
10
|
+
import { n as FieldController } from "./form.binding-Brdjq2yr.js";
|
|
11
|
+
import { n as $a8ea2faf2ebe4d2f$re_export$mergeProps, r as $a8ea2faf2ebe4d2f$re_export$mergeRefs } from "./import-D_3dPATF.js";
|
|
12
|
+
import { t as useFieldAccessibility } from "./useFieldAccessibility-eZIMECmG.js";
|
|
13
|
+
import { t as FormField } from "./FormField-TI8Vx5aC.js";
|
|
14
|
+
import { t as inputBaseDefinition } from "./input.cva-mm1dnfKP.js";
|
|
15
|
+
import { n as resolveInputLayout, t as isFieldHeaderHiddenByLayout } from "./inputLayout-CIVpuUBq.js";
|
|
16
|
+
import { t as TooltipWrapper } from "./TooltipWrapper-ubbBHHVD.js";
|
|
17
|
+
import { t as popoverDefinition } from "./popover.cva-DAbfSma6.js";
|
|
18
|
+
import { t as InputContent } from "./InputContent-B8OCdbVP.js";
|
|
19
|
+
import { t as selectListBoxItemDefinition } from "./selectItem.cva-B6vxey2R.js";
|
|
20
|
+
import { n as SelectInputTags, t as useDebounceCallback } from "./useDebounceCallback-BjePw6y4.js";
|
|
21
|
+
import { memo, useId, useRef, useState } from "react";
|
|
22
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
+
//#region src/components/inputs/Selection/Autocomplete/Autocomplete.tsx
|
|
24
|
+
const entryKey = (entry) => entry.id == null ? `text:${entry.label}` : `id:${String(entry.id)}`;
|
|
25
|
+
/** The text input, wired to the surrounding React Aria autocomplete so arrow keys move through the suggestions. */
|
|
26
|
+
const AutocompleteTextInput = ({ ref, ...props }) => {
|
|
27
|
+
const { ref: fieldRef, value, onChange, ...fieldProps } = $7230ffa83bc0c2cf$export$fabf2dc03a41866e($4b38b5b75ecc6208$export$698f465ec27e93df) ?? {};
|
|
28
|
+
const inputProps = $a8ea2faf2ebe4d2f$re_export$mergeProps(fieldProps, props);
|
|
29
|
+
return /* @__PURE__ */ jsx($41fb335299a4a39e$export$f5b8910cec6cf069, {
|
|
30
|
+
...inputProps,
|
|
31
|
+
ref: $a8ea2faf2ebe4d2f$re_export$mergeRefs(ref, fieldRef),
|
|
32
|
+
role: "combobox",
|
|
33
|
+
"aria-controls": inputProps["aria-controls"],
|
|
34
|
+
"aria-expanded": inputProps["aria-expanded"],
|
|
35
|
+
value: value ?? "",
|
|
36
|
+
onChange: (event) => onChange?.(event.target.value)
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
function AutocompleteInner({ items: itemsProp, list, selectionMode, value, defaultValue, onChange, onValueCommit, collapseAfter, onBlur, onInputChange, isClientSearchDisabled, searchDebounceDelay, ref, inputClassName, label, error, helperText, className, tooltipText, isRequired, rightContent, headerClassName, errorClassName, isDisabled, isReadOnly, isInvalid, isDirty, layout: layoutProp, hideLabel: hideLabelProp, variant: variantProp, size: sizeProp, isClearable: isClearableProp, isClearableIfDisabled, unit, isLoading, action, leadingIcon, trailingIcon, placeholder, autoFocusOnMount: _autoFocusOnMount, name: _name, onClick: _onClick, style: _style, min: _min, max: _max, isMulti: _isMulti, options: _options, onSelectionChange: _onSelectionChange, selectedKey: _selectedKey, selectedKeys: _selectedKeys, defaultSelectedKey: _defaultSelectedKey, defaultSelectedKeys: _defaultSelectedKeys, renderStaticInput: _renderStaticInput, ...rest }) {
|
|
40
|
+
const ui = UIConfig.useConfig();
|
|
41
|
+
const generatedId = useId();
|
|
42
|
+
const inputId = rest.id ?? generatedId;
|
|
43
|
+
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
44
|
+
const popoverCva = UIOverrides.useCva("popover.cva", popoverDefinition);
|
|
45
|
+
const itemCva = UIOverrides.useCva("select.listBoxItemCva", selectListBoxItemDefinition);
|
|
46
|
+
const { contains } = $a3be900807531178$re_export$useFilter({ sensitivity: "base" });
|
|
47
|
+
const isMultiple = selectionMode === "multiple";
|
|
48
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue ?? null);
|
|
49
|
+
const [pendingText, setPendingText] = useState("");
|
|
50
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
51
|
+
const inputRef = useRef(null);
|
|
52
|
+
const frameRef = useRef(null);
|
|
53
|
+
const popoverRef = useRef(null);
|
|
54
|
+
const currentValue = value === void 0 ? uncontrolledValue : value;
|
|
55
|
+
const entries = isMultiple && Array.isArray(currentValue) ? currentValue : [];
|
|
56
|
+
const text = isMultiple ? pendingText : (!isMultiple && currentValue && !Array.isArray(currentValue) ? currentValue : null)?.label ?? "";
|
|
57
|
+
const hasValue = text !== "" || entries.length > 0;
|
|
58
|
+
const as = resolveInputLayout(layoutProp, ui.input.layout);
|
|
59
|
+
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
60
|
+
const variant = variantProp ?? ui.input.variant;
|
|
61
|
+
const size = sizeProp ?? ui.input.size;
|
|
62
|
+
const isClearable = isClearableProp ?? ui.input.isClearable;
|
|
63
|
+
const isEditable = !isDisabled && !isReadOnly;
|
|
64
|
+
const { describedBy, errorMessageId, helperTextId } = useFieldAccessibility({
|
|
65
|
+
describedBy: rest["aria-describedby"],
|
|
66
|
+
error,
|
|
67
|
+
helperText
|
|
68
|
+
});
|
|
69
|
+
const { callback: searchList } = useDebounceCallback(list?.setFilterText, { delay: searchDebounceDelay ?? ui.select.searchDebounceDelay });
|
|
70
|
+
const selectedIds = new Set(entries.map((entry) => entry.id));
|
|
71
|
+
const visibleItems = (list?.items ?? itemsProp ?? []).filter((item) => !(isMultiple && selectedIds.has(item.id)) && (!!list || isClientSearchDisabled || contains(item.label, text)));
|
|
72
|
+
const showPopover = isOpen && isEditable && (visibleItems.length > 0 || !!list?.isLoading);
|
|
73
|
+
const emit = (next) => {
|
|
74
|
+
if (value === void 0) setUncontrolledValue(next);
|
|
75
|
+
onChange?.(next);
|
|
76
|
+
};
|
|
77
|
+
const updateText = (next) => {
|
|
78
|
+
if (isMultiple) setPendingText(next);
|
|
79
|
+
if (list) searchList(next);
|
|
80
|
+
onInputChange?.(next);
|
|
81
|
+
};
|
|
82
|
+
const typeText = (next) => {
|
|
83
|
+
if (!isEditable || next === text) return;
|
|
84
|
+
updateText(next);
|
|
85
|
+
if (!isMultiple) emit(next ? { label: next } : null);
|
|
86
|
+
setIsOpen(true);
|
|
87
|
+
};
|
|
88
|
+
const pick = (item) => {
|
|
89
|
+
if (!isEditable) return;
|
|
90
|
+
const picked = {
|
|
91
|
+
id: item.id,
|
|
92
|
+
label: item.label
|
|
93
|
+
};
|
|
94
|
+
if (isMultiple) {
|
|
95
|
+
emit([...entries, picked]);
|
|
96
|
+
updateText("");
|
|
97
|
+
} else {
|
|
98
|
+
emit(picked);
|
|
99
|
+
onInputChange?.(item.label);
|
|
100
|
+
}
|
|
101
|
+
onValueCommit?.();
|
|
102
|
+
setIsOpen(false);
|
|
103
|
+
};
|
|
104
|
+
/** Turns the typed text into a chip. Returns whether there was text to act on. */
|
|
105
|
+
const commitText = (notify) => {
|
|
106
|
+
if (!isMultiple || !pendingText) return false;
|
|
107
|
+
const typed = pendingText.trim();
|
|
108
|
+
const isDuplicate = entries.some((entry) => entry.id == null && entry.label.toLowerCase() === typed.toLowerCase());
|
|
109
|
+
if (typed && !isDuplicate) {
|
|
110
|
+
emit([...entries, { label: typed }]);
|
|
111
|
+
if (notify) onValueCommit?.();
|
|
112
|
+
}
|
|
113
|
+
updateText("");
|
|
114
|
+
return true;
|
|
115
|
+
};
|
|
116
|
+
const removeAt = (index) => {
|
|
117
|
+
if (!isEditable || index < 0) return;
|
|
118
|
+
emit(entries.filter((_, entryIndex) => entryIndex !== index));
|
|
119
|
+
onValueCommit?.();
|
|
120
|
+
inputRef.current?.focus();
|
|
121
|
+
};
|
|
122
|
+
const tags = entries.map((entry) => ({
|
|
123
|
+
id: entryKey(entry),
|
|
124
|
+
label: entry.label,
|
|
125
|
+
color: entry.id == null ? "secondary" : "primary"
|
|
126
|
+
}));
|
|
127
|
+
const removeTag = (key) => removeAt(entries.findIndex((entry) => entryKey(entry) === key));
|
|
128
|
+
const clear = () => {
|
|
129
|
+
emit(isMultiple ? [] : null);
|
|
130
|
+
updateText("");
|
|
131
|
+
onValueCommit?.();
|
|
132
|
+
};
|
|
133
|
+
const onKeyDown = (event) => {
|
|
134
|
+
const focusedOptionId = event.currentTarget.getAttribute("aria-activedescendant");
|
|
135
|
+
const hasFocusedOption = !!focusedOptionId && !!document.getElementById(focusedOptionId);
|
|
136
|
+
if (event.key === "Enter" && !hasFocusedOption) {
|
|
137
|
+
if (commitText(true)) event.preventDefault();
|
|
138
|
+
setIsOpen(false);
|
|
139
|
+
} else if (event.key === "Backspace" && isMultiple && !pendingText && entries.length > 0) removeAt(entries.length - 1);
|
|
140
|
+
else if (event.key === "Escape" && showPopover) {
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
setIsOpen(false);
|
|
143
|
+
} else if ((event.key === "ArrowDown" || event.key === "ArrowUp") && !showPopover && isEditable) {
|
|
144
|
+
event.preventDefault();
|
|
145
|
+
setIsOpen(true);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const onInputBlur = (event) => {
|
|
149
|
+
if (popoverRef.current?.contains(event.relatedTarget)) return;
|
|
150
|
+
commitText(false);
|
|
151
|
+
setIsOpen(false);
|
|
152
|
+
onBlur?.(event);
|
|
153
|
+
};
|
|
154
|
+
const focusInput = (event) => {
|
|
155
|
+
if (isDisabled || event.target.closest("input, button")) return;
|
|
156
|
+
event.preventDefault();
|
|
157
|
+
inputRef.current?.focus();
|
|
158
|
+
};
|
|
159
|
+
const fieldProps = {
|
|
160
|
+
label,
|
|
161
|
+
error,
|
|
162
|
+
helperText,
|
|
163
|
+
tooltipText,
|
|
164
|
+
isRequired,
|
|
165
|
+
rightContent,
|
|
166
|
+
headerClassName,
|
|
167
|
+
errorClassName,
|
|
168
|
+
isDisabled,
|
|
169
|
+
hideLabel,
|
|
170
|
+
errorMessageId,
|
|
171
|
+
helperTextId,
|
|
172
|
+
labelProps: { htmlFor: inputId }
|
|
173
|
+
};
|
|
174
|
+
const inputPlaceholder = entries.length > 0 ? void 0 : as === "floating" ? "\xA0" : placeholder;
|
|
175
|
+
const input = /* @__PURE__ */ jsx(AutocompleteTextInput, {
|
|
176
|
+
...$a8ea2faf2ebe4d2f$re_export$mergeProps(rest, {
|
|
177
|
+
onKeyDown,
|
|
178
|
+
onBlur: onInputBlur
|
|
179
|
+
}),
|
|
180
|
+
id: inputId,
|
|
181
|
+
ref: $a8ea2faf2ebe4d2f$re_export$mergeRefs(ref, inputRef),
|
|
182
|
+
"aria-expanded": showPopover,
|
|
183
|
+
"aria-label": rest["aria-label"] ?? label,
|
|
184
|
+
"aria-describedby": describedBy,
|
|
185
|
+
"aria-errormessage": errorMessageId,
|
|
186
|
+
"aria-invalid": !!error || isInvalid || void 0,
|
|
187
|
+
"aria-required": isRequired || void 0,
|
|
188
|
+
disabled: isDisabled,
|
|
189
|
+
readOnly: isReadOnly,
|
|
190
|
+
placeholder: inputPlaceholder,
|
|
191
|
+
"data-is-filled": hasValue || void 0,
|
|
192
|
+
"data-is-dirty": isDirty || void 0,
|
|
193
|
+
className: clsx("min-w-0 bg-transparent outline-none", isMultiple ? "w-16 flex-1" : "w-full")
|
|
194
|
+
});
|
|
195
|
+
return /* @__PURE__ */ jsxs($4b38b5b75ecc6208$export$2f2b9559550c7bbc, {
|
|
196
|
+
inputValue: text,
|
|
197
|
+
onInputChange: typeText,
|
|
198
|
+
disableAutoFocusFirst: true,
|
|
199
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
200
|
+
className: clsx("group w-full", className),
|
|
201
|
+
children: /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
202
|
+
as,
|
|
203
|
+
error,
|
|
204
|
+
children: /* @__PURE__ */ jsx(FormField, {
|
|
205
|
+
...fieldProps,
|
|
206
|
+
hideLabel: hideLabel || isFieldHeaderHiddenByLayout(as),
|
|
207
|
+
layout: as,
|
|
208
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
209
|
+
ref: frameRef,
|
|
210
|
+
className: clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
211
|
+
variant,
|
|
212
|
+
layout: as
|
|
213
|
+
}), inputClassName),
|
|
214
|
+
"data-is-empty": !hasValue || void 0,
|
|
215
|
+
"data-is-disabled": isDisabled || void 0,
|
|
216
|
+
"data-is-required": isRequired || void 0,
|
|
217
|
+
onMouseDown: focusInput,
|
|
218
|
+
children: /* @__PURE__ */ jsx(InputContent, {
|
|
219
|
+
inputRef,
|
|
220
|
+
isReadOnly,
|
|
221
|
+
unit,
|
|
222
|
+
isLoading,
|
|
223
|
+
isDisabled,
|
|
224
|
+
action,
|
|
225
|
+
leadingIcon,
|
|
226
|
+
trailingIcon,
|
|
227
|
+
isClearable: isClearable && !isReadOnly,
|
|
228
|
+
isClearableIfDisabled,
|
|
229
|
+
value: text || entries.map((entry) => entry.label).join(", "),
|
|
230
|
+
onChange: clear,
|
|
231
|
+
headerProps: {
|
|
232
|
+
...fieldProps,
|
|
233
|
+
isHeaderHidden: hideLabel
|
|
234
|
+
},
|
|
235
|
+
as,
|
|
236
|
+
size,
|
|
237
|
+
children: isMultiple ? /* @__PURE__ */ jsxs("div", {
|
|
238
|
+
className: "flex min-w-0 flex-1 flex-wrap items-center gap-1",
|
|
239
|
+
children: [/* @__PURE__ */ jsx(SelectInputTags, {
|
|
240
|
+
selectedItems: tags,
|
|
241
|
+
selectedTagsType: "tags",
|
|
242
|
+
collapseAfter,
|
|
243
|
+
isDisabled,
|
|
244
|
+
onRemove: isReadOnly ? void 0 : removeTag,
|
|
245
|
+
tagClassName: "max-w-full"
|
|
246
|
+
}), input]
|
|
247
|
+
}) : input
|
|
248
|
+
})
|
|
249
|
+
})
|
|
250
|
+
})
|
|
251
|
+
})
|
|
252
|
+
}), /* @__PURE__ */ jsx($542a13ca2fa5b484$export$5b6b19405a83ff9d, {
|
|
253
|
+
ref: popoverRef,
|
|
254
|
+
triggerRef: frameRef,
|
|
255
|
+
isOpen: showPopover,
|
|
256
|
+
onOpenChange: setIsOpen,
|
|
257
|
+
isNonModal: true,
|
|
258
|
+
placement: "bottom start",
|
|
259
|
+
className: clsx(popoverCva({}), "w-max max-w-[min(20rem,calc(100vw-2rem))]"),
|
|
260
|
+
style: { minWidth: "min(var(--trigger-width), calc(100vw - 24px))" },
|
|
261
|
+
children: /* @__PURE__ */ jsxs($928221da08ecbc62$export$41f133550aa26f48, {
|
|
262
|
+
"aria-label": rest["aria-label"] ?? label,
|
|
263
|
+
className: "max-h-72 overflow-auto outline-none",
|
|
264
|
+
children: [/* @__PURE__ */ jsx($a3be900807531178$re_export$Collection, {
|
|
265
|
+
items: visibleItems,
|
|
266
|
+
children: (item) => /* @__PURE__ */ jsx($928221da08ecbc62$export$a11e76429ed99b4, {
|
|
267
|
+
id: item.id,
|
|
268
|
+
textValue: item.label,
|
|
269
|
+
isDisabled: item.isDisabled,
|
|
270
|
+
onAction: () => pick(item),
|
|
271
|
+
className: itemCva({ isSingle: true }),
|
|
272
|
+
children: item.content ?? item.label
|
|
273
|
+
})
|
|
274
|
+
}), list && /* @__PURE__ */ jsx($928221da08ecbc62$export$8e6d031a08cf56a1, {
|
|
275
|
+
onLoadMore: list.hasNextPage ? () => list.fetchNextPage() : void 0,
|
|
276
|
+
isLoading: list.isLoading || list.isFetchingNextPage,
|
|
277
|
+
className: "flex justify-center py-1.5 text-muted-foreground",
|
|
278
|
+
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
279
|
+
})]
|
|
280
|
+
})
|
|
281
|
+
})]
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
function ControlledAutocomplete(props) {
|
|
285
|
+
const { field, ref, ...innerProps } = props;
|
|
286
|
+
return /* @__PURE__ */ jsx(FieldController, {
|
|
287
|
+
control: field.form,
|
|
288
|
+
name: field.name,
|
|
289
|
+
onValueChange: field.onValueChange,
|
|
290
|
+
onBlur: field.onBlur,
|
|
291
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(AutocompleteInner, {
|
|
292
|
+
...innerProps,
|
|
293
|
+
ref: $a8ea2faf2ebe4d2f$re_export$mergeRefs(ref, field.ref),
|
|
294
|
+
value: field.value ?? (props.selectionMode === "multiple" ? [] : null),
|
|
295
|
+
onChange: field.onChange,
|
|
296
|
+
onValueCommit: field.onValueCommit,
|
|
297
|
+
onBlur: field.onBlur,
|
|
298
|
+
isDirty,
|
|
299
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
300
|
+
error: props.error ?? error?.message
|
|
301
|
+
})
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
function AutocompleteComponent(props) {
|
|
305
|
+
return props.field ? /* @__PURE__ */ jsx(ControlledAutocomplete, { ...props }) : /* @__PURE__ */ jsx(AutocompleteInner, { ...props });
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* A text field with suggestions whose entries are either picked suggestions (`{ id, label }`) or typed text
|
|
309
|
+
* (`{ label }`). `selectionMode="multiple"` turns it into a row of chips, like an email "To" line.
|
|
310
|
+
* To allow only the listed options, use `Select isSearchable`.
|
|
311
|
+
*
|
|
312
|
+
* @example
|
|
313
|
+
* <Autocomplete label="City" items={cities} value={city} onChange={setCity} />
|
|
314
|
+
* @example
|
|
315
|
+
* <Autocomplete label="To" selectionMode="multiple" items={contacts} field={{ form, name: "recipients" }} />
|
|
316
|
+
*/
|
|
317
|
+
const Autocomplete = memo(AutocompleteComponent);
|
|
318
|
+
//#endregion
|
|
319
|
+
export { Autocomplete as t };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { n as Removed } from "./hints-B09_WDhL.js";
|
|
2
|
+
import { i as FieldValues } from "./form.binding-DSXB2AOD.js";
|
|
3
|
+
import { t as FormControlProps } from "./form.types-a2WVJDQX.js";
|
|
4
|
+
import { i as StandaloneInputProps } from "./Input-onUj0DKg.js";
|
|
5
|
+
import { t as AsyncList } from "./useAsyncList-F-328rtE.js";
|
|
6
|
+
import { ReactElement, ReactNode } from "react";
|
|
7
|
+
import { InputProps, Key } from "react-aria-components";
|
|
8
|
+
//#region src/components/inputs/Selection/Autocomplete/Autocomplete.d.ts
|
|
9
|
+
/** A suggestion offered while typing. */
|
|
10
|
+
interface AutocompleteItem<TKey extends Key = Key> {
|
|
11
|
+
/** Stored as the entry's `id` when the suggestion is picked. */
|
|
12
|
+
id: TKey;
|
|
13
|
+
/** Text shown in the field, matched against the typed text and used as the accessible name. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Custom suggestion content in the list, in place of `label`. */
|
|
16
|
+
content?: ReactNode;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One entry held by an `Autocomplete`: a picked suggestion or typed text.
|
|
21
|
+
* A picked suggestion carries its `id` (an exact match); typed text has no `id` (a partial match).
|
|
22
|
+
*/
|
|
23
|
+
interface AutocompleteValue<TKey extends Key = Key> {
|
|
24
|
+
/** The picked suggestion's `id`. Absent when the entry is typed text. */
|
|
25
|
+
id?: TKey;
|
|
26
|
+
/** The picked suggestion's label, or the typed text. */
|
|
27
|
+
label: string;
|
|
28
|
+
}
|
|
29
|
+
/** The subset of `useAsyncList` an `Autocomplete` reads to load suggestions remotely. */
|
|
30
|
+
type AutocompleteList<TKey extends Key = Key> = Pick<AsyncList<AutocompleteItem<TKey>>, "items" | "isLoading" | "hasNextPage" | "fetchNextPage" | "isFetchingNextPage" | "setFilterText">;
|
|
31
|
+
type AutocompleteDataProps<TKey extends Key = Key> = {
|
|
32
|
+
/** @deprecated Pass either `items` or `list`. */
|
|
33
|
+
items?: Removed<"Pass either `items` or `list`; the list supplies the suggestions">;
|
|
34
|
+
/** Remote suggestions from `useAsyncList`; the typed text is sent to `list.setFilterText`. */
|
|
35
|
+
list: AutocompleteList<TKey>;
|
|
36
|
+
/** @deprecated A `list` already filters on the server. */
|
|
37
|
+
isClientSearchDisabled?: Removed<"Leave it out: a `list` already filters on the server. It is only for `items` filtered elsewhere">;
|
|
38
|
+
} | {
|
|
39
|
+
/** The suggestions. Typed text filters them by `label`. */
|
|
40
|
+
items: readonly AutocompleteItem<TKey>[];
|
|
41
|
+
list?: never;
|
|
42
|
+
/** Skip built-in label filtering when `items` are already filtered elsewhere, such as on the server. */
|
|
43
|
+
isClientSearchDisabled?: boolean;
|
|
44
|
+
};
|
|
45
|
+
interface AutocompleteSingleProps<TKey extends Key = Key> {
|
|
46
|
+
/** Omitted or `"single"`: the field is a text box and `value` is one entry or null. */
|
|
47
|
+
selectionMode?: "single";
|
|
48
|
+
value?: AutocompleteValue<TKey> | null;
|
|
49
|
+
defaultValue?: AutocompleteValue<TKey> | null;
|
|
50
|
+
/** Typing emits `{ label }`, picking a suggestion emits `{ id, label }`, and an empty field emits null. */
|
|
51
|
+
onChange?: (value: AutocompleteValue<TKey> | null) => void;
|
|
52
|
+
collapseAfter?: never;
|
|
53
|
+
}
|
|
54
|
+
interface AutocompleteMultipleProps<TKey extends Key = Key> {
|
|
55
|
+
/** The field holds a row of chips, like an email "To" line, and `value` is an array of entries. */
|
|
56
|
+
selectionMode: "multiple";
|
|
57
|
+
value?: AutocompleteValue<TKey>[];
|
|
58
|
+
defaultValue?: AutocompleteValue<TKey>[];
|
|
59
|
+
/** Emits when a chip is added (picking a suggestion, or Enter/blur on typed text) or removed. */
|
|
60
|
+
onChange?: (value: AutocompleteValue<TKey>[]) => void;
|
|
61
|
+
/** Chips to show before the rest collapse into "+N more", as on a multiple `Select`. Every chip shows when omitted. */
|
|
62
|
+
collapseAfter?: number;
|
|
63
|
+
}
|
|
64
|
+
type AutocompleteBaseProps = Omit<StandaloneInputProps, "field" | "type" | "renderStaticInput" | "spellCheck" | "value" | "defaultValue" | "onChange" | "name"> & {
|
|
65
|
+
spellCheck?: InputProps["spellCheck"];
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated `Autocomplete` is not submitted through native `FormData`: its value is `{ id, label }` entries, which
|
|
68
|
+
* one text field cannot carry.
|
|
69
|
+
*/
|
|
70
|
+
name?: Removed<"Autocomplete is not submitted with native FormData: bind it with field={{ form, name }}">;
|
|
71
|
+
/** Every change to the text in the field, including the reset after a chip is added. */
|
|
72
|
+
onInputChange?: (text: string) => void;
|
|
73
|
+
/** Debounce for `list.setFilterText` in milliseconds; defaults to UIConfig.select.searchDebounceDelay (500). */
|
|
74
|
+
searchDebounceDelay?: number;
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated Use `selectionMode="multiple"`. Intersected with `boolean` because the remaining props spread into the
|
|
77
|
+
* `<input>`, which has its own `multiple`.
|
|
78
|
+
*/
|
|
79
|
+
multiple?: boolean & Removed<'Use selectionMode="multiple"'>;
|
|
80
|
+
/** @deprecated Use `selectionMode="multiple"`. */
|
|
81
|
+
isMulti?: Removed<'Use selectionMode="multiple"'>;
|
|
82
|
+
/** @deprecated Use `items`. */
|
|
83
|
+
options?: Removed<"Use `items`: { id, label }[]">;
|
|
84
|
+
/** @deprecated Use `onChange`. */
|
|
85
|
+
onSelectionChange?: Removed<"Use `onChange`; it receives the entry, { id, label } or typed { label }">;
|
|
86
|
+
/** @deprecated Use `value`. */
|
|
87
|
+
selectedKey?: Removed<'Use `value`: an entry { id?, label }, or an array of entries with selectionMode="multiple"'>;
|
|
88
|
+
/** @deprecated Use `value`. */
|
|
89
|
+
selectedKeys?: Removed<'Use `value`: an entry { id?, label }, or an array of entries with selectionMode="multiple"'>;
|
|
90
|
+
/** @deprecated Use `defaultValue`. */
|
|
91
|
+
defaultSelectedKey?: Removed<'Use `defaultValue`: an entry { id?, label }, or an array of entries with selectionMode="multiple"'>;
|
|
92
|
+
/** @deprecated Use `defaultValue`. */
|
|
93
|
+
defaultSelectedKeys?: Removed<'Use `defaultValue`: an entry { id?, label }, or an array of entries with selectionMode="multiple"'>;
|
|
94
|
+
/** @deprecated Has no effect: the field is always live. */
|
|
95
|
+
renderStaticInput?: Removed<"Leave it out: Autocomplete always mounts its live input, so its ref is ready after mount">;
|
|
96
|
+
};
|
|
97
|
+
/** Props for an `Autocomplete` that owns its value through `value`/`defaultValue`/`onChange`. */
|
|
98
|
+
type StandaloneAutocompleteProps<TKey extends Key = Key> = AutocompleteBaseProps & AutocompleteDataProps<TKey> & (AutocompleteSingleProps<TKey> | AutocompleteMultipleProps<TKey>) & {
|
|
99
|
+
field?: never;
|
|
100
|
+
};
|
|
101
|
+
type AutocompleteControlProps<TKey extends Key, TFieldValues extends FieldValues> = ({
|
|
102
|
+
selectionMode?: "single";
|
|
103
|
+
} & FormControlProps<AutocompleteSingleProps<TKey>, TFieldValues, "value", "an { id?, label } entry or null">) | ({
|
|
104
|
+
selectionMode: "multiple";
|
|
105
|
+
} & FormControlProps<AutocompleteMultipleProps<TKey>, TFieldValues, "value", "an array of { id?, label } entries">);
|
|
106
|
+
/** Props for an `Autocomplete` bound to a form field; the form owns the value, change, and blur handling. */
|
|
107
|
+
type ControlledAutocompleteProps<TKey extends Key = Key, TFieldValues extends FieldValues = FieldValues> = Omit<AutocompleteBaseProps, "onBlur"> & AutocompleteDataProps<TKey> & AutocompleteControlProps<TKey extends string ? string : TKey extends number ? number : TKey, TFieldValues>;
|
|
108
|
+
/** Props for `Autocomplete`: either its own value props, or `field={{ form, name }}` to bind a form field. */
|
|
109
|
+
type AutocompleteProps<TKey extends Key = Key, TFieldValues extends FieldValues = FieldValues> = StandaloneAutocompleteProps<TKey> | ControlledAutocompleteProps<TKey, TFieldValues>;
|
|
110
|
+
declare function AutocompleteComponent<TKey extends Key = Key, TFieldValues extends FieldValues = FieldValues>(props: AutocompleteProps<TKey, TFieldValues>): ReactElement;
|
|
111
|
+
/**
|
|
112
|
+
* A text field with suggestions whose entries are either picked suggestions (`{ id, label }`) or typed text
|
|
113
|
+
* (`{ label }`). `selectionMode="multiple"` turns it into a row of chips, like an email "To" line.
|
|
114
|
+
* To allow only the listed options, use `Select isSearchable`.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* <Autocomplete label="City" items={cities} value={city} onChange={setCity} />
|
|
118
|
+
* @example
|
|
119
|
+
* <Autocomplete label="To" selectionMode="multiple" items={contacts} field={{ form, name: "recipients" }} />
|
|
120
|
+
*/
|
|
121
|
+
declare const Autocomplete: typeof AutocompleteComponent;
|
|
122
|
+
//#endregion
|
|
123
|
+
export { AutocompleteMultipleProps as a, AutocompleteValue as c, AutocompleteList as i, ControlledAutocompleteProps as l, AutocompleteDataProps as n, AutocompleteProps as o, AutocompleteItem as r, AutocompleteSingleProps as s, Autocomplete as t, StandaloneAutocompleteProps as u };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { n as IconSlotIcon } from "./IconSlot-DcEDPaNb.js";
|
|
2
|
+
import { _n as BadgeVariantProps } from "./link.cva-D6L1c2wq.js";
|
|
3
|
+
import { n as Removed } from "./hints-B09_WDhL.js";
|
|
4
|
+
import { t as ButtonContentVariantProps } from "./buttonContent.cva-Dyy_RUZU.js";
|
|
5
|
+
import { n as TypographyProps } from "./Typography-Cx1oRGxd.js";
|
|
6
|
+
import { ReactNode, Ref } from "react";
|
|
7
|
+
import { ButtonProps, ToggleButtonProps } from "react-aria-components";
|
|
8
|
+
//#region src/components/text/Badge/Badge.d.ts
|
|
9
|
+
interface BadgeSharedProps extends BadgeVariantProps {
|
|
10
|
+
className?: string;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/** A component such as a lucide icon, or an element. */
|
|
13
|
+
icon?: IconSlotIcon;
|
|
14
|
+
contentRef?: Ref<HTMLElement>;
|
|
15
|
+
}
|
|
16
|
+
/** A display-only badge. Pass `onRemove` for a remove button inside it. */
|
|
17
|
+
interface StaticBadgeProps extends BadgeSharedProps {
|
|
18
|
+
as?: undefined;
|
|
19
|
+
/** Makes the badge removable: renders a remove button that calls this handler. */
|
|
20
|
+
onRemove?: () => void;
|
|
21
|
+
/** Props applied to the remove button, when one is rendered. Its default name is "Remove <children>"; an `aria-label` replaces it. */
|
|
22
|
+
removeButtonProps?: Omit<ButtonProps, "children" | "onPress">;
|
|
23
|
+
excludeFromTabOrder?: boolean;
|
|
24
|
+
isDisabled?: boolean;
|
|
25
|
+
/** Displays the selected appearance without making the badge interactive. */
|
|
26
|
+
isSelected?: boolean;
|
|
27
|
+
/** Defaults to `UIConfig.tag.textSize`. */
|
|
28
|
+
textSize?: TypographyProps["size"];
|
|
29
|
+
/** @deprecated A display-only badge is not pressable. */
|
|
30
|
+
onPress?: Removed<'Add `as="button"` for a pressable badge'>;
|
|
31
|
+
/** @deprecated A display-only badge is not a toggle. */
|
|
32
|
+
onChange?: Removed<'Add `as="toggle"` for a toggle badge; `onChange` receives the selected state'>;
|
|
33
|
+
/** @deprecated Use `as="toggle"`. */
|
|
34
|
+
toggle?: Removed<'Use `as="toggle"`'>;
|
|
35
|
+
/** @deprecated Use `onRemove`. */
|
|
36
|
+
onDismiss?: Removed<"Use `onRemove` instead of `onDismiss`">;
|
|
37
|
+
/** @deprecated Pass `onRemove`. */
|
|
38
|
+
dismissible?: Removed<"Pass `onRemove`; it alone renders the remove button">;
|
|
39
|
+
}
|
|
40
|
+
/** A badge-styled action. Works as a menu or dialog trigger. */
|
|
41
|
+
type ButtonBadgeProps = BadgeSharedProps & ButtonContentVariantProps & Omit<ButtonProps, "children" | "className" | "style"> & {
|
|
42
|
+
as: "button";
|
|
43
|
+
};
|
|
44
|
+
/** A badge-styled toggle; `onChange` receives the next selected state. Defaults to the `outlined` variant. */
|
|
45
|
+
type ToggleBadgeProps = BadgeSharedProps & ButtonContentVariantProps & Omit<ToggleButtonProps, "children" | "className" | "style" | "onPress"> & {
|
|
46
|
+
as: "toggle";
|
|
47
|
+
/** @deprecated Use `onChange`. */
|
|
48
|
+
onPress?: Removed<"Use `onChange`; it receives the selected state">;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Props for `Badge`. Without `as` it is display-only; `as="button"` makes the whole badge an action and
|
|
52
|
+
* `as="toggle"` a toggle button.
|
|
53
|
+
*/
|
|
54
|
+
type BadgeProps = StaticBadgeProps | ButtonBadgeProps | ToggleBadgeProps;
|
|
55
|
+
/**
|
|
56
|
+
* A compact label. Display-only by default; `as="button"` or `as="toggle"` makes the whole badge
|
|
57
|
+
* interactive.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* <Badge color="success">Active</Badge>
|
|
61
|
+
* <Badge onRemove={removeFilter}>Status: open</Badge>
|
|
62
|
+
* <Badge as="button" color="error" onPress={deleteSelected}>Delete</Badge>
|
|
63
|
+
* <Badge as="toggle" isSelected={isPinned} onChange={setIsPinned}>Pinned</Badge>
|
|
64
|
+
*/
|
|
65
|
+
declare const Badge: (props: BadgeProps) => import("react").JSX.Element;
|
|
66
|
+
//#endregion
|
|
67
|
+
export { ToggleBadgeProps as a, StaticBadgeProps as i, BadgeProps as n, ButtonBadgeProps as r, Badge as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as clsx } from "./clsx-CnD0nOiA.js";
|
|
2
|
-
import { n as $f2ff30fde7b014be$export$3ddf2d174ce01153, t as $f2ff30fde7b014be$export$2e1e1122cf0cba88 } from "./Dialog-
|
|
3
|
-
import { n as $8b8d26808cb8cb53$export$8948f78d83984c69, t as $8b8d26808cb8cb53$export$2b77a92f1a5ad772 } from "./Modal-
|
|
4
|
-
import { t as UIConfig } from "./uiConfig.context-
|
|
2
|
+
import { n as $f2ff30fde7b014be$export$3ddf2d174ce01153, t as $f2ff30fde7b014be$export$2e1e1122cf0cba88 } from "./Dialog-BJ13KRQo.js";
|
|
3
|
+
import { n as $8b8d26808cb8cb53$export$8948f78d83984c69, t as $8b8d26808cb8cb53$export$2b77a92f1a5ad772 } from "./Modal-DAMsCwzb.js";
|
|
4
|
+
import { t as UIConfig } from "./uiConfig.context-CjnLnQOo.js";
|
|
5
5
|
import { a as $a8ea2faf2ebe4d2f$re_export$useResizeObserver, o as $a8ea2faf2ebe4d2f$re_export$useViewportSize } from "./import-D_3dPATF.js";
|
|
6
6
|
import { n as useStateAndRef, t as DomUtils } from "./dom.utils-BPooTXtC.js";
|
|
7
7
|
import { BottomSheetHeader } from "./components/bottom-sheet-header.js";
|
|
@@ -28,7 +28,7 @@ const staticTransition = {
|
|
|
28
28
|
]
|
|
29
29
|
};
|
|
30
30
|
const KEYBOARD_INSET_THRESHOLD = 48;
|
|
31
|
-
const BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = true, isScrollable = true, height = "full", label, portalContainerRef, children, footer, hideHeader, hideThumb: hideThumbProp, sheetMarginTop = 96, sheetMarginBottom = 128, closeDragThreshold: closeDragThresholdProp, closeVelocityThreshold: closeVelocityThresholdProp, shouldCloseOnInteractOutside,
|
|
31
|
+
const BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable = true, isScrollable = true, height = "full", label, portalContainerRef, children, footer, hideHeader, hideThumb: hideThumbProp, sheetMarginTop = 96, sheetMarginBottom = 128, closeDragThreshold: closeDragThresholdProp, closeVelocityThreshold: closeVelocityThresholdProp, shouldCloseOnInteractOutside, className, overlayClassName, headerTypography: headerTypographyProp }) => {
|
|
32
32
|
const uiConfig = UIConfig.useConfig();
|
|
33
33
|
const closeDragThreshold = closeDragThresholdProp ?? uiConfig.bottomSheet.closeDragThreshold;
|
|
34
34
|
const closeVelocityThreshold = closeVelocityThresholdProp ?? uiConfig.bottomSheet.closeVelocityThreshold;
|
|
@@ -102,7 +102,7 @@ const BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable =
|
|
|
102
102
|
return /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs(MotionModalOverlay, {
|
|
103
103
|
isOpen: true,
|
|
104
104
|
UNSTABLE_portalContainer: portalContainerRef?.current,
|
|
105
|
-
className:
|
|
105
|
+
className: "fixed top-0 left-0 z-bottom-sheet w-screen h-dvh",
|
|
106
106
|
style: { "--bottom-sheet-keyboard-inset": `var(--bottom-sheet-host-inset, ${keyboardInset}px)` },
|
|
107
107
|
onOpenChange,
|
|
108
108
|
isDismissable,
|
|
@@ -177,14 +177,14 @@ const BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable =
|
|
|
177
177
|
children: /* @__PURE__ */ jsx($f2ff30fde7b014be$export$3ddf2d174ce01153, {
|
|
178
178
|
className: "relative flex min-h-0 flex-1 flex-col items-stretch outline-none",
|
|
179
179
|
ref: dialogRef,
|
|
180
|
-
"aria-label": label,
|
|
180
|
+
"aria-label": label || void 0,
|
|
181
181
|
children: ({ close }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
182
182
|
/* @__PURE__ */ jsx("div", {
|
|
183
183
|
style: { minHeight: `${sheetMarginTop}px` },
|
|
184
184
|
className: clsx("shrink-0", height === "auto" && "grow")
|
|
185
185
|
}),
|
|
186
186
|
/* @__PURE__ */ jsxs("div", {
|
|
187
|
-
className: clsx("pointer-events-auto relative flex min-h-0 flex-col items-stretch rounded-t-lg border-t bg-background text-foreground", height === "full" && "flex-1"),
|
|
187
|
+
className: clsx("pointer-events-auto relative flex min-h-0 flex-col items-stretch rounded-t-lg border-t bg-background text-foreground", height === "full" && "flex-1", className),
|
|
188
188
|
children: [
|
|
189
189
|
/* @__PURE__ */ jsx("div", {
|
|
190
190
|
className: clsx("absolute bottom-full left-0 w-full outline-none", isDismissable ? "h-0" : "h-screen"),
|
|
@@ -208,7 +208,7 @@ const BottomSheetBase = ({ isOpen, onOpenChange, onStateChange, isDismissable =
|
|
|
208
208
|
className: "shrink-0",
|
|
209
209
|
style: { height: `${footerHeight + (isScrollable ? 0 : sheetMarginBottom)}px` }
|
|
210
210
|
}),
|
|
211
|
-
/* @__PURE__ */ jsx("div", { className: "absolute top-full h-screen w-full bg-
|
|
211
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-full h-screen w-full bg-inherit" })
|
|
212
212
|
]
|
|
213
213
|
}),
|
|
214
214
|
footer && /* @__PURE__ */ jsx(motion.div, {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { En as TypographyVariantProps } from "./link.cva-D6L1c2wq.js";
|
|
2
|
+
import { n as Removed } from "./hints-B09_WDhL.js";
|
|
3
|
+
import { ReactElement, ReactNode, RefObject } from "react";
|
|
4
|
+
//#region src/components/overlays/BottomSheet/BottomSheet.d.ts
|
|
5
|
+
type BottomSheetState = "closed" | "opening" | "opened" | "closing";
|
|
6
|
+
interface BottomSheetBaseProps {
|
|
7
|
+
/** Controlled open state. Optional only when `trigger` owns the state; without either the sheet never opens. */
|
|
8
|
+
isOpen?: boolean;
|
|
9
|
+
/** Called with the next open state: `false` on Escape, outside press, drag-to-close, the close button or `close()`. */
|
|
10
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
11
|
+
/** Reports the slide animation phase: `opening` then `opened`, `closing` then `closed`. */
|
|
12
|
+
onStateChange?: (state: BottomSheetState) => void;
|
|
13
|
+
/** Whether pressing outside closes the sheet; false also hides the drag handle and the close button. Defaults to true. */
|
|
14
|
+
isDismissable?: boolean;
|
|
15
|
+
/** Set to false for content that does not scroll, to reserve `sheetMarginBottom` px below it. Defaults to true. */
|
|
16
|
+
isScrollable?: boolean;
|
|
17
|
+
/** Hides the header row (the `label` text and close button); `label` still names the sheet. */
|
|
18
|
+
hideHeader?: boolean;
|
|
19
|
+
/** Hides the drag handle. Defaults to `UIConfig` `bottomSheet.hideThumb` (false). */
|
|
20
|
+
hideThumb?: boolean;
|
|
21
|
+
/** `full` (default) fills the viewport below `sheetMarginTop`; `auto` fits the content. */
|
|
22
|
+
height?: "auto" | "full";
|
|
23
|
+
/** Accessible name, also rendered as the header text unless `hideHeader` is set. */
|
|
24
|
+
label: string;
|
|
25
|
+
/** Element to portal into instead of `document.body`. */
|
|
26
|
+
portalContainerRef?: RefObject<HTMLElement>;
|
|
27
|
+
/** Sheet content, or a function that receives `close`. */
|
|
28
|
+
children: ReactNode | ((close: () => void) => ReactNode);
|
|
29
|
+
/** Content pinned to the bottom of the viewport, above the on-screen keyboard. */
|
|
30
|
+
footer?: ReactNode;
|
|
31
|
+
/** Minimum gap (px) kept between the top of the viewport and the sheet. Defaults to 96. */
|
|
32
|
+
sheetMarginTop?: number;
|
|
33
|
+
/** Space (px) reserved below the content when `isScrollable` is false. Defaults to 128. */
|
|
34
|
+
sheetMarginBottom?: number;
|
|
35
|
+
/** Min downward drag distance (px) to allow close on release. Increase to require a longer drag. Defaults to `UIConfig` `bottomSheet.closeDragThreshold` (100). */
|
|
36
|
+
closeDragThreshold?: number;
|
|
37
|
+
/** Min downward velocity (px/s) to close on flick. Increase to require a more intentional swipe. Defaults to `UIConfig` `bottomSheet.closeVelocityThreshold` (200). */
|
|
38
|
+
closeVelocityThreshold?: number;
|
|
39
|
+
/** Return false to ignore an outside press. */
|
|
40
|
+
shouldCloseOnInteractOutside?: () => boolean;
|
|
41
|
+
/** Classes for the sheet, the visible surface that slides up and holds the header and `children` (background, width). */
|
|
42
|
+
className?: string;
|
|
43
|
+
/** Classes for the dimmed backdrop. */
|
|
44
|
+
overlayClassName?: string;
|
|
45
|
+
/** Typography variant of the header text. Defaults to `UIConfig` `bottomSheet.headerTypography`. */
|
|
46
|
+
headerTypography?: TypographyVariantProps;
|
|
47
|
+
/** @deprecated Use `isOpen`. */
|
|
48
|
+
open?: Removed<"Use `isOpen`">;
|
|
49
|
+
/** @deprecated Use `onOpenChange`. */
|
|
50
|
+
onClose?: Removed<"Use `onOpenChange`; it is called with `false` when the sheet closes">;
|
|
51
|
+
/** @deprecated Use `className`. */
|
|
52
|
+
containerClassName?: Removed<"Use `className`; it styles the sheet">;
|
|
53
|
+
/** @deprecated Use `label`. */
|
|
54
|
+
"aria-label"?: Removed<"Use `label`">;
|
|
55
|
+
/** @deprecated Use `label`. */
|
|
56
|
+
title?: Removed<"Use `label`; it is rendered as the sheet header">;
|
|
57
|
+
/** @deprecated Use `label`. */
|
|
58
|
+
heading?: Removed<"Use `label`; it is rendered as the sheet header">;
|
|
59
|
+
}
|
|
60
|
+
interface BottomSheetProps extends BottomSheetBaseProps {
|
|
61
|
+
/** A pressable element (`Button`, `IconButton`) that opens the sheet on press. */
|
|
62
|
+
trigger?: ReactElement;
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { BottomSheetProps as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BottomSheetProps } from "./BottomSheet-
|
|
1
|
+
import { t as BottomSheetProps } from "./BottomSheet-Be0HtQzP.js";
|
|
2
2
|
//#region src/components/overlays/BottomSheet/BottomSheet.lazy.d.ts
|
|
3
3
|
declare const BottomSheet: ({ isOpen, onOpenChange, trigger, ...props }: BottomSheetProps) => import("react").JSX.Element;
|
|
4
4
|
//#endregion
|