@jobber/components-native 0.90.1-JOB-140976-20bb6ae.11 → 0.90.1-JOB-140976-676a3bc.17

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.90.1-JOB-140976-20bb6ae.11+20bb6ae6a",
3
+ "version": "0.90.1-JOB-140976-676a3bc.17+676a3bc2e",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -94,5 +94,5 @@
94
94
  "react-native-safe-area-context": "^5.4.0",
95
95
  "react-native-svg": ">=12.0.0"
96
96
  },
97
- "gitHead": "20bb6ae6a51997e8306d4f4ddf12295b33ca16be"
97
+ "gitHead": "676a3bc2eb3879aa5fda68db6121d30c9bf4828f"
98
98
  }
@@ -27,7 +27,7 @@ export function InputDate(props) {
27
27
  }
28
28
  return React.createElement(InternalInputDate, Object.assign({}, props));
29
29
  }
30
- function InternalInputDate({ clearable = "always", disabled, emptyValueLabel, invalid, maxDate, minDate, placeholder, value, name, onChange, accessibilityLabel, accessibilityHint, }) {
30
+ function InternalInputDate({ clearable = "always", disabled, emptyValueLabel, invalid, maxDate, minDate, placeholder, value, showMiniLabel = true, name, onChange, accessibilityLabel, accessibilityHint, }) {
31
31
  const [showPicker, setShowPicker] = useState(false);
32
32
  const { t, locale, formatDate } = useAtlantisI18n();
33
33
  const date = useMemo(() => {
@@ -44,7 +44,7 @@ function InternalInputDate({ clearable = "always", disabled, emptyValueLabel, in
44
44
  const canClearDate = formattedDate === emptyValueLabel ? "never" : clearable;
45
45
  const placeholderLabel = placeholder !== null && placeholder !== void 0 ? placeholder : t("date");
46
46
  return (React.createElement(React.Fragment, null,
47
- React.createElement(InputPressable, { focused: showPicker, clearable: canClearDate, disabled: disabled, invalid: invalid, placeholder: placeholderLabel, prefix: { icon: "calendar" }, value: formattedDate, onClear: handleClear, onPress: showDatePicker, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint }),
47
+ React.createElement(InputPressable, { showMiniLabel: showMiniLabel, focused: showPicker, clearable: canClearDate, disabled: disabled, invalid: invalid, placeholder: placeholderLabel, prefix: { icon: "calendar" }, value: formattedDate, onClear: handleClear, onPress: showDatePicker, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint }),
48
48
  React.createElement(DateTimePicker, { testID: "inputDate-datePicker", date: date || undefined, display: display, isVisible: showPicker, maximumDate: maxDate, minimumDate: minDate, mode: "date", confirmTextIOS: t("confirm"), cancelTextIOS: t("cancel"), locale: locale, onCancel: handleCancel, onConfirm: handleConfirm })));
49
49
  function showDatePicker() {
50
50
  Keyboard.dismiss();
@@ -7,7 +7,6 @@ export const InputPressable = forwardRef(InputPressableInternal);
7
7
  export function InputPressableInternal({ value, placeholder, disabled, invalid, error, showMiniLabel = true, onPress, accessibilityLabel, accessibilityHint, prefix, suffix, clearable = "never", onClear, focused, }, ref) {
8
8
  const hasValue = !!value;
9
9
  const placeholderMode = getPlaceholderMode(showMiniLabel, value);
10
- const miniLabelActive = placeholderMode === "mini";
11
10
  const showClear = useShowClear({
12
11
  clearable,
13
12
  multiline: false,
@@ -22,7 +21,8 @@ export function InputPressableInternal({ value, placeholder, disabled, invalid,
22
21
  React.createElement(NativeText, { style: [
23
22
  commonInputStyles.input,
24
23
  styles.inputPressableStyles,
25
- !miniLabelActive && commonInputStyles.inputEmpty,
24
+ placeholderMode === "normal" && commonInputStyles.inputEmpty,
25
+ placeholderMode === "hidden" && styles.withoutMiniLabel,
26
26
  disabled && commonInputStyles.inputDisabled,
27
27
  (Boolean(invalid) || error) && styles.inputInvalid,
28
28
  ], testID: "inputPressableText", ref: ref, accessibilityRole: "none", accessible: false, importantForAccessibility: "no-hide-descendants" }, value))));
@@ -21,5 +21,8 @@ export const useStyles = buildThemedStyles(tokens => {
21
21
  inputInvalid: {
22
22
  borderColor: tokens["color-critical"],
23
23
  },
24
+ withoutMiniLabel: {
25
+ paddingTop: tokens["space-base"] + tokens["space-smallest"],
26
+ },
24
27
  };
25
28
  });
@@ -28,7 +28,7 @@ export function InputTime(props) {
28
28
  }
29
29
  return React.createElement(InternalInputTime, Object.assign({}, props));
30
30
  }
31
- function InternalInputTime({ clearable = "always", disabled, emptyValueLabel, invalid, placeholder, value, name, type = "scheduling", onChange, showIcon = true, }) {
31
+ function InternalInputTime({ clearable = "always", disabled, emptyValueLabel, invalid, placeholder, value, name, type = "scheduling", showMiniLabel = true, onChange, showIcon = true, }) {
32
32
  const [showPicker, setShowPicker] = useState(false);
33
33
  const { t, formatTime } = useAtlantisI18n();
34
34
  const { timeZone, timeFormat } = useAtlantisContext();
@@ -42,7 +42,7 @@ function InternalInputTime({ clearable = "always", disabled, emptyValueLabel, in
42
42
  }, [dateTime, emptyValueLabel]);
43
43
  const canClearTime = formattedTime === emptyValueLabel ? "never" : clearable;
44
44
  return (React.createElement(View, { style: styles.container },
45
- React.createElement(InputPressable, { clearable: canClearTime, disabled: disabled, invalid: invalid, focused: showPicker, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t("time"), prefix: showIcon ? { icon: "timer" } : undefined, value: formattedTime, onClear: handleClear, onPress: showDatePicker }),
45
+ React.createElement(InputPressable, { showMiniLabel: showMiniLabel, clearable: canClearTime, disabled: disabled, invalid: invalid, focused: showPicker, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t("time"), prefix: showIcon ? { icon: "timer" } : undefined, value: formattedTime, onClear: handleClear, onPress: showDatePicker }),
46
46
  React.createElement(DateTimePicker, { testID: "inputTime-Picker", minuteInterval: getMinuteInterval(type), date: getInitialPickerDate(dateTime), timeZoneOffsetInMinutes: getTimeZoneOffsetInMinutes(timeZone, dateTime), isVisible: showPicker, mode: "time", onCancel: handleCancel, onConfirm: handleConfirm, is24Hour: is24Hour, locale: is24Hour ? LOCALE_24_HOURS : LOCALE_12_HOURS })));
47
47
  function showDatePicker() {
48
48
  Keyboard.dismiss();