@ghostvue/vue 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 +22 -0
- package/README.md +40 -2
- package/dist/.registries/component-names.generated.d.ts +3 -0
- package/dist/GhostAccordion.vue.d.ts +38 -0
- package/dist/GhostAccordionContent.vue.d.ts +26 -0
- package/dist/GhostAccordionItem.vue.d.ts +20 -0
- package/dist/GhostAccordionTrigger.vue.d.ts +23 -0
- package/dist/GhostAvatar.vue.d.ts +27 -0
- package/dist/GhostBadge.vue.d.ts +16 -0
- package/dist/GhostBreadcrumb.vue.d.ts +28 -0
- package/dist/GhostBreadcrumbEllipsis.vue.d.ts +20 -0
- package/dist/GhostBreadcrumbItem.vue.d.ts +25 -0
- package/dist/GhostBreadcrumbLink.vue.d.ts +25 -0
- package/dist/GhostBreadcrumbList.vue.d.ts +25 -0
- package/dist/GhostBreadcrumbPage.vue.d.ts +25 -0
- package/dist/GhostBreadcrumbSeparator.vue.d.ts +25 -0
- package/dist/GhostButton.vue.d.ts +25 -0
- package/dist/GhostCalendar.vue.d.ts +57 -0
- package/dist/GhostCalendarCell.vue.d.ts +35 -0
- package/dist/GhostCalendarGrid.vue.d.ts +19 -0
- package/dist/GhostCalendarHeader.vue.d.ts +24 -0
- package/dist/GhostCalendarHeading.vue.d.ts +22 -0
- package/dist/GhostCalendarNextButton.vue.d.ts +24 -0
- package/dist/GhostCalendarPrevButton.vue.d.ts +24 -0
- package/dist/GhostCard.vue.d.ts +18 -0
- package/dist/GhostCheckbox.vue.d.ts +48 -0
- package/dist/GhostCollapsible.vue.d.ts +31 -0
- package/dist/GhostCollapsibleContent.vue.d.ts +30 -0
- package/dist/GhostCollapsibleTrigger.vue.d.ts +28 -0
- package/dist/GhostCombobox.vue.d.ts +69 -0
- package/dist/GhostComboboxContent.vue.d.ts +41 -0
- package/dist/GhostComboboxEmpty.vue.d.ts +21 -0
- package/dist/GhostComboboxGroup.vue.d.ts +21 -0
- package/dist/GhostComboboxInput.vue.d.ts +11 -0
- package/dist/GhostComboboxLabel.vue.d.ts +21 -0
- package/dist/GhostComboboxOption.vue.d.ts +29 -0
- package/dist/GhostComboboxTrigger.vue.d.ts +26 -0
- package/dist/GhostCommandPalette.vue.d.ts +57 -0
- package/dist/GhostCommandPaletteContent.vue.d.ts +47 -0
- package/dist/GhostCommandPaletteEmpty.vue.d.ts +25 -0
- package/dist/GhostCommandPaletteGroup.vue.d.ts +25 -0
- package/dist/GhostCommandPaletteInput.vue.d.ts +13 -0
- package/dist/GhostCommandPaletteItem.vue.d.ts +33 -0
- package/dist/GhostCommandPaletteLabel.vue.d.ts +25 -0
- package/dist/GhostCommandPaletteList.vue.d.ts +25 -0
- package/dist/GhostCommandPaletteOverlay.vue.d.ts +32 -0
- package/dist/GhostCommandPaletteSeparator.vue.d.ts +10 -0
- package/dist/GhostCommandPaletteTitle.vue.d.ts +25 -0
- package/dist/GhostCommandPaletteTrigger.vue.d.ts +28 -0
- package/dist/GhostContextMenu.vue.d.ts +26 -0
- package/dist/GhostContextMenuCheckboxItem.vue.d.ts +63 -0
- package/dist/GhostContextMenuContent.vue.d.ts +39 -0
- package/dist/GhostContextMenuGroup.vue.d.ts +21 -0
- package/dist/GhostContextMenuItem.vue.d.ts +30 -0
- package/dist/GhostContextMenuLabel.vue.d.ts +21 -0
- package/dist/GhostContextMenuRadioGroup.vue.d.ts +31 -0
- package/dist/GhostContextMenuRadioItem.vue.d.ts +31 -0
- package/dist/GhostContextMenuSeparator.vue.d.ts +11 -0
- package/dist/GhostContextMenuTrigger.vue.d.ts +28 -0
- package/dist/GhostDataTable.vue.d.ts +29 -0
- package/dist/GhostDataTablePreset.vue.d.ts +21 -0
- package/dist/GhostDataTableTable.vue.d.ts +20 -0
- package/dist/GhostDatePicker.vue.d.ts +106 -0
- package/dist/GhostDatePickerCalendar.vue.d.ts +16 -0
- package/dist/GhostDatePickerContent.vue.d.ts +46 -0
- package/dist/GhostDatePickerInput.vue.d.ts +19 -0
- package/dist/GhostDatePickerTrigger.vue.d.ts +14 -0
- package/dist/GhostDialog.vue.d.ts +31 -0
- package/dist/GhostDialogClose.vue.d.ts +28 -0
- package/dist/GhostDialogContent.vue.d.ts +50 -0
- package/dist/GhostDialogDescription.vue.d.ts +25 -0
- package/dist/GhostDialogOverlay.vue.d.ts +32 -0
- package/dist/GhostDialogTitle.vue.d.ts +25 -0
- package/dist/GhostDialogTrigger.vue.d.ts +28 -0
- package/dist/GhostDrawer.vue.d.ts +39 -0
- package/dist/GhostDrawerClose.vue.d.ts +28 -0
- package/dist/GhostDrawerContent.vue.d.ts +47 -0
- package/dist/GhostDrawerDescription.vue.d.ts +25 -0
- package/dist/GhostDrawerOverlay.vue.d.ts +32 -0
- package/dist/GhostDrawerTitle.vue.d.ts +25 -0
- package/dist/GhostDrawerTrigger.vue.d.ts +28 -0
- package/dist/GhostDropdownMenu.vue.d.ts +26 -0
- package/dist/GhostDropdownMenuCheckboxItem.vue.d.ts +63 -0
- package/dist/GhostDropdownMenuContent.vue.d.ts +39 -0
- package/dist/GhostDropdownMenuGroup.vue.d.ts +21 -0
- package/dist/GhostDropdownMenuItem.vue.d.ts +30 -0
- package/dist/GhostDropdownMenuLabel.vue.d.ts +21 -0
- package/dist/GhostDropdownMenuRadioGroup.vue.d.ts +31 -0
- package/dist/GhostDropdownMenuRadioItem.vue.d.ts +31 -0
- package/dist/GhostDropdownMenuSeparator.vue.d.ts +11 -0
- package/dist/GhostDropdownMenuTrigger.vue.d.ts +26 -0
- package/dist/GhostEmptyState.vue.d.ts +19 -0
- package/dist/GhostField.vue.d.ts +28 -0
- package/dist/GhostFieldControl.vue.d.ts +13 -0
- package/dist/GhostFieldDescription.vue.d.ts +21 -0
- package/dist/GhostFieldError.vue.d.ts +21 -0
- package/dist/GhostFieldLabel.vue.d.ts +30 -0
- package/dist/GhostFileUpload.vue.d.ts +64 -0
- package/dist/GhostFileUploadDropzone.vue.d.ts +13 -0
- package/dist/GhostFileUploadItem.vue.d.ts +17 -0
- package/dist/GhostFileUploadItemRemove.vue.d.ts +13 -0
- package/dist/GhostFileUploadList.vue.d.ts +13 -0
- package/dist/GhostFileUploadTrigger.vue.d.ts +19 -0
- package/dist/GhostHoverCard.vue.d.ts +37 -0
- package/dist/GhostHoverCardContent.vue.d.ts +47 -0
- package/dist/GhostHoverCardTrigger.vue.d.ts +28 -0
- package/dist/GhostInlineAlert.vue.d.ts +19 -0
- package/dist/GhostInput.vue.d.ts +26 -0
- package/dist/GhostInteractiveSurface.vue.d.ts +25 -0
- package/dist/GhostKbd.vue.d.ts +25 -0
- package/dist/GhostLink.vue.d.ts +25 -0
- package/dist/GhostMenubar.vue.d.ts +27 -0
- package/dist/GhostMenubarCheckboxItem.vue.d.ts +63 -0
- package/dist/GhostMenubarContent.vue.d.ts +39 -0
- package/dist/GhostMenubarGroup.vue.d.ts +21 -0
- package/dist/GhostMenubarItem.vue.d.ts +30 -0
- package/dist/GhostMenubarLabel.vue.d.ts +21 -0
- package/dist/GhostMenubarMenu.vue.d.ts +26 -0
- package/dist/GhostMenubarRadioGroup.vue.d.ts +31 -0
- package/dist/GhostMenubarRadioItem.vue.d.ts +31 -0
- package/dist/GhostMenubarSeparator.vue.d.ts +11 -0
- package/dist/GhostMenubarTrigger.vue.d.ts +26 -0
- package/dist/GhostNumberInput.vue.d.ts +37 -0
- package/dist/GhostPagination.vue.d.ts +53 -0
- package/dist/GhostPopover.vue.d.ts +28 -0
- package/dist/GhostPopoverClose.vue.d.ts +28 -0
- package/dist/GhostPopoverContent.vue.d.ts +47 -0
- package/dist/GhostPopoverTrigger.vue.d.ts +28 -0
- package/dist/GhostPortal.vue.d.ts +28 -0
- package/dist/GhostProgress.vue.d.ts +14 -0
- package/dist/GhostRadioGroup.vue.d.ts +36 -0
- package/dist/GhostRadioGroupItem.vue.d.ts +10 -0
- package/dist/GhostScrollArea.vue.d.ts +17 -0
- package/dist/GhostScrollSpy.vue.d.ts +57 -0
- package/dist/GhostScrollSpyItem.vue.d.ts +26 -0
- package/dist/GhostScrollSpyLink.vue.d.ts +27 -0
- package/dist/GhostScrollSpyList.vue.d.ts +24 -0
- package/dist/GhostSegmentedControl.vue.d.ts +44 -0
- package/dist/GhostSegmentedControlIndicator.vue.d.ts +3 -0
- package/dist/GhostSegmentedControlItem.vue.d.ts +30 -0
- package/dist/GhostSelect.vue.d.ts +51 -0
- package/dist/GhostSelectContent.vue.d.ts +41 -0
- package/dist/GhostSelectGroup.vue.d.ts +21 -0
- package/dist/GhostSelectLabel.vue.d.ts +21 -0
- package/dist/GhostSelectOption.vue.d.ts +29 -0
- package/dist/GhostSelectTrigger.vue.d.ts +26 -0
- package/dist/GhostSelectValue.vue.d.ts +17 -0
- package/dist/GhostSeparator.vue.d.ts +7 -0
- package/dist/GhostSkeleton.vue.d.ts +18 -0
- package/dist/GhostSlider.vue.d.ts +141 -0
- package/dist/GhostSpinner.vue.d.ts +8 -0
- package/dist/GhostSwitch.vue.d.ts +37 -0
- package/dist/GhostTable.vue.d.ts +15 -0
- package/dist/GhostTableBody.vue.d.ts +13 -0
- package/dist/GhostTableCaption.vue.d.ts +13 -0
- package/dist/GhostTableCell.vue.d.ts +13 -0
- package/dist/GhostTableFoot.vue.d.ts +13 -0
- package/dist/GhostTableHead.vue.d.ts +13 -0
- package/dist/GhostTableHeaderCell.vue.d.ts +13 -0
- package/dist/GhostTableRow.vue.d.ts +13 -0
- package/dist/GhostTabs.vue.d.ts +37 -0
- package/dist/GhostTabsContent.vue.d.ts +27 -0
- package/dist/GhostTabsList.vue.d.ts +25 -0
- package/dist/GhostTabsTrigger.vue.d.ts +30 -0
- package/dist/GhostTextarea.vue.d.ts +29 -0
- package/dist/GhostToast.vue.d.ts +17 -0
- package/dist/GhostToastAction.vue.d.ts +17 -0
- package/dist/GhostToastClose.vue.d.ts +16 -0
- package/dist/GhostToastDescription.vue.d.ts +12 -0
- package/dist/GhostToastProvider.vue.d.ts +24 -0
- package/dist/GhostToastTitle.vue.d.ts +12 -0
- package/dist/GhostToastViewport.vue.d.ts +25 -0
- package/dist/GhostToggleGroup.vue.d.ts +41 -0
- package/dist/GhostToggleGroupItem.vue.d.ts +30 -0
- package/dist/GhostToolbar.vue.d.ts +29 -0
- package/dist/GhostTooltip.vue.d.ts +36 -0
- package/dist/GhostTooltipContent.vue.d.ts +47 -0
- package/dist/GhostTooltipProvider.vue.d.ts +16 -0
- package/dist/GhostTooltipTrigger.vue.d.ts +28 -0
- package/dist/GhostTree.vue.d.ts +59 -0
- package/dist/GhostTreeGroup.vue.d.ts +22 -0
- package/dist/GhostTreeItem.vue.d.ts +27 -0
- package/dist/GhostTreeTrigger.vue.d.ts +25 -0
- package/dist/GhostVisuallyHidden.vue.d.ts +19 -0
- package/dist/accordion-header-keyboard.d.ts +11 -0
- package/dist/calendar-date-math.d.ts +16 -0
- package/dist/calendar-intl.d.ts +7 -0
- package/dist/calendar-public-date.d.ts +1 -0
- package/dist/command-palette-context.d.ts +6 -0
- package/dist/data-table-interaction.d.ts +57 -0
- package/dist/data-table-processing.d.ts +32 -0
- package/dist/data-table-render.d.ts +40 -0
- package/dist/data-table-slot-bindings.d.ts +21 -0
- package/dist/date-picker-calendar-bridge.d.ts +25 -0
- package/dist/date-picker-value.d.ts +33 -0
- package/dist/define-data-table-columns.d.ts +89 -0
- package/dist/dev-codes.d.ts +143 -0
- package/dist/dialog-shared.d.ts +169 -0
- package/dist/dismissable-layer-stack.d.ts +27 -0
- package/dist/form-reset.d.ts +21 -0
- package/dist/get-pagination-range.d.ts +24 -0
- package/dist/get-tabbable-elements.d.ts +22 -0
- package/dist/ghost-accordion.d.ts +120 -0
- package/dist/ghost-avatar.d.ts +41 -0
- package/dist/ghost-badge.d.ts +11 -0
- package/dist/ghost-breadcrumb.d.ts +114 -0
- package/dist/ghost-button.d.ts +39 -0
- package/dist/ghost-calendar.d.ts +148 -0
- package/dist/ghost-card.d.ts +29 -0
- package/dist/ghost-checkbox.d.ts +51 -0
- package/dist/ghost-collapsible.d.ts +104 -0
- package/dist/ghost-combobox.d.ts +217 -0
- package/dist/ghost-command-palette.d.ts +377 -0
- package/dist/ghost-context-menu.d.ts +226 -0
- package/dist/ghost-data-table-preset.d.ts +107 -0
- package/dist/ghost-data-table-table.d.ts +76 -0
- package/dist/ghost-data-table.d.ts +508 -0
- package/dist/ghost-date-picker.d.ts +301 -0
- package/dist/ghost-dialog.d.ts +254 -0
- package/dist/ghost-drawer.d.ts +268 -0
- package/dist/ghost-dropdown-menu.d.ts +226 -0
- package/dist/ghost-empty-state.d.ts +26 -0
- package/dist/ghost-field.d.ts +151 -0
- package/dist/ghost-file-upload-accept.d.ts +32 -0
- package/dist/ghost-file-upload-messages.d.ts +14 -0
- package/dist/ghost-file-upload.d.ts +325 -0
- package/dist/ghost-hover-card.d.ts +192 -0
- package/dist/ghost-inline-alert.d.ts +34 -0
- package/dist/ghost-input.d.ts +71 -0
- package/dist/ghost-interactive-surface.d.ts +41 -0
- package/dist/ghost-kbd.d.ts +39 -0
- package/dist/ghost-link.d.ts +58 -0
- package/dist/ghost-menubar.d.ts +260 -0
- package/dist/ghost-number-input.d.ts +88 -0
- package/dist/ghost-pagination.d.ts +92 -0
- package/dist/ghost-popover.d.ts +188 -0
- package/dist/ghost-portal.d.ts +21 -0
- package/dist/ghost-progress.d.ts +40 -0
- package/dist/ghost-radio-group.d.ts +100 -0
- package/dist/ghost-scroll-area.d.ts +46 -0
- package/dist/ghost-scroll-spy.d.ts +150 -0
- package/dist/ghost-segmented-control.d.ts +124 -0
- package/dist/ghost-select.d.ts +131 -0
- package/dist/ghost-separator.d.ts +33 -0
- package/dist/ghost-skeleton.d.ts +14 -0
- package/dist/ghost-slider.d.ts +99 -0
- package/dist/ghost-spinner.d.ts +22 -0
- package/dist/ghost-switch.d.ts +77 -0
- package/dist/ghost-table.d.ts +62 -0
- package/dist/ghost-tabs.d.ts +154 -0
- package/dist/ghost-textarea.d.ts +78 -0
- package/dist/ghost-toast.d.ts +219 -0
- package/dist/ghost-toggle-group.d.ts +123 -0
- package/dist/ghost-toolbar.d.ts +23 -0
- package/dist/ghost-tooltip-provider.d.ts +37 -0
- package/dist/ghost-tooltip.d.ts +190 -0
- package/dist/ghost-tree.d.ts +355 -0
- package/dist/ghost-visually-hidden.d.ts +27 -0
- package/dist/ghostvue.js +17534 -0
- package/dist/has-tabbable-descendants.d.ts +2 -0
- package/dist/index.d.ts +307 -0
- package/dist/invoke-attr-handler.d.ts +15 -0
- package/dist/is-ime-composing.d.ts +28 -0
- package/dist/manifest.json +17098 -0
- package/dist/measure-scroll-overflow.d.ts +6 -0
- package/dist/menu-item-activation.d.ts +39 -0
- package/dist/resolver.d.ts +49 -0
- package/dist/resolver.js +14 -0
- package/dist/scroll-spy-motion.d.ts +26 -0
- package/dist/sort-by-document-order.d.ts +23 -0
- package/dist/sync-calendar-focus-tab-stops.d.ts +2 -0
- package/dist/sync-segmented-control-item-order.d.ts +5 -0
- package/dist/sync-tabs-selection-tab-stops.d.ts +7 -0
- package/dist/sync-toggle-group-selection-tab-stops.d.ts +14 -0
- package/dist/typeahead-match.d.ts +15 -0
- package/dist/use-collapsible-content-hidden.d.ts +28 -0
- package/dist/use-controllable-state.d.ts +20 -0
- package/dist/use-dismissable-layer.d.ts +40 -0
- package/dist/use-floating.d.ts +38 -0
- package/dist/use-focus-scope.d.ts +34 -0
- package/dist/use-ghost-accordion.d.ts +5 -0
- package/dist/use-ghost-avatar.d.ts +28 -0
- package/dist/use-ghost-badge.d.ts +13 -0
- package/dist/use-ghost-breadcrumb.d.ts +19 -0
- package/dist/use-ghost-button.d.ts +18 -0
- package/dist/use-ghost-calendar.d.ts +3 -0
- package/dist/use-ghost-card.d.ts +15 -0
- package/dist/use-ghost-checkbox.d.ts +24 -0
- package/dist/use-ghost-collapsible.d.ts +8 -0
- package/dist/use-ghost-combobox.d.ts +65 -0
- package/dist/use-ghost-command-palette.d.ts +24 -0
- package/dist/use-ghost-context-menu.d.ts +14 -0
- package/dist/use-ghost-data-table.d.ts +55 -0
- package/dist/use-ghost-date-picker.d.ts +11 -0
- package/dist/use-ghost-dialog.d.ts +10 -0
- package/dist/use-ghost-drawer.d.ts +11 -0
- package/dist/use-ghost-dropdown-menu.d.ts +5 -0
- package/dist/use-ghost-empty-state.d.ts +18 -0
- package/dist/use-ghost-field-part-content.d.ts +15 -0
- package/dist/use-ghost-field.d.ts +10 -0
- package/dist/use-ghost-file-upload.d.ts +16 -0
- package/dist/use-ghost-hover-card.d.ts +8 -0
- package/dist/use-ghost-id.d.ts +6 -0
- package/dist/use-ghost-inline-alert.d.ts +20 -0
- package/dist/use-ghost-input.d.ts +29 -0
- package/dist/use-ghost-interactive-surface.d.ts +21 -0
- package/dist/use-ghost-kbd.d.ts +35 -0
- package/dist/use-ghost-link.d.ts +20 -0
- package/dist/use-ghost-menu-collection.d.ts +19 -0
- package/dist/use-ghost-menubar-menu.d.ts +3 -0
- package/dist/use-ghost-menubar.d.ts +10 -0
- package/dist/use-ghost-number-input.d.ts +63 -0
- package/dist/use-ghost-pagination.d.ts +22 -0
- package/dist/use-ghost-popover.d.ts +8 -0
- package/dist/use-ghost-progress.d.ts +33 -0
- package/dist/use-ghost-radio-group.d.ts +5 -0
- package/dist/use-ghost-scroll-area.d.ts +23 -0
- package/dist/use-ghost-scroll-spy.d.ts +25 -0
- package/dist/use-ghost-segmented-control.d.ts +6 -0
- package/dist/use-ghost-select.d.ts +52 -0
- package/dist/use-ghost-separator.d.ts +19 -0
- package/dist/use-ghost-skeleton.d.ts +19 -0
- package/dist/use-ghost-slider.d.ts +65 -0
- package/dist/use-ghost-spinner.d.ts +18 -0
- package/dist/use-ghost-switch.d.ts +39 -0
- package/dist/use-ghost-table.d.ts +70 -0
- package/dist/use-ghost-tabs.d.ts +5 -0
- package/dist/use-ghost-textarea.d.ts +44 -0
- package/dist/use-ghost-toast.d.ts +56 -0
- package/dist/use-ghost-toggle-group.d.ts +6 -0
- package/dist/use-ghost-toolbar.d.ts +23 -0
- package/dist/use-ghost-tooltip.d.ts +8 -0
- package/dist/use-ghost-tree.d.ts +14 -0
- package/dist/use-ghost-visually-hidden.d.ts +35 -0
- package/dist/use-inert-others.d.ts +20 -0
- package/dist/use-roving-focus.d.ts +20 -0
- package/dist/use-scroll-lock.d.ts +13 -0
- package/package.json +59 -4
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import type { Placement, Strategy } from '@floating-ui/dom';
|
|
2
|
+
import type { Component, ComputedRef, CSSProperties, InjectionKey, MaybeRefOrGetter, Ref } from 'vue';
|
|
3
|
+
import { resolvePopoverHtmlElement } from './ghost-popover.js';
|
|
4
|
+
/** @see resolvePopoverHtmlElement */
|
|
5
|
+
export declare const resolveComboboxHtmlElement: typeof resolvePopoverHtmlElement;
|
|
6
|
+
/**
|
|
7
|
+
* Id of the `role="listbox"` element inside the content with `contentId`.
|
|
8
|
+
* The input's and trigger's `aria-controls` must name the popup itself (see
|
|
9
|
+
* the specification); the content root is a presentational positioning
|
|
10
|
+
* wrapper.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ghostComboboxListboxId(contentId: string): string;
|
|
13
|
+
export type GhostComboboxInputElement = string | Component;
|
|
14
|
+
export type GhostComboboxTriggerElement = string | Component;
|
|
15
|
+
export type GhostComboboxContentElement = string | Component;
|
|
16
|
+
export type GhostComboboxOptionElement = string | Component;
|
|
17
|
+
export type GhostComboboxGroupElement = string | Component;
|
|
18
|
+
export type GhostComboboxLabelElement = string | Component;
|
|
19
|
+
export type GhostComboboxEmptyElement = string | Component;
|
|
20
|
+
export type GhostComboboxPlacement = Placement;
|
|
21
|
+
export type GhostComboboxStrategy = Strategy;
|
|
22
|
+
export type GhostComboboxPadding = number | {
|
|
23
|
+
top?: number;
|
|
24
|
+
right?: number;
|
|
25
|
+
bottom?: number;
|
|
26
|
+
left?: number;
|
|
27
|
+
};
|
|
28
|
+
export type GhostComboboxOffsetOptions = number | {
|
|
29
|
+
mainAxis?: number;
|
|
30
|
+
crossAxis?: number;
|
|
31
|
+
alignmentAxis?: number | null;
|
|
32
|
+
};
|
|
33
|
+
export interface GhostComboboxFlipOptions {
|
|
34
|
+
mainAxis?: boolean;
|
|
35
|
+
crossAxis?: boolean;
|
|
36
|
+
fallbackPlacements?: GhostComboboxPlacement[];
|
|
37
|
+
padding?: GhostComboboxPadding;
|
|
38
|
+
boundary?: Element | Element[];
|
|
39
|
+
}
|
|
40
|
+
export interface GhostComboboxShiftOptions {
|
|
41
|
+
mainAxis?: boolean;
|
|
42
|
+
crossAxis?: boolean;
|
|
43
|
+
padding?: GhostComboboxPadding;
|
|
44
|
+
boundary?: Element | Element[];
|
|
45
|
+
}
|
|
46
|
+
export interface GhostComboboxOptionRecord {
|
|
47
|
+
value: string;
|
|
48
|
+
textValue: string;
|
|
49
|
+
disabled: boolean;
|
|
50
|
+
optionId: string;
|
|
51
|
+
getElement: () => HTMLElement | null;
|
|
52
|
+
}
|
|
53
|
+
export type GhostComboboxValue = string | string[] | undefined;
|
|
54
|
+
/** Native submit + `required` constraint validation (not `type=hidden`). */
|
|
55
|
+
export interface GhostComboboxFormInputProps {
|
|
56
|
+
type: 'text';
|
|
57
|
+
name: string | undefined;
|
|
58
|
+
value: string;
|
|
59
|
+
form: string | undefined;
|
|
60
|
+
disabled: boolean | undefined;
|
|
61
|
+
required: boolean | undefined;
|
|
62
|
+
tabindex: -1;
|
|
63
|
+
'aria-hidden': true;
|
|
64
|
+
class: 'ghost-visually-hidden';
|
|
65
|
+
style: CSSProperties;
|
|
66
|
+
autocomplete: 'off';
|
|
67
|
+
}
|
|
68
|
+
/** Visually-hidden polite live region bindings for {@link GhostCombobox}. */
|
|
69
|
+
export interface GhostComboboxLiveRegionProps {
|
|
70
|
+
id: string;
|
|
71
|
+
class: 'ghost-visually-hidden';
|
|
72
|
+
style: CSSProperties;
|
|
73
|
+
'aria-live': 'polite';
|
|
74
|
+
'aria-atomic': true;
|
|
75
|
+
'data-part': 'announcer';
|
|
76
|
+
}
|
|
77
|
+
export interface GhostComboboxSearchPayload {
|
|
78
|
+
query: string;
|
|
79
|
+
requestId: number;
|
|
80
|
+
}
|
|
81
|
+
/** Overridable internal strings and formatters for {@link GhostCombobox}. */
|
|
82
|
+
export interface GhostComboboxMessages {
|
|
83
|
+
/** Live-region announcement while `loading` is true. @default 'Loading results' */
|
|
84
|
+
loading?: string;
|
|
85
|
+
/** Live-region announcement when open with zero enabled options. @default 'No results available' */
|
|
86
|
+
empty?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Live-region announcement formatter when open with `count > 0` enabled options.
|
|
89
|
+
* @default (count) => `${String(count)} results available`
|
|
90
|
+
*/
|
|
91
|
+
results?: (count: number) => string;
|
|
92
|
+
/** Native constraint validation message when `required` and empty. @default 'Select a value.' */
|
|
93
|
+
required?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface GhostComboboxContext {
|
|
96
|
+
multiple: ComputedRef<boolean>;
|
|
97
|
+
virtualized: ComputedRef<boolean>;
|
|
98
|
+
selectedValue: Ref<GhostComboboxValue>;
|
|
99
|
+
searchValue: Ref<string>;
|
|
100
|
+
isOpen: Ref<boolean>;
|
|
101
|
+
loading: ComputedRef<boolean>;
|
|
102
|
+
open: () => void;
|
|
103
|
+
close: () => void;
|
|
104
|
+
toggleOpen: () => void;
|
|
105
|
+
disabled: ComputedRef<boolean>;
|
|
106
|
+
required: ComputedRef<boolean>;
|
|
107
|
+
invalid: ComputedRef<boolean>;
|
|
108
|
+
allowDeselect: ComputedRef<boolean>;
|
|
109
|
+
placeholder: ComputedRef<string | undefined>;
|
|
110
|
+
defaultInputId: ComputedRef<string>;
|
|
111
|
+
defaultContentId: ComputedRef<string>;
|
|
112
|
+
inputId: ComputedRef<string>;
|
|
113
|
+
contentId: ComputedRef<string>;
|
|
114
|
+
inputElement: Ref<HTMLElement | null>;
|
|
115
|
+
contentElement: Ref<HTMLElement | null>;
|
|
116
|
+
listboxElement: Ref<HTMLElement | null>;
|
|
117
|
+
openedAtMount: Ref<boolean>;
|
|
118
|
+
setInputElement: (element: HTMLElement | null) => void;
|
|
119
|
+
setContentElement: (element: HTMLElement | null) => void;
|
|
120
|
+
setListboxElement: (element: HTMLElement | null) => void;
|
|
121
|
+
setInputId: (id: string | null) => void;
|
|
122
|
+
setContentId: (id: string | null) => void;
|
|
123
|
+
setInputRegistered: (registered: boolean) => void;
|
|
124
|
+
inputRegistered: Ref<boolean>;
|
|
125
|
+
/** Optional companion trigger; part of the widget for focus departure. */
|
|
126
|
+
triggerElement: Ref<HTMLElement | null>;
|
|
127
|
+
setTriggerElement: (element: HTMLElement | null) => void;
|
|
128
|
+
/**
|
|
129
|
+
* Called from `focusout` on the input, trigger, and content. Closes and
|
|
130
|
+
* resets the transient search only when focus leaves all of them.
|
|
131
|
+
*/
|
|
132
|
+
notifyFocusOut: (event: FocusEvent) => void;
|
|
133
|
+
/**
|
|
134
|
+
* Called from `pointerdown` on the input, trigger, and content so a press
|
|
135
|
+
* inside the widget that blurs to `body` is not treated as focus departure.
|
|
136
|
+
*/
|
|
137
|
+
notifyPointerDownInside: () => void;
|
|
138
|
+
/**
|
|
139
|
+
* True while a focus-departure close is pending, so the content's focus
|
|
140
|
+
* scope does not pull focus back to the input after the user moved away.
|
|
141
|
+
*/
|
|
142
|
+
focusRestoreSuppressed: Ref<boolean>;
|
|
143
|
+
registerOption: (value: string, textValue: string, disabled: boolean, optionId: string, getElement: () => HTMLElement | null) => void;
|
|
144
|
+
unregisterOption: (value: string) => void;
|
|
145
|
+
setOptionDisabled: (value: string, disabled: boolean) => void;
|
|
146
|
+
setOptionTextValue: (value: string, textValue: string) => void;
|
|
147
|
+
select: (value: string) => void;
|
|
148
|
+
isSelected: (value: string) => boolean;
|
|
149
|
+
isOptionDisabled: (value: string) => boolean;
|
|
150
|
+
optionOrder: ComputedRef<string[]>;
|
|
151
|
+
optionCount: ComputedRef<number>;
|
|
152
|
+
getOptionText: (value: string) => string | undefined;
|
|
153
|
+
getOptionId: (value: string) => string | undefined;
|
|
154
|
+
activeOptionValue: Ref<string | undefined>;
|
|
155
|
+
activeDescendantId: ComputedRef<string | undefined>;
|
|
156
|
+
moveActive: (direction: 1 | -1) => void;
|
|
157
|
+
setActiveOptionByValue: (value: string | undefined) => void;
|
|
158
|
+
moveActiveFirst: () => void;
|
|
159
|
+
moveActiveLast: () => void;
|
|
160
|
+
onInputSearch: (query: string) => void;
|
|
161
|
+
labelVersion: Ref<number>;
|
|
162
|
+
announceMessage: Ref<string>;
|
|
163
|
+
liveRegionId: ComputedRef<string>;
|
|
164
|
+
}
|
|
165
|
+
export declare const ghostComboboxContextKey: InjectionKey<GhostComboboxContext>;
|
|
166
|
+
export declare const ghostComboboxGroupLabelKey: InjectionKey<{
|
|
167
|
+
setLabelId: (id: string | null) => void;
|
|
168
|
+
}>;
|
|
169
|
+
export interface GhostComboboxInputExposed {
|
|
170
|
+
readonly element: HTMLElement | null;
|
|
171
|
+
focus(options?: FocusOptions): void;
|
|
172
|
+
blur(): void;
|
|
173
|
+
}
|
|
174
|
+
export interface GhostComboboxTriggerExposed {
|
|
175
|
+
readonly element: HTMLElement | null;
|
|
176
|
+
focus(options?: FocusOptions): void;
|
|
177
|
+
blur(): void;
|
|
178
|
+
}
|
|
179
|
+
export interface GhostComboboxContentExposed {
|
|
180
|
+
readonly element: HTMLElement | null;
|
|
181
|
+
focus(options?: FocusOptions): void;
|
|
182
|
+
blur(): void;
|
|
183
|
+
}
|
|
184
|
+
export interface GhostComboboxOptionExposed {
|
|
185
|
+
readonly element: HTMLElement | null;
|
|
186
|
+
focus(options?: FocusOptions): void;
|
|
187
|
+
blur(): void;
|
|
188
|
+
}
|
|
189
|
+
export interface GhostComboboxExposed {
|
|
190
|
+
readonly element: HTMLElement | null;
|
|
191
|
+
focus(options?: FocusOptions): void;
|
|
192
|
+
blur(): void;
|
|
193
|
+
}
|
|
194
|
+
export interface UseGhostComboboxOptions {
|
|
195
|
+
multiple?: MaybeRefOrGetter<boolean | undefined>;
|
|
196
|
+
virtualized?: MaybeRefOrGetter<boolean | undefined>;
|
|
197
|
+
modelValue?: MaybeRefOrGetter<GhostComboboxValue>;
|
|
198
|
+
defaultValue?: MaybeRefOrGetter<GhostComboboxValue>;
|
|
199
|
+
search?: MaybeRefOrGetter<string | undefined>;
|
|
200
|
+
defaultSearch?: MaybeRefOrGetter<string | undefined>;
|
|
201
|
+
open?: MaybeRefOrGetter<boolean | undefined>;
|
|
202
|
+
defaultOpen?: MaybeRefOrGetter<boolean | undefined>;
|
|
203
|
+
disabled?: MaybeRefOrGetter<boolean | undefined>;
|
|
204
|
+
required?: MaybeRefOrGetter<boolean | undefined>;
|
|
205
|
+
invalid?: MaybeRefOrGetter<boolean | undefined>;
|
|
206
|
+
loading?: MaybeRefOrGetter<boolean | undefined>;
|
|
207
|
+
allowDeselect?: MaybeRefOrGetter<boolean | undefined>;
|
|
208
|
+
name?: MaybeRefOrGetter<string | undefined>;
|
|
209
|
+
form?: MaybeRefOrGetter<string | undefined>;
|
|
210
|
+
placeholder?: MaybeRefOrGetter<string | undefined>;
|
|
211
|
+
messages?: MaybeRefOrGetter<GhostComboboxMessages | undefined>;
|
|
212
|
+
onValueChange?: (value: GhostComboboxValue) => void;
|
|
213
|
+
onSearchChange?: (query: string) => void;
|
|
214
|
+
onSearch?: (payload: GhostComboboxSearchPayload) => void;
|
|
215
|
+
onOpenChange?: (open: boolean) => void;
|
|
216
|
+
getFormInput?: () => HTMLInputElement | null;
|
|
217
|
+
}
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import type { Component, ComputedRef, InjectionKey, MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
import type { GhostComboboxLiveRegionProps, GhostComboboxMessages, GhostComboboxSearchPayload } from './ghost-combobox.js';
|
|
3
|
+
import type { GhostDialogContext } from './ghost-dialog.js';
|
|
4
|
+
import type { GhostPortalTarget } from './ghost-portal.js';
|
|
5
|
+
/** Valid `as` targets for {@link GhostCommandPaletteTrigger}. */
|
|
6
|
+
export type GhostCommandPaletteTriggerElement = string | Component;
|
|
7
|
+
/** Valid `as` targets for {@link GhostCommandPaletteOverlay}. */
|
|
8
|
+
export type GhostCommandPaletteOverlayElement = string | Component;
|
|
9
|
+
/** Valid `as` targets for {@link GhostCommandPaletteContent}. */
|
|
10
|
+
export type GhostCommandPaletteContentElement = string | Component;
|
|
11
|
+
/** Valid `as` targets for {@link GhostCommandPaletteTitle}. */
|
|
12
|
+
export type GhostCommandPaletteTitleElement = string | Component;
|
|
13
|
+
/** Valid `as` targets for {@link GhostCommandPaletteInput}. */
|
|
14
|
+
export type GhostCommandPaletteInputElement = string | Component;
|
|
15
|
+
/** Valid `as` targets for {@link GhostCommandPaletteList}. */
|
|
16
|
+
export type GhostCommandPaletteListElement = string | Component;
|
|
17
|
+
/** Valid `as` targets for {@link GhostCommandPaletteItem}. */
|
|
18
|
+
export type GhostCommandPaletteItemElement = string | Component;
|
|
19
|
+
/** Valid `as` targets for {@link GhostCommandPaletteGroup}. */
|
|
20
|
+
export type GhostCommandPaletteGroupElement = string | Component;
|
|
21
|
+
/** Valid `as` targets for {@link GhostCommandPaletteLabel}. */
|
|
22
|
+
export type GhostCommandPaletteLabelElement = string | Component;
|
|
23
|
+
/** Valid `as` targets for {@link GhostCommandPaletteEmpty}. */
|
|
24
|
+
export type GhostCommandPaletteEmptyElement = string | Component;
|
|
25
|
+
/** Valid `as` targets for {@link GhostCommandPaletteSeparator}. */
|
|
26
|
+
export type GhostCommandPaletteSeparatorElement = string | Component;
|
|
27
|
+
/**
|
|
28
|
+
* Payload of the palette `command` event. Only the activated item's stable
|
|
29
|
+
* `id` is emitted (C10): `textValue` is presentation for assistive technology,
|
|
30
|
+
* and handlers should key off ids that survive copy and locale changes.
|
|
31
|
+
*/
|
|
32
|
+
export interface GhostCommandPaletteCommandPayload {
|
|
33
|
+
/** Stable command identity from the activated item's `id` prop. */
|
|
34
|
+
id: string;
|
|
35
|
+
}
|
|
36
|
+
/** Payload of the palette `search` event (same contract as `GhostCombobox`). */
|
|
37
|
+
export type GhostCommandPaletteSearchPayload = GhostComboboxSearchPayload;
|
|
38
|
+
/** Props for the {@link GhostCommandPalette} root. */
|
|
39
|
+
export interface GhostCommandPaletteProps {
|
|
40
|
+
/**
|
|
41
|
+
* Controlled open state. Omit to run uncontrolled from `defaultOpen`.
|
|
42
|
+
* @default undefined
|
|
43
|
+
*/
|
|
44
|
+
open?: boolean | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Initial open state when `open` is omitted.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
defaultOpen?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Controlled query text. Omit to run uncontrolled from `defaultSearch`.
|
|
52
|
+
* @default undefined
|
|
53
|
+
*/
|
|
54
|
+
search?: string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Initial query, and the value the query resets to when the palette closes.
|
|
57
|
+
* @default ''
|
|
58
|
+
*/
|
|
59
|
+
defaultSearch?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Shows loading presentation: hides the empty part, sets `aria-busy` on the
|
|
62
|
+
* listbox, and announces `messages.loading` politely.
|
|
63
|
+
* @default false
|
|
64
|
+
*/
|
|
65
|
+
loading?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Modal dialog shell: focus trap, scroll lock, inert background, and overlay.
|
|
68
|
+
* A non-modal palette closes when focus leaves it.
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
modal?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Blocks opening, search, and command activation.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
disabled?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Requests close after a command is activated. When `false`, or when a
|
|
79
|
+
* controlled parent keeps `open`, the query stays as typed.
|
|
80
|
+
* @default true
|
|
81
|
+
*/
|
|
82
|
+
closeOnSelect?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Whether `Escape` closes the palette. `GhostCommandPaletteContent` may
|
|
85
|
+
* override it.
|
|
86
|
+
* @default true
|
|
87
|
+
*/
|
|
88
|
+
closeOnEscape?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Overrides the loading, empty, and results-count announcements. Unset
|
|
91
|
+
* fields keep the English defaults.
|
|
92
|
+
* @default undefined
|
|
93
|
+
*/
|
|
94
|
+
messages?: GhostComboboxMessages | undefined;
|
|
95
|
+
}
|
|
96
|
+
/** Props passed to the {@link GhostCommandPalette} default slot. */
|
|
97
|
+
export interface GhostCommandPaletteSlotProps {
|
|
98
|
+
open: boolean;
|
|
99
|
+
search: string;
|
|
100
|
+
loading: boolean;
|
|
101
|
+
close: () => void;
|
|
102
|
+
focusInput: () => void;
|
|
103
|
+
}
|
|
104
|
+
/** Props for {@link GhostCommandPaletteTrigger}. */
|
|
105
|
+
export interface GhostCommandPaletteTriggerProps {
|
|
106
|
+
/**
|
|
107
|
+
* Tag name or component rendered for the trigger control.
|
|
108
|
+
* @default 'button'
|
|
109
|
+
*/
|
|
110
|
+
as?: GhostCommandPaletteTriggerElement;
|
|
111
|
+
/**
|
|
112
|
+
* Disables opening from this trigger. The root `disabled` prop also applies.
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
115
|
+
disabled?: boolean;
|
|
116
|
+
}
|
|
117
|
+
/** Props for {@link GhostCommandPaletteOverlay}. */
|
|
118
|
+
export interface GhostCommandPaletteOverlayProps {
|
|
119
|
+
/**
|
|
120
|
+
* Tag name or component rendered for the modal backdrop.
|
|
121
|
+
* @default 'div'
|
|
122
|
+
*/
|
|
123
|
+
as?: GhostCommandPaletteOverlayElement;
|
|
124
|
+
/**
|
|
125
|
+
* Teleport the overlay through `GhostPortal` when `true`.
|
|
126
|
+
* @default true
|
|
127
|
+
*/
|
|
128
|
+
portal?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Teleport target when `portal` is `true`.
|
|
131
|
+
* @default 'body'
|
|
132
|
+
*/
|
|
133
|
+
portalTo?: GhostPortalTarget;
|
|
134
|
+
}
|
|
135
|
+
/** Props for {@link GhostCommandPaletteContent}. */
|
|
136
|
+
export interface GhostCommandPaletteContentProps {
|
|
137
|
+
/**
|
|
138
|
+
* Tag name or component rendered for the dialog surface.
|
|
139
|
+
* @default 'div'
|
|
140
|
+
*/
|
|
141
|
+
as?: GhostCommandPaletteContentElement;
|
|
142
|
+
/**
|
|
143
|
+
* Overrides the root `closeOnEscape` when set.
|
|
144
|
+
* @default undefined
|
|
145
|
+
*/
|
|
146
|
+
closeOnEscape?: boolean | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Dismisses the palette on outside pointerdown, including the overlay.
|
|
149
|
+
* @default true
|
|
150
|
+
*/
|
|
151
|
+
closeOnOutsideClick?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Teleport the surface through `GhostPortal` when `true`.
|
|
154
|
+
* @default true
|
|
155
|
+
*/
|
|
156
|
+
portal?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Teleport target when `portal` is `true`.
|
|
159
|
+
* @default 'body'
|
|
160
|
+
*/
|
|
161
|
+
portalTo?: GhostPortalTarget;
|
|
162
|
+
/**
|
|
163
|
+
* Gates the first focus-scope activation of each opening (see
|
|
164
|
+
* `GhostDialogContent`).
|
|
165
|
+
* @default true
|
|
166
|
+
*/
|
|
167
|
+
focusReady?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Resolves the element focused on open. Defaults to the command input.
|
|
170
|
+
* @default undefined
|
|
171
|
+
*/
|
|
172
|
+
initialFocus?: (() => HTMLElement | null) | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* Resolves the element focused on close, for openers that are not the
|
|
175
|
+
* visible trigger. Defaults to the element focused before opening.
|
|
176
|
+
* @default undefined
|
|
177
|
+
*/
|
|
178
|
+
returnFocus?: (() => HTMLElement | null) | undefined;
|
|
179
|
+
}
|
|
180
|
+
/** Props for {@link GhostCommandPaletteTitle}. */
|
|
181
|
+
export interface GhostCommandPaletteTitleProps {
|
|
182
|
+
/**
|
|
183
|
+
* Tag name or component rendered for the dialog title.
|
|
184
|
+
* @default 'h2'
|
|
185
|
+
*/
|
|
186
|
+
as?: GhostCommandPaletteTitleElement;
|
|
187
|
+
}
|
|
188
|
+
/** Props for {@link GhostCommandPaletteInput}. */
|
|
189
|
+
export interface GhostCommandPaletteInputProps {
|
|
190
|
+
/**
|
|
191
|
+
* Tag name or component rendered for the query field.
|
|
192
|
+
* @default 'input'
|
|
193
|
+
*/
|
|
194
|
+
as?: GhostCommandPaletteInputElement;
|
|
195
|
+
/**
|
|
196
|
+
* Disables typing and activation from this input.
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
disabled?: boolean;
|
|
200
|
+
}
|
|
201
|
+
/** Props for {@link GhostCommandPaletteList}. */
|
|
202
|
+
export interface GhostCommandPaletteListProps {
|
|
203
|
+
/**
|
|
204
|
+
* Tag name or component rendered for the listbox.
|
|
205
|
+
* @default 'div'
|
|
206
|
+
*/
|
|
207
|
+
as?: GhostCommandPaletteListElement;
|
|
208
|
+
}
|
|
209
|
+
/** Props for {@link GhostCommandPaletteItem}. */
|
|
210
|
+
export interface GhostCommandPaletteItemProps {
|
|
211
|
+
/** Stable command identity, unique within the palette; emitted on `command`. */
|
|
212
|
+
id: string;
|
|
213
|
+
/**
|
|
214
|
+
* Excluded from highlight and activation.
|
|
215
|
+
* @default false
|
|
216
|
+
*/
|
|
217
|
+
disabled?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Plain-text label for assistive technology. Falls back to the item's text.
|
|
220
|
+
* @default undefined
|
|
221
|
+
*/
|
|
222
|
+
textValue?: string | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* Tag name or component rendered for the option.
|
|
225
|
+
* @default 'div'
|
|
226
|
+
*/
|
|
227
|
+
as?: GhostCommandPaletteItemElement | undefined;
|
|
228
|
+
}
|
|
229
|
+
/** Props for {@link GhostCommandPaletteGroup}. */
|
|
230
|
+
export interface GhostCommandPaletteGroupProps {
|
|
231
|
+
/**
|
|
232
|
+
* Tag name or component rendered for the group.
|
|
233
|
+
* @default 'div'
|
|
234
|
+
*/
|
|
235
|
+
as?: GhostCommandPaletteGroupElement;
|
|
236
|
+
}
|
|
237
|
+
/** Props for {@link GhostCommandPaletteLabel}. */
|
|
238
|
+
export interface GhostCommandPaletteLabelProps {
|
|
239
|
+
/**
|
|
240
|
+
* Tag name or component rendered for the group label.
|
|
241
|
+
* @default 'div'
|
|
242
|
+
*/
|
|
243
|
+
as?: GhostCommandPaletteLabelElement;
|
|
244
|
+
}
|
|
245
|
+
/** Props for {@link GhostCommandPaletteEmpty}. */
|
|
246
|
+
export interface GhostCommandPaletteEmptyProps {
|
|
247
|
+
/**
|
|
248
|
+
* Tag name or component rendered for the empty message.
|
|
249
|
+
* @default 'div'
|
|
250
|
+
*/
|
|
251
|
+
as?: GhostCommandPaletteEmptyElement;
|
|
252
|
+
}
|
|
253
|
+
/** Props for {@link GhostCommandPaletteSeparator}. */
|
|
254
|
+
export interface GhostCommandPaletteSeparatorProps {
|
|
255
|
+
/**
|
|
256
|
+
* Tag name or component rendered for the divider.
|
|
257
|
+
* @default 'div'
|
|
258
|
+
*/
|
|
259
|
+
as?: GhostCommandPaletteSeparatorElement;
|
|
260
|
+
}
|
|
261
|
+
/** Ref contract shared by every palette part. */
|
|
262
|
+
export interface GhostCommandPalettePartExposed {
|
|
263
|
+
readonly element: HTMLElement | null;
|
|
264
|
+
focus(options?: FocusOptions): void;
|
|
265
|
+
blur(): void;
|
|
266
|
+
}
|
|
267
|
+
/** Methods exposed by a template ref to {@link GhostCommandPalette}. */
|
|
268
|
+
export interface GhostCommandPaletteExposed extends GhostCommandPalettePartExposed {
|
|
269
|
+
/** Opens the palette (no-op while `disabled`). */
|
|
270
|
+
open(): void;
|
|
271
|
+
/** Requests close; a controlled parent may keep it open. */
|
|
272
|
+
close(): void;
|
|
273
|
+
/** Moves focus to the command input when it is mounted. */
|
|
274
|
+
focusInput(): void;
|
|
275
|
+
}
|
|
276
|
+
export type GhostCommandPaletteTriggerExposed = GhostCommandPalettePartExposed;
|
|
277
|
+
export type GhostCommandPaletteOverlayExposed = GhostCommandPalettePartExposed;
|
|
278
|
+
export type GhostCommandPaletteContentExposed = GhostCommandPalettePartExposed;
|
|
279
|
+
export type GhostCommandPaletteTitleExposed = GhostCommandPalettePartExposed;
|
|
280
|
+
export type GhostCommandPaletteInputExposed = GhostCommandPalettePartExposed;
|
|
281
|
+
export type GhostCommandPaletteListExposed = GhostCommandPalettePartExposed;
|
|
282
|
+
export type GhostCommandPaletteItemExposed = GhostCommandPalettePartExposed;
|
|
283
|
+
export type GhostCommandPaletteGroupExposed = GhostCommandPalettePartExposed;
|
|
284
|
+
export type GhostCommandPaletteLabelExposed = GhostCommandPalettePartExposed;
|
|
285
|
+
export type GhostCommandPaletteEmptyExposed = GhostCommandPalettePartExposed;
|
|
286
|
+
export type GhostCommandPaletteSeparatorExposed = GhostCommandPalettePartExposed;
|
|
287
|
+
/** Options for {@link useGhostCommandPalette}. */
|
|
288
|
+
export interface UseGhostCommandPaletteOptions {
|
|
289
|
+
open?: MaybeRefOrGetter<boolean | undefined>;
|
|
290
|
+
defaultOpen?: MaybeRefOrGetter<boolean | undefined>;
|
|
291
|
+
search?: MaybeRefOrGetter<string | undefined>;
|
|
292
|
+
defaultSearch?: MaybeRefOrGetter<string | undefined>;
|
|
293
|
+
loading?: MaybeRefOrGetter<boolean | undefined>;
|
|
294
|
+
modal?: MaybeRefOrGetter<boolean | undefined>;
|
|
295
|
+
disabled?: MaybeRefOrGetter<boolean | undefined>;
|
|
296
|
+
closeOnSelect?: MaybeRefOrGetter<boolean | undefined>;
|
|
297
|
+
closeOnEscape?: MaybeRefOrGetter<boolean | undefined>;
|
|
298
|
+
messages?: MaybeRefOrGetter<GhostComboboxMessages | undefined>;
|
|
299
|
+
onOpenChange?: (open: boolean) => void;
|
|
300
|
+
onSearchChange?: (query: string) => void;
|
|
301
|
+
onSearch?: (payload: GhostCommandPaletteSearchPayload) => void;
|
|
302
|
+
onCommand?: (payload: GhostCommandPaletteCommandPayload) => void;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Dialog part state used by the palette shell parts. Structurally the public
|
|
306
|
+
* `GhostDialogContext` plus the non-modal autofocus flag.
|
|
307
|
+
*/
|
|
308
|
+
export type GhostCommandPaletteDialogContext = GhostDialogContext & {
|
|
309
|
+
openedAtMount: Ref<boolean>;
|
|
310
|
+
};
|
|
311
|
+
/** Reactive state and helpers returned by {@link useGhostCommandPalette}. */
|
|
312
|
+
export interface UseGhostCommandPaletteReturn {
|
|
313
|
+
/** Dialog open state. */
|
|
314
|
+
isOpen: Ref<boolean>;
|
|
315
|
+
/** Current query text. */
|
|
316
|
+
searchValue: Ref<string>;
|
|
317
|
+
loading: ComputedRef<boolean>;
|
|
318
|
+
disabled: ComputedRef<boolean>;
|
|
319
|
+
isModal: ComputedRef<boolean>;
|
|
320
|
+
closeOnEscape: ComputedRef<boolean>;
|
|
321
|
+
/** Opens the palette unless `disabled`. */
|
|
322
|
+
open: () => void;
|
|
323
|
+
/** Requests close. */
|
|
324
|
+
close: () => void;
|
|
325
|
+
/** Focuses the mounted command input. */
|
|
326
|
+
focusInput: () => void;
|
|
327
|
+
/**
|
|
328
|
+
* Emits `command` for an enabled, registered item and, with
|
|
329
|
+
* `closeOnSelect`, requests close. Never commits combobox selection or
|
|
330
|
+
* rewrites the query.
|
|
331
|
+
*/
|
|
332
|
+
activateCommand: (id: string) => void;
|
|
333
|
+
/** Writes the query from user input and emits `search`. */
|
|
334
|
+
setSearchFromInput: (query: string) => void;
|
|
335
|
+
/** Dialog shell state consumed by trigger, overlay, content, and title. */
|
|
336
|
+
dialog: GhostCommandPaletteDialogContext;
|
|
337
|
+
inputId: ComputedRef<string>;
|
|
338
|
+
listId: ComputedRef<string>;
|
|
339
|
+
inputElement: Ref<HTMLElement | null>;
|
|
340
|
+
setInputElement: (element: HTMLElement | null) => void;
|
|
341
|
+
setInputId: (id: string | null) => void;
|
|
342
|
+
/** Called from `focusout` on the content; closes a non-modal palette (C4). */
|
|
343
|
+
notifyFocusOut: (event: FocusEvent) => void;
|
|
344
|
+
/** True while a focus-departure close must not restore focus. */
|
|
345
|
+
focusRestoreSuppressed: Ref<boolean>;
|
|
346
|
+
registerItem: (id: string, textValue: string, disabled: boolean, optionId: string, getElement: () => HTMLElement | null) => void;
|
|
347
|
+
unregisterItem: (id: string) => void;
|
|
348
|
+
setItemDisabled: (id: string, disabled: boolean) => void;
|
|
349
|
+
setItemTextValue: (id: string, textValue: string) => void;
|
|
350
|
+
isItemRegistered: (id: string) => boolean;
|
|
351
|
+
isItemDisabled: (id: string) => boolean;
|
|
352
|
+
itemCount: ComputedRef<number>;
|
|
353
|
+
activeItemId: Ref<string | undefined>;
|
|
354
|
+
activeDescendantId: ComputedRef<string | undefined>;
|
|
355
|
+
moveActive: (direction: 1 | -1) => void;
|
|
356
|
+
moveActiveFirst: () => void;
|
|
357
|
+
moveActiveLast: () => void;
|
|
358
|
+
setActiveItem: (id: string | undefined) => void;
|
|
359
|
+
announceMessage: Ref<string>;
|
|
360
|
+
liveRegionProps: ComputedRef<GhostComboboxLiveRegionProps>;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Context provided by {@link GhostCommandPalette} to its parts: the full
|
|
364
|
+
* {@link useGhostCommandPalette} return value.
|
|
365
|
+
*/
|
|
366
|
+
export type GhostCommandPaletteContext = UseGhostCommandPaletteReturn;
|
|
367
|
+
/** Return type of {@link useGhostCommandPaletteAsyncSearch}. */
|
|
368
|
+
export interface UseGhostCommandPaletteAsyncSearchReturn {
|
|
369
|
+
/** Records `requestId` from a `search` event as the newest request. */
|
|
370
|
+
begin: (requestId: number) => void;
|
|
371
|
+
/** True when `requestId` is still the newest request passed to `begin`. */
|
|
372
|
+
isLatest: (requestId: number) => boolean;
|
|
373
|
+
}
|
|
374
|
+
export declare const ghostCommandPaletteContextKey: InjectionKey<GhostCommandPaletteContext>;
|
|
375
|
+
export declare const ghostCommandPaletteGroupLabelKey: InjectionKey<{
|
|
376
|
+
setLabelId: (id: string | null) => void;
|
|
377
|
+
}>;
|