@idealyst/components 1.2.45 → 1.2.47

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/components",
3
- "version": "1.2.45",
3
+ "version": "1.2.47",
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.45",
59
+ "@idealyst/theme": "^1.2.47",
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,7 +107,7 @@
107
107
  },
108
108
  "devDependencies": {
109
109
  "@idealyst/blur": "^1.2.40",
110
- "@idealyst/theme": "^1.2.45",
110
+ "@idealyst/theme": "^1.2.47",
111
111
  "@idealyst/tooling": "^1.2.30",
112
112
  "@mdi/react": "^1.6.1",
113
113
  "@types/react": "^19.1.0",
@@ -1,5 +1,5 @@
1
1
  import { useEffect, forwardRef, useMemo } from 'react';
2
- import { Modal, View, Text, TouchableOpacity, TouchableWithoutFeedback, BackHandler, GestureResponderEvent } from 'react-native';
2
+ import { Modal, View, Text, TouchableOpacity, TouchableWithoutFeedback, BackHandler, GestureResponderEvent, KeyboardAvoidingView, Platform } from 'react-native';
3
3
  import Animated, { useSharedValue, useAnimatedStyle, withTiming, Easing } from 'react-native-reanimated';
4
4
  import { DialogProps } from './types';
5
5
  import { dialogStyles } from './Dialog.styles';
@@ -15,6 +15,7 @@ const Dialog = forwardRef<View, DialogProps>(({
15
15
  showCloseButton = true,
16
16
  closeOnBackdropClick = true,
17
17
  animationType: _animationType = 'fade',
18
+ avoidKeyboard = false,
18
19
  style,
19
20
  testID,
20
21
  id,
@@ -175,6 +176,23 @@ const Dialog = forwardRef<View, DialogProps>(({
175
176
  </TouchableWithoutFeedback>
176
177
  );
177
178
 
179
+ const modalContent = (
180
+ <TouchableWithoutFeedback onPress={handleBackdropPress}>
181
+ {BackdropComponent ? (
182
+ <View style={customBackdropWrapperStyle}>
183
+ <Animated.View style={[customBackdropContainerStyle, backdropAnimatedStyle]}>
184
+ <BackdropComponent isVisible={open} />
185
+ </Animated.View>
186
+ {dialogContainer}
187
+ </View>
188
+ ) : (
189
+ <Animated.View style={[backdropStyle, backdropAnimatedStyle]}>
190
+ {dialogContainer}
191
+ </Animated.View>
192
+ )}
193
+ </TouchableWithoutFeedback>
194
+ );
195
+
178
196
  return (
179
197
  <Modal
180
198
  visible={open}
@@ -184,20 +202,16 @@ const Dialog = forwardRef<View, DialogProps>(({
184
202
  statusBarTranslucent
185
203
  testID={testID}
186
204
  >
187
- <TouchableWithoutFeedback onPress={handleBackdropPress}>
188
- {BackdropComponent ? (
189
- <View style={customBackdropWrapperStyle}>
190
- <Animated.View style={[customBackdropContainerStyle, backdropAnimatedStyle]}>
191
- <BackdropComponent isVisible={open} />
192
- </Animated.View>
193
- {dialogContainer}
194
- </View>
195
- ) : (
196
- <Animated.View style={[backdropStyle, backdropAnimatedStyle]}>
197
- {dialogContainer}
198
- </Animated.View>
199
- )}
200
- </TouchableWithoutFeedback>
205
+ {avoidKeyboard ? (
206
+ <KeyboardAvoidingView
207
+ style={{ flex: 1 }}
208
+ behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
209
+ >
210
+ {modalContent}
211
+ </KeyboardAvoidingView>
212
+ ) : (
213
+ modalContent
214
+ )}
201
215
  </Modal>
202
216
  );
203
217
  });
@@ -127,7 +127,6 @@ export const dialogStyles = defineStyle('Dialog', (theme: Theme) => ({
127
127
  }),
128
128
 
129
129
  content: (_props: DialogDynamicProps) => ({
130
- padding: 24,
131
130
  _web: {
132
131
  overflow: 'visible',
133
132
  maxHeight: 'none',
@@ -89,4 +89,11 @@ export interface DialogProps extends BaseProps, InteractiveAccessibilityProps {
89
89
  * It receives isVisible for animation coordination.
90
90
  */
91
91
  BackdropComponent?: ComponentType<BackdropComponentProps>;
92
+
93
+ /**
94
+ * Whether the dialog should avoid the keyboard on mobile (native only).
95
+ * When true, the dialog content will shift up when the keyboard is shown.
96
+ * @default false
97
+ */
98
+ avoidKeyboard?: boolean;
92
99
  }
@@ -68,6 +68,7 @@ export const textAreaStyles = defineStyle('TextArea', (theme: Theme) => ({
68
68
 
69
69
  textareaContainer: (_props: TextAreaVariants) => ({
70
70
  position: 'relative' as const,
71
+ width: '100%',
71
72
  borderWidth: 1,
72
73
  borderColor: theme.colors.border.primary,
73
74
  borderRadius: theme.radii.md,
@@ -80,6 +81,7 @@ export const textAreaStyles = defineStyle('TextArea', (theme: Theme) => ({
80
81
  },
81
82
  },
82
83
  _web: {
84
+ boxSizing: 'border-box',
83
85
  border: `1px solid ${theme.colors.border.primary}`,
84
86
  },
85
87
  }),
@@ -112,9 +114,13 @@ export const textAreaStyles = defineStyle('TextArea', (theme: Theme) => ({
112
114
  },
113
115
  },
114
116
  _web: {
117
+ display: 'block',
118
+ width: '100%',
115
119
  fontFamily: 'inherit',
116
120
  outline: 'none',
117
121
  border: 'none',
122
+ borderWidth: 0,
123
+ background: 'transparent',
118
124
  transition: 'border-color 0.2s ease, box-shadow 0.2s ease',
119
125
  boxSizing: 'border-box',
120
126
  overflowY: 'hidden',