react-native-ui-lib 7.41.0-snapshot.6891 → 7.41.0-snapshot.6899
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 +1 -1
- package/scripts/docs/buildDocsCommon.js +1 -7
- package/src/components/timeline/Line.d.ts +1 -0
- package/src/components/timeline/Line.js +5 -4
- package/src/components/timeline/Point.d.ts +1 -0
- package/src/components/timeline/Point.js +5 -4
- package/src/components/timeline/index.js +6 -5
- package/src/components/timeline/line.driver.d.ts +9 -0
- package/src/components/timeline/line.driver.js +35 -0
- package/src/components/timeline/point.driver.d.ts +8 -0
- package/src/components/timeline/point.driver.js +55 -0
- package/src/components/timeline/timeline.driver.d.ts +23 -0
- package/src/components/timeline/timeline.driver.js +39 -0
package/package.json
CHANGED
|
@@ -7,7 +7,6 @@ const fs = require('fs');
|
|
|
7
7
|
|
|
8
8
|
const COMPONENTS_DOCS_DIR = './docs/components';
|
|
9
9
|
const SERVICES_DOCS_DIR = './docs/services';
|
|
10
|
-
const COMPOSITE_DOCS_DIR = './docs/composite';
|
|
11
10
|
const FOUNDATION_DOCS_DIR = './docs/foundation';
|
|
12
11
|
|
|
13
12
|
const VALID_COMPONENTS_CATEGORIES = [
|
|
@@ -28,8 +27,7 @@ const VALID_COMPONENTS_CATEGORIES = [
|
|
|
28
27
|
'infra',
|
|
29
28
|
// non components categories
|
|
30
29
|
'services',
|
|
31
|
-
'dev'
|
|
32
|
-
'composite'
|
|
30
|
+
'dev' // development category for components we don't want to render in our docs (used in test.api.json)
|
|
33
31
|
];
|
|
34
32
|
|
|
35
33
|
function buildDocs(apiFolders, componentsPreProcess) {
|
|
@@ -97,10 +95,6 @@ function processComponents(components) {
|
|
|
97
95
|
|
|
98
96
|
let dirPath;
|
|
99
97
|
switch (component.category) {
|
|
100
|
-
case 'composite': {
|
|
101
|
-
dirPath = `${COMPOSITE_DOCS_DIR}`;
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
98
|
case 'services': {
|
|
105
99
|
dirPath = `${SERVICES_DOCS_DIR}`;
|
|
106
100
|
break;
|
|
@@ -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}.entryPoint`} />;
|
|
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} />;
|
|
36
37
|
}
|
|
37
|
-
return <View style={solidLineStyle} />;
|
|
38
|
+
return <View style={solidLineStyle} testID={testID} />;
|
|
38
39
|
};
|
|
39
40
|
return <>
|
|
40
41
|
{top && renderStartPoint()}
|
|
@@ -3,6 +3,7 @@ import { LayoutChangeEvent } from 'react-native';
|
|
|
3
3
|
import { PointProps } from './types';
|
|
4
4
|
type PointPropsInternal = PointProps & {
|
|
5
5
|
onLayout?: (event: LayoutChangeEvent) => void;
|
|
6
|
+
testID?: string;
|
|
6
7
|
};
|
|
7
8
|
declare const Point: (props: PointPropsInternal) => React.JSX.Element;
|
|
8
9
|
export default Point;
|
|
@@ -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}>
|
|
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
|
+
return <View row style={containerStyle} testID={testID}>
|
|
118
119
|
<View style={styles.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}>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentProps } from '../../testkit/new/Component.driver';
|
|
2
|
+
export declare const LineDriver: (props: ComponentProps) => {
|
|
3
|
+
getLine: () => {
|
|
4
|
+
exists: () => boolean;
|
|
5
|
+
getStyle: () => any;
|
|
6
|
+
isEntryPointExists: () => boolean;
|
|
7
|
+
getEntryPointStyle: () => any;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { ViewDriver } from "../view/View.driver.new";
|
|
3
|
+
export const LineDriver = props => {
|
|
4
|
+
const lineDriver = ViewDriver({
|
|
5
|
+
renderTree: props.renderTree,
|
|
6
|
+
testID: `${props.testID}`
|
|
7
|
+
});
|
|
8
|
+
const entryPointDriver = ViewDriver({
|
|
9
|
+
renderTree: props.renderTree,
|
|
10
|
+
testID: `${props.testID}.entryPoint`
|
|
11
|
+
});
|
|
12
|
+
const getLine = () => {
|
|
13
|
+
const exists = () => {
|
|
14
|
+
return lineDriver.exists();
|
|
15
|
+
};
|
|
16
|
+
const getStyle = () => {
|
|
17
|
+
return StyleSheet.flatten(lineDriver.getElement().props.style);
|
|
18
|
+
};
|
|
19
|
+
const isEntryPointExists = () => {
|
|
20
|
+
return entryPointDriver.exists();
|
|
21
|
+
};
|
|
22
|
+
const getEntryPointStyle = () => {
|
|
23
|
+
return entryPointDriver.getStyle();
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
exists,
|
|
27
|
+
getStyle,
|
|
28
|
+
isEntryPointExists,
|
|
29
|
+
getEntryPointStyle
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
getLine
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { TextDriver } from "../text/Text.driver.new";
|
|
3
|
+
import { ImageDriver } from "../image/Image.driver.new";
|
|
4
|
+
import { ViewDriver } from "../view/View.driver.new";
|
|
5
|
+
export const PointDriver = props => {
|
|
6
|
+
const pointDriver = ViewDriver({
|
|
7
|
+
renderTree: props.renderTree,
|
|
8
|
+
testID: `${props.testID}`
|
|
9
|
+
});
|
|
10
|
+
const labelDriver = TextDriver({
|
|
11
|
+
renderTree: props.renderTree,
|
|
12
|
+
testID: `${props.testID}.label`
|
|
13
|
+
});
|
|
14
|
+
const iconDriver = ImageDriver({
|
|
15
|
+
renderTree: props.renderTree,
|
|
16
|
+
testID: `${props.testID}.icon`
|
|
17
|
+
});
|
|
18
|
+
const getLabel = () => {
|
|
19
|
+
const exists = () => {
|
|
20
|
+
return labelDriver.exists();
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
...labelDriver,
|
|
24
|
+
exists
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
const getIcon = () => {
|
|
28
|
+
const exists = () => {
|
|
29
|
+
return iconDriver.exists();
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
...iconDriver,
|
|
33
|
+
exists
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const getPoint = () => {
|
|
37
|
+
const exists = () => {
|
|
38
|
+
return pointDriver.exists();
|
|
39
|
+
};
|
|
40
|
+
const getStyle = () => {
|
|
41
|
+
return StyleSheet.flatten(pointDriver.getElement().props.style);
|
|
42
|
+
};
|
|
43
|
+
const getContentStyle = () => {
|
|
44
|
+
return getIcon().exists() ? StyleSheet.flatten(getIcon().getElement().props.style) : getLabel().exists() && StyleSheet.flatten(getLabel().getElement().props.style);
|
|
45
|
+
};
|
|
46
|
+
return {
|
|
47
|
+
exists,
|
|
48
|
+
getStyle,
|
|
49
|
+
getContentStyle
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
getPoint
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentProps } from '../../testkit/new/Component.driver';
|
|
2
|
+
export declare const TimelineDriver: (props: ComponentProps) => {
|
|
3
|
+
getPoint: () => {
|
|
4
|
+
exists: () => boolean;
|
|
5
|
+
getStyle: () => any;
|
|
6
|
+
getContentStyle: () => any;
|
|
7
|
+
};
|
|
8
|
+
getTopLine: () => {
|
|
9
|
+
exists: () => boolean;
|
|
10
|
+
getStyle: () => any;
|
|
11
|
+
isEntryPointExists: () => boolean;
|
|
12
|
+
getEntryPointStyle: () => any;
|
|
13
|
+
};
|
|
14
|
+
getBottomLine: () => {
|
|
15
|
+
exists: () => boolean;
|
|
16
|
+
getStyle: () => any;
|
|
17
|
+
isEntryPointExists: () => boolean;
|
|
18
|
+
getEntryPointStyle: () => any;
|
|
19
|
+
};
|
|
20
|
+
getElement: () => import("react-test-renderer").ReactTestInstance;
|
|
21
|
+
queryElement: () => import("react-test-renderer").ReactTestInstance | undefined;
|
|
22
|
+
exists: () => boolean;
|
|
23
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useComponentDriver } from "../../testkit/new/Component.driver";
|
|
2
|
+
import { LineDriver } from "./line.driver";
|
|
3
|
+
import { PointDriver } from "./point.driver";
|
|
4
|
+
export const TimelineDriver = props => {
|
|
5
|
+
const driver = useComponentDriver(props);
|
|
6
|
+
const pointDriver = PointDriver({
|
|
7
|
+
renderTree: props.renderTree,
|
|
8
|
+
testID: `${props.testID}.point`
|
|
9
|
+
});
|
|
10
|
+
const topLineDriver = LineDriver({
|
|
11
|
+
renderTree: props.renderTree,
|
|
12
|
+
testID: `${props.testID}.topLine`
|
|
13
|
+
});
|
|
14
|
+
const bottomLineDriver = LineDriver({
|
|
15
|
+
renderTree: props.renderTree,
|
|
16
|
+
testID: `${props.testID}.bottomLine`
|
|
17
|
+
});
|
|
18
|
+
const getPoint = () => {
|
|
19
|
+
return {
|
|
20
|
+
...pointDriver.getPoint()
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
const getTopLine = () => {
|
|
24
|
+
return {
|
|
25
|
+
...topLineDriver.getLine()
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const getBottomLine = () => {
|
|
29
|
+
return {
|
|
30
|
+
...bottomLineDriver.getLine()
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
...driver,
|
|
35
|
+
getPoint,
|
|
36
|
+
getTopLine,
|
|
37
|
+
getBottomLine
|
|
38
|
+
};
|
|
39
|
+
};
|