@kbach/react 0.5.49 → 0.5.51
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-KWB2XQSF.mjs → chunk-6YN6SRMN.mjs} +4 -3
- package/dist/{chunk-BKSXIWL7.mjs → chunk-JBV2R655.mjs} +5 -3
- package/dist/{chunk-3UUTNNWV.mjs → chunk-JVTA5SC3.mjs} +2 -1
- package/dist/index.js +7 -4
- package/dist/index.mjs +3 -3
- package/dist/jsx-dev-runtime.js +8 -4
- package/dist/jsx-dev-runtime.mjs +3 -3
- package/dist/jsx-runtime.js +8 -4
- package/dist/jsx-runtime.mjs +3 -3
- package/dist/vite-plugin.mjs +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
transformToWebProps,
|
|
7
7
|
useConditionalWidth,
|
|
8
8
|
useGlobalDarkMode
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JVTA5SC3.mjs";
|
|
10
10
|
import {
|
|
11
11
|
flatten,
|
|
12
12
|
getActiveBreakpoints,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
isWeb,
|
|
21
21
|
normalizeClassString,
|
|
22
22
|
resolve
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-JBV2R655.mjs";
|
|
24
24
|
|
|
25
25
|
// src/jsx-runtime.tsx
|
|
26
26
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -36,6 +36,7 @@ var DarkWrapper = React.forwardRef(
|
|
|
36
36
|
const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
|
|
37
37
|
const isNonStringComponent = typeof Component !== "string";
|
|
38
38
|
const computedStyle = useMemo(() => {
|
|
39
|
+
if (isWeb) return {};
|
|
39
40
|
const s = flatten(resolvedStyle, isDark, {}, breakpoints);
|
|
40
41
|
stripInternalMarkers(s);
|
|
41
42
|
if (isNonStringComponent) stripWebOnlyProps(s);
|
|
@@ -186,7 +187,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
186
187
|
return makeElement(isStaticChildren, effectiveType, { ...passProps2, style: finalStyle2 }, key);
|
|
187
188
|
}
|
|
188
189
|
const config = getConfig();
|
|
189
|
-
const resolved = __kbachStyles
|
|
190
|
+
const resolved = !isWeb && __kbachStyles != null ? __kbachStyles : classStr ? resolve(classStr, config.theme, config.darkMode) : {};
|
|
190
191
|
const { style: userStyle, ...passProps } = omitConsumed(workingProps);
|
|
191
192
|
const { interactive, modeOrResponsive } = bucketMods(resolved);
|
|
192
193
|
if (interactive) {
|
|
@@ -2805,9 +2805,11 @@ function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new
|
|
|
2805
2805
|
Object.assign(result, styles);
|
|
2806
2806
|
}
|
|
2807
2807
|
}
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2808
|
+
if (isNative) {
|
|
2809
|
+
const defaultFont = getDefaultFontFamily();
|
|
2810
|
+
if (defaultFont && !("fontFamily" in result)) {
|
|
2811
|
+
result.fontFamily = defaultFont;
|
|
2812
|
+
}
|
|
2811
2813
|
}
|
|
2812
2814
|
if (!isNative) {
|
|
2813
2815
|
const r = result;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
isNative,
|
|
8
8
|
isWeb,
|
|
9
9
|
subscribeGlobalWidth
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JBV2R655.mjs";
|
|
11
11
|
|
|
12
12
|
// src/core/darkModeStore.ts
|
|
13
13
|
var KEY = "__kbach_dark_store__";
|
|
@@ -260,6 +260,7 @@ var InteractiveWrapper = forwardRef(
|
|
|
260
260
|
const handleBlur = useCallback(chain(onBlur, () => setFocused(false)), [onBlur]);
|
|
261
261
|
const computedStyle = useMemo(
|
|
262
262
|
() => {
|
|
263
|
+
if (isWeb) return {};
|
|
263
264
|
const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused, disabled: !!rest.disabled, checked: !!rest.checked }, breakpoints);
|
|
264
265
|
delete s.__divideX;
|
|
265
266
|
delete s.__divideY;
|
package/dist/index.js
CHANGED
|
@@ -2933,9 +2933,11 @@ function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new
|
|
|
2933
2933
|
Object.assign(result, styles);
|
|
2934
2934
|
}
|
|
2935
2935
|
}
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2936
|
+
if (isNative) {
|
|
2937
|
+
const defaultFont = getDefaultFontFamily();
|
|
2938
|
+
if (defaultFont && !("fontFamily" in result)) {
|
|
2939
|
+
result.fontFamily = defaultFont;
|
|
2940
|
+
}
|
|
2939
2941
|
}
|
|
2940
2942
|
if (!isNative) {
|
|
2941
2943
|
const r = result;
|
|
@@ -3689,7 +3691,7 @@ function styled(Component, baseClasses = "") {
|
|
|
3689
3691
|
const width = useConditionalWidth(needsWidth);
|
|
3690
3692
|
const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
|
|
3691
3693
|
const computedStyle = (0, import_react6.useMemo)(
|
|
3692
|
-
() => flatten(resolved, isDark, { pressed, hover: hovered, focus: focused, disabled, checked }, breakpoints),
|
|
3694
|
+
() => isWeb ? {} : flatten(resolved, isDark, { pressed, hover: hovered, focus: focused, disabled, checked }, breakpoints),
|
|
3693
3695
|
[resolved, isDark, pressed, hovered, focused, disabled, checked, width]
|
|
3694
3696
|
// eslint-disable-line react-hooks/exhaustive-deps
|
|
3695
3697
|
);
|
|
@@ -3828,6 +3830,7 @@ var InteractiveWrapper = (0, import_react10.forwardRef)(
|
|
|
3828
3830
|
const handleBlur = (0, import_react10.useCallback)(chain(onBlur, () => setFocused(false)), [onBlur]);
|
|
3829
3831
|
const computedStyle = (0, import_react10.useMemo)(
|
|
3830
3832
|
() => {
|
|
3833
|
+
if (isWeb) return {};
|
|
3831
3834
|
const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused, disabled: !!rest.disabled, checked: !!rest.checked }, breakpoints);
|
|
3832
3835
|
delete s.__divideX;
|
|
3833
3836
|
delete s.__divideY;
|
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useConditionalWidth,
|
|
12
12
|
useGlobalDarkMode,
|
|
13
13
|
useGlobalWidth
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JVTA5SC3.mjs";
|
|
15
15
|
import {
|
|
16
16
|
__require,
|
|
17
17
|
buildConfig,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
syncGlobalScreens,
|
|
34
34
|
syncGlobalWidth,
|
|
35
35
|
updateConfig
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-JBV2R655.mjs";
|
|
37
37
|
|
|
38
38
|
// src/context.tsx
|
|
39
39
|
import { createContext, useContext } from "react";
|
|
@@ -476,7 +476,7 @@ function styled(Component, baseClasses = "") {
|
|
|
476
476
|
const width = useConditionalWidth(needsWidth);
|
|
477
477
|
const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
|
|
478
478
|
const computedStyle = useMemo3(
|
|
479
|
-
() => flatten(resolved, isDark, { pressed, hover: hovered, focus: focused, disabled, checked }, breakpoints),
|
|
479
|
+
() => isWeb ? {} : flatten(resolved, isDark, { pressed, hover: hovered, focus: focused, disabled, checked }, breakpoints),
|
|
480
480
|
[resolved, isDark, pressed, hovered, focused, disabled, checked, width]
|
|
481
481
|
// eslint-disable-line react-hooks/exhaustive-deps
|
|
482
482
|
);
|
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -2811,9 +2811,11 @@ function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new
|
|
|
2811
2811
|
Object.assign(result, styles);
|
|
2812
2812
|
}
|
|
2813
2813
|
}
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2814
|
+
if (isNative) {
|
|
2815
|
+
const defaultFont = getDefaultFontFamily();
|
|
2816
|
+
if (defaultFont && !("fontFamily" in result)) {
|
|
2817
|
+
result.fontFamily = defaultFont;
|
|
2818
|
+
}
|
|
2817
2819
|
}
|
|
2818
2820
|
if (!isNative) {
|
|
2819
2821
|
const r = result;
|
|
@@ -3147,6 +3149,7 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
|
|
|
3147
3149
|
const handleBlur = (0, import_react3.useCallback)(chain(onBlur, () => setFocused(false)), [onBlur]);
|
|
3148
3150
|
const computedStyle = (0, import_react3.useMemo)(
|
|
3149
3151
|
() => {
|
|
3152
|
+
if (isWeb) return {};
|
|
3150
3153
|
const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused, disabled: !!rest.disabled, checked: !!rest.checked }, breakpoints);
|
|
3151
3154
|
delete s.__divideX;
|
|
3152
3155
|
delete s.__divideY;
|
|
@@ -3212,6 +3215,7 @@ var DarkWrapper = import_react4.default.forwardRef(
|
|
|
3212
3215
|
const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS2;
|
|
3213
3216
|
const isNonStringComponent = typeof Component !== "string";
|
|
3214
3217
|
const computedStyle = (0, import_react4.useMemo)(() => {
|
|
3218
|
+
if (isWeb) return {};
|
|
3215
3219
|
const s = flatten(resolvedStyle, isDark, {}, breakpoints);
|
|
3216
3220
|
stripInternalMarkers(s);
|
|
3217
3221
|
if (isNonStringComponent) stripWebOnlyProps(s);
|
|
@@ -3439,7 +3443,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
3439
3443
|
return makeElement(isStaticChildren, effectiveType, { ...passProps2, style: finalStyle2 }, key);
|
|
3440
3444
|
}
|
|
3441
3445
|
const config = getConfig();
|
|
3442
|
-
const resolved = __kbachStyles
|
|
3446
|
+
const resolved = !isWeb && __kbachStyles != null ? __kbachStyles : classStr ? resolve(classStr, config.theme, config.darkMode) : {};
|
|
3443
3447
|
const { style: userStyle, ...passProps } = omitConsumed(workingProps);
|
|
3444
3448
|
const { interactive, modeOrResponsive } = bucketMods(resolved);
|
|
3445
3449
|
if (interactive) {
|
package/dist/jsx-dev-runtime.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
Fragment,
|
|
3
3
|
jsx,
|
|
4
4
|
jsxs
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-6YN6SRMN.mjs";
|
|
6
|
+
import "./chunk-JVTA5SC3.mjs";
|
|
7
|
+
import "./chunk-JBV2R655.mjs";
|
|
8
8
|
|
|
9
9
|
// src/jsx-dev-runtime.tsx
|
|
10
10
|
function jsxDEV(type, props, key, isStaticChildren, source, self) {
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -2812,9 +2812,11 @@ function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new
|
|
|
2812
2812
|
Object.assign(result, styles);
|
|
2813
2813
|
}
|
|
2814
2814
|
}
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2815
|
+
if (isNative) {
|
|
2816
|
+
const defaultFont = getDefaultFontFamily();
|
|
2817
|
+
if (defaultFont && !("fontFamily" in result)) {
|
|
2818
|
+
result.fontFamily = defaultFont;
|
|
2819
|
+
}
|
|
2818
2820
|
}
|
|
2819
2821
|
if (!isNative) {
|
|
2820
2822
|
const r = result;
|
|
@@ -3148,6 +3150,7 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
|
|
|
3148
3150
|
const handleBlur = (0, import_react3.useCallback)(chain(onBlur, () => setFocused(false)), [onBlur]);
|
|
3149
3151
|
const computedStyle = (0, import_react3.useMemo)(
|
|
3150
3152
|
() => {
|
|
3153
|
+
if (isWeb) return {};
|
|
3151
3154
|
const s = flatten(resolvedStyle, isDark, { pressed, hover: hovered, focus: focused, disabled: !!rest.disabled, checked: !!rest.checked }, breakpoints);
|
|
3152
3155
|
delete s.__divideX;
|
|
3153
3156
|
delete s.__divideY;
|
|
@@ -3213,6 +3216,7 @@ var DarkWrapper = import_react4.default.forwardRef(
|
|
|
3213
3216
|
const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS2;
|
|
3214
3217
|
const isNonStringComponent = typeof Component !== "string";
|
|
3215
3218
|
const computedStyle = (0, import_react4.useMemo)(() => {
|
|
3219
|
+
if (isWeb) return {};
|
|
3216
3220
|
const s = flatten(resolvedStyle, isDark, {}, breakpoints);
|
|
3217
3221
|
stripInternalMarkers(s);
|
|
3218
3222
|
if (isNonStringComponent) stripWebOnlyProps(s);
|
|
@@ -3448,7 +3452,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
|
|
|
3448
3452
|
return makeElement(isStaticChildren, effectiveType, { ...passProps2, style: finalStyle2 }, key);
|
|
3449
3453
|
}
|
|
3450
3454
|
const config = getConfig();
|
|
3451
|
-
const resolved = __kbachStyles
|
|
3455
|
+
const resolved = !isWeb && __kbachStyles != null ? __kbachStyles : classStr ? resolve(classStr, config.theme, config.darkMode) : {};
|
|
3452
3456
|
const { style: userStyle, ...passProps } = omitConsumed(workingProps);
|
|
3453
3457
|
const { interactive, modeOrResponsive } = bucketMods(resolved);
|
|
3454
3458
|
if (interactive) {
|
package/dist/jsx-runtime.mjs
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
_invalidateDefaultFontCache,
|
|
4
4
|
jsx,
|
|
5
5
|
jsxs
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6YN6SRMN.mjs";
|
|
7
7
|
import {
|
|
8
8
|
registerWebElement
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-JVTA5SC3.mjs";
|
|
10
|
+
import "./chunk-JBV2R655.mjs";
|
|
11
11
|
export {
|
|
12
12
|
Fragment,
|
|
13
13
|
_invalidateDefaultFontCache,
|
package/dist/vite-plugin.mjs
CHANGED