@ghostvue/vue 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +40 -2
  3. package/dist/.registries/component-names.generated.d.ts +3 -0
  4. package/dist/GhostAccordion.vue.d.ts +38 -0
  5. package/dist/GhostAccordionContent.vue.d.ts +26 -0
  6. package/dist/GhostAccordionItem.vue.d.ts +20 -0
  7. package/dist/GhostAccordionTrigger.vue.d.ts +23 -0
  8. package/dist/GhostAvatar.vue.d.ts +27 -0
  9. package/dist/GhostBadge.vue.d.ts +16 -0
  10. package/dist/GhostBreadcrumb.vue.d.ts +28 -0
  11. package/dist/GhostBreadcrumbEllipsis.vue.d.ts +20 -0
  12. package/dist/GhostBreadcrumbItem.vue.d.ts +25 -0
  13. package/dist/GhostBreadcrumbLink.vue.d.ts +25 -0
  14. package/dist/GhostBreadcrumbList.vue.d.ts +25 -0
  15. package/dist/GhostBreadcrumbPage.vue.d.ts +25 -0
  16. package/dist/GhostBreadcrumbSeparator.vue.d.ts +25 -0
  17. package/dist/GhostButton.vue.d.ts +25 -0
  18. package/dist/GhostCalendar.vue.d.ts +57 -0
  19. package/dist/GhostCalendarCell.vue.d.ts +35 -0
  20. package/dist/GhostCalendarGrid.vue.d.ts +19 -0
  21. package/dist/GhostCalendarHeader.vue.d.ts +24 -0
  22. package/dist/GhostCalendarHeading.vue.d.ts +22 -0
  23. package/dist/GhostCalendarNextButton.vue.d.ts +24 -0
  24. package/dist/GhostCalendarPrevButton.vue.d.ts +24 -0
  25. package/dist/GhostCard.vue.d.ts +18 -0
  26. package/dist/GhostCheckbox.vue.d.ts +48 -0
  27. package/dist/GhostCollapsible.vue.d.ts +31 -0
  28. package/dist/GhostCollapsibleContent.vue.d.ts +30 -0
  29. package/dist/GhostCollapsibleTrigger.vue.d.ts +28 -0
  30. package/dist/GhostCombobox.vue.d.ts +69 -0
  31. package/dist/GhostComboboxContent.vue.d.ts +41 -0
  32. package/dist/GhostComboboxEmpty.vue.d.ts +21 -0
  33. package/dist/GhostComboboxGroup.vue.d.ts +21 -0
  34. package/dist/GhostComboboxInput.vue.d.ts +11 -0
  35. package/dist/GhostComboboxLabel.vue.d.ts +21 -0
  36. package/dist/GhostComboboxOption.vue.d.ts +29 -0
  37. package/dist/GhostComboboxTrigger.vue.d.ts +26 -0
  38. package/dist/GhostCommandPalette.vue.d.ts +57 -0
  39. package/dist/GhostCommandPaletteContent.vue.d.ts +47 -0
  40. package/dist/GhostCommandPaletteEmpty.vue.d.ts +25 -0
  41. package/dist/GhostCommandPaletteGroup.vue.d.ts +25 -0
  42. package/dist/GhostCommandPaletteInput.vue.d.ts +13 -0
  43. package/dist/GhostCommandPaletteItem.vue.d.ts +33 -0
  44. package/dist/GhostCommandPaletteLabel.vue.d.ts +25 -0
  45. package/dist/GhostCommandPaletteList.vue.d.ts +25 -0
  46. package/dist/GhostCommandPaletteOverlay.vue.d.ts +32 -0
  47. package/dist/GhostCommandPaletteSeparator.vue.d.ts +10 -0
  48. package/dist/GhostCommandPaletteTitle.vue.d.ts +25 -0
  49. package/dist/GhostCommandPaletteTrigger.vue.d.ts +28 -0
  50. package/dist/GhostContextMenu.vue.d.ts +26 -0
  51. package/dist/GhostContextMenuCheckboxItem.vue.d.ts +63 -0
  52. package/dist/GhostContextMenuContent.vue.d.ts +39 -0
  53. package/dist/GhostContextMenuGroup.vue.d.ts +21 -0
  54. package/dist/GhostContextMenuItem.vue.d.ts +30 -0
  55. package/dist/GhostContextMenuLabel.vue.d.ts +21 -0
  56. package/dist/GhostContextMenuRadioGroup.vue.d.ts +31 -0
  57. package/dist/GhostContextMenuRadioItem.vue.d.ts +31 -0
  58. package/dist/GhostContextMenuSeparator.vue.d.ts +11 -0
  59. package/dist/GhostContextMenuTrigger.vue.d.ts +28 -0
  60. package/dist/GhostDataTable.vue.d.ts +29 -0
  61. package/dist/GhostDataTablePreset.vue.d.ts +21 -0
  62. package/dist/GhostDataTableTable.vue.d.ts +20 -0
  63. package/dist/GhostDatePicker.vue.d.ts +106 -0
  64. package/dist/GhostDatePickerCalendar.vue.d.ts +16 -0
  65. package/dist/GhostDatePickerContent.vue.d.ts +46 -0
  66. package/dist/GhostDatePickerInput.vue.d.ts +19 -0
  67. package/dist/GhostDatePickerTrigger.vue.d.ts +14 -0
  68. package/dist/GhostDialog.vue.d.ts +31 -0
  69. package/dist/GhostDialogClose.vue.d.ts +28 -0
  70. package/dist/GhostDialogContent.vue.d.ts +50 -0
  71. package/dist/GhostDialogDescription.vue.d.ts +25 -0
  72. package/dist/GhostDialogOverlay.vue.d.ts +32 -0
  73. package/dist/GhostDialogTitle.vue.d.ts +25 -0
  74. package/dist/GhostDialogTrigger.vue.d.ts +28 -0
  75. package/dist/GhostDrawer.vue.d.ts +39 -0
  76. package/dist/GhostDrawerClose.vue.d.ts +28 -0
  77. package/dist/GhostDrawerContent.vue.d.ts +47 -0
  78. package/dist/GhostDrawerDescription.vue.d.ts +25 -0
  79. package/dist/GhostDrawerOverlay.vue.d.ts +32 -0
  80. package/dist/GhostDrawerTitle.vue.d.ts +25 -0
  81. package/dist/GhostDrawerTrigger.vue.d.ts +28 -0
  82. package/dist/GhostDropdownMenu.vue.d.ts +26 -0
  83. package/dist/GhostDropdownMenuCheckboxItem.vue.d.ts +63 -0
  84. package/dist/GhostDropdownMenuContent.vue.d.ts +39 -0
  85. package/dist/GhostDropdownMenuGroup.vue.d.ts +21 -0
  86. package/dist/GhostDropdownMenuItem.vue.d.ts +30 -0
  87. package/dist/GhostDropdownMenuLabel.vue.d.ts +21 -0
  88. package/dist/GhostDropdownMenuRadioGroup.vue.d.ts +31 -0
  89. package/dist/GhostDropdownMenuRadioItem.vue.d.ts +31 -0
  90. package/dist/GhostDropdownMenuSeparator.vue.d.ts +11 -0
  91. package/dist/GhostDropdownMenuTrigger.vue.d.ts +26 -0
  92. package/dist/GhostEmptyState.vue.d.ts +19 -0
  93. package/dist/GhostField.vue.d.ts +28 -0
  94. package/dist/GhostFieldControl.vue.d.ts +13 -0
  95. package/dist/GhostFieldDescription.vue.d.ts +21 -0
  96. package/dist/GhostFieldError.vue.d.ts +21 -0
  97. package/dist/GhostFieldLabel.vue.d.ts +30 -0
  98. package/dist/GhostFileUpload.vue.d.ts +64 -0
  99. package/dist/GhostFileUploadDropzone.vue.d.ts +13 -0
  100. package/dist/GhostFileUploadItem.vue.d.ts +17 -0
  101. package/dist/GhostFileUploadItemRemove.vue.d.ts +13 -0
  102. package/dist/GhostFileUploadList.vue.d.ts +13 -0
  103. package/dist/GhostFileUploadTrigger.vue.d.ts +19 -0
  104. package/dist/GhostHoverCard.vue.d.ts +37 -0
  105. package/dist/GhostHoverCardContent.vue.d.ts +47 -0
  106. package/dist/GhostHoverCardTrigger.vue.d.ts +28 -0
  107. package/dist/GhostInlineAlert.vue.d.ts +19 -0
  108. package/dist/GhostInput.vue.d.ts +26 -0
  109. package/dist/GhostInteractiveSurface.vue.d.ts +25 -0
  110. package/dist/GhostKbd.vue.d.ts +25 -0
  111. package/dist/GhostLink.vue.d.ts +25 -0
  112. package/dist/GhostMenubar.vue.d.ts +27 -0
  113. package/dist/GhostMenubarCheckboxItem.vue.d.ts +63 -0
  114. package/dist/GhostMenubarContent.vue.d.ts +39 -0
  115. package/dist/GhostMenubarGroup.vue.d.ts +21 -0
  116. package/dist/GhostMenubarItem.vue.d.ts +30 -0
  117. package/dist/GhostMenubarLabel.vue.d.ts +21 -0
  118. package/dist/GhostMenubarMenu.vue.d.ts +26 -0
  119. package/dist/GhostMenubarRadioGroup.vue.d.ts +31 -0
  120. package/dist/GhostMenubarRadioItem.vue.d.ts +31 -0
  121. package/dist/GhostMenubarSeparator.vue.d.ts +11 -0
  122. package/dist/GhostMenubarTrigger.vue.d.ts +26 -0
  123. package/dist/GhostNumberInput.vue.d.ts +37 -0
  124. package/dist/GhostPagination.vue.d.ts +53 -0
  125. package/dist/GhostPopover.vue.d.ts +28 -0
  126. package/dist/GhostPopoverClose.vue.d.ts +28 -0
  127. package/dist/GhostPopoverContent.vue.d.ts +47 -0
  128. package/dist/GhostPopoverTrigger.vue.d.ts +28 -0
  129. package/dist/GhostPortal.vue.d.ts +28 -0
  130. package/dist/GhostProgress.vue.d.ts +14 -0
  131. package/dist/GhostRadioGroup.vue.d.ts +36 -0
  132. package/dist/GhostRadioGroupItem.vue.d.ts +10 -0
  133. package/dist/GhostScrollArea.vue.d.ts +17 -0
  134. package/dist/GhostScrollSpy.vue.d.ts +57 -0
  135. package/dist/GhostScrollSpyItem.vue.d.ts +26 -0
  136. package/dist/GhostScrollSpyLink.vue.d.ts +27 -0
  137. package/dist/GhostScrollSpyList.vue.d.ts +24 -0
  138. package/dist/GhostSegmentedControl.vue.d.ts +44 -0
  139. package/dist/GhostSegmentedControlIndicator.vue.d.ts +3 -0
  140. package/dist/GhostSegmentedControlItem.vue.d.ts +30 -0
  141. package/dist/GhostSelect.vue.d.ts +51 -0
  142. package/dist/GhostSelectContent.vue.d.ts +41 -0
  143. package/dist/GhostSelectGroup.vue.d.ts +21 -0
  144. package/dist/GhostSelectLabel.vue.d.ts +21 -0
  145. package/dist/GhostSelectOption.vue.d.ts +29 -0
  146. package/dist/GhostSelectTrigger.vue.d.ts +26 -0
  147. package/dist/GhostSelectValue.vue.d.ts +17 -0
  148. package/dist/GhostSeparator.vue.d.ts +7 -0
  149. package/dist/GhostSkeleton.vue.d.ts +18 -0
  150. package/dist/GhostSlider.vue.d.ts +141 -0
  151. package/dist/GhostSpinner.vue.d.ts +8 -0
  152. package/dist/GhostSwitch.vue.d.ts +37 -0
  153. package/dist/GhostTable.vue.d.ts +15 -0
  154. package/dist/GhostTableBody.vue.d.ts +13 -0
  155. package/dist/GhostTableCaption.vue.d.ts +13 -0
  156. package/dist/GhostTableCell.vue.d.ts +13 -0
  157. package/dist/GhostTableFoot.vue.d.ts +13 -0
  158. package/dist/GhostTableHead.vue.d.ts +13 -0
  159. package/dist/GhostTableHeaderCell.vue.d.ts +13 -0
  160. package/dist/GhostTableRow.vue.d.ts +13 -0
  161. package/dist/GhostTabs.vue.d.ts +37 -0
  162. package/dist/GhostTabsContent.vue.d.ts +27 -0
  163. package/dist/GhostTabsList.vue.d.ts +25 -0
  164. package/dist/GhostTabsTrigger.vue.d.ts +30 -0
  165. package/dist/GhostTextarea.vue.d.ts +29 -0
  166. package/dist/GhostToast.vue.d.ts +17 -0
  167. package/dist/GhostToastAction.vue.d.ts +17 -0
  168. package/dist/GhostToastClose.vue.d.ts +16 -0
  169. package/dist/GhostToastDescription.vue.d.ts +12 -0
  170. package/dist/GhostToastProvider.vue.d.ts +24 -0
  171. package/dist/GhostToastTitle.vue.d.ts +12 -0
  172. package/dist/GhostToastViewport.vue.d.ts +25 -0
  173. package/dist/GhostToggleGroup.vue.d.ts +41 -0
  174. package/dist/GhostToggleGroupItem.vue.d.ts +30 -0
  175. package/dist/GhostToolbar.vue.d.ts +29 -0
  176. package/dist/GhostTooltip.vue.d.ts +36 -0
  177. package/dist/GhostTooltipContent.vue.d.ts +47 -0
  178. package/dist/GhostTooltipProvider.vue.d.ts +16 -0
  179. package/dist/GhostTooltipTrigger.vue.d.ts +28 -0
  180. package/dist/GhostTree.vue.d.ts +59 -0
  181. package/dist/GhostTreeGroup.vue.d.ts +22 -0
  182. package/dist/GhostTreeItem.vue.d.ts +27 -0
  183. package/dist/GhostTreeTrigger.vue.d.ts +25 -0
  184. package/dist/GhostVisuallyHidden.vue.d.ts +19 -0
  185. package/dist/accordion-header-keyboard.d.ts +11 -0
  186. package/dist/calendar-date-math.d.ts +16 -0
  187. package/dist/calendar-intl.d.ts +7 -0
  188. package/dist/calendar-public-date.d.ts +1 -0
  189. package/dist/command-palette-context.d.ts +6 -0
  190. package/dist/data-table-interaction.d.ts +57 -0
  191. package/dist/data-table-processing.d.ts +32 -0
  192. package/dist/data-table-render.d.ts +40 -0
  193. package/dist/data-table-slot-bindings.d.ts +21 -0
  194. package/dist/date-picker-calendar-bridge.d.ts +25 -0
  195. package/dist/date-picker-value.d.ts +33 -0
  196. package/dist/define-data-table-columns.d.ts +89 -0
  197. package/dist/dev-codes.d.ts +143 -0
  198. package/dist/dialog-shared.d.ts +169 -0
  199. package/dist/dismissable-layer-stack.d.ts +27 -0
  200. package/dist/form-reset.d.ts +21 -0
  201. package/dist/get-pagination-range.d.ts +24 -0
  202. package/dist/get-tabbable-elements.d.ts +22 -0
  203. package/dist/ghost-accordion.d.ts +120 -0
  204. package/dist/ghost-avatar.d.ts +41 -0
  205. package/dist/ghost-badge.d.ts +11 -0
  206. package/dist/ghost-breadcrumb.d.ts +114 -0
  207. package/dist/ghost-button.d.ts +39 -0
  208. package/dist/ghost-calendar.d.ts +148 -0
  209. package/dist/ghost-card.d.ts +29 -0
  210. package/dist/ghost-checkbox.d.ts +51 -0
  211. package/dist/ghost-collapsible.d.ts +104 -0
  212. package/dist/ghost-combobox.d.ts +217 -0
  213. package/dist/ghost-command-palette.d.ts +377 -0
  214. package/dist/ghost-context-menu.d.ts +226 -0
  215. package/dist/ghost-data-table-preset.d.ts +107 -0
  216. package/dist/ghost-data-table-table.d.ts +76 -0
  217. package/dist/ghost-data-table.d.ts +508 -0
  218. package/dist/ghost-date-picker.d.ts +301 -0
  219. package/dist/ghost-dialog.d.ts +254 -0
  220. package/dist/ghost-drawer.d.ts +268 -0
  221. package/dist/ghost-dropdown-menu.d.ts +226 -0
  222. package/dist/ghost-empty-state.d.ts +26 -0
  223. package/dist/ghost-field.d.ts +151 -0
  224. package/dist/ghost-file-upload-accept.d.ts +32 -0
  225. package/dist/ghost-file-upload-messages.d.ts +14 -0
  226. package/dist/ghost-file-upload.d.ts +325 -0
  227. package/dist/ghost-hover-card.d.ts +192 -0
  228. package/dist/ghost-inline-alert.d.ts +34 -0
  229. package/dist/ghost-input.d.ts +71 -0
  230. package/dist/ghost-interactive-surface.d.ts +41 -0
  231. package/dist/ghost-kbd.d.ts +39 -0
  232. package/dist/ghost-link.d.ts +58 -0
  233. package/dist/ghost-menubar.d.ts +260 -0
  234. package/dist/ghost-number-input.d.ts +88 -0
  235. package/dist/ghost-pagination.d.ts +92 -0
  236. package/dist/ghost-popover.d.ts +188 -0
  237. package/dist/ghost-portal.d.ts +21 -0
  238. package/dist/ghost-progress.d.ts +40 -0
  239. package/dist/ghost-radio-group.d.ts +100 -0
  240. package/dist/ghost-scroll-area.d.ts +46 -0
  241. package/dist/ghost-scroll-spy.d.ts +150 -0
  242. package/dist/ghost-segmented-control.d.ts +124 -0
  243. package/dist/ghost-select.d.ts +131 -0
  244. package/dist/ghost-separator.d.ts +33 -0
  245. package/dist/ghost-skeleton.d.ts +14 -0
  246. package/dist/ghost-slider.d.ts +99 -0
  247. package/dist/ghost-spinner.d.ts +22 -0
  248. package/dist/ghost-switch.d.ts +77 -0
  249. package/dist/ghost-table.d.ts +62 -0
  250. package/dist/ghost-tabs.d.ts +154 -0
  251. package/dist/ghost-textarea.d.ts +78 -0
  252. package/dist/ghost-toast.d.ts +219 -0
  253. package/dist/ghost-toggle-group.d.ts +123 -0
  254. package/dist/ghost-toolbar.d.ts +23 -0
  255. package/dist/ghost-tooltip-provider.d.ts +37 -0
  256. package/dist/ghost-tooltip.d.ts +190 -0
  257. package/dist/ghost-tree.d.ts +355 -0
  258. package/dist/ghost-visually-hidden.d.ts +27 -0
  259. package/dist/ghostvue.js +17534 -0
  260. package/dist/has-tabbable-descendants.d.ts +2 -0
  261. package/dist/index.d.ts +307 -0
  262. package/dist/invoke-attr-handler.d.ts +15 -0
  263. package/dist/is-ime-composing.d.ts +28 -0
  264. package/dist/manifest.json +17098 -0
  265. package/dist/measure-scroll-overflow.d.ts +6 -0
  266. package/dist/menu-item-activation.d.ts +39 -0
  267. package/dist/resolver.d.ts +49 -0
  268. package/dist/resolver.js +14 -0
  269. package/dist/scroll-spy-motion.d.ts +26 -0
  270. package/dist/sort-by-document-order.d.ts +23 -0
  271. package/dist/sync-calendar-focus-tab-stops.d.ts +2 -0
  272. package/dist/sync-segmented-control-item-order.d.ts +5 -0
  273. package/dist/sync-tabs-selection-tab-stops.d.ts +7 -0
  274. package/dist/sync-toggle-group-selection-tab-stops.d.ts +14 -0
  275. package/dist/typeahead-match.d.ts +15 -0
  276. package/dist/use-collapsible-content-hidden.d.ts +28 -0
  277. package/dist/use-controllable-state.d.ts +20 -0
  278. package/dist/use-dismissable-layer.d.ts +40 -0
  279. package/dist/use-floating.d.ts +38 -0
  280. package/dist/use-focus-scope.d.ts +34 -0
  281. package/dist/use-ghost-accordion.d.ts +5 -0
  282. package/dist/use-ghost-avatar.d.ts +28 -0
  283. package/dist/use-ghost-badge.d.ts +13 -0
  284. package/dist/use-ghost-breadcrumb.d.ts +19 -0
  285. package/dist/use-ghost-button.d.ts +18 -0
  286. package/dist/use-ghost-calendar.d.ts +3 -0
  287. package/dist/use-ghost-card.d.ts +15 -0
  288. package/dist/use-ghost-checkbox.d.ts +24 -0
  289. package/dist/use-ghost-collapsible.d.ts +8 -0
  290. package/dist/use-ghost-combobox.d.ts +65 -0
  291. package/dist/use-ghost-command-palette.d.ts +24 -0
  292. package/dist/use-ghost-context-menu.d.ts +14 -0
  293. package/dist/use-ghost-data-table.d.ts +55 -0
  294. package/dist/use-ghost-date-picker.d.ts +11 -0
  295. package/dist/use-ghost-dialog.d.ts +10 -0
  296. package/dist/use-ghost-drawer.d.ts +11 -0
  297. package/dist/use-ghost-dropdown-menu.d.ts +5 -0
  298. package/dist/use-ghost-empty-state.d.ts +18 -0
  299. package/dist/use-ghost-field-part-content.d.ts +15 -0
  300. package/dist/use-ghost-field.d.ts +10 -0
  301. package/dist/use-ghost-file-upload.d.ts +16 -0
  302. package/dist/use-ghost-hover-card.d.ts +8 -0
  303. package/dist/use-ghost-id.d.ts +6 -0
  304. package/dist/use-ghost-inline-alert.d.ts +20 -0
  305. package/dist/use-ghost-input.d.ts +29 -0
  306. package/dist/use-ghost-interactive-surface.d.ts +21 -0
  307. package/dist/use-ghost-kbd.d.ts +35 -0
  308. package/dist/use-ghost-link.d.ts +20 -0
  309. package/dist/use-ghost-menu-collection.d.ts +19 -0
  310. package/dist/use-ghost-menubar-menu.d.ts +3 -0
  311. package/dist/use-ghost-menubar.d.ts +10 -0
  312. package/dist/use-ghost-number-input.d.ts +63 -0
  313. package/dist/use-ghost-pagination.d.ts +22 -0
  314. package/dist/use-ghost-popover.d.ts +8 -0
  315. package/dist/use-ghost-progress.d.ts +33 -0
  316. package/dist/use-ghost-radio-group.d.ts +5 -0
  317. package/dist/use-ghost-scroll-area.d.ts +23 -0
  318. package/dist/use-ghost-scroll-spy.d.ts +25 -0
  319. package/dist/use-ghost-segmented-control.d.ts +6 -0
  320. package/dist/use-ghost-select.d.ts +52 -0
  321. package/dist/use-ghost-separator.d.ts +19 -0
  322. package/dist/use-ghost-skeleton.d.ts +19 -0
  323. package/dist/use-ghost-slider.d.ts +65 -0
  324. package/dist/use-ghost-spinner.d.ts +18 -0
  325. package/dist/use-ghost-switch.d.ts +39 -0
  326. package/dist/use-ghost-table.d.ts +70 -0
  327. package/dist/use-ghost-tabs.d.ts +5 -0
  328. package/dist/use-ghost-textarea.d.ts +44 -0
  329. package/dist/use-ghost-toast.d.ts +56 -0
  330. package/dist/use-ghost-toggle-group.d.ts +6 -0
  331. package/dist/use-ghost-toolbar.d.ts +23 -0
  332. package/dist/use-ghost-tooltip.d.ts +8 -0
  333. package/dist/use-ghost-tree.d.ts +14 -0
  334. package/dist/use-ghost-visually-hidden.d.ts +35 -0
  335. package/dist/use-inert-others.d.ts +20 -0
  336. package/dist/use-roving-focus.d.ts +20 -0
  337. package/dist/use-scroll-lock.d.ts +13 -0
  338. package/package.json +59 -4
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Internal `accept` matcher for {@link GhostFileUpload}. Private to
3
+ * `@ghostvue/vue` until a second consumer proves a need (see the spec's
4
+ * Composition section).
5
+ *
6
+ * The matcher is client-side UX only: `file.type` and `file.name` come from
7
+ * the operating system and the user, so a match is not a guarantee about the
8
+ * file's real content.
9
+ */
10
+ /** One parsed, valid `accept` token. Values are lowercased. */
11
+ export type GhostFileUploadAcceptToken = {
12
+ kind: 'extension';
13
+ value: string;
14
+ } | {
15
+ kind: 'wildcard';
16
+ value: string;
17
+ } | {
18
+ kind: 'mime';
19
+ value: string;
20
+ };
21
+ /**
22
+ * Parses native `accept` grammar into valid tokens. Tokens are comma-separated,
23
+ * trimmed, and lowercased; empty and invalid tokens are dropped, matching how
24
+ * browsers ignore them in the picker. An empty result means "accept everything".
25
+ */
26
+ export declare function parseGhostFileUploadAccept(accept: string | undefined): GhostFileUploadAcceptToken[];
27
+ /**
28
+ * Whether `file` satisfies at least one token. An empty token list accepts
29
+ * every file. An empty `file.type` (unknown to the operating system) matches
30
+ * extension tokens only: the matcher never guesses a MIME type.
31
+ */
32
+ export declare function matchesGhostFileUploadAccept(file: Pick<File, 'name' | 'type'>, tokens: readonly GhostFileUploadAcceptToken[]): boolean;
@@ -0,0 +1,14 @@
1
+ import type { GhostFileUploadMessages } from './ghost-file-upload.js';
2
+ /**
3
+ * Formats a byte count for `{limit}`, for example `5 MB` or `1.5 kB`, with
4
+ * `Intl.NumberFormat('en', { style: 'unit', unitDisplay: 'short',
5
+ * maximumFractionDigits: 1 })`.
6
+ */
7
+ export declare function formatGhostFileUploadSize(bytes: number): string;
8
+ /** English defaults for every {@link GhostFileUploadMessages} key. */
9
+ export declare const ghostFileUploadDefaultMessages: GhostFileUploadMessages;
10
+ /**
11
+ * Resolves one message key against consumer overrides at call time, so a
12
+ * reactive `messages` object updates later announcements without caching.
13
+ */
14
+ export declare function resolveGhostFileUploadMessage<Key extends keyof GhostFileUploadMessages>(overrides: Partial<GhostFileUploadMessages> | undefined, key: Key): GhostFileUploadMessages[Key];
@@ -0,0 +1,325 @@
1
+ import type { ComputedRef, CSSProperties, InjectionKey, MaybeRef, MaybeRefOrGetter, ShallowRef } from 'vue';
2
+ /** Why a file was not added. The first failing validation step decides. */
3
+ export type GhostFileUploadRejectionReason = 'file-type' | 'file-too-large' | 'too-many-files' | 'custom';
4
+ /** Second argument of {@link GhostFileUploadValidate}. */
5
+ export interface GhostFileUploadValidateContext {
6
+ /** Accepted files so far: the current list plus earlier accepted files of this batch. */
7
+ readonly files: readonly File[];
8
+ }
9
+ /**
10
+ * Synchronous, pure consumer check that runs after `accept` and `maxFileSize`
11
+ * and before capacity. Return `null` or `undefined` to accept, or a string
12
+ * (the rejection `code`, possibly empty) to reject. A throw propagates to
13
+ * Vue's error handler and nothing from the batch is committed.
14
+ */
15
+ export type GhostFileUploadValidate = (file: File, context: GhostFileUploadValidateContext) => string | null | undefined;
16
+ /** Everything `messages.rejected` needs; also the basis of the public payload. */
17
+ export interface GhostFileUploadRejectionContext {
18
+ file: File;
19
+ reason: GhostFileUploadRejectionReason;
20
+ /** The string returned by `validate` when `reason` is `'custom'`. */
21
+ code?: string;
22
+ /** Present when `reason` is `'too-many-files'`. */
23
+ maxFiles?: number;
24
+ /** Present when `reason` is `'file-too-large'`, in bytes. */
25
+ maxFileSize?: number;
26
+ /** Present when `reason` is `'file-type'`. */
27
+ accept?: string;
28
+ }
29
+ /** One rejected file from an intake batch, emitted through `reject`. */
30
+ export interface GhostFileUploadRejection extends GhostFileUploadRejectionContext {
31
+ /** English default from `messages.rejected`; localize through `messages`. */
32
+ message: string;
33
+ }
34
+ /** A list entry with a key for `v-for`. */
35
+ export interface GhostFileUploadEntry {
36
+ /** Opaque, unique within a root, stable for a File instance; not for persistence. */
37
+ id: string;
38
+ file: File;
39
+ }
40
+ /**
41
+ * Announcement and label text. Callbacks own pluralization. Overrides are
42
+ * read when a message is produced, so a reactive object updates later
43
+ * announcements. Returning an empty string omits that part of an announcement.
44
+ */
45
+ export interface GhostFileUploadMessages {
46
+ /** @default `1 file added.` / `{count} files added.` */
47
+ added(count: number): string;
48
+ /** @default `{name} removed. {n} files remaining.` (with zero and one forms) */
49
+ removed(file: File, remaining: number): string;
50
+ /** @default `All files removed.` */
51
+ cleared(): string;
52
+ /** Per-reason sentence, also used as `GhostFileUploadRejection.message`. */
53
+ rejected(rejection: GhostFileUploadRejectionContext): string;
54
+ /** Used when one intake has more than three rejections. @default `{count} files were not added.` */
55
+ rejectedSummary(count: number): string;
56
+ /** Default accessible name of `GhostFileUploadItemRemove`. @default `Remove {name}` */
57
+ removeLabel(file: File): string;
58
+ }
59
+ /**
60
+ * Props for the {@link GhostFileUpload} root. `aria-describedby` set on the
61
+ * root is routed to the trigger; `aria-invalid` is ignored in favor of
62
+ * `invalid`; every other attribute, `class`, `style`, and listener falls
63
+ * through to the root element.
64
+ */
65
+ export interface GhostFileUploadProps {
66
+ /** Controlled list. `undefined` is uncontrolled; `[]` is a real empty value. */
67
+ modelValue?: File[];
68
+ /**
69
+ * Uncontrolled seed and form-reset baseline, captured once at setup.
70
+ * @default []
71
+ */
72
+ defaultValue?: File[];
73
+ /** Native `accept` grammar; a picker hint that is also enforced on intake. */
74
+ accept?: string;
75
+ /** Total list capacity. Floored; not finite or below 1 is unlimited. `1` turns `multiple` off. */
76
+ maxFiles?: number;
77
+ /** Per-file limit in bytes (equal is accepted). Not finite or negative is unset. */
78
+ maxFileSize?: number;
79
+ /** Synchronous, pure consumer check run after `accept` and `maxFileSize`. */
80
+ validate?: GhostFileUploadValidate;
81
+ /** @default false */
82
+ disabled?: boolean;
83
+ /** Consumer validity, combined with native constraint failure. @default false */
84
+ invalid?: boolean;
85
+ /** Native `required` on the form mirror; no effect without `name`. @default false */
86
+ required?: boolean;
87
+ /** Form mirror `name`. Without it nothing is submitted. */
88
+ name?: string;
89
+ /** `form` attribute for the mirror and picker. */
90
+ form?: string;
91
+ /** Id of the trigger (the labelable control), not of the root. */
92
+ id?: string;
93
+ /** Typed, reactive overrides of announcement and label text. */
94
+ messages?: Partial<GhostFileUploadMessages>;
95
+ /**
96
+ * Cancel file drags and drops outside every dropzone while an enabled
97
+ * dropzone is mounted, so a missed drop does not navigate away.
98
+ * @default true
99
+ */
100
+ preventDocumentDrop?: boolean;
101
+ }
102
+ /** Props for {@link GhostFileUploadTrigger}. */
103
+ export interface GhostFileUploadTriggerProps {
104
+ /** Disables this trigger; combines with the root `disabled`. @default false */
105
+ disabled?: boolean;
106
+ }
107
+ /** Props for {@link GhostFileUploadItem}. */
108
+ export interface GhostFileUploadItemProps {
109
+ /** The entry this item represents. */
110
+ file: File;
111
+ }
112
+ /** Root default slot props. */
113
+ export interface GhostFileUploadSlotProps {
114
+ /** Current list with stable ids for `v-for` keys. */
115
+ entries: readonly GhostFileUploadEntry[];
116
+ /** Rejections from the most recent intake only. */
117
+ rejections: readonly GhostFileUploadRejection[];
118
+ /** `maxFiles` minus list length, never below 0; `undefined` when unlimited. */
119
+ remaining: number | undefined;
120
+ /** Effective invalid state: `invalid` prop or native constraint failure. */
121
+ invalid: boolean;
122
+ /** Opens the native picker. No-op when disabled. */
123
+ openPicker: () => void;
124
+ /** Removes the first identical entry and applies the focus rule. */
125
+ remove: (file: File) => void;
126
+ /** Empties the list and `rejections`, and announces it. */
127
+ clear: () => void;
128
+ /** Empties `rejections` without touching the list. */
129
+ clearRejections: () => void;
130
+ }
131
+ /** {@link GhostFileUploadDropzone} default slot props. */
132
+ export interface GhostFileUploadDropzoneSlotProps {
133
+ /** A file drag is over the dropzone. */
134
+ dragging: boolean;
135
+ }
136
+ /** Template ref contract of {@link GhostFileUpload}. */
137
+ export interface GhostFileUploadExposed {
138
+ /** The root element. */
139
+ readonly element: HTMLElement | null;
140
+ /** Focuses the trigger. */
141
+ focus(options?: FocusOptions): void;
142
+ /** Blurs the trigger. */
143
+ blur(): void;
144
+ /** Opens the native picker; call inside a user gesture. */
145
+ openPicker(): void;
146
+ /** Same as the slot `clear`. */
147
+ clear(): void;
148
+ }
149
+ /** Template ref contract of {@link GhostFileUploadDropzone}. */
150
+ export interface GhostFileUploadDropzoneExposed {
151
+ readonly element: HTMLElement | null;
152
+ }
153
+ /** Template ref contract of {@link GhostFileUploadTrigger}. */
154
+ export interface GhostFileUploadTriggerExposed {
155
+ readonly element: HTMLElement | null;
156
+ focus(options?: FocusOptions): void;
157
+ blur(): void;
158
+ }
159
+ /** Template ref contract of {@link GhostFileUploadList}. */
160
+ export interface GhostFileUploadListExposed {
161
+ /** `null` while the list is empty (the list is not rendered). */
162
+ readonly element: HTMLElement | null;
163
+ }
164
+ /** Template ref contract of {@link GhostFileUploadItem}. */
165
+ export interface GhostFileUploadItemExposed {
166
+ readonly element: HTMLElement | null;
167
+ }
168
+ /** Template ref contract of {@link GhostFileUploadItemRemove}. */
169
+ export interface GhostFileUploadItemRemoveExposed {
170
+ readonly element: HTMLElement | null;
171
+ focus(options?: FocusOptions): void;
172
+ blur(): void;
173
+ }
174
+ /** Options for {@link useGhostFileUpload}. Every value may be a ref or getter. */
175
+ export interface UseGhostFileUploadOptions {
176
+ modelValue?: MaybeRefOrGetter<File[] | undefined>;
177
+ defaultValue?: MaybeRefOrGetter<File[] | undefined>;
178
+ accept?: MaybeRefOrGetter<string | undefined>;
179
+ maxFiles?: MaybeRefOrGetter<number | undefined>;
180
+ maxFileSize?: MaybeRefOrGetter<number | undefined>;
181
+ /**
182
+ * A function or a ref holding one. Not a getter: a bare function is the
183
+ * validator itself, so pass `toRef(props, 'validate')` for a reactive prop.
184
+ */
185
+ validate?: MaybeRef<GhostFileUploadValidate | undefined>;
186
+ disabled?: MaybeRefOrGetter<boolean | undefined>;
187
+ invalid?: MaybeRefOrGetter<boolean | undefined>;
188
+ required?: MaybeRefOrGetter<boolean | undefined>;
189
+ name?: MaybeRefOrGetter<string | undefined>;
190
+ form?: MaybeRefOrGetter<string | undefined>;
191
+ messages?: MaybeRefOrGetter<Partial<GhostFileUploadMessages> | undefined>;
192
+ /** @default true */
193
+ preventDocumentDrop?: MaybeRefOrGetter<boolean | undefined>;
194
+ /** Id applied to the trigger props. Generated when omitted. */
195
+ id?: MaybeRefOrGetter<string | undefined>;
196
+ /** Transient picker input (bind `pickerProps`). */
197
+ picker?: MaybeRefOrGetter<HTMLInputElement | null | undefined>;
198
+ /** Form mirror input (bind `mirrorProps` when `name` is set). */
199
+ mirror?: MaybeRefOrGetter<HTMLInputElement | null | undefined>;
200
+ /** Trigger button, focused on native invalid and as the last removal fallback. */
201
+ trigger?: MaybeRefOrGetter<HTMLElement | null | undefined>;
202
+ /** Synchronous list write; emit `update:modelValue` here. Receives a new array. */
203
+ onChange?: (files: File[]) => void;
204
+ /** Once per intake with at least one rejection, after `onChange`. */
205
+ onReject?: (rejections: GhostFileUploadRejection[]) => void;
206
+ }
207
+ /** Bindings for the transient picker `input[type="file"]`. */
208
+ export interface GhostFileUploadPickerProps {
209
+ type: 'file';
210
+ hidden: true;
211
+ accept: string | undefined;
212
+ multiple: boolean;
213
+ form: string | undefined;
214
+ disabled: boolean;
215
+ tabindex: -1;
216
+ 'data-part': 'picker';
217
+ onChange: (event: Event) => void;
218
+ onClick: (event: MouseEvent) => void;
219
+ }
220
+ /** Bindings for the visually hidden form mirror `input[type="file"]`. */
221
+ export interface GhostFileUploadMirrorProps {
222
+ type: 'file';
223
+ name: string | undefined;
224
+ form: string | undefined;
225
+ multiple: boolean;
226
+ required: boolean;
227
+ disabled: boolean;
228
+ tabindex: -1;
229
+ 'aria-hidden': 'true';
230
+ style: CSSProperties;
231
+ 'data-part': 'form-input';
232
+ onInvalid: (event: Event) => void;
233
+ }
234
+ /** Bindings for a dropzone element. */
235
+ export interface GhostFileUploadDropzoneProps {
236
+ class: 'ghost-file-upload-dropzone';
237
+ 'data-part': 'dropzone';
238
+ 'data-state': 'dragging' | 'invalid' | 'disabled' | undefined;
239
+ onDragenter: (event: DragEvent) => void;
240
+ onDragover: (event: DragEvent) => void;
241
+ onDragleave: (event: DragEvent) => void;
242
+ onDrop: (event: DragEvent) => void;
243
+ onClick: (event: MouseEvent) => void;
244
+ }
245
+ /** Bindings for the trigger button. */
246
+ export interface GhostFileUploadTriggerBindings {
247
+ id: string;
248
+ type: 'button';
249
+ class: 'ghost-file-upload-trigger';
250
+ disabled: boolean;
251
+ 'aria-invalid': 'true' | undefined;
252
+ 'data-part': 'trigger';
253
+ 'data-state': 'invalid' | 'disabled' | undefined;
254
+ onClick: (event: MouseEvent) => void;
255
+ }
256
+ /** Bindings for the polite live region. */
257
+ export interface GhostFileUploadLiveRegionProps {
258
+ role: 'status';
259
+ 'aria-live': 'polite';
260
+ 'aria-atomic': 'true';
261
+ style: CSSProperties;
262
+ 'data-part': 'announcer';
263
+ }
264
+ /** Latest announcement; `key` changes on every announcement. */
265
+ export interface GhostFileUploadAnnouncement {
266
+ key: number;
267
+ text: string;
268
+ }
269
+ /** A rendered item registered for the focus-after-removal rule. */
270
+ export interface GhostFileUploadItemRegistration {
271
+ file: () => File;
272
+ element: () => HTMLElement | null;
273
+ removeButton: () => HTMLElement | null;
274
+ }
275
+ /** Return value of {@link useGhostFileUpload}. */
276
+ export interface UseGhostFileUploadReturn {
277
+ files: ComputedRef<File[]>;
278
+ entries: ComputedRef<readonly GhostFileUploadEntry[]>;
279
+ rejections: ShallowRef<readonly GhostFileUploadRejection[]>;
280
+ remaining: ComputedRef<number | undefined>;
281
+ isDisabled: ComputedRef<boolean>;
282
+ isInvalid: ComputedRef<boolean>;
283
+ isRequired: ComputedRef<boolean>;
284
+ isDragging: ShallowRef<boolean>;
285
+ announcement: ShallowRef<GhostFileUploadAnnouncement>;
286
+ /** Single intake path for the picker, drops, and consumer paste surfaces. */
287
+ addFiles: (files: Iterable<File>) => void;
288
+ remove: (file: File) => void;
289
+ clear: () => void;
290
+ clearRejections: () => void;
291
+ openPicker: () => void;
292
+ applyFormReset: () => void;
293
+ /**
294
+ * Call when a dropzone mounts (client only); returns its cleanup. While at
295
+ * least one is registered, the root is enabled, and `preventDocumentDrop`
296
+ * is not false, the shared document drop guard is installed.
297
+ */
298
+ registerDropzone: () => () => void;
299
+ /** Registers a rendered item for focus after removal; returns cleanup. */
300
+ registerItem: (item: GhostFileUploadItemRegistration) => () => void;
301
+ pickerProps: ComputedRef<GhostFileUploadPickerProps>;
302
+ mirrorProps: ComputedRef<GhostFileUploadMirrorProps>;
303
+ dropzoneProps: ComputedRef<GhostFileUploadDropzoneProps>;
304
+ triggerProps: ComputedRef<GhostFileUploadTriggerBindings>;
305
+ liveRegionProps: ComputedRef<GhostFileUploadLiveRegionProps>;
306
+ }
307
+ /** Internal context shared from the root to its parts. */
308
+ export interface GhostFileUploadContext {
309
+ upload: UseGhostFileUploadReturn;
310
+ /** Trigger id from the root `id` prop or generated. */
311
+ triggerId: ComputedRef<string>;
312
+ /** `aria-describedby` routed from the root attributes. */
313
+ describedBy: ComputedRef<string | undefined>;
314
+ /** Field label id when inside `GhostField`, for the composed trigger name. */
315
+ fieldLabelId: ComputedRef<string | undefined>;
316
+ messages: ComputedRef<Partial<GhostFileUploadMessages> | undefined>;
317
+ setTriggerElement: (element: HTMLElement | null) => void;
318
+ }
319
+ /** Internal context from an item to its remove button. */
320
+ export interface GhostFileUploadItemContext {
321
+ file: ComputedRef<File>;
322
+ setRemoveButton: (element: HTMLElement | null) => void;
323
+ }
324
+ export declare const ghostFileUploadContextKey: InjectionKey<GhostFileUploadContext>;
325
+ export declare const ghostFileUploadItemContextKey: InjectionKey<GhostFileUploadItemContext>;
@@ -0,0 +1,192 @@
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 GhostHoverCardTrigger}. */
5
+ export type GhostHoverCardTriggerElement = string | Component;
6
+ /** Valid `as` targets for {@link GhostHoverCardContent}. */
7
+ export type GhostHoverCardContentElement = string | Component;
8
+ /** Supported floating placements relative to the trigger anchor. */
9
+ export type GhostHoverCardPlacement = Placement;
10
+ /** Supported CSS positioning strategies for floating content. */
11
+ export type GhostHoverCardStrategy = Strategy;
12
+ /** Viewport/boundary padding accepted by hover-card flip and shift options. */
13
+ export type GhostHoverCardPadding = number | {
14
+ top?: number;
15
+ right?: number;
16
+ bottom?: number;
17
+ left?: number;
18
+ };
19
+ /** Distance or axis offsets between trigger and hover-card content. */
20
+ export type GhostHoverCardOffsetOptions = number | {
21
+ mainAxis?: number;
22
+ crossAxis?: number;
23
+ alignmentAxis?: number | null;
24
+ };
25
+ /** Collision flip options for {@link GhostHoverCardContent}. */
26
+ export interface GhostHoverCardFlipOptions {
27
+ mainAxis?: boolean;
28
+ crossAxis?: boolean;
29
+ fallbackPlacements?: GhostHoverCardPlacement[];
30
+ padding?: GhostHoverCardPadding;
31
+ boundary?: Element | Element[];
32
+ }
33
+ /** Collision shift options for {@link GhostHoverCardContent}. */
34
+ export interface GhostHoverCardShiftOptions {
35
+ mainAxis?: boolean;
36
+ crossAxis?: boolean;
37
+ padding?: GhostHoverCardPadding;
38
+ boundary?: Element | Element[];
39
+ }
40
+ /** Props for the {@link GhostHoverCard} root provider component. */
41
+ export interface GhostHoverCardProps {
42
+ /**
43
+ * Controlled open state. Omit to run uncontrolled from `defaultOpen`.
44
+ * @default undefined
45
+ */
46
+ open?: boolean | undefined;
47
+ /**
48
+ * Initial open state when `open` is omitted.
49
+ * @default false
50
+ */
51
+ defaultOpen?: boolean;
52
+ /**
53
+ * Milliseconds before showing after hover or focus begins.
54
+ * @default 700
55
+ */
56
+ openDelay?: number;
57
+ /**
58
+ * Milliseconds before hiding after hover/focus leaves the trigger and content.
59
+ * @default 300
60
+ */
61
+ closeDelay?: number;
62
+ /**
63
+ * When `true`, `Escape` dismisses the open card via `useDismissableLayer`.
64
+ * @default true
65
+ */
66
+ closeOnEscape?: boolean;
67
+ }
68
+ /** Props passed to the {@link GhostHoverCard} default slot. */
69
+ export interface GhostHoverCardSlotProps {
70
+ open: boolean;
71
+ close: () => void;
72
+ }
73
+ /** Props for {@link GhostHoverCardTrigger}. */
74
+ export interface GhostHoverCardTriggerProps {
75
+ /**
76
+ * Tag name or component rendered for the trigger control.
77
+ * @default 'button'
78
+ */
79
+ as?: GhostHoverCardTriggerElement;
80
+ /**
81
+ * Prevents scheduling show on hover or focus when `true`.
82
+ * @default false
83
+ */
84
+ disabled?: boolean;
85
+ }
86
+ /** Props for {@link GhostHoverCardContent}. */
87
+ export interface GhostHoverCardContentProps {
88
+ /**
89
+ * Tag name or component rendered for the card surface.
90
+ * @default 'div'
91
+ */
92
+ as?: GhostHoverCardContentElement;
93
+ /**
94
+ * Preferred placement relative to the trigger.
95
+ * @default 'bottom'
96
+ */
97
+ placement?: GhostHoverCardPlacement;
98
+ /**
99
+ * Distance or axis offsets passed to `useFloating`.
100
+ * @default undefined
101
+ */
102
+ offset?: GhostHoverCardOffsetOptions | boolean | undefined;
103
+ /**
104
+ * Flip to an opposite side when overflowing the viewport or boundary.
105
+ * @default true
106
+ */
107
+ flip?: boolean | GhostHoverCardFlipOptions;
108
+ /**
109
+ * Shift along the cross axis to keep the card in view.
110
+ * @default true
111
+ */
112
+ shift?: boolean | GhostHoverCardShiftOptions;
113
+ /**
114
+ * CSS positioning strategy passed to `useFloating`.
115
+ * @default 'absolute'
116
+ */
117
+ strategy?: GhostHoverCardStrategy;
118
+ /**
119
+ * Teleport content through {@link GhostPortal} when `true`, or render inline when `false`.
120
+ * @default true
121
+ */
122
+ portal?: boolean;
123
+ /**
124
+ * Teleport target passed to {@link GhostPortal} when `portal` is `true`.
125
+ * @default 'body'
126
+ */
127
+ portalTo?: GhostPortalTarget;
128
+ }
129
+ /** Methods and state exposed by a template ref to {@link GhostHoverCardTrigger}. */
130
+ export interface GhostHoverCardTriggerExposed {
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 GhostHoverCardContent}. */
136
+ export interface GhostHoverCardContentExposed {
137
+ readonly element: HTMLElement | null;
138
+ focus(options?: FocusOptions): void;
139
+ blur(): void;
140
+ }
141
+ /** Options for {@link useGhostHoverCard}. */
142
+ export interface UseGhostHoverCardOptions {
143
+ open?: MaybeRefOrGetter<boolean | undefined>;
144
+ defaultOpen?: MaybeRefOrGetter<boolean | undefined>;
145
+ onOpenChange?: (open: boolean) => void;
146
+ }
147
+ /** Reactive state and helpers returned by {@link useGhostHoverCard}. */
148
+ export interface UseGhostHoverCardReturn {
149
+ isOpen: Ref<boolean>;
150
+ open: () => void;
151
+ close: () => void;
152
+ triggerId: ComputedRef<string>;
153
+ contentId: ComputedRef<string>;
154
+ }
155
+ /** Internal context shared between `GhostHoverCard` parts. */
156
+ export interface GhostHoverCardContext {
157
+ isOpen: Ref<boolean>;
158
+ closeDelay: ComputedRef<number>;
159
+ closeOnEscape: ComputedRef<boolean>;
160
+ cancelClose: () => void;
161
+ hideImmediate: () => void;
162
+ notifyTriggerPointerEnter: () => void;
163
+ notifyTriggerPointerLeave: () => void;
164
+ notifyTriggerFocusIn: () => void;
165
+ notifyTriggerFocusOut: (relatedTarget: EventTarget | null) => void;
166
+ notifyContentPointerEnter: () => void;
167
+ notifyContentPointerLeave: () => void;
168
+ notifyContentFocusIn: () => void;
169
+ notifyContentFocusOut: (relatedTarget: EventTarget | null) => void;
170
+ defaultTriggerId: ComputedRef<string>;
171
+ defaultContentId: ComputedRef<string>;
172
+ triggerId: ComputedRef<string>;
173
+ contentId: ComputedRef<string>;
174
+ triggerRegistered: Ref<boolean>;
175
+ triggerElement: Ref<HTMLElement | null>;
176
+ contentElement: Ref<HTMLElement | null>;
177
+ setTriggerElement: (element: HTMLElement | null) => void;
178
+ setContentElement: (element: HTMLElement | null) => void;
179
+ setTriggerId: (id: string | null) => void;
180
+ setTriggerRegistered: (registered: boolean) => void;
181
+ setContentId: (id: string | null) => void;
182
+ }
183
+ export declare const ghostHoverCardContextKey: InjectionKey<GhostHoverCardContext>;
184
+ /**
185
+ * Resolves a DOM element from either a raw element or a component ref
186
+ * (preferring exposed `.element` over `.$el`).
187
+ */
188
+ export declare function resolveHoverCardHtmlElement(target: unknown): HTMLElement | null;
189
+ /**
190
+ * Returns whether `relatedTarget` is contained by the trigger or card content.
191
+ */
192
+ export declare function hoverCardFocusStaysInside(relatedTarget: EventTarget | null, trigger: HTMLElement | null, content: HTMLElement | null): boolean;
@@ -0,0 +1,34 @@
1
+ import type { MaybeRefOrGetter } from 'vue';
2
+ /** Root element for GhostInlineAlert. */
3
+ export type GhostInlineAlertElement = 'div' | 'section';
4
+ /** Native heading level for the title slot. */
5
+ export type GhostInlineAlertHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
6
+ /** Live-region semantics for copy that appears or updates after mount. */
7
+ export type GhostInlineAlertAnnounce = 'off' | 'status' | 'alert';
8
+ /** Declared props on the unstyled GhostInlineAlert SFC. */
9
+ export interface GhostInlineAlertProps {
10
+ /** Root element. Prefer `div` inside table cells. */
11
+ as?: GhostInlineAlertElement;
12
+ /** Heading level wrapping the `title` slot. */
13
+ headingLevel?: GhostInlineAlertHeadingLevel;
14
+ /**
15
+ * Live-region behavior. Default `off` for static inline feedback.
16
+ * Use `status` or `alert` only when copy appears or changes after mount.
17
+ */
18
+ announce?: GhostInlineAlertAnnounce;
19
+ }
20
+ /** Options for {@link useGhostInlineAlert}. */
21
+ export interface UseGhostInlineAlertOptions {
22
+ as?: MaybeRefOrGetter<GhostInlineAlertElement | undefined>;
23
+ headingLevel?: MaybeRefOrGetter<GhostInlineAlertHeadingLevel | undefined>;
24
+ announce?: MaybeRefOrGetter<GhostInlineAlertAnnounce | undefined>;
25
+ /** Whether the title slot is rendered. */
26
+ hasTitle?: MaybeRefOrGetter<boolean>;
27
+ /** Generated or overridden title id for aria-labelledby. */
28
+ titleId?: MaybeRefOrGetter<string>;
29
+ }
30
+ /** Template ref contract for GhostInlineAlert. */
31
+ export interface GhostInlineAlertExposed {
32
+ /** Root element after mount; null before mount. */
33
+ readonly element: HTMLElement | null;
34
+ }
@@ -0,0 +1,71 @@
1
+ import type { InputHTMLAttributes, MaybeRefOrGetter } from 'vue';
2
+ /**
3
+ * HTML text-like types only. `number` belongs to GhostNumberInput; checkbox,
4
+ * radio, file, and temporal widgets are separate primitives.
5
+ */
6
+ export type GhostInputType = 'text' | 'search' | 'email' | 'password' | 'tel' | 'url';
7
+ /**
8
+ * Unstyled {@link GhostInput} props. `@vue-ignore` keeps native attributes as
9
+ * fallthrough at runtime while typing the input contract for consumers.
10
+ * `value` is omitted so the current text is `modelValue` / `defaultValue`.
11
+ */
12
+ export interface GhostInputProps extends /* @vue-ignore */ Omit<InputHTMLAttributes, 'value'> {
13
+ /**
14
+ * Controlled value. Omit for uncontrolled mode. An empty string is a real
15
+ * controlled value, not "unset".
16
+ */
17
+ modelValue?: string;
18
+ /**
19
+ * Initial uncontrolled value. Later changes are ignored.
20
+ * @default ''
21
+ */
22
+ defaultValue?: string;
23
+ /**
24
+ * Prevents editing and sequential focus, and omits the field from submit.
25
+ * @default false
26
+ */
27
+ disabled?: boolean;
28
+ /**
29
+ * Prevents editing while remaining focusable and submitted.
30
+ * @default false
31
+ */
32
+ readonly?: boolean;
33
+ /**
34
+ * Consumer-owned validity. Sets `aria-invalid`, not native ValidityState.
35
+ * @default false
36
+ */
37
+ invalid?: boolean;
38
+ /**
39
+ * Native required constraint.
40
+ * @default false
41
+ */
42
+ required?: boolean;
43
+ /**
44
+ * Native text-like type.
45
+ * @default 'text'
46
+ */
47
+ type?: GhostInputType;
48
+ }
49
+ /** Options for {@link useGhostInput}. */
50
+ export interface UseGhostInputOptions {
51
+ modelValue?: MaybeRefOrGetter<string | undefined>;
52
+ defaultValue?: MaybeRefOrGetter<string | undefined>;
53
+ disabled?: MaybeRefOrGetter<boolean | undefined>;
54
+ readonly?: MaybeRefOrGetter<boolean | undefined>;
55
+ invalid?: MaybeRefOrGetter<boolean | undefined>;
56
+ required?: MaybeRefOrGetter<boolean | undefined>;
57
+ type?: MaybeRefOrGetter<GhostInputType | undefined>;
58
+ /** Native input for post-reset DOM reconciliation. */
59
+ element?: MaybeRefOrGetter<HTMLInputElement | null | undefined>;
60
+ /** Synchronous write. Emit `update:modelValue` here. */
61
+ onChange?: (value: string) => void;
62
+ }
63
+ /** Methods and state available from a template ref to {@link GhostInput}. */
64
+ export interface GhostInputExposed {
65
+ /** The native input after mount, or `null` before mount. */
66
+ readonly element: HTMLInputElement | null;
67
+ /** Moves focus to the native input when it is mounted and not disabled. */
68
+ focus(options?: FocusOptions): void;
69
+ /** Removes focus from the native input when it is mounted. */
70
+ blur(): void;
71
+ }