@oxy.so/services 11.2.0-oxy-one.4 → 11.2.0-oxy-one.6
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/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRulesScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/package.json +4 -4
- package/src/ui/screens/trust/TrustCenterScreen.tsx +1 -1
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +1 -1
- package/src/ui/screens/trust/TrustRulesScreen.tsx +1 -1
- package/lib/commonjs/ui/components/styles/overlay.js +0 -83
- package/lib/commonjs/ui/components/styles/overlay.js.map +0 -1
- package/lib/commonjs/ui/components/styles/shadow.js +0 -127
- package/lib/commonjs/ui/components/styles/shadow.js.map +0 -1
- package/lib/commonjs/ui/constants/spacing.js +0 -50
- package/lib/commonjs/ui/constants/spacing.js.map +0 -1
- package/lib/module/ui/components/styles/overlay.js +0 -80
- package/lib/module/ui/components/styles/overlay.js.map +0 -1
- package/lib/module/ui/components/styles/shadow.js +0 -123
- package/lib/module/ui/components/styles/shadow.js.map +0 -1
- package/lib/module/ui/constants/spacing.js +0 -45
- package/lib/module/ui/constants/spacing.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/styles/overlay.d.ts +0 -6
- package/lib/typescript/commonjs/ui/components/styles/overlay.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/styles/shadow.d.ts +0 -3
- package/lib/typescript/commonjs/ui/components/styles/shadow.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/constants/spacing.d.ts +0 -33
- package/lib/typescript/commonjs/ui/constants/spacing.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/styles/overlay.d.ts +0 -6
- package/lib/typescript/module/ui/components/styles/overlay.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/styles/shadow.d.ts +0 -3
- package/lib/typescript/module/ui/components/styles/shadow.d.ts.map +0 -1
- package/lib/typescript/module/ui/constants/spacing.d.ts +0 -33
- package/lib/typescript/module/ui/constants/spacing.d.ts.map +0 -1
- package/src/ui/components/styles/overlay.tsx +0 -96
- package/src/ui/components/styles/shadow.tsx +0 -131
- package/src/ui/constants/spacing.ts +0 -44
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Animated } from 'react-native';
|
|
2
|
-
|
|
3
|
-
// Simple hex color manipulation without color package
|
|
4
|
-
const hexToRgb = (hex: string): [number, number, number] => {
|
|
5
|
-
const r = Number.parseInt(hex.slice(1, 3), 16);
|
|
6
|
-
const g = Number.parseInt(hex.slice(3, 5), 16);
|
|
7
|
-
const b = Number.parseInt(hex.slice(5, 7), 16);
|
|
8
|
-
return [r, g, b];
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const rgbToHex = (r: number, g: number, b: number): string => {
|
|
12
|
-
return `#${[r, g, b]
|
|
13
|
-
.map((x) => {
|
|
14
|
-
const hex = Math.round(x).toString(16);
|
|
15
|
-
return hex.length === 1 ? `0${hex}` : hex;
|
|
16
|
-
})
|
|
17
|
-
.join('')}`;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const mixColors = (color1: string, color2: string, ratio: number): string => {
|
|
21
|
-
const [r1, g1, b1] = hexToRgb(color1);
|
|
22
|
-
const [r2, g2, b2] = hexToRgb(color2);
|
|
23
|
-
const r = r1 + (r2 - r1) * ratio;
|
|
24
|
-
const g = g1 + (g2 - g1) * ratio;
|
|
25
|
-
const b = b1 + (b2 - b1) * ratio;
|
|
26
|
-
return rgbToHex(r, g, b);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const isAnimatedValue = (
|
|
30
|
-
it: number | string | Animated.AnimatedInterpolation<number | string>,
|
|
31
|
-
): it is Animated.Value => it instanceof Animated.Value;
|
|
32
|
-
|
|
33
|
-
// Overloaded signatures so each call site gets the right return type
|
|
34
|
-
// without the conditional-type narrowing that TS cannot infer inside the
|
|
35
|
-
// implementation body.
|
|
36
|
-
function overlay(elevation: number, surfaceColor?: string): string;
|
|
37
|
-
function overlay(
|
|
38
|
-
elevation: Animated.Value,
|
|
39
|
-
surfaceColor?: string,
|
|
40
|
-
): Animated.AnimatedInterpolation<number | string>;
|
|
41
|
-
function overlay(
|
|
42
|
-
elevation: Animated.Value | number,
|
|
43
|
-
surfaceColor = '#121212',
|
|
44
|
-
): string | Animated.AnimatedInterpolation<number | string> {
|
|
45
|
-
if (isAnimatedValue(elevation)) {
|
|
46
|
-
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
47
|
-
|
|
48
|
-
return elevation.interpolate({
|
|
49
|
-
inputRange,
|
|
50
|
-
outputRange: inputRange.map((e) => calculateColor(surfaceColor, e)),
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return calculateColor(surfaceColor, elevation);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export default overlay;
|
|
58
|
-
|
|
59
|
-
function calculateColor(surfaceColor: string, elevation = 1) {
|
|
60
|
-
let overlayTransparency: number;
|
|
61
|
-
if (elevation >= 1 && elevation <= 24) {
|
|
62
|
-
overlayTransparency = elevationOverlayTransparency[elevation];
|
|
63
|
-
} else if (elevation > 24) {
|
|
64
|
-
overlayTransparency = elevationOverlayTransparency[24];
|
|
65
|
-
} else {
|
|
66
|
-
overlayTransparency = elevationOverlayTransparency[1];
|
|
67
|
-
}
|
|
68
|
-
return mixColors(surfaceColor, '#FFFFFF', overlayTransparency * 0.01);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const elevationOverlayTransparency: Record<string, number> = {
|
|
72
|
-
1: 5,
|
|
73
|
-
2: 7,
|
|
74
|
-
3: 8,
|
|
75
|
-
4: 9,
|
|
76
|
-
5: 10,
|
|
77
|
-
6: 11,
|
|
78
|
-
7: 11.5,
|
|
79
|
-
8: 12,
|
|
80
|
-
9: 12.5,
|
|
81
|
-
10: 13,
|
|
82
|
-
11: 13.5,
|
|
83
|
-
12: 14,
|
|
84
|
-
13: 14.25,
|
|
85
|
-
14: 14.5,
|
|
86
|
-
15: 14.75,
|
|
87
|
-
16: 15,
|
|
88
|
-
17: 15.12,
|
|
89
|
-
18: 15.24,
|
|
90
|
-
19: 15.36,
|
|
91
|
-
20: 15.48,
|
|
92
|
-
21: 15.6,
|
|
93
|
-
22: 15.72,
|
|
94
|
-
23: 15.84,
|
|
95
|
-
24: 16,
|
|
96
|
-
};
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { Animated, Platform, type ShadowStyleIOS, type ViewStyle } from 'react-native';
|
|
2
|
-
|
|
3
|
-
const SHADOW_COLOR = '#000000';
|
|
4
|
-
const SHADOW_OPACITY = 0.24;
|
|
5
|
-
const MD3_SHADOW_OPACITY = 0.3;
|
|
6
|
-
const MD3_SHADOW_COLOR = '#000000';
|
|
7
|
-
|
|
8
|
-
export default function shadow(
|
|
9
|
-
elevation: number | Animated.Value = 0,
|
|
10
|
-
isV3 = false,
|
|
11
|
-
): ViewStyle | ShadowStyleIOS {
|
|
12
|
-
return isV3 ? v3Shadow(elevation) : v2Shadow(elevation);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function v2Shadow(elevation: number | Animated.Value = 0): ViewStyle | ShadowStyleIOS {
|
|
16
|
-
if (elevation instanceof Animated.Value) {
|
|
17
|
-
const inputRange = [0, 1, 2, 3, 8, 24];
|
|
18
|
-
|
|
19
|
-
if (Platform.OS === 'ios') {
|
|
20
|
-
return {
|
|
21
|
-
shadowColor: SHADOW_COLOR,
|
|
22
|
-
shadowOffset: {
|
|
23
|
-
width: 0,
|
|
24
|
-
height: elevation.interpolate({
|
|
25
|
-
inputRange,
|
|
26
|
-
outputRange: [0, 0.5, 0.75, 2, 7, 23],
|
|
27
|
-
}),
|
|
28
|
-
},
|
|
29
|
-
shadowOpacity: elevation.interpolate({
|
|
30
|
-
inputRange: [0, 1],
|
|
31
|
-
outputRange: [0, SHADOW_OPACITY],
|
|
32
|
-
extrapolate: 'clamp',
|
|
33
|
-
}),
|
|
34
|
-
shadowRadius: elevation.interpolate({
|
|
35
|
-
inputRange,
|
|
36
|
-
outputRange: [0, 0.75, 1.5, 3, 8, 24],
|
|
37
|
-
}),
|
|
38
|
-
} as unknown as ShadowStyleIOS;
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
elevation: elevation.interpolate({
|
|
42
|
-
inputRange,
|
|
43
|
-
outputRange: [0, 1, 2, 3, 8, 24],
|
|
44
|
-
}) as unknown as number,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
if (elevation === 0) {
|
|
48
|
-
return {};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
let height: number;
|
|
52
|
-
let radius: number;
|
|
53
|
-
switch (elevation) {
|
|
54
|
-
case 1:
|
|
55
|
-
height = 0.5;
|
|
56
|
-
radius = 0.75;
|
|
57
|
-
break;
|
|
58
|
-
case 2:
|
|
59
|
-
height = 0.75;
|
|
60
|
-
radius = 1.5;
|
|
61
|
-
break;
|
|
62
|
-
default:
|
|
63
|
-
height = elevation - 1;
|
|
64
|
-
radius = elevation;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (Platform.OS === 'ios') {
|
|
68
|
-
return {
|
|
69
|
-
shadowColor: SHADOW_COLOR,
|
|
70
|
-
shadowOffset: {
|
|
71
|
-
width: 0,
|
|
72
|
-
height,
|
|
73
|
-
},
|
|
74
|
-
shadowOpacity: SHADOW_OPACITY,
|
|
75
|
-
shadowRadius: radius,
|
|
76
|
-
} as ShadowStyleIOS;
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
elevation: elevation,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function v3Shadow(elevation: number | Animated.Value = 0): ViewStyle | ShadowStyleIOS {
|
|
84
|
-
const inputRange = [0, 1, 2, 3, 4, 5];
|
|
85
|
-
const shadowHeight = [0, 1, 2, 4, 6, 8];
|
|
86
|
-
const shadowRadius = [0, 3, 6, 8, 10, 12];
|
|
87
|
-
|
|
88
|
-
if (elevation instanceof Animated.Value) {
|
|
89
|
-
if (Platform.OS === 'ios') {
|
|
90
|
-
return {
|
|
91
|
-
shadowColor: MD3_SHADOW_COLOR,
|
|
92
|
-
shadowOffset: {
|
|
93
|
-
width: 0,
|
|
94
|
-
height: elevation.interpolate({
|
|
95
|
-
inputRange,
|
|
96
|
-
outputRange: shadowHeight,
|
|
97
|
-
}),
|
|
98
|
-
},
|
|
99
|
-
shadowOpacity: elevation.interpolate({
|
|
100
|
-
inputRange: [0, 1],
|
|
101
|
-
outputRange: [0, MD3_SHADOW_OPACITY],
|
|
102
|
-
extrapolate: 'clamp',
|
|
103
|
-
}),
|
|
104
|
-
shadowRadius: elevation.interpolate({
|
|
105
|
-
inputRange,
|
|
106
|
-
outputRange: shadowRadius,
|
|
107
|
-
}),
|
|
108
|
-
} as unknown as ShadowStyleIOS;
|
|
109
|
-
}
|
|
110
|
-
return {
|
|
111
|
-
elevation: elevation.interpolate({
|
|
112
|
-
inputRange,
|
|
113
|
-
outputRange: [0, 1, 2, 3, 4, 5],
|
|
114
|
-
}) as unknown as number,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
if (Platform.OS === 'ios') {
|
|
118
|
-
return {
|
|
119
|
-
shadowColor: MD3_SHADOW_COLOR,
|
|
120
|
-
shadowOpacity: elevation ? MD3_SHADOW_OPACITY : 0,
|
|
121
|
-
shadowOffset: {
|
|
122
|
-
width: 0,
|
|
123
|
-
height: shadowHeight[elevation] || 0,
|
|
124
|
-
},
|
|
125
|
-
shadowRadius: shadowRadius[elevation] || 0,
|
|
126
|
-
} as ShadowStyleIOS;
|
|
127
|
-
}
|
|
128
|
-
return {
|
|
129
|
-
elevation: elevation || 0,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { StyleSheet } from 'react-native';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Reusable spacing constants for screens across the codebase
|
|
5
|
-
* These values ensure consistent padding and gaps across all screens
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// Screen padding - used for all bottom sheet screens
|
|
9
|
-
export const SCREEN_PADDING_HORIZONTAL = 16;
|
|
10
|
-
export const SCREEN_PADDING_VERTICAL = 16;
|
|
11
|
-
export const SCREEN_PADDING_TOP = 24; // Top padding for screen content (accounts for handle)
|
|
12
|
-
|
|
13
|
-
// Section gaps
|
|
14
|
-
export const SECTION_GAP = 24;
|
|
15
|
-
export const SECTION_GAP_LARGE = 32;
|
|
16
|
-
|
|
17
|
-
// Component gaps
|
|
18
|
-
export const COMPONENT_GAP = 12;
|
|
19
|
-
export const COMPONENT_GAP_SMALL = 8;
|
|
20
|
-
|
|
21
|
-
// Header padding
|
|
22
|
-
export const HEADER_PADDING_TOP_OVERVIEW = 38;
|
|
23
|
-
export const HEADER_PADDING_TOP_SETTINGS = 40;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Reusable screen content style for all bottom sheet screens
|
|
27
|
-
* Use this for ScrollView contentContainerStyle to ensure consistent padding
|
|
28
|
-
*/
|
|
29
|
-
export const screenContentStyle = {
|
|
30
|
-
paddingHorizontal: SCREEN_PADDING_HORIZONTAL,
|
|
31
|
-
paddingVertical: SCREEN_PADDING_VERTICAL,
|
|
32
|
-
paddingTop: SCREEN_PADDING_TOP,
|
|
33
|
-
paddingBottom: SCREEN_PADDING_VERTICAL,
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Reusable screen content style for screens that need custom top padding
|
|
38
|
-
*/
|
|
39
|
-
export const createScreenContentStyle = (topPadding?: number) => ({
|
|
40
|
-
paddingHorizontal: SCREEN_PADDING_HORIZONTAL,
|
|
41
|
-
paddingVertical: SCREEN_PADDING_VERTICAL,
|
|
42
|
-
paddingTop: topPadding ?? SCREEN_PADDING_TOP,
|
|
43
|
-
paddingBottom: SCREEN_PADDING_VERTICAL,
|
|
44
|
-
});
|