tembro 2.0.4 → 2.0.5
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/dist/components/actions/action-menu.cjs +1 -1
- package/dist/components/actions/action-menu.d.ts +13 -1
- package/dist/components/actions/action-menu.js +87 -61
- package/dist/components/actions/button-group.cjs +1 -1
- package/dist/components/actions/button-group.d.ts +9 -1
- package/dist/components/actions/button-group.js +58 -14
- package/dist/components/actions/copy-button.cjs +1 -1
- package/dist/components/actions/copy-button.d.ts +2 -1
- package/dist/components/actions/copy-button.js +13 -11
- package/dist/components/calendar/calendar.cjs +1 -1
- package/dist/components/calendar/calendar.d.ts +14 -1
- package/dist/components/calendar/calendar.js +207 -128
- package/dist/components/calendar/date-picker.cjs +1 -1
- package/dist/components/calendar/date-picker.d.ts +3 -1
- package/dist/components/calendar/date-picker.js +57 -27
- package/dist/components/calendar/date-range-picker.cjs +1 -1
- package/dist/components/calendar/date-range-picker.d.ts +10 -1
- package/dist/components/calendar/date-range-picker.js +149 -64
- package/dist/components/data-table/data-table-toolbar.cjs +1 -1
- package/dist/components/data-table/data-table-toolbar.d.ts +5 -1
- package/dist/components/data-table/data-table-toolbar.js +36 -23
- package/dist/components/data-table/data-table.cjs +1 -1
- package/dist/components/data-table/data-table.d.ts +6 -4
- package/dist/components/data-table/data-table.js +87 -79
- package/dist/components/data-table/demo.cjs +1 -1
- package/dist/components/data-table/demo.js +3 -13
- package/dist/components/data-table/index.cjs +1 -1
- package/dist/components/data-table/index.js +5 -5
- package/dist/components/data-table/public.cjs +1 -1
- package/dist/components/data-table/public.d.ts +1 -6
- package/dist/components/data-table/public.js +7 -12
- package/dist/components/display/activity-feed.cjs +1 -1
- package/dist/components/display/activity-feed.d.ts +12 -1
- package/dist/components/display/activity-feed.js +69 -47
- package/dist/components/display/carousel.cjs +1 -1
- package/dist/components/display/carousel.d.ts +10 -1
- package/dist/components/display/carousel.js +68 -23
- package/dist/components/display/code-block.cjs +2 -1
- package/dist/components/display/code-block.d.ts +3 -1
- package/dist/components/display/code-block.js +33 -19
- package/dist/components/display/comparison-card.cjs +1 -1
- package/dist/components/display/comparison-card.d.ts +3 -3
- package/dist/components/display/comparison-card.js +14 -38
- package/dist/components/display/data-state.cjs +1 -1
- package/dist/components/display/data-state.d.ts +12 -2
- package/dist/components/display/data-state.js +80 -42
- package/dist/components/display/demo.cjs +1 -1
- package/dist/components/display/demo.js +1 -5
- package/dist/components/display/index.cjs +1 -1
- package/dist/components/display/index.d.ts +0 -3
- package/dist/components/display/index.js +21 -24
- package/dist/components/feedback/alert.cjs +1 -1
- package/dist/components/feedback/alert.d.ts +6 -1
- package/dist/components/feedback/alert.js +49 -19
- package/dist/components/feedback/index.cjs +1 -1
- package/dist/components/feedback/index.d.ts +0 -2
- package/dist/components/feedback/index.js +3 -5
- package/dist/components/filters/demo.cjs +1 -1
- package/dist/components/filters/demo.js +1 -5
- package/dist/components/filters/filter-bar.cjs +1 -1
- package/dist/components/filters/filter-bar.d.ts +15 -1
- package/dist/components/filters/filter-bar.js +94 -50
- package/dist/components/filters/index.cjs +1 -1
- package/dist/components/filters/index.d.ts +0 -1
- package/dist/components/filters/index.js +3 -4
- package/dist/components/form/form-field-shell.cjs +1 -1
- package/dist/components/form/form-field-shell.d.ts +17 -3
- package/dist/components/form/form-field-shell.js +54 -40
- package/dist/components/form/form-input.cjs +1 -1
- package/dist/components/form/form-input.js +278 -217
- package/dist/components/form/form-select.cjs +1 -1
- package/dist/components/form/form-select.js +47 -33
- package/dist/components/form/form-switch.cjs +1 -1
- package/dist/components/form/form-switch.js +79 -66
- package/dist/components/form/form-textarea.cjs +1 -1
- package/dist/components/form/form-textarea.js +59 -48
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.js +14 -14
- package/dist/components/form/public.cjs +1 -1
- package/dist/components/form/public.d.ts +0 -8
- package/dist/components/form/public.js +7 -15
- package/dist/components/inputs/async-select.cjs +1 -1
- package/dist/components/inputs/async-select.d.ts +11 -2
- package/dist/components/inputs/async-select.js +278 -270
- package/dist/components/inputs/combobox.cjs +1 -1
- package/dist/components/inputs/combobox.d.ts +5 -1
- package/dist/components/inputs/combobox.js +52 -19
- package/dist/components/inputs/simple-select.cjs +1 -1
- package/dist/components/inputs/simple-select.d.ts +2 -1
- package/dist/components/inputs/simple-select.js +32 -16
- package/dist/components/layout/app-sidebar.cjs +1 -1
- package/dist/components/layout/app-sidebar.d.ts +4 -1
- package/dist/components/layout/app-sidebar.js +152 -132
- package/dist/components/layout/breadcrumbs.cjs +1 -1
- package/dist/components/layout/breadcrumbs.d.ts +2 -1
- package/dist/components/layout/breadcrumbs.js +10 -10
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +3 -3
- package/dist/components/layout/stat-card.cjs +1 -1
- package/dist/components/layout/stat-card.d.ts +8 -1
- package/dist/components/layout/stat-card.js +33 -11
- package/dist/components/modern/calendar-scheduler.cjs +1 -1
- package/dist/components/modern/calendar-scheduler.d.ts +2 -1
- package/dist/components/modern/calendar-scheduler.js +21 -12
- package/dist/components/overlay/alert-dialog.cjs +1 -1
- package/dist/components/overlay/alert-dialog.d.ts +15 -1
- package/dist/components/overlay/alert-dialog.js +102 -27
- package/dist/components/overlay/drawer.cjs +1 -1
- package/dist/components/overlay/drawer.d.ts +4 -1
- package/dist/components/overlay/drawer.js +20 -17
- package/dist/components/patterns/index.cjs +1 -1
- package/dist/components/patterns/index.d.ts +0 -1
- package/dist/components/patterns/index.js +1 -2
- package/dist/components/patterns/public.cjs +1 -1
- package/dist/components/patterns/public.d.ts +0 -1
- package/dist/components/patterns/public.js +1 -2
- package/dist/components/ui/button/index.cjs +1 -1
- package/dist/components/ui/button/index.d.ts +3 -1
- package/dist/components/ui/button/index.js +7 -5
- package/dist/components/ui/checkbox/index.cjs +1 -1
- package/dist/components/ui/checkbox/index.d.ts +8 -0
- package/dist/components/ui/checkbox/index.js +16 -14
- package/dist/components/ui/collapse/index.cjs +1 -1
- package/dist/components/ui/collapse/index.d.ts +17 -3
- package/dist/components/ui/collapse/index.js +88 -33
- package/dist/components/ui/dialog/index.cjs +1 -1
- package/dist/components/ui/dialog/index.d.ts +2 -1
- package/dist/components/ui/dialog/index.js +6 -4
- package/dist/components/ui/dropdown-menu/index.cjs +1 -1
- package/dist/components/ui/dropdown-menu/index.d.ts +9 -4
- package/dist/components/ui/dropdown-menu/index.js +87 -62
- package/dist/index.cjs +1 -1
- package/dist/index.js +137 -156
- package/dist/public-component-surface.cjs +1 -1
- package/dist/public-component-surface.js +0 -15
- package/dist/showcase/component-api-schema.cjs +1 -1
- package/dist/showcase/component-api-schema.js +2 -2
- package/dist/showcase/create-demo.cjs +20 -34
- package/dist/showcase/create-demo.js +15 -16
- package/dist/showcase/fallback.cjs +3 -3
- package/dist/showcase/fallback.js +275 -265
- package/dist/showcase/premium/accordion/showcase.cjs +1 -1
- package/dist/showcase/premium/accordion/showcase.js +36 -5
- package/dist/showcase/premium/action-menu/showcase.cjs +1 -1
- package/dist/showcase/premium/action-menu/showcase.js +26 -8
- package/dist/showcase/premium/activity-feed/showcase.cjs +1 -1
- package/dist/showcase/premium/activity-feed/showcase.js +60 -36
- package/dist/showcase/premium/alert/showcase.cjs +1 -1
- package/dist/showcase/premium/alert/showcase.js +41 -18
- package/dist/showcase/premium/alert-dialog/showcase.cjs +1 -1
- package/dist/showcase/premium/alert-dialog/showcase.js +35 -7
- package/dist/showcase/premium/async-multi-select/mock.cjs +4 -3
- package/dist/showcase/premium/async-multi-select/mock.js +5 -5
- package/dist/showcase/premium/async-multi-select/showcase.cjs +1 -1
- package/dist/showcase/premium/async-multi-select/showcase.js +4 -3
- package/dist/showcase/premium/async-select/mock.cjs +1 -1
- package/dist/showcase/premium/async-select/mock.js +1 -1
- package/dist/showcase/premium/async-select/showcase.cjs +1 -1
- package/dist/showcase/premium/async-select/showcase.js +69 -22
- package/dist/showcase/premium/button/showcase.cjs +1 -1
- package/dist/showcase/premium/button/showcase.js +49 -3
- package/dist/showcase/premium/button-group/showcase.cjs +1 -1
- package/dist/showcase/premium/button-group/showcase.js +53 -29
- package/dist/showcase/premium/calendar/showcase.cjs +1 -1
- package/dist/showcase/premium/calendar/showcase.js +7 -2
- package/dist/showcase/premium/carousel/showcase.cjs +1 -1
- package/dist/showcase/premium/carousel/showcase.js +95 -47
- package/dist/showcase/premium/checkbox/showcase.cjs +1 -1
- package/dist/showcase/premium/checkbox/showcase.js +143 -67
- package/dist/showcase/premium/clearable-input/mock.cjs +4 -3
- package/dist/showcase/premium/clearable-input/mock.js +3 -2
- package/dist/showcase/premium/clearable-input/showcase.cjs +1 -1
- package/dist/showcase/premium/clearable-input/showcase.js +8 -2
- package/dist/showcase/premium/collapse/showcase.cjs +1 -1
- package/dist/showcase/premium/collapse/showcase.js +7 -0
- package/dist/showcase/premium/combobox/showcase.cjs +1 -1
- package/dist/showcase/premium/combobox/showcase.d.ts +2 -1
- package/dist/showcase/premium/combobox/showcase.js +56 -47
- package/dist/showcase/premium/data-table/showcase.cjs +1 -1
- package/dist/showcase/premium/data-table/showcase.js +138 -46
- package/dist/showcase/premium/data-table-parts/showcase.cjs +1 -1
- package/dist/showcase/premium/data-table-parts/showcase.js +13 -13
- package/dist/showcase/premium/date-input/mock.cjs +1 -1
- package/dist/showcase/premium/date-input/mock.js +1 -1
- package/dist/showcase/premium/date-range-picker/showcase.cjs +1 -1
- package/dist/showcase/premium/date-range-picker/showcase.js +32 -1
- package/dist/showcase/premium/dropdown-menu/showcase.cjs +1 -1
- package/dist/showcase/premium/dropdown-menu/showcase.js +88 -54
- package/dist/showcase/premium/form-wrapper/mock.cjs +41 -15
- package/dist/showcase/premium/form-wrapper/mock.js +4 -4
- package/dist/showcase/premium/form-wrapper/showcase.cjs +1 -1
- package/dist/showcase/premium/form-wrapper/showcase.js +77 -28
- package/dist/showcase/premium/index.cjs +1 -1
- package/dist/showcase/premium/index.js +426 -467
- package/dist/showcase/premium/input/mock.cjs +4 -1
- package/dist/showcase/premium/input/mock.js +1 -1
- package/dist/showcase/premium/masked-input/mock.cjs +1 -1
- package/dist/showcase/premium/masked-input/mock.js +1 -1
- package/dist/showcase/premium/money-input/mock.cjs +1 -1
- package/dist/showcase/premium/money-input/mock.js +1 -1
- package/dist/showcase/premium/number-input/mock.cjs +1 -1
- package/dist/showcase/premium/number-input/mock.js +1 -1
- package/dist/showcase/premium/phone-input/mock.cjs +1 -1
- package/dist/showcase/premium/phone-input/mock.js +1 -1
- package/dist/showcase/premium/quantity-input/mock.cjs +1 -1
- package/dist/showcase/premium/quantity-input/mock.js +1 -1
- package/dist/showcase/premium/simple-select/mock.cjs +1 -1
- package/dist/showcase/premium/simple-select/mock.js +1 -1
- package/dist/showcase/premium/simple-select/showcase.cjs +1 -1
- package/dist/showcase/premium/simple-select/showcase.js +4 -2
- package/dist/showcase/preview-catalog.cjs +7 -10
- package/dist/showcase/preview-catalog.js +7 -7
- package/dist/showcase/registry-quality.cjs +1 -1
- package/dist/showcase/registry-quality.js +0 -23
- package/dist/showcase/registry-specific.cjs +1 -1
- package/dist/showcase/registry-specific.js +149 -383
- package/dist/showcase/render-registry-preview.cjs +1 -1
- package/dist/showcase/render-registry-preview.js +163 -195
- package/dist/showcase/site-data.cjs +1 -1
- package/dist/showcase/site-data.js +197 -941
- package/dist/showcase/supplemental.cjs +1 -1
- package/dist/showcase/supplemental.js +1 -1
- package/dist/showcase/tembro-registry.json.cjs +1 -1
- package/dist/showcase/tembro-registry.json.js +33 -51
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +2 -2
- package/packages/cli/vendor/src/components/actions/action-menu.tsx +149 -83
- package/packages/cli/vendor/src/components/actions/button-group.tsx +141 -33
- package/packages/cli/vendor/src/components/actions/copy-button.tsx +21 -16
- package/packages/cli/vendor/src/components/calendar/calendar.tsx +223 -88
- package/packages/cli/vendor/src/components/calendar/date-picker.tsx +73 -29
- package/packages/cli/vendor/src/components/calendar/date-range-picker.tsx +154 -49
- package/packages/cli/vendor/src/components/data-table/data-table-toolbar.tsx +71 -50
- package/packages/cli/vendor/src/components/data-table/data-table.tsx +65 -53
- package/packages/cli/vendor/src/components/data-table/demo.tsx +2 -12
- package/packages/cli/vendor/src/components/data-table/public.ts +1 -6
- package/packages/cli/vendor/src/components/display/activity-feed.tsx +98 -40
- package/packages/cli/vendor/src/components/display/carousel.tsx +88 -2
- package/packages/cli/vendor/src/components/display/code-block.tsx +58 -26
- package/packages/cli/vendor/src/components/display/comparison-card.tsx +15 -41
- package/packages/cli/vendor/src/components/display/data-state.tsx +119 -50
- package/packages/cli/vendor/src/components/display/demo.tsx +0 -4
- package/packages/cli/vendor/src/components/display/index.ts +0 -3
- package/packages/cli/vendor/src/components/feedback/alert.tsx +86 -28
- package/packages/cli/vendor/src/components/feedback/index.ts +0 -2
- package/packages/cli/vendor/src/components/filters/demo.tsx +0 -1
- package/packages/cli/vendor/src/components/filters/filter-bar.tsx +126 -54
- package/packages/cli/vendor/src/components/filters/index.ts +0 -1
- package/packages/cli/vendor/src/components/form/form-field-shell.tsx +72 -34
- package/packages/cli/vendor/src/components/form/form-input.tsx +118 -11
- package/packages/cli/vendor/src/components/form/form-select.tsx +26 -3
- package/packages/cli/vendor/src/components/form/form-switch.tsx +77 -58
- package/packages/cli/vendor/src/components/form/form-textarea.tsx +65 -51
- package/packages/cli/vendor/src/components/form/public.ts +0 -9
- package/packages/cli/vendor/src/components/inputs/async-select.tsx +126 -82
- package/packages/cli/vendor/src/components/inputs/combobox.tsx +66 -9
- package/packages/cli/vendor/src/components/inputs/simple-select.tsx +52 -24
- package/packages/cli/vendor/src/components/layout/app-sidebar.tsx +42 -1
- package/packages/cli/vendor/src/components/layout/breadcrumbs.tsx +17 -8
- package/packages/cli/vendor/src/components/layout/stat-card.tsx +63 -23
- package/packages/cli/vendor/src/components/modern/calendar-scheduler.tsx +32 -22
- package/packages/cli/vendor/src/components/overlay/alert-dialog.tsx +148 -24
- package/packages/cli/vendor/src/components/overlay/drawer.tsx +42 -30
- package/packages/cli/vendor/src/components/patterns/index.ts +0 -1
- package/packages/cli/vendor/src/components/patterns/public.ts +0 -1
- package/packages/cli/vendor/src/components/ui/button/index.tsx +27 -17
- package/packages/cli/vendor/src/components/ui/checkbox/index.tsx +22 -5
- package/packages/cli/vendor/src/components/ui/collapse/index.tsx +97 -16
- package/packages/cli/vendor/src/components/ui/dialog/index.tsx +12 -8
- package/packages/cli/vendor/src/components/ui/dropdown-menu/index.tsx +82 -28
- package/packages/cli/vendor/src/public-component-surface.ts +0 -3
- package/packages/cli/vendor/src/showcase/component-api-schema.ts +2 -2
- package/packages/cli/vendor/src/showcase/create-demo.tsx +31 -46
- package/packages/cli/vendor/src/showcase/fallback.tsx +80 -99
- package/packages/cli/vendor/src/showcase/premium/accordion/showcase.tsx +32 -2
- package/packages/cli/vendor/src/showcase/premium/action-menu/showcase.tsx +12 -3
- package/packages/cli/vendor/src/showcase/premium/activity-feed/showcase.tsx +15 -2
- package/packages/cli/vendor/src/showcase/premium/alert/showcase.tsx +32 -17
- package/packages/cli/vendor/src/showcase/premium/alert-dialog/showcase.tsx +28 -3
- package/packages/cli/vendor/src/showcase/premium/async-multi-select/mock.ts +6 -5
- package/packages/cli/vendor/src/showcase/premium/async-multi-select/showcase.tsx +5 -4
- package/packages/cli/vendor/src/showcase/premium/async-select/mock.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/async-select/showcase.tsx +36 -0
- package/packages/cli/vendor/src/showcase/premium/button/showcase.tsx +26 -5
- package/packages/cli/vendor/src/showcase/premium/button-group/showcase.tsx +20 -3
- package/packages/cli/vendor/src/showcase/premium/calendar/showcase.tsx +5 -0
- package/packages/cli/vendor/src/showcase/premium/carousel/showcase.tsx +33 -5
- package/packages/cli/vendor/src/showcase/premium/checkbox/showcase.tsx +46 -3
- package/packages/cli/vendor/src/showcase/premium/clearable-input/mock.ts +5 -3
- package/packages/cli/vendor/src/showcase/premium/clearable-input/showcase.tsx +5 -2
- package/packages/cli/vendor/src/showcase/premium/collapse/showcase.tsx +4 -0
- package/packages/cli/vendor/src/showcase/premium/combobox/showcase.tsx +8 -0
- package/packages/cli/vendor/src/showcase/premium/data-table/showcase.tsx +77 -27
- package/packages/cli/vendor/src/showcase/premium/data-table-parts/showcase.tsx +11 -11
- package/packages/cli/vendor/src/showcase/premium/date-input/mock.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/date-range-picker/showcase.tsx +7 -0
- package/packages/cli/vendor/src/showcase/premium/dropdown-menu/showcase.tsx +46 -3
- package/packages/cli/vendor/src/showcase/premium/form-wrapper/mock.ts +70 -44
- package/packages/cli/vendor/src/showcase/premium/form-wrapper/showcase.tsx +129 -12
- package/packages/cli/vendor/src/showcase/premium/index.ts +7 -24
- package/packages/cli/vendor/src/showcase/premium/input/mock.ts +2 -2
- package/packages/cli/vendor/src/showcase/premium/masked-input/mock.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/money-input/mock.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/number-input/mock.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/phone-input/mock.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/quantity-input/mock.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/simple-select/mock.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/simple-select/showcase.tsx +2 -1
- package/packages/cli/vendor/src/showcase/preview-catalog.tsx +7 -7
- package/packages/cli/vendor/src/showcase/registry-quality.ts +4 -28
- package/packages/cli/vendor/src/showcase/registry-specific.tsx +3 -178
- package/packages/cli/vendor/src/showcase/render-registry-preview.tsx +18 -51
- package/packages/cli/vendor/src/showcase/site-data.tsx +2443 -2761
- package/packages/cli/vendor/src/showcase/supplemental.tsx +2 -42
- package/packages/cli/vendor/src/showcase/tembro-registry.json +11 -58
- package/registry.json +11 -61
- package/dist/components/display/entity-card.cjs +0 -1
- package/dist/components/display/entity-card.d.ts +0 -18
- package/dist/components/display/entity-card.js +0 -61
- package/dist/components/display/entity-header.cjs +0 -1
- package/dist/components/display/entity-header.d.ts +0 -13
- package/dist/components/display/entity-header.js +0 -52
- package/dist/components/display/file-card.cjs +0 -1
- package/dist/components/display/file-card.d.ts +0 -14
- package/dist/components/display/file-card.js +0 -59
- package/dist/components/feedback/empty-search-state.cjs +0 -1
- package/dist/components/feedback/empty-search-state.d.ts +0 -11
- package/dist/components/feedback/empty-search-state.js +0 -45
- package/dist/components/feedback/empty-state.cjs +0 -1
- package/dist/components/feedback/empty-state.d.ts +0 -11
- package/dist/components/feedback/empty-state.js +0 -38
- package/dist/components/filters/filter-chips.cjs +0 -1
- package/dist/components/filters/filter-chips.d.ts +0 -18
- package/dist/components/filters/filter-chips.js +0 -61
- package/dist/components/patterns/form-builder-presets.cjs +0 -1
- package/dist/components/patterns/form-builder-presets.d.ts +0 -1
- package/dist/components/patterns/form-builder-presets.js +0 -2
- package/dist/components/patterns/form-builder.cjs +0 -1
- package/dist/components/patterns/form-builder.d.ts +0 -109
- package/dist/components/patterns/form-builder.js +0 -263
- package/dist/showcase/premium/empty-state/index.cjs +0 -1
- package/dist/showcase/premium/empty-state/index.d.ts +0 -2
- package/dist/showcase/premium/empty-state/index.js +0 -3
- package/dist/showcase/premium/empty-state/mock.cjs +0 -14
- package/dist/showcase/premium/empty-state/mock.d.ts +0 -2
- package/dist/showcase/premium/empty-state/mock.js +0 -31
- package/dist/showcase/premium/empty-state/showcase.cjs +0 -1
- package/dist/showcase/premium/empty-state/showcase.d.ts +0 -3
- package/dist/showcase/premium/empty-state/showcase.js +0 -99
- package/dist/showcase/premium/form-builder/index.cjs +0 -1
- package/dist/showcase/premium/form-builder/index.d.ts +0 -2
- package/dist/showcase/premium/form-builder/index.js +0 -3
- package/dist/showcase/premium/form-builder/mock.cjs +0 -57
- package/dist/showcase/premium/form-builder/mock.d.ts +0 -2
- package/dist/showcase/premium/form-builder/mock.js +0 -40
- package/dist/showcase/premium/form-builder/showcase.cjs +0 -1
- package/dist/showcase/premium/form-builder/showcase.d.ts +0 -3
- package/dist/showcase/premium/form-builder/showcase.js +0 -69
- package/packages/cli/vendor/src/components/display/entity-card.tsx +0 -80
- package/packages/cli/vendor/src/components/display/entity-header.tsx +0 -80
- package/packages/cli/vendor/src/components/display/file-card.tsx +0 -61
- package/packages/cli/vendor/src/components/feedback/empty-search-state.tsx +0 -65
- package/packages/cli/vendor/src/components/feedback/empty-state.tsx +0 -56
- package/packages/cli/vendor/src/components/filters/filter-chips.tsx +0 -89
- package/packages/cli/vendor/src/components/patterns/form-builder-presets.ts +0 -13
- package/packages/cli/vendor/src/components/patterns/form-builder.tsx +0 -443
- package/packages/cli/vendor/src/showcase/premium/empty-state/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/empty-state/mock.ts +0 -30
- package/packages/cli/vendor/src/showcase/premium/empty-state/showcase.tsx +0 -65
- package/packages/cli/vendor/src/showcase/premium/form-builder/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/form-builder/mock.ts +0 -79
- package/packages/cli/vendor/src/showcase/premium/form-builder/showcase.tsx +0 -55
|
@@ -3,8 +3,8 @@ import { Button as n } from "../ui/button/index.js";
|
|
|
3
3
|
import { Input as r } from "../ui/input/index.js";
|
|
4
4
|
import { Popover as i, PopoverContent as ee, PopoverTrigger as te } from "../ui/popover/index.js";
|
|
5
5
|
import * as a from "react";
|
|
6
|
-
import { CheckIcon as
|
|
7
|
-
import {
|
|
6
|
+
import { CheckIcon as o, ChevronsUpDownIcon as ne, Loader2Icon as re, PlusIcon as ie, SearchIcon as ae, XIcon as oe } from "lucide-react";
|
|
7
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/inputs/async-select.tsx
|
|
9
9
|
function se(e, t) {
|
|
10
10
|
let [n, r] = a.useState(e);
|
|
@@ -20,25 +20,25 @@ function se(e, t) {
|
|
|
20
20
|
function ce(e) {
|
|
21
21
|
return typeof e == "object" && !!e && "options" in e;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function le(e) {
|
|
24
24
|
if (!e || e.length === 0) return [];
|
|
25
25
|
let t = e[0];
|
|
26
26
|
return ce(t) ? e : [{ options: e }];
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function ue(e) {
|
|
29
29
|
return e.flatMap((e) => e.options);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function u(e) {
|
|
32
32
|
return typeof e.label == "string" || typeof e.label == "number" ? String(e.label).toLowerCase() : e.value.toLowerCase();
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function de(e, t) {
|
|
35
35
|
let n = e.trim().toLowerCase();
|
|
36
|
-
return n ? !t.some((e) => e.value.toLowerCase() === n ||
|
|
36
|
+
return n ? !t.some((e) => e.value.toLowerCase() === n || u(e) === n) : !1;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function fe(e, t, n, r, i) {
|
|
39
39
|
if (e) return t?.value === e ? t : i?.value === e ? i : [...n, ...r].find((t) => t.value === e);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function d(...e) {
|
|
42
42
|
let t = /* @__PURE__ */ new Map();
|
|
43
43
|
return e.forEach((e) => {
|
|
44
44
|
e?.forEach((e) => {
|
|
@@ -46,11 +46,11 @@ function f(...e) {
|
|
|
46
46
|
});
|
|
47
47
|
}), Array.from(t.values());
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function f(e, t) {
|
|
50
50
|
let n = new Map(t.map((e) => [e.value, e]));
|
|
51
51
|
return e.map((e) => n.get(e)).filter((e) => !!e);
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function pe(e, t, n) {
|
|
54
54
|
let r = e.get(t);
|
|
55
55
|
if (r) {
|
|
56
56
|
if (Number.isFinite(n) && Date.now() - r.createdAt > n) {
|
|
@@ -60,27 +60,27 @@ function de(e, t, n) {
|
|
|
60
60
|
return r.groups;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function me(e, t, n) {
|
|
64
64
|
e.set(t, {
|
|
65
65
|
groups: n,
|
|
66
66
|
createdAt: Date.now()
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function he(e) {
|
|
70
70
|
return e.trim().toLowerCase();
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return /* @__PURE__ */
|
|
72
|
+
function p({ className: t, children: n }) {
|
|
73
|
+
return /* @__PURE__ */ c("div", {
|
|
74
74
|
"data-slot": "async-select-state",
|
|
75
75
|
className: e("rounded-[var(--radius-md)] border border-[color:var(--aui-card-border,var(--border))] bg-[color:color-mix(in_oklch,var(--muted),transparent_55%)] px-3 py-3 text-sm leading-5 text-muted-foreground", t),
|
|
76
76
|
children: n
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function ge(e) {
|
|
80
80
|
return typeof e.label == "string" || typeof e.label == "number" ? String(e.label) : e.value;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
return /* @__PURE__ */
|
|
82
|
+
function _e({ option: t, selected: n, renderOption: r, optionClassName: i, onSelect: ee }) {
|
|
83
|
+
return /* @__PURE__ */ l("button", {
|
|
84
84
|
type: "button",
|
|
85
85
|
disabled: t.disabled,
|
|
86
86
|
"data-slot": "async-select-option",
|
|
@@ -88,23 +88,23 @@ function he({ option: t, selected: n, renderOption: r, optionClassName: i, onSel
|
|
|
88
88
|
"data-disabled": t.disabled || void 0,
|
|
89
89
|
className: e("flex w-full items-start gap-2.5 rounded-[var(--radius-md)] border border-transparent px-3 py-2.5 text-left text-sm outline-none transition-[background-color,border-color,color,box-shadow] hover:border-[color:color-mix(in_oklch,var(--primary),transparent_76%)] hover:bg-[color:color-mix(in_oklch,var(--primary),transparent_93%)] focus-visible:border-[color:var(--aui-focus-ring,var(--ring))] focus-visible:shadow-[0_0_0_3px_var(--aui-focus-ring-soft,transparent)] data-[selected=true]:border-[color:color-mix(in_oklch,var(--primary),transparent_68%)] data-[selected=true]:bg-[color:color-mix(in_oklch,var(--primary),transparent_89%)] data-[selected=true]:text-foreground disabled:pointer-events-none disabled:opacity-50", i),
|
|
90
90
|
onClick: () => ee(t),
|
|
91
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ c("span", {
|
|
92
92
|
className: e("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border border-border/70", n && "border-primary bg-primary text-primary-foreground"),
|
|
93
|
-
children: n && /* @__PURE__ */
|
|
94
|
-
}), /* @__PURE__ */
|
|
93
|
+
children: n && /* @__PURE__ */ c(o, { className: "size-3" })
|
|
94
|
+
}), /* @__PURE__ */ c("span", {
|
|
95
95
|
className: "min-w-0 flex-1",
|
|
96
|
-
children: r?.(t, { selected: n }) ?? /* @__PURE__ */
|
|
96
|
+
children: r?.(t, { selected: n }) ?? /* @__PURE__ */ l("span", {
|
|
97
97
|
className: "flex min-w-0 flex-col",
|
|
98
98
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ c("span", {
|
|
100
100
|
className: "truncate font-medium",
|
|
101
101
|
children: t.label
|
|
102
102
|
}),
|
|
103
|
-
t.description && /* @__PURE__ */
|
|
103
|
+
t.description && /* @__PURE__ */ c("span", {
|
|
104
104
|
className: "truncate text-xs text-muted-foreground",
|
|
105
105
|
children: t.description
|
|
106
106
|
}),
|
|
107
|
-
t.disabled && t.disabledReason && /* @__PURE__ */
|
|
107
|
+
t.disabled && t.disabledReason && /* @__PURE__ */ c("span", {
|
|
108
108
|
className: "truncate text-xs text-muted-foreground",
|
|
109
109
|
children: t.disabledReason
|
|
110
110
|
})
|
|
@@ -113,71 +113,75 @@ function he({ option: t, selected: n, renderOption: r, optionClassName: i, onSel
|
|
|
113
113
|
})]
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
return /* @__PURE__ */
|
|
116
|
+
function ve({ search: e, isCreating: t, label: n, onCreate: r }) {
|
|
117
|
+
return /* @__PURE__ */ l("button", {
|
|
118
118
|
type: "button",
|
|
119
119
|
disabled: t,
|
|
120
120
|
"data-slot": "async-select-create",
|
|
121
121
|
className: "flex w-full items-center gap-2 rounded-[var(--radius-md)] border border-dashed border-[color:color-mix(in_oklch,var(--primary),transparent_55%)] bg-[color:color-mix(in_oklch,var(--primary),transparent_94%)] px-3 py-2.5 text-left text-sm font-medium text-foreground outline-none transition-[background-color,border-color,color,box-shadow] hover:bg-[color:color-mix(in_oklch,var(--primary),transparent_90%)] disabled:pointer-events-none disabled:opacity-50",
|
|
122
122
|
onClick: r,
|
|
123
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ c("span", {
|
|
124
124
|
className: "flex size-4 shrink-0 items-center justify-center",
|
|
125
|
-
children: t ? /* @__PURE__ */
|
|
126
|
-
}), /* @__PURE__ */
|
|
125
|
+
children: t ? /* @__PURE__ */ c(re, { className: "size-4 animate-spin" }) : /* @__PURE__ */ c(ie, { className: "size-4" })
|
|
126
|
+
}), /* @__PURE__ */ c("span", {
|
|
127
127
|
className: "min-w-0 flex-1 truncate",
|
|
128
128
|
children: n?.(e) ?? `Create "${e.trim()}"`
|
|
129
129
|
})]
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
function m(o) {
|
|
133
|
+
if ("isMulti" in o && o.isMulti) {
|
|
134
|
+
let e = { ...o };
|
|
135
|
+
return delete e.isMulti, /* @__PURE__ */ c(ye, { ...e });
|
|
136
|
+
}
|
|
137
|
+
let { className: ie, value: s, selectedOption: ce, onValueChange: u, loadOptions: d, loadSelectedOption: f, defaultOptions: ge, disabled: m = !1, clearable: h = !0, cacheOptions: g = !0, cacheTtl: _ = Infinity, debounceMs: be = 250, minSearchLength: v = 0, labels: y, renderOption: b, renderValue: x, renderLoading: xe, renderEmpty: Se, renderError: S, renderMinSearch: Ce, onCreateOption: we, createOptionLabel: Te, showCreateOption: Ee, showSelectedDescription: De = !0, triggerClassName: Oe, contentClassName: ke, searchClassName: Ae, optionClassName: C, invalid: je, ...Me } = o, w = a.useMemo(() => le(ge), [ge]), Ne = a.useMemo(() => ue(w), [w]), [T, E] = a.useState(!1), [D, O] = a.useState(""), [Pe, k] = a.useState(w), [A, Fe] = a.useState(null), [j, M] = a.useState(!1), [N, P] = a.useState(!1), [F, I] = a.useState(!1), L = a.useRef(/* @__PURE__ */ new Map()), R = a.useRef(0), Ie = a.useRef(0), z = se(D, be).trim(), B = a.useMemo(() => ue(Pe), [Pe]), V = a.useMemo(() => ({
|
|
138
|
+
search: D,
|
|
135
139
|
minSearchLength: v,
|
|
136
|
-
options:
|
|
140
|
+
options: B
|
|
137
141
|
}), [
|
|
138
|
-
|
|
142
|
+
B,
|
|
139
143
|
v,
|
|
140
|
-
|
|
141
|
-
]),
|
|
144
|
+
D
|
|
145
|
+
]), H = fe(s, ce, B, Ne, A), Le = h && !!s && !m, U = z.length < v, W = !U && !!we && (Ee ?? de)(D, B);
|
|
142
146
|
a.useEffect(() => {
|
|
143
|
-
|
|
144
|
-
}, [
|
|
145
|
-
|
|
146
|
-
}, [
|
|
147
|
-
if (!
|
|
148
|
-
let e = new AbortController(), t = ++
|
|
147
|
+
L.current.clear();
|
|
148
|
+
}, [d]), a.useEffect(() => {
|
|
149
|
+
k(w);
|
|
150
|
+
}, [w]), a.useEffect(() => {
|
|
151
|
+
if (!s || H || !f) return;
|
|
152
|
+
let e = new AbortController(), t = ++Ie.current;
|
|
149
153
|
async function n() {
|
|
150
|
-
let n = await
|
|
151
|
-
!e.signal.aborted && t ===
|
|
154
|
+
let n = await f?.(s, e.signal);
|
|
155
|
+
!e.signal.aborted && t === Ie.current && Fe(n ?? null);
|
|
152
156
|
}
|
|
153
157
|
return n(), () => {
|
|
154
158
|
e.abort();
|
|
155
159
|
};
|
|
156
160
|
}, [
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
H,
|
|
162
|
+
f,
|
|
163
|
+
s
|
|
160
164
|
]), a.useEffect(() => {
|
|
161
|
-
if (!
|
|
162
|
-
if (
|
|
163
|
-
|
|
165
|
+
if (!T) return;
|
|
166
|
+
if (U) {
|
|
167
|
+
k(w), M(!1), I(!1);
|
|
164
168
|
return;
|
|
165
169
|
}
|
|
166
|
-
let e = g ?
|
|
170
|
+
let e = g ? pe(L.current, z, _) : void 0;
|
|
167
171
|
if (e) {
|
|
168
|
-
|
|
172
|
+
k(e), M(!1), I(!1);
|
|
169
173
|
return;
|
|
170
174
|
}
|
|
171
|
-
let t = new AbortController(), n = ++
|
|
175
|
+
let t = new AbortController(), n = ++R.current;
|
|
172
176
|
async function r() {
|
|
173
|
-
|
|
177
|
+
M(!0), I(!1);
|
|
174
178
|
try {
|
|
175
|
-
let e =
|
|
176
|
-
!t.signal.aborted && n ===
|
|
179
|
+
let e = le(await d(z, t.signal));
|
|
180
|
+
!t.signal.aborted && n === R.current && (g && me(L.current, z, e), k(e));
|
|
177
181
|
} catch {
|
|
178
|
-
!t.signal.aborted && n ===
|
|
182
|
+
!t.signal.aborted && n === R.current && (I(!0), k([]));
|
|
179
183
|
} finally {
|
|
180
|
-
!t.signal.aborted && n ===
|
|
184
|
+
!t.signal.aborted && n === R.current && M(!1);
|
|
181
185
|
}
|
|
182
186
|
}
|
|
183
187
|
return r(), () => {
|
|
@@ -185,127 +189,127 @@ function h({ className: ne, value: o, selectedOption: ce, onValueChange: d, load
|
|
|
185
189
|
};
|
|
186
190
|
}, [
|
|
187
191
|
g,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
E,
|
|
192
|
+
_,
|
|
193
|
+
d,
|
|
191
194
|
T,
|
|
192
|
-
|
|
193
|
-
|
|
195
|
+
w,
|
|
196
|
+
z,
|
|
197
|
+
U
|
|
194
198
|
]);
|
|
195
|
-
let
|
|
196
|
-
e.disabled || (
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
},
|
|
200
|
-
t(e),
|
|
201
|
-
},
|
|
202
|
-
if (!
|
|
199
|
+
let G = (e) => {
|
|
200
|
+
e.disabled || (u?.(e.value, e), E(!1), O(""));
|
|
201
|
+
}, K = () => {
|
|
202
|
+
u?.(void 0), O("");
|
|
203
|
+
}, Re = (e) => {
|
|
204
|
+
t(e), K();
|
|
205
|
+
}, q = (e) => {
|
|
206
|
+
if (!m) {
|
|
203
207
|
if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
|
|
204
|
-
e.preventDefault(),
|
|
208
|
+
e.preventDefault(), E(!0);
|
|
205
209
|
return;
|
|
206
210
|
}
|
|
207
|
-
(e.key === "Backspace" || e.key === "Delete") &&
|
|
211
|
+
(e.key === "Backspace" || e.key === "Delete") && s && (e.preventDefault(), K());
|
|
208
212
|
}
|
|
209
|
-
},
|
|
210
|
-
if (!(!
|
|
211
|
-
|
|
213
|
+
}, J = async () => {
|
|
214
|
+
if (!(!we || !D.trim() || U)) {
|
|
215
|
+
P(!0);
|
|
212
216
|
try {
|
|
213
|
-
let e = await
|
|
214
|
-
|
|
217
|
+
let e = await we(D.trim()), t = he(D);
|
|
218
|
+
k((t) => [{ options: [e] }, ...t]), g && t && me(L.current, t, [{ options: [e] }]), u?.(e.value, e), O(""), E(!1);
|
|
215
219
|
} finally {
|
|
216
|
-
|
|
220
|
+
P(!1);
|
|
217
221
|
}
|
|
218
222
|
}
|
|
219
223
|
};
|
|
220
|
-
return /* @__PURE__ */
|
|
224
|
+
return /* @__PURE__ */ c("div", {
|
|
221
225
|
"data-slot": "async-select",
|
|
222
|
-
className: e("w-full",
|
|
223
|
-
...
|
|
224
|
-
children: /* @__PURE__ */
|
|
225
|
-
open:
|
|
226
|
-
onOpenChange:
|
|
227
|
-
children: [/* @__PURE__ */
|
|
228
|
-
render: /* @__PURE__ */
|
|
226
|
+
className: e("w-full", ie),
|
|
227
|
+
...Me,
|
|
228
|
+
children: /* @__PURE__ */ l(i, {
|
|
229
|
+
open: T,
|
|
230
|
+
onOpenChange: E,
|
|
231
|
+
children: [/* @__PURE__ */ l(te, {
|
|
232
|
+
render: /* @__PURE__ */ c(n, {
|
|
229
233
|
type: "button",
|
|
230
234
|
variant: "outline",
|
|
231
|
-
disabled:
|
|
232
|
-
"aria-expanded":
|
|
233
|
-
"aria-invalid":
|
|
235
|
+
disabled: m,
|
|
236
|
+
"aria-expanded": T,
|
|
237
|
+
"aria-invalid": je || void 0,
|
|
234
238
|
"data-slot": "async-select-trigger",
|
|
235
|
-
className: e("min-h-11 w-full justify-between rounded-[var(--aui-control-radius,var(--radius-md))] px-3.5 text-left",
|
|
236
|
-
onKeyDown:
|
|
239
|
+
className: e("min-h-11 w-full justify-between rounded-[var(--aui-control-radius,var(--radius-md))] px-3.5 text-left", Oe),
|
|
240
|
+
onKeyDown: q
|
|
237
241
|
}),
|
|
238
|
-
children: [/* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ c("span", {
|
|
239
243
|
className: "min-w-0 flex-1 text-left",
|
|
240
|
-
children:
|
|
244
|
+
children: H ? /* @__PURE__ */ l("span", {
|
|
241
245
|
className: "flex min-w-0 flex-col gap-0.5",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
246
|
+
children: [/* @__PURE__ */ c("span", {
|
|
243
247
|
className: "truncate font-semibold",
|
|
244
|
-
children:
|
|
245
|
-
}),
|
|
248
|
+
children: x?.(H) ?? H.label
|
|
249
|
+
}), De && (H.description || H.disabled && H.disabledReason) ? /* @__PURE__ */ c("span", {
|
|
246
250
|
className: "truncate text-xs text-muted-foreground",
|
|
247
|
-
children:
|
|
248
|
-
})]
|
|
249
|
-
}) : /* @__PURE__ */
|
|
251
|
+
children: H.description ?? H.disabledReason
|
|
252
|
+
}) : null]
|
|
253
|
+
}) : /* @__PURE__ */ c("span", {
|
|
250
254
|
className: "truncate text-muted-foreground",
|
|
251
255
|
children: y?.placeholder ?? "Select"
|
|
252
256
|
})
|
|
253
|
-
}), /* @__PURE__ */
|
|
257
|
+
}), /* @__PURE__ */ l("span", {
|
|
254
258
|
className: "ml-2 flex shrink-0 items-center gap-1",
|
|
255
|
-
children: [
|
|
259
|
+
children: [Le && /* @__PURE__ */ c("span", {
|
|
256
260
|
role: "button",
|
|
257
261
|
tabIndex: 0,
|
|
258
262
|
className: "rounded-full border border-border/65 p-1 text-muted-foreground transition-colors hover:border-border hover:bg-muted/55 hover:text-foreground",
|
|
259
263
|
"aria-label": y?.clear ?? "Clear",
|
|
260
|
-
onClick:
|
|
264
|
+
onClick: Re,
|
|
261
265
|
onKeyDown: (e) => {
|
|
262
|
-
e.key !== "Enter" && e.key !== " " || (e.preventDefault(), t(e),
|
|
266
|
+
e.key !== "Enter" && e.key !== " " || (e.preventDefault(), t(e), K());
|
|
263
267
|
},
|
|
264
|
-
children: /* @__PURE__ */
|
|
265
|
-
}), /* @__PURE__ */
|
|
268
|
+
children: /* @__PURE__ */ c(oe, { className: "size-3.5" })
|
|
269
|
+
}), /* @__PURE__ */ c(ne, { className: "size-4 opacity-60" })]
|
|
266
270
|
})]
|
|
267
|
-
}), /* @__PURE__ */
|
|
271
|
+
}), /* @__PURE__ */ l(ee, {
|
|
268
272
|
align: "start",
|
|
269
273
|
"data-slot": "async-select-content",
|
|
270
|
-
className: e("w-(--anchor-width) min-w-72 gap-3 rounded-[var(--aui-card-radius,var(--radius-lg))] border-[color:var(--aui-card-border,var(--border))] bg-popover p-3 shadow-[var(--aui-control-panel-shadow,0_18px_40px_rgba(15,23,42,0.14))]",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
274
|
+
className: e("w-(--anchor-width) min-w-72 gap-3 rounded-[var(--aui-card-radius,var(--radius-lg))] border-[color:var(--aui-card-border,var(--border))] bg-popover p-3 shadow-[var(--aui-control-panel-shadow,0_18px_40px_rgba(15,23,42,0.14))]", ke),
|
|
275
|
+
children: [/* @__PURE__ */ l("div", {
|
|
272
276
|
"data-slot": "async-select-search-wrap",
|
|
273
277
|
className: "relative",
|
|
274
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ c(ae, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ c(r, {
|
|
275
279
|
"data-slot": "async-select-search",
|
|
276
|
-
value:
|
|
277
|
-
onChange: (e) =>
|
|
280
|
+
value: D,
|
|
281
|
+
onChange: (e) => O(e.target.value),
|
|
278
282
|
placeholder: y?.searchPlaceholder ?? "Search...",
|
|
279
|
-
className: e("pl-8",
|
|
283
|
+
className: e("pl-8", Ae)
|
|
280
284
|
})]
|
|
281
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ l("div", {
|
|
282
286
|
className: "max-h-72 space-y-1 overflow-y-auto pr-1",
|
|
283
287
|
children: [
|
|
284
|
-
|
|
285
|
-
|
|
288
|
+
U && B.length === 0 && (Ce?.(V) ?? /* @__PURE__ */ c(p, { children: y?.minSearchLength?.(v) ?? `Type at least ${v} characters` })),
|
|
289
|
+
j && (xe?.(V) ?? /* @__PURE__ */ c(p, { children: /* @__PURE__ */ l("span", {
|
|
286
290
|
className: "inline-flex items-center gap-2",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
291
|
+
children: [/* @__PURE__ */ c(re, { className: "size-4 animate-spin" }), y?.loading ?? "Loading..."]
|
|
288
292
|
}) })),
|
|
289
|
-
!
|
|
293
|
+
!j && F && (S?.(V) ?? /* @__PURE__ */ c(p, {
|
|
290
294
|
className: "text-destructive",
|
|
291
295
|
children: y?.error ?? "Could not load options"
|
|
292
296
|
})),
|
|
293
|
-
!
|
|
294
|
-
!
|
|
295
|
-
search:
|
|
296
|
-
isCreating:
|
|
297
|
-
label:
|
|
298
|
-
onCreate:
|
|
297
|
+
!j && !F && !U && B.length === 0 && !W && (Se?.(V) ?? /* @__PURE__ */ c(p, { children: y?.empty ?? "No options found" })),
|
|
298
|
+
!j && !F && W && /* @__PURE__ */ c(ve, {
|
|
299
|
+
search: D,
|
|
300
|
+
isCreating: N,
|
|
301
|
+
label: Te,
|
|
302
|
+
onCreate: J
|
|
299
303
|
}),
|
|
300
|
-
!
|
|
304
|
+
!j && !F && Pe.map((e, t) => /* @__PURE__ */ l("div", { children: [e.label && /* @__PURE__ */ c("div", {
|
|
301
305
|
className: "sticky top-0 z-10 bg-popover px-2 py-1 text-xs font-medium text-muted-foreground",
|
|
302
306
|
children: e.label
|
|
303
|
-
}), e.options.map((e) => /* @__PURE__ */
|
|
307
|
+
}), e.options.map((e) => /* @__PURE__ */ c(_e, {
|
|
304
308
|
option: e,
|
|
305
|
-
selected: e.value ===
|
|
306
|
-
renderOption:
|
|
307
|
-
optionClassName:
|
|
308
|
-
onSelect:
|
|
309
|
+
selected: e.value === s,
|
|
310
|
+
renderOption: b,
|
|
311
|
+
optionClassName: C,
|
|
312
|
+
onSelect: G
|
|
309
313
|
}, e.value))] }, t))
|
|
310
314
|
]
|
|
311
315
|
})]
|
|
@@ -313,67 +317,67 @@ function h({ className: ne, value: o, selectedOption: ce, onValueChange: d, load
|
|
|
313
317
|
})
|
|
314
318
|
});
|
|
315
319
|
}
|
|
316
|
-
function
|
|
317
|
-
let
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
320
|
+
function ye({ className: o, value: ie, selectedOptions: ce, onValueChange: u, loadOptions: fe, loadSelectedOptions: m, defaultOptions: ye, disabled: h = !1, clearable: g = !0, cacheOptions: _ = !0, cacheTtl: be = Infinity, closeOnSelect: v = !1, debounceMs: y = 250, minSearchLength: b = 0, maxSelected: x, maxVisibleTags: xe, showSelectAll: Se = !1, labels: S, renderOption: Ce, renderValue: we, renderTag: Te, renderLoading: Ee, renderEmpty: De, renderError: Oe, renderMinSearch: ke, renderMaxSelected: Ae, onCreateOption: C, createOptionLabel: je, showCreateOption: Me, showSelectedDescription: w = !0, triggerClassName: Ne, contentClassName: T, searchClassName: E, optionClassName: D, tagClassName: O, invalid: Pe, ...k }) {
|
|
321
|
+
let A = a.useMemo(() => ie ?? [], [ie]), Fe = A.join("|"), j = a.useMemo(() => le(ye), [ye]), M = a.useMemo(() => ue(j), [j]), [N, P] = a.useState(!1), [F, I] = a.useState(""), [L, R] = a.useState(j), [Ie, z] = a.useState([]), [B, V] = a.useState(!1), [H, Le] = a.useState(!1), [U, W] = a.useState(!1), G = a.useRef(/* @__PURE__ */ new Map()), K = a.useRef(0), Re = a.useRef(0), q = se(F, y).trim(), J = a.useMemo(() => ue(L), [L]), ze = a.useMemo(() => new Set(A), [A]), Y = a.useMemo(() => d(ce, Ie, J, M), [
|
|
322
|
+
M,
|
|
323
|
+
J,
|
|
324
|
+
Ie,
|
|
321
325
|
ce
|
|
322
|
-
]),
|
|
323
|
-
search:
|
|
326
|
+
]), Be = a.useMemo(() => f(A, Y), [Y, A]), X = a.useMemo(() => ({
|
|
327
|
+
search: F,
|
|
324
328
|
minSearchLength: b,
|
|
325
|
-
options:
|
|
326
|
-
selectedCount:
|
|
329
|
+
options: J,
|
|
330
|
+
selectedCount: A.length,
|
|
327
331
|
maxSelected: x
|
|
328
332
|
}), [
|
|
329
|
-
|
|
333
|
+
J,
|
|
330
334
|
x,
|
|
331
335
|
b,
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
]),
|
|
336
|
+
F,
|
|
337
|
+
A.length
|
|
338
|
+
]), Ve = A.length > 0, He = g && Ve && !h, Ue = typeof x == "number" && A.length >= x, We = Math.max(xe ?? A.length, 1), Z = q.length < b, Ge = !Z && !!C && (Me ?? de)(F, J), Q = J.filter((e) => !e.disabled).filter((e) => !ze.has(e.value)), Ke = Se && Q.length > 0 && !Ue, qe = Be.slice(0, We), Je = Math.max(Be.length - qe.length, 0);
|
|
335
339
|
a.useEffect(() => {
|
|
336
|
-
|
|
337
|
-
}, [
|
|
338
|
-
|
|
339
|
-
}, [
|
|
340
|
-
if (!
|
|
341
|
-
let e = new Set(
|
|
340
|
+
G.current.clear();
|
|
341
|
+
}, [fe]), a.useEffect(() => {
|
|
342
|
+
R(j);
|
|
343
|
+
}, [j]), a.useEffect(() => {
|
|
344
|
+
if (!A.length || !m) return;
|
|
345
|
+
let e = new Set(Y.map((e) => e.value)), t = A.filter((t) => !e.has(t));
|
|
342
346
|
if (!t.length) return;
|
|
343
|
-
let n = new AbortController(), r = ++
|
|
347
|
+
let n = new AbortController(), r = ++Re.current;
|
|
344
348
|
async function i() {
|
|
345
|
-
let e = await
|
|
346
|
-
!n.signal.aborted && r ===
|
|
349
|
+
let e = await m?.(t, n.signal);
|
|
350
|
+
!n.signal.aborted && r === Re.current && e && z((t) => d(t, e));
|
|
347
351
|
}
|
|
348
352
|
return i(), () => {
|
|
349
353
|
n.abort();
|
|
350
354
|
};
|
|
351
355
|
}, [
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
+
Y,
|
|
357
|
+
m,
|
|
358
|
+
Fe,
|
|
359
|
+
A
|
|
356
360
|
]), a.useEffect(() => {
|
|
357
|
-
if (!
|
|
358
|
-
if (
|
|
359
|
-
|
|
361
|
+
if (!N) return;
|
|
362
|
+
if (Z) {
|
|
363
|
+
R(j), V(!1), W(!1);
|
|
360
364
|
return;
|
|
361
365
|
}
|
|
362
|
-
let e = _ ?
|
|
366
|
+
let e = _ ? pe(G.current, q, be) : void 0;
|
|
363
367
|
if (e) {
|
|
364
|
-
|
|
368
|
+
R(e), V(!1), W(!1);
|
|
365
369
|
return;
|
|
366
370
|
}
|
|
367
|
-
let t = new AbortController(), n = ++
|
|
371
|
+
let t = new AbortController(), n = ++K.current;
|
|
368
372
|
async function r() {
|
|
369
|
-
|
|
373
|
+
V(!0), W(!1);
|
|
370
374
|
try {
|
|
371
|
-
let e =
|
|
372
|
-
!t.signal.aborted && n ===
|
|
375
|
+
let e = le(await fe(q, t.signal));
|
|
376
|
+
!t.signal.aborted && n === K.current && (_ && me(G.current, q, e), R(e));
|
|
373
377
|
} catch {
|
|
374
|
-
!t.signal.aborted && n ===
|
|
378
|
+
!t.signal.aborted && n === K.current && (W(!0), R([]));
|
|
375
379
|
} finally {
|
|
376
|
-
!t.signal.aborted && n ===
|
|
380
|
+
!t.signal.aborted && n === K.current && V(!1);
|
|
377
381
|
}
|
|
378
382
|
}
|
|
379
383
|
return r(), () => {
|
|
@@ -381,184 +385,188 @@ function _e({ className: ne, value: o, selectedOptions: ce, onValueChange: d, lo
|
|
|
381
385
|
};
|
|
382
386
|
}, [
|
|
383
387
|
_,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
F,
|
|
388
|
+
be,
|
|
389
|
+
fe,
|
|
387
390
|
N,
|
|
388
|
-
|
|
389
|
-
|
|
391
|
+
j,
|
|
392
|
+
q,
|
|
393
|
+
Z
|
|
390
394
|
]);
|
|
391
|
-
let
|
|
392
|
-
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
},
|
|
396
|
-
e.disabled || (
|
|
397
|
-
},
|
|
398
|
-
e.key !== "Enter" && e.key !== " " && e.key !== "Backspace" && e.key !== "Delete" || (e.preventDefault(), t(e),
|
|
399
|
-
},
|
|
400
|
-
if (!
|
|
395
|
+
let $ = (e, t) => {
|
|
396
|
+
u?.(e, f(e, t));
|
|
397
|
+
}, Ye = (e) => {
|
|
398
|
+
$(A.filter((t) => t !== e), Y);
|
|
399
|
+
}, Xe = (e) => {
|
|
400
|
+
e.disabled || ($(ze.has(e.value) ? A.filter((t) => t !== e.value) : Ue ? A : [...A, e.value], d(Y, [e])), v && (P(!1), I("")));
|
|
401
|
+
}, Ze = (e, n) => {
|
|
402
|
+
e.key !== "Enter" && e.key !== " " && e.key !== "Backspace" && e.key !== "Delete" || (e.preventDefault(), t(e), Ye(n.value));
|
|
403
|
+
}, Qe = (e) => {
|
|
404
|
+
if (!h) {
|
|
401
405
|
if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
|
|
402
|
-
e.preventDefault(),
|
|
406
|
+
e.preventDefault(), P(!0);
|
|
403
407
|
return;
|
|
404
408
|
}
|
|
405
|
-
|
|
409
|
+
F.length > 0 || A.length === 0 || (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), Ye(A[A.length - 1]));
|
|
406
410
|
}
|
|
407
|
-
},
|
|
408
|
-
if (!
|
|
409
|
-
let e = typeof x == "number" ? Math.max(x -
|
|
410
|
-
|
|
411
|
-
},
|
|
412
|
-
|
|
413
|
-
},
|
|
414
|
-
|
|
415
|
-
},
|
|
416
|
-
t(e),
|
|
417
|
-
},
|
|
418
|
-
if (!(!
|
|
419
|
-
|
|
411
|
+
}, $e = () => {
|
|
412
|
+
if (!Q.length) return;
|
|
413
|
+
let e = typeof x == "number" ? Math.max(x - A.length, 0) : Q.length, t = Q.slice(0, e);
|
|
414
|
+
$(Array.from(new Set([...A, ...t.map((e) => e.value)])), d(Y, t));
|
|
415
|
+
}, et = (e) => {
|
|
416
|
+
Ye(e.value);
|
|
417
|
+
}, tt = () => {
|
|
418
|
+
u?.([], []), I("");
|
|
419
|
+
}, nt = (e) => {
|
|
420
|
+
t(e), tt();
|
|
421
|
+
}, rt = async () => {
|
|
422
|
+
if (!(!C || !F.trim() || Z)) {
|
|
423
|
+
Le(!0);
|
|
420
424
|
try {
|
|
421
|
-
let e = await
|
|
422
|
-
|
|
425
|
+
let e = await C(F.trim()), t = he(F), n = d(Y, [e]), r = ze.has(e.value) || Ue ? A : [...A, e.value];
|
|
426
|
+
R((t) => [{ options: [e] }, ...t]), _ && t && me(G.current, t, [{ options: [e] }]), $(r, n), I(""), v && P(!1);
|
|
423
427
|
} finally {
|
|
424
|
-
|
|
428
|
+
Le(!1);
|
|
425
429
|
}
|
|
426
430
|
}
|
|
427
431
|
};
|
|
428
|
-
return /* @__PURE__ */
|
|
432
|
+
return /* @__PURE__ */ c("div", {
|
|
429
433
|
"data-slot": "async-multi-select",
|
|
430
|
-
className: e("w-full",
|
|
431
|
-
...
|
|
432
|
-
children: /* @__PURE__ */
|
|
433
|
-
open:
|
|
434
|
-
onOpenChange:
|
|
435
|
-
children: [/* @__PURE__ */
|
|
436
|
-
render: /* @__PURE__ */
|
|
434
|
+
className: e("w-full", o),
|
|
435
|
+
...k,
|
|
436
|
+
children: /* @__PURE__ */ l(i, {
|
|
437
|
+
open: N,
|
|
438
|
+
onOpenChange: P,
|
|
439
|
+
children: [/* @__PURE__ */ l(te, {
|
|
440
|
+
render: /* @__PURE__ */ c(n, {
|
|
437
441
|
type: "button",
|
|
438
442
|
variant: "outline",
|
|
439
|
-
disabled:
|
|
440
|
-
"aria-expanded":
|
|
441
|
-
"aria-invalid":
|
|
443
|
+
disabled: h,
|
|
444
|
+
"aria-expanded": N,
|
|
445
|
+
"aria-invalid": Pe || void 0,
|
|
442
446
|
"data-slot": "async-select-trigger",
|
|
443
|
-
className: e("min-h-11 w-full justify-between rounded-[var(--aui-control-radius,var(--radius-md))] px-3.5 text-left",
|
|
444
|
-
onKeyDown:
|
|
447
|
+
className: e("min-h-11 w-full justify-between rounded-[var(--aui-control-radius,var(--radius-md))] px-3.5 text-left", Ne),
|
|
448
|
+
onKeyDown: Qe
|
|
445
449
|
}),
|
|
446
|
-
children: [/* @__PURE__ */
|
|
450
|
+
children: [/* @__PURE__ */ c("span", {
|
|
447
451
|
className: "flex min-w-0 flex-1 flex-wrap gap-1 text-left",
|
|
448
|
-
children:
|
|
452
|
+
children: Be.length > 0 ? /* @__PURE__ */ l(s, { children: [qe.map((n) => /* @__PURE__ */ l("span", {
|
|
449
453
|
"data-slot": "async-select-tag",
|
|
450
|
-
className: e("inline-flex max-w-full items-center gap-1.5 rounded-[var(--radius-sm)] border border-[color:color-mix(in_oklch,var(--primary),transparent_70%)] bg-[color:color-mix(in_oklch,var(--primary),transparent_92%)] px-2 py-1 text-xs font-medium text-foreground",
|
|
451
|
-
children: [/* @__PURE__ */
|
|
454
|
+
className: e("inline-flex max-w-full items-center gap-1.5 rounded-[var(--radius-sm)] border border-[color:color-mix(in_oklch,var(--primary),transparent_70%)] bg-[color:color-mix(in_oklch,var(--primary),transparent_92%)] px-2 py-1 text-xs font-medium text-foreground", O),
|
|
455
|
+
children: [/* @__PURE__ */ l("span", {
|
|
452
456
|
className: "flex min-w-0 flex-col",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
457
|
+
children: [/* @__PURE__ */ c("span", {
|
|
454
458
|
className: "truncate",
|
|
455
|
-
children:
|
|
456
|
-
}), n.disabled && n.disabledReason
|
|
459
|
+
children: Te?.(n, { remove: () => et(n) }) ?? we?.(n) ?? n.label
|
|
460
|
+
}), w && (n.description || n.disabled && n.disabledReason) ? /* @__PURE__ */ c("span", {
|
|
457
461
|
className: "truncate text-[11px] text-muted-foreground",
|
|
458
|
-
children: n.disabledReason
|
|
459
|
-
})]
|
|
460
|
-
}), !
|
|
462
|
+
children: n.description ?? n.disabledReason
|
|
463
|
+
}) : null]
|
|
464
|
+
}), !h && /* @__PURE__ */ c("span", {
|
|
461
465
|
role: "button",
|
|
462
466
|
tabIndex: 0,
|
|
463
467
|
"data-slot": "async-select-tag-remove",
|
|
464
468
|
className: "rounded-full p-0.5 text-muted-foreground transition-colors hover:bg-background hover:text-foreground",
|
|
465
|
-
"aria-label": `Remove ${
|
|
469
|
+
"aria-label": `Remove ${ge(n)}`,
|
|
466
470
|
onClick: (e) => {
|
|
467
|
-
t(e),
|
|
471
|
+
t(e), et(n);
|
|
468
472
|
},
|
|
469
|
-
onKeyDown: (e) =>
|
|
470
|
-
children: /* @__PURE__ */
|
|
473
|
+
onKeyDown: (e) => Ze(e, n),
|
|
474
|
+
children: /* @__PURE__ */ c(oe, { className: "size-3" })
|
|
471
475
|
})]
|
|
472
|
-
}, n.value))
|
|
476
|
+
}, n.value)), Je > 0 ? /* @__PURE__ */ c("span", {
|
|
477
|
+
"data-slot": "async-select-tag-overflow",
|
|
478
|
+
className: e("inline-flex max-w-full items-center rounded-[var(--radius-sm)] border border-dashed border-[color:var(--aui-card-border,var(--border))] bg-[color:color-mix(in_oklch,var(--muted),transparent_58%)] px-2 py-1 text-xs font-medium text-muted-foreground", O),
|
|
479
|
+
children: S?.hiddenSelected?.(Je) ?? `+${Je} more`
|
|
480
|
+
}) : null] }) : /* @__PURE__ */ c("span", {
|
|
473
481
|
className: "truncate text-muted-foreground",
|
|
474
|
-
children: S?.placeholder ?? "Select"
|
|
482
|
+
children: S?.multiPlaceholder ?? S?.placeholder ?? "Select"
|
|
475
483
|
})
|
|
476
|
-
}), /* @__PURE__ */
|
|
484
|
+
}), /* @__PURE__ */ l("span", {
|
|
477
485
|
className: "ml-2 flex shrink-0 items-center gap-1",
|
|
478
|
-
children: [
|
|
486
|
+
children: [He && /* @__PURE__ */ c("span", {
|
|
479
487
|
role: "button",
|
|
480
488
|
tabIndex: 0,
|
|
481
489
|
"data-slot": "async-select-clear",
|
|
482
490
|
className: "rounded-full border border-border/65 p-1 text-muted-foreground transition-colors hover:border-border hover:bg-muted/55 hover:text-foreground",
|
|
483
491
|
"aria-label": S?.clearAll ?? S?.clear ?? "Clear all",
|
|
484
|
-
onClick:
|
|
492
|
+
onClick: nt,
|
|
485
493
|
onKeyDown: (e) => {
|
|
486
|
-
e.key !== "Enter" && e.key !== " " || (e.preventDefault(), t(e),
|
|
494
|
+
e.key !== "Enter" && e.key !== " " || (e.preventDefault(), t(e), tt());
|
|
487
495
|
},
|
|
488
|
-
children: /* @__PURE__ */
|
|
489
|
-
}), /* @__PURE__ */
|
|
496
|
+
children: /* @__PURE__ */ c(oe, { className: "size-3.5" })
|
|
497
|
+
}), /* @__PURE__ */ c(ne, { className: "size-4 opacity-60" })]
|
|
490
498
|
})]
|
|
491
|
-
}), /* @__PURE__ */
|
|
499
|
+
}), /* @__PURE__ */ l(ee, {
|
|
492
500
|
align: "start",
|
|
493
501
|
"data-slot": "async-select-content",
|
|
494
|
-
className: e("w-(--anchor-width) min-w-72 gap-3 rounded-[var(--aui-card-radius,var(--radius-lg))] border-[color:var(--aui-card-border,var(--border))] bg-popover p-3 shadow-[var(--aui-control-panel-shadow,0_18px_40px_rgba(15,23,42,0.14))]",
|
|
502
|
+
className: e("w-(--anchor-width) min-w-72 gap-3 rounded-[var(--aui-card-radius,var(--radius-lg))] border-[color:var(--aui-card-border,var(--border))] bg-popover p-3 shadow-[var(--aui-control-panel-shadow,0_18px_40px_rgba(15,23,42,0.14))]", T),
|
|
495
503
|
children: [
|
|
496
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ l("div", {
|
|
497
505
|
"data-slot": "async-select-search-wrap",
|
|
498
506
|
className: "relative",
|
|
499
|
-
children: [/* @__PURE__ */
|
|
507
|
+
children: [/* @__PURE__ */ c(ae, { className: "pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ c(r, {
|
|
500
508
|
"data-slot": "async-select-search",
|
|
501
|
-
value:
|
|
502
|
-
onChange: (e) =>
|
|
509
|
+
value: F,
|
|
510
|
+
onChange: (e) => I(e.target.value),
|
|
503
511
|
placeholder: S?.searchPlaceholder ?? "Search...",
|
|
504
|
-
className: e("pl-8",
|
|
512
|
+
className: e("pl-8", E)
|
|
505
513
|
})]
|
|
506
514
|
}),
|
|
507
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ l("div", {
|
|
508
516
|
"data-slot": "async-select-meta",
|
|
509
517
|
className: "flex flex-wrap items-center justify-between gap-2 rounded-[var(--radius-md)] border border-[color:var(--aui-card-border,var(--border))] bg-[color:color-mix(in_oklch,var(--muted),transparent_62%)] px-3 py-2 text-xs text-muted-foreground",
|
|
510
518
|
children: [
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
/* @__PURE__ */
|
|
519
|
+
Ve && S?.selectedCount && /* @__PURE__ */ c("span", { children: S.selectedCount(A.length) }),
|
|
520
|
+
Ue && (Ae?.(X) ?? /* @__PURE__ */ c("span", { children: S?.maxSelected?.(x ?? A.length) ?? `Maximum ${x} selected` })),
|
|
521
|
+
/* @__PURE__ */ l("div", {
|
|
514
522
|
className: "ml-auto flex items-center gap-2",
|
|
515
|
-
children: [
|
|
523
|
+
children: [Ke && /* @__PURE__ */ c("button", {
|
|
516
524
|
type: "button",
|
|
517
525
|
"data-slot": "async-select-meta-action",
|
|
518
526
|
className: "rounded-[var(--radius-sm)] border border-border/75 px-2.5 py-1 font-medium text-foreground transition-colors hover:bg-background",
|
|
519
|
-
onClick:
|
|
527
|
+
onClick: $e,
|
|
520
528
|
children: S?.selectAll ?? "Select all"
|
|
521
|
-
}),
|
|
529
|
+
}), He && /* @__PURE__ */ c("button", {
|
|
522
530
|
type: "button",
|
|
523
531
|
"data-slot": "async-select-meta-action",
|
|
524
532
|
className: "rounded-[var(--radius-sm)] border border-border/75 px-2.5 py-1 font-medium text-foreground transition-colors hover:bg-background",
|
|
525
|
-
onClick: () =>
|
|
533
|
+
onClick: () => u?.([], []),
|
|
526
534
|
children: S?.clearAll ?? S?.clear ?? "Clear all"
|
|
527
535
|
})]
|
|
528
536
|
})
|
|
529
537
|
]
|
|
530
538
|
}),
|
|
531
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ l("div", {
|
|
532
540
|
className: "max-h-72 space-y-1 overflow-y-auto pr-1",
|
|
533
541
|
children: [
|
|
534
|
-
|
|
535
|
-
|
|
542
|
+
Z && J.length === 0 && (ke?.(X) ?? /* @__PURE__ */ c(p, { children: S?.minSearchLength?.(b) ?? `Type at least ${b} characters` })),
|
|
543
|
+
B && (Ee?.(X) ?? /* @__PURE__ */ c(p, { children: /* @__PURE__ */ l("span", {
|
|
536
544
|
className: "inline-flex items-center gap-2",
|
|
537
|
-
children: [/* @__PURE__ */
|
|
545
|
+
children: [/* @__PURE__ */ c(re, { className: "size-4 animate-spin" }), S?.loading ?? "Loading..."]
|
|
538
546
|
}) })),
|
|
539
|
-
!
|
|
547
|
+
!B && U && (Oe?.(X) ?? /* @__PURE__ */ c(p, {
|
|
540
548
|
className: "text-destructive",
|
|
541
549
|
children: S?.error ?? "Could not load options"
|
|
542
550
|
})),
|
|
543
|
-
!
|
|
544
|
-
!
|
|
545
|
-
search:
|
|
546
|
-
isCreating:
|
|
547
|
-
label:
|
|
548
|
-
onCreate:
|
|
551
|
+
!B && !U && !Z && J.length === 0 && !Ge && (De?.(X) ?? /* @__PURE__ */ c(p, { children: S?.empty ?? "No options found" })),
|
|
552
|
+
!B && !U && Ge && /* @__PURE__ */ c(ve, {
|
|
553
|
+
search: F,
|
|
554
|
+
isCreating: H,
|
|
555
|
+
label: je,
|
|
556
|
+
onCreate: rt
|
|
549
557
|
}),
|
|
550
|
-
!
|
|
558
|
+
!B && !U && L.map((e, t) => /* @__PURE__ */ l("div", { children: [e.label && /* @__PURE__ */ c("div", {
|
|
551
559
|
className: "sticky top-0 z-10 bg-popover px-2 py-1 text-xs font-medium text-muted-foreground",
|
|
552
|
-
children: /* @__PURE__ */
|
|
560
|
+
children: /* @__PURE__ */ c("span", {
|
|
553
561
|
"data-slot": "async-select-group-label",
|
|
554
562
|
children: e.label
|
|
555
563
|
})
|
|
556
|
-
}), e.options.map((e) => /* @__PURE__ */
|
|
564
|
+
}), e.options.map((e) => /* @__PURE__ */ c(_e, {
|
|
557
565
|
option: e,
|
|
558
|
-
selected:
|
|
559
|
-
renderOption:
|
|
560
|
-
optionClassName:
|
|
561
|
-
onSelect:
|
|
566
|
+
selected: ze.has(e.value),
|
|
567
|
+
renderOption: Ce,
|
|
568
|
+
optionClassName: D,
|
|
569
|
+
onSelect: Xe
|
|
562
570
|
}, e.value))] }, t))
|
|
563
571
|
]
|
|
564
572
|
})
|
|
@@ -568,4 +576,4 @@ function _e({ className: ne, value: o, selectedOptions: ce, onValueChange: d, lo
|
|
|
568
576
|
});
|
|
569
577
|
}
|
|
570
578
|
//#endregion
|
|
571
|
-
export {
|
|
579
|
+
export { ye as AsyncMultiSelect, m as AsyncSelect };
|