@kbach/react 0.5.7 → 0.5.8

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.
@@ -8,7 +8,7 @@ import {
8
8
  resolve,
9
9
  useConditionalWidth,
10
10
  useGlobalDarkMode
11
- } from "./chunk-YLT5TFLD.mjs";
11
+ } from "./chunk-4R2AILNR.mjs";
12
12
 
13
13
  // src/jsx-runtime.tsx
14
14
  import { jsx as _jsx, jsxs as _jsxs, Fragment } from "react/jsx-runtime";
@@ -2988,6 +2988,10 @@ function getActiveBreakpoints(width) {
2988
2988
 
2989
2989
  // src/core/resolver.ts
2990
2990
  var styleCache = new LRUCache(1e4);
2991
+ var _defaultFontFamily;
2992
+ function setDefaultFontFamily(font) {
2993
+ _defaultFontFamily = font;
2994
+ }
2991
2995
  var _styleEl = null;
2992
2996
  var _injectedRules = /* @__PURE__ */ new Set();
2993
2997
  function getStyleEl() {
@@ -3256,6 +3260,7 @@ function resolve(classString, theme, darkMode = "attribute") {
3256
3260
  }
3257
3261
  function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new Set()) {
3258
3262
  const result = {};
3263
+ if (_defaultFontFamily) result.fontFamily = _defaultFontFamily;
3259
3264
  const entries = Object.entries(resolved);
3260
3265
  entries.sort((a, b) => {
3261
3266
  const pa = a[0] === "base" ? -1 : a[0].split(":").length;
@@ -3432,6 +3437,9 @@ function buildConfig(userConfig) {
3432
3437
  for (const plugin of resolved.plugins) {
3433
3438
  plugin(pluginAPI);
3434
3439
  }
3440
+ const rawSans = theme.fontFamily.sans;
3441
+ const sansFontValue = Array.isArray(rawSans) ? rawSans[0] : rawSans;
3442
+ setDefaultFontFamily(sansFontValue && sansFontValue !== "System" ? sansFontValue : void 0);
3435
3443
  injectGlobalStyles(resolved.theme);
3436
3444
  return resolved;
3437
3445
  }
package/dist/index.js CHANGED
@@ -3118,6 +3118,10 @@ function getActiveBreakpoints(width) {
3118
3118
 
3119
3119
  // src/core/resolver.ts
3120
3120
  var styleCache = new LRUCache(1e4);
3121
+ var _defaultFontFamily;
3122
+ function setDefaultFontFamily(font) {
3123
+ _defaultFontFamily = font;
3124
+ }
3121
3125
  var _styleEl = null;
3122
3126
  var _injectedRules = /* @__PURE__ */ new Set();
3123
3127
  function getStyleEl() {
@@ -3386,6 +3390,7 @@ function resolve(classString, theme, darkMode = "attribute") {
3386
3390
  }
3387
3391
  function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new Set()) {
3388
3392
  const result = {};
3393
+ if (_defaultFontFamily) result.fontFamily = _defaultFontFamily;
3389
3394
  const entries = Object.entries(resolved);
3390
3395
  entries.sort((a, b) => {
3391
3396
  const pa = a[0] === "base" ? -1 : a[0].split(":").length;
@@ -3562,6 +3567,9 @@ function buildConfig(userConfig) {
3562
3567
  for (const plugin of resolved.plugins) {
3563
3568
  plugin(pluginAPI);
3564
3569
  }
3570
+ const rawSans = theme.fontFamily.sans;
3571
+ const sansFontValue = Array.isArray(rawSans) ? rawSans[0] : rawSans;
3572
+ setDefaultFontFamily(sansFontValue && sansFontValue !== "System" ? sansFontValue : void 0);
3565
3573
  injectGlobalStyles(resolved.theme);
3566
3574
  return resolved;
3567
3575
  }
package/dist/index.mjs CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  useConditionalWidth,
24
24
  useGlobalDarkMode,
25
25
  useGlobalWidth
26
- } from "./chunk-YLT5TFLD.mjs";
26
+ } from "./chunk-4R2AILNR.mjs";
27
27
 
28
28
  // src/context.tsx
29
29
  import { createContext, useContext } from "react";
@@ -3009,6 +3009,10 @@ function getActiveBreakpoints(width) {
3009
3009
 
3010
3010
  // src/core/resolver.ts
3011
3011
  var styleCache = new LRUCache(1e4);
3012
+ var _defaultFontFamily;
3013
+ function setDefaultFontFamily(font) {
3014
+ _defaultFontFamily = font;
3015
+ }
3012
3016
  var _styleEl = null;
3013
3017
  var _injectedRules = /* @__PURE__ */ new Set();
3014
3018
  function getStyleEl() {
@@ -3277,6 +3281,7 @@ function resolve(classString, theme, darkMode = "attribute") {
3277
3281
  }
3278
3282
  function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new Set()) {
3279
3283
  const result = {};
3284
+ if (_defaultFontFamily) result.fontFamily = _defaultFontFamily;
3280
3285
  const entries = Object.entries(resolved);
3281
3286
  entries.sort((a, b) => {
3282
3287
  const pa = a[0] === "base" ? -1 : a[0].split(":").length;
@@ -3445,6 +3450,9 @@ function buildConfig(userConfig) {
3445
3450
  for (const plugin of resolved.plugins) {
3446
3451
  plugin(pluginAPI);
3447
3452
  }
3453
+ const rawSans = theme.fontFamily.sans;
3454
+ const sansFontValue = Array.isArray(rawSans) ? rawSans[0] : rawSans;
3455
+ setDefaultFontFamily(sansFontValue && sansFontValue !== "System" ? sansFontValue : void 0);
3448
3456
  injectGlobalStyles(resolved.theme);
3449
3457
  return resolved;
3450
3458
  }
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-3SF5YHWG.mjs";
6
- import "./chunk-YLT5TFLD.mjs";
5
+ } from "./chunk-3VPBKWUE.mjs";
6
+ import "./chunk-4R2AILNR.mjs";
7
7
 
8
8
  // src/jsx-dev-runtime.tsx
9
9
  function jsxDEV(type, props, key, isStaticChildren, _source, _self) {
@@ -3008,6 +3008,10 @@ function getActiveBreakpoints(width) {
3008
3008
 
3009
3009
  // src/core/resolver.ts
3010
3010
  var styleCache = new LRUCache(1e4);
3011
+ var _defaultFontFamily;
3012
+ function setDefaultFontFamily(font) {
3013
+ _defaultFontFamily = font;
3014
+ }
3011
3015
  var _styleEl = null;
3012
3016
  var _injectedRules = /* @__PURE__ */ new Set();
3013
3017
  function getStyleEl() {
@@ -3276,6 +3280,7 @@ function resolve(classString, theme, darkMode = "attribute") {
3276
3280
  }
3277
3281
  function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new Set()) {
3278
3282
  const result = {};
3283
+ if (_defaultFontFamily) result.fontFamily = _defaultFontFamily;
3279
3284
  const entries = Object.entries(resolved);
3280
3285
  entries.sort((a, b) => {
3281
3286
  const pa = a[0] === "base" ? -1 : a[0].split(":").length;
@@ -3444,6 +3449,9 @@ function buildConfig(userConfig) {
3444
3449
  for (const plugin of resolved.plugins) {
3445
3450
  plugin(pluginAPI);
3446
3451
  }
3452
+ const rawSans = theme.fontFamily.sans;
3453
+ const sansFontValue = Array.isArray(rawSans) ? rawSans[0] : rawSans;
3454
+ setDefaultFontFamily(sansFontValue && sansFontValue !== "System" ? sansFontValue : void 0);
3447
3455
  injectGlobalStyles(resolved.theme);
3448
3456
  return resolved;
3449
3457
  }
@@ -2,8 +2,8 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-3SF5YHWG.mjs";
6
- import "./chunk-YLT5TFLD.mjs";
5
+ } from "./chunk-3VPBKWUE.mjs";
6
+ import "./chunk-4R2AILNR.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.7",
3
+ "version": "0.5.8",
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",