zss-engine 0.2.44 → 0.2.46

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": "zss-engine",
3
- "version": "0.2.44",
3
+ "version": "0.2.46",
4
4
  "description": "Zero-runtime StyleSheet Engine",
5
5
  "keywords": [
6
6
  "zero-runtime",
@@ -38,9 +38,9 @@ type ColonString = `:${string}`;
38
38
  type ColonSelector = {
39
39
  [key in ColonString]: CommonProperties;
40
40
  };
41
- export type MediaQuery = `@media ${string}`;
42
- type MediaQuerySelector = {
43
- [K in MediaQuery]: CommonProperties | ColonSelector | AndSelector;
41
+ export type Query = `@media ${string}` | `@container ${string}`;
42
+ type QuerySelector = {
43
+ [K in Query]: CommonProperties | ColonSelector | AndSelector;
44
44
  };
45
- export type CSSProperties = CommonProperties | AndSelector | ColonSelector | MediaQuerySelector | CSSVariableProperty;
45
+ export type CSSProperties = CommonProperties | AndSelector | ColonSelector | QuerySelector | CSSVariableProperty;
46
46
  export {};
@@ -0,0 +1,5 @@
1
+ type PropertyValue = string | number | Properties;
2
+ export type Properties = {
3
+ [key: string]: PropertyValue;
4
+ };
5
+ export {};
@@ -5,6 +5,12 @@ export type CreateStyleType<T> = {
5
5
  export type CreateStyle = {
6
6
  [key: string]: CSSProperties;
7
7
  };
8
+ type Selector<Properties> = {
9
+ readonly properties: Properties;
10
+ };
8
11
  export type ReturnType<T> = {
9
- [K in keyof T]: Readonly<T[K]>;
12
+ [K in keyof T]: Readonly<{
13
+ [P in keyof T[K]]: P extends `@media ${string}` | `@container ${string}` | `:${string}` | `&${string}` ? Selector<keyof T[K][P]> : Readonly<T[K][P]>;
14
+ }>;
10
15
  };
16
+ export {};
@@ -1,37 +1,37 @@
1
- import type { CSSProperties, MediaQuery } from '../common/css-properties';
1
+ import type { CSSProperties, Query } from '../common/css-properties';
2
2
  type JSXType = keyof HTMLElementTagNameMap | '*' | ':root';
3
- type HTMLType = {
3
+ type HTMLSelector = {
4
4
  [K in JSXType]: CSSProperties;
5
5
  };
6
6
  type ClassName = `.${string}`;
7
- type ClassNameType = {
7
+ type ClassNameSelector = {
8
8
  [K in ClassName]: CSSProperties;
9
9
  };
10
10
  type Attribute = `${string}[${string}]${string}`;
11
- type AttributeType = {
11
+ type AttributeSelector = {
12
12
  [K in Attribute]: CSSProperties;
13
13
  };
14
14
  type Consecutive = `${JSXType} ${string}`;
15
- type ConsecutiveType = {
15
+ type ConsecutiveSelector = {
16
16
  [K in Consecutive]: CSSProperties;
17
17
  };
18
18
  type PseudoClass = `${JSXType}:${string}`;
19
- type PseudoClassType = {
19
+ type PseudoClassSelector = {
20
20
  [K in PseudoClass]: CSSProperties;
21
21
  };
22
22
  type PseudoElement = `::${string}`;
23
- type PseudoElementType = {
23
+ type PseudoElementSelector = {
24
24
  [K in PseudoElement]: CSSProperties;
25
25
  };
26
- type KeyframeSelector = 'from' | 'to' | `${number}%`;
26
+ type KeyframesInSelector = 'from' | 'to' | `${number}%`;
27
27
  export type CreateKeyframes = {
28
- [K in KeyframeSelector]?: CSSProperties;
28
+ [K in KeyframesInSelector]?: CSSProperties;
29
29
  };
30
- type KeyframesType = {
30
+ type KeyframesSelector = {
31
31
  [K in `@keyframes ${string}`]: CreateKeyframes;
32
32
  };
33
- type MediaQueryHTMLType = {
34
- [K in MediaQuery]: CSSHTML;
33
+ type QuerySelectorHTML = {
34
+ [K in Query]: CSSHTML;
35
35
  };
36
- export type CSSHTML = HTMLType | ClassNameType | AttributeType | ConsecutiveType | PseudoClassType | PseudoElementType | KeyframesType | MediaQueryHTMLType;
36
+ export type CSSHTML = HTMLSelector | ClassNameSelector | AttributeSelector | ConsecutiveSelector | PseudoClassSelector | PseudoElementSelector | KeyframesSelector | QuerySelectorHTML;
37
37
  export {};
@@ -1,5 +0,0 @@
1
- type PropertyValue = string | number | PropertyType;
2
- export type PropertyType = {
3
- [key: string]: PropertyValue;
4
- };
5
- export {};