@plumeria/core 7.1.2 → 7.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/dist/css.d.ts +20 -0
- package/dist/css.js +12 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3 -0
- package/dist/types.d.ts +94 -0
- package/dist/types.js +1 -0
- package/package.json +7 -5
- package/dist/css.d.mts +0 -82
- package/dist/css.mjs +0 -14
package/dist/css.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CSSProperties, CreateStyleType, CreateStatic, CreateTheme, Keyframes, ViewTransition, ReturnType, ReturnVariableType, Variant, ContainerStyleQuery } from './types';
|
|
2
|
+
export type create = typeof create;
|
|
3
|
+
export type props = typeof props;
|
|
4
|
+
export type createTheme = typeof createTheme;
|
|
5
|
+
export type createStatic = typeof createStatic;
|
|
6
|
+
export type keyframes = typeof keyframes;
|
|
7
|
+
export type viewTransition = typeof viewTransition;
|
|
8
|
+
export type variants = typeof variants;
|
|
9
|
+
export type marker = typeof marker;
|
|
10
|
+
export type extended = typeof extended;
|
|
11
|
+
export declare const create: <const T extends Record<string, CSSProperties>>(_rule: CreateStyleType<T>) => ReturnType<T>;
|
|
12
|
+
export declare const props: (..._rules: (false | CSSProperties | null | undefined)[]) => string;
|
|
13
|
+
export declare const createTheme: <const T extends CreateTheme>(_rule: T) => ReturnVariableType<T>;
|
|
14
|
+
export declare const createStatic: <const T extends CreateStatic>(_rule: T) => T;
|
|
15
|
+
export declare const keyframes: (_rule: Keyframes) => string;
|
|
16
|
+
export declare const viewTransition: (_rule: ViewTransition) => string;
|
|
17
|
+
export declare const variants: <T extends Variant>(_rule: T) => (_props: { [K in keyof T]?: keyof T[K]; }) => CSSProperties;
|
|
18
|
+
export declare const marker: (_id: string, _pseudo: string) => CSSProperties;
|
|
19
|
+
export declare const extended: (_id: string, _pseudo: string) => ContainerStyleQuery;
|
|
20
|
+
export type { CreateStyle, CSSProperties } from './types';
|
package/dist/css.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const runtimeNotSupported = () => {
|
|
2
|
+
throw new Error('Runtime is not supported. Configure the bundler plugin.');
|
|
3
|
+
};
|
|
4
|
+
export const create = (_rule) => runtimeNotSupported();
|
|
5
|
+
export const props = (..._rules) => runtimeNotSupported();
|
|
6
|
+
export const createTheme = (_rule) => runtimeNotSupported();
|
|
7
|
+
export const createStatic = (_rule) => runtimeNotSupported();
|
|
8
|
+
export const keyframes = (_rule) => runtimeNotSupported();
|
|
9
|
+
export const viewTransition = (_rule) => runtimeNotSupported();
|
|
10
|
+
export const variants = (_rule) => (_props) => runtimeNotSupported();
|
|
11
|
+
export const marker = (_id, _pseudo) => runtimeNotSupported();
|
|
12
|
+
export const extended = (_id, _pseudo) => runtimeNotSupported();
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Properties, Property } from 'csstype';
|
|
2
|
+
type CSSVariableKey = `--${string}`;
|
|
3
|
+
type CSSVariableValue = `var(${CSSVariableKey})`;
|
|
4
|
+
type CSSVariableProperty = {
|
|
5
|
+
[key: CSSVariableKey]: string | number;
|
|
6
|
+
};
|
|
7
|
+
type ColorValue = Exclude<Property.Color, '-moz-initial'> | (string & {});
|
|
8
|
+
type CSSColorProperty = Exclude<ColorValue, SystemColorKeyword>;
|
|
9
|
+
type SystemColorKeyword = 'ActiveBorder' | 'ActiveCaption' | 'AppWorkspace' | 'Background' | 'ButtonFace' | 'ButtonHighlight' | 'ButtonShadow' | 'ButtonText' | 'CaptionText' | 'GrayText' | 'Highlight' | 'HighlightText' | 'InactiveBorder' | 'InactiveCaption' | 'InactiveCaptionText' | 'InfoBackground' | 'InfoText' | 'Menu' | 'MenuText' | 'Scrollbar' | 'ThreeDDarkShadow' | 'ThreeDFace' | 'ThreeDHighlight' | 'ThreeDLightShadow' | 'ThreeDShadow' | 'Window' | 'WindowFrame' | 'WindowText';
|
|
10
|
+
type ExcludeMozInitial<T> = Exclude<T, '-moz-initial'>;
|
|
11
|
+
type CSSTypeProperties = Properties<number | (string & {})>;
|
|
12
|
+
type CustomProperties = {
|
|
13
|
+
[K in keyof CSSTypeProperties]: ExcludeMozInitial<CSSTypeProperties[K]>;
|
|
14
|
+
};
|
|
15
|
+
type BaseCSSProperties = {
|
|
16
|
+
[K in keyof CustomProperties]: CustomProperties[K] | CSSVariableValue;
|
|
17
|
+
};
|
|
18
|
+
interface CommonProperties extends BaseCSSProperties {
|
|
19
|
+
accentColor?: CSSColorProperty;
|
|
20
|
+
color?: CSSColorProperty;
|
|
21
|
+
borderLeftColor?: CSSColorProperty;
|
|
22
|
+
borderRightColor?: CSSColorProperty;
|
|
23
|
+
borderTopColor?: CSSColorProperty;
|
|
24
|
+
borderBottomColor?: CSSColorProperty;
|
|
25
|
+
borderBlockColor?: CSSColorProperty;
|
|
26
|
+
borderBlockStartColor?: CSSColorProperty;
|
|
27
|
+
borderBlockEndColor?: CSSColorProperty;
|
|
28
|
+
borderInlineColor?: CSSColorProperty;
|
|
29
|
+
borderInlineStartColor?: CSSColorProperty;
|
|
30
|
+
borderInlineEndColor?: CSSColorProperty;
|
|
31
|
+
backgroundColor?: CSSColorProperty;
|
|
32
|
+
outlineColor?: CSSColorProperty;
|
|
33
|
+
textDecorationColor?: CSSColorProperty;
|
|
34
|
+
caretColor?: CSSColorProperty;
|
|
35
|
+
columnRuleColor?: CSSColorProperty;
|
|
36
|
+
}
|
|
37
|
+
type ArrayString = `[${string}`;
|
|
38
|
+
type ArraySelector = {
|
|
39
|
+
[key in ArrayString]: CommonProperties | CSSVariableProperty;
|
|
40
|
+
};
|
|
41
|
+
type ColonString = `:${string}`;
|
|
42
|
+
type ColonSelector = {
|
|
43
|
+
[key in ColonString]: CommonProperties | CSSVariableProperty;
|
|
44
|
+
};
|
|
45
|
+
type Query = `@media ${string}` | `@container ${string}`;
|
|
46
|
+
type QuerySelector = {
|
|
47
|
+
[K in Query]: CommonProperties | ColonSelector | ArraySelector | CSSVariableProperty;
|
|
48
|
+
};
|
|
49
|
+
type CSSProperties = CommonProperties | ArraySelector | ColonSelector | QuerySelector | CSSVariableProperty;
|
|
50
|
+
type CreateStyleType<T> = {
|
|
51
|
+
readonly [K in keyof T]: T[K] extends CSSProperties ? CSSProperties : T[K];
|
|
52
|
+
};
|
|
53
|
+
type CreateStyle = {
|
|
54
|
+
[key: string]: CSSProperties;
|
|
55
|
+
};
|
|
56
|
+
type Selector<Properties> = {
|
|
57
|
+
readonly properties: Properties;
|
|
58
|
+
};
|
|
59
|
+
type ReturnType<T> = {
|
|
60
|
+
[K in keyof T]: Readonly<{
|
|
61
|
+
[P in keyof T[K]]: P extends `@media ${string}` | `@container ${string}` | `:${string}` | `[${string}` ? Selector<keyof T[K][P]> : T[K][P];
|
|
62
|
+
}>;
|
|
63
|
+
};
|
|
64
|
+
type CreateStatic = Record<string, string | number>;
|
|
65
|
+
type CreateTheme = Record<string, Record<string, string | number>>;
|
|
66
|
+
type ReturnVariableType<T> = {
|
|
67
|
+
[K in keyof T]: CSSVariableValue;
|
|
68
|
+
};
|
|
69
|
+
type KeyframesInSelector = 'from' | 'to' | `${number}%`;
|
|
70
|
+
type Keyframes = {
|
|
71
|
+
[K in KeyframesInSelector]?: CSSProperties;
|
|
72
|
+
};
|
|
73
|
+
type ViewTransition = {
|
|
74
|
+
group?: CSSProperties;
|
|
75
|
+
imagePair?: CSSProperties;
|
|
76
|
+
new?: CSSProperties;
|
|
77
|
+
old?: CSSProperties;
|
|
78
|
+
};
|
|
79
|
+
type Variant = Record<string, Record<string, CSSProperties>>;
|
|
80
|
+
type ContainerStyleQuery = `@container style(--${string}: 1)`;
|
|
81
|
+
type StaticDefault = {
|
|
82
|
+
create: <const T extends Record<string, CSSProperties>>(_rule: CreateStyleType<T>) => ReturnType<T>;
|
|
83
|
+
props: (..._rules: (false | CSSProperties | null | undefined)[]) => string;
|
|
84
|
+
createTheme: <const T extends CreateTheme>(_rule: T) => ReturnVariableType<T>;
|
|
85
|
+
createStatic: <const T extends CreateStatic>(_rule: T) => T;
|
|
86
|
+
keyframes: (_rule: Keyframes) => string;
|
|
87
|
+
viewTransition: (_rule: ViewTransition) => string;
|
|
88
|
+
variants: <T extends Variant>(_rule: T) => (_props: {
|
|
89
|
+
[K in keyof T]?: keyof T[K];
|
|
90
|
+
}) => CSSProperties;
|
|
91
|
+
marker: (_id: string, _pseudo: string) => CSSProperties;
|
|
92
|
+
extended: (_id: string, _pseudo: string) => ContainerStyleQuery;
|
|
93
|
+
};
|
|
94
|
+
export { StaticDefault, CSSProperties, CreateStyle, CreateStyleType, CreateStatic, CreateTheme, Keyframes, ViewTransition, ReturnType, ReturnVariableType, Variant, ContainerStyleQuery, };
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/core",
|
|
3
|
-
"version": "7.1
|
|
3
|
+
"version": "7.2.1",
|
|
4
4
|
"description": "An atomic CSS runtime designed to disappear.",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
"react-native-web"
|
|
25
25
|
],
|
|
26
26
|
"sideEffects": false,
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "dist/index.js",
|
|
29
|
+
"module": "dist/index.js",
|
|
30
|
+
"types": "dist/index.d.ts",
|
|
30
31
|
"files": [
|
|
31
32
|
"dist/"
|
|
32
33
|
],
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
"provenance": true
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|
|
41
|
-
"build": "
|
|
42
|
+
"build": "rimraf dist && pnpm esm",
|
|
43
|
+
"esm": "tsc --project tsconfig.esm.json"
|
|
42
44
|
}
|
|
43
45
|
}
|
package/dist/css.d.mts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { Properties, Property } from "csstype";
|
|
2
|
-
|
|
3
|
-
type CSSVariableKey = `--${string}`;
|
|
4
|
-
type CSSVariableValue = `var(${CSSVariableKey})`;
|
|
5
|
-
type CSSVariableProperty = {
|
|
6
|
-
[key: CSSVariableKey]: string | number;
|
|
7
|
-
};
|
|
8
|
-
type ColorValue = Exclude<Property.Color, '-moz-initial'> | (string & {});
|
|
9
|
-
type CSSColorProperty = Exclude<ColorValue, SystemColorKeyword>;
|
|
10
|
-
type SystemColorKeyword = 'ActiveBorder' | 'ActiveCaption' | 'AppWorkspace' | 'Background' | 'ButtonFace' | 'ButtonHighlight' | 'ButtonShadow' | 'ButtonText' | 'CaptionText' | 'GrayText' | 'Highlight' | 'HighlightText' | 'InactiveBorder' | 'InactiveCaption' | 'InactiveCaptionText' | 'InfoBackground' | 'InfoText' | 'Menu' | 'MenuText' | 'Scrollbar' | 'ThreeDDarkShadow' | 'ThreeDFace' | 'ThreeDHighlight' | 'ThreeDLightShadow' | 'ThreeDShadow' | 'Window' | 'WindowFrame' | 'WindowText';
|
|
11
|
-
type ExcludeMozInitial<T> = Exclude<T, '-moz-initial'>;
|
|
12
|
-
type CSSTypeProperties = Properties<number | (string & {})>;
|
|
13
|
-
type CustomProperties = { [K in keyof CSSTypeProperties]: ExcludeMozInitial<CSSTypeProperties[K]> };
|
|
14
|
-
type BaseCSSProperties = { [K in keyof CustomProperties]: CustomProperties[K] | CSSVariableValue };
|
|
15
|
-
interface CommonProperties extends BaseCSSProperties {
|
|
16
|
-
accentColor?: CSSColorProperty;
|
|
17
|
-
color?: CSSColorProperty;
|
|
18
|
-
borderLeftColor?: CSSColorProperty;
|
|
19
|
-
borderRightColor?: CSSColorProperty;
|
|
20
|
-
borderTopColor?: CSSColorProperty;
|
|
21
|
-
borderBottomColor?: CSSColorProperty;
|
|
22
|
-
borderBlockColor?: CSSColorProperty;
|
|
23
|
-
borderBlockStartColor?: CSSColorProperty;
|
|
24
|
-
borderBlockEndColor?: CSSColorProperty;
|
|
25
|
-
borderInlineColor?: CSSColorProperty;
|
|
26
|
-
borderInlineStartColor?: CSSColorProperty;
|
|
27
|
-
borderInlineEndColor?: CSSColorProperty;
|
|
28
|
-
backgroundColor?: CSSColorProperty;
|
|
29
|
-
outlineColor?: CSSColorProperty;
|
|
30
|
-
textDecorationColor?: CSSColorProperty;
|
|
31
|
-
caretColor?: CSSColorProperty;
|
|
32
|
-
columnRuleColor?: CSSColorProperty;
|
|
33
|
-
}
|
|
34
|
-
type ArrayString = `[${string}`;
|
|
35
|
-
type ArraySelector = { [key in ArrayString]: CommonProperties | CSSVariableProperty };
|
|
36
|
-
type ColonString = `:${string}`;
|
|
37
|
-
type ColonSelector = { [key in ColonString]: CommonProperties | CSSVariableProperty };
|
|
38
|
-
type Query = `@media ${string}` | `@container ${string}`;
|
|
39
|
-
type QuerySelector = { [K in Query]: CommonProperties | ColonSelector | ArraySelector | CSSVariableProperty };
|
|
40
|
-
type CSSProperties = CommonProperties | ArraySelector | ColonSelector | QuerySelector | CSSVariableProperty;
|
|
41
|
-
type CreateStyleType<T> = { readonly [K in keyof T]: T[K] extends CSSProperties ? CSSProperties : T[K] };
|
|
42
|
-
type CreateStyle = {
|
|
43
|
-
[key: string]: CSSProperties;
|
|
44
|
-
};
|
|
45
|
-
type Selector<Properties> = {
|
|
46
|
-
readonly properties: Properties;
|
|
47
|
-
};
|
|
48
|
-
type ReturnType<T> = { [K in keyof T]: Readonly<{ [P in keyof T[K]]: P extends `@media ${string}` | `@container ${string}` | `:${string}` | `[${string}` ? Selector<keyof T[K][P]> : T[K][P] }> };
|
|
49
|
-
type CreateStatic = Record<string, string | number>;
|
|
50
|
-
type CreateTheme = Record<string, Record<string, string | number>>;
|
|
51
|
-
type ReturnVariableType<T> = { [K in keyof T]: CSSVariableValue };
|
|
52
|
-
type KeyframesInSelector = 'from' | 'to' | `${number}%`;
|
|
53
|
-
type Keyframes = { [K in KeyframesInSelector]?: CSSProperties };
|
|
54
|
-
type ViewTransition = {
|
|
55
|
-
group?: CSSProperties;
|
|
56
|
-
imagePair?: CSSProperties;
|
|
57
|
-
new?: CSSProperties;
|
|
58
|
-
old?: CSSProperties;
|
|
59
|
-
};
|
|
60
|
-
type Variant = Record<string, Record<string, CSSProperties>>;
|
|
61
|
-
type ContainerStyleQuery = `@container style(--${string}: 1)`;
|
|
62
|
-
|
|
63
|
-
type create = typeof create;
|
|
64
|
-
type props = typeof props;
|
|
65
|
-
type createTheme = typeof createTheme;
|
|
66
|
-
type createStatic = typeof createStatic;
|
|
67
|
-
type keyframes = typeof keyframes;
|
|
68
|
-
type viewTransition = typeof viewTransition;
|
|
69
|
-
type variants = typeof variants;
|
|
70
|
-
type marker = typeof marker;
|
|
71
|
-
type extended = typeof extended;
|
|
72
|
-
declare const create: <const T extends Record<string, CSSProperties>>(_rule: CreateStyleType<T>) => ReturnType<T>;
|
|
73
|
-
declare const props: (..._rules: (false | CSSProperties | null | undefined)[]) => string;
|
|
74
|
-
declare const createTheme: <const T extends CreateTheme>(_rule: T) => ReturnVariableType<T>;
|
|
75
|
-
declare const createStatic: <const T extends CreateStatic>(_rule: T) => T;
|
|
76
|
-
declare const keyframes: (_rule: Keyframes) => string;
|
|
77
|
-
declare const viewTransition: (_rule: ViewTransition) => string;
|
|
78
|
-
declare const variants: <T extends Variant>(_rule: T) => (_props: { [K in keyof T]?: keyof T[K] }) => CSSProperties;
|
|
79
|
-
declare const marker: (_id: string, _pseudo: string) => CSSProperties;
|
|
80
|
-
declare const extended: (_id: string, _pseudo: string) => ContainerStyleQuery;
|
|
81
|
-
|
|
82
|
-
export { type CSSProperties, type CreateStyle, create, createStatic, createTheme, extended, keyframes, marker, props, variants, viewTransition };
|
package/dist/css.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const runtimeNotSupported = () => {
|
|
2
|
-
throw new Error("Runtime is not supported. Configure the bundler plugin.");
|
|
3
|
-
};
|
|
4
|
-
const create = (_rule) => runtimeNotSupported();
|
|
5
|
-
const props = (..._rules) => runtimeNotSupported();
|
|
6
|
-
const createTheme = (_rule) => runtimeNotSupported();
|
|
7
|
-
const createStatic = (_rule) => runtimeNotSupported();
|
|
8
|
-
const keyframes = (_rule) => runtimeNotSupported();
|
|
9
|
-
const viewTransition = (_rule) => runtimeNotSupported();
|
|
10
|
-
const variants = (_rule) => (_props) => runtimeNotSupported();
|
|
11
|
-
const marker = (_id, _pseudo) => runtimeNotSupported();
|
|
12
|
-
const extended = (_id, _pseudo) => runtimeNotSupported();
|
|
13
|
-
|
|
14
|
-
export { create, createStatic, createTheme, extended, keyframes, marker, props, variants, viewTransition };
|