@stackwright/themes 0.3.1 → 0.4.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/LICENSE +21 -0
- package/dist/index.d.mts +213 -64
- package/dist/index.d.ts +213 -64
- package/dist/index.js +72 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +25 -6
- package/AGENTS.md +0 -222
- package/CHANGELOG.md +0 -61
- package/src/ThemeProvider.tsx +0 -31
- package/src/index.ts +0 -4
- package/src/themeLoader.ts +0 -116
- package/src/themes/corporate.ts +0 -31
- package/src/themes/corporate.yaml +0 -36
- package/src/themes/soft.ts +0 -32
- package/src/themes/soft.yaml +0 -36
- package/src/types.ts +0 -66
- package/test/setup.ts +0 -1
- package/test/themeLoader.test.ts +0 -174
- package/tsconfig.json +0 -14
- package/tsup.config.ts +0 -16
- package/vitest.config.ts +0 -12
package/dist/index.js
CHANGED
|
@@ -32,10 +32,79 @@ var index_exports = {};
|
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
ThemeLoader: () => ThemeLoader,
|
|
34
34
|
ThemeProvider: () => ThemeProvider,
|
|
35
|
+
componentStyleSchema: () => componentStyleSchema,
|
|
36
|
+
themeConfigSchema: () => themeConfigSchema,
|
|
37
|
+
themeSchema: () => themeSchema,
|
|
35
38
|
useTheme: () => useTheme
|
|
36
39
|
});
|
|
37
40
|
module.exports = __toCommonJS(index_exports);
|
|
38
41
|
|
|
42
|
+
// src/types.ts
|
|
43
|
+
var import_zod = require("zod");
|
|
44
|
+
var componentStyleSchema = import_zod.z.object({
|
|
45
|
+
base: import_zod.z.string().optional(),
|
|
46
|
+
primary: import_zod.z.string().optional(),
|
|
47
|
+
secondary: import_zod.z.string().optional(),
|
|
48
|
+
outline: import_zod.z.string().optional(),
|
|
49
|
+
shadow: import_zod.z.string().optional(),
|
|
50
|
+
nav: import_zod.z.string().optional(),
|
|
51
|
+
text: import_zod.z.string().optional()
|
|
52
|
+
}).catchall(import_zod.z.string().optional());
|
|
53
|
+
var themeConfigSchema = import_zod.z.object({
|
|
54
|
+
id: import_zod.z.string(),
|
|
55
|
+
name: import_zod.z.string(),
|
|
56
|
+
description: import_zod.z.string(),
|
|
57
|
+
colors: import_zod.z.object({
|
|
58
|
+
primary: import_zod.z.string(),
|
|
59
|
+
secondary: import_zod.z.string(),
|
|
60
|
+
accent: import_zod.z.string(),
|
|
61
|
+
background: import_zod.z.string(),
|
|
62
|
+
surface: import_zod.z.string(),
|
|
63
|
+
text: import_zod.z.string(),
|
|
64
|
+
textSecondary: import_zod.z.string()
|
|
65
|
+
}),
|
|
66
|
+
backgroundImage: import_zod.z.object({
|
|
67
|
+
url: import_zod.z.string(),
|
|
68
|
+
repeat: import_zod.z.enum(["repeat", "repeat-x", "repeat-y", "no-repeat"]).optional(),
|
|
69
|
+
size: import_zod.z.string().optional(),
|
|
70
|
+
position: import_zod.z.string().optional(),
|
|
71
|
+
attachment: import_zod.z.enum(["scroll", "fixed", "local"]).optional(),
|
|
72
|
+
scale: import_zod.z.number().optional(),
|
|
73
|
+
animation: import_zod.z.enum(["drift", "float", "shimmer", "shimmer-float", "none"]).optional(),
|
|
74
|
+
customAnimation: import_zod.z.string().optional()
|
|
75
|
+
}).optional(),
|
|
76
|
+
typography: import_zod.z.object({
|
|
77
|
+
fontFamily: import_zod.z.object({
|
|
78
|
+
primary: import_zod.z.string(),
|
|
79
|
+
secondary: import_zod.z.string()
|
|
80
|
+
}),
|
|
81
|
+
scale: import_zod.z.object({
|
|
82
|
+
xs: import_zod.z.string(),
|
|
83
|
+
sm: import_zod.z.string(),
|
|
84
|
+
base: import_zod.z.string(),
|
|
85
|
+
lg: import_zod.z.string(),
|
|
86
|
+
xl: import_zod.z.string(),
|
|
87
|
+
"2xl": import_zod.z.string(),
|
|
88
|
+
"3xl": import_zod.z.string()
|
|
89
|
+
})
|
|
90
|
+
}),
|
|
91
|
+
spacing: import_zod.z.object({
|
|
92
|
+
xs: import_zod.z.string(),
|
|
93
|
+
sm: import_zod.z.string(),
|
|
94
|
+
md: import_zod.z.string(),
|
|
95
|
+
lg: import_zod.z.string(),
|
|
96
|
+
xl: import_zod.z.string(),
|
|
97
|
+
"2xl": import_zod.z.string()
|
|
98
|
+
}),
|
|
99
|
+
components: import_zod.z.object({
|
|
100
|
+
button: componentStyleSchema.optional(),
|
|
101
|
+
card: componentStyleSchema.optional(),
|
|
102
|
+
header: componentStyleSchema.optional(),
|
|
103
|
+
footer: componentStyleSchema.optional()
|
|
104
|
+
}).optional()
|
|
105
|
+
});
|
|
106
|
+
var themeSchema = themeConfigSchema;
|
|
107
|
+
|
|
39
108
|
// src/ThemeProvider.tsx
|
|
40
109
|
var import_react = require("react");
|
|
41
110
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -160,6 +229,9 @@ spacing:
|
|
|
160
229
|
0 && (module.exports = {
|
|
161
230
|
ThemeLoader,
|
|
162
231
|
ThemeProvider,
|
|
232
|
+
componentStyleSchema,
|
|
233
|
+
themeConfigSchema,
|
|
234
|
+
themeSchema,
|
|
163
235
|
useTheme
|
|
164
236
|
});
|
|
165
237
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/ThemeProvider.tsx","../src/themeLoader.ts"],"sourcesContent":["export * from './types';\nexport * from './ThemeProvider';\nexport * from './themeLoader';\nexport type { ThemeConfig, Theme, ComponentStyle } from './types';","import React, { createContext, useContext, useState, ReactNode } from 'react';\nimport { Theme } from './types';\n\ninterface ThemeContextType {\n theme: Theme;\n setTheme: (theme: Theme) => void;\n}\n\nconst ThemeContext = createContext<ThemeContextType | undefined>(undefined);\n\ninterface ThemeProviderProps {\n theme: Theme;\n children: ReactNode;\n}\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({ theme: initialTheme, children }) => {\n const [theme, setTheme] = useState<Theme>(initialTheme);\n return (\n <ThemeContext.Provider value={{ theme, setTheme }}>\n {children}\n </ThemeContext.Provider>\n );\n};\n\nexport const useTheme = (): ThemeContextType => {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context;\n};","import * as yaml from 'js-yaml';\nimport { Theme } from './types';\n\nexport class ThemeLoader {\n private static themes: Map<string, Theme> = new Map();\n\n static loadThemeFromYaml(yamlContent: string): Theme {\n try {\n const theme = yaml.load(yamlContent) as Theme;\n this.themes.set(theme.name, theme);\n return theme;\n } catch (error) {\n throw new Error(`Failed to parse theme YAML: ${error}`);\n }\n }\n\n static loadThemeFromFile(themeName: string): Theme {\n // In a real implementation, this would load from the file system\n // For now, we'll embed the themes\n const themeData = this.getEmbeddedTheme(themeName);\n return this.loadThemeFromYaml(themeData);\n }\n\n static getTheme(name: string): Theme | undefined {\n return this.themes.get(name);\n }\n\n static getAllThemes(): Theme[] {\n return Array.from(this.themes.values());\n }\n\n static registerCustomTheme(theme: Theme): void {\n this.themes.set(theme.name, theme);\n console.log(`🎨 Registered custom theme: ${theme.name}`);\n }\n\n static loadCustomTheme(theme: Theme): Theme {\n this.registerCustomTheme(theme);\n return theme;\n }\n\n private static getEmbeddedTheme(name: string): string {\n const themes: Record<string, string> = {\n corporate: `\nid: \"corporate\"\nname: \"Corporate\"\ndescription: \"A professional amber-toned corporate theme\"\ncolors:\n primary: \"#f59e0b\"\n secondary: \"#334155\"\n accent: \"#d97706\"\n background: \"#f8fafc\"\n surface: \"#ffffff\"\n text: \"#1f2937\"\n textSecondary: \"#6b7280\"\ntypography:\n fontFamily:\n primary: \"Roboto, sans-serif\"\n secondary: \"Roboto, sans-serif\"\n scale:\n xs: \"0.75rem\"\n sm: \"0.875rem\"\n base: \"1rem\"\n lg: \"1.125rem\"\n xl: \"1.25rem\"\n 2xl: \"1.5rem\"\n 3xl: \"1.875rem\"\nspacing:\n xs: \"0.5rem\"\n sm: \"0.75rem\"\n md: \"1rem\"\n lg: \"1.5rem\"\n xl: \"2rem\"\n 2xl: \"3rem\"\n`,\n soft: `\nid: \"soft\"\nname: \"Soft\"\ndescription: \"A gentle pink-toned soft theme\"\ncolors:\n primary: \"#ec4899\"\n secondary: \"#6b7280\"\n accent: \"#db2777\"\n background: \"#f9fafb\"\n surface: \"#ffffff\"\n text: \"#374151\"\n textSecondary: \"#9ca3af\"\ntypography:\n fontFamily:\n primary: \"Roboto, sans-serif\"\n secondary: \"Roboto, sans-serif\"\n scale:\n xs: \"0.75rem\"\n sm: \"0.875rem\"\n base: \"1rem\"\n lg: \"1.125rem\"\n xl: \"1.25rem\"\n 2xl: \"1.5rem\"\n 3xl: \"1.875rem\"\nspacing:\n xs: \"0.5rem\"\n sm: \"0.75rem\"\n md: \"1rem\"\n lg: \"1.5rem\"\n xl: \"2rem\"\n 2xl: \"3rem\"\n`\n };\n\n if (!themes[name]) {\n throw new Error(`Theme '${name}' not found`);\n }\n\n return themes[name];\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAsE;AAkBlE;AAVJ,IAAM,mBAAe,4BAA4C,MAAS;AAOnE,IAAM,gBAA8C,CAAC,EAAE,OAAO,cAAc,SAAS,MAAM;AAChG,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAgB,YAAY;AACtD,SACE,4CAAC,aAAa,UAAb,EAAsB,OAAO,EAAE,OAAO,SAAS,GAC7C,UACH;AAEJ;AAEO,IAAM,WAAW,MAAwB;AAC9C,QAAM,cAAU,yBAAW,YAAY;AACvC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,8CAA8C;AAAA,EAChE;AACA,SAAO;AACT;;;AC9BA,WAAsB;AAGf,IAAM,cAAN,MAAkB;AAAA,EACvB,OAAe,SAA6B,oBAAI,IAAI;AAAA,EAEpD,OAAO,kBAAkB,aAA4B;AACnD,QAAI;AACF,YAAM,QAAa,UAAK,WAAW;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AO,IAAI;AAAA,EACpB;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/types.ts","../src/ThemeProvider.tsx","../src/themeLoader.ts"],"sourcesContent":["export * from './types';\nexport * from './ThemeProvider';\nexport * from './themeLoader';\nexport type { ThemeConfig, Theme, ComponentStyle } from './types';\nexport { componentStyleSchema, themeConfigSchema, themeSchema } from './types';","import { z } from 'zod';\n\nexport const componentStyleSchema = z.object({\n base: z.string().optional(),\n primary: z.string().optional(),\n secondary: z.string().optional(),\n outline: z.string().optional(),\n shadow: z.string().optional(),\n nav: z.string().optional(),\n text: z.string().optional(),\n}).catchall(z.string().optional());\n\nexport const themeConfigSchema = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string(),\n colors: z.object({\n primary: z.string(),\n secondary: z.string(),\n accent: z.string(),\n background: z.string(),\n surface: z.string(),\n text: z.string(),\n textSecondary: z.string(),\n }),\n backgroundImage: z.object({\n url: z.string(),\n repeat: z.enum(['repeat', 'repeat-x', 'repeat-y', 'no-repeat']).optional(),\n size: z.string().optional(),\n position: z.string().optional(),\n attachment: z.enum(['scroll', 'fixed', 'local']).optional(),\n scale: z.number().optional(),\n animation: z.enum(['drift', 'float', 'shimmer', 'shimmer-float', 'none']).optional(),\n customAnimation: z.string().optional(),\n }).optional(),\n typography: z.object({\n fontFamily: z.object({\n primary: z.string(),\n secondary: z.string(),\n }),\n scale: z.object({\n xs: z.string(),\n sm: z.string(),\n base: z.string(),\n lg: z.string(),\n xl: z.string(),\n '2xl': z.string(),\n '3xl': z.string(),\n }),\n }),\n spacing: z.object({\n xs: z.string(),\n sm: z.string(),\n md: z.string(),\n lg: z.string(),\n xl: z.string(),\n '2xl': z.string(),\n }),\n components: z.object({\n button: componentStyleSchema.optional(),\n card: componentStyleSchema.optional(),\n header: componentStyleSchema.optional(),\n footer: componentStyleSchema.optional(),\n }).optional(),\n});\n\nexport const themeSchema = themeConfigSchema;\n\nexport type ThemeConfig = z.infer<typeof themeConfigSchema>;\nexport type ComponentStyle = z.infer<typeof componentStyleSchema>;\nexport interface Theme extends ThemeConfig {}\n","import React, { createContext, useContext, useState, ReactNode } from 'react';\nimport { Theme } from './types';\n\ninterface ThemeContextType {\n theme: Theme;\n setTheme: (theme: Theme) => void;\n}\n\nconst ThemeContext = createContext<ThemeContextType | undefined>(undefined);\n\ninterface ThemeProviderProps {\n theme: Theme;\n children: ReactNode;\n}\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({ theme: initialTheme, children }) => {\n const [theme, setTheme] = useState<Theme>(initialTheme);\n return (\n <ThemeContext.Provider value={{ theme, setTheme }}>\n {children}\n </ThemeContext.Provider>\n );\n};\n\nexport const useTheme = (): ThemeContextType => {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context;\n};","import * as yaml from 'js-yaml';\nimport { Theme } from './types';\n\nexport class ThemeLoader {\n private static themes: Map<string, Theme> = new Map();\n\n static loadThemeFromYaml(yamlContent: string): Theme {\n try {\n const theme = yaml.load(yamlContent) as Theme;\n this.themes.set(theme.name, theme);\n return theme;\n } catch (error) {\n throw new Error(`Failed to parse theme YAML: ${error}`);\n }\n }\n\n static loadThemeFromFile(themeName: string): Theme {\n // In a real implementation, this would load from the file system\n // For now, we'll embed the themes\n const themeData = this.getEmbeddedTheme(themeName);\n return this.loadThemeFromYaml(themeData);\n }\n\n static getTheme(name: string): Theme | undefined {\n return this.themes.get(name);\n }\n\n static getAllThemes(): Theme[] {\n return Array.from(this.themes.values());\n }\n\n static registerCustomTheme(theme: Theme): void {\n this.themes.set(theme.name, theme);\n console.log(`🎨 Registered custom theme: ${theme.name}`);\n }\n\n static loadCustomTheme(theme: Theme): Theme {\n this.registerCustomTheme(theme);\n return theme;\n }\n\n private static getEmbeddedTheme(name: string): string {\n const themes: Record<string, string> = {\n corporate: `\nid: \"corporate\"\nname: \"Corporate\"\ndescription: \"A professional amber-toned corporate theme\"\ncolors:\n primary: \"#f59e0b\"\n secondary: \"#334155\"\n accent: \"#d97706\"\n background: \"#f8fafc\"\n surface: \"#ffffff\"\n text: \"#1f2937\"\n textSecondary: \"#6b7280\"\ntypography:\n fontFamily:\n primary: \"Roboto, sans-serif\"\n secondary: \"Roboto, sans-serif\"\n scale:\n xs: \"0.75rem\"\n sm: \"0.875rem\"\n base: \"1rem\"\n lg: \"1.125rem\"\n xl: \"1.25rem\"\n 2xl: \"1.5rem\"\n 3xl: \"1.875rem\"\nspacing:\n xs: \"0.5rem\"\n sm: \"0.75rem\"\n md: \"1rem\"\n lg: \"1.5rem\"\n xl: \"2rem\"\n 2xl: \"3rem\"\n`,\n soft: `\nid: \"soft\"\nname: \"Soft\"\ndescription: \"A gentle pink-toned soft theme\"\ncolors:\n primary: \"#ec4899\"\n secondary: \"#6b7280\"\n accent: \"#db2777\"\n background: \"#f9fafb\"\n surface: \"#ffffff\"\n text: \"#374151\"\n textSecondary: \"#9ca3af\"\ntypography:\n fontFamily:\n primary: \"Roboto, sans-serif\"\n secondary: \"Roboto, sans-serif\"\n scale:\n xs: \"0.75rem\"\n sm: \"0.875rem\"\n base: \"1rem\"\n lg: \"1.125rem\"\n xl: \"1.25rem\"\n 2xl: \"1.5rem\"\n 3xl: \"1.875rem\"\nspacing:\n xs: \"0.5rem\"\n sm: \"0.75rem\"\n md: \"1rem\"\n lg: \"1.5rem\"\n xl: \"2rem\"\n 2xl: \"3rem\"\n`\n };\n\n if (!themes[name]) {\n throw new Error(`Theme '${name}' not found`);\n }\n\n return themes[name];\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAEX,IAAM,uBAAuB,aAAE,OAAO;AAAA,EACzC,MAAM,aAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,SAAS,aAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,WAAW,aAAE,OAAO,EAAE,SAAS;AAAA,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AAU,IAAI,aAAa;AAAA,IAC7C;AAEA,WAAO,OAAO,IAAI;AAAA,EACpB;AACF;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,69 @@
|
|
|
1
|
+
// src/types.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var componentStyleSchema = z.object({
|
|
4
|
+
base: z.string().optional(),
|
|
5
|
+
primary: z.string().optional(),
|
|
6
|
+
secondary: z.string().optional(),
|
|
7
|
+
outline: z.string().optional(),
|
|
8
|
+
shadow: z.string().optional(),
|
|
9
|
+
nav: z.string().optional(),
|
|
10
|
+
text: z.string().optional()
|
|
11
|
+
}).catchall(z.string().optional());
|
|
12
|
+
var themeConfigSchema = z.object({
|
|
13
|
+
id: z.string(),
|
|
14
|
+
name: z.string(),
|
|
15
|
+
description: z.string(),
|
|
16
|
+
colors: z.object({
|
|
17
|
+
primary: z.string(),
|
|
18
|
+
secondary: z.string(),
|
|
19
|
+
accent: z.string(),
|
|
20
|
+
background: z.string(),
|
|
21
|
+
surface: z.string(),
|
|
22
|
+
text: z.string(),
|
|
23
|
+
textSecondary: z.string()
|
|
24
|
+
}),
|
|
25
|
+
backgroundImage: z.object({
|
|
26
|
+
url: z.string(),
|
|
27
|
+
repeat: z.enum(["repeat", "repeat-x", "repeat-y", "no-repeat"]).optional(),
|
|
28
|
+
size: z.string().optional(),
|
|
29
|
+
position: z.string().optional(),
|
|
30
|
+
attachment: z.enum(["scroll", "fixed", "local"]).optional(),
|
|
31
|
+
scale: z.number().optional(),
|
|
32
|
+
animation: z.enum(["drift", "float", "shimmer", "shimmer-float", "none"]).optional(),
|
|
33
|
+
customAnimation: z.string().optional()
|
|
34
|
+
}).optional(),
|
|
35
|
+
typography: z.object({
|
|
36
|
+
fontFamily: z.object({
|
|
37
|
+
primary: z.string(),
|
|
38
|
+
secondary: z.string()
|
|
39
|
+
}),
|
|
40
|
+
scale: z.object({
|
|
41
|
+
xs: z.string(),
|
|
42
|
+
sm: z.string(),
|
|
43
|
+
base: z.string(),
|
|
44
|
+
lg: z.string(),
|
|
45
|
+
xl: z.string(),
|
|
46
|
+
"2xl": z.string(),
|
|
47
|
+
"3xl": z.string()
|
|
48
|
+
})
|
|
49
|
+
}),
|
|
50
|
+
spacing: z.object({
|
|
51
|
+
xs: z.string(),
|
|
52
|
+
sm: z.string(),
|
|
53
|
+
md: z.string(),
|
|
54
|
+
lg: z.string(),
|
|
55
|
+
xl: z.string(),
|
|
56
|
+
"2xl": z.string()
|
|
57
|
+
}),
|
|
58
|
+
components: z.object({
|
|
59
|
+
button: componentStyleSchema.optional(),
|
|
60
|
+
card: componentStyleSchema.optional(),
|
|
61
|
+
header: componentStyleSchema.optional(),
|
|
62
|
+
footer: componentStyleSchema.optional()
|
|
63
|
+
}).optional()
|
|
64
|
+
});
|
|
65
|
+
var themeSchema = themeConfigSchema;
|
|
66
|
+
|
|
1
67
|
// src/ThemeProvider.tsx
|
|
2
68
|
import { createContext, useContext, useState } from "react";
|
|
3
69
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -121,6 +187,9 @@ spacing:
|
|
|
121
187
|
export {
|
|
122
188
|
ThemeLoader,
|
|
123
189
|
ThemeProvider,
|
|
190
|
+
componentStyleSchema,
|
|
191
|
+
themeConfigSchema,
|
|
192
|
+
themeSchema,
|
|
124
193
|
useTheme
|
|
125
194
|
};
|
|
126
195
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ThemeProvider.tsx","../src/themeLoader.ts"],"sourcesContent":["import React, { createContext, useContext, useState, ReactNode } from 'react';\nimport { Theme } from './types';\n\ninterface ThemeContextType {\n theme: Theme;\n setTheme: (theme: Theme) => void;\n}\n\nconst ThemeContext = createContext<ThemeContextType | undefined>(undefined);\n\ninterface ThemeProviderProps {\n theme: Theme;\n children: ReactNode;\n}\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({ theme: initialTheme, children }) => {\n const [theme, setTheme] = useState<Theme>(initialTheme);\n return (\n <ThemeContext.Provider value={{ theme, setTheme }}>\n {children}\n </ThemeContext.Provider>\n );\n};\n\nexport const useTheme = (): ThemeContextType => {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context;\n};","import * as yaml from 'js-yaml';\nimport { Theme } from './types';\n\nexport class ThemeLoader {\n private static themes: Map<string, Theme> = new Map();\n\n static loadThemeFromYaml(yamlContent: string): Theme {\n try {\n const theme = yaml.load(yamlContent) as Theme;\n this.themes.set(theme.name, theme);\n return theme;\n } catch (error) {\n throw new Error(`Failed to parse theme YAML: ${error}`);\n }\n }\n\n static loadThemeFromFile(themeName: string): Theme {\n // In a real implementation, this would load from the file system\n // For now, we'll embed the themes\n const themeData = this.getEmbeddedTheme(themeName);\n return this.loadThemeFromYaml(themeData);\n }\n\n static getTheme(name: string): Theme | undefined {\n return this.themes.get(name);\n }\n\n static getAllThemes(): Theme[] {\n return Array.from(this.themes.values());\n }\n\n static registerCustomTheme(theme: Theme): void {\n this.themes.set(theme.name, theme);\n console.log(`🎨 Registered custom theme: ${theme.name}`);\n }\n\n static loadCustomTheme(theme: Theme): Theme {\n this.registerCustomTheme(theme);\n return theme;\n }\n\n private static getEmbeddedTheme(name: string): string {\n const themes: Record<string, string> = {\n corporate: `\nid: \"corporate\"\nname: \"Corporate\"\ndescription: \"A professional amber-toned corporate theme\"\ncolors:\n primary: \"#f59e0b\"\n secondary: \"#334155\"\n accent: \"#d97706\"\n background: \"#f8fafc\"\n surface: \"#ffffff\"\n text: \"#1f2937\"\n textSecondary: \"#6b7280\"\ntypography:\n fontFamily:\n primary: \"Roboto, sans-serif\"\n secondary: \"Roboto, sans-serif\"\n scale:\n xs: \"0.75rem\"\n sm: \"0.875rem\"\n base: \"1rem\"\n lg: \"1.125rem\"\n xl: \"1.25rem\"\n 2xl: \"1.5rem\"\n 3xl: \"1.875rem\"\nspacing:\n xs: \"0.5rem\"\n sm: \"0.75rem\"\n md: \"1rem\"\n lg: \"1.5rem\"\n xl: \"2rem\"\n 2xl: \"3rem\"\n`,\n soft: `\nid: \"soft\"\nname: \"Soft\"\ndescription: \"A gentle pink-toned soft theme\"\ncolors:\n primary: \"#ec4899\"\n secondary: \"#6b7280\"\n accent: \"#db2777\"\n background: \"#f9fafb\"\n surface: \"#ffffff\"\n text: \"#374151\"\n textSecondary: \"#9ca3af\"\ntypography:\n fontFamily:\n primary: \"Roboto, sans-serif\"\n secondary: \"Roboto, sans-serif\"\n scale:\n xs: \"0.75rem\"\n sm: \"0.875rem\"\n base: \"1rem\"\n lg: \"1.125rem\"\n xl: \"1.25rem\"\n 2xl: \"1.5rem\"\n 3xl: \"1.875rem\"\nspacing:\n xs: \"0.5rem\"\n sm: \"0.75rem\"\n md: \"1rem\"\n lg: \"1.5rem\"\n xl: \"2rem\"\n 2xl: \"3rem\"\n`\n };\n\n if (!themes[name]) {\n throw new Error(`Theme '${name}' not found`);\n }\n\n return themes[name];\n }\n}"],"mappings":";AAAA,SAAgB,eAAe,YAAY,gBAA2B;AAkBlE;AAVJ,IAAM,eAAe,cAA4C,MAAS;AAOnE,IAAM,gBAA8C,CAAC,EAAE,OAAO,cAAc,SAAS,MAAM;AAChG,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAgB,YAAY;AACtD,SACE,oBAAC,aAAa,UAAb,EAAsB,OAAO,EAAE,OAAO,SAAS,GAC7C,UACH;AAEJ;AAEO,IAAM,WAAW,MAAwB;AAC9C,QAAM,UAAU,WAAW,YAAY;AACvC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,8CAA8C;AAAA,EAChE;AACA,SAAO;AACT;;;AC9BA,YAAY,UAAU;AAGf,IAAM,cAAN,MAAkB;AAAA,EACvB,OAAe,SAA6B,oBAAI,IAAI;AAAA,EAEpD,OAAO,kBAAkB,aAA4B;AACnD,QAAI;AACF,YAAM,QAAa,UAAK,WAAW;AACnC,WAAK,OAAO,IAAI,MAA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names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/types.ts","../src/ThemeProvider.tsx","../src/themeLoader.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const componentStyleSchema = z.object({\n base: z.string().optional(),\n primary: z.string().optional(),\n secondary: z.string().optional(),\n outline: z.string().optional(),\n shadow: z.string().optional(),\n nav: z.string().optional(),\n text: z.string().optional(),\n}).catchall(z.string().optional());\n\nexport const themeConfigSchema = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string(),\n colors: z.object({\n primary: z.string(),\n secondary: z.string(),\n accent: z.string(),\n background: z.string(),\n surface: z.string(),\n text: z.string(),\n textSecondary: z.string(),\n }),\n backgroundImage: z.object({\n url: z.string(),\n repeat: z.enum(['repeat', 'repeat-x', 'repeat-y', 'no-repeat']).optional(),\n size: z.string().optional(),\n position: z.string().optional(),\n attachment: z.enum(['scroll', 'fixed', 'local']).optional(),\n scale: z.number().optional(),\n animation: z.enum(['drift', 'float', 'shimmer', 'shimmer-float', 'none']).optional(),\n customAnimation: z.string().optional(),\n }).optional(),\n typography: z.object({\n fontFamily: z.object({\n primary: z.string(),\n secondary: z.string(),\n }),\n scale: z.object({\n xs: z.string(),\n sm: z.string(),\n base: z.string(),\n lg: z.string(),\n xl: z.string(),\n '2xl': z.string(),\n '3xl': z.string(),\n }),\n }),\n spacing: z.object({\n xs: z.string(),\n sm: z.string(),\n md: z.string(),\n lg: z.string(),\n xl: z.string(),\n '2xl': z.string(),\n }),\n components: z.object({\n button: componentStyleSchema.optional(),\n card: componentStyleSchema.optional(),\n header: componentStyleSchema.optional(),\n footer: componentStyleSchema.optional(),\n }).optional(),\n});\n\nexport const themeSchema = themeConfigSchema;\n\nexport type ThemeConfig = z.infer<typeof themeConfigSchema>;\nexport type ComponentStyle = z.infer<typeof componentStyleSchema>;\nexport interface Theme extends ThemeConfig {}\n","import React, { createContext, useContext, useState, ReactNode } from 'react';\nimport { Theme } from './types';\n\ninterface ThemeContextType {\n theme: Theme;\n setTheme: (theme: Theme) => void;\n}\n\nconst ThemeContext = createContext<ThemeContextType | undefined>(undefined);\n\ninterface ThemeProviderProps {\n theme: Theme;\n children: ReactNode;\n}\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({ theme: initialTheme, children }) => {\n const [theme, setTheme] = useState<Theme>(initialTheme);\n return (\n <ThemeContext.Provider value={{ theme, setTheme }}>\n {children}\n </ThemeContext.Provider>\n );\n};\n\nexport const useTheme = (): ThemeContextType => {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context;\n};","import * as yaml from 'js-yaml';\nimport { Theme } from './types';\n\nexport class ThemeLoader {\n private static themes: Map<string, Theme> = new Map();\n\n static loadThemeFromYaml(yamlContent: string): Theme {\n try {\n const theme = yaml.load(yamlContent) as Theme;\n this.themes.set(theme.name, theme);\n return theme;\n } catch (error) {\n throw new Error(`Failed to parse theme YAML: ${error}`);\n }\n }\n\n static loadThemeFromFile(themeName: string): Theme {\n // In a real implementation, this would load from the file system\n // For now, we'll embed the themes\n const themeData = this.getEmbeddedTheme(themeName);\n return this.loadThemeFromYaml(themeData);\n }\n\n static getTheme(name: string): Theme | undefined {\n return this.themes.get(name);\n }\n\n static getAllThemes(): Theme[] {\n return Array.from(this.themes.values());\n }\n\n static registerCustomTheme(theme: Theme): void {\n this.themes.set(theme.name, theme);\n console.log(`🎨 Registered custom theme: ${theme.name}`);\n }\n\n static loadCustomTheme(theme: Theme): Theme {\n this.registerCustomTheme(theme);\n return theme;\n }\n\n private static getEmbeddedTheme(name: string): string {\n const themes: Record<string, string> = {\n corporate: `\nid: \"corporate\"\nname: \"Corporate\"\ndescription: \"A professional amber-toned corporate theme\"\ncolors:\n primary: \"#f59e0b\"\n secondary: \"#334155\"\n accent: \"#d97706\"\n background: \"#f8fafc\"\n surface: \"#ffffff\"\n text: \"#1f2937\"\n textSecondary: \"#6b7280\"\ntypography:\n fontFamily:\n primary: \"Roboto, sans-serif\"\n secondary: \"Roboto, sans-serif\"\n scale:\n xs: \"0.75rem\"\n sm: \"0.875rem\"\n base: \"1rem\"\n lg: \"1.125rem\"\n xl: \"1.25rem\"\n 2xl: \"1.5rem\"\n 3xl: \"1.875rem\"\nspacing:\n xs: \"0.5rem\"\n sm: \"0.75rem\"\n md: \"1rem\"\n lg: \"1.5rem\"\n xl: \"2rem\"\n 2xl: \"3rem\"\n`,\n soft: `\nid: \"soft\"\nname: \"Soft\"\ndescription: \"A gentle pink-toned soft theme\"\ncolors:\n primary: \"#ec4899\"\n secondary: \"#6b7280\"\n accent: \"#db2777\"\n background: \"#f9fafb\"\n surface: \"#ffffff\"\n text: \"#374151\"\n textSecondary: \"#9ca3af\"\ntypography:\n fontFamily:\n primary: \"Roboto, sans-serif\"\n secondary: \"Roboto, sans-serif\"\n scale:\n xs: \"0.75rem\"\n sm: \"0.875rem\"\n base: \"1rem\"\n lg: \"1.125rem\"\n xl: \"1.25rem\"\n 2xl: \"1.5rem\"\n 3xl: \"1.875rem\"\nspacing:\n xs: \"0.5rem\"\n sm: \"0.75rem\"\n md: \"1rem\"\n lg: \"1.5rem\"\n xl: \"2rem\"\n 2xl: \"3rem\"\n`\n };\n\n if (!themes[name]) {\n throw new Error(`Theme '${name}' not found`);\n }\n\n return themes[name];\n }\n}"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,uBAAuB,EAAE,OAAO;AAAA,EACzC,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA,EACzB,MAAM,EAAE,OAAO,EAAE,SAAS;AAC9B,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC;AAE1B,IAAM,oBAAoB,EAAE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4.1",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/Per-Aspera-LLC/stackwright"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"module": "./dist/index.mjs",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.mjs",
|
|
18
|
+
"require": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
6
21
|
"dependencies": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
22
|
+
"js-yaml": "^4",
|
|
23
|
+
"zod": "^4.1.12"
|
|
9
24
|
},
|
|
10
25
|
"devDependencies": {
|
|
11
26
|
"@types/react": "^19",
|
|
12
27
|
"@types/js-yaml": "^4",
|
|
28
|
+
"react": "^19",
|
|
13
29
|
"typescript": "^5",
|
|
14
30
|
"tsup": "^8",
|
|
15
|
-
"vitest": "^
|
|
31
|
+
"vitest": "^4"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": "^19"
|
|
16
35
|
},
|
|
17
36
|
"scripts": {
|
|
18
37
|
"build": "tsup",
|
package/AGENTS.md
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
# @stackwright/themes - Theme System
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
The `@stackwright/themes` package provides a YAML-configurable theme system for Stackwright applications. It enables developers and content creators to define custom visual themes declaratively, supporting everything from color palettes to typography scales and component styling variants.
|
|
6
|
-
|
|
7
|
-
## Key Features
|
|
8
|
-
|
|
9
|
-
### YAML-Driven Theme Configuration
|
|
10
|
-
Themes are defined in YAML format, making them accessible to non-developers:
|
|
11
|
-
|
|
12
|
-
```yaml
|
|
13
|
-
id: "custom-brand-theme"
|
|
14
|
-
name: "Custom Brand Theme"
|
|
15
|
-
description: "A theme for our brand identity"
|
|
16
|
-
colors:
|
|
17
|
-
primary: "#1976d2"
|
|
18
|
-
secondary: "#dc004e"
|
|
19
|
-
accent: "#9c27b0"
|
|
20
|
-
background: "#ffffff"
|
|
21
|
-
text: "#212121"
|
|
22
|
-
typography:
|
|
23
|
-
fontFamily:
|
|
24
|
-
primary: "Inter"
|
|
25
|
-
secondary: "Cinzel"
|
|
26
|
-
spacing:
|
|
27
|
-
xs: "0.5rem"
|
|
28
|
-
sm: "0.75rem"
|
|
29
|
-
md: "1rem"
|
|
30
|
-
lg: "1.5rem"
|
|
31
|
-
xl: "2rem"
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Dynamic Color Resolution
|
|
35
|
-
The theme system provides intelligent color resolution that supports:
|
|
36
|
-
- **Hex codes**: Direct color values like `#1976d2`
|
|
37
|
-
- **Theme references**: Named colors from the theme palette
|
|
38
|
-
- **Fallback handling**: Graceful degradation for invalid colors
|
|
39
|
-
|
|
40
|
-
```typescript
|
|
41
|
-
// Color resolution example from core package
|
|
42
|
-
function resolveColor(colorValue: string, themeColors: Record<string, string>): string {
|
|
43
|
-
if (colorValue.startsWith('#')) {
|
|
44
|
-
return colorValue; // Already a hex code
|
|
45
|
-
}
|
|
46
|
-
return themeColors[colorValue] || colorValue;
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Component Integration
|
|
51
|
-
Themes seamlessly integrate with React components through the `useSafeTheme()` hook:
|
|
52
|
-
|
|
53
|
-
```typescript
|
|
54
|
-
// Example from ThemedButton component
|
|
55
|
-
const theme = useSafeTheme();
|
|
56
|
-
const buttonColor = button.buttonBackground
|
|
57
|
-
? resolveColor(button.buttonBackground)
|
|
58
|
-
: background
|
|
59
|
-
? resolveColor(background)
|
|
60
|
-
: theme.colors.primary;
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### Background Image Support
|
|
64
|
-
Themes support background images with automatic transparency handling:
|
|
65
|
-
|
|
66
|
-
```typescript
|
|
67
|
-
// From PageLayout component
|
|
68
|
-
const hasBackgroundImage = siteConfig?.customTheme?.backgroundImage?.url;
|
|
69
|
-
const backgroundColor = hasBackgroundImage ? 'transparent' : theme.colors.background;
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Architecture
|
|
73
|
-
|
|
74
|
-
### Dependencies
|
|
75
|
-
- **React**: Core React hooks and components
|
|
76
|
-
- **js-yaml**: YAML parsing and serialization
|
|
77
|
-
- **TypeScript**: Type safety and development experience
|
|
78
|
-
|
|
79
|
-
### Build Configuration
|
|
80
|
-
The package uses `tsup` for building with dual format support:
|
|
81
|
-
|
|
82
|
-
```typescript
|
|
83
|
-
// tsup.config.ts
|
|
84
|
-
export default defineConfig({
|
|
85
|
-
entry: ['src/index.ts'],
|
|
86
|
-
format: ['cjs', 'esm'],
|
|
87
|
-
dts: true,
|
|
88
|
-
target: 'es2022',
|
|
89
|
-
splitting: false,
|
|
90
|
-
sourcemap: true,
|
|
91
|
-
clean: true,
|
|
92
|
-
outExtension({ format }) {
|
|
93
|
-
return {
|
|
94
|
-
js: format === 'cjs' ? '.js' : '.mjs',
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Development Workflow
|
|
101
|
-
|
|
102
|
-
### Theme Creation Process
|
|
103
|
-
1. **Define theme YAML** with colors, typography, and spacing
|
|
104
|
-
2. **Add theme exports** in the themes package index
|
|
105
|
-
3. **Test integration** with example applications
|
|
106
|
-
4. **Validate** theme structure and color accessibility
|
|
107
|
-
|
|
108
|
-
### Custom Theme Generation
|
|
109
|
-
The CLI package can generate custom themes from brand specifications:
|
|
110
|
-
|
|
111
|
-
```javascript
|
|
112
|
-
// From CLI custom theme generation
|
|
113
|
-
function generateCustomTheme(brand) {
|
|
114
|
-
const colors = mapBrandColorsToTheme(brand.colors);
|
|
115
|
-
|
|
116
|
-
return {
|
|
117
|
-
id: `${brand.name.toLowerCase().replace(/\s+/g, '-')}-custom`,
|
|
118
|
-
name: `${brand.name} Custom`,
|
|
119
|
-
description: `Custom theme for ${brand.name}`,
|
|
120
|
-
colors,
|
|
121
|
-
typography: {
|
|
122
|
-
fontFamily: {
|
|
123
|
-
primary: brand.fonts.find(f => f.usage === 'body')?.name || 'Inter',
|
|
124
|
-
secondary: brand.fonts.find(f => f.usage === 'titles')?.name || 'Cinzel'
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
## Integration Points
|
|
132
|
-
|
|
133
|
-
### With Core Framework
|
|
134
|
-
- **Color resolution**: Used throughout component system
|
|
135
|
-
- **Theme hooks**: Provides `useSafeTheme()` for components
|
|
136
|
-
- **Layout integration**: Background and styling support
|
|
137
|
-
|
|
138
|
-
### With CLI Tools
|
|
139
|
-
- **Theme generation**: AI-powered custom theme creation
|
|
140
|
-
- **Validation**: Schema validation for theme structure
|
|
141
|
-
- **Documentation**: Auto-generated theme reference
|
|
142
|
-
|
|
143
|
-
### With Next.js Adapter
|
|
144
|
-
- **SSR support**: Server-side theme resolution
|
|
145
|
-
- **Static generation**: Build-time theme optimization
|
|
146
|
-
- **Route integration**: Theme switching capabilities
|
|
147
|
-
|
|
148
|
-
## Theme Structure
|
|
149
|
-
|
|
150
|
-
### Core Properties
|
|
151
|
-
- **`id`**: Unique theme identifier
|
|
152
|
-
- **`name`**: Human-readable theme name
|
|
153
|
-
- **`description`**: Theme description and usage notes
|
|
154
|
-
- **`colors`**: Color palette definition
|
|
155
|
-
- **`typography`**: Font family and text styling
|
|
156
|
-
- **`spacing`**: Consistent spacing scale
|
|
157
|
-
|
|
158
|
-
### Color Palette
|
|
159
|
-
Standard color keys supported:
|
|
160
|
-
- `primary`: Main brand color
|
|
161
|
-
- `secondary`: Secondary brand color
|
|
162
|
-
- `accent`: Accent/highlight color
|
|
163
|
-
- `background`: Page background color
|
|
164
|
-
- `text`: Primary text color
|
|
165
|
-
|
|
166
|
-
### Typography System
|
|
167
|
-
Font family configuration:
|
|
168
|
-
- `primary`: Body text font
|
|
169
|
-
- `secondary`: Heading/title font
|
|
170
|
-
|
|
171
|
-
### Spacing Scale
|
|
172
|
-
Consistent spacing tokens:
|
|
173
|
-
- `xs`, `sm`, `md`, `lg`, `xl`, `2xl`: Progressive spacing scale
|
|
174
|
-
|
|
175
|
-
## Testing and Validation
|
|
176
|
-
|
|
177
|
-
### Development Testing
|
|
178
|
-
```bash
|
|
179
|
-
# Build the themes package
|
|
180
|
-
pnpm build:themes
|
|
181
|
-
|
|
182
|
-
# Test with example application
|
|
183
|
-
pnpm dev:example
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### Theme Validation
|
|
187
|
-
- **YAML parsing**: Ensures valid YAML structure
|
|
188
|
-
- **Type checking**: TypeScript validation of theme properties
|
|
189
|
-
- **Color validation**: Hex code and named color validation
|
|
190
|
-
- **Integration testing**: Cross-package theme usage validation
|
|
191
|
-
|
|
192
|
-
## Future Enhancements
|
|
193
|
-
|
|
194
|
-
### Planned Features
|
|
195
|
-
- **Theme variants**: Light/dark mode support
|
|
196
|
-
- **Component theming**: Per-component style overrides
|
|
197
|
-
- **Theme inheritance**: Base theme extension capabilities
|
|
198
|
-
- **Advanced typography**: Font weight and size scales
|
|
199
|
-
- **Animation themes**: Motion and transition definitions
|
|
200
|
-
|
|
201
|
-
### Performance Optimizations
|
|
202
|
-
- **Theme caching**: Runtime theme resolution caching
|
|
203
|
-
- **Build-time optimization**: Static theme extraction
|
|
204
|
-
- **Selective loading**: Dynamic theme loading
|
|
205
|
-
|
|
206
|
-
## Contributing
|
|
207
|
-
|
|
208
|
-
### Adding New Themes
|
|
209
|
-
1. Create theme YAML definition
|
|
210
|
-
2. Add to package exports
|
|
211
|
-
3. Update documentation
|
|
212
|
-
4. Test across components
|
|
213
|
-
|
|
214
|
-
### Extending Theme Properties
|
|
215
|
-
1. Update TypeScript types
|
|
216
|
-
2. Modify parsing logic
|
|
217
|
-
3. Update component integration
|
|
218
|
-
4. Add CLI generation support
|
|
219
|
-
|
|
220
|
-
---
|
|
221
|
-
|
|
222
|
-
**Note**: The themes package is currently in active development (version 0.3.1-alpha.1). Theme structure and APIs may evolve as the framework matures.
|
package/CHANGELOG.md
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# @stackwright/themes
|
|
2
|
-
|
|
3
|
-
## 0.3.1
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- dc2db25: Adding null checks to core
|
|
8
|
-
- bd7cd6e: Internal packagename refactor.
|
|
9
|
-
- ca71410: Core testing implemented
|
|
10
|
-
- 51dbbc9: Refactor types out of core into own package.
|
|
11
|
-
- f195337: Adding test dependencies to all packages.
|
|
12
|
-
- 5ff20a6: Fixing mixed compilation tooling (tsup/tsc) to only tsup
|
|
13
|
-
- 46df7ac: Documentation updates
|
|
14
|
-
- e4fbf2f: Update all dependencies
|
|
15
|
-
- cc761ce: More version updates
|
|
16
|
-
|
|
17
|
-
## 0.3.1-alpha.5
|
|
18
|
-
|
|
19
|
-
### Patch Changes
|
|
20
|
-
|
|
21
|
-
- dc2db25: Adding null checks to core
|
|
22
|
-
|
|
23
|
-
## 0.3.1-alpha.4
|
|
24
|
-
|
|
25
|
-
### Patch Changes
|
|
26
|
-
|
|
27
|
-
- cc761ce: More version updates
|
|
28
|
-
|
|
29
|
-
## 0.3.1-alpha.3
|
|
30
|
-
|
|
31
|
-
### Patch Changes
|
|
32
|
-
|
|
33
|
-
- e4fbf2f: Update all dependencies
|
|
34
|
-
|
|
35
|
-
## 0.3.1-alpha.2
|
|
36
|
-
|
|
37
|
-
### Patch Changes
|
|
38
|
-
|
|
39
|
-
- 46df7ac: Documentation updates
|
|
40
|
-
|
|
41
|
-
## 0.3.1-alpha.1
|
|
42
|
-
|
|
43
|
-
### Patch Changes
|
|
44
|
-
|
|
45
|
-
- 51dbbc9: Refactor types out of core into own package.
|
|
46
|
-
|
|
47
|
-
## 0.3.1-alpha.0
|
|
48
|
-
|
|
49
|
-
### Patch Changes
|
|
50
|
-
|
|
51
|
-
- bd7cd6e: Internal packagename refactor.
|
|
52
|
-
- ca71410: Core testing implemented
|
|
53
|
-
- f195337: Adding test dependencies to all packages.
|
|
54
|
-
- 5ff20a6: Fixing mixed compilation tooling (tsup/tsc) to only tsup
|
|
55
|
-
|
|
56
|
-
## 0.2.1
|
|
57
|
-
|
|
58
|
-
### Patch Changes
|
|
59
|
-
|
|
60
|
-
- 78a02d1: "testing beta tagging"
|
|
61
|
-
- d66fda6: Bump to test github publish action
|
package/src/ThemeProvider.tsx
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React, { createContext, useContext, useState, ReactNode } from 'react';
|
|
2
|
-
import { Theme } from './types';
|
|
3
|
-
|
|
4
|
-
interface ThemeContextType {
|
|
5
|
-
theme: Theme;
|
|
6
|
-
setTheme: (theme: Theme) => void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const ThemeContext = createContext<ThemeContextType | undefined>(undefined);
|
|
10
|
-
|
|
11
|
-
interface ThemeProviderProps {
|
|
12
|
-
theme: Theme;
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const ThemeProvider: React.FC<ThemeProviderProps> = ({ theme: initialTheme, children }) => {
|
|
17
|
-
const [theme, setTheme] = useState<Theme>(initialTheme);
|
|
18
|
-
return (
|
|
19
|
-
<ThemeContext.Provider value={{ theme, setTheme }}>
|
|
20
|
-
{children}
|
|
21
|
-
</ThemeContext.Provider>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const useTheme = (): ThemeContextType => {
|
|
26
|
-
const context = useContext(ThemeContext);
|
|
27
|
-
if (!context) {
|
|
28
|
-
throw new Error('useTheme must be used within a ThemeProvider');
|
|
29
|
-
}
|
|
30
|
-
return context;
|
|
31
|
-
};
|
package/src/index.ts
DELETED