@kbach/react 0.4.0 → 0.4.1

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.
@@ -2160,7 +2160,7 @@ function styleValueToCSS(styles) {
2160
2160
  } else {
2161
2161
  cssVal = String(val);
2162
2162
  }
2163
- const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") ? " !important" : "";
2163
+ const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") || prop === "position" && (cssVal === "sticky" || cssVal === "fixed" || cssVal === "static") ? " !important" : "";
2164
2164
  return `${cssProp}: ${cssVal}${important}`;
2165
2165
  }).join("; ");
2166
2166
  }
@@ -2562,6 +2562,9 @@ var InteractiveWrapper = forwardRef(
2562
2562
  delete s.gridAutoFlow;
2563
2563
  delete s.gridAutoColumns;
2564
2564
  delete s.gridAutoRows;
2565
+ if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
2566
+ delete s.position;
2567
+ }
2565
2568
  }
2566
2569
  return s;
2567
2570
  },
@@ -8,7 +8,7 @@ import {
8
8
  resolve,
9
9
  useConditionalWidth,
10
10
  useGlobalDarkMode
11
- } from "./chunk-QXJ6A5GS.mjs";
11
+ } from "./chunk-HY6PU2XS.mjs";
12
12
 
13
13
  // src/jsx-runtime.tsx
14
14
  import { jsx as _jsx, jsxs as _jsxs, Fragment } from "react/jsx-runtime";
@@ -32,14 +32,14 @@ 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 (typeof Component !== "string") stripWebGridProps(computedStyle);
35
+ if (typeof Component !== "string") stripWebOnlyProps(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);
39
39
  }
40
40
  );
41
41
  DarkWrapper.displayName = "Kbach.DarkWrapper";
42
- function stripWebGridProps(s) {
42
+ function stripWebOnlyProps(s) {
43
43
  if (s.display === "grid" || s.display === "inline-grid") delete s.display;
44
44
  delete s.gridTemplateColumns;
45
45
  delete s.gridTemplateRows;
@@ -49,6 +49,9 @@ function stripWebGridProps(s) {
49
49
  delete s.gridAutoFlow;
50
50
  delete s.gridAutoColumns;
51
51
  delete s.gridAutoRows;
52
+ if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
53
+ delete s.position;
54
+ }
52
55
  }
53
56
 
54
57
  // src/jsx-runtime.tsx
@@ -161,6 +164,9 @@ function processElement(type, rawProps, key, isStaticChildren) {
161
164
  delete computedStyle.gridAutoFlow;
162
165
  delete computedStyle.gridAutoColumns;
163
166
  delete computedStyle.gridAutoRows;
167
+ if (computedStyle.position === "sticky" || computedStyle.position === "fixed" || computedStyle.position === "static") {
168
+ delete computedStyle.position;
169
+ }
164
170
  }
165
171
  const finalStyle = mergeStyle(computedStyle, userStyle);
166
172
  return makeElement(isStaticChildren, actualType, {
package/dist/index.js CHANGED
@@ -2290,7 +2290,7 @@ function styleValueToCSS(styles) {
2290
2290
  } else {
2291
2291
  cssVal = String(val);
2292
2292
  }
2293
- const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") ? " !important" : "";
2293
+ const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") || prop === "position" && (cssVal === "sticky" || cssVal === "fixed" || cssVal === "static") ? " !important" : "";
2294
2294
  return `${cssProp}: ${cssVal}${important}`;
2295
2295
  }).join("; ");
2296
2296
  }
@@ -3066,6 +3066,9 @@ var InteractiveWrapper = (0, import_react9.forwardRef)(
3066
3066
  delete s.gridAutoFlow;
3067
3067
  delete s.gridAutoColumns;
3068
3068
  delete s.gridAutoRows;
3069
+ if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
3070
+ delete s.position;
3071
+ }
3069
3072
  }
3070
3073
  return s;
3071
3074
  },
package/dist/index.mjs CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  updateConfig,
22
22
  useGlobalDarkMode,
23
23
  useGlobalWidth
24
- } from "./chunk-QXJ6A5GS.mjs";
24
+ } from "./chunk-HY6PU2XS.mjs";
25
25
 
26
26
  // src/context.tsx
27
27
  import { createContext, useContext } from "react";
@@ -2181,7 +2181,7 @@ function styleValueToCSS(styles) {
2181
2181
  } else {
2182
2182
  cssVal = String(val);
2183
2183
  }
2184
- const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") ? " !important" : "";
2184
+ const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") || prop === "position" && (cssVal === "sticky" || cssVal === "fixed" || cssVal === "static") ? " !important" : "";
2185
2185
  return `${cssProp}: ${cssVal}${important}`;
2186
2186
  }).join("; ");
2187
2187
  }
@@ -2545,6 +2545,9 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
2545
2545
  delete s.gridAutoFlow;
2546
2546
  delete s.gridAutoColumns;
2547
2547
  delete s.gridAutoRows;
2548
+ if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
2549
+ delete s.position;
2550
+ }
2548
2551
  }
2549
2552
  return s;
2550
2553
  },
@@ -2589,14 +2592,14 @@ var DarkWrapper = import_react4.default.forwardRef(
2589
2592
  const width = useConditionalWidth(needsWidth);
2590
2593
  const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
2591
2594
  const computedStyle = flatten(resolvedStyle, isDark, {}, breakpoints);
2592
- if (typeof Component !== "string") stripWebGridProps(computedStyle);
2595
+ if (typeof Component !== "string") stripWebOnlyProps(computedStyle);
2593
2596
  const finalStyle = styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
2594
2597
  const props = { ref, ...rest, style: finalStyle };
2595
2598
  return Array.isArray(children) ? import_react4.default.createElement(Component, props, ...children) : import_react4.default.createElement(Component, props, children);
2596
2599
  }
2597
2600
  );
2598
2601
  DarkWrapper.displayName = "Kbach.DarkWrapper";
2599
- function stripWebGridProps(s) {
2602
+ function stripWebOnlyProps(s) {
2600
2603
  if (s.display === "grid" || s.display === "inline-grid") delete s.display;
2601
2604
  delete s.gridTemplateColumns;
2602
2605
  delete s.gridTemplateRows;
@@ -2606,6 +2609,9 @@ function stripWebGridProps(s) {
2606
2609
  delete s.gridAutoFlow;
2607
2610
  delete s.gridAutoColumns;
2608
2611
  delete s.gridAutoRows;
2612
+ if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
2613
+ delete s.position;
2614
+ }
2609
2615
  }
2610
2616
 
2611
2617
  // src/jsx-runtime.tsx
@@ -2718,6 +2724,9 @@ function processElement(type, rawProps, key, isStaticChildren) {
2718
2724
  delete computedStyle.gridAutoFlow;
2719
2725
  delete computedStyle.gridAutoColumns;
2720
2726
  delete computedStyle.gridAutoRows;
2727
+ if (computedStyle.position === "sticky" || computedStyle.position === "fixed" || computedStyle.position === "static") {
2728
+ delete computedStyle.position;
2729
+ }
2721
2730
  }
2722
2731
  const finalStyle = mergeStyle(computedStyle, userStyle);
2723
2732
  return makeElement(isStaticChildren, actualType, {
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-QVZTZMJ7.mjs";
6
- import "./chunk-QXJ6A5GS.mjs";
5
+ } from "./chunk-V5WMKNJC.mjs";
6
+ import "./chunk-HY6PU2XS.mjs";
7
7
 
8
8
  // src/jsx-dev-runtime.tsx
9
9
  function jsxDEV(type, props, key, isStaticChildren, _source, _self) {
@@ -2180,7 +2180,7 @@ function styleValueToCSS(styles) {
2180
2180
  } else {
2181
2181
  cssVal = String(val);
2182
2182
  }
2183
- const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") ? " !important" : "";
2183
+ const important = prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") || prop === "position" && (cssVal === "sticky" || cssVal === "fixed" || cssVal === "static") ? " !important" : "";
2184
2184
  return `${cssProp}: ${cssVal}${important}`;
2185
2185
  }).join("; ");
2186
2186
  }
@@ -2544,6 +2544,9 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
2544
2544
  delete s.gridAutoFlow;
2545
2545
  delete s.gridAutoColumns;
2546
2546
  delete s.gridAutoRows;
2547
+ if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
2548
+ delete s.position;
2549
+ }
2547
2550
  }
2548
2551
  return s;
2549
2552
  },
@@ -2588,14 +2591,14 @@ var DarkWrapper = import_react4.default.forwardRef(
2588
2591
  const width = useConditionalWidth(needsWidth);
2589
2592
  const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
2590
2593
  const computedStyle = flatten(resolvedStyle, isDark, {}, breakpoints);
2591
- if (typeof Component !== "string") stripWebGridProps(computedStyle);
2594
+ if (typeof Component !== "string") stripWebOnlyProps(computedStyle);
2592
2595
  const finalStyle = styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
2593
2596
  const props = { ref, ...rest, style: finalStyle };
2594
2597
  return Array.isArray(children) ? import_react4.default.createElement(Component, props, ...children) : import_react4.default.createElement(Component, props, children);
2595
2598
  }
2596
2599
  );
2597
2600
  DarkWrapper.displayName = "Kbach.DarkWrapper";
2598
- function stripWebGridProps(s) {
2601
+ function stripWebOnlyProps(s) {
2599
2602
  if (s.display === "grid" || s.display === "inline-grid") delete s.display;
2600
2603
  delete s.gridTemplateColumns;
2601
2604
  delete s.gridTemplateRows;
@@ -2605,6 +2608,9 @@ function stripWebGridProps(s) {
2605
2608
  delete s.gridAutoFlow;
2606
2609
  delete s.gridAutoColumns;
2607
2610
  delete s.gridAutoRows;
2611
+ if (s.position === "sticky" || s.position === "fixed" || s.position === "static") {
2612
+ delete s.position;
2613
+ }
2608
2614
  }
2609
2615
 
2610
2616
  // src/jsx-runtime.tsx
@@ -2717,6 +2723,9 @@ function processElement(type, rawProps, key, isStaticChildren) {
2717
2723
  delete computedStyle.gridAutoFlow;
2718
2724
  delete computedStyle.gridAutoColumns;
2719
2725
  delete computedStyle.gridAutoRows;
2726
+ if (computedStyle.position === "sticky" || computedStyle.position === "fixed" || computedStyle.position === "static") {
2727
+ delete computedStyle.position;
2728
+ }
2720
2729
  }
2721
2730
  const finalStyle = mergeStyle(computedStyle, userStyle);
2722
2731
  return makeElement(isStaticChildren, actualType, {
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-QVZTZMJ7.mjs";
6
- import "./chunk-QXJ6A5GS.mjs";
5
+ } from "./chunk-V5WMKNJC.mjs";
6
+ import "./chunk-HY6PU2XS.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.4.0",
3
+ "version": "0.4.1",
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",