@artsy/palette-mobile 23.14.0 → 24.0.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 (220) hide show
  1. package/dist/Theme.js +16 -11
  2. package/dist/animation/CssTransition.js +71 -26
  3. package/dist/animation/index.js +17 -1
  4. package/dist/constants.js +12 -8
  5. package/dist/elements/ArtsyKeyboardAvoidingView/ArtsyKeyboardAvoidingView.js +116 -69
  6. package/dist/elements/ArtsyKeyboardAvoidingView/index.js +17 -1
  7. package/dist/elements/Autocomplete/Autocomplete.js +32 -23
  8. package/dist/elements/Autocomplete/Autocomplete.tests.js +128 -56
  9. package/dist/elements/Autocomplete/index.js +17 -1
  10. package/dist/elements/Avatar/Avatar.js +20 -15
  11. package/dist/elements/Avatar/Avatar.stories.js +29 -15
  12. package/dist/elements/Avatar/Avatar.tests.js +12 -10
  13. package/dist/elements/Avatar/index.js +17 -1
  14. package/dist/elements/BackButton/BackButton.js +16 -9
  15. package/dist/elements/BackButton/BackButton.stories.js +12 -8
  16. package/dist/elements/BackButton/index.js +17 -1
  17. package/dist/elements/Banner/Banner.js +45 -18
  18. package/dist/elements/Banner/Banner.stories.js +12 -8
  19. package/dist/elements/Banner/index.js +17 -1
  20. package/dist/elements/BorderBox/BorderBox.js +16 -11
  21. package/dist/elements/BorderBox/index.js +17 -1
  22. package/dist/elements/Box/Box.js +16 -14
  23. package/dist/elements/Box/Box.stories.js +21 -15
  24. package/dist/elements/Box/index.js +17 -1
  25. package/dist/elements/Button/Button.js +85 -64
  26. package/dist/elements/Button/Button.stories.js +48 -23
  27. package/dist/elements/Button/CTAButton.js +18 -3
  28. package/dist/elements/Button/FollowButton.js +38 -11
  29. package/dist/elements/Button/LinkButton.js +19 -4
  30. package/dist/elements/Button/colors.js +7 -3
  31. package/dist/elements/Button/index.js +20 -4
  32. package/dist/elements/ButtonNew/Button.js +114 -49
  33. package/dist/elements/ButtonNew/Button.stories.js +64 -38
  34. package/dist/elements/ButtonNew/Button.tests.js +23 -21
  35. package/dist/elements/ButtonNew/CTAButton.js +18 -3
  36. package/dist/elements/ButtonNew/FollowButton.js +36 -9
  37. package/dist/elements/ButtonNew/LinkButton.js +19 -4
  38. package/dist/elements/ButtonNew/colors.js +7 -3
  39. package/dist/elements/ButtonNew/index.js +20 -4
  40. package/dist/elements/Checkbox/Check.js +83 -46
  41. package/dist/elements/Checkbox/Checkbox.js +83 -47
  42. package/dist/elements/Checkbox/Checkbox.stories.js +10 -9
  43. package/dist/elements/Checkbox/index.js +18 -2
  44. package/dist/elements/Chip/Chip.js +23 -18
  45. package/dist/elements/Chip/Chip.stories.js +12 -8
  46. package/dist/elements/Chip/index.js +17 -1
  47. package/dist/elements/ClassTheme/ClassTheme.js +10 -5
  48. package/dist/elements/ClassTheme/index.js +17 -1
  49. package/dist/elements/Collapse/Collapse.js +9 -4
  50. package/dist/elements/Collapse/Collapse.stories.js +13 -9
  51. package/dist/elements/Collapse/index.js +17 -1
  52. package/dist/elements/CollapsibleMenuItem/CollapsibleMenuItem.js +32 -27
  53. package/dist/elements/CollapsibleMenuItem/CollapsibleMenuItem.stories.js +62 -37
  54. package/dist/elements/CollapsibleMenuItem/index.js +17 -1
  55. package/dist/elements/Dialog/Dialog.js +52 -26
  56. package/dist/elements/Dialog/Dialog.stories.js +41 -22
  57. package/dist/elements/Dialog/Dialog.tests.js +33 -31
  58. package/dist/elements/Dialog/index.js +17 -1
  59. package/dist/elements/EntityHeader/EntityHeader.js +42 -15
  60. package/dist/elements/EntityHeader/EntityHeader.stories.js +26 -18
  61. package/dist/elements/EntityHeader/index.js +17 -1
  62. package/dist/elements/Flex/Flex.js +32 -4
  63. package/dist/elements/Flex/index.js +17 -1
  64. package/dist/elements/Header/ArtsyLogoHeader.js +15 -8
  65. package/dist/elements/Header/index.js +17 -1
  66. package/dist/elements/Histogram/Histogram.js +19 -14
  67. package/dist/elements/Histogram/index.js +17 -1
  68. package/dist/elements/Image/Image.js +60 -28
  69. package/dist/elements/Image/Image.stories.js +35 -23
  70. package/dist/elements/Image/__tests__/getImageURL.tests.js +10 -8
  71. package/dist/elements/Image/helpers/getImageURL.js +13 -8
  72. package/dist/elements/Image/index.js +17 -1
  73. package/dist/elements/Input/Input.js +216 -168
  74. package/dist/elements/Input/Input.stories.js +15 -11
  75. package/dist/elements/Input/Input.tests.js +85 -39
  76. package/dist/elements/Input/InputTitle.js +9 -4
  77. package/dist/elements/Input/helpers.js +35 -27
  78. package/dist/elements/Input/index.js +19 -3
  79. package/dist/elements/Input/maskValue.js +25 -9
  80. package/dist/elements/Input/maskValue.tests.js +19 -17
  81. package/dist/elements/Join/Join.js +14 -9
  82. package/dist/elements/Join/index.js +17 -1
  83. package/dist/elements/LazyFlatlist/LazyFlatlist.js +11 -8
  84. package/dist/elements/LazyFlatlist/index.js +18 -2
  85. package/dist/elements/LazyFlatlist/useHasSeenItem.js +19 -12
  86. package/dist/elements/LegacyScreen/LegacyScreen.js +124 -83
  87. package/dist/elements/LegacyScreen/index.js +17 -1
  88. package/dist/elements/LegacyTabs/ContentTabs.js +18 -12
  89. package/dist/elements/LegacyTabs/NavigationalTabs.js +21 -15
  90. package/dist/elements/LegacyTabs/StepTabs.js +25 -19
  91. package/dist/elements/LegacyTabs/Tab.js +31 -19
  92. package/dist/elements/LegacyTabs/TabBarContainer.js +48 -39
  93. package/dist/elements/LegacyTabs/index.js +38 -9
  94. package/dist/elements/List/BulletedItem.js +34 -7
  95. package/dist/elements/List/List.stories.js +12 -8
  96. package/dist/elements/List/index.js +17 -1
  97. package/dist/elements/MeasuredView/MeasuredView.js +18 -12
  98. package/dist/elements/MeasuredView/index.js +17 -1
  99. package/dist/elements/MenuItem/MenuItem.js +14 -9
  100. package/dist/elements/MenuItem/MenuItem.stories.js +9 -5
  101. package/dist/elements/MenuItem/index.js +17 -1
  102. package/dist/elements/Message/Message.js +35 -19
  103. package/dist/elements/Message/Message.stories.d.ts +1 -1
  104. package/dist/elements/Message/Message.stories.js +23 -17
  105. package/dist/elements/Message/Message.tests.js +38 -36
  106. package/dist/elements/Message/index.js +17 -1
  107. package/dist/elements/Pill/Pill.js +116 -138
  108. package/dist/elements/Pill/Pill.stories.js +28 -20
  109. package/dist/elements/Pill/Pill.tests.js +15 -13
  110. package/dist/elements/Pill/index.js +17 -1
  111. package/dist/elements/PopIn/PopIn.js +13 -8
  112. package/dist/elements/PopIn/index.js +17 -1
  113. package/dist/elements/Popover/Popover.js +45 -15
  114. package/dist/elements/Popover/Popover.stories.js +25 -19
  115. package/dist/elements/Popover/index.js +17 -1
  116. package/dist/elements/ProgressBar/ProgressBar.js +68 -23
  117. package/dist/elements/ProgressBar/ProgressBar.stories.js +11 -7
  118. package/dist/elements/ProgressBar/ProgressBar.tests.js +48 -23
  119. package/dist/elements/ProgressBar/index.js +17 -1
  120. package/dist/elements/Radio/RadioButton.js +80 -44
  121. package/dist/elements/Radio/RadioButton.stories.js +17 -13
  122. package/dist/elements/Radio/RadioDot.js +31 -15
  123. package/dist/elements/Radio/index.js +7 -2
  124. package/dist/elements/Screen/Background.js +10 -3
  125. package/dist/elements/Screen/Body.js +37 -10
  126. package/dist/elements/Screen/BottomView.js +17 -9
  127. package/dist/elements/Screen/FloatingHeader.js +36 -9
  128. package/dist/elements/Screen/FullWidthDivider.js +20 -5
  129. package/dist/elements/Screen/FullWidthItem.js +20 -5
  130. package/dist/elements/Screen/Header.js +79 -26
  131. package/dist/elements/Screen/Screen.stories.js +46 -30
  132. package/dist/elements/Screen/ScreenBase.js +39 -11
  133. package/dist/elements/Screen/ScreenFlatList.js +26 -9
  134. package/dist/elements/Screen/ScreenScrollContext.js +21 -15
  135. package/dist/elements/Screen/ScreenScrollView.js +27 -9
  136. package/dist/elements/Screen/StickySubHeader.js +62 -23
  137. package/dist/elements/Screen/constants.js +8 -5
  138. package/dist/elements/Screen/hooks/useListenForScreenScroll.js +13 -9
  139. package/dist/elements/Screen/hooks/useShowLargeTitle.js +19 -14
  140. package/dist/elements/Screen/hooks/useTitleStyles.js +14 -10
  141. package/dist/elements/Screen/index.js +48 -31
  142. package/dist/elements/SearchInput/RoundSearchInput.js +79 -46
  143. package/dist/elements/SearchInput/SearchInput.js +43 -14
  144. package/dist/elements/SearchInput/index.js +18 -2
  145. package/dist/elements/Separator/Separator.js +20 -12
  146. package/dist/elements/Separator/Separator.stories.js +10 -6
  147. package/dist/elements/Separator/ShadowSeparator.js +14 -7
  148. package/dist/elements/Separator/index.js +18 -2
  149. package/dist/elements/SimpleMessage/SimpleMessage.js +47 -11
  150. package/dist/elements/SimpleMessage/index.js +17 -1
  151. package/dist/elements/Skeleton/Skeleton.js +50 -19
  152. package/dist/elements/Skeleton/Skeleton.stories.js +14 -10
  153. package/dist/elements/Skeleton/index.js +17 -1
  154. package/dist/elements/Spacer/Spacer.js +32 -3
  155. package/dist/elements/Spacer/Spacer.stories.js +35 -19
  156. package/dist/elements/Spacer/index.js +17 -1
  157. package/dist/elements/Spinner/Spinner.js +62 -33
  158. package/dist/elements/Spinner/index.js +17 -1
  159. package/dist/elements/Switch/Switch.js +50 -17
  160. package/dist/elements/Switch/Switch.stories.js +31 -14
  161. package/dist/elements/Switch/index.js +17 -1
  162. package/dist/elements/Tabs/SubTabBar.js +29 -20
  163. package/dist/elements/Tabs/TabFlashList.js +24 -12
  164. package/dist/elements/Tabs/TabFlatList.js +24 -12
  165. package/dist/elements/Tabs/TabMasonry.js +24 -12
  166. package/dist/elements/Tabs/TabScrollView.js +27 -14
  167. package/dist/elements/Tabs/Tabs.js +27 -24
  168. package/dist/elements/Tabs/Tabs.stories.js +93 -46
  169. package/dist/elements/Tabs/TabsContainer.js +62 -38
  170. package/dist/elements/Tabs/TabsWithHeader.js +41 -13
  171. package/dist/elements/Tabs/hooks/useListenForTabContentScroll.js +13 -9
  172. package/dist/elements/Tabs/index.js +17 -1
  173. package/dist/elements/Text/LinkText.js +32 -3
  174. package/dist/elements/Text/Text.js +61 -23
  175. package/dist/elements/Text/Text.stories.js +37 -28
  176. package/dist/elements/Text/Text.tests.js +7 -5
  177. package/dist/elements/Text/helpers.js +13 -7
  178. package/dist/elements/Text/index.js +19 -3
  179. package/dist/elements/ToolTip/ToolTip.js +67 -53
  180. package/dist/elements/ToolTip/ToolTip.stories.js +21 -14
  181. package/dist/elements/ToolTip/ToolTip.tests.js +15 -13
  182. package/dist/elements/ToolTip/ToolTipFlyout.js +68 -28
  183. package/dist/elements/ToolTip/index.js +17 -1
  184. package/dist/elements/Touchable/Touchable.js +41 -13
  185. package/dist/elements/Touchable/Touchable.stories.js +13 -9
  186. package/dist/elements/Touchable/TouchableHighlightColor.js +38 -12
  187. package/dist/elements/Touchable/TouchableWithScale.js +38 -11
  188. package/dist/elements/Touchable/index.js +19 -3
  189. package/dist/elements/VisualClue/VisualClue.stories.js +11 -7
  190. package/dist/elements/VisualClue/VisualClueDot.js +24 -14
  191. package/dist/elements/VisualClue/VisualClueText.js +26 -15
  192. package/dist/elements/VisualClue/index.js +18 -2
  193. package/dist/elements/index.js +62 -46
  194. package/dist/index.js +24 -8
  195. package/dist/setupJest.js +11 -6
  196. package/dist/storybook/decorators.js +36 -27
  197. package/dist/storybook/helpers.js +40 -22
  198. package/dist/tokens.js +28 -67
  199. package/dist/types.js +10 -5
  200. package/dist/utils/Wrap.js +16 -8
  201. package/dist/utils/colors.stories.js +31 -25
  202. package/dist/utils/createGeminiUrl.js +28 -22
  203. package/dist/utils/flattenChildren.js +20 -7
  204. package/dist/utils/formatLargeNumber.js +8 -4
  205. package/dist/utils/formatLargeNumbers.tests.js +15 -13
  206. package/dist/utils/hooks/index.js +20 -4
  207. package/dist/utils/hooks/useColor.js +6 -2
  208. package/dist/utils/hooks/useMeasure.js +40 -14
  209. package/dist/utils/hooks/useScreenDimensions.js +31 -20
  210. package/dist/utils/hooks/useSpace.js +6 -2
  211. package/dist/utils/hooks/useTheme.js +31 -23
  212. package/dist/utils/normalizeText.js +11 -6
  213. package/dist/utils/space.stories.js +15 -10
  214. package/dist/utils/tests/flattenChildren.tests.js +8 -6
  215. package/dist/utils/tests/isTestEnvironment.js +5 -1
  216. package/dist/utils/tests/renderWithWrappers.js +15 -7
  217. package/dist/utils/text.js +13 -9
  218. package/dist/utils/types.js +2 -0
  219. package/dist/utils/webTokensToMobile.js +16 -10
  220. package/package.json +30 -36
@@ -1 +1,17 @@
1
- export * from "./Image";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Image"), exports);
@@ -1,151 +1,211 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { EventEmitter } from "events";
3
- import { CloseFillIcon, HideIcon, ShowIcon, TriangleDownIcon } from "@artsy/icons/native";
4
- import { THEME } from "@artsy/palette-tokens";
5
- import themeGet from "@styled-system/theme-get";
6
- import { isArray, isString } from "lodash";
7
- import { forwardRef, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, } from "react";
8
- import { LayoutAnimation, Platform, TextInput, TouchableOpacity, } from "react-native";
9
- import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
10
- import styled from "styled-components";
11
- import { getInputState, getInputVariant, getInputVariants, } from "./helpers";
12
- import { maskValue, unmaskText } from "./maskValue";
13
- import { useTheme } from "../../utils/hooks";
14
- import { useMeasure } from "../../utils/hooks/useMeasure";
15
- import { Flex } from "../Flex";
16
- import { Spinner } from "../Spinner";
17
- import { Text } from "../Text";
18
- import { Touchable } from "../Touchable";
19
- export const inputEvents = new EventEmitter();
20
- export const emitInputClearEvent = () => {
21
- inputEvents.emit("clear");
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
22
5
  };
23
- export const HORIZONTAL_PADDING = 15;
24
- export const INPUT_BORDER_RADIUS = 4;
25
- export const INPUT_MIN_HEIGHT = 56;
26
- export const MULTILINE_INPUT_MIN_HEIGHT = 110;
27
- export const MULTILINE_INPUT_MAX_HEIGHT = 300;
28
- export const LABEL_HEIGHT = 25;
29
- export const LEFT_COMPONENT_WIDTH = 40;
30
- export const SELECT_COMPONENT_WIDTH = 120;
31
- export const Input = forwardRef(({ addClearListener = false, defaultValue, disabled = false, enableClearButton = false, fixedRightPlaceholder, hintText = "What's this?", icon, leftComponentWidth = LEFT_COMPONENT_WIDTH, mask, selectComponentWidth = SELECT_COMPONENT_WIDTH, loading = false, onBlur, onChangeText, onClear, onFocus, onSelectTap, placeholder, secureTextEntry = false, style: styleProp = {}, unit, value: propValue, selectDisplayLabel, ...props }, ref) => {
32
- const { color, theme, space } = useTheme();
33
- const [focused, setIsFocused] = useState(false);
34
- const [delayedFocused, setDelayedFocused] = useState(false);
35
- const [value, setValue] = useState(maskValue({
36
- currentValue: propValue ?? defaultValue,
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }) : function(o, v) {
31
+ o["default"] = v;
32
+ });
33
+ var __importStar = (this && this.__importStar) || (function () {
34
+ var ownKeys = function(o) {
35
+ ownKeys = Object.getOwnPropertyNames || function (o) {
36
+ var ar = [];
37
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
38
+ return ar;
39
+ };
40
+ return ownKeys(o);
41
+ };
42
+ return function (mod) {
43
+ if (mod && mod.__esModule) return mod;
44
+ var result = {};
45
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
46
+ __setModuleDefault(result, mod);
47
+ return result;
48
+ };
49
+ })();
50
+ var __rest = (this && this.__rest) || function (s, e) {
51
+ var t = {};
52
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
53
+ t[p] = s[p];
54
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
55
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
56
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
57
+ t[p[i]] = s[p[i]];
58
+ }
59
+ return t;
60
+ };
61
+ var __importDefault = (this && this.__importDefault) || function (mod) {
62
+ return (mod && mod.__esModule) ? mod : { "default": mod };
63
+ };
64
+ Object.defineProperty(exports, "__esModule", { value: true });
65
+ exports.Input = exports.SELECT_COMPONENT_WIDTH = exports.LEFT_COMPONENT_WIDTH = exports.LABEL_HEIGHT = exports.MULTILINE_INPUT_MAX_HEIGHT = exports.MULTILINE_INPUT_MIN_HEIGHT = exports.INPUT_MIN_HEIGHT = exports.INPUT_BORDER_RADIUS = exports.HORIZONTAL_PADDING = exports.emitInputClearEvent = exports.inputEvents = void 0;
66
+ var jsx_runtime_1 = require("react/jsx-runtime");
67
+ var events_1 = require("events");
68
+ var native_1 = require("@artsy/icons/native");
69
+ var palette_tokens_1 = require("@artsy/palette-tokens");
70
+ var theme_get_1 = __importDefault(require("@styled-system/theme-get"));
71
+ var lodash_1 = require("lodash");
72
+ var react_1 = require("react");
73
+ var react_native_1 = require("react-native");
74
+ var react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
75
+ var styled_components_1 = __importDefault(require("styled-components"));
76
+ var helpers_1 = require("./helpers");
77
+ var maskValue_1 = require("./maskValue");
78
+ var hooks_1 = require("../../utils/hooks");
79
+ var useMeasure_1 = require("../../utils/hooks/useMeasure");
80
+ var Flex_1 = require("../Flex");
81
+ var Spinner_1 = require("../Spinner");
82
+ var Text_1 = require("../Text");
83
+ var Touchable_1 = require("../Touchable");
84
+ exports.inputEvents = new events_1.EventEmitter();
85
+ var emitInputClearEvent = function () {
86
+ exports.inputEvents.emit("clear");
87
+ };
88
+ exports.emitInputClearEvent = emitInputClearEvent;
89
+ exports.HORIZONTAL_PADDING = 15;
90
+ exports.INPUT_BORDER_RADIUS = 4;
91
+ exports.INPUT_MIN_HEIGHT = 56;
92
+ exports.MULTILINE_INPUT_MIN_HEIGHT = 110;
93
+ exports.MULTILINE_INPUT_MAX_HEIGHT = 300;
94
+ exports.LABEL_HEIGHT = 25;
95
+ exports.LEFT_COMPONENT_WIDTH = 40;
96
+ exports.SELECT_COMPONENT_WIDTH = 120;
97
+ exports.Input = (0, react_1.forwardRef)(function (_a, ref) {
98
+ var _b = _a.addClearListener, addClearListener = _b === void 0 ? false : _b, defaultValue = _a.defaultValue, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.enableClearButton, enableClearButton = _d === void 0 ? false : _d, fixedRightPlaceholder = _a.fixedRightPlaceholder, _e = _a.hintText, hintText = _e === void 0 ? "What's this?" : _e, icon = _a.icon, _f = _a.leftComponentWidth, leftComponentWidth = _f === void 0 ? exports.LEFT_COMPONENT_WIDTH : _f, mask = _a.mask, _g = _a.selectComponentWidth, selectComponentWidth = _g === void 0 ? exports.SELECT_COMPONENT_WIDTH : _g, _h = _a.loading, loading = _h === void 0 ? false : _h, onBlur = _a.onBlur, onChangeText = _a.onChangeText, onClear = _a.onClear, onFocus = _a.onFocus, onSelectTap = _a.onSelectTap, placeholder = _a.placeholder, _j = _a.secureTextEntry, secureTextEntry = _j === void 0 ? false : _j, _k = _a.style, styleProp = _k === void 0 ? {} : _k, unit = _a.unit, propValue = _a.value, selectDisplayLabel = _a.selectDisplayLabel, props = __rest(_a, ["addClearListener", "defaultValue", "disabled", "enableClearButton", "fixedRightPlaceholder", "hintText", "icon", "leftComponentWidth", "mask", "selectComponentWidth", "loading", "onBlur", "onChangeText", "onClear", "onFocus", "onSelectTap", "placeholder", "secureTextEntry", "style", "unit", "value", "selectDisplayLabel"]);
99
+ var _l = (0, hooks_1.useTheme)(), color = _l.color, theme = _l.theme, space = _l.space;
100
+ var _m = (0, react_1.useState)(false), focused = _m[0], setIsFocused = _m[1];
101
+ var _o = (0, react_1.useState)(false), delayedFocused = _o[0], setDelayedFocused = _o[1];
102
+ var _p = (0, react_1.useState)((0, maskValue_1.maskValue)({
103
+ currentValue: propValue !== null && propValue !== void 0 ? propValue : defaultValue,
37
104
  mask: mask,
38
- }));
39
- const [showPassword, setShowPassword] = useState(!secureTextEntry);
40
- const [inputWidth, setInputWidth] = useState(0);
41
- const placeholderWidths = useRef([]);
42
- const rightComponentRef = useRef(null);
43
- const inputRef = useRef(null);
44
- const variant = getInputVariant({
105
+ })), value = _p[0], setValue = _p[1];
106
+ var _q = (0, react_1.useState)(!secureTextEntry), showPassword = _q[0], setShowPassword = _q[1];
107
+ var _r = (0, react_1.useState)(0), inputWidth = _r[0], setInputWidth = _r[1];
108
+ var placeholderWidths = (0, react_1.useRef)([]);
109
+ var rightComponentRef = (0, react_1.useRef)(null);
110
+ var inputRef = (0, react_1.useRef)(null);
111
+ var variant = (0, helpers_1.getInputVariant)({
45
112
  hasError: !!props.error,
46
113
  disabled: disabled,
47
114
  });
48
- const hasLeftComponent = useMemo(() => !!unit || !!icon || !!onSelectTap, [unit, icon, onSelectTap]);
49
- const animatedState = useSharedValue(getInputState({
115
+ var hasLeftComponent = (0, react_1.useMemo)(function () { return !!unit || !!icon || !!onSelectTap; }, [unit, icon, onSelectTap]);
116
+ var animatedState = (0, react_native_reanimated_1.useSharedValue)((0, helpers_1.getInputState)({
50
117
  isFocused: !!focused,
51
118
  value: value,
52
119
  }));
53
- useImperativeHandle(ref, () => inputRef.current);
54
- useEffect(() => {
120
+ (0, react_1.useImperativeHandle)(ref, function () { return inputRef.current; });
121
+ (0, react_1.useEffect)(function () {
55
122
  // If the prop value changes, update the local state
56
123
  // This optimisation is not needed if no propValue has been specified
57
124
  if (propValue !== undefined && propValue !== value) {
58
- setValue(maskValue({ currentValue: propValue || "", mask }));
125
+ setValue((0, maskValue_1.maskValue)({ currentValue: propValue || "", mask: mask }));
59
126
  }
60
127
  }, [propValue, value, mask]);
61
- useEffect(() => {
128
+ (0, react_1.useEffect)(function () {
62
129
  // If the mask value changes, update the value state to be formatted again
63
- setValue(maskValue({ currentValue: value, mask }));
130
+ setValue((0, maskValue_1.maskValue)({ currentValue: value, mask: mask }));
64
131
  // eslint-disable-next-line react-hooks/exhaustive-deps
65
132
  }, [mask]);
66
- const fontFamily = theme.fonts.sans.regular;
67
- useEffect(() => {
133
+ var fontFamily = theme.fonts.sans.regular;
134
+ (0, react_1.useEffect)(function () {
135
+ var _a;
68
136
  /* to make the font work for secure text inputs,
69
137
  see https://github.com/facebook/react-native/issues/30123#issuecomment-711076098 */
70
- inputRef.current?.setNativeProps({
71
- style: { fontFamily },
138
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.setNativeProps({
139
+ style: { fontFamily: fontFamily },
72
140
  });
73
141
  }, [fontFamily]);
74
- useEffect(() => {
142
+ (0, react_1.useEffect)(function () {
75
143
  // We don't need to delay hiding the placeholder
76
144
  if (!focused && delayedFocused) {
77
145
  setDelayedFocused(false);
78
146
  }
79
- let delayFocusedTimeout;
147
+ var delayFocusedTimeout;
80
148
  // We only want to show the placeholder after we're sure the title animation has finished
81
149
  if (!delayedFocused && focused) {
82
- delayFocusedTimeout = setTimeout(() => {
150
+ delayFocusedTimeout = setTimeout(function () {
83
151
  setDelayedFocused(focused);
84
152
  }, 200);
85
153
  }
86
- return () => {
154
+ return function () {
87
155
  if (delayFocusedTimeout) {
88
156
  clearTimeout(delayFocusedTimeout);
89
157
  }
90
158
  };
91
159
  }, [focused, delayedFocused]);
92
- const handleChangeText = useCallback((text) => {
160
+ var handleChangeText = (0, react_1.useCallback)(function (text) {
93
161
  if (mask) {
94
- const newText = maskValue({ currentValue: text, mask: mask, previousValue: value }) || "";
162
+ var newText = (0, maskValue_1.maskValue)({ currentValue: text, mask: mask, previousValue: value }) || "";
95
163
  setValue(newText);
96
- onChangeText?.(newText, unmaskText(text));
164
+ onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(newText, (0, maskValue_1.unmaskText)(text));
97
165
  }
98
166
  else {
99
167
  setValue(text);
100
- onChangeText?.(text);
168
+ onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
101
169
  }
102
170
  }, [onChangeText, value, mask]);
103
- const handleClear = useCallback(() => {
104
- LayoutAnimation.configureNext({ ...LayoutAnimation.Presets.easeInEaseOut, duration: 200 });
105
- inputRef.current?.clear();
171
+ var handleClear = (0, react_1.useCallback)(function () {
172
+ var _a;
173
+ react_native_1.LayoutAnimation.configureNext(__assign(__assign({}, react_native_1.LayoutAnimation.Presets.easeInEaseOut), { duration: 200 }));
174
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.clear();
106
175
  handleChangeText("");
107
- onClear?.();
176
+ onClear === null || onClear === void 0 ? void 0 : onClear();
108
177
  }, [onClear, handleChangeText]);
109
- useEffect(() => {
178
+ (0, react_1.useEffect)(function () {
110
179
  if (!addClearListener) {
111
180
  return;
112
181
  }
113
- inputEvents.addListener("clear", handleClear);
114
- return () => {
115
- inputEvents.removeListener("clear", handleClear);
182
+ exports.inputEvents.addListener("clear", handleClear);
183
+ return function () {
184
+ exports.inputEvents.removeListener("clear", handleClear);
116
185
  };
117
186
  }, [addClearListener, handleClear]);
118
- const { width: rightComponentWidth = 0 } = useMeasure({ ref: rightComponentRef });
119
- useLayoutEffect(() => {
120
- inputRef.current?.measureInWindow((_x, _y, width) => {
187
+ var _s = (0, useMeasure_1.useMeasure)({ ref: rightComponentRef }).width, rightComponentWidth = _s === void 0 ? 0 : _s;
188
+ (0, react_1.useLayoutEffect)(function () {
189
+ var _a;
190
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.measureInWindow(function (_x, _y, width) {
121
191
  if (width > 0 && width !== inputWidth) {
122
192
  setInputWidth(width);
123
193
  }
124
194
  });
125
195
  }, []);
126
- const textInputPaddingLeft = useMemo(() => {
196
+ var textInputPaddingLeft = (0, react_1.useMemo)(function () {
127
197
  if (!hasLeftComponent) {
128
- return HORIZONTAL_PADDING;
198
+ return exports.HORIZONTAL_PADDING;
129
199
  }
130
200
  if (onSelectTap) {
131
- return selectComponentWidth + HORIZONTAL_PADDING;
201
+ return selectComponentWidth + exports.HORIZONTAL_PADDING;
132
202
  }
133
203
  return leftComponentWidth;
134
204
  }, [hasLeftComponent, leftComponentWidth, onSelectTap, selectComponentWidth]);
135
- const styles = useMemo(() => {
136
- return {
137
- fontFamily: fontFamily,
138
- fontSize: parseInt(THEME.textVariants["sm-display"].fontSize, 10),
139
- minHeight: props.multiline ? MULTILINE_INPUT_MIN_HEIGHT : INPUT_MIN_HEIGHT,
140
- maxHeight: props.multiline ? MULTILINE_INPUT_MAX_HEIGHT : undefined,
141
- height: props.multiline ? MULTILINE_INPUT_MIN_HEIGHT : undefined,
142
- borderWidth: 1,
143
- paddingRight: rightComponentWidth + HORIZONTAL_PADDING,
144
- paddingLeft: textInputPaddingLeft,
145
- ...styleProp,
146
- };
205
+ var styles = (0, react_1.useMemo)(function () {
206
+ return __assign({ fontFamily: fontFamily, fontSize: parseInt(palette_tokens_1.THEME.textVariants["sm-display"].fontSize, 10), minHeight: props.multiline ? exports.MULTILINE_INPUT_MIN_HEIGHT : exports.INPUT_MIN_HEIGHT, maxHeight: props.multiline ? exports.MULTILINE_INPUT_MAX_HEIGHT : undefined, height: props.multiline ? exports.MULTILINE_INPUT_MIN_HEIGHT : undefined, borderWidth: 1, paddingRight: rightComponentWidth + exports.HORIZONTAL_PADDING, paddingLeft: textInputPaddingLeft }, styleProp);
147
207
  }, [fontFamily, styleProp, props.multiline, rightComponentWidth, textInputPaddingLeft]);
148
- const labelStyles = useMemo(() => {
208
+ var labelStyles = (0, react_1.useMemo)(function () {
149
209
  return {
150
210
  // this is neeeded too make sure the label is on top of the input
151
211
  backgroundColor: color("background"),
@@ -154,73 +214,69 @@ export const Input = forwardRef(({ addClearListener = false, defaultValue, disab
154
214
  fontFamily: fontFamily,
155
215
  };
156
216
  }, [fontFamily, space, color]);
157
- const inputVariants = useMemo(() => getInputVariants(theme), [theme]);
158
- useEffect(() => {
159
- const inputState = getInputState({
217
+ var inputVariants = (0, react_1.useMemo)(function () { return (0, helpers_1.getInputVariants)(theme); }, [theme]);
218
+ (0, react_1.useEffect)(function () {
219
+ var inputState = (0, helpers_1.getInputState)({
160
220
  isFocused: !!focused,
161
221
  value: value,
162
222
  });
163
- animatedState.set(() => inputState);
223
+ animatedState.set(function () { return inputState; });
164
224
  }, [value, focused, animatedState]);
165
- const textInputAnimatedStyles = useAnimatedStyle(() => {
225
+ var textInputAnimatedStyles = (0, react_native_reanimated_1.useAnimatedStyle)(function () {
166
226
  return {
167
- borderColor: withTiming(inputVariants[variant][animatedState.get()].inputBorderColor),
168
- color: withTiming(inputVariants[variant][animatedState.get()].inputTextColor),
227
+ borderColor: (0, react_native_reanimated_1.withTiming)(inputVariants[variant][animatedState.get()].inputBorderColor),
228
+ color: (0, react_native_reanimated_1.withTiming)(inputVariants[variant][animatedState.get()].inputTextColor),
169
229
  };
170
230
  });
171
- const labelAnimatedStyles = useAnimatedStyle(() => {
172
- const hasValue = !!value;
231
+ var labelAnimatedStyles = (0, react_native_reanimated_1.useAnimatedStyle)(function () {
232
+ var hasValue = !!value;
173
233
  // Only add a margin if the input has a left component and it is not focused and has no value
174
- const marginLeft = textInputPaddingLeft && !focused && !hasValue
234
+ var marginLeft = textInputPaddingLeft && !focused && !hasValue
175
235
  ? textInputPaddingLeft - 3
176
- : HORIZONTAL_PADDING;
236
+ : exports.HORIZONTAL_PADDING;
177
237
  return {
178
- color: withTiming(inputVariants[variant][animatedState.get()].labelColor),
179
- top: withTiming(inputVariants[variant][animatedState.get()].labelTop),
180
- fontSize: withTiming(inputVariants[variant][animatedState.get()].labelFontSize),
181
- marginLeft: withTiming(marginLeft),
238
+ color: (0, react_native_reanimated_1.withTiming)(inputVariants[variant][animatedState.get()].labelColor),
239
+ top: (0, react_native_reanimated_1.withTiming)(inputVariants[variant][animatedState.get()].labelTop),
240
+ fontSize: (0, react_native_reanimated_1.withTiming)(inputVariants[variant][animatedState.get()].labelFontSize),
241
+ marginLeft: (0, react_native_reanimated_1.withTiming)(marginLeft),
182
242
  };
183
243
  });
184
- const selectComponentStyles = useAnimatedStyle(() => {
244
+ var selectComponentStyles = (0, react_native_reanimated_1.useAnimatedStyle)(function () {
185
245
  return {
186
- borderColor: withTiming(inputVariants[variant][animatedState.get()].inputBorderColor),
246
+ borderColor: (0, react_native_reanimated_1.withTiming)(inputVariants[variant][animatedState.get()].inputBorderColor),
187
247
  };
188
248
  });
189
- const handleFocus = (e) => {
249
+ var handleFocus = function (e) {
190
250
  setIsFocused(true);
191
- onFocus?.(e);
251
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
192
252
  };
193
- const handleBlur = (e) => {
253
+ var handleBlur = function (e) {
194
254
  setIsFocused(false);
195
- onBlur?.(e);
255
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
196
256
  };
197
- const hasTitle = !!props.title;
198
- const renderLeftComponent = useCallback(() => {
199
- const leftComponentSharedStyles = {
257
+ var hasTitle = !!props.title;
258
+ var renderLeftComponent = (0, react_1.useCallback)(function () {
259
+ var leftComponentSharedStyles = {
200
260
  position: "absolute",
201
- paddingHorizontal: HORIZONTAL_PADDING,
202
- height: INPUT_MIN_HEIGHT,
203
- top: hasTitle ? LABEL_HEIGHT : 0,
261
+ paddingHorizontal: exports.HORIZONTAL_PADDING,
262
+ height: exports.INPUT_MIN_HEIGHT,
263
+ top: hasTitle ? exports.LABEL_HEIGHT : 0,
204
264
  alignItems: "center",
205
265
  zIndex: 100,
206
266
  };
207
267
  if (unit || icon) {
208
- return (_jsxs(Flex, { style: {
209
- ...leftComponentSharedStyles,
210
- justifyContent: "center",
211
- width: leftComponentWidth,
212
- }, children: [unit && (_jsx(Text, { color: disabled ? "mono30" : "mono60", variant: "sm-display", children: unit })), icon] }));
268
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { style: __assign(__assign({}, leftComponentSharedStyles), { justifyContent: "center", width: leftComponentWidth }), children: [unit && ((0, jsx_runtime_1.jsx)(Text_1.Text, { color: disabled ? "mono30" : "mono60", variant: "sm-display", children: unit })), icon] }));
213
269
  }
214
270
  if (onSelectTap) {
215
- return (_jsx(TouchableOpacity, { accessibilityRole: "button", onPress: onSelectTap, style: [
271
+ return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { accessibilityRole: "button", onPress: onSelectTap, style: [
216
272
  leftComponentSharedStyles,
217
273
  {
218
274
  width: selectComponentWidth,
219
275
  },
220
- ], hitSlop: { top: 10, right: 10, bottom: 10, left: 10 }, children: _jsxs(AnimatedFlex, { style: [
276
+ ], hitSlop: { top: 10, right: 10, bottom: 10, left: 10 }, children: (0, jsx_runtime_1.jsxs)(AnimatedFlex, { style: [
221
277
  {
222
- paddingHorizontal: HORIZONTAL_PADDING,
223
- height: INPUT_MIN_HEIGHT,
278
+ paddingHorizontal: exports.HORIZONTAL_PADDING,
279
+ height: exports.INPUT_MIN_HEIGHT,
224
280
  alignItems: "center",
225
281
  width: selectComponentWidth,
226
282
  flexDirection: "row",
@@ -228,7 +284,7 @@ export const Input = forwardRef(({ addClearListener = false, defaultValue, disab
228
284
  justifyContent: "space-between",
229
285
  },
230
286
  selectComponentStyles,
231
- ], children: [_jsx(Text, { color: disabled ? "mono30" : "mono100", children: selectDisplayLabel }), _jsx(TriangleDownIcon, { fill: "mono60", width: 10 })] }) }));
287
+ ], children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { color: disabled ? "mono30" : "mono100", children: selectDisplayLabel }), (0, jsx_runtime_1.jsx)(native_1.TriangleDownIcon, { fill: "mono60", width: 10 })] }) }));
232
288
  }
233
289
  return null;
234
290
  }, [
@@ -242,28 +298,25 @@ export const Input = forwardRef(({ addClearListener = false, defaultValue, disab
242
298
  selectComponentStyles,
243
299
  selectDisplayLabel,
244
300
  ]);
245
- const renderRightComponent = useCallback(() => {
301
+ var renderRightComponent = (0, react_1.useCallback)(function () {
246
302
  if (fixedRightPlaceholder) {
247
- return (_jsx(Flex, { justifyContent: "center", position: "absolute", right: `${HORIZONTAL_PADDING}px`, top: hasTitle ? LABEL_HEIGHT : 0, height: INPUT_MIN_HEIGHT, ref: rightComponentRef, children: _jsx(Text, { color: disabled ? "mono30" : "mono60", children: fixedRightPlaceholder }) }));
303
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { justifyContent: "center", position: "absolute", right: "".concat(exports.HORIZONTAL_PADDING, "px"), top: hasTitle ? exports.LABEL_HEIGHT : 0, height: exports.INPUT_MIN_HEIGHT, ref: rightComponentRef, children: (0, jsx_runtime_1.jsx)(Text_1.Text, { color: disabled ? "mono30" : "mono60", children: fixedRightPlaceholder }) }));
248
304
  }
249
305
  if (loading) {
250
- return (_jsx(Flex, { justifyContent: "center", position: "absolute", right: `${HORIZONTAL_PADDING}px`, top: hasTitle ? LABEL_HEIGHT : 0, height: INPUT_MIN_HEIGHT, ref: rightComponentRef, children: _jsx(Spinner, { size: "medium", style: {
306
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { justifyContent: "center", position: "absolute", right: "".concat(exports.HORIZONTAL_PADDING, "px"), top: hasTitle ? exports.LABEL_HEIGHT : 0, height: exports.INPUT_MIN_HEIGHT, ref: rightComponentRef, children: (0, jsx_runtime_1.jsx)(Spinner_1.Spinner, { size: "medium", style: {
251
307
  right: 0,
252
308
  width: 15,
253
309
  backgroundColor: color("mono60"),
254
310
  } }) }));
255
311
  }
256
312
  if (enableClearButton && value) {
257
- return (_jsx(Flex, { justifyContent: "center", position: "absolute", right: `${HORIZONTAL_PADDING}px`, top: hasTitle ? LABEL_HEIGHT : 0, height: INPUT_MIN_HEIGHT, zIndex: 100, ref: rightComponentRef, children: _jsx(Touchable, { haptic: "impactMedium", onPress: handleClear, hitSlop: { bottom: 40, right: 40, left: 0, top: 40 }, accessibilityRole: "button", accessibilityHint: "Clears the input", accessibilityLabel: "Clear", testID: "clear-input-button", children: _jsx(CloseFillIcon, { fill: "mono30" }) }) }));
313
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { justifyContent: "center", position: "absolute", right: "".concat(exports.HORIZONTAL_PADDING, "px"), top: hasTitle ? exports.LABEL_HEIGHT : 0, height: exports.INPUT_MIN_HEIGHT, zIndex: 100, ref: rightComponentRef, children: (0, jsx_runtime_1.jsx)(Touchable_1.Touchable, { haptic: "impactMedium", onPress: handleClear, hitSlop: { bottom: 40, right: 40, left: 0, top: 40 }, accessibilityRole: "button", accessibilityHint: "Clears the input", accessibilityLabel: "Clear", testID: "clear-input-button", children: (0, jsx_runtime_1.jsx)(native_1.CloseFillIcon, { fill: "mono30" }) }) }));
258
314
  }
259
315
  if (secureTextEntry) {
260
- return (_jsx(Flex, { justifyContent: "center", position: "absolute", right: `${HORIZONTAL_PADDING}px`, top: hasTitle ? LABEL_HEIGHT : 0, height: INPUT_MIN_HEIGHT, zIndex: 100, ref: rightComponentRef, children: _jsx(Touchable, { haptic: true, onPress: () => {
261
- LayoutAnimation.configureNext({
262
- ...LayoutAnimation.Presets.easeInEaseOut,
263
- duration: 200,
264
- });
316
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { justifyContent: "center", position: "absolute", right: "".concat(exports.HORIZONTAL_PADDING, "px"), top: hasTitle ? exports.LABEL_HEIGHT : 0, height: exports.INPUT_MIN_HEIGHT, zIndex: 100, ref: rightComponentRef, children: (0, jsx_runtime_1.jsx)(Touchable_1.Touchable, { haptic: true, onPress: function () {
317
+ react_native_1.LayoutAnimation.configureNext(__assign(__assign({}, react_native_1.LayoutAnimation.Presets.easeInEaseOut), { duration: 200 }));
265
318
  setShowPassword(!showPassword);
266
- }, accessibilityRole: "button", accessibilityLabel: showPassword ? "hide password icon" : "show password icon", accessibilityHint: showPassword ? "Hides the password" : "Shows the password", hitSlop: { bottom: 40, right: 40, left: 0, top: 40 }, children: !showPassword ? _jsx(HideIcon, { fill: "mono30" }) : _jsx(ShowIcon, { fill: "mono60" }) }) }));
319
+ }, accessibilityRole: "button", accessibilityLabel: showPassword ? "hide password icon" : "show password icon", accessibilityHint: showPassword ? "Hides the password" : "Shows the password", hitSlop: { bottom: 40, right: 40, left: 0, top: 40 }, children: !showPassword ? (0, jsx_runtime_1.jsx)(native_1.HideIcon, { fill: "mono30" }) : (0, jsx_runtime_1.jsx)(native_1.ShowIcon, { fill: "mono60" }) }) }));
267
320
  }
268
321
  return null;
269
322
  }, [
@@ -278,41 +331,41 @@ export const Input = forwardRef(({ addClearListener = false, defaultValue, disab
278
331
  handleClear,
279
332
  showPassword,
280
333
  ]);
281
- const renderBottomComponent = useCallback(() => {
334
+ var renderBottomComponent = (0, react_1.useCallback)(function () {
282
335
  if (!!props.error) {
283
- return (_jsx(Text, { color: "red100", variant: "xs", px: `${HORIZONTAL_PADDING}px`, mt: 0.5, children: props.error }));
336
+ return ((0, jsx_runtime_1.jsx)(Text_1.Text, { color: "red100", variant: "xs", px: "".concat(exports.HORIZONTAL_PADDING, "px"), mt: 0.5, children: props.error }));
284
337
  }
285
- return (_jsxs(Flex, { flexDirection: "row", justifyContent: "space-between", children: [!!props.required || !!props.optional ? (_jsxs(Text, { color: "mono60", variant: "xs", pl: `${HORIZONTAL_PADDING}px`, mt: 0.5, children: [!!props.required && "* Required", !!props.optional && "* Optional"] })) : (
338
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", justifyContent: "space-between", children: [!!props.required || !!props.optional ? ((0, jsx_runtime_1.jsxs)(Text_1.Text, { color: "mono60", variant: "xs", pl: "".concat(exports.HORIZONTAL_PADDING, "px"), mt: 0.5, children: [!!props.required && "* Required", !!props.optional && "* Optional"] })) : (
286
339
  // Adding this empty flex to make sure that the maxLength text is always on the right
287
- _jsx(Flex, {})), !!props.maxLength && !!props.showLimit && (_jsxs(Text, { color: "mono60", variant: "xs", pr: `${HORIZONTAL_PADDING}px`, mt: 0.5, children: [(value || "").length, " / ", props.maxLength] }))] }));
340
+ (0, jsx_runtime_1.jsx)(Flex_1.Flex, {})), !!props.maxLength && !!props.showLimit && ((0, jsx_runtime_1.jsxs)(Text_1.Text, { color: "mono60", variant: "xs", pr: "".concat(exports.HORIZONTAL_PADDING, "px"), mt: 0.5, children: [(value || "").length, " / ", props.maxLength] }))] }));
288
341
  }, [props.error, props.maxLength, props.optional, props.required, props.showLimit, value]);
289
- const renderHint = useCallback(() => {
342
+ var renderHint = (0, react_1.useCallback)(function () {
290
343
  if (!props.onHintPress) {
291
344
  return null;
292
345
  }
293
- return (_jsx(Flex, { style: {
346
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { style: {
294
347
  alignItems: "flex-end",
295
348
  top: space(2),
296
- }, children: _jsx(Touchable, { accessibilityRole: "button", accessibilityHint: "hint", onPress: props.onHintPress, haptic: "impactLight", hitSlop: {
349
+ }, children: (0, jsx_runtime_1.jsx)(Touchable_1.Touchable, { accessibilityRole: "button", accessibilityHint: "hint", onPress: props.onHintPress, haptic: "impactLight", hitSlop: {
297
350
  top: 5,
298
351
  right: 10,
299
352
  bottom: 5,
300
353
  left: 10,
301
- }, children: _jsx(Text, { underline: true, variant: "xs", color: "mono60", children: hintText }) }) }));
354
+ }, children: (0, jsx_runtime_1.jsx)(Text_1.Text, { underline: true, variant: "xs", color: "mono60", children: hintText }) }) }));
302
355
  }, [hintText, props.onHintPress, space]);
303
- const getPlatformSpecificPlaceholder = useCallback(() => {
356
+ var getPlatformSpecificPlaceholder = (0, react_1.useCallback)(function () {
304
357
  if (!placeholder) {
305
358
  return "";
306
359
  }
307
- if (Platform.OS === "ios") {
308
- return isArray(placeholder) ? placeholder[0] : placeholder;
360
+ if (react_native_1.Platform.OS === "ios") {
361
+ return (0, lodash_1.isArray)(placeholder) ? placeholder[0] : placeholder;
309
362
  }
310
363
  // if it's android and we only have one string, return that string
311
- if (isString(placeholder)) {
364
+ if ((0, lodash_1.isString)(placeholder)) {
312
365
  return placeholder;
313
366
  }
314
367
  // otherwise, find a placeholder that has longest width that fits in the inputtext
315
- const longestFittingStringIndex = placeholderWidths.current.findIndex((placeholderWidth) => {
368
+ var longestFittingStringIndex = placeholderWidths.current.findIndex(function (placeholderWidth) {
316
369
  return placeholderWidth <= inputWidth;
317
370
  });
318
371
  if (longestFittingStringIndex > -1) {
@@ -321,7 +374,7 @@ export const Input = forwardRef(({ addClearListener = false, defaultValue, disab
321
374
  // otherwise just return the shortest placeholder
322
375
  return placeholder[placeholder.length - 1];
323
376
  }, [inputWidth, placeholder]);
324
- const getPlaceholder = useCallback(() => {
377
+ var getPlaceholder = (0, react_1.useCallback)(function () {
325
378
  // Show placeholder always if there is no title
326
379
  // This is because we won't have a title animation
327
380
  if (!props.title) {
@@ -338,40 +391,35 @@ export const Input = forwardRef(({ addClearListener = false, defaultValue, disab
338
391
  // On focus, we want to show the placeholder after the title animation has finished
339
392
  return "";
340
393
  }, [delayedFocused, getPlatformSpecificPlaceholder, props.title, props.multiline]);
341
- const renderAnimatedTitle = useCallback(() => {
394
+ var renderAnimatedTitle = (0, react_1.useCallback)(function () {
342
395
  if (!props.title) {
343
396
  return null;
344
397
  }
345
- return (_jsx(Flex, { flexDirection: "row", zIndex: 100, pointerEvents: "none", height: LABEL_HEIGHT, children: _jsxs(AnimatedText, { style: [labelStyles, labelAnimatedStyles], numberOfLines: 1, accessibilityLabel: "input label", children: [" ", props.title, " "] }) }));
398
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "row", zIndex: 100, pointerEvents: "none", height: exports.LABEL_HEIGHT, children: (0, jsx_runtime_1.jsxs)(AnimatedText, { style: [labelStyles, labelAnimatedStyles], numberOfLines: 1, accessibilityLabel: "input label", children: [" ", props.title, " "] }) }));
346
399
  }, [labelStyles, labelAnimatedStyles, props.title]);
347
- const renderAndroidPlaceholderMeasuringHack = useCallback(() => {
348
- if (Platform.OS === "ios" || !isArray(placeholder)) {
400
+ var renderAndroidPlaceholderMeasuringHack = (0, react_1.useCallback)(function () {
401
+ if (react_native_1.Platform.OS === "ios" || !(0, lodash_1.isArray)(placeholder)) {
349
402
  return null;
350
403
  }
351
404
  // Do not render the hack if we have already measured the placeholder
352
405
  if (placeholderWidths.current.length > 0) {
353
406
  return null;
354
407
  }
355
- return (_jsx(Flex, { style: {
408
+ return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { style: {
356
409
  position: "absolute",
357
410
  top: -10000, // make sure its off the screen
358
411
  width: 10000, // make sure Texts can take as much space as they need
359
412
  alignItems: "baseline", // this is to make Texts get the smallest width they can get to fit the text
360
- }, children: placeholder.map((placeholderString, index) => (_jsx(Text, { onLayout: (event) => {
413
+ }, children: placeholder.map(function (placeholderString, index) { return ((0, jsx_runtime_1.jsx)(Text_1.Text, { onLayout: function (event) {
361
414
  placeholderWidths.current[index] = event.nativeEvent.layout.width;
362
- }, numberOfLines: 1, style: {
363
- ...styles,
364
- }, children: placeholderString }, `${placeholderString.replaceAll(" ", "-")}-${index}`))) }));
415
+ }, numberOfLines: 1, style: __assign({}, styles), children: placeholderString }, "".concat(placeholderString.replaceAll(" ", "-"), "-").concat(index))); }) }));
365
416
  }, [placeholder, styles]);
366
- return (_jsxs(Flex, { flexGrow: 1, children: [renderAndroidPlaceholderMeasuringHack(), renderHint(), renderAnimatedTitle(), _jsx(AnimatedStyledInput
417
+ return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexGrow: 1, children: [renderAndroidPlaceholderMeasuringHack(), renderHint(), renderAnimatedTitle(), (0, jsx_runtime_1.jsx)(AnimatedStyledInput
367
418
  // Only use a controlled input if specified
368
- , { ...((propValue !== undefined && propValue !== null) || mask ? { value } : {}), onChangeText: handleChangeText, style: [styles, textInputAnimatedStyles], onFocus: handleFocus, onBlur: handleBlur, scrollEnabled: props.multiline, editable: !disabled, textAlignVertical: props.multiline ? "top" : "center", ref: inputRef, placeholderTextColor: delayedFocused ? color("mono60") : "transparent", placeholder: getPlaceholder(), defaultValue: defaultValue, secureTextEntry: !showPassword, ...props }), renderRightComponent(), renderLeftComponent(), renderBottomComponent()] }));
419
+ , __assign({}, ((propValue !== undefined && propValue !== null) || mask ? { value: value } : {}), { onChangeText: handleChangeText, style: [styles, textInputAnimatedStyles], onFocus: handleFocus, onBlur: handleBlur, scrollEnabled: props.multiline, editable: !disabled, textAlignVertical: props.multiline ? "top" : "center", ref: inputRef, placeholderTextColor: delayedFocused ? color("mono60") : "transparent", placeholder: getPlaceholder(), defaultValue: defaultValue, secureTextEntry: !showPassword }, props)), renderRightComponent(), renderLeftComponent(), renderBottomComponent()] }));
369
420
  });
370
- const StyledInput = styled(TextInput) `
371
- padding: ${HORIZONTAL_PADDING}px;
372
- font-family: ${themeGet("fonts.sans.regular")};
373
- border-radius: ${INPUT_BORDER_RADIUS}px;
374
- `;
375
- const AnimatedStyledInput = Animated.createAnimatedComponent(StyledInput);
376
- const AnimatedText = Animated.createAnimatedComponent(Text);
377
- const AnimatedFlex = Animated.createAnimatedComponent(Flex);
421
+ var StyledInput = (0, styled_components_1.default)(react_native_1.TextInput)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", "px;\n font-family: ", ";\n border-radius: ", "px;\n"], ["\n padding: ", "px;\n font-family: ", ";\n border-radius: ", "px;\n"])), exports.HORIZONTAL_PADDING, (0, theme_get_1.default)("fonts.sans.regular"), exports.INPUT_BORDER_RADIUS);
422
+ var AnimatedStyledInput = react_native_reanimated_1.default.createAnimatedComponent(StyledInput);
423
+ var AnimatedText = react_native_reanimated_1.default.createAnimatedComponent(Text_1.Text);
424
+ var AnimatedFlex = react_native_reanimated_1.default.createAnimatedComponent(Flex_1.Flex);
425
+ var templateObject_1;