@plumeria/core 5.0.0 → 6.0.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/dist/css.d.mts +4 -2
- package/dist/css.mjs +5 -18
- package/package.json +1 -1
package/dist/css.d.mts
CHANGED
|
@@ -60,19 +60,21 @@ type ViewTransition = {
|
|
|
60
60
|
new?: CSSProperties;
|
|
61
61
|
old?: CSSProperties;
|
|
62
62
|
};
|
|
63
|
+
type Variant = Record<string, Record<string, CSSProperties>>;
|
|
63
64
|
|
|
65
|
+
type css = typeof css;
|
|
64
66
|
declare const x: (className: string, style: Style) => {
|
|
65
67
|
className: string;
|
|
66
68
|
style: Style;
|
|
67
69
|
};
|
|
68
70
|
declare const css: {
|
|
69
71
|
create: <const T extends Record<string, CSSProperties>>(_rule: CreateStyleType<T>) => ReturnType<T>;
|
|
70
|
-
props: (...
|
|
72
|
+
props: (..._rules: (false | CSSProperties | null | undefined)[]) => string;
|
|
71
73
|
createTheme: <const T extends CreateTheme>(_rule: T) => ReturnVariableType<T>;
|
|
72
74
|
createStatic: <const T extends CreateStatic>(_rule: T) => T;
|
|
73
75
|
keyframes: (_rule: Keyframes) => string;
|
|
74
76
|
viewTransition: (_rule: ViewTransition) => string;
|
|
77
|
+
variants: <T extends Variant>(_rule: T) => (_props: { [K in keyof T]?: keyof T[K] }) => CSSProperties;
|
|
75
78
|
};
|
|
76
|
-
type css = typeof css;
|
|
77
79
|
|
|
78
80
|
export { type CSSProperties, type CreateStyle, css, x };
|
package/dist/css.mjs
CHANGED
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
const errorFn = () => {
|
|
2
|
-
throw new Error("Runtime
|
|
3
|
-
};
|
|
4
|
-
const defined = new Set();
|
|
5
|
-
const props = (...rules) => {
|
|
6
|
-
defined.clear();
|
|
7
|
-
let result = "";
|
|
8
|
-
for (let i = rules.length - 1; i >= 0; i--) {
|
|
9
|
-
const arg = rules[i];
|
|
10
|
-
if (!arg || typeof arg !== "object") continue;
|
|
11
|
-
let chunk = "";
|
|
12
|
-
for (const key in arg) if (arg[key] && !defined.has(key)) {
|
|
13
|
-
defined.add(key);
|
|
14
|
-
chunk += chunk ? " " + arg[key] : arg[key];
|
|
15
|
-
}
|
|
16
|
-
if (chunk) result = result ? chunk + " " + result : chunk;
|
|
17
|
-
}
|
|
18
|
-
return result;
|
|
2
|
+
throw new Error("Runtime is not supported. Configure the bundler plugin.");
|
|
19
3
|
};
|
|
4
|
+
const props = (..._rules) => errorFn();
|
|
20
5
|
const create = (_rule) => errorFn();
|
|
21
6
|
const createTheme = (_rule) => errorFn();
|
|
22
7
|
const createStatic = (_rule) => errorFn();
|
|
23
8
|
const keyframes = (_rule) => errorFn();
|
|
24
9
|
const viewTransition = (_rule) => errorFn();
|
|
10
|
+
const variants = (_rule) => (_props) => errorFn();
|
|
25
11
|
const x = (className, style) => ({
|
|
26
12
|
className,
|
|
27
13
|
style
|
|
@@ -32,7 +18,8 @@ const css = {
|
|
|
32
18
|
createTheme,
|
|
33
19
|
createStatic,
|
|
34
20
|
keyframes,
|
|
35
|
-
viewTransition
|
|
21
|
+
viewTransition,
|
|
22
|
+
variants
|
|
36
23
|
};
|
|
37
24
|
|
|
38
25
|
export { css, x };
|