@kbach/react 0.4.0 → 0.4.2
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.
- package/dist/{chunk-QXJ6A5GS.mjs → chunk-HY6PU2XS.mjs} +4 -1
- package/dist/{chunk-QVZTZMJ7.mjs → chunk-JFQ7QYQM.mjs} +13 -5
- package/dist/index.js +4 -1
- package/dist/index.mjs +1 -1
- package/dist/jsx-dev-runtime.js +16 -5
- package/dist/jsx-dev-runtime.mjs +2 -2
- package/dist/jsx-runtime.js +16 -5
- package/dist/jsx-runtime.mjs +2 -2
- package/package.json +1 -1
|
@@ -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-
|
|
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")
|
|
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
|
|
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
|
|
@@ -127,8 +130,10 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
127
130
|
return makeElement(isStaticChildren, type, rawProps, key);
|
|
128
131
|
}
|
|
129
132
|
const config = getConfig();
|
|
130
|
-
const
|
|
131
|
-
const
|
|
133
|
+
const isOnWeb = typeof document !== "undefined" && classStr != null;
|
|
134
|
+
const isGrdOnWeb = isOnWeb && /(?:^|\s)grd(?:\s|$)/.test(classStr);
|
|
135
|
+
const hasWebPosition = isOnWeb && /(?:^|\s)(?:[\w-]+:)*(?:fixed|sticky)(?:\s|$)/.test(classStr);
|
|
136
|
+
const actualType = isGrdOnWeb || hasWebPosition ? "div" : type;
|
|
132
137
|
const resolved = __kbachStyles ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
|
|
133
138
|
const { style: userStyle, ...passProps } = omitConsumed(rawProps);
|
|
134
139
|
const { interactive, modeOrResponsive } = bucketMods(resolved);
|
|
@@ -161,6 +166,9 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
161
166
|
delete computedStyle.gridAutoFlow;
|
|
162
167
|
delete computedStyle.gridAutoColumns;
|
|
163
168
|
delete computedStyle.gridAutoRows;
|
|
169
|
+
if (computedStyle.position === "sticky" || computedStyle.position === "fixed" || computedStyle.position === "static") {
|
|
170
|
+
delete computedStyle.position;
|
|
171
|
+
}
|
|
164
172
|
}
|
|
165
173
|
const finalStyle = mergeStyle(computedStyle, userStyle);
|
|
166
174
|
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
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -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")
|
|
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
|
|
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
|
|
@@ -2684,8 +2690,10 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2684
2690
|
return makeElement(isStaticChildren, type, rawProps, key);
|
|
2685
2691
|
}
|
|
2686
2692
|
const config = getConfig();
|
|
2687
|
-
const
|
|
2688
|
-
const
|
|
2693
|
+
const isOnWeb = typeof document !== "undefined" && classStr != null;
|
|
2694
|
+
const isGrdOnWeb = isOnWeb && /(?:^|\s)grd(?:\s|$)/.test(classStr);
|
|
2695
|
+
const hasWebPosition = isOnWeb && /(?:^|\s)(?:[\w-]+:)*(?:fixed|sticky)(?:\s|$)/.test(classStr);
|
|
2696
|
+
const actualType = isGrdOnWeb || hasWebPosition ? "div" : type;
|
|
2689
2697
|
const resolved = __kbachStyles ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
|
|
2690
2698
|
const { style: userStyle, ...passProps } = omitConsumed(rawProps);
|
|
2691
2699
|
const { interactive, modeOrResponsive } = bucketMods(resolved);
|
|
@@ -2718,6 +2726,9 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2718
2726
|
delete computedStyle.gridAutoFlow;
|
|
2719
2727
|
delete computedStyle.gridAutoColumns;
|
|
2720
2728
|
delete computedStyle.gridAutoRows;
|
|
2729
|
+
if (computedStyle.position === "sticky" || computedStyle.position === "fixed" || computedStyle.position === "static") {
|
|
2730
|
+
delete computedStyle.position;
|
|
2731
|
+
}
|
|
2721
2732
|
}
|
|
2722
2733
|
const finalStyle = mergeStyle(computedStyle, userStyle);
|
|
2723
2734
|
return makeElement(isStaticChildren, actualType, {
|
package/dist/jsx-dev-runtime.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
Fragment,
|
|
3
3
|
jsx,
|
|
4
4
|
jsxs
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-JFQ7QYQM.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) {
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -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")
|
|
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
|
|
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
|
|
@@ -2683,8 +2689,10 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2683
2689
|
return makeElement(isStaticChildren, type, rawProps, key);
|
|
2684
2690
|
}
|
|
2685
2691
|
const config = getConfig();
|
|
2686
|
-
const
|
|
2687
|
-
const
|
|
2692
|
+
const isOnWeb = typeof document !== "undefined" && classStr != null;
|
|
2693
|
+
const isGrdOnWeb = isOnWeb && /(?:^|\s)grd(?:\s|$)/.test(classStr);
|
|
2694
|
+
const hasWebPosition = isOnWeb && /(?:^|\s)(?:[\w-]+:)*(?:fixed|sticky)(?:\s|$)/.test(classStr);
|
|
2695
|
+
const actualType = isGrdOnWeb || hasWebPosition ? "div" : type;
|
|
2688
2696
|
const resolved = __kbachStyles ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
|
|
2689
2697
|
const { style: userStyle, ...passProps } = omitConsumed(rawProps);
|
|
2690
2698
|
const { interactive, modeOrResponsive } = bucketMods(resolved);
|
|
@@ -2717,6 +2725,9 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2717
2725
|
delete computedStyle.gridAutoFlow;
|
|
2718
2726
|
delete computedStyle.gridAutoColumns;
|
|
2719
2727
|
delete computedStyle.gridAutoRows;
|
|
2728
|
+
if (computedStyle.position === "sticky" || computedStyle.position === "fixed" || computedStyle.position === "static") {
|
|
2729
|
+
delete computedStyle.position;
|
|
2730
|
+
}
|
|
2720
2731
|
}
|
|
2721
2732
|
const finalStyle = mergeStyle(computedStyle, userStyle);
|
|
2722
2733
|
return makeElement(isStaticChildren, actualType, {
|
package/dist/jsx-runtime.mjs
CHANGED