@artsy/palette-mobile 13.2.33 → 13.2.35

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 (327) hide show
  1. package/dist/Theme.js +9 -13
  2. package/dist/animation/CssTransition.js +8 -12
  3. package/dist/animation/index.js +1 -17
  4. package/dist/constants.js +4 -8
  5. package/dist/elements/ArtsyKeyboardAvoidingView/ArtsyKeyboardAvoidingView.js +19 -23
  6. package/dist/elements/ArtsyKeyboardAvoidingView/index.js +1 -17
  7. package/dist/elements/Autocomplete/Autocomplete.js +4 -8
  8. package/dist/elements/Autocomplete/Autocomplete.tests.js +9 -11
  9. package/dist/elements/Autocomplete/index.js +1 -17
  10. package/dist/elements/Avatar/Avatar.js +17 -44
  11. package/dist/elements/Avatar/Avatar.stories.js +7 -11
  12. package/dist/elements/Avatar/Avatar.tests.js +8 -10
  13. package/dist/elements/Avatar/index.js +1 -17
  14. package/dist/elements/BackButton/BackButton.js +9 -14
  15. package/dist/elements/BackButton/BackButton.stories.js +8 -12
  16. package/dist/elements/BackButton/index.js +1 -17
  17. package/dist/elements/Banner/Banner.js +14 -18
  18. package/dist/elements/Banner/Banner.stories.js +7 -11
  19. package/dist/elements/Banner/index.js +1 -17
  20. package/dist/elements/BorderBox/BorderBox.js +9 -15
  21. package/dist/elements/BorderBox/index.js +1 -17
  22. package/dist/elements/Box/Box.js +11 -17
  23. package/dist/elements/Box/Box.stories.js +14 -20
  24. package/dist/elements/Box/index.js +1 -17
  25. package/dist/elements/Button/Button.js +30 -37
  26. package/dist/elements/Button/Button.stories.js +18 -25
  27. package/dist/elements/Button/CTAButton.js +3 -7
  28. package/dist/elements/Button/FollowButton.js +7 -11
  29. package/dist/elements/Button/LinkButton.js +4 -8
  30. package/dist/elements/Button/colors.js +3 -7
  31. package/dist/elements/Button/index.js +4 -20
  32. package/dist/elements/ButtonNew/Button.js +32 -62
  33. package/dist/elements/ButtonNew/Button.stories.js +36 -50
  34. package/dist/elements/ButtonNew/Button.tests.js +13 -15
  35. package/dist/elements/ButtonNew/CTAButton.js +3 -7
  36. package/dist/elements/ButtonNew/FollowButton.js +7 -11
  37. package/dist/elements/ButtonNew/LinkButton.js +4 -8
  38. package/dist/elements/ButtonNew/colors.js +3 -7
  39. package/dist/elements/ButtonNew/index.js +4 -20
  40. package/dist/elements/Checkbox/Check.js +29 -56
  41. package/dist/elements/Checkbox/Checkbox.js +22 -30
  42. package/dist/elements/Checkbox/Checkbox.stories.js +8 -12
  43. package/dist/elements/Checkbox/index.js +2 -18
  44. package/dist/elements/ClassTheme/ClassTheme.js +5 -9
  45. package/dist/elements/ClassTheme/index.js +1 -17
  46. package/dist/elements/Collapse/Collapse.js +4 -8
  47. package/dist/elements/Collapse/Collapse.stories.js +9 -13
  48. package/dist/elements/Collapse/index.js +1 -17
  49. package/dist/elements/CollapsibleMenuItem/CollapsibleMenuItem.js +18 -21
  50. package/dist/elements/CollapsibleMenuItem/CollapsibleMenuItem.stories.js +30 -38
  51. package/dist/elements/CollapsibleMenuItem/index.js +1 -17
  52. package/dist/elements/Dialog/Dialog.js +20 -24
  53. package/dist/elements/Dialog/Dialog.stories.js +14 -16
  54. package/dist/elements/Dialog/Dialog.tests.js +12 -14
  55. package/dist/elements/Dialog/index.js +1 -17
  56. package/dist/elements/EntityHeader/EntityHeader.js +14 -18
  57. package/dist/elements/EntityHeader/EntityHeader.stories.js +17 -25
  58. package/dist/elements/EntityHeader/index.js +1 -17
  59. package/dist/elements/Flex/Flex.js +4 -7
  60. package/dist/elements/Flex/index.js +1 -17
  61. package/dist/elements/Header/ArtsyLogoHeader.js +8 -12
  62. package/dist/elements/Header/index.js +1 -17
  63. package/dist/elements/Histogram/Histogram.js +6 -10
  64. package/dist/elements/Histogram/index.js +1 -17
  65. package/dist/elements/Image/Image.js +26 -55
  66. package/dist/elements/Image/Image.stories.js +14 -16
  67. package/dist/elements/Image/index.js +1 -17
  68. package/dist/elements/Input/Input.js +127 -157
  69. package/dist/elements/Input/Input.stories.js +9 -11
  70. package/dist/elements/Input/Input.tests.js +17 -19
  71. package/dist/elements/Input/InputTitle.js +4 -8
  72. package/dist/elements/Input/helpers.d.ts +1 -1
  73. package/dist/elements/Input/helpers.js +51 -56
  74. package/dist/elements/Input/index.js +3 -19
  75. package/dist/elements/Input/maskValue.js +5 -10
  76. package/dist/elements/Input/maskValue.tests.js +11 -13
  77. package/dist/elements/Join/Join.js +6 -10
  78. package/dist/elements/Join/index.js +1 -17
  79. package/dist/elements/LazyFlatlist/LazyFlatlist.js +3 -7
  80. package/dist/elements/LazyFlatlist/index.js +2 -18
  81. package/dist/elements/LazyFlatlist/useHasSeenItem.js +6 -10
  82. package/dist/elements/LegacyScreen/LegacyScreen.js +51 -59
  83. package/dist/elements/LegacyScreen/index.js +1 -17
  84. package/dist/elements/LegacyTabs/ContentTabs.js +8 -12
  85. package/dist/elements/LegacyTabs/NavigationalTabs.js +11 -15
  86. package/dist/elements/LegacyTabs/StepTabs.js +15 -19
  87. package/dist/elements/LegacyTabs/Tab.js +9 -13
  88. package/dist/elements/LegacyTabs/TabBarContainer.js +28 -34
  89. package/dist/elements/LegacyTabs/index.js +9 -15
  90. package/dist/elements/List/BulletedItem.js +7 -11
  91. package/dist/elements/List/List.stories.js +8 -10
  92. package/dist/elements/List/index.js +1 -17
  93. package/dist/elements/MeasuredView/MeasuredView.js +10 -15
  94. package/dist/elements/MeasuredView/index.js +1 -17
  95. package/dist/elements/MenuItem/MenuItem.js +9 -13
  96. package/dist/elements/MenuItem/MenuItem.stories.js +5 -9
  97. package/dist/elements/MenuItem/index.js +1 -17
  98. package/dist/elements/Message/Message.js +15 -19
  99. package/dist/elements/Message/Message.stories.js +10 -12
  100. package/dist/elements/Message/Message.tests.js +9 -11
  101. package/dist/elements/Message/index.js +1 -17
  102. package/dist/elements/Pill/Pill.js +53 -83
  103. package/dist/elements/Pill/Pill.stories.js +16 -18
  104. package/dist/elements/Pill/Pill.tests.js +8 -10
  105. package/dist/elements/Pill/index.js +1 -17
  106. package/dist/elements/PopIn/PopIn.js +8 -12
  107. package/dist/elements/PopIn/index.js +1 -17
  108. package/dist/elements/Popover/Popover.js +21 -28
  109. package/dist/elements/Popover/Popover.stories.js +15 -17
  110. package/dist/elements/Popover/index.js +1 -17
  111. package/dist/elements/ProgressBar/ProgressBar.js +16 -43
  112. package/dist/elements/ProgressBar/ProgressBar.stories.js +6 -8
  113. package/dist/elements/ProgressBar/ProgressBar.tests.js +7 -9
  114. package/dist/elements/ProgressBar/index.js +1 -17
  115. package/dist/elements/Radio/RadioButton.js +20 -28
  116. package/dist/elements/Radio/RadioButton.stories.js +13 -15
  117. package/dist/elements/Radio/RadioDot.js +10 -14
  118. package/dist/elements/Radio/index.js +2 -7
  119. package/dist/elements/Screen/Background.js +3 -7
  120. package/dist/elements/Screen/Body.js +9 -13
  121. package/dist/elements/Screen/BottomView.js +9 -16
  122. package/dist/elements/Screen/FloatingHeader.js +9 -13
  123. package/dist/elements/Screen/FullWidthDivider.js +5 -9
  124. package/dist/elements/Screen/FullWidthItem.js +5 -9
  125. package/dist/elements/Screen/Header.js +21 -49
  126. package/dist/elements/Screen/Screen.stories.js +18 -20
  127. package/dist/elements/Screen/ScreenBase.js +9 -13
  128. package/dist/elements/Screen/ScreenFlatList.js +8 -15
  129. package/dist/elements/Screen/ScreenScrollContext.js +9 -14
  130. package/dist/elements/Screen/ScreenScrollView.js +8 -15
  131. package/dist/elements/Screen/StickySubHeader.js +20 -47
  132. package/dist/elements/Screen/constants.js +5 -8
  133. package/dist/elements/Screen/hooks/useAnimatedHeaderScrolling.js +10 -14
  134. package/dist/elements/Screen/hooks/useListenForScreenScroll.js +10 -14
  135. package/dist/elements/Screen/index.js +29 -46
  136. package/dist/elements/SearchInput/SearchInput.js +6 -10
  137. package/dist/elements/SearchInput/index.js +1 -17
  138. package/dist/elements/Separator/Separator.js +9 -15
  139. package/dist/elements/Separator/Separator.stories.js +6 -10
  140. package/dist/elements/Separator/ShadowSeparator.js +3 -9
  141. package/dist/elements/Separator/index.js +2 -18
  142. package/dist/elements/SimpleMessage/SimpleMessage.js +9 -16
  143. package/dist/elements/SimpleMessage/index.js +1 -17
  144. package/dist/elements/Skeleton/Skeleton.js +16 -45
  145. package/dist/elements/Skeleton/Skeleton.stories.js +10 -14
  146. package/dist/elements/Skeleton/index.js +1 -17
  147. package/dist/elements/Spacer/Spacer.js +3 -7
  148. package/dist/elements/Spacer/Spacer.stories.js +15 -20
  149. package/dist/elements/Spacer/index.js +1 -17
  150. package/dist/elements/Spinner/Spinner.js +15 -23
  151. package/dist/elements/Spinner/index.js +1 -17
  152. package/dist/elements/Switch/Switch.js +8 -12
  153. package/dist/elements/Switch/Switch.stories.js +11 -15
  154. package/dist/elements/Switch/index.js +1 -17
  155. package/dist/elements/Tabs/SubTabBar.js +11 -15
  156. package/dist/elements/Tabs/TabFlashList.js +8 -12
  157. package/dist/elements/Tabs/TabFlatList.js +8 -12
  158. package/dist/elements/Tabs/TabMasonry.js +8 -12
  159. package/dist/elements/Tabs/TabScrollView.js +8 -12
  160. package/dist/elements/Tabs/Tabs.js +24 -27
  161. package/dist/elements/Tabs/Tabs.stories.js +11 -13
  162. package/dist/elements/Tabs/TabsContainer.js +15 -19
  163. package/dist/elements/Tabs/TabsWithHeader.js +8 -12
  164. package/dist/elements/Tabs/hooks/useListenForTabContentScroll.js +8 -12
  165. package/dist/elements/Tabs/index.js +1 -17
  166. package/dist/elements/Text/LinkText.js +3 -7
  167. package/dist/elements/Text/Text.js +15 -21
  168. package/dist/elements/Text/Text.stories.js +18 -27
  169. package/dist/elements/Text/Text.tests.js +3 -5
  170. package/dist/elements/Text/helpers.js +5 -10
  171. package/dist/elements/Text/index.js +3 -19
  172. package/dist/elements/ToolTip/ToolTip.js +29 -34
  173. package/dist/elements/ToolTip/ToolTip.stories.js +11 -13
  174. package/dist/elements/ToolTip/ToolTip.tests.js +7 -9
  175. package/dist/elements/ToolTip/ToolTipFlyout.js +19 -47
  176. package/dist/elements/ToolTip/index.js +1 -17
  177. package/dist/elements/Touchable/Touchable.js +12 -19
  178. package/dist/elements/Touchable/Touchable.stories.js +9 -13
  179. package/dist/elements/Touchable/TouchableHighlightColor.js +6 -10
  180. package/dist/elements/Touchable/TouchableWithScale.js +7 -11
  181. package/dist/elements/Touchable/index.js +3 -19
  182. package/dist/elements/VisualClue/VisualClue.stories.js +6 -8
  183. package/dist/elements/VisualClue/VisualClueDot.js +6 -10
  184. package/dist/elements/VisualClue/VisualClueText.js +9 -13
  185. package/dist/elements/VisualClue/index.js +2 -18
  186. package/dist/elements/index.js +45 -61
  187. package/dist/index.js +10 -26
  188. package/dist/setupJest.js +2 -7
  189. package/dist/storybook/decorators.js +20 -28
  190. package/dist/storybook/helpers.js +6 -12
  191. package/dist/svgs/AddCircleFillIcon.js +6 -10
  192. package/dist/svgs/AddCircleIcon.js +6 -10
  193. package/dist/svgs/AddIcon.js +6 -10
  194. package/dist/svgs/AlertCircleFillIcon.js +6 -10
  195. package/dist/svgs/AlertIcon.js +6 -10
  196. package/dist/svgs/ArrowCircleFillIcons.js +7 -12
  197. package/dist/svgs/ArrowDownCircleIcon.js +6 -10
  198. package/dist/svgs/ArrowDownIcon.js +6 -10
  199. package/dist/svgs/ArrowLeftCircleIcon.js +6 -10
  200. package/dist/svgs/ArrowLeftIcon.js +6 -10
  201. package/dist/svgs/ArrowRightCircleIcon.js +6 -10
  202. package/dist/svgs/ArrowRightIcon.js +6 -10
  203. package/dist/svgs/ArrowUpCircleIcon.js +6 -10
  204. package/dist/svgs/ArrowUpIcon.js +6 -10
  205. package/dist/svgs/ArtsyLogoBlackIcon.js +6 -10
  206. package/dist/svgs/ArtsyLogoWhiteIcon.js +4 -8
  207. package/dist/svgs/ArtsyMarkBlackIcon.js +6 -10
  208. package/dist/svgs/ArtsyMarkWhiteIcon.js +4 -8
  209. package/dist/svgs/ArtworkIcon.js +6 -10
  210. package/dist/svgs/AuctionIcon.js +6 -10
  211. package/dist/svgs/BellFillIcon.js +6 -10
  212. package/dist/svgs/BellIcon.js +6 -10
  213. package/dist/svgs/BlueChipIcon.js +6 -10
  214. package/dist/svgs/BoltCircleFill.js +6 -10
  215. package/dist/svgs/BoltFill.js +6 -10
  216. package/dist/svgs/BookmarkFill.js +6 -10
  217. package/dist/svgs/BriefcaseIcon.js +6 -10
  218. package/dist/svgs/CertificateIcon.js +6 -10
  219. package/dist/svgs/CheckCircleFillIcon.js +6 -10
  220. package/dist/svgs/CheckCircleIcon.js +6 -10
  221. package/dist/svgs/CheckIcon.js +6 -10
  222. package/dist/svgs/ChevronIcon.js +11 -15
  223. package/dist/svgs/ClockFill.js +6 -10
  224. package/dist/svgs/CloseCircleFillIcon.js +6 -10
  225. package/dist/svgs/CloseCircleIcon.js +6 -10
  226. package/dist/svgs/CloseIcon.js +6 -10
  227. package/dist/svgs/CollapseIcon.js +6 -10
  228. package/dist/svgs/CreditCardIcon.js +14 -18
  229. package/dist/svgs/DecreaseIcon.js +6 -10
  230. package/dist/svgs/DocumentIcon.js +6 -10
  231. package/dist/svgs/DownloadIcon.js +6 -10
  232. package/dist/svgs/EditIcon.js +6 -10
  233. package/dist/svgs/EmptyCheckCircleIcon.js +6 -10
  234. package/dist/svgs/EnterIcon.js +6 -10
  235. package/dist/svgs/EnvelopeIcon.js +6 -10
  236. package/dist/svgs/EstablishedIcon.js +6 -10
  237. package/dist/svgs/ExclamationMarkCircleFill.js +6 -10
  238. package/dist/svgs/ExpandIcon.js +6 -10
  239. package/dist/svgs/EyeClosedIcon.js +6 -10
  240. package/dist/svgs/EyeOpenedIcon.js +6 -10
  241. package/dist/svgs/FacebookIcon.js +6 -10
  242. package/dist/svgs/FairIcon.js +6 -10
  243. package/dist/svgs/FilterIcon.js +6 -10
  244. package/dist/svgs/FullWidthIcon.js +6 -10
  245. package/dist/svgs/GenomeIcon.js +6 -10
  246. package/dist/svgs/GraphIcon.js +6 -10
  247. package/dist/svgs/GridIcon.js +6 -10
  248. package/dist/svgs/GuaranteeIcon.js +7 -11
  249. package/dist/svgs/HeartFillIcon.js +6 -10
  250. package/dist/svgs/HeartIcon.js +6 -10
  251. package/dist/svgs/HideIcon.js +6 -10
  252. package/dist/svgs/HomeIcon.js +6 -10
  253. package/dist/svgs/Icon.js +15 -30
  254. package/dist/svgs/ImageIcon.js +6 -10
  255. package/dist/svgs/ImageSetIcon.js +6 -10
  256. package/dist/svgs/IncreaseIcon.js +6 -10
  257. package/dist/svgs/InfoCircleIcon.js +6 -10
  258. package/dist/svgs/InstagramAppIcon.js +3 -7
  259. package/dist/svgs/InstitutionIcon.js +6 -10
  260. package/dist/svgs/LinkIcon.js +6 -10
  261. package/dist/svgs/LoaderIcon.js +6 -10
  262. package/dist/svgs/LockIcon.js +6 -10
  263. package/dist/svgs/LogoutIcon.js +6 -10
  264. package/dist/svgs/MagnifyingGlassIcon.js +6 -10
  265. package/dist/svgs/MapPinIcon.js +6 -10
  266. package/dist/svgs/MenuIcon.js +6 -10
  267. package/dist/svgs/MessageIcon.js +7 -11
  268. package/dist/svgs/MessagesAppIcon.js +4 -8
  269. package/dist/svgs/MoneyCircleIcon.js +6 -10
  270. package/dist/svgs/MoneyFillIcon.js +6 -10
  271. package/dist/svgs/MoreIcon.js +6 -10
  272. package/dist/svgs/MultiplePersonsIcon.js +6 -10
  273. package/dist/svgs/NoArtworkIcon.js +6 -10
  274. package/dist/svgs/NoImageIcon.js +6 -10
  275. package/dist/svgs/PageIcon.js +6 -10
  276. package/dist/svgs/Payment2Icon.js +6 -10
  277. package/dist/svgs/PaymentIcon.js +6 -10
  278. package/dist/svgs/PersonIcon.js +6 -10
  279. package/dist/svgs/PublicationIcon.js +6 -10
  280. package/dist/svgs/QuestionCircleIcon.js +6 -10
  281. package/dist/svgs/ReloadIcon.js +6 -10
  282. package/dist/svgs/SecureLockIcon.js +6 -10
  283. package/dist/svgs/SettingsIcon.js +6 -10
  284. package/dist/svgs/ShareIcon.js +6 -10
  285. package/dist/svgs/ShieldFilledIcon.js +6 -10
  286. package/dist/svgs/ShieldIcon.js +6 -10
  287. package/dist/svgs/StarCircleFill.js +6 -10
  288. package/dist/svgs/StarCircleIcon.js +6 -10
  289. package/dist/svgs/Stopwatch.js +6 -10
  290. package/dist/svgs/Tag2Icon.js +7 -11
  291. package/dist/svgs/TagIcon.js +6 -10
  292. package/dist/svgs/TimerIcon.js +6 -10
  293. package/dist/svgs/TopEmergingIcon.js +6 -10
  294. package/dist/svgs/TrashIcon.js +6 -10
  295. package/dist/svgs/TrendingIcon.js +6 -10
  296. package/dist/svgs/TriangleDown.js +6 -10
  297. package/dist/svgs/TwitterIcon.js +6 -10
  298. package/dist/svgs/UserMultiIcon.js +6 -10
  299. package/dist/svgs/UserSingleIcon.js +6 -10
  300. package/dist/svgs/VerifiedIcon.js +6 -10
  301. package/dist/svgs/VerifiedPersonIcon.js +6 -10
  302. package/dist/svgs/WhatsAppAppIcon.js +4 -8
  303. package/dist/svgs/WorldGlobeCircleIcon.js +6 -10
  304. package/dist/svgs/XCircleIcon.js +6 -10
  305. package/dist/svgs/icons.stories.js +11 -38
  306. package/dist/svgs/index.js +113 -129
  307. package/dist/tokens.js +9 -12
  308. package/dist/types.js +5 -10
  309. package/dist/utils/Wrap.js +7 -11
  310. package/dist/utils/colors.stories.js +16 -20
  311. package/dist/utils/createGeminiUrl.js +6 -10
  312. package/dist/utils/flattenChildren.js +5 -9
  313. package/dist/utils/formatLargeNumber.js +1 -5
  314. package/dist/utils/formatLargeNumbers.tests.js +8 -10
  315. package/dist/utils/hooks/index.js +4 -20
  316. package/dist/utils/hooks/useColor.js +2 -6
  317. package/dist/utils/hooks/useMeasure.js +4 -8
  318. package/dist/utils/hooks/useScreenDimensions.js +11 -16
  319. package/dist/utils/hooks/useSpace.js +2 -6
  320. package/dist/utils/hooks/useTheme.js +6 -10
  321. package/dist/utils/normalizeText.js +1 -5
  322. package/dist/utils/space.stories.js +9 -13
  323. package/dist/utils/tests/renderWithWrappers.js +7 -12
  324. package/dist/utils/text.js +9 -13
  325. package/dist/utils/types.js +1 -2
  326. package/dist/utils/webTokensToMobile.js +4 -9
  327. package/package.json +14 -14
@@ -1,20 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PopIn = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const react_native_1 = require("react-native");
7
- const PopIn = ({ children, xOffset, yOffset, }) => {
8
- const entranceProgress = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
9
- (0, react_1.useEffect)(() => {
10
- react_native_1.Animated.spring(entranceProgress, {
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from "react";
3
+ import { Animated } from "react-native";
4
+ export const PopIn = ({ children, xOffset, yOffset, }) => {
5
+ const entranceProgress = useRef(new Animated.Value(0)).current;
6
+ useEffect(() => {
7
+ Animated.spring(entranceProgress, {
11
8
  toValue: 1,
12
9
  bounciness: 12,
13
10
  speed: 28,
14
11
  useNativeDriver: true,
15
12
  }).start();
16
13
  }, []);
17
- return ((0, jsx_runtime_1.jsx)(react_native_1.Animated.View, { style: {
14
+ return (_jsx(Animated.View, { style: {
18
15
  opacity: entranceProgress,
19
16
  transform: [
20
17
  {
@@ -42,4 +39,3 @@ const PopIn = ({ children, xOffset, yOffset, }) => {
42
39
  ],
43
40
  }, children: children }));
44
41
  };
45
- exports.PopIn = PopIn;
@@ -1,17 +1 @@
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("./PopIn"), exports);
1
+ export * from "./PopIn";
@@ -1,33 +1,26 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.POPOVER_VARIANTS = exports.Popover = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const palette_tokens_1 = require("@artsy/palette-tokens");
9
- const react_native_1 = require("react-native");
10
- const react_native_popover_view_1 = __importDefault(require("react-native-popover-view"));
11
- const react_native_reanimated_1 = require("react-native-reanimated");
12
- const styled_components_1 = __importDefault(require("styled-components"));
13
- const svgs_1 = require("../../svgs");
14
- const Flex_1 = require("../Flex");
15
- const Touchable_1 = require("../Touchable");
16
- const Popover = ({ variant = "dark", children, visible, onPressOutside, onDismiss, onCloseComplete, placement = "top", title, content, noCloseIcon, }) => {
17
- const style = exports.POPOVER_VARIANTS[variant];
18
- return ((0, jsx_runtime_1.jsx)(react_native_popover_view_1.default, { backgroundStyle: { opacity: 0.5, backgroundColor: palette_tokens_1.THEME.colors.black100 }, popoverStyle: [{ backgroundColor: style.backgroundColor }, style.shadow], from: children, isVisible: visible,
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { THEME } from "@artsy/palette-tokens";
3
+ import { Platform, StatusBar } from "react-native";
4
+ import RNPopover from "react-native-popover-view";
5
+ import { Easing } from "react-native-reanimated";
6
+ import styled from "styled-components";
7
+ import { CloseIcon } from "../../svgs";
8
+ import { Flex } from "../Flex";
9
+ import { Touchable } from "../Touchable";
10
+ export const Popover = ({ variant = "dark", children, visible, onPressOutside, onDismiss, onCloseComplete, placement = "top", title, content, noCloseIcon, }) => {
11
+ const style = POPOVER_VARIANTS[variant];
12
+ return (_jsx(RNPopover, { backgroundStyle: { opacity: 0.5, backgroundColor: THEME.colors.black100 }, popoverStyle: [{ backgroundColor: style.backgroundColor }, style.shadow], from: children, isVisible: visible,
19
13
  // this is required to make sure that the popover is positioned correctly on android
20
- verticalOffset: react_native_1.Platform.OS === "android" ? -(react_native_1.StatusBar.currentHeight ?? 0) : 0, onCloseComplete: onCloseComplete, onRequestClose: onPressOutside, placement: placement, arrowSize: { height: 11, width: 22 }, animationConfig: {
14
+ verticalOffset: Platform.OS === "android" ? -(StatusBar.currentHeight ?? 0) : 0, onCloseComplete: onCloseComplete, onRequestClose: onPressOutside, placement: placement, arrowSize: { height: 11, width: 22 }, animationConfig: {
21
15
  duration: 400,
22
- easing: react_native_reanimated_1.Easing.out(react_native_reanimated_1.Easing.exp),
23
- }, children: (0, jsx_runtime_1.jsxs)(Container, { variant: variant, p: 1, children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [title ? title : (0, jsx_runtime_1.jsx)(Flex_1.Flex, {}), !noCloseIcon && ((0, jsx_runtime_1.jsx)(Touchable_1.Touchable, { onPress: onDismiss, accessibilityRole: "button", "aria-label": "Dismiss popover", children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { ml: 0.5, children: (0, jsx_runtime_1.jsx)(svgs_1.CloseIcon, { width: 18, height: 18, fill: style.fill }) }) }))] }), content] }) }));
16
+ easing: Easing.out(Easing.exp),
17
+ }, children: _jsxs(Container, { variant: variant, p: 1, children: [_jsxs(Flex, { flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [title ? title : _jsx(Flex, {}), !noCloseIcon && (_jsx(Touchable, { onPress: onDismiss, accessibilityRole: "button", "aria-label": "Dismiss popover", children: _jsx(Flex, { ml: 0.5, children: _jsx(CloseIcon, { width: 18, height: 18, fill: style.fill }) }) }))] }), content] }) }));
24
18
  };
25
- exports.Popover = Popover;
26
- const Container = (0, styled_components_1.default)(Flex_1.Flex) `
27
- background-color: ${({ variant }) => exports.POPOVER_VARIANTS[variant].backgroundColor};
19
+ const Container = styled(Flex) `
20
+ background-color: ${({ variant }) => POPOVER_VARIANTS[variant].backgroundColor};
28
21
  `;
29
22
  const DROP_SHADOW = {
30
- shadowColor: palette_tokens_1.THEME.colors.black100,
23
+ shadowColor: THEME.colors.black100,
31
24
  shadowOffset: {
32
25
  width: 0,
33
26
  height: 2,
@@ -36,14 +29,14 @@ const DROP_SHADOW = {
36
29
  shadowRadius: 2.62,
37
30
  elevation: 4,
38
31
  };
39
- exports.POPOVER_VARIANTS = {
32
+ export const POPOVER_VARIANTS = {
40
33
  light: {
41
- backgroundColor: palette_tokens_1.THEME.colors.white100,
34
+ backgroundColor: THEME.colors.white100,
42
35
  fill: "black100",
43
36
  shadow: DROP_SHADOW,
44
37
  },
45
38
  dark: {
46
- backgroundColor: palette_tokens_1.THEME.colors.black100,
39
+ backgroundColor: THEME.colors.black100,
47
40
  fill: "white100",
48
41
  },
49
42
  };
@@ -1,23 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_native_1 = require("@storybook/react-native");
5
- const react_1 = require("react");
6
- const Popover_1 = require("./Popover");
7
- const Button_1 = require("../Button");
8
- const Flex_1 = require("../Flex");
9
- const Text_1 = require("../Text");
10
- (0, react_native_1.storiesOf)("Popover", module)
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { storiesOf } from "@storybook/react-native";
3
+ import { useState } from "react";
4
+ import { Popover } from "./Popover";
5
+ import { Button } from "../Button";
6
+ import { Flex } from "../Flex";
7
+ import { Text } from "../Text";
8
+ storiesOf("Popover", module)
11
9
  .add("Variants", () => {
12
- const [visible, setVisible] = (0, react_1.useState)(null);
13
- return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flex: 1, alignSelf: "center", mt: 12, alignItems: "center", flexWrap: "wrap", children: [(0, jsx_runtime_1.jsx)(Popover_1.Popover, { visible: visible === "top-dark", title: (0, jsx_runtime_1.jsx)(Text_1.Text, { color: "white100", variant: "xs", children: "Popover Top Dark" }), onPressOutside: () => setVisible(null), onDismiss: () => setVisible(null), children: (0, jsx_runtime_1.jsx)(Text_1.Text, { onPress: () => setVisible("top-dark"), children: "Top Dark" }) }), (0, jsx_runtime_1.jsx)(Popover_1.Popover, { visible: visible === "bottom-dark", placement: "bottom", title: (0, jsx_runtime_1.jsx)(Text_1.Text, { color: "white100", variant: "xs", children: "Popover Bottom Dark" }), onPressOutside: () => setVisible(null), onDismiss: () => setVisible(null), children: (0, jsx_runtime_1.jsx)(Text_1.Text, { onPress: () => setVisible("bottom-dark"), children: "Bottom Dark" }) }), (0, jsx_runtime_1.jsx)(Popover_1.Popover, { visible: visible === "top-light", placement: "top", variant: "light", title: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", children: "Popover Top Light" }), onPressOutside: () => setVisible(null), onDismiss: () => setVisible(null), children: (0, jsx_runtime_1.jsx)(Text_1.Text, { onPress: () => setVisible("top-light"), children: "Top Light" }) }), (0, jsx_runtime_1.jsx)(Popover_1.Popover, { visible: visible === "bottom-light", placement: "bottom", variant: "light", title: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", children: "Popover Bottom Light" }), onPressOutside: () => setVisible(null), onDismiss: () => setVisible(null), children: (0, jsx_runtime_1.jsx)(Text_1.Text, { onPress: () => setVisible("bottom-light"), children: "Bottom Light" }) })] }));
10
+ const [visible, setVisible] = useState(null);
11
+ return (_jsxs(Flex, { flex: 1, alignSelf: "center", mt: 12, alignItems: "center", flexWrap: "wrap", children: [_jsx(Popover, { visible: visible === "top-dark", title: _jsx(Text, { color: "white100", variant: "xs", children: "Popover Top Dark" }), onPressOutside: () => setVisible(null), onDismiss: () => setVisible(null), children: _jsx(Text, { onPress: () => setVisible("top-dark"), children: "Top Dark" }) }), _jsx(Popover, { visible: visible === "bottom-dark", placement: "bottom", title: _jsx(Text, { color: "white100", variant: "xs", children: "Popover Bottom Dark" }), onPressOutside: () => setVisible(null), onDismiss: () => setVisible(null), children: _jsx(Text, { onPress: () => setVisible("bottom-dark"), children: "Bottom Dark" }) }), _jsx(Popover, { visible: visible === "top-light", placement: "top", variant: "light", title: _jsx(Text, { variant: "xs", children: "Popover Top Light" }), onPressOutside: () => setVisible(null), onDismiss: () => setVisible(null), children: _jsx(Text, { onPress: () => setVisible("top-light"), children: "Top Light" }) }), _jsx(Popover, { visible: visible === "bottom-light", placement: "bottom", variant: "light", title: _jsx(Text, { variant: "xs", children: "Popover Bottom Light" }), onPressOutside: () => setVisible(null), onDismiss: () => setVisible(null), children: _jsx(Text, { onPress: () => setVisible("bottom-light"), children: "Bottom Light" }) })] }));
14
12
  })
15
13
  .add("With title and/or content", () => {
16
- const [visible, setVisible] = (0, react_1.useState)(null);
17
- return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flex: 1, alignSelf: "center", mt: 12, alignItems: "center", flexWrap: "wrap", children: [(0, jsx_runtime_1.jsx)(Popover_1.Popover, { visible: visible === "title", title: (0, jsx_runtime_1.jsx)(Text_1.Text, { weight: "medium", color: "white100", children: "Popover title" }), content: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { color: "white100", children: "Popover descriptive text with some not so long long long body" }), (0, jsx_runtime_1.jsx)(Text_1.Text, { color: "white100", children: "And some line break" })] }), onDismiss: () => setVisible(null), children: (0, jsx_runtime_1.jsx)(Text_1.Text, { onPress: () => setVisible("title"), children: "Some title and description" }) }), (0, jsx_runtime_1.jsx)(Popover_1.Popover, { visible: visible === "buttons", placement: "bottom", variant: "light", content: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { weight: "medium", mb: 1, children: "Popover title" }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { height: 80, backgroundColor: "black30", mb: 1 }), (0, jsx_runtime_1.jsx)(Text_1.Text, { mb: 1, children: "Popover descriptive text" }), (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", justifyContent: "flex-end", children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { size: "small", variant: "outlineGray", children: "Learn more" }), (0, jsx_runtime_1.jsx)(Button_1.Button, { size: "small", ml: 1, onPress: () => setVisible(null), children: "Got it" })] })] }), onDismiss: () => setVisible(null), children: (0, jsx_runtime_1.jsx)(Text_1.Text, { onPress: () => setVisible("buttons"), children: "Buttons and more content" }) }), (0, jsx_runtime_1.jsx)(Popover_1.Popover, { visible: visible === "no-close", placement: "bottom", noCloseIcon: true, variant: "light", content: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { weight: "medium", mb: 1, children: "Popover title?" }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { height: 80, backgroundColor: "black30", mb: 1 }), (0, jsx_runtime_1.jsx)(Text_1.Text, { mb: 1, children: "Popover descriptive text" }), (0, jsx_runtime_1.jsx)(Button_1.Button, { size: "small", onPress: () => setVisible(null), children: "Got it" })] }), onDismiss: () => setVisible(null), children: (0, jsx_runtime_1.jsx)(Text_1.Text, { onPress: () => setVisible("no-close"), children: "Content without close icon" }) })] }));
14
+ const [visible, setVisible] = useState(null);
15
+ return (_jsxs(Flex, { flex: 1, alignSelf: "center", mt: 12, alignItems: "center", flexWrap: "wrap", children: [_jsx(Popover, { visible: visible === "title", title: _jsx(Text, { weight: "medium", color: "white100", children: "Popover title" }), content: _jsxs(_Fragment, { children: [_jsx(Text, { color: "white100", children: "Popover descriptive text with some not so long long long body" }), _jsx(Text, { color: "white100", children: "And some line break" })] }), onDismiss: () => setVisible(null), children: _jsx(Text, { onPress: () => setVisible("title"), children: "Some title and description" }) }), _jsx(Popover, { visible: visible === "buttons", placement: "bottom", variant: "light", content: _jsxs(_Fragment, { children: [_jsx(Text, { weight: "medium", mb: 1, children: "Popover title" }), _jsx(Flex, { height: 80, backgroundColor: "black30", mb: 1 }), _jsx(Text, { mb: 1, children: "Popover descriptive text" }), _jsxs(Flex, { flexDirection: "row", justifyContent: "flex-end", children: [_jsx(Button, { size: "small", variant: "outlineGray", children: "Learn more" }), _jsx(Button, { size: "small", ml: 1, onPress: () => setVisible(null), children: "Got it" })] })] }), onDismiss: () => setVisible(null), children: _jsx(Text, { onPress: () => setVisible("buttons"), children: "Buttons and more content" }) }), _jsx(Popover, { visible: visible === "no-close", placement: "bottom", noCloseIcon: true, variant: "light", content: _jsxs(_Fragment, { children: [_jsx(Text, { weight: "medium", mb: 1, children: "Popover title?" }), _jsx(Flex, { height: 80, backgroundColor: "black30", mb: 1 }), _jsx(Text, { mb: 1, children: "Popover descriptive text" }), _jsx(Button, { size: "small", onPress: () => setVisible(null), children: "Got it" })] }), onDismiss: () => setVisible(null), children: _jsx(Text, { onPress: () => setVisible("no-close"), children: "Content without close icon" }) })] }));
18
16
  })
19
17
  .add("Edge positions", () => {
20
- const [topVisible, setTopVisible] = (0, react_1.useState)(true);
21
- const [bottomVisible, setBottomVisible] = (0, react_1.useState)(false);
22
- return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flex: 1, backgroundColor: "black30", justifyContent: "space-between", px: 1, children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { backgroundColor: "white100", width: 80, px: 1, children: (0, jsx_runtime_1.jsx)(Popover_1.Popover, { visible: topVisible, placement: "bottom", onDismiss: () => setTopVisible(false), onCloseComplete: () => setBottomVisible(true), title: (0, jsx_runtime_1.jsx)(Text_1.Text, { color: "white100", variant: "xs", children: "Top-Left" }), children: (0, jsx_runtime_1.jsx)(Text_1.Text, { children: "Top-left" }) }) }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { backgroundColor: "white100", width: 120, mb: 6, alignSelf: "flex-end", px: 1, children: (0, jsx_runtime_1.jsx)(Popover_1.Popover, { visible: bottomVisible, onDismiss: () => setBottomVisible(false), title: (0, jsx_runtime_1.jsx)(Text_1.Text, { color: "white100", variant: "xs", children: "Bottom-Right" }), children: (0, jsx_runtime_1.jsx)(Text_1.Text, { children: "Bottom-right" }) }) })] }));
18
+ const [topVisible, setTopVisible] = useState(true);
19
+ const [bottomVisible, setBottomVisible] = useState(false);
20
+ return (_jsxs(Flex, { flex: 1, backgroundColor: "black30", justifyContent: "space-between", px: 1, children: [_jsx(Flex, { backgroundColor: "white100", width: 80, px: 1, children: _jsx(Popover, { visible: topVisible, placement: "bottom", onDismiss: () => setTopVisible(false), onCloseComplete: () => setBottomVisible(true), title: _jsx(Text, { color: "white100", variant: "xs", children: "Top-Left" }), children: _jsx(Text, { children: "Top-left" }) }) }), _jsx(Flex, { backgroundColor: "white100", width: 120, mb: 6, alignSelf: "flex-end", px: 1, children: _jsx(Popover, { visible: bottomVisible, onDismiss: () => setBottomVisible(false), title: _jsx(Text, { color: "white100", variant: "xs", children: "Bottom-Right" }), children: _jsx(Text, { children: "Bottom-right" }) }) })] }));
23
21
  });
@@ -1,17 +1 @@
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("./Popover"), exports);
1
+ export * from "./Popover";
@@ -1,56 +1,29 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.ProgressBar = void 0;
27
- const jsx_runtime_1 = require("react/jsx-runtime");
28
- const react_1 = require("react");
29
- const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
30
- const hooks_1 = require("../../utils/hooks");
31
- const useColor_1 = require("../../utils/hooks/useColor");
32
- const Flex_1 = require("../Flex");
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from "react";
3
+ import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
4
+ import { useSpace } from "../../utils/hooks";
5
+ import { useColor } from "../../utils/hooks/useColor";
6
+ import { Flex } from "../Flex";
33
7
  const clamp = (num, min, max) => Math.max(min, Math.min(num, max));
34
- const ProgressBar = ({ animationDuration = 200, backgroundColor = "black30", height = 2, onCompletion, progress: unclampedProgress, trackColor = "blue100", style, progressBarStyle, }) => {
35
- const color = (0, useColor_1.useColor)();
36
- const space = (0, hooks_1.useSpace)();
37
- const width = (0, react_native_reanimated_1.useSharedValue)(0);
8
+ export const ProgressBar = ({ animationDuration = 200, backgroundColor = "black30", height = 2, onCompletion, progress: unclampedProgress, trackColor = "blue100", style, progressBarStyle, }) => {
9
+ const color = useColor();
10
+ const space = useSpace();
11
+ const width = useSharedValue(0);
38
12
  const progress = clamp(unclampedProgress, 0, 100);
39
- const progressAnim = (0, react_native_reanimated_1.useAnimatedStyle)(() => {
13
+ const progressAnim = useAnimatedStyle(() => {
40
14
  return { width: `${width.value}%` };
41
15
  });
42
- const [onCompletionCalled, setOnCompletionCalled] = (0, react_1.useState)(false);
43
- (0, react_1.useEffect)(() => {
44
- width.value = (0, react_native_reanimated_1.withTiming)(progress, { duration: animationDuration });
16
+ const [onCompletionCalled, setOnCompletionCalled] = useState(false);
17
+ useEffect(() => {
18
+ width.value = withTiming(progress, { duration: animationDuration });
45
19
  if (progress === 100 && !onCompletionCalled) {
46
20
  onCompletion?.();
47
21
  setOnCompletionCalled(true);
48
22
  }
49
23
  }, [progress]);
50
- return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { width: "10%", backgroundColor: backgroundColor, style: {
24
+ return (_jsx(Flex, { width: "10%", backgroundColor: backgroundColor, style: {
51
25
  marginVertical: space(1),
52
26
  width: "100%",
53
27
  ...style,
54
- }, children: (0, jsx_runtime_1.jsx)(react_native_reanimated_1.default.View, { testID: "progress-bar-track", style: [progressAnim, { height, backgroundColor: color(trackColor) }, progressBarStyle] }) }));
28
+ }, children: _jsx(Animated.View, { testID: "progress-bar-track", style: [progressAnim, { height, backgroundColor: color(trackColor) }, progressBarStyle] }) }));
55
29
  };
56
- exports.ProgressBar = ProgressBar;
@@ -1,8 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_native_1 = require("@storybook/react-native");
5
- const _1 = require("./");
6
- const Flex_1 = require("../Flex");
7
- const Text_1 = require("../Text");
8
- (0, react_native_1.storiesOf)("Progress Indicators", module).add("ProgressBar", () => ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { p: 2, children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { children: "10%" }), (0, jsx_runtime_1.jsx)(_1.ProgressBar, { progress: 10 }), (0, jsx_runtime_1.jsx)(Text_1.Text, { children: "20%" }), (0, jsx_runtime_1.jsx)(_1.ProgressBar, { progress: 20 }), (0, jsx_runtime_1.jsx)(Text_1.Text, { children: "50%" }), (0, jsx_runtime_1.jsx)(_1.ProgressBar, { progress: 50 })] })));
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { storiesOf } from "@storybook/react-native";
3
+ import { ProgressBar } from "./";
4
+ import { Flex } from "../Flex";
5
+ import { Text } from "../Text";
6
+ storiesOf("Progress Indicators", module).add("ProgressBar", () => (_jsxs(Flex, { p: 2, children: [_jsx(Text, { children: "10%" }), _jsx(ProgressBar, { progress: 10 }), _jsx(Text, { children: "20%" }), _jsx(ProgressBar, { progress: 20 }), _jsx(Text, { children: "50%" }), _jsx(ProgressBar, { progress: 50 })] })));
@@ -1,12 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_native_1 = require("@testing-library/react-native");
5
- const ProgressBar_1 = require("./ProgressBar");
6
- const renderWithWrappers_1 = require("../../utils/tests/renderWithWrappers");
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { waitFor } from "@testing-library/react-native";
3
+ import { ProgressBar } from "./ProgressBar";
4
+ import { renderWithWrappers } from "../../utils/tests/renderWithWrappers";
7
5
  describe("ProgressBar", () => {
8
6
  const getWrapper = (props) => {
9
- return (0, renderWithWrappers_1.renderWithWrappers)((0, jsx_runtime_1.jsx)(ProgressBar_1.ProgressBar, { ...props }));
7
+ return renderWithWrappers(_jsx(ProgressBar, { ...props }));
10
8
  };
11
9
  it.skip("does not display the track view when progress is zero", async () => {
12
10
  const wrapper = getWrapper({ progress: 0 });
@@ -14,7 +12,7 @@ describe("ProgressBar", () => {
14
12
  const track = wrapper.getByTestId("progress-bar-track");
15
13
  expect(container.props.width).toEqual("100%");
16
14
  // width of 0% is invisible
17
- await (0, react_native_1.waitFor)(() => expect(track.props.style.width).toEqual("0%"));
15
+ await waitFor(() => expect(track.props.style.width).toEqual("0%"));
18
16
  });
19
17
  it.skip("display the track view when progress is above zero", async () => {
20
18
  const wrapper = getWrapper({ progress: 50 });
@@ -23,6 +21,6 @@ describe("ProgressBar", () => {
23
21
  expect(container.props.width).toEqual("100%");
24
22
  // width of 50% is visible
25
23
  // wait for animations to finish running
26
- await (0, react_native_1.waitFor)(() => expect(track.props.style.width).toEqual("50%"));
24
+ await waitFor(() => expect(track.props.style.width).toEqual("50%"));
27
25
  });
28
26
  });
@@ -1,17 +1 @@
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("./ProgressBar"), exports);
1
+ export * from "./ProgressBar";
@@ -1,22 +1,16 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DisabledDot = exports.RadioDot = exports.RadioButton = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const theme_get_1 = require("@styled-system/theme-get");
9
- const react_native_1 = require("react-native");
10
- const native_1 = __importDefault(require("styled-components/native"));
11
- const animation_1 = require("../../animation");
12
- const useTheme_1 = require("../../utils/hooks/useTheme");
13
- const Flex_1 = require("../Flex");
14
- const Text_1 = require("../Text");
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { themeGet } from "@styled-system/theme-get";
3
+ import { PixelRatio, StyleSheet, TouchableWithoutFeedback, View, } from "react-native";
4
+ import styled from "styled-components/native";
5
+ import { CssTransition } from "../../animation";
6
+ import { useTheme } from "../../utils/hooks/useTheme";
7
+ import { Flex } from "../Flex";
8
+ import { Text } from "../Text";
15
9
  const RADIOBUTTON_SIZE = 20;
16
10
  const DURATION = 150;
17
- const RadioButton = ({ selected, disabled, error, onPress, text, textVariant = "md", subtitle, accessibilityState, ...restProps }) => {
18
- const { color, space } = (0, useTheme_1.useTheme)();
19
- const fontScale = react_native_1.PixelRatio.getFontScale();
11
+ export const RadioButton = ({ selected, disabled, error, onPress, text, textVariant = "md", subtitle, accessibilityState, ...restProps }) => {
12
+ const { color, space } = useTheme();
13
+ const fontScale = PixelRatio.getFontScale();
20
14
  const radioButtonSize = RADIOBUTTON_SIZE * fontScale;
21
15
  const defaultRadioButtonStyle = {
22
16
  backgroundColor: color("white100"),
@@ -45,21 +39,20 @@ const RadioButton = ({ selected, disabled, error, onPress, text, textVariant = "
45
39
  : radioButtonStyles[error ? "error" : "default"][selected ? "selected" : "notSelected"];
46
40
  const textColor = error ? color("red100") : disabled ? color("black30") : color("black100");
47
41
  const subtitleColor = error ? color("red100") : color("black30");
48
- return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableWithoutFeedback, { accessibilityState: accessibilityState, onPress: (event) => {
42
+ return (_jsx(TouchableWithoutFeedback, { accessibilityState: accessibilityState, onPress: (event) => {
49
43
  if (disabled) {
50
44
  return;
51
45
  }
52
46
  onPress?.(event);
53
- }, children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { ...restProps, children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { mt: "2px", children: (0, jsx_runtime_1.jsx)(animation_1.CssTransition, { style: [
47
+ }, children: _jsxs(Flex, { ...restProps, children: [_jsxs(Flex, { flexDirection: "row", alignItems: "center", children: [_jsx(Flex, { mt: "2px", children: _jsx(CssTransition, { style: [
54
48
  styles(fontScale).container,
55
49
  { marginRight: space(1) * fontScale },
56
50
  radioButtonStyle,
57
51
  ], animate: ["borderColor"], duration: DURATION, children: !!selected &&
58
- (!!disabled ? ((0, jsx_runtime_1.jsx)(exports.DisabledDot, { size: radioButtonSize })) : ((0, jsx_runtime_1.jsx)(exports.RadioDot, { size: radioButtonSize }))) }) }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { justifyContent: "center", children: !!text && ((0, jsx_runtime_1.jsx)(Text_1.Text, { variant: textVariant, color: textColor, children: text })) })] }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { ml: `${(RADIOBUTTON_SIZE + space(1)) * fontScale}px`, mt: "6px", children: !!subtitle && ((0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", color: subtitleColor, children: subtitle })) })] }) }));
52
+ (!!disabled ? (_jsx(DisabledDot, { size: radioButtonSize })) : (_jsx(RadioDot, { size: radioButtonSize }))) }) }), _jsx(Flex, { justifyContent: "center", children: !!text && (_jsx(Text, { variant: textVariant, color: textColor, children: text })) })] }), _jsx(Flex, { ml: `${(RADIOBUTTON_SIZE + space(1)) * fontScale}px`, mt: "6px", children: !!subtitle && (_jsx(Text, { variant: "xs", color: subtitleColor, children: subtitle })) })] }) }));
59
53
  };
60
- exports.RadioButton = RadioButton;
61
54
  // styled-component does not have support for Animated.View
62
- const styles = (fontScale) => react_native_1.StyleSheet.create({
55
+ const styles = (fontScale) => StyleSheet.create({
63
56
  container: {
64
57
  display: "flex",
65
58
  justifyContent: "center",
@@ -74,16 +67,15 @@ const styles = (fontScale) => react_native_1.StyleSheet.create({
74
67
  // This component represents the white ● mark in CSS. We are not using styled-system since it's easier to specify raw CSS
75
68
  // properties with styled-component.
76
69
  // Height, Width, and Border Radius calculations are used to maintain the size of the white dot when scaling
77
- const RadioDot = ({ size }) => {
78
- return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
70
+ export const RadioDot = ({ size }) => {
71
+ return (_jsx(View, { style: {
79
72
  height: size * 0.625,
80
73
  width: size * 0.625,
81
74
  borderRadius: size * 0.3125,
82
75
  backgroundColor: "white",
83
76
  } }));
84
77
  };
85
- exports.RadioDot = RadioDot;
86
- exports.DisabledDot = (0, native_1.default)(exports.RadioDot) `
87
- border-bottom-color: ${(0, theme_get_1.themeGet)("colors.black30")};
88
- border-left-color: ${(0, theme_get_1.themeGet)("colors.black30")};
78
+ export const DisabledDot = styled(RadioDot) `
79
+ border-bottom-color: ${themeGet("colors.black30")};
80
+ border-left-color: ${themeGet("colors.black30")};
89
81
  `;
@@ -1,24 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_native_1 = require("@storybook/react-native");
5
- const react_1 = require("react");
6
- const RadioButton_1 = require("./RadioButton");
7
- const helpers_1 = require("../../storybook/helpers");
8
- const Flex_1 = require("../Flex");
9
- exports.default = {
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { storiesOf } from "@storybook/react-native";
3
+ import { useState } from "react";
4
+ import { RadioButton } from "./RadioButton";
5
+ import { List } from "../../storybook/helpers";
6
+ import { Flex } from "../Flex";
7
+ export default {
10
8
  title: "RadioButton",
11
- component: RadioButton_1.RadioButton,
9
+ component: RadioButton,
12
10
  };
13
- (0, react_native_1.storiesOf)("RadioButton", module).add("Default", () => {
14
- const [metric, setMetric] = (0, react_1.useState)("cm");
15
- return ((0, jsx_runtime_1.jsx)(helpers_1.List, { contentContainerStyle: {
11
+ storiesOf("RadioButton", module).add("Default", () => {
12
+ const [metric, setMetric] = useState("cm");
13
+ return (_jsx(List, { contentContainerStyle: {
16
14
  marginHorizontal: 20,
17
15
  justifyContent: "flex-start",
18
16
  alignItems: "flex-start",
19
- }, children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", gap: 20, children: [(0, jsx_runtime_1.jsx)(RadioButton_1.RadioButton, { onPress: () => {
17
+ }, children: _jsxs(Flex, { flexDirection: "row", gap: 20, children: [_jsx(RadioButton, { onPress: () => {
20
18
  setMetric("cm");
21
- }, selected: metric === "cm", text: "centimeters" }), (0, jsx_runtime_1.jsx)(RadioButton_1.RadioButton, { onPress: () => {
19
+ }, selected: metric === "cm", text: "centimeters" }), _jsx(RadioButton, { onPress: () => {
22
20
  setMetric("in");
23
21
  }, selected: metric === "in", text: "inches" })] }) }));
24
22
  });
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RadioDot = exports.RADIO_DOT_MODES = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const Flex_1 = require("../Flex");
6
- exports.RADIO_DOT_MODES = {
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Flex } from "../Flex";
3
+ export const RADIO_DOT_MODES = {
7
4
  default: {
8
5
  resting: {
9
6
  borderWidth: 2,
@@ -51,22 +48,21 @@ exports.RADIO_DOT_MODES = {
51
48
  },
52
49
  },
53
50
  };
54
- const RadioDot = (props) => ((0, jsx_runtime_1.jsx)(Container, { ...props, children: (0, jsx_runtime_1.jsx)(Dot, { ...props }) }));
55
- exports.RadioDot = RadioDot;
51
+ export const RadioDot = (props) => (_jsx(Container, { ...props, children: _jsx(Dot, { ...props }) }));
56
52
  const Container = ({ selected = false, hover = false, error = false, disabled = false, }) => {
57
53
  const mode = (() => {
58
54
  switch (true) {
59
55
  case disabled:
60
- return exports.RADIO_DOT_MODES.disabled;
56
+ return RADIO_DOT_MODES.disabled;
61
57
  case hover:
62
- return exports.RADIO_DOT_MODES.hover;
58
+ return RADIO_DOT_MODES.hover;
63
59
  case error:
64
- return exports.RADIO_DOT_MODES.error;
60
+ return RADIO_DOT_MODES.error;
65
61
  default:
66
- return exports.RADIO_DOT_MODES.default;
62
+ return RADIO_DOT_MODES.default;
67
63
  }
68
64
  })();
69
65
  const moreProps = selected ? mode.selected : mode.resting;
70
- return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { width: 20, height: 20, borderRadius: 50, alignItems: "center", justifyContent: "center", flexShrink: 0, ...moreProps }));
66
+ return (_jsx(Flex, { width: 20, height: 20, borderRadius: 50, alignItems: "center", justifyContent: "center", flexShrink: 0, ...moreProps }));
71
67
  };
72
- const Dot = ({ selected = false, disabled = false }) => ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { width: 10, height: 10, borderRadius: 50, alignItems: "center", justifyContent: "center", flexShrink: 0, backgroundColor: disabled && !selected ? "transparent" : "white100" }));
68
+ const Dot = ({ selected = false, disabled = false }) => (_jsx(Flex, { width: 10, height: 10, borderRadius: 50, alignItems: "center", justifyContent: "center", flexShrink: 0, backgroundColor: disabled && !selected ? "transparent" : "white100" }));
@@ -1,7 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RadioDot = exports.RadioButton = void 0;
4
- var RadioButton_1 = require("./RadioButton");
5
- Object.defineProperty(exports, "RadioButton", { enumerable: true, get: function () { return RadioButton_1.RadioButton; } });
6
- var RadioDot_1 = require("./RadioDot");
7
- Object.defineProperty(exports, "RadioDot", { enumerable: true, get: function () { return RadioDot_1.RadioDot; } });
1
+ export { RadioButton } from "./RadioButton";
2
+ export { RadioDot } from "./RadioDot";
@@ -1,7 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Background = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const Flex_1 = require("../Flex");
6
- const Background = ({ children }) => ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { position: "absolute", top: 0, bottom: 0, left: 0, right: 0, children: children }));
7
- exports.Background = Background;
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Flex } from "../Flex";
3
+ export const Background = ({ children }) => (_jsx(Flex, { position: "absolute", top: 0, bottom: 0, left: 0, right: 0, children: children }));
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Body = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const react_native_1 = require("react-native");
7
- const constants_1 = require("./constants");
8
- const Flex_1 = require("../Flex");
9
- const Body = ({ children, fullwidth, scroll, disableKeyboardAvoidance = false, ...flexProps }) => {
10
- const Wrapper = disableKeyboardAvoidance ? react_1.Fragment : react_native_1.KeyboardAvoidingView;
11
- return ((0, jsx_runtime_1.jsx)(Wrapper, { ...(disableKeyboardAvoidance
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
3
+ import { KeyboardAvoidingView, Platform, ScrollView } from "react-native";
4
+ import { SCREEN_HORIZONTAL_PADDING } from "./constants";
5
+ import { Flex } from "../Flex";
6
+ export const Body = ({ children, fullwidth, scroll, disableKeyboardAvoidance = false, ...flexProps }) => {
7
+ const Wrapper = disableKeyboardAvoidance ? Fragment : KeyboardAvoidingView;
8
+ return (_jsx(Wrapper, { ...(disableKeyboardAvoidance
12
9
  ? {}
13
- : { style: { flex: 1 }, behavior: react_native_1.Platform.OS === "ios" ? "padding" : "height" }), children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { flex: 1, ...flexProps, children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { flex: 1, px: fullwidth ? undefined : constants_1.SCREEN_HORIZONTAL_PADDING, children: scroll ? (0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { children: children }) : children }) }) }));
10
+ : { style: { flex: 1 }, behavior: Platform.OS === "ios" ? "padding" : "height" }), children: _jsx(Flex, { flex: 1, ...flexProps, children: _jsx(Flex, { flex: 1, px: fullwidth ? undefined : SCREEN_HORIZONTAL_PADDING, children: scroll ? _jsx(ScrollView, { children: children }) : children }) }) }));
14
11
  };
15
- exports.Body = Body;
@@ -1,19 +1,12 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.BottomView = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const react_native_linear_gradient_1 = __importDefault(require("react-native-linear-gradient"));
9
- const constants_1 = require("./constants");
10
- const useColor_1 = require("../../utils/hooks/useColor");
11
- const Flex_1 = require("../Flex");
12
- const BottomView = ({ children, darkMode }) => {
13
- const color = (0, useColor_1.useColor)();
14
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_native_linear_gradient_1.default, { colors: [darkMode ? "rgba(0,0,0,0)" : "rgba(255,255,255,0)", color("background")], start: { x: 0, y: 0 }, end: { x: 0, y: 1 }, style: {
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import LinearGradient from "react-native-linear-gradient";
3
+ import { SCREEN_HORIZONTAL_PADDING } from "./constants";
4
+ import { useColor } from "../../utils/hooks/useColor";
5
+ import { Flex } from "../Flex";
6
+ export const BottomView = ({ children, darkMode }) => {
7
+ const color = useColor();
8
+ return (_jsxs(_Fragment, { children: [_jsx(LinearGradient, { colors: [darkMode ? "rgba(0,0,0,0)" : "rgba(255,255,255,0)", color("background")], start: { x: 0, y: 0 }, end: { x: 0, y: 1 }, style: {
15
9
  width: "100%",
16
10
  height: 20,
17
- }, pointerEvents: "none" }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { px: constants_1.SCREEN_HORIZONTAL_PADDING, pt: 1, pb: 4, backgroundColor: "background", children: children })] }));
11
+ }, pointerEvents: "none" }), _jsx(Flex, { px: SCREEN_HORIZONTAL_PADDING, pt: 1, pb: 4, backgroundColor: "background", children: children })] }));
18
12
  };
19
- exports.BottomView = BottomView;