@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,131 @@
|
|
|
1
|
+
import type { Placement, Strategy } from '@floating-ui/dom';
|
|
2
|
+
import type { Component, ComputedRef, InjectionKey, MaybeRefOrGetter, Ref } from 'vue';
|
|
3
|
+
import { resolvePopoverHtmlElement } from './ghost-popover.js';
|
|
4
|
+
/** @see resolvePopoverHtmlElement */
|
|
5
|
+
export declare const resolveSelectHtmlElement: typeof resolvePopoverHtmlElement;
|
|
6
|
+
/**
|
|
7
|
+
* Id of the `role="listbox"` element inside the content with `contentId`.
|
|
8
|
+
* The trigger's `aria-controls` must name the popup itself; the content root
|
|
9
|
+
* is a presentational positioning wrapper.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ghostSelectListboxId(contentId: string): string;
|
|
12
|
+
export type GhostSelectTriggerElement = string | Component;
|
|
13
|
+
export type GhostSelectContentElement = string | Component;
|
|
14
|
+
export type GhostSelectOptionElement = string | Component;
|
|
15
|
+
export type GhostSelectGroupElement = string | Component;
|
|
16
|
+
export type GhostSelectLabelElement = string | Component;
|
|
17
|
+
export type GhostSelectPlacement = Placement;
|
|
18
|
+
export type GhostSelectStrategy = Strategy;
|
|
19
|
+
export type GhostSelectPadding = number | {
|
|
20
|
+
top?: number;
|
|
21
|
+
right?: number;
|
|
22
|
+
bottom?: number;
|
|
23
|
+
left?: number;
|
|
24
|
+
};
|
|
25
|
+
export type GhostSelectOffsetOptions = number | {
|
|
26
|
+
mainAxis?: number;
|
|
27
|
+
crossAxis?: number;
|
|
28
|
+
alignmentAxis?: number | null;
|
|
29
|
+
};
|
|
30
|
+
export interface GhostSelectFlipOptions {
|
|
31
|
+
mainAxis?: boolean;
|
|
32
|
+
crossAxis?: boolean;
|
|
33
|
+
fallbackPlacements?: GhostSelectPlacement[];
|
|
34
|
+
padding?: GhostSelectPadding;
|
|
35
|
+
boundary?: Element | Element[];
|
|
36
|
+
}
|
|
37
|
+
export interface GhostSelectShiftOptions {
|
|
38
|
+
mainAxis?: boolean;
|
|
39
|
+
crossAxis?: boolean;
|
|
40
|
+
padding?: GhostSelectPadding;
|
|
41
|
+
boundary?: Element | Element[];
|
|
42
|
+
}
|
|
43
|
+
export interface GhostSelectOptionRecord {
|
|
44
|
+
value: string;
|
|
45
|
+
textValue: string;
|
|
46
|
+
disabled: boolean;
|
|
47
|
+
getElement: () => HTMLElement | null;
|
|
48
|
+
}
|
|
49
|
+
export interface GhostSelectContext {
|
|
50
|
+
selectedValue: Ref<string | undefined>;
|
|
51
|
+
isOpen: Ref<boolean>;
|
|
52
|
+
open: () => void;
|
|
53
|
+
close: () => void;
|
|
54
|
+
disabled: ComputedRef<boolean>;
|
|
55
|
+
required: ComputedRef<boolean>;
|
|
56
|
+
invalid: ComputedRef<boolean>;
|
|
57
|
+
placeholder: ComputedRef<string | undefined>;
|
|
58
|
+
defaultTriggerId: ComputedRef<string>;
|
|
59
|
+
defaultContentId: ComputedRef<string>;
|
|
60
|
+
triggerId: ComputedRef<string>;
|
|
61
|
+
contentId: ComputedRef<string>;
|
|
62
|
+
triggerElement: Ref<HTMLElement | null>;
|
|
63
|
+
contentElement: Ref<HTMLElement | null>;
|
|
64
|
+
triggerRegistered: Ref<boolean>;
|
|
65
|
+
openedAtMount: Ref<boolean>;
|
|
66
|
+
setTriggerElement: (element: HTMLElement | null) => void;
|
|
67
|
+
setContentElement: (element: HTMLElement | null) => void;
|
|
68
|
+
setTriggerId: (id: string | null) => void;
|
|
69
|
+
setContentId: (id: string | null) => void;
|
|
70
|
+
setTriggerRegistered: (registered: boolean) => void;
|
|
71
|
+
registerOption: (value: string, textValue: string, disabled: boolean, getElement: () => HTMLElement | null) => void;
|
|
72
|
+
unregisterOption: (value: string) => void;
|
|
73
|
+
setOptionDisabled: (value: string, disabled: boolean) => void;
|
|
74
|
+
setOptionTextValue: (value: string, textValue: string) => void;
|
|
75
|
+
select: (value: string) => void;
|
|
76
|
+
isSelected: (value: string) => boolean;
|
|
77
|
+
isOptionDisabled: (value: string) => boolean;
|
|
78
|
+
optionOrder: ComputedRef<string[]>;
|
|
79
|
+
getOptionText: (value: string) => string | undefined;
|
|
80
|
+
handleTypeahead: (event: KeyboardEvent) => void;
|
|
81
|
+
focusOptionByValue: (value: string) => void;
|
|
82
|
+
focusFirstEnabledOption: (fromEnd?: boolean) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Set by the trigger when it opens the list: `true` when focus should
|
|
85
|
+
* start on the last enabled option (ArrowUp) if nothing is selected.
|
|
86
|
+
*/
|
|
87
|
+
openFocusFromEnd: Ref<boolean>;
|
|
88
|
+
labelVersion: Ref<number>;
|
|
89
|
+
}
|
|
90
|
+
export declare const ghostSelectContextKey: InjectionKey<GhostSelectContext>;
|
|
91
|
+
export interface GhostSelectTriggerExposed {
|
|
92
|
+
readonly element: HTMLElement | null;
|
|
93
|
+
focus(options?: FocusOptions): void;
|
|
94
|
+
blur(): void;
|
|
95
|
+
}
|
|
96
|
+
export interface GhostSelectContentExposed {
|
|
97
|
+
readonly element: HTMLElement | null;
|
|
98
|
+
focus(options?: FocusOptions): void;
|
|
99
|
+
blur(): void;
|
|
100
|
+
}
|
|
101
|
+
export interface GhostSelectOptionExposed {
|
|
102
|
+
readonly element: HTMLElement | null;
|
|
103
|
+
focus(options?: FocusOptions): void;
|
|
104
|
+
blur(): void;
|
|
105
|
+
}
|
|
106
|
+
export interface GhostSelectExposed {
|
|
107
|
+
readonly element: HTMLElement | null;
|
|
108
|
+
focus(options?: FocusOptions): void;
|
|
109
|
+
blur(): void;
|
|
110
|
+
}
|
|
111
|
+
/** Overridable internal strings for {@link GhostSelect}. */
|
|
112
|
+
export interface GhostSelectMessages {
|
|
113
|
+
/** Native constraint validation message when `required` and empty. @default 'Select a value.' */
|
|
114
|
+
required?: string;
|
|
115
|
+
}
|
|
116
|
+
export interface UseGhostSelectOptions {
|
|
117
|
+
modelValue?: MaybeRefOrGetter<string | undefined>;
|
|
118
|
+
defaultValue?: MaybeRefOrGetter<string | undefined>;
|
|
119
|
+
open?: MaybeRefOrGetter<boolean | undefined>;
|
|
120
|
+
defaultOpen?: MaybeRefOrGetter<boolean | undefined>;
|
|
121
|
+
disabled?: MaybeRefOrGetter<boolean | undefined>;
|
|
122
|
+
required?: MaybeRefOrGetter<boolean | undefined>;
|
|
123
|
+
invalid?: MaybeRefOrGetter<boolean | undefined>;
|
|
124
|
+
name?: MaybeRefOrGetter<string | undefined>;
|
|
125
|
+
form?: MaybeRefOrGetter<string | undefined>;
|
|
126
|
+
placeholder?: MaybeRefOrGetter<string | undefined>;
|
|
127
|
+
messages?: MaybeRefOrGetter<GhostSelectMessages | undefined>;
|
|
128
|
+
onValueChange?: (value: string | undefined) => void;
|
|
129
|
+
onOpenChange?: (open: boolean) => void;
|
|
130
|
+
getFormInput?: () => HTMLInputElement | null;
|
|
131
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Closed union: `hr` is the native thematic break, `div` hosts vertical rules,
|
|
4
|
+
* `li` is valid in a list-shaped menu (`role="menu"`). Widening is additive.
|
|
5
|
+
*/
|
|
6
|
+
export type GhostSeparatorElement = 'hr' | 'div' | 'li';
|
|
7
|
+
/** Axis of the divider line. */
|
|
8
|
+
export type GhostSeparatorOrientation = 'horizontal' | 'vertical';
|
|
9
|
+
/** Props for the unstyled {@link GhostSeparator} component. */
|
|
10
|
+
export interface GhostSeparatorProps {
|
|
11
|
+
/**
|
|
12
|
+
* Root tag valid in the parent context (`li` in a list). Omit to get `hr`
|
|
13
|
+
* for horizontal and `div` for vertical.
|
|
14
|
+
*/
|
|
15
|
+
as?: GhostSeparatorElement;
|
|
16
|
+
/**
|
|
17
|
+
* When true, the line is presentational (`role="none"`). Defaults false so
|
|
18
|
+
* native `hr` and menu/toolbar grouping keep separator semantics.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
decorative?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Axis of the line. Vertical has no native element, so the default `as` is `div`.
|
|
24
|
+
* @default 'horizontal'
|
|
25
|
+
*/
|
|
26
|
+
orientation?: GhostSeparatorOrientation;
|
|
27
|
+
}
|
|
28
|
+
/** Options for {@link useGhostSeparator}. */
|
|
29
|
+
export interface UseGhostSeparatorOptions {
|
|
30
|
+
as?: MaybeRefOrGetter<GhostSeparatorElement | undefined>;
|
|
31
|
+
decorative?: MaybeRefOrGetter<boolean | undefined>;
|
|
32
|
+
orientation?: MaybeRefOrGetter<GhostSeparatorOrientation | undefined>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Closed union: interactive/void tags would become tab stops inside an
|
|
3
|
+
* `aria-hidden` tree or cannot hold a box. Widening is additive; narrowing
|
|
4
|
+
* is breaking.
|
|
5
|
+
*/
|
|
6
|
+
export type GhostSkeletonElement = 'span' | 'div' | 'p' | 'li' | 'td' | 'th';
|
|
7
|
+
/** Props for the unstyled {@link GhostSkeleton} component. */
|
|
8
|
+
export interface GhostSkeletonProps {
|
|
9
|
+
/**
|
|
10
|
+
* Root tag valid in the parent context (`td` in a row, `li` in a list).
|
|
11
|
+
* @default 'span'
|
|
12
|
+
*/
|
|
13
|
+
as?: GhostSkeletonElement;
|
|
14
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { HTMLAttributes, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
export type GhostSliderOrientation = 'horizontal' | 'vertical';
|
|
3
|
+
export type GhostSliderValue = number | readonly [number, number];
|
|
4
|
+
/** Overridable internal range-naming strings and formatters for {@link GhostSlider}. */
|
|
5
|
+
export interface GhostSliderMessages {
|
|
6
|
+
/**
|
|
7
|
+
* Minimum-thumb hint text for range sliders.
|
|
8
|
+
* Used both in the visually hidden hint referenced by `aria-labelledby` and
|
|
9
|
+
* as the default suffix when `aria-label` is set without `formatMinimumLabel`.
|
|
10
|
+
* @default 'minimum'
|
|
11
|
+
*/
|
|
12
|
+
minimum?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Maximum-thumb hint text for range sliders.
|
|
15
|
+
* Used both in the visually hidden hint referenced by `aria-labelledby` and
|
|
16
|
+
* as the default suffix when `aria-label` is set without `formatMaximumLabel`.
|
|
17
|
+
* @default 'maximum'
|
|
18
|
+
*/
|
|
19
|
+
maximum?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional formatter for the minimum thumb `aria-label` in range mode when
|
|
22
|
+
* the root uses `aria-label`. Defaults to `` `${label} ${minimum}` ``.
|
|
23
|
+
*/
|
|
24
|
+
formatMinimumLabel?: (label: string) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Optional formatter for the maximum thumb `aria-label` in range mode when
|
|
27
|
+
* the root uses `aria-label`. Defaults to `` `${label} ${maximum}` ``.
|
|
28
|
+
*/
|
|
29
|
+
formatMaximumLabel?: (label: string) => string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Unstyled {@link GhostSlider} props. Native attributes fall through to the root
|
|
33
|
+
* track container.
|
|
34
|
+
*/
|
|
35
|
+
export interface GhostSliderProps extends /* @vue-ignore */ HTMLAttributes {
|
|
36
|
+
/**
|
|
37
|
+
* Controlled value. Single-thumb mode uses a number; `range` uses a tuple.
|
|
38
|
+
* Omit for uncontrolled mode.
|
|
39
|
+
*/
|
|
40
|
+
modelValue?: GhostSliderValue;
|
|
41
|
+
/**
|
|
42
|
+
* Initial value when `modelValue` is omitted. Captured at mount for reset.
|
|
43
|
+
*/
|
|
44
|
+
defaultValue?: GhostSliderValue;
|
|
45
|
+
/** @default 0 */
|
|
46
|
+
min?: number;
|
|
47
|
+
/** @default 100 */
|
|
48
|
+
max?: number;
|
|
49
|
+
/** @default 1 */
|
|
50
|
+
step?: number;
|
|
51
|
+
/** Two-thumb interval selection. @default false */
|
|
52
|
+
range?: boolean;
|
|
53
|
+
/** @default 'horizontal' */
|
|
54
|
+
orientation?: GhostSliderOrientation;
|
|
55
|
+
/** @default false */
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
/** Hidden input name for the primary (low / only) value. */
|
|
58
|
+
name?: string;
|
|
59
|
+
/** Hidden input name for the high thumb when `range` is true. */
|
|
60
|
+
nameMax?: string;
|
|
61
|
+
/** Associates hidden inputs with an external form id. */
|
|
62
|
+
form?: string;
|
|
63
|
+
/** Optional `aria-valuetext` for the sole thumb in single mode. */
|
|
64
|
+
valueText?: string;
|
|
65
|
+
/** Overridable range-thumb naming strings and formatters. */
|
|
66
|
+
messages?: GhostSliderMessages;
|
|
67
|
+
}
|
|
68
|
+
export interface UseGhostSliderOptions {
|
|
69
|
+
modelValue?: MaybeRefOrGetter<GhostSliderValue | undefined>;
|
|
70
|
+
defaultValue?: MaybeRefOrGetter<GhostSliderValue | undefined>;
|
|
71
|
+
min?: MaybeRefOrGetter<number | undefined>;
|
|
72
|
+
max?: MaybeRefOrGetter<number | undefined>;
|
|
73
|
+
step?: MaybeRefOrGetter<number | undefined>;
|
|
74
|
+
range?: MaybeRefOrGetter<boolean | undefined>;
|
|
75
|
+
orientation?: MaybeRefOrGetter<GhostSliderOrientation | undefined>;
|
|
76
|
+
disabled?: MaybeRefOrGetter<boolean | undefined>;
|
|
77
|
+
name?: MaybeRefOrGetter<string | undefined>;
|
|
78
|
+
nameMax?: MaybeRefOrGetter<string | undefined>;
|
|
79
|
+
form?: MaybeRefOrGetter<string | undefined>;
|
|
80
|
+
valueText?: MaybeRefOrGetter<string | undefined>;
|
|
81
|
+
label?: MaybeRefOrGetter<string | undefined>;
|
|
82
|
+
/** Copied from root `aria-labelledby` for thumb sliders. */
|
|
83
|
+
ariaLabelledby?: MaybeRefOrGetter<string | undefined>;
|
|
84
|
+
/** Visually hidden range-end hint ids paired with `ariaLabelledby` on each thumb. */
|
|
85
|
+
rangeEndLabelIds?: MaybeRefOrGetter<{
|
|
86
|
+
minimum: string;
|
|
87
|
+
maximum: string;
|
|
88
|
+
} | undefined>;
|
|
89
|
+
messages?: MaybeRefOrGetter<GhostSliderMessages | undefined>;
|
|
90
|
+
onChange?: (value: GhostSliderValue) => void;
|
|
91
|
+
root?: MaybeRefOrGetter<HTMLElement | null | undefined>;
|
|
92
|
+
}
|
|
93
|
+
/** Methods available from a template ref to {@link GhostSlider}. */
|
|
94
|
+
export interface GhostSliderExposed {
|
|
95
|
+
readonly element: HTMLElement | null;
|
|
96
|
+
readonly value: GhostSliderValue;
|
|
97
|
+
focus(options?: FocusOptions): void;
|
|
98
|
+
blur(): void;
|
|
99
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { HTMLAttributes, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Unstyled {@link GhostSpinner} props. `@vue-ignore` keeps native attributes as
|
|
4
|
+
* fallthrough at runtime while typing the full span contract for consumers.
|
|
5
|
+
*/
|
|
6
|
+
export interface GhostSpinnerProps extends /* @vue-ignore */ HTMLAttributes {
|
|
7
|
+
/**
|
|
8
|
+
* Status message rendered as visually hidden live-region content.
|
|
9
|
+
* `role="status"` takes its accessible name from the author, so this string
|
|
10
|
+
* is what assistive technology announces, not `aria-label`.
|
|
11
|
+
* @default 'Loading'
|
|
12
|
+
*/
|
|
13
|
+
label?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Options for {@link useGhostSpinner}. */
|
|
16
|
+
export interface UseGhostSpinnerOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Status message. Defaults to `'Loading'`.
|
|
19
|
+
* @default 'Loading'
|
|
20
|
+
*/
|
|
21
|
+
label?: MaybeRefOrGetter<string | undefined>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Unstyled {@link GhostSwitch} props. `@vue-ignore` keeps native attributes as
|
|
4
|
+
* fallthrough at runtime while typing the full button contract for consumers.
|
|
5
|
+
* `name`, `value`, and `form` are declared so they route to the hidden form
|
|
6
|
+
* input rather than the button.
|
|
7
|
+
*/
|
|
8
|
+
export interface GhostSwitchProps extends /* @vue-ignore */ ButtonHTMLAttributes {
|
|
9
|
+
/**
|
|
10
|
+
* Controlled on/off. Omit for uncontrolled mode. `undefined` is required as
|
|
11
|
+
* the default so Vue does not coerce an omitted boolean prop to `false`.
|
|
12
|
+
*/
|
|
13
|
+
modelValue?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Initial on/off when `modelValue` is omitted. Later changes are ignored.
|
|
16
|
+
* Form reset restores this mounted value.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
defaultValue?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Native disabled: not focusable, not operable, not submitted.
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Focusable but not user-operable. Still submitted. Programmatic model
|
|
27
|
+
* writes still apply. Not a native button attribute; expressed as
|
|
28
|
+
* `aria-readonly`.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
readonly?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Form field name. When set, a hidden input submits `name=value` while on
|
|
34
|
+
* and enabled.
|
|
35
|
+
*/
|
|
36
|
+
name?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Submitted string when on. Same default as a native checkbox.
|
|
39
|
+
* @default 'on'
|
|
40
|
+
*/
|
|
41
|
+
value?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Associates the hidden input (and the button `form` IDL) with an external
|
|
44
|
+
* form id.
|
|
45
|
+
*/
|
|
46
|
+
form?: string;
|
|
47
|
+
}
|
|
48
|
+
/** Options for {@link useGhostSwitch}. */
|
|
49
|
+
export interface UseGhostSwitchOptions {
|
|
50
|
+
modelValue?: MaybeRefOrGetter<boolean | undefined>;
|
|
51
|
+
defaultValue?: MaybeRefOrGetter<boolean | undefined>;
|
|
52
|
+
disabled?: MaybeRefOrGetter<boolean | undefined>;
|
|
53
|
+
readonly?: MaybeRefOrGetter<boolean | undefined>;
|
|
54
|
+
name?: MaybeRefOrGetter<string | undefined>;
|
|
55
|
+
value?: MaybeRefOrGetter<string | undefined>;
|
|
56
|
+
form?: MaybeRefOrGetter<string | undefined>;
|
|
57
|
+
/** Synchronous `update:modelValue` write. */
|
|
58
|
+
onChange?: (checked: boolean) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Mounted button, used to find `button.form` for native reset. Omit when
|
|
61
|
+
* the composable host does not participate in forms.
|
|
62
|
+
*/
|
|
63
|
+
element?: MaybeRefOrGetter<HTMLButtonElement | null | undefined>;
|
|
64
|
+
}
|
|
65
|
+
/** Methods and state available from a template ref to {@link GhostSwitch}. */
|
|
66
|
+
export interface GhostSwitchExposed {
|
|
67
|
+
/** The native switch button after mount, or `null` before mount. */
|
|
68
|
+
readonly element: HTMLButtonElement | null;
|
|
69
|
+
/** Current on/off. */
|
|
70
|
+
readonly checked: boolean;
|
|
71
|
+
/** User-activation toggle. No-op when disabled or readonly. */
|
|
72
|
+
toggle(): void;
|
|
73
|
+
/** Moves focus to the native button when it is mounted and enabled. */
|
|
74
|
+
focus(options?: FocusOptions): void;
|
|
75
|
+
/** Removes focus from the native button when it is mounted. */
|
|
76
|
+
blur(): void;
|
|
77
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { HTMLAttributes, InjectionKey, Ref } from 'vue';
|
|
2
|
+
/** Shared {@link GhostTable} context for caption id registration. */
|
|
3
|
+
export interface GhostTableContext {
|
|
4
|
+
captionId: Ref<string | undefined>;
|
|
5
|
+
setCaptionId(id: string | undefined): void;
|
|
6
|
+
}
|
|
7
|
+
export declare const ghostTableContextKey: InjectionKey<GhostTableContext>;
|
|
8
|
+
/** Valid `scope` values for {@link GhostTableHeaderCell}. */
|
|
9
|
+
export type GhostTableHeaderScope = 'col' | 'row' | 'colgroup' | 'rowgroup';
|
|
10
|
+
/** Props for {@link GhostTable}. */
|
|
11
|
+
export interface GhostTableProps {
|
|
12
|
+
/**
|
|
13
|
+
* When true, wraps the table in a scroll container for explicit horizontal
|
|
14
|
+
* overflow. The table itself never receives implicit overflow.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
containHorizontal?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Accessible name for the horizontal scroll region. When omitted and a
|
|
20
|
+
* {@link GhostTableCaption} is rendered, the scroll region uses `aria-labelledby`
|
|
21
|
+
* on the caption id.
|
|
22
|
+
*/
|
|
23
|
+
scrollLabel?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Props for {@link GhostTableHeaderCell}. */
|
|
26
|
+
export interface GhostTableHeaderCellProps {
|
|
27
|
+
/** Header relationship for assistive technology. */
|
|
28
|
+
scope?: GhostTableHeaderScope;
|
|
29
|
+
}
|
|
30
|
+
/** Shared fallthrough for table section parts. */
|
|
31
|
+
export type GhostTableSectionProps = HTMLAttributes;
|
|
32
|
+
export type GhostTableCaptionProps = HTMLAttributes;
|
|
33
|
+
export type GhostTableRowProps = HTMLAttributes;
|
|
34
|
+
export type GhostTableCellProps = HTMLAttributes;
|
|
35
|
+
export interface UseGhostTableOptions {
|
|
36
|
+
containHorizontal?: () => boolean | undefined;
|
|
37
|
+
scrollLabel?: () => string | undefined;
|
|
38
|
+
captionId?: () => string | undefined;
|
|
39
|
+
}
|
|
40
|
+
export interface UseGhostTableHeaderCellOptions {
|
|
41
|
+
scope?: () => GhostTableHeaderScope | undefined;
|
|
42
|
+
}
|
|
43
|
+
/** Methods and state available from a template ref to {@link GhostTable}. */
|
|
44
|
+
export interface GhostTableExposed {
|
|
45
|
+
/** The native table after mount, or `null` before mount and after unmount. */
|
|
46
|
+
readonly element: HTMLTableElement | null;
|
|
47
|
+
}
|
|
48
|
+
export interface GhostTableCaptionExposed {
|
|
49
|
+
readonly element: HTMLTableCaptionElement | null;
|
|
50
|
+
}
|
|
51
|
+
export interface GhostTableSectionExposed {
|
|
52
|
+
readonly element: HTMLTableSectionElement | null;
|
|
53
|
+
}
|
|
54
|
+
export interface GhostTableRowExposed {
|
|
55
|
+
readonly element: HTMLTableRowElement | null;
|
|
56
|
+
}
|
|
57
|
+
export interface GhostTableHeaderCellExposed {
|
|
58
|
+
readonly element: HTMLTableCellElement | null;
|
|
59
|
+
}
|
|
60
|
+
export interface GhostTableCellExposed {
|
|
61
|
+
readonly element: HTMLTableCellElement | null;
|
|
62
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { Component, ComputedRef, InjectionKey, MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
+
import type { TextDirection } from './use-roving-focus.js';
|
|
3
|
+
/** Valid `as` targets for {@link GhostTabsList}. */
|
|
4
|
+
export type GhostTabsListElement = string | Component;
|
|
5
|
+
/** Valid `as` targets for {@link GhostTabsTrigger}. */
|
|
6
|
+
export type GhostTabsTriggerElement = string | Component;
|
|
7
|
+
/** Valid `as` targets for {@link GhostTabsContent}. */
|
|
8
|
+
export type GhostTabsContentElement = string | Component;
|
|
9
|
+
export type GhostTabsActivationMode = 'automatic' | 'manual';
|
|
10
|
+
export type GhostTabsOrientation = 'horizontal' | 'vertical';
|
|
11
|
+
/** Props for the {@link GhostTabs} root provider component. */
|
|
12
|
+
export interface GhostTabsProps {
|
|
13
|
+
/**
|
|
14
|
+
* Controlled selected tab value. Omit to run uncontrolled from `defaultValue`.
|
|
15
|
+
* @default undefined
|
|
16
|
+
*/
|
|
17
|
+
modelValue?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Initial selected value when `modelValue` is omitted. When omitted, the first
|
|
20
|
+
* mounted trigger value is selected.
|
|
21
|
+
* @default undefined
|
|
22
|
+
*/
|
|
23
|
+
defaultValue?: string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Whether focus alone activates a tab (`automatic`) or activation requires
|
|
26
|
+
* click/Enter/Space (`manual`).
|
|
27
|
+
* @default 'automatic'
|
|
28
|
+
*/
|
|
29
|
+
activationMode?: GhostTabsActivationMode;
|
|
30
|
+
/**
|
|
31
|
+
* Tab strip layout; drives roving arrow keys and `aria-orientation` on the list.
|
|
32
|
+
* @default 'horizontal'
|
|
33
|
+
*/
|
|
34
|
+
orientation?: GhostTabsOrientation;
|
|
35
|
+
/**
|
|
36
|
+
* Explicit text direction for roving focus. When omitted, inferred from the list.
|
|
37
|
+
*/
|
|
38
|
+
dir?: TextDirection;
|
|
39
|
+
}
|
|
40
|
+
/** Props passed to the {@link GhostTabs} default slot. */
|
|
41
|
+
export interface GhostTabsSlotProps {
|
|
42
|
+
modelValue: string | undefined;
|
|
43
|
+
}
|
|
44
|
+
/** Props for {@link GhostTabsList}. */
|
|
45
|
+
export interface GhostTabsListProps {
|
|
46
|
+
/**
|
|
47
|
+
* Tag name or component rendered for the tab list.
|
|
48
|
+
* @default 'div'
|
|
49
|
+
*/
|
|
50
|
+
as?: GhostTabsListElement;
|
|
51
|
+
}
|
|
52
|
+
/** Props for {@link GhostTabsTrigger}. */
|
|
53
|
+
export interface GhostTabsTriggerProps {
|
|
54
|
+
/**
|
|
55
|
+
* Tag name or component rendered for the tab control.
|
|
56
|
+
* @default 'button'
|
|
57
|
+
*/
|
|
58
|
+
as?: GhostTabsTriggerElement;
|
|
59
|
+
/** Stable value identifying this tab and its panel. */
|
|
60
|
+
value: string;
|
|
61
|
+
/**
|
|
62
|
+
* Disables selection and removes the tab from roving focus.
|
|
63
|
+
* @default false
|
|
64
|
+
*/
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/** Props for {@link GhostTabsContent}. */
|
|
68
|
+
export interface GhostTabsContentProps {
|
|
69
|
+
/**
|
|
70
|
+
* Tag name or component rendered for the tab panel.
|
|
71
|
+
* @default 'div'
|
|
72
|
+
*/
|
|
73
|
+
as?: GhostTabsContentElement;
|
|
74
|
+
/** Panel value; must match a {@link GhostTabsTrigger} `value`. */
|
|
75
|
+
value: string;
|
|
76
|
+
}
|
|
77
|
+
/** Methods and state exposed by a template ref to {@link GhostTabsList}. */
|
|
78
|
+
export interface GhostTabsListExposed {
|
|
79
|
+
readonly element: HTMLElement | null;
|
|
80
|
+
focus(options?: FocusOptions): void;
|
|
81
|
+
blur(): void;
|
|
82
|
+
}
|
|
83
|
+
/** Methods and state exposed by a template ref to {@link GhostTabsTrigger}. */
|
|
84
|
+
export interface GhostTabsTriggerExposed {
|
|
85
|
+
readonly element: HTMLElement | null;
|
|
86
|
+
focus(options?: FocusOptions): void;
|
|
87
|
+
blur(): void;
|
|
88
|
+
}
|
|
89
|
+
/** Methods and state exposed by a template ref to {@link GhostTabsContent}. */
|
|
90
|
+
export interface GhostTabsContentExposed {
|
|
91
|
+
readonly element: HTMLElement | null;
|
|
92
|
+
focus(options?: FocusOptions): void;
|
|
93
|
+
blur(): void;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Renderless {@link GhostTabs} exposes no root element; `element` is always `null`.
|
|
97
|
+
*/
|
|
98
|
+
export interface GhostTabsExposed {
|
|
99
|
+
readonly element: HTMLElement | null;
|
|
100
|
+
}
|
|
101
|
+
/** Options for {@link useGhostTabs}. */
|
|
102
|
+
export interface UseGhostTabsOptions {
|
|
103
|
+
modelValue?: MaybeRefOrGetter<string | undefined>;
|
|
104
|
+
defaultValue?: MaybeRefOrGetter<string | undefined>;
|
|
105
|
+
activationMode?: MaybeRefOrGetter<GhostTabsActivationMode>;
|
|
106
|
+
orientation?: MaybeRefOrGetter<GhostTabsOrientation>;
|
|
107
|
+
dir?: MaybeRefOrGetter<TextDirection | undefined>;
|
|
108
|
+
onValueChange?: (value: string) => void;
|
|
109
|
+
}
|
|
110
|
+
/** Reactive state and helpers returned by {@link useGhostTabs}. */
|
|
111
|
+
export interface UseGhostTabsReturn {
|
|
112
|
+
modelValue: Ref<string | undefined>;
|
|
113
|
+
activationMode: ComputedRef<GhostTabsActivationMode>;
|
|
114
|
+
orientation: ComputedRef<GhostTabsOrientation>;
|
|
115
|
+
dir: ComputedRef<TextDirection | undefined>;
|
|
116
|
+
select: (value: string) => void;
|
|
117
|
+
isSelected: (value: string) => boolean;
|
|
118
|
+
registerTrigger: (value: string, triggerId: string, disabled: boolean) => void;
|
|
119
|
+
setTriggerDisabled: (value: string, disabled: boolean) => void;
|
|
120
|
+
unregisterTrigger: (value: string) => void;
|
|
121
|
+
tabStopValue: ComputedRef<string | undefined>;
|
|
122
|
+
registerPanel: (value: string, panelId: string) => void;
|
|
123
|
+
unregisterPanel: (value: string) => void;
|
|
124
|
+
getTriggerId: (value: string) => string | undefined;
|
|
125
|
+
getPanelId: (value: string) => string | undefined;
|
|
126
|
+
defaultUncontrolled: ComputedRef<boolean>;
|
|
127
|
+
registryVersion: Ref<number>;
|
|
128
|
+
}
|
|
129
|
+
/** Internal context shared between `GhostTabs` parts. */
|
|
130
|
+
export interface GhostTabsContext {
|
|
131
|
+
modelValue: Ref<string | undefined>;
|
|
132
|
+
activationMode: ComputedRef<GhostTabsActivationMode>;
|
|
133
|
+
orientation: ComputedRef<GhostTabsOrientation>;
|
|
134
|
+
dir: ComputedRef<TextDirection | undefined>;
|
|
135
|
+
select: (value: string) => void;
|
|
136
|
+
isSelected: (value: string) => boolean;
|
|
137
|
+
registerTrigger: (value: string, triggerId: string, disabled: boolean) => void;
|
|
138
|
+
setTriggerDisabled: (value: string, disabled: boolean) => void;
|
|
139
|
+
unregisterTrigger: (value: string) => void;
|
|
140
|
+
tabStopValue: ComputedRef<string | undefined>;
|
|
141
|
+
syncSelectionTabStops: (listRoot: HTMLElement) => void;
|
|
142
|
+
registerPanel: (value: string, panelId: string) => void;
|
|
143
|
+
unregisterPanel: (value: string) => void;
|
|
144
|
+
getTriggerId: (value: string) => string | undefined;
|
|
145
|
+
getPanelId: (value: string) => string | undefined;
|
|
146
|
+
registryVersion: Ref<number>;
|
|
147
|
+
}
|
|
148
|
+
export declare const ghostTabsContextKey: InjectionKey<GhostTabsContext>;
|
|
149
|
+
/**
|
|
150
|
+
* Resolves a DOM element from either a raw element or a component ref
|
|
151
|
+
* (preferring exposed `.element` over `.$el` so wrappers like themed
|
|
152
|
+
* `GhostButton` with a `display: contents` scope resolve to their inner control).
|
|
153
|
+
*/
|
|
154
|
+
export declare function resolveTabsHtmlElement(target: unknown): HTMLElement | null;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter, TextareaHTMLAttributes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Unstyled {@link GhostTextarea} props. `@vue-ignore` keeps native attributes as
|
|
4
|
+
* fallthrough at runtime while typing the full textarea contract for consumers.
|
|
5
|
+
*/
|
|
6
|
+
export interface GhostTextareaProps extends /* @vue-ignore */ TextareaHTMLAttributes {
|
|
7
|
+
/**
|
|
8
|
+
* Controlled value. Omit for uncontrolled mode; `''` is a defined empty string.
|
|
9
|
+
*/
|
|
10
|
+
modelValue?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Initial uncontrolled value. Later changes are ignored.
|
|
13
|
+
* @default ''
|
|
14
|
+
*/
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Native disabled semantics: not focusable, not editable, omitted from submit.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Native readonly semantics: focusable and submitted, but the UA rejects edits.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
readonly?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Consumer-owned invalid state. Sets `aria-invalid="true"`; error copy belongs
|
|
28
|
+
* to Field or the surrounding form.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
invalid?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Native required constraint. Validation messaging stays with the form.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
required?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Native `rows`. Matches the HTML default so SSR and the UA agree. Auto-resize
|
|
39
|
+
* uses this as the minimum height.
|
|
40
|
+
* @default 2
|
|
41
|
+
*/
|
|
42
|
+
rows?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Auto-resize ceiling in rows. Ignored unless `autoResize` is true. When set
|
|
45
|
+
* below `rows`, `rows` wins as both min and max.
|
|
46
|
+
*/
|
|
47
|
+
maxRows?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Grow the field with its content after mount. Off so native resize and a
|
|
50
|
+
* fixed `rows` height stay the ordinary path.
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
autoResize?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/** Options for {@link useGhostTextarea}. */
|
|
56
|
+
export interface UseGhostTextareaOptions {
|
|
57
|
+
modelValue?: MaybeRefOrGetter<string | undefined>;
|
|
58
|
+
defaultValue?: MaybeRefOrGetter<string | undefined>;
|
|
59
|
+
disabled?: MaybeRefOrGetter<boolean | undefined>;
|
|
60
|
+
readonly?: MaybeRefOrGetter<boolean | undefined>;
|
|
61
|
+
invalid?: MaybeRefOrGetter<boolean | undefined>;
|
|
62
|
+
required?: MaybeRefOrGetter<boolean | undefined>;
|
|
63
|
+
rows?: MaybeRefOrGetter<number | undefined>;
|
|
64
|
+
maxRows?: MaybeRefOrGetter<number | undefined>;
|
|
65
|
+
autoResize?: MaybeRefOrGetter<boolean | undefined>;
|
|
66
|
+
/** Host used for auto-resize measurement. Omit when calling `resize()` yourself. */
|
|
67
|
+
element?: MaybeRefOrGetter<HTMLTextAreaElement | null | undefined>;
|
|
68
|
+
onValueChange?: (value: string) => void;
|
|
69
|
+
}
|
|
70
|
+
/** Methods and state available from a template ref to {@link GhostTextarea}. */
|
|
71
|
+
export interface GhostTextareaExposed {
|
|
72
|
+
/** The native textarea after mount, or `null` before mount. */
|
|
73
|
+
readonly element: HTMLTextAreaElement | null;
|
|
74
|
+
/** Moves focus to the native textarea when it is mounted and enabled. */
|
|
75
|
+
focus(options?: FocusOptions): void;
|
|
76
|
+
/** Removes focus from the native textarea when it is mounted. */
|
|
77
|
+
blur(): void;
|
|
78
|
+
}
|