@principal-ade/industry-theme 0.1.2

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 (46) hide show
  1. package/dist/cjs/ThemeProvider.d.ts +19 -0
  2. package/dist/cjs/ThemeProvider.d.ts.map +1 -0
  3. package/dist/cjs/ThemeShowcase.d.ts +24 -0
  4. package/dist/cjs/ThemeShowcase.d.ts.map +1 -0
  5. package/dist/cjs/defaultThemes.d.ts +8 -0
  6. package/dist/cjs/defaultThemes.d.ts.map +1 -0
  7. package/dist/cjs/glassmorphismTheme.d.ts +7 -0
  8. package/dist/cjs/glassmorphismTheme.d.ts.map +1 -0
  9. package/dist/cjs/index.d.ts +130 -0
  10. package/dist/cjs/index.d.ts.map +1 -0
  11. package/dist/cjs/index.js +1798 -0
  12. package/dist/cjs/package.json +1 -0
  13. package/dist/cjs/themeHelpers.d.ts +30 -0
  14. package/dist/cjs/themeHelpers.d.ts.map +1 -0
  15. package/dist/cjs/themes.d.ts +12 -0
  16. package/dist/cjs/themes.d.ts.map +1 -0
  17. package/dist/cjs/utils.d.ts +32 -0
  18. package/dist/cjs/utils.d.ts.map +1 -0
  19. package/dist/esm/ThemeProvider.d.ts +19 -0
  20. package/dist/esm/ThemeProvider.d.ts.map +1 -0
  21. package/dist/esm/ThemeShowcase.d.ts +24 -0
  22. package/dist/esm/ThemeShowcase.d.ts.map +1 -0
  23. package/dist/esm/defaultThemes.d.ts +8 -0
  24. package/dist/esm/defaultThemes.d.ts.map +1 -0
  25. package/dist/esm/glassmorphismTheme.d.ts +7 -0
  26. package/dist/esm/glassmorphismTheme.d.ts.map +1 -0
  27. package/dist/esm/index.d.ts +130 -0
  28. package/dist/esm/index.d.ts.map +1 -0
  29. package/dist/esm/index.js +1753 -0
  30. package/dist/esm/package.json +1 -0
  31. package/dist/esm/themeHelpers.d.ts +30 -0
  32. package/dist/esm/themeHelpers.d.ts.map +1 -0
  33. package/dist/esm/themes.d.ts +12 -0
  34. package/dist/esm/themes.d.ts.map +1 -0
  35. package/dist/esm/utils.d.ts +32 -0
  36. package/dist/esm/utils.d.ts.map +1 -0
  37. package/package.json +64 -0
  38. package/src/README.md +134 -0
  39. package/src/ThemeProvider.tsx +117 -0
  40. package/src/ThemeShowcase.tsx +442 -0
  41. package/src/defaultThemes.ts +369 -0
  42. package/src/glassmorphismTheme.ts +213 -0
  43. package/src/index.ts +230 -0
  44. package/src/themeHelpers.ts +106 -0
  45. package/src/themes.ts +746 -0
  46. package/src/utils.ts +135 -0
@@ -0,0 +1,442 @@
1
+ import React from 'react';
2
+
3
+ import { Theme } from './index';
4
+
5
+ export interface ThemeShowcaseProps {
6
+ theme: Theme;
7
+ /**
8
+ * Optional title for the showcase
9
+ */
10
+ title?: string;
11
+ /**
12
+ * Show raw theme values alongside visual representations
13
+ */
14
+ showValues?: boolean;
15
+ /**
16
+ * Sections to display - by default shows all
17
+ */
18
+ sections?: ('colors' | 'typography' | 'spacing' | 'shadows' | 'radii')[];
19
+ }
20
+
21
+ /**
22
+ * A comprehensive theme showcase component that visually displays all theme properties.
23
+ * Useful for theme editors, documentation, and theme development.
24
+ */
25
+ export const ThemeShowcase: React.FC<ThemeShowcaseProps> = ({
26
+ theme,
27
+ title,
28
+ showValues = true,
29
+ sections = ['colors', 'typography', 'spacing', 'shadows', 'radii']
30
+ }) => {
31
+ const containerStyle: React.CSSProperties = {
32
+ fontFamily: theme.fonts.body,
33
+ color: theme.colors.text,
34
+ backgroundColor: theme.colors.background,
35
+ padding: theme.space[4],
36
+ minHeight: '100vh',
37
+ };
38
+
39
+ const sectionStyle: React.CSSProperties = {
40
+ marginBottom: theme.space[5],
41
+ padding: theme.space[4],
42
+ backgroundColor: theme.colors.surface || theme.colors.backgroundSecondary,
43
+ borderRadius: theme.radii[2],
44
+ border: `1px solid ${theme.colors.border}`,
45
+ };
46
+
47
+ const headingStyle: React.CSSProperties = {
48
+ fontFamily: theme.fonts.heading,
49
+ fontSize: theme.fontSizes[5],
50
+ fontWeight: theme.fontWeights.heading,
51
+ marginBottom: theme.space[3],
52
+ color: theme.colors.primary,
53
+ };
54
+
55
+ const subheadingStyle: React.CSSProperties = {
56
+ fontFamily: theme.fonts.heading,
57
+ fontSize: theme.fontSizes[3],
58
+ fontWeight: theme.fontWeights.medium,
59
+ marginBottom: theme.space[2],
60
+ marginTop: theme.space[3],
61
+ color: theme.colors.text,
62
+ };
63
+
64
+ return (
65
+ <div style={containerStyle}>
66
+ {title && (
67
+ <h1 style={{
68
+ ...headingStyle,
69
+ fontSize: theme.fontSizes[6],
70
+ marginBottom: theme.space[4],
71
+ }}>
72
+ {title}
73
+ </h1>
74
+ )}
75
+
76
+ {sections.includes('colors') && (
77
+ <div style={sectionStyle}>
78
+ <h2 style={headingStyle}>Colors</h2>
79
+
80
+ {/* Primary Colors */}
81
+ <h3 style={subheadingStyle}>Primary Colors</h3>
82
+ <div style={{
83
+ display: 'grid',
84
+ gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))',
85
+ gap: theme.space[3],
86
+ marginBottom: theme.space[3],
87
+ }}>
88
+ {['text', 'background', 'primary', 'secondary', 'accent', 'muted'].map(key => {
89
+ const color = theme.colors[key as keyof typeof theme.colors];
90
+ if (!color) return null;
91
+ return (
92
+ <div key={key} style={{
93
+ display: 'flex',
94
+ alignItems: 'center',
95
+ padding: theme.space[2],
96
+ backgroundColor: theme.colors.backgroundLight || theme.colors.backgroundTertiary,
97
+ borderRadius: theme.radii[1],
98
+ }}>
99
+ <div style={{
100
+ width: 40,
101
+ height: 40,
102
+ backgroundColor: color,
103
+ border: `1px solid ${theme.colors.border}`,
104
+ borderRadius: theme.radii[1],
105
+ marginRight: theme.space[2],
106
+ }} />
107
+ <div>
108
+ <div style={{
109
+ fontFamily: theme.fonts.monospace,
110
+ fontSize: theme.fontSizes[1],
111
+ fontWeight: theme.fontWeights.medium,
112
+ }}>
113
+ {key}
114
+ </div>
115
+ {showValues && (
116
+ <div style={{
117
+ fontFamily: theme.fonts.monospace,
118
+ fontSize: theme.fontSizes[0],
119
+ color: theme.colors.textSecondary,
120
+ }}>
121
+ {color}
122
+ </div>
123
+ )}
124
+ </div>
125
+ </div>
126
+ );
127
+ })}
128
+ </div>
129
+
130
+ {/* Status Colors */}
131
+ <h3 style={subheadingStyle}>Status Colors</h3>
132
+ <div style={{
133
+ display: 'grid',
134
+ gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))',
135
+ gap: theme.space[3],
136
+ marginBottom: theme.space[3],
137
+ }}>
138
+ {['success', 'warning', 'error', 'info'].map(key => {
139
+ const color = theme.colors[key as keyof typeof theme.colors];
140
+ if (!color) return null;
141
+ return (
142
+ <div key={key} style={{
143
+ display: 'flex',
144
+ alignItems: 'center',
145
+ padding: theme.space[2],
146
+ backgroundColor: theme.colors.backgroundLight || theme.colors.backgroundTertiary,
147
+ borderRadius: theme.radii[1],
148
+ }}>
149
+ <div style={{
150
+ width: 40,
151
+ height: 40,
152
+ backgroundColor: color,
153
+ border: `1px solid ${theme.colors.border}`,
154
+ borderRadius: theme.radii[1],
155
+ marginRight: theme.space[2],
156
+ }} />
157
+ <div>
158
+ <div style={{
159
+ fontFamily: theme.fonts.monospace,
160
+ fontSize: theme.fontSizes[1],
161
+ fontWeight: theme.fontWeights.medium,
162
+ }}>
163
+ {key}
164
+ </div>
165
+ {showValues && (
166
+ <div style={{
167
+ fontFamily: theme.fonts.monospace,
168
+ fontSize: theme.fontSizes[0],
169
+ color: theme.colors.textSecondary,
170
+ }}>
171
+ {color}
172
+ </div>
173
+ )}
174
+ </div>
175
+ </div>
176
+ );
177
+ })}
178
+ </div>
179
+
180
+ {/* Background Colors */}
181
+ <h3 style={subheadingStyle}>Background Colors</h3>
182
+ <div style={{
183
+ display: 'grid',
184
+ gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))',
185
+ gap: theme.space[3],
186
+ }}>
187
+ {['backgroundSecondary', 'backgroundTertiary', 'backgroundLight', 'backgroundHover', 'surface'].map(key => {
188
+ const color = theme.colors[key as keyof typeof theme.colors];
189
+ if (!color) return null;
190
+ return (
191
+ <div key={key} style={{
192
+ padding: theme.space[3],
193
+ backgroundColor: color,
194
+ border: `1px solid ${theme.colors.border}`,
195
+ borderRadius: theme.radii[1],
196
+ }}>
197
+ <div style={{
198
+ fontFamily: theme.fonts.monospace,
199
+ fontSize: theme.fontSizes[1],
200
+ fontWeight: theme.fontWeights.medium,
201
+ }}>
202
+ {key}
203
+ </div>
204
+ {showValues && (
205
+ <div style={{
206
+ fontFamily: theme.fonts.monospace,
207
+ fontSize: theme.fontSizes[0],
208
+ color: theme.colors.textSecondary,
209
+ marginTop: theme.space[1],
210
+ }}>
211
+ {color}
212
+ </div>
213
+ )}
214
+ </div>
215
+ );
216
+ })}
217
+ </div>
218
+ </div>
219
+ )}
220
+
221
+ {sections.includes('typography') && (
222
+ <div style={sectionStyle}>
223
+ <h2 style={headingStyle}>Typography</h2>
224
+
225
+ {/* Font Families */}
226
+ <h3 style={subheadingStyle}>Font Families</h3>
227
+ <div style={{ marginBottom: theme.space[4] }}>
228
+ <div style={{
229
+ fontFamily: theme.fonts.heading,
230
+ fontSize: theme.fontSizes[4],
231
+ marginBottom: theme.space[2],
232
+ }}>
233
+ Heading Font: {showValues && <span style={{
234
+ fontFamily: theme.fonts.monospace,
235
+ fontSize: theme.fontSizes[1],
236
+ color: theme.colors.textSecondary,
237
+ }}> {theme.fonts.heading}</span>}
238
+ </div>
239
+ <div style={{
240
+ fontFamily: theme.fonts.body,
241
+ fontSize: theme.fontSizes[2],
242
+ marginBottom: theme.space[2],
243
+ }}>
244
+ Body Font: {showValues && <span style={{
245
+ fontFamily: theme.fonts.monospace,
246
+ fontSize: theme.fontSizes[1],
247
+ color: theme.colors.textSecondary,
248
+ }}> {theme.fonts.body}</span>}
249
+ </div>
250
+ <div style={{
251
+ fontFamily: theme.fonts.monospace,
252
+ fontSize: theme.fontSizes[2],
253
+ }}>
254
+ Monospace Font: {showValues && <span style={{
255
+ fontSize: theme.fontSizes[1],
256
+ color: theme.colors.textSecondary,
257
+ }}> {theme.fonts.monospace}</span>}
258
+ </div>
259
+ </div>
260
+
261
+ {/* Font Sizes */}
262
+ <h3 style={subheadingStyle}>Font Sizes</h3>
263
+ <div style={{ marginBottom: theme.space[4] }}>
264
+ {theme.fontSizes.map((size, index) => (
265
+ <div key={index} style={{
266
+ fontSize: size,
267
+ lineHeight: theme.lineHeights.body,
268
+ marginBottom: theme.space[1],
269
+ }}>
270
+ Size {index}: Sample Text {showValues && `(${size}px)`}
271
+ </div>
272
+ ))}
273
+ </div>
274
+
275
+ {/* Font Weights */}
276
+ <h3 style={subheadingStyle}>Font Weights</h3>
277
+ <div style={{
278
+ display: 'grid',
279
+ gridTemplateColumns: 'repeat(auto-fit, minmax(150px, 1fr))',
280
+ gap: theme.space[2],
281
+ }}>
282
+ {Object.entries(theme.fontWeights).map(([name, weight]) => (
283
+ <div key={name} style={{
284
+ fontWeight: weight,
285
+ fontSize: theme.fontSizes[2],
286
+ }}>
287
+ {name} {showValues && `(${weight})`}
288
+ </div>
289
+ ))}
290
+ </div>
291
+ </div>
292
+ )}
293
+
294
+ {sections.includes('spacing') && (
295
+ <div style={sectionStyle}>
296
+ <h2 style={headingStyle}>Spacing</h2>
297
+ <div style={{ display: 'flex', flexDirection: 'column', gap: theme.space[2] }}>
298
+ {theme.space.map((space, index) => (
299
+ <div key={index} style={{ display: 'flex', alignItems: 'center' }}>
300
+ <div style={{
301
+ width: 60,
302
+ fontFamily: theme.fonts.monospace,
303
+ fontSize: theme.fontSizes[1],
304
+ color: theme.colors.textSecondary,
305
+ }}>
306
+ [{index}]
307
+ </div>
308
+ <div style={{
309
+ height: 24,
310
+ width: space,
311
+ backgroundColor: theme.colors.primary,
312
+ borderRadius: theme.radii[1],
313
+ }} />
314
+ {showValues && (
315
+ <div style={{
316
+ marginLeft: theme.space[2],
317
+ fontFamily: theme.fonts.monospace,
318
+ fontSize: theme.fontSizes[1],
319
+ color: theme.colors.textSecondary,
320
+ }}>
321
+ {space}px
322
+ </div>
323
+ )}
324
+ </div>
325
+ ))}
326
+ </div>
327
+ </div>
328
+ )}
329
+
330
+ {sections.includes('radii') && (
331
+ <div style={sectionStyle}>
332
+ <h2 style={headingStyle}>Border Radii</h2>
333
+ <div style={{
334
+ display: 'grid',
335
+ gridTemplateColumns: 'repeat(auto-fill, minmax(100px, 1fr))',
336
+ gap: theme.space[3],
337
+ }}>
338
+ {theme.radii.map((radius, index) => (
339
+ <div key={index} style={{ textAlign: 'center' }}>
340
+ <div style={{
341
+ width: 80,
342
+ height: 80,
343
+ backgroundColor: theme.colors.primary,
344
+ borderRadius: radius,
345
+ marginBottom: theme.space[1],
346
+ margin: '0 auto',
347
+ }} />
348
+ <div style={{
349
+ fontFamily: theme.fonts.monospace,
350
+ fontSize: theme.fontSizes[0],
351
+ color: theme.colors.textSecondary,
352
+ }}>
353
+ [{index}] {showValues && `${radius}px`}
354
+ </div>
355
+ </div>
356
+ ))}
357
+ </div>
358
+ </div>
359
+ )}
360
+
361
+ {sections.includes('shadows') && (
362
+ <div style={sectionStyle}>
363
+ <h2 style={headingStyle}>Shadows</h2>
364
+ <div style={{
365
+ display: 'grid',
366
+ gridTemplateColumns: 'repeat(auto-fill, minmax(150px, 1fr))',
367
+ gap: theme.space[4],
368
+ }}>
369
+ {theme.shadows.map((shadow, index) => (
370
+ <div key={index} style={{ textAlign: 'center' }}>
371
+ <div style={{
372
+ width: 100,
373
+ height: 100,
374
+ backgroundColor: theme.colors.background,
375
+ boxShadow: shadow,
376
+ borderRadius: theme.radii[2],
377
+ margin: '0 auto',
378
+ marginBottom: theme.space[2],
379
+ border: `1px solid ${theme.colors.border}`,
380
+ }} />
381
+ <div style={{
382
+ fontFamily: theme.fonts.monospace,
383
+ fontSize: theme.fontSizes[0],
384
+ color: theme.colors.textSecondary,
385
+ }}>
386
+ Shadow [{index}]
387
+ </div>
388
+ {showValues && (
389
+ <div style={{
390
+ fontFamily: theme.fonts.monospace,
391
+ fontSize: theme.fontSizes[0],
392
+ color: theme.colors.textMuted,
393
+ marginTop: theme.space[1],
394
+ }}>
395
+ {shadow === 'none' ? 'none' : '...'}
396
+ </div>
397
+ )}
398
+ </div>
399
+ ))}
400
+ </div>
401
+ </div>
402
+ )}
403
+
404
+ {/* Theme Modes */}
405
+ {theme.modes && Object.keys(theme.modes).length > 0 && (
406
+ <div style={sectionStyle}>
407
+ <h2 style={headingStyle}>Available Modes</h2>
408
+ <div style={{
409
+ display: 'flex',
410
+ gap: theme.space[2],
411
+ flexWrap: 'wrap',
412
+ }}>
413
+ <div style={{
414
+ padding: `${theme.space[2]}px ${theme.space[3]}px`,
415
+ backgroundColor: theme.colors.primary,
416
+ color: '#ffffff',
417
+ borderRadius: theme.radii[2],
418
+ fontFamily: theme.fonts.body,
419
+ fontSize: theme.fontSizes[1],
420
+ }}>
421
+ default
422
+ </div>
423
+ {Object.keys(theme.modes).map(modeName => (
424
+ <div key={modeName} style={{
425
+ padding: `${theme.space[2]}px ${theme.space[3]}px`,
426
+ backgroundColor: theme.colors.secondary,
427
+ color: theme.colors.text,
428
+ borderRadius: theme.radii[2],
429
+ fontFamily: theme.fonts.body,
430
+ fontSize: theme.fontSizes[1],
431
+ }}>
432
+ {modeName}
433
+ </div>
434
+ ))}
435
+ </div>
436
+ </div>
437
+ )}
438
+ </div>
439
+ );
440
+ };
441
+
442
+ export default ThemeShowcase;