react-native-ui-lib 7.38.1-snapshot.6305 → 7.38.1-snapshot.6311
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,5 +1,5 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, ImagePropsBase, ImageStyle, TextStyle, AccessibilityProps } from 'react-native';
|
|
2
|
+
import { StyleProp, ViewStyle, ImagePropsBase, ImageStyle, TextStyle, TextProps, AccessibilityProps } from 'react-native';
|
|
3
3
|
import { BadgeProps } from '../badge';
|
|
4
4
|
import { ImageProps } from '../image';
|
|
5
5
|
import { AnimatedImageProps } from '../animatedImage';
|
|
@@ -23,7 +23,7 @@ export type AutoColorsProps = {
|
|
|
23
23
|
*/
|
|
24
24
|
defaultColor?: string;
|
|
25
25
|
};
|
|
26
|
-
export type AvatarProps = Pick<AccessibilityProps, 'accessibilityLabel'> & PropsWithChildren<{
|
|
26
|
+
export type AvatarProps = Pick<AccessibilityProps, 'accessibilityLabel'> & Pick<TextProps, 'ellipsizeMode'> & PropsWithChildren<{
|
|
27
27
|
/**
|
|
28
28
|
* Adds fade in animation when Avatar image loads
|
|
29
29
|
*/
|
|
@@ -133,7 +133,7 @@ interface Statics {
|
|
|
133
133
|
* @image: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Avatar/Avarat_1.png?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Avatar/Avarat_2.png?raw=true
|
|
134
134
|
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/AvatarsScreen.tsx
|
|
135
135
|
*/
|
|
136
|
-
declare const Avatar: React.ForwardRefExoticComponent<Pick<AccessibilityProps, "accessibilityLabel"> & {
|
|
136
|
+
declare const Avatar: React.ForwardRefExoticComponent<Pick<AccessibilityProps, "accessibilityLabel"> & Pick<TextProps, "ellipsizeMode"> & {
|
|
137
137
|
/**
|
|
138
138
|
* Adds fade in animation when Avatar image loads
|
|
139
139
|
*/
|
|
@@ -166,25 +166,23 @@ declare const Avatar: React.ForwardRefExoticComponent<Pick<AccessibilityProps, "
|
|
|
166
166
|
assetName?: string | undefined;
|
|
167
167
|
assetGroup?: string | undefined;
|
|
168
168
|
tintColor?: string | undefined;
|
|
169
|
-
supportRTL?: boolean | undefined;
|
|
169
|
+
supportRTL?: boolean | undefined; /**
|
|
170
|
+
* Background color for Avatar
|
|
171
|
+
*/
|
|
170
172
|
cover?: boolean | undefined;
|
|
171
173
|
aspectRatio?: number | undefined;
|
|
172
|
-
overlayType?: string | undefined;
|
|
174
|
+
overlayType?: string | undefined; /**
|
|
175
|
+
* Image props object
|
|
176
|
+
*/
|
|
173
177
|
overlayIntensity?: import("../overlay").OverlayIntensityType | undefined;
|
|
174
178
|
overlayColor?: string | undefined;
|
|
175
179
|
customOverlayContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
176
180
|
errorSource?: import("../image").ImageSourceType;
|
|
177
|
-
imageId?: string | undefined;
|
|
178
|
-
* Listener-callback for when an image's (uri) loading
|
|
179
|
-
* fails (equiv. to Image.onError()).
|
|
180
|
-
*/
|
|
181
|
+
imageId?: string | undefined;
|
|
181
182
|
useBackgroundContainer?: boolean | undefined;
|
|
182
183
|
width?: string | number | undefined;
|
|
183
184
|
height?: string | number | undefined;
|
|
184
|
-
source: import("../image").ImageSourceType;
|
|
185
|
-
* Hash the name (or label) to get a color, so each name will have a specific color.
|
|
186
|
-
* Default is false.
|
|
187
|
-
*/
|
|
185
|
+
source: import("../image").ImageSourceType;
|
|
188
186
|
} & AnimatedImageProps> | undefined;
|
|
189
187
|
/**
|
|
190
188
|
* Image style object used to pass additional style props
|
|
@@ -261,7 +259,7 @@ declare const Avatar: React.ForwardRefExoticComponent<Pick<AccessibilityProps, "
|
|
|
261
259
|
children?: React.ReactNode;
|
|
262
260
|
} & React.RefAttributes<any>>;
|
|
263
261
|
export { Avatar };
|
|
264
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<AccessibilityProps, "accessibilityLabel"> & {
|
|
262
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<AccessibilityProps, "accessibilityLabel"> & Pick<TextProps, "ellipsizeMode"> & {
|
|
265
263
|
/**
|
|
266
264
|
* Adds fade in animation when Avatar image loads
|
|
267
265
|
*/
|
|
@@ -294,25 +292,23 @@ declare const _default: React.ForwardRefExoticComponent<Pick<AccessibilityProps,
|
|
|
294
292
|
assetName?: string | undefined;
|
|
295
293
|
assetGroup?: string | undefined;
|
|
296
294
|
tintColor?: string | undefined;
|
|
297
|
-
supportRTL?: boolean | undefined;
|
|
295
|
+
supportRTL?: boolean | undefined; /**
|
|
296
|
+
* Background color for Avatar
|
|
297
|
+
*/
|
|
298
298
|
cover?: boolean | undefined;
|
|
299
299
|
aspectRatio?: number | undefined;
|
|
300
|
-
overlayType?: string | undefined;
|
|
300
|
+
overlayType?: string | undefined; /**
|
|
301
|
+
* Image props object
|
|
302
|
+
*/
|
|
301
303
|
overlayIntensity?: import("../overlay").OverlayIntensityType | undefined;
|
|
302
304
|
overlayColor?: string | undefined;
|
|
303
305
|
customOverlayContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
304
306
|
errorSource?: import("../image").ImageSourceType;
|
|
305
|
-
imageId?: string | undefined;
|
|
306
|
-
* Listener-callback for when an image's (uri) loading
|
|
307
|
-
* fails (equiv. to Image.onError()).
|
|
308
|
-
*/
|
|
307
|
+
imageId?: string | undefined;
|
|
309
308
|
useBackgroundContainer?: boolean | undefined;
|
|
310
309
|
width?: string | number | undefined;
|
|
311
310
|
height?: string | number | undefined;
|
|
312
|
-
source: import("../image").ImageSourceType;
|
|
313
|
-
* Hash the name (or label) to get a color, so each name will have a specific color.
|
|
314
|
-
* Default is false.
|
|
315
|
-
*/
|
|
311
|
+
source: import("../image").ImageSourceType;
|
|
316
312
|
} & AnimatedImageProps> | undefined;
|
|
317
313
|
/**
|
|
318
314
|
* Image style object used to pass additional style props
|
|
@@ -55,6 +55,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
55
55
|
useAutoColors,
|
|
56
56
|
autoColorsConfig,
|
|
57
57
|
containerStyle,
|
|
58
|
+
ellipsizeMode = 'clip',
|
|
58
59
|
onPress,
|
|
59
60
|
children
|
|
60
61
|
} = themeProps;
|
|
@@ -177,7 +178,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
177
178
|
const Container = onPress ? TouchableOpacity : View;
|
|
178
179
|
return <Container style={_containerStyle} ref={ref} testID={testID} onPress={onPress} accessible={!_isUndefined(onPress)} accessibilityLabel={'Avatar'} accessibilityRole={onPress ? 'button' : 'image'} hitSlop={onPress ? hitTargetPadding : undefined} {...accessibilityProps}>
|
|
179
180
|
<View testID={`${testID}.container`} style={textContainerStyle}>
|
|
180
|
-
{!_isUndefined(text) && <Text numberOfLines={1} style={textStyle} testID={`${testID}.label`}>
|
|
181
|
+
{!_isUndefined(text) && <Text numberOfLines={1} ellipsizeMode={ellipsizeMode} style={textStyle} testID={`${testID}.label`}>
|
|
181
182
|
{text}
|
|
182
183
|
</Text>}
|
|
183
184
|
</View>
|
|
@@ -193,7 +194,8 @@ const styles = StyleSheet.create({
|
|
|
193
194
|
...StyleSheet.absoluteFillObject,
|
|
194
195
|
alignItems: 'center',
|
|
195
196
|
justifyContent: 'center',
|
|
196
|
-
borderRadius: BorderRadiuses.br100
|
|
197
|
+
borderRadius: BorderRadiuses.br100,
|
|
198
|
+
overflow: 'hidden'
|
|
197
199
|
},
|
|
198
200
|
initialsContainerWithInset: {
|
|
199
201
|
top: 1,
|
|
@@ -156,7 +156,7 @@ class Image extends PureComponent {
|
|
|
156
156
|
} = modifiers;
|
|
157
157
|
return (
|
|
158
158
|
// @ts-ignore
|
|
159
|
-
<ImageView style={[
|
|
159
|
+
<ImageView style={[tintColor && {
|
|
160
160
|
tintColor
|
|
161
161
|
}, shouldFlipRTL && styles.rtlFlipped, width && {
|
|
162
162
|
width
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
console.log(`inside index.web.js`);
|
|
2
|
-
export const icons = {
|
|
3
|
-
get check() {
|
|
4
|
-
return {uri: require('./check.png'), dimensions: {width: 24, height: 24}};
|
|
5
|
-
},
|
|
6
|
-
get checkSmall() {
|
|
7
|
-
return {uri: require('./check-small.png'), dimensions: {width: 24, height: 24}};
|
|
8
|
-
},
|
|
9
|
-
get minusSmall() {
|
|
10
|
-
return {uri: require('./minusSmall.png'), dimensions: {width: 24, height: 24}};
|
|
11
|
-
},
|
|
12
|
-
get plusSmall() {
|
|
13
|
-
return {uri: require('./plusSmall.png'), dimensions: {width: 24, height: 24}};
|
|
14
|
-
},
|
|
15
|
-
get search() {
|
|
16
|
-
return {uri: require('./search.png'), dimensions: {width: 24, height: 24}};
|
|
17
|
-
},
|
|
18
|
-
get x() {
|
|
19
|
-
return {uri: require('./x.png'), dimensions: {width: 24, height: 24}};
|
|
20
|
-
},
|
|
21
|
-
get xMedium() {
|
|
22
|
-
return {uri: require('./xMedium.png'), dimensions: {width: 24, height: 24}};
|
|
23
|
-
},
|
|
24
|
-
get xFlat() {
|
|
25
|
-
return {uri: require('./xFlat.png'), dimensions: {width: 24, height: 24}};
|
|
26
|
-
}
|
|
27
|
-
};
|