@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,25 @@
|
|
|
1
|
+
import type { CalendarDate } from '@internationalized/date';
|
|
2
|
+
import { type PropType } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* Internal renderless child of `GhostCalendar` inside
|
|
5
|
+
* `GhostDatePickerCalendar`. Calendar context is only visible to Calendar
|
|
6
|
+
* descendants, so this bridge seeds the initial roving focus date and hands
|
|
7
|
+
* the Calendar's internal focus-target accessor to the picker, which uses it
|
|
8
|
+
* as the dialog's initial focus target (no timers or DOM nesting queries).
|
|
9
|
+
*
|
|
10
|
+
* The pure annotation lets bundlers drop this module-level `defineComponent`
|
|
11
|
+
* call from imports that never render a DatePicker.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DatePickerCalendarBridge: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
14
|
+
focusDate: {
|
|
15
|
+
type: PropType<CalendarDate | undefined>;
|
|
16
|
+
default: undefined;
|
|
17
|
+
};
|
|
18
|
+
}>, () => null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
focusDate: {
|
|
20
|
+
type: PropType<CalendarDate | undefined>;
|
|
21
|
+
default: undefined;
|
|
22
|
+
};
|
|
23
|
+
}>> & Readonly<{}>, {
|
|
24
|
+
focusDate: CalendarDate | undefined;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal date-only value helpers for GhostDatePicker: strict ISO text,
|
|
3
|
+
* runtime shape checks, and value identity. Not exported from the barrel.
|
|
4
|
+
*/
|
|
5
|
+
import { CalendarDate } from '@internationalized/date';
|
|
6
|
+
import type { GhostDatePickerRange, GhostDatePickerSelectionMode } from './ghost-date-picker.js';
|
|
7
|
+
/**
|
|
8
|
+
* Public values are Gregorian date-only `CalendarDate`s in years 0001–9999.
|
|
9
|
+
* `instanceof` rejects `CalendarDateTime` / `ZonedDateTime` (separate classes),
|
|
10
|
+
* JavaScript `Date`, and strings that reach the picker from untyped callers.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isPickerDate(value: unknown): value is CalendarDate;
|
|
13
|
+
export declare function isPickerRange(value: unknown): value is GhostDatePickerRange;
|
|
14
|
+
/**
|
|
15
|
+
* Whether `value` has the shape `mode` requires. The mode is never inferred
|
|
16
|
+
* from the value; a mismatch is a `configuration` error.
|
|
17
|
+
*/
|
|
18
|
+
export declare function hasValidShape(value: unknown, mode: GhostDatePickerSelectionMode): boolean;
|
|
19
|
+
/** ISO `YYYY-MM-DD`, zero-padded to four year digits. */
|
|
20
|
+
export declare function toIsoDate(date: CalendarDate): string;
|
|
21
|
+
/**
|
|
22
|
+
* Strict ISO parser: exactly `YYYY-MM-DD`, no whitespace, zero-padded, year
|
|
23
|
+
* 0001–9999, and a real calendar day. `CalendarDate` silently constrains
|
|
24
|
+
* impossible days (Feb 30 becomes Feb 29/28), so the day is range-checked
|
|
25
|
+
* against the month before constructing the value.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseIsoDate(text: string): CalendarDate | null;
|
|
28
|
+
/**
|
|
29
|
+
* Stable identity key used to suppress duplicate `update:modelValue` events
|
|
30
|
+
* and to detect material external changes. Wrong-shaped values get a key that
|
|
31
|
+
* never equals a valid one.
|
|
32
|
+
*/
|
|
33
|
+
export declare function valueKey(value: unknown): string;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { VNodeChild } from 'vue';
|
|
2
|
+
import type { DataTableCellContext, DataTableColumnDef } from './ghost-data-table.js';
|
|
3
|
+
/**
|
|
4
|
+
* Cell context for a column built with {@link defineDataTableColumns}. Same
|
|
5
|
+
* fields as {@link DataTableCellContext}, plus `value` and a typed `getValue`.
|
|
6
|
+
*/
|
|
7
|
+
export type DataTableTypedCellContext<TData, TValue> = Omit<DataTableCellContext<TData>, 'getValue'> & {
|
|
8
|
+
/** This cell's value, read once from the column accessor. */
|
|
9
|
+
value: TValue;
|
|
10
|
+
/** Returns {@link DataTableTypedCellContext.value}. */
|
|
11
|
+
getValue: () => TValue;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Column options for {@link DataTableColumnHelper.accessorKey}. `id` defaults
|
|
15
|
+
* to the key.
|
|
16
|
+
*
|
|
17
|
+
* `accessorFn` is omitted on purpose: at runtime an `accessorFn` wins over
|
|
18
|
+
* `accessorKey`, so allowing both would make the typed `value` lie. Use
|
|
19
|
+
* {@link DataTableColumnHelper.accessorFn} for derived values.
|
|
20
|
+
*/
|
|
21
|
+
export type DataTableAccessorKeyColumn<TData, K extends keyof TData & string> = Omit<DataTableColumnDef<TData>, 'accessorKey' | 'accessorFn' | 'id' | 'cell'> & {
|
|
22
|
+
/** @default the accessor key */
|
|
23
|
+
id?: string;
|
|
24
|
+
/** Render hook with the typed value of `row[key]`. */
|
|
25
|
+
cell?: (context: DataTableTypedCellContext<TData, TData[K]>) => VNodeChild;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Column options for {@link DataTableColumnHelper.accessorFn}. The column
|
|
29
|
+
* value type is inferred from the `accessorFn` return type. `accessorKey` is
|
|
30
|
+
* omitted because `accessorFn` would shadow it at runtime.
|
|
31
|
+
*/
|
|
32
|
+
export type DataTableAccessorFnColumn<TData, TValue> = Omit<DataTableColumnDef<TData>, 'accessorKey' | 'accessorFn' | 'id' | 'cell'> & {
|
|
33
|
+
accessorFn: (row: TData, index: number) => TValue;
|
|
34
|
+
/** Render hook with the typed `accessorFn` result. */
|
|
35
|
+
cell?: (context: DataTableTypedCellContext<TData, TValue>) => VNodeChild;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Column returned by {@link DataTableColumnHelper.accessorKey}: a plain
|
|
39
|
+
* {@link DataTableColumnDef} whose `id` and `accessorKey` keep their literal
|
|
40
|
+
* types. `TId` is the key unless the options set their own `id`; with a custom
|
|
41
|
+
* id the type is `TId | K`, a harmless superset of the runtime id.
|
|
42
|
+
*/
|
|
43
|
+
export type DataTableAccessorKeyColumnDef<TData, K extends keyof TData & string, TId extends string = K> = DataTableColumnDef<TData> & {
|
|
44
|
+
id: TId | K;
|
|
45
|
+
accessorKey: K;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Column returned by {@link DataTableColumnHelper.accessorFn}: a plain
|
|
49
|
+
* {@link DataTableColumnDef} whose `id` is the literal id and whose
|
|
50
|
+
* `accessorFn` keeps its return type.
|
|
51
|
+
*/
|
|
52
|
+
export type DataTableAccessorFnColumnDef<TData, TValue, TId extends string = string> = DataTableColumnDef<TData> & {
|
|
53
|
+
id: TId;
|
|
54
|
+
accessorFn: (row: TData, index: number) => TValue;
|
|
55
|
+
};
|
|
56
|
+
/** Builders returned by {@link defineDataTableColumns}. */
|
|
57
|
+
export interface DataTableColumnHelper<TData> {
|
|
58
|
+
/**
|
|
59
|
+
* Column that reads `row[key]`. `key` must be a string key of `TData`, so
|
|
60
|
+
* renaming the row property breaks the definition at compile time.
|
|
61
|
+
*/
|
|
62
|
+
accessorKey: <K extends keyof TData & string, TId extends string = K>(key: K, column: DataTableAccessorKeyColumn<TData, K> & {
|
|
63
|
+
id?: TId;
|
|
64
|
+
}) => DataTableAccessorKeyColumnDef<TData, K, TId>;
|
|
65
|
+
/** Column whose value comes from `accessorFn`. `id` is required. */
|
|
66
|
+
accessorFn: <TValue, TId extends string = string>(id: TId, column: DataTableAccessorFnColumn<TData, TValue>) => DataTableAccessorFnColumnDef<TData, TValue, TId>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Typed column factory for DataTable. Pass the row type once; each builder
|
|
70
|
+
* infers the column's value type so `cell` receives a typed `value` and
|
|
71
|
+
* `getValue()`:
|
|
72
|
+
*
|
|
73
|
+
* ```ts
|
|
74
|
+
* const columns = defineDataTableColumns<Invoice>()
|
|
75
|
+
* const defs = [
|
|
76
|
+
* columns.accessorKey('amount', {
|
|
77
|
+
* header: 'Amount',
|
|
78
|
+
* cell: ({ value }) => `${value.toFixed(2)} USD`,
|
|
79
|
+
* }),
|
|
80
|
+
* ]
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* Holds no state and does not touch Vue reactivity. Each builder returns a
|
|
84
|
+
* new {@link DataTableColumnDef} and never mutates the options object.
|
|
85
|
+
* Generic contexts (for example `getBodyCellContext` in the `GhostDataTable`
|
|
86
|
+
* slot) still type `getValue()` as `unknown`, because one column array mixes
|
|
87
|
+
* value types.
|
|
88
|
+
*/
|
|
89
|
+
export declare function defineDataTableColumns<TData>(): DataTableColumnHelper<TData>;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
export type GhostCodeLevel = 'warn' | 'error';
|
|
2
|
+
export interface GhostCodeEntry {
|
|
3
|
+
readonly level: GhostCodeLevel;
|
|
4
|
+
readonly title: string;
|
|
5
|
+
/**
|
|
6
|
+
* Runtime message. `{name}` placeholders are replaced by `logGhostCode`
|
|
7
|
+
* replacements; unknown placeholders are left unchanged.
|
|
8
|
+
*/
|
|
9
|
+
readonly message: string;
|
|
10
|
+
/** Markdown path relative to `docs/warnings.md`. */
|
|
11
|
+
readonly relatedDocs?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface RetiredGhostCodeEntry {
|
|
14
|
+
readonly reason: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Canonical public URL for the diagnostic catalog. Console messages link here
|
|
18
|
+
* until a hosted docs origin exists.
|
|
19
|
+
*/
|
|
20
|
+
export declare const GHOST_CODE_DOCS_URL = "https://github.com/zprue743/ghostvue/blob/master/docs/warnings.md";
|
|
21
|
+
/**
|
|
22
|
+
* Assigned development diagnostic codes. Keys are stable public identifiers and
|
|
23
|
+
* must never be reused. Retire a code in `retiredGhostCodes` instead of deleting
|
|
24
|
+
* it.
|
|
25
|
+
*/
|
|
26
|
+
export declare const ghostCodes: {
|
|
27
|
+
readonly GHOST001: {
|
|
28
|
+
readonly level: "warn";
|
|
29
|
+
readonly title: "Controlled and uncontrolled state mixed";
|
|
30
|
+
readonly message: "A component switched from {from} to {to}. Pass the value prop for the lifetime of the instance, or omit it and use default*.";
|
|
31
|
+
readonly relatedDocs: "./architecture/component-state.md";
|
|
32
|
+
};
|
|
33
|
+
readonly GHOST002: {
|
|
34
|
+
readonly level: "warn";
|
|
35
|
+
readonly title: "Dialog content missing accessible name";
|
|
36
|
+
readonly message: "GhostDialogContent, GhostDrawerContent, and GhostCommandPaletteContent require an accessible name. Render GhostDialogTitle, GhostDrawerTitle, or GhostCommandPaletteTitle inside the content, or pass aria-label or aria-labelledby.";
|
|
37
|
+
readonly relatedDocs: "./components/dialog.md";
|
|
38
|
+
};
|
|
39
|
+
readonly GHOST003: {
|
|
40
|
+
readonly level: "warn";
|
|
41
|
+
readonly title: "Alert dialog missing description";
|
|
42
|
+
readonly message: "GhostDialogContent or GhostDrawerContent with role=\"alertdialog\" should provide a description. Render GhostDialogDescription or GhostDrawerDescription inside the content, or pass aria-describedby.";
|
|
43
|
+
readonly relatedDocs: "./components/dialog.md";
|
|
44
|
+
};
|
|
45
|
+
readonly GHOST004: {
|
|
46
|
+
readonly level: "warn";
|
|
47
|
+
readonly title: "DatePicker format callback threw";
|
|
48
|
+
readonly message: "The GhostDatePicker format callback threw for {date}. The input shows the ISO YYYY-MM-DD text instead. Make format synchronous, pure, and total for valid CalendarDate values.";
|
|
49
|
+
readonly relatedDocs: "./components/date-picker.md";
|
|
50
|
+
};
|
|
51
|
+
readonly GHOST005: {
|
|
52
|
+
readonly level: "warn";
|
|
53
|
+
readonly title: "Deprecated API used";
|
|
54
|
+
readonly message: "{api} is deprecated since {since} and will be removed in {removal}. {migration}";
|
|
55
|
+
readonly relatedDocs: "./standards/component-stability.md";
|
|
56
|
+
};
|
|
57
|
+
readonly GHOST006: {
|
|
58
|
+
readonly level: "warn";
|
|
59
|
+
readonly title: "Toast created during server rendering";
|
|
60
|
+
readonly message: "toast() ran during server-side rendering and was ignored. The server never queues toasts; call toast() from client code such as onMounted or an event handler.";
|
|
61
|
+
readonly relatedDocs: "./components/toast.md";
|
|
62
|
+
};
|
|
63
|
+
readonly GHOST007: {
|
|
64
|
+
readonly level: "warn";
|
|
65
|
+
readonly title: "Toast duration ignored";
|
|
66
|
+
readonly message: "duration is ignored on toast \"{id}\" because {reason} toasts persist until dismissed. Remove duration, or make the toast informational.";
|
|
67
|
+
readonly relatedDocs: "./components/toast.md";
|
|
68
|
+
};
|
|
69
|
+
readonly GHOST008: {
|
|
70
|
+
readonly level: "warn";
|
|
71
|
+
readonly title: "Invalid toast option";
|
|
72
|
+
readonly message: "{option} {value} is invalid; expected {expected}. Using {fallback} instead.";
|
|
73
|
+
readonly relatedDocs: "./components/toast.md";
|
|
74
|
+
};
|
|
75
|
+
readonly GHOST009: {
|
|
76
|
+
readonly level: "warn";
|
|
77
|
+
readonly title: "Toast id uses the reserved prefix";
|
|
78
|
+
readonly message: "Toast id \"{id}\" starts with the generated-id prefix \"{prefix}\". It is treated as an update of an existing toast only; omit id for a generated one or choose another explicit id.";
|
|
79
|
+
readonly relatedDocs: "./components/toast.md";
|
|
80
|
+
};
|
|
81
|
+
readonly GHOST010: {
|
|
82
|
+
readonly level: "warn";
|
|
83
|
+
readonly title: "Many toasts waiting";
|
|
84
|
+
readonly message: "{count} toasts are waiting behind the visible stack. Check for runaway toast() calls, and reuse an id to update a toast in place.";
|
|
85
|
+
readonly relatedDocs: "./components/toast.md";
|
|
86
|
+
};
|
|
87
|
+
readonly GHOST011: {
|
|
88
|
+
readonly level: "warn";
|
|
89
|
+
readonly title: "Toast without a title";
|
|
90
|
+
readonly message: "toast() and update() need a non-empty title. The {call} call was ignored.";
|
|
91
|
+
readonly relatedDocs: "./components/toast.md";
|
|
92
|
+
};
|
|
93
|
+
readonly GHOST012: {
|
|
94
|
+
readonly level: "warn";
|
|
95
|
+
readonly title: "Duplicate command palette item id";
|
|
96
|
+
readonly message: "Two GhostCommandPaletteItem components in one palette use the id \"{id}\". Give every command a unique, stable id; duplicates share one highlight and registry entry.";
|
|
97
|
+
readonly relatedDocs: "./components/command-palette.md";
|
|
98
|
+
};
|
|
99
|
+
readonly GHOST013: {
|
|
100
|
+
readonly level: "warn";
|
|
101
|
+
readonly title: "Duplicate scroll spy target";
|
|
102
|
+
readonly message: "Two GhostScrollSpyLink components in one GhostScrollSpy use the target \"{target}\". Each section id should appear once. Duplicate registrations resolve to the first enabled link in DOM order.";
|
|
103
|
+
readonly relatedDocs: "./components/scroll-spy.md";
|
|
104
|
+
};
|
|
105
|
+
readonly GHOST014: {
|
|
106
|
+
readonly level: "warn";
|
|
107
|
+
readonly title: "GhostPresence surface not resolved";
|
|
108
|
+
readonly message: "GhostPresence closed without a resolved surface element, so it unmounted immediately without an exit animation. When the default slot renders a fragment, several roots, or a GhostPortal/Teleport wrapper, bind :ref=\"setElement\" (plus data-state and inert) on the animated element.";
|
|
109
|
+
readonly relatedDocs: "./components/presence.md";
|
|
110
|
+
};
|
|
111
|
+
readonly GHOST015: {
|
|
112
|
+
readonly level: "warn";
|
|
113
|
+
readonly title: "External form attribute ignored in GhostCheckboxGroup";
|
|
114
|
+
readonly message: "GhostCheckboxGroup does not support an external form attribute on {target}. Place the group inside its ancestor form instead; the form attribute was omitted so submission and reset stay aligned.";
|
|
115
|
+
readonly relatedDocs: "./components/checkbox-group.md";
|
|
116
|
+
};
|
|
117
|
+
readonly GHOST016: {
|
|
118
|
+
readonly level: "warn";
|
|
119
|
+
readonly title: "Checkbox member model prop ignored";
|
|
120
|
+
readonly message: "GhostCheckbox with value \"{value}\" inside GhostCheckboxGroup ignores {prop}. Bind v-model or defaultValue on GhostCheckboxGroup instead.";
|
|
121
|
+
readonly relatedDocs: "./components/checkbox-group.md";
|
|
122
|
+
};
|
|
123
|
+
readonly GHOST017: {
|
|
124
|
+
readonly level: "warn";
|
|
125
|
+
readonly title: "Checkbox member name overridden by group";
|
|
126
|
+
readonly message: "GhostCheckbox with value \"{value}\" passed name=\"{itemName}\", which differs from GhostCheckboxGroup name=\"{groupName}\". Using the group name.";
|
|
127
|
+
readonly relatedDocs: "./components/checkbox-group.md";
|
|
128
|
+
};
|
|
129
|
+
readonly GHOST018: {
|
|
130
|
+
readonly level: "warn";
|
|
131
|
+
readonly title: "Duplicate checkbox group option value";
|
|
132
|
+
readonly message: "Two GhostCheckbox members in one GhostCheckboxGroup share the value \"{value}\". Give every member a unique value.";
|
|
133
|
+
readonly relatedDocs: "./components/checkbox-group.md";
|
|
134
|
+
};
|
|
135
|
+
readonly GHOST019: {
|
|
136
|
+
readonly level: "warn";
|
|
137
|
+
readonly title: "GhostSelect multiple mode changed after setup";
|
|
138
|
+
readonly message: "GhostSelect \"multiple\" was read at setup as {initial} and changed to {next}. Keep the mode fixed for the lifetime of the instance.";
|
|
139
|
+
readonly relatedDocs: "./components/select.md";
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Formerly assigned codes. Kept so the number cannot be given to a new meaning.
|
|
144
|
+
*/
|
|
145
|
+
export declare const retiredGhostCodes: Readonly<Record<string, RetiredGhostCodeEntry>>;
|
|
146
|
+
export type GhostCode = keyof typeof ghostCodes;
|
|
147
|
+
export declare function ghostCodeDocsUrl(code: GhostCode): string;
|
|
148
|
+
export declare function formatGhostCodeMessage(code: GhostCode, replacements?: Readonly<Record<string, string>>): string;
|
|
149
|
+
/**
|
|
150
|
+
* Emits a coded diagnostic. Callers must wrap this in
|
|
151
|
+
* `process.env.NODE_ENV !== 'production'` so consumer bundlers can strip both
|
|
152
|
+
* the call and these strings. `import.meta.env.DEV` would be baked by the
|
|
153
|
+
* library build.
|
|
154
|
+
*/
|
|
155
|
+
export declare function logGhostCode(code: GhostCode, replacements?: Readonly<Record<string, string>>): void;
|
|
156
|
+
/**
|
|
157
|
+
* One deprecation notice. Every field is consumer-facing text in the GHOST005
|
|
158
|
+
* message, so `migration` names the replacement and how to move to it.
|
|
159
|
+
*/
|
|
160
|
+
export interface GhostDeprecation {
|
|
161
|
+
/** The deprecated API, e.g. `GhostFoo prop "size"` or `GhostFoo`. */
|
|
162
|
+
readonly api: string;
|
|
163
|
+
/** Package version that first deprecated it, e.g. `0.4.0`. */
|
|
164
|
+
readonly since: string;
|
|
165
|
+
/**
|
|
166
|
+
* Earliest release that may remove it: a minor before 1.0 and a major from
|
|
167
|
+
* 1.0 onward, at least one minor release and 30 days after `since`.
|
|
168
|
+
*/
|
|
169
|
+
readonly removal: string;
|
|
170
|
+
/** Replacement and migration steps. */
|
|
171
|
+
readonly migration: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Reports deprecated API use with GHOST005, once per `api` per JavaScript
|
|
175
|
+
* realm. This is the only sanctioned deprecation warning; see
|
|
176
|
+
* docs/standards/component-stability.md. Callers must wrap it in
|
|
177
|
+
* `process.env.NODE_ENV !== 'production'` like `logGhostCode`.
|
|
178
|
+
*/
|
|
179
|
+
export declare function warnGhostDeprecation(deprecation: GhostDeprecation): void;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal compound-dialog part mechanics shared by `GhostDialog*` and
|
|
3
|
+
* `GhostDrawer*`.
|
|
4
|
+
*
|
|
5
|
+
* Both families implement the same APG Dialog (Modal) contract: controllable
|
|
6
|
+
* open state, deterministic part IDs, trigger/close activation, modal overlay,
|
|
7
|
+
* and a content surface composing `useScrollLock`, `useInertOthers`,
|
|
8
|
+
* `useDismissableLayer`, and `useFocusScope`. Keeping one implementation here
|
|
9
|
+
* prevents the focus, dismissal, scroll-lock, and background-isolation logic
|
|
10
|
+
* from drifting between the two families (GHO-91).
|
|
11
|
+
*
|
|
12
|
+
* This module is intentionally not exported from the public barrel. Each family
|
|
13
|
+
* provides the context returned by {@link createDialogPartsContext} under its own
|
|
14
|
+
* injection key (`ghostDialogContextKey` vs `ghostDrawerContextKey`) so a
|
|
15
|
+
* `GhostDialog` nested inside a `GhostDrawer` (or vice versa) never resolves the
|
|
16
|
+
* wrong ancestor through `provide` / `inject`.
|
|
17
|
+
*/
|
|
18
|
+
import { type ComputedRef, type InjectionKey, type MaybeRefOrGetter, type Ref, type ShallowRef } from 'vue';
|
|
19
|
+
import type { GhostDialogContentRole, GhostDialogContext } from './ghost-dialog.js';
|
|
20
|
+
import type { GhostPortalTarget } from './ghost-portal.js';
|
|
21
|
+
/**
|
|
22
|
+
* Context shared by every compound dialog part. Structurally identical to the
|
|
23
|
+
* public `GhostDialogContext` plus the internal `openedAtMount` flag used by
|
|
24
|
+
* non-modal autofocus.
|
|
25
|
+
*/
|
|
26
|
+
export type DialogPartsContext = GhostDialogContext & {
|
|
27
|
+
openedAtMount: Ref<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Internal: skips exit retention for the content surface. Set by
|
|
30
|
+
* `GhostDatePickerContent` so an anchored picker closed before its first
|
|
31
|
+
* positioning (still `visibility: hidden`) unmounts immediately.
|
|
32
|
+
*/
|
|
33
|
+
skipExitPresence?: () => boolean;
|
|
34
|
+
};
|
|
35
|
+
/** Ref contract every part exposes through `defineExpose`. */
|
|
36
|
+
export interface DialogPartExposed {
|
|
37
|
+
readonly element: HTMLElement | null;
|
|
38
|
+
focus(options?: FocusOptions): void;
|
|
39
|
+
blur(): void;
|
|
40
|
+
}
|
|
41
|
+
/** Options accepted by {@link useDialogState}. */
|
|
42
|
+
export interface UseDialogStateOptions {
|
|
43
|
+
open?: MaybeRefOrGetter<boolean | undefined>;
|
|
44
|
+
defaultOpen?: MaybeRefOrGetter<boolean | undefined>;
|
|
45
|
+
modal?: MaybeRefOrGetter<boolean | undefined>;
|
|
46
|
+
onOpenChange?: (open: boolean) => void;
|
|
47
|
+
}
|
|
48
|
+
/** Return value of {@link useDialogState}. */
|
|
49
|
+
export interface UseDialogStateReturn {
|
|
50
|
+
isOpen: Ref<boolean>;
|
|
51
|
+
isModal: ComputedRef<boolean>;
|
|
52
|
+
open: () => void;
|
|
53
|
+
close: () => void;
|
|
54
|
+
toggle: () => void;
|
|
55
|
+
triggerId: ComputedRef<string>;
|
|
56
|
+
contentId: ComputedRef<string>;
|
|
57
|
+
titleId: ComputedRef<string>;
|
|
58
|
+
descriptionId: ComputedRef<string>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Controllable open state, modal flag, and deterministic SSR-safe IDs.
|
|
62
|
+
*
|
|
63
|
+
* `idPrefix` keeps generated IDs readable per family (`ghost-dialog-*` vs
|
|
64
|
+
* `ghost-drawer-*`); uniqueness still comes from `useGhostId`.
|
|
65
|
+
*/
|
|
66
|
+
export declare function useDialogState(options: UseDialogStateOptions, idPrefix: string): UseDialogStateReturn;
|
|
67
|
+
/**
|
|
68
|
+
* Builds the root context provided to compound parts. Must run during the
|
|
69
|
+
* root component's `setup`.
|
|
70
|
+
*/
|
|
71
|
+
export declare function createDialogPartsContext(state: UseDialogStateReturn): DialogPartsContext;
|
|
72
|
+
/**
|
|
73
|
+
* Injects a family context or throws a consumer-facing error naming both the
|
|
74
|
+
* part and its required root.
|
|
75
|
+
*/
|
|
76
|
+
export declare function injectDialogPartsContext<T extends DialogPartsContext>(key: InjectionKey<T>, partName: string, rootName: string): T;
|
|
77
|
+
/**
|
|
78
|
+
* Resolves a DOM element from either a raw element or a component ref
|
|
79
|
+
* (preferring exposed `.element` over `.$el` so wrappers like themed
|
|
80
|
+
* `GhostButton` with a `display: contents` scope resolve to their inner control).
|
|
81
|
+
*/
|
|
82
|
+
export declare function resolveDialogHtmlElement(target: unknown): HTMLElement | null;
|
|
83
|
+
/** Builds the `{ element, focus, blur }` ref contract for one part. */
|
|
84
|
+
export declare function createDialogPartExposed(element: () => HTMLElement | null): DialogPartExposed;
|
|
85
|
+
type ExtraAttrs = () => Record<string, unknown>;
|
|
86
|
+
/** Props shared by button-like parts (Trigger and Close). */
|
|
87
|
+
interface DialogButtonPartProps {
|
|
88
|
+
as: unknown;
|
|
89
|
+
disabled: boolean;
|
|
90
|
+
}
|
|
91
|
+
/** Trigger part: opens/toggles the dialog and registers its id and element. */
|
|
92
|
+
export declare function useDialogTriggerPart(context: DialogPartsContext, props: DialogButtonPartProps, hostRef: Readonly<ShallowRef<unknown>>, options?: {
|
|
93
|
+
haspopup?: string;
|
|
94
|
+
extraAttrs?: ExtraAttrs;
|
|
95
|
+
}): {
|
|
96
|
+
triggerAttrs: ComputedRef<{
|
|
97
|
+
id: string;
|
|
98
|
+
'aria-haspopup': string;
|
|
99
|
+
'aria-expanded': string;
|
|
100
|
+
'aria-controls': string;
|
|
101
|
+
'data-part': string;
|
|
102
|
+
'data-state': string;
|
|
103
|
+
}>;
|
|
104
|
+
onClick: (event: MouseEvent) => void;
|
|
105
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
106
|
+
exposed: DialogPartExposed;
|
|
107
|
+
};
|
|
108
|
+
/** Close part: closes the enclosing dialog on click or keyboard activation. */
|
|
109
|
+
export declare function useDialogClosePart(context: DialogPartsContext, props: DialogButtonPartProps, hostRef: Readonly<ShallowRef<unknown>>): {
|
|
110
|
+
closeAttrs: ComputedRef<{
|
|
111
|
+
'data-part': string;
|
|
112
|
+
}>;
|
|
113
|
+
onClick: (event: MouseEvent) => void;
|
|
114
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
115
|
+
exposed: DialogPartExposed;
|
|
116
|
+
};
|
|
117
|
+
/** Overlay part: modal-only backdrop that stays non-inert while open. */
|
|
118
|
+
export declare function useDialogOverlayPart(context: DialogPartsContext, hostRef: Readonly<ShallowRef<unknown>>, options?: {
|
|
119
|
+
extraAttrs?: ExtraAttrs;
|
|
120
|
+
}): {
|
|
121
|
+
attrs: import("vue").Attrs;
|
|
122
|
+
isPresent: ComputedRef<boolean>;
|
|
123
|
+
overlayAttrs: ComputedRef<Record<string, unknown> & {
|
|
124
|
+
style?: unknown;
|
|
125
|
+
}>;
|
|
126
|
+
exposed: DialogPartExposed;
|
|
127
|
+
};
|
|
128
|
+
/** Title or Description part: registers its id for automatic ARIA linking. */
|
|
129
|
+
export declare function useDialogLabelPart(context: DialogPartsContext, kind: 'title' | 'description', hostRef: Readonly<ShallowRef<unknown>>): {
|
|
130
|
+
labelAttrs: ComputedRef<{
|
|
131
|
+
id: string;
|
|
132
|
+
'data-part': "title" | "description";
|
|
133
|
+
}>;
|
|
134
|
+
exposed: DialogPartExposed;
|
|
135
|
+
};
|
|
136
|
+
/** Props consumed by {@link useDialogContentPart}. */
|
|
137
|
+
export interface DialogContentPartProps {
|
|
138
|
+
role: GhostDialogContentRole;
|
|
139
|
+
closeOnEscape: boolean;
|
|
140
|
+
closeOnOutsideClick: boolean | undefined;
|
|
141
|
+
portal: boolean;
|
|
142
|
+
portalTo: GhostPortalTarget;
|
|
143
|
+
/**
|
|
144
|
+
* Focus-entry hooks exposed by `GhostDialogContent` (GHO-209). Optional so
|
|
145
|
+
* `GhostDrawerContent`, which does not expose them, keeps the defaults.
|
|
146
|
+
*/
|
|
147
|
+
focusReady?: boolean;
|
|
148
|
+
initialFocus?: (() => HTMLElement | null) | undefined;
|
|
149
|
+
returnFocus?: (() => HTMLElement | null) | undefined;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Content part: the dialog surface. Composes scroll lock, background inert,
|
|
153
|
+
* dismissable layer, and focus scope, links Title/Description, and emits
|
|
154
|
+
* `GHOST002` / `GHOST003` development diagnostics.
|
|
155
|
+
*
|
|
156
|
+
* `extraAttrs` lets a family add its own hooks (for example the drawer's
|
|
157
|
+
* `data-side` / `data-dir`). They are applied after consumer attrs and before
|
|
158
|
+
* the ARIA relationships, so they cannot override role or labelling.
|
|
159
|
+
*
|
|
160
|
+
* `suppressRestoreFocus` lets a family close without restoring focus when the
|
|
161
|
+
* user already moved focus elsewhere (the non-modal command palette's focus
|
|
162
|
+
* departure, GHO-166). Dialog and Drawer do not pass it.
|
|
163
|
+
*/
|
|
164
|
+
export declare function useDialogContentPart(context: DialogPartsContext, props: DialogContentPartProps, hostRef: Readonly<ShallowRef<unknown>>, options?: {
|
|
165
|
+
extraAttrs?: ExtraAttrs;
|
|
166
|
+
suppressRestoreFocus?: () => boolean;
|
|
167
|
+
}): {
|
|
168
|
+
attrs: import("vue").Attrs;
|
|
169
|
+
contentElement: ComputedRef<HTMLElement | null>;
|
|
170
|
+
presentElement: ComputedRef<HTMLElement | null>;
|
|
171
|
+
isPresent: ComputedRef<boolean>;
|
|
172
|
+
contentAttrs: ComputedRef<Record<string, unknown> & {
|
|
173
|
+
inert?: boolean;
|
|
174
|
+
style?: unknown;
|
|
175
|
+
}>;
|
|
176
|
+
exposed: DialogPartExposed;
|
|
177
|
+
};
|
|
178
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal module-level stack of active dismissable layers (per copy of
|
|
3
|
+
* `@ghostvue/vue`). Shared between `useDismissableLayer` and `useFocusScope`
|
|
4
|
+
* without a circular import or new public exports.
|
|
5
|
+
*/
|
|
6
|
+
export interface DismissableLayerEntry {
|
|
7
|
+
readonly id: symbol;
|
|
8
|
+
readonly element: HTMLElement;
|
|
9
|
+
readonly branches?: (() => readonly HTMLElement[]) | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Escape-only layers (such as an open tooltip) take part in `Escape`
|
|
12
|
+
* ordering but never in outside-pointer dismissal or focus ownership, so they
|
|
13
|
+
* cannot block or steal those interactions from the layers beneath them.
|
|
14
|
+
*/
|
|
15
|
+
readonly escapeOnly?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function pushDismissableLayer(entry: DismissableLayerEntry): void;
|
|
18
|
+
export declare function removeDismissableLayer(entry: DismissableLayerEntry): void;
|
|
19
|
+
export declare function getTopDismissableLayer(): DismissableLayerEntry | undefined;
|
|
20
|
+
/** Active layers ordered bottom to top. Read-only view of the live stack. */
|
|
21
|
+
export declare function getDismissableLayers(): readonly DismissableLayerEntry[];
|
|
22
|
+
export declare function hasDismissableLayers(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Returns `true` when `activeElement` sits inside a dismissable layer stacked
|
|
25
|
+
* above the layer owning `scopeRoot`. Used by a trapped `useFocusScope` to
|
|
26
|
+
* ignore `Tab` while focus lives inside a portaled popover opened from the modal.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isFocusInUpperDismissableLayer(scopeRoot: HTMLElement, activeElement: Element | null): boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schedules reconciliation after the `reset` event has fully dispatched so
|
|
3
|
+
* `defaultPrevented` is final (including listeners on `document` and `window`
|
|
4
|
+
* registered after the library listener).
|
|
5
|
+
*
|
|
6
|
+
* Uses a macrotask (`setTimeout(0)`), not a microtask: after each listener the
|
|
7
|
+
* engine can drain microtasks while dispatch is still in progress (for example
|
|
8
|
+
* when reset comes from a real reset-button click). A microtask checkpoint can
|
|
9
|
+
* run before a later `window` listener calls `preventDefault`; a task runs only
|
|
10
|
+
* after the whole dispatch finishes.
|
|
11
|
+
*/
|
|
12
|
+
export declare function afterNativeFormReset(event: Event, apply: () => void): () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Registers a callback to run once every {@link afterNativeFormReset} macrotask
|
|
15
|
+
* scheduled for `event` has finished or been cancelled on unmount. Invokes
|
|
16
|
+
* `onSettled` immediately when no pending callbacks remain for `event`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function afterNativeFormResetSettled(event: Event, onSettled: () => void): () => void;
|
|
19
|
+
/** Resolves once every {@link afterNativeFormReset} callback for `event` settles. */
|
|
20
|
+
export declare function whenNativeFormResetSettled(event: Event): Promise<void>;
|
|
21
|
+
/** Awaits the macrotask scheduled by {@link afterNativeFormReset} (for tests). */
|
|
22
|
+
export declare function waitForFormResetDeferral(): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Listens for a native `reset` on the control's current owner form. Uses bubble
|
|
25
|
+
* phase on `document` so form-scoped `preventDefault` runs during dispatch.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useNativeFormReset(getElement: () => (HTMLElement & {
|
|
28
|
+
form?: HTMLFormElement | null;
|
|
29
|
+
}) | null, apply: (owner: HTMLFormElement) => void): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface GetPaginationRangeOptions {
|
|
2
|
+
/** 1-based current page. */
|
|
3
|
+
page: number;
|
|
4
|
+
/** Total pages (values below 1 are treated as 1). */
|
|
5
|
+
pageCount: number;
|
|
6
|
+
/** Pages adjacent to the current page. Invalid values fall back to 1. */
|
|
7
|
+
siblingCount?: number;
|
|
8
|
+
/** Pages always visible at the start and end. Invalid values fall back to 1. */
|
|
9
|
+
boundaryCount?: number;
|
|
10
|
+
}
|
|
11
|
+
export type GhostPaginationRangeEntry = {
|
|
12
|
+
type: 'page';
|
|
13
|
+
page: number;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'ellipsis';
|
|
16
|
+
placement: 'start' | 'end';
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Pure pagination range with ellipsis markers. Used by {@link useGhostPagination}
|
|
20
|
+
* and covered by unit tests so ellipsis placement stays stable.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getPaginationRange(options: GetPaginationRangeOptions): GhostPaginationRangeEntry[];
|
|
23
|
+
/** @deprecated Use {@link GhostPaginationRangeEntry}. */
|
|
24
|
+
export type GhostPaginationItem = GhostPaginationRangeEntry;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small local tabbable query. Dialog, menus, and composites need this without
|
|
3
|
+
* taking on `tabbable` / `focus-trap` as a runtime dependency.
|
|
4
|
+
*
|
|
5
|
+
* Visibility uses computed style and hiding attributes rather than layout
|
|
6
|
+
* metrics: jsdom reports 0×0 for every element, so offsetWidth would empty
|
|
7
|
+
* the sequence in unit tests and still be wrong for zero-size controls.
|
|
8
|
+
*
|
|
9
|
+
* Scope boundary: queries light-DOM candidates under `root` (or the direct tree
|
|
10
|
+
* of `root` when `root` itself is a `ShadowRoot`). Does not traverse into nested
|
|
11
|
+
* open shadow roots or closed shadow roots.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getTabbableElements(root: ParentNode): HTMLElement[];
|
|
14
|
+
/** Focusable includes tabindex="-1", which roving items use as the resting stop. */
|
|
15
|
+
export declare function getFocusableElements(root: ParentNode): HTMLElement[];
|
|
16
|
+
export declare function isFocusable(element: HTMLElement): boolean;
|
|
17
|
+
export declare function isSameRadioGroup(a: Element, b: Element): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Composite navigation policy: roving widgets skip these items but loading
|
|
20
|
+
* controls may keep `aria-disabled` while remaining natively focusable.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isDisabledElement(element: HTMLElement): boolean;
|