react-native-ui-lib 7.40.1-snapshot.6872 → 7.41.0-snapshot.6877

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": "react-native-ui-lib",
3
- "version": "7.40.1-snapshot.6872",
3
+ "version": "7.41.0-snapshot.6877",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -12,7 +12,8 @@ const Line = React.memo(props => {
12
12
  entry,
13
13
  top,
14
14
  style,
15
- width = LINE_WIDTH
15
+ width = LINE_WIDTH,
16
+ testID
16
17
  } = props;
17
18
  const solidLineStyle = useMemo(() => {
18
19
  return [style, styles.line, {
@@ -27,14 +28,14 @@ const Line = React.memo(props => {
27
28
  if (entry) {
28
29
  return <View style={[styles.entryPoint, {
29
30
  backgroundColor: color
30
- }]} />;
31
+ }]} testID={`${testID}.${top ? 'startPoint' : 'endPoint'}`} />;
31
32
  }
32
33
  };
33
34
  const renderLine = () => {
34
35
  if (type === LineTypes.DASHED) {
35
- return <Dash vertical color={color} containerStyle={dashedLineStyle} />;
36
+ return <Dash vertical color={color} containerStyle={dashedLineStyle} testID={`${testID}.dashedLine`} />;
36
37
  }
37
- return <View style={solidLineStyle} />;
38
+ return <View style={solidLineStyle} testID={`${testID}.solidLine`} />;
38
39
  };
39
40
  return <>
40
41
  {top && renderStartPoint()}
@@ -20,7 +20,8 @@ const Point = props => {
20
20
  label,
21
21
  type,
22
22
  color,
23
- onLayout
23
+ onLayout,
24
+ testID
24
25
  } = props;
25
26
  const pointStyle = useMemo(() => {
26
27
  const hasOutline = type === PointTypes.OUTLINE;
@@ -55,14 +56,14 @@ const Point = props => {
55
56
  const tintColor = removeIconBackground ? Colors.$iconDefault : Colors.$iconDefaultLight;
56
57
  const iconSize = removeIconBackground ? undefined : ICON_SIZE;
57
58
  if (icon) {
58
- return <Icon tintColor={tintColor} {...iconProps} size={iconSize} source={icon} />;
59
+ return <Icon testID={`${testID}.icon`} tintColor={tintColor} {...iconProps} size={iconSize} source={icon} />;
59
60
  } else if (label) {
60
- return <Text recorderTag={'unmask'} $textDefaultLight subtextBold color={labelColor}>
61
+ return <Text testID={`${testID}.label`} recorderTag={'unmask'} $textDefaultLight subtextBold color={labelColor}>
61
62
  {label}
62
63
  </Text>;
63
64
  }
64
65
  };
65
- return <View center style={pointStyle} onLayout={onLayout}>
66
+ return <View center style={pointStyle} onLayout={onLayout} testID={`${testID}.container`}>
66
67
  {renderPointContent()}
67
68
  </View>;
68
69
  };
@@ -15,7 +15,8 @@ const Timeline = props => {
15
15
  topLine,
16
16
  bottomLine,
17
17
  point,
18
- children
18
+ children,
19
+ testID
19
20
  } = themeProps;
20
21
  const [anchorMeasurements, setAnchorMeasurements] = useState();
21
22
  const [contentContainerMeasurements, setContentContainerMeasurements] = useState();
@@ -107,17 +108,17 @@ const Timeline = props => {
107
108
  });
108
109
  }, []);
109
110
  const renderTopLine = () => {
110
- return <Line {...topLine} top style={topLineStyle} color={topLine ? topLine?.color || getStateColor(topLine?.state) : undefined} />;
111
+ return <Line testID={`${testID}.topLine`} {...topLine} top style={topLineStyle} color={topLine ? topLine?.color || getStateColor(topLine?.state) : undefined} />;
111
112
  };
112
113
  const renderBottomLine = () => {
113
114
  if (bottomLine) {
114
- return <Line {...bottomLine} style={styles.bottomLine} color={bottomLine?.color || getStateColor(bottomLine?.state)} />;
115
+ return <Line testID={`${testID}.bottomLine`} {...bottomLine} style={styles.bottomLine} color={bottomLine?.color || getStateColor(bottomLine?.state)} />;
115
116
  }
116
117
  };
117
- return <View row style={containerStyle}>
118
- <View style={styles.timelineContainer}>
118
+ return <View row style={containerStyle} testID={testID}>
119
+ <View style={styles.timelineContainer} testID={`${testID}.timelineContainer`}>
119
120
  {renderTopLine()}
120
- <Point {...point} onLayout={onPointLayout} color={point?.color || getStateColor(point?.state)} />
121
+ <Point {...point} onLayout={onPointLayout} color={point?.color || getStateColor(point?.state)} testID={`${testID}.point`} />
121
122
  {renderBottomLine()}
122
123
  </View>
123
124
  <View style={styles.contentContainer} onLayout={onContentContainerLayout} ref={contentContainerRef}>
@@ -23,6 +23,7 @@ export type LineProps = {
23
23
  /** to mark as entry point */
24
24
  entry?: boolean;
25
25
  width?: number;
26
+ testID?: string;
26
27
  };
27
28
  export type PointProps = {
28
29
  state?: StateTypes | `${StateTypes}`;
@@ -35,6 +36,7 @@ export type PointProps = {
35
36
  labelColor?: string;
36
37
  /** to align point to this view's center */
37
38
  anchorRef?: React.MutableRefObject<undefined>;
39
+ testID?: string;
38
40
  };
39
41
  export type Layout = {
40
42
  x: number;