@pandacss/preset-base 0.28.0 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +63 -4
- package/dist/index.d.ts +63 -4
- package/dist/index.js +193 -112
- package/dist/index.mjs +193 -112
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -117,6 +117,18 @@ var conditions = {
|
|
|
117
117
|
vertical: "&[data-orientation=vertical]"
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
+
// src/color-mix-transform.ts
|
|
121
|
+
var createColorMixTransform = (prop) => (value, args) => {
|
|
122
|
+
const mix = args.utils.colorMix(value);
|
|
123
|
+
if (mix.invalid)
|
|
124
|
+
return { [prop]: value };
|
|
125
|
+
const cssVar = "--mix-" + prop;
|
|
126
|
+
return {
|
|
127
|
+
[cssVar]: mix.value,
|
|
128
|
+
[prop]: `var(${cssVar}, ${mix.color})`
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
|
|
120
132
|
// src/utilities/background.ts
|
|
121
133
|
var background = {
|
|
122
134
|
backgroundPosition: {
|
|
@@ -148,12 +160,14 @@ var background = {
|
|
|
148
160
|
background: {
|
|
149
161
|
shorthand: "bg",
|
|
150
162
|
className: "bg",
|
|
151
|
-
values: "colors"
|
|
163
|
+
values: "colors",
|
|
164
|
+
transform: createColorMixTransform("background")
|
|
152
165
|
},
|
|
153
166
|
backgroundColor: {
|
|
154
167
|
shorthand: "bgColor",
|
|
155
168
|
className: "bg",
|
|
156
|
-
values: "colors"
|
|
169
|
+
values: "colors",
|
|
170
|
+
transform: createColorMixTransform("backgroundColor")
|
|
157
171
|
},
|
|
158
172
|
backgroundOrigin: {
|
|
159
173
|
shorthand: "bgOrigin",
|
|
@@ -228,32 +242,26 @@ var background = {
|
|
|
228
242
|
gradientFrom: {
|
|
229
243
|
className: "from",
|
|
230
244
|
values: "colors",
|
|
231
|
-
transform(
|
|
232
|
-
return {
|
|
233
|
-
"--gradient-from": value
|
|
234
|
-
};
|
|
235
|
-
}
|
|
245
|
+
transform: createColorMixTransform("--gradient-from")
|
|
236
246
|
},
|
|
237
247
|
gradientTo: {
|
|
238
248
|
className: "to",
|
|
239
249
|
values: "colors",
|
|
240
|
-
transform(
|
|
241
|
-
return {
|
|
242
|
-
"--gradient-to": value
|
|
243
|
-
};
|
|
244
|
-
}
|
|
250
|
+
transform: createColorMixTransform("--gradient-to")
|
|
245
251
|
},
|
|
246
252
|
gradientVia: {
|
|
247
253
|
className: "via",
|
|
248
254
|
values: "colors",
|
|
249
|
-
transform(value) {
|
|
255
|
+
transform(value, args) {
|
|
256
|
+
const transformed = gradientVia(value, args);
|
|
250
257
|
return {
|
|
251
|
-
|
|
252
|
-
"--gradient-via":
|
|
258
|
+
...transformed,
|
|
259
|
+
"--gradient-via-stops": "var(--gradient-from), var(--gradient-via), var(--gradient-to)"
|
|
253
260
|
};
|
|
254
261
|
}
|
|
255
262
|
}
|
|
256
263
|
};
|
|
264
|
+
var gradientVia = createColorMixTransform("--gradient-via");
|
|
257
265
|
|
|
258
266
|
// src/utilities/border.ts
|
|
259
267
|
var border = {
|
|
@@ -400,7 +408,8 @@ var border = {
|
|
|
400
408
|
},
|
|
401
409
|
borderColor: {
|
|
402
410
|
className: "border",
|
|
403
|
-
values: "colors"
|
|
411
|
+
values: "colors",
|
|
412
|
+
transform: createColorMixTransform("borderColor")
|
|
404
413
|
},
|
|
405
414
|
borderInline: {
|
|
406
415
|
className: "border-x",
|
|
@@ -415,7 +424,8 @@ var border = {
|
|
|
415
424
|
borderInlineColor: {
|
|
416
425
|
className: "border-x",
|
|
417
426
|
values: "colors",
|
|
418
|
-
shorthand: "borderXColor"
|
|
427
|
+
shorthand: "borderXColor",
|
|
428
|
+
transform: createColorMixTransform("borderInlineColor")
|
|
419
429
|
},
|
|
420
430
|
borderBlock: {
|
|
421
431
|
className: "border-y",
|
|
@@ -430,7 +440,8 @@ var border = {
|
|
|
430
440
|
borderBlockColor: {
|
|
431
441
|
className: "border-y",
|
|
432
442
|
values: "colors",
|
|
433
|
-
shorthand: "borderYColor"
|
|
443
|
+
shorthand: "borderYColor",
|
|
444
|
+
transform: createColorMixTransform("borderBlockColor")
|
|
434
445
|
},
|
|
435
446
|
borderLeft: {
|
|
436
447
|
className: "border-l",
|
|
@@ -438,7 +449,8 @@ var border = {
|
|
|
438
449
|
},
|
|
439
450
|
borderLeftColor: {
|
|
440
451
|
className: "border-l",
|
|
441
|
-
values: "colors"
|
|
452
|
+
values: "colors",
|
|
453
|
+
transform: createColorMixTransform("borderLeftColor")
|
|
442
454
|
},
|
|
443
455
|
borderInlineStart: {
|
|
444
456
|
className: "border-s",
|
|
@@ -453,7 +465,8 @@ var border = {
|
|
|
453
465
|
borderInlineStartColor: {
|
|
454
466
|
className: "border-s",
|
|
455
467
|
values: "colors",
|
|
456
|
-
shorthand: "borderStartColor"
|
|
468
|
+
shorthand: "borderStartColor",
|
|
469
|
+
transform: createColorMixTransform("borderInlineStartColor")
|
|
457
470
|
},
|
|
458
471
|
borderRight: {
|
|
459
472
|
className: "border-r",
|
|
@@ -461,7 +474,8 @@ var border = {
|
|
|
461
474
|
},
|
|
462
475
|
borderRightColor: {
|
|
463
476
|
className: "border-r",
|
|
464
|
-
values: "colors"
|
|
477
|
+
values: "colors",
|
|
478
|
+
transform: createColorMixTransform("borderRightColor")
|
|
465
479
|
},
|
|
466
480
|
borderInlineEnd: {
|
|
467
481
|
className: "border-e",
|
|
@@ -476,7 +490,8 @@ var border = {
|
|
|
476
490
|
borderInlineEndColor: {
|
|
477
491
|
className: "border-e",
|
|
478
492
|
values: "colors",
|
|
479
|
-
shorthand: "borderEndColor"
|
|
493
|
+
shorthand: "borderEndColor",
|
|
494
|
+
transform: createColorMixTransform("borderInlineEndColor")
|
|
480
495
|
},
|
|
481
496
|
borderTop: {
|
|
482
497
|
className: "border-t",
|
|
@@ -484,7 +499,8 @@ var border = {
|
|
|
484
499
|
},
|
|
485
500
|
borderTopColor: {
|
|
486
501
|
className: "border-t",
|
|
487
|
-
values: "colors"
|
|
502
|
+
values: "colors",
|
|
503
|
+
transform: createColorMixTransform("borderTopColor")
|
|
488
504
|
},
|
|
489
505
|
borderBottom: {
|
|
490
506
|
className: "border-b",
|
|
@@ -492,7 +508,8 @@ var border = {
|
|
|
492
508
|
},
|
|
493
509
|
borderBottomColor: {
|
|
494
510
|
className: "border-b",
|
|
495
|
-
values: "colors"
|
|
511
|
+
values: "colors",
|
|
512
|
+
transform: createColorMixTransform("borderBottomColor")
|
|
496
513
|
},
|
|
497
514
|
borderBlockEnd: {
|
|
498
515
|
className: "border-be",
|
|
@@ -500,7 +517,8 @@ var border = {
|
|
|
500
517
|
},
|
|
501
518
|
borderBlockEndColor: {
|
|
502
519
|
className: "border-be",
|
|
503
|
-
values: "colors"
|
|
520
|
+
values: "colors",
|
|
521
|
+
transform: createColorMixTransform("borderBlockEndColor")
|
|
504
522
|
},
|
|
505
523
|
borderBlockStart: {
|
|
506
524
|
className: "border-bs",
|
|
@@ -508,7 +526,23 @@ var border = {
|
|
|
508
526
|
},
|
|
509
527
|
borderBlockStartColor: {
|
|
510
528
|
className: "border-bs",
|
|
511
|
-
values: "colors"
|
|
529
|
+
values: "colors",
|
|
530
|
+
transform: createColorMixTransform("borderBlockStartColor")
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
// src/utilities/container.ts
|
|
535
|
+
var container = {
|
|
536
|
+
container: {
|
|
537
|
+
className: "cq"
|
|
538
|
+
},
|
|
539
|
+
containerName: {
|
|
540
|
+
className: "cq-name",
|
|
541
|
+
property: "containerName",
|
|
542
|
+
values: "containerNames"
|
|
543
|
+
},
|
|
544
|
+
containerType: {
|
|
545
|
+
className: "cq-type"
|
|
512
546
|
}
|
|
513
547
|
};
|
|
514
548
|
|
|
@@ -574,11 +608,9 @@ var divide = {
|
|
|
574
608
|
divideColor: {
|
|
575
609
|
className: "divide",
|
|
576
610
|
values: "colors",
|
|
577
|
-
transform(value) {
|
|
611
|
+
transform(value, args) {
|
|
578
612
|
return {
|
|
579
|
-
"& > :not([hidden]) ~ :not([hidden])":
|
|
580
|
-
borderColor: value
|
|
581
|
-
}
|
|
613
|
+
"& > :not([hidden]) ~ :not([hidden])": divideColor(value, args)
|
|
582
614
|
};
|
|
583
615
|
}
|
|
584
616
|
},
|
|
@@ -594,6 +626,7 @@ var divide = {
|
|
|
594
626
|
}
|
|
595
627
|
}
|
|
596
628
|
};
|
|
629
|
+
var divideColor = createColorMixTransform("borderColor");
|
|
597
630
|
|
|
598
631
|
// src/utilities/effects.ts
|
|
599
632
|
var effects = {
|
|
@@ -609,11 +642,7 @@ var effects = {
|
|
|
609
642
|
shorthand: "shadowColor",
|
|
610
643
|
className: "shadow",
|
|
611
644
|
values: "colors",
|
|
612
|
-
transform(
|
|
613
|
-
return {
|
|
614
|
-
"--shadow-color": value
|
|
615
|
-
};
|
|
616
|
-
}
|
|
645
|
+
transform: createColorMixTransform("--shadow-color")
|
|
617
646
|
},
|
|
618
647
|
mixBlendMode: {
|
|
619
648
|
className: "mix-blend"
|
|
@@ -1045,11 +1074,13 @@ var helpers = {
|
|
|
1045
1074
|
var interactivity = {
|
|
1046
1075
|
accentColor: {
|
|
1047
1076
|
className: "accent",
|
|
1048
|
-
values: "colors"
|
|
1077
|
+
values: "colors",
|
|
1078
|
+
transform: createColorMixTransform("accentColor")
|
|
1049
1079
|
},
|
|
1050
1080
|
caretColor: {
|
|
1051
1081
|
className: "caret",
|
|
1052
|
-
values: "colors"
|
|
1082
|
+
values: "colors",
|
|
1083
|
+
transform: createColorMixTransform("caretColor")
|
|
1053
1084
|
},
|
|
1054
1085
|
scrollBehavior: {
|
|
1055
1086
|
className: "scroll"
|
|
@@ -1428,7 +1459,8 @@ var outline = {
|
|
|
1428
1459
|
outlineColor: {
|
|
1429
1460
|
className: "ring",
|
|
1430
1461
|
values: "colors",
|
|
1431
|
-
shorthand: "ringColor"
|
|
1462
|
+
shorthand: "ringColor",
|
|
1463
|
+
transform: createColorMixTransform("outlineColor")
|
|
1432
1464
|
},
|
|
1433
1465
|
outline: {
|
|
1434
1466
|
className: "ring",
|
|
@@ -1448,6 +1480,58 @@ var outline = {
|
|
|
1448
1480
|
}
|
|
1449
1481
|
};
|
|
1450
1482
|
|
|
1483
|
+
// src/utilities/polyfill.ts
|
|
1484
|
+
var polyfill = {
|
|
1485
|
+
appearance: {
|
|
1486
|
+
className: "appearance",
|
|
1487
|
+
transform(value) {
|
|
1488
|
+
return { appearance: value, WebkitAppearance: value };
|
|
1489
|
+
}
|
|
1490
|
+
},
|
|
1491
|
+
backfaceVisibility: {
|
|
1492
|
+
className: "backface",
|
|
1493
|
+
transform(value) {
|
|
1494
|
+
return { backfaceVisibility: value, WebkitBackfaceVisibility: value };
|
|
1495
|
+
}
|
|
1496
|
+
},
|
|
1497
|
+
clipPath: {
|
|
1498
|
+
className: "clip-path",
|
|
1499
|
+
transform(value) {
|
|
1500
|
+
return { clipPath: value, WebkitClipPath: value };
|
|
1501
|
+
}
|
|
1502
|
+
},
|
|
1503
|
+
hyphens: {
|
|
1504
|
+
className: "hyphens",
|
|
1505
|
+
transform(value) {
|
|
1506
|
+
return { hyphens: value, WebkitHyphens: value };
|
|
1507
|
+
}
|
|
1508
|
+
},
|
|
1509
|
+
mask: {
|
|
1510
|
+
className: "mask",
|
|
1511
|
+
transform(value) {
|
|
1512
|
+
return { mask: value, WebkitMask: value };
|
|
1513
|
+
}
|
|
1514
|
+
},
|
|
1515
|
+
maskImage: {
|
|
1516
|
+
className: "mask-image",
|
|
1517
|
+
transform(value) {
|
|
1518
|
+
return { maskImage: value, WebkitMaskImage: value };
|
|
1519
|
+
}
|
|
1520
|
+
},
|
|
1521
|
+
maskSize: {
|
|
1522
|
+
className: "mask-size",
|
|
1523
|
+
transform(value) {
|
|
1524
|
+
return { maskSize: value, WebkitMaskSize: value };
|
|
1525
|
+
}
|
|
1526
|
+
},
|
|
1527
|
+
textSizeAdjust: {
|
|
1528
|
+
className: "text-size-adjust",
|
|
1529
|
+
transform(value) {
|
|
1530
|
+
return { textSizeAdjust: value, WebkitTextSizeAdjust: value };
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
};
|
|
1534
|
+
|
|
1451
1535
|
// src/utilities/sizing.ts
|
|
1452
1536
|
var widthValues = (theme) => ({
|
|
1453
1537
|
auto: "auto",
|
|
@@ -1678,11 +1762,13 @@ var spacing = {
|
|
|
1678
1762
|
var svg = {
|
|
1679
1763
|
fill: {
|
|
1680
1764
|
className: "fill",
|
|
1681
|
-
values: "colors"
|
|
1765
|
+
values: "colors",
|
|
1766
|
+
transform: createColorMixTransform("fill")
|
|
1682
1767
|
},
|
|
1683
1768
|
stroke: {
|
|
1684
1769
|
className: "stroke",
|
|
1685
|
-
values: "colors"
|
|
1770
|
+
values: "colors",
|
|
1771
|
+
transform: createColorMixTransform("stroke")
|
|
1686
1772
|
},
|
|
1687
1773
|
strokeWidth: {
|
|
1688
1774
|
className: "stroke-w",
|
|
@@ -1878,7 +1964,8 @@ var transitions = {
|
|
|
1878
1964
|
var typography = {
|
|
1879
1965
|
color: {
|
|
1880
1966
|
className: "text",
|
|
1881
|
-
values: "colors"
|
|
1967
|
+
values: "colors",
|
|
1968
|
+
transform: createColorMixTransform("color")
|
|
1882
1969
|
},
|
|
1883
1970
|
fontFamily: {
|
|
1884
1971
|
className: "font",
|
|
@@ -1923,11 +2010,13 @@ var typography = {
|
|
|
1923
2010
|
},
|
|
1924
2011
|
textDecorationColor: {
|
|
1925
2012
|
className: "text-decor",
|
|
1926
|
-
values: "colors"
|
|
2013
|
+
values: "colors",
|
|
2014
|
+
transform: createColorMixTransform("textDecorationColor")
|
|
1927
2015
|
},
|
|
1928
2016
|
textEmphasisColor: {
|
|
1929
2017
|
className: "text-emphasis",
|
|
1930
|
-
values: "colors"
|
|
2018
|
+
values: "colors",
|
|
2019
|
+
transform: createColorMixTransform("textEmphasisColor")
|
|
1931
2020
|
},
|
|
1932
2021
|
textDecorationStyle: {
|
|
1933
2022
|
className: "decoration"
|
|
@@ -1996,58 +2085,6 @@ var typography = {
|
|
|
1996
2085
|
}
|
|
1997
2086
|
};
|
|
1998
2087
|
|
|
1999
|
-
// src/utilities/polyfill.ts
|
|
2000
|
-
var polyfill = {
|
|
2001
|
-
appearance: {
|
|
2002
|
-
className: "appearance",
|
|
2003
|
-
transform(value) {
|
|
2004
|
-
return { appearance: value, WebkitAppearance: value };
|
|
2005
|
-
}
|
|
2006
|
-
},
|
|
2007
|
-
backfaceVisibility: {
|
|
2008
|
-
className: "backface",
|
|
2009
|
-
transform(value) {
|
|
2010
|
-
return { backfaceVisibility: value, WebkitBackfaceVisibility: value };
|
|
2011
|
-
}
|
|
2012
|
-
},
|
|
2013
|
-
clipPath: {
|
|
2014
|
-
className: "clip-path",
|
|
2015
|
-
transform(value) {
|
|
2016
|
-
return { clipPath: value, WebkitClipPath: value };
|
|
2017
|
-
}
|
|
2018
|
-
},
|
|
2019
|
-
hyphens: {
|
|
2020
|
-
className: "hyphens",
|
|
2021
|
-
transform(value) {
|
|
2022
|
-
return { hyphens: value, WebkitHyphens: value };
|
|
2023
|
-
}
|
|
2024
|
-
},
|
|
2025
|
-
mask: {
|
|
2026
|
-
className: "mask",
|
|
2027
|
-
transform(value) {
|
|
2028
|
-
return { mask: value, WebkitMask: value };
|
|
2029
|
-
}
|
|
2030
|
-
},
|
|
2031
|
-
maskImage: {
|
|
2032
|
-
className: "mask-image",
|
|
2033
|
-
transform(value) {
|
|
2034
|
-
return { maskImage: value, WebkitMaskImage: value };
|
|
2035
|
-
}
|
|
2036
|
-
},
|
|
2037
|
-
maskSize: {
|
|
2038
|
-
className: "mask-size",
|
|
2039
|
-
transform(value) {
|
|
2040
|
-
return { maskSize: value, WebkitMaskSize: value };
|
|
2041
|
-
}
|
|
2042
|
-
},
|
|
2043
|
-
textSizeAdjust: {
|
|
2044
|
-
className: "text-size-adjust",
|
|
2045
|
-
transform(value) {
|
|
2046
|
-
return { textSizeAdjust: value, WebkitTextSizeAdjust: value };
|
|
2047
|
-
}
|
|
2048
|
-
}
|
|
2049
|
-
};
|
|
2050
|
-
|
|
2051
2088
|
// src/utilities/index.ts
|
|
2052
2089
|
var utilities = Object.assign(
|
|
2053
2090
|
{},
|
|
@@ -2069,7 +2106,8 @@ var utilities = Object.assign(
|
|
|
2069
2106
|
interactivity,
|
|
2070
2107
|
svg,
|
|
2071
2108
|
helpers,
|
|
2072
|
-
polyfill
|
|
2109
|
+
polyfill,
|
|
2110
|
+
container
|
|
2073
2111
|
);
|
|
2074
2112
|
|
|
2075
2113
|
// src/patterns.ts
|
|
@@ -2113,8 +2151,12 @@ var stack = definePattern({
|
|
|
2113
2151
|
direction: { type: "property", value: "flexDirection" },
|
|
2114
2152
|
gap: { type: "property", value: "gap" }
|
|
2115
2153
|
},
|
|
2154
|
+
defaultValues: {
|
|
2155
|
+
direction: "column",
|
|
2156
|
+
gap: "10px"
|
|
2157
|
+
},
|
|
2116
2158
|
transform(props) {
|
|
2117
|
-
const { align, justify, direction
|
|
2159
|
+
const { align, justify, direction, gap, ...rest } = props;
|
|
2118
2160
|
return {
|
|
2119
2161
|
display: "flex",
|
|
2120
2162
|
flexDirection: direction,
|
|
@@ -2131,8 +2173,11 @@ var vstack = definePattern({
|
|
|
2131
2173
|
justify: { type: "property", value: "justifyContent" },
|
|
2132
2174
|
gap: { type: "property", value: "gap" }
|
|
2133
2175
|
},
|
|
2176
|
+
defaultValues: {
|
|
2177
|
+
gap: "10px"
|
|
2178
|
+
},
|
|
2134
2179
|
transform(props) {
|
|
2135
|
-
const { justify, gap
|
|
2180
|
+
const { justify, gap, ...rest } = props;
|
|
2136
2181
|
return {
|
|
2137
2182
|
display: "flex",
|
|
2138
2183
|
alignItems: "center",
|
|
@@ -2149,8 +2194,11 @@ var hstack = definePattern({
|
|
|
2149
2194
|
justify: { type: "property", value: "justifyContent" },
|
|
2150
2195
|
gap: { type: "property", value: "gap" }
|
|
2151
2196
|
},
|
|
2197
|
+
defaultValues: {
|
|
2198
|
+
gap: "10px"
|
|
2199
|
+
},
|
|
2152
2200
|
transform(props) {
|
|
2153
|
-
const { justify, gap
|
|
2201
|
+
const { justify, gap, ...rest } = props;
|
|
2154
2202
|
return {
|
|
2155
2203
|
display: "flex",
|
|
2156
2204
|
alignItems: "center",
|
|
@@ -2218,10 +2266,12 @@ var grid = definePattern({
|
|
|
2218
2266
|
columns: { type: "number" },
|
|
2219
2267
|
minChildWidth: { type: "token", value: "sizes", property: "width" }
|
|
2220
2268
|
},
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2269
|
+
defaultValues(props) {
|
|
2270
|
+
return { gap: props.columnGap || props.rowGap ? void 0 : "10px" };
|
|
2271
|
+
},
|
|
2272
|
+
transform(props, { map, isCssUnit }) {
|
|
2273
|
+
const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props;
|
|
2274
|
+
const getValue = (v) => isCssUnit(v) ? v : `token(sizes.${v}, ${v})`;
|
|
2225
2275
|
return {
|
|
2226
2276
|
display: "grid",
|
|
2227
2277
|
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,
|
|
@@ -2277,7 +2327,7 @@ var wrap = definePattern({
|
|
|
2277
2327
|
};
|
|
2278
2328
|
}
|
|
2279
2329
|
});
|
|
2280
|
-
var
|
|
2330
|
+
var container2 = definePattern({
|
|
2281
2331
|
transform(props) {
|
|
2282
2332
|
return {
|
|
2283
2333
|
position: "relative",
|
|
@@ -2340,8 +2390,12 @@ var divider = definePattern({
|
|
|
2340
2390
|
thickness: { type: "token", value: "sizes", property: "borderWidth" },
|
|
2341
2391
|
color: { type: "token", value: "colors", property: "borderColor" }
|
|
2342
2392
|
},
|
|
2393
|
+
defaultValues: {
|
|
2394
|
+
orientation: "horizontal",
|
|
2395
|
+
thickness: "1px"
|
|
2396
|
+
},
|
|
2343
2397
|
transform(props, { map }) {
|
|
2344
|
-
const { orientation
|
|
2398
|
+
const { orientation, thickness, color, ...rest } = props;
|
|
2345
2399
|
return {
|
|
2346
2400
|
"--thickness": thickness,
|
|
2347
2401
|
width: map(orientation, (v) => v === "vertical" ? void 0 : "100%"),
|
|
@@ -2403,8 +2457,12 @@ var float = definePattern({
|
|
|
2403
2457
|
]
|
|
2404
2458
|
}
|
|
2405
2459
|
},
|
|
2460
|
+
defaultValues(props) {
|
|
2461
|
+
const offset = props.offset || "0";
|
|
2462
|
+
return { offset, offsetX: offset, offsetY: offset, placement: "top-end" };
|
|
2463
|
+
},
|
|
2406
2464
|
transform(props, { map }) {
|
|
2407
|
-
const { offset
|
|
2465
|
+
const { offset, offsetX, offsetY, placement, ...rest } = props;
|
|
2408
2466
|
return {
|
|
2409
2467
|
display: "inline-flex",
|
|
2410
2468
|
justifyContent: "center",
|
|
@@ -2445,11 +2503,16 @@ var bleed = definePattern({
|
|
|
2445
2503
|
inline: { type: "property", value: "marginInline" },
|
|
2446
2504
|
block: { type: "property", value: "marginBlock" }
|
|
2447
2505
|
},
|
|
2448
|
-
|
|
2449
|
-
|
|
2506
|
+
defaultValues: {
|
|
2507
|
+
inline: "0",
|
|
2508
|
+
block: "0"
|
|
2509
|
+
},
|
|
2510
|
+
transform(props, { map, isCssUnit, isCssVar }) {
|
|
2511
|
+
const { inline, block, ...rest } = props;
|
|
2512
|
+
const valueFn = (v) => isCssUnit(v) || isCssVar(v) ? v : `token(spacing.${v}, ${v})`;
|
|
2450
2513
|
return {
|
|
2451
|
-
"--bleed-x":
|
|
2452
|
-
"--bleed-y":
|
|
2514
|
+
"--bleed-x": map(inline, valueFn),
|
|
2515
|
+
"--bleed-y": map(block, valueFn),
|
|
2453
2516
|
marginInline: "calc(var(--bleed-x, 0) * -1)",
|
|
2454
2517
|
marginBlock: "calc(var(--bleed-y, 0) * -1)",
|
|
2455
2518
|
...rest
|
|
@@ -2464,6 +2527,23 @@ var visuallyHidden = definePattern({
|
|
|
2464
2527
|
};
|
|
2465
2528
|
}
|
|
2466
2529
|
});
|
|
2530
|
+
var cq = definePattern({
|
|
2531
|
+
properties: {
|
|
2532
|
+
name: { type: "token", value: "containerNames", property: "containerName" },
|
|
2533
|
+
type: { type: "property", value: "containerType" }
|
|
2534
|
+
},
|
|
2535
|
+
defaultValues: {
|
|
2536
|
+
type: "inline-size"
|
|
2537
|
+
},
|
|
2538
|
+
transform(props) {
|
|
2539
|
+
const { name, type, ...rest } = props;
|
|
2540
|
+
return {
|
|
2541
|
+
containerType: type,
|
|
2542
|
+
containerName: name,
|
|
2543
|
+
...rest
|
|
2544
|
+
};
|
|
2545
|
+
}
|
|
2546
|
+
});
|
|
2467
2547
|
var patterns = {
|
|
2468
2548
|
box,
|
|
2469
2549
|
flex,
|
|
@@ -2480,11 +2560,12 @@ var patterns = {
|
|
|
2480
2560
|
grid,
|
|
2481
2561
|
gridItem,
|
|
2482
2562
|
wrap,
|
|
2483
|
-
container,
|
|
2563
|
+
container: container2,
|
|
2484
2564
|
divider,
|
|
2485
2565
|
float,
|
|
2486
2566
|
bleed,
|
|
2487
|
-
visuallyHidden
|
|
2567
|
+
visuallyHidden,
|
|
2568
|
+
cq
|
|
2488
2569
|
};
|
|
2489
2570
|
|
|
2490
2571
|
// src/index.ts
|