@kbach/react 0.3.13 → 0.3.14

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-XL3F5GRY.mjs";
11
+ } from "./chunk-WPJY7X5I.mjs";
12
12
 
13
13
  // src/jsx-runtime.tsx
14
14
  import { jsx as _jsx, jsxs as _jsxs, Fragment } from "react/jsx-runtime";
@@ -32,12 +32,24 @@ 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) stripWebGridProps(computedStyle);
35
36
  const finalStyle = styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
36
37
  const props = { ref, ...rest, style: finalStyle };
37
38
  return Array.isArray(children) ? React.createElement(Component, props, ...children) : React.createElement(Component, props, children);
38
39
  }
39
40
  );
40
41
  DarkWrapper.displayName = "Kbach.DarkWrapper";
42
+ function stripWebGridProps(s) {
43
+ if (s.display === "grid" || s.display === "inline-grid") delete s.display;
44
+ delete s.gridTemplateColumns;
45
+ delete s.gridTemplateRows;
46
+ delete s.gridColumn;
47
+ delete s.gridRow;
48
+ delete s.gridArea;
49
+ delete s.gridAutoFlow;
50
+ delete s.gridAutoColumns;
51
+ delete s.gridAutoRows;
52
+ }
41
53
 
42
54
  // src/jsx-runtime.tsx
43
55
  var INTERACTIVE_MODS = /* @__PURE__ */ new Set([
@@ -137,6 +149,17 @@ function processElement(type, rawProps, key, isStaticChildren) {
137
149
  }, key);
138
150
  }
139
151
  const computedStyle = flatten(resolved, false);
152
+ if (isWeb) {
153
+ if (computedStyle.display === "grid" || computedStyle.display === "inline-grid") delete computedStyle.display;
154
+ delete computedStyle.gridTemplateColumns;
155
+ delete computedStyle.gridTemplateRows;
156
+ delete computedStyle.gridColumn;
157
+ delete computedStyle.gridRow;
158
+ delete computedStyle.gridArea;
159
+ delete computedStyle.gridAutoFlow;
160
+ delete computedStyle.gridAutoColumns;
161
+ delete computedStyle.gridAutoRows;
162
+ }
140
163
  const finalStyle = mergeStyle(computedStyle, userStyle);
141
164
  return makeElement(isStaticChildren, type, {
142
165
  ...passProps,
@@ -2414,7 +2414,21 @@ var InteractiveWrapper = forwardRef(
2414
2414
  const handleFocus = useCallback(chain(onFocus, () => setFocused(true)), [onFocus]);
2415
2415
  const handleBlur = useCallback(chain(onBlur, () => setFocused(false)), [onBlur]);
2416
2416
  const computedStyle = useMemo(
2417
- () => flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints),
2417
+ () => {
2418
+ const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints);
2419
+ if (isWeb) {
2420
+ if (s.display === "grid" || s.display === "inline-grid") delete s.display;
2421
+ delete s.gridTemplateColumns;
2422
+ delete s.gridTemplateRows;
2423
+ delete s.gridColumn;
2424
+ delete s.gridRow;
2425
+ delete s.gridArea;
2426
+ delete s.gridAutoFlow;
2427
+ delete s.gridAutoColumns;
2428
+ delete s.gridAutoRows;
2429
+ }
2430
+ return s;
2431
+ },
2418
2432
  [resolvedStyle, isDark, pressed, hovered, focused, width]
2419
2433
  // eslint-disable-line react-hooks/exhaustive-deps
2420
2434
  );
package/dist/index.js CHANGED
@@ -2918,7 +2918,21 @@ var InteractiveWrapper = (0, import_react9.forwardRef)(
2918
2918
  const handleFocus = (0, import_react9.useCallback)(chain(onFocus, () => setFocused(true)), [onFocus]);
2919
2919
  const handleBlur = (0, import_react9.useCallback)(chain(onBlur, () => setFocused(false)), [onBlur]);
2920
2920
  const computedStyle = (0, import_react9.useMemo)(
2921
- () => flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints),
2921
+ () => {
2922
+ const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints);
2923
+ if (isWeb) {
2924
+ if (s.display === "grid" || s.display === "inline-grid") delete s.display;
2925
+ delete s.gridTemplateColumns;
2926
+ delete s.gridTemplateRows;
2927
+ delete s.gridColumn;
2928
+ delete s.gridRow;
2929
+ delete s.gridArea;
2930
+ delete s.gridAutoFlow;
2931
+ delete s.gridAutoColumns;
2932
+ delete s.gridAutoRows;
2933
+ }
2934
+ return s;
2935
+ },
2922
2936
  [resolvedStyle, isDark, pressed, hovered, focused, width]
2923
2937
  // eslint-disable-line react-hooks/exhaustive-deps
2924
2938
  );
package/dist/index.mjs CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  updateConfig,
22
22
  useGlobalDarkMode,
23
23
  useGlobalWidth
24
- } from "./chunk-XL3F5GRY.mjs";
24
+ } from "./chunk-WPJY7X5I.mjs";
25
25
 
26
26
  // src/context.tsx
27
27
  import { createContext, useContext } from "react";
@@ -2397,7 +2397,21 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
2397
2397
  const handleFocus = (0, import_react3.useCallback)(chain(onFocus, () => setFocused(true)), [onFocus]);
2398
2398
  const handleBlur = (0, import_react3.useCallback)(chain(onBlur, () => setFocused(false)), [onBlur]);
2399
2399
  const computedStyle = (0, import_react3.useMemo)(
2400
- () => flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints),
2400
+ () => {
2401
+ const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints);
2402
+ if (isWeb) {
2403
+ if (s.display === "grid" || s.display === "inline-grid") delete s.display;
2404
+ delete s.gridTemplateColumns;
2405
+ delete s.gridTemplateRows;
2406
+ delete s.gridColumn;
2407
+ delete s.gridRow;
2408
+ delete s.gridArea;
2409
+ delete s.gridAutoFlow;
2410
+ delete s.gridAutoColumns;
2411
+ delete s.gridAutoRows;
2412
+ }
2413
+ return s;
2414
+ },
2401
2415
  [resolvedStyle, isDark, pressed, hovered, focused, width]
2402
2416
  // eslint-disable-line react-hooks/exhaustive-deps
2403
2417
  );
@@ -2439,12 +2453,24 @@ var DarkWrapper = import_react4.default.forwardRef(
2439
2453
  const width = useConditionalWidth(needsWidth);
2440
2454
  const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
2441
2455
  const computedStyle = flatten(resolvedStyle, isDark, {}, breakpoints);
2456
+ if (isWeb) stripWebGridProps(computedStyle);
2442
2457
  const finalStyle = styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
2443
2458
  const props = { ref, ...rest, style: finalStyle };
2444
2459
  return Array.isArray(children) ? import_react4.default.createElement(Component, props, ...children) : import_react4.default.createElement(Component, props, children);
2445
2460
  }
2446
2461
  );
2447
2462
  DarkWrapper.displayName = "Kbach.DarkWrapper";
2463
+ function stripWebGridProps(s) {
2464
+ if (s.display === "grid" || s.display === "inline-grid") delete s.display;
2465
+ delete s.gridTemplateColumns;
2466
+ delete s.gridTemplateRows;
2467
+ delete s.gridColumn;
2468
+ delete s.gridRow;
2469
+ delete s.gridArea;
2470
+ delete s.gridAutoFlow;
2471
+ delete s.gridAutoColumns;
2472
+ delete s.gridAutoRows;
2473
+ }
2448
2474
 
2449
2475
  // src/jsx-runtime.tsx
2450
2476
  var INTERACTIVE_MODS = /* @__PURE__ */ new Set([
@@ -2544,6 +2570,17 @@ function processElement(type, rawProps, key, isStaticChildren) {
2544
2570
  }, key);
2545
2571
  }
2546
2572
  const computedStyle = flatten(resolved, false);
2573
+ if (isWeb) {
2574
+ if (computedStyle.display === "grid" || computedStyle.display === "inline-grid") delete computedStyle.display;
2575
+ delete computedStyle.gridTemplateColumns;
2576
+ delete computedStyle.gridTemplateRows;
2577
+ delete computedStyle.gridColumn;
2578
+ delete computedStyle.gridRow;
2579
+ delete computedStyle.gridArea;
2580
+ delete computedStyle.gridAutoFlow;
2581
+ delete computedStyle.gridAutoColumns;
2582
+ delete computedStyle.gridAutoRows;
2583
+ }
2547
2584
  const finalStyle = mergeStyle(computedStyle, userStyle);
2548
2585
  return makeElement(isStaticChildren, type, {
2549
2586
  ...passProps,
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-BBWDCPU6.mjs";
6
- import "./chunk-XL3F5GRY.mjs";
5
+ } from "./chunk-R22W555P.mjs";
6
+ import "./chunk-WPJY7X5I.mjs";
7
7
 
8
8
  // src/jsx-dev-runtime.tsx
9
9
  function jsxDEV(type, props, key, isStaticChildren, _source, _self) {
@@ -2396,7 +2396,21 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
2396
2396
  const handleFocus = (0, import_react3.useCallback)(chain(onFocus, () => setFocused(true)), [onFocus]);
2397
2397
  const handleBlur = (0, import_react3.useCallback)(chain(onBlur, () => setFocused(false)), [onBlur]);
2398
2398
  const computedStyle = (0, import_react3.useMemo)(
2399
- () => flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints),
2399
+ () => {
2400
+ const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints);
2401
+ if (isWeb) {
2402
+ if (s.display === "grid" || s.display === "inline-grid") delete s.display;
2403
+ delete s.gridTemplateColumns;
2404
+ delete s.gridTemplateRows;
2405
+ delete s.gridColumn;
2406
+ delete s.gridRow;
2407
+ delete s.gridArea;
2408
+ delete s.gridAutoFlow;
2409
+ delete s.gridAutoColumns;
2410
+ delete s.gridAutoRows;
2411
+ }
2412
+ return s;
2413
+ },
2400
2414
  [resolvedStyle, isDark, pressed, hovered, focused, width]
2401
2415
  // eslint-disable-line react-hooks/exhaustive-deps
2402
2416
  );
@@ -2438,12 +2452,24 @@ var DarkWrapper = import_react4.default.forwardRef(
2438
2452
  const width = useConditionalWidth(needsWidth);
2439
2453
  const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
2440
2454
  const computedStyle = flatten(resolvedStyle, isDark, {}, breakpoints);
2455
+ if (isWeb) stripWebGridProps(computedStyle);
2441
2456
  const finalStyle = styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
2442
2457
  const props = { ref, ...rest, style: finalStyle };
2443
2458
  return Array.isArray(children) ? import_react4.default.createElement(Component, props, ...children) : import_react4.default.createElement(Component, props, children);
2444
2459
  }
2445
2460
  );
2446
2461
  DarkWrapper.displayName = "Kbach.DarkWrapper";
2462
+ function stripWebGridProps(s) {
2463
+ if (s.display === "grid" || s.display === "inline-grid") delete s.display;
2464
+ delete s.gridTemplateColumns;
2465
+ delete s.gridTemplateRows;
2466
+ delete s.gridColumn;
2467
+ delete s.gridRow;
2468
+ delete s.gridArea;
2469
+ delete s.gridAutoFlow;
2470
+ delete s.gridAutoColumns;
2471
+ delete s.gridAutoRows;
2472
+ }
2447
2473
 
2448
2474
  // src/jsx-runtime.tsx
2449
2475
  var INTERACTIVE_MODS = /* @__PURE__ */ new Set([
@@ -2543,6 +2569,17 @@ function processElement(type, rawProps, key, isStaticChildren) {
2543
2569
  }, key);
2544
2570
  }
2545
2571
  const computedStyle = flatten(resolved, false);
2572
+ if (isWeb) {
2573
+ if (computedStyle.display === "grid" || computedStyle.display === "inline-grid") delete computedStyle.display;
2574
+ delete computedStyle.gridTemplateColumns;
2575
+ delete computedStyle.gridTemplateRows;
2576
+ delete computedStyle.gridColumn;
2577
+ delete computedStyle.gridRow;
2578
+ delete computedStyle.gridArea;
2579
+ delete computedStyle.gridAutoFlow;
2580
+ delete computedStyle.gridAutoColumns;
2581
+ delete computedStyle.gridAutoRows;
2582
+ }
2546
2583
  const finalStyle = mergeStyle(computedStyle, userStyle);
2547
2584
  return makeElement(isStaticChildren, type, {
2548
2585
  ...passProps,
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-BBWDCPU6.mjs";
6
- import "./chunk-XL3F5GRY.mjs";
5
+ } from "./chunk-R22W555P.mjs";
6
+ import "./chunk-WPJY7X5I.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.13",
3
+ "version": "0.3.14",
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",