@flairjs/client 0.0.1-beta.3 → 0.0.1-beta.5
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/types/utils.d.ts +6 -4
- package/package.json +2 -2
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type * as CSS from "csstype";
|
|
2
2
|
export interface FlairTheme {
|
|
3
|
+
tokens: Record<string, unknown>;
|
|
4
|
+
breakpoints: Record<string, unknown>;
|
|
3
5
|
}
|
|
4
6
|
type Key = string | number;
|
|
5
7
|
type Join<P extends string, K extends Key> = `${P}${P extends "" ? "" : "."}${K}`;
|
|
@@ -7,10 +9,10 @@ type Paths<T, P extends string = ""> = T extends object ? {
|
|
|
7
9
|
[K in keyof T & Key]: Paths<T[K], Join<P, K>>;
|
|
8
10
|
}[keyof T & Key] : P;
|
|
9
11
|
export type TokensOf<T> = `$${Paths<T>}`;
|
|
10
|
-
export type
|
|
11
|
-
type BreakPointTokens = `@screen ${keyof
|
|
12
|
-
type FlairObject = {
|
|
13
|
-
[K in keyof CSS.Properties]?: CSS.Properties[K] |
|
|
12
|
+
export type ThemeTokens<T extends FlairTheme = FlairTheme> = TokensOf<T["tokens"]>;
|
|
13
|
+
export type BreakPointTokens<T extends FlairTheme = FlairTheme> = `@screen ${Extract<keyof T["breakpoints"], string>}`;
|
|
14
|
+
type FlairObject<T extends FlairTheme = FlairTheme> = {
|
|
15
|
+
[K in keyof CSS.Properties]?: CSS.Properties[K] | ThemeTokens<T> | (string & {}) | number;
|
|
14
16
|
};
|
|
15
17
|
type FlairCSS = {
|
|
16
18
|
[K in string]?: FlairObject | FlairCSS;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flairjs/client",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.5",
|
|
4
4
|
"module": "./dist/esm/index.js",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"csstype": "^3.1.3",
|
|
68
68
|
"rolldown": "1.0.0-beta.37",
|
|
69
69
|
"typescript": "^5.8.3",
|
|
70
|
-
"@flairjs/core": "0.0.1-beta.
|
|
70
|
+
"@flairjs/core": "0.0.1-beta.7"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "rolldown -c",
|