@hanzo/ui 4.5.4 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README-MCP.md +3 -3
  2. package/README.md +229 -0
  3. package/assets/ai-icons.tsx +207 -0
  4. package/assets/crypto.tsx +33 -0
  5. package/assets/file-type-icon.tsx +66 -0
  6. package/assets/file.tsx +45 -0
  7. package/assets/general.tsx +2318 -0
  8. package/assets/hanzo-logo.svg +9 -0
  9. package/assets/hanzo-logo.tsx +15 -0
  10. package/assets/index.ts +8 -0
  11. package/assets/index.tsx +4 -0
  12. package/assets/llm-provider.tsx +1094 -0
  13. package/bin/create-registry.js +1 -1
  14. package/bin/test-mcp.sh +1 -1
  15. package/bin/update-registry.js +2 -2
  16. package/blocks/components/content.tsx +1 -1
  17. package/blocks/components/grid-block/index.tsx +1 -1
  18. package/blocks/components/screenful-block/content.tsx +1 -1
  19. package/blocks/components/screenful-block/poster-background.tsx +1 -1
  20. package/components/index.ts +56 -0
  21. package/dist/button.d.ts +1 -0
  22. package/dist/button.js +1 -0
  23. package/dist/hooks/index.d.ts +7 -0
  24. package/dist/hooks/index.js +7 -0
  25. package/dist/hooks/use-click-away.d.ts +2 -0
  26. package/dist/hooks/use-click-away.js +23 -0
  27. package/dist/hooks/use-combined-refs.d.ts +3 -0
  28. package/dist/hooks/use-combined-refs.js +18 -0
  29. package/dist/hooks/use-copy-clipboard.d.ts +9 -0
  30. package/dist/hooks/use-copy-clipboard.js +21 -0
  31. package/dist/hooks/use-debounce.d.ts +1 -0
  32. package/dist/hooks/use-debounce.js +13 -0
  33. package/dist/hooks/use-fill-ids.d.ts +8 -0
  34. package/dist/hooks/use-fill-ids.js +20 -0
  35. package/dist/hooks/use-map.d.ts +1 -0
  36. package/dist/hooks/use-map.js +20 -0
  37. package/dist/hooks/use-measure.d.ts +8 -0
  38. package/dist/hooks/use-measure.js +25 -0
  39. package/dist/hooks/use-reverse-video-playback.d.ts +1 -0
  40. package/dist/hooks/use-reverse-video-playback.js +41 -0
  41. package/dist/hooks/use-scroll-restoration.d.ts +8 -0
  42. package/dist/hooks/use-scroll-restoration.js +36 -0
  43. package/dist/mcp/enhanced-server.js +2 -2
  44. package/dist/registry/api.d.ts +1 -1
  45. package/dist/registry/api.js +3 -3
  46. package/dist/registry/index.d.ts +48 -48
  47. package/dist/registry/index.js +3 -3
  48. package/dist/utils.d.ts +1 -0
  49. package/dist/utils.js +1 -0
  50. package/helpers/file.ts +33 -0
  51. package/helpers/memoization.ts +40 -0
  52. package/package.json +27 -6
  53. package/primitives/accordion.tsx +53 -45
  54. package/primitives/alert-dialog.tsx +185 -0
  55. package/primitives/alert.tsx +74 -0
  56. package/primitives/apply-typography.tsx +1 -1
  57. package/primitives/avatar.tsx +37 -29
  58. package/primitives/background-beams.tsx +142 -0
  59. package/primitives/badge.tsx +27 -19
  60. package/primitives/breadcrumb.tsx +77 -62
  61. package/primitives/button.tsx +69 -72
  62. package/primitives/card.tsx +73 -59
  63. package/primitives/chat/chat-input-area.tsx +87 -0
  64. package/primitives/chat/chat-input.tsx +71 -0
  65. package/primitives/chat/files-preview.tsx +330 -0
  66. package/primitives/chat/index.ts +6 -0
  67. package/primitives/chat/json-form.tsx +8 -0
  68. package/primitives/chat/message-list.tsx +307 -0
  69. package/primitives/chat/message.tsx +569 -0
  70. package/primitives/chat/sqlite-preview.tsx +215 -0
  71. package/primitives/checkbox.tsx +18 -19
  72. package/primitives/collapsible.tsx +9 -0
  73. package/primitives/command.tsx +75 -83
  74. package/primitives/context-menu.tsx +115 -109
  75. package/primitives/copy-to-clipboard-icon.tsx +60 -0
  76. package/primitives/dialog-video-controller.tsx +1 -1
  77. package/primitives/dialog.tsx +111 -145
  78. package/primitives/dot-pattern.tsx +57 -0
  79. package/primitives/dots-loader.tsx +13 -0
  80. package/primitives/drawer.tsx +59 -87
  81. package/primitives/dropdown-menu.tsx +199 -0
  82. package/primitives/error-message.tsx +19 -0
  83. package/primitives/file-uploader.tsx +200 -0
  84. package/primitives/form.tsx +92 -87
  85. package/primitives/hover-card.tsx +28 -0
  86. package/primitives/icons/github.tsx +1 -1
  87. package/primitives/icons/youtube-logo.tsx +1 -1
  88. package/primitives/index-common.ts +121 -42
  89. package/primitives/index-next.ts +3 -1
  90. package/primitives/input.tsx +115 -20
  91. package/primitives/label.tsx +15 -23
  92. package/primitives/loading-spinner.tsx +1 -1
  93. package/primitives/markdown-preview.tsx +609 -0
  94. package/primitives/mermaid.tsx +196 -0
  95. package/primitives/next/link-element.tsx +1 -1
  96. package/primitives/next/mdx-link.tsx +1 -1
  97. package/primitives/pagination.tsx +117 -0
  98. package/primitives/popover.tsx +20 -25
  99. package/primitives/pretty-json-print.tsx +28 -0
  100. package/primitives/progress.tsx +14 -15
  101. package/primitives/prompt-textarea.tsx +72 -0
  102. package/primitives/qr-code.tsx +112 -0
  103. package/primitives/radio-group.tsx +25 -39
  104. package/primitives/resizable.tsx +47 -0
  105. package/primitives/scroll-area.tsx +35 -25
  106. package/primitives/search-input.tsx +66 -0
  107. package/primitives/select.tsx +62 -109
  108. package/primitives/separator.tsx +22 -26
  109. package/primitives/sheet.tsx +78 -117
  110. package/primitives/skeleton.tsx +13 -16
  111. package/primitives/slider.tsx +50 -60
  112. package/primitives/stepper.tsx +272 -0
  113. package/primitives/switch.tsx +14 -23
  114. package/primitives/table.tsx +65 -77
  115. package/primitives/tabs.tsx +29 -39
  116. package/primitives/text-link.tsx +25 -0
  117. package/primitives/textarea.tsx +61 -0
  118. package/primitives/textfield.tsx +75 -0
  119. package/primitives/toast.tsx +30 -0
  120. package/primitives/toggle-group.tsx +33 -33
  121. package/primitives/toggle.tsx +22 -51
  122. package/primitives/tooltip.tsx +37 -38
  123. package/registry.json +1 -1
  124. package/src/button.ts +1 -0
  125. package/src/hooks/index.ts +7 -0
  126. package/src/hooks/use-click-away.ts +31 -0
  127. package/src/hooks/use-combined-refs.ts +22 -0
  128. package/src/hooks/use-copy-clipboard.ts +30 -0
  129. package/src/hooks/use-debounce.ts +17 -0
  130. package/src/hooks/use-fill-ids.ts +25 -0
  131. package/src/hooks/use-map.ts +26 -0
  132. package/src/hooks/use-measure.ts +42 -0
  133. package/src/hooks/use-reverse-video-playback.ts +43 -0
  134. package/src/hooks/use-scroll-restoration.ts +50 -0
  135. package/src/mcp/README.md +1 -1
  136. package/src/mcp/enhanced-server.ts +2 -2
  137. package/src/registry/api.ts +3 -3
  138. package/src/registry/index.ts +3 -3
  139. package/src/utils.ts +1 -0
  140. package/style/theme-provider.tsx +1 -1
  141. package/test-imports.mjs +19 -0
  142. package/types/animation-def.ts +1 -1
  143. package/types/button-def.ts +1 -1
  144. package/types/index.ts +1 -1
  145. package/util/blob.ts +28 -0
  146. package/util/copy-to-clipboard.ts +17 -0
  147. package/util/create-shadow-root.ts +22 -0
  148. package/util/date.ts +83 -0
  149. package/util/debounce.ts +11 -0
  150. package/util/file.ts +15 -0
  151. package/util/format-and-abbreviate-as-currency.ts +1 -1
  152. package/util/format-text.ts +33 -0
  153. package/util/index.ts +9 -78
  154. package/util/timing.ts +3 -0
  155. package/util/toasts.tsx +17 -0
  156. package/utils.ts +9 -0
@@ -0,0 +1,215 @@
1
+ import { debug } from '@tauri-apps/plugin-log';
2
+ import { useEffect, useState } from 'react';
3
+ import * as sqljs from 'sql.js';
4
+
5
+ import { Button } from '../button';
6
+ import { Skeleton } from '../skeleton';
7
+
8
+ interface SqlitePreviewProps {
9
+ url: string;
10
+ }
11
+
12
+ const loadTableData = async (
13
+ db: sqljs.Database,
14
+ tableName: string,
15
+ ): Promise<{ values: sqljs.SqlValue[][] }> => {
16
+ void debug(`loading table data for ${tableName}`);
17
+ const dataResult = db.exec(`SELECT * FROM ${tableName}`);
18
+ void debug(`found ${dataResult[0].values.length} rows for ${tableName}`);
19
+ return { values: dataResult[0].values };
20
+ };
21
+
22
+ const loadDatabase = async (
23
+ url: string,
24
+ ): Promise<{
25
+ db: sqljs.Database;
26
+ tables: { name: string; columns: sqljs.SqlValue[]; count: number }[];
27
+ }> => {
28
+ void debug(`loading database from ${url}`);
29
+ const SQL = await sqljs.default({
30
+ locateFile: (file: string) => '/sqljs/sql-wasm.wasm',
31
+ });
32
+
33
+ const response = await fetch(url);
34
+ const arrayBuffer = await response.arrayBuffer();
35
+ const db = new SQL.Database(new Uint8Array(arrayBuffer));
36
+
37
+ // Get list of tables
38
+ const tablesResult = db.exec(
39
+ "SELECT name FROM sqlite_master WHERE type='table'",
40
+ );
41
+ const tableNames = tablesResult[0].values.map((v) => v[0] as string);
42
+ void debug(`found ${tableNames.length} tables`);
43
+ void debug(`tables: ${tableNames.join(', ')}`);
44
+ const tables = tableNames.map((table) => {
45
+ const columnsResult = db.exec(`PRAGMA table_info(${table})`);
46
+ const columnNames = columnsResult[0].values.map((v) => v[1]);
47
+ const countResult = db.exec(`SELECT COUNT(*) FROM ${table}`);
48
+ const count = countResult[0].values[0][0] as number;
49
+ void debug(
50
+ `found columns ${columnNames.join(', ')} and ${count} rows for ${table}`,
51
+ );
52
+ return {
53
+ name: table,
54
+ columns: columnNames,
55
+ count,
56
+ };
57
+ });
58
+
59
+ return { db, tables };
60
+ };
61
+
62
+ export const SqlitePreview: React.FC<SqlitePreviewProps> = ({ url }) => {
63
+ const [selectedTable, setSelectedTable] = useState<string>();
64
+ const [error, setError] = useState<string>();
65
+ const [loading, setLoading] = useState(true);
66
+ const [loadingData, setLoadingData] = useState(false);
67
+
68
+ const [db, setDb] = useState<sqljs.Database | null>(null);
69
+ const [tables, setTables] = useState<
70
+ { name: string; columns: sqljs.SqlValue[]; count: number }[]
71
+ >([]);
72
+ const [tableData, setTableData] = useState<{
73
+ columns: sqljs.SqlValue[];
74
+ rows: sqljs.SqlValue[][];
75
+ } | null>(null);
76
+
77
+ useEffect(() => {
78
+ const init = async () => {
79
+ setLoading(true);
80
+ try {
81
+ const { db, tables } = await loadDatabase(url);
82
+ setDb(db);
83
+ setTables(tables);
84
+ if (tables.length > 0) {
85
+ setSelectedTable(tables[0].name);
86
+ }
87
+ } catch (error) {
88
+ setError(
89
+ error instanceof Error ? error.message : 'Failed to load database',
90
+ );
91
+ } finally {
92
+ setLoading(false);
93
+ }
94
+ };
95
+ void init();
96
+ }, [url]);
97
+
98
+ useEffect(() => {
99
+ if (db && selectedTable) {
100
+ setLoadingData(true);
101
+ loadTableData(db, selectedTable)
102
+ .then(({ values }) => {
103
+ const columns = tables.find(
104
+ (table) => table.name === selectedTable,
105
+ )?.columns;
106
+ if (!columns) {
107
+ setError('Table not found');
108
+ return;
109
+ }
110
+ setTableData({
111
+ columns,
112
+ rows: values,
113
+ });
114
+ })
115
+ .catch((error) => {
116
+ setError(
117
+ error instanceof Error
118
+ ? error.message
119
+ : 'Failed to load table data',
120
+ );
121
+ })
122
+ .finally(() => {
123
+ setLoadingData(false);
124
+ });
125
+ }
126
+ }, [db, selectedTable, tables]);
127
+
128
+ useEffect(() => {
129
+ return () => {
130
+ if (db) {
131
+ void debug('closing database connection');
132
+ db.close();
133
+ }
134
+ };
135
+ }, [db]);
136
+
137
+ if (error) {
138
+ return (
139
+ <div className="p-4 text-red-500">Error loading database: {error}</div>
140
+ );
141
+ }
142
+
143
+ if (loading) {
144
+ return (
145
+ <div className="flex flex-col gap-4 rounded-lg bg-gray-600 p-4">
146
+ <div className="flex gap-2">
147
+ <Skeleton className="h-8 w-24" />
148
+ <Skeleton className="h-8 w-24" />
149
+ </div>
150
+ <div className="space-y-2">
151
+ <Skeleton className="h-8 w-full" />
152
+ <Skeleton className="h-8 w-full" />
153
+ <Skeleton className="h-8 w-full" />
154
+ </div>
155
+ </div>
156
+ );
157
+ }
158
+
159
+ return (
160
+ <div className="flex flex-col gap-4 overflow-y-hidden rounded-lg bg-gray-600 p-4">
161
+ <div className="flex flex-wrap gap-2">
162
+ {tables.map((table) => (
163
+ <Button
164
+ key={table.name}
165
+ onClick={() => setSelectedTable(table.name)}
166
+ size="sm"
167
+ variant={selectedTable === table.name ? 'default' : 'outline'}
168
+ >
169
+ {table.name} ({table.count})
170
+ </Button>
171
+ ))}
172
+ </div>
173
+
174
+ {selectedTable && (
175
+ <div className="max-h-full min-h-fit overflow-y-auto">
176
+ <div className="overflow-x-auto">
177
+ {loadingData ? (
178
+ <div className="space-y-2">
179
+ <Skeleton className="h-8 w-full" />
180
+ <Skeleton className="h-8 w-full" />
181
+ <Skeleton className="h-8 w-full" />
182
+ </div>
183
+ ) : (
184
+ <table className="w-full text-left text-sm">
185
+ <thead className="sticky top-0 bg-gray-600">
186
+ <tr className="border-b border-gray-500">
187
+ {tableData?.columns.map((column) => (
188
+ <th
189
+ className="p-2 font-medium text-gray-300"
190
+ key={String(column)}
191
+ >
192
+ {String(column)}
193
+ </th>
194
+ ))}
195
+ </tr>
196
+ </thead>
197
+ <tbody>
198
+ {tableData?.rows.map((row, i) => (
199
+ <tr className="border-b border-gray-700" key={i}>
200
+ {row.map((cell, j) => (
201
+ <td className="text-text-secondary p-2" key={j}>
202
+ {String(cell)}
203
+ </td>
204
+ ))}
205
+ </tr>
206
+ ))}
207
+ </tbody>
208
+ </table>
209
+ )}
210
+ </div>
211
+ </div>
212
+ )}
213
+ </div>
214
+ );
215
+ };
@@ -1,32 +1,31 @@
1
- 'use client'
2
- import React from 'react'
3
- import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
4
- import { Check } from 'lucide-react'
1
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
2
+ import { CheckIcon } from '@radix-ui/react-icons';
3
+ import * as React from 'react';
5
4
 
6
- import { cn } from '../util'
5
+ import { cn } from '../src/utils';
7
6
 
8
- const Checkbox = React.forwardRef<
9
- React.ElementRef<typeof CheckboxPrimitive.Root>,
10
- React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
11
- >(({ className, ...props }, ref) => (
7
+ type CheckboxProps = React.ComponentPropsWithoutRef<
8
+ typeof CheckboxPrimitive.Root
9
+ > & {
10
+ ref?: React.RefObject<React.ComponentRef<typeof CheckboxPrimitive.Root>>;
11
+ };
12
+
13
+ const Checkbox = ({ className, ref, ...props }: CheckboxProps) => (
12
14
  <CheckboxPrimitive.Root
13
- ref={ref}
14
15
  className={cn(
15
- 'peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background ' +
16
- 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ' +
17
- 'focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ' +
18
- 'data-[state=checked]:bg-primary data-[state=checked]:text-primary-fg',
19
- className
16
+ 'focus-visible:ring-ring data-[state=checked]:bg-brand data-[state=checked]:border-brand peer h-4 w-4 shrink-0 rounded-xs border border-gray-400 shadow-sm focus-visible:ring-1 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-black',
17
+ className,
20
18
  )}
19
+ ref={ref}
21
20
  {...props}
22
21
  >
23
22
  <CheckboxPrimitive.Indicator
24
23
  className={cn('flex items-center justify-center text-current')}
25
24
  >
26
- <Check className='h-4 w-4' />
25
+ <CheckIcon className="h-3.5 w-3.5" />
27
26
  </CheckboxPrimitive.Indicator>
28
27
  </CheckboxPrimitive.Root>
29
- ))
30
- Checkbox.displayName = CheckboxPrimitive.Root.displayName
28
+ );
29
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName;
31
30
 
32
- export default Checkbox
31
+ export { Checkbox };
@@ -0,0 +1,9 @@
1
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
2
+
3
+ const Collapsible = CollapsiblePrimitive.Root;
4
+
5
+ const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
6
+
7
+ const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
8
+
9
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -1,132 +1,124 @@
1
- "use client"
2
- import React from "react"
1
+ import { DialogProps } from '@radix-ui/react-dialog';
2
+ import { Command as CommandPrimitive } from 'cmdk';
3
+ import { Search } from 'lucide-react';
4
+ import * as React from 'react';
3
5
 
4
- import { type DialogProps } from "@radix-ui/react-dialog"
5
- import { Command as CommandPrimitive } from "cmdk"
6
- import { Search } from "lucide-react"
6
+ import { cn } from '../src/utils';
7
+ import { Dialog, DialogContent } from './dialog';
7
8
 
8
- import { cn } from "../util"
9
- import { Dialog, DialogContent } from "./dialog"
10
-
11
- const Command = React.forwardRef<
12
- React.ElementRef<typeof CommandPrimitive>,
13
- React.ComponentPropsWithoutRef<typeof CommandPrimitive>
14
- >(({ className, ...props }, ref) => (
9
+ const Command = ({
10
+ className,
11
+ ...props
12
+ }: React.ComponentProps<typeof CommandPrimitive>) => (
15
13
  <CommandPrimitive
16
- ref={ref}
17
14
  className={cn(
18
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-level-1 text-foreground",
19
- className
15
+ 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md [&_[cmdk-list]]:scroll-pt-0 [&_[cmdk-list]]:scroll-auto',
16
+ className,
20
17
  )}
18
+ loop={true}
21
19
  {...props}
22
20
  />
23
- ))
24
- Command.displayName = CommandPrimitive.displayName
21
+ );
22
+ Command.displayName = CommandPrimitive.displayName;
25
23
 
26
- interface CommandDialogProps extends DialogProps {}
24
+ type CommandDialogProps = DialogProps;
27
25
 
28
26
  const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
29
27
  return (
30
28
  <Dialog {...props}>
31
29
  <DialogContent className="overflow-hidden p-0 shadow-lg">
32
- <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-1 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
30
+ <Command className="[&_[cmdk-group-heading]]:text-text-secondary [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
33
31
  {children}
34
32
  </Command>
35
33
  </DialogContent>
36
34
  </Dialog>
37
- )
38
- }
35
+ );
36
+ };
39
37
 
40
- const CommandInput = React.forwardRef<
41
- React.ElementRef<typeof CommandPrimitive.Input>,
42
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
43
- >(({ className, ...props }, ref) => (
38
+ const CommandInput = ({
39
+ className,
40
+ ref,
41
+ ...props
42
+ }: React.ComponentProps<typeof CommandPrimitive.Input>) => (
44
43
  <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
45
44
  <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
46
45
  <CommandPrimitive.Input
47
- ref={ref}
48
46
  className={cn(
49
- "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-2 disabled:cursor-not-allowed disabled:opacity-50",
50
- className
47
+ 'placeholder:!text-text-placeholder flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50',
48
+ className,
51
49
  )}
50
+ ref={ref}
52
51
  {...props}
53
52
  />
54
53
  </div>
55
- ))
54
+ );
56
55
 
57
- CommandInput.displayName = CommandPrimitive.Input.displayName
56
+ CommandInput.displayName = CommandPrimitive.Input.displayName;
58
57
 
59
- const CommandList = React.forwardRef<
60
- React.ElementRef<typeof CommandPrimitive.List>,
61
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
62
- >(({ className, ...props }, ref) => (
58
+ const CommandList = ({
59
+ className,
60
+ ...props
61
+ }: React.ComponentProps<typeof CommandPrimitive.List>) => (
63
62
  <CommandPrimitive.List
64
- ref={ref}
65
- className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
63
+ className={cn(
64
+ 'max-h-[300px] scroll-pt-0 overflow-x-hidden overflow-y-auto scroll-auto',
65
+ className,
66
+ )}
66
67
  {...props}
67
68
  />
68
- ))
69
+ );
69
70
 
70
- CommandList.displayName = CommandPrimitive.List.displayName
71
+ CommandList.displayName = CommandPrimitive.List.displayName;
71
72
 
72
- const CommandEmpty = React.forwardRef<
73
- React.ElementRef<typeof CommandPrimitive.Empty>,
74
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
75
- >((props, ref) => (
76
- <CommandPrimitive.Empty
77
- ref={ref}
78
- className="py-6 text-center text-sm"
79
- {...props}
80
- />
81
- ))
73
+ const CommandEmpty = ({
74
+ className,
75
+ ...props
76
+ }: React.ComponentProps<typeof CommandPrimitive.Empty>) => (
77
+ <CommandPrimitive.Empty className="py-6 text-center text-sm" {...props} />
78
+ );
82
79
 
83
- CommandEmpty.displayName = CommandPrimitive.Empty.displayName
80
+ CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
84
81
 
85
- const CommandGroup = React.forwardRef<
86
- React.ElementRef<typeof CommandPrimitive.Group>,
87
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
88
- >(({ className, ...props }, ref) => (
82
+ const CommandGroup = ({
83
+ className,
84
+ ...props
85
+ }: React.ComponentProps<typeof CommandPrimitive.Group>) => (
89
86
  <CommandPrimitive.Group
90
- ref={ref}
91
87
  className={cn(
92
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted",
93
- className
88
+ 'text-text-default [&_[cmdk-group-heading]]:text-text-default overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium',
89
+ className,
94
90
  )}
95
91
  {...props}
96
92
  />
97
- ))
93
+ );
98
94
 
99
- CommandGroup.displayName = CommandPrimitive.Group.displayName
95
+ CommandGroup.displayName = CommandPrimitive.Group.displayName;
100
96
 
101
- const CommandSeparator = React.forwardRef<
102
- React.ElementRef<typeof CommandPrimitive.Separator>,
103
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
104
- >(({ className, ...props }, ref) => (
97
+ const CommandSeparator = ({
98
+ className,
99
+ ...props
100
+ }: React.ComponentProps<typeof CommandPrimitive.Separator>) => (
105
101
  <CommandPrimitive.Separator
106
- ref={ref}
107
- className={cn("-mx-1 h-px bg-border", className)}
102
+ className={cn('bg-divider -mx-1 h-px', className)}
108
103
  {...props}
109
104
  />
110
- ))
111
- CommandSeparator.displayName = CommandPrimitive.Separator.displayName
105
+ );
106
+ CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
112
107
 
113
- const CommandItem = React.forwardRef<
114
- React.ElementRef<typeof CommandPrimitive.Item>,
115
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
116
- >(({ className, ...props }, ref) => (
108
+ const CommandItem = ({
109
+ className,
110
+ ...props
111
+ }: React.ComponentProps<typeof CommandPrimitive.Item>) => (
117
112
  <CommandPrimitive.Item
118
- ref={ref}
119
113
  className={cn(
120
- 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none',
121
- 'data-selected:bg-level-3 aria-selected:text-accent',
122
- 'data-[disabled]:pointer-events-none data-[disabled]:opacity-35',
123
- className
114
+ "hover:bg-bg-secondary data-[selected=true]:text-text-default data-[selected='true']:bg-bg-secondary relative flex cursor-default items-center rounded-xs px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
115
+ className,
124
116
  )}
125
117
  {...props}
126
118
  />
127
- ))
119
+ );
128
120
 
129
- CommandItem.displayName = CommandPrimitive.Item.displayName
121
+ CommandItem.displayName = CommandPrimitive.Item.displayName;
130
122
 
131
123
  const CommandShortcut = ({
132
124
  className,
@@ -135,14 +127,14 @@ const CommandShortcut = ({
135
127
  return (
136
128
  <span
137
129
  className={cn(
138
- "ml-auto text-xs tracking-widest text-muted",
139
- className
130
+ 'text-text-secondary ml-auto text-xs tracking-widest',
131
+ className,
140
132
  )}
141
133
  {...props}
142
134
  />
143
- )
144
- }
145
- CommandShortcut.displayName = "CommandShortcut"
135
+ );
136
+ };
137
+ CommandShortcut.displayName = 'CommandShortcut';
146
138
 
147
139
  export {
148
140
  Command,
@@ -154,4 +146,4 @@ export {
154
146
  CommandItem,
155
147
  CommandShortcut,
156
148
  CommandSeparator,
157
- }
149
+ };