@conscia-labs/design-system 0.3.5 → 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,957 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-JU5DQXFC.js";
4
-
5
- // src/primitives/button.tsx
6
- import { Slot } from "@radix-ui/react-slot";
7
- import { cva } from "class-variance-authority";
8
- import { jsx } from "react/jsx-runtime";
9
- var buttonVariants = cva(
10
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
11
- {
12
- variants: {
13
- variant: {
14
- default: "bg-primary text-primary-foreground shadow-xs hover:bg-accent-hover active:bg-accent-active",
15
- destructive: "bg-danger text-white shadow-xs hover:bg-danger/90 focus-visible:ring-danger/20 dark:bg-danger-background dark:text-danger-foreground dark:hover:bg-danger-border dark:focus-visible:ring-danger/40",
16
- outline: "border border-border-default bg-surface-control text-foreground shadow-xs hover:bg-surface-control-hover hover:text-foreground",
17
- secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
18
- ghost: "text-foreground hover:bg-surface-muted hover:text-foreground",
19
- link: "text-text-link underline-offset-4 hover:underline"
20
- },
21
- size: {
22
- default: "h-[var(--ds-control-height)] px-3 py-2 has-[>svg]:px-3",
23
- sm: "h-[var(--ds-control-height-sm)] rounded-md gap-1.5 px-2.5 has-[>svg]:px-2",
24
- lg: "h-[var(--ds-control-height-lg)] rounded-md px-4 has-[>svg]:px-3.5",
25
- icon: "size-[var(--ds-control-height)]"
26
- }
27
- },
28
- defaultVariants: {
29
- variant: "default",
30
- size: "default"
31
- }
32
- }
33
- );
34
- function Button({
35
- className,
36
- variant,
37
- size,
38
- asChild = false,
39
- type,
40
- ...props
41
- }) {
42
- const Comp = asChild ? Slot : "button";
43
- return /* @__PURE__ */ jsx(
44
- Comp,
45
- {
46
- "data-slot": "button",
47
- type: asChild ? void 0 : type ?? "button",
48
- className: cn(buttonVariants({ variant, size, className })),
49
- ...props
50
- }
51
- );
52
- }
53
-
54
- // src/primitives/checkbox.tsx
55
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
56
- import { CheckIcon } from "lucide-react";
57
- import { jsx as jsx2 } from "react/jsx-runtime";
58
- function Checkbox({
59
- className,
60
- ...props
61
- }) {
62
- return /* @__PURE__ */ jsx2(
63
- CheckboxPrimitive.Root,
64
- {
65
- "data-slot": "checkbox",
66
- className: cn(
67
- "peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-danger aria-invalid:ring-danger/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-danger/40 dark:data-[state=checked]:bg-primary",
68
- className
69
- ),
70
- ...props,
71
- children: /* @__PURE__ */ jsx2(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center text-current transition-none", children: /* @__PURE__ */ jsx2(CheckIcon, { className: "size-3.5" }) })
72
- }
73
- );
74
- }
75
-
76
- // src/primitives/table.tsx
77
- import { jsx as jsx3 } from "react/jsx-runtime";
78
- function Table({ className, ...props }) {
79
- return /* @__PURE__ */ jsx3("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: /* @__PURE__ */ jsx3("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props }) });
80
- }
81
- function TableHeader({ className, ...props }) {
82
- return /* @__PURE__ */ jsx3("thead", { "data-slot": "table-header", className: cn("[&_tr]:border-b [&_tr]:border-border-subtle", className), ...props });
83
- }
84
- function TableBody({ className, ...props }) {
85
- return /* @__PURE__ */ jsx3("tbody", { "data-slot": "table-body", className: cn("[&_tr:last-child]:border-0", className), ...props });
86
- }
87
- function TableRow({ className, ...props }) {
88
- return /* @__PURE__ */ jsx3(
89
- "tr",
90
- {
91
- "data-slot": "table-row",
92
- className: cn("h-[var(--ds-row-height)] border-b border-border-subtle transition-colors hover:bg-surface-muted/70 data-[state=selected]:bg-accent-background", className),
93
- ...props
94
- }
95
- );
96
- }
97
- function TableHead({ className, ...props }) {
98
- return /* @__PURE__ */ jsx3(
99
- "th",
100
- {
101
- "data-slot": "table-head",
102
- className: cn("h-[var(--ds-table-header-height)] whitespace-nowrap px-3 text-left align-middle text-[var(--ds-metadata)] font-semibold uppercase text-muted-foreground", className),
103
- ...props
104
- }
105
- );
106
- }
107
- function TableCell({ className, ...props }) {
108
- return /* @__PURE__ */ jsx3("td", { "data-slot": "table-cell", className: cn("whitespace-nowrap px-3 py-2 align-middle text-sm", className), ...props });
109
- }
110
-
111
- // src/primitives/select.tsx
112
- import * as SelectPrimitive from "@radix-ui/react-select";
113
- import { CheckIcon as CheckIcon2, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
114
- import { jsx as jsx4, jsxs } from "react/jsx-runtime";
115
- function Select({ ...props }) {
116
- return /* @__PURE__ */ jsx4(SelectPrimitive.Root, { "data-slot": "select", ...props });
117
- }
118
- function SelectGroup({ ...props }) {
119
- return /* @__PURE__ */ jsx4(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
120
- }
121
- function SelectValue({ ...props }) {
122
- return /* @__PURE__ */ jsx4(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
123
- }
124
- function SelectTrigger({
125
- className,
126
- size = "default",
127
- children,
128
- ...props
129
- }) {
130
- return /* @__PURE__ */ jsxs(
131
- SelectPrimitive.Trigger,
132
- {
133
- "data-slot": "select-trigger",
134
- "data-size": size,
135
- className: cn(
136
- "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-danger/20 aria-invalid:border-danger flex w-fit items-center justify-between gap-2 rounded-[var(--ds-field-control-radius)] border bg-surface-control px-[var(--ds-field-control-padding-x)] py-2 text-sm leading-5 whitespace-nowrap shadow-none transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[var(--ds-field-control-height)] data-[size=sm]:h-[var(--ds-control-height-sm)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 dark:aria-invalid:ring-danger/40",
137
- className
138
- ),
139
- ...props,
140
- children: [
141
- children,
142
- /* @__PURE__ */ jsx4(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx4(ChevronDownIcon, { className: "size-4 opacity-50" }) })
143
- ]
144
- }
145
- );
146
- }
147
- function SelectContent({
148
- className,
149
- children,
150
- position = "popper",
151
- ...props
152
- }) {
153
- return /* @__PURE__ */ jsx4(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
154
- SelectPrimitive.Content,
155
- {
156
- "data-slot": "select-content",
157
- className: cn(
158
- "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-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
159
- 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",
160
- className
161
- ),
162
- position,
163
- ...props,
164
- children: [
165
- /* @__PURE__ */ jsx4(SelectScrollUpButton, {}),
166
- /* @__PURE__ */ jsx4(
167
- SelectPrimitive.Viewport,
168
- {
169
- className: cn(
170
- "p-1",
171
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
172
- ),
173
- children
174
- }
175
- ),
176
- /* @__PURE__ */ jsx4(SelectScrollDownButton, {})
177
- ]
178
- }
179
- ) });
180
- }
181
- function SelectItem({
182
- className,
183
- children,
184
- ...props
185
- }) {
186
- return /* @__PURE__ */ jsxs(
187
- SelectPrimitive.Item,
188
- {
189
- "data-slot": "select-item",
190
- className: cn(
191
- "focus:bg-surface-muted focus:text-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-[length:var(--ds-menu-item-size)] outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
192
- className
193
- ),
194
- ...props,
195
- children: [
196
- /* @__PURE__ */ jsx4("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx4(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx4(CheckIcon2, { className: "size-4" }) }) }),
197
- /* @__PURE__ */ jsx4(SelectPrimitive.ItemText, { children })
198
- ]
199
- }
200
- );
201
- }
202
- function SelectLabel({
203
- className,
204
- ...props
205
- }) {
206
- return /* @__PURE__ */ jsx4(
207
- SelectPrimitive.Label,
208
- {
209
- "data-slot": "select-label",
210
- className: cn("text-muted-foreground px-2 py-1.5 text-[length:var(--ds-menu-label-size)]", className),
211
- ...props
212
- }
213
- );
214
- }
215
- function SelectSeparator({
216
- className,
217
- ...props
218
- }) {
219
- return /* @__PURE__ */ jsx4(
220
- SelectPrimitive.Separator,
221
- {
222
- "data-slot": "select-separator",
223
- className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
224
- ...props
225
- }
226
- );
227
- }
228
- function SelectScrollUpButton({ className, ...props }) {
229
- return /* @__PURE__ */ jsx4(SelectPrimitive.ScrollUpButton, { "data-slot": "select-scroll-up-button", className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: /* @__PURE__ */ jsx4(ChevronUpIcon, { className: "size-4" }) });
230
- }
231
- function SelectScrollDownButton({ className, ...props }) {
232
- return /* @__PURE__ */ jsx4(SelectPrimitive.ScrollDownButton, { "data-slot": "select-scroll-down-button", className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: /* @__PURE__ */ jsx4(ChevronDownIcon, { className: "size-4" }) });
233
- }
234
-
235
- // src/primitives/input.tsx
236
- import { jsx as jsx5 } from "react/jsx-runtime";
237
- function Input({ className, type, ...props }) {
238
- return /* @__PURE__ */ jsx5(
239
- "input",
240
- {
241
- type,
242
- "data-slot": "input",
243
- className: cn(
244
- "border-input bg-surface-control flex h-[var(--ds-field-control-height)] w-full min-w-0 rounded-[var(--ds-field-control-radius)] border px-[var(--ds-field-control-padding-x)] py-2 text-sm leading-5 shadow-none transition-colors outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-sm placeholder:leading-5 placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
245
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
246
- "aria-invalid:border-danger aria-invalid:ring-danger/20 dark:aria-invalid:ring-danger/40",
247
- className
248
- ),
249
- ...props
250
- }
251
- );
252
- }
253
-
254
- // src/primitives/separator.tsx
255
- import * as SeparatorPrimitive from "@radix-ui/react-separator";
256
- import { jsx as jsx6 } from "react/jsx-runtime";
257
- function Separator2({
258
- className,
259
- orientation = "horizontal",
260
- decorative = true,
261
- ...props
262
- }) {
263
- return /* @__PURE__ */ jsx6(
264
- SeparatorPrimitive.Root,
265
- {
266
- "data-slot": "separator",
267
- decorative,
268
- orientation,
269
- className: cn(
270
- "shrink-0 bg-border-subtle data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
271
- className
272
- ),
273
- ...props
274
- }
275
- );
276
- }
277
-
278
- // src/primitives/sheet.tsx
279
- import * as DialogPrimitive from "@radix-ui/react-dialog";
280
- import { XIcon } from "lucide-react";
281
- import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
282
- function Sheet({ ...props }) {
283
- return /* @__PURE__ */ jsx7(DialogPrimitive.Root, { "data-slot": "sheet", ...props });
284
- }
285
- function SheetTrigger({
286
- ...props
287
- }) {
288
- return /* @__PURE__ */ jsx7(DialogPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
289
- }
290
- function SheetPortal({
291
- ...props
292
- }) {
293
- return /* @__PURE__ */ jsx7(DialogPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
294
- }
295
- function SheetClose({
296
- ...props
297
- }) {
298
- return /* @__PURE__ */ jsx7(DialogPrimitive.Close, { "data-slot": "sheet-close", ...props });
299
- }
300
- function SheetOverlay({
301
- className,
302
- ...props
303
- }) {
304
- return /* @__PURE__ */ jsx7(
305
- DialogPrimitive.Overlay,
306
- {
307
- "data-slot": "sheet-overlay",
308
- className: cn("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className),
309
- ...props
310
- }
311
- );
312
- }
313
- var sheetSideClasses = {
314
- top: "inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
315
- right: "right-0 top-0 h-full max-w-md border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-lg",
316
- bottom: "inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
317
- left: "left-0 top-0 h-full max-w-md border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-lg"
318
- };
319
- function SheetContent({
320
- className,
321
- children,
322
- side = "right",
323
- closeLabel = "Close",
324
- ...props
325
- }) {
326
- return /* @__PURE__ */ jsxs2(SheetPortal, { children: [
327
- /* @__PURE__ */ jsx7(SheetOverlay, {}),
328
- /* @__PURE__ */ jsxs2(
329
- DialogPrimitive.Content,
330
- {
331
- "data-slot": "sheet-content",
332
- className: cn(
333
- "fixed z-50 flex w-full flex-col gap-6 bg-background p-6 text-foreground shadow-lg outline-none data-[state=open]:animate-in data-[state=closed]:animate-out",
334
- sheetSideClasses[side],
335
- className
336
- ),
337
- ...props,
338
- children: [
339
- children,
340
- /* @__PURE__ */ jsxs2(
341
- DialogPrimitive.Close,
342
- {
343
- "data-slot": "sheet-close",
344
- className: "absolute right-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
345
- children: [
346
- /* @__PURE__ */ jsx7(XIcon, {}),
347
- /* @__PURE__ */ jsx7("span", { className: "sr-only", children: closeLabel })
348
- ]
349
- }
350
- )
351
- ]
352
- }
353
- )
354
- ] });
355
- }
356
- function SheetHeader({ className, ...props }) {
357
- return /* @__PURE__ */ jsx7("div", { "data-slot": "sheet-header", className: cn("grid gap-2 pr-8", className), ...props });
358
- }
359
- function SheetTitle({
360
- className,
361
- ...props
362
- }) {
363
- return /* @__PURE__ */ jsx7(
364
- DialogPrimitive.Title,
365
- {
366
- "data-slot": "sheet-title",
367
- className: cn("text-lg font-semibold leading-tight", className),
368
- ...props
369
- }
370
- );
371
- }
372
- function SheetDescription({
373
- className,
374
- ...props
375
- }) {
376
- return /* @__PURE__ */ jsx7(
377
- DialogPrimitive.Description,
378
- {
379
- "data-slot": "sheet-description",
380
- className: cn("text-sm text-muted-foreground", className),
381
- ...props
382
- }
383
- );
384
- }
385
- function SheetBody({ className, ...props }) {
386
- return /* @__PURE__ */ jsx7(
387
- "div",
388
- {
389
- "data-slot": "sheet-body",
390
- className: cn("flex min-h-0 flex-1 flex-col gap-[var(--ds-space-group)] overflow-y-auto pr-1", className),
391
- ...props
392
- }
393
- );
394
- }
395
- function SheetFooter({ className, ...props }) {
396
- return /* @__PURE__ */ jsx7(
397
- "div",
398
- {
399
- "data-slot": "sheet-footer",
400
- className: cn("mt-auto flex flex-wrap items-center justify-between gap-2 border-t border-border-subtle pt-4", className),
401
- ...props
402
- }
403
- );
404
- }
405
-
406
- // src/primitives/tooltip.tsx
407
- import * as TooltipPrimitive from "@radix-ui/react-tooltip";
408
- import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
409
- function TooltipProvider({ delayDuration = 150, ...props }) {
410
- return /* @__PURE__ */ jsx8(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delayDuration, ...props });
411
- }
412
- function Tooltip({ ...props }) {
413
- return /* @__PURE__ */ jsx8(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
414
- }
415
- function TooltipTrigger({ ...props }) {
416
- return /* @__PURE__ */ jsx8(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
417
- }
418
- function TooltipContent({
419
- className,
420
- sideOffset = 6,
421
- children,
422
- ...props
423
- }) {
424
- return /* @__PURE__ */ jsx8(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs3(
425
- TooltipPrimitive.Content,
426
- {
427
- "data-slot": "tooltip-content",
428
- sideOffset,
429
- className: cn("z-50 w-fit rounded-md bg-foreground px-3 py-1.5 text-balance text-xs text-background shadow-[var(--ds-shadow-floating)]", className),
430
- ...props,
431
- children: [
432
- children,
433
- /* @__PURE__ */ jsx8(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" })
434
- ]
435
- }
436
- ) });
437
- }
438
-
439
- // src/primitives/dialog.tsx
440
- import * as DialogPrimitive2 from "@radix-ui/react-dialog";
441
- import { XIcon as XIcon2 } from "lucide-react";
442
- import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
443
- function Dialog({ ...props }) {
444
- return /* @__PURE__ */ jsx9(DialogPrimitive2.Root, { "data-slot": "dialog", ...props });
445
- }
446
- function DialogTrigger({ ...props }) {
447
- return /* @__PURE__ */ jsx9(DialogPrimitive2.Trigger, { "data-slot": "dialog-trigger", ...props });
448
- }
449
- function DialogClose({ ...props }) {
450
- return /* @__PURE__ */ jsx9(DialogPrimitive2.Close, { "data-slot": "dialog-close", ...props });
451
- }
452
- function DialogPortal({ ...props }) {
453
- return /* @__PURE__ */ jsx9(DialogPrimitive2.Portal, { "data-slot": "dialog-portal", ...props });
454
- }
455
- function DialogOverlay({ className, ...props }) {
456
- return /* @__PURE__ */ jsx9(DialogPrimitive2.Overlay, { "data-slot": "dialog-overlay", className: cn("fixed inset-0 z-50 bg-black/50", className), ...props });
457
- }
458
- function DialogContent({
459
- className,
460
- children,
461
- showCloseButton = true,
462
- size = "default",
463
- closeLabel = "Close",
464
- ...props
465
- }) {
466
- return /* @__PURE__ */ jsxs4(DialogPortal, { children: [
467
- /* @__PURE__ */ jsx9(DialogOverlay, {}),
468
- /* @__PURE__ */ jsxs4(
469
- DialogPrimitive2.Content,
470
- {
471
- "data-slot": "dialog-content",
472
- "data-size": size,
473
- className: cn(
474
- "fixed left-1/2 top-1/2 z-50 grid max-h-[min(42rem,calc(100vh-2rem))] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 grid-rows-[auto_minmax(0,1fr)_auto] gap-5 overflow-hidden rounded-lg border bg-background p-5 text-foreground shadow-lg sm:p-6",
475
- "data-[size=small]:sm:max-w-sm data-[size=default]:sm:max-w-lg data-[size=large]:sm:max-w-3xl",
476
- className
477
- ),
478
- ...props,
479
- children: [
480
- children,
481
- showCloseButton ? /* @__PURE__ */ jsxs4(
482
- DialogPrimitive2.Close,
483
- {
484
- "data-slot": "dialog-close",
485
- className: "absolute right-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
486
- children: [
487
- /* @__PURE__ */ jsx9(XIcon2, { className: "size-4" }),
488
- /* @__PURE__ */ jsx9("span", { className: "sr-only", children: closeLabel })
489
- ]
490
- }
491
- ) : null
492
- ]
493
- }
494
- )
495
- ] });
496
- }
497
- function DialogHeader({ className, ...props }) {
498
- return /* @__PURE__ */ jsx9("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2 text-left", className), ...props });
499
- }
500
- function DialogTitle({ className, ...props }) {
501
- return /* @__PURE__ */ jsx9(DialogPrimitive2.Title, { "data-slot": "dialog-title", className: cn("text-base font-semibold leading-none", className), ...props });
502
- }
503
- function DialogDescription({ className, ...props }) {
504
- return /* @__PURE__ */ jsx9(DialogPrimitive2.Description, { "data-slot": "dialog-description", className: cn("text-sm text-muted-foreground", className), ...props });
505
- }
506
- function DialogBody({ className, ...props }) {
507
- return /* @__PURE__ */ jsx9("div", { "data-slot": "dialog-body", className: cn("min-h-0 overflow-y-auto text-sm", className), ...props });
508
- }
509
- function DialogFooter({ className, ...props }) {
510
- return /* @__PURE__ */ jsx9("div", { "data-slot": "dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props });
511
- }
512
-
513
- // src/primitives/tabs.tsx
514
- import * as React from "react";
515
- import * as TabsPrimitive from "@radix-ui/react-tabs";
516
- import { Slot as Slot2 } from "@radix-ui/react-slot";
517
- import { jsx as jsx10 } from "react/jsx-runtime";
518
- var defaultTabsVisualContext = {
519
- variant: "underline",
520
- size: "default"
521
- };
522
- var TabsRootVisualContext = React.createContext(defaultTabsVisualContext);
523
- var TabsListVisualContext = React.createContext(defaultTabsVisualContext);
524
- var tabRailClasses = "flex min-w-0 items-stretch overflow-x-auto overscroll-x-contain border-b border-border-subtle scroll-px-2 snap-x [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
525
- var navigationTabClasses = "relative inline-flex h-full shrink-0 snap-start items-center justify-center gap-2 whitespace-nowrap rounded-t-[var(--ds-radius-control)] px-[var(--ds-tab-padding-x)] text-sm font-medium outline-none transition-[background-color,color,box-shadow] duration-150 after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-transparent after:transition-colors hover:bg-surface-muted focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/60 data-[active=false]:text-muted-foreground data-[active=false]:hover:text-foreground data-[active=true]:bg-selection-background data-[active=true]:font-semibold data-[active=true]:text-selection-foreground data-[active=true]:after:bg-selection-indicator";
526
- function assignRef(ref, value) {
527
- if (typeof ref === "function") {
528
- ref(value);
529
- } else if (ref) {
530
- ref.current = value;
531
- }
532
- }
533
- function useHorizontalScrollRail(externalRef) {
534
- const internalRef = React.useRef(null);
535
- const [scrollPosition, setScrollPosition] = React.useState("none");
536
- const updateScrollPosition = React.useCallback(() => {
537
- const element = internalRef.current;
538
- if (!element) return;
539
- const maximumScroll = element.scrollWidth - element.clientWidth;
540
- const nextPosition = maximumScroll <= 1 ? "none" : element.scrollLeft <= 1 ? "start" : element.scrollLeft >= maximumScroll - 1 ? "end" : "middle";
541
- setScrollPosition(
542
- (current) => current === nextPosition ? current : nextPosition
543
- );
544
- }, []);
545
- const ref = React.useCallback(
546
- (node) => {
547
- internalRef.current = node;
548
- assignRef(externalRef, node);
549
- },
550
- [externalRef]
551
- );
552
- React.useEffect(() => {
553
- updateScrollPosition();
554
- const element = internalRef.current;
555
- if (!element || typeof ResizeObserver === "undefined") return;
556
- const observer = new ResizeObserver(updateScrollPosition);
557
- observer.observe(element);
558
- return () => observer.disconnect();
559
- }, [updateScrollPosition]);
560
- return [scrollPosition, ref, updateScrollPosition];
561
- }
562
- function Tabs({
563
- className,
564
- variant = "underline",
565
- size = "default",
566
- ...props
567
- }) {
568
- return /* @__PURE__ */ jsx10(TabsRootVisualContext.Provider, { value: { variant, size }, children: /* @__PURE__ */ jsx10(
569
- TabsPrimitive.Root,
570
- {
571
- "data-slot": "tabs",
572
- "data-variant": variant,
573
- "data-size": size,
574
- className: cn("flex min-w-0 flex-col gap-2", className),
575
- ...props
576
- }
577
- ) });
578
- }
579
- function TabsList({
580
- className,
581
- variant,
582
- size,
583
- children,
584
- ref: externalRef,
585
- onScroll,
586
- ...props
587
- }) {
588
- const rootVisuals = React.useContext(TabsRootVisualContext);
589
- const resolvedVariant = variant ?? rootVisuals.variant;
590
- const resolvedSize = size ?? rootVisuals.size;
591
- const [scrollPosition, scrollRailRef, updateScrollPosition] = useHorizontalScrollRail(externalRef);
592
- return /* @__PURE__ */ jsx10(
593
- TabsPrimitive.List,
594
- {
595
- "data-slot": "tabs-list",
596
- "data-variant": resolvedVariant,
597
- "data-size": resolvedSize,
598
- "data-scroll-position": resolvedVariant === "underline" ? scrollPosition : void 0,
599
- ref: scrollRailRef,
600
- onScroll: (event) => {
601
- updateScrollPosition();
602
- onScroll?.(event);
603
- },
604
- className: cn(
605
- "text-muted-foreground",
606
- resolvedVariant === "underline" && tabRailClasses,
607
- resolvedVariant === "underline" && (resolvedSize === "compact" ? "h-[var(--ds-tab-rail-height-compact)]" : "h-[var(--ds-tab-rail-height)]"),
608
- resolvedVariant === "segmented" && "inline-flex h-[var(--ds-control-height)] items-center gap-1 self-start rounded-md bg-surface-muted p-1",
609
- className
610
- ),
611
- ...props,
612
- children: /* @__PURE__ */ jsx10(
613
- TabsListVisualContext.Provider,
614
- {
615
- value: { variant: resolvedVariant, size: resolvedSize },
616
- children
617
- }
618
- )
619
- }
620
- );
621
- }
622
- function TabsTrigger({
623
- className,
624
- variant,
625
- size,
626
- ...props
627
- }) {
628
- const listVisuals = React.useContext(TabsListVisualContext);
629
- const resolvedVariant = variant ?? listVisuals.variant;
630
- const resolvedSize = size ?? listVisuals.size;
631
- return /* @__PURE__ */ jsx10(
632
- TabsPrimitive.Trigger,
633
- {
634
- "data-slot": "tabs-trigger",
635
- "data-variant": resolvedVariant,
636
- "data-size": resolvedSize,
637
- className: cn(
638
- "disabled:pointer-events-none disabled:opacity-50",
639
- resolvedVariant === "underline" && cn(
640
- navigationTabClasses,
641
- "data-[state=active]:bg-selection-background data-[state=active]:font-semibold data-[state=active]:text-selection-foreground data-[state=active]:after:bg-selection-indicator"
642
- ),
643
- resolvedVariant === "segmented" && "inline-flex h-full items-center justify-center gap-2 whitespace-nowrap rounded-[calc(var(--ds-radius-control)-2px)] px-3 text-sm font-medium text-muted-foreground outline-none transition-[background-color,color,box-shadow] hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-xs",
644
- className
645
- ),
646
- ...props
647
- }
648
- );
649
- }
650
- function TabsContent({
651
- className,
652
- ...props
653
- }) {
654
- return /* @__PURE__ */ jsx10(
655
- TabsPrimitive.Content,
656
- {
657
- "data-slot": "tabs-content",
658
- className: cn(
659
- "outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
660
- className
661
- ),
662
- ...props
663
- }
664
- );
665
- }
666
- function NavigationTabs({
667
- className,
668
- ...props
669
- }) {
670
- return /* @__PURE__ */ jsx10(
671
- "nav",
672
- {
673
- "data-slot": "navigation-tabs",
674
- className: cn("min-w-0", className),
675
- ...props
676
- }
677
- );
678
- }
679
- function NavigationTabsList({
680
- className,
681
- ref: externalRef,
682
- onScroll,
683
- ...props
684
- }) {
685
- const [scrollPosition, scrollRailRef, updateScrollPosition] = useHorizontalScrollRail(externalRef);
686
- return /* @__PURE__ */ jsx10(
687
- "div",
688
- {
689
- "data-slot": "navigation-tabs-list",
690
- "data-scroll-position": scrollPosition,
691
- ref: scrollRailRef,
692
- onScroll: (event) => {
693
- updateScrollPosition();
694
- onScroll?.(event);
695
- },
696
- className: cn(
697
- tabRailClasses,
698
- "h-[var(--ds-tab-rail-height)]",
699
- className
700
- ),
701
- ...props
702
- }
703
- );
704
- }
705
- function NavigationTab({
706
- className,
707
- active = false,
708
- asChild = false,
709
- ref: externalRef,
710
- ...props
711
- }) {
712
- const Comp = asChild ? Slot2 : "a";
713
- const internalRef = React.useRef(null);
714
- const ref = React.useCallback(
715
- (node) => {
716
- internalRef.current = node;
717
- assignRef(externalRef, node);
718
- },
719
- [externalRef]
720
- );
721
- React.useEffect(() => {
722
- if (!active) return;
723
- internalRef.current?.scrollIntoView({
724
- behavior: "auto",
725
- block: "nearest",
726
- inline: "nearest"
727
- });
728
- }, [active]);
729
- return /* @__PURE__ */ jsx10(
730
- Comp,
731
- {
732
- ...props,
733
- "data-slot": "navigation-tab",
734
- "data-active": active ? "true" : "false",
735
- "aria-current": active ? "page" : void 0,
736
- ref,
737
- className: cn(
738
- navigationTabClasses,
739
- className
740
- )
741
- }
742
- );
743
- }
744
-
745
- // src/primitives/card.tsx
746
- import { jsx as jsx11 } from "react/jsx-runtime";
747
- function Card({ className, ...props }) {
748
- return /* @__PURE__ */ jsx11(
749
- "div",
750
- {
751
- "data-slot": "card",
752
- className: cn("flex flex-col gap-5 rounded-lg border border-border-default bg-card py-[var(--ds-surface-padding)] text-card-foreground shadow-sm", className),
753
- ...props
754
- }
755
- );
756
- }
757
- function CardHeader({ className, ...props }) {
758
- return /* @__PURE__ */ jsx11("div", { "data-slot": "card-header", className: cn("grid auto-rows-min gap-1.5 px-[var(--ds-surface-padding)]", className), ...props });
759
- }
760
- function CardTitle({ className, ...props }) {
761
- return /* @__PURE__ */ jsx11("div", { "data-slot": "card-title", className: cn("font-semibold leading-none", className), ...props });
762
- }
763
- function CardDescription({ className, ...props }) {
764
- return /* @__PURE__ */ jsx11("div", { "data-slot": "card-description", className: cn("text-sm text-muted-foreground", className), ...props });
765
- }
766
- function CardContent({ className, ...props }) {
767
- return /* @__PURE__ */ jsx11("div", { "data-slot": "card-content", className: cn("px-[var(--ds-surface-padding)]", className), ...props });
768
- }
769
-
770
- // src/primitives/skeleton.tsx
771
- import { jsx as jsx12 } from "react/jsx-runtime";
772
- function Skeleton({ className, ...props }) {
773
- return /* @__PURE__ */ jsx12(
774
- "div",
775
- {
776
- "data-slot": "skeleton",
777
- className: cn("animate-pulse rounded-md bg-surface-muted", className),
778
- ...props
779
- }
780
- );
781
- }
782
-
783
- // src/primitives/collapsible.tsx
784
- import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
785
- import { jsx as jsx13 } from "react/jsx-runtime";
786
- function Collapsible({
787
- ...props
788
- }) {
789
- return /* @__PURE__ */ jsx13(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
790
- }
791
- function CollapsibleTrigger({
792
- ...props
793
- }) {
794
- return /* @__PURE__ */ jsx13(
795
- CollapsiblePrimitive.Trigger,
796
- {
797
- "data-slot": "collapsible-trigger",
798
- ...props
799
- }
800
- );
801
- }
802
- function CollapsibleContent({
803
- ...props
804
- }) {
805
- return /* @__PURE__ */ jsx13(
806
- CollapsiblePrimitive.Content,
807
- {
808
- "data-slot": "collapsible-content",
809
- ...props
810
- }
811
- );
812
- }
813
-
814
- // src/primitives/dropdown-menu.tsx
815
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
816
- import { ChevronRight } from "lucide-react";
817
- import { jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
818
- function DropdownMenu({ ...props }) {
819
- return /* @__PURE__ */ jsx14(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
820
- }
821
- function DropdownMenuGroup({ ...props }) {
822
- return /* @__PURE__ */ jsx14(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
823
- }
824
- function DropdownMenuSub({ ...props }) {
825
- return /* @__PURE__ */ jsx14(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
826
- }
827
- function DropdownMenuSubTrigger({ className, children, ...props }) {
828
- return /* @__PURE__ */ jsxs5(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", className: cn("focus:bg-surface-muted flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-[length:var(--ds-menu-item-size)] outline-hidden", className), ...props, children: [
829
- children,
830
- /* @__PURE__ */ jsx14(ChevronRight, { className: "ml-auto size-4 text-muted-foreground" })
831
- ] });
832
- }
833
- function DropdownMenuSubContent({ className, ...props }) {
834
- return /* @__PURE__ */ jsx14(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx14(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn("z-50 min-w-56 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-[var(--ds-shadow-floating)]", className), ...props }) });
835
- }
836
- function DropdownMenuTrigger({ ...props }) {
837
- return /* @__PURE__ */ jsx14(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
838
- }
839
- function DropdownMenuContent({
840
- className,
841
- sideOffset = 4,
842
- ...props
843
- }) {
844
- return /* @__PURE__ */ jsx14(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx14(
845
- DropdownMenuPrimitive.Content,
846
- {
847
- "data-slot": "dropdown-menu-content",
848
- sideOffset,
849
- className: cn("z-50 min-w-40 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-[var(--ds-shadow-floating)]", className),
850
- ...props
851
- }
852
- ) });
853
- }
854
- function DropdownMenuItem({
855
- className,
856
- inset,
857
- variant = "default",
858
- ...props
859
- }) {
860
- return /* @__PURE__ */ jsx14(
861
- DropdownMenuPrimitive.Item,
862
- {
863
- "data-slot": "dropdown-menu-item",
864
- "data-inset": inset,
865
- "data-variant": variant,
866
- className: cn("focus:bg-surface-muted focus:text-foreground data-[variant=destructive]:text-danger-foreground data-[variant=destructive]:focus:bg-danger-background relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-[length:var(--ds-menu-item-size)] outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset=true]:pl-8", className),
867
- ...props
868
- }
869
- );
870
- }
871
- function DropdownMenuLabel({
872
- className,
873
- inset,
874
- ...props
875
- }) {
876
- return /* @__PURE__ */ jsx14(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn("px-2 py-1.5 text-[length:var(--ds-menu-label-size)] font-medium data-[inset=true]:pl-8", className), ...props });
877
- }
878
- function DropdownMenuSeparator({ className, ...props }) {
879
- return /* @__PURE__ */ jsx14(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props });
880
- }
881
-
882
- export {
883
- buttonVariants,
884
- Button,
885
- Checkbox,
886
- Table,
887
- TableHeader,
888
- TableBody,
889
- TableRow,
890
- TableHead,
891
- TableCell,
892
- Select,
893
- SelectGroup,
894
- SelectValue,
895
- SelectTrigger,
896
- SelectContent,
897
- SelectItem,
898
- SelectLabel,
899
- SelectSeparator,
900
- SelectScrollUpButton,
901
- SelectScrollDownButton,
902
- Input,
903
- Separator2 as Separator,
904
- Sheet,
905
- SheetTrigger,
906
- SheetPortal,
907
- SheetClose,
908
- SheetOverlay,
909
- SheetContent,
910
- SheetHeader,
911
- SheetTitle,
912
- SheetDescription,
913
- SheetBody,
914
- SheetFooter,
915
- TooltipProvider,
916
- Tooltip,
917
- TooltipTrigger,
918
- TooltipContent,
919
- Dialog,
920
- DialogTrigger,
921
- DialogClose,
922
- DialogPortal,
923
- DialogOverlay,
924
- DialogContent,
925
- DialogHeader,
926
- DialogTitle,
927
- DialogDescription,
928
- DialogBody,
929
- DialogFooter,
930
- Tabs,
931
- TabsList,
932
- TabsTrigger,
933
- TabsContent,
934
- NavigationTabs,
935
- NavigationTabsList,
936
- NavigationTab,
937
- Card,
938
- CardHeader,
939
- CardTitle,
940
- CardDescription,
941
- CardContent,
942
- Skeleton,
943
- Collapsible,
944
- CollapsibleTrigger,
945
- CollapsibleContent,
946
- DropdownMenu,
947
- DropdownMenuGroup,
948
- DropdownMenuSub,
949
- DropdownMenuSubTrigger,
950
- DropdownMenuSubContent,
951
- DropdownMenuTrigger,
952
- DropdownMenuContent,
953
- DropdownMenuItem,
954
- DropdownMenuLabel,
955
- DropdownMenuSeparator
956
- };
957
- //# sourceMappingURL=chunk-ZCBZHRTV.js.map