@kbach/react 0.5.8 → 0.5.9

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.
@@ -2992,6 +2992,9 @@ var _defaultFontFamily;
2992
2992
  function setDefaultFontFamily(font) {
2993
2993
  _defaultFontFamily = font;
2994
2994
  }
2995
+ function getDefaultFontFamily() {
2996
+ return _defaultFontFamily;
2997
+ }
2995
2998
  var _styleEl = null;
2996
2999
  var _injectedRules = /* @__PURE__ */ new Set();
2997
3000
  function getStyleEl() {
@@ -3724,6 +3727,7 @@ export {
3724
3727
  syncGlobalScreens,
3725
3728
  setGlobalWidth,
3726
3729
  getActiveBreakpoints,
3730
+ getDefaultFontFamily,
3727
3731
  resolve,
3728
3732
  flatten,
3729
3733
  getConfig,
@@ -4,11 +4,12 @@ import {
4
4
  flatten,
5
5
  getActiveBreakpoints,
6
6
  getConfig,
7
+ getDefaultFontFamily,
7
8
  isWeb,
8
9
  resolve,
9
10
  useConditionalWidth,
10
11
  useGlobalDarkMode
11
- } from "./chunk-4R2AILNR.mjs";
12
+ } from "./chunk-OBFLMVLT.mjs";
12
13
 
13
14
  // src/jsx-runtime.tsx
14
15
  import { jsx as _jsx, jsxs as _jsxs, Fragment } from "react/jsx-runtime";
@@ -190,7 +191,13 @@ function processElement(type, rawProps, key, isStaticChildren) {
190
191
  const { className, kb: kbProp, __kbachStyles, __kbachClasses } = rawProps;
191
192
  const classStr = className ?? kbProp ?? __kbachClasses;
192
193
  if (!classStr && !__kbachStyles) {
193
- return makeElement(isStaticChildren, type, rawProps, key);
194
+ const defaultFont = getDefaultFontFamily();
195
+ if (!defaultFont) {
196
+ return makeElement(isStaticChildren, type, rawProps, key);
197
+ }
198
+ const { style: userStyle2, ...passProps2 } = omitConsumed(rawProps);
199
+ const finalStyle2 = userStyle2 ? Array.isArray(userStyle2) ? { fontFamily: defaultFont, ...Object.assign({}, ...userStyle2) } : { fontFamily: defaultFont, ...userStyle2 } : { fontFamily: defaultFont };
200
+ return makeElement(isStaticChildren, type, { ...passProps2, style: finalStyle2 }, key);
194
201
  }
195
202
  const config = getConfig();
196
203
  const resolved = __kbachStyles ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
package/dist/index.mjs CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  useConditionalWidth,
24
24
  useGlobalDarkMode,
25
25
  useGlobalWidth
26
- } from "./chunk-4R2AILNR.mjs";
26
+ } from "./chunk-OBFLMVLT.mjs";
27
27
 
28
28
  // src/context.tsx
29
29
  import { createContext, useContext } from "react";
@@ -3013,6 +3013,9 @@ var _defaultFontFamily;
3013
3013
  function setDefaultFontFamily(font) {
3014
3014
  _defaultFontFamily = font;
3015
3015
  }
3016
+ function getDefaultFontFamily() {
3017
+ return _defaultFontFamily;
3018
+ }
3016
3019
  var _styleEl = null;
3017
3020
  var _injectedRules = /* @__PURE__ */ new Set();
3018
3021
  function getStyleEl() {
@@ -3868,7 +3871,13 @@ function processElement(type, rawProps, key, isStaticChildren) {
3868
3871
  const { className, kb: kbProp, __kbachStyles, __kbachClasses } = rawProps;
3869
3872
  const classStr = className ?? kbProp ?? __kbachClasses;
3870
3873
  if (!classStr && !__kbachStyles) {
3871
- return makeElement(isStaticChildren, type, rawProps, key);
3874
+ const defaultFont = getDefaultFontFamily();
3875
+ if (!defaultFont) {
3876
+ return makeElement(isStaticChildren, type, rawProps, key);
3877
+ }
3878
+ const { style: userStyle2, ...passProps2 } = omitConsumed(rawProps);
3879
+ const finalStyle2 = userStyle2 ? Array.isArray(userStyle2) ? { fontFamily: defaultFont, ...Object.assign({}, ...userStyle2) } : { fontFamily: defaultFont, ...userStyle2 } : { fontFamily: defaultFont };
3880
+ return makeElement(isStaticChildren, type, { ...passProps2, style: finalStyle2 }, key);
3872
3881
  }
3873
3882
  const config = getConfig();
3874
3883
  const resolved = __kbachStyles ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-3VPBKWUE.mjs";
6
- import "./chunk-4R2AILNR.mjs";
5
+ } from "./chunk-QG3EWTVW.mjs";
6
+ import "./chunk-OBFLMVLT.mjs";
7
7
 
8
8
  // src/jsx-dev-runtime.tsx
9
9
  function jsxDEV(type, props, key, isStaticChildren, _source, _self) {
@@ -3012,6 +3012,9 @@ var _defaultFontFamily;
3012
3012
  function setDefaultFontFamily(font) {
3013
3013
  _defaultFontFamily = font;
3014
3014
  }
3015
+ function getDefaultFontFamily() {
3016
+ return _defaultFontFamily;
3017
+ }
3015
3018
  var _styleEl = null;
3016
3019
  var _injectedRules = /* @__PURE__ */ new Set();
3017
3020
  function getStyleEl() {
@@ -3867,7 +3870,13 @@ function processElement(type, rawProps, key, isStaticChildren) {
3867
3870
  const { className, kb: kbProp, __kbachStyles, __kbachClasses } = rawProps;
3868
3871
  const classStr = className ?? kbProp ?? __kbachClasses;
3869
3872
  if (!classStr && !__kbachStyles) {
3870
- return makeElement(isStaticChildren, type, rawProps, key);
3873
+ const defaultFont = getDefaultFontFamily();
3874
+ if (!defaultFont) {
3875
+ return makeElement(isStaticChildren, type, rawProps, key);
3876
+ }
3877
+ const { style: userStyle2, ...passProps2 } = omitConsumed(rawProps);
3878
+ const finalStyle2 = userStyle2 ? Array.isArray(userStyle2) ? { fontFamily: defaultFont, ...Object.assign({}, ...userStyle2) } : { fontFamily: defaultFont, ...userStyle2 } : { fontFamily: defaultFont };
3879
+ return makeElement(isStaticChildren, type, { ...passProps2, style: finalStyle2 }, key);
3871
3880
  }
3872
3881
  const config = getConfig();
3873
3882
  const resolved = __kbachStyles ?? (classStr ? resolve(classStr, config.theme, config.darkMode) : {});
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-3VPBKWUE.mjs";
6
- import "./chunk-4R2AILNR.mjs";
5
+ } from "./chunk-QG3EWTVW.mjs";
6
+ import "./chunk-OBFLMVLT.mjs";
7
7
  export {
8
8
  Fragment,
9
9
  jsx,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kbach/react",
3
- "version": "0.5.8",
3
+ "version": "0.5.9",
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",