@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.
@@ -2,7 +2,8 @@ import type { UseControllerProps } from "react-hook-form";
2
2
  import type { XOR } from "ts-xor";
3
3
  import type { Clearable } from "@jobber/hooks";
4
4
  import type { InputFieldWrapperProps } from "../InputFieldWrapper";
5
- interface BaseInputDateProps extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder"> {
5
+ import type { InputPressableProps } from "../InputPressable/InputPressable";
6
+ interface BaseInputDateProps extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder">, Pick<InputPressableProps, "showMiniLabel"> {
6
7
  /**
7
8
  * Defaulted to "always" so user can clear the dates whenever there's a value.
8
9
  */
@@ -15,4 +15,7 @@ export declare const useStyles: () => {
15
15
  inputInvalid: {
16
16
  borderColor: string;
17
17
  };
18
+ withoutMiniLabel: {
19
+ paddingTop: number;
20
+ };
18
21
  };
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import type { InputTextProps, InputTextRef } from "../InputText";
3
3
  export declare const InputSearch: React.ForwardRefExoticComponent<InputSearchProps & React.RefAttributes<InputTextRef>>;
4
- export interface InputSearchProps extends Pick<InputTextProps, "accessibilityHint" | "accessibilityLabel" | "autoFocus" | "placeholder" | "prefix"> {
4
+ export interface InputSearchProps extends Pick<InputTextProps, "accessibilityHint" | "accessibilityLabel" | "autoFocus" | "placeholder" | "prefix" | "showMiniLabel"> {
5
5
  /**
6
6
  * A callback function that handles the update of the new value of the property value.
7
7
  */
@@ -2,7 +2,8 @@ import type { UseControllerProps } from "react-hook-form";
2
2
  import type { XOR } from "ts-xor";
3
3
  import type { Clearable } from "@jobber/hooks";
4
4
  import type { InputFieldWrapperProps } from "../InputFieldWrapper";
5
- interface InputTimeBaseProps extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder"> {
5
+ import type { InputPressableProps } from "../InputPressable/InputPressable";
6
+ interface InputTimeBaseProps extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder">, Pick<InputPressableProps, "showMiniLabel"> {
6
7
  /**
7
8
  * Defaulted to "always" so user can clear the time whenever there's a value.
8
9
  */
package/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
  }
@@ -8,9 +8,11 @@ import type { InputFieldWrapperProps } from "../InputFieldWrapper";
8
8
  import { FormField } from "../FormField";
9
9
  import { InputPressable } from "../InputPressable";
10
10
  import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
11
+ import type { InputPressableProps } from "../InputPressable/InputPressable";
11
12
 
12
13
  interface BaseInputDateProps
13
- extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder"> {
14
+ extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder">,
15
+ Pick<InputPressableProps, "showMiniLabel"> {
14
16
  /**
15
17
  * Defaulted to "always" so user can clear the dates whenever there's a value.
16
18
  */
@@ -145,6 +147,7 @@ function InternalInputDate({
145
147
  minDate,
146
148
  placeholder,
147
149
  value,
150
+ showMiniLabel = true,
148
151
  name,
149
152
  onChange,
150
153
  accessibilityLabel,
@@ -174,6 +177,7 @@ function InternalInputDate({
174
177
  return (
175
178
  <>
176
179
  <InputPressable
180
+ showMiniLabel={showMiniLabel}
177
181
  focused={showPicker}
178
182
  clearable={canClearDate}
179
183
  disabled={disabled}
@@ -28,5 +28,9 @@ export const useStyles = buildThemedStyles(tokens => {
28
28
  inputInvalid: {
29
29
  borderColor: tokens["color-critical"],
30
30
  },
31
+
32
+ withoutMiniLabel: {
33
+ paddingTop: tokens["space-base"] + tokens["space-smallest"],
34
+ },
31
35
  };
32
36
  });
@@ -130,7 +130,6 @@ export function InputPressableInternal(
130
130
  const hasValue = !!value;
131
131
 
132
132
  const placeholderMode = getPlaceholderMode(showMiniLabel, value);
133
- const miniLabelActive = placeholderMode === "mini";
134
133
 
135
134
  const showClear = useShowClear({
136
135
  clearable,
@@ -169,7 +168,8 @@ export function InputPressableInternal(
169
168
  style={[
170
169
  commonInputStyles.input,
171
170
  styles.inputPressableStyles,
172
- !miniLabelActive && commonInputStyles.inputEmpty,
171
+ placeholderMode === "normal" && commonInputStyles.inputEmpty,
172
+ placeholderMode === "hidden" && styles.withoutMiniLabel,
173
173
  disabled && commonInputStyles.inputDisabled,
174
174
  (Boolean(invalid) || error) && styles.inputInvalid,
175
175
  ]}
@@ -16,6 +16,7 @@ export interface InputSearchProps
16
16
  | "autoFocus"
17
17
  | "placeholder"
18
18
  | "prefix"
19
+ | "showMiniLabel"
19
20
  > {
20
21
  /**
21
22
  * A callback function that handles the update of the new value of the property value.
@@ -11,9 +11,11 @@ import { InputPressable } from "../InputPressable";
11
11
  import { FormField } from "../FormField";
12
12
  import type { InputFieldWrapperProps } from "../InputFieldWrapper";
13
13
  import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
14
+ import type { InputPressableProps } from "../InputPressable/InputPressable";
14
15
 
15
16
  interface InputTimeBaseProps
16
- extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder"> {
17
+ extends Pick<InputFieldWrapperProps, "invalid" | "disabled" | "placeholder">,
18
+ Pick<InputPressableProps, "showMiniLabel"> {
17
19
  /**
18
20
  * Defaulted to "always" so user can clear the time whenever there's a value.
19
21
  */
@@ -129,6 +131,7 @@ function InternalInputTime({
129
131
  value,
130
132
  name,
131
133
  type = "scheduling",
134
+ showMiniLabel = true,
132
135
  onChange,
133
136
  showIcon = true,
134
137
  }: InputTimeProps): JSX.Element {
@@ -156,6 +159,7 @@ function InternalInputTime({
156
159
  return (
157
160
  <View style={styles.container}>
158
161
  <InputPressable
162
+ showMiniLabel={showMiniLabel}
159
163
  clearable={canClearTime}
160
164
  disabled={disabled}
161
165
  invalid={invalid}