@plumeria/core 21.1.3 → 21.1.4

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 (2) hide show
  1. package/lib/types.d.ts +14 -14
  2. package/package.json +1 -1
package/lib/types.d.ts CHANGED
@@ -83,17 +83,11 @@ type ClassStyled<T> = Readonly<{
83
83
 
84
84
  type AtomicClassStyle<T> = ClassStyled<AtomicStyle<T>>;
85
85
 
86
- type StyleMap<T> = [T] extends [unknown]
87
- ? Readonly<{
88
- readonly [key in keyof T]: T[key] extends Record<string, unknown>
89
- ? key extends NestedKey
90
- ? StyleMap<T[key]>
91
- : AtomicClassNameFor<key & string, T[key]>
92
- : key extends string
93
- ? AtomicClassNameFor<key, T[key]>
94
- : never;
95
- }>
96
- : never;
86
+ type StyleMap<T> = Readonly<{
87
+ readonly [key in keyof T]: key extends NestedKey
88
+ ? StyleMap<T[key]>
89
+ : AtomicClassNameFor<key & string, T[key]>;
90
+ }>;
97
91
 
98
92
  type CreateReturnType<T> = Readonly<{
99
93
  [K in keyof T]: T[K] extends (...args: infer A) => infer R
@@ -106,16 +100,22 @@ type FlatNamespace<K extends StyleKey, M = unknown> = {
106
100
  : never;
107
101
  };
108
102
 
109
- interface NestedNamespace<K extends StyleKey, M> {
103
+ type NestedNamespace<K extends StyleKey, M> = {
110
104
  readonly [P: NestedKey]: AllowedNamespace<K, M> | undefined;
111
- }
105
+ };
112
106
 
113
107
  type AllowedNamespace<K extends StyleKey, M = unknown> = FlatNamespace<K, M> &
114
108
  NestedNamespace<K, M>;
115
109
 
116
110
  type StyleList<T> = T | false | null | undefined | StyleList<T>[];
117
111
 
118
- type StyleNamespace = AllowedNamespace<StyleKey>;
112
+ type StyleNamespace = {
113
+ readonly [key: string]:
114
+ | AtomicClassNameFor<string, unknown>
115
+ | StyleNamespace
116
+ | undefined;
117
+ };
118
+
119
119
  type Style = StyleList<StyleNamespace>;
120
120
 
121
121
  type StyleProps<K extends StyleKey> = StyleList<AllowedNamespace<K>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "21.1.3",
3
+ "version": "21.1.4",
4
4
  "description": "Zero-cost abstraction layer for styling React components.",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",