@kbach/react-native 1.0.0-beta.11 → 1.0.0-beta.13
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-YOC3SHF5.mjs → chunk-6QFPLRSP.mjs} +1 -1
- package/dist/{chunk-5MU6PEXV.mjs → chunk-GU6DH6UE.mjs} +1 -1
- package/dist/{chunk-XHL653X2.mjs → chunk-JMNJCPGK.mjs} +41 -13
- package/dist/chunk-ZB2UU6EO.mjs +192 -0
- package/dist/index.js +41 -13
- package/dist/index.mjs +1 -1
- package/dist/index.web.js +1 -1
- package/dist/index.web.mjs +1 -1
- package/dist/jsx-dev-runtime.js +41 -13
- package/dist/jsx-dev-runtime.mjs +2 -2
- package/dist/jsx-dev-runtime.web.js +1 -1
- package/dist/jsx-dev-runtime.web.mjs +2 -2
- package/dist/jsx-runtime.js +41 -13
- package/dist/jsx-runtime.mjs +2 -2
- package/dist/jsx-runtime.web.js +1 -1
- package/dist/jsx-runtime.web.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-H5Z24XX5.mjs +0 -192
package/dist/jsx-runtime.js
CHANGED
|
@@ -1103,6 +1103,36 @@ function lookupHex(theme, key) {
|
|
|
1103
1103
|
const entry = theme.colors[key];
|
|
1104
1104
|
return typeof entry === "string" ? entry : null;
|
|
1105
1105
|
}
|
|
1106
|
+
function hexToRgb(hex) {
|
|
1107
|
+
const m = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());
|
|
1108
|
+
if (!m) return null;
|
|
1109
|
+
let h = m[1];
|
|
1110
|
+
if (h.length === 3) h = h.split("").map((c) => c + c).join("");
|
|
1111
|
+
const n = parseInt(h, 16);
|
|
1112
|
+
return [n >> 16 & 255, n >> 8 & 255, n & 255];
|
|
1113
|
+
}
|
|
1114
|
+
function splitOpacity(value) {
|
|
1115
|
+
const slash = value.lastIndexOf("/");
|
|
1116
|
+
if (slash === -1) return [value, null];
|
|
1117
|
+
const opacityText = value.slice(slash + 1);
|
|
1118
|
+
const n = Number(opacityText);
|
|
1119
|
+
if (opacityText !== "" && Number.isInteger(n) && n >= 0 && n <= 100) {
|
|
1120
|
+
return [value.slice(0, slash), n];
|
|
1121
|
+
}
|
|
1122
|
+
return [value, null];
|
|
1123
|
+
}
|
|
1124
|
+
function colorValue(theme, parsed) {
|
|
1125
|
+
const value = parsed.value;
|
|
1126
|
+
if (value === null) return null;
|
|
1127
|
+
if (parsed.isArbitrary) return value;
|
|
1128
|
+
const [name, opacity] = splitOpacity(value);
|
|
1129
|
+
const hex = lookupHex(theme, name);
|
|
1130
|
+
if (hex === null) return null;
|
|
1131
|
+
if (opacity === null) return hex;
|
|
1132
|
+
const rgb = hexToRgb(hex);
|
|
1133
|
+
if (rgb === null) return hex;
|
|
1134
|
+
return `rgba(${rgb.join(",")},${opacity / 100})`;
|
|
1135
|
+
}
|
|
1106
1136
|
|
|
1107
1137
|
// src/jsEngine/resolvers/border.ts
|
|
1108
1138
|
function radiusSize(key) {
|
|
@@ -1162,8 +1192,8 @@ function borderValue(theme, parsed) {
|
|
|
1162
1192
|
if (value === "solid" || value === "dashed" || value === "dotted" || value === "double" || value === "hidden" || value === "none") {
|
|
1163
1193
|
return [decl("border-style", value)];
|
|
1164
1194
|
}
|
|
1165
|
-
const
|
|
1166
|
-
return
|
|
1195
|
+
const color = colorValue(theme, parsed);
|
|
1196
|
+
return color === null ? null : [decl("border-color", color)];
|
|
1167
1197
|
}
|
|
1168
1198
|
function borderSideValue(theme, parsed, sideProperty) {
|
|
1169
1199
|
const value = parsed.value;
|
|
@@ -1176,8 +1206,8 @@ function borderSideValue(theme, parsed, sideProperty) {
|
|
|
1176
1206
|
if (value === "solid" || value === "dashed" || value === "dotted" || value === "double" || value === "hidden" || value === "none") {
|
|
1177
1207
|
return [decl(`${sideProperty}-style`, value)];
|
|
1178
1208
|
}
|
|
1179
|
-
const
|
|
1180
|
-
return
|
|
1209
|
+
const color = colorValue(theme, parsed);
|
|
1210
|
+
return color === null ? null : [decl(`${sideProperty}-color`, color)];
|
|
1181
1211
|
}
|
|
1182
1212
|
function borderAxisValue(theme, parsed, sideA, sideB) {
|
|
1183
1213
|
const value = parsed.value;
|
|
@@ -1190,8 +1220,8 @@ function borderAxisValue(theme, parsed, sideA, sideB) {
|
|
|
1190
1220
|
if (value === "solid" || value === "dashed" || value === "dotted" || value === "double" || value === "hidden" || value === "none") {
|
|
1191
1221
|
return [decl(`${sideA}-style`, value), decl(`${sideB}-style`, value)];
|
|
1192
1222
|
}
|
|
1193
|
-
const
|
|
1194
|
-
return
|
|
1223
|
+
const color = colorValue(theme, parsed);
|
|
1224
|
+
return color === null ? null : [decl(`${sideA}-color`, color), decl(`${sideB}-color`, color)];
|
|
1195
1225
|
}
|
|
1196
1226
|
function radiusProperties(side) {
|
|
1197
1227
|
switch (side) {
|
|
@@ -1253,8 +1283,8 @@ function outlineValue(theme, parsed) {
|
|
|
1253
1283
|
const w = outlineWidthValue(value);
|
|
1254
1284
|
if (w !== null) return [decl("outline-width", w)];
|
|
1255
1285
|
if (OUTLINE_STYLES.includes(value)) return [decl("outline-style", value)];
|
|
1256
|
-
const
|
|
1257
|
-
return
|
|
1286
|
+
const color = colorValue(theme, parsed);
|
|
1287
|
+
return color === null ? null : [decl("outline-color", color)];
|
|
1258
1288
|
}
|
|
1259
1289
|
function outlineOffsetValue(parsed) {
|
|
1260
1290
|
const value = parsed.value;
|
|
@@ -1290,7 +1320,7 @@ function ringValue(theme, parsed) {
|
|
|
1290
1320
|
const w = ringWidth(value);
|
|
1291
1321
|
if (w !== null) return [decl("--kb-ring-width", w), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1292
1322
|
}
|
|
1293
|
-
const color =
|
|
1323
|
+
const color = colorValue(theme, parsed);
|
|
1294
1324
|
if (color === null) return null;
|
|
1295
1325
|
return [decl("--kb-ring-color", color), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1296
1326
|
}
|
|
@@ -1301,7 +1331,7 @@ function ringOffsetValue(theme, parsed) {
|
|
|
1301
1331
|
const w = ringWidth(value);
|
|
1302
1332
|
if (w !== null) return [decl("--kb-ring-offset-width", w), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1303
1333
|
}
|
|
1304
|
-
const color =
|
|
1334
|
+
const color = colorValue(theme, parsed);
|
|
1305
1335
|
if (color === null) return null;
|
|
1306
1336
|
return [decl("--kb-ring-offset-color", color), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1307
1337
|
}
|
|
@@ -1508,9 +1538,7 @@ function resolveLeadingTrackingNative(parsed) {
|
|
|
1508
1538
|
return null;
|
|
1509
1539
|
}
|
|
1510
1540
|
function nativeHexColor(parsed, theme) {
|
|
1511
|
-
|
|
1512
|
-
if (value === null) return null;
|
|
1513
|
-
return parsed.isArbitrary ? value : lookupHex(theme, value);
|
|
1541
|
+
return colorValue(theme, parsed);
|
|
1514
1542
|
}
|
|
1515
1543
|
function resolveTextNative(parsed, theme) {
|
|
1516
1544
|
if (!parsed.isArbitrary && parsed.value !== null) {
|