@kbach/react-native 1.0.0-beta.43 → 1.0.0-beta.44

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getTheme
3
- } from "./chunk-BTIGG7K2.mjs";
3
+ } from "./chunk-DKZM4NUU.mjs";
4
4
 
5
5
  // src/darkModeStore.ts
6
6
  import { Appearance } from "react-native";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveClassName
3
- } from "./chunk-BTIGG7K2.mjs";
3
+ } from "./chunk-DKZM4NUU.mjs";
4
4
 
5
5
  // src/jsxRuntimeCoreWeb.ts
6
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
package/dist/index.js CHANGED
@@ -908,6 +908,12 @@ function colorValue(theme, parsed) {
908
908
  if (rgb === null) return hex;
909
909
  return `rgba(${rgb.join(",")},${opacity / 100})`;
910
910
  }
911
+ var LENGTH_UNITS = ["px", "rem", "em", "%", "vh", "vw"];
912
+ function looksLikeLength(value) {
913
+ const unit = LENGTH_UNITS.find((u) => value.endsWith(u));
914
+ const withoutUnit = unit ? value.slice(0, value.length - unit.length) : value;
915
+ return withoutUnit !== "" && Number.isFinite(Number(withoutUnit));
916
+ }
911
917
 
912
918
  // src/jsEngine/resolvers/border.ts
913
919
  function radiusSize(key) {
@@ -958,7 +964,9 @@ function borderValue(theme, parsed) {
958
964
  if (value === "separate") return [decl("border-collapse", "separate")];
959
965
  }
960
966
  if (parsed.isArbitrary) {
961
- return [decl("border-width", value)];
967
+ if (looksLikeLength(value)) return [decl("border-width", value)];
968
+ const color2 = colorValue(theme, parsed);
969
+ return color2 === null ? null : [decl("border-color", color2)];
962
970
  }
963
971
  if (Number.isFinite(Number(value)) && value.trim() !== "") {
964
972
  const v = resolveLength(theme, parsed);
@@ -973,7 +981,11 @@ function borderValue(theme, parsed) {
973
981
  function borderSideValue(theme, parsed, sideProperty) {
974
982
  const value = parsed.value;
975
983
  if (value === null) return null;
976
- if (parsed.isArbitrary) return [decl(`${sideProperty}-width`, value)];
984
+ if (parsed.isArbitrary) {
985
+ if (looksLikeLength(value)) return [decl(`${sideProperty}-width`, value)];
986
+ const color2 = colorValue(theme, parsed);
987
+ return color2 === null ? null : [decl(`${sideProperty}-color`, color2)];
988
+ }
977
989
  if (Number.isFinite(Number(value)) && value.trim() !== "") {
978
990
  const v = resolveLength(theme, parsed);
979
991
  return v === null ? null : [decl(`${sideProperty}-width`, v)];
@@ -987,7 +999,11 @@ function borderSideValue(theme, parsed, sideProperty) {
987
999
  function borderAxisValue(theme, parsed, sideA, sideB) {
988
1000
  const value = parsed.value;
989
1001
  if (value === null) return null;
990
- if (parsed.isArbitrary) return [decl(`${sideA}-width`, value), decl(`${sideB}-width`, value)];
1002
+ if (parsed.isArbitrary) {
1003
+ if (looksLikeLength(value)) return [decl(`${sideA}-width`, value), decl(`${sideB}-width`, value)];
1004
+ const color2 = colorValue(theme, parsed);
1005
+ return color2 === null ? null : [decl(`${sideA}-color`, color2), decl(`${sideB}-color`, color2)];
1006
+ }
991
1007
  if (Number.isFinite(Number(value)) && value.trim() !== "") {
992
1008
  const v = resolveLength(theme, parsed);
993
1009
  return v === null ? null : [decl(`${sideA}-width`, v), decl(`${sideB}-width`, v)];
@@ -1054,7 +1070,11 @@ function outlineWidthValue(key) {
1054
1070
  function outlineValue(theme, parsed) {
1055
1071
  const value = parsed.value;
1056
1072
  if (value === null) return null;
1057
- if (parsed.isArbitrary) return [decl("outline-width", value)];
1073
+ if (parsed.isArbitrary) {
1074
+ if (looksLikeLength(value)) return [decl("outline-width", value)];
1075
+ const color2 = colorValue(theme, parsed);
1076
+ return color2 === null ? null : [decl("outline-color", color2)];
1077
+ }
1058
1078
  const w = outlineWidthValue(value);
1059
1079
  if (w !== null) return [decl("outline-width", w)];
1060
1080
  if (OUTLINE_STYLES.includes(value)) return [decl("outline-style", value)];