tonal-ui 0.1.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.
package/dist/index.js ADDED
@@ -0,0 +1,1055 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // src/utils/cn.ts
8
+ import { clsx } from "clsx";
9
+ import { twMerge } from "tailwind-merge";
10
+ function cn(...inputs) {
11
+ return twMerge(clsx(inputs));
12
+ }
13
+
14
+ // src/components/Button.tsx
15
+ import { forwardRef } from "react";
16
+ import { cva } from "class-variance-authority";
17
+ import { jsx, jsxs } from "react/jsx-runtime";
18
+ var buttonVariants = cva(
19
+ "inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
20
+ {
21
+ variants: {
22
+ variant: {
23
+ primary: "bg-primary text-on-primary hover:bg-primary/90 disabled:opacity-50",
24
+ secondary: "bg-secondary text-on-secondary hover:bg-secondary/90 disabled:opacity-50",
25
+ danger: "bg-error text-on-error hover:bg-error/90 disabled:opacity-50",
26
+ outline: "border border-outline-variant text-on-surface-variant hover:bg-surface-container-low disabled:opacity-50",
27
+ ghost: "text-on-surface-variant hover:bg-surface-container disabled:opacity-50"
28
+ },
29
+ size: {
30
+ sm: "px-3 py-1.5 text-sm",
31
+ md: "px-4 py-2 text-sm",
32
+ lg: "px-6 py-3 text-base"
33
+ }
34
+ },
35
+ defaultVariants: {
36
+ variant: "primary",
37
+ size: "md"
38
+ }
39
+ }
40
+ );
41
+ var Button = forwardRef(
42
+ ({ variant, size, loading, children, disabled, className, ...props }, ref) => {
43
+ return /* @__PURE__ */ jsxs(
44
+ "button",
45
+ {
46
+ ref,
47
+ disabled: disabled || loading,
48
+ className: cn(buttonVariants({ variant, size }), className),
49
+ ...props,
50
+ children: [
51
+ loading && /* @__PURE__ */ jsxs("svg", { className: "mr-2 h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", children: [
52
+ /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
53
+ /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
54
+ ] }),
55
+ children
56
+ ]
57
+ }
58
+ );
59
+ }
60
+ );
61
+ Button.displayName = "Button";
62
+
63
+ // src/components/Alert.tsx
64
+ import { forwardRef as forwardRef2, useState } from "react";
65
+ import { cva as cva2 } from "class-variance-authority";
66
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
67
+ var alertVariants = cva2("rounded-md border p-4", {
68
+ variants: {
69
+ variant: {
70
+ info: "bg-info-container border-info text-on-info-container",
71
+ success: "bg-success-container border-success text-on-success-container",
72
+ warning: "bg-warning-container border-warning text-on-warning-container",
73
+ danger: "bg-error-container border-error text-on-error-container"
74
+ }
75
+ },
76
+ defaultVariants: {
77
+ variant: "info"
78
+ }
79
+ });
80
+ var Alert = forwardRef2(
81
+ ({ variant, title, dismissible, children, className, ...props }, ref) => {
82
+ const [visible, setVisible] = useState(true);
83
+ if (!visible) return null;
84
+ return /* @__PURE__ */ jsx2(
85
+ "div",
86
+ {
87
+ ref,
88
+ role: "alert",
89
+ className: cn(alertVariants({ variant }), className),
90
+ ...props,
91
+ children: /* @__PURE__ */ jsxs2("div", { className: "flex", children: [
92
+ /* @__PURE__ */ jsxs2("div", { className: "flex-1", children: [
93
+ title && /* @__PURE__ */ jsx2("h4", { className: "mb-1 text-sm font-semibold", children: title }),
94
+ /* @__PURE__ */ jsx2("div", { className: "text-sm", children })
95
+ ] }),
96
+ dismissible && /* @__PURE__ */ jsx2(
97
+ "button",
98
+ {
99
+ onClick: () => setVisible(false),
100
+ className: "ml-4 text-current opacity-50 hover:opacity-100",
101
+ children: "\xD7"
102
+ }
103
+ )
104
+ ] })
105
+ }
106
+ );
107
+ }
108
+ );
109
+ Alert.displayName = "Alert";
110
+
111
+ // src/components/Badge.tsx
112
+ import { forwardRef as forwardRef3 } from "react";
113
+ import { cva as cva3 } from "class-variance-authority";
114
+ import { jsx as jsx3 } from "react/jsx-runtime";
115
+ var badgeVariants = cva3(
116
+ "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",
117
+ {
118
+ variants: {
119
+ variant: {
120
+ default: "bg-surface-container-high text-on-surface-variant",
121
+ success: "bg-success-container text-on-success-container",
122
+ warning: "bg-warning-container text-on-warning-container",
123
+ danger: "bg-error-container text-on-error-container",
124
+ info: "bg-info-container text-on-info-container"
125
+ }
126
+ },
127
+ defaultVariants: {
128
+ variant: "default"
129
+ }
130
+ }
131
+ );
132
+ var Badge = forwardRef3(
133
+ ({ variant, className, children, ...props }, ref) => {
134
+ return /* @__PURE__ */ jsx3(
135
+ "span",
136
+ {
137
+ ref,
138
+ className: cn(badgeVariants({ variant }), className),
139
+ ...props,
140
+ children
141
+ }
142
+ );
143
+ }
144
+ );
145
+ Badge.displayName = "Badge";
146
+
147
+ // src/components/Chip.tsx
148
+ import { forwardRef as forwardRef4 } from "react";
149
+ import { cva as cva4 } from "class-variance-authority";
150
+ import { jsx as jsx4 } from "react/jsx-runtime";
151
+ var chipVariants = cva4(
152
+ "inline-flex items-center px-5 py-2 rounded-full text-xs font-semibold tracking-wide transition-all whitespace-nowrap cursor-default",
153
+ {
154
+ variants: {
155
+ variant: {
156
+ filled: "bg-secondary-container text-on-secondary-container hover:bg-primary-fixed-dim",
157
+ tonal: "bg-surface-container text-on-surface-variant hover:bg-surface-container-high",
158
+ outline: "border border-outline-variant text-on-surface-variant hover:bg-surface-container-low"
159
+ },
160
+ active: {
161
+ true: "",
162
+ false: ""
163
+ }
164
+ },
165
+ compoundVariants: [
166
+ { variant: "filled", active: true, className: "bg-primary text-on-primary shadow-md" },
167
+ { variant: "tonal", active: true, className: "bg-primary-fixed text-on-primary-fixed-variant font-semibold" },
168
+ { variant: "outline", active: true, className: "border-primary text-primary font-semibold" }
169
+ ],
170
+ defaultVariants: {
171
+ variant: "filled",
172
+ active: false
173
+ }
174
+ }
175
+ );
176
+ var Chip = forwardRef4(
177
+ ({ variant, active, onClick, className, children, ...props }, ref) => {
178
+ return /* @__PURE__ */ jsx4(
179
+ "span",
180
+ {
181
+ ref,
182
+ role: onClick ? "button" : void 0,
183
+ tabIndex: onClick ? 0 : void 0,
184
+ onClick,
185
+ className: cn(
186
+ chipVariants({ variant, active }),
187
+ onClick && "cursor-pointer",
188
+ className
189
+ ),
190
+ ...props,
191
+ children
192
+ }
193
+ );
194
+ }
195
+ );
196
+ Chip.displayName = "Chip";
197
+
198
+ // src/components/Container.tsx
199
+ import { forwardRef as forwardRef5 } from "react";
200
+ import { cva as cva5 } from "class-variance-authority";
201
+ import { jsx as jsx5 } from "react/jsx-runtime";
202
+ var containerVariants = cva5("mx-auto px-6", {
203
+ variants: {
204
+ size: {
205
+ default: "max-w-7xl",
206
+ narrow: "max-w-4xl"
207
+ }
208
+ },
209
+ defaultVariants: {
210
+ size: "default"
211
+ }
212
+ });
213
+ var Container = forwardRef5(
214
+ ({ size, className, children, ...props }, ref) => {
215
+ return /* @__PURE__ */ jsx5(
216
+ "div",
217
+ {
218
+ ref,
219
+ className: cn(containerVariants({ size }), className),
220
+ ...props,
221
+ children
222
+ }
223
+ );
224
+ }
225
+ );
226
+ Container.displayName = "Container";
227
+
228
+ // src/components/Divider.tsx
229
+ import { forwardRef as forwardRef6 } from "react";
230
+ import { cva as cva6 } from "class-variance-authority";
231
+ import { jsx as jsx6 } from "react/jsx-runtime";
232
+ var dividerVariants = cva6("bg-outline-variant/15", {
233
+ variants: {
234
+ orientation: {
235
+ horizontal: "w-full h-px",
236
+ vertical: "h-full w-px"
237
+ }
238
+ },
239
+ defaultVariants: {
240
+ orientation: "horizontal"
241
+ }
242
+ });
243
+ var Divider = forwardRef6(
244
+ ({ orientation, className, ...props }, ref) => {
245
+ return /* @__PURE__ */ jsx6(
246
+ "div",
247
+ {
248
+ ref,
249
+ role: "separator",
250
+ "aria-orientation": orientation ?? "horizontal",
251
+ className: cn(dividerVariants({ orientation }), className),
252
+ ...props
253
+ }
254
+ );
255
+ }
256
+ );
257
+ Divider.displayName = "Divider";
258
+
259
+ // src/components/HeroBadge.tsx
260
+ import { forwardRef as forwardRef7 } from "react";
261
+ import { cva as cva7 } from "class-variance-authority";
262
+ import { jsx as jsx7 } from "react/jsx-runtime";
263
+ var heroBadgeVariants = cva7(
264
+ "inline-block px-3 py-1 rounded-full text-xs font-bold tracking-wider",
265
+ {
266
+ variants: {
267
+ variant: {
268
+ default: "bg-secondary-container text-on-secondary-container",
269
+ primary: "bg-primary-container text-on-primary-container",
270
+ tertiary: "bg-tertiary-container text-on-tertiary-container"
271
+ }
272
+ },
273
+ defaultVariants: {
274
+ variant: "default"
275
+ }
276
+ }
277
+ );
278
+ var HeroBadge = forwardRef7(
279
+ ({ variant, className, children, ...props }, ref) => {
280
+ return /* @__PURE__ */ jsx7(
281
+ "span",
282
+ {
283
+ ref,
284
+ className: cn(heroBadgeVariants({ variant }), className),
285
+ ...props,
286
+ children
287
+ }
288
+ );
289
+ }
290
+ );
291
+ HeroBadge.displayName = "HeroBadge";
292
+
293
+ // src/components/IconButton.tsx
294
+ import { forwardRef as forwardRef8 } from "react";
295
+ import { cva as cva8 } from "class-variance-authority";
296
+ import { jsx as jsx8 } from "react/jsx-runtime";
297
+ var iconButtonVariants = cva8(
298
+ "flex items-center justify-center rounded-lg text-on-surface-variant hover:bg-surface-container-high active:scale-90 transition-all duration-200",
299
+ {
300
+ variants: {
301
+ size: {
302
+ sm: "min-h-[36px] min-w-[36px]",
303
+ md: "min-h-[44px] min-w-[44px]",
304
+ lg: "min-h-[52px] min-w-[52px]"
305
+ }
306
+ },
307
+ defaultVariants: {
308
+ size: "md"
309
+ }
310
+ }
311
+ );
312
+ var IconButton = forwardRef8(
313
+ ({ size, className, children, ...props }, ref) => {
314
+ return /* @__PURE__ */ jsx8(
315
+ "button",
316
+ {
317
+ ref,
318
+ className: cn(iconButtonVariants({ size }), className),
319
+ ...props,
320
+ children
321
+ }
322
+ );
323
+ }
324
+ );
325
+ IconButton.displayName = "IconButton";
326
+
327
+ // src/components/Input.tsx
328
+ import { forwardRef as forwardRef9 } from "react";
329
+ import { cva as cva9 } from "class-variance-authority";
330
+ import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
331
+ var inputVariants = cva9(
332
+ "w-full rounded-md border px-3 py-2 text-sm transition-colors focus:outline-none focus:ring-2",
333
+ {
334
+ variants: {
335
+ variant: {
336
+ default: "border-outline-variant focus:ring-primary",
337
+ error: "border-error focus:ring-error"
338
+ }
339
+ },
340
+ defaultVariants: {
341
+ variant: "default"
342
+ }
343
+ }
344
+ );
345
+ var Input = forwardRef9(
346
+ ({ label, error, variant, className, id, ...props }, ref) => {
347
+ const inputId = id || label?.toLowerCase().replace(/\s+/g, "-");
348
+ const resolvedVariant = error ? "error" : variant;
349
+ return /* @__PURE__ */ jsxs3("div", { children: [
350
+ label && /* @__PURE__ */ jsx9(
351
+ "label",
352
+ {
353
+ htmlFor: inputId,
354
+ className: "mb-1 block text-sm font-medium text-on-surface-variant",
355
+ children: label
356
+ }
357
+ ),
358
+ /* @__PURE__ */ jsx9(
359
+ "input",
360
+ {
361
+ ref,
362
+ id: inputId,
363
+ className: cn(inputVariants({ variant: resolvedVariant }), className),
364
+ ...props
365
+ }
366
+ ),
367
+ error && /* @__PURE__ */ jsx9("p", { className: "mt-1 text-sm text-error", children: error })
368
+ ] });
369
+ }
370
+ );
371
+ Input.displayName = "Input";
372
+
373
+ // src/components/Modal.tsx
374
+ import { forwardRef as forwardRef10, useEffect, useRef, useImperativeHandle } from "react";
375
+ import { cva as cva10 } from "class-variance-authority";
376
+ import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
377
+ var modalVariants = cva10(
378
+ "fixed inset-0 m-auto rounded-lg border-none bg-surface-container-lowest p-0 shadow-xl backdrop:bg-black/50",
379
+ {
380
+ variants: {
381
+ size: {
382
+ sm: "w-full max-w-sm",
383
+ md: "w-full max-w-lg",
384
+ lg: "w-full max-w-2xl",
385
+ full: "w-full max-w-[calc(100vw-2rem)]"
386
+ }
387
+ },
388
+ defaultVariants: {
389
+ size: "md"
390
+ }
391
+ }
392
+ );
393
+ var Modal = forwardRef10(
394
+ ({ open, onClose, title, size, className, children, ...props }, ref) => {
395
+ const dialogRef = useRef(null);
396
+ useImperativeHandle(ref, () => dialogRef.current);
397
+ useEffect(() => {
398
+ const dialog = dialogRef.current;
399
+ if (!dialog) return;
400
+ if (open) {
401
+ dialog.showModal();
402
+ } else {
403
+ dialog.close();
404
+ }
405
+ }, [open]);
406
+ return /* @__PURE__ */ jsx10(
407
+ "dialog",
408
+ {
409
+ ref: dialogRef,
410
+ onClose,
411
+ className: cn(modalVariants({ size }), className),
412
+ ...props,
413
+ children: /* @__PURE__ */ jsxs4("div", { className: "p-6", children: [
414
+ /* @__PURE__ */ jsxs4("div", { className: "mb-4 flex items-center justify-between", children: [
415
+ /* @__PURE__ */ jsx10("h2", { className: "text-lg font-semibold text-on-surface", children: title }),
416
+ /* @__PURE__ */ jsx10(
417
+ "button",
418
+ {
419
+ onClick: onClose,
420
+ className: "text-outline hover:text-on-surface-variant",
421
+ children: "\xD7"
422
+ }
423
+ )
424
+ ] }),
425
+ children
426
+ ] })
427
+ }
428
+ );
429
+ }
430
+ );
431
+ Modal.displayName = "Modal";
432
+
433
+ // src/components/ProgressBar.tsx
434
+ import { forwardRef as forwardRef11 } from "react";
435
+ import { cva as cva11 } from "class-variance-authority";
436
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
437
+ var progressBarVariants = cva11("h-full rounded-full transition-all duration-300", {
438
+ variants: {
439
+ variant: {
440
+ primary: "bg-primary",
441
+ success: "bg-success",
442
+ warning: "bg-warning",
443
+ danger: "bg-error"
444
+ },
445
+ size: {
446
+ sm: "",
447
+ md: "",
448
+ lg: ""
449
+ }
450
+ },
451
+ defaultVariants: {
452
+ variant: "primary",
453
+ size: "md"
454
+ }
455
+ });
456
+ var trackSizeMap = {
457
+ sm: "h-1",
458
+ md: "h-2",
459
+ lg: "h-3"
460
+ };
461
+ var ProgressBar = forwardRef11(
462
+ ({ value, max = 100, label, variant, size, className, ...props }, ref) => {
463
+ const percentage = Math.min(100, Math.max(0, value / max * 100));
464
+ const trackSize = trackSizeMap[size ?? "md"];
465
+ return /* @__PURE__ */ jsxs5("div", { ref, className, ...props, children: [
466
+ label && /* @__PURE__ */ jsx11("div", { className: "mb-1 text-sm text-on-surface-variant", children: label }),
467
+ /* @__PURE__ */ jsx11(
468
+ "div",
469
+ {
470
+ className: cn(
471
+ "w-full overflow-hidden rounded-full bg-surface-container-high",
472
+ trackSize
473
+ ),
474
+ children: /* @__PURE__ */ jsx11(
475
+ "div",
476
+ {
477
+ className: cn(progressBarVariants({ variant, size })),
478
+ style: { width: `${percentage}%` }
479
+ }
480
+ )
481
+ }
482
+ )
483
+ ] });
484
+ }
485
+ );
486
+ ProgressBar.displayName = "ProgressBar";
487
+
488
+ // src/components/Radio.tsx
489
+ import { forwardRef as forwardRef12 } from "react";
490
+ import { cva as cva12 } from "class-variance-authority";
491
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
492
+ var radioGroupVariants = cva12("", {
493
+ variants: {
494
+ orientation: {
495
+ horizontal: "flex gap-4",
496
+ vertical: "flex flex-col gap-2"
497
+ }
498
+ },
499
+ defaultVariants: {
500
+ orientation: "horizontal"
501
+ }
502
+ });
503
+ var RadioGroup = forwardRef12(
504
+ ({ name, label, options, value, onChange, orientation, disabled, className, ...props }, ref) => {
505
+ return /* @__PURE__ */ jsxs6("fieldset", { ref, disabled, className, ...props, children: [
506
+ label && /* @__PURE__ */ jsx12("legend", { className: "mb-2 text-sm font-medium text-on-surface-variant", children: label }),
507
+ /* @__PURE__ */ jsx12("div", { className: cn(radioGroupVariants({ orientation })), children: options.map((opt) => /* @__PURE__ */ jsxs6("label", { className: "flex cursor-pointer items-center gap-2", children: [
508
+ /* @__PURE__ */ jsx12(
509
+ "input",
510
+ {
511
+ type: "radio",
512
+ name,
513
+ value: opt.value,
514
+ checked: value === opt.value,
515
+ onChange: () => onChange(opt.value),
516
+ className: "h-4 w-4 text-primary focus:ring-primary"
517
+ }
518
+ ),
519
+ /* @__PURE__ */ jsx12("span", { className: "text-sm text-on-surface-variant", children: opt.label }),
520
+ opt.description && /* @__PURE__ */ jsxs6("span", { className: "text-xs text-outline", children: [
521
+ "(",
522
+ opt.description,
523
+ ")"
524
+ ] })
525
+ ] }, opt.value)) })
526
+ ] });
527
+ }
528
+ );
529
+ RadioGroup.displayName = "RadioGroup";
530
+
531
+ // src/components/Select.tsx
532
+ import { forwardRef as forwardRef13 } from "react";
533
+ import { cva as cva13 } from "class-variance-authority";
534
+ import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
535
+ var selectVariants = cva13(
536
+ "w-full rounded-md border border-outline-variant px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary",
537
+ {
538
+ variants: {
539
+ size: {
540
+ sm: "px-2 py-1 text-xs",
541
+ md: "px-3 py-2 text-sm",
542
+ lg: "px-4 py-3 text-base"
543
+ }
544
+ },
545
+ defaultVariants: {
546
+ size: "md"
547
+ }
548
+ }
549
+ );
550
+ var Select = forwardRef13(
551
+ ({ label, options, size, className, id, ...props }, ref) => {
552
+ const selectId = id || label?.toLowerCase().replace(/\s+/g, "-");
553
+ return /* @__PURE__ */ jsxs7("div", { children: [
554
+ label && /* @__PURE__ */ jsx13(
555
+ "label",
556
+ {
557
+ htmlFor: selectId,
558
+ className: "mb-1 block text-sm font-medium text-on-surface-variant",
559
+ children: label
560
+ }
561
+ ),
562
+ /* @__PURE__ */ jsx13(
563
+ "select",
564
+ {
565
+ ref,
566
+ id: selectId,
567
+ className: cn(selectVariants({ size }), className),
568
+ ...props,
569
+ children: options.map((opt) => /* @__PURE__ */ jsx13("option", { value: opt.value, children: opt.label }, opt.value))
570
+ }
571
+ )
572
+ ] });
573
+ }
574
+ );
575
+ Select.displayName = "Select";
576
+
577
+ // src/components/SidebarCard.tsx
578
+ import { forwardRef as forwardRef14 } from "react";
579
+ import { cva as cva14 } from "class-variance-authority";
580
+ import { jsxs as jsxs8 } from "react/jsx-runtime";
581
+ var sidebarCardVariants = cva14("rounded-xl", {
582
+ variants: {
583
+ variant: {
584
+ default: "bg-surface-container-lowest p-6",
585
+ elevated: "bg-surface-container-lowest p-6 shadow-md"
586
+ }
587
+ },
588
+ defaultVariants: {
589
+ variant: "default"
590
+ }
591
+ });
592
+ var SidebarCard = forwardRef14(
593
+ ({ title, icon, variant, className, children, ...props }, ref) => {
594
+ return /* @__PURE__ */ jsxs8(
595
+ "div",
596
+ {
597
+ ref,
598
+ className: cn(sidebarCardVariants({ variant }), className),
599
+ ...props,
600
+ children: [
601
+ /* @__PURE__ */ jsxs8("h4", { className: "font-headline text-lg font-bold text-on-surface mb-6 flex items-center gap-2", children: [
602
+ icon,
603
+ title
604
+ ] }),
605
+ children
606
+ ]
607
+ }
608
+ );
609
+ }
610
+ );
611
+ SidebarCard.displayName = "SidebarCard";
612
+
613
+ // src/components/Switch.tsx
614
+ import { forwardRef as forwardRef15 } from "react";
615
+ import { cva as cva15 } from "class-variance-authority";
616
+ import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
617
+ var switchVariants = cva15(
618
+ "relative inline-flex shrink-0 rounded-full transition-colors",
619
+ {
620
+ variants: {
621
+ size: {
622
+ sm: "h-5 w-9",
623
+ md: "h-6 w-11",
624
+ lg: "h-7 w-[52px]"
625
+ }
626
+ },
627
+ defaultVariants: {
628
+ size: "md"
629
+ }
630
+ }
631
+ );
632
+ var thumbSizeMap = {
633
+ sm: "h-4 w-4",
634
+ md: "h-5 w-5",
635
+ lg: "h-6 w-6"
636
+ };
637
+ var thumbTranslateMap = {
638
+ sm: { on: "translate-x-4", off: "translate-x-0.5" },
639
+ md: { on: "translate-x-5.5", off: "translate-x-0.5" },
640
+ lg: { on: "translate-x-6", off: "translate-x-0.5" }
641
+ };
642
+ var Switch = forwardRef15(
643
+ ({ label, checked, onChange, size, disabled, className, ...props }, ref) => {
644
+ const resolvedSize = size ?? "md";
645
+ const thumbSize = thumbSizeMap[resolvedSize];
646
+ const thumbTranslate = checked ? thumbTranslateMap[resolvedSize].on : thumbTranslateMap[resolvedSize].off;
647
+ return /* @__PURE__ */ jsxs9(
648
+ "label",
649
+ {
650
+ ref,
651
+ className: cn("flex cursor-pointer items-center gap-3", className),
652
+ ...props,
653
+ children: [
654
+ /* @__PURE__ */ jsx14(
655
+ "button",
656
+ {
657
+ type: "button",
658
+ role: "switch",
659
+ "aria-checked": checked,
660
+ disabled,
661
+ onClick: () => onChange(!checked),
662
+ className: cn(
663
+ switchVariants({ size }),
664
+ checked ? "bg-primary" : "bg-surface-container-highest",
665
+ disabled && "cursor-not-allowed opacity-50"
666
+ ),
667
+ children: /* @__PURE__ */ jsx14(
668
+ "span",
669
+ {
670
+ className: cn(
671
+ "inline-block translate-y-0.5 rounded-full bg-surface-container-lowest shadow transition-transform",
672
+ thumbSize,
673
+ thumbTranslate
674
+ )
675
+ }
676
+ )
677
+ }
678
+ ),
679
+ label && /* @__PURE__ */ jsx14("span", { className: "text-sm text-on-surface-variant", children: label })
680
+ ]
681
+ }
682
+ );
683
+ }
684
+ );
685
+ Switch.displayName = "Switch";
686
+
687
+ // src/components/Toast.tsx
688
+ import { forwardRef as forwardRef16, useEffect as useEffect2, useState as useState2 } from "react";
689
+ import { cva as cva16 } from "class-variance-authority";
690
+ import { jsx as jsx15 } from "react/jsx-runtime";
691
+ var toastVariants = cva16(
692
+ "fixed right-4 top-4 z-50 rounded-md px-4 py-3 text-sm shadow-lg transition-all duration-300",
693
+ {
694
+ variants: {
695
+ variant: {
696
+ success: "bg-success text-on-success",
697
+ danger: "bg-error text-on-error",
698
+ info: "bg-primary text-on-primary"
699
+ }
700
+ },
701
+ defaultVariants: {
702
+ variant: "info"
703
+ }
704
+ }
705
+ );
706
+ var Toast = forwardRef16(
707
+ ({ variant, message, duration = 3e3, onClose, className, ...props }, ref) => {
708
+ const [visible, setVisible] = useState2(true);
709
+ useEffect2(() => {
710
+ const timer = setTimeout(() => {
711
+ setVisible(false);
712
+ setTimeout(onClose, 300);
713
+ }, duration);
714
+ return () => clearTimeout(timer);
715
+ }, [duration, onClose]);
716
+ return /* @__PURE__ */ jsx15(
717
+ "div",
718
+ {
719
+ ref,
720
+ className: cn(
721
+ toastVariants({ variant }),
722
+ visible ? "translate-y-0 opacity-100" : "-translate-y-2 opacity-0",
723
+ className
724
+ ),
725
+ ...props,
726
+ children: message
727
+ }
728
+ );
729
+ }
730
+ );
731
+ Toast.displayName = "Toast";
732
+
733
+ // src/components/Table/index.ts
734
+ var Table_exports = {};
735
+ __export(Table_exports, {
736
+ Body: () => TableBody,
737
+ Cell: () => TableCell,
738
+ Head: () => TableHead,
739
+ HeaderCell: () => TableHeaderCell,
740
+ Root: () => TableRoot,
741
+ Row: () => TableRow,
742
+ tableCellVariants: () => tableCellVariants,
743
+ tableHeaderCellVariants: () => tableHeaderCellVariants,
744
+ tableRootVariants: () => tableRootVariants,
745
+ tableRowVariants: () => tableRowVariants
746
+ });
747
+
748
+ // src/components/Table/TableRoot.tsx
749
+ import { forwardRef as forwardRef17 } from "react";
750
+ import { cva as cva17 } from "class-variance-authority";
751
+ import { jsx as jsx16 } from "react/jsx-runtime";
752
+ var tableRootVariants = cva17("w-full text-sm", {
753
+ variants: {
754
+ density: {
755
+ default: "",
756
+ compact: "[&_th]:px-3 [&_th]:py-2 [&_td]:px-3 [&_td]:py-2",
757
+ comfortable: "[&_th]:px-5 [&_th]:py-4 [&_td]:px-5 [&_td]:py-4"
758
+ }
759
+ },
760
+ defaultVariants: {
761
+ density: "default"
762
+ }
763
+ });
764
+ var TableRoot = forwardRef17(
765
+ ({ density, className, children, ...props }, ref) => {
766
+ return /* @__PURE__ */ jsx16("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsx16(
767
+ "table",
768
+ {
769
+ ref,
770
+ className: cn(tableRootVariants({ density }), className),
771
+ ...props,
772
+ children
773
+ }
774
+ ) });
775
+ }
776
+ );
777
+ TableRoot.displayName = "Table.Root";
778
+
779
+ // src/components/Table/TableHead.tsx
780
+ import { forwardRef as forwardRef18 } from "react";
781
+ import { jsx as jsx17 } from "react/jsx-runtime";
782
+ var TableHead = forwardRef18(
783
+ ({ className, children, ...props }, ref) => {
784
+ return /* @__PURE__ */ jsx17(
785
+ "thead",
786
+ {
787
+ ref,
788
+ className: cn("border-b border-outline-variant bg-surface-container-low", className),
789
+ ...props,
790
+ children
791
+ }
792
+ );
793
+ }
794
+ );
795
+ TableHead.displayName = "Table.Head";
796
+
797
+ // src/components/Table/TableBody.tsx
798
+ import { forwardRef as forwardRef19 } from "react";
799
+ import { jsx as jsx18 } from "react/jsx-runtime";
800
+ var TableBody = forwardRef19(
801
+ ({ className, children, ...props }, ref) => {
802
+ return /* @__PURE__ */ jsx18(
803
+ "tbody",
804
+ {
805
+ ref,
806
+ className: cn("divide-y divide-outline-variant", className),
807
+ ...props,
808
+ children
809
+ }
810
+ );
811
+ }
812
+ );
813
+ TableBody.displayName = "Table.Body";
814
+
815
+ // src/components/Table/TableRow.tsx
816
+ import { forwardRef as forwardRef20 } from "react";
817
+ import { cva as cva18 } from "class-variance-authority";
818
+ import { jsx as jsx19 } from "react/jsx-runtime";
819
+ var tableRowVariants = cva18("", {
820
+ variants: {
821
+ hoverable: {
822
+ true: "hover:bg-surface-container-low",
823
+ false: ""
824
+ },
825
+ selected: {
826
+ true: "bg-primary-fixed/10",
827
+ false: ""
828
+ }
829
+ },
830
+ defaultVariants: {
831
+ hoverable: true,
832
+ selected: false
833
+ }
834
+ });
835
+ var TableRow = forwardRef20(
836
+ ({ hoverable, selected, className, children, ...props }, ref) => {
837
+ return /* @__PURE__ */ jsx19(
838
+ "tr",
839
+ {
840
+ ref,
841
+ className: cn(tableRowVariants({ hoverable, selected }), className),
842
+ ...props,
843
+ children
844
+ }
845
+ );
846
+ }
847
+ );
848
+ TableRow.displayName = "Table.Row";
849
+
850
+ // src/components/Table/TableHeaderCell.tsx
851
+ import { forwardRef as forwardRef21 } from "react";
852
+ import { cva as cva19 } from "class-variance-authority";
853
+ import { jsx as jsx20 } from "react/jsx-runtime";
854
+ var tableHeaderCellVariants = cva19(
855
+ "px-4 py-3 text-xs font-medium uppercase tracking-wider text-outline",
856
+ {
857
+ variants: {
858
+ align: {
859
+ left: "text-left",
860
+ center: "text-center",
861
+ right: "text-right"
862
+ }
863
+ },
864
+ defaultVariants: {
865
+ align: "left"
866
+ }
867
+ }
868
+ );
869
+ var TableHeaderCell = forwardRef21(
870
+ ({ align, className, children, ...props }, ref) => {
871
+ return /* @__PURE__ */ jsx20(
872
+ "th",
873
+ {
874
+ ref,
875
+ className: cn(tableHeaderCellVariants({ align }), className),
876
+ ...props,
877
+ children
878
+ }
879
+ );
880
+ }
881
+ );
882
+ TableHeaderCell.displayName = "Table.HeaderCell";
883
+
884
+ // src/components/Table/TableCell.tsx
885
+ import { forwardRef as forwardRef22 } from "react";
886
+ import { cva as cva20 } from "class-variance-authority";
887
+ import { jsx as jsx21 } from "react/jsx-runtime";
888
+ var tableCellVariants = cva20("px-4 py-3 text-on-surface-variant", {
889
+ variants: {
890
+ align: {
891
+ left: "text-left",
892
+ center: "text-center",
893
+ right: "text-right"
894
+ }
895
+ },
896
+ defaultVariants: {
897
+ align: "left"
898
+ }
899
+ });
900
+ var TableCell = forwardRef22(
901
+ ({ align, className, children, ...props }, ref) => {
902
+ return /* @__PURE__ */ jsx21(
903
+ "td",
904
+ {
905
+ ref,
906
+ className: cn(tableCellVariants({ align }), className),
907
+ ...props,
908
+ children
909
+ }
910
+ );
911
+ }
912
+ );
913
+ TableCell.displayName = "Table.Cell";
914
+
915
+ // src/components/Card/index.ts
916
+ var Card_exports = {};
917
+ __export(Card_exports, {
918
+ Body: () => CardBody,
919
+ Footer: () => CardFooter,
920
+ Header: () => CardHeader,
921
+ Root: () => CardRoot,
922
+ Title: () => CardTitle,
923
+ cardRootVariants: () => cardRootVariants,
924
+ cardTitleVariants: () => cardTitleVariants
925
+ });
926
+
927
+ // src/components/Card/CardRoot.tsx
928
+ import { forwardRef as forwardRef23 } from "react";
929
+ import { cva as cva21 } from "class-variance-authority";
930
+ import { jsx as jsx22 } from "react/jsx-runtime";
931
+ var cardRootVariants = cva21(
932
+ "rounded-lg border border-outline-variant shadow-sm",
933
+ {
934
+ variants: {
935
+ variant: {
936
+ filled: "bg-surface-container-lowest",
937
+ elevated: "bg-surface-container-lowest shadow-md",
938
+ outlined: "bg-transparent shadow-none"
939
+ },
940
+ padding: {
941
+ true: "p-6",
942
+ false: ""
943
+ }
944
+ },
945
+ defaultVariants: {
946
+ variant: "filled",
947
+ padding: true
948
+ }
949
+ }
950
+ );
951
+ var CardRoot = forwardRef23(
952
+ ({ variant, padding, className, children, ...props }, ref) => {
953
+ return /* @__PURE__ */ jsx22(
954
+ "div",
955
+ {
956
+ ref,
957
+ className: cn(cardRootVariants({ variant, padding }), className),
958
+ ...props,
959
+ children
960
+ }
961
+ );
962
+ }
963
+ );
964
+ CardRoot.displayName = "Card.Root";
965
+
966
+ // src/components/Card/CardHeader.tsx
967
+ import { forwardRef as forwardRef24 } from "react";
968
+ import { jsx as jsx23 } from "react/jsx-runtime";
969
+ var CardHeader = forwardRef24(
970
+ ({ className, children, ...props }, ref) => {
971
+ return /* @__PURE__ */ jsx23("div", { ref, className: cn("mb-4", className), ...props, children });
972
+ }
973
+ );
974
+ CardHeader.displayName = "Card.Header";
975
+
976
+ // src/components/Card/CardTitle.tsx
977
+ import { forwardRef as forwardRef25 } from "react";
978
+ import { cva as cva22 } from "class-variance-authority";
979
+ import { jsx as jsx24 } from "react/jsx-runtime";
980
+ var cardTitleVariants = cva22("font-semibold text-on-surface", {
981
+ variants: {
982
+ size: {
983
+ sm: "text-base",
984
+ md: "text-lg",
985
+ lg: "text-xl"
986
+ }
987
+ },
988
+ defaultVariants: {
989
+ size: "md"
990
+ }
991
+ });
992
+ var CardTitle = forwardRef25(
993
+ ({ size, className, children, ...props }, ref) => {
994
+ return /* @__PURE__ */ jsx24("h3", { ref, className: cn(cardTitleVariants({ size }), className), ...props, children });
995
+ }
996
+ );
997
+ CardTitle.displayName = "Card.Title";
998
+
999
+ // src/components/Card/CardBody.tsx
1000
+ import { forwardRef as forwardRef26 } from "react";
1001
+ import { jsx as jsx25 } from "react/jsx-runtime";
1002
+ var CardBody = forwardRef26(
1003
+ ({ className, children, ...props }, ref) => {
1004
+ return /* @__PURE__ */ jsx25("div", { ref, className: cn("text-on-surface-variant", className), ...props, children });
1005
+ }
1006
+ );
1007
+ CardBody.displayName = "Card.Body";
1008
+
1009
+ // src/components/Card/CardFooter.tsx
1010
+ import { forwardRef as forwardRef27 } from "react";
1011
+ import { jsx as jsx26 } from "react/jsx-runtime";
1012
+ var CardFooter = forwardRef27(
1013
+ ({ className, children, ...props }, ref) => {
1014
+ return /* @__PURE__ */ jsx26("div", { ref, className: cn("mt-4 flex items-center gap-2", className), ...props, children });
1015
+ }
1016
+ );
1017
+ CardFooter.displayName = "Card.Footer";
1018
+ export {
1019
+ Alert,
1020
+ Badge,
1021
+ Button,
1022
+ Card_exports as Card,
1023
+ Chip,
1024
+ Container,
1025
+ Divider,
1026
+ HeroBadge,
1027
+ IconButton,
1028
+ Input,
1029
+ Modal,
1030
+ ProgressBar,
1031
+ RadioGroup,
1032
+ Select,
1033
+ SidebarCard,
1034
+ Switch,
1035
+ Table_exports as Table,
1036
+ Toast,
1037
+ alertVariants,
1038
+ badgeVariants,
1039
+ buttonVariants,
1040
+ chipVariants,
1041
+ cn,
1042
+ containerVariants,
1043
+ dividerVariants,
1044
+ heroBadgeVariants,
1045
+ iconButtonVariants,
1046
+ inputVariants,
1047
+ modalVariants,
1048
+ progressBarVariants,
1049
+ radioGroupVariants,
1050
+ selectVariants,
1051
+ sidebarCardVariants,
1052
+ switchVariants,
1053
+ toastVariants
1054
+ };
1055
+ //# sourceMappingURL=index.js.map