@vellira-ui/react-native 2.100.0 → 2.100.1
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/dist/index.js +7 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,6 +11,12 @@ const componentShadowLevels = [
|
|
|
11
11
|
"lg",
|
|
12
12
|
"xl"
|
|
13
13
|
];
|
|
14
|
+
const reactNativeShadowApproximationLevel = {
|
|
15
|
+
sm: "sm",
|
|
16
|
+
md: "md",
|
|
17
|
+
lg: "lg",
|
|
18
|
+
xl: "lg"
|
|
19
|
+
};
|
|
14
20
|
function hasExactKeys(candidate, expectedKeys) {
|
|
15
21
|
const actualKeys = Object.keys(candidate);
|
|
16
22
|
return actualKeys.length === expectedKeys.length && actualKeys.every((key) => expectedKeys.includes(key));
|
|
@@ -41,7 +47,7 @@ function resolveIntentForWeb(theme, intent) {
|
|
|
41
47
|
function resolveIntentForReactNative(theme, intent) {
|
|
42
48
|
if (intent.kind === "viewport-height") return `${formatPercentage(intent.ratio)}%`;
|
|
43
49
|
if (intent.role === "focus-ring" || intent.role === "none") return null;
|
|
44
|
-
const nativeLevel = intent.level
|
|
50
|
+
const nativeLevel = reactNativeShadowApproximationLevel[intent.level];
|
|
45
51
|
return theme.tokens.shadows[nativeLevel];
|
|
46
52
|
}
|
|
47
53
|
function adaptComponentTokenTree(value, resolveIntent) {
|