@kbach/react 0.3.17 → 0.3.19

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.
@@ -1536,7 +1536,7 @@ var RESOLVERS = {
1536
1536
  },
1537
1537
  // ── Grid (responsive column count: grid-1 … grid-12) ─────────────────────
1538
1538
  grid: ({ value }) => {
1539
- if (!value || typeof document === "undefined") return null;
1539
+ if (!value) return null;
1540
1540
  const n = parseInt(value, 10);
1541
1541
  if (isNaN(n) || n < 1 || n > 12) return null;
1542
1542
  return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
@@ -1801,10 +1801,10 @@ function resolveUtility(parsed, theme) {
1801
1801
  if (!parsed.value) {
1802
1802
  if (parsed.utility in PLUGIN_STANDALONE) return PLUGIN_STANDALONE[parsed.utility] ?? null;
1803
1803
  if (parsed.utility === "grd" || parsed.utility === "grid") {
1804
- return typeof document !== "undefined" ? { display: "grid" } : null;
1804
+ return { display: "grid" };
1805
1805
  }
1806
1806
  if (parsed.utility === "inline-grid") {
1807
- return typeof document !== "undefined" ? { display: "inline-grid" } : null;
1807
+ return { display: "inline-grid" };
1808
1808
  }
1809
1809
  if (parsed.utility in STANDALONE) return STANDALONE[parsed.utility] ?? null;
1810
1810
  }
@@ -2424,7 +2424,7 @@ var InteractiveWrapper = forwardRef(
2424
2424
  const computedStyle = useMemo(
2425
2425
  () => {
2426
2426
  const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints);
2427
- if (isWeb && typeof Component !== "string") {
2427
+ if (typeof Component !== "string") {
2428
2428
  if (s.display === "grid" || s.display === "inline-grid") delete s.display;
2429
2429
  delete s.gridTemplateColumns;
2430
2430
  delete s.gridTemplateRows;
@@ -8,7 +8,7 @@ import {
8
8
  resolve,
9
9
  useConditionalWidth,
10
10
  useGlobalDarkMode
11
- } from "./chunk-5GHUWO2A.mjs";
11
+ } from "./chunk-AW3HK2B4.mjs";
12
12
 
13
13
  // src/jsx-runtime.tsx
14
14
  import { jsx as _jsx, jsxs as _jsxs, Fragment } from "react/jsx-runtime";
@@ -32,7 +32,7 @@ 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 (isWeb && typeof Component !== "string") stripWebGridProps(computedStyle);
35
+ if (typeof Component !== "string") stripWebGridProps(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);
@@ -127,7 +127,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
127
127
  return makeElement(isStaticChildren, type, rawProps, key);
128
128
  }
129
129
  const config = getConfig();
130
- const isGrdOnWeb = isWeb && classStr != null && /(?:^|\s)grd(?:\s|$)/.test(classStr);
130
+ const isGrdOnWeb = typeof document !== "undefined" && classStr != null && /(?:^|\s)grd(?:\s|$)/.test(classStr);
131
131
  const actualType = isGrdOnWeb ? "div" : type;
132
132
  const resolved = __kbachStyles ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
133
133
  const { style: userStyle, ...passProps } = omitConsumed(rawProps);
@@ -151,7 +151,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
151
151
  }, key);
152
152
  }
153
153
  const computedStyle = flatten(resolved, false);
154
- if (isWeb && typeof actualType !== "string") {
154
+ if (typeof actualType !== "string") {
155
155
  if (computedStyle.display === "grid" || computedStyle.display === "inline-grid") delete computedStyle.display;
156
156
  delete computedStyle.gridTemplateColumns;
157
157
  delete computedStyle.gridTemplateRows;
package/dist/index.js CHANGED
@@ -1702,7 +1702,7 @@ var RESOLVERS = {
1702
1702
  },
1703
1703
  // ── Grid (responsive column count: grid-1 … grid-12) ─────────────────────
1704
1704
  grid: ({ value }) => {
1705
- if (!value || typeof document === "undefined") return null;
1705
+ if (!value) return null;
1706
1706
  const n = parseInt(value, 10);
1707
1707
  if (isNaN(n) || n < 1 || n > 12) return null;
1708
1708
  return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
@@ -1967,10 +1967,10 @@ function resolveUtility(parsed, theme) {
1967
1967
  if (!parsed.value) {
1968
1968
  if (parsed.utility in PLUGIN_STANDALONE) return PLUGIN_STANDALONE[parsed.utility] ?? null;
1969
1969
  if (parsed.utility === "grd" || parsed.utility === "grid") {
1970
- return typeof document !== "undefined" ? { display: "grid" } : null;
1970
+ return { display: "grid" };
1971
1971
  }
1972
1972
  if (parsed.utility === "inline-grid") {
1973
- return typeof document !== "undefined" ? { display: "inline-grid" } : null;
1973
+ return { display: "inline-grid" };
1974
1974
  }
1975
1975
  if (parsed.utility in STANDALONE) return STANDALONE[parsed.utility] ?? null;
1976
1976
  }
@@ -2928,7 +2928,7 @@ var InteractiveWrapper = (0, import_react9.forwardRef)(
2928
2928
  const computedStyle = (0, import_react9.useMemo)(
2929
2929
  () => {
2930
2930
  const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints);
2931
- if (isWeb && typeof Component !== "string") {
2931
+ if (typeof Component !== "string") {
2932
2932
  if (s.display === "grid" || s.display === "inline-grid") delete s.display;
2933
2933
  delete s.gridTemplateColumns;
2934
2934
  delete s.gridTemplateRows;
package/dist/index.mjs CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  updateConfig,
22
22
  useGlobalDarkMode,
23
23
  useGlobalWidth
24
- } from "./chunk-5GHUWO2A.mjs";
24
+ } from "./chunk-AW3HK2B4.mjs";
25
25
 
26
26
  // src/context.tsx
27
27
  import { createContext, useContext } from "react";
@@ -1605,7 +1605,7 @@ var RESOLVERS = {
1605
1605
  },
1606
1606
  // ── Grid (responsive column count: grid-1 … grid-12) ─────────────────────
1607
1607
  grid: ({ value }) => {
1608
- if (!value || typeof document === "undefined") return null;
1608
+ if (!value) return null;
1609
1609
  const n = parseInt(value, 10);
1610
1610
  if (isNaN(n) || n < 1 || n > 12) return null;
1611
1611
  return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
@@ -1870,10 +1870,10 @@ function resolveUtility(parsed, theme) {
1870
1870
  if (!parsed.value) {
1871
1871
  if (parsed.utility in PLUGIN_STANDALONE) return PLUGIN_STANDALONE[parsed.utility] ?? null;
1872
1872
  if (parsed.utility === "grd" || parsed.utility === "grid") {
1873
- return typeof document !== "undefined" ? { display: "grid" } : null;
1873
+ return { display: "grid" };
1874
1874
  }
1875
1875
  if (parsed.utility === "inline-grid") {
1876
- return typeof document !== "undefined" ? { display: "inline-grid" } : null;
1876
+ return { display: "inline-grid" };
1877
1877
  }
1878
1878
  if (parsed.utility in STANDALONE) return STANDALONE[parsed.utility] ?? null;
1879
1879
  }
@@ -2407,7 +2407,7 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
2407
2407
  const computedStyle = (0, import_react3.useMemo)(
2408
2408
  () => {
2409
2409
  const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints);
2410
- if (isWeb && typeof Component !== "string") {
2410
+ if (typeof Component !== "string") {
2411
2411
  if (s.display === "grid" || s.display === "inline-grid") delete s.display;
2412
2412
  delete s.gridTemplateColumns;
2413
2413
  delete s.gridTemplateRows;
@@ -2461,7 +2461,7 @@ var DarkWrapper = import_react4.default.forwardRef(
2461
2461
  const width = useConditionalWidth(needsWidth);
2462
2462
  const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
2463
2463
  const computedStyle = flatten(resolvedStyle, isDark, {}, breakpoints);
2464
- if (isWeb && typeof Component !== "string") stripWebGridProps(computedStyle);
2464
+ if (typeof Component !== "string") stripWebGridProps(computedStyle);
2465
2465
  const finalStyle = styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
2466
2466
  const props = { ref, ...rest, style: finalStyle };
2467
2467
  return Array.isArray(children) ? import_react4.default.createElement(Component, props, ...children) : import_react4.default.createElement(Component, props, children);
@@ -2556,7 +2556,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
2556
2556
  return makeElement(isStaticChildren, type, rawProps, key);
2557
2557
  }
2558
2558
  const config = getConfig();
2559
- const isGrdOnWeb = isWeb && classStr != null && /(?:^|\s)grd(?:\s|$)/.test(classStr);
2559
+ const isGrdOnWeb = typeof document !== "undefined" && classStr != null && /(?:^|\s)grd(?:\s|$)/.test(classStr);
2560
2560
  const actualType = isGrdOnWeb ? "div" : type;
2561
2561
  const resolved = __kbachStyles ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
2562
2562
  const { style: userStyle, ...passProps } = omitConsumed(rawProps);
@@ -2580,7 +2580,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
2580
2580
  }, key);
2581
2581
  }
2582
2582
  const computedStyle = flatten(resolved, false);
2583
- if (isWeb && typeof actualType !== "string") {
2583
+ if (typeof actualType !== "string") {
2584
2584
  if (computedStyle.display === "grid" || computedStyle.display === "inline-grid") delete computedStyle.display;
2585
2585
  delete computedStyle.gridTemplateColumns;
2586
2586
  delete computedStyle.gridTemplateRows;
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-L3IEKX5I.mjs";
6
- import "./chunk-5GHUWO2A.mjs";
5
+ } from "./chunk-NM6ISARQ.mjs";
6
+ import "./chunk-AW3HK2B4.mjs";
7
7
 
8
8
  // src/jsx-dev-runtime.tsx
9
9
  function jsxDEV(type, props, key, isStaticChildren, _source, _self) {
@@ -1604,7 +1604,7 @@ var RESOLVERS = {
1604
1604
  },
1605
1605
  // ── Grid (responsive column count: grid-1 … grid-12) ─────────────────────
1606
1606
  grid: ({ value }) => {
1607
- if (!value || typeof document === "undefined") return null;
1607
+ if (!value) return null;
1608
1608
  const n = parseInt(value, 10);
1609
1609
  if (isNaN(n) || n < 1 || n > 12) return null;
1610
1610
  return { display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` };
@@ -1869,10 +1869,10 @@ function resolveUtility(parsed, theme) {
1869
1869
  if (!parsed.value) {
1870
1870
  if (parsed.utility in PLUGIN_STANDALONE) return PLUGIN_STANDALONE[parsed.utility] ?? null;
1871
1871
  if (parsed.utility === "grd" || parsed.utility === "grid") {
1872
- return typeof document !== "undefined" ? { display: "grid" } : null;
1872
+ return { display: "grid" };
1873
1873
  }
1874
1874
  if (parsed.utility === "inline-grid") {
1875
- return typeof document !== "undefined" ? { display: "inline-grid" } : null;
1875
+ return { display: "inline-grid" };
1876
1876
  }
1877
1877
  if (parsed.utility in STANDALONE) return STANDALONE[parsed.utility] ?? null;
1878
1878
  }
@@ -2406,7 +2406,7 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
2406
2406
  const computedStyle = (0, import_react3.useMemo)(
2407
2407
  () => {
2408
2408
  const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints);
2409
- if (isWeb && typeof Component !== "string") {
2409
+ if (typeof Component !== "string") {
2410
2410
  if (s.display === "grid" || s.display === "inline-grid") delete s.display;
2411
2411
  delete s.gridTemplateColumns;
2412
2412
  delete s.gridTemplateRows;
@@ -2460,7 +2460,7 @@ var DarkWrapper = import_react4.default.forwardRef(
2460
2460
  const width = useConditionalWidth(needsWidth);
2461
2461
  const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
2462
2462
  const computedStyle = flatten(resolvedStyle, isDark, {}, breakpoints);
2463
- if (isWeb && typeof Component !== "string") stripWebGridProps(computedStyle);
2463
+ if (typeof Component !== "string") stripWebGridProps(computedStyle);
2464
2464
  const finalStyle = styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
2465
2465
  const props = { ref, ...rest, style: finalStyle };
2466
2466
  return Array.isArray(children) ? import_react4.default.createElement(Component, props, ...children) : import_react4.default.createElement(Component, props, children);
@@ -2555,7 +2555,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
2555
2555
  return makeElement(isStaticChildren, type, rawProps, key);
2556
2556
  }
2557
2557
  const config = getConfig();
2558
- const isGrdOnWeb = isWeb && classStr != null && /(?:^|\s)grd(?:\s|$)/.test(classStr);
2558
+ const isGrdOnWeb = typeof document !== "undefined" && classStr != null && /(?:^|\s)grd(?:\s|$)/.test(classStr);
2559
2559
  const actualType = isGrdOnWeb ? "div" : type;
2560
2560
  const resolved = __kbachStyles ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
2561
2561
  const { style: userStyle, ...passProps } = omitConsumed(rawProps);
@@ -2579,7 +2579,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
2579
2579
  }, key);
2580
2580
  }
2581
2581
  const computedStyle = flatten(resolved, false);
2582
- if (isWeb && typeof actualType !== "string") {
2582
+ if (typeof actualType !== "string") {
2583
2583
  if (computedStyle.display === "grid" || computedStyle.display === "inline-grid") delete computedStyle.display;
2584
2584
  delete computedStyle.gridTemplateColumns;
2585
2585
  delete computedStyle.gridTemplateRows;
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-L3IEKX5I.mjs";
6
- import "./chunk-5GHUWO2A.mjs";
5
+ } from "./chunk-NM6ISARQ.mjs";
6
+ import "./chunk-AW3HK2B4.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.17",
3
+ "version": "0.3.19",
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",