zss-engine 0.2.28 → 0.2.30

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.28",
3
+ "version": "0.2.30",
4
4
  "description": "Zero-runtime StyleSheet Engine",
5
5
  "keywords": [
6
6
  "zero-runtime",
package/types/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export type { CustomProperties } from './types/common/css-properties';
2
- export type { CreateStyle, ClassesStyle, ReturnType } from './types/main/create';
3
- export type { KeyframesDefinition, CustomHTMLType } from './types/main/global';
4
- export type { VarsDefinition, VarsTransformed } from './types/main/vars';
1
+ export type { CSSProperties } from './types/common/css-properties';
2
+ export type { CreateStyle, ReturnType, ClassesStyle } from './types/main/create';
3
+ export type { CSSHTML, CreateKeyframes } from './types/main/global';
4
+ export type { CreateVars, CreateTheme } from './types/main/vars';
5
5
  export { isServer, isDevelopment, isDevAndTest } from './utils/helper.js';
6
6
  export { genBase36Hash } from './utils/hash.js';
7
7
  export { transpiler } from './utils/transpiler.js';
@@ -5,11 +5,11 @@ type CSSColorProperty = Exclude<ColorValue, SystemColorKeyword>;
5
5
  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';
6
6
  type ExcludeMozInitial<T> = Exclude<T, '-moz-initial'>;
7
7
  type CSSTypeProperties = Properties<number | (string & {})>;
8
- type CSSProperties = {
8
+ type CustomProperties = {
9
9
  [K in keyof CSSTypeProperties]: ExcludeMozInitial<CSSTypeProperties[K]>;
10
10
  };
11
11
  type BaseCSSProperties = {
12
- [K in keyof CSSProperties]: CSSProperties[K] | CSSVariableValue;
12
+ [K in keyof CustomProperties]: CustomProperties[K] | CSSVariableValue;
13
13
  };
14
14
  interface CommonProperties extends BaseCSSProperties {
15
15
  accentColor?: CSSColorProperty;
@@ -42,5 +42,5 @@ export type MediaQuery = `@media ${string}`;
42
42
  type MediaQueryType = {
43
43
  [K in MediaQuery]: CommonProperties | ColonType | AndStringType;
44
44
  };
45
- export type CustomProperties = CommonProperties | ColonType | CSSVariableProperty | AndStringType | MediaQueryType;
45
+ export type CSSProperties = CommonProperties | ColonType | CSSVariableProperty | AndStringType | MediaQueryType;
46
46
  export {};
@@ -1,9 +1,9 @@
1
- import type { CustomProperties } from '../common/css-properties';
1
+ import type { CSSProperties } from '../common/css-properties';
2
2
  export type CreateStyle<T> = {
3
- readonly [K in keyof T]: T[K] extends CustomProperties ? CustomProperties : T[K];
3
+ readonly [K in keyof T]: T[K] extends CSSProperties ? CSSProperties : T[K];
4
4
  };
5
5
  export type ClassesStyle = {
6
- [key: string]: CustomProperties;
6
+ [key: string]: CSSProperties;
7
7
  };
8
8
  export type ReturnType<T> = {
9
9
  [key in keyof T]: string;
@@ -1,37 +1,37 @@
1
- import type { CustomProperties, MediaQuery } from '../common/css-properties';
1
+ import type { CSSProperties, MediaQuery } from '../common/css-properties';
2
2
  type JSXType = keyof HTMLElementTagNameMap | '*' | ':root';
3
3
  type HTMLType = {
4
- [K in JSXType]: CustomProperties;
4
+ [K in JSXType]: CSSProperties;
5
5
  };
6
6
  type ClassName = `.${string}`;
7
7
  type ClassNameType = {
8
- [K in ClassName]: CustomProperties;
8
+ [K in ClassName]: CSSProperties;
9
9
  };
10
10
  type Attribute = `${string}[${string}]${string}`;
11
11
  type AttributeType = {
12
- [K in Attribute]: CustomProperties;
12
+ [K in Attribute]: CSSProperties;
13
13
  };
14
14
  type Consecutive = `${JSXType} ${string}`;
15
15
  type ConsecutiveType = {
16
- [K in Consecutive]: CustomProperties;
16
+ [K in Consecutive]: CSSProperties;
17
17
  };
18
18
  type PseudoClass = `${JSXType}:${string}`;
19
19
  type PseudoClassType = {
20
- [K in PseudoClass]: CustomProperties;
20
+ [K in PseudoClass]: CSSProperties;
21
21
  };
22
22
  type PseudoElement = `::${string}`;
23
23
  type PseudoElementType = {
24
- [K in PseudoElement]: CustomProperties;
24
+ [K in PseudoElement]: CSSProperties;
25
25
  };
26
26
  type KeyframeSelector = 'from' | 'to' | `${number}%`;
27
- export type KeyframesDefinition = {
28
- [K in KeyframeSelector]?: CustomProperties;
27
+ export type CreateKeyframes = {
28
+ [K in KeyframeSelector]?: CSSProperties;
29
29
  };
30
30
  type KeyframesType = {
31
- [K in `@keyframes ${string}`]: KeyframesDefinition;
31
+ [K in `@keyframes ${string}`]: CreateKeyframes;
32
32
  };
33
33
  type MediaQueryHTMLType = {
34
- [K in MediaQuery]: CustomHTMLType;
34
+ [K in MediaQuery]: CSSHTML;
35
35
  };
36
- export type CustomHTMLType = HTMLType | ClassNameType | AttributeType | ConsecutiveType | PseudoClassType | PseudoElementType | KeyframesType | MediaQueryHTMLType;
36
+ export type CSSHTML = HTMLType | ClassNameType | AttributeType | ConsecutiveType | PseudoClassType | PseudoElementType | KeyframesType | MediaQueryHTMLType;
37
37
  export {};
@@ -1,10 +1,8 @@
1
- export type VarsDefinition = Record<string, string | number | Record<string, string | number>>;
2
1
  type CSSVariableKey = `--${string}`;
3
2
  export type CSSVariableValue = `var(${CSSVariableKey})`;
4
3
  export type CSSVariableProperty = {
5
4
  [key: CSSVariableKey]: string | number;
6
5
  };
7
- export type VarsTransformed = {
8
- [key: string]: CSSVariableProperty;
9
- };
6
+ export type CreateVars = Record<string, string | number>;
7
+ export type CreateTheme = Record<string, Record<string, string | number>>;
10
8
  export {};
@@ -1,2 +1,2 @@
1
- import { ClassesStyle, KeyframesDefinition, VarsDefinition } from '../index.js';
2
- export declare function genBase36Hash(object: ClassesStyle | KeyframesDefinition | VarsDefinition, n: number): string;
1
+ import { ClassesStyle, CreateKeyframes } from '../index.js';
2
+ export declare function genBase36Hash(object: ClassesStyle | CreateKeyframes, n: number): string;
@@ -1,4 +1,4 @@
1
- import type { ClassesStyle, CustomHTMLType, VarsDefinition } from '../index.js';
2
- export declare function transpiler(object: ClassesStyle | CustomHTMLType | VarsDefinition, base36Hash?: string, core?: string): {
1
+ import type { CSSHTML } from '../index.js';
2
+ export declare function transpiler(object: CSSHTML, base36Hash?: string, core?: string): {
3
3
  styleSheet: string;
4
4
  };