@timbal-ai/timbal-react 0.8.2 → 1.0.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.
@@ -1,435 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-QVAUCVQA.esm.js";
4
-
5
- // src/ui/dropdown-menu.tsx
6
- import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
7
- import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
- function DropdownMenu({
10
- ...props
11
- }) {
12
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
13
- }
14
- function DropdownMenuTrigger({
15
- ...props
16
- }) {
17
- return /* @__PURE__ */ jsx(
18
- DropdownMenuPrimitive.Trigger,
19
- {
20
- "data-slot": "dropdown-menu-trigger",
21
- ...props
22
- }
23
- );
24
- }
25
- function DropdownMenuGroup({
26
- ...props
27
- }) {
28
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
29
- }
30
- function DropdownMenuContent({
31
- className,
32
- sideOffset = 4,
33
- ...props
34
- }) {
35
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
36
- DropdownMenuPrimitive.Content,
37
- {
38
- "data-slot": "dropdown-menu-content",
39
- sideOffset,
40
- className: cn(
41
- "bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-[80] max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] origin-[var(--radix-dropdown-menu-content-transform-origin)] overflow-x-hidden overflow-y-auto rounded-lg border border-border p-1 shadow-card",
42
- className
43
- ),
44
- ...props
45
- }
46
- ) });
47
- }
48
- function DropdownMenuItem({
49
- className,
50
- inset,
51
- variant = "default",
52
- ...props
53
- }) {
54
- return /* @__PURE__ */ jsx(
55
- DropdownMenuPrimitive.Item,
56
- {
57
- "data-slot": "dropdown-menu-item",
58
- "data-inset": inset,
59
- "data-variant": variant,
60
- className: cn(
61
- "relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
62
- className
63
- ),
64
- ...props
65
- }
66
- );
67
- }
68
- function DropdownMenuCheckboxItem({
69
- className,
70
- children,
71
- checked,
72
- ...props
73
- }) {
74
- return /* @__PURE__ */ jsxs(
75
- DropdownMenuPrimitive.CheckboxItem,
76
- {
77
- "data-slot": "dropdown-menu-checkbox-item",
78
- className: cn(
79
- "relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
80
- className
81
- ),
82
- checked,
83
- ...props,
84
- children: [
85
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
86
- children
87
- ]
88
- }
89
- );
90
- }
91
- function DropdownMenuRadioGroup({
92
- ...props
93
- }) {
94
- return /* @__PURE__ */ jsx(
95
- DropdownMenuPrimitive.RadioGroup,
96
- {
97
- "data-slot": "dropdown-menu-radio-group",
98
- ...props
99
- }
100
- );
101
- }
102
- function DropdownMenuRadioItem({
103
- className,
104
- children,
105
- ...props
106
- }) {
107
- return /* @__PURE__ */ jsxs(
108
- DropdownMenuPrimitive.RadioItem,
109
- {
110
- "data-slot": "dropdown-menu-radio-item",
111
- className: cn(
112
- "relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
113
- className
114
- ),
115
- ...props,
116
- children: [
117
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
118
- children
119
- ]
120
- }
121
- );
122
- }
123
- function DropdownMenuLabel({
124
- className,
125
- inset,
126
- ...props
127
- }) {
128
- return /* @__PURE__ */ jsx(
129
- DropdownMenuPrimitive.Label,
130
- {
131
- "data-slot": "dropdown-menu-label",
132
- "data-inset": inset,
133
- className: cn(
134
- "px-2 py-1.5 text-xs font-medium text-muted-foreground data-[inset]:pl-8",
135
- className
136
- ),
137
- ...props
138
- }
139
- );
140
- }
141
- function DropdownMenuSeparator({
142
- className,
143
- ...props
144
- }) {
145
- return /* @__PURE__ */ jsx(
146
- DropdownMenuPrimitive.Separator,
147
- {
148
- "data-slot": "dropdown-menu-separator",
149
- className: cn("-mx-1 my-1 h-px bg-border", className),
150
- ...props
151
- }
152
- );
153
- }
154
- function DropdownMenuShortcut({
155
- className,
156
- ...props
157
- }) {
158
- return /* @__PURE__ */ jsx(
159
- "span",
160
- {
161
- "data-slot": "dropdown-menu-shortcut",
162
- className: cn(
163
- "ml-auto text-xs tracking-widest text-muted-foreground",
164
- className
165
- ),
166
- ...props
167
- }
168
- );
169
- }
170
- function DropdownMenuSub({
171
- ...props
172
- }) {
173
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
174
- }
175
- function DropdownMenuSubTrigger({
176
- className,
177
- inset,
178
- children,
179
- ...props
180
- }) {
181
- return /* @__PURE__ */ jsxs(
182
- DropdownMenuPrimitive.SubTrigger,
183
- {
184
- "data-slot": "dropdown-menu-sub-trigger",
185
- "data-inset": inset,
186
- className: cn(
187
- "flex cursor-default items-center rounded-md px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground data-[inset]:pl-8",
188
- className
189
- ),
190
- ...props,
191
- children: [
192
- children,
193
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
194
- ]
195
- }
196
- );
197
- }
198
- function DropdownMenuSubContent({
199
- className,
200
- ...props
201
- }) {
202
- return /* @__PURE__ */ jsx(
203
- DropdownMenuPrimitive.SubContent,
204
- {
205
- "data-slot": "dropdown-menu-sub-content",
206
- className: cn(
207
- "bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-[80] min-w-[8rem] origin-[var(--radix-dropdown-menu-content-transform-origin)] overflow-hidden rounded-lg border border-border p-1 shadow-card",
208
- className
209
- ),
210
- ...props
211
- }
212
- );
213
- }
214
-
215
- // src/ui/popover.tsx
216
- import { Popover as PopoverPrimitive } from "radix-ui";
217
- import { jsx as jsx2 } from "react/jsx-runtime";
218
- function Popover({
219
- ...props
220
- }) {
221
- return /* @__PURE__ */ jsx2(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
222
- }
223
- function PopoverTrigger({
224
- ...props
225
- }) {
226
- return /* @__PURE__ */ jsx2(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
227
- }
228
- function PopoverAnchor({
229
- ...props
230
- }) {
231
- return /* @__PURE__ */ jsx2(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
232
- }
233
- function PopoverContent({
234
- className,
235
- align = "center",
236
- sideOffset = 4,
237
- ...props
238
- }) {
239
- return /* @__PURE__ */ jsx2(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx2(
240
- PopoverPrimitive.Content,
241
- {
242
- "data-slot": "popover-content",
243
- align,
244
- sideOffset,
245
- className: cn(
246
- "bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-[80] w-72 origin-[var(--radix-popover-content-transform-origin)] rounded-xl border border-border p-4 shadow-card outline-hidden",
247
- className
248
- ),
249
- ...props
250
- }
251
- ) });
252
- }
253
-
254
- // src/ui/select.tsx
255
- import { Select as SelectPrimitive } from "radix-ui";
256
- import { CheckIcon as CheckIcon2, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
257
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
258
- function Select({
259
- ...props
260
- }) {
261
- return /* @__PURE__ */ jsx3(SelectPrimitive.Root, { "data-slot": "select", ...props });
262
- }
263
- function SelectGroup({
264
- ...props
265
- }) {
266
- return /* @__PURE__ */ jsx3(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
267
- }
268
- function SelectValue({
269
- ...props
270
- }) {
271
- return /* @__PURE__ */ jsx3(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
272
- }
273
- function SelectTrigger({
274
- className,
275
- size = "default",
276
- children,
277
- ...props
278
- }) {
279
- return /* @__PURE__ */ jsxs2(
280
- SelectPrimitive.Trigger,
281
- {
282
- "data-slot": "select-trigger",
283
- "data-size": size,
284
- className: cn(
285
- "flex w-fit items-center justify-between gap-2 rounded-lg border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
286
- className
287
- ),
288
- ...props,
289
- children: [
290
- children,
291
- /* @__PURE__ */ jsx3(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx3(ChevronDownIcon, { className: "size-4 opacity-50" }) })
292
- ]
293
- }
294
- );
295
- }
296
- function SelectContent({
297
- className,
298
- children,
299
- position = "popper",
300
- ...props
301
- }) {
302
- return /* @__PURE__ */ jsx3(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs2(
303
- SelectPrimitive.Content,
304
- {
305
- "data-slot": "select-content",
306
- className: cn(
307
- "bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-[80] max-h-[var(--radix-select-content-available-height)] min-w-[8rem] origin-[var(--radix-select-content-transform-origin)] overflow-x-hidden overflow-y-auto rounded-lg border border-border shadow-card",
308
- position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
309
- className
310
- ),
311
- position,
312
- ...props,
313
- children: [
314
- /* @__PURE__ */ jsx3(SelectScrollUpButton, {}),
315
- /* @__PURE__ */ jsx3(
316
- SelectPrimitive.Viewport,
317
- {
318
- className: cn(
319
- "p-1",
320
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
321
- ),
322
- children
323
- }
324
- ),
325
- /* @__PURE__ */ jsx3(SelectScrollDownButton, {})
326
- ]
327
- }
328
- ) });
329
- }
330
- function SelectLabel({
331
- className,
332
- ...props
333
- }) {
334
- return /* @__PURE__ */ jsx3(
335
- SelectPrimitive.Label,
336
- {
337
- "data-slot": "select-label",
338
- className: cn("px-2 py-1.5 text-xs font-medium text-muted-foreground", className),
339
- ...props
340
- }
341
- );
342
- }
343
- function SelectItem({
344
- className,
345
- children,
346
- ...props
347
- }) {
348
- return /* @__PURE__ */ jsxs2(
349
- SelectPrimitive.Item,
350
- {
351
- "data-slot": "select-item",
352
- className: cn(
353
- "relative flex w-full cursor-default items-center gap-2 rounded-md py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
354
- className
355
- ),
356
- ...props,
357
- children: [
358
- /* @__PURE__ */ jsx3("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx3(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx3(CheckIcon2, { className: "size-4" }) }) }),
359
- /* @__PURE__ */ jsx3(SelectPrimitive.ItemText, { children })
360
- ]
361
- }
362
- );
363
- }
364
- function SelectSeparator({
365
- className,
366
- ...props
367
- }) {
368
- return /* @__PURE__ */ jsx3(
369
- SelectPrimitive.Separator,
370
- {
371
- "data-slot": "select-separator",
372
- className: cn("-mx-1 my-1 h-px bg-border", className),
373
- ...props
374
- }
375
- );
376
- }
377
- function SelectScrollUpButton({
378
- className,
379
- ...props
380
- }) {
381
- return /* @__PURE__ */ jsx3(
382
- SelectPrimitive.ScrollUpButton,
383
- {
384
- "data-slot": "select-scroll-up-button",
385
- className: cn("flex cursor-default items-center justify-center py-1", className),
386
- ...props,
387
- children: /* @__PURE__ */ jsx3(ChevronUpIcon, { className: "size-4" })
388
- }
389
- );
390
- }
391
- function SelectScrollDownButton({
392
- className,
393
- ...props
394
- }) {
395
- return /* @__PURE__ */ jsx3(
396
- SelectPrimitive.ScrollDownButton,
397
- {
398
- "data-slot": "select-scroll-down-button",
399
- className: cn("flex cursor-default items-center justify-center py-1", className),
400
- ...props,
401
- children: /* @__PURE__ */ jsx3(ChevronDownIcon, { className: "size-4" })
402
- }
403
- );
404
- }
405
-
406
- export {
407
- DropdownMenu,
408
- DropdownMenuTrigger,
409
- DropdownMenuGroup,
410
- DropdownMenuContent,
411
- DropdownMenuItem,
412
- DropdownMenuCheckboxItem,
413
- DropdownMenuRadioGroup,
414
- DropdownMenuRadioItem,
415
- DropdownMenuLabel,
416
- DropdownMenuSeparator,
417
- DropdownMenuShortcut,
418
- DropdownMenuSub,
419
- DropdownMenuSubTrigger,
420
- DropdownMenuSubContent,
421
- Popover,
422
- PopoverTrigger,
423
- PopoverAnchor,
424
- PopoverContent,
425
- Select,
426
- SelectGroup,
427
- SelectValue,
428
- SelectTrigger,
429
- SelectContent,
430
- SelectLabel,
431
- SelectItem,
432
- SelectSeparator,
433
- SelectScrollUpButton,
434
- SelectScrollDownButton
435
- };