@kbach/react 0.3.11 → 0.3.13

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-SMSQ7JQV.mjs";
11
+ } from "./chunk-XL3F5GRY.mjs";
12
12
 
13
13
  // src/jsx-runtime.tsx
14
14
  import { jsx as _jsx, jsxs as _jsxs, Fragment } from "react/jsx-runtime";
@@ -1532,6 +1532,13 @@ var RESOLVERS = {
1532
1532
  const r = resolveRadius(value, borderRadius, isArbitrary);
1533
1533
  return r !== null ? { borderBottomRightRadius: r } : null;
1534
1534
  },
1535
+ // ── Grid (responsive column count: grid-1 … grid-12) ─────────────────────
1536
+ grid: ({ value }) => {
1537
+ if (!value || !isWeb) return null;
1538
+ const n = parseInt(value, 10);
1539
+ if (isNaN(n) || n < 1 || n > 12) return null;
1540
+ return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
1541
+ },
1535
1542
  // ── Flex ───────────────────────────────────────────────────────────────────
1536
1543
  flex: ({ value, isArbitrary }, { flex }) => {
1537
1544
  if (!value) return { display: "flex" };
@@ -2017,7 +2024,8 @@ function styleValueToCSS(styles) {
2017
2024
  } else {
2018
2025
  cssVal = String(val);
2019
2026
  }
2020
- return `${cssProp}: ${cssVal}`;
2027
+ const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") ? " !important" : "";
2028
+ return `${cssProp}: ${cssVal}${important}`;
2021
2029
  }).join("; ");
2022
2030
  }
2023
2031
  function camelToKebab(str) {
package/dist/index.js CHANGED
@@ -1698,6 +1698,13 @@ var RESOLVERS = {
1698
1698
  const r = resolveRadius(value, borderRadius, isArbitrary);
1699
1699
  return r !== null ? { borderBottomRightRadius: r } : null;
1700
1700
  },
1701
+ // ── Grid (responsive column count: grid-1 … grid-12) ─────────────────────
1702
+ grid: ({ value }) => {
1703
+ if (!value || !isWeb) return null;
1704
+ const n = parseInt(value, 10);
1705
+ if (isNaN(n) || n < 1 || n > 12) return null;
1706
+ return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
1707
+ },
1701
1708
  // ── Flex ───────────────────────────────────────────────────────────────────
1702
1709
  flex: ({ value, isArbitrary }, { flex }) => {
1703
1710
  if (!value) return { display: "flex" };
@@ -2147,7 +2154,8 @@ function styleValueToCSS(styles) {
2147
2154
  } else {
2148
2155
  cssVal = String(val);
2149
2156
  }
2150
- return `${cssProp}: ${cssVal}`;
2157
+ const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") ? " !important" : "";
2158
+ return `${cssProp}: ${cssVal}${important}`;
2151
2159
  }).join("; ");
2152
2160
  }
2153
2161
  function camelToKebab(str) {
package/dist/index.mjs CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  updateConfig,
22
22
  useGlobalDarkMode,
23
23
  useGlobalWidth
24
- } from "./chunk-SMSQ7JQV.mjs";
24
+ } from "./chunk-XL3F5GRY.mjs";
25
25
 
26
26
  // src/context.tsx
27
27
  import { createContext, useContext } from "react";
@@ -1601,6 +1601,13 @@ var RESOLVERS = {
1601
1601
  const r = resolveRadius(value, borderRadius, isArbitrary);
1602
1602
  return r !== null ? { borderBottomRightRadius: r } : null;
1603
1603
  },
1604
+ // ── Grid (responsive column count: grid-1 … grid-12) ─────────────────────
1605
+ grid: ({ value }) => {
1606
+ if (!value || !isWeb) return null;
1607
+ const n = parseInt(value, 10);
1608
+ if (isNaN(n) || n < 1 || n > 12) return null;
1609
+ return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
1610
+ },
1604
1611
  // ── Flex ───────────────────────────────────────────────────────────────────
1605
1612
  flex: ({ value, isArbitrary }, { flex }) => {
1606
1613
  if (!value) return { display: "flex" };
@@ -2038,7 +2045,8 @@ function styleValueToCSS(styles) {
2038
2045
  } else {
2039
2046
  cssVal = String(val);
2040
2047
  }
2041
- return `${cssProp}: ${cssVal}`;
2048
+ const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") ? " !important" : "";
2049
+ return `${cssProp}: ${cssVal}${important}`;
2042
2050
  }).join("; ");
2043
2051
  }
2044
2052
  function camelToKebab(str) {
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-PIVTTJGI.mjs";
6
- import "./chunk-SMSQ7JQV.mjs";
5
+ } from "./chunk-BBWDCPU6.mjs";
6
+ import "./chunk-XL3F5GRY.mjs";
7
7
 
8
8
  // src/jsx-dev-runtime.tsx
9
9
  function jsxDEV(type, props, key, isStaticChildren, _source, _self) {
@@ -1600,6 +1600,13 @@ var RESOLVERS = {
1600
1600
  const r = resolveRadius(value, borderRadius, isArbitrary);
1601
1601
  return r !== null ? { borderBottomRightRadius: r } : null;
1602
1602
  },
1603
+ // ── Grid (responsive column count: grid-1 … grid-12) ─────────────────────
1604
+ grid: ({ value }) => {
1605
+ if (!value || !isWeb) return null;
1606
+ const n = parseInt(value, 10);
1607
+ if (isNaN(n) || n < 1 || n > 12) return null;
1608
+ return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
1609
+ },
1603
1610
  // ── Flex ───────────────────────────────────────────────────────────────────
1604
1611
  flex: ({ value, isArbitrary }, { flex }) => {
1605
1612
  if (!value) return { display: "flex" };
@@ -2037,7 +2044,8 @@ function styleValueToCSS(styles) {
2037
2044
  } else {
2038
2045
  cssVal = String(val);
2039
2046
  }
2040
- return `${cssProp}: ${cssVal}`;
2047
+ const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") ? " !important" : "";
2048
+ return `${cssProp}: ${cssVal}${important}`;
2041
2049
  }).join("; ");
2042
2050
  }
2043
2051
  function camelToKebab(str) {
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-PIVTTJGI.mjs";
6
- import "./chunk-SMSQ7JQV.mjs";
5
+ } from "./chunk-BBWDCPU6.mjs";
6
+ import "./chunk-XL3F5GRY.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.11",
3
+ "version": "0.3.13",
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",