@tamagui/web 1.89.0 → 1.89.2
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/esm/helpers/insertStyleRule.mjs +2 -1
- package/dist/esm/styled.mjs +14 -14
- package/package.json +11 -11
|
@@ -104,7 +104,8 @@ function addThemesFromCSS(cssStyleRule, tokens) {
|
|
|
104
104
|
for (const rule of rules) {
|
|
105
105
|
const sepI = rule.indexOf(":");
|
|
106
106
|
if (sepI === -1) continue;
|
|
107
|
-
const
|
|
107
|
+
const varIndex = rule.indexOf("--"),
|
|
108
|
+
key = rule.slice(varIndex === -1 ? 0 : varIndex + 2, sepI),
|
|
108
109
|
val = rule.slice(sepI + 2);
|
|
109
110
|
let value;
|
|
110
111
|
if (val.startsWith("var(")) {
|
package/dist/esm/styled.mjs
CHANGED
|
@@ -3,11 +3,11 @@ import { mergeVariants } from "./helpers/mergeVariants.mjs";
|
|
|
3
3
|
import { getReactNativeConfig } from "./setupReactNative.mjs";
|
|
4
4
|
function styled(ComponentIn, options, staticExtractionOptions) {
|
|
5
5
|
if (process.env.NODE_ENV !== "production" && !ComponentIn) throw new Error("No component given to styled()");
|
|
6
|
-
const
|
|
7
|
-
isPlainStyledComponent = !!
|
|
8
|
-
let Component =
|
|
9
|
-
const reactNativeConfig =
|
|
10
|
-
isReactNative = !!(reactNativeConfig || staticExtractionOptions?.isReactNative ||
|
|
6
|
+
const parentStaticConfig = ComponentIn.staticConfig,
|
|
7
|
+
isPlainStyledComponent = !!parentStaticConfig && !(parentStaticConfig.isReactNative || parentStaticConfig.isHOC);
|
|
8
|
+
let Component = parentStaticConfig?.isHOC && !parentStaticConfig?.isStyledHOC || isPlainStyledComponent ? ComponentIn : parentStaticConfig?.Component || ComponentIn;
|
|
9
|
+
const reactNativeConfig = parentStaticConfig ? void 0 : getReactNativeConfig(Component),
|
|
10
|
+
isReactNative = !!(reactNativeConfig || staticExtractionOptions?.isReactNative || parentStaticConfig?.isReactNative),
|
|
11
11
|
staticConfigProps = (() => {
|
|
12
12
|
if (options) {
|
|
13
13
|
let {
|
|
@@ -21,14 +21,14 @@ function styled(ComponentIn, options, staticExtractionOptions) {
|
|
|
21
21
|
defaultVariants && (defaultProps = {
|
|
22
22
|
...defaultVariants,
|
|
23
23
|
...defaultProps
|
|
24
|
-
}),
|
|
25
|
-
...
|
|
24
|
+
}), parentStaticConfig && (parentStaticConfig.isHOC && !parentStaticConfig.isStyledHOC || (defaultProps = {
|
|
25
|
+
...parentStaticConfig.defaultProps,
|
|
26
26
|
...defaultProps
|
|
27
|
-
},
|
|
28
|
-
const isText = !!(staticExtractionOptions?.isText ||
|
|
29
|
-
acceptsClassName = acceptsClassNameProp ??
|
|
27
|
+
}, parentStaticConfig.variants && (variants = mergeVariants(parentStaticConfig.variants, variants)))), parentStaticConfig?.isHOC && name && (defaultProps.componentName = name);
|
|
28
|
+
const isText = !!(staticExtractionOptions?.isText || parentStaticConfig?.isText),
|
|
29
|
+
acceptsClassName = acceptsClassNameProp ?? (isPlainStyledComponent || isReactNative || parentStaticConfig?.isHOC && parentStaticConfig?.acceptsClassName),
|
|
30
30
|
conf = {
|
|
31
|
-
...
|
|
31
|
+
...parentStaticConfig,
|
|
32
32
|
...staticExtractionOptions,
|
|
33
33
|
...(!isPlainStyledComponent && {
|
|
34
34
|
Component
|
|
@@ -37,14 +37,14 @@ function styled(ComponentIn, options, staticExtractionOptions) {
|
|
|
37
37
|
variants,
|
|
38
38
|
defaultProps,
|
|
39
39
|
defaultVariants,
|
|
40
|
-
componentName: name ||
|
|
40
|
+
componentName: name || parentStaticConfig?.componentName,
|
|
41
41
|
isReactNative,
|
|
42
42
|
isText,
|
|
43
43
|
acceptsClassName,
|
|
44
44
|
context,
|
|
45
45
|
...reactNativeConfig,
|
|
46
|
-
isStyledHOC: !!
|
|
47
|
-
|
|
46
|
+
isStyledHOC: !!parentStaticConfig?.isHOC,
|
|
47
|
+
parentStaticConfig
|
|
48
48
|
};
|
|
49
49
|
return (defaultProps.children || !acceptsClassName || context) && (conf.neverFlatten = !0), conf;
|
|
50
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/web",
|
|
3
|
-
"version": "1.89.
|
|
3
|
+
"version": "1.89.2",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -27,20 +27,20 @@
|
|
|
27
27
|
"reset.css"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tamagui/compose-refs": "1.89.
|
|
31
|
-
"@tamagui/constants": "1.89.
|
|
32
|
-
"@tamagui/helpers": "1.89.
|
|
33
|
-
"@tamagui/normalize-css-color": "1.89.
|
|
34
|
-
"@tamagui/timer": "1.89.
|
|
35
|
-
"@tamagui/types": "1.89.
|
|
36
|
-
"@tamagui/use-did-finish-ssr": "1.89.
|
|
37
|
-
"@tamagui/use-event": "1.89.
|
|
38
|
-
"@tamagui/use-force-update": "1.89.
|
|
30
|
+
"@tamagui/compose-refs": "1.89.2",
|
|
31
|
+
"@tamagui/constants": "1.89.2",
|
|
32
|
+
"@tamagui/helpers": "1.89.2",
|
|
33
|
+
"@tamagui/normalize-css-color": "1.89.2",
|
|
34
|
+
"@tamagui/timer": "1.89.2",
|
|
35
|
+
"@tamagui/types": "1.89.2",
|
|
36
|
+
"@tamagui/use-did-finish-ssr": "1.89.2",
|
|
37
|
+
"@tamagui/use-event": "1.89.2",
|
|
38
|
+
"@tamagui/use-force-update": "1.89.2",
|
|
39
39
|
"react": "^18.2.0",
|
|
40
40
|
"react-dom": "^18.2.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@tamagui/build": "1.89.
|
|
43
|
+
"@tamagui/build": "1.89.2",
|
|
44
44
|
"@testing-library/react": "^14.0.0",
|
|
45
45
|
"csstype": "^3.0.10",
|
|
46
46
|
"typescript": "^5.3.3",
|