@kbach/react-native 1.0.0-beta.27 → 1.0.0-beta.29
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.
- package/android/src/main/jniLibs/arm64-v8a/libkbach_core_engine.so +0 -0
- package/android/src/main/jniLibs/x86_64/libkbach_core_engine.so +0 -0
- package/dist/{chunk-MXIT3EDJ.mjs → chunk-2RXP6YSV.mjs} +1 -1
- package/dist/chunk-B36TKRB6.mjs +564 -0
- package/dist/{chunk-GHQ7DWLO.mjs → chunk-Q2L7M7FC.mjs} +2 -2
- package/dist/{useDynamicToken-C8T9r6Cl.d.ts → clsx-BCXALPGh.d.ts} +43 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +32 -1
- package/dist/index.web.d.ts +1 -1
- package/dist/index.web.js +29 -1
- package/dist/index.web.mjs +29 -2
- package/dist/jsx-dev-runtime.js +11 -3
- package/dist/jsx-dev-runtime.web.js +2 -2
- package/dist/jsx-dev-runtime.web.mjs +3 -3
- package/dist/jsx-runtime.js +11 -3
- package/dist/jsx-runtime.web.js +2 -2
- package/dist/jsx-runtime.web.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-BEXNFWW6.mjs +0 -564
package/dist/index.web.mjs
CHANGED
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
subscribeDynamicTokens,
|
|
11
11
|
subscribeGlobalDarkMode,
|
|
12
12
|
toggleGlobalDarkMode
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2RXP6YSV.mjs";
|
|
14
14
|
import {
|
|
15
15
|
defaultTheme,
|
|
16
16
|
getTheme,
|
|
17
17
|
resolveClassName,
|
|
18
18
|
setTheme
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-B36TKRB6.mjs";
|
|
20
20
|
|
|
21
21
|
// src/config.ts
|
|
22
22
|
function parseHexRgb(hex) {
|
|
@@ -216,9 +216,36 @@ import { useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
|
216
216
|
function useDynamicToken(name) {
|
|
217
217
|
return useSyncExternalStore2(subscribeDynamicTokens, () => getDynamicToken(name));
|
|
218
218
|
}
|
|
219
|
+
|
|
220
|
+
// src/clsx.ts
|
|
221
|
+
function clsx(...inputs) {
|
|
222
|
+
let out = "";
|
|
223
|
+
for (const input of inputs) {
|
|
224
|
+
const piece = resolveClassValue(input);
|
|
225
|
+
if (piece) out = out ? `${out} ${piece}` : piece;
|
|
226
|
+
}
|
|
227
|
+
return out;
|
|
228
|
+
}
|
|
229
|
+
function resolveClassValue(value) {
|
|
230
|
+
if (!value) return "";
|
|
231
|
+
const type = typeof value;
|
|
232
|
+
if (type === "string" || type === "number" || type === "bigint") return String(value);
|
|
233
|
+
if (Array.isArray(value)) return clsx(...value);
|
|
234
|
+
if (type === "object") {
|
|
235
|
+
let out = "";
|
|
236
|
+
for (const key in value) {
|
|
237
|
+
if (Object.prototype.hasOwnProperty.call(value, key) && value[key]) {
|
|
238
|
+
out = out ? `${out} ${key}` : key;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return out;
|
|
242
|
+
}
|
|
243
|
+
return "";
|
|
244
|
+
}
|
|
219
245
|
export {
|
|
220
246
|
ThemeProvider,
|
|
221
247
|
applyKbachConfig,
|
|
248
|
+
clsx,
|
|
222
249
|
defaultTheme,
|
|
223
250
|
deleteDynamicToken,
|
|
224
251
|
getDynamicToken,
|
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -653,7 +653,12 @@ function ReactiveElement({
|
|
|
653
653
|
}
|
|
654
654
|
const states = { hover: isHovered, focus: isFocused, disabled: hostRest.disabled === true };
|
|
655
655
|
const finalStyle = hostType === import_react_native.Pressable ? (state) => resolvedStyleFor(resolveStyle2, classStrRaw, userStyle, state.pressed, layoutOverrides, states) : resolvedStyleFor(resolveStyle2, classStrRaw, userStyle, false, layoutOverrides, states);
|
|
656
|
-
return makeElement(
|
|
656
|
+
return makeElement(
|
|
657
|
+
isStaticChildren,
|
|
658
|
+
hostType,
|
|
659
|
+
{ ...hostRestWithLayout, className: classStrRaw, style: finalStyle },
|
|
660
|
+
elementKey
|
|
661
|
+
);
|
|
657
662
|
}
|
|
658
663
|
function processElement(resolveStyle2, type, rawProps, key, isStaticChildren) {
|
|
659
664
|
if (type === null || typeof type === "symbol" || !rawProps) {
|
|
@@ -672,7 +677,7 @@ function processElement(resolveStyle2, type, rawProps, key, isStaticChildren) {
|
|
|
672
677
|
}
|
|
673
678
|
const staticStates = { hover: false, focus: false, disabled: rest.disabled === true };
|
|
674
679
|
const finalStyle = type === import_react_native.Pressable ? (state) => resolvedStyleFor(resolveStyle2, classStrRaw, userStyle, state.pressed, void 0, staticStates) : resolvedStyleFor(resolveStyle2, classStrRaw, userStyle, false, void 0, staticStates);
|
|
675
|
-
return makeElement(isStaticChildren, type, { ...rest, style: finalStyle }, key);
|
|
680
|
+
return makeElement(isStaticChildren, type, { ...rest, className: classStrRaw, style: finalStyle }, key);
|
|
676
681
|
}
|
|
677
682
|
function createJsxFunctions(resolveStyle2) {
|
|
678
683
|
function jsx2(type, props, key) {
|
|
@@ -721,7 +726,10 @@ function resolveLength(theme, parsed) {
|
|
|
721
726
|
}
|
|
722
727
|
function resolveNegatableLength(theme, parsed) {
|
|
723
728
|
if (!parsed.negative) return resolveLength(theme, parsed);
|
|
724
|
-
if (parsed.isArbitrary)
|
|
729
|
+
if (parsed.isArbitrary) {
|
|
730
|
+
const value2 = parsed.value;
|
|
731
|
+
return value2 === null ? null : `calc(${value2} * -1)`;
|
|
732
|
+
}
|
|
725
733
|
const value = parsed.value;
|
|
726
734
|
if (value === null) return null;
|
|
727
735
|
const px = spacingPx(theme, value);
|