@vvedantb/ui 0.0.0-stage → 0.1.1

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 (75) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +124 -4
  3. package/src/ai-elements/artifact.tsx +99 -0
  4. package/src/ai-elements/attachments.tsx +366 -0
  5. package/src/ai-elements/chain-of-thought.tsx +212 -0
  6. package/src/ai-elements/code-block.tsx +478 -0
  7. package/src/ai-elements/conversation.tsx +157 -0
  8. package/src/ai-elements/image.tsx +25 -0
  9. package/src/ai-elements/inline-citation.tsx +252 -0
  10. package/src/ai-elements/message.tsx +269 -0
  11. package/src/ai-elements/model-selector.tsx +211 -0
  12. package/src/ai-elements/prompt-input.tsx +1018 -0
  13. package/src/ai-elements/queue.tsx +251 -0
  14. package/src/ai-elements/reasoning.tsx +178 -0
  15. package/src/ai-elements/shimmer.tsx +56 -0
  16. package/src/ai-elements/sources.tsx +77 -0
  17. package/src/ai-elements/speech-input.tsx +290 -0
  18. package/src/ai-elements/suggestion.tsx +191 -0
  19. package/src/css.d.ts +2 -0
  20. package/src/index.ts +96 -0
  21. package/src/motion/presets.ts +35 -0
  22. package/src/motion/presets.vibot.ts +105 -0
  23. package/src/ui/_menu-classes.ts +30 -0
  24. package/src/ui/_menu-classes.vibot.ts +33 -0
  25. package/src/ui/accordion.tsx +81 -0
  26. package/src/ui/accordion.verve.tsx +56 -0
  27. package/src/ui/badge.tsx +34 -0
  28. package/src/ui/breadcrumb.tsx +83 -0
  29. package/src/ui/button-group.tsx +84 -0
  30. package/src/ui/button.tsx +57 -0
  31. package/src/ui/card.tsx +27 -0
  32. package/src/ui/carousel.tsx +211 -0
  33. package/src/ui/checkbox.tsx +27 -0
  34. package/src/ui/clear-input.tsx +170 -0
  35. package/src/ui/clear-input.vibot.tsx +76 -0
  36. package/src/ui/clearInputDissolve.ts +214 -0
  37. package/src/ui/collapsible.tsx +7 -0
  38. package/src/ui/command.tsx +148 -0
  39. package/src/ui/context-menu.tsx +173 -0
  40. package/src/ui/dialog.tsx +149 -0
  41. package/src/ui/dropdown-menu.tsx +178 -0
  42. package/src/ui/hover-card.tsx +31 -0
  43. package/src/ui/input-group.tsx +162 -0
  44. package/src/ui/input-group.verve.tsx +150 -0
  45. package/src/ui/input.tsx +21 -0
  46. package/src/ui/kbd.tsx +18 -0
  47. package/src/ui/label.tsx +20 -0
  48. package/src/ui/labeled-switch-row.tsx +53 -0
  49. package/src/ui/modalTransition.ts +85 -0
  50. package/src/ui/pagination.tsx +47 -0
  51. package/src/ui/popover.tsx +33 -0
  52. package/src/ui/progress.tsx +25 -0
  53. package/src/ui/radix-select.tsx +202 -0
  54. package/src/ui/scroll-area.tsx +55 -0
  55. package/src/ui/scroll-area.verve.tsx +43 -0
  56. package/src/ui/search-input.tsx +29 -0
  57. package/src/ui/select.tsx +163 -0
  58. package/src/ui/separator.tsx +28 -0
  59. package/src/ui/sheet.tsx +87 -0
  60. package/src/ui/skeleton.tsx +18 -0
  61. package/src/ui/sonner.css +16 -0
  62. package/src/ui/sonner.tsx +47 -0
  63. package/src/ui/spinner.tsx +27 -0
  64. package/src/ui/surface-classes.ts +55 -0
  65. package/src/ui/switch.tsx +26 -0
  66. package/src/ui/table.tsx +123 -0
  67. package/src/ui/tabs.tsx +140 -0
  68. package/src/ui/tabsSliding.ts +56 -0
  69. package/src/ui/textarea.tsx +21 -0
  70. package/src/ui/time-picker.tsx +170 -0
  71. package/src/ui/tooltip.tsx +25 -0
  72. package/src/ui/visually-hidden.tsx +3 -0
  73. package/src/utils/cn.ts +16 -0
  74. package/src/utils/ref.ts +10 -0
  75. package/README.md +0 -3
@@ -0,0 +1,211 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+
3
+ import {
4
+ Command,
5
+ CommandDialog,
6
+ CommandEmpty,
7
+ CommandGroup,
8
+ CommandInput,
9
+ CommandItem,
10
+ CommandList,
11
+ CommandSeparator,
12
+ CommandShortcut,
13
+ } from "../ui/command";
14
+ import {
15
+ Dialog,
16
+ DialogContent,
17
+ DialogTitle,
18
+ DialogTrigger,
19
+ } from "../ui/dialog";
20
+ import { cn } from "../utils/cn";
21
+
22
+ export type ModelSelectorProps = ComponentProps<typeof Dialog>;
23
+
24
+ export const ModelSelector = (props: ModelSelectorProps) => (
25
+ <Dialog {...props} />
26
+ );
27
+
28
+ export type ModelSelectorTriggerProps = ComponentProps<typeof DialogTrigger>;
29
+
30
+ export const ModelSelectorTrigger = (props: ModelSelectorTriggerProps) => (
31
+ <DialogTrigger {...props} />
32
+ );
33
+
34
+ export type ModelSelectorContentProps = ComponentProps<typeof DialogContent> & {
35
+ title?: ReactNode;
36
+ };
37
+
38
+ export const ModelSelectorContent = ({
39
+ className,
40
+ children,
41
+ title = "Model Selector",
42
+ ...props
43
+ }: ModelSelectorContentProps) => (
44
+ <DialogContent
45
+ aria-describedby={undefined}
46
+ className={cn("border-0 p-0", className)}
47
+ {...props}
48
+ >
49
+ <DialogTitle className="sr-only">{title}</DialogTitle>
50
+ <Command className="data-[slot=command-input-wrapper]:**:h-auto">
51
+ {children}
52
+ </Command>
53
+ </DialogContent>
54
+ );
55
+
56
+ export type ModelSelectorDialogProps = ComponentProps<typeof CommandDialog>;
57
+
58
+ export const ModelSelectorDialog = (props: ModelSelectorDialogProps) => (
59
+ <CommandDialog {...props} />
60
+ );
61
+
62
+ export type ModelSelectorInputProps = ComponentProps<typeof CommandInput>;
63
+
64
+ export const ModelSelectorInput = ({
65
+ className,
66
+ ...props
67
+ }: ModelSelectorInputProps) => (
68
+ <CommandInput className={cn("h-auto py-3.5", className)} {...props} />
69
+ );
70
+
71
+ export type ModelSelectorListProps = ComponentProps<typeof CommandList>;
72
+
73
+ export const ModelSelectorList = (props: ModelSelectorListProps) => (
74
+ <CommandList {...props} />
75
+ );
76
+
77
+ export type ModelSelectorEmptyProps = ComponentProps<typeof CommandEmpty>;
78
+
79
+ export const ModelSelectorEmpty = (props: ModelSelectorEmptyProps) => (
80
+ <CommandEmpty {...props} />
81
+ );
82
+
83
+ export type ModelSelectorGroupProps = ComponentProps<typeof CommandGroup>;
84
+
85
+ export const ModelSelectorGroup = (props: ModelSelectorGroupProps) => (
86
+ <CommandGroup {...props} />
87
+ );
88
+
89
+ export type ModelSelectorItemProps = ComponentProps<typeof CommandItem>;
90
+
91
+ export const ModelSelectorItem = (props: ModelSelectorItemProps) => (
92
+ <CommandItem {...props} />
93
+ );
94
+
95
+ export type ModelSelectorShortcutProps = ComponentProps<typeof CommandShortcut>;
96
+
97
+ export const ModelSelectorShortcut = (props: ModelSelectorShortcutProps) => (
98
+ <CommandShortcut {...props} />
99
+ );
100
+
101
+ export type ModelSelectorSeparatorProps = ComponentProps<
102
+ typeof CommandSeparator
103
+ >;
104
+
105
+ export const ModelSelectorSeparator = (props: ModelSelectorSeparatorProps) => (
106
+ <CommandSeparator {...props} />
107
+ );
108
+
109
+ export type ModelSelectorLogoProps = Omit<
110
+ ComponentProps<"img">,
111
+ "src" | "alt"
112
+ > & {
113
+ provider:
114
+ | "moonshotai-cn"
115
+ | "lucidquery"
116
+ | "moonshotai"
117
+ | "zai-coding-plan"
118
+ | "alibaba"
119
+ | "xai"
120
+ | "vultr"
121
+ | "nvidia"
122
+ | "upstage"
123
+ | "groq"
124
+ | "github-copilot"
125
+ | "mistral"
126
+ | "vercel"
127
+ | "nebius"
128
+ | "deepseek"
129
+ | "alibaba-cn"
130
+ | "google-vertex-anthropic"
131
+ | "venice"
132
+ | "chutes"
133
+ | "cortecs"
134
+ | "github-models"
135
+ | "togetherai"
136
+ | "azure"
137
+ | "baseten"
138
+ | "huggingface"
139
+ | "opencode"
140
+ | "fastrouter"
141
+ | "google"
142
+ | "google-vertex"
143
+ | "cloudflare-workers-ai"
144
+ | "inception"
145
+ | "wandb"
146
+ | "openai"
147
+ | "zhipuai-coding-plan"
148
+ | "perplexity"
149
+ | "openrouter"
150
+ | "zenmux"
151
+ | "v0"
152
+ | "iflowcn"
153
+ | "synthetic"
154
+ | "deepinfra"
155
+ | "zhipuai"
156
+ | "submodel"
157
+ | "zai"
158
+ | "inference"
159
+ | "requesty"
160
+ | "morph"
161
+ | "lmstudio"
162
+ | "anthropic"
163
+ | "aihubmix"
164
+ | "fireworks-ai"
165
+ | "modelscope"
166
+ | "llama"
167
+ | "scaleway"
168
+ | "amazon-bedrock"
169
+ | "cerebras"
170
+ // oxlint-disable-next-line typescript-eslint(ban-types) -- intentional pattern for autocomplete-friendly string union
171
+ | (string & {});
172
+ };
173
+
174
+ export const ModelSelectorLogo = ({
175
+ provider,
176
+ className,
177
+ ...props
178
+ }: ModelSelectorLogoProps) => (
179
+ <img
180
+ {...props}
181
+ alt={`${provider} logo`}
182
+ className={cn("size-3 dark:invert", className)}
183
+ height={12}
184
+ src={`https://models.dev/logos/${provider}.svg`}
185
+ width={12}
186
+ />
187
+ );
188
+
189
+ export type ModelSelectorLogoGroupProps = ComponentProps<"div">;
190
+
191
+ export const ModelSelectorLogoGroup = ({
192
+ className,
193
+ ...props
194
+ }: ModelSelectorLogoGroupProps) => (
195
+ <div
196
+ className={cn(
197
+ "flex shrink-0 items-center -space-x-1 [&>img]:rounded-full [&>img]:bg-surface [&>img]:p-px dark:[&>img]:bg-foreground",
198
+ className,
199
+ )}
200
+ {...props}
201
+ />
202
+ );
203
+
204
+ export type ModelSelectorNameProps = ComponentProps<"span">;
205
+
206
+ export const ModelSelectorName = ({
207
+ className,
208
+ ...props
209
+ }: ModelSelectorNameProps) => (
210
+ <span className={cn("flex-1 truncate text-left", className)} {...props} />
211
+ );