@stylexjs/babel-plugin 0.16.3 → 0.17.1

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.
Files changed (61) hide show
  1. package/lib/index.js +994 -1837
  2. package/lib/index.js.flow +1 -0
  3. package/lib/shared/common-types.d.ts +1 -0
  4. package/lib/shared/common-types.js.flow +9 -0
  5. package/lib/shared/hash.d.ts +3 -0
  6. package/lib/shared/index.d.ts +13 -1
  7. package/lib/shared/index.js.flow +1 -1
  8. package/lib/shared/messages.d.ts +32 -0
  9. package/lib/shared/physical-rtl/generate-ltr.d.ts +1 -1
  10. package/lib/shared/physical-rtl/generate-ltr.js.flow +1 -1
  11. package/lib/shared/physical-rtl/generate-rtl.d.ts +1 -1
  12. package/lib/shared/physical-rtl/generate-rtl.js.flow +1 -1
  13. package/lib/shared/preprocess-rules/application-order.d.ts +35 -34
  14. package/lib/shared/preprocess-rules/application-order.js.flow +35 -29
  15. package/lib/shared/preprocess-rules/basic-validation.d.ts +1 -1
  16. package/lib/shared/preprocess-rules/basic-validation.js.flow +1 -1
  17. package/lib/shared/preprocess-rules/legacy-expand-shorthands.d.ts +26 -15
  18. package/lib/shared/preprocess-rules/legacy-expand-shorthands.js.flow +19 -14
  19. package/lib/shared/preprocess-rules/property-specificity.d.ts +12 -11
  20. package/lib/shared/preprocess-rules/property-specificity.js.flow +12 -6
  21. package/lib/shared/stylex-define-consts.d.ts +1 -1
  22. package/lib/shared/stylex-keyframes.d.ts +1 -1
  23. package/lib/shared/stylex-keyframes.js.flow +1 -1
  24. package/lib/shared/stylex-position-try.d.ts +1 -1
  25. package/lib/shared/stylex-position-try.js.flow +1 -1
  26. package/lib/shared/stylex-vars-utils.d.ts +2 -2
  27. package/lib/shared/stylex-vars-utils.js.flow +3 -3
  28. package/lib/shared/stylex-view-transition-class.d.ts +1 -1
  29. package/lib/shared/stylex-view-transition-class.js.flow +1 -1
  30. package/lib/shared/types/index.d.ts +14 -0
  31. package/lib/shared/types/index.js.flow +1 -1
  32. package/lib/shared/utils/convert-to-className.d.ts +1 -1
  33. package/lib/shared/utils/convert-to-className.js.flow +1 -1
  34. package/lib/shared/utils/default-options.d.ts +1 -0
  35. package/lib/shared/utils/file-based-identifier.js.flow +1 -1
  36. package/lib/shared/utils/generate-css-rule.d.ts +1 -1
  37. package/lib/shared/utils/generate-css-rule.js.flow +1 -1
  38. package/lib/shared/utils/normalize-value.js.flow +1 -1
  39. package/lib/shared/utils/object-utils.d.ts +10 -8
  40. package/lib/shared/utils/object-utils.js.flow +2 -2
  41. package/lib/shared/utils/rule-utils.d.ts +2 -0
  42. package/lib/shared/utils/transform-value.d.ts +2 -0
  43. package/lib/shared/validate.js.flow +3 -1
  44. package/lib/shared/when/when.d.ts +10 -10
  45. package/lib/shared/when/when.js.flow +10 -10
  46. package/lib/utils/evaluate-path.d.ts +3 -2
  47. package/lib/utils/evaluate-path.js.flow +3 -2
  48. package/lib/utils/evaluation-errors.d.ts +15 -0
  49. package/lib/utils/js-to-ast.d.ts +0 -4
  50. package/lib/utils/js-to-ast.js.flow +0 -6
  51. package/lib/utils/state-manager.d.ts +41 -35
  52. package/lib/utils/state-manager.js.flow +5 -0
  53. package/lib/utils/validate.d.ts +18 -3
  54. package/lib/utils/validate.js.flow +5 -3
  55. package/lib/visitors/parse-stylex-create-arg.d.ts +1 -1
  56. package/lib/visitors/parse-stylex-create-arg.js.flow +1 -1
  57. package/lib/visitors/stylex-default-target.d.ts +20 -0
  58. package/lib/visitors/stylex-default-target.js.flow +21 -0
  59. package/lib/visitors/stylex-define-marker.d.ts +22 -0
  60. package/lib/visitors/stylex-define-marker.js.flow +22 -0
  61. package/package.json +5 -4
package/lib/index.js.flow CHANGED
@@ -45,6 +45,7 @@ export type Rule = [
45
45
  },
46
46
  number,
47
47
  ];
48
+
48
49
  declare function processStylexRules(
49
50
  rules: Array<Rule>,
50
51
  config?:
@@ -55,6 +55,7 @@ export type StyleXOptions = Readonly<{
55
55
  | 'property-specificity'
56
56
  | 'legacy-expand-shorthands';
57
57
  test: boolean;
58
+ ...
58
59
  }>;
59
60
  export type MutableCompiledNamespaces = { [key: string]: FlatCompiledStyles };
60
61
  export type CompiledNamespaces = Readonly<MutableCompiledNamespaces>;
@@ -52,11 +52,20 @@ export type StyleXOptions = $ReadOnly<{
52
52
  enableDebugDataProp?: ?boolean,
53
53
  enableDevClassNames?: ?boolean,
54
54
  enableFontSizePxToRem?: ?boolean,
55
+ enableInlinedConditionalMerge?: ?boolean,
55
56
  enableMediaQueryOrder?: ?boolean,
56
57
  enableLegacyValueFlipping?: ?boolean,
57
58
  enableLogicalStylesPolyfill?: ?boolean,
58
59
  enableLTRRTLComments?: ?boolean,
59
60
  enableMinifiedKeys?: ?boolean,
61
+ // runtimeInjection?:
62
+ // | boolean
63
+ // | ?string
64
+ // | $ReadOnly<{ from: string, as: string }>,
65
+ importSources?: $ReadOnlyArray<
66
+ string | $ReadOnly<{ from: string, as: string }>,
67
+ >,
68
+ treeshakeCompensation?: boolean,
60
69
  styleResolution:
61
70
  | 'application-order' // The last style applied wins.
62
71
  // More specific styles will win over less specific styles. (margin-top wins over margin)
@@ -8,5 +8,8 @@
8
8
  */
9
9
 
10
10
  declare const $$EXPORT_DEFAULT_DECLARATION$$: (str: string) => string;
11
+ declare type $$EXPORT_DEFAULT_DECLARATION$$ =
12
+ typeof $$EXPORT_DEFAULT_DECLARATION$$;
11
13
  export default $$EXPORT_DEFAULT_DECLARATION$$;
12
14
  export declare const createShortHash: (str: string) => string;
15
+ export declare type createShortHash = typeof createShortHash;
@@ -34,24 +34,36 @@ import {
34
34
  PSEUDO_CLASS_PRIORITIES as _PSEUDO_CLASS_PRIORITIES,
35
35
  AT_RULE_PRIORITIES as _AT_RULE_PRIORITIES,
36
36
  PSEUDO_ELEMENT_PRIORITY as _PSEUDO_ELEMENT_PRIORITY,
37
- } from './utils/property-priorities';
37
+ } from '@stylexjs/shared';
38
38
  export * as types from './types';
39
39
  export * as when from './when/when';
40
40
  export declare const create: typeof styleXCreateSet;
41
+ export declare type create = typeof create;
41
42
  export declare const defineVars: typeof styleXDefineVars;
43
+ export declare type defineVars = typeof defineVars;
42
44
  export declare const defineConsts: typeof styleXDefineConsts;
45
+ export declare type defineConsts = typeof defineConsts;
43
46
  export declare const createTheme: typeof styleXCreateTheme;
47
+ export declare type createTheme = typeof createTheme;
44
48
  export declare const keyframes: typeof stylexKeyframes;
49
+ export declare type keyframes = typeof keyframes;
45
50
  export declare const positionTry: typeof stylexPositionTry;
51
+ export declare type positionTry = typeof positionTry;
46
52
  export declare const utils: {
47
53
  hash: typeof hash;
48
54
  genFileBasedIdentifier: typeof genFileBasedIdentifier;
49
55
  };
56
+ export declare type utils = typeof utils;
50
57
  export declare const messages: typeof m;
58
+ export declare type messages = typeof messages;
51
59
  export declare const firstThatWorks: typeof stylexFirstThatWorks;
60
+ export declare type firstThatWorks = typeof firstThatWorks;
52
61
  export declare const PSEUDO_CLASS_PRIORITIES: typeof _PSEUDO_CLASS_PRIORITIES;
62
+ export declare type PSEUDO_CLASS_PRIORITIES = typeof PSEUDO_CLASS_PRIORITIES;
53
63
  export declare const AT_RULE_PRIORITIES: typeof _AT_RULE_PRIORITIES;
64
+ export declare type AT_RULE_PRIORITIES = typeof AT_RULE_PRIORITIES;
54
65
  export declare const PSEUDO_ELEMENT_PRIORITY: typeof _PSEUDO_ELEMENT_PRIORITY;
66
+ export declare type PSEUDO_ELEMENT_PRIORITY = typeof PSEUDO_ELEMENT_PRIORITY;
55
67
  export type InjectableStyle = _InjectableStyle;
56
68
  export type CompiledNamespaces = _CompiledNamespaces;
57
69
  export type MutableCompiledNamespaces = _MutableCompiledNamespaces;
@@ -41,7 +41,7 @@ import {
41
41
  PSEUDO_CLASS_PRIORITIES as _PSEUDO_CLASS_PRIORITIES,
42
42
  AT_RULE_PRIORITIES as _AT_RULE_PRIORITIES,
43
43
  PSEUDO_ELEMENT_PRIORITY as _PSEUDO_ELEMENT_PRIORITY,
44
- } from './utils/property-priorities';
44
+ } from '@stylexjs/shared';
45
45
 
46
46
  export * as types from './types';
47
47
  export * as when from './when/when';
@@ -11,28 +11,60 @@ export declare const illegalArgumentLength: (
11
11
  fn: string,
12
12
  argLength: number,
13
13
  ) => string;
14
+ export declare type illegalArgumentLength = typeof illegalArgumentLength;
14
15
  export declare const nonStaticValue: (fn: string) => string;
16
+ export declare type nonStaticValue = typeof nonStaticValue;
15
17
  export declare const nonStyleObject: (fn: string) => string;
18
+ export declare type nonStyleObject = typeof nonStyleObject;
16
19
  export declare const nonExportNamedDeclaration: (fn: string) => string;
20
+ export declare type nonExportNamedDeclaration =
21
+ typeof nonExportNamedDeclaration;
17
22
  export declare const unboundCallValue: (fn: string) => string;
23
+ export declare type unboundCallValue = typeof unboundCallValue;
18
24
  export declare const cannotGenerateHash: (fn: string) => string;
25
+ export declare type cannotGenerateHash = typeof cannotGenerateHash;
19
26
  export declare const DUPLICATE_CONDITIONAL: 'The same pseudo selector or at-rule cannot be used more than once.';
27
+ export declare type DUPLICATE_CONDITIONAL = typeof DUPLICATE_CONDITIONAL;
20
28
  export declare const ESCAPED_STYLEX_VALUE: 'Escaping a create() value is not allowed.';
29
+ export declare type ESCAPED_STYLEX_VALUE = typeof ESCAPED_STYLEX_VALUE;
21
30
  export declare const ILLEGAL_NESTED_PSEUDO: "Pseudo objects can't be nested more than one level deep.";
31
+ export declare type ILLEGAL_NESTED_PSEUDO = typeof ILLEGAL_NESTED_PSEUDO;
22
32
  export declare const ILLEGAL_PROP_VALUE: 'A style value can only contain an array, string or number.';
33
+ export declare type ILLEGAL_PROP_VALUE = typeof ILLEGAL_PROP_VALUE;
23
34
  export declare const ILLEGAL_PROP_ARRAY_VALUE: 'A style array value can only contain strings or numbers.';
35
+ export declare type ILLEGAL_PROP_ARRAY_VALUE = typeof ILLEGAL_PROP_ARRAY_VALUE;
24
36
  export declare const ILLEGAL_NAMESPACE_VALUE: 'A StyleX namespace must be an object.';
37
+ export declare type ILLEGAL_NAMESPACE_VALUE = typeof ILLEGAL_NAMESPACE_VALUE;
25
38
  export declare const INVALID_CONST_KEY: 'Keys in defineConsts() cannot start with "--".';
39
+ export declare type INVALID_CONST_KEY = typeof INVALID_CONST_KEY;
26
40
  export declare const INVALID_PSEUDO: 'Invalid pseudo selector, not on the whitelist.';
41
+ export declare type INVALID_PSEUDO = typeof INVALID_PSEUDO;
27
42
  export declare const INVALID_PSEUDO_OR_AT_RULE: 'Invalid pseudo or at-rule.';
43
+ export declare type INVALID_PSEUDO_OR_AT_RULE =
44
+ typeof INVALID_PSEUDO_OR_AT_RULE;
28
45
  export declare const INVALID_MEDIA_QUERY_SYNTAX: 'Invalid media query syntax.';
46
+ export declare type INVALID_MEDIA_QUERY_SYNTAX =
47
+ typeof INVALID_MEDIA_QUERY_SYNTAX;
29
48
  export declare const LINT_UNCLOSED_FUNCTION: 'Rule contains an unclosed function';
49
+ export declare type LINT_UNCLOSED_FUNCTION = typeof LINT_UNCLOSED_FUNCTION;
30
50
  export declare const LOCAL_ONLY: 'The return value of create() should not be exported.';
51
+ export declare type LOCAL_ONLY = typeof LOCAL_ONLY;
31
52
  export declare const NON_OBJECT_KEYFRAME: 'Every frame within a keyframes() call must be an object.';
53
+ export declare type NON_OBJECT_KEYFRAME = typeof NON_OBJECT_KEYFRAME;
32
54
  export declare const NON_CONTIGUOUS_VARS: 'All variables passed to firstThatWorks() must be contiguous.';
55
+ export declare type NON_CONTIGUOUS_VARS = typeof NON_CONTIGUOUS_VARS;
33
56
  export declare const NO_OBJECT_SPREADS: 'Object spreads are not allowed in create() calls.';
57
+ export declare type NO_OBJECT_SPREADS = typeof NO_OBJECT_SPREADS;
34
58
  export declare const ONLY_NAMED_PARAMETERS_IN_DYNAMIC_STYLE_FUNCTIONS: 'Only named parameters are allowed in Dynamic Style functions. Destructuring, spreading or default values are not allowed.';
59
+ export declare type ONLY_NAMED_PARAMETERS_IN_DYNAMIC_STYLE_FUNCTIONS =
60
+ typeof ONLY_NAMED_PARAMETERS_IN_DYNAMIC_STYLE_FUNCTIONS;
35
61
  export declare const ONLY_TOP_LEVEL: 'create() is only allowed at the root of a program.';
62
+ export declare type ONLY_TOP_LEVEL = typeof ONLY_TOP_LEVEL;
36
63
  export declare const UNKNOWN_PROP_KEY: 'Unknown property key';
64
+ export declare type UNKNOWN_PROP_KEY = typeof UNKNOWN_PROP_KEY;
37
65
  export declare const POSITION_TRY_INVALID_PROPERTY: 'Invalid property in `positionTry()` call. It may only contain, positionAnchor, positionArea, inset properties (top, left, insetInline etc.), margin properties, size properties (height, inlineSize, etc.), and self-alignment properties (alignSelf, justifySelf, placeSelf)';
66
+ export declare type POSITION_TRY_INVALID_PROPERTY =
67
+ typeof POSITION_TRY_INVALID_PROPERTY;
38
68
  export declare const VIEW_TRANSITION_CLASS_INVALID_PROPERTY: 'Invalid property in `viewTransitionClass()` call. It may only contain group, imagePair, old, and new properties';
69
+ export declare type VIEW_TRANSITION_CLASS_INVALID_PROPERTY =
70
+ typeof VIEW_TRANSITION_CLASS_INVALID_PROPERTY;
@@ -10,6 +10,6 @@
10
10
  import type { StyleXOptions } from '../common-types';
11
11
  declare function generateLTR(
12
12
  pair: Readonly<[string, string]>,
13
- options: StyleXOptions,
13
+ options?: StyleXOptions,
14
14
  ): Readonly<[string, string]>;
15
15
  export default generateLTR;
@@ -10,5 +10,5 @@
10
10
  import type { StyleXOptions } from '../common-types';
11
11
  declare export default function generateLTR(
12
12
  pair: $ReadOnly<[string, string]>,
13
- options: StyleXOptions,
13
+ options?: StyleXOptions,
14
14
  ): $ReadOnly<[string, string]>;
@@ -10,6 +10,6 @@
10
10
  import type { StyleXOptions } from '../common-types';
11
11
  declare function generateRTL(
12
12
  pair: Readonly<[string, string]>,
13
- options: StyleXOptions,
13
+ options?: StyleXOptions,
14
14
  ): null | undefined | Readonly<[string, string]>;
15
15
  export default generateRTL;
@@ -10,5 +10,5 @@
10
10
  import type { StyleXOptions } from '../common-types';
11
11
  declare export default function generateRTL(
12
12
  pair: $ReadOnly<[string, string]>,
13
- options: StyleXOptions,
13
+ options?: StyleXOptions,
14
14
  ): ?$ReadOnly<[string, string]>;
@@ -115,69 +115,70 @@ declare const shorthands: Readonly<{
115
115
  [key: string]: ($$PARAM_0$$: TStyleValue) => TReturn;
116
116
  }>;
117
117
  declare const aliases: {
118
- borderHorizontal: any;
119
- borderVertical: any;
120
- borderBlockStart: any;
121
- borderEnd: any;
122
- borderBlockEnd: any;
123
- borderStart: any;
118
+ borderHorizontal: typeof shorthands.borderInline;
119
+ borderVertical: typeof shorthands.borderBlock;
120
+ borderBlockStart: typeof shorthands.borderTop;
121
+ borderEnd: typeof shorthands.borderInlineEnd;
122
+ borderBlockEnd: typeof shorthands.borderBottom;
123
+ borderStart: typeof shorthands.borderInlineStart;
124
124
  blockSize: (val: TStyleValue) => TReturn;
125
125
  inlineSize: (val: TStyleValue) => TReturn;
126
126
  minBlockSize: (val: TStyleValue) => TReturn;
127
127
  minInlineSize: (val: TStyleValue) => TReturn;
128
128
  maxBlockSize: (val: TStyleValue) => TReturn;
129
129
  maxInlineSize: (val: TStyleValue) => TReturn;
130
- borderHorizontalWidth: any;
131
- borderHorizontalStyle: any;
132
- borderHorizontalColor: any;
133
- borderVerticalWidth: any;
134
- borderVerticalStyle: any;
135
- borderVerticalColor: any;
130
+ borderHorizontalWidth: typeof shorthands.borderInlineWidth;
131
+ borderHorizontalStyle: typeof shorthands.borderInlineStyle;
132
+ borderHorizontalColor: typeof shorthands.borderInlineColor;
133
+ borderVerticalWidth: typeof shorthands.borderBlockWidth;
134
+ borderVerticalStyle: typeof shorthands.borderBlockStyle;
135
+ borderVerticalColor: typeof shorthands.borderBlockColor;
136
136
  borderBlockStartColor: (value: TStyleValue) => TReturn;
137
137
  borderBlockEndColor: (value: TStyleValue) => TReturn;
138
138
  borderBlockStartStyle: (value: TStyleValue) => TReturn;
139
139
  borderBlockEndStyle: (value: TStyleValue) => TReturn;
140
140
  borderBlockStartWidth: (value: TStyleValue) => TReturn;
141
141
  borderBlockEndWidth: (value: TStyleValue) => TReturn;
142
- borderStartColor: any;
143
- borderEndColor: any;
144
- borderStartStyle: any;
145
- borderEndStyle: any;
146
- borderStartWidth: any;
147
- borderEndWidth: any;
142
+ borderStartColor: typeof shorthands.borderInlineStartColor;
143
+ borderEndColor: typeof shorthands.borderInlineEndColor;
144
+ borderStartStyle: typeof shorthands.borderInlineStartStyle;
145
+ borderEndStyle: typeof shorthands.borderInlineEndStyle;
146
+ borderStartWidth: typeof shorthands.borderInlineStartWidth;
147
+ borderEndWidth: typeof shorthands.borderInlineEndWidth;
148
148
  borderTopStartRadius: (value: TStyleValue) => TReturn;
149
149
  borderTopEndRadius: (value: TStyleValue) => TReturn;
150
150
  borderBottomStartRadius: (value: TStyleValue) => TReturn;
151
151
  borderBottomEndRadius: (value: TStyleValue) => TReturn;
152
152
  containIntrinsicBlockSize: (value: TStyleValue) => TReturn;
153
153
  containIntrinsicInlineSize: (value: TStyleValue) => TReturn;
154
- gridGap: any;
154
+ gridGap: typeof shorthands.gap;
155
155
  gridRowGap: (value: TStyleValue) => TReturn;
156
156
  gridColumnGap: (value: TStyleValue) => TReturn;
157
157
  marginBlockStart: (value: TStyleValue) => TReturn;
158
158
  marginBlockEnd: (value: TStyleValue) => TReturn;
159
- marginStart: any;
160
- marginEnd: any;
161
- marginHorizontal: any;
162
- marginVertical: any;
159
+ marginStart: typeof shorthands.marginInlineStart;
160
+ marginEnd: typeof shorthands.marginInlineEnd;
161
+ marginHorizontal: typeof shorthands.marginInline;
162
+ marginVertical: typeof shorthands.marginBlock;
163
163
  overflowBlock: (value: TStyleValue) => TReturn;
164
164
  overflowInline: (value: TStyleValue) => TReturn;
165
165
  paddingBlockStart: (rawValue: TStyleValue) => TReturn;
166
166
  paddingBlockEnd: (rawValue: TStyleValue) => TReturn;
167
- paddingStart: any;
168
- paddingEnd: any;
169
- paddingHorizontal: any;
170
- paddingVertical: any;
167
+ paddingStart: typeof shorthands.paddingInlineStart;
168
+ paddingEnd: typeof shorthands.paddingInlineEnd;
169
+ paddingHorizontal: typeof shorthands.paddingInline;
170
+ paddingVertical: typeof shorthands.paddingBlock;
171
171
  scrollMarginBlockStart: (value: TStyleValue) => TReturn;
172
172
  scrollMarginBlockEnd: (value: TStyleValue) => TReturn;
173
173
  insetBlockStart: (value: TStyleValue) => TReturn;
174
174
  insetBlockEnd: (value: TStyleValue) => TReturn;
175
- start: any;
176
- end: any;
175
+ start: typeof shorthands.insetInlineStart;
176
+ end: typeof shorthands.insetInlineEnd;
177
177
  };
178
- declare const $$EXPORT_DEFAULT_DECLARATION$$: Readonly</**
179
- * > 132 | ...typeof shorthands,
180
- * | ^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with complex spreads" is currently not supported.
181
- **/
182
- any>;
178
+ declare const $$EXPORT_DEFAULT_DECLARATION$$: Readonly<
179
+ Omit<typeof shorthands, keyof typeof aliases | keyof {}> &
180
+ Omit<typeof aliases, keyof {}> & {}
181
+ >;
182
+ declare type $$EXPORT_DEFAULT_DECLARATION$$ =
183
+ typeof $$EXPORT_DEFAULT_DECLARATION$$;
183
184
  export default $$EXPORT_DEFAULT_DECLARATION$$;
@@ -67,65 +67,71 @@ declare const shorthands: $ReadOnly<{
67
67
  }>;
68
68
 
69
69
  declare const aliases: {
70
- borderHorizontal: $FlowFixMe,
71
- borderVertical: $FlowFixMe,
72
- borderBlockStart: $FlowFixMe,
73
- borderEnd: $FlowFixMe,
74
- borderBlockEnd: $FlowFixMe,
75
- borderStart: $FlowFixMe,
70
+ // @Deprecated
71
+ borderHorizontal: typeof shorthands.borderInline,
72
+ // @Deprecated
73
+ borderVertical: typeof shorthands.borderBlock,
74
+ // @Deprecated
75
+ borderBlockStart: typeof shorthands.borderTop,
76
+ // @Deprecated
77
+ borderEnd: typeof shorthands.borderInlineEnd,
78
+ // @Deprecated
79
+ borderBlockEnd: typeof shorthands.borderBottom,
80
+ // @Deprecated
81
+ borderStart: typeof shorthands.borderInlineStart,
76
82
  blockSize: (val: TStyleValue) => TReturn,
77
83
  inlineSize: (val: TStyleValue) => TReturn,
78
84
  minBlockSize: (val: TStyleValue) => TReturn,
79
85
  minInlineSize: (val: TStyleValue) => TReturn,
80
86
  maxBlockSize: (val: TStyleValue) => TReturn,
81
87
  maxInlineSize: (val: TStyleValue) => TReturn,
82
- borderHorizontalWidth: $FlowFixMe,
83
- borderHorizontalStyle: $FlowFixMe,
84
- borderHorizontalColor: $FlowFixMe,
85
- borderVerticalWidth: $FlowFixMe,
86
- borderVerticalStyle: $FlowFixMe,
87
- borderVerticalColor: $FlowFixMe,
88
+ borderHorizontalWidth: typeof shorthands.borderInlineWidth,
89
+ borderHorizontalStyle: typeof shorthands.borderInlineStyle,
90
+ borderHorizontalColor: typeof shorthands.borderInlineColor,
91
+ borderVerticalWidth: typeof shorthands.borderBlockWidth,
92
+ borderVerticalStyle: typeof shorthands.borderBlockStyle,
93
+ borderVerticalColor: typeof shorthands.borderBlockColor,
88
94
  borderBlockStartColor: (value: TStyleValue) => TReturn,
89
95
  borderBlockEndColor: (value: TStyleValue) => TReturn,
90
96
  borderBlockStartStyle: (value: TStyleValue) => TReturn,
91
97
  borderBlockEndStyle: (value: TStyleValue) => TReturn,
92
98
  borderBlockStartWidth: (value: TStyleValue) => TReturn,
93
99
  borderBlockEndWidth: (value: TStyleValue) => TReturn,
94
- borderStartColor: $FlowFixMe,
95
- borderEndColor: $FlowFixMe,
96
- borderStartStyle: $FlowFixMe,
97
- borderEndStyle: $FlowFixMe,
98
- borderStartWidth: $FlowFixMe,
99
- borderEndWidth: $FlowFixMe,
100
+ borderStartColor: typeof shorthands.borderInlineStartColor,
101
+ borderEndColor: typeof shorthands.borderInlineEndColor,
102
+ borderStartStyle: typeof shorthands.borderInlineStartStyle,
103
+ borderEndStyle: typeof shorthands.borderInlineEndStyle,
104
+ borderStartWidth: typeof shorthands.borderInlineStartWidth,
105
+ borderEndWidth: typeof shorthands.borderInlineEndWidth,
100
106
  borderTopStartRadius: (value: TStyleValue) => TReturn,
101
107
  borderTopEndRadius: (value: TStyleValue) => TReturn,
102
108
  borderBottomStartRadius: (value: TStyleValue) => TReturn,
103
109
  borderBottomEndRadius: (value: TStyleValue) => TReturn,
104
110
  containIntrinsicBlockSize: (value: TStyleValue) => TReturn,
105
111
  containIntrinsicInlineSize: (value: TStyleValue) => TReturn,
106
- gridGap: $FlowFixMe,
112
+ gridGap: typeof shorthands.gap,
107
113
  gridRowGap: (value: TStyleValue) => TReturn,
108
114
  gridColumnGap: (value: TStyleValue) => TReturn,
109
115
  marginBlockStart: (value: TStyleValue) => TReturn,
110
116
  marginBlockEnd: (value: TStyleValue) => TReturn,
111
- marginStart: $FlowFixMe,
112
- marginEnd: $FlowFixMe,
113
- marginHorizontal: $FlowFixMe,
114
- marginVertical: $FlowFixMe,
117
+ marginStart: typeof shorthands.marginInlineStart,
118
+ marginEnd: typeof shorthands.marginInlineEnd,
119
+ marginHorizontal: typeof shorthands.marginInline,
120
+ marginVertical: typeof shorthands.marginBlock,
115
121
  overflowBlock: (value: TStyleValue) => TReturn,
116
122
  overflowInline: (value: TStyleValue) => TReturn,
117
123
  paddingBlockStart: (rawValue: TStyleValue) => TReturn,
118
124
  paddingBlockEnd: (rawValue: TStyleValue) => TReturn,
119
- paddingStart: $FlowFixMe,
120
- paddingEnd: $FlowFixMe,
121
- paddingHorizontal: $FlowFixMe,
122
- paddingVertical: $FlowFixMe,
125
+ paddingStart: typeof shorthands.paddingInlineStart,
126
+ paddingEnd: typeof shorthands.paddingInlineEnd,
127
+ paddingHorizontal: typeof shorthands.paddingInline,
128
+ paddingVertical: typeof shorthands.paddingBlock,
123
129
  scrollMarginBlockStart: (value: TStyleValue) => TReturn,
124
130
  scrollMarginBlockEnd: (value: TStyleValue) => TReturn,
125
131
  insetBlockStart: (value: TStyleValue) => TReturn,
126
132
  insetBlockEnd: (value: TStyleValue) => TReturn,
127
- start: $FlowFixMe,
128
- end: $FlowFixMe,
133
+ start: typeof shorthands.insetInlineStart,
134
+ end: typeof shorthands.insetInlineEnd,
129
135
  };
130
136
 
131
137
  declare export default $ReadOnly<{
@@ -9,5 +9,5 @@
9
9
 
10
10
  export declare function validateNamespace(
11
11
  namespace: unknown,
12
- conditions: ReadonlyArray<string>,
12
+ conditions?: ReadonlyArray<string>,
13
13
  ): void;
@@ -9,5 +9,5 @@
9
9
 
10
10
  declare export function validateNamespace(
11
11
  namespace: mixed,
12
- conditions: $ReadOnlyArray<string>,
12
+ conditions?: $ReadOnlyArray<string>,
13
13
  ): void;
@@ -8,6 +8,10 @@
8
8
  */
9
9
 
10
10
  import type { TStyleValue } from '../common-types';
11
+ export declare const LOGICAL_FLOAT_START_VAR: '--stylex-logical-start';
12
+ export declare type LOGICAL_FLOAT_START_VAR = typeof LOGICAL_FLOAT_START_VAR;
13
+ export declare const LOGICAL_FLOAT_END_VAR: '--stylex-logical-end';
14
+ export declare type LOGICAL_FLOAT_END_VAR = typeof LOGICAL_FLOAT_END_VAR;
11
15
  /**
12
16
  * Shorthand properties:
13
17
  * - [x] all - Should be banned
@@ -109,8 +113,8 @@ declare const shorthands: Readonly<{
109
113
  declare const aliases: {
110
114
  insetBlockStart: (val: TStyleValue) => TReturn;
111
115
  insetBlockEnd: (val: TStyleValue) => TReturn;
112
- insetInlineStart: any;
113
- insetInlineEnd: any;
116
+ insetInlineStart: typeof shorthands.start;
117
+ insetInlineEnd: typeof shorthands.end;
114
118
  blockSize: (val: TStyleValue) => TReturn;
115
119
  inlineSize: (val: TStyleValue) => TReturn;
116
120
  minBlockSize: (val: TStyleValue) => TReturn;
@@ -119,39 +123,46 @@ declare const aliases: {
119
123
  maxInlineSize: (val: TStyleValue) => TReturn;
120
124
  borderStart: (val: TStyleValue) => TReturn;
121
125
  borderEnd: (val: TStyleValue) => TReturn;
122
- borderBlockWidth: any;
123
- borderBlockStyle: any;
124
- borderBlockColor: any;
126
+ borderBlockWidth: typeof shorthands.borderVerticalWidth;
127
+ borderBlockStyle: typeof shorthands.borderVerticalStyle;
128
+ borderBlockColor: typeof shorthands.borderVerticalColor;
125
129
  borderBlockStartWidth: (val: TStyleValue) => TReturn;
126
130
  borderBlockStartStyle: (val: TStyleValue) => TReturn;
127
131
  borderBlockStartColor: (val: TStyleValue) => TReturn;
128
132
  borderBlockEndWidth: (val: TStyleValue) => TReturn;
129
133
  borderBlockEndStyle: (val: TStyleValue) => TReturn;
130
134
  borderBlockEndColor: (val: TStyleValue) => TReturn;
131
- borderInlineWidth: any;
132
- borderInlineStyle: any;
133
- borderInlineColor: any;
135
+ borderInlineWidth: typeof shorthands.borderHorizontalWidth;
136
+ borderInlineStyle: typeof shorthands.borderHorizontalStyle;
137
+ borderInlineColor: typeof shorthands.borderHorizontalColor;
134
138
  borderTopStartRadius: (val: TStyleValue) => TReturn;
135
139
  borderTopEndRadius: (val: TStyleValue) => TReturn;
136
140
  borderBottomStartRadius: (val: TStyleValue) => TReturn;
137
141
  borderBottomEndRadius: (val: TStyleValue) => TReturn;
138
- gridGap: any;
142
+ gridGap: typeof shorthands.gap;
139
143
  gridRowGap: (value: TStyleValue) => TReturn;
140
144
  gridColumnGap: (value: TStyleValue) => TReturn;
141
- marginBlock: any;
145
+ marginBlock: typeof shorthands.marginVertical;
142
146
  marginBlockStart: (val: TStyleValue) => TReturn;
143
147
  marginBlockEnd: (val: TStyleValue) => TReturn;
144
- marginInline: any;
148
+ marginInline: typeof shorthands.marginHorizontal;
145
149
  overflowBlock: (value: TStyleValue) => TReturn;
146
150
  overflowInline: (value: TStyleValue) => TReturn;
147
- paddingBlock: any;
151
+ paddingBlock: typeof shorthands.paddingVertical;
148
152
  paddingBlockStart: (val: TStyleValue) => TReturn;
149
153
  paddingBlockEnd: (val: TStyleValue) => TReturn;
150
- paddingInline: any;
154
+ paddingInline: typeof shorthands.paddingHorizontal;
151
155
  scrollMarginBlockStart: (value: TStyleValue) => TReturn;
152
156
  scrollMarginBlockEnd: (value: TStyleValue) => TReturn;
157
+ float: (value: TStyleValue) => TReturn;
158
+ clear: (value: TStyleValue) => TReturn;
153
159
  };
154
- declare const expansions: Omit<shorthands, keyof (aliases | {})> &
155
- Omit<aliases, keyof ({})> & {};
160
+ declare const expansions: Omit<
161
+ typeof shorthands,
162
+ keyof typeof aliases | keyof {}
163
+ > &
164
+ Omit<typeof aliases, keyof {}> & {};
156
165
  declare const $$EXPORT_DEFAULT_DECLARATION$$: typeof expansions;
166
+ declare type $$EXPORT_DEFAULT_DECLARATION$$ =
167
+ typeof $$EXPORT_DEFAULT_DECLARATION$$;
157
168
  export default $$EXPORT_DEFAULT_DECLARATION$$;
@@ -9,6 +9,9 @@
9
9
 
10
10
  import type { TStyleValue } from '../common-types';
11
11
 
12
+ declare export const LOGICAL_FLOAT_START_VAR: '--stylex-logical-start';
13
+ declare export const LOGICAL_FLOAT_END_VAR: '--stylex-logical-end';
14
+
12
15
  // TODO: to be added later.
13
16
  // const aliases = {
14
17
  // marginInlineStart: (rawValue) => [['marginStart', rawValue]],
@@ -88,8 +91,8 @@ declare const shorthands: $ReadOnly<{
88
91
  declare const aliases: {
89
92
  insetBlockStart: (val: TStyleValue) => TReturn,
90
93
  insetBlockEnd: (val: TStyleValue) => TReturn,
91
- insetInlineStart: $FlowFixMe,
92
- insetInlineEnd: $FlowFixMe,
94
+ insetInlineStart: typeof shorthands.start,
95
+ insetInlineEnd: typeof shorthands.end,
93
96
  blockSize: (val: TStyleValue) => TReturn,
94
97
  inlineSize: (val: TStyleValue) => TReturn,
95
98
  minBlockSize: (val: TStyleValue) => TReturn,
@@ -98,39 +101,41 @@ declare const aliases: {
98
101
  maxInlineSize: (val: TStyleValue) => TReturn,
99
102
  borderStart: (val: TStyleValue) => TReturn,
100
103
  borderEnd: (val: TStyleValue) => TReturn,
101
- borderBlockWidth: $FlowFixMe,
102
- borderBlockStyle: $FlowFixMe,
103
- borderBlockColor: $FlowFixMe,
104
+ borderBlockWidth: typeof shorthands.borderVerticalWidth,
105
+ borderBlockStyle: typeof shorthands.borderVerticalStyle,
106
+ borderBlockColor: typeof shorthands.borderVerticalColor,
104
107
  borderBlockStartWidth: (val: TStyleValue) => TReturn,
105
108
  borderBlockStartStyle: (val: TStyleValue) => TReturn,
106
109
  borderBlockStartColor: (val: TStyleValue) => TReturn,
107
110
  borderBlockEndWidth: (val: TStyleValue) => TReturn,
108
111
  borderBlockEndStyle: (val: TStyleValue) => TReturn,
109
112
  borderBlockEndColor: (val: TStyleValue) => TReturn,
110
- borderInlineWidth: $FlowFixMe,
111
- borderInlineStyle: $FlowFixMe,
112
- borderInlineColor: $FlowFixMe,
113
+ borderInlineWidth: typeof shorthands.borderHorizontalWidth,
114
+ borderInlineStyle: typeof shorthands.borderHorizontalStyle,
115
+ borderInlineColor: typeof shorthands.borderHorizontalColor,
113
116
  borderTopStartRadius: (val: TStyleValue) => TReturn,
114
117
  borderTopEndRadius: (val: TStyleValue) => TReturn,
115
118
  borderBottomStartRadius: (val: TStyleValue) => TReturn,
116
119
  borderBottomEndRadius: (val: TStyleValue) => TReturn,
117
- gridGap: $FlowFixMe,
120
+ gridGap: typeof shorthands.gap,
118
121
  gridRowGap: (value: TStyleValue) => TReturn,
119
122
  gridColumnGap: (value: TStyleValue) => TReturn,
120
- marginBlock: $FlowFixMe,
123
+ marginBlock: typeof shorthands.marginVertical,
121
124
  marginBlockStart: (val: TStyleValue) => TReturn,
122
125
  marginBlockEnd: (val: TStyleValue) => TReturn,
123
- marginInline: $FlowFixMe,
126
+ marginInline: typeof shorthands.marginHorizontal,
124
127
  overflowBlock: (value: TStyleValue) => TReturn,
125
128
  overflowInline: (value: TStyleValue) => TReturn,
126
- paddingBlock: $FlowFixMe,
129
+ paddingBlock: typeof shorthands.paddingVertical,
127
130
  paddingBlockStart: (val: TStyleValue) => TReturn,
128
131
  paddingBlockEnd: (val: TStyleValue) => TReturn,
129
- paddingInline: $FlowFixMe,
132
+ paddingInline: typeof shorthands.paddingHorizontal,
130
133
  scrollMarginBlockStart: (value: TStyleValue) => TReturn,
131
134
  scrollMarginBlockEnd: (value: TStyleValue) => TReturn,
135
+ float: (value: TStyleValue) => TReturn,
136
+ clear: (value: TStyleValue) => TReturn,
132
137
  };
133
138
 
134
- declare const expansions: { ...shorthands, ...aliases };
139
+ declare const expansions: { ...typeof shorthands, ...typeof aliases };
135
140
 
136
141
  declare export default typeof expansions;
@@ -13,12 +13,12 @@ declare const shorthands: Readonly<{
13
13
  [key: string]: ($$PARAM_0$$: TStyleValue) => TReturn;
14
14
  }>;
15
15
  declare const aliases: {
16
- borderHorizontal: any;
17
- borderVertical: any;
18
- borderBlockStart: any;
19
- borderEnd: any;
20
- borderBlockEnd: any;
21
- borderStart: any;
16
+ borderHorizontal: typeof shorthands.borderInline;
17
+ borderVertical: typeof shorthands.borderBlock;
18
+ borderBlockStart: typeof shorthands.borderTop;
19
+ borderEnd: typeof shorthands.borderInlineEnd;
20
+ borderBlockEnd: typeof shorthands.borderBottom;
21
+ borderStart: typeof shorthands.borderInlineStart;
22
22
  blockSize: (val: TStyleValue) => TReturn;
23
23
  inlineSize: (val: TStyleValue) => TReturn;
24
24
  minBlockSize: (val: TStyleValue) => TReturn;
@@ -70,9 +70,10 @@ declare const aliases: {
70
70
  start: (val: TStyleValue) => TReturn;
71
71
  end: (val: TStyleValue) => TReturn;
72
72
  };
73
- declare const $$EXPORT_DEFAULT_DECLARATION$$: Readonly</**
74
- * > 85 | ...typeof shorthands,
75
- * | ^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with complex spreads" is currently not supported.
76
- **/
77
- any>;
73
+ declare const $$EXPORT_DEFAULT_DECLARATION$$: Readonly<
74
+ Omit<typeof shorthands, keyof typeof aliases | keyof {}> &
75
+ Omit<typeof aliases, keyof {}> & {}
76
+ >;
77
+ declare type $$EXPORT_DEFAULT_DECLARATION$$ =
78
+ typeof $$EXPORT_DEFAULT_DECLARATION$$;
78
79
  export default $$EXPORT_DEFAULT_DECLARATION$$;
@@ -23,12 +23,18 @@ declare const shorthands: $ReadOnly<{
23
23
  }>;
24
24
 
25
25
  declare const aliases: {
26
- borderHorizontal: $FlowFixMe,
27
- borderVertical: $FlowFixMe,
28
- borderBlockStart: $FlowFixMe,
29
- borderEnd: $FlowFixMe,
30
- borderBlockEnd: $FlowFixMe,
31
- borderStart: $FlowFixMe,
26
+ // @Deprecated
27
+ borderHorizontal: typeof shorthands.borderInline,
28
+ // @Deprecated
29
+ borderVertical: typeof shorthands.borderBlock,
30
+ // @Deprecated
31
+ borderBlockStart: typeof shorthands.borderTop,
32
+ // @Deprecated
33
+ borderEnd: typeof shorthands.borderInlineEnd,
34
+ // @Deprecated
35
+ borderBlockEnd: typeof shorthands.borderBottom,
36
+ // @Deprecated
37
+ borderStart: typeof shorthands.borderInlineStart,
32
38
  blockSize: (val: TStyleValue) => TReturn,
33
39
  inlineSize: (val: TStyleValue) => TReturn,
34
40
  minBlockSize: (val: TStyleValue) => TReturn,
@@ -12,7 +12,7 @@ import type { ConstsConfig } from './stylex-consts-utils';
12
12
  declare function styleXDefineConsts<Vars extends ConstsConfig>(
13
13
  constants: Vars,
14
14
  options: Readonly<
15
- Omit<Partial<StyleXOptions>, keyof ({ exportId: string })> & {
15
+ Omit<Partial<StyleXOptions>, keyof { exportId: string }> & {
16
16
  exportId: string;
17
17
  }
18
18
  >,