@jobber/components-native 0.89.5-JOB-140604-cab60b8.43 → 0.89.5-JOB-140604-8777ec5.52

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 (229) hide show
  1. package/dist/package.json +7 -7
  2. package/dist/src/ActionItem/ActionItemGroup.js +1 -1
  3. package/dist/src/AutoLink/components/Link/Link.js +1 -1
  4. package/dist/src/BottomSheet/BottomSheet.js +4 -2
  5. package/dist/src/BottomSheet/hooks/useBottomSheetBackHandler.js +26 -0
  6. package/dist/src/Chip/Chip.js +12 -1
  7. package/dist/src/Chip/Chip.style.js +1 -1
  8. package/dist/src/ContentOverlay/ContentOverlay.js +3 -5
  9. package/dist/src/ErrorMessageWrapper/context/ErrorMessageProvider.js +1 -1
  10. package/dist/src/Form/Form.js +2 -1
  11. package/dist/src/Form/components/FormMessageBanner/FormMessageBanner.js +1 -1
  12. package/dist/src/Form/hooks/useInternalForm.js +6 -3
  13. package/dist/src/FormatFile/components/MediaView/MediaView.js +22 -5
  14. package/dist/src/InputDate/InputDate.js +2 -2
  15. package/dist/src/InputFieldWrapper/InputFieldWrapper.js +14 -12
  16. package/dist/src/InputFieldWrapper/components/Prefix/Prefix.js +5 -2
  17. package/dist/src/InputFieldWrapper/components/Suffix/Suffix.js +5 -2
  18. package/dist/src/InputPressable/InputPressable.js +20 -8
  19. package/dist/src/InputPressable/InputPressable.style.js +3 -0
  20. package/dist/src/InputText/InputText.js +22 -11
  21. package/dist/src/InputText/InputText.style.js +4 -0
  22. package/dist/src/InputTime/InputTime.js +2 -2
  23. package/dist/src/Menu/Menu.js +2 -2
  24. package/dist/src/Select/components/SelectPressable/SelectPressable.js +1 -1
  25. package/dist/src/utils/meta/meta.json +0 -1
  26. package/dist/tsconfig.build.tsbuildinfo +1 -1
  27. package/dist/types/src/ActionItem/ActionItem.d.ts +2 -1
  28. package/dist/types/src/ActionItem/ActionItemGroup.d.ts +2 -1
  29. package/dist/types/src/ActionItem/components/ActionItemContainer.d.ts +2 -1
  30. package/dist/types/src/ActionLabel/ActionLabel.d.ts +1 -1
  31. package/dist/types/src/ActivityIndicator/ActivityIndicator.d.ts +2 -1
  32. package/dist/types/src/AutoLink/AutoLink.d.ts +2 -1
  33. package/dist/types/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.d.ts +2 -1
  34. package/dist/types/src/AutoLink/components/Link/Link.d.ts +2 -1
  35. package/dist/types/src/Banner/Banner.d.ts +2 -1
  36. package/dist/types/src/Banner/components/BannerIcon/BannerIcon.d.ts +2 -1
  37. package/dist/types/src/BottomSheet/BottomSheet.d.ts +4 -9
  38. package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +2 -1
  39. package/dist/types/src/BottomSheet/hooks/useBottomSheetBackHandler.d.ts +8 -0
  40. package/dist/types/src/Button/Button.d.ts +2 -1
  41. package/dist/types/src/Button/components/InternalButtonLoading/InternalButtonLoading.d.ts +1 -1
  42. package/dist/types/src/ButtonGroup/ButtonGroup.d.ts +2 -1
  43. package/dist/types/src/ButtonGroup/ButtonGroupAction.d.ts +4 -3
  44. package/dist/types/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +3 -2
  45. package/dist/types/src/Card/Card.d.ts +2 -1
  46. package/dist/types/src/Card/components/InternalCardHeader.d.ts +2 -1
  47. package/dist/types/src/Checkbox/Checkbox.d.ts +2 -1
  48. package/dist/types/src/Checkbox/CheckboxGroup.d.ts +2 -1
  49. package/dist/types/src/Chip/Chip.d.ts +2 -1
  50. package/dist/types/src/Content/Content.d.ts +2 -1
  51. package/dist/types/src/ContentOverlay/UNSAFE_WrappedModalize.d.ts +1 -1
  52. package/dist/types/src/Disclosure/Disclosure.d.ts +1 -1
  53. package/dist/types/src/Divider/Divider.d.ts +2 -1
  54. package/dist/types/src/EmptyState/EmptyState.d.ts +2 -1
  55. package/dist/types/src/ErrorMessageWrapper/ErrorMessageWrapper.d.ts +2 -1
  56. package/dist/types/src/ErrorMessageWrapper/context/ErrorMessageProvider.d.ts +2 -1
  57. package/dist/types/src/ErrorMessageWrapper/context/types.d.ts +1 -1
  58. package/dist/types/src/Flex/Flex.d.ts +2 -1
  59. package/dist/types/src/Form/Form.d.ts +2 -1
  60. package/dist/types/src/Form/components/FormActionBar/FormActionBar.d.ts +3 -2
  61. package/dist/types/src/Form/components/FormBody/FormBody.d.ts +3 -2
  62. package/dist/types/src/Form/components/FormCache/FormCache.d.ts +2 -1
  63. package/dist/types/src/Form/components/FormErrorBanner/FormErrorBanner.d.ts +2 -1
  64. package/dist/types/src/Form/components/FormMask/FormMask.d.ts +2 -1
  65. package/dist/types/src/Form/components/FormMessage/FormMessage.d.ts +2 -1
  66. package/dist/types/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.d.ts +2 -1
  67. package/dist/types/src/Form/components/FormMessageBanner/FormMessageBanner.d.ts +2 -1
  68. package/dist/types/src/Form/components/FormSaveButton/FormSaveButton.d.ts +2 -1
  69. package/dist/types/src/Form/context/AtlantisFormContext.d.ts +1 -1
  70. package/dist/types/src/Form/context/types.d.ts +2 -2
  71. package/dist/types/src/Form/hooks/useFormViewRefs.d.ts +2 -2
  72. package/dist/types/src/Form/hooks/useInternalForm.d.ts +5 -5
  73. package/dist/types/src/Form/types.d.ts +10 -4
  74. package/dist/types/src/FormField/FormField.d.ts +1 -1
  75. package/dist/types/src/FormatFile/FormatFile.d.ts +2 -1
  76. package/dist/types/src/FormatFile/components/ErrorIcon/ErrorIcon.d.ts +2 -1
  77. package/dist/types/src/FormatFile/components/FileView/FileView.d.ts +2 -1
  78. package/dist/types/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +3 -2
  79. package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +2 -1
  80. package/dist/types/src/FormatFile/components/ProgressBar/ProgressBar.d.ts +2 -1
  81. package/dist/types/src/Heading/Heading.d.ts +1 -1
  82. package/dist/types/src/Icon/Icon.d.ts +2 -1
  83. package/dist/types/src/IconButton/IconButton.d.ts +1 -1
  84. package/dist/types/src/InputCurrency/InputCurrency.d.ts +2 -1
  85. package/dist/types/src/InputDate/InputDate.d.ts +4 -2
  86. package/dist/types/src/InputFieldWrapper/InputFieldWrapper.d.ts +9 -2
  87. package/dist/types/src/InputFieldWrapper/components/ClearAction/ClearAction.d.ts +2 -1
  88. package/dist/types/src/InputFieldWrapper/components/Prefix/Prefix.d.ts +4 -4
  89. package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +4 -4
  90. package/dist/types/src/InputPressable/InputPressable.d.ts +9 -1
  91. package/dist/types/src/InputPressable/InputPressable.style.d.ts +3 -0
  92. package/dist/types/src/InputSearch/InputSearch.d.ts +1 -1
  93. package/dist/types/src/InputSearch/components/FilterButton.d.ts +2 -1
  94. package/dist/types/src/InputText/InputText.d.ts +8 -0
  95. package/dist/types/src/InputText/InputText.style.d.ts +4 -0
  96. package/dist/types/src/InputText/context/InputAccessoriesProvider.d.ts +2 -1
  97. package/dist/types/src/InputTime/InputTime.d.ts +4 -2
  98. package/dist/types/src/Menu/Menu.d.ts +2 -1
  99. package/dist/types/src/Menu/components/MenuOption/MenuOption.d.ts +2 -1
  100. package/dist/types/src/Menu/components/Overlay/Overlay.d.ts +2 -1
  101. package/dist/types/src/Menu/types.d.ts +6 -1
  102. package/dist/types/src/ProgressBar/ProgressBar.d.ts +2 -1
  103. package/dist/types/src/ProgressBar/ProgressBarInner.d.ts +2 -1
  104. package/dist/types/src/Select/Select.d.ts +3 -2
  105. package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.d.ts +2 -1
  106. package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.d.ts +2 -1
  107. package/dist/types/src/Select/components/SelectInternalPicker/SelectInternalPicker.d.ts +2 -1
  108. package/dist/types/src/Select/components/SelectPressable/SelectPressable.d.ts +2 -1
  109. package/dist/types/src/StatusLabel/StatusLabel.d.ts +2 -1
  110. package/dist/types/src/Switch/Switch.d.ts +2 -1
  111. package/dist/types/src/Switch/components/BaseSwitch/BaseSwitch.d.ts +2 -1
  112. package/dist/types/src/Text/Text.d.ts +1 -1
  113. package/dist/types/src/TextList/TextList.d.ts +2 -1
  114. package/dist/types/src/ThumbnailList/ThumbnailList.d.ts +2 -1
  115. package/dist/types/src/Toast/Toast.d.ts +2 -1
  116. package/dist/types/src/Typography/Typography.d.ts +1 -1
  117. package/dist/types/src/Typography/TypographyGestureDetector.d.ts +2 -1
  118. package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +1 -1
  119. package/package.json +7 -7
  120. package/src/ActionItem/ActionItem.tsx +1 -1
  121. package/src/ActionItem/ActionItemGroup.tsx +1 -3
  122. package/src/ActionItem/components/ActionItemContainer.tsx +1 -1
  123. package/src/ActionLabel/ActionLabel.tsx +1 -1
  124. package/src/ActivityIndicator/ActivityIndicator.tsx +1 -3
  125. package/src/AutoLink/AutoLink.tsx +1 -1
  126. package/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.tsx +1 -1
  127. package/src/AutoLink/components/Link/Link.tsx +1 -5
  128. package/src/Banner/Banner.tsx +2 -2
  129. package/src/Banner/components/BannerIcon/BannerIcon.tsx +1 -1
  130. package/src/BottomSheet/BottomSheet.stories.tsx +0 -1
  131. package/src/BottomSheet/BottomSheet.tsx +9 -10
  132. package/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.tsx +1 -1
  133. package/src/BottomSheet/hooks/useBottomSheetBackHandler.test.ts +90 -0
  134. package/src/BottomSheet/hooks/useBottomSheetBackHandler.ts +41 -0
  135. package/src/Button/Button.tsx +1 -1
  136. package/src/Button/components/InternalButtonLoading/InternalButtonLoading.tsx +1 -1
  137. package/src/ButtonGroup/ButtonGroup.tsx +1 -1
  138. package/src/ButtonGroup/ButtonGroupAction.tsx +4 -4
  139. package/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.tsx +2 -2
  140. package/src/Card/Card.tsx +1 -1
  141. package/src/Card/components/InternalCardHeader.tsx +1 -1
  142. package/src/Checkbox/Checkbox.tsx +2 -2
  143. package/src/Checkbox/CheckboxGroup.test.tsx +1 -1
  144. package/src/Checkbox/CheckboxGroup.tsx +2 -2
  145. package/src/Chip/Chip.style.ts +1 -1
  146. package/src/Chip/Chip.tsx +20 -2
  147. package/src/Content/Content.tsx +1 -1
  148. package/src/ContentOverlay/ContentOverlay.tsx +3 -4
  149. package/src/Disclosure/Disclosure.tsx +1 -1
  150. package/src/Divider/Divider.tsx +1 -1
  151. package/src/EmptyState/EmptyState.tsx +1 -1
  152. package/src/ErrorMessageWrapper/ErrorMessageWrapper.tsx +1 -1
  153. package/src/ErrorMessageWrapper/context/ErrorMessageProvider.tsx +3 -5
  154. package/src/ErrorMessageWrapper/context/types.ts +1 -1
  155. package/src/Flex/Flex.tsx +2 -2
  156. package/src/Form/Form.test.tsx +145 -2
  157. package/src/Form/Form.tsx +3 -1
  158. package/src/Form/components/FormActionBar/FormActionBar.tsx +3 -3
  159. package/src/Form/components/FormBody/FormBody.tsx +3 -3
  160. package/src/Form/components/FormCache/FormCache.tsx +1 -1
  161. package/src/Form/components/FormErrorBanner/FormErrorBanner.tsx +1 -1
  162. package/src/Form/components/FormMask/FormMask.tsx +1 -1
  163. package/src/Form/components/FormMessage/FormMessage.tsx +1 -1
  164. package/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.tsx +1 -1
  165. package/src/Form/components/FormMessageBanner/FormMessageBanner.tsx +1 -3
  166. package/src/Form/components/FormSaveButton/FormSaveButton.tsx +1 -1
  167. package/src/Form/context/types.ts +2 -2
  168. package/src/Form/hooks/useFormViewRefs.ts +4 -5
  169. package/src/Form/hooks/useInternalForm.ts +12 -5
  170. package/src/Form/types.ts +11 -4
  171. package/src/FormField/FormField.tsx +1 -1
  172. package/src/FormatFile/FormatFile.tsx +3 -3
  173. package/src/FormatFile/components/ErrorIcon/ErrorIcon.tsx +1 -1
  174. package/src/FormatFile/components/FileView/FileView.tsx +1 -1
  175. package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +2 -2
  176. package/src/FormatFile/components/MediaView/MediaView.test.tsx +283 -0
  177. package/src/FormatFile/components/MediaView/MediaView.tsx +28 -7
  178. package/src/FormatFile/components/ProgressBar/ProgressBar.tsx +1 -1
  179. package/src/Heading/Heading.tsx +1 -1
  180. package/src/Icon/Icon.tsx +1 -1
  181. package/src/IconButton/IconButton.tsx +1 -1
  182. package/src/InputCurrency/InputCurrency.tsx +1 -1
  183. package/src/InputDate/InputDate.tsx +7 -3
  184. package/src/InputFieldWrapper/InputFieldWrapper.test.tsx +48 -1
  185. package/src/InputFieldWrapper/InputFieldWrapper.tsx +39 -29
  186. package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +1 -1
  187. package/src/InputFieldWrapper/components/Prefix/Prefix.test.tsx +3 -5
  188. package/src/InputFieldWrapper/components/Prefix/Prefix.tsx +8 -6
  189. package/src/InputFieldWrapper/components/Suffix/Suffix.test.tsx +2 -4
  190. package/src/InputFieldWrapper/components/Suffix/Suffix.tsx +8 -6
  191. package/src/InputPassword/InputPassword.tsx +1 -1
  192. package/src/InputPressable/InputPressable.style.ts +4 -0
  193. package/src/InputPressable/InputPressable.test.tsx +75 -1
  194. package/src/InputPressable/InputPressable.tsx +34 -8
  195. package/src/InputSearch/InputSearch.tsx +1 -0
  196. package/src/InputSearch/components/FilterButton.tsx +1 -1
  197. package/src/InputText/InputText.style.ts +5 -0
  198. package/src/InputText/InputText.test.tsx +75 -0
  199. package/src/InputText/InputText.tsx +32 -12
  200. package/src/InputText/context/InputAccessoriesProvider.tsx +1 -1
  201. package/src/InputTime/InputTime.tsx +7 -3
  202. package/src/Menu/Menu.tsx +3 -3
  203. package/src/Menu/components/MenuOption/MenuOption.tsx +1 -1
  204. package/src/Menu/components/Overlay/Overlay.tsx +1 -1
  205. package/src/Menu/types.ts +7 -1
  206. package/src/ProgressBar/ProgressBar.tsx +1 -1
  207. package/src/ProgressBar/ProgressBarInner.tsx +1 -1
  208. package/src/Select/Select.tsx +2 -2
  209. package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.tsx +1 -1
  210. package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.tsx +1 -1
  211. package/src/Select/components/SelectInternalPicker/SelectInternalPicker.tsx +1 -1
  212. package/src/Select/components/SelectPressable/SelectPressable.tsx +1 -4
  213. package/src/StatusLabel/StatusLabel.tsx +1 -1
  214. package/src/Switch/Switch.tsx +1 -1
  215. package/src/Switch/components/BaseSwitch/BaseSwitch.tsx +1 -1
  216. package/src/Text/Text.tsx +1 -1
  217. package/src/TextList/TextList.tsx +1 -1
  218. package/src/ThumbnailList/ThumbnailList.tsx +1 -1
  219. package/src/Toast/Toast.tsx +2 -2
  220. package/src/Typography/Typography.tsx +1 -1
  221. package/src/Typography/TypographyGestureDetector.tsx +1 -3
  222. package/src/utils/meta/meta.json +0 -1
  223. package/src/utils/test/MockSafeAreaProvider.tsx +1 -1
  224. package/dist/src/BottomSheet/components/BottomSheetInputText/BottomSheetInputText.js +0 -45
  225. package/dist/src/BottomSheet/components/BottomSheetInputText/BottomSheetInputText.styles.js +0 -8
  226. package/dist/types/src/BottomSheet/components/BottomSheetInputText/BottomSheetInputText.d.ts +0 -9
  227. package/dist/types/src/BottomSheet/components/BottomSheetInputText/BottomSheetInputText.styles.d.ts +0 -5
  228. package/src/BottomSheet/components/BottomSheetInputText/BottomSheetInputText.styles.ts +0 -9
  229. package/src/BottomSheet/components/BottomSheetInputText/BottomSheetInputText.tsx +0 -89
package/src/Menu/types.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { ReactElement } from "react";
1
2
  import type { IconColorNames, IconNames } from "@jobber/design";
2
3
  import type { TextAlign } from "../Typography";
3
4
 
@@ -15,9 +16,14 @@ export interface MenuOptionInternalProps extends MenuOptionProps {
15
16
  setOpen: (bool: boolean) => void;
16
17
  }
17
18
 
19
+ export interface CustomActivatorProps {
20
+ readonly onPress?: () => void;
21
+ readonly onLongPress?: () => void;
22
+ }
23
+
18
24
  export interface MenuProps {
19
25
  readonly menuOptions?: MenuOptionProps[];
20
- readonly customActivator?: JSX.Element;
26
+ readonly customActivator?: ReactElement<CustomActivatorProps>;
21
27
  }
22
28
 
23
29
  export interface OverlayProp {
@@ -17,7 +17,7 @@ export function ProgressBar({
17
17
  header,
18
18
  variation = "progress",
19
19
  size = "base",
20
- }: ProgressBarProps): JSX.Element {
20
+ }: ProgressBarProps) {
21
21
  const { t } = useAtlantisI18n();
22
22
  const styles = useStyles();
23
23
  const { tokens } = useAtlantisTheme();
@@ -14,7 +14,7 @@ export function ProgressBarInner({
14
14
  width,
15
15
  // animationDuration = 0,
16
16
  color,
17
- }: ProgressBarInnerProps): JSX.Element {
17
+ }: ProgressBarInnerProps) {
18
18
  // Animation breaking on Android
19
19
  // const [animatedOpacity] = useTiming({
20
20
  // duration: animationDuration,
@@ -110,7 +110,7 @@ export function Select({
110
110
  accessibilityLabel,
111
111
  name,
112
112
  testID,
113
- }: SelectProps): JSX.Element {
113
+ }: SelectProps) {
114
114
  const { field, error } = useFormController({
115
115
  name,
116
116
  validations,
@@ -243,6 +243,6 @@ function getTestID(testID?: string): string {
243
243
  return "ATL-Select";
244
244
  }
245
245
 
246
- export function Option({ children }: SelectOption): JSX.Element {
246
+ export function Option({ children }: SelectOption) {
247
247
  return <>{children}</>;
248
248
  }
@@ -19,7 +19,7 @@ export function SelectDefaultPicker({
19
19
  children,
20
20
  options,
21
21
  onChange,
22
- }: SelectDefaultPickerProps): JSX.Element {
22
+ }: SelectDefaultPickerProps) {
23
23
  const [show, setShow] = useState(false);
24
24
  const { t } = useAtlantisI18n();
25
25
  const selectedLanguage = options.find(option => option.isActive);
@@ -12,7 +12,7 @@ export function SelectDefaultPicker({
12
12
  options,
13
13
  disabled,
14
14
  onChange,
15
- }: SelectDefaultPickerProps): JSX.Element {
15
+ }: SelectDefaultPickerProps) {
16
16
  const selectedItem = options.find(option => option.isActive);
17
17
  const pickerRef = useRef<Picker<string>>(null);
18
18
  const { tokens } = useAtlantisTheme();
@@ -10,7 +10,7 @@ export function SelectInternalPicker({
10
10
  options,
11
11
  disabled,
12
12
  onChange,
13
- }: SelectInternalPickerProps): JSX.Element {
13
+ }: SelectInternalPickerProps) {
14
14
  if (disabled) return <>{children}</>;
15
15
 
16
16
  if (isIOS14AndUp()) {
@@ -13,10 +13,7 @@ type SelectPressableProps = Pick<SelectInternalPickerProps, "children"> &
13
13
  * screen-reader is being used to avoid screen-readers from ignoring the press
14
14
  * on the MenuView
15
15
  */
16
- export function SelectPressable({
17
- children,
18
- onPress,
19
- }: SelectPressableProps): JSX.Element {
16
+ export function SelectPressable({ children, onPress }: SelectPressableProps) {
20
17
  const isScreenReaderEnabled = useIsScreenReaderEnabled();
21
18
  const styles = useStyles();
22
19
  if (isScreenReaderEnabled) return <>{children}</>;
@@ -37,7 +37,7 @@ export function StatusLabel({
37
37
  text,
38
38
  alignment = "end",
39
39
  status = "success",
40
- }: StatusLabelProps): JSX.Element {
40
+ }: StatusLabelProps) {
41
41
  const styles = useStyles();
42
42
 
43
43
  return (
@@ -20,7 +20,7 @@ interface WithLabelProps extends BaseSwitchProps {
20
20
 
21
21
  export type SwitchProps = XOR<BaseSwitchProps, WithLabelProps>;
22
22
 
23
- export function Switch(props: SwitchProps): JSX.Element {
23
+ export function Switch(props: SwitchProps) {
24
24
  const switchProps: SwitchProps = {
25
25
  ...props,
26
26
  accessibilityLabel: props.accessibilityLabel || props.label,
@@ -43,7 +43,7 @@ export function BaseSwitch({
43
43
  disabled = false,
44
44
  accessibilityLabel,
45
45
  name,
46
- }: BaseSwitchProps): JSX.Element {
46
+ }: BaseSwitchProps) {
47
47
  const { field } = useFormController({
48
48
  name,
49
49
  value: value ?? defaultValue,
package/src/Text/Text.tsx CHANGED
@@ -143,7 +143,7 @@ export function Text({
143
143
  underline,
144
144
  selectable,
145
145
  onTextLayout,
146
- }: TextProps): JSX.Element {
146
+ }: TextProps) {
147
147
  const accessibilityRole: TextAccessibilityRole = "text";
148
148
 
149
149
  return (
@@ -44,7 +44,7 @@ export function TextList({
44
44
  emphasis,
45
45
  level = "text",
46
46
  spacing = "none",
47
- }: TextListProps): JSX.Element {
47
+ }: TextListProps) {
48
48
  const styles = useStyles();
49
49
 
50
50
  return (
@@ -26,7 +26,7 @@ export function ThumbnailList({
26
26
  rowCount = RowCount.TwoRows,
27
27
  handleOpenFile,
28
28
  createThumbnail,
29
- }: ThumbnailListProps): JSX.Element {
29
+ }: ThumbnailListProps) {
30
30
  const imageList = filterImages(files);
31
31
  const styles = useStyles();
32
32
 
@@ -17,7 +17,7 @@ import { tokens as staticTokens } from "../utils/design";
17
17
  const MAX_TOAST_MESSAGE_LENGTH = 60;
18
18
  const ANNOUNCEMENT_DELAY = 100;
19
19
 
20
- function DefaultToast({ text1 }: ToastConfigParams<string>): JSX.Element {
20
+ function DefaultToast({ text1 }: ToastConfigParams<string>) {
21
21
  const { bottom } = useSafeAreaInsets();
22
22
  const { t } = useAtlantisI18n();
23
23
  const styles = useStyles();
@@ -56,7 +56,7 @@ export interface JobberToastProps {
56
56
  readonly bottomOffset?: number;
57
57
  }
58
58
 
59
- export function JobberToast({ bottomOffset }: JobberToastProps): JSX.Element {
59
+ export function JobberToast({ bottomOffset }: JobberToastProps) {
60
60
  return <Toast bottomOffset={bottomOffset} config={toastConfig} />;
61
61
  }
62
62
 
@@ -174,7 +174,7 @@ function InternalTypography<T extends FontFamily = "base">({
174
174
  UNSAFE_style,
175
175
  selectable = true,
176
176
  onTextLayout,
177
- }: TypographyProps<T>): JSX.Element {
177
+ }: TypographyProps<T>) {
178
178
  const styles = useTypographyStyles();
179
179
  const sizeAndHeight = getSizeAndHeightStyle(size, styles, lineHeight);
180
180
  const style: StyleProp<ViewStyle>[] = [
@@ -7,8 +7,6 @@ import { Gesture, GestureDetector } from "react-native-gesture-handler";
7
7
  * accidental highlighting of text in Android devices
8
8
  * https://github.com/software-mansion/react-native-gesture-handler/issues/1372
9
9
  */
10
- export function TypographyGestureDetector(
11
- props: PropsWithChildren<unknown>,
12
- ): JSX.Element {
10
+ export function TypographyGestureDetector(props: PropsWithChildren<unknown>) {
13
11
  return <GestureDetector {...props} gesture={Gesture.Native()} />;
14
12
  }
@@ -12,7 +12,6 @@
12
12
  "AutoLink",
13
13
  "Banner",
14
14
  "BottomSheet",
15
- "BottomSheet.InputText",
16
15
  "BottomSheetOption",
17
16
  "Button",
18
17
  "ButtonGroup",
@@ -12,7 +12,7 @@ export function MockSafeAreaProvider({
12
12
  frame,
13
13
  insets,
14
14
  children,
15
- }: MockSafeAreaProviderProps): JSX.Element {
15
+ }: MockSafeAreaProviderProps) {
16
16
  const initialFrame: Rect = { x: 0, y: 0, width: 0, height: 0 };
17
17
  const initialInsets: EdgeInsets = { bottom: 50, top: 50, left: 0, right: 0 };
18
18
 
@@ -1,45 +0,0 @@
1
- import React, { forwardRef, useCallback } from "react";
2
- import { TextInput, View, findNodeHandle } from "react-native";
3
- import { useBottomSheetInternal } from "@gorhom/bottom-sheet";
4
- import { useStyles } from "./BottomSheetInputText.styles";
5
- import { InputText } from "../../../InputText/InputText";
6
- /**
7
- * BottomSheetInputText is a wrapper around InputText that provides
8
- * bottom sheet keyboard handling. It implements the handleOnFocus and
9
- * handleOnBlur logic from BottomSheetTextInput to ensure proper keyboard
10
- * positioning within bottom sheets.
11
- */
12
- export const BottomSheetInputText = forwardRef(function BottomSheetInputText(props, ref) {
13
- const styles = useStyles();
14
- const { onFocus, onBlur } = props;
15
- const { animatedKeyboardState, textInputNodesRef } = useBottomSheetInternal();
16
- const handleOnFocus = useCallback((event) => {
17
- animatedKeyboardState.set((state) => (Object.assign(Object.assign({}, state), { target: event === null || event === void 0 ? void 0 : event.nativeEvent.target })));
18
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
19
- }, [animatedKeyboardState, onFocus]);
20
- const handleOnBlur = useCallback((event) => {
21
- const keyboardState = animatedKeyboardState.get();
22
- const currentlyFocusedInput = TextInput.State.currentlyFocusedInput();
23
- const currentFocusedInput = currentlyFocusedInput !== null
24
- ? findNodeHandle(
25
- // @ts-expect-error - TextInput.State.currentlyFocusedInput() returns NativeMethods
26
- // which is not directly assignable to findNodeHandle's expected type,
27
- // but it works at runtime. This is a known type limitation in React Native.
28
- currentlyFocusedInput)
29
- : null;
30
- /**
31
- * we need to make sure that we only remove the target
32
- * if the target belong to the current component and
33
- * if the currently focused input is not in the targets set.
34
- */
35
- const shouldRemoveCurrentTarget = keyboardState.target === (event === null || event === void 0 ? void 0 : event.nativeEvent.target);
36
- const shouldIgnoreBlurEvent = currentFocusedInput &&
37
- textInputNodesRef.current.has(currentFocusedInput);
38
- if (shouldRemoveCurrentTarget && !shouldIgnoreBlurEvent) {
39
- animatedKeyboardState.set((state) => (Object.assign(Object.assign({}, state), { target: undefined })));
40
- }
41
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
42
- }, [animatedKeyboardState, textInputNodesRef, onBlur]);
43
- return (React.createElement(View, { style: styles.inputText },
44
- React.createElement(InputText, Object.assign({}, props, { ref: ref, onFocus: handleOnFocus, onBlur: handleOnBlur }))));
45
- });
@@ -1,8 +0,0 @@
1
- import { buildThemedStyles } from "../../../AtlantisThemeContext";
2
- export const useStyles = buildThemedStyles(tokens => {
3
- return {
4
- inputText: {
5
- padding: tokens["space-small"],
6
- },
7
- };
8
- });
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- import type { InputTextProps, InputTextRef } from "../../../InputText/InputText";
3
- /**
4
- * BottomSheetInputText is a wrapper around InputText that provides
5
- * bottom sheet keyboard handling. It implements the handleOnFocus and
6
- * handleOnBlur logic from BottomSheetTextInput to ensure proper keyboard
7
- * positioning within bottom sheets.
8
- */
9
- export declare const BottomSheetInputText: React.ForwardRefExoticComponent<InputTextProps & React.RefAttributes<InputTextRef>>;
@@ -1,5 +0,0 @@
1
- export declare const useStyles: () => {
2
- inputText: {
3
- padding: number;
4
- };
5
- };
@@ -1,9 +0,0 @@
1
- import { buildThemedStyles } from "../../../AtlantisThemeContext";
2
-
3
- export const useStyles = buildThemedStyles(tokens => {
4
- return {
5
- inputText: {
6
- padding: tokens["space-small"],
7
- },
8
- };
9
- });
@@ -1,89 +0,0 @@
1
- import React, { forwardRef, useCallback } from "react";
2
- import type { FocusEvent } from "react-native";
3
- import { TextInput, View, findNodeHandle } from "react-native";
4
- import { useBottomSheetInternal } from "@gorhom/bottom-sheet";
5
- import { useStyles } from "./BottomSheetInputText.styles";
6
- import type {
7
- InputTextProps,
8
- InputTextRef,
9
- } from "../../../InputText/InputText";
10
- import { InputText } from "../../../InputText/InputText";
11
-
12
- /**
13
- * BottomSheetInputText is a wrapper around InputText that provides
14
- * bottom sheet keyboard handling. It implements the handleOnFocus and
15
- * handleOnBlur logic from BottomSheetTextInput to ensure proper keyboard
16
- * positioning within bottom sheets.
17
- */
18
- export const BottomSheetInputText = forwardRef<InputTextRef, InputTextProps>(
19
- function BottomSheetInputText(props, ref) {
20
- const styles = useStyles();
21
- const { onFocus, onBlur } = props;
22
- const { animatedKeyboardState, textInputNodesRef } =
23
- useBottomSheetInternal();
24
-
25
- const handleOnFocus = useCallback(
26
- (event?: FocusEvent) => {
27
- animatedKeyboardState.set(
28
- (state: ReturnType<typeof animatedKeyboardState.get>) => ({
29
- ...state,
30
- target: event?.nativeEvent.target,
31
- }),
32
- );
33
-
34
- onFocus?.(event);
35
- },
36
- [animatedKeyboardState, onFocus],
37
- );
38
-
39
- const handleOnBlur = useCallback(
40
- (event?: FocusEvent) => {
41
- const keyboardState = animatedKeyboardState.get();
42
- const currentlyFocusedInput = TextInput.State.currentlyFocusedInput();
43
- const currentFocusedInput =
44
- currentlyFocusedInput !== null
45
- ? findNodeHandle(
46
- // @ts-expect-error - TextInput.State.currentlyFocusedInput() returns NativeMethods
47
- // which is not directly assignable to findNodeHandle's expected type,
48
- // but it works at runtime. This is a known type limitation in React Native.
49
- currentlyFocusedInput,
50
- )
51
- : null;
52
-
53
- /**
54
- * we need to make sure that we only remove the target
55
- * if the target belong to the current component and
56
- * if the currently focused input is not in the targets set.
57
- */
58
- const shouldRemoveCurrentTarget =
59
- keyboardState.target === event?.nativeEvent.target;
60
- const shouldIgnoreBlurEvent =
61
- currentFocusedInput &&
62
- textInputNodesRef.current.has(currentFocusedInput);
63
-
64
- if (shouldRemoveCurrentTarget && !shouldIgnoreBlurEvent) {
65
- animatedKeyboardState.set(
66
- (state: ReturnType<typeof animatedKeyboardState.get>) => ({
67
- ...state,
68
- target: undefined,
69
- }),
70
- );
71
- }
72
-
73
- onBlur?.(event);
74
- },
75
- [animatedKeyboardState, textInputNodesRef, onBlur],
76
- );
77
-
78
- return (
79
- <View style={styles.inputText}>
80
- <InputText
81
- {...props}
82
- ref={ref}
83
- onFocus={handleOnFocus}
84
- onBlur={handleOnBlur}
85
- />
86
- </View>
87
- );
88
- },
89
- );