@moldable-ai/ui 0.2.5 → 0.2.7

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 (100) hide show
  1. package/LICENSE +75 -71
  2. package/dist/components/chat/chat-input.d.ts +15 -3
  3. package/dist/components/chat/chat-input.d.ts.map +1 -1
  4. package/dist/components/chat/chat-input.js +19 -8
  5. package/dist/components/chat/chat-message.d.ts +6 -0
  6. package/dist/components/chat/chat-message.d.ts.map +1 -1
  7. package/dist/components/chat/chat-message.js +20 -5
  8. package/dist/components/chat/chat-messages.d.ts +26 -1
  9. package/dist/components/chat/chat-messages.d.ts.map +1 -1
  10. package/dist/components/chat/chat-messages.js +33 -22
  11. package/dist/components/chat/chat-panel.d.ts +40 -3
  12. package/dist/components/chat/chat-panel.d.ts.map +1 -1
  13. package/dist/components/chat/chat-panel.js +173 -36
  14. package/dist/components/chat/checkpoint-badge.d.ts +20 -0
  15. package/dist/components/chat/checkpoint-badge.d.ts.map +1 -0
  16. package/dist/components/chat/checkpoint-badge.js +16 -0
  17. package/dist/components/chat/conversation-history.d.ts +6 -1
  18. package/dist/components/chat/conversation-history.d.ts.map +1 -1
  19. package/dist/components/chat/conversation-history.js +6 -6
  20. package/dist/components/chat/index.d.ts +5 -3
  21. package/dist/components/chat/index.d.ts.map +1 -1
  22. package/dist/components/chat/index.js +3 -1
  23. package/dist/components/chat/markdown.d.ts +9 -0
  24. package/dist/components/chat/markdown.d.ts.map +1 -0
  25. package/dist/components/chat/markdown.js +47 -0
  26. package/dist/components/chat/model-selector.d.ts +3 -1
  27. package/dist/components/chat/model-selector.d.ts.map +1 -1
  28. package/dist/components/chat/model-selector.js +2 -2
  29. package/dist/components/chat/reasoning-effort-selector.d.ts +4 -1
  30. package/dist/components/chat/reasoning-effort-selector.d.ts.map +1 -1
  31. package/dist/components/chat/reasoning-effort-selector.js +6 -6
  32. package/dist/components/chat/restore-dialog.d.ts +33 -0
  33. package/dist/components/chat/restore-dialog.d.ts.map +1 -0
  34. package/dist/components/chat/restore-dialog.js +23 -0
  35. package/dist/components/chat/tool-handlers.d.ts.map +1 -1
  36. package/dist/components/chat/tool-handlers.js +194 -2
  37. package/dist/components/ui/alert-dialog.d.ts +8 -4
  38. package/dist/components/ui/alert-dialog.d.ts.map +1 -1
  39. package/dist/components/ui/alert-dialog.js +14 -11
  40. package/dist/components/ui/avatar.d.ts +7 -2
  41. package/dist/components/ui/avatar.d.ts.map +1 -1
  42. package/dist/components/ui/avatar.js +13 -4
  43. package/dist/components/ui/badge.d.ts +1 -1
  44. package/dist/components/ui/badge.d.ts.map +1 -1
  45. package/dist/components/ui/badge.js +9 -7
  46. package/dist/components/ui/button.d.ts +3 -4
  47. package/dist/components/ui/button.d.ts.map +1 -1
  48. package/dist/components/ui/button.js +6 -6
  49. package/dist/components/ui/card.d.ts +8 -7
  50. package/dist/components/ui/card.d.ts.map +1 -1
  51. package/dist/components/ui/card.js +22 -14
  52. package/dist/components/ui/checkbox.js +1 -1
  53. package/dist/components/ui/collapsible.d.ts +3 -3
  54. package/dist/components/ui/collapsible.d.ts.map +1 -1
  55. package/dist/components/ui/collapsible.js +11 -3
  56. package/dist/components/ui/combobox.d.ts +25 -0
  57. package/dist/components/ui/combobox.d.ts.map +1 -0
  58. package/dist/components/ui/combobox.js +58 -0
  59. package/dist/components/ui/command.d.ts +15 -15
  60. package/dist/components/ui/command.d.ts.map +1 -1
  61. package/dist/components/ui/command.js +29 -24
  62. package/dist/components/ui/dialog.d.ts +15 -17
  63. package/dist/components/ui/dialog.d.ts.map +1 -1
  64. package/dist/components/ui/dialog.js +33 -19
  65. package/dist/components/ui/dropdown-menu.js +6 -6
  66. package/dist/components/ui/input-group.d.ts +2 -2
  67. package/dist/components/ui/input.d.ts +1 -2
  68. package/dist/components/ui/input.d.ts.map +1 -1
  69. package/dist/components/ui/input.js +4 -5
  70. package/dist/components/ui/item.d.ts +1 -1
  71. package/dist/components/ui/label.d.ts +1 -1
  72. package/dist/components/ui/label.d.ts.map +1 -1
  73. package/dist/components/ui/label.js +3 -3
  74. package/dist/components/ui/popover.d.ts +4 -1
  75. package/dist/components/ui/popover.d.ts.map +1 -1
  76. package/dist/components/ui/popover.js +10 -1
  77. package/dist/components/ui/scroll-area.d.ts +1 -1
  78. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  79. package/dist/components/ui/scroll-area.js +9 -5
  80. package/dist/components/ui/select.d.ts +13 -11
  81. package/dist/components/ui/select.d.ts.map +1 -1
  82. package/dist/components/ui/select.js +35 -23
  83. package/dist/components/ui/sheet.d.ts +2 -1
  84. package/dist/components/ui/sheet.d.ts.map +1 -1
  85. package/dist/components/ui/sheet.js +2 -2
  86. package/dist/components/ui/switch.d.ts +4 -2
  87. package/dist/components/ui/switch.d.ts.map +1 -1
  88. package/dist/components/ui/switch.js +4 -4
  89. package/dist/components/ui/tabs.d.ts +7 -3
  90. package/dist/components/ui/tabs.d.ts.map +1 -1
  91. package/dist/components/ui/tabs.js +18 -6
  92. package/dist/components/ui/textarea.d.ts +1 -2
  93. package/dist/components/ui/textarea.d.ts.map +1 -1
  94. package/dist/components/ui/textarea.js +4 -5
  95. package/dist/components/ui/tooltip.js +1 -1
  96. package/dist/lib/commands.d.ts +49 -0
  97. package/dist/lib/commands.d.ts.map +1 -1
  98. package/dist/lib/commands.js +56 -0
  99. package/package.json +10 -7
  100. package/src/styles/index.css +7 -0
@@ -0,0 +1,33 @@
1
+ export interface CheckpointInfo {
2
+ /** The message ID of the checkpoint */
3
+ messageId: string;
4
+ /** Number of files in the checkpoint */
5
+ fileCount: number;
6
+ /** Total bytes of the checkpoint */
7
+ totalBytes: number;
8
+ /** When the checkpoint was created */
9
+ createdAt: string;
10
+ /** List of file paths (for display) */
11
+ files?: string[];
12
+ }
13
+ export interface RestoreDialogProps {
14
+ /** Whether the dialog is open */
15
+ open: boolean;
16
+ /** Callback when dialog state changes */
17
+ onOpenChange: (open: boolean) => void;
18
+ /** The checkpoint to potentially restore */
19
+ checkpoint: CheckpointInfo | null;
20
+ /** Callback when restore is confirmed */
21
+ onConfirm: () => void;
22
+ /** Whether a restore is in progress */
23
+ isRestoring?: boolean;
24
+ }
25
+ /**
26
+ * Dialog for confirming checkpoint restoration.
27
+ *
28
+ * Note: The restore operation is cascading - it will undo ALL changes from
29
+ * this point forward, including deleting files that were created after this
30
+ * checkpoint.
31
+ */
32
+ export declare function RestoreDialog({ open, onOpenChange, checkpoint, onConfirm, isRestoring, }: RestoreDialogProps): import("react/jsx-runtime").JSX.Element | null;
33
+ //# sourceMappingURL=restore-dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restore-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/chat/restore-dialog.tsx"],"names":[],"mappings":"AAcA,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAA;IACjB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAA;IACjB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAA;IAClB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,iCAAiC;IACjC,IAAI,EAAE,OAAO,CAAA;IACb,yCAAyC;IACzC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,4CAA4C;IAC5C,UAAU,EAAE,cAAc,GAAG,IAAI,CAAA;IACjC,yCAAyC;IACzC,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,SAAS,EACT,WAAW,GACZ,EAAE,kBAAkB,kDAwFpB"}
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { AlertTriangle, History } from 'lucide-react';
4
+ import { Button } from '../ui/button';
5
+ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '../ui/dialog';
6
+ import { formatDistanceToNow } from 'date-fns';
7
+ /**
8
+ * Dialog for confirming checkpoint restoration.
9
+ *
10
+ * Note: The restore operation is cascading - it will undo ALL changes from
11
+ * this point forward, including deleting files that were created after this
12
+ * checkpoint.
13
+ */
14
+ export function RestoreDialog({ open, onOpenChange, checkpoint, onConfirm, isRestoring, }) {
15
+ if (!checkpoint)
16
+ return null;
17
+ const files = checkpoint.files ?? [];
18
+ const displayFiles = files.slice(0, 5);
19
+ const remainingCount = files.length - displayFiles.length;
20
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "sm:max-w-md", children: [_jsxs(DialogHeader, { children: [_jsxs(DialogTitle, { className: "flex items-center gap-2", children: [_jsx(History, { className: "text-muted-foreground size-5" }), "Restore to this point?"] }), _jsxs(DialogDescription, { children: ["This will undo all changes made from", ' ', formatDistanceToNow(new Date(checkpoint.createdAt), {
21
+ addSuffix: true,
22
+ }), ' ', "onwards."] })] }), _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "bg-destructive/10 flex items-start gap-2 rounded-lg p-3 text-sm", children: [_jsx(AlertTriangle, { className: "text-destructive mt-0.5 size-4 shrink-0" }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-foreground", children: "All changes after this point will be reverted. Files created after this checkpoint will be deleted." }), _jsx("p", { className: "text-muted-foreground", children: "This action cannot be undone." })] })] }), files.length > 0 && (_jsxs("div", { className: "text-muted-foreground text-sm", children: [_jsx("p", { className: "text-foreground mb-2 font-medium", children: "Files in this checkpoint:" }), _jsxs("ul", { className: "bg-muted/50 space-y-1 rounded-md p-2 font-mono text-xs", children: [displayFiles.map((file) => (_jsx("li", { className: "truncate", children: file }, file))), remainingCount > 0 && (_jsxs("li", { className: "text-muted-foreground/70", children: ["...and ", remainingCount, " more"] }))] })] })), _jsxs("p", { className: "text-muted-foreground text-xs", children: [checkpoint.fileCount, " file", checkpoint.fileCount !== 1 ? 's' : '', ' ', "captured"] })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "outline", onClick: () => onOpenChange(false), disabled: isRestoring, className: "cursor-pointer", children: "Cancel" }), _jsx(Button, { variant: "destructive", onClick: onConfirm, disabled: isRestoring, className: "cursor-pointer", children: isRestoring ? 'Restoring...' : 'Restore' })] })] }) }));
23
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"tool-handlers.d.ts","sourceRoot":"","sources":["../../../src/components/chat/tool-handlers.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAA;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAU5D,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAEtE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,SAAS,GAAG,UAAU,CAAA;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;CACd;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IAExB,YAAY,EAAE,MAAM,CAAA;IAEpB,MAAM,CAAC,EAAE,sBAAsB,CAAA;IAE/B,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,SAAS,CAAA;IAGhE,aAAa,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,SAAS,CAAA;IAG7C,eAAe,CAAC,EAAE,CAChB,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,qBAAqB,KAC5B,SAAS,CAAA;IAGd,cAAc,CAAC,EAAE,CACf,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,EAAE,uBAAuB,KAC/B,SAAS,CAAA;CACf,CAAA;AAkOD;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAk1C7D,CAAA;AAoBD;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAmC5D"}
1
+ {"version":3,"file":"tool-handlers.d.ts","sourceRoot":"","sources":["../../../src/components/chat/tool-handlers.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAA;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAW5D,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAEtE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,SAAS,GAAG,UAAU,CAAA;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;CACd;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IAExB,YAAY,EAAE,MAAM,CAAA;IAEpB,MAAM,CAAC,EAAE,sBAAsB,CAAA;IAE/B,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,SAAS,CAAA;IAGhE,aAAa,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,SAAS,CAAA;IAG7C,eAAe,CAAC,EAAE,CAChB,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,qBAAqB,KAC5B,SAAS,CAAA;IAGd,cAAc,CAAC,EAAE,CACf,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,EAAE,uBAAuB,KAC/B,SAAS,CAAA;CACf,CAAA;AAoSD;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAg/D7D,CAAA;AAoBD;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAmC5D"}
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { BookOpen, Check, CheckCheck, Copy, Download, FileCode, FileText, FolderOpen, Globe, Package, Plus, Search, Sparkles, Terminal, Trash2, X, } from 'lucide-react';
3
+ import { AlertTriangle, BookOpen, Check, CheckCheck, Copy, Database, Download, FileCode, FileText, FolderOpen, Globe, Info, Package, Plus, Search, Sparkles, Terminal, Trash2, X, } from 'lucide-react';
4
4
  import { useState } from 'react';
5
5
  import { cn } from '../../lib/utils';
6
6
  import { ThinkingTimelineMarker } from './thinking-timeline';
7
- import { ToolApproval, ToolApprovalAction, ToolApprovalActions, ToolApprovalDangerousHelp, ToolApprovalHeader, ToolApprovalRequest, ToolApprovalSandboxHelp, } from './tool-approval';
7
+ import { ToolApproval, ToolApprovalAction, ToolApprovalActions, ToolApprovalDangerousHelp, ToolApprovalHeader, ToolApprovalHelp, ToolApprovalRequest, ToolApprovalSandboxHelp, } from './tool-approval';
8
8
  /**
9
9
  * Code block component for displaying command output or file contents
10
10
  */
@@ -85,10 +85,66 @@ function getFileName(path) {
85
85
  const parts = path.split('/');
86
86
  return parts[parts.length - 1] || path;
87
87
  }
88
+ function appApiScopes(output) {
89
+ return (output.apps?.flatMap((app) => app.api?.capabilities?.flatMap((capability) => capability.scopes ?? []) ?? []) ?? []);
90
+ }
91
+ function appApiItemCount(result) {
92
+ if (Array.isArray(result)) {
93
+ return result.length;
94
+ }
95
+ if (result && typeof result === 'object') {
96
+ const record = result;
97
+ for (const key of ['items', 'records', 'meetings', 'results', 'data']) {
98
+ const value = record[key];
99
+ if (Array.isArray(value)) {
100
+ return value.length;
101
+ }
102
+ }
103
+ return 1;
104
+ }
105
+ return result == null ? 0 : 1;
106
+ }
88
107
  /**
89
108
  * Default tool handlers for Moldable tools
90
109
  */
91
110
  export const DEFAULT_TOOL_HANDLERS = {
111
+ listMoldableAppApi: {
112
+ loadingLabel: 'Listing app APIs...',
113
+ marker: ThinkingTimelineMarker.Default,
114
+ inline: true,
115
+ renderLoading: () => (_jsx(LoadingIndicator, { icon: Database, children: "Listing app APIs..." })),
116
+ renderOutput: (output, toolCallId) => {
117
+ if (output === undefined || output === null) {
118
+ return (_jsx(LoadingIndicator, { icon: Database, children: "Listing app APIs..." }, toolCallId));
119
+ }
120
+ const result = output;
121
+ const apps = result.apps ?? [];
122
+ const scopes = appApiScopes(result);
123
+ const hasError = result.success === false;
124
+ return (_jsx("div", { className: "my-1 min-w-0 max-w-xl", children: _jsxs("div", { className: cn('inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs', hasError
125
+ ? 'bg-destructive/10 text-destructive'
126
+ : 'bg-muted text-muted-foreground'), children: [_jsx(Database, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: hasError ? 'App API list failed' : 'Listing app APIs' }), !hasError && (_jsxs("span", { className: "truncate", children: [apps.length, " app", apps.length === 1 ? '' : 's', ", ", scopes.length, ' ', "function", scopes.length === 1 ? '' : 's'] })), hasError ? (_jsx(X, { className: "size-3 shrink-0" })) : (_jsx(Check, { className: "size-3 shrink-0 text-green-600" }))] }) }, toolCallId));
127
+ },
128
+ },
129
+ callMoldableAppApi: {
130
+ loadingLabel: 'Calling app API...',
131
+ marker: ThinkingTimelineMarker.Default,
132
+ inline: true,
133
+ renderLoading: () => (_jsx(LoadingIndicator, { icon: Database, children: "Fetching app data..." })),
134
+ renderOutput: (output, toolCallId) => {
135
+ if (output === undefined || output === null) {
136
+ return (_jsx(LoadingIndicator, { icon: Database, children: "Fetching app data..." }, toolCallId));
137
+ }
138
+ const response = output;
139
+ const ok = response.ok !== false && !response.error;
140
+ const itemCount = ok ? appApiItemCount(response.result) : 0;
141
+ return (_jsx("div", { className: "my-1 min-w-0 max-w-xl", children: _jsxs("div", { className: cn('inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs', ok
142
+ ? 'bg-muted text-muted-foreground'
143
+ : 'bg-destructive/10 text-destructive'), children: [_jsx(Database, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: ok ? 'Fetched app data' : 'App API failed' }), _jsx("span", { className: "min-w-0 truncate", children: ok
144
+ ? `${itemCount} item${itemCount === 1 ? '' : 's'}`
145
+ : response.error?.message || response.error?.code || 'Error' }), ok ? (_jsx(Check, { className: "size-3 shrink-0 text-green-600" })) : (_jsx(X, { className: "size-3 shrink-0" }))] }) }, toolCallId));
146
+ },
147
+ },
92
148
  readFile: {
93
149
  loadingLabel: 'Reading file...',
94
150
  marker: ThinkingTimelineMarker.File,
@@ -340,6 +396,28 @@ export const DEFAULT_TOOL_HANDLERS = {
340
396
  return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Search, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: "Found" }), _jsxs("span", { className: "shrink-0", children: [result.files.length, " file", result.files.length !== 1 ? 's' : ''] }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }, toolCallId));
341
397
  },
342
398
  },
399
+ readToolOutput: {
400
+ loadingLabel: 'Reading tool output...',
401
+ marker: ThinkingTimelineMarker.File,
402
+ inline: true,
403
+ renderLoading: (args) => {
404
+ const { path } = (args ?? {});
405
+ return (_jsx(FileOperation, { operation: "read", path: path || 'saved output', status: "loading" }));
406
+ },
407
+ renderOutput: (output, toolCallId) => {
408
+ const result = (output ?? {});
409
+ // If output is empty, tool is still executing
410
+ if (output === undefined || output === null) {
411
+ return (_jsx(FileOperation, { operation: "read", path: "saved output", status: "loading" }, toolCallId));
412
+ }
413
+ if (result.success === false) {
414
+ return (_jsx(FileOperation, { operation: "read", path: result.path || 'saved output', status: "error" }, toolCallId));
415
+ }
416
+ const startLine = result.startLine ?? 0;
417
+ const endLine = startLine + (result.linesReturned || 0);
418
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(FileText, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: "Read tool output" }), _jsxs("span", { className: "text-muted-foreground/70 shrink-0", children: [startLine, "\u2013", endLine, "/", result.totalLines || 0] }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }, toolCallId));
419
+ },
420
+ },
343
421
  // ─────────────────────────────────────────────────────────────────────────────
344
422
  // Web Search
345
423
  // ─────────────────────────────────────────────────────────────────────────────
@@ -483,6 +561,120 @@ export const DEFAULT_TOOL_HANDLERS = {
483
561
  return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 min-w-0 rounded-md", children: [_jsxs("div", { className: "flex items-center gap-2 px-2 py-1.5 text-xs", children: [_jsx(Package, { className: "size-3.5 shrink-0" }), _jsxs("span", { className: "font-medium", children: [result.icon, " ", result.name || result.appId] }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }), _jsxs("div", { className: "border-border/50 flex flex-wrap gap-x-3 gap-y-0.5 border-t px-2 py-1 text-[10px]", children: [result.port && (_jsxs("span", { children: ["Port: ", _jsx("code", { className: "font-mono", children: result.port })] })), result.pnpmInstalled && (_jsx("span", { className: "text-green-600", children: "deps installed" })), result.registered && (_jsx("span", { className: "text-green-600", children: "registered" })), result.files && (_jsxs("span", { className: "text-muted-foreground/70", children: [result.files.length, " files"] }))] })] }, toolCallId));
484
562
  },
485
563
  },
564
+ // ─────────────────────────────────────────────────────────────────────────────
565
+ // App Management
566
+ // ─────────────────────────────────────────────────────────────────────────────
567
+ getAppInfo: {
568
+ loadingLabel: 'Getting app info...',
569
+ marker: ThinkingTimelineMarker.Default,
570
+ inline: true,
571
+ renderLoading: (args) => {
572
+ const { appId } = (args ?? {});
573
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Info, { className: "size-3.5 shrink-0 animate-pulse" }), _jsxs("span", { className: "truncate", children: ["Getting info for ", appId || 'app', "..."] })] }));
574
+ },
575
+ renderOutput: (output, toolCallId) => {
576
+ const result = (output ?? {});
577
+ if (output === undefined || output === null) {
578
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Info, { className: "size-3.5 shrink-0 animate-pulse" }), _jsx("span", { className: "truncate", children: "Getting app info..." })] }, toolCallId));
579
+ }
580
+ if (result.success === false) {
581
+ return (_jsxs("div", { className: "bg-destructive/10 text-destructive my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Info, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "truncate", children: result.error || 'Failed to get app info' })] }, toolCallId));
582
+ }
583
+ const workspaceCount = result.installedInWorkspaces?.length || 0;
584
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 min-w-0 rounded-md", children: [_jsxs("div", { className: "flex items-center gap-2 px-2 py-1.5 text-xs", children: [_jsx(Info, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "font-medium", children: result.appName || result.appId }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }), _jsxs("div", { className: "border-border/50 flex flex-wrap gap-x-3 gap-y-0.5 border-t px-2 py-1 text-[10px]", children: [_jsxs("span", { children: ["Installed in ", workspaceCount, " workspace", workspaceCount !== 1 ? 's' : ''] }), result.hasWorkspaceData && (_jsx("span", { className: "text-amber-600", children: "has workspace data" }))] })] }, toolCallId));
585
+ },
586
+ },
587
+ unregisterApp: {
588
+ loadingLabel: 'Removing app from workspace...',
589
+ marker: ThinkingTimelineMarker.Default,
590
+ inline: true,
591
+ renderLoading: (args) => {
592
+ const { appId } = (args ?? {});
593
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Package, { className: "size-3.5 shrink-0 animate-pulse" }), _jsxs("span", { className: "truncate", children: ["Removing ", appId || 'app', " from workspace..."] })] }));
594
+ },
595
+ renderOutput: (output, toolCallId) => {
596
+ const result = (output ?? {});
597
+ if (output === undefined || output === null) {
598
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Package, { className: "size-3.5 shrink-0 animate-pulse" }), _jsx("span", { className: "truncate", children: "Removing app from workspace..." })] }, toolCallId));
599
+ }
600
+ if (result.success === false) {
601
+ return (_jsxs("div", { className: "bg-destructive/10 text-destructive my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Package, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "truncate", children: result.error || 'Failed to remove app' })] }, toolCallId));
602
+ }
603
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Package, { className: "size-3.5 shrink-0" }), _jsxs("span", { className: "font-medium", children: [result.appName || result.appId, " removed from workspace"] }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }, toolCallId));
604
+ },
605
+ renderApproval: (approval, onRespond) => {
606
+ const { appId } = (approval.args ?? {});
607
+ return (_jsxs(ToolApproval, { state: "approval-requested", children: [_jsx(ToolApprovalHeader, { children: _jsxs(ToolApprovalRequest, { children: [_jsx("div", { className: "mb-1 text-xs font-medium", children: "Remove app from workspace" }), _jsxs("div", { className: "text-muted-foreground mb-2 text-[10px]", children: ["Remove ", _jsx("strong", { children: appId }), " from this workspace?"] }), _jsx("div", { className: "bg-muted/50 rounded px-2 py-1.5 text-[10px]", children: "The app's code and data will be preserved. You can add it back later from the app gallery." })] }) }), _jsxs(ToolApprovalActions, { children: [_jsx(ToolApprovalAction, { variant: "outline", onClick: () => onRespond({
608
+ approvalId: approval.approvalId,
609
+ approved: false,
610
+ reason: 'User cancelled',
611
+ }), children: "Cancel" }), _jsx(ToolApprovalAction, { onClick: () => onRespond({
612
+ approvalId: approval.approvalId,
613
+ approved: true,
614
+ }), children: "Remove" })] })] }));
615
+ },
616
+ },
617
+ deleteAppData: {
618
+ loadingLabel: 'Deleting app data...',
619
+ marker: ThinkingTimelineMarker.Default,
620
+ inline: true,
621
+ renderLoading: (args) => {
622
+ const { appId, workspaceId } = (args ?? {});
623
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Database, { className: "size-3.5 shrink-0 animate-pulse" }), _jsxs("span", { className: "truncate", children: ["Deleting data for ", appId || 'app', workspaceId ? ` in ${workspaceId}` : '', "..."] })] }));
624
+ },
625
+ renderOutput: (output, toolCallId) => {
626
+ const result = (output ?? {});
627
+ if (output === undefined || output === null) {
628
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Database, { className: "size-3.5 shrink-0 animate-pulse" }), _jsx("span", { className: "truncate", children: "Deleting app data..." })] }, toolCallId));
629
+ }
630
+ if (result.success === false) {
631
+ return (_jsxs("div", { className: "bg-destructive/10 text-destructive my-1 min-w-0 rounded-md", children: [_jsxs("div", { className: "flex items-center gap-2 px-2 py-1.5 text-xs", children: [_jsx(Database, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "truncate", children: result.error || 'Failed to delete app data' })] }), (result.workspaceName || result.workspaceId) && (_jsxs("div", { className: "border-destructive/20 border-t px-2 py-1 text-[10px]", children: ["Workspace:", ' ', _jsx("span", { className: "font-medium", children: result.workspaceName || result.workspaceId }), result.workspaceName && result.workspaceId && (_jsxs("span", { className: "text-destructive/70", children: [' ', "(", result.workspaceId, ")"] }))] }))] }, toolCallId));
632
+ }
633
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 min-w-0 rounded-md", children: [_jsxs("div", { className: "flex items-center gap-2 px-2 py-1.5 text-xs", children: [_jsx(Database, { className: "size-3.5 shrink-0" }), _jsxs("span", { className: "font-medium", children: ["Data deleted for ", result.appId] }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }), (result.workspaceName || result.workspaceId) && (_jsxs("div", { className: "border-border/50 border-t px-2 py-1 text-[10px]", children: ["Workspace:", ' ', _jsx("span", { className: "font-medium", children: result.workspaceName || result.workspaceId }), result.workspaceName && result.workspaceId && (_jsxs("span", { className: "text-muted-foreground/70", children: [' ', "(", result.workspaceId, ")"] }))] }))] }, toolCallId));
634
+ },
635
+ renderApproval: (approval, onRespond) => {
636
+ const { appId, workspaceId } = (approval.args ?? {});
637
+ return (_jsxs(ToolApproval, { state: "approval-requested", children: [_jsx(ToolApprovalHeader, { children: _jsxs(ToolApprovalRequest, { children: [_jsxs("div", { className: "mb-1 flex items-center gap-1.5 text-xs font-medium text-amber-600", children: [_jsx(AlertTriangle, { className: "size-3.5" }), "Delete app data"] }), _jsxs("div", { className: "text-muted-foreground mb-2 text-[10px]", children: ["Delete all data for ", _jsx("strong", { children: appId }), " in workspace ID", ' ', _jsx("strong", { children: workspaceId || 'unknown' }), "?"] }), _jsxs("div", { className: "bg-muted/50 mb-2 grid gap-1 rounded px-2 py-1.5 text-[10px]", children: [_jsxs("div", { className: "flex min-w-0 items-center justify-between gap-2", children: [_jsx("span", { className: "text-muted-foreground", children: "App" }), _jsx("code", { className: "bg-background/70 truncate rounded px-1 font-mono", children: appId || 'unknown' })] }), _jsxs("div", { className: "flex min-w-0 items-center justify-between gap-2", children: [_jsx("span", { className: "text-muted-foreground", children: "Target workspace ID" }), _jsx("code", { className: "bg-background/70 truncate rounded px-1 font-mono", children: workspaceId || 'unknown' })] })] }), _jsx("div", { className: "rounded bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700", children: "This permanently deletes this app's database, files, and cache only in the target workspace. The app will remain installed and start fresh there." })] }) }), _jsxs(ToolApprovalActions, { children: [_jsx(ToolApprovalAction, { variant: "outline", onClick: () => onRespond({
638
+ approvalId: approval.approvalId,
639
+ approved: false,
640
+ reason: 'User cancelled',
641
+ }), children: "Cancel" }), _jsx(ToolApprovalAction, { variant: "destructive", onClick: () => onRespond({
642
+ approvalId: approval.approvalId,
643
+ approved: true,
644
+ }), children: "Delete Data" })] })] }));
645
+ },
646
+ },
647
+ deleteApp: {
648
+ loadingLabel: 'Deleting app...',
649
+ marker: ThinkingTimelineMarker.Default,
650
+ inline: true,
651
+ renderLoading: (args) => {
652
+ const { appId } = (args ?? {});
653
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Trash2, { className: "size-3.5 shrink-0 animate-pulse" }), _jsxs("span", { className: "truncate", children: ["Deleting ", appId || 'app', " permanently..."] })] }));
654
+ },
655
+ renderOutput: (output, toolCallId) => {
656
+ const result = (output ?? {});
657
+ if (output === undefined || output === null) {
658
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Trash2, { className: "size-3.5 shrink-0 animate-pulse" }), _jsx("span", { className: "truncate", children: "Deleting app..." })] }, toolCallId));
659
+ }
660
+ if (result.success === false) {
661
+ return (_jsxs("div", { className: "bg-destructive/10 text-destructive my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Trash2, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "truncate", children: result.error || 'Failed to delete app' })] }, toolCallId));
662
+ }
663
+ const affectedCount = result.workspacesAffected?.length || 0;
664
+ return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 min-w-0 rounded-md", children: [_jsxs("div", { className: "flex items-center gap-2 px-2 py-1.5 text-xs", children: [_jsx(Trash2, { className: "size-3.5 shrink-0" }), _jsxs("span", { className: "font-medium", children: [result.appName || result.appId, " deleted permanently"] }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }), affectedCount > 0 && (_jsxs("div", { className: "border-border/50 border-t px-2 py-1 text-[10px]", children: ["Removed from ", affectedCount, " workspace", affectedCount !== 1 ? 's' : ''] }))] }, toolCallId));
665
+ },
666
+ renderApproval: (approval, onRespond) => {
667
+ const { appId } = (approval.args ?? {});
668
+ return (_jsxs(ToolApproval, { state: "approval-requested", children: [_jsx(ToolApprovalHeader, { children: _jsxs(ToolApprovalRequest, { children: [_jsxs("div", { className: "mb-1 flex items-center gap-1.5 text-xs font-medium text-red-600", children: [_jsx(AlertTriangle, { className: "size-3.5" }), "Delete app permanently"] }), _jsxs("div", { className: "text-muted-foreground mb-2 text-[10px]", children: ["Permanently delete ", _jsx("strong", { children: appId }), " from Moldable?"] }), _jsxs("div", { className: "bg-destructive/10 text-destructive rounded px-2 py-1.5 text-[10px]", children: [_jsx("strong", { children: "This will:" }), _jsxs("ul", { className: "mt-1 list-inside list-disc space-y-0.5", children: [_jsx("li", { children: "Remove the app from ALL workspaces" }), _jsx("li", { children: "Delete all source code from shared/apps/" }), _jsx("li", { children: "Delete all workspace data" })] }), _jsx("p", { className: "mt-1.5 font-medium", children: "This action cannot be undone." })] }), _jsxs(ToolApprovalHelp, { className: "mt-2", children: ["To just hide this app from the current workspace (keeps code and data), ask to ", _jsx("strong", { children: "remove" }), " it instead. To clear the app's data but keep it installed, ask to", ' ', _jsx("strong", { children: "reset" }), " it."] })] }) }), _jsxs(ToolApprovalActions, { children: [_jsx(ToolApprovalAction, { variant: "outline", onClick: () => onRespond({
669
+ approvalId: approval.approvalId,
670
+ approved: false,
671
+ reason: 'User cancelled',
672
+ }), children: "Cancel" }), _jsx(ToolApprovalAction, { variant: "destructive", onClick: () => onRespond({
673
+ approvalId: approval.approvalId,
674
+ approved: true,
675
+ }), children: "Delete Permanently" })] })] }));
676
+ },
677
+ },
486
678
  };
487
679
  /**
488
680
  * Loading indicator for inline tool loading states
@@ -1,15 +1,19 @@
1
1
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
2
2
  import * as React from 'react';
3
+ import { Button } from './button';
3
4
  declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
5
  declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
6
  declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
6
7
  declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
7
- declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
8
+ declare function AlertDialogContent({ className, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
9
+ size?: 'default' | 'sm';
10
+ }): import("react/jsx-runtime").JSX.Element;
8
11
  declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
9
12
  declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
10
13
  declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
11
14
  declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
12
- declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>): import("react/jsx-runtime").JSX.Element;
13
- declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): import("react/jsx-runtime").JSX.Element;
14
- export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
15
+ declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
16
+ declare function AlertDialogAction({ className, variant, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action> & Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>): import("react/jsx-runtime").JSX.Element;
17
+ declare function AlertDialogCancel({ className, variant, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> & Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>): import("react/jsx-runtime").JSX.Element;
18
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
15
19
  //# sourceMappingURL=alert-dialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,2CAExD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,2CAI3D;AAED,iBAAS,iBAAiB,CAAC,EACzB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,2CAI1D;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,2CAW3D;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,2CAc3D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQ7B;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAW7B;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,2CAQzD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,WAAW,CAAC,2CAQ/D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,2CAO1D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,2CAO1D;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GAClB,CAAA"}
1
+ {"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,2CAExD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,2CAI3D;AAED,iBAAS,iBAAiB,CAAC,EACzB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,2CAI1D;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,2CAW3D;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,GAAG;IAC7D,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;CACxB,2CAeA;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAW7B;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAW7B;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,2CAWzD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,WAAW,CAAC,2CAQ/D;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAW7B;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,GACzD,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC,2CAU9D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,GACzD,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC,2CAU9D;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,CAAA"}
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
4
4
  import { cn } from '../../lib/utils';
5
- import { buttonVariants } from './button';
5
+ import { Button } from './button';
6
6
  function AlertDialog({ ...props }) {
7
7
  return _jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
8
8
  }
@@ -15,25 +15,28 @@ function AlertDialogPortal({ ...props }) {
15
15
  function AlertDialogOverlay({ className, ...props }) {
16
16
  return (_jsx(AlertDialogPrimitive.Overlay, { "data-slot": "alert-dialog-overlay", className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50', className), ...props }));
17
17
  }
18
- function AlertDialogContent({ className, ...props }) {
19
- return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { "data-slot": "alert-dialog-content", className: cn('bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed left-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg', className), ...props })] }));
18
+ function AlertDialogContent({ className, size = 'default', ...props }) {
19
+ return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { "data-slot": "alert-dialog-content", "data-size": size, className: cn('bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed left-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg', className), ...props })] }));
20
20
  }
21
21
  function AlertDialogHeader({ className, ...props }) {
22
- return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn('flex flex-col gap-2 text-center sm:text-left', className), ...props }));
22
+ return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn('has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr] grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left', className), ...props }));
23
23
  }
24
24
  function AlertDialogFooter({ className, ...props }) {
25
- return (_jsx("div", { "data-slot": "alert-dialog-footer", className: cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className), ...props }));
25
+ return (_jsx("div", { "data-slot": "alert-dialog-footer", className: cn('flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end', className), ...props }));
26
26
  }
27
27
  function AlertDialogTitle({ className, ...props }) {
28
- return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", className: cn('text-lg font-semibold', className), ...props }));
28
+ return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", className: cn('sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2 text-lg font-semibold', className), ...props }));
29
29
  }
30
30
  function AlertDialogDescription({ className, ...props }) {
31
31
  return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", className: cn('text-muted-foreground text-sm', className), ...props }));
32
32
  }
33
- function AlertDialogAction({ className, ...props }) {
34
- return (_jsx(AlertDialogPrimitive.Action, { className: cn(buttonVariants(), className), ...props }));
33
+ function AlertDialogMedia({ className, ...props }) {
34
+ return (_jsx("div", { "data-slot": "alert-dialog-media", className: cn("bg-muted *:[svg:not([class*='size-'])]:size-8 mb-2 inline-flex size-16 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2", className), ...props }));
35
35
  }
36
- function AlertDialogCancel({ className, ...props }) {
37
- return (_jsx(AlertDialogPrimitive.Cancel, { className: cn(buttonVariants({ variant: 'outline' }), className), ...props }));
36
+ function AlertDialogAction({ className, variant = 'default', size = 'default', ...props }) {
37
+ return (_jsx(Button, { variant: variant, size: size, asChild: true, children: _jsx(AlertDialogPrimitive.Action, { "data-slot": "alert-dialog-action", className: cn(className), ...props }) }));
38
38
  }
39
- export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
39
+ function AlertDialogCancel({ className, variant = 'outline', size = 'default', ...props }) {
40
+ return (_jsx(Button, { variant: variant, size: size, asChild: true, children: _jsx(AlertDialogPrimitive.Cancel, { "data-slot": "alert-dialog-cancel", className: cn(className), ...props }) }));
41
+ }
42
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
@@ -1,7 +1,12 @@
1
1
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
2
2
  import * as React from 'react';
3
- declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Avatar({ className, size, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root> & {
4
+ size?: 'default' | 'sm' | 'lg';
5
+ }): import("react/jsx-runtime").JSX.Element;
4
6
  declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
5
7
  declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
6
- export { Avatar, AvatarImage, AvatarFallback };
8
+ declare function AvatarBadge({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
9
+ declare function AvatarGroup({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
10
+ declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
11
+ export { Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount, };
7
12
  //# sourceMappingURL=avatar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAWnD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAQpD;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,QAAQ,CAAC,2CAWvD;AAED,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GAAG;IACrD,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAA;CAC/B,2CAYA;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAQpD;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,QAAQ,CAAC,2CAWvD;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAczE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWxE;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAW7B;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,cAAc,EACd,WAAW,EACX,WAAW,EACX,gBAAgB,GACjB,CAAA"}
@@ -2,13 +2,22 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
4
4
  import { cn } from '../../lib/utils';
5
- function Avatar({ className, ...props }) {
6
- return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", className: cn('relative flex size-8 shrink-0 overflow-hidden rounded-full', className), ...props }));
5
+ function Avatar({ className, size = 'default', ...props }) {
6
+ return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", "data-size": size, className: cn('group/avatar relative flex size-8 shrink-0 select-none overflow-hidden rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6', className), ...props }));
7
7
  }
8
8
  function AvatarImage({ className, ...props }) {
9
9
  return (_jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn('aspect-square size-full', className), ...props }));
10
10
  }
11
11
  function AvatarFallback({ className, ...props }) {
12
- return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn('bg-muted flex size-full items-center justify-center rounded-full', className), ...props }));
12
+ return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn('bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs', className), ...props }));
13
13
  }
14
- export { Avatar, AvatarImage, AvatarFallback };
14
+ function AvatarBadge({ className, ...props }) {
15
+ return (_jsx("span", { "data-slot": "avatar-badge", className: cn('bg-primary text-primary-foreground ring-background absolute bottom-0 right-0 z-10 inline-flex select-none items-center justify-center rounded-full ring-2', 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden', 'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2', 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2', className), ...props }));
16
+ }
17
+ function AvatarGroup({ className, ...props }) {
18
+ return (_jsx("div", { "data-slot": "avatar-group", className: cn('*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2', className), ...props }));
19
+ }
20
+ function AvatarGroupCount({ className, ...props }) {
21
+ return (_jsx("div", { "data-slot": "avatar-group-count", className: cn('bg-muted text-muted-foreground ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 [&>svg]:size-4', className), ...props }));
22
+ }
23
+ export { Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount, };
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
4
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
7
  asChild?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAEjE,QAAA,MAAM,aAAa;;8EAmBlB,CAAA;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAO,EACP,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAC7B,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,2CAU3D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAEjE,QAAA,MAAM,aAAa;;8EAoBlB,CAAA;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAmB,EACnB,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAC7B,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,2CAW3D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
@@ -3,21 +3,23 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { Slot } from '@radix-ui/react-slot';
4
4
  import { cn } from '../../lib/utils';
5
5
  import { cva } from 'class-variance-authority';
6
- const badgeVariants = cva('inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden', {
6
+ const badgeVariants = cva('inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden', {
7
7
  variants: {
8
8
  variant: {
9
- default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
10
- secondary: 'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
11
- destructive: 'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
12
- outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
9
+ default: 'bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
10
+ secondary: 'bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
11
+ destructive: 'bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
12
+ outline: 'border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
13
+ ghost: '[a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
14
+ link: 'text-primary underline-offset-4 [a&]:hover:underline',
13
15
  },
14
16
  },
15
17
  defaultVariants: {
16
18
  variant: 'default',
17
19
  },
18
20
  });
19
- function Badge({ className, variant, asChild = false, ...props }) {
21
+ function Badge({ className, variant = 'default', asChild = false, ...props }) {
20
22
  const Comp = asChild ? Slot : 'span';
21
- return (_jsx(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props }));
23
+ return (_jsx(Comp, { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant }), className), ...props }));
22
24
  }
23
25
  export { Badge, badgeVariants };
@@ -2,11 +2,10 @@ import * as React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const buttonVariants: (props?: ({
4
4
  variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
- size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
5
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
- export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
7
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
8
8
  asChild?: boolean;
9
- }
10
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
9
+ }): import("react/jsx-runtime").JSX.Element;
11
10
  export { Button, buttonVariants };
12
11
  //# sourceMappingURL=button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAEjE,QAAA,MAAM,cAAc;;;8EA8BnB,CAAA;AAED,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,MAAM,uFAWX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAEjE,QAAA,MAAM,cAAc;;;8EAgCnB,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAC/B,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,2CAYF;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
@@ -1,9 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Slot } from '@radix-ui/react-slot';
3
- import * as React from 'react';
4
3
  import { cn } from '../../lib/utils';
5
4
  import { cva } from 'class-variance-authority';
6
- const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", {
5
+ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
7
6
  variants: {
8
7
  variant: {
9
8
  default: 'bg-primary text-primary-foreground hover:bg-primary/90',
@@ -15,9 +14,11 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
15
14
  },
16
15
  size: {
17
16
  default: 'h-9 px-4 py-2 has-[>svg]:px-3',
17
+ xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
18
18
  sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
19
19
  lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
20
20
  icon: 'size-9',
21
+ 'icon-xs': "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
21
22
  'icon-sm': 'size-8',
22
23
  'icon-lg': 'size-10',
23
24
  },
@@ -27,9 +28,8 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
27
28
  size: 'default',
28
29
  },
29
30
  });
30
- const Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
31
+ function Button({ className, variant = 'default', size = 'default', asChild = false, ...props }) {
31
32
  const Comp = asChild ? Slot : 'button';
32
- return (_jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref: ref, ...props }));
33
- });
34
- Button.displayName = 'Button';
33
+ return (_jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
34
+ }
35
35
  export { Button, buttonVariants };