@jobber/components-native 0.58.3 → 0.59.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/dist/package.json +2 -2
- package/dist/src/InputFieldWrapper/InputFieldWrapper.js +3 -2
- package/dist/src/InputFieldWrapper/InputFieldWrapper.style.js +11 -1
- package/dist/src/InputText/InputText.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/InputFieldWrapper/InputFieldWrapper.d.ts +5 -1
- package/dist/types/src/InputFieldWrapper/InputFieldWrapper.style.d.ts +7 -0
- package/dist/types/src/InputText/InputText.d.ts +2 -2
- package/package.json +2 -2
- package/src/InputFieldWrapper/InputFieldWrapper.style.ts +15 -1
- package/src/InputFieldWrapper/InputFieldWrapper.test.tsx +35 -0
- package/src/InputFieldWrapper/InputFieldWrapper.tsx +8 -0
- package/src/InputText/InputText.tsx +8 -2
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.0",
|
|
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.0.0 || ^3.0.0",
|
|
85
85
|
"react-native-safe-area-context": "^4.5.2"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "a4e892a00816d674e54a986b16a3a25b87c78bf4"
|
|
88
88
|
}
|
|
@@ -9,7 +9,7 @@ import { ClearAction } from "./components/ClearAction";
|
|
|
9
9
|
import { ErrorMessageWrapper } from "../ErrorMessageWrapper";
|
|
10
10
|
import { typographyStyles } from "../Typography";
|
|
11
11
|
import { Text } from "../Text";
|
|
12
|
-
export function InputFieldWrapper({ invalid, disabled, placeholder, assistiveText, prefix, suffix, hasMiniLabel = false, hasValue = false, error, focused = false, children, onClear, showClearAction = false, styleOverride, }) {
|
|
12
|
+
export function InputFieldWrapper({ invalid, disabled, placeholder, assistiveText, prefix, suffix, hasMiniLabel = false, hasValue = false, error, focused = false, children, onClear, showClearAction = false, styleOverride, toolbar, }) {
|
|
13
13
|
fieldAffixRequiredPropsCheck([prefix, suffix]);
|
|
14
14
|
const handleClear = onClear !== null && onClear !== void 0 ? onClear : noopClear;
|
|
15
15
|
warnIfClearActionWithNoOnClear(onClear, showClearAction);
|
|
@@ -38,7 +38,8 @@ export function InputFieldWrapper({ invalid, disabled, placeholder, assistiveTex
|
|
|
38
38
|
(showClearAction || (suffix === null || suffix === void 0 ? void 0 : suffix.label) || (suffix === null || suffix === void 0 ? void 0 : suffix.icon)) && (React.createElement(View, { style: styles.inputEndContainer },
|
|
39
39
|
showClearAction && (React.createElement(ClearAction, { hasMarginRight: !!(suffix === null || suffix === void 0 ? void 0 : suffix.icon) || !!(suffix === null || suffix === void 0 ? void 0 : suffix.label), onPress: handleClear })),
|
|
40
40
|
(suffix === null || suffix === void 0 ? void 0 : suffix.label) && hasValue && (React.createElement(SuffixLabel, { disabled: disabled, focused: focused, hasMiniLabel: hasMiniLabel, inputInvalid: inputInvalid, label: suffix.label, hasLeftMargin: !showClearAction, styleOverride: styleOverride === null || styleOverride === void 0 ? void 0 : styleOverride.suffixLabel })),
|
|
41
|
-
(suffix === null || suffix === void 0 ? void 0 : suffix.icon) && (React.createElement(SuffixIcon, { disabled: disabled, focused: focused, hasMiniLabel: hasMiniLabel, hasLeftMargin: !!(!showClearAction || (suffix === null || suffix === void 0 ? void 0 : suffix.label)), inputInvalid: inputInvalid, icon: suffix.icon, onPress: suffix.onPress })))))
|
|
41
|
+
(suffix === null || suffix === void 0 ? void 0 : suffix.icon) && (React.createElement(SuffixIcon, { disabled: disabled, focused: focused, hasMiniLabel: hasMiniLabel, hasLeftMargin: !!(!showClearAction || (suffix === null || suffix === void 0 ? void 0 : suffix.label)), inputInvalid: inputInvalid, icon: suffix.icon, onPress: suffix.onPress }))))),
|
|
42
|
+
toolbar && focused && React.createElement(View, { style: styles.toolbar }, toolbar)),
|
|
42
43
|
assistiveText && !error && !invalid && (React.createElement(Text, { level: "textSupporting", variation: disabled ? "disabled" : focused ? "interactive" : "subdued" }, assistiveText))));
|
|
43
44
|
}
|
|
44
45
|
function getLabelVariation(error, invalid, disabled) {
|
|
@@ -3,7 +3,12 @@ import { commonInputStyles } from "./CommonInputStyles.style";
|
|
|
3
3
|
import { tokens } from "../utils/design";
|
|
4
4
|
import { typographyStyles } from "../Typography";
|
|
5
5
|
export const styles = StyleSheet.create({
|
|
6
|
-
container: StyleSheet.flatten([
|
|
6
|
+
container: StyleSheet.flatten([
|
|
7
|
+
commonInputStyles.container,
|
|
8
|
+
{
|
|
9
|
+
flexDirection: "column",
|
|
10
|
+
},
|
|
11
|
+
]),
|
|
7
12
|
inputContainer: {
|
|
8
13
|
flexDirection: "row",
|
|
9
14
|
flex: 1,
|
|
@@ -79,4 +84,9 @@ export const styles = StyleSheet.create({
|
|
|
79
84
|
flexDirection: "row",
|
|
80
85
|
zIndex: 1,
|
|
81
86
|
},
|
|
87
|
+
toolbar: {
|
|
88
|
+
flexDirection: "row",
|
|
89
|
+
gap: tokens["space-small"],
|
|
90
|
+
paddingBottom: tokens["space-small"],
|
|
91
|
+
},
|
|
82
92
|
});
|
|
@@ -9,7 +9,7 @@ import { InputFieldWrapper } from "../InputFieldWrapper";
|
|
|
9
9
|
import { commonInputStyles } from "../InputFieldWrapper/CommonInputStyles.style";
|
|
10
10
|
export const InputText = forwardRef(InputTextInternal);
|
|
11
11
|
// eslint-disable-next-line max-statements
|
|
12
|
-
function InputTextInternal({ invalid, disabled, name, placeholder, assistiveText, keyboard, value: controlledValue, defaultValue, autoFocus, autoComplete = "off", spellCheck, textContentType = "none", validations, onChangeText, onSubmitEditing, onFocus, accessibilityLabel, accessibilityHint, autoCorrect, autoCapitalize, onBlur, multiline = false, prefix, suffix, transform = {}, clearable = multiline ? "never" : "while-editing", testID, secureTextEntry, styleOverride, }, ref) {
|
|
12
|
+
function InputTextInternal({ invalid, disabled, name, placeholder, assistiveText, keyboard, value: controlledValue, defaultValue, autoFocus, autoComplete = "off", spellCheck, textContentType = "none", validations, onChangeText, onSubmitEditing, onFocus, accessibilityLabel, accessibilityHint, autoCorrect, autoCapitalize, onBlur, multiline = false, prefix, suffix, transform = {}, clearable = multiline ? "never" : "while-editing", testID, secureTextEntry, styleOverride, toolbar, }, ref) {
|
|
13
13
|
var _a;
|
|
14
14
|
const isAndroid = Platform.OS === "android";
|
|
15
15
|
const isIOS = Platform.OS === "ios";
|
|
@@ -72,7 +72,7 @@ function InputTextInternal({ invalid, disabled, name, placeholder, assistiveText
|
|
|
72
72
|
}
|
|
73
73
|
onFocusNext();
|
|
74
74
|
}
|
|
75
|
-
return (React.createElement(InputFieldWrapper, { prefix: prefix, suffix: suffix, hasValue: hasValue, hasMiniLabel: hasMiniLabel, assistiveText: assistiveText, focused: focused, error: error, invalid: invalid, placeholder: placeholder, disabled: disabled, onClear: handleClear, showClearAction: showClear, styleOverride: styleOverride },
|
|
75
|
+
return (React.createElement(InputFieldWrapper, { prefix: prefix, suffix: suffix, hasValue: hasValue, hasMiniLabel: hasMiniLabel, assistiveText: assistiveText, focused: focused, error: error, invalid: invalid, placeholder: placeholder, disabled: disabled, onClear: handleClear, showClearAction: showClear, styleOverride: styleOverride, toolbar: toolbar },
|
|
76
76
|
React.createElement(TextInput, Object.assign({ inputAccessoryViewID: inputAccessoryID || undefined, testID: testID, autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, spellCheck: spellCheck, style: [
|
|
77
77
|
commonInputStyles.input,
|
|
78
78
|
styles.inputPaddingTop,
|