@tokenami/css 0.0.29 → 0.0.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/dist/index.d.cts +11 -5
- package/dist/index.d.ts +11 -5
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { TokenamiProperties, TokenamiFinalConfig } from '@tokenami/dev';
|
|
1
2
|
import * as Tokenami from '@tokenami/config';
|
|
2
3
|
export { createConfig, defaultConfig } from '@tokenami/config';
|
|
3
|
-
import { TokenamiProperties, TokenamiFinalConfig } from '@tokenami/dev';
|
|
4
4
|
|
|
5
5
|
declare const _ALIASES: unique symbol;
|
|
6
|
+
type TokenamiCSS = {
|
|
7
|
+
[_: symbol]: 'TokenamiCSS';
|
|
8
|
+
};
|
|
6
9
|
type VariantsConfig = Record<string, Record<string, TokenamiProperties>>;
|
|
7
10
|
type VariantValue<T> = T extends 'true' | 'false' ? boolean : T;
|
|
8
11
|
type ReponsiveKey = Extract<keyof TokenamiFinalConfig['responsive'], string>;
|
|
9
12
|
type ResponsiveValue<T> = T extends string ? `${ReponsiveKey}_${T}` : never;
|
|
10
|
-
type Override = TokenamiProperties | false | undefined;
|
|
13
|
+
type Override = TokenamiProperties | TokenamiCSS | false | undefined;
|
|
11
14
|
type Variants$1<C> = undefined extends C ? {} : {
|
|
12
15
|
[V in keyof C]?: VariantValue<keyof C[V]>;
|
|
13
16
|
};
|
|
@@ -22,12 +25,15 @@ type ComposeCSS<V, R> = TokenamiProperties & {
|
|
|
22
25
|
};
|
|
23
26
|
interface CSS {
|
|
24
27
|
[_ALIASES]?: Tokenami.Aliases;
|
|
25
|
-
(baseStyles: TokenamiProperties, ...overrides: Override[]):
|
|
26
|
-
compose: <V extends VariantsConfig | undefined, R extends VariantsConfig | undefined>(config: ComposeCSS<V, R>) => (selectedVariants?: Variants$1<V> & Variants$1<R> & ResponsiveVariants<R>, ...overrides: Override[]) =>
|
|
28
|
+
(baseStyles: TokenamiProperties, ...overrides: Override[]): TokenamiCSS;
|
|
29
|
+
compose: <V extends VariantsConfig | undefined, R extends VariantsConfig | undefined>(config: ComposeCSS<V, R>) => (selectedVariants?: Variants$1<V> & Variants$1<R> & ResponsiveVariants<R>, ...overrides: Override[]) => TokenamiCSS;
|
|
27
30
|
}
|
|
28
31
|
declare const css: CSS;
|
|
29
32
|
declare function createCss(config: Tokenami.Config): CSS;
|
|
30
33
|
|
|
34
|
+
type TokenamiStyle<P> = {
|
|
35
|
+
[K in keyof P]: K extends 'style' ? TokenamiCSS & P[K] : P[K];
|
|
36
|
+
};
|
|
31
37
|
type Variants<T extends () => {}> = Parameters<T>[0] extends undefined | null ? {} : NonNullable<Parameters<T>[0]>;
|
|
32
38
|
|
|
33
|
-
export { type Variants, createCss, css };
|
|
39
|
+
export { type TokenamiStyle, type Variants, createCss, css };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { TokenamiProperties, TokenamiFinalConfig } from '@tokenami/dev';
|
|
1
2
|
import * as Tokenami from '@tokenami/config';
|
|
2
3
|
export { createConfig, defaultConfig } from '@tokenami/config';
|
|
3
|
-
import { TokenamiProperties, TokenamiFinalConfig } from '@tokenami/dev';
|
|
4
4
|
|
|
5
5
|
declare const _ALIASES: unique symbol;
|
|
6
|
+
type TokenamiCSS = {
|
|
7
|
+
[_: symbol]: 'TokenamiCSS';
|
|
8
|
+
};
|
|
6
9
|
type VariantsConfig = Record<string, Record<string, TokenamiProperties>>;
|
|
7
10
|
type VariantValue<T> = T extends 'true' | 'false' ? boolean : T;
|
|
8
11
|
type ReponsiveKey = Extract<keyof TokenamiFinalConfig['responsive'], string>;
|
|
9
12
|
type ResponsiveValue<T> = T extends string ? `${ReponsiveKey}_${T}` : never;
|
|
10
|
-
type Override = TokenamiProperties | false | undefined;
|
|
13
|
+
type Override = TokenamiProperties | TokenamiCSS | false | undefined;
|
|
11
14
|
type Variants$1<C> = undefined extends C ? {} : {
|
|
12
15
|
[V in keyof C]?: VariantValue<keyof C[V]>;
|
|
13
16
|
};
|
|
@@ -22,12 +25,15 @@ type ComposeCSS<V, R> = TokenamiProperties & {
|
|
|
22
25
|
};
|
|
23
26
|
interface CSS {
|
|
24
27
|
[_ALIASES]?: Tokenami.Aliases;
|
|
25
|
-
(baseStyles: TokenamiProperties, ...overrides: Override[]):
|
|
26
|
-
compose: <V extends VariantsConfig | undefined, R extends VariantsConfig | undefined>(config: ComposeCSS<V, R>) => (selectedVariants?: Variants$1<V> & Variants$1<R> & ResponsiveVariants<R>, ...overrides: Override[]) =>
|
|
28
|
+
(baseStyles: TokenamiProperties, ...overrides: Override[]): TokenamiCSS;
|
|
29
|
+
compose: <V extends VariantsConfig | undefined, R extends VariantsConfig | undefined>(config: ComposeCSS<V, R>) => (selectedVariants?: Variants$1<V> & Variants$1<R> & ResponsiveVariants<R>, ...overrides: Override[]) => TokenamiCSS;
|
|
27
30
|
}
|
|
28
31
|
declare const css: CSS;
|
|
29
32
|
declare function createCss(config: Tokenami.Config): CSS;
|
|
30
33
|
|
|
34
|
+
type TokenamiStyle<P> = {
|
|
35
|
+
[K in keyof P]: K extends 'style' ? TokenamiCSS & P[K] : P[K];
|
|
36
|
+
};
|
|
31
37
|
type Variants<T extends () => {}> = Parameters<T>[0] extends undefined | null ? {} : NonNullable<Parameters<T>[0]>;
|
|
32
38
|
|
|
33
|
-
export { type Variants, createCss, css };
|
|
39
|
+
export { type TokenamiStyle, type Variants, createCss, css };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenami/css",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@tokenami/config": "0.0.
|
|
15
|
+
"@tokenami/config": "0.0.30"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"tsup": "^7.0.0",
|
|
19
19
|
"typescript": "^5.1.3",
|
|
20
20
|
"vitest": "^0.34.6",
|
|
21
|
-
"@tokenami/dev": "0.0.
|
|
21
|
+
"@tokenami/dev": "0.0.30"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"typescript": ">= 5",
|
|
25
|
-
"@tokenami/dev": "0.0.
|
|
25
|
+
"@tokenami/dev": "0.0.30"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsup",
|