@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.
@@ -6,7 +6,7 @@ import {
6
6
  transformToWebProps,
7
7
  useConditionalWidth,
8
8
  useGlobalDarkMode
9
- } from "./chunk-3UUTNNWV.mjs";
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-BKSXIWL7.mjs";
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 ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
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
- const defaultFont = getDefaultFontFamily();
2809
- if (defaultFont && !("fontFamily" in result)) {
2810
- result.fontFamily = defaultFont;
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-BKSXIWL7.mjs";
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
- const defaultFont = getDefaultFontFamily();
2937
- if (defaultFont && !("fontFamily" in result)) {
2938
- result.fontFamily = defaultFont;
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-3UUTNNWV.mjs";
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-BKSXIWL7.mjs";
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
  );
@@ -2811,9 +2811,11 @@ function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new
2811
2811
  Object.assign(result, styles);
2812
2812
  }
2813
2813
  }
2814
- const defaultFont = getDefaultFontFamily();
2815
- if (defaultFont && !("fontFamily" in result)) {
2816
- result.fontFamily = defaultFont;
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 ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
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) {
@@ -2,9 +2,9 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-KWB2XQSF.mjs";
6
- import "./chunk-3UUTNNWV.mjs";
7
- import "./chunk-BKSXIWL7.mjs";
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) {
@@ -2812,9 +2812,11 @@ function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new
2812
2812
  Object.assign(result, styles);
2813
2813
  }
2814
2814
  }
2815
- const defaultFont = getDefaultFontFamily();
2816
- if (defaultFont && !("fontFamily" in result)) {
2817
- result.fontFamily = defaultFont;
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 ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
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) {
@@ -3,11 +3,11 @@ import {
3
3
  _invalidateDefaultFontCache,
4
4
  jsx,
5
5
  jsxs
6
- } from "./chunk-KWB2XQSF.mjs";
6
+ } from "./chunk-6YN6SRMN.mjs";
7
7
  import {
8
8
  registerWebElement
9
- } from "./chunk-3UUTNNWV.mjs";
10
- import "./chunk-BKSXIWL7.mjs";
9
+ } from "./chunk-JVTA5SC3.mjs";
10
+ import "./chunk-JBV2R655.mjs";
11
11
  export {
12
12
  Fragment,
13
13
  _invalidateDefaultFontCache,
@@ -4,7 +4,7 @@ import {
4
4
  generateClassCSS,
5
5
  setCSSGenMode,
6
6
  splitClassTokens
7
- } from "./chunk-BKSXIWL7.mjs";
7
+ } from "./chunk-JBV2R655.mjs";
8
8
 
9
9
  // src/vite-plugin.ts
10
10
  import { readFileSync, writeFileSync, readdirSync, statSync } from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kbach/react",
3
- "version": "0.5.49",
3
+ "version": "0.5.51",
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",