@kbach/react 0.6.46 → 0.6.47

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.
@@ -3106,6 +3106,27 @@ var CSS_UNITLESS = /* @__PURE__ */ new Set([
3106
3106
  "gridRowStart",
3107
3107
  "gridRowEnd"
3108
3108
  ]);
3109
+ var TEXT_ONLY_STYLE_KEYS = [
3110
+ "color",
3111
+ "fontSize",
3112
+ "fontWeight",
3113
+ "fontStyle",
3114
+ "fontVariant",
3115
+ "letterSpacing",
3116
+ "lineHeight",
3117
+ "textAlign",
3118
+ "textAlignVertical",
3119
+ "textDecorationLine",
3120
+ "textDecorationColor",
3121
+ "textDecorationStyle",
3122
+ "textShadowColor",
3123
+ "textShadowOffset",
3124
+ "textShadowRadius",
3125
+ "textTransform",
3126
+ "writingDirection",
3127
+ "includeFontPadding",
3128
+ "verticalAlign"
3129
+ ];
3109
3130
  var RN_SHORTHAND_EXPAND = {
3110
3131
  marginHorizontal: ["margin-left", "margin-right"],
3111
3132
  marginVertical: ["margin-top", "margin-bottom"],
@@ -3265,8 +3286,10 @@ function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new
3265
3286
  }
3266
3287
  if (isNative) {
3267
3288
  const defaultFont = getDefaultFontFamily();
3268
- if (defaultFont && !("fontFamily" in result)) {
3269
- result.fontFamily = defaultFont;
3289
+ const r = result;
3290
+ const looksLikeText = TEXT_ONLY_STYLE_KEYS.some((k) => k in r);
3291
+ if (defaultFont && looksLikeText && !("fontFamily" in r)) {
3292
+ r.fontFamily = defaultFont;
3270
3293
  }
3271
3294
  }
3272
3295
  if (!isNative) {
@@ -26,7 +26,7 @@ import {
26
26
  transformToWebProps,
27
27
  useConditionalGlobalDarkMode,
28
28
  useConditionalWidth
29
- } from "./chunk-FYVFEEFX.mjs";
29
+ } from "./chunk-5HY7Z2PS.mjs";
30
30
 
31
31
  // src/jsx-runtime.tsx
32
32
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -144,7 +144,9 @@ function processElement(type, rawProps, key, isStaticChildren) {
144
144
  if (!classStr && !__kbachStyles) {
145
145
  if (getEffectiveIsWeb()) return makeElement(isStaticChildren, effectiveType, omitConsumed(workingProps), key);
146
146
  const defaultFont = getCachedDefaultFont();
147
- if (!defaultFont) return makeElement(isStaticChildren, effectiveType, workingProps, key);
147
+ if (!defaultFont || getWebTag(type) !== "span") {
148
+ return makeElement(isStaticChildren, effectiveType, workingProps, key);
149
+ }
148
150
  const { style: userStyle2, ...passProps2 } = omitConsumed(workingProps);
149
151
  const finalStyle2 = userStyle2 ? Array.isArray(userStyle2) ? { fontFamily: defaultFont, ...Object.assign({}, ...userStyle2) } : { fontFamily: defaultFont, ...userStyle2 } : { fontFamily: defaultFont };
150
152
  return makeElement(isStaticChildren, effectiveType, { ...passProps2, style: finalStyle2 }, key);
@@ -3194,6 +3194,27 @@ var CSS_UNITLESS = /* @__PURE__ */ new Set([
3194
3194
  "gridRowStart",
3195
3195
  "gridRowEnd"
3196
3196
  ]);
3197
+ var TEXT_ONLY_STYLE_KEYS = [
3198
+ "color",
3199
+ "fontSize",
3200
+ "fontWeight",
3201
+ "fontStyle",
3202
+ "fontVariant",
3203
+ "letterSpacing",
3204
+ "lineHeight",
3205
+ "textAlign",
3206
+ "textAlignVertical",
3207
+ "textDecorationLine",
3208
+ "textDecorationColor",
3209
+ "textDecorationStyle",
3210
+ "textShadowColor",
3211
+ "textShadowOffset",
3212
+ "textShadowRadius",
3213
+ "textTransform",
3214
+ "writingDirection",
3215
+ "includeFontPadding",
3216
+ "verticalAlign"
3217
+ ];
3197
3218
  var RN_SHORTHAND_EXPAND = {
3198
3219
  marginHorizontal: ["margin-left", "margin-right"],
3199
3220
  marginVertical: ["margin-top", "margin-bottom"],
@@ -3363,8 +3384,10 @@ function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new
3363
3384
  }
3364
3385
  if (isNative) {
3365
3386
  const defaultFont = getDefaultFontFamily();
3366
- if (defaultFont && !("fontFamily" in result)) {
3367
- result.fontFamily = defaultFont;
3387
+ const r = result;
3388
+ const looksLikeText = TEXT_ONLY_STYLE_KEYS.some((k) => k in r);
3389
+ if (defaultFont && looksLikeText && !("fontFamily" in r)) {
3390
+ r.fontFamily = defaultFont;
3368
3391
  }
3369
3392
  }
3370
3393
  if (!isNative) {
package/dist/index.mjs CHANGED
@@ -48,7 +48,7 @@ import {
48
48
  useGlobalDarkMode,
49
49
  useGlobalWidth,
50
50
  useSyncExternalStore
51
- } from "./chunk-FYVFEEFX.mjs";
51
+ } from "./chunk-5HY7Z2PS.mjs";
52
52
 
53
53
  // src/context.tsx
54
54
  import { createContext, useContext } from "react";
@@ -682,7 +682,9 @@ function processElement(type, rawProps, key, isStaticChildren) {
682
682
  if (!classStr && !__kbachStyles) {
683
683
  if ((0, import_core6.getEffectiveIsWeb)()) return makeElement(isStaticChildren, effectiveType, omitConsumed(workingProps), key);
684
684
  const defaultFont = getCachedDefaultFont();
685
- if (!defaultFont) return makeElement(isStaticChildren, effectiveType, workingProps, key);
685
+ if (!defaultFont || getWebTag(type) !== "span") {
686
+ return makeElement(isStaticChildren, effectiveType, workingProps, key);
687
+ }
686
688
  const { style: userStyle2, ...passProps2 } = omitConsumed(workingProps);
687
689
  const finalStyle2 = userStyle2 ? Array.isArray(userStyle2) ? { fontFamily: defaultFont, ...Object.assign({}, ...userStyle2) } : { fontFamily: defaultFont, ...userStyle2 } : { fontFamily: defaultFont };
688
690
  return makeElement(isStaticChildren, effectiveType, { ...passProps2, style: finalStyle2 }, key);
@@ -3,8 +3,8 @@ import {
3
3
  Fragment,
4
4
  jsx,
5
5
  jsxs
6
- } from "./chunk-4Y44K364.mjs";
7
- import "./chunk-FYVFEEFX.mjs";
6
+ } from "./chunk-WW3NH5W2.mjs";
7
+ import "./chunk-5HY7Z2PS.mjs";
8
8
 
9
9
  // src/jsx-dev-runtime.tsx
10
10
  function jsxDEV(type, props, key, isStaticChildren, source, self) {
@@ -688,7 +688,9 @@ function processElement(type, rawProps, key, isStaticChildren) {
688
688
  if (!classStr && !__kbachStyles) {
689
689
  if ((0, import_core6.getEffectiveIsWeb)()) return makeElement(isStaticChildren, effectiveType, omitConsumed(workingProps), key);
690
690
  const defaultFont = getCachedDefaultFont();
691
- if (!defaultFont) return makeElement(isStaticChildren, effectiveType, workingProps, key);
691
+ if (!defaultFont || getWebTag(type) !== "span") {
692
+ return makeElement(isStaticChildren, effectiveType, workingProps, key);
693
+ }
692
694
  const { style: userStyle2, ...passProps2 } = omitConsumed(workingProps);
693
695
  const finalStyle2 = userStyle2 ? Array.isArray(userStyle2) ? { fontFamily: defaultFont, ...Object.assign({}, ...userStyle2) } : { fontFamily: defaultFont, ...userStyle2 } : { fontFamily: defaultFont };
694
696
  return makeElement(isStaticChildren, effectiveType, { ...passProps2, style: finalStyle2 }, key);
@@ -4,10 +4,10 @@ import {
4
4
  _invalidateDefaultFontCache,
5
5
  jsx,
6
6
  jsxs
7
- } from "./chunk-4Y44K364.mjs";
7
+ } from "./chunk-WW3NH5W2.mjs";
8
8
  import {
9
9
  registerWebElement
10
- } from "./chunk-FYVFEEFX.mjs";
10
+ } from "./chunk-5HY7Z2PS.mjs";
11
11
  export {
12
12
  Fragment,
13
13
  _invalidateDefaultFontCache,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kbach/react",
3
- "version": "0.6.46",
3
+ "version": "0.6.47",
4
4
  "description": "React / React Native components and hooks for the Kbach framework",
5
5
  "license": "MIT",
6
6
  "repository": {