@plumeria/core 15.1.3 → 16.1.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.
- package/lib/css.d.ts +2 -10
- package/lib/types.d.ts +4 -24
- package/package.json +1 -1
package/lib/css.d.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Bundler plugin required.
|
|
4
4
|
* ```ts
|
|
5
5
|
* type create = <const T extends Record<string, CreateStyleValue>>(rule: T)=> CreateReturnType<T>;
|
|
6
|
-
* type variants = <T extends Variants>(rule: T) => (props: { [K in keyof T]?: keyof T[K] }) => VariantStyles<T>;
|
|
7
6
|
* type createTheme = <const T extends CreateTheme>(themeSelector: CreateThemeSelector, rule: T) => CreateThemeReturnType<T>;
|
|
8
7
|
* type createStatic = <const T extends CreateStatic>(rule: T)=> T;
|
|
9
8
|
* type keyframes = <const T extends Keyframes>(rule: T) => string;
|
|
@@ -15,16 +14,14 @@
|
|
|
15
14
|
*/
|
|
16
15
|
declare module '@plumeria/core' {
|
|
17
16
|
import type {
|
|
17
|
+
AtomicClassNameFor,
|
|
18
18
|
StyleName,
|
|
19
|
-
CSSProperties,
|
|
20
19
|
CreateStyleValue,
|
|
21
20
|
CreateReturnType,
|
|
22
21
|
CreateTheme,
|
|
23
22
|
CreateThemeSelector,
|
|
24
23
|
CreateThemeReturnType,
|
|
25
24
|
CreateStatic,
|
|
26
|
-
Variants,
|
|
27
|
-
VariantStyles,
|
|
28
25
|
Keyframes,
|
|
29
26
|
ViewTransition,
|
|
30
27
|
Marker,
|
|
@@ -39,18 +36,13 @@ declare module '@plumeria/core' {
|
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
|
|
42
|
-
export type { StyleName };
|
|
39
|
+
export type { AtomicClassNameFor, StyleName };
|
|
43
40
|
|
|
44
41
|
export const create: create;
|
|
45
42
|
export type create = <const T extends Record<string, CreateStyleValue>>(
|
|
46
43
|
rule: T,
|
|
47
44
|
) => CreateReturnType<T>;
|
|
48
45
|
|
|
49
|
-
export const variants: variants;
|
|
50
|
-
export type variants = <T extends Variants>(
|
|
51
|
-
rule: T,
|
|
52
|
-
) => (props: { [K in keyof T]?: keyof T[K] }) => VariantStyles<T>;
|
|
53
|
-
|
|
54
46
|
export const createTheme: createTheme;
|
|
55
47
|
export type createTheme = <const T extends CreateTheme>(
|
|
56
48
|
themeSelector: CreateThemeSelector,
|
package/lib/types.d.ts
CHANGED
|
@@ -72,8 +72,8 @@ type CreateReturnType<T> = Readonly<{
|
|
|
72
72
|
? (...args: A) => MapNamespace<R>
|
|
73
73
|
: MapNamespace<T[K]>;
|
|
74
74
|
}>;
|
|
75
|
-
|
|
76
|
-
type StyleName =
|
|
75
|
+
type Conditional = false | CSSProperties | null | undefined;
|
|
76
|
+
type StyleName = Conditional | StyleName[];
|
|
77
77
|
|
|
78
78
|
type CreateStatic = Record<string, string | number>;
|
|
79
79
|
|
|
@@ -99,25 +99,6 @@ type ViewTransition = {
|
|
|
99
99
|
old?: CSSProperties;
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
type Variants = Record<string, Record<string, CSSProperties>>;
|
|
103
|
-
|
|
104
|
-
type AllOptionsOf<T> = {
|
|
105
|
-
[G in keyof T]: T[G][keyof T[G]];
|
|
106
|
-
}[keyof T];
|
|
107
|
-
|
|
108
|
-
type KeysOfUnion<U> = U extends unknown ? keyof U : never;
|
|
109
|
-
type ValueForKeyInUnion<U, K> = U extends unknown
|
|
110
|
-
? K extends keyof U
|
|
111
|
-
? U[K]
|
|
112
|
-
: never
|
|
113
|
-
: never;
|
|
114
|
-
|
|
115
|
-
type MergeVariants<U> = Readonly<{
|
|
116
|
-
[K in KeysOfUnion<U>]?: ValueForKeyInUnion<U, K>;
|
|
117
|
-
}>;
|
|
118
|
-
|
|
119
|
-
type VariantStyles<T> = MergeVariants<AllOptionsOf<T>>;
|
|
120
|
-
|
|
121
102
|
type Marker = Record<string, CSSProperties>;
|
|
122
103
|
|
|
123
104
|
type StripColon<T extends string> = T extends `:${infer R}` ? StripColon<R> : T;
|
|
@@ -128,16 +109,15 @@ type Extended<
|
|
|
128
109
|
> = `@container style(--${I}-${StripColon<P>}: 1)`;
|
|
129
110
|
|
|
130
111
|
export type {
|
|
131
|
-
|
|
112
|
+
AtomicClassNameFor,
|
|
132
113
|
StyleName,
|
|
114
|
+
CSSProperties,
|
|
133
115
|
CreateStyleValue,
|
|
134
116
|
CreateReturnType,
|
|
135
117
|
CreateTheme,
|
|
136
118
|
CreateThemeSelector,
|
|
137
119
|
CreateThemeReturnType,
|
|
138
120
|
CreateStatic,
|
|
139
|
-
Variants,
|
|
140
|
-
VariantStyles,
|
|
141
121
|
Keyframes,
|
|
142
122
|
ViewTransition,
|
|
143
123
|
Marker,
|