@idealyst/components 1.2.108 → 1.2.110
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 +4 -4
- package/src/Switch/Switch.native.tsx +11 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idealyst/components",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.110",
|
|
4
4
|
"description": "Shared component library for React and React Native",
|
|
5
5
|
"documentation": "https://github.com/IdealystIO/idealyst-framework/tree/main/packages/components#readme",
|
|
6
6
|
"readme": "README.md",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"publish:npm": "npm publish"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@idealyst/theme": "^1.2.
|
|
59
|
+
"@idealyst/theme": "^1.2.110",
|
|
60
60
|
"@mdi/js": ">=7.0.0",
|
|
61
61
|
"@mdi/react": ">=1.0.0",
|
|
62
62
|
"@react-native-vector-icons/common": ">=12.0.0",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@idealyst/blur": "^1.2.40",
|
|
110
|
-
"@idealyst/theme": "^1.2.
|
|
111
|
-
"@idealyst/tooling": "^1.2.
|
|
110
|
+
"@idealyst/theme": "^1.2.110",
|
|
111
|
+
"@idealyst/tooling": "^1.2.110",
|
|
112
112
|
"@mdi/react": "^1.6.1",
|
|
113
113
|
"@types/react": "^19.1.0",
|
|
114
114
|
"react": "^19.1.0",
|
|
@@ -46,13 +46,17 @@ const Switch = forwardRef<IdealystElement, SwitchProps>(({
|
|
|
46
46
|
checked,
|
|
47
47
|
hasError,
|
|
48
48
|
intent,
|
|
49
|
-
|
|
49
|
+
labelPosition,
|
|
50
50
|
margin,
|
|
51
51
|
marginVertical,
|
|
52
52
|
marginHorizontal,
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
//
|
|
55
|
+
// Resolve dynamic style functions
|
|
56
|
+
const switchContainerStyle = (switchStyles.switchContainer as any)({});
|
|
57
|
+
const switchTrackStyle = (switchStyles.switchTrack as any)({});
|
|
58
|
+
const containerStyle = (switchStyles.container as any)({});
|
|
59
|
+
const labelStyle = (switchStyles.label as any)({});
|
|
56
60
|
const wrapperStyle = (switchStyles.wrapper as any)({});
|
|
57
61
|
const helperTextStyle = (switchStyles.helperText as any)({ hasError });
|
|
58
62
|
|
|
@@ -140,11 +144,11 @@ const Switch = forwardRef<IdealystElement, SwitchProps>(({
|
|
|
140
144
|
nativeID={!label && !needsWrapper ? id : undefined}
|
|
141
145
|
onPress={handlePress}
|
|
142
146
|
disabled={disabled}
|
|
143
|
-
style={
|
|
147
|
+
style={switchContainerStyle}
|
|
144
148
|
testID={!label && !needsWrapper ? testID : undefined}
|
|
145
149
|
{...nativeA11yProps}
|
|
146
150
|
>
|
|
147
|
-
<Animated.View style={
|
|
151
|
+
<Animated.View style={switchTrackStyle}>
|
|
148
152
|
<Animated.View
|
|
149
153
|
style={[
|
|
150
154
|
{
|
|
@@ -174,15 +178,15 @@ const Switch = forwardRef<IdealystElement, SwitchProps>(({
|
|
|
174
178
|
nativeID={!needsWrapper ? id : undefined}
|
|
175
179
|
onPress={handlePress}
|
|
176
180
|
disabled={disabled}
|
|
177
|
-
style={[
|
|
181
|
+
style={[containerStyle, !needsWrapper && style]}
|
|
178
182
|
testID={!needsWrapper ? testID : undefined}
|
|
179
183
|
>
|
|
180
184
|
{labelPosition === 'left' && (
|
|
181
|
-
<Text style={
|
|
185
|
+
<Text style={labelStyle}>{label}</Text>
|
|
182
186
|
)}
|
|
183
187
|
{switchElement}
|
|
184
188
|
{labelPosition === 'right' && (
|
|
185
|
-
<Text style={
|
|
189
|
+
<Text style={labelStyle}>{label}</Text>
|
|
186
190
|
)}
|
|
187
191
|
</Pressable>
|
|
188
192
|
) : switchElement;
|