@tamagui/core 1.5.12 → 1.5.14
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/config.js +2 -2
- package/dist/cjs/config.js.map +2 -2
- package/dist/cjs/createComponent.js +1 -1
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createFont.web.test.js +125 -0
- package/dist/cjs/createFont.web.test.js.map +7 -0
- package/dist/cjs/createTamagui.js +1 -3
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTokens.web.test.js +28 -0
- package/dist/cjs/createTokens.web.test.js.map +7 -0
- package/dist/cjs/createVariable.js.map +1 -1
- package/dist/cjs/createVariable.web.test.js +7 -0
- package/dist/cjs/createVariable.web.test.js.map +7 -0
- package/dist/cjs/helpers/ThemeManager.test.js +465 -0
- package/dist/cjs/helpers/ThemeManager.test.js.map +7 -0
- package/dist/cjs/helpers/expandStyles.js +12 -2
- package/dist/cjs/helpers/expandStyles.js.map +3 -3
- package/dist/cjs/helpers/getSplitStyles.js +15 -20
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js +5 -8
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +2 -2
- package/dist/cjs/helpers/normalizeColor.js +5 -5
- package/dist/cjs/helpers/normalizeColor.js.map +3 -3
- package/dist/cjs/helpers/useShallowSetState.js +14 -15
- package/dist/cjs/helpers/useShallowSetState.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +12 -13
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/hooks/useTheme.js +21 -17
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/setupReactNative.js +8 -9
- package/dist/cjs/setupReactNative.js.map +2 -2
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Stack.web.test.js +22 -0
- package/dist/cjs/views/Stack.web.test.js.map +7 -0
- package/dist/esm/config.js +2 -2
- package/dist/esm/config.js.map +2 -2
- package/dist/esm/config.mjs +2 -2
- package/dist/esm/config.mjs.map +2 -2
- package/dist/esm/createComponent.js +1 -1
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createComponent.mjs +1 -1
- package/dist/esm/createComponent.mjs.map +2 -2
- package/dist/esm/createFont.web.test.js +124 -0
- package/dist/esm/createFont.web.test.js.map +7 -0
- package/dist/esm/createFont.web.test.mjs +124 -0
- package/dist/esm/createFont.web.test.mjs.map +7 -0
- package/dist/esm/createTamagui.js +1 -3
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createTamagui.mjs +1 -3
- package/dist/esm/createTamagui.mjs.map +2 -2
- package/dist/esm/createTokens.web.test.js +27 -0
- package/dist/esm/createTokens.web.test.js.map +7 -0
- package/dist/esm/createTokens.web.test.mjs +27 -0
- package/dist/esm/createTokens.web.test.mjs.map +7 -0
- package/dist/esm/createVariable.js.map +1 -1
- package/dist/esm/createVariable.mjs.map +1 -1
- package/dist/esm/createVariable.web.test.js +6 -0
- package/dist/esm/createVariable.web.test.js.map +7 -0
- package/dist/esm/createVariable.web.test.mjs +6 -0
- package/dist/esm/createVariable.web.test.mjs.map +7 -0
- package/dist/esm/helpers/ThemeManager.test.js +464 -0
- package/dist/esm/helpers/ThemeManager.test.js.map +7 -0
- package/dist/esm/helpers/ThemeManager.test.mjs +464 -0
- package/dist/esm/helpers/ThemeManager.test.mjs.map +7 -0
- package/dist/esm/helpers/expandStyles.js +1 -1
- package/dist/esm/helpers/expandStyles.js.map +2 -2
- package/dist/esm/helpers/expandStyles.mjs +1 -1
- package/dist/esm/helpers/expandStyles.mjs.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +15 -20
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.mjs +15 -20
- package/dist/esm/helpers/getSplitStyles.mjs.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.native.js +4 -6
- package/dist/esm/helpers/getStylesAtomic.native.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.native.mjs +4 -6
- package/dist/esm/helpers/getStylesAtomic.native.mjs.map +2 -2
- package/dist/esm/helpers/normalizeColor.js +4 -4
- package/dist/esm/helpers/normalizeColor.js.map +3 -3
- package/dist/esm/helpers/normalizeColor.mjs +4 -4
- package/dist/esm/helpers/normalizeColor.mjs.map +3 -3
- package/dist/esm/helpers/useShallowSetState.js +14 -15
- package/dist/esm/helpers/useShallowSetState.js.map +2 -2
- package/dist/esm/helpers/useShallowSetState.mjs +14 -15
- package/dist/esm/helpers/useShallowSetState.mjs.map +2 -2
- package/dist/esm/hooks/useMedia.js +12 -13
- package/dist/esm/hooks/useMedia.js.map +2 -2
- package/dist/esm/hooks/useMedia.mjs +12 -13
- package/dist/esm/hooks/useMedia.mjs.map +2 -2
- package/dist/esm/hooks/useTheme.js +21 -17
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/hooks/useTheme.mjs +21 -17
- package/dist/esm/hooks/useTheme.mjs.map +2 -2
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/index.mjs.map +2 -2
- package/dist/esm/setupReactNative.js +8 -9
- package/dist/esm/setupReactNative.js.map +2 -2
- package/dist/esm/setupReactNative.mjs +8 -9
- package/dist/esm/setupReactNative.mjs.map +2 -2
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/styled.mjs.map +2 -2
- package/dist/esm/views/Stack.web.test.js +21 -0
- package/dist/esm/views/Stack.web.test.js.map +7 -0
- package/dist/esm/views/Stack.web.test.mjs +21 -0
- package/dist/esm/views/Stack.web.test.mjs.map +7 -0
- package/package.json +5 -5
- package/src/index.ts +0 -1
- package/types/config.d.ts.map +1 -1
- package/types/createFont.web.test.d.ts.map +1 -0
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createTokens.web.test.d.ts.map +1 -0
- package/types/createVariable.d.ts.map +1 -1
- package/types/createVariable.web.test.d.ts.map +1 -0
- package/types/helpers/ThemeManager.test.d.ts.map +1 -0
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.native.d.ts.map +1 -1
- package/types/helpers/normalizeColor.d.ts.map +1 -1
- package/types/helpers/useShallowSetState.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/setupReactNative.d.ts.map +1 -1
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts.map +1 -1
- package/types/views/Stack.web.test.d.ts.map +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createVariable.ts"],
|
|
4
|
-
"sourcesContent": ["import { isWeb } from '@tamagui/constants'\nimport { simpleHash } from '@tamagui/helpers'\n\nimport { getConfig } from './config'\n\n/**\n * Should rename this to Token\n * Moving to objects for React Server Components support\n */\n\nconst IS_VAR = 'isVar'\n\nexport interface Variable<A = any> {\n [IS_VAR]?: true\n variable?: string\n val: A\n name: string\n key: string\n}\n\nexport type MakeVariable<A = any> = A extends string | number ? Variable<A> : A\n\ntype VariableIn<A = any> = Pick<Variable<A>, 'key' | 'name' | 'val'>\nexport const createVariable = <A extends string | number
|
|
4
|
+
"sourcesContent": ["import { isWeb } from '@tamagui/constants'\nimport { simpleHash } from '@tamagui/helpers'\n\nimport { getConfig } from './config'\n\n/**\n * Should rename this to Token\n * Moving to objects for React Server Components support\n */\n\nconst IS_VAR = 'isVar'\n\nexport interface Variable<A = any> {\n [IS_VAR]?: true\n variable?: string\n val: A\n name: string\n key: string\n}\n\nexport type MakeVariable<A = any> = A extends string | number ? Variable<A> : A\n\ntype VariableIn<A = any> = Pick<Variable<A>, 'key' | 'name' | 'val'>\nexport const createVariable = <A extends string | number = any>(\n props: VariableIn<A>\n): Variable<A> => {\n if (isVariable(props)) return props\n const { key, name, val } = props\n return {\n [IS_VAR]: true,\n key: key!,\n name: simpleHash(name, 40),\n val: val as any,\n variable: isWeb ? createCSSVariable(name) : '',\n }\n}\n\n// could do weakmap cache\nexport function variableToString(vrble?: any, getValue = false) {\n if (isVariable(vrble)) {\n if (!getValue && isWeb && vrble.variable) {\n return vrble.variable\n }\n return `${vrble.val}`\n }\n return `${vrble || ''}`\n}\n\nexport function isVariable(v: Variable | any): v is Variable {\n return v && typeof v === 'object' && IS_VAR in v\n}\n\nexport function getVariable(nameOrVariable: Variable | string) {\n setDidGetVariableValue(true)\n if (isVariable(nameOrVariable)) {\n return variableToString(nameOrVariable)\n }\n const tokens = getConfig().tokensParsed\n return variableToString(tokens[nameOrVariable] ?? nameOrVariable)\n}\n\nlet accessed = false\nexport const setDidGetVariableValue = (val: boolean) => (accessed = val)\nexport const didGetVariableValue = () => accessed\n\nexport function getVariableValue(v: Variable | any) {\n if (isVariable(v)) {\n setDidGetVariableValue(true)\n return v.val\n }\n return v\n}\n\nexport function getVariableName(v: Variable | any) {\n if (isVariable(v)) return v.name\n return v\n}\n\nexport function getVariableVariable(v: Variable | any) {\n if (isVariable(v)) return v.variable\n return v\n}\n\n// bugfix { space: { 0.5: 10 } } was generating var(--space-0.5) (invalid CSS):\nexport const createCSSVariable = (nameProp: string, includeVar = true) => {\n if (process.env.NODE_ENV === 'development') {\n if (!nameProp || typeof nameProp !== 'string') {\n throw new Error(`createCSSVariable expected string: ${nameProp}`)\n }\n }\n const name = simpleHash(nameProp, 60)\n return includeVar ? `var(--${name})` : name\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB;AACtB,qBAA2B;AAE3B,oBAA0B;AAO1B,MAAM,SAAS;AAaR,MAAM,iBAAiB,CAC5B,UACgB;AAChB,MAAI,WAAW,KAAK;AAAG,WAAO;AAC9B,QAAM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,IAClE;AAAA,EACF;AACA,QAAM,WAAO,2BAAW,UAAU,EAAE;AACpC,SAAO,aAAa,SAAS,UAAU;AACzC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var import_vitest = require("vitest");
|
|
3
|
+
var import_createVariable = require("./createVariable");
|
|
4
|
+
(0, import_vitest.test)("dots", () => {
|
|
5
|
+
(0, import_vitest.expect)((0, import_createVariable.createCSSVariable)("yellow.10")).toBe("var(--yellow101a)");
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=createVariable.web.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/createVariable.web.test.tsx"],
|
|
4
|
+
"sourcesContent": ["import { expect, test } from 'vitest'\n\nimport { createCSSVariable } from './createVariable'\n\ntest('dots', () => {\n expect(createCSSVariable('yellow.10')).toBe('var(--yellow101a)')\n})\n"],
|
|
5
|
+
"mappings": ";AAAA,oBAA6B;AAE7B,4BAAkC;AAAA,IAElC,oBAAK,QAAQ,MAAM;AACjB,gCAAO,yCAAkB,WAAW,CAAC,EAAE,KAAK,mBAAmB;AACjE,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var import_config_default_node = require("@tamagui/config-default-node");
|
|
3
|
+
var import_vitest = require("vitest");
|
|
4
|
+
var import_createTamagui = require("../createTamagui");
|
|
5
|
+
var import_ThemeManager = require("./ThemeManager");
|
|
6
|
+
const conf = (0, import_config_default_node.getDefaultTamaguiConfig)();
|
|
7
|
+
(0, import_vitest.describe)("ThemeManager", () => {
|
|
8
|
+
(0, import_vitest.beforeAll)(() => {
|
|
9
|
+
(0, import_createTamagui.createTamagui)(conf);
|
|
10
|
+
});
|
|
11
|
+
(0, import_vitest.test)("Changes theme to dark", () => {
|
|
12
|
+
const manager = new import_ThemeManager.ThemeManager(
|
|
13
|
+
{
|
|
14
|
+
name: "dark"
|
|
15
|
+
},
|
|
16
|
+
"root"
|
|
17
|
+
);
|
|
18
|
+
(0, import_vitest.expect)(manager.state.name).toBe("dark");
|
|
19
|
+
});
|
|
20
|
+
(0, import_vitest.test)('Given parent theme "dark" and child theme "red" to return theme "dark_red"', () => {
|
|
21
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
22
|
+
{
|
|
23
|
+
name: "dark"
|
|
24
|
+
},
|
|
25
|
+
"root"
|
|
26
|
+
);
|
|
27
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
28
|
+
{
|
|
29
|
+
name: "red"
|
|
30
|
+
},
|
|
31
|
+
parent
|
|
32
|
+
);
|
|
33
|
+
(0, import_vitest.expect)(parent.state.name).toBe("dark");
|
|
34
|
+
(0, import_vitest.expect)(child.state.name).toBe("dark_red");
|
|
35
|
+
});
|
|
36
|
+
(0, import_vitest.test)('Given parent theme "dark", child theme "red_alt2" and component "Button" returns "dark_red_alt2_Button"', () => {
|
|
37
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
38
|
+
{
|
|
39
|
+
name: "dark"
|
|
40
|
+
},
|
|
41
|
+
"root"
|
|
42
|
+
);
|
|
43
|
+
const child1 = new import_ThemeManager.ThemeManager(
|
|
44
|
+
{
|
|
45
|
+
name: "red"
|
|
46
|
+
},
|
|
47
|
+
parent
|
|
48
|
+
);
|
|
49
|
+
(0, import_vitest.expect)(child1.state.name).toBe("dark_red");
|
|
50
|
+
const child2 = new import_ThemeManager.ThemeManager(
|
|
51
|
+
{
|
|
52
|
+
name: "alt2",
|
|
53
|
+
componentName: "Button"
|
|
54
|
+
},
|
|
55
|
+
child1
|
|
56
|
+
);
|
|
57
|
+
(0, import_vitest.expect)(child2.state.name).toBe("dark_red_alt2_Button");
|
|
58
|
+
});
|
|
59
|
+
(0, import_vitest.test)('Given parent theme "dark", child theme "red" and component "Button" returns "dark_red_Button"', () => {
|
|
60
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
61
|
+
{
|
|
62
|
+
name: "dark"
|
|
63
|
+
},
|
|
64
|
+
"root"
|
|
65
|
+
);
|
|
66
|
+
const child1 = new import_ThemeManager.ThemeManager(
|
|
67
|
+
{
|
|
68
|
+
name: "red"
|
|
69
|
+
},
|
|
70
|
+
parent
|
|
71
|
+
);
|
|
72
|
+
(0, import_vitest.expect)(child1.state.name).toBe("dark_red");
|
|
73
|
+
const child2 = new import_ThemeManager.ThemeManager(
|
|
74
|
+
{
|
|
75
|
+
componentName: "Button"
|
|
76
|
+
},
|
|
77
|
+
child1
|
|
78
|
+
);
|
|
79
|
+
(0, import_vitest.expect)(child2.state.name).toBe("dark_red_Button");
|
|
80
|
+
});
|
|
81
|
+
(0, import_vitest.test)('Given parent theme "dark", child theme "red" and missing component "Card" returns "dark_red"', () => {
|
|
82
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
83
|
+
{
|
|
84
|
+
name: "dark"
|
|
85
|
+
},
|
|
86
|
+
"root"
|
|
87
|
+
);
|
|
88
|
+
const child1 = new import_ThemeManager.ThemeManager(
|
|
89
|
+
{
|
|
90
|
+
name: "red"
|
|
91
|
+
},
|
|
92
|
+
parent
|
|
93
|
+
);
|
|
94
|
+
(0, import_vitest.expect)(child1.state.name).toBe("dark_red");
|
|
95
|
+
const child2 = new import_ThemeManager.ThemeManager(
|
|
96
|
+
{
|
|
97
|
+
componentName: "Card"
|
|
98
|
+
},
|
|
99
|
+
child1
|
|
100
|
+
);
|
|
101
|
+
(0, import_vitest.expect)(child2.state.name).toBe("dark_red");
|
|
102
|
+
});
|
|
103
|
+
(0, import_vitest.test)('Changes "light" to "dark"', () => {
|
|
104
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
105
|
+
{
|
|
106
|
+
name: "light"
|
|
107
|
+
},
|
|
108
|
+
"root"
|
|
109
|
+
);
|
|
110
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
111
|
+
{
|
|
112
|
+
name: "dark"
|
|
113
|
+
},
|
|
114
|
+
parent
|
|
115
|
+
);
|
|
116
|
+
(0, import_vitest.expect)(parent.state.name).toBe("light");
|
|
117
|
+
(0, import_vitest.expect)(child.state.name).toBe("dark");
|
|
118
|
+
});
|
|
119
|
+
(0, import_vitest.test)('Inverts "light" to "dark"', () => {
|
|
120
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
121
|
+
{
|
|
122
|
+
name: "light"
|
|
123
|
+
},
|
|
124
|
+
"root"
|
|
125
|
+
);
|
|
126
|
+
const child1 = new import_ThemeManager.ThemeManager(
|
|
127
|
+
{
|
|
128
|
+
inverse: true
|
|
129
|
+
},
|
|
130
|
+
parent
|
|
131
|
+
);
|
|
132
|
+
(0, import_vitest.expect)(child1.state.name).toBe("dark");
|
|
133
|
+
});
|
|
134
|
+
(0, import_vitest.test)('Inverts "light_red" to "dark_red"', () => {
|
|
135
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
136
|
+
{
|
|
137
|
+
name: "light"
|
|
138
|
+
},
|
|
139
|
+
"root"
|
|
140
|
+
);
|
|
141
|
+
const child1 = new import_ThemeManager.ThemeManager(
|
|
142
|
+
{
|
|
143
|
+
name: "red",
|
|
144
|
+
inverse: true
|
|
145
|
+
},
|
|
146
|
+
parent
|
|
147
|
+
);
|
|
148
|
+
(0, import_vitest.expect)(child1.state.name).toBe("dark_red");
|
|
149
|
+
});
|
|
150
|
+
(0, import_vitest.test)("Updates state", () => {
|
|
151
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
152
|
+
{
|
|
153
|
+
name: "light"
|
|
154
|
+
},
|
|
155
|
+
"root"
|
|
156
|
+
);
|
|
157
|
+
const newState = parent.updateState({
|
|
158
|
+
name: "dark"
|
|
159
|
+
});
|
|
160
|
+
(0, import_vitest.expect)(newState).toMatchInlineSnapshot(`
|
|
161
|
+
{
|
|
162
|
+
"className": "t_dark",
|
|
163
|
+
"name": "dark",
|
|
164
|
+
"parentName": "",
|
|
165
|
+
"theme": {
|
|
166
|
+
"background": {
|
|
167
|
+
"isVar": true,
|
|
168
|
+
"key": "color-2",
|
|
169
|
+
"name": "background",
|
|
170
|
+
"val": "#000",
|
|
171
|
+
"variable": "",
|
|
172
|
+
},
|
|
173
|
+
"color": {
|
|
174
|
+
"isVar": true,
|
|
175
|
+
"key": "color-1",
|
|
176
|
+
"name": "color",
|
|
177
|
+
"val": "#fff",
|
|
178
|
+
"variable": "",
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
}
|
|
182
|
+
`);
|
|
183
|
+
(0, import_vitest.expect)(parent.state.name).toBe("dark");
|
|
184
|
+
});
|
|
185
|
+
(0, import_vitest.test)("Returns parent on empty", () => {
|
|
186
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
187
|
+
{
|
|
188
|
+
name: "light"
|
|
189
|
+
},
|
|
190
|
+
"root"
|
|
191
|
+
);
|
|
192
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
193
|
+
{
|
|
194
|
+
name: null
|
|
195
|
+
},
|
|
196
|
+
parent
|
|
197
|
+
);
|
|
198
|
+
(0, import_vitest.expect)(child).toBe(parent);
|
|
199
|
+
});
|
|
200
|
+
(0, import_vitest.test)("Resets theme", () => {
|
|
201
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
202
|
+
{
|
|
203
|
+
name: "light"
|
|
204
|
+
},
|
|
205
|
+
"root"
|
|
206
|
+
);
|
|
207
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
208
|
+
{
|
|
209
|
+
name: "dark"
|
|
210
|
+
},
|
|
211
|
+
parent
|
|
212
|
+
);
|
|
213
|
+
(0, import_vitest.expect)(child.state.name).toBe("dark");
|
|
214
|
+
(0, import_vitest.expect)(child.parentManager).toBe(parent);
|
|
215
|
+
const child2 = new import_ThemeManager.ThemeManager(
|
|
216
|
+
{
|
|
217
|
+
reset: true
|
|
218
|
+
},
|
|
219
|
+
child
|
|
220
|
+
);
|
|
221
|
+
(0, import_vitest.expect)(child2.parentManager).toBe(child);
|
|
222
|
+
(0, import_vitest.expect)(child2.state.name).toBe("light");
|
|
223
|
+
});
|
|
224
|
+
(0, import_vitest.test)("Nested invert and reset", () => {
|
|
225
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
226
|
+
{
|
|
227
|
+
name: "light"
|
|
228
|
+
},
|
|
229
|
+
"root"
|
|
230
|
+
);
|
|
231
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
232
|
+
{
|
|
233
|
+
name: "dark"
|
|
234
|
+
},
|
|
235
|
+
parent
|
|
236
|
+
);
|
|
237
|
+
const child2 = new import_ThemeManager.ThemeManager(
|
|
238
|
+
{
|
|
239
|
+
reset: true
|
|
240
|
+
},
|
|
241
|
+
child
|
|
242
|
+
);
|
|
243
|
+
const child3 = new import_ThemeManager.ThemeManager(
|
|
244
|
+
{
|
|
245
|
+
inverse: true
|
|
246
|
+
},
|
|
247
|
+
child2
|
|
248
|
+
);
|
|
249
|
+
(0, import_vitest.expect)(child3.state.name).toBe("dark");
|
|
250
|
+
});
|
|
251
|
+
(0, import_vitest.test)("Updates from null the new theme nested 3 themes", () => {
|
|
252
|
+
const a = new import_ThemeManager.ThemeManager(
|
|
253
|
+
{
|
|
254
|
+
name: "dark"
|
|
255
|
+
},
|
|
256
|
+
"root"
|
|
257
|
+
);
|
|
258
|
+
const b = new import_ThemeManager.ThemeManager(
|
|
259
|
+
{
|
|
260
|
+
name: "red"
|
|
261
|
+
},
|
|
262
|
+
a
|
|
263
|
+
);
|
|
264
|
+
(0, import_vitest.expect)(b.state.name).toBe("dark_red");
|
|
265
|
+
const c = new import_ThemeManager.ThemeManager(
|
|
266
|
+
{
|
|
267
|
+
name: "alt2"
|
|
268
|
+
},
|
|
269
|
+
b
|
|
270
|
+
);
|
|
271
|
+
(0, import_vitest.expect)(c.state.name).toBe("dark_red_alt2");
|
|
272
|
+
});
|
|
273
|
+
(0, import_vitest.test)("Ignored dup themes", () => {
|
|
274
|
+
const a = new import_ThemeManager.ThemeManager(
|
|
275
|
+
{
|
|
276
|
+
name: "dark"
|
|
277
|
+
},
|
|
278
|
+
"root"
|
|
279
|
+
);
|
|
280
|
+
const b = new import_ThemeManager.ThemeManager(
|
|
281
|
+
{
|
|
282
|
+
name: "dark"
|
|
283
|
+
},
|
|
284
|
+
a
|
|
285
|
+
);
|
|
286
|
+
(0, import_vitest.expect)(b === a).toBe(true);
|
|
287
|
+
});
|
|
288
|
+
(0, import_vitest.test)("Nested component themes fallback to grandparents", () => {
|
|
289
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
290
|
+
{
|
|
291
|
+
name: "dark"
|
|
292
|
+
},
|
|
293
|
+
"root"
|
|
294
|
+
);
|
|
295
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
296
|
+
{
|
|
297
|
+
name: "red",
|
|
298
|
+
componentName: "Button"
|
|
299
|
+
},
|
|
300
|
+
parent
|
|
301
|
+
);
|
|
302
|
+
const child2 = new import_ThemeManager.ThemeManager(
|
|
303
|
+
{
|
|
304
|
+
name: "blue"
|
|
305
|
+
},
|
|
306
|
+
child
|
|
307
|
+
);
|
|
308
|
+
(0, import_vitest.expect)(child2.state.name).toBe("dark_blue");
|
|
309
|
+
const child3 = new import_ThemeManager.ThemeManager(
|
|
310
|
+
{
|
|
311
|
+
componentName: "Button"
|
|
312
|
+
},
|
|
313
|
+
child2
|
|
314
|
+
);
|
|
315
|
+
(0, import_vitest.expect)(child3.state.name).toBe("dark_blue_Button");
|
|
316
|
+
});
|
|
317
|
+
(0, import_vitest.test)(`Component theme with sub component that doesn't exist keeps same theme`, () => {
|
|
318
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
319
|
+
{
|
|
320
|
+
name: "dark"
|
|
321
|
+
},
|
|
322
|
+
"root"
|
|
323
|
+
);
|
|
324
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
325
|
+
{
|
|
326
|
+
name: "red",
|
|
327
|
+
componentName: "Button"
|
|
328
|
+
},
|
|
329
|
+
parent
|
|
330
|
+
);
|
|
331
|
+
const child2 = new import_ThemeManager.ThemeManager(
|
|
332
|
+
{
|
|
333
|
+
componentName: "Spacer"
|
|
334
|
+
},
|
|
335
|
+
child
|
|
336
|
+
);
|
|
337
|
+
(0, import_vitest.expect)(child2).toBe(child);
|
|
338
|
+
});
|
|
339
|
+
(0, import_vitest.test)(`Doesn't find invalid parent when only passing component`, () => {
|
|
340
|
+
(0, import_vitest.expect)(!!conf.themes["dark_Card"]).toBeTruthy();
|
|
341
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
342
|
+
{
|
|
343
|
+
name: "dark_red"
|
|
344
|
+
},
|
|
345
|
+
"root"
|
|
346
|
+
);
|
|
347
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
348
|
+
{
|
|
349
|
+
componentName: "Card"
|
|
350
|
+
},
|
|
351
|
+
parent
|
|
352
|
+
);
|
|
353
|
+
(0, import_vitest.expect)(child.state.name).toBe(parent.state.name);
|
|
354
|
+
});
|
|
355
|
+
(0, import_vitest.test)(`Finds sub-theme when componentName and name are passed but componentName doesn't exist`, () => {
|
|
356
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
357
|
+
{
|
|
358
|
+
name: "dark"
|
|
359
|
+
},
|
|
360
|
+
"root"
|
|
361
|
+
);
|
|
362
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
363
|
+
{
|
|
364
|
+
name: "red",
|
|
365
|
+
componentName: "Missing"
|
|
366
|
+
},
|
|
367
|
+
parent
|
|
368
|
+
);
|
|
369
|
+
(0, import_vitest.expect)(child.state.name).toBe("dark_red");
|
|
370
|
+
});
|
|
371
|
+
(0, import_vitest.test)("Uses the full className without the light/dark prefix", () => {
|
|
372
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
373
|
+
{
|
|
374
|
+
name: "dark"
|
|
375
|
+
},
|
|
376
|
+
"root"
|
|
377
|
+
);
|
|
378
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
379
|
+
{
|
|
380
|
+
name: "red_alt2"
|
|
381
|
+
},
|
|
382
|
+
parent
|
|
383
|
+
);
|
|
384
|
+
(0, import_vitest.expect)(child.state.className).toBe("t_red_alt2");
|
|
385
|
+
const child2 = new import_ThemeManager.ThemeManager(
|
|
386
|
+
{
|
|
387
|
+
name: "red"
|
|
388
|
+
},
|
|
389
|
+
parent
|
|
390
|
+
);
|
|
391
|
+
const child3 = new import_ThemeManager.ThemeManager(
|
|
392
|
+
{
|
|
393
|
+
name: "alt2"
|
|
394
|
+
},
|
|
395
|
+
child2
|
|
396
|
+
);
|
|
397
|
+
(0, import_vitest.expect)(child3.state.className).toBe("t_red_alt2");
|
|
398
|
+
});
|
|
399
|
+
(0, import_vitest.test)("Finds component dark_red + Button", () => {
|
|
400
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
401
|
+
{
|
|
402
|
+
name: "dark_red"
|
|
403
|
+
},
|
|
404
|
+
"root"
|
|
405
|
+
);
|
|
406
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
407
|
+
{
|
|
408
|
+
name: "dark_red",
|
|
409
|
+
componentName: "Button"
|
|
410
|
+
},
|
|
411
|
+
parent
|
|
412
|
+
);
|
|
413
|
+
(0, import_vitest.expect)(child.state.className).toBe("t_red_Button");
|
|
414
|
+
(0, import_vitest.expect)(child.state.name).toBe("dark_red_Button");
|
|
415
|
+
});
|
|
416
|
+
(0, import_vitest.test)("Drops componentName if only regular name found at stronger level", () => {
|
|
417
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
418
|
+
{
|
|
419
|
+
name: "dark_red"
|
|
420
|
+
},
|
|
421
|
+
"root"
|
|
422
|
+
);
|
|
423
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
424
|
+
{
|
|
425
|
+
name: "alt1",
|
|
426
|
+
componentName: "Button"
|
|
427
|
+
},
|
|
428
|
+
parent
|
|
429
|
+
);
|
|
430
|
+
(0, import_vitest.expect)(child.state.name).toBe("dark_red_alt1");
|
|
431
|
+
});
|
|
432
|
+
(0, import_vitest.test)("Component name + theme change when nested already", () => {
|
|
433
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
434
|
+
{
|
|
435
|
+
name: "dark_red"
|
|
436
|
+
},
|
|
437
|
+
"root"
|
|
438
|
+
);
|
|
439
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
440
|
+
{
|
|
441
|
+
name: "yellow",
|
|
442
|
+
componentName: "Button"
|
|
443
|
+
},
|
|
444
|
+
parent
|
|
445
|
+
);
|
|
446
|
+
(0, import_vitest.expect)(child.state.name).toBe("dark_yellow_Button");
|
|
447
|
+
});
|
|
448
|
+
(0, import_vitest.test)("Component name + name finds one up when component name missing", () => {
|
|
449
|
+
const parent = new import_ThemeManager.ThemeManager(
|
|
450
|
+
{
|
|
451
|
+
name: "dark_red_alt1"
|
|
452
|
+
},
|
|
453
|
+
"root"
|
|
454
|
+
);
|
|
455
|
+
const child = new import_ThemeManager.ThemeManager(
|
|
456
|
+
{
|
|
457
|
+
name: "alt2",
|
|
458
|
+
componentName: "Missing"
|
|
459
|
+
},
|
|
460
|
+
parent
|
|
461
|
+
);
|
|
462
|
+
(0, import_vitest.expect)(child.state.name).toBe("dark_red_alt2");
|
|
463
|
+
});
|
|
464
|
+
});
|
|
465
|
+
//# sourceMappingURL=ThemeManager.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/ThemeManager.test.tsx"],
|
|
4
|
+
"sourcesContent": ["import { getDefaultTamaguiConfig } from '@tamagui/config-default-node'\nimport { beforeAll, describe, expect, test } from 'vitest'\n\nimport { createTamagui } from '../createTamagui'\nimport { ThemeManager } from './ThemeManager'\n\nconst conf = getDefaultTamaguiConfig()\n\ndescribe('ThemeManager', () => {\n beforeAll(() => {\n createTamagui(conf)\n })\n\n test('Changes theme to dark', () => {\n const manager = new ThemeManager(\n {\n name: 'dark',\n },\n 'root'\n )\n expect(manager.state.name).toBe('dark')\n })\n\n test('Given parent theme \"dark\" and child theme \"red\" to return theme \"dark_red\"', () => {\n const parent = new ThemeManager(\n {\n name: 'dark',\n },\n 'root'\n )\n const child = new ThemeManager(\n {\n name: 'red',\n },\n parent\n )\n expect(parent.state.name).toBe('dark')\n expect(child.state.name).toBe('dark_red')\n })\n\n test('Given parent theme \"dark\", child theme \"red_alt2\" and component \"Button\" returns \"dark_red_alt2_Button\"', () => {\n const parent = new ThemeManager(\n {\n name: 'dark',\n },\n 'root'\n )\n const child1 = new ThemeManager(\n {\n name: 'red',\n },\n parent\n )\n expect(child1.state.name).toBe('dark_red')\n const child2 = new ThemeManager(\n {\n name: 'alt2',\n componentName: 'Button',\n },\n child1\n )\n expect(child2.state.name).toBe('dark_red_alt2_Button')\n })\n\n test('Given parent theme \"dark\", child theme \"red\" and component \"Button\" returns \"dark_red_Button\"', () => {\n const parent = new ThemeManager(\n {\n name: 'dark',\n },\n 'root'\n )\n const child1 = new ThemeManager(\n {\n name: 'red',\n },\n parent\n )\n expect(child1.state.name).toBe('dark_red')\n const child2 = new ThemeManager(\n {\n componentName: 'Button',\n },\n child1\n )\n expect(child2.state.name).toBe('dark_red_Button')\n })\n\n test('Given parent theme \"dark\", child theme \"red\" and missing component \"Card\" returns \"dark_red\"', () => {\n const parent = new ThemeManager(\n {\n name: 'dark',\n },\n 'root'\n )\n const child1 = new ThemeManager(\n {\n name: 'red',\n },\n parent\n )\n expect(child1.state.name).toBe('dark_red')\n const child2 = new ThemeManager(\n {\n componentName: 'Card',\n },\n child1\n )\n expect(child2.state.name).toBe('dark_red')\n })\n\n test('Changes \"light\" to \"dark\"', () => {\n const parent = new ThemeManager(\n {\n name: 'light',\n },\n 'root'\n )\n const child = new ThemeManager(\n {\n name: 'dark',\n },\n parent\n )\n expect(parent.state.name).toBe('light')\n expect(child.state.name).toBe('dark')\n })\n\n test('Inverts \"light\" to \"dark\"', () => {\n const parent = new ThemeManager(\n {\n name: 'light',\n },\n 'root'\n )\n const child1 = new ThemeManager(\n {\n inverse: true,\n },\n parent\n )\n expect(child1.state.name).toBe('dark')\n })\n\n test('Inverts \"light_red\" to \"dark_red\"', () => {\n const parent = new ThemeManager(\n {\n name: 'light',\n },\n 'root'\n )\n const child1 = new ThemeManager(\n {\n name: 'red',\n inverse: true,\n },\n parent\n )\n expect(child1.state.name).toBe('dark_red')\n })\n\n test('Updates state', () => {\n const parent = new ThemeManager(\n {\n name: 'light',\n },\n 'root'\n )\n const newState = parent.updateState({\n name: 'dark',\n })\n expect(newState).toMatchInlineSnapshot(`\n {\n \"className\": \"t_dark\",\n \"name\": \"dark\",\n \"parentName\": \"\",\n \"theme\": {\n \"background\": {\n \"isVar\": true,\n \"key\": \"color-2\",\n \"name\": \"background\",\n \"val\": \"#000\",\n \"variable\": \"\",\n },\n \"color\": {\n \"isVar\": true,\n \"key\": \"color-1\",\n \"name\": \"color\",\n \"val\": \"#fff\",\n \"variable\": \"\",\n },\n },\n }\n `)\n expect(parent.state.name).toBe('dark')\n })\n\n test('Returns parent on empty', () => {\n const parent = new ThemeManager(\n {\n name: 'light',\n },\n 'root'\n )\n const child = new ThemeManager(\n {\n name: null,\n },\n parent\n )\n expect(child).toBe(parent)\n })\n\n test('Resets theme', () => {\n const parent = new ThemeManager(\n {\n name: 'light',\n },\n 'root'\n )\n const child = new ThemeManager(\n {\n name: 'dark',\n },\n parent\n )\n expect(child.state.name).toBe('dark')\n expect(child.parentManager).toBe(parent)\n const child2 = new ThemeManager(\n {\n reset: true,\n },\n child\n )\n expect(child2.parentManager).toBe(child)\n expect(child2.state.name).toBe('light')\n })\n\n test('Nested invert and reset', () => {\n const parent = new ThemeManager(\n {\n name: 'light',\n },\n 'root'\n )\n const child = new ThemeManager(\n {\n name: 'dark',\n },\n parent\n )\n const child2 = new ThemeManager(\n {\n reset: true,\n },\n child\n )\n const child3 = new ThemeManager(\n {\n inverse: true,\n },\n child2\n )\n expect(child3.state.name).toBe('dark')\n })\n\n test('Updates from null the new theme nested 3 themes', () => {\n const a = new ThemeManager(\n {\n name: 'dark',\n },\n 'root'\n )\n const b = new ThemeManager(\n {\n name: 'red',\n },\n a\n )\n expect(b.state.name).toBe('dark_red')\n const c = new ThemeManager(\n {\n name: 'alt2',\n },\n b\n )\n expect(c.state.name).toBe('dark_red_alt2')\n })\n\n test('Ignored dup themes', () => {\n const a = new ThemeManager(\n {\n name: 'dark',\n },\n 'root'\n )\n const b = new ThemeManager(\n {\n name: 'dark',\n },\n a\n )\n expect(b === a).toBe(true)\n })\n\n test('Nested component themes fallback to grandparents', () => {\n const parent = new ThemeManager(\n {\n name: 'dark',\n },\n 'root'\n )\n const child = new ThemeManager(\n {\n name: 'red',\n componentName: 'Button',\n },\n parent\n )\n const child2 = new ThemeManager(\n {\n name: 'blue',\n },\n child\n )\n expect(child2.state.name).toBe('dark_blue')\n const child3 = new ThemeManager(\n {\n componentName: 'Button',\n },\n child2\n )\n expect(child3.state.name).toBe('dark_blue_Button')\n })\n\n test(`Component theme with sub component that doesn't exist keeps same theme`, () => {\n const parent = new ThemeManager(\n {\n name: 'dark',\n },\n 'root'\n )\n const child = new ThemeManager(\n {\n name: 'red',\n componentName: 'Button',\n },\n parent\n )\n const child2 = new ThemeManager(\n {\n componentName: 'Spacer',\n },\n child\n )\n expect(child2).toBe(child)\n })\n\n test(`Doesn't find invalid parent when only passing component`, () => {\n expect(!!conf.themes['dark_Card']).toBeTruthy()\n\n const parent = new ThemeManager(\n {\n name: 'dark_red',\n },\n 'root'\n )\n\n const child = new ThemeManager(\n {\n componentName: 'Card',\n },\n parent\n )\n\n // dont find dark_Card because dark_red is highest it should climb\n expect(child.state.name).toBe(parent.state.name)\n })\n\n test(`Finds sub-theme when componentName and name are passed but componentName doesn't exist`, () => {\n const parent = new ThemeManager(\n {\n name: 'dark',\n },\n 'root'\n )\n\n const child = new ThemeManager(\n {\n name: 'red',\n componentName: 'Missing',\n },\n parent\n )\n\n // dont find dark_Card because dark_red is highest it should climb\n expect(child.state.name).toBe('dark_red')\n })\n\n test('Uses the full className without the light/dark prefix', () => {\n const parent = new ThemeManager(\n {\n name: 'dark',\n },\n 'root'\n )\n const child = new ThemeManager(\n {\n name: 'red_alt2',\n },\n parent\n )\n expect(child.state.className).toBe('t_red_alt2')\n\n const child2 = new ThemeManager(\n {\n name: 'red',\n },\n parent\n )\n const child3 = new ThemeManager(\n {\n name: 'alt2',\n },\n child2\n )\n expect(child3.state.className).toBe('t_red_alt2')\n })\n\n test('Finds component dark_red + Button', () => {\n const parent = new ThemeManager(\n {\n name: 'dark_red',\n },\n 'root'\n )\n const child = new ThemeManager(\n {\n name: 'dark_red',\n componentName: 'Button',\n },\n parent\n )\n expect(child.state.className).toBe('t_red_Button')\n expect(child.state.name).toBe('dark_red_Button')\n })\n\n test('Drops componentName if only regular name found at stronger level', () => {\n const parent = new ThemeManager(\n {\n name: 'dark_red',\n },\n 'root'\n )\n const child = new ThemeManager(\n {\n name: 'alt1',\n componentName: 'Button',\n },\n parent\n )\n expect(child.state.name).toBe('dark_red_alt1')\n })\n\n test('Component name + theme change when nested already', () => {\n const parent = new ThemeManager(\n {\n name: 'dark_red',\n },\n 'root'\n )\n const child = new ThemeManager(\n {\n name: 'yellow',\n componentName: 'Button',\n },\n parent\n )\n expect(child.state.name).toBe('dark_yellow_Button')\n })\n\n test('Component name + name finds one up when component name missing', () => {\n const parent = new ThemeManager(\n {\n name: 'dark_red_alt1',\n },\n 'root'\n )\n const child = new ThemeManager(\n {\n name: 'alt2',\n componentName: 'Missing',\n },\n parent\n )\n expect(child.state.name).toBe('dark_red_alt2')\n })\n})\n"],
|
|
5
|
+
"mappings": ";AAAA,iCAAwC;AACxC,oBAAkD;AAElD,2BAA8B;AAC9B,0BAA6B;AAE7B,MAAM,WAAO,oDAAwB;AAAA,IAErC,wBAAS,gBAAgB,MAAM;AAC7B,+BAAU,MAAM;AACd,4CAAc,IAAI;AAAA,EACpB,CAAC;AAED,0BAAK,yBAAyB,MAAM;AAClC,UAAM,UAAU,IAAI;AAAA,MAClB;AAAA,QACE,MAA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E,MAAM;AAAA,MACR;AAAA,MACA;AAAA,IACF;AACA,UAAM,QAAQ,IAAI;AAAA,MAChB;AAAA,QACE,MAAM;AAAA,QACN,eAAe;AAAA,MACjB;AAAA,MACA;AAAA,IACF;AACA,8BAAO,MAAM,MAAM,IAAI,EAAE,KAAK,oBAAoB;AAAA,EACpD,CAAC;AAED,0BAAK,kEAAkE,MAAM;AAC3E,UAAM,SAAS,IAAI;AAAA,MACjB;AAAA,QACE,MAAM;AAAA,MACR;AAAA,MACA;AAAA,IACF;AACA,UAAM,QAAQ,IAAI;AAAA,MAChB;AAAA,QACE,MAAM;AAAA,QACN,eAAe;AAAA,MACjB;AAAA,MACA;AAAA,IACF;AACA,8BAAO,MAAM,MAAM,IAAI,EAAE,KAAK,eAAe;AAAA,EAC/C,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var expandStyles_exports = {};
|
|
20
30
|
__export(expandStyles_exports, {
|
|
@@ -24,7 +34,7 @@ __export(expandStyles_exports, {
|
|
|
24
34
|
});
|
|
25
35
|
module.exports = __toCommonJS(expandStyles_exports);
|
|
26
36
|
var import_constants = require("@tamagui/constants");
|
|
27
|
-
var import_normalize_css_color = require("@tamagui/normalize-css-color");
|
|
37
|
+
var import_normalize_css_color = __toESM(require("@tamagui/normalize-css-color"));
|
|
28
38
|
var import_config = require("../config");
|
|
29
39
|
var import_expandStyle = require("./expandStyle");
|
|
30
40
|
var import_normalizeColor = require("./normalizeColor");
|
|
@@ -89,7 +99,7 @@ function normalizeShadow({
|
|
|
89
99
|
shadowColor: (0, import_normalizeColor.normalizeColor)(colorStr, shadowOpacity)
|
|
90
100
|
},
|
|
91
101
|
...process.env.TAMAGUI_TARGET === "native" && (() => {
|
|
92
|
-
const val = (0, import_normalize_css_color.
|
|
102
|
+
const val = (0, import_normalize_css_color.default)(colorStr);
|
|
93
103
|
if (!val) {
|
|
94
104
|
if (process.env.NODE_ENV === "development") {
|
|
95
105
|
console.warn("No rgba form", colorStr);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/expandStyles.ts"],
|
|
4
|
-
"sourcesContent": ["import { isWeb } from '@tamagui/constants'\nimport
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import { isWeb } from '@tamagui/constants'\nimport normalizeCSSColor from '@tamagui/normalize-css-color'\n\nimport { getConfig } from '../config'\nimport { expandStyle } from './expandStyle'\nimport { normalizeColor, rgba } from './normalizeColor'\nimport { normalizeValueWithProperty } from './normalizeValueWithProperty.js'\nimport { pseudoDescriptors } from './pseudoDescriptors'\n\nlet shorthands: Record<string, string> | null = null\nexport const defaultOffset = { height: 0, width: 0 }\n\n/**\n * This is what you want to run before Object.assign() a style onto another.\n * It does the following:\n * 1. Turns user shorthands into longhands, ie px = paddingHorizontal\n * 2. Normalizes various inconsistent styles to be more consistent\n * 3. Expands react-native shorthands, ie paddingHorizontal => paddingLeft, paddingRight\n */\n\nexport function expandStyles(style: Record<string, any>, config = getConfig()) {\n const res: Record<string, any> = {}\n\n for (let key in style) {\n shorthands = shorthands || (config ? config.shorthands : null)\n if (shorthands) {\n key = shorthands[key] || key\n }\n if (key in pseudoDescriptors) {\n res[key] = expandStyles(style[key])\n continue\n }\n const val = normalizeValueWithProperty(style[key], key)\n // expand react-native shorthands\n const out = expandStyle(key, val)\n if (out) {\n Object.assign(res, Object.fromEntries(out))\n } else {\n res[key] = val\n }\n }\n\n fixStyles(res)\n\n return res\n}\n\nexport function fixStyles(style: Record<string, any>) {\n if (style.shadowRadius) {\n Object.assign(style, normalizeShadow(style))\n }\n\n // ensure border style set by default to solid\n for (const key in borderDefaults) {\n if (style[key] && !style[borderDefaults[key]]) {\n style[borderDefaults[key]] = 'solid'\n }\n }\n}\n\nconst borderDefaults = {\n borderWidth: 'borderStyle',\n borderBottomWidth: 'borderBottomStyle',\n borderTopWidth: 'borderTopStyle',\n borderLeftWidth: 'borderLeftStyle',\n borderRightWidth: 'borderRightStyle',\n}\n\nfunction normalizeShadow({\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n}: Record<string, any>) {\n const { height, width } = shadowOffset || defaultOffset\n const colorStr = String(shadowColor || 'black')\n return {\n shadowOffset: {\n width: normalizeValueWithProperty(width || 0),\n height: normalizeValueWithProperty(height || 0),\n },\n shadowRadius: normalizeValueWithProperty(shadowRadius || 0),\n ...(isWeb && {\n shadowColor: normalizeColor(colorStr, shadowOpacity),\n }),\n ...(process.env.TAMAGUI_TARGET === 'native' &&\n (() => {\n // on native fix bug - shadows behave better if turned into non-alpha rgb() + shadowOpacity\n const val = normalizeCSSColor(colorStr)\n if (!val) {\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn('No rgba form', colorStr)\n }\n return {\n shadowColor,\n shadowOpacity,\n }\n }\n const { r, g, b, a } = rgba(val)\n return {\n shadowColor: `rgb(${r},${g},${b})`,\n shadowOpacity: shadowOpacity ?? a,\n }\n })()),\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB;AACtB,iCAA8B;AAE9B,oBAA0B;AAC1B,yBAA4B;AAC5B,4BAAqC;AACrC,wCAA2C;AAC3C,+BAAkC;AAElC,IAAI,aAA4C;AACzC,MAAM,gBAAgB,EAAE,QAAQ,GAAG,OAAO,EAAE;AAU5C,SAAS,aAAa,OAA4B,aAAS,yBAAU,GAAG;AAC7E,QAAM,MAA2B,CAAC;AAElC,WAAS,OAAO,OAAO;AACrB,iBAAa,eAAe,SAAS,OAAO,aAAa;AACzD,QAAI,YAAY;AACd,YAAM,WAAW,GAAG,KAAK;AAAA,IAC3B;AACA,QAAI,OAAO,4CAAmB;AAC5B,UAAI,GAAG,IAAI,aAAa,MAAM,GAAG,CAAC;AAClC;AAAA,IACF;AACA,UAAM,UAAM,8DAA2B,MAAM,GAAG,GAAG,GAAG;AAEtD,UAAM,UAAM,gCAAY,KAAK,GAAG;AAChC,QAAI,KAAK;AACP,aAAO,OAAO,KAAK,OAAO,YAAY,GAAG,CAAC;AAAA,IAC5C,OAAO;AACL,UAAI,GAAG,IAAI;AAAA,IACb;AAAA,EACF;AAEA,YAAU,GAAG;AAEb,SAAO;AACT;AAEO,SAAS,UAAU,OAA4B;AACpD,MAAI,MAAM,cAAc;AACtB,WAAO,OAAO,OAAO,gBAAgB,KAAK,CAAC;AAAA,EAC7C;AAGA,aAAW,OAAO,gBAAgB;AAChC,QAAI,MAAM,G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