@jobber/components-native 0.44.2 → 0.45.1

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 (159) hide show
  1. package/dist/package.json +88 -0
  2. package/dist/src/AtlantisContext/AtlantisContext.js +1 -0
  3. package/dist/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.js +3 -3
  4. package/dist/src/AutoLink/utils.js +14 -3
  5. package/dist/src/BottomSheet/BottomSheet.js +3 -4
  6. package/dist/src/ButtonGroup/ButtonGroup.js +3 -4
  7. package/dist/src/ButtonGroup/utils.js +4 -5
  8. package/dist/src/ContentOverlay/ContentOverlay.js +3 -4
  9. package/dist/src/Form/components/FormErrorBanner/FormErrorBanner.js +5 -13
  10. package/dist/src/Form/components/FormMask/FormMask.js +3 -4
  11. package/dist/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.js +4 -5
  12. package/dist/src/Form/components/FormSaveButton/FormSaveButton.js +4 -5
  13. package/dist/src/Form/hooks/useOfflineHandler.js +6 -7
  14. package/dist/src/FormatFile/FormatFile.js +3 -4
  15. package/dist/src/FormatFile/components/FileView/FileView.js +3 -3
  16. package/dist/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.js +6 -7
  17. package/dist/src/FormatFile/components/MediaView/MediaView.js +3 -3
  18. package/dist/src/FormatFile/utils/computeA11yLabel.js +4 -5
  19. package/dist/src/InputCurrency/InputCurrency.js +3 -3
  20. package/dist/src/InputDate/InputDate.js +4 -5
  21. package/dist/src/InputFieldWrapper/components/ClearAction/ClearAction.js +3 -4
  22. package/dist/src/InputFieldWrapper/components/ClearAction/index.js +0 -1
  23. package/dist/src/InputNumber/InputNumber.js +3 -4
  24. package/dist/src/InputPassword/InputPassword.js +3 -4
  25. package/dist/src/InputTime/InputTime.js +3 -4
  26. package/dist/src/Menu/Menu.js +3 -4
  27. package/dist/src/ProgressBar/ProgressBar.js +14 -8
  28. package/dist/src/Select/Select.js +5 -6
  29. package/dist/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.js +3 -4
  30. package/dist/src/Toast/Toast.js +4 -5
  31. package/dist/src/hooks/useAtlantisI18n/index.js +1 -0
  32. package/dist/src/hooks/useAtlantisI18n/locales/en.json +35 -0
  33. package/dist/src/hooks/useAtlantisI18n/locales/es.json +35 -0
  34. package/dist/src/hooks/useAtlantisI18n/useAtlantisI18n.js +22 -0
  35. package/dist/tsconfig.json +38 -0
  36. package/dist/tsconfig.tsbuildinfo +1 -1
  37. package/dist/types/src/AtlantisContext/AtlantisContext.d.ts +8 -0
  38. package/dist/types/src/AutoLink/utils.d.ts +2 -2
  39. package/dist/types/src/FormatFile/utils/computeA11yLabel.d.ts +6 -6
  40. package/dist/types/src/InputFieldWrapper/components/ClearAction/index.d.ts +0 -1
  41. package/dist/types/src/hooks/useAtlantisI18n/index.d.ts +1 -0
  42. package/dist/types/src/hooks/useAtlantisI18n/useAtlantisI18n.d.ts +7 -0
  43. package/package.json +2 -2
  44. package/src/AtlantisContext/AtlantisContext.tsx +10 -0
  45. package/src/AutoLink/AutoLink.test.tsx +3 -4
  46. package/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.tsx +3 -3
  47. package/src/AutoLink/utils.ts +16 -5
  48. package/src/BottomSheet/BottomSheet.test.tsx +3 -4
  49. package/src/BottomSheet/BottomSheet.tsx +3 -4
  50. package/src/ButtonGroup/ButtonGroup.test.tsx +8 -9
  51. package/src/ButtonGroup/ButtonGroup.tsx +3 -4
  52. package/src/ButtonGroup/utils.ts +5 -6
  53. package/src/ContentOverlay/ContentOverlay.test.tsx +1 -11
  54. package/src/ContentOverlay/ContentOverlay.tsx +5 -9
  55. package/src/Form/Form.test.tsx +9 -40
  56. package/src/Form/components/FormErrorBanner/FormErrorBanner.test.tsx +9 -72
  57. package/src/Form/components/FormErrorBanner/FormErrorBanner.tsx +6 -15
  58. package/src/Form/components/FormMask/FormMask.tsx +3 -7
  59. package/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.tsx +4 -5
  60. package/src/Form/components/FormSaveButton/FormSaveButton.test.tsx +3 -7
  61. package/src/Form/components/FormSaveButton/FormSaveButton.tsx +4 -5
  62. package/src/Form/hooks/useOfflineHandler.ts +7 -8
  63. package/src/FormatFile/FormatFile.test.tsx +7 -31
  64. package/src/FormatFile/FormatFile.tsx +3 -7
  65. package/src/FormatFile/components/FileView/FileView.tsx +3 -3
  66. package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.test.tsx +2 -9
  67. package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +6 -7
  68. package/src/FormatFile/components/MediaView/MediaView.tsx +3 -3
  69. package/src/FormatFile/utils/computeA11yLabel.ts +9 -12
  70. package/src/InputCurrency/InputCurrency.test.tsx +6 -1
  71. package/src/InputCurrency/InputCurrency.tsx +3 -3
  72. package/src/InputDate/InputDate.tsx +6 -5
  73. package/src/InputFieldWrapper/InputFieldWrapper.test.tsx +4 -15
  74. package/src/InputFieldWrapper/components/ClearAction/ClearAction.test.tsx +1 -5
  75. package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +3 -4
  76. package/src/InputFieldWrapper/components/ClearAction/index.ts +0 -1
  77. package/src/InputNumber/InputNumber.test.tsx +10 -18
  78. package/src/InputNumber/InputNumber.tsx +3 -4
  79. package/src/InputPassword/InputPassword.test.tsx +1 -2
  80. package/src/InputPassword/InputPassword.tsx +3 -4
  81. package/src/InputSearch/InputSearch.test.tsx +1 -6
  82. package/src/InputText/InputText.test.tsx +10 -38
  83. package/src/InputTime/InputTime.tsx +3 -4
  84. package/src/Menu/Menu.test.tsx +10 -9
  85. package/src/Menu/Menu.tsx +3 -4
  86. package/src/ProgressBar/ProgressBar.tsx +17 -8
  87. package/src/Select/Select.test.tsx +4 -5
  88. package/src/Select/Select.tsx +5 -8
  89. package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.tsx +3 -4
  90. package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.test.tsx +1 -2
  91. package/src/Toast/Toast.tsx +4 -9
  92. package/src/hooks/useAtlantisI18n/index.ts +1 -0
  93. package/src/hooks/useAtlantisI18n/locales/en.json +35 -0
  94. package/src/hooks/useAtlantisI18n/locales/es.json +35 -0
  95. package/src/hooks/useAtlantisI18n/useAtlantisI18n.test.ts +53 -0
  96. package/src/hooks/useAtlantisI18n/useAtlantisI18n.ts +42 -0
  97. package/dist/src/AutoLink/messages.js +0 -18
  98. package/dist/src/BottomSheet/messages.js +0 -8
  99. package/dist/src/ButtonGroup/messages.js +0 -18
  100. package/dist/src/ContentOverlay/messages.js +0 -8
  101. package/dist/src/Form/components/FormErrorBanner/messages.js +0 -13
  102. package/dist/src/Form/components/FormMessage/components/InternalFormMessage/messages.js +0 -8
  103. package/dist/src/Form/components/FormSaveButton/messages.js +0 -8
  104. package/dist/src/Form/messages.js +0 -28
  105. package/dist/src/FormatFile/components/FormatFileBottomSheet/messages.js +0 -13
  106. package/dist/src/FormatFile/messages.js +0 -23
  107. package/dist/src/InputCurrency/messages.js +0 -8
  108. package/dist/src/InputDate/messages.js +0 -8
  109. package/dist/src/InputFieldWrapper/components/ClearAction/messages.js +0 -8
  110. package/dist/src/InputNumber/messages.js +0 -8
  111. package/dist/src/InputPassword/messages.js +0 -8
  112. package/dist/src/InputTime/messages.js +0 -8
  113. package/dist/src/Menu/messages.js +0 -8
  114. package/dist/src/ProgressBar/messages.js +0 -13
  115. package/dist/src/Select/components/SelectDefaultPicker/messages.js +0 -8
  116. package/dist/src/Select/messages.js +0 -13
  117. package/dist/src/Toast/messages.js +0 -13
  118. package/dist/types/src/AutoLink/messages.d.ts +0 -17
  119. package/dist/types/src/BottomSheet/messages.d.ts +0 -7
  120. package/dist/types/src/ButtonGroup/messages.d.ts +0 -17
  121. package/dist/types/src/ContentOverlay/messages.d.ts +0 -7
  122. package/dist/types/src/Form/components/FormErrorBanner/messages.d.ts +0 -12
  123. package/dist/types/src/Form/components/FormMessage/components/InternalFormMessage/messages.d.ts +0 -7
  124. package/dist/types/src/Form/components/FormSaveButton/messages.d.ts +0 -7
  125. package/dist/types/src/Form/messages.d.ts +0 -27
  126. package/dist/types/src/FormatFile/components/FormatFileBottomSheet/messages.d.ts +0 -12
  127. package/dist/types/src/FormatFile/messages.d.ts +0 -22
  128. package/dist/types/src/InputCurrency/messages.d.ts +0 -7
  129. package/dist/types/src/InputDate/messages.d.ts +0 -7
  130. package/dist/types/src/InputFieldWrapper/components/ClearAction/messages.d.ts +0 -7
  131. package/dist/types/src/InputNumber/messages.d.ts +0 -7
  132. package/dist/types/src/InputPassword/messages.d.ts +0 -7
  133. package/dist/types/src/InputTime/messages.d.ts +0 -7
  134. package/dist/types/src/Menu/messages.d.ts +0 -7
  135. package/dist/types/src/ProgressBar/messages.d.ts +0 -12
  136. package/dist/types/src/Select/components/SelectDefaultPicker/messages.d.ts +0 -7
  137. package/dist/types/src/Select/messages.d.ts +0 -12
  138. package/dist/types/src/Toast/messages.d.ts +0 -12
  139. package/src/AutoLink/messages.ts +0 -19
  140. package/src/BottomSheet/messages.ts +0 -9
  141. package/src/ButtonGroup/messages.ts +0 -19
  142. package/src/ContentOverlay/messages.ts +0 -9
  143. package/src/Form/components/FormErrorBanner/messages.ts +0 -14
  144. package/src/Form/components/FormMessage/components/InternalFormMessage/messages.ts +0 -10
  145. package/src/Form/components/FormSaveButton/messages.ts +0 -9
  146. package/src/Form/messages.ts +0 -33
  147. package/src/FormatFile/components/FormatFileBottomSheet/messages.ts +0 -14
  148. package/src/FormatFile/messages.ts +0 -24
  149. package/src/InputCurrency/messages.ts +0 -10
  150. package/src/InputDate/messages.ts +0 -9
  151. package/src/InputFieldWrapper/components/ClearAction/messages.ts +0 -9
  152. package/src/InputNumber/messages.ts +0 -10
  153. package/src/InputPassword/messages.ts +0 -9
  154. package/src/InputTime/messages.ts +0 -9
  155. package/src/Menu/messages.ts +0 -9
  156. package/src/ProgressBar/messages.ts +0 -14
  157. package/src/Select/components/SelectDefaultPicker/messages.ts +0 -9
  158. package/src/Select/messages.ts +0 -14
  159. package/src/Toast/messages.ts +0 -14
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "@jobber/components-native",
3
+ "version": "0.45.1",
4
+ "license": "MIT",
5
+ "description": "React Native implementation of Atlantis",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/GetJobber/atlantis.git"
9
+ },
10
+ "author": "The Frends",
11
+ "bugs": {
12
+ "url": "https://github.com/GetJobber/atlantis/issues"
13
+ },
14
+ "homepage": "https://github.com/GetJobber/atlantis#readme",
15
+ "main": "dist/src/index.js",
16
+ "module": "dist/src/index.js",
17
+ "types": "dist/types/src/index.d.ts",
18
+ "files": [
19
+ "dist",
20
+ "src",
21
+ "!**/__tests__",
22
+ "!**/__fixtures__",
23
+ "!**/__mocks__",
24
+ "ios",
25
+ "cpp",
26
+ "*.podspec",
27
+ "!ios/build",
28
+ "./jestSetup.js"
29
+ ],
30
+ "scripts": {
31
+ "clean": "rm -rf dist/* tsconfig.tsbuildinfo",
32
+ "build": "npm run build:clean && npm run compile",
33
+ "bootstrap": "npm run build",
34
+ "prepack": "npm run build",
35
+ "compile": "tsc -b",
36
+ "build:clean": "rm -rf ./dist"
37
+ },
38
+ "dependencies": {
39
+ "@jobber/design": "^0.44.4",
40
+ "@jobber/hooks": "^2.1.5",
41
+ "@react-native-clipboard/clipboard": "^1.11.2",
42
+ "@react-native-picker/picker": "^2.4.10",
43
+ "autolinker": "^4.0.0",
44
+ "deepmerge": "^4.2.2",
45
+ "lodash": "^4.17.21",
46
+ "react-hook-form": "^7.30.0",
47
+ "react-intl": "^6.4.2",
48
+ "react-native-keyboard-aware-scroll-view": "^0.9.5",
49
+ "react-native-modalize": "^2.0.13",
50
+ "react-native-portalize": "^1.0.7",
51
+ "react-native-safe-area-context": "^4.5.2",
52
+ "react-native-svg": "^13.9.0",
53
+ "react-native-toast-message": "^2.1.6",
54
+ "react-native-uuid": "^1.4.9",
55
+ "ts-xor": "^1.1.0"
56
+ },
57
+ "devDependencies": {
58
+ "@testing-library/jest-native": "^5.4.2",
59
+ "@testing-library/react-hooks": "^7.0.2",
60
+ "@testing-library/react-native": "^12.0.1",
61
+ "@types/lodash.chunk": "^4.2.7",
62
+ "@types/lodash.debounce": "^4.0.7",
63
+ "@types/lodash.identity": "^3.0.7",
64
+ "@types/react": "^18.0.28",
65
+ "@types/react-native": "^0.71.6",
66
+ "@types/react-native-uuid": "^1.4.0",
67
+ "metro-react-native-babel-preset": "^0.76.0",
68
+ "react-test-renderer": "^18.2.0",
69
+ "typescript": "^4.9.5"
70
+ },
71
+ "peerDependencies": {
72
+ "@babel/core": "^7.4.5",
73
+ "@react-native-community/datetimepicker": ">=6.7.0",
74
+ "date-fns": "^2.0.0",
75
+ "date-fns-tz": "*",
76
+ "react": "^18",
77
+ "react-intl": "^6.4.2",
78
+ "react-native": ">=0.69.2",
79
+ "react-native-gesture-handler": ">=2.10.0",
80
+ "react-native-keyboard-aware-scroll-view": "^0.9.5",
81
+ "react-native-modal-datetime-picker": " >=13.0.0",
82
+ "react-native-modalize": "^2.0.13",
83
+ "react-native-portalize": "^1.0.7",
84
+ "react-native-reanimated": "^2.17.0",
85
+ "react-native-safe-area-context": "^4.5.2"
86
+ },
87
+ "gitHead": "8764198c93cfc2812f504b6f6509595ad6b3195c"
88
+ }
@@ -13,6 +13,7 @@ export const defaultValues = {
13
13
  floatSeparators: { group: ",", decimal: "." },
14
14
  currencySymbol: DEFAULT_CURRENCY_SYMBOL,
15
15
  headerHeight: 0,
16
+ locale: "en",
16
17
  setHeaderHeight: _ => {
17
18
  return;
18
19
  },
@@ -1,18 +1,18 @@
1
1
  import React from "react";
2
- import { useIntl } from "react-intl";
3
2
  import { Platform } from "react-native";
4
3
  import { onLongPressLink, onPressLink } from "../../utils";
5
4
  import { Link } from "../Link/Link";
6
5
  import { Text } from "../../../Text";
6
+ import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n";
7
7
  export function ComposeTextWithLinks({ part, index, match, bottomTabsVisible, selectable = true, }) {
8
- const { formatMessage } = useIntl();
8
+ const { t } = useAtlantisI18n();
9
9
  const isLink = match === null || match === void 0 ? void 0 : match.getType();
10
10
  if (isLink) {
11
11
  return (React.createElement(Link, { key: index, onPress: () => onPressLink(match), onLongPress: () => {
12
12
  if (selectable && Platform.OS === "android") {
13
13
  return;
14
14
  }
15
- onLongPressLink(match, bottomTabsVisible, formatMessage);
15
+ onLongPressLink(match, bottomTabsVisible, t);
16
16
  } }, match.getAnchorText()));
17
17
  }
18
18
  return React.createElement(Text, { key: index }, part);
@@ -1,5 +1,4 @@
1
1
  import { Linking } from "react-native";
2
- import { messages } from "./messages";
3
2
  import { copyTextToClipboard } from "./clipboard";
4
3
  function hasPrefix(text, prefixes) {
5
4
  return prefixes.some(prefix => text.includes(prefix));
@@ -31,10 +30,10 @@ export function getUrl(match, immediateOpen = true) {
31
30
  return match.getAnchorHref();
32
31
  }
33
32
  }
34
- export function onLongPressLink(match, bottomTabsVisible, formatMessage) {
33
+ export function onLongPressLink(match, bottomTabsVisible, t) {
35
34
  const linkUrl = getUrl(match, false);
36
35
  const toastConfig = {
37
- message: formatMessage(messages[`${match.getType()}Copied`]),
36
+ message: t(getMessageKey(match)),
38
37
  bottomTabsVisible,
39
38
  };
40
39
  copyTextToClipboard(linkUrl, toastConfig);
@@ -43,3 +42,15 @@ export function onPressLink(match) {
43
42
  const linkUrl = getUrl(match);
44
43
  Linking.openURL(linkUrl);
45
44
  }
45
+ function getMessageKey(match) {
46
+ switch (match.getType()) {
47
+ case "email":
48
+ return "AutoLink.emailCopied";
49
+ case "phone":
50
+ return "AutoLink.phoneCopied";
51
+ case "url":
52
+ return "AutoLink.urlCopied";
53
+ default:
54
+ return "copied";
55
+ }
56
+ }
@@ -2,13 +2,12 @@ import React, { forwardRef, useState } from "react";
2
2
  import { Modalize } from "react-native-modalize";
3
3
  import { useSafeAreaInsets } from "react-native-safe-area-context";
4
4
  import { Keyboard, View } from "react-native";
5
- import { useIntl } from "react-intl";
6
5
  import { BottomSheetOption } from "./components/BottomSheetOption";
7
6
  import { styles } from "./BottomSheet.style";
8
- import { messages } from "./messages";
9
7
  import { useIsScreenReaderEnabled } from "../hooks";
10
8
  import { Divider } from "../Divider";
11
9
  import { Heading } from "../Heading";
10
+ import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
12
11
  export const BottomSheet = forwardRef(BottomSheetInternal);
13
12
  function BottomSheetInternal({ children, showCancel, loading = false, heading, onOpen, onClose, }, ref) {
14
13
  const isScreenReaderEnabled = useIsScreenReaderEnabled();
@@ -36,11 +35,11 @@ function Header({ heading }) {
36
35
  }
37
36
  function Footer({ cancellable, onCancel, }) {
38
37
  const insets = useSafeAreaInsets();
39
- const { formatMessage } = useIntl();
38
+ const { t } = useAtlantisI18n();
40
39
  return (React.createElement(View, { style: { marginBottom: insets.bottom } }, cancellable && (React.createElement(View, { style: styles.children },
41
40
  React.createElement(View, { style: styles.footerDivider },
42
41
  React.createElement(Divider, null)),
43
- React.createElement(BottomSheetOption, { text: formatMessage(messages.cancel), icon: "remove", onPress: onCancel })))));
42
+ React.createElement(BottomSheetOption, { text: t("cancel"), icon: "remove", onPress: onCancel })))));
44
43
  }
45
44
  function dismissKeyboard() {
46
45
  //Dismisses the keyboard before opening the bottom sheet.
@@ -1,14 +1,13 @@
1
1
  import React, { useRef } from "react";
2
- import { useIntl } from "react-intl";
3
2
  import { View } from "react-native";
4
3
  import { PrimaryAction, SecondaryAction } from "./ButtonGroupAction";
5
- import { messages } from "./messages";
6
4
  import { styles } from "./ButtonGroup.style";
7
5
  import { SecondaryActionSheet } from "./components/SecondaryActionSheet";
8
6
  import { getActions, usePreventTapWhenOffline } from "./utils";
9
7
  import { Button } from "../Button";
8
+ import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
10
9
  export function ButtonGroup({ children, showCancelInBottomSheet, bottomSheetHeading, onOpenBottomSheet, onCloseBottomSheet, allowTapWhenOffline = false, }) {
11
- const { formatMessage } = useIntl();
10
+ const { t } = useAtlantisI18n();
12
11
  const { handlePress } = usePreventTapWhenOffline();
13
12
  const secondaryActionsRef = useRef();
14
13
  const { primaryActions, secondaryActions } = getActions(children);
@@ -18,7 +17,7 @@ export function ButtonGroup({ children, showCancelInBottomSheet, bottomSheetHead
18
17
  return (React.createElement(View, { style: styles.button, key: index }, customButton || (React.createElement(Button, { label: label, accessibilityLabel: label, onPress: allowTapWhenOffline ? onPress : handlePress(onPress), type: buttonType, variation: buttonVariation, fullHeight: true, icon: icon, loading: loading }))));
19
18
  }),
20
19
  secondaryActions.length > 0 && (React.createElement(View, { style: styles.moreButton },
21
- React.createElement(Button, { icon: "more", accessibilityLabel: formatMessage(messages.more), onPress: handlePress(openBottomSheet), fullHeight: true }))),
20
+ React.createElement(Button, { icon: "more", accessibilityLabel: t("more"), onPress: handlePress(openBottomSheet), fullHeight: true }))),
22
21
  React.createElement(SecondaryActionSheet, { heading: bottomSheetHeading, showCancel: showCancelInBottomSheet, secondaryActionsRef: secondaryActionsRef, actions: secondaryActions.map(secondaryAction => secondaryAction.props), onOpenBottomSheet: onOpenBottomSheet, onCloseBottomSheet: onCloseBottomSheet })));
23
22
  function openBottomSheet() {
24
23
  var _a;
@@ -1,21 +1,20 @@
1
1
  import React, { useCallback } from "react";
2
- import { useIntl } from "react-intl";
3
2
  import { Alert } from "react-native";
4
- import { messages } from "./messages";
5
3
  import { PrimaryAction, SecondaryAction, } from "./ButtonGroupAction";
6
4
  import { useAtlantisContext } from "../AtlantisContext/AtlantisContext";
5
+ import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
7
6
  /**
8
7
  * Determine if the onPress should be fired or an alert when the device is
9
8
  * online or offline
10
9
  */
11
10
  export function usePreventTapWhenOffline() {
12
- const { formatMessage } = useIntl();
11
+ const { t } = useAtlantisI18n();
13
12
  const { isOnline } = useAtlantisContext();
14
13
  const handlePress = useCallback((callback) => {
15
14
  if (isOnline)
16
15
  return callback;
17
- return () => Alert.alert(formatMessage(messages.unavailableNetworkTitle), formatMessage(messages.unavailableNetworkMessage));
18
- }, [formatMessage, isOnline]);
16
+ return () => Alert.alert(t("networkUnavailableTitle"), t("networkUnavailableDescription"));
17
+ }, [isOnline]);
19
18
  return { handlePress };
20
19
  }
21
20
  /**
@@ -3,22 +3,21 @@ import { Modalize } from "react-native-modalize";
3
3
  import { useSafeAreaInsets } from "react-native-safe-area-context";
4
4
  import { AccessibilityInfo, Platform, View, findNodeHandle, useWindowDimensions, } from "react-native";
5
5
  import { Portal } from "react-native-portalize";
6
- import { useIntl } from "react-intl";
7
6
  import { useKeyboardVisibility } from "./hooks/useKeyboardVisibility";
8
7
  import { styles } from "./ContentOverlay.style";
9
- import { messages } from "./messages";
10
8
  import { useViewLayoutHeight } from "./hooks/useViewLayoutHeight";
11
9
  import { useIsScreenReaderEnabled } from "../hooks";
12
10
  import { IconButton } from "../IconButton";
13
11
  import { tokens } from "../utils/design";
14
12
  import { Heading } from "../Heading";
13
+ import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
15
14
  export const ContentOverlay = forwardRef(ContentOverlayPortal);
16
15
  const ContentOverlayModal = forwardRef(ContentOverlayInternal);
17
16
  // eslint-disable-next-line max-statements
18
17
  function ContentOverlayInternal({ children, title, accessibilityLabel, fullScreen = false, showDismiss = false, isDraggable = true, adjustToContentHeight = false, keyboardShouldPersistTaps = false, keyboardAvoidingBehavior, scrollEnabled = false, modalBackgroundColor = "surface", onClose, onOpen, onBeforeExit, loading = false, avoidKeyboardLikeIOS, }, ref) {
19
18
  isDraggable = onBeforeExit ? false : isDraggable;
20
19
  const isCloseableOnOverlayTap = onBeforeExit ? false : true;
21
- const { formatMessage } = useIntl();
20
+ const { t } = useAtlantisI18n();
22
21
  const { width: windowWidth, height: windowHeight } = useWindowDimensions();
23
22
  const insets = useSafeAreaInsets();
24
23
  const [position, setPosition] = useState("initial");
@@ -106,7 +105,7 @@ function ContentOverlayInternal({ children, title, accessibilityLabel, fullScree
106
105
  !childrenHeightKnown && (React.createElement(View, { style: [styles.hiddenContent, modalStyle] }, renderedChildren)),
107
106
  !headerHeightKnown && (React.createElement(View, { style: [styles.hiddenContent, modalStyle] }, renderedHeader))));
108
107
  function renderHeader() {
109
- const closeOverlayA11YLabel = formatMessage(messages.closeOverlayA11YLabel, {
108
+ const closeOverlayA11YLabel = t("ContentOverlay.close", {
110
109
  title: title,
111
110
  });
112
111
  const headerStyles = [
@@ -1,21 +1,13 @@
1
1
  import React from "react";
2
- import { useIntl } from "react-intl";
3
- import { messages } from "./messages";
4
- import { useAtlantisContext } from "../../../AtlantisContext";
5
2
  import { Banner } from "../../../Banner";
3
+ import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n";
6
4
  export function FormErrorBanner({ networkError, bannerError, }) {
7
- const { formatMessage } = useIntl();
8
- const { isOnline } = useAtlantisContext();
9
- if (!isOnline) {
10
- return (React.createElement(Banner, { text: formatMessage(messages.offlineError), type: "error" }));
11
- }
12
- else if (networkError) {
13
- return (React.createElement(Banner, { text: formatMessage(messages.networkError), type: "error" }));
5
+ const { t } = useAtlantisI18n();
6
+ if (networkError) {
7
+ return React.createElement(Banner, { type: "error" }, t("errors.couldNotSave"));
14
8
  }
15
9
  else if (bannerError) {
16
10
  return (React.createElement(Banner, { text: bannerError.title, details: bannerError.messages, type: "error" }));
17
11
  }
18
- else {
19
- return React.createElement(React.Fragment, null);
20
- }
12
+ return React.createElement(React.Fragment, null);
21
13
  }
@@ -1,11 +1,10 @@
1
1
  import React from "react";
2
2
  import { View } from "react-native";
3
- import { useIntl } from "react-intl";
4
3
  import { styles } from "./FormMask.style";
5
4
  import { ActivityIndicator } from "../../../ActivityIndicator";
6
- import { messages } from "../../messages";
5
+ import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n";
7
6
  export function FormMask() {
8
- const { formatMessage } = useIntl();
9
- return (React.createElement(View, { style: styles.mask, accessibilityLabel: formatMessage(messages.loadingA11YLabel) },
7
+ const { t } = useAtlantisI18n();
8
+ return (React.createElement(View, { style: styles.mask, accessibilityLabel: t("loading") },
10
9
  React.createElement(ActivityIndicator, null)));
11
10
  }
@@ -2,23 +2,22 @@ import React, { useMemo } from "react";
2
2
  import { SafeAreaView } from "react-native-safe-area-context";
3
3
  import { Modal, StatusBar, View } from "react-native";
4
4
  import { ScrollView } from "react-native-gesture-handler";
5
- import { useIntl } from "react-intl";
6
5
  import { styles } from "./InternalFormMessage.style";
7
- import { messages } from "./messages";
8
6
  import { EmptyState } from "../../../../../EmptyState";
7
+ import { useAtlantisI18n } from "../../../../../hooks/useAtlantisI18n";
9
8
  export function InternalFormMessage({ data, onRequestClose, }) {
10
- const { formatMessage } = useIntl();
9
+ const { t } = useAtlantisI18n();
11
10
  const emptyStateData = useMemo(() => {
12
11
  if (data.secondaryAction) {
13
12
  return data;
14
13
  }
15
14
  else {
16
15
  return Object.assign(Object.assign({}, data), { secondaryAction: {
17
- label: formatMessage(messages.goBackButton),
16
+ label: t("goBack"),
18
17
  onPress: onRequestClose,
19
18
  } });
20
19
  }
21
- }, [data, formatMessage, onRequestClose]);
20
+ }, [data, t, onRequestClose]);
22
21
  return (React.createElement(Modal, { animationType: "fade", transparent: true, visible: true, onRequestClose: onRequestClose },
23
22
  React.createElement(View, { style: styles.wrapper },
24
23
  React.createElement(StatusBar, { barStyle: "dark-content" }),
@@ -8,18 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import React from "react";
11
- import { useIntl } from "react-intl";
12
11
  import { useFormContext } from "react-hook-form";
13
- import { messages } from "./messages";
14
12
  import { ButtonGroup, } from "../../../ButtonGroup";
13
+ import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n";
15
14
  export function FormSaveButton({ primaryAction, loading, label, secondaryActions, setSecondaryActionLoading, onOpenBottomSheet, onCloseBottomSheet, }) {
16
- const { formatMessage } = useIntl();
15
+ const { t } = useAtlantisI18n();
17
16
  const formContext = useFormContext();
18
17
  const buttonActions = useButtonGroupAction(secondaryActions);
19
18
  return (React.createElement(React.Fragment, null,
20
19
  React.createElement(ButtonGroup, { onOpenBottomSheet: onOpenBottomSheet, onCloseBottomSheet: onCloseBottomSheet, allowTapWhenOffline: true }, buttonActions.map((action, index) => {
21
20
  if (index === 0) {
22
- return (React.createElement(ButtonGroup.PrimaryAction, { key: index, onPress: primaryAction, label: label !== null && label !== void 0 ? label : formatMessage(messages.saveButton), loading: loading }));
21
+ return (React.createElement(ButtonGroup.PrimaryAction, { key: index, onPress: primaryAction, label: label !== null && label !== void 0 ? label : t("save"), loading: loading }));
23
22
  }
24
23
  else {
25
24
  return (React.createElement(ButtonGroup.SecondaryAction, { key: index, label: action.label, icon: action.icon, onPress: action.onPress, destructive: action.destructive }));
@@ -37,7 +36,7 @@ export function FormSaveButton({ primaryAction, loading, label, secondaryActions
37
36
  })
38
37
  : [];
39
38
  buttonGroupActionProps.unshift({
40
- label: label !== null && label !== void 0 ? label : formatMessage(messages.saveButton),
39
+ label: label !== null && label !== void 0 ? label : t("save"),
41
40
  onPress: primaryAction,
42
41
  loading: loading,
43
42
  icon: undefined,
@@ -1,24 +1,23 @@
1
1
  import { useCallback } from "react";
2
- import { useIntl } from "react-intl";
3
2
  import { Alert } from "react-native";
4
- import { messages } from "../messages";
3
+ import { useAtlantisI18n } from "../../hooks/useAtlantisI18n";
5
4
  export function useOfflineHandler() {
6
- const { formatMessage } = useIntl();
5
+ const { t } = useAtlantisI18n();
7
6
  const handleOfflineSubmit = useCallback((callback, dismiss) => {
8
7
  return () => {
9
- Alert.alert(formatMessage(messages.unavailableNetworkTitle), formatMessage(messages.unavailableNetworkMessage), [
8
+ Alert.alert(t("networkUnavailableTitle"), t("networkUnavailableDescription"), [
10
9
  {
11
- text: formatMessage(messages.dismissAlertButton),
10
+ text: t("dismiss"),
12
11
  style: "cancel",
13
12
  onPress: dismiss,
14
13
  },
15
14
  {
16
- text: formatMessage(messages.retryAlertButton),
15
+ text: t("tryAgain"),
17
16
  style: "default",
18
17
  onPress: callback,
19
18
  },
20
19
  ]);
21
20
  };
22
- }, [formatMessage]);
21
+ }, [t]);
23
22
  return handleOfflineSubmit;
24
23
  }
@@ -9,8 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import React, { createRef, useCallback, useState } from "react";
11
11
  import { TouchableOpacity, View } from "react-native";
12
- import { useIntl } from "react-intl";
13
- import { messages } from "./messages";
14
12
  import { styles } from "./FormatFile.style";
15
13
  import { MediaView } from "./components/MediaView";
16
14
  import { FormatFileBottomSheet, } from "./components/FormatFileBottomSheet";
@@ -19,6 +17,7 @@ import { acceptedExtensions, videoExtensions } from "./constants";
19
17
  import { StatusCode, } from "./types";
20
18
  import { AtlantisFormatFileContext } from "./context/FormatFileContext";
21
19
  import { createUseCreateThumbnail } from "./utils/createUseCreateThumbnail";
20
+ import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
22
21
  function FormatFileContent({ accessibilityLabel, file, showOverlay, styleInGrid, onUploadComplete, isMedia, }) {
23
22
  return (React.createElement(View, { style: [
24
23
  styles.thumbnailContainer,
@@ -89,7 +88,7 @@ export function FormatFile({ file, accessibilityLabel, accessibilityHint, onTap,
89
88
  }
90
89
  function FormatFileInternal({ file, accessibilityLabel, accessibilityHint, onTap, onRemove, bottomSheetOptionsSuffix, styleInGrid = false, onPreviewPress, testID, createThumbnail: createThumbnailProp, }) {
91
90
  const [showOverlay, setShowOverlay] = useState(file.status !== StatusCode.Completed);
92
- const { formatMessage } = useIntl();
91
+ const { t } = useAtlantisI18n();
93
92
  const bottomSheetRef = createRef();
94
93
  const handlePreviewPress = useCallback(() => {
95
94
  onPreviewPress === null || onPreviewPress === void 0 ? void 0 : onPreviewPress(file);
@@ -100,7 +99,7 @@ function FormatFileInternal({ file, accessibilityLabel, accessibilityHint, onTap
100
99
  const { useCreateThumbnail } = createUseCreateThumbnail(createThumbnail);
101
100
  return (React.createElement(AtlantisFormatFileContext.Provider, { value: { useCreateThumbnail } },
102
101
  React.createElement(View, null,
103
- React.createElement(TouchableOpacity, { accessibilityRole: "imagebutton", accessibilityHint: accessibilityHint !== null && accessibilityHint !== void 0 ? accessibilityHint : formatMessage(messages.defaultAccessibilityHint), onPress: handleOnPress, testID: testID },
102
+ React.createElement(TouchableOpacity, { accessibilityRole: "imagebutton", accessibilityHint: accessibilityHint !== null && accessibilityHint !== void 0 ? accessibilityHint : t("FormatFile.hint"), onPress: handleOnPress, testID: testID },
104
103
  React.createElement(FormatFileContent, { accessibilityLabel: accessibilityLabel, file: file, onUploadComplete: () => setShowOverlay(false), isMedia: !!file.isMedia, styleInGrid: styleInGrid, showOverlay: showOverlay })),
105
104
  React.createElement(FormatFileBottomSheet, { bottomSheetRef: bottomSheetRef, onRemovePress: onRemove, bottomSheetOptionsSuffix: bottomSheetOptionsSuffix, onPreviewPress: file.showPreview ? handlePreviewPress : undefined }))));
106
105
  function handleOnPress() {
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import { View } from "react-native";
3
- import { useIntl } from "react-intl";
4
3
  import { styles } from "./FileView.style";
5
4
  import { Icon } from "../../../Icon";
6
5
  import { Text } from "../../../Text";
@@ -8,13 +7,14 @@ import { StatusCode } from "../../types";
8
7
  import { computeA11yLabel } from "../../utils";
9
8
  import { ProgressBar } from "../ProgressBar";
10
9
  import { ErrorIcon } from "../ErrorIcon";
10
+ import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n";
11
11
  export function FileView({ accessibilityLabel, styleInGrid, file, showOverlay, showError, onUploadComplete, }) {
12
- const { formatMessage } = useIntl();
12
+ const { t } = useAtlantisI18n();
13
13
  const a11yLabel = computeA11yLabel({
14
14
  accessibilityLabel,
15
15
  showOverlay,
16
16
  showError,
17
- formatMessage,
17
+ t,
18
18
  });
19
19
  const freezeProgressBar = file.status !== StatusCode.Completed && file.progress >= 0.9;
20
20
  return (React.createElement(View, { style: [
@@ -1,11 +1,10 @@
1
1
  import React from "react";
2
2
  import { Portal } from "react-native-portalize";
3
- import { useIntl } from "react-intl";
4
- import { messages } from "./messages";
5
3
  import { BottomSheet } from "../../../BottomSheet/BottomSheet";
6
4
  import { BottomSheetOption } from "../../../BottomSheet/components/BottomSheetOption";
5
+ import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n";
7
6
  export const FormatFileBottomSheet = ({ bottomSheetRef, onPreviewPress, onRemovePress, bottomSheetOptionsSuffix, }) => {
8
- const { formatMessage } = useIntl();
7
+ const { t } = useAtlantisI18n();
9
8
  const handlePress = (onPressAction) => {
10
9
  var _a;
11
10
  onPressAction();
@@ -13,10 +12,10 @@ export const FormatFileBottomSheet = ({ bottomSheetRef, onPreviewPress, onRemove
13
12
  };
14
13
  return (React.createElement(Portal, null,
15
14
  React.createElement(BottomSheet, { ref: bottomSheetRef },
16
- onPreviewPress ? (React.createElement(BottomSheetOption, { icon: "eye", text: formatMessage(messages.lightBoxPreviewButton, {
17
- bottomSheetOptionsSuffix,
15
+ onPreviewPress ? (React.createElement(BottomSheetOption, { icon: "eye", text: t("FormatFile.preview", {
16
+ item: bottomSheetOptionsSuffix || "",
18
17
  }), onPress: () => handlePress(onPreviewPress) })) : undefined,
19
- onRemovePress ? (React.createElement(BottomSheetOption, { icon: "trash", destructive: true, text: formatMessage(messages.removeButton, {
20
- bottomSheetOptionsSuffix,
18
+ onRemovePress ? (React.createElement(BottomSheetOption, { icon: "trash", destructive: true, text: t("FormatFile.remove", {
19
+ item: bottomSheetOptionsSuffix || "",
21
20
  }), onPress: () => handlePress(onRemovePress) })) : undefined)));
22
21
  };
@@ -1,6 +1,5 @@
1
1
  import React, { useState } from "react";
2
2
  import { ImageBackground, View } from "react-native";
3
- import { useIntl } from "react-intl";
4
3
  import { styles } from "./MediaView.style";
5
4
  import { StatusCode } from "../../types";
6
5
  import { computeA11yLabel } from "../../utils";
@@ -9,8 +8,9 @@ import { Icon } from "../../../Icon";
9
8
  import { ProgressBar } from "../ProgressBar";
10
9
  import { ErrorIcon } from "../ErrorIcon";
11
10
  import { useAtlantisFormatFileContext } from "../../context/FormatFileContext";
11
+ import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n";
12
12
  export function MediaView({ accessibilityLabel, showOverlay, showError, file, styleInGrid, onUploadComplete, }) {
13
- const { formatMessage } = useIntl();
13
+ const { t } = useAtlantisI18n();
14
14
  const { useCreateThumbnail } = useAtlantisFormatFileContext();
15
15
  const { thumbnail, error } = useCreateThumbnail(file);
16
16
  const [isLoading, setIsLoading] = useState(false);
@@ -18,7 +18,7 @@ export function MediaView({ accessibilityLabel, showOverlay, showError, file, st
18
18
  accessibilityLabel,
19
19
  showOverlay,
20
20
  showError,
21
- formatMessage,
21
+ t,
22
22
  });
23
23
  const hasError = showError || error;
24
24
  const uri = thumbnail || file.thumbnailUrl || file.source;
@@ -1,12 +1,11 @@
1
- import { messages } from "../messages";
2
- export function computeA11yLabel({ accessibilityLabel, showOverlay, showError, formatMessage, }) {
1
+ export function computeA11yLabel({ accessibilityLabel, showOverlay, showError, t, }) {
3
2
  if (!showError && showOverlay) {
4
- return formatMessage(messages.inProgressAccessibilityLabel);
3
+ return t("upload.inProgress");
5
4
  }
6
5
  else if (showError) {
7
- return formatMessage(messages.errorAccessibilityLabel);
6
+ return t("upload.failed");
8
7
  }
9
8
  else {
10
- return (accessibilityLabel || formatMessage(messages.defaultAccessibilityLabel));
9
+ return accessibilityLabel || t("FormatFile.label");
11
10
  }
12
11
  }
@@ -2,10 +2,10 @@ import React, { useState } from "react";
2
2
  import { useIntl } from "react-intl";
3
3
  import { Platform } from "react-native";
4
4
  import { NUMBER_VALIDATION_REGEX, checkLastChar, configureDecimal, convertToNumber, isValidNumber, limitInputWholeDigits, parseGivenInput, } from "./utils";
5
- import { messages } from "./messages";
6
5
  import { useAtlantisContext } from "../AtlantisContext";
7
6
  import { InputText } from "../InputText";
8
7
  import { useFormController } from "../hooks/useFormController";
8
+ import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
9
9
  export const getInternalValue = (props, field, formatNumber) => {
10
10
  var _a, _b;
11
11
  if (!props.value && !field.value)
@@ -72,7 +72,7 @@ export function InputCurrency(props) {
72
72
  setOnChangeAndDisplayValues(value, value);
73
73
  }
74
74
  };
75
- const { formatMessage } = useIntl();
75
+ const { t } = useAtlantisI18n();
76
76
  return (React.createElement(React.Fragment, null,
77
77
  React.createElement(InputText, Object.assign({}, props, { prefix: showCurrencySymbol ? { label: currencySymbol } : undefined, keyboard: getKeyboard(props), value: ((_a = props.value) === null || _a === void 0 ? void 0 : _a.toString()) || displayValue, defaultValue: (_b = props.defaultValue) === null || _b === void 0 ? void 0 : _b.toString(), onChangeText: handleChange, transform: {
78
78
  output: val => {
@@ -80,7 +80,7 @@ export function InputCurrency(props) {
80
80
  },
81
81
  }, validations: Object.assign({ pattern: {
82
82
  value: NUMBER_VALIDATION_REGEX,
83
- message: formatMessage(messages.notANumberError),
83
+ message: t("errors.notANumber"),
84
84
  } }, props.validations), onBlur: () => {
85
85
  var _a;
86
86
  (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props);
@@ -1,13 +1,12 @@
1
1
  import React, { useMemo, useState } from "react";
2
2
  import DateTimePicker from "react-native-modal-datetime-picker";
3
3
  import { Platform } from "react-native";
4
- import { useIntl } from "react-intl";
5
4
  import { utcToZonedTime } from "date-fns-tz";
6
5
  import { format as formatDate } from "date-fns";
7
- import { messages } from "./messages";
8
6
  import { FormField } from "../FormField";
9
7
  import { InputPressable } from "../InputPressable";
10
8
  import { useAtlantisContext } from "../AtlantisContext";
9
+ import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
11
10
  function formatInvalidState(error, invalid) {
12
11
  if (invalid)
13
12
  return invalid;
@@ -33,7 +32,7 @@ export function InputDate(props) {
33
32
  }
34
33
  function InternalInputDate({ clearable = "always", disabled, emptyValueLabel, invalid, maxDate, minDate, placeholder, value, name, onChange, accessibilityLabel, accessibilityHint, }) {
35
34
  const [showPicker, setShowPicker] = useState(false);
36
- const { formatMessage } = useIntl();
35
+ const { t, locale } = useAtlantisI18n();
37
36
  const { timeZone, dateFormat } = useAtlantisContext();
38
37
  const date = useMemo(() => {
39
38
  if (typeof value === "string")
@@ -48,10 +47,10 @@ function InternalInputDate({ clearable = "always", disabled, emptyValueLabel, in
48
47
  return emptyValueLabel;
49
48
  }, [date, emptyValueLabel, timeZone, dateFormat]);
50
49
  const canClearDate = formattedDate === emptyValueLabel ? "never" : clearable;
51
- const placeholderLabel = placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages.datePlaceholder);
50
+ const placeholderLabel = placeholder !== null && placeholder !== void 0 ? placeholder : t("date");
52
51
  return (React.createElement(React.Fragment, null,
53
52
  React.createElement(InputPressable, { clearable: canClearDate, disabled: disabled, invalid: invalid, placeholder: placeholderLabel, prefix: { icon: "calendar" }, value: formattedDate, onClear: handleClear, onPress: showDatePicker, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint }),
54
- React.createElement(DateTimePicker, { testID: "inputDate-datePicker", date: date || undefined, display: display, isVisible: showPicker, maximumDate: maxDate, minimumDate: minDate, mode: "date", onCancel: handleCancel, onConfirm: handleConfirm })));
53
+ 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 })));
55
54
  function showDatePicker() {
56
55
  setShowPicker(true);
57
56
  }
@@ -1,12 +1,11 @@
1
1
  import React from "react";
2
2
  import { Pressable, View } from "react-native";
3
- import { useIntl } from "react-intl";
4
3
  import { styles } from "./ClearAction.style";
5
- import { messages } from "./messages";
6
4
  import { Icon } from "../../../Icon";
5
+ import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n";
7
6
  export function ClearAction({ onPress, hasMarginRight = false, }) {
8
- const { formatMessage } = useIntl();
9
- return (React.createElement(Pressable, { style: [styles.container, hasMarginRight && styles.addedMargin], onPress: onPress, accessibilityLabel: formatMessage(messages.clearTextLabel) },
7
+ const { t } = useAtlantisI18n();
8
+ return (React.createElement(Pressable, { style: [styles.container, hasMarginRight && styles.addedMargin], onPress: onPress, accessibilityLabel: t("InputFieldWrapper.clear") },
10
9
  React.createElement(View, { style: styles.circle },
11
10
  React.createElement(Icon, { size: "small", name: "cross", color: "interactiveSubtle" }))));
12
11
  }