@tokenami/config 0.0.56 → 0.0.58
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.cjs +140 -133
- package/dist/index.d.cts +191 -191
- package/dist/index.d.ts +191 -191
- package/dist/index.js +140 -133
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,65 +1,5 @@
|
|
|
1
1
|
import * as CSS from 'csstype';
|
|
2
2
|
|
|
3
|
-
type GridProperty = '--_grid';
|
|
4
|
-
declare const GridProperty: {
|
|
5
|
-
safeParse: (input: unknown) => Validated<"--_grid">;
|
|
6
|
-
};
|
|
7
|
-
declare function gridProperty(): GridProperty;
|
|
8
|
-
type GridValue = number;
|
|
9
|
-
declare const GridValue: {
|
|
10
|
-
safeParse: (input: unknown) => Validated<number>;
|
|
11
|
-
};
|
|
12
|
-
type TokenProperty<P extends string = string> = `--${P}`;
|
|
13
|
-
declare const TokenProperty: {
|
|
14
|
-
safeParse: (input: unknown) => Validated<`--${string}`>;
|
|
15
|
-
};
|
|
16
|
-
declare function tokenProperty(name: string): TokenProperty;
|
|
17
|
-
declare function parsedTokenProperty(name: string): TokenProperty;
|
|
18
|
-
type VariantProperty<P extends string = string, V extends string = string> = `--${V}_${P}`;
|
|
19
|
-
declare const VariantProperty: {
|
|
20
|
-
safeParse: (input: unknown) => Validated<`--${string}_${string}`>;
|
|
21
|
-
};
|
|
22
|
-
declare function variantProperty(variant: string, name: string): VariantProperty;
|
|
23
|
-
declare function parsedVariantProperty(variant: string, name: string): VariantProperty;
|
|
24
|
-
type TokenValue<TK extends string = string, V extends string = string> = `var(--${TK}_${V})`;
|
|
25
|
-
declare const TokenValue: {
|
|
26
|
-
safeParse: (input: unknown) => Validated<`var(--${string}_${string})`>;
|
|
27
|
-
};
|
|
28
|
-
declare function tokenValue<TK extends string, N extends string>(themeKey: TK, name: N): TokenValue<TK, N>;
|
|
29
|
-
type ArbitraryValue = `var(---,${string})`;
|
|
30
|
-
declare const ArbitraryValue: {
|
|
31
|
-
safeParse: (input: unknown) => Validated<`var(---,${string})`>;
|
|
32
|
-
};
|
|
33
|
-
declare function arbitraryValue(value: string): ArbitraryValue;
|
|
34
|
-
type Validated<T> = {
|
|
35
|
-
success: true;
|
|
36
|
-
output: T;
|
|
37
|
-
} | {
|
|
38
|
-
success: false;
|
|
39
|
-
};
|
|
40
|
-
declare function getTokenPropertyName(property: TokenProperty): string;
|
|
41
|
-
declare function getTokenPropertySplit(property: TokenProperty): {
|
|
42
|
-
alias: string;
|
|
43
|
-
variants: string[];
|
|
44
|
-
};
|
|
45
|
-
type PropertyParts = {
|
|
46
|
-
alias: string;
|
|
47
|
-
responsive?: string;
|
|
48
|
-
selector?: string;
|
|
49
|
-
variant?: string;
|
|
50
|
-
};
|
|
51
|
-
declare function getTokenPropertyParts(tokenProperty: TokenProperty, config: Config): PropertyParts | null;
|
|
52
|
-
declare function getArbitrarySelector(selector: string | undefined): string | undefined;
|
|
53
|
-
declare function getTokenValueParts(tokenValue: TokenValue): {
|
|
54
|
-
property: string;
|
|
55
|
-
themeKey: string;
|
|
56
|
-
token: string;
|
|
57
|
-
};
|
|
58
|
-
declare function getCSSPropertiesForAlias(alias: string, aliases: Config['aliases']): string[];
|
|
59
|
-
declare function parseProperty<T extends string>(str: T, options?: {
|
|
60
|
-
escapeSpecialChars?: boolean;
|
|
61
|
-
}): T;
|
|
62
|
-
|
|
63
3
|
interface CSSProperties<TLength = (string & {}) | 0, TTime = string & {}> extends CSS.StandardPropertiesHyphen<TLength, TTime>, CSS.SvgPropertiesHyphen<TLength, TTime> {
|
|
64
4
|
}
|
|
65
5
|
type CSSProperty = keyof CSSProperties;
|
|
@@ -99,7 +39,7 @@ interface Config {
|
|
|
99
39
|
aliases?: Aliases;
|
|
100
40
|
themeSelector?: (mode: string) => string;
|
|
101
41
|
theme: ThemeConfig;
|
|
102
|
-
properties?: Partial<Record<
|
|
42
|
+
properties?: Partial<Record<CSSProperty | (string & {}), PropertiesOptions>>;
|
|
103
43
|
}
|
|
104
44
|
declare const defaultConfig: {
|
|
105
45
|
include: never[];
|
|
@@ -124,136 +64,136 @@ declare const defaultConfig: {
|
|
|
124
64
|
disabled: string;
|
|
125
65
|
};
|
|
126
66
|
properties: {
|
|
127
|
-
'
|
|
128
|
-
|
|
129
|
-
'
|
|
130
|
-
|
|
131
|
-
'
|
|
132
|
-
'
|
|
133
|
-
'
|
|
134
|
-
'
|
|
135
|
-
'
|
|
136
|
-
'
|
|
137
|
-
|
|
138
|
-
'
|
|
139
|
-
'
|
|
140
|
-
'
|
|
141
|
-
'
|
|
142
|
-
'
|
|
143
|
-
'
|
|
144
|
-
'
|
|
145
|
-
'
|
|
146
|
-
'
|
|
147
|
-
'
|
|
148
|
-
'
|
|
149
|
-
'
|
|
150
|
-
'
|
|
151
|
-
'
|
|
152
|
-
'
|
|
153
|
-
'
|
|
154
|
-
'
|
|
155
|
-
'
|
|
156
|
-
'
|
|
157
|
-
'
|
|
158
|
-
'
|
|
159
|
-
'
|
|
160
|
-
'
|
|
161
|
-
'
|
|
162
|
-
'
|
|
163
|
-
'
|
|
164
|
-
'
|
|
165
|
-
'
|
|
166
|
-
'
|
|
167
|
-
'
|
|
168
|
-
'
|
|
169
|
-
'
|
|
170
|
-
'
|
|
171
|
-
'
|
|
172
|
-
'
|
|
173
|
-
'
|
|
174
|
-
'
|
|
175
|
-
'
|
|
176
|
-
'
|
|
177
|
-
'
|
|
178
|
-
'
|
|
179
|
-
|
|
180
|
-
'
|
|
181
|
-
'
|
|
182
|
-
|
|
183
|
-
'
|
|
184
|
-
'
|
|
185
|
-
'
|
|
186
|
-
'
|
|
187
|
-
|
|
188
|
-
'
|
|
189
|
-
'
|
|
190
|
-
'
|
|
191
|
-
'
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
'
|
|
195
|
-
|
|
196
|
-
'
|
|
197
|
-
'
|
|
198
|
-
'
|
|
199
|
-
'
|
|
200
|
-
'
|
|
201
|
-
'
|
|
202
|
-
|
|
203
|
-
'
|
|
204
|
-
'
|
|
205
|
-
|
|
206
|
-
'
|
|
207
|
-
'
|
|
208
|
-
'
|
|
209
|
-
'
|
|
210
|
-
'
|
|
211
|
-
'
|
|
212
|
-
'
|
|
213
|
-
'
|
|
214
|
-
'
|
|
215
|
-
'
|
|
216
|
-
'
|
|
217
|
-
'
|
|
218
|
-
'
|
|
219
|
-
'
|
|
220
|
-
'
|
|
221
|
-
'
|
|
222
|
-
'
|
|
223
|
-
'
|
|
224
|
-
|
|
225
|
-
'
|
|
226
|
-
|
|
227
|
-
'
|
|
228
|
-
'
|
|
229
|
-
'
|
|
230
|
-
'
|
|
231
|
-
'
|
|
232
|
-
'
|
|
233
|
-
'
|
|
234
|
-
'
|
|
235
|
-
'
|
|
236
|
-
'
|
|
237
|
-
|
|
238
|
-
'
|
|
239
|
-
'
|
|
240
|
-
'
|
|
241
|
-
'
|
|
242
|
-
'
|
|
243
|
-
'
|
|
244
|
-
'
|
|
245
|
-
'
|
|
246
|
-
'
|
|
247
|
-
'
|
|
248
|
-
'
|
|
249
|
-
|
|
250
|
-
'
|
|
251
|
-
'
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
'
|
|
255
|
-
|
|
256
|
-
'
|
|
67
|
+
'accent-color': "color"[];
|
|
68
|
+
animation: "anim"[];
|
|
69
|
+
'animation-timing-function': "ease"[];
|
|
70
|
+
background: ("color" | "surface")[];
|
|
71
|
+
'background-color': "color"[];
|
|
72
|
+
'background-image': "surface"[];
|
|
73
|
+
'background-position': "grid"[];
|
|
74
|
+
'background-position-x': "grid"[];
|
|
75
|
+
'background-position-y': "grid"[];
|
|
76
|
+
'block-size': ("grid" | "size")[];
|
|
77
|
+
border: "border"[];
|
|
78
|
+
'border-block': "border"[];
|
|
79
|
+
'border-block-color': "color"[];
|
|
80
|
+
'border-block-end': "border"[];
|
|
81
|
+
'border-block-end-color': "color"[];
|
|
82
|
+
'border-block-end-style': "line-style"[];
|
|
83
|
+
'border-block-start': "border"[];
|
|
84
|
+
'border-block-start-color': "color"[];
|
|
85
|
+
'border-block-start-style': "line-style"[];
|
|
86
|
+
'border-block-style': "line-style"[];
|
|
87
|
+
'border-bottom': "border"[];
|
|
88
|
+
'border-bottom-color': "color"[];
|
|
89
|
+
'border-bottom-left-radius': "radii"[];
|
|
90
|
+
'border-bottom-right-radius': "radii"[];
|
|
91
|
+
'border-bottom-style': "line-style"[];
|
|
92
|
+
'border-color': "color"[];
|
|
93
|
+
'border-end-end-radius': "radii"[];
|
|
94
|
+
'border-end-start-radius': "radii"[];
|
|
95
|
+
'border-inline': "border"[];
|
|
96
|
+
'border-inline-color': "color"[];
|
|
97
|
+
'border-inline-end': "border"[];
|
|
98
|
+
'border-inline-end-color': "color"[];
|
|
99
|
+
'border-inline-end-style': "line-style"[];
|
|
100
|
+
'border-inline-start': "border"[];
|
|
101
|
+
'border-inline-start-color': "color"[];
|
|
102
|
+
'border-inline-start-style': "line-style"[];
|
|
103
|
+
'border-inline-style': "line-style"[];
|
|
104
|
+
'border-left': "border"[];
|
|
105
|
+
'border-left-color': "color"[];
|
|
106
|
+
'border-left-style': "line-style"[];
|
|
107
|
+
'border-radius': "radii"[];
|
|
108
|
+
'border-right': "border"[];
|
|
109
|
+
'border-right-color': "color"[];
|
|
110
|
+
'border-right-style': "line-style"[];
|
|
111
|
+
'border-start-end-radius': "radii"[];
|
|
112
|
+
'border-start-start-radius': "radii"[];
|
|
113
|
+
'border-style': "line-style"[];
|
|
114
|
+
'border-top': "border"[];
|
|
115
|
+
'border-top-color': "color"[];
|
|
116
|
+
'border-top-left-radius': "radii"[];
|
|
117
|
+
'border-top-right-radius': "radii"[];
|
|
118
|
+
'border-top-style': "line-style"[];
|
|
119
|
+
bottom: "grid"[];
|
|
120
|
+
'box-shadow': "shadow"[];
|
|
121
|
+
'caret-color': "color"[];
|
|
122
|
+
color: "color"[];
|
|
123
|
+
'column-gap': "grid"[];
|
|
124
|
+
'column-rule-color': "color"[];
|
|
125
|
+
'column-rule-width': "grid"[];
|
|
126
|
+
'column-width': ("grid" | "size")[];
|
|
127
|
+
fill: "color"[];
|
|
128
|
+
'flex-basis': ("grid" | "size")[];
|
|
129
|
+
'font-family': "font"[];
|
|
130
|
+
'font-size': "font-size"[];
|
|
131
|
+
'font-weight': "weight"[];
|
|
132
|
+
gap: "grid"[];
|
|
133
|
+
height: ("grid" | "size")[];
|
|
134
|
+
'inline-size': ("grid" | "size")[];
|
|
135
|
+
inset: "grid"[];
|
|
136
|
+
'inset-block': "grid"[];
|
|
137
|
+
'inset-block-end': "grid"[];
|
|
138
|
+
'inset-block-start': "grid"[];
|
|
139
|
+
'inset-inline': "grid"[];
|
|
140
|
+
'inset-inline-end': "grid"[];
|
|
141
|
+
'inset-inline-start': "grid"[];
|
|
142
|
+
left: "grid"[];
|
|
143
|
+
'letter-spacing': "tracking"[];
|
|
144
|
+
'line-height': "leading"[];
|
|
145
|
+
margin: "grid"[];
|
|
146
|
+
'margin-block': "grid"[];
|
|
147
|
+
'margin-block-end': "grid"[];
|
|
148
|
+
'margin-block-start': "grid"[];
|
|
149
|
+
'margin-bottom': "grid"[];
|
|
150
|
+
'margin-inline': "grid"[];
|
|
151
|
+
'margin-inline-end': "grid"[];
|
|
152
|
+
'margin-inline-start': "grid"[];
|
|
153
|
+
'margin-left': "grid"[];
|
|
154
|
+
'margin-right': "grid"[];
|
|
155
|
+
'margin-top': "grid"[];
|
|
156
|
+
'max-block-size': ("grid" | "size")[];
|
|
157
|
+
'max-height': ("grid" | "size")[];
|
|
158
|
+
'max-inline-size': ("grid" | "size")[];
|
|
159
|
+
'max-width': ("grid" | "size")[];
|
|
160
|
+
'min-block-size': ("grid" | "size")[];
|
|
161
|
+
'min-height': ("grid" | "size")[];
|
|
162
|
+
'min-inline-size': ("grid" | "size")[];
|
|
163
|
+
'min-width': ("grid" | "size")[];
|
|
164
|
+
opacity: "alpha"[];
|
|
165
|
+
'outline-color': "color"[];
|
|
166
|
+
padding: "grid"[];
|
|
167
|
+
'padding-block': "grid"[];
|
|
168
|
+
'padding-block-end': "grid"[];
|
|
169
|
+
'padding-block-start': "grid"[];
|
|
170
|
+
'padding-bottom': "grid"[];
|
|
171
|
+
'padding-inline': "grid"[];
|
|
172
|
+
'padding-inline-end': "grid"[];
|
|
173
|
+
'padding-inline-start': "grid"[];
|
|
174
|
+
'padding-left': "grid"[];
|
|
175
|
+
'padding-right': "grid"[];
|
|
176
|
+
'padding-top': "grid"[];
|
|
177
|
+
right: "grid"[];
|
|
178
|
+
'row-gap': "grid"[];
|
|
179
|
+
'scroll-margin': "grid"[];
|
|
180
|
+
'scroll-margin-bottom': "grid"[];
|
|
181
|
+
'scroll-margin-left': "grid"[];
|
|
182
|
+
'scroll-margin-right': "grid"[];
|
|
183
|
+
'scroll-margin-top': "grid"[];
|
|
184
|
+
'scroll-padding': "grid"[];
|
|
185
|
+
'scroll-padding-bottom': "grid"[];
|
|
186
|
+
'scroll-padding-left': "grid"[];
|
|
187
|
+
'scroll-padding-right': "grid"[];
|
|
188
|
+
'scroll-padding-top': "grid"[];
|
|
189
|
+
stroke: "color"[];
|
|
190
|
+
'text-decoration-color': "color"[];
|
|
191
|
+
'text-shadow': "shadow"[];
|
|
192
|
+
top: "grid"[];
|
|
193
|
+
transition: "transition"[];
|
|
194
|
+
'transition-timing-function': "ease"[];
|
|
195
|
+
width: ("grid" | "size")[];
|
|
196
|
+
'z-index': "z"[];
|
|
257
197
|
};
|
|
258
198
|
};
|
|
259
199
|
type DefaultConfig = typeof defaultConfig;
|
|
@@ -264,6 +204,66 @@ type MatchingThemeModes<M> = M extends ThemeMode ? {
|
|
|
264
204
|
} : {};
|
|
265
205
|
declare function createConfig<T>(obj: ExactConfig<Config, T> & (T extends Config ? MatchingThemeModes<T['theme']['modes']> : {})): Omit<DefaultConfig, keyof DeepReadonly<T>> & DeepReadonly<T>;
|
|
266
206
|
|
|
207
|
+
type GridProperty = '--_grid';
|
|
208
|
+
declare const GridProperty: {
|
|
209
|
+
safeParse: (input: unknown) => Validated<"--_grid">;
|
|
210
|
+
};
|
|
211
|
+
declare function gridProperty(): GridProperty;
|
|
212
|
+
type GridValue = number;
|
|
213
|
+
declare const GridValue: {
|
|
214
|
+
safeParse: (input: unknown) => Validated<number>;
|
|
215
|
+
};
|
|
216
|
+
type TokenProperty<P extends string = string> = `--${P}`;
|
|
217
|
+
declare const TokenProperty: {
|
|
218
|
+
safeParse: (input: unknown) => Validated<`--${string}`>;
|
|
219
|
+
};
|
|
220
|
+
declare function tokenProperty(name: string): TokenProperty;
|
|
221
|
+
declare function parsedTokenProperty(name: string): TokenProperty;
|
|
222
|
+
type VariantProperty<P extends string = string, V extends string = string> = `--${V}_${P}`;
|
|
223
|
+
declare const VariantProperty: {
|
|
224
|
+
safeParse: (input: unknown) => Validated<`--${string}_${string}`>;
|
|
225
|
+
};
|
|
226
|
+
declare function variantProperty(variant: string, name: string): VariantProperty;
|
|
227
|
+
declare function parsedVariantProperty(variant: string, name: string): VariantProperty;
|
|
228
|
+
type TokenValue<TK extends string = string, V extends string = string> = `var(--${TK}_${V})`;
|
|
229
|
+
declare const TokenValue: {
|
|
230
|
+
safeParse: (input: unknown) => Validated<`var(--${string}_${string})`>;
|
|
231
|
+
};
|
|
232
|
+
declare function tokenValue<TK extends string, N extends string>(themeKey: TK, name: N): TokenValue<TK, N>;
|
|
233
|
+
type ArbitraryValue = `var(---,${string})`;
|
|
234
|
+
declare const ArbitraryValue: {
|
|
235
|
+
safeParse: (input: unknown) => Validated<`var(---,${string})`>;
|
|
236
|
+
};
|
|
237
|
+
declare function arbitraryValue(value: string): ArbitraryValue;
|
|
238
|
+
type Validated<T> = {
|
|
239
|
+
success: true;
|
|
240
|
+
output: T;
|
|
241
|
+
} | {
|
|
242
|
+
success: false;
|
|
243
|
+
};
|
|
244
|
+
declare function getTokenPropertyName(property: TokenProperty): string;
|
|
245
|
+
declare function getTokenPropertySplit(property: TokenProperty): {
|
|
246
|
+
alias: string;
|
|
247
|
+
variants: string[];
|
|
248
|
+
};
|
|
249
|
+
type PropertyParts = {
|
|
250
|
+
alias: string;
|
|
251
|
+
responsive?: string;
|
|
252
|
+
selector?: string;
|
|
253
|
+
variant?: string;
|
|
254
|
+
};
|
|
255
|
+
declare function getTokenPropertyParts(tokenProperty: TokenProperty, config: Config): PropertyParts | null;
|
|
256
|
+
declare function getArbitrarySelector(selector: string | undefined): string | undefined;
|
|
257
|
+
declare function getTokenValueParts(tokenValue: TokenValue): {
|
|
258
|
+
property: string;
|
|
259
|
+
themeKey: string;
|
|
260
|
+
token: string;
|
|
261
|
+
};
|
|
262
|
+
declare function getCSSPropertiesForAlias(alias: string, aliases: Config['aliases']): string[];
|
|
263
|
+
declare function parseProperty<T extends string>(str: T, options?: {
|
|
264
|
+
escapeSpecialChars?: boolean;
|
|
265
|
+
}): T;
|
|
266
|
+
|
|
267
267
|
declare const mapShorthandToLonghands: Map<"flex" | "grid" | "all" | "border-block-color" | "border-block-style" | "border-block-width" | "border-inline-color" | "border-inline-style" | "border-inline-width" | "border" | "transition" | "font-variant" | "animation" | "background" | "background-position" | "border-block" | "border-block-end" | "border-block-start" | "border-bottom" | "border-color" | "border-image" | "border-inline" | "border-inline-end" | "border-inline-start" | "border-left" | "border-radius" | "border-right" | "border-style" | "border-top" | "border-width" | "column-rule" | "columns" | "contain-intrinsic-size" | "container" | "flex-flow" | "font" | "gap" | "grid-area" | "grid-column" | "grid-row" | "grid-template" | "inset" | "inset-block" | "inset-inline" | "list-style" | "margin" | "margin-block" | "margin-inline" | "mask" | "mask-border" | "offset" | "outline" | "overflow" | "overscroll-behavior" | "padding" | "padding-block" | "padding-inline" | "place-content" | "place-items" | "place-self" | "scroll-margin" | "scroll-margin-block" | "scroll-margin-inline" | "scroll-padding" | "scroll-padding-block" | "scroll-padding-inline" | "scroll-timeline" | "text-decoration" | "text-emphasis", string[]>;
|
|
268
268
|
|
|
269
269
|
export { type Aliases, ArbitraryValue, type CSSProperties, type CSSProperty, type Config, type DeepReadonly, type DefaultConfig, GridProperty, GridValue, type Theme, type ThemeModes, TokenProperty, TokenValue, VariantProperty, arbitraryValue, createConfig, defaultConfig, getArbitrarySelector, getCSSPropertiesForAlias, getTokenPropertyName, getTokenPropertyParts, getTokenPropertySplit, getTokenValueParts, gridProperty, mapShorthandToLonghands, parseProperty, parsedTokenProperty, parsedVariantProperty, tokenProperty, tokenValue, variantProperty };
|