@hanzogui/theme-builder 4.4.0 → 102.0.0-rc.41-hanzoai.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzogui/theme-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "102.0.0-rc.41-hanzoai.1",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -28,21 +28,21 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"build": "
|
|
32
|
-
"watch": "
|
|
33
|
-
"clean": "
|
|
34
|
-
"clean:build": "
|
|
31
|
+
"build": "hanzogui-build",
|
|
32
|
+
"watch": "hanzogui-build --watch",
|
|
33
|
+
"clean": "hanzogui-build clean",
|
|
34
|
+
"clean:build": "hanzogui-build clean:build",
|
|
35
35
|
"test": "vitest --run",
|
|
36
36
|
"test:web": "bun run test",
|
|
37
37
|
"test:watch": "vitest"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@hanzogui/create-theme": "
|
|
41
|
-
"@hanzogui/web": "
|
|
40
|
+
"@hanzogui/create-theme": "102.0.0-rc.41-hanzoai.1",
|
|
41
|
+
"@hanzogui/web": "102.0.0-rc.41-hanzoai.1",
|
|
42
42
|
"color2k": "^2.0.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@hanzogui/build": "
|
|
45
|
+
"@hanzogui/build": "102.0.0-rc.41-hanzoai.1",
|
|
46
46
|
"vitest": "4.0.4"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/src/createThemes.ts
CHANGED
|
@@ -203,7 +203,7 @@ export const getLastBuilder = () => lastBuilder
|
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
205
|
* V4 version of createThemes - uses v4 theme ordering for backwards compatibility.
|
|
206
|
-
* Use this for v4 themes (like v4-
|
|
206
|
+
* Use this for v4 themes (like v4-hanzogui.ts).
|
|
207
207
|
*/
|
|
208
208
|
export function createV4Themes<
|
|
209
209
|
Extra extends ExtraThemeValuesByScheme = ExtraThemeValuesByScheme,
|
|
@@ -616,7 +616,7 @@ export function createPalettes(palettes: BuildPalettes): SimplePaletteDefinition
|
|
|
616
616
|
* - Children and grandChildren themes are added FIRST
|
|
617
617
|
* - Accent theme is added LAST with avoidNestingWithin for children themes
|
|
618
618
|
*
|
|
619
|
-
* Use this for v4 themes (like v4-
|
|
619
|
+
* Use this for v4 themes (like v4-hanzogui.ts). The default createSimpleThemeBuilder
|
|
620
620
|
* now uses v5 ordering.
|
|
621
621
|
*/
|
|
622
622
|
export function createV4ThemeBuilder<
|
|
@@ -10,7 +10,7 @@ import type { BuildPalette } from './types'
|
|
|
10
10
|
const paletteSize = 12
|
|
11
11
|
|
|
12
12
|
// how many things come before the actual bg color (transparencies etc)
|
|
13
|
-
// 👋 SYNC WITH
|
|
13
|
+
// 👋 SYNC WITH hanzogui.dev/features/studio/constants
|
|
14
14
|
export const PALETTE_BACKGROUND_OFFSET = 6
|
|
15
15
|
|
|
16
16
|
const generateColorPalette = ({
|
package/types/createThemes.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare function createThemes<Extra extends ExtraThemeValuesByScheme = Ex
|
|
|
72
72
|
export declare const getLastBuilder: () => ThemeBuilder<import("./ThemeBuilder").ThemeBuilderInternalState, Record<string, string>> | null;
|
|
73
73
|
/**
|
|
74
74
|
* V4 version of createThemes - uses v4 theme ordering for backwards compatibility.
|
|
75
|
-
* Use this for v4 themes (like v4-
|
|
75
|
+
* Use this for v4 themes (like v4-hanzogui.ts).
|
|
76
76
|
*/
|
|
77
77
|
export declare function createV4Themes<Extra extends ExtraThemeValuesByScheme = ExtraThemeValuesByScheme, SubThemes extends SimpleThemesDefinition = SimpleThemesDefinition, ComponentThemes extends SimpleThemesDefinition | false = SimpleThemesDefinition, GrandChildrenThemes extends SimpleThemesDefinition | undefined = undefined, Accent extends BaseThemeDefinition<Extra> | undefined = undefined, Templates extends BuildTemplates = typeof defaultTemplates, GetThemeReturn extends Record<string, string | number> = Record<string, string>>(props: CreateThemesProps<Accent, GrandChildrenThemes, Extra, SubThemes, ComponentThemes, Templates, GetThemeReturn>): Record<"light" | "dark" | ((Accent extends undefined ? false : true) extends infer T ? T extends (Accent extends undefined ? false : true) ? T extends true ? "light_accent" | "dark_accent" : never : never : never) | (keyof SubThemes extends string ? `light_${(GrandChildrenThemes extends undefined ? undefined : Record<keyof GrandChildrenThemes, any>) extends infer T_1 ? T_1 extends (GrandChildrenThemes extends undefined ? undefined : Record<keyof GrandChildrenThemes, any>) ? T_1 extends undefined ? string & keyof SubThemes : NamesWithChildrenNames<string & keyof SubThemes, keyof T_1> : never : never}` | `dark_${(GrandChildrenThemes extends undefined ? undefined : Record<keyof GrandChildrenThemes, any>) extends infer T_2 ? T_2 extends (GrandChildrenThemes extends undefined ? undefined : Record<keyof GrandChildrenThemes, any>) ? T_2 extends undefined ? string & keyof SubThemes : NamesWithChildrenNames<string & keyof SubThemes, keyof T_2> : never : never}` : never), { [ThemeKey in "colorTransparent" | "color" | "colorHover" | "colorPress" | "colorFocus" | "placeholderColor" | "outlineColor" | "accentBackground" | "accentColor" | "background0" | "background02" | "background04" | "background06" | "background08" | "color1" | "color2" | "color3" | "color4" | "color5" | "color6" | "color7" | "color8" | "color9" | "color10" | "color11" | "color12" | "color0" | "color02" | "color04" | "color06" | "color08" | "background" | "backgroundHover" | "backgroundPress" | "backgroundFocus" | "borderColor" | "borderColorHover" | "borderColorPress" | "borderColorFocus" | keyof Extra["dark"] | ((Accent extends undefined ? false : true) extends infer T_3 ? T_3 extends (Accent extends undefined ? false : true) ? T_3 extends true ? "accent0" | "accent2" | "accent1" | "accent3" | "accent4" | "accent5" | "accent6" | "accent7" | "accent8" | "accent9" | "accent10" | "accent11" | "accent12" : never : never : never)]: string; } & GetThemeReturn>;
|
|
78
78
|
type NamesWithChildrenNames<ParentNames extends string, ChildNames> = ParentNames | (ChildNames extends string ? `${ParentNames}_${ChildNames}` : never);
|
|
@@ -111,7 +111,7 @@ export declare function createPalettes(palettes: BuildPalettes): SimplePaletteDe
|
|
|
111
111
|
* - Children and grandChildren themes are added FIRST
|
|
112
112
|
* - Accent theme is added LAST with avoidNestingWithin for children themes
|
|
113
113
|
*
|
|
114
|
-
* Use this for v4 themes (like v4-
|
|
114
|
+
* Use this for v4 themes (like v4-hanzogui.ts). The default createSimpleThemeBuilder
|
|
115
115
|
* now uses v5 ordering.
|
|
116
116
|
*/
|
|
117
117
|
export declare function createV4ThemeBuilder<Extra extends ExtraThemeValuesByScheme, Templates extends BuildTemplates, Palettes extends SimplePaletteDefinitions, ChildrenThemes extends Record<string, {
|