@idealyst/components 1.2.73 → 1.2.75
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.
|
|
3
|
+
"version": "1.2.75",
|
|
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.75",
|
|
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.
|
|
110
|
+
"@idealyst/theme": "^1.2.75",
|
|
111
111
|
"@idealyst/tooling": "^1.2.30",
|
|
112
112
|
"@mdi/react": "^1.6.1",
|
|
113
113
|
"@types/react": "^19.1.0",
|
|
@@ -10,6 +10,10 @@ const Screen = forwardRef<IdealystElement, ScreenProps>(({
|
|
|
10
10
|
children,
|
|
11
11
|
background = 'screen',
|
|
12
12
|
safeArea = true,
|
|
13
|
+
safeAreaTop,
|
|
14
|
+
safeAreaBottom,
|
|
15
|
+
safeAreaLeft,
|
|
16
|
+
safeAreaRight,
|
|
13
17
|
scrollable = true,
|
|
14
18
|
avoidKeyboard = true,
|
|
15
19
|
contentInset,
|
|
@@ -28,6 +32,12 @@ const Screen = forwardRef<IdealystElement, ScreenProps>(({
|
|
|
28
32
|
}, ref) => {
|
|
29
33
|
const insets = useSafeAreaInsets();
|
|
30
34
|
|
|
35
|
+
// Resolve safe area per edge: specific prop > general safeArea prop
|
|
36
|
+
const applySafeAreaTop = safeAreaTop ?? safeArea;
|
|
37
|
+
const applySafeAreaBottom = safeAreaBottom ?? safeArea;
|
|
38
|
+
const applySafeAreaLeft = safeAreaLeft ?? safeArea;
|
|
39
|
+
const applySafeAreaRight = safeAreaRight ?? safeArea;
|
|
40
|
+
|
|
31
41
|
// Animated keyboard offset
|
|
32
42
|
const keyboardOffset = useSharedValue(0);
|
|
33
43
|
|
|
@@ -82,22 +92,22 @@ const Screen = forwardRef<IdealystElement, ScreenProps>(({
|
|
|
82
92
|
// Call styles as functions to get theme-reactive styles
|
|
83
93
|
const screenStyle = (screenStyles.screen as any)({});
|
|
84
94
|
|
|
85
|
-
// Calculate safe area padding
|
|
86
|
-
const safeAreaStyle =
|
|
87
|
-
paddingTop: insets.top,
|
|
88
|
-
paddingBottom: insets.bottom,
|
|
89
|
-
paddingLeft: insets.left,
|
|
90
|
-
paddingRight: insets.right,
|
|
91
|
-
}
|
|
95
|
+
// Calculate safe area padding per edge
|
|
96
|
+
const safeAreaStyle = {
|
|
97
|
+
paddingTop: applySafeAreaTop ? insets.top : 0,
|
|
98
|
+
paddingBottom: applySafeAreaBottom ? insets.bottom : 0,
|
|
99
|
+
paddingLeft: applySafeAreaLeft ? insets.left : 0,
|
|
100
|
+
paddingRight: applySafeAreaRight ? insets.right : 0,
|
|
101
|
+
};
|
|
92
102
|
|
|
93
103
|
if (scrollable) {
|
|
94
104
|
// Content styles applied via View wrapper for Unistyles reactivity
|
|
95
105
|
// (contentContainerStyle isn't reactive, only style prop is)
|
|
96
106
|
const contentInsetStyle = contentInset ? {
|
|
97
|
-
paddingTop:
|
|
98
|
-
paddingBottom:
|
|
99
|
-
paddingLeft:
|
|
100
|
-
paddingRight:
|
|
107
|
+
paddingTop: safeAreaStyle.paddingTop + (contentInset.top ?? 0),
|
|
108
|
+
paddingBottom: safeAreaStyle.paddingBottom + (contentInset.bottom ?? 0),
|
|
109
|
+
paddingLeft: safeAreaStyle.paddingLeft + (contentInset.left ?? 0),
|
|
110
|
+
paddingRight: safeAreaStyle.paddingRight + (contentInset.right ?? 0),
|
|
101
111
|
} : safeAreaStyle;
|
|
102
112
|
|
|
103
113
|
return (
|
|
@@ -15,6 +15,10 @@ const Screen = forwardRef<IdealystElement, ScreenProps>(({
|
|
|
15
15
|
children,
|
|
16
16
|
background = 'screen',
|
|
17
17
|
safeArea = false,
|
|
18
|
+
safeAreaTop: _safeAreaTop,
|
|
19
|
+
safeAreaBottom: _safeAreaBottom,
|
|
20
|
+
safeAreaLeft: _safeAreaLeft,
|
|
21
|
+
safeAreaRight: _safeAreaRight,
|
|
18
22
|
onLayout,
|
|
19
23
|
// Spacing variants from ContainerStyleProps
|
|
20
24
|
gap,
|
package/src/Screen/types.ts
CHANGED
|
@@ -20,10 +20,35 @@ export interface ScreenProps extends ContainerStyleProps {
|
|
|
20
20
|
background?: Surface | 'transparent';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Safe area padding for
|
|
23
|
+
* Safe area padding for all edges (lower precedence).
|
|
24
|
+
* Individual edge props (safeAreaTop, etc.) override this when set.
|
|
24
25
|
*/
|
|
25
26
|
safeArea?: boolean;
|
|
26
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Safe area padding for the top edge.
|
|
30
|
+
* Overrides safeArea for top when explicitly set.
|
|
31
|
+
*/
|
|
32
|
+
safeAreaTop?: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Safe area padding for the bottom edge.
|
|
36
|
+
* Overrides safeArea for bottom when explicitly set.
|
|
37
|
+
*/
|
|
38
|
+
safeAreaBottom?: boolean;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Safe area padding for the left edge.
|
|
42
|
+
* Overrides safeArea for left when explicitly set.
|
|
43
|
+
*/
|
|
44
|
+
safeAreaLeft?: boolean;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Safe area padding for the right edge.
|
|
48
|
+
* Overrides safeArea for right when explicitly set.
|
|
49
|
+
*/
|
|
50
|
+
safeAreaRight?: boolean;
|
|
51
|
+
|
|
27
52
|
/**
|
|
28
53
|
* Content inset padding for scrollable content (mobile only)
|
|
29
54
|
* Adds padding to the scroll view's content container
|
|
@@ -126,7 +126,7 @@ export const textAreaStyles = defineStyle('TextArea', (theme: Theme) => ({
|
|
|
126
126
|
size: {
|
|
127
127
|
fontSize: theme.sizes.$textarea.fontSize,
|
|
128
128
|
padding: theme.sizes.$textarea.padding,
|
|
129
|
-
lineHeight:
|
|
129
|
+
lineHeight: 'auto',
|
|
130
130
|
},
|
|
131
131
|
autoGrow: {
|
|
132
132
|
true: {
|
|
@@ -86,6 +86,7 @@ const TextInput = React.forwardRef<IdealystElement, TextInputProps>(({
|
|
|
86
86
|
// Submit handling
|
|
87
87
|
onSubmitEditing,
|
|
88
88
|
returnKeyType = 'default',
|
|
89
|
+
textContentType,
|
|
89
90
|
}, ref) => {
|
|
90
91
|
const [isFocused, setIsFocused] = useState(false);
|
|
91
92
|
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
|
@@ -183,6 +184,10 @@ const TextInput = React.forwardRef<IdealystElement, TextInputProps>(({
|
|
|
183
184
|
hasError,
|
|
184
185
|
]);
|
|
185
186
|
|
|
187
|
+
// Determine the textContentType for iOS AutoFill
|
|
188
|
+
// If explicitly provided, use that; otherwise default password fields to 'password'
|
|
189
|
+
const resolvedTextContentType = textContentType ?? (isSecureField ? 'password' : undefined);
|
|
190
|
+
|
|
186
191
|
// Memoized TextInput props (everything except value/onChangeText)
|
|
187
192
|
const textInputProps = useMemo(() => ({
|
|
188
193
|
onPress: handlePress,
|
|
@@ -196,6 +201,7 @@ const TextInput = React.forwardRef<IdealystElement, TextInputProps>(({
|
|
|
196
201
|
onSubmitEditing: handleSubmitEditing,
|
|
197
202
|
returnKeyType,
|
|
198
203
|
placeholderTextColor: '#999999',
|
|
204
|
+
textContentType: resolvedTextContentType,
|
|
199
205
|
...nativeA11yProps,
|
|
200
206
|
}), [
|
|
201
207
|
handlePress,
|
|
@@ -209,6 +215,7 @@ const TextInput = React.forwardRef<IdealystElement, TextInputProps>(({
|
|
|
209
215
|
handleBlur,
|
|
210
216
|
handleSubmitEditing,
|
|
211
217
|
returnKeyType,
|
|
218
|
+
resolvedTextContentType,
|
|
212
219
|
nativeA11yProps,
|
|
213
220
|
]);
|
|
214
221
|
|
package/src/TextInput/types.ts
CHANGED
|
@@ -23,6 +23,31 @@ export type TextInputMode = 'text' | 'email' | 'password' | 'number';
|
|
|
23
23
|
*/
|
|
24
24
|
export type ReturnKeyType = 'done' | 'go' | 'next' | 'search' | 'send' | 'default';
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Text content type for iOS AutoFill.
|
|
28
|
+
* Helps iOS identify the purpose of the field for password/credential autofill.
|
|
29
|
+
* @platform ios
|
|
30
|
+
*/
|
|
31
|
+
export type TextContentType =
|
|
32
|
+
| 'none'
|
|
33
|
+
| 'username'
|
|
34
|
+
| 'password'
|
|
35
|
+
| 'newPassword'
|
|
36
|
+
| 'oneTimeCode'
|
|
37
|
+
| 'emailAddress'
|
|
38
|
+
| 'name'
|
|
39
|
+
| 'givenName'
|
|
40
|
+
| 'familyName'
|
|
41
|
+
| 'telephoneNumber'
|
|
42
|
+
| 'streetAddressLine1'
|
|
43
|
+
| 'streetAddressLine2'
|
|
44
|
+
| 'addressCity'
|
|
45
|
+
| 'addressState'
|
|
46
|
+
| 'addressCityAndState'
|
|
47
|
+
| 'postalCode'
|
|
48
|
+
| 'countryName'
|
|
49
|
+
| 'creditCardNumber';
|
|
50
|
+
|
|
26
51
|
/**
|
|
27
52
|
* Single-line text input field with support for icons, validation states, and multiple visual styles.
|
|
28
53
|
* Includes built-in password visibility toggle and platform-specific keyboard handling.
|
|
@@ -160,6 +185,15 @@ export interface TextInputProps extends FormInputStyleProps, FormAccessibilityPr
|
|
|
160
185
|
*/
|
|
161
186
|
returnKeyType?: ReturnKeyType;
|
|
162
187
|
|
|
188
|
+
/**
|
|
189
|
+
* iOS AutoFill content type. Helps iOS identify the field purpose for
|
|
190
|
+
* password/credential autofill. Set to 'none' to disable autofill suggestions.
|
|
191
|
+
* For password fields, use 'password' for existing passwords or 'newPassword' for signup.
|
|
192
|
+
* Pair with a username field using 'username' or 'emailAddress' for best results.
|
|
193
|
+
* @platform ios
|
|
194
|
+
*/
|
|
195
|
+
textContentType?: TextContentType;
|
|
196
|
+
|
|
163
197
|
/**
|
|
164
198
|
* Additional styles (platform-specific)
|
|
165
199
|
*/
|