@pandacss/preset-base 0.5.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +67 -32
- package/dist/index.mjs +67 -32
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -80,7 +80,7 @@ declare const preset: {
|
|
|
80
80
|
light: string;
|
|
81
81
|
osDark: string;
|
|
82
82
|
osLight: string;
|
|
83
|
-
|
|
83
|
+
highContrast: string;
|
|
84
84
|
lessContrast: string;
|
|
85
85
|
moreContrast: string;
|
|
86
86
|
ltr: string;
|
|
@@ -364,7 +364,9 @@ declare const preset: {
|
|
|
364
364
|
transform(props: _pandacss_types_dist_pattern.Props<_pandacss_types_dist_pattern.PatternProperties>, { map }: _pandacss_types.PatternHelpers): {
|
|
365
365
|
gridColumn: any;
|
|
366
366
|
gridRow: any;
|
|
367
|
+
gridColumnStart: any;
|
|
367
368
|
gridColumnEnd: any;
|
|
369
|
+
gridRowStart: any;
|
|
368
370
|
gridRowEnd: any;
|
|
369
371
|
};
|
|
370
372
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ declare const preset: {
|
|
|
80
80
|
light: string;
|
|
81
81
|
osDark: string;
|
|
82
82
|
osLight: string;
|
|
83
|
-
|
|
83
|
+
highContrast: string;
|
|
84
84
|
lessContrast: string;
|
|
85
85
|
moreContrast: string;
|
|
86
86
|
ltr: string;
|
|
@@ -364,7 +364,9 @@ declare const preset: {
|
|
|
364
364
|
transform(props: _pandacss_types_dist_pattern.Props<_pandacss_types_dist_pattern.PatternProperties>, { map }: _pandacss_types.PatternHelpers): {
|
|
365
365
|
gridColumn: any;
|
|
366
366
|
gridRow: any;
|
|
367
|
+
gridColumnStart: any;
|
|
367
368
|
gridColumnEnd: any;
|
|
369
|
+
gridRowStart: any;
|
|
368
370
|
gridRowEnd: any;
|
|
369
371
|
};
|
|
370
372
|
};
|
package/dist/index.js
CHANGED
|
@@ -53,8 +53,8 @@ var conditions = {
|
|
|
53
53
|
first: "&:first-child",
|
|
54
54
|
last: "&:last-child",
|
|
55
55
|
only: "&:only-child",
|
|
56
|
-
even: "&:even",
|
|
57
|
-
odd: "&:odd",
|
|
56
|
+
even: "&:nth-child(even)",
|
|
57
|
+
odd: "&:nth-child(odd)",
|
|
58
58
|
firstOfType: "&:first-of-type",
|
|
59
59
|
lastOfType: "&:last-of-type",
|
|
60
60
|
onlyOfType: "&:only-of-type",
|
|
@@ -104,7 +104,7 @@ var conditions = {
|
|
|
104
104
|
light: " &.light, .light &",
|
|
105
105
|
osDark: "@media (prefers-color-scheme: dark)",
|
|
106
106
|
osLight: "@media (prefers-color-scheme: light)",
|
|
107
|
-
|
|
107
|
+
highContrast: "@media (forced-colors: active)",
|
|
108
108
|
lessContrast: "@media (prefers-contrast: less)",
|
|
109
109
|
moreContrast: "@media (prefers-contrast: more)",
|
|
110
110
|
ltr: "[dir=ltr] &",
|
|
@@ -608,7 +608,7 @@ var effects = {
|
|
|
608
608
|
className: "contrast",
|
|
609
609
|
transform(value) {
|
|
610
610
|
return {
|
|
611
|
-
"--contrast": `
|
|
611
|
+
"--contrast": `contrast(${value})`
|
|
612
612
|
};
|
|
613
613
|
}
|
|
614
614
|
},
|
|
@@ -712,7 +712,7 @@ var effects = {
|
|
|
712
712
|
className: "backdrop-contrast",
|
|
713
713
|
transform(value) {
|
|
714
714
|
return {
|
|
715
|
-
"--backdrop-contrast": `
|
|
715
|
+
"--backdrop-contrast": `contrast(${value})`
|
|
716
716
|
};
|
|
717
717
|
}
|
|
718
718
|
},
|
|
@@ -840,7 +840,7 @@ var flexGrid = {
|
|
|
840
840
|
}
|
|
841
841
|
},
|
|
842
842
|
gridTemplateRows: {
|
|
843
|
-
className: "grid-
|
|
843
|
+
className: "grid-rows",
|
|
844
844
|
values: {
|
|
845
845
|
"1": "repeat(1, minmax(0, 1fr))",
|
|
846
846
|
"2": "repeat(2, minmax(0, 1fr))",
|
|
@@ -1250,7 +1250,8 @@ var layout = {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
},
|
|
1252
1252
|
zIndex: {
|
|
1253
|
-
className: "z"
|
|
1253
|
+
className: "z",
|
|
1254
|
+
values: "zIndex"
|
|
1254
1255
|
},
|
|
1255
1256
|
boxSizing: {
|
|
1256
1257
|
className: "box"
|
|
@@ -1687,6 +1688,19 @@ var tables = {
|
|
|
1687
1688
|
};
|
|
1688
1689
|
|
|
1689
1690
|
// src/utilities/transforms.ts
|
|
1691
|
+
var positiveFractions = {
|
|
1692
|
+
"1/2": "50%",
|
|
1693
|
+
"1/3": "33.333333%",
|
|
1694
|
+
"2/3": "66.666667%",
|
|
1695
|
+
"1/4": "25%",
|
|
1696
|
+
"2/4": "50%",
|
|
1697
|
+
"3/4": "75%",
|
|
1698
|
+
full: "100%"
|
|
1699
|
+
};
|
|
1700
|
+
var negativeFractions = Object.fromEntries(
|
|
1701
|
+
Object.entries(positiveFractions).map(([key, value]) => [`-${key}`, `-${value}`])
|
|
1702
|
+
);
|
|
1703
|
+
var fractions = { ...positiveFractions, ...negativeFractions };
|
|
1690
1704
|
var transforms = {
|
|
1691
1705
|
transformOrigin: {
|
|
1692
1706
|
className: "origin"
|
|
@@ -1727,13 +1741,7 @@ var transforms = {
|
|
|
1727
1741
|
values(theme) {
|
|
1728
1742
|
return {
|
|
1729
1743
|
...theme("spacing"),
|
|
1730
|
-
|
|
1731
|
-
"1/3": "33.333333%",
|
|
1732
|
-
"2/3": "66.666667%",
|
|
1733
|
-
"1/4": "25%",
|
|
1734
|
-
"2/4": "50%",
|
|
1735
|
-
"3/4": "75%",
|
|
1736
|
-
full: "100%"
|
|
1744
|
+
...fractions
|
|
1737
1745
|
};
|
|
1738
1746
|
},
|
|
1739
1747
|
transform(value) {
|
|
@@ -1748,13 +1756,7 @@ var transforms = {
|
|
|
1748
1756
|
values(theme) {
|
|
1749
1757
|
return {
|
|
1750
1758
|
...theme("spacing"),
|
|
1751
|
-
|
|
1752
|
-
"1/3": "33.333333%",
|
|
1753
|
-
"2/3": "66.666667%",
|
|
1754
|
-
"1/4": "25%",
|
|
1755
|
-
"2/4": "50%",
|
|
1756
|
-
"3/4": "75%",
|
|
1757
|
-
full: "100%"
|
|
1759
|
+
...fractions
|
|
1758
1760
|
};
|
|
1759
1761
|
},
|
|
1760
1762
|
transform(value) {
|
|
@@ -1766,10 +1768,32 @@ var transforms = {
|
|
|
1766
1768
|
};
|
|
1767
1769
|
|
|
1768
1770
|
// src/utilities/transitions.ts
|
|
1771
|
+
var createTransition = (value) => ({
|
|
1772
|
+
transitionProperty: `var(--transition-prop, ${value})`,
|
|
1773
|
+
transitionTimingFunction: "var(--transition-easing, cubic-bezier(0.4, 0, 0.2, 1))",
|
|
1774
|
+
transitionDuration: "var(--transition-duration, 150ms)"
|
|
1775
|
+
});
|
|
1776
|
+
var transitionMap = {
|
|
1777
|
+
all: createTransition("all"),
|
|
1778
|
+
common: createTransition(
|
|
1779
|
+
"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter"
|
|
1780
|
+
),
|
|
1781
|
+
background: createTransition("background, background-color"),
|
|
1782
|
+
colors: createTransition("color, background-color, border-color, outline-color, text-decoration-color, fill, stroke"),
|
|
1783
|
+
opacity: createTransition("opacity"),
|
|
1784
|
+
shadow: createTransition("box-shadow"),
|
|
1785
|
+
transform: createTransition("transform")
|
|
1786
|
+
};
|
|
1769
1787
|
var transitions = {
|
|
1770
1788
|
transitionTimingFunction: {
|
|
1771
1789
|
className: "ease",
|
|
1772
|
-
values: "easings"
|
|
1790
|
+
values: "easings",
|
|
1791
|
+
transform(value) {
|
|
1792
|
+
return {
|
|
1793
|
+
"--transition-easing": value,
|
|
1794
|
+
transitionTimingFunction: value
|
|
1795
|
+
};
|
|
1796
|
+
}
|
|
1773
1797
|
},
|
|
1774
1798
|
transitionDelay: {
|
|
1775
1799
|
className: "delay",
|
|
@@ -1777,19 +1801,28 @@ var transitions = {
|
|
|
1777
1801
|
},
|
|
1778
1802
|
transitionDuration: {
|
|
1779
1803
|
className: "duration",
|
|
1780
|
-
values: "durations"
|
|
1804
|
+
values: "durations",
|
|
1805
|
+
transform(value) {
|
|
1806
|
+
return {
|
|
1807
|
+
"--transition-duration": value,
|
|
1808
|
+
transitionDuration: value
|
|
1809
|
+
};
|
|
1810
|
+
}
|
|
1781
1811
|
},
|
|
1782
1812
|
transitionProperty: {
|
|
1813
|
+
className: "transition-prop",
|
|
1814
|
+
transform(value) {
|
|
1815
|
+
return {
|
|
1816
|
+
"--transition-prop": value,
|
|
1817
|
+
transitionProperty: value
|
|
1818
|
+
};
|
|
1819
|
+
}
|
|
1820
|
+
},
|
|
1821
|
+
transition: {
|
|
1783
1822
|
className: "transition",
|
|
1784
|
-
values:
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
opacity: "opacity",
|
|
1788
|
-
shadow: "box-shadow",
|
|
1789
|
-
transform: "transform",
|
|
1790
|
-
base: "color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",
|
|
1791
|
-
background: "background, background-color",
|
|
1792
|
-
colors: "color, background-color, border-color, outline-color, text-decoration-color, fill, stroke"
|
|
1823
|
+
values: Object.keys(transitionMap),
|
|
1824
|
+
transform(value) {
|
|
1825
|
+
return transitionMap[value] ?? { transition: value };
|
|
1793
1826
|
}
|
|
1794
1827
|
},
|
|
1795
1828
|
animation: {
|
|
@@ -2173,7 +2206,9 @@ var gridItem = definePattern({
|
|
|
2173
2206
|
return {
|
|
2174
2207
|
gridColumn: colSpan != null ? map(colSpan, spanFn) : void 0,
|
|
2175
2208
|
gridRow: rowSpan != null ? map(rowSpan, spanFn) : void 0,
|
|
2209
|
+
gridColumnStart: colStart,
|
|
2176
2210
|
gridColumnEnd: colEnd,
|
|
2211
|
+
gridRowStart: rowStart,
|
|
2177
2212
|
gridRowEnd: rowEnd,
|
|
2178
2213
|
...rest
|
|
2179
2214
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -26,8 +26,8 @@ var conditions = {
|
|
|
26
26
|
first: "&:first-child",
|
|
27
27
|
last: "&:last-child",
|
|
28
28
|
only: "&:only-child",
|
|
29
|
-
even: "&:even",
|
|
30
|
-
odd: "&:odd",
|
|
29
|
+
even: "&:nth-child(even)",
|
|
30
|
+
odd: "&:nth-child(odd)",
|
|
31
31
|
firstOfType: "&:first-of-type",
|
|
32
32
|
lastOfType: "&:last-of-type",
|
|
33
33
|
onlyOfType: "&:only-of-type",
|
|
@@ -77,7 +77,7 @@ var conditions = {
|
|
|
77
77
|
light: " &.light, .light &",
|
|
78
78
|
osDark: "@media (prefers-color-scheme: dark)",
|
|
79
79
|
osLight: "@media (prefers-color-scheme: light)",
|
|
80
|
-
|
|
80
|
+
highContrast: "@media (forced-colors: active)",
|
|
81
81
|
lessContrast: "@media (prefers-contrast: less)",
|
|
82
82
|
moreContrast: "@media (prefers-contrast: more)",
|
|
83
83
|
ltr: "[dir=ltr] &",
|
|
@@ -581,7 +581,7 @@ var effects = {
|
|
|
581
581
|
className: "contrast",
|
|
582
582
|
transform(value) {
|
|
583
583
|
return {
|
|
584
|
-
"--contrast": `
|
|
584
|
+
"--contrast": `contrast(${value})`
|
|
585
585
|
};
|
|
586
586
|
}
|
|
587
587
|
},
|
|
@@ -685,7 +685,7 @@ var effects = {
|
|
|
685
685
|
className: "backdrop-contrast",
|
|
686
686
|
transform(value) {
|
|
687
687
|
return {
|
|
688
|
-
"--backdrop-contrast": `
|
|
688
|
+
"--backdrop-contrast": `contrast(${value})`
|
|
689
689
|
};
|
|
690
690
|
}
|
|
691
691
|
},
|
|
@@ -813,7 +813,7 @@ var flexGrid = {
|
|
|
813
813
|
}
|
|
814
814
|
},
|
|
815
815
|
gridTemplateRows: {
|
|
816
|
-
className: "grid-
|
|
816
|
+
className: "grid-rows",
|
|
817
817
|
values: {
|
|
818
818
|
"1": "repeat(1, minmax(0, 1fr))",
|
|
819
819
|
"2": "repeat(2, minmax(0, 1fr))",
|
|
@@ -1223,7 +1223,8 @@ var layout = {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
},
|
|
1225
1225
|
zIndex: {
|
|
1226
|
-
className: "z"
|
|
1226
|
+
className: "z",
|
|
1227
|
+
values: "zIndex"
|
|
1227
1228
|
},
|
|
1228
1229
|
boxSizing: {
|
|
1229
1230
|
className: "box"
|
|
@@ -1660,6 +1661,19 @@ var tables = {
|
|
|
1660
1661
|
};
|
|
1661
1662
|
|
|
1662
1663
|
// src/utilities/transforms.ts
|
|
1664
|
+
var positiveFractions = {
|
|
1665
|
+
"1/2": "50%",
|
|
1666
|
+
"1/3": "33.333333%",
|
|
1667
|
+
"2/3": "66.666667%",
|
|
1668
|
+
"1/4": "25%",
|
|
1669
|
+
"2/4": "50%",
|
|
1670
|
+
"3/4": "75%",
|
|
1671
|
+
full: "100%"
|
|
1672
|
+
};
|
|
1673
|
+
var negativeFractions = Object.fromEntries(
|
|
1674
|
+
Object.entries(positiveFractions).map(([key, value]) => [`-${key}`, `-${value}`])
|
|
1675
|
+
);
|
|
1676
|
+
var fractions = { ...positiveFractions, ...negativeFractions };
|
|
1663
1677
|
var transforms = {
|
|
1664
1678
|
transformOrigin: {
|
|
1665
1679
|
className: "origin"
|
|
@@ -1700,13 +1714,7 @@ var transforms = {
|
|
|
1700
1714
|
values(theme) {
|
|
1701
1715
|
return {
|
|
1702
1716
|
...theme("spacing"),
|
|
1703
|
-
|
|
1704
|
-
"1/3": "33.333333%",
|
|
1705
|
-
"2/3": "66.666667%",
|
|
1706
|
-
"1/4": "25%",
|
|
1707
|
-
"2/4": "50%",
|
|
1708
|
-
"3/4": "75%",
|
|
1709
|
-
full: "100%"
|
|
1717
|
+
...fractions
|
|
1710
1718
|
};
|
|
1711
1719
|
},
|
|
1712
1720
|
transform(value) {
|
|
@@ -1721,13 +1729,7 @@ var transforms = {
|
|
|
1721
1729
|
values(theme) {
|
|
1722
1730
|
return {
|
|
1723
1731
|
...theme("spacing"),
|
|
1724
|
-
|
|
1725
|
-
"1/3": "33.333333%",
|
|
1726
|
-
"2/3": "66.666667%",
|
|
1727
|
-
"1/4": "25%",
|
|
1728
|
-
"2/4": "50%",
|
|
1729
|
-
"3/4": "75%",
|
|
1730
|
-
full: "100%"
|
|
1732
|
+
...fractions
|
|
1731
1733
|
};
|
|
1732
1734
|
},
|
|
1733
1735
|
transform(value) {
|
|
@@ -1739,10 +1741,32 @@ var transforms = {
|
|
|
1739
1741
|
};
|
|
1740
1742
|
|
|
1741
1743
|
// src/utilities/transitions.ts
|
|
1744
|
+
var createTransition = (value) => ({
|
|
1745
|
+
transitionProperty: `var(--transition-prop, ${value})`,
|
|
1746
|
+
transitionTimingFunction: "var(--transition-easing, cubic-bezier(0.4, 0, 0.2, 1))",
|
|
1747
|
+
transitionDuration: "var(--transition-duration, 150ms)"
|
|
1748
|
+
});
|
|
1749
|
+
var transitionMap = {
|
|
1750
|
+
all: createTransition("all"),
|
|
1751
|
+
common: createTransition(
|
|
1752
|
+
"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter"
|
|
1753
|
+
),
|
|
1754
|
+
background: createTransition("background, background-color"),
|
|
1755
|
+
colors: createTransition("color, background-color, border-color, outline-color, text-decoration-color, fill, stroke"),
|
|
1756
|
+
opacity: createTransition("opacity"),
|
|
1757
|
+
shadow: createTransition("box-shadow"),
|
|
1758
|
+
transform: createTransition("transform")
|
|
1759
|
+
};
|
|
1742
1760
|
var transitions = {
|
|
1743
1761
|
transitionTimingFunction: {
|
|
1744
1762
|
className: "ease",
|
|
1745
|
-
values: "easings"
|
|
1763
|
+
values: "easings",
|
|
1764
|
+
transform(value) {
|
|
1765
|
+
return {
|
|
1766
|
+
"--transition-easing": value,
|
|
1767
|
+
transitionTimingFunction: value
|
|
1768
|
+
};
|
|
1769
|
+
}
|
|
1746
1770
|
},
|
|
1747
1771
|
transitionDelay: {
|
|
1748
1772
|
className: "delay",
|
|
@@ -1750,19 +1774,28 @@ var transitions = {
|
|
|
1750
1774
|
},
|
|
1751
1775
|
transitionDuration: {
|
|
1752
1776
|
className: "duration",
|
|
1753
|
-
values: "durations"
|
|
1777
|
+
values: "durations",
|
|
1778
|
+
transform(value) {
|
|
1779
|
+
return {
|
|
1780
|
+
"--transition-duration": value,
|
|
1781
|
+
transitionDuration: value
|
|
1782
|
+
};
|
|
1783
|
+
}
|
|
1754
1784
|
},
|
|
1755
1785
|
transitionProperty: {
|
|
1786
|
+
className: "transition-prop",
|
|
1787
|
+
transform(value) {
|
|
1788
|
+
return {
|
|
1789
|
+
"--transition-prop": value,
|
|
1790
|
+
transitionProperty: value
|
|
1791
|
+
};
|
|
1792
|
+
}
|
|
1793
|
+
},
|
|
1794
|
+
transition: {
|
|
1756
1795
|
className: "transition",
|
|
1757
|
-
values:
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
opacity: "opacity",
|
|
1761
|
-
shadow: "box-shadow",
|
|
1762
|
-
transform: "transform",
|
|
1763
|
-
base: "color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",
|
|
1764
|
-
background: "background, background-color",
|
|
1765
|
-
colors: "color, background-color, border-color, outline-color, text-decoration-color, fill, stroke"
|
|
1796
|
+
values: Object.keys(transitionMap),
|
|
1797
|
+
transform(value) {
|
|
1798
|
+
return transitionMap[value] ?? { transition: value };
|
|
1766
1799
|
}
|
|
1767
1800
|
},
|
|
1768
1801
|
animation: {
|
|
@@ -2146,7 +2179,9 @@ var gridItem = definePattern({
|
|
|
2146
2179
|
return {
|
|
2147
2180
|
gridColumn: colSpan != null ? map(colSpan, spanFn) : void 0,
|
|
2148
2181
|
gridRow: rowSpan != null ? map(rowSpan, spanFn) : void 0,
|
|
2182
|
+
gridColumnStart: colStart,
|
|
2149
2183
|
gridColumnEnd: colEnd,
|
|
2184
|
+
gridRowStart: rowStart,
|
|
2150
2185
|
gridRowEnd: rowEnd,
|
|
2151
2186
|
...rest
|
|
2152
2187
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/preset-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "The base preset for Panda CSS that contains the conditions and utilities",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pandacss/types": "0.
|
|
17
|
+
"@pandacss/types": "0.7.0"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "tsup src/index.ts --format=esm,cjs --dts",
|