@stylexjs/shared 0.2.0-beta.11 → 0.2.0-beta.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. package/lib/common-types.d.ts +49 -0
  2. package/lib/common-types.js.flow +64 -0
  3. package/lib/convert-to-className.d.ts +16 -0
  4. package/lib/convert-to-className.js.flow +23 -0
  5. package/lib/generate-css-rule.d.ts +17 -0
  6. package/lib/generate-css-rule.js.flow +17 -0
  7. package/lib/hash.d.ts +11 -0
  8. package/lib/hash.js.flow +12 -0
  9. package/lib/index.d.ts +32 -95
  10. package/lib/index.js.flow +46 -3
  11. package/lib/messages.d.ts +32 -0
  12. package/lib/messages.js.flow +35 -0
  13. package/lib/physical-rtl/generate-ltr.d.ts +12 -0
  14. package/lib/physical-rtl/generate-ltr.js.flow +13 -0
  15. package/lib/physical-rtl/generate-rtl.d.ts +14 -0
  16. package/lib/physical-rtl/generate-rtl.js.flow +13 -0
  17. package/lib/preprocess-rules/PreRule.d.ts +52 -0
  18. package/lib/preprocess-rules/PreRule.js.flow +64 -0
  19. package/lib/preprocess-rules/application-order.d.ts +253 -0
  20. package/lib/preprocess-rules/application-order.js.flow +206 -0
  21. package/lib/preprocess-rules/basic-validation.d.ts +13 -0
  22. package/lib/preprocess-rules/basic-validation.js.flow +13 -0
  23. package/lib/preprocess-rules/flatten-raw-style-obj.d.ts +25 -0
  24. package/lib/preprocess-rules/flatten-raw-style-obj.js.flow +27 -0
  25. package/lib/preprocess-rules/index.d.ts +18 -0
  26. package/lib/preprocess-rules/index.js.flow +19 -0
  27. package/lib/preprocess-rules/legacy-expand-shorthands.d.ts +122 -0
  28. package/lib/preprocess-rules/legacy-expand-shorthands.js +0 -139
  29. package/lib/preprocess-rules/legacy-expand-shorthands.js.flow +101 -0
  30. package/lib/preprocess-rules/property-specificity.d.ts +76 -0
  31. package/lib/preprocess-rules/property-specificity.js.flow +87 -0
  32. package/lib/stylex-create-vars.d.ts +27 -0
  33. package/lib/stylex-create-vars.js.flow +22 -0
  34. package/lib/stylex-create.d.ts +23 -0
  35. package/lib/stylex-create.js.flow +30 -0
  36. package/lib/stylex-first-that-works.d.ts +14 -0
  37. package/lib/stylex-first-that-works.js.flow +13 -0
  38. package/lib/stylex-include.d.ts +19 -0
  39. package/lib/stylex-include.js.flow +21 -0
  40. package/lib/stylex-keyframes.d.ts +17 -0
  41. package/lib/stylex-keyframes.js.flow +20 -0
  42. package/lib/transform-value.d.ts +13 -0
  43. package/lib/transform-value.js.flow +15 -0
  44. package/lib/utils/Rule.d.ts +58 -0
  45. package/lib/utils/Rule.js.flow +64 -0
  46. package/lib/utils/dashify.d.ts +10 -0
  47. package/lib/utils/dashify.js.flow +9 -0
  48. package/lib/utils/default-options.d.ts +10 -0
  49. package/lib/utils/default-options.js.flow +24 -0
  50. package/lib/utils/file-based-identifier.d.ts +14 -0
  51. package/lib/utils/file-based-identifier.js +22 -0
  52. package/lib/utils/file-based-identifier.js.flow +13 -0
  53. package/lib/utils/genCSSRule.d.ts +16 -0
  54. package/lib/utils/genCSSRule.js.flow +16 -0
  55. package/lib/utils/normalize-value.d.ts +12 -0
  56. package/lib/utils/normalize-value.js.flow +14 -0
  57. package/lib/utils/normalizers/detect-unclosed-fns.d.ts +17 -0
  58. package/lib/utils/normalizers/detect-unclosed-fns.js.flow +16 -0
  59. package/lib/utils/normalizers/font-size-px-to-rem.d.ts +19 -0
  60. package/lib/utils/normalizers/font-size-px-to-rem.js +9 -4
  61. package/lib/utils/normalizers/font-size-px-to-rem.js.flow +18 -0
  62. package/lib/utils/normalizers/leading-zero.d.ts +17 -0
  63. package/lib/utils/normalizers/leading-zero.js.flow +16 -0
  64. package/lib/utils/normalizers/quotes.d.ts +19 -0
  65. package/lib/utils/normalizers/quotes.js.flow +18 -0
  66. package/lib/utils/normalizers/timings.d.ts +19 -0
  67. package/lib/utils/normalizers/timings.js.flow +18 -0
  68. package/lib/utils/normalizers/whitespace.d.ts +20 -0
  69. package/lib/utils/normalizers/whitespace.js.flow +19 -0
  70. package/lib/utils/normalizers/zero-dimensions.d.ts +19 -0
  71. package/lib/utils/normalizers/zero-dimensions.js.flow +18 -0
  72. package/lib/utils/object-utils.d.ts +61 -0
  73. package/lib/utils/object-utils.js.flow +81 -0
  74. package/lib/utils/property-priorities.d.ts +11 -0
  75. package/lib/utils/property-priorities.js.flow +10 -0
  76. package/lib/utils/split-css-value.d.ts +15 -0
  77. package/lib/utils/split-css-value.js.flow +16 -0
  78. package/lib/validate.d.ts +12 -0
  79. package/lib/validate.js.flow +12 -0
  80. package/package.json +3 -1
  81. package/lib/expand-shorthands.d.ts +0 -5
  82. package/lib/expand-shorthands.js +0 -330
  83. package/lib/namespace-transforms/__tests__/preflatten.test.js +0 -120
  84. package/lib/namespace-transforms/preflatten.js +0 -89
  85. package/lib/preprocess-rules/expand-shorthands.js +0 -156
  86. package/lib/preprocess-rules/null-out-longhand.js +0 -310
  87. package/lib/preprocess-rules/react-native-web.js +0 -142
  88. package/lib/stylex-defaultValue.js +0 -397
@@ -0,0 +1,253 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ *
8
+ */
9
+
10
+ import type { TStyleValue } from '../common-types';
11
+ /**
12
+ * Shorthand properties:
13
+ * - [x] all - Should be banned
14
+ * - [x] animation
15
+ * - [x] background
16
+ * - [x] border
17
+ * - [x] border-block-end
18
+ * - [x] border-block-start
19
+ * - [x] border-bottom
20
+ * - [x] border-color
21
+ * - [x] border-image
22
+ * - [x] border-inline-end
23
+ * - [x] border-inline-start
24
+ * - [x] border-left
25
+ * - [x] border-radius
26
+ * - [x] border-right
27
+ * - [x] border-style
28
+ * - [x] border-top
29
+ * - [x] border-width
30
+ * - [x] column-rule
31
+ * - [x] columns
32
+ * - [x] container
33
+ * - [x] flex
34
+ * - [x] flex-flow
35
+ * - [x] font
36
+ * - [x] gap
37
+ * - [x] grid
38
+ * - [x] grid-area
39
+ * - [x] grid-column
40
+ * - [x] grid-row
41
+ * - [x] grid-template
42
+ * - [x] inset
43
+ * - [x] inset-block
44
+ * - [x] inset-inline
45
+ * - [x] list-style
46
+ * - [x] margin
47
+ * - [x] mask
48
+ * - [x] offset
49
+ * - [x] outline
50
+ * - [x] overflow
51
+ * - [x] padding
52
+ * - [x] place-content
53
+ * - [x] place-items
54
+ * - [x] place-self
55
+ * - [x] scroll-margin
56
+ * - [x] scroll-padding
57
+ * - [x] text-decoration
58
+ * - [x] text-emphasis
59
+ * - [x] transition
60
+ */
61
+
62
+ /**
63
+ * Shorthand properties:
64
+ * - [x] all - Should be banned
65
+ * - [x] animation
66
+ * - [x] background
67
+ * - [x] border
68
+ * - [x] border-block-end
69
+ * - [x] border-block-start
70
+ * - [x] border-bottom
71
+ * - [x] border-color
72
+ * - [x] border-image
73
+ * - [x] border-inline-end
74
+ * - [x] border-inline-start
75
+ * - [x] border-left
76
+ * - [x] border-radius
77
+ * - [x] border-right
78
+ * - [x] border-style
79
+ * - [x] border-top
80
+ * - [x] border-width
81
+ * - [x] column-rule
82
+ * - [x] columns
83
+ * - [x] container
84
+ * - [x] flex
85
+ * - [x] flex-flow
86
+ * - [x] font
87
+ * - [x] gap
88
+ * - [x] grid
89
+ * - [x] grid-area
90
+ * - [x] grid-column
91
+ * - [x] grid-row
92
+ * - [x] grid-template
93
+ * - [x] inset
94
+ * - [x] inset-block
95
+ * - [x] inset-inline
96
+ * - [x] list-style
97
+ * - [x] margin
98
+ * - [x] mask
99
+ * - [x] offset
100
+ * - [x] outline
101
+ * - [x] overflow
102
+ * - [x] padding
103
+ * - [x] place-content
104
+ * - [x] place-items
105
+ * - [x] place-self
106
+ * - [x] scroll-margin
107
+ * - [x] scroll-padding
108
+ * - [x] text-decoration
109
+ * - [x] text-emphasis
110
+ * - [x] transition
111
+ */
112
+
113
+ type TReturn = ReadonlyArray<[string, TStyleValue]>;
114
+ declare var shorthands: {
115
+ all: (_: TStyleValue) => TReturn;
116
+ animation: (value: TStyleValue) => Array<[string, TStyleValue]>;
117
+ background: (value: TStyleValue) => TReturn;
118
+ border: (rawValue: TStyleValue) => TReturn;
119
+ borderInline: (rawValue: TStyleValue) => TReturn;
120
+ borderBlock: (rawValue: TStyleValue) => TReturn;
121
+ borderTop: (rawValue: TStyleValue) => TReturn;
122
+ borderInlineEnd: (rawValue: TStyleValue) => TReturn;
123
+ borderRight: (_rawValue: TStyleValue) => TReturn;
124
+ borderBottom: (rawValue: TStyleValue) => TReturn;
125
+ borderInlineStart: (rawValue: TStyleValue) => TReturn;
126
+ borderLeft: (_rawValue: TStyleValue) => TReturn;
127
+ borderInlineWidth: (rawValue: TStyleValue) => TReturn;
128
+ borderInlineStyle: (rawValue: TStyleValue) => TReturn;
129
+ borderInlineColor: (rawValue: TStyleValue) => TReturn;
130
+ borderBlockWidth: (rawValue: TStyleValue) => TReturn;
131
+ borderBlockStyle: (rawValue: TStyleValue) => TReturn;
132
+ borderBlockColor: (rawValue: TStyleValue) => TReturn;
133
+ borderColor: (value: TStyleValue) => TReturn;
134
+ borderStyle: (value: TStyleValue) => TReturn;
135
+ borderWidth: (value: TStyleValue) => TReturn;
136
+ borderInlineStartColor: (value: TStyleValue) => TReturn;
137
+ borderInlineEndColor: (value: TStyleValue) => TReturn;
138
+ borderInlineStartStyle: (value: TStyleValue) => TReturn;
139
+ borderInlineEndStyle: (value: TStyleValue) => TReturn;
140
+ borderInlineStartWidth: (value: TStyleValue) => TReturn;
141
+ borderInlineEndWidth: (value: TStyleValue) => TReturn;
142
+ borderLeftColor: (value: TStyleValue) => TReturn;
143
+ borderRightColor: (value: TStyleValue) => TReturn;
144
+ borderLeftStyle: (value: TStyleValue) => TReturn;
145
+ borderRightStyle: (value: TStyleValue) => TReturn;
146
+ borderLeftWidth: (value: TStyleValue) => TReturn;
147
+ borderRightWidth: (value: TStyleValue) => TReturn;
148
+ borderRadius: (value: TStyleValue) => TReturn;
149
+ borderStartStartRadius: (value: TStyleValue) => TReturn;
150
+ borderStartEndRadius: (value: TStyleValue) => TReturn;
151
+ borderEndStartRadius: (value: TStyleValue) => TReturn;
152
+ borderEndEndRadius: (value: TStyleValue) => TReturn;
153
+ borderTopLeftRadius: (value: TStyleValue) => TReturn;
154
+ borderTopRightRadius: (value: TStyleValue) => TReturn;
155
+ borderBottomLeftRadius: (value: TStyleValue) => TReturn;
156
+ borderBottomRightRadius: (value: TStyleValue) => TReturn;
157
+ columnRule: (value: TStyleValue) => TReturn;
158
+ columns: (value: TStyleValue) => TReturn;
159
+ container: (value: TStyleValue) => TReturn;
160
+ flex: (value: TStyleValue) => TReturn;
161
+ flexFlow: (value: TStyleValue) => TReturn;
162
+ font: (value: TStyleValue) => TReturn;
163
+ gap: (value: TStyleValue) => TReturn;
164
+ grid: (value: TStyleValue) => TReturn;
165
+ gridArea: (value: TStyleValue) => TReturn;
166
+ gridRow: (value: TStyleValue) => TReturn;
167
+ gridColumn: (value: TStyleValue) => TReturn;
168
+ gridTemplate: (value: TStyleValue) => TReturn;
169
+ inset: (value: TStyleValue) => TReturn;
170
+ insetInline: (value: TStyleValue) => TReturn;
171
+ insetBlock: (value: TStyleValue) => TReturn;
172
+ insetInlineStart: (value: TStyleValue) => TReturn;
173
+ insetInlineEnd: (value: TStyleValue) => TReturn;
174
+ left: (value: TStyleValue) => TReturn;
175
+ right: (value: TStyleValue) => TReturn;
176
+ listStyle: (value: TStyleValue) => TReturn;
177
+ margin: (value: TStyleValue) => TReturn;
178
+ marginInline: (value: TStyleValue) => TReturn;
179
+ marginBlock: (value: TStyleValue) => TReturn;
180
+ marginInlineStart: (value: TStyleValue) => TReturn;
181
+ marginInlineEnd: (value: TStyleValue) => TReturn;
182
+ marginLeft: (value: TStyleValue) => TReturn;
183
+ marginRight: (value: TStyleValue) => TReturn;
184
+ mask: (value: TStyleValue) => TReturn;
185
+ offset: (value: TStyleValue) => TReturn;
186
+ outline: (value: TStyleValue) => TReturn;
187
+ overflow: (value: TStyleValue) => TReturn;
188
+ padding: (rawValue: TStyleValue) => TReturn;
189
+ paddingInline: (rawValue: TStyleValue) => TReturn;
190
+ paddingBlock: (rawValue: TStyleValue) => TReturn;
191
+ paddingInlineStart: (value: TStyleValue) => TReturn;
192
+ paddingInlineEnd: (value: TStyleValue) => TReturn;
193
+ paddingLeft: (value: TStyleValue) => TReturn;
194
+ paddingRight: (value: TStyleValue) => TReturn;
195
+ placeContent: (value: TStyleValue) => TReturn;
196
+ placeItems: (value: TStyleValue) => TReturn;
197
+ placeSelf: (value: TStyleValue) => TReturn;
198
+ scrollMargin: (value: TStyleValue) => TReturn;
199
+ scrollPadding: (value: TStyleValue) => TReturn;
200
+ scrollTimeline: (value: TStyleValue) => TReturn;
201
+ textDecoration: (value: TStyleValue) => TReturn;
202
+ textEmphasis: (value: TStyleValue) => TReturn;
203
+ transition: (value: TStyleValue) => TReturn;
204
+ };
205
+ declare var aliases: {
206
+ borderHorizontal: any;
207
+ borderVertical: any;
208
+ borderBlockStart: any;
209
+ borderEnd: any;
210
+ borderBlockEnd: any;
211
+ borderStart: any;
212
+ borderHorizontalWidth: any;
213
+ borderHorizontalStyle: any;
214
+ borderHorizontalColor: any;
215
+ borderVerticalWidth: any;
216
+ borderVerticalStyle: any;
217
+ borderVerticalColor: any;
218
+ borderBlockStartColor: (value: TStyleValue) => TReturn;
219
+ borderBlockEndColor: (value: TStyleValue) => TReturn;
220
+ borderBlockStartStyle: (value: TStyleValue) => TReturn;
221
+ borderBlockEndStyle: (value: TStyleValue) => TReturn;
222
+ borderBlockStartWidth: (value: TStyleValue) => TReturn;
223
+ borderBlockEndWidth: (value: TStyleValue) => TReturn;
224
+ borderStartColor: any;
225
+ borderEndColor: any;
226
+ borderStartStyle: any;
227
+ borderEndStyle: any;
228
+ borderStartWidth: any;
229
+ borderEndWidth: any;
230
+ borderTopStartRadius: (value: TStyleValue) => TReturn;
231
+ borderTopEndRadius: (value: TStyleValue) => TReturn;
232
+ borderBottomStartRadius: (value: TStyleValue) => TReturn;
233
+ borderBottomEndRadius: (value: TStyleValue) => TReturn;
234
+ marginBlockStart: (value: TStyleValue) => TReturn;
235
+ marginBlockEnd: (value: TStyleValue) => TReturn;
236
+ marginStart: any;
237
+ marginEnd: any;
238
+ marginHorizontal: any;
239
+ marginVertical: any;
240
+ paddingBlockStart: (rawValue: TStyleValue) => TReturn;
241
+ paddingBlockEnd: (rawValue: TStyleValue) => TReturn;
242
+ paddingStart: any;
243
+ paddingEnd: any;
244
+ paddingHorizontal: any;
245
+ paddingVertical: any;
246
+ insetBlockStart: (value: TStyleValue) => TReturn;
247
+ insetBlockEnd: (value: TStyleValue) => TReturn;
248
+ start: any;
249
+ end: any;
250
+ };
251
+ declare var expansions: Omit<shorthands, keyof (aliases | {})> &
252
+ Omit<aliases, keyof ({})> & {};
253
+ export default expansions;
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ */
9
+
10
+ import type { TStyleValue } from '../common-types';
11
+
12
+ /**
13
+ * Shorthand properties:
14
+ * - [x] all - Should be banned
15
+ * - [x] animation
16
+ * - [x] background
17
+ * - [x] border
18
+ * - [x] border-block-end
19
+ * - [x] border-block-start
20
+ * - [x] border-bottom
21
+ * - [x] border-color
22
+ * - [x] border-image
23
+ * - [x] border-inline-end
24
+ * - [x] border-inline-start
25
+ * - [x] border-left
26
+ * - [x] border-radius
27
+ * - [x] border-right
28
+ * - [x] border-style
29
+ * - [x] border-top
30
+ * - [x] border-width
31
+ * - [x] column-rule
32
+ * - [x] columns
33
+ * - [x] container
34
+ * - [x] flex
35
+ * - [x] flex-flow
36
+ * - [x] font
37
+ * - [x] gap
38
+ * - [x] grid
39
+ * - [x] grid-area
40
+ * - [x] grid-column
41
+ * - [x] grid-row
42
+ * - [x] grid-template
43
+ * - [x] inset
44
+ * - [x] inset-block
45
+ * - [x] inset-inline
46
+ * - [x] list-style
47
+ * - [x] margin
48
+ * - [x] mask
49
+ * - [x] offset
50
+ * - [x] outline
51
+ * - [x] overflow
52
+ * - [x] padding
53
+ * - [x] place-content
54
+ * - [x] place-items
55
+ * - [x] place-self
56
+ * - [x] scroll-margin
57
+ * - [x] scroll-padding
58
+ * - [x] text-decoration
59
+ * - [x] text-emphasis
60
+ * - [x] transition
61
+ */
62
+
63
+ type TReturn = $ReadOnlyArray<[string, TStyleValue]>;
64
+
65
+ declare var shorthands: {
66
+ all: (_: TStyleValue) => TReturn,
67
+ animation: (value: TStyleValue) => Array<[string, TStyleValue]>,
68
+ background: (value: TStyleValue) => TReturn,
69
+ border: (rawValue: TStyleValue) => TReturn,
70
+ borderInline: (rawValue: TStyleValue) => TReturn,
71
+ borderBlock: (rawValue: TStyleValue) => TReturn,
72
+ borderTop: (rawValue: TStyleValue) => TReturn,
73
+ borderInlineEnd: (rawValue: TStyleValue) => TReturn,
74
+ borderRight: (_rawValue: TStyleValue) => TReturn,
75
+ borderBottom: (rawValue: TStyleValue) => TReturn,
76
+ borderInlineStart: (rawValue: TStyleValue) => TReturn,
77
+ borderLeft: (_rawValue: TStyleValue) => TReturn,
78
+ borderInlineWidth: (rawValue: TStyleValue) => TReturn,
79
+ borderInlineStyle: (rawValue: TStyleValue) => TReturn,
80
+ borderInlineColor: (rawValue: TStyleValue) => TReturn,
81
+ borderBlockWidth: (rawValue: TStyleValue) => TReturn,
82
+ borderBlockStyle: (rawValue: TStyleValue) => TReturn,
83
+ borderBlockColor: (rawValue: TStyleValue) => TReturn,
84
+ borderColor: (value: TStyleValue) => TReturn,
85
+ borderStyle: (value: TStyleValue) => TReturn,
86
+ borderWidth: (value: TStyleValue) => TReturn,
87
+ borderInlineStartColor: (value: TStyleValue) => TReturn,
88
+ borderInlineEndColor: (value: TStyleValue) => TReturn,
89
+ borderInlineStartStyle: (value: TStyleValue) => TReturn,
90
+ borderInlineEndStyle: (value: TStyleValue) => TReturn,
91
+ borderInlineStartWidth: (value: TStyleValue) => TReturn,
92
+ borderInlineEndWidth: (value: TStyleValue) => TReturn,
93
+ borderLeftColor: (value: TStyleValue) => TReturn,
94
+ borderRightColor: (value: TStyleValue) => TReturn,
95
+ borderLeftStyle: (value: TStyleValue) => TReturn,
96
+ borderRightStyle: (value: TStyleValue) => TReturn,
97
+ borderLeftWidth: (value: TStyleValue) => TReturn,
98
+ borderRightWidth: (value: TStyleValue) => TReturn,
99
+ borderRadius: (value: TStyleValue) => TReturn,
100
+ borderStartStartRadius: (value: TStyleValue) => TReturn,
101
+ borderStartEndRadius: (value: TStyleValue) => TReturn,
102
+ borderEndStartRadius: (value: TStyleValue) => TReturn,
103
+ borderEndEndRadius: (value: TStyleValue) => TReturn,
104
+ borderTopLeftRadius: (value: TStyleValue) => TReturn,
105
+ borderTopRightRadius: (value: TStyleValue) => TReturn,
106
+ borderBottomLeftRadius: (value: TStyleValue) => TReturn,
107
+ borderBottomRightRadius: (value: TStyleValue) => TReturn,
108
+ columnRule: (value: TStyleValue) => TReturn,
109
+ columns: (value: TStyleValue) => TReturn,
110
+ container: (value: TStyleValue) => TReturn,
111
+ flex: (value: TStyleValue) => TReturn,
112
+ flexFlow: (value: TStyleValue) => TReturn,
113
+ font: (value: TStyleValue) => TReturn,
114
+ gap: (value: TStyleValue) => TReturn,
115
+ grid: (value: TStyleValue) => TReturn,
116
+ gridArea: (value: TStyleValue) => TReturn,
117
+ gridRow: (value: TStyleValue) => TReturn,
118
+ gridColumn: (value: TStyleValue) => TReturn,
119
+ gridTemplate: (value: TStyleValue) => TReturn,
120
+ inset: (value: TStyleValue) => TReturn,
121
+ insetInline: (value: TStyleValue) => TReturn,
122
+ insetBlock: (value: TStyleValue) => TReturn,
123
+ insetInlineStart: (value: TStyleValue) => TReturn,
124
+ insetInlineEnd: (value: TStyleValue) => TReturn,
125
+ left: (value: TStyleValue) => TReturn,
126
+ right: (value: TStyleValue) => TReturn,
127
+ listStyle: (value: TStyleValue) => TReturn,
128
+ margin: (value: TStyleValue) => TReturn,
129
+ marginInline: (value: TStyleValue) => TReturn,
130
+ marginBlock: (value: TStyleValue) => TReturn,
131
+ marginInlineStart: (value: TStyleValue) => TReturn,
132
+ marginInlineEnd: (value: TStyleValue) => TReturn,
133
+ marginLeft: (value: TStyleValue) => TReturn,
134
+ marginRight: (value: TStyleValue) => TReturn,
135
+ mask: (value: TStyleValue) => TReturn,
136
+ offset: (value: TStyleValue) => TReturn,
137
+ outline: (value: TStyleValue) => TReturn,
138
+ overflow: (value: TStyleValue) => TReturn,
139
+ padding: (rawValue: TStyleValue) => TReturn,
140
+ paddingInline: (rawValue: TStyleValue) => TReturn,
141
+ paddingBlock: (rawValue: TStyleValue) => TReturn,
142
+ paddingInlineStart: (value: TStyleValue) => TReturn,
143
+ paddingInlineEnd: (value: TStyleValue) => TReturn,
144
+ paddingLeft: (value: TStyleValue) => TReturn,
145
+ paddingRight: (value: TStyleValue) => TReturn,
146
+ placeContent: (value: TStyleValue) => TReturn,
147
+ placeItems: (value: TStyleValue) => TReturn,
148
+ placeSelf: (value: TStyleValue) => TReturn,
149
+ scrollMargin: (value: TStyleValue) => TReturn,
150
+ scrollPadding: (value: TStyleValue) => TReturn,
151
+ scrollTimeline: (value: TStyleValue) => TReturn,
152
+ textDecoration: (value: TStyleValue) => TReturn,
153
+ textEmphasis: (value: TStyleValue) => TReturn,
154
+ transition: (value: TStyleValue) => TReturn,
155
+ };
156
+
157
+ declare var aliases: {
158
+ borderHorizontal: $FlowFixMe,
159
+ borderVertical: $FlowFixMe,
160
+ borderBlockStart: $FlowFixMe,
161
+ borderEnd: $FlowFixMe,
162
+ borderBlockEnd: $FlowFixMe,
163
+ borderStart: $FlowFixMe,
164
+ borderHorizontalWidth: $FlowFixMe,
165
+ borderHorizontalStyle: $FlowFixMe,
166
+ borderHorizontalColor: $FlowFixMe,
167
+ borderVerticalWidth: $FlowFixMe,
168
+ borderVerticalStyle: $FlowFixMe,
169
+ borderVerticalColor: $FlowFixMe,
170
+ borderBlockStartColor: (value: TStyleValue) => TReturn,
171
+ borderBlockEndColor: (value: TStyleValue) => TReturn,
172
+ borderBlockStartStyle: (value: TStyleValue) => TReturn,
173
+ borderBlockEndStyle: (value: TStyleValue) => TReturn,
174
+ borderBlockStartWidth: (value: TStyleValue) => TReturn,
175
+ borderBlockEndWidth: (value: TStyleValue) => TReturn,
176
+ borderStartColor: $FlowFixMe,
177
+ borderEndColor: $FlowFixMe,
178
+ borderStartStyle: $FlowFixMe,
179
+ borderEndStyle: $FlowFixMe,
180
+ borderStartWidth: $FlowFixMe,
181
+ borderEndWidth: $FlowFixMe,
182
+ borderTopStartRadius: (value: TStyleValue) => TReturn,
183
+ borderTopEndRadius: (value: TStyleValue) => TReturn,
184
+ borderBottomStartRadius: (value: TStyleValue) => TReturn,
185
+ borderBottomEndRadius: (value: TStyleValue) => TReturn,
186
+ marginBlockStart: (value: TStyleValue) => TReturn,
187
+ marginBlockEnd: (value: TStyleValue) => TReturn,
188
+ marginStart: $FlowFixMe,
189
+ marginEnd: $FlowFixMe,
190
+ marginHorizontal: $FlowFixMe,
191
+ marginVertical: $FlowFixMe,
192
+ paddingBlockStart: (rawValue: TStyleValue) => TReturn,
193
+ paddingBlockEnd: (rawValue: TStyleValue) => TReturn,
194
+ paddingStart: $FlowFixMe,
195
+ paddingEnd: $FlowFixMe,
196
+ paddingHorizontal: $FlowFixMe,
197
+ paddingVertical: $FlowFixMe,
198
+ insetBlockStart: (value: TStyleValue) => TReturn,
199
+ insetBlockEnd: (value: TStyleValue) => TReturn,
200
+ start: $FlowFixMe,
201
+ end: $FlowFixMe,
202
+ };
203
+
204
+ declare var expansions: { ...shorthands, ...aliases };
205
+
206
+ declare export default expansions;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ *
8
+ */
9
+
10
+ export declare function validateNamespace(
11
+ namespace: unknown,
12
+ conditions: ReadonlyArray<string>
13
+ ): void;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ */
9
+
10
+ declare export function validateNamespace(
11
+ namespace: mixed,
12
+ conditions: $ReadOnlyArray<string>
13
+ ): void;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ *
8
+ */
9
+
10
+ import type { RawStyles, StyleXOptions } from '../common-types';
11
+ import {
12
+ type AnyPreRule,
13
+ type IPreRule,
14
+ PreIncludedStylesRule,
15
+ } from './PreRule';
16
+ export declare function flattenRawStyleObject(
17
+ style: RawStyles,
18
+ options: StyleXOptions
19
+ ): ReadonlyArray<Readonly<[string, IPreRule]>>;
20
+ export declare function _flattenRawStyleObject(
21
+ style: RawStyles,
22
+ pseudos: ReadonlyArray<string>,
23
+ atRules: ReadonlyArray<string>,
24
+ options: StyleXOptions
25
+ ): Array<Readonly<[string, AnyPreRule | PreIncludedStylesRule]>>;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ */
9
+
10
+ import type { RawStyles, StyleXOptions } from '../common-types';
11
+
12
+ import {
13
+ type AnyPreRule,
14
+ type IPreRule,
15
+ PreIncludedStylesRule,
16
+ } from './PreRule';
17
+ declare export function flattenRawStyleObject(
18
+ style: RawStyles,
19
+ options: StyleXOptions
20
+ ): $ReadOnlyArray<$ReadOnly<[string, IPreRule]>>;
21
+
22
+ declare export function _flattenRawStyleObject(
23
+ style: RawStyles,
24
+ pseudos: $ReadOnlyArray<string>,
25
+ atRules: $ReadOnlyArray<string>,
26
+ options: StyleXOptions
27
+ ): Array<$ReadOnly<[string, AnyPreRule | PreIncludedStylesRule]>>;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ *
8
+ */
9
+
10
+ import type { StyleXOptions, TStyleValue } from '../common-types';
11
+ export declare function getExpandedKeys(
12
+ options: StyleXOptions
13
+ ): ReadonlyArray<string>;
14
+ declare function flatMapExpandedShorthands(
15
+ objEntry: Readonly<[string, TStyleValue]>,
16
+ options: StyleXOptions
17
+ ): ReadonlyArray<[string, TStyleValue]>;
18
+ export default flatMapExpandedShorthands;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ */
9
+
10
+ import type { StyleXOptions, TStyleValue } from '../common-types';
11
+
12
+ declare export function getExpandedKeys(
13
+ options: StyleXOptions
14
+ ): $ReadOnlyArray<string>;
15
+
16
+ declare export default function flatMapExpandedShorthands(
17
+ objEntry: $ReadOnly<[string, TStyleValue]>,
18
+ options: StyleXOptions
19
+ ): $ReadOnlyArray<[string, TStyleValue]>;
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ *
8
+ */
9
+
10
+ import type { TStyleValue } from '../common-types';
11
+ /**
12
+ * Shorthand properties:
13
+ * - [x] all - Should be banned
14
+ * - [ ] animation
15
+ * - [ ] background
16
+ * - [-] border
17
+ * - [x] border-block-end
18
+ * - [x] border-block-start
19
+ * - [ ] border-bottom
20
+ * - [x] border-color
21
+ * - [x] border-image
22
+ * - [x] border-inline-end
23
+ * - [x] border-inline-start
24
+ * - [ ] border-left
25
+ * - [x] border-radius
26
+ * - [ ] border-right
27
+ * - [x] border-style
28
+ * - [ ] border-top
29
+ * - [x] border-width
30
+ * - [ ] column-rule
31
+ * - [ ] columns
32
+ * - [ ] flex
33
+ * - [ ] flex-flow
34
+ * - [ ] font
35
+ * - [ ] gap
36
+ * - [ ] grid
37
+ * - [ ] grid-area
38
+ * - [ ] grid-column
39
+ * - [ ] grid-row
40
+ * - [ ] grid-template
41
+ * - [ ] list-style
42
+ * - [x] margin
43
+ * - [ ] mask
44
+ * - [ ] offset
45
+ * - [ ] outline
46
+ * - [x] overflow
47
+ * - [x] padding
48
+ * - [ ] place-content
49
+ * - [ ] place-items
50
+ * - [ ] place-self
51
+ * - [ ] scroll-margin
52
+ * - [ ] scroll-padding
53
+ * - [ ] text-decoration
54
+ * - [ ] text-emphasis
55
+ * - [ ] transition
56
+ */
57
+
58
+ /**
59
+ * Shorthand properties:
60
+ * - [x] all - Should be banned
61
+ * - [ ] animation
62
+ * - [ ] background
63
+ * - [-] border
64
+ * - [x] border-block-end
65
+ * - [x] border-block-start
66
+ * - [ ] border-bottom
67
+ * - [x] border-color
68
+ * - [x] border-image
69
+ * - [x] border-inline-end
70
+ * - [x] border-inline-start
71
+ * - [ ] border-left
72
+ * - [x] border-radius
73
+ * - [ ] border-right
74
+ * - [x] border-style
75
+ * - [ ] border-top
76
+ * - [x] border-width
77
+ * - [ ] column-rule
78
+ * - [ ] columns
79
+ * - [ ] flex
80
+ * - [ ] flex-flow
81
+ * - [ ] font
82
+ * - [ ] gap
83
+ * - [ ] grid
84
+ * - [ ] grid-area
85
+ * - [ ] grid-column
86
+ * - [ ] grid-row
87
+ * - [ ] grid-template
88
+ * - [ ] list-style
89
+ * - [x] margin
90
+ * - [ ] mask
91
+ * - [ ] offset
92
+ * - [ ] outline
93
+ * - [x] overflow
94
+ * - [x] padding
95
+ * - [ ] place-content
96
+ * - [ ] place-items
97
+ * - [ ] place-self
98
+ * - [ ] scroll-margin
99
+ * - [ ] scroll-padding
100
+ * - [ ] text-decoration
101
+ * - [ ] text-emphasis
102
+ * - [ ] transition
103
+ */
104
+
105
+ type TReturn = ReadonlyArray<[string, TStyleValue]>;
106
+ declare var expansions: {
107
+ border: (rawValue: TStyleValue) => TReturn;
108
+ borderColor: (rawValue: TStyleValue) => TReturn;
109
+ borderHorizontal: (rawValue: TStyleValue) => TReturn;
110
+ borderStyle: (rawValue: TStyleValue) => TReturn;
111
+ borderVertical: (rawValue: TStyleValue) => TReturn;
112
+ borderWidth: (rawValue: TStyleValue) => TReturn;
113
+ borderRadius: (rawValue: TStyleValue) => TReturn;
114
+ margin: (rawValue: TStyleValue) => TReturn;
115
+ marginHorizontal: (rawValue: TStyleValue) => TReturn;
116
+ marginVertical: (rawValue: TStyleValue) => TReturn;
117
+ overflow: (rawValue: TStyleValue) => TReturn;
118
+ padding: (rawValue: TStyleValue) => TReturn;
119
+ paddingHorizontal: (rawValue: TStyleValue) => TReturn;
120
+ paddingVertical: (rawValue: TStyleValue) => TReturn;
121
+ };
122
+ export default expansions;