@stylexjs/stylex 0.2.0-beta.16 → 0.2.0-beta.18

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/stylex.js CHANGED
@@ -1,13 +1,4 @@
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
- 'use strict';
1
+ "use strict";
11
2
 
12
3
  Object.defineProperty(exports, "__esModule", {
13
4
  value: true
@@ -26,16 +17,16 @@ function spread(styles, _options) {
26
17
  };
27
18
  }
28
19
  function stylexCreate(_styles) {
29
- throw new Error('stylex.create should never be called. It should be compiled away.');
20
+ throw new Error("stylex.create should never be called. It should be compiled away.");
30
21
  }
31
22
  function stylexCreateVars(_styles) {
32
- throw new Error('stylex.createVars should never be called. It should be compiled away.');
23
+ throw new Error("stylex.createVars should never be called. It should be compiled away.");
33
24
  }
34
25
  function stylexOverrideVars(_styles) {
35
- throw new Error('stylex.overrideVars should never be called. It should be compiled away.');
26
+ throw new Error("stylex.overrideVars should never be called. It should be compiled away.");
36
27
  }
37
28
  function stylexIncludes(_styles) {
38
- throw new Error('stylex.extends should never be called. It should be compiled away.');
29
+ throw new Error("stylex.extends should never be called. It should be compiled away.");
39
30
  }
40
31
  const create = stylexCreate;
41
32
  exports.create = create;
@@ -46,17 +37,17 @@ exports.unstable_overrideVars = unstable_overrideVars;
46
37
  const include = stylexIncludes;
47
38
  exports.include = include;
48
39
  const keyframes = _keyframes => {
49
- throw new Error('stylex.keyframes should never be called');
40
+ throw new Error("stylex.keyframes should never be called");
50
41
  };
51
42
  exports.keyframes = keyframes;
52
43
  const firstThatWorks = function () {
53
- throw new Error('stylex.firstThatWorks should never be called.');
44
+ throw new Error("stylex.firstThatWorks should never be called.");
54
45
  };
55
46
  exports.firstThatWorks = firstThatWorks;
56
47
  const inject = _stylexInject.default;
57
48
  exports.inject = inject;
58
49
  const UNSUPPORTED_PROPERTY = _props => {
59
- throw new Error('stylex.UNSUPPORTED_PROPERTY should never be called. It should be compiled away.');
50
+ throw new Error("stylex.UNSUPPORTED_PROPERTY should never be called. It should be compiled away.");
60
51
  };
61
52
  exports.UNSUPPORTED_PROPERTY = UNSUPPORTED_PROPERTY;
62
53
  function _stylex() {
@@ -10,69 +10,66 @@
10
10
  import type {
11
11
  Keyframes,
12
12
  Stylex$Create,
13
- Stylex$CreateVars,
14
- Stylex$OverrideVars,
13
+ StyleX$CreateVars,
14
+ StyleX$OverrideVars,
15
15
  StyleXArray,
16
16
  MapNamespace,
17
+ CompiledStyles,
17
18
  } from './StyleXTypes';
18
19
 
19
- import injectStyle from './stylex-inject';
20
- type DedupeStyles = $ReadOnly<{
21
- $$css: true,
22
- [key: string]: string | $ReadOnly<{ [key: string]: string, ... }>,
23
- ...
24
- }>;
20
+ export type { Theme, Variant } from './StyleXTypes';
25
21
 
22
+ import injectStyle from './stylex-inject';
26
23
  declare export function spread(
27
24
  styles: StyleXArray<
28
- | ?DedupeStyles
25
+ | ?CompiledStyles
29
26
  | boolean
30
- | $ReadOnly<{ $$css?: void, [string]: string | number }>
27
+ | $ReadOnly<{ $$css?: void, [string]: string | number }>,
31
28
  >,
32
- _options?: { ... }
29
+ _options?: { ... },
33
30
  ): $ReadOnly<{
34
31
  className: string,
35
32
  style: $ReadOnly<{ $$css?: void, [string]: string | number }>,
36
33
  }>;
37
34
 
38
35
  type Stylex$Include = <TStyles: { +[string]: string | number }>(
39
- _styles: MapNamespace<TStyles>
36
+ _styles: MapNamespace<TStyles>,
40
37
  ) => TStyles;
41
38
 
42
- declare export var create: Stylex$Create;
39
+ declare export const create: Stylex$Create;
43
40
 
44
- declare export var unstable_createVars: Stylex$CreateVars;
41
+ declare export const unstable_createVars: StyleX$CreateVars;
45
42
 
46
- declare export var unstable_overrideVars: Stylex$OverrideVars;
43
+ declare export const unstable_overrideVars: StyleX$OverrideVars;
47
44
 
48
- declare export var include: Stylex$Include;
45
+ declare export const include: Stylex$Include;
49
46
 
50
- declare export var keyframes: (_keyframes: Keyframes) => string;
47
+ declare export const keyframes: (_keyframes: Keyframes) => string;
51
48
 
52
- declare export var firstThatWorks: <T: string | number>(
49
+ declare export const firstThatWorks: <T: string | number>(
53
50
  ..._styles: $ReadOnlyArray<T>
54
51
  ) => $ReadOnlyArray<T>;
55
52
 
56
- declare export var inject: typeof injectStyle;
53
+ declare export const inject: typeof injectStyle;
57
54
 
58
- declare export var UNSUPPORTED_PROPERTY: <T>(_props: T) => T;
55
+ declare export const UNSUPPORTED_PROPERTY: <T>(_props: T) => T;
59
56
 
60
57
  type IStyleX = {
61
- (...styles: $ReadOnlyArray<StyleXArray<?DedupeStyles | boolean>>): string,
58
+ (...styles: $ReadOnlyArray<StyleXArray<?CompiledStyles | boolean>>): string,
62
59
  spread: (
63
60
  styles: StyleXArray<
64
- | ?DedupeStyles
61
+ | ?CompiledStyles
65
62
  | boolean
66
- | $ReadOnly<{ $$css?: void, [string]: string | number }>
63
+ | $ReadOnly<{ $$css?: void, [string]: string | number }>,
67
64
  >,
68
- _options?: { ... }
65
+ _options?: { ... },
69
66
  ) => $ReadOnly<{
70
67
  className: string,
71
68
  style: $ReadOnly<{ $$css?: void, [string]: string | number }>,
72
69
  }>,
73
70
  create: Stylex$Create,
74
- unstable_createVars: Stylex$CreateVars,
75
- unstable_overrideVars: Stylex$OverrideVars,
71
+ unstable_createVars: StyleX$CreateVars,
72
+ unstable_overrideVars: StyleX$OverrideVars,
76
73
  include: Stylex$Include,
77
74
  firstThatWorks: <T: string | number>(
78
75
  ...v: $ReadOnlyArray<T>
@@ -85,4 +82,4 @@ type IStyleX = {
85
82
 
86
83
  declare export default IStyleX;
87
84
 
88
- declare export var stylex: IStyleX;
85
+ declare export const stylex: IStyleX;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stylexjs/stylex",
3
- "version": "0.2.0-beta.16",
3
+ "version": "0.2.0-beta.18",
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",
@@ -20,7 +20,7 @@
20
20
  "utility-types": "^3.10.0"
21
21
  },
22
22
  "devDependencies": {
23
- "@stylexjs/scripts": "0.2.0-beta.16"
23
+ "@stylexjs/scripts": "0.2.0-beta.18"
24
24
  },
25
25
  "jest": {},
26
26
  "files": [