@bevelo/svelte 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/accordion.svelte +98 -0
- package/dist/accordion.svelte.d.ts +29 -0
- package/dist/agent.d.ts +2 -0
- package/dist/agent.js +5 -0
- package/dist/alert-dialog.svelte +17 -0
- package/dist/alert-dialog.svelte.d.ts +7 -0
- package/dist/alert.svelte +78 -0
- package/dist/alert.svelte.d.ts +16 -0
- package/dist/aspect-ratio.svelte +43 -0
- package/dist/aspect-ratio.svelte.d.ts +12 -0
- package/dist/async-options.svelte.d.ts +42 -0
- package/dist/async-options.svelte.js +94 -0
- package/dist/autocomplete.svelte +332 -0
- package/dist/autocomplete.svelte.d.ts +81 -0
- package/dist/avatar.svelte +39 -0
- package/dist/avatar.svelte.d.ts +12 -0
- package/dist/badge.svelte +37 -0
- package/dist/badge.svelte.d.ts +12 -0
- package/dist/bound.svelte.d.ts +15 -0
- package/dist/bound.svelte.js +56 -0
- package/dist/breadcrumb.svelte +90 -0
- package/dist/breadcrumb.svelte.d.ts +22 -0
- package/dist/button.svelte +45 -0
- package/dist/button.svelte.d.ts +12 -0
- package/dist/calendar.svelte +463 -0
- package/dist/calendar.svelte.d.ts +74 -0
- package/dist/card.svelte +69 -0
- package/dist/card.svelte.d.ts +16 -0
- package/dist/carousel.svelte +262 -0
- package/dist/carousel.svelte.d.ts +45 -0
- package/dist/checkbox-group-scope.d.ts +11 -0
- package/dist/checkbox-group-scope.js +5 -0
- package/dist/checkbox-group.svelte +93 -0
- package/dist/checkbox-group.svelte.d.ts +18 -0
- package/dist/checkbox.svelte +89 -0
- package/dist/checkbox.svelte.d.ts +16 -0
- package/dist/collapsible.svelte +73 -0
- package/dist/collapsible.svelte.d.ts +25 -0
- package/dist/color-picker-alpha-thumb.svelte +11 -0
- package/dist/color-picker-alpha-thumb.svelte.d.ts +4 -0
- package/dist/color-picker-area-canvas.svelte +11 -0
- package/dist/color-picker-area-canvas.svelte.d.ts +4 -0
- package/dist/color-picker-area-thumb.svelte +11 -0
- package/dist/color-picker-area-thumb.svelte.d.ts +4 -0
- package/dist/color-picker-area.svelte +11 -0
- package/dist/color-picker-area.svelte.d.ts +4 -0
- package/dist/color-picker-channel-input.svelte +35 -0
- package/dist/color-picker-channel-input.svelte.d.ts +9 -0
- package/dist/color-picker-context.d.ts +23 -0
- package/dist/color-picker-context.js +24 -0
- package/dist/color-picker-eye-dropper.svelte +11 -0
- package/dist/color-picker-eye-dropper.svelte.d.ts +4 -0
- package/dist/color-picker-input.svelte +11 -0
- package/dist/color-picker-input.svelte.d.ts +4 -0
- package/dist/color-picker-part.svelte +38 -0
- package/dist/color-picker-part.svelte.d.ts +11 -0
- package/dist/color-picker-slider-thumb.svelte +11 -0
- package/dist/color-picker-slider-thumb.svelte.d.ts +4 -0
- package/dist/color-picker-slider.svelte +21 -0
- package/dist/color-picker-slider.svelte.d.ts +9 -0
- package/dist/color-picker-swatch-item.svelte +38 -0
- package/dist/color-picker-swatch-item.svelte.d.ts +9 -0
- package/dist/color-picker-swatch.svelte +11 -0
- package/dist/color-picker-swatch.svelte.d.ts +4 -0
- package/dist/color-picker-swatches.svelte +11 -0
- package/dist/color-picker-swatches.svelte.d.ts +4 -0
- package/dist/color-picker.svelte +132 -0
- package/dist/color-picker.svelte.d.ts +18 -0
- package/dist/combobox-chip-remove.svelte +25 -0
- package/dist/combobox-chip-remove.svelte.d.ts +4 -0
- package/dist/combobox-chip.svelte +14 -0
- package/dist/combobox-chip.svelte.d.ts +7 -0
- package/dist/combobox-chips-overflow.svelte +27 -0
- package/dist/combobox-chips-overflow.svelte.d.ts +12 -0
- package/dist/combobox-chips.svelte +12 -0
- package/dist/combobox-chips.svelte.d.ts +4 -0
- package/dist/combobox-clear.svelte +27 -0
- package/dist/combobox-clear.svelte.d.ts +4 -0
- package/dist/combobox-compound-root.svelte +150 -0
- package/dist/combobox-compound-root.svelte.d.ts +37 -0
- package/dist/combobox-compound.svelte.d.ts +59 -0
- package/dist/combobox-compound.svelte.js +21 -0
- package/dist/combobox-content.svelte +21 -0
- package/dist/combobox-content.svelte.d.ts +7 -0
- package/dist/combobox-create.svelte +63 -0
- package/dist/combobox-create.svelte.d.ts +11 -0
- package/dist/combobox-empty.svelte +22 -0
- package/dist/combobox-empty.svelte.d.ts +9 -0
- package/dist/combobox-group-label.svelte +14 -0
- package/dist/combobox-group-label.svelte.d.ts +4 -0
- package/dist/combobox-group.svelte +16 -0
- package/dist/combobox-group.svelte.d.ts +4 -0
- package/dist/combobox-input.svelte +44 -0
- package/dist/combobox-input.svelte.d.ts +4 -0
- package/dist/combobox-item-icon.svelte +12 -0
- package/dist/combobox-item-icon.svelte.d.ts +7 -0
- package/dist/combobox-item-indicator.svelte +24 -0
- package/dist/combobox-item-indicator.svelte.d.ts +7 -0
- package/dist/combobox-item-text.svelte +31 -0
- package/dist/combobox-item-text.svelte.d.ts +11 -0
- package/dist/combobox-item.svelte +87 -0
- package/dist/combobox-item.svelte.d.ts +14 -0
- package/dist/combobox-label.svelte +14 -0
- package/dist/combobox-label.svelte.d.ts +4 -0
- package/dist/combobox-list.svelte +36 -0
- package/dist/combobox-list.svelte.d.ts +12 -0
- package/dist/combobox-options.svelte +194 -0
- package/dist/combobox-options.svelte.d.ts +63 -0
- package/dist/combobox-select-all.svelte +36 -0
- package/dist/combobox-select-all.svelte.d.ts +11 -0
- package/dist/combobox-separator.svelte +12 -0
- package/dist/combobox-separator.svelte.d.ts +4 -0
- package/dist/combobox-status.svelte +20 -0
- package/dist/combobox-status.svelte.d.ts +9 -0
- package/dist/combobox-trigger.svelte +36 -0
- package/dist/combobox-trigger.svelte.d.ts +11 -0
- package/dist/combobox-value-icon.svelte +12 -0
- package/dist/combobox-value-icon.svelte.d.ts +4 -0
- package/dist/combobox-value.svelte +40 -0
- package/dist/combobox-value.svelte.d.ts +12 -0
- package/dist/combobox.svelte +59 -0
- package/dist/combobox.svelte.d.ts +37 -0
- package/dist/command-empty.svelte +29 -0
- package/dist/command-empty.svelte.d.ts +15 -0
- package/dist/command-group-label.svelte +16 -0
- package/dist/command-group-label.svelte.d.ts +9 -0
- package/dist/command-group.svelte +31 -0
- package/dist/command-group.svelte.d.ts +11 -0
- package/dist/command-inline.svelte +45 -0
- package/dist/command-inline.svelte.d.ts +14 -0
- package/dist/command-input.svelte +27 -0
- package/dist/command-input.svelte.d.ts +6 -0
- package/dist/command-item-icon.svelte +18 -0
- package/dist/command-item-icon.svelte.d.ts +11 -0
- package/dist/command-item-text.svelte +24 -0
- package/dist/command-item-text.svelte.d.ts +12 -0
- package/dist/command-item.svelte +110 -0
- package/dist/command-item.svelte.d.ts +22 -0
- package/dist/command-list.svelte +28 -0
- package/dist/command-list.svelte.d.ts +15 -0
- package/dist/command-page.svelte +24 -0
- package/dist/command-page.svelte.d.ts +13 -0
- package/dist/command-scope.svelte.d.ts +93 -0
- package/dist/command-scope.svelte.js +155 -0
- package/dist/command-separator.svelte +13 -0
- package/dist/command-separator.svelte.d.ts +6 -0
- package/dist/command-shortcut.svelte +20 -0
- package/dist/command-shortcut.svelte.d.ts +11 -0
- package/dist/command-status.svelte +21 -0
- package/dist/command-status.svelte.d.ts +10 -0
- package/dist/command.svelte +219 -0
- package/dist/command.svelte.d.ts +54 -0
- package/dist/context-menu.svelte +107 -0
- package/dist/context-menu.svelte.d.ts +15 -0
- package/dist/date-input-segment.svelte +50 -0
- package/dist/date-input-segment.svelte.d.ts +12 -0
- package/dist/date-input.svelte +245 -0
- package/dist/date-input.svelte.d.ts +37 -0
- package/dist/date-picker.svelte +533 -0
- package/dist/date-picker.svelte.d.ts +85 -0
- package/dist/date-segments-context.d.ts +7 -0
- package/dist/date-segments-context.js +7 -0
- package/dist/describe.svelte +41 -0
- package/dist/describe.svelte.d.ts +8 -0
- package/dist/dialog.svelte +91 -0
- package/dist/dialog.svelte.d.ts +17 -0
- package/dist/direction.svelte +43 -0
- package/dist/direction.svelte.d.ts +12 -0
- package/dist/dnd.svelte.d.ts +60 -0
- package/dist/dnd.svelte.js +101 -0
- package/dist/drawer.svelte +87 -0
- package/dist/drawer.svelte.d.ts +17 -0
- package/dist/empty-state.svelte +83 -0
- package/dist/empty-state.svelte.d.ts +16 -0
- package/dist/engine-state.svelte.d.ts +12 -0
- package/dist/engine-state.svelte.js +28 -0
- package/dist/error-state.svelte +93 -0
- package/dist/error-state.svelte.d.ts +16 -0
- package/dist/field-api.d.ts +6 -0
- package/dist/field-api.js +16 -0
- package/dist/field.svelte +143 -0
- package/dist/field.svelte.d.ts +37 -0
- package/dist/file-input.svelte +102 -0
- package/dist/file-input.svelte.d.ts +28 -0
- package/dist/gauge-context.d.ts +26 -0
- package/dist/gauge-context.js +41 -0
- package/dist/gauge-indicator.svelte +25 -0
- package/dist/gauge-indicator.svelte.d.ts +10 -0
- package/dist/gauge-label.svelte +16 -0
- package/dist/gauge-label.svelte.d.ts +8 -0
- package/dist/gauge-track.svelte +14 -0
- package/dist/gauge-track.svelte.d.ts +8 -0
- package/dist/gauge-value.svelte +14 -0
- package/dist/gauge-value.svelte.d.ts +9 -0
- package/dist/headless.svelte.d.ts +63 -0
- package/dist/headless.svelte.js +314 -0
- package/dist/hidden-input.svelte +42 -0
- package/dist/hidden-input.svelte.d.ts +12 -0
- package/dist/hover-card.svelte +69 -0
- package/dist/hover-card.svelte.d.ts +17 -0
- package/dist/icon-button.svelte +83 -0
- package/dist/icon-button.svelte.d.ts +12 -0
- package/dist/icon.svelte +41 -0
- package/dist/icon.svelte.d.ts +16 -0
- package/dist/image-cropper.svelte +78 -0
- package/dist/image-cropper.svelte.d.ts +8 -0
- package/dist/image.svelte +51 -0
- package/dist/image.svelte.d.ts +12 -0
- package/dist/index.d.ts +198 -0
- package/dist/index.js +187 -0
- package/dist/input-group.svelte +100 -0
- package/dist/input-group.svelte.d.ts +14 -0
- package/dist/input.svelte +63 -0
- package/dist/input.svelte.d.ts +17 -0
- package/dist/item.svelte +147 -0
- package/dist/item.svelte.d.ts +29 -0
- package/dist/kbd.svelte +41 -0
- package/dist/kbd.svelte.d.ts +12 -0
- package/dist/label.svelte +40 -0
- package/dist/label.svelte.d.ts +14 -0
- package/dist/listbox.svelte +135 -0
- package/dist/listbox.svelte.d.ts +38 -0
- package/dist/loader.svelte +38 -0
- package/dist/loader.svelte.d.ts +8 -0
- package/dist/mention-menu.svelte +134 -0
- package/dist/mention-menu.svelte.d.ts +23 -0
- package/dist/menu.svelte +185 -0
- package/dist/menu.svelte.d.ts +34 -0
- package/dist/menubar.svelte +75 -0
- package/dist/menubar.svelte.d.ts +21 -0
- package/dist/meter.svelte +83 -0
- package/dist/meter.svelte.d.ts +21 -0
- package/dist/native-select.svelte +87 -0
- package/dist/native-select.svelte.d.ts +16 -0
- package/dist/navigation-menu.svelte +155 -0
- package/dist/navigation-menu.svelte.d.ts +28 -0
- package/dist/number-input-scrub-area.svelte +55 -0
- package/dist/number-input-scrub-area.svelte.d.ts +18 -0
- package/dist/number-input-scrub.d.ts +6 -0
- package/dist/number-input-scrub.js +4 -0
- package/dist/number-input.svelte +86 -0
- package/dist/number-input.svelte.d.ts +26 -0
- package/dist/otp-input.svelte +96 -0
- package/dist/otp-input.svelte.d.ts +14 -0
- package/dist/overlay.svelte.d.ts +29 -0
- package/dist/overlay.svelte.js +46 -0
- package/dist/pagination.svelte +129 -0
- package/dist/pagination.svelte.d.ts +33 -0
- package/dist/parts-part.svelte +62 -0
- package/dist/parts-part.svelte.d.ts +14 -0
- package/dist/parts-root.svelte +74 -0
- package/dist/parts-root.svelte.d.ts +12 -0
- package/dist/password-input.svelte +129 -0
- package/dist/password-input.svelte.d.ts +49 -0
- package/dist/popover.svelte +85 -0
- package/dist/popover.svelte.d.ts +19 -0
- package/dist/preferences/preferences.svelte +96 -0
- package/dist/preferences/preferences.svelte.d.ts +21 -0
- package/dist/preferences.d.ts +2 -0
- package/dist/preferences.js +2 -0
- package/dist/preferences.svelte.d.ts +11 -0
- package/dist/preferences.svelte.js +26 -0
- package/dist/presence.svelte.d.ts +25 -0
- package/dist/presence.svelte.js +57 -0
- package/dist/progress.svelte +88 -0
- package/dist/progress.svelte.d.ts +21 -0
- package/dist/props.d.ts +8 -0
- package/dist/props.js +7 -0
- package/dist/query.svelte.d.ts +65 -0
- package/dist/query.svelte.js +219 -0
- package/dist/radio.svelte +79 -0
- package/dist/radio.svelte.d.ts +21 -0
- package/dist/rating.svelte +86 -0
- package/dist/rating.svelte.d.ts +28 -0
- package/dist/resizable.svelte +69 -0
- package/dist/resizable.svelte.d.ts +21 -0
- package/dist/scroll-area.svelte +66 -0
- package/dist/scroll-area.svelte.d.ts +18 -0
- package/dist/segmented-control.svelte +83 -0
- package/dist/segmented-control.svelte.d.ts +27 -0
- package/dist/select.svelte +285 -0
- package/dist/select.svelte.d.ts +77 -0
- package/dist/separator.svelte +26 -0
- package/dist/separator.svelte.d.ts +8 -0
- package/dist/sheet.svelte +105 -0
- package/dist/sheet.svelte.d.ts +19 -0
- package/dist/sidebar.svelte +66 -0
- package/dist/sidebar.svelte.d.ts +16 -0
- package/dist/skeleton.svelte +29 -0
- package/dist/skeleton.svelte.d.ts +8 -0
- package/dist/slider.svelte +78 -0
- package/dist/slider.svelte.d.ts +17 -0
- package/dist/sortable-board-strict.svelte +76 -0
- package/dist/sortable-board-strict.svelte.d.ts +12 -0
- package/dist/sortable-engine.svelte +129 -0
- package/dist/sortable-engine.svelte.d.ts +30 -0
- package/dist/sortable.svelte +86 -0
- package/dist/sortable.svelte.d.ts +27 -0
- package/dist/spinner.svelte +27 -0
- package/dist/spinner.svelte.d.ts +8 -0
- package/dist/steps.svelte +95 -0
- package/dist/steps.svelte.d.ts +23 -0
- package/dist/switch.svelte +74 -0
- package/dist/switch.svelte.d.ts +19 -0
- package/dist/table.svelte +151 -0
- package/dist/table.svelte.d.ts +23 -0
- package/dist/tabs.svelte +97 -0
- package/dist/tabs.svelte.d.ts +23 -0
- package/dist/textarea.svelte +65 -0
- package/dist/textarea.svelte.d.ts +17 -0
- package/dist/time-input.svelte +128 -0
- package/dist/time-input.svelte.d.ts +28 -0
- package/dist/timeline.svelte +88 -0
- package/dist/timeline.svelte.d.ts +25 -0
- package/dist/toast.svelte +190 -0
- package/dist/toast.svelte.d.ts +37 -0
- package/dist/toaster.d.ts +2 -0
- package/dist/toaster.js +6 -0
- package/dist/toggle-group.svelte +76 -0
- package/dist/toggle-group.svelte.d.ts +19 -0
- package/dist/toggle.svelte +50 -0
- package/dist/toggle.svelte.d.ts +14 -0
- package/dist/token-input-editor.svelte +42 -0
- package/dist/token-input-editor.svelte.d.ts +4 -0
- package/dist/token-input-segments-root.svelte +120 -0
- package/dist/token-input-segments-root.svelte.d.ts +33 -0
- package/dist/token-input-token-remove.svelte +32 -0
- package/dist/token-input-token-remove.svelte.d.ts +4 -0
- package/dist/token-input-token-scope.svelte +15 -0
- package/dist/token-input-token-scope.svelte.d.ts +9 -0
- package/dist/token-input-token.svelte +22 -0
- package/dist/token-input-token.svelte.d.ts +4 -0
- package/dist/token-input.svelte +157 -0
- package/dist/token-input.svelte.d.ts +66 -0
- package/dist/token-segments-scope.svelte.d.ts +17 -0
- package/dist/token-segments-scope.svelte.js +11 -0
- package/dist/toolbar-item.svelte +31 -0
- package/dist/toolbar-item.svelte.d.ts +14 -0
- package/dist/toolbar.svelte +74 -0
- package/dist/toolbar.svelte.d.ts +19 -0
- package/dist/tooltip.svelte +84 -0
- package/dist/tooltip.svelte.d.ts +18 -0
- package/dist/tree-grid.svelte +159 -0
- package/dist/tree-grid.svelte.d.ts +34 -0
- package/dist/tree.svelte +229 -0
- package/dist/tree.svelte.d.ts +65 -0
- package/dist/trigger-menu-content.svelte +24 -0
- package/dist/trigger-menu-content.svelte.d.ts +11 -0
- package/dist/trigger-menu-editor.svelte +32 -0
- package/dist/trigger-menu-editor.svelte.d.ts +13 -0
- package/dist/trigger-menu-empty.svelte +29 -0
- package/dist/trigger-menu-empty.svelte.d.ts +15 -0
- package/dist/trigger-menu-group-label.svelte +16 -0
- package/dist/trigger-menu-group-label.svelte.d.ts +9 -0
- package/dist/trigger-menu-group.svelte +16 -0
- package/dist/trigger-menu-group.svelte.d.ts +9 -0
- package/dist/trigger-menu-hint.svelte +16 -0
- package/dist/trigger-menu-hint.svelte.d.ts +9 -0
- package/dist/trigger-menu-inline.svelte.d.ts +59 -0
- package/dist/trigger-menu-inline.svelte.js +72 -0
- package/dist/trigger-menu-input.svelte +24 -0
- package/dist/trigger-menu-input.svelte.d.ts +6 -0
- package/dist/trigger-menu-item-icon.svelte +18 -0
- package/dist/trigger-menu-item-icon.svelte.d.ts +11 -0
- package/dist/trigger-menu-item.svelte +40 -0
- package/dist/trigger-menu-item.svelte.d.ts +19 -0
- package/dist/trigger-menu-list.svelte +20 -0
- package/dist/trigger-menu-list.svelte.d.ts +12 -0
- package/dist/trigger-menu-separator.svelte +13 -0
- package/dist/trigger-menu-separator.svelte.d.ts +6 -0
- package/dist/trigger-menu-status.svelte +21 -0
- package/dist/trigger-menu-status.svelte.d.ts +10 -0
- package/dist/trigger-menu.svelte +150 -0
- package/dist/trigger-menu.svelte.d.ts +30 -0
- package/dist/virtual-list-strict.svelte +83 -0
- package/dist/virtual-list-strict.svelte.d.ts +23 -0
- package/dist/virtual-list.svelte +86 -0
- package/dist/virtual-list.svelte.d.ts +28 -0
- package/dist/virtual.svelte.d.ts +24 -0
- package/dist/virtual.svelte.js +48 -0
- package/dist/waterfall-axis.svelte +25 -0
- package/dist/waterfall-axis.svelte.d.ts +14 -0
- package/dist/waterfall-bar.svelte +23 -0
- package/dist/waterfall-bar.svelte.d.ts +7 -0
- package/dist/waterfall-cell.svelte +13 -0
- package/dist/waterfall-cell.svelte.d.ts +7 -0
- package/dist/waterfall-chart.svelte +134 -0
- package/dist/waterfall-chart.svelte.d.ts +27 -0
- package/dist/waterfall-column-header.svelte +13 -0
- package/dist/waterfall-column-header.svelte.d.ts +7 -0
- package/dist/waterfall-header-row.svelte +13 -0
- package/dist/waterfall-header-row.svelte.d.ts +7 -0
- package/dist/waterfall-indicator.svelte +32 -0
- package/dist/waterfall-indicator.svelte.d.ts +7 -0
- package/dist/waterfall-mark.svelte +26 -0
- package/dist/waterfall-mark.svelte.d.ts +9 -0
- package/dist/waterfall-row-header.svelte +13 -0
- package/dist/waterfall-row-header.svelte.d.ts +7 -0
- package/dist/waterfall-row.svelte +39 -0
- package/dist/waterfall-row.svelte.d.ts +9 -0
- package/dist/waterfall-tick.svelte +25 -0
- package/dist/waterfall-tick.svelte.d.ts +9 -0
- package/dist/waterfall-trace.d.ts +17 -0
- package/dist/waterfall-trace.js +10 -0
- package/dist/waterfall.svelte +177 -0
- package/dist/waterfall.svelte.d.ts +48 -0
- package/package.json +447 -3
- package/README.md +0 -3
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { ListboxOption, PopupPlacementProps, PrimitiveComboboxOptions } from "@bevelo/core";
|
|
3
|
+
import type { PrimitiveProps } from "./props.js";
|
|
4
|
+
/** One option row's state, as the `item` snippet receives it. */
|
|
5
|
+
export interface ComboboxOptionState {
|
|
6
|
+
readonly index: number;
|
|
7
|
+
readonly value: string;
|
|
8
|
+
readonly label: string;
|
|
9
|
+
readonly disabled: boolean;
|
|
10
|
+
readonly selected: boolean;
|
|
11
|
+
readonly active: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Props for `Combobox`. `value`, `open` and `inputValue` are bindable. */
|
|
14
|
+
export interface ComboboxProps extends PrimitiveProps<PrimitiveComboboxOptions, Omit<PopupPlacementProps, "alignOffset"> & {
|
|
15
|
+
/** Renders an option's content in place of its label text. */
|
|
16
|
+
item?: Snippet<[ListboxOption, ComboboxOptionState]> | undefined;
|
|
17
|
+
/** The selected row's mark inside the indicator part. */
|
|
18
|
+
checkmark?: string | Snippet | undefined;
|
|
19
|
+
/** The trigger button's content. */
|
|
20
|
+
chevron?: string | Snippet | undefined;
|
|
21
|
+
/** The clear button's content. */
|
|
22
|
+
clearIcon?: string | Snippet | undefined;
|
|
23
|
+
/** Text shown when no option matches. */
|
|
24
|
+
emptyText?: string | Snippet | undefined;
|
|
25
|
+
/** The create row's text for the typed value. */
|
|
26
|
+
createLabel?: ((text: string) => string) | undefined;
|
|
27
|
+
/** The element the panel portals into instead of the layer root. */
|
|
28
|
+
container?: HTMLElement | undefined;
|
|
29
|
+
}, HTMLDivElement> {
|
|
30
|
+
}
|
|
31
|
+
declare const ComboboxOptions: import("svelte").Component<ComboboxProps, {
|
|
32
|
+
controller: () => {
|
|
33
|
+
focus: () => void | undefined;
|
|
34
|
+
setValue: (next: string | readonly string[] | null) => void;
|
|
35
|
+
getValue: () => string | undefined;
|
|
36
|
+
setQuery: (query: string) => void;
|
|
37
|
+
value(): string | undefined;
|
|
38
|
+
inputValue(): string;
|
|
39
|
+
isOpen(): boolean;
|
|
40
|
+
open(event?: unknown): void;
|
|
41
|
+
close(reason?: import("@bevelo/core").PrimitiveComboboxReason, event?: unknown): void;
|
|
42
|
+
dismiss(reason?: import("@bevelo/core").PrimitiveComboboxReason, event?: unknown): void;
|
|
43
|
+
toggle(event?: unknown): void;
|
|
44
|
+
clear(event?: unknown): void;
|
|
45
|
+
choose(value: string, event?: unknown): void;
|
|
46
|
+
chooseActive(event?: unknown): void;
|
|
47
|
+
createValue(event?: unknown): void;
|
|
48
|
+
moveActive(step: import("@bevelo/core").ListStep): void;
|
|
49
|
+
typeText(text: string, event?: unknown): void;
|
|
50
|
+
displayedText(): string;
|
|
51
|
+
visible(): import("@bevelo/core").IndexedOption[];
|
|
52
|
+
sections(): import("@bevelo/core").OptionSection[];
|
|
53
|
+
nav(): import("@bevelo/core").IndexedOption[];
|
|
54
|
+
activeValue(): string | undefined;
|
|
55
|
+
activeEntry(): import("@bevelo/core").IndexedOption | undefined;
|
|
56
|
+
createText(): string;
|
|
57
|
+
instanceId(): string;
|
|
58
|
+
listboxId(): string;
|
|
59
|
+
optionId(index: number): string;
|
|
60
|
+
};
|
|
61
|
+
}, "value" | "open" | "inputValue">;
|
|
62
|
+
type ComboboxOptions = ReturnType<typeof ComboboxOptions>;
|
|
63
|
+
export default ComboboxOptions;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// @stable — follows semver.
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
// Selects every enabled row, or clears them once all are chosen; the snippet
|
|
7
|
+
// receives `{ checked, indeterminate }`.
|
|
8
|
+
import type { Snippet } from "svelte";
|
|
9
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
10
|
+
import { chain, getComboboxScope } from "./combobox-compound.svelte.js";
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
children,
|
|
14
|
+
...rest
|
|
15
|
+
}: Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
16
|
+
children?: Snippet<[{ readonly checked: boolean; readonly indeterminate: boolean }]> | undefined;
|
|
17
|
+
} = $props();
|
|
18
|
+
const scope = getComboboxScope();
|
|
19
|
+
const view = $derived.by(() => {
|
|
20
|
+
scope?.track();
|
|
21
|
+
return scope?.compound.selectAllState() ?? { checked: false, indeterminate: false };
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<div
|
|
26
|
+
role="option"
|
|
27
|
+
data-part="select-all"
|
|
28
|
+
aria-selected={view.checked ? "true" : "false"}
|
|
29
|
+
data-indeterminate={view.indeterminate ? "" : undefined}
|
|
30
|
+
{...rest}
|
|
31
|
+
onmousedown={(event) => event.preventDefault()}
|
|
32
|
+
onclick={(event) => {
|
|
33
|
+
scope?.compound.selectAll();
|
|
34
|
+
chain(rest.onclick, event);
|
|
35
|
+
}}
|
|
36
|
+
>{#if children}{@render children(view)}{:else}Select all{/if}</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
4
|
+
children?: Snippet<[{
|
|
5
|
+
readonly checked: boolean;
|
|
6
|
+
readonly indeterminate: boolean;
|
|
7
|
+
}]> | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const ComboboxSelectAll: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type ComboboxSelectAll = ReturnType<typeof ComboboxSelectAll>;
|
|
11
|
+
export default ComboboxSelectAll;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// @stable — follows semver.
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
// A rule between groups.
|
|
7
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
8
|
+
|
|
9
|
+
let { ...rest }: HTMLAttributes<HTMLDivElement> = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div role="separator" data-part="separator" {...rest}></div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// @stable — follows semver.
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
// A polite live region; the snippet receives the match count and the loading view.
|
|
7
|
+
import type { Snippet } from "svelte";
|
|
8
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
9
|
+
import { getComboboxScope, statusState } from "./combobox-compound.svelte.js";
|
|
10
|
+
import type { ComboboxStatusState } from "./combobox-compound.svelte.js";
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
children,
|
|
14
|
+
...rest
|
|
15
|
+
}: Omit<HTMLAttributes<HTMLDivElement>, "children"> & { children?: Snippet<[ComboboxStatusState]> | undefined } = $props();
|
|
16
|
+
const scope = getComboboxScope();
|
|
17
|
+
const view = $derived(statusState(scope));
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<div role="status" aria-live="polite" data-part="status" {...rest}>{@render children?.(view)}</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { ComboboxStatusState } from "./combobox-compound.svelte.js";
|
|
4
|
+
type $$ComponentProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
5
|
+
children?: Snippet<[ComboboxStatusState]> | undefined;
|
|
6
|
+
};
|
|
7
|
+
declare const ComboboxStatus: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type ComboboxStatus = ReturnType<typeof ComboboxStatus>;
|
|
9
|
+
export default ComboboxStatus;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// @stable — follows semver.
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
// A button that opens and closes the panel; the snippet receives `{ open, disabled }`.
|
|
7
|
+
import type { Snippet } from "svelte";
|
|
8
|
+
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
9
|
+
import { chain, getComboboxScope } from "./combobox-compound.svelte.js";
|
|
10
|
+
|
|
11
|
+
let {
|
|
12
|
+
children,
|
|
13
|
+
...rest
|
|
14
|
+
}: Omit<HTMLButtonAttributes, "children"> & {
|
|
15
|
+
children?: Snippet<[{ readonly open: boolean; readonly disabled: boolean }]> | undefined;
|
|
16
|
+
} = $props();
|
|
17
|
+
const scope = getComboboxScope();
|
|
18
|
+
const view = $derived.by(() => {
|
|
19
|
+
scope?.track();
|
|
20
|
+
return { open: scope?.compound.isOpen() ?? false, disabled: scope?.compound.disabled() ?? false };
|
|
21
|
+
});
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<button
|
|
25
|
+
type="button"
|
|
26
|
+
tabindex={-1}
|
|
27
|
+
data-part="trigger"
|
|
28
|
+
aria-controls={scope?.compound.listId}
|
|
29
|
+
aria-expanded={view.open ? "true" : "false"}
|
|
30
|
+
disabled={view.disabled}
|
|
31
|
+
{...rest}
|
|
32
|
+
onclick={(event) => {
|
|
33
|
+
scope?.compound.dispatch({ type: "open", open: !view.open, reason: "imperative" });
|
|
34
|
+
chain(rest.onclick, event);
|
|
35
|
+
}}
|
|
36
|
+
>{@render children?.(view)}</button>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
3
|
+
type $$ComponentProps = Omit<HTMLButtonAttributes, "children"> & {
|
|
4
|
+
children?: Snippet<[{
|
|
5
|
+
readonly open: boolean;
|
|
6
|
+
readonly disabled: boolean;
|
|
7
|
+
}]> | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const ComboboxTrigger: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type ComboboxTrigger = ReturnType<typeof ComboboxTrigger>;
|
|
11
|
+
export default ComboboxTrigger;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// @stable — follows semver.
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
// A decorative icon for the selected value beside the field.
|
|
7
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
8
|
+
|
|
9
|
+
let { children, ...rest }: HTMLAttributes<HTMLSpanElement> = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<span data-part="value-icon" aria-hidden="true" {...rest}>{@render children?.()}</span>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// @stable — follows semver.
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
// The selected labels as text, or the snippet's own rendering of them.
|
|
7
|
+
import type { Snippet } from "svelte";
|
|
8
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
9
|
+
import { comboboxValueText } from "@bevelo/core";
|
|
10
|
+
import { getComboboxScope } from "./combobox-compound.svelte.js";
|
|
11
|
+
import type { ComboboxValueState } from "./combobox-compound.svelte.js";
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
placeholder,
|
|
15
|
+
maxLabels,
|
|
16
|
+
getMoreLabel,
|
|
17
|
+
children,
|
|
18
|
+
...rest
|
|
19
|
+
}: Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
20
|
+
placeholder?: string | undefined;
|
|
21
|
+
maxLabels?: number | undefined;
|
|
22
|
+
getMoreLabel?: ((count: number) => string) | undefined;
|
|
23
|
+
children?: Snippet<[ComboboxValueState]> | undefined;
|
|
24
|
+
} = $props();
|
|
25
|
+
const scope = getComboboxScope();
|
|
26
|
+
const view: ComboboxValueState = $derived.by(() => {
|
|
27
|
+
scope?.track();
|
|
28
|
+
const values = scope?.compound.values() ?? [];
|
|
29
|
+
const labels = scope?.compound.labels() ?? [];
|
|
30
|
+
return {
|
|
31
|
+
value: scope?.compound.multiple() ? values : values[0],
|
|
32
|
+
values,
|
|
33
|
+
label: comboboxValueText(labels, maxLabels, getMoreLabel),
|
|
34
|
+
labels,
|
|
35
|
+
placeholder: values.length === 0,
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<span data-part="value" {...rest}>{#if children}{@render children(view)}{:else if view.placeholder}{placeholder ?? ""}{:else}{view.label}{/if}</span>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { ComboboxValueState } from "./combobox-compound.svelte.js";
|
|
4
|
+
type $$ComponentProps = Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
5
|
+
placeholder?: string | undefined;
|
|
6
|
+
maxLabels?: number | undefined;
|
|
7
|
+
getMoreLabel?: ((count: number) => string) | undefined;
|
|
8
|
+
children?: Snippet<[ComboboxValueState]> | undefined;
|
|
9
|
+
};
|
|
10
|
+
declare const ComboboxValue: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
11
|
+
type ComboboxValue = ReturnType<typeof ComboboxValue>;
|
|
12
|
+
export default ComboboxValue;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// @stable — follows semver.
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
import type { ComboboxCompoundApi, ComboboxFilterSpec } from "@bevelo/core";
|
|
5
|
+
import type { ComboboxProps as ComboboxOptionsProps } from "./combobox-options.svelte";
|
|
6
|
+
import type { ComboboxListData } from "./combobox-compound.svelte.js";
|
|
7
|
+
|
|
8
|
+
export type { ComboboxOptionState } from "./combobox-options.svelte";
|
|
9
|
+
|
|
10
|
+
/** The imperative surface `api()` returns in either form. */
|
|
11
|
+
export type ComboboxApi = ComboboxCompoundApi;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Props for `Combobox`. `value`, `open` and `inputValue` are bindable. With
|
|
15
|
+
* `children` or `items` the combobox is composed from the parts and
|
|
16
|
+
* `multiple`, `maxSelected`, `allowCustomValue`, `defaultQuery`, `readOnly`,
|
|
17
|
+
* `loop` and `onHighlight` apply.
|
|
18
|
+
*/
|
|
19
|
+
export type ComboboxProps = Omit<ComboboxOptionsProps, "value" | "defaultValue" | "onChange" | "filter" | "children"> & {
|
|
20
|
+
value?: string | readonly string[] | null | undefined;
|
|
21
|
+
defaultValue?: string | readonly string[] | null | undefined;
|
|
22
|
+
onChange?: ((value: never, details: import("@bevelo/core").ChangeDetails<string>) => void) | undefined;
|
|
23
|
+
filter?: ComboboxFilterSpec | undefined;
|
|
24
|
+
multiple?: boolean | undefined;
|
|
25
|
+
maxSelected?: number | undefined;
|
|
26
|
+
allowCustomValue?: boolean | undefined;
|
|
27
|
+
defaultQuery?: string | undefined;
|
|
28
|
+
readOnly?: boolean | undefined;
|
|
29
|
+
loop?: boolean | undefined;
|
|
30
|
+
items?: ComboboxListData | undefined;
|
|
31
|
+
emptyItems?: ComboboxListData | undefined;
|
|
32
|
+
itemToLabel?: ((value: string) => string) | undefined;
|
|
33
|
+
onHighlight?: ((value: string | undefined, details: { readonly index: number }) => void) | undefined;
|
|
34
|
+
children?: Snippet | undefined;
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<script lang="ts">
|
|
39
|
+
// `Combobox` picks its form once: composed from the host's parts when it has
|
|
40
|
+
// children or `items`, otherwise rendered from `options`.
|
|
41
|
+
import ComboboxCompoundRoot from "./combobox-compound-root.svelte";
|
|
42
|
+
import ComboboxOptions from "./combobox-options.svelte";
|
|
43
|
+
|
|
44
|
+
let { value = $bindable(), open = $bindable(), inputValue = $bindable(), ...rest }: ComboboxProps = $props();
|
|
45
|
+
const composed = rest.children !== undefined || rest.items !== undefined;
|
|
46
|
+
let compound: ComboboxCompoundRoot | undefined = $state();
|
|
47
|
+
let options: ComboboxOptions | undefined = $state();
|
|
48
|
+
|
|
49
|
+
/** The imperative surface: open, choose, set and read the value, set the query, focus. */
|
|
50
|
+
export function api(): ComboboxApi {
|
|
51
|
+
return (compound?.api() ?? options?.controller()) as unknown as ComboboxApi;
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
{#if composed}
|
|
56
|
+
<ComboboxCompoundRoot bind:this={compound} bind:value bind:open bind:inputValue {...(rest as Record<string, unknown>)} />
|
|
57
|
+
{:else}
|
|
58
|
+
<ComboboxOptions bind:this={options} bind:value={value as never} bind:open bind:inputValue {...(rest as Record<string, unknown>)} />
|
|
59
|
+
{/if}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { ComboboxCompoundApi, ComboboxFilterSpec } from "@bevelo/core";
|
|
3
|
+
import type { ComboboxProps as ComboboxOptionsProps } from "./combobox-options.svelte";
|
|
4
|
+
import type { ComboboxListData } from "./combobox-compound.svelte.js";
|
|
5
|
+
export type { ComboboxOptionState } from "./combobox-options.svelte";
|
|
6
|
+
/** The imperative surface `api()` returns in either form. */
|
|
7
|
+
export type ComboboxApi = ComboboxCompoundApi;
|
|
8
|
+
/**
|
|
9
|
+
* Props for `Combobox`. `value`, `open` and `inputValue` are bindable. With
|
|
10
|
+
* `children` or `items` the combobox is composed from the parts and
|
|
11
|
+
* `multiple`, `maxSelected`, `allowCustomValue`, `defaultQuery`, `readOnly`,
|
|
12
|
+
* `loop` and `onHighlight` apply.
|
|
13
|
+
*/
|
|
14
|
+
export type ComboboxProps = Omit<ComboboxOptionsProps, "value" | "defaultValue" | "onChange" | "filter" | "children"> & {
|
|
15
|
+
value?: string | readonly string[] | null | undefined;
|
|
16
|
+
defaultValue?: string | readonly string[] | null | undefined;
|
|
17
|
+
onChange?: ((value: never, details: import("@bevelo/core").ChangeDetails<string>) => void) | undefined;
|
|
18
|
+
filter?: ComboboxFilterSpec | undefined;
|
|
19
|
+
multiple?: boolean | undefined;
|
|
20
|
+
maxSelected?: number | undefined;
|
|
21
|
+
allowCustomValue?: boolean | undefined;
|
|
22
|
+
defaultQuery?: string | undefined;
|
|
23
|
+
readOnly?: boolean | undefined;
|
|
24
|
+
loop?: boolean | undefined;
|
|
25
|
+
items?: ComboboxListData | undefined;
|
|
26
|
+
emptyItems?: ComboboxListData | undefined;
|
|
27
|
+
itemToLabel?: ((value: string) => string) | undefined;
|
|
28
|
+
onHighlight?: ((value: string | undefined, details: {
|
|
29
|
+
readonly index: number;
|
|
30
|
+
}) => void) | undefined;
|
|
31
|
+
children?: Snippet | undefined;
|
|
32
|
+
};
|
|
33
|
+
declare const Combobox: import("svelte").Component<ComboboxProps, {
|
|
34
|
+
api: () => ComboboxApi;
|
|
35
|
+
}, "value" | "open" | "inputValue">;
|
|
36
|
+
type Combobox = ReturnType<typeof Combobox>;
|
|
37
|
+
export default Combobox;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// @stable — follows semver.
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
5
|
+
import type { CommandListState } from "./command-scope.svelte.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props for `CommandEmpty`: shown while no row matches. Its snippet receives
|
|
9
|
+
* the list's state; set `when` to decide visibility from the state instead
|
|
10
|
+
* (`when={(state) => state.empty && !state.loading}`).
|
|
11
|
+
*/
|
|
12
|
+
export interface CommandEmptyProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
13
|
+
children?: Snippet<[CommandListState]> | undefined;
|
|
14
|
+
when?: ((state: CommandListState) => boolean) | undefined;
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
import { inlineCommand } from "./command-scope.svelte.js";
|
|
20
|
+
|
|
21
|
+
let { children, when, ...rest }: CommandEmptyProps = $props();
|
|
22
|
+
const scope = inlineCommand();
|
|
23
|
+
const state = $derived(scope?.state ?? { empty: true, loading: false, count: 0, query: "", status: "idle" });
|
|
24
|
+
const shown = $derived(when === undefined ? state.empty : when(state));
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
{#if shown}
|
|
28
|
+
<div data-part="empty" {...rest}>{#if children}{@render children(state)}{/if}</div>
|
|
29
|
+
{/if}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { CommandListState } from "./command-scope.svelte.js";
|
|
4
|
+
/**
|
|
5
|
+
* Props for `CommandEmpty`: shown while no row matches. Its snippet receives
|
|
6
|
+
* the list's state; set `when` to decide visibility from the state instead
|
|
7
|
+
* (`when={(state) => state.empty && !state.loading}`).
|
|
8
|
+
*/
|
|
9
|
+
export interface CommandEmptyProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
10
|
+
children?: Snippet<[CommandListState]> | undefined;
|
|
11
|
+
when?: ((state: CommandListState) => boolean) | undefined;
|
|
12
|
+
}
|
|
13
|
+
declare const CommandEmpty: import("svelte").Component<CommandEmptyProps, {}, "">;
|
|
14
|
+
type CommandEmpty = ReturnType<typeof CommandEmpty>;
|
|
15
|
+
export default CommandEmpty;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// @stable — follows semver.
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
5
|
+
|
|
6
|
+
/** Props for `CommandGroupLabel`: a group's heading. */
|
|
7
|
+
export interface CommandGroupLabelProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
8
|
+
children?: Snippet | undefined;
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
let { children, ...rest }: CommandGroupLabelProps = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<div data-part="group-label" {...rest}>{#if children}{@render children()}{/if}</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
/** Props for `CommandGroupLabel`: a group's heading. */
|
|
4
|
+
export interface CommandGroupLabelProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
5
|
+
children?: Snippet | undefined;
|
|
6
|
+
}
|
|
7
|
+
declare const CommandGroupLabel: import("svelte").Component<CommandGroupLabelProps, {}, "">;
|
|
8
|
+
type CommandGroupLabel = ReturnType<typeof CommandGroupLabel>;
|
|
9
|
+
export default CommandGroupLabel;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// @stable — follows semver.
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
5
|
+
|
|
6
|
+
/** Props for `CommandGroup`: a titled set of rows. */
|
|
7
|
+
export interface CommandGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
8
|
+
label?: string | undefined;
|
|
9
|
+
heading?: string | undefined;
|
|
10
|
+
children?: Snippet | undefined;
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
// The group hides rather than unmounts while a query leaves none of its rows
|
|
16
|
+
// matching: its rows stay registered, so it comes back when a later query
|
|
17
|
+
// matches one of them.
|
|
18
|
+
import { inlineCommand, provideGroup } from "./command-scope.svelte.js";
|
|
19
|
+
|
|
20
|
+
let { label, heading, children, ...rest }: CommandGroupProps = $props();
|
|
21
|
+
const scope = inlineCommand();
|
|
22
|
+
const id = Symbol("group");
|
|
23
|
+
provideGroup(id);
|
|
24
|
+
const hidden = $derived(scope !== undefined && scope.query !== "" && !scope.groupMatches(id));
|
|
25
|
+
const title = $derived(label ?? heading);
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<div role="group" data-part="group" {...rest} {hidden}>
|
|
29
|
+
{#if title !== undefined}<div data-part="group-label">{title}</div>{/if}
|
|
30
|
+
{#if children}{@render children()}{/if}
|
|
31
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
/** Props for `CommandGroup`: a titled set of rows. */
|
|
4
|
+
export interface CommandGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
5
|
+
label?: string | undefined;
|
|
6
|
+
heading?: string | undefined;
|
|
7
|
+
children?: Snippet | undefined;
|
|
8
|
+
}
|
|
9
|
+
declare const CommandGroup: import("svelte").Component<CommandGroupProps, {}, "">;
|
|
10
|
+
type CommandGroup = ReturnType<typeof CommandGroup>;
|
|
11
|
+
export default CommandGroup;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// Internal: `Command` renders this in its inline mode.
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
5
|
+
import type { InlineCommandOptions } from "./command-scope.svelte.js";
|
|
6
|
+
|
|
7
|
+
/** Props for the inline list's region. */
|
|
8
|
+
export interface CommandInlineProps extends InlineCommandOptions, Omit<HTMLAttributes<HTMLDivElement>, "onInput" | "children"> {
|
|
9
|
+
label?: string | undefined;
|
|
10
|
+
children?: Snippet | undefined;
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import { InlineCommandScope, provideInlineCommand } from "./command-scope.svelte.js";
|
|
16
|
+
import type { CommandApi } from "./command-scope.svelte.js";
|
|
17
|
+
|
|
18
|
+
let {
|
|
19
|
+
query = $bindable(), label = "Command", items, status, pages, page, filter,
|
|
20
|
+
onRun, onInput, onHighlight, onPagesChange, onPageChange, children, ...rest
|
|
21
|
+
}: CommandInlineProps = $props();
|
|
22
|
+
|
|
23
|
+
const scope = new InlineCommandScope(() => ({
|
|
24
|
+
query, items, status, pages, page, filter, onRun, onHighlight, onPagesChange, onPageChange,
|
|
25
|
+
onInput: (text: string) => {
|
|
26
|
+
if (query !== undefined) query = text;
|
|
27
|
+
onInput?.(text);
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
30
|
+
provideInlineCommand(scope);
|
|
31
|
+
|
|
32
|
+
/** The list's api: query, highlight, pages, run and focus. */
|
|
33
|
+
export function api(): CommandApi {
|
|
34
|
+
return scope.api;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let root = $state<HTMLDivElement>();
|
|
38
|
+
$effect(() => {
|
|
39
|
+
scope.root = root;
|
|
40
|
+
});
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<div {...rest} bind:this={root} role="region" aria-label={label} data-slot="command" onkeydown={scope.keydown}>
|
|
44
|
+
{#if children}{@render children()}{/if}
|
|
45
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { InlineCommandOptions } from "./command-scope.svelte.js";
|
|
4
|
+
/** Props for the inline list's region. */
|
|
5
|
+
export interface CommandInlineProps extends InlineCommandOptions, Omit<HTMLAttributes<HTMLDivElement>, "onInput" | "children"> {
|
|
6
|
+
label?: string | undefined;
|
|
7
|
+
children?: Snippet | undefined;
|
|
8
|
+
}
|
|
9
|
+
import type { CommandApi } from "./command-scope.svelte.js";
|
|
10
|
+
declare const CommandInline: import("svelte").Component<CommandInlineProps, {
|
|
11
|
+
api: () => CommandApi;
|
|
12
|
+
}, "query">;
|
|
13
|
+
type CommandInline = ReturnType<typeof CommandInline>;
|
|
14
|
+
export default CommandInline;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// @stable — follows semver.
|
|
3
|
+
import type { HTMLInputAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
/** Props for `CommandInput`: the inline list's search field. */
|
|
6
|
+
export type CommandInputProps = HTMLInputAttributes;
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { inlineCommand } from "./command-scope.svelte.js";
|
|
11
|
+
|
|
12
|
+
let { oninput, ...rest }: CommandInputProps = $props();
|
|
13
|
+
const scope = inlineCommand();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<input
|
|
17
|
+
type="text"
|
|
18
|
+
role="combobox"
|
|
19
|
+
aria-expanded="true"
|
|
20
|
+
data-part="input"
|
|
21
|
+
{...rest}
|
|
22
|
+
value={scope?.query ?? ""}
|
|
23
|
+
oninput={(event) => {
|
|
24
|
+
scope?.setQuery(event.currentTarget.value);
|
|
25
|
+
oninput?.(event);
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HTMLInputAttributes } from "svelte/elements";
|
|
2
|
+
/** Props for `CommandInput`: the inline list's search field. */
|
|
3
|
+
export type CommandInputProps = HTMLInputAttributes;
|
|
4
|
+
declare const CommandInput: import("svelte").Component<HTMLInputAttributes, {}, "">;
|
|
5
|
+
type CommandInput = ReturnType<typeof CommandInput>;
|
|
6
|
+
export default CommandInput;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// @stable — follows semver.
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
5
|
+
|
|
6
|
+
/** Props for `CommandItemIcon`: a row's icon, hidden from assistive technology. */
|
|
7
|
+
export interface CommandItemIconProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
8
|
+
/** Marks the icon `data-mirror`, which stylesheets flip in right-to-left text. */
|
|
9
|
+
mirror?: boolean | undefined;
|
|
10
|
+
children?: Snippet | undefined;
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
let { mirror = false, children, ...rest }: CommandItemIconProps = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<span data-part="item-icon" aria-hidden="true" data-mirror={mirror ? "" : undefined} {...rest}>{#if children}{@render children()}{/if}</span>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
/** Props for `CommandItemIcon`: a row's icon, hidden from assistive technology. */
|
|
4
|
+
export interface CommandItemIconProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
5
|
+
/** Marks the icon `data-mirror`, which stylesheets flip in right-to-left text. */
|
|
6
|
+
mirror?: boolean | undefined;
|
|
7
|
+
children?: Snippet | undefined;
|
|
8
|
+
}
|
|
9
|
+
declare const CommandItemIcon: import("svelte").Component<CommandItemIconProps, {}, "">;
|
|
10
|
+
type CommandItemIcon = ReturnType<typeof CommandItemIcon>;
|
|
11
|
+
export default CommandItemIcon;
|