@pattern-stack/frontend-patterns 0.0.1 → 0.0.3

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 (153) hide show
  1. package/README.md +6 -6
  2. package/package.json +3 -5
  3. package/src/App.css +0 -42
  4. package/src/App.tsx +0 -54
  5. package/src/__tests__/README.md +0 -221
  6. package/src/__tests__/atoms/hooks/simple-hooks.test.ts +0 -44
  7. package/src/__tests__/atoms/ui/button.test.tsx +0 -68
  8. package/src/__tests__/atoms/utils/simple.test.ts +0 -18
  9. package/src/__tests__/atoms/utils/utils.test.ts +0 -77
  10. package/src/__tests__/features/auth/simple-auth.test.tsx +0 -40
  11. package/src/__tests__/molecules/layout/simple-layout.test.tsx +0 -81
  12. package/src/__tests__/organisms/showcase/simple-showcase.test.tsx +0 -167
  13. package/src/__tests__/setup.ts +0 -51
  14. package/src/__tests__/utils.tsx +0 -123
  15. package/src/atoms/composed/Accordion/Accordion.tsx +0 -271
  16. package/src/atoms/composed/Accordion/index.ts +0 -1
  17. package/src/atoms/composed/Alert/Alert.tsx +0 -132
  18. package/src/atoms/composed/Alert/index.ts +0 -1
  19. package/src/atoms/composed/Breadcrumb/Breadcrumb.tsx +0 -83
  20. package/src/atoms/composed/Breadcrumb/index.ts +0 -1
  21. package/src/atoms/composed/Chart/Chart.tsx +0 -425
  22. package/src/atoms/composed/Chart/index.ts +0 -2
  23. package/src/atoms/composed/ColorSwatch/ColorSwatch.tsx +0 -72
  24. package/src/atoms/composed/ColorSwatch/index.ts +0 -1
  25. package/src/atoms/composed/DarkModeToggle.tsx +0 -66
  26. package/src/atoms/composed/DataBadge/DataBadge.tsx +0 -81
  27. package/src/atoms/composed/DataBadge/index.ts +0 -1
  28. package/src/atoms/composed/DataTable/DataTable.tsx +0 -394
  29. package/src/atoms/composed/DataTable/TableCellWithTooltip.tsx +0 -41
  30. package/src/atoms/composed/DataTable/index.ts +0 -2
  31. package/src/atoms/composed/DateTimePicker/DateTimePicker.tsx +0 -611
  32. package/src/atoms/composed/DateTimePicker/index.ts +0 -2
  33. package/src/atoms/composed/DetailedCard/DetailedCard.tsx +0 -181
  34. package/src/atoms/composed/DetailedCard/index.ts +0 -2
  35. package/src/atoms/composed/EmptyState/EmptyState.tsx +0 -90
  36. package/src/atoms/composed/EmptyState/index.ts +0 -1
  37. package/src/atoms/composed/FileUpload/FileUpload.tsx +0 -477
  38. package/src/atoms/composed/FileUpload/index.ts +0 -2
  39. package/src/atoms/composed/FormField/FormField.tsx +0 -92
  40. package/src/atoms/composed/FormField/index.ts +0 -1
  41. package/src/atoms/composed/GlobalSearch/GlobalSearch.tsx +0 -37
  42. package/src/atoms/composed/GlobalSearch/index.ts +0 -1
  43. package/src/atoms/composed/IconBadge/IconBadge.tsx +0 -95
  44. package/src/atoms/composed/IconBadge/index.ts +0 -2
  45. package/src/atoms/composed/Modal/Modal.tsx +0 -223
  46. package/src/atoms/composed/Modal/index.ts +0 -2
  47. package/src/atoms/composed/PaletteSwitcher.tsx +0 -386
  48. package/src/atoms/composed/ProgressBar/ProgressBar.tsx +0 -116
  49. package/src/atoms/composed/ProgressBar/index.ts +0 -1
  50. package/src/atoms/composed/StatCard/StatCard.tsx +0 -219
  51. package/src/atoms/composed/StatCard/index.ts +0 -1
  52. package/src/atoms/composed/StyleGuide.tsx +0 -717
  53. package/src/atoms/composed/Toast/Toast.tsx +0 -219
  54. package/src/atoms/composed/Toast/index.ts +0 -1
  55. package/src/atoms/composed/Tooltip/Tooltip.tsx +0 -213
  56. package/src/atoms/composed/Tooltip/index.ts +0 -1
  57. package/src/atoms/composed/UserAvatar/UserAvatar.tsx +0 -139
  58. package/src/atoms/composed/UserAvatar/index.ts +0 -1
  59. package/src/atoms/composed/UserMenu/UserMenu.tsx +0 -16
  60. package/src/atoms/composed/UserMenu/index.ts +0 -1
  61. package/src/atoms/composed/index.ts +0 -29
  62. package/src/atoms/hooks/useApi.ts +0 -80
  63. package/src/atoms/hooks/useHealth.ts +0 -17
  64. package/src/atoms/index.ts +0 -13
  65. package/src/atoms/services/api/client.ts +0 -134
  66. package/src/atoms/services/auth-service.ts +0 -248
  67. package/src/atoms/services/health.ts +0 -15
  68. package/src/atoms/services/index.ts +0 -3
  69. package/src/atoms/shared/config/constants.ts +0 -17
  70. package/src/atoms/shared/config/dashboard-sizes.ts +0 -111
  71. package/src/atoms/shared/config/environment.ts +0 -10
  72. package/src/atoms/shared/index.ts +0 -4
  73. package/src/atoms/shared/styles/color-palettes.css +0 -566
  74. package/src/atoms/types/auth.ts +0 -62
  75. package/src/atoms/types/generated.ts +0 -1469
  76. package/src/atoms/types/index.ts +0 -4
  77. package/src/atoms/types/loading.ts +0 -28
  78. package/src/atoms/ui/Badge.tsx +0 -30
  79. package/src/atoms/ui/ErrorBoundary.tsx +0 -59
  80. package/src/atoms/ui/Select.tsx +0 -53
  81. package/src/atoms/ui/Switch.tsx +0 -42
  82. package/src/atoms/ui/Tabs.tsx +0 -118
  83. package/src/atoms/ui/avatar.tsx +0 -48
  84. package/src/atoms/ui/button.tsx +0 -70
  85. package/src/atoms/ui/card.tsx +0 -76
  86. package/src/atoms/ui/dropdown-menu.tsx +0 -199
  87. package/src/atoms/ui/index.ts +0 -39
  88. package/src/atoms/ui/input.tsx +0 -23
  89. package/src/atoms/ui/label.tsx +0 -23
  90. package/src/atoms/ui/skeleton.tsx +0 -13
  91. package/src/atoms/ui/spinner.tsx +0 -49
  92. package/src/atoms/ui/table.tsx +0 -116
  93. package/src/atoms/utils/animations.ts +0 -135
  94. package/src/atoms/utils/tooltip-helpers.ts +0 -140
  95. package/src/atoms/utils/utils.ts +0 -9
  96. package/src/features/auth/components/LoginForm.tsx +0 -168
  97. package/src/features/auth/components/LogoutButton.tsx +0 -19
  98. package/src/features/auth/components/ProtectedRoute.tsx +0 -60
  99. package/src/features/auth/components/index.ts +0 -4
  100. package/src/features/auth/hooks/index.ts +0 -2
  101. package/src/features/auth/hooks/useAuth.tsx +0 -205
  102. package/src/features/auth/hooks/usePermissions.ts +0 -35
  103. package/src/features/auth/index.ts +0 -2
  104. package/src/features/index.ts +0 -2
  105. package/src/index.css +0 -704
  106. package/src/index.ts +0 -13
  107. package/src/main.tsx +0 -48
  108. package/src/molecules/.gitkeep +0 -0
  109. package/src/molecules/forms/FormGroup.tsx +0 -75
  110. package/src/molecules/forms/SearchInput.tsx +0 -259
  111. package/src/molecules/forms/index.ts +0 -4
  112. package/src/molecules/index.ts +0 -4
  113. package/src/molecules/layout/AppHeader/AppHeader.tsx +0 -42
  114. package/src/molecules/layout/AppHeader/index.ts +0 -1
  115. package/src/molecules/layout/AppLayout.tsx +0 -29
  116. package/src/molecules/layout/PageTemplate.tsx +0 -87
  117. package/src/molecules/layout/SectionHeader/SectionHeader.tsx +0 -87
  118. package/src/molecules/layout/SectionHeader/index.ts +0 -1
  119. package/src/molecules/layout/ShowcaseSection.tsx +0 -57
  120. package/src/molecules/layout/Sidebar.tsx +0 -144
  121. package/src/molecules/layout/SidebarButton/SidebarButton.tsx +0 -99
  122. package/src/molecules/layout/SidebarButton/index.ts +0 -1
  123. package/src/molecules/layout/SidebarContext.tsx +0 -31
  124. package/src/molecules/layout/index.ts +0 -7
  125. package/src/molecules/navigation/NavMenu.tsx +0 -188
  126. package/src/molecules/navigation/Pagination.tsx +0 -172
  127. package/src/molecules/navigation/index.ts +0 -4
  128. package/src/organisms/index.ts +0 -5
  129. package/src/organisms/showcase/ComponentShowcasePage.tsx +0 -2496
  130. package/src/organisms/showcase/index.ts +0 -1
  131. package/src/pages/AdminShowcase/AdminCRUDShowcase.tsx +0 -242
  132. package/src/pages/AdminShowcase/AdminDashboardShowcase.tsx +0 -171
  133. package/src/pages/AdminShowcase/AdminDetailShowcase.tsx +0 -385
  134. package/src/pages/AdminShowcase/index.tsx +0 -3
  135. package/src/pages/ComponentShowcase/BadgesShowcase.tsx +0 -188
  136. package/src/pages/ComponentShowcase/CardsShowcase.tsx +0 -392
  137. package/src/pages/ComponentShowcase/PalettesShowcase.tsx +0 -207
  138. package/src/pages/ComponentShowcase/StatesShowcase.tsx +0 -485
  139. package/src/pages/ComponentShowcase/TablesShowcase.tsx +0 -134
  140. package/src/pages/ComponentShowcase/TypographyShowcase.tsx +0 -255
  141. package/src/pages/ComponentShowcase/index.tsx +0 -188
  142. package/src/pages/index.ts +0 -2
  143. package/src/templates/AuthTemplate.tsx +0 -216
  144. package/src/templates/ComponentShowcaseTemplate.tsx +0 -173
  145. package/src/templates/DashboardTemplate.tsx +0 -232
  146. package/src/templates/DataTemplate.tsx +0 -319
  147. package/src/templates/admin/AdminCRUDTemplate.tsx +0 -630
  148. package/src/templates/admin/AdminDashboardTemplate.tsx +0 -351
  149. package/src/templates/admin/AdminDetailTemplate.tsx +0 -563
  150. package/src/templates/admin/index.ts +0 -29
  151. package/src/templates/factory.tsx +0 -169
  152. package/src/templates/index.ts +0 -37
  153. package/src/vite-env.d.ts +0 -1
@@ -1,392 +0,0 @@
1
- import React from 'react';
2
- import { ComponentShowcaseTemplate } from '../../templates';
3
- import { StatCard, DetailedCard, DataBadge, FileUpload } from '../../atoms/composed';
4
- import { Card } from '../../atoms/ui';
5
- import { Database, CheckCircle, Users, Activity, TrendingUp } from 'lucide-react';
6
-
7
- export const CardsShowcase: React.FC = () => {
8
- return (
9
- <ComponentShowcaseTemplate
10
- category={1}
11
- title="Cards"
12
- description="Analytics cards for displaying key metrics, statistics, and detailed information in data interfaces."
13
- primaryComponent={{
14
- title: "Card Component",
15
- description: "Base card component with category theming, border styling, and hover effects. Foundation for all card-based components.",
16
- badge: {
17
- text: "UI Foundation",
18
- variant: "category",
19
- category: 1
20
- },
21
- children: (
22
- <div className="space-y-6">
23
- {/* Basic Card Usage */}
24
- <div className="space-y-4">
25
- <h4 className="text-base font-medium">Basic Card</h4>
26
- <div className="grid md:grid-cols-3 gap-4">
27
- <Card className="p-4">
28
- <h3 className="font-medium mb-2">Default Card</h3>
29
- <p className="text-sm text-muted-foreground">Basic card with standard styling, border, and shadow effects.</p>
30
- </Card>
31
- <Card category={1} className="p-4">
32
- <h3 className="font-medium mb-2">Category Card</h3>
33
- <p className="text-sm text-muted-foreground">Card with category theming - colored left border and background tint.</p>
34
- </Card>
35
- <Card category={2} className="p-4">
36
- <h3 className="font-medium mb-2">Interactive Card</h3>
37
- <p className="text-sm text-muted-foreground">Hover effects and interactive states for clickable cards.</p>
38
- </Card>
39
- </div>
40
- </div>
41
-
42
- {/* Category Variants */}
43
- <div className="space-y-4">
44
- <h4 className="text-base font-medium">Category Variants</h4>
45
- <div className="grid md:grid-cols-4 gap-4">
46
- {[1, 2, 3, 4, 5, 6, 7, 8].map(category => (
47
- <Card key={category} category={category as 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8} className="p-3">
48
- <div className="text-sm font-medium">Category {category}</div>
49
- <div className="text-xs text-muted-foreground mt-1">
50
- Border: category-{category}
51
- </div>
52
- </Card>
53
- ))}
54
- </div>
55
- </div>
56
- </div>
57
- )
58
- }}
59
- composedExamples={{
60
- title: "Business Card Components",
61
- description: "Domain-specific card components built on the base Card component for data interfaces and analytics applications.",
62
- sections: [
63
- {
64
- title: "StatCard Component",
65
- description: "Compact analytics cards for displaying key metrics and statistics with optional trends and interactive states.",
66
- badge: {
67
- text: "Business Component",
68
- variant: "category",
69
- category: 2
70
- },
71
- category: 2,
72
- children: (
73
- <div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
74
- <StatCard
75
- title="Total Models"
76
- value="1,234"
77
- subtitle="Active dbt models"
78
- category={1}
79
- icon={<Database className="w-5 h-5" />}
80
- trend={{ value: 12.5, label: "vs last month" }}
81
- />
82
- <StatCard
83
- title="Success Rate"
84
- value="99.2%"
85
- subtitle="Test pass rate"
86
- category={2}
87
- icon={<CheckCircle className="w-5 h-5" />}
88
- trend={{ value: 2.1, label: "vs last week" }}
89
- />
90
- <StatCard
91
- title="Active Users"
92
- value="567"
93
- subtitle="Monthly active users"
94
- category={3}
95
- icon={<Users className="w-5 h-5" />}
96
- trend={{ value: -3.2, label: "vs last month" }}
97
- />
98
- <StatCard
99
- title="Data Freshness"
100
- value="4.2hrs"
101
- subtitle="Average delay"
102
- category={4}
103
- icon={<Activity className="w-5 h-5" />}
104
- onClick={() => alert('Card clicked!')}
105
- />
106
- <StatCard
107
- title="Query Performance"
108
- value="1.8s"
109
- subtitle="Average duration"
110
- category={5}
111
- icon={<TrendingUp className="w-5 h-5" />}
112
- trend={{ value: 0 }}
113
- />
114
- <StatCard
115
- title="Data Volume"
116
- value="2.4TB"
117
- subtitle="Total processed"
118
- category={6}
119
- icon={<Database className="w-5 h-5" />}
120
- />
121
- </div>
122
- )
123
- },
124
- {
125
- title: "DetailedCard Component",
126
- description: "Rich information cards with multiple metrics, descriptions, and interactive elements for complex data display.",
127
- badge: {
128
- text: "Business Component",
129
- variant: "category",
130
- category: 2
131
- },
132
- category: 2,
133
- children: (
134
- <div className="grid md:grid-cols-1 lg:grid-cols-2 gap-6">
135
- <DetailedCard
136
- title="Customer Analytics Model"
137
- subtitle="Production Model"
138
- description="Advanced analytics model for customer behavior tracking and segmentation. Processes customer interactions, purchase patterns, and engagement metrics."
139
- category={1}
140
- icon={<Database className="w-5 h-5" />}
141
- primaryMetric={{
142
- label: "Success Rate",
143
- value: "98.7%",
144
- trend: { value: 5.2, label: "vs last week" }
145
- }}
146
- secondaryMetrics={[
147
- { label: "Daily Runs", value: "24", status: "success" },
148
- { label: "Avg Runtime", value: "2.4min", status: "info" },
149
- { label: "Data Quality", value: "95%", status: "warning" },
150
- { label: "Test Coverage", value: "87%", status: "success" }
151
- ]}
152
- tags={[
153
- { label: "Production", status: "success" },
154
- { label: "Analytics", category: 1 },
155
- { label: "Customer Data", category: 3 }
156
- ]}
157
- onClick={() => alert('Model details clicked!')}
158
- />
159
-
160
- <DetailedCard
161
- title="Revenue Forecasting Pipeline"
162
- subtitle="Critical Business Model"
163
- description="Machine learning pipeline for revenue forecasting and business intelligence. Combines historical data with market trends for accurate predictions."
164
- category={2}
165
- icon={<TrendingUp className="w-5 h-5" />}
166
- primaryMetric={{
167
- label: "Accuracy Score",
168
- value: "94.3%",
169
- trend: { value: -1.2, label: "vs last month" }
170
- }}
171
- secondaryMetrics={[
172
- { label: "Predictions", value: "156", status: "info" },
173
- { label: "Model Score", value: "0.943", status: "success" },
174
- { label: "Data Freshness", value: "2hrs", status: "warning" },
175
- { label: "Dependencies", value: "12", status: "neutral" }
176
- ]}
177
- tags={[
178
- { label: "ML Model", category: 5 },
179
- { label: "Critical", status: "error" },
180
- { label: "Revenue", category: 2 },
181
- { label: "Forecasting", category: 4 }
182
- ]}
183
- onClick={() => alert('Pipeline details clicked!')}
184
- />
185
- </div>
186
- )
187
- }
188
- ]
189
- }}
190
- ephemeralExamples={{
191
- title: "Ephemeral Components",
192
- description: "Application-specific components built inline for one-off use cases. Consider promoting to shared library if pattern emerges across multiple apps.",
193
- sections: [
194
- {
195
- title: "BankAccountCard",
196
- description: "Custom card for financial data display - built inline for this demo. Shows how to extend business components for specific domains.",
197
- badge: {
198
- text: "App-Specific",
199
- variant: "category",
200
- category: 3
201
- },
202
- category: 3,
203
- children: (
204
- <div className="grid md:grid-cols-2 gap-6">
205
- {/* BankAccountCard - Inline ephemeral component */}
206
- <Card category={1} className="p-6">
207
- <div className="flex items-start justify-between mb-4">
208
- <div className="flex items-center gap-3">
209
- <div className="w-10 h-10 rounded bg-category-1/20 flex items-center justify-center">
210
- <Database className="w-5 h-5 text-category-1" />
211
- </div>
212
- <div>
213
- <h3 className="font-semibold">Checking Account</h3>
214
- <p className="text-sm text-muted-foreground">Wells Fargo ••••4892</p>
215
- </div>
216
- </div>
217
- <DataBadge variant="status" status="success" size="sm">Active</DataBadge>
218
- </div>
219
-
220
- <div className="space-y-3">
221
- <div className="flex justify-between items-baseline">
222
- <span className="text-2xl font-bold">$12,847.32</span>
223
- <span className="text-sm text-muted-foreground">Available Balance</span>
224
- </div>
225
-
226
- <div className="grid grid-cols-2 gap-4 pt-3 border-t border-border">
227
- <div>
228
- <div className="text-xs text-muted-foreground">Last Transaction</div>
229
- <div className="text-sm font-medium">-$45.20</div>
230
- </div>
231
- <div>
232
- <div className="text-xs text-muted-foreground">Interest Rate</div>
233
- <div className="text-sm font-medium">0.15% APY</div>
234
- </div>
235
- </div>
236
- </div>
237
- </Card>
238
-
239
- <Card category={2} className="p-6">
240
- <div className="flex items-start justify-between mb-4">
241
- <div className="flex items-center gap-3">
242
- <div className="w-10 h-10 rounded bg-category-2/20 flex items-center justify-center">
243
- <TrendingUp className="w-5 h-5 text-category-2" />
244
- </div>
245
- <div>
246
- <h3 className="font-semibold">Investment Account</h3>
247
- <p className="text-sm text-muted-foreground">Vanguard ••••7361</p>
248
- </div>
249
- </div>
250
- <DataBadge variant="status" status="info" size="sm">Growth</DataBadge>
251
- </div>
252
-
253
- <div className="space-y-3">
254
- <div className="flex justify-between items-baseline">
255
- <span className="text-2xl font-bold">$89,234.56</span>
256
- <span className="text-sm text-category-2 font-medium">+$2,341 (2.7%)</span>
257
- </div>
258
-
259
- <div className="grid grid-cols-2 gap-4 pt-3 border-t border-border">
260
- <div>
261
- <div className="text-xs text-muted-foreground">Portfolio Value</div>
262
- <div className="text-sm font-medium">$91,575.91</div>
263
- </div>
264
- <div>
265
- <div className="text-xs text-muted-foreground">Unrealized P&L</div>
266
- <div className="text-sm font-medium text-category-2">+$4,682.45</div>
267
- </div>
268
- </div>
269
- </div>
270
- </Card>
271
- </div>
272
- )
273
- },
274
- {
275
- title: "FileUpload Component",
276
- description: "Drag-and-drop file upload component with progress tracking, validation, and preview support for modern file handling workflows.",
277
- badge: {
278
- text: "Business Component",
279
- variant: "category",
280
- category: 2
281
- },
282
- category: 2,
283
- children: (
284
- <div className="space-y-6">
285
- {/* Basic File Upload */}
286
- <Card className="p-6" category={2}>
287
- <h5 className="font-medium mb-4">Basic File Upload</h5>
288
- <FileUpload
289
- accept="image/*,.pdf,.doc,.docx"
290
- multiple
291
- maxSize={5 * 1024 * 1024} // 5MB
292
- maxFiles={3}
293
- uploadText="Choose files or drag and drop"
294
- dragText="Drop files here"
295
- onChange={(files) => console.log('Files changed:', files)}
296
- onUpload={async (files) => {
297
- console.log('Uploading files:', files);
298
- // Simulate upload delay
299
- await new Promise(resolve => setTimeout(resolve, 2000));
300
- }}
301
- />
302
- </Card>
303
-
304
- {/* Compact Variant */}
305
- <div className="grid md:grid-cols-2 gap-6">
306
- <Card className="p-4" category={2}>
307
- <h5 className="font-medium mb-4">Compact Variant</h5>
308
- <FileUpload
309
- variant="compact"
310
- accept="image/*"
311
- maxSize={2 * 1024 * 1024} // 2MB
312
- maxFiles={1}
313
- uploadText="Upload image"
314
- onChange={(files) => console.log('Image files:', files)}
315
- />
316
- </Card>
317
-
318
- <Card className="p-4" category={2}>
319
- <h5 className="font-medium mb-4">Large Variant</h5>
320
- <FileUpload
321
- variant="large"
322
- accept=".zip,.tar,.gz"
323
- maxSize={50 * 1024 * 1024} // 50MB
324
- maxFiles={1}
325
- uploadText="Upload archive"
326
- dragText="Drop your archive here"
327
- onChange={(files) => console.log('Archive files:', files)}
328
- />
329
- </Card>
330
- </div>
331
-
332
- {/* Different File Types */}
333
- <Card className="p-6" category={2}>
334
- <h5 className="font-medium mb-4">Different File Type Restrictions</h5>
335
- <div className="grid md:grid-cols-3 gap-4">
336
- <div>
337
- <h6 className="text-sm font-medium mb-2">Images Only</h6>
338
- <FileUpload
339
- variant="compact"
340
- accept="image/*"
341
- maxSize={10 * 1024 * 1024}
342
- maxFiles={5}
343
- showPreview
344
- uploadText="Images"
345
- onChange={(files) => console.log('Images:', files)}
346
- />
347
- </div>
348
- <div>
349
- <h6 className="text-sm font-medium mb-2">Documents</h6>
350
- <FileUpload
351
- variant="compact"
352
- accept=".pdf,.doc,.docx,.txt"
353
- maxSize={20 * 1024 * 1024}
354
- maxFiles={10}
355
- uploadText="Documents"
356
- onChange={(files) => console.log('Documents:', files)}
357
- />
358
- </div>
359
- <div>
360
- <h6 className="text-sm font-medium mb-2">CSV/Excel</h6>
361
- <FileUpload
362
- variant="compact"
363
- accept=".csv,.xlsx,.xls"
364
- maxSize={50 * 1024 * 1024}
365
- maxFiles={1}
366
- uploadText="Data files"
367
- onChange={(files) => console.log('Data files:', files)}
368
- />
369
- </div>
370
- </div>
371
- </Card>
372
-
373
- {/* Error States */}
374
- <Card className="p-6" category={2}>
375
- <h5 className="font-medium mb-4">Error State Example</h5>
376
- <FileUpload
377
- accept="image/*"
378
- maxSize={100 * 1024} // Very small limit for demo
379
- maxFiles={1}
380
- error="File size too large. Please select a smaller file."
381
- uploadText="Try uploading a large image to see error"
382
- onChange={(files) => console.log('Error demo files:', files)}
383
- />
384
- </Card>
385
- </div>
386
- )
387
- }
388
- ]
389
- }}
390
- />
391
- );
392
- };
@@ -1,207 +0,0 @@
1
- import React from 'react';
2
- import { ComponentShowcaseTemplate } from '../../templates';
3
- import { ColorSwatch } from '../../atoms/composed';
4
-
5
- export const PalettesShowcase: React.FC = () => {
6
- return (
7
- <ComponentShowcaseTemplate
8
- category={2}
9
- title="Color System & Palettes"
10
- description="Complete color system including individual color swatches and predefined palette combinations for data visualization and interface design."
11
- primaryComponent={{
12
- title: "ColorSwatch Component",
13
- description: "Individual color swatch component for displaying colors with names, labels, and interactive features.",
14
- badge: {
15
- text: "Business Component",
16
- variant: "category",
17
- category: 2
18
- },
19
- children: (
20
- <div className="space-y-6">
21
- {/* Basic Color Swatches */}
22
- <div className="space-y-4">
23
- <h4 className="text-base font-medium">Basic Swatches</h4>
24
- <div className="grid grid-cols-4 gap-4">
25
- <ColorSwatch
26
- color="hsl(var(--category-1))"
27
- name="Blue"
28
- label="Primary"
29
- interactive
30
- />
31
- <ColorSwatch
32
- color="hsl(var(--category-2))"
33
- name="Teal"
34
- label="Secondary"
35
- interactive
36
- />
37
- <ColorSwatch
38
- color="hsl(var(--status-success))"
39
- name="Success"
40
- label="Status"
41
- interactive
42
- />
43
- <ColorSwatch
44
- color="hsl(var(--status-error))"
45
- name="Error"
46
- label="Status"
47
- interactive
48
- />
49
- </div>
50
- </div>
51
-
52
- {/* Size Variants */}
53
- <div className="space-y-4">
54
- <h4 className="text-base font-medium">Size Variants</h4>
55
- <div className="flex items-end gap-4">
56
- <ColorSwatch
57
- color="hsl(var(--category-3))"
58
- name="Small"
59
- size="sm"
60
- interactive
61
- />
62
- <ColorSwatch
63
- color="hsl(var(--category-3))"
64
- name="Medium"
65
- size="md"
66
- interactive
67
- />
68
- <ColorSwatch
69
- color="hsl(var(--category-3))"
70
- name="Large"
71
- size="lg"
72
- interactive
73
- />
74
- </div>
75
- </div>
76
-
77
- {/* Interactive States */}
78
- <div className="space-y-4">
79
- <h4 className="text-base font-medium">Interactive States</h4>
80
- <div className="grid grid-cols-4 gap-4">
81
- <ColorSwatch
82
- color="hsl(var(--category-4))"
83
- name="Static"
84
- label="Default state"
85
- />
86
- <ColorSwatch
87
- color="hsl(var(--category-4))"
88
- name="Hover"
89
- label="Hover effects"
90
- interactive
91
- />
92
- <ColorSwatch
93
- color="hsl(var(--category-4))"
94
- name="Clickable"
95
- label="Click handlers"
96
- interactive
97
- onClick={() => alert('Swatch clicked!')}
98
- />
99
- <ColorSwatch
100
- color="hsl(var(--category-4))"
101
- name="Selected"
102
- label="Active state"
103
- interactive
104
- className="ring-2 ring-category-4"
105
- />
106
- </div>
107
- </div>
108
- </div>
109
- )
110
- }}
111
- composedExamples={{
112
- title: "Color Palettes & Combinations",
113
- description: "Predefined color palettes and systematic color combinations for data visualization and interface design.",
114
- sections: [
115
- {
116
- title: "Category Colors",
117
- description: "Primary colors for categorizing different types of data, models, and content sections.",
118
- badge: {
119
- text: "Data Classification",
120
- variant: "category",
121
- category: 1
122
- },
123
- category: 1,
124
- children: (
125
- <div className="grid grid-cols-4 md:grid-cols-8 gap-4">
126
- {[
127
- { num: 1, name: 'Blue', usage: 'Primary data' },
128
- { num: 2, name: 'Teal', usage: 'Models' },
129
- { num: 3, name: 'Orange', usage: 'Tests' },
130
- { num: 4, name: 'Purple', usage: 'Sources' },
131
- { num: 5, name: 'Pink', usage: 'Analytics' },
132
- { num: 6, name: 'Green', usage: 'Jobs' },
133
- { num: 7, name: 'Yellow', usage: 'Documentation' },
134
- { num: 8, name: 'Red', usage: 'Issues' }
135
- ].map(category => (
136
- <ColorSwatch
137
- key={category.num}
138
- color={`hsl(var(--category-${category.num}))`}
139
- name={category.name}
140
- label={category.usage}
141
- interactive
142
- />
143
- ))}
144
- </div>
145
- )
146
- },
147
- {
148
- title: "Category Palette",
149
- description: "Complete 8-color palette for data categorization with excellent contrast and accessibility.",
150
- badge: {
151
- text: "8 Colors",
152
- variant: "category",
153
- category: 6
154
- },
155
- category: 2,
156
- children: (
157
- <div className="flex gap-1 rounded overflow-hidden border border-border">
158
- {[1, 2, 3, 4, 5, 6, 7, 8].map(num => (
159
- <div
160
- key={num}
161
- className="flex-1 h-24 group relative cursor-pointer"
162
- style={{ backgroundColor: `hsl(var(--category-${num}))` }}
163
- >
164
- <div className="absolute inset-0 bg-black/0 group-hover:bg-black/10 flex items-center justify-center">
165
- <span className="text-white font-medium opacity-0 group-hover:opacity-100 transition-opacity">
166
- {num}
167
- </span>
168
- </div>
169
- </div>
170
- ))}
171
- </div>
172
- )
173
- },
174
- {
175
- title: "Status Colors",
176
- description: "Semantic colors for indicating status, health, and operational states across the system.",
177
- badge: {
178
- text: "System States",
179
- variant: "status",
180
- status: "success"
181
- },
182
- category: 2,
183
- children: (
184
- <div className="grid grid-cols-5 gap-4">
185
- {[
186
- { name: 'Success', usage: 'Completed', cssVar: '--status-success' },
187
- { name: 'Warning', usage: 'Attention', cssVar: '--status-warning' },
188
- { name: 'Error', usage: 'Failed', cssVar: '--status-error' },
189
- { name: 'Info', usage: 'Information', cssVar: '--status-info' },
190
- { name: 'Neutral', usage: 'Pending', cssVar: '--status-neutral' }
191
- ].map(color => (
192
- <ColorSwatch
193
- key={color.name}
194
- color={`hsl(var(${color.cssVar}))`}
195
- name={color.name}
196
- label={color.usage}
197
- interactive
198
- />
199
- ))}
200
- </div>
201
- )
202
- }
203
- ]
204
- }}
205
- />
206
- );
207
- };