@kbach/react 0.3.14 → 0.3.16
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-R22W555P.mjs → chunk-7DGFJPDP.mjs} +8 -6
- package/dist/{chunk-WPJY7X5I.mjs → chunk-PDPOXGSG.mjs} +3 -1
- package/dist/index.js +3 -1
- package/dist/index.mjs +1 -1
- package/dist/jsx-dev-runtime.js +10 -6
- package/dist/jsx-dev-runtime.mjs +2 -2
- package/dist/jsx-runtime.js +10 -6
- package/dist/jsx-runtime.mjs +2 -2
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
resolve,
|
|
9
9
|
useConditionalWidth,
|
|
10
10
|
useGlobalDarkMode
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PDPOXGSG.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) stripWebGridProps(computedStyle);
|
|
35
|
+
if (isWeb && 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,12 +127,14 @@ 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);
|
|
131
|
+
const actualType = isGrdOnWeb ? "div" : type;
|
|
130
132
|
const resolved = __kbachStyles ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
|
|
131
133
|
const { style: userStyle, ...passProps } = omitConsumed(rawProps);
|
|
132
134
|
const { interactive, modeOrResponsive } = bucketMods(resolved);
|
|
133
135
|
if (interactive) {
|
|
134
136
|
return _jsx(InteractiveWrapper, {
|
|
135
|
-
Component:
|
|
137
|
+
Component: actualType,
|
|
136
138
|
resolvedStyle: resolved,
|
|
137
139
|
...isWeb && classStr ? { className: classStr } : {},
|
|
138
140
|
style: userStyle,
|
|
@@ -141,7 +143,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
141
143
|
}
|
|
142
144
|
if (modeOrResponsive) {
|
|
143
145
|
return _jsx(DarkWrapper, {
|
|
144
|
-
Component:
|
|
146
|
+
Component: actualType,
|
|
145
147
|
resolvedStyle: resolved,
|
|
146
148
|
...isWeb && classStr ? { className: classStr } : {},
|
|
147
149
|
style: userStyle,
|
|
@@ -149,7 +151,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
149
151
|
}, key);
|
|
150
152
|
}
|
|
151
153
|
const computedStyle = flatten(resolved, false);
|
|
152
|
-
if (isWeb) {
|
|
154
|
+
if (isWeb && typeof actualType !== "string") {
|
|
153
155
|
if (computedStyle.display === "grid" || computedStyle.display === "inline-grid") delete computedStyle.display;
|
|
154
156
|
delete computedStyle.gridTemplateColumns;
|
|
155
157
|
delete computedStyle.gridTemplateRows;
|
|
@@ -161,7 +163,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
161
163
|
delete computedStyle.gridAutoRows;
|
|
162
164
|
}
|
|
163
165
|
const finalStyle = mergeStyle(computedStyle, userStyle);
|
|
164
|
-
return makeElement(isStaticChildren,
|
|
166
|
+
return makeElement(isStaticChildren, actualType, {
|
|
165
167
|
...passProps,
|
|
166
168
|
style: finalStyle,
|
|
167
169
|
...isWeb && classStr ? { className: classStr } : {}
|
|
@@ -829,6 +829,7 @@ var STANDALONE_UTILITIES = /* @__PURE__ */ new Set([
|
|
|
829
829
|
"grid",
|
|
830
830
|
"inline-flex",
|
|
831
831
|
"inline-grid",
|
|
832
|
+
"grd",
|
|
832
833
|
"hidden",
|
|
833
834
|
"contents",
|
|
834
835
|
"flow-root",
|
|
@@ -1142,6 +1143,7 @@ var STANDALONE = {
|
|
|
1142
1143
|
"inline-block": isWeb ? { display: "inline-block" } : null,
|
|
1143
1144
|
inline: isWeb ? { display: "inline" } : null,
|
|
1144
1145
|
grid: isWeb ? { display: "grid" } : null,
|
|
1146
|
+
grd: isWeb ? { display: "grid" } : null,
|
|
1145
1147
|
"inline-flex": { display: isWeb ? "inline-flex" : "flex" },
|
|
1146
1148
|
"inline-grid": isWeb ? { display: "inline-grid" } : null,
|
|
1147
1149
|
hidden: { display: "none" },
|
|
@@ -2416,7 +2418,7 @@ var InteractiveWrapper = forwardRef(
|
|
|
2416
2418
|
const computedStyle = useMemo(
|
|
2417
2419
|
() => {
|
|
2418
2420
|
const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints);
|
|
2419
|
-
if (isWeb) {
|
|
2421
|
+
if (isWeb && typeof Component !== "string") {
|
|
2420
2422
|
if (s.display === "grid" || s.display === "inline-grid") delete s.display;
|
|
2421
2423
|
delete s.gridTemplateColumns;
|
|
2422
2424
|
delete s.gridTemplateRows;
|
package/dist/index.js
CHANGED
|
@@ -995,6 +995,7 @@ var STANDALONE_UTILITIES = /* @__PURE__ */ new Set([
|
|
|
995
995
|
"grid",
|
|
996
996
|
"inline-flex",
|
|
997
997
|
"inline-grid",
|
|
998
|
+
"grd",
|
|
998
999
|
"hidden",
|
|
999
1000
|
"contents",
|
|
1000
1001
|
"flow-root",
|
|
@@ -1308,6 +1309,7 @@ var STANDALONE = {
|
|
|
1308
1309
|
"inline-block": isWeb ? { display: "inline-block" } : null,
|
|
1309
1310
|
inline: isWeb ? { display: "inline" } : null,
|
|
1310
1311
|
grid: isWeb ? { display: "grid" } : null,
|
|
1312
|
+
grd: isWeb ? { display: "grid" } : null,
|
|
1311
1313
|
"inline-flex": { display: isWeb ? "inline-flex" : "flex" },
|
|
1312
1314
|
"inline-grid": isWeb ? { display: "inline-grid" } : null,
|
|
1313
1315
|
hidden: { display: "none" },
|
|
@@ -2920,7 +2922,7 @@ var InteractiveWrapper = (0, import_react9.forwardRef)(
|
|
|
2920
2922
|
const computedStyle = (0, import_react9.useMemo)(
|
|
2921
2923
|
() => {
|
|
2922
2924
|
const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints);
|
|
2923
|
-
if (isWeb) {
|
|
2925
|
+
if (isWeb && typeof Component !== "string") {
|
|
2924
2926
|
if (s.display === "grid" || s.display === "inline-grid") delete s.display;
|
|
2925
2927
|
delete s.gridTemplateColumns;
|
|
2926
2928
|
delete s.gridTemplateRows;
|
package/dist/index.mjs
CHANGED
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -898,6 +898,7 @@ var STANDALONE_UTILITIES = /* @__PURE__ */ new Set([
|
|
|
898
898
|
"grid",
|
|
899
899
|
"inline-flex",
|
|
900
900
|
"inline-grid",
|
|
901
|
+
"grd",
|
|
901
902
|
"hidden",
|
|
902
903
|
"contents",
|
|
903
904
|
"flow-root",
|
|
@@ -1211,6 +1212,7 @@ var STANDALONE = {
|
|
|
1211
1212
|
"inline-block": isWeb ? { display: "inline-block" } : null,
|
|
1212
1213
|
inline: isWeb ? { display: "inline" } : null,
|
|
1213
1214
|
grid: isWeb ? { display: "grid" } : null,
|
|
1215
|
+
grd: isWeb ? { display: "grid" } : null,
|
|
1214
1216
|
"inline-flex": { display: isWeb ? "inline-flex" : "flex" },
|
|
1215
1217
|
"inline-grid": isWeb ? { display: "inline-grid" } : null,
|
|
1216
1218
|
hidden: { display: "none" },
|
|
@@ -2399,7 +2401,7 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
|
|
|
2399
2401
|
const computedStyle = (0, import_react3.useMemo)(
|
|
2400
2402
|
() => {
|
|
2401
2403
|
const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints);
|
|
2402
|
-
if (isWeb) {
|
|
2404
|
+
if (isWeb && typeof Component !== "string") {
|
|
2403
2405
|
if (s.display === "grid" || s.display === "inline-grid") delete s.display;
|
|
2404
2406
|
delete s.gridTemplateColumns;
|
|
2405
2407
|
delete s.gridTemplateRows;
|
|
@@ -2453,7 +2455,7 @@ var DarkWrapper = import_react4.default.forwardRef(
|
|
|
2453
2455
|
const width = useConditionalWidth(needsWidth);
|
|
2454
2456
|
const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
|
|
2455
2457
|
const computedStyle = flatten(resolvedStyle, isDark, {}, breakpoints);
|
|
2456
|
-
if (isWeb) stripWebGridProps(computedStyle);
|
|
2458
|
+
if (isWeb && typeof Component !== "string") stripWebGridProps(computedStyle);
|
|
2457
2459
|
const finalStyle = styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
|
|
2458
2460
|
const props = { ref, ...rest, style: finalStyle };
|
|
2459
2461
|
return Array.isArray(children) ? import_react4.default.createElement(Component, props, ...children) : import_react4.default.createElement(Component, props, children);
|
|
@@ -2548,12 +2550,14 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2548
2550
|
return makeElement(isStaticChildren, type, rawProps, key);
|
|
2549
2551
|
}
|
|
2550
2552
|
const config = getConfig();
|
|
2553
|
+
const isGrdOnWeb = isWeb && classStr != null && /(?:^|\s)grd(?:\s|$)/.test(classStr);
|
|
2554
|
+
const actualType = isGrdOnWeb ? "div" : type;
|
|
2551
2555
|
const resolved = __kbachStyles ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
|
|
2552
2556
|
const { style: userStyle, ...passProps } = omitConsumed(rawProps);
|
|
2553
2557
|
const { interactive, modeOrResponsive } = bucketMods(resolved);
|
|
2554
2558
|
if (interactive) {
|
|
2555
2559
|
return (0, import_jsx_runtime.jsx)(InteractiveWrapper, {
|
|
2556
|
-
Component:
|
|
2560
|
+
Component: actualType,
|
|
2557
2561
|
resolvedStyle: resolved,
|
|
2558
2562
|
...isWeb && classStr ? { className: classStr } : {},
|
|
2559
2563
|
style: userStyle,
|
|
@@ -2562,7 +2566,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2562
2566
|
}
|
|
2563
2567
|
if (modeOrResponsive) {
|
|
2564
2568
|
return (0, import_jsx_runtime.jsx)(DarkWrapper, {
|
|
2565
|
-
Component:
|
|
2569
|
+
Component: actualType,
|
|
2566
2570
|
resolvedStyle: resolved,
|
|
2567
2571
|
...isWeb && classStr ? { className: classStr } : {},
|
|
2568
2572
|
style: userStyle,
|
|
@@ -2570,7 +2574,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2570
2574
|
}, key);
|
|
2571
2575
|
}
|
|
2572
2576
|
const computedStyle = flatten(resolved, false);
|
|
2573
|
-
if (isWeb) {
|
|
2577
|
+
if (isWeb && typeof actualType !== "string") {
|
|
2574
2578
|
if (computedStyle.display === "grid" || computedStyle.display === "inline-grid") delete computedStyle.display;
|
|
2575
2579
|
delete computedStyle.gridTemplateColumns;
|
|
2576
2580
|
delete computedStyle.gridTemplateRows;
|
|
@@ -2582,7 +2586,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2582
2586
|
delete computedStyle.gridAutoRows;
|
|
2583
2587
|
}
|
|
2584
2588
|
const finalStyle = mergeStyle(computedStyle, userStyle);
|
|
2585
|
-
return makeElement(isStaticChildren,
|
|
2589
|
+
return makeElement(isStaticChildren, actualType, {
|
|
2586
2590
|
...passProps,
|
|
2587
2591
|
style: finalStyle,
|
|
2588
2592
|
...isWeb && classStr ? { className: classStr } : {}
|
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-7DGFJPDP.mjs";
|
|
6
|
+
import "./chunk-PDPOXGSG.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
|
@@ -897,6 +897,7 @@ var STANDALONE_UTILITIES = /* @__PURE__ */ new Set([
|
|
|
897
897
|
"grid",
|
|
898
898
|
"inline-flex",
|
|
899
899
|
"inline-grid",
|
|
900
|
+
"grd",
|
|
900
901
|
"hidden",
|
|
901
902
|
"contents",
|
|
902
903
|
"flow-root",
|
|
@@ -1210,6 +1211,7 @@ var STANDALONE = {
|
|
|
1210
1211
|
"inline-block": isWeb ? { display: "inline-block" } : null,
|
|
1211
1212
|
inline: isWeb ? { display: "inline" } : null,
|
|
1212
1213
|
grid: isWeb ? { display: "grid" } : null,
|
|
1214
|
+
grd: isWeb ? { display: "grid" } : null,
|
|
1213
1215
|
"inline-flex": { display: isWeb ? "inline-flex" : "flex" },
|
|
1214
1216
|
"inline-grid": isWeb ? { display: "inline-grid" } : null,
|
|
1215
1217
|
hidden: { display: "none" },
|
|
@@ -2398,7 +2400,7 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
|
|
|
2398
2400
|
const computedStyle = (0, import_react3.useMemo)(
|
|
2399
2401
|
() => {
|
|
2400
2402
|
const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused }, breakpoints);
|
|
2401
|
-
if (isWeb) {
|
|
2403
|
+
if (isWeb && typeof Component !== "string") {
|
|
2402
2404
|
if (s.display === "grid" || s.display === "inline-grid") delete s.display;
|
|
2403
2405
|
delete s.gridTemplateColumns;
|
|
2404
2406
|
delete s.gridTemplateRows;
|
|
@@ -2452,7 +2454,7 @@ var DarkWrapper = import_react4.default.forwardRef(
|
|
|
2452
2454
|
const width = useConditionalWidth(needsWidth);
|
|
2453
2455
|
const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
|
|
2454
2456
|
const computedStyle = flatten(resolvedStyle, isDark, {}, breakpoints);
|
|
2455
|
-
if (isWeb) stripWebGridProps(computedStyle);
|
|
2457
|
+
if (isWeb && typeof Component !== "string") stripWebGridProps(computedStyle);
|
|
2456
2458
|
const finalStyle = styleProp ? Array.isArray(styleProp) ? Object.assign({}, computedStyle, ...styleProp) : { ...computedStyle, ...styleProp } : computedStyle;
|
|
2457
2459
|
const props = { ref, ...rest, style: finalStyle };
|
|
2458
2460
|
return Array.isArray(children) ? import_react4.default.createElement(Component, props, ...children) : import_react4.default.createElement(Component, props, children);
|
|
@@ -2547,12 +2549,14 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2547
2549
|
return makeElement(isStaticChildren, type, rawProps, key);
|
|
2548
2550
|
}
|
|
2549
2551
|
const config = getConfig();
|
|
2552
|
+
const isGrdOnWeb = isWeb && classStr != null && /(?:^|\s)grd(?:\s|$)/.test(classStr);
|
|
2553
|
+
const actualType = isGrdOnWeb ? "div" : type;
|
|
2550
2554
|
const resolved = __kbachStyles ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
|
|
2551
2555
|
const { style: userStyle, ...passProps } = omitConsumed(rawProps);
|
|
2552
2556
|
const { interactive, modeOrResponsive } = bucketMods(resolved);
|
|
2553
2557
|
if (interactive) {
|
|
2554
2558
|
return (0, import_jsx_runtime.jsx)(InteractiveWrapper, {
|
|
2555
|
-
Component:
|
|
2559
|
+
Component: actualType,
|
|
2556
2560
|
resolvedStyle: resolved,
|
|
2557
2561
|
...isWeb && classStr ? { className: classStr } : {},
|
|
2558
2562
|
style: userStyle,
|
|
@@ -2561,7 +2565,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2561
2565
|
}
|
|
2562
2566
|
if (modeOrResponsive) {
|
|
2563
2567
|
return (0, import_jsx_runtime.jsx)(DarkWrapper, {
|
|
2564
|
-
Component:
|
|
2568
|
+
Component: actualType,
|
|
2565
2569
|
resolvedStyle: resolved,
|
|
2566
2570
|
...isWeb && classStr ? { className: classStr } : {},
|
|
2567
2571
|
style: userStyle,
|
|
@@ -2569,7 +2573,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2569
2573
|
}, key);
|
|
2570
2574
|
}
|
|
2571
2575
|
const computedStyle = flatten(resolved, false);
|
|
2572
|
-
if (isWeb) {
|
|
2576
|
+
if (isWeb && typeof actualType !== "string") {
|
|
2573
2577
|
if (computedStyle.display === "grid" || computedStyle.display === "inline-grid") delete computedStyle.display;
|
|
2574
2578
|
delete computedStyle.gridTemplateColumns;
|
|
2575
2579
|
delete computedStyle.gridTemplateRows;
|
|
@@ -2581,7 +2585,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
2581
2585
|
delete computedStyle.gridAutoRows;
|
|
2582
2586
|
}
|
|
2583
2587
|
const finalStyle = mergeStyle(computedStyle, userStyle);
|
|
2584
|
-
return makeElement(isStaticChildren,
|
|
2588
|
+
return makeElement(isStaticChildren, actualType, {
|
|
2585
2589
|
...passProps,
|
|
2586
2590
|
style: finalStyle,
|
|
2587
2591
|
...isWeb && classStr ? { className: classStr } : {}
|
package/dist/jsx-runtime.mjs
CHANGED