@vaneui/ui 0.1.2 → 0.1.3

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.
Files changed (77) hide show
  1. package/README.md +13 -1
  2. package/dist/components/complex/index.d.ts +1 -0
  3. package/dist/components/complex/index.js +132 -0
  4. package/dist/components/complex/index.js.map +1 -0
  5. package/dist/components/complex/sharer.d.ts +39 -0
  6. package/dist/components/themeContext.d.ts +50 -0
  7. package/dist/components/themedComponent.d.ts +7 -0
  8. package/dist/components/ui/badge.d.ts +3 -0
  9. package/dist/components/ui/button.d.ts +3 -0
  10. package/dist/components/ui/card.d.ts +3 -0
  11. package/dist/components/ui/chip.d.ts +3 -0
  12. package/dist/components/ui/classes/appearanceClasses.d.ts +13 -0
  13. package/dist/components/ui/classes/spacingClasses.d.ts +2 -0
  14. package/dist/components/ui/classes/typographyClasses.d.ts +4 -0
  15. package/dist/components/ui/col.d.ts +3 -0
  16. package/dist/components/ui/container.d.ts +3 -0
  17. package/dist/components/ui/divider.d.ts +3 -0
  18. package/dist/components/ui/grid.d.ts +4 -0
  19. package/dist/components/ui/layout.d.ts +7 -0
  20. package/dist/components/ui/props/index.d.ts +1 -0
  21. package/dist/components/ui/props/keys.d.ts +81 -0
  22. package/dist/components/ui/props/props.d.ts +43 -0
  23. package/dist/components/ui/row.d.ts +3 -0
  24. package/dist/components/ui/section.d.ts +3 -0
  25. package/dist/components/ui/stack.d.ts +3 -0
  26. package/dist/components/ui/theme/appearance/layoutAppearanceTheme.d.ts +10 -0
  27. package/dist/components/ui/theme/appearance/textAppearanceTheme.d.ts +10 -0
  28. package/dist/components/ui/theme/appearance/variantTheme.d.ts +15 -0
  29. package/dist/components/ui/theme/badgeTheme.d.ts +32 -0
  30. package/dist/components/ui/theme/buttonTheme.d.ts +32 -0
  31. package/dist/components/ui/theme/cardTheme.d.ts +37 -0
  32. package/dist/components/ui/theme/chipTheme.d.ts +32 -0
  33. package/dist/components/ui/theme/colTheme.d.ts +15 -0
  34. package/dist/components/ui/theme/common/ComponentTheme.d.ts +52 -0
  35. package/dist/components/ui/theme/common/baseTheme.d.ts +12 -0
  36. package/dist/components/ui/theme/containerTheme.d.ts +31 -0
  37. package/dist/components/ui/theme/dividerTheme.d.ts +9 -0
  38. package/dist/components/ui/theme/gridTheme.d.ts +10 -0
  39. package/dist/components/ui/theme/layout/borderTheme.d.ts +9 -0
  40. package/dist/components/ui/theme/layout/directionTheme.d.ts +9 -0
  41. package/dist/components/ui/theme/layout/displayTheme.d.ts +9 -0
  42. package/dist/components/ui/theme/layout/hideTheme.d.ts +9 -0
  43. package/dist/components/ui/theme/layout/itemsTheme.d.ts +9 -0
  44. package/dist/components/ui/theme/layout/justifyTheme.d.ts +9 -0
  45. package/dist/components/ui/theme/layout/positionTheme.d.ts +9 -0
  46. package/dist/components/ui/theme/layout/radiusTheme.d.ts +9 -0
  47. package/dist/components/ui/theme/layout/ringTheme.d.ts +9 -0
  48. package/dist/components/ui/theme/layout/shadowTheme.d.ts +9 -0
  49. package/dist/components/ui/theme/layout/wrapTheme.d.ts +9 -0
  50. package/dist/components/ui/theme/rowTheme.d.ts +15 -0
  51. package/dist/components/ui/theme/sectionTheme.d.ts +34 -0
  52. package/dist/components/ui/theme/size/breakpointTheme.d.ts +9 -0
  53. package/dist/components/ui/theme/size/gapTheme.d.ts +9 -0
  54. package/dist/components/ui/theme/size/pxTheme.d.ts +9 -0
  55. package/dist/components/ui/theme/size/pyTheme.d.ts +9 -0
  56. package/dist/components/ui/theme/size/sizeTheme.d.ts +9 -0
  57. package/dist/components/ui/theme/stackTheme.d.ts +19 -0
  58. package/dist/components/ui/theme/typography/fontFamilyTheme.d.ts +9 -0
  59. package/dist/components/ui/theme/typography/fontStyleTheme.d.ts +9 -0
  60. package/dist/components/ui/theme/typography/fontWeightTheme.d.ts +9 -0
  61. package/dist/components/ui/theme/typography/textAlignTheme.d.ts +9 -0
  62. package/dist/components/ui/theme/typography/textDecorationTheme.d.ts +9 -0
  63. package/dist/components/ui/theme/typography/textTransformTheme.d.ts +9 -0
  64. package/dist/components/ui/theme/typographyComponentTheme.d.ts +22 -0
  65. package/dist/components/ui/typography.d.ts +9 -0
  66. package/dist/components/utils/componentUtils.d.ts +4 -0
  67. package/dist/components/utils/deepMerge.d.ts +4 -0
  68. package/dist/components/utils/deepPartial.d.ts +3 -0
  69. package/dist/components/utils/tests/deepMerge.test.d.ts +1 -0
  70. package/dist/index.d.ts +8 -0
  71. package/dist/index.esm.js +4717 -0
  72. package/dist/index.esm.js.map +1 -0
  73. package/dist/index.js +4785 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/ui.css +2049 -0
  76. package/dist/vars.css +132 -0
  77. package/package.json +19 -5
package/dist/index.js ADDED
@@ -0,0 +1,4785 @@
1
+ 'use client';
2
+
3
+ 'use strict';
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var react = require('react');
7
+
8
+ /**
9
+ * Base Theme class that all theme types will extend
10
+ */
11
+ class BaseTheme {
12
+ }
13
+
14
+ const MODE_KEYS = ['base', 'hover', 'active'];
15
+ const SIZE_KEYS = ['xs', 'sm', 'md', 'lg', 'xl'];
16
+ const VARIANT_KEYS = ['filled', 'outline'];
17
+ const APPEARANCE_KEYS = ['default', 'accent', 'primary', 'secondary', 'tertiary', 'success', 'danger', 'warning', 'info', 'transparent'];
18
+ const TEXT_APPEARANCE_KEYS = [...APPEARANCE_KEYS, 'muted', 'link'];
19
+ const FONT_FAMILY_KEYS = ['sans', 'serif', 'mono'];
20
+ const FONT_WEIGHT_KEYS = ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'];
21
+ const FONT_STYLE_KEYS = ['italic', 'notItalic'];
22
+ const TEXT_DECORATION_KEYS = ['underline', 'lineThrough', 'noUnderline', 'overline'];
23
+ const TEXT_TRANSFORM_KEYS = ['uppercase', 'lowercase', 'capitalize', 'normalCase'];
24
+ const TEXT_ALIGN_KEYS = ['textLeft', 'textCenter', 'textRight', 'textJustify'];
25
+ const BORDER_KEYS = ['border', 'noBorder'];
26
+ const SHADOW_KEYS = ['shadow', 'noShadow'];
27
+ const RING_KEYS = ['ring', 'noRing'];
28
+ const PADDING_KEYS = ['padding', 'noPadding'];
29
+ const BREAKPOINT_KEYS = ['xsCol', 'smCol', 'mdCol', 'lgCol', 'xlCol'];
30
+ const HIDE_KEYS = ['xsHide', 'smHide', 'mdHide', 'lgHide', 'xlHide'];
31
+ const POSITION_KEYS = ['relative', 'absolute', 'fixed', 'sticky', 'static'];
32
+ const DIRECTION_REVERSE_KEYS = ['reverse'];
33
+ const GAP_KEYS = ['gap', 'noGap'];
34
+ const PILL_KEYS = ['pill'];
35
+ const SHARP_KEYS = ['sharp'];
36
+ const ROUNDED_KEYS = ['rounded'];
37
+ const SHAPE_KEYS = [...PILL_KEYS, ...SHARP_KEYS, ...ROUNDED_KEYS];
38
+ const FLEX_DIRECTION_KEYS = ['row', 'column', 'rowReverse', 'columnReverse'];
39
+ const ITEMS_KEYS = ['itemsStart', 'itemsEnd', 'itemsCenter', 'itemsBaseline', 'itemsStretch'];
40
+ const JUSTIFY_KEYS = ['justifyStart', 'justifyEnd', 'justifyCenter', 'justifyBetween', 'justifyAround', 'justifyEvenly', 'justifyStretch', 'justifyBaseline'];
41
+ const WRAP_KEYS = ['flexWrap', 'flexNoWrap', 'flexWrapReverse'];
42
+ const DISPLAY_KEYS = ['inline', 'block', 'inlineBlock', 'flex', 'inlineFlex', 'grid', 'inlineGrid', 'contents', 'table', 'tableCell', 'hidden'];
43
+ // A master list of all groups where only one key can be 'true' at a time.
44
+ const EXCLUSIVE_KEY_GROUPS = [
45
+ MODE_KEYS,
46
+ SIZE_KEYS,
47
+ TEXT_APPEARANCE_KEYS,
48
+ VARIANT_KEYS,
49
+ FONT_FAMILY_KEYS,
50
+ FONT_WEIGHT_KEYS,
51
+ FONT_STYLE_KEYS,
52
+ TEXT_DECORATION_KEYS,
53
+ TEXT_TRANSFORM_KEYS,
54
+ TEXT_ALIGN_KEYS,
55
+ BORDER_KEYS,
56
+ SHADOW_KEYS,
57
+ RING_KEYS,
58
+ PADDING_KEYS,
59
+ BREAKPOINT_KEYS,
60
+ HIDE_KEYS,
61
+ POSITION_KEYS,
62
+ DIRECTION_REVERSE_KEYS,
63
+ GAP_KEYS,
64
+ SHAPE_KEYS,
65
+ FLEX_DIRECTION_KEYS,
66
+ ITEMS_KEYS,
67
+ JUSTIFY_KEYS,
68
+ WRAP_KEYS,
69
+ DISPLAY_KEYS,
70
+ ];
71
+ // Base component keys
72
+ const BASE_COMPONENT_KEYS = [
73
+ ...SIZE_KEYS,
74
+ ...HIDE_KEYS,
75
+ ...ITEMS_KEYS,
76
+ ...JUSTIFY_KEYS,
77
+ ...POSITION_KEYS,
78
+ ...DISPLAY_KEYS
79
+ ];
80
+ // Font keys
81
+ const FONT_KEYS = [
82
+ ...FONT_WEIGHT_KEYS,
83
+ ...FONT_STYLE_KEYS,
84
+ ...TEXT_DECORATION_KEYS,
85
+ ...TEXT_TRANSFORM_KEYS,
86
+ ...FONT_FAMILY_KEYS,
87
+ ...TEXT_APPEARANCE_KEYS,
88
+ ...TEXT_ALIGN_KEYS
89
+ ];
90
+ // Typography component keys
91
+ const TYPOGRAPHY_COMPONENT_KEYS = [
92
+ ...BASE_COMPONENT_KEYS,
93
+ ...FONT_KEYS
94
+ ];
95
+ // Button keys
96
+ const BUTTON_KEYS = [
97
+ ...TYPOGRAPHY_COMPONENT_KEYS,
98
+ ...SHAPE_KEYS,
99
+ ...BORDER_KEYS,
100
+ ...SHADOW_KEYS,
101
+ ...RING_KEYS,
102
+ ...GAP_KEYS,
103
+ ...PADDING_KEYS,
104
+ ...VARIANT_KEYS,
105
+ ...APPEARANCE_KEYS
106
+ ];
107
+ // Grid keys
108
+ const GRID_KEYS = [
109
+ ...BASE_COMPONENT_KEYS,
110
+ ...GAP_KEYS,
111
+ ...APPEARANCE_KEYS
112
+ ];
113
+ // Row keys
114
+ const ROW_KEYS = [
115
+ ...BASE_COMPONENT_KEYS,
116
+ ...WRAP_KEYS,
117
+ ...GAP_KEYS,
118
+ ...DIRECTION_REVERSE_KEYS,
119
+ ...BREAKPOINT_KEYS,
120
+ ...APPEARANCE_KEYS
121
+ ];
122
+ // Col keys
123
+ const COL_KEYS = [
124
+ ...BASE_COMPONENT_KEYS,
125
+ ...WRAP_KEYS,
126
+ ...GAP_KEYS,
127
+ ...DIRECTION_REVERSE_KEYS,
128
+ ...APPEARANCE_KEYS
129
+ ];
130
+ // Card keys
131
+ const CARD_KEYS = [
132
+ ...TYPOGRAPHY_COMPONENT_KEYS,
133
+ ...GAP_KEYS,
134
+ ...SHARP_KEYS,
135
+ ...ROUNDED_KEYS,
136
+ ...BREAKPOINT_KEYS,
137
+ ...APPEARANCE_KEYS,
138
+ ...BORDER_KEYS,
139
+ ...RING_KEYS,
140
+ ...SHADOW_KEYS,
141
+ ...PADDING_KEYS,
142
+ ...FLEX_DIRECTION_KEYS,
143
+ ...DIRECTION_REVERSE_KEYS,
144
+ ...WRAP_KEYS
145
+ ];
146
+ // Stack keys
147
+ const STACK_KEYS = [
148
+ ...BASE_COMPONENT_KEYS,
149
+ ...WRAP_KEYS,
150
+ ...GAP_KEYS,
151
+ ...DIRECTION_REVERSE_KEYS,
152
+ ...BREAKPOINT_KEYS,
153
+ ...APPEARANCE_KEYS,
154
+ ...FLEX_DIRECTION_KEYS,
155
+ ...PADDING_KEYS
156
+ ];
157
+ // Badge keys
158
+ const BADGE_KEYS = [
159
+ ...TYPOGRAPHY_COMPONENT_KEYS,
160
+ ...SHAPE_KEYS,
161
+ ...VARIANT_KEYS,
162
+ ...SHADOW_KEYS,
163
+ ...BORDER_KEYS,
164
+ ...RING_KEYS,
165
+ ...GAP_KEYS,
166
+ ...PADDING_KEYS,
167
+ ...APPEARANCE_KEYS
168
+ ];
169
+ // Chip keys
170
+ const CHIP_KEYS = [
171
+ ...TYPOGRAPHY_COMPONENT_KEYS,
172
+ ...SHAPE_KEYS,
173
+ ...VARIANT_KEYS,
174
+ ...SHADOW_KEYS,
175
+ ...BORDER_KEYS,
176
+ ...RING_KEYS,
177
+ ...GAP_KEYS,
178
+ ...PADDING_KEYS,
179
+ ...APPEARANCE_KEYS
180
+ ];
181
+ // Divider keys
182
+ const DIVIDER_KEYS = [
183
+ ...BASE_COMPONENT_KEYS,
184
+ ...APPEARANCE_KEYS
185
+ ];
186
+ // Container keys
187
+ const CONTAINER_KEYS = [
188
+ ...BASE_COMPONENT_KEYS,
189
+ ...APPEARANCE_KEYS,
190
+ ...BORDER_KEYS,
191
+ ...SHADOW_KEYS,
192
+ ...RING_KEYS,
193
+ ...GAP_KEYS,
194
+ ...SHAPE_KEYS
195
+ ];
196
+ // Section keys
197
+ const SECTION_KEYS = [
198
+ ...BASE_COMPONENT_KEYS,
199
+ ...FLEX_DIRECTION_KEYS,
200
+ ...APPEARANCE_KEYS,
201
+ ...PADDING_KEYS,
202
+ ...DIRECTION_REVERSE_KEYS,
203
+ ...WRAP_KEYS,
204
+ ...BREAKPOINT_KEYS,
205
+ ...GAP_KEYS,
206
+ ...BORDER_KEYS,
207
+ ...SHADOW_KEYS,
208
+ ...RING_KEYS,
209
+ ...SHAPE_KEYS,
210
+ ];
211
+
212
+ /**
213
+ * Pick the first truthy key from props, then from defaults, then undefined.
214
+ */
215
+ function pickFirstTruthyKey(props, defaults, keys) {
216
+ let falsyKeys = [];
217
+ for (const k of keys) {
218
+ const p = props[k];
219
+ if (p === true)
220
+ return k;
221
+ if (p === false)
222
+ falsyKeys.push(k);
223
+ }
224
+ for (const k of keys) {
225
+ const d = defaults[k];
226
+ if (d === true && !falsyKeys.includes(k))
227
+ return k;
228
+ }
229
+ return undefined;
230
+ }
231
+
232
+ class HideTheme extends BaseTheme {
233
+ constructor(initialConfig) {
234
+ super();
235
+ HIDE_KEYS.forEach((key) => {
236
+ var _a;
237
+ this[key] = (_a = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig[key]) !== null && _a !== void 0 ? _a : HideTheme.defaultClasses[key];
238
+ });
239
+ }
240
+ getClasses(props, defaults) {
241
+ const key = pickFirstTruthyKey(props, defaults, HIDE_KEYS);
242
+ return [key ? this[key] : ''];
243
+ }
244
+ }
245
+ HideTheme.defaultClasses = {
246
+ xsHide: "max-xs:hidden",
247
+ smHide: "max-sm:hidden",
248
+ mdHide: "max-md:hidden",
249
+ lgHide: "max-lg:hidden",
250
+ xlHide: "max-xl:hidden"
251
+ };
252
+
253
+ class ItemsTheme extends BaseTheme {
254
+ constructor(initialConfig) {
255
+ super();
256
+ ITEMS_KEYS.forEach((key) => {
257
+ var _a;
258
+ this[key] = (_a = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig[key]) !== null && _a !== void 0 ? _a : ItemsTheme.defaultClasses[key];
259
+ });
260
+ }
261
+ getClasses(props, defaults) {
262
+ const pickedKey = pickFirstTruthyKey(props, defaults, ITEMS_KEYS);
263
+ return [pickedKey && this[pickedKey] ? this[pickedKey] : ''];
264
+ }
265
+ }
266
+ ItemsTheme.defaultClasses = {
267
+ itemsStart: "items-start",
268
+ itemsEnd: "items-end",
269
+ itemsCenter: "items-center",
270
+ itemsBaseline: "items-baseline",
271
+ itemsStretch: "items-stretch",
272
+ };
273
+
274
+ class JustifyTheme extends BaseTheme {
275
+ constructor(initialConfig) {
276
+ super();
277
+ JUSTIFY_KEYS.forEach((key) => {
278
+ var _a;
279
+ this[key] = (_a = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig[key]) !== null && _a !== void 0 ? _a : JustifyTheme.defaultClasses[key];
280
+ });
281
+ }
282
+ getClasses(props, defaults) {
283
+ const key = pickFirstTruthyKey(props, defaults, JUSTIFY_KEYS);
284
+ return [key ? this[key] : ''];
285
+ }
286
+ }
287
+ JustifyTheme.defaultClasses = {
288
+ justifyStart: "justify-start",
289
+ justifyEnd: "justify-end",
290
+ justifyCenter: "justify-center",
291
+ justifyBetween: "justify-between",
292
+ justifyAround: "justify-around",
293
+ justifyEvenly: "justify-evenly",
294
+ justifyStretch: "justify-stretch",
295
+ justifyBaseline: "justify-baseline",
296
+ };
297
+
298
+ class PositionTheme extends BaseTheme {
299
+ constructor(initialConfig) {
300
+ super();
301
+ POSITION_KEYS.forEach((key) => {
302
+ var _a;
303
+ this[key] = (_a = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig[key]) !== null && _a !== void 0 ? _a : PositionTheme.defaultClasses[key];
304
+ });
305
+ }
306
+ getClasses(props, defaults) {
307
+ const key = pickFirstTruthyKey(props, defaults, POSITION_KEYS);
308
+ return [key ? this[key] : ''];
309
+ }
310
+ }
311
+ PositionTheme.defaultClasses = {
312
+ relative: "relative",
313
+ absolute: "absolute",
314
+ fixed: "fixed",
315
+ sticky: "sticky",
316
+ static: "static"
317
+ };
318
+
319
+ class FontStyleTheme extends BaseTheme {
320
+ constructor(initial) {
321
+ super();
322
+ FONT_STYLE_KEYS.forEach((key) => {
323
+ var _a;
324
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : FontStyleTheme.defaultClasses[key];
325
+ });
326
+ }
327
+ getClasses(props, defaults) {
328
+ const key = pickFirstTruthyKey(props, defaults, FONT_STYLE_KEYS);
329
+ return [key ? this[key] : '']; // No default for font style
330
+ }
331
+ }
332
+ FontStyleTheme.defaultClasses = {
333
+ italic: "italic",
334
+ notItalic: "not-italic",
335
+ };
336
+
337
+ class FontFamilyTheme extends BaseTheme {
338
+ constructor(initial) {
339
+ super();
340
+ FONT_FAMILY_KEYS.forEach((key) => {
341
+ var _a;
342
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : FontFamilyTheme.defaultClasses[key];
343
+ });
344
+ }
345
+ getClasses(props, defaults) {
346
+ const key = pickFirstTruthyKey(props, defaults, FONT_FAMILY_KEYS);
347
+ return [this[key !== null && key !== void 0 ? key : 'sans'] || ''];
348
+ }
349
+ }
350
+ FontFamilyTheme.defaultClasses = {
351
+ sans: "font-sans",
352
+ serif: "font-serif",
353
+ mono: "font-mono",
354
+ };
355
+
356
+ class FontWeightTheme extends BaseTheme {
357
+ constructor(initial) {
358
+ super();
359
+ FONT_WEIGHT_KEYS.forEach((key) => {
360
+ var _a;
361
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : FontWeightTheme.defaultClasses[key];
362
+ });
363
+ }
364
+ getClasses(props, defaults) {
365
+ const key = pickFirstTruthyKey(props, defaults, FONT_WEIGHT_KEYS);
366
+ return [this[key !== null && key !== void 0 ? key : 'normal'] || '']; // Default to 'normal' if no key is provided
367
+ }
368
+ }
369
+ FontWeightTheme.defaultClasses = {
370
+ thin: "font-thin",
371
+ extralight: "font-extralight",
372
+ light: "font-light",
373
+ normal: "font-normal",
374
+ medium: "font-medium",
375
+ semibold: "font-semibold",
376
+ bold: "font-bold",
377
+ extrabold: "font-extrabold",
378
+ black: "font-black",
379
+ };
380
+
381
+ class TextDecorationTheme extends BaseTheme {
382
+ constructor(initial) {
383
+ super();
384
+ TEXT_DECORATION_KEYS.forEach((key) => {
385
+ var _a;
386
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : TextDecorationTheme.defaultClasses[key];
387
+ });
388
+ }
389
+ getClasses(props, defaults) {
390
+ const key = pickFirstTruthyKey(props, defaults, TEXT_DECORATION_KEYS);
391
+ return [key ? this[key] : '']; // No default for text decoration
392
+ }
393
+ }
394
+ TextDecorationTheme.defaultClasses = {
395
+ underline: "underline",
396
+ lineThrough: "line-through",
397
+ noUnderline: "no-underline",
398
+ overline: "overline",
399
+ };
400
+
401
+ class TextTransformTheme extends BaseTheme {
402
+ constructor(initial) {
403
+ super();
404
+ TEXT_TRANSFORM_KEYS.forEach((key) => {
405
+ var _a;
406
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : TextTransformTheme.defaultClasses[key];
407
+ });
408
+ }
409
+ getClasses(props, defaults) {
410
+ const key = pickFirstTruthyKey(props, defaults, TEXT_TRANSFORM_KEYS);
411
+ return [key ? this[key] : '']; // No default for text transform
412
+ }
413
+ }
414
+ TextTransformTheme.defaultClasses = {
415
+ uppercase: "uppercase",
416
+ lowercase: "lowercase",
417
+ capitalize: "capitalize",
418
+ normalCase: "normal-case",
419
+ };
420
+
421
+ class TextAlignTheme extends BaseTheme {
422
+ constructor(initial) {
423
+ super();
424
+ TEXT_ALIGN_KEYS.forEach((key) => {
425
+ var _a;
426
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : TextAlignTheme.defaultClasses[key];
427
+ });
428
+ }
429
+ getClasses(props, defaults) {
430
+ const key = pickFirstTruthyKey(props, defaults, TEXT_ALIGN_KEYS);
431
+ return [key ? this[key] : '']; // No default for text align
432
+ }
433
+ }
434
+ TextAlignTheme.defaultClasses = {
435
+ textLeft: "text-left",
436
+ textCenter: "text-center",
437
+ textRight: "text-right",
438
+ textJustify: "text-justify",
439
+ };
440
+
441
+ const isObject = (item) => {
442
+ return item !== null && typeof item === 'object' && !Array.isArray(item);
443
+ };
444
+ const deepMerge = (target, source) => {
445
+ const output = Object.assign(Object.create(Object.getPrototypeOf(target)), target);
446
+ for (const key in source) {
447
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
448
+ const sourceValue = source[key];
449
+ const targetValue = output[key];
450
+ if (sourceValue === undefined) {
451
+ continue;
452
+ }
453
+ // Special case: If the key is 'defaults', use the contextual mergeDefaults function.
454
+ if (key === 'defaults' &&
455
+ isObject(targetValue) &&
456
+ isObject(sourceValue)) {
457
+ output[key] = mergeDefaults(targetValue, sourceValue);
458
+ }
459
+ // For all other objects, use the standard recursive deep merge.
460
+ else if (isObject(targetValue) && isObject(sourceValue)) {
461
+ output[key] = deepMerge(targetValue, sourceValue);
462
+ }
463
+ // For non-object values, just assign the value from the source.
464
+ else {
465
+ output[key] = sourceValue;
466
+ }
467
+ }
468
+ }
469
+ return output;
470
+ };
471
+ const deepClone = (source) => {
472
+ if (!isObject(source)) {
473
+ return source;
474
+ }
475
+ const output = Object.assign(Object.create(Object.getPrototypeOf(source)), source);
476
+ for (const key in output) {
477
+ if (Object.prototype.hasOwnProperty.call(output, key)) {
478
+ output[key] = deepClone(output[key]);
479
+ }
480
+ }
481
+ return output;
482
+ };
483
+ const findGroup = (key) => EXCLUSIVE_KEY_GROUPS.find(group => group.includes(key));
484
+ const mergeDefaults = (baseDefaults, overrideDefaults) => {
485
+ const finalDefaults = { ...baseDefaults };
486
+ // Iterate over the override keys to apply them.
487
+ for (const key in overrideDefaults) {
488
+ if (Object.prototype.hasOwnProperty.call(overrideDefaults, key)) {
489
+ const overrideValue = overrideDefaults[key];
490
+ // If the override is setting a key to true...
491
+ if (overrideValue) {
492
+ // Find the exclusive group this key belongs to (e.g., SIZE_KEYS).
493
+ const group = findGroup(key);
494
+ // If the key is part of an exclusive group...
495
+ if (group) {
496
+ // ...set all other keys in that group to false.
497
+ group.forEach(groupKey => {
498
+ if (groupKey !== key) {
499
+ finalDefaults[groupKey] = false;
500
+ }
501
+ });
502
+ }
503
+ }
504
+ finalDefaults[key] = overrideValue;
505
+ }
506
+ }
507
+ return finalDefaults;
508
+ };
509
+
510
+ class DisplayTheme extends BaseTheme {
511
+ constructor(initialConfig) {
512
+ super();
513
+ DISPLAY_KEYS.forEach((key) => {
514
+ var _a;
515
+ this[key] = (_a = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig[key]) !== null && _a !== void 0 ? _a : DisplayTheme.defaultClasses[key];
516
+ });
517
+ }
518
+ getClasses(props, defaults) {
519
+ const pickedKey = pickFirstTruthyKey(props, defaults, DISPLAY_KEYS);
520
+ return [pickedKey && this[pickedKey] ? this[pickedKey] : ''];
521
+ }
522
+ }
523
+ DisplayTheme.defaultClasses = {
524
+ inline: "inline",
525
+ block: "block",
526
+ inlineBlock: "inline-block",
527
+ flex: "flex",
528
+ inlineFlex: "inline-flex",
529
+ grid: "grid",
530
+ inlineGrid: "inline-grid",
531
+ contents: "contents",
532
+ table: "table",
533
+ tableCell: "table-cell",
534
+ hidden: "hidden"
535
+ };
536
+
537
+ const CLASS_PART_SEPARATOR = '-';
538
+ const createClassGroupUtils = config => {
539
+ const classMap = createClassMap(config);
540
+ const {
541
+ conflictingClassGroups,
542
+ conflictingClassGroupModifiers
543
+ } = config;
544
+ const getClassGroupId = className => {
545
+ const classParts = className.split(CLASS_PART_SEPARATOR);
546
+ // Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and remove it from classParts.
547
+ if (classParts[0] === '' && classParts.length !== 1) {
548
+ classParts.shift();
549
+ }
550
+ return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
551
+ };
552
+ const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
553
+ const conflicts = conflictingClassGroups[classGroupId] || [];
554
+ if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
555
+ return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
556
+ }
557
+ return conflicts;
558
+ };
559
+ return {
560
+ getClassGroupId,
561
+ getConflictingClassGroupIds
562
+ };
563
+ };
564
+ const getGroupRecursive = (classParts, classPartObject) => {
565
+ if (classParts.length === 0) {
566
+ return classPartObject.classGroupId;
567
+ }
568
+ const currentClassPart = classParts[0];
569
+ const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
570
+ const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined;
571
+ if (classGroupFromNextClassPart) {
572
+ return classGroupFromNextClassPart;
573
+ }
574
+ if (classPartObject.validators.length === 0) {
575
+ return undefined;
576
+ }
577
+ const classRest = classParts.join(CLASS_PART_SEPARATOR);
578
+ return classPartObject.validators.find(({
579
+ validator
580
+ }) => validator(classRest))?.classGroupId;
581
+ };
582
+ const arbitraryPropertyRegex = /^\[(.+)\]$/;
583
+ const getGroupIdForArbitraryProperty = className => {
584
+ if (arbitraryPropertyRegex.test(className)) {
585
+ const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
586
+ const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':'));
587
+ if (property) {
588
+ // I use two dots here because one dot is used as prefix for class groups in plugins
589
+ return 'arbitrary..' + property;
590
+ }
591
+ }
592
+ };
593
+ /**
594
+ * Exported for testing only
595
+ */
596
+ const createClassMap = config => {
597
+ const {
598
+ theme,
599
+ classGroups
600
+ } = config;
601
+ const classMap = {
602
+ nextPart: new Map(),
603
+ validators: []
604
+ };
605
+ for (const classGroupId in classGroups) {
606
+ processClassesRecursively(classGroups[classGroupId], classMap, classGroupId, theme);
607
+ }
608
+ return classMap;
609
+ };
610
+ const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
611
+ classGroup.forEach(classDefinition => {
612
+ if (typeof classDefinition === 'string') {
613
+ const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);
614
+ classPartObjectToEdit.classGroupId = classGroupId;
615
+ return;
616
+ }
617
+ if (typeof classDefinition === 'function') {
618
+ if (isThemeGetter(classDefinition)) {
619
+ processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
620
+ return;
621
+ }
622
+ classPartObject.validators.push({
623
+ validator: classDefinition,
624
+ classGroupId
625
+ });
626
+ return;
627
+ }
628
+ Object.entries(classDefinition).forEach(([key, classGroup]) => {
629
+ processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);
630
+ });
631
+ });
632
+ };
633
+ const getPart = (classPartObject, path) => {
634
+ let currentClassPartObject = classPartObject;
635
+ path.split(CLASS_PART_SEPARATOR).forEach(pathPart => {
636
+ if (!currentClassPartObject.nextPart.has(pathPart)) {
637
+ currentClassPartObject.nextPart.set(pathPart, {
638
+ nextPart: new Map(),
639
+ validators: []
640
+ });
641
+ }
642
+ currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
643
+ });
644
+ return currentClassPartObject;
645
+ };
646
+ const isThemeGetter = func => func.isThemeGetter;
647
+
648
+ // LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance
649
+ const createLruCache = maxCacheSize => {
650
+ if (maxCacheSize < 1) {
651
+ return {
652
+ get: () => undefined,
653
+ set: () => {}
654
+ };
655
+ }
656
+ let cacheSize = 0;
657
+ let cache = new Map();
658
+ let previousCache = new Map();
659
+ const update = (key, value) => {
660
+ cache.set(key, value);
661
+ cacheSize++;
662
+ if (cacheSize > maxCacheSize) {
663
+ cacheSize = 0;
664
+ previousCache = cache;
665
+ cache = new Map();
666
+ }
667
+ };
668
+ return {
669
+ get(key) {
670
+ let value = cache.get(key);
671
+ if (value !== undefined) {
672
+ return value;
673
+ }
674
+ if ((value = previousCache.get(key)) !== undefined) {
675
+ update(key, value);
676
+ return value;
677
+ }
678
+ },
679
+ set(key, value) {
680
+ if (cache.has(key)) {
681
+ cache.set(key, value);
682
+ } else {
683
+ update(key, value);
684
+ }
685
+ }
686
+ };
687
+ };
688
+ const IMPORTANT_MODIFIER = '!';
689
+ const MODIFIER_SEPARATOR = ':';
690
+ const MODIFIER_SEPARATOR_LENGTH = MODIFIER_SEPARATOR.length;
691
+ const createParseClassName = config => {
692
+ const {
693
+ prefix,
694
+ experimentalParseClassName
695
+ } = config;
696
+ /**
697
+ * Parse class name into parts.
698
+ *
699
+ * Inspired by `splitAtTopLevelOnly` used in Tailwind CSS
700
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
701
+ */
702
+ let parseClassName = className => {
703
+ const modifiers = [];
704
+ let bracketDepth = 0;
705
+ let parenDepth = 0;
706
+ let modifierStart = 0;
707
+ let postfixModifierPosition;
708
+ for (let index = 0; index < className.length; index++) {
709
+ let currentCharacter = className[index];
710
+ if (bracketDepth === 0 && parenDepth === 0) {
711
+ if (currentCharacter === MODIFIER_SEPARATOR) {
712
+ modifiers.push(className.slice(modifierStart, index));
713
+ modifierStart = index + MODIFIER_SEPARATOR_LENGTH;
714
+ continue;
715
+ }
716
+ if (currentCharacter === '/') {
717
+ postfixModifierPosition = index;
718
+ continue;
719
+ }
720
+ }
721
+ if (currentCharacter === '[') {
722
+ bracketDepth++;
723
+ } else if (currentCharacter === ']') {
724
+ bracketDepth--;
725
+ } else if (currentCharacter === '(') {
726
+ parenDepth++;
727
+ } else if (currentCharacter === ')') {
728
+ parenDepth--;
729
+ }
730
+ }
731
+ const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
732
+ const baseClassName = stripImportantModifier(baseClassNameWithImportantModifier);
733
+ const hasImportantModifier = baseClassName !== baseClassNameWithImportantModifier;
734
+ const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;
735
+ return {
736
+ modifiers,
737
+ hasImportantModifier,
738
+ baseClassName,
739
+ maybePostfixModifierPosition
740
+ };
741
+ };
742
+ if (prefix) {
743
+ const fullPrefix = prefix + MODIFIER_SEPARATOR;
744
+ const parseClassNameOriginal = parseClassName;
745
+ parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.substring(fullPrefix.length)) : {
746
+ isExternal: true,
747
+ modifiers: [],
748
+ hasImportantModifier: false,
749
+ baseClassName: className,
750
+ maybePostfixModifierPosition: undefined
751
+ };
752
+ }
753
+ if (experimentalParseClassName) {
754
+ const parseClassNameOriginal = parseClassName;
755
+ parseClassName = className => experimentalParseClassName({
756
+ className,
757
+ parseClassName: parseClassNameOriginal
758
+ });
759
+ }
760
+ return parseClassName;
761
+ };
762
+ const stripImportantModifier = baseClassName => {
763
+ if (baseClassName.endsWith(IMPORTANT_MODIFIER)) {
764
+ return baseClassName.substring(0, baseClassName.length - 1);
765
+ }
766
+ /**
767
+ * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
768
+ * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
769
+ */
770
+ if (baseClassName.startsWith(IMPORTANT_MODIFIER)) {
771
+ return baseClassName.substring(1);
772
+ }
773
+ return baseClassName;
774
+ };
775
+
776
+ /**
777
+ * Sorts modifiers according to following schema:
778
+ * - Predefined modifiers are sorted alphabetically
779
+ * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
780
+ */
781
+ const createSortModifiers = config => {
782
+ const orderSensitiveModifiers = Object.fromEntries(config.orderSensitiveModifiers.map(modifier => [modifier, true]));
783
+ const sortModifiers = modifiers => {
784
+ if (modifiers.length <= 1) {
785
+ return modifiers;
786
+ }
787
+ const sortedModifiers = [];
788
+ let unsortedModifiers = [];
789
+ modifiers.forEach(modifier => {
790
+ const isPositionSensitive = modifier[0] === '[' || orderSensitiveModifiers[modifier];
791
+ if (isPositionSensitive) {
792
+ sortedModifiers.push(...unsortedModifiers.sort(), modifier);
793
+ unsortedModifiers = [];
794
+ } else {
795
+ unsortedModifiers.push(modifier);
796
+ }
797
+ });
798
+ sortedModifiers.push(...unsortedModifiers.sort());
799
+ return sortedModifiers;
800
+ };
801
+ return sortModifiers;
802
+ };
803
+ const createConfigUtils = config => ({
804
+ cache: createLruCache(config.cacheSize),
805
+ parseClassName: createParseClassName(config),
806
+ sortModifiers: createSortModifiers(config),
807
+ ...createClassGroupUtils(config)
808
+ });
809
+ const SPLIT_CLASSES_REGEX = /\s+/;
810
+ const mergeClassList = (classList, configUtils) => {
811
+ const {
812
+ parseClassName,
813
+ getClassGroupId,
814
+ getConflictingClassGroupIds,
815
+ sortModifiers
816
+ } = configUtils;
817
+ /**
818
+ * Set of classGroupIds in following format:
819
+ * `{importantModifier}{variantModifiers}{classGroupId}`
820
+ * @example 'float'
821
+ * @example 'hover:focus:bg-color'
822
+ * @example 'md:!pr'
823
+ */
824
+ const classGroupsInConflict = [];
825
+ const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
826
+ let result = '';
827
+ for (let index = classNames.length - 1; index >= 0; index -= 1) {
828
+ const originalClassName = classNames[index];
829
+ const {
830
+ isExternal,
831
+ modifiers,
832
+ hasImportantModifier,
833
+ baseClassName,
834
+ maybePostfixModifierPosition
835
+ } = parseClassName(originalClassName);
836
+ if (isExternal) {
837
+ result = originalClassName + (result.length > 0 ? ' ' + result : result);
838
+ continue;
839
+ }
840
+ let hasPostfixModifier = !!maybePostfixModifierPosition;
841
+ let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
842
+ if (!classGroupId) {
843
+ if (!hasPostfixModifier) {
844
+ // Not a Tailwind class
845
+ result = originalClassName + (result.length > 0 ? ' ' + result : result);
846
+ continue;
847
+ }
848
+ classGroupId = getClassGroupId(baseClassName);
849
+ if (!classGroupId) {
850
+ // Not a Tailwind class
851
+ result = originalClassName + (result.length > 0 ? ' ' + result : result);
852
+ continue;
853
+ }
854
+ hasPostfixModifier = false;
855
+ }
856
+ const variantModifier = sortModifiers(modifiers).join(':');
857
+ const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
858
+ const classId = modifierId + classGroupId;
859
+ if (classGroupsInConflict.includes(classId)) {
860
+ // Tailwind class omitted due to conflict
861
+ continue;
862
+ }
863
+ classGroupsInConflict.push(classId);
864
+ const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
865
+ for (let i = 0; i < conflictGroups.length; ++i) {
866
+ const group = conflictGroups[i];
867
+ classGroupsInConflict.push(modifierId + group);
868
+ }
869
+ // Tailwind class not in conflict
870
+ result = originalClassName + (result.length > 0 ? ' ' + result : result);
871
+ }
872
+ return result;
873
+ };
874
+
875
+ /**
876
+ * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
877
+ *
878
+ * Specifically:
879
+ * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
880
+ * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
881
+ *
882
+ * Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
883
+ */
884
+ function twJoin() {
885
+ let index = 0;
886
+ let argument;
887
+ let resolvedValue;
888
+ let string = '';
889
+ while (index < arguments.length) {
890
+ if (argument = arguments[index++]) {
891
+ if (resolvedValue = toValue(argument)) {
892
+ string && (string += ' ');
893
+ string += resolvedValue;
894
+ }
895
+ }
896
+ }
897
+ return string;
898
+ }
899
+ const toValue = mix => {
900
+ if (typeof mix === 'string') {
901
+ return mix;
902
+ }
903
+ let resolvedValue;
904
+ let string = '';
905
+ for (let k = 0; k < mix.length; k++) {
906
+ if (mix[k]) {
907
+ if (resolvedValue = toValue(mix[k])) {
908
+ string && (string += ' ');
909
+ string += resolvedValue;
910
+ }
911
+ }
912
+ }
913
+ return string;
914
+ };
915
+ function createTailwindMerge(createConfigFirst, ...createConfigRest) {
916
+ let configUtils;
917
+ let cacheGet;
918
+ let cacheSet;
919
+ let functionToCall = initTailwindMerge;
920
+ function initTailwindMerge(classList) {
921
+ const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
922
+ configUtils = createConfigUtils(config);
923
+ cacheGet = configUtils.cache.get;
924
+ cacheSet = configUtils.cache.set;
925
+ functionToCall = tailwindMerge;
926
+ return tailwindMerge(classList);
927
+ }
928
+ function tailwindMerge(classList) {
929
+ const cachedResult = cacheGet(classList);
930
+ if (cachedResult) {
931
+ return cachedResult;
932
+ }
933
+ const result = mergeClassList(classList, configUtils);
934
+ cacheSet(classList, result);
935
+ return result;
936
+ }
937
+ return function callTailwindMerge() {
938
+ return functionToCall(twJoin.apply(null, arguments));
939
+ };
940
+ }
941
+ const fromTheme = key => {
942
+ const themeGetter = theme => theme[key] || [];
943
+ themeGetter.isThemeGetter = true;
944
+ return themeGetter;
945
+ };
946
+ const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
947
+ const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
948
+ const fractionRegex = /^\d+\/\d+$/;
949
+ const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
950
+ const lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
951
+ const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
952
+ // Shadow always begins with x and y offset separated by underscore optionally prepended by inset
953
+ const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
954
+ const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
955
+ const isFraction = value => fractionRegex.test(value);
956
+ const isNumber = value => Boolean(value) && !Number.isNaN(Number(value));
957
+ const isInteger = value => Boolean(value) && Number.isInteger(Number(value));
958
+ const isPercent = value => value.endsWith('%') && isNumber(value.slice(0, -1));
959
+ const isTshirtSize = value => tshirtUnitRegex.test(value);
960
+ const isAny = () => true;
961
+ const isLengthOnly = value =>
962
+ // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
963
+ // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
964
+ // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
965
+ lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
966
+ const isNever = () => false;
967
+ const isShadow = value => shadowRegex.test(value);
968
+ const isImage = value => imageRegex.test(value);
969
+ const isAnyNonArbitrary = value => !isArbitraryValue(value) && !isArbitraryVariable(value);
970
+ const isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever);
971
+ const isArbitraryValue = value => arbitraryValueRegex.test(value);
972
+ const isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
973
+ const isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber);
974
+ const isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever);
975
+ const isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage);
976
+ const isArbitraryShadow = value => getIsArbitraryValue(value, isNever, isShadow);
977
+ const isArbitraryVariable = value => arbitraryVariableRegex.test(value);
978
+ const isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength);
979
+ const isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName);
980
+ const isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLabelPosition);
981
+ const isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize);
982
+ const isArbitraryVariableImage = value => getIsArbitraryVariable(value, isLabelImage);
983
+ const isArbitraryVariableShadow = value => getIsArbitraryVariable(value, isLabelShadow, true);
984
+ // Helpers
985
+ const getIsArbitraryValue = (value, testLabel, testValue) => {
986
+ const result = arbitraryValueRegex.exec(value);
987
+ if (result) {
988
+ if (result[1]) {
989
+ return testLabel(result[1]);
990
+ }
991
+ return testValue(result[2]);
992
+ }
993
+ return false;
994
+ };
995
+ const getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {
996
+ const result = arbitraryVariableRegex.exec(value);
997
+ if (result) {
998
+ if (result[1]) {
999
+ return testLabel(result[1]);
1000
+ }
1001
+ return shouldMatchNoLabel;
1002
+ }
1003
+ return false;
1004
+ };
1005
+ // Labels
1006
+ const isLabelPosition = label => label === 'position';
1007
+ const imageLabels = /*#__PURE__*/new Set(['image', 'url']);
1008
+ const isLabelImage = label => imageLabels.has(label);
1009
+ const sizeLabels = /*#__PURE__*/new Set(['length', 'size', 'percentage']);
1010
+ const isLabelSize = label => sizeLabels.has(label);
1011
+ const isLabelLength = label => label === 'length';
1012
+ const isLabelNumber = label => label === 'number';
1013
+ const isLabelFamilyName = label => label === 'family-name';
1014
+ const isLabelShadow = label => label === 'shadow';
1015
+ const getDefaultConfig = () => {
1016
+ /**
1017
+ * Theme getters for theme variable namespaces
1018
+ * @see https://tailwindcss.com/docs/theme#theme-variable-namespaces
1019
+ */
1020
+ /***/
1021
+ const themeColor = fromTheme('color');
1022
+ const themeFont = fromTheme('font');
1023
+ const themeText = fromTheme('text');
1024
+ const themeFontWeight = fromTheme('font-weight');
1025
+ const themeTracking = fromTheme('tracking');
1026
+ const themeLeading = fromTheme('leading');
1027
+ const themeBreakpoint = fromTheme('breakpoint');
1028
+ const themeContainer = fromTheme('container');
1029
+ const themeSpacing = fromTheme('spacing');
1030
+ const themeRadius = fromTheme('radius');
1031
+ const themeShadow = fromTheme('shadow');
1032
+ const themeInsetShadow = fromTheme('inset-shadow');
1033
+ const themeDropShadow = fromTheme('drop-shadow');
1034
+ const themeBlur = fromTheme('blur');
1035
+ const themePerspective = fromTheme('perspective');
1036
+ const themeAspect = fromTheme('aspect');
1037
+ const themeEase = fromTheme('ease');
1038
+ const themeAnimate = fromTheme('animate');
1039
+ /**
1040
+ * Helpers to avoid repeating the same scales
1041
+ *
1042
+ * We use functions that create a new array every time they're called instead of static arrays.
1043
+ * This ensures that users who modify any scale by mutating the array (e.g. with `array.push(element)`) don't accidentally mutate arrays in other parts of the config.
1044
+ */
1045
+ /***/
1046
+ const scaleBreak = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];
1047
+ const scalePosition = () => ['bottom', 'center', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top', 'top'];
1048
+ const scaleOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];
1049
+ const scaleOverscroll = () => ['auto', 'contain', 'none'];
1050
+ const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];
1051
+ const scaleInset = () => [isFraction, 'full', 'auto', ...scaleUnambiguousSpacing()];
1052
+ const scaleGridTemplateColsRows = () => [isInteger, 'none', 'subgrid', isArbitraryVariable, isArbitraryValue];
1053
+ const scaleGridColRowStartAndEnd = () => ['auto', {
1054
+ span: ['full', isInteger, isArbitraryVariable, isArbitraryValue]
1055
+ }, isInteger, isArbitraryVariable, isArbitraryValue];
1056
+ const scaleGridColRowStartOrEnd = () => [isInteger, 'auto', isArbitraryVariable, isArbitraryValue];
1057
+ const scaleGridAutoColsRows = () => ['auto', 'min', 'max', 'fr', isArbitraryVariable, isArbitraryValue];
1058
+ const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline'];
1059
+ const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch'];
1060
+ const scaleMargin = () => ['auto', ...scaleUnambiguousSpacing()];
1061
+ const scaleSizing = () => [isFraction, 'auto', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];
1062
+ const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];
1063
+ const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength];
1064
+ const scaleRadius = () => [
1065
+ // Deprecated since Tailwind CSS v4.0.0
1066
+ '', 'none', 'full', themeRadius, isArbitraryVariable, isArbitraryValue];
1067
+ const scaleBorderWidth = () => ['', isNumber, isArbitraryVariableLength, isArbitraryLength];
1068
+ const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double'];
1069
+ const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'];
1070
+ const scaleBlur = () => [
1071
+ // Deprecated since Tailwind CSS v4.0.0
1072
+ '', 'none', themeBlur, isArbitraryVariable, isArbitraryValue];
1073
+ const scaleOrigin = () => ['center', 'top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left', isArbitraryVariable, isArbitraryValue];
1074
+ const scaleRotate = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];
1075
+ const scaleScale = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];
1076
+ const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];
1077
+ const scaleTranslate = () => [isFraction, 'full', ...scaleUnambiguousSpacing()];
1078
+ return {
1079
+ cacheSize: 500,
1080
+ theme: {
1081
+ animate: ['spin', 'ping', 'pulse', 'bounce'],
1082
+ aspect: ['video'],
1083
+ blur: [isTshirtSize],
1084
+ breakpoint: [isTshirtSize],
1085
+ color: [isAny],
1086
+ container: [isTshirtSize],
1087
+ 'drop-shadow': [isTshirtSize],
1088
+ ease: ['in', 'out', 'in-out'],
1089
+ font: [isAnyNonArbitrary],
1090
+ 'font-weight': ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'],
1091
+ 'inset-shadow': [isTshirtSize],
1092
+ leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose'],
1093
+ perspective: ['dramatic', 'near', 'normal', 'midrange', 'distant', 'none'],
1094
+ radius: [isTshirtSize],
1095
+ shadow: [isTshirtSize],
1096
+ spacing: ['px', isNumber],
1097
+ text: [isTshirtSize],
1098
+ tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest']
1099
+ },
1100
+ classGroups: {
1101
+ // --------------
1102
+ // --- Layout ---
1103
+ // --------------
1104
+ /**
1105
+ * Aspect Ratio
1106
+ * @see https://tailwindcss.com/docs/aspect-ratio
1107
+ */
1108
+ aspect: [{
1109
+ aspect: ['auto', 'square', isFraction, isArbitraryValue, isArbitraryVariable, themeAspect]
1110
+ }],
1111
+ /**
1112
+ * Container
1113
+ * @see https://tailwindcss.com/docs/container
1114
+ * @deprecated since Tailwind CSS v4.0.0
1115
+ */
1116
+ container: ['container'],
1117
+ /**
1118
+ * Columns
1119
+ * @see https://tailwindcss.com/docs/columns
1120
+ */
1121
+ columns: [{
1122
+ columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer]
1123
+ }],
1124
+ /**
1125
+ * Break After
1126
+ * @see https://tailwindcss.com/docs/break-after
1127
+ */
1128
+ 'break-after': [{
1129
+ 'break-after': scaleBreak()
1130
+ }],
1131
+ /**
1132
+ * Break Before
1133
+ * @see https://tailwindcss.com/docs/break-before
1134
+ */
1135
+ 'break-before': [{
1136
+ 'break-before': scaleBreak()
1137
+ }],
1138
+ /**
1139
+ * Break Inside
1140
+ * @see https://tailwindcss.com/docs/break-inside
1141
+ */
1142
+ 'break-inside': [{
1143
+ 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column']
1144
+ }],
1145
+ /**
1146
+ * Box Decoration Break
1147
+ * @see https://tailwindcss.com/docs/box-decoration-break
1148
+ */
1149
+ 'box-decoration': [{
1150
+ 'box-decoration': ['slice', 'clone']
1151
+ }],
1152
+ /**
1153
+ * Box Sizing
1154
+ * @see https://tailwindcss.com/docs/box-sizing
1155
+ */
1156
+ box: [{
1157
+ box: ['border', 'content']
1158
+ }],
1159
+ /**
1160
+ * Display
1161
+ * @see https://tailwindcss.com/docs/display
1162
+ */
1163
+ display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'],
1164
+ /**
1165
+ * Screen Reader Only
1166
+ * @see https://tailwindcss.com/docs/display#screen-reader-only
1167
+ */
1168
+ sr: ['sr-only', 'not-sr-only'],
1169
+ /**
1170
+ * Floats
1171
+ * @see https://tailwindcss.com/docs/float
1172
+ */
1173
+ float: [{
1174
+ float: ['right', 'left', 'none', 'start', 'end']
1175
+ }],
1176
+ /**
1177
+ * Clear
1178
+ * @see https://tailwindcss.com/docs/clear
1179
+ */
1180
+ clear: [{
1181
+ clear: ['left', 'right', 'both', 'none', 'start', 'end']
1182
+ }],
1183
+ /**
1184
+ * Isolation
1185
+ * @see https://tailwindcss.com/docs/isolation
1186
+ */
1187
+ isolation: ['isolate', 'isolation-auto'],
1188
+ /**
1189
+ * Object Fit
1190
+ * @see https://tailwindcss.com/docs/object-fit
1191
+ */
1192
+ 'object-fit': [{
1193
+ object: ['contain', 'cover', 'fill', 'none', 'scale-down']
1194
+ }],
1195
+ /**
1196
+ * Object Position
1197
+ * @see https://tailwindcss.com/docs/object-position
1198
+ */
1199
+ 'object-position': [{
1200
+ object: [...scalePosition(), isArbitraryValue, isArbitraryVariable]
1201
+ }],
1202
+ /**
1203
+ * Overflow
1204
+ * @see https://tailwindcss.com/docs/overflow
1205
+ */
1206
+ overflow: [{
1207
+ overflow: scaleOverflow()
1208
+ }],
1209
+ /**
1210
+ * Overflow X
1211
+ * @see https://tailwindcss.com/docs/overflow
1212
+ */
1213
+ 'overflow-x': [{
1214
+ 'overflow-x': scaleOverflow()
1215
+ }],
1216
+ /**
1217
+ * Overflow Y
1218
+ * @see https://tailwindcss.com/docs/overflow
1219
+ */
1220
+ 'overflow-y': [{
1221
+ 'overflow-y': scaleOverflow()
1222
+ }],
1223
+ /**
1224
+ * Overscroll Behavior
1225
+ * @see https://tailwindcss.com/docs/overscroll-behavior
1226
+ */
1227
+ overscroll: [{
1228
+ overscroll: scaleOverscroll()
1229
+ }],
1230
+ /**
1231
+ * Overscroll Behavior X
1232
+ * @see https://tailwindcss.com/docs/overscroll-behavior
1233
+ */
1234
+ 'overscroll-x': [{
1235
+ 'overscroll-x': scaleOverscroll()
1236
+ }],
1237
+ /**
1238
+ * Overscroll Behavior Y
1239
+ * @see https://tailwindcss.com/docs/overscroll-behavior
1240
+ */
1241
+ 'overscroll-y': [{
1242
+ 'overscroll-y': scaleOverscroll()
1243
+ }],
1244
+ /**
1245
+ * Position
1246
+ * @see https://tailwindcss.com/docs/position
1247
+ */
1248
+ position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],
1249
+ /**
1250
+ * Top / Right / Bottom / Left
1251
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1252
+ */
1253
+ inset: [{
1254
+ inset: scaleInset()
1255
+ }],
1256
+ /**
1257
+ * Right / Left
1258
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1259
+ */
1260
+ 'inset-x': [{
1261
+ 'inset-x': scaleInset()
1262
+ }],
1263
+ /**
1264
+ * Top / Bottom
1265
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1266
+ */
1267
+ 'inset-y': [{
1268
+ 'inset-y': scaleInset()
1269
+ }],
1270
+ /**
1271
+ * Start
1272
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1273
+ */
1274
+ start: [{
1275
+ start: scaleInset()
1276
+ }],
1277
+ /**
1278
+ * End
1279
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1280
+ */
1281
+ end: [{
1282
+ end: scaleInset()
1283
+ }],
1284
+ /**
1285
+ * Top
1286
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1287
+ */
1288
+ top: [{
1289
+ top: scaleInset()
1290
+ }],
1291
+ /**
1292
+ * Right
1293
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1294
+ */
1295
+ right: [{
1296
+ right: scaleInset()
1297
+ }],
1298
+ /**
1299
+ * Bottom
1300
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1301
+ */
1302
+ bottom: [{
1303
+ bottom: scaleInset()
1304
+ }],
1305
+ /**
1306
+ * Left
1307
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1308
+ */
1309
+ left: [{
1310
+ left: scaleInset()
1311
+ }],
1312
+ /**
1313
+ * Visibility
1314
+ * @see https://tailwindcss.com/docs/visibility
1315
+ */
1316
+ visibility: ['visible', 'invisible', 'collapse'],
1317
+ /**
1318
+ * Z-Index
1319
+ * @see https://tailwindcss.com/docs/z-index
1320
+ */
1321
+ z: [{
1322
+ z: [isInteger, 'auto', isArbitraryVariable, isArbitraryValue]
1323
+ }],
1324
+ // ------------------------
1325
+ // --- Flexbox and Grid ---
1326
+ // ------------------------
1327
+ /**
1328
+ * Flex Basis
1329
+ * @see https://tailwindcss.com/docs/flex-basis
1330
+ */
1331
+ basis: [{
1332
+ basis: [isFraction, 'full', 'auto', themeContainer, ...scaleUnambiguousSpacing()]
1333
+ }],
1334
+ /**
1335
+ * Flex Direction
1336
+ * @see https://tailwindcss.com/docs/flex-direction
1337
+ */
1338
+ 'flex-direction': [{
1339
+ flex: ['row', 'row-reverse', 'col', 'col-reverse']
1340
+ }],
1341
+ /**
1342
+ * Flex Wrap
1343
+ * @see https://tailwindcss.com/docs/flex-wrap
1344
+ */
1345
+ 'flex-wrap': [{
1346
+ flex: ['nowrap', 'wrap', 'wrap-reverse']
1347
+ }],
1348
+ /**
1349
+ * Flex
1350
+ * @see https://tailwindcss.com/docs/flex
1351
+ */
1352
+ flex: [{
1353
+ flex: [isNumber, isFraction, 'auto', 'initial', 'none', isArbitraryValue]
1354
+ }],
1355
+ /**
1356
+ * Flex Grow
1357
+ * @see https://tailwindcss.com/docs/flex-grow
1358
+ */
1359
+ grow: [{
1360
+ grow: ['', isNumber, isArbitraryVariable, isArbitraryValue]
1361
+ }],
1362
+ /**
1363
+ * Flex Shrink
1364
+ * @see https://tailwindcss.com/docs/flex-shrink
1365
+ */
1366
+ shrink: [{
1367
+ shrink: ['', isNumber, isArbitraryVariable, isArbitraryValue]
1368
+ }],
1369
+ /**
1370
+ * Order
1371
+ * @see https://tailwindcss.com/docs/order
1372
+ */
1373
+ order: [{
1374
+ order: [isInteger, 'first', 'last', 'none', isArbitraryVariable, isArbitraryValue]
1375
+ }],
1376
+ /**
1377
+ * Grid Template Columns
1378
+ * @see https://tailwindcss.com/docs/grid-template-columns
1379
+ */
1380
+ 'grid-cols': [{
1381
+ 'grid-cols': scaleGridTemplateColsRows()
1382
+ }],
1383
+ /**
1384
+ * Grid Column Start / End
1385
+ * @see https://tailwindcss.com/docs/grid-column
1386
+ */
1387
+ 'col-start-end': [{
1388
+ col: scaleGridColRowStartAndEnd()
1389
+ }],
1390
+ /**
1391
+ * Grid Column Start
1392
+ * @see https://tailwindcss.com/docs/grid-column
1393
+ */
1394
+ 'col-start': [{
1395
+ 'col-start': scaleGridColRowStartOrEnd()
1396
+ }],
1397
+ /**
1398
+ * Grid Column End
1399
+ * @see https://tailwindcss.com/docs/grid-column
1400
+ */
1401
+ 'col-end': [{
1402
+ 'col-end': scaleGridColRowStartOrEnd()
1403
+ }],
1404
+ /**
1405
+ * Grid Template Rows
1406
+ * @see https://tailwindcss.com/docs/grid-template-rows
1407
+ */
1408
+ 'grid-rows': [{
1409
+ 'grid-rows': scaleGridTemplateColsRows()
1410
+ }],
1411
+ /**
1412
+ * Grid Row Start / End
1413
+ * @see https://tailwindcss.com/docs/grid-row
1414
+ */
1415
+ 'row-start-end': [{
1416
+ row: scaleGridColRowStartAndEnd()
1417
+ }],
1418
+ /**
1419
+ * Grid Row Start
1420
+ * @see https://tailwindcss.com/docs/grid-row
1421
+ */
1422
+ 'row-start': [{
1423
+ 'row-start': scaleGridColRowStartOrEnd()
1424
+ }],
1425
+ /**
1426
+ * Grid Row End
1427
+ * @see https://tailwindcss.com/docs/grid-row
1428
+ */
1429
+ 'row-end': [{
1430
+ 'row-end': scaleGridColRowStartOrEnd()
1431
+ }],
1432
+ /**
1433
+ * Grid Auto Flow
1434
+ * @see https://tailwindcss.com/docs/grid-auto-flow
1435
+ */
1436
+ 'grid-flow': [{
1437
+ 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense']
1438
+ }],
1439
+ /**
1440
+ * Grid Auto Columns
1441
+ * @see https://tailwindcss.com/docs/grid-auto-columns
1442
+ */
1443
+ 'auto-cols': [{
1444
+ 'auto-cols': scaleGridAutoColsRows()
1445
+ }],
1446
+ /**
1447
+ * Grid Auto Rows
1448
+ * @see https://tailwindcss.com/docs/grid-auto-rows
1449
+ */
1450
+ 'auto-rows': [{
1451
+ 'auto-rows': scaleGridAutoColsRows()
1452
+ }],
1453
+ /**
1454
+ * Gap
1455
+ * @see https://tailwindcss.com/docs/gap
1456
+ */
1457
+ gap: [{
1458
+ gap: scaleUnambiguousSpacing()
1459
+ }],
1460
+ /**
1461
+ * Gap X
1462
+ * @see https://tailwindcss.com/docs/gap
1463
+ */
1464
+ 'gap-x': [{
1465
+ 'gap-x': scaleUnambiguousSpacing()
1466
+ }],
1467
+ /**
1468
+ * Gap Y
1469
+ * @see https://tailwindcss.com/docs/gap
1470
+ */
1471
+ 'gap-y': [{
1472
+ 'gap-y': scaleUnambiguousSpacing()
1473
+ }],
1474
+ /**
1475
+ * Justify Content
1476
+ * @see https://tailwindcss.com/docs/justify-content
1477
+ */
1478
+ 'justify-content': [{
1479
+ justify: [...scaleAlignPrimaryAxis(), 'normal']
1480
+ }],
1481
+ /**
1482
+ * Justify Items
1483
+ * @see https://tailwindcss.com/docs/justify-items
1484
+ */
1485
+ 'justify-items': [{
1486
+ 'justify-items': [...scaleAlignSecondaryAxis(), 'normal']
1487
+ }],
1488
+ /**
1489
+ * Justify Self
1490
+ * @see https://tailwindcss.com/docs/justify-self
1491
+ */
1492
+ 'justify-self': [{
1493
+ 'justify-self': ['auto', ...scaleAlignSecondaryAxis()]
1494
+ }],
1495
+ /**
1496
+ * Align Content
1497
+ * @see https://tailwindcss.com/docs/align-content
1498
+ */
1499
+ 'align-content': [{
1500
+ content: ['normal', ...scaleAlignPrimaryAxis()]
1501
+ }],
1502
+ /**
1503
+ * Align Items
1504
+ * @see https://tailwindcss.com/docs/align-items
1505
+ */
1506
+ 'align-items': [{
1507
+ items: [...scaleAlignSecondaryAxis(), 'baseline']
1508
+ }],
1509
+ /**
1510
+ * Align Self
1511
+ * @see https://tailwindcss.com/docs/align-self
1512
+ */
1513
+ 'align-self': [{
1514
+ self: ['auto', ...scaleAlignSecondaryAxis(), 'baseline']
1515
+ }],
1516
+ /**
1517
+ * Place Content
1518
+ * @see https://tailwindcss.com/docs/place-content
1519
+ */
1520
+ 'place-content': [{
1521
+ 'place-content': scaleAlignPrimaryAxis()
1522
+ }],
1523
+ /**
1524
+ * Place Items
1525
+ * @see https://tailwindcss.com/docs/place-items
1526
+ */
1527
+ 'place-items': [{
1528
+ 'place-items': [...scaleAlignSecondaryAxis(), 'baseline']
1529
+ }],
1530
+ /**
1531
+ * Place Self
1532
+ * @see https://tailwindcss.com/docs/place-self
1533
+ */
1534
+ 'place-self': [{
1535
+ 'place-self': ['auto', ...scaleAlignSecondaryAxis()]
1536
+ }],
1537
+ // Spacing
1538
+ /**
1539
+ * Padding
1540
+ * @see https://tailwindcss.com/docs/padding
1541
+ */
1542
+ p: [{
1543
+ p: scaleUnambiguousSpacing()
1544
+ }],
1545
+ /**
1546
+ * Padding X
1547
+ * @see https://tailwindcss.com/docs/padding
1548
+ */
1549
+ px: [{
1550
+ px: scaleUnambiguousSpacing()
1551
+ }],
1552
+ /**
1553
+ * Padding Y
1554
+ * @see https://tailwindcss.com/docs/padding
1555
+ */
1556
+ py: [{
1557
+ py: scaleUnambiguousSpacing()
1558
+ }],
1559
+ /**
1560
+ * Padding Start
1561
+ * @see https://tailwindcss.com/docs/padding
1562
+ */
1563
+ ps: [{
1564
+ ps: scaleUnambiguousSpacing()
1565
+ }],
1566
+ /**
1567
+ * Padding End
1568
+ * @see https://tailwindcss.com/docs/padding
1569
+ */
1570
+ pe: [{
1571
+ pe: scaleUnambiguousSpacing()
1572
+ }],
1573
+ /**
1574
+ * Padding Top
1575
+ * @see https://tailwindcss.com/docs/padding
1576
+ */
1577
+ pt: [{
1578
+ pt: scaleUnambiguousSpacing()
1579
+ }],
1580
+ /**
1581
+ * Padding Right
1582
+ * @see https://tailwindcss.com/docs/padding
1583
+ */
1584
+ pr: [{
1585
+ pr: scaleUnambiguousSpacing()
1586
+ }],
1587
+ /**
1588
+ * Padding Bottom
1589
+ * @see https://tailwindcss.com/docs/padding
1590
+ */
1591
+ pb: [{
1592
+ pb: scaleUnambiguousSpacing()
1593
+ }],
1594
+ /**
1595
+ * Padding Left
1596
+ * @see https://tailwindcss.com/docs/padding
1597
+ */
1598
+ pl: [{
1599
+ pl: scaleUnambiguousSpacing()
1600
+ }],
1601
+ /**
1602
+ * Margin
1603
+ * @see https://tailwindcss.com/docs/margin
1604
+ */
1605
+ m: [{
1606
+ m: scaleMargin()
1607
+ }],
1608
+ /**
1609
+ * Margin X
1610
+ * @see https://tailwindcss.com/docs/margin
1611
+ */
1612
+ mx: [{
1613
+ mx: scaleMargin()
1614
+ }],
1615
+ /**
1616
+ * Margin Y
1617
+ * @see https://tailwindcss.com/docs/margin
1618
+ */
1619
+ my: [{
1620
+ my: scaleMargin()
1621
+ }],
1622
+ /**
1623
+ * Margin Start
1624
+ * @see https://tailwindcss.com/docs/margin
1625
+ */
1626
+ ms: [{
1627
+ ms: scaleMargin()
1628
+ }],
1629
+ /**
1630
+ * Margin End
1631
+ * @see https://tailwindcss.com/docs/margin
1632
+ */
1633
+ me: [{
1634
+ me: scaleMargin()
1635
+ }],
1636
+ /**
1637
+ * Margin Top
1638
+ * @see https://tailwindcss.com/docs/margin
1639
+ */
1640
+ mt: [{
1641
+ mt: scaleMargin()
1642
+ }],
1643
+ /**
1644
+ * Margin Right
1645
+ * @see https://tailwindcss.com/docs/margin
1646
+ */
1647
+ mr: [{
1648
+ mr: scaleMargin()
1649
+ }],
1650
+ /**
1651
+ * Margin Bottom
1652
+ * @see https://tailwindcss.com/docs/margin
1653
+ */
1654
+ mb: [{
1655
+ mb: scaleMargin()
1656
+ }],
1657
+ /**
1658
+ * Margin Left
1659
+ * @see https://tailwindcss.com/docs/margin
1660
+ */
1661
+ ml: [{
1662
+ ml: scaleMargin()
1663
+ }],
1664
+ /**
1665
+ * Space Between X
1666
+ * @see https://tailwindcss.com/docs/margin#adding-space-between-children
1667
+ */
1668
+ 'space-x': [{
1669
+ 'space-x': scaleUnambiguousSpacing()
1670
+ }],
1671
+ /**
1672
+ * Space Between X Reverse
1673
+ * @see https://tailwindcss.com/docs/margin#adding-space-between-children
1674
+ */
1675
+ 'space-x-reverse': ['space-x-reverse'],
1676
+ /**
1677
+ * Space Between Y
1678
+ * @see https://tailwindcss.com/docs/margin#adding-space-between-children
1679
+ */
1680
+ 'space-y': [{
1681
+ 'space-y': scaleUnambiguousSpacing()
1682
+ }],
1683
+ /**
1684
+ * Space Between Y Reverse
1685
+ * @see https://tailwindcss.com/docs/margin#adding-space-between-children
1686
+ */
1687
+ 'space-y-reverse': ['space-y-reverse'],
1688
+ // --------------
1689
+ // --- Sizing ---
1690
+ // --------------
1691
+ /**
1692
+ * Size
1693
+ * @see https://tailwindcss.com/docs/width#setting-both-width-and-height
1694
+ */
1695
+ size: [{
1696
+ size: scaleSizing()
1697
+ }],
1698
+ /**
1699
+ * Width
1700
+ * @see https://tailwindcss.com/docs/width
1701
+ */
1702
+ w: [{
1703
+ w: [themeContainer, 'screen', ...scaleSizing()]
1704
+ }],
1705
+ /**
1706
+ * Min-Width
1707
+ * @see https://tailwindcss.com/docs/min-width
1708
+ */
1709
+ 'min-w': [{
1710
+ 'min-w': [themeContainer, 'screen', /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
1711
+ 'none', ...scaleSizing()]
1712
+ }],
1713
+ /**
1714
+ * Max-Width
1715
+ * @see https://tailwindcss.com/docs/max-width
1716
+ */
1717
+ 'max-w': [{
1718
+ 'max-w': [themeContainer, 'screen', 'none', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
1719
+ 'prose', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
1720
+ {
1721
+ screen: [themeBreakpoint]
1722
+ }, ...scaleSizing()]
1723
+ }],
1724
+ /**
1725
+ * Height
1726
+ * @see https://tailwindcss.com/docs/height
1727
+ */
1728
+ h: [{
1729
+ h: ['screen', ...scaleSizing()]
1730
+ }],
1731
+ /**
1732
+ * Min-Height
1733
+ * @see https://tailwindcss.com/docs/min-height
1734
+ */
1735
+ 'min-h': [{
1736
+ 'min-h': ['screen', 'none', ...scaleSizing()]
1737
+ }],
1738
+ /**
1739
+ * Max-Height
1740
+ * @see https://tailwindcss.com/docs/max-height
1741
+ */
1742
+ 'max-h': [{
1743
+ 'max-h': ['screen', ...scaleSizing()]
1744
+ }],
1745
+ // ------------------
1746
+ // --- Typography ---
1747
+ // ------------------
1748
+ /**
1749
+ * Font Size
1750
+ * @see https://tailwindcss.com/docs/font-size
1751
+ */
1752
+ 'font-size': [{
1753
+ text: ['base', themeText, isArbitraryVariableLength, isArbitraryLength]
1754
+ }],
1755
+ /**
1756
+ * Font Smoothing
1757
+ * @see https://tailwindcss.com/docs/font-smoothing
1758
+ */
1759
+ 'font-smoothing': ['antialiased', 'subpixel-antialiased'],
1760
+ /**
1761
+ * Font Style
1762
+ * @see https://tailwindcss.com/docs/font-style
1763
+ */
1764
+ 'font-style': ['italic', 'not-italic'],
1765
+ /**
1766
+ * Font Weight
1767
+ * @see https://tailwindcss.com/docs/font-weight
1768
+ */
1769
+ 'font-weight': [{
1770
+ font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber]
1771
+ }],
1772
+ /**
1773
+ * Font Stretch
1774
+ * @see https://tailwindcss.com/docs/font-stretch
1775
+ */
1776
+ 'font-stretch': [{
1777
+ 'font-stretch': ['ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded', isPercent, isArbitraryValue]
1778
+ }],
1779
+ /**
1780
+ * Font Family
1781
+ * @see https://tailwindcss.com/docs/font-family
1782
+ */
1783
+ 'font-family': [{
1784
+ font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont]
1785
+ }],
1786
+ /**
1787
+ * Font Variant Numeric
1788
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1789
+ */
1790
+ 'fvn-normal': ['normal-nums'],
1791
+ /**
1792
+ * Font Variant Numeric
1793
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1794
+ */
1795
+ 'fvn-ordinal': ['ordinal'],
1796
+ /**
1797
+ * Font Variant Numeric
1798
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1799
+ */
1800
+ 'fvn-slashed-zero': ['slashed-zero'],
1801
+ /**
1802
+ * Font Variant Numeric
1803
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1804
+ */
1805
+ 'fvn-figure': ['lining-nums', 'oldstyle-nums'],
1806
+ /**
1807
+ * Font Variant Numeric
1808
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1809
+ */
1810
+ 'fvn-spacing': ['proportional-nums', 'tabular-nums'],
1811
+ /**
1812
+ * Font Variant Numeric
1813
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1814
+ */
1815
+ 'fvn-fraction': ['diagonal-fractions', 'stacked-fractions'],
1816
+ /**
1817
+ * Letter Spacing
1818
+ * @see https://tailwindcss.com/docs/letter-spacing
1819
+ */
1820
+ tracking: [{
1821
+ tracking: [themeTracking, isArbitraryVariable, isArbitraryValue]
1822
+ }],
1823
+ /**
1824
+ * Line Clamp
1825
+ * @see https://tailwindcss.com/docs/line-clamp
1826
+ */
1827
+ 'line-clamp': [{
1828
+ 'line-clamp': [isNumber, 'none', isArbitraryVariable, isArbitraryNumber]
1829
+ }],
1830
+ /**
1831
+ * Line Height
1832
+ * @see https://tailwindcss.com/docs/line-height
1833
+ */
1834
+ leading: [{
1835
+ leading: [/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
1836
+ themeLeading, ...scaleUnambiguousSpacing()]
1837
+ }],
1838
+ /**
1839
+ * List Style Image
1840
+ * @see https://tailwindcss.com/docs/list-style-image
1841
+ */
1842
+ 'list-image': [{
1843
+ 'list-image': ['none', isArbitraryVariable, isArbitraryValue]
1844
+ }],
1845
+ /**
1846
+ * List Style Position
1847
+ * @see https://tailwindcss.com/docs/list-style-position
1848
+ */
1849
+ 'list-style-position': [{
1850
+ list: ['inside', 'outside']
1851
+ }],
1852
+ /**
1853
+ * List Style Type
1854
+ * @see https://tailwindcss.com/docs/list-style-type
1855
+ */
1856
+ 'list-style-type': [{
1857
+ list: ['disc', 'decimal', 'none', isArbitraryVariable, isArbitraryValue]
1858
+ }],
1859
+ /**
1860
+ * Text Alignment
1861
+ * @see https://tailwindcss.com/docs/text-align
1862
+ */
1863
+ 'text-alignment': [{
1864
+ text: ['left', 'center', 'right', 'justify', 'start', 'end']
1865
+ }],
1866
+ /**
1867
+ * Placeholder Color
1868
+ * @deprecated since Tailwind CSS v3.0.0
1869
+ * @see https://v3.tailwindcss.com/docs/placeholder-color
1870
+ */
1871
+ 'placeholder-color': [{
1872
+ placeholder: scaleColor()
1873
+ }],
1874
+ /**
1875
+ * Text Color
1876
+ * @see https://tailwindcss.com/docs/text-color
1877
+ */
1878
+ 'text-color': [{
1879
+ text: scaleColor()
1880
+ }],
1881
+ /**
1882
+ * Text Decoration
1883
+ * @see https://tailwindcss.com/docs/text-decoration
1884
+ */
1885
+ 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'],
1886
+ /**
1887
+ * Text Decoration Style
1888
+ * @see https://tailwindcss.com/docs/text-decoration-style
1889
+ */
1890
+ 'text-decoration-style': [{
1891
+ decoration: [...scaleLineStyle(), 'wavy']
1892
+ }],
1893
+ /**
1894
+ * Text Decoration Thickness
1895
+ * @see https://tailwindcss.com/docs/text-decoration-thickness
1896
+ */
1897
+ 'text-decoration-thickness': [{
1898
+ decoration: [isNumber, 'from-font', 'auto', isArbitraryVariable, isArbitraryLength]
1899
+ }],
1900
+ /**
1901
+ * Text Decoration Color
1902
+ * @see https://tailwindcss.com/docs/text-decoration-color
1903
+ */
1904
+ 'text-decoration-color': [{
1905
+ decoration: scaleColor()
1906
+ }],
1907
+ /**
1908
+ * Text Underline Offset
1909
+ * @see https://tailwindcss.com/docs/text-underline-offset
1910
+ */
1911
+ 'underline-offset': [{
1912
+ 'underline-offset': [isNumber, 'auto', isArbitraryVariable, isArbitraryValue]
1913
+ }],
1914
+ /**
1915
+ * Text Transform
1916
+ * @see https://tailwindcss.com/docs/text-transform
1917
+ */
1918
+ 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'],
1919
+ /**
1920
+ * Text Overflow
1921
+ * @see https://tailwindcss.com/docs/text-overflow
1922
+ */
1923
+ 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],
1924
+ /**
1925
+ * Text Wrap
1926
+ * @see https://tailwindcss.com/docs/text-wrap
1927
+ */
1928
+ 'text-wrap': [{
1929
+ text: ['wrap', 'nowrap', 'balance', 'pretty']
1930
+ }],
1931
+ /**
1932
+ * Text Indent
1933
+ * @see https://tailwindcss.com/docs/text-indent
1934
+ */
1935
+ indent: [{
1936
+ indent: scaleUnambiguousSpacing()
1937
+ }],
1938
+ /**
1939
+ * Vertical Alignment
1940
+ * @see https://tailwindcss.com/docs/vertical-align
1941
+ */
1942
+ 'vertical-align': [{
1943
+ align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryVariable, isArbitraryValue]
1944
+ }],
1945
+ /**
1946
+ * Whitespace
1947
+ * @see https://tailwindcss.com/docs/whitespace
1948
+ */
1949
+ whitespace: [{
1950
+ whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']
1951
+ }],
1952
+ /**
1953
+ * Word Break
1954
+ * @see https://tailwindcss.com/docs/word-break
1955
+ */
1956
+ break: [{
1957
+ break: ['normal', 'words', 'all', 'keep']
1958
+ }],
1959
+ /**
1960
+ * Hyphens
1961
+ * @see https://tailwindcss.com/docs/hyphens
1962
+ */
1963
+ hyphens: [{
1964
+ hyphens: ['none', 'manual', 'auto']
1965
+ }],
1966
+ /**
1967
+ * Content
1968
+ * @see https://tailwindcss.com/docs/content
1969
+ */
1970
+ content: [{
1971
+ content: ['none', isArbitraryVariable, isArbitraryValue]
1972
+ }],
1973
+ // -------------------
1974
+ // --- Backgrounds ---
1975
+ // -------------------
1976
+ /**
1977
+ * Background Attachment
1978
+ * @see https://tailwindcss.com/docs/background-attachment
1979
+ */
1980
+ 'bg-attachment': [{
1981
+ bg: ['fixed', 'local', 'scroll']
1982
+ }],
1983
+ /**
1984
+ * Background Clip
1985
+ * @see https://tailwindcss.com/docs/background-clip
1986
+ */
1987
+ 'bg-clip': [{
1988
+ 'bg-clip': ['border', 'padding', 'content', 'text']
1989
+ }],
1990
+ /**
1991
+ * Background Origin
1992
+ * @see https://tailwindcss.com/docs/background-origin
1993
+ */
1994
+ 'bg-origin': [{
1995
+ 'bg-origin': ['border', 'padding', 'content']
1996
+ }],
1997
+ /**
1998
+ * Background Position
1999
+ * @see https://tailwindcss.com/docs/background-position
2000
+ */
2001
+ 'bg-position': [{
2002
+ bg: [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition]
2003
+ }],
2004
+ /**
2005
+ * Background Repeat
2006
+ * @see https://tailwindcss.com/docs/background-repeat
2007
+ */
2008
+ 'bg-repeat': [{
2009
+ bg: ['no-repeat', {
2010
+ repeat: ['', 'x', 'y', 'space', 'round']
2011
+ }]
2012
+ }],
2013
+ /**
2014
+ * Background Size
2015
+ * @see https://tailwindcss.com/docs/background-size
2016
+ */
2017
+ 'bg-size': [{
2018
+ bg: ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize]
2019
+ }],
2020
+ /**
2021
+ * Background Image
2022
+ * @see https://tailwindcss.com/docs/background-image
2023
+ */
2024
+ 'bg-image': [{
2025
+ bg: ['none', {
2026
+ linear: [{
2027
+ to: ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']
2028
+ }, isInteger, isArbitraryVariable, isArbitraryValue],
2029
+ radial: ['', isArbitraryVariable, isArbitraryValue],
2030
+ conic: [isInteger, isArbitraryVariable, isArbitraryValue]
2031
+ }, isArbitraryVariableImage, isArbitraryImage]
2032
+ }],
2033
+ /**
2034
+ * Background Color
2035
+ * @see https://tailwindcss.com/docs/background-color
2036
+ */
2037
+ 'bg-color': [{
2038
+ bg: scaleColor()
2039
+ }],
2040
+ /**
2041
+ * Gradient Color Stops From Position
2042
+ * @see https://tailwindcss.com/docs/gradient-color-stops
2043
+ */
2044
+ 'gradient-from-pos': [{
2045
+ from: scaleGradientStopPosition()
2046
+ }],
2047
+ /**
2048
+ * Gradient Color Stops Via Position
2049
+ * @see https://tailwindcss.com/docs/gradient-color-stops
2050
+ */
2051
+ 'gradient-via-pos': [{
2052
+ via: scaleGradientStopPosition()
2053
+ }],
2054
+ /**
2055
+ * Gradient Color Stops To Position
2056
+ * @see https://tailwindcss.com/docs/gradient-color-stops
2057
+ */
2058
+ 'gradient-to-pos': [{
2059
+ to: scaleGradientStopPosition()
2060
+ }],
2061
+ /**
2062
+ * Gradient Color Stops From
2063
+ * @see https://tailwindcss.com/docs/gradient-color-stops
2064
+ */
2065
+ 'gradient-from': [{
2066
+ from: scaleColor()
2067
+ }],
2068
+ /**
2069
+ * Gradient Color Stops Via
2070
+ * @see https://tailwindcss.com/docs/gradient-color-stops
2071
+ */
2072
+ 'gradient-via': [{
2073
+ via: scaleColor()
2074
+ }],
2075
+ /**
2076
+ * Gradient Color Stops To
2077
+ * @see https://tailwindcss.com/docs/gradient-color-stops
2078
+ */
2079
+ 'gradient-to': [{
2080
+ to: scaleColor()
2081
+ }],
2082
+ // ---------------
2083
+ // --- Borders ---
2084
+ // ---------------
2085
+ /**
2086
+ * Border Radius
2087
+ * @see https://tailwindcss.com/docs/border-radius
2088
+ */
2089
+ rounded: [{
2090
+ rounded: scaleRadius()
2091
+ }],
2092
+ /**
2093
+ * Border Radius Start
2094
+ * @see https://tailwindcss.com/docs/border-radius
2095
+ */
2096
+ 'rounded-s': [{
2097
+ 'rounded-s': scaleRadius()
2098
+ }],
2099
+ /**
2100
+ * Border Radius End
2101
+ * @see https://tailwindcss.com/docs/border-radius
2102
+ */
2103
+ 'rounded-e': [{
2104
+ 'rounded-e': scaleRadius()
2105
+ }],
2106
+ /**
2107
+ * Border Radius Top
2108
+ * @see https://tailwindcss.com/docs/border-radius
2109
+ */
2110
+ 'rounded-t': [{
2111
+ 'rounded-t': scaleRadius()
2112
+ }],
2113
+ /**
2114
+ * Border Radius Right
2115
+ * @see https://tailwindcss.com/docs/border-radius
2116
+ */
2117
+ 'rounded-r': [{
2118
+ 'rounded-r': scaleRadius()
2119
+ }],
2120
+ /**
2121
+ * Border Radius Bottom
2122
+ * @see https://tailwindcss.com/docs/border-radius
2123
+ */
2124
+ 'rounded-b': [{
2125
+ 'rounded-b': scaleRadius()
2126
+ }],
2127
+ /**
2128
+ * Border Radius Left
2129
+ * @see https://tailwindcss.com/docs/border-radius
2130
+ */
2131
+ 'rounded-l': [{
2132
+ 'rounded-l': scaleRadius()
2133
+ }],
2134
+ /**
2135
+ * Border Radius Start Start
2136
+ * @see https://tailwindcss.com/docs/border-radius
2137
+ */
2138
+ 'rounded-ss': [{
2139
+ 'rounded-ss': scaleRadius()
2140
+ }],
2141
+ /**
2142
+ * Border Radius Start End
2143
+ * @see https://tailwindcss.com/docs/border-radius
2144
+ */
2145
+ 'rounded-se': [{
2146
+ 'rounded-se': scaleRadius()
2147
+ }],
2148
+ /**
2149
+ * Border Radius End End
2150
+ * @see https://tailwindcss.com/docs/border-radius
2151
+ */
2152
+ 'rounded-ee': [{
2153
+ 'rounded-ee': scaleRadius()
2154
+ }],
2155
+ /**
2156
+ * Border Radius End Start
2157
+ * @see https://tailwindcss.com/docs/border-radius
2158
+ */
2159
+ 'rounded-es': [{
2160
+ 'rounded-es': scaleRadius()
2161
+ }],
2162
+ /**
2163
+ * Border Radius Top Left
2164
+ * @see https://tailwindcss.com/docs/border-radius
2165
+ */
2166
+ 'rounded-tl': [{
2167
+ 'rounded-tl': scaleRadius()
2168
+ }],
2169
+ /**
2170
+ * Border Radius Top Right
2171
+ * @see https://tailwindcss.com/docs/border-radius
2172
+ */
2173
+ 'rounded-tr': [{
2174
+ 'rounded-tr': scaleRadius()
2175
+ }],
2176
+ /**
2177
+ * Border Radius Bottom Right
2178
+ * @see https://tailwindcss.com/docs/border-radius
2179
+ */
2180
+ 'rounded-br': [{
2181
+ 'rounded-br': scaleRadius()
2182
+ }],
2183
+ /**
2184
+ * Border Radius Bottom Left
2185
+ * @see https://tailwindcss.com/docs/border-radius
2186
+ */
2187
+ 'rounded-bl': [{
2188
+ 'rounded-bl': scaleRadius()
2189
+ }],
2190
+ /**
2191
+ * Border Width
2192
+ * @see https://tailwindcss.com/docs/border-width
2193
+ */
2194
+ 'border-w': [{
2195
+ border: scaleBorderWidth()
2196
+ }],
2197
+ /**
2198
+ * Border Width X
2199
+ * @see https://tailwindcss.com/docs/border-width
2200
+ */
2201
+ 'border-w-x': [{
2202
+ 'border-x': scaleBorderWidth()
2203
+ }],
2204
+ /**
2205
+ * Border Width Y
2206
+ * @see https://tailwindcss.com/docs/border-width
2207
+ */
2208
+ 'border-w-y': [{
2209
+ 'border-y': scaleBorderWidth()
2210
+ }],
2211
+ /**
2212
+ * Border Width Start
2213
+ * @see https://tailwindcss.com/docs/border-width
2214
+ */
2215
+ 'border-w-s': [{
2216
+ 'border-s': scaleBorderWidth()
2217
+ }],
2218
+ /**
2219
+ * Border Width End
2220
+ * @see https://tailwindcss.com/docs/border-width
2221
+ */
2222
+ 'border-w-e': [{
2223
+ 'border-e': scaleBorderWidth()
2224
+ }],
2225
+ /**
2226
+ * Border Width Top
2227
+ * @see https://tailwindcss.com/docs/border-width
2228
+ */
2229
+ 'border-w-t': [{
2230
+ 'border-t': scaleBorderWidth()
2231
+ }],
2232
+ /**
2233
+ * Border Width Right
2234
+ * @see https://tailwindcss.com/docs/border-width
2235
+ */
2236
+ 'border-w-r': [{
2237
+ 'border-r': scaleBorderWidth()
2238
+ }],
2239
+ /**
2240
+ * Border Width Bottom
2241
+ * @see https://tailwindcss.com/docs/border-width
2242
+ */
2243
+ 'border-w-b': [{
2244
+ 'border-b': scaleBorderWidth()
2245
+ }],
2246
+ /**
2247
+ * Border Width Left
2248
+ * @see https://tailwindcss.com/docs/border-width
2249
+ */
2250
+ 'border-w-l': [{
2251
+ 'border-l': scaleBorderWidth()
2252
+ }],
2253
+ /**
2254
+ * Divide Width X
2255
+ * @see https://tailwindcss.com/docs/border-width#between-children
2256
+ */
2257
+ 'divide-x': [{
2258
+ 'divide-x': scaleBorderWidth()
2259
+ }],
2260
+ /**
2261
+ * Divide Width X Reverse
2262
+ * @see https://tailwindcss.com/docs/border-width#between-children
2263
+ */
2264
+ 'divide-x-reverse': ['divide-x-reverse'],
2265
+ /**
2266
+ * Divide Width Y
2267
+ * @see https://tailwindcss.com/docs/border-width#between-children
2268
+ */
2269
+ 'divide-y': [{
2270
+ 'divide-y': scaleBorderWidth()
2271
+ }],
2272
+ /**
2273
+ * Divide Width Y Reverse
2274
+ * @see https://tailwindcss.com/docs/border-width#between-children
2275
+ */
2276
+ 'divide-y-reverse': ['divide-y-reverse'],
2277
+ /**
2278
+ * Border Style
2279
+ * @see https://tailwindcss.com/docs/border-style
2280
+ */
2281
+ 'border-style': [{
2282
+ border: [...scaleLineStyle(), 'hidden', 'none']
2283
+ }],
2284
+ /**
2285
+ * Divide Style
2286
+ * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style
2287
+ */
2288
+ 'divide-style': [{
2289
+ divide: [...scaleLineStyle(), 'hidden', 'none']
2290
+ }],
2291
+ /**
2292
+ * Border Color
2293
+ * @see https://tailwindcss.com/docs/border-color
2294
+ */
2295
+ 'border-color': [{
2296
+ border: scaleColor()
2297
+ }],
2298
+ /**
2299
+ * Border Color X
2300
+ * @see https://tailwindcss.com/docs/border-color
2301
+ */
2302
+ 'border-color-x': [{
2303
+ 'border-x': scaleColor()
2304
+ }],
2305
+ /**
2306
+ * Border Color Y
2307
+ * @see https://tailwindcss.com/docs/border-color
2308
+ */
2309
+ 'border-color-y': [{
2310
+ 'border-y': scaleColor()
2311
+ }],
2312
+ /**
2313
+ * Border Color S
2314
+ * @see https://tailwindcss.com/docs/border-color
2315
+ */
2316
+ 'border-color-s': [{
2317
+ 'border-s': scaleColor()
2318
+ }],
2319
+ /**
2320
+ * Border Color E
2321
+ * @see https://tailwindcss.com/docs/border-color
2322
+ */
2323
+ 'border-color-e': [{
2324
+ 'border-e': scaleColor()
2325
+ }],
2326
+ /**
2327
+ * Border Color Top
2328
+ * @see https://tailwindcss.com/docs/border-color
2329
+ */
2330
+ 'border-color-t': [{
2331
+ 'border-t': scaleColor()
2332
+ }],
2333
+ /**
2334
+ * Border Color Right
2335
+ * @see https://tailwindcss.com/docs/border-color
2336
+ */
2337
+ 'border-color-r': [{
2338
+ 'border-r': scaleColor()
2339
+ }],
2340
+ /**
2341
+ * Border Color Bottom
2342
+ * @see https://tailwindcss.com/docs/border-color
2343
+ */
2344
+ 'border-color-b': [{
2345
+ 'border-b': scaleColor()
2346
+ }],
2347
+ /**
2348
+ * Border Color Left
2349
+ * @see https://tailwindcss.com/docs/border-color
2350
+ */
2351
+ 'border-color-l': [{
2352
+ 'border-l': scaleColor()
2353
+ }],
2354
+ /**
2355
+ * Divide Color
2356
+ * @see https://tailwindcss.com/docs/divide-color
2357
+ */
2358
+ 'divide-color': [{
2359
+ divide: scaleColor()
2360
+ }],
2361
+ /**
2362
+ * Outline Style
2363
+ * @see https://tailwindcss.com/docs/outline-style
2364
+ */
2365
+ 'outline-style': [{
2366
+ outline: [...scaleLineStyle(), 'none', 'hidden']
2367
+ }],
2368
+ /**
2369
+ * Outline Offset
2370
+ * @see https://tailwindcss.com/docs/outline-offset
2371
+ */
2372
+ 'outline-offset': [{
2373
+ 'outline-offset': [isNumber, isArbitraryVariable, isArbitraryValue]
2374
+ }],
2375
+ /**
2376
+ * Outline Width
2377
+ * @see https://tailwindcss.com/docs/outline-width
2378
+ */
2379
+ 'outline-w': [{
2380
+ outline: ['', isNumber, isArbitraryVariableLength, isArbitraryLength]
2381
+ }],
2382
+ /**
2383
+ * Outline Color
2384
+ * @see https://tailwindcss.com/docs/outline-color
2385
+ */
2386
+ 'outline-color': [{
2387
+ outline: [themeColor]
2388
+ }],
2389
+ // ---------------
2390
+ // --- Effects ---
2391
+ // ---------------
2392
+ /**
2393
+ * Box Shadow
2394
+ * @see https://tailwindcss.com/docs/box-shadow
2395
+ */
2396
+ shadow: [{
2397
+ shadow: [
2398
+ // Deprecated since Tailwind CSS v4.0.0
2399
+ '', 'none', themeShadow, isArbitraryVariableShadow, isArbitraryShadow]
2400
+ }],
2401
+ /**
2402
+ * Box Shadow Color
2403
+ * @see https://tailwindcss.com/docs/box-shadow#setting-the-shadow-color
2404
+ */
2405
+ 'shadow-color': [{
2406
+ shadow: scaleColor()
2407
+ }],
2408
+ /**
2409
+ * Inset Box Shadow
2410
+ * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow
2411
+ */
2412
+ 'inset-shadow': [{
2413
+ 'inset-shadow': ['none', isArbitraryVariable, isArbitraryValue, themeInsetShadow]
2414
+ }],
2415
+ /**
2416
+ * Inset Box Shadow Color
2417
+ * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color
2418
+ */
2419
+ 'inset-shadow-color': [{
2420
+ 'inset-shadow': scaleColor()
2421
+ }],
2422
+ /**
2423
+ * Ring Width
2424
+ * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring
2425
+ */
2426
+ 'ring-w': [{
2427
+ ring: scaleBorderWidth()
2428
+ }],
2429
+ /**
2430
+ * Ring Width Inset
2431
+ * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings
2432
+ * @deprecated since Tailwind CSS v4.0.0
2433
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
2434
+ */
2435
+ 'ring-w-inset': ['ring-inset'],
2436
+ /**
2437
+ * Ring Color
2438
+ * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color
2439
+ */
2440
+ 'ring-color': [{
2441
+ ring: scaleColor()
2442
+ }],
2443
+ /**
2444
+ * Ring Offset Width
2445
+ * @see https://v3.tailwindcss.com/docs/ring-offset-width
2446
+ * @deprecated since Tailwind CSS v4.0.0
2447
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
2448
+ */
2449
+ 'ring-offset-w': [{
2450
+ 'ring-offset': [isNumber, isArbitraryLength]
2451
+ }],
2452
+ /**
2453
+ * Ring Offset Color
2454
+ * @see https://v3.tailwindcss.com/docs/ring-offset-color
2455
+ * @deprecated since Tailwind CSS v4.0.0
2456
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
2457
+ */
2458
+ 'ring-offset-color': [{
2459
+ 'ring-offset': scaleColor()
2460
+ }],
2461
+ /**
2462
+ * Inset Ring Width
2463
+ * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring
2464
+ */
2465
+ 'inset-ring-w': [{
2466
+ 'inset-ring': scaleBorderWidth()
2467
+ }],
2468
+ /**
2469
+ * Inset Ring Color
2470
+ * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color
2471
+ */
2472
+ 'inset-ring-color': [{
2473
+ 'inset-ring': scaleColor()
2474
+ }],
2475
+ /**
2476
+ * Opacity
2477
+ * @see https://tailwindcss.com/docs/opacity
2478
+ */
2479
+ opacity: [{
2480
+ opacity: [isNumber, isArbitraryVariable, isArbitraryValue]
2481
+ }],
2482
+ /**
2483
+ * Mix Blend Mode
2484
+ * @see https://tailwindcss.com/docs/mix-blend-mode
2485
+ */
2486
+ 'mix-blend': [{
2487
+ 'mix-blend': [...scaleBlendMode(), 'plus-darker', 'plus-lighter']
2488
+ }],
2489
+ /**
2490
+ * Background Blend Mode
2491
+ * @see https://tailwindcss.com/docs/background-blend-mode
2492
+ */
2493
+ 'bg-blend': [{
2494
+ 'bg-blend': scaleBlendMode()
2495
+ }],
2496
+ // ---------------
2497
+ // --- Filters ---
2498
+ // ---------------
2499
+ /**
2500
+ * Filter
2501
+ * @see https://tailwindcss.com/docs/filter
2502
+ */
2503
+ filter: [{
2504
+ filter: [
2505
+ // Deprecated since Tailwind CSS v3.0.0
2506
+ '', 'none', isArbitraryVariable, isArbitraryValue]
2507
+ }],
2508
+ /**
2509
+ * Blur
2510
+ * @see https://tailwindcss.com/docs/blur
2511
+ */
2512
+ blur: [{
2513
+ blur: scaleBlur()
2514
+ }],
2515
+ /**
2516
+ * Brightness
2517
+ * @see https://tailwindcss.com/docs/brightness
2518
+ */
2519
+ brightness: [{
2520
+ brightness: [isNumber, isArbitraryVariable, isArbitraryValue]
2521
+ }],
2522
+ /**
2523
+ * Contrast
2524
+ * @see https://tailwindcss.com/docs/contrast
2525
+ */
2526
+ contrast: [{
2527
+ contrast: [isNumber, isArbitraryVariable, isArbitraryValue]
2528
+ }],
2529
+ /**
2530
+ * Drop Shadow
2531
+ * @see https://tailwindcss.com/docs/drop-shadow
2532
+ */
2533
+ 'drop-shadow': [{
2534
+ 'drop-shadow': [
2535
+ // Deprecated since Tailwind CSS v4.0.0
2536
+ '', 'none', themeDropShadow, isArbitraryVariable, isArbitraryValue]
2537
+ }],
2538
+ /**
2539
+ * Grayscale
2540
+ * @see https://tailwindcss.com/docs/grayscale
2541
+ */
2542
+ grayscale: [{
2543
+ grayscale: ['', isNumber, isArbitraryVariable, isArbitraryValue]
2544
+ }],
2545
+ /**
2546
+ * Hue Rotate
2547
+ * @see https://tailwindcss.com/docs/hue-rotate
2548
+ */
2549
+ 'hue-rotate': [{
2550
+ 'hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]
2551
+ }],
2552
+ /**
2553
+ * Invert
2554
+ * @see https://tailwindcss.com/docs/invert
2555
+ */
2556
+ invert: [{
2557
+ invert: ['', isNumber, isArbitraryVariable, isArbitraryValue]
2558
+ }],
2559
+ /**
2560
+ * Saturate
2561
+ * @see https://tailwindcss.com/docs/saturate
2562
+ */
2563
+ saturate: [{
2564
+ saturate: [isNumber, isArbitraryVariable, isArbitraryValue]
2565
+ }],
2566
+ /**
2567
+ * Sepia
2568
+ * @see https://tailwindcss.com/docs/sepia
2569
+ */
2570
+ sepia: [{
2571
+ sepia: ['', isNumber, isArbitraryVariable, isArbitraryValue]
2572
+ }],
2573
+ /**
2574
+ * Backdrop Filter
2575
+ * @see https://tailwindcss.com/docs/backdrop-filter
2576
+ */
2577
+ 'backdrop-filter': [{
2578
+ 'backdrop-filter': [
2579
+ // Deprecated since Tailwind CSS v3.0.0
2580
+ '', 'none', isArbitraryVariable, isArbitraryValue]
2581
+ }],
2582
+ /**
2583
+ * Backdrop Blur
2584
+ * @see https://tailwindcss.com/docs/backdrop-blur
2585
+ */
2586
+ 'backdrop-blur': [{
2587
+ 'backdrop-blur': scaleBlur()
2588
+ }],
2589
+ /**
2590
+ * Backdrop Brightness
2591
+ * @see https://tailwindcss.com/docs/backdrop-brightness
2592
+ */
2593
+ 'backdrop-brightness': [{
2594
+ 'backdrop-brightness': [isNumber, isArbitraryVariable, isArbitraryValue]
2595
+ }],
2596
+ /**
2597
+ * Backdrop Contrast
2598
+ * @see https://tailwindcss.com/docs/backdrop-contrast
2599
+ */
2600
+ 'backdrop-contrast': [{
2601
+ 'backdrop-contrast': [isNumber, isArbitraryVariable, isArbitraryValue]
2602
+ }],
2603
+ /**
2604
+ * Backdrop Grayscale
2605
+ * @see https://tailwindcss.com/docs/backdrop-grayscale
2606
+ */
2607
+ 'backdrop-grayscale': [{
2608
+ 'backdrop-grayscale': ['', isNumber, isArbitraryVariable, isArbitraryValue]
2609
+ }],
2610
+ /**
2611
+ * Backdrop Hue Rotate
2612
+ * @see https://tailwindcss.com/docs/backdrop-hue-rotate
2613
+ */
2614
+ 'backdrop-hue-rotate': [{
2615
+ 'backdrop-hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]
2616
+ }],
2617
+ /**
2618
+ * Backdrop Invert
2619
+ * @see https://tailwindcss.com/docs/backdrop-invert
2620
+ */
2621
+ 'backdrop-invert': [{
2622
+ 'backdrop-invert': ['', isNumber, isArbitraryVariable, isArbitraryValue]
2623
+ }],
2624
+ /**
2625
+ * Backdrop Opacity
2626
+ * @see https://tailwindcss.com/docs/backdrop-opacity
2627
+ */
2628
+ 'backdrop-opacity': [{
2629
+ 'backdrop-opacity': [isNumber, isArbitraryVariable, isArbitraryValue]
2630
+ }],
2631
+ /**
2632
+ * Backdrop Saturate
2633
+ * @see https://tailwindcss.com/docs/backdrop-saturate
2634
+ */
2635
+ 'backdrop-saturate': [{
2636
+ 'backdrop-saturate': [isNumber, isArbitraryVariable, isArbitraryValue]
2637
+ }],
2638
+ /**
2639
+ * Backdrop Sepia
2640
+ * @see https://tailwindcss.com/docs/backdrop-sepia
2641
+ */
2642
+ 'backdrop-sepia': [{
2643
+ 'backdrop-sepia': ['', isNumber, isArbitraryVariable, isArbitraryValue]
2644
+ }],
2645
+ // --------------
2646
+ // --- Tables ---
2647
+ // --------------
2648
+ /**
2649
+ * Border Collapse
2650
+ * @see https://tailwindcss.com/docs/border-collapse
2651
+ */
2652
+ 'border-collapse': [{
2653
+ border: ['collapse', 'separate']
2654
+ }],
2655
+ /**
2656
+ * Border Spacing
2657
+ * @see https://tailwindcss.com/docs/border-spacing
2658
+ */
2659
+ 'border-spacing': [{
2660
+ 'border-spacing': scaleUnambiguousSpacing()
2661
+ }],
2662
+ /**
2663
+ * Border Spacing X
2664
+ * @see https://tailwindcss.com/docs/border-spacing
2665
+ */
2666
+ 'border-spacing-x': [{
2667
+ 'border-spacing-x': scaleUnambiguousSpacing()
2668
+ }],
2669
+ /**
2670
+ * Border Spacing Y
2671
+ * @see https://tailwindcss.com/docs/border-spacing
2672
+ */
2673
+ 'border-spacing-y': [{
2674
+ 'border-spacing-y': scaleUnambiguousSpacing()
2675
+ }],
2676
+ /**
2677
+ * Table Layout
2678
+ * @see https://tailwindcss.com/docs/table-layout
2679
+ */
2680
+ 'table-layout': [{
2681
+ table: ['auto', 'fixed']
2682
+ }],
2683
+ /**
2684
+ * Caption Side
2685
+ * @see https://tailwindcss.com/docs/caption-side
2686
+ */
2687
+ caption: [{
2688
+ caption: ['top', 'bottom']
2689
+ }],
2690
+ // ---------------------------------
2691
+ // --- Transitions and Animation ---
2692
+ // ---------------------------------
2693
+ /**
2694
+ * Transition Property
2695
+ * @see https://tailwindcss.com/docs/transition-property
2696
+ */
2697
+ transition: [{
2698
+ transition: ['', 'all', 'colors', 'opacity', 'shadow', 'transform', 'none', isArbitraryVariable, isArbitraryValue]
2699
+ }],
2700
+ /**
2701
+ * Transition Behavior
2702
+ * @see https://tailwindcss.com/docs/transition-behavior
2703
+ */
2704
+ 'transition-behavior': [{
2705
+ transition: ['normal', 'discrete']
2706
+ }],
2707
+ /**
2708
+ * Transition Duration
2709
+ * @see https://tailwindcss.com/docs/transition-duration
2710
+ */
2711
+ duration: [{
2712
+ duration: [isNumber, 'initial', isArbitraryVariable, isArbitraryValue]
2713
+ }],
2714
+ /**
2715
+ * Transition Timing Function
2716
+ * @see https://tailwindcss.com/docs/transition-timing-function
2717
+ */
2718
+ ease: [{
2719
+ ease: ['linear', 'initial', themeEase, isArbitraryVariable, isArbitraryValue]
2720
+ }],
2721
+ /**
2722
+ * Transition Delay
2723
+ * @see https://tailwindcss.com/docs/transition-delay
2724
+ */
2725
+ delay: [{
2726
+ delay: [isNumber, isArbitraryVariable, isArbitraryValue]
2727
+ }],
2728
+ /**
2729
+ * Animation
2730
+ * @see https://tailwindcss.com/docs/animation
2731
+ */
2732
+ animate: [{
2733
+ animate: ['none', themeAnimate, isArbitraryVariable, isArbitraryValue]
2734
+ }],
2735
+ // ------------------
2736
+ // --- Transforms ---
2737
+ // ------------------
2738
+ /**
2739
+ * Backface Visibility
2740
+ * @see https://tailwindcss.com/docs/backface-visibility
2741
+ */
2742
+ backface: [{
2743
+ backface: ['hidden', 'visible']
2744
+ }],
2745
+ /**
2746
+ * Perspective
2747
+ * @see https://tailwindcss.com/docs/perspective
2748
+ */
2749
+ perspective: [{
2750
+ perspective: [themePerspective, isArbitraryVariable, isArbitraryValue]
2751
+ }],
2752
+ /**
2753
+ * Perspective Origin
2754
+ * @see https://tailwindcss.com/docs/perspective-origin
2755
+ */
2756
+ 'perspective-origin': [{
2757
+ 'perspective-origin': scaleOrigin()
2758
+ }],
2759
+ /**
2760
+ * Rotate
2761
+ * @see https://tailwindcss.com/docs/rotate
2762
+ */
2763
+ rotate: [{
2764
+ rotate: scaleRotate()
2765
+ }],
2766
+ /**
2767
+ * Rotate X
2768
+ * @see https://tailwindcss.com/docs/rotate
2769
+ */
2770
+ 'rotate-x': [{
2771
+ 'rotate-x': scaleRotate()
2772
+ }],
2773
+ /**
2774
+ * Rotate Y
2775
+ * @see https://tailwindcss.com/docs/rotate
2776
+ */
2777
+ 'rotate-y': [{
2778
+ 'rotate-y': scaleRotate()
2779
+ }],
2780
+ /**
2781
+ * Rotate Z
2782
+ * @see https://tailwindcss.com/docs/rotate
2783
+ */
2784
+ 'rotate-z': [{
2785
+ 'rotate-z': scaleRotate()
2786
+ }],
2787
+ /**
2788
+ * Scale
2789
+ * @see https://tailwindcss.com/docs/scale
2790
+ */
2791
+ scale: [{
2792
+ scale: scaleScale()
2793
+ }],
2794
+ /**
2795
+ * Scale X
2796
+ * @see https://tailwindcss.com/docs/scale
2797
+ */
2798
+ 'scale-x': [{
2799
+ 'scale-x': scaleScale()
2800
+ }],
2801
+ /**
2802
+ * Scale Y
2803
+ * @see https://tailwindcss.com/docs/scale
2804
+ */
2805
+ 'scale-y': [{
2806
+ 'scale-y': scaleScale()
2807
+ }],
2808
+ /**
2809
+ * Scale Z
2810
+ * @see https://tailwindcss.com/docs/scale
2811
+ */
2812
+ 'scale-z': [{
2813
+ 'scale-z': scaleScale()
2814
+ }],
2815
+ /**
2816
+ * Scale 3D
2817
+ * @see https://tailwindcss.com/docs/scale
2818
+ */
2819
+ 'scale-3d': ['scale-3d'],
2820
+ /**
2821
+ * Skew
2822
+ * @see https://tailwindcss.com/docs/skew
2823
+ */
2824
+ skew: [{
2825
+ skew: scaleSkew()
2826
+ }],
2827
+ /**
2828
+ * Skew X
2829
+ * @see https://tailwindcss.com/docs/skew
2830
+ */
2831
+ 'skew-x': [{
2832
+ 'skew-x': scaleSkew()
2833
+ }],
2834
+ /**
2835
+ * Skew Y
2836
+ * @see https://tailwindcss.com/docs/skew
2837
+ */
2838
+ 'skew-y': [{
2839
+ 'skew-y': scaleSkew()
2840
+ }],
2841
+ /**
2842
+ * Transform
2843
+ * @see https://tailwindcss.com/docs/transform
2844
+ */
2845
+ transform: [{
2846
+ transform: [isArbitraryVariable, isArbitraryValue, '', 'none', 'gpu', 'cpu']
2847
+ }],
2848
+ /**
2849
+ * Transform Origin
2850
+ * @see https://tailwindcss.com/docs/transform-origin
2851
+ */
2852
+ 'transform-origin': [{
2853
+ origin: scaleOrigin()
2854
+ }],
2855
+ /**
2856
+ * Transform Style
2857
+ * @see https://tailwindcss.com/docs/transform-style
2858
+ */
2859
+ 'transform-style': [{
2860
+ transform: ['3d', 'flat']
2861
+ }],
2862
+ /**
2863
+ * Translate
2864
+ * @see https://tailwindcss.com/docs/translate
2865
+ */
2866
+ translate: [{
2867
+ translate: scaleTranslate()
2868
+ }],
2869
+ /**
2870
+ * Translate X
2871
+ * @see https://tailwindcss.com/docs/translate
2872
+ */
2873
+ 'translate-x': [{
2874
+ 'translate-x': scaleTranslate()
2875
+ }],
2876
+ /**
2877
+ * Translate Y
2878
+ * @see https://tailwindcss.com/docs/translate
2879
+ */
2880
+ 'translate-y': [{
2881
+ 'translate-y': scaleTranslate()
2882
+ }],
2883
+ /**
2884
+ * Translate Z
2885
+ * @see https://tailwindcss.com/docs/translate
2886
+ */
2887
+ 'translate-z': [{
2888
+ 'translate-z': scaleTranslate()
2889
+ }],
2890
+ /**
2891
+ * Translate None
2892
+ * @see https://tailwindcss.com/docs/translate
2893
+ */
2894
+ 'translate-none': ['translate-none'],
2895
+ // ---------------------
2896
+ // --- Interactivity ---
2897
+ // ---------------------
2898
+ /**
2899
+ * Accent Color
2900
+ * @see https://tailwindcss.com/docs/accent-color
2901
+ */
2902
+ accent: [{
2903
+ accent: scaleColor()
2904
+ }],
2905
+ /**
2906
+ * Appearance
2907
+ * @see https://tailwindcss.com/docs/appearance
2908
+ */
2909
+ appearance: [{
2910
+ appearance: ['none', 'auto']
2911
+ }],
2912
+ /**
2913
+ * Caret Color
2914
+ * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
2915
+ */
2916
+ 'caret-color': [{
2917
+ caret: scaleColor()
2918
+ }],
2919
+ /**
2920
+ * Color Scheme
2921
+ * @see https://tailwindcss.com/docs/color-scheme
2922
+ */
2923
+ 'color-scheme': [{
2924
+ scheme: ['normal', 'dark', 'light', 'light-dark', 'only-dark', 'only-light']
2925
+ }],
2926
+ /**
2927
+ * Cursor
2928
+ * @see https://tailwindcss.com/docs/cursor
2929
+ */
2930
+ cursor: [{
2931
+ cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryVariable, isArbitraryValue]
2932
+ }],
2933
+ /**
2934
+ * Field Sizing
2935
+ * @see https://tailwindcss.com/docs/field-sizing
2936
+ */
2937
+ 'field-sizing': [{
2938
+ 'field-sizing': ['fixed', 'content']
2939
+ }],
2940
+ /**
2941
+ * Pointer Events
2942
+ * @see https://tailwindcss.com/docs/pointer-events
2943
+ */
2944
+ 'pointer-events': [{
2945
+ 'pointer-events': ['auto', 'none']
2946
+ }],
2947
+ /**
2948
+ * Resize
2949
+ * @see https://tailwindcss.com/docs/resize
2950
+ */
2951
+ resize: [{
2952
+ resize: ['none', '', 'y', 'x']
2953
+ }],
2954
+ /**
2955
+ * Scroll Behavior
2956
+ * @see https://tailwindcss.com/docs/scroll-behavior
2957
+ */
2958
+ 'scroll-behavior': [{
2959
+ scroll: ['auto', 'smooth']
2960
+ }],
2961
+ /**
2962
+ * Scroll Margin
2963
+ * @see https://tailwindcss.com/docs/scroll-margin
2964
+ */
2965
+ 'scroll-m': [{
2966
+ 'scroll-m': scaleUnambiguousSpacing()
2967
+ }],
2968
+ /**
2969
+ * Scroll Margin X
2970
+ * @see https://tailwindcss.com/docs/scroll-margin
2971
+ */
2972
+ 'scroll-mx': [{
2973
+ 'scroll-mx': scaleUnambiguousSpacing()
2974
+ }],
2975
+ /**
2976
+ * Scroll Margin Y
2977
+ * @see https://tailwindcss.com/docs/scroll-margin
2978
+ */
2979
+ 'scroll-my': [{
2980
+ 'scroll-my': scaleUnambiguousSpacing()
2981
+ }],
2982
+ /**
2983
+ * Scroll Margin Start
2984
+ * @see https://tailwindcss.com/docs/scroll-margin
2985
+ */
2986
+ 'scroll-ms': [{
2987
+ 'scroll-ms': scaleUnambiguousSpacing()
2988
+ }],
2989
+ /**
2990
+ * Scroll Margin End
2991
+ * @see https://tailwindcss.com/docs/scroll-margin
2992
+ */
2993
+ 'scroll-me': [{
2994
+ 'scroll-me': scaleUnambiguousSpacing()
2995
+ }],
2996
+ /**
2997
+ * Scroll Margin Top
2998
+ * @see https://tailwindcss.com/docs/scroll-margin
2999
+ */
3000
+ 'scroll-mt': [{
3001
+ 'scroll-mt': scaleUnambiguousSpacing()
3002
+ }],
3003
+ /**
3004
+ * Scroll Margin Right
3005
+ * @see https://tailwindcss.com/docs/scroll-margin
3006
+ */
3007
+ 'scroll-mr': [{
3008
+ 'scroll-mr': scaleUnambiguousSpacing()
3009
+ }],
3010
+ /**
3011
+ * Scroll Margin Bottom
3012
+ * @see https://tailwindcss.com/docs/scroll-margin
3013
+ */
3014
+ 'scroll-mb': [{
3015
+ 'scroll-mb': scaleUnambiguousSpacing()
3016
+ }],
3017
+ /**
3018
+ * Scroll Margin Left
3019
+ * @see https://tailwindcss.com/docs/scroll-margin
3020
+ */
3021
+ 'scroll-ml': [{
3022
+ 'scroll-ml': scaleUnambiguousSpacing()
3023
+ }],
3024
+ /**
3025
+ * Scroll Padding
3026
+ * @see https://tailwindcss.com/docs/scroll-padding
3027
+ */
3028
+ 'scroll-p': [{
3029
+ 'scroll-p': scaleUnambiguousSpacing()
3030
+ }],
3031
+ /**
3032
+ * Scroll Padding X
3033
+ * @see https://tailwindcss.com/docs/scroll-padding
3034
+ */
3035
+ 'scroll-px': [{
3036
+ 'scroll-px': scaleUnambiguousSpacing()
3037
+ }],
3038
+ /**
3039
+ * Scroll Padding Y
3040
+ * @see https://tailwindcss.com/docs/scroll-padding
3041
+ */
3042
+ 'scroll-py': [{
3043
+ 'scroll-py': scaleUnambiguousSpacing()
3044
+ }],
3045
+ /**
3046
+ * Scroll Padding Start
3047
+ * @see https://tailwindcss.com/docs/scroll-padding
3048
+ */
3049
+ 'scroll-ps': [{
3050
+ 'scroll-ps': scaleUnambiguousSpacing()
3051
+ }],
3052
+ /**
3053
+ * Scroll Padding End
3054
+ * @see https://tailwindcss.com/docs/scroll-padding
3055
+ */
3056
+ 'scroll-pe': [{
3057
+ 'scroll-pe': scaleUnambiguousSpacing()
3058
+ }],
3059
+ /**
3060
+ * Scroll Padding Top
3061
+ * @see https://tailwindcss.com/docs/scroll-padding
3062
+ */
3063
+ 'scroll-pt': [{
3064
+ 'scroll-pt': scaleUnambiguousSpacing()
3065
+ }],
3066
+ /**
3067
+ * Scroll Padding Right
3068
+ * @see https://tailwindcss.com/docs/scroll-padding
3069
+ */
3070
+ 'scroll-pr': [{
3071
+ 'scroll-pr': scaleUnambiguousSpacing()
3072
+ }],
3073
+ /**
3074
+ * Scroll Padding Bottom
3075
+ * @see https://tailwindcss.com/docs/scroll-padding
3076
+ */
3077
+ 'scroll-pb': [{
3078
+ 'scroll-pb': scaleUnambiguousSpacing()
3079
+ }],
3080
+ /**
3081
+ * Scroll Padding Left
3082
+ * @see https://tailwindcss.com/docs/scroll-padding
3083
+ */
3084
+ 'scroll-pl': [{
3085
+ 'scroll-pl': scaleUnambiguousSpacing()
3086
+ }],
3087
+ /**
3088
+ * Scroll Snap Align
3089
+ * @see https://tailwindcss.com/docs/scroll-snap-align
3090
+ */
3091
+ 'snap-align': [{
3092
+ snap: ['start', 'end', 'center', 'align-none']
3093
+ }],
3094
+ /**
3095
+ * Scroll Snap Stop
3096
+ * @see https://tailwindcss.com/docs/scroll-snap-stop
3097
+ */
3098
+ 'snap-stop': [{
3099
+ snap: ['normal', 'always']
3100
+ }],
3101
+ /**
3102
+ * Scroll Snap Type
3103
+ * @see https://tailwindcss.com/docs/scroll-snap-type
3104
+ */
3105
+ 'snap-type': [{
3106
+ snap: ['none', 'x', 'y', 'both']
3107
+ }],
3108
+ /**
3109
+ * Scroll Snap Type Strictness
3110
+ * @see https://tailwindcss.com/docs/scroll-snap-type
3111
+ */
3112
+ 'snap-strictness': [{
3113
+ snap: ['mandatory', 'proximity']
3114
+ }],
3115
+ /**
3116
+ * Touch Action
3117
+ * @see https://tailwindcss.com/docs/touch-action
3118
+ */
3119
+ touch: [{
3120
+ touch: ['auto', 'none', 'manipulation']
3121
+ }],
3122
+ /**
3123
+ * Touch Action X
3124
+ * @see https://tailwindcss.com/docs/touch-action
3125
+ */
3126
+ 'touch-x': [{
3127
+ 'touch-pan': ['x', 'left', 'right']
3128
+ }],
3129
+ /**
3130
+ * Touch Action Y
3131
+ * @see https://tailwindcss.com/docs/touch-action
3132
+ */
3133
+ 'touch-y': [{
3134
+ 'touch-pan': ['y', 'up', 'down']
3135
+ }],
3136
+ /**
3137
+ * Touch Action Pinch Zoom
3138
+ * @see https://tailwindcss.com/docs/touch-action
3139
+ */
3140
+ 'touch-pz': ['touch-pinch-zoom'],
3141
+ /**
3142
+ * User Select
3143
+ * @see https://tailwindcss.com/docs/user-select
3144
+ */
3145
+ select: [{
3146
+ select: ['none', 'text', 'all', 'auto']
3147
+ }],
3148
+ /**
3149
+ * Will Change
3150
+ * @see https://tailwindcss.com/docs/will-change
3151
+ */
3152
+ 'will-change': [{
3153
+ 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryVariable, isArbitraryValue]
3154
+ }],
3155
+ // -----------
3156
+ // --- SVG ---
3157
+ // -----------
3158
+ /**
3159
+ * Fill
3160
+ * @see https://tailwindcss.com/docs/fill
3161
+ */
3162
+ fill: [{
3163
+ fill: ['none', ...scaleColor()]
3164
+ }],
3165
+ /**
3166
+ * Stroke Width
3167
+ * @see https://tailwindcss.com/docs/stroke-width
3168
+ */
3169
+ 'stroke-w': [{
3170
+ stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber]
3171
+ }],
3172
+ /**
3173
+ * Stroke
3174
+ * @see https://tailwindcss.com/docs/stroke
3175
+ */
3176
+ stroke: [{
3177
+ stroke: ['none', ...scaleColor()]
3178
+ }],
3179
+ // ---------------------
3180
+ // --- Accessibility ---
3181
+ // ---------------------
3182
+ /**
3183
+ * Forced Color Adjust
3184
+ * @see https://tailwindcss.com/docs/forced-color-adjust
3185
+ */
3186
+ 'forced-color-adjust': [{
3187
+ 'forced-color-adjust': ['auto', 'none']
3188
+ }]
3189
+ },
3190
+ conflictingClassGroups: {
3191
+ overflow: ['overflow-x', 'overflow-y'],
3192
+ overscroll: ['overscroll-x', 'overscroll-y'],
3193
+ inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],
3194
+ 'inset-x': ['right', 'left'],
3195
+ 'inset-y': ['top', 'bottom'],
3196
+ flex: ['basis', 'grow', 'shrink'],
3197
+ gap: ['gap-x', 'gap-y'],
3198
+ p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],
3199
+ px: ['pr', 'pl'],
3200
+ py: ['pt', 'pb'],
3201
+ m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],
3202
+ mx: ['mr', 'ml'],
3203
+ my: ['mt', 'mb'],
3204
+ size: ['w', 'h'],
3205
+ 'font-size': ['leading'],
3206
+ 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],
3207
+ 'fvn-ordinal': ['fvn-normal'],
3208
+ 'fvn-slashed-zero': ['fvn-normal'],
3209
+ 'fvn-figure': ['fvn-normal'],
3210
+ 'fvn-spacing': ['fvn-normal'],
3211
+ 'fvn-fraction': ['fvn-normal'],
3212
+ 'line-clamp': ['display', 'overflow'],
3213
+ rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'],
3214
+ 'rounded-s': ['rounded-ss', 'rounded-es'],
3215
+ 'rounded-e': ['rounded-se', 'rounded-ee'],
3216
+ 'rounded-t': ['rounded-tl', 'rounded-tr'],
3217
+ 'rounded-r': ['rounded-tr', 'rounded-br'],
3218
+ 'rounded-b': ['rounded-br', 'rounded-bl'],
3219
+ 'rounded-l': ['rounded-tl', 'rounded-bl'],
3220
+ 'border-spacing': ['border-spacing-x', 'border-spacing-y'],
3221
+ 'border-w': ['border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],
3222
+ 'border-w-x': ['border-w-r', 'border-w-l'],
3223
+ 'border-w-y': ['border-w-t', 'border-w-b'],
3224
+ 'border-color': ['border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],
3225
+ 'border-color-x': ['border-color-r', 'border-color-l'],
3226
+ 'border-color-y': ['border-color-t', 'border-color-b'],
3227
+ translate: ['translate-x', 'translate-y', 'translate-none'],
3228
+ 'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'],
3229
+ 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],
3230
+ 'scroll-mx': ['scroll-mr', 'scroll-ml'],
3231
+ 'scroll-my': ['scroll-mt', 'scroll-mb'],
3232
+ 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],
3233
+ 'scroll-px': ['scroll-pr', 'scroll-pl'],
3234
+ 'scroll-py': ['scroll-pt', 'scroll-pb'],
3235
+ touch: ['touch-x', 'touch-y', 'touch-pz'],
3236
+ 'touch-x': ['touch'],
3237
+ 'touch-y': ['touch'],
3238
+ 'touch-pz': ['touch']
3239
+ },
3240
+ conflictingClassGroupModifiers: {
3241
+ 'font-size': ['leading']
3242
+ },
3243
+ orderSensitiveModifiers: ['before', 'after', 'placeholder', 'file', 'marker', 'selection', 'first-line', 'first-letter', 'backdrop', '*', '**']
3244
+ };
3245
+ };
3246
+ const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);
3247
+
3248
+ class ComponentTheme {
3249
+ constructor(tag, base, subThemes, defaults = {}) {
3250
+ this.tag = tag;
3251
+ this.base = base;
3252
+ this.defaults = defaults;
3253
+ const defaultInternalThemes = {
3254
+ layout: {
3255
+ hide: new HideTheme(),
3256
+ items: new ItemsTheme(),
3257
+ justify: new JustifyTheme(),
3258
+ position: new PositionTheme(),
3259
+ display: new DisplayTheme()
3260
+ },
3261
+ typography: {
3262
+ fontFamily: new FontFamilyTheme(),
3263
+ fontWeight: new FontWeightTheme(),
3264
+ fontStyle: new FontStyleTheme(),
3265
+ textDecoration: new TextDecorationTheme(),
3266
+ textTransform: new TextTransformTheme(),
3267
+ textAlign: new TextAlignTheme()
3268
+ }
3269
+ };
3270
+ this.themes = deepMerge(defaultInternalThemes, subThemes);
3271
+ }
3272
+ getClasses(props, defaults = this.defaults) {
3273
+ const user = props;
3274
+ const defs = defaults;
3275
+ const classes = [];
3276
+ if (this.base) {
3277
+ classes.push(...this.base.split(/\s+/));
3278
+ }
3279
+ const walk = (map) => {
3280
+ for (const key of Object.keys(map)) {
3281
+ const node = map[key];
3282
+ if (node instanceof BaseTheme) {
3283
+ classes.push(...node.getClasses(user, defs));
3284
+ }
3285
+ else if (node && typeof node === "object" && !Array.isArray(node)) {
3286
+ walk(node);
3287
+ }
3288
+ }
3289
+ };
3290
+ walk(this.themes);
3291
+ return classes.filter(Boolean);
3292
+ }
3293
+ getComponentConfig(props, propsToOmit = []) {
3294
+ var _a;
3295
+ const cleanProps = { ...props };
3296
+ for (const k of propsToOmit) {
3297
+ delete cleanProps[k];
3298
+ }
3299
+ const { className, tag, ...other } = cleanProps;
3300
+ const componentTag = (_a = tag !== null && tag !== void 0 ? tag : this.tag) !== null && _a !== void 0 ? _a : "div";
3301
+ const themeGeneratedClasses = this.getClasses(props);
3302
+ const finalClasses = twMerge(...themeGeneratedClasses, className);
3303
+ return {
3304
+ Tag: componentTag,
3305
+ finalClasses,
3306
+ finalProps: other,
3307
+ };
3308
+ }
3309
+ }
3310
+
3311
+ class SizeTheme extends BaseTheme {
3312
+ constructor(initial) {
3313
+ super();
3314
+ SIZE_KEYS.forEach((key) => {
3315
+ var _a;
3316
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : SizeTheme.defaultClasses[key];
3317
+ });
3318
+ }
3319
+ getClasses(props, defaults) {
3320
+ const size = pickFirstTruthyKey(props, defaults, SIZE_KEYS);
3321
+ return [this[size !== null && size !== void 0 ? size : 'md'] || ''];
3322
+ }
3323
+ }
3324
+ SizeTheme.defaultClasses = {
3325
+ xs: '',
3326
+ sm: '',
3327
+ md: '',
3328
+ lg: '',
3329
+ xl: ''
3330
+ };
3331
+
3332
+ class GapTheme extends BaseTheme {
3333
+ constructor(initial) {
3334
+ super();
3335
+ GAP_KEYS.forEach((key) => {
3336
+ var _a;
3337
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : GapTheme.defaultClasses[key];
3338
+ });
3339
+ }
3340
+ getClasses(props, defaults) {
3341
+ const size = pickFirstTruthyKey(props, defaults, SIZE_KEYS) || 'md';
3342
+ const key = pickFirstTruthyKey(props, defaults, GAP_KEYS) || 'noGap';
3343
+ return [typeof this[key] === 'string' ? this[key] : this[key][size]];
3344
+ }
3345
+ }
3346
+ GapTheme.defaultClasses = {
3347
+ gap: {
3348
+ xs: 'gap-2',
3349
+ sm: 'gap-3',
3350
+ md: 'gap-4',
3351
+ lg: 'gap-5',
3352
+ xl: 'gap-6',
3353
+ },
3354
+ noGap: "gap-0"
3355
+ };
3356
+
3357
+ class RadiusTheme extends BaseTheme {
3358
+ constructor(initial) {
3359
+ super();
3360
+ SHAPE_KEYS.forEach((key) => {
3361
+ var _a;
3362
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : RadiusTheme.defaultClasses[key];
3363
+ });
3364
+ }
3365
+ getClasses(props, defaults) {
3366
+ const size = pickFirstTruthyKey(props, defaults, SIZE_KEYS) || 'md';
3367
+ const shape = pickFirstTruthyKey(props, defaults, SHAPE_KEYS) || 'rounded';
3368
+ return [typeof this[shape] === 'string' ? this[shape] : this[shape][size]];
3369
+ }
3370
+ }
3371
+ RadiusTheme.defaultClasses = {
3372
+ pill: "rounded-full",
3373
+ sharp: "rounded-none",
3374
+ rounded: {
3375
+ xs: "rounded-sm",
3376
+ sm: "rounded-md",
3377
+ md: "rounded-lg",
3378
+ lg: "rounded-xl",
3379
+ xl: "rounded-2xl",
3380
+ }
3381
+ };
3382
+
3383
+ class ShadowTheme extends BaseTheme {
3384
+ constructor(initial) {
3385
+ super();
3386
+ SHADOW_KEYS.forEach((key) => {
3387
+ var _a;
3388
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : ShadowTheme.defaultClasses[key];
3389
+ });
3390
+ }
3391
+ getClasses(props, defaults) {
3392
+ const size = pickFirstTruthyKey(props, defaults, SIZE_KEYS) || 'md';
3393
+ const key = pickFirstTruthyKey(props, defaults, SHADOW_KEYS);
3394
+ if (key === undefined) {
3395
+ return [];
3396
+ }
3397
+ const isModeStringMap = MODE_KEYS.every(m => typeof this[key][m] === "string");
3398
+ return MODE_KEYS.map(mode => isModeStringMap
3399
+ ? this[key][mode]
3400
+ : this[key][mode][size]);
3401
+ }
3402
+ }
3403
+ ShadowTheme.defaultClasses = {
3404
+ shadow: {
3405
+ base: {
3406
+ xs: "shadow-2xs",
3407
+ sm: "shadow-xs",
3408
+ md: "shadow-sm",
3409
+ lg: "shadow-md",
3410
+ xl: "shadow-lg"
3411
+ },
3412
+ hover: {
3413
+ xs: "hover:shadow-xs",
3414
+ sm: "hover:shadow-sm",
3415
+ md: "hover:shadow-md",
3416
+ lg: "hover:shadow-lg",
3417
+ xl: "hover:shadow-xl"
3418
+ },
3419
+ active: {
3420
+ xs: "active:shadow-xs",
3421
+ sm: "active:shadow-sm",
3422
+ md: "active:shadow-md",
3423
+ lg: "active:shadow-lg",
3424
+ xl: "active:shadow-xl"
3425
+ },
3426
+ },
3427
+ noShadow: {
3428
+ base: "shadow-none",
3429
+ hover: "hover:shadow-none",
3430
+ active: "active:shadow-none",
3431
+ }
3432
+ };
3433
+
3434
+ class BorderTheme extends BaseTheme {
3435
+ constructor(initial) {
3436
+ super();
3437
+ BORDER_KEYS.forEach((key) => {
3438
+ this[key] = {
3439
+ ...BorderTheme.defaultClasses[key],
3440
+ ...((initial === null || initial === void 0 ? void 0 : initial[key]) || {}),
3441
+ };
3442
+ });
3443
+ }
3444
+ getClasses(props, defaults) {
3445
+ const key = pickFirstTruthyKey(props, defaults, BORDER_KEYS);
3446
+ if (!key || !this[key]) {
3447
+ return MODE_KEYS.map(() => '');
3448
+ }
3449
+ return MODE_KEYS.map(mode => this[key][mode] || '');
3450
+ }
3451
+ }
3452
+ BorderTheme.defaultClasses = {
3453
+ border: {
3454
+ base: "border",
3455
+ hover: "hover:border",
3456
+ active: "active:border",
3457
+ },
3458
+ noBorder: {
3459
+ base: "",
3460
+ hover: "",
3461
+ active: "",
3462
+ },
3463
+ //noBorder: {
3464
+ // base: "border-none",
3465
+ // hover: "hover:border-none",
3466
+ // active: "active:border-none",
3467
+ //},
3468
+ };
3469
+
3470
+ class RingTheme extends BaseTheme {
3471
+ constructor(initial) {
3472
+ super();
3473
+ RING_KEYS.forEach((key) => {
3474
+ this[key] = {
3475
+ ...RingTheme.defaultClasses[key],
3476
+ ...((initial === null || initial === void 0 ? void 0 : initial[key]) || {}),
3477
+ };
3478
+ });
3479
+ }
3480
+ getClasses(props, defaults) {
3481
+ const key = pickFirstTruthyKey(props, defaults, RING_KEYS);
3482
+ if (!key || !this[key]) {
3483
+ return MODE_KEYS.map(() => '');
3484
+ }
3485
+ return MODE_KEYS.map(mode => this[key][mode] || '');
3486
+ }
3487
+ }
3488
+ RingTheme.defaultClasses = {
3489
+ ring: {
3490
+ base: "ring ring-inset",
3491
+ hover: "hover:ring hover:ring-inset",
3492
+ active: "active:ring active:ring-inset",
3493
+ },
3494
+ noRing: {
3495
+ base: "ring-0",
3496
+ hover: "hover:ring-0",
3497
+ active: "active:ring-0",
3498
+ },
3499
+ };
3500
+
3501
+ class PxTheme extends BaseTheme {
3502
+ constructor(initial) {
3503
+ super();
3504
+ PADDING_KEYS.forEach((key) => {
3505
+ var _a;
3506
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : PxTheme.defaultClasses[key];
3507
+ });
3508
+ }
3509
+ getClasses(props, defaults) {
3510
+ const size = pickFirstTruthyKey(props, defaults, SIZE_KEYS) || 'md';
3511
+ const key = pickFirstTruthyKey(props, defaults, PADDING_KEYS) || 'noPadding';
3512
+ return [typeof this[key] === 'string' ? this[key] : this[key][size]];
3513
+ }
3514
+ }
3515
+ PxTheme.defaultClasses = {
3516
+ padding: {
3517
+ xs: "px-2",
3518
+ sm: "px-4",
3519
+ md: "px-6",
3520
+ lg: "px-8",
3521
+ xl: "px-10"
3522
+ },
3523
+ noPadding: "px-0"
3524
+ };
3525
+
3526
+ class PyTheme extends BaseTheme {
3527
+ constructor(initial) {
3528
+ super();
3529
+ PADDING_KEYS.forEach((key) => {
3530
+ var _a;
3531
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : PyTheme.defaultClasses[key];
3532
+ });
3533
+ }
3534
+ getClasses(props, defaults) {
3535
+ const size = pickFirstTruthyKey(props, defaults, SIZE_KEYS) || 'md';
3536
+ const key = pickFirstTruthyKey(props, defaults, PADDING_KEYS) || 'noPadding';
3537
+ return [typeof this[key] === 'string' ? this[key] : this[key][size]];
3538
+ }
3539
+ }
3540
+ PyTheme.defaultClasses = {
3541
+ padding: {
3542
+ xs: "py-2",
3543
+ sm: "py-4",
3544
+ md: "py-6",
3545
+ lg: "py-8",
3546
+ xl: "py-10"
3547
+ },
3548
+ noPadding: "py-0"
3549
+ };
3550
+
3551
+ // Text appearance classes for filled buttons (all white text)
3552
+ const filledTextAppearanceClasses = {
3553
+ default: "text-white",
3554
+ primary: "text-white",
3555
+ secondary: "text-white",
3556
+ tertiary: "text-white",
3557
+ muted: "text-white",
3558
+ link: "text-white",
3559
+ accent: "text-white",
3560
+ success: "text-white",
3561
+ danger: "text-white",
3562
+ warning: "text-white",
3563
+ info: "text-white",
3564
+ transparent: "text-transparent",
3565
+ };
3566
+ // Default text appearance classes (for non-button components)
3567
+ const textAppearanceClasses = {
3568
+ default: "text-(--text-color-default)",
3569
+ primary: "text-(--text-color-primary)",
3570
+ secondary: "text-(--text-color-secondary)",
3571
+ tertiary: "text-(--text-color-tertiary)",
3572
+ muted: "text-(--text-color-muted)",
3573
+ link: "text-(--text-color-link)",
3574
+ accent: "text-(--text-color-accent)",
3575
+ success: "text-(--text-color-success)",
3576
+ danger: "text-(--text-color-danger)",
3577
+ warning: "text-(--text-color-warning)",
3578
+ info: "text-(--text-color-info)",
3579
+ transparent: "text-transparent",
3580
+ };
3581
+ // Text size classes
3582
+ const textSizeClasses = {
3583
+ xs: "text-xs",
3584
+ sm: "text-sm",
3585
+ md: "text-base",
3586
+ lg: "text-lg",
3587
+ xl: "text-xl",
3588
+ };
3589
+
3590
+ class TextAppearanceTheme extends BaseTheme {
3591
+ constructor(initialOverrides) {
3592
+ super();
3593
+ TEXT_APPEARANCE_KEYS.forEach((textKey) => {
3594
+ const defaultModesForKey = TextAppearanceTheme.defaultFullConfig[textKey];
3595
+ const overrideModesForKey = initialOverrides === null || initialOverrides === void 0 ? void 0 : initialOverrides[textKey];
3596
+ this[textKey] = {
3597
+ ...defaultModesForKey,
3598
+ ...(overrideModesForKey || {}),
3599
+ };
3600
+ });
3601
+ }
3602
+ getClasses(props, defaults) {
3603
+ const pickedAppearanceKey = pickFirstTruthyKey(props, defaults, TEXT_APPEARANCE_KEYS) || 'default';
3604
+ const modesForAppearance = this[pickedAppearanceKey];
3605
+ if (!modesForAppearance) {
3606
+ return MODE_KEYS.map(() => '');
3607
+ }
3608
+ return MODE_KEYS.map(mode => modesForAppearance[mode] || '');
3609
+ }
3610
+ static createDefaultStyle(src = {}) {
3611
+ const initialOverridesForConstructor = {};
3612
+ TEXT_APPEARANCE_KEYS.forEach((textKey) => {
3613
+ const modesForCurrentTextKey = {};
3614
+ let keyHasDataInSrc = false;
3615
+ MODE_KEYS.forEach((modeKey) => {
3616
+ var _a;
3617
+ const classValue = (_a = src[modeKey]) === null || _a === void 0 ? void 0 : _a[textKey];
3618
+ if (classValue !== undefined) {
3619
+ modesForCurrentTextKey[modeKey] = classValue;
3620
+ keyHasDataInSrc = true;
3621
+ }
3622
+ });
3623
+ if (keyHasDataInSrc) {
3624
+ initialOverridesForConstructor[textKey] = modesForCurrentTextKey;
3625
+ }
3626
+ });
3627
+ return new TextAppearanceTheme(initialOverridesForConstructor);
3628
+ }
3629
+ }
3630
+ TextAppearanceTheme.defaultFullConfig = (() => {
3631
+ const config = {};
3632
+ TEXT_APPEARANCE_KEYS.forEach((key) => {
3633
+ config[key] = {
3634
+ base: textAppearanceClasses[key] || '',
3635
+ hover: '',
3636
+ active: '',
3637
+ };
3638
+ });
3639
+ return config;
3640
+ })();
3641
+
3642
+ // Background classes for filled buttons
3643
+ const filledBackgroundAppearanceClasses = {
3644
+ default: "bg-(--filled-background-color-default)",
3645
+ primary: "bg-(--filled-background-color-primary)",
3646
+ secondary: "bg-(--filled-background-color-secondary)",
3647
+ tertiary: "bg-(--filled-background-color-tertiary)",
3648
+ accent: "bg-(--filled-background-color-accent)",
3649
+ success: "bg-(--filled-background-color-success)",
3650
+ danger: "bg-(--filled-background-color-danger)",
3651
+ warning: "bg-(--filled-background-color-warning)",
3652
+ info: "bg-(--filled-background-color-info)",
3653
+ transparent: "bg-transparent",
3654
+ muted: "bg-(--filled-background-color-muted)",
3655
+ link: "bg-(--filled-background-color-link)",
3656
+ };
3657
+ // Hover background classes for filled buttons
3658
+ const filledHoverBackgroundAppearanceClasses = {
3659
+ default: "hover:bg-(--filled-background-color-hover-default)",
3660
+ primary: "hover:bg-(--filled-background-color-hover-primary)",
3661
+ secondary: "hover:bg-(--filled-background-color-hover-secondary)",
3662
+ tertiary: "hover:bg-(--filled-background-color-hover-tertiary)",
3663
+ accent: "hover:bg-(--filled-background-color-hover-accent)",
3664
+ success: "hover:bg-(--filled-background-color-hover-success)",
3665
+ danger: "hover:bg-(--filled-background-color-hover-danger)",
3666
+ warning: "hover:bg-(--filled-background-color-hover-warning)",
3667
+ info: "hover:bg-(--filled-background-color-hover-info)",
3668
+ transparent: "hover:bg-transparent",
3669
+ muted: "hover:bg-(--filled-background-color-hover-muted)",
3670
+ link: "hover:bg-(--filled-background-color-hover-link)",
3671
+ };
3672
+ // Active background classes for filled buttons
3673
+ const filledActiveBackgroundAppearanceClasses = {
3674
+ default: "active:bg-(--filled-background-color-active-default)",
3675
+ primary: "active:bg-(--filled-background-color-active-primary)",
3676
+ secondary: "active:bg-(--filled-background-color-active-secondary)",
3677
+ tertiary: "active:bg-(--filled-background-color-active-tertiary)",
3678
+ accent: "active:bg-(--filled-background-color-active-accent)",
3679
+ success: "active:bg-(--filled-background-color-active-success)",
3680
+ danger: "active:bg-(--filled-background-color-active-danger)",
3681
+ warning: "active:bg-(--filled-background-color-active-warning)",
3682
+ info: "active:bg-(--filled-background-color-active-info)",
3683
+ transparent: "active:bg-transparent",
3684
+ muted: "active:bg-(--filled-background-color-active-muted)",
3685
+ link: "active:bg-(--filled-background-color-active-link)",
3686
+ };
3687
+ // Default background appearance classes (for non-button components)
3688
+ const backgroundAppearanceClasses = {
3689
+ default: "bg-(--background-color-default)",
3690
+ primary: "bg-(--background-color-primary)",
3691
+ secondary: "bg-(--background-color-secondary)",
3692
+ tertiary: "bg-(--background-color-tertiary)",
3693
+ accent: "bg-(--background-color-accent)",
3694
+ success: "bg-(--background-color-success)",
3695
+ danger: "bg-(--background-color-danger)",
3696
+ warning: "bg-(--background-color-warning)",
3697
+ info: "bg-(--background-color-info)",
3698
+ transparent: "bg-transparent",
3699
+ muted: "bg-(--background-color-muted)",
3700
+ link: "bg-(--background-color-link)",
3701
+ };
3702
+ // Hover background appearance classes for outline buttons
3703
+ const hoverBackgroundAppearanceClasses = {
3704
+ default: "hover:bg-(--background-color-hover-default)",
3705
+ primary: "hover:bg-(--background-color-hover-primary)",
3706
+ secondary: "hover:bg-(--background-color-hover-secondary)",
3707
+ tertiary: "hover:bg-(--background-color-hover-tertiary)",
3708
+ accent: "hover:bg-(--background-color-hover-accent)",
3709
+ success: "hover:bg-(--background-color-hover-success)",
3710
+ danger: "hover:bg-(--background-color-hover-danger)",
3711
+ warning: "hover:bg-(--background-color-hover-warning)",
3712
+ info: "hover:bg-(--background-color-hover-info)",
3713
+ transparent: "hover:bg-transparent",
3714
+ muted: "hover:bg-(--background-color-hover-muted)",
3715
+ link: "hover:bg-(--background-color-hover-link)",
3716
+ };
3717
+ // Active background appearance classes for outline buttons
3718
+ const activeBackgroundAppearanceClasses = {
3719
+ default: "active:bg-(--background-color-active-default)",
3720
+ primary: "active:bg-(--background-color-active-primary)",
3721
+ secondary: "active:bg-(--background-color-active-secondary)",
3722
+ tertiary: "active:bg-(--background-color-active-tertiary)",
3723
+ accent: "active:bg-(--background-color-active-accent)",
3724
+ success: "active:bg-(--background-color-active-success)",
3725
+ danger: "active:bg-(--background-color-active-danger)",
3726
+ warning: "active:bg-(--background-color-active-warning)",
3727
+ info: "active:bg-(--background-color-active-info)",
3728
+ transparent: "active:bg-transparent",
3729
+ muted: "active:bg-(--background-color-active-muted)",
3730
+ link: "active:bg-(--background-color-active-link)",
3731
+ };
3732
+ const layoutBackgroundAppearanceClasses = {
3733
+ default: "bg-(--layout-background-default)",
3734
+ primary: "bg-(--layout-background-primary)",
3735
+ secondary: "bg-(--layout-background-secondary)",
3736
+ tertiary: "bg-(--layout-background-tertiary)",
3737
+ accent: "bg-(--layout-background-accent)",
3738
+ success: "bg-(--layout-background-success)",
3739
+ danger: "bg-(--layout-background-danger)",
3740
+ warning: "bg-(--layout-background-warning)",
3741
+ info: "bg-(--layout-background-info)",
3742
+ transparent: "bg-transparent",
3743
+ };
3744
+ const bgBorderAppearanceClasses = {
3745
+ default: "bg-(--border-color-default)",
3746
+ primary: "bg-(--border-color-primary)",
3747
+ secondary: "bg-(--border-color-secondary)",
3748
+ tertiary: "bg-(--border-color-tertiary)",
3749
+ accent: "bg-(--border-color-accent)",
3750
+ success: "bg-(--border-color-success)",
3751
+ danger: "bg-(--border-color-danger)",
3752
+ warning: "bg-(--border-color-warning)",
3753
+ info: "bg-(--border-color-info)",
3754
+ transparent: "bg-transparent",
3755
+ muted: "bg-(--border-color-muted)",
3756
+ link: "bg-(--border-color-link)",
3757
+ };
3758
+ const borderAppearanceClasses = {
3759
+ default: "border-(--border-color-default)",
3760
+ primary: "border-(--border-color-primary)",
3761
+ secondary: "border-(--border-color-secondary)",
3762
+ tertiary: "border-(--border-color-tertiary)",
3763
+ accent: "border-(--border-color-accent)",
3764
+ success: "border-(--border-color-success)",
3765
+ danger: "border-(--border-color-danger)",
3766
+ warning: "border-(--border-color-warning)",
3767
+ info: "border-(--border-color-info)",
3768
+ transparent: "border-transparent",
3769
+ muted: "border-(--border-color-muted)",
3770
+ link: "border-(--border-color-link)",
3771
+ };
3772
+ // Border classes for filled elements
3773
+ const filledBorderAppearanceClasses = {
3774
+ default: "border-(--filled-border-color-default)",
3775
+ primary: "border-(--filled-border-color-primary)",
3776
+ secondary: "border-(--filled-border-color-secondary)",
3777
+ tertiary: "border-(--filled-border-color-tertiary)",
3778
+ accent: "border-(--filled-border-color-accent)",
3779
+ success: "border-(--filled-border-color-success)",
3780
+ danger: "border-(--filled-border-color-danger)",
3781
+ warning: "border-(--filled-border-color-warning)",
3782
+ info: "border-(--filled-border-color-info)",
3783
+ transparent: "border-transparent",
3784
+ muted: "border-(--filled-border-color-muted)",
3785
+ link: "border-(--filled-border-color-link)",
3786
+ };
3787
+ const ringAppearanceClasses = {
3788
+ default: "ring-(--border-color-default)",
3789
+ primary: "ring-(--border-color-primary)",
3790
+ secondary: "ring-(--border-color-secondary)",
3791
+ tertiary: "ring-(--border-color-tertiary)",
3792
+ accent: "ring-(--border-color-accent)",
3793
+ success: "ring-(--border-color-success)",
3794
+ danger: "ring-(--border-color-danger)",
3795
+ warning: "ring-(--border-color-warning)",
3796
+ info: "ring-(--border-color-info)",
3797
+ transparent: "ring-transparent",
3798
+ muted: "ring-(--border-color-muted)",
3799
+ link: "ring-(--border-color-link)",
3800
+ };
3801
+ // Ring classes for filled elements
3802
+ const filledRingAppearanceClasses = {
3803
+ default: "ring-(--filled-border-color-default)",
3804
+ primary: "ring-(--filled-border-color-primary)",
3805
+ secondary: "ring-(--filled-border-color-secondary)",
3806
+ tertiary: "ring-(--filled-border-color-tertiary)",
3807
+ accent: "ring-(--filled-border-color-accent)",
3808
+ success: "ring-(--filled-border-color-success)",
3809
+ danger: "ring-(--filled-border-color-danger)",
3810
+ warning: "ring-(--filled-border-color-warning)",
3811
+ info: "ring-(--filled-border-color-info)",
3812
+ transparent: "ring-transparent",
3813
+ muted: "ring-(--filled-border-color-muted)",
3814
+ link: "ring-(--filled-border-color-link)",
3815
+ };
3816
+
3817
+ class VariantTheme extends BaseTheme {
3818
+ constructor(variantInstances = VariantTheme.defaultInstances) {
3819
+ super();
3820
+ VARIANT_KEYS.forEach((variantKey) => {
3821
+ this[variantKey] = variantInstances[variantKey] || VariantTheme.defaultInstances[variantKey];
3822
+ });
3823
+ }
3824
+ getClasses(props, defaults) {
3825
+ const activeVariantKey = pickFirstTruthyKey(props, defaults, VARIANT_KEYS) || 'outline';
3826
+ const activeTextAppearanceTheme = this[activeVariantKey];
3827
+ if (!activeTextAppearanceTheme) {
3828
+ return [];
3829
+ }
3830
+ return activeTextAppearanceTheme.getClasses(props, defaults);
3831
+ }
3832
+ static createDefault(initialInstances) {
3833
+ const fullInitialInstances = {
3834
+ ...VariantTheme.defaultInstances,
3835
+ ...(initialInstances || {})
3836
+ };
3837
+ return new VariantTheme(fullInitialInstances);
3838
+ }
3839
+ static createDefaultBackground() {
3840
+ return this.createDefault({
3841
+ outline: TextAppearanceTheme.createDefaultStyle({
3842
+ base: backgroundAppearanceClasses,
3843
+ hover: hoverBackgroundAppearanceClasses,
3844
+ active: activeBackgroundAppearanceClasses
3845
+ }),
3846
+ filled: TextAppearanceTheme.createDefaultStyle({
3847
+ base: filledBackgroundAppearanceClasses,
3848
+ hover: filledHoverBackgroundAppearanceClasses,
3849
+ active: filledActiveBackgroundAppearanceClasses
3850
+ })
3851
+ });
3852
+ }
3853
+ static createDefaultText() {
3854
+ return this.createDefault({
3855
+ outline: TextAppearanceTheme.createDefaultStyle({ base: textAppearanceClasses }),
3856
+ filled: TextAppearanceTheme.createDefaultStyle({ base: filledTextAppearanceClasses })
3857
+ });
3858
+ }
3859
+ static createDefaultBorder() {
3860
+ return this.createDefault({
3861
+ outline: TextAppearanceTheme.createDefaultStyle({ base: borderAppearanceClasses }),
3862
+ filled: TextAppearanceTheme.createDefaultStyle({ base: filledBorderAppearanceClasses })
3863
+ });
3864
+ }
3865
+ static createDefaultRing() {
3866
+ return this.createDefault({
3867
+ outline: TextAppearanceTheme.createDefaultStyle({ base: ringAppearanceClasses }),
3868
+ filled: TextAppearanceTheme.createDefaultStyle({ base: filledRingAppearanceClasses })
3869
+ });
3870
+ }
3871
+ }
3872
+ VariantTheme.defaultInstances = Object.fromEntries(VARIANT_KEYS.map(variantKey => [
3873
+ variantKey,
3874
+ new TextAppearanceTheme()
3875
+ ]));
3876
+
3877
+ const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-pointer transition-all duration-200 whitespace-nowrap", {
3878
+ size: {
3879
+ px: new PxTheme({
3880
+ padding: {
3881
+ xs: 'px-2',
3882
+ sm: 'px-3',
3883
+ md: 'px-4',
3884
+ lg: 'px-5',
3885
+ xl: 'px-6',
3886
+ }
3887
+ }),
3888
+ py: new PyTheme({
3889
+ padding: {
3890
+ xs: 'py-1',
3891
+ sm: 'py-1.5',
3892
+ md: 'py-2',
3893
+ lg: 'py-2.5',
3894
+ xl: 'py-3',
3895
+ }
3896
+ }),
3897
+ gap: new GapTheme({
3898
+ gap: {
3899
+ xs: 'gap-1',
3900
+ sm: 'gap-1.5',
3901
+ md: 'gap-2',
3902
+ lg: 'gap-2.5',
3903
+ xl: 'gap-3',
3904
+ }
3905
+ }),
3906
+ text: new SizeTheme({
3907
+ xs: 'text-xs',
3908
+ sm: 'text-sm',
3909
+ md: 'text-base',
3910
+ lg: 'text-lg',
3911
+ xl: 'text-xl',
3912
+ }),
3913
+ shadow: new ShadowTheme(),
3914
+ },
3915
+ appearance: {
3916
+ background: VariantTheme.createDefaultBackground(),
3917
+ text: VariantTheme.createDefaultText(),
3918
+ border: VariantTheme.createDefaultBorder(),
3919
+ ring: VariantTheme.createDefaultRing(),
3920
+ },
3921
+ layout: {
3922
+ border: new BorderTheme(),
3923
+ ring: new RingTheme(),
3924
+ radius: new RadiusTheme({
3925
+ rounded: {
3926
+ xs: 'rounded-sm',
3927
+ sm: 'rounded-md',
3928
+ md: 'rounded-md',
3929
+ lg: 'rounded-lg',
3930
+ xl: 'rounded-xl',
3931
+ }
3932
+ }),
3933
+ },
3934
+ }, {
3935
+ md: true,
3936
+ inlineFlex: true,
3937
+ itemsCenter: true,
3938
+ justifyCenter: true,
3939
+ outline: true,
3940
+ default: true,
3941
+ rounded: true,
3942
+ sans: true,
3943
+ semibold: true,
3944
+ textCenter: true,
3945
+ noBorder: true,
3946
+ gap: true,
3947
+ padding: true,
3948
+ ring: true,
3949
+ shadow: true,
3950
+ });
3951
+
3952
+ const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all duration-200 whitespace-nowrap", {
3953
+ size: {
3954
+ px: new PxTheme({
3955
+ padding: {
3956
+ xs: "px-2",
3957
+ sm: "px-3",
3958
+ md: "px-4",
3959
+ lg: "px-5",
3960
+ xl: "px-6"
3961
+ }
3962
+ }),
3963
+ py: new PyTheme({
3964
+ padding: {
3965
+ xs: 'py-1',
3966
+ sm: 'py-1.5',
3967
+ md: 'py-2',
3968
+ lg: 'py-2.5',
3969
+ xl: 'py-3',
3970
+ }
3971
+ }),
3972
+ gap: new GapTheme({
3973
+ gap: {
3974
+ xs: 'gap-1',
3975
+ sm: 'gap-1.5',
3976
+ md: 'gap-2',
3977
+ lg: 'gap-2.5',
3978
+ xl: 'gap-3',
3979
+ }
3980
+ }),
3981
+ text: new SizeTheme({
3982
+ xs: 'text-xs',
3983
+ sm: 'text-sm',
3984
+ md: 'text-base',
3985
+ lg: 'text-lg',
3986
+ xl: 'text-xl',
3987
+ }),
3988
+ shadow: new ShadowTheme(),
3989
+ },
3990
+ appearance: {
3991
+ background: VariantTheme.createDefault({
3992
+ outline: TextAppearanceTheme.createDefaultStyle({
3993
+ base: backgroundAppearanceClasses,
3994
+ }),
3995
+ filled: TextAppearanceTheme.createDefaultStyle({
3996
+ base: filledBackgroundAppearanceClasses,
3997
+ })
3998
+ }),
3999
+ text: VariantTheme.createDefaultText(),
4000
+ border: VariantTheme.createDefaultBorder(),
4001
+ ring: VariantTheme.createDefaultRing(),
4002
+ },
4003
+ layout: {
4004
+ border: new BorderTheme(),
4005
+ ring: new RingTheme(),
4006
+ radius: new RadiusTheme({
4007
+ rounded: {
4008
+ xs: "rounded-xs",
4009
+ sm: "rounded-sm",
4010
+ md: "rounded-md",
4011
+ lg: "rounded-lg",
4012
+ xl: "rounded-xl"
4013
+ }
4014
+ }),
4015
+ },
4016
+ }, {
4017
+ md: true,
4018
+ inlineFlex: true,
4019
+ outline: true,
4020
+ pill: true,
4021
+ sans: true,
4022
+ semibold: true,
4023
+ uppercase: true,
4024
+ noShadow: true,
4025
+ itemsCenter: true,
4026
+ padding: true,
4027
+ gap: true,
4028
+ ring: true,
4029
+ });
4030
+
4031
+ const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all duration-200 whitespace-nowrap", {
4032
+ size: {
4033
+ px: new PxTheme({
4034
+ padding: {
4035
+ xs: 'px-2',
4036
+ sm: 'px-2.5',
4037
+ md: 'px-3',
4038
+ lg: 'px-3.5',
4039
+ xl: 'px-4',
4040
+ }
4041
+ }),
4042
+ py: new PyTheme({
4043
+ padding: {
4044
+ xs: 'py-0.5',
4045
+ sm: 'py-1',
4046
+ md: 'py-1.5',
4047
+ lg: 'py-2',
4048
+ xl: 'py-2.5',
4049
+ }
4050
+ }),
4051
+ text: new SizeTheme({
4052
+ xs: 'text-xs',
4053
+ sm: 'text-sm',
4054
+ md: 'text-base',
4055
+ lg: 'text-lg',
4056
+ xl: 'text-xl',
4057
+ }),
4058
+ gap: new GapTheme({
4059
+ gap: {
4060
+ xs: 'gap-1',
4061
+ sm: 'gap-1.5',
4062
+ md: 'gap-2',
4063
+ lg: 'gap-2.5',
4064
+ xl: 'gap-3',
4065
+ }
4066
+ }),
4067
+ shadow: new ShadowTheme(),
4068
+ },
4069
+ appearance: {
4070
+ background: VariantTheme.createDefault({
4071
+ outline: TextAppearanceTheme.createDefaultStyle({
4072
+ base: backgroundAppearanceClasses,
4073
+ }),
4074
+ filled: TextAppearanceTheme.createDefaultStyle({
4075
+ base: filledBackgroundAppearanceClasses,
4076
+ })
4077
+ }),
4078
+ text: VariantTheme.createDefaultText(),
4079
+ border: VariantTheme.createDefaultBorder(),
4080
+ ring: VariantTheme.createDefaultRing(),
4081
+ },
4082
+ layout: {
4083
+ radius: new RadiusTheme({
4084
+ rounded: {
4085
+ xs: 'rounded-sm',
4086
+ sm: 'rounded-md',
4087
+ md: 'rounded-lg',
4088
+ lg: 'rounded-xl',
4089
+ xl: 'rounded-2xl',
4090
+ }
4091
+ }),
4092
+ border: new BorderTheme(),
4093
+ ring: new RingTheme(),
4094
+ },
4095
+ }, {
4096
+ md: true,
4097
+ inlineFlex: true,
4098
+ itemsCenter: true,
4099
+ outline: true,
4100
+ secondary: true,
4101
+ rounded: true,
4102
+ mono: true,
4103
+ normal: true,
4104
+ noShadow: true,
4105
+ padding: true,
4106
+ gap: true,
4107
+ ring: true,
4108
+ });
4109
+
4110
+ const typographyThemeDefaults = {
4111
+ md: true,
4112
+ default: true,
4113
+ sans: true,
4114
+ normal: true,
4115
+ };
4116
+ const createTypographyComponentTheme = (tag, base = "text-balance", textSizeMap = textSizeClasses, defaults = typographyThemeDefaults) => {
4117
+ return new ComponentTheme(tag, base, {
4118
+ size: {
4119
+ text: new SizeTheme(textSizeMap),
4120
+ },
4121
+ appearance: {
4122
+ text: TextAppearanceTheme.createDefaultStyle({ base: textAppearanceClasses }),
4123
+ }
4124
+ }, defaults);
4125
+ };
4126
+ // Page title specific theme
4127
+ const pageTitleTheme = createTypographyComponentTheme("h1", "text-balance tracking-tight w-fit", {
4128
+ xs: "text-3xl max-lg:text-2xl max-md:text-xl",
4129
+ sm: "text-4xl max-lg:text-3xl max-md:text-2xl",
4130
+ md: "text-5xl max-lg:text-4xl max-md:text-3xl",
4131
+ lg: "text-6xl max-lg:text-5xl max-md:text-4xl",
4132
+ xl: "text-7xl max-lg:text-6xl max-md:text-5xl",
4133
+ }, mergeDefaults(typographyThemeDefaults, { semibold: true }));
4134
+ // Section title specific theme
4135
+ const sectionTitleTheme = createTypographyComponentTheme("h2", "text-balance w-fit", {
4136
+ xs: "text-2xl max-lg:text-xl max-md:text-lg",
4137
+ sm: "text-3xl max-lg:text-2xl max-md:text-xl",
4138
+ md: "text-4xl max-lg:text-3xl max-md:text-2xl",
4139
+ lg: "text-5xl max-lg:text-4xl max-md:text-3xl",
4140
+ xl: "text-6xl max-lg:text-5xl max-md:text-4xl",
4141
+ }, mergeDefaults(typographyThemeDefaults, { semibold: true }));
4142
+ // Title specific theme
4143
+ const titleTheme = createTypographyComponentTheme("h3", "text-balance w-fit", {
4144
+ xs: "text-lg",
4145
+ sm: "text-xl",
4146
+ md: "text-2xl",
4147
+ lg: "text-3xl",
4148
+ xl: "text-4xl",
4149
+ }, mergeDefaults(typographyThemeDefaults, { semibold: true }));
4150
+ // Text specific theme
4151
+ const textTheme = createTypographyComponentTheme("p", "p-0 m-0 w-fit", textSizeClasses, mergeDefaults(typographyThemeDefaults, { secondary: true }));
4152
+ // Link specific theme
4153
+ const linkTheme = createTypographyComponentTheme("a", "hover:underline w-fit", textSizeClasses, mergeDefaults(typographyThemeDefaults, { link: true }));
4154
+ // List item specific theme
4155
+ const listItemTheme = createTypographyComponentTheme("li");
4156
+ // List specific theme
4157
+ const listTheme = createTypographyComponentTheme("ul", "list-disc list-inside");
4158
+
4159
+ class DirectionTheme extends BaseTheme {
4160
+ constructor(initial) {
4161
+ super();
4162
+ FLEX_DIRECTION_KEYS.forEach((key) => {
4163
+ this[key] = (initial === null || initial === void 0 ? void 0 : initial[key]) || DirectionTheme.defaultClasses[key];
4164
+ });
4165
+ }
4166
+ getClasses(props, defaults) {
4167
+ let direction = pickFirstTruthyKey(props, defaults, FLEX_DIRECTION_KEYS) || 'column';
4168
+ const reverse = pickFirstTruthyKey(props, defaults, DIRECTION_REVERSE_KEYS);
4169
+ if (reverse) {
4170
+ switch (direction) {
4171
+ case "column":
4172
+ direction = "columnReverse";
4173
+ break;
4174
+ case "row":
4175
+ direction = "rowReverse";
4176
+ break;
4177
+ }
4178
+ }
4179
+ return direction ? [this[direction]] : [];
4180
+ }
4181
+ }
4182
+ DirectionTheme.defaultClasses = {
4183
+ row: "flex-row",
4184
+ column: "flex-col",
4185
+ rowReverse: "flex-row-reverse",
4186
+ columnReverse: "flex-col-reverse",
4187
+ };
4188
+
4189
+ class WrapTheme extends BaseTheme {
4190
+ constructor(initialConfig) {
4191
+ super();
4192
+ WRAP_KEYS.forEach((key) => {
4193
+ var _a;
4194
+ this[key] = (_a = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig[key]) !== null && _a !== void 0 ? _a : WrapTheme.defaultClasses[key];
4195
+ });
4196
+ }
4197
+ getClasses(props, defaults) {
4198
+ const key = pickFirstTruthyKey(props, defaults, WRAP_KEYS);
4199
+ return key ? [this[key]] : [];
4200
+ }
4201
+ }
4202
+ WrapTheme.defaultClasses = {
4203
+ flexWrap: "flex-wrap",
4204
+ flexNoWrap: "flex-nowrap",
4205
+ flexWrapReverse: "flex-wrap-reverse"
4206
+ };
4207
+
4208
+ const commonGaps = {
4209
+ xs: 'gap-2',
4210
+ sm: 'gap-3',
4211
+ md: 'gap-4',
4212
+ lg: 'gap-5',
4213
+ xl: 'gap-6',
4214
+ };
4215
+
4216
+ class LayoutAppearanceTheme extends BaseTheme {
4217
+ constructor(initialOverrides) {
4218
+ super();
4219
+ APPEARANCE_KEYS.forEach((textKey) => {
4220
+ const defaultModesForKey = LayoutAppearanceTheme.defaultFullConfig[textKey];
4221
+ const overrideModesForKey = initialOverrides === null || initialOverrides === void 0 ? void 0 : initialOverrides[textKey];
4222
+ this[textKey] = {
4223
+ ...defaultModesForKey,
4224
+ ...(overrideModesForKey || {}),
4225
+ };
4226
+ });
4227
+ }
4228
+ getClasses(props, defaults) {
4229
+ const pickedAppearanceKey = pickFirstTruthyKey(props, defaults, APPEARANCE_KEYS) || 'default';
4230
+ const modesForAppearance = this[pickedAppearanceKey];
4231
+ if (!modesForAppearance) {
4232
+ return MODE_KEYS.map(() => '');
4233
+ }
4234
+ return MODE_KEYS.map(mode => modesForAppearance[mode] || '');
4235
+ }
4236
+ static createDefaultStyle(src = {}) {
4237
+ const initialOverridesForConstructor = {};
4238
+ APPEARANCE_KEYS.forEach((textKey) => {
4239
+ const modesForCurrentTextKey = {};
4240
+ let keyHasDataInSrc = false;
4241
+ MODE_KEYS.forEach((modeKey) => {
4242
+ var _a;
4243
+ const classValue = (_a = src[modeKey]) === null || _a === void 0 ? void 0 : _a[textKey];
4244
+ if (classValue !== undefined) {
4245
+ modesForCurrentTextKey[modeKey] = classValue;
4246
+ keyHasDataInSrc = true;
4247
+ }
4248
+ });
4249
+ if (keyHasDataInSrc) {
4250
+ initialOverridesForConstructor[textKey] = modesForCurrentTextKey;
4251
+ }
4252
+ });
4253
+ return new LayoutAppearanceTheme(initialOverridesForConstructor);
4254
+ }
4255
+ }
4256
+ LayoutAppearanceTheme.defaultFullConfig = (() => {
4257
+ const config = {};
4258
+ APPEARANCE_KEYS.forEach((key) => {
4259
+ config[key] = {
4260
+ base: textAppearanceClasses[key] || '',
4261
+ hover: '',
4262
+ active: '',
4263
+ };
4264
+ });
4265
+ return config;
4266
+ })();
4267
+
4268
+ class BreakpointTheme extends BaseTheme {
4269
+ constructor(initial) {
4270
+ super();
4271
+ BREAKPOINT_KEYS.forEach((key) => {
4272
+ var _a;
4273
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : BreakpointTheme.defaultClasses[key];
4274
+ });
4275
+ }
4276
+ getClasses(props, defaults) {
4277
+ const key = pickFirstTruthyKey(props, defaults, BREAKPOINT_KEYS);
4278
+ if (!key)
4279
+ return [];
4280
+ return [this[key] || ''];
4281
+ }
4282
+ }
4283
+ BreakpointTheme.defaultClasses = {
4284
+ xsCol: "max-xs:flex-col",
4285
+ smCol: "max-sm:flex-col",
4286
+ mdCol: "max-md:flex-col",
4287
+ lgCol: "max-lg:flex-col",
4288
+ xlCol: "max-xl:flex-col"
4289
+ };
4290
+
4291
+ const defaultCardTheme = new ComponentTheme("div", "overflow-hidden", {
4292
+ size: {
4293
+ px: new PxTheme({
4294
+ padding: {
4295
+ xs: 'px-3',
4296
+ sm: 'px-4',
4297
+ md: 'px-5',
4298
+ lg: 'px-6',
4299
+ xl: 'px-8',
4300
+ }
4301
+ }),
4302
+ py: new PyTheme({
4303
+ padding: {
4304
+ xs: 'py-2',
4305
+ sm: 'py-3',
4306
+ md: 'py-4',
4307
+ lg: 'py-5',
4308
+ xl: 'py-6',
4309
+ }
4310
+ }),
4311
+ gap: new GapTheme({ gap: commonGaps }),
4312
+ shadow: new ShadowTheme(),
4313
+ },
4314
+ layout: {
4315
+ border: new BorderTheme(),
4316
+ ring: new RingTheme(),
4317
+ radius: new RadiusTheme({
4318
+ rounded: {
4319
+ xs: "rounded-md",
4320
+ sm: "rounded-lg",
4321
+ md: "rounded-xl",
4322
+ lg: "rounded-2xl",
4323
+ xl: "rounded-3xl"
4324
+ }
4325
+ }),
4326
+ wrap: new WrapTheme(),
4327
+ direction: new DirectionTheme(),
4328
+ breakpoint: new BreakpointTheme(),
4329
+ },
4330
+ appearance: {
4331
+ background: LayoutAppearanceTheme.createDefaultStyle({
4332
+ base: layoutBackgroundAppearanceClasses,
4333
+ }),
4334
+ text: TextAppearanceTheme.createDefaultStyle({ base: textAppearanceClasses }),
4335
+ border: TextAppearanceTheme.createDefaultStyle({ base: borderAppearanceClasses }),
4336
+ ring: TextAppearanceTheme.createDefaultStyle({ base: ringAppearanceClasses }),
4337
+ }
4338
+ }, {
4339
+ md: true,
4340
+ flex: true,
4341
+ default: true,
4342
+ rounded: true,
4343
+ normal: true,
4344
+ column: true,
4345
+ border: true,
4346
+ gap: true,
4347
+ padding: true,
4348
+ });
4349
+
4350
+ const defaultRowTheme = new ComponentTheme("div", "flex-row", {
4351
+ size: {
4352
+ gap: new GapTheme({ gap: commonGaps }),
4353
+ breakpoint: new BreakpointTheme(),
4354
+ },
4355
+ layout: {
4356
+ wrap: new WrapTheme(),
4357
+ },
4358
+ }, {
4359
+ md: true,
4360
+ flex: true,
4361
+ transparent: true,
4362
+ itemsCenter: true,
4363
+ gap: true,
4364
+ });
4365
+
4366
+ const defaultDividerTheme = new ComponentTheme("div", "h-px w-full", {
4367
+ appearance: {
4368
+ background: TextAppearanceTheme.createDefaultStyle({
4369
+ base: bgBorderAppearanceClasses,
4370
+ }),
4371
+ }
4372
+ }, {
4373
+ md: true,
4374
+ default: true,
4375
+ });
4376
+
4377
+ const defaultContainerTheme = new ComponentTheme("div", "flex-col mx-auto w-full", {
4378
+ size: {
4379
+ gap: new GapTheme({
4380
+ gap: {
4381
+ xs: 'gap-2 max-lg:gap-1',
4382
+ sm: 'gap-4 max-lg:gap-3 max-md:gap-2',
4383
+ md: 'gap-6 max-lg:gap-5 max-md:gap-4',
4384
+ lg: 'gap-8 max-lg:gap-7 max-md:gap-6',
4385
+ xl: 'gap-10 max-lg:gap-9 max-md:gap-8',
4386
+ }
4387
+ }),
4388
+ maxWidth: new SizeTheme({
4389
+ xs: 'max-w-3xl',
4390
+ sm: 'max-w-4xl',
4391
+ md: 'max-w-5xl',
4392
+ lg: 'max-w-6xl',
4393
+ xl: 'max-w-7xl',
4394
+ }),
4395
+ },
4396
+ layout: {
4397
+ border: new BorderTheme(),
4398
+ ring: new RingTheme(),
4399
+ wrap: new WrapTheme(),
4400
+ direction: new DirectionTheme(),
4401
+ radius: new RadiusTheme({
4402
+ rounded: {
4403
+ xs: "rounded-md",
4404
+ sm: "rounded-lg",
4405
+ md: "rounded-xl",
4406
+ lg: "rounded-2xl",
4407
+ xl: "rounded-3xl"
4408
+ }
4409
+ }),
4410
+ },
4411
+ appearance: {
4412
+ background: LayoutAppearanceTheme.createDefaultStyle({
4413
+ base: layoutBackgroundAppearanceClasses,
4414
+ }),
4415
+ text: TextAppearanceTheme.createDefaultStyle({ base: textAppearanceClasses }),
4416
+ border: TextAppearanceTheme.createDefaultStyle({ base: borderAppearanceClasses }),
4417
+ ring: TextAppearanceTheme.createDefaultStyle({ base: ringAppearanceClasses }),
4418
+ }
4419
+ }, {
4420
+ transparent: true,
4421
+ noRing: true,
4422
+ flex: true,
4423
+ md: true,
4424
+ itemsCenter: true,
4425
+ gap: true,
4426
+ sharp: true,
4427
+ });
4428
+
4429
+ const defaultColTheme = new ComponentTheme("div", "flex-col", {
4430
+ size: {
4431
+ gap: new GapTheme({ gap: commonGaps }),
4432
+ },
4433
+ layout: {
4434
+ wrap: new WrapTheme(),
4435
+ direction: new DirectionTheme(),
4436
+ },
4437
+ }, {
4438
+ md: true,
4439
+ flex: true,
4440
+ transparent: true,
4441
+ gap: true,
4442
+ });
4443
+
4444
+ const defaultStackTheme = new ComponentTheme("div", "", {
4445
+ size: {
4446
+ px: new PxTheme({
4447
+ padding: {
4448
+ xs: 'px-2',
4449
+ sm: 'px-3',
4450
+ md: 'px-4',
4451
+ lg: 'px-5',
4452
+ xl: 'px-6',
4453
+ }
4454
+ }),
4455
+ py: new PyTheme({
4456
+ padding: {
4457
+ xs: 'py-2',
4458
+ sm: 'py-3',
4459
+ md: 'py-4',
4460
+ lg: 'py-5',
4461
+ xl: 'py-6',
4462
+ }
4463
+ }),
4464
+ gap: new GapTheme({
4465
+ gap: commonGaps
4466
+ }),
4467
+ },
4468
+ layout: {
4469
+ wrap: new WrapTheme(),
4470
+ direction: new DirectionTheme(),
4471
+ },
4472
+ }, {
4473
+ md: true,
4474
+ flex: true,
4475
+ transparent: true,
4476
+ column: true,
4477
+ flexWrap: true,
4478
+ gap: true,
4479
+ padding: true,
4480
+ });
4481
+
4482
+ const defaultSectionTheme = new ComponentTheme("div", "w-full flex-col", {
4483
+ size: {
4484
+ px: new PxTheme({
4485
+ padding: {
4486
+ xs: 'px-5 max-lg:px-4 max-md:px-3',
4487
+ sm: 'px-6 max-lg:px-5 max-md:px-4',
4488
+ md: 'px-7 max-lg:px-6 max-md:px-5',
4489
+ lg: 'px-8 max-lg:px-7 max-md:px-6',
4490
+ xl: 'px-9 max-lg:px-8 max-md:px-7',
4491
+ }
4492
+ }),
4493
+ py: new PyTheme({
4494
+ padding: {
4495
+ xs: 'py-4 max-md:py-3',
4496
+ sm: 'py-8 max-md:py-6',
4497
+ md: 'py-12 max-md:py-6',
4498
+ lg: 'py-16 max-lg:py-14 max-md:py-12',
4499
+ xl: 'py-20 max-lg:py-16 max-md:py-12',
4500
+ }
4501
+ }),
4502
+ gap: new GapTheme({
4503
+ gap: {
4504
+ xs: 'gap-4',
4505
+ sm: 'gap-6',
4506
+ md: 'gap-8',
4507
+ lg: 'gap-12',
4508
+ xl: 'gap-16',
4509
+ }
4510
+ }),
4511
+ shadow: new ShadowTheme(),
4512
+ },
4513
+ appearance: {
4514
+ background: LayoutAppearanceTheme.createDefaultStyle({
4515
+ base: layoutBackgroundAppearanceClasses,
4516
+ }),
4517
+ text: TextAppearanceTheme.createDefaultStyle({ base: textAppearanceClasses }),
4518
+ border: TextAppearanceTheme.createDefaultStyle({ base: borderAppearanceClasses }),
4519
+ ring: TextAppearanceTheme.createDefaultStyle({ base: ringAppearanceClasses }),
4520
+ },
4521
+ layout: {
4522
+ wrap: new WrapTheme(),
4523
+ direction: new DirectionTheme(),
4524
+ border: new BorderTheme(),
4525
+ ring: new RingTheme(),
4526
+ radius: new RadiusTheme({
4527
+ rounded: {
4528
+ xs: 'rounded-md',
4529
+ sm: 'rounded-lg',
4530
+ md: 'rounded-xl',
4531
+ lg: 'rounded-2xl',
4532
+ xl: 'rounded-3xl',
4533
+ }
4534
+ }),
4535
+ },
4536
+ }, {
4537
+ md: true,
4538
+ flex: true,
4539
+ default: true,
4540
+ itemsStart: true,
4541
+ gap: true,
4542
+ padding: true,
4543
+ noBorder: true,
4544
+ noRing: true,
4545
+ noShadow: true,
4546
+ sharp: true,
4547
+ });
4548
+
4549
+ const gridDefaults = {
4550
+ md: true,
4551
+ gap: true,
4552
+ grid: true,
4553
+ };
4554
+ const gridSubThemes = {
4555
+ size: {
4556
+ gap: new GapTheme({
4557
+ gap: {
4558
+ xs: "gap-2",
4559
+ sm: "gap-4 max-lg:gap-2",
4560
+ md: "gap-6 max-lg:gap-4",
4561
+ lg: "gap-8 max-lg:gap-6 max-md:gap-4",
4562
+ xl: "gap-10 max-lg:gap-8 max-md:gap-6"
4563
+ }
4564
+ }),
4565
+ },
4566
+ };
4567
+ const defaultGrid3Theme = new ComponentTheme("div", "grid-cols-1 md:grid-cols-3", gridSubThemes, gridDefaults);
4568
+ const defaultGrid4Theme = new ComponentTheme("div", "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4", gridSubThemes, gridDefaults);
4569
+
4570
+ const COMPONENT_KEYS = ['button', 'badge', 'chip', 'card', 'divider', 'row', 'col', 'stack', 'section',
4571
+ 'grid3', 'grid4', 'pageTitle', 'sectionTitle', 'title', 'text', 'link', 'list', 'listItem'];
4572
+ const defaultTheme = {
4573
+ button: defaultButtonTheme,
4574
+ badge: defaultBadgeTheme,
4575
+ chip: defaultChipTheme,
4576
+ card: defaultCardTheme,
4577
+ divider: defaultDividerTheme,
4578
+ container: defaultContainerTheme,
4579
+ row: defaultRowTheme,
4580
+ col: defaultColTheme,
4581
+ stack: defaultStackTheme,
4582
+ section: defaultSectionTheme,
4583
+ grid3: defaultGrid3Theme,
4584
+ grid4: defaultGrid4Theme,
4585
+ pageTitle: pageTitleTheme,
4586
+ sectionTitle: sectionTitleTheme,
4587
+ title: titleTheme,
4588
+ text: textTheme,
4589
+ link: linkTheme,
4590
+ listItem: listItemTheme,
4591
+ list: listTheme,
4592
+ };
4593
+ const ThemeContext = react.createContext(defaultTheme);
4594
+ function ThemeProvider({ children, theme: themeObject = {}, themeDefaults, themeOverride }) {
4595
+ const mergedTheme = react.useMemo(() => {
4596
+ let finalTheme = themeObject
4597
+ ? deepMerge(defaultTheme, themeObject)
4598
+ : defaultTheme;
4599
+ if (typeof themeOverride === 'function') {
4600
+ const themeToModify = deepClone(finalTheme);
4601
+ finalTheme = themeOverride(themeToModify);
4602
+ }
4603
+ if (themeDefaults !== undefined) {
4604
+ for (const key in themeDefaults) {
4605
+ const componentKey = key;
4606
+ const componentTheme = finalTheme[componentKey];
4607
+ const themeDefault = themeDefaults[componentKey];
4608
+ if (themeDefault !== undefined) {
4609
+ finalTheme[componentKey].defaults =
4610
+ mergeDefaults(componentTheme.defaults, themeDefaults[componentKey]);
4611
+ }
4612
+ }
4613
+ }
4614
+ return finalTheme;
4615
+ }, [themeObject, themeOverride]);
4616
+ return (jsxRuntime.jsx(ThemeContext.Provider, { value: mergedTheme, children: children }));
4617
+ }
4618
+ function useTheme() {
4619
+ return react.useContext(ThemeContext);
4620
+ }
4621
+
4622
+ function ThemedComponent({ theme, propsToOmit, ...props }) {
4623
+ const { Tag, finalClasses, finalProps } = react.useMemo(() => {
4624
+ return theme.getComponentConfig(props, propsToOmit);
4625
+ }, [theme, props, propsToOmit]);
4626
+ return (jsxRuntime.jsx(Tag, { className: finalClasses, ...finalProps, children: props.children }));
4627
+ }
4628
+
4629
+ const Button = (props) => {
4630
+ const theme = useTheme();
4631
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.button, propsToOmit: BUTTON_KEYS, ...props });
4632
+ };
4633
+
4634
+ const Badge = (props) => {
4635
+ const theme = useTheme();
4636
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.badge, propsToOmit: BADGE_KEYS, ...props });
4637
+ };
4638
+
4639
+ const Divider = (props) => {
4640
+ const theme = useTheme();
4641
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.divider, propsToOmit: DIVIDER_KEYS, ...props });
4642
+ };
4643
+
4644
+ const Chip = (props) => {
4645
+ const theme = useTheme();
4646
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.chip, propsToOmit: CHIP_KEYS, ...props });
4647
+ };
4648
+
4649
+ const Section = (props) => {
4650
+ const theme = useTheme();
4651
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.section, propsToOmit: SECTION_KEYS, ...props });
4652
+ };
4653
+
4654
+ const Container = (props) => {
4655
+ const theme = useTheme();
4656
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.container, propsToOmit: CONTAINER_KEYS, ...props });
4657
+ };
4658
+
4659
+ const Col = (props) => {
4660
+ const theme = useTheme();
4661
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.col, propsToOmit: COL_KEYS, ...props });
4662
+ };
4663
+
4664
+ const Row = (props) => {
4665
+ const theme = useTheme();
4666
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.row, propsToOmit: ROW_KEYS, ...props });
4667
+ };
4668
+
4669
+ const Grid3 = (props) => {
4670
+ const theme = useTheme();
4671
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.grid3, propsToOmit: GRID_KEYS, ...props });
4672
+ };
4673
+ const Grid4 = (props) => {
4674
+ const theme = useTheme();
4675
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.grid4, propsToOmit: GRID_KEYS, ...props });
4676
+ };
4677
+
4678
+ const Card = (props) => {
4679
+ const theme = useTheme();
4680
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.card, propsToOmit: CARD_KEYS, ...props });
4681
+ };
4682
+
4683
+ const Stack = (props) => {
4684
+ const theme = useTheme();
4685
+ const stackTheme = theme.stack;
4686
+ return jsxRuntime.jsx(ThemedComponent, { theme: stackTheme, propsToOmit: STACK_KEYS, ...props });
4687
+ };
4688
+
4689
+ const PageTitle = (props) => {
4690
+ const theme = useTheme();
4691
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.pageTitle, propsToOmit: TYPOGRAPHY_COMPONENT_KEYS, ...props });
4692
+ };
4693
+ const SectionTitle = (props) => {
4694
+ const theme = useTheme();
4695
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.sectionTitle, propsToOmit: TYPOGRAPHY_COMPONENT_KEYS, ...props });
4696
+ };
4697
+ const Title = (props) => {
4698
+ const theme = useTheme();
4699
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.title, propsToOmit: TYPOGRAPHY_COMPONENT_KEYS, ...props });
4700
+ };
4701
+ const Text = (props) => {
4702
+ const theme = useTheme();
4703
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.text, propsToOmit: TYPOGRAPHY_COMPONENT_KEYS, ...props });
4704
+ };
4705
+ const Link = (props) => {
4706
+ const theme = useTheme();
4707
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.link, propsToOmit: TYPOGRAPHY_COMPONENT_KEYS, ...props });
4708
+ };
4709
+ const ListItem = (props) => {
4710
+ const theme = useTheme();
4711
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.listItem, propsToOmit: TYPOGRAPHY_COMPONENT_KEYS, ...props });
4712
+ };
4713
+ const List = (props) => {
4714
+ const theme = useTheme();
4715
+ return jsxRuntime.jsx(ThemedComponent, { theme: theme.list, propsToOmit: TYPOGRAPHY_COMPONENT_KEYS, ...props });
4716
+ };
4717
+
4718
+ exports.APPEARANCE_KEYS = APPEARANCE_KEYS;
4719
+ exports.BADGE_KEYS = BADGE_KEYS;
4720
+ exports.BASE_COMPONENT_KEYS = BASE_COMPONENT_KEYS;
4721
+ exports.BORDER_KEYS = BORDER_KEYS;
4722
+ exports.BREAKPOINT_KEYS = BREAKPOINT_KEYS;
4723
+ exports.BUTTON_KEYS = BUTTON_KEYS;
4724
+ exports.Badge = Badge;
4725
+ exports.Button = Button;
4726
+ exports.CARD_KEYS = CARD_KEYS;
4727
+ exports.CHIP_KEYS = CHIP_KEYS;
4728
+ exports.COL_KEYS = COL_KEYS;
4729
+ exports.COMPONENT_KEYS = COMPONENT_KEYS;
4730
+ exports.CONTAINER_KEYS = CONTAINER_KEYS;
4731
+ exports.Card = Card;
4732
+ exports.Chip = Chip;
4733
+ exports.Col = Col;
4734
+ exports.Container = Container;
4735
+ exports.DIRECTION_REVERSE_KEYS = DIRECTION_REVERSE_KEYS;
4736
+ exports.DISPLAY_KEYS = DISPLAY_KEYS;
4737
+ exports.DIVIDER_KEYS = DIVIDER_KEYS;
4738
+ exports.Divider = Divider;
4739
+ exports.EXCLUSIVE_KEY_GROUPS = EXCLUSIVE_KEY_GROUPS;
4740
+ exports.FLEX_DIRECTION_KEYS = FLEX_DIRECTION_KEYS;
4741
+ exports.FONT_FAMILY_KEYS = FONT_FAMILY_KEYS;
4742
+ exports.FONT_KEYS = FONT_KEYS;
4743
+ exports.FONT_STYLE_KEYS = FONT_STYLE_KEYS;
4744
+ exports.FONT_WEIGHT_KEYS = FONT_WEIGHT_KEYS;
4745
+ exports.GAP_KEYS = GAP_KEYS;
4746
+ exports.GRID_KEYS = GRID_KEYS;
4747
+ exports.Grid3 = Grid3;
4748
+ exports.Grid4 = Grid4;
4749
+ exports.HIDE_KEYS = HIDE_KEYS;
4750
+ exports.ITEMS_KEYS = ITEMS_KEYS;
4751
+ exports.JUSTIFY_KEYS = JUSTIFY_KEYS;
4752
+ exports.Link = Link;
4753
+ exports.List = List;
4754
+ exports.ListItem = ListItem;
4755
+ exports.MODE_KEYS = MODE_KEYS;
4756
+ exports.PADDING_KEYS = PADDING_KEYS;
4757
+ exports.PILL_KEYS = PILL_KEYS;
4758
+ exports.POSITION_KEYS = POSITION_KEYS;
4759
+ exports.PageTitle = PageTitle;
4760
+ exports.RING_KEYS = RING_KEYS;
4761
+ exports.ROUNDED_KEYS = ROUNDED_KEYS;
4762
+ exports.ROW_KEYS = ROW_KEYS;
4763
+ exports.Row = Row;
4764
+ exports.SECTION_KEYS = SECTION_KEYS;
4765
+ exports.SHADOW_KEYS = SHADOW_KEYS;
4766
+ exports.SHAPE_KEYS = SHAPE_KEYS;
4767
+ exports.SHARP_KEYS = SHARP_KEYS;
4768
+ exports.SIZE_KEYS = SIZE_KEYS;
4769
+ exports.STACK_KEYS = STACK_KEYS;
4770
+ exports.Section = Section;
4771
+ exports.SectionTitle = SectionTitle;
4772
+ exports.Stack = Stack;
4773
+ exports.TEXT_ALIGN_KEYS = TEXT_ALIGN_KEYS;
4774
+ exports.TEXT_APPEARANCE_KEYS = TEXT_APPEARANCE_KEYS;
4775
+ exports.TEXT_DECORATION_KEYS = TEXT_DECORATION_KEYS;
4776
+ exports.TEXT_TRANSFORM_KEYS = TEXT_TRANSFORM_KEYS;
4777
+ exports.TYPOGRAPHY_COMPONENT_KEYS = TYPOGRAPHY_COMPONENT_KEYS;
4778
+ exports.Text = Text;
4779
+ exports.ThemeProvider = ThemeProvider;
4780
+ exports.Title = Title;
4781
+ exports.VARIANT_KEYS = VARIANT_KEYS;
4782
+ exports.WRAP_KEYS = WRAP_KEYS;
4783
+ exports.defaultTheme = defaultTheme;
4784
+ exports.useTheme = useTheme;
4785
+ //# sourceMappingURL=index.js.map