@visulima/dev-toolbar 1.0.0-alpha.2 → 1.0.0-alpha.4

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 (123) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +59 -42
  3. package/dist/apps/a11y/a11y-store.d.ts +12 -16
  4. package/dist/apps/a11y/a11y-tooltip.d.ts +1 -1
  5. package/dist/apps/a11y/index.js +2 -21
  6. package/dist/apps/inspector/index.d.ts +3 -0
  7. package/dist/apps/inspector/index.js +1 -0
  8. package/dist/apps/inspector/inspector-app.d.ts +12 -0
  9. package/dist/apps/module-graph/index.js +1 -20
  10. package/dist/apps/more/index.js +2 -19
  11. package/dist/apps/performance/index.js +1 -17
  12. package/dist/apps/seo/index.js +1 -17
  13. package/dist/apps/settings/index.js +1 -17
  14. package/dist/apps/settings/settings-app.d.ts +0 -1
  15. package/dist/apps/tailwind/index.d.ts +3 -0
  16. package/dist/apps/tailwind/index.js +7 -0
  17. package/dist/apps/tailwind/tailwind-app.d.ts +5 -0
  18. package/dist/apps/timeline/index.js +1 -18
  19. package/dist/apps/vite-config/index.js +1 -16
  20. package/dist/client/overlay.js +1 -1
  21. package/dist/hooks/create-hook.d.ts +7 -5
  22. package/dist/hooks/events.d.ts +4 -2
  23. package/dist/hooks/global-hook.d.ts +6 -6
  24. package/dist/index.d.ts +4 -2
  25. package/dist/index.js +1 -1
  26. package/dist/packem_chunks/inject-source.js +1 -0
  27. package/dist/packem_shared/Alert-H-x1JuZ0.js +1 -0
  28. package/dist/packem_shared/Badge-C30mDKKG.js +1 -0
  29. package/dist/packem_shared/Button-DODNCTPZ.js +1 -0
  30. package/dist/packem_shared/Card-DdI7Wn3t.js +1 -0
  31. package/dist/packem_shared/Icon-DWFLZkwW.js +1 -0
  32. package/dist/packem_shared/Input-GfbOwAkK.js +1 -0
  33. package/dist/packem_shared/Label-Bzi47aUf.js +1 -0
  34. package/dist/packem_shared/Popover-CLt7YhUF.js +1 -0
  35. package/dist/packem_shared/Progress-vGfFpxRn.js +1 -0
  36. package/dist/packem_shared/Separator-DQGeJPQg.js +1 -0
  37. package/dist/packem_shared/Skeleton-BYXau6jM.js +1 -0
  38. package/dist/packem_shared/Switch-BeC78S_T.js +1 -0
  39. package/dist/packem_shared/Tabs-CXERaeAp.js +1 -0
  40. package/dist/packem_shared/Textarea-DvbSX13V.js +1 -0
  41. package/dist/packem_shared/Tooltip-tlBN-NdK.js +1 -0
  42. package/dist/packem_shared/cn-DWLJYh3h.js +1 -0
  43. package/dist/packem_shared/createClientRPCContext-DgRxrllw.js +1 -0
  44. package/dist/packem_shared/createDevToolbarHook-4bZZiHPI.js +1 -0
  45. package/dist/packem_shared/createServerRPCContext-CEm1Ymkn.js +1 -0
  46. package/dist/packem_shared/getTimelineStore-B1cfjWV8.js +1 -0
  47. package/dist/packem_shared/{setupGlobalHook-CFuxsCyl.js → setupGlobalHook-CCf9Logv.js} +1 -1
  48. package/dist/packem_shared/sharedToolbarStylesheet-DOV-Jwcm.js +2 -0
  49. package/dist/packem_shared/store-DaUtLjf3.js +1 -0
  50. package/dist/packem_shared/use-theme-BOw3dPpY.js +1 -0
  51. package/dist/performance/monitor.d.ts +27 -26
  52. package/dist/rpc/client.d.ts +6 -4
  53. package/dist/rpc/functions/module-graph.d.ts +2 -2
  54. package/dist/rpc/functions/open-in-editor.d.ts +13 -6
  55. package/dist/rpc/functions/tailwind-config.d.ts +15 -0
  56. package/dist/rpc/functions/vite-config.d.ts +6 -4
  57. package/dist/rpc/server.d.ts +11 -5
  58. package/dist/timeline/capture.d.ts +8 -0
  59. package/dist/timeline/index.d.ts +3 -1
  60. package/dist/timeline/store.d.ts +12 -22
  61. package/dist/toolbar/app-manager.d.ts +49 -40
  62. package/dist/toolbar/components/app-button.d.ts +2 -2
  63. package/dist/toolbar/components/app-canvas.d.ts +1 -2
  64. package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -1
  65. package/dist/toolbar/components/first-visit-hint.d.ts +3 -3
  66. package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -1
  67. package/dist/toolbar/components/toolbar-bar.d.ts +0 -1
  68. package/dist/toolbar/components/toolbar-container.d.ts +1 -1
  69. package/dist/toolbar/components/vite-overlay-button.d.ts +2 -3
  70. package/dist/toolbar/context/index.d.ts +1 -1
  71. package/dist/toolbar/context/toolbar-context.d.ts +43 -42
  72. package/dist/toolbar/global-api.d.ts +4 -3
  73. package/dist/toolbar/helpers.d.ts +5 -3
  74. package/dist/toolbar/hooks/index.d.ts +4 -4
  75. package/dist/toolbar/hooks/use-apps.d.ts +5 -3
  76. package/dist/toolbar/hooks/use-frame-state.d.ts +22 -16
  77. package/dist/toolbar/hooks/use-panel-visible.d.ts +9 -7
  78. package/dist/toolbar/hooks/use-position.d.ts +7 -5
  79. package/dist/toolbar/hooks/use-theme.d.ts +6 -4
  80. package/dist/toolbar/hooks/use-toolbar.d.ts +4 -2
  81. package/dist/toolbar/index.d.ts +9 -16
  82. package/dist/toolbar/index.js +3 -4
  83. package/dist/toolbar/settings.d.ts +7 -7
  84. package/dist/toolbar/stylesheet.d.ts +3 -1
  85. package/dist/toolbar/utils/index.d.ts +3 -3
  86. package/dist/types/app.d.ts +26 -14
  87. package/dist/types/global-api.d.ts +27 -31
  88. package/dist/types/hooks.d.ts +32 -34
  89. package/dist/types/messaging.d.ts +2 -2
  90. package/dist/types/rpc.d.ts +8 -6
  91. package/dist/types/timeline.d.ts +3 -3
  92. package/dist/types/toolbar.d.ts +1 -1
  93. package/dist/ui/components/alert.d.ts +20 -0
  94. package/dist/ui/components/badge.d.ts +10 -0
  95. package/dist/ui/components/button.d.ts +12 -0
  96. package/dist/ui/components/card.d.ts +17 -0
  97. package/dist/ui/components/icon.d.ts +5 -6
  98. package/dist/ui/components/input.d.ts +8 -0
  99. package/dist/ui/components/label.d.ts +8 -0
  100. package/dist/ui/components/popover.d.ts +27 -0
  101. package/dist/ui/components/progress.d.ts +8 -0
  102. package/dist/ui/components/separator.d.ts +9 -0
  103. package/dist/ui/components/skeleton.d.ts +7 -0
  104. package/dist/ui/components/switch.d.ts +12 -0
  105. package/dist/ui/components/tabs.d.ts +29 -0
  106. package/dist/ui/components/textarea.d.ts +8 -0
  107. package/dist/ui/components/tooltip.d.ts +19 -0
  108. package/dist/ui/index.d.ts +17 -0
  109. package/dist/ui/index.js +1 -0
  110. package/dist/utils/cn.d.ts +3 -3
  111. package/dist/vite/inject-source.d.ts +24 -0
  112. package/dist/vite/matcher.d.ts +6 -0
  113. package/dist/vite-plugin.d.ts +43 -5
  114. package/dist/vite-plugin.js +2 -2
  115. package/package.json +23 -5
  116. package/dist/packem_shared/TimelineStore-BgBrirKd.js +0 -1
  117. package/dist/packem_shared/cn-BEsR6GkP.js +0 -1
  118. package/dist/packem_shared/createClientRPCContext-DzKQpKTk.js +0 -1
  119. package/dist/packem_shared/createDevToolbarHook-DGNxqk8N.js +0 -1
  120. package/dist/packem_shared/createServerRPCContext-BVSesPXu.js +0 -1
  121. package/dist/packem_shared/icon-BUQ92HaT.js +0 -1
  122. package/dist/packem_shared/store-BxE0w51s.js +0 -1
  123. package/dist/rpc/index.d.ts +0 -8
@@ -73,11 +73,10 @@ export interface DevToolbarApp {
73
73
  */
74
74
  beforeTogglingOff?: (canvas: ShadowRoot) => boolean | Promise<boolean>;
75
75
  /**
76
- * Called when the app is unregistered / removed from the toolbar.
77
- * Use this for final cleanup (event listeners, timers, subscriptions).
78
- * @param canvas Shadow root of the app
76
+ * Preact component for rendering (alternative to init)
77
+ * If provided, this will be used instead of init
79
78
  */
80
- destroy?: (canvas: ShadowRoot) => Promise<void> | void;
79
+ component?: ComponentType<AppComponentProps>;
81
80
  /**
82
81
  * When true, this app is automatically activated when the toolbar opens for
83
82
  * the first time (or when no other app has been activated yet).
@@ -86,17 +85,11 @@ export interface DevToolbarApp {
86
85
  */
87
86
  defaultOpen?: boolean;
88
87
  /**
89
- * Preact component for rendering (alternative to init)
90
- * If provided, this will be used instead of init
91
- */
92
- component?: ComponentType<AppComponentProps>;
93
- /**
94
- * Optional hover tooltip component — renders a compact live preview when the
95
- * user hovers over this app's button in the toolbar pill.
96
- * The component should be small (≤280px wide) and self-contained.
97
- * If omitted, hovering shows the native title tooltip only.
88
+ * Called when the app is unregistered / removed from the toolbar.
89
+ * Use this for final cleanup (event listeners, timers, subscriptions).
90
+ * @param canvas Shadow root of the app
98
91
  */
99
- tooltip?: ComponentType<AppTooltipProps>;
92
+ destroy?: (canvas: ShadowRoot) => Promise<void> | void;
100
93
  /**
101
94
  * Icon HTML string (SVG)
102
95
  */
@@ -116,6 +109,25 @@ export interface DevToolbarApp {
116
109
  * Display name of the app
117
110
  */
118
111
  name: string;
112
+ /**
113
+ * Action button callback — called when the button is activated (active: false → true).
114
+ * When present, clicking the toolbar button will NOT open a panel.
115
+ * Instead the button toggles its active state and calls onClick (activate)
116
+ * or onDeactivate (deactivate).
117
+ */
118
+ onClick?: () => Promise<void> | void;
119
+ /**
120
+ * Called when the action button is deactivated (active: true → false).
121
+ * Only meaningful when onClick is also provided.
122
+ */
123
+ onDeactivate?: () => Promise<void> | void;
124
+ /**
125
+ * Optional hover tooltip component — renders a compact live preview when the
126
+ * user hovers over this app's button in the toolbar pill.
127
+ * The component should be small (≤280px wide) and self-contained.
128
+ * If omitted, hovering shows the native title tooltip only.
129
+ */
130
+ tooltip?: ComponentType<AppTooltipProps>;
119
131
  /**
120
132
  * App rendering mode
121
133
  */
@@ -1,84 +1,79 @@
1
1
  import type { DevToolbarApp } from "./app.d.ts";
2
- import type { ToolbarSettings } from "./toolbar.d.ts";
3
2
  import type { DevToolbarHook } from "./hooks.d.ts";
4
3
  import type { ServerFunctions } from "./rpc.d.ts";
4
+ import type { ToolbarSettings } from "./toolbar.d.ts";
5
5
  /**
6
- * Global DevTools API interface
6
+ * Global DevTools API interface.
7
7
  * Exposed as window.__VISULIMA_DEVTOOLS__
8
8
  */
9
- export interface VisulimaDevTools {
9
+ interface VisulimaDevTools {
10
10
  /**
11
- * Clear notification for an app
12
- * @param appId App ID
11
+ * Clears notification for an app.
13
12
  */
14
13
  clearNotification: (appId: string) => void;
15
14
  /**
16
- * Close the currently active app
15
+ * Closes the currently active app.
17
16
  */
18
17
  closeApp: () => Promise<void>;
19
18
  /**
20
- * Get the currently active app ID
21
- * @returns Active app ID or null
19
+ * Gets the currently active app ID.
22
20
  */
23
- getActiveApp: () => string | null;
21
+ getActiveApp: () => string | undefined;
24
22
  /**
25
- * Get all registered apps
26
- * @returns Array of app definitions
23
+ * Gets all registered apps.
27
24
  */
28
25
  getApps: () => DevToolbarApp[];
29
26
  /**
30
- * Get current toolbar settings
31
- * @returns Toolbar settings
27
+ * Gets current toolbar settings.
32
28
  */
33
29
  getSettings: () => ToolbarSettings;
34
30
  /**
35
- * Hide the toolbar
31
+ * Hides the toolbar.
36
32
  */
37
33
  hide: () => void;
38
34
  /**
39
- * Hook instance for event subscriptions
35
+ * Hook instance for event subscriptions.
40
36
  */
41
37
  hook: DevToolbarHook;
42
38
  /**
43
- * Show a notification for an app
44
- * @param appId App ID
45
- * @param level Notification level
39
+ * Shows a notification for an app.
46
40
  */
47
41
  notify: (appId: string, level: "info" | "warning" | "error") => void;
48
42
  /**
49
- * Open an app
50
- * @param appId App ID to open
43
+ * Opens an app by ID.
51
44
  */
52
45
  openApp: (appId: string) => Promise<void>;
53
46
  /**
54
- * Register a custom app
55
- * @param app App definition
47
+ * Registers a custom app.
56
48
  */
57
49
  registerApp: (app: DevToolbarApp) => void;
58
50
  /**
59
- * RPC client for calling server functions
51
+ * RPC client for calling server functions.
60
52
  */
61
53
  rpc: ServerFunctions;
62
54
  /**
63
- * Show the toolbar
55
+ * Directly sets the active state of an action button without invoking callbacks.
56
+ * Useful for deactivating a button from async work running outside the toolbar.
57
+ */
58
+ setAppActive: (appId: string, active: boolean) => void;
59
+ /**
60
+ * Shows the toolbar.
64
61
  */
65
62
  show: () => void;
66
63
  /**
67
- * Toggle toolbar visibility
64
+ * Toggles toolbar visibility.
68
65
  */
69
66
  toggle: () => void;
70
67
  /**
71
- * Unregister an app
72
- * @param appId App ID to unregister
68
+ * Unregisters an app by ID.
73
69
  */
74
70
  unregisterApp: (appId: string) => void;
75
71
  /**
76
- * Update toolbar settings
77
- * @param settings Partial settings to update
72
+ * Updates toolbar settings.
78
73
  */
79
74
  updateSettings: (settings: Partial<ToolbarSettings>) => void;
80
75
  /**
81
- * Package version
76
+ * Package version.
82
77
  */
83
78
  version: string;
84
79
  }
@@ -88,8 +83,9 @@ export interface VisulimaDevTools {
88
83
  declare global {
89
84
  interface Window {
90
85
  /**
91
- * Visulima DevTools global API
86
+ * Visulima DevTools global API.
92
87
  */
93
88
  __VISULIMA_DEVTOOLS__?: VisulimaDevTools;
94
89
  }
95
90
  }
91
+ export type { VisulimaDevTools };
@@ -3,75 +3,72 @@ import type { TimelineEvent } from "./timeline.d.ts";
3
3
  /**
4
4
  * Hook event definitions
5
5
  */
6
- export interface HookEvents {
7
- /**
8
- * Extension point for custom events
9
- */
6
+ interface HookEvents {
10
7
  [key: string]: (...args: any[]) => void;
11
8
  /**
12
- * App error occurred
13
- * @param error Error object
14
- * @param appId Optional app ID where error occurred
9
+ * App error occurred.
10
+ * @param error Error object.
11
+ * @param appId Optional app ID where error occurred.
15
12
  */
16
13
  "app:error": (error: Error, appId?: string) => void;
17
14
  /**
18
- * DevTools closed
15
+ * DevTools closed.
19
16
  */
20
17
  "devtools:close": () => void;
21
18
  /**
22
- * DevTools initialized
19
+ * DevTools initialized.
23
20
  */
24
21
  "devtools:init": () => void;
25
22
  /**
26
- * DevTools opened
27
- * @param appId ID of the opened app
23
+ * DevTools opened.
24
+ * @param appId ID of the opened app.
28
25
  */
29
26
  "devtools:open": (appId: string) => void;
30
27
  /**
31
- * Timeline event added
32
- * @param event Timeline event
28
+ * Timeline event added.
29
+ * @param event Timeline event.
33
30
  */
34
31
  "timeline:event": (event: TimelineEvent) => void;
35
32
  }
36
33
  /**
37
- * Dev toolbar hook interface
34
+ * Dev toolbar hook interface.
38
35
  * Exposed as window.__DEV_TOOLBAR_HOOK__
39
36
  */
40
- export interface DevToolbarHook {
37
+ interface DevToolbarHook {
41
38
  /**
42
- * Add a timeline event
43
- * @param groupId Timeline group ID
44
- * @param event Timeline event
39
+ * Adds a timeline event.
40
+ * @param groupId Timeline group ID.
41
+ * @param event Timeline event.
45
42
  */
46
43
  addTimelineEvent: (groupId: string, event: TimelineEvent) => void;
47
44
  /**
48
- * Emit an event
49
- * @param event Event name
50
- * @param args Event arguments
45
+ * Emits an event.
46
+ * @param event Event name.
47
+ * @param args Event arguments.
51
48
  */
52
49
  emit: <T extends keyof HookEvents>(event: T, ...args: Parameters<HookEvents[T]>) => void;
53
50
  /**
54
- * Unsubscribe from an event
55
- * @param event Event name
56
- * @param handler Optional specific handler to remove
51
+ * Unsubscribes from an event.
52
+ * @param event Event name.
53
+ * @param handler Optional specific handler to remove.
57
54
  */
58
55
  off: <T extends keyof HookEvents>(event: T, handler?: HookEvents[T]) => void;
59
56
  /**
60
- * Subscribe to an event
61
- * @param event Event name
62
- * @param handler Event handler
63
- * @returns Unsubscribe function
57
+ * Subscribes to an event.
58
+ * @param event Event name.
59
+ * @param handler Event handler.
60
+ * @returns Unsubscribe function.
64
61
  */
65
62
  on: <T extends keyof HookEvents>(event: T, handler: HookEvents[T]) => () => void;
66
63
  /**
67
- * Subscribe to an event once
68
- * @param event Event name
69
- * @param handler Event handler
64
+ * Subscribes to an event once.
65
+ * @param event Event name.
66
+ * @param handler Event handler.
70
67
  */
71
68
  once: <T extends keyof HookEvents>(event: T, handler: HookEvents[T]) => void;
72
69
  /**
73
- * Register a custom app
74
- * @param app App definition
70
+ * Registers a custom app.
71
+ * @param app App definition.
75
72
  */
76
73
  registerApp: (app: DevToolbarApp) => void;
77
74
  }
@@ -81,8 +78,9 @@ export interface DevToolbarHook {
81
78
  declare global {
82
79
  interface Window {
83
80
  /**
84
- * Dev toolbar hook for library integrations
81
+ * Dev toolbar hook for library integrations.
85
82
  */
86
83
  __DEV_TOOLBAR_HOOK__?: DevToolbarHook;
87
84
  }
88
85
  }
86
+ export type { DevToolbarHook, HookEvents };
@@ -33,11 +33,11 @@ export interface MessageChannel<TEvents extends Record<string, (...args: any[])
33
33
  */
34
34
  export type ChannelFactory<TEvents extends Record<string, (...args: any[]) => void>> = () => MessageChannel<TEvents>;
35
35
  /**
36
- * Message channel context
36
+ * Factory result providing a method to instantiate named message channels.
37
37
  */
38
38
  export interface MessageChannelContext<TEvents extends Record<string, (...args: any[]) => void>> {
39
39
  /**
40
- * Create a new channel instance
40
+ * Creates and returns a new channel instance.
41
41
  */
42
42
  createChannel: () => MessageChannel<TEvents>;
43
43
  }
@@ -1,5 +1,6 @@
1
1
  import type { ViteDevServer } from "vite";
2
2
  import type { SerializableModuleNode } from "../rpc/functions/module-graph.d.ts";
3
+ import type { TailwindConfigResult } from "../rpc/functions/tailwind-config.d.ts";
3
4
  /**
4
5
  * Server-side RPC functions
5
6
  * These can be called from the client
@@ -13,6 +14,10 @@ export interface ServerFunctions {
13
14
  * Get module dependency graph
14
15
  */
15
16
  getModuleGraph: () => Promise<SerializableModuleNode[]>;
17
+ /**
18
+ * Get full Tailwind CSS theme (default + user overrides)
19
+ */
20
+ getTailwindConfig: () => Promise<TailwindConfigResult>;
16
21
  /**
17
22
  * Get Vite configuration
18
23
  */
@@ -35,20 +40,17 @@ export interface ServerFunctions {
35
40
  * These can be called from the server
36
41
  */
37
42
  export interface ClientFunctions {
38
- /**
39
- * Extension point for custom client functions
40
- */
41
43
  [key: string]: (...args: any[]) => void;
42
44
  /**
43
45
  * Notify client of config change
44
46
  * @param config New Vite config
45
47
  */
46
- onConfigChange: (config: Record<string, any>) => void;
48
+ onConfigChange: (config: Record<string, unknown>) => void;
47
49
  /**
48
50
  * Notify client of HMR update
49
51
  * @param payload HMR payload
50
52
  */
51
- onHMRUpdate: (payload: any) => void;
53
+ onHMRUpdate: (payload: unknown) => void;
52
54
  /**
53
55
  * Notify client of module update
54
56
  * @param module Updated module node
@@ -89,7 +91,7 @@ export interface ClientRPCContext {
89
91
  /**
90
92
  * Register a client function
91
93
  * @param name Function name
92
- * @param fn Function implementation
94
+ * @param function_ Function implementation
93
95
  */
94
96
  registerFunction: <K extends keyof ClientFunctions>(name: K, function_: ClientFunctions[K]) => void;
95
97
  }
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Timeline event level
2
+ * Severity levels for timeline events.
3
3
  */
4
4
  export type TimelineEventLevel = "info" | "warning" | "error";
5
5
  /**
6
- * Timeline event
6
+ * A single captured event displayed in the timeline panel.
7
7
  */
8
8
  export interface TimelineEvent {
9
9
  /**
@@ -36,7 +36,7 @@ export interface TimelineEvent {
36
36
  title: string;
37
37
  }
38
38
  /**
39
- * Timeline group
39
+ * A named group that holds related timeline events.
40
40
  */
41
41
  export interface TimelineGroup {
42
42
  /**
@@ -34,7 +34,7 @@ export interface FrameState {
34
34
  top: number;
35
35
  }
36
36
  /**
37
- * Toolbar settings
37
+ * Configuration options controlling the toolbar's initial appearance.
38
38
  */
39
39
  export interface ToolbarSettings {
40
40
  /**
@@ -0,0 +1,20 @@
1
+ /** @jsxImportSource preact */
2
+ import type { ComponentChildren, JSX } from "preact";
3
+ type AlertVariant = "default" | "destructive" | "info" | "success" | "warning";
4
+ interface AlertProps extends JSX.HTMLAttributes<HTMLDivElement> {
5
+ children?: ComponentChildren;
6
+ class?: string;
7
+ variant?: AlertVariant;
8
+ }
9
+ interface AlertTitleProps extends JSX.HTMLAttributes<HTMLHeadingElement> {
10
+ children?: ComponentChildren;
11
+ class?: string;
12
+ }
13
+ interface AlertDescriptionProps extends JSX.HTMLAttributes<HTMLDivElement> {
14
+ children?: ComponentChildren;
15
+ class?: string;
16
+ }
17
+ declare const Alert: ({ children, class: className, variant, ...rest }: AlertProps) => JSX.Element;
18
+ declare const AlertTitle: ({ children, class: className, ...rest }: AlertTitleProps) => JSX.Element;
19
+ declare const AlertDescription: ({ children, class: className, ...rest }: AlertDescriptionProps) => JSX.Element;
20
+ export { Alert, AlertDescription, AlertTitle };
@@ -0,0 +1,10 @@
1
+ /** @jsxImportSource preact */
2
+ import type { ComponentChildren, JSX } from "preact";
3
+ type BadgeVariant = "default" | "destructive" | "info" | "outline" | "secondary" | "success" | "warning";
4
+ interface BadgeProps extends JSX.HTMLAttributes<HTMLDivElement> {
5
+ children?: ComponentChildren;
6
+ class?: string;
7
+ variant?: BadgeVariant;
8
+ }
9
+ declare const Badge: ({ children, class: className, variant, ...rest }: BadgeProps) => JSX.Element;
10
+ export default Badge;
@@ -0,0 +1,12 @@
1
+ /** @jsxImportSource preact */
2
+ import type { ComponentChildren, JSX } from "preact";
3
+ type ButtonSize = "default" | "icon" | "lg" | "sm";
4
+ type ButtonVariant = "default" | "destructive" | "ghost" | "link" | "outline" | "secondary";
5
+ interface ButtonProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
6
+ children?: ComponentChildren;
7
+ class?: string;
8
+ size?: ButtonSize;
9
+ variant?: ButtonVariant;
10
+ }
11
+ declare const Button: ({ children, class: className, size, type, variant, ...rest }: ButtonProps) => JSX.Element;
12
+ export default Button;
@@ -0,0 +1,17 @@
1
+ /** @jsxImportSource preact */
2
+ import type { ComponentChildren, JSX } from "preact";
3
+ interface CardProps extends JSX.HTMLAttributes<HTMLDivElement> {
4
+ children?: ComponentChildren;
5
+ class?: string;
6
+ }
7
+ interface CardTitleProps extends JSX.HTMLAttributes<HTMLHeadingElement> {
8
+ children?: ComponentChildren;
9
+ class?: string;
10
+ }
11
+ declare const Card: ({ children, class: className, ...rest }: CardProps) => JSX.Element;
12
+ declare const CardHeader: ({ children, class: className, ...rest }: CardProps) => JSX.Element;
13
+ declare const CardTitle: ({ children, class: className, ...rest }: CardTitleProps) => JSX.Element;
14
+ declare const CardDescription: ({ children, class: className, ...rest }: CardProps) => JSX.Element;
15
+ declare const CardContent: ({ children, class: className, ...rest }: CardProps) => JSX.Element;
16
+ declare const CardFooter: ({ children, class: className, ...rest }: CardProps) => JSX.Element;
17
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -4,7 +4,7 @@ interface IconProps {
4
4
  class?: string;
5
5
  size?: number;
6
6
  /**
7
- * CSS data-URI from a `?data-uri&encoding=css` lucide-static import.
7
+ * CSS data-URI from a `?data-uri&amp;encoding=css` lucide-static import.
8
8
  * Uses CSS mask-image so the icon inherits currentColor from the parent.
9
9
  */
10
10
  src: string;
@@ -12,10 +12,9 @@ interface IconProps {
12
12
  /**
13
13
  * Renders a lucide-static icon using CSS mask-image.
14
14
  * Color is driven by the parent element's `color` property (currentColor).
15
- *
16
- * Usage:
17
- * import xIcon from "lucide-static/icons/x.d.ts";
18
- * <Icon src={xIcon} size={13} />
15
+ * @example
16
+ * import xIcon from "lucide-static/icons/x.d.ts";
17
+ * &lt;Icon src={xIcon} size={13} />
19
18
  */
20
- declare const Icon: ({ src, size, class: className }: IconProps) => ComponentChildren;
19
+ declare const Icon: ({ class: className, size, src }: IconProps) => ComponentChildren;
21
20
  export default Icon;
@@ -0,0 +1,8 @@
1
+ /** @jsxImportSource preact */
2
+ import type { JSX } from "preact";
3
+ import type { ForwardRefExoticComponent, RefAttributes } from "preact/compat";
4
+ interface InputProps extends JSX.InputHTMLAttributes<HTMLInputElement> {
5
+ class?: string;
6
+ }
7
+ declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
8
+ export default Input;
@@ -0,0 +1,8 @@
1
+ /** @jsxImportSource preact */
2
+ import type { ComponentChildren, JSX } from "preact";
3
+ interface LabelProps extends JSX.LabelHTMLAttributes<HTMLLabelElement> {
4
+ children?: ComponentChildren;
5
+ class?: string;
6
+ }
7
+ declare const Label: ({ children, class: className, ...rest }: LabelProps) => JSX.Element;
8
+ export default Label;
@@ -0,0 +1,27 @@
1
+ import type { ComponentChildren, JSX } from "preact";
2
+ interface PopoverProps {
3
+ children: ComponentChildren;
4
+ defaultOpen?: boolean;
5
+ onOpenChange?: (open: boolean) => void;
6
+ open?: boolean;
7
+ }
8
+ interface PopoverTriggerProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
9
+ children: ComponentChildren;
10
+ class?: string;
11
+ }
12
+ interface PopoverContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
13
+ align?: "center" | "end" | "start";
14
+ children: ComponentChildren;
15
+ class?: string;
16
+ side?: "bottom" | "left" | "right" | "top";
17
+ sideOffset?: number;
18
+ }
19
+ interface PopoverCloseProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
20
+ children?: ComponentChildren;
21
+ class?: string;
22
+ }
23
+ declare const Popover: ({ children, defaultOpen, onOpenChange, open }: PopoverProps) => JSX.Element;
24
+ declare const PopoverTrigger: ({ children, class: className, ...rest }: PopoverTriggerProps) => JSX.Element;
25
+ declare const PopoverContent: ({ align, children, class: className, side, sideOffset, ...rest }: PopoverContentProps) => JSX.Element | undefined;
26
+ declare const PopoverClose: ({ children, class: className, ...rest }: PopoverCloseProps) => JSX.Element;
27
+ export { Popover, PopoverClose, PopoverContent, PopoverTrigger };
@@ -0,0 +1,8 @@
1
+ /** @jsxImportSource preact */
2
+ import type { JSX } from "preact";
3
+ interface ProgressProps extends JSX.HTMLAttributes<HTMLDivElement> {
4
+ class?: string;
5
+ value?: number;
6
+ }
7
+ declare const Progress: ({ class: className, value, ...rest }: ProgressProps) => JSX.Element;
8
+ export default Progress;
@@ -0,0 +1,9 @@
1
+ /** @jsxImportSource preact */
2
+ import type { JSX } from "preact";
3
+ interface SeparatorProps extends JSX.HTMLAttributes<HTMLDivElement> {
4
+ class?: string;
5
+ decorative?: boolean;
6
+ orientation?: "horizontal" | "vertical";
7
+ }
8
+ declare const Separator: ({ class: className, decorative, orientation, ...rest }: SeparatorProps) => JSX.Element;
9
+ export default Separator;
@@ -0,0 +1,7 @@
1
+ /** @jsxImportSource preact */
2
+ import type { JSX } from "preact";
3
+ interface SkeletonProps extends JSX.HTMLAttributes<HTMLDivElement> {
4
+ class?: string;
5
+ }
6
+ declare const Skeleton: ({ class: className, ...rest }: SkeletonProps) => JSX.Element;
7
+ export default Skeleton;
@@ -0,0 +1,12 @@
1
+ /** @jsxImportSource preact */
2
+ import type { JSX } from "preact";
3
+ interface SwitchProps extends Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> {
4
+ checked?: boolean;
5
+ class?: string;
6
+ defaultChecked?: boolean;
7
+ disabled?: boolean;
8
+ id?: string;
9
+ onCheckedChange?: (checked: boolean) => void;
10
+ }
11
+ declare const Switch: ({ checked, class: className, defaultChecked, disabled, id, onCheckedChange, ...rest }: SwitchProps) => JSX.Element;
12
+ export default Switch;
@@ -0,0 +1,29 @@
1
+ /** @jsxImportSource preact */
2
+ import type { ComponentChildren, JSX } from "preact";
3
+ interface TabsProps extends JSX.HTMLAttributes<HTMLDivElement> {
4
+ children?: ComponentChildren;
5
+ class?: string;
6
+ defaultValue?: string;
7
+ onValueChange?: (value: string) => void;
8
+ value?: string;
9
+ }
10
+ interface TabsListProps extends JSX.HTMLAttributes<HTMLDivElement> {
11
+ children?: ComponentChildren;
12
+ class?: string;
13
+ }
14
+ interface TabsTriggerProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
15
+ children?: ComponentChildren;
16
+ class?: string;
17
+ disabled?: boolean;
18
+ value: string;
19
+ }
20
+ interface TabsContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
21
+ children?: ComponentChildren;
22
+ class?: string;
23
+ value: string;
24
+ }
25
+ declare const Tabs: ({ children, class: className, defaultValue, onValueChange, value, ...rest }: TabsProps) => JSX.Element;
26
+ declare const TabsList: ({ children, class: className, ...rest }: TabsListProps) => JSX.Element;
27
+ declare const TabsTrigger: ({ children, class: className, disabled, value, ...rest }: TabsTriggerProps) => JSX.Element;
28
+ declare const TabsContent: ({ children, class: className, value, ...rest }: TabsContentProps) => JSX.Element | undefined;
29
+ export { Tabs, TabsContent, TabsList, TabsTrigger };
@@ -0,0 +1,8 @@
1
+ /** @jsxImportSource preact */
2
+ import type { JSX } from "preact";
3
+ import type { ForwardRefExoticComponent, RefAttributes } from "preact/compat";
4
+ interface TextareaProps extends JSX.TextareaHTMLAttributes<HTMLTextAreaElement> {
5
+ class?: string;
6
+ }
7
+ declare const Textarea: ForwardRefExoticComponent<RefAttributes<HTMLTextAreaElement> & TextareaProps>;
8
+ export default Textarea;
@@ -0,0 +1,19 @@
1
+ import type { ComponentChildren, JSX } from "preact";
2
+ interface TooltipProps {
3
+ children: ComponentChildren;
4
+ delayDuration?: number;
5
+ }
6
+ interface TooltipTriggerProps extends JSX.HTMLAttributes<HTMLSpanElement> {
7
+ children: ComponentChildren;
8
+ class?: string;
9
+ }
10
+ interface TooltipContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
11
+ children: ComponentChildren;
12
+ class?: string;
13
+ side?: "bottom" | "left" | "right" | "top";
14
+ sideOffset?: number;
15
+ }
16
+ declare const Tooltip: ({ children, delayDuration: _delayDuration }: TooltipProps) => JSX.Element;
17
+ declare const TooltipTrigger: ({ children, class: className, ...rest }: TooltipTriggerProps) => JSX.Element;
18
+ declare const TooltipContent: ({ children, class: className, side, sideOffset, ...rest }: TooltipContentProps) => JSX.Element | undefined;
19
+ export { Tooltip, TooltipContent, TooltipTrigger };
@@ -0,0 +1,17 @@
1
+ export { default as cn } from "../utils/cn.d.ts";
2
+ export { Alert, AlertDescription, AlertTitle } from "./components/alert.d.ts";
3
+ export { default as Badge } from "./components/badge.d.ts";
4
+ export { default as Button } from "./components/button.d.ts";
5
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/card.d.ts";
6
+ export { default as Icon } from "./components/icon.d.ts";
7
+ export { default as Input } from "./components/input.d.ts";
8
+ export { default as Label } from "./components/label.d.ts";
9
+ export { Popover, PopoverClose, PopoverContent, PopoverTrigger } from "./components/popover.d.ts";
10
+ export { default as Progress } from "./components/progress.d.ts";
11
+ export { default as Separator } from "./components/separator.d.ts";
12
+ export { default as Skeleton } from "./components/skeleton.d.ts";
13
+ export { default as Switch } from "./components/switch.d.ts";
14
+ export { Tabs, TabsContent, TabsList, TabsTrigger } from "./components/tabs.d.ts";
15
+ export { default as Textarea } from "./components/textarea.d.ts";
16
+ export { Tooltip, TooltipContent, TooltipTrigger } from "./components/tooltip.d.ts";
17
+ export { clsx } from "clsx";