@srcroot/ui 0.0.55 → 0.0.58

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 (107) hide show
  1. package/README.md +151 -151
  2. package/dist/index.d.ts +0 -0
  3. package/dist/index.js +120 -93
  4. package/package.json +7 -2
  5. package/src/registry/analytics/google-analytics.tsx +36 -39
  6. package/src/registry/analytics/google-tag-manager.tsx +62 -65
  7. package/src/registry/analytics/meta-pixel.tsx +44 -47
  8. package/src/registry/analytics/microsoft-clarity.tsx +31 -34
  9. package/src/registry/analytics/tiktok-pixel.tsx +34 -37
  10. package/src/registry/lib/utils.ts +0 -0
  11. package/src/registry/themes/v3/blue.css +157 -157
  12. package/src/registry/themes/v3/glass.css +153 -153
  13. package/src/registry/themes/v3/gray.css +157 -157
  14. package/src/registry/themes/v3/green.css +157 -157
  15. package/src/registry/themes/v3/neutral.css +157 -157
  16. package/src/registry/themes/v3/orange.css +157 -157
  17. package/src/registry/themes/v3/rose.css +157 -157
  18. package/src/registry/themes/v3/slate.css +157 -157
  19. package/src/registry/themes/v3/stone.css +157 -157
  20. package/src/registry/themes/v3/violet.css +186 -186
  21. package/src/registry/themes/v3/zinc.css +157 -157
  22. package/src/registry/themes/v4/blue.css +184 -184
  23. package/src/registry/themes/v4/glass.css +180 -180
  24. package/src/registry/themes/v4/gray.css +184 -184
  25. package/src/registry/themes/v4/green.css +184 -184
  26. package/src/registry/themes/v4/neutral.css +184 -184
  27. package/src/registry/themes/v4/orange.css +184 -184
  28. package/src/registry/themes/v4/rose.css +184 -184
  29. package/src/registry/themes/v4/slate.css +184 -184
  30. package/src/registry/themes/v4/stone.css +184 -184
  31. package/src/registry/themes/v4/violet.css +184 -184
  32. package/src/registry/themes/v4/zinc.css +184 -184
  33. package/src/registry/ui/accordion.tsx +164 -165
  34. package/src/registry/ui/alert-dialog.tsx +213 -214
  35. package/src/registry/ui/alert.tsx +73 -76
  36. package/src/registry/ui/aspect-ratio.tsx +44 -47
  37. package/src/registry/ui/avatar.tsx +96 -97
  38. package/src/registry/ui/badge.tsx +52 -55
  39. package/src/registry/ui/breadcrumb.tsx +147 -150
  40. package/src/registry/ui/button-group.tsx +64 -67
  41. package/src/registry/ui/button.tsx +71 -72
  42. package/src/registry/ui/calendar.tsx +514 -515
  43. package/src/registry/ui/card.tsx +88 -91
  44. package/src/registry/ui/carousel.tsx +214 -214
  45. package/src/registry/ui/chart.tsx +373 -373
  46. package/src/registry/ui/chatbot.tsx +86 -13
  47. package/src/registry/ui/checkbox.tsx +93 -94
  48. package/src/registry/ui/collapsible.tsx +107 -108
  49. package/src/registry/ui/combobox.tsx +171 -171
  50. package/src/registry/ui/command.tsx +300 -300
  51. package/src/registry/ui/container.tsx +44 -47
  52. package/src/registry/ui/context-menu.tsx +221 -221
  53. package/src/registry/ui/date-picker.tsx +228 -228
  54. package/src/registry/ui/dialog.tsx +269 -270
  55. package/src/registry/ui/drawer.tsx +10 -4
  56. package/src/registry/ui/dropdown-menu.tsx +529 -530
  57. package/src/registry/ui/empty-state.tsx +0 -2
  58. package/src/registry/ui/file-upload.tsx +0 -0
  59. package/src/registry/ui/floating-dock.tsx +0 -0
  60. package/src/registry/ui/form-field.tsx +91 -94
  61. package/src/registry/ui/google-analytics.tsx +38 -0
  62. package/src/registry/ui/google-tag-manager.tsx +64 -0
  63. package/src/registry/ui/hover-card.tsx +223 -223
  64. package/src/registry/ui/image.tsx +144 -147
  65. package/src/registry/ui/input-group.tsx +82 -85
  66. package/src/registry/ui/input.tsx +125 -125
  67. package/src/registry/ui/kbd.tsx +60 -63
  68. package/src/registry/ui/label.tsx +36 -37
  69. package/src/registry/ui/loading-spinner.tsx +108 -111
  70. package/src/registry/ui/map.tsx +0 -0
  71. package/src/registry/ui/marquee.tsx +2 -0
  72. package/src/registry/ui/menubar.tsx +246 -246
  73. package/src/registry/ui/meta-pixel.tsx +46 -0
  74. package/src/registry/ui/microsoft-clarity.tsx +33 -0
  75. package/src/registry/ui/native-select.tsx +49 -52
  76. package/src/registry/ui/otp-input.tsx +163 -155
  77. package/src/registry/ui/pagination.tsx +149 -152
  78. package/src/registry/ui/patterns.tsx +28 -0
  79. package/src/registry/ui/popover.tsx +226 -227
  80. package/src/registry/ui/progress.tsx +51 -52
  81. package/src/registry/ui/radio.tsx +99 -102
  82. package/src/registry/ui/resizable.tsx +314 -314
  83. package/src/registry/ui/scroll-animation.tsx +45 -0
  84. package/src/registry/ui/scroll-area.tsx +121 -122
  85. package/src/registry/ui/scroll-to-top.tsx +0 -0
  86. package/src/registry/ui/search.tsx +162 -150
  87. package/src/registry/ui/select.tsx +292 -293
  88. package/src/registry/ui/separator.tsx +46 -47
  89. package/src/registry/ui/sheet.tsx +6 -3
  90. package/src/registry/ui/sidebar.tsx +628 -628
  91. package/src/registry/ui/skeleton.tsx +26 -29
  92. package/src/registry/ui/slider.tsx +196 -197
  93. package/src/registry/ui/slot.tsx +69 -72
  94. package/src/registry/ui/star-rating.tsx +146 -134
  95. package/src/registry/ui/switch.tsx +72 -73
  96. package/src/registry/ui/table-of-contents.tsx +96 -96
  97. package/src/registry/ui/table.tsx +138 -139
  98. package/src/registry/ui/tabs.tsx +124 -125
  99. package/src/registry/ui/text.tsx +61 -64
  100. package/src/registry/ui/textarea.tsx +41 -42
  101. package/src/registry/ui/theme-switcher.tsx +66 -66
  102. package/src/registry/ui/tiktok-pixel.tsx +36 -0
  103. package/src/registry/ui/toast.tsx +97 -98
  104. package/src/registry/ui/toggle-group.tsx +129 -129
  105. package/src/registry/ui/toggle.tsx +72 -72
  106. package/src/registry/ui/tooltip.tsx +143 -144
  107. package/src/registry/ui/whatsapp.tsx +0 -0
@@ -1,111 +1,108 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { cva, type VariantProps } from "class-variance-authority"
5
- import { cn } from "@/lib/utils"
6
-
7
- const spinnerVariants = cva(
8
- "animate-spin",
9
- {
10
- variants: {
11
- size: {
12
- xs: "h-3 w-3",
13
- sm: "h-4 w-4",
14
- default: "h-6 w-6",
15
- lg: "h-8 w-8",
16
- xl: "h-12 w-12",
17
- },
18
- variant: {
19
- default: "text-primary",
20
- muted: "text-muted-foreground",
21
- white: "text-white",
22
- },
23
- },
24
- defaultVariants: {
25
- size: "default",
26
- variant: "default",
27
- },
28
- }
29
- )
30
-
31
- type SpinnerVariants = VariantProps<typeof spinnerVariants>
32
-
33
- interface LoadingSpinnerProps extends SpinnerVariants {
34
- className?: string
35
- /** Accessible label for screen readers */
36
- label?: string
37
- }
38
-
39
- /**
40
- * Loading spinner with size and color variants
41
- *
42
- * @example
43
- * <LoadingSpinner />
44
- * <LoadingSpinner size="lg" variant="muted" />
45
- * <LoadingSpinner size="sm" label="Submitting..." />
46
- */
47
- const LoadingSpinner = React.forwardRef<SVGSVGElement, LoadingSpinnerProps>(
48
- ({ className, size, variant, label = "Loading" }, ref) => (
49
- <svg
50
- ref={ref}
51
- className={cn(spinnerVariants({ size, variant, className }))}
52
- xmlns="http://www.w3.org/2000/svg"
53
- fill="none"
54
- viewBox="0 0 24 24"
55
- role="status"
56
- aria-label={label}
57
- >
58
- <circle
59
- className="opacity-25"
60
- cx="12"
61
- cy="12"
62
- r="10"
63
- stroke="currentColor"
64
- strokeWidth="4"
65
- />
66
- <path
67
- className="opacity-75"
68
- fill="currentColor"
69
- d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
70
- />
71
- </svg>
72
- )
73
- )
74
- LoadingSpinner.displayName = "LoadingSpinner"
75
-
76
- interface LoadingOverlayProps extends SpinnerVariants {
77
- className?: string
78
- children?: React.ReactNode
79
- /** Whether to show the loading state */
80
- loading?: boolean
81
- /** Text to display below spinner */
82
- text?: string
83
- }
84
-
85
- /**
86
- * Full overlay loading state
87
- *
88
- * @example
89
- * <LoadingOverlay loading={isLoading}>
90
- * <YourContent />
91
- * </LoadingOverlay>
92
- */
93
- const LoadingOverlay = React.forwardRef<HTMLDivElement, LoadingOverlayProps>(
94
- ({ className, children, loading = true, text, size = "lg", variant }, ref) => {
95
- if (!loading) return <>{children}</>
96
-
97
- return (
98
- <div ref={ref} className={cn("relative", className)}>
99
- {children && <div className="opacity-50 pointer-events-none">{children}</div>}
100
- <div className="absolute inset-0 flex flex-col items-center justify-center bg-background/80">
101
- <LoadingSpinner size={size} variant={variant} />
102
- {text && <p className="mt-2 text-sm text-muted-foreground">{text}</p>}
103
- </div>
104
- </div>
105
- )
106
- }
107
- )
108
- LoadingOverlay.displayName = "LoadingOverlay"
109
-
110
- export { LoadingSpinner, LoadingOverlay, spinnerVariants }
111
-
1
+ import * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+ import { cn } from "@/lib/utils"
4
+
5
+ const spinnerVariants = cva(
6
+ "animate-spin",
7
+ {
8
+ variants: {
9
+ size: {
10
+ xs: "h-3 w-3",
11
+ sm: "h-4 w-4",
12
+ default: "h-6 w-6",
13
+ lg: "h-8 w-8",
14
+ xl: "h-12 w-12",
15
+ },
16
+ variant: {
17
+ default: "text-primary",
18
+ muted: "text-muted-foreground",
19
+ white: "text-white",
20
+ },
21
+ },
22
+ defaultVariants: {
23
+ size: "default",
24
+ variant: "default",
25
+ },
26
+ }
27
+ )
28
+
29
+ type SpinnerVariants = VariantProps<typeof spinnerVariants>
30
+
31
+ interface LoadingSpinnerProps extends SpinnerVariants {
32
+ className?: string
33
+ /** Accessible label for screen readers */
34
+ label?: string
35
+ }
36
+
37
+ /**
38
+ * Loading spinner with size and color variants
39
+ *
40
+ * @example
41
+ * <LoadingSpinner />
42
+ * <LoadingSpinner size="lg" variant="muted" />
43
+ * <LoadingSpinner size="sm" label="Submitting..." />
44
+ */
45
+ const LoadingSpinner = React.forwardRef<SVGSVGElement, LoadingSpinnerProps>(
46
+ ({ className, size, variant, label = "Loading" }, ref) => (
47
+ <svg
48
+ ref={ref}
49
+ className={cn(spinnerVariants({ size, variant, className }))}
50
+ xmlns="http://www.w3.org/2000/svg"
51
+ fill="none"
52
+ viewBox="0 0 24 24"
53
+ role="status"
54
+ aria-label={label}
55
+ >
56
+ <circle
57
+ className="opacity-25"
58
+ cx="12"
59
+ cy="12"
60
+ r="10"
61
+ stroke="currentColor"
62
+ strokeWidth="4"
63
+ />
64
+ <path
65
+ className="opacity-75"
66
+ fill="currentColor"
67
+ d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
68
+ />
69
+ </svg>
70
+ )
71
+ )
72
+ LoadingSpinner.displayName = "LoadingSpinner"
73
+
74
+ interface LoadingOverlayProps extends SpinnerVariants {
75
+ className?: string
76
+ children?: React.ReactNode
77
+ /** Whether to show the loading state */
78
+ loading?: boolean
79
+ /** Text to display below spinner */
80
+ text?: string
81
+ }
82
+
83
+ /**
84
+ * Full overlay loading state
85
+ *
86
+ * @example
87
+ * <LoadingOverlay loading={isLoading}>
88
+ * <YourContent />
89
+ * </LoadingOverlay>
90
+ */
91
+ const LoadingOverlay = React.forwardRef<HTMLDivElement, LoadingOverlayProps>(
92
+ ({ className, children, loading = true, text, size = "lg", variant }, ref) => {
93
+ if (!loading) return <>{children}</>
94
+
95
+ return (
96
+ <div ref={ref} className={cn("relative", className)}>
97
+ {children && <div className="opacity-50 pointer-events-none">{children}</div>}
98
+ <div className="absolute inset-0 flex flex-col items-center justify-center bg-background/80">
99
+ <LoadingSpinner size={size} variant={variant} />
100
+ {text && <p className="mt-2 text-sm text-muted-foreground">{text}</p>}
101
+ </div>
102
+ </div>
103
+ )
104
+ }
105
+ )
106
+ LoadingOverlay.displayName = "LoadingOverlay"
107
+
108
+ export { LoadingSpinner, LoadingOverlay, spinnerVariants }
File without changes
@@ -1,3 +1,5 @@
1
+ "use client"
2
+
1
3
  "use client";
2
4
 
3
5
  import { cn } from "@/lib/utils";