@tamagui/theme-builder 1.125.9 → 1.125.11
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/dist/cjs/createStudioThemes.cjs +40 -0
- package/dist/cjs/createStudioThemes.js +30 -0
- package/dist/cjs/createStudioThemes.js.map +6 -0
- package/dist/cjs/createStudioThemes.native.js +35 -0
- package/dist/cjs/createStudioThemes.native.js.map +6 -0
- package/dist/cjs/createThemes.cjs +0 -10
- package/dist/cjs/createThemes.js +0 -10
- package/dist/cjs/createThemes.js.map +1 -1
- package/dist/cjs/createThemes.native.js +0 -11
- package/dist/cjs/createThemes.native.js.map +2 -2
- package/dist/cjs/defaultTemplatesStronger.cjs +147 -0
- package/dist/cjs/defaultTemplatesStronger.js +137 -0
- package/dist/cjs/defaultTemplatesStronger.js.map +6 -0
- package/dist/cjs/defaultTemplatesStronger.native.js +147 -0
- package/dist/cjs/defaultTemplatesStronger.native.js.map +6 -0
- package/dist/cjs/defaultTemplatesStrongest.cjs +147 -0
- package/dist/cjs/defaultTemplatesStrongest.js +137 -0
- package/dist/cjs/defaultTemplatesStrongest.js.map +6 -0
- package/dist/cjs/defaultTemplatesStrongest.native.js +147 -0
- package/dist/cjs/defaultTemplatesStrongest.native.js.map +6 -0
- package/dist/cjs/index.cjs +3 -2
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +2 -2
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/createStudioThemes.js +18 -0
- package/dist/esm/createStudioThemes.js.map +6 -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.js +0 -10
- package/dist/esm/createThemes.js.map +1 -1
- package/dist/esm/createThemes.mjs +1 -10
- package/dist/esm/createThemes.mjs.map +1 -1
- package/dist/esm/createThemes.native.js +1 -10
- package/dist/esm/createThemes.native.js.map +1 -1
- package/dist/esm/defaultTemplatesStronger.js +121 -0
- package/dist/esm/defaultTemplatesStronger.js.map +6 -0
- package/dist/esm/defaultTemplatesStronger.mjs +124 -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.js +121 -0
- package/dist/esm/defaultTemplatesStrongest.js.map +6 -0
- package/dist/esm/defaultTemplatesStrongest.mjs +124 -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/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -1
- package/dist/esm/index.native.js.map +1 -1
- package/package.json +3 -3
- package/src/createStudioThemes.ts +28 -0
- package/src/createThemes.ts +1 -14
- package/src/defaultTemplatesStronger.ts +152 -0
- package/src/defaultTemplatesStrongest.ts +152 -0
- package/src/index.ts +1 -1
- package/src/types.ts +4 -10
- package/types/createStudioThemes.d.ts +8 -0
- package/types/createStudioThemes.d.ts.map +1 -0
- package/types/createThemes.d.ts +1 -7
- package/types/createThemes.d.ts.map +1 -1
- 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/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/types.d.ts +3 -9
- package/types/types.d.ts.map +1 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { objectFromEntries, objectKeys } from "./helpers.native.js";
|
|
2
|
+
var getTemplates = function () {
|
|
3
|
+
var lightTemplates = getBaseTemplates("light"),
|
|
4
|
+
darkTemplates = getBaseTemplates("dark"),
|
|
5
|
+
templates = {
|
|
6
|
+
...objectFromEntries(objectKeys(lightTemplates).map(function (name) {
|
|
7
|
+
return [`light_${name}`, lightTemplates[name]];
|
|
8
|
+
})),
|
|
9
|
+
...objectFromEntries(objectKeys(darkTemplates).map(function (name) {
|
|
10
|
+
return [`dark_${name}`, darkTemplates[name]];
|
|
11
|
+
}))
|
|
12
|
+
};
|
|
13
|
+
return templates;
|
|
14
|
+
},
|
|
15
|
+
getBaseTemplates = function (scheme) {
|
|
16
|
+
var isLight = scheme === "light",
|
|
17
|
+
bgIndex = 6,
|
|
18
|
+
lighten = isLight ? -1 : 1,
|
|
19
|
+
darken = -lighten,
|
|
20
|
+
borderColor = bgIndex + 3,
|
|
21
|
+
baseColors = {
|
|
22
|
+
color: -bgIndex,
|
|
23
|
+
colorHover: -bgIndex - 1,
|
|
24
|
+
colorPress: -bgIndex,
|
|
25
|
+
colorFocus: -bgIndex - 1,
|
|
26
|
+
placeholderColor: -bgIndex - 3,
|
|
27
|
+
outlineColor: -2
|
|
28
|
+
},
|
|
29
|
+
base = {
|
|
30
|
+
accentBackground: 0,
|
|
31
|
+
accentColor: -0,
|
|
32
|
+
background0: 1,
|
|
33
|
+
background02: 2,
|
|
34
|
+
background04: 3,
|
|
35
|
+
background06: 4,
|
|
36
|
+
background08: 5,
|
|
37
|
+
color1: bgIndex,
|
|
38
|
+
color2: bgIndex + 1,
|
|
39
|
+
color3: bgIndex + 2,
|
|
40
|
+
color4: bgIndex + 3,
|
|
41
|
+
color5: bgIndex + 4,
|
|
42
|
+
color6: bgIndex + 5,
|
|
43
|
+
color7: bgIndex + 6,
|
|
44
|
+
color8: bgIndex + 7,
|
|
45
|
+
color9: bgIndex + 8,
|
|
46
|
+
color10: bgIndex + 9,
|
|
47
|
+
color11: bgIndex + 10,
|
|
48
|
+
color12: bgIndex + 11,
|
|
49
|
+
color0: -1,
|
|
50
|
+
color02: -2,
|
|
51
|
+
color04: -3,
|
|
52
|
+
color06: -4,
|
|
53
|
+
color08: -5,
|
|
54
|
+
// the background, color, etc keys here work like generics - they make it so you
|
|
55
|
+
// can publish components for others to use without mandating a specific color scale
|
|
56
|
+
// the @tamagui/button Button component looks for `$background`, so you set the
|
|
57
|
+
// dark_red_Button theme to have a stronger background than the dark_red theme.
|
|
58
|
+
background: bgIndex,
|
|
59
|
+
backgroundHover: bgIndex + lighten,
|
|
60
|
+
// always lighten on hover no matter the scheme
|
|
61
|
+
backgroundPress: bgIndex + darken,
|
|
62
|
+
// always darken on press no matter the theme
|
|
63
|
+
backgroundFocus: bgIndex + darken,
|
|
64
|
+
borderColor,
|
|
65
|
+
borderColorHover: borderColor + lighten,
|
|
66
|
+
borderColorPress: borderColor + darken,
|
|
67
|
+
borderColorFocus: borderColor,
|
|
68
|
+
...baseColors,
|
|
69
|
+
colorTransparent: -1
|
|
70
|
+
},
|
|
71
|
+
surface1 = {
|
|
72
|
+
...baseColors,
|
|
73
|
+
background: base.background + 2,
|
|
74
|
+
backgroundHover: base.backgroundHover + 2,
|
|
75
|
+
backgroundPress: base.backgroundPress + 2,
|
|
76
|
+
backgroundFocus: base.backgroundFocus + 2,
|
|
77
|
+
borderColor: base.borderColor + 2,
|
|
78
|
+
borderColorHover: base.borderColorHover + 2,
|
|
79
|
+
borderColorFocus: base.borderColorFocus + 2,
|
|
80
|
+
borderColorPress: base.borderColorPress + 2
|
|
81
|
+
},
|
|
82
|
+
surface2 = {
|
|
83
|
+
...baseColors,
|
|
84
|
+
background: base.background + 3,
|
|
85
|
+
backgroundHover: base.backgroundHover + 3,
|
|
86
|
+
backgroundPress: base.backgroundPress + 3,
|
|
87
|
+
backgroundFocus: base.backgroundFocus + 3,
|
|
88
|
+
borderColor: base.borderColor + 3,
|
|
89
|
+
borderColorHover: base.borderColorHover + 3,
|
|
90
|
+
borderColorFocus: base.borderColorFocus + 3,
|
|
91
|
+
borderColorPress: base.borderColorPress + 3
|
|
92
|
+
},
|
|
93
|
+
surface3 = {
|
|
94
|
+
...baseColors,
|
|
95
|
+
background: base.background + 4,
|
|
96
|
+
backgroundHover: base.backgroundHover + 4,
|
|
97
|
+
backgroundPress: base.backgroundPress + 4,
|
|
98
|
+
backgroundFocus: base.backgroundFocus + 4,
|
|
99
|
+
borderColor: base.borderColor + 4,
|
|
100
|
+
borderColorHover: base.borderColorHover + 4,
|
|
101
|
+
borderColorFocus: base.borderColorFocus + 4,
|
|
102
|
+
borderColorPress: base.borderColorPress + 4
|
|
103
|
+
},
|
|
104
|
+
alt1 = {
|
|
105
|
+
color: base.color - 1,
|
|
106
|
+
colorHover: base.colorHover - 1,
|
|
107
|
+
colorPress: base.colorPress - 1,
|
|
108
|
+
colorFocus: base.colorFocus - 1
|
|
109
|
+
},
|
|
110
|
+
alt2 = {
|
|
111
|
+
color: base.color - 2,
|
|
112
|
+
colorHover: base.colorHover - 2,
|
|
113
|
+
colorPress: base.colorPress - 2,
|
|
114
|
+
colorFocus: base.colorFocus - 2
|
|
115
|
+
},
|
|
116
|
+
inverse = Object.fromEntries(Object.entries(base).map(function (param) {
|
|
117
|
+
var [key, index] = param;
|
|
118
|
+
return [key, -index];
|
|
119
|
+
}));
|
|
120
|
+
return {
|
|
121
|
+
base,
|
|
122
|
+
surface1,
|
|
123
|
+
surface2,
|
|
124
|
+
surface3,
|
|
125
|
+
alt1,
|
|
126
|
+
alt2,
|
|
127
|
+
inverse
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
defaultTemplatesStronger = getTemplates();
|
|
131
|
+
export { defaultTemplatesStronger };
|
|
132
|
+
//# sourceMappingURL=defaultTemplatesStronger.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["objectFromEntries","objectKeys","getTemplates","lightTemplates","getBaseTemplates","darkTemplates","templates","map","name","scheme","isLight","bgIndex","lighten","darken","borderColor","baseColors","color","colorHover","colorPress","colorFocus","placeholderColor","outlineColor","base","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","borderColorHover","borderColorPress","borderColorFocus","colorTransparent","surface1","surface2","surface3","alt1","alt2","inverse","Object","fromEntries","entries","param","key","index"],"sources":["../../src/defaultTemplatesStronger.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,iBAAA,EAAmBC,UAAA,QAAkB;AAG9C,IAAAC,YAAM,YAAAA,CAAA,EAAqB;IACzB,IAAAC,cAAM,GAAAC,gBAAiB,QAAiB;MAAOC,aACzC,GAAAD,gBAAgB,OAAiB;MAAME,SAAA;QAa7C,GAAAN,iBAZkB,CAAAC,UAAA,CAAAE,cAAA,EAAAI,GAAA,WAAAC,IAAA;UAChB,OAAG,CACD,SAAWA,IAAA,IACTL,cAAW,CAAAK,IAAA,CAAS,CACtB;QACF;QACA,GAAGR,iBAAA,CAAAC,UAAA,CAAAI,aAAA,EAAAE,GAAA,WAAAC,IAAA;UACD,QACE,QAACA,IAAU,IACbH,aAAA,CAAAG,IAAA,EACF;QACF;MAEF,CAEM;IACJ,OAAMF,SAAU;EASG;EAAAF,gBACT,YAAAA,CAAAK,MAAA;IAAA,IACRC,OAAA,GAAYD,MAAC,KAAU;MAAAE,OAAA;MAAAC,OAAA,GAAAF,OAAA;MAAAG,MAAA,IAAAD,OAAA;MAAAE,WAAA,GAAAH,OAAA;MAAAI,UAAA;QACvBC,KAAA,GAAAL,OAAa;QACbM,UAAA,EAAY,CAACN,OAAA,GAAU;QACvBO,UAAA,GAAAP,OAAmB;QACnBQ,UAAA,GAAAR,OAAc;QAChBS,gBAIa,GAAAT,OAAA;QACXU,YAAA;MAAkB;MAClBC,IAAA;QAEAC,gBAAa;QACbC,WAAA,GAAc;QACdC,WAAA,GAAc;QACdC,YAAA,EAAc;QACdC,YAAA,EAAc;QACdC,YAAQ;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AyC,OAAA,GAAAC,MAAA,CAAAC,WAAA,CAAAD,MAAA,CAAAE,OAAA,CAAAzC,IAAA,EAAAf,GAAA,WAAAyD,KAAA;QAEA,KAAOC,GAAA,EAAAC,KAAA,IAAAF,KAAA;QACL,QACAC,GAAA,EACA,CAAAC,KAAA,CACA;MAAA,EACA;IAAA,OACA;MACA5C,IAAA;MACFiC,QAAA;MAGWC,QAAA","ignoreList":[]}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { objectFromEntries, objectKeys } from "./helpers";
|
|
2
|
+
const getTemplates = () => {
|
|
3
|
+
const lightTemplates = getBaseTemplates("light"), darkTemplates = getBaseTemplates("dark");
|
|
4
|
+
return {
|
|
5
|
+
...objectFromEntries(
|
|
6
|
+
objectKeys(lightTemplates).map(
|
|
7
|
+
(name) => [`light_${name}`, lightTemplates[name]]
|
|
8
|
+
)
|
|
9
|
+
),
|
|
10
|
+
...objectFromEntries(
|
|
11
|
+
objectKeys(darkTemplates).map(
|
|
12
|
+
(name) => [`dark_${name}`, darkTemplates[name]]
|
|
13
|
+
)
|
|
14
|
+
)
|
|
15
|
+
};
|
|
16
|
+
}, getBaseTemplates = (scheme) => {
|
|
17
|
+
const isLight = scheme === "light", bgIndex = 6, lighten = isLight ? -1 : 1, darken = -lighten, borderColor = bgIndex + 3, baseColors = {
|
|
18
|
+
color: -bgIndex,
|
|
19
|
+
colorHover: -bgIndex - 1,
|
|
20
|
+
colorPress: -bgIndex,
|
|
21
|
+
colorFocus: -bgIndex - 1,
|
|
22
|
+
placeholderColor: -bgIndex - 3,
|
|
23
|
+
outlineColor: -2
|
|
24
|
+
}, base = {
|
|
25
|
+
accentBackground: 0,
|
|
26
|
+
accentColor: -0,
|
|
27
|
+
background0: 1,
|
|
28
|
+
background02: 2,
|
|
29
|
+
background04: 3,
|
|
30
|
+
background06: 4,
|
|
31
|
+
background08: 5,
|
|
32
|
+
color1: bgIndex,
|
|
33
|
+
color2: bgIndex + 1,
|
|
34
|
+
color3: bgIndex + 2,
|
|
35
|
+
color4: bgIndex + 3,
|
|
36
|
+
color5: bgIndex + 4,
|
|
37
|
+
color6: bgIndex + 5,
|
|
38
|
+
color7: bgIndex + 6,
|
|
39
|
+
color8: bgIndex + 7,
|
|
40
|
+
color9: bgIndex + 8,
|
|
41
|
+
color10: bgIndex + 9,
|
|
42
|
+
color11: bgIndex + 10,
|
|
43
|
+
color12: bgIndex + 11,
|
|
44
|
+
color0: -1,
|
|
45
|
+
color02: -2,
|
|
46
|
+
color04: -3,
|
|
47
|
+
color06: -4,
|
|
48
|
+
color08: -5,
|
|
49
|
+
// the background, color, etc keys here work like generics - they make it so you
|
|
50
|
+
// can publish components for others to use without mandating a specific color scale
|
|
51
|
+
// the @tamagui/button Button component looks for `$background`, so you set the
|
|
52
|
+
// dark_red_Button theme to have a stronger background than the dark_red theme.
|
|
53
|
+
background: bgIndex,
|
|
54
|
+
backgroundHover: bgIndex + lighten,
|
|
55
|
+
// always lighten on hover no matter the scheme
|
|
56
|
+
backgroundPress: bgIndex + darken,
|
|
57
|
+
// always darken on press no matter the theme
|
|
58
|
+
backgroundFocus: bgIndex + darken,
|
|
59
|
+
borderColor,
|
|
60
|
+
borderColorHover: borderColor + lighten,
|
|
61
|
+
borderColorPress: borderColor + darken,
|
|
62
|
+
borderColorFocus: borderColor,
|
|
63
|
+
...baseColors,
|
|
64
|
+
colorTransparent: -1
|
|
65
|
+
}, surface1 = {
|
|
66
|
+
...baseColors,
|
|
67
|
+
background: base.background + 3,
|
|
68
|
+
backgroundHover: base.backgroundHover + 3,
|
|
69
|
+
backgroundPress: base.backgroundPress + 3,
|
|
70
|
+
backgroundFocus: base.backgroundFocus + 3,
|
|
71
|
+
borderColor: base.borderColor + 3,
|
|
72
|
+
borderColorHover: base.borderColorHover + 3,
|
|
73
|
+
borderColorFocus: base.borderColorFocus + 3,
|
|
74
|
+
borderColorPress: base.borderColorPress + 3
|
|
75
|
+
}, surface2 = {
|
|
76
|
+
...baseColors,
|
|
77
|
+
background: base.background + 4,
|
|
78
|
+
backgroundHover: base.backgroundHover + 4,
|
|
79
|
+
backgroundPress: base.backgroundPress + 4,
|
|
80
|
+
backgroundFocus: base.backgroundFocus + 4,
|
|
81
|
+
borderColor: base.borderColor + 4,
|
|
82
|
+
borderColorHover: base.borderColorHover + 4,
|
|
83
|
+
borderColorFocus: base.borderColorFocus + 4,
|
|
84
|
+
borderColorPress: base.borderColorPress + 4
|
|
85
|
+
}, surface3 = {
|
|
86
|
+
...baseColors,
|
|
87
|
+
background: base.background + 5,
|
|
88
|
+
backgroundHover: base.backgroundHover + 5,
|
|
89
|
+
backgroundPress: base.backgroundPress + 5,
|
|
90
|
+
backgroundFocus: base.backgroundFocus + 5,
|
|
91
|
+
borderColor: base.borderColor + 5,
|
|
92
|
+
borderColorHover: base.borderColorHover + 5,
|
|
93
|
+
borderColorFocus: base.borderColorFocus + 5,
|
|
94
|
+
borderColorPress: base.borderColorPress + 5
|
|
95
|
+
}, alt1 = {
|
|
96
|
+
color: base.color - 1,
|
|
97
|
+
colorHover: base.colorHover - 1,
|
|
98
|
+
colorPress: base.colorPress - 1,
|
|
99
|
+
colorFocus: base.colorFocus - 1
|
|
100
|
+
}, alt2 = {
|
|
101
|
+
color: base.color - 2,
|
|
102
|
+
colorHover: base.colorHover - 2,
|
|
103
|
+
colorPress: base.colorPress - 2,
|
|
104
|
+
colorFocus: base.colorFocus - 2
|
|
105
|
+
}, inverse = Object.fromEntries(
|
|
106
|
+
Object.entries(base).map(([key, index]) => [key, -index])
|
|
107
|
+
);
|
|
108
|
+
return {
|
|
109
|
+
base,
|
|
110
|
+
surface1,
|
|
111
|
+
surface2,
|
|
112
|
+
surface3,
|
|
113
|
+
alt1,
|
|
114
|
+
alt2,
|
|
115
|
+
inverse
|
|
116
|
+
};
|
|
117
|
+
}, defaultTemplatesStrongest = getTemplates();
|
|
118
|
+
export {
|
|
119
|
+
defaultTemplatesStrongest
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL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a,KAAK,cAAc;AAAA,IAChC,kBAAkB,KAAK,mBAAmB;AAAA,IAC1C,kBAAkB,KAAK,mBAAmB;AAAA,IAC1C,kBAAkB,KAAK,mBAAmB;AAAA,EAC5C,GAEM,OAAO;AAAA,IACX,OAAO,KAAK,QAAQ;AAAA,IACpB,YAAY,KAAK,aAAa;AAAA,IAC9B,YAAY,KAAK,aAAa;AAAA,IAC9B,YAAY,KAAK,aAAa;AAAA,EAChC,GAEM,OAAO;AAAA,IACX,OAAO,KAAK,QAAQ;AAAA,IACpB,YAAY,KAAK,aAAa;AAAA,IAC9B,YAAY,KAAK,aAAa;AAAA,IAC9B,YAAY,KAAK,aAAa;AAAA,EAChC,GAEM,UAAU,OAAO;AAAA,IACrB,OAAO,QAAQ,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAC5B,CAAC,KAAK,CAAC,KAAK,CACpB;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF,GAEa,4BAA4B,aAAa;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { objectFromEntries, objectKeys } from "./helpers.mjs";
|
|
2
|
+
const getTemplates = () => {
|
|
3
|
+
const lightTemplates = getBaseTemplates("light"),
|
|
4
|
+
darkTemplates = getBaseTemplates("dark");
|
|
5
|
+
return {
|
|
6
|
+
...objectFromEntries(objectKeys(lightTemplates).map(name => [`light_${name}`, lightTemplates[name]])),
|
|
7
|
+
...objectFromEntries(objectKeys(darkTemplates).map(name => [`dark_${name}`, darkTemplates[name]]))
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
getBaseTemplates = scheme => {
|
|
11
|
+
const isLight = scheme === "light",
|
|
12
|
+
bgIndex = 6,
|
|
13
|
+
lighten = isLight ? -1 : 1,
|
|
14
|
+
darken = -lighten,
|
|
15
|
+
borderColor = bgIndex + 3,
|
|
16
|
+
baseColors = {
|
|
17
|
+
color: -bgIndex,
|
|
18
|
+
colorHover: -bgIndex - 1,
|
|
19
|
+
colorPress: -bgIndex,
|
|
20
|
+
colorFocus: -bgIndex - 1,
|
|
21
|
+
placeholderColor: -bgIndex - 3,
|
|
22
|
+
outlineColor: -2
|
|
23
|
+
},
|
|
24
|
+
base = {
|
|
25
|
+
accentBackground: 0,
|
|
26
|
+
accentColor: -0,
|
|
27
|
+
background0: 1,
|
|
28
|
+
background02: 2,
|
|
29
|
+
background04: 3,
|
|
30
|
+
background06: 4,
|
|
31
|
+
background08: 5,
|
|
32
|
+
color1: bgIndex,
|
|
33
|
+
color2: bgIndex + 1,
|
|
34
|
+
color3: bgIndex + 2,
|
|
35
|
+
color4: bgIndex + 3,
|
|
36
|
+
color5: bgIndex + 4,
|
|
37
|
+
color6: bgIndex + 5,
|
|
38
|
+
color7: bgIndex + 6,
|
|
39
|
+
color8: bgIndex + 7,
|
|
40
|
+
color9: bgIndex + 8,
|
|
41
|
+
color10: bgIndex + 9,
|
|
42
|
+
color11: bgIndex + 10,
|
|
43
|
+
color12: bgIndex + 11,
|
|
44
|
+
color0: -1,
|
|
45
|
+
color02: -2,
|
|
46
|
+
color04: -3,
|
|
47
|
+
color06: -4,
|
|
48
|
+
color08: -5,
|
|
49
|
+
// the background, color, etc keys here work like generics - they make it so you
|
|
50
|
+
// can publish components for others to use without mandating a specific color scale
|
|
51
|
+
// the @tamagui/button Button component looks for `$background`, so you set the
|
|
52
|
+
// dark_red_Button theme to have a stronger background than the dark_red theme.
|
|
53
|
+
background: bgIndex,
|
|
54
|
+
backgroundHover: bgIndex + lighten,
|
|
55
|
+
// always lighten on hover no matter the scheme
|
|
56
|
+
backgroundPress: bgIndex + darken,
|
|
57
|
+
// always darken on press no matter the theme
|
|
58
|
+
backgroundFocus: bgIndex + darken,
|
|
59
|
+
borderColor,
|
|
60
|
+
borderColorHover: borderColor + lighten,
|
|
61
|
+
borderColorPress: borderColor + darken,
|
|
62
|
+
borderColorFocus: borderColor,
|
|
63
|
+
...baseColors,
|
|
64
|
+
colorTransparent: -1
|
|
65
|
+
},
|
|
66
|
+
surface1 = {
|
|
67
|
+
...baseColors,
|
|
68
|
+
background: base.background + 3,
|
|
69
|
+
backgroundHover: base.backgroundHover + 3,
|
|
70
|
+
backgroundPress: base.backgroundPress + 3,
|
|
71
|
+
backgroundFocus: base.backgroundFocus + 3,
|
|
72
|
+
borderColor: base.borderColor + 3,
|
|
73
|
+
borderColorHover: base.borderColorHover + 3,
|
|
74
|
+
borderColorFocus: base.borderColorFocus + 3,
|
|
75
|
+
borderColorPress: base.borderColorPress + 3
|
|
76
|
+
},
|
|
77
|
+
surface2 = {
|
|
78
|
+
...baseColors,
|
|
79
|
+
background: base.background + 4,
|
|
80
|
+
backgroundHover: base.backgroundHover + 4,
|
|
81
|
+
backgroundPress: base.backgroundPress + 4,
|
|
82
|
+
backgroundFocus: base.backgroundFocus + 4,
|
|
83
|
+
borderColor: base.borderColor + 4,
|
|
84
|
+
borderColorHover: base.borderColorHover + 4,
|
|
85
|
+
borderColorFocus: base.borderColorFocus + 4,
|
|
86
|
+
borderColorPress: base.borderColorPress + 4
|
|
87
|
+
},
|
|
88
|
+
surface3 = {
|
|
89
|
+
...baseColors,
|
|
90
|
+
background: base.background + 5,
|
|
91
|
+
backgroundHover: base.backgroundHover + 5,
|
|
92
|
+
backgroundPress: base.backgroundPress + 5,
|
|
93
|
+
backgroundFocus: base.backgroundFocus + 5,
|
|
94
|
+
borderColor: base.borderColor + 5,
|
|
95
|
+
borderColorHover: base.borderColorHover + 5,
|
|
96
|
+
borderColorFocus: base.borderColorFocus + 5,
|
|
97
|
+
borderColorPress: base.borderColorPress + 5
|
|
98
|
+
},
|
|
99
|
+
alt1 = {
|
|
100
|
+
color: base.color - 1,
|
|
101
|
+
colorHover: base.colorHover - 1,
|
|
102
|
+
colorPress: base.colorPress - 1,
|
|
103
|
+
colorFocus: base.colorFocus - 1
|
|
104
|
+
},
|
|
105
|
+
alt2 = {
|
|
106
|
+
color: base.color - 2,
|
|
107
|
+
colorHover: base.colorHover - 2,
|
|
108
|
+
colorPress: base.colorPress - 2,
|
|
109
|
+
colorFocus: base.colorFocus - 2
|
|
110
|
+
},
|
|
111
|
+
inverse = Object.fromEntries(Object.entries(base).map(([key, index]) => [key, -index]));
|
|
112
|
+
return {
|
|
113
|
+
base,
|
|
114
|
+
surface1,
|
|
115
|
+
surface2,
|
|
116
|
+
surface3,
|
|
117
|
+
alt1,
|
|
118
|
+
alt2,
|
|
119
|
+
inverse
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
defaultTemplatesStrongest = getTemplates();
|
|
123
|
+
export { defaultTemplatesStrongest };
|
|
124
|
+
//# sourceMappingURL=defaultTemplatesStrongest.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["objectFromEntries","objectKeys","getTemplates","lightTemplates","getBaseTemplates","darkTemplates","map","name","scheme","isLight","bgIndex","lighten","darken","borderColor","baseColors","color","colorHover","colorPress","colorFocus","placeholderColor","outlineColor","base","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","borderColorHover","borderColorPress","borderColorFocus","colorTransparent","surface1","surface2","surface3","alt1","alt2","inverse","Object","fromEntries","entries","key","index","defaultTemplatesStrongest"],"sources":["../../src/defaultTemplatesStrongest.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,iBAAA,EAAmBC,UAAA,QAAkB;AAG9C,MAAMC,YAAA,GAAeA,CAAA,KAAM;IACzB,MAAMC,cAAA,GAAiBC,gBAAA,CAAiB,OAAO;MACzCC,aAAA,GAAgBD,gBAAA,CAAiB,MAAM;IAa7C,OAZkB;MAChB,GAAGJ,iBAAA,CACDC,UAAA,CAAWE,cAAc,EAAEG,GAAA,CACxBC,IAAA,IAAS,CAAC,SA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AC,IAAA;MACAC,IAAA;MACAC;IACF;EACF;EAEaM,yBAAA,GAA4B/D,YAAA,CAAa","ignoreList":[]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { objectFromEntries, objectKeys } from "./helpers.native.js";
|
|
2
|
+
var getTemplates = function () {
|
|
3
|
+
var lightTemplates = getBaseTemplates("light"),
|
|
4
|
+
darkTemplates = getBaseTemplates("dark"),
|
|
5
|
+
templates = {
|
|
6
|
+
...objectFromEntries(objectKeys(lightTemplates).map(function (name) {
|
|
7
|
+
return [`light_${name}`, lightTemplates[name]];
|
|
8
|
+
})),
|
|
9
|
+
...objectFromEntries(objectKeys(darkTemplates).map(function (name) {
|
|
10
|
+
return [`dark_${name}`, darkTemplates[name]];
|
|
11
|
+
}))
|
|
12
|
+
};
|
|
13
|
+
return templates;
|
|
14
|
+
},
|
|
15
|
+
getBaseTemplates = function (scheme) {
|
|
16
|
+
var isLight = scheme === "light",
|
|
17
|
+
bgIndex = 6,
|
|
18
|
+
lighten = isLight ? -1 : 1,
|
|
19
|
+
darken = -lighten,
|
|
20
|
+
borderColor = bgIndex + 3,
|
|
21
|
+
baseColors = {
|
|
22
|
+
color: -bgIndex,
|
|
23
|
+
colorHover: -bgIndex - 1,
|
|
24
|
+
colorPress: -bgIndex,
|
|
25
|
+
colorFocus: -bgIndex - 1,
|
|
26
|
+
placeholderColor: -bgIndex - 3,
|
|
27
|
+
outlineColor: -2
|
|
28
|
+
},
|
|
29
|
+
base = {
|
|
30
|
+
accentBackground: 0,
|
|
31
|
+
accentColor: -0,
|
|
32
|
+
background0: 1,
|
|
33
|
+
background02: 2,
|
|
34
|
+
background04: 3,
|
|
35
|
+
background06: 4,
|
|
36
|
+
background08: 5,
|
|
37
|
+
color1: bgIndex,
|
|
38
|
+
color2: bgIndex + 1,
|
|
39
|
+
color3: bgIndex + 2,
|
|
40
|
+
color4: bgIndex + 3,
|
|
41
|
+
color5: bgIndex + 4,
|
|
42
|
+
color6: bgIndex + 5,
|
|
43
|
+
color7: bgIndex + 6,
|
|
44
|
+
color8: bgIndex + 7,
|
|
45
|
+
color9: bgIndex + 8,
|
|
46
|
+
color10: bgIndex + 9,
|
|
47
|
+
color11: bgIndex + 10,
|
|
48
|
+
color12: bgIndex + 11,
|
|
49
|
+
color0: -1,
|
|
50
|
+
color02: -2,
|
|
51
|
+
color04: -3,
|
|
52
|
+
color06: -4,
|
|
53
|
+
color08: -5,
|
|
54
|
+
// the background, color, etc keys here work like generics - they make it so you
|
|
55
|
+
// can publish components for others to use without mandating a specific color scale
|
|
56
|
+
// the @tamagui/button Button component looks for `$background`, so you set the
|
|
57
|
+
// dark_red_Button theme to have a stronger background than the dark_red theme.
|
|
58
|
+
background: bgIndex,
|
|
59
|
+
backgroundHover: bgIndex + lighten,
|
|
60
|
+
// always lighten on hover no matter the scheme
|
|
61
|
+
backgroundPress: bgIndex + darken,
|
|
62
|
+
// always darken on press no matter the theme
|
|
63
|
+
backgroundFocus: bgIndex + darken,
|
|
64
|
+
borderColor,
|
|
65
|
+
borderColorHover: borderColor + lighten,
|
|
66
|
+
borderColorPress: borderColor + darken,
|
|
67
|
+
borderColorFocus: borderColor,
|
|
68
|
+
...baseColors,
|
|
69
|
+
colorTransparent: -1
|
|
70
|
+
},
|
|
71
|
+
surface1 = {
|
|
72
|
+
...baseColors,
|
|
73
|
+
background: base.background + 3,
|
|
74
|
+
backgroundHover: base.backgroundHover + 3,
|
|
75
|
+
backgroundPress: base.backgroundPress + 3,
|
|
76
|
+
backgroundFocus: base.backgroundFocus + 3,
|
|
77
|
+
borderColor: base.borderColor + 3,
|
|
78
|
+
borderColorHover: base.borderColorHover + 3,
|
|
79
|
+
borderColorFocus: base.borderColorFocus + 3,
|
|
80
|
+
borderColorPress: base.borderColorPress + 3
|
|
81
|
+
},
|
|
82
|
+
surface2 = {
|
|
83
|
+
...baseColors,
|
|
84
|
+
background: base.background + 4,
|
|
85
|
+
backgroundHover: base.backgroundHover + 4,
|
|
86
|
+
backgroundPress: base.backgroundPress + 4,
|
|
87
|
+
backgroundFocus: base.backgroundFocus + 4,
|
|
88
|
+
borderColor: base.borderColor + 4,
|
|
89
|
+
borderColorHover: base.borderColorHover + 4,
|
|
90
|
+
borderColorFocus: base.borderColorFocus + 4,
|
|
91
|
+
borderColorPress: base.borderColorPress + 4
|
|
92
|
+
},
|
|
93
|
+
surface3 = {
|
|
94
|
+
...baseColors,
|
|
95
|
+
background: base.background + 5,
|
|
96
|
+
backgroundHover: base.backgroundHover + 5,
|
|
97
|
+
backgroundPress: base.backgroundPress + 5,
|
|
98
|
+
backgroundFocus: base.backgroundFocus + 5,
|
|
99
|
+
borderColor: base.borderColor + 5,
|
|
100
|
+
borderColorHover: base.borderColorHover + 5,
|
|
101
|
+
borderColorFocus: base.borderColorFocus + 5,
|
|
102
|
+
borderColorPress: base.borderColorPress + 5
|
|
103
|
+
},
|
|
104
|
+
alt1 = {
|
|
105
|
+
color: base.color - 1,
|
|
106
|
+
colorHover: base.colorHover - 1,
|
|
107
|
+
colorPress: base.colorPress - 1,
|
|
108
|
+
colorFocus: base.colorFocus - 1
|
|
109
|
+
},
|
|
110
|
+
alt2 = {
|
|
111
|
+
color: base.color - 2,
|
|
112
|
+
colorHover: base.colorHover - 2,
|
|
113
|
+
colorPress: base.colorPress - 2,
|
|
114
|
+
colorFocus: base.colorFocus - 2
|
|
115
|
+
},
|
|
116
|
+
inverse = Object.fromEntries(Object.entries(base).map(function (param) {
|
|
117
|
+
var [key, index] = param;
|
|
118
|
+
return [key, -index];
|
|
119
|
+
}));
|
|
120
|
+
return {
|
|
121
|
+
base,
|
|
122
|
+
surface1,
|
|
123
|
+
surface2,
|
|
124
|
+
surface3,
|
|
125
|
+
alt1,
|
|
126
|
+
alt2,
|
|
127
|
+
inverse
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
defaultTemplatesStrongest = getTemplates();
|
|
131
|
+
export { defaultTemplatesStrongest };
|
|
132
|
+
//# sourceMappingURL=defaultTemplatesStrongest.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["objectFromEntries","objectKeys","getTemplates","lightTemplates","getBaseTemplates","darkTemplates","templates","map","name","scheme","isLight","bgIndex","lighten","darken","borderColor","baseColors","color","colorHover","colorPress","colorFocus","placeholderColor","outlineColor","base","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","borderColorHover","borderColorPress","borderColorFocus","colorTransparent","surface1","surface2","surface3","alt1","alt2","inverse","Object","fromEntries","entries","param","key","index"],"sources":["../../src/defaultTemplatesStrongest.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,iBAAA,EAAmBC,UAAA,QAAkB;AAG9C,IAAAC,YAAM,YAAAA,CAAA,EAAqB;IACzB,IAAAC,cAAM,GAAAC,gBAAiB,QAAiB;MAAOC,aACzC,GAAAD,gBAAgB,OAAiB;MAAME,SAAA;QAa7C,GAAAN,iBAZkB,CAAAC,UAAA,CAAAE,cAAA,EAAAI,GAAA,WAAAC,IAAA;UAChB,OAAG,CACD,SAAWA,IAAA,IACTL,cAAW,CAAAK,IAAA,CAAS,CACtB;QACF;QACA,GAAGR,iBAAA,CAAAC,UAAA,CAAAI,aAAA,EAAAE,GAAA,WAAAC,IAAA;UACD,QACE,QAACA,IAAU,IACbH,aAAA,CAAAG,IAAA,EACF;QACF;MAEF,CAEM;IACJ,OAAMF,SAAU;EASG;EAAAF,gBACT,YAAAA,CAAAK,MAAA;IAAA,IACRC,OAAA,GAAYD,MAAC,KAAU;MAAAE,OAAA;MAAAC,OAAA,GAAAF,OAAA;MAAAG,MAAA,IAAAD,OAAA;MAAAE,WAAA,GAAAH,OAAA;MAAAI,UAAA;QACvBC,KAAA,GAAAL,OAAa;QACbM,UAAA,EAAY,CAACN,OAAA,GAAU;QACvBO,UAAA,GAAAP,OAAmB;QACnBQ,UAAA,GAAAR,OAAc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AM,IAAA,CAAYN,KAAK;QACjBC,UAAA,EAAYK,IAAA,CAAKL,UAAA,GAAa;QAChCC,UAEM,EAAUI,IAAA,CAAAJ,UAAO;QACrBC,UAAO,EAAAG,IAAQ,CAAAH,UAAY;MAG7B;MAAAyC,OAAA,GAAAC,MAAA,CAAAC,WAAA,CAAAD,MAAA,CAAAE,OAAA,CAAAzC,IAAA,EAAAf,GAAA,WAAAyD,KAAA;QAEA,KAAOC,GAAA,EAAAC,KAAA,IAAAF,KAAA;QACL,QACAC,GAAA,EACA,CAAAC,KAAA,CACA;MAAA,EACA;IAAA,OACA;MACA5C,IAAA;MACFiC,QAAA;MAGWC,QAAA","ignoreList":[]}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "AAAA,cAAc;AACd,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,
|
|
4
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AAEd,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAEP,SAAS,wBAAwB;AACjC,SAAS,8BAA8B;AAEvC,SAAS,2BAA2B,6BAA6B;AAGjE,SAAS,aAAa;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./ThemeBuilder.mjs";
|
|
2
2
|
export * from "@tamagui/create-theme";
|
|
3
|
-
import { createStudioThemes
|
|
3
|
+
import { createStudioThemes } from "./createStudioThemes.mjs";
|
|
4
|
+
import { createThemes, createPalettes } from "./createThemes.mjs";
|
|
4
5
|
import { defaultTemplates } from "./defaultTemplates.mjs";
|
|
5
6
|
import { defaultComponentThemes } from "./defaultComponentThemes.mjs";
|
|
6
7
|
import { PALETTE_BACKGROUND_OFFSET, getThemeSuitePalettes } from "./getThemeSuitePalettes.mjs";
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createStudioThemes","createThemes","createPalettes","defaultTemplates","defaultComponentThemes","PALETTE_BACKGROUND_OFFSET","getThemeSuitePalettes","masks"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AAEd,
|
|
1
|
+
{"version":3,"names":["createStudioThemes","createThemes","createPalettes","defaultTemplates","defaultComponentThemes","PALETTE_BACKGROUND_OFFSET","getThemeSuitePalettes","masks"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AAEd,SAASA,kBAAA,QAA0B;AACnC,SACEC,YAAA,EACAC,cAAA,QAEK;AAEP,SAASC,gBAAA,QAAwB;AACjC,SAASC,sBAAA,QAA8B;AAEvC,SAASC,yBAAA,EAA2BC,qBAAA,QAA6B;AAGjE,SAASC,KAAA,QAAa","ignoreList":[]}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./ThemeBuilder.native.js";
|
|
2
2
|
export * from "@tamagui/create-theme";
|
|
3
|
-
import { createStudioThemes
|
|
3
|
+
import { createStudioThemes } from "./createStudioThemes.native.js";
|
|
4
|
+
import { createThemes, createPalettes } from "./createThemes.native.js";
|
|
4
5
|
import { defaultTemplates } from "./defaultTemplates.native.js";
|
|
5
6
|
import { defaultComponentThemes } from "./defaultComponentThemes.native.js";
|
|
6
7
|
import { PALETTE_BACKGROUND_OFFSET, getThemeSuitePalettes } from "./getThemeSuitePalettes.native.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createStudioThemes","createThemes","createPalettes","defaultTemplates","defaultComponentThemes","PALETTE_BACKGROUND_OFFSET","getThemeSuitePalettes","masks"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AAEd,
|
|
1
|
+
{"version":3,"names":["createStudioThemes","createThemes","createPalettes","defaultTemplates","defaultComponentThemes","PALETTE_BACKGROUND_OFFSET","getThemeSuitePalettes","masks"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AAEd,SAASA,kBAAA,QAA0B;AACnC,SAAAC,YAAA,EAAAC,cAAA;AAAA,SACEC,gBAAA;AAAA,SACAC,sBAAA;AAAA,SAEKC,yBAAA,EAAAC,qBAAA;AAEP,SAASC,KAAA;AACT,SAEAF,yBAAS,EAGTH,cAAS,E","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/theme-builder",
|
|
3
|
-
"version": "1.125.
|
|
3
|
+
"version": "1.125.11",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@tamagui/create-theme": "1.125.
|
|
35
|
+
"@tamagui/create-theme": "1.125.11",
|
|
36
36
|
"color2k": "^2.0.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@tamagui/build": "1.125.
|
|
39
|
+
"@tamagui/build": "1.125.11"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createPalettes, createSimpleThemeBuilder } from './createThemes'
|
|
2
|
+
import { defaultComponentThemes } from './defaultComponentThemes'
|
|
3
|
+
import { defaultTemplates } from './defaultTemplates'
|
|
4
|
+
import { defaultTemplatesStronger } from './defaultTemplatesStronger'
|
|
5
|
+
import { defaultTemplatesStrongest } from './defaultTemplatesStrongest'
|
|
6
|
+
import type { BuildThemeSuiteProps } from './types'
|
|
7
|
+
|
|
8
|
+
// for studio
|
|
9
|
+
// allows more detailed configuration, used by studio
|
|
10
|
+
// eventually we should merge this down into simple and have it handle what we need
|
|
11
|
+
|
|
12
|
+
export function createStudioThemes(props: BuildThemeSuiteProps) {
|
|
13
|
+
const palettes = createPalettes(props.palettes)
|
|
14
|
+
|
|
15
|
+
const templates =
|
|
16
|
+
props.templateStrategy === 'stronger'
|
|
17
|
+
? defaultTemplatesStronger
|
|
18
|
+
: props.templateStrategy === 'strongest'
|
|
19
|
+
? defaultTemplatesStrongest
|
|
20
|
+
: defaultTemplates
|
|
21
|
+
|
|
22
|
+
return createSimpleThemeBuilder({
|
|
23
|
+
palettes,
|
|
24
|
+
templates,
|
|
25
|
+
componentThemes: defaultComponentThemes,
|
|
26
|
+
accentTheme: !!props.palettes.accent,
|
|
27
|
+
})
|
|
28
|
+
}
|