@admin-layout/tailwind-design-pro 10.0.9-alpha.2 → 10.0.9-alpha.21

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 (100) hide show
  1. package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
  2. package/lib/components/Layout/BasicLayout/index.js +11 -28
  3. package/lib/components/Layout/BasicLayout/index.js.map +1 -1
  4. package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
  5. package/lib/components/Layout/GlobalHeader/Header.js +8 -4
  6. package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
  7. package/lib/components/Layout/ProTailwindLayout.d.ts +2 -0
  8. package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
  9. package/lib/components/Layout/ProTailwindLayout.js +6 -1
  10. package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
  11. package/lib/components/Layout/Sidebar/DynamicIcon.d.ts +12 -0
  12. package/lib/components/Layout/Sidebar/DynamicIcon.d.ts.map +1 -0
  13. package/lib/components/Layout/Sidebar/DynamicIcon.js +51 -0
  14. package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -0
  15. package/lib/components/Layout/Sidebar/Sidebar.d.ts +1 -0
  16. package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +1 -1
  17. package/lib/components/Layout/Sidebar/Sidebar.js +35 -10
  18. package/lib/components/Layout/Sidebar/Sidebar.js.map +1 -1
  19. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts +3 -5
  20. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +1 -1
  21. package/lib/components/Layout/Sidebar/SidebarMenu.js +118 -38
  22. package/lib/components/Layout/Sidebar/SidebarMenu.js.map +1 -1
  23. package/lib/components/Layout/slot-fill/AdditionalSettings.d.ts +4 -0
  24. package/lib/components/Layout/slot-fill/AdditionalSettings.d.ts.map +1 -0
  25. package/lib/components/Layout/slot-fill/AdditionalSettings.js +7 -0
  26. package/lib/components/Layout/slot-fill/AdditionalSettings.js.map +1 -0
  27. package/lib/components/Layout/slot-fill/index.d.ts +1 -0
  28. package/lib/components/Layout/slot-fill/index.d.ts.map +1 -1
  29. package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
  30. package/lib/components/SettingDrawer/SettingDrawer.js +35 -12
  31. package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
  32. package/lib/components/SettingDrawer/ThemeColor.d.ts.map +1 -1
  33. package/lib/components/SettingDrawer/ThemeColor.js +3 -0
  34. package/lib/components/SettingDrawer/ThemeColor.js.map +1 -1
  35. package/lib/components/SettingDrawer/types.d.ts +11 -1
  36. package/lib/components/SettingDrawer/types.d.ts.map +1 -1
  37. package/lib/components/ThemeProvider/ThemeProvider.d.ts +18 -0
  38. package/lib/components/ThemeProvider/ThemeProvider.d.ts.map +1 -0
  39. package/lib/components/ThemeProvider/ThemeProvider.js +63 -0
  40. package/lib/components/ThemeProvider/ThemeProvider.js.map +1 -0
  41. package/lib/components/ThemeProvider/ThemeToggle.d.ts +7 -0
  42. package/lib/components/ThemeProvider/ThemeToggle.d.ts.map +1 -0
  43. package/lib/components/ThemeProvider/ThemeToggle.js +50 -0
  44. package/lib/components/ThemeProvider/ThemeToggle.js.map +1 -0
  45. package/lib/components/ThemeProvider/index.d.ts +7 -0
  46. package/lib/components/ThemeProvider/index.d.ts.map +1 -0
  47. package/lib/components/ThemeProvider/themeRegistry.d.ts +3 -0
  48. package/lib/components/ThemeProvider/themeRegistry.d.ts.map +1 -0
  49. package/lib/components/ThemeProvider/themeRegistry.js +388 -0
  50. package/lib/components/ThemeProvider/themeRegistry.js.map +1 -0
  51. package/lib/components/ThemeProvider/themeUtils.d.ts +26 -0
  52. package/lib/components/ThemeProvider/themeUtils.d.ts.map +1 -0
  53. package/lib/components/ThemeProvider/themeUtils.js +192 -0
  54. package/lib/components/ThemeProvider/themeUtils.js.map +1 -0
  55. package/lib/components/ThemeProvider/types.d.ts +112 -0
  56. package/lib/components/ThemeProvider/types.d.ts.map +1 -0
  57. package/lib/components/UI/CategoriesTypeList.d.ts +28 -0
  58. package/lib/components/UI/CategoriesTypeList.d.ts.map +1 -0
  59. package/lib/components/UI/CategoriesTypeList.js +85 -0
  60. package/lib/components/UI/CategoriesTypeList.js.map +1 -0
  61. package/lib/components/UI/index.d.ts +2 -0
  62. package/lib/components/UI/index.d.ts.map +1 -0
  63. package/lib/components/index.d.ts +3 -0
  64. package/lib/components/index.d.ts.map +1 -0
  65. package/lib/components/index.js +1 -0
  66. package/lib/components/index.js.map +1 -0
  67. package/lib/components/typings.d.ts +8 -0
  68. package/lib/components/typings.d.ts.map +1 -1
  69. package/lib/compute.d.ts.map +1 -1
  70. package/lib/compute.js +6 -4
  71. package/lib/compute.js.map +1 -1
  72. package/lib/helpers/DynamicIcon.js +55 -0
  73. package/lib/helpers/DynamicIcon.js.map +1 -0
  74. package/lib/hooks/index.d.ts +3 -0
  75. package/lib/hooks/index.d.ts.map +1 -0
  76. package/lib/hooks/useWindowSize.d.ts +6 -0
  77. package/lib/hooks/useWindowSize.d.ts.map +1 -0
  78. package/lib/hooks/useWindowSize.js +20 -0
  79. package/lib/hooks/useWindowSize.js.map +1 -0
  80. package/lib/icons.d.ts +14 -0
  81. package/lib/icons.d.ts.map +1 -0
  82. package/lib/icons.js +13 -0
  83. package/lib/icons.js.map +1 -0
  84. package/lib/index.d.ts +0 -3
  85. package/lib/index.d.ts.map +1 -1
  86. package/lib/index.js +1 -1
  87. package/lib/index.js.map +1 -1
  88. package/lib/machines/settingsMachine.d.ts.map +1 -1
  89. package/lib/machines/settingsMachine.js +7 -1
  90. package/lib/machines/settingsMachine.js.map +1 -1
  91. package/lib/module.d.ts.map +1 -1
  92. package/lib/module.js +2 -1
  93. package/lib/module.js.map +1 -1
  94. package/lib/routes.json +1 -0
  95. package/lib/styles/index.css +438 -46
  96. package/package.json +5 -5
  97. package/lib/utils/index.d.ts +0 -2
  98. package/lib/utils/index.d.ts.map +0 -1
  99. package/lib/utils/index.js +0 -13
  100. package/lib/utils/index.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ export { ThemeProvider, useTheme, ThemeContext } from './ThemeProvider';
2
+ export type { ThemeProviderProps } from './ThemeProvider';
3
+ export { ThemeToggle } from './ThemeToggle';
4
+ export { applyTheme, hslToHex, generateColorPalette } from './themeUtils';
5
+ export { themeRegistry } from './themeRegistry';
6
+ export type { Theme, ThemeColors, ThemeFontSizes, ThemeSpacing, ThemeBorderRadius, ThemeOptions, ThemeSelectorProps, } from './types';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeProvider/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACR,KAAK,EACL,WAAW,EACX,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,GACrB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Theme } from './types';
2
+ export declare const themeRegistry: Record<string, Theme>;
3
+ //# sourceMappingURL=themeRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeRegistry.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeProvider/themeRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAiY/C,CAAC"}
@@ -0,0 +1,388 @@
1
+ // Define available themes
2
+ const themeRegistry = {
3
+ default: {
4
+ name: 'Default',
5
+ colors: {
6
+ // Light mode colors
7
+ light: {
8
+ background: '0 0% 100%',
9
+ foreground: '222.2 84% 4.9%',
10
+ card: '0 0% 100%',
11
+ cardForeground: '222.2 84% 4.9%',
12
+ popover: '0 0% 100%',
13
+ popoverForeground: '222.2 84% 4.9%',
14
+ primary: '221.2 83.2% 53.3%',
15
+ primaryForeground: '210 40% 98%',
16
+ secondary: '210 40% 96.1%',
17
+ secondaryForeground: '222.2 47.4% 11.2%',
18
+ muted: '210 40% 96.1%',
19
+ mutedForeground: '215.4 16.3% 46.9%',
20
+ accent: '210 40% 96.1%',
21
+ accentForeground: '222.2 47.4% 11.2%',
22
+ destructive: '0 84.2% 60.2%',
23
+ destructiveForeground: '210 40% 98%',
24
+ border: '214.3 31.8% 91.4%',
25
+ input: '214.3 31.8% 91.4%',
26
+ ring: '221.2 83.2% 53.3%'
27
+ },
28
+ // Dark mode colors
29
+ dark: {
30
+ background: '222.2 84% 4.9%',
31
+ foreground: '210 40% 98%',
32
+ card: '222.2 84% 4.9%',
33
+ cardForeground: '210 40% 98%',
34
+ popover: '222.2 84% 4.9%',
35
+ popoverForeground: '210 40% 98%',
36
+ primary: '217.2 91.2% 59.8%',
37
+ primaryForeground: '222.2 47.4% 11.2%',
38
+ secondary: '217.2 32.6% 17.5%',
39
+ secondaryForeground: '210 40% 98%',
40
+ muted: '217.2 32.6% 17.5%',
41
+ mutedForeground: '215 20.2% 65.1%',
42
+ accent: '217.2 32.6% 17.5%',
43
+ accentForeground: '210 40% 98%',
44
+ destructive: '0 62.8% 30.6%',
45
+ destructiveForeground: '210 40% 98%',
46
+ border: '217.2 32.6% 17.5%',
47
+ input: '217.2 32.6% 17.5%',
48
+ ring: '224.3 76.3% 48%'
49
+ }
50
+ },
51
+ fontSizes: {
52
+ xs: '0.75rem',
53
+ sm: '0.875rem',
54
+ base: '1rem',
55
+ lg: '1.125rem',
56
+ xl: '1.25rem',
57
+ '2xl': '1.5rem',
58
+ '3xl': '1.875rem',
59
+ '4xl': '2.25rem',
60
+ '5xl': '3rem'
61
+ },
62
+ spacing: {
63
+ px: '1px',
64
+ 0: '0',
65
+ 0.5: '0.125rem',
66
+ 1: '0.25rem',
67
+ 1.5: '0.375rem',
68
+ 2: '0.5rem',
69
+ 2.5: '0.625rem',
70
+ 3: '0.75rem',
71
+ 3.5: '0.875rem',
72
+ 4: '1rem',
73
+ 5: '1.25rem',
74
+ 6: '1.5rem',
75
+ 8: '2rem',
76
+ 10: '2.5rem',
77
+ 12: '3rem',
78
+ 16: '4rem',
79
+ 20: '5rem',
80
+ 24: '6rem',
81
+ 32: '8rem',
82
+ 40: '10rem',
83
+ 48: '12rem',
84
+ 56: '14rem',
85
+ 64: '16rem'
86
+ },
87
+ borderRadius: {
88
+ none: '0',
89
+ sm: '0.125rem',
90
+ DEFAULT: '0.25rem',
91
+ md: '0.375rem',
92
+ lg: '0.5rem',
93
+ xl: '0.75rem',
94
+ '2xl': '1rem',
95
+ '3xl': '1.5rem',
96
+ full: '9999px'
97
+ }
98
+ },
99
+ // GitHub-inspired theme
100
+ github: {
101
+ name: 'GitHub',
102
+ colors: {
103
+ light: {
104
+ background: '0 0% 100%',
105
+ foreground: '210 12% 16%',
106
+ card: '210 13% 97%',
107
+ cardForeground: '210 12% 16%',
108
+ popover: '0 0% 100%',
109
+ popoverForeground: '210 12% 16%',
110
+ primary: '212 100% 48%',
111
+ primaryForeground: '0 0% 100%',
112
+ secondary: '220 14% 96%',
113
+ secondaryForeground: '220 9% 46%',
114
+ muted: '220 14% 96%',
115
+ mutedForeground: '220 9% 46%',
116
+ accent: '220 14% 96%',
117
+ accentForeground: '222.2 47.4% 11.2%',
118
+ destructive: '0 72% 51%',
119
+ destructiveForeground: '210 40% 98%',
120
+ border: '220 13% 91%',
121
+ input: '220 13% 91%',
122
+ ring: '212 100% 48%'
123
+ },
124
+ dark: {
125
+ background: '215 21% 11%',
126
+ foreground: '210 10% 85%',
127
+ card: '214 21% 17%',
128
+ cardForeground: '210 10% 85%',
129
+ popover: '214 21% 17%',
130
+ popoverForeground: '210 10% 85%',
131
+ primary: '212 100% 50%',
132
+ primaryForeground: '0 0% 100%',
133
+ secondary: '215 14% 25%',
134
+ secondaryForeground: '210 10% 85%',
135
+ muted: '215 14% 25%',
136
+ mutedForeground: '215 10% 65%',
137
+ accent: '215 14% 25%',
138
+ accentForeground: '210 10% 85%',
139
+ destructive: '0 72% 42%',
140
+ destructiveForeground: '210 40% 98%',
141
+ border: '215 14% 25%',
142
+ input: '215 14% 25%',
143
+ ring: '212 100% 50%'
144
+ }
145
+ },
146
+ fontSizes: {
147
+ xs: '0.75rem',
148
+ sm: '0.875rem',
149
+ base: '1rem',
150
+ lg: '1.125rem',
151
+ xl: '1.25rem',
152
+ '2xl': '1.5rem',
153
+ '3xl': '1.875rem',
154
+ '4xl': '2.25rem',
155
+ '5xl': '3rem'
156
+ },
157
+ spacing: {
158
+ px: '1px',
159
+ 0: '0',
160
+ 0.5: '0.125rem',
161
+ 1: '0.25rem',
162
+ 1.5: '0.375rem',
163
+ 2: '0.5rem',
164
+ 2.5: '0.625rem',
165
+ 3: '0.75rem',
166
+ 3.5: '0.875rem',
167
+ 4: '1rem',
168
+ 5: '1.25rem',
169
+ 6: '1.5rem',
170
+ 8: '2rem',
171
+ 10: '2.5rem',
172
+ 12: '3rem',
173
+ 16: '4rem',
174
+ 20: '5rem',
175
+ 24: '6rem',
176
+ 32: '8rem',
177
+ 40: '10rem',
178
+ 48: '12rem',
179
+ 56: '14rem',
180
+ 64: '16rem'
181
+ },
182
+ borderRadius: {
183
+ none: '0',
184
+ sm: '0.125rem',
185
+ DEFAULT: '0.25rem',
186
+ md: '0.375rem',
187
+ lg: '0.5rem',
188
+ xl: '0.75rem',
189
+ '2xl': '1rem',
190
+ '3xl': '1.5rem',
191
+ full: '9999px'
192
+ }
193
+ },
194
+ // Slack-inspired theme
195
+ slack: {
196
+ name: 'Slack',
197
+ colors: {
198
+ light: {
199
+ background: '0 0% 100%',
200
+ foreground: '0 0% 11%',
201
+ card: '0 0% 98%',
202
+ cardForeground: '0 0% 11%',
203
+ popover: '0 0% 100%',
204
+ popoverForeground: '0 0% 11%',
205
+ primary: '279 87% 43%',
206
+ // Slack purple
207
+ primaryForeground: '0 0% 100%',
208
+ secondary: '0 0% 96%',
209
+ secondaryForeground: '0 0% 40%',
210
+ muted: '0 0% 96%',
211
+ mutedForeground: '0 0% 40%',
212
+ accent: '0 0% 96%',
213
+ accentForeground: '0 0% 11%',
214
+ destructive: '358 75% 59%',
215
+ destructiveForeground: '0 0% 100%',
216
+ border: '0 0% 90%',
217
+ input: '0 0% 90%',
218
+ ring: '279 87% 43%'
219
+ },
220
+ dark: {
221
+ background: '225 6% 13%',
222
+ foreground: '0 0% 93%',
223
+ card: '223 6% 18%',
224
+ cardForeground: '0 0% 93%',
225
+ popover: '223 6% 18%',
226
+ popoverForeground: '0 0% 93%',
227
+ primary: '292 85% 43%',
228
+ // Slack purple
229
+ primaryForeground: '0 0% 100%',
230
+ secondary: '222 5% 25%',
231
+ secondaryForeground: '0 0% 93%',
232
+ muted: '222 5% 25%',
233
+ mutedForeground: '217 8% 63%',
234
+ accent: '222 5% 25%',
235
+ accentForeground: '0 0% 93%',
236
+ destructive: '358 75% 59%',
237
+ destructiveForeground: '0 0% 100%',
238
+ border: '223 6% 25%',
239
+ input: '223 6% 25%',
240
+ ring: '292 85% 43%'
241
+ }
242
+ },
243
+ fontSizes: {
244
+ xs: '0.75rem',
245
+ sm: '0.875rem',
246
+ base: '1rem',
247
+ lg: '1.125rem',
248
+ xl: '1.25rem',
249
+ '2xl': '1.5rem',
250
+ '3xl': '1.875rem',
251
+ '4xl': '2.25rem',
252
+ '5xl': '3rem'
253
+ },
254
+ spacing: {
255
+ px: '1px',
256
+ 0: '0',
257
+ 0.5: '0.125rem',
258
+ 1: '0.25rem',
259
+ 1.5: '0.375rem',
260
+ 2: '0.5rem',
261
+ 2.5: '0.625rem',
262
+ 3: '0.75rem',
263
+ 3.5: '0.875rem',
264
+ 4: '1rem',
265
+ 5: '1.25rem',
266
+ 6: '1.5rem',
267
+ 8: '2rem',
268
+ 10: '2.5rem',
269
+ 12: '3rem',
270
+ 16: '4rem',
271
+ 20: '5rem',
272
+ 24: '6rem',
273
+ 32: '8rem',
274
+ 40: '10rem',
275
+ 48: '12rem',
276
+ 56: '14rem',
277
+ 64: '16rem'
278
+ },
279
+ borderRadius: {
280
+ none: '0',
281
+ sm: '0.125rem',
282
+ DEFAULT: '0.375rem',
283
+ md: '0.5rem',
284
+ lg: '0.75rem',
285
+ xl: '1rem',
286
+ '2xl': '1.5rem',
287
+ '3xl': '2rem',
288
+ full: '9999px'
289
+ }
290
+ },
291
+ // Spotify-inspired theme
292
+ spotify: {
293
+ name: 'Spotify',
294
+ colors: {
295
+ light: {
296
+ background: '0 0% 100%',
297
+ foreground: '0 0% 0%',
298
+ card: '0 0% 97%',
299
+ cardForeground: '0 0% 0%',
300
+ popover: '0 0% 100%',
301
+ popoverForeground: '0 0% 0%',
302
+ primary: '142 73% 37%',
303
+ // Spotify green
304
+ primaryForeground: '0 0% 100%',
305
+ secondary: '210 4% 91%',
306
+ secondaryForeground: '210 5% 35%',
307
+ muted: '210 4% 91%',
308
+ mutedForeground: '210 5% 35%',
309
+ accent: '142 73% 37%',
310
+ accentForeground: '0 0% 100%',
311
+ destructive: '0 63% 31%',
312
+ destructiveForeground: '0 0% 100%',
313
+ border: '214.3 31.8% 91.4%',
314
+ input: '214.3 31.8% 91.4%',
315
+ ring: '142 73% 37%'
316
+ },
317
+ dark: {
318
+ background: '0 0% 11%',
319
+ foreground: '0 0% 98%',
320
+ card: '0 0% 15%',
321
+ cardForeground: '0 0% 98%',
322
+ popover: '0 0% 15%',
323
+ popoverForeground: '0 0% 98%',
324
+ primary: '141 76% 48%',
325
+ // Spotify green
326
+ primaryForeground: '0 0% 2%',
327
+ secondary: '0 0% 18%',
328
+ secondaryForeground: '0 0% 98%',
329
+ muted: '0 0% 18%',
330
+ mutedForeground: '0 0% 65%',
331
+ accent: '141 76% 48%',
332
+ accentForeground: '0 0% 2%',
333
+ destructive: '0 84% 60%',
334
+ destructiveForeground: '0 0% 98%',
335
+ border: '240 3.7% 26%',
336
+ input: '240 3.7% 26%',
337
+ ring: '141 76% 48%'
338
+ }
339
+ },
340
+ fontSizes: {
341
+ xs: '0.75rem',
342
+ sm: '0.875rem',
343
+ base: '1rem',
344
+ lg: '1.125rem',
345
+ xl: '1.25rem',
346
+ '2xl': '1.5rem',
347
+ '3xl': '1.875rem',
348
+ '4xl': '2.25rem',
349
+ '5xl': '3rem'
350
+ },
351
+ spacing: {
352
+ px: '1px',
353
+ 0: '0px',
354
+ 0.5: '0.125rem',
355
+ 1: '0.25rem',
356
+ 1.5: '0.375rem',
357
+ 2: '0.5rem',
358
+ 2.5: '0.625rem',
359
+ 3: '0.75rem',
360
+ 3.5: '0.875rem',
361
+ 4: '1rem',
362
+ 5: '1.25rem',
363
+ 6: '1.5rem',
364
+ 8: '2rem',
365
+ 10: '2.5rem',
366
+ 12: '3rem',
367
+ 16: '4rem',
368
+ 20: '5rem',
369
+ 24: '6rem',
370
+ 32: '8rem',
371
+ 40: '10rem',
372
+ 48: '12rem',
373
+ 56: '14rem',
374
+ 64: '16rem'
375
+ },
376
+ borderRadius: {
377
+ none: '0',
378
+ sm: '0.25rem',
379
+ DEFAULT: '0.5rem',
380
+ md: '0.625rem',
381
+ lg: '0.75rem',
382
+ xl: '1rem',
383
+ '2xl': '1.5rem',
384
+ '3xl': '2rem',
385
+ full: '9999px'
386
+ }
387
+ }
388
+ };export{themeRegistry};//# sourceMappingURL=themeRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeRegistry.js","sources":["../../../src/components/ThemeProvider/themeRegistry.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;AACa,MAAA,aAAa,GAA0B;AAChD,EAAA,OAAA,EAAO;AACH,IAAA,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AACJ,MAAA,EAAA,EAAA,MAAI;AACJ,MAAA,EAAA,EAAA,MAAI;AACP,MAAA,EAAA,EAAA,OAAA;AACD,MAAA,EAAA,EAAA,OAAA;AACI,MAAA,EAAA,EAAA;AACA,MAAA,EAAA,EAAA;AACA,KAAA;AACA,IAAA,YAAI,EAAU;AACd,MAAA,IAAA,EAAA;AACA,MAAA,EAAA,EAAA,SAAU;AACV,MAAA,OAAA,EAAA,QAAe;AACf,MAAA,EAAA,EAAA,UAAa;AACb,MAAA,EAAA,EAAA,SAAc;AACjB,MAAA,EAAA,EAAA,MAAA;AACJ,MAAA,KAAA,EAAA,QAAA;MACH,KAAA,EAAA,MAAA;;;;"}
@@ -0,0 +1,26 @@
1
+ import { Theme, ThemeOptions } from './types';
2
+ /**
3
+ * Converts an HSL color string (like '210 40% 98%') to a hex color code
4
+ * @param hsl HSL color string in the format 'hue saturation% lightness%'
5
+ * @returns Hex color code like '#ffffff'
6
+ */
7
+ export declare function hslToHex(hsl: string): string;
8
+ /**
9
+ * Converts a hex color code to an HSL color string
10
+ * @param hex Hex color code like '#ffffff'
11
+ * @returns HSL color string in the format 'hue saturation% lightness%'
12
+ */
13
+ export declare function hexToHsl(hex: string): string;
14
+ /**
15
+ * Applies a theme to the document by setting CSS variables
16
+ * @param theme The theme configuration to apply
17
+ * @param options Options including dark mode flag and overrides
18
+ */
19
+ export declare function applyTheme(theme: Theme, options: ThemeOptions): void;
20
+ /**
21
+ * Generates a color palette from a primary color
22
+ * @param primaryColor HSL color string for the primary color
23
+ * @returns Object with color variations
24
+ */
25
+ export declare function generateColorPalette(primaryColor: string): Record<string, string>;
26
+ //# sourceMappingURL=themeUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeUtils.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeProvider/themeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAoC5C;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgD5C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CA+DpE;AA0BD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAsBjF"}
@@ -0,0 +1,192 @@
1
+ /**
2
+ * Converts an HSL color string (like '210 40% 98%') to a hex color code
3
+ * @param hsl HSL color string in the format 'hue saturation% lightness%'
4
+ * @returns Hex color code like '#ffffff'
5
+ */
6
+ function hslToHex(hsl) {
7
+ // Parse the HSL values
8
+ const [h, s, l] = hsl.split(' ').map((val, index) => {
9
+ if (index === 0) return parseInt(val, 10);
10
+ return parseInt(val.replace('%', ''), 10) / 100;
11
+ });
12
+ // Calculate RGB values
13
+ const c = (1 - Math.abs(2 * l - 1)) * s;
14
+ const x = c * (1 - Math.abs(h / 60 % 2 - 1));
15
+ const m = l - c / 2;
16
+ let r = 0,
17
+ g = 0,
18
+ b = 0;
19
+ if (0 <= h && h < 60) {
20
+ [r, g, b] = [c, x, 0];
21
+ } else if (60 <= h && h < 120) {
22
+ [r, g, b] = [x, c, 0];
23
+ } else if (120 <= h && h < 180) {
24
+ [r, g, b] = [0, c, x];
25
+ } else if (180 <= h && h < 240) {
26
+ [r, g, b] = [0, x, c];
27
+ } else if (240 <= h && h < 300) {
28
+ [r, g, b] = [x, 0, c];
29
+ } else if (300 <= h && h < 360) {
30
+ [r, g, b] = [c, 0, x];
31
+ }
32
+ // Convert to hex
33
+ const toHex = val => {
34
+ const hex = Math.round((val + m) * 255).toString(16);
35
+ return hex.length === 1 ? '0' + hex : hex;
36
+ };
37
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
38
+ }
39
+ /**
40
+ * Converts a hex color code to an HSL color string
41
+ * @param hex Hex color code like '#ffffff'
42
+ * @returns HSL color string in the format 'hue saturation% lightness%'
43
+ */
44
+ function hexToHsl(hex) {
45
+ // Remove the # if present
46
+ hex = hex.replace(/^#/, '');
47
+ // Parse the hex values
48
+ let r, g, b;
49
+ if (hex.length === 3) {
50
+ r = parseInt(hex[0] + hex[0], 16) / 255;
51
+ g = parseInt(hex[1] + hex[1], 16) / 255;
52
+ b = parseInt(hex[2] + hex[2], 16) / 255;
53
+ } else {
54
+ r = parseInt(hex.substring(0, 2), 16) / 255;
55
+ g = parseInt(hex.substring(2, 4), 16) / 255;
56
+ b = parseInt(hex.substring(4, 6), 16) / 255;
57
+ }
58
+ // Find the min and max values to calculate saturation
59
+ const max = Math.max(r, g, b);
60
+ const min = Math.min(r, g, b);
61
+ // Calculate lightness
62
+ const lightness = (max + min) / 2;
63
+ // Calculate saturation
64
+ let s = 0;
65
+ if (max !== min) {
66
+ s = lightness > 0.5 ? (max - min) / (2 - max - min) : (max - min) / (max + min);
67
+ }
68
+ // Calculate hue
69
+ let h = 0;
70
+ if (max !== min) {
71
+ if (max === r) {
72
+ h = (g - b) / (max - min) + (g < b ? 6 : 0);
73
+ } else if (max === g) {
74
+ h = (b - r) / (max - min) + 2;
75
+ } else {
76
+ h = (r - g) / (max - min) + 4;
77
+ }
78
+ h *= 60;
79
+ }
80
+ // Round values
81
+ h = Math.round(h);
82
+ s = Math.round(s * 100);
83
+ const l = Math.round(lightness * 100);
84
+ return `${h} ${s}% ${l}%`;
85
+ }
86
+ /**
87
+ * Applies a theme to the document by setting CSS variables
88
+ * @param theme The theme configuration to apply
89
+ * @param options Options including dark mode flag and overrides
90
+ */
91
+ function applyTheme(theme, options) {
92
+ const {
93
+ isDarkMode,
94
+ primaryColor,
95
+ fontFamily
96
+ } = options;
97
+ const modeKey = isDarkMode ? 'dark' : 'light';
98
+ const colors = theme.colors[modeKey];
99
+ // Apply all variables from the theme
100
+ Object.entries(colors).forEach(([key, value]) => {
101
+ document.documentElement.style.setProperty(`--${key}`, value);
102
+ });
103
+ // Override primary color if specified
104
+ if (primaryColor) {
105
+ try {
106
+ // Convert to HSL format if it's a hex color
107
+ if (primaryColor.startsWith('#')) {
108
+ const hslValue = hexToHsl(primaryColor);
109
+ document.documentElement.style.setProperty('--primary', hslValue);
110
+ // Generate primary foreground color - typically white or black depending on primary color lightness
111
+ const [,, lightness] = hslValue.split(' ');
112
+ const light = parseInt(lightness.replace('%', ''), 10);
113
+ const foreground = light > 60 ? '0 0% 0%' : '0 0% 100%';
114
+ document.documentElement.style.setProperty('--primary-foreground', foreground);
115
+ // Update ring color to match primary
116
+ document.documentElement.style.setProperty('--ring', hslValue);
117
+ // Apply related styles
118
+ applyThemeColors(theme, hslValue);
119
+ } else {
120
+ document.documentElement.style.setProperty('--primary', primaryColor);
121
+ }
122
+ } catch (error) {
123
+ console.error('Failed to apply primary color:', error);
124
+ }
125
+ }
126
+ // Apply all typography
127
+ if (fontFamily) {
128
+ document.documentElement.style.setProperty('--font-family', fontFamily);
129
+ document.documentElement.style.fontFamily = fontFamily;
130
+ }
131
+ // Apply font sizes
132
+ Object.entries(theme.fontSizes).forEach(([key, value]) => {
133
+ document.documentElement.style.setProperty(`--font-size-${key}`, value);
134
+ });
135
+ // Apply spacing
136
+ Object.entries(theme.spacing).forEach(([key, value]) => {
137
+ // CSS variables can't have dots, replace with underscores
138
+ const normalizedKey = String(key).replace('.', '_');
139
+ document.documentElement.style.setProperty(`--spacing-${normalizedKey}`, value);
140
+ });
141
+ // Apply border radius
142
+ Object.entries(theme.borderRadius).forEach(([key, value]) => {
143
+ const normalizedKey = key === 'DEFAULT' ? 'default' : key.replace(/\./g, '_');
144
+ document.documentElement.style.setProperty(`--radius-${normalizedKey}`, value);
145
+ });
146
+ // Set global radius
147
+ document.documentElement.style.setProperty('--radius', theme.borderRadius.DEFAULT);
148
+ }
149
+ /**
150
+ * Apply theme color variations based on primary color
151
+ * @param theme Current theme
152
+ * @param primaryHsl Primary color in HSL format
153
+ */
154
+ function applyThemeColors(theme, primaryHsl) {
155
+ const [hue, saturation] = primaryHsl.split(' ');
156
+ const h = parseInt(hue, 10);
157
+ const s = parseInt(saturation.replace('%', ''), 10);
158
+ // Generate accent color based on primary (typically a lighter variant)
159
+ const accentH = (h + 10) % 360; // Slightly shift hue
160
+ const accentS = Math.max(0, s - 15); // Slightly less saturated
161
+ const accentL = 95; // Light background
162
+ document.documentElement.style.setProperty('--accent', `${accentH} ${accentS}% ${accentL}%`);
163
+ // Generate accent foreground (text on accent)
164
+ document.documentElement.style.setProperty('--accent-foreground', `${h} ${s}% 20%`);
165
+ // For muted colors (using hue but lower saturation)
166
+ document.documentElement.style.setProperty('--muted', `${h} 10% 95%`);
167
+ document.documentElement.style.setProperty('--muted-foreground', `${h} 10% 40%`);
168
+ }
169
+ /**
170
+ * Generates a color palette from a primary color
171
+ * @param primaryColor HSL color string for the primary color
172
+ * @returns Object with color variations
173
+ */
174
+ function generateColorPalette(primaryColor) {
175
+ // Convert if hex
176
+ const hslColor = primaryColor.startsWith('#') ? hexToHsl(primaryColor) : primaryColor;
177
+ // Extract the HSL components
178
+ const [h, s, l] = hslColor.split(' ').map((val, index) => {
179
+ if (index === 0) return parseInt(val, 10);
180
+ return parseInt(val.replace('%', ''), 10);
181
+ });
182
+ // Generate a palette with different lightness values
183
+ const palette = {};
184
+ // Create 11 shades from 50 to 950
185
+ [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].forEach((shade, index) => {
186
+ // Adjust lightness based on shade (lighter for lower numbers)
187
+ // For example: 50 → 95% lightness, 950 → 10% lightness
188
+ const adjustedLightness = Math.min(98, Math.max(10, 100 - index * 9));
189
+ palette[shade] = `${h} ${s}% ${adjustedLightness}%`;
190
+ });
191
+ return palette;
192
+ }export{applyTheme,generateColorPalette,hexToHsl,hslToHex};//# sourceMappingURL=themeUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeUtils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