@kbach/react-native 1.0.0-beta.53 → 1.0.0-beta.55
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/AGENTS.md +18 -0
- package/README.md +5 -0
- package/THIRD_PARTY_NOTICES.md +41 -0
- 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-CAD43NRG.mjs +575 -0
- package/dist/{chunk-3JQAZNJK.mjs → chunk-KAA2Y67Z.mjs} +1 -1
- package/dist/{chunk-TC6VSV44.mjs → chunk-WI7VGI2G.mjs} +1 -1
- package/dist/index.js +67 -87
- package/dist/index.web.js +1 -1
- package/dist/index.web.mjs +2 -2
- package/dist/jsx-dev-runtime.js +67 -87
- package/dist/jsx-dev-runtime.web.js +1 -1
- package/dist/jsx-dev-runtime.web.mjs +3 -3
- package/dist/jsx-runtime.js +67 -87
- package/dist/jsx-runtime.web.js +1 -1
- package/dist/jsx-runtime.web.mjs +2 -2
- package/package.json +3 -2
- package/dist/chunk-P75PP2QR.mjs +0 -575
package/dist/index.js
CHANGED
|
@@ -202,11 +202,15 @@ var VALUE_PREFIXES = [
|
|
|
202
202
|
"rotate-y-",
|
|
203
203
|
"rotate-z-",
|
|
204
204
|
"rotate-",
|
|
205
|
+
// Bare 'translate-'/'skew-' (both axes) after their per-axis forms, same
|
|
206
|
+
// longer-before-shorter rule as resolvers/parser.rs.
|
|
205
207
|
"translate-x-",
|
|
206
208
|
"translate-y-",
|
|
207
209
|
"translate-z-",
|
|
210
|
+
"translate-",
|
|
208
211
|
"skew-x-",
|
|
209
212
|
"skew-y-",
|
|
213
|
+
"skew-",
|
|
210
214
|
"perspective-origin-",
|
|
211
215
|
"perspective-",
|
|
212
216
|
"origin-",
|
|
@@ -394,6 +398,7 @@ function decl(property, value) {
|
|
|
394
398
|
function spacingPx(theme, value) {
|
|
395
399
|
const fromTable = theme.spacing[value];
|
|
396
400
|
if (fromTable !== void 0) return fromTable;
|
|
401
|
+
if (value === "px") return 1;
|
|
397
402
|
const n = Number(value);
|
|
398
403
|
return Number.isFinite(n) && value.trim() !== "" ? n * 4 : void 0;
|
|
399
404
|
}
|
|
@@ -436,6 +441,7 @@ function fractionPercent(value) {
|
|
|
436
441
|
}
|
|
437
442
|
function resolveNegatableSize(theme, parsed) {
|
|
438
443
|
if (!parsed.isArbitrary && parsed.value !== null) {
|
|
444
|
+
if (parsed.negative && parsed.value === "full") return "-100%";
|
|
439
445
|
const pct = fractionPercent(parsed.value);
|
|
440
446
|
if (pct !== null) return parsed.negative ? `-${pct}` : pct;
|
|
441
447
|
}
|
|
@@ -694,7 +700,7 @@ function resolveFlex(parsed, web) {
|
|
|
694
700
|
case "shrink-0":
|
|
695
701
|
return [decl("flex-shrink", "0")];
|
|
696
702
|
default:
|
|
697
|
-
return null;
|
|
703
|
+
return /^\d+$/.test(value) ? [decl("flex", value)] : null;
|
|
698
704
|
}
|
|
699
705
|
}
|
|
700
706
|
|
|
@@ -938,8 +944,11 @@ function radiusSize(key) {
|
|
|
938
944
|
switch (key) {
|
|
939
945
|
case "none":
|
|
940
946
|
return "0px";
|
|
941
|
-
|
|
947
|
+
// Tailwind v4.3's radius scale: `sm` is 0.25rem (v3's 0.125rem is `xs`).
|
|
948
|
+
case "xs":
|
|
942
949
|
return "0.125rem";
|
|
950
|
+
case "sm":
|
|
951
|
+
return "0.25rem";
|
|
943
952
|
case "md":
|
|
944
953
|
return "0.375rem";
|
|
945
954
|
case "lg":
|
|
@@ -950,12 +959,19 @@ function radiusSize(key) {
|
|
|
950
959
|
return "1rem";
|
|
951
960
|
case "3xl":
|
|
952
961
|
return "1.5rem";
|
|
962
|
+
case "4xl":
|
|
963
|
+
return "2rem";
|
|
953
964
|
case "full":
|
|
954
965
|
return "9999px";
|
|
955
966
|
default:
|
|
956
967
|
return null;
|
|
957
968
|
}
|
|
958
969
|
}
|
|
970
|
+
function borderWidthPx(parsed) {
|
|
971
|
+
if (parsed.negative || parsed.isArbitrary || parsed.value === null) return null;
|
|
972
|
+
const n = Number(parsed.value);
|
|
973
|
+
return Number.isFinite(n) && n >= 0 && parsed.value.trim() !== "" ? `${n}px` : null;
|
|
974
|
+
}
|
|
959
975
|
function borderSideProperty(side) {
|
|
960
976
|
switch (side) {
|
|
961
977
|
case "t":
|
|
@@ -978,6 +994,15 @@ function borderValue(theme, parsed) {
|
|
|
978
994
|
if (side !== null) {
|
|
979
995
|
return [decl(`${side}-width`, "1px"), decl(`${side}-style`, "solid")];
|
|
980
996
|
}
|
|
997
|
+
const pair = value === "x" ? ["border-left", "border-right"] : value === "y" ? ["border-top", "border-bottom"] : null;
|
|
998
|
+
if (pair !== null) {
|
|
999
|
+
return [
|
|
1000
|
+
decl(`${pair[0]}-width`, "1px"),
|
|
1001
|
+
decl(`${pair[1]}-width`, "1px"),
|
|
1002
|
+
decl(`${pair[0]}-style`, "solid"),
|
|
1003
|
+
decl(`${pair[1]}-style`, "solid")
|
|
1004
|
+
];
|
|
1005
|
+
}
|
|
981
1006
|
if (value === "collapse") return [decl("border-collapse", "collapse")];
|
|
982
1007
|
if (value === "separate") return [decl("border-collapse", "separate")];
|
|
983
1008
|
}
|
|
@@ -987,7 +1012,7 @@ function borderValue(theme, parsed) {
|
|
|
987
1012
|
return color2 === null ? null : [decl("border-color", color2)];
|
|
988
1013
|
}
|
|
989
1014
|
if (Number.isFinite(Number(value)) && value.trim() !== "") {
|
|
990
|
-
const v =
|
|
1015
|
+
const v = borderWidthPx(parsed);
|
|
991
1016
|
return v === null ? null : [decl("border-width", v)];
|
|
992
1017
|
}
|
|
993
1018
|
if (value === "solid" || value === "dashed" || value === "dotted" || value === "double" || value === "hidden" || value === "none") {
|
|
@@ -1005,7 +1030,7 @@ function borderSideValue(theme, parsed, sideProperty) {
|
|
|
1005
1030
|
return color2 === null ? null : [decl(`${sideProperty}-color`, color2)];
|
|
1006
1031
|
}
|
|
1007
1032
|
if (Number.isFinite(Number(value)) && value.trim() !== "") {
|
|
1008
|
-
const v =
|
|
1033
|
+
const v = borderWidthPx(parsed);
|
|
1009
1034
|
return v === null ? null : [decl(`${sideProperty}-width`, v)];
|
|
1010
1035
|
}
|
|
1011
1036
|
if (value === "solid" || value === "dashed" || value === "dotted" || value === "double" || value === "hidden" || value === "none") {
|
|
@@ -1023,7 +1048,7 @@ function borderAxisValue(theme, parsed, sideA, sideB) {
|
|
|
1023
1048
|
return color2 === null ? null : [decl(`${sideA}-color`, color2), decl(`${sideB}-color`, color2)];
|
|
1024
1049
|
}
|
|
1025
1050
|
if (Number.isFinite(Number(value)) && value.trim() !== "") {
|
|
1026
|
-
const v =
|
|
1051
|
+
const v = borderWidthPx(parsed);
|
|
1027
1052
|
return v === null ? null : [decl(`${sideA}-width`, v), decl(`${sideB}-width`, v)];
|
|
1028
1053
|
}
|
|
1029
1054
|
if (value === "solid" || value === "dashed" || value === "dotted" || value === "double" || value === "hidden" || value === "none") {
|
|
@@ -1070,20 +1095,7 @@ function resolveRadiusSide(theme, parsed, side) {
|
|
|
1070
1095
|
}
|
|
1071
1096
|
var OUTLINE_STYLES = ["solid", "dashed", "dotted", "double"];
|
|
1072
1097
|
function outlineWidthValue(key) {
|
|
1073
|
-
|
|
1074
|
-
case "0":
|
|
1075
|
-
return "0px";
|
|
1076
|
-
case "1":
|
|
1077
|
-
return "1px";
|
|
1078
|
-
case "2":
|
|
1079
|
-
return "2px";
|
|
1080
|
-
case "4":
|
|
1081
|
-
return "4px";
|
|
1082
|
-
case "8":
|
|
1083
|
-
return "8px";
|
|
1084
|
-
default:
|
|
1085
|
-
return null;
|
|
1086
|
-
}
|
|
1098
|
+
return /^\d+$/.test(key) ? `${Number(key)}px` : null;
|
|
1087
1099
|
}
|
|
1088
1100
|
function outlineValue(theme, parsed) {
|
|
1089
1101
|
const value = parsed.value;
|
|
@@ -1106,48 +1118,6 @@ function outlineOffsetValue(parsed) {
|
|
|
1106
1118
|
const w = outlineWidthValue(value);
|
|
1107
1119
|
return w === null ? null : [decl("outline-offset", w)];
|
|
1108
1120
|
}
|
|
1109
|
-
var RING_BOX_SHADOW = "var(--kb-ring-inset,) 0 0 0 var(--kb-ring-offset-width, 0px) var(--kb-ring-offset-color, #fff), var(--kb-ring-inset,) 0 0 0 calc(var(--kb-ring-width, 0px) + var(--kb-ring-offset-width, 0px)) var(--kb-ring-color, rgba(59,130,246,0.5))";
|
|
1110
|
-
function ringWidth(key) {
|
|
1111
|
-
switch (key) {
|
|
1112
|
-
case "0":
|
|
1113
|
-
return "0px";
|
|
1114
|
-
case "1":
|
|
1115
|
-
return "1px";
|
|
1116
|
-
case "2":
|
|
1117
|
-
return "2px";
|
|
1118
|
-
case "4":
|
|
1119
|
-
return "4px";
|
|
1120
|
-
case "8":
|
|
1121
|
-
return "8px";
|
|
1122
|
-
default:
|
|
1123
|
-
return null;
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
function ringValue(theme, parsed) {
|
|
1127
|
-
const value = parsed.value;
|
|
1128
|
-
if (value === null) return null;
|
|
1129
|
-
if (value === "inset") {
|
|
1130
|
-
return [decl("--kb-ring-inset", "inset"), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1131
|
-
}
|
|
1132
|
-
if (!parsed.isArbitrary) {
|
|
1133
|
-
const w = ringWidth(value);
|
|
1134
|
-
if (w !== null) return [decl("--kb-ring-width", w), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1135
|
-
}
|
|
1136
|
-
const color = colorValue(theme, parsed);
|
|
1137
|
-
if (color === null) return null;
|
|
1138
|
-
return [decl("--kb-ring-color", color), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1139
|
-
}
|
|
1140
|
-
function ringOffsetValue(theme, parsed) {
|
|
1141
|
-
const value = parsed.value;
|
|
1142
|
-
if (value === null) return null;
|
|
1143
|
-
if (!parsed.isArbitrary) {
|
|
1144
|
-
const w = ringWidth(value);
|
|
1145
|
-
if (w !== null) return [decl("--kb-ring-offset-width", w), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1146
|
-
}
|
|
1147
|
-
const color = colorValue(theme, parsed);
|
|
1148
|
-
if (color === null) return null;
|
|
1149
|
-
return [decl("--kb-ring-offset-color", color), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1150
|
-
}
|
|
1151
1121
|
var RADIUS_SIDES = /* @__PURE__ */ new Set(["t", "r", "b", "l", "tl", "tr", "br", "bl"]);
|
|
1152
1122
|
function resolve3(parsed, theme) {
|
|
1153
1123
|
switch (parsed.utility) {
|
|
@@ -1176,14 +1146,19 @@ function resolve3(parsed, theme) {
|
|
|
1176
1146
|
const v = resolveLength(theme, parsed);
|
|
1177
1147
|
return v === null ? null : [decl("border-radius", v)];
|
|
1178
1148
|
}
|
|
1149
|
+
// Rings are web-only (a var()-composed CSS box-shadow React Native can't
|
|
1150
|
+
// parse) — same as resolvers/mod.rs's native dispatcher.
|
|
1179
1151
|
case "ring":
|
|
1180
|
-
if (parsed.value === null) return [decl("--kb-ring-width", "3px"), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1181
|
-
return ringValue(theme, parsed);
|
|
1182
1152
|
case "ring-offset":
|
|
1183
|
-
return
|
|
1153
|
+
return null;
|
|
1154
|
+
// Outlines: the same final native style the Rust engine produces once
|
|
1155
|
+
// its var()-based web declarations are filtered out (resolve_style.rs):
|
|
1156
|
+
// bare `outline` is a 1px width, `outline-none` is outline-style: none,
|
|
1157
|
+
// `outline-hidden` keeps only its offset (RN has no `outline` shorthand).
|
|
1184
1158
|
case "outline":
|
|
1185
|
-
if (parsed.value === null) return [decl("outline-
|
|
1186
|
-
if (parsed.value === "none") return [decl("outline", "none")];
|
|
1159
|
+
if (parsed.value === null) return [decl("outline-width", "1px")];
|
|
1160
|
+
if (parsed.value === "none") return [decl("outline-style", "none")];
|
|
1161
|
+
if (!parsed.isArbitrary && parsed.value === "hidden") return [decl("outline-offset", "2px")];
|
|
1187
1162
|
return outlineValue(theme, parsed);
|
|
1188
1163
|
case "outline-offset":
|
|
1189
1164
|
return outlineOffsetValue(parsed);
|
|
@@ -1229,26 +1204,10 @@ function textSize(key) {
|
|
|
1229
1204
|
}
|
|
1230
1205
|
}
|
|
1231
1206
|
function lineHeightSize(key) {
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
return "1rem";
|
|
1237
|
-
case "5":
|
|
1238
|
-
return "1.25rem";
|
|
1239
|
-
case "6":
|
|
1240
|
-
return "1.5rem";
|
|
1241
|
-
case "7":
|
|
1242
|
-
return "1.75rem";
|
|
1243
|
-
case "8":
|
|
1244
|
-
return "2rem";
|
|
1245
|
-
case "9":
|
|
1246
|
-
return "2.25rem";
|
|
1247
|
-
case "10":
|
|
1248
|
-
return "2.5rem";
|
|
1249
|
-
default:
|
|
1250
|
-
return null;
|
|
1251
|
-
}
|
|
1207
|
+
if (key === "px") return "1px";
|
|
1208
|
+
if (key.trim() === "") return null;
|
|
1209
|
+
const n = Number(key);
|
|
1210
|
+
return Number.isFinite(n) && n >= 0 ? `${n * 0.25}rem` : null;
|
|
1252
1211
|
}
|
|
1253
1212
|
function textAlign(key) {
|
|
1254
1213
|
switch (key) {
|
|
@@ -1312,8 +1271,14 @@ function fontFamilyValue(theme, key) {
|
|
|
1312
1271
|
// src/jsEngine/resolvers/effects.ts
|
|
1313
1272
|
function nativeShadowValue(key) {
|
|
1314
1273
|
switch (key) {
|
|
1315
|
-
|
|
1274
|
+
// Tailwind v4.3's scale, like effects.rs: `sm` is the default shadow,
|
|
1275
|
+
// v3's `sm` is `xs`.
|
|
1276
|
+
case "2xs":
|
|
1277
|
+
return { offsetY: 1, radius: 0, opacity: 0.05, elevation: 1 };
|
|
1278
|
+
case "xs":
|
|
1316
1279
|
return { offsetY: 1, radius: 2, opacity: 0.05, elevation: 1 };
|
|
1280
|
+
case "sm":
|
|
1281
|
+
return { offsetY: 1, radius: 3, opacity: 0.1, elevation: 2 };
|
|
1317
1282
|
case "DEFAULT":
|
|
1318
1283
|
return { offsetY: 1, radius: 3, opacity: 0.1, elevation: 2 };
|
|
1319
1284
|
case "md":
|
|
@@ -1363,6 +1328,16 @@ function resolveNative(parsed, theme) {
|
|
|
1363
1328
|
switch (parsed.utility) {
|
|
1364
1329
|
case "transform-none":
|
|
1365
1330
|
return [decl("transform-op-none", "1")];
|
|
1331
|
+
// Both axes at once (`translate-4`, `-skew-3`); mirrors transform.rs.
|
|
1332
|
+
case "translate": {
|
|
1333
|
+
if (!parsed.isArbitrary && parsed.value === "none") return [decl("transform-op-translate-x", "0"), decl("transform-op-translate-y", "0")];
|
|
1334
|
+
const v = resolveNegatableSize(theme, parsed);
|
|
1335
|
+
return v === null ? null : [decl("transform-op-translate-x", v), decl("transform-op-translate-y", v)];
|
|
1336
|
+
}
|
|
1337
|
+
case "skew": {
|
|
1338
|
+
const deg = angle(parsed);
|
|
1339
|
+
return deg === null ? null : [decl("transform-op-skew-x", deg), decl("transform-op-skew-y", deg)];
|
|
1340
|
+
}
|
|
1366
1341
|
case "backface-visible":
|
|
1367
1342
|
return [decl("backface-visibility", "visible")];
|
|
1368
1343
|
case "backface-hidden":
|
|
@@ -1376,6 +1351,7 @@ function resolveNative(parsed, theme) {
|
|
|
1376
1351
|
return v === null ? null : [decl("transform-op-translate-y", v)];
|
|
1377
1352
|
}
|
|
1378
1353
|
case "scale": {
|
|
1354
|
+
if (!parsed.isArbitrary && parsed.value === "none") return [decl("transform-op-scale-x", "1"), decl("transform-op-scale-y", "1")];
|
|
1379
1355
|
const n = scaleFactor(parsed);
|
|
1380
1356
|
return n === null ? null : [decl("transform-op-scale-x", `${n}`), decl("transform-op-scale-y", `${n}`)];
|
|
1381
1357
|
}
|
|
@@ -1388,6 +1364,7 @@ function resolveNative(parsed, theme) {
|
|
|
1388
1364
|
return n === null ? null : [decl("transform-op-scale-y", `${n}`)];
|
|
1389
1365
|
}
|
|
1390
1366
|
case "rotate": {
|
|
1367
|
+
if (!parsed.isArbitrary && parsed.value === "none") return [decl("transform-op-rotate", "0deg")];
|
|
1391
1368
|
const deg = angle(parsed);
|
|
1392
1369
|
return deg === null ? null : [decl("transform-op-rotate", deg)];
|
|
1393
1370
|
}
|
|
@@ -1832,6 +1809,9 @@ function resolveStyleJsWithWarnings(classString, theme, colorScheme, pressed, wi
|
|
|
1832
1809
|
if (d.property.startsWith("__")) {
|
|
1833
1810
|
continue;
|
|
1834
1811
|
}
|
|
1812
|
+
if (d.property.startsWith("--") || d.value.includes("var(") || d.property === "outline" || d.property === "object-position" || d.property === "container-type") {
|
|
1813
|
+
continue;
|
|
1814
|
+
}
|
|
1835
1815
|
if (d.property === "shadow-offset-x" || d.property === "shadow-offset-y") {
|
|
1836
1816
|
if (spec < (keySpecificity.get("shadowOffset") ?? 0)) continue;
|
|
1837
1817
|
const n = Number(d.value);
|