@vvedantb/ui 0.1.0 → 0.1.2

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 (74) hide show
  1. package/LICENSE +21 -21
  2. package/package.json +3 -2
  3. package/src/ai-elements/artifact.tsx +99 -99
  4. package/src/ai-elements/attachments.tsx +366 -366
  5. package/src/ai-elements/chain-of-thought.tsx +212 -212
  6. package/src/ai-elements/code-block.tsx +478 -478
  7. package/src/ai-elements/conversation.tsx +157 -157
  8. package/src/ai-elements/image.tsx +25 -25
  9. package/src/ai-elements/inline-citation.tsx +252 -252
  10. package/src/ai-elements/message.tsx +269 -269
  11. package/src/ai-elements/model-selector.tsx +211 -211
  12. package/src/ai-elements/prompt-input.tsx +1018 -1018
  13. package/src/ai-elements/queue.tsx +251 -251
  14. package/src/ai-elements/reasoning.tsx +178 -178
  15. package/src/ai-elements/shimmer.tsx +56 -56
  16. package/src/ai-elements/sources.tsx +77 -77
  17. package/src/ai-elements/speech-input.tsx +290 -290
  18. package/src/ai-elements/suggestion.tsx +191 -191
  19. package/src/css.d.ts +2 -2
  20. package/src/index.ts +96 -96
  21. package/src/motion/presets.ts +35 -35
  22. package/src/motion/presets.vibot.ts +105 -105
  23. package/src/ui/_menu-classes.ts +30 -30
  24. package/src/ui/_menu-classes.vibot.ts +33 -33
  25. package/src/ui/accordion.tsx +81 -81
  26. package/src/ui/accordion.verve.tsx +56 -56
  27. package/src/ui/badge.tsx +34 -34
  28. package/src/ui/breadcrumb.tsx +83 -83
  29. package/src/ui/button-group.tsx +84 -84
  30. package/src/ui/button.tsx +57 -57
  31. package/src/ui/card.tsx +27 -27
  32. package/src/ui/carousel.tsx +211 -211
  33. package/src/ui/checkbox.tsx +27 -27
  34. package/src/ui/clear-input.tsx +170 -170
  35. package/src/ui/clear-input.vibot.tsx +76 -76
  36. package/src/ui/clearInputDissolve.ts +214 -214
  37. package/src/ui/collapsible.tsx +7 -7
  38. package/src/ui/command.tsx +148 -148
  39. package/src/ui/context-menu.tsx +173 -173
  40. package/src/ui/dialog.tsx +149 -149
  41. package/src/ui/dropdown-menu.tsx +178 -178
  42. package/src/ui/hover-card.tsx +31 -31
  43. package/src/ui/input-group.tsx +162 -162
  44. package/src/ui/input-group.verve.tsx +150 -150
  45. package/src/ui/input.tsx +21 -21
  46. package/src/ui/kbd.tsx +18 -18
  47. package/src/ui/label.tsx +20 -20
  48. package/src/ui/labeled-switch-row.tsx +53 -53
  49. package/src/ui/modalTransition.ts +85 -85
  50. package/src/ui/pagination.tsx +47 -47
  51. package/src/ui/popover.tsx +33 -33
  52. package/src/ui/progress.tsx +25 -25
  53. package/src/ui/radix-select.tsx +202 -202
  54. package/src/ui/scroll-area.tsx +55 -55
  55. package/src/ui/scroll-area.verve.tsx +43 -43
  56. package/src/ui/search-input.tsx +29 -29
  57. package/src/ui/select.tsx +163 -163
  58. package/src/ui/separator.tsx +28 -28
  59. package/src/ui/sheet.tsx +87 -87
  60. package/src/ui/skeleton.tsx +18 -18
  61. package/src/ui/sonner.css +16 -16
  62. package/src/ui/sonner.tsx +47 -47
  63. package/src/ui/spinner.tsx +27 -27
  64. package/src/ui/surface-classes.ts +55 -55
  65. package/src/ui/switch.tsx +26 -26
  66. package/src/ui/table.tsx +123 -123
  67. package/src/ui/tabs.tsx +140 -140
  68. package/src/ui/tabsSliding.ts +56 -56
  69. package/src/ui/textarea.tsx +21 -21
  70. package/src/ui/time-picker.tsx +170 -170
  71. package/src/ui/tooltip.tsx +25 -25
  72. package/src/ui/visually-hidden.tsx +3 -3
  73. package/src/utils/cn.ts +16 -16
  74. package/src/utils/ref.ts +10 -10
@@ -1,211 +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
- );
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
+ );