@jobber/components-native 0.47.3 → 0.48.1
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/dist/package.json +2 -2
- package/dist/src/Select/Select.js +8 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/Select/Select.d.ts +5 -1
- package/package.json +2 -2
- package/src/AtlantisContext/AtlantisContext.test.tsx +1 -3
- package/src/Button/components/InternalButtonLoading/InternalButtonLoading.test.tsx +1 -3
- package/src/Checkbox/CheckboxGroup.test.tsx +3 -5
- package/src/Divider/Divider.test.tsx +1 -3
- package/src/Form/components/FormErrorBanner/FormErrorBanner.test.tsx +3 -4
- package/src/InputSearch/InputSearch.test.tsx +1 -7
- package/src/InputTime/InputTime.test.tsx +2 -7
- package/src/Select/Select.test.tsx +141 -173
- package/src/Select/Select.tsx +18 -1
- package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.test.tsx +2 -2
- package/src/Select/components/SelectInternalPicker/SelectInternalPicker.test.tsx +1 -2
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"react-native-reanimated": "^2.17.0",
|
|
85
85
|
"react-native-safe-area-context": "^4.5.2"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "d8214fde2dedb50cebe48fe7967019660a1933bd"
|
|
88
88
|
}
|
|
@@ -7,7 +7,7 @@ import { Icon } from "../Icon";
|
|
|
7
7
|
import { Text } from "../Text";
|
|
8
8
|
import { useFormController } from "../hooks";
|
|
9
9
|
import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
|
|
10
|
-
export function Select({ value, defaultValue, onChange, children, placeholder, label, assistiveText, disabled, invalid, validations, accessibilityLabel, name, }) {
|
|
10
|
+
export function Select({ value, defaultValue, onChange, children, placeholder, label, assistiveText, disabled, invalid, validations, accessibilityLabel, name, testID, }) {
|
|
11
11
|
const { field, error } = useFormController({
|
|
12
12
|
name,
|
|
13
13
|
validations,
|
|
@@ -24,7 +24,7 @@ export function Select({ value, defaultValue, onChange, children, placeholder, l
|
|
|
24
24
|
return (React.createElement(InputFieldWrapper, { error: error, invalid: invalid || !!error, hasValue: hasValue, styleOverride: {
|
|
25
25
|
container: { borderBottomWidth: undefined },
|
|
26
26
|
} },
|
|
27
|
-
React.createElement(View, { testID:
|
|
27
|
+
React.createElement(View, { testID: getTestID(testID), accessible: true, accessibilityLabel: getA11yLabel(), accessibilityValue: { text: getValue() }, accessibilityHint: t("Select.a11yHint"), accessibilityRole: "button", accessibilityState: { disabled: disabled } },
|
|
28
28
|
React.createElement(SelectInternalPicker, { disabled: disabled, options: getOptions(), onChange: handleChange },
|
|
29
29
|
React.createElement(View, { style: [styles.container, (invalid || !!error) && styles.invalid] },
|
|
30
30
|
label && (React.createElement(Text, { level: "textSupporting", variation: textVariation, hideFromScreenReader: true }, label)),
|
|
@@ -73,6 +73,12 @@ function getTextVariation({ invalid, disabled, }) {
|
|
|
73
73
|
return "disabled";
|
|
74
74
|
return "subdued";
|
|
75
75
|
}
|
|
76
|
+
function getTestID(testID) {
|
|
77
|
+
if (testID) {
|
|
78
|
+
return `ATL-${testID}-Select`;
|
|
79
|
+
}
|
|
80
|
+
return "ATL-Select";
|
|
81
|
+
}
|
|
76
82
|
export function Option({ children }) {
|
|
77
83
|
return React.createElement(React.Fragment, null, children);
|
|
78
84
|
}
|