@jobber/components-native 0.51.5 → 0.51.6-JOB-88274.7

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.
@@ -25,6 +25,7 @@ export declare const commonInputStyles: {
25
25
  width: string;
26
26
  borderColor: string;
27
27
  borderStyle: "solid";
28
- borderBottomWidth: number;
28
+ borderWidth: number;
29
+ paddingLeft: number;
29
30
  };
30
31
  };
@@ -8,7 +8,8 @@ export declare const styles: {
8
8
  width: string;
9
9
  borderColor: string;
10
10
  borderStyle: "solid";
11
- borderBottomWidth: number;
11
+ borderWidth: number;
12
+ paddingLeft: number;
12
13
  };
13
14
  inputContainer: {
14
15
  flexDirection: "row";
@@ -64,10 +65,12 @@ export declare const styles: {
64
65
  };
65
66
  suffixIcon: {
66
67
  justifyContent: "center";
68
+ paddingRight: number;
67
69
  };
68
70
  suffixLabel: {
69
71
  justifyContent: "center";
70
72
  paddingTop: number;
73
+ paddingRight: number;
71
74
  };
72
75
  suffixIconMargin: {
73
76
  marginLeft: number;
@@ -16,6 +16,10 @@ export interface InputPressableProps {
16
16
  * Disables input selection
17
17
  */
18
18
  readonly disabled?: boolean;
19
+ /**
20
+ * Indicates if the input is focused
21
+ */
22
+ readonly focused?: boolean;
19
23
  /**
20
24
  * Indicates if there is an validation error
21
25
  */
@@ -67,4 +71,4 @@ export interface InputPressableProps {
67
71
  }
68
72
  export type InputPressableRef = NativeText;
69
73
  export declare const InputPressable: React.ForwardRefExoticComponent<InputPressableProps & React.RefAttributes<NativeText>>;
70
- export declare function InputPressableInternal({ value, placeholder, disabled, invalid, error, onPress, accessibilityLabel, accessibilityHint, prefix, suffix, clearable, onClear, }: InputPressableProps, ref: Ref<InputPressableRef>): JSX.Element;
74
+ export declare function InputPressableInternal({ value, placeholder, disabled, invalid, error, onPress, accessibilityLabel, accessibilityHint, prefix, suffix, clearable, onClear, focused, }: InputPressableProps, ref: Ref<InputPressableRef>): JSX.Element;
@@ -1,6 +1,5 @@
1
1
  export declare const styles: {
2
2
  container: {
3
3
  width: string;
4
- paddingHorizontal: number;
5
4
  };
6
5
  };
@@ -8,11 +8,14 @@ export declare const styles: {
8
8
  width: string;
9
9
  borderColor: string;
10
10
  borderStyle: "solid";
11
- borderBottomWidth: number;
11
+ borderWidth: number;
12
+ paddingLeft: number;
12
13
  } | {
13
14
  flexDirection: "column";
14
15
  justifyContent: "flex-end";
15
16
  minHeight: number;
17
+ marginVertical: number;
18
+ borderWidth: number;
16
19
  };
17
20
  input: {
18
21
  width: string;
@@ -30,6 +33,7 @@ export declare const styles: {
30
33
  paddingBottom: number;
31
34
  minHeight: number;
32
35
  minWidth: string;
36
+ paddingRight: number;
33
37
  };
34
38
  value: {
35
39
  flexGrow: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.51.5",
3
+ "version": "0.51.6-JOB-88274.7+b7b85ba2",
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": "3caaa43e03388b7d034d0606dc803218394929c2"
87
+ "gitHead": "b7b85ba202558ffdcb7ecad60cdd1104575e81d3"
88
88
  }
@@ -174,6 +174,7 @@ function InternalInputDate({
174
174
  return (
175
175
  <>
176
176
  <InputPressable
177
+ focused={showPicker}
177
178
  clearable={canClearDate}
178
179
  disabled={disabled}
179
180
  invalid={invalid}
@@ -30,8 +30,9 @@ export const commonInputStyles = StyleSheet.create({
30
30
  flexDirection: "row",
31
31
  justifyContent: "space-between",
32
32
  width: "100%",
33
- borderColor: tokens["color-grey"],
33
+ borderColor: tokens["color-border"],
34
34
  borderStyle: "solid",
35
- borderBottomWidth: tokens["border-base"],
35
+ borderWidth: tokens["border-base"],
36
+ paddingLeft: tokens["space-base"],
36
37
  },
37
38
  });
@@ -74,11 +74,13 @@ export const styles = StyleSheet.create({
74
74
 
75
75
  suffixIcon: {
76
76
  justifyContent: "center",
77
+ paddingRight: tokens["space-small"],
77
78
  },
78
79
 
79
80
  suffixLabel: {
80
81
  justifyContent: "center",
81
82
  paddingTop: tokens["space-minuscule"],
83
+ paddingRight: tokens["space-small"],
82
84
  },
83
85
  suffixIconMargin: {
84
86
  marginLeft: tokens["space-small"] + tokens["space-smaller"],
@@ -192,9 +192,7 @@ describe("InputFieldWrapper", () => {
192
192
  includeHiddenElements: true,
193
193
  });
194
194
 
195
- expect(placeholder.props.style).toContainEqual(
196
- typographyStyles.interactive,
197
- );
195
+ expect(placeholder.props.style).toContainEqual(typographyStyles.subdued);
198
196
  expect(placeholder.props.style).toContainEqual(
199
197
  typographyStyles.defaultSize,
200
198
  );
@@ -146,12 +146,7 @@ export function InputFieldWrapper({
146
146
  >
147
147
  <Placeholder
148
148
  placeholder={placeholder}
149
- labelVariation={getLabelVariation(
150
- error,
151
- invalid,
152
- focused,
153
- disabled,
154
- )}
149
+ labelVariation={getLabelVariation(error, invalid, disabled)}
155
150
  hasMiniLabel={hasMiniLabel}
156
151
  styleOverride={styleOverride?.placeholderText}
157
152
  />
@@ -218,15 +213,12 @@ export function InputFieldWrapper({
218
213
  function getLabelVariation(
219
214
  error?: FieldError,
220
215
  invalid?: boolean | string,
221
- focused?: boolean,
222
216
  disabled?: boolean,
223
217
  ): TextVariation {
224
218
  if (invalid || error) {
225
219
  return "error";
226
220
  } else if (disabled) {
227
221
  return "disabled";
228
- } else if (focused) {
229
- return "interactive";
230
222
  }
231
223
 
232
224
  return "subdued";
@@ -22,6 +22,11 @@ export interface InputPressableProps {
22
22
  */
23
23
  readonly disabled?: boolean;
24
24
 
25
+ /**
26
+ * Indicates if the input is focused
27
+ */
28
+ readonly focused?: boolean;
29
+
25
30
  /**
26
31
  * Indicates if there is an validation error
27
32
  */
@@ -95,6 +100,7 @@ export function InputPressableInternal(
95
100
  suffix,
96
101
  clearable = "never",
97
102
  onClear,
103
+ focused,
98
104
  }: InputPressableProps,
99
105
  ref: Ref<InputPressableRef>,
100
106
  ): JSX.Element {
@@ -119,7 +125,7 @@ export function InputPressableInternal(
119
125
  suffix={suffix}
120
126
  hasValue={hasValue}
121
127
  hasMiniLabel={hasMiniLabel}
122
- focused={false}
128
+ focused={focused}
123
129
  error={error}
124
130
  invalid={invalid}
125
131
  placeholder={placeholder}
@@ -1,9 +1,7 @@
1
1
  import { StyleSheet } from "react-native";
2
- import { tokens } from "../utils/design";
3
2
 
4
3
  export const styles = StyleSheet.create({
5
4
  container: {
6
5
  width: "100%",
7
- paddingHorizontal: tokens["space-base"],
8
6
  },
9
7
  });
@@ -159,6 +159,7 @@ function InternalInputTime({
159
159
  clearable={canClearTime}
160
160
  disabled={disabled}
161
161
  invalid={invalid}
162
+ focused={showPicker}
162
163
  placeholder={placeholder ?? t("time")}
163
164
  prefix={showIcon ? { icon: "timer" } : undefined}
164
165
  value={formattedTime}
@@ -9,6 +9,8 @@ export const styles = StyleSheet.create({
9
9
  flexDirection: "column",
10
10
  justifyContent: "flex-end",
11
11
  minHeight: tokens["space-largest"] + tokens["border-base"],
12
+ marginVertical: 0,
13
+ borderWidth: 0,
12
14
  },
13
15
  ]),
14
16
 
@@ -20,6 +22,7 @@ export const styles = StyleSheet.create({
20
22
  paddingBottom: tokens["space-smaller"],
21
23
  minHeight: 0,
22
24
  minWidth: "100%",
25
+ paddingRight: tokens["space-small"],
23
26
  },
24
27
  ]),
25
28
 
@@ -131,7 +131,7 @@ export function Select({
131
131
  invalid={invalid || !!error}
132
132
  hasValue={hasValue}
133
133
  styleOverride={{
134
- container: { borderBottomWidth: undefined },
134
+ container: { paddingLeft: undefined },
135
135
  }}
136
136
  >
137
137
  <View