@kbach/react-native 1.0.0-beta.52 → 1.0.0-beta.54
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 +78 -6
- package/README.md +21 -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-MLBH2JYH.mjs +575 -0
- package/dist/{chunk-23JJORPW.mjs → chunk-NPDSBCXR.mjs} +1 -1
- package/dist/{chunk-HVGMZKV7.mjs → chunk-NXRSUBSY.mjs} +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +119 -87
- package/dist/index.web.d.ts +2 -1
- package/dist/index.web.js +53 -1
- package/dist/index.web.mjs +36 -2
- package/dist/jsx-dev-runtime.d.ts +2 -2
- package/dist/jsx-dev-runtime.js +67 -87
- package/dist/jsx-dev-runtime.web.d.ts +2 -2
- package/dist/jsx-dev-runtime.web.js +1 -1
- package/dist/jsx-dev-runtime.web.mjs +3 -3
- package/dist/jsx-runtime.d.ts +3 -3
- package/dist/jsx-runtime.js +67 -87
- package/dist/jsx-runtime.web.d.ts +3 -3
- package/dist/jsx-runtime.web.js +1 -1
- package/dist/jsx-runtime.web.mjs +2 -2
- package/dist/{clsx-BLLSnqAa.d.ts → semanticElements-Bk3TB-vt.d.ts} +60 -3
- package/dist/theme.js +16 -7
- package/package.json +3 -2
- package/dist/chunk-Z5Q3FGXR.mjs +0 -566
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-NPDSBCXR.mjs";
|
|
2
2
|
import {
|
|
3
3
|
Fragment,
|
|
4
4
|
jsx,
|
|
5
5
|
jsxs
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-NXRSUBSY.mjs";
|
|
7
|
+
import "./chunk-MLBH2JYH.mjs";
|
|
8
8
|
|
|
9
9
|
// src/jsxRuntimeCore.ts
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
export { Fragment, JSX } from 'react';
|
|
3
3
|
|
|
4
|
-
declare const jsx: (type: unknown, props: Record<string, unknown> | null, key?: string) =>
|
|
5
|
-
declare const jsxs: (type: unknown, props: Record<string, unknown> | null, key?: string) =>
|
|
4
|
+
declare const jsx: (type: unknown, props: Record<string, unknown> | null, key?: string) => React.ReactElement;
|
|
5
|
+
declare const jsxs: (type: unknown, props: Record<string, unknown> | null, key?: string) => React.ReactElement;
|
|
6
6
|
|
|
7
7
|
export { jsx, jsxs };
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -564,11 +564,15 @@ var VALUE_PREFIXES = [
|
|
|
564
564
|
"rotate-y-",
|
|
565
565
|
"rotate-z-",
|
|
566
566
|
"rotate-",
|
|
567
|
+
// Bare 'translate-'/'skew-' (both axes) after their per-axis forms, same
|
|
568
|
+
// longer-before-shorter rule as resolvers/parser.rs.
|
|
567
569
|
"translate-x-",
|
|
568
570
|
"translate-y-",
|
|
569
571
|
"translate-z-",
|
|
572
|
+
"translate-",
|
|
570
573
|
"skew-x-",
|
|
571
574
|
"skew-y-",
|
|
575
|
+
"skew-",
|
|
572
576
|
"perspective-origin-",
|
|
573
577
|
"perspective-",
|
|
574
578
|
"origin-",
|
|
@@ -983,6 +987,7 @@ function decl(property, value) {
|
|
|
983
987
|
function spacingPx(theme, value) {
|
|
984
988
|
const fromTable = theme.spacing[value];
|
|
985
989
|
if (fromTable !== void 0) return fromTable;
|
|
990
|
+
if (value === "px") return 1;
|
|
986
991
|
const n = Number(value);
|
|
987
992
|
return Number.isFinite(n) && value.trim() !== "" ? n * 4 : void 0;
|
|
988
993
|
}
|
|
@@ -1025,6 +1030,7 @@ function fractionPercent(value) {
|
|
|
1025
1030
|
}
|
|
1026
1031
|
function resolveNegatableSize(theme, parsed) {
|
|
1027
1032
|
if (!parsed.isArbitrary && parsed.value !== null) {
|
|
1033
|
+
if (parsed.negative && parsed.value === "full") return "-100%";
|
|
1028
1034
|
const pct = fractionPercent(parsed.value);
|
|
1029
1035
|
if (pct !== null) return parsed.negative ? `-${pct}` : pct;
|
|
1030
1036
|
}
|
|
@@ -1283,7 +1289,7 @@ function resolveFlex(parsed, web) {
|
|
|
1283
1289
|
case "shrink-0":
|
|
1284
1290
|
return [decl("flex-shrink", "0")];
|
|
1285
1291
|
default:
|
|
1286
|
-
return null;
|
|
1292
|
+
return /^\d+$/.test(value) ? [decl("flex", value)] : null;
|
|
1287
1293
|
}
|
|
1288
1294
|
}
|
|
1289
1295
|
|
|
@@ -1456,8 +1462,11 @@ function radiusSize(key) {
|
|
|
1456
1462
|
switch (key) {
|
|
1457
1463
|
case "none":
|
|
1458
1464
|
return "0px";
|
|
1459
|
-
|
|
1465
|
+
// Tailwind v4.3's radius scale: `sm` is 0.25rem (v3's 0.125rem is `xs`).
|
|
1466
|
+
case "xs":
|
|
1460
1467
|
return "0.125rem";
|
|
1468
|
+
case "sm":
|
|
1469
|
+
return "0.25rem";
|
|
1461
1470
|
case "md":
|
|
1462
1471
|
return "0.375rem";
|
|
1463
1472
|
case "lg":
|
|
@@ -1468,12 +1477,19 @@ function radiusSize(key) {
|
|
|
1468
1477
|
return "1rem";
|
|
1469
1478
|
case "3xl":
|
|
1470
1479
|
return "1.5rem";
|
|
1480
|
+
case "4xl":
|
|
1481
|
+
return "2rem";
|
|
1471
1482
|
case "full":
|
|
1472
1483
|
return "9999px";
|
|
1473
1484
|
default:
|
|
1474
1485
|
return null;
|
|
1475
1486
|
}
|
|
1476
1487
|
}
|
|
1488
|
+
function borderWidthPx(parsed) {
|
|
1489
|
+
if (parsed.negative || parsed.isArbitrary || parsed.value === null) return null;
|
|
1490
|
+
const n = Number(parsed.value);
|
|
1491
|
+
return Number.isFinite(n) && n >= 0 && parsed.value.trim() !== "" ? `${n}px` : null;
|
|
1492
|
+
}
|
|
1477
1493
|
function borderSideProperty(side) {
|
|
1478
1494
|
switch (side) {
|
|
1479
1495
|
case "t":
|
|
@@ -1496,6 +1512,15 @@ function borderValue(theme, parsed) {
|
|
|
1496
1512
|
if (side !== null) {
|
|
1497
1513
|
return [decl(`${side}-width`, "1px"), decl(`${side}-style`, "solid")];
|
|
1498
1514
|
}
|
|
1515
|
+
const pair = value === "x" ? ["border-left", "border-right"] : value === "y" ? ["border-top", "border-bottom"] : null;
|
|
1516
|
+
if (pair !== null) {
|
|
1517
|
+
return [
|
|
1518
|
+
decl(`${pair[0]}-width`, "1px"),
|
|
1519
|
+
decl(`${pair[1]}-width`, "1px"),
|
|
1520
|
+
decl(`${pair[0]}-style`, "solid"),
|
|
1521
|
+
decl(`${pair[1]}-style`, "solid")
|
|
1522
|
+
];
|
|
1523
|
+
}
|
|
1499
1524
|
if (value === "collapse") return [decl("border-collapse", "collapse")];
|
|
1500
1525
|
if (value === "separate") return [decl("border-collapse", "separate")];
|
|
1501
1526
|
}
|
|
@@ -1505,7 +1530,7 @@ function borderValue(theme, parsed) {
|
|
|
1505
1530
|
return color2 === null ? null : [decl("border-color", color2)];
|
|
1506
1531
|
}
|
|
1507
1532
|
if (Number.isFinite(Number(value)) && value.trim() !== "") {
|
|
1508
|
-
const v =
|
|
1533
|
+
const v = borderWidthPx(parsed);
|
|
1509
1534
|
return v === null ? null : [decl("border-width", v)];
|
|
1510
1535
|
}
|
|
1511
1536
|
if (value === "solid" || value === "dashed" || value === "dotted" || value === "double" || value === "hidden" || value === "none") {
|
|
@@ -1523,7 +1548,7 @@ function borderSideValue(theme, parsed, sideProperty) {
|
|
|
1523
1548
|
return color2 === null ? null : [decl(`${sideProperty}-color`, color2)];
|
|
1524
1549
|
}
|
|
1525
1550
|
if (Number.isFinite(Number(value)) && value.trim() !== "") {
|
|
1526
|
-
const v =
|
|
1551
|
+
const v = borderWidthPx(parsed);
|
|
1527
1552
|
return v === null ? null : [decl(`${sideProperty}-width`, v)];
|
|
1528
1553
|
}
|
|
1529
1554
|
if (value === "solid" || value === "dashed" || value === "dotted" || value === "double" || value === "hidden" || value === "none") {
|
|
@@ -1541,7 +1566,7 @@ function borderAxisValue(theme, parsed, sideA, sideB) {
|
|
|
1541
1566
|
return color2 === null ? null : [decl(`${sideA}-color`, color2), decl(`${sideB}-color`, color2)];
|
|
1542
1567
|
}
|
|
1543
1568
|
if (Number.isFinite(Number(value)) && value.trim() !== "") {
|
|
1544
|
-
const v =
|
|
1569
|
+
const v = borderWidthPx(parsed);
|
|
1545
1570
|
return v === null ? null : [decl(`${sideA}-width`, v), decl(`${sideB}-width`, v)];
|
|
1546
1571
|
}
|
|
1547
1572
|
if (value === "solid" || value === "dashed" || value === "dotted" || value === "double" || value === "hidden" || value === "none") {
|
|
@@ -1588,20 +1613,7 @@ function resolveRadiusSide(theme, parsed, side) {
|
|
|
1588
1613
|
}
|
|
1589
1614
|
var OUTLINE_STYLES = ["solid", "dashed", "dotted", "double"];
|
|
1590
1615
|
function outlineWidthValue(key) {
|
|
1591
|
-
|
|
1592
|
-
case "0":
|
|
1593
|
-
return "0px";
|
|
1594
|
-
case "1":
|
|
1595
|
-
return "1px";
|
|
1596
|
-
case "2":
|
|
1597
|
-
return "2px";
|
|
1598
|
-
case "4":
|
|
1599
|
-
return "4px";
|
|
1600
|
-
case "8":
|
|
1601
|
-
return "8px";
|
|
1602
|
-
default:
|
|
1603
|
-
return null;
|
|
1604
|
-
}
|
|
1616
|
+
return /^\d+$/.test(key) ? `${Number(key)}px` : null;
|
|
1605
1617
|
}
|
|
1606
1618
|
function outlineValue(theme, parsed) {
|
|
1607
1619
|
const value = parsed.value;
|
|
@@ -1624,48 +1636,6 @@ function outlineOffsetValue(parsed) {
|
|
|
1624
1636
|
const w = outlineWidthValue(value);
|
|
1625
1637
|
return w === null ? null : [decl("outline-offset", w)];
|
|
1626
1638
|
}
|
|
1627
|
-
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))";
|
|
1628
|
-
function ringWidth(key) {
|
|
1629
|
-
switch (key) {
|
|
1630
|
-
case "0":
|
|
1631
|
-
return "0px";
|
|
1632
|
-
case "1":
|
|
1633
|
-
return "1px";
|
|
1634
|
-
case "2":
|
|
1635
|
-
return "2px";
|
|
1636
|
-
case "4":
|
|
1637
|
-
return "4px";
|
|
1638
|
-
case "8":
|
|
1639
|
-
return "8px";
|
|
1640
|
-
default:
|
|
1641
|
-
return null;
|
|
1642
|
-
}
|
|
1643
|
-
}
|
|
1644
|
-
function ringValue(theme, parsed) {
|
|
1645
|
-
const value = parsed.value;
|
|
1646
|
-
if (value === null) return null;
|
|
1647
|
-
if (value === "inset") {
|
|
1648
|
-
return [decl("--kb-ring-inset", "inset"), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1649
|
-
}
|
|
1650
|
-
if (!parsed.isArbitrary) {
|
|
1651
|
-
const w = ringWidth(value);
|
|
1652
|
-
if (w !== null) return [decl("--kb-ring-width", w), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1653
|
-
}
|
|
1654
|
-
const color = colorValue(theme, parsed);
|
|
1655
|
-
if (color === null) return null;
|
|
1656
|
-
return [decl("--kb-ring-color", color), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1657
|
-
}
|
|
1658
|
-
function ringOffsetValue(theme, parsed) {
|
|
1659
|
-
const value = parsed.value;
|
|
1660
|
-
if (value === null) return null;
|
|
1661
|
-
if (!parsed.isArbitrary) {
|
|
1662
|
-
const w = ringWidth(value);
|
|
1663
|
-
if (w !== null) return [decl("--kb-ring-offset-width", w), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1664
|
-
}
|
|
1665
|
-
const color = colorValue(theme, parsed);
|
|
1666
|
-
if (color === null) return null;
|
|
1667
|
-
return [decl("--kb-ring-offset-color", color), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1668
|
-
}
|
|
1669
1639
|
var RADIUS_SIDES = /* @__PURE__ */ new Set(["t", "r", "b", "l", "tl", "tr", "br", "bl"]);
|
|
1670
1640
|
function resolve3(parsed, theme) {
|
|
1671
1641
|
switch (parsed.utility) {
|
|
@@ -1694,14 +1664,19 @@ function resolve3(parsed, theme) {
|
|
|
1694
1664
|
const v = resolveLength(theme, parsed);
|
|
1695
1665
|
return v === null ? null : [decl("border-radius", v)];
|
|
1696
1666
|
}
|
|
1667
|
+
// Rings are web-only (a var()-composed CSS box-shadow React Native can't
|
|
1668
|
+
// parse) — same as resolvers/mod.rs's native dispatcher.
|
|
1697
1669
|
case "ring":
|
|
1698
|
-
if (parsed.value === null) return [decl("--kb-ring-width", "3px"), decl("box-shadow", RING_BOX_SHADOW)];
|
|
1699
|
-
return ringValue(theme, parsed);
|
|
1700
1670
|
case "ring-offset":
|
|
1701
|
-
return
|
|
1671
|
+
return null;
|
|
1672
|
+
// Outlines: the same final native style the Rust engine produces once
|
|
1673
|
+
// its var()-based web declarations are filtered out (resolve_style.rs):
|
|
1674
|
+
// bare `outline` is a 1px width, `outline-none` is outline-style: none,
|
|
1675
|
+
// `outline-hidden` keeps only its offset (RN has no `outline` shorthand).
|
|
1702
1676
|
case "outline":
|
|
1703
|
-
if (parsed.value === null) return [decl("outline-
|
|
1704
|
-
if (parsed.value === "none") return [decl("outline", "none")];
|
|
1677
|
+
if (parsed.value === null) return [decl("outline-width", "1px")];
|
|
1678
|
+
if (parsed.value === "none") return [decl("outline-style", "none")];
|
|
1679
|
+
if (!parsed.isArbitrary && parsed.value === "hidden") return [decl("outline-offset", "2px")];
|
|
1705
1680
|
return outlineValue(theme, parsed);
|
|
1706
1681
|
case "outline-offset":
|
|
1707
1682
|
return outlineOffsetValue(parsed);
|
|
@@ -1747,26 +1722,10 @@ function textSize(key) {
|
|
|
1747
1722
|
}
|
|
1748
1723
|
}
|
|
1749
1724
|
function lineHeightSize(key) {
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
return "1rem";
|
|
1755
|
-
case "5":
|
|
1756
|
-
return "1.25rem";
|
|
1757
|
-
case "6":
|
|
1758
|
-
return "1.5rem";
|
|
1759
|
-
case "7":
|
|
1760
|
-
return "1.75rem";
|
|
1761
|
-
case "8":
|
|
1762
|
-
return "2rem";
|
|
1763
|
-
case "9":
|
|
1764
|
-
return "2.25rem";
|
|
1765
|
-
case "10":
|
|
1766
|
-
return "2.5rem";
|
|
1767
|
-
default:
|
|
1768
|
-
return null;
|
|
1769
|
-
}
|
|
1725
|
+
if (key === "px") return "1px";
|
|
1726
|
+
if (key.trim() === "") return null;
|
|
1727
|
+
const n = Number(key);
|
|
1728
|
+
return Number.isFinite(n) && n >= 0 ? `${n * 0.25}rem` : null;
|
|
1770
1729
|
}
|
|
1771
1730
|
function textAlign(key) {
|
|
1772
1731
|
switch (key) {
|
|
@@ -1830,8 +1789,14 @@ function fontFamilyValue(theme, key) {
|
|
|
1830
1789
|
// src/jsEngine/resolvers/effects.ts
|
|
1831
1790
|
function nativeShadowValue(key) {
|
|
1832
1791
|
switch (key) {
|
|
1833
|
-
|
|
1792
|
+
// Tailwind v4.3's scale, like effects.rs: `sm` is the default shadow,
|
|
1793
|
+
// v3's `sm` is `xs`.
|
|
1794
|
+
case "2xs":
|
|
1795
|
+
return { offsetY: 1, radius: 0, opacity: 0.05, elevation: 1 };
|
|
1796
|
+
case "xs":
|
|
1834
1797
|
return { offsetY: 1, radius: 2, opacity: 0.05, elevation: 1 };
|
|
1798
|
+
case "sm":
|
|
1799
|
+
return { offsetY: 1, radius: 3, opacity: 0.1, elevation: 2 };
|
|
1835
1800
|
case "DEFAULT":
|
|
1836
1801
|
return { offsetY: 1, radius: 3, opacity: 0.1, elevation: 2 };
|
|
1837
1802
|
case "md":
|
|
@@ -1881,6 +1846,16 @@ function resolveNative(parsed, theme) {
|
|
|
1881
1846
|
switch (parsed.utility) {
|
|
1882
1847
|
case "transform-none":
|
|
1883
1848
|
return [decl("transform-op-none", "1")];
|
|
1849
|
+
// Both axes at once (`translate-4`, `-skew-3`); mirrors transform.rs.
|
|
1850
|
+
case "translate": {
|
|
1851
|
+
if (!parsed.isArbitrary && parsed.value === "none") return [decl("transform-op-translate-x", "0"), decl("transform-op-translate-y", "0")];
|
|
1852
|
+
const v = resolveNegatableSize(theme, parsed);
|
|
1853
|
+
return v === null ? null : [decl("transform-op-translate-x", v), decl("transform-op-translate-y", v)];
|
|
1854
|
+
}
|
|
1855
|
+
case "skew": {
|
|
1856
|
+
const deg = angle(parsed);
|
|
1857
|
+
return deg === null ? null : [decl("transform-op-skew-x", deg), decl("transform-op-skew-y", deg)];
|
|
1858
|
+
}
|
|
1884
1859
|
case "backface-visible":
|
|
1885
1860
|
return [decl("backface-visibility", "visible")];
|
|
1886
1861
|
case "backface-hidden":
|
|
@@ -1894,6 +1869,7 @@ function resolveNative(parsed, theme) {
|
|
|
1894
1869
|
return v === null ? null : [decl("transform-op-translate-y", v)];
|
|
1895
1870
|
}
|
|
1896
1871
|
case "scale": {
|
|
1872
|
+
if (!parsed.isArbitrary && parsed.value === "none") return [decl("transform-op-scale-x", "1"), decl("transform-op-scale-y", "1")];
|
|
1897
1873
|
const n = scaleFactor(parsed);
|
|
1898
1874
|
return n === null ? null : [decl("transform-op-scale-x", `${n}`), decl("transform-op-scale-y", `${n}`)];
|
|
1899
1875
|
}
|
|
@@ -1906,6 +1882,7 @@ function resolveNative(parsed, theme) {
|
|
|
1906
1882
|
return n === null ? null : [decl("transform-op-scale-y", `${n}`)];
|
|
1907
1883
|
}
|
|
1908
1884
|
case "rotate": {
|
|
1885
|
+
if (!parsed.isArbitrary && parsed.value === "none") return [decl("transform-op-rotate", "0deg")];
|
|
1909
1886
|
const deg = angle(parsed);
|
|
1910
1887
|
return deg === null ? null : [decl("transform-op-rotate", deg)];
|
|
1911
1888
|
}
|
|
@@ -2203,6 +2180,9 @@ function resolveStyleJsWithWarnings(classString, theme, colorScheme, pressed, wi
|
|
|
2203
2180
|
if (d.property.startsWith("__")) {
|
|
2204
2181
|
continue;
|
|
2205
2182
|
}
|
|
2183
|
+
if (d.property.startsWith("--") || d.value.includes("var(") || d.property === "outline" || d.property === "object-position" || d.property === "container-type") {
|
|
2184
|
+
continue;
|
|
2185
|
+
}
|
|
2206
2186
|
if (d.property === "shadow-offset-x" || d.property === "shadow-offset-y") {
|
|
2207
2187
|
if (spec < (keySpecificity.get("shadowOffset") ?? 0)) continue;
|
|
2208
2188
|
const n = Number(d.value);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
export { Fragment, JSX } from 'react';
|
|
3
3
|
|
|
4
|
-
declare const jsx: (type: unknown, props: Record<string, unknown> | null, key?: string) =>
|
|
5
|
-
declare const jsxs: (type: unknown, props: Record<string, unknown> | null, key?: string) =>
|
|
4
|
+
declare const jsx: (type: unknown, props: Record<string, unknown> | null, key?: string) => React.ReactElement;
|
|
5
|
+
declare const jsxs: (type: unknown, props: Record<string, unknown> | null, key?: string) => React.ReactElement;
|
|
6
6
|
|
|
7
7
|
export { jsx, jsxs };
|