@stylexjs/stylex 0.3.0 → 0.4.0

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 (45) hide show
  1. package/README.md +18 -43
  2. package/lib/StyleXCSSTypes.d.ts +3 -1
  3. package/lib/StyleXCSSTypes.js.flow +4 -2
  4. package/lib/StyleXSheet.js +17 -3
  5. package/lib/StyleXTypes.d.ts +10 -4
  6. package/lib/StyleXTypes.js.flow +9 -6
  7. package/lib/stylex.d.ts +0 -7
  8. package/lib/stylex.js +1 -5
  9. package/lib/stylex.js.flow +0 -4
  10. package/package.json +2 -2
  11. package/lib/native/CSSCustomPropertyValue.d.ts +0 -26
  12. package/lib/native/CSSCustomPropertyValue.js +0 -27
  13. package/lib/native/CSSCustomPropertyValue.js.flow +0 -27
  14. package/lib/native/CSSLengthUnitValue.d.ts +0 -18
  15. package/lib/native/CSSLengthUnitValue.js +0 -73
  16. package/lib/native/CSSLengthUnitValue.js.flow +0 -21
  17. package/lib/native/CSSMediaQuery.d.ts +0 -25
  18. package/lib/native/CSSMediaQuery.js +0 -55
  19. package/lib/native/CSSMediaQuery.js.flow +0 -26
  20. package/lib/native/SpreadOptions.d.ts +0 -19
  21. package/lib/native/SpreadOptions.js +0 -1
  22. package/lib/native/SpreadOptions.js.flow +0 -19
  23. package/lib/native/__tests__/__snapshots__/stylex-css-var-test.js.snap +0 -48
  24. package/lib/native/__tests__/__snapshots__/stylex-test.js.snap +0 -1046
  25. package/lib/native/__tests__/parseTimeValue-test.js +0 -11
  26. package/lib/native/__tests__/stylex-css-var-test.js +0 -148
  27. package/lib/native/__tests__/stylex-test.js +0 -924
  28. package/lib/native/errorMsg.d.ts +0 -11
  29. package/lib/native/errorMsg.js +0 -13
  30. package/lib/native/errorMsg.js.flow +0 -12
  31. package/lib/native/fixContentBox.d.ts +0 -11
  32. package/lib/native/fixContentBox.js +0 -59
  33. package/lib/native/fixContentBox.js.flow +0 -11
  34. package/lib/native/flattenStyle.d.ts +0 -15
  35. package/lib/native/flattenStyle.js +0 -20
  36. package/lib/native/flattenStyle.js.flow +0 -20
  37. package/lib/native/parseShadow.d.ts +0 -18
  38. package/lib/native/parseShadow.js +0 -36
  39. package/lib/native/parseShadow.js.flow +0 -19
  40. package/lib/native/parseTimeValue.d.ts +0 -11
  41. package/lib/native/parseTimeValue.js +0 -18
  42. package/lib/native/parseTimeValue.js.flow +0 -12
  43. package/lib/native/stylex.d.ts +0 -50
  44. package/lib/native/stylex.js +0 -393
  45. package/lib/native/stylex.js.flow +0 -60
@@ -1,26 +0,0 @@
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
- export type MatchObject = {
11
- width: number,
12
- height: number,
13
- direction: 'ltr' | 'rtl',
14
- };
15
-
16
- declare export class CSSMediaQuery {
17
- static isMediaQueryString(inp: string): boolean;
18
- static resolveMediaQueries(
19
- styleObj: { +[string]: mixed },
20
- matchObj: MatchObject,
21
- ): { [string]: mixed };
22
- query: string;
23
- matchedStyle: { [string]: mixed };
24
- constructor(query: string, matchedStyle: { [string]: mixed }): void;
25
- resolve(matchObject: MatchObject): { [string]: mixed };
26
- }
@@ -1,19 +0,0 @@
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 type SpreadOptions = Readonly<{
11
- customProperties: {};
12
- inheritedFontSize: null | undefined | number;
13
- fontScale: number | void;
14
- hover?: null | undefined | boolean;
15
- passthroughProperties: Array<string>;
16
- viewportHeight: number;
17
- viewportWidth: number;
18
- writingDirection: 'ltr' | 'rtl';
19
- }>;
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,19 +0,0 @@
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
- export type SpreadOptions = $ReadOnly<{
11
- customProperties: {},
12
- inheritedFontSize: ?number,
13
- fontScale: number | void,
14
- hover?: ?boolean,
15
- passthroughProperties: Array<string>,
16
- viewportHeight: number,
17
- viewportWidth: number,
18
- writingDirection: 'ltr' | 'rtl',
19
- }>;
@@ -1,48 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`stylex CSSCustomProperty value test falls back to a default value with spaces 1`] = `
4
- {
5
- "style": {
6
- "shadowColor": "0px 0px 0px black",
7
- "shadowOffset": {
8
- "height": undefined,
9
- "width": undefined,
10
- },
11
- "shadowOpacity": 1,
12
- },
13
- }
14
- `;
15
-
16
- exports[`stylex CSSCustomProperty value test parses a variable with a default value with spaces 1`] = `
17
- {
18
- "style": {
19
- "shadowColor": "5px 5px 5px black",
20
- "shadowOffset": {
21
- "height": undefined,
22
- "width": undefined,
23
- },
24
- "shadowOpacity": 1,
25
- },
26
- }
27
- `;
28
-
29
- exports[`stylex CSSCustomProperty value test parses and falls back to a default value containing spaces and embedded variables 1`] = `
30
- {
31
- "style": {
32
- "shadowColor": "var(--boxShadowVarNotFound",
33
- "shadowOffset": {
34
- "height": undefined,
35
- "width": undefined,
36
- },
37
- "shadowOpacity": 1,
38
- },
39
- }
40
- `;
41
-
42
- exports[`stylex CSSCustomProperty value test parses and falls back to default value containing a variable 1`] = `
43
- {
44
- "style": {
45
- "color": "blue",
46
- },
47
- }
48
- `;