@bamboocss/eslint-plugin 1.12.0 → 1.12.2

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.
@@ -1,4455 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
- value: mod,
24
- enumerable: true
25
- }) : target, mod));
26
-
27
- //#endregion
28
- require("@bamboocss/types");
29
- let _bamboocss_config = require("@bamboocss/config");
30
- let _bamboocss_shared = require("@bamboocss/shared");
31
- let _bamboocss_generator = require("@bamboocss/generator");
32
- let _bamboocss_config_ts_path = require("@bamboocss/config/ts-path");
33
- let micromatch = require("micromatch");
34
- micromatch = __toESM(micromatch);
35
- let path = require("path");
36
- path = __toESM(path);
37
- let synckit = require("synckit");
38
- let _typescript_eslint_utils = require("@typescript-eslint/utils");
39
- let node_path = require("node:path");
40
- let node_url = require("node:url");
41
-
42
- //#region tests/fixtures/recipes.ts
43
- const recipes = {
44
- buttonStyle: {
45
- base: {
46
- _hover: {
47
- backgroundColor: "red.200",
48
- color: "white",
49
- fontSize: "3xl"
50
- },
51
- alignItems: "center",
52
- display: "inline-flex",
53
- justifyContent: "center"
54
- },
55
- className: "buttonStyle",
56
- defaultVariants: {
57
- size: "md",
58
- variant: "solid"
59
- },
60
- variants: {
61
- size: {
62
- md: {
63
- height: "3rem",
64
- minWidth: "3rem",
65
- padding: "0 0.75rem"
66
- },
67
- sm: {
68
- height: "2.5rem",
69
- minWidth: "2.5rem",
70
- padding: "0 0.5rem"
71
- }
72
- },
73
- variant: {
74
- outline: {
75
- "&[data-disabled]": {
76
- backgroundColor: "transparent",
77
- border: "1px solid gray",
78
- color: "gray"
79
- },
80
- _hover: {
81
- backgroundColor: "blue",
82
- color: "white"
83
- },
84
- backgroundColor: "transparent",
85
- border: "1px solid blue",
86
- color: "blue"
87
- },
88
- solid: {
89
- "&[data-disabled]": {
90
- backgroundColor: "gray",
91
- color: "black",
92
- fontSize: "2xl"
93
- },
94
- _hover: { backgroundColor: "darkblue" },
95
- backgroundColor: "blue",
96
- color: "white"
97
- }
98
- }
99
- }
100
- },
101
- cardStyle: {
102
- className: "card",
103
- variants: { rounded: { true: { borderRadius: "0.375rem" } } }
104
- },
105
- textStyle: {
106
- base: {
107
- divideX: "20px",
108
- fontFamily: "mono"
109
- },
110
- className: "textStyle",
111
- variants: { size: {
112
- h1: {
113
- fontSize: "5rem",
114
- fontWeight: 800,
115
- lineHeight: "1em"
116
- },
117
- h2: {
118
- fontSize: "3rem",
119
- fontWeight: 700,
120
- letterSpacing: "-0.03em",
121
- lineHeight: "1.2em"
122
- }
123
- } }
124
- },
125
- tooltipStyle: {
126
- base: { "&[data-tooltip], & [data-tooltip]": { color: { _dark: "red" } } },
127
- className: "tooltipStyle"
128
- }
129
- };
130
-
131
- //#endregion
132
- //#region tests/fixtures/semantic-tokens.ts
133
- const semanticTokens = {
134
- colors: {
135
- button: {
136
- card: {
137
- body: { value: {
138
- _dark: "#000",
139
- base: "#fff"
140
- } },
141
- heading: { value: {
142
- _dark: "#000",
143
- base: "#fff"
144
- } }
145
- },
146
- thick: { value: {
147
- _dark: "#000",
148
- base: "#fff"
149
- } }
150
- },
151
- complex: { value: {
152
- _dark: { _highContrast: "{colors.red.700}" },
153
- base: "{colors.red.800}"
154
- } },
155
- primary: { value: {
156
- _dark: "{colors.red.400}",
157
- base: "{colors.red.500}"
158
- } },
159
- secondary: { value: {
160
- _dark: "{colors.red.700}",
161
- base: "{colors.red.800}"
162
- } },
163
- surface: { value: {
164
- _materialTheme: {
165
- _dark: "#m-d",
166
- base: "#m-b"
167
- },
168
- _pastelTheme: {
169
- _dark: { md: "#p-d" },
170
- base: "#p-b"
171
- }
172
- } }
173
- },
174
- spacing: { gutter: { value: {
175
- base: "{spacing.4}",
176
- lg: "{spacing.5}"
177
- } } }
178
- };
179
-
180
- //#endregion
181
- //#region tests/fixtures/slot-recipes.ts
182
- const slotRecipes = {
183
- badge: {
184
- base: { title: {
185
- bg: "red.300",
186
- rounded: "sm"
187
- } },
188
- className: "badge",
189
- compoundVariants: [{
190
- css: { title: { color: "ButtonHighlight" } },
191
- raised: true,
192
- size: "sm"
193
- }],
194
- slots: ["title", "body"],
195
- variants: {
196
- raised: { true: { title: { shadow: "md" } } },
197
- size: { sm: {
198
- body: { color: "red" },
199
- title: { px: "4" }
200
- } }
201
- }
202
- },
203
- checkbox: {
204
- base: {
205
- control: {
206
- borderRadius: "sm",
207
- borderWidth: "1px"
208
- },
209
- label: { marginStart: "2" },
210
- root: {
211
- alignItems: "center",
212
- display: "flex",
213
- gap: "2"
214
- }
215
- },
216
- className: "checkbox",
217
- defaultVariants: { size: "sm" },
218
- slots: [
219
- "root",
220
- "control",
221
- "label"
222
- ],
223
- variants: { size: {
224
- lg: {
225
- control: {
226
- height: "12",
227
- width: "12"
228
- },
229
- label: { fontSize: "lg" }
230
- },
231
- md: {
232
- control: {
233
- height: "10",
234
- width: "10"
235
- },
236
- label: { fontSize: "md" }
237
- },
238
- sm: {
239
- control: {
240
- height: "8",
241
- textStyle: "headline.h1",
242
- width: "8"
243
- },
244
- label: { fontSize: "sm" }
245
- }
246
- } }
247
- }
248
- };
249
-
250
- //#endregion
251
- //#region ../preset-base/dist/index.mjs
252
- const conditions$1 = {
253
- hover: "&:is(:hover, [data-hover])",
254
- focus: "&:is(:focus, [data-focus])",
255
- focusWithin: "&:focus-within",
256
- focusVisible: "&:is(:focus-visible, [data-focus-visible])",
257
- disabled: "&:is(:disabled, [disabled], [data-disabled], [aria-disabled=true])",
258
- active: "&:is(:active, [data-active])",
259
- visited: "&:visited",
260
- target: "&:target",
261
- readOnly: "&:is(:read-only, [data-read-only], [aria-readonly=true])",
262
- readWrite: "&:read-write",
263
- empty: "&:is(:empty, [data-empty])",
264
- checked: "&:is(:checked, [data-checked], [aria-checked=true], [data-state=\"checked\"])",
265
- enabled: "&:enabled",
266
- expanded: "&:is([aria-expanded=true], [data-expanded], [data-state=\"expanded\"])",
267
- highlighted: "&[data-highlighted]",
268
- complete: "&[data-complete]",
269
- incomplete: "&[data-incomplete]",
270
- dragging: "&[data-dragging]",
271
- before: "&::before",
272
- after: "&::after",
273
- firstLetter: "&::first-letter",
274
- firstLine: "&::first-line",
275
- marker: "&::marker, &::-webkit-details-marker",
276
- selection: "&::selection",
277
- file: "&::file-selector-button",
278
- backdrop: "&::backdrop",
279
- first: "&:first-child",
280
- last: "&:last-child",
281
- only: "&:only-child",
282
- even: "&:nth-child(even)",
283
- odd: "&:nth-child(odd)",
284
- firstOfType: "&:first-of-type",
285
- lastOfType: "&:last-of-type",
286
- onlyOfType: "&:only-of-type",
287
- peerFocus: ".peer:is(:focus, [data-focus]) ~ &",
288
- peerHover: ".peer:is(:hover, [data-hover]) ~ &",
289
- peerActive: ".peer:is(:active, [data-active]) ~ &",
290
- peerFocusWithin: ".peer:focus-within ~ &",
291
- peerFocusVisible: ".peer:is(:focus-visible, [data-focus-visible]) ~ &",
292
- peerDisabled: ".peer:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) ~ &",
293
- peerChecked: ".peer:is(:checked, [data-checked], [aria-checked=true], [data-state=\"checked\"]) ~ &",
294
- peerInvalid: ".peer:is(:invalid, [data-invalid], [aria-invalid=true]) ~ &",
295
- peerExpanded: ".peer:is([aria-expanded=true], [data-expanded], [data-state=\"expanded\"]) ~ &",
296
- peerPlaceholderShown: ".peer:placeholder-shown ~ &",
297
- groupFocus: ".group:is(:focus, [data-focus]) &",
298
- groupHover: ".group:is(:hover, [data-hover]) &",
299
- groupActive: ".group:is(:active, [data-active]) &",
300
- groupFocusWithin: ".group:focus-within &",
301
- groupFocusVisible: ".group:is(:focus-visible, [data-focus-visible]) &",
302
- groupDisabled: ".group:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) &",
303
- groupChecked: ".group:is(:checked, [data-checked], [aria-checked=true], [data-state=\"checked\"]) &",
304
- groupExpanded: ".group:is([aria-expanded=true], [data-expanded], [data-state=\"expanded\"]) &",
305
- groupInvalid: ".group:is(:invalid, [data-invalid], [aria-invalid=true]) &",
306
- indeterminate: "&:is(:indeterminate, [data-indeterminate], [aria-checked=mixed], [data-state=\"indeterminate\"])",
307
- required: "&:is(:required, [data-required], [aria-required=true])",
308
- valid: "&:is(:valid, [data-valid])",
309
- invalid: "&:is(:invalid, [data-invalid], [aria-invalid=true])",
310
- autofill: "&:autofill",
311
- inRange: "&:is(:in-range, [data-in-range])",
312
- outOfRange: "&:is(:out-of-range, [data-outside-range])",
313
- placeholder: "&::placeholder, &[data-placeholder]",
314
- placeholderShown: "&:is(:placeholder-shown, [data-placeholder-shown])",
315
- pressed: "&:is([aria-pressed=true], [data-pressed])",
316
- selected: "&:is([aria-selected=true], [data-selected])",
317
- grabbed: "&:is([aria-grabbed=true], [data-grabbed])",
318
- underValue: "&[data-state=under-value]",
319
- overValue: "&[data-state=over-value]",
320
- atValue: "&[data-state=at-value]",
321
- default: "&:default",
322
- optional: "&:optional",
323
- open: "&:is([open], [data-open], [data-state=\"open\"], :popover-open)",
324
- closed: "&:is([closed], [data-closed], [data-state=\"closed\"])",
325
- fullscreen: "&:is(:fullscreen, [data-fullscreen])",
326
- loading: "&:is([data-loading], [aria-busy=true])",
327
- hidden: "&:is([hidden], [data-hidden])",
328
- current: "&:is([aria-current=true], [data-current])",
329
- currentPage: "&[aria-current=page]",
330
- currentStep: "&[aria-current=step]",
331
- today: "&[data-today]",
332
- unavailable: "&[data-unavailable]",
333
- rangeStart: "&[data-range-start]",
334
- rangeEnd: "&[data-range-end]",
335
- now: "&[data-now]",
336
- topmost: "&[data-topmost]",
337
- motionReduce: "@media (prefers-reduced-motion: reduce)",
338
- motionSafe: "@media (prefers-reduced-motion: no-preference)",
339
- print: "@media print",
340
- landscape: "@media (orientation: landscape)",
341
- portrait: "@media (orientation: portrait)",
342
- dark: ".dark &",
343
- light: ".light &",
344
- osDark: "@media (prefers-color-scheme: dark)",
345
- osLight: "@media (prefers-color-scheme: light)",
346
- highContrast: "@media (forced-colors: active)",
347
- lessContrast: "@media (prefers-contrast: less)",
348
- moreContrast: "@media (prefers-contrast: more)",
349
- ltr: ":where([dir=ltr], :dir(ltr)) &",
350
- rtl: ":where([dir=rtl], :dir(rtl)) &",
351
- scrollbar: "&::-webkit-scrollbar",
352
- scrollbarThumb: "&::-webkit-scrollbar-thumb",
353
- scrollbarTrack: "&::-webkit-scrollbar-track",
354
- horizontal: "&[data-orientation=horizontal]",
355
- vertical: "&[data-orientation=vertical]",
356
- icon: "& :where(svg)",
357
- starting: "@starting-style",
358
- noscript: "@media (scripting: none)",
359
- invertedColors: "@media (inverted-colors: inverted)"
360
- };
361
- const EMPTY = "/*-*/ /*-*/";
362
- const globalCss = { "*, ::before, ::after, ::backdrop": {
363
- "--blur": EMPTY,
364
- "--brightness": EMPTY,
365
- "--contrast": EMPTY,
366
- "--grayscale": EMPTY,
367
- "--hue-rotate": EMPTY,
368
- "--invert": EMPTY,
369
- "--saturate": EMPTY,
370
- "--sepia": EMPTY,
371
- "--drop-shadow": EMPTY,
372
- "--backdrop-blur": EMPTY,
373
- "--backdrop-brightness": EMPTY,
374
- "--backdrop-contrast": EMPTY,
375
- "--backdrop-grayscale": EMPTY,
376
- "--backdrop-hue-rotate": EMPTY,
377
- "--backdrop-invert": EMPTY,
378
- "--backdrop-opacity": EMPTY,
379
- "--backdrop-saturate": EMPTY,
380
- "--backdrop-sepia": EMPTY,
381
- "--gradient-from-position": EMPTY,
382
- "--gradient-to-position": EMPTY,
383
- "--gradient-via-position": EMPTY,
384
- "--scroll-snap-strictness": "proximity",
385
- "--border-spacing-x": 0,
386
- "--border-spacing-y": 0,
387
- "--translate-x": 0,
388
- "--translate-y": 0,
389
- "--rotate": 0,
390
- "--rotate-x": 0,
391
- "--rotate-y": 0,
392
- "--skew-x": 0,
393
- "--skew-y": 0,
394
- "--scale-x": 1,
395
- "--scale-y": 1
396
- } };
397
- function definePattern(config) {
398
- return config;
399
- }
400
- const box = definePattern({ transform(props) {
401
- return props;
402
- } });
403
- const flex = definePattern({
404
- properties: {
405
- align: {
406
- type: "property",
407
- value: "alignItems"
408
- },
409
- justify: {
410
- type: "property",
411
- value: "justifyContent"
412
- },
413
- direction: {
414
- type: "property",
415
- value: "flexDirection"
416
- },
417
- wrap: {
418
- type: "property",
419
- value: "flexWrap"
420
- },
421
- basis: {
422
- type: "property",
423
- value: "flexBasis"
424
- },
425
- grow: {
426
- type: "property",
427
- value: "flexGrow"
428
- },
429
- shrink: {
430
- type: "property",
431
- value: "flexShrink"
432
- }
433
- },
434
- transform(props) {
435
- const { direction, align, justify, wrap, basis, grow, shrink, ...rest } = props;
436
- return {
437
- display: "flex",
438
- flexDirection: direction,
439
- alignItems: align,
440
- justifyContent: justify,
441
- flexWrap: wrap,
442
- flexBasis: basis,
443
- flexGrow: grow,
444
- flexShrink: shrink,
445
- ...rest
446
- };
447
- }
448
- });
449
- const stack = definePattern({
450
- properties: {
451
- align: {
452
- type: "property",
453
- value: "alignItems"
454
- },
455
- justify: {
456
- type: "property",
457
- value: "justifyContent"
458
- },
459
- direction: {
460
- type: "property",
461
- value: "flexDirection"
462
- },
463
- gap: {
464
- type: "property",
465
- value: "gap"
466
- }
467
- },
468
- defaultValues: {
469
- direction: "column",
470
- gap: "8px"
471
- },
472
- transform(props) {
473
- const { align, justify, direction, gap, ...rest } = props;
474
- return {
475
- display: "flex",
476
- flexDirection: direction,
477
- alignItems: align,
478
- justifyContent: justify,
479
- gap,
480
- ...rest
481
- };
482
- }
483
- });
484
- const vstack = definePattern({
485
- jsxName: "VStack",
486
- properties: {
487
- justify: {
488
- type: "property",
489
- value: "justifyContent"
490
- },
491
- gap: {
492
- type: "property",
493
- value: "gap"
494
- }
495
- },
496
- defaultValues: { gap: "8px" },
497
- transform(props) {
498
- const { justify, gap, ...rest } = props;
499
- return {
500
- display: "flex",
501
- alignItems: "center",
502
- justifyContent: justify,
503
- gap,
504
- flexDirection: "column",
505
- ...rest
506
- };
507
- }
508
- });
509
- const hstack = definePattern({
510
- jsxName: "HStack",
511
- properties: {
512
- justify: {
513
- type: "property",
514
- value: "justifyContent"
515
- },
516
- gap: {
517
- type: "property",
518
- value: "gap"
519
- }
520
- },
521
- defaultValues: { gap: "8px" },
522
- transform(props) {
523
- const { justify, gap, ...rest } = props;
524
- return {
525
- display: "flex",
526
- alignItems: "center",
527
- justifyContent: justify,
528
- gap,
529
- flexDirection: "row",
530
- ...rest
531
- };
532
- }
533
- });
534
- const spacer = definePattern({
535
- properties: { size: {
536
- type: "token",
537
- value: "spacing"
538
- } },
539
- transform(props, { map, isCssUnit, isCssVar }) {
540
- const { size, ...rest } = props;
541
- return {
542
- alignSelf: "stretch",
543
- justifySelf: "stretch",
544
- flex: map(size, (v) => {
545
- if (v == null) return "1";
546
- return `0 0 ${isCssUnit(v) || isCssVar(v) ? v : `token(spacing.${v}, ${v})`}`;
547
- }),
548
- ...rest
549
- };
550
- }
551
- });
552
- const circle = definePattern({
553
- properties: { size: {
554
- type: "property",
555
- value: "width"
556
- } },
557
- transform(props) {
558
- const { size, ...rest } = props;
559
- return {
560
- display: "flex",
561
- alignItems: "center",
562
- justifyContent: "center",
563
- flex: "0 0 auto",
564
- width: size,
565
- height: size,
566
- borderRadius: "9999px",
567
- ...rest
568
- };
569
- }
570
- });
571
- const square = definePattern({
572
- properties: { size: {
573
- type: "property",
574
- value: "width"
575
- } },
576
- transform(props) {
577
- const { size, ...rest } = props;
578
- return {
579
- display: "flex",
580
- alignItems: "center",
581
- justifyContent: "center",
582
- flex: "0 0 auto",
583
- width: size,
584
- height: size,
585
- ...rest
586
- };
587
- }
588
- });
589
- const grid = definePattern({
590
- properties: {
591
- gap: {
592
- type: "property",
593
- value: "gap"
594
- },
595
- columnGap: {
596
- type: "property",
597
- value: "gap"
598
- },
599
- rowGap: {
600
- type: "property",
601
- value: "gap"
602
- },
603
- columns: { type: "number" },
604
- minChildWidth: {
605
- type: "token",
606
- value: "sizes",
607
- property: "width"
608
- }
609
- },
610
- defaultValues(props) {
611
- return { gap: props.columnGap || props.rowGap ? void 0 : "8px" };
612
- },
613
- transform(props, { map, isCssUnit }) {
614
- const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props;
615
- const getValue = (v) => isCssUnit(v) ? v : `token(sizes.${v}, ${v})`;
616
- return {
617
- display: "grid",
618
- gridTemplateColumns: columns != null ? map(columns, (v) => `repeat(${v}, minmax(0, 1fr))`) : minChildWidth != null ? map(minChildWidth, (v) => `repeat(auto-fit, minmax(${getValue(v)}, 1fr))`) : void 0,
619
- gap,
620
- columnGap,
621
- rowGap,
622
- ...rest
623
- };
624
- }
625
- });
626
- const gridItem = definePattern({
627
- properties: {
628
- colSpan: { type: "number" },
629
- rowSpan: { type: "number" },
630
- colStart: { type: "number" },
631
- rowStart: { type: "number" },
632
- colEnd: { type: "number" },
633
- rowEnd: { type: "number" }
634
- },
635
- transform(props, { map }) {
636
- const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props;
637
- const spanFn = (v) => v === "auto" ? v : `span ${v}`;
638
- return {
639
- gridColumn: colSpan != null ? map(colSpan, spanFn) : void 0,
640
- gridRow: rowSpan != null ? map(rowSpan, spanFn) : void 0,
641
- gridColumnStart: colStart,
642
- gridColumnEnd: colEnd,
643
- gridRowStart: rowStart,
644
- gridRowEnd: rowEnd,
645
- ...rest
646
- };
647
- }
648
- });
649
- const wrap = definePattern({
650
- properties: {
651
- gap: {
652
- type: "property",
653
- value: "gap"
654
- },
655
- rowGap: {
656
- type: "property",
657
- value: "gap"
658
- },
659
- columnGap: {
660
- type: "property",
661
- value: "gap"
662
- },
663
- align: {
664
- type: "property",
665
- value: "alignItems"
666
- },
667
- justify: {
668
- type: "property",
669
- value: "justifyContent"
670
- }
671
- },
672
- transform(props) {
673
- const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "8px", align, justify, ...rest } = props;
674
- return {
675
- display: "flex",
676
- flexWrap: "wrap",
677
- alignItems: align,
678
- justifyContent: justify,
679
- gap,
680
- columnGap,
681
- rowGap,
682
- ...rest
683
- };
684
- }
685
- });
686
- const container$1 = definePattern({ transform(props) {
687
- return {
688
- position: "relative",
689
- maxWidth: "8xl",
690
- mx: "auto",
691
- px: {
692
- base: "4",
693
- md: "6",
694
- lg: "8"
695
- },
696
- ...props
697
- };
698
- } });
699
- const center = definePattern({
700
- properties: { inline: { type: "boolean" } },
701
- transform(props) {
702
- const { inline, ...rest } = props;
703
- return {
704
- display: inline ? "inline-flex" : "flex",
705
- alignItems: "center",
706
- justifyContent: "center",
707
- ...rest
708
- };
709
- }
710
- });
711
- const aspectRatio = definePattern({
712
- properties: { ratio: { type: "number" } },
713
- blocklist: ["aspectRatio"],
714
- transform(props, { map }) {
715
- const { ratio = 4 / 3, ...rest } = props;
716
- return {
717
- position: "relative",
718
- _before: {
719
- content: `""`,
720
- display: "block",
721
- height: "0",
722
- paddingBottom: map(ratio, (r) => `${1 / r * 100}%`)
723
- },
724
- "&>*": {
725
- display: "flex",
726
- justifyContent: "center",
727
- alignItems: "center",
728
- overflow: "hidden",
729
- position: "absolute",
730
- inset: "0",
731
- width: "100%",
732
- height: "100%"
733
- },
734
- "&>img, &>video": { objectFit: "cover" },
735
- ...rest
736
- };
737
- }
738
- });
739
- const divider = definePattern({
740
- properties: {
741
- orientation: {
742
- type: "enum",
743
- value: ["horizontal", "vertical"]
744
- },
745
- thickness: {
746
- type: "token",
747
- value: "sizes",
748
- property: "borderWidth"
749
- },
750
- color: {
751
- type: "token",
752
- value: "colors",
753
- property: "borderColor"
754
- }
755
- },
756
- defaultValues: {
757
- orientation: "horizontal",
758
- thickness: "1px"
759
- },
760
- transform(props, { map }) {
761
- const { orientation, thickness, color, ...rest } = props;
762
- return {
763
- "--thickness": thickness,
764
- width: map(orientation, (v) => v === "vertical" ? void 0 : "100%"),
765
- height: map(orientation, (v) => v === "horizontal" ? void 0 : "100%"),
766
- borderBlockEndWidth: map(orientation, (v) => v === "horizontal" ? "var(--thickness)" : void 0),
767
- borderInlineEndWidth: map(orientation, (v) => v === "vertical" ? "var(--thickness)" : void 0),
768
- borderColor: color,
769
- ...rest
770
- };
771
- }
772
- });
773
- const patterns = {
774
- box,
775
- flex,
776
- stack,
777
- vstack,
778
- hstack,
779
- spacer,
780
- square,
781
- circle,
782
- center,
783
- linkOverlay: definePattern({
784
- jsxElement: "a",
785
- transform(props) {
786
- return {
787
- _before: {
788
- content: "\"\"",
789
- position: "absolute",
790
- inset: "0",
791
- zIndex: "0",
792
- ...props["_before"]
793
- },
794
- ...props
795
- };
796
- }
797
- }),
798
- aspectRatio,
799
- grid,
800
- gridItem,
801
- wrap,
802
- container: container$1,
803
- divider,
804
- float: definePattern({
805
- properties: {
806
- offsetX: {
807
- type: "token",
808
- value: "spacing",
809
- property: "left"
810
- },
811
- offsetY: {
812
- type: "token",
813
- value: "spacing",
814
- property: "top"
815
- },
816
- offset: {
817
- type: "token",
818
- value: "spacing",
819
- property: "top"
820
- },
821
- placement: {
822
- type: "enum",
823
- value: [
824
- "bottom-end",
825
- "bottom-start",
826
- "top-end",
827
- "top-start",
828
- "bottom-center",
829
- "top-center",
830
- "middle-center",
831
- "middle-end",
832
- "middle-start"
833
- ]
834
- }
835
- },
836
- defaultValues(props) {
837
- const offset = props.offset || "0";
838
- return {
839
- offset,
840
- offsetX: offset,
841
- offsetY: offset,
842
- placement: "top-end"
843
- };
844
- },
845
- transform(props, { map }) {
846
- const { offset, offsetX, offsetY, placement, ...rest } = props;
847
- return {
848
- display: "inline-flex",
849
- justifyContent: "center",
850
- alignItems: "center",
851
- position: "absolute",
852
- insetBlockStart: map(placement, (v) => {
853
- const [side] = v.split("-");
854
- return {
855
- top: offsetY,
856
- middle: "50%",
857
- bottom: "auto"
858
- }[side];
859
- }),
860
- insetBlockEnd: map(placement, (v) => {
861
- const [side] = v.split("-");
862
- return {
863
- top: "auto",
864
- middle: "50%",
865
- bottom: offsetY
866
- }[side];
867
- }),
868
- insetInlineStart: map(placement, (v) => {
869
- const [, align] = v.split("-");
870
- return {
871
- start: offsetX,
872
- center: "50%",
873
- end: "auto"
874
- }[align];
875
- }),
876
- insetInlineEnd: map(placement, (v) => {
877
- const [, align] = v.split("-");
878
- return {
879
- start: "auto",
880
- center: "50%",
881
- end: offsetX
882
- }[align];
883
- }),
884
- translate: map(placement, (v) => {
885
- const [side, align] = v.split("-");
886
- return `${{
887
- start: "-50%",
888
- center: "-50%",
889
- end: "50%"
890
- }[align]} ${{
891
- top: "-50%",
892
- middle: "-50%",
893
- bottom: "50%"
894
- }[side]}`;
895
- }),
896
- ...rest
897
- };
898
- }
899
- }),
900
- bleed: definePattern({
901
- properties: {
902
- inline: {
903
- type: "property",
904
- value: "marginInline"
905
- },
906
- block: {
907
- type: "property",
908
- value: "marginBlock"
909
- }
910
- },
911
- defaultValues: {
912
- inline: "0",
913
- block: "0"
914
- },
915
- transform(props, { map, isCssUnit, isCssVar }) {
916
- const { inline, block, ...rest } = props;
917
- const valueFn = (v) => isCssUnit(v) || isCssVar(v) ? v : `token(spacing.${v}, ${v})`;
918
- return {
919
- "--bleed-x": map(inline, valueFn),
920
- "--bleed-y": map(block, valueFn),
921
- marginInline: "calc(var(--bleed-x, 0) * -1)",
922
- marginBlock: "calc(var(--bleed-y, 0) * -1)",
923
- ...rest
924
- };
925
- }
926
- }),
927
- visuallyHidden: definePattern({ transform(props) {
928
- return {
929
- srOnly: true,
930
- ...props
931
- };
932
- } }),
933
- cq: definePattern({
934
- properties: {
935
- name: {
936
- type: "token",
937
- value: "containerNames",
938
- property: "containerName"
939
- },
940
- type: {
941
- type: "property",
942
- value: "containerType"
943
- }
944
- },
945
- defaultValues: { type: "inline-size" },
946
- transform(props) {
947
- const { name, type, ...rest } = props;
948
- return {
949
- containerType: type,
950
- containerName: name,
951
- ...rest
952
- };
953
- }
954
- })
955
- };
956
- const createColorMixTransform = (prop) => (value, args) => {
957
- const mix = args.utils.colorMix(value);
958
- if (mix.invalid) return { [prop]: value };
959
- const cssVar = "--mix-" + prop;
960
- return {
961
- [cssVar]: mix.value,
962
- [prop]: `var(${cssVar}, ${mix.color})`
963
- };
964
- };
965
- const background = {
966
- backgroundPosition: {
967
- shorthand: "bgPosition",
968
- className: "bg-p",
969
- group: "Background"
970
- },
971
- backgroundPositionX: {
972
- shorthand: "bgPositionX",
973
- className: "bg-p-x",
974
- group: "Background"
975
- },
976
- backgroundPositionY: {
977
- shorthand: "bgPositionY",
978
- className: "bg-p-y",
979
- group: "Background"
980
- },
981
- backgroundAttachment: {
982
- shorthand: "bgAttachment",
983
- className: "bg-a",
984
- group: "Background"
985
- },
986
- backgroundClip: {
987
- shorthand: "bgClip",
988
- className: "bg-cp",
989
- group: "Background",
990
- transform(value) {
991
- return {
992
- backgroundClip: value,
993
- WebkitBackgroundClip: value
994
- };
995
- }
996
- },
997
- background: {
998
- shorthand: "bg",
999
- className: "bg",
1000
- values: "colors",
1001
- group: "Background",
1002
- transform: createColorMixTransform("background")
1003
- },
1004
- backgroundColor: {
1005
- shorthand: "bgColor",
1006
- className: "bg-c",
1007
- values: "colors",
1008
- group: "Background",
1009
- transform: createColorMixTransform("backgroundColor")
1010
- },
1011
- backgroundOrigin: {
1012
- shorthand: "bgOrigin",
1013
- className: "bg-o",
1014
- group: "Background"
1015
- },
1016
- backgroundImage: {
1017
- shorthand: "bgImage",
1018
- className: "bg-i",
1019
- values: "assets",
1020
- group: "Background"
1021
- },
1022
- backgroundRepeat: {
1023
- shorthand: "bgRepeat",
1024
- className: "bg-r",
1025
- group: "Background"
1026
- },
1027
- backgroundBlendMode: {
1028
- shorthand: "bgBlendMode",
1029
- className: "bg-bm",
1030
- group: "Background"
1031
- },
1032
- backgroundSize: {
1033
- shorthand: "bgSize",
1034
- className: "bg-s",
1035
- group: "Background"
1036
- }
1037
- };
1038
- const border = {
1039
- borderRadius: {
1040
- className: "bdr",
1041
- shorthand: "rounded",
1042
- values: "radii",
1043
- group: "Border Radius"
1044
- },
1045
- borderTopLeftRadius: {
1046
- className: "bdr-tl",
1047
- shorthand: "roundedTopLeft",
1048
- values: "radii",
1049
- group: "Border Radius"
1050
- },
1051
- borderTopRightRadius: {
1052
- className: "bdr-tr",
1053
- shorthand: "roundedTopRight",
1054
- values: "radii",
1055
- group: "Border Radius"
1056
- },
1057
- borderBottomRightRadius: {
1058
- className: "bdr-br",
1059
- shorthand: "roundedBottomRight",
1060
- values: "radii",
1061
- group: "Border Radius"
1062
- },
1063
- borderBottomLeftRadius: {
1064
- className: "bdr-bl",
1065
- shorthand: "roundedBottomLeft",
1066
- values: "radii",
1067
- group: "Border Radius"
1068
- },
1069
- borderTopRadius: {
1070
- className: "bdr-t",
1071
- shorthand: "roundedTop",
1072
- property: "borderRadius",
1073
- values: "radii",
1074
- group: "Border Radius",
1075
- transform(value) {
1076
- return {
1077
- borderTopLeftRadius: value,
1078
- borderTopRightRadius: value
1079
- };
1080
- }
1081
- },
1082
- borderRightRadius: {
1083
- className: "bdr-r",
1084
- shorthand: "roundedRight",
1085
- property: "borderRadius",
1086
- values: "radii",
1087
- group: "Border Radius",
1088
- transform(value) {
1089
- return {
1090
- borderTopRightRadius: value,
1091
- borderBottomRightRadius: value
1092
- };
1093
- }
1094
- },
1095
- borderBottomRadius: {
1096
- className: "bdr-b",
1097
- shorthand: "roundedBottom",
1098
- property: "borderRadius",
1099
- values: "radii",
1100
- group: "Border Radius",
1101
- transform(value) {
1102
- return {
1103
- borderBottomLeftRadius: value,
1104
- borderBottomRightRadius: value
1105
- };
1106
- }
1107
- },
1108
- borderLeftRadius: {
1109
- className: "bdr-l",
1110
- shorthand: "roundedLeft",
1111
- values: "radii",
1112
- property: "borderRadius",
1113
- group: "Border Radius",
1114
- transform(value) {
1115
- return {
1116
- borderTopLeftRadius: value,
1117
- borderBottomLeftRadius: value
1118
- };
1119
- }
1120
- },
1121
- borderStartStartRadius: {
1122
- className: "bdr-ss",
1123
- shorthand: "roundedStartStart",
1124
- values: "radii",
1125
- group: "Border Radius"
1126
- },
1127
- borderStartEndRadius: {
1128
- className: "bdr-se",
1129
- shorthand: "roundedStartEnd",
1130
- values: "radii",
1131
- group: "Border Radius"
1132
- },
1133
- borderStartRadius: {
1134
- className: "bdr-s",
1135
- values: "radii",
1136
- property: "borderRadius",
1137
- shorthand: "roundedStart",
1138
- group: "Border Radius",
1139
- transform(value) {
1140
- return {
1141
- borderStartStartRadius: value,
1142
- borderEndStartRadius: value
1143
- };
1144
- }
1145
- },
1146
- borderEndStartRadius: {
1147
- className: "bdr-es",
1148
- shorthand: "roundedEndStart",
1149
- values: "radii",
1150
- group: "Border Radius"
1151
- },
1152
- borderEndEndRadius: {
1153
- className: "bdr-ee",
1154
- shorthand: "roundedEndEnd",
1155
- values: "radii",
1156
- group: "Border Radius"
1157
- },
1158
- borderEndRadius: {
1159
- className: "bdr-e",
1160
- shorthand: "roundedEnd",
1161
- property: "borderRadius",
1162
- values: "radii",
1163
- group: "Border Radius",
1164
- transform(value) {
1165
- return {
1166
- borderStartEndRadius: value,
1167
- borderEndEndRadius: value
1168
- };
1169
- }
1170
- },
1171
- border: {
1172
- className: "bd",
1173
- values: "borders",
1174
- group: "Border"
1175
- },
1176
- borderWidth: {
1177
- className: "bd-w",
1178
- values: "borderWidths",
1179
- group: "Border Radius"
1180
- },
1181
- borderTopWidth: {
1182
- className: "bd-t-w",
1183
- values: "borderWidths",
1184
- group: "Border"
1185
- },
1186
- borderLeftWidth: {
1187
- className: "bd-l-w",
1188
- values: "borderWidths",
1189
- group: "Border"
1190
- },
1191
- borderRightWidth: {
1192
- className: "bd-r-w",
1193
- values: "borderWidths",
1194
- group: "Border"
1195
- },
1196
- borderBottomWidth: {
1197
- className: "bd-b-w",
1198
- values: "borderWidths",
1199
- group: "Border"
1200
- },
1201
- borderBlockStartWidth: {
1202
- className: "bd-bs-w",
1203
- values: "borderWidths",
1204
- group: "Border Radius"
1205
- },
1206
- borderBlockEndWidth: {
1207
- className: "bd-be-w",
1208
- values: "borderWidths",
1209
- group: "Border Radius"
1210
- },
1211
- borderColor: {
1212
- className: "bd-c",
1213
- values: "colors",
1214
- group: "Border",
1215
- transform: createColorMixTransform("borderColor")
1216
- },
1217
- borderInline: {
1218
- className: "bd-x",
1219
- values: "borders",
1220
- group: "Border",
1221
- shorthand: "borderX"
1222
- },
1223
- borderInlineWidth: {
1224
- className: "bd-x-w",
1225
- values: "borderWidths",
1226
- group: "Border",
1227
- shorthand: "borderXWidth"
1228
- },
1229
- borderInlineColor: {
1230
- className: "bd-x-c",
1231
- values: "colors",
1232
- group: "Border",
1233
- shorthand: "borderXColor",
1234
- transform: createColorMixTransform("borderInlineColor")
1235
- },
1236
- borderBlock: {
1237
- className: "bd-y",
1238
- values: "borders",
1239
- group: "Border",
1240
- shorthand: "borderY"
1241
- },
1242
- borderBlockWidth: {
1243
- className: "bd-y-w",
1244
- values: "borderWidths",
1245
- group: "Border",
1246
- shorthand: "borderYWidth"
1247
- },
1248
- borderBlockColor: {
1249
- className: "bd-y-c",
1250
- values: "colors",
1251
- group: "Border",
1252
- shorthand: "borderYColor",
1253
- transform: createColorMixTransform("borderBlockColor")
1254
- },
1255
- borderLeft: {
1256
- className: "bd-l",
1257
- values: "borders",
1258
- group: "Border"
1259
- },
1260
- borderLeftColor: {
1261
- className: "bd-l-c",
1262
- values: "colors",
1263
- group: "Border",
1264
- transform: createColorMixTransform("borderLeftColor")
1265
- },
1266
- borderInlineStart: {
1267
- className: "bd-s",
1268
- values: "borders",
1269
- group: "Border",
1270
- shorthand: "borderStart"
1271
- },
1272
- borderInlineStartWidth: {
1273
- className: "bd-s-w",
1274
- values: "borderWidths",
1275
- group: "Border",
1276
- shorthand: "borderStartWidth"
1277
- },
1278
- borderInlineStartColor: {
1279
- className: "bd-s-c",
1280
- values: "colors",
1281
- group: "Border",
1282
- shorthand: "borderStartColor",
1283
- transform: createColorMixTransform("borderInlineStartColor")
1284
- },
1285
- borderRight: {
1286
- className: "bd-r",
1287
- values: "borders",
1288
- group: "Border"
1289
- },
1290
- borderRightColor: {
1291
- className: "bd-r-c",
1292
- values: "colors",
1293
- group: "Border",
1294
- transform: createColorMixTransform("borderRightColor")
1295
- },
1296
- borderInlineEnd: {
1297
- className: "bd-e",
1298
- values: "borders",
1299
- group: "Border",
1300
- shorthand: "borderEnd"
1301
- },
1302
- borderInlineEndWidth: {
1303
- className: "bd-e-w",
1304
- values: "borderWidths",
1305
- group: "Border",
1306
- shorthand: "borderEndWidth"
1307
- },
1308
- borderInlineEndColor: {
1309
- className: "bd-e-c",
1310
- values: "colors",
1311
- group: "Border",
1312
- shorthand: "borderEndColor",
1313
- transform: createColorMixTransform("borderInlineEndColor")
1314
- },
1315
- borderTop: {
1316
- className: "bd-t",
1317
- values: "borders",
1318
- group: "Border"
1319
- },
1320
- borderTopColor: {
1321
- className: "bd-t-c",
1322
- values: "colors",
1323
- group: "Border",
1324
- transform: createColorMixTransform("borderTopColor")
1325
- },
1326
- borderBottom: {
1327
- className: "bd-b",
1328
- values: "borders",
1329
- group: "Border"
1330
- },
1331
- borderBottomColor: {
1332
- className: "bd-b-c",
1333
- values: "colors",
1334
- group: "Border",
1335
- transform: createColorMixTransform("borderBottomColor")
1336
- },
1337
- borderBlockEnd: {
1338
- className: "bd-be",
1339
- values: "borders",
1340
- group: "Border"
1341
- },
1342
- borderBlockEndColor: {
1343
- className: "bd-be-c",
1344
- values: "colors",
1345
- group: "Border",
1346
- transform: createColorMixTransform("borderBlockEndColor")
1347
- },
1348
- borderBlockStart: {
1349
- className: "bd-bs",
1350
- values: "borders",
1351
- group: "Border"
1352
- },
1353
- borderBlockStartColor: {
1354
- className: "bd-bs-c",
1355
- values: "colors",
1356
- group: "Border",
1357
- transform: createColorMixTransform("borderBlockStartColor")
1358
- }
1359
- };
1360
- const container = {
1361
- container: {
1362
- className: "cq",
1363
- group: "Container"
1364
- },
1365
- containerName: {
1366
- className: "cq-n",
1367
- property: "containerName",
1368
- values: "containerNames",
1369
- group: "Container"
1370
- },
1371
- containerType: {
1372
- className: "cq-t",
1373
- group: "Container"
1374
- }
1375
- };
1376
- const cursor = { cursor: {
1377
- className: "cursor",
1378
- values: "cursor",
1379
- group: "System"
1380
- } };
1381
- const display = {
1382
- display: {
1383
- className: "d",
1384
- group: "Display"
1385
- },
1386
- hideFrom: {
1387
- className: "hide",
1388
- values: "breakpoints",
1389
- group: "Display",
1390
- transform(value, { raw, token }) {
1391
- return { [token.raw(`breakpoints.${raw}`) ? `@breakpoint ${raw}` : `@media screen and (min-width: ${value})`]: { display: "none" } };
1392
- }
1393
- },
1394
- hideBelow: {
1395
- className: "show",
1396
- values: "breakpoints",
1397
- group: "Display",
1398
- transform(value, { raw, token }) {
1399
- return { [token.raw(`breakpoints.${raw}`) ? `@breakpoint ${raw}Down` : `@media screen and (max-width: ${value})`]: { display: "none" } };
1400
- }
1401
- }
1402
- };
1403
- const divideColor = createColorMixTransform("borderColor");
1404
- const divide = {
1405
- divideX: {
1406
- className: "dvd-x",
1407
- values: "borderWidths",
1408
- group: "Border",
1409
- transform(value) {
1410
- return { "& > :not([hidden]) ~ :not([hidden])": {
1411
- borderInlineStartWidth: value,
1412
- borderInlineEndWidth: "0px"
1413
- } };
1414
- }
1415
- },
1416
- divideY: {
1417
- className: "dvd-y",
1418
- values: "borderWidths",
1419
- group: "Border",
1420
- transform(value) {
1421
- return { "& > :not([hidden]) ~ :not([hidden])": {
1422
- borderTopWidth: value,
1423
- borderBottomWidth: "0px"
1424
- } };
1425
- }
1426
- },
1427
- divideColor: {
1428
- className: "dvd-c",
1429
- values: "colors",
1430
- group: "Border",
1431
- transform(value, args) {
1432
- return { "& > :not([hidden]) ~ :not([hidden])": divideColor(value, args) };
1433
- }
1434
- },
1435
- divideStyle: {
1436
- className: "dvd-s",
1437
- property: "borderStyle",
1438
- group: "Border",
1439
- transform(value) {
1440
- return { "& > :not([hidden]) ~ :not([hidden])": { borderStyle: value } };
1441
- }
1442
- }
1443
- };
1444
- const effects = {
1445
- opacity: {
1446
- className: "op",
1447
- values: "opacity",
1448
- group: "Background"
1449
- },
1450
- boxShadow: {
1451
- shorthand: "shadow",
1452
- className: "bx-sh",
1453
- values: "shadows",
1454
- group: "Shadow"
1455
- },
1456
- boxShadowColor: {
1457
- shorthand: "shadowColor",
1458
- className: "bx-sh-c",
1459
- values: "colors",
1460
- transform: createColorMixTransform("--shadow-color"),
1461
- group: "Color"
1462
- },
1463
- mixBlendMode: {
1464
- className: "mix-bm",
1465
- group: "Effect"
1466
- },
1467
- filter: {
1468
- className: "filter",
1469
- group: "Effect",
1470
- values: { auto: "var(--blur, ) var(--brightness, ) var(--contrast, ) var(--grayscale, ) var(--hue-rotate, ) var(--invert, ) var(--saturate, ) var(--sepia, ) var(--drop-shadow, )" }
1471
- },
1472
- brightness: {
1473
- className: "brightness",
1474
- group: "Effect",
1475
- transform(value) {
1476
- return { "--brightness": `brightness(${value})` };
1477
- }
1478
- },
1479
- contrast: {
1480
- className: "contrast",
1481
- group: "Effect",
1482
- transform(value) {
1483
- return { "--contrast": `contrast(${value})` };
1484
- }
1485
- },
1486
- grayscale: {
1487
- className: "grayscale",
1488
- group: "Effect",
1489
- transform(value) {
1490
- return { "--grayscale": `grayscale(${value})` };
1491
- }
1492
- },
1493
- hueRotate: {
1494
- className: "hue-rotate",
1495
- group: "Effect",
1496
- transform(value) {
1497
- return { "--hue-rotate": `hue-rotate(${value})` };
1498
- }
1499
- },
1500
- invert: {
1501
- className: "invert",
1502
- group: "Effect",
1503
- transform(value) {
1504
- return { "--invert": `invert(${value})` };
1505
- }
1506
- },
1507
- saturate: {
1508
- className: "saturate",
1509
- group: "Effect",
1510
- transform(value) {
1511
- return { "--saturate": `saturate(${value})` };
1512
- }
1513
- },
1514
- sepia: {
1515
- className: "sepia",
1516
- group: "Effect",
1517
- transform(value) {
1518
- return { "--sepia": `sepia(${value})` };
1519
- }
1520
- },
1521
- dropShadow: {
1522
- className: "drop-shadow",
1523
- group: "Effect",
1524
- values: "dropShadows",
1525
- transform(value) {
1526
- return { "--drop-shadow": value };
1527
- }
1528
- },
1529
- blur: {
1530
- className: "blur",
1531
- group: "Effect",
1532
- values: "blurs",
1533
- transform(value) {
1534
- return { "--blur": `blur(${value})` };
1535
- }
1536
- },
1537
- backdropFilter: {
1538
- className: "bkdp",
1539
- group: "Effect",
1540
- values: { auto: "var(--backdrop-blur, ) var(--backdrop-brightness, ) var(--backdrop-contrast, ) var(--backdrop-grayscale, ) var(--backdrop-hue-rotate, ) var(--backdrop-invert, ) var(--backdrop-opacity, ) var(--backdrop-saturate, ) var(--backdrop-sepia, )" },
1541
- transform(value) {
1542
- return {
1543
- backdropFilter: value,
1544
- WebkitBackdropFilter: value
1545
- };
1546
- }
1547
- },
1548
- backdropBlur: {
1549
- className: "bkdp-blur",
1550
- group: "Effect",
1551
- values: "blurs",
1552
- transform(value) {
1553
- return { "--backdrop-blur": `blur(${value})` };
1554
- }
1555
- },
1556
- backdropBrightness: {
1557
- className: "bkdp-brightness",
1558
- group: "Effect",
1559
- transform(value) {
1560
- return { "--backdrop-brightness": `brightness(${value})` };
1561
- }
1562
- },
1563
- backdropContrast: {
1564
- className: "bkdp-contrast",
1565
- group: "Effect",
1566
- transform(value) {
1567
- return { "--backdrop-contrast": `contrast(${value})` };
1568
- }
1569
- },
1570
- backdropGrayscale: {
1571
- className: "bkdp-grayscale",
1572
- group: "Effect",
1573
- transform(value) {
1574
- return { "--backdrop-grayscale": `grayscale(${value})` };
1575
- }
1576
- },
1577
- backdropHueRotate: {
1578
- className: "bkdp-hue-rotate",
1579
- group: "Effect",
1580
- transform(value) {
1581
- return { "--backdrop-hue-rotate": `hue-rotate(${value})` };
1582
- }
1583
- },
1584
- backdropInvert: {
1585
- className: "bkdp-invert",
1586
- group: "Effect",
1587
- transform(value) {
1588
- return { "--backdrop-invert": `invert(${value})` };
1589
- }
1590
- },
1591
- backdropOpacity: {
1592
- className: "bkdp-opacity",
1593
- group: "Effect",
1594
- transform(value) {
1595
- return { "--backdrop-opacity": value };
1596
- }
1597
- },
1598
- backdropSaturate: {
1599
- className: "bkdp-saturate",
1600
- group: "Effect",
1601
- transform(value) {
1602
- return { "--backdrop-saturate": `saturate(${value})` };
1603
- }
1604
- },
1605
- backdropSepia: {
1606
- className: "bkdp-sepia",
1607
- group: "Effect",
1608
- transform(value) {
1609
- return { "--backdrop-sepia": `sepia(${value})` };
1610
- }
1611
- }
1612
- };
1613
- const flexGrid = {
1614
- flexBasis: {
1615
- className: "flex-b",
1616
- group: "Flex Layout",
1617
- values(theme) {
1618
- return {
1619
- ...theme("sizes"),
1620
- "1/2": "50%",
1621
- "1/3": "33.333333%",
1622
- "2/3": "66.666667%",
1623
- "1/4": "25%",
1624
- "2/4": "50%",
1625
- "3/4": "75%",
1626
- "1/5": "20%",
1627
- "2/5": "40%",
1628
- "3/5": "60%",
1629
- "4/5": "80%",
1630
- "1/6": "16.666667%",
1631
- "2/6": "33.333333%",
1632
- "3/6": "50%",
1633
- "4/6": "66.666667%",
1634
- "5/6": "83.333333%",
1635
- "1/12": "8.333333%",
1636
- "2/12": "16.666667%",
1637
- "3/12": "25%",
1638
- "4/12": "33.333333%",
1639
- "5/12": "41.666667%",
1640
- "6/12": "50%",
1641
- "7/12": "58.333333%",
1642
- "8/12": "66.666667%",
1643
- "9/12": "75%",
1644
- "10/12": "83.333333%",
1645
- "11/12": "91.666667%",
1646
- full: "100%"
1647
- };
1648
- }
1649
- },
1650
- flex: {
1651
- className: "flex",
1652
- group: "Flex Layout",
1653
- values: {
1654
- "1": "1 1 0%",
1655
- auto: "1 1 auto",
1656
- initial: "0 1 auto",
1657
- none: "none"
1658
- }
1659
- },
1660
- flexDirection: {
1661
- className: "flex-d",
1662
- group: "Flex Layout",
1663
- shorthand: "flexDir"
1664
- },
1665
- flexGrow: {
1666
- className: "flex-g",
1667
- group: "Flex Layout"
1668
- },
1669
- flexShrink: {
1670
- className: "flex-sh",
1671
- group: "Flex Layout"
1672
- },
1673
- gridTemplateColumns: {
1674
- className: "grid-tc",
1675
- group: "Grid Layout"
1676
- },
1677
- gridTemplateRows: {
1678
- className: "grid-tr",
1679
- group: "Grid Layout"
1680
- },
1681
- gridColumn: {
1682
- className: "grid-c",
1683
- group: "Grid Layout"
1684
- },
1685
- gridRow: {
1686
- className: "grid-r",
1687
- group: "Grid Layout"
1688
- },
1689
- gridColumnStart: {
1690
- className: "grid-cs",
1691
- group: "Grid Layout"
1692
- },
1693
- gridColumnEnd: {
1694
- className: "grid-ce",
1695
- group: "Grid Layout"
1696
- },
1697
- gridAutoFlow: {
1698
- className: "grid-af",
1699
- group: "Grid Layout"
1700
- },
1701
- gridAutoColumns: {
1702
- className: "grid-ac",
1703
- group: "Grid Layout",
1704
- values: {
1705
- min: "min-content",
1706
- max: "max-content",
1707
- fr: "minmax(0, 1fr)"
1708
- }
1709
- },
1710
- gridAutoRows: {
1711
- className: "grid-ar",
1712
- group: "Grid Layout",
1713
- values: {
1714
- min: "min-content",
1715
- max: "max-content",
1716
- fr: "minmax(0, 1fr)"
1717
- }
1718
- },
1719
- gap: {
1720
- className: "gap",
1721
- group: "Flex Layout",
1722
- values: "spacing"
1723
- },
1724
- gridGap: {
1725
- className: "grid-g",
1726
- group: "Grid Layout",
1727
- values: "spacing"
1728
- },
1729
- gridRowGap: {
1730
- className: "grid-rg",
1731
- group: "Grid Layout",
1732
- values: "spacing"
1733
- },
1734
- gridColumnGap: {
1735
- className: "grid-cg",
1736
- group: "Grid Layout",
1737
- values: "spacing"
1738
- },
1739
- rowGap: {
1740
- className: "rg",
1741
- group: "Grid Layout",
1742
- values: "spacing"
1743
- },
1744
- columnGap: {
1745
- className: "cg",
1746
- group: "Grid Layout",
1747
- values: "spacing"
1748
- },
1749
- justifyContent: {
1750
- className: "jc",
1751
- group: "Flex Layout"
1752
- },
1753
- alignContent: {
1754
- className: "ac",
1755
- group: "Flex Layout"
1756
- },
1757
- alignItems: {
1758
- className: "ai",
1759
- group: "Flex Layout"
1760
- },
1761
- alignSelf: {
1762
- className: "as",
1763
- group: "Flex Layout"
1764
- }
1765
- };
1766
- function createFocusRing(selector, className) {
1767
- return {
1768
- className,
1769
- group: "Focus Ring",
1770
- values: [
1771
- "outside",
1772
- "inside",
1773
- "mixed",
1774
- "none"
1775
- ],
1776
- transform(value) {
1777
- const focusRingColor = `var(--focus-ring-color-prop, var(--global-color-focus-ring, #005FCC))`;
1778
- switch (value) {
1779
- case "inside": return {
1780
- "--focus-ring-color": focusRingColor,
1781
- [selector]: {
1782
- outlineOffset: "0px",
1783
- outlineWidth: "var(--focus-ring-width, 1px)",
1784
- outlineColor: "var(--focus-ring-color)",
1785
- outlineStyle: "var(--focus-ring-style, solid)",
1786
- borderColor: "var(--focus-ring-color)"
1787
- }
1788
- };
1789
- case "outside": return {
1790
- "--focus-ring-color": focusRingColor,
1791
- [selector]: {
1792
- outlineWidth: "var(--focus-ring-width, 2px)",
1793
- outlineOffset: "var(--focus-ring-offset, 2px)",
1794
- outlineStyle: "var(--focus-ring-style, solid)",
1795
- outlineColor: "var(--focus-ring-color)"
1796
- }
1797
- };
1798
- case "mixed": return {
1799
- "--focus-ring-color": focusRingColor,
1800
- [selector]: {
1801
- outlineOffset: "0px",
1802
- outlineWidth: "var(--focus-ring-width, 3px)",
1803
- outlineStyle: "var(--focus-ring-style, solid)",
1804
- outlineColor: "color-mix(in srgb, var(--focus-ring-color), transparent 60%)",
1805
- borderColor: "var(--focus-ring-color)"
1806
- }
1807
- };
1808
- case "none": return {
1809
- "--focus-ring-color": focusRingColor,
1810
- [selector]: { outline: "none" }
1811
- };
1812
- default: return {};
1813
- }
1814
- }
1815
- };
1816
- }
1817
- const focusRing = {
1818
- focusRing: createFocusRing("&:is(:focus, [data-focus])", "focus-ring"),
1819
- focusVisibleRing: createFocusRing("&:is(:focus-visible, [data-focus-visible])", "focus-v-ring"),
1820
- focusRingColor: {
1821
- className: "focus-ring-c",
1822
- values: "colors",
1823
- group: "Focus Ring",
1824
- transform(value, { utils }) {
1825
- const prop = "--focus-ring-color-prop";
1826
- const mix = utils.colorMix(value);
1827
- if (mix.invalid) return { [prop]: value };
1828
- const cssVar = "--mix-" + prop;
1829
- return {
1830
- [cssVar]: mix.value,
1831
- [prop]: `var(${cssVar}, ${mix.color})`
1832
- };
1833
- }
1834
- },
1835
- focusRingOffset: {
1836
- className: "focus-ring-o",
1837
- values: "spacing",
1838
- group: "Focus Ring",
1839
- transform: (v) => ({ "--focus-ring-offset": v })
1840
- },
1841
- focusRingWidth: {
1842
- className: "focus-ring-w",
1843
- values: "borderWidths",
1844
- property: "outlineWidth",
1845
- group: "Focus Ring",
1846
- transform: (v) => ({ "--focus-ring-width": v })
1847
- },
1848
- focusRingStyle: {
1849
- className: "focus-ring-s",
1850
- values: "borderStyles",
1851
- property: "outlineStyle",
1852
- group: "Focus Ring",
1853
- transform: (v) => ({ "--focus-ring-style": v })
1854
- }
1855
- };
1856
- const gradientVia = createColorMixTransform("--gradient-via");
1857
- const linearGradientDirectionMap = new Map([
1858
- ["to-t", "to top"],
1859
- ["to-tr", "to top right"],
1860
- ["to-r", "to right"],
1861
- ["to-br", "to bottom right"],
1862
- ["to-b", "to bottom"],
1863
- ["to-bl", "to bottom left"],
1864
- ["to-l", "to left"],
1865
- ["to-tl", "to top left"]
1866
- ]);
1867
- const isGradientShortcut = (value) => linearGradientDirectionMap.has(value);
1868
- const linearGradientValues = (theme) => {
1869
- return {
1870
- ...theme("gradients"),
1871
- ...Object.fromEntries(linearGradientDirectionMap.entries())
1872
- };
1873
- };
1874
- const gradientStops = "var(--gradient-via-stops, var(--gradient-position), var(--gradient-from) var(--gradient-from-position), var(--gradient-to) var(--gradient-to-position))";
1875
- const gradientViaStops = "var(--gradient-position), var(--gradient-from) var(--gradient-from-position), var(--gradient-via) var(--gradient-via-position), var(--gradient-to) var(--gradient-to-position)";
1876
- const backgroundGradients = {
1877
- backgroundGradient: {
1878
- shorthand: "bgGradient",
1879
- className: "bg-grad",
1880
- group: "Background Gradient",
1881
- values: linearGradientValues,
1882
- transform(value, { raw, token }) {
1883
- const tokenValue = token(`gradients.${raw}`);
1884
- if (tokenValue) return { backgroundImage: tokenValue };
1885
- if (!isGradientShortcut(raw)) return { backgroundImage: value };
1886
- return {
1887
- "--gradient-stops": gradientStops,
1888
- "--gradient-position": linearGradientDirectionMap.get(raw),
1889
- backgroundImage: `linear-gradient(var(--gradient-stops))`
1890
- };
1891
- }
1892
- },
1893
- backgroundLinear: {
1894
- shorthand: "bgLinear",
1895
- className: "bg-linear",
1896
- group: "Background Gradient",
1897
- values: linearGradientValues,
1898
- transform(value, { raw, token }) {
1899
- const tokenValue = token(`gradients.${raw}`);
1900
- if (tokenValue) return { backgroundImage: tokenValue };
1901
- if (!isGradientShortcut(raw)) return { backgroundImage: value };
1902
- return {
1903
- "--gradient-stops": gradientStops,
1904
- "--gradient-position": linearGradientDirectionMap.get(raw),
1905
- backgroundImage: `linear-gradient(var(--gradient-stops))`
1906
- };
1907
- }
1908
- },
1909
- backgroundRadial: {
1910
- shorthand: "bgRadial",
1911
- className: "bg-radial",
1912
- group: "Background Gradient",
1913
- values: "gradients",
1914
- transform(value, { raw, token }) {
1915
- const tokenValue = token(`gradients.${raw}`);
1916
- if (tokenValue) return { backgroundImage: tokenValue };
1917
- return {
1918
- "--gradient-stops": gradientStops,
1919
- "--gradient-position": value,
1920
- backgroundImage: `radial-gradient(var(--gradient-stops,${value}))`
1921
- };
1922
- }
1923
- },
1924
- backgroundConic: {
1925
- shorthand: "bgConic",
1926
- className: "bg-conic",
1927
- group: "Background Gradient",
1928
- transform(value) {
1929
- return {
1930
- "--gradient-stops": gradientStops,
1931
- "--gradient-position": value,
1932
- backgroundImage: `conic-gradient(var(--gradient-stops))`
1933
- };
1934
- }
1935
- },
1936
- textGradient: {
1937
- className: "txt-grad",
1938
- group: "Background Gradient",
1939
- values: linearGradientValues,
1940
- transform(value, { raw, token }) {
1941
- const tokenValue = token(`gradients.${raw}`);
1942
- if (tokenValue) return {
1943
- backgroundImage: tokenValue,
1944
- WebkitBackgroundClip: "text",
1945
- color: "transparent"
1946
- };
1947
- if (!isGradientShortcut(raw)) return {
1948
- backgroundImage: value,
1949
- WebkitBackgroundClip: "text",
1950
- color: "transparent"
1951
- };
1952
- return {
1953
- "--gradient-stops": gradientStops,
1954
- "--gradient-position": linearGradientDirectionMap.get(raw),
1955
- backgroundImage: `linear-gradient(var(--gradient-stops))`,
1956
- WebkitBackgroundClip: "text",
1957
- color: "transparent"
1958
- };
1959
- }
1960
- },
1961
- gradientFromPosition: {
1962
- className: "grad-from-pos",
1963
- group: "Background Gradient",
1964
- transform(value) {
1965
- return { "--gradient-from-position": value };
1966
- }
1967
- },
1968
- gradientToPosition: {
1969
- className: "grad-to-pos",
1970
- group: "Background Gradient",
1971
- transform(value) {
1972
- return { "--gradient-to-position": value };
1973
- }
1974
- },
1975
- gradientFrom: {
1976
- className: "grad-from",
1977
- values: "colors",
1978
- group: "Background Gradient",
1979
- transform: createColorMixTransform("--gradient-from")
1980
- },
1981
- gradientTo: {
1982
- className: "grad-to",
1983
- values: "colors",
1984
- group: "Background Gradient",
1985
- transform: createColorMixTransform("--gradient-to")
1986
- },
1987
- gradientVia: {
1988
- className: "grad-via",
1989
- values: "colors",
1990
- group: "Background Gradient",
1991
- transform(value, args) {
1992
- return {
1993
- ...gradientVia(value, args),
1994
- "--gradient-stops": "var(--gradient-via-stops)",
1995
- "--gradient-via-stops": gradientViaStops
1996
- };
1997
- }
1998
- },
1999
- gradientViaPosition: {
2000
- className: "grad-via-pos",
2001
- group: "Background Gradient",
2002
- transform(value) {
2003
- return { "--gradient-via-position": value };
2004
- }
2005
- }
2006
- };
2007
- const srMapping = {
2008
- true: {
2009
- position: "absolute",
2010
- width: "1px",
2011
- height: "1px",
2012
- padding: "0",
2013
- margin: "-1px",
2014
- overflow: "hidden",
2015
- clip: "rect(0, 0, 0, 0)",
2016
- whiteSpace: "nowrap",
2017
- borderWidth: "0"
2018
- },
2019
- false: {
2020
- position: "static",
2021
- width: "auto",
2022
- height: "auto",
2023
- padding: "0",
2024
- margin: "0",
2025
- overflow: "visible",
2026
- clip: "auto",
2027
- whiteSpace: "normal"
2028
- }
2029
- };
2030
- const helpers = {
2031
- srOnly: {
2032
- className: "sr",
2033
- values: { type: "boolean" },
2034
- group: "Other",
2035
- transform(value) {
2036
- return srMapping[value] || {};
2037
- }
2038
- },
2039
- debug: {
2040
- className: "debug",
2041
- values: { type: "boolean" },
2042
- group: "Other",
2043
- transform(value) {
2044
- if (!value) return {};
2045
- return {
2046
- outline: "1px solid blue !important",
2047
- "&>*": { outline: "1px solid red !important" }
2048
- };
2049
- }
2050
- }
2051
- };
2052
- const interactivity = {
2053
- accentColor: {
2054
- className: "ac-c",
2055
- values: "colors",
2056
- transform: createColorMixTransform("accentColor"),
2057
- group: "Color"
2058
- },
2059
- caretColor: {
2060
- className: "ca-c",
2061
- values: "colors",
2062
- group: "Color",
2063
- transform: createColorMixTransform("caretColor")
2064
- },
2065
- scrollBehavior: {
2066
- className: "scr-bhv",
2067
- group: "Scroll"
2068
- },
2069
- scrollbar: {
2070
- className: "scr-bar",
2071
- values: ["visible", "hidden"],
2072
- group: "Scroll",
2073
- transform(value) {
2074
- if (value === "visible") return {
2075
- msOverflowStyle: "auto",
2076
- scrollbarWidth: "auto",
2077
- "&::-webkit-scrollbar": { display: "block" }
2078
- };
2079
- if (value === "hidden") return {
2080
- msOverflowStyle: "none",
2081
- scrollbarWidth: "none",
2082
- "&::-webkit-scrollbar": { display: "none" }
2083
- };
2084
- }
2085
- },
2086
- scrollbarColor: {
2087
- className: "scr-bar-c",
2088
- values: "colors",
2089
- group: "Scroll",
2090
- transform: createColorMixTransform("scrollbarColor")
2091
- },
2092
- scrollbarGutter: {
2093
- className: "scr-bar-g",
2094
- group: "Scroll"
2095
- },
2096
- scrollbarWidth: {
2097
- className: "scr-bar-w",
2098
- values: "sizes",
2099
- group: "Scroll"
2100
- },
2101
- scrollMargin: {
2102
- className: "scr-m",
2103
- values: "spacing",
2104
- group: "Scroll"
2105
- },
2106
- scrollMarginLeft: {
2107
- className: "scr-ml",
2108
- values: "spacing",
2109
- group: "Scroll"
2110
- },
2111
- scrollMarginRight: {
2112
- className: "scr-mr",
2113
- values: "spacing",
2114
- group: "Scroll"
2115
- },
2116
- scrollMarginTop: {
2117
- className: "scr-mt",
2118
- values: "spacing",
2119
- group: "Scroll"
2120
- },
2121
- scrollMarginBottom: {
2122
- className: "scr-mb",
2123
- values: "spacing",
2124
- group: "Scroll"
2125
- },
2126
- scrollMarginBlock: {
2127
- className: "scr-my",
2128
- values: "spacing",
2129
- group: "Scroll",
2130
- shorthand: ["scrollMarginY"]
2131
- },
2132
- scrollMarginBlockEnd: {
2133
- className: "scr-mbe",
2134
- values: "spacing",
2135
- group: "Scroll"
2136
- },
2137
- scrollMarginBlockStart: {
2138
- className: "scr-mbt",
2139
- values: "spacing",
2140
- group: "Scroll"
2141
- },
2142
- scrollMarginInline: {
2143
- className: "scr-mx",
2144
- values: "spacing",
2145
- group: "Scroll",
2146
- shorthand: ["scrollMarginX"]
2147
- },
2148
- scrollMarginInlineEnd: {
2149
- className: "scr-me",
2150
- values: "spacing",
2151
- group: "Scroll"
2152
- },
2153
- scrollMarginInlineStart: {
2154
- className: "scr-ms",
2155
- values: "spacing",
2156
- group: "Scroll"
2157
- },
2158
- scrollPadding: {
2159
- className: "scr-p",
2160
- values: "spacing",
2161
- group: "Scroll"
2162
- },
2163
- scrollPaddingBlock: {
2164
- className: "scr-py",
2165
- values: "spacing",
2166
- group: "Scroll",
2167
- shorthand: ["scrollPaddingY"]
2168
- },
2169
- scrollPaddingBlockStart: {
2170
- className: "scr-pbs",
2171
- values: "spacing",
2172
- group: "Scroll"
2173
- },
2174
- scrollPaddingBlockEnd: {
2175
- className: "scr-pbe",
2176
- values: "spacing",
2177
- group: "Scroll"
2178
- },
2179
- scrollPaddingInline: {
2180
- className: "scr-px",
2181
- values: "spacing",
2182
- group: "Scroll",
2183
- shorthand: ["scrollPaddingX"]
2184
- },
2185
- scrollPaddingInlineEnd: {
2186
- className: "scr-pe",
2187
- values: "spacing",
2188
- group: "Scroll"
2189
- },
2190
- scrollPaddingInlineStart: {
2191
- className: "scr-ps",
2192
- values: "spacing",
2193
- group: "Scroll"
2194
- },
2195
- scrollPaddingLeft: {
2196
- className: "scr-pl",
2197
- values: "spacing",
2198
- group: "Scroll"
2199
- },
2200
- scrollPaddingRight: {
2201
- className: "scr-pr",
2202
- values: "spacing",
2203
- group: "Scroll"
2204
- },
2205
- scrollPaddingTop: {
2206
- className: "scr-pt",
2207
- values: "spacing",
2208
- group: "Scroll"
2209
- },
2210
- scrollPaddingBottom: {
2211
- className: "scr-pb",
2212
- values: "spacing",
2213
- group: "Scroll"
2214
- },
2215
- scrollSnapAlign: {
2216
- className: "scr-sa",
2217
- group: "Scroll"
2218
- },
2219
- scrollSnapStop: {
2220
- className: "scrs-s",
2221
- group: "Scroll"
2222
- },
2223
- scrollSnapType: {
2224
- className: "scrs-t",
2225
- group: "Scroll",
2226
- values: {
2227
- none: "none",
2228
- x: "x var(--scroll-snap-strictness)",
2229
- y: "y var(--scroll-snap-strictness)",
2230
- both: "both var(--scroll-snap-strictness)"
2231
- }
2232
- },
2233
- scrollSnapStrictness: {
2234
- className: "scrs-strt",
2235
- values: ["mandatory", "proximity"],
2236
- group: "Scroll",
2237
- transform(value) {
2238
- return { "--scroll-snap-strictness": value };
2239
- }
2240
- },
2241
- scrollSnapMargin: {
2242
- className: "scrs-m",
2243
- values: "spacing",
2244
- group: "Scroll"
2245
- },
2246
- scrollSnapMarginTop: {
2247
- className: "scrs-mt",
2248
- values: "spacing",
2249
- group: "Scroll"
2250
- },
2251
- scrollSnapMarginBottom: {
2252
- className: "scrs-mb",
2253
- values: "spacing",
2254
- group: "Scroll"
2255
- },
2256
- scrollSnapMarginLeft: {
2257
- className: "scrs-ml",
2258
- values: "spacing",
2259
- group: "Scroll"
2260
- },
2261
- scrollSnapMarginRight: {
2262
- className: "scrs-mr",
2263
- values: "spacing",
2264
- group: "Scroll"
2265
- },
2266
- scrollSnapCoordinate: {
2267
- className: "scrs-c",
2268
- group: "Scroll"
2269
- },
2270
- scrollSnapDestination: {
2271
- className: "scrs-d",
2272
- group: "Scroll"
2273
- },
2274
- scrollSnapPointsX: {
2275
- className: "scrs-px",
2276
- group: "Scroll"
2277
- },
2278
- scrollSnapPointsY: {
2279
- className: "scrs-py",
2280
- group: "Scroll"
2281
- },
2282
- scrollSnapTypeX: {
2283
- className: "scrs-tx",
2284
- group: "Scroll"
2285
- },
2286
- scrollSnapTypeY: {
2287
- className: "scrs-ty",
2288
- group: "Scroll"
2289
- },
2290
- scrollTimeline: {
2291
- className: "scrtl",
2292
- group: "Scroll"
2293
- },
2294
- scrollTimelineAxis: {
2295
- className: "scrtl-a",
2296
- group: "Scroll"
2297
- },
2298
- scrollTimelineName: {
2299
- className: "scrtl-n",
2300
- group: "Scroll"
2301
- },
2302
- touchAction: {
2303
- className: "tch-a",
2304
- group: "Interactivity"
2305
- },
2306
- userSelect: {
2307
- className: "us",
2308
- group: "Interactivity",
2309
- transform(value) {
2310
- return {
2311
- WebkitUserSelect: value,
2312
- userSelect: value
2313
- };
2314
- }
2315
- },
2316
- overflow: {
2317
- className: "ov",
2318
- group: "Scroll"
2319
- },
2320
- overflowWrap: {
2321
- className: "ov-wrap",
2322
- group: "Scroll"
2323
- },
2324
- overflowX: {
2325
- className: "ov-x",
2326
- group: "Scroll"
2327
- },
2328
- overflowY: {
2329
- className: "ov-y",
2330
- group: "Scroll"
2331
- },
2332
- overflowAnchor: {
2333
- className: "ov-a",
2334
- group: "Scroll"
2335
- },
2336
- overflowBlock: {
2337
- className: "ov-b",
2338
- group: "Scroll"
2339
- },
2340
- overflowInline: {
2341
- className: "ov-i",
2342
- group: "Scroll"
2343
- },
2344
- overflowClipBox: {
2345
- className: "ovcp-bx",
2346
- group: "Scroll"
2347
- },
2348
- overflowClipMargin: {
2349
- className: "ovcp-m",
2350
- group: "Scroll"
2351
- },
2352
- overscrollBehavior: {
2353
- className: "ovs-b",
2354
- group: "Scroll"
2355
- },
2356
- overscrollBehaviorX: {
2357
- className: "ovs-bx",
2358
- group: "Scroll"
2359
- },
2360
- overscrollBehaviorY: {
2361
- className: "ovs-by",
2362
- group: "Scroll"
2363
- },
2364
- overscrollBehaviorBlock: {
2365
- className: "ovs-bb",
2366
- group: "Scroll"
2367
- },
2368
- overscrollBehaviorInline: {
2369
- className: "ovs-bi",
2370
- group: "Scroll"
2371
- }
2372
- };
2373
- const layout = {
2374
- aspectRatio: {
2375
- className: "asp",
2376
- values: "aspectRatios",
2377
- group: "Layout"
2378
- },
2379
- boxDecorationBreak: {
2380
- className: "bx-db",
2381
- group: "Layout",
2382
- transform(value) {
2383
- return {
2384
- boxDecorationBreak: value,
2385
- WebkitBoxDecorationBreak: value
2386
- };
2387
- }
2388
- },
2389
- zIndex: {
2390
- className: "z",
2391
- values: "zIndex",
2392
- group: "Visibility"
2393
- },
2394
- boxSizing: {
2395
- className: "bx-s",
2396
- group: "System"
2397
- },
2398
- objectPosition: {
2399
- className: "obj-p",
2400
- group: "Layout"
2401
- },
2402
- objectFit: {
2403
- className: "obj-f",
2404
- group: "Layout"
2405
- },
2406
- overscrollBehavior: {
2407
- className: "ovscl",
2408
- group: "Scroll"
2409
- },
2410
- overscrollBehaviorX: {
2411
- className: "ovscl-x",
2412
- group: "Scroll"
2413
- },
2414
- overscrollBehaviorY: {
2415
- className: "ovscl-y",
2416
- group: "Scroll"
2417
- },
2418
- position: {
2419
- className: "pos",
2420
- shorthand: "pos",
2421
- group: "Position"
2422
- },
2423
- top: {
2424
- className: "top",
2425
- values: "spacing",
2426
- group: "Position"
2427
- },
2428
- left: {
2429
- className: "left",
2430
- values: "spacing",
2431
- group: "Position"
2432
- },
2433
- inset: {
2434
- className: "inset",
2435
- group: "Position",
2436
- values: (theme) => ({
2437
- auto: "auto",
2438
- ...theme("spacing")
2439
- })
2440
- },
2441
- insetInline: {
2442
- className: "inset-x",
2443
- values: "spacing",
2444
- group: "Position",
2445
- shorthand: ["insetX"]
2446
- },
2447
- insetBlock: {
2448
- className: "inset-y",
2449
- values: "spacing",
2450
- group: "Position",
2451
- shorthand: ["insetY"]
2452
- },
2453
- insetBlockEnd: {
2454
- className: "inset-be",
2455
- values: "spacing",
2456
- group: "Position"
2457
- },
2458
- insetBlockStart: {
2459
- className: "inset-bs",
2460
- values: "spacing",
2461
- group: "Position"
2462
- },
2463
- insetInlineEnd: {
2464
- className: "inset-e",
2465
- values: "spacing",
2466
- group: "Position",
2467
- shorthand: ["insetEnd", "end"]
2468
- },
2469
- insetInlineStart: {
2470
- className: "inset-s",
2471
- values: "spacing",
2472
- group: "Position",
2473
- shorthand: ["insetStart", "start"]
2474
- },
2475
- right: {
2476
- className: "right",
2477
- values: "spacing",
2478
- group: "Position"
2479
- },
2480
- bottom: {
2481
- className: "bottom",
2482
- values: "spacing",
2483
- group: "Position"
2484
- },
2485
- float: {
2486
- className: "float",
2487
- values: ["start", "end"],
2488
- property: "float",
2489
- group: "Position",
2490
- transform(value) {
2491
- if (value === "start") return {
2492
- float: "left",
2493
- "[dir=\"rtl\"] &": { float: "right" }
2494
- };
2495
- if (value === "end") return {
2496
- float: "right",
2497
- "[dir=\"rtl\"] &": { float: "left" }
2498
- };
2499
- return { float: value };
2500
- }
2501
- },
2502
- visibility: {
2503
- className: "vis",
2504
- group: "Visibility"
2505
- }
2506
- };
2507
- const list = {
2508
- listStyleType: {
2509
- className: "li-t",
2510
- group: "List"
2511
- },
2512
- listStylePosition: {
2513
- className: "li-pos",
2514
- group: "List"
2515
- },
2516
- listStyleImage: {
2517
- className: "li-img",
2518
- group: "List",
2519
- values: "assets"
2520
- },
2521
- listStyle: {
2522
- className: "li-s",
2523
- group: "List"
2524
- }
2525
- };
2526
- const outline = {
2527
- outlineWidth: {
2528
- className: "ring-w",
2529
- shorthand: "ringWidth",
2530
- values: "borderWidths",
2531
- group: "Border"
2532
- },
2533
- outlineColor: {
2534
- className: "ring-c",
2535
- values: "colors",
2536
- group: "Color",
2537
- shorthand: "ringColor",
2538
- transform: createColorMixTransform("outlineColor")
2539
- },
2540
- outline: {
2541
- className: "ring",
2542
- shorthand: "ring",
2543
- values: "borders",
2544
- group: "Border",
2545
- transform(value) {
2546
- if (value === "none") return {
2547
- outline: "2px solid transparent",
2548
- outlineOffset: "2px"
2549
- };
2550
- return { outline: value };
2551
- }
2552
- },
2553
- outlineOffset: {
2554
- className: "ring-o",
2555
- shorthand: "ringOffset",
2556
- values: "spacing",
2557
- group: "Border"
2558
- }
2559
- };
2560
- const polyfill = {
2561
- appearance: {
2562
- className: "ap",
2563
- group: "Visibility",
2564
- transform(value) {
2565
- return {
2566
- appearance: value,
2567
- WebkitAppearance: value
2568
- };
2569
- }
2570
- },
2571
- backfaceVisibility: {
2572
- className: "bfv",
2573
- group: "Visibility",
2574
- transform(value) {
2575
- return {
2576
- backfaceVisibility: value,
2577
- WebkitBackfaceVisibility: value
2578
- };
2579
- }
2580
- },
2581
- clipPath: {
2582
- className: "cp-path",
2583
- group: "Other",
2584
- transform(value) {
2585
- return {
2586
- clipPath: value,
2587
- WebkitClipPath: value
2588
- };
2589
- }
2590
- },
2591
- hyphens: {
2592
- className: "hy",
2593
- group: "Other",
2594
- transform(value) {
2595
- return {
2596
- hyphens: value,
2597
- WebkitHyphens: value
2598
- };
2599
- }
2600
- },
2601
- mask: {
2602
- className: "msk",
2603
- group: "Other",
2604
- transform(value) {
2605
- return {
2606
- mask: value,
2607
- WebkitMask: value
2608
- };
2609
- }
2610
- },
2611
- maskImage: {
2612
- className: "msk-i",
2613
- group: "Other",
2614
- transform(value) {
2615
- return {
2616
- maskImage: value,
2617
- WebkitMaskImage: value
2618
- };
2619
- }
2620
- },
2621
- maskSize: {
2622
- className: "msk-s",
2623
- group: "Other",
2624
- transform(value) {
2625
- return {
2626
- maskSize: value,
2627
- WebkitMaskSize: value
2628
- };
2629
- }
2630
- },
2631
- textSizeAdjust: {
2632
- className: "txt-adj",
2633
- group: "Typography",
2634
- transform(value) {
2635
- return {
2636
- textSizeAdjust: value,
2637
- WebkitTextSizeAdjust: value
2638
- };
2639
- }
2640
- }
2641
- };
2642
- const widthValues = (theme) => ({
2643
- auto: "auto",
2644
- ...theme("sizes"),
2645
- "1/2": "50%",
2646
- "1/3": "33.333333%",
2647
- "2/3": "66.666667%",
2648
- "1/4": "25%",
2649
- "2/4": "50%",
2650
- "3/4": "75%",
2651
- "1/5": "20%",
2652
- "2/5": "40%",
2653
- "3/5": "60%",
2654
- "4/5": "80%",
2655
- "1/6": "16.666667%",
2656
- "2/6": "33.333333%",
2657
- "3/6": "50%",
2658
- "4/6": "66.666667%",
2659
- "5/6": "83.333333%",
2660
- "1/12": "8.333333%",
2661
- "2/12": "16.666667%",
2662
- "3/12": "25%",
2663
- "4/12": "33.333333%",
2664
- "5/12": "41.666667%",
2665
- "6/12": "50%",
2666
- "7/12": "58.333333%",
2667
- "8/12": "66.666667%",
2668
- "9/12": "75%",
2669
- "10/12": "83.333333%",
2670
- "11/12": "91.666667%",
2671
- screen: "100vw"
2672
- });
2673
- const heightValues = (theme) => ({
2674
- auto: "auto",
2675
- ...theme("sizes"),
2676
- svh: "100svh",
2677
- lvh: "100lvh",
2678
- dvh: "100dvh",
2679
- screen: "100vh",
2680
- "1/2": "50%",
2681
- "1/3": "33.333333%",
2682
- "2/3": "66.666667%",
2683
- "1/4": "25%",
2684
- "2/4": "50%",
2685
- "3/4": "75%",
2686
- "1/5": "20%",
2687
- "2/5": "40%",
2688
- "3/5": "60%",
2689
- "4/5": "80%",
2690
- "1/6": "16.666667%",
2691
- "2/6": "33.333333%",
2692
- "3/6": "50%",
2693
- "4/6": "66.666667%",
2694
- "5/6": "83.333333%"
2695
- });
2696
- const sizing = {
2697
- width: {
2698
- shorthand: "w",
2699
- className: "w",
2700
- group: "Width",
2701
- values: widthValues
2702
- },
2703
- inlineSize: {
2704
- className: "w-is",
2705
- group: "Width",
2706
- values: widthValues
2707
- },
2708
- minWidth: {
2709
- shorthand: "minW",
2710
- className: "min-w",
2711
- group: "Width",
2712
- values: widthValues
2713
- },
2714
- minInlineSize: {
2715
- className: "min-w-is",
2716
- group: "Width",
2717
- values: widthValues
2718
- },
2719
- maxWidth: {
2720
- shorthand: "maxW",
2721
- className: "max-w",
2722
- group: "Width",
2723
- values: widthValues
2724
- },
2725
- maxInlineSize: {
2726
- className: "max-w-is",
2727
- group: "Width",
2728
- values: widthValues
2729
- },
2730
- height: {
2731
- shorthand: "h",
2732
- className: "h",
2733
- group: "Height",
2734
- values: heightValues
2735
- },
2736
- blockSize: {
2737
- className: "h-bs",
2738
- group: "Height",
2739
- values: heightValues
2740
- },
2741
- minHeight: {
2742
- shorthand: "minH",
2743
- className: "min-h",
2744
- group: "Height",
2745
- values: heightValues
2746
- },
2747
- minBlockSize: {
2748
- className: "min-h-bs",
2749
- group: "Height",
2750
- values: heightValues
2751
- },
2752
- maxHeight: {
2753
- shorthand: "maxH",
2754
- className: "max-h",
2755
- group: "Height",
2756
- values: heightValues
2757
- },
2758
- maxBlockSize: {
2759
- className: "max-b",
2760
- group: "Height",
2761
- values: heightValues
2762
- },
2763
- boxSize: {
2764
- className: "size",
2765
- group: "Width",
2766
- values: widthValues,
2767
- transform(value) {
2768
- return {
2769
- width: value,
2770
- height: value
2771
- };
2772
- }
2773
- }
2774
- };
2775
- const marginValues = (theme) => ({
2776
- auto: "auto",
2777
- ...theme("spacing")
2778
- });
2779
- const spacing$1 = {
2780
- padding: {
2781
- className: "p",
2782
- shorthand: "p",
2783
- values: "spacing",
2784
- group: "Padding"
2785
- },
2786
- paddingLeft: {
2787
- className: "pl",
2788
- shorthand: "pl",
2789
- values: "spacing",
2790
- group: "Padding"
2791
- },
2792
- paddingRight: {
2793
- className: "pr",
2794
- shorthand: "pr",
2795
- values: "spacing",
2796
- group: "Padding"
2797
- },
2798
- paddingTop: {
2799
- className: "pt",
2800
- shorthand: "pt",
2801
- values: "spacing",
2802
- group: "Padding"
2803
- },
2804
- paddingBottom: {
2805
- className: "pb",
2806
- shorthand: "pb",
2807
- values: "spacing",
2808
- group: "Padding"
2809
- },
2810
- paddingBlock: {
2811
- className: "py",
2812
- values: "spacing",
2813
- group: "Padding",
2814
- shorthand: ["py", "paddingY"]
2815
- },
2816
- paddingBlockEnd: {
2817
- className: "pbe",
2818
- values: "spacing",
2819
- group: "Padding"
2820
- },
2821
- paddingBlockStart: {
2822
- className: "pbs",
2823
- values: "spacing",
2824
- group: "Padding"
2825
- },
2826
- paddingInline: {
2827
- className: "px",
2828
- values: "spacing",
2829
- group: "Padding",
2830
- shorthand: ["paddingX", "px"]
2831
- },
2832
- paddingInlineEnd: {
2833
- className: "pe",
2834
- shorthand: ["pe", "paddingEnd"],
2835
- values: "spacing",
2836
- group: "Padding"
2837
- },
2838
- paddingInlineStart: {
2839
- className: "ps",
2840
- shorthand: ["ps", "paddingStart"],
2841
- values: "spacing",
2842
- group: "Padding"
2843
- },
2844
- marginLeft: {
2845
- className: "ml",
2846
- shorthand: "ml",
2847
- values: marginValues,
2848
- group: "Margin"
2849
- },
2850
- marginRight: {
2851
- className: "mr",
2852
- shorthand: "mr",
2853
- values: marginValues,
2854
- group: "Margin"
2855
- },
2856
- marginTop: {
2857
- className: "mt",
2858
- shorthand: "mt",
2859
- values: marginValues,
2860
- group: "Margin"
2861
- },
2862
- marginBottom: {
2863
- className: "mb",
2864
- shorthand: "mb",
2865
- values: marginValues,
2866
- group: "Margin"
2867
- },
2868
- margin: {
2869
- className: "m",
2870
- shorthand: "m",
2871
- values: marginValues,
2872
- group: "Margin"
2873
- },
2874
- marginBlock: {
2875
- className: "my",
2876
- values: marginValues,
2877
- group: "Margin",
2878
- shorthand: ["my", "marginY"]
2879
- },
2880
- marginBlockEnd: {
2881
- className: "mbe",
2882
- values: marginValues,
2883
- group: "Margin"
2884
- },
2885
- marginBlockStart: {
2886
- className: "mbs",
2887
- values: marginValues,
2888
- group: "Margin"
2889
- },
2890
- marginInline: {
2891
- className: "mx",
2892
- values: marginValues,
2893
- group: "Margin",
2894
- shorthand: ["mx", "marginX"]
2895
- },
2896
- marginInlineEnd: {
2897
- className: "me",
2898
- shorthand: ["me", "marginEnd"],
2899
- values: marginValues,
2900
- group: "Margin"
2901
- },
2902
- marginInlineStart: {
2903
- className: "ms",
2904
- shorthand: ["ms", "marginStart"],
2905
- values: marginValues,
2906
- group: "Margin"
2907
- },
2908
- spaceX: {
2909
- className: "sx",
2910
- values: marginValues,
2911
- property: "marginInlineStart",
2912
- group: "Margin",
2913
- transform(value) {
2914
- return { "& > :not([hidden]) ~ :not([hidden])": {
2915
- marginInlineStart: value,
2916
- marginInlineEnd: "0px"
2917
- } };
2918
- }
2919
- },
2920
- spaceY: {
2921
- className: "sy",
2922
- values: marginValues,
2923
- property: "marginBlockStart",
2924
- group: "Margin",
2925
- transform(value) {
2926
- return { "& > :not([hidden]) ~ :not([hidden])": {
2927
- marginTop: value,
2928
- marginBottom: "0px"
2929
- } };
2930
- }
2931
- }
2932
- };
2933
- const svg = {
2934
- fill: {
2935
- className: "fill",
2936
- values: "colors",
2937
- group: "Color",
2938
- transform: createColorMixTransform("fill")
2939
- },
2940
- stroke: {
2941
- className: "stk",
2942
- values: "colors",
2943
- group: "Color",
2944
- transform: createColorMixTransform("stroke")
2945
- },
2946
- strokeWidth: {
2947
- className: "stk-w",
2948
- values: "borderWidths",
2949
- group: "Border"
2950
- },
2951
- strokeDasharray: {
2952
- className: "stk-dsh",
2953
- group: "Border"
2954
- },
2955
- strokeDashoffset: {
2956
- className: "stk-do",
2957
- group: "Border"
2958
- },
2959
- strokeLinecap: {
2960
- className: "stk-lc",
2961
- group: "Border"
2962
- },
2963
- strokeLinejoin: {
2964
- className: "stk-lj",
2965
- group: "Border"
2966
- },
2967
- strokeMiterlimit: {
2968
- className: "stk-ml",
2969
- group: "Border"
2970
- },
2971
- strokeOpacity: {
2972
- className: "stk-op",
2973
- group: "Border"
2974
- }
2975
- };
2976
- const tables = {
2977
- borderCollapse: {
2978
- className: "bd-cl",
2979
- group: "Table"
2980
- },
2981
- borderSpacing: {
2982
- className: "bd-sp",
2983
- group: "Table",
2984
- values(theme) {
2985
- return {
2986
- ...theme("spacing"),
2987
- auto: "var(--border-spacing-x) var(--border-spacing-y)"
2988
- };
2989
- }
2990
- },
2991
- borderSpacingX: {
2992
- className: "bd-sx",
2993
- values: "spacing",
2994
- group: "Table",
2995
- transform(value) {
2996
- return { "--border-spacing-x": value };
2997
- }
2998
- },
2999
- borderSpacingY: {
3000
- className: "bd-sy",
3001
- values: "spacing",
3002
- group: "Table",
3003
- transform(value) {
3004
- return { "--border-spacing-y": value };
3005
- }
3006
- },
3007
- tableLayout: {
3008
- className: "tbl",
3009
- group: "Table"
3010
- }
3011
- };
3012
- const positiveFractions = {
3013
- "1/2": "50%",
3014
- "1/3": "33.333333%",
3015
- "2/3": "66.666667%",
3016
- "1/4": "25%",
3017
- "2/4": "50%",
3018
- "3/4": "75%",
3019
- full: "100%"
3020
- };
3021
- const negativeFractions = Object.fromEntries(Object.entries(positiveFractions).map(([key, value]) => [`-${key}`, `-${value}`]));
3022
- const fractions = {
3023
- ...positiveFractions,
3024
- ...negativeFractions
3025
- };
3026
- const transforms = {
3027
- transformOrigin: {
3028
- className: "trf-o",
3029
- group: "Transform"
3030
- },
3031
- transformBox: {
3032
- className: "trf-b",
3033
- group: "Transform"
3034
- },
3035
- transformStyle: {
3036
- className: "trf-s",
3037
- group: "Transform"
3038
- },
3039
- transform: {
3040
- className: "trf",
3041
- group: "Transform"
3042
- },
3043
- rotate: {
3044
- className: "rotate",
3045
- group: "Transform",
3046
- property: "rotate",
3047
- values: {
3048
- auto: "var(--rotate-x) var(--rotate-y)",
3049
- "auto-3d": "var(--rotate-x) var(--rotate-y) var(--rotate-z)"
3050
- }
3051
- },
3052
- rotateX: {
3053
- className: "rotate-x",
3054
- group: "Transform",
3055
- property: "rotate",
3056
- transform(value) {
3057
- return { "--rotate-x": value };
3058
- }
3059
- },
3060
- rotateY: {
3061
- className: "rotate-y",
3062
- group: "Transform",
3063
- property: "rotate",
3064
- transform(value) {
3065
- return { "--rotate-y": value };
3066
- }
3067
- },
3068
- rotateZ: {
3069
- className: "rotate-z",
3070
- group: "Transform",
3071
- property: "rotate",
3072
- transform(value) {
3073
- return { "--rotate-z": value };
3074
- }
3075
- },
3076
- scale: {
3077
- className: "scale",
3078
- group: "Transform",
3079
- property: "scale",
3080
- values: { auto: "var(--scale-x) var(--scale-y)" }
3081
- },
3082
- scaleX: {
3083
- className: "scale-x",
3084
- group: "Transform",
3085
- transform(value) {
3086
- return { "--scale-x": value };
3087
- }
3088
- },
3089
- scaleY: {
3090
- className: "scale-y",
3091
- group: "Transform",
3092
- transform(value) {
3093
- return { "--scale-y": value };
3094
- }
3095
- },
3096
- translate: {
3097
- className: "translate",
3098
- group: "Transform",
3099
- property: "translate",
3100
- values: {
3101
- auto: "var(--translate-x) var(--translate-y)",
3102
- "auto-3d": "var(--translate-x) var(--translate-y) var(--translate-z)"
3103
- }
3104
- },
3105
- translateX: {
3106
- shorthand: "x",
3107
- className: "translate-x",
3108
- group: "Transform",
3109
- values(theme) {
3110
- return {
3111
- ...theme("spacing"),
3112
- ...fractions
3113
- };
3114
- },
3115
- transform(value) {
3116
- return { "--translate-x": value };
3117
- }
3118
- },
3119
- translateY: {
3120
- shorthand: "y",
3121
- className: "translate-y",
3122
- group: "Transform",
3123
- values(theme) {
3124
- return {
3125
- ...theme("spacing"),
3126
- ...fractions
3127
- };
3128
- },
3129
- transform(value) {
3130
- return { "--translate-y": value };
3131
- }
3132
- },
3133
- translateZ: {
3134
- shorthand: "z",
3135
- className: "translate-z",
3136
- group: "Transform",
3137
- values(theme) {
3138
- return {
3139
- ...theme("spacing"),
3140
- ...fractions
3141
- };
3142
- },
3143
- transform(value) {
3144
- return { "--translate-z": value };
3145
- }
3146
- }
3147
- };
3148
- const createTransition = (value) => ({
3149
- transitionProperty: `var(--transition-prop, ${value})`,
3150
- transitionTimingFunction: "var(--transition-easing, cubic-bezier(0.4, 0, 0.2, 1))",
3151
- transitionDuration: "var(--transition-duration, 150ms)"
3152
- });
3153
- const transitionMap = {
3154
- all: createTransition("all"),
3155
- common: createTransition("color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter"),
3156
- size: createTransition("width, height, min-width, max-width, min-height, max-height"),
3157
- position: createTransition("left, right, top, bottom, inset, inset-inline, inset-block"),
3158
- background: createTransition("background, background-color, background-image, background-position"),
3159
- colors: createTransition("color, background-color, border-color, outline-color, text-decoration-color, fill, stroke"),
3160
- opacity: createTransition("opacity"),
3161
- shadow: createTransition("box-shadow"),
3162
- transform: createTransition("transform")
3163
- };
3164
- const transitions = {
3165
- transitionTimingFunction: {
3166
- className: "trs-tmf",
3167
- values: "easings",
3168
- group: "Transition",
3169
- transform(value) {
3170
- return {
3171
- "--transition-easing": value,
3172
- transitionTimingFunction: value
3173
- };
3174
- }
3175
- },
3176
- transitionDelay: {
3177
- className: "trs-dly",
3178
- values: "durations",
3179
- group: "Transition"
3180
- },
3181
- transitionDuration: {
3182
- className: "trs-dur",
3183
- values: "durations",
3184
- group: "Transition",
3185
- transform(value) {
3186
- return {
3187
- "--transition-duration": value,
3188
- transitionDuration: value
3189
- };
3190
- }
3191
- },
3192
- transitionProperty: {
3193
- className: "trs-prop",
3194
- group: "Transition",
3195
- values: {
3196
- common: "color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",
3197
- colors: "color, background-color, border-color, outline-color, text-decoration-color, fill, stroke",
3198
- size: "width, height, min-width, max-width, min-height, max-height",
3199
- position: "left, right, top, bottom, inset, inset-inline, inset-block",
3200
- background: "background, background-color, background-image, background-position"
3201
- },
3202
- transform(value) {
3203
- return {
3204
- "--transition-prop": value,
3205
- transitionProperty: value
3206
- };
3207
- }
3208
- },
3209
- transition: {
3210
- className: "trs",
3211
- values: Object.keys(transitionMap),
3212
- group: "Transition",
3213
- transform(value) {
3214
- return transitionMap[value] ?? { transition: value };
3215
- }
3216
- },
3217
- animation: {
3218
- className: "anim",
3219
- values: "animations",
3220
- group: "Animation"
3221
- },
3222
- animationName: {
3223
- className: "anim-n",
3224
- values: "keyframes",
3225
- group: "Animation"
3226
- },
3227
- animationTimingFunction: {
3228
- className: "anim-tmf",
3229
- values: "easings",
3230
- group: "Animation"
3231
- },
3232
- animationDuration: {
3233
- className: "anim-dur",
3234
- values: "durations",
3235
- group: "Animation"
3236
- },
3237
- animationDelay: {
3238
- className: "anim-dly",
3239
- values: "durations",
3240
- group: "Animation"
3241
- },
3242
- animationPlayState: {
3243
- className: "anim-ps",
3244
- group: "Animation"
3245
- },
3246
- animationComposition: {
3247
- className: "anim-comp",
3248
- group: "Animation"
3249
- },
3250
- animationFillMode: {
3251
- className: "anim-fm",
3252
- group: "Animation"
3253
- },
3254
- animationDirection: {
3255
- className: "anim-dir",
3256
- group: "Animation"
3257
- },
3258
- animationIterationCount: {
3259
- className: "anim-ic",
3260
- group: "Animation"
3261
- },
3262
- animationRange: {
3263
- className: "anim-r",
3264
- group: "Animation"
3265
- },
3266
- animationState: {
3267
- className: "anim-s",
3268
- group: "Animation"
3269
- },
3270
- animationRangeStart: {
3271
- className: "anim-rs",
3272
- group: "Animation"
3273
- },
3274
- animationRangeEnd: {
3275
- className: "anim-re",
3276
- group: "Animation"
3277
- },
3278
- animationTimeline: {
3279
- className: "anim-tl",
3280
- group: "Animation"
3281
- }
3282
- };
3283
- const typography = {
3284
- color: {
3285
- className: "c",
3286
- values: "colors",
3287
- group: "Color",
3288
- transform: createColorMixTransform("color")
3289
- },
3290
- fontFamily: {
3291
- className: "ff",
3292
- values: "fonts",
3293
- group: "Typography"
3294
- },
3295
- fontSize: {
3296
- className: "fs",
3297
- values: "fontSizes",
3298
- group: "Typography"
3299
- },
3300
- fontSizeAdjust: {
3301
- className: "fs-a",
3302
- group: "Typography"
3303
- },
3304
- fontPalette: {
3305
- className: "fp",
3306
- group: "Typography"
3307
- },
3308
- fontKerning: {
3309
- className: "fk",
3310
- group: "Typography"
3311
- },
3312
- fontFeatureSettings: {
3313
- className: "ff-s",
3314
- group: "Typography"
3315
- },
3316
- fontWeight: {
3317
- className: "fw",
3318
- values: "fontWeights",
3319
- group: "Typography"
3320
- },
3321
- fontSmoothing: {
3322
- className: "fsmt",
3323
- group: "Typography",
3324
- values: {
3325
- antialiased: "antialiased",
3326
- "subpixel-antialiased": "auto"
3327
- },
3328
- transform(value) {
3329
- return { WebkitFontSmoothing: value };
3330
- }
3331
- },
3332
- fontVariant: {
3333
- className: "fv",
3334
- group: "Typography"
3335
- },
3336
- fontVariantAlternates: {
3337
- className: "fv-alt",
3338
- group: "Typography"
3339
- },
3340
- fontVariantCaps: {
3341
- className: "fv-caps",
3342
- group: "Typography"
3343
- },
3344
- fontVariationSettings: {
3345
- className: "fv-s",
3346
- group: "Typography"
3347
- },
3348
- fontVariantNumeric: {
3349
- className: "fv-num",
3350
- group: "Typography"
3351
- },
3352
- letterSpacing: {
3353
- className: "ls",
3354
- values: "letterSpacings",
3355
- group: "Typography"
3356
- },
3357
- lineHeight: {
3358
- className: "lh",
3359
- values: "lineHeights",
3360
- group: "Typography"
3361
- },
3362
- textAlign: {
3363
- className: "ta",
3364
- group: "Typography"
3365
- },
3366
- textDecoration: {
3367
- className: "td",
3368
- group: "Typography"
3369
- },
3370
- textDecorationColor: {
3371
- className: "td-c",
3372
- values: "colors",
3373
- transform: createColorMixTransform("textDecorationColor"),
3374
- group: "Typography"
3375
- },
3376
- textEmphasisColor: {
3377
- className: "te-c",
3378
- values: "colors",
3379
- transform: createColorMixTransform("textEmphasisColor"),
3380
- group: "Typography"
3381
- },
3382
- textDecorationStyle: {
3383
- className: "td-s",
3384
- group: "Typography"
3385
- },
3386
- textDecorationThickness: {
3387
- className: "td-t",
3388
- group: "Typography"
3389
- },
3390
- textUnderlineOffset: {
3391
- className: "tu-o",
3392
- group: "Typography"
3393
- },
3394
- textTransform: {
3395
- className: "tt",
3396
- group: "Typography"
3397
- },
3398
- textIndent: {
3399
- className: "ti",
3400
- group: "Typography",
3401
- values: "spacing"
3402
- },
3403
- textShadow: {
3404
- className: "tsh",
3405
- values: "shadows",
3406
- group: "Typography"
3407
- },
3408
- textShadowColor: {
3409
- shorthand: "textShadowColor",
3410
- className: "tsh-c",
3411
- values: "colors",
3412
- transform: createColorMixTransform("--text-shadow-color"),
3413
- group: "Typography"
3414
- },
3415
- WebkitTextFillColor: {
3416
- className: "wktf-c",
3417
- values: "colors",
3418
- transform: createColorMixTransform("WebkitTextFillColor"),
3419
- group: "Typography"
3420
- },
3421
- textOverflow: {
3422
- className: "tov",
3423
- group: "Typography"
3424
- },
3425
- verticalAlign: {
3426
- className: "va",
3427
- group: "Typography"
3428
- },
3429
- wordBreak: {
3430
- className: "wb",
3431
- group: "Typography"
3432
- },
3433
- textWrap: {
3434
- className: "tw",
3435
- values: [
3436
- "wrap",
3437
- "balance",
3438
- "nowrap"
3439
- ],
3440
- group: "Typography",
3441
- transform(value) {
3442
- return { textWrap: value };
3443
- }
3444
- },
3445
- truncate: {
3446
- className: "trunc",
3447
- values: { type: "boolean" },
3448
- group: "Typography",
3449
- transform(value) {
3450
- if (!value) return {};
3451
- return {
3452
- overflow: "hidden",
3453
- textOverflow: "ellipsis",
3454
- whiteSpace: "nowrap"
3455
- };
3456
- }
3457
- },
3458
- lineClamp: {
3459
- className: "lc",
3460
- group: "Typography",
3461
- transform(value) {
3462
- if (value === "none") return { WebkitLineClamp: "unset" };
3463
- return {
3464
- overflow: "hidden",
3465
- display: "-webkit-box",
3466
- WebkitLineClamp: value,
3467
- WebkitBoxOrient: "vertical"
3468
- };
3469
- }
3470
- }
3471
- };
3472
- const utilities = Object.assign({}, layout, display, flexGrid, spacing$1, outline, focusRing, divide, sizing, typography, list, background, backgroundGradients, border, effects, tables, transitions, transforms, interactivity, svg, helpers, polyfill, container, cursor);
3473
- const definePreset$1 = (preset) => preset;
3474
- const preset$1 = definePreset$1({
3475
- name: "@bamboocss/preset-base",
3476
- conditions: conditions$1,
3477
- utilities,
3478
- patterns,
3479
- globalCss
3480
- });
3481
-
3482
- //#endregion
3483
- //#region ../preset-bamboo/dist/index.mjs
3484
- const breakpoints = {
3485
- sm: "640px",
3486
- md: "768px",
3487
- lg: "1024px",
3488
- xl: "1280px",
3489
- "2xl": "1536px"
3490
- };
3491
- const containerSizes = {
3492
- xs: "320px",
3493
- sm: "384px",
3494
- md: "448px",
3495
- lg: "512px",
3496
- xl: "576px",
3497
- "2xl": "672px",
3498
- "3xl": "768px",
3499
- "4xl": "896px",
3500
- "5xl": "1024px",
3501
- "6xl": "1152px",
3502
- "7xl": "1280px",
3503
- "8xl": "1440px"
3504
- };
3505
- const keyframes = {
3506
- spin: { to: { transform: "rotate(360deg)" } },
3507
- ping: { "75%, 100%": {
3508
- transform: "scale(2)",
3509
- opacity: "0"
3510
- } },
3511
- pulse: { "50%": { opacity: ".5" } },
3512
- bounce: {
3513
- "0%, 100%": {
3514
- transform: "translateY(-25%)",
3515
- animationTimingFunction: "cubic-bezier(0.8,0,1,1)"
3516
- },
3517
- "50%": {
3518
- transform: "none",
3519
- animationTimingFunction: "cubic-bezier(0,0,0.2,1)"
3520
- }
3521
- }
3522
- };
3523
- const animations = {
3524
- spin: { value: "spin 1s linear infinite" },
3525
- ping: { value: "ping 1s cubic-bezier(0, 0, 0.2, 1) infinite" },
3526
- pulse: { value: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite" },
3527
- bounce: { value: "bounce 1s infinite" }
3528
- };
3529
- const aspectRatios = {
3530
- square: { value: "1 / 1" },
3531
- landscape: { value: "4 / 3" },
3532
- portrait: { value: "3 / 4" },
3533
- wide: { value: "16 / 9" },
3534
- ultrawide: { value: "18 / 5" },
3535
- golden: { value: "1.618 / 1" }
3536
- };
3537
- const borders = { none: { value: "none" } };
3538
- const colors = {
3539
- current: { value: "currentColor" },
3540
- black: { value: "#000" },
3541
- white: { value: "#fff" },
3542
- transparent: { value: "rgb(0 0 0 / 0)" },
3543
- rose: {
3544
- 50: { value: "#fff1f2" },
3545
- 100: { value: "#ffe4e6" },
3546
- 200: { value: "#fecdd3" },
3547
- 300: { value: "#fda4af" },
3548
- 400: { value: "#fb7185" },
3549
- 500: { value: "#f43f5e" },
3550
- 600: { value: "#e11d48" },
3551
- 700: { value: "#be123c" },
3552
- 800: { value: "#9f1239" },
3553
- 900: { value: "#881337" },
3554
- 950: { value: "#4c0519" }
3555
- },
3556
- pink: {
3557
- 50: { value: "#fdf2f8" },
3558
- 100: { value: "#fce7f3" },
3559
- 200: { value: "#fbcfe8" },
3560
- 300: { value: "#f9a8d4" },
3561
- 400: { value: "#f472b6" },
3562
- 500: { value: "#ec4899" },
3563
- 600: { value: "#db2777" },
3564
- 700: { value: "#be185d" },
3565
- 800: { value: "#9d174d" },
3566
- 900: { value: "#831843" },
3567
- 950: { value: "#500724" }
3568
- },
3569
- fuchsia: {
3570
- 50: { value: "#fdf4ff" },
3571
- 100: { value: "#fae8ff" },
3572
- 200: { value: "#f5d0fe" },
3573
- 300: { value: "#f0abfc" },
3574
- 400: { value: "#e879f9" },
3575
- 500: { value: "#d946ef" },
3576
- 600: { value: "#c026d3" },
3577
- 700: { value: "#a21caf" },
3578
- 800: { value: "#86198f" },
3579
- 900: { value: "#701a75" },
3580
- 950: { value: "#4a044e" }
3581
- },
3582
- purple: {
3583
- 50: { value: "#faf5ff" },
3584
- 100: { value: "#f3e8ff" },
3585
- 200: { value: "#e9d5ff" },
3586
- 300: { value: "#d8b4fe" },
3587
- 400: { value: "#c084fc" },
3588
- 500: { value: "#a855f7" },
3589
- 600: { value: "#9333ea" },
3590
- 700: { value: "#7e22ce" },
3591
- 800: { value: "#6b21a8" },
3592
- 900: { value: "#581c87" },
3593
- 950: { value: "#3b0764" }
3594
- },
3595
- violet: {
3596
- 50: { value: "#f5f3ff" },
3597
- 100: { value: "#ede9fe" },
3598
- 200: { value: "#ddd6fe" },
3599
- 300: { value: "#c4b5fd" },
3600
- 400: { value: "#a78bfa" },
3601
- 500: { value: "#8b5cf6" },
3602
- 600: { value: "#7c3aed" },
3603
- 700: { value: "#6d28d9" },
3604
- 800: { value: "#5b21b6" },
3605
- 900: { value: "#4c1d95" },
3606
- 950: { value: "#2e1065" }
3607
- },
3608
- indigo: {
3609
- 50: { value: "#eef2ff" },
3610
- 100: { value: "#e0e7ff" },
3611
- 200: { value: "#c7d2fe" },
3612
- 300: { value: "#a5b4fc" },
3613
- 400: { value: "#818cf8" },
3614
- 500: { value: "#6366f1" },
3615
- 600: { value: "#4f46e5" },
3616
- 700: { value: "#4338ca" },
3617
- 800: { value: "#3730a3" },
3618
- 900: { value: "#312e81" },
3619
- 950: { value: "#1e1b4b" }
3620
- },
3621
- blue: {
3622
- 50: { value: "#eff6ff" },
3623
- 100: { value: "#dbeafe" },
3624
- 200: { value: "#bfdbfe" },
3625
- 300: { value: "#93c5fd" },
3626
- 400: { value: "#60a5fa" },
3627
- 500: { value: "#3b82f6" },
3628
- 600: { value: "#2563eb" },
3629
- 700: { value: "#1d4ed8" },
3630
- 800: { value: "#1e40af" },
3631
- 900: { value: "#1e3a8a" },
3632
- 950: { value: "#172554" }
3633
- },
3634
- sky: {
3635
- 50: { value: "#f0f9ff" },
3636
- 100: { value: "#e0f2fe" },
3637
- 200: { value: "#bae6fd" },
3638
- 300: { value: "#7dd3fc" },
3639
- 400: { value: "#38bdf8" },
3640
- 500: { value: "#0ea5e9" },
3641
- 600: { value: "#0284c7" },
3642
- 700: { value: "#0369a1" },
3643
- 800: { value: "#075985" },
3644
- 900: { value: "#0c4a6e" },
3645
- 950: { value: "#082f49" }
3646
- },
3647
- cyan: {
3648
- 50: { value: "#ecfeff" },
3649
- 100: { value: "#cffafe" },
3650
- 200: { value: "#a5f3fc" },
3651
- 300: { value: "#67e8f9" },
3652
- 400: { value: "#22d3ee" },
3653
- 500: { value: "#06b6d4" },
3654
- 600: { value: "#0891b2" },
3655
- 700: { value: "#0e7490" },
3656
- 800: { value: "#155e75" },
3657
- 900: { value: "#164e63" },
3658
- 950: { value: "#083344" }
3659
- },
3660
- teal: {
3661
- 50: { value: "#f0fdfa" },
3662
- 100: { value: "#ccfbf1" },
3663
- 200: { value: "#99f6e4" },
3664
- 300: { value: "#5eead4" },
3665
- 400: { value: "#2dd4bf" },
3666
- 500: { value: "#14b8a6" },
3667
- 600: { value: "#0d9488" },
3668
- 700: { value: "#0f766e" },
3669
- 800: { value: "#115e59" },
3670
- 900: { value: "#134e4a" },
3671
- 950: { value: "#042f2e" }
3672
- },
3673
- emerald: {
3674
- 50: { value: "#ecfdf5" },
3675
- 100: { value: "#d1fae5" },
3676
- 200: { value: "#a7f3d0" },
3677
- 300: { value: "#6ee7b7" },
3678
- 400: { value: "#34d399" },
3679
- 500: { value: "#10b981" },
3680
- 600: { value: "#059669" },
3681
- 700: { value: "#047857" },
3682
- 800: { value: "#065f46" },
3683
- 900: { value: "#064e3b" },
3684
- 950: { value: "#022c22" }
3685
- },
3686
- green: {
3687
- 50: { value: "#f0fdf4" },
3688
- 100: { value: "#dcfce7" },
3689
- 200: { value: "#bbf7d0" },
3690
- 300: { value: "#86efac" },
3691
- 400: { value: "#4ade80" },
3692
- 500: { value: "#22c55e" },
3693
- 600: { value: "#16a34a" },
3694
- 700: { value: "#15803d" },
3695
- 800: { value: "#166534" },
3696
- 900: { value: "#14532d" },
3697
- 950: { value: "#052e16" }
3698
- },
3699
- lime: {
3700
- 50: { value: "#f7fee7" },
3701
- 100: { value: "#ecfccb" },
3702
- 200: { value: "#d9f99d" },
3703
- 300: { value: "#bef264" },
3704
- 400: { value: "#a3e635" },
3705
- 500: { value: "#84cc16" },
3706
- 600: { value: "#65a30d" },
3707
- 700: { value: "#4d7c0f" },
3708
- 800: { value: "#3f6212" },
3709
- 900: { value: "#365314" },
3710
- 950: { value: "#1a2e05" }
3711
- },
3712
- yellow: {
3713
- 50: { value: "#fefce8" },
3714
- 100: { value: "#fef9c3" },
3715
- 200: { value: "#fef08a" },
3716
- 300: { value: "#fde047" },
3717
- 400: { value: "#facc15" },
3718
- 500: { value: "#eab308" },
3719
- 600: { value: "#ca8a04" },
3720
- 700: { value: "#a16207" },
3721
- 800: { value: "#854d0e" },
3722
- 900: { value: "#713f12" },
3723
- 950: { value: "#422006" }
3724
- },
3725
- amber: {
3726
- 50: { value: "#fffbeb" },
3727
- 100: { value: "#fef3c7" },
3728
- 200: { value: "#fde68a" },
3729
- 300: { value: "#fcd34d" },
3730
- 400: { value: "#fbbf24" },
3731
- 500: { value: "#f59e0b" },
3732
- 600: { value: "#d97706" },
3733
- 700: { value: "#b45309" },
3734
- 800: { value: "#92400e" },
3735
- 900: { value: "#78350f" },
3736
- 950: { value: "#451a03" }
3737
- },
3738
- orange: {
3739
- 50: { value: "#fff7ed" },
3740
- 100: { value: "#ffedd5" },
3741
- 200: { value: "#fed7aa" },
3742
- 300: { value: "#fdba74" },
3743
- 400: { value: "#fb923c" },
3744
- 500: { value: "#f97316" },
3745
- 600: { value: "#ea580c" },
3746
- 700: { value: "#c2410c" },
3747
- 800: { value: "#9a3412" },
3748
- 900: { value: "#7c2d12" },
3749
- 950: { value: "#431407" }
3750
- },
3751
- red: {
3752
- 50: { value: "#fef2f2" },
3753
- 100: { value: "#fee2e2" },
3754
- 200: { value: "#fecaca" },
3755
- 300: { value: "#fca5a5" },
3756
- 400: { value: "#f87171" },
3757
- 500: { value: "#ef4444" },
3758
- 600: { value: "#dc2626" },
3759
- 700: { value: "#b91c1c" },
3760
- 800: { value: "#991b1b" },
3761
- 900: { value: "#7f1d1d" },
3762
- 950: { value: "#450a0a" }
3763
- },
3764
- neutral: {
3765
- 50: { value: "#fafafa" },
3766
- 100: { value: "#f5f5f5" },
3767
- 200: { value: "#e5e5e5" },
3768
- 300: { value: "#d4d4d4" },
3769
- 400: { value: "#a3a3a3" },
3770
- 500: { value: "#737373" },
3771
- 600: { value: "#525252" },
3772
- 700: { value: "#404040" },
3773
- 800: { value: "#262626" },
3774
- 900: { value: "#171717" },
3775
- 950: { value: "#0a0a0a" }
3776
- },
3777
- stone: {
3778
- 50: { value: "#fafaf9" },
3779
- 100: { value: "#f5f5f4" },
3780
- 200: { value: "#e7e5e4" },
3781
- 300: { value: "#d6d3d1" },
3782
- 400: { value: "#a8a29e" },
3783
- 500: { value: "#78716c" },
3784
- 600: { value: "#57534e" },
3785
- 700: { value: "#44403c" },
3786
- 800: { value: "#292524" },
3787
- 900: { value: "#1c1917" },
3788
- 950: { value: "#0c0a09" }
3789
- },
3790
- zinc: {
3791
- 50: { value: "#fafafa" },
3792
- 100: { value: "#f4f4f5" },
3793
- 200: { value: "#e4e4e7" },
3794
- 300: { value: "#d4d4d8" },
3795
- 400: { value: "#a1a1aa" },
3796
- 500: { value: "#71717a" },
3797
- 600: { value: "#52525b" },
3798
- 700: { value: "#3f3f46" },
3799
- 800: { value: "#27272a" },
3800
- 900: { value: "#18181b" },
3801
- 950: { value: "#09090b" }
3802
- },
3803
- gray: {
3804
- 50: { value: "#f9fafb" },
3805
- 100: { value: "#f3f4f6" },
3806
- 200: { value: "#e5e7eb" },
3807
- 300: { value: "#d1d5db" },
3808
- 400: { value: "#9ca3af" },
3809
- 500: { value: "#6b7280" },
3810
- 600: { value: "#4b5563" },
3811
- 700: { value: "#374151" },
3812
- 800: { value: "#1f2937" },
3813
- 900: { value: "#111827" },
3814
- 950: { value: "#030712" }
3815
- },
3816
- slate: {
3817
- 50: { value: "#f8fafc" },
3818
- 100: { value: "#f1f5f9" },
3819
- 200: { value: "#e2e8f0" },
3820
- 300: { value: "#cbd5e1" },
3821
- 400: { value: "#94a3b8" },
3822
- 500: { value: "#64748b" },
3823
- 600: { value: "#475569" },
3824
- 700: { value: "#334155" },
3825
- 800: { value: "#1e293b" },
3826
- 900: { value: "#0f172a" },
3827
- 950: { value: "#020617" }
3828
- }
3829
- };
3830
- const shadows = {
3831
- "2xs": { value: "0 1px rgb(0 0 0 / 0.05)" },
3832
- xs: { value: "0 1px 2px 0 rgb(0 0 0 / 0.05)" },
3833
- sm: { value: ["0 1px 3px 0 rgb(0 0 0 / 0.1)", "0 1px 2px -1px rgb(0 0 0 / 0.1)"] },
3834
- md: { value: ["0 4px 6px -1px rgb(0 0 0 / 0.1)", "0 2px 4px -2px rgb(0 0 0 / 0.1)"] },
3835
- lg: { value: ["0 10px 15px -3px rgb(0 0 0 / 0.1)", "0 4px 6px -4px rgb(0 0 0 / 0.1)"] },
3836
- xl: { value: ["0 20px 25px -5px rgb(0 0 0 / 0.1)", "0 8px 10px -6px rgb(0 0 0 / 0.1)"] },
3837
- "2xl": { value: "0 25px 50px -12px rgb(0 0 0 / 0.25)" },
3838
- "inset-2xs": { value: "inset 0 1px rgb(0 0 0 / 0.05)" },
3839
- "inset-xs": { value: "inset 0 1px 1px rgb(0 0 0 / 0.05)" },
3840
- "inset-sm": { value: "inset 0 2px 4px rgb(0 0 0 / 0.05)" }
3841
- };
3842
- const spacing = {
3843
- 0: { value: "0rem" },
3844
- .5: { value: "0.125rem" },
3845
- 1: { value: "0.25rem" },
3846
- 1.5: { value: "0.375rem" },
3847
- 2: { value: "0.5rem" },
3848
- 2.5: { value: "0.625rem" },
3849
- 3: { value: "0.75rem" },
3850
- 3.5: { value: "0.875rem" },
3851
- 4: { value: "1rem" },
3852
- 4.5: { value: "1.125rem" },
3853
- 5: { value: "1.25rem" },
3854
- 5.5: { value: "1.375rem" },
3855
- 6: { value: "1.5rem" },
3856
- 7: { value: "1.75rem" },
3857
- 8: { value: "2rem" },
3858
- 9: { value: "2.25rem" },
3859
- 10: { value: "2.5rem" },
3860
- 11: { value: "2.75rem" },
3861
- 12: { value: "3rem" },
3862
- 14: { value: "3.5rem" },
3863
- 16: { value: "4rem" },
3864
- 20: { value: "5rem" },
3865
- 24: { value: "6rem" },
3866
- 28: { value: "7rem" },
3867
- 32: { value: "8rem" },
3868
- 36: { value: "9rem" },
3869
- 40: { value: "10rem" },
3870
- 44: { value: "11rem" },
3871
- 48: { value: "12rem" },
3872
- 52: { value: "13rem" },
3873
- 56: { value: "14rem" },
3874
- 60: { value: "15rem" },
3875
- 64: { value: "16rem" },
3876
- 72: { value: "18rem" },
3877
- 80: { value: "20rem" },
3878
- 96: { value: "24rem" }
3879
- };
3880
- const largeSizes = {
3881
- xs: { value: "20rem" },
3882
- sm: { value: "24rem" },
3883
- md: { value: "28rem" },
3884
- lg: { value: "32rem" },
3885
- xl: { value: "36rem" },
3886
- "2xl": { value: "42rem" },
3887
- "3xl": { value: "48rem" },
3888
- "4xl": { value: "56rem" },
3889
- "5xl": { value: "64rem" },
3890
- "6xl": { value: "72rem" },
3891
- "7xl": { value: "80rem" },
3892
- "8xl": { value: "90rem" },
3893
- prose: { value: "65ch" }
3894
- };
3895
- const sizes = {
3896
- ...spacing,
3897
- ...largeSizes,
3898
- full: { value: "100%" },
3899
- min: { value: "min-content" },
3900
- max: { value: "max-content" },
3901
- fit: { value: "fit-content" }
3902
- };
3903
- const fontSizes = {
3904
- "2xs": { value: "0.5rem" },
3905
- xs: { value: "0.75rem" },
3906
- sm: { value: "0.875rem" },
3907
- md: { value: "1rem" },
3908
- lg: { value: "1.125rem" },
3909
- xl: { value: "1.25rem" },
3910
- "2xl": { value: "1.5rem" },
3911
- "3xl": { value: "1.875rem" },
3912
- "4xl": { value: "2.25rem" },
3913
- "5xl": { value: "3rem" },
3914
- "6xl": { value: "3.75rem" },
3915
- "7xl": { value: "4.5rem" },
3916
- "8xl": { value: "6rem" },
3917
- "9xl": { value: "8rem" }
3918
- };
3919
- const fontWeights = {
3920
- thin: { value: "100" },
3921
- extralight: { value: "200" },
3922
- light: { value: "300" },
3923
- normal: { value: "400" },
3924
- medium: { value: "500" },
3925
- semibold: { value: "600" },
3926
- bold: { value: "700" },
3927
- extrabold: { value: "800" },
3928
- black: { value: "900" }
3929
- };
3930
- const letterSpacings = {
3931
- tighter: { value: "-0.05em" },
3932
- tight: { value: "-0.025em" },
3933
- normal: { value: "0em" },
3934
- wide: { value: "0.025em" },
3935
- wider: { value: "0.05em" },
3936
- widest: { value: "0.1em" }
3937
- };
3938
- const lineHeights = {
3939
- none: { value: "1" },
3940
- tight: { value: "1.25" },
3941
- snug: { value: "1.375" },
3942
- normal: { value: "1.5" },
3943
- relaxed: { value: "1.625" },
3944
- loose: { value: "2" }
3945
- };
3946
- const fonts = {
3947
- sans: { value: [
3948
- "ui-sans-serif",
3949
- "system-ui",
3950
- "-apple-system",
3951
- "BlinkMacSystemFont",
3952
- "\"Segoe UI\"",
3953
- "Roboto",
3954
- "\"Helvetica Neue\"",
3955
- "Arial",
3956
- "\"Noto Sans\"",
3957
- "sans-serif",
3958
- "\"Apple Color Emoji\"",
3959
- "\"Segoe UI Emoji\"",
3960
- "\"Segoe UI Symbol\"",
3961
- "\"Noto Color Emoji\""
3962
- ] },
3963
- serif: { value: [
3964
- "ui-serif",
3965
- "Georgia",
3966
- "Cambria",
3967
- "\"Times New Roman\"",
3968
- "Times",
3969
- "serif"
3970
- ] },
3971
- mono: { value: [
3972
- "ui-monospace",
3973
- "SFMono-Regular",
3974
- "Menlo",
3975
- "Monaco",
3976
- "Consolas",
3977
- "\"Liberation Mono\"",
3978
- "\"Courier New\"",
3979
- "monospace"
3980
- ] }
3981
- };
3982
- const textStyles$1 = {
3983
- xs: { value: {
3984
- fontSize: "0.75rem",
3985
- lineHeight: "calc(1 / 0.75)"
3986
- } },
3987
- sm: { value: {
3988
- fontSize: "0.875rem",
3989
- lineHeight: "calc(1.25 / 0.875)"
3990
- } },
3991
- md: { value: {
3992
- fontSize: "1rem",
3993
- lineHeight: "calc(1.5 / 1)"
3994
- } },
3995
- lg: { value: {
3996
- fontSize: "1.125rem",
3997
- lineHeight: "calc(1.75 / 1.125)"
3998
- } },
3999
- xl: { value: {
4000
- fontSize: "1.25rem",
4001
- lineHeight: "calc(1.75 / 1.25)"
4002
- } },
4003
- "2xl": { value: {
4004
- fontSize: "1.5rem",
4005
- lineHeight: "calc(2 / 1.5)"
4006
- } },
4007
- "3xl": { value: {
4008
- fontSize: "1.875rem",
4009
- lineHeight: "calc(2.25 / 1.875)"
4010
- } },
4011
- "4xl": { value: {
4012
- fontSize: "2.25rem",
4013
- lineHeight: "calc(2.5 / 2.25)"
4014
- } },
4015
- "5xl": { value: {
4016
- fontSize: "3rem",
4017
- lineHeight: "1"
4018
- } },
4019
- "6xl": { value: {
4020
- fontSize: "3.75rem",
4021
- lineHeight: "1"
4022
- } },
4023
- "7xl": { value: {
4024
- fontSize: "4.5rem",
4025
- lineHeight: "1"
4026
- } },
4027
- "8xl": { value: {
4028
- fontSize: "6rem",
4029
- lineHeight: "1"
4030
- } },
4031
- "9xl": { value: {
4032
- fontSize: "8rem",
4033
- lineHeight: "1"
4034
- } }
4035
- };
4036
- const defineTokens = (v) => v;
4037
- const tokens$1 = defineTokens({
4038
- aspectRatios,
4039
- borders,
4040
- easings: {
4041
- default: { value: "cubic-bezier(0.4, 0, 0.2, 1)" },
4042
- linear: { value: "linear" },
4043
- in: { value: "cubic-bezier(0.4, 0, 1, 1)" },
4044
- out: { value: "cubic-bezier(0, 0, 0.2, 1)" },
4045
- "in-out": { value: "cubic-bezier(0.4, 0, 0.2, 1)" }
4046
- },
4047
- durations: {
4048
- fastest: { value: "50ms" },
4049
- faster: { value: "100ms" },
4050
- fast: { value: "150ms" },
4051
- normal: { value: "200ms" },
4052
- slow: { value: "300ms" },
4053
- slower: { value: "400ms" },
4054
- slowest: { value: "500ms" }
4055
- },
4056
- radii: {
4057
- xs: { value: "0.125rem" },
4058
- sm: { value: "0.25rem" },
4059
- md: { value: "0.375rem" },
4060
- lg: { value: "0.5rem" },
4061
- xl: { value: "0.75rem" },
4062
- "2xl": { value: "1rem" },
4063
- "3xl": { value: "1.5rem" },
4064
- "4xl": { value: "2rem" },
4065
- full: { value: "9999px" }
4066
- },
4067
- fontWeights,
4068
- lineHeights,
4069
- fonts,
4070
- letterSpacings,
4071
- fontSizes,
4072
- shadows,
4073
- colors,
4074
- blurs: {
4075
- xs: { value: "4px" },
4076
- sm: { value: "8px" },
4077
- md: { value: "12px" },
4078
- lg: { value: "16px" },
4079
- xl: { value: "24px" },
4080
- "2xl": { value: "40px" },
4081
- "3xl": { value: "64px" }
4082
- },
4083
- spacing,
4084
- sizes,
4085
- animations
4086
- });
4087
- const definePreset = (config) => config;
4088
- const preset = definePreset({
4089
- name: "@bamboocss/preset-bamboo",
4090
- theme: {
4091
- keyframes,
4092
- breakpoints,
4093
- tokens: tokens$1,
4094
- textStyles: textStyles$1,
4095
- containerSizes
4096
- }
4097
- });
4098
-
4099
- //#endregion
4100
- //#region tests/fixtures/config.ts
4101
- const conditions = {
4102
- ...preset$1.conditions,
4103
- dark: "[data-theme=dark] &, .dark &, &.dark, &[data-theme=dark]",
4104
- light: "[data-theme=light] &, .light &, &.light, &[data-theme=light]",
4105
- materialTheme: "[data-color=material] &",
4106
- pastelTheme: "[data-color=pastel] &"
4107
- };
4108
- const theme = preset.theme;
4109
- const tokens = {
4110
- ...theme.tokens,
4111
- colors: {
4112
- ...theme.tokens?.colors,
4113
- deep: { test: {
4114
- pool: {
4115
- poller: { value: "#fff" },
4116
- tall: { value: "$dfdf" }
4117
- },
4118
- yam: { value: "%555" }
4119
- } }
4120
- }
4121
- };
4122
- const textStyles = { headline: {
4123
- h1: { value: {
4124
- fontSize: "2rem",
4125
- fontWeight: "bold"
4126
- } },
4127
- h2: { value: {
4128
- fontSize: {
4129
- base: "1.5rem",
4130
- lg: "2rem"
4131
- },
4132
- fontWeight: "bold"
4133
- } }
4134
- } };
4135
- const fixturePreset = {
4136
- ...preset$1,
4137
- conditions,
4138
- theme: {
4139
- ...theme,
4140
- recipes,
4141
- semanticTokens,
4142
- slotRecipes,
4143
- textStyles,
4144
- tokens
4145
- }
4146
- };
4147
-
4148
- //#endregion
4149
- //#region ../cli/dist/index.mjs
4150
- function defineConfig(config) {
4151
- return Object.assign(config, { name: "__bamboo.config__" });
4152
- }
4153
-
4154
- //#endregion
4155
- //#region tests/fixtures/create-context.ts
4156
- const sandboxConfig = defineConfig({
4157
- exclude: [],
4158
- globalCss: {
4159
- "*": {
4160
- fontFamily: "Inter",
4161
- margin: "0"
4162
- },
4163
- a: {
4164
- color: "inherit",
4165
- textDecoration: "none"
4166
- }
4167
- },
4168
- include: ["./src/**/*.{tsx,jsx}", "./pages/**/*.{jsx,tsx}"],
4169
- jsxFactory: "bamboo",
4170
- jsxFramework: "react",
4171
- outdir: "styled-system",
4172
- preflight: true,
4173
- theme: { extend: {
4174
- recipes: { button: {
4175
- base: { fontSize: "lg" },
4176
- className: "button",
4177
- compoundVariants: [{
4178
- css: { fontSize: "12px" },
4179
- size: "sm",
4180
- variant: "primary"
4181
- }, {
4182
- css: {
4183
- fontSize: "24px",
4184
- fontWeight: "bold",
4185
- padding: 4
4186
- },
4187
- state: "focused",
4188
- variant: ["primary", "danger"]
4189
- }],
4190
- description: "A button styles",
4191
- jsx: [
4192
- "Button",
4193
- "ListedButton",
4194
- /WithRegex$/,
4195
- "PrimaryButtonLike"
4196
- ],
4197
- variants: {
4198
- rounded: { true: { borderRadius: "md" } },
4199
- size: {
4200
- md: {
4201
- borderRadius: "md",
4202
- padding: "4"
4203
- },
4204
- sm: {
4205
- borderRadius: "sm",
4206
- padding: "2"
4207
- }
4208
- },
4209
- state: {
4210
- focused: { color: "green" },
4211
- hovered: { color: "pink.400" }
4212
- },
4213
- variant: {
4214
- danger: {
4215
- backgroundColor: "red.500",
4216
- color: "white"
4217
- },
4218
- primary: {
4219
- backgroundColor: "blue.500",
4220
- color: "white"
4221
- },
4222
- purple: {
4223
- backgroundColor: "purple.500",
4224
- color: "amber.300"
4225
- },
4226
- secondary: {
4227
- backgroundColor: "green.500",
4228
- color: "pink.300"
4229
- }
4230
- }
4231
- }
4232
- } },
4233
- semanticTokens: { colors: {
4234
- bg: { value: {
4235
- _osDark: "{colors.gray.400}",
4236
- base: "{colors.gray.600}"
4237
- } },
4238
- text: { value: {
4239
- _osDark: "{colors.gray.400}",
4240
- base: "{colors.gray.600}"
4241
- } }
4242
- } },
4243
- tokens: { colors: { red: { "400": {
4244
- deprecated: true,
4245
- description: "red color",
4246
- value: "#ff0000"
4247
- } } } }
4248
- } }
4249
- });
4250
- const config = {
4251
- ...fixturePreset,
4252
- cssVarRoot: ":where(html)",
4253
- cwd: "",
4254
- include: [],
4255
- jsxFramework: "react",
4256
- outdir: "styled-system"
4257
- };
4258
- const fixtureDefaults = {
4259
- config,
4260
- dependencies: [],
4261
- deserialize: () => (0, _bamboocss_shared.parseJson)((0, _bamboocss_shared.stringifyJson)(config)),
4262
- hooks: {},
4263
- path: "",
4264
- serialized: (0, _bamboocss_shared.stringifyJson)(config)
4265
- };
4266
- const createGeneratorContext = (userConfig) => {
4267
- const resolvedConfig = (0, _bamboocss_config.mergeConfigs)([
4268
- fixtureDefaults.config,
4269
- sandboxConfig,
4270
- { importMap: "./bamboo" },
4271
- ...userConfig ? [userConfig] : []
4272
- ]);
4273
- return new _bamboocss_generator.Generator({
4274
- ...fixtureDefaults,
4275
- config: resolvedConfig
4276
- });
4277
- };
4278
-
4279
- //#endregion
4280
- //#region src/utils/worker.ts
4281
- const contextCache = {};
4282
- async function getContext(options) {
4283
- if (process.env.NODE_ENV === "test") return createGeneratorContext({
4284
- exclude: ["**/Invalid.tsx", "**/bamboo.config.ts"],
4285
- importMap: "./bamboo",
4286
- include: ["**/*"],
4287
- jsxFactory: "styled"
4288
- });
4289
- else {
4290
- const configPath = (0, _bamboocss_config.findConfig)({ cwd: options.configPath ?? options.currentFile });
4291
- if (!contextCache[configPath]) contextCache[configPath] = _getContext(configPath);
4292
- return contextCache[configPath];
4293
- }
4294
- }
4295
- async function _getContext(configPath) {
4296
- if (!configPath) throw new Error("Invalid config path");
4297
- return new _bamboocss_generator.Generator(await (0, _bamboocss_config.loadConfig)({
4298
- cwd: path.default.dirname(configPath),
4299
- file: configPath
4300
- }));
4301
- }
4302
- const filterDeprecatedTokens = (context, tokens) => {
4303
- return tokens.filter((token) => {
4304
- const value = typeof token === "string" ? token : token.category + "." + token.value;
4305
- return context.utility.tokens.isDeprecated(value);
4306
- });
4307
- };
4308
- const filterInvalidTokens = (context, paths) => {
4309
- return paths.filter((path$2) => !context.utility.tokens.view.get(path$2));
4310
- };
4311
- const getPropertyCategory = (context, _attribute) => {
4312
- const attribute = resolveLongHand(context, _attribute) || _attribute;
4313
- const attributeConfig = context.utility.config[attribute];
4314
- return typeof attributeConfig?.values === "string" ? attributeConfig.values : void 0;
4315
- };
4316
- const isColorAttribute = (context, _attribute) => {
4317
- return getPropertyCategory(context, _attribute) === "colors";
4318
- };
4319
- const isColorToken = (context, value) => {
4320
- return Boolean(context.utility.tokens.view.categoryMap.get("colors")?.get(value));
4321
- };
4322
- function run(action, options, ...args) {
4323
- return runAsync(action, options, ...args);
4324
- }
4325
- async function runAsync(action, options, ...args) {
4326
- const context = await getContext(options);
4327
- switch (action) {
4328
- case "filterDeprecatedTokens": return filterDeprecatedTokens(context, ...args);
4329
- case "filterImports": return filterImports(context, ...args);
4330
- case "filterInvalidTokens": return filterInvalidTokens(context, ...args);
4331
- case "getJsxFactory": return getJsxFactory(context);
4332
- case "getPropCategory": return getPropertyCategory(context, ...args);
4333
- case "isColorAttribute": return isColorAttribute(context, ...args);
4334
- case "isColorToken": return isColorToken(context, ...args);
4335
- case "isValidFile": return isValidFile(context, options.currentFile);
4336
- case "isValidProperty": return isValidProperty(context, ...args);
4337
- case "matchFile": return matchFile(context, ...args);
4338
- case "matchImports": return matchImports(context, ...args);
4339
- case "resolveLongHand": return resolveLongHand(context, ...args);
4340
- case "resolveShorthands": return resolveShorthands(context, ...args);
4341
- }
4342
- }
4343
- const isValidFile = (context, fileName) => {
4344
- const { exclude, include } = context.config;
4345
- const cwd = context.config.cwd || process.cwd();
4346
- const relativePath = path.default.isAbsolute(fileName) ? path.default.relative(cwd, fileName) : fileName;
4347
- return micromatch.default.isMatch(relativePath, include, {
4348
- dot: true,
4349
- ignore: exclude
4350
- });
4351
- };
4352
- const isValidProperty = (context, name, patternName) => {
4353
- if (context.isValidProperty(name)) return true;
4354
- if (!patternName) return false;
4355
- if (patternName === context.config.jsxFactory) return false;
4356
- const pattern = context.patterns.details.find((p) => p.baseName === patternName || p.jsx.includes(patternName))?.config.properties;
4357
- if (!pattern) return false;
4358
- return Object.keys(pattern).includes(name);
4359
- };
4360
- const matchFile = (context, name, imports) => {
4361
- return context.imports.file(imports).match(name);
4362
- };
4363
- const matchImports = (context, result) => {
4364
- return context.imports.match(result, (module_) => {
4365
- const { tsOptions } = context.parserOptions;
4366
- if (!tsOptions?.pathMappings) return;
4367
- return (0, _bamboocss_config_ts_path.resolveTsPathPattern)(tsOptions.pathMappings, module_);
4368
- });
4369
- };
4370
- const filterImports = (context, imports) => {
4371
- return imports.filter((imp) => context.imports.match(imp, (module_) => {
4372
- const { tsOptions } = context.parserOptions;
4373
- if (!tsOptions?.pathMappings) return;
4374
- return (0, _bamboocss_config_ts_path.resolveTsPathPattern)(tsOptions.pathMappings, module_);
4375
- }));
4376
- };
4377
- const reverseShorthandsMapCache = /* @__PURE__ */ new WeakMap();
4378
- const getReverseShorthandsMap = (context) => {
4379
- let reverseMap = reverseShorthandsMapCache.get(context);
4380
- if (!reverseMap) {
4381
- reverseMap = /* @__PURE__ */ new Map();
4382
- const shorthands = context.utility.getPropShorthandsMap();
4383
- for (const [key, values] of shorthands) for (const value of values) reverseMap.set(value, key);
4384
- reverseShorthandsMapCache.set(context, reverseMap);
4385
- }
4386
- return reverseMap;
4387
- };
4388
- const resolveLongHand = (context, name) => {
4389
- return getReverseShorthandsMap(context).get(name);
4390
- };
4391
- const resolveShorthands = (context, name) => {
4392
- return context.utility.getPropShorthandsMap().get(name);
4393
- };
4394
- const getJsxFactory = (context) => {
4395
- return context.config.jsxFactory;
4396
- };
4397
- (0, synckit.runAsWorker)(run);
4398
-
4399
- //#endregion
4400
- //#region src/utils/index.ts
4401
- const createRule = _typescript_eslint_utils.ESLintUtils.RuleCreator((name) => `https://github.com/bamboocss/bamboo/blob/main/packages/eslint-plugin/docs/rules/${name}.md`);
4402
- const isBase = process.env.NODE_ENV !== "test" || require("url").pathToFileURL(__filename).href.endsWith("dist/index.js");
4403
- const _syncAction = (0, synckit.createSyncFn)((0, node_path.join)((0, node_url.fileURLToPath)(new URL(isBase ? "./" : "../../dist", require("url").pathToFileURL(__filename).href)), "utils/worker.mjs"));
4404
- const cache = /* @__PURE__ */ new Map();
4405
- const syncAction = ((...args) => {
4406
- const cacheKey = JSON.stringify(args);
4407
- if (cache.has(cacheKey)) return cache.get(cacheKey);
4408
- try {
4409
- const result = _syncAction(...args);
4410
- cache.set(cacheKey, result);
4411
- return result;
4412
- } catch (error) {
4413
- console.error("syncAction error:", error);
4414
- return;
4415
- }
4416
- });
4417
-
4418
- //#endregion
4419
- Object.defineProperty(exports, '__toESM', {
4420
- enumerable: true,
4421
- get: function () {
4422
- return __toESM;
4423
- }
4424
- });
4425
- Object.defineProperty(exports, 'createRule', {
4426
- enumerable: true,
4427
- get: function () {
4428
- return createRule;
4429
- }
4430
- });
4431
- Object.defineProperty(exports, 'getContext', {
4432
- enumerable: true,
4433
- get: function () {
4434
- return getContext;
4435
- }
4436
- });
4437
- Object.defineProperty(exports, 'run', {
4438
- enumerable: true,
4439
- get: function () {
4440
- return run;
4441
- }
4442
- });
4443
- Object.defineProperty(exports, 'runAsync', {
4444
- enumerable: true,
4445
- get: function () {
4446
- return runAsync;
4447
- }
4448
- });
4449
- Object.defineProperty(exports, 'syncAction', {
4450
- enumerable: true,
4451
- get: function () {
4452
- return syncAction;
4453
- }
4454
- });
4455
- //# sourceMappingURL=utils-BQiAeXE_.cjs.map