@plumeria/core 19.14.4 → 20.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/lib/css.d.ts CHANGED
@@ -7,6 +7,8 @@
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;
10
+ * type positionTry = <const T extends PositionTry>(rule: T) => CSSVariableKey;
11
+ * type varType = <const T extends VarType>(rule: T) => CSSVariableKey;
10
12
  * type marker = (id: string, pseudo: string) => Marker;
11
13
  * type extended = <I extends string, P extends string>(id: I, pseudo: P) => Extended<I, P>;
12
14
  * type use = (...rules: Style[]) => string;
@@ -31,6 +33,9 @@ declare module '@plumeria/core' {
31
33
  CreateStatic,
32
34
  Keyframes,
33
35
  ViewTransition,
36
+ PositionTry,
37
+ VarType,
38
+ CSSVariableKey,
34
39
  Marker,
35
40
  Extended,
36
41
  } from '#types';
@@ -69,6 +74,14 @@ declare module '@plumeria/core' {
69
74
  rule: T,
70
75
  ) => string;
71
76
 
77
+ export const positionTry: positionTry;
78
+ export type positionTry = <const T extends PositionTry>(
79
+ rule: T,
80
+ ) => CSSVariableKey;
81
+
82
+ export const varType: varType;
83
+ export type varType = <const T extends VarType>(rule: T) => CSSVariableKey;
84
+
72
85
  export const marker: marker;
73
86
  export type marker = (id: string, pseudo: string) => Marker;
74
87
 
package/lib/types.d.ts CHANGED
@@ -24,8 +24,11 @@ type ColonSelector = {
24
24
  [key in ColonString]: CommonProperties | CSSVariableProperty;
25
25
  };
26
26
 
27
- type AtKeyword = '@media' | '@container' | '@supports' | '@layer' | '@scope';
28
- type AtRule = `${AtKeyword} ${string}` | `${AtKeyword}(${string}`;
27
+ type AtKeyword = '@media' | '@container' | '@supports';
28
+ type AtRule =
29
+ | `${AtKeyword} ${string}`
30
+ | `${AtKeyword}(${string}`
31
+ | '@starting-style';
29
32
 
30
33
  type StyleKey = keyof CSSTypes;
31
34
  type NestedKey = ColonString | ArrayString | AtRule;
@@ -152,6 +155,79 @@ type ViewTransition = {
152
155
  old?: CSSProperties;
153
156
  };
154
157
 
158
+ type PositionTryProperty =
159
+ | 'positionAnchor'
160
+ | 'positionArea'
161
+ | 'inset'
162
+ | 'insetBlock'
163
+ | 'insetBlockStart'
164
+ | 'insetBlockEnd'
165
+ | 'insetInline'
166
+ | 'insetInlineStart'
167
+ | 'insetInlineEnd'
168
+ | 'top'
169
+ | 'right'
170
+ | 'bottom'
171
+ | 'left'
172
+ | 'placeSelf'
173
+ | 'alignSelf'
174
+ | 'justifySelf'
175
+ | 'inlineSize'
176
+ | 'minInlineSize'
177
+ | 'maxInlineSize'
178
+ | 'width'
179
+ | 'minWidth'
180
+ | 'maxWidth'
181
+ | 'blockSize'
182
+ | 'minBlockSize'
183
+ | 'maxBlockSize'
184
+ | 'height'
185
+ | 'minHeight'
186
+ | 'maxHeight'
187
+ | 'margin'
188
+ | 'marginBlock'
189
+ | 'marginBlockStart'
190
+ | 'marginBlockEnd'
191
+ | 'marginInline'
192
+ | 'marginInlineStart'
193
+ | 'marginInlineEnd'
194
+ | 'marginTop'
195
+ | 'marginRight'
196
+ | 'marginBottom'
197
+ | 'marginLeft';
198
+
199
+ type PositionTry = Pick<CommonProperties, PositionTryProperty>;
200
+
201
+ type VarTypeSyntax =
202
+ | '<angle>'
203
+ | '<color>'
204
+ | '<custom-ident>'
205
+ | '<image>'
206
+ | '<integer>'
207
+ | '<length>'
208
+ | '<length-percentage>'
209
+ | '<number>'
210
+ | '<percentage>'
211
+ | '<resolution>'
212
+ | '<string>'
213
+ | '<time>'
214
+ | '<transform-function>'
215
+ | '<transform-list>'
216
+ | '<url>'
217
+ | (string & {});
218
+
219
+ type VarType =
220
+ | {
221
+ syntax: '*';
222
+ inherits?: boolean;
223
+ initialValue?: string;
224
+ }
225
+ | {
226
+ syntax: VarTypeSyntax;
227
+ inherits?: boolean;
228
+ initialValue: string;
229
+ };
230
+
155
231
  type StripColon<T extends string> = T extends `:${infer R}` ? StripColon<R> : T;
156
232
 
157
233
  type Extended<
@@ -179,6 +255,9 @@ export type {
179
255
  CreateStatic,
180
256
  Keyframes,
181
257
  ViewTransition,
258
+ PositionTry,
259
+ VarType,
260
+ CSSVariableKey,
182
261
  Marker,
183
262
  Extended,
184
263
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "19.14.4",
3
+ "version": "20.0.0",
4
4
  "description": "Zero-cost abstraction layer for styling React components.",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",