@plumeria/core 7.3.0 → 7.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "7.3.0",
3
+ "version": "7.3.2",
4
4
  "description": "A type-only atomic CSS framework.",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
package/types/css.d.ts CHANGED
@@ -8,22 +8,23 @@
8
8
  * type keyframes = (_rule: Keyframes) => string;
9
9
  * type viewTransition = (_rule: ViewTransition) => string;
10
10
  * type variants = <T extends Variants>(_rule: T) => (_props: { [K in keyof T]?: keyof T[K] }) => CSSProperties;
11
- * type marker = (_id: string, _pseudo: string) => CSSProperties;
12
- * type extended = (_id: string, _pseudo: string) => ContainerStyleQuery;
11
+ * type marker = (_id: string, _pseudo: string) => Marker;
12
+ * type extended = <I extends string, P extends string>(_id: I, _pseudo: P) => Extended<I, P>;
13
13
  * ```
14
14
  */
15
15
  declare module '@plumeria/core' {
16
- export type CSSProperties = import('./definition').CSSProperties;
17
- export type CreateStyle = import('./definition').CreateStyle;
18
- export type CreateStyleType<T> = import('./definition').CreateStyleType<T>;
19
- export type CreateStatic = import('./definition').CreateStatic;
20
- export type CreateTheme = import('./definition').CreateTheme;
21
- export type Keyframes = import('./definition').Keyframes;
22
- export type ViewTransition = import('./definition').ViewTransition;
23
- export type ReturnType<T> = import('./definition').ReturnType<T>;
24
- export type ReturnVariableType<T> = import('./definition').ReturnVariableType<T>;
25
- export type Variants = import('./definition').Variants;
26
- export type ContainerStyleQuery = import('./definition').ContainerStyleQuery;
16
+ export type CSSProperties = import('./definitions').CSSProperties;
17
+ export type CreateStyle = import('./definitions').CreateStyle;
18
+ export type CreateStyleType<T> = import('./definitions').CreateStyleType<T>;
19
+ export type CreateStatic = import('./definitions').CreateStatic;
20
+ export type CreateTheme = import('./definitions').CreateTheme;
21
+ export type Keyframes = import('./definitions').Keyframes;
22
+ export type ViewTransition = import('./definitions').ViewTransition;
23
+ export type ReturnType<T> = import('./definitions').ReturnType<T>;
24
+ export type ReturnVariableType<T> = import('./definitions').ReturnVariableType<T>;
25
+ export type Variants = import('./definitions').Variants;
26
+ export type Marker = import('./definitions').Marker;
27
+ export type Extended<I extends string, P extends string> = import('./definitions').Extended<I, P>;
27
28
  export type create = <const T extends Record<string, CSSProperties>>(_rule: CreateStyleType<T>)=> ReturnType<T>;
28
29
  export type props = (..._rules: (false | CSSProperties | null | undefined)[])=> string;
29
30
  export type createTheme = <const T extends CreateTheme>(_rule: T)=> ReturnVariableType<T>;
@@ -31,8 +32,8 @@ declare module '@plumeria/core' {
31
32
  export type keyframes = (_rule: Keyframes) => string;
32
33
  export type viewTransition = (_rule: ViewTransition) => string;
33
34
  export type variants = <T extends Variants>(_rule: T) => (_props: { [K in keyof T]?: keyof T[K] }) => CSSProperties;
34
- export type marker = (_id: string, _pseudo: string) => CSSProperties;
35
- export type extended = (_id: string, _pseudo: string) => ContainerStyleQuery;
35
+ export type marker = (_id: string, _pseudo: string) => Marker;
36
+ export type extended = <I extends string, P extends string>(_id: I, _pseudo: P) => Extended<I, P>;
36
37
  export const create: create;
37
38
  export const props: props;
38
39
  export const createTheme: createTheme;
@@ -103,19 +103,9 @@ type CreateStyle = {
103
103
  [key: string]: CSSProperties;
104
104
  };
105
105
 
106
- type Selector<Properties> = {
107
- readonly properties: Properties;
108
- };
109
-
110
106
  type ReturnType<T> = {
111
107
  [K in keyof T]: Readonly<{
112
- [P in keyof T[K]]: P extends
113
- | `@media ${string}`
114
- | `@container ${string}`
115
- | `:${string}`
116
- | `[${string}`
117
- ? Selector<keyof T[K][P]>
118
- : T[K][P];
108
+ [P in keyof T[K]]: T[K][P];
119
109
  }>;
120
110
  };
121
111
 
@@ -138,7 +128,13 @@ type ViewTransition = {
138
128
 
139
129
  type Variants = Record<string, Record<string, CSSProperties>>;
140
130
 
141
- type ContainerStyleQuery = `@container style(--${string}: 1)`;
131
+ type Marker = Record<string, CSSProperties>;
132
+
133
+ type StripColon<T extends string> = T extends `:${infer R}`
134
+ ? StripColon<R>
135
+ : T;
136
+
137
+ type Extended<I extends string, P extends string> = `@container style(--${I}-${StripColon<P>}: 1)`;
142
138
 
143
139
  export type {
144
140
  CSSProperties,
@@ -151,5 +147,6 @@ export type {
151
147
  ReturnType,
152
148
  ReturnVariableType,
153
149
  Variants,
154
- ContainerStyleQuery,
150
+ Marker,
151
+ Extended,
155
152
  };