@jobber/components-native 0.60.0 → 0.60.1-feat-toolb.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.60.0",
3
+ "version": "0.60.1-feat-toolb.1+5b5cfb3e",
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": "5ddeb02c0553241a32a1ef03b5231894b690fa7b"
87
+ "gitHead": "5b5cfb3e70eeb0453991d46ffa10ee711c11a9e0"
88
88
  }
@@ -9,11 +9,12 @@ 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, toolbar, }) {
12
+ export function InputFieldWrapper({ invalid, disabled, placeholder, assistiveText, prefix, suffix, hasMiniLabel = false, hasValue = false, error, focused = false, children, onClear, showClearAction = false, styleOverride, toolbar, toolbarVisibility = "while-editing", }) {
13
13
  fieldAffixRequiredPropsCheck([prefix, suffix]);
14
14
  const handleClear = onClear !== null && onClear !== void 0 ? onClear : noopClear;
15
15
  warnIfClearActionWithNoOnClear(onClear, showClearAction);
16
16
  const inputInvalid = Boolean(invalid) || Boolean(error);
17
+ const isToolbarVisible = toolbar && (toolbarVisibility === "always" || focused);
17
18
  return (React.createElement(ErrorMessageWrapper, { message: getMessage({ invalid, error }) },
18
19
  React.createElement(View, { testID: "ATL-InputFieldWrapper", style: [
19
20
  styles.container,
@@ -39,7 +40,7 @@ export function InputFieldWrapper({ invalid, disabled, placeholder, assistiveTex
39
40
  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
41
  (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
42
  (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)),
43
+ isToolbarVisible && React.createElement(View, { style: styles.toolbar }, toolbar)),
43
44
  assistiveText && !error && !invalid && (React.createElement(Text, { level: "textSupporting", variation: disabled ? "disabled" : focused ? "interactive" : "subdued" }, assistiveText))));
44
45
  }
45
46
  function getLabelVariation(error, invalid, disabled) {
@@ -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, toolbar, }, 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, toolbarVisibility, }, 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, toolbar: toolbar },
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, toolbarVisibility: toolbarVisibility },
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,