@stylexjs/stylex 0.2.0-beta.19 → 0.2.0-beta.21
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/lib/StyleXCSSTypes.d.ts +396 -9
- package/lib/StyleXCSSTypes.js.flow +397 -391
- package/lib/StyleXTypes.d.ts +156 -100
- package/lib/StyleXTypes.js.flow +125 -88
- package/lib/native/CSSCustomPropertyValue.d.ts +14 -2
- package/lib/native/CSSCustomPropertyValue.js +12 -10
- package/lib/native/CSSCustomPropertyValue.js.flow +14 -2
- package/lib/native/CSSLengthUnitValue.d.ts +3 -7
- package/lib/native/CSSLengthUnitValue.js +8 -2
- package/lib/native/CSSLengthUnitValue.js.flow +4 -7
- package/lib/native/SpreadOptions.d.ts +18 -0
- package/lib/native/SpreadOptions.js +1 -0
- package/lib/native/SpreadOptions.js.flow +18 -0
- package/lib/native/__tests__/__snapshots__/stylex-css-var-test.js.snap +48 -0
- package/lib/native/__tests__/__snapshots__/stylex-test.js.snap +570 -51
- package/lib/native/__tests__/stylex-css-var-test.js +148 -0
- package/lib/native/__tests__/stylex-test.js +325 -32
- package/lib/native/fixContentBox.d.ts +11 -0
- package/lib/native/fixContentBox.js +59 -0
- package/lib/native/fixContentBox.js.flow +11 -0
- package/lib/native/stylex.d.ts +3 -13
- package/lib/native/stylex.js +173 -73
- package/lib/native/stylex.js.flow +3 -10
- package/lib/stylex.d.ts +54 -1
- package/lib/stylex.js +48 -4
- package/lib/stylex.js.flow +52 -2
- package/package.json +3 -3
package/lib/stylex.js.flow
CHANGED
|
@@ -44,6 +44,56 @@ declare export const unstable_overrideVars: StyleX$OverrideVars;
|
|
|
44
44
|
|
|
45
45
|
declare export const include: Stylex$Include;
|
|
46
46
|
|
|
47
|
+
type ValueWithDefault<+T> =
|
|
48
|
+
| T
|
|
49
|
+
| $ReadOnly<{
|
|
50
|
+
+default: T,
|
|
51
|
+
+[string]: ValueWithDefault<T>,
|
|
52
|
+
}>;
|
|
53
|
+
|
|
54
|
+
type CSSSyntax =
|
|
55
|
+
| '*'
|
|
56
|
+
| '<length>'
|
|
57
|
+
| '<number>'
|
|
58
|
+
| '<percentage>'
|
|
59
|
+
| '<length-percentage>'
|
|
60
|
+
| '<color>'
|
|
61
|
+
| '<image>'
|
|
62
|
+
| '<url>'
|
|
63
|
+
| '<integer>'
|
|
64
|
+
| '<angle>'
|
|
65
|
+
| '<time>'
|
|
66
|
+
| '<resolution>'
|
|
67
|
+
| '<transform-function>'
|
|
68
|
+
| '<custom-ident>'
|
|
69
|
+
| '<transform-list>';
|
|
70
|
+
|
|
71
|
+
type CSSSyntaxType = CSSSyntax | $ReadOnlyArray<CSSSyntax>;
|
|
72
|
+
|
|
73
|
+
interface ICSSType<+T: string | number> {
|
|
74
|
+
+value: ValueWithDefault<T>;
|
|
75
|
+
+syntax: CSSSyntaxType;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare export const types: {
|
|
79
|
+
angle: <T: number | string>(_v: ValueWithDefault<T>) => ICSSType<T>,
|
|
80
|
+
color: <T: number | string>(_v: ValueWithDefault<T>) => ICSSType<T>,
|
|
81
|
+
url: <T: number | string>(_v: ValueWithDefault<T>) => ICSSType<T>,
|
|
82
|
+
image: <T: number | string>(_v: ValueWithDefault<T>) => ICSSType<T>,
|
|
83
|
+
integer: <T: number | string>(_v: ValueWithDefault<T>) => ICSSType<T>,
|
|
84
|
+
lengthPercentage: <T: number | string>(
|
|
85
|
+
_v: ValueWithDefault<T>,
|
|
86
|
+
) => ICSSType<T>,
|
|
87
|
+
length: <T: number | string>(_v: ValueWithDefault<T>) => ICSSType<T>,
|
|
88
|
+
percentage: <T: number | string>(_v: ValueWithDefault<T>) => ICSSType<T>,
|
|
89
|
+
number: <T: number | string>(_v: ValueWithDefault<T>) => ICSSType<T>,
|
|
90
|
+
resolution: <T: number | string>(_v: ValueWithDefault<T>) => ICSSType<T>,
|
|
91
|
+
time: <T: number | string>(_v: ValueWithDefault<T>) => ICSSType<T>,
|
|
92
|
+
transformFunction: <T: number | string>(
|
|
93
|
+
_v: ValueWithDefault<T>,
|
|
94
|
+
) => ICSSType<T>,
|
|
95
|
+
transformList: <T: number | string>(_v: ValueWithDefault<T>) => ICSSType<T>,
|
|
96
|
+
};
|
|
47
97
|
declare export const keyframes: (_keyframes: Keyframes) => string;
|
|
48
98
|
|
|
49
99
|
declare export const firstThatWorks: <T: string | number>(
|
|
@@ -71,6 +121,7 @@ type IStyleX = {
|
|
|
71
121
|
unstable_createVars: StyleX$CreateVars,
|
|
72
122
|
unstable_overrideVars: StyleX$OverrideVars,
|
|
73
123
|
include: Stylex$Include,
|
|
124
|
+
types: typeof types,
|
|
74
125
|
firstThatWorks: <T: string | number>(
|
|
75
126
|
...v: $ReadOnlyArray<T>
|
|
76
127
|
) => $ReadOnlyArray<T>,
|
|
@@ -80,6 +131,5 @@ type IStyleX = {
|
|
|
80
131
|
...
|
|
81
132
|
};
|
|
82
133
|
|
|
83
|
-
declare export default IStyleX;
|
|
84
|
-
|
|
85
134
|
declare export const stylex: IStyleX;
|
|
135
|
+
declare export default IStyleX;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stylexjs/stylex",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.21",
|
|
4
4
|
"description": "A library for defining styles for optimized user interfaces.",
|
|
5
5
|
"main": "lib/stylex.js",
|
|
6
6
|
"react-native": "lib/native/stylex.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"prebuild": "gen-types -i src/ -o lib/",
|
|
12
12
|
"build": "babel src/ --out-dir lib/ --copy-files",
|
|
13
|
-
"build-haste": "
|
|
13
|
+
"build-haste": "rewrite-imports -i src/ -o lib/",
|
|
14
14
|
"test": "jest"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"utility-types": "^3.10.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@stylexjs/scripts": "0.2.0-beta.
|
|
23
|
+
"@stylexjs/scripts": "0.2.0-beta.21"
|
|
24
24
|
},
|
|
25
25
|
"jest": {},
|
|
26
26
|
"files": [
|