@plumeria/core 12.0.8 → 13.0.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 +6 -5
- package/lib/types.d.ts +17 -5
- package/package.json +1 -1
package/lib/css.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Type definitions
|
|
3
|
-
*
|
|
2
|
+
* Type definitions. Without runtime implementation.\
|
|
3
|
+
* Bundler plugin required.
|
|
4
4
|
* ```ts
|
|
5
5
|
* type create = <const T extends Record<string, CreateStyleValue>>(rule: T)=> CreateReturnType<T>;
|
|
6
|
-
* type createTheme = <const T extends CreateTheme>(rule: T)=>
|
|
6
|
+
* type createTheme = <const T extends CreateTheme>(themeSelector: string, rule: T) => CreateThemeReturnType<T>;
|
|
7
7
|
* type createStatic = <const T extends CreateStatic>(rule: T)=> T;
|
|
8
8
|
* type keyframes = <const T extends Keyframes>(rule: T) => string;
|
|
9
9
|
* type viewTransition = <const T extends ViewTransition>(rule: T) => string;
|
|
@@ -21,9 +21,9 @@ declare module '@plumeria/core' {
|
|
|
21
21
|
CreateReturnType,
|
|
22
22
|
CreateStatic,
|
|
23
23
|
CreateTheme,
|
|
24
|
+
CreateThemeReturnType,
|
|
24
25
|
Keyframes,
|
|
25
26
|
ViewTransition,
|
|
26
|
-
ReturnVariableType,
|
|
27
27
|
Variants,
|
|
28
28
|
Marker,
|
|
29
29
|
Extended,
|
|
@@ -46,8 +46,9 @@ declare module '@plumeria/core' {
|
|
|
46
46
|
|
|
47
47
|
export const createTheme: createTheme;
|
|
48
48
|
export type createTheme = <const T extends CreateTheme>(
|
|
49
|
+
themeSelector: string,
|
|
49
50
|
rule: T,
|
|
50
|
-
) =>
|
|
51
|
+
) => CreateThemeReturnType<T>;
|
|
51
52
|
|
|
52
53
|
export const createStatic: createStatic;
|
|
53
54
|
export type createStatic = <const T extends CreateStatic>(rule: T) => T;
|
package/lib/types.d.ts
CHANGED
|
@@ -2,10 +2,16 @@ import type { CSSTypes } from './csstypes';
|
|
|
2
2
|
|
|
3
3
|
type CSSVariableKey = `--${string}`;
|
|
4
4
|
type CSSVariableValue = `var(${CSSVariableKey})`;
|
|
5
|
-
type
|
|
5
|
+
type ThemeValue = {
|
|
6
|
+
default: string | number;
|
|
7
|
+
theme: string | number;
|
|
8
|
+
};
|
|
9
|
+
type CSSVariableProperty = {
|
|
10
|
+
[key: CSSVariableKey]: string | number | ThemeValue;
|
|
11
|
+
};
|
|
6
12
|
|
|
7
13
|
type CommonProperties = {
|
|
8
|
-
[K in keyof CSSTypes]: CSSTypes[K] | CSSVariableValue;
|
|
14
|
+
[K in keyof CSSTypes]: CSSTypes[K] | CSSVariableValue | ThemeValue;
|
|
9
15
|
};
|
|
10
16
|
|
|
11
17
|
type ArrayString = `[${string}`;
|
|
@@ -46,8 +52,14 @@ type StyleName = CSSProperties | (false | CSSProperties | null | undefined)[];
|
|
|
46
52
|
|
|
47
53
|
type CreateStatic = Record<string, string | number>;
|
|
48
54
|
|
|
49
|
-
type
|
|
50
|
-
|
|
55
|
+
type ReadonlyTheme<T> = Readonly<T> & CSSVariableValue;
|
|
56
|
+
|
|
57
|
+
type CreateTheme = {
|
|
58
|
+
[key: string]: ThemeValue;
|
|
59
|
+
};
|
|
60
|
+
type CreateThemeReturnType<T> = {
|
|
61
|
+
readonly [K in keyof T]: ReadonlyTheme<T[K]>;
|
|
62
|
+
};
|
|
51
63
|
|
|
52
64
|
type KeyframesInSelector = 'from' | 'to' | `${number}%`;
|
|
53
65
|
type Keyframes = {
|
|
@@ -81,7 +93,7 @@ export type {
|
|
|
81
93
|
CreateTheme,
|
|
82
94
|
Keyframes,
|
|
83
95
|
ViewTransition,
|
|
84
|
-
|
|
96
|
+
CreateThemeReturnType,
|
|
85
97
|
Variants,
|
|
86
98
|
Marker,
|
|
87
99
|
Extended,
|