@plumeria/core 13.1.5 → 13.2.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.
package/lib/css.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * ```ts
5
5
  * type create = <const T extends Record<string, CreateStyleValue>>(rule: T)=> CreateReturnType<T>;
6
6
  * type variants = <T extends Variants>(rule: T) => (props: { [K in keyof T]?: keyof T[K] }) => VariantStyles<T>;
7
- * type createTheme = <const T extends CreateTheme>(themeSelector: string, rule: T) => CreateThemeReturnType<T>;
7
+ * type createTheme = <const T extends CreateTheme>(themeSelector: CreateThemeSelector, rule: T) => CreateThemeReturnType<T>;
8
8
  * type createStatic = <const T extends CreateStatic>(rule: T)=> T;
9
9
  * type keyframes = <const T extends Keyframes>(rule: T) => string;
10
10
  * type viewTransition = <const T extends ViewTransition>(rule: T) => string;
@@ -20,6 +20,7 @@ declare module '@plumeria/core' {
20
20
  CreateStyleValue,
21
21
  CreateReturnType,
22
22
  CreateTheme,
23
+ CreateThemeSelector,
23
24
  CreateThemeReturnType,
24
25
  CreateStatic,
25
26
  Variants,
@@ -52,7 +53,7 @@ declare module '@plumeria/core' {
52
53
 
53
54
  export const createTheme: createTheme;
54
55
  export type createTheme = <const T extends CreateTheme>(
55
- themeSelector: string,
56
+ themeSelector: CreateThemeSelector,
56
57
  rule: T,
57
58
  ) => CreateThemeReturnType<T>;
58
59
 
package/lib/types.d.ts CHANGED
@@ -24,9 +24,15 @@ type ColonSelector = {
24
24
  [key in ColonString]: CommonProperties | CSSVariableProperty;
25
25
  };
26
26
 
27
- type Query = `@media ${string}` | `@container ${string}`;
28
- type QuerySelector = {
29
- [K in Query]:
27
+ type AtRule =
28
+ | `@media ${string}`
29
+ | `@container ${string}`
30
+ | `@supports ${string}`
31
+ | `@layer ${string}`
32
+ | `@scope ${string}`;
33
+
34
+ type AtRuleSelector = {
35
+ [K in AtRule]:
30
36
  | CommonProperties
31
37
  | ColonSelector
32
38
  | ArraySelector
@@ -35,9 +41,9 @@ type QuerySelector = {
35
41
 
36
42
  type CSSProperties =
37
43
  | CommonProperties
38
- | ArraySelector
39
44
  | ColonSelector
40
- | QuerySelector
45
+ | ArraySelector
46
+ | AtRuleSelector
41
47
  | CSSVariableProperty;
42
48
 
43
49
  type CreateStyleValue = CSSProperties | ((...args: any[]) => CSSProperties);
@@ -50,9 +56,10 @@ type AtomicClassNameFor<out P extends string, out V> = string & {
50
56
  readonly _value: V;
51
57
  };
52
58
 
59
+ type AtString = `@${string}`;
53
60
  type MapNamespace<T> = Readonly<{
54
61
  [key in keyof T]: T[key] extends Record<string, unknown>
55
- ? key extends `:${string}` | `@${string}` | `[${string}`
62
+ ? key extends ColonString | ArrayString | AtString
56
63
  ? MapNamespace<T[key]>
57
64
  : AtomicClassNameFor<key & string, T[key]>
58
65
  : key extends string
@@ -73,6 +80,9 @@ type CreateStatic = Record<string, string | number>;
73
80
  type CreateTheme = {
74
81
  [key: string]: ThemeValue;
75
82
  };
83
+
84
+ type DotString = `.${string}`;
85
+ type CreateThemeSelector = DotString | ArrayString | AtRule;
76
86
  type CreateThemeReturnType<T> = {
77
87
  readonly [K in keyof T]: Readonly<T[K]>;
78
88
  };
@@ -123,6 +133,7 @@ export type {
123
133
  CreateStyleValue,
124
134
  CreateReturnType,
125
135
  CreateTheme,
136
+ CreateThemeSelector,
126
137
  CreateThemeReturnType,
127
138
  CreateStatic,
128
139
  Variants,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "13.1.5",
3
+ "version": "13.2.1",
4
4
  "description": "Zero-cost abstraction layer for styling React components.",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -21,7 +21,8 @@
21
21
  "plumeria",
22
22
  "type",
23
23
  "typed",
24
- "types"
24
+ "types",
25
+ "stylex"
25
26
  ],
26
27
  "exports": {
27
28
  ".": {