@kbach/react 0.3.10 → 0.3.12

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-LZYPVC5K.mjs";
11
+ } from "./chunk-UGBTZ7VN.mjs";
12
12
 
13
13
  // src/jsx-runtime.tsx
14
14
  import { jsx as _jsx, jsxs as _jsxs, Fragment } from "react/jsx-runtime";
@@ -1134,14 +1134,15 @@ function resolveFontSize(value, fontSizes, isArbitrary) {
1134
1134
  }
1135
1135
  var STANDALONE = {
1136
1136
  // Display
1137
- // On native, Views are flex containers by default — `display: 'flex'` is a no-op.
1137
+ // React Native only supports display:'flex'|'none'. Setting 'flex' explicitly is
1138
+ // a no-op normally, but is needed to re-show an element that was hidden via `hidden`.
1138
1139
  // `grid`, `inline-*`, `contents`, `flow-root` have no native equivalent.
1139
- flex: isWeb ? { display: "flex" } : {},
1140
+ flex: { display: "flex" },
1140
1141
  block: isWeb ? { display: "block" } : null,
1141
1142
  "inline-block": isWeb ? { display: "inline-block" } : null,
1142
1143
  inline: isWeb ? { display: "inline" } : null,
1143
1144
  grid: isWeb ? { display: "grid" } : null,
1144
- "inline-flex": isWeb ? { display: "inline-flex" } : {},
1145
+ "inline-flex": { display: isWeb ? "inline-flex" : "flex" },
1145
1146
  "inline-grid": isWeb ? { display: "inline-grid" } : null,
1146
1147
  hidden: { display: "none" },
1147
1148
  contents: isWeb ? { display: "contents" } : null,
@@ -1531,9 +1532,16 @@ var RESOLVERS = {
1531
1532
  const r = resolveRadius(value, borderRadius, isArbitrary);
1532
1533
  return r !== null ? { borderBottomRightRadius: r } : null;
1533
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
+ },
1534
1542
  // ── Flex ───────────────────────────────────────────────────────────────────
1535
1543
  flex: ({ value, isArbitrary }, { flex }) => {
1536
- if (!value) return isWeb ? { display: "flex" } : {};
1544
+ if (!value) return { display: "flex" };
1537
1545
  if (isArbitrary) {
1538
1546
  const v = parseFloat(value);
1539
1547
  return isNaN(v) ? null : { flex: v };
package/dist/index.js CHANGED
@@ -1300,14 +1300,15 @@ function resolveFontSize(value, fontSizes, isArbitrary) {
1300
1300
  }
1301
1301
  var STANDALONE = {
1302
1302
  // Display
1303
- // On native, Views are flex containers by default — `display: 'flex'` is a no-op.
1303
+ // React Native only supports display:'flex'|'none'. Setting 'flex' explicitly is
1304
+ // a no-op normally, but is needed to re-show an element that was hidden via `hidden`.
1304
1305
  // `grid`, `inline-*`, `contents`, `flow-root` have no native equivalent.
1305
- flex: isWeb ? { display: "flex" } : {},
1306
+ flex: { display: "flex" },
1306
1307
  block: isWeb ? { display: "block" } : null,
1307
1308
  "inline-block": isWeb ? { display: "inline-block" } : null,
1308
1309
  inline: isWeb ? { display: "inline" } : null,
1309
1310
  grid: isWeb ? { display: "grid" } : null,
1310
- "inline-flex": isWeb ? { display: "inline-flex" } : {},
1311
+ "inline-flex": { display: isWeb ? "inline-flex" : "flex" },
1311
1312
  "inline-grid": isWeb ? { display: "inline-grid" } : null,
1312
1313
  hidden: { display: "none" },
1313
1314
  contents: isWeb ? { display: "contents" } : null,
@@ -1697,9 +1698,16 @@ var RESOLVERS = {
1697
1698
  const r = resolveRadius(value, borderRadius, isArbitrary);
1698
1699
  return r !== null ? { borderBottomRightRadius: r } : null;
1699
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
+ },
1700
1708
  // ── Flex ───────────────────────────────────────────────────────────────────
1701
1709
  flex: ({ value, isArbitrary }, { flex }) => {
1702
- if (!value) return isWeb ? { display: "flex" } : {};
1710
+ if (!value) return { display: "flex" };
1703
1711
  if (isArbitrary) {
1704
1712
  const v = parseFloat(value);
1705
1713
  return isNaN(v) ? null : { flex: v };
package/dist/index.mjs CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  updateConfig,
22
22
  useGlobalDarkMode,
23
23
  useGlobalWidth
24
- } from "./chunk-LZYPVC5K.mjs";
24
+ } from "./chunk-UGBTZ7VN.mjs";
25
25
 
26
26
  // src/context.tsx
27
27
  import { createContext, useContext } from "react";
@@ -1203,14 +1203,15 @@ function resolveFontSize(value, fontSizes, isArbitrary) {
1203
1203
  }
1204
1204
  var STANDALONE = {
1205
1205
  // Display
1206
- // On native, Views are flex containers by default — `display: 'flex'` is a no-op.
1206
+ // React Native only supports display:'flex'|'none'. Setting 'flex' explicitly is
1207
+ // a no-op normally, but is needed to re-show an element that was hidden via `hidden`.
1207
1208
  // `grid`, `inline-*`, `contents`, `flow-root` have no native equivalent.
1208
- flex: isWeb ? { display: "flex" } : {},
1209
+ flex: { display: "flex" },
1209
1210
  block: isWeb ? { display: "block" } : null,
1210
1211
  "inline-block": isWeb ? { display: "inline-block" } : null,
1211
1212
  inline: isWeb ? { display: "inline" } : null,
1212
1213
  grid: isWeb ? { display: "grid" } : null,
1213
- "inline-flex": isWeb ? { display: "inline-flex" } : {},
1214
+ "inline-flex": { display: isWeb ? "inline-flex" : "flex" },
1214
1215
  "inline-grid": isWeb ? { display: "inline-grid" } : null,
1215
1216
  hidden: { display: "none" },
1216
1217
  contents: isWeb ? { display: "contents" } : null,
@@ -1600,9 +1601,16 @@ var RESOLVERS = {
1600
1601
  const r = resolveRadius(value, borderRadius, isArbitrary);
1601
1602
  return r !== null ? { borderBottomRightRadius: r } : null;
1602
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
+ },
1603
1611
  // ── Flex ───────────────────────────────────────────────────────────────────
1604
1612
  flex: ({ value, isArbitrary }, { flex }) => {
1605
- if (!value) return isWeb ? { display: "flex" } : {};
1613
+ if (!value) return { display: "flex" };
1606
1614
  if (isArbitrary) {
1607
1615
  const v = parseFloat(value);
1608
1616
  return isNaN(v) ? null : { flex: v };
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-3AMSZMOL.mjs";
6
- import "./chunk-LZYPVC5K.mjs";
5
+ } from "./chunk-BAI72FG4.mjs";
6
+ import "./chunk-UGBTZ7VN.mjs";
7
7
 
8
8
  // src/jsx-dev-runtime.tsx
9
9
  function jsxDEV(type, props, key, isStaticChildren, _source, _self) {
@@ -1202,14 +1202,15 @@ function resolveFontSize(value, fontSizes, isArbitrary) {
1202
1202
  }
1203
1203
  var STANDALONE = {
1204
1204
  // Display
1205
- // On native, Views are flex containers by default — `display: 'flex'` is a no-op.
1205
+ // React Native only supports display:'flex'|'none'. Setting 'flex' explicitly is
1206
+ // a no-op normally, but is needed to re-show an element that was hidden via `hidden`.
1206
1207
  // `grid`, `inline-*`, `contents`, `flow-root` have no native equivalent.
1207
- flex: isWeb ? { display: "flex" } : {},
1208
+ flex: { display: "flex" },
1208
1209
  block: isWeb ? { display: "block" } : null,
1209
1210
  "inline-block": isWeb ? { display: "inline-block" } : null,
1210
1211
  inline: isWeb ? { display: "inline" } : null,
1211
1212
  grid: isWeb ? { display: "grid" } : null,
1212
- "inline-flex": isWeb ? { display: "inline-flex" } : {},
1213
+ "inline-flex": { display: isWeb ? "inline-flex" : "flex" },
1213
1214
  "inline-grid": isWeb ? { display: "inline-grid" } : null,
1214
1215
  hidden: { display: "none" },
1215
1216
  contents: isWeb ? { display: "contents" } : null,
@@ -1599,9 +1600,16 @@ var RESOLVERS = {
1599
1600
  const r = resolveRadius(value, borderRadius, isArbitrary);
1600
1601
  return r !== null ? { borderBottomRightRadius: r } : null;
1601
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
+ },
1602
1610
  // ── Flex ───────────────────────────────────────────────────────────────────
1603
1611
  flex: ({ value, isArbitrary }, { flex }) => {
1604
- if (!value) return isWeb ? { display: "flex" } : {};
1612
+ if (!value) return { display: "flex" };
1605
1613
  if (isArbitrary) {
1606
1614
  const v = parseFloat(value);
1607
1615
  return isNaN(v) ? null : { flex: v };
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-3AMSZMOL.mjs";
6
- import "./chunk-LZYPVC5K.mjs";
5
+ } from "./chunk-BAI72FG4.mjs";
6
+ import "./chunk-UGBTZ7VN.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.10",
3
+ "version": "0.3.12",
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",