@jobber/components-native 0.56.2 → 0.57.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.
Files changed (96) hide show
  1. package/dist/package.json +4 -4
  2. package/dist/src/Button/Button.js +2 -2
  3. package/dist/src/Button/Button.style.js +2 -2
  4. package/dist/src/Card/Card.js +7 -8
  5. package/dist/src/InputCurrency/InputCurrency.js +16 -17
  6. package/dist/tsconfig.tsbuildinfo +1 -1
  7. package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +1 -1
  8. package/dist/types/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +6 -6
  9. package/dist/types/src/Checkbox/CheckboxGroup.d.ts +2 -2
  10. package/dist/types/src/Form/components/FormBody/FormBody.d.ts +3 -3
  11. package/dist/types/src/Form/components/FormCache/FormCache.d.ts +4 -4
  12. package/dist/types/src/Form/components/FormMessageBanner/FormMessageBanner.d.ts +1 -1
  13. package/dist/types/src/FormField/FormField.d.ts +2 -2
  14. package/dist/types/src/FormatFile/FormatFile.d.ts +6 -6
  15. package/dist/types/src/FormatFile/components/FileView/FileView.d.ts +6 -6
  16. package/dist/types/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +4 -4
  17. package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +6 -6
  18. package/dist/types/src/FormatFile/components/ProgressBar/ProgressBar.d.ts +3 -3
  19. package/dist/types/src/InputCurrency/InputCurrency.d.ts +3 -3
  20. package/dist/types/src/InputFieldWrapper/components/Prefix/Prefix.d.ts +12 -12
  21. package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +14 -14
  22. package/dist/types/src/InputPassword/InputPassword.d.ts +1 -1
  23. package/dist/types/src/InputText/context/InputAccessoriesProvider.d.ts +1 -1
  24. package/dist/types/src/Toast/Toast.d.ts +1 -1
  25. package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +3 -3
  26. package/jestSetup.js +2 -0
  27. package/package.json +4 -4
  28. package/src/ActionItem/ActionItem.tsx +2 -0
  29. package/src/ActionItem/ActionItemGroup.tsx +1 -0
  30. package/src/AutoLink/hooks/useCreateLinkedText.ts +1 -0
  31. package/src/AutoLink/hooks/useTokenGenerator.ts +1 -0
  32. package/src/BottomSheet/BottomSheet.tsx +3 -3
  33. package/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.tsx +3 -1
  34. package/src/Button/Button.style.ts +2 -2
  35. package/src/Button/Button.test.tsx +2 -2
  36. package/src/Button/Button.tsx +2 -2
  37. package/src/Button/components/InternalButtonLoading/InternalButtonLoading.tsx +1 -0
  38. package/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.tsx +7 -6
  39. package/src/Card/Card.tsx +31 -32
  40. package/src/Card/components/InternalCardHeader.tsx +1 -0
  41. package/src/Checkbox/CheckboxGroup.tsx +12 -2
  42. package/src/Chip/Chip.tsx +2 -0
  43. package/src/Content/Content.test.tsx +1 -0
  44. package/src/Content/Content.tsx +1 -0
  45. package/src/ContentOverlay/ContentOverlay.test.tsx +1 -0
  46. package/src/Divider/Divider.tsx +1 -0
  47. package/src/EmptyState/EmptyState.tsx +2 -2
  48. package/src/Flex/Flex.styles.tsx +1 -0
  49. package/src/Flex/Flex.test.tsx +2 -0
  50. package/src/Form/Form.test.tsx +19 -14
  51. package/src/Form/components/FormBody/FormBody.tsx +4 -3
  52. package/src/Form/components/FormCache/FormCache.tsx +5 -4
  53. package/src/Form/components/FormMessage/FormMessage.tsx +1 -0
  54. package/src/Form/components/FormMessageBanner/FormMessageBanner.tsx +1 -1
  55. package/src/Form/components/FormSaveButton/FormSaveButton.test.tsx +5 -5
  56. package/src/Form/context/AtlantisFormContext.tsx +1 -0
  57. package/src/Form/hooks/useFormViewRefs.ts +1 -0
  58. package/src/Form/hooks/useOfflineHandler.ts +1 -0
  59. package/src/Form/hooks/useScrollToError/useScrollToError.ts +2 -0
  60. package/src/FormField/FormField.test.tsx +6 -8
  61. package/src/FormField/FormField.tsx +2 -2
  62. package/src/FormatFile/FormatFile.tsx +15 -14
  63. package/src/FormatFile/components/FileView/FileView.tsx +9 -6
  64. package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +4 -4
  65. package/src/FormatFile/components/MediaView/MediaView.tsx +15 -14
  66. package/src/FormatFile/components/ProgressBar/ProgressBar.tsx +3 -3
  67. package/src/FormatFile/utils/createUseCreateThumbnail.ts +1 -0
  68. package/src/Icon/Icon.tsx +1 -0
  69. package/src/InputCurrency/InputCurrency.tsx +40 -38
  70. package/src/InputCurrency/utils.ts +9 -0
  71. package/src/InputDate/InputDate.test.tsx +1 -0
  72. package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +1 -0
  73. package/src/InputFieldWrapper/components/Prefix/Prefix.tsx +12 -12
  74. package/src/InputFieldWrapper/components/Suffix/Suffix.tsx +14 -14
  75. package/src/InputNumber/InputNumber.tsx +8 -0
  76. package/src/InputPassword/InputPassword.test.tsx +1 -0
  77. package/src/InputPassword/InputPassword.tsx +2 -1
  78. package/src/InputPressable/InputPressable.test.tsx +1 -0
  79. package/src/InputSearch/InputSearch.tsx +1 -0
  80. package/src/InputText/context/InputAccessoriesProvider.test.tsx +6 -1
  81. package/src/InputText/context/InputAccessoriesProvider.tsx +1 -1
  82. package/src/InputTime/utils/index.ts +1 -0
  83. package/src/Menu/components/MenuOption/MenuOption.tsx +1 -0
  84. package/src/Menu/utils.ts +1 -0
  85. package/src/ProgressBar/ProgressBarInner.tsx +1 -0
  86. package/src/Select/components/SelectInternalPicker/SelectInternalPicker.tsx +1 -0
  87. package/src/Select/components/SelectInternalPicker/utils.ts +1 -0
  88. package/src/StatusLabel/StatusLabel.tsx +1 -1
  89. package/src/Switch/components/BaseSwitch/BaseSwitch.tsx +1 -0
  90. package/src/Text/Text.tsx +1 -0
  91. package/src/Toast/Toast.tsx +2 -1
  92. package/src/Typography/Typography.tsx +5 -0
  93. package/src/hooks/useAtlantisI18n/utils/dateFormatter.ts +1 -0
  94. package/src/hooks/useFormController.ts +2 -0
  95. package/src/utils/intl/capitalize.ts +1 -0
  96. package/src/utils/test/MockSafeAreaProvider.tsx +3 -3
@@ -46,10 +46,11 @@ export interface InputCurrencyProps
46
46
  readonly maxLength?: number;
47
47
 
48
48
  onChange?(newValue?: number | string | undefined): void;
49
- value?: number;
50
- defaultValue?: number;
51
- keyboard?: "decimal-pad" | "numbers-and-punctuation";
49
+ readonly value?: number;
50
+ readonly defaultValue?: number;
51
+ readonly keyboard?: "decimal-pad" | "numbers-and-punctuation";
52
52
  }
53
+
53
54
  export const getInternalValue = (
54
55
  props: InputCurrencyProps,
55
56
  field: ControllerRenderProps<FieldValues, string>,
@@ -59,6 +60,7 @@ export const getInternalValue = (
59
60
  ) => string,
60
61
  ): string => {
61
62
  if (!props.value && !field.value) return "";
63
+
62
64
  return (
63
65
  props.value?.toString() ??
64
66
  formatNumber(field.value, {
@@ -113,6 +115,7 @@ export function InputCurrency(props: InputCurrencyProps): JSX.Element {
113
115
  decimalNumbers !== ""
114
116
  ? transformedValue.toString() + "." + decimalNumbers.slice(1)
115
117
  : transformedValue.toString();
118
+
116
119
  if (checkLastChar(stringValue)) {
117
120
  const roundedDecimal = configureDecimal(
118
121
  decimalCount,
@@ -167,40 +170,39 @@ export function InputCurrency(props: InputCurrencyProps): JSX.Element {
167
170
  const { t } = useAtlantisI18n();
168
171
 
169
172
  return (
170
- <>
171
- <InputText
172
- {...props}
173
- prefix={showCurrencySymbol ? { label: currencySymbol } : undefined}
174
- keyboard={getKeyboard(props)}
175
- value={props.value?.toString() || displayValue}
176
- defaultValue={props.defaultValue?.toString()}
177
- onChangeText={handleChange}
178
- transform={{
179
- output: val => {
180
- return val
181
- ?.split(floatSeparators.group)
182
- .join("")
183
- .replace(floatSeparators.decimal, ".");
184
- },
185
- }}
186
- validations={{
187
- pattern: {
188
- value: NUMBER_VALIDATION_REGEX,
189
- message: t("errors.notANumber"),
190
- },
191
- ...props.validations,
192
- }}
193
- onBlur={() => {
194
- props.onBlur?.();
195
- if (
196
- field.value === 0 ||
197
- field.value === "" ||
198
- field.value === undefined
199
- ) {
200
- setDisplayValue("0");
201
- }
202
- }}
203
- />
204
- </>
173
+ <InputText
174
+ {...props}
175
+ prefix={showCurrencySymbol ? { label: currencySymbol } : undefined}
176
+ keyboard={getKeyboard(props)}
177
+ value={props.value?.toString() || displayValue}
178
+ defaultValue={props.defaultValue?.toString()}
179
+ onChangeText={handleChange}
180
+ transform={{
181
+ output: val => {
182
+ return val
183
+ ?.split(floatSeparators.group)
184
+ .join("")
185
+ .replace(floatSeparators.decimal, ".");
186
+ },
187
+ }}
188
+ validations={{
189
+ pattern: {
190
+ value: NUMBER_VALIDATION_REGEX,
191
+ message: t("errors.notANumber"),
192
+ },
193
+ ...props.validations,
194
+ }}
195
+ onBlur={() => {
196
+ props.onBlur?.();
197
+
198
+ if (
199
+ field.value === 0 ||
200
+ field.value === "" ||
201
+ field.value === undefined
202
+ ) {
203
+ setDisplayValue("0");
204
+ }
205
+ }}
206
+ />
205
207
  );
206
208
  }
@@ -1,5 +1,6 @@
1
1
  export function countDecimal(value: number): number {
2
2
  const convertedValue = value.toString();
3
+
3
4
  if (convertedValue.includes(".")) {
4
5
  return convertedValue.split(".")[1].length;
5
6
  }
@@ -12,10 +13,13 @@ export function limitInputWholeDigits(
12
13
  maxInputLength: number,
13
14
  ): number {
14
15
  let convertedValue = value.toString();
16
+
15
17
  if (convertedValue.length > maxInputLength) {
16
18
  convertedValue = convertedValue.slice(0, maxInputLength);
19
+
17
20
  return parseFloat(convertedValue);
18
21
  }
22
+
19
23
  return value;
20
24
  }
21
25
 
@@ -32,19 +36,23 @@ export function configureDecimal(
32
36
  const precision = 10 ** targetDecimalPlaces;
33
37
  const convertedValue =
34
38
  Math.round(parseFloat(transformedValue) * precision) / precision;
39
+
35
40
  return convertedValue;
36
41
  }
37
42
 
38
43
  export function convertToNumber(value: string): string | number {
39
44
  const regexValidation = /^[0-9]*$/;
45
+
40
46
  if (value?.match?.(regexValidation)) {
41
47
  return parseFloat(value);
42
48
  }
49
+
43
50
  return value;
44
51
  }
45
52
 
46
53
  export const checkLastChar = (stringValue: string): boolean => {
47
54
  const lastChar = stringValue[stringValue.length - 1];
55
+
48
56
  return Boolean(Number(stringValue)) && lastChar !== "0" && lastChar !== ".";
49
57
  };
50
58
 
@@ -85,6 +93,7 @@ export const parseGivenInput = (
85
93
  wholeIntegerValue = splittedValue[0];
86
94
  decimalNumbers = getDecimalNumbers(value, decimalSeparator);
87
95
  }
96
+
88
97
  return [decimalCount, wholeIntegerValue, decimalNumbers];
89
98
  };
90
99
 
@@ -139,6 +139,7 @@ describe("InputDate", () => {
139
139
  const saveButtonText = "Submit";
140
140
 
141
141
  const requiredError = "This is required";
142
+
142
143
  function SimpleFormWithProvider({ children, defaultValues }) {
143
144
  const formMethods = useForm({
144
145
  reValidateMode: "onChange",
@@ -17,6 +17,7 @@ export function ClearAction({
17
17
  hasMarginRight = false,
18
18
  }: ClearActionProps): JSX.Element {
19
19
  const { t } = useAtlantisI18n();
20
+
20
21
  return (
21
22
  <Pressable
22
23
  style={[styles.container, hasMarginRight && styles.addedMargin]}
@@ -15,12 +15,12 @@ import { typographyStyles } from "../../../Typography";
15
15
  import { styles } from "../../InputFieldWrapper.style";
16
16
 
17
17
  export interface PrefixLabelProps {
18
- focused: boolean;
19
- disabled?: boolean;
20
- hasMiniLabel: boolean;
21
- inputInvalid: boolean;
22
- label: string;
23
- styleOverride?: StyleProp<TextStyle>;
18
+ readonly focused: boolean;
19
+ readonly disabled?: boolean;
20
+ readonly hasMiniLabel: boolean;
21
+ readonly inputInvalid: boolean;
22
+ readonly label: string;
23
+ readonly styleOverride?: StyleProp<TextStyle>;
24
24
  }
25
25
 
26
26
  export const prefixLabelTestId = "ATL-InputFieldWrapper-PrefixLabel";
@@ -68,12 +68,12 @@ export function PrefixLabel({
68
68
  }
69
69
 
70
70
  export interface PrefixIconProps {
71
- focused: boolean;
72
- disabled?: boolean;
73
- hasMiniLabel: boolean;
74
- inputInvalid?: boolean;
75
- icon: IconNames;
76
- styleOverride?: StyleProp<ViewStyle>;
71
+ readonly focused: boolean;
72
+ readonly disabled?: boolean;
73
+ readonly hasMiniLabel: boolean;
74
+ readonly inputInvalid?: boolean;
75
+ readonly icon: IconNames;
76
+ readonly styleOverride?: StyleProp<ViewStyle>;
77
77
  }
78
78
 
79
79
  export function PrefixIcon({
@@ -15,13 +15,13 @@ import { typographyStyles } from "../../../Typography";
15
15
  import { styles } from "../../InputFieldWrapper.style";
16
16
 
17
17
  export interface SuffixLabelProps {
18
- focused: boolean;
19
- disabled?: boolean;
20
- hasMiniLabel: boolean;
21
- inputInvalid?: boolean;
22
- label: string;
23
- hasLeftMargin?: boolean;
24
- styleOverride?: StyleProp<TextStyle>;
18
+ readonly focused: boolean;
19
+ readonly disabled?: boolean;
20
+ readonly hasMiniLabel: boolean;
21
+ readonly inputInvalid?: boolean;
22
+ readonly label: string;
23
+ readonly hasLeftMargin?: boolean;
24
+ readonly styleOverride?: StyleProp<TextStyle>;
25
25
  }
26
26
 
27
27
  export const suffixLabelTestId = "ATL-InputFieldWrapper-SuffixLabel";
@@ -71,13 +71,13 @@ export function SuffixLabel({
71
71
  }
72
72
 
73
73
  export interface SuffixIconProps {
74
- focused: boolean;
75
- disabled?: boolean;
76
- hasMiniLabel: boolean;
77
- inputInvalid?: boolean;
78
- icon: IconNames;
79
- hasLeftMargin?: boolean;
80
- onPress?: () => void;
74
+ readonly focused: boolean;
75
+ readonly disabled?: boolean;
76
+ readonly hasMiniLabel: boolean;
77
+ readonly inputInvalid?: boolean;
78
+ readonly icon: IconNames;
79
+ readonly hasLeftMargin?: boolean;
80
+ readonly onPress?: () => void;
81
81
  }
82
82
 
83
83
  export function SuffixIcon({
@@ -36,12 +36,14 @@ function InputNumberInternal(props: InputNumberProps, ref: Ref<InputTextRef>) {
36
36
  }
37
37
  };
38
38
  const { t } = useAtlantisI18n();
39
+
39
40
  const handleChange = (newValue: number | string | undefined) => {
40
41
  props.onChange?.(newValue);
41
42
  };
42
43
 
43
44
  const { inputTransform: convertToString, outputTransform: convertToNumber } =
44
45
  useNumberTransform(props.value);
46
+
45
47
  return (
46
48
  <InputText
47
49
  {...props}
@@ -69,10 +71,12 @@ function hasPeriodAtEnd(value: string) {
69
71
  // matches patterns like ".", "0.", "12.", "+1.", and "-0."
70
72
  return !!value?.match(/^[-+]?[0-9]*\.$/);
71
73
  }
74
+
72
75
  function hasScientificNotationAtEnd(value: string) {
73
76
  // matches patterns like "1e", "+2e", "1.2e" and "-3e"
74
77
  return !!value?.match(/^[-+]?[0-9]+(\.?[0-9]+)?e$/);
75
78
  }
79
+
76
80
  function hasPlusMinusAtEnd(value: string) {
77
81
  // matches "+" and "-"
78
82
  return !!value?.match(/^[-+]+$/);
@@ -92,6 +96,7 @@ export function shouldShowUserValue(value: string): boolean {
92
96
  ];
93
97
  const isSpecial = (v: string) =>
94
98
  specialCasesFn.reduce((acc, fn) => acc || fn(v), false);
99
+
95
100
  return isSpecial(value);
96
101
  }
97
102
 
@@ -105,9 +110,11 @@ export function useNumberTransform(controlledValue: number | undefined): {
105
110
 
106
111
  const convertToNumber = (newValue: string) => {
107
112
  setTypedValue(newValue);
113
+
108
114
  if (newValue?.match?.(NUMBER_VALIDATION_REGEX)) {
109
115
  return parseFloat(newValue);
110
116
  }
117
+
111
118
  return newValue;
112
119
  };
113
120
 
@@ -115,6 +122,7 @@ export function useNumberTransform(controlledValue: number | undefined): {
115
122
  if (shouldShowUserValue(typedValue)) {
116
123
  return typedValue;
117
124
  }
125
+
118
126
  return internalValue?.toString() || undefined;
119
127
  };
120
128
 
@@ -8,6 +8,7 @@ jest.mock("../InputFieldWrapper", () => ({
8
8
  ...jest.requireActual("../InputFieldWrapper"),
9
9
  InputFieldWrapper: function Mock(props: InputFieldWrapperProps) {
10
10
  MockInputFieldWrapper(props);
11
+
11
12
  return jest.requireActual("../InputFieldWrapper").InputFieldWrapper(props);
12
13
  },
13
14
  }));
@@ -15,7 +15,7 @@ export interface InputPasswordProps
15
15
  *
16
16
  * @default true
17
17
  */
18
- usePrivacyEye?: boolean;
18
+ readonly usePrivacyEye?: boolean;
19
19
  }
20
20
 
21
21
  function InputPasswordInternal(
@@ -43,6 +43,7 @@ function InputPasswordInternal(
43
43
  onPress: handleOnPress,
44
44
  };
45
45
  }
46
+
46
47
  return undefined;
47
48
  };
48
49
 
@@ -8,6 +8,7 @@ jest.mock("../InputFieldWrapper", () => ({
8
8
  ...jest.requireActual("../InputFieldWrapper"),
9
9
  InputFieldWrapper: function Mock(props: InputFieldWrapperProps) {
10
10
  MockInputFieldWrapper(props);
11
+
11
12
  return jest.requireActual("../InputFieldWrapper").InputFieldWrapper(props);
12
13
  },
13
14
  }));
@@ -54,6 +54,7 @@ function SearchInputInternal(
54
54
 
55
55
  useEffect(() => {
56
56
  delayedSearch(value);
57
+
57
58
  return delayedSearch.cancel;
58
59
  }, [value, delayedSearch]);
59
60
 
@@ -31,7 +31,7 @@ describe("InputAccessories", () => {
31
31
  const mockInputOneFocus = jest.fn();
32
32
  const mockInputTwoFocus = jest.fn();
33
33
 
34
- function InputWrapper({ focusedInput }: { focusedInput: string }) {
34
+ function InputWrapper({ focusedInput }: { readonly focusedInput: string }) {
35
35
  const { register, setFocusedInput, unregister } = useContext(
36
36
  InputAccessoriesContext,
37
37
  );
@@ -40,12 +40,14 @@ describe("InputAccessories", () => {
40
40
  register(inputOneName, () => mockInputOneFocus());
41
41
  register(inputTwoName, () => mockInputTwoFocus());
42
42
  setFocusedInput(focusedInput);
43
+
43
44
  return () => {
44
45
  unregister(inputOneName);
45
46
  unregister(inputTwoName);
46
47
  setFocusedInput("");
47
48
  };
48
49
  }, [register, setFocusedInput, unregister, focusedInput]);
50
+
49
51
  return (
50
52
  <>
51
53
  <InputText
@@ -58,6 +60,7 @@ describe("InputAccessories", () => {
58
60
  </>
59
61
  );
60
62
  }
63
+
61
64
  function SetupInputAccessoriesTest(focusedInput: string) {
62
65
  mockUseFormController.mockImplementation(({ name, value, validations }) => {
63
66
  const { field, error } = actualUseFormController({
@@ -65,8 +68,10 @@ describe("InputAccessories", () => {
65
68
  value,
66
69
  validations,
67
70
  });
71
+
68
72
  return { field, error };
69
73
  });
74
+
70
75
  return render(<InputWrapper focusedInput={focusedInput} />, {
71
76
  wrapper: InputAccessoriesProvider,
72
77
  });
@@ -15,7 +15,7 @@ import { styles } from "./InputAccessoriesProvider.style";
15
15
  export function InputAccessoriesProvider({
16
16
  children,
17
17
  }: {
18
- children: ReactNode;
18
+ readonly children: ReactNode;
19
19
  }): JSX.Element {
20
20
  const inputAccessoryID = useRef(v4()).current;
21
21
  const {
@@ -15,6 +15,7 @@ export function roundUpToNearestMinutes(
15
15
  minutes: MinutesIncrement,
16
16
  ): Date {
17
17
  const ms = 1000 * 60 * minutes;
18
+
18
19
  return new Date(Math.ceil(date.getTime() / ms) * ms);
19
20
  }
20
21
 
@@ -20,6 +20,7 @@ export function MenuOption({
20
20
  }: MenuOptionInternalProps): JSX.Element {
21
21
  const destructiveColor = "critical";
22
22
  const textVariation = destructive ? destructiveColor : "heading";
23
+
23
24
  return (
24
25
  <View testID="ATL-MENU-OPTIONS">
25
26
  <Pressable
package/src/Menu/utils.ts CHANGED
@@ -82,6 +82,7 @@ function getHorizontalPosition(
82
82
  if (menuPositionHorizontal === "menuRight") {
83
83
  getRightPosition(pos, activatorLayout, windowWidth, menuPadding, menuWidth);
84
84
  }
85
+
85
86
  if (menuPositionHorizontal === "menuLeft") {
86
87
  getLeftPosition(pos, activatorLayout, windowWidth, menuPadding, menuWidth);
87
88
  }
@@ -43,5 +43,6 @@ export function calculateWidth(total: number, current: number): number {
43
43
  const curr = Math.max(0, current);
44
44
 
45
45
  if (curr >= total) return 100;
46
+
46
47
  return (curr / total) * 100;
47
48
  }
@@ -12,6 +12,7 @@ export function SelectInternalPicker({
12
12
  onChange,
13
13
  }: SelectInternalPickerProps): JSX.Element {
14
14
  if (disabled) return <>{children}</>;
15
+
15
16
  if (isIOS14AndUp()) {
16
17
  return (
17
18
  <SelectPressable>
@@ -13,6 +13,7 @@ export function handlePress(onChange: SelectInternalPickerProps["onChange"]) {
13
13
  export function isIOS14AndUp(): boolean {
14
14
  if (Platform.OS === "ios") {
15
15
  const majorVersionIOS = parseInt(Platform.Version, 10);
16
+
16
17
  return majorVersionIOS >= 14;
17
18
  }
18
19
 
@@ -57,7 +57,7 @@ export function StatusLabel({
57
57
  }
58
58
 
59
59
  interface StatusLabelIconProps {
60
- status: StatusType;
60
+ readonly status: StatusType;
61
61
  }
62
62
 
63
63
  function StatusLabelIcon({ status }: StatusLabelIconProps) {
@@ -61,6 +61,7 @@ export function BaseSwitch({
61
61
  return tokens["color-surface--background"];
62
62
  }
63
63
  }
64
+
64
65
  return undefined; //use default iOS
65
66
  }
66
67
 
package/src/Text/Text.tsx CHANGED
@@ -147,5 +147,6 @@ function getFontWeight({
147
147
  }: Pick<TextProps, "level" | "emphasis">): BaseWeight {
148
148
  if (emphasis === "strong") return "semiBold";
149
149
  if (level === "textSupporting") return "medium";
150
+
150
151
  return "regular";
151
152
  }
@@ -19,6 +19,7 @@ function DefaultToast({ text1 }: ToastConfigParams<string>): JSX.Element {
19
19
  const { bottom } = useSafeAreaInsets();
20
20
  const { t } = useAtlantisI18n();
21
21
  const toastContainerStyles = [styles.container, { paddingBottom: bottom }];
22
+
22
23
  return (
23
24
  <View style={toastContainerStyles}>
24
25
  <View style={styles.toast}>
@@ -48,7 +49,7 @@ export interface JobberToastProps {
48
49
  * Has effect only when the position is "bottom".
49
50
  * @default 40
50
51
  */
51
- bottomOffset?: number;
52
+ readonly bottomOffset?: number;
52
53
  }
53
54
 
54
55
  export function JobberToast({ bottomOffset }: JobberToastProps): JSX.Element {
@@ -207,6 +207,7 @@ function getFontStyle(
207
207
  fontWeight,
208
208
  )}`;
209
209
  const fontStyling = styles[styleKey];
210
+
210
211
  if (fontStyling) {
211
212
  return fontStyling;
212
213
  } else {
@@ -234,6 +235,7 @@ function getColorStyle(color?: TextColor, reverseTheme?: boolean) {
234
235
  return styles.greyBlue;
235
236
  }
236
237
  const colorStyleKey = `${color}${reverseTheme ? "Reverse" : ""}`;
238
+
237
239
  return styles[`${colorStyleKey}`];
238
240
  }
239
241
 
@@ -248,10 +250,13 @@ function getSizeAndHeightStyle(
248
250
  lineHeightOverwrite?: LineHeight,
249
251
  ) {
250
252
  const fontSize = styles[`${textSize}Size`];
253
+
251
254
  if (lineHeightOverwrite) {
252
255
  const lineHeight = styles[`${lineHeightOverwrite}LineHeight`];
256
+
253
257
  return StyleSheet.flatten([fontSize, lineHeight]);
254
258
  }
259
+
255
260
  return fontSize;
256
261
  }
257
262
 
@@ -13,6 +13,7 @@ export function dateFormatter(
13
13
  { locale, timeZone }: DateFormatterOptions,
14
14
  ): string {
15
15
  const zonedTime = utcToZonedTime(date, timeZone);
16
+
16
17
  return format(zonedTime, dateTimeFormat, {
17
18
  locale: getDateFnsLocale(locale),
18
19
  });
@@ -51,6 +51,7 @@ export function useFormController<T>({
51
51
  // TODO: Add support for two-part identifiers (e.g. "property.province")
52
52
  const fieldIdentifiers = fieldName.split(".");
53
53
  let error: FieldError | undefined;
54
+
54
55
  if (fieldIdentifiers.length === 3) {
55
56
  const [section, item, identifier] = fieldIdentifiers;
56
57
  error = errors[section]?.[item]?.[identifier];
@@ -64,5 +65,6 @@ export function useFormController<T>({
64
65
  function useControlName(name?: string): UseControllerReturn["field"]["name"] {
65
66
  const [identifier] = useState(v1());
66
67
  const prefix = `generatedName--${identifier}`;
68
+
67
69
  return `${name || prefix}` as const;
68
70
  }
@@ -2,5 +2,6 @@ export function capitalize(text: string): string {
2
2
  if (!text) {
3
3
  return "";
4
4
  }
5
+
5
6
  return text.charAt(0).toLocaleUpperCase("en-US") + text.slice(1);
6
7
  }
@@ -6,9 +6,9 @@ import {
6
6
  } from "react-native-safe-area-context";
7
7
 
8
8
  interface MockSafeAreaProviderProps {
9
- children: React.ReactNode;
10
- frame?: Rect;
11
- insets?: EdgeInsets;
9
+ readonly children: React.ReactNode;
10
+ readonly frame?: Rect;
11
+ readonly insets?: EdgeInsets;
12
12
  }
13
13
 
14
14
  export function MockSafeAreaProvider({