@kbach/react 0.3.19 → 0.4.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/{chunk-AW3HK2B4.mjs → chunk-HY6PU2XS.mjs} +135 -4
- package/dist/{chunk-NM6ISARQ.mjs → chunk-V5WMKNJC.mjs} +9 -3
- package/dist/index.js +135 -4
- package/dist/index.mjs +1 -1
- package/dist/jsx-dev-runtime.js +143 -6
- package/dist/jsx-dev-runtime.mjs +2 -2
- package/dist/jsx-runtime.js +143 -6
- package/dist/jsx-runtime.mjs +2 -2
- package/package.json +1 -1
|
@@ -728,6 +728,18 @@ var UTILITY_PREFIXES = [
|
|
|
728
728
|
"bg-opacity",
|
|
729
729
|
"text-opacity",
|
|
730
730
|
"border-opacity",
|
|
731
|
+
// Grid placement (longer prefixes before shorter ones)
|
|
732
|
+
"col-span",
|
|
733
|
+
"col-start",
|
|
734
|
+
"col-end",
|
|
735
|
+
"row-span",
|
|
736
|
+
"row-start",
|
|
737
|
+
"row-end",
|
|
738
|
+
"grid-cols",
|
|
739
|
+
"grid-rows",
|
|
740
|
+
"grid-flow",
|
|
741
|
+
"auto-cols",
|
|
742
|
+
"auto-rows",
|
|
731
743
|
// Single-word prefixes last
|
|
732
744
|
"appearance-none",
|
|
733
745
|
"outline-none",
|
|
@@ -1534,13 +1546,125 @@ var RESOLVERS = {
|
|
|
1534
1546
|
const r = resolveRadius(value, borderRadius, isArbitrary);
|
|
1535
1547
|
return r !== null ? { borderBottomRightRadius: r } : null;
|
|
1536
1548
|
},
|
|
1537
|
-
// ── Grid (responsive column count: grid-1 … grid-12)
|
|
1538
|
-
grid: ({ value }) => {
|
|
1549
|
+
// ── Grid (responsive column count: grid-1 … grid-12, or arbitrary) ───────
|
|
1550
|
+
grid: ({ value, isArbitrary }) => {
|
|
1539
1551
|
if (!value) return null;
|
|
1552
|
+
if (isArbitrary) return { display: "grid", gridTemplateColumns: value };
|
|
1540
1553
|
const n = parseInt(value, 10);
|
|
1541
1554
|
if (isNaN(n) || n < 1 || n > 12) return null;
|
|
1542
1555
|
return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
|
|
1543
1556
|
},
|
|
1557
|
+
// ── Grid template columns/rows (Tailwind-style aliases, web-only) ──────────
|
|
1558
|
+
"grid-cols": ({ value, isArbitrary }) => {
|
|
1559
|
+
if (!isWeb) return null;
|
|
1560
|
+
if (!value) return null;
|
|
1561
|
+
if (isArbitrary) return { display: "grid", gridTemplateColumns: value };
|
|
1562
|
+
if (value === "none") return { display: "grid", gridTemplateColumns: "none" };
|
|
1563
|
+
const n = parseInt(value, 10);
|
|
1564
|
+
if (isNaN(n) || n < 1 || n > 12) return null;
|
|
1565
|
+
return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
|
|
1566
|
+
},
|
|
1567
|
+
"grid-rows": ({ value, isArbitrary }) => {
|
|
1568
|
+
if (!isWeb) return null;
|
|
1569
|
+
if (!value) return null;
|
|
1570
|
+
if (isArbitrary) return { gridTemplateRows: value };
|
|
1571
|
+
if (value === "none") return { gridTemplateRows: "none" };
|
|
1572
|
+
const n = parseInt(value, 10);
|
|
1573
|
+
if (isNaN(n) || n < 1) return null;
|
|
1574
|
+
return { gridTemplateRows: `repeat(${n}, minmax(0, 1fr))` };
|
|
1575
|
+
},
|
|
1576
|
+
// ── Grid auto flow (web-only) ─────────────────────────────────────────────
|
|
1577
|
+
"grid-flow": ({ value }) => {
|
|
1578
|
+
if (!isWeb) return null;
|
|
1579
|
+
const flows = {
|
|
1580
|
+
row: "row",
|
|
1581
|
+
col: "column",
|
|
1582
|
+
dense: "dense",
|
|
1583
|
+
"row-dense": "row dense",
|
|
1584
|
+
"col-dense": "column dense"
|
|
1585
|
+
};
|
|
1586
|
+
const flow = flows[value];
|
|
1587
|
+
return flow ? { gridAutoFlow: flow } : null;
|
|
1588
|
+
},
|
|
1589
|
+
// ── Grid auto sizing (web-only) ───────────────────────────────────────────
|
|
1590
|
+
"auto-cols": ({ value, isArbitrary }) => {
|
|
1591
|
+
if (!isWeb) return null;
|
|
1592
|
+
if (isArbitrary) return { gridAutoColumns: value };
|
|
1593
|
+
const presets = {
|
|
1594
|
+
auto: "auto",
|
|
1595
|
+
min: "min-content",
|
|
1596
|
+
max: "max-content",
|
|
1597
|
+
fr: "minmax(0, 1fr)"
|
|
1598
|
+
};
|
|
1599
|
+
const v = presets[value];
|
|
1600
|
+
return v ? { gridAutoColumns: v } : null;
|
|
1601
|
+
},
|
|
1602
|
+
"auto-rows": ({ value, isArbitrary }) => {
|
|
1603
|
+
if (!isWeb) return null;
|
|
1604
|
+
if (isArbitrary) return { gridAutoRows: value };
|
|
1605
|
+
const presets = {
|
|
1606
|
+
auto: "auto",
|
|
1607
|
+
min: "min-content",
|
|
1608
|
+
max: "max-content",
|
|
1609
|
+
fr: "minmax(0, 1fr)"
|
|
1610
|
+
};
|
|
1611
|
+
const v = presets[value];
|
|
1612
|
+
return v ? { gridAutoRows: v } : null;
|
|
1613
|
+
},
|
|
1614
|
+
// ── Grid column placement (web-only) ──────────────────────────────────────
|
|
1615
|
+
"col-span": ({ value }) => {
|
|
1616
|
+
if (!isWeb) return null;
|
|
1617
|
+
if (value === "full") return { gridColumn: "1 / -1" };
|
|
1618
|
+
const n = parseInt(value, 10);
|
|
1619
|
+
return isNaN(n) ? null : { gridColumn: `span ${n} / span ${n}` };
|
|
1620
|
+
},
|
|
1621
|
+
"col-start": ({ value, isArbitrary }) => {
|
|
1622
|
+
if (!isWeb) return null;
|
|
1623
|
+
if (value === "auto") return { gridColumnStart: "auto" };
|
|
1624
|
+
if (isArbitrary) return { gridColumnStart: value };
|
|
1625
|
+
const n = parseInt(value, 10);
|
|
1626
|
+
return isNaN(n) ? null : { gridColumnStart: n };
|
|
1627
|
+
},
|
|
1628
|
+
"col-end": ({ value, isArbitrary }) => {
|
|
1629
|
+
if (!isWeb) return null;
|
|
1630
|
+
if (value === "auto") return { gridColumnEnd: "auto" };
|
|
1631
|
+
if (isArbitrary) return { gridColumnEnd: value };
|
|
1632
|
+
const n = parseInt(value, 10);
|
|
1633
|
+
return isNaN(n) ? null : { gridColumnEnd: n };
|
|
1634
|
+
},
|
|
1635
|
+
col: ({ value, isArbitrary }) => {
|
|
1636
|
+
if (!isWeb) return null;
|
|
1637
|
+
if (!value || value === "auto") return { gridColumn: "auto" };
|
|
1638
|
+
if (isArbitrary) return { gridColumn: value };
|
|
1639
|
+
return null;
|
|
1640
|
+
},
|
|
1641
|
+
// ── Grid row placement (web-only) ─────────────────────────────────────────
|
|
1642
|
+
"row-span": ({ value }) => {
|
|
1643
|
+
if (!isWeb) return null;
|
|
1644
|
+
if (value === "full") return { gridRow: "1 / -1" };
|
|
1645
|
+
const n = parseInt(value, 10);
|
|
1646
|
+
return isNaN(n) ? null : { gridRow: `span ${n} / span ${n}` };
|
|
1647
|
+
},
|
|
1648
|
+
"row-start": ({ value, isArbitrary }) => {
|
|
1649
|
+
if (!isWeb) return null;
|
|
1650
|
+
if (value === "auto") return { gridRowStart: "auto" };
|
|
1651
|
+
if (isArbitrary) return { gridRowStart: value };
|
|
1652
|
+
const n = parseInt(value, 10);
|
|
1653
|
+
return isNaN(n) ? null : { gridRowStart: n };
|
|
1654
|
+
},
|
|
1655
|
+
"row-end": ({ value, isArbitrary }) => {
|
|
1656
|
+
if (!isWeb) return null;
|
|
1657
|
+
if (value === "auto") return { gridRowEnd: "auto" };
|
|
1658
|
+
if (isArbitrary) return { gridRowEnd: value };
|
|
1659
|
+
const n = parseInt(value, 10);
|
|
1660
|
+
return isNaN(n) ? null : { gridRowEnd: n };
|
|
1661
|
+
},
|
|
1662
|
+
row: ({ value, isArbitrary }) => {
|
|
1663
|
+
if (!isWeb) return null;
|
|
1664
|
+
if (!value || value === "auto") return { gridRow: "auto" };
|
|
1665
|
+
if (isArbitrary) return { gridRow: value };
|
|
1666
|
+
return null;
|
|
1667
|
+
},
|
|
1544
1668
|
// ── Flex ───────────────────────────────────────────────────────────────────
|
|
1545
1669
|
flex: ({ value, isArbitrary }, { flex }) => {
|
|
1546
1670
|
if (!value) return { display: "flex" };
|
|
@@ -2019,7 +2143,11 @@ var CSS_UNITLESS = /* @__PURE__ */ new Set([
|
|
|
2019
2143
|
"zIndex",
|
|
2020
2144
|
"aspectRatio",
|
|
2021
2145
|
"columnCount",
|
|
2022
|
-
"lineHeight"
|
|
2146
|
+
"lineHeight",
|
|
2147
|
+
"gridColumnStart",
|
|
2148
|
+
"gridColumnEnd",
|
|
2149
|
+
"gridRowStart",
|
|
2150
|
+
"gridRowEnd"
|
|
2023
2151
|
]);
|
|
2024
2152
|
function styleValueToCSS(styles) {
|
|
2025
2153
|
return Object.entries(styles).filter(
|
|
@@ -2032,7 +2160,7 @@ function styleValueToCSS(styles) {
|
|
|
2032
2160
|
} else {
|
|
2033
2161
|
cssVal = String(val);
|
|
2034
2162
|
}
|
|
2035
|
-
const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") ? " !important" : "";
|
|
2163
|
+
const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") || prop === "position" && (cssVal === "sticky" || cssVal === "fixed" || cssVal === "static") ? " !important" : "";
|
|
2036
2164
|
return `${cssProp}: ${cssVal}${important}`;
|
|
2037
2165
|
}).join("; ");
|
|
2038
2166
|
}
|
|
@@ -2434,6 +2562,9 @@ var InteractiveWrapper = forwardRef(
|
|
|
2434
2562
|
delete s.gridAutoFlow;
|
|
2435
2563
|
delete s.gridAutoColumns;
|
|
2436
2564
|
delete s.gridAutoRows;
|
|
2565
|
+
if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
|
|
2566
|
+
delete s.position;
|
|
2567
|
+
}
|
|
2437
2568
|
}
|
|
2438
2569
|
return s;
|
|
2439
2570
|
},
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
resolve,
|
|
9
9
|
useConditionalWidth,
|
|
10
10
|
useGlobalDarkMode
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HY6PU2XS.mjs";
|
|
12
12
|
|
|
13
13
|
// src/jsx-runtime.tsx
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs, Fragment } from "react/jsx-runtime";
|
|
@@ -32,14 +32,14 @@ var DarkWrapper = React.forwardRef(
|
|
|
32
32
|
const width = useConditionalWidth(needsWidth);
|
|
33
33
|
const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
|
|
34
34
|
const computedStyle = flatten(resolvedStyle, isDark, {}, breakpoints);
|
|
35
|
-
if (typeof Component !== "string")
|
|
35
|
+
if (typeof Component !== "string") stripWebOnlyProps(computedStyle);
|
|
36
36
|
const finalStyle = styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
|
|
37
37
|
const props = { ref, ...rest, style: finalStyle };
|
|
38
38
|
return Array.isArray(children) ? React.createElement(Component, props, ...children) : React.createElement(Component, props, children);
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
DarkWrapper.displayName = "Kbach.DarkWrapper";
|
|
42
|
-
function
|
|
42
|
+
function stripWebOnlyProps(s) {
|
|
43
43
|
if (s.display === "grid" || s.display === "inline-grid") delete s.display;
|
|
44
44
|
delete s.gridTemplateColumns;
|
|
45
45
|
delete s.gridTemplateRows;
|
|
@@ -49,6 +49,9 @@ function stripWebGridProps(s) {
|
|
|
49
49
|
delete s.gridAutoFlow;
|
|
50
50
|
delete s.gridAutoColumns;
|
|
51
51
|
delete s.gridAutoRows;
|
|
52
|
+
if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
|
|
53
|
+
delete s.position;
|
|
54
|
+
}
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
// src/jsx-runtime.tsx
|
|
@@ -161,6 +164,9 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
161
164
|
delete computedStyle.gridAutoFlow;
|
|
162
165
|
delete computedStyle.gridAutoColumns;
|
|
163
166
|
delete computedStyle.gridAutoRows;
|
|
167
|
+
if (computedStyle.position === "sticky" || computedStyle.position === "fixed" || computedStyle.position === "static") {
|
|
168
|
+
delete computedStyle.position;
|
|
169
|
+
}
|
|
164
170
|
}
|
|
165
171
|
const finalStyle = mergeStyle(computedStyle, userStyle);
|
|
166
172
|
return makeElement(isStaticChildren, actualType, {
|
package/dist/index.js
CHANGED
|
@@ -894,6 +894,18 @@ var UTILITY_PREFIXES = [
|
|
|
894
894
|
"bg-opacity",
|
|
895
895
|
"text-opacity",
|
|
896
896
|
"border-opacity",
|
|
897
|
+
// Grid placement (longer prefixes before shorter ones)
|
|
898
|
+
"col-span",
|
|
899
|
+
"col-start",
|
|
900
|
+
"col-end",
|
|
901
|
+
"row-span",
|
|
902
|
+
"row-start",
|
|
903
|
+
"row-end",
|
|
904
|
+
"grid-cols",
|
|
905
|
+
"grid-rows",
|
|
906
|
+
"grid-flow",
|
|
907
|
+
"auto-cols",
|
|
908
|
+
"auto-rows",
|
|
897
909
|
// Single-word prefixes last
|
|
898
910
|
"appearance-none",
|
|
899
911
|
"outline-none",
|
|
@@ -1700,13 +1712,125 @@ var RESOLVERS = {
|
|
|
1700
1712
|
const r = resolveRadius(value, borderRadius, isArbitrary);
|
|
1701
1713
|
return r !== null ? { borderBottomRightRadius: r } : null;
|
|
1702
1714
|
},
|
|
1703
|
-
// ── Grid (responsive column count: grid-1 … grid-12)
|
|
1704
|
-
grid: ({ value }) => {
|
|
1715
|
+
// ── Grid (responsive column count: grid-1 … grid-12, or arbitrary) ───────
|
|
1716
|
+
grid: ({ value, isArbitrary }) => {
|
|
1705
1717
|
if (!value) return null;
|
|
1718
|
+
if (isArbitrary) return { display: "grid", gridTemplateColumns: value };
|
|
1706
1719
|
const n = parseInt(value, 10);
|
|
1707
1720
|
if (isNaN(n) || n < 1 || n > 12) return null;
|
|
1708
1721
|
return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
|
|
1709
1722
|
},
|
|
1723
|
+
// ── Grid template columns/rows (Tailwind-style aliases, web-only) ──────────
|
|
1724
|
+
"grid-cols": ({ value, isArbitrary }) => {
|
|
1725
|
+
if (!isWeb) return null;
|
|
1726
|
+
if (!value) return null;
|
|
1727
|
+
if (isArbitrary) return { display: "grid", gridTemplateColumns: value };
|
|
1728
|
+
if (value === "none") return { display: "grid", gridTemplateColumns: "none" };
|
|
1729
|
+
const n = parseInt(value, 10);
|
|
1730
|
+
if (isNaN(n) || n < 1 || n > 12) return null;
|
|
1731
|
+
return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
|
|
1732
|
+
},
|
|
1733
|
+
"grid-rows": ({ value, isArbitrary }) => {
|
|
1734
|
+
if (!isWeb) return null;
|
|
1735
|
+
if (!value) return null;
|
|
1736
|
+
if (isArbitrary) return { gridTemplateRows: value };
|
|
1737
|
+
if (value === "none") return { gridTemplateRows: "none" };
|
|
1738
|
+
const n = parseInt(value, 10);
|
|
1739
|
+
if (isNaN(n) || n < 1) return null;
|
|
1740
|
+
return { gridTemplateRows: `repeat(${n}, minmax(0, 1fr))` };
|
|
1741
|
+
},
|
|
1742
|
+
// ── Grid auto flow (web-only) ─────────────────────────────────────────────
|
|
1743
|
+
"grid-flow": ({ value }) => {
|
|
1744
|
+
if (!isWeb) return null;
|
|
1745
|
+
const flows = {
|
|
1746
|
+
row: "row",
|
|
1747
|
+
col: "column",
|
|
1748
|
+
dense: "dense",
|
|
1749
|
+
"row-dense": "row dense",
|
|
1750
|
+
"col-dense": "column dense"
|
|
1751
|
+
};
|
|
1752
|
+
const flow = flows[value];
|
|
1753
|
+
return flow ? { gridAutoFlow: flow } : null;
|
|
1754
|
+
},
|
|
1755
|
+
// ── Grid auto sizing (web-only) ───────────────────────────────────────────
|
|
1756
|
+
"auto-cols": ({ value, isArbitrary }) => {
|
|
1757
|
+
if (!isWeb) return null;
|
|
1758
|
+
if (isArbitrary) return { gridAutoColumns: value };
|
|
1759
|
+
const presets = {
|
|
1760
|
+
auto: "auto",
|
|
1761
|
+
min: "min-content",
|
|
1762
|
+
max: "max-content",
|
|
1763
|
+
fr: "minmax(0, 1fr)"
|
|
1764
|
+
};
|
|
1765
|
+
const v = presets[value];
|
|
1766
|
+
return v ? { gridAutoColumns: v } : null;
|
|
1767
|
+
},
|
|
1768
|
+
"auto-rows": ({ value, isArbitrary }) => {
|
|
1769
|
+
if (!isWeb) return null;
|
|
1770
|
+
if (isArbitrary) return { gridAutoRows: value };
|
|
1771
|
+
const presets = {
|
|
1772
|
+
auto: "auto",
|
|
1773
|
+
min: "min-content",
|
|
1774
|
+
max: "max-content",
|
|
1775
|
+
fr: "minmax(0, 1fr)"
|
|
1776
|
+
};
|
|
1777
|
+
const v = presets[value];
|
|
1778
|
+
return v ? { gridAutoRows: v } : null;
|
|
1779
|
+
},
|
|
1780
|
+
// ── Grid column placement (web-only) ──────────────────────────────────────
|
|
1781
|
+
"col-span": ({ value }) => {
|
|
1782
|
+
if (!isWeb) return null;
|
|
1783
|
+
if (value === "full") return { gridColumn: "1 / -1" };
|
|
1784
|
+
const n = parseInt(value, 10);
|
|
1785
|
+
return isNaN(n) ? null : { gridColumn: `span ${n} / span ${n}` };
|
|
1786
|
+
},
|
|
1787
|
+
"col-start": ({ value, isArbitrary }) => {
|
|
1788
|
+
if (!isWeb) return null;
|
|
1789
|
+
if (value === "auto") return { gridColumnStart: "auto" };
|
|
1790
|
+
if (isArbitrary) return { gridColumnStart: value };
|
|
1791
|
+
const n = parseInt(value, 10);
|
|
1792
|
+
return isNaN(n) ? null : { gridColumnStart: n };
|
|
1793
|
+
},
|
|
1794
|
+
"col-end": ({ value, isArbitrary }) => {
|
|
1795
|
+
if (!isWeb) return null;
|
|
1796
|
+
if (value === "auto") return { gridColumnEnd: "auto" };
|
|
1797
|
+
if (isArbitrary) return { gridColumnEnd: value };
|
|
1798
|
+
const n = parseInt(value, 10);
|
|
1799
|
+
return isNaN(n) ? null : { gridColumnEnd: n };
|
|
1800
|
+
},
|
|
1801
|
+
col: ({ value, isArbitrary }) => {
|
|
1802
|
+
if (!isWeb) return null;
|
|
1803
|
+
if (!value || value === "auto") return { gridColumn: "auto" };
|
|
1804
|
+
if (isArbitrary) return { gridColumn: value };
|
|
1805
|
+
return null;
|
|
1806
|
+
},
|
|
1807
|
+
// ── Grid row placement (web-only) ─────────────────────────────────────────
|
|
1808
|
+
"row-span": ({ value }) => {
|
|
1809
|
+
if (!isWeb) return null;
|
|
1810
|
+
if (value === "full") return { gridRow: "1 / -1" };
|
|
1811
|
+
const n = parseInt(value, 10);
|
|
1812
|
+
return isNaN(n) ? null : { gridRow: `span ${n} / span ${n}` };
|
|
1813
|
+
},
|
|
1814
|
+
"row-start": ({ value, isArbitrary }) => {
|
|
1815
|
+
if (!isWeb) return null;
|
|
1816
|
+
if (value === "auto") return { gridRowStart: "auto" };
|
|
1817
|
+
if (isArbitrary) return { gridRowStart: value };
|
|
1818
|
+
const n = parseInt(value, 10);
|
|
1819
|
+
return isNaN(n) ? null : { gridRowStart: n };
|
|
1820
|
+
},
|
|
1821
|
+
"row-end": ({ value, isArbitrary }) => {
|
|
1822
|
+
if (!isWeb) return null;
|
|
1823
|
+
if (value === "auto") return { gridRowEnd: "auto" };
|
|
1824
|
+
if (isArbitrary) return { gridRowEnd: value };
|
|
1825
|
+
const n = parseInt(value, 10);
|
|
1826
|
+
return isNaN(n) ? null : { gridRowEnd: n };
|
|
1827
|
+
},
|
|
1828
|
+
row: ({ value, isArbitrary }) => {
|
|
1829
|
+
if (!isWeb) return null;
|
|
1830
|
+
if (!value || value === "auto") return { gridRow: "auto" };
|
|
1831
|
+
if (isArbitrary) return { gridRow: value };
|
|
1832
|
+
return null;
|
|
1833
|
+
},
|
|
1710
1834
|
// ── Flex ───────────────────────────────────────────────────────────────────
|
|
1711
1835
|
flex: ({ value, isArbitrary }, { flex }) => {
|
|
1712
1836
|
if (!value) return { display: "flex" };
|
|
@@ -2149,7 +2273,11 @@ var CSS_UNITLESS = /* @__PURE__ */ new Set([
|
|
|
2149
2273
|
"zIndex",
|
|
2150
2274
|
"aspectRatio",
|
|
2151
2275
|
"columnCount",
|
|
2152
|
-
"lineHeight"
|
|
2276
|
+
"lineHeight",
|
|
2277
|
+
"gridColumnStart",
|
|
2278
|
+
"gridColumnEnd",
|
|
2279
|
+
"gridRowStart",
|
|
2280
|
+
"gridRowEnd"
|
|
2153
2281
|
]);
|
|
2154
2282
|
function styleValueToCSS(styles) {
|
|
2155
2283
|
return Object.entries(styles).filter(
|
|
@@ -2162,7 +2290,7 @@ function styleValueToCSS(styles) {
|
|
|
2162
2290
|
} else {
|
|
2163
2291
|
cssVal = String(val);
|
|
2164
2292
|
}
|
|
2165
|
-
const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") ? " !important" : "";
|
|
2293
|
+
const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") || prop === "position" && (cssVal === "sticky" || cssVal === "fixed" || cssVal === "static") ? " !important" : "";
|
|
2166
2294
|
return `${cssProp}: ${cssVal}${important}`;
|
|
2167
2295
|
}).join("; ");
|
|
2168
2296
|
}
|
|
@@ -2938,6 +3066,9 @@ var InteractiveWrapper = (0, import_react9.forwardRef)(
|
|
|
2938
3066
|
delete s.gridAutoFlow;
|
|
2939
3067
|
delete s.gridAutoColumns;
|
|
2940
3068
|
delete s.gridAutoRows;
|
|
3069
|
+
if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
|
|
3070
|
+
delete s.position;
|
|
3071
|
+
}
|
|
2941
3072
|
}
|
|
2942
3073
|
return s;
|
|
2943
3074
|
},
|
package/dist/index.mjs
CHANGED
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -797,6 +797,18 @@ var UTILITY_PREFIXES = [
|
|
|
797
797
|
"bg-opacity",
|
|
798
798
|
"text-opacity",
|
|
799
799
|
"border-opacity",
|
|
800
|
+
// Grid placement (longer prefixes before shorter ones)
|
|
801
|
+
"col-span",
|
|
802
|
+
"col-start",
|
|
803
|
+
"col-end",
|
|
804
|
+
"row-span",
|
|
805
|
+
"row-start",
|
|
806
|
+
"row-end",
|
|
807
|
+
"grid-cols",
|
|
808
|
+
"grid-rows",
|
|
809
|
+
"grid-flow",
|
|
810
|
+
"auto-cols",
|
|
811
|
+
"auto-rows",
|
|
800
812
|
// Single-word prefixes last
|
|
801
813
|
"appearance-none",
|
|
802
814
|
"outline-none",
|
|
@@ -1603,13 +1615,125 @@ var RESOLVERS = {
|
|
|
1603
1615
|
const r = resolveRadius(value, borderRadius, isArbitrary);
|
|
1604
1616
|
return r !== null ? { borderBottomRightRadius: r } : null;
|
|
1605
1617
|
},
|
|
1606
|
-
// ── Grid (responsive column count: grid-1 … grid-12)
|
|
1607
|
-
grid: ({ value }) => {
|
|
1618
|
+
// ── Grid (responsive column count: grid-1 … grid-12, or arbitrary) ───────
|
|
1619
|
+
grid: ({ value, isArbitrary }) => {
|
|
1608
1620
|
if (!value) return null;
|
|
1621
|
+
if (isArbitrary) return { display: "grid", gridTemplateColumns: value };
|
|
1609
1622
|
const n = parseInt(value, 10);
|
|
1610
1623
|
if (isNaN(n) || n < 1 || n > 12) return null;
|
|
1611
1624
|
return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
|
|
1612
1625
|
},
|
|
1626
|
+
// ── Grid template columns/rows (Tailwind-style aliases, web-only) ──────────
|
|
1627
|
+
"grid-cols": ({ value, isArbitrary }) => {
|
|
1628
|
+
if (!isWeb) return null;
|
|
1629
|
+
if (!value) return null;
|
|
1630
|
+
if (isArbitrary) return { display: "grid", gridTemplateColumns: value };
|
|
1631
|
+
if (value === "none") return { display: "grid", gridTemplateColumns: "none" };
|
|
1632
|
+
const n = parseInt(value, 10);
|
|
1633
|
+
if (isNaN(n) || n < 1 || n > 12) return null;
|
|
1634
|
+
return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
|
|
1635
|
+
},
|
|
1636
|
+
"grid-rows": ({ value, isArbitrary }) => {
|
|
1637
|
+
if (!isWeb) return null;
|
|
1638
|
+
if (!value) return null;
|
|
1639
|
+
if (isArbitrary) return { gridTemplateRows: value };
|
|
1640
|
+
if (value === "none") return { gridTemplateRows: "none" };
|
|
1641
|
+
const n = parseInt(value, 10);
|
|
1642
|
+
if (isNaN(n) || n < 1) return null;
|
|
1643
|
+
return { gridTemplateRows: `repeat(${n}, minmax(0, 1fr))` };
|
|
1644
|
+
},
|
|
1645
|
+
// ── Grid auto flow (web-only) ─────────────────────────────────────────────
|
|
1646
|
+
"grid-flow": ({ value }) => {
|
|
1647
|
+
if (!isWeb) return null;
|
|
1648
|
+
const flows = {
|
|
1649
|
+
row: "row",
|
|
1650
|
+
col: "column",
|
|
1651
|
+
dense: "dense",
|
|
1652
|
+
"row-dense": "row dense",
|
|
1653
|
+
"col-dense": "column dense"
|
|
1654
|
+
};
|
|
1655
|
+
const flow = flows[value];
|
|
1656
|
+
return flow ? { gridAutoFlow: flow } : null;
|
|
1657
|
+
},
|
|
1658
|
+
// ── Grid auto sizing (web-only) ───────────────────────────────────────────
|
|
1659
|
+
"auto-cols": ({ value, isArbitrary }) => {
|
|
1660
|
+
if (!isWeb) return null;
|
|
1661
|
+
if (isArbitrary) return { gridAutoColumns: value };
|
|
1662
|
+
const presets = {
|
|
1663
|
+
auto: "auto",
|
|
1664
|
+
min: "min-content",
|
|
1665
|
+
max: "max-content",
|
|
1666
|
+
fr: "minmax(0, 1fr)"
|
|
1667
|
+
};
|
|
1668
|
+
const v = presets[value];
|
|
1669
|
+
return v ? { gridAutoColumns: v } : null;
|
|
1670
|
+
},
|
|
1671
|
+
"auto-rows": ({ value, isArbitrary }) => {
|
|
1672
|
+
if (!isWeb) return null;
|
|
1673
|
+
if (isArbitrary) return { gridAutoRows: value };
|
|
1674
|
+
const presets = {
|
|
1675
|
+
auto: "auto",
|
|
1676
|
+
min: "min-content",
|
|
1677
|
+
max: "max-content",
|
|
1678
|
+
fr: "minmax(0, 1fr)"
|
|
1679
|
+
};
|
|
1680
|
+
const v = presets[value];
|
|
1681
|
+
return v ? { gridAutoRows: v } : null;
|
|
1682
|
+
},
|
|
1683
|
+
// ── Grid column placement (web-only) ──────────────────────────────────────
|
|
1684
|
+
"col-span": ({ value }) => {
|
|
1685
|
+
if (!isWeb) return null;
|
|
1686
|
+
if (value === "full") return { gridColumn: "1 / -1" };
|
|
1687
|
+
const n = parseInt(value, 10);
|
|
1688
|
+
return isNaN(n) ? null : { gridColumn: `span ${n} / span ${n}` };
|
|
1689
|
+
},
|
|
1690
|
+
"col-start": ({ value, isArbitrary }) => {
|
|
1691
|
+
if (!isWeb) return null;
|
|
1692
|
+
if (value === "auto") return { gridColumnStart: "auto" };
|
|
1693
|
+
if (isArbitrary) return { gridColumnStart: value };
|
|
1694
|
+
const n = parseInt(value, 10);
|
|
1695
|
+
return isNaN(n) ? null : { gridColumnStart: n };
|
|
1696
|
+
},
|
|
1697
|
+
"col-end": ({ value, isArbitrary }) => {
|
|
1698
|
+
if (!isWeb) return null;
|
|
1699
|
+
if (value === "auto") return { gridColumnEnd: "auto" };
|
|
1700
|
+
if (isArbitrary) return { gridColumnEnd: value };
|
|
1701
|
+
const n = parseInt(value, 10);
|
|
1702
|
+
return isNaN(n) ? null : { gridColumnEnd: n };
|
|
1703
|
+
},
|
|
1704
|
+
col: ({ value, isArbitrary }) => {
|
|
1705
|
+
if (!isWeb) return null;
|
|
1706
|
+
if (!value || value === "auto") return { gridColumn: "auto" };
|
|
1707
|
+
if (isArbitrary) return { gridColumn: value };
|
|
1708
|
+
return null;
|
|
1709
|
+
},
|
|
1710
|
+
// ── Grid row placement (web-only) ─────────────────────────────────────────
|
|
1711
|
+
"row-span": ({ value }) => {
|
|
1712
|
+
if (!isWeb) return null;
|
|
1713
|
+
if (value === "full") return { gridRow: "1 / -1" };
|
|
1714
|
+
const n = parseInt(value, 10);
|
|
1715
|
+
return isNaN(n) ? null : { gridRow: `span ${n} / span ${n}` };
|
|
1716
|
+
},
|
|
1717
|
+
"row-start": ({ value, isArbitrary }) => {
|
|
1718
|
+
if (!isWeb) return null;
|
|
1719
|
+
if (value === "auto") return { gridRowStart: "auto" };
|
|
1720
|
+
if (isArbitrary) return { gridRowStart: value };
|
|
1721
|
+
const n = parseInt(value, 10);
|
|
1722
|
+
return isNaN(n) ? null : { gridRowStart: n };
|
|
1723
|
+
},
|
|
1724
|
+
"row-end": ({ value, isArbitrary }) => {
|
|
1725
|
+
if (!isWeb) return null;
|
|
1726
|
+
if (value === "auto") return { gridRowEnd: "auto" };
|
|
1727
|
+
if (isArbitrary) return { gridRowEnd: value };
|
|
1728
|
+
const n = parseInt(value, 10);
|
|
1729
|
+
return isNaN(n) ? null : { gridRowEnd: n };
|
|
1730
|
+
},
|
|
1731
|
+
row: ({ value, isArbitrary }) => {
|
|
1732
|
+
if (!isWeb) return null;
|
|
1733
|
+
if (!value || value === "auto") return { gridRow: "auto" };
|
|
1734
|
+
if (isArbitrary) return { gridRow: value };
|
|
1735
|
+
return null;
|
|
1736
|
+
},
|
|
1613
1737
|
// ── Flex ───────────────────────────────────────────────────────────────────
|
|
1614
1738
|
flex: ({ value, isArbitrary }, { flex }) => {
|
|
1615
1739
|
if (!value) return { display: "flex" };
|
|
@@ -2040,7 +2164,11 @@ var CSS_UNITLESS = /* @__PURE__ */ new Set([
|
|
|
2040
2164
|
"zIndex",
|
|
2041
2165
|
"aspectRatio",
|
|
2042
2166
|
"columnCount",
|
|
2043
|
-
"lineHeight"
|
|
2167
|
+
"lineHeight",
|
|
2168
|
+
"gridColumnStart",
|
|
2169
|
+
"gridColumnEnd",
|
|
2170
|
+
"gridRowStart",
|
|
2171
|
+
"gridRowEnd"
|
|
2044
2172
|
]);
|
|
2045
2173
|
function styleValueToCSS(styles) {
|
|
2046
2174
|
return Object.entries(styles).filter(
|
|
@@ -2053,7 +2181,7 @@ function styleValueToCSS(styles) {
|
|
|
2053
2181
|
} else {
|
|
2054
2182
|
cssVal = String(val);
|
|
2055
2183
|
}
|
|
2056
|
-
const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") ? " !important" : "";
|
|
2184
|
+
const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") || prop === "position" && (cssVal === "sticky" || cssVal === "fixed" || cssVal === "static") ? " !important" : "";
|
|
2057
2185
|
return `${cssProp}: ${cssVal}${important}`;
|
|
2058
2186
|
}).join("; ");
|
|
2059
2187
|
}
|
|
@@ -2417,6 +2545,9 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
|
|
|
2417
2545
|
delete s.gridAutoFlow;
|
|
2418
2546
|
delete s.gridAutoColumns;
|
|
2419
2547
|
delete s.gridAutoRows;
|
|
2548
|
+
if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
|
|
2549
|
+
delete s.position;
|
|
2550
|
+
}
|
|
2420
2551
|
}
|
|
2421
2552
|
return s;
|
|
2422
2553
|
},
|
|
@@ -2461,14 +2592,14 @@ var DarkWrapper = import_react4.default.forwardRef(
|
|
|
2461
2592
|
const width = useConditionalWidth(needsWidth);
|
|
2462
2593
|
const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
|
|
2463
2594
|
const computedStyle = flatten(resolvedStyle, isDark, {}, breakpoints);
|
|
2464
|
-
if (typeof Component !== "string")
|
|
2595
|
+
if (typeof Component !== "string") stripWebOnlyProps(computedStyle);
|
|
2465
2596
|
const finalStyle = styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
|
|
2466
2597
|
const props = { ref, ...rest, style: finalStyle };
|
|
2467
2598
|
return Array.isArray(children) ? import_react4.default.createElement(Component, props, ...children) : import_react4.default.createElement(Component, props, children);
|
|
2468
2599
|
}
|
|
2469
2600
|
);
|
|
2470
2601
|
DarkWrapper.displayName = "Kbach.DarkWrapper";
|
|
2471
|
-
function
|
|
2602
|
+
function stripWebOnlyProps(s) {
|
|
2472
2603
|
if (s.display === "grid" || s.display === "inline-grid") delete s.display;
|
|
2473
2604
|
delete s.gridTemplateColumns;
|
|
2474
2605
|
delete s.gridTemplateRows;
|
|
@@ -2478,6 +2609,9 @@ function stripWebGridProps(s) {
|
|
|
2478
2609
|
delete s.gridAutoFlow;
|
|
2479
2610
|
delete s.gridAutoColumns;
|
|
2480
2611
|
delete s.gridAutoRows;
|
|
2612
|
+
if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
|
|
2613
|
+
delete s.position;
|
|
2614
|
+
}
|
|
2481
2615
|
}
|
|
2482
2616
|
|
|
2483
2617
|
// src/jsx-runtime.tsx
|
|
@@ -2590,6 +2724,9 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2590
2724
|
delete computedStyle.gridAutoFlow;
|
|
2591
2725
|
delete computedStyle.gridAutoColumns;
|
|
2592
2726
|
delete computedStyle.gridAutoRows;
|
|
2727
|
+
if (computedStyle.position === "sticky" || computedStyle.position === "fixed" || computedStyle.position === "static") {
|
|
2728
|
+
delete computedStyle.position;
|
|
2729
|
+
}
|
|
2593
2730
|
}
|
|
2594
2731
|
const finalStyle = mergeStyle(computedStyle, userStyle);
|
|
2595
2732
|
return makeElement(isStaticChildren, actualType, {
|
package/dist/jsx-dev-runtime.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
Fragment,
|
|
3
3
|
jsx,
|
|
4
4
|
jsxs
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-V5WMKNJC.mjs";
|
|
6
|
+
import "./chunk-HY6PU2XS.mjs";
|
|
7
7
|
|
|
8
8
|
// src/jsx-dev-runtime.tsx
|
|
9
9
|
function jsxDEV(type, props, key, isStaticChildren, _source, _self) {
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -796,6 +796,18 @@ var UTILITY_PREFIXES = [
|
|
|
796
796
|
"bg-opacity",
|
|
797
797
|
"text-opacity",
|
|
798
798
|
"border-opacity",
|
|
799
|
+
// Grid placement (longer prefixes before shorter ones)
|
|
800
|
+
"col-span",
|
|
801
|
+
"col-start",
|
|
802
|
+
"col-end",
|
|
803
|
+
"row-span",
|
|
804
|
+
"row-start",
|
|
805
|
+
"row-end",
|
|
806
|
+
"grid-cols",
|
|
807
|
+
"grid-rows",
|
|
808
|
+
"grid-flow",
|
|
809
|
+
"auto-cols",
|
|
810
|
+
"auto-rows",
|
|
799
811
|
// Single-word prefixes last
|
|
800
812
|
"appearance-none",
|
|
801
813
|
"outline-none",
|
|
@@ -1602,13 +1614,125 @@ var RESOLVERS = {
|
|
|
1602
1614
|
const r = resolveRadius(value, borderRadius, isArbitrary);
|
|
1603
1615
|
return r !== null ? { borderBottomRightRadius: r } : null;
|
|
1604
1616
|
},
|
|
1605
|
-
// ── Grid (responsive column count: grid-1 … grid-12)
|
|
1606
|
-
grid: ({ value }) => {
|
|
1617
|
+
// ── Grid (responsive column count: grid-1 … grid-12, or arbitrary) ───────
|
|
1618
|
+
grid: ({ value, isArbitrary }) => {
|
|
1607
1619
|
if (!value) return null;
|
|
1620
|
+
if (isArbitrary) return { display: "grid", gridTemplateColumns: value };
|
|
1608
1621
|
const n = parseInt(value, 10);
|
|
1609
1622
|
if (isNaN(n) || n < 1 || n > 12) return null;
|
|
1610
1623
|
return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
|
|
1611
1624
|
},
|
|
1625
|
+
// ── Grid template columns/rows (Tailwind-style aliases, web-only) ──────────
|
|
1626
|
+
"grid-cols": ({ value, isArbitrary }) => {
|
|
1627
|
+
if (!isWeb) return null;
|
|
1628
|
+
if (!value) return null;
|
|
1629
|
+
if (isArbitrary) return { display: "grid", gridTemplateColumns: value };
|
|
1630
|
+
if (value === "none") return { display: "grid", gridTemplateColumns: "none" };
|
|
1631
|
+
const n = parseInt(value, 10);
|
|
1632
|
+
if (isNaN(n) || n < 1 || n > 12) return null;
|
|
1633
|
+
return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
|
|
1634
|
+
},
|
|
1635
|
+
"grid-rows": ({ value, isArbitrary }) => {
|
|
1636
|
+
if (!isWeb) return null;
|
|
1637
|
+
if (!value) return null;
|
|
1638
|
+
if (isArbitrary) return { gridTemplateRows: value };
|
|
1639
|
+
if (value === "none") return { gridTemplateRows: "none" };
|
|
1640
|
+
const n = parseInt(value, 10);
|
|
1641
|
+
if (isNaN(n) || n < 1) return null;
|
|
1642
|
+
return { gridTemplateRows: `repeat(${n}, minmax(0, 1fr))` };
|
|
1643
|
+
},
|
|
1644
|
+
// ── Grid auto flow (web-only) ─────────────────────────────────────────────
|
|
1645
|
+
"grid-flow": ({ value }) => {
|
|
1646
|
+
if (!isWeb) return null;
|
|
1647
|
+
const flows = {
|
|
1648
|
+
row: "row",
|
|
1649
|
+
col: "column",
|
|
1650
|
+
dense: "dense",
|
|
1651
|
+
"row-dense": "row dense",
|
|
1652
|
+
"col-dense": "column dense"
|
|
1653
|
+
};
|
|
1654
|
+
const flow = flows[value];
|
|
1655
|
+
return flow ? { gridAutoFlow: flow } : null;
|
|
1656
|
+
},
|
|
1657
|
+
// ── Grid auto sizing (web-only) ───────────────────────────────────────────
|
|
1658
|
+
"auto-cols": ({ value, isArbitrary }) => {
|
|
1659
|
+
if (!isWeb) return null;
|
|
1660
|
+
if (isArbitrary) return { gridAutoColumns: value };
|
|
1661
|
+
const presets = {
|
|
1662
|
+
auto: "auto",
|
|
1663
|
+
min: "min-content",
|
|
1664
|
+
max: "max-content",
|
|
1665
|
+
fr: "minmax(0, 1fr)"
|
|
1666
|
+
};
|
|
1667
|
+
const v = presets[value];
|
|
1668
|
+
return v ? { gridAutoColumns: v } : null;
|
|
1669
|
+
},
|
|
1670
|
+
"auto-rows": ({ value, isArbitrary }) => {
|
|
1671
|
+
if (!isWeb) return null;
|
|
1672
|
+
if (isArbitrary) return { gridAutoRows: value };
|
|
1673
|
+
const presets = {
|
|
1674
|
+
auto: "auto",
|
|
1675
|
+
min: "min-content",
|
|
1676
|
+
max: "max-content",
|
|
1677
|
+
fr: "minmax(0, 1fr)"
|
|
1678
|
+
};
|
|
1679
|
+
const v = presets[value];
|
|
1680
|
+
return v ? { gridAutoRows: v } : null;
|
|
1681
|
+
},
|
|
1682
|
+
// ── Grid column placement (web-only) ──────────────────────────────────────
|
|
1683
|
+
"col-span": ({ value }) => {
|
|
1684
|
+
if (!isWeb) return null;
|
|
1685
|
+
if (value === "full") return { gridColumn: "1 / -1" };
|
|
1686
|
+
const n = parseInt(value, 10);
|
|
1687
|
+
return isNaN(n) ? null : { gridColumn: `span ${n} / span ${n}` };
|
|
1688
|
+
},
|
|
1689
|
+
"col-start": ({ value, isArbitrary }) => {
|
|
1690
|
+
if (!isWeb) return null;
|
|
1691
|
+
if (value === "auto") return { gridColumnStart: "auto" };
|
|
1692
|
+
if (isArbitrary) return { gridColumnStart: value };
|
|
1693
|
+
const n = parseInt(value, 10);
|
|
1694
|
+
return isNaN(n) ? null : { gridColumnStart: n };
|
|
1695
|
+
},
|
|
1696
|
+
"col-end": ({ value, isArbitrary }) => {
|
|
1697
|
+
if (!isWeb) return null;
|
|
1698
|
+
if (value === "auto") return { gridColumnEnd: "auto" };
|
|
1699
|
+
if (isArbitrary) return { gridColumnEnd: value };
|
|
1700
|
+
const n = parseInt(value, 10);
|
|
1701
|
+
return isNaN(n) ? null : { gridColumnEnd: n };
|
|
1702
|
+
},
|
|
1703
|
+
col: ({ value, isArbitrary }) => {
|
|
1704
|
+
if (!isWeb) return null;
|
|
1705
|
+
if (!value || value === "auto") return { gridColumn: "auto" };
|
|
1706
|
+
if (isArbitrary) return { gridColumn: value };
|
|
1707
|
+
return null;
|
|
1708
|
+
},
|
|
1709
|
+
// ── Grid row placement (web-only) ─────────────────────────────────────────
|
|
1710
|
+
"row-span": ({ value }) => {
|
|
1711
|
+
if (!isWeb) return null;
|
|
1712
|
+
if (value === "full") return { gridRow: "1 / -1" };
|
|
1713
|
+
const n = parseInt(value, 10);
|
|
1714
|
+
return isNaN(n) ? null : { gridRow: `span ${n} / span ${n}` };
|
|
1715
|
+
},
|
|
1716
|
+
"row-start": ({ value, isArbitrary }) => {
|
|
1717
|
+
if (!isWeb) return null;
|
|
1718
|
+
if (value === "auto") return { gridRowStart: "auto" };
|
|
1719
|
+
if (isArbitrary) return { gridRowStart: value };
|
|
1720
|
+
const n = parseInt(value, 10);
|
|
1721
|
+
return isNaN(n) ? null : { gridRowStart: n };
|
|
1722
|
+
},
|
|
1723
|
+
"row-end": ({ value, isArbitrary }) => {
|
|
1724
|
+
if (!isWeb) return null;
|
|
1725
|
+
if (value === "auto") return { gridRowEnd: "auto" };
|
|
1726
|
+
if (isArbitrary) return { gridRowEnd: value };
|
|
1727
|
+
const n = parseInt(value, 10);
|
|
1728
|
+
return isNaN(n) ? null : { gridRowEnd: n };
|
|
1729
|
+
},
|
|
1730
|
+
row: ({ value, isArbitrary }) => {
|
|
1731
|
+
if (!isWeb) return null;
|
|
1732
|
+
if (!value || value === "auto") return { gridRow: "auto" };
|
|
1733
|
+
if (isArbitrary) return { gridRow: value };
|
|
1734
|
+
return null;
|
|
1735
|
+
},
|
|
1612
1736
|
// ── Flex ───────────────────────────────────────────────────────────────────
|
|
1613
1737
|
flex: ({ value, isArbitrary }, { flex }) => {
|
|
1614
1738
|
if (!value) return { display: "flex" };
|
|
@@ -2039,7 +2163,11 @@ var CSS_UNITLESS = /* @__PURE__ */ new Set([
|
|
|
2039
2163
|
"zIndex",
|
|
2040
2164
|
"aspectRatio",
|
|
2041
2165
|
"columnCount",
|
|
2042
|
-
"lineHeight"
|
|
2166
|
+
"lineHeight",
|
|
2167
|
+
"gridColumnStart",
|
|
2168
|
+
"gridColumnEnd",
|
|
2169
|
+
"gridRowStart",
|
|
2170
|
+
"gridRowEnd"
|
|
2043
2171
|
]);
|
|
2044
2172
|
function styleValueToCSS(styles) {
|
|
2045
2173
|
return Object.entries(styles).filter(
|
|
@@ -2052,7 +2180,7 @@ function styleValueToCSS(styles) {
|
|
|
2052
2180
|
} else {
|
|
2053
2181
|
cssVal = String(val);
|
|
2054
2182
|
}
|
|
2055
|
-
const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") ? " !important" : "";
|
|
2183
|
+
const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") || prop === "position" && (cssVal === "sticky" || cssVal === "fixed" || cssVal === "static") ? " !important" : "";
|
|
2056
2184
|
return `${cssProp}: ${cssVal}${important}`;
|
|
2057
2185
|
}).join("; ");
|
|
2058
2186
|
}
|
|
@@ -2416,6 +2544,9 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
|
|
|
2416
2544
|
delete s.gridAutoFlow;
|
|
2417
2545
|
delete s.gridAutoColumns;
|
|
2418
2546
|
delete s.gridAutoRows;
|
|
2547
|
+
if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
|
|
2548
|
+
delete s.position;
|
|
2549
|
+
}
|
|
2419
2550
|
}
|
|
2420
2551
|
return s;
|
|
2421
2552
|
},
|
|
@@ -2460,14 +2591,14 @@ var DarkWrapper = import_react4.default.forwardRef(
|
|
|
2460
2591
|
const width = useConditionalWidth(needsWidth);
|
|
2461
2592
|
const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
|
|
2462
2593
|
const computedStyle = flatten(resolvedStyle, isDark, {}, breakpoints);
|
|
2463
|
-
if (typeof Component !== "string")
|
|
2594
|
+
if (typeof Component !== "string") stripWebOnlyProps(computedStyle);
|
|
2464
2595
|
const finalStyle = styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
|
|
2465
2596
|
const props = { ref, ...rest, style: finalStyle };
|
|
2466
2597
|
return Array.isArray(children) ? import_react4.default.createElement(Component, props, ...children) : import_react4.default.createElement(Component, props, children);
|
|
2467
2598
|
}
|
|
2468
2599
|
);
|
|
2469
2600
|
DarkWrapper.displayName = "Kbach.DarkWrapper";
|
|
2470
|
-
function
|
|
2601
|
+
function stripWebOnlyProps(s) {
|
|
2471
2602
|
if (s.display === "grid" || s.display === "inline-grid") delete s.display;
|
|
2472
2603
|
delete s.gridTemplateColumns;
|
|
2473
2604
|
delete s.gridTemplateRows;
|
|
@@ -2477,6 +2608,9 @@ function stripWebGridProps(s) {
|
|
|
2477
2608
|
delete s.gridAutoFlow;
|
|
2478
2609
|
delete s.gridAutoColumns;
|
|
2479
2610
|
delete s.gridAutoRows;
|
|
2611
|
+
if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
|
|
2612
|
+
delete s.position;
|
|
2613
|
+
}
|
|
2480
2614
|
}
|
|
2481
2615
|
|
|
2482
2616
|
// src/jsx-runtime.tsx
|
|
@@ -2589,6 +2723,9 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2589
2723
|
delete computedStyle.gridAutoFlow;
|
|
2590
2724
|
delete computedStyle.gridAutoColumns;
|
|
2591
2725
|
delete computedStyle.gridAutoRows;
|
|
2726
|
+
if (computedStyle.position === "sticky" || computedStyle.position === "fixed" || computedStyle.position === "static") {
|
|
2727
|
+
delete computedStyle.position;
|
|
2728
|
+
}
|
|
2592
2729
|
}
|
|
2593
2730
|
const finalStyle = mergeStyle(computedStyle, userStyle);
|
|
2594
2731
|
return makeElement(isStaticChildren, actualType, {
|
package/dist/jsx-runtime.mjs
CHANGED