@kbach/react 0.3.18 → 0.4.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.
@@ -8,7 +8,7 @@ import {
8
8
  resolve,
9
9
  useConditionalWidth,
10
10
  useGlobalDarkMode
11
- } from "./chunk-437T7FQC.mjs";
11
+ } from "./chunk-QXJ6A5GS.mjs";
12
12
 
13
13
  // src/jsx-runtime.tsx
14
14
  import { jsx as _jsx, jsxs as _jsxs, Fragment } from "react/jsx-runtime";
@@ -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 }) => {
1539
- if (!value || typeof document === "undefined") return null;
1549
+ // ── Grid (responsive column count: grid-1 … grid-12, or arbitrary) ───────
1550
+ grid: ({ value, isArbitrary }) => {
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" };
@@ -1801,10 +1925,10 @@ function resolveUtility(parsed, theme) {
1801
1925
  if (!parsed.value) {
1802
1926
  if (parsed.utility in PLUGIN_STANDALONE) return PLUGIN_STANDALONE[parsed.utility] ?? null;
1803
1927
  if (parsed.utility === "grd" || parsed.utility === "grid") {
1804
- return typeof document !== "undefined" ? { display: "grid" } : null;
1928
+ return { display: "grid" };
1805
1929
  }
1806
1930
  if (parsed.utility === "inline-grid") {
1807
- return typeof document !== "undefined" ? { display: "inline-grid" } : null;
1931
+ return { display: "inline-grid" };
1808
1932
  }
1809
1933
  if (parsed.utility in STANDALONE) return STANDALONE[parsed.utility] ?? null;
1810
1934
  }
@@ -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(
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 }) => {
1705
- if (!value || typeof document === "undefined") return null;
1715
+ // ── Grid (responsive column count: grid-1 … grid-12, or arbitrary) ───────
1716
+ grid: ({ value, isArbitrary }) => {
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" };
@@ -1967,10 +2091,10 @@ function resolveUtility(parsed, theme) {
1967
2091
  if (!parsed.value) {
1968
2092
  if (parsed.utility in PLUGIN_STANDALONE) return PLUGIN_STANDALONE[parsed.utility] ?? null;
1969
2093
  if (parsed.utility === "grd" || parsed.utility === "grid") {
1970
- return typeof document !== "undefined" ? { display: "grid" } : null;
2094
+ return { display: "grid" };
1971
2095
  }
1972
2096
  if (parsed.utility === "inline-grid") {
1973
- return typeof document !== "undefined" ? { display: "inline-grid" } : null;
2097
+ return { display: "inline-grid" };
1974
2098
  }
1975
2099
  if (parsed.utility in STANDALONE) return STANDALONE[parsed.utility] ?? null;
1976
2100
  }
@@ -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(
package/dist/index.mjs CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  updateConfig,
22
22
  useGlobalDarkMode,
23
23
  useGlobalWidth
24
- } from "./chunk-437T7FQC.mjs";
24
+ } from "./chunk-QXJ6A5GS.mjs";
25
25
 
26
26
  // src/context.tsx
27
27
  import { createContext, useContext } from "react";
@@ -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 }) => {
1608
- if (!value || typeof document === "undefined") return null;
1618
+ // ── Grid (responsive column count: grid-1 … grid-12, or arbitrary) ───────
1619
+ grid: ({ value, isArbitrary }) => {
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" };
@@ -1870,10 +1994,10 @@ function resolveUtility(parsed, theme) {
1870
1994
  if (!parsed.value) {
1871
1995
  if (parsed.utility in PLUGIN_STANDALONE) return PLUGIN_STANDALONE[parsed.utility] ?? null;
1872
1996
  if (parsed.utility === "grd" || parsed.utility === "grid") {
1873
- return typeof document !== "undefined" ? { display: "grid" } : null;
1997
+ return { display: "grid" };
1874
1998
  }
1875
1999
  if (parsed.utility === "inline-grid") {
1876
- return typeof document !== "undefined" ? { display: "inline-grid" } : null;
2000
+ return { display: "inline-grid" };
1877
2001
  }
1878
2002
  if (parsed.utility in STANDALONE) return STANDALONE[parsed.utility] ?? null;
1879
2003
  }
@@ -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(
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-CIK3ADJB.mjs";
6
- import "./chunk-437T7FQC.mjs";
5
+ } from "./chunk-QVZTZMJ7.mjs";
6
+ import "./chunk-QXJ6A5GS.mjs";
7
7
 
8
8
  // src/jsx-dev-runtime.tsx
9
9
  function jsxDEV(type, props, key, isStaticChildren, _source, _self) {
@@ -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 }) => {
1607
- if (!value || typeof document === "undefined") return null;
1617
+ // ── Grid (responsive column count: grid-1 … grid-12, or arbitrary) ───────
1618
+ grid: ({ value, isArbitrary }) => {
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" };
@@ -1869,10 +1993,10 @@ function resolveUtility(parsed, theme) {
1869
1993
  if (!parsed.value) {
1870
1994
  if (parsed.utility in PLUGIN_STANDALONE) return PLUGIN_STANDALONE[parsed.utility] ?? null;
1871
1995
  if (parsed.utility === "grd" || parsed.utility === "grid") {
1872
- return typeof document !== "undefined" ? { display: "grid" } : null;
1996
+ return { display: "grid" };
1873
1997
  }
1874
1998
  if (parsed.utility === "inline-grid") {
1875
- return typeof document !== "undefined" ? { display: "inline-grid" } : null;
1999
+ return { display: "inline-grid" };
1876
2000
  }
1877
2001
  if (parsed.utility in STANDALONE) return STANDALONE[parsed.utility] ?? null;
1878
2002
  }
@@ -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(
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-CIK3ADJB.mjs";
6
- import "./chunk-437T7FQC.mjs";
5
+ } from "./chunk-QVZTZMJ7.mjs";
6
+ import "./chunk-QXJ6A5GS.mjs";
7
7
  export {
8
8
  Fragment,
9
9
  jsx,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kbach/react",
3
- "version": "0.3.18",
3
+ "version": "0.4.0",
4
4
  "description": "React / React Native components and hooks for the Kbach framework",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",