@styleframe/theme 2.3.0 → 2.4.0
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/CHANGELOG.md +171 -3
- package/dist/theme.d.ts +814 -344
- package/dist/theme.js +4241 -3793
- package/dist/theme.umd.cjs +4 -4
- package/package.json +4 -4
package/dist/theme.d.ts
CHANGED
|
@@ -7,91 +7,10 @@ import { UtilityCallbackFn } from '@styleframe/core';
|
|
|
7
7
|
import { UtilityCreatorFn } from '@styleframe/core';
|
|
8
8
|
import { Variable } from '@styleframe/core';
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* Creates a generic composable function for a CSS utility.
|
|
12
|
-
*
|
|
13
|
-
* This factory function generates `use*Utility` composables (like `useMarginUtility`, `usePaddingUtility`, etc.)
|
|
14
|
-
* from a utility name and factory function.
|
|
15
|
-
*
|
|
16
|
-
* @param utilityName - The utility name (e.g., 'margin', 'padding')
|
|
17
|
-
* @param factory - Function that receives { value } and returns CSS declarations
|
|
18
|
-
* @param options - Configuration options
|
|
19
|
-
* @returns A composable function that creates utilities for the given property
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```typescript
|
|
23
|
-
* // Create a useMarginUtility composable
|
|
24
|
-
* export const useMarginUtility = createUseUtility(
|
|
25
|
-
* 'm',
|
|
26
|
-
* ({ value }) => ({ margin: value })
|
|
27
|
-
* );
|
|
28
|
-
*
|
|
29
|
-
* // Usage
|
|
30
|
-
* const s = styleframe();
|
|
31
|
-
* const createMargin = useMarginUtility(s, {
|
|
32
|
-
* sm: '0.5rem',
|
|
33
|
-
* md: '1rem',
|
|
34
|
-
* lg: '1.5rem',
|
|
35
|
-
* });
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export declare function createUseUtility<UtilityName extends string, Defaults extends Record<string, TokenValue> = Record<string, TokenValue>>(utilityName: UtilityName, factory: UtilityCallbackFn, options?: CreateUseUtilityOptions<Defaults>): <T extends Record<string, TokenValue> = Defaults>(s: Styleframe, values?: T, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
39
|
-
|
|
40
|
-
export declare interface CreateUseUtilityOptions<Defaults extends Record<string, TokenValue>> {
|
|
41
|
-
/** Default values for the utility */
|
|
42
|
-
defaults?: Defaults;
|
|
43
|
-
/** Whether to merge user values with defaults (true) or replace them (false) */
|
|
44
|
-
mergeDefaults?: boolean;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Creates a generic composable function for a CSS property.
|
|
49
|
-
*
|
|
50
|
-
* This factory function generates `use*` composables (like `useFontFamily`, `useLineHeight`, etc.)
|
|
51
|
-
* from a CSS property name string.
|
|
52
|
-
*
|
|
53
|
-
* @param propertyName - The CSS property name (e.g., 'font-family', 'line-height')
|
|
54
|
-
* @returns A composable function that creates variables for the given property
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```typescript
|
|
58
|
-
* import { styleframe } from "styleframe";
|
|
59
|
-
* import { createUseVariable } from "styleframe/theme";
|
|
60
|
-
*
|
|
61
|
-
* // Create a useFontFamily composable
|
|
62
|
-
* const useFontFamily = createUseVariable("font-family");
|
|
63
|
-
*
|
|
64
|
-
* const s = styleframe();
|
|
65
|
-
* const { fontFamily, fontFamilyMono } = useFontFamily(s, {
|
|
66
|
-
* default: "Arial, sans-serif",
|
|
67
|
-
* mono: "Courier, monospace",
|
|
68
|
-
* });
|
|
69
|
-
* ```
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```typescript
|
|
73
|
-
* // Create a useLineHeight composable
|
|
74
|
-
* const useLineHeight = createUseVariable("line-height");
|
|
75
|
-
*
|
|
76
|
-
* const s = styleframe();
|
|
77
|
-
* const { lineHeight, lineHeightTight, lineHeightLoose } = useLineHeight(s, {
|
|
78
|
-
* default: "1.5",
|
|
79
|
-
* tight: "1.25",
|
|
80
|
-
* loose: "1.75",
|
|
81
|
-
* });
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
export declare function createUseVariable<PropertyName extends string, PropertyType = TokenValue, Delimiter extends string = ".", Defaults extends Record<string, PropertyType> = Record<string, PropertyType>, MergeDefaults extends boolean = false>(propertyName: PropertyName, { defaults, mergeDefaults, transform, delimiter, }?: {
|
|
85
|
-
defaults?: Defaults;
|
|
86
|
-
mergeDefaults?: MergeDefaults;
|
|
87
|
-
transform?: (value: PropertyType) => TokenValue;
|
|
88
|
-
delimiter?: Delimiter;
|
|
89
|
-
}): <T extends Record<string, PropertyType> = Defaults>(s: Styleframe, tokens?: T) => ExportKeys<PropertyName, MergeDefaults extends true ? Defaults & T : T, Delimiter>;
|
|
90
|
-
|
|
91
10
|
/**
|
|
92
11
|
* Default align-content utility values matching Tailwind CSS.
|
|
93
12
|
*/
|
|
94
|
-
export declare const
|
|
13
|
+
export declare const alignContentValues: {
|
|
95
14
|
normal: string;
|
|
96
15
|
center: string;
|
|
97
16
|
start: string;
|
|
@@ -106,7 +25,7 @@ export declare const defaultAlignContentValues: {
|
|
|
106
25
|
/**
|
|
107
26
|
* Default align-items utility values matching Tailwind CSS.
|
|
108
27
|
*/
|
|
109
|
-
export declare const
|
|
28
|
+
export declare const alignItemsValues: {
|
|
110
29
|
start: string;
|
|
111
30
|
end: string;
|
|
112
31
|
center: string;
|
|
@@ -117,7 +36,7 @@ export declare const defaultAlignItemsValues: {
|
|
|
117
36
|
/**
|
|
118
37
|
* Default align-self utility values matching Tailwind CSS.
|
|
119
38
|
*/
|
|
120
|
-
export declare const
|
|
39
|
+
export declare const alignSelfValues: {
|
|
121
40
|
auto: string;
|
|
122
41
|
start: string;
|
|
123
42
|
end: string;
|
|
@@ -126,10 +45,15 @@ export declare const defaultAlignSelfValues: {
|
|
|
126
45
|
baseline: string;
|
|
127
46
|
};
|
|
128
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Generates all variation keys for all colors in the record
|
|
50
|
+
*/
|
|
51
|
+
declare type AllColorVariations<TColors extends Record<string, string>> = UnionToIntersection<ColorVariationsForKey<keyof TColors>>;
|
|
52
|
+
|
|
129
53
|
/**
|
|
130
54
|
* Default animation utility values matching Tailwind CSS.
|
|
131
55
|
*/
|
|
132
|
-
export declare const
|
|
56
|
+
export declare const animationValues: {
|
|
133
57
|
none: string;
|
|
134
58
|
spin: string;
|
|
135
59
|
ping: string;
|
|
@@ -140,15 +64,15 @@ export declare const defaultAnimationValues: {
|
|
|
140
64
|
/**
|
|
141
65
|
* Default appearance utility values matching Tailwind CSS.
|
|
142
66
|
*/
|
|
143
|
-
export declare const
|
|
67
|
+
export declare const appearanceValues: {
|
|
144
68
|
none: string;
|
|
145
69
|
auto: string;
|
|
146
70
|
};
|
|
147
71
|
|
|
148
72
|
/**
|
|
149
|
-
* Default aspect
|
|
73
|
+
* Default aspect-ratio utility values matching Tailwind CSS.
|
|
150
74
|
*/
|
|
151
|
-
export declare const
|
|
75
|
+
export declare const aspectRatioValues: {
|
|
152
76
|
auto: string;
|
|
153
77
|
square: string;
|
|
154
78
|
video: string;
|
|
@@ -157,7 +81,7 @@ export declare const defaultAspectRatioValues: {
|
|
|
157
81
|
/**
|
|
158
82
|
* Default backface-visibility utility values matching Tailwind CSS.
|
|
159
83
|
*/
|
|
160
|
-
export declare const
|
|
84
|
+
export declare const backfaceVisibilityValues: {
|
|
161
85
|
visible: string;
|
|
162
86
|
hidden: string;
|
|
163
87
|
};
|
|
@@ -165,7 +89,7 @@ export declare const defaultBackfaceVisibilityValues: {
|
|
|
165
89
|
/**
|
|
166
90
|
* Default background-attachment utility values matching Tailwind CSS.
|
|
167
91
|
*/
|
|
168
|
-
export declare const
|
|
92
|
+
export declare const backgroundAttachmentValues: {
|
|
169
93
|
fixed: string;
|
|
170
94
|
local: string;
|
|
171
95
|
scroll: string;
|
|
@@ -174,7 +98,7 @@ export declare const defaultBackgroundAttachmentValues: {
|
|
|
174
98
|
/**
|
|
175
99
|
* Default background-blend-mode utility values matching Tailwind CSS.
|
|
176
100
|
*/
|
|
177
|
-
export declare const
|
|
101
|
+
export declare const backgroundBlendModeValues: {
|
|
178
102
|
normal: string;
|
|
179
103
|
multiply: string;
|
|
180
104
|
screen: string;
|
|
@@ -196,7 +120,7 @@ export declare const defaultBackgroundBlendModeValues: {
|
|
|
196
120
|
/**
|
|
197
121
|
* Default background-clip utility values matching Tailwind CSS.
|
|
198
122
|
*/
|
|
199
|
-
export declare const
|
|
123
|
+
export declare const backgroundClipValues: {
|
|
200
124
|
border: string;
|
|
201
125
|
padding: string;
|
|
202
126
|
content: string;
|
|
@@ -206,7 +130,7 @@ export declare const defaultBackgroundClipValues: {
|
|
|
206
130
|
/**
|
|
207
131
|
* Default background-image utility values matching Tailwind CSS.
|
|
208
132
|
*/
|
|
209
|
-
export declare const
|
|
133
|
+
export declare const backgroundImageValues: {
|
|
210
134
|
none: string;
|
|
211
135
|
"gradient-to-t": string;
|
|
212
136
|
"gradient-to-tr": string;
|
|
@@ -221,7 +145,7 @@ export declare const defaultBackgroundImageValues: {
|
|
|
221
145
|
/**
|
|
222
146
|
* Default background-origin utility values matching Tailwind CSS.
|
|
223
147
|
*/
|
|
224
|
-
export declare const
|
|
148
|
+
export declare const backgroundOriginValues: {
|
|
225
149
|
border: string;
|
|
226
150
|
padding: string;
|
|
227
151
|
content: string;
|
|
@@ -230,7 +154,7 @@ export declare const defaultBackgroundOriginValues: {
|
|
|
230
154
|
/**
|
|
231
155
|
* Default background-position utility values matching Tailwind CSS.
|
|
232
156
|
*/
|
|
233
|
-
export declare const
|
|
157
|
+
export declare const backgroundPositionValues: {
|
|
234
158
|
bottom: string;
|
|
235
159
|
center: string;
|
|
236
160
|
left: string;
|
|
@@ -245,7 +169,7 @@ export declare const defaultBackgroundPositionValues: {
|
|
|
245
169
|
/**
|
|
246
170
|
* Default background-repeat utility values matching Tailwind CSS.
|
|
247
171
|
*/
|
|
248
|
-
export declare const
|
|
172
|
+
export declare const backgroundRepeatValues: {
|
|
249
173
|
repeat: string;
|
|
250
174
|
"no-repeat": string;
|
|
251
175
|
"repeat-x": string;
|
|
@@ -257,7 +181,7 @@ export declare const defaultBackgroundRepeatValues: {
|
|
|
257
181
|
/**
|
|
258
182
|
* Default background-size utility values matching Tailwind CSS.
|
|
259
183
|
*/
|
|
260
|
-
export declare const
|
|
184
|
+
export declare const backgroundSizeValues: {
|
|
261
185
|
auto: string;
|
|
262
186
|
cover: string;
|
|
263
187
|
contain: string;
|
|
@@ -266,24 +190,23 @@ export declare const defaultBackgroundSizeValues: {
|
|
|
266
190
|
/**
|
|
267
191
|
* Default border-collapse utility values matching Tailwind CSS.
|
|
268
192
|
*/
|
|
269
|
-
export declare const
|
|
193
|
+
export declare const borderCollapseValues: {
|
|
270
194
|
collapse: string;
|
|
271
195
|
separate: string;
|
|
272
196
|
};
|
|
273
197
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
*/
|
|
277
|
-
export declare const defaultBorderStyleUtilityValues: {
|
|
278
|
-
solid: string;
|
|
279
|
-
dashed: string;
|
|
280
|
-
dotted: string;
|
|
281
|
-
double: string;
|
|
282
|
-
hidden: string;
|
|
198
|
+
export declare const borderRadiusValues: {
|
|
199
|
+
default: string;
|
|
283
200
|
none: string;
|
|
201
|
+
sm: string;
|
|
202
|
+
md: string;
|
|
203
|
+
lg: string;
|
|
204
|
+
xl: string;
|
|
205
|
+
"2xl": string;
|
|
206
|
+
full: string;
|
|
284
207
|
};
|
|
285
208
|
|
|
286
|
-
export declare const
|
|
209
|
+
export declare const borderStyleValues: {
|
|
287
210
|
readonly default: "@solid";
|
|
288
211
|
readonly none: "none";
|
|
289
212
|
readonly solid: "solid";
|
|
@@ -295,7 +218,7 @@ export declare const defaultBorderStyleValues: {
|
|
|
295
218
|
readonly outset: "outset";
|
|
296
219
|
};
|
|
297
220
|
|
|
298
|
-
export declare const
|
|
221
|
+
export declare const borderWidthValues: {
|
|
299
222
|
default: string;
|
|
300
223
|
none: number;
|
|
301
224
|
thin: string;
|
|
@@ -306,12 +229,12 @@ export declare const defaultBorderWidthValues: {
|
|
|
306
229
|
/**
|
|
307
230
|
* Default box-decoration-break utility values matching Tailwind CSS.
|
|
308
231
|
*/
|
|
309
|
-
export declare const
|
|
232
|
+
export declare const boxDecorationBreakValues: {
|
|
310
233
|
clone: string;
|
|
311
234
|
slice: string;
|
|
312
235
|
};
|
|
313
236
|
|
|
314
|
-
export declare const
|
|
237
|
+
export declare const boxShadowValues: {
|
|
315
238
|
default: string;
|
|
316
239
|
none: string;
|
|
317
240
|
xs: string;
|
|
@@ -327,7 +250,7 @@ export declare const defaultBoxShadowValues: {
|
|
|
327
250
|
/**
|
|
328
251
|
* Default box-sizing utility values matching Tailwind CSS.
|
|
329
252
|
*/
|
|
330
|
-
export declare const
|
|
253
|
+
export declare const boxSizingValues: {
|
|
331
254
|
border: string;
|
|
332
255
|
content: string;
|
|
333
256
|
};
|
|
@@ -335,7 +258,7 @@ export declare const defaultBoxSizingValues: {
|
|
|
335
258
|
/**
|
|
336
259
|
* Default break-after utility values matching Tailwind CSS.
|
|
337
260
|
*/
|
|
338
|
-
export declare const
|
|
261
|
+
export declare const breakAfterValues: {
|
|
339
262
|
auto: string;
|
|
340
263
|
avoid: string;
|
|
341
264
|
all: string;
|
|
@@ -349,7 +272,7 @@ export declare const defaultBreakAfterValues: {
|
|
|
349
272
|
/**
|
|
350
273
|
* Default break-before utility values matching Tailwind CSS.
|
|
351
274
|
*/
|
|
352
|
-
export declare const
|
|
275
|
+
export declare const breakBeforeValues: {
|
|
353
276
|
auto: string;
|
|
354
277
|
avoid: string;
|
|
355
278
|
all: string;
|
|
@@ -363,14 +286,14 @@ export declare const defaultBreakBeforeValues: {
|
|
|
363
286
|
/**
|
|
364
287
|
* Default break-inside utility values matching Tailwind CSS.
|
|
365
288
|
*/
|
|
366
|
-
export declare const
|
|
289
|
+
export declare const breakInsideValues: {
|
|
367
290
|
auto: string;
|
|
368
291
|
avoid: string;
|
|
369
292
|
"avoid-page": string;
|
|
370
293
|
"avoid-column": string;
|
|
371
294
|
};
|
|
372
295
|
|
|
373
|
-
export declare const
|
|
296
|
+
export declare const breakpointValues: {
|
|
374
297
|
xs: number;
|
|
375
298
|
sm: number;
|
|
376
299
|
md: number;
|
|
@@ -381,7 +304,7 @@ export declare const defaultBreakpointValues: {
|
|
|
381
304
|
/**
|
|
382
305
|
* Default caption-side utility values matching Tailwind CSS.
|
|
383
306
|
*/
|
|
384
|
-
export declare const
|
|
307
|
+
export declare const captionSideValues: {
|
|
385
308
|
top: string;
|
|
386
309
|
bottom: string;
|
|
387
310
|
};
|
|
@@ -389,7 +312,7 @@ export declare const defaultCaptionSideValues: {
|
|
|
389
312
|
/**
|
|
390
313
|
* Default clear utility values matching Tailwind CSS.
|
|
391
314
|
*/
|
|
392
|
-
export declare const
|
|
315
|
+
export declare const clearValues: {
|
|
393
316
|
start: string;
|
|
394
317
|
end: string;
|
|
395
318
|
left: string;
|
|
@@ -398,7 +321,7 @@ export declare const defaultClearValues: {
|
|
|
398
321
|
none: string;
|
|
399
322
|
};
|
|
400
323
|
|
|
401
|
-
export declare const
|
|
324
|
+
export declare const colorLightnessValues: {
|
|
402
325
|
readonly 50: 5;
|
|
403
326
|
readonly 100: 10;
|
|
404
327
|
readonly 200: 20;
|
|
@@ -412,34 +335,150 @@ export declare const defaultColorLightnessValues: {
|
|
|
412
335
|
readonly 950: 95;
|
|
413
336
|
};
|
|
414
337
|
|
|
338
|
+
/**
|
|
339
|
+
* Color result type that strongly types base colors and all variations.
|
|
340
|
+
*/
|
|
341
|
+
declare type ColorResult<TColors extends Record<string, string> | false, TMerge extends boolean = false> = TColors extends false ? undefined : TColors extends Record<string, string> ? TMerge extends true ? ExportKeys<"color", Omit<DefaultColors, keyof TColors> & TColors, "."> & AllColorVariations<Omit<DefaultColors, keyof TColors> & TColors> : ExportKeys<"color", TColors, "."> & AllColorVariations<TColors> : ExportKeys<"color", DefaultColors, "."> & AllColorVariations<DefaultColors>;
|
|
342
|
+
|
|
415
343
|
/**
|
|
416
344
|
* Default color-scheme utility values matching Tailwind CSS.
|
|
417
345
|
*/
|
|
418
|
-
export declare const
|
|
346
|
+
export declare const colorSchemeValues: {
|
|
419
347
|
normal: string;
|
|
420
348
|
light: string;
|
|
421
349
|
dark: string;
|
|
422
350
|
"light-dark": string;
|
|
423
351
|
};
|
|
424
352
|
|
|
425
|
-
export declare const
|
|
353
|
+
export declare const colorShadeValues: {
|
|
426
354
|
readonly 50: 5;
|
|
427
355
|
readonly 100: 10;
|
|
428
356
|
readonly 150: 15;
|
|
429
357
|
readonly 200: 20;
|
|
430
358
|
};
|
|
431
359
|
|
|
432
|
-
|
|
360
|
+
/**
|
|
361
|
+
* Configuration for color generation behavior
|
|
362
|
+
*/
|
|
363
|
+
export declare interface ColorsMetaConfig {
|
|
364
|
+
generateLightness?: boolean;
|
|
365
|
+
generateShades?: boolean;
|
|
366
|
+
generateTints?: boolean;
|
|
367
|
+
lightnessLevels?: Record<string | number, number>;
|
|
368
|
+
shadeLevels?: Record<string | number, number>;
|
|
369
|
+
tintLevels?: Record<string | number, number>;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export declare const colorTintValues: {
|
|
433
373
|
readonly 50: 5;
|
|
434
374
|
readonly 100: 10;
|
|
435
375
|
readonly 150: 15;
|
|
436
376
|
readonly 200: 20;
|
|
437
377
|
};
|
|
438
378
|
|
|
379
|
+
export declare const colorValues: {
|
|
380
|
+
primary: string;
|
|
381
|
+
secondary: string;
|
|
382
|
+
success: string;
|
|
383
|
+
warning: string;
|
|
384
|
+
danger: string;
|
|
385
|
+
info: string;
|
|
386
|
+
light: string;
|
|
387
|
+
dark: string;
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Generates all variation keys for a single color name (distributive over K)
|
|
392
|
+
*/
|
|
393
|
+
declare type ColorVariationsForKey<K> = K extends string ? ExportKeys<`color.${K}`, DefaultLightnessLevels, "-"> & ExportKeys<`color.${K}-shade`, DefaultShadeLevels, "-"> & ExportKeys<`color.${K}-tint`, DefaultTintLevels, "-"> : never;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Creates a generic composable function for a CSS utility.
|
|
397
|
+
*
|
|
398
|
+
* This factory function generates `use*Utility` composables (like `useMarginUtility`, `usePaddingUtility`, etc.)
|
|
399
|
+
* from a utility name and factory function.
|
|
400
|
+
*
|
|
401
|
+
* @param utilityName - The utility name (e.g., 'margin', 'padding')
|
|
402
|
+
* @param factory - Function that receives { value } and returns CSS declarations
|
|
403
|
+
* @param options - Configuration options
|
|
404
|
+
* @returns A composable function that creates utilities for the given property
|
|
405
|
+
*
|
|
406
|
+
* @example
|
|
407
|
+
* ```typescript
|
|
408
|
+
* // Create a useMarginUtility composable
|
|
409
|
+
* export const useMarginUtility = createUseUtility(
|
|
410
|
+
* 'm',
|
|
411
|
+
* ({ value }) => ({ margin: value })
|
|
412
|
+
* );
|
|
413
|
+
*
|
|
414
|
+
* // Usage
|
|
415
|
+
* const s = styleframe();
|
|
416
|
+
* const createMargin = useMarginUtility(s, {
|
|
417
|
+
* sm: '0.5rem',
|
|
418
|
+
* md: '1rem',
|
|
419
|
+
* lg: '1.5rem',
|
|
420
|
+
* });
|
|
421
|
+
* ```
|
|
422
|
+
*/
|
|
423
|
+
export declare function createUseUtility<UtilityName extends string, Defaults extends Record<string, TokenValue> = Record<string, TokenValue>>(utilityName: UtilityName, factory: UtilityCallbackFn, options?: CreateUseUtilityOptions<Defaults>): <T extends Record<string, TokenValue> = Defaults>(s: Styleframe, values?: T, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
424
|
+
|
|
425
|
+
export declare interface CreateUseUtilityOptions<Defaults extends Record<string, TokenValue>> {
|
|
426
|
+
/** Default values for the utility */
|
|
427
|
+
defaults?: Defaults;
|
|
428
|
+
/** Whether to merge user values with defaults (true) or replace them (false) */
|
|
429
|
+
mergeDefaults?: boolean;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Creates a generic composable function for a CSS property.
|
|
434
|
+
*
|
|
435
|
+
* This factory function generates `use*` composables (like `useFontFamily`, `useLineHeight`, etc.)
|
|
436
|
+
* from a CSS property name string.
|
|
437
|
+
*
|
|
438
|
+
* @param propertyName - The CSS property name (e.g., 'font-family', 'line-height')
|
|
439
|
+
* @returns A composable function that creates variables for the given property
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* ```typescript
|
|
443
|
+
* import { styleframe } from "styleframe";
|
|
444
|
+
* import { createUseVariable } from "styleframe/theme";
|
|
445
|
+
*
|
|
446
|
+
* // Create a useFontFamily composable
|
|
447
|
+
* const useFontFamily = createUseVariable("font-family");
|
|
448
|
+
*
|
|
449
|
+
* const s = styleframe();
|
|
450
|
+
* const { fontFamily, fontFamilyMono } = useFontFamily(s, {
|
|
451
|
+
* default: "Arial, sans-serif",
|
|
452
|
+
* mono: "Courier, monospace",
|
|
453
|
+
* });
|
|
454
|
+
* ```
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* ```typescript
|
|
458
|
+
* // Create a useLineHeight composable
|
|
459
|
+
* const useLineHeight = createUseVariable("line-height");
|
|
460
|
+
*
|
|
461
|
+
* const s = styleframe();
|
|
462
|
+
* const { lineHeight, lineHeightTight, lineHeightLoose } = useLineHeight(s, {
|
|
463
|
+
* default: "1.5",
|
|
464
|
+
* tight: "1.25",
|
|
465
|
+
* loose: "1.75",
|
|
466
|
+
* });
|
|
467
|
+
* ```
|
|
468
|
+
*/
|
|
469
|
+
export declare function createUseVariable<PropertyName extends string, PropertyType = TokenValue, Delimiter extends string = ".", Defaults extends Record<string, PropertyType> = Record<string, PropertyType>, MergeDefaults extends boolean = false>(propertyName: PropertyName, { defaults, mergeDefaults, transform, delimiter, }?: {
|
|
470
|
+
defaults?: Defaults;
|
|
471
|
+
mergeDefaults?: MergeDefaults;
|
|
472
|
+
transform?: (value: PropertyType) => TokenValue;
|
|
473
|
+
delimiter?: Delimiter;
|
|
474
|
+
}): <T extends Record<string, PropertyType> = Defaults>(s: Styleframe, tokens?: T, { default: isDefault }?: {
|
|
475
|
+
default?: boolean;
|
|
476
|
+
}) => ExportKeys<PropertyName, MergeDefaults extends true ? Defaults & T : T, Delimiter>;
|
|
477
|
+
|
|
439
478
|
/**
|
|
440
479
|
* Default cursor utility values matching Tailwind CSS.
|
|
441
480
|
*/
|
|
442
|
-
export declare const
|
|
481
|
+
export declare const cursorValues: {
|
|
443
482
|
auto: string;
|
|
444
483
|
default: string;
|
|
445
484
|
pointer: string;
|
|
@@ -478,10 +517,130 @@ export declare const defaultCursorValues: {
|
|
|
478
517
|
"zoom-out": string;
|
|
479
518
|
};
|
|
480
519
|
|
|
520
|
+
declare type DefaultBorderRadius = typeof borderRadiusValues;
|
|
521
|
+
|
|
522
|
+
declare type DefaultBorderStyle = typeof borderStyleValues;
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Default border-style utility values matching Tailwind CSS.
|
|
526
|
+
*/
|
|
527
|
+
export declare const defaultBorderStyleUtilityValues: {
|
|
528
|
+
solid: string;
|
|
529
|
+
dashed: string;
|
|
530
|
+
dotted: string;
|
|
531
|
+
double: string;
|
|
532
|
+
hidden: string;
|
|
533
|
+
none: string;
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
declare type DefaultBorderWidth = typeof borderWidthValues;
|
|
537
|
+
|
|
538
|
+
declare type DefaultBoxShadow = typeof boxShadowValues;
|
|
539
|
+
|
|
540
|
+
declare type DefaultBreakpoint = typeof breakpointValues;
|
|
541
|
+
|
|
542
|
+
declare type DefaultColors = typeof colorValues;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Default colors meta configuration
|
|
546
|
+
*/
|
|
547
|
+
export declare const defaultColorsMetaConfig: Required<ColorsMetaConfig>;
|
|
548
|
+
|
|
549
|
+
declare type DefaultEasing = typeof easingValues;
|
|
550
|
+
|
|
551
|
+
declare type DefaultFontFamily = typeof fontFamilyValues;
|
|
552
|
+
|
|
553
|
+
declare type DefaultFontSize = typeof fontSizeValues;
|
|
554
|
+
|
|
555
|
+
declare type DefaultFontStyle = typeof fontStyleValues;
|
|
556
|
+
|
|
557
|
+
declare type DefaultFontWeight = typeof fontWeightValues;
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Default font-weight utility values matching Tailwind CSS.
|
|
561
|
+
*/
|
|
562
|
+
export declare const defaultFontWeightUtilityValues: {
|
|
563
|
+
thin: string;
|
|
564
|
+
extralight: string;
|
|
565
|
+
light: string;
|
|
566
|
+
normal: string;
|
|
567
|
+
medium: string;
|
|
568
|
+
semibold: string;
|
|
569
|
+
bold: string;
|
|
570
|
+
extrabold: string;
|
|
571
|
+
black: string;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
declare type DefaultLetterSpacing = typeof letterSpacingValues;
|
|
575
|
+
|
|
576
|
+
declare type DefaultLightnessLevels = typeof colorLightnessValues;
|
|
577
|
+
|
|
578
|
+
declare type DefaultLineHeight = typeof lineHeightValues;
|
|
579
|
+
|
|
580
|
+
declare type DefaultScale = typeof scaleValues;
|
|
581
|
+
|
|
582
|
+
declare type DefaultShadeLevels = typeof colorShadeValues;
|
|
583
|
+
|
|
584
|
+
declare type DefaultSpacing = typeof spacingValues;
|
|
585
|
+
|
|
586
|
+
declare type DefaultTintLevels = typeof colorTintValues;
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Configuration options for the default design tokens preset.
|
|
590
|
+
* Generic type parameters capture the shape of each domain's configuration.
|
|
591
|
+
*
|
|
592
|
+
* - Omit or set to `undefined` to use default values
|
|
593
|
+
* - Set to `false` to disable the domain entirely
|
|
594
|
+
* - Provide a custom record to use custom values
|
|
595
|
+
* - Set `meta.merge` to `true` to merge custom values with defaults
|
|
596
|
+
*/
|
|
597
|
+
export declare interface DesignTokensPresetConfig<TSpacing extends Record<string, TokenValue> | false = DefaultSpacing, TBorderWidth extends Record<string, TokenValue> | false = DefaultBorderWidth, TBorderRadius extends Record<string, TokenValue> | false = DefaultBorderRadius, TBorderStyle extends Record<string, TokenValue> | false = DefaultBorderStyle, TBoxShadow extends Record<string, TokenValue> | false = DefaultBoxShadow, TColors extends Record<string, string> | false = DefaultColors, TFontFamily extends Record<string, TokenValue> | false = DefaultFontFamily, TFontSize extends Record<string, TokenValue> | false = DefaultFontSize, TFontStyle extends Record<string, TokenValue> | false = DefaultFontStyle, TFontWeight extends Record<string, TokenValue> | false = DefaultFontWeight, TLineHeight extends Record<string, TokenValue> | false = DefaultLineHeight, TLetterSpacing extends Record<string, TokenValue> | false = DefaultLetterSpacing, TScale extends Record<string, TokenValue> | false = DefaultScale, TBreakpoint extends Record<string, number> | false = DefaultBreakpoint, TEasing extends Record<string, TokenValue> | false = DefaultEasing, TMerge extends boolean = false> {
|
|
598
|
+
spacing?: TSpacing;
|
|
599
|
+
borderWidth?: TBorderWidth;
|
|
600
|
+
borderRadius?: TBorderRadius;
|
|
601
|
+
borderStyle?: TBorderStyle;
|
|
602
|
+
boxShadow?: TBoxShadow;
|
|
603
|
+
colors?: TColors;
|
|
604
|
+
meta?: MetaConfigWithMerge<TMerge>;
|
|
605
|
+
fontFamily?: TFontFamily;
|
|
606
|
+
fontSize?: TFontSize;
|
|
607
|
+
fontStyle?: TFontStyle;
|
|
608
|
+
fontWeight?: TFontWeight;
|
|
609
|
+
lineHeight?: TLineHeight;
|
|
610
|
+
letterSpacing?: TLetterSpacing;
|
|
611
|
+
scale?: TScale;
|
|
612
|
+
scalePowers?: readonly number[];
|
|
613
|
+
breakpoint?: TBreakpoint;
|
|
614
|
+
easing?: TEasing;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Result structure for the default design tokens preset.
|
|
619
|
+
* The result type reflects the exact structure based on config generics.
|
|
620
|
+
*/
|
|
621
|
+
export declare interface DesignTokensPresetResult<TSpacing extends Record<string, TokenValue> | false = DefaultSpacing, TBorderWidth extends Record<string, TokenValue> | false = DefaultBorderWidth, TBorderRadius extends Record<string, TokenValue> | false = DefaultBorderRadius, TBorderStyle extends Record<string, TokenValue> | false = DefaultBorderStyle, TBoxShadow extends Record<string, TokenValue> | false = DefaultBoxShadow, TColors extends Record<string, string> | false = DefaultColors, TFontFamily extends Record<string, TokenValue> | false = DefaultFontFamily, TFontSize extends Record<string, TokenValue> | false = DefaultFontSize, TFontStyle extends Record<string, TokenValue> | false = DefaultFontStyle, TFontWeight extends Record<string, TokenValue> | false = DefaultFontWeight, TLineHeight extends Record<string, TokenValue> | false = DefaultLineHeight, TLetterSpacing extends Record<string, TokenValue> | false = DefaultLetterSpacing, TScale extends Record<string, TokenValue> | false = DefaultScale, TBreakpoint extends Record<string, number> | false = DefaultBreakpoint, TEasing extends Record<string, TokenValue> | false = DefaultEasing, TMerge extends boolean = false> {
|
|
622
|
+
spacing: TokenResult<TSpacing, "spacing", DefaultSpacing, TMerge>;
|
|
623
|
+
borderWidth: TokenResult<TBorderWidth, "border-width", DefaultBorderWidth, TMerge>;
|
|
624
|
+
borderRadius: TokenResult<TBorderRadius, "border-radius", DefaultBorderRadius, TMerge>;
|
|
625
|
+
borderStyle: TokenResult<TBorderStyle, "border-style", DefaultBorderStyle, TMerge>;
|
|
626
|
+
boxShadow: TokenResult<TBoxShadow, "box-shadow", DefaultBoxShadow, TMerge>;
|
|
627
|
+
colors: ColorResult<TColors, TMerge>;
|
|
628
|
+
fontFamily: TokenResult<TFontFamily, "font-family", DefaultFontFamily, TMerge>;
|
|
629
|
+
fontSize: TokenResult<TFontSize, "font-size", DefaultFontSize, TMerge>;
|
|
630
|
+
fontStyle: TokenResult<TFontStyle, "font-style", DefaultFontStyle, TMerge>;
|
|
631
|
+
fontWeight: TokenResult<TFontWeight, "font-weight", DefaultFontWeight, TMerge>;
|
|
632
|
+
lineHeight: TokenResult<TLineHeight, "line-height", DefaultLineHeight, TMerge>;
|
|
633
|
+
letterSpacing: TokenResult<TLetterSpacing, "letter-spacing", DefaultLetterSpacing, TMerge>;
|
|
634
|
+
scale: TokenResult<TScale, "scale", DefaultScale, TMerge>;
|
|
635
|
+
scalePowers: TScale extends false ? undefined : Record<number, TokenValue>;
|
|
636
|
+
breakpoint: TokenResult<TBreakpoint, "breakpoint", DefaultBreakpoint, TMerge>;
|
|
637
|
+
easing: TokenResult<TEasing, "easing", DefaultEasing, TMerge>;
|
|
638
|
+
}
|
|
639
|
+
|
|
481
640
|
/**
|
|
482
641
|
* Default display utility values matching Tailwind CSS.
|
|
483
642
|
*/
|
|
484
|
-
export declare const
|
|
643
|
+
export declare const displayValues: {
|
|
485
644
|
block: string;
|
|
486
645
|
"inline-block": string;
|
|
487
646
|
inline: string;
|
|
@@ -508,7 +667,7 @@ export declare const defaultDisplayValues: {
|
|
|
508
667
|
/**
|
|
509
668
|
* Default divide-style utility values matching Tailwind CSS.
|
|
510
669
|
*/
|
|
511
|
-
export declare const
|
|
670
|
+
export declare const divideStyleValues: {
|
|
512
671
|
solid: string;
|
|
513
672
|
dashed: string;
|
|
514
673
|
dotted: string;
|
|
@@ -516,7 +675,7 @@ export declare const defaultDivideStyleValues: {
|
|
|
516
675
|
none: string;
|
|
517
676
|
};
|
|
518
677
|
|
|
519
|
-
export declare const
|
|
678
|
+
export declare const easingValues: {
|
|
520
679
|
readonly linear: "linear";
|
|
521
680
|
readonly ease: "ease";
|
|
522
681
|
readonly "ease-in": "ease-in";
|
|
@@ -550,10 +709,28 @@ export declare const defaultEasingValues: {
|
|
|
550
709
|
readonly bounce: "linear(0, 0.004, 0.016, 0.035, 0.063, 0.098, 0.141 13.6%, 0.25, 0.391, 0.563, 0.765, 1, 0.891 40.9%, 0.848, 0.813, 0.785, 0.766, 0.754, 0.75, 0.754, 0.766, 0.785, 0.813, 0.848, 0.891 68.2%, 1 72.7%, 0.973, 0.953, 0.941, 0.938, 0.941, 0.953, 0.973, 1, 0.988, 0.984, 0.988, 1)";
|
|
551
710
|
};
|
|
552
711
|
|
|
712
|
+
/**
|
|
713
|
+
* Generic type that transforms keys to their export names with a given prefix
|
|
714
|
+
*
|
|
715
|
+
* @example
|
|
716
|
+
* ExportKeys<"example-property", { "default": "...", "variant": "..." }> -> {
|
|
717
|
+
* "exampleProperty": Variable<'example-property'>,
|
|
718
|
+
* "examplePropertyVariant": Variable<'example-property.variant'>,
|
|
719
|
+
* }
|
|
720
|
+
*/
|
|
721
|
+
export declare type ExportKeys<Prefix extends string, T extends Record<string, unknown>, Separator extends string = "."> = {
|
|
722
|
+
[K in keyof T as CamelCase<ExportKeyVariableName<Prefix, K, Separator>>]: Variable<ExportKeyVariableName<Prefix, K, Separator>>;
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* Helper type to compute the variable name for a given prefix and key
|
|
727
|
+
*/
|
|
728
|
+
declare type ExportKeyVariableName<Prefix extends string, K, Separator extends string = "."> = K extends "default" ? Prefix : `${Prefix}${Separator}${K & (string | number)}`;
|
|
729
|
+
|
|
553
730
|
/**
|
|
554
731
|
* Default flex-direction utility values matching Tailwind CSS.
|
|
555
732
|
*/
|
|
556
|
-
export declare const
|
|
733
|
+
export declare const flexDirectionValues: {
|
|
557
734
|
row: string;
|
|
558
735
|
"row-reverse": string;
|
|
559
736
|
col: string;
|
|
@@ -563,7 +740,7 @@ export declare const defaultFlexDirectionValues: {
|
|
|
563
740
|
/**
|
|
564
741
|
* Default flex utility values matching Tailwind CSS.
|
|
565
742
|
*/
|
|
566
|
-
export declare const
|
|
743
|
+
export declare const flexValues: {
|
|
567
744
|
"1": string;
|
|
568
745
|
auto: string;
|
|
569
746
|
initial: string;
|
|
@@ -573,7 +750,7 @@ export declare const defaultFlexValues: {
|
|
|
573
750
|
/**
|
|
574
751
|
* Default flex-wrap utility values matching Tailwind CSS.
|
|
575
752
|
*/
|
|
576
|
-
export declare const
|
|
753
|
+
export declare const flexWrapValues: {
|
|
577
754
|
wrap: string;
|
|
578
755
|
"wrap-reverse": string;
|
|
579
756
|
nowrap: string;
|
|
@@ -582,7 +759,7 @@ export declare const defaultFlexWrapValues: {
|
|
|
582
759
|
/**
|
|
583
760
|
* Default float utility values matching Tailwind CSS.
|
|
584
761
|
*/
|
|
585
|
-
export declare const
|
|
762
|
+
export declare const floatValues: {
|
|
586
763
|
start: string;
|
|
587
764
|
end: string;
|
|
588
765
|
right: string;
|
|
@@ -590,21 +767,29 @@ export declare const defaultFloatValues: {
|
|
|
590
767
|
none: string;
|
|
591
768
|
};
|
|
592
769
|
|
|
593
|
-
export declare const
|
|
770
|
+
export declare const fontFamilyValues: {
|
|
594
771
|
default: string;
|
|
595
772
|
base: string;
|
|
596
773
|
print: string;
|
|
597
774
|
mono: string;
|
|
598
775
|
};
|
|
599
776
|
|
|
600
|
-
export declare const
|
|
777
|
+
export declare const fontSizeValues: {
|
|
601
778
|
default: string;
|
|
779
|
+
xs: string;
|
|
780
|
+
sm: string;
|
|
781
|
+
md: string;
|
|
782
|
+
lg: string;
|
|
783
|
+
xl: string;
|
|
784
|
+
"2xl": string;
|
|
785
|
+
"3xl": string;
|
|
786
|
+
"4xl": string;
|
|
602
787
|
};
|
|
603
788
|
|
|
604
789
|
/**
|
|
605
790
|
* Default font-smoothing utility values matching Tailwind CSS.
|
|
606
791
|
*/
|
|
607
|
-
export declare const
|
|
792
|
+
export declare const fontSmoothingValues: {
|
|
608
793
|
antialiased: string;
|
|
609
794
|
"subpixel-antialiased": string;
|
|
610
795
|
};
|
|
@@ -612,7 +797,7 @@ export declare const defaultFontSmoothingValues: {
|
|
|
612
797
|
/**
|
|
613
798
|
* Default font-stretch utility values matching Tailwind CSS.
|
|
614
799
|
*/
|
|
615
|
-
export declare const
|
|
800
|
+
export declare const fontStretchValues: {
|
|
616
801
|
"ultra-condensed": string;
|
|
617
802
|
"extra-condensed": string;
|
|
618
803
|
condensed: string;
|
|
@@ -624,45 +809,30 @@ export declare const defaultFontStretchValues: {
|
|
|
624
809
|
"ultra-expanded": string;
|
|
625
810
|
};
|
|
626
811
|
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
*/
|
|
630
|
-
export declare const defaultFontStyleValues: {
|
|
812
|
+
export declare const fontStyleValues: {
|
|
813
|
+
default: string;
|
|
631
814
|
italic: string;
|
|
632
|
-
|
|
815
|
+
oblique: string;
|
|
816
|
+
normal: string;
|
|
817
|
+
inherit: string;
|
|
633
818
|
};
|
|
634
819
|
|
|
635
820
|
/**
|
|
636
821
|
* Default font-variant-numeric utility values matching Tailwind CSS.
|
|
637
|
-
*/
|
|
638
|
-
export declare const
|
|
639
|
-
"normal-nums": string;
|
|
640
|
-
ordinal: string;
|
|
641
|
-
"slashed-zero": string;
|
|
642
|
-
"lining-nums": string;
|
|
643
|
-
"oldstyle-nums": string;
|
|
644
|
-
"proportional-nums": string;
|
|
645
|
-
"tabular-nums": string;
|
|
646
|
-
"diagonal-fractions": string;
|
|
647
|
-
"stacked-fractions": string;
|
|
648
|
-
};
|
|
649
|
-
|
|
650
|
-
/**
|
|
651
|
-
* Default font-weight utility values matching Tailwind CSS.
|
|
652
|
-
*/
|
|
653
|
-
export declare const defaultFontWeightUtilityValues: {
|
|
654
|
-
thin: string;
|
|
655
|
-
extralight: string;
|
|
656
|
-
light: string;
|
|
657
|
-
normal: string;
|
|
658
|
-
medium: string;
|
|
659
|
-
semibold: string;
|
|
660
|
-
bold: string;
|
|
661
|
-
extrabold: string;
|
|
662
|
-
black: string;
|
|
822
|
+
*/
|
|
823
|
+
export declare const fontVariantNumericValues: {
|
|
824
|
+
"normal-nums": string;
|
|
825
|
+
ordinal: string;
|
|
826
|
+
"slashed-zero": string;
|
|
827
|
+
"lining-nums": string;
|
|
828
|
+
"oldstyle-nums": string;
|
|
829
|
+
"proportional-nums": string;
|
|
830
|
+
"tabular-nums": string;
|
|
831
|
+
"diagonal-fractions": string;
|
|
832
|
+
"stacked-fractions": string;
|
|
663
833
|
};
|
|
664
834
|
|
|
665
|
-
export declare const
|
|
835
|
+
export declare const fontWeightValues: {
|
|
666
836
|
default: string;
|
|
667
837
|
extralight: number;
|
|
668
838
|
light: number;
|
|
@@ -679,7 +849,7 @@ export declare const defaultFontWeightValues: {
|
|
|
679
849
|
/**
|
|
680
850
|
* Default forced-color-adjust utility values matching Tailwind CSS.
|
|
681
851
|
*/
|
|
682
|
-
export declare const
|
|
852
|
+
export declare const forcedColorAdjustValues: {
|
|
683
853
|
auto: string;
|
|
684
854
|
none: string;
|
|
685
855
|
};
|
|
@@ -687,7 +857,7 @@ export declare const defaultForcedColorAdjustValues: {
|
|
|
687
857
|
/**
|
|
688
858
|
* Default grid-auto-flow utility values matching Tailwind CSS.
|
|
689
859
|
*/
|
|
690
|
-
export declare const
|
|
860
|
+
export declare const gridAutoFlowValues: {
|
|
691
861
|
row: string;
|
|
692
862
|
col: string;
|
|
693
863
|
dense: string;
|
|
@@ -698,16 +868,18 @@ export declare const defaultGridAutoFlowValues: {
|
|
|
698
868
|
/**
|
|
699
869
|
* Default hyphens utility values matching Tailwind CSS.
|
|
700
870
|
*/
|
|
701
|
-
export declare const
|
|
871
|
+
export declare const hyphensValues: {
|
|
702
872
|
none: string;
|
|
703
873
|
manual: string;
|
|
704
874
|
auto: string;
|
|
705
875
|
};
|
|
706
876
|
|
|
877
|
+
export declare function isKeyReferenceValue(value: unknown): value is `@${string}`;
|
|
878
|
+
|
|
707
879
|
/**
|
|
708
880
|
* Default isolation utility values matching Tailwind CSS.
|
|
709
881
|
*/
|
|
710
|
-
export declare const
|
|
882
|
+
export declare const isolationValues: {
|
|
711
883
|
isolate: string;
|
|
712
884
|
auto: string;
|
|
713
885
|
};
|
|
@@ -715,7 +887,7 @@ export declare const defaultIsolationValues: {
|
|
|
715
887
|
/**
|
|
716
888
|
* Default justify-content utility values matching Tailwind CSS.
|
|
717
889
|
*/
|
|
718
|
-
export declare const
|
|
890
|
+
export declare const justifyContentValues: {
|
|
719
891
|
normal: string;
|
|
720
892
|
start: string;
|
|
721
893
|
end: string;
|
|
@@ -729,7 +901,7 @@ export declare const defaultJustifyContentValues: {
|
|
|
729
901
|
/**
|
|
730
902
|
* Default justify-items utility values matching Tailwind CSS.
|
|
731
903
|
*/
|
|
732
|
-
export declare const
|
|
904
|
+
export declare const justifyItemsValues: {
|
|
733
905
|
start: string;
|
|
734
906
|
end: string;
|
|
735
907
|
center: string;
|
|
@@ -739,7 +911,7 @@ export declare const defaultJustifyItemsValues: {
|
|
|
739
911
|
/**
|
|
740
912
|
* Default justify-self utility values matching Tailwind CSS.
|
|
741
913
|
*/
|
|
742
|
-
export declare const
|
|
914
|
+
export declare const justifySelfValues: {
|
|
743
915
|
auto: string;
|
|
744
916
|
start: string;
|
|
745
917
|
end: string;
|
|
@@ -747,7 +919,7 @@ export declare const defaultJustifySelfValues: {
|
|
|
747
919
|
stretch: string;
|
|
748
920
|
};
|
|
749
921
|
|
|
750
|
-
export declare const
|
|
922
|
+
export declare const letterSpacingValues: {
|
|
751
923
|
default: string;
|
|
752
924
|
tighter: string;
|
|
753
925
|
tight: string;
|
|
@@ -756,7 +928,7 @@ export declare const defaultLetterSpacingValues: {
|
|
|
756
928
|
wider: string;
|
|
757
929
|
};
|
|
758
930
|
|
|
759
|
-
export declare const
|
|
931
|
+
export declare const lineHeightValues: {
|
|
760
932
|
default: string;
|
|
761
933
|
tight: number;
|
|
762
934
|
snug: number;
|
|
@@ -768,7 +940,7 @@ export declare const defaultLineHeightValues: {
|
|
|
768
940
|
/**
|
|
769
941
|
* Default list-style-position utility values matching Tailwind CSS.
|
|
770
942
|
*/
|
|
771
|
-
export declare const
|
|
943
|
+
export declare const listStylePositionValues: {
|
|
772
944
|
inside: string;
|
|
773
945
|
outside: string;
|
|
774
946
|
};
|
|
@@ -776,16 +948,35 @@ export declare const defaultListStylePositionValues: {
|
|
|
776
948
|
/**
|
|
777
949
|
* Default list-style-type utility values matching Tailwind CSS.
|
|
778
950
|
*/
|
|
779
|
-
export declare const
|
|
951
|
+
export declare const listStyleTypeValues: {
|
|
780
952
|
none: string;
|
|
781
953
|
disc: string;
|
|
782
954
|
decimal: string;
|
|
783
955
|
};
|
|
784
956
|
|
|
957
|
+
/**
|
|
958
|
+
* Meta configuration for advanced options
|
|
959
|
+
*/
|
|
960
|
+
export declare interface MetaConfig {
|
|
961
|
+
/**
|
|
962
|
+
* When true, custom values are merged with defaults instead of replacing them.
|
|
963
|
+
* Custom values override defaults with the same key.
|
|
964
|
+
*/
|
|
965
|
+
merge?: boolean;
|
|
966
|
+
colors?: ColorsMetaConfig;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* Meta configuration with merge option typed for inference
|
|
971
|
+
*/
|
|
972
|
+
export declare type MetaConfigWithMerge<TMerge extends boolean = false> = Omit<MetaConfig, "merge"> & {
|
|
973
|
+
merge?: TMerge;
|
|
974
|
+
};
|
|
975
|
+
|
|
785
976
|
/**
|
|
786
977
|
* Default mix-blend-mode utility values matching Tailwind CSS.
|
|
787
978
|
*/
|
|
788
|
-
export declare const
|
|
979
|
+
export declare const mixBlendModeValues: {
|
|
789
980
|
normal: string;
|
|
790
981
|
multiply: string;
|
|
791
982
|
screen: string;
|
|
@@ -809,7 +1000,7 @@ export declare const defaultMixBlendModeValues: {
|
|
|
809
1000
|
/**
|
|
810
1001
|
* Default object-fit utility values matching Tailwind CSS.
|
|
811
1002
|
*/
|
|
812
|
-
export declare const
|
|
1003
|
+
export declare const objectFitValues: {
|
|
813
1004
|
contain: string;
|
|
814
1005
|
cover: string;
|
|
815
1006
|
fill: string;
|
|
@@ -820,7 +1011,7 @@ export declare const defaultObjectFitValues: {
|
|
|
820
1011
|
/**
|
|
821
1012
|
* Default object-position utility values matching Tailwind CSS.
|
|
822
1013
|
*/
|
|
823
|
-
export declare const
|
|
1014
|
+
export declare const objectPositionValues: {
|
|
824
1015
|
bottom: string;
|
|
825
1016
|
center: string;
|
|
826
1017
|
left: string;
|
|
@@ -835,7 +1026,7 @@ export declare const defaultObjectPositionValues: {
|
|
|
835
1026
|
/**
|
|
836
1027
|
* Default outline-style utility values matching Tailwind CSS.
|
|
837
1028
|
*/
|
|
838
|
-
export declare const
|
|
1029
|
+
export declare const outlineStyleValues: {
|
|
839
1030
|
none: string;
|
|
840
1031
|
solid: string;
|
|
841
1032
|
dashed: string;
|
|
@@ -846,7 +1037,7 @@ export declare const defaultOutlineStyleValues: {
|
|
|
846
1037
|
/**
|
|
847
1038
|
* Default overflow utility values matching Tailwind CSS.
|
|
848
1039
|
*/
|
|
849
|
-
export declare const
|
|
1040
|
+
export declare const overflowValues: {
|
|
850
1041
|
auto: string;
|
|
851
1042
|
hidden: string;
|
|
852
1043
|
clip: string;
|
|
@@ -857,16 +1048,16 @@ export declare const defaultOverflowValues: {
|
|
|
857
1048
|
/**
|
|
858
1049
|
* Default overflow-wrap utility values matching Tailwind CSS.
|
|
859
1050
|
*/
|
|
860
|
-
export declare const
|
|
1051
|
+
export declare const overflowWrapValues: {
|
|
861
1052
|
normal: string;
|
|
862
1053
|
"break-word": string;
|
|
863
1054
|
anywhere: string;
|
|
864
1055
|
};
|
|
865
1056
|
|
|
866
1057
|
/**
|
|
867
|
-
* Default overscroll
|
|
1058
|
+
* Default overscroll utility values matching Tailwind CSS.
|
|
868
1059
|
*/
|
|
869
|
-
export declare const
|
|
1060
|
+
export declare const overscrollValues: {
|
|
870
1061
|
auto: string;
|
|
871
1062
|
contain: string;
|
|
872
1063
|
none: string;
|
|
@@ -875,7 +1066,7 @@ export declare const defaultOverscrollValues: {
|
|
|
875
1066
|
/**
|
|
876
1067
|
* Default perspective-origin utility values matching Tailwind CSS.
|
|
877
1068
|
*/
|
|
878
|
-
export declare const
|
|
1069
|
+
export declare const perspectiveOriginValues: {
|
|
879
1070
|
center: string;
|
|
880
1071
|
top: string;
|
|
881
1072
|
"top-right": string;
|
|
@@ -890,7 +1081,7 @@ export declare const defaultPerspectiveOriginValues: {
|
|
|
890
1081
|
/**
|
|
891
1082
|
* Default place-content utility values matching Tailwind CSS.
|
|
892
1083
|
*/
|
|
893
|
-
export declare const
|
|
1084
|
+
export declare const placeContentValues: {
|
|
894
1085
|
center: string;
|
|
895
1086
|
start: string;
|
|
896
1087
|
end: string;
|
|
@@ -904,7 +1095,7 @@ export declare const defaultPlaceContentValues: {
|
|
|
904
1095
|
/**
|
|
905
1096
|
* Default place-items utility values matching Tailwind CSS.
|
|
906
1097
|
*/
|
|
907
|
-
export declare const
|
|
1098
|
+
export declare const placeItemsValues: {
|
|
908
1099
|
start: string;
|
|
909
1100
|
end: string;
|
|
910
1101
|
center: string;
|
|
@@ -915,7 +1106,7 @@ export declare const defaultPlaceItemsValues: {
|
|
|
915
1106
|
/**
|
|
916
1107
|
* Default place-self utility values matching Tailwind CSS.
|
|
917
1108
|
*/
|
|
918
|
-
export declare const
|
|
1109
|
+
export declare const placeSelfValues: {
|
|
919
1110
|
auto: string;
|
|
920
1111
|
start: string;
|
|
921
1112
|
end: string;
|
|
@@ -926,7 +1117,7 @@ export declare const defaultPlaceSelfValues: {
|
|
|
926
1117
|
/**
|
|
927
1118
|
* Default pointer-events utility values matching Tailwind CSS.
|
|
928
1119
|
*/
|
|
929
|
-
export declare const
|
|
1120
|
+
export declare const pointerEventsValues: {
|
|
930
1121
|
none: string;
|
|
931
1122
|
auto: string;
|
|
932
1123
|
};
|
|
@@ -934,7 +1125,7 @@ export declare const defaultPointerEventsValues: {
|
|
|
934
1125
|
/**
|
|
935
1126
|
* Default position utility values matching Tailwind CSS.
|
|
936
1127
|
*/
|
|
937
|
-
export declare const
|
|
1128
|
+
export declare const positionValues: {
|
|
938
1129
|
static: string;
|
|
939
1130
|
fixed: string;
|
|
940
1131
|
absolute: string;
|
|
@@ -945,16 +1136,25 @@ export declare const defaultPositionValues: {
|
|
|
945
1136
|
/**
|
|
946
1137
|
* Default resize utility values matching Tailwind CSS.
|
|
947
1138
|
*/
|
|
948
|
-
export declare const
|
|
1139
|
+
export declare const resizeValues: {
|
|
949
1140
|
none: string;
|
|
950
1141
|
y: string;
|
|
951
1142
|
x: string;
|
|
952
1143
|
both: string;
|
|
953
1144
|
};
|
|
954
1145
|
|
|
955
|
-
|
|
1146
|
+
/**
|
|
1147
|
+
* Resolves which value record to use based on config:
|
|
1148
|
+
* - false => never (will be undefined)
|
|
1149
|
+
* - undefined => default values
|
|
1150
|
+
* - custom record => that record (or merged with defaults if TMerge is true)
|
|
1151
|
+
*/
|
|
1152
|
+
declare type ResolveTokens<TConfig, TDefault extends Record<string, unknown>, TMerge extends boolean = false> = TConfig extends false ? never : TConfig extends undefined ? TDefault : TConfig extends Record<string, unknown> ? TMerge extends true ? Omit<TDefault, keyof TConfig> & TConfig : TConfig : TDefault;
|
|
956
1153
|
|
|
957
|
-
export declare const
|
|
1154
|
+
export declare const scalePowerValues: readonly number[];
|
|
1155
|
+
|
|
1156
|
+
/** biome-ignore-all lint/suspicious/noApproximativeNumericConstant: Scale ratios are magic numbers */
|
|
1157
|
+
export declare const scaleValues: {
|
|
958
1158
|
readonly default: "@minor-third";
|
|
959
1159
|
readonly "minor-second": 1.067;
|
|
960
1160
|
readonly "major-second": 1.125;
|
|
@@ -969,7 +1169,7 @@ export declare const defaultScaleValues: {
|
|
|
969
1169
|
/**
|
|
970
1170
|
* Default scroll-behavior utility values matching Tailwind CSS.
|
|
971
1171
|
*/
|
|
972
|
-
export declare const
|
|
1172
|
+
export declare const scrollBehaviorValues: {
|
|
973
1173
|
auto: string;
|
|
974
1174
|
smooth: string;
|
|
975
1175
|
};
|
|
@@ -977,7 +1177,7 @@ export declare const defaultScrollBehaviorValues: {
|
|
|
977
1177
|
/**
|
|
978
1178
|
* Default scroll-snap-align utility values matching Tailwind CSS.
|
|
979
1179
|
*/
|
|
980
|
-
export declare const
|
|
1180
|
+
export declare const scrollSnapAlignValues: {
|
|
981
1181
|
start: string;
|
|
982
1182
|
end: string;
|
|
983
1183
|
center: string;
|
|
@@ -987,7 +1187,7 @@ export declare const defaultScrollSnapAlignValues: {
|
|
|
987
1187
|
/**
|
|
988
1188
|
* Default scroll-snap-stop utility values matching Tailwind CSS.
|
|
989
1189
|
*/
|
|
990
|
-
export declare const
|
|
1190
|
+
export declare const scrollSnapStopValues: {
|
|
991
1191
|
normal: string;
|
|
992
1192
|
always: string;
|
|
993
1193
|
};
|
|
@@ -995,7 +1195,7 @@ export declare const defaultScrollSnapStopValues: {
|
|
|
995
1195
|
/**
|
|
996
1196
|
* Default scroll-snap-type utility values matching Tailwind CSS.
|
|
997
1197
|
*/
|
|
998
|
-
export declare const
|
|
1198
|
+
export declare const scrollSnapTypeValues: {
|
|
999
1199
|
none: string;
|
|
1000
1200
|
x: string;
|
|
1001
1201
|
y: string;
|
|
@@ -1004,10 +1204,22 @@ export declare const defaultScrollSnapTypeValues: {
|
|
|
1004
1204
|
proximity: string;
|
|
1005
1205
|
};
|
|
1006
1206
|
|
|
1207
|
+
export declare const spacingValues: {
|
|
1208
|
+
default: string;
|
|
1209
|
+
"2xs": string;
|
|
1210
|
+
xs: string;
|
|
1211
|
+
sm: string;
|
|
1212
|
+
md: string;
|
|
1213
|
+
lg: string;
|
|
1214
|
+
xl: string;
|
|
1215
|
+
"2xl": string;
|
|
1216
|
+
"3xl": string;
|
|
1217
|
+
};
|
|
1218
|
+
|
|
1007
1219
|
/**
|
|
1008
1220
|
* Default table-layout utility values matching Tailwind CSS.
|
|
1009
1221
|
*/
|
|
1010
|
-
export declare const
|
|
1222
|
+
export declare const tableLayoutValues: {
|
|
1011
1223
|
auto: string;
|
|
1012
1224
|
fixed: string;
|
|
1013
1225
|
};
|
|
@@ -1015,7 +1227,7 @@ export declare const defaultTableLayoutValues: {
|
|
|
1015
1227
|
/**
|
|
1016
1228
|
* Default text-align utility values matching Tailwind CSS.
|
|
1017
1229
|
*/
|
|
1018
|
-
export declare const
|
|
1230
|
+
export declare const textAlignValues: {
|
|
1019
1231
|
left: string;
|
|
1020
1232
|
center: string;
|
|
1021
1233
|
right: string;
|
|
@@ -1027,7 +1239,7 @@ export declare const defaultTextAlignValues: {
|
|
|
1027
1239
|
/**
|
|
1028
1240
|
* Default text-decoration-line utility values matching Tailwind CSS.
|
|
1029
1241
|
*/
|
|
1030
|
-
export declare const
|
|
1242
|
+
export declare const textDecorationLineValues: {
|
|
1031
1243
|
underline: string;
|
|
1032
1244
|
overline: string;
|
|
1033
1245
|
"line-through": string;
|
|
@@ -1037,7 +1249,7 @@ export declare const defaultTextDecorationLineValues: {
|
|
|
1037
1249
|
/**
|
|
1038
1250
|
* Default text-decoration-style utility values matching Tailwind CSS.
|
|
1039
1251
|
*/
|
|
1040
|
-
export declare const
|
|
1252
|
+
export declare const textDecorationStyleValues: {
|
|
1041
1253
|
solid: string;
|
|
1042
1254
|
double: string;
|
|
1043
1255
|
dotted: string;
|
|
@@ -1048,7 +1260,7 @@ export declare const defaultTextDecorationStyleValues: {
|
|
|
1048
1260
|
/**
|
|
1049
1261
|
* Default text-overflow utility values matching Tailwind CSS.
|
|
1050
1262
|
*/
|
|
1051
|
-
export declare const
|
|
1263
|
+
export declare const textOverflowValues: {
|
|
1052
1264
|
truncate: string;
|
|
1053
1265
|
"text-ellipsis": string;
|
|
1054
1266
|
"text-clip": string;
|
|
@@ -1057,7 +1269,7 @@ export declare const defaultTextOverflowValues: {
|
|
|
1057
1269
|
/**
|
|
1058
1270
|
* Default text-transform utility values matching Tailwind CSS.
|
|
1059
1271
|
*/
|
|
1060
|
-
export declare const
|
|
1272
|
+
export declare const textTransformValues: {
|
|
1061
1273
|
uppercase: string;
|
|
1062
1274
|
lowercase: string;
|
|
1063
1275
|
capitalize: string;
|
|
@@ -1067,17 +1279,22 @@ export declare const defaultTextTransformValues: {
|
|
|
1067
1279
|
/**
|
|
1068
1280
|
* Default text-wrap utility values matching Tailwind CSS.
|
|
1069
1281
|
*/
|
|
1070
|
-
export declare const
|
|
1282
|
+
export declare const textWrapValues: {
|
|
1071
1283
|
wrap: string;
|
|
1072
1284
|
nowrap: string;
|
|
1073
1285
|
balance: string;
|
|
1074
1286
|
pretty: string;
|
|
1075
1287
|
};
|
|
1076
1288
|
|
|
1289
|
+
/**
|
|
1290
|
+
* Generates ExportKeys or undefined based on config
|
|
1291
|
+
*/
|
|
1292
|
+
declare type TokenResult<TConfig, TPrefix extends string, TDefault extends Record<string, unknown>, TMerge extends boolean = false, TSeparator extends string = "."> = TConfig extends false ? undefined : ExportKeys<TPrefix, ResolveTokens<TConfig, TDefault, TMerge>, TSeparator>;
|
|
1293
|
+
|
|
1077
1294
|
/**
|
|
1078
1295
|
* Default touch-action utility values matching Tailwind CSS.
|
|
1079
1296
|
*/
|
|
1080
|
-
export declare const
|
|
1297
|
+
export declare const touchActionValues: {
|
|
1081
1298
|
auto: string;
|
|
1082
1299
|
none: string;
|
|
1083
1300
|
"pan-x": string;
|
|
@@ -1093,7 +1310,7 @@ export declare const defaultTouchActionValues: {
|
|
|
1093
1310
|
/**
|
|
1094
1311
|
* Default transform-origin utility values matching Tailwind CSS.
|
|
1095
1312
|
*/
|
|
1096
|
-
export declare const
|
|
1313
|
+
export declare const transformOriginValues: {
|
|
1097
1314
|
center: string;
|
|
1098
1315
|
top: string;
|
|
1099
1316
|
"top-right": string;
|
|
@@ -1108,7 +1325,7 @@ export declare const defaultTransformOriginValues: {
|
|
|
1108
1325
|
/**
|
|
1109
1326
|
* Default transform-style utility values matching Tailwind CSS.
|
|
1110
1327
|
*/
|
|
1111
|
-
export declare const
|
|
1328
|
+
export declare const transformStyleValues: {
|
|
1112
1329
|
flat: string;
|
|
1113
1330
|
"3d": string;
|
|
1114
1331
|
};
|
|
@@ -1116,7 +1333,7 @@ export declare const defaultTransformStyleValues: {
|
|
|
1116
1333
|
/**
|
|
1117
1334
|
* Default transition-behavior utility values matching Tailwind CSS.
|
|
1118
1335
|
*/
|
|
1119
|
-
export declare const
|
|
1336
|
+
export declare const transitionBehaviorValues: {
|
|
1120
1337
|
normal: string;
|
|
1121
1338
|
"allow-discrete": string;
|
|
1122
1339
|
};
|
|
@@ -1124,7 +1341,7 @@ export declare const defaultTransitionBehaviorValues: {
|
|
|
1124
1341
|
/**
|
|
1125
1342
|
* Default transition-property utility values matching Tailwind CSS.
|
|
1126
1343
|
*/
|
|
1127
|
-
export declare const
|
|
1344
|
+
export declare const transitionPropertyValues: {
|
|
1128
1345
|
none: string;
|
|
1129
1346
|
all: string;
|
|
1130
1347
|
default: string;
|
|
@@ -1135,89 +1352,9 @@ export declare const defaultTransitionPropertyValues: {
|
|
|
1135
1352
|
};
|
|
1136
1353
|
|
|
1137
1354
|
/**
|
|
1138
|
-
*
|
|
1139
|
-
*/
|
|
1140
|
-
export declare const defaultUserSelectValues: {
|
|
1141
|
-
none: string;
|
|
1142
|
-
text: string;
|
|
1143
|
-
all: string;
|
|
1144
|
-
auto: string;
|
|
1145
|
-
};
|
|
1146
|
-
|
|
1147
|
-
/**
|
|
1148
|
-
* Default vertical-align utility values matching Tailwind CSS.
|
|
1149
|
-
*/
|
|
1150
|
-
export declare const defaultVerticalAlignValues: {
|
|
1151
|
-
baseline: string;
|
|
1152
|
-
top: string;
|
|
1153
|
-
middle: string;
|
|
1154
|
-
bottom: string;
|
|
1155
|
-
"text-top": string;
|
|
1156
|
-
"text-bottom": string;
|
|
1157
|
-
sub: string;
|
|
1158
|
-
super: string;
|
|
1159
|
-
};
|
|
1160
|
-
|
|
1161
|
-
/**
|
|
1162
|
-
* Default visibility utility values matching Tailwind CSS.
|
|
1163
|
-
*/
|
|
1164
|
-
export declare const defaultVisibilityValues: {
|
|
1165
|
-
visible: string;
|
|
1166
|
-
invisible: string;
|
|
1167
|
-
collapse: string;
|
|
1168
|
-
};
|
|
1169
|
-
|
|
1170
|
-
/**
|
|
1171
|
-
* Default white-space utility values matching Tailwind CSS.
|
|
1172
|
-
*/
|
|
1173
|
-
export declare const defaultWhitespaceValues: {
|
|
1174
|
-
normal: string;
|
|
1175
|
-
nowrap: string;
|
|
1176
|
-
pre: string;
|
|
1177
|
-
"pre-line": string;
|
|
1178
|
-
"pre-wrap": string;
|
|
1179
|
-
"break-spaces": string;
|
|
1180
|
-
};
|
|
1181
|
-
|
|
1182
|
-
/**
|
|
1183
|
-
* Default will-change utility values matching Tailwind CSS.
|
|
1184
|
-
*/
|
|
1185
|
-
export declare const defaultWillChangeValues: {
|
|
1186
|
-
auto: string;
|
|
1187
|
-
scroll: string;
|
|
1188
|
-
contents: string;
|
|
1189
|
-
transform: string;
|
|
1190
|
-
};
|
|
1191
|
-
|
|
1192
|
-
/**
|
|
1193
|
-
* Default word-break utility values matching Tailwind CSS.
|
|
1194
|
-
*/
|
|
1195
|
-
export declare const defaultWordBreakValues: {
|
|
1196
|
-
normal: string;
|
|
1197
|
-
words: string;
|
|
1198
|
-
all: string;
|
|
1199
|
-
keep: string;
|
|
1200
|
-
};
|
|
1201
|
-
|
|
1202
|
-
/**
|
|
1203
|
-
* Generic type that transforms keys to their export names with a given prefix
|
|
1204
|
-
*
|
|
1205
|
-
* @example
|
|
1206
|
-
* ExportKeys<"example-property", { "default": "...", "variant": "..." }> -> {
|
|
1207
|
-
* "exampleProperty": Variable<'example-property'>,
|
|
1208
|
-
* "examplePropertyVariant": Variable<'example-property.variant'>,
|
|
1209
|
-
* }
|
|
1210
|
-
*/
|
|
1211
|
-
export declare type ExportKeys<Prefix extends string, T extends Record<string, unknown>, Separator extends string = "."> = {
|
|
1212
|
-
[K in keyof T as CamelCase<ExportKeyVariableName<Prefix, K, Separator>>]: Variable<ExportKeyVariableName<Prefix, K, Separator>>;
|
|
1213
|
-
};
|
|
1214
|
-
|
|
1215
|
-
/**
|
|
1216
|
-
* Helper type to compute the variable name for a given prefix and key
|
|
1355
|
+
* Helper to convert a union to an intersection
|
|
1217
1356
|
*/
|
|
1218
|
-
declare type
|
|
1219
|
-
|
|
1220
|
-
export declare function isKeyReferenceValue(value: unknown): value is `@${string}`;
|
|
1357
|
+
declare type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
1221
1358
|
|
|
1222
1359
|
/**
|
|
1223
1360
|
* Create accent-color utility classes.
|
|
@@ -1474,6 +1611,21 @@ export declare const useBackgroundSizeUtility: <T extends Record<string, TokenVa
|
|
|
1474
1611
|
contain: string;
|
|
1475
1612
|
}>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
1476
1613
|
|
|
1614
|
+
/**
|
|
1615
|
+
* Create background shorthand utility classes.
|
|
1616
|
+
*
|
|
1617
|
+
* @example
|
|
1618
|
+
* ```typescript
|
|
1619
|
+
* const s = styleframe();
|
|
1620
|
+
* useBackgroundUtility(s, {
|
|
1621
|
+
* none: 'none',
|
|
1622
|
+
* cover: 'center / cover no-repeat',
|
|
1623
|
+
* contain: 'center / contain no-repeat',
|
|
1624
|
+
* });
|
|
1625
|
+
* ```
|
|
1626
|
+
*/
|
|
1627
|
+
export declare const useBackgroundUtility: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
1628
|
+
|
|
1477
1629
|
/**
|
|
1478
1630
|
* Create blur utility classes.
|
|
1479
1631
|
*
|
|
@@ -1526,7 +1678,9 @@ export declare const useBorderCollapseUtility: <T extends Record<string, TokenVa
|
|
|
1526
1678
|
* });
|
|
1527
1679
|
* ```
|
|
1528
1680
|
*/
|
|
1529
|
-
export declare const useBorderColor: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, tokens?: T | undefined
|
|
1681
|
+
export declare const useBorderColor: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
1682
|
+
default?: boolean;
|
|
1683
|
+
}) => ExportKeys<"border-color", T, ".">;
|
|
1530
1684
|
|
|
1531
1685
|
/**
|
|
1532
1686
|
* Create border-bottom-color utility classes.
|
|
@@ -1608,7 +1762,18 @@ export declare const useBorderColorYUtility: <T extends Record<string, TokenValu
|
|
|
1608
1762
|
* });
|
|
1609
1763
|
* ```
|
|
1610
1764
|
*/
|
|
1611
|
-
export declare const useBorderRadius: <T extends Record<string, TokenValue> =
|
|
1765
|
+
export declare const useBorderRadius: <T extends Record<string, TokenValue> = {
|
|
1766
|
+
default: string;
|
|
1767
|
+
none: string;
|
|
1768
|
+
sm: string;
|
|
1769
|
+
md: string;
|
|
1770
|
+
lg: string;
|
|
1771
|
+
xl: string;
|
|
1772
|
+
"2xl": string;
|
|
1773
|
+
full: string;
|
|
1774
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
1775
|
+
default?: boolean;
|
|
1776
|
+
}) => ExportKeys<"border-radius", T, ".">;
|
|
1612
1777
|
|
|
1613
1778
|
/**
|
|
1614
1779
|
* Create border-bottom-left-radius utility classes.
|
|
@@ -1755,7 +1920,9 @@ export declare const useBorderStyle: <T extends Record<string, TokenValue> = {
|
|
|
1755
1920
|
readonly groove: "groove";
|
|
1756
1921
|
readonly inset: "inset";
|
|
1757
1922
|
readonly outset: "outset";
|
|
1758
|
-
}>(s: Styleframe, tokens?: T | undefined
|
|
1923
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
1924
|
+
default?: boolean;
|
|
1925
|
+
}) => ExportKeys<"border-style", T, ".">;
|
|
1759
1926
|
|
|
1760
1927
|
/**
|
|
1761
1928
|
* Create border-style utility classes.
|
|
@@ -1800,7 +1967,9 @@ export declare const useBorderWidth: <T extends Record<string, TokenValue> = {
|
|
|
1800
1967
|
thin: string;
|
|
1801
1968
|
medium: string;
|
|
1802
1969
|
thick: string;
|
|
1803
|
-
}>(s: Styleframe, tokens?: T | undefined
|
|
1970
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
1971
|
+
default?: boolean;
|
|
1972
|
+
}) => ExportKeys<"border-width", T, ".">;
|
|
1804
1973
|
|
|
1805
1974
|
/**
|
|
1806
1975
|
* Create border-bottom-width utility classes.
|
|
@@ -1909,7 +2078,9 @@ export declare const useBoxShadow: <T extends Record<string, TokenValue> = {
|
|
|
1909
2078
|
"2xl": string;
|
|
1910
2079
|
inner: string;
|
|
1911
2080
|
ring: string;
|
|
1912
|
-
}>(s: Styleframe, tokens?: T | undefined
|
|
2081
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
2082
|
+
default?: boolean;
|
|
2083
|
+
}) => ExportKeys<"box-shadow", T, ".">;
|
|
1913
2084
|
|
|
1914
2085
|
/**
|
|
1915
2086
|
* Create box-shadow-color utility classes.
|
|
@@ -2013,7 +2184,9 @@ export declare const useBreakpoint: <T extends Record<string, TokenValue> = {
|
|
|
2013
2184
|
md: number;
|
|
2014
2185
|
lg: number;
|
|
2015
2186
|
xl: number;
|
|
2016
|
-
}>(s: Styleframe, tokens?: T | undefined
|
|
2187
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
2188
|
+
default?: boolean;
|
|
2189
|
+
}) => ExportKeys<"breakpoint", T, ".">;
|
|
2017
2190
|
|
|
2018
2191
|
/**
|
|
2019
2192
|
* Create brightness utility classes.
|
|
@@ -2064,7 +2237,9 @@ export declare const useClearUtility: <T extends Record<string, TokenValue> = {
|
|
|
2064
2237
|
* });
|
|
2065
2238
|
* ```
|
|
2066
2239
|
*/
|
|
2067
|
-
export declare const useColor: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, tokens?: T | undefined
|
|
2240
|
+
export declare const useColor: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
2241
|
+
default?: boolean;
|
|
2242
|
+
}) => ExportKeys<"color", T, ".">;
|
|
2068
2243
|
|
|
2069
2244
|
/**
|
|
2070
2245
|
* Create a set of lightness levels for a color variable.
|
|
@@ -2091,7 +2266,9 @@ export declare const useColor: <T extends Record<string, TokenValue> = Record<st
|
|
|
2091
2266
|
* });
|
|
2092
2267
|
* ```
|
|
2093
2268
|
*/
|
|
2094
|
-
export declare function useColorLightness<Name extends string, T extends Record<string | number, number>>(s: Styleframe, color: Variable<Name>, levels: T
|
|
2269
|
+
export declare function useColorLightness<Name extends string, T extends Record<string | number, number>>(s: Styleframe, color: Variable<Name>, levels: T, { default: isDefault }?: {
|
|
2270
|
+
default?: boolean;
|
|
2271
|
+
}): ExportKeys<Name, T, "-">;
|
|
2095
2272
|
|
|
2096
2273
|
/**
|
|
2097
2274
|
* Create color-scheme utility classes.
|
|
@@ -2124,7 +2301,9 @@ export declare const useColorSchemeUtility: <T extends Record<string, TokenValue
|
|
|
2124
2301
|
* });
|
|
2125
2302
|
* ```
|
|
2126
2303
|
*/
|
|
2127
|
-
export declare function useColorShade<Name extends string, T extends Record<string | number, number>>(s: Styleframe, color: Variable<Name>, levels: T
|
|
2304
|
+
export declare function useColorShade<Name extends string, T extends Record<string | number, number>>(s: Styleframe, color: Variable<Name>, levels: T, { default: isDefault }?: {
|
|
2305
|
+
default?: boolean;
|
|
2306
|
+
}): ExportKeys<`${Name}-shade`, T, "-">;
|
|
2128
2307
|
|
|
2129
2308
|
/**
|
|
2130
2309
|
* Create a set of relative color tint (lighter) levels
|
|
@@ -2147,7 +2326,9 @@ export declare function useColorShade<Name extends string, T extends Record<stri
|
|
|
2147
2326
|
* });
|
|
2148
2327
|
* ```
|
|
2149
2328
|
*/
|
|
2150
|
-
export declare function useColorTint<Name extends string, T extends Record<string | number, number>>(s: Styleframe, color: Variable<Name>, levels: T
|
|
2329
|
+
export declare function useColorTint<Name extends string, T extends Record<string | number, number>>(s: Styleframe, color: Variable<Name>, levels: T, { default: isDefault }?: {
|
|
2330
|
+
default?: boolean;
|
|
2331
|
+
}): ExportKeys<`${Name}-tint`, T, "-">;
|
|
2151
2332
|
|
|
2152
2333
|
/**
|
|
2153
2334
|
* Create color utility classes.
|
|
@@ -2246,6 +2427,57 @@ export declare const useCursorUtility: <T extends Record<string, TokenValue> = {
|
|
|
2246
2427
|
"zoom-out": string;
|
|
2247
2428
|
}>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
2248
2429
|
|
|
2430
|
+
/**
|
|
2431
|
+
* Create a complete design token system with sensible defaults.
|
|
2432
|
+
*
|
|
2433
|
+
* @param s - The Styleframe instance
|
|
2434
|
+
* @param config - Configuration options for customizing the preset
|
|
2435
|
+
* @returns An object containing all generated design token variables
|
|
2436
|
+
*
|
|
2437
|
+
* @remarks
|
|
2438
|
+
* **Scale Powers**: The `scalePowers` result is only generated when the `scale` config
|
|
2439
|
+
* includes a key named `scale` (either via defaults or a custom config with `{ default: "@scale", scale: "1.2" }`).
|
|
2440
|
+
* If you provide a custom scale config without a `scale` key (e.g., `{ ratio: "1.25" }`),
|
|
2441
|
+
* `scalePowers` will be `undefined`.
|
|
2442
|
+
*
|
|
2443
|
+
* @example
|
|
2444
|
+
* ```typescript
|
|
2445
|
+
* import { styleframe } from "styleframe";
|
|
2446
|
+
* import { useDesignTokensPreset } from "@styleframe/theme";
|
|
2447
|
+
*
|
|
2448
|
+
* const s = styleframe();
|
|
2449
|
+
*
|
|
2450
|
+
* // Use all defaults
|
|
2451
|
+
* const tokens = useDesignTokensPreset(s);
|
|
2452
|
+
*
|
|
2453
|
+
* // Customize specific domains
|
|
2454
|
+
* const tokens = useDesignTokensPreset(s, {
|
|
2455
|
+
* colors: { primary: "#ff6600", secondary: "#333" },
|
|
2456
|
+
* meta: {
|
|
2457
|
+
* colors: {
|
|
2458
|
+
* generateLightness: true,
|
|
2459
|
+
* generateShades: false,
|
|
2460
|
+
* },
|
|
2461
|
+
* },
|
|
2462
|
+
* spacing: {
|
|
2463
|
+
* default: "0.5rem",
|
|
2464
|
+
* sm: "0.25rem",
|
|
2465
|
+
* md: "0.5rem",
|
|
2466
|
+
* lg: "1rem",
|
|
2467
|
+
* },
|
|
2468
|
+
* easing: false, // Disable easing entirely
|
|
2469
|
+
* });
|
|
2470
|
+
*
|
|
2471
|
+
* // Merge custom values with defaults
|
|
2472
|
+
* const tokens = useDesignTokensPreset(s, {
|
|
2473
|
+
* meta: { merge: true },
|
|
2474
|
+
* spacing: { xl: "2rem", xxl: "4rem" }, // Added to default spacing values
|
|
2475
|
+
* colors: { brand: "#ff6600" }, // Added to default colors
|
|
2476
|
+
* });
|
|
2477
|
+
* ```
|
|
2478
|
+
*/
|
|
2479
|
+
export declare function useDesignTokensPreset<TSpacing extends Record<string, TokenValue> | false = DefaultSpacing, TBorderWidth extends Record<string, TokenValue> | false = DefaultBorderWidth, TBorderRadius extends Record<string, TokenValue> | false = DefaultBorderRadius, TBorderStyle extends Record<string, TokenValue> | false = DefaultBorderStyle, TBoxShadow extends Record<string, TokenValue> | false = DefaultBoxShadow, TColors extends Record<string, string> | false = DefaultColors, TFontFamily extends Record<string, TokenValue> | false = DefaultFontFamily, TFontSize extends Record<string, TokenValue> | false = DefaultFontSize, TFontStyle extends Record<string, TokenValue> | false = DefaultFontStyle, TFontWeight extends Record<string, TokenValue> | false = DefaultFontWeight, TLineHeight extends Record<string, TokenValue> | false = DefaultLineHeight, TLetterSpacing extends Record<string, TokenValue> | false = DefaultLetterSpacing, TScale extends Record<string, TokenValue> | false = DefaultScale, TBreakpoint extends Record<string, number> | false = DefaultBreakpoint, TEasing extends Record<string, TokenValue> | false = DefaultEasing, TMerge extends boolean = false>(s: Styleframe, config?: DesignTokensPresetConfig<TSpacing, TBorderWidth, TBorderRadius, TBorderStyle, TBoxShadow, TColors, TFontFamily, TFontSize, TFontStyle, TFontWeight, TLineHeight, TLetterSpacing, TScale, TBreakpoint, TEasing, TMerge>): DesignTokensPresetResult<TSpacing, TBorderWidth, TBorderRadius, TBorderStyle, TBoxShadow, TColors, TFontFamily, TFontSize, TFontStyle, TFontWeight, TLineHeight, TLetterSpacing, TScale, TBreakpoint, TEasing, TMerge>;
|
|
2480
|
+
|
|
2249
2481
|
/**
|
|
2250
2482
|
* Create display utility classes.
|
|
2251
2483
|
*
|
|
@@ -2383,7 +2615,9 @@ export declare const useEasing: <T extends Record<string, TokenValue> = {
|
|
|
2383
2615
|
readonly "ease-in-out-back": "cubic-bezier(0.68, -0.55, 0.265, 1.55)";
|
|
2384
2616
|
readonly spring: "linear(0, 0.0018, 0.0069 1.15%, 0.026 2.3%, 0.0637, 0.1135 5.18%, 0.2229 7.78%, 0.5977 15.84%, 0.7014, 0.7904, 0.8641, 0.9228, 0.9676 28.8%, 1.0032 31.68%, 1.0225, 1.0352 36.29%, 1.0431 38.88%, 1.046 42.05%, 1.0448 44.35%, 1.0407 47.23%, 1.0118 61.63%, 1.0025 69.41%, 0.9981 80.35%, 0.9992 99.94%)";
|
|
2385
2617
|
readonly bounce: "linear(0, 0.004, 0.016, 0.035, 0.063, 0.098, 0.141 13.6%, 0.25, 0.391, 0.563, 0.765, 1, 0.891 40.9%, 0.848, 0.813, 0.785, 0.766, 0.754, 0.75, 0.754, 0.766, 0.785, 0.813, 0.848, 0.891 68.2%, 1 72.7%, 0.973, 0.953, 0.941, 0.938, 0.941, 0.953, 0.973, 1, 0.988, 0.984, 0.988, 1)";
|
|
2386
|
-
}>(s: Styleframe, tokens?: T | undefined
|
|
2618
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
2619
|
+
default?: boolean;
|
|
2620
|
+
}) => ExportKeys<"easing", T, ".">;
|
|
2387
2621
|
|
|
2388
2622
|
/**
|
|
2389
2623
|
* Create fill utility classes for SVG elements.
|
|
@@ -2488,7 +2722,9 @@ export declare const useFontFamily: <T extends Record<string, TokenValue> = {
|
|
|
2488
2722
|
base: string;
|
|
2489
2723
|
print: string;
|
|
2490
2724
|
mono: string;
|
|
2491
|
-
}>(s: Styleframe, tokens?: T | undefined
|
|
2725
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
2726
|
+
default?: boolean;
|
|
2727
|
+
}) => ExportKeys<"font-family", T, ".">;
|
|
2492
2728
|
|
|
2493
2729
|
/**
|
|
2494
2730
|
* Create font-family utility classes.
|
|
@@ -2530,7 +2766,17 @@ export declare const useFontFamilyUtility: <T extends Record<string, TokenValue>
|
|
|
2530
2766
|
*/
|
|
2531
2767
|
export declare const useFontSize: <T extends Record<string, TokenValue> = {
|
|
2532
2768
|
default: string;
|
|
2533
|
-
|
|
2769
|
+
xs: string;
|
|
2770
|
+
sm: string;
|
|
2771
|
+
md: string;
|
|
2772
|
+
lg: string;
|
|
2773
|
+
xl: string;
|
|
2774
|
+
"2xl": string;
|
|
2775
|
+
"3xl": string;
|
|
2776
|
+
"4xl": string;
|
|
2777
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
2778
|
+
default?: boolean;
|
|
2779
|
+
}) => ExportKeys<"font-size", T, ".">;
|
|
2534
2780
|
|
|
2535
2781
|
/**
|
|
2536
2782
|
* Create font-size utility classes.
|
|
@@ -2572,12 +2818,49 @@ export declare const useFontStretchUtility: <T extends Record<string, TokenValue
|
|
|
2572
2818
|
"ultra-expanded": string;
|
|
2573
2819
|
}>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
2574
2820
|
|
|
2821
|
+
/**
|
|
2822
|
+
* Create a set of font-style variables for use in a Styleframe instance.
|
|
2823
|
+
*
|
|
2824
|
+
* @usage
|
|
2825
|
+
* ```typescript
|
|
2826
|
+
* import { styleframe } from "styleframe";
|
|
2827
|
+
* import { useFontStyle } from "styleframe/theme";
|
|
2828
|
+
*
|
|
2829
|
+
* const s = styleframe();
|
|
2830
|
+
*
|
|
2831
|
+
* const {
|
|
2832
|
+
* fontStyleItalic,
|
|
2833
|
+
* fontStyleOblique,
|
|
2834
|
+
* fontStyleNormal,
|
|
2835
|
+
* fontStyle,
|
|
2836
|
+
* } = useFontStyle(s, {
|
|
2837
|
+
* default: "normal",
|
|
2838
|
+
* italic: "italic",
|
|
2839
|
+
* oblique: "oblique",
|
|
2840
|
+
* normal: "normal",
|
|
2841
|
+
* inherit: "inherit",
|
|
2842
|
+
* });
|
|
2843
|
+
* ```
|
|
2844
|
+
*/
|
|
2845
|
+
export declare const useFontStyle: <T extends Record<string, TokenValue> = {
|
|
2846
|
+
default: string;
|
|
2847
|
+
italic: string;
|
|
2848
|
+
oblique: string;
|
|
2849
|
+
normal: string;
|
|
2850
|
+
inherit: string;
|
|
2851
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
2852
|
+
default?: boolean;
|
|
2853
|
+
}) => ExportKeys<"font-style", T, ".">;
|
|
2854
|
+
|
|
2575
2855
|
/**
|
|
2576
2856
|
* Create font-style utility classes.
|
|
2577
2857
|
*/
|
|
2578
2858
|
export declare const useFontStyleUtility: <T extends Record<string, TokenValue> = {
|
|
2859
|
+
default: string;
|
|
2579
2860
|
italic: string;
|
|
2580
|
-
|
|
2861
|
+
oblique: string;
|
|
2862
|
+
normal: string;
|
|
2863
|
+
inherit: string;
|
|
2581
2864
|
}>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
2582
2865
|
|
|
2583
2866
|
/**
|
|
@@ -2643,7 +2926,9 @@ export declare const useFontWeight: <T extends Record<string, TokenValue> = {
|
|
|
2643
2926
|
lighter: string;
|
|
2644
2927
|
bolder: string;
|
|
2645
2928
|
inherit: string;
|
|
2646
|
-
}>(s: Styleframe, tokens?: T | undefined
|
|
2929
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
2930
|
+
default?: boolean;
|
|
2931
|
+
}) => ExportKeys<"font-weight", T, ".">;
|
|
2647
2932
|
|
|
2648
2933
|
/**
|
|
2649
2934
|
* Create font-weight utility classes.
|
|
@@ -2930,7 +3215,9 @@ export declare const useLetterSpacing: <T extends Record<string, TokenValue> = {
|
|
|
2930
3215
|
normal: string;
|
|
2931
3216
|
wide: string;
|
|
2932
3217
|
wider: string;
|
|
2933
|
-
}>(s: Styleframe, tokens?: T | undefined
|
|
3218
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
3219
|
+
default?: boolean;
|
|
3220
|
+
}) => ExportKeys<"letter-spacing", T, ".">;
|
|
2934
3221
|
|
|
2935
3222
|
/**
|
|
2936
3223
|
* Create letter-spacing utility classes.
|
|
@@ -2996,7 +3283,9 @@ export declare const useLineHeight: <T extends Record<string, TokenValue> = {
|
|
|
2996
3283
|
normal: number;
|
|
2997
3284
|
relaxed: number;
|
|
2998
3285
|
loose: number;
|
|
2999
|
-
}>(s: Styleframe, tokens?: T | undefined
|
|
3286
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
3287
|
+
default?: boolean;
|
|
3288
|
+
}) => ExportKeys<"line-height", T, ".">;
|
|
3000
3289
|
|
|
3001
3290
|
/**
|
|
3002
3291
|
* Create line-height utility classes.
|
|
@@ -3575,6 +3864,16 @@ export declare const useRotateXUtility: <T extends Record<string, TokenValue> =
|
|
|
3575
3864
|
*/
|
|
3576
3865
|
export declare const useRotateYUtility: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
3577
3866
|
|
|
3867
|
+
/**
|
|
3868
|
+
* Default user-select utility values matching Tailwind CSS.
|
|
3869
|
+
*/
|
|
3870
|
+
export declare const userSelectValues: {
|
|
3871
|
+
none: string;
|
|
3872
|
+
text: string;
|
|
3873
|
+
all: string;
|
|
3874
|
+
auto: string;
|
|
3875
|
+
};
|
|
3876
|
+
|
|
3578
3877
|
/**
|
|
3579
3878
|
* Create saturate utility classes.
|
|
3580
3879
|
*/
|
|
@@ -3623,7 +3922,9 @@ export declare const useScale: <T extends Record<string, TokenValue> = {
|
|
|
3623
3922
|
readonly "augmented-fourth": 1.414;
|
|
3624
3923
|
readonly "perfect-fifth": 1.5;
|
|
3625
3924
|
readonly golden: 1.618;
|
|
3626
|
-
}>(s: Styleframe, tokens?: T | undefined
|
|
3925
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
3926
|
+
default?: boolean;
|
|
3927
|
+
}) => ExportKeys<"scale", T, ".">;
|
|
3627
3928
|
|
|
3628
3929
|
export declare function useScalePowers<T extends readonly number[]>(s: Styleframe, scale: Variable | Reference, powers?: T): Record<number, TokenValue>;
|
|
3629
3930
|
|
|
@@ -3656,7 +3957,7 @@ export declare const useScrollBehaviorUtility: <T extends Record<string, TokenVa
|
|
|
3656
3957
|
export declare const useScrollMarginBottomUtility: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
3657
3958
|
|
|
3658
3959
|
/**
|
|
3659
|
-
* Create scroll-margin-end utility classes.
|
|
3960
|
+
* Create scroll-margin-inline-end utility classes.
|
|
3660
3961
|
*/
|
|
3661
3962
|
export declare const useScrollMarginEndUtility: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
3662
3963
|
|
|
@@ -3671,7 +3972,7 @@ export declare const useScrollMarginLeftUtility: <T extends Record<string, Token
|
|
|
3671
3972
|
export declare const useScrollMarginRightUtility: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
3672
3973
|
|
|
3673
3974
|
/**
|
|
3674
|
-
* Create scroll-margin-start utility classes.
|
|
3975
|
+
* Create scroll-margin-inline-start utility classes.
|
|
3675
3976
|
*/
|
|
3676
3977
|
export declare const useScrollMarginStartUtility: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
3677
3978
|
|
|
@@ -3701,7 +4002,7 @@ export declare const useScrollMarginYUtility: <T extends Record<string, TokenVal
|
|
|
3701
4002
|
export declare const useScrollPaddingBottomUtility: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
3702
4003
|
|
|
3703
4004
|
/**
|
|
3704
|
-
* Create scroll-padding-end utility classes.
|
|
4005
|
+
* Create scroll-padding-inline-end utility classes.
|
|
3705
4006
|
*/
|
|
3706
4007
|
export declare const useScrollPaddingEndUtility: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
3707
4008
|
|
|
@@ -3716,7 +4017,7 @@ export declare const useScrollPaddingLeftUtility: <T extends Record<string, Toke
|
|
|
3716
4017
|
export declare const useScrollPaddingRightUtility: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
3717
4018
|
|
|
3718
4019
|
/**
|
|
3719
|
-
* Create scroll-padding-start utility classes.
|
|
4020
|
+
* Create scroll-padding-inline-start utility classes.
|
|
3720
4021
|
*/
|
|
3721
4022
|
export declare const useScrollPaddingStartUtility: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
3722
4023
|
|
|
@@ -3855,7 +4156,19 @@ export declare const useSpaceYUtility: <T extends Record<string, TokenValue> = R
|
|
|
3855
4156
|
* });
|
|
3856
4157
|
* ```
|
|
3857
4158
|
*/
|
|
3858
|
-
export declare const useSpacing: <T extends Record<string, TokenValue> =
|
|
4159
|
+
export declare const useSpacing: <T extends Record<string, TokenValue> = {
|
|
4160
|
+
default: string;
|
|
4161
|
+
"2xs": string;
|
|
4162
|
+
xs: string;
|
|
4163
|
+
sm: string;
|
|
4164
|
+
md: string;
|
|
4165
|
+
lg: string;
|
|
4166
|
+
xl: string;
|
|
4167
|
+
"2xl": string;
|
|
4168
|
+
"3xl": string;
|
|
4169
|
+
}>(s: Styleframe, tokens?: T | undefined, { default: isDefault }?: {
|
|
4170
|
+
default?: boolean;
|
|
4171
|
+
}) => ExportKeys<"spacing", T, ".">;
|
|
3859
4172
|
|
|
3860
4173
|
/**
|
|
3861
4174
|
* Create screen-reader only utility class.
|
|
@@ -3980,10 +4293,10 @@ export declare const useTextShadowColorUtility: <T extends Record<string, TokenV
|
|
|
3980
4293
|
* ```typescript
|
|
3981
4294
|
* const s = styleframe();
|
|
3982
4295
|
* useTextShadowUtility(s, {
|
|
3983
|
-
* sm: '0 1px 2px var(--
|
|
3984
|
-
* default: '0 1px 3px var(--
|
|
3985
|
-
* md: '0 2px 4px var(--
|
|
3986
|
-
* lg: '0 4px 8px var(--
|
|
4296
|
+
* sm: '0 1px 2px var(--text-shadow-color, rgb(0 0 0 / 0.05))',
|
|
4297
|
+
* default: '0 1px 3px var(--text-shadow-color, rgb(0 0 0 / 0.1))',
|
|
4298
|
+
* md: '0 2px 4px var(--text-shadow-color, rgb(0 0 0 / 0.1))',
|
|
4299
|
+
* lg: '0 4px 8px var(--text-shadow-color, rgb(0 0 0 / 0.1))',
|
|
3987
4300
|
* none: 'none',
|
|
3988
4301
|
* });
|
|
3989
4302
|
* ```
|
|
@@ -4142,40 +4455,39 @@ export declare const useUserSelectUtility: <T extends Record<string, TokenValue>
|
|
|
4142
4455
|
* Register all utility factories with the Styleframe instance and return their creator functions.
|
|
4143
4456
|
*
|
|
4144
4457
|
* This function is useful when you want to register all utilities at once for use with recipes.
|
|
4145
|
-
* Each utility factory is registered
|
|
4146
|
-
*
|
|
4458
|
+
* Each utility factory is registered with configurable default values.
|
|
4459
|
+
*
|
|
4460
|
+
* @param s - The Styleframe instance to register utilities with
|
|
4461
|
+
* @param config - Configuration options for customizing utility defaults
|
|
4462
|
+
* @returns An object containing creator functions for all registered utilities
|
|
4147
4463
|
*
|
|
4148
4464
|
* @example
|
|
4149
4465
|
* ```typescript
|
|
4150
4466
|
* import { styleframe } from "styleframe";
|
|
4151
|
-
* import {
|
|
4467
|
+
* import { useUtilitiesPreset } from "@styleframe/theme";
|
|
4152
4468
|
*
|
|
4153
4469
|
* const s = styleframe();
|
|
4154
|
-
*
|
|
4155
|
-
*
|
|
4156
|
-
*
|
|
4157
|
-
*
|
|
4158
|
-
*
|
|
4159
|
-
*
|
|
4160
|
-
*
|
|
4161
|
-
* //
|
|
4162
|
-
* createMarginUtility({ sm: '0.5rem', md: '1rem', lg: '1.5rem' });
|
|
4163
|
-
* createPaddingUtility({ sm: '0.5rem', md: '1rem', lg: '1.5rem' });
|
|
4164
|
-
*
|
|
4165
|
-
* // Or use them in recipes - utilities are already registered
|
|
4166
|
-
* s.recipe({
|
|
4167
|
-
* name: 'button',
|
|
4168
|
-
* base: { display: 'flex' },
|
|
4169
|
-
* variants: {
|
|
4170
|
-
* size: {
|
|
4171
|
-
* sm: { padding: '0.5rem' },
|
|
4172
|
-
* md: { padding: '1rem' },
|
|
4173
|
-
* },
|
|
4174
|
-
* },
|
|
4470
|
+
*
|
|
4471
|
+
* // Use all defaults
|
|
4472
|
+
* const utilities = useUtilitiesPreset(s);
|
|
4473
|
+
*
|
|
4474
|
+
* // Customize specific utilities
|
|
4475
|
+
* const utilities = useUtilitiesPreset(s, {
|
|
4476
|
+
* display: { flex: "flex", block: "block", hidden: "none" },
|
|
4477
|
+
* position: false, // Disable position utilities
|
|
4175
4478
|
* });
|
|
4479
|
+
*
|
|
4480
|
+
* // Merge custom values with defaults
|
|
4481
|
+
* const utilities = useUtilitiesPreset(s, {
|
|
4482
|
+
* meta: { merge: true },
|
|
4483
|
+
* cursor: { custom: "url('custom.cur'), auto" },
|
|
4484
|
+
* });
|
|
4485
|
+
*
|
|
4486
|
+
* // Now you can use the creator functions to define additional utility values
|
|
4487
|
+
* utilities.createMarginUtility({ sm: '0.5rem', md: '1rem', lg: '1.5rem' });
|
|
4176
4488
|
* ```
|
|
4177
4489
|
*/
|
|
4178
|
-
export declare function
|
|
4490
|
+
export declare function useUtilitiesPreset(s: Styleframe, config?: UtilitiesPresetConfig): {
|
|
4179
4491
|
createForcedColorAdjustUtility: UtilityCreatorFn;
|
|
4180
4492
|
createNotSrOnlyUtility: UtilityCreatorFn;
|
|
4181
4493
|
createSrOnlyUtility: UtilityCreatorFn;
|
|
@@ -4187,6 +4499,7 @@ export declare function useUtilities(s: Styleframe): {
|
|
|
4187
4499
|
createBackgroundPositionUtility: UtilityCreatorFn;
|
|
4188
4500
|
createBackgroundRepeatUtility: UtilityCreatorFn;
|
|
4189
4501
|
createBackgroundSizeUtility: UtilityCreatorFn;
|
|
4502
|
+
createBackgroundUtility: UtilityCreatorFn;
|
|
4190
4503
|
createGradientFromUtility: UtilityCreatorFn;
|
|
4191
4504
|
createGradientToUtility: UtilityCreatorFn;
|
|
4192
4505
|
createGradientViaUtility: UtilityCreatorFn;
|
|
@@ -4553,4 +4866,161 @@ export declare const useWordBreakUtility: <T extends Record<string, TokenValue>
|
|
|
4553
4866
|
*/
|
|
4554
4867
|
export declare const useZIndexUtility: <T extends Record<string, TokenValue> = Record<string, TokenValue>>(s: Styleframe, values?: T | undefined, modifiers?: ModifierFactory[]) => UtilityCreatorFn;
|
|
4555
4868
|
|
|
4869
|
+
/**
|
|
4870
|
+
* Meta configuration for utilities preset
|
|
4871
|
+
*/
|
|
4872
|
+
export declare interface UtilitiesMetaConfig {
|
|
4873
|
+
/**
|
|
4874
|
+
* When true, custom values are merged with defaults instead of replacing them.
|
|
4875
|
+
* Custom values override defaults with the same key.
|
|
4876
|
+
*/
|
|
4877
|
+
merge?: boolean;
|
|
4878
|
+
}
|
|
4879
|
+
|
|
4880
|
+
/**
|
|
4881
|
+
* Configuration options for the utilities preset.
|
|
4882
|
+
*
|
|
4883
|
+
* - Omit or set to `undefined` to use default values
|
|
4884
|
+
* - Set to `false` to disable the utility category entirely
|
|
4885
|
+
* - Provide a custom record to use custom values
|
|
4886
|
+
* - Set `meta.merge` to `true` to merge custom values with defaults
|
|
4887
|
+
*/
|
|
4888
|
+
export declare interface UtilitiesPresetConfig {
|
|
4889
|
+
meta?: UtilitiesMetaConfig;
|
|
4890
|
+
forcedColorAdjust?: Record<string, string> | false;
|
|
4891
|
+
backgroundAttachment?: Record<string, string> | false;
|
|
4892
|
+
backgroundClip?: Record<string, string> | false;
|
|
4893
|
+
backgroundImage?: Record<string, string> | false;
|
|
4894
|
+
backgroundOrigin?: Record<string, string> | false;
|
|
4895
|
+
backgroundPosition?: Record<string, string> | false;
|
|
4896
|
+
backgroundRepeat?: Record<string, string> | false;
|
|
4897
|
+
backgroundSize?: Record<string, string> | false;
|
|
4898
|
+
backgroundBlendMode?: Record<string, string> | false;
|
|
4899
|
+
mixBlendMode?: Record<string, string> | false;
|
|
4900
|
+
divideStyle?: Record<string, string> | false;
|
|
4901
|
+
outlineStyle?: Record<string, string> | false;
|
|
4902
|
+
flex?: Record<string, string> | false;
|
|
4903
|
+
flexDirection?: Record<string, string> | false;
|
|
4904
|
+
flexWrap?: Record<string, string> | false;
|
|
4905
|
+
justifyContent?: Record<string, string> | false;
|
|
4906
|
+
justifyItems?: Record<string, string> | false;
|
|
4907
|
+
justifySelf?: Record<string, string> | false;
|
|
4908
|
+
alignContent?: Record<string, string> | false;
|
|
4909
|
+
alignItems?: Record<string, string> | false;
|
|
4910
|
+
alignSelf?: Record<string, string> | false;
|
|
4911
|
+
placeContent?: Record<string, string> | false;
|
|
4912
|
+
placeItems?: Record<string, string> | false;
|
|
4913
|
+
placeSelf?: Record<string, string> | false;
|
|
4914
|
+
gridAutoFlow?: Record<string, string> | false;
|
|
4915
|
+
appearance?: Record<string, string> | false;
|
|
4916
|
+
colorScheme?: Record<string, string> | false;
|
|
4917
|
+
cursor?: Record<string, string> | false;
|
|
4918
|
+
pointerEvents?: Record<string, string> | false;
|
|
4919
|
+
resize?: Record<string, string> | false;
|
|
4920
|
+
scrollBehavior?: Record<string, string> | false;
|
|
4921
|
+
scrollSnapAlign?: Record<string, string> | false;
|
|
4922
|
+
scrollSnapStop?: Record<string, string> | false;
|
|
4923
|
+
scrollSnapType?: Record<string, string> | false;
|
|
4924
|
+
touchAction?: Record<string, string> | false;
|
|
4925
|
+
userSelect?: Record<string, string> | false;
|
|
4926
|
+
willChange?: Record<string, string> | false;
|
|
4927
|
+
aspectRatio?: Record<string, string> | false;
|
|
4928
|
+
boxDecorationBreak?: Record<string, string> | false;
|
|
4929
|
+
boxSizing?: Record<string, string> | false;
|
|
4930
|
+
breakAfter?: Record<string, string> | false;
|
|
4931
|
+
breakBefore?: Record<string, string> | false;
|
|
4932
|
+
breakInside?: Record<string, string> | false;
|
|
4933
|
+
clear?: Record<string, string> | false;
|
|
4934
|
+
display?: Record<string, string> | false;
|
|
4935
|
+
float?: Record<string, string> | false;
|
|
4936
|
+
isolation?: Record<string, string> | false;
|
|
4937
|
+
objectFit?: Record<string, string> | false;
|
|
4938
|
+
objectPosition?: Record<string, string> | false;
|
|
4939
|
+
overflow?: Record<string, string> | false;
|
|
4940
|
+
overscroll?: Record<string, string> | false;
|
|
4941
|
+
position?: Record<string, string> | false;
|
|
4942
|
+
visibility?: Record<string, string> | false;
|
|
4943
|
+
borderCollapse?: Record<string, string> | false;
|
|
4944
|
+
captionSide?: Record<string, string> | false;
|
|
4945
|
+
tableLayout?: Record<string, string> | false;
|
|
4946
|
+
backfaceVisibility?: Record<string, string> | false;
|
|
4947
|
+
perspectiveOrigin?: Record<string, string> | false;
|
|
4948
|
+
transformOrigin?: Record<string, string> | false;
|
|
4949
|
+
transformStyle?: Record<string, string> | false;
|
|
4950
|
+
animation?: Record<string, string> | false;
|
|
4951
|
+
transitionBehavior?: Record<string, string> | false;
|
|
4952
|
+
transitionProperty?: Record<string, string> | false;
|
|
4953
|
+
fontSmoothing?: Record<string, string> | false;
|
|
4954
|
+
fontStretch?: Record<string, string> | false;
|
|
4955
|
+
fontVariantNumeric?: Record<string, string> | false;
|
|
4956
|
+
hyphens?: Record<string, string> | false;
|
|
4957
|
+
listStylePosition?: Record<string, string> | false;
|
|
4958
|
+
listStyleType?: Record<string, string> | false;
|
|
4959
|
+
overflowWrap?: Record<string, string> | false;
|
|
4960
|
+
textAlign?: Record<string, string> | false;
|
|
4961
|
+
textDecorationLine?: Record<string, string> | false;
|
|
4962
|
+
textDecorationStyle?: Record<string, string> | false;
|
|
4963
|
+
textOverflow?: Record<string, string> | false;
|
|
4964
|
+
textTransform?: Record<string, string> | false;
|
|
4965
|
+
textWrap?: Record<string, string> | false;
|
|
4966
|
+
verticalAlign?: Record<string, string> | false;
|
|
4967
|
+
whitespace?: Record<string, string> | false;
|
|
4968
|
+
wordBreak?: Record<string, string> | false;
|
|
4969
|
+
}
|
|
4970
|
+
|
|
4971
|
+
/**
|
|
4972
|
+
* Default vertical-align utility values matching Tailwind CSS.
|
|
4973
|
+
*/
|
|
4974
|
+
export declare const verticalAlignValues: {
|
|
4975
|
+
baseline: string;
|
|
4976
|
+
top: string;
|
|
4977
|
+
middle: string;
|
|
4978
|
+
bottom: string;
|
|
4979
|
+
"text-top": string;
|
|
4980
|
+
"text-bottom": string;
|
|
4981
|
+
sub: string;
|
|
4982
|
+
super: string;
|
|
4983
|
+
};
|
|
4984
|
+
|
|
4985
|
+
/**
|
|
4986
|
+
* Default visibility utility values matching Tailwind CSS.
|
|
4987
|
+
*/
|
|
4988
|
+
export declare const visibilityValues: {
|
|
4989
|
+
visible: string;
|
|
4990
|
+
invisible: string;
|
|
4991
|
+
collapse: string;
|
|
4992
|
+
};
|
|
4993
|
+
|
|
4994
|
+
/**
|
|
4995
|
+
* Default whitespace utility values matching Tailwind CSS.
|
|
4996
|
+
*/
|
|
4997
|
+
export declare const whitespaceValues: {
|
|
4998
|
+
normal: string;
|
|
4999
|
+
nowrap: string;
|
|
5000
|
+
pre: string;
|
|
5001
|
+
"pre-line": string;
|
|
5002
|
+
"pre-wrap": string;
|
|
5003
|
+
"break-spaces": string;
|
|
5004
|
+
};
|
|
5005
|
+
|
|
5006
|
+
/**
|
|
5007
|
+
* Default will-change utility values matching Tailwind CSS.
|
|
5008
|
+
*/
|
|
5009
|
+
export declare const willChangeValues: {
|
|
5010
|
+
auto: string;
|
|
5011
|
+
scroll: string;
|
|
5012
|
+
contents: string;
|
|
5013
|
+
transform: string;
|
|
5014
|
+
};
|
|
5015
|
+
|
|
5016
|
+
/**
|
|
5017
|
+
* Default word-break utility values matching Tailwind CSS.
|
|
5018
|
+
*/
|
|
5019
|
+
export declare const wordBreakValues: {
|
|
5020
|
+
normal: string;
|
|
5021
|
+
words: string;
|
|
5022
|
+
all: string;
|
|
5023
|
+
keep: string;
|
|
5024
|
+
};
|
|
5025
|
+
|
|
4556
5026
|
export { }
|