@openconsole/shadcn 0.2.6 → 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 (113) hide show
  1. package/components/index.ts +1 -2
  2. package/components/ui/accordion.tsx +66 -66
  3. package/components/ui/alert-dialog.tsx +196 -196
  4. package/components/ui/alert.tsx +66 -66
  5. package/components/ui/aspect-ratio.tsx +11 -11
  6. package/components/ui/avatar.tsx +53 -53
  7. package/components/ui/badge.tsx +46 -46
  8. package/components/ui/breadcrumb.tsx +109 -109
  9. package/components/ui/button-group.tsx +83 -83
  10. package/components/ui/button.tsx +60 -60
  11. package/components/ui/calendar.tsx +219 -219
  12. package/components/ui/card.tsx +92 -92
  13. package/components/ui/carousel.tsx +241 -241
  14. package/components/ui/chart.tsx +374 -374
  15. package/components/ui/checkbox.tsx +32 -32
  16. package/components/ui/collapsible.tsx +33 -33
  17. package/components/ui/command.tsx +184 -184
  18. package/components/ui/context-menu.tsx +252 -252
  19. package/components/ui/dialog.tsx +143 -143
  20. package/components/ui/direction.tsx +22 -22
  21. package/components/ui/drawer.tsx +135 -135
  22. package/components/ui/dropdown-menu.tsx +257 -257
  23. package/components/ui/empty.tsx +104 -104
  24. package/components/ui/field.tsx +248 -248
  25. package/components/ui/form.tsx +167 -167
  26. package/components/ui/hover-card.tsx +44 -44
  27. package/components/ui/index.ts +59 -59
  28. package/components/ui/input-group.tsx +170 -170
  29. package/components/ui/input-otp.tsx +77 -77
  30. package/components/ui/input.tsx +21 -21
  31. package/components/ui/item.tsx +193 -193
  32. package/components/ui/kbd.tsx +28 -28
  33. package/components/ui/label.tsx +24 -24
  34. package/components/ui/menubar.tsx +276 -276
  35. package/components/ui/native-select.tsx +62 -62
  36. package/components/ui/navigation-menu.tsx +168 -168
  37. package/components/ui/pagination.tsx +127 -127
  38. package/components/ui/popover.tsx +89 -89
  39. package/components/ui/progress.tsx +31 -31
  40. package/components/ui/radio-group.tsx +45 -45
  41. package/components/ui/resizable.tsx +53 -53
  42. package/components/ui/scroll-area.tsx +58 -58
  43. package/components/ui/select.tsx +187 -187
  44. package/components/ui/separator.tsx +28 -28
  45. package/components/ui/sheet.tsx +139 -139
  46. package/components/ui/sidebar.tsx +724 -724
  47. package/components/ui/skeleton.tsx +13 -13
  48. package/components/ui/slider.tsx +63 -63
  49. package/components/ui/sonner.tsx +40 -40
  50. package/components/ui/spinner.tsx +16 -16
  51. package/components/ui/switch.tsx +35 -35
  52. package/components/ui/table.tsx +116 -116
  53. package/components/ui/tabs.tsx +66 -66
  54. package/components/ui/textarea.tsx +18 -18
  55. package/components/ui/toggle-group.tsx +83 -83
  56. package/components/ui/toggle.tsx +47 -47
  57. package/components/ui/tooltip.tsx +61 -61
  58. package/hooks/index.ts +1 -1
  59. package/hooks/use-mobile.ts +19 -19
  60. package/index.ts +3 -3
  61. package/lib/index.ts +1 -1
  62. package/lib/utils.ts +6 -6
  63. package/package.json +1 -1
  64. package/styles.css +124 -124
  65. package/components/ai-elements/agent.tsx +0 -141
  66. package/components/ai-elements/artifact.tsx +0 -148
  67. package/components/ai-elements/attachments.tsx +0 -426
  68. package/components/ai-elements/audio-player.tsx +0 -231
  69. package/components/ai-elements/canvas.tsx +0 -26
  70. package/components/ai-elements/chain-of-thought.tsx +0 -222
  71. package/components/ai-elements/checkpoint.tsx +0 -71
  72. package/components/ai-elements/code-block.tsx +0 -562
  73. package/components/ai-elements/commit.tsx +0 -458
  74. package/components/ai-elements/confirmation.tsx +0 -174
  75. package/components/ai-elements/connection.tsx +0 -28
  76. package/components/ai-elements/context.tsx +0 -409
  77. package/components/ai-elements/controls.tsx +0 -18
  78. package/components/ai-elements/conversation.tsx +0 -168
  79. package/components/ai-elements/edge.tsx +0 -143
  80. package/components/ai-elements/environment-variables.tsx +0 -324
  81. package/components/ai-elements/file-tree.tsx +0 -304
  82. package/components/ai-elements/image.tsx +0 -24
  83. package/components/ai-elements/index.ts +0 -51
  84. package/components/ai-elements/inline-citation.tsx +0 -296
  85. package/components/ai-elements/jsx-preview.tsx +0 -310
  86. package/components/ai-elements/message.tsx +0 -360
  87. package/components/ai-elements/mic-selector.tsx +0 -375
  88. package/components/ai-elements/model-selector.tsx +0 -213
  89. package/components/ai-elements/node.tsx +0 -71
  90. package/components/ai-elements/open-in-chat.tsx +0 -370
  91. package/components/ai-elements/package-info.tsx +0 -239
  92. package/components/ai-elements/panel.tsx +0 -15
  93. package/components/ai-elements/persona.tsx +0 -306
  94. package/components/ai-elements/plan.tsx +0 -147
  95. package/components/ai-elements/prompt-input.tsx +0 -1463
  96. package/components/ai-elements/queue.tsx +0 -274
  97. package/components/ai-elements/reasoning.tsx +0 -228
  98. package/components/ai-elements/sandbox.tsx +0 -132
  99. package/components/ai-elements/schema-display.tsx +0 -471
  100. package/components/ai-elements/shimmer.tsx +0 -77
  101. package/components/ai-elements/snippet.tsx +0 -145
  102. package/components/ai-elements/sources.tsx +0 -77
  103. package/components/ai-elements/speech-input.tsx +0 -323
  104. package/components/ai-elements/stack-trace.tsx +0 -528
  105. package/components/ai-elements/suggestion.tsx +0 -57
  106. package/components/ai-elements/task.tsx +0 -87
  107. package/components/ai-elements/terminal.tsx +0 -273
  108. package/components/ai-elements/test-results.tsx +0 -496
  109. package/components/ai-elements/tool.tsx +0 -173
  110. package/components/ai-elements/toolbar.tsx +0 -16
  111. package/components/ai-elements/transcription.tsx +0 -125
  112. package/components/ai-elements/voice-selector.tsx +0 -524
  113. package/components/ai-elements/web-preview.tsx +0 -281
@@ -1,426 +0,0 @@
1
- "use client";
2
-
3
- import { Button } from "../ui/button";
4
- import {
5
- HoverCard,
6
- HoverCardContent,
7
- HoverCardTrigger,
8
- } from "../ui/hover-card";
9
- import { cn } from "../../lib/utils";
10
- import type { FileUIPart, SourceDocumentUIPart } from "ai";
11
- import {
12
- FileTextIcon,
13
- GlobeIcon,
14
- ImageIcon,
15
- Music2Icon,
16
- PaperclipIcon,
17
- VideoIcon,
18
- XIcon,
19
- } from "lucide-react";
20
- import type { ComponentProps, HTMLAttributes, ReactNode } from "react";
21
- import { createContext, useCallback, useContext, useMemo } from "react";
22
-
23
- // ============================================================================
24
- // Types
25
- // ============================================================================
26
-
27
- export type AttachmentData =
28
- | (FileUIPart & { id: string })
29
- | (SourceDocumentUIPart & { id: string });
30
-
31
- export type AttachmentMediaCategory =
32
- | "image"
33
- | "video"
34
- | "audio"
35
- | "document"
36
- | "source"
37
- | "unknown";
38
-
39
- export type AttachmentVariant = "grid" | "inline" | "list";
40
-
41
- const mediaCategoryIcons: Record<AttachmentMediaCategory, typeof ImageIcon> = {
42
- audio: Music2Icon,
43
- document: FileTextIcon,
44
- image: ImageIcon,
45
- source: GlobeIcon,
46
- unknown: PaperclipIcon,
47
- video: VideoIcon,
48
- };
49
-
50
- // ============================================================================
51
- // Utility Functions
52
- // ============================================================================
53
-
54
- export const getMediaCategory = (
55
- data: AttachmentData
56
- ): AttachmentMediaCategory => {
57
- if (data.type === "source-document") {
58
- return "source";
59
- }
60
-
61
- const mediaType = data.mediaType ?? "";
62
-
63
- if (mediaType.startsWith("image/")) {
64
- return "image";
65
- }
66
- if (mediaType.startsWith("video/")) {
67
- return "video";
68
- }
69
- if (mediaType.startsWith("audio/")) {
70
- return "audio";
71
- }
72
- if (mediaType.startsWith("application/") || mediaType.startsWith("text/")) {
73
- return "document";
74
- }
75
-
76
- return "unknown";
77
- };
78
-
79
- export const getAttachmentLabel = (data: AttachmentData): string => {
80
- if (data.type === "source-document") {
81
- return data.title || data.filename || "Source";
82
- }
83
-
84
- const category = getMediaCategory(data);
85
- return data.filename || (category === "image" ? "Image" : "Attachment");
86
- };
87
-
88
- const renderAttachmentImage = (
89
- url: string,
90
- filename: string | undefined,
91
- isGrid: boolean
92
- ) =>
93
- isGrid ? (
94
- <img
95
- alt={filename || "Image"}
96
- className="size-full object-cover"
97
- height={96}
98
- src={url}
99
- width={96}
100
- />
101
- ) : (
102
- <img
103
- alt={filename || "Image"}
104
- className="size-full rounded object-cover"
105
- height={20}
106
- src={url}
107
- width={20}
108
- />
109
- );
110
-
111
- // ============================================================================
112
- // Contexts
113
- // ============================================================================
114
-
115
- interface AttachmentsContextValue {
116
- variant: AttachmentVariant;
117
- }
118
-
119
- const AttachmentsContext = createContext<AttachmentsContextValue | null>(null);
120
-
121
- interface AttachmentContextValue {
122
- data: AttachmentData;
123
- mediaCategory: AttachmentMediaCategory;
124
- onRemove?: () => void;
125
- variant: AttachmentVariant;
126
- }
127
-
128
- const AttachmentContext = createContext<AttachmentContextValue | null>(null);
129
-
130
- // ============================================================================
131
- // Hooks
132
- // ============================================================================
133
-
134
- export const useAttachmentsContext = () =>
135
- useContext(AttachmentsContext) ?? { variant: "grid" as const };
136
-
137
- export const useAttachmentContext = () => {
138
- const ctx = useContext(AttachmentContext);
139
- if (!ctx) {
140
- throw new Error("Attachment components must be used within <Attachment>");
141
- }
142
- return ctx;
143
- };
144
-
145
- // ============================================================================
146
- // Attachments - Container
147
- // ============================================================================
148
-
149
- export type AttachmentsProps = HTMLAttributes<HTMLDivElement> & {
150
- variant?: AttachmentVariant;
151
- };
152
-
153
- export const Attachments = ({
154
- variant = "grid",
155
- className,
156
- children,
157
- ...props
158
- }: AttachmentsProps) => {
159
- const contextValue = useMemo(() => ({ variant }), [variant]);
160
-
161
- return (
162
- <AttachmentsContext.Provider value={contextValue}>
163
- <div
164
- className={cn(
165
- "flex items-start",
166
- variant === "list" ? "flex-col gap-2" : "flex-wrap gap-2",
167
- variant === "grid" && "ml-auto w-fit",
168
- className
169
- )}
170
- {...props}
171
- >
172
- {children}
173
- </div>
174
- </AttachmentsContext.Provider>
175
- );
176
- };
177
-
178
- // ============================================================================
179
- // Attachment - Item
180
- // ============================================================================
181
-
182
- export type AttachmentProps = HTMLAttributes<HTMLDivElement> & {
183
- data: AttachmentData;
184
- onRemove?: () => void;
185
- };
186
-
187
- export const Attachment = ({
188
- data,
189
- onRemove,
190
- className,
191
- children,
192
- ...props
193
- }: AttachmentProps) => {
194
- const { variant } = useAttachmentsContext();
195
- const mediaCategory = getMediaCategory(data);
196
-
197
- const contextValue = useMemo<AttachmentContextValue>(
198
- () => ({ data, mediaCategory, onRemove, variant }),
199
- [data, mediaCategory, onRemove, variant]
200
- );
201
-
202
- return (
203
- <AttachmentContext.Provider value={contextValue}>
204
- <div
205
- className={cn(
206
- "group relative",
207
- variant === "grid" && "size-24 overflow-hidden rounded-lg",
208
- variant === "inline" && [
209
- "flex h-8 cursor-pointer select-none items-center gap-1.5",
210
- "rounded-md border border-border px-1.5",
211
- "font-medium text-sm transition-all",
212
- "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
213
- ],
214
- variant === "list" && [
215
- "flex w-full items-center gap-3 rounded-lg border p-3",
216
- "hover:bg-accent/50",
217
- ],
218
- className
219
- )}
220
- {...props}
221
- >
222
- {children}
223
- </div>
224
- </AttachmentContext.Provider>
225
- );
226
- };
227
-
228
- // ============================================================================
229
- // AttachmentPreview - Media preview
230
- // ============================================================================
231
-
232
- export type AttachmentPreviewProps = HTMLAttributes<HTMLDivElement> & {
233
- fallbackIcon?: ReactNode;
234
- };
235
-
236
- export const AttachmentPreview = ({
237
- fallbackIcon,
238
- className,
239
- ...props
240
- }: AttachmentPreviewProps) => {
241
- const { data, mediaCategory, variant } = useAttachmentContext();
242
-
243
- const iconSize = variant === "inline" ? "size-3" : "size-4";
244
-
245
- const renderIcon = (Icon: typeof ImageIcon) => (
246
- <Icon className={cn(iconSize, "text-muted-foreground")} />
247
- );
248
-
249
- const renderContent = () => {
250
- if (mediaCategory === "image" && data.type === "file" && data.url) {
251
- return renderAttachmentImage(data.url, data.filename, variant === "grid");
252
- }
253
-
254
- if (mediaCategory === "video" && data.type === "file" && data.url) {
255
- return <video className="size-full object-cover" muted src={data.url} />;
256
- }
257
-
258
- const Icon = mediaCategoryIcons[mediaCategory];
259
- return fallbackIcon ?? renderIcon(Icon);
260
- };
261
-
262
- return (
263
- <div
264
- className={cn(
265
- "flex shrink-0 items-center justify-center overflow-hidden",
266
- variant === "grid" && "size-full bg-muted",
267
- variant === "inline" && "size-5 rounded bg-background",
268
- variant === "list" && "size-12 rounded bg-muted",
269
- className
270
- )}
271
- {...props}
272
- >
273
- {renderContent()}
274
- </div>
275
- );
276
- };
277
-
278
- // ============================================================================
279
- // AttachmentInfo - Name and type display
280
- // ============================================================================
281
-
282
- export type AttachmentInfoProps = HTMLAttributes<HTMLDivElement> & {
283
- showMediaType?: boolean;
284
- };
285
-
286
- export const AttachmentInfo = ({
287
- showMediaType = false,
288
- className,
289
- ...props
290
- }: AttachmentInfoProps) => {
291
- const { data, variant } = useAttachmentContext();
292
- const label = getAttachmentLabel(data);
293
-
294
- if (variant === "grid") {
295
- return null;
296
- }
297
-
298
- return (
299
- <div className={cn("min-w-0 flex-1", className)} {...props}>
300
- <span className="block truncate">{label}</span>
301
- {showMediaType && data.mediaType && (
302
- <span className="block truncate text-muted-foreground text-xs">
303
- {data.mediaType}
304
- </span>
305
- )}
306
- </div>
307
- );
308
- };
309
-
310
- // ============================================================================
311
- // AttachmentRemove - Remove button
312
- // ============================================================================
313
-
314
- export type AttachmentRemoveProps = ComponentProps<typeof Button> & {
315
- label?: string;
316
- };
317
-
318
- export const AttachmentRemove = ({
319
- label = "Remove",
320
- className,
321
- children,
322
- ...props
323
- }: AttachmentRemoveProps) => {
324
- const { onRemove, variant } = useAttachmentContext();
325
-
326
- const handleClick = useCallback(
327
- (e: React.MouseEvent) => {
328
- e.stopPropagation();
329
- onRemove?.();
330
- },
331
- [onRemove]
332
- );
333
-
334
- if (!onRemove) {
335
- return null;
336
- }
337
-
338
- return (
339
- <Button
340
- aria-label={label}
341
- className={cn(
342
- variant === "grid" && [
343
- "absolute top-2 right-2 size-6 rounded-full p-0",
344
- "bg-background/80 backdrop-blur-sm",
345
- "opacity-0 transition-opacity group-hover:opacity-100",
346
- "hover:bg-background",
347
- "[&>svg]:size-3",
348
- ],
349
- variant === "inline" && [
350
- "size-5 rounded p-0",
351
- "opacity-0 transition-opacity group-hover:opacity-100",
352
- "[&>svg]:size-2.5",
353
- ],
354
- variant === "list" && ["size-8 shrink-0 rounded p-0", "[&>svg]:size-4"],
355
- className
356
- )}
357
- onClick={handleClick}
358
- type="button"
359
- variant="ghost"
360
- {...props}
361
- >
362
- {children ?? <XIcon />}
363
- <span className="sr-only">{label}</span>
364
- </Button>
365
- );
366
- };
367
-
368
- // ============================================================================
369
- // AttachmentHoverCard - Hover preview
370
- // ============================================================================
371
-
372
- export type AttachmentHoverCardProps = ComponentProps<typeof HoverCard>;
373
-
374
- export const AttachmentHoverCard = ({
375
- openDelay = 0,
376
- closeDelay = 0,
377
- ...props
378
- }: AttachmentHoverCardProps) => (
379
- <HoverCard closeDelay={closeDelay} openDelay={openDelay} {...props} />
380
- );
381
-
382
- export type AttachmentHoverCardTriggerProps = ComponentProps<
383
- typeof HoverCardTrigger
384
- >;
385
-
386
- export const AttachmentHoverCardTrigger = (
387
- props: AttachmentHoverCardTriggerProps
388
- ) => <HoverCardTrigger {...props} />;
389
-
390
- export type AttachmentHoverCardContentProps = ComponentProps<
391
- typeof HoverCardContent
392
- >;
393
-
394
- export const AttachmentHoverCardContent = ({
395
- align = "start",
396
- className,
397
- ...props
398
- }: AttachmentHoverCardContentProps) => (
399
- <HoverCardContent
400
- align={align}
401
- className={cn("w-auto p-2", className)}
402
- {...props}
403
- />
404
- );
405
-
406
- // ============================================================================
407
- // AttachmentEmpty - Empty state
408
- // ============================================================================
409
-
410
- export type AttachmentEmptyProps = HTMLAttributes<HTMLDivElement>;
411
-
412
- export const AttachmentEmpty = ({
413
- className,
414
- children,
415
- ...props
416
- }: AttachmentEmptyProps) => (
417
- <div
418
- className={cn(
419
- "flex items-center justify-center p-4 text-muted-foreground text-sm",
420
- className
421
- )}
422
- {...props}
423
- >
424
- {children ?? "No attachments"}
425
- </div>
426
- );
@@ -1,231 +0,0 @@
1
- "use client";
2
-
3
- import { Button } from "../ui/button";
4
- import {
5
- ButtonGroup,
6
- ButtonGroupText,
7
- } from "../ui/button-group";
8
- import { cn } from "../../lib/utils";
9
- import type { Experimental_SpeechResult as SpeechResult } from "ai";
10
- import {
11
- MediaControlBar,
12
- MediaController,
13
- MediaDurationDisplay,
14
- MediaMuteButton,
15
- MediaPlayButton,
16
- MediaSeekBackwardButton,
17
- MediaSeekForwardButton,
18
- MediaTimeDisplay,
19
- MediaTimeRange,
20
- MediaVolumeRange,
21
- } from "media-chrome/react";
22
- import type { ComponentProps, CSSProperties } from "react";
23
-
24
- export type AudioPlayerProps = Omit<
25
- ComponentProps<typeof MediaController>,
26
- "audio"
27
- >;
28
-
29
- export const AudioPlayer = ({
30
- children,
31
- style,
32
- ...props
33
- }: AudioPlayerProps) => (
34
- <MediaController
35
- audio
36
- data-slot="audio-player"
37
- style={
38
- {
39
- "--media-background-color": "transparent",
40
- "--media-button-icon-height": "1rem",
41
- "--media-button-icon-width": "1rem",
42
- "--media-control-background": "transparent",
43
- "--media-control-hover-background": "var(--color-accent)",
44
- "--media-control-padding": "0",
45
- "--media-font": "var(--font-sans)",
46
- "--media-font-size": "10px",
47
- "--media-icon-color": "currentColor",
48
- "--media-preview-time-background": "var(--color-background)",
49
- "--media-preview-time-border-radius": "var(--radius-md)",
50
- "--media-preview-time-text-shadow": "none",
51
- "--media-primary-color": "var(--color-primary)",
52
- "--media-range-bar-color": "var(--color-primary)",
53
- "--media-range-track-background": "var(--color-secondary)",
54
- "--media-secondary-color": "var(--color-secondary)",
55
- "--media-text-color": "var(--color-foreground)",
56
- "--media-tooltip-arrow-display": "none",
57
- "--media-tooltip-background": "var(--color-background)",
58
- "--media-tooltip-border-radius": "var(--radius-md)",
59
- ...style,
60
- } as CSSProperties
61
- }
62
- {...props}
63
- >
64
- {children}
65
- </MediaController>
66
- );
67
-
68
- export type AudioPlayerElementProps = Omit<ComponentProps<"audio">, "src"> &
69
- (
70
- | {
71
- data: SpeechResult["audio"];
72
- }
73
- | {
74
- src: string;
75
- }
76
- );
77
-
78
- export const AudioPlayerElement = ({ ...props }: AudioPlayerElementProps) => (
79
- // oxlint-disable-next-line eslint-plugin-jsx-a11y(media-has-caption) -- audio player captions are provided by consumer
80
- <audio
81
- data-slot="audio-player-element"
82
- slot="media"
83
- src={
84
- "src" in props
85
- ? props.src
86
- : `data:${props.data.mediaType};base64,${props.data.base64}`
87
- }
88
- {...props}
89
- />
90
- );
91
-
92
- export type AudioPlayerControlBarProps = ComponentProps<typeof MediaControlBar>;
93
-
94
- export const AudioPlayerControlBar = ({
95
- children,
96
- ...props
97
- }: AudioPlayerControlBarProps) => (
98
- <MediaControlBar data-slot="audio-player-control-bar" {...props}>
99
- <ButtonGroup orientation="horizontal">{children}</ButtonGroup>
100
- </MediaControlBar>
101
- );
102
-
103
- export type AudioPlayerPlayButtonProps = ComponentProps<typeof MediaPlayButton>;
104
-
105
- export const AudioPlayerPlayButton = ({
106
- className,
107
- ...props
108
- }: AudioPlayerPlayButtonProps) => (
109
- <Button asChild size="icon-sm" variant="outline">
110
- <MediaPlayButton
111
- className={cn("bg-transparent", className)}
112
- data-slot="audio-player-play-button"
113
- {...props}
114
- />
115
- </Button>
116
- );
117
-
118
- export type AudioPlayerSeekBackwardButtonProps = ComponentProps<
119
- typeof MediaSeekBackwardButton
120
- >;
121
-
122
- export const AudioPlayerSeekBackwardButton = ({
123
- seekOffset = 10,
124
- ...props
125
- }: AudioPlayerSeekBackwardButtonProps) => (
126
- <Button asChild size="icon-sm" variant="outline">
127
- <MediaSeekBackwardButton
128
- data-slot="audio-player-seek-backward-button"
129
- seekOffset={seekOffset}
130
- {...props}
131
- />
132
- </Button>
133
- );
134
-
135
- export type AudioPlayerSeekForwardButtonProps = ComponentProps<
136
- typeof MediaSeekForwardButton
137
- >;
138
-
139
- export const AudioPlayerSeekForwardButton = ({
140
- seekOffset = 10,
141
- ...props
142
- }: AudioPlayerSeekForwardButtonProps) => (
143
- <Button asChild size="icon-sm" variant="outline">
144
- <MediaSeekForwardButton
145
- data-slot="audio-player-seek-forward-button"
146
- seekOffset={seekOffset}
147
- {...props}
148
- />
149
- </Button>
150
- );
151
-
152
- export type AudioPlayerTimeDisplayProps = ComponentProps<
153
- typeof MediaTimeDisplay
154
- >;
155
-
156
- export const AudioPlayerTimeDisplay = ({
157
- className,
158
- ...props
159
- }: AudioPlayerTimeDisplayProps) => (
160
- <ButtonGroupText asChild className="bg-transparent">
161
- <MediaTimeDisplay
162
- className={cn("tabular-nums", className)}
163
- data-slot="audio-player-time-display"
164
- {...props}
165
- />
166
- </ButtonGroupText>
167
- );
168
-
169
- export type AudioPlayerTimeRangeProps = ComponentProps<typeof MediaTimeRange>;
170
-
171
- export const AudioPlayerTimeRange = ({
172
- className,
173
- ...props
174
- }: AudioPlayerTimeRangeProps) => (
175
- <ButtonGroupText asChild className="bg-transparent">
176
- <MediaTimeRange
177
- className={cn("", className)}
178
- data-slot="audio-player-time-range"
179
- {...props}
180
- />
181
- </ButtonGroupText>
182
- );
183
-
184
- export type AudioPlayerDurationDisplayProps = ComponentProps<
185
- typeof MediaDurationDisplay
186
- >;
187
-
188
- export const AudioPlayerDurationDisplay = ({
189
- className,
190
- ...props
191
- }: AudioPlayerDurationDisplayProps) => (
192
- <ButtonGroupText asChild className="bg-transparent">
193
- <MediaDurationDisplay
194
- className={cn("tabular-nums", className)}
195
- data-slot="audio-player-duration-display"
196
- {...props}
197
- />
198
- </ButtonGroupText>
199
- );
200
-
201
- export type AudioPlayerMuteButtonProps = ComponentProps<typeof MediaMuteButton>;
202
-
203
- export const AudioPlayerMuteButton = ({
204
- className,
205
- ...props
206
- }: AudioPlayerMuteButtonProps) => (
207
- <ButtonGroupText asChild className="bg-transparent">
208
- <MediaMuteButton
209
- className={cn("", className)}
210
- data-slot="audio-player-mute-button"
211
- {...props}
212
- />
213
- </ButtonGroupText>
214
- );
215
-
216
- export type AudioPlayerVolumeRangeProps = ComponentProps<
217
- typeof MediaVolumeRange
218
- >;
219
-
220
- export const AudioPlayerVolumeRange = ({
221
- className,
222
- ...props
223
- }: AudioPlayerVolumeRangeProps) => (
224
- <ButtonGroupText asChild className="bg-transparent">
225
- <MediaVolumeRange
226
- className={cn("", className)}
227
- data-slot="audio-player-volume-range"
228
- {...props}
229
- />
230
- </ButtonGroupText>
231
- );
@@ -1,26 +0,0 @@
1
- import type { ReactFlowProps } from "@xyflow/react";
2
- import { Background, ReactFlow } from "@xyflow/react";
3
- import type { ReactNode } from "react";
4
-
5
- import "@xyflow/react/dist/style.css";
6
-
7
- type CanvasProps = ReactFlowProps & {
8
- children?: ReactNode;
9
- };
10
-
11
- const deleteKeyCode = ["Backspace", "Delete"];
12
-
13
- export const Canvas = ({ children, ...props }: CanvasProps) => (
14
- <ReactFlow
15
- deleteKeyCode={deleteKeyCode}
16
- fitView
17
- panOnDrag={false}
18
- panOnScroll
19
- selectionOnDrag={true}
20
- zoomOnDoubleClick={false}
21
- {...props}
22
- >
23
- <Background bgColor="var(--sidebar)" />
24
- {children}
25
- </ReactFlow>
26
- );