@surreal-ui/react 0.5.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.
Files changed (125) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/index.js +11307 -0
  3. package/package.json +38 -0
  4. package/src/components/GlassmorphismAlert.tsx +40 -0
  5. package/src/components/GlassmorphismButton.tsx +20 -0
  6. package/src/components/GlassmorphismCard.tsx +43 -0
  7. package/src/components/GlassmorphismEmptyState.tsx +20 -0
  8. package/src/components/GlassmorphismInputGroup.tsx +148 -0
  9. package/src/components/GlassmorphismMenubar.tsx +96 -0
  10. package/src/components/GlassmorphismScrollArea.tsx +67 -0
  11. package/src/components/GlassmorphismTable.tsx +61 -0
  12. package/src/components/GlassmorphismTypography.tsx +31 -0
  13. package/src/components/MinimalistAccordion.tsx +215 -0
  14. package/src/components/MinimalistAlert.tsx +40 -0
  15. package/src/components/MinimalistAlertDialog.tsx +317 -0
  16. package/src/components/MinimalistAspectRatio.tsx +30 -0
  17. package/src/components/MinimalistAvatar.tsx +149 -0
  18. package/src/components/MinimalistBadge.tsx +49 -0
  19. package/src/components/MinimalistBreadcrumb.tsx +105 -0
  20. package/src/components/MinimalistButton.tsx +86 -0
  21. package/src/components/MinimalistButtonGroup.tsx +85 -0
  22. package/src/components/MinimalistCalendar.tsx +352 -0
  23. package/src/components/MinimalistCard.tsx +89 -0
  24. package/src/components/MinimalistCarousel.tsx +266 -0
  25. package/src/components/MinimalistChart.tsx +296 -0
  26. package/src/components/MinimalistCheckbox.tsx +117 -0
  27. package/src/components/MinimalistCodeBlock.tsx +203 -0
  28. package/src/components/MinimalistCollapsible.tsx +134 -0
  29. package/src/components/MinimalistCommand.tsx +344 -0
  30. package/src/components/MinimalistContextMenu.tsx +400 -0
  31. package/src/components/MinimalistDialog.tsx +269 -0
  32. package/src/components/MinimalistDrawer.tsx +216 -0
  33. package/src/components/MinimalistDropdownMenu.tsx +431 -0
  34. package/src/components/MinimalistEmpty.tsx +105 -0
  35. package/src/components/MinimalistEmptyState.tsx +34 -0
  36. package/src/components/MinimalistField.tsx +275 -0
  37. package/src/components/MinimalistForm.tsx +203 -0
  38. package/src/components/MinimalistHoverCard.tsx +48 -0
  39. package/src/components/MinimalistInput.tsx +24 -0
  40. package/src/components/MinimalistInputGroup.tsx +180 -0
  41. package/src/components/MinimalistInputOtp.tsx +189 -0
  42. package/src/components/MinimalistItem.tsx +181 -0
  43. package/src/components/MinimalistKbd.tsx +46 -0
  44. package/src/components/MinimalistLabel.tsx +19 -0
  45. package/src/components/MinimalistMenubar.tsx +491 -0
  46. package/src/components/MinimalistNativeSelect.tsx +77 -0
  47. package/src/components/MinimalistNavigationMenu.tsx +198 -0
  48. package/src/components/MinimalistPagination.tsx +152 -0
  49. package/src/components/MinimalistPopover.tsx +228 -0
  50. package/src/components/MinimalistProgress.tsx +39 -0
  51. package/src/components/MinimalistRadioGroup.tsx +115 -0
  52. package/src/components/MinimalistRangeCalendar.tsx +396 -0
  53. package/src/components/MinimalistResizable.tsx +54 -0
  54. package/src/components/MinimalistScrollArea.tsx +41 -0
  55. package/src/components/MinimalistSelect.tsx +265 -0
  56. package/src/components/MinimalistSeparator.tsx +45 -0
  57. package/src/components/MinimalistSheet.tsx +247 -0
  58. package/src/components/MinimalistSidebar.tsx +637 -0
  59. package/src/components/MinimalistSkeleton.tsx +16 -0
  60. package/src/components/MinimalistSlider.tsx +213 -0
  61. package/src/components/MinimalistSonner.tsx +41 -0
  62. package/src/components/MinimalistSpinner.tsx +39 -0
  63. package/src/components/MinimalistSwitch.tsx +92 -0
  64. package/src/components/MinimalistTable.tsx +65 -0
  65. package/src/components/MinimalistTabs.tsx +166 -0
  66. package/src/components/MinimalistTextarea.tsx +24 -0
  67. package/src/components/MinimalistToggle.tsx +74 -0
  68. package/src/components/MinimalistToggleGroup.tsx +196 -0
  69. package/src/components/MinimalistTooltip.tsx +172 -0
  70. package/src/components/MinimalistTypography.tsx +33 -0
  71. package/src/components/NeubrutalismCard.tsx +3 -0
  72. package/src/components/NeubrutalismItem.tsx +48 -0
  73. package/src/components/ShadcnAccordion.tsx +215 -0
  74. package/src/components/ShadcnAlertDialog.tsx +317 -0
  75. package/src/components/ShadcnAspectRatio.tsx +30 -0
  76. package/src/components/ShadcnAvatar.tsx +149 -0
  77. package/src/components/ShadcnBadge.tsx +49 -0
  78. package/src/components/ShadcnBreadcrumb.tsx +105 -0
  79. package/src/components/ShadcnButton.tsx +86 -0
  80. package/src/components/ShadcnButtonGroup.tsx +85 -0
  81. package/src/components/ShadcnCalendar.tsx +352 -0
  82. package/src/components/ShadcnCarousel.tsx +266 -0
  83. package/src/components/ShadcnChart.tsx +296 -0
  84. package/src/components/ShadcnCheckbox.tsx +117 -0
  85. package/src/components/ShadcnCodeBlock.tsx +203 -0
  86. package/src/components/ShadcnCollapsible.tsx +134 -0
  87. package/src/components/ShadcnCommand.tsx +344 -0
  88. package/src/components/ShadcnContextMenu.tsx +400 -0
  89. package/src/components/ShadcnDialog.tsx +269 -0
  90. package/src/components/ShadcnDrawer.tsx +216 -0
  91. package/src/components/ShadcnDropdownMenu.tsx +431 -0
  92. package/src/components/ShadcnEmpty.tsx +105 -0
  93. package/src/components/ShadcnField.tsx +275 -0
  94. package/src/components/ShadcnForm.tsx +203 -0
  95. package/src/components/ShadcnHoverCard.tsx +48 -0
  96. package/src/components/ShadcnInput.tsx +24 -0
  97. package/src/components/ShadcnInputGroup.tsx +180 -0
  98. package/src/components/ShadcnInputOtp.tsx +189 -0
  99. package/src/components/ShadcnItem.tsx +181 -0
  100. package/src/components/ShadcnKbd.tsx +46 -0
  101. package/src/components/ShadcnLabel.tsx +19 -0
  102. package/src/components/ShadcnMenubar.tsx +491 -0
  103. package/src/components/ShadcnNativeSelect.tsx +77 -0
  104. package/src/components/ShadcnNavigationMenu.tsx +198 -0
  105. package/src/components/ShadcnPagination.tsx +152 -0
  106. package/src/components/ShadcnPopover.tsx +228 -0
  107. package/src/components/ShadcnProgress.tsx +39 -0
  108. package/src/components/ShadcnRadioGroup.tsx +115 -0
  109. package/src/components/ShadcnRangeCalendar.tsx +396 -0
  110. package/src/components/ShadcnSelect.tsx +265 -0
  111. package/src/components/ShadcnSeparator.tsx +45 -0
  112. package/src/components/ShadcnSheet.tsx +247 -0
  113. package/src/components/ShadcnSidebar.tsx +637 -0
  114. package/src/components/ShadcnSkeleton.tsx +16 -0
  115. package/src/components/ShadcnSlider.tsx +213 -0
  116. package/src/components/ShadcnSonner.tsx +41 -0
  117. package/src/components/ShadcnSpinner.tsx +39 -0
  118. package/src/components/ShadcnSwitch.tsx +92 -0
  119. package/src/components/ShadcnTabs.tsx +166 -0
  120. package/src/components/ShadcnTextarea.tsx +24 -0
  121. package/src/components/ShadcnToggle.tsx +74 -0
  122. package/src/components/ShadcnToggleGroup.tsx +196 -0
  123. package/src/components/ShadcnTooltip.tsx +172 -0
  124. package/src/index.ts +124 -0
  125. package/tsconfig.json +10 -0
@@ -0,0 +1,352 @@
1
+ import * as React from 'react';
2
+ import { ChevronLeft, ChevronRight, ChevronDown } from 'lucide-react';
3
+ import { cn } from '@surreal-ui/core';
4
+
5
+ export interface ShadcnCalendarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
6
+ value?: Date | string | null;
7
+ defaultValue?: Date | string | null;
8
+ locale?: string;
9
+ weekdayFormat?: 'short' | 'narrow' | 'long';
10
+ captionLayout?: 'label' | 'dropdown' | 'dropdown-months' | 'dropdown-years';
11
+ minDate?: Date;
12
+ maxDate?: Date;
13
+ disableDaysOutsideMonth?: boolean;
14
+ onChange?: (date: Date) => void;
15
+ }
16
+
17
+ export function ShadcnCalendar({
18
+ value: controlledValue,
19
+ defaultValue = null,
20
+ locale = 'en-US',
21
+ weekdayFormat = 'short',
22
+ captionLayout = 'label',
23
+ minDate,
24
+ maxDate,
25
+ disableDaysOutsideMonth = false,
26
+ onChange,
27
+ className,
28
+ ...props
29
+ }: CalendarProps) {
30
+ const [internalDate, setInternalDate] = React.useState<Date | null>(() => {
31
+ if (controlledValue) return new Date(controlledValue);
32
+ if (defaultValue) return new Date(defaultValue);
33
+ return null;
34
+ });
35
+
36
+ const selectedDate =
37
+ controlledValue !== undefined
38
+ ? controlledValue
39
+ ? new Date(controlledValue)
40
+ : null
41
+ : internalDate;
42
+
43
+ const [currentMonth, setCurrentMonth] = React.useState<Date>(() => {
44
+ const initial = selectedDate || new Date();
45
+ return new Date(initial.getFullYear(), initial.getMonth(), 1);
46
+ });
47
+
48
+ const monthNames = React.useMemo(
49
+ () => [
50
+ 'January',
51
+ 'February',
52
+ 'March',
53
+ 'April',
54
+ 'May',
55
+ 'June',
56
+ 'July',
57
+ 'August',
58
+ 'September',
59
+ 'October',
60
+ 'November',
61
+ 'December',
62
+ ],
63
+ [],
64
+ );
65
+
66
+ const weekdays = React.useMemo(() => {
67
+ const days: string[] = [];
68
+ const temp = new Date(2023, 0, 1); // Sunday
69
+ for (let i = 0; i < 7; i++) {
70
+ days.push(new Intl.DateTimeFormat(locale, { weekday: weekdayFormat }).format(temp));
71
+ temp.setDate(temp.getDate() + 1);
72
+ }
73
+ return days;
74
+ }, [locale, weekdayFormat]);
75
+
76
+ const monthYearLabel = React.useMemo(() => {
77
+ const month = new Intl.DateTimeFormat(locale, { month: 'long' }).format(currentMonth);
78
+ const year = new Intl.DateTimeFormat(locale, { year: 'numeric' }).format(currentMonth);
79
+ return { month, year };
80
+ }, [locale, currentMonth]);
81
+
82
+ const yearList = React.useMemo(() => {
83
+ const startYear = currentMonth.getFullYear() - 10;
84
+ return Array.from({ length: 21 }, (_, i) => startYear + i);
85
+ }, [currentMonth]);
86
+
87
+ const calendarGrid = React.useMemo(() => {
88
+ const year = currentMonth.getFullYear();
89
+ const month = currentMonth.getMonth();
90
+ const firstDay = new Date(year, month, 1);
91
+ const lastDay = new Date(year, month + 1, 0);
92
+
93
+ const startOffset = firstDay.getDay();
94
+ const daysInMonth = lastDay.getDate();
95
+ const prevMonthLastDay = new Date(year, month, 0).getDate();
96
+
97
+ const today = new Date();
98
+ today.setHours(0, 0, 0, 0);
99
+
100
+ const weeks: Array<
101
+ Array<{
102
+ date: Date;
103
+ isCurrentMonth: boolean;
104
+ isToday: boolean;
105
+ isSelected: boolean;
106
+ isDisabled: boolean;
107
+ }>
108
+ > = [];
109
+ let currentWeek: Array<{
110
+ date: Date;
111
+ isCurrentMonth: boolean;
112
+ isToday: boolean;
113
+ isSelected: boolean;
114
+ isDisabled: boolean;
115
+ }> = [];
116
+
117
+ for (let i = startOffset - 1; i >= 0; i--) {
118
+ const d = new Date(year, month - 1, prevMonthLastDay - i);
119
+ d.setHours(0, 0, 0, 0);
120
+ currentWeek.push({
121
+ date: d,
122
+ isCurrentMonth: false,
123
+ isToday: d.getTime() === today.getTime(),
124
+ isSelected:
125
+ !!selectedDate &&
126
+ d.getFullYear() === selectedDate.getFullYear() &&
127
+ d.getMonth() === selectedDate.getMonth() &&
128
+ d.getDate() === selectedDate.getDate(),
129
+ isDisabled:
130
+ disableDaysOutsideMonth || (!!minDate && d < minDate) || (!!maxDate && d > maxDate),
131
+ });
132
+ }
133
+
134
+ for (let day = 1; day <= daysInMonth; day++) {
135
+ const d = new Date(year, month, day);
136
+ d.setHours(0, 0, 0, 0);
137
+ const isSelected =
138
+ !!selectedDate &&
139
+ d.getFullYear() === selectedDate.getFullYear() &&
140
+ d.getMonth() === selectedDate.getMonth() &&
141
+ d.getDate() === selectedDate.getDate();
142
+ currentWeek.push({
143
+ date: d,
144
+ isCurrentMonth: true,
145
+ isToday: d.getTime() === today.getTime(),
146
+ isSelected,
147
+ isDisabled: (!!minDate && d < minDate) || (!!maxDate && d > maxDate),
148
+ });
149
+
150
+ if (currentWeek.length === 7) {
151
+ weeks.push(currentWeek);
152
+ currentWeek = [];
153
+ }
154
+ }
155
+
156
+ if (currentWeek.length > 0) {
157
+ let nextDay = 1;
158
+ while (currentWeek.length < 7) {
159
+ const d = new Date(year, month + 1, nextDay);
160
+ d.setHours(0, 0, 0, 0);
161
+ currentWeek.push({
162
+ date: d,
163
+ isCurrentMonth: false,
164
+ isToday: d.getTime() === today.getTime(),
165
+ isSelected:
166
+ !!selectedDate &&
167
+ d.getFullYear() === selectedDate.getFullYear() &&
168
+ d.getMonth() === selectedDate.getMonth() &&
169
+ d.getDate() === selectedDate.getDate(),
170
+ isDisabled:
171
+ disableDaysOutsideMonth || (!!minDate && d < minDate) || (!!maxDate && d > maxDate),
172
+ });
173
+ nextDay++;
174
+ }
175
+ weeks.push(currentWeek);
176
+ }
177
+
178
+ return weeks;
179
+ }, [currentMonth, selectedDate, disableDaysOutsideMonth, minDate, maxDate]);
180
+
181
+ const handleSelect = (date: Date, disabled: boolean) => {
182
+ if (disabled) return;
183
+ if (controlledValue === undefined) {
184
+ setInternalDate(date);
185
+ }
186
+ onChange?.(date);
187
+ };
188
+
189
+ return (
190
+ <div
191
+ data-slot="calendar"
192
+ className={cn(
193
+ 'p-3 rounded-lg border border-border bg-background text-foreground shadow-sm inline-block select-none',
194
+ className,
195
+ )}
196
+ {...props}
197
+ >
198
+ <div className="flex flex-col gap-4">
199
+ <div className="relative flex items-center justify-between pt-1">
200
+ <div className="flex items-center gap-1.5 text-sm font-semibold pl-1">
201
+ {captionLayout === 'dropdown' || captionLayout === 'dropdown-months' ? (
202
+ <div className="relative flex items-center">
203
+ <select
204
+ aria-label="Select month"
205
+ value={currentMonth.getMonth()}
206
+ onChange={(e) => {
207
+ const m = parseInt(e.target.value, 10);
208
+ setCurrentMonth(new Date(currentMonth.getFullYear(), m, 1));
209
+ }}
210
+ className="appearance-none bg-transparent hover:bg-accent hover:text-accent-foreground text-sm font-medium py-1 ps-2 pe-6 rounded-md border border-input cursor-pointer focus:outline-none focus:ring-1 focus:ring-ring"
211
+ >
212
+ {monthNames.map((name, idx) => (
213
+ <option key={name} value={idx}>
214
+ {name}
215
+ </option>
216
+ ))}
217
+ </select>
218
+ <ChevronDown className="pointer-events-none absolute right-1.5 size-3.5 text-muted-foreground" />
219
+ </div>
220
+ ) : (
221
+ <span>{monthYearLabel.month}</span>
222
+ )}
223
+
224
+ {captionLayout === 'dropdown' || captionLayout === 'dropdown-years' ? (
225
+ <div className="relative flex items-center">
226
+ <select
227
+ aria-label="Select year"
228
+ value={currentMonth.getFullYear()}
229
+ onChange={(e) => {
230
+ const y = parseInt(e.target.value, 10);
231
+ setCurrentMonth(new Date(y, currentMonth.getMonth(), 1));
232
+ }}
233
+ className="appearance-none bg-transparent hover:bg-accent hover:text-accent-foreground text-sm font-medium py-1 ps-2 pe-6 rounded-md border border-input cursor-pointer focus:outline-none focus:ring-1 focus:ring-ring"
234
+ >
235
+ {yearList.map((y) => (
236
+ <option key={y} value={y}>
237
+ {y}
238
+ </option>
239
+ ))}
240
+ </select>
241
+ <ChevronDown className="pointer-events-none absolute right-1.5 size-3.5 text-muted-foreground" />
242
+ </div>
243
+ ) : (
244
+ <span>{monthYearLabel.year}</span>
245
+ )}
246
+ </div>
247
+
248
+ <div className="flex items-center gap-1">
249
+ <button
250
+ type="button"
251
+ onClick={() =>
252
+ setCurrentMonth(
253
+ new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1, 1),
254
+ )
255
+ }
256
+ aria-label="Previous Month"
257
+ className="inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
258
+ >
259
+ <ChevronLeft className="size-4" />
260
+ </button>
261
+ <button
262
+ type="button"
263
+ onClick={() =>
264
+ setCurrentMonth(
265
+ new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1),
266
+ )
267
+ }
268
+ aria-label="Next Month"
269
+ className="inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
270
+ >
271
+ <ChevronRight className="size-4" />
272
+ </button>
273
+ </div>
274
+ </div>
275
+
276
+ <div className="w-full">
277
+ <div className="grid grid-cols-7 mb-1">
278
+ {weekdays.map((day, idx) => (
279
+ <div
280
+ key={idx}
281
+ className="size-8 flex items-center justify-center text-[0.8rem] font-medium text-muted-foreground"
282
+ >
283
+ {day.slice(0, 2)}
284
+ </div>
285
+ ))}
286
+ </div>
287
+
288
+ <div className="grid grid-cols-7 gap-y-1">
289
+ {calendarGrid.flatMap((week, wIdx) =>
290
+ week.map((cell, cIdx) => (
291
+ <button
292
+ key={`${wIdx}-${cIdx}`}
293
+ type="button"
294
+ disabled={cell.isDisabled}
295
+ onClick={() => handleSelect(cell.date, cell.isDisabled)}
296
+ className={cn(
297
+ 'size-8 flex items-center justify-center rounded-md text-sm font-normal transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',
298
+ !cell.isCurrentMonth && 'text-muted-foreground opacity-40',
299
+ cell.isToday &&
300
+ !cell.isSelected &&
301
+ 'bg-accent text-accent-foreground font-semibold',
302
+ cell.isSelected &&
303
+ 'bg-primary text-primary-foreground font-medium hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',
304
+ !cell.isSelected &&
305
+ !cell.isDisabled &&
306
+ 'hover:bg-accent hover:text-accent-foreground',
307
+ cell.isDisabled && 'pointer-events-none opacity-20',
308
+ )}
309
+ >
310
+ {cell.date.getDate()}
311
+ </button>
312
+ )),
313
+ )}
314
+ </div>
315
+ </div>
316
+ </div>
317
+ </div>
318
+ );
319
+ }
320
+
321
+ // Subcomponent exports
322
+ export const ShadcnCalendarHeader = React.forwardRef<
323
+ HTMLDivElement,
324
+ React.HTMLAttributes<HTMLDivElement>
325
+ >(({ className, ...props }, ref) => (
326
+ <div
327
+ ref={ref}
328
+ className={cn(
329
+ 'flex h-7 w-full items-center justify-center gap-1.5 text-sm font-medium',
330
+ className,
331
+ )}
332
+ {...props}
333
+ />
334
+ ));
335
+ CalendarHeader.displayName = 'CalendarHeader';
336
+
337
+ export const CalendarMonths = React.forwardRef<
338
+ HTMLDivElement,
339
+ React.HTMLAttributes<HTMLDivElement>
340
+ >(({ className, ...props }, ref) => (
341
+ <div ref={ref} className={cn('relative flex flex-col gap-4 md:flex-row', className)} {...props} />
342
+ ));
343
+ CalendarMonths.displayName = 'CalendarMonths';
344
+
345
+ export const CalendarMonth = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
346
+ ({ className, ...props }, ref) => (
347
+ <div ref={ref} className={cn('flex w-full flex-col gap-4', className)} {...props} />
348
+ ),
349
+ );
350
+ CalendarMonth.displayName = 'CalendarMonth';
351
+
352
+ export default MinimalistCalendar;
@@ -0,0 +1,89 @@
1
+ import React, { useState } from 'react';
2
+ import { Eye, SunMoon } from 'lucide-react';
3
+
4
+ interface ModernCardProps {
5
+ title: string;
6
+ screenshot?: string;
7
+ themeSupport?: string;
8
+ bgTheme?: string;
9
+ onBgThemeChange?: (theme: string) => void;
10
+ }
11
+
12
+ export const ModernCard: React.FC<ModernCardProps> = ({
13
+ title,
14
+ screenshot = '',
15
+ themeSupport = 'light-and-dark',
16
+ bgTheme: externalBgTheme,
17
+ onBgThemeChange,
18
+ }) => {
19
+ const [internalBgTheme, setInternalBgTheme] = useState('dark-grid');
20
+ const bgTheme = externalBgTheme !== undefined ? externalBgTheme : internalBgTheme;
21
+ const setBgTheme = (theme: string) => {
22
+ if (onBgThemeChange) onBgThemeChange(theme);
23
+ setInternalBgTheme(theme);
24
+ };
25
+
26
+ return (
27
+ <section className="rounded-3xl border border-slate-800 overflow-hidden bg-slate-900/50 shadow-2xl space-y-0">
28
+ <div className="px-6 py-3 bg-slate-900/90 border-b border-slate-800 flex flex-wrap items-center justify-between gap-4">
29
+ <div className="flex items-center gap-2 text-xs font-medium text-slate-300">
30
+ <Eye className="w-4 h-4 text-indigo-400" />
31
+ <span>Actual Rendered Component Preview</span>
32
+ {themeSupport === 'light-and-dark' && (
33
+ <span className="inline-flex items-center gap-1 text-[10px] px-2 py-0.5 rounded bg-emerald-500/10 text-emerald-300 border border-emerald-500/20">
34
+ <SunMoon className="w-3 h-3 text-emerald-400" /> Light & Dark Modes
35
+ </span>
36
+ )}
37
+ </div>
38
+ <div className="flex items-center gap-1.5 bg-slate-950 p-1 rounded-xl border border-slate-800/80 text-xs">
39
+ <button
40
+ onClick={() => setBgTheme('dark-grid')}
41
+ className={`px-2.5 py-1 rounded-lg transition-colors ${bgTheme === 'dark-grid' ? 'bg-indigo-600 text-white' : 'text-slate-400 hover:text-white'}`}
42
+ >
43
+ Dark Grid
44
+ </button>
45
+ <button
46
+ onClick={() => setBgTheme('glass-gradient')}
47
+ className={`px-2.5 py-1 rounded-lg transition-colors ${bgTheme === 'glass-gradient' ? 'bg-indigo-600 text-white' : 'text-slate-400 hover:text-white'}`}
48
+ >
49
+ Glass Gradient
50
+ </button>
51
+ <button
52
+ onClick={() => setBgTheme('light')}
53
+ className={`px-2.5 py-1 rounded-lg transition-colors ${bgTheme === 'light' ? 'bg-indigo-600 text-white' : 'text-slate-400 hover:text-white'}`}
54
+ >
55
+ Light Mode
56
+ </button>
57
+ </div>
58
+ </div>
59
+ <div
60
+ className={`min-h-[280px] p-8 flex items-center justify-center transition-all ${
61
+ bgTheme === 'dark-grid'
62
+ ? 'bg-slate-950 bg-grid-pattern'
63
+ : bgTheme === 'glass-gradient'
64
+ ? 'bg-gradient-to-tr from-indigo-900 via-purple-900 to-slate-900'
65
+ : 'bg-slate-100 text-slate-900'
66
+ }`}
67
+ >
68
+ {screenshot ? (
69
+ <div className="max-w-lg w-full rounded-2xl overflow-hidden border border-slate-700/50 shadow-2xl bg-slate-900 p-2">
70
+ <img
71
+ src={screenshot}
72
+ alt={`Rendered preview of ${title}`}
73
+ className="w-full h-auto rounded-xl object-contain"
74
+ />
75
+ </div>
76
+ ) : (
77
+ <div className="p-8 rounded-2xl bg-slate-900 border border-slate-800 text-center space-y-3 max-w-sm">
78
+ <h3 className="text-base font-bold text-white">{title}</h3>
79
+ <p className="text-xs text-slate-400">
80
+ Encapsulated multi-platform component package preview.
81
+ </p>
82
+ </div>
83
+ )}
84
+ </div>
85
+ </section>
86
+ );
87
+ };
88
+
89
+ export default MinimalistCard;