@terreno/ui 0.22.1 → 0.23.0
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/README.md +27 -0
- package/dist/Accordion.js +3 -3
- package/dist/Accordion.js.map +1 -1
- package/dist/BooleanField.js +6 -4
- package/dist/BooleanField.js.map +1 -1
- package/dist/Box.js +3 -2
- package/dist/Box.js.map +1 -1
- package/dist/CheckBox.js +2 -2
- package/dist/CheckBox.js.map +1 -1
- package/dist/Common.d.ts +40 -57
- package/dist/Common.js +1 -0
- package/dist/Common.js.map +1 -1
- package/dist/CustomSelectField.js +5 -3
- package/dist/CustomSelectField.js.map +1 -1
- package/dist/DataTable.js +18 -12
- package/dist/DataTable.js.map +1 -1
- package/dist/DateTimeField.js +5 -3
- package/dist/DateTimeField.js.map +1 -1
- package/dist/Link.js +2 -2
- package/dist/Link.js.map +1 -1
- package/dist/MarkdownEditor.js +14 -2
- package/dist/MarkdownEditor.js.map +1 -1
- package/dist/MarkdownEditorField.js +18 -4
- package/dist/MarkdownEditorField.js.map +1 -1
- package/dist/Modal.js +10 -6
- package/dist/Modal.js.map +1 -1
- package/dist/MultiselectField.js +5 -3
- package/dist/MultiselectField.js.map +1 -1
- package/dist/Page.js +1 -1
- package/dist/Page.js.map +1 -1
- package/dist/Pagination.js +2 -2
- package/dist/Pagination.js.map +1 -1
- package/dist/SegmentedControl.js +5 -3
- package/dist/SegmentedControl.js.map +1 -1
- package/dist/SelectField.js +5 -3
- package/dist/SelectField.js.map +1 -1
- package/dist/SocialLoginButton.js +2 -1
- package/dist/SocialLoginButton.js.map +1 -1
- package/dist/Spinner.js +3 -2
- package/dist/Spinner.js.map +1 -1
- package/dist/TextField.js +6 -4
- package/dist/TextField.js.map +1 -1
- package/dist/fieldElements/FieldError.d.ts +1 -0
- package/dist/fieldElements/FieldError.js +3 -2
- package/dist/fieldElements/FieldError.js.map +1 -1
- package/dist/fieldElements/FieldHelperText.d.ts +1 -0
- package/dist/fieldElements/FieldHelperText.js +3 -2
- package/dist/fieldElements/FieldHelperText.js.map +1 -1
- package/dist/fieldElements/FieldTitle.d.ts +1 -0
- package/dist/fieldElements/FieldTitle.js +4 -3
- package/dist/fieldElements/FieldTitle.js.map +1 -1
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/resolveTestId.d.ts +39 -0
- package/dist/testing/resolveTestId.js +97 -0
- package/dist/testing/resolveTestId.js.map +1 -0
- package/dist/testing/types.d.ts +59 -0
- package/dist/testing/types.js +2 -0
- package/dist/testing/types.js.map +1 -0
- package/package.json +1 -1
- package/src/Accordion.tsx +3 -1
- package/src/BooleanField.tsx +13 -3
- package/src/Box.tsx +3 -2
- package/src/CheckBox.tsx +7 -1
- package/src/Common.ts +62 -60
- package/src/CustomSelectField.tsx +8 -1
- package/src/DataTable.tsx +40 -3
- package/src/DateTimeField.tsx +10 -3
- package/src/Link.tsx +2 -1
- package/src/MarkdownEditor.tsx +52 -27
- package/src/MarkdownEditorField.tsx +37 -16
- package/src/Modal.tsx +13 -0
- package/src/MultiselectField.tsx +8 -3
- package/src/Page.tsx +1 -0
- package/src/Pagination.tsx +2 -1
- package/src/SegmentedControl.tsx +15 -2
- package/src/SelectField.tsx +8 -3
- package/src/SocialLoginButton.tsx +2 -1
- package/src/Spinner.tsx +3 -2
- package/src/TextField.tsx +8 -5
- package/src/__snapshots__/AddressField.test.tsx.snap +4 -0
- package/src/__snapshots__/BooleanField.test.tsx.snap +4 -0
- package/src/__snapshots__/Field.test.tsx.snap +8 -0
- package/src/__snapshots__/Link.test.tsx.snap +1 -0
- package/src/__snapshots__/Page.test.tsx.snap +21 -0
- package/src/__snapshots__/SegmentedControl.test.tsx.snap +4 -0
- package/src/__snapshots__/UnifiedAddressAutoComplete.test.tsx.snap +1 -0
- package/src/fieldElements/FieldError.tsx +7 -2
- package/src/fieldElements/FieldHelperText.tsx +4 -2
- package/src/fieldElements/FieldTitle.tsx +4 -1
- package/src/login/__snapshots__/LoginScreen.test.tsx.snap +4 -0
- package/src/signUp/__snapshots__/SignUpScreen.test.tsx.snap +5 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/resolveTestId.test.ts +130 -0
- package/src/testing/resolveTestId.ts +142 -0
- package/src/testing/types.ts +67 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
/** Build a dot-suffixed test id, e.g. `login.email` + `input` → `login.email.input`. */
|
|
3
|
+
export const resolveTestID = (base, part) => {
|
|
4
|
+
if (!base) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
if (!part) {
|
|
8
|
+
return base;
|
|
9
|
+
}
|
|
10
|
+
return `${base}.${part}`;
|
|
11
|
+
};
|
|
12
|
+
/** React Native / RN Web test props (`testID` maps to `data-testid` on web). */
|
|
13
|
+
export const toTestProps = (id) => {
|
|
14
|
+
if (!id) {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
return { testID: id };
|
|
18
|
+
};
|
|
19
|
+
/** Plain DOM test props for web-only components. */
|
|
20
|
+
export const toDomTestProps = (id) => {
|
|
21
|
+
if (!id) {
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
24
|
+
return { "data-testid": id };
|
|
25
|
+
};
|
|
26
|
+
/** Cross-platform test props — RN uses `testID`, web DOM uses `data-testid`. */
|
|
27
|
+
export const toPlatformTestProps = (id) => {
|
|
28
|
+
if (!id) {
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
if (Platform.OS === "web") {
|
|
32
|
+
return { "data-testid": id };
|
|
33
|
+
}
|
|
34
|
+
return { testID: id };
|
|
35
|
+
};
|
|
36
|
+
/** Resolve compound field test ids with dot-suffix defaults. */
|
|
37
|
+
export const resolveFieldTestIDs = (baseTestID, testIDs) => {
|
|
38
|
+
var _a, _b, _c, _d;
|
|
39
|
+
return {
|
|
40
|
+
error: (_a = testIDs === null || testIDs === void 0 ? void 0 : testIDs.error) !== null && _a !== void 0 ? _a : resolveTestID(baseTestID, "error"),
|
|
41
|
+
helper: (_b = testIDs === null || testIDs === void 0 ? void 0 : testIDs.helper) !== null && _b !== void 0 ? _b : resolveTestID(baseTestID, "helper"),
|
|
42
|
+
input: (_c = testIDs === null || testIDs === void 0 ? void 0 : testIDs.input) !== null && _c !== void 0 ? _c : baseTestID,
|
|
43
|
+
label: (_d = testIDs === null || testIDs === void 0 ? void 0 : testIDs.label) !== null && _d !== void 0 ? _d : resolveTestID(baseTestID, "label"),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/** Resolve field test ids from component props. */
|
|
47
|
+
export const resolveFieldTestIDsFromProps = (props) => {
|
|
48
|
+
return resolveFieldTestIDs(props.testID, props.testIDs);
|
|
49
|
+
};
|
|
50
|
+
/** Resolve compound modal test ids with dot-suffix defaults. */
|
|
51
|
+
export const resolveModalTestIDs = (baseTestID, testIDs) => {
|
|
52
|
+
var _a, _b, _c, _d, _e;
|
|
53
|
+
return {
|
|
54
|
+
dismiss: (_a = testIDs === null || testIDs === void 0 ? void 0 : testIDs.dismiss) !== null && _a !== void 0 ? _a : resolveTestID(baseTestID, "dismiss"),
|
|
55
|
+
primaryButton: (_b = testIDs === null || testIDs === void 0 ? void 0 : testIDs.primaryButton) !== null && _b !== void 0 ? _b : resolveTestID(baseTestID, "primary"),
|
|
56
|
+
root: (_c = testIDs === null || testIDs === void 0 ? void 0 : testIDs.root) !== null && _c !== void 0 ? _c : baseTestID,
|
|
57
|
+
secondaryButton: (_d = testIDs === null || testIDs === void 0 ? void 0 : testIDs.secondaryButton) !== null && _d !== void 0 ? _d : resolveTestID(baseTestID, "secondary"),
|
|
58
|
+
title: (_e = testIDs === null || testIDs === void 0 ? void 0 : testIDs.title) !== null && _e !== void 0 ? _e : resolveTestID(baseTestID, "title"),
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export const resolveModalTestIDsFromProps = (props) => {
|
|
62
|
+
return resolveModalTestIDs(props.testID, props.testIDs);
|
|
63
|
+
};
|
|
64
|
+
/** Resolve compound DataTable test ids with dot-suffix defaults. */
|
|
65
|
+
export const resolveDataTableTestIDs = (baseTestID, testIDs) => {
|
|
66
|
+
var _a, _b, _c, _d, _e;
|
|
67
|
+
return {
|
|
68
|
+
body: (_a = testIDs === null || testIDs === void 0 ? void 0 : testIDs.body) !== null && _a !== void 0 ? _a : resolveTestID(baseTestID, "body"),
|
|
69
|
+
header: (_b = testIDs === null || testIDs === void 0 ? void 0 : testIDs.header) !== null && _b !== void 0 ? _b : resolveTestID(baseTestID, "header"),
|
|
70
|
+
pagination: (_c = testIDs === null || testIDs === void 0 ? void 0 : testIDs.pagination) !== null && _c !== void 0 ? _c : resolveTestID(baseTestID, "pagination"),
|
|
71
|
+
root: (_d = testIDs === null || testIDs === void 0 ? void 0 : testIDs.root) !== null && _d !== void 0 ? _d : baseTestID,
|
|
72
|
+
row: (_e = testIDs === null || testIDs === void 0 ? void 0 : testIDs.row) !== null && _e !== void 0 ? _e : resolveTestID(baseTestID, "row"),
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export const resolveDataTableTestIDsFromProps = (props) => {
|
|
76
|
+
return resolveDataTableTestIDs(props.testID, props.testIDs);
|
|
77
|
+
};
|
|
78
|
+
/** Row test id for DataTable — use with a stable row key, not row index alone. */
|
|
79
|
+
export const resolveDataTableRowTestID = (rowTestIDBase, rowKey) => {
|
|
80
|
+
if (!rowTestIDBase) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
return `${rowTestIDBase}-${rowKey}`;
|
|
84
|
+
};
|
|
85
|
+
/** Resolve compound SegmentedControl test ids with dot-suffix defaults. */
|
|
86
|
+
export const resolveSegmentedControlTestIDs = (baseTestID, testIDs) => {
|
|
87
|
+
var _a, _b, _c;
|
|
88
|
+
return {
|
|
89
|
+
nextButton: (_a = testIDs === null || testIDs === void 0 ? void 0 : testIDs.nextButton) !== null && _a !== void 0 ? _a : resolveTestID(baseTestID, "next"),
|
|
90
|
+
previousButton: (_b = testIDs === null || testIDs === void 0 ? void 0 : testIDs.previousButton) !== null && _b !== void 0 ? _b : resolveTestID(baseTestID, "previous"),
|
|
91
|
+
root: (_c = testIDs === null || testIDs === void 0 ? void 0 : testIDs.root) !== null && _c !== void 0 ? _c : baseTestID,
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
export const resolveSegmentedControlTestIDsFromProps = (props) => {
|
|
95
|
+
return resolveSegmentedControlTestIDs(props.testID, props.testIDs);
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=resolveTestId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveTestId.js","sourceRoot":"","sources":["../../src/testing/resolveTestId.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Shared test id surface for @terreno/ui components. */
|
|
2
|
+
export interface WithTestID {
|
|
3
|
+
/** Root test id for the primary interactive element or container. */
|
|
4
|
+
testID?: string;
|
|
5
|
+
}
|
|
6
|
+
/** Sub-element test ids for compound form fields. */
|
|
7
|
+
export interface FieldTestIDs {
|
|
8
|
+
label?: string;
|
|
9
|
+
input?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
helper?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Sub-element test ids for Modal. */
|
|
14
|
+
export interface ModalTestIDs {
|
|
15
|
+
root?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
primaryButton?: string;
|
|
18
|
+
secondaryButton?: string;
|
|
19
|
+
dismiss?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Sub-element test ids for DataTable. */
|
|
22
|
+
export interface DataTableTestIDs {
|
|
23
|
+
root?: string;
|
|
24
|
+
header?: string;
|
|
25
|
+
body?: string;
|
|
26
|
+
row?: string;
|
|
27
|
+
pagination?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Sub-element test ids for SegmentedControl. */
|
|
30
|
+
export interface SegmentedControlTestIDs {
|
|
31
|
+
root?: string;
|
|
32
|
+
previousButton?: string;
|
|
33
|
+
nextButton?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ResolvedFieldTestIDs {
|
|
36
|
+
label?: string;
|
|
37
|
+
input?: string;
|
|
38
|
+
error?: string;
|
|
39
|
+
helper?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ResolvedModalTestIDs {
|
|
42
|
+
root?: string;
|
|
43
|
+
title?: string;
|
|
44
|
+
primaryButton?: string;
|
|
45
|
+
secondaryButton?: string;
|
|
46
|
+
dismiss?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface ResolvedDataTableTestIDs {
|
|
49
|
+
root?: string;
|
|
50
|
+
header?: string;
|
|
51
|
+
body?: string;
|
|
52
|
+
row?: string;
|
|
53
|
+
pagination?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ResolvedSegmentedControlTestIDs {
|
|
56
|
+
root?: string;
|
|
57
|
+
previousButton?: string;
|
|
58
|
+
nextButton?: string;
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/testing/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
package/src/Accordion.tsx
CHANGED
|
@@ -19,6 +19,7 @@ export const Accordion: FC<AccordionProps> = ({
|
|
|
19
19
|
infoModalText,
|
|
20
20
|
infoModalTitle,
|
|
21
21
|
onToggle,
|
|
22
|
+
testID,
|
|
22
23
|
}) => {
|
|
23
24
|
const {theme} = useTheme();
|
|
24
25
|
const [collapsed, setCollapsed] = useState(false);
|
|
@@ -38,6 +39,7 @@ export const Accordion: FC<AccordionProps> = ({
|
|
|
38
39
|
padding: 16,
|
|
39
40
|
width: "100%",
|
|
40
41
|
}}
|
|
42
|
+
testID={testID}
|
|
41
43
|
>
|
|
42
44
|
<View style={{alignItems: "center", flexDirection: "row", justifyContent: "space-between"}}>
|
|
43
45
|
<View style={{flexDirection: "column", gap: 4}}>
|
|
@@ -64,7 +66,7 @@ export const Accordion: FC<AccordionProps> = ({
|
|
|
64
66
|
onToggle(!collapsed);
|
|
65
67
|
}
|
|
66
68
|
}}
|
|
67
|
-
testID="accordion-toggle"
|
|
69
|
+
testID={testID ? `${testID}.toggle` : "accordion-toggle"}
|
|
68
70
|
>
|
|
69
71
|
<FontAwesome6
|
|
70
72
|
color={theme.text.link}
|
package/src/BooleanField.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import type {BooleanFieldProps} from "./Common";
|
|
|
5
5
|
import {FieldHelperText, FieldTitle} from "./fieldElements";
|
|
6
6
|
import {Text} from "./Text";
|
|
7
7
|
import {useTheme} from "./Theme";
|
|
8
|
+
import {resolveFieldTestIDsFromProps} from "./testing/resolveTestId";
|
|
8
9
|
|
|
9
10
|
const TOUCHABLE_SIZE = 20;
|
|
10
11
|
const OFFSET = 10;
|
|
@@ -19,8 +20,11 @@ export const BooleanField: FC<BooleanFieldProps> = ({
|
|
|
19
20
|
disabled,
|
|
20
21
|
disabledHelperText,
|
|
21
22
|
helperText,
|
|
23
|
+
testID,
|
|
24
|
+
testIDs,
|
|
22
25
|
}) => {
|
|
23
26
|
const {theme} = useTheme();
|
|
27
|
+
const fieldTestIDs = resolveFieldTestIDsFromProps({testID, testIDs});
|
|
24
28
|
const backgroundColor = useRef(
|
|
25
29
|
new Animated.Value(value ? WIDTH_WITH_OFFSET : -1 * WIDTH_WITH_OFFSET)
|
|
26
30
|
).current;
|
|
@@ -83,6 +87,7 @@ export const BooleanField: FC<BooleanFieldProps> = ({
|
|
|
83
87
|
alignItems: "flex-start",
|
|
84
88
|
flexDirection: "column",
|
|
85
89
|
}}
|
|
90
|
+
testID={fieldTestIDs.input}
|
|
86
91
|
>
|
|
87
92
|
<View
|
|
88
93
|
style={{
|
|
@@ -91,11 +96,12 @@ export const BooleanField: FC<BooleanFieldProps> = ({
|
|
|
91
96
|
justifyContent: variant === "title" ? "flex-start" : "center",
|
|
92
97
|
}}
|
|
93
98
|
>
|
|
94
|
-
{Boolean(title) && <FieldTitle text={title!} />}
|
|
99
|
+
{Boolean(title) && <FieldTitle testID={fieldTestIDs.label} text={title!} />}
|
|
95
100
|
<Pressable
|
|
96
101
|
aria-role="button"
|
|
97
102
|
onPress={handleSwitch}
|
|
98
103
|
style={{alignItems: "center", flexDirection: "row", justifyContent: "center"}}
|
|
104
|
+
testID={fieldTestIDs.input ? `${fieldTestIDs.input}.switch` : undefined}
|
|
99
105
|
>
|
|
100
106
|
<Animated.View
|
|
101
107
|
style={{
|
|
@@ -136,8 +142,12 @@ export const BooleanField: FC<BooleanFieldProps> = ({
|
|
|
136
142
|
{variant === "title" && <Text size="md">{value ? "Yes" : "No"}</Text>}
|
|
137
143
|
</Pressable>
|
|
138
144
|
</View>
|
|
139
|
-
{disabled && disabledHelperText &&
|
|
140
|
-
|
|
145
|
+
{disabled && disabledHelperText && (
|
|
146
|
+
<FieldHelperText testID={fieldTestIDs.helper} text={disabledHelperText} />
|
|
147
|
+
)}
|
|
148
|
+
{Boolean(helperText) && (
|
|
149
|
+
<FieldHelperText testID={fieldTestIDs.helper} text={helperText as string} />
|
|
150
|
+
)}
|
|
141
151
|
</View>
|
|
142
152
|
);
|
|
143
153
|
};
|
package/src/Box.tsx
CHANGED
|
@@ -62,6 +62,7 @@ const isValidWidthHeight = (value: number | string): boolean => {
|
|
|
62
62
|
|
|
63
63
|
export const Box = React.forwardRef((props: BoxProps, ref) => {
|
|
64
64
|
const {theme} = useTheme();
|
|
65
|
+
const resolvedTestID = props.testID;
|
|
65
66
|
|
|
66
67
|
useImperativeHandle(ref, () => ({
|
|
67
68
|
scrollTo: (y: number) => {
|
|
@@ -316,7 +317,7 @@ export const Box = React.forwardRef((props: BoxProps, ref) => {
|
|
|
316
317
|
await props.onClick?.();
|
|
317
318
|
}}
|
|
318
319
|
style={propsToStyle()}
|
|
319
|
-
testID={
|
|
320
|
+
testID={resolvedTestID ? `${resolvedTestID}-clickable` : undefined}
|
|
320
321
|
>
|
|
321
322
|
{props.children}
|
|
322
323
|
</Pressable>
|
|
@@ -327,7 +328,7 @@ export const Box = React.forwardRef((props: BoxProps, ref) => {
|
|
|
327
328
|
onPointerEnter={onHoverIn}
|
|
328
329
|
onPointerLeave={onHoverOut}
|
|
329
330
|
style={propsToStyle()}
|
|
330
|
-
testID={
|
|
331
|
+
testID={resolvedTestID}
|
|
331
332
|
>
|
|
332
333
|
{props.children}
|
|
333
334
|
</View>
|
package/src/CheckBox.tsx
CHANGED
|
@@ -5,7 +5,12 @@ import {View} from "react-native";
|
|
|
5
5
|
import type {CheckBoxProps} from "./Common";
|
|
6
6
|
import {useTheme} from "./Theme";
|
|
7
7
|
|
|
8
|
-
export const CheckBox: FC<CheckBoxProps> = ({
|
|
8
|
+
export const CheckBox: FC<CheckBoxProps> = ({
|
|
9
|
+
selected,
|
|
10
|
+
size = "md",
|
|
11
|
+
bgColor = "default",
|
|
12
|
+
testID,
|
|
13
|
+
}) => {
|
|
9
14
|
const {theme} = useTheme();
|
|
10
15
|
const px = {
|
|
11
16
|
lg: {container: 24, icon: 16},
|
|
@@ -30,6 +35,7 @@ export const CheckBox: FC<CheckBoxProps> = ({selected, size = "md", bgColor = "d
|
|
|
30
35
|
justifyContent: "center",
|
|
31
36
|
width: px[size].container,
|
|
32
37
|
}}
|
|
38
|
+
testID={testID}
|
|
33
39
|
>
|
|
34
40
|
{selected ? (
|
|
35
41
|
<FontAwesome6
|
package/src/Common.ts
CHANGED
|
@@ -19,12 +19,37 @@ import type {
|
|
|
19
19
|
FontAwesome6RegularNames,
|
|
20
20
|
FontAwesome6SolidNames,
|
|
21
21
|
} from "./CommonIconTypes";
|
|
22
|
+
import type {
|
|
23
|
+
DataTableTestIDs,
|
|
24
|
+
FieldTestIDs,
|
|
25
|
+
ModalTestIDs,
|
|
26
|
+
SegmentedControlTestIDs,
|
|
27
|
+
WithTestID,
|
|
28
|
+
} from "./testing/types";
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
resolveDataTableRowTestID,
|
|
32
|
+
resolveDataTableTestIDsFromProps,
|
|
33
|
+
resolveFieldTestIDsFromProps,
|
|
34
|
+
resolveModalTestIDsFromProps,
|
|
35
|
+
resolveTestID,
|
|
36
|
+
toDomTestProps,
|
|
37
|
+
toPlatformTestProps,
|
|
38
|
+
toTestProps,
|
|
39
|
+
} from "./testing";
|
|
40
|
+
export type {
|
|
41
|
+
DataTableTestIDs,
|
|
42
|
+
FieldTestIDs,
|
|
43
|
+
ModalTestIDs,
|
|
44
|
+
SegmentedControlTestIDs,
|
|
45
|
+
WithTestID,
|
|
46
|
+
} from "./testing/types";
|
|
22
47
|
|
|
23
48
|
export type PercentageString = `${number}%`;
|
|
24
49
|
|
|
25
50
|
export type NumberOrPercentage = number | PercentageString | string;
|
|
26
51
|
|
|
27
|
-
export interface InfoModalIconProps {
|
|
52
|
+
export interface InfoModalIconProps extends WithTestID {
|
|
28
53
|
/**
|
|
29
54
|
* The content of the information modal.
|
|
30
55
|
*/
|
|
@@ -384,12 +409,11 @@ export type IconName =
|
|
|
384
409
|
| CustomIconName;
|
|
385
410
|
|
|
386
411
|
/** Props passed to a custom icon component when it is rendered. */
|
|
387
|
-
export interface CustomIconProps {
|
|
412
|
+
export interface CustomIconProps extends WithTestID {
|
|
388
413
|
/** Resolved color string, already mapped from the active theme. */
|
|
389
414
|
color: string;
|
|
390
415
|
/** Resolved icon size in pixels. */
|
|
391
416
|
size: number;
|
|
392
|
-
testID?: string;
|
|
393
417
|
}
|
|
394
418
|
|
|
395
419
|
/** A component that renders a custom (non-FontAwesome) icon. */
|
|
@@ -494,7 +518,7 @@ export interface AccessibilityProps {
|
|
|
494
518
|
accessibilityHint: string;
|
|
495
519
|
}
|
|
496
520
|
|
|
497
|
-
export interface BoxPropsBase {
|
|
521
|
+
export interface BoxPropsBase extends WithTestID {
|
|
498
522
|
alignContent?: AlignContent;
|
|
499
523
|
alignItems?: AlignItems;
|
|
500
524
|
alignSelf?: AlignSelf;
|
|
@@ -596,7 +620,6 @@ export interface BoxPropsBase {
|
|
|
596
620
|
scrollRef?: React.RefObject<ScrollView | null>;
|
|
597
621
|
onScroll?: (offsetY: number) => void;
|
|
598
622
|
onLayout?: (event: LayoutChangeEvent) => void;
|
|
599
|
-
testID?: string;
|
|
600
623
|
}
|
|
601
624
|
|
|
602
625
|
// If onClick is provided, add accessibility props.
|
|
@@ -666,7 +689,7 @@ export interface ErrorBoundaryProps {
|
|
|
666
689
|
children?: ReactNode;
|
|
667
690
|
}
|
|
668
691
|
|
|
669
|
-
export interface IconProps {
|
|
692
|
+
export interface IconProps extends WithTestID {
|
|
670
693
|
iconName: IconName;
|
|
671
694
|
type?:
|
|
672
695
|
| "regular"
|
|
@@ -680,7 +703,6 @@ export interface IconProps {
|
|
|
680
703
|
| "sharp";
|
|
681
704
|
color?: IconColor;
|
|
682
705
|
size?: IconSize;
|
|
683
|
-
testID?: string;
|
|
684
706
|
}
|
|
685
707
|
|
|
686
708
|
export type TooltipPosition = "top" | "bottom" | "left" | "right";
|
|
@@ -692,7 +714,8 @@ export interface SegmentedControlBadgeConfig {
|
|
|
692
714
|
status?: "info" | "error" | "warning" | "success" | "neutral";
|
|
693
715
|
}
|
|
694
716
|
|
|
695
|
-
export interface SegmentedControlProps {
|
|
717
|
+
export interface SegmentedControlProps extends WithTestID {
|
|
718
|
+
testIDs?: SegmentedControlTestIDs;
|
|
696
719
|
items: string[];
|
|
697
720
|
size?: "md" | "lg"; // default "md"
|
|
698
721
|
onChange: (activeIndex: number) => void;
|
|
@@ -713,9 +736,9 @@ export interface TextStyleWithOutline extends TextStyle {
|
|
|
713
736
|
outline?: string;
|
|
714
737
|
}
|
|
715
738
|
|
|
716
|
-
interface BaseFieldProps {
|
|
739
|
+
interface BaseFieldProps extends WithTestID {
|
|
717
740
|
id?: string;
|
|
718
|
-
|
|
741
|
+
testIDs?: FieldTestIDs;
|
|
719
742
|
title?: string;
|
|
720
743
|
placeholder?: string;
|
|
721
744
|
iconName?: IconName;
|
|
@@ -856,14 +879,13 @@ export const getRounding = (rounding: Rounding) => {
|
|
|
856
879
|
return ROUNDING_MAP[rounding];
|
|
857
880
|
};
|
|
858
881
|
|
|
859
|
-
export interface HeadingProps {
|
|
882
|
+
export interface HeadingProps extends WithTestID {
|
|
860
883
|
align?: "left" | "right" | "center" | "justify"; // default "left"
|
|
861
884
|
children?: React.ReactNode;
|
|
862
885
|
color?: TextColor;
|
|
863
886
|
overflow?: "normal" | "breakWord"; // default "breakWord"
|
|
864
887
|
size?: "sm" | "md" | "lg" | "xl" | "2xl"; // default "sm"
|
|
865
888
|
truncate?: boolean; // default false
|
|
866
|
-
testID?: string;
|
|
867
889
|
}
|
|
868
890
|
|
|
869
891
|
export interface MetaProps {
|
|
@@ -897,7 +919,8 @@ export interface BackButtonInterface {
|
|
|
897
919
|
onBack: () => void;
|
|
898
920
|
}
|
|
899
921
|
|
|
900
|
-
export interface BooleanFieldProps extends HelperTextProps, ErrorTextProps {
|
|
922
|
+
export interface BooleanFieldProps extends WithTestID, HelperTextProps, ErrorTextProps {
|
|
923
|
+
testIDs?: FieldTestIDs;
|
|
901
924
|
title?: string;
|
|
902
925
|
variant?: "simple" | "title"; // default "simple"
|
|
903
926
|
disabled?: boolean;
|
|
@@ -906,7 +929,7 @@ export interface BooleanFieldProps extends HelperTextProps, ErrorTextProps {
|
|
|
906
929
|
onChange: (value: boolean) => void;
|
|
907
930
|
}
|
|
908
931
|
|
|
909
|
-
export interface CheckBoxProps {
|
|
932
|
+
export interface CheckBoxProps extends WithTestID {
|
|
910
933
|
/**
|
|
911
934
|
* The background color of the checkbox.
|
|
912
935
|
* @default "default"
|
|
@@ -1017,7 +1040,7 @@ export type ReactChild = ReactNode;
|
|
|
1017
1040
|
export type ReactChildren = ReactNode;
|
|
1018
1041
|
export type WithChildren<P> = P & {children?: ReactNode};
|
|
1019
1042
|
|
|
1020
|
-
export interface AddressAutocompleteProps {
|
|
1043
|
+
export interface AddressAutocompleteProps extends WithTestID {
|
|
1021
1044
|
disabled?: boolean;
|
|
1022
1045
|
googleMapsApiKey?: string;
|
|
1023
1046
|
includeCounty?: boolean;
|
|
@@ -1026,10 +1049,9 @@ export interface AddressAutocompleteProps {
|
|
|
1026
1049
|
handleAddressChange: OnChangeCallback;
|
|
1027
1050
|
handleAutoCompleteChange: (value: AddressInterface) => void;
|
|
1028
1051
|
googlePlacesMobileStyles?: Styles;
|
|
1029
|
-
testID?: string;
|
|
1030
1052
|
}
|
|
1031
1053
|
|
|
1032
|
-
export interface ActionSheetProps {
|
|
1054
|
+
export interface ActionSheetProps extends WithTestID {
|
|
1033
1055
|
children?: React.ReactNode;
|
|
1034
1056
|
ref?: React.MutableRefObject<{
|
|
1035
1057
|
/**
|
|
@@ -1350,11 +1372,6 @@ export interface ActionSheetProps {
|
|
|
1350
1372
|
|
|
1351
1373
|
keyboardMode?: "padding" | "position";
|
|
1352
1374
|
|
|
1353
|
-
/**
|
|
1354
|
-
* Test ID for unit testing
|
|
1355
|
-
*/
|
|
1356
|
-
testID?: string;
|
|
1357
|
-
|
|
1358
1375
|
/**
|
|
1359
1376
|
*
|
|
1360
1377
|
Event called when the ActionSheet closes.
|
|
@@ -1399,7 +1416,7 @@ export interface CustomSvgProps extends SvgProps {
|
|
|
1399
1416
|
doNotDisturb?: boolean;
|
|
1400
1417
|
}
|
|
1401
1418
|
|
|
1402
|
-
export interface AvatarProps {
|
|
1419
|
+
export interface AvatarProps extends WithTestID {
|
|
1403
1420
|
/**
|
|
1404
1421
|
* The name of the user. This is used for the placeholder treatment if an image is not available.
|
|
1405
1422
|
*/
|
|
@@ -1432,13 +1449,9 @@ export interface AvatarProps {
|
|
|
1432
1449
|
* Accessibility label for the avatar image.
|
|
1433
1450
|
*/
|
|
1434
1451
|
accessibilityLabel?: string;
|
|
1435
|
-
/**
|
|
1436
|
-
* Test ID for unit testing
|
|
1437
|
-
*/
|
|
1438
|
-
testID?: string;
|
|
1439
1452
|
}
|
|
1440
1453
|
|
|
1441
|
-
export interface BadgeProps {
|
|
1454
|
+
export interface BadgeProps extends WithTestID {
|
|
1442
1455
|
/**
|
|
1443
1456
|
* When status is "custom", determines the badge's background color.
|
|
1444
1457
|
*/
|
|
@@ -1485,11 +1498,6 @@ export interface BadgeProps {
|
|
|
1485
1498
|
*/
|
|
1486
1499
|
status?: "info" | "error" | "warning" | "success" | "neutral" | "custom";
|
|
1487
1500
|
|
|
1488
|
-
/**
|
|
1489
|
-
* Test ID for unit testing
|
|
1490
|
-
*/
|
|
1491
|
-
testID?: string;
|
|
1492
|
-
|
|
1493
1501
|
/**
|
|
1494
1502
|
* The text or number to display inside the badge.
|
|
1495
1503
|
*/
|
|
@@ -1602,7 +1610,7 @@ export interface BodyProps {
|
|
|
1602
1610
|
|
|
1603
1611
|
export type ButtonPressAnimation = "scale" | "opacity" | "none";
|
|
1604
1612
|
|
|
1605
|
-
export interface ButtonProps {
|
|
1613
|
+
export interface ButtonProps extends WithTestID {
|
|
1606
1614
|
/**
|
|
1607
1615
|
* The text content of the confirmation modal.
|
|
1608
1616
|
* @default "Are you sure you want to continue?"
|
|
@@ -1645,10 +1653,6 @@ export interface ButtonProps {
|
|
|
1645
1653
|
* @default "scale"
|
|
1646
1654
|
*/
|
|
1647
1655
|
pressAnimation?: ButtonPressAnimation;
|
|
1648
|
-
/**
|
|
1649
|
-
* The test ID for the button, used for testing purposes.
|
|
1650
|
-
*/
|
|
1651
|
-
testID?: string;
|
|
1652
1656
|
/**
|
|
1653
1657
|
* The text content of the button.
|
|
1654
1658
|
*/
|
|
@@ -1690,7 +1694,7 @@ export interface ButtonProps {
|
|
|
1690
1694
|
* Props for the SocialLoginButton component.
|
|
1691
1695
|
* Used for OAuth social login buttons (Google, GitHub, Apple).
|
|
1692
1696
|
*/
|
|
1693
|
-
export interface SocialLoginButtonProps {
|
|
1697
|
+
export interface SocialLoginButtonProps extends WithTestID {
|
|
1694
1698
|
/**
|
|
1695
1699
|
* The OAuth provider for the social login.
|
|
1696
1700
|
*/
|
|
@@ -1731,14 +1735,10 @@ export interface SocialLoginButtonProps {
|
|
|
1731
1735
|
* Custom text for the button. Defaults to "Continue with {Provider}".
|
|
1732
1736
|
*/
|
|
1733
1737
|
text?: string;
|
|
1734
|
-
|
|
1735
|
-
/**
|
|
1736
|
-
* Test ID for testing purposes.
|
|
1737
|
-
*/
|
|
1738
|
-
testID?: string;
|
|
1739
1738
|
}
|
|
1740
1739
|
|
|
1741
|
-
export interface CustomSelectFieldProps {
|
|
1740
|
+
export interface CustomSelectFieldProps extends WithTestID {
|
|
1741
|
+
testIDs?: FieldTestIDs;
|
|
1742
1742
|
/**
|
|
1743
1743
|
* The current value of the custom select field.
|
|
1744
1744
|
*/
|
|
@@ -1885,7 +1885,7 @@ export interface HyperlinkProps {
|
|
|
1885
1885
|
style?: StyleProp<any>;
|
|
1886
1886
|
}
|
|
1887
1887
|
|
|
1888
|
-
export interface IconButtonProps {
|
|
1888
|
+
export interface IconButtonProps extends WithTestID {
|
|
1889
1889
|
/**
|
|
1890
1890
|
* The accessibility hint describes the results of performing an action on a control or view.
|
|
1891
1891
|
* It should be a very brief description of the result of interacting with the button.
|
|
@@ -1937,11 +1937,6 @@ export interface IconButtonProps {
|
|
|
1937
1937
|
*/
|
|
1938
1938
|
loading?: boolean;
|
|
1939
1939
|
|
|
1940
|
-
/**
|
|
1941
|
-
* The test ID for the button, used for testing purposes.
|
|
1942
|
-
*/
|
|
1943
|
-
testID?: string;
|
|
1944
|
-
|
|
1945
1940
|
/**
|
|
1946
1941
|
* The ideal position of the tooltip.
|
|
1947
1942
|
*/
|
|
@@ -1981,7 +1976,8 @@ export interface InfoTooltipButtonProps {
|
|
|
1981
1976
|
size?: IconSize;
|
|
1982
1977
|
}
|
|
1983
1978
|
|
|
1984
|
-
export interface ModalProps {
|
|
1979
|
+
export interface ModalProps extends WithTestID {
|
|
1980
|
+
testIDs?: ModalTestIDs;
|
|
1985
1981
|
/**
|
|
1986
1982
|
* The content of the modal.
|
|
1987
1983
|
*/
|
|
@@ -2049,7 +2045,7 @@ export interface NumberPickerActionSheetProps {
|
|
|
2049
2045
|
actionSheetRef: React.RefObject<any>;
|
|
2050
2046
|
}
|
|
2051
2047
|
|
|
2052
|
-
export interface PageProps {
|
|
2048
|
+
export interface PageProps extends WithTestID {
|
|
2053
2049
|
// biome-ignore lint/suspicious/noExplicitAny: React Navigation type varies by navigation stack configuration
|
|
2054
2050
|
navigation?: any;
|
|
2055
2051
|
scroll?: boolean;
|
|
@@ -2124,7 +2120,7 @@ export interface SideDrawerProps {
|
|
|
2124
2120
|
drawerStyles?: StyleProp<ViewStyle>;
|
|
2125
2121
|
}
|
|
2126
2122
|
|
|
2127
|
-
export interface SpinnerProps {
|
|
2123
|
+
export interface SpinnerProps extends WithTestID {
|
|
2128
2124
|
size?: "sm" | "md";
|
|
2129
2125
|
color?: "light" | "dark" | "accent" | "secondary";
|
|
2130
2126
|
}
|
|
@@ -2200,7 +2196,7 @@ export interface TableProps {
|
|
|
2200
2196
|
extraControls?: React.ReactElement;
|
|
2201
2197
|
}
|
|
2202
2198
|
|
|
2203
|
-
export interface PaginationProps {
|
|
2199
|
+
export interface PaginationProps extends WithTestID {
|
|
2204
2200
|
page: number;
|
|
2205
2201
|
setPage: (page: number) => void;
|
|
2206
2202
|
totalPages: number;
|
|
@@ -2228,7 +2224,8 @@ export interface DataTableColumn {
|
|
|
2228
2224
|
infoModalText?: string;
|
|
2229
2225
|
}
|
|
2230
2226
|
|
|
2231
|
-
export interface DataTableProps {
|
|
2227
|
+
export interface DataTableProps extends WithTestID {
|
|
2228
|
+
testIDs?: DataTableTestIDs;
|
|
2232
2229
|
data: DataTableCellData[][];
|
|
2233
2230
|
columns: DataTableColumn[];
|
|
2234
2231
|
alternateRowBackground?: boolean;
|
|
@@ -2255,6 +2252,10 @@ export interface DataTableProps {
|
|
|
2255
2252
|
moreContentExtraData?: Record<string, unknown>[];
|
|
2256
2253
|
// Allows handling of custom column types.
|
|
2257
2254
|
customColumnComponentMap?: DataTableCustomComponentMap;
|
|
2255
|
+
/**
|
|
2256
|
+
* Returns a stable key for row test ids. Defaults to row index when omitted.
|
|
2257
|
+
*/
|
|
2258
|
+
getRowTestID?: (row: DataTableCellData[], rowIndex: number) => string | number;
|
|
2258
2259
|
}
|
|
2259
2260
|
|
|
2260
2261
|
export interface DataTableCellProps {
|
|
@@ -2361,7 +2362,7 @@ export interface TableContextProviderProps extends TableContextType {
|
|
|
2361
2362
|
children: React.ReactNode;
|
|
2362
2363
|
}
|
|
2363
2364
|
|
|
2364
|
-
export interface TextProps {
|
|
2365
|
+
export interface TextProps extends WithTestID {
|
|
2365
2366
|
align?: "left" | "right" | "center" | "justify"; // default "left"
|
|
2366
2367
|
children?: React.ReactNode;
|
|
2367
2368
|
bold?: boolean; // default false
|
|
@@ -2372,7 +2373,6 @@ export interface TextProps {
|
|
|
2372
2373
|
underline?: boolean;
|
|
2373
2374
|
numberOfLines?: number;
|
|
2374
2375
|
skipLinking?: boolean;
|
|
2375
|
-
testID?: string;
|
|
2376
2376
|
}
|
|
2377
2377
|
|
|
2378
2378
|
export interface TextFieldPickerActionSheetProps {
|
|
@@ -2654,7 +2654,8 @@ export interface ModelAdminCustomComponentProps extends Omit<FieldProps, "name">
|
|
|
2654
2654
|
editing: boolean; // Allow for inline editing of the field.
|
|
2655
2655
|
}
|
|
2656
2656
|
|
|
2657
|
-
export interface MultiselectFieldProps extends HelperTextProps, ErrorTextProps {
|
|
2657
|
+
export interface MultiselectFieldProps extends WithTestID, HelperTextProps, ErrorTextProps {
|
|
2658
|
+
testIDs?: FieldTestIDs;
|
|
2658
2659
|
/**
|
|
2659
2660
|
* The available options for the multiselect field.
|
|
2660
2661
|
*/
|
|
@@ -2775,7 +2776,8 @@ export interface FieldOption {
|
|
|
2775
2776
|
}
|
|
2776
2777
|
|
|
2777
2778
|
// Split up SelectField so if value is passed as a string,
|
|
2778
|
-
export interface SelectFieldPropsBase {
|
|
2779
|
+
export interface SelectFieldPropsBase extends WithTestID {
|
|
2780
|
+
testIDs?: FieldTestIDs;
|
|
2779
2781
|
/**
|
|
2780
2782
|
* If true, the select field will be disabled.
|
|
2781
2783
|
* @default false
|