@hanzogui/theme-builder 2.0.0-rc.41-hanzoai.5
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/cjs/ThemeBuilder.cjs +248 -0
- package/dist/cjs/ThemeBuilder.native.js +338 -0
- package/dist/cjs/ThemeBuilder.native.js.map +1 -0
- package/dist/cjs/createStudioThemes.cjs +42 -0
- package/dist/cjs/createStudioThemes.native.js +45 -0
- package/dist/cjs/createStudioThemes.native.js.map +1 -0
- package/dist/cjs/createThemes.cjs +395 -0
- package/dist/cjs/createThemes.native.js +405 -0
- package/dist/cjs/createThemes.native.js.map +1 -0
- package/dist/cjs/defaultComponentThemes.cjs +86 -0
- package/dist/cjs/defaultComponentThemes.native.js +89 -0
- package/dist/cjs/defaultComponentThemes.native.js.map +1 -0
- package/dist/cjs/defaultTemplates.cjs +154 -0
- package/dist/cjs/defaultTemplates.native.js +162 -0
- package/dist/cjs/defaultTemplates.native.js.map +1 -0
- package/dist/cjs/defaultTemplatesStronger.cjs +152 -0
- package/dist/cjs/defaultTemplatesStronger.native.js +160 -0
- package/dist/cjs/defaultTemplatesStronger.native.js.map +1 -0
- package/dist/cjs/defaultTemplatesStrongest.cjs +152 -0
- package/dist/cjs/defaultTemplatesStrongest.native.js +160 -0
- package/dist/cjs/defaultTemplatesStrongest.native.js.map +1 -0
- package/dist/cjs/getThemeSuitePalettes.cjs +92 -0
- package/dist/cjs/getThemeSuitePalettes.native.js +117 -0
- package/dist/cjs/getThemeSuitePalettes.native.js.map +1 -0
- package/dist/cjs/helpers.cjs +36 -0
- package/dist/cjs/helpers.native.js +41 -0
- package/dist/cjs/helpers.native.js.map +1 -0
- package/dist/cjs/index.cjs +45 -0
- package/dist/cjs/index.native.js +48 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/masks.cjs +117 -0
- package/dist/cjs/masks.native.js +120 -0
- package/dist/cjs/masks.native.js.map +1 -0
- package/dist/cjs/types.cjs +18 -0
- package/dist/cjs/types.native.js +21 -0
- package/dist/cjs/types.native.js.map +1 -0
- package/dist/esm/ThemeBuilder.mjs +222 -0
- package/dist/esm/ThemeBuilder.mjs.map +1 -0
- package/dist/esm/ThemeBuilder.native.js +309 -0
- package/dist/esm/ThemeBuilder.native.js.map +1 -0
- package/dist/esm/createStudioThemes.mjs +17 -0
- package/dist/esm/createStudioThemes.mjs.map +1 -0
- package/dist/esm/createStudioThemes.native.js +17 -0
- package/dist/esm/createStudioThemes.native.js.map +1 -0
- package/dist/esm/createThemes.mjs +364 -0
- package/dist/esm/createThemes.mjs.map +1 -0
- package/dist/esm/createThemes.native.js +371 -0
- package/dist/esm/createThemes.native.js.map +1 -0
- package/dist/esm/defaultComponentThemes.mjs +61 -0
- package/dist/esm/defaultComponentThemes.mjs.map +1 -0
- package/dist/esm/defaultComponentThemes.native.js +61 -0
- package/dist/esm/defaultComponentThemes.native.js.map +1 -0
- package/dist/esm/defaultTemplates.mjs +129 -0
- package/dist/esm/defaultTemplates.mjs.map +1 -0
- package/dist/esm/defaultTemplates.native.js +134 -0
- package/dist/esm/defaultTemplates.native.js.map +1 -0
- package/dist/esm/defaultTemplatesStronger.mjs +127 -0
- package/dist/esm/defaultTemplatesStronger.mjs.map +1 -0
- package/dist/esm/defaultTemplatesStronger.native.js +132 -0
- package/dist/esm/defaultTemplatesStronger.native.js.map +1 -0
- package/dist/esm/defaultTemplatesStrongest.mjs +127 -0
- package/dist/esm/defaultTemplatesStrongest.mjs.map +1 -0
- package/dist/esm/defaultTemplatesStrongest.native.js +132 -0
- package/dist/esm/defaultTemplatesStrongest.native.js.map +1 -0
- package/dist/esm/getThemeSuitePalettes.mjs +66 -0
- package/dist/esm/getThemeSuitePalettes.mjs.map +1 -0
- package/dist/esm/getThemeSuitePalettes.native.js +88 -0
- package/dist/esm/getThemeSuitePalettes.native.js.map +1 -0
- package/dist/esm/helpers.mjs +9 -0
- package/dist/esm/helpers.mjs.map +1 -0
- package/dist/esm/helpers.native.js +11 -0
- package/dist/esm/helpers.native.js.map +1 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.mjs +10 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +10 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/esm/masks.mjs +92 -0
- package/dist/esm/masks.mjs.map +1 -0
- package/dist/esm/masks.native.js +92 -0
- package/dist/esm/masks.native.js.map +1 -0
- package/dist/esm/types.mjs +2 -0
- package/dist/esm/types.mjs.map +1 -0
- package/dist/esm/types.native.js +2 -0
- package/dist/esm/types.native.js.map +1 -0
- package/package.json +48 -0
- package/src/ThemeBuilder.ts +514 -0
- package/src/createStudioThemes.ts +28 -0
- package/src/createThemes.ts +794 -0
- package/src/defaultComponentThemes.ts +26 -0
- package/src/defaultTemplates.ts +157 -0
- package/src/defaultTemplatesStronger.ts +152 -0
- package/src/defaultTemplatesStrongest.ts +152 -0
- package/src/getThemeSuitePalettes.ts +101 -0
- package/src/helpers.ts +44 -0
- package/src/index.ts +22 -0
- package/src/masks.tsx +83 -0
- package/src/types.ts +97 -0
- package/types/ThemeBuilder.d.ts +80 -0
- package/types/ThemeBuilder.d.ts.map +1 -0
- package/types/createStudioThemes.d.ts +8 -0
- package/types/createStudioThemes.d.ts.map +1 -0
- package/types/createThemes.d.ts +141 -0
- package/types/createThemes.d.ts.map +1 -0
- package/types/defaultComponentThemes.d.ts +63 -0
- package/types/defaultComponentThemes.d.ts.map +1 -0
- package/types/defaultTemplates.d.ts +42 -0
- package/types/defaultTemplates.d.ts.map +1 -0
- package/types/defaultTemplatesStronger.d.ts +42 -0
- package/types/defaultTemplatesStronger.d.ts.map +1 -0
- package/types/defaultTemplatesStrongest.d.ts +42 -0
- package/types/defaultTemplatesStrongest.d.ts.map +1 -0
- package/types/getThemeSuitePalettes.d.ts +7 -0
- package/types/getThemeSuitePalettes.d.ts.map +1 -0
- package/types/helpers.d.ts +24 -0
- package/types/helpers.d.ts.map +1 -0
- package/types/index.d.ts +11 -0
- package/types/index.d.ts.map +1 -0
- package/types/masks.d.ts +18 -0
- package/types/masks.d.ts.map +1 -0
- package/types/types.d.ts +76 -0
- package/types/types.d.ts.map +1 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
23
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
24
|
+
value: true
|
|
25
|
+
}), mod);
|
|
26
|
+
var index_exports = {};
|
|
27
|
+
__export(index_exports, {
|
|
28
|
+
PALETTE_BACKGROUND_OFFSET: () => import_getThemeSuitePalettes.PALETTE_BACKGROUND_OFFSET,
|
|
29
|
+
createPalettes: () => import_createThemes.createPalettes,
|
|
30
|
+
createStudioThemes: () => import_createStudioThemes.createStudioThemes,
|
|
31
|
+
createThemes: () => import_createThemes.createThemes,
|
|
32
|
+
createV4ThemeBuilder: () => import_createThemes.createV4ThemeBuilder,
|
|
33
|
+
createV4Themes: () => import_createThemes.createV4Themes,
|
|
34
|
+
defaultComponentThemes: () => import_defaultComponentThemes.defaultComponentThemes,
|
|
35
|
+
defaultTemplates: () => import_defaultTemplates.defaultTemplates,
|
|
36
|
+
getThemeSuitePalettes: () => import_getThemeSuitePalettes.getThemeSuitePalettes,
|
|
37
|
+
masks: () => import_masks.masks
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(index_exports);
|
|
40
|
+
__reExport(index_exports, require("./ThemeBuilder.native.js"), module.exports);
|
|
41
|
+
__reExport(index_exports, require("@hanzogui/create-theme"), module.exports);
|
|
42
|
+
var import_createStudioThemes = require("./createStudioThemes.native.js");
|
|
43
|
+
var import_createThemes = require("./createThemes.native.js");
|
|
44
|
+
var import_defaultTemplates = require("./defaultTemplates.native.js");
|
|
45
|
+
var import_defaultComponentThemes = require("./defaultComponentThemes.native.js");
|
|
46
|
+
var import_getThemeSuitePalettes = require("./getThemeSuitePalettes.native.js");
|
|
47
|
+
var import_masks = require("./masks.native.js");
|
|
48
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","PALETTE_BACKGROUND_OFFSET","import_getThemeSuitePalettes","createPalettes","import_createThemes","createStudioThemes","import_createStudioThemes","createThemes","createV4ThemeBuilder","createV4Themes","defaultComponentThemes","import_defaultComponentThemes","defaultTemplates","import_defaultTemplates","getThemeSuitePalettes","masks","import_masks","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,yBAAA,EAAAA,CAAA,KAAAC,4BAAA,CAAAD,yBAAA;EAAAE,cAAA,EAAAA,CAAA,KAAAC,mBAAA,CAAAD,cAAA;EAAAE,kBAAA,EAAAA,CAAA,KAAAC,yBAAA,CAAAD,kBAAA;EAAAE,YAAA,EAAAA,CAAA,KAAAH,mBAAA,CAAAG,YAAA;EAAAC,oBAAA,EAAAA,CAAA,KAAAJ,mBAAA,CAAAI,oBAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAL,mBAAA,CAAAK,cAAA;EAAAC,sBAAA,EAAAA,CAAA,KAAAC,6BAAA,CAAAD,sBAAA;EAAAE,gBAAA,EAAAA,CAAA,KAAAC,uBAAA,CAAAD,gBAAA;EAAAE,qBAAA,EAAAA,CAAA,KAAAZ,4BAAA,CAAAY,qBAAA;EAAAC,KAAA,EAAAA,CAAA,KAAAC,YAAA,CAAAD;AAAA;AAAAE,MAAA,CAAAC,OAAA,GAAAxB,YAAc,CAAAK,aAAA;AACdoB,UAAA,CAAApB,aAAA,EAAcqB,OAAA,8BAAAH,MAAA,CAAAC,OADd;AAGAC,UAAA,CAAApB,aAAA,EAAAqB,OAAmC,4BAAAH,MAAA,CAAAC,OAAA;AACnC,IAAAZ,yBAMO,GAAAc,OAAA;AAEP,IAAAhB,mBAAA,GAAAgB,OAAiC;AAEjC,IAAAP,uBAAA,GAAAO,OAAuC;AAEvC,IAAAT,6BAAA,GAAiES,OAAA;AAGjE,IAAAlB,4BAAsB,GAAAkB,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
}), mod);
|
|
23
|
+
var masks_exports = {};
|
|
24
|
+
__export(masks_exports, {
|
|
25
|
+
masks: () => masks
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(masks_exports);
|
|
28
|
+
var import_create_theme = require("@hanzogui/create-theme");
|
|
29
|
+
const masks = {
|
|
30
|
+
identity: (0, import_create_theme.createIdentityMask)(),
|
|
31
|
+
soften: (0, import_create_theme.createSoftenMask)(),
|
|
32
|
+
soften2: (0, import_create_theme.createSoftenMask)({
|
|
33
|
+
strength: 2
|
|
34
|
+
}),
|
|
35
|
+
soften3: (0, import_create_theme.createSoftenMask)({
|
|
36
|
+
strength: 3
|
|
37
|
+
}),
|
|
38
|
+
strengthen: (0, import_create_theme.createStrengthenMask)(),
|
|
39
|
+
inverse: (0, import_create_theme.createInverseMask)(),
|
|
40
|
+
inverseSoften: (0, import_create_theme.combineMasks)((0, import_create_theme.createInverseMask)(), (0, import_create_theme.createSoftenMask)({
|
|
41
|
+
strength: 2
|
|
42
|
+
})),
|
|
43
|
+
inverseSoften2: (0, import_create_theme.combineMasks)((0, import_create_theme.createInverseMask)(), (0, import_create_theme.createSoftenMask)({
|
|
44
|
+
strength: 3
|
|
45
|
+
})),
|
|
46
|
+
inverseSoften3: (0, import_create_theme.combineMasks)((0, import_create_theme.createInverseMask)(), (0, import_create_theme.createSoftenMask)({
|
|
47
|
+
strength: 4
|
|
48
|
+
})),
|
|
49
|
+
inverseStrengthen2: (0, import_create_theme.combineMasks)((0, import_create_theme.createInverseMask)(), (0, import_create_theme.createStrengthenMask)({
|
|
50
|
+
strength: 2
|
|
51
|
+
})),
|
|
52
|
+
strengthenButSoftenBorder: (0, import_create_theme.createMask)((template, options) => {
|
|
53
|
+
const stronger = (0, import_create_theme.createStrengthenMask)().mask(template, options);
|
|
54
|
+
const softer = (0, import_create_theme.createSoftenMask)().mask(template, options);
|
|
55
|
+
return {
|
|
56
|
+
...stronger,
|
|
57
|
+
borderColor: softer.borderColor,
|
|
58
|
+
borderColorHover: softer.borderColorHover,
|
|
59
|
+
borderColorPress: softer.borderColorPress,
|
|
60
|
+
borderColorFocus: softer.borderColorFocus
|
|
61
|
+
};
|
|
62
|
+
}),
|
|
63
|
+
soften2Border1: (0, import_create_theme.createMask)((template, options) => {
|
|
64
|
+
const softer2 = (0, import_create_theme.createSoftenMask)({
|
|
65
|
+
strength: 2
|
|
66
|
+
}).mask(template, options);
|
|
67
|
+
const softer1 = (0, import_create_theme.createSoftenMask)({
|
|
68
|
+
strength: 1
|
|
69
|
+
}).mask(template, options);
|
|
70
|
+
return {
|
|
71
|
+
...softer2,
|
|
72
|
+
borderColor: softer1.borderColor,
|
|
73
|
+
borderColorHover: softer1.borderColorHover,
|
|
74
|
+
borderColorPress: softer1.borderColorPress,
|
|
75
|
+
borderColorFocus: softer1.borderColorFocus
|
|
76
|
+
};
|
|
77
|
+
}),
|
|
78
|
+
soften3FlatBorder: (0, import_create_theme.createMask)((template, options) => {
|
|
79
|
+
const borderMask = (0, import_create_theme.createSoftenMask)({
|
|
80
|
+
strength: 2
|
|
81
|
+
}).mask(template, options);
|
|
82
|
+
const softer3 = (0, import_create_theme.createSoftenMask)({
|
|
83
|
+
strength: 3
|
|
84
|
+
}).mask(template, options);
|
|
85
|
+
return {
|
|
86
|
+
...softer3,
|
|
87
|
+
borderColor: borderMask.borderColor,
|
|
88
|
+
borderColorHover: borderMask.borderColorHover,
|
|
89
|
+
borderColorPress: borderMask.borderColorPress,
|
|
90
|
+
borderColorFocus: borderMask.borderColorFocus
|
|
91
|
+
};
|
|
92
|
+
}),
|
|
93
|
+
softenBorder: (0, import_create_theme.createMask)((template, options) => {
|
|
94
|
+
const plain = import_create_theme.skipMask.mask(template, options);
|
|
95
|
+
const softer = (0, import_create_theme.createSoftenMask)().mask(template, options);
|
|
96
|
+
return {
|
|
97
|
+
...plain,
|
|
98
|
+
borderColor: softer.borderColor,
|
|
99
|
+
borderColorHover: softer.borderColorHover,
|
|
100
|
+
borderColorPress: softer.borderColorPress,
|
|
101
|
+
borderColorFocus: softer.borderColorFocus
|
|
102
|
+
};
|
|
103
|
+
}),
|
|
104
|
+
softenBorder2: (0, import_create_theme.createMask)((template, options) => {
|
|
105
|
+
const plain = import_create_theme.skipMask.mask(template, options);
|
|
106
|
+
const softer = (0, import_create_theme.createSoftenMask)({
|
|
107
|
+
strength: 2
|
|
108
|
+
}).mask(template, options);
|
|
109
|
+
return {
|
|
110
|
+
...plain,
|
|
111
|
+
borderColor: softer.borderColor,
|
|
112
|
+
borderColorHover: softer.borderColorHover,
|
|
113
|
+
borderColorPress: softer.borderColorPress,
|
|
114
|
+
borderColorFocus: softer.borderColorFocus
|
|
115
|
+
};
|
|
116
|
+
})
|
|
117
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
}), mod);
|
|
25
|
+
var masks_exports = {};
|
|
26
|
+
__export(masks_exports, {
|
|
27
|
+
masks: () => masks
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(masks_exports);
|
|
30
|
+
var import_create_theme = require("@hanzogui/create-theme");
|
|
31
|
+
var masks = {
|
|
32
|
+
identity: (0, import_create_theme.createIdentityMask)(),
|
|
33
|
+
soften: (0, import_create_theme.createSoftenMask)(),
|
|
34
|
+
soften2: (0, import_create_theme.createSoftenMask)({
|
|
35
|
+
strength: 2
|
|
36
|
+
}),
|
|
37
|
+
soften3: (0, import_create_theme.createSoftenMask)({
|
|
38
|
+
strength: 3
|
|
39
|
+
}),
|
|
40
|
+
strengthen: (0, import_create_theme.createStrengthenMask)(),
|
|
41
|
+
inverse: (0, import_create_theme.createInverseMask)(),
|
|
42
|
+
inverseSoften: (0, import_create_theme.combineMasks)((0, import_create_theme.createInverseMask)(), (0, import_create_theme.createSoftenMask)({
|
|
43
|
+
strength: 2
|
|
44
|
+
})),
|
|
45
|
+
inverseSoften2: (0, import_create_theme.combineMasks)((0, import_create_theme.createInverseMask)(), (0, import_create_theme.createSoftenMask)({
|
|
46
|
+
strength: 3
|
|
47
|
+
})),
|
|
48
|
+
inverseSoften3: (0, import_create_theme.combineMasks)((0, import_create_theme.createInverseMask)(), (0, import_create_theme.createSoftenMask)({
|
|
49
|
+
strength: 4
|
|
50
|
+
})),
|
|
51
|
+
inverseStrengthen2: (0, import_create_theme.combineMasks)((0, import_create_theme.createInverseMask)(), (0, import_create_theme.createStrengthenMask)({
|
|
52
|
+
strength: 2
|
|
53
|
+
})),
|
|
54
|
+
strengthenButSoftenBorder: (0, import_create_theme.createMask)(function (template, options) {
|
|
55
|
+
var stronger = (0, import_create_theme.createStrengthenMask)().mask(template, options);
|
|
56
|
+
var softer = (0, import_create_theme.createSoftenMask)().mask(template, options);
|
|
57
|
+
return {
|
|
58
|
+
...stronger,
|
|
59
|
+
borderColor: softer.borderColor,
|
|
60
|
+
borderColorHover: softer.borderColorHover,
|
|
61
|
+
borderColorPress: softer.borderColorPress,
|
|
62
|
+
borderColorFocus: softer.borderColorFocus
|
|
63
|
+
};
|
|
64
|
+
}),
|
|
65
|
+
soften2Border1: (0, import_create_theme.createMask)(function (template, options) {
|
|
66
|
+
var softer2 = (0, import_create_theme.createSoftenMask)({
|
|
67
|
+
strength: 2
|
|
68
|
+
}).mask(template, options);
|
|
69
|
+
var softer1 = (0, import_create_theme.createSoftenMask)({
|
|
70
|
+
strength: 1
|
|
71
|
+
}).mask(template, options);
|
|
72
|
+
return {
|
|
73
|
+
...softer2,
|
|
74
|
+
borderColor: softer1.borderColor,
|
|
75
|
+
borderColorHover: softer1.borderColorHover,
|
|
76
|
+
borderColorPress: softer1.borderColorPress,
|
|
77
|
+
borderColorFocus: softer1.borderColorFocus
|
|
78
|
+
};
|
|
79
|
+
}),
|
|
80
|
+
soften3FlatBorder: (0, import_create_theme.createMask)(function (template, options) {
|
|
81
|
+
var borderMask = (0, import_create_theme.createSoftenMask)({
|
|
82
|
+
strength: 2
|
|
83
|
+
}).mask(template, options);
|
|
84
|
+
var softer3 = (0, import_create_theme.createSoftenMask)({
|
|
85
|
+
strength: 3
|
|
86
|
+
}).mask(template, options);
|
|
87
|
+
return {
|
|
88
|
+
...softer3,
|
|
89
|
+
borderColor: borderMask.borderColor,
|
|
90
|
+
borderColorHover: borderMask.borderColorHover,
|
|
91
|
+
borderColorPress: borderMask.borderColorPress,
|
|
92
|
+
borderColorFocus: borderMask.borderColorFocus
|
|
93
|
+
};
|
|
94
|
+
}),
|
|
95
|
+
softenBorder: (0, import_create_theme.createMask)(function (template, options) {
|
|
96
|
+
var plain = import_create_theme.skipMask.mask(template, options);
|
|
97
|
+
var softer = (0, import_create_theme.createSoftenMask)().mask(template, options);
|
|
98
|
+
return {
|
|
99
|
+
...plain,
|
|
100
|
+
borderColor: softer.borderColor,
|
|
101
|
+
borderColorHover: softer.borderColorHover,
|
|
102
|
+
borderColorPress: softer.borderColorPress,
|
|
103
|
+
borderColorFocus: softer.borderColorFocus
|
|
104
|
+
};
|
|
105
|
+
}),
|
|
106
|
+
softenBorder2: (0, import_create_theme.createMask)(function (template, options) {
|
|
107
|
+
var plain = import_create_theme.skipMask.mask(template, options);
|
|
108
|
+
var softer = (0, import_create_theme.createSoftenMask)({
|
|
109
|
+
strength: 2
|
|
110
|
+
}).mask(template, options);
|
|
111
|
+
return {
|
|
112
|
+
...plain,
|
|
113
|
+
borderColor: softer.borderColor,
|
|
114
|
+
borderColorHover: softer.borderColorHover,
|
|
115
|
+
borderColorPress: softer.borderColorPress,
|
|
116
|
+
borderColorFocus: softer.borderColorFocus
|
|
117
|
+
};
|
|
118
|
+
})
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=masks.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","masks_exports","__export","masks","module","exports","import_create_theme","require","identity","createIdentityMask","soften","createSoftenMask","soften2","strength","soften3","strengthen","createStrengthenMask","inverse","createInverseMask","inverseSoften","combineMasks","inverseSoften2","inverseSoften3","inverseStrengthen2","strengthenButSoftenBorder","createMask","template","options","stronger","mask","softer","borderColor","borderColorHover","borderColorPress","borderColorFocus","soften2Border1","softer2","softer1","soften3FlatBorder","borderMask","softer3","softenBorder","plain","skipMask"],"sources":["../../src/masks.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAA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AAO,EAAAM,UAAA,CAAAN,gBAAA;MACLC,gBAAG,EAAAK,UAAA,CAAAL;IAAA;EACiB;EACKO,YACzB,MAAAnC,mBAAyB,CAAAmB,UAAA,YAAAC,QAAA,EAAAC,OAAA;IAAA,IACzBe,KAAA,GAAApC,mBAAyB,CAAAqC,QAAA,CAAAd,IAAA,CAAAH,QAAA,EAAAC,OAAA;IAC3B,IAAAG,MAAA,OAAAxB,mBAAA,CAAAK,gBAAA,IAAAkB,IAAA,CAAAH,QAAA,EAAAC,OAAA;IACD;MACH,GAAAe,KAAA","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
8
|
+
get: () => from[key],
|
|
9
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
}), mod);
|
|
17
|
+
var types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
+
get: () => from[key],
|
|
11
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
}), mod);
|
|
19
|
+
var types_exports = {};
|
|
20
|
+
module.exports = __toCommonJS(types_exports);
|
|
21
|
+
//# sourceMappingURL=types.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","types_exports"],"sources":["../../src/types.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { applyMask, createMask, createThemeWithPalettes, objectEntries, objectFromEntries } from "@hanzogui/create-theme";
|
|
2
|
+
class ThemeBuilder {
|
|
3
|
+
constructor(state) {
|
|
4
|
+
this.state = state;
|
|
5
|
+
}
|
|
6
|
+
state;
|
|
7
|
+
_getThemeFn;
|
|
8
|
+
addPalettes(palettes) {
|
|
9
|
+
this.state.palettes = {
|
|
10
|
+
// as {} prevents generic string key merge messing up types
|
|
11
|
+
...this.state.palettes,
|
|
12
|
+
...palettes
|
|
13
|
+
};
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
addTemplates(templates) {
|
|
17
|
+
this.state.templates = {
|
|
18
|
+
// as {} prevents generic string key merge messing up types
|
|
19
|
+
...this.state.templates,
|
|
20
|
+
...templates
|
|
21
|
+
};
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
addMasks(masks) {
|
|
25
|
+
this.state.masks = {
|
|
26
|
+
// as {} prevents generic string key merge messing up types
|
|
27
|
+
...this.state.masks,
|
|
28
|
+
...objectFromEntries(objectEntries(masks).map(([key, val]) => [key, createMask(val)]))
|
|
29
|
+
};
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
// for dev mode only really
|
|
33
|
+
_addedThemes = [];
|
|
34
|
+
addThemes(themes) {
|
|
35
|
+
this._addedThemes.push({
|
|
36
|
+
type: "themes",
|
|
37
|
+
args: [themes]
|
|
38
|
+
});
|
|
39
|
+
this.state.themes = {
|
|
40
|
+
// as {} prevents generic string key merge messing up types
|
|
41
|
+
...this.state.themes,
|
|
42
|
+
...themes
|
|
43
|
+
};
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
// these wont be typed to save some complexity and because they don't need to be typed!
|
|
47
|
+
addComponentThemes(childThemeDefinition, options) {
|
|
48
|
+
void this.addChildThemes(childThemeDefinition, options);
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
addChildThemes(childThemeDefinition, options) {
|
|
52
|
+
const currentThemes = this.state.themes;
|
|
53
|
+
if (!currentThemes) {
|
|
54
|
+
throw new Error(`No themes defined yet, use addThemes first to set your base themes`);
|
|
55
|
+
}
|
|
56
|
+
this._addedThemes.push({
|
|
57
|
+
type: "childThemes",
|
|
58
|
+
args: [childThemeDefinition, options]
|
|
59
|
+
});
|
|
60
|
+
const currentThemeNames = Object.keys(currentThemes);
|
|
61
|
+
const incomingThemeNames = Object.keys(childThemeDefinition);
|
|
62
|
+
const namesWithDefinitions = currentThemeNames.flatMap(prefix => {
|
|
63
|
+
const avoidNestingWithin = options?.avoidNestingWithin;
|
|
64
|
+
if (avoidNestingWithin) {
|
|
65
|
+
if (avoidNestingWithin.some(avoidName => prefix.startsWith(avoidName) || prefix.endsWith(avoidName))) {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return incomingThemeNames.map(subName => {
|
|
70
|
+
const fullName = `${prefix}_${subName}`;
|
|
71
|
+
const definition = childThemeDefinition[subName];
|
|
72
|
+
if ("avoidNestingWithin" in definition) {
|
|
73
|
+
const avoidNest = definition.avoidNestingWithin;
|
|
74
|
+
if (avoidNest.some(name => {
|
|
75
|
+
if ((name === "light" || name === "dark") && prefix.includes("_")) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
return prefix.startsWith(name) || prefix.endsWith(name);
|
|
79
|
+
})) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (prefix.endsWith(`_${subName}`)) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
if (fullName in currentThemes) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
return [fullName, definition];
|
|
90
|
+
}).filter(Boolean);
|
|
91
|
+
});
|
|
92
|
+
const childThemes = Object.fromEntries(namesWithDefinitions);
|
|
93
|
+
const next = {
|
|
94
|
+
// as {} prevents generic string key merge messing up types
|
|
95
|
+
...this.state.themes,
|
|
96
|
+
...childThemes
|
|
97
|
+
};
|
|
98
|
+
this.state.themes = next;
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
getTheme(fn) {
|
|
102
|
+
this._getThemeFn = fn;
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
build() {
|
|
106
|
+
if (!this.state.themes) {
|
|
107
|
+
return {};
|
|
108
|
+
}
|
|
109
|
+
const out = {};
|
|
110
|
+
const maskedThemes = [];
|
|
111
|
+
for (const themeName in this.state.themes) {
|
|
112
|
+
const nameParts = themeName.split("_");
|
|
113
|
+
const parentName = nameParts.slice(0, nameParts.length - 1).join("_");
|
|
114
|
+
const definitions = this.state.themes[themeName];
|
|
115
|
+
const themeDefinition = Array.isArray(definitions) ? (() => {
|
|
116
|
+
const found = definitions.find(
|
|
117
|
+
// endWith match stronger than startsWith
|
|
118
|
+
d => d.parent ? parentName.endsWith(d.parent) || parentName.startsWith(d.parent) : true);
|
|
119
|
+
if (!found) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
return found;
|
|
123
|
+
})() : definitions;
|
|
124
|
+
if (!themeDefinition) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if ("theme" in themeDefinition) {
|
|
128
|
+
out[themeName] = themeDefinition.theme;
|
|
129
|
+
} else if ("mask" in themeDefinition) {
|
|
130
|
+
maskedThemes.push({
|
|
131
|
+
parentName,
|
|
132
|
+
themeName,
|
|
133
|
+
mask: themeDefinition
|
|
134
|
+
});
|
|
135
|
+
} else {
|
|
136
|
+
let {
|
|
137
|
+
palette: paletteName = "",
|
|
138
|
+
template: templateName,
|
|
139
|
+
...options
|
|
140
|
+
} = themeDefinition;
|
|
141
|
+
const parentDefinition = this.state.themes[parentName];
|
|
142
|
+
if (!this.state.palettes) {
|
|
143
|
+
throw new Error(`No palettes defined for theme with palette expected: ${themeName}`);
|
|
144
|
+
}
|
|
145
|
+
let palette = this.state.palettes[paletteName || ""];
|
|
146
|
+
let attemptParentName = `${parentName}_${paletteName}`;
|
|
147
|
+
while (!palette && attemptParentName) {
|
|
148
|
+
if (attemptParentName in this.state.palettes) {
|
|
149
|
+
palette = this.state.palettes[attemptParentName];
|
|
150
|
+
paletteName = attemptParentName;
|
|
151
|
+
} else {
|
|
152
|
+
attemptParentName = attemptParentName.split("_").slice(0, -1).join("_");
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (!palette) {
|
|
156
|
+
const msg = process.env.NODE_ENV !== "production" ? `: ${themeName}: ${paletteName}
|
|
157
|
+
Definition: ${JSON.stringify(themeDefinition)}
|
|
158
|
+
Parent: ${JSON.stringify(parentDefinition)}
|
|
159
|
+
Potential: (${Object.keys(this.state.palettes).join(", ")})` : ``;
|
|
160
|
+
throw new Error(`No palette for theme${msg}`);
|
|
161
|
+
}
|
|
162
|
+
const template = this.state.templates?.[templateName] ??
|
|
163
|
+
// fall back to finding the scheme specific on if it exists
|
|
164
|
+
this.state.templates?.[`${nameParts[0]}_${templateName}`];
|
|
165
|
+
if (!template) {
|
|
166
|
+
throw new Error(`No template for theme ${themeName}: ${templateName} in templates:
|
|
167
|
+
- ${Object.keys(this.state.templates || {}).join("\n - ")}`);
|
|
168
|
+
}
|
|
169
|
+
const theme = createThemeWithPalettes(this.state.palettes, paletteName, template, options, themeName, true);
|
|
170
|
+
out[themeName] = this._getThemeFn ? {
|
|
171
|
+
...theme,
|
|
172
|
+
...this._getThemeFn({
|
|
173
|
+
theme,
|
|
174
|
+
name: themeName,
|
|
175
|
+
level: nameParts.length,
|
|
176
|
+
parentName,
|
|
177
|
+
scheme: /^(light|dark)$/.test(nameParts[0]) ? nameParts[0] : void 0,
|
|
178
|
+
parentNames: nameParts.slice(0, -1),
|
|
179
|
+
palette,
|
|
180
|
+
template
|
|
181
|
+
})
|
|
182
|
+
} : theme;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
for (const {
|
|
186
|
+
mask,
|
|
187
|
+
themeName,
|
|
188
|
+
parentName
|
|
189
|
+
} of maskedThemes) {
|
|
190
|
+
const parent = out[parentName];
|
|
191
|
+
if (!parent) {
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
const {
|
|
195
|
+
mask: maskName,
|
|
196
|
+
...options
|
|
197
|
+
} = mask;
|
|
198
|
+
let maskFunction = this.state.masks?.[maskName];
|
|
199
|
+
if (!maskFunction) {
|
|
200
|
+
throw new Error(`No mask ${maskName}`);
|
|
201
|
+
}
|
|
202
|
+
const parentTheme = this.state.themes[parentName];
|
|
203
|
+
if (parentTheme && "childOptions" in parentTheme) {
|
|
204
|
+
const {
|
|
205
|
+
mask: mask2,
|
|
206
|
+
...childOpts
|
|
207
|
+
} = parentTheme.childOptions;
|
|
208
|
+
if (mask2) {
|
|
209
|
+
maskFunction = this.state.masks?.[mask2];
|
|
210
|
+
}
|
|
211
|
+
Object.assign(options, childOpts);
|
|
212
|
+
}
|
|
213
|
+
out[themeName] = applyMask(parent, maskFunction, options, parentName, themeName);
|
|
214
|
+
}
|
|
215
|
+
return out;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function createThemeBuilder() {
|
|
219
|
+
return new ThemeBuilder({});
|
|
220
|
+
}
|
|
221
|
+
export { ThemeBuilder, createThemeBuilder };
|
|
222
|
+
//# sourceMappingURL=ThemeBuilder.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["applyMask","createMask","createThemeWithPalettes","objectEntries","objectFromEntries","ThemeBuilder","constructor","state","_getThemeFn","addPalettes","palettes","addTemplates","templates","addMasks","masks","map","key","val","_addedThemes","addThemes","themes","push","type","args","addComponentThemes","childThemeDefinition","options","addChildThemes","currentThemes","Error","currentThemeNames","Object","keys","incomingThemeNames","namesWithDefinitions","flatMap","prefix","avoidNestingWithin","some","avoidName","startsWith","endsWith","subName","fullName","definition","avoidNest","name","includes","filter","Boolean","childThemes","fromEntries","next","getTheme","fn","build","out","maskedThemes","themeName","nameParts","split","parentName","slice","length","join","definitions","themeDefinition","Array","isArray","found","find","d","parent","theme","mask","palette","paletteName","template","templateName","parentDefinition","attemptParentName","msg","process","env","NODE_ENV","JSON","stringify","level","scheme","test","parentNames","maskName","maskFunction","parentTheme","mask2","childOpts","childOptions","assign","createThemeBuilder"],"sources":["../../src/ThemeBuilder.ts"],"sourcesContent":[null],"mappings":"AAQA,SACEA,SAAA,EACAC,UAAA,EACAC,uBAAA,EACAC,aAAA,EACAC,iBAAA,QACK;AAwFA,MAAMC,YAAA,CAGX;EAGAC,YAAmBC,KAAA,EAAc;IAAd,KAAAA,KAAA,GAAAA,KAAA;EAAe;EAAfA,KAAA;EAFXC,WAAA;EAIRC,YAAgDC,QAAA,EAAa;IAC3D,KAAKH,KAAA,CAAMG,QAAA,GAAW;MAAA;MAEpB,GAAI,KAAKH,KAAA,CA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