@kbach/react 0.5.8 → 0.5.10

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.
@@ -2988,9 +2988,12 @@ function getActiveBreakpoints(width) {
2988
2988
 
2989
2989
  // src/core/resolver.ts
2990
2990
  var styleCache = new LRUCache(1e4);
2991
- var _defaultFontFamily;
2991
+ var FONT_KEY = "__kbach_default_font__";
2992
2992
  function setDefaultFontFamily(font) {
2993
- _defaultFontFamily = font;
2993
+ globalThis[FONT_KEY] = font;
2994
+ }
2995
+ function getDefaultFontFamily() {
2996
+ return globalThis[FONT_KEY];
2994
2997
  }
2995
2998
  var _styleEl = null;
2996
2999
  var _injectedRules = /* @__PURE__ */ new Set();
@@ -3260,7 +3263,8 @@ function resolve(classString, theme, darkMode = "attribute") {
3260
3263
  }
3261
3264
  function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new Set()) {
3262
3265
  const result = {};
3263
- if (_defaultFontFamily) result.fontFamily = _defaultFontFamily;
3266
+ const _df = getDefaultFontFamily();
3267
+ if (_df) result.fontFamily = _df;
3264
3268
  const entries = Object.entries(resolved);
3265
3269
  entries.sort((a, b) => {
3266
3270
  const pa = a[0] === "base" ? -1 : a[0].split(":").length;
@@ -3724,6 +3728,7 @@ export {
3724
3728
  syncGlobalScreens,
3725
3729
  setGlobalWidth,
3726
3730
  getActiveBreakpoints,
3731
+ getDefaultFontFamily,
3727
3732
  resolve,
3728
3733
  flatten,
3729
3734
  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-FXDTPPTC.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.js CHANGED
@@ -3118,9 +3118,12 @@ function getActiveBreakpoints(width) {
3118
3118
 
3119
3119
  // src/core/resolver.ts
3120
3120
  var styleCache = new LRUCache(1e4);
3121
- var _defaultFontFamily;
3121
+ var FONT_KEY = "__kbach_default_font__";
3122
3122
  function setDefaultFontFamily(font) {
3123
- _defaultFontFamily = font;
3123
+ globalThis[FONT_KEY] = font;
3124
+ }
3125
+ function getDefaultFontFamily() {
3126
+ return globalThis[FONT_KEY];
3124
3127
  }
3125
3128
  var _styleEl = null;
3126
3129
  var _injectedRules = /* @__PURE__ */ new Set();
@@ -3390,7 +3393,8 @@ function resolve(classString, theme, darkMode = "attribute") {
3390
3393
  }
3391
3394
  function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new Set()) {
3392
3395
  const result = {};
3393
- if (_defaultFontFamily) result.fontFamily = _defaultFontFamily;
3396
+ const _df = getDefaultFontFamily();
3397
+ if (_df) result.fontFamily = _df;
3394
3398
  const entries = Object.entries(resolved);
3395
3399
  entries.sort((a, b) => {
3396
3400
  const pa = a[0] === "base" ? -1 : a[0].split(":").length;
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-FXDTPPTC.mjs";
27
27
 
28
28
  // src/context.tsx
29
29
  import { createContext, useContext } from "react";
@@ -3009,9 +3009,12 @@ function getActiveBreakpoints(width) {
3009
3009
 
3010
3010
  // src/core/resolver.ts
3011
3011
  var styleCache = new LRUCache(1e4);
3012
- var _defaultFontFamily;
3012
+ var FONT_KEY = "__kbach_default_font__";
3013
3013
  function setDefaultFontFamily(font) {
3014
- _defaultFontFamily = font;
3014
+ globalThis[FONT_KEY] = font;
3015
+ }
3016
+ function getDefaultFontFamily() {
3017
+ return globalThis[FONT_KEY];
3015
3018
  }
3016
3019
  var _styleEl = null;
3017
3020
  var _injectedRules = /* @__PURE__ */ new Set();
@@ -3281,7 +3284,8 @@ function resolve(classString, theme, darkMode = "attribute") {
3281
3284
  }
3282
3285
  function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new Set()) {
3283
3286
  const result = {};
3284
- if (_defaultFontFamily) result.fontFamily = _defaultFontFamily;
3287
+ const _df = getDefaultFontFamily();
3288
+ if (_df) result.fontFamily = _df;
3285
3289
  const entries = Object.entries(resolved);
3286
3290
  entries.sort((a, b) => {
3287
3291
  const pa = a[0] === "base" ? -1 : a[0].split(":").length;
@@ -3868,7 +3872,13 @@ function processElement(type, rawProps, key, isStaticChildren) {
3868
3872
  const { className, kb: kbProp, __kbachStyles, __kbachClasses } = rawProps;
3869
3873
  const classStr = className ?? kbProp ?? __kbachClasses;
3870
3874
  if (!classStr && !__kbachStyles) {
3871
- return makeElement(isStaticChildren, type, rawProps, key);
3875
+ const defaultFont = getDefaultFontFamily();
3876
+ if (!defaultFont) {
3877
+ return makeElement(isStaticChildren, type, rawProps, key);
3878
+ }
3879
+ const { style: userStyle2, ...passProps2 } = omitConsumed(rawProps);
3880
+ const finalStyle2 = userStyle2 ? Array.isArray(userStyle2) ? { fontFamily: defaultFont, ...Object.assign({}, ...userStyle2) } : { fontFamily: defaultFont, ...userStyle2 } : { fontFamily: defaultFont };
3881
+ return makeElement(isStaticChildren, type, { ...passProps2, style: finalStyle2 }, key);
3872
3882
  }
3873
3883
  const config = getConfig();
3874
3884
  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-VM3BMCFM.mjs";
6
+ import "./chunk-FXDTPPTC.mjs";
7
7
 
8
8
  // src/jsx-dev-runtime.tsx
9
9
  function jsxDEV(type, props, key, isStaticChildren, _source, _self) {
@@ -3008,9 +3008,12 @@ function getActiveBreakpoints(width) {
3008
3008
 
3009
3009
  // src/core/resolver.ts
3010
3010
  var styleCache = new LRUCache(1e4);
3011
- var _defaultFontFamily;
3011
+ var FONT_KEY = "__kbach_default_font__";
3012
3012
  function setDefaultFontFamily(font) {
3013
- _defaultFontFamily = font;
3013
+ globalThis[FONT_KEY] = font;
3014
+ }
3015
+ function getDefaultFontFamily() {
3016
+ return globalThis[FONT_KEY];
3014
3017
  }
3015
3018
  var _styleEl = null;
3016
3019
  var _injectedRules = /* @__PURE__ */ new Set();
@@ -3280,7 +3283,8 @@ function resolve(classString, theme, darkMode = "attribute") {
3280
3283
  }
3281
3284
  function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new Set()) {
3282
3285
  const result = {};
3283
- if (_defaultFontFamily) result.fontFamily = _defaultFontFamily;
3286
+ const _df = getDefaultFontFamily();
3287
+ if (_df) result.fontFamily = _df;
3284
3288
  const entries = Object.entries(resolved);
3285
3289
  entries.sort((a, b) => {
3286
3290
  const pa = a[0] === "base" ? -1 : a[0].split(":").length;
@@ -3867,7 +3871,13 @@ function processElement(type, rawProps, key, isStaticChildren) {
3867
3871
  const { className, kb: kbProp, __kbachStyles, __kbachClasses } = rawProps;
3868
3872
  const classStr = className ?? kbProp ?? __kbachClasses;
3869
3873
  if (!classStr && !__kbachStyles) {
3870
- 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);
3871
3881
  }
3872
3882
  const config = getConfig();
3873
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-VM3BMCFM.mjs";
6
+ import "./chunk-FXDTPPTC.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.10",
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",