@aceshooting/lyra-ui 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -14
- package/custom-elements.json +11555 -5539
- package/dist/components/app-rail/app-rail-item.d.ts +30 -0
- package/dist/components/app-rail/app-rail-item.js +68 -0
- package/dist/components/app-rail/app-rail-item.styles.d.ts +1 -0
- package/dist/components/app-rail/app-rail-item.styles.js +65 -0
- package/dist/components/app-rail/app-rail.d.ts +21 -24
- package/dist/components/app-rail/app-rail.js +68 -132
- package/dist/components/app-rail/app-rail.styles.js +5 -2
- package/dist/components/attachment-chip/attachment-chip.d.ts +38 -11
- package/dist/components/attachment-chip/attachment-chip.js +73 -29
- package/dist/components/attachment-trigger/attachment-trigger.d.ts +13 -0
- package/dist/components/attachment-trigger/attachment-trigger.js +13 -1
- package/dist/components/attachment-trigger/attachment-trigger.styles.js +28 -6
- package/dist/components/chart/bar-chart.js +2 -18
- package/dist/components/chart/box-plot.d.ts +25 -1
- package/dist/components/chart/box-plot.js +136 -6
- package/dist/components/chart/box-plot.styles.js +13 -0
- package/dist/components/chart/bubble-chart.js +2 -18
- package/dist/components/chart/chart.d.ts +54 -10
- package/dist/components/chart/chart.js +182 -39
- package/dist/components/chart/doughnut-chart.js +2 -18
- package/dist/components/chart/histogram-bin.d.ts +5 -2
- package/dist/components/chart/histogram-bin.js +12 -4
- package/dist/components/chart/histogram.js +8 -16
- package/dist/components/chart/line-chart.js +2 -18
- package/dist/components/chart/lite-chart.d.ts +80 -3
- package/dist/components/chart/lite-chart.js +250 -53
- package/dist/components/chart/pie-chart.js +2 -18
- package/dist/components/chart/polar-area-chart.js +2 -18
- package/dist/components/chart/radar-chart.js +2 -18
- package/dist/components/chart/scatter-chart.js +2 -18
- package/dist/components/chat-composer/chat-composer.d.ts +42 -1
- package/dist/components/chat-composer/chat-composer.js +84 -3
- package/dist/components/chat-composer/chat-composer.styles.js +11 -1
- package/dist/components/chat-message/chat-message.d.ts +32 -4
- package/dist/components/chat-message/chat-message.js +57 -17
- package/dist/components/checkbox/checkbox.d.ts +66 -8
- package/dist/components/checkbox/checkbox.js +173 -50
- package/dist/components/checkbox/checkbox.styles.js +9 -2
- package/dist/components/chip/chip-group.js +8 -2
- package/dist/components/chip/chip.js +9 -2
- package/dist/components/citation-badge/citation-badge.js +21 -3
- package/dist/components/code-block/code-block.d.ts +38 -0
- package/dist/components/code-block/code-block.js +72 -7
- package/dist/components/code-block/code-loader.d.ts +44 -1
- package/dist/components/code-block/code-loader.js +63 -0
- package/dist/components/combobox/combobox.d.ts +46 -5
- package/dist/components/combobox/combobox.js +175 -35
- package/dist/components/combobox/combobox.styles.js +3 -3
- package/dist/components/context-meter/context-meter.js +17 -8
- package/dist/components/context-meter/context-meter.styles.js +0 -6
- package/dist/components/conversation-item/conversation-item.d.ts +13 -16
- package/dist/components/conversation-item/conversation-item.js +29 -20
- package/dist/components/date-picker/calendar-core.d.ts +24 -0
- package/dist/components/date-picker/calendar-core.js +51 -4
- package/dist/components/date-picker/date-input.d.ts +77 -10
- package/dist/components/date-picker/date-input.js +278 -73
- package/dist/components/date-picker/date-picker.d.ts +28 -4
- package/dist/components/date-picker/date-picker.js +95 -37
- package/dist/components/dialog/confirm.js +3 -6
- package/dist/components/dialog/dialog.d.ts +75 -31
- package/dist/components/dialog/dialog.js +147 -131
- package/dist/components/dialog/dialog.styles.js +46 -2
- package/dist/components/dock-panel/dock-panel.d.ts +8 -0
- package/dist/components/dock-panel/dock-panel.js +15 -1
- package/dist/components/dock-panel/dock-panel.styles.js +15 -1
- package/dist/components/document-preview/document-preview.d.ts +15 -7
- package/dist/components/document-preview/document-preview.js +29 -13
- package/dist/components/empty/empty.d.ts +1 -2
- package/dist/components/empty/empty.js +18 -12
- package/dist/components/empty/empty.styles.js +0 -3
- package/dist/components/export-button/export-button.d.ts +12 -0
- package/dist/components/export-button/export-button.js +33 -5
- package/dist/components/export-button/export-button.styles.js +5 -1
- package/dist/components/file-input/accept.js +2 -0
- package/dist/components/file-input/file-input.d.ts +10 -1
- package/dist/components/file-input/file-input.js +36 -5
- package/dist/components/flag/flag.d.ts +1 -1
- package/dist/components/flag/flag.js +15 -1
- package/dist/components/flag/flag.styles.js +1 -1
- package/dist/components/flag/language-map.d.ts +4 -1
- package/dist/components/flag/language-map.js +6 -3
- package/dist/components/gauge/gauge.d.ts +10 -1
- package/dist/components/gauge/gauge.js +28 -9
- package/dist/components/generation-status/generation-status.d.ts +13 -5
- package/dist/components/generation-status/generation-status.js +59 -5
- package/dist/components/graph/graph.d.ts +37 -3
- package/dist/components/graph/graph.js +132 -20
- package/dist/components/heatmap/calendar-grid.d.ts +15 -6
- package/dist/components/heatmap/calendar-grid.js +17 -6
- package/dist/components/heatmap/heatmap-scale.d.ts +5 -1
- package/dist/components/heatmap/heatmap-scale.js +8 -2
- package/dist/components/heatmap/heatmap.d.ts +166 -25
- package/dist/components/heatmap/heatmap.js +372 -89
- package/dist/components/json-viewer/json-viewer.d.ts +22 -5
- package/dist/components/json-viewer/json-viewer.js +115 -37
- package/dist/components/json-viewer/json-viewer.styles.js +2 -1
- package/dist/components/kbd/kbd.js +24 -7
- package/dist/components/live-region/live-region.d.ts +10 -1
- package/dist/components/live-region/live-region.js +42 -6
- package/dist/components/map/map.d.ts +24 -1
- package/dist/components/map/map.js +89 -24
- package/dist/components/markdown/markdown-loader.d.ts +24 -0
- package/dist/components/markdown/markdown-loader.js +35 -1
- package/dist/components/markdown/markdown.d.ts +46 -8
- package/dist/components/markdown/markdown.js +136 -31
- package/dist/components/markdown/markdown.styles.js +7 -1
- package/dist/components/media-card/media-card.d.ts +25 -17
- package/dist/components/media-card/media-card.js +43 -65
- package/dist/components/mention-popover/mention-popover.d.ts +4 -1
- package/dist/components/mention-popover/mention-popover.js +23 -5
- package/dist/components/menu/menu-item.d.ts +32 -3
- package/dist/components/menu/menu-item.js +94 -7
- package/dist/components/menu/menu-item.styles.js +8 -0
- package/dist/components/menu/menu.d.ts +25 -1
- package/dist/components/menu/menu.js +99 -3
- package/dist/components/menu/menu.styles.js +3 -2
- package/dist/components/model-select/model-select.d.ts +48 -3
- package/dist/components/model-select/model-select.js +120 -22
- package/dist/components/model-select/model-select.styles.js +17 -3
- package/dist/components/model-settings-panel/model-settings-panel.d.ts +25 -1
- package/dist/components/model-settings-panel/model-settings-panel.js +65 -1
- package/dist/components/playback/playback.d.ts +6 -2
- package/dist/components/playback/playback.js +72 -29
- package/dist/components/playback/playback.styles.js +6 -1
- package/dist/components/responsive-panel/responsive-panel.d.ts +29 -16
- package/dist/components/responsive-panel/responsive-panel.js +130 -132
- package/dist/components/responsive-panel/responsive-panel.styles.js +1 -1
- package/dist/components/result-card/result-card.d.ts +8 -2
- package/dist/components/result-card/result-card.js +9 -3
- package/dist/components/result-card/result-card.styles.js +0 -1
- package/dist/components/select/select.d.ts +59 -20
- package/dist/components/select/select.js +125 -43
- package/dist/components/skeleton/skeleton.d.ts +3 -0
- package/dist/components/skeleton/skeleton.js +7 -1
- package/dist/components/skeleton/skeleton.styles.js +5 -4
- package/dist/components/slider/slider.d.ts +57 -5
- package/dist/components/slider/slider.js +195 -80
- package/dist/components/source-card/source-card.d.ts +17 -5
- package/dist/components/source-card/source-card.js +55 -8
- package/dist/components/source-card/source-card.styles.js +1 -1
- package/dist/components/source-list/source-list.js +9 -1
- package/dist/components/sparkline/sparkline.js +34 -10
- package/dist/components/split/split.d.ts +141 -14
- package/dist/components/split/split.js +357 -52
- package/dist/components/split/split.styles.js +18 -1
- package/dist/components/stat/stat.d.ts +10 -4
- package/dist/components/stat/stat.js +46 -11
- package/dist/components/stream-status/stream-status.d.ts +27 -11
- package/dist/components/stream-status/stream-status.js +95 -13
- package/dist/components/streaming-text/streaming-text.d.ts +9 -3
- package/dist/components/streaming-text/streaming-text.js +25 -10
- package/dist/components/streaming-text/streaming-text.styles.js +3 -2
- package/dist/components/switch/switch.d.ts +52 -7
- package/dist/components/switch/switch.js +111 -40
- package/dist/components/switch/switch.styles.js +1 -1
- package/dist/components/table/table.d.ts +18 -3
- package/dist/components/table/table.js +88 -20
- package/dist/components/tabs/tabs.d.ts +23 -0
- package/dist/components/tabs/tabs.js +76 -12
- package/dist/components/tabs/tabs.styles.js +11 -0
- package/dist/components/thinking-panel/thinking-panel.d.ts +3 -1
- package/dist/components/thinking-panel/thinking-panel.js +34 -9
- package/dist/components/thinking-panel/thinking-panel.styles.js +6 -0
- package/dist/components/time-range/time-range.d.ts +59 -2
- package/dist/components/time-range/time-range.js +163 -67
- package/dist/components/toast/toast-item.d.ts +12 -3
- package/dist/components/toast/toast-item.js +90 -53
- package/dist/components/toast/toast-item.styles.js +59 -28
- package/dist/components/toast/toast.js +17 -5
- package/dist/components/toast/toaster.js +10 -1
- package/dist/components/tool-approval-dialog/tool-approval-dialog.d.ts +11 -10
- package/dist/components/tool-approval-dialog/tool-approval-dialog.js +50 -124
- package/dist/components/tool-approval-dialog/tool-approval-dialog.styles.js +1 -1
- package/dist/components/tool-call-chip/tool-call-chip.d.ts +18 -2
- package/dist/components/tool-call-chip/tool-call-chip.js +86 -25
- package/dist/components/tool-param-form/tool-param-form.d.ts +89 -28
- package/dist/components/tool-param-form/tool-param-form.js +350 -106
- package/dist/components/tool-result-dialog/tool-result-dialog.d.ts +27 -7
- package/dist/components/tool-result-dialog/tool-result-dialog.js +80 -115
- package/dist/components/tool-result-dialog/tool-result-dialog.styles.js +1 -1
- package/dist/components/tool-result-view/registry.d.ts +0 -8
- package/dist/components/tool-result-view/registry.js +7 -2
- package/dist/components/tool-result-view/tool-result-view.d.ts +6 -3
- package/dist/components/tool-result-view/tool-result-view.js +18 -4
- package/dist/components/tool-select-dialog/tool-select-dialog.d.ts +11 -11
- package/dist/components/tool-select-dialog/tool-select-dialog.js +44 -133
- package/dist/components/tool-select-dialog/tool-select-dialog.styles.js +13 -4
- package/dist/components/tree/tree-node.d.ts +4 -1
- package/dist/components/tree/tree-node.js +4 -1
- package/dist/components/tree/tree.d.ts +17 -8
- package/dist/components/tree/tree.js +21 -20
- package/dist/components/typing-indicator/typing-indicator.d.ts +12 -2
- package/dist/components/typing-indicator/typing-indicator.js +16 -4
- package/dist/components/typing-indicator/typing-indicator.styles.js +2 -2
- package/dist/components/virtual-list/virtual-list.d.ts +56 -19
- package/dist/components/virtual-list/virtual-list.js +184 -38
- package/dist/components/virtual-list/virtual-list.styles.js +12 -0
- package/dist/components/widget/widget.d.ts +5 -4
- package/dist/components/widget/widget.js +54 -120
- package/dist/components/widget/widget.styles.js +8 -2
- package/dist/components/word-cloud/word-cloud-layout.d.ts +7 -0
- package/dist/components/word-cloud/word-cloud-layout.js +20 -6
- package/dist/components/word-cloud/word-cloud.d.ts +22 -2
- package/dist/components/word-cloud/word-cloud.js +45 -6
- package/dist/components/word-cloud/word-cloud.styles.js +13 -1
- package/dist/internal/anchored-validity.d.ts +1 -0
- package/dist/internal/anchored-validity.js +86 -0
- package/dist/internal/form-associated.d.ts +7 -0
- package/dist/internal/form-associated.js +43 -4
- package/dist/internal/numbers.d.ts +12 -0
- package/dist/internal/numbers.js +26 -0
- package/dist/internal/overlay-manager.d.ts +51 -0
- package/dist/internal/overlay-manager.js +523 -0
- package/dist/internal/positioner.js +27 -3
- package/dist/internal/safe-url.d.ts +12 -0
- package/dist/internal/safe-url.js +41 -0
- package/dist/internal/tokens.styles.js +17 -11
- package/dist/lyra.d.ts +5 -2
- package/dist/lyra.js +3 -1
- package/llms-full.txt +970 -426
- package/llms.txt +5 -4
- package/package.json +19 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnchoredValidityController, SET_ANCHORED_VALIDITY, VALIDITY_ANCHOR, } from './anchored-validity.js';
|
|
1
2
|
/**
|
|
2
3
|
* Mixin that turns a Lit component into a form-associated custom element via
|
|
3
4
|
* `ElementInternals`, so it participates in native `<form>` submission,
|
|
@@ -15,13 +16,13 @@ export function FormAssociated(Base) {
|
|
|
15
16
|
static { this.properties = {
|
|
16
17
|
name: { reflect: true, noAccessor: true },
|
|
17
18
|
value: { noAccessor: true },
|
|
18
|
-
disabled: { type: Boolean, reflect: true },
|
|
19
|
+
disabled: { type: Boolean, reflect: true, noAccessor: true },
|
|
19
20
|
required: { type: Boolean, reflect: true, noAccessor: true },
|
|
20
21
|
}; }
|
|
21
22
|
constructor(...args) {
|
|
22
23
|
super(...args);
|
|
23
|
-
this.disabled = false;
|
|
24
24
|
this._fieldsetDisabled = false;
|
|
25
|
+
this._disabled = false;
|
|
25
26
|
// Hand-written accessor (mirrors `value`/`required` below): native form
|
|
26
27
|
// submission for a form-associated custom element keys its `FormData`
|
|
27
28
|
// entry off the `name` *content attribute*, read synchronously at
|
|
@@ -42,11 +43,35 @@ export function FormAssociated(Base) {
|
|
|
42
43
|
this._defaultValue = '';
|
|
43
44
|
this._required = false;
|
|
44
45
|
this.internals = this.attachInternals();
|
|
46
|
+
this.validityController = new AnchoredValidityController(this, this.internals, () => this[VALIDITY_ANCHOR]());
|
|
45
47
|
// Native <input> always has a submission value ("") from construction —
|
|
46
48
|
// without this, a control whose `value` is never touched is entirely
|
|
47
49
|
// absent from FormData instead of present as "".
|
|
48
50
|
this.internals.setFormValue('');
|
|
49
51
|
}
|
|
52
|
+
get form() {
|
|
53
|
+
return this.internals.form;
|
|
54
|
+
}
|
|
55
|
+
get labels() {
|
|
56
|
+
return this.internals.labels;
|
|
57
|
+
}
|
|
58
|
+
get validity() {
|
|
59
|
+
return this.internals.validity;
|
|
60
|
+
}
|
|
61
|
+
get validationMessage() {
|
|
62
|
+
return this.internals.validationMessage;
|
|
63
|
+
}
|
|
64
|
+
get willValidate() {
|
|
65
|
+
return this.internals.willValidate;
|
|
66
|
+
}
|
|
67
|
+
/** @internal */
|
|
68
|
+
[VALIDITY_ANCHOR]() {
|
|
69
|
+
return this.renderRoot?.querySelector("input:not([type='hidden']), textarea, select, button, [tabindex]:not([tabindex='-1'])") ?? null;
|
|
70
|
+
}
|
|
71
|
+
/** @internal */
|
|
72
|
+
[SET_ANCHORED_VALIDITY](flags, message = '') {
|
|
73
|
+
this.validityController.setValidity(flags, message);
|
|
74
|
+
}
|
|
50
75
|
get name() {
|
|
51
76
|
return this._name;
|
|
52
77
|
}
|
|
@@ -71,6 +96,17 @@ export function FormAssociated(Base) {
|
|
|
71
96
|
this.updateValidity();
|
|
72
97
|
this.requestUpdate('value', old);
|
|
73
98
|
}
|
|
99
|
+
get disabled() {
|
|
100
|
+
return this._disabled;
|
|
101
|
+
}
|
|
102
|
+
set disabled(next) {
|
|
103
|
+
const old = this._disabled;
|
|
104
|
+
this._disabled = Boolean(next);
|
|
105
|
+
// FACE omission and barred validation are driven by the live host
|
|
106
|
+
// attribute, so reflection must happen before same-tick form APIs run.
|
|
107
|
+
this.toggleAttribute('disabled', this._disabled);
|
|
108
|
+
this.requestUpdate('disabled', old);
|
|
109
|
+
}
|
|
74
110
|
get required() {
|
|
75
111
|
return this._required;
|
|
76
112
|
}
|
|
@@ -107,10 +143,10 @@ export function FormAssociated(Base) {
|
|
|
107
143
|
*/
|
|
108
144
|
updateValidity() {
|
|
109
145
|
if (this.required && this._value === '') {
|
|
110
|
-
this
|
|
146
|
+
this[SET_ANCHORED_VALIDITY]({ valueMissing: true }, 'Please fill out this field.');
|
|
111
147
|
}
|
|
112
148
|
else {
|
|
113
|
-
this
|
|
149
|
+
this[SET_ANCHORED_VALIDITY]({});
|
|
114
150
|
}
|
|
115
151
|
}
|
|
116
152
|
checkValidity() {
|
|
@@ -124,6 +160,9 @@ export function FormAssociated(Base) {
|
|
|
124
160
|
// semantics) — previously this unconditionally blanked the field.
|
|
125
161
|
this.value = this._defaultValue;
|
|
126
162
|
}
|
|
163
|
+
formStateRestoreCallback(state, _mode) {
|
|
164
|
+
this.value = typeof state === 'string' ? state : '';
|
|
165
|
+
}
|
|
127
166
|
/**
|
|
128
167
|
* Called by the browser when an ancestor `<fieldset disabled>` toggles.
|
|
129
168
|
* Tracked separately from the consumer's own `disabled` (see
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The largest delay browsers can represent reliably with setTimeout. */
|
|
2
|
+
export declare const MAX_TIMEOUT_MS = 2147483647;
|
|
3
|
+
/** Returns a finite number or the supplied finite fallback. */
|
|
4
|
+
export declare function finiteNumber(value: number, fallback: number): number;
|
|
5
|
+
/** Returns a finite value clamped to the requested range. */
|
|
6
|
+
export declare function finiteRange(value: number, fallback: number, min?: number, max?: number): number;
|
|
7
|
+
/** Returns a finite integer, truncating fractional input and clamping it. */
|
|
8
|
+
export declare function finiteInteger(value: number, fallback: number, min?: number, max?: number): number;
|
|
9
|
+
/** Returns a finite, non-negative integer suitable for a count or index. */
|
|
10
|
+
export declare function finiteCount(value: number, fallback?: number, max?: number): number;
|
|
11
|
+
/** Returns a finite timer duration, capped at the browser timer ceiling. */
|
|
12
|
+
export declare function finiteDuration(value: number, fallback: number, min?: number, max?: number): number;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** The largest delay browsers can represent reliably with setTimeout. */
|
|
2
|
+
export const MAX_TIMEOUT_MS = 2_147_483_647;
|
|
3
|
+
/** Returns a finite number or the supplied finite fallback. */
|
|
4
|
+
export function finiteNumber(value, fallback) {
|
|
5
|
+
return Number.isFinite(value) ? value : Number.isFinite(fallback) ? fallback : 0;
|
|
6
|
+
}
|
|
7
|
+
/** Returns a finite value clamped to the requested range. */
|
|
8
|
+
export function finiteRange(value, fallback, min = Number.NEGATIVE_INFINITY, max = Number.POSITIVE_INFINITY) {
|
|
9
|
+
const safeFallback = finiteNumber(fallback, 0);
|
|
10
|
+
const safeMin = Number.isFinite(min) ? min : Number.NEGATIVE_INFINITY;
|
|
11
|
+
const safeMax = Number.isFinite(max) ? max : Number.POSITIVE_INFINITY;
|
|
12
|
+
const safeValue = finiteNumber(value, safeFallback);
|
|
13
|
+
return Math.min(safeMax, Math.max(safeMin, safeValue));
|
|
14
|
+
}
|
|
15
|
+
/** Returns a finite integer, truncating fractional input and clamping it. */
|
|
16
|
+
export function finiteInteger(value, fallback, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
|
17
|
+
return Math.trunc(finiteRange(value, fallback, min, max));
|
|
18
|
+
}
|
|
19
|
+
/** Returns a finite, non-negative integer suitable for a count or index. */
|
|
20
|
+
export function finiteCount(value, fallback = 0, max = Number.MAX_SAFE_INTEGER) {
|
|
21
|
+
return finiteInteger(value, Math.max(0, fallback), 0, max);
|
|
22
|
+
}
|
|
23
|
+
/** Returns a finite timer duration, capped at the browser timer ceiling. */
|
|
24
|
+
export function finiteDuration(value, fallback, min = 0, max = MAX_TIMEOUT_MS) {
|
|
25
|
+
return finiteRange(value, fallback, min, Math.min(max, MAX_TIMEOUT_MS));
|
|
26
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface OverlayActivationOptions {
|
|
2
|
+
/** The custom-element host that owns this overlay. */
|
|
3
|
+
host: HTMLElement;
|
|
4
|
+
/** Resolves the current dialog/panel element after each render. */
|
|
5
|
+
panel: () => HTMLElement | null;
|
|
6
|
+
/** Dismisses the overlay with its component-specific Escape reason/event. */
|
|
7
|
+
onEscape: () => void;
|
|
8
|
+
/** Dismisses the overlay with its component-specific backdrop reason/event. */
|
|
9
|
+
onBackdrop?: () => void;
|
|
10
|
+
/** Optional component-specific initial target, such as an intentionally safe default action. */
|
|
11
|
+
preferredInitialFocus?: () => HTMLElement | null;
|
|
12
|
+
/** Override the focus-return target captured when the overlay activates. */
|
|
13
|
+
restoreFocusTo?: HTMLElement | null;
|
|
14
|
+
/** Defaults to true. Nonmodal popups share ordering without inerting the page. */
|
|
15
|
+
modal?: boolean;
|
|
16
|
+
/** Defaults to true. Set false for popups that allow native Tab to leave. */
|
|
17
|
+
trapFocus?: boolean;
|
|
18
|
+
/** Optional non-trapping Tab lifecycle, called without preventing the event. */
|
|
19
|
+
onTab?: () => void;
|
|
20
|
+
}
|
|
21
|
+
export interface OverlayDeactivateOptions {
|
|
22
|
+
/** Defaults to true. Explicit outside-pointer paths can suppress restoration. */
|
|
23
|
+
restoreFocus?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface OverlayHandle {
|
|
26
|
+
/** Moves focus inside unless focus is already within the current panel. */
|
|
27
|
+
focusInitial(): void;
|
|
28
|
+
/** Removes the overlay permanently. Safe to call repeatedly. */
|
|
29
|
+
deactivate(options?: OverlayDeactivateOptions): void;
|
|
30
|
+
/** Temporarily unregisters during disconnect, preserving the original return target. */
|
|
31
|
+
suspend(): void;
|
|
32
|
+
/** Re-registers a suspended overlay in its current `ownerDocument`. */
|
|
33
|
+
resume(): void;
|
|
34
|
+
/** Whether this overlay currently owns Escape, Tab, and backdrop dismissal. */
|
|
35
|
+
isTopmost(): boolean;
|
|
36
|
+
/** Whether this handle still represents an active or temporarily suspended overlay. */
|
|
37
|
+
isActive(): boolean;
|
|
38
|
+
/** Runs the backdrop callback only when this overlay is topmost. */
|
|
39
|
+
dismissBackdrop(): boolean;
|
|
40
|
+
}
|
|
41
|
+
/** Returns the deepest focused descendant across open shadow roots. */
|
|
42
|
+
export declare function deepActiveElement(doc?: Document): Element | null;
|
|
43
|
+
export declare function composedContains(container: Element, candidate: Element | null): boolean;
|
|
44
|
+
/** Collects rendered focus targets through slots and nested open shadow roots in browser tab order. */
|
|
45
|
+
export declare function collectFocusableElements(root: Element | ShadowRoot): HTMLElement[];
|
|
46
|
+
/**
|
|
47
|
+
* Adds an overlay to a stack scoped to its own `ownerDocument`. One document
|
|
48
|
+
* listener routes Escape and Tab only to the top entry, while modal inerting,
|
|
49
|
+
* visual stack depth, and focus return are recomputed as entries move.
|
|
50
|
+
*/
|
|
51
|
+
export declare function activateOverlay(options: OverlayActivationOptions): OverlayHandle;
|