@tokenami/css 0.0.15 → 0.0.17
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 +27 -0
- package/dist/index.d.ts +5 -3
- package/package.json +4 -4
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as Tokenami from '@tokenami/config';
|
|
2
|
+
export { createConfig, defaultConfig } from '@tokenami/config';
|
|
3
|
+
import { TokenamiProperties, TokenamiFinalConfig } from '@tokenami/dev';
|
|
4
|
+
|
|
5
|
+
type VariantsConfig = Record<string, Record<string, TokenamiProperties>>;
|
|
6
|
+
type VariantValue<T> = T extends 'true' | 'false' ? boolean : T;
|
|
7
|
+
type ReponsiveKey = Extract<keyof TokenamiFinalConfig['responsive'], string>;
|
|
8
|
+
type ResponsiveValue<T> = T extends string ? `${ReponsiveKey}_${T}` : never;
|
|
9
|
+
type Override = TokenamiProperties | false | undefined;
|
|
10
|
+
type Variants$1<C> = {
|
|
11
|
+
[V in keyof C]?: VariantValue<keyof C[V]>;
|
|
12
|
+
};
|
|
13
|
+
type ResponsiveVariants<C> = {
|
|
14
|
+
[V in keyof C]: {
|
|
15
|
+
[M in ResponsiveValue<V>]?: VariantValue<keyof C[V]>;
|
|
16
|
+
};
|
|
17
|
+
}[keyof C];
|
|
18
|
+
type SelectedVariants<V, R> = undefined extends V ? null : Variants$1<V> & (R extends true ? ResponsiveVariants<V> : {});
|
|
19
|
+
declare function css<V extends VariantsConfig | undefined, R>(baseStyles: TokenamiProperties, variantsConfig?: V & VariantsConfig, options?: undefined extends V ? never : {
|
|
20
|
+
responsive: R & boolean;
|
|
21
|
+
}): (variants?: SelectedVariants<V, R>, ...overrides: Override[]) => {};
|
|
22
|
+
declare namespace css { }
|
|
23
|
+
declare function createCss(config: Tokenami.Config): typeof css;
|
|
24
|
+
|
|
25
|
+
type Variants<T extends () => {}> = Parameters<T>[0] extends undefined | null ? {} : NonNullable<Parameters<T>[0]>;
|
|
26
|
+
|
|
27
|
+
export { type Variants, createCss, css };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as Tokenami from '@tokenami/config';
|
|
2
2
|
export { createConfig, defaultConfig } from '@tokenami/config';
|
|
3
|
-
import { TokenamiProperties,
|
|
3
|
+
import { TokenamiProperties, TokenamiFinalConfig } from '@tokenami/dev';
|
|
4
4
|
|
|
5
5
|
type VariantsConfig = Record<string, Record<string, TokenamiProperties>>;
|
|
6
6
|
type VariantValue<T> = T extends 'true' | 'false' ? boolean : T;
|
|
7
|
-
type
|
|
7
|
+
type ReponsiveKey = Extract<keyof TokenamiFinalConfig['responsive'], string>;
|
|
8
|
+
type ResponsiveValue<T> = T extends string ? `${ReponsiveKey}_${T}` : never;
|
|
8
9
|
type Override = TokenamiProperties | false | undefined;
|
|
9
10
|
type Variants$1<C> = {
|
|
10
11
|
[V in keyof C]?: VariantValue<keyof C[V]>;
|
|
@@ -18,8 +19,9 @@ type SelectedVariants<V, R> = undefined extends V ? null : Variants$1<V> & (R ex
|
|
|
18
19
|
declare function css<V extends VariantsConfig | undefined, R>(baseStyles: TokenamiProperties, variantsConfig?: V & VariantsConfig, options?: undefined extends V ? never : {
|
|
19
20
|
responsive: R & boolean;
|
|
20
21
|
}): (variants?: SelectedVariants<V, R>, ...overrides: Override[]) => {};
|
|
22
|
+
declare namespace css { }
|
|
21
23
|
declare function createCss(config: Tokenami.Config): typeof css;
|
|
22
24
|
|
|
23
25
|
type Variants<T extends () => {}> = Parameters<T>[0] extends undefined | null ? {} : NonNullable<Parameters<T>[0]>;
|
|
24
26
|
|
|
25
|
-
export { Variants, createCss, css };
|
|
27
|
+
export { 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.17",
|
|
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.17"
|
|
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.17"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"typescript": ">= 5",
|
|
25
|
-
"@tokenami/dev": "0.0.
|
|
25
|
+
"@tokenami/dev": "0.0.17"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsup",
|