@shellui/core 0.4.1 → 0.5.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +15 -3
- package/schemas/curated-themes.json +4035 -0
- package/schemas/shellui.config.schema.json +961 -0
- package/schemas/shellui.theme.schema.json +187 -0
- package/src/app.tsx +4 -1
- package/src/components/ContentView.tsx +144 -9
- package/src/components/LoadingOverlay.tsx +1 -1
- package/src/components/ui/alert-dialog.tsx +1 -1
- package/src/components/ui/dialog.tsx +23 -5
- package/src/components/ui/drawer.tsx +282 -42
- package/src/components/ui/dropdown-menu.tsx +7 -2
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/separator.tsx +23 -0
- package/src/components/ui/sheet.tsx +220 -0
- package/src/components/ui/sidebar.tsx +785 -221
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/constants/urls.ts +1 -0
- package/src/features/admin/utils.ts +2 -45
- package/src/features/alertDialog/DialogContext.tsx +1 -1
- package/src/features/auth/components/LoginButton.tsx +25 -18
- package/src/features/auth/components/LoginPreferencesControls.tsx +124 -0
- package/src/features/auth/components/LoginView.tsx +131 -49
- package/src/features/config/types.ts +64 -82
- package/src/features/drawer/DrawerContext.tsx +55 -19
- package/src/features/layouts/AppLayout.tsx +3 -3
- package/src/features/layouts/OverlayShell.tsx +376 -77
- package/src/features/layouts/appbar/AppBarLayout.tsx +501 -88
- package/src/features/layouts/branding/AppBrandIcon.tsx +95 -0
- package/src/features/layouts/branding/resolveThemeAsset.spec.ts +33 -0
- package/src/features/layouts/branding/resolveThemeAsset.ts +33 -0
- package/src/features/layouts/chrome/CollapsedDesktopTitlebar.tsx +49 -0
- package/src/features/layouts/chrome/ContentDragOverlay.tsx +19 -0
- package/src/features/layouts/chrome/DesktopBackButton.tsx +71 -0
- package/src/features/layouts/chrome/DesktopChrome.tsx +28 -0
- package/src/features/layouts/chrome/DesktopForwardButton.tsx +59 -0
- package/src/features/layouts/chrome/DesktopHistoryButtons.tsx +16 -0
- package/src/features/layouts/chrome/constants.ts +11 -0
- package/src/features/layouts/chrome/goDesktopBack.spec.ts +218 -0
- package/src/features/layouts/chrome/goDesktopBack.ts +106 -0
- package/src/features/layouts/chrome/index.ts +26 -0
- package/src/features/layouts/chrome/runtime.ts +45 -0
- package/src/features/layouts/findMatchingNavigationItem.spec.ts +55 -0
- package/src/features/layouts/fullscreen/FullscreenLayout.tsx +17 -1
- package/src/features/layouts/isFrameForAppUrl.spec.ts +33 -0
- package/src/features/layouts/sidebar/NavigationContent.tsx +70 -34
- package/src/features/layouts/sidebar/SidebarIcons.tsx +41 -42
- package/src/features/layouts/sidebar/SidebarInner.tsx +142 -24
- package/src/features/layouts/sidebar/SidebarLayout.tsx +100 -37
- package/src/features/layouts/sidebar/sidebarUtils.ts +0 -7
- package/src/features/layouts/sidebar/types.ts +3 -3
- package/src/features/layouts/utils.ts +73 -5
- package/src/features/layouts/windows/WindowsLayout.tsx +173 -61
- package/src/features/modal/ModalContext.tsx +21 -8
- package/src/features/overlays/OverlayDrawerPendingBar.tsx +26 -0
- package/src/features/overlays/OverlayDynamicDemoView.tsx +108 -0
- package/src/features/overlays/OverlayPendingSpinner.tsx +18 -0
- package/src/features/overlays/ResponsiveModal.tsx +483 -0
- package/src/features/overlays/overlaySize.spec.ts +71 -0
- package/src/features/overlays/overlaySize.ts +228 -0
- package/src/features/overlays/useOverlayReportedSize.ts +130 -0
- package/src/features/settings/SettingsProvider.tsx +66 -46
- package/src/features/settings/SettingsView.tsx +42 -47
- package/src/features/settings/components/Appearance.tsx +305 -55
- package/src/features/settings/components/develop/DrawerTestButtons.tsx +18 -0
- package/src/features/settings/components/develop/ModalTestButtons.tsx +23 -0
- package/src/features/settings/utils/getResolvedAppearanceForSettings.ts +11 -5
- package/src/features/theme/applyTheme.ts +143 -0
- package/src/features/theme/color.ts +83 -0
- package/src/features/theme/curated/amber-minimal.json +86 -0
- package/src/features/theme/curated/amethyst-haze.json +86 -0
- package/src/features/theme/curated/astro-vista.json +86 -0
- package/src/features/theme/curated/bold-tech.json +86 -0
- package/src/features/theme/curated/bubblegum.json +86 -0
- package/src/features/theme/curated/caffeine.json +83 -0
- package/src/features/theme/curated/candyland.json +86 -0
- package/src/features/theme/curated/catppuccin.json +86 -0
- package/src/features/theme/curated/claude.json +86 -0
- package/src/features/theme/curated/claymorphism.json +86 -0
- package/src/features/theme/curated/clean-slate.json +86 -0
- package/src/features/theme/curated/cosmic-night.json +86 -0
- package/src/features/theme/curated/cyberpunk.json +86 -0
- package/src/features/theme/curated/darkmatter.json +86 -0
- package/src/features/theme/curated/doom-64.json +86 -0
- package/src/features/theme/curated/elegant-luxury.json +86 -0
- package/src/features/theme/curated/graphite.json +86 -0
- package/src/features/theme/curated/index.ts +260 -0
- package/src/features/theme/curated/kodama-grove.json +86 -0
- package/src/features/theme/curated/light-green.json +87 -0
- package/src/features/theme/curated/midnight-bloom.json +86 -0
- package/src/features/theme/curated/mocha-mousse.json +86 -0
- package/src/features/theme/curated/modern-minimal.json +86 -0
- package/src/features/theme/curated/mono.json +84 -0
- package/src/features/theme/curated/nature.json +86 -0
- package/src/features/theme/curated/neo-brutalism.json +86 -0
- package/src/features/theme/curated/northern-lights.json +86 -0
- package/src/features/theme/curated/notebook.json +87 -0
- package/src/features/theme/curated/ocean-breeze.json +86 -0
- package/src/features/theme/curated/pastel-dreams.json +86 -0
- package/src/features/theme/curated/perpetuity.json +86 -0
- package/src/features/theme/curated/quantum-rose.json +86 -0
- package/src/features/theme/curated/retro-arcade.json +86 -0
- package/src/features/theme/curated/sage-garden.json +86 -0
- package/src/features/theme/curated/shadcn.json +83 -0
- package/src/features/theme/curated/shellui.json +82 -0
- package/src/features/theme/curated/soft-pop.json +86 -0
- package/src/features/theme/curated/solar-dusk.json +86 -0
- package/src/features/theme/curated/starry-night.json +86 -0
- package/src/features/theme/curated/sunset-horizon.json +86 -0
- package/src/features/theme/curated/supabase.json +85 -0
- package/src/features/theme/curated/t3-chat.json +83 -0
- package/src/features/theme/curated/tangerine.json +86 -0
- package/src/features/theme/curated/twitter.json +86 -0
- package/src/features/theme/curated/vercel.json +86 -0
- package/src/features/theme/curated/vintage-paper.json +86 -0
- package/src/features/theme/curated/violet-bloom.json +87 -0
- package/src/features/theme/curated/zen-inspired.json +87 -0
- package/src/features/theme/index.ts +76 -0
- package/src/features/theme/normalize.ts +159 -0
- package/src/features/theme/registry.ts +50 -0
- package/src/features/theme/resolveConfig.ts +182 -0
- package/src/features/theme/safeApplyTheme.ts +147 -0
- package/src/features/theme/themes.spec.ts +276 -0
- package/src/features/theme/themes.ts +82 -558
- package/src/features/theme/tokenKeys.ts +60 -0
- package/src/features/theme/types.ts +170 -0
- package/src/features/theme/useTheme.tsx +48 -50
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/i18n/translations/en/common.json +41 -0
- package/src/i18n/translations/en/settings.json +10 -2
- package/src/i18n/translations/fr/common.json +41 -0
- package/src/i18n/translations/fr/settings.json +10 -2
- package/src/index.css +372 -128
- package/src/index.ts +71 -0
- package/src/lib/z-index.ts +4 -1
- package/src/routes/components/IndexRoute.tsx +12 -2
- package/src/routes/components/NavigationItemRoute.tsx +1 -10
- package/src/routes/hooks/useNavigationItems.ts +29 -44
- package/src/routes/routes.tsx +58 -27
- package/tailwind.config.js +27 -27
- package/src/features/layouts/sidebar/BottomNavItem.tsx +0 -88
- package/src/features/layouts/sidebar/MobileBottomNav.tsx +0 -168
|
@@ -1,561 +1,85 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
1
|
/**
|
|
3
|
-
* Theme
|
|
4
|
-
*
|
|
5
|
-
* Colors are stored in hex format (e.g., "#4CAF50" or "4CAF50")
|
|
6
|
-
* and converted to HSL when applied to CSS variables
|
|
2
|
+
* Theme system public surface for internal imports.
|
|
3
|
+
* Prefer importing from `@shellui/core` in app code.
|
|
7
4
|
*/
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
popoverForeground: string;
|
|
90
|
-
primary: string;
|
|
91
|
-
primaryForeground: string;
|
|
92
|
-
secondary: string;
|
|
93
|
-
secondaryForeground: string;
|
|
94
|
-
muted: string;
|
|
95
|
-
mutedForeground: string;
|
|
96
|
-
accent: string;
|
|
97
|
-
accentForeground: string;
|
|
98
|
-
destructive: string;
|
|
99
|
-
destructiveForeground: string;
|
|
100
|
-
border: string;
|
|
101
|
-
input: string;
|
|
102
|
-
ring: string;
|
|
103
|
-
radius: string;
|
|
104
|
-
sidebarBackground: string;
|
|
105
|
-
sidebarForeground: string;
|
|
106
|
-
sidebarPrimary: string;
|
|
107
|
-
sidebarPrimaryForeground: string;
|
|
108
|
-
sidebarAccent: string;
|
|
109
|
-
sidebarAccentForeground: string;
|
|
110
|
-
sidebarBorder: string;
|
|
111
|
-
sidebarRing: string;
|
|
112
|
-
};
|
|
113
|
-
dark: {
|
|
114
|
-
background: string;
|
|
115
|
-
foreground: string;
|
|
116
|
-
card: string;
|
|
117
|
-
cardForeground: string;
|
|
118
|
-
popover: string;
|
|
119
|
-
popoverForeground: string;
|
|
120
|
-
primary: string;
|
|
121
|
-
primaryForeground: string;
|
|
122
|
-
secondary: string;
|
|
123
|
-
secondaryForeground: string;
|
|
124
|
-
muted: string;
|
|
125
|
-
mutedForeground: string;
|
|
126
|
-
accent: string;
|
|
127
|
-
accentForeground: string;
|
|
128
|
-
destructive: string;
|
|
129
|
-
destructiveForeground: string;
|
|
130
|
-
border: string;
|
|
131
|
-
input: string;
|
|
132
|
-
ring: string;
|
|
133
|
-
radius: string;
|
|
134
|
-
sidebarBackground: string;
|
|
135
|
-
sidebarForeground: string;
|
|
136
|
-
sidebarPrimary: string;
|
|
137
|
-
sidebarPrimaryForeground: string;
|
|
138
|
-
sidebarAccent: string;
|
|
139
|
-
sidebarAccentForeground: string;
|
|
140
|
-
sidebarBorder: string;
|
|
141
|
-
sidebarRing: string;
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export interface ThemeDefinition {
|
|
146
|
-
name: string;
|
|
147
|
-
displayName: string;
|
|
148
|
-
colors: ThemeColors;
|
|
149
|
-
fontFamily?: string; // Optional custom font family (backward compatible)
|
|
150
|
-
headingFontFamily?: string; // Optional font family for headings (h1-h6)
|
|
151
|
-
bodyFontFamily?: string; // Optional font family for body text
|
|
152
|
-
fontFiles?: string[]; // Optional array of font file URLs or paths to load (e.g., Google Fonts links or local paths)
|
|
153
|
-
letterSpacing?: string; // Optional custom letter spacing (e.g., "0.02em")
|
|
154
|
-
textShadow?: string; // Optional custom text shadow (e.g., "1px 1px 2px rgba(0, 0, 0, 0.1)")
|
|
155
|
-
lineHeight?: string; // Optional custom line height (e.g., "1.6")
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Default theme - Green (current ShellUI theme)
|
|
160
|
-
* Colors are in hex format (e.g., "#FFFFFF" or "FFFFFF" for white)
|
|
161
|
-
*/
|
|
162
|
-
export const defaultTheme: ThemeDefinition = {
|
|
163
|
-
name: 'default',
|
|
164
|
-
displayName: 'Default',
|
|
165
|
-
colors: {
|
|
166
|
-
light: {
|
|
167
|
-
background: '#FFFFFF', // White
|
|
168
|
-
foreground: '#020617', // Very dark blue-gray
|
|
169
|
-
card: '#FFFFFF', // White
|
|
170
|
-
cardForeground: '#020617', // Very dark blue-gray
|
|
171
|
-
popover: '#FFFFFF', // White
|
|
172
|
-
popoverForeground: '#020617', // Very dark blue-gray
|
|
173
|
-
primary: '#22C55E', // Green
|
|
174
|
-
primaryForeground: '#FFFFFF', // White
|
|
175
|
-
secondary: '#F1F5F9', // Light gray-blue
|
|
176
|
-
secondaryForeground: '#0F172A', // Dark blue-gray
|
|
177
|
-
muted: '#F1F5F9', // Light gray-blue
|
|
178
|
-
mutedForeground: '#64748B', // Medium gray-blue
|
|
179
|
-
accent: '#F1F5F9', // Light gray-blue
|
|
180
|
-
accentForeground: '#0F172A', // Dark blue-gray
|
|
181
|
-
destructive: '#EF4444', // Red
|
|
182
|
-
destructiveForeground: '#F8FAFC', // Off-white
|
|
183
|
-
border: '#E2E8F0', // Light gray
|
|
184
|
-
input: '#E2E8F0', // Light gray
|
|
185
|
-
ring: '#020617', // Very dark blue-gray
|
|
186
|
-
radius: '0.5rem',
|
|
187
|
-
sidebarBackground: '#FAFAFA', // Off-white
|
|
188
|
-
sidebarForeground: '#334155', // Dark gray-blue
|
|
189
|
-
sidebarPrimary: '#0F172A', // Very dark blue-gray
|
|
190
|
-
sidebarPrimaryForeground: '#FAFAFA', // Off-white
|
|
191
|
-
sidebarAccent: '#F4F4F5', // Light gray
|
|
192
|
-
sidebarAccentForeground: '#0F172A', // Very dark blue-gray
|
|
193
|
-
sidebarBorder: '#E2E8F0', // Light gray
|
|
194
|
-
sidebarRing: '#3B82F6', // Blue
|
|
195
|
-
},
|
|
196
|
-
dark: {
|
|
197
|
-
background: '#020617', // Very dark blue-gray
|
|
198
|
-
foreground: '#F8FAFC', // Off-white
|
|
199
|
-
card: '#020617', // Very dark blue-gray
|
|
200
|
-
cardForeground: '#F8FAFC', // Off-white
|
|
201
|
-
popover: '#020617', // Very dark blue-gray
|
|
202
|
-
popoverForeground: '#F8FAFC', // Off-white
|
|
203
|
-
primary: '#4ADE80', // Bright green
|
|
204
|
-
primaryForeground: '#FFFFFF', // White
|
|
205
|
-
secondary: '#1E293B', // Dark blue-gray
|
|
206
|
-
secondaryForeground: '#F8FAFC', // Off-white
|
|
207
|
-
muted: '#1E293B', // Dark blue-gray
|
|
208
|
-
mutedForeground: '#94A3B8', // Medium gray-blue
|
|
209
|
-
accent: '#1E293B', // Dark blue-gray
|
|
210
|
-
accentForeground: '#F8FAFC', // Off-white
|
|
211
|
-
destructive: '#991B1B', // Dark red
|
|
212
|
-
destructiveForeground: '#F8FAFC', // Off-white
|
|
213
|
-
border: '#1E293B', // Dark blue-gray
|
|
214
|
-
input: '#1E293B', // Dark blue-gray
|
|
215
|
-
ring: '#CBD5E1', // Light gray-blue
|
|
216
|
-
radius: '0.5rem',
|
|
217
|
-
sidebarBackground: '#0F172A', // Very dark blue-gray
|
|
218
|
-
sidebarForeground: '#F1F5F9', // Light gray-blue
|
|
219
|
-
sidebarPrimary: '#E0E7FF', // Very light blue
|
|
220
|
-
sidebarPrimaryForeground: '#0F172A', // Very dark blue-gray
|
|
221
|
-
sidebarAccent: '#18181B', // Very dark gray
|
|
222
|
-
sidebarAccentForeground: '#F1F5F9', // Light gray-blue
|
|
223
|
-
sidebarBorder: '#18181B', // Very dark gray
|
|
224
|
-
sidebarRing: '#3B82F6', // Blue
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Blue theme
|
|
231
|
-
* Colors are in hex format (e.g., "#FFFFFF" or "FFFFFF" for white)
|
|
232
|
-
*/
|
|
233
|
-
export const blueTheme: ThemeDefinition = {
|
|
234
|
-
name: 'blue',
|
|
235
|
-
displayName: 'Blue',
|
|
236
|
-
colors: {
|
|
237
|
-
light: {
|
|
238
|
-
background: '#FFFFFF', // White
|
|
239
|
-
foreground: '#020617', // Very dark blue-gray
|
|
240
|
-
card: '#FFFFFF', // White
|
|
241
|
-
cardForeground: '#020617', // Very dark blue-gray
|
|
242
|
-
popover: '#FFFFFF', // White
|
|
243
|
-
popoverForeground: '#020617', // Very dark blue-gray
|
|
244
|
-
primary: '#3B82F6', // Blue
|
|
245
|
-
primaryForeground: '#FFFFFF', // White
|
|
246
|
-
secondary: '#F1F5F9', // Light gray-blue
|
|
247
|
-
secondaryForeground: '#0F172A', // Dark blue-gray
|
|
248
|
-
muted: '#F1F5F9', // Light gray-blue
|
|
249
|
-
mutedForeground: '#64748B', // Medium gray-blue
|
|
250
|
-
accent: '#F1F5F9', // Light gray-blue
|
|
251
|
-
accentForeground: '#0F172A', // Dark blue-gray
|
|
252
|
-
destructive: '#EF4444', // Red
|
|
253
|
-
destructiveForeground: '#F8FAFC', // Off-white
|
|
254
|
-
border: '#E2E8F0', // Light gray
|
|
255
|
-
input: '#E2E8F0', // Light gray
|
|
256
|
-
ring: '#3B82F6', // Blue
|
|
257
|
-
radius: '0.5rem',
|
|
258
|
-
sidebarBackground: '#FAFAFA', // Off-white
|
|
259
|
-
sidebarForeground: '#334155', // Dark gray-blue
|
|
260
|
-
sidebarPrimary: '#3B82F6', // Blue
|
|
261
|
-
sidebarPrimaryForeground: '#FFFFFF', // White
|
|
262
|
-
sidebarAccent: '#F4F4F5', // Light gray
|
|
263
|
-
sidebarAccentForeground: '#0F172A', // Very dark blue-gray
|
|
264
|
-
sidebarBorder: '#E2E8F0', // Light gray
|
|
265
|
-
sidebarRing: '#3B82F6', // Blue
|
|
266
|
-
},
|
|
267
|
-
dark: {
|
|
268
|
-
background: '#020617', // Very dark blue-gray
|
|
269
|
-
foreground: '#F8FAFC', // Off-white
|
|
270
|
-
card: '#020617', // Very dark blue-gray
|
|
271
|
-
cardForeground: '#F8FAFC', // Off-white
|
|
272
|
-
popover: '#020617', // Very dark blue-gray
|
|
273
|
-
popoverForeground: '#F8FAFC', // Off-white
|
|
274
|
-
primary: '#3B82F6', // Blue
|
|
275
|
-
primaryForeground: '#FFFFFF', // White
|
|
276
|
-
secondary: '#1E293B', // Dark blue-gray
|
|
277
|
-
secondaryForeground: '#F8FAFC', // Off-white
|
|
278
|
-
muted: '#1E293B', // Dark blue-gray
|
|
279
|
-
mutedForeground: '#94A3B8', // Medium gray-blue
|
|
280
|
-
accent: '#1E293B', // Dark blue-gray
|
|
281
|
-
accentForeground: '#F8FAFC', // Off-white
|
|
282
|
-
destructive: '#991B1B', // Dark red
|
|
283
|
-
destructiveForeground: '#F8FAFC', // Off-white
|
|
284
|
-
border: '#1E293B', // Dark blue-gray
|
|
285
|
-
input: '#1E293B', // Dark blue-gray
|
|
286
|
-
ring: '#3B82F6', // Blue
|
|
287
|
-
radius: '0.5rem',
|
|
288
|
-
sidebarBackground: '#0F172A', // Very dark blue-gray
|
|
289
|
-
sidebarForeground: '#F1F5F9', // Light gray-blue
|
|
290
|
-
sidebarPrimary: '#3B82F6', // Blue
|
|
291
|
-
sidebarPrimaryForeground: '#0F172A', // Dark blue-gray
|
|
292
|
-
sidebarAccent: '#18181B', // Very dark gray
|
|
293
|
-
sidebarAccentForeground: '#F1F5F9', // Light gray-blue
|
|
294
|
-
sidebarBorder: '#18181B', // Very dark gray
|
|
295
|
-
sidebarRing: '#3B82F6', // Blue
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Warm Yellow theme - Custom yellowish theme with warm tones
|
|
302
|
-
* Colors are in hex format (e.g., "#FFFFFF" or "FFFFFF" for white)
|
|
303
|
-
*/
|
|
304
|
-
export const warmYellowTheme: ThemeDefinition = {
|
|
305
|
-
name: 'warm-yellow',
|
|
306
|
-
displayName: 'Warm Yellow',
|
|
307
|
-
fontFamily: '"Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", cursive, sans-serif',
|
|
308
|
-
letterSpacing: '0.02em',
|
|
309
|
-
textShadow: '1px 1px 2px rgba(0, 0, 0, 0.1)',
|
|
310
|
-
lineHeight: '1.6',
|
|
311
|
-
colors: {
|
|
312
|
-
light: {
|
|
313
|
-
background: '#FFF8E7', // Warm cream/yellowish
|
|
314
|
-
foreground: '#3E2723', // Warm dark brown
|
|
315
|
-
card: '#FFFEF5', // Slightly off-white cream
|
|
316
|
-
cardForeground: '#3E2723', // Warm dark brown
|
|
317
|
-
popover: '#FFFEF5', // Slightly off-white cream
|
|
318
|
-
popoverForeground: '#3E2723', // Warm dark brown
|
|
319
|
-
primary: '#F59E0B', // Warm golden amber (complements yellow)
|
|
320
|
-
primaryForeground: '#FFFFFF', // White
|
|
321
|
-
secondary: '#F5E6D3', // Warm beige
|
|
322
|
-
secondaryForeground: '#3E2723', // Warm dark brown
|
|
323
|
-
muted: '#F5E6D3', // Warm beige
|
|
324
|
-
mutedForeground: '#6D4C41', // Medium warm brown
|
|
325
|
-
accent: '#FFE082', // Light warm yellow
|
|
326
|
-
accentForeground: '#3E2723', // Warm dark brown
|
|
327
|
-
destructive: '#E57373', // Soft red (works with warm tones)
|
|
328
|
-
destructiveForeground: '#FFFFFF', // White
|
|
329
|
-
border: '#E8D5B7', // Warm tan border
|
|
330
|
-
input: '#E8D5B7', // Warm tan input border
|
|
331
|
-
ring: '#F59E0B', // Warm golden amber ring
|
|
332
|
-
radius: '0.5rem',
|
|
333
|
-
sidebarBackground: '#FFF5E1', // Slightly warmer cream (subtle contrast with main background)
|
|
334
|
-
sidebarForeground: '#5D4037', // Medium warm brown
|
|
335
|
-
sidebarPrimary: '#F59E0B', // Warm golden amber
|
|
336
|
-
sidebarPrimaryForeground: '#FFFFFF', // White
|
|
337
|
-
sidebarAccent: '#F5E6D3', // Warm beige
|
|
338
|
-
sidebarAccentForeground: '#3E2723', // Warm dark brown
|
|
339
|
-
sidebarBorder: '#E8D5B7', // Warm tan
|
|
340
|
-
sidebarRing: '#F59E0B', // Warm golden amber
|
|
341
|
-
},
|
|
342
|
-
dark: {
|
|
343
|
-
background: '#2E2419', // Dark warm brown
|
|
344
|
-
foreground: '#FFF8E7', // Warm cream (inverted)
|
|
345
|
-
card: '#3E2723', // Dark warm brown
|
|
346
|
-
cardForeground: '#FFF8E7', // Warm cream
|
|
347
|
-
popover: '#3E2723', // Dark warm brown
|
|
348
|
-
popoverForeground: '#FFF8E7', // Warm cream
|
|
349
|
-
primary: '#FBBF24', // Bright golden amber (lighter for dark mode)
|
|
350
|
-
primaryForeground: '#FFFFFF', // White for better contrast
|
|
351
|
-
secondary: '#4E342E', // Medium dark warm brown
|
|
352
|
-
secondaryForeground: '#FFF8E7', // Warm cream
|
|
353
|
-
muted: '#4E342E', // Medium dark warm brown
|
|
354
|
-
mutedForeground: '#D7CCC8', // Light warm gray
|
|
355
|
-
accent: '#FFB74D', // Warm orange accent
|
|
356
|
-
accentForeground: '#2E2419', // Dark warm brown for better contrast
|
|
357
|
-
destructive: '#EF5350', // Softer red for dark mode
|
|
358
|
-
destructiveForeground: '#FFF8E7', // Warm cream
|
|
359
|
-
border: '#5D4037', // Medium warm brown border
|
|
360
|
-
input: '#5D4037', // Medium warm brown input border
|
|
361
|
-
ring: '#FBBF24', // Bright golden amber ring
|
|
362
|
-
radius: '0.5rem',
|
|
363
|
-
sidebarBackground: '#35281F', // Slightly warmer dark brown (subtle contrast with main background)
|
|
364
|
-
sidebarForeground: '#D7CCC8', // Light warm gray
|
|
365
|
-
sidebarPrimary: '#FBBF24', // Bright golden amber
|
|
366
|
-
sidebarPrimaryForeground: '#2E2419', // Dark warm brown for better contrast
|
|
367
|
-
sidebarAccent: '#4E342E', // Medium dark warm brown
|
|
368
|
-
sidebarAccentForeground: '#FFF8E7', // Warm cream
|
|
369
|
-
sidebarBorder: '#5D4037', // Medium warm brown
|
|
370
|
-
sidebarRing: '#FBBF24', // Bright golden amber
|
|
371
|
-
},
|
|
372
|
-
},
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Registry of all available themes
|
|
377
|
-
*/
|
|
378
|
-
const themeRegistry = new Map<string, ThemeDefinition>([
|
|
379
|
-
['default', defaultTheme],
|
|
380
|
-
['blue', blueTheme],
|
|
381
|
-
['warm-yellow', warmYellowTheme],
|
|
382
|
-
]);
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Register a custom theme
|
|
386
|
-
*/
|
|
387
|
-
export function registerTheme(theme: ThemeDefinition): void {
|
|
388
|
-
themeRegistry.set(theme.name, theme);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Get a theme by name
|
|
393
|
-
*/
|
|
394
|
-
export function getTheme(name: string): ThemeDefinition | undefined {
|
|
395
|
-
return themeRegistry.get(name);
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Get all available themes
|
|
400
|
-
*/
|
|
401
|
-
export function getAllThemes(): ThemeDefinition[] {
|
|
402
|
-
return Array.from(themeRegistry.values());
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* Apply theme colors to the document
|
|
407
|
-
* Converts hex format colors to HSL format for CSS variables
|
|
408
|
-
* Sets variables directly on :root to ensure they override CSS defaults
|
|
409
|
-
*/
|
|
410
|
-
export function applyTheme(theme: ThemeDefinition, isDark: boolean): void {
|
|
411
|
-
if (typeof document === 'undefined') {
|
|
412
|
-
return;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
const root = document.documentElement;
|
|
416
|
-
const colors = isDark ? theme.colors.dark : theme.colors.light;
|
|
417
|
-
|
|
418
|
-
// Convert hex to HSL for all colors
|
|
419
|
-
const primaryHsl = hexToHsl(colors.primary);
|
|
420
|
-
|
|
421
|
-
// Apply CSS variables directly on :root element
|
|
422
|
-
// Inline styles have the highest specificity and will override CSS defaults
|
|
423
|
-
// Format: HSL values without hsl() wrapper (e.g., "142 71% 45%")
|
|
424
|
-
root.style.setProperty('--background', hexToHsl(colors.background));
|
|
425
|
-
root.style.setProperty('--foreground', hexToHsl(colors.foreground));
|
|
426
|
-
root.style.setProperty('--card', hexToHsl(colors.card));
|
|
427
|
-
root.style.setProperty('--card-foreground', hexToHsl(colors.cardForeground));
|
|
428
|
-
root.style.setProperty('--popover', hexToHsl(colors.popover));
|
|
429
|
-
root.style.setProperty('--popover-foreground', hexToHsl(colors.popoverForeground));
|
|
430
|
-
root.style.setProperty('--primary', primaryHsl);
|
|
431
|
-
root.style.setProperty('--primary-foreground', hexToHsl(colors.primaryForeground));
|
|
432
|
-
root.style.setProperty('--secondary', hexToHsl(colors.secondary));
|
|
433
|
-
root.style.setProperty('--secondary-foreground', hexToHsl(colors.secondaryForeground));
|
|
434
|
-
root.style.setProperty('--muted', hexToHsl(colors.muted));
|
|
435
|
-
root.style.setProperty('--muted-foreground', hexToHsl(colors.mutedForeground));
|
|
436
|
-
root.style.setProperty('--accent', hexToHsl(colors.accent));
|
|
437
|
-
root.style.setProperty('--accent-foreground', hexToHsl(colors.accentForeground));
|
|
438
|
-
root.style.setProperty('--destructive', hexToHsl(colors.destructive));
|
|
439
|
-
root.style.setProperty('--destructive-foreground', hexToHsl(colors.destructiveForeground));
|
|
440
|
-
root.style.setProperty('--border', hexToHsl(colors.border));
|
|
441
|
-
root.style.setProperty('--input', hexToHsl(colors.input));
|
|
442
|
-
root.style.setProperty('--ring', hexToHsl(colors.ring));
|
|
443
|
-
root.style.setProperty('--radius', colors.radius); // radius is not a color
|
|
444
|
-
root.style.setProperty('--sidebar-background', hexToHsl(colors.sidebarBackground));
|
|
445
|
-
root.style.setProperty('--sidebar-foreground', hexToHsl(colors.sidebarForeground));
|
|
446
|
-
root.style.setProperty('--sidebar-primary', hexToHsl(colors.sidebarPrimary));
|
|
447
|
-
root.style.setProperty('--sidebar-primary-foreground', hexToHsl(colors.sidebarPrimaryForeground));
|
|
448
|
-
root.style.setProperty('--sidebar-accent', hexToHsl(colors.sidebarAccent));
|
|
449
|
-
root.style.setProperty('--sidebar-accent-foreground', hexToHsl(colors.sidebarAccentForeground));
|
|
450
|
-
root.style.setProperty('--sidebar-border', hexToHsl(colors.sidebarBorder));
|
|
451
|
-
root.style.setProperty('--sidebar-ring', hexToHsl(colors.sidebarRing));
|
|
452
|
-
|
|
453
|
-
// Load custom font files if provided
|
|
454
|
-
// Always clean up existing theme fonts first (for theme switching)
|
|
455
|
-
const head = document.head || document.getElementsByTagName('head')[0];
|
|
456
|
-
const existingFontLinks = head.querySelectorAll('link[data-theme-font], style[data-theme-font]');
|
|
457
|
-
existingFontLinks.forEach((link) => link.remove());
|
|
458
|
-
|
|
459
|
-
if (theme.fontFiles && theme.fontFiles.length > 0) {
|
|
460
|
-
theme.fontFiles.forEach((fontFile, index) => {
|
|
461
|
-
// Check if it's a Google Fonts link or a regular stylesheet
|
|
462
|
-
if (fontFile.includes('fonts.googleapis.com') || fontFile.endsWith('.css')) {
|
|
463
|
-
const link = document.createElement('link');
|
|
464
|
-
link.rel = 'stylesheet';
|
|
465
|
-
link.href = fontFile;
|
|
466
|
-
link.setAttribute('data-theme-font', theme.name);
|
|
467
|
-
head.appendChild(link);
|
|
468
|
-
} else {
|
|
469
|
-
// Assume it's a font file URL - create @font-face rule
|
|
470
|
-
const style = document.createElement('style');
|
|
471
|
-
style.setAttribute('data-theme-font', theme.name);
|
|
472
|
-
// Extract font name from URL or use a generic name
|
|
473
|
-
const fontName = `ThemeFont-${theme.name}-${index}`;
|
|
474
|
-
style.textContent = `
|
|
475
|
-
@font-face {
|
|
476
|
-
font-family: '${fontName}';
|
|
477
|
-
src: url('${fontFile}') format('woff2');
|
|
478
|
-
}
|
|
479
|
-
`;
|
|
480
|
-
head.appendChild(style);
|
|
481
|
-
}
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
// Apply custom font families
|
|
486
|
-
// Priority: headingFontFamily/bodyFontFamily > fontFamily (backward compatible)
|
|
487
|
-
const bodyFont = theme.bodyFontFamily || theme.fontFamily;
|
|
488
|
-
const headingFont = theme.headingFontFamily || theme.fontFamily || bodyFont;
|
|
489
|
-
|
|
490
|
-
if (bodyFont) {
|
|
491
|
-
root.style.setProperty('--body-font-family', bodyFont);
|
|
492
|
-
root.style.setProperty('--font-family', bodyFont); // Backward compatibility
|
|
493
|
-
document.body.style.fontFamily = bodyFont;
|
|
494
|
-
} else {
|
|
495
|
-
root.style.removeProperty('--body-font-family');
|
|
496
|
-
root.style.removeProperty('--font-family');
|
|
497
|
-
document.body.style.fontFamily = '';
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
if (headingFont) {
|
|
501
|
-
root.style.setProperty('--heading-font-family', headingFont);
|
|
502
|
-
// Apply to headings via CSS variable (will be used in CSS)
|
|
503
|
-
} else {
|
|
504
|
-
root.style.removeProperty('--heading-font-family');
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
// Apply optional font styling properties generically
|
|
508
|
-
if (theme.letterSpacing) {
|
|
509
|
-
root.style.setProperty('--letter-spacing', theme.letterSpacing);
|
|
510
|
-
root.style.letterSpacing = theme.letterSpacing;
|
|
511
|
-
} else {
|
|
512
|
-
root.style.removeProperty('--letter-spacing');
|
|
513
|
-
root.style.letterSpacing = '';
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
if (theme.textShadow) {
|
|
517
|
-
root.style.setProperty('--text-shadow', theme.textShadow);
|
|
518
|
-
// Apply slightly lighter shadow to body for better readability
|
|
519
|
-
const bodyShadow = theme.textShadow.replace(/rgba\(([^)]+)\)/, (match, rgba) => {
|
|
520
|
-
// Reduce opacity by ~20% for body text
|
|
521
|
-
const values = rgba.split(',').map((v: string) => v.trim());
|
|
522
|
-
if (values.length === 4) {
|
|
523
|
-
const opacity = parseFloat(values[3]);
|
|
524
|
-
return `rgba(${values[0]}, ${values[1]}, ${values[2]}, ${Math.max(0, opacity * 0.8)})`;
|
|
525
|
-
}
|
|
526
|
-
return match;
|
|
527
|
-
});
|
|
528
|
-
document.body.style.textShadow = bodyShadow;
|
|
529
|
-
} else {
|
|
530
|
-
root.style.removeProperty('--text-shadow');
|
|
531
|
-
document.body.style.textShadow = '';
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
if (theme.lineHeight) {
|
|
535
|
-
root.style.setProperty('--line-height', theme.lineHeight);
|
|
536
|
-
document.body.style.lineHeight = theme.lineHeight;
|
|
537
|
-
} else {
|
|
538
|
-
root.style.removeProperty('--line-height');
|
|
539
|
-
document.body.style.lineHeight = '';
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
// Verify primary color is set (for debugging)
|
|
543
|
-
const actualPrimary = root.style.getPropertyValue('--primary');
|
|
544
|
-
|
|
545
|
-
// Validate HSL format (should be "H S% L%" like "142 71% 45%")
|
|
546
|
-
const hslFormat = /^\d+(\.\d+)?\s+\d+(\.\d+)?%\s+\d+(\.\d+)?%$/;
|
|
547
|
-
|
|
548
|
-
if (!actualPrimary || actualPrimary.trim() === '') {
|
|
549
|
-
console.error(
|
|
550
|
-
`[Theme] Failed to set --primary CSS variable. Expected HSL from ${colors.primary}, got: "${actualPrimary}"`,
|
|
551
|
-
);
|
|
552
|
-
} else if (!hslFormat.test(actualPrimary.trim())) {
|
|
553
|
-
console.error(
|
|
554
|
-
`[Theme] Invalid HSL format for --primary: "${actualPrimary}". Expected format: "H S% L%"`,
|
|
555
|
-
);
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
// Force a reflow to ensure Tailwind picks up the changes
|
|
559
|
-
// This is sometimes needed for Tailwind v4 to recognize CSS variable changes
|
|
560
|
-
void root.offsetHeight;
|
|
561
|
-
}
|
|
6
|
+
export type {
|
|
7
|
+
ThemeColors,
|
|
8
|
+
ThemeColorsMode,
|
|
9
|
+
ThemeColorsModePartial,
|
|
10
|
+
ThemeDefinition,
|
|
11
|
+
ThemeFonts,
|
|
12
|
+
ThemeInput,
|
|
13
|
+
ThemeRef,
|
|
14
|
+
ThemesConfig,
|
|
15
|
+
ThemeColorKey,
|
|
16
|
+
} from './types';
|
|
17
|
+
export { THEME_SCHEMA_VERSION, THEME_COLOR_KEYS } from './types';
|
|
18
|
+
|
|
19
|
+
export { hexToHsl, toCssVarValue, isHexColor } from './color';
|
|
20
|
+
export { applyTheme } from './applyTheme';
|
|
21
|
+
export { normalizeTheme, toThemeJson } from './normalize';
|
|
22
|
+
export { resolveThemeConfig } from './resolveConfig';
|
|
23
|
+
export type { ResolveThemeConfigInput, ResolvedThemeConfig } from './resolveConfig';
|
|
24
|
+
export {
|
|
25
|
+
registerTheme,
|
|
26
|
+
setAvailableThemes,
|
|
27
|
+
getTheme,
|
|
28
|
+
getAllThemes,
|
|
29
|
+
clearThemeRegistry,
|
|
30
|
+
} from './registry';
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
defaultTheme,
|
|
34
|
+
themes,
|
|
35
|
+
themeNames,
|
|
36
|
+
recommendedThemeNames,
|
|
37
|
+
curatedThemes,
|
|
38
|
+
shelluiTheme,
|
|
39
|
+
claudeTheme,
|
|
40
|
+
lightGreenTheme,
|
|
41
|
+
zenInspiredTheme,
|
|
42
|
+
astroVistaTheme,
|
|
43
|
+
shadcnTheme,
|
|
44
|
+
amberMinimalTheme,
|
|
45
|
+
amethystHazeTheme,
|
|
46
|
+
boldTechTheme,
|
|
47
|
+
bubblegumTheme,
|
|
48
|
+
caffeineTheme,
|
|
49
|
+
candylandTheme,
|
|
50
|
+
catppuccinTheme,
|
|
51
|
+
claymorphismTheme,
|
|
52
|
+
cleanSlateTheme,
|
|
53
|
+
cosmicNightTheme,
|
|
54
|
+
cyberpunkTheme,
|
|
55
|
+
darkmatterTheme,
|
|
56
|
+
doom64Theme,
|
|
57
|
+
elegantLuxuryTheme,
|
|
58
|
+
graphiteTheme,
|
|
59
|
+
kodamaGroveTheme,
|
|
60
|
+
midnightBloomTheme,
|
|
61
|
+
mochaMousseTheme,
|
|
62
|
+
modernMinimalTheme,
|
|
63
|
+
monoTheme,
|
|
64
|
+
natureTheme,
|
|
65
|
+
neoBrutalismTheme,
|
|
66
|
+
northernLightsTheme,
|
|
67
|
+
notebookTheme,
|
|
68
|
+
oceanBreezeTheme,
|
|
69
|
+
pastelDreamsTheme,
|
|
70
|
+
perpetuityTheme,
|
|
71
|
+
quantumRoseTheme,
|
|
72
|
+
retroArcadeTheme,
|
|
73
|
+
sageGardenTheme,
|
|
74
|
+
softPopTheme,
|
|
75
|
+
solarDuskTheme,
|
|
76
|
+
starryNightTheme,
|
|
77
|
+
sunsetHorizonTheme,
|
|
78
|
+
supabaseTheme,
|
|
79
|
+
t3ChatTheme,
|
|
80
|
+
tangerineTheme,
|
|
81
|
+
twitterTheme,
|
|
82
|
+
vercelTheme,
|
|
83
|
+
vintagePaperTheme,
|
|
84
|
+
violetBloomTheme,
|
|
85
|
+
} from './curated';
|