@voidable/ui 0.6.1 → 0.8.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 (250) hide show
  1. package/README.md +168 -9
  2. package/dist/angular/index.d.ts +20 -0
  3. package/dist/angular/index.js +78 -0
  4. package/dist/autoloader-core.d.ts +45 -0
  5. package/dist/autoloader-table.generated.d.ts +5 -0
  6. package/dist/autoloader.d.ts +13 -0
  7. package/dist/autoloader.js +229 -0
  8. package/dist/base.d.ts +173 -2
  9. package/dist/base.js +2 -9
  10. package/dist/chunks/base-CMruMbxC.js +824 -0
  11. package/dist/chunks/disclosure-Bj_49GcC.js +23 -0
  12. package/dist/chunks/dismiss-Drsy_dE5.js +37 -0
  13. package/dist/chunks/form-control-C0vH6gii.js +300 -0
  14. package/dist/chunks/keyboard-MQpfTX5I.js +46 -0
  15. package/dist/chunks/keyboard-activation-CV0m4hkn.js +29 -0
  16. package/dist/chunks/modal-D_YVy2vg.js +71 -0
  17. package/dist/chunks/overlay-BywGMcDW.js +467 -0
  18. package/dist/chunks/parts-D30c8OoG.js +229 -0
  19. package/dist/chunks/{shape-FJvZa8FW.js → shape-C_LW7EjG.js} +12 -4
  20. package/dist/components/accordion.d.ts +38 -10
  21. package/dist/components/accordion.js +51 -53
  22. package/dist/components/action-input.d.ts +64 -6
  23. package/dist/components/action-input.js +84 -41
  24. package/dist/components/alert.d.ts +24 -10
  25. package/dist/components/alert.js +26 -27
  26. package/dist/components/avatar.d.ts +8 -2
  27. package/dist/components/avatar.js +3 -3
  28. package/dist/components/badge.d.ts +8 -3
  29. package/dist/components/badge.js +2 -2
  30. package/dist/components/banner.d.ts +21 -10
  31. package/dist/components/banner.js +27 -27
  32. package/dist/components/bar-chart.d.ts +30 -6
  33. package/dist/components/bar-chart.js +29 -39
  34. package/dist/components/breadcrumbs.d.ts +19 -6
  35. package/dist/components/breadcrumbs.js +16 -22
  36. package/dist/components/button.d.ts +64 -10
  37. package/dist/components/button.js +70 -26
  38. package/dist/components/calendar.d.ts +65 -10
  39. package/dist/components/calendar.js +157 -106
  40. package/dist/components/card.d.ts +14 -9
  41. package/dist/components/card.js +8 -22
  42. package/dist/components/carousel.d.ts +65 -14
  43. package/dist/components/carousel.js +84 -93
  44. package/dist/components/charts/scale.d.ts +0 -1
  45. package/dist/components/charts/shape.d.ts +0 -1
  46. package/dist/components/checkbox-group.d.ts +38 -5
  47. package/dist/components/checkbox-group.js +61 -20
  48. package/dist/components/checkbox.d.ts +53 -7
  49. package/dist/components/checkbox.js +66 -29
  50. package/dist/components/collapsible.d.ts +29 -9
  51. package/dist/components/collapsible.js +42 -44
  52. package/dist/components/color-picker.d.ts +20 -4
  53. package/dist/components/color-picker.js +35 -29
  54. package/dist/components/combobox.d.ts +84 -10
  55. package/dist/components/combobox.js +142 -45
  56. package/dist/components/compose-input.d.ts +8 -1
  57. package/dist/components/compose-input.js +9 -3
  58. package/dist/components/dialog.d.ts +24 -20
  59. package/dist/components/dialog.js +8 -57
  60. package/dist/components/divider.d.ts +8 -1
  61. package/dist/components/divider.js +3 -3
  62. package/dist/components/donut-chart.d.ts +28 -5
  63. package/dist/components/donut-chart.js +55 -54
  64. package/dist/components/drawer.d.ts +19 -18
  65. package/dist/components/drawer.js +9 -53
  66. package/dist/components/dropdown-menu.d.ts +62 -7
  67. package/dist/components/dropdown-menu.js +124 -33
  68. package/dist/components/editable.d.ts +37 -3
  69. package/dist/components/editable.js +45 -24
  70. package/dist/components/error-fallback.d.ts +36 -5
  71. package/dist/components/error-fallback.js +73 -23
  72. package/dist/components/field.d.ts +38 -4
  73. package/dist/components/field.js +63 -21
  74. package/dist/components/file-upload.d.ts +23 -2
  75. package/dist/components/file-upload.js +47 -24
  76. package/dist/components/gauge.d.ts +48 -9
  77. package/dist/components/gauge.js +57 -55
  78. package/dist/components/hamburger.d.ts +19 -4
  79. package/dist/components/hamburger.js +28 -19
  80. package/dist/components/hover-card.d.ts +40 -14
  81. package/dist/components/hover-card.js +76 -59
  82. package/dist/components/indicator.d.ts +18 -7
  83. package/dist/components/indicator.js +16 -18
  84. package/dist/components/input.d.ts +70 -5
  85. package/dist/components/input.js +83 -20
  86. package/dist/components/line-chart.d.ts +27 -5
  87. package/dist/components/line-chart.js +19 -21
  88. package/dist/components/list.d.ts +10 -1
  89. package/dist/components/list.js +3 -3
  90. package/dist/components/menu.d.ts +67 -21
  91. package/dist/components/menu.js +116 -115
  92. package/dist/components/multiselect.d.ts +108 -13
  93. package/dist/components/multiselect.js +207 -70
  94. package/dist/components/nav-bar.d.ts +12 -7
  95. package/dist/components/nav-bar.js +11 -21
  96. package/dist/components/nav-menu.d.ts +52 -12
  97. package/dist/components/nav-menu.js +68 -70
  98. package/dist/components/number-input.d.ts +76 -8
  99. package/dist/components/number-input.js +117 -51
  100. package/dist/components/pagination.d.ts +19 -1
  101. package/dist/components/pagination.js +68 -7
  102. package/dist/components/panel.d.ts +16 -8
  103. package/dist/components/panel.js +20 -20
  104. package/dist/components/pin-input.d.ts +41 -4
  105. package/dist/components/pin-input.js +45 -27
  106. package/dist/components/popover.d.ts +29 -11
  107. package/dist/components/popover.js +47 -35
  108. package/dist/components/progress.d.ts +7 -3
  109. package/dist/components/progress.js +3 -3
  110. package/dist/components/radio-group.d.ts +30 -5
  111. package/dist/components/radio-group.js +56 -19
  112. package/dist/components/radio.d.ts +47 -7
  113. package/dist/components/radio.js +68 -29
  114. package/dist/components/scroll-area.d.ts +8 -5
  115. package/dist/components/scroll-area.js +19 -20
  116. package/dist/components/segmented-control.d.ts +52 -8
  117. package/dist/components/segmented-control.js +66 -36
  118. package/dist/components/select.d.ts +59 -12
  119. package/dist/components/select.js +96 -46
  120. package/dist/components/sidebar.d.ts +22 -3
  121. package/dist/components/sidebar.js +20 -10
  122. package/dist/components/skeleton.d.ts +5 -2
  123. package/dist/components/skeleton.js +4 -4
  124. package/dist/components/slider.d.ts +27 -5
  125. package/dist/components/slider.js +29 -17
  126. package/dist/components/spinner.d.ts +6 -2
  127. package/dist/components/spinner.js +3 -3
  128. package/dist/components/stat.d.ts +21 -4
  129. package/dist/components/stat.js +7 -3
  130. package/dist/components/status-dot.d.ts +4 -1
  131. package/dist/components/status-dot.js +3 -3
  132. package/dist/components/stepper.d.ts +5 -1
  133. package/dist/components/stepper.js +2 -2
  134. package/dist/components/switch.d.ts +24 -5
  135. package/dist/components/switch.js +37 -19
  136. package/dist/components/table.d.ts +51 -2
  137. package/dist/components/table.js +157 -8
  138. package/dist/components/tabs.d.ts +49 -17
  139. package/dist/components/tabs.js +85 -54
  140. package/dist/components/tag.d.ts +17 -7
  141. package/dist/components/tag.js +19 -21
  142. package/dist/components/tags-input.d.ts +33 -4
  143. package/dist/components/tags-input.js +40 -30
  144. package/dist/components/textarea.d.ts +61 -5
  145. package/dist/components/textarea.js +58 -21
  146. package/dist/components/toast.d.ts +89 -15
  147. package/dist/components/toast.js +105 -30
  148. package/dist/components/toggle-group.d.ts +30 -3
  149. package/dist/components/toggle-group.js +43 -16
  150. package/dist/components/toggle.d.ts +25 -4
  151. package/dist/components/toggle.js +28 -18
  152. package/dist/components/tooltip.d.ts +31 -12
  153. package/dist/components/tooltip.js +62 -28
  154. package/dist/components.json +1518 -0
  155. package/dist/custom-elements.json +31817 -0
  156. package/dist/dev/index.d.ts +40 -0
  157. package/dist/dev/rules.d.ts +46 -0
  158. package/dist/dev/table.generated.d.ts +8 -0
  159. package/dist/dev/types.d.ts +113 -0
  160. package/dist/dev.js +3364 -0
  161. package/dist/disclosure.d.ts +30 -0
  162. package/dist/dismiss.d.ts +20 -0
  163. package/dist/form-control.d.ts +92 -0
  164. package/dist/index.d.ts +5 -4
  165. package/dist/index.js +24 -24
  166. package/dist/keyboard-activation.d.ts +31 -0
  167. package/dist/keyboard.d.ts +32 -0
  168. package/dist/modal.d.ts +44 -0
  169. package/dist/overlay.d.ts +249 -0
  170. package/dist/parts.d.ts +171 -0
  171. package/dist/projection.d.ts +370 -0
  172. package/dist/types/elements.d.ts +648 -0
  173. package/dist/types/react.d.ts +163 -0
  174. package/dist/types/solid.d.ts +164 -0
  175. package/dist/types/solid2.d.ts +161 -0
  176. package/dist/types/svelte.d.ts +154 -0
  177. package/dist/types/vue.d.ts +156 -0
  178. package/dist/vscode.html-custom-data.json +6004 -0
  179. package/dist/web-types.json +8365 -0
  180. package/package.json +113 -21
  181. package/dist/base.d.ts.map +0 -1
  182. package/dist/components/accordion.d.ts.map +0 -1
  183. package/dist/components/action-input.d.ts.map +0 -1
  184. package/dist/components/alert.d.ts.map +0 -1
  185. package/dist/components/avatar.d.ts.map +0 -1
  186. package/dist/components/badge.d.ts.map +0 -1
  187. package/dist/components/banner.d.ts.map +0 -1
  188. package/dist/components/bar-chart.d.ts.map +0 -1
  189. package/dist/components/breadcrumbs.d.ts.map +0 -1
  190. package/dist/components/button.d.ts.map +0 -1
  191. package/dist/components/calendar.d.ts.map +0 -1
  192. package/dist/components/card.d.ts.map +0 -1
  193. package/dist/components/carousel.d.ts.map +0 -1
  194. package/dist/components/charts/scale.d.ts.map +0 -1
  195. package/dist/components/charts/shape.d.ts.map +0 -1
  196. package/dist/components/checkbox-group.d.ts.map +0 -1
  197. package/dist/components/checkbox.d.ts.map +0 -1
  198. package/dist/components/collapsible.d.ts.map +0 -1
  199. package/dist/components/color-picker.d.ts.map +0 -1
  200. package/dist/components/combobox.d.ts.map +0 -1
  201. package/dist/components/compose-input.d.ts.map +0 -1
  202. package/dist/components/dialog.d.ts.map +0 -1
  203. package/dist/components/divider.d.ts.map +0 -1
  204. package/dist/components/donut-chart.d.ts.map +0 -1
  205. package/dist/components/drawer.d.ts.map +0 -1
  206. package/dist/components/dropdown-menu.d.ts.map +0 -1
  207. package/dist/components/editable.d.ts.map +0 -1
  208. package/dist/components/error-fallback.d.ts.map +0 -1
  209. package/dist/components/field.d.ts.map +0 -1
  210. package/dist/components/file-upload.d.ts.map +0 -1
  211. package/dist/components/gauge.d.ts.map +0 -1
  212. package/dist/components/hamburger.d.ts.map +0 -1
  213. package/dist/components/hover-card.d.ts.map +0 -1
  214. package/dist/components/indicator.d.ts.map +0 -1
  215. package/dist/components/input.d.ts.map +0 -1
  216. package/dist/components/line-chart.d.ts.map +0 -1
  217. package/dist/components/list.d.ts.map +0 -1
  218. package/dist/components/menu.d.ts.map +0 -1
  219. package/dist/components/multiselect.d.ts.map +0 -1
  220. package/dist/components/nav-bar.d.ts.map +0 -1
  221. package/dist/components/nav-menu.d.ts.map +0 -1
  222. package/dist/components/number-input.d.ts.map +0 -1
  223. package/dist/components/pagination.d.ts.map +0 -1
  224. package/dist/components/panel.d.ts.map +0 -1
  225. package/dist/components/pin-input.d.ts.map +0 -1
  226. package/dist/components/popover.d.ts.map +0 -1
  227. package/dist/components/progress.d.ts.map +0 -1
  228. package/dist/components/radio-group.d.ts.map +0 -1
  229. package/dist/components/radio.d.ts.map +0 -1
  230. package/dist/components/scroll-area.d.ts.map +0 -1
  231. package/dist/components/segmented-control.d.ts.map +0 -1
  232. package/dist/components/select.d.ts.map +0 -1
  233. package/dist/components/sidebar.d.ts.map +0 -1
  234. package/dist/components/skeleton.d.ts.map +0 -1
  235. package/dist/components/slider.d.ts.map +0 -1
  236. package/dist/components/spinner.d.ts.map +0 -1
  237. package/dist/components/stat.d.ts.map +0 -1
  238. package/dist/components/status-dot.d.ts.map +0 -1
  239. package/dist/components/stepper.d.ts.map +0 -1
  240. package/dist/components/switch.d.ts.map +0 -1
  241. package/dist/components/table.d.ts.map +0 -1
  242. package/dist/components/tabs.d.ts.map +0 -1
  243. package/dist/components/tag.d.ts.map +0 -1
  244. package/dist/components/tags-input.d.ts.map +0 -1
  245. package/dist/components/textarea.d.ts.map +0 -1
  246. package/dist/components/toast.d.ts.map +0 -1
  247. package/dist/components/toggle-group.d.ts.map +0 -1
  248. package/dist/components/toggle.d.ts.map +0 -1
  249. package/dist/components/tooltip.d.ts.map +0 -1
  250. package/dist/index.d.ts.map +0 -1
@@ -0,0 +1,30 @@
1
+ import { PartsController } from './parts.js';
2
+ /**
3
+ * How closed content of a disclosure (collapsible, accordion item) is hidden.
4
+ *
5
+ * The theme already hides it from the host's own `open` attribute (a collapsed
6
+ * grid row and `visibility: hidden`), which is all a browser without
7
+ * `hidden="until-found"` needs and all that shows before the script loads. Where
8
+ * the browser supports `hidden="until-found"` (Chrome and Edge 102, Firefox 148;
9
+ * not yet Safari), the content part also carries that attribute while it is
10
+ * closed:
11
+ *
12
+ * - it is `content-visibility: hidden`, so it is out of the accessibility tree
13
+ * and the tab order, as `display: none` would be, and
14
+ * - find-in-page, a text fragment or an in-page link to something inside it
15
+ * fires `beforematch` on it first, which the component answers by opening.
16
+ *
17
+ * The attribute is only put on after the closing animation has finished (it
18
+ * would cut the content off at the first frame), and taken off the moment the
19
+ * disclosure opens. It goes through the parts controller, so a server morph
20
+ * keeps it, and it is taken off again if the part is removed.
21
+ */
22
+ export declare function supportsUntilFound(): boolean;
23
+ export declare class ClosedContent {
24
+ private readonly _host;
25
+ private readonly _parts;
26
+ private _pass;
27
+ constructor(_host: HTMLElement, _parts: PartsController);
28
+ /** Brings the content part's `hidden` attribute in line with `open` (call it from the component's wiring). */
29
+ sync(content: HTMLElement | null, open: boolean): void;
30
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Dismissing a notice (alert, banner, toast), shared so the three behave alike.
3
+ *
4
+ * The close part wraps the author's own control. Pressing it fires `void-close`
5
+ * (it bubbles, is composed and is not cancelable: by then the user has chosen;
6
+ * each notice dispatches it from its own source) and the notice removes itself. When focus was inside the notice, it would
7
+ * fall to the document body with the node, so it moves first to the next
8
+ * focusable element after the notice in document order (where the reader's
9
+ * attention continues), or the last one before it when nothing follows.
10
+ */
11
+ /** The element focus should go to when `host`, which holds it, is removed; `null` for none. */
12
+ export declare function focusSuccessor(host: HTMLElement): HTMLElement | null;
13
+ /** Removes `host`, first moving focus out of it if it held focus (see the file comment). */
14
+ export declare function removeWithFocus(host: HTMLElement): void;
15
+ /**
16
+ * Whether a click landed on a working control inside a notice's close part (one
17
+ * that is not disabled). The notice then fires `void-close` itself (so the event
18
+ * is declared in its own source and manifest) and calls {@link removeWithFocus}.
19
+ */
20
+ export declare function closeControlPressed(close: HTMLElement | null, e: Event): boolean;
@@ -0,0 +1,92 @@
1
+ import { VoidElement } from './base.js';
2
+ /** What a form-associated control contributes to its form's entry list. */
3
+ export type FormSubmission = string | readonly string[] | readonly File[] | null;
4
+ /** A validity result for ElementInternals.setValidity. */
5
+ export interface FormValidityResult {
6
+ flags: ValidityStateFlags;
7
+ message: string;
8
+ anchor?: HTMLElement;
9
+ }
10
+ type Constructor<T = object> = new (...args: any[]) => T;
11
+ /** True when `el` sits inside a `<fieldset disabled>` (outside that fieldset's first legend). */
12
+ export declare function isInDisabledFieldset(el: Element): boolean;
13
+ /**
14
+ * Calls `onChange` whenever a `<fieldset>` around `host` is disabled or
15
+ * enabled, for components that are not form-associated but must stop reacting
16
+ * there as a native button does. One observer per document serves every such
17
+ * host (a page of a thousand buttons does not create a thousand observers);
18
+ * moving a host into or out of a fieldset reconnects it, which the component
19
+ * handles itself. Returns the function that stops watching, for
20
+ * disconnectedCallback.
21
+ */
22
+ export declare function watchDisabledAncestors(host: Element, onChange: () => void): () => void;
23
+ /** Public and protected surface shared by every Void form control. */
24
+ export declare class VoidFormControl {
25
+ /** Field name; reflected. */
26
+ name: string;
27
+ /** The associated form, if any. */
28
+ readonly form: HTMLFormElement | null;
29
+ /** True when disabled directly or via a disabled ancestor (`<fieldset disabled>`, disabled group). */
30
+ get formDisabled(): boolean;
31
+ /** Reset callback (called by the browser for form-associated hosts). */
32
+ formResetCallback(): void;
33
+ /** Browser callback: the disabled state (own or via fieldset) changed. */
34
+ formDisabledCallback(disabled: boolean): void;
35
+ /** Reactive mirror of formAncestorDisabled(), kept current by observing ancestors. */
36
+ protected ancestorDisabled: boolean;
37
+ /** Hook: whether an ancestor disables this control. Defaults to a disabled fieldset. */
38
+ protected formAncestorDisabled(): boolean;
39
+ /** Hook: state to remember as the reset target. Defaults to `value`. */
40
+ protected formSnapshot(): unknown;
41
+ /** Hook: apply a snapshot (reset / restore). Must not fire void-change. */
42
+ protected formRestore(state: unknown): void;
43
+ /** Hook: re-capture the reset target from the current state. */
44
+ protected formCaptureDefault(): void;
45
+ /** Hook: validity of the host itself, or null when always valid. */
46
+ protected formValidity(): FormValidityResult | null;
47
+ /** Push the current value, validity and ARIA state to the form now. */
48
+ protected formSync(): void;
49
+ }
50
+ /** Surface added by NativeFormControl. */
51
+ export declare class VoidNativeFormControl extends VoidFormControl {
52
+ /** The `form` attribute, forwarded to the native control. */
53
+ protected formAttr: string | null;
54
+ /** Hook: push host state into the native control synchronously (no events). */
55
+ protected formSyncNative(): void;
56
+ /** Hook: make the native control's default (reset target) equal `state`. */
57
+ protected formWriteNativeDefault(state: unknown): void;
58
+ /** Writes the captured reset target again (native controls that arrived after it was written). */
59
+ protected formRewriteNativeDefault(): void;
60
+ /** Hook: after a reset, mirror the native control's state into the host (no events). */
61
+ protected formReadNative(): void;
62
+ /** Hook: the native control that owns form association. */
63
+ protected formNativeControl(): HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | null;
64
+ }
65
+ /** Surface added by InternalsFormControl. */
66
+ export declare class VoidInternalsFormControl extends VoidFormControl {
67
+ /** When set, an empty submission makes the control invalid (valueMissing). */
68
+ required: boolean;
69
+ readonly validity: ValidityState | undefined;
70
+ readonly validationMessage: string;
71
+ readonly willValidate: boolean;
72
+ checkValidity(): boolean;
73
+ reportValidity(): boolean;
74
+ formStateRestoreCallback(state: string | File | FormData | null, mode: string): void;
75
+ /** Hook: what to submit. Defaults to `String(value)`. */
76
+ protected formSubmission(): FormSubmission;
77
+ /** Hook: element that anchors the validation bubble. */
78
+ protected formValidationAnchor(): HTMLElement | undefined;
79
+ }
80
+ /**
81
+ * Strategy (a): the component renders a native control that submits for it.
82
+ * The host is not form-associated; see the header comment for how reset,
83
+ * defaults and disabled ancestors are handled.
84
+ */
85
+ export declare function NativeFormControl<T extends Constructor<VoidElement>>(Base: T): Constructor<VoidNativeFormControl> & T;
86
+ /**
87
+ * Strategy (b): the host is form-associated and submits through
88
+ * ElementInternals. Degrades to "no submission" where attachInternals is
89
+ * unavailable.
90
+ */
91
+ export declare function InternalsFormControl<T extends Constructor<VoidElement>>(Base: T): Constructor<VoidInternalsFormControl> & T;
92
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { VoidElement } from './base.js';
2
+ export type { VoidFormControl, VoidNativeFormControl, VoidInternalsFormControl, FormSubmission, FormValidityResult, } from './form-control.js';
2
3
  export { VoidBadge } from './components/badge.js';
3
4
  export { VoidButton } from './components/button.js';
4
5
  export { VoidDivider } from './components/divider.js';
@@ -20,11 +21,12 @@ export { VoidRadioGroup } from './components/radio-group.js';
20
21
  export { VoidField } from './components/field.js';
21
22
  export { VoidMultiselect, VoidOption } from './components/multiselect.js';
22
23
  export { VoidDialog } from './components/dialog.js';
23
- export { VoidTabs, VoidTabPanel } from './components/tabs.js';
24
+ export { VoidTabs } from './components/tabs.js';
24
25
  export { VoidAccordion, VoidAccordionItem } from './components/accordion.js';
25
26
  export { VoidBreadcrumbs } from './components/breadcrumbs.js';
26
27
  export { VoidList, VoidListItem } from './components/list.js';
27
- export { VoidToast, VoidToastContainer } from './components/toast.js';
28
+ export { VoidToast, VoidToastContainer, toast } from './components/toast.js';
29
+ export type { ToastOptions, ToastAction } from './components/toast.js';
28
30
  export { VoidStepper } from './components/stepper.js';
29
31
  export { VoidDrawer } from './components/drawer.js';
30
32
  export { VoidCard } from './components/card.js';
@@ -48,7 +50,7 @@ export { VoidToggleGroup } from './components/toggle-group.js';
48
50
  export { VoidSegmentedControl, VoidSegmentedControlItem } from './components/segmented-control.js';
49
51
  export { VoidStat } from './components/stat.js';
50
52
  export { VoidCalendar, VoidDatePicker } from './components/calendar.js';
51
- export { VoidCarousel, VoidCarouselSlide } from './components/carousel.js';
53
+ export { VoidCarousel, VoidCarouselPrevious, VoidCarouselNext } from './components/carousel.js';
52
54
  export { VoidDropdownMenu, VoidDropdownMenuItem } from './components/dropdown-menu.js';
53
55
  export { VoidIndicator } from './components/indicator.js';
54
56
  export { VoidMenu, VoidMenuItem, VoidMenuGroup } from './components/menu.js';
@@ -69,4 +71,3 @@ export { VoidDonutChart } from './components/donut-chart.js';
69
71
  export type { DonutChartData, DonutChartSegment } from './components/donut-chart.js';
70
72
  export { VoidGauge } from './components/gauge.js';
71
73
  export type { GaugeData, GaugeSegment, GaugeZone } from './components/gauge.js';
72
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { VoidElement as e } from "./base.js";
1
+ import { t as e } from "./chunks/base-CMruMbxC.js";
2
2
  import { VoidBadge as t } from "./components/badge.js";
3
3
  import { VoidButton as n } from "./components/button.js";
4
4
  import { VoidDivider as r } from "./components/divider.js";
@@ -20,11 +20,11 @@ import { VoidRadioGroup as v } from "./components/radio-group.js";
20
20
  import { VoidField as y } from "./components/field.js";
21
21
  import { VoidMultiselect as b, VoidOption as x } from "./components/multiselect.js";
22
22
  import { VoidDialog as S } from "./components/dialog.js";
23
- import { VoidTabPanel as C, VoidTabs as w } from "./components/tabs.js";
24
- import { VoidAccordion as T, VoidAccordionItem as E } from "./components/accordion.js";
25
- import { VoidBreadcrumbs as D } from "./components/breadcrumbs.js";
26
- import { VoidList as O, VoidListItem as k } from "./components/list.js";
27
- import { VoidToast as A, VoidToastContainer as j } from "./components/toast.js";
23
+ import { VoidTabs as C } from "./components/tabs.js";
24
+ import { VoidAccordion as w, VoidAccordionItem as T } from "./components/accordion.js";
25
+ import { VoidBreadcrumbs as E } from "./components/breadcrumbs.js";
26
+ import { VoidList as D, VoidListItem as O } from "./components/list.js";
27
+ import { VoidToast as k, VoidToastContainer as A, toast as j } from "./components/toast.js";
28
28
  import { VoidStepper as M } from "./components/stepper.js";
29
29
  import { VoidDrawer as N } from "./components/drawer.js";
30
30
  import { VoidCard as P } from "./components/card.js";
@@ -48,21 +48,21 @@ import { VoidToggleGroup as Z } from "./components/toggle-group.js";
48
48
  import { VoidSegmentedControl as Q, VoidSegmentedControlItem as $ } from "./components/segmented-control.js";
49
49
  import { VoidStat as ee } from "./components/stat.js";
50
50
  import { VoidCalendar as te, VoidDatePicker as ne } from "./components/calendar.js";
51
- import { VoidCarousel as re, VoidCarouselSlide as ie } from "./components/carousel.js";
52
- import { VoidDropdownMenu as ae, VoidDropdownMenuItem as oe } from "./components/dropdown-menu.js";
53
- import { VoidIndicator as se } from "./components/indicator.js";
54
- import { VoidMenu as ce, VoidMenuGroup as le, VoidMenuItem as ue } from "./components/menu.js";
55
- import { VoidNumberInput as de } from "./components/number-input.js";
56
- import { VoidCollapsible as fe } from "./components/collapsible.js";
57
- import { VoidEditable as pe } from "./components/editable.js";
58
- import { VoidHoverCard as me } from "./components/hover-card.js";
59
- import { VoidPinInput as he } from "./components/pin-input.js";
60
- import { VoidTagsInput as ge } from "./components/tags-input.js";
61
- import { VoidNavMenu as _e, VoidNavMenuItem as ve } from "./components/nav-menu.js";
62
- import { VoidColorPicker as ye } from "./components/color-picker.js";
63
- import { VoidActionInput as be } from "./components/action-input.js";
64
- import { VoidBarChart as xe } from "./components/bar-chart.js";
65
- import { VoidLineChart as Se } from "./components/line-chart.js";
66
- import { VoidDonutChart as Ce } from "./components/donut-chart.js";
67
- import { VoidGauge as we } from "./components/gauge.js";
68
- export { T as VoidAccordion, E as VoidAccordionItem, be as VoidActionInput, l as VoidAlert, c as VoidAvatar, t as VoidBadge, L as VoidBanner, xe as VoidBarChart, D as VoidBreadcrumbs, n as VoidButton, te as VoidCalendar, P as VoidCard, re as VoidCarousel, ie as VoidCarouselSlide, g as VoidCheckbox, H as VoidCheckboxGroup, fe as VoidCollapsible, ye as VoidColorPicker, U as VoidCombobox, J as VoidComposeInput, ne as VoidDatePicker, S as VoidDialog, r as VoidDivider, Ce as VoidDonutChart, N as VoidDrawer, ae as VoidDropdownMenu, oe as VoidDropdownMenuItem, pe as VoidEditable, e as VoidElement, V as VoidErrorFallback, y as VoidField, G as VoidFileUpload, we as VoidGauge, q as VoidHamburger, me as VoidHoverCard, se as VoidIndicator, p as VoidInput, Se as VoidLineChart, O as VoidList, k as VoidListItem, ce as VoidMenu, le as VoidMenuGroup, ue as VoidMenuItem, b as VoidMultiselect, K as VoidNavBar, _e as VoidNavMenu, ve as VoidNavMenuItem, de as VoidNumberInput, x as VoidOption, B as VoidPagination, f as VoidPanel, he as VoidPinInput, F as VoidPopover, d as VoidProgress, _ as VoidRadio, v as VoidRadioGroup, R as VoidScrollArea, Q as VoidSegmentedControl, $ as VoidSegmentedControlItem, h as VoidSelect, Y as VoidSidebar, a as VoidSkeleton, W as VoidSlider, i as VoidSpinner, ee as VoidStat, o as VoidStatusDot, M as VoidStepper, s as VoidSwitch, C as VoidTabPanel, z as VoidTable, w as VoidTabs, u as VoidTag, ge as VoidTagsInput, m as VoidTextarea, A as VoidToast, j as VoidToastContainer, X as VoidToggle, Z as VoidToggleGroup, I as VoidTooltip };
51
+ import { VoidCarousel as re, VoidCarouselNext as ie, VoidCarouselPrevious as ae } from "./components/carousel.js";
52
+ import { VoidDropdownMenu as oe, VoidDropdownMenuItem as se } from "./components/dropdown-menu.js";
53
+ import { VoidIndicator as ce } from "./components/indicator.js";
54
+ import { VoidMenu as le, VoidMenuGroup as ue, VoidMenuItem as de } from "./components/menu.js";
55
+ import { VoidNumberInput as fe } from "./components/number-input.js";
56
+ import { VoidCollapsible as pe } from "./components/collapsible.js";
57
+ import { VoidEditable as me } from "./components/editable.js";
58
+ import { VoidHoverCard as he } from "./components/hover-card.js";
59
+ import { VoidPinInput as ge } from "./components/pin-input.js";
60
+ import { VoidTagsInput as _e } from "./components/tags-input.js";
61
+ import { VoidNavMenu as ve, VoidNavMenuItem as ye } from "./components/nav-menu.js";
62
+ import { VoidColorPicker as be } from "./components/color-picker.js";
63
+ import { VoidActionInput as xe } from "./components/action-input.js";
64
+ import { VoidBarChart as Se } from "./components/bar-chart.js";
65
+ import { VoidLineChart as Ce } from "./components/line-chart.js";
66
+ import { VoidDonutChart as we } from "./components/donut-chart.js";
67
+ import { VoidGauge as Te } from "./components/gauge.js";
68
+ export { w as VoidAccordion, T as VoidAccordionItem, xe as VoidActionInput, l as VoidAlert, c as VoidAvatar, t as VoidBadge, L as VoidBanner, Se as VoidBarChart, E as VoidBreadcrumbs, n as VoidButton, te as VoidCalendar, P as VoidCard, re as VoidCarousel, ie as VoidCarouselNext, ae as VoidCarouselPrevious, g as VoidCheckbox, H as VoidCheckboxGroup, pe as VoidCollapsible, be as VoidColorPicker, U as VoidCombobox, J as VoidComposeInput, ne as VoidDatePicker, S as VoidDialog, r as VoidDivider, we as VoidDonutChart, N as VoidDrawer, oe as VoidDropdownMenu, se as VoidDropdownMenuItem, me as VoidEditable, e as VoidElement, V as VoidErrorFallback, y as VoidField, G as VoidFileUpload, Te as VoidGauge, q as VoidHamburger, he as VoidHoverCard, ce as VoidIndicator, p as VoidInput, Ce as VoidLineChart, D as VoidList, O as VoidListItem, le as VoidMenu, ue as VoidMenuGroup, de as VoidMenuItem, b as VoidMultiselect, K as VoidNavBar, ve as VoidNavMenu, ye as VoidNavMenuItem, fe as VoidNumberInput, x as VoidOption, B as VoidPagination, f as VoidPanel, ge as VoidPinInput, F as VoidPopover, d as VoidProgress, _ as VoidRadio, v as VoidRadioGroup, R as VoidScrollArea, Q as VoidSegmentedControl, $ as VoidSegmentedControlItem, h as VoidSelect, Y as VoidSidebar, a as VoidSkeleton, W as VoidSlider, i as VoidSpinner, ee as VoidStat, o as VoidStatusDot, M as VoidStepper, s as VoidSwitch, z as VoidTable, C as VoidTabs, u as VoidTag, _e as VoidTagsInput, m as VoidTextarea, k as VoidToast, A as VoidToastContainer, X as VoidToggle, Z as VoidToggleGroup, I as VoidTooltip, j as toast };
@@ -0,0 +1,31 @@
1
+ import { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ export interface KeyboardActivationOptions {
3
+ /** Enter activates, on keydown, as a native button does. Default true. */
4
+ enter?: boolean | (() => boolean);
5
+ /** Space activates, on keyup, as a native button does. Default true. */
6
+ space?: boolean | (() => boolean);
7
+ /** True while the element is disabled: no key does anything. */
8
+ disabled?: () => boolean;
9
+ /** What activation does. Default: `host.click()`, a real `click` event that bubbles. */
10
+ activate?: (e: KeyboardEvent) => void;
11
+ }
12
+ /**
13
+ * Makes a custom element activate like a native `<button>`: Enter fires a real `click` on keydown, Space fires one
14
+ * on keyup (and only when the same element saw the keydown), and a disabled or `aria-disabled` element does
15
+ * nothing. Everything that listens for `click` (an overlay trigger, `onClick`, `phx-click`, `wire:click`, Alpine
16
+ * `@click`, Turbo, a form's submit) therefore works the same for the keyboard as for the mouse. Keys that land on
17
+ * an element inside the host (a native `<a>`, `<button>` or `<input>` it contains) are left to that element.
18
+ */
19
+ export declare class KeyboardActivation implements ReactiveController {
20
+ private readonly _host;
21
+ private readonly _options;
22
+ private _armed;
23
+ constructor(_host: ReactiveControllerHost & HTMLElement, _options?: KeyboardActivationOptions);
24
+ hostConnected(): void;
25
+ hostDisconnected(): void;
26
+ private _disabled;
27
+ private _activate;
28
+ private _disarm;
29
+ private _keydown;
30
+ private _keyup;
31
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Keyboard helpers shared by the composite widgets (combobox, multiselect,
3
+ * tabs, menus, segmented control). Internal: not part of the public API.
4
+ */
5
+ /**
6
+ * Index of the next entry from `from` in `step` direction (1 or -1) that is not
7
+ * disabled, wrapping at the ends; `from` may be -1 (nothing current). Returns -1
8
+ * when every entry is disabled or the list is empty.
9
+ */
10
+ export declare function stepEnabled(disabled: readonly boolean[], from: number, step: 1 | -1, wrap?: boolean): number;
11
+ /** Index of the first (`step` 1) or last (`step` -1) entry that is not disabled, or -1. */
12
+ export declare function edgeEnabled(disabled: readonly boolean[], step: 1 | -1): number;
13
+ /** True for a key press that types a character (no Ctrl, Meta or Alt). */
14
+ export declare function isPrintable(e: KeyboardEvent): boolean;
15
+ /**
16
+ * Type-ahead search: characters typed within `timeout` ms of each other form
17
+ * one search string. The same character repeated cycles through the entries
18
+ * starting with it.
19
+ */
20
+ export declare class Typeahead {
21
+ #private;
22
+ private readonly timeout;
23
+ constructor(timeout?: number);
24
+ /**
25
+ * Feeds a typed character. Returns the index of the matching entry (searching
26
+ * on from `current`, wrapping, skipping disabled entries) or -1.
27
+ */
28
+ match(char: string, labels: readonly string[], disabled: readonly boolean[], current: number): number;
29
+ reset(): void;
30
+ }
31
+ /** A document-unique id for ARIA relationships. */
32
+ export declare function uid(prefix: string): string;
@@ -0,0 +1,44 @@
1
+ import { VoidElement } from './base.js';
2
+ import { OverlayController } from './overlay.js';
3
+ import { PartsController } from './parts.js';
4
+ /**
5
+ * The shared modal behind `<void-dialog>` and `<void-drawer>`.
6
+ *
7
+ * The author's parts (title, description, body, actions) stay the host's own
8
+ * light-DOM children; the native `<dialog>` that `showModal()` needs lives in
9
+ * the host's shadow root around a `<slot>`, so the top layer, `::backdrop`,
10
+ * the inert page and focus containment come from the platform while the
11
+ * author's markup stays the final DOM. The close button is part of that
12
+ * internal structure too. The theme styles both with `::part(surface)` and
13
+ * `::part(close)`.
14
+ * @internal
15
+ */
16
+ export declare class VoidModal extends VoidElement {
17
+ /** Whether it is open. Set or remove the attribute (or property) to open and close it; the server may do the same through a morph. */
18
+ open: boolean;
19
+ /**
20
+ * Leave out the close button, and ignore Escape and presses on the backdrop: the user closes it only with a
21
+ * button you put in its actions part (a forced choice).
22
+ */
23
+ hideClose: boolean;
24
+ protected readonly _parts: PartsController;
25
+ protected readonly _overlay: OverlayController;
26
+ private _chrome;
27
+ private _surface;
28
+ connectedCallback(): void;
29
+ disconnectedCallback(): void;
30
+ protected willUpdate(changed: Map<string, unknown>): void;
31
+ static get observedAttributes(): string[];
32
+ attributeChangedCallback(name: string, old: string | null, value: string | null): void;
33
+ /**
34
+ * Names the native dialog after the title part and describes it with the
35
+ * description part. The dialog role lives only on the native `<dialog>` in
36
+ * the shadow root, the one element assistive technology sees while it is
37
+ * modal; giving the host the role as well exposes two nested dialogs to
38
+ * DOM-based tools (Testing Library, Playwright) and, likely, Firefox.
39
+ * See "Dialogs and drawers" in the composition guide for what this means for
40
+ * role-scoped test queries.
41
+ */
42
+ private _wire;
43
+ private _close;
44
+ }
@@ -0,0 +1,249 @@
1
+ import { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ /**
3
+ * The shared overlay model behind every Void UI component that opens something
4
+ * on top of the page: dialog, drawer, popover, hover-card, dropdown-menu,
5
+ * tooltip, the combobox / multiselect / date-picker panels and the toast
6
+ * container.
7
+ *
8
+ * The platform does the heavy lifting:
9
+ *
10
+ * - **Modal** overlays (dialog, drawer) render a native `<dialog>` opened with
11
+ * `showModal()`: top layer, `::backdrop`, an inert page behind it (so Tab and
12
+ * assistive technology cannot reach it) and focus kept inside.
13
+ * - **Non-modal** overlays render a `popover="manual"` element shown with
14
+ * `showPopover()`: top layer, so no `overflow`, `transform` or `z-index` of an
15
+ * ancestor can clip or bury it, and `display: none` (nothing visible,
16
+ * focusable or exposed) while closed.
17
+ * - **Placement** uses CSS anchor positioning (`position-anchor`,
18
+ * `position-area`, `position-try-fallbacks`), where the browser supports it.
19
+ * Elsewhere, and whenever the CSS result would still overflow the viewport, a
20
+ * small JavaScript positioner places the overlay with flipping and clamping.
21
+ *
22
+ * What the platform does not decide is shared here, once per document:
23
+ *
24
+ * - **One stack.** Escape and outside pointer presses close only the topmost
25
+ * overlay, whatever the engine's own close-request rules are, and an overlay
26
+ * that is not closable (`hide-close`) swallows them. Overlays nest
27
+ * (a select inside a popover inside a dialog inside a drawer); closing one
28
+ * closes the overlays opened inside it.
29
+ * - **Counted scroll lock** while any modal is open.
30
+ * - **Focus**: moved in on open (modal always; non-modal when opened by the
31
+ * user), returned to the opener on close, with fallbacks when the opener was
32
+ * removed or hidden meanwhile.
33
+ * - **Trigger ARIA**: `aria-haspopup`, `aria-expanded` and `aria-controls`.
34
+ * - **Events**: `void-open` and `void-close` with `detail.reason`; `void-close`
35
+ * is cancelable when the user caused it. Like the native `toggle` and `close`
36
+ * events they do not bubble, so a tooltip or select closing inside a dialog is
37
+ * never mistaken for the dialog closing.
38
+ * - **Morph resilience**: if the surface was taken out of the document and put
39
+ * back (a morph without `Element.moveBefore`), or rebuilt by recovery, an open
40
+ * overlay is shown again with focus kept where it was.
41
+ *
42
+ * Document listeners exist only while at least one overlay is open, and all
43
+ * shared state lives on the document (not in module scope).
44
+ */
45
+ export type OverlayKind = 'modal' | 'dialog' | 'menu' | 'listbox' | 'tooltip' | 'hover';
46
+ /** Why an overlay closed. All but `api` and `parent` come from the user and make `void-close` cancelable. */
47
+ export type OverlayCloseReason = 'escape' | 'outside' | 'blur' | 'trigger' | 'close-button' | 'select' | 'hover' | 'form' | 'parent' | 'api';
48
+ /** Why an overlay opened. */
49
+ export type OverlayOpenReason = 'trigger' | 'keyboard' | 'hover' | 'focus' | 'api';
50
+ export type OverlaySide = 'top' | 'bottom' | 'left' | 'right';
51
+ export type OverlayAlign = 'start' | 'center' | 'end';
52
+ export interface OverlayCloseDetail {
53
+ reason: OverlayCloseReason;
54
+ }
55
+ export interface OverlayOpenDetail {
56
+ reason: OverlayOpenReason;
57
+ }
58
+ export interface OverlayOptions {
59
+ kind: OverlayKind;
60
+ /** The rendered `<dialog>` (modal) or `popover` element (everything else). */
61
+ surface: () => HTMLElement | null | undefined;
62
+ /** The component's open state (usually its `open` property). */
63
+ isOpen: () => boolean;
64
+ /** Changes the component's open state; the controller reacts in the next update. */
65
+ setOpen: (open: boolean) => void;
66
+ /** The element that opens the overlay: gets trigger ARIA, counts as inside, receives focus as a fallback. */
67
+ trigger?: () => HTMLElement | null | undefined;
68
+ /** `aria-haspopup` value written on the trigger. Omit to leave the trigger's ARIA alone. */
69
+ haspopup?: 'dialog' | 'menu' | 'listbox';
70
+ /** The element the overlay is placed against. Omit for overlays that are not anchored. */
71
+ anchor?: () => Element | null | undefined;
72
+ /**
73
+ * Writes a style property on the host (the component's `setHostStyle`), used
74
+ * when the anchor is the host itself so the anchor name survives morphs.
75
+ */
76
+ hostStyle?: (property: string, value: string | null) => void;
77
+ placement?: () => {
78
+ side: OverlaySide;
79
+ align: OverlayAlign;
80
+ };
81
+ /** Whether Escape, outside presses and the close button may close it (default: always). */
82
+ closable?: () => boolean;
83
+ /**
84
+ * What receives focus when the overlay opens. Return `null` to use the default
85
+ * for the kind, `false` to leave focus where it is.
86
+ */
87
+ initialFocus?: (reason: OverlayOpenReason) => HTMLElement | null | false;
88
+ /**
89
+ * Writes (`null` removes) an attribute the controller manages on an element
90
+ * the author wrote (trigger ARIA on the trigger's control, placement
91
+ * attributes on a content part). Components with explicit parts pass their
92
+ * PartsController's `set`, so the attributes survive morphs. Default: plain
93
+ * `setAttribute` / `removeAttribute`.
94
+ */
95
+ attr?: (el: Element, name: string, value: string | null) => void;
96
+ /** Same as `attr` for inline style properties (anchor names, positioner coordinates). */
97
+ style?: (el: HTMLElement, property: string, value: string | null) => void;
98
+ }
99
+ /** Whether the element can receive focus by Tab right now. */
100
+ export declare function isTabbable(el: Element): el is HTMLElement;
101
+ /** Tabbable elements inside `root`, in document order. */
102
+ export declare function tabbables(root: Element): HTMLElement[];
103
+ /**
104
+ * Places a fixed-position box of `size` next to `anchor` inside a viewport of
105
+ * `vw` x `vh`, flipping to the opposite side and the opposite alignment when
106
+ * the preferred one does not fit, and finally clamping it into the viewport.
107
+ * Exported for tests.
108
+ */
109
+ export declare function placeOverlay(anchor: {
110
+ left: number;
111
+ top: number;
112
+ right: number;
113
+ bottom: number;
114
+ }, size: {
115
+ width: number;
116
+ height: number;
117
+ }, viewport: {
118
+ width: number;
119
+ height: number;
120
+ }, side: OverlaySide, align: OverlayAlign, gap: number, rtl?: boolean): {
121
+ x: number;
122
+ y: number;
123
+ side: OverlaySide;
124
+ align: OverlayAlign;
125
+ };
126
+ type Host = ReactiveControllerHost & HTMLElement;
127
+ /**
128
+ * @internal Drives one overlay of a component. Create it in a field initializer
129
+ * after the component's ProjectionController, so it runs after projection on
130
+ * every update.
131
+ */
132
+ export declare class OverlayController implements ReactiveController {
133
+ readonly host: Host;
134
+ readonly kind: OverlayKind;
135
+ private readonly _o;
136
+ private readonly _modal;
137
+ /** Open as far as the controller is concerned: in the stack, shown, listeners attached. */
138
+ private _active;
139
+ private _surface;
140
+ private _opener;
141
+ private _openerId;
142
+ private _openReason;
143
+ /** Set when a close was announced (void-close dispatched) before the state changed. */
144
+ private _closeReason;
145
+ private _formClosing;
146
+ private _ariaTrigger;
147
+ private _anchorName;
148
+ private _anchorEl;
149
+ private _mode;
150
+ private _locked;
151
+ private _checkFrame;
152
+ private _reshowing;
153
+ /** Focus was inside the surface at some point while open. */
154
+ private _hadFocus;
155
+ private readonly _attr;
156
+ private readonly _css;
157
+ constructor(host: ReactiveControllerHost & HTMLElement, options: OverlayOptions);
158
+ /** Whether the overlay is open and shown. */
159
+ get active(): boolean;
160
+ get surfaceElement(): HTMLElement | null;
161
+ get anchorElement(): Element | null;
162
+ private get _registry();
163
+ /** Opens because of the user (`trigger`, `keyboard`, `hover`, `focus`) or code (`api`). */
164
+ requestOpen(reason?: OverlayOpenReason): void;
165
+ /**
166
+ * Closes for `reason`, dispatching a `void-close` that the listener may cancel
167
+ * (when the user caused it). Returns false if it stays open. A request while
168
+ * the overlay is already closing is accepted without a second event.
169
+ */
170
+ requestClose(reason: OverlayCloseReason): boolean;
171
+ /** Toggles from the trigger. */
172
+ toggle(reason?: OverlayOpenReason): void;
173
+ /** Whether a pointer event happened inside the overlay (host, trigger or surface, not a modal's backdrop). */
174
+ containsEvent(e: Event): boolean;
175
+ /** `node` is the host, inside it, or inside its shadow root (the internal `<dialog>` of a modal). */
176
+ private _withinHost;
177
+ /**
178
+ * `node` is inside the surface. A surface in the host's shadow root (a modal's
179
+ * internal `<dialog>`) shows the host's light-DOM children through its slot,
180
+ * so everything in the host counts as inside it.
181
+ */
182
+ inSurface(node: Node | null | undefined): boolean;
183
+ /** Re-runs placement now (JavaScript positioner only). */
184
+ reposition(): void;
185
+ hostConnected(): void;
186
+ hostDisconnected(): void;
187
+ hostUpdated(): void;
188
+ private _sync;
189
+ /** First sight of a (new) surface element: listeners for native closes and the closed state. */
190
+ private _adopt;
191
+ private _activate;
192
+ /** A modal opening closes the non-modal overlays it is not inside, like `showModal()` does for popovers. */
193
+ private _closeNonAncestors;
194
+ private _show;
195
+ /**
196
+ * Firefox: when anchor positioning picks a position-try fallback (a flipped
197
+ * surface) while the entry fade runs, the surface keeps the fade's starting
198
+ * opacity once it ends, invisible though placed correctly. Once the entry
199
+ * transition is over, a surface that is open but still fully transparent
200
+ * has its position resolved again, which restyles it to its real opacity.
201
+ * Elsewhere the check finds opacity 1 and does nothing.
202
+ */
203
+ private _watchFade;
204
+ private _hide;
205
+ /** The surface lost its shown state while open (taken out of the document by a morph, or rebuilt). */
206
+ private _reshow;
207
+ private _deactivate;
208
+ /**
209
+ * Focus goes back only when it would otherwise be lost or stranded: it is
210
+ * inside the closing surface, on nothing, or on a removed element. Never when
211
+ * the user moved it on (closing because focus left, the pointer left, or a
212
+ * press outside a non-modal overlay landed somewhere else).
213
+ */
214
+ private _shouldRestoreFocus;
215
+ /** Closed because the overlay it was opened inside closed. */
216
+ private _closeForParent;
217
+ private _focusInitial;
218
+ private _defaultModalFocus;
219
+ private _focusableSurface;
220
+ private _restoreFocus;
221
+ /**
222
+ * Where focus goes back to: the opener; else an element with the opener's id
223
+ * (a morph replaced it); else, for an opener hidden inside a closed overlay,
224
+ * that overlay's trigger; else this overlay's own trigger; else the topmost
225
+ * overlay still open; else nowhere (the document).
226
+ */
227
+ private _focusReturnTarget;
228
+ private _onCancel;
229
+ private _onSurfaceFocus;
230
+ private _onSubmit;
231
+ /** The native dialog closed without us (`method="dialog"` form, `dialog.close()` by other code). */
232
+ private _onNativeClose;
233
+ /** Someone else hid the popover (`hidePopover()` by other code). */
234
+ private _onToggle;
235
+ private _syncTriggerAria;
236
+ private _position;
237
+ private _overflows;
238
+ private _linkAnchor;
239
+ private _clearAnchor;
240
+ private _placeFixed;
241
+ }
242
+ /** @internal Test hook: forces the JavaScript positioner in `doc` (as if anchor positioning were missing). */
243
+ export declare function forceOverlayFallback(doc: Document, force: boolean): void;
244
+ /** @internal Test hook: the open overlays of `doc`, bottom to top, and the scroll-lock count. */
245
+ export declare function overlayState(doc: Document): {
246
+ stack: HTMLElement[];
247
+ locks: number;
248
+ };
249
+ export {};