@catalystsoftware/ui 1.0.5 → 1.0.7
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/data/data.tsx +29 -29
- package/dist/data/tailwind.config.js +3821 -261
- package/dist/data.tsx +29 -29
- package/package.json +4 -3
- package/components/catalyst-ui/buttons/burger.tsx +0 -207
- package/components/catalyst-ui/core/data-display/timeline.tsx +0 -210
- package/components/catalyst-ui/core/feedback/alert.tsx +0 -491
- package/components/catalyst-ui/core/feedback/spinner-1.tsx +0 -65
- package/components/catalyst-ui/core/feedback/toast.tsx +0 -1857
- package/components/catalyst-ui/core/navigation/menu.tsx +0 -164
- package/components/catalyst-ui/forms/toggle-class.tsx +0 -176
- package/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +0 -419
- package/components/catalyst-ui/hooks/use-counter.tsx +0 -13
- package/components/catalyst-ui/hooks/use-event-listener.tsx +0 -23
- package/components/catalyst-ui/hooks/use-export-markdown.tsx +0 -47
- package/components/catalyst-ui/hooks/use-focus.tsx +0 -17
- package/components/catalyst-ui/hooks/use-interval.tsx +0 -23
- package/components/catalyst-ui/hooks/use-is-client.tsx +0 -16
- package/components/catalyst-ui/hooks/use-media-query.tsx +0 -19
- package/components/catalyst-ui/hooks/use-mobile.tsx +0 -19
- package/components/catalyst-ui/hooks/use-resize-observer.tsx +0 -81
- package/components/catalyst-ui/hooks/use-timeout.tsx +0 -21
- package/components/catalyst-ui/hooks/use-timer.tsx +0 -209
- package/components/catalyst-ui/hooks/use-toggle.tsx +0 -12
- package/components/catalyst-ui/media/image.tsx +0 -13
- package/components/catalyst-ui/overlays/dual-sidebar.tsx +0 -4142
- package/components/catalyst-ui/overlays/sidebar-original.tsx +0 -726
- package/components/catalyst-ui/primitives/accordion.tsx +0 -250
- package/components/catalyst-ui/primitives/alert-dialog.tsx +0 -126
- package/components/catalyst-ui/primitives/aspect-ratio.tsx +0 -9
- package/components/catalyst-ui/primitives/avatar.tsx +0 -296
- package/components/catalyst-ui/primitives/badge.tsx +0 -57
- package/components/catalyst-ui/primitives/breadcrumb.tsx +0 -101
- package/components/catalyst-ui/primitives/button.tsx +0 -265
- package/components/catalyst-ui/primitives/calendar-v4.tsx +0 -208
- package/components/catalyst-ui/primitives/calendar.tsx +0 -295
- package/components/catalyst-ui/primitives/card.tsx +0 -618
- package/components/catalyst-ui/primitives/carousel.tsx +0 -238
- package/components/catalyst-ui/primitives/chart.tsx +0 -347
- package/components/catalyst-ui/primitives/checkbox.tsx +0 -225
- package/components/catalyst-ui/primitives/collapsible.tsx +0 -212
- package/components/catalyst-ui/primitives/command.tsx +0 -393
- package/components/catalyst-ui/primitives/context-menu.tsx +0 -236
- package/components/catalyst-ui/primitives/dialog.tsx +0 -471
- package/components/catalyst-ui/primitives/drawer.tsx +0 -761
- package/components/catalyst-ui/primitives/dropdown-menu.tsx +0 -290
- package/components/catalyst-ui/primitives/empty.tsx +0 -104
- package/components/catalyst-ui/primitives/field.tsx +0 -244
- package/components/catalyst-ui/primitives/hover-card.tsx +0 -124
- package/components/catalyst-ui/primitives/input-otp.tsx +0 -76
- package/components/catalyst-ui/primitives/input.tsx +0 -64
- package/components/catalyst-ui/primitives/item.tsx +0 -196
- package/components/catalyst-ui/primitives/kbd.tsx +0 -75
- package/components/catalyst-ui/primitives/label.tsx +0 -24
- package/components/catalyst-ui/primitives/navigation-menu.tsx +0 -150
- package/components/catalyst-ui/primitives/pagination.tsx +0 -198
- package/components/catalyst-ui/primitives/popover.tsx +0 -232
- package/components/catalyst-ui/primitives/progress.tsx +0 -34
- package/components/catalyst-ui/primitives/radio-group.tsx +0 -43
- package/components/catalyst-ui/primitives/resizable.tsx +0 -56
- package/components/catalyst-ui/primitives/select.tsx +0 -155
- package/components/catalyst-ui/primitives/separator.tsx +0 -74
- package/components/catalyst-ui/primitives/sheet.tsx +0 -126
- package/components/catalyst-ui/primitives/skeleton.tsx +0 -15
- package/components/catalyst-ui/primitives/slider.tsx +0 -27
- package/components/catalyst-ui/primitives/switch.tsx +0 -187
- package/components/catalyst-ui/primitives/tabs.tsx +0 -335
- package/components/catalyst-ui/primitives/textarea.tsx +0 -24
- package/components/catalyst-ui/primitives/toggle-group.tsx +0 -55
- package/components/catalyst-ui/primitives/toggle.tsx +0 -42
- package/components/catalyst-ui/primitives/tooltip.tsx +0 -116
- package/components/catalyst-ui/utils/basic-auth.tsx +0 -40
- package/components/catalyst-ui/utils/context-storage.tsx +0 -19
- package/components/catalyst-ui/utils/cors-middleware.tsx +0 -71
- package/components/catalyst-ui/utils/deferred-content.tsx +0 -595
- package/components/catalyst-ui/utils/honeypot-middleware.tsx +0 -38
- package/components/catalyst-ui/utils/incId.tsx +0 -75
- package/components/catalyst-ui/utils/jwk-auth.tsx +0 -36
- package/components/catalyst-ui/utils/request-id.tsx +0 -14
- package/components/catalyst-ui/utils/secure-headers.tsx +0 -37
- package/components/catalyst-ui/utils/server-timing.tsx +0 -23
- package/components/catalyst-ui/utils/utils.ts +0 -43
- package/components/catalyst-ui/utils/with-cookie.tsx +0 -43
- package/components/catalyst-ui/x/accordian-x.tsx +0 -428
- package/components/catalyst-ui/x/alert-x.tsx +0 -413
- package/components/catalyst-ui/x/animated-text-x.tsx +0 -2242
- package/components/catalyst-ui/x/avatar-x.tsx +0 -515
- package/components/catalyst-ui/x/badge-x.tsx +0 -670
- package/components/catalyst-ui/x/button-X.tsx +0 -2857
- package/components/catalyst-ui/x/button-group-x.tsx +0 -847
- package/components/catalyst-ui/x/calendar-x.tsx +0 -1910
- package/components/catalyst-ui/x/card-x.tsx +0 -2597
- package/components/catalyst-ui/x/checkbox-x.tsx +0 -656
- package/components/catalyst-ui/x/collapsible-x.tsx +0 -1360
- package/components/catalyst-ui/x/combobox-x.tsx +0 -911
- package/components/catalyst-ui/x/data-table-x.tsx +0 -1753
- package/components/catalyst-ui/x/date-picker-x.tsx +0 -648
- package/components/catalyst-ui/x/dialog-x.tsx +0 -659
- package/components/catalyst-ui/x/dropdown-menu-x.tsx +0 -612
- package/components/catalyst-ui/x/hover-card-x.tsx +0 -375
- package/components/catalyst-ui/x/icon-x.tsx +0 -840
- package/components/catalyst-ui/x/input-mask-x.tsx +0 -981
- package/components/catalyst-ui/x/input-otp-x.tsx +0 -659
- package/components/catalyst-ui/x/loader-x.tsx +0 -1757
- package/components/catalyst-ui/x/pagination-x.tsx +0 -622
- package/components/catalyst-ui/x/popover-x.tsx +0 -744
- package/components/catalyst-ui/x/radio-group-x.tsx +0 -499
- package/components/catalyst-ui/x/select-x.tsx +0 -1127
- package/components/catalyst-ui/x/sheet-x.tsx +0 -668
- package/components/catalyst-ui/x/switch-x.tsx +0 -681
- package/components/catalyst-ui/x/table-x.tsx +0 -574
- package/components/catalyst-ui/x/tabs-x.tsx +0 -839
- package/components/catalyst-ui/x/textarea-x.tsx +0 -1263
- package/components/catalyst-ui/x/tooltip-x.tsx +0 -396
- package/components/catalyst-ui/x/tracker-x.tsx +0 -560
- package/data/bg-data.tsx +0 -901
- package/data/buttons-data.tsx +0 -2327
- package/data/charts-data.tsx +0 -102
- package/data/chat-data.tsx +0 -83
- package/data/code-data.tsx +0 -1040
- package/data/comboboxes-data.tsx +0 -1843
- package/data/command-data.tsx +0 -1381
- package/data/core-data.tsx +0 -15953
- package/data/crm-data.tsx +0 -47
- package/data/data.tsx +0 -159
- package/data/date-and-time-data.tsx +0 -554
- package/data/dependencies.tsx +0 -7
- package/data/ecommerce-data.tsx +0 -1387
- package/data/forms-data.tsx +0 -7890
- package/data/hooks-data.tsx +0 -5487
- package/data/index.ts +0 -34
- package/data/inputs-data.tsx +0 -557
- package/data/interactive-data.tsx +0 -5394
- package/data/lofi-data.tsx +0 -18295
- package/data/marketing-data.tsx +0 -2546
- package/data/media-data.tsx +0 -1510
- package/data/motion-data.tsx +0 -5801
- package/data/overlay-data.tsx +0 -4136
- package/data/pdf-data.tsx +0 -124
- package/data/pos-data.tsx +0 -213
- package/data/postcss.config.js +0 -6
- package/data/primitive-data.tsx +0 -5170
- package/data/prompt-data.tsx +0 -1226
- package/data/requiredLibs.ts +0 -4
- package/data/sandbox-data.tsx +0 -1
- package/data/sidebars-data.tsx +0 -5421
- package/data/stacks-data.tsx +0 -32
- package/data/table-data.tsx +0 -706
- package/data/tailwind.config.js +0 -270
- package/data/tailwind.config.ngin.js +0 -3830
- package/data/tailwind.css +0 -431
- package/data/tools-data.tsx +0 -6910
- package/data/typography-data.tsx +0 -2050
- package/data/utils-data.tsx +0 -6500
- package/data/x-data.tsx +0 -1171
|
@@ -1,491 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { CheckCircle, AlertTriangle, XCircle, Info, X, ExternalLink, ArrowRight, Bell, Shield, Zap, } from 'lucide-react';
|
|
3
|
-
|
|
4
|
-
export const AlertV2 = ({
|
|
5
|
-
title = "Alert Title",
|
|
6
|
-
description = "This is an alert description that provides more context about the situation.",
|
|
7
|
-
variant = "info",
|
|
8
|
-
style = "accent",
|
|
9
|
-
dismissible = false,
|
|
10
|
-
onDismiss = null,
|
|
11
|
-
primaryAction = null,
|
|
12
|
-
secondaryAction = null,
|
|
13
|
-
icon = "auto",
|
|
14
|
-
iconPosition = "left",
|
|
15
|
-
className = "",
|
|
16
|
-
size = "default",
|
|
17
|
-
rounded = "default",
|
|
18
|
-
customStyles = {},
|
|
19
|
-
showBorder = "bordered",
|
|
20
|
-
...props
|
|
21
|
-
}) => {
|
|
22
|
-
const [isVisible, setIsVisible] = useState(true);
|
|
23
|
-
|
|
24
|
-
if (!isVisible) return null;
|
|
25
|
-
|
|
26
|
-
// Icon mapping
|
|
27
|
-
const iconMap = {
|
|
28
|
-
default: null,
|
|
29
|
-
success: CheckCircle,
|
|
30
|
-
warning: AlertTriangle,
|
|
31
|
-
error: XCircle,
|
|
32
|
-
info: Info,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// Auto-select icon based on variant
|
|
36
|
-
const getIcon = () => {
|
|
37
|
-
if (icon === false) return null;
|
|
38
|
-
if (icon === "auto") return iconMap[variant];
|
|
39
|
-
return icon;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const IconComponent = getIcon();
|
|
43
|
-
|
|
44
|
-
// Handle dismiss
|
|
45
|
-
const handleDismiss = () => {
|
|
46
|
-
setIsVisible(false);
|
|
47
|
-
if (onDismiss) onDismiss();
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const styleConfigs = {
|
|
52
|
-
simple: {
|
|
53
|
-
default: {
|
|
54
|
-
container: 'bg-background border border-border text-foreground p-3',
|
|
55
|
-
icon: 'text-muted-foreground',
|
|
56
|
-
title: 'text-foreground',
|
|
57
|
-
description: 'text-muted-foreground',
|
|
58
|
-
button: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
59
|
-
dismissButton: 'text-muted-foreground hover:text-foreground',
|
|
60
|
-
},
|
|
61
|
-
success: {
|
|
62
|
-
container: "bg-green-950/50 border border-green-800/50 text-green-100 p-3",
|
|
63
|
-
icon: "text-green-400",
|
|
64
|
-
title: "text-green-100",
|
|
65
|
-
description: "text-green-200",
|
|
66
|
-
button: "bg-green-600 text-white hover:bg-green-700",
|
|
67
|
-
dismissButton: "text-green-400 hover:text-green-200"
|
|
68
|
-
},
|
|
69
|
-
warning: {
|
|
70
|
-
container: "bg-orange-950/50 border border-orange-800/50 text-orange-100 p-3",
|
|
71
|
-
icon: "text-orange-400",
|
|
72
|
-
title: "text-orange-100",
|
|
73
|
-
description: "text-orange-200",
|
|
74
|
-
button: "bg-orange-600 text-white hover:bg-orange-700",
|
|
75
|
-
dismissButton: "text-orange-400 hover:text-orange-200"
|
|
76
|
-
},
|
|
77
|
-
error: {
|
|
78
|
-
container: "bg-red-950/50 border border-red-800/50 text-red-100 p-3",
|
|
79
|
-
icon: "text-red-400",
|
|
80
|
-
title: "text-red-100",
|
|
81
|
-
description: "text-red-200",
|
|
82
|
-
button: "bg-red-600 text-white hover:bg-red-700",
|
|
83
|
-
dismissButton: "text-red-400 hover:text-red-200"
|
|
84
|
-
},
|
|
85
|
-
info: {
|
|
86
|
-
container: "bg-blue-950/50 border border-blue-800/50 text-blue-100 p-3",
|
|
87
|
-
icon: "text-blue-400",
|
|
88
|
-
title: "text-blue-100",
|
|
89
|
-
description: "text-blue-200",
|
|
90
|
-
button: "bg-blue-600 text-white hover:bg-blue-700",
|
|
91
|
-
dismissButton: "text-blue-400 hover:text-blue-200"
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
bordered: {
|
|
95
|
-
default: {
|
|
96
|
-
container: 'bg-background border-2 border-border text-foreground shadow-sm p-3',
|
|
97
|
-
icon: 'text-primary',
|
|
98
|
-
title: 'text-foreground font-medium',
|
|
99
|
-
description: 'text-muted-foreground',
|
|
100
|
-
button: 'bg-primary text-primary-foreground hover:bg-primary/90 border-0',
|
|
101
|
-
dismissButton: 'text-muted-foreground hover:text-foreground border border-border hover:bg-muted',
|
|
102
|
-
},
|
|
103
|
-
success: {
|
|
104
|
-
container: "bg-green-950/20 border-2 border-green-500 text-green-100 shadow-md p-3",
|
|
105
|
-
icon: "text-green-400",
|
|
106
|
-
title: "text-green-100 font-semibold",
|
|
107
|
-
description: "text-green-200",
|
|
108
|
-
button: "bg-green-600 text-white hover:bg-green-700 border-0",
|
|
109
|
-
dismissButton: "text-green-400 hover:text-green-200 border border-green-500 hover:bg-green-950/40"
|
|
110
|
-
},
|
|
111
|
-
warning: {
|
|
112
|
-
container: "bg-amber-950/20 border-2 border-amber-500 text-amber-100 shadow-md p-3",
|
|
113
|
-
icon: "text-amber-400",
|
|
114
|
-
title: "text-amber-100 font-semibold",
|
|
115
|
-
description: "text-amber-200",
|
|
116
|
-
button: "bg-amber-600 text-white hover:bg-amber-700 border-0",
|
|
117
|
-
dismissButton: "text-amber-400 hover:text-amber-200 border border-amber-500 hover:bg-amber-950/40"
|
|
118
|
-
},
|
|
119
|
-
error: {
|
|
120
|
-
container: "bg-rose-950/20 border-2 border-rose-500 text-rose-100 shadow-md p-3",
|
|
121
|
-
icon: "text-rose-400",
|
|
122
|
-
title: "text-rose-100 font-semibold",
|
|
123
|
-
description: "text-rose-200",
|
|
124
|
-
button: "bg-rose-600 text-white hover:bg-rose-700 border-0",
|
|
125
|
-
dismissButton: "text-rose-400 hover:text-rose-200 border border-rose-500 hover:bg-rose-950/40"
|
|
126
|
-
},
|
|
127
|
-
info: {
|
|
128
|
-
container: "bg-cyan-950/20 border-2 border-cyan-500 text-cyan-100 shadow-md p-3",
|
|
129
|
-
icon: "text-cyan-400",
|
|
130
|
-
title: "text-cyan-100 font-semibold",
|
|
131
|
-
description: "text-cyan-200",
|
|
132
|
-
button: "bg-cyan-600 text-white hover:bg-cyan-700 border-0",
|
|
133
|
-
dismissButton: "text-cyan-400 hover:text-cyan-200 border border-cyan-500 hover:bg-cyan-950/40"
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
filled: {
|
|
137
|
-
default: {
|
|
138
|
-
container: 'bg-muted text-muted-foreground border-0 p-3',
|
|
139
|
-
icon: 'text-foreground',
|
|
140
|
-
title: 'text-foreground font-medium',
|
|
141
|
-
description: 'text-muted-foreground',
|
|
142
|
-
button: 'bg-background text-foreground hover:bg-background/80',
|
|
143
|
-
dismissButton: 'text-muted-foreground hover:text-foreground',
|
|
144
|
-
},
|
|
145
|
-
success: {
|
|
146
|
-
container: "bg-green-600 text-green-50 border-0 p-3",
|
|
147
|
-
icon: "text-green-100",
|
|
148
|
-
title: "text-green-50 font-medium",
|
|
149
|
-
description: "text-green-100",
|
|
150
|
-
button: "bg-green-800 text-green-50 hover:bg-green-900",
|
|
151
|
-
dismissButton: "text-green-200 hover:text-green-50"
|
|
152
|
-
},
|
|
153
|
-
warning: {
|
|
154
|
-
container: "bg-amber-600 text-amber-50 border-0 p-3",
|
|
155
|
-
icon: "text-amber-100",
|
|
156
|
-
title: "text-amber-50 font-medium",
|
|
157
|
-
description: "text-amber-100",
|
|
158
|
-
button: "bg-amber-800 text-amber-50 hover:bg-amber-900",
|
|
159
|
-
dismissButton: "text-amber-200 hover:text-amber-50"
|
|
160
|
-
},
|
|
161
|
-
error: {
|
|
162
|
-
container: "bg-red-600 text-red-50 border-0 p-3",
|
|
163
|
-
icon: "text-red-100",
|
|
164
|
-
title: "text-red-50 font-medium",
|
|
165
|
-
description: "text-red-100",
|
|
166
|
-
button: "bg-red-800 text-red-50 hover:bg-red-900",
|
|
167
|
-
dismissButton: "text-red-200 hover:text-red-50"
|
|
168
|
-
},
|
|
169
|
-
info: {
|
|
170
|
-
container: "bg-blue-600 text-blue-50 border-0 p-3",
|
|
171
|
-
icon: "text-blue-100",
|
|
172
|
-
title: "text-blue-50 font-medium",
|
|
173
|
-
description: "text-blue-100",
|
|
174
|
-
button: "bg-blue-800 text-blue-50 hover:bg-blue-900",
|
|
175
|
-
dismissButton: "text-blue-200 hover:text-blue-50"
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
accent: {
|
|
179
|
-
default: {
|
|
180
|
-
container: 'bg-background border-l-4 border-primary text-foreground shadow-sm pl-4 p-3',
|
|
181
|
-
icon: 'text-primary',
|
|
182
|
-
title: 'text-foreground font-medium',
|
|
183
|
-
description: 'text-muted-foreground',
|
|
184
|
-
button: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
185
|
-
dismissButton: 'text-muted-foreground hover:text-foreground',
|
|
186
|
-
},
|
|
187
|
-
success: {
|
|
188
|
-
container: "bg-green-950/30 border-l-4 border-green-400 text-green-100 shadow-sm pl-4 p-3",
|
|
189
|
-
icon: "text-green-400",
|
|
190
|
-
title: "text-green-100 font-semibold",
|
|
191
|
-
description: "text-green-200",
|
|
192
|
-
button: "bg-green-600 text-white hover:bg-green-700",
|
|
193
|
-
dismissButton: "text-green-400 hover:text-green-200"
|
|
194
|
-
},
|
|
195
|
-
warning: {
|
|
196
|
-
container: "bg-yellow-950/30 border-l-4 border-yellow-400 text-yellow-100 shadow-sm pl-4 p-3",
|
|
197
|
-
icon: "text-yellow-400",
|
|
198
|
-
title: "text-yellow-100 font-semibold",
|
|
199
|
-
description: "text-yellow-200",
|
|
200
|
-
button: "bg-yellow-600 text-white hover:bg-yellow-700",
|
|
201
|
-
dismissButton: "text-yellow-400 hover:text-yellow-200"
|
|
202
|
-
},
|
|
203
|
-
error: {
|
|
204
|
-
container: "bg-red-950/30 border-l-4 border-red-400 text-red-100 shadow-sm pl-4 p-3",
|
|
205
|
-
icon: "text-red-400",
|
|
206
|
-
title: "text-red-100 font-semibold",
|
|
207
|
-
description: "text-red-200",
|
|
208
|
-
button: "bg-red-600 text-white hover:bg-red-700",
|
|
209
|
-
dismissButton: "text-red-400 hover:text-red-200"
|
|
210
|
-
},
|
|
211
|
-
info: {
|
|
212
|
-
container: "bg-indigo-950/30 border-l-4 border-indigo-400 text-indigo-100 shadow-sm pl-4 p-3",
|
|
213
|
-
icon: "text-indigo-400",
|
|
214
|
-
title: "text-indigo-100 font-semibold",
|
|
215
|
-
description: "text-indigo-200",
|
|
216
|
-
button: "bg-indigo-600 text-white hover:bg-indigo-700",
|
|
217
|
-
dismissButton: "text-indigo-400 hover:text-indigo-200"
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
banner: {
|
|
221
|
-
default: {
|
|
222
|
-
container: 'bg-muted text-foreground border-0 rounded-lg px-4 py-3 p-3',
|
|
223
|
-
icon: 'text-primary',
|
|
224
|
-
title: 'text-foreground font-semibold',
|
|
225
|
-
description: 'text-muted-foreground',
|
|
226
|
-
button: 'bg-background text-foreground hover:bg-background/80 rounded-md',
|
|
227
|
-
dismissButton: 'text-muted-foreground hover:text-foreground',
|
|
228
|
-
},
|
|
229
|
-
success: {
|
|
230
|
-
container: "bg-green-700 text-green-50 border-0 rounded-lg px-4 py-3 p-3",
|
|
231
|
-
icon: "text-green-100",
|
|
232
|
-
title: "text-green-50 font-bold",
|
|
233
|
-
description: "text-green-100",
|
|
234
|
-
button: "bg-green-900 text-green-50 hover:bg-green-950 rounded-md",
|
|
235
|
-
dismissButton: "text-green-200 hover:text-green-50"
|
|
236
|
-
},
|
|
237
|
-
warning: {
|
|
238
|
-
container: "bg-orange-700 text-orange-50 border-0 rounded-lg px-4 py-3 p-3",
|
|
239
|
-
icon: "text-orange-100",
|
|
240
|
-
title: "text-orange-50 font-bold",
|
|
241
|
-
description: "text-orange-100",
|
|
242
|
-
button: "bg-orange-900 text-orange-50 hover:bg-orange-950 rounded-md",
|
|
243
|
-
dismissButton: "text-orange-200 hover:text-orange-50"
|
|
244
|
-
},
|
|
245
|
-
error: {
|
|
246
|
-
container: "bg-red-700 text-red-50 border-0 rounded-lg px-4 py-3 p-3",
|
|
247
|
-
icon: "text-red-100",
|
|
248
|
-
title: "text-red-50 font-bold",
|
|
249
|
-
description: "text-red-100",
|
|
250
|
-
button: "bg-red-900 text-red-50 hover:bg-red-950 rounded-md ",
|
|
251
|
-
dismissButton: "text-red-200 hover:text-red-50"
|
|
252
|
-
},
|
|
253
|
-
info: {
|
|
254
|
-
container: "bg-blue-700 text-blue-50 border-0 rounded-lg px-4 py-3 p-3",
|
|
255
|
-
icon: "text-blue-100",
|
|
256
|
-
title: "text-blue-50 font-bold",
|
|
257
|
-
description: "text-blue-100",
|
|
258
|
-
button: "bg-blue-900 text-blue-50 hover:bg-blue-950 rounded-md",
|
|
259
|
-
dismissButton: "text-blue-200 hover:text-blue-50"
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
card: {
|
|
263
|
-
default: {
|
|
264
|
-
container: 'bg-card border border-border text-card-foreground shadow-lg rounded-lg p-3',
|
|
265
|
-
icon: 'text-primary',
|
|
266
|
-
title: 'text-card-foreground font-semibold',
|
|
267
|
-
description: 'text-muted-foreground',
|
|
268
|
-
button: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
269
|
-
dismissButton: 'text-muted-foreground hover:text-foreground',
|
|
270
|
-
},
|
|
271
|
-
success: {
|
|
272
|
-
container: "bg-green-900/50 border border-green-700 text-green-100 shadow-xl rounded-lg p-4 backdrop-blur-sm",
|
|
273
|
-
icon: "text-green-400",
|
|
274
|
-
title: "text-green-100 font-bold",
|
|
275
|
-
description: "text-green-200",
|
|
276
|
-
button: "bg-green-600 text-white hover:bg-green-700 shadow-sm",
|
|
277
|
-
dismissButton: "text-green-400 hover:text-green-200 hover:bg-green-800/50 rounded-full"
|
|
278
|
-
},
|
|
279
|
-
warning: {
|
|
280
|
-
container: "bg-amber-900/50 border border-amber-700 text-amber-100 shadow-xl rounded-lg p-4 backdrop-blur-sm",
|
|
281
|
-
icon: "text-amber-400",
|
|
282
|
-
title: "text-amber-100 font-bold",
|
|
283
|
-
description: "text-amber-200",
|
|
284
|
-
button: "bg-amber-600 text-white hover:bg-amber-700 shadow-sm",
|
|
285
|
-
dismissButton: "text-amber-400 hover:text-amber-200 hover:bg-amber-800/50 rounded-full"
|
|
286
|
-
},
|
|
287
|
-
error: {
|
|
288
|
-
container: "bg-red-900/50 border border-red-700 text-red-100 shadow-xl rounded-lg p-4 backdrop-blur-sm",
|
|
289
|
-
icon: "text-red-400",
|
|
290
|
-
title: "text-red-100 font-bold",
|
|
291
|
-
description: "text-red-200",
|
|
292
|
-
button: "bg-red-600 text-white hover:bg-red-700 shadow-sm",
|
|
293
|
-
dismissButton: "text-red-400 hover:text-red-200 hover:bg-red-800/50 rounded-full"
|
|
294
|
-
},
|
|
295
|
-
info: {
|
|
296
|
-
container: "bg-blue-900/50 border border-blue-700 text-blue-100 shadow-xl rounded-lg p-4 backdrop-blur-sm",
|
|
297
|
-
icon: "text-blue-400",
|
|
298
|
-
title: "text-blue-100 font-bold",
|
|
299
|
-
description: "text-blue-200",
|
|
300
|
-
button: "bg-blue-600 text-white hover:bg-blue-700 shadow-sm",
|
|
301
|
-
dismissButton: "text-blue-400 hover:text-blue-200 hover:bg-blue-800/50 rounded-full"
|
|
302
|
-
}
|
|
303
|
-
},
|
|
304
|
-
minimal: {
|
|
305
|
-
default: {
|
|
306
|
-
container: 'bg-transparent border-0 text-foreground p-3',
|
|
307
|
-
icon: 'text-muted-foreground',
|
|
308
|
-
title: 'text-foreground',
|
|
309
|
-
description: 'text-muted-foreground text-sm',
|
|
310
|
-
button: 'text-primary hover:text-primary/80 underline bg-transparent p-0',
|
|
311
|
-
dismissButton: 'text-muted-foreground hover:text-foreground bg-transparent',
|
|
312
|
-
},
|
|
313
|
-
success: {
|
|
314
|
-
container: "bg-transparent border-0 text-green-200 p-3",
|
|
315
|
-
icon: "text-green-400",
|
|
316
|
-
title: "text-green-200 font-medium",
|
|
317
|
-
description: "text-green-300 text-sm",
|
|
318
|
-
button: "text-green-400 hover:text-green-200 underline bg-transparent p-0",
|
|
319
|
-
dismissButton: "text-green-500 hover:text-green-300 bg-transparent"
|
|
320
|
-
},
|
|
321
|
-
warning: {
|
|
322
|
-
container: "bg-transparent border-0 text-amber-200 p-3",
|
|
323
|
-
icon: "text-amber-400",
|
|
324
|
-
title: "text-amber-200 font-medium",
|
|
325
|
-
description: "text-amber-300 text-sm",
|
|
326
|
-
button: "text-amber-400 hover:text-amber-200 underline bg-transparent p-0",
|
|
327
|
-
dismissButton: "text-amber-500 hover:text-amber-300 bg-transparent"
|
|
328
|
-
},
|
|
329
|
-
error: {
|
|
330
|
-
container: "bg-transparent border-0 text-red-200 p-3",
|
|
331
|
-
icon: "text-red-400",
|
|
332
|
-
title: "text-red-200 font-medium",
|
|
333
|
-
description: "text-red-300 text-sm",
|
|
334
|
-
button: "text-red-400 hover:text-red-200 underline bg-transparent p-0",
|
|
335
|
-
dismissButton: "text-red-500 hover:text-red-300 bg-transparent"
|
|
336
|
-
},
|
|
337
|
-
info: {
|
|
338
|
-
container: "bg-transparent border-0 text-blue-200 p-3",
|
|
339
|
-
icon: "text-blue-400",
|
|
340
|
-
title: "text-blue-200 font-medium",
|
|
341
|
-
description: "text-blue-300 text-sm",
|
|
342
|
-
button: "text-blue-400 hover:text-blue-200 underline bg-transparent p-0",
|
|
343
|
-
dismissButton: "text-blue-500 hover:text-blue-300 bg-transparent"
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
// Get current theme - FIXED ACCESS PATTERN
|
|
348
|
-
const currentTheme = styleConfigs[style]?.[variant] || styleConfigs.accent.default;
|
|
349
|
-
|
|
350
|
-
// Size configurations
|
|
351
|
-
const sizeConfigs = {
|
|
352
|
-
small: {
|
|
353
|
-
container: "p-3",
|
|
354
|
-
icon: "h-4 w-4",
|
|
355
|
-
title: "text-sm font-medium",
|
|
356
|
-
description: "text-sm",
|
|
357
|
-
spacing: "space-x-2"
|
|
358
|
-
},
|
|
359
|
-
default: {
|
|
360
|
-
container: "p-4",
|
|
361
|
-
icon: "h-5 w-5",
|
|
362
|
-
title: "text-base font-medium",
|
|
363
|
-
description: "text-sm",
|
|
364
|
-
spacing: "space-x-3"
|
|
365
|
-
},
|
|
366
|
-
large: {
|
|
367
|
-
container: "p-6",
|
|
368
|
-
icon: "h-6 w-6",
|
|
369
|
-
title: "text-lg font-medium",
|
|
370
|
-
description: "text-base",
|
|
371
|
-
spacing: "space-x-4"
|
|
372
|
-
}
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
const currentSize = sizeConfigs[size];
|
|
376
|
-
|
|
377
|
-
// Rounded configurations
|
|
378
|
-
const roundedConfigs = {
|
|
379
|
-
none: "",
|
|
380
|
-
small: "rounded-sm",
|
|
381
|
-
default: "rounded-md",
|
|
382
|
-
large: "rounded-lg",
|
|
383
|
-
full: "rounded-xl"
|
|
384
|
-
};
|
|
385
|
-
|
|
386
|
-
// Render action button
|
|
387
|
-
const renderActionButton = (action, isPrimary = true) => {
|
|
388
|
-
if (!action) return null;
|
|
389
|
-
|
|
390
|
-
const buttonClasses = `inline-flex items-center px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${
|
|
391
|
-
isPrimary ? currentTheme.button : 'text-muted-foreground bg-background border border-border hover:bg-muted'
|
|
392
|
-
}`;
|
|
393
|
-
|
|
394
|
-
const content = (
|
|
395
|
-
<>
|
|
396
|
-
{action.text}
|
|
397
|
-
{action.href && <ExternalLink className="ml-1 h-3 w-3" />}
|
|
398
|
-
{!action.href && isPrimary && <ArrowRight className="ml-1 h-3 w-3" />}
|
|
399
|
-
</>
|
|
400
|
-
);
|
|
401
|
-
|
|
402
|
-
if (action.href) {
|
|
403
|
-
return (
|
|
404
|
-
<a
|
|
405
|
-
href={action.href}
|
|
406
|
-
className={buttonClasses}
|
|
407
|
-
target="_blank"
|
|
408
|
-
rel="noopener noreferrer"
|
|
409
|
-
>
|
|
410
|
-
{content}
|
|
411
|
-
</a>
|
|
412
|
-
);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
return (
|
|
416
|
-
<button
|
|
417
|
-
onClick={action.onClick}
|
|
418
|
-
className={buttonClasses}
|
|
419
|
-
>
|
|
420
|
-
{content}
|
|
421
|
-
</button>
|
|
422
|
-
);
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
return (
|
|
426
|
-
<div
|
|
427
|
-
className={`
|
|
428
|
-
${currentTheme.container}
|
|
429
|
-
${currentSize.container}
|
|
430
|
-
${roundedConfigs[rounded]}
|
|
431
|
-
${className}
|
|
432
|
-
`}
|
|
433
|
-
style={customStyles}
|
|
434
|
-
{...props}
|
|
435
|
-
>
|
|
436
|
-
<div className="flex">
|
|
437
|
-
{/* Icon */}
|
|
438
|
-
{IconComponent && iconPosition === 'left' && (
|
|
439
|
-
<div className="flex-shrink-0">
|
|
440
|
-
<IconComponent className={`${currentSize.icon} ${currentTheme.icon}`} />
|
|
441
|
-
</div>
|
|
442
|
-
)}
|
|
443
|
-
|
|
444
|
-
{/* Content */}
|
|
445
|
-
<div className={`flex-1 ${IconComponent && iconPosition === 'left' ? 'ml-3' : ''}`}>
|
|
446
|
-
{/* Icon on top */}
|
|
447
|
-
{IconComponent && iconPosition === 'top' && (
|
|
448
|
-
<div className="mb-2">
|
|
449
|
-
<IconComponent className={`${currentSize.icon} ${currentTheme.icon}`} />
|
|
450
|
-
</div>
|
|
451
|
-
)}
|
|
452
|
-
|
|
453
|
-
{/* Title */}
|
|
454
|
-
{title && (
|
|
455
|
-
<h3 className={`${currentSize.title} ${currentTheme.title}`}>
|
|
456
|
-
{title}
|
|
457
|
-
</h3>
|
|
458
|
-
)}
|
|
459
|
-
|
|
460
|
-
{/* Description */}
|
|
461
|
-
{description && (
|
|
462
|
-
<div className={`mt-1 ${currentSize.description} ${currentTheme.description}`}>
|
|
463
|
-
{description}
|
|
464
|
-
</div>
|
|
465
|
-
)}
|
|
466
|
-
|
|
467
|
-
{/* Actions */}
|
|
468
|
-
{(primaryAction || secondaryAction) && (
|
|
469
|
-
<div className="mt-4 flex space-x-3">
|
|
470
|
-
{renderActionButton(primaryAction, true)}
|
|
471
|
-
{renderActionButton(secondaryAction, false)}
|
|
472
|
-
</div>
|
|
473
|
-
)}
|
|
474
|
-
</div>
|
|
475
|
-
|
|
476
|
-
{/* Dismiss Button */}
|
|
477
|
-
{dismissible && (
|
|
478
|
-
<div className="flex-shrink-0 ml-4">
|
|
479
|
-
<button
|
|
480
|
-
onClick={handleDismiss}
|
|
481
|
-
className={`inline-flex rounded-md p-1.5 transition-colors ${currentTheme.dismissButton}`}
|
|
482
|
-
>
|
|
483
|
-
<span className="sr-only">Dismiss</span>
|
|
484
|
-
<X className="h-4 w-4" />
|
|
485
|
-
</button>
|
|
486
|
-
</div>
|
|
487
|
-
)}
|
|
488
|
-
</div>
|
|
489
|
-
</div>
|
|
490
|
-
);
|
|
491
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// Claude - 10:09 pm Thursday Oct 9th 2025
|
|
2
|
-
|
|
3
|
-
import React from 'react'
|
|
4
|
-
import { cva, type VariantProps } from 'class-variance-authority'
|
|
5
|
-
import { cn } from '~/components/catalyst-ui'
|
|
6
|
-
|
|
7
|
-
// these few weird ones that weren't in the demo, shadcn just released some new components, and just had the ai's build them to start
|
|
8
|
-
const spinnerVariants = cva(
|
|
9
|
-
"animate-spin rounded-full border-2 border-solid border-current border-r-transparent",
|
|
10
|
-
{
|
|
11
|
-
variants: {
|
|
12
|
-
size: {
|
|
13
|
-
sm: "size-4",
|
|
14
|
-
default: "size-6",
|
|
15
|
-
lg: "size-8",
|
|
16
|
-
xl: "size-12",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
defaultVariants: {
|
|
20
|
-
size: "default",
|
|
21
|
-
},
|
|
22
|
-
}
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
function SpinnerV1({
|
|
26
|
-
className,
|
|
27
|
-
size,
|
|
28
|
-
...props
|
|
29
|
-
}: React.ComponentProps<"div"> & VariantProps<typeof spinnerVariants>) {
|
|
30
|
-
return (
|
|
31
|
-
<div
|
|
32
|
-
role="status"
|
|
33
|
-
aria-label="Loading"
|
|
34
|
-
className={cn(spinnerVariants({ size, className }))}
|
|
35
|
-
{...props}
|
|
36
|
-
/>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function SpinnerV1Demo() {
|
|
41
|
-
return (
|
|
42
|
-
<div className="space-y-8 p-6 max-w-2xl mx-auto">
|
|
43
|
-
<div>
|
|
44
|
-
<h2 className="text-2xl font-bold mb-4">SpinnerV1 Sizes</h2>
|
|
45
|
-
<div className="flex items-center gap-4">
|
|
46
|
-
<SpinnerV1 size="sm" />
|
|
47
|
-
<SpinnerV1 size="default" />
|
|
48
|
-
<SpinnerV1 size="lg" />
|
|
49
|
-
<SpinnerV1 size="xl" />
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
<div>
|
|
53
|
-
<h2 className="text-2xl font-bold mb-4">Custom Color</h2>
|
|
54
|
-
<div className="flex items-center gap-4">
|
|
55
|
-
<SpinnerV1 className="text-primary" />
|
|
56
|
-
<SpinnerV1 className="text-destructive" />
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
export { SpinnerV1, spinnerVariants }
|