@umituz/react-native-settings 1.11.1 → 1.11.2
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/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Setting Item Component
|
|
3
3
|
* Single Responsibility: Render a single settings item
|
|
4
|
-
*
|
|
4
|
+
* Material Design 3 style with hover effects and modern spacing
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import React from "react";
|
|
8
|
-
import { View, Text,
|
|
8
|
+
import { View, Text, Pressable, StyleSheet, Switch } from "react-native";
|
|
9
9
|
import { ChevronRight, type LucideIcon } from "lucide-react-native";
|
|
10
10
|
import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
|
|
11
11
|
|
|
@@ -56,14 +56,17 @@ export const SettingItem: React.FC<SettingItemProps> = ({
|
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<>
|
|
59
|
-
<
|
|
60
|
-
style={[
|
|
59
|
+
<Pressable
|
|
60
|
+
style={({ pressed }) => [
|
|
61
61
|
styles.container,
|
|
62
|
-
{
|
|
62
|
+
{
|
|
63
|
+
backgroundColor: pressed && !disabled && !showSwitch
|
|
64
|
+
? `${colors.primary}08`
|
|
65
|
+
: 'transparent',
|
|
66
|
+
},
|
|
63
67
|
]}
|
|
64
68
|
onPress={onPress}
|
|
65
69
|
disabled={showSwitch || disabled}
|
|
66
|
-
activeOpacity={disabled ? 1 : 0.7}
|
|
67
70
|
testID={testID}
|
|
68
71
|
>
|
|
69
72
|
<View style={styles.content}>
|
|
@@ -77,7 +80,7 @@ export const SettingItem: React.FC<SettingItemProps> = ({
|
|
|
77
80
|
},
|
|
78
81
|
]}
|
|
79
82
|
>
|
|
80
|
-
<Icon size={
|
|
83
|
+
<Icon size={24} color={iconColor || colors.primary} />
|
|
81
84
|
</View>
|
|
82
85
|
<View style={styles.textContainer}>
|
|
83
86
|
<Text
|
|
@@ -97,7 +100,7 @@ export const SettingItem: React.FC<SettingItemProps> = ({
|
|
|
97
100
|
{value && !showSwitch && (
|
|
98
101
|
<Text
|
|
99
102
|
style={[styles.value, { color: colors.textSecondary }]}
|
|
100
|
-
numberOfLines={
|
|
103
|
+
numberOfLines={2}
|
|
101
104
|
>
|
|
102
105
|
{value}
|
|
103
106
|
</Text>
|
|
@@ -115,12 +118,13 @@ export const SettingItem: React.FC<SettingItemProps> = ({
|
|
|
115
118
|
true: colors.primary,
|
|
116
119
|
}}
|
|
117
120
|
thumbColor="#FFFFFF"
|
|
121
|
+
ios_backgroundColor={`${colors.textSecondary}30`}
|
|
118
122
|
/>
|
|
119
123
|
) : (
|
|
120
|
-
<ChevronRight size={
|
|
124
|
+
<ChevronRight size={20} color={colors.textSecondary} />
|
|
121
125
|
)}
|
|
122
126
|
</View>
|
|
123
|
-
</
|
|
127
|
+
</Pressable>
|
|
124
128
|
|
|
125
129
|
{!isLast && (
|
|
126
130
|
<View
|
|
@@ -139,9 +143,9 @@ const styles = StyleSheet.create({
|
|
|
139
143
|
flexDirection: "row",
|
|
140
144
|
alignItems: "center",
|
|
141
145
|
justifyContent: "space-between",
|
|
142
|
-
paddingHorizontal:
|
|
143
|
-
paddingVertical:
|
|
144
|
-
minHeight:
|
|
146
|
+
paddingHorizontal: 16,
|
|
147
|
+
paddingVertical: 16,
|
|
148
|
+
minHeight: 72,
|
|
145
149
|
},
|
|
146
150
|
content: {
|
|
147
151
|
flexDirection: "row",
|
|
@@ -149,8 +153,8 @@ const styles = StyleSheet.create({
|
|
|
149
153
|
flex: 1,
|
|
150
154
|
},
|
|
151
155
|
iconContainer: {
|
|
152
|
-
width:
|
|
153
|
-
height:
|
|
156
|
+
width: 48,
|
|
157
|
+
height: 48,
|
|
154
158
|
borderRadius: 12,
|
|
155
159
|
justifyContent: "center",
|
|
156
160
|
alignItems: "center",
|
|
@@ -163,11 +167,13 @@ const styles = StyleSheet.create({
|
|
|
163
167
|
title: {
|
|
164
168
|
fontSize: 16,
|
|
165
169
|
fontWeight: "500",
|
|
170
|
+
lineHeight: 20,
|
|
166
171
|
},
|
|
167
172
|
value: {
|
|
168
|
-
fontSize:
|
|
173
|
+
fontSize: 14,
|
|
169
174
|
fontWeight: "400",
|
|
170
|
-
marginTop:
|
|
175
|
+
marginTop: 4,
|
|
176
|
+
lineHeight: 18,
|
|
171
177
|
},
|
|
172
178
|
rightContainer: {
|
|
173
179
|
flexDirection: "row",
|
|
@@ -20,19 +20,13 @@ export const SettingsSection: React.FC<SettingsSectionProps> = ({
|
|
|
20
20
|
}) => {
|
|
21
21
|
const tokens = useAppDesignTokens();
|
|
22
22
|
const colors = tokens.colors;
|
|
23
|
-
const spacing = tokens.spacing;
|
|
24
23
|
|
|
25
24
|
return (
|
|
26
|
-
<View style={styles.container}>
|
|
27
|
-
<Text style={[styles.title, { color: colors.
|
|
25
|
+
<View style={[styles.container, { backgroundColor: colors.surface }]}>
|
|
26
|
+
<Text style={[styles.title, { color: colors.textPrimary }]}>
|
|
28
27
|
{title}
|
|
29
28
|
</Text>
|
|
30
|
-
<View
|
|
31
|
-
style={[
|
|
32
|
-
styles.content,
|
|
33
|
-
{ backgroundColor: `${colors.textSecondary}10` },
|
|
34
|
-
]}
|
|
35
|
-
>
|
|
29
|
+
<View style={styles.content}>
|
|
36
30
|
{children}
|
|
37
31
|
</View>
|
|
38
32
|
</View>
|
|
@@ -41,22 +35,19 @@ export const SettingsSection: React.FC<SettingsSectionProps> = ({
|
|
|
41
35
|
|
|
42
36
|
const styles = StyleSheet.create({
|
|
43
37
|
container: {
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
marginBottom: 16,
|
|
39
|
+
borderRadius: 12,
|
|
40
|
+
overflow: "hidden",
|
|
46
41
|
},
|
|
47
42
|
title: {
|
|
48
|
-
fontSize:
|
|
49
|
-
fontWeight: "
|
|
50
|
-
textTransform: "uppercase",
|
|
51
|
-
letterSpacing: 1.2,
|
|
43
|
+
fontSize: 18,
|
|
44
|
+
fontWeight: "600",
|
|
52
45
|
paddingHorizontal: 16,
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
paddingTop: 16,
|
|
47
|
+
paddingBottom: 8,
|
|
55
48
|
},
|
|
56
49
|
content: {
|
|
57
|
-
borderRadius:
|
|
58
|
-
marginHorizontal: 16,
|
|
59
|
-
overflow: "hidden",
|
|
50
|
+
borderRadius: 0,
|
|
60
51
|
},
|
|
61
52
|
});
|
|
62
53
|
|