@data-slot/ui 0.2.129 → 0.2.132
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 +23 -18
- package/dist/alert-dialog.cjs +1 -0
- package/dist/alert-dialog.d.cts +2 -0
- package/dist/alert-dialog.d.ts +2 -0
- package/dist/alert-dialog.js +1 -0
- package/dist/collapsible.d.cts +1 -1
- package/dist/collapsible.d.ts +1 -1
- package/dist/command.d.cts +1 -1
- package/dist/command.d.ts +1 -1
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/dialog.d.cts +1 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/hover-card.d.cts +1 -1
- package/dist/hover-card.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index10.d.cts +14 -0
- package/dist/index10.d.ts +14 -0
- package/dist/index2.d.cts +16 -33
- package/dist/index2.d.ts +16 -33
- package/dist/index3.d.cts +42 -38
- package/dist/index3.d.ts +42 -38
- package/dist/index4.d.cts +38 -58
- package/dist/index4.d.ts +38 -58
- package/dist/index5.d.cts +39 -46
- package/dist/index5.d.ts +39 -46
- package/dist/index6.d.cts +54 -48
- package/dist/index6.d.ts +54 -48
- package/dist/index7.d.cts +45 -53
- package/dist/index7.d.ts +45 -53
- package/dist/index8.d.cts +49 -49
- package/dist/index8.d.ts +49 -49
- package/dist/index9.d.cts +71 -13
- package/dist/index9.d.ts +71 -13
- package/dist/popover.d.cts +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/popup.d.cts +13 -1
- package/dist/popup.d.ts +13 -1
- package/dist/tabs.d.cts +1 -1
- package/dist/tabs.d.ts +1 -1
- package/dist/tooltip.d.cts +1 -1
- package/dist/tooltip.d.ts +1 -1
- package/package.json +23 -16
package/dist/index4.d.cts
CHANGED
|
@@ -1,62 +1,42 @@
|
|
|
1
|
-
//#region ../
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
//#region ../command/src/index.d.ts
|
|
2
|
+
type CommandFilter = (value: string, search: string, keywords?: string[]) => number;
|
|
3
|
+
interface CommandOptions {
|
|
4
|
+
/** Accessible label announced for the command input */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Initial active item value */
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
/** Initial search input value */
|
|
9
|
+
defaultSearch?: string;
|
|
10
|
+
/** Called whenever the active item value changes */
|
|
11
|
+
onValueChange?: (value: string | null) => void;
|
|
12
|
+
/** Called whenever the search query changes */
|
|
13
|
+
onSearchChange?: (search: string) => void;
|
|
14
|
+
/** Called when an item is selected via click or Enter */
|
|
15
|
+
onSelect?: (value: string) => void;
|
|
16
|
+
/** Disable built-in filtering and sorting */
|
|
17
|
+
shouldFilter?: boolean;
|
|
18
|
+
/** Custom ranking function. Return 0 to hide the item. */
|
|
19
|
+
filter?: CommandFilter;
|
|
20
|
+
/** Wrap arrow-key navigation */
|
|
21
|
+
loop?: boolean;
|
|
22
|
+
/** Disable pointer-move selection */
|
|
23
|
+
disablePointerSelection?: boolean;
|
|
24
|
+
/** Enable ctrl+j/k/n/p shortcuts @default true */
|
|
25
|
+
vimBindings?: boolean;
|
|
15
26
|
}
|
|
16
|
-
interface
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
/** Cleanup all event listeners */
|
|
27
|
+
interface CommandController {
|
|
28
|
+
/** Current active item value */
|
|
29
|
+
readonly value: string | null;
|
|
30
|
+
/** Current search query */
|
|
31
|
+
readonly search: string;
|
|
32
|
+
/** Set the active item value programmatically */
|
|
33
|
+
select(value: string | null): void;
|
|
34
|
+
/** Set the search query programmatically */
|
|
35
|
+
setSearch(search: string): void;
|
|
36
|
+
/** Cleanup all event listeners and observers */
|
|
26
37
|
destroy(): void;
|
|
27
|
-
/** Internal: handle keydown for focus trap (used by global handler) */
|
|
28
|
-
_handleKeydown?(e: KeyboardEvent): void;
|
|
29
|
-
/** Internal: content element for focus trap */
|
|
30
|
-
_content?: HTMLElement;
|
|
31
|
-
/** Internal: overlay element for stack metadata */
|
|
32
|
-
_overlay?: HTMLElement;
|
|
33
38
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
* Expected markup:
|
|
38
|
-
* ```html
|
|
39
|
-
* <div data-slot="dialog">
|
|
40
|
-
* <button data-slot="dialog-trigger">Open</button>
|
|
41
|
-
* <div data-slot="dialog-portal">
|
|
42
|
-
* <div data-slot="dialog-overlay"></div>
|
|
43
|
-
* <div data-slot="dialog-content">
|
|
44
|
-
* <h2 data-slot="dialog-title">Title</h2>
|
|
45
|
-
* <p data-slot="dialog-description">Description</p>
|
|
46
|
-
* <button data-slot="dialog-close">Close</button>
|
|
47
|
-
* </div>
|
|
48
|
-
* </div>
|
|
49
|
-
* </div>
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* Note: Overlay is required. The optional dialog-portal slot will be
|
|
53
|
-
* automatically moved to document.body to escape stacking context issues.
|
|
54
|
-
*/
|
|
55
|
-
declare function createDialog(root: Element, options?: DialogOptions): DialogController;
|
|
56
|
-
/**
|
|
57
|
-
* Find and bind all dialog components in a scope
|
|
58
|
-
* Returns array of controllers for programmatic access
|
|
59
|
-
*/
|
|
60
|
-
declare function create(scope?: ParentNode): DialogController[];
|
|
39
|
+
declare function createCommand(root: Element, options?: CommandOptions): CommandController;
|
|
40
|
+
declare function create(scope?: ParentNode): CommandController[];
|
|
61
41
|
//#endregion
|
|
62
|
-
export {
|
|
42
|
+
export { createCommand as a, create as i, CommandFilter as n, CommandOptions as r, CommandController as t };
|
package/dist/index4.d.ts
CHANGED
|
@@ -1,62 +1,42 @@
|
|
|
1
|
-
//#region ../
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
//#region ../command/src/index.d.ts
|
|
2
|
+
type CommandFilter = (value: string, search: string, keywords?: string[]) => number;
|
|
3
|
+
interface CommandOptions {
|
|
4
|
+
/** Accessible label announced for the command input */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Initial active item value */
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
/** Initial search input value */
|
|
9
|
+
defaultSearch?: string;
|
|
10
|
+
/** Called whenever the active item value changes */
|
|
11
|
+
onValueChange?: (value: string | null) => void;
|
|
12
|
+
/** Called whenever the search query changes */
|
|
13
|
+
onSearchChange?: (search: string) => void;
|
|
14
|
+
/** Called when an item is selected via click or Enter */
|
|
15
|
+
onSelect?: (value: string) => void;
|
|
16
|
+
/** Disable built-in filtering and sorting */
|
|
17
|
+
shouldFilter?: boolean;
|
|
18
|
+
/** Custom ranking function. Return 0 to hide the item. */
|
|
19
|
+
filter?: CommandFilter;
|
|
20
|
+
/** Wrap arrow-key navigation */
|
|
21
|
+
loop?: boolean;
|
|
22
|
+
/** Disable pointer-move selection */
|
|
23
|
+
disablePointerSelection?: boolean;
|
|
24
|
+
/** Enable ctrl+j/k/n/p shortcuts @default true */
|
|
25
|
+
vimBindings?: boolean;
|
|
15
26
|
}
|
|
16
|
-
interface
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
/** Cleanup all event listeners */
|
|
27
|
+
interface CommandController {
|
|
28
|
+
/** Current active item value */
|
|
29
|
+
readonly value: string | null;
|
|
30
|
+
/** Current search query */
|
|
31
|
+
readonly search: string;
|
|
32
|
+
/** Set the active item value programmatically */
|
|
33
|
+
select(value: string | null): void;
|
|
34
|
+
/** Set the search query programmatically */
|
|
35
|
+
setSearch(search: string): void;
|
|
36
|
+
/** Cleanup all event listeners and observers */
|
|
26
37
|
destroy(): void;
|
|
27
|
-
/** Internal: handle keydown for focus trap (used by global handler) */
|
|
28
|
-
_handleKeydown?(e: KeyboardEvent): void;
|
|
29
|
-
/** Internal: content element for focus trap */
|
|
30
|
-
_content?: HTMLElement;
|
|
31
|
-
/** Internal: overlay element for stack metadata */
|
|
32
|
-
_overlay?: HTMLElement;
|
|
33
38
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
* Expected markup:
|
|
38
|
-
* ```html
|
|
39
|
-
* <div data-slot="dialog">
|
|
40
|
-
* <button data-slot="dialog-trigger">Open</button>
|
|
41
|
-
* <div data-slot="dialog-portal">
|
|
42
|
-
* <div data-slot="dialog-overlay"></div>
|
|
43
|
-
* <div data-slot="dialog-content">
|
|
44
|
-
* <h2 data-slot="dialog-title">Title</h2>
|
|
45
|
-
* <p data-slot="dialog-description">Description</p>
|
|
46
|
-
* <button data-slot="dialog-close">Close</button>
|
|
47
|
-
* </div>
|
|
48
|
-
* </div>
|
|
49
|
-
* </div>
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* Note: Overlay is required. The optional dialog-portal slot will be
|
|
53
|
-
* automatically moved to document.body to escape stacking context issues.
|
|
54
|
-
*/
|
|
55
|
-
declare function createDialog(root: Element, options?: DialogOptions): DialogController;
|
|
56
|
-
/**
|
|
57
|
-
* Find and bind all dialog components in a scope
|
|
58
|
-
* Returns array of controllers for programmatic access
|
|
59
|
-
*/
|
|
60
|
-
declare function create(scope?: ParentNode): DialogController[];
|
|
39
|
+
declare function createCommand(root: Element, options?: CommandOptions): CommandController;
|
|
40
|
+
declare function create(scope?: ParentNode): CommandController[];
|
|
61
41
|
//#endregion
|
|
62
|
-
export {
|
|
42
|
+
export { createCommand as a, create as i, CommandFilter as n, CommandOptions as r, CommandController as t };
|
package/dist/index5.d.cts
CHANGED
|
@@ -1,69 +1,62 @@
|
|
|
1
|
-
//#region ../
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type HoverCardReason = "pointer" | "focus" | "blur" | "dismiss" | "api";
|
|
5
|
-
interface HoverCardOptions {
|
|
6
|
-
/** Initial open state (uncontrolled mode only) */
|
|
1
|
+
//#region ../dialog/src/index.d.ts
|
|
2
|
+
interface DialogOptions {
|
|
3
|
+
/** Initial open state */
|
|
7
4
|
defaultOpen?: boolean;
|
|
8
|
-
/** Controlled open state. Internal interactions do not mutate when set. */
|
|
9
|
-
open?: boolean;
|
|
10
|
-
/** Delay before opening on hover/keyboard focus (ms). @default 700 */
|
|
11
|
-
delay?: number;
|
|
12
|
-
/** Duration to skip delay after closing (ms). Set to 0 to disable warm-up. @default 300 */
|
|
13
|
-
skipDelayDuration?: number;
|
|
14
|
-
/** Delay before closing after leave/blur (ms). @default 300 */
|
|
15
|
-
closeDelay?: number;
|
|
16
|
-
/** The preferred side of the trigger to render against. @default "bottom" */
|
|
17
|
-
side?: HoverCardSide;
|
|
18
|
-
/** The preferred alignment against the trigger. @default "center" */
|
|
19
|
-
align?: HoverCardAlign;
|
|
20
|
-
/** The distance in pixels from the trigger. @default 4 */
|
|
21
|
-
sideOffset?: number;
|
|
22
|
-
/** Offset in pixels from the alignment edge. @default 0 */
|
|
23
|
-
alignOffset?: number;
|
|
24
|
-
/** When true, flips/shifts content to avoid viewport collisions. @default true */
|
|
25
|
-
avoidCollisions?: boolean;
|
|
26
|
-
/** Viewport padding used when avoiding collisions. @default 8 */
|
|
27
|
-
collisionPadding?: number;
|
|
28
|
-
/** Portal content to body while open. @default true */
|
|
29
|
-
portal?: boolean;
|
|
30
|
-
/** Close when clicking outside. @default true */
|
|
31
|
-
closeOnClickOutside?: boolean;
|
|
32
|
-
/** Close when pressing Escape. @default true */
|
|
33
|
-
closeOnEscape?: boolean;
|
|
34
5
|
/** Callback when open state changes */
|
|
35
6
|
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
/** Close when clicking overlay */
|
|
8
|
+
closeOnClickOutside?: boolean;
|
|
9
|
+
/** Close when pressing Escape */
|
|
10
|
+
closeOnEscape?: boolean;
|
|
11
|
+
/** Lock body scroll when open */
|
|
12
|
+
lockScroll?: boolean;
|
|
13
|
+
/** Use alertdialog role for blocking confirmations */
|
|
14
|
+
alertDialog?: boolean;
|
|
36
15
|
}
|
|
37
|
-
interface
|
|
38
|
-
/** Open the
|
|
16
|
+
interface DialogController {
|
|
17
|
+
/** Open the dialog */
|
|
39
18
|
open(): void;
|
|
40
|
-
/** Close the
|
|
19
|
+
/** Close the dialog */
|
|
41
20
|
close(): void;
|
|
42
|
-
/** Toggle the
|
|
21
|
+
/** Toggle the dialog */
|
|
43
22
|
toggle(): void;
|
|
44
|
-
/** Force open state update (works in both controlled/uncontrolled modes) */
|
|
45
|
-
setOpen(open: boolean): void;
|
|
46
23
|
/** Current open state */
|
|
47
24
|
readonly isOpen: boolean;
|
|
48
25
|
/** Cleanup all event listeners */
|
|
49
26
|
destroy(): void;
|
|
27
|
+
/** Internal: handle keydown for focus trap (used by global handler) */
|
|
28
|
+
_handleKeydown?(e: KeyboardEvent): void;
|
|
29
|
+
/** Internal: content element for focus trap */
|
|
30
|
+
_content?: HTMLElement;
|
|
31
|
+
/** Internal: overlay element for stack metadata */
|
|
32
|
+
_overlay?: HTMLElement;
|
|
50
33
|
}
|
|
51
34
|
/**
|
|
52
|
-
* Create a
|
|
35
|
+
* Create a dialog controller for a root element
|
|
53
36
|
*
|
|
54
37
|
* Expected markup:
|
|
55
38
|
* ```html
|
|
56
|
-
* <div data-slot="
|
|
57
|
-
* <button data-slot="
|
|
58
|
-
* <div data-slot="
|
|
39
|
+
* <div data-slot="dialog">
|
|
40
|
+
* <button data-slot="dialog-trigger">Open</button>
|
|
41
|
+
* <div data-slot="dialog-portal">
|
|
42
|
+
* <div data-slot="dialog-overlay"></div>
|
|
43
|
+
* <div data-slot="dialog-content">
|
|
44
|
+
* <h2 data-slot="dialog-title">Title</h2>
|
|
45
|
+
* <p data-slot="dialog-description">Description</p>
|
|
46
|
+
* <button data-slot="dialog-close">Close</button>
|
|
47
|
+
* </div>
|
|
48
|
+
* </div>
|
|
59
49
|
* </div>
|
|
60
50
|
* ```
|
|
51
|
+
*
|
|
52
|
+
* Note: Overlay is required. The optional dialog-portal slot will be
|
|
53
|
+
* automatically moved to document.body to escape stacking context issues.
|
|
61
54
|
*/
|
|
62
|
-
declare function
|
|
55
|
+
declare function createDialog(root: Element, options?: DialogOptions): DialogController;
|
|
63
56
|
/**
|
|
64
|
-
* Find and bind all
|
|
57
|
+
* Find and bind all dialog components in a scope
|
|
65
58
|
* Returns array of controllers for programmatic access
|
|
66
59
|
*/
|
|
67
|
-
declare function create(scope?: ParentNode):
|
|
60
|
+
declare function create(scope?: ParentNode): DialogController[];
|
|
68
61
|
//#endregion
|
|
69
|
-
export {
|
|
62
|
+
export { createDialog as i, DialogOptions as n, create as r, DialogController as t };
|
package/dist/index5.d.ts
CHANGED
|
@@ -1,69 +1,62 @@
|
|
|
1
|
-
//#region ../
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type HoverCardReason = "pointer" | "focus" | "blur" | "dismiss" | "api";
|
|
5
|
-
interface HoverCardOptions {
|
|
6
|
-
/** Initial open state (uncontrolled mode only) */
|
|
1
|
+
//#region ../dialog/src/index.d.ts
|
|
2
|
+
interface DialogOptions {
|
|
3
|
+
/** Initial open state */
|
|
7
4
|
defaultOpen?: boolean;
|
|
8
|
-
/** Controlled open state. Internal interactions do not mutate when set. */
|
|
9
|
-
open?: boolean;
|
|
10
|
-
/** Delay before opening on hover/keyboard focus (ms). @default 700 */
|
|
11
|
-
delay?: number;
|
|
12
|
-
/** Duration to skip delay after closing (ms). Set to 0 to disable warm-up. @default 300 */
|
|
13
|
-
skipDelayDuration?: number;
|
|
14
|
-
/** Delay before closing after leave/blur (ms). @default 300 */
|
|
15
|
-
closeDelay?: number;
|
|
16
|
-
/** The preferred side of the trigger to render against. @default "bottom" */
|
|
17
|
-
side?: HoverCardSide;
|
|
18
|
-
/** The preferred alignment against the trigger. @default "center" */
|
|
19
|
-
align?: HoverCardAlign;
|
|
20
|
-
/** The distance in pixels from the trigger. @default 4 */
|
|
21
|
-
sideOffset?: number;
|
|
22
|
-
/** Offset in pixels from the alignment edge. @default 0 */
|
|
23
|
-
alignOffset?: number;
|
|
24
|
-
/** When true, flips/shifts content to avoid viewport collisions. @default true */
|
|
25
|
-
avoidCollisions?: boolean;
|
|
26
|
-
/** Viewport padding used when avoiding collisions. @default 8 */
|
|
27
|
-
collisionPadding?: number;
|
|
28
|
-
/** Portal content to body while open. @default true */
|
|
29
|
-
portal?: boolean;
|
|
30
|
-
/** Close when clicking outside. @default true */
|
|
31
|
-
closeOnClickOutside?: boolean;
|
|
32
|
-
/** Close when pressing Escape. @default true */
|
|
33
|
-
closeOnEscape?: boolean;
|
|
34
5
|
/** Callback when open state changes */
|
|
35
6
|
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
/** Close when clicking overlay */
|
|
8
|
+
closeOnClickOutside?: boolean;
|
|
9
|
+
/** Close when pressing Escape */
|
|
10
|
+
closeOnEscape?: boolean;
|
|
11
|
+
/** Lock body scroll when open */
|
|
12
|
+
lockScroll?: boolean;
|
|
13
|
+
/** Use alertdialog role for blocking confirmations */
|
|
14
|
+
alertDialog?: boolean;
|
|
36
15
|
}
|
|
37
|
-
interface
|
|
38
|
-
/** Open the
|
|
16
|
+
interface DialogController {
|
|
17
|
+
/** Open the dialog */
|
|
39
18
|
open(): void;
|
|
40
|
-
/** Close the
|
|
19
|
+
/** Close the dialog */
|
|
41
20
|
close(): void;
|
|
42
|
-
/** Toggle the
|
|
21
|
+
/** Toggle the dialog */
|
|
43
22
|
toggle(): void;
|
|
44
|
-
/** Force open state update (works in both controlled/uncontrolled modes) */
|
|
45
|
-
setOpen(open: boolean): void;
|
|
46
23
|
/** Current open state */
|
|
47
24
|
readonly isOpen: boolean;
|
|
48
25
|
/** Cleanup all event listeners */
|
|
49
26
|
destroy(): void;
|
|
27
|
+
/** Internal: handle keydown for focus trap (used by global handler) */
|
|
28
|
+
_handleKeydown?(e: KeyboardEvent): void;
|
|
29
|
+
/** Internal: content element for focus trap */
|
|
30
|
+
_content?: HTMLElement;
|
|
31
|
+
/** Internal: overlay element for stack metadata */
|
|
32
|
+
_overlay?: HTMLElement;
|
|
50
33
|
}
|
|
51
34
|
/**
|
|
52
|
-
* Create a
|
|
35
|
+
* Create a dialog controller for a root element
|
|
53
36
|
*
|
|
54
37
|
* Expected markup:
|
|
55
38
|
* ```html
|
|
56
|
-
* <div data-slot="
|
|
57
|
-
* <button data-slot="
|
|
58
|
-
* <div data-slot="
|
|
39
|
+
* <div data-slot="dialog">
|
|
40
|
+
* <button data-slot="dialog-trigger">Open</button>
|
|
41
|
+
* <div data-slot="dialog-portal">
|
|
42
|
+
* <div data-slot="dialog-overlay"></div>
|
|
43
|
+
* <div data-slot="dialog-content">
|
|
44
|
+
* <h2 data-slot="dialog-title">Title</h2>
|
|
45
|
+
* <p data-slot="dialog-description">Description</p>
|
|
46
|
+
* <button data-slot="dialog-close">Close</button>
|
|
47
|
+
* </div>
|
|
48
|
+
* </div>
|
|
59
49
|
* </div>
|
|
60
50
|
* ```
|
|
51
|
+
*
|
|
52
|
+
* Note: Overlay is required. The optional dialog-portal slot will be
|
|
53
|
+
* automatically moved to document.body to escape stacking context issues.
|
|
61
54
|
*/
|
|
62
|
-
declare function
|
|
55
|
+
declare function createDialog(root: Element, options?: DialogOptions): DialogController;
|
|
63
56
|
/**
|
|
64
|
-
* Find and bind all
|
|
57
|
+
* Find and bind all dialog components in a scope
|
|
65
58
|
* Returns array of controllers for programmatic access
|
|
66
59
|
*/
|
|
67
|
-
declare function create(scope?: ParentNode):
|
|
60
|
+
declare function create(scope?: ParentNode): DialogController[];
|
|
68
61
|
//#endregion
|
|
69
|
-
export {
|
|
62
|
+
export { createDialog as i, DialogOptions as n, create as r, DialogController as t };
|
package/dist/index6.d.cts
CHANGED
|
@@ -1,63 +1,69 @@
|
|
|
1
|
-
//#region ../
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
//#region ../hover-card/src/index.d.ts
|
|
2
|
+
type HoverCardSide = "top" | "right" | "bottom" | "left";
|
|
3
|
+
type HoverCardAlign = "start" | "center" | "end";
|
|
4
|
+
type HoverCardReason = "pointer" | "focus" | "blur" | "dismiss" | "api";
|
|
5
|
+
interface HoverCardOptions {
|
|
6
|
+
/** Initial open state (uncontrolled mode only) */
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
/** Controlled open state. Internal interactions do not mutate when set. */
|
|
9
|
+
open?: boolean;
|
|
10
|
+
/** Delay before opening on hover/keyboard focus (ms). @default 700 */
|
|
11
|
+
delay?: number;
|
|
12
|
+
/** Duration to skip delay after closing (ms). Set to 0 to disable warm-up. @default 300 */
|
|
13
|
+
skipDelayDuration?: number;
|
|
14
|
+
/** Delay before closing after leave/blur (ms). @default 300 */
|
|
15
|
+
closeDelay?: number;
|
|
16
|
+
/** The preferred side of the trigger to render against. @default "bottom" */
|
|
17
|
+
side?: HoverCardSide;
|
|
18
|
+
/** The preferred alignment against the trigger. @default "center" */
|
|
19
|
+
align?: HoverCardAlign;
|
|
20
|
+
/** The distance in pixels from the trigger. @default 4 */
|
|
21
|
+
sideOffset?: number;
|
|
22
|
+
/** Offset in pixels from the alignment edge. @default 0 */
|
|
23
|
+
alignOffset?: number;
|
|
24
|
+
/** When true, flips/shifts content to avoid viewport collisions. @default true */
|
|
25
|
+
avoidCollisions?: boolean;
|
|
26
|
+
/** Viewport padding used when avoiding collisions. @default 8 */
|
|
27
|
+
collisionPadding?: number;
|
|
28
|
+
/** Portal content to body while open. @default true */
|
|
29
|
+
portal?: boolean;
|
|
30
|
+
/** Close when clicking outside. @default true */
|
|
31
|
+
closeOnClickOutside?: boolean;
|
|
32
|
+
/** Close when pressing Escape. @default true */
|
|
33
|
+
closeOnEscape?: boolean;
|
|
34
|
+
/** Callback when open state changes */
|
|
35
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
36
|
}
|
|
16
|
-
interface
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
|
|
37
|
+
interface HoverCardController {
|
|
38
|
+
/** Open the hover-card (request in controlled mode) */
|
|
39
|
+
open(): void;
|
|
40
|
+
/** Close the hover-card (request in controlled mode) */
|
|
41
|
+
close(): void;
|
|
42
|
+
/** Toggle the hover-card (request in controlled mode) */
|
|
43
|
+
toggle(): void;
|
|
44
|
+
/** Force open state update (works in both controlled/uncontrolled modes) */
|
|
45
|
+
setOpen(open: boolean): void;
|
|
46
|
+
/** Current open state */
|
|
47
|
+
readonly isOpen: boolean;
|
|
23
48
|
/** Cleanup all event listeners */
|
|
24
49
|
destroy(): void;
|
|
25
50
|
}
|
|
26
51
|
/**
|
|
27
|
-
* Create a
|
|
28
|
-
*
|
|
29
|
-
* ## Events
|
|
30
|
-
* - **Outbound** `tabs:change` (on root): Fires when selected tab changes.
|
|
31
|
-
* `event.detail: { value: string }`
|
|
32
|
-
* - **Inbound** `tabs:select` (on root): Select a tab programmatically.
|
|
33
|
-
* `event.detail: { value: string } | string` (fallback: `event.currentTarget.dataset.value`)
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```js
|
|
37
|
-
* // Listen for tab changes
|
|
38
|
-
* root.addEventListener("tabs:change", (e) => console.log(e.detail.value));
|
|
39
|
-
* // Select a tab from outside (object or string detail)
|
|
40
|
-
* root.dispatchEvent(new CustomEvent("tabs:select", { detail: { value: "two" } }));
|
|
41
|
-
* root.dispatchEvent(new CustomEvent("tabs:select", { detail: "two" }));
|
|
42
|
-
* ```
|
|
52
|
+
* Create a hover-card controller for a root element
|
|
43
53
|
*
|
|
44
54
|
* Expected markup:
|
|
45
55
|
* ```html
|
|
46
|
-
* <div data-slot="
|
|
47
|
-
* <
|
|
48
|
-
*
|
|
49
|
-
* <button data-slot="tabs-trigger" data-value="two">Tab Two</button>
|
|
50
|
-
* </div>
|
|
51
|
-
* <div data-slot="tabs-content" data-value="one">Content One</div>
|
|
52
|
-
* <div data-slot="tabs-content" data-value="two">Content Two</div>
|
|
56
|
+
* <div data-slot="hover-card">
|
|
57
|
+
* <button data-slot="hover-card-trigger">Hover me</button>
|
|
58
|
+
* <div data-slot="hover-card-content">Preview content</div>
|
|
53
59
|
* </div>
|
|
54
60
|
* ```
|
|
55
61
|
*/
|
|
56
|
-
declare function
|
|
62
|
+
declare function createHoverCard(root: Element, options?: HoverCardOptions): HoverCardController;
|
|
57
63
|
/**
|
|
58
|
-
* Find and bind all
|
|
64
|
+
* Find and bind all hover-card components in a scope
|
|
59
65
|
* Returns array of controllers for programmatic access
|
|
60
66
|
*/
|
|
61
|
-
declare function create(scope?: ParentNode):
|
|
67
|
+
declare function create(scope?: ParentNode): HoverCardController[];
|
|
62
68
|
//#endregion
|
|
63
|
-
export {
|
|
69
|
+
export { HoverCardSide as a, HoverCardReason as i, HoverCardController as n, create as o, HoverCardOptions as r, createHoverCard as s, HoverCardAlign as t };
|