@ghostvue/vue 0.0.0-stage → 0.2.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/GhostCheckboxGroup.vue.d.ts +24 -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 +31 -0
- package/dist/GhostFieldControl.vue.d.ts +13 -0
- package/dist/GhostFieldDescription.vue.d.ts +21 -0
- package/dist/GhostFieldError.vue.d.ts +18 -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/GhostForm.vue.d.ts +25 -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/GhostPresence.vue.d.ts +27 -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 +24 -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 +14 -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/GhostSubmenu.vue.d.ts +23 -0
- package/dist/GhostSubmenuContent.vue.d.ts +20 -0
- package/dist/GhostSubmenuTrigger.vue.d.ts +17 -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/GhostTagsInput.vue.d.ts +26 -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 +179 -0
- package/dist/dialog-shared.d.ts +178 -0
- package/dist/dismissable-layer-stack.d.ts +28 -0
- package/dist/form-reset.d.ts +29 -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-group.d.ts +88 -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 +256 -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 +172 -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-form.d.ts +273 -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-presence.d.ts +78 -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 +188 -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-submenu.d.ts +20 -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-tags-input.d.ts +41 -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 +48 -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 +19653 -0
- package/dist/has-tabbable-descendants.d.ts +2 -0
- package/dist/index.d.ts +322 -0
- package/dist/invoke-attr-handler.d.ts +15 -0
- package/dist/is-ime-composing.d.ts +28 -0
- package/dist/manifest.json +18406 -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/track-reactive-reads.d.ts +13 -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 +48 -0
- package/dist/use-floating.d.ts +38 -0
- package/dist/use-focus-scope.d.ts +41 -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-group.d.ts +13 -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-form.d.ts +7 -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-branch.d.ts +54 -0
- package/dist/use-ghost-menu-collection.d.ts +30 -0
- package/dist/use-ghost-menu-root.d.ts +13 -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-presence.d.ts +48 -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 +62 -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 +22 -0
- package/dist/use-scroll-lock.d.ts +13 -0
- package/package.json +60 -4
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import type { Placement, Strategy } from '@floating-ui/dom';
|
|
2
|
+
import type { Component, ComputedRef, InjectionKey, MaybeRefOrGetter, Ref } from 'vue';
|
|
3
|
+
import type { GhostPortalTarget } from './ghost-portal.js';
|
|
4
|
+
/** Valid `as` targets for the {@link GhostMenubar} root. */
|
|
5
|
+
export type GhostMenubarElement = string | Component;
|
|
6
|
+
/** Valid `as` targets for {@link GhostMenubarTrigger}. */
|
|
7
|
+
export type GhostMenubarTriggerElement = string | Component;
|
|
8
|
+
/** Valid `as` targets for {@link GhostMenubarContent}. */
|
|
9
|
+
export type GhostMenubarContentElement = string | Component;
|
|
10
|
+
/** Valid `as` targets for {@link GhostMenubarItem}. */
|
|
11
|
+
export type GhostMenubarItemElement = string | Component;
|
|
12
|
+
/** Valid `as` targets for {@link GhostMenubarGroup}. */
|
|
13
|
+
export type GhostMenubarGroupElement = string | Component;
|
|
14
|
+
/** Valid `as` targets for {@link GhostMenubarLabel}. */
|
|
15
|
+
export type GhostMenubarLabelElement = string | Component;
|
|
16
|
+
/** Valid `as` targets for {@link GhostMenubarSeparator}. */
|
|
17
|
+
export type GhostMenubarSeparatorElement = string | Component;
|
|
18
|
+
/** Valid `as` targets for {@link GhostMenubarCheckboxItem}. */
|
|
19
|
+
export type GhostMenubarCheckboxItemElement = string | Component;
|
|
20
|
+
/** Valid `as` targets for {@link GhostMenubarRadioGroup}. */
|
|
21
|
+
export type GhostMenubarRadioGroupElement = string | Component;
|
|
22
|
+
/** Valid `as` targets for {@link GhostMenubarRadioItem}. */
|
|
23
|
+
export type GhostMenubarRadioItemElement = string | Component;
|
|
24
|
+
/** Supported floating placements relative to the trigger anchor. */
|
|
25
|
+
export type GhostMenubarPlacement = Placement;
|
|
26
|
+
/** Supported CSS positioning strategies for floating content. */
|
|
27
|
+
export type GhostMenubarStrategy = Strategy;
|
|
28
|
+
/** Viewport/boundary padding accepted by flip and shift options. */
|
|
29
|
+
export type GhostMenubarPadding = number | {
|
|
30
|
+
top?: number;
|
|
31
|
+
right?: number;
|
|
32
|
+
bottom?: number;
|
|
33
|
+
left?: number;
|
|
34
|
+
};
|
|
35
|
+
/** Distance or axis offsets between trigger and menu content. */
|
|
36
|
+
export type GhostMenubarOffsetOptions = number | {
|
|
37
|
+
mainAxis?: number;
|
|
38
|
+
crossAxis?: number;
|
|
39
|
+
alignmentAxis?: number | null;
|
|
40
|
+
};
|
|
41
|
+
/** Collision flip options for {@link GhostMenubarContent}. */
|
|
42
|
+
export interface GhostMenubarFlipOptions {
|
|
43
|
+
mainAxis?: boolean;
|
|
44
|
+
crossAxis?: boolean;
|
|
45
|
+
fallbackPlacements?: GhostMenubarPlacement[];
|
|
46
|
+
padding?: GhostMenubarPadding;
|
|
47
|
+
boundary?: Element | Element[];
|
|
48
|
+
}
|
|
49
|
+
/** Collision shift options for {@link GhostMenubarContent}. */
|
|
50
|
+
export interface GhostMenubarShiftOptions {
|
|
51
|
+
mainAxis?: boolean;
|
|
52
|
+
crossAxis?: boolean;
|
|
53
|
+
padding?: GhostMenubarPadding;
|
|
54
|
+
boundary?: Element | Element[];
|
|
55
|
+
}
|
|
56
|
+
/** Props for the {@link GhostMenubar} root component. */
|
|
57
|
+
export interface GhostMenubarProps {
|
|
58
|
+
/**
|
|
59
|
+
* Tag name or component rendered for the menubar container.
|
|
60
|
+
* @default 'div'
|
|
61
|
+
*/
|
|
62
|
+
as?: GhostMenubarElement;
|
|
63
|
+
/** Text direction for horizontal arrow-key roving. */
|
|
64
|
+
dir?: 'ltr' | 'rtl';
|
|
65
|
+
}
|
|
66
|
+
/** Props for the {@link GhostMenubarMenu} root provider component. */
|
|
67
|
+
export interface GhostMenubarMenuProps {
|
|
68
|
+
/**
|
|
69
|
+
* Controlled open state. Omit to run uncontrolled from `defaultOpen`.
|
|
70
|
+
* @default undefined
|
|
71
|
+
*/
|
|
72
|
+
open?: boolean | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Initial open state when `open` is omitted.
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
defaultOpen?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** Props passed to the {@link GhostMenubarMenu} default slot. */
|
|
80
|
+
export interface GhostMenubarMenuSlotProps {
|
|
81
|
+
open: boolean;
|
|
82
|
+
close: () => void;
|
|
83
|
+
}
|
|
84
|
+
/** Props for {@link GhostMenubarTrigger}. */
|
|
85
|
+
export interface GhostMenubarTriggerProps {
|
|
86
|
+
/**
|
|
87
|
+
* Tag name or component rendered for the trigger control.
|
|
88
|
+
* @default 'button'
|
|
89
|
+
*/
|
|
90
|
+
as?: GhostMenubarTriggerElement;
|
|
91
|
+
/**
|
|
92
|
+
* Disables activation and menubar roving.
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
disabled?: boolean;
|
|
96
|
+
}
|
|
97
|
+
/** Props for {@link GhostMenubarContent}. */
|
|
98
|
+
export interface GhostMenubarContentProps {
|
|
99
|
+
/**
|
|
100
|
+
* Tag name or component rendered for the menu surface.
|
|
101
|
+
* @default 'div'
|
|
102
|
+
*/
|
|
103
|
+
as?: GhostMenubarContentElement;
|
|
104
|
+
/** Preferred placement relative to the trigger. */
|
|
105
|
+
placement?: GhostMenubarPlacement;
|
|
106
|
+
offset?: GhostMenubarOffsetOptions | boolean | undefined;
|
|
107
|
+
flip?: boolean | GhostMenubarFlipOptions;
|
|
108
|
+
shift?: boolean | GhostMenubarShiftOptions;
|
|
109
|
+
strategy?: GhostMenubarStrategy;
|
|
110
|
+
portal?: boolean;
|
|
111
|
+
portalTo?: GhostPortalTarget;
|
|
112
|
+
}
|
|
113
|
+
/** Props for {@link GhostMenubarItem}. */
|
|
114
|
+
export interface GhostMenubarItemProps {
|
|
115
|
+
as?: GhostMenubarItemElement;
|
|
116
|
+
disabled?: boolean;
|
|
117
|
+
}
|
|
118
|
+
/** Props for {@link GhostMenubarGroup}. */
|
|
119
|
+
export interface GhostMenubarGroupProps {
|
|
120
|
+
as?: GhostMenubarGroupElement;
|
|
121
|
+
}
|
|
122
|
+
/** Props for {@link GhostMenubarLabel}. */
|
|
123
|
+
export interface GhostMenubarLabelProps {
|
|
124
|
+
as?: GhostMenubarLabelElement;
|
|
125
|
+
}
|
|
126
|
+
/** Props for {@link GhostMenubarSeparator}. */
|
|
127
|
+
export interface GhostMenubarSeparatorProps {
|
|
128
|
+
as?: GhostMenubarSeparatorElement;
|
|
129
|
+
decorative?: boolean;
|
|
130
|
+
}
|
|
131
|
+
/** Props for {@link GhostMenubarCheckboxItem}. */
|
|
132
|
+
export interface GhostMenubarCheckboxItemProps {
|
|
133
|
+
as?: GhostMenubarCheckboxItemElement;
|
|
134
|
+
checked?: boolean | undefined;
|
|
135
|
+
defaultChecked?: boolean;
|
|
136
|
+
disabled?: boolean;
|
|
137
|
+
}
|
|
138
|
+
/** Props for {@link GhostMenubarRadioGroup}. */
|
|
139
|
+
export interface GhostMenubarRadioGroupProps {
|
|
140
|
+
as?: GhostMenubarRadioGroupElement;
|
|
141
|
+
modelValue?: string | undefined;
|
|
142
|
+
defaultValue?: string | undefined;
|
|
143
|
+
disabled?: boolean;
|
|
144
|
+
}
|
|
145
|
+
/** Props for {@link GhostMenubarRadioItem}. */
|
|
146
|
+
export interface GhostMenubarRadioItemProps {
|
|
147
|
+
as?: GhostMenubarRadioItemElement;
|
|
148
|
+
value: string;
|
|
149
|
+
disabled?: boolean;
|
|
150
|
+
}
|
|
151
|
+
/** Methods and state exposed by a template ref to {@link GhostMenubar}. */
|
|
152
|
+
export interface GhostMenubarExposed {
|
|
153
|
+
readonly element: HTMLElement | null;
|
|
154
|
+
}
|
|
155
|
+
/** Methods and state exposed by a template ref to {@link GhostMenubarTrigger}. */
|
|
156
|
+
export interface GhostMenubarTriggerExposed {
|
|
157
|
+
readonly element: HTMLElement | null;
|
|
158
|
+
focus(options?: FocusOptions): void;
|
|
159
|
+
blur(): void;
|
|
160
|
+
}
|
|
161
|
+
/** Methods and state exposed by a template ref to {@link GhostMenubarContent}. */
|
|
162
|
+
export interface GhostMenubarContentExposed {
|
|
163
|
+
readonly element: HTMLElement | null;
|
|
164
|
+
focus(options?: FocusOptions): void;
|
|
165
|
+
blur(): void;
|
|
166
|
+
}
|
|
167
|
+
/** Methods and state exposed by a template ref to {@link GhostMenubarItem}. */
|
|
168
|
+
export interface GhostMenubarItemExposed {
|
|
169
|
+
readonly element: HTMLElement | null;
|
|
170
|
+
focus(options?: FocusOptions): void;
|
|
171
|
+
blur(): void;
|
|
172
|
+
}
|
|
173
|
+
/** Methods and state exposed by a template ref to {@link GhostMenubarCheckboxItem}. */
|
|
174
|
+
export interface GhostMenubarCheckboxItemExposed {
|
|
175
|
+
readonly element: HTMLElement | null;
|
|
176
|
+
focus(options?: FocusOptions): void;
|
|
177
|
+
blur(): void;
|
|
178
|
+
}
|
|
179
|
+
/** Methods and state exposed by a template ref to {@link GhostMenubarRadioItem}. */
|
|
180
|
+
export interface GhostMenubarRadioItemExposed {
|
|
181
|
+
readonly element: HTMLElement | null;
|
|
182
|
+
focus(options?: FocusOptions): void;
|
|
183
|
+
blur(): void;
|
|
184
|
+
}
|
|
185
|
+
/** Options for {@link useGhostMenubarMenu}. */
|
|
186
|
+
export interface UseGhostMenubarMenuOptions {
|
|
187
|
+
open?: MaybeRefOrGetter<boolean | undefined>;
|
|
188
|
+
defaultOpen?: MaybeRefOrGetter<boolean | undefined>;
|
|
189
|
+
onOpenChange?: (open: boolean) => void;
|
|
190
|
+
}
|
|
191
|
+
/** Reactive state and helpers returned by {@link useGhostMenubarMenu}. */
|
|
192
|
+
export interface UseGhostMenubarMenuReturn {
|
|
193
|
+
isOpen: Ref<boolean>;
|
|
194
|
+
open: () => void;
|
|
195
|
+
close: () => void;
|
|
196
|
+
toggle: () => void;
|
|
197
|
+
triggerId: ComputedRef<string>;
|
|
198
|
+
contentId: ComputedRef<string>;
|
|
199
|
+
}
|
|
200
|
+
/** Internal context shared between menubar menu parts. */
|
|
201
|
+
export interface GhostMenubarMenuContext {
|
|
202
|
+
isOpen: Ref<boolean>;
|
|
203
|
+
open: () => void;
|
|
204
|
+
close: () => void;
|
|
205
|
+
toggle: () => void;
|
|
206
|
+
defaultTriggerId: ComputedRef<string>;
|
|
207
|
+
defaultContentId: ComputedRef<string>;
|
|
208
|
+
triggerId: ComputedRef<string>;
|
|
209
|
+
contentId: ComputedRef<string>;
|
|
210
|
+
triggerRegistered: Ref<boolean>;
|
|
211
|
+
triggerElement: Ref<HTMLElement | null>;
|
|
212
|
+
focusLastOnOpen: Ref<boolean>;
|
|
213
|
+
setFocusLastOnOpen: (value: boolean) => void;
|
|
214
|
+
setTriggerElement: (element: HTMLElement | null) => void;
|
|
215
|
+
setTriggerId: (id: string | null) => void;
|
|
216
|
+
setTriggerRegistered: (registered: boolean) => void;
|
|
217
|
+
setContentId: (id: string | null) => void;
|
|
218
|
+
}
|
|
219
|
+
export interface GhostMenubarMenuInternalContext extends GhostMenubarMenuContext {
|
|
220
|
+
openedAtMount: Ref<boolean>;
|
|
221
|
+
}
|
|
222
|
+
export declare const ghostMenubarMenuContextKey: InjectionKey<GhostMenubarMenuInternalContext>;
|
|
223
|
+
/** Radio group context scoped to a menubar menu. */
|
|
224
|
+
export interface GhostMenubarMenuRadioGroupContext {
|
|
225
|
+
readonly selectedValue: Ref<string | undefined>;
|
|
226
|
+
disabled: ComputedRef<boolean>;
|
|
227
|
+
select: (value: string) => void;
|
|
228
|
+
isSelected: (value: string) => boolean;
|
|
229
|
+
isItemDisabled: (value: string) => boolean;
|
|
230
|
+
}
|
|
231
|
+
export declare const ghostMenubarMenuRadioGroupContextKey: InjectionKey<GhostMenubarMenuRadioGroupContext>;
|
|
232
|
+
/** Per-menu registration tracked by the menubar root. */
|
|
233
|
+
export interface GhostMenubarMenuRegistration {
|
|
234
|
+
triggerElement: Ref<HTMLElement | null>;
|
|
235
|
+
isOpen: Ref<boolean>;
|
|
236
|
+
open: () => void;
|
|
237
|
+
close: () => void;
|
|
238
|
+
setFocusLastOnOpen: (value: boolean) => void;
|
|
239
|
+
}
|
|
240
|
+
/** Menubar root coordination context. */
|
|
241
|
+
export interface GhostMenubarContext {
|
|
242
|
+
registerMenu: (id: symbol, entry: GhostMenubarMenuRegistration) => void;
|
|
243
|
+
unregisterMenu: (id: symbol) => void;
|
|
244
|
+
/** Roving trigger with tabindex `0`; others are `-1`. */
|
|
245
|
+
triggerTabStop: Ref<HTMLElement | null>;
|
|
246
|
+
hasOpenMenu: () => boolean;
|
|
247
|
+
moveTriggerFocus: (currentTrigger: HTMLElement, key: 'ArrowLeft' | 'ArrowRight' | 'Home' | 'End') => void;
|
|
248
|
+
/** Close current, open adjacent menu, focus its first item (menubar or menu focus). */
|
|
249
|
+
openAdjacentMenu: (currentTrigger: HTMLElement, key: 'ArrowLeft' | 'ArrowRight') => void;
|
|
250
|
+
focusNextTabStopAfterMenubar: (from?: HTMLElement | null) => void;
|
|
251
|
+
closeAllExcept: (exceptId: symbol | null) => void;
|
|
252
|
+
getMenubarElement: () => HTMLElement | null;
|
|
253
|
+
}
|
|
254
|
+
export declare const ghostMenubarContextKey: InjectionKey<GhostMenubarContext>;
|
|
255
|
+
/**
|
|
256
|
+
* Resolves a DOM element from either a raw element or a component ref
|
|
257
|
+
* (preferring exposed `.element` over `.$el` so wrappers with a `display:
|
|
258
|
+
* contents` scope resolve to their inner control).
|
|
259
|
+
*/
|
|
260
|
+
export declare function resolveMenubarHtmlElement(target: unknown): HTMLElement | null;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Options forwarded to `Intl.NumberFormat`.
|
|
4
|
+
*
|
|
5
|
+
* Round-trip formatting and parsing is supported for `notation: 'standard'`
|
|
6
|
+
* (the default) across `style: 'decimal' | 'currency' | 'percent' | 'unit'`,
|
|
7
|
+
* including `currencySign: 'accounting'`, `signDisplay`, `useGrouping`, and
|
|
8
|
+
* locale or `numberingSystem` digits.
|
|
9
|
+
*/
|
|
10
|
+
export type GhostNumberInputFormatOptions = Intl.NumberFormatOptions;
|
|
11
|
+
/**
|
|
12
|
+
* Unstyled {@link GhostNumberInput} props. Native attributes fall through to the
|
|
13
|
+
* spinbutton. `name` and `form` route to a hidden submit control; id and aria
|
|
14
|
+
* stay on the visible field. `value` is omitted so the model is
|
|
15
|
+
* `modelValue` / `defaultValue`.
|
|
16
|
+
*/
|
|
17
|
+
export interface GhostNumberInputProps extends /* @vue-ignore */ Omit<InputHTMLAttributes, 'value' | 'type' | 'role'> {
|
|
18
|
+
/**
|
|
19
|
+
* Controlled value. Omit for uncontrolled mode. `null` is an empty field.
|
|
20
|
+
*/
|
|
21
|
+
modelValue?: number | null;
|
|
22
|
+
/**
|
|
23
|
+
* Initial uncontrolled value and form-reset seed.
|
|
24
|
+
* @default null
|
|
25
|
+
*/
|
|
26
|
+
defaultValue?: number | null;
|
|
27
|
+
/** Inclusive minimum. Sets `aria-valuemin` when defined. */
|
|
28
|
+
min?: number;
|
|
29
|
+
/** Inclusive maximum. Sets `aria-valuemax` when defined. */
|
|
30
|
+
max?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Step for buttons and keyboard.
|
|
33
|
+
* @default 1
|
|
34
|
+
*/
|
|
35
|
+
step?: number;
|
|
36
|
+
/** `Intl.NumberFormat` locale; runtime default when omitted. */
|
|
37
|
+
locale?: string;
|
|
38
|
+
/** `Intl.NumberFormat` options. @default {} */
|
|
39
|
+
formatOptions?: GhostNumberInputFormatOptions;
|
|
40
|
+
/** @default false */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** @default false */
|
|
43
|
+
readonly?: boolean;
|
|
44
|
+
/** @default false */
|
|
45
|
+
invalid?: boolean;
|
|
46
|
+
/** @default false */
|
|
47
|
+
required?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Accessible name for the decrement button.
|
|
50
|
+
* @default 'Decrease'
|
|
51
|
+
*/
|
|
52
|
+
decrementLabel?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Accessible name for the increment button.
|
|
55
|
+
* @default 'Increase'
|
|
56
|
+
*/
|
|
57
|
+
incrementLabel?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface UseGhostNumberInputOptions {
|
|
60
|
+
modelValue?: MaybeRefOrGetter<number | null | undefined>;
|
|
61
|
+
defaultValue?: MaybeRefOrGetter<number | null | undefined>;
|
|
62
|
+
min?: MaybeRefOrGetter<number | undefined>;
|
|
63
|
+
max?: MaybeRefOrGetter<number | undefined>;
|
|
64
|
+
step?: MaybeRefOrGetter<number | undefined>;
|
|
65
|
+
locale?: MaybeRefOrGetter<string | undefined>;
|
|
66
|
+
formatOptions?: MaybeRefOrGetter<GhostNumberInputFormatOptions | undefined>;
|
|
67
|
+
disabled?: MaybeRefOrGetter<boolean | undefined>;
|
|
68
|
+
readonly?: MaybeRefOrGetter<boolean | undefined>;
|
|
69
|
+
invalid?: MaybeRefOrGetter<boolean | undefined>;
|
|
70
|
+
required?: MaybeRefOrGetter<boolean | undefined>;
|
|
71
|
+
decrementLabel?: MaybeRefOrGetter<string | undefined>;
|
|
72
|
+
incrementLabel?: MaybeRefOrGetter<string | undefined>;
|
|
73
|
+
/** Spinbutton input for reset reconciliation and display sync. */
|
|
74
|
+
element?: MaybeRefOrGetter<HTMLInputElement | null | undefined>;
|
|
75
|
+
/** Hidden input that carries the machine `name` / submit value. */
|
|
76
|
+
formInput?: MaybeRefOrGetter<HTMLInputElement | null | undefined>;
|
|
77
|
+
name?: MaybeRefOrGetter<string | undefined>;
|
|
78
|
+
form?: MaybeRefOrGetter<string | undefined>;
|
|
79
|
+
onChange?: (value: number | null) => void;
|
|
80
|
+
}
|
|
81
|
+
/** Methods available from a template ref to {@link GhostNumberInput}. */
|
|
82
|
+
export interface GhostNumberInputExposed {
|
|
83
|
+
readonly element: HTMLInputElement | null;
|
|
84
|
+
focus(options?: FocusOptions): void;
|
|
85
|
+
blur(): void;
|
|
86
|
+
increment(): void;
|
|
87
|
+
decrement(): void;
|
|
88
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { HTMLAttributes, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { GhostPaginationRangeEntry } from './get-pagination-range.js';
|
|
3
|
+
/**
|
|
4
|
+
* Unstyled {@link GhostPagination} props. `@vue-ignore` keeps native attributes as
|
|
5
|
+
* fallthrough at runtime while typing the full nav contract for consumers.
|
|
6
|
+
*/
|
|
7
|
+
export interface GhostPaginationProps extends /* @vue-ignore */ HTMLAttributes {
|
|
8
|
+
/**
|
|
9
|
+
* Controlled current page (1-based). Omit for uncontrolled mode.
|
|
10
|
+
*/
|
|
11
|
+
modelValue?: number | undefined;
|
|
12
|
+
/** Initial page when {@link modelValue} is omitted. @default 1 */
|
|
13
|
+
defaultPage?: number;
|
|
14
|
+
/** Total pages. Values below `1` are treated as `1`. */
|
|
15
|
+
pageCount: number;
|
|
16
|
+
/** Pages adjacent to the current page. @default 1 */
|
|
17
|
+
siblingCount?: number;
|
|
18
|
+
/** Pages always visible at the start and end. @default 1 */
|
|
19
|
+
boundaryCount?: number;
|
|
20
|
+
/** Render first and last controls. @default true */
|
|
21
|
+
showEdges?: boolean;
|
|
22
|
+
/** Disable every control. @default false */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Accessible name for the navigation landmark.
|
|
26
|
+
* @default 'Pagination'
|
|
27
|
+
*/
|
|
28
|
+
ariaLabel?: string;
|
|
29
|
+
/** Accessible name formatter for numbered pages. */
|
|
30
|
+
getPageLabel?: (page: number) => string;
|
|
31
|
+
/** Accessible name for the previous control. @default 'Previous page' */
|
|
32
|
+
previousLabel?: string;
|
|
33
|
+
/** Accessible name for the next control. @default 'Next page' */
|
|
34
|
+
nextLabel?: string;
|
|
35
|
+
/** Accessible name for the first control. @default 'First page' */
|
|
36
|
+
firstLabel?: string;
|
|
37
|
+
/** Accessible name for the last control. @default 'Last page' */
|
|
38
|
+
lastLabel?: string;
|
|
39
|
+
/** Accessible name for ellipsis list items. @default 'More pages' */
|
|
40
|
+
ellipsisLabel?: string;
|
|
41
|
+
}
|
|
42
|
+
/** Options for {@link useGhostPagination}. */
|
|
43
|
+
export interface UseGhostPaginationOptions {
|
|
44
|
+
modelValue?: MaybeRefOrGetter<number | undefined>;
|
|
45
|
+
defaultPage?: MaybeRefOrGetter<number | undefined>;
|
|
46
|
+
pageCount: MaybeRefOrGetter<number>;
|
|
47
|
+
siblingCount?: MaybeRefOrGetter<number | undefined>;
|
|
48
|
+
boundaryCount?: MaybeRefOrGetter<number | undefined>;
|
|
49
|
+
showEdges?: MaybeRefOrGetter<boolean | undefined>;
|
|
50
|
+
disabled?: MaybeRefOrGetter<boolean | undefined>;
|
|
51
|
+
ariaLabel?: MaybeRefOrGetter<string | undefined>;
|
|
52
|
+
getPageLabel?: MaybeRefOrGetter<((page: number) => string) | undefined>;
|
|
53
|
+
previousLabel?: MaybeRefOrGetter<string | undefined>;
|
|
54
|
+
nextLabel?: MaybeRefOrGetter<string | undefined>;
|
|
55
|
+
firstLabel?: MaybeRefOrGetter<string | undefined>;
|
|
56
|
+
lastLabel?: MaybeRefOrGetter<string | undefined>;
|
|
57
|
+
ellipsisLabel?: MaybeRefOrGetter<string | undefined>;
|
|
58
|
+
onChange?: (page: number) => void;
|
|
59
|
+
}
|
|
60
|
+
export interface GhostPaginationRootProps {
|
|
61
|
+
class: 'ghost-pagination';
|
|
62
|
+
'data-ghost-pagination': '';
|
|
63
|
+
'data-part': 'root';
|
|
64
|
+
'data-state': 'disabled' | undefined;
|
|
65
|
+
'aria-label': string;
|
|
66
|
+
}
|
|
67
|
+
export interface GhostPaginationListProps {
|
|
68
|
+
'data-part': 'list';
|
|
69
|
+
class: 'ghost-pagination__list';
|
|
70
|
+
role: 'list';
|
|
71
|
+
}
|
|
72
|
+
export interface GhostPaginationControlProps {
|
|
73
|
+
type: 'button';
|
|
74
|
+
disabled: true | undefined;
|
|
75
|
+
'aria-disabled': 'true' | undefined;
|
|
76
|
+
'data-disabled': '' | undefined;
|
|
77
|
+
'aria-label': string;
|
|
78
|
+
'aria-current': 'page' | undefined;
|
|
79
|
+
'data-part': 'first' | 'previous' | 'next' | 'last' | 'page';
|
|
80
|
+
onClick: (event: MouseEvent) => void;
|
|
81
|
+
}
|
|
82
|
+
export interface GhostPaginationEllipsisMarkerProps {
|
|
83
|
+
role: 'img';
|
|
84
|
+
'aria-label': string;
|
|
85
|
+
'data-part': 'ellipsis';
|
|
86
|
+
}
|
|
87
|
+
export interface GhostPaginationExposed {
|
|
88
|
+
readonly element: HTMLElement | null;
|
|
89
|
+
focus(options?: FocusOptions): void;
|
|
90
|
+
blur(): void;
|
|
91
|
+
}
|
|
92
|
+
export type { GhostPaginationRangeEntry };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import type { Placement, Strategy } from '@floating-ui/dom';
|
|
2
|
+
import type { Component, ComputedRef, InjectionKey, MaybeRefOrGetter, Ref } from 'vue';
|
|
3
|
+
import type { GhostPortalTarget } from './ghost-portal.js';
|
|
4
|
+
/** Valid `as` targets for {@link GhostPopoverTrigger}. */
|
|
5
|
+
export type GhostPopoverTriggerElement = string | Component;
|
|
6
|
+
/** Valid `as` targets for {@link GhostPopoverContent}. */
|
|
7
|
+
export type GhostPopoverContentElement = string | Component;
|
|
8
|
+
/** Valid `as` targets for {@link GhostPopoverClose}. */
|
|
9
|
+
export type GhostPopoverCloseElement = string | Component;
|
|
10
|
+
/** Supported floating placements relative to the trigger anchor. */
|
|
11
|
+
export type GhostPopoverPlacement = Placement;
|
|
12
|
+
/** Supported CSS positioning strategies for floating content. */
|
|
13
|
+
export type GhostPopoverStrategy = Strategy;
|
|
14
|
+
/** Viewport/boundary padding accepted by popover flip and shift options. */
|
|
15
|
+
export type GhostPopoverPadding = number | {
|
|
16
|
+
top?: number;
|
|
17
|
+
right?: number;
|
|
18
|
+
bottom?: number;
|
|
19
|
+
left?: number;
|
|
20
|
+
};
|
|
21
|
+
/** Distance or axis offsets between trigger and popover content. */
|
|
22
|
+
export type GhostPopoverOffsetOptions = number | {
|
|
23
|
+
mainAxis?: number;
|
|
24
|
+
crossAxis?: number;
|
|
25
|
+
alignmentAxis?: number | null;
|
|
26
|
+
};
|
|
27
|
+
/** Collision flip options for {@link GhostPopoverContent}. */
|
|
28
|
+
export interface GhostPopoverFlipOptions {
|
|
29
|
+
mainAxis?: boolean;
|
|
30
|
+
crossAxis?: boolean;
|
|
31
|
+
fallbackPlacements?: GhostPopoverPlacement[];
|
|
32
|
+
padding?: GhostPopoverPadding;
|
|
33
|
+
boundary?: Element | Element[];
|
|
34
|
+
}
|
|
35
|
+
/** Collision shift options for {@link GhostPopoverContent}. */
|
|
36
|
+
export interface GhostPopoverShiftOptions {
|
|
37
|
+
mainAxis?: boolean;
|
|
38
|
+
crossAxis?: boolean;
|
|
39
|
+
padding?: GhostPopoverPadding;
|
|
40
|
+
boundary?: Element | Element[];
|
|
41
|
+
}
|
|
42
|
+
/** Props for the {@link GhostPopover} root provider component. */
|
|
43
|
+
export interface GhostPopoverProps {
|
|
44
|
+
/**
|
|
45
|
+
* Controlled open state. Omit to run uncontrolled from `defaultOpen`.
|
|
46
|
+
* @default undefined
|
|
47
|
+
*/
|
|
48
|
+
open?: boolean | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Initial open state when `open` is omitted.
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
defaultOpen?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/** Props passed to the {@link GhostPopover} default slot. */
|
|
56
|
+
export interface GhostPopoverSlotProps {
|
|
57
|
+
open: boolean;
|
|
58
|
+
close: () => void;
|
|
59
|
+
}
|
|
60
|
+
/** Props for {@link GhostPopoverTrigger}. */
|
|
61
|
+
export interface GhostPopoverTriggerProps {
|
|
62
|
+
/**
|
|
63
|
+
* Tag name or component rendered for the trigger control.
|
|
64
|
+
* @default 'button'
|
|
65
|
+
*/
|
|
66
|
+
as?: GhostPopoverTriggerElement;
|
|
67
|
+
/**
|
|
68
|
+
* Disables toggling on click or keyboard activation.
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
disabled?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/** Props for {@link GhostPopoverContent}. */
|
|
74
|
+
export interface GhostPopoverContentProps {
|
|
75
|
+
/**
|
|
76
|
+
* Tag name or component rendered for the popover dialog surface.
|
|
77
|
+
* @default 'div'
|
|
78
|
+
*/
|
|
79
|
+
as?: GhostPopoverContentElement;
|
|
80
|
+
/**
|
|
81
|
+
* Preferred placement relative to the trigger.
|
|
82
|
+
* @default 'bottom'
|
|
83
|
+
*/
|
|
84
|
+
placement?: GhostPopoverPlacement;
|
|
85
|
+
/**
|
|
86
|
+
* Distance or axis offsets passed to `useFloating`.
|
|
87
|
+
* @default undefined
|
|
88
|
+
*/
|
|
89
|
+
offset?: GhostPopoverOffsetOptions | boolean | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Flip to an opposite side when overflowing the viewport or boundary.
|
|
92
|
+
* @default true
|
|
93
|
+
*/
|
|
94
|
+
flip?: boolean | GhostPopoverFlipOptions;
|
|
95
|
+
/**
|
|
96
|
+
* Shift along the cross axis to keep the popover in view.
|
|
97
|
+
* @default true
|
|
98
|
+
*/
|
|
99
|
+
shift?: boolean | GhostPopoverShiftOptions;
|
|
100
|
+
/**
|
|
101
|
+
* CSS positioning strategy passed to `useFloating`.
|
|
102
|
+
* @default 'absolute'
|
|
103
|
+
*/
|
|
104
|
+
strategy?: GhostPopoverStrategy;
|
|
105
|
+
/**
|
|
106
|
+
* Teleport content through {@link GhostPortal} when `true`, or render inline when `false`.
|
|
107
|
+
* @default true
|
|
108
|
+
*/
|
|
109
|
+
portal?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Teleport target passed to {@link GhostPortal} when `portal` is `true`.
|
|
112
|
+
* @default 'body'
|
|
113
|
+
*/
|
|
114
|
+
portalTo?: GhostPortalTarget;
|
|
115
|
+
}
|
|
116
|
+
/** Props for {@link GhostPopoverClose}. */
|
|
117
|
+
export interface GhostPopoverCloseProps {
|
|
118
|
+
/**
|
|
119
|
+
* Tag name or component rendered for the close control.
|
|
120
|
+
* @default 'button'
|
|
121
|
+
*/
|
|
122
|
+
as?: GhostPopoverCloseElement;
|
|
123
|
+
/**
|
|
124
|
+
* Disables closing on click or keyboard activation.
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
disabled?: boolean;
|
|
128
|
+
}
|
|
129
|
+
/** Methods and state exposed by a template ref to {@link GhostPopoverTrigger}. */
|
|
130
|
+
export interface GhostPopoverTriggerExposed {
|
|
131
|
+
readonly element: HTMLElement | null;
|
|
132
|
+
focus(options?: FocusOptions): void;
|
|
133
|
+
blur(): void;
|
|
134
|
+
}
|
|
135
|
+
/** Methods and state exposed by a template ref to {@link GhostPopoverContent}. */
|
|
136
|
+
export interface GhostPopoverContentExposed {
|
|
137
|
+
readonly element: HTMLElement | null;
|
|
138
|
+
focus(options?: FocusOptions): void;
|
|
139
|
+
blur(): void;
|
|
140
|
+
}
|
|
141
|
+
/** Methods and state exposed by a template ref to {@link GhostPopoverClose}. */
|
|
142
|
+
export interface GhostPopoverCloseExposed {
|
|
143
|
+
readonly element: HTMLElement | null;
|
|
144
|
+
focus(options?: FocusOptions): void;
|
|
145
|
+
blur(): void;
|
|
146
|
+
}
|
|
147
|
+
/** Options for {@link useGhostPopover}. */
|
|
148
|
+
export interface UseGhostPopoverOptions {
|
|
149
|
+
open?: MaybeRefOrGetter<boolean | undefined>;
|
|
150
|
+
defaultOpen?: MaybeRefOrGetter<boolean | undefined>;
|
|
151
|
+
onOpenChange?: (open: boolean) => void;
|
|
152
|
+
}
|
|
153
|
+
/** Reactive state and helpers returned by {@link useGhostPopover}. */
|
|
154
|
+
export interface UseGhostPopoverReturn {
|
|
155
|
+
isOpen: Ref<boolean>;
|
|
156
|
+
open: () => void;
|
|
157
|
+
close: () => void;
|
|
158
|
+
toggle: () => void;
|
|
159
|
+
triggerId: ComputedRef<string>;
|
|
160
|
+
contentId: ComputedRef<string>;
|
|
161
|
+
}
|
|
162
|
+
/** Internal context shared between `GhostPopover` parts. */
|
|
163
|
+
export interface GhostPopoverContext {
|
|
164
|
+
isOpen: Ref<boolean>;
|
|
165
|
+
open: () => void;
|
|
166
|
+
close: () => void;
|
|
167
|
+
toggle: () => void;
|
|
168
|
+
defaultTriggerId: ComputedRef<string>;
|
|
169
|
+
defaultContentId: ComputedRef<string>;
|
|
170
|
+
triggerId: ComputedRef<string>;
|
|
171
|
+
contentId: ComputedRef<string>;
|
|
172
|
+
triggerRegistered: Ref<boolean>;
|
|
173
|
+
triggerElement: Ref<HTMLElement | null>;
|
|
174
|
+
setTriggerElement: (element: HTMLElement | null) => void;
|
|
175
|
+
setTriggerId: (id: string | null) => void;
|
|
176
|
+
setTriggerRegistered: (registered: boolean) => void;
|
|
177
|
+
setContentId: (id: string | null) => void;
|
|
178
|
+
}
|
|
179
|
+
export interface GhostPopoverInternalContext extends GhostPopoverContext {
|
|
180
|
+
openedAtMount: Ref<boolean>;
|
|
181
|
+
}
|
|
182
|
+
export declare const ghostPopoverContextKey: InjectionKey<GhostPopoverInternalContext>;
|
|
183
|
+
/**
|
|
184
|
+
* Resolves a DOM element from either a raw element or a component ref
|
|
185
|
+
* (preferring exposed `.element` over `.$el` so wrappers like themed
|
|
186
|
+
* `GhostButton` with a `display: contents` scope resolve to their inner control).
|
|
187
|
+
*/
|
|
188
|
+
export declare function resolvePopoverHtmlElement(target: unknown): HTMLElement | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Target CSS selector, DOM element, or `null` when unavailable. */
|
|
2
|
+
export type GhostPortalTarget = string | Element | null;
|
|
3
|
+
/** Props for the {@link GhostPortal} component. */
|
|
4
|
+
export interface GhostPortalProps {
|
|
5
|
+
/**
|
|
6
|
+
* Target CSS selector or DOM element to teleport children into.
|
|
7
|
+
* @default 'body'
|
|
8
|
+
*/
|
|
9
|
+
to?: GhostPortalTarget;
|
|
10
|
+
/**
|
|
11
|
+
* Render slot content inline instead of teleporting.
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Defer target lookup until after the current mount or update cycle so
|
|
17
|
+
* targets rendered later in the same tree can be found.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
defer?: boolean;
|
|
21
|
+
}
|