@epoch32/visage 0.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/api/client.d.ts +5 -0
  2. package/dist/api/file-router.d.ts +29 -0
  3. package/dist/api/handler.d.ts +15 -0
  4. package/dist/api/index.d.ts +12 -0
  5. package/dist/{src/api → api}/index.js +87 -2
  6. package/dist/api/middleware.d.ts +11 -0
  7. package/dist/api/pragma.d.ts +21 -0
  8. package/dist/api/procedure.d.ts +66 -0
  9. package/dist/api/types.d.ts +181 -0
  10. package/dist/charts/Area.d.ts +18 -0
  11. package/dist/charts/Axis.d.ts +21 -0
  12. package/dist/charts/Bar.d.ts +10 -0
  13. package/dist/charts/CartesianGrid.d.ts +10 -0
  14. package/dist/charts/Chart.d.ts +16 -0
  15. package/dist/charts/Cursor.d.ts +8 -0
  16. package/dist/charts/Legend.d.ts +9 -0
  17. package/dist/charts/Line.d.ts +18 -0
  18. package/dist/charts/Pie.d.ts +12 -0
  19. package/dist/charts/Tooltip.d.ts +12 -0
  20. package/dist/charts/context.d.ts +20 -0
  21. package/dist/charts/index.d.ts +14 -0
  22. package/dist/{src/charts → charts}/index.js +87 -2
  23. package/dist/charts/path.d.ts +27 -0
  24. package/dist/charts/scale.d.ts +23 -0
  25. package/dist/charts/types.d.ts +43 -0
  26. package/dist/devtools/DomTab.d.ts +6 -0
  27. package/dist/devtools/GraphInspector.d.ts +11 -0
  28. package/dist/devtools/GraphTab.d.ts +10 -0
  29. package/dist/devtools/QueryTab.d.ts +10 -0
  30. package/dist/devtools/RpcTab.d.ts +10 -0
  31. package/dist/devtools/SignalsTab.d.ts +10 -0
  32. package/dist/devtools/component.d.ts +2 -0
  33. package/dist/devtools/highlighter.d.ts +2 -0
  34. package/dist/devtools/hub.d.ts +41 -0
  35. package/dist/devtools/index.d.ts +9 -0
  36. package/dist/{src/devtools → devtools}/index.js +87 -2
  37. package/dist/devtools/styles.d.ts +1 -0
  38. package/dist/devtools/types.d.ts +44 -0
  39. package/dist/dom/async.d.ts +41 -0
  40. package/dist/dom/control-flow.d.ts +53 -0
  41. package/dist/dom/index.d.ts +3 -0
  42. package/dist/{src/dom → dom}/index.js +87 -2
  43. package/dist/dom/lazy.d.ts +30 -0
  44. package/dist/dom/render.d.ts +23 -0
  45. package/dist/dom/resource.d.ts +34 -0
  46. package/dist/form/form.d.ts +41 -0
  47. package/dist/form/index.d.ts +2 -0
  48. package/dist/{src/form → form}/index.js +87 -2
  49. package/dist/form/schema.d.ts +96 -0
  50. package/dist/index.d.ts +15 -0
  51. package/dist/index.js +3571 -1293
  52. package/dist/jsx-dev-runtime/index.d.ts +1 -0
  53. package/dist/jsx-runtime/index.d.ts +8 -0
  54. package/dist/{src/jsx-runtime → jsx-runtime}/index.js +87 -2
  55. package/dist/query/create-mutation.d.ts +3 -0
  56. package/dist/query/create-query.d.ts +4 -0
  57. package/dist/query/focus-manager.d.ts +14 -0
  58. package/dist/query/index.d.ts +9 -0
  59. package/dist/{src/query → query}/index.js +87 -2
  60. package/dist/query/mutation-cache.d.ts +24 -0
  61. package/dist/query/online-manager.d.ts +14 -0
  62. package/dist/query/query-cache.d.ts +69 -0
  63. package/dist/query/query-client.d.ts +46 -0
  64. package/dist/query/types.d.ts +131 -0
  65. package/dist/query/utils.d.ts +16 -0
  66. package/dist/router/index.d.ts +1 -0
  67. package/dist/{src/router → router}/index.js +87 -2
  68. package/dist/router/router.d.ts +91 -0
  69. package/dist/rpc/client.d.ts +2 -0
  70. package/dist/rpc/error.d.ts +16 -0
  71. package/dist/rpc/index.d.ts +7 -0
  72. package/dist/{src/rpc → rpc}/index.js +87 -2
  73. package/dist/rpc/procedure.d.ts +8 -0
  74. package/dist/rpc/router.d.ts +19 -0
  75. package/dist/rpc/server.d.ts +3 -0
  76. package/dist/rpc/types.d.ts +200 -0
  77. package/dist/server/hydrate.d.ts +5 -0
  78. package/dist/server/index.d.ts +3 -0
  79. package/dist/{src/server → server}/index.js +87 -2
  80. package/dist/server/render-to-stream.d.ts +9 -0
  81. package/dist/server/render-to-string.d.ts +6 -0
  82. package/dist/signals/computed.d.ts +61 -0
  83. package/dist/signals/context.d.ts +44 -0
  84. package/dist/signals/effect.d.ts +56 -0
  85. package/dist/signals/index.d.ts +8 -0
  86. package/dist/{src/signals → signals}/index.js +87 -2
  87. package/dist/signals/scope.d.ts +61 -0
  88. package/dist/signals/signal.d.ts +40 -0
  89. package/dist/signals/store.d.ts +45 -0
  90. package/dist/signals/system.d.ts +56 -0
  91. package/dist/signals/types.d.ts +58 -0
  92. package/dist/style/component.d.ts +49 -0
  93. package/dist/style/create-style.d.ts +63 -0
  94. package/dist/style/cx.d.ts +18 -0
  95. package/dist/style/hash.d.ts +8 -0
  96. package/dist/style/index.d.ts +8 -0
  97. package/dist/{src/style → style}/index.js +87 -2
  98. package/dist/style/layout.d.ts +129 -0
  99. package/dist/style/manager.d.ts +31 -0
  100. package/dist/style/parser.d.ts +12 -0
  101. package/dist/style/scale.d.ts +82 -0
  102. package/dist/template/index.d.ts +1 -0
  103. package/dist/{src/template → template}/index.js +87 -2
  104. package/dist/template/template.d.ts +8 -0
  105. package/dist/ui/accordion.d.ts +81 -0
  106. package/dist/ui/command-dialog.d.ts +10 -0
  107. package/dist/ui/command.d.ts +103 -0
  108. package/dist/ui/data-table.d.ts +38 -0
  109. package/dist/ui/dialog.d.ts +102 -0
  110. package/dist/ui/dropdown-menu.d.ts +92 -0
  111. package/dist/ui/icon.d.ts +18 -0
  112. package/dist/ui/index.d.ts +14 -0
  113. package/dist/{src/ui → ui}/index.js +87 -2
  114. package/dist/ui/layout.d.ts +1 -0
  115. package/dist/ui/popover.d.ts +68 -0
  116. package/dist/ui/switch.d.ts +31 -0
  117. package/dist/ui/tabs.d.ts +71 -0
  118. package/dist/ui/toast.d.ts +91 -0
  119. package/dist/ui/tooltip.d.ts +64 -0
  120. package/dist/ui/utils.d.ts +21 -0
  121. package/dist/virtual/index.d.ts +2 -0
  122. package/dist/{src/virtual → virtual}/index.js +87 -2
  123. package/dist/virtual/virtual-list.d.ts +21 -0
  124. package/dist/virtual/virtualizer.d.ts +31 -0
  125. package/dist/vite/hmr.d.ts +7 -0
  126. package/dist/vite/index.d.ts +3 -0
  127. package/dist/vite/index.js +296 -15
  128. package/dist/vite/lucide.d.ts +27 -0
  129. package/dist/vite/plugin.d.ts +3 -0
  130. package/dist/vite/rpc-middleware.d.ts +5 -0
  131. package/dist/vite/types.d.ts +59 -0
  132. package/package.json +40 -40
  133. package/src/signals/index.ts +1 -0
  134. package/src/signals/signal.ts +110 -2
  135. package/src/signals/types.ts +9 -0
  136. package/src/vite/plugin.ts +4 -0
  137. package/dist/bundle.dev.js +0 -4875
  138. package/dist/src/index.js +0 -11826
  139. package/dist/src/vite/index.js +0 -984
@@ -0,0 +1,81 @@
1
+ import type { Child } from "../dom/render";
2
+ export interface AccordionContextValue {
3
+ isExpanded: (value: string) => boolean;
4
+ toggleItem: (value: string) => void;
5
+ type: "single" | "multiple";
6
+ collapsible: boolean;
7
+ }
8
+ export declare const AccordionContext: import("..").Context<AccordionContextValue | null>;
9
+ export declare function useAccordionContext(): AccordionContextValue | null;
10
+ export interface AccordionItemData {
11
+ value: string;
12
+ trigger: Child | (() => Child);
13
+ content: Child | (() => Child);
14
+ disabled?: boolean | (() => boolean);
15
+ }
16
+ export interface AccordionBaseProps {
17
+ items?: AccordionItemData[];
18
+ itemClass?: any;
19
+ triggerClass?: any;
20
+ contentClass?: any;
21
+ as?: string;
22
+ class?: any;
23
+ style?: any;
24
+ children?: Child | (() => Child);
25
+ [key: string]: any;
26
+ }
27
+ export interface AccordionSingleProps extends AccordionBaseProps {
28
+ type: "single";
29
+ value?: () => string | undefined;
30
+ defaultValue?: string;
31
+ onValueChange?: (value: string) => void;
32
+ collapsible?: boolean;
33
+ }
34
+ export interface AccordionMultipleProps extends AccordionBaseProps {
35
+ type: "multiple";
36
+ value?: () => string[] | undefined;
37
+ defaultValue?: string[];
38
+ onValueChange?: (value: string[]) => void;
39
+ }
40
+ export type AccordionProps = AccordionSingleProps | AccordionMultipleProps;
41
+ export declare function AccordionRoot(props: AccordionProps): Child;
42
+ export interface AccordionItemContextValue {
43
+ value: string;
44
+ itemId: string;
45
+ }
46
+ export declare const AccordionItemContext: import("..").Context<AccordionItemContextValue | null>;
47
+ export declare function useAccordionItemContext(): AccordionItemContextValue | null;
48
+ export interface AccordionItemProps {
49
+ value: string;
50
+ disabled?: boolean | (() => boolean);
51
+ as?: string;
52
+ class?: any;
53
+ style?: any;
54
+ children: Child | (() => Child);
55
+ [key: string]: any;
56
+ }
57
+ export declare function AccordionItem(props: AccordionItemProps): Child;
58
+ export interface AccordionTriggerProps {
59
+ as?: string;
60
+ class?: any;
61
+ style?: any;
62
+ onClick?: (e: MouseEvent) => void;
63
+ children: Child | (() => Child);
64
+ [key: string]: any;
65
+ }
66
+ export declare function AccordionTrigger(props: AccordionTriggerProps): Child;
67
+ export interface AccordionContentProps {
68
+ forceMount?: boolean;
69
+ as?: string;
70
+ class?: any;
71
+ style?: any;
72
+ children: Child | (() => Child);
73
+ [key: string]: any;
74
+ }
75
+ export declare function AccordionContent(props: AccordionContentProps): Child;
76
+ export declare const Accordion: typeof AccordionRoot & {
77
+ Root: typeof AccordionRoot;
78
+ Item: typeof AccordionItem;
79
+ Trigger: typeof AccordionTrigger;
80
+ Content: typeof AccordionContent;
81
+ };
@@ -0,0 +1,10 @@
1
+ import type { Child } from "../dom/render";
2
+ import type { CommandProps } from "./command";
3
+ export interface CommandDialogProps extends CommandProps {
4
+ open?: () => boolean | undefined;
5
+ defaultOpen?: boolean;
6
+ onOpenChange?: (open: boolean) => void;
7
+ overlayClass?: any;
8
+ contentClass?: any;
9
+ }
10
+ export declare function CommandDialog(props: CommandDialogProps): Child;
@@ -0,0 +1,103 @@
1
+ import type { Child } from "../dom/render";
2
+ import type { ReadonlySignal } from "../signals";
3
+ import { CommandDialog, type CommandDialogProps } from "./command-dialog";
4
+ export type { CommandDialogProps };
5
+ export { CommandDialog };
6
+ export interface CommandItemData {
7
+ value?: string;
8
+ label: Child | (() => Child);
9
+ icon?: Child | (() => Child);
10
+ shortcut?: string;
11
+ disabled?: boolean;
12
+ onSelect?: () => void;
13
+ keywords?: string[];
14
+ class?: any;
15
+ }
16
+ export interface CommandGroupData {
17
+ heading?: string;
18
+ items: CommandItemData[];
19
+ }
20
+ export interface CommandContextValue {
21
+ search: ReadonlySignal<string>;
22
+ setSearch: (query: string) => void;
23
+ activeValue: ReadonlySignal<string>;
24
+ setActiveValue: (val: string) => void;
25
+ filterMatches: (text: string, keywords?: string[]) => boolean;
26
+ commandId: string;
27
+ }
28
+ export declare const CommandContext: import("..").Context<CommandContextValue | null>;
29
+ export declare function useCommandContext(): CommandContextValue | null;
30
+ export interface CommandProps {
31
+ value?: () => string | undefined;
32
+ defaultValue?: string;
33
+ onValueChange?: (value: string) => void;
34
+ search?: () => string | undefined;
35
+ onSearchChange?: (query: string) => void;
36
+ placeholder?: string;
37
+ groups?: CommandGroupData[];
38
+ items?: CommandItemData[];
39
+ emptyText?: string;
40
+ class?: any;
41
+ style?: any;
42
+ inputClass?: any;
43
+ listClass?: any;
44
+ itemClass?: any;
45
+ as?: string;
46
+ children?: Child | (() => Child);
47
+ [key: string]: any;
48
+ }
49
+ export declare function CommandRoot(props: CommandProps): Child;
50
+ export interface CommandInputProps {
51
+ placeholder?: string;
52
+ class?: any;
53
+ style?: any;
54
+ [key: string]: any;
55
+ }
56
+ export declare function CommandInput(props: CommandInputProps): Child;
57
+ export interface CommandListProps {
58
+ as?: string;
59
+ class?: any;
60
+ style?: any;
61
+ children: Child | (() => Child);
62
+ [key: string]: any;
63
+ }
64
+ export declare function CommandList(props: CommandListProps): Child;
65
+ export interface CommandEmptyProps {
66
+ as?: string;
67
+ class?: any;
68
+ style?: any;
69
+ children: Child | (() => Child);
70
+ [key: string]: any;
71
+ }
72
+ export declare function CommandEmpty(props: CommandEmptyProps): Child;
73
+ export interface CommandGroupProps {
74
+ heading?: string;
75
+ as?: string;
76
+ class?: any;
77
+ style?: any;
78
+ children: Child | (() => Child);
79
+ [key: string]: any;
80
+ }
81
+ export declare function CommandGroup(props: CommandGroupProps): Child;
82
+ export interface CommandItemProps {
83
+ value?: string;
84
+ shortcut?: string;
85
+ disabled?: boolean;
86
+ onSelect?: () => void;
87
+ keywords?: string[];
88
+ as?: string;
89
+ class?: any;
90
+ style?: any;
91
+ children: Child | (() => Child);
92
+ [key: string]: any;
93
+ }
94
+ export declare function CommandItem(props: CommandItemProps): Child;
95
+ export declare const Command: typeof CommandRoot & {
96
+ Root: typeof CommandRoot;
97
+ Dialog: typeof CommandDialog;
98
+ Input: typeof CommandInput;
99
+ List: typeof CommandList;
100
+ Empty: typeof CommandEmpty;
101
+ Group: typeof CommandGroup;
102
+ Item: typeof CommandItem;
103
+ };
@@ -0,0 +1,38 @@
1
+ import type { Child } from "../dom/render";
2
+ export type SortDirection = "asc" | "desc" | null;
3
+ export interface SortState {
4
+ column: string;
5
+ direction: SortDirection;
6
+ }
7
+ export interface ColumnDef<T = any> {
8
+ id: string;
9
+ header: Child | (() => Child);
10
+ accessorKey?: keyof T;
11
+ cell?: (row: T, index: number) => Child;
12
+ sortable?: boolean;
13
+ width?: string;
14
+ align?: "left" | "center" | "right";
15
+ }
16
+ export interface DataTableProps<T = any> {
17
+ data: T[] | (() => T[]);
18
+ columns: ColumnDef<T>[];
19
+ sort?: () => SortState | undefined;
20
+ onSortChange?: (sort: SortState) => void;
21
+ filter?: () => string | undefined;
22
+ selection?: "none" | "single" | "multi";
23
+ selectedKeys?: () => string[] | undefined;
24
+ onSelectionChange?: (keys: string[]) => void;
25
+ getRowId?: (row: T, index: number) => string;
26
+ pageSize?: number;
27
+ onRowClick?: (row: T, index: number) => void;
28
+ emptyText?: string;
29
+ class?: any;
30
+ style?: any;
31
+ tableClass?: any;
32
+ headerClass?: any;
33
+ rowClass?: any;
34
+ cellClass?: any;
35
+ paginationClass?: any;
36
+ [key: string]: any;
37
+ }
38
+ export declare function DataTable<T extends Record<string, any>>(props: DataTableProps<T>): Child;
@@ -0,0 +1,102 @@
1
+ import type { Child } from "../dom/render";
2
+ import type { ReadonlySignal } from "../signals";
3
+ export interface DialogContextValue {
4
+ open: ReadonlySignal<boolean>;
5
+ setOpen: (open: boolean) => void;
6
+ titleId: string;
7
+ descriptionId: string;
8
+ contentRef: {
9
+ current: HTMLElement | null;
10
+ };
11
+ }
12
+ export declare const DialogContext: import("..").Context<DialogContextValue | null>;
13
+ export declare function useDialogContext(): DialogContextValue;
14
+ export interface DialogProps {
15
+ open?: () => boolean | undefined;
16
+ defaultOpen?: boolean;
17
+ onOpenChange?: (open: boolean) => void;
18
+ trigger?: Child | (() => Child);
19
+ title?: Child | (() => Child);
20
+ description?: Child | (() => Child);
21
+ footer?: Child | (() => Child);
22
+ triggerClass?: any;
23
+ overlayClass?: any;
24
+ contentClass?: any;
25
+ titleClass?: any;
26
+ descriptionClass?: any;
27
+ footerClass?: any;
28
+ portalled?: boolean;
29
+ children?: Child | (() => Child);
30
+ }
31
+ export declare function DialogRoot(props: DialogProps): Child;
32
+ export interface DialogTriggerProps {
33
+ as?: string;
34
+ class?: any;
35
+ style?: any;
36
+ onClick?: (e: MouseEvent) => void;
37
+ children: Child | (() => Child);
38
+ [key: string]: any;
39
+ }
40
+ export declare function DialogTrigger(props: DialogTriggerProps): Child;
41
+ export interface DialogPortalProps {
42
+ mount?: HTMLElement | null;
43
+ children: Child | (() => Child);
44
+ }
45
+ export declare function DialogPortal(props: DialogPortalProps): Child;
46
+ export interface DialogOverlayProps {
47
+ as?: string;
48
+ portalled?: boolean;
49
+ mount?: HTMLElement | null;
50
+ class?: any;
51
+ style?: any;
52
+ onClick?: (e: MouseEvent) => void;
53
+ children?: Child | (() => Child);
54
+ [key: string]: any;
55
+ }
56
+ export declare function DialogOverlay(props: DialogOverlayProps): Child;
57
+ export interface DialogContentProps {
58
+ as?: string;
59
+ portalled?: boolean;
60
+ mount?: HTMLElement | null;
61
+ class?: any;
62
+ style?: any;
63
+ onKeyDown?: (e: KeyboardEvent) => void;
64
+ children: Child | (() => Child);
65
+ [key: string]: any;
66
+ }
67
+ export declare function DialogContent(props: DialogContentProps): Child;
68
+ export interface DialogTitleProps {
69
+ as?: string;
70
+ class?: any;
71
+ style?: any;
72
+ children: Child | (() => Child);
73
+ [key: string]: any;
74
+ }
75
+ export declare function DialogTitle(props: DialogTitleProps): Child;
76
+ export interface DialogDescriptionProps {
77
+ as?: string;
78
+ class?: any;
79
+ style?: any;
80
+ children: Child | (() => Child);
81
+ [key: string]: any;
82
+ }
83
+ export declare function DialogDescription(props: DialogDescriptionProps): Child;
84
+ export interface DialogCloseProps {
85
+ as?: string;
86
+ class?: any;
87
+ style?: any;
88
+ onClick?: (e: MouseEvent) => void;
89
+ children: Child | (() => Child);
90
+ [key: string]: any;
91
+ }
92
+ export declare function DialogClose(props: DialogCloseProps): Child;
93
+ export declare const Dialog: typeof DialogRoot & {
94
+ Root: typeof DialogRoot;
95
+ Trigger: typeof DialogTrigger;
96
+ Portal: typeof DialogPortal;
97
+ Overlay: typeof DialogOverlay;
98
+ Content: typeof DialogContent;
99
+ Title: typeof DialogTitle;
100
+ Description: typeof DialogDescription;
101
+ Close: typeof DialogClose;
102
+ };
@@ -0,0 +1,92 @@
1
+ import type { Child } from "../dom/render";
2
+ import { type ReadonlySignal } from "../signals";
3
+ export interface DropdownMenuContextValue {
4
+ open: ReadonlySignal<boolean>;
5
+ setOpen: (open: boolean) => void;
6
+ triggerRef: {
7
+ current: HTMLElement | null;
8
+ };
9
+ contentRef: {
10
+ current: HTMLElement | null;
11
+ };
12
+ menuId: string;
13
+ }
14
+ export declare const DropdownMenuContext: import("..").Context<DropdownMenuContextValue | null>;
15
+ export declare function useDropdownMenuContext(): DropdownMenuContextValue | null;
16
+ export interface DropdownMenuItemData {
17
+ label?: Child | (() => Child);
18
+ icon?: Child | (() => Child);
19
+ disabled?: boolean | (() => boolean);
20
+ danger?: boolean;
21
+ separator?: boolean;
22
+ onSelect?: (e: Event) => void;
23
+ class?: any;
24
+ }
25
+ export interface DropdownMenuProps {
26
+ open?: () => boolean | undefined;
27
+ defaultOpen?: boolean;
28
+ onOpenChange?: (open: boolean) => void;
29
+ trigger?: Child | (() => Child);
30
+ items?: DropdownMenuItemData[];
31
+ triggerClass?: any;
32
+ contentClass?: any;
33
+ itemClass?: any;
34
+ separatorClass?: any;
35
+ portalled?: boolean;
36
+ children?: Child | (() => Child);
37
+ }
38
+ export declare function DropdownMenuRoot(props: DropdownMenuProps): Child;
39
+ export interface DropdownMenuTriggerProps {
40
+ as?: string;
41
+ class?: any;
42
+ style?: any;
43
+ onClick?: (e: MouseEvent) => void;
44
+ onKeyDown?: (e: KeyboardEvent) => void;
45
+ children: Child | (() => Child);
46
+ [key: string]: any;
47
+ }
48
+ export declare function DropdownMenuTrigger(props: DropdownMenuTriggerProps): Child;
49
+ export interface DropdownMenuPortalProps {
50
+ mount?: HTMLElement | null;
51
+ children: Child | (() => Child);
52
+ }
53
+ export declare function DropdownMenuPortal(props: DropdownMenuPortalProps): Child;
54
+ export interface DropdownMenuContentProps {
55
+ as?: string;
56
+ portalled?: boolean;
57
+ mount?: HTMLElement | null;
58
+ class?: any;
59
+ style?: any;
60
+ onKeyDown?: (e: KeyboardEvent) => void;
61
+ children: Child | (() => Child);
62
+ [key: string]: any;
63
+ }
64
+ export declare function DropdownMenuContent(props: DropdownMenuContentProps): Child;
65
+ export interface DropdownMenuItemProps {
66
+ disabled?: boolean | (() => boolean);
67
+ closeOnSelect?: boolean;
68
+ as?: string;
69
+ class?: any;
70
+ style?: any;
71
+ onSelect?: (e: Event) => void;
72
+ onClick?: (e: MouseEvent) => void;
73
+ onKeyDown?: (e: KeyboardEvent) => void;
74
+ children: Child | (() => Child);
75
+ [key: string]: any;
76
+ }
77
+ export declare function DropdownMenuItem(props: DropdownMenuItemProps): Child;
78
+ export interface DropdownMenuSeparatorProps {
79
+ as?: string;
80
+ class?: any;
81
+ style?: any;
82
+ [key: string]: any;
83
+ }
84
+ export declare function DropdownMenuSeparator(props: DropdownMenuSeparatorProps): Child;
85
+ export declare const DropdownMenu: typeof DropdownMenuRoot & {
86
+ Root: typeof DropdownMenuRoot;
87
+ Trigger: typeof DropdownMenuTrigger;
88
+ Portal: typeof DropdownMenuPortal;
89
+ Content: typeof DropdownMenuContent;
90
+ Item: typeof DropdownMenuItem;
91
+ Separator: typeof DropdownMenuSeparator;
92
+ };
@@ -0,0 +1,18 @@
1
+ import type { Child } from "../dom/render";
2
+ export type IconNode = [string, Record<string, any>][];
3
+ export interface IconProps {
4
+ size?: number | string | (() => number | string);
5
+ color?: string | (() => string);
6
+ strokeWidth?: number | string | (() => number | string);
7
+ class?: any;
8
+ style?: any;
9
+ children?: Child | (() => Child);
10
+ [key: string]: any;
11
+ }
12
+ /**
13
+ * Creates a native Visage SVG component from a Lucide / SVG icon node definition
14
+ */
15
+ export declare function createIcon(name: string, iconNode: IconNode): {
16
+ (props?: IconProps): Child;
17
+ displayName: string;
18
+ };
@@ -0,0 +1,14 @@
1
+ export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, type AccordionMultipleProps, type AccordionProps, type AccordionSingleProps, AccordionTrigger, useAccordionContext, useAccordionItemContext } from "./accordion";
2
+ export { Command, CommandDialog, type CommandDialogProps, CommandEmpty, CommandGroup, type CommandGroupData, CommandInput, type CommandInputProps, CommandItem, type CommandItemData, type CommandItemProps, CommandList, type CommandProps, useCommandContext } from "./command";
3
+ export { type ColumnDef, DataTable, type DataTableProps, type SortDirection, type SortState } from "./data-table";
4
+ export { Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogOverlay, DialogPortal, type DialogProps, DialogTitle, DialogTrigger, useDialogContext } from "./dialog";
5
+ export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuPortal, type DropdownMenuProps, DropdownMenuSeparator, DropdownMenuTrigger, useDropdownMenuContext } from "./dropdown-menu";
6
+ export { createIcon, type IconNode, type IconProps } from "./icon";
7
+ export { type BaseLayoutProps, Center, type CenterProps, Grid, type GridProps, Row, type RowProps, Spacer, type SpacerProps, Stack, type StackProps } from "./layout";
8
+ export { Popover, PopoverClose, PopoverContent, type PopoverContentProps, PopoverPortal, type PopoverProps, PopoverTrigger, usePopoverContext } from "./popover";
9
+ export { Switch, type SwitchProps, SwitchThumb, type SwitchThumbProps } from "./switch";
10
+ export { Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, useTabsContext } from "./tabs";
11
+ export type { ToastData, ToastManager, ToastOptions, ToastProps, ToastVariant } from "./toast";
12
+ export { createToastManager, defaultToastManager, Toast, ToastClose, ToastDescription, ToastProvider, type ToastProviderProps, ToastTitle, ToastViewport, type ToastViewportProps, toast, useToast } from "./toast";
13
+ export { Tooltip, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipProps, TooltipTrigger, useTooltipContext } from "./tooltip";
14
+ export { createControllableSignal, createId, onClickOutside, trapFocus } from "./utils";
@@ -848,10 +848,12 @@ class Signal {
848
848
  _value;
849
849
  _subscribers = new Set;
850
850
  _equals;
851
+ _onSet;
851
852
  version = 0;
852
- constructor(initialValue, equals) {
853
+ constructor(initialValue, equals, onSet) {
853
854
  this._value = initialValue;
854
855
  this._equals = equals ?? Object.is;
856
+ this._onSet = onSet;
855
857
  }
856
858
  get() {
857
859
  if (currentSubscriber !== null && currentSubscriber.state !== 3 /* DISPOSED */) {
@@ -876,6 +878,9 @@ class Signal {
876
878
  }
877
879
  this._value = newValue;
878
880
  this.version++;
881
+ if (this._onSet) {
882
+ this._onSet(newValue);
883
+ }
879
884
  batch(() => {
880
885
  this.notify();
881
886
  });
@@ -901,11 +906,91 @@ class Signal {
901
906
  }
902
907
  }
903
908
  }
909
+ function resolveStorage(storageOption) {
910
+ if (storageOption && typeof storageOption === "object") {
911
+ return storageOption;
912
+ }
913
+ if (storageOption === "session") {
914
+ try {
915
+ if (typeof sessionStorage !== "undefined")
916
+ return sessionStorage;
917
+ } catch {}
918
+ try {
919
+ if (typeof window !== "undefined" && window.sessionStorage) {
920
+ return window.sessionStorage;
921
+ }
922
+ } catch {}
923
+ try {
924
+ if (typeof globalThis !== "undefined" && globalThis.sessionStorage) {
925
+ return globalThis.sessionStorage;
926
+ }
927
+ } catch {}
928
+ return null;
929
+ }
930
+ try {
931
+ if (typeof localStorage !== "undefined")
932
+ return localStorage;
933
+ } catch {}
934
+ try {
935
+ if (typeof window !== "undefined" && window.localStorage) {
936
+ return window.localStorage;
937
+ }
938
+ } catch {}
939
+ try {
940
+ if (typeof globalThis !== "undefined" && globalThis.localStorage) {
941
+ return globalThis.localStorage;
942
+ }
943
+ } catch {}
944
+ return null;
945
+ }
904
946
  function signal(initialValue, optionsOrEquals) {
905
947
  const equals = typeof optionsOrEquals === "function" ? optionsOrEquals : optionsOrEquals?.equals;
906
948
  const isInternal = typeof optionsOrEquals === "object" ? optionsOrEquals?.internal : false;
907
949
  const customName = typeof optionsOrEquals === "object" ? optionsOrEquals?.name : undefined;
908
- const s = new Signal(initialValue, equals);
950
+ const persistOption = typeof optionsOrEquals === "object" ? optionsOrEquals?.persist : undefined;
951
+ const persistConfig = persistOption ? typeof persistOption === "string" ? { key: persistOption } : persistOption : undefined;
952
+ let effectiveInitial = initialValue;
953
+ const storage = persistConfig ? resolveStorage(persistConfig.storage) : null;
954
+ const serialize = persistConfig?.serialize ?? JSON.stringify;
955
+ const deserialize = persistConfig?.deserialize ?? JSON.parse;
956
+ if (persistConfig && storage) {
957
+ try {
958
+ const stored = storage.getItem(persistConfig.key);
959
+ if (stored !== null) {
960
+ effectiveInitial = deserialize(stored);
961
+ }
962
+ } catch {}
963
+ }
964
+ let isSyncing = false;
965
+ const onSet = persistConfig && storage ? (val) => {
966
+ if (isSyncing)
967
+ return;
968
+ try {
969
+ storage.setItem(persistConfig.key, serialize(val));
970
+ } catch {}
971
+ } : undefined;
972
+ const s = new Signal(effectiveInitial, equals, onSet);
973
+ if (persistConfig && storage && (persistConfig.syncTabs ?? true) && typeof window !== "undefined" && typeof window.addEventListener === "function") {
974
+ const onStorage = (e) => {
975
+ if (e.key === persistConfig.key) {
976
+ try {
977
+ const nextVal = e.newValue !== null ? deserialize(e.newValue) : initialValue;
978
+ isSyncing = true;
979
+ try {
980
+ s.set(nextVal);
981
+ } finally {
982
+ isSyncing = false;
983
+ }
984
+ } catch {}
985
+ }
986
+ };
987
+ window.addEventListener("storage", onStorage);
988
+ if (currentScope) {
989
+ currentScope.addCleanup(() => {
990
+ window.removeEventListener("storage", onStorage);
991
+ });
992
+ }
993
+ }
909
994
  const accessor = (...args) => {
910
995
  if (args.length === 0) {
911
996
  return s.get();
@@ -0,0 +1 @@
1
+ export { type BaseLayoutProps, Center, type CenterProps, Grid, type GridProps, Row, type RowProps, Spacer, type SpacerProps, Stack, type StackProps } from "../style/layout";
@@ -0,0 +1,68 @@
1
+ import type { Child } from "../dom/render";
2
+ import { type ReadonlySignal } from "../signals";
3
+ export interface PopoverContextValue {
4
+ open: ReadonlySignal<boolean>;
5
+ setOpen: (open: boolean) => void;
6
+ triggerRef: {
7
+ current: HTMLElement | null;
8
+ };
9
+ contentRef: {
10
+ current: HTMLElement | null;
11
+ };
12
+ contentId: string;
13
+ }
14
+ export declare const PopoverContext: import("..").Context<PopoverContextValue | null>;
15
+ export declare function usePopoverContext(): PopoverContextValue | null;
16
+ export interface PopoverProps {
17
+ open?: () => boolean | undefined;
18
+ defaultOpen?: boolean;
19
+ onOpenChange?: (open: boolean) => void;
20
+ trigger?: Child | (() => Child);
21
+ content?: Child | (() => Child);
22
+ triggerClass?: any;
23
+ contentClass?: any;
24
+ portalled?: boolean;
25
+ children?: Child | (() => Child);
26
+ }
27
+ export declare function PopoverRoot(props: PopoverProps): Child;
28
+ export interface PopoverTriggerProps {
29
+ as?: string;
30
+ class?: any;
31
+ style?: any;
32
+ onClick?: (e: MouseEvent) => void;
33
+ children: Child | (() => Child);
34
+ [key: string]: any;
35
+ }
36
+ export declare function PopoverTrigger(props: PopoverTriggerProps): Child;
37
+ export interface PopoverPortalProps {
38
+ mount?: HTMLElement | null;
39
+ children: Child | (() => Child);
40
+ }
41
+ export declare function PopoverPortal(props: PopoverPortalProps): Child;
42
+ export interface PopoverContentProps {
43
+ as?: string;
44
+ portalled?: boolean;
45
+ mount?: HTMLElement | null;
46
+ class?: any;
47
+ style?: any;
48
+ onKeyDown?: (e: KeyboardEvent) => void;
49
+ children: Child | (() => Child);
50
+ [key: string]: any;
51
+ }
52
+ export declare function PopoverContent(props: PopoverContentProps): Child;
53
+ export interface PopoverCloseProps {
54
+ as?: string;
55
+ class?: any;
56
+ style?: any;
57
+ onClick?: (e: MouseEvent) => void;
58
+ children: Child | (() => Child);
59
+ [key: string]: any;
60
+ }
61
+ export declare function PopoverClose(props: PopoverCloseProps): Child;
62
+ export declare const Popover: typeof PopoverRoot & {
63
+ Root: typeof PopoverRoot;
64
+ Trigger: typeof PopoverTrigger;
65
+ Portal: typeof PopoverPortal;
66
+ Content: typeof PopoverContent;
67
+ Close: typeof PopoverClose;
68
+ };
@@ -0,0 +1,31 @@
1
+ import type { Child } from "../dom/render";
2
+ export interface SwitchProps {
3
+ checked?: () => boolean | undefined;
4
+ defaultChecked?: boolean;
5
+ onCheckedChange?: (checked: boolean) => void;
6
+ disabled?: boolean | (() => boolean);
7
+ required?: boolean;
8
+ name?: string;
9
+ value?: string;
10
+ thumbClass?: any;
11
+ thumbStyle?: any;
12
+ as?: string;
13
+ class?: any;
14
+ style?: any;
15
+ children?: Child | (() => Child);
16
+ onClick?: (e: MouseEvent) => void;
17
+ onKeyDown?: (e: KeyboardEvent) => void;
18
+ [key: string]: any;
19
+ }
20
+ export declare function SwitchRoot(props: SwitchProps): Child;
21
+ export interface SwitchThumbProps {
22
+ as?: string;
23
+ class?: any;
24
+ style?: any;
25
+ [key: string]: any;
26
+ }
27
+ export declare function SwitchThumb(props: SwitchThumbProps): Child;
28
+ export declare const Switch: typeof SwitchRoot & {
29
+ Root: typeof SwitchRoot;
30
+ Thumb: typeof SwitchThumb;
31
+ };