@fountain-ui/core 2.0.0-beta.9 → 2.0.0-beta.91

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 (573) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/build/commonjs/Accordion/Accordion.js +110 -27
  3. package/build/commonjs/Accordion/Accordion.js.map +1 -1
  4. package/build/commonjs/Accordion/AccordionProps.js.map +1 -1
  5. package/build/commonjs/Badge/Badge.js +5 -14
  6. package/build/commonjs/Badge/Badge.js.map +1 -1
  7. package/build/commonjs/Badge/BadgeProps.js.map +1 -1
  8. package/build/commonjs/Button/Button.js +6 -3
  9. package/build/commonjs/Button/Button.js.map +1 -1
  10. package/build/commonjs/ButtonBase/ButtonBase.js +65 -51
  11. package/build/commonjs/ButtonBase/ButtonBase.js.map +1 -1
  12. package/build/commonjs/ButtonBase/ButtonBaseProps.js.map +1 -1
  13. package/build/commonjs/Checkbox/CheckboxProps.js.map +1 -1
  14. package/build/commonjs/Chip/Chip.js +11 -9
  15. package/build/commonjs/Chip/Chip.js.map +1 -1
  16. package/build/commonjs/Chip/ChipProps.js.map +1 -1
  17. package/build/commonjs/CircularProgress/CircularProgress.js +27 -28
  18. package/build/commonjs/CircularProgress/CircularProgress.js.map +1 -1
  19. package/build/commonjs/Dialog/Dialog.js +118 -10
  20. package/build/commonjs/Dialog/Dialog.js.map +1 -1
  21. package/build/commonjs/Dialog/DialogProps.js.map +1 -1
  22. package/build/commonjs/Divider/Divider.js +26 -18
  23. package/build/commonjs/Divider/Divider.js.map +1 -1
  24. package/build/commonjs/Divider/DividerProps.js.map +1 -1
  25. package/build/commonjs/Image/Image.js +58 -14
  26. package/build/commonjs/Image/Image.js.map +1 -1
  27. package/build/commonjs/Image/ImageProps.js.map +1 -1
  28. package/build/commonjs/Image/index.js.map +1 -1
  29. package/build/commonjs/ImageCore/ImageCoreNative.js +36 -26
  30. package/build/commonjs/ImageCore/ImageCoreNative.js.map +1 -1
  31. package/build/commonjs/ImageCore/ImageCoreProps.js.map +1 -1
  32. package/build/commonjs/ImageCore/ImageCoreWeb.js +19 -1
  33. package/build/commonjs/ImageCore/ImageCoreWeb.js.map +1 -1
  34. package/build/commonjs/ImageCore/ImageFileExtensionContext.js +14 -0
  35. package/build/commonjs/ImageCore/ImageFileExtensionContext.js.map +1 -0
  36. package/build/commonjs/ImageCore/ImageFileExtensionProvider.js +42 -0
  37. package/build/commonjs/ImageCore/ImageFileExtensionProvider.js.map +1 -0
  38. package/build/commonjs/ImageCore/index.js +17 -5
  39. package/build/commonjs/ImageCore/index.js.map +1 -1
  40. package/build/commonjs/ImageCore/index.native.js +27 -0
  41. package/build/commonjs/ImageCore/index.native.js.map +1 -1
  42. package/build/commonjs/Modal/AnimatedContainer/index.js +167 -0
  43. package/build/commonjs/Modal/AnimatedContainer/index.js.map +1 -0
  44. package/build/commonjs/Modal/Modal.js +43 -9
  45. package/build/commonjs/Modal/Modal.js.map +1 -1
  46. package/build/commonjs/Modal/ModalProps.js +12 -0
  47. package/build/commonjs/Modal/ModalProps.js.map +1 -1
  48. package/build/commonjs/Modal/index.js +18 -0
  49. package/build/commonjs/Modal/index.js.map +1 -1
  50. package/build/commonjs/Paper/Paper.js +1 -1
  51. package/build/commonjs/Paper/Paper.js.map +1 -1
  52. package/build/commonjs/Radio/Radio.js +11 -4
  53. package/build/commonjs/Radio/Radio.js.map +1 -1
  54. package/build/commonjs/Radio/RadioProps.js.map +1 -1
  55. package/build/commonjs/Slide/Slide.js +41 -27
  56. package/build/commonjs/Slide/Slide.js.map +1 -1
  57. package/build/commonjs/Slide/SlideProps.js.map +1 -1
  58. package/build/commonjs/Snackbar/Snackbar.js +34 -7
  59. package/build/commonjs/Snackbar/Snackbar.js.map +1 -1
  60. package/build/commonjs/Snackbar/SnackbarProps.js.map +1 -1
  61. package/build/commonjs/SnackbarContent/SnackbarContent.js +32 -14
  62. package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
  63. package/build/commonjs/SnackbarContent/SnackbarContentProps.js.map +1 -1
  64. package/build/commonjs/SvgIcon/SvgIcon.js +1 -1
  65. package/build/commonjs/SvgIcon/SvgIcon.js.map +1 -1
  66. package/build/commonjs/Tab/Tab.js +66 -20
  67. package/build/commonjs/Tab/Tab.js.map +1 -1
  68. package/build/commonjs/Tab/TabIndicator.js +11 -7
  69. package/build/commonjs/Tab/TabIndicator.js.map +1 -1
  70. package/build/commonjs/Tab/TabProps.js.map +1 -1
  71. package/build/commonjs/Tab/index.js.map +1 -1
  72. package/build/commonjs/Tabs/IndexAwareTab.js +35 -0
  73. package/build/commonjs/Tabs/IndexAwareTab.js.map +1 -0
  74. package/build/commonjs/Tabs/InternalContext.js +17 -0
  75. package/build/commonjs/Tabs/InternalContext.js.map +1 -0
  76. package/build/commonjs/Tabs/ScrollableTabsView.js +35 -0
  77. package/build/commonjs/Tabs/ScrollableTabsView.js.map +1 -0
  78. package/build/commonjs/Tabs/TabIndicator.js +73 -28
  79. package/build/commonjs/Tabs/TabIndicator.js.map +1 -1
  80. package/build/commonjs/Tabs/TabIndicatorProps.js.map +1 -1
  81. package/build/commonjs/Tabs/Tabs.js +119 -83
  82. package/build/commonjs/Tabs/Tabs.js.map +1 -1
  83. package/build/commonjs/Tabs/TabsProps.js.map +1 -1
  84. package/build/commonjs/Tabs/index.js.map +1 -1
  85. package/build/commonjs/Tabs/types.js +2 -0
  86. package/build/commonjs/Tabs/types.js.map +1 -0
  87. package/build/commonjs/Tabs/useIndexStore.js +35 -0
  88. package/build/commonjs/Tabs/useIndexStore.js.map +1 -0
  89. package/build/commonjs/Tabs/useScrollViewReaction.js +69 -0
  90. package/build/commonjs/Tabs/useScrollViewReaction.js.map +1 -0
  91. package/build/commonjs/Tabs/useTabCoordinates.js +30 -0
  92. package/build/commonjs/Tabs/useTabCoordinates.js.map +1 -0
  93. package/build/commonjs/Tabs/useTabInnerContentsWidth.js +30 -0
  94. package/build/commonjs/Tabs/useTabInnerContentsWidth.js.map +1 -0
  95. package/build/commonjs/Tabs/utils.js +19 -0
  96. package/build/commonjs/Tabs/utils.js.map +1 -0
  97. package/build/commonjs/TextField/InputLabel.js +6 -3
  98. package/build/commonjs/TextField/InputLabel.js.map +1 -1
  99. package/build/commonjs/TextField/OutlinedTextField.js +6 -2
  100. package/build/commonjs/TextField/OutlinedTextField.js.map +1 -1
  101. package/build/commonjs/TextField/TextField.js +15 -8
  102. package/build/commonjs/TextField/TextField.js.map +1 -1
  103. package/build/commonjs/TextField/TextFieldProps.js.map +1 -1
  104. package/build/commonjs/Tooltip/Tooltip.js +50 -31
  105. package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
  106. package/build/commonjs/Tooltip/TooltipProps.js.map +1 -1
  107. package/build/commonjs/Typography/Typography.js +14 -5
  108. package/build/commonjs/Typography/Typography.js.map +1 -1
  109. package/build/commonjs/Typography/TypographyProps.js.map +1 -1
  110. package/build/commonjs/animated/AnimatedPressable.js +2 -3
  111. package/build/commonjs/animated/AnimatedPressable.js.map +1 -1
  112. package/build/commonjs/hooks/index.js +32 -0
  113. package/build/commonjs/hooks/index.js.map +1 -1
  114. package/build/commonjs/hooks/useAnimatedValue.js +31 -0
  115. package/build/commonjs/hooks/useAnimatedValue.js.map +1 -0
  116. package/build/commonjs/hooks/useCollapsibleAppBar.js +41 -54
  117. package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
  118. package/build/commonjs/hooks/useDebounce.js +33 -0
  119. package/build/commonjs/hooks/useDebounce.js.map +1 -0
  120. package/build/commonjs/hooks/useFadeInAppBar.js +21 -23
  121. package/build/commonjs/hooks/useFadeInAppBar.js.map +1 -1
  122. package/build/commonjs/hooks/useImperativeState.js +26 -0
  123. package/build/commonjs/hooks/useImperativeState.js.map +1 -0
  124. package/build/commonjs/hooks/useSyncAnimatedValue.js +40 -0
  125. package/build/commonjs/hooks/useSyncAnimatedValue.js.map +1 -0
  126. package/build/commonjs/hooks/useThrottle.js +3 -7
  127. package/build/commonjs/hooks/useThrottle.js.map +1 -1
  128. package/build/commonjs/hooks/useValidWindowDimensions/index.ios.js +14 -7
  129. package/build/commonjs/hooks/useValidWindowDimensions/index.ios.js.map +1 -1
  130. package/build/commonjs/index.js +35 -0
  131. package/build/commonjs/index.js.map +1 -1
  132. package/build/commonjs/internal/hooks/index.js +0 -8
  133. package/build/commonjs/internal/hooks/index.js.map +1 -1
  134. package/build/commonjs/internal/hooks/useHeight.js +3 -9
  135. package/build/commonjs/internal/hooks/useHeight.js.map +1 -1
  136. package/build/commonjs/internal/icons/Checkbox.js +1 -1
  137. package/build/commonjs/internal/icons/Checkbox.js.map +1 -1
  138. package/build/commonjs/internal/icons/CheckboxChecked.js +1 -1
  139. package/build/commonjs/internal/icons/CheckboxChecked.js.map +1 -1
  140. package/build/commonjs/internal/icons/ChevronDown.js +1 -1
  141. package/build/commonjs/internal/icons/ChevronDown.js.map +1 -1
  142. package/build/commonjs/internal/icons/ChevronLeft.js +1 -1
  143. package/build/commonjs/internal/icons/ChevronLeft.js.map +1 -1
  144. package/build/commonjs/internal/icons/ChevronRight.js +1 -1
  145. package/build/commonjs/internal/icons/ChevronRight.js.map +1 -1
  146. package/build/commonjs/internal/icons/Close.js +1 -1
  147. package/build/commonjs/internal/icons/Close.js.map +1 -1
  148. package/build/commonjs/internal/icons/Radio.js +1 -1
  149. package/build/commonjs/internal/icons/Radio.js.map +1 -1
  150. package/build/commonjs/internal/icons/RadioChecked.js +1 -1
  151. package/build/commonjs/internal/icons/RadioChecked.js.map +1 -1
  152. package/build/commonjs/store/MockStore.js +27 -0
  153. package/build/commonjs/store/MockStore.js.map +1 -0
  154. package/build/commonjs/store/SimpleStore.js +59 -0
  155. package/build/commonjs/store/SimpleStore.js.map +1 -0
  156. package/build/commonjs/store/index.js +24 -0
  157. package/build/commonjs/store/index.js.map +1 -0
  158. package/build/commonjs/store/types.js +2 -0
  159. package/build/commonjs/store/types.js.map +1 -0
  160. package/build/commonjs/types/index.js.map +1 -1
  161. package/build/commonjs/utils/index.js +8 -0
  162. package/build/commonjs/utils/index.js.map +1 -1
  163. package/build/commonjs/utils/isNotAndroid12.js +20 -0
  164. package/build/commonjs/utils/isNotAndroid12.js.map +1 -0
  165. package/build/module/Accordion/Accordion.js +111 -29
  166. package/build/module/Accordion/Accordion.js.map +1 -1
  167. package/build/module/Accordion/AccordionProps.js.map +1 -1
  168. package/build/module/Badge/Badge.js +5 -14
  169. package/build/module/Badge/Badge.js.map +1 -1
  170. package/build/module/Badge/BadgeProps.js.map +1 -1
  171. package/build/module/Button/Button.js +6 -3
  172. package/build/module/Button/Button.js.map +1 -1
  173. package/build/module/ButtonBase/ButtonBase.js +64 -49
  174. package/build/module/ButtonBase/ButtonBase.js.map +1 -1
  175. package/build/module/ButtonBase/ButtonBaseProps.js.map +1 -1
  176. package/build/module/Checkbox/CheckboxProps.js.map +1 -1
  177. package/build/module/Chip/Chip.js +11 -9
  178. package/build/module/Chip/Chip.js.map +1 -1
  179. package/build/module/Chip/ChipProps.js.map +1 -1
  180. package/build/module/CircularProgress/CircularProgress.js +25 -23
  181. package/build/module/CircularProgress/CircularProgress.js.map +1 -1
  182. package/build/module/Dialog/Dialog.js +109 -8
  183. package/build/module/Dialog/Dialog.js.map +1 -1
  184. package/build/module/Dialog/DialogProps.js.map +1 -1
  185. package/build/module/Divider/Divider.js +26 -18
  186. package/build/module/Divider/Divider.js.map +1 -1
  187. package/build/module/Divider/DividerProps.js.map +1 -1
  188. package/build/module/Image/Image.js +54 -12
  189. package/build/module/Image/Image.js.map +1 -1
  190. package/build/module/Image/ImageProps.js.map +1 -1
  191. package/build/module/Image/index.js.map +1 -1
  192. package/build/module/ImageCore/ImageCoreNative.js +31 -25
  193. package/build/module/ImageCore/ImageCoreNative.js.map +1 -1
  194. package/build/module/ImageCore/ImageCoreProps.js.map +1 -1
  195. package/build/module/ImageCore/ImageCoreWeb.js +19 -1
  196. package/build/module/ImageCore/ImageCoreWeb.js.map +1 -1
  197. package/build/module/ImageCore/ImageFileExtensionContext.js +5 -0
  198. package/build/module/ImageCore/ImageFileExtensionContext.js.map +1 -0
  199. package/build/module/ImageCore/ImageFileExtensionProvider.js +24 -0
  200. package/build/module/ImageCore/ImageFileExtensionProvider.js.map +1 -0
  201. package/build/module/ImageCore/index.js +2 -1
  202. package/build/module/ImageCore/index.js.map +1 -1
  203. package/build/module/ImageCore/index.native.js +2 -0
  204. package/build/module/ImageCore/index.native.js.map +1 -1
  205. package/build/module/Modal/AnimatedContainer/index.js +144 -0
  206. package/build/module/Modal/AnimatedContainer/index.js.map +1 -0
  207. package/build/module/Modal/Modal.js +43 -9
  208. package/build/module/Modal/Modal.js.map +1 -1
  209. package/build/module/Modal/ModalProps.js +5 -0
  210. package/build/module/Modal/ModalProps.js.map +1 -1
  211. package/build/module/Modal/index.js +2 -0
  212. package/build/module/Modal/index.js.map +1 -1
  213. package/build/module/Paper/Paper.js +1 -1
  214. package/build/module/Paper/Paper.js.map +1 -1
  215. package/build/module/Radio/Radio.js +9 -5
  216. package/build/module/Radio/Radio.js.map +1 -1
  217. package/build/module/Radio/RadioProps.js.map +1 -1
  218. package/build/module/Slide/Slide.js +39 -23
  219. package/build/module/Slide/Slide.js.map +1 -1
  220. package/build/module/Slide/SlideProps.js.map +1 -1
  221. package/build/module/Snackbar/Snackbar.js +25 -5
  222. package/build/module/Snackbar/Snackbar.js.map +1 -1
  223. package/build/module/Snackbar/SnackbarProps.js.map +1 -1
  224. package/build/module/SnackbarContent/SnackbarContent.js +21 -6
  225. package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
  226. package/build/module/SnackbarContent/SnackbarContentProps.js.map +1 -1
  227. package/build/module/SvgIcon/SvgIcon.js +1 -1
  228. package/build/module/SvgIcon/SvgIcon.js.map +1 -1
  229. package/build/module/Tab/Tab.js +63 -21
  230. package/build/module/Tab/Tab.js.map +1 -1
  231. package/build/module/Tab/TabIndicator.js +11 -7
  232. package/build/module/Tab/TabIndicator.js.map +1 -1
  233. package/build/module/Tab/TabProps.js.map +1 -1
  234. package/build/module/Tab/index.js.map +1 -1
  235. package/build/module/Tabs/IndexAwareTab.js +23 -0
  236. package/build/module/Tabs/IndexAwareTab.js.map +1 -0
  237. package/build/module/Tabs/InternalContext.js +7 -0
  238. package/build/module/Tabs/InternalContext.js.map +1 -0
  239. package/build/module/Tabs/ScrollableTabsView.js +22 -0
  240. package/build/module/Tabs/ScrollableTabsView.js.map +1 -0
  241. package/build/module/Tabs/TabIndicator.js +66 -25
  242. package/build/module/Tabs/TabIndicator.js.map +1 -1
  243. package/build/module/Tabs/TabIndicatorProps.js.map +1 -1
  244. package/build/module/Tabs/Tabs.js +109 -72
  245. package/build/module/Tabs/Tabs.js.map +1 -1
  246. package/build/module/Tabs/TabsProps.js.map +1 -1
  247. package/build/module/Tabs/index.js.map +1 -1
  248. package/build/module/Tabs/types.js +2 -0
  249. package/build/module/Tabs/types.js.map +1 -0
  250. package/build/module/Tabs/useIndexStore.js +25 -0
  251. package/build/module/Tabs/useIndexStore.js.map +1 -0
  252. package/build/module/Tabs/useScrollViewReaction.js +57 -0
  253. package/build/module/Tabs/useScrollViewReaction.js.map +1 -0
  254. package/build/module/Tabs/useTabCoordinates.js +21 -0
  255. package/build/module/Tabs/useTabCoordinates.js.map +1 -0
  256. package/build/module/Tabs/useTabInnerContentsWidth.js +21 -0
  257. package/build/module/Tabs/useTabInnerContentsWidth.js.map +1 -0
  258. package/build/module/Tabs/utils.js +9 -0
  259. package/build/module/Tabs/utils.js.map +1 -0
  260. package/build/module/TextField/InputLabel.js +7 -4
  261. package/build/module/TextField/InputLabel.js.map +1 -1
  262. package/build/module/TextField/OutlinedTextField.js +7 -3
  263. package/build/module/TextField/OutlinedTextField.js.map +1 -1
  264. package/build/module/TextField/TextField.js +13 -5
  265. package/build/module/TextField/TextField.js.map +1 -1
  266. package/build/module/TextField/TextFieldProps.js.map +1 -1
  267. package/build/module/Tooltip/Tooltip.js +48 -25
  268. package/build/module/Tooltip/Tooltip.js.map +1 -1
  269. package/build/module/Tooltip/TooltipProps.js.map +1 -1
  270. package/build/module/Typography/Typography.js +14 -5
  271. package/build/module/Typography/Typography.js.map +1 -1
  272. package/build/module/Typography/TypographyProps.js.map +1 -1
  273. package/build/module/animated/AnimatedPressable.js +2 -3
  274. package/build/module/animated/AnimatedPressable.js.map +1 -1
  275. package/build/module/hooks/index.js +4 -0
  276. package/build/module/hooks/index.js.map +1 -1
  277. package/build/module/hooks/useAnimatedValue.js +22 -0
  278. package/build/module/hooks/useAnimatedValue.js.map +1 -0
  279. package/build/module/hooks/useCollapsibleAppBar.js +42 -52
  280. package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
  281. package/build/module/hooks/useDebounce.js +25 -0
  282. package/build/module/hooks/useDebounce.js.map +1 -0
  283. package/build/module/hooks/useFadeInAppBar.js +23 -20
  284. package/build/module/hooks/useFadeInAppBar.js.map +1 -1
  285. package/build/module/hooks/useImperativeState.js +17 -0
  286. package/build/module/hooks/useImperativeState.js.map +1 -0
  287. package/build/module/hooks/useSyncAnimatedValue.js +28 -0
  288. package/build/module/hooks/useSyncAnimatedValue.js.map +1 -0
  289. package/build/module/hooks/useThrottle.js +3 -3
  290. package/build/module/hooks/useThrottle.js.map +1 -1
  291. package/build/module/hooks/useValidWindowDimensions/index.ios.js +15 -9
  292. package/build/module/hooks/useValidWindowDimensions/index.ios.js.map +1 -1
  293. package/build/module/index.js +3 -1
  294. package/build/module/index.js.map +1 -1
  295. package/build/module/internal/hooks/index.js +0 -1
  296. package/build/module/internal/hooks/index.js.map +1 -1
  297. package/build/module/internal/hooks/useHeight.js +3 -4
  298. package/build/module/internal/hooks/useHeight.js.map +1 -1
  299. package/build/module/internal/icons/Checkbox.js +1 -1
  300. package/build/module/internal/icons/Checkbox.js.map +1 -1
  301. package/build/module/internal/icons/CheckboxChecked.js +1 -1
  302. package/build/module/internal/icons/CheckboxChecked.js.map +1 -1
  303. package/build/module/internal/icons/ChevronDown.js +1 -1
  304. package/build/module/internal/icons/ChevronDown.js.map +1 -1
  305. package/build/module/internal/icons/ChevronLeft.js +1 -1
  306. package/build/module/internal/icons/ChevronLeft.js.map +1 -1
  307. package/build/module/internal/icons/ChevronRight.js +1 -1
  308. package/build/module/internal/icons/ChevronRight.js.map +1 -1
  309. package/build/module/internal/icons/Close.js +1 -1
  310. package/build/module/internal/icons/Close.js.map +1 -1
  311. package/build/module/internal/icons/Radio.js +1 -1
  312. package/build/module/internal/icons/Radio.js.map +1 -1
  313. package/build/module/internal/icons/RadioChecked.js +1 -1
  314. package/build/module/internal/icons/RadioChecked.js.map +1 -1
  315. package/build/module/store/MockStore.js +18 -0
  316. package/build/module/store/MockStore.js.map +1 -0
  317. package/build/module/store/SimpleStore.js +50 -0
  318. package/build/module/store/SimpleStore.js.map +1 -0
  319. package/build/module/store/index.js +3 -0
  320. package/build/module/store/index.js.map +1 -0
  321. package/build/module/store/types.js +2 -0
  322. package/build/module/store/types.js.map +1 -0
  323. package/build/module/types/index.js.map +1 -1
  324. package/build/module/utils/index.js +1 -0
  325. package/build/module/utils/index.js.map +1 -1
  326. package/build/module/utils/isNotAndroid12.js +6 -0
  327. package/build/module/utils/isNotAndroid12.js.map +1 -0
  328. package/build/typescript/Accordion/Accordion.d.ts +1 -0
  329. package/build/typescript/Accordion/AccordionProps.d.ts +14 -11
  330. package/build/typescript/AspectRatio/AspectRatioNative.d.ts +1 -0
  331. package/build/typescript/AspectRatio/AspectRatioWeb.d.ts +1 -0
  332. package/build/typescript/Avatar/Avatar.d.ts +1 -0
  333. package/build/typescript/Badge/Badge.d.ts +1 -0
  334. package/build/typescript/Badge/BadgeProps.d.ts +5 -0
  335. package/build/typescript/Button/Button.d.ts +1 -0
  336. package/build/typescript/ButtonBase/ButtonBase.d.ts +1 -0
  337. package/build/typescript/ButtonBase/ButtonBaseProps.d.ts +8 -0
  338. package/build/typescript/Card/Card.d.ts +1 -0
  339. package/build/typescript/CardActions/CardActions.d.ts +1 -0
  340. package/build/typescript/CardContent/CardContent.d.ts +1 -0
  341. package/build/typescript/CardMedia/CardMedia.d.ts +1 -0
  342. package/build/typescript/Checkbox/Checkbox.d.ts +1 -0
  343. package/build/typescript/Checkbox/CheckboxProps.d.ts +1 -1
  344. package/build/typescript/Chip/Chip.d.ts +1 -0
  345. package/build/typescript/Chip/ChipProps.d.ts +4 -0
  346. package/build/typescript/CircularProgress/CircularProgress.d.ts +3 -2
  347. package/build/typescript/Column/Column.d.ts +1 -0
  348. package/build/typescript/Dialog/Dialog.d.ts +1 -0
  349. package/build/typescript/Dialog/DialogProps.d.ts +10 -0
  350. package/build/typescript/DialogActions/DialogActions.d.ts +1 -0
  351. package/build/typescript/DialogContent/DialogContent.d.ts +1 -0
  352. package/build/typescript/DialogMedia/DialogMedia.d.ts +1 -0
  353. package/build/typescript/DialogTitle/DialogTitle.d.ts +1 -0
  354. package/build/typescript/Divider/Divider.d.ts +1 -0
  355. package/build/typescript/Divider/DividerProps.d.ts +22 -1
  356. package/build/typescript/Fab/Fab.d.ts +1 -0
  357. package/build/typescript/Flexbox/Flexbox.d.ts +1 -0
  358. package/build/typescript/IconButton/IconButton.d.ts +1 -0
  359. package/build/typescript/Image/Image.d.ts +1 -0
  360. package/build/typescript/Image/ImageProps.d.ts +30 -2
  361. package/build/typescript/Image/index.d.ts +1 -1
  362. package/build/typescript/ImageCore/ImageCoreNative.d.ts +1 -0
  363. package/build/typescript/ImageCore/ImageCoreProps.d.ts +5 -1
  364. package/build/typescript/ImageCore/ImageCoreWeb.d.ts +1 -0
  365. package/build/typescript/ImageCore/ImageFileExtensionContext.d.ts +3 -0
  366. package/build/typescript/ImageCore/ImageFileExtensionProvider.d.ts +13 -0
  367. package/build/typescript/ImageCore/index.d.ts +3 -1
  368. package/build/typescript/ImageCore/index.native.d.ts +2 -0
  369. package/build/typescript/Link/Link.d.ts +1 -0
  370. package/build/typescript/List/List.d.ts +1 -0
  371. package/build/typescript/ListItem/ListItem.d.ts +1 -0
  372. package/build/typescript/ListItemIcon/ListItemIcon.d.ts +1 -0
  373. package/build/typescript/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +1 -0
  374. package/build/typescript/ListItemText/ListItemText.d.ts +1 -0
  375. package/build/typescript/ListSubheader/ListSubheader.d.ts +1 -0
  376. package/build/typescript/Menu/Menu.d.ts +1 -0
  377. package/build/typescript/MenuItem/MenuItem.d.ts +1 -0
  378. package/build/typescript/Modal/AnimatedContainer/index.d.ts +5 -0
  379. package/build/typescript/Modal/Modal.d.ts +1 -0
  380. package/build/typescript/Modal/ModalProps.d.ts +47 -0
  381. package/build/typescript/Modal/index.d.ts +4 -1
  382. package/build/typescript/Pagination/Pagination.d.ts +1 -0
  383. package/build/typescript/Portal/Portal.d.ts +1 -0
  384. package/build/typescript/Radio/Radio.d.ts +1 -0
  385. package/build/typescript/Radio/RadioProps.d.ts +13 -0
  386. package/build/typescript/RadioGroup/RadioGroup.d.ts +1 -0
  387. package/build/typescript/Row/Row.d.ts +1 -0
  388. package/build/typescript/Slide/Slide.d.ts +1 -0
  389. package/build/typescript/Slide/SlideProps.d.ts +2 -3
  390. package/build/typescript/Slider/Slider.d.ts +1 -1
  391. package/build/typescript/Snackbar/Snackbar.d.ts +1 -0
  392. package/build/typescript/Snackbar/SnackbarProps.d.ts +10 -3
  393. package/build/typescript/SnackbarContent/SnackbarContent.d.ts +1 -0
  394. package/build/typescript/SnackbarContent/SnackbarContentProps.d.ts +9 -0
  395. package/build/typescript/Spacer/Spacer.d.ts +1 -0
  396. package/build/typescript/SvgIcon/SvgIcon.d.ts +1 -0
  397. package/build/typescript/Switch/Switch.d.ts +1 -0
  398. package/build/typescript/Tab/Tab.d.ts +1 -0
  399. package/build/typescript/Tab/TabIndicator.d.ts +5 -1
  400. package/build/typescript/Tab/TabProps.d.ts +21 -2
  401. package/build/typescript/Tab/index.d.ts +1 -1
  402. package/build/typescript/TabBase/TabBase.d.ts +1 -0
  403. package/build/typescript/Tabs/IndexAwareTab.d.ts +8 -0
  404. package/build/typescript/Tabs/InternalContext.d.ts +7 -0
  405. package/build/typescript/Tabs/ScrollableTabsView.d.ts +8 -0
  406. package/build/typescript/Tabs/TabIndicator.d.ts +1 -0
  407. package/build/typescript/Tabs/TabIndicatorProps.d.ts +10 -5
  408. package/build/typescript/Tabs/Tabs.d.ts +4 -1
  409. package/build/typescript/Tabs/TabsProps.d.ts +37 -13
  410. package/build/typescript/Tabs/index.d.ts +1 -0
  411. package/build/typescript/Tabs/types.d.ts +9 -0
  412. package/build/typescript/Tabs/useIndexStore.d.ts +3 -0
  413. package/build/typescript/Tabs/useScrollViewReaction.d.ts +8 -0
  414. package/build/typescript/Tabs/useTabCoordinates.d.ts +6 -0
  415. package/build/typescript/Tabs/useTabInnerContentsWidth.d.ts +6 -0
  416. package/build/typescript/Tabs/utils.d.ts +3 -0
  417. package/build/typescript/TextField/InputLabel.d.ts +1 -0
  418. package/build/typescript/TextField/TextFieldProps.d.ts +3 -0
  419. package/build/typescript/Toolbar/Toolbar.d.ts +1 -0
  420. package/build/typescript/Tooltip/Tooltip.d.ts +1 -0
  421. package/build/typescript/Tooltip/TooltipProps.d.ts +26 -1
  422. package/build/typescript/Typography/TypographyProps.d.ts +22 -1
  423. package/build/typescript/animated/AnimatedPressable.d.ts +2 -2
  424. package/build/typescript/hooks/index.d.ts +5 -0
  425. package/build/typescript/hooks/useAnimatedValue.d.ts +2 -0
  426. package/build/typescript/hooks/useCollapsibleAppBar.d.ts +2 -0
  427. package/build/typescript/hooks/useDebounce.d.ts +1 -0
  428. package/build/typescript/hooks/useFadeInAppBar.d.ts +1 -0
  429. package/build/typescript/hooks/useImperativeState.d.ts +6 -0
  430. package/build/typescript/hooks/useSyncAnimatedValue.d.ts +6 -0
  431. package/build/typescript/hooks/useValidWindowDimensions/index.ios.d.ts +2 -1
  432. package/build/typescript/index.d.ts +4 -2
  433. package/build/typescript/internal/hooks/index.d.ts +0 -1
  434. package/build/typescript/internal/icons/Checkbox.d.ts +9 -7
  435. package/build/typescript/internal/icons/CheckboxChecked.d.ts +9 -7
  436. package/build/typescript/internal/icons/ChevronDown.d.ts +9 -7
  437. package/build/typescript/internal/icons/ChevronLeft.d.ts +9 -7
  438. package/build/typescript/internal/icons/ChevronRight.d.ts +9 -7
  439. package/build/typescript/internal/icons/CircularProgress.d.ts +1 -0
  440. package/build/typescript/internal/icons/Close.d.ts +9 -7
  441. package/build/typescript/internal/icons/Radio.d.ts +9 -7
  442. package/build/typescript/internal/icons/RadioChecked.d.ts +9 -7
  443. package/build/typescript/store/MockStore.d.ts +7 -0
  444. package/build/typescript/store/SimpleStore.d.ts +10 -0
  445. package/build/typescript/store/index.d.ts +3 -0
  446. package/build/typescript/store/types.d.ts +10 -0
  447. package/build/typescript/types/index.d.ts +6 -0
  448. package/build/typescript/utils/index.d.ts +1 -0
  449. package/build/typescript/utils/isNotAndroid12.d.ts +2 -0
  450. package/package.json +9 -9
  451. package/src/Accordion/Accordion.tsx +147 -51
  452. package/src/Accordion/AccordionProps.ts +15 -11
  453. package/src/Badge/Badge.tsx +6 -16
  454. package/src/Badge/BadgeProps.ts +6 -0
  455. package/src/Button/Button.tsx +8 -2
  456. package/src/ButtonBase/ButtonBase.tsx +79 -44
  457. package/src/ButtonBase/ButtonBaseProps.ts +10 -0
  458. package/src/Checkbox/CheckboxProps.ts +1 -1
  459. package/src/Chip/Chip.tsx +13 -9
  460. package/src/Chip/ChipProps.ts +5 -0
  461. package/src/CircularProgress/CircularProgress.tsx +41 -33
  462. package/src/Dialog/Dialog.tsx +136 -14
  463. package/src/Dialog/DialogProps.ts +12 -0
  464. package/src/Divider/Divider.tsx +23 -14
  465. package/src/Divider/DividerProps.ts +27 -1
  466. package/src/Image/Image.tsx +78 -16
  467. package/src/Image/ImageProps.ts +36 -2
  468. package/src/Image/index.ts +1 -1
  469. package/src/ImageCore/ImageCoreNative.tsx +29 -19
  470. package/src/ImageCore/ImageCoreProps.ts +6 -1
  471. package/src/ImageCore/ImageCoreWeb.tsx +22 -2
  472. package/src/ImageCore/ImageFileExtensionContext.ts +7 -0
  473. package/src/ImageCore/ImageFileExtensionProvider.tsx +33 -0
  474. package/src/ImageCore/index.native.ts +3 -1
  475. package/src/ImageCore/index.ts +4 -1
  476. package/src/Modal/AnimatedContainer/index.tsx +172 -0
  477. package/src/Modal/Modal.tsx +44 -12
  478. package/src/Modal/ModalProps.ts +59 -1
  479. package/src/Modal/index.ts +4 -1
  480. package/src/Paper/Paper.tsx +1 -1
  481. package/src/Radio/Radio.tsx +10 -7
  482. package/src/Radio/RadioProps.ts +16 -0
  483. package/src/Slide/Slide.tsx +33 -27
  484. package/src/Slide/SlideProps.ts +2 -3
  485. package/src/Snackbar/Snackbar.tsx +33 -7
  486. package/src/Snackbar/SnackbarProps.ts +19 -9
  487. package/src/SnackbarContent/SnackbarContent.tsx +42 -10
  488. package/src/SnackbarContent/SnackbarContentProps.ts +14 -3
  489. package/src/SvgIcon/SvgIcon.tsx +1 -1
  490. package/src/Tab/Tab.tsx +85 -28
  491. package/src/Tab/TabIndicator.tsx +17 -15
  492. package/src/Tab/TabProps.ts +24 -2
  493. package/src/Tab/index.ts +1 -1
  494. package/src/Tabs/IndexAwareTab.tsx +29 -0
  495. package/src/Tabs/InternalContext.ts +13 -0
  496. package/src/Tabs/ScrollableTabsView.tsx +28 -0
  497. package/src/Tabs/TabIndicator.tsx +74 -37
  498. package/src/Tabs/TabIndicatorProps.ts +12 -5
  499. package/src/Tabs/Tabs.tsx +139 -93
  500. package/src/Tabs/TabsProps.ts +43 -23
  501. package/src/Tabs/index.ts +2 -1
  502. package/src/Tabs/types.ts +18 -0
  503. package/src/Tabs/useIndexStore.ts +31 -0
  504. package/src/Tabs/useScrollViewReaction.ts +62 -0
  505. package/src/Tabs/useTabCoordinates.ts +25 -0
  506. package/src/Tabs/useTabInnerContentsWidth.ts +26 -0
  507. package/src/Tabs/utils.ts +14 -0
  508. package/src/TextField/InputLabel.tsx +6 -1
  509. package/src/TextField/OutlinedTextField.tsx +8 -2
  510. package/src/TextField/TextField.tsx +10 -4
  511. package/src/TextField/TextFieldProps.ts +4 -0
  512. package/src/Tooltip/Tooltip.tsx +57 -26
  513. package/src/Tooltip/TooltipProps.ts +26 -1
  514. package/src/Typography/Typography.tsx +12 -3
  515. package/src/Typography/TypographyProps.ts +30 -1
  516. package/src/animated/AnimatedPressable.tsx +1 -2
  517. package/src/hooks/index.ts +6 -0
  518. package/src/hooks/useAnimatedValue.ts +21 -0
  519. package/src/hooks/useCollapsibleAppBar.ts +64 -47
  520. package/src/hooks/useDebounce.ts +23 -0
  521. package/src/hooks/useFadeInAppBar.ts +23 -17
  522. package/src/hooks/useImperativeState.ts +24 -0
  523. package/src/hooks/useSyncAnimatedValue.ts +38 -0
  524. package/src/hooks/useThrottle.ts +3 -3
  525. package/src/hooks/useValidWindowDimensions/index.ios.ts +16 -10
  526. package/src/index.ts +6 -2
  527. package/src/internal/hooks/index.ts +0 -1
  528. package/src/internal/hooks/useHeight.ts +4 -5
  529. package/src/internal/icons/Checkbox.tsx +1 -1
  530. package/src/internal/icons/CheckboxChecked.tsx +1 -1
  531. package/src/internal/icons/ChevronDown.tsx +1 -1
  532. package/src/internal/icons/ChevronLeft.tsx +1 -1
  533. package/src/internal/icons/ChevronRight.tsx +1 -1
  534. package/src/internal/icons/Close.tsx +1 -1
  535. package/src/internal/icons/Radio.tsx +1 -1
  536. package/src/internal/icons/RadioChecked.tsx +1 -1
  537. package/src/store/MockStore.ts +21 -0
  538. package/src/store/SimpleStore.ts +50 -0
  539. package/src/store/index.ts +3 -0
  540. package/src/store/types.ts +12 -0
  541. package/src/types/index.ts +7 -0
  542. package/src/utils/index.ts +1 -0
  543. package/src/utils/isNotAndroid12.ts +7 -0
  544. package/build/commonjs/ButtonBase/ButtonBase.ios.js +0 -101
  545. package/build/commonjs/ButtonBase/ButtonBase.ios.js.map +0 -1
  546. package/build/commonjs/ButtonBase/useDisabledReaction/index.js +0 -21
  547. package/build/commonjs/ButtonBase/useDisabledReaction/index.js.map +0 -1
  548. package/build/commonjs/ButtonBase/useDisabledReaction/index.native.js +0 -9
  549. package/build/commonjs/ButtonBase/useDisabledReaction/index.native.js.map +0 -1
  550. package/build/commonjs/ImageCore/ImageCoreNative.ios.js +0 -60
  551. package/build/commonjs/ImageCore/ImageCoreNative.ios.js.map +0 -1
  552. package/build/commonjs/internal/hooks/useWidth.js +0 -29
  553. package/build/commonjs/internal/hooks/useWidth.js.map +0 -1
  554. package/build/module/ButtonBase/ButtonBase.ios.js +0 -82
  555. package/build/module/ButtonBase/ButtonBase.ios.js.map +0 -1
  556. package/build/module/ButtonBase/useDisabledReaction/index.js +0 -12
  557. package/build/module/ButtonBase/useDisabledReaction/index.js.map +0 -1
  558. package/build/module/ButtonBase/useDisabledReaction/index.native.js +0 -2
  559. package/build/module/ButtonBase/useDisabledReaction/index.native.js.map +0 -1
  560. package/build/module/ImageCore/ImageCoreNative.ios.js +0 -45
  561. package/build/module/ImageCore/ImageCoreNative.ios.js.map +0 -1
  562. package/build/module/internal/hooks/useWidth.js +0 -15
  563. package/build/module/internal/hooks/useWidth.js.map +0 -1
  564. package/build/typescript/ButtonBase/ButtonBase.ios.d.ts +0 -2
  565. package/build/typescript/ButtonBase/useDisabledReaction/index.d.ts +0 -2
  566. package/build/typescript/ButtonBase/useDisabledReaction/index.native.d.ts +0 -2
  567. package/build/typescript/ImageCore/ImageCoreNative.ios.d.ts +0 -2
  568. package/build/typescript/internal/hooks/useWidth.d.ts +0 -2
  569. package/src/ButtonBase/ButtonBase.ios.tsx +0 -95
  570. package/src/ButtonBase/useDisabledReaction/index.native.ts +0 -4
  571. package/src/ButtonBase/useDisabledReaction/index.ts +0 -16
  572. package/src/ImageCore/ImageCoreNative.ios.tsx +0 -46
  573. package/src/internal/hooks/useWidth.ts +0 -17
@@ -1 +1 @@
1
- {"version":3,"names":["ORIGINAL_OPACITY","DISABLED_OPACITY","ACTIVE_OPACITY","ORIGINAL_SCALE","MINIFIED_SCALE","animationTimingConfig","duration","styles","StyleSheet","create","disabled","opacity","transform","scale","ButtonBase","props","children","disableThrottle","onPress","pressEffect","style","throttleMillis","otherProps","handlePress","useThrottle","periodMillis","callback","useSharedValue","animatedStyle","useAnimatedStyle","value","useDisabledReaction","startAnimation","pressIn","isHovered","withTiming","withDelay","undefined","hovered"],"sources":["ButtonBase.tsx"],"sourcesContent":["import React from 'react';\nimport type { WithTimingConfig } from 'react-native-reanimated';\nimport { useAnimatedStyle, useSharedValue, withDelay, withTiming } from 'react-native-reanimated';\nimport { useThrottle } from '../hooks';\nimport { AnimatedPressable } from '../animated';\nimport { StyleSheet } from '../styles';\nimport type ButtonBaseProps from './ButtonBaseProps';\nimport useDisabledReaction from './useDisabledReaction';\n\nexport const ORIGINAL_OPACITY = 1;\nexport const DISABLED_OPACITY = .3;\nconst ACTIVE_OPACITY = .65;\n\nconst ORIGINAL_SCALE = 1;\nconst MINIFIED_SCALE = .96;\n\nconst animationTimingConfig: WithTimingConfig = { duration: 150 };\n\nconst styles = StyleSheet.create({\n disabled: {\n opacity: DISABLED_OPACITY,\n transform: [{ scale: ORIGINAL_SCALE }],\n },\n});\n\nexport default function ButtonBase(props: ButtonBaseProps) {\n const {\n children,\n disabled = false,\n disableThrottle = false,\n onPress,\n pressEffect = 'opacity',\n style,\n throttleMillis = 650,\n ...otherProps\n } = props;\n\n const handlePress = useThrottle({\n periodMillis: disableThrottle ? 0 : throttleMillis,\n callback: onPress,\n });\n\n const opacity = useSharedValue(ORIGINAL_OPACITY);\n const scale = useSharedValue(ORIGINAL_SCALE);\n\n const animatedStyle = useAnimatedStyle(() => ({\n opacity: opacity.value,\n transform: [{ scale: scale.value }],\n }));\n\n useDisabledReaction(disabled, opacity);\n\n const startAnimation = (pressIn: boolean, isHovered: boolean = false) => {\n if (pressEffect === 'none') {\n return;\n }\n\n if (pressEffect === 'opacity') {\n if (pressIn) {\n opacity.value = ACTIVE_OPACITY;\n } else {\n opacity.value = withTiming(ORIGINAL_OPACITY, animationTimingConfig);\n }\n } else if (!isHovered) {\n if (pressIn) {\n scale.value = withDelay(\n 100,\n withTiming(MINIFIED_SCALE, animationTimingConfig),\n );\n } else {\n scale.value = withTiming(ORIGINAL_SCALE, animationTimingConfig);\n }\n }\n };\n\n return (\n <AnimatedPressable\n disabled={disabled}\n onPress={handlePress}\n onPressIn={() => startAnimation(true)}\n onPressOut={() => startAnimation(false)}\n style={[\n animatedStyle,\n disabled ? styles.disabled : undefined,\n style,\n ]}\n {...otherProps}\n >\n {typeof children !== 'function' ? (\n ({ hovered }) => {\n if (hovered !== undefined && !disabled) {\n startAnimation(hovered, true);\n }\n\n return children;\n }\n ) : children}\n </AnimatedPressable>\n );\n};\n"],"mappings":";;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEO,MAAMA,gBAAgB,GAAG,CAAzB;;AACA,MAAMC,gBAAgB,GAAG,EAAzB;;AACP,MAAMC,cAAc,GAAG,GAAvB;AAEA,MAAMC,cAAc,GAAG,CAAvB;AACA,MAAMC,cAAc,GAAG,GAAvB;AAEA,MAAMC,qBAAuC,GAAG;EAAEC,QAAQ,EAAE;AAAZ,CAAhD;;AAEA,MAAMC,MAAM,GAAGC,kBAAA,CAAWC,MAAX,CAAkB;EAC7BC,QAAQ,EAAE;IACNC,OAAO,EAAEV,gBADH;IAENW,SAAS,EAAE,CAAC;MAAEC,KAAK,EAAEV;IAAT,CAAD;EAFL;AADmB,CAAlB,CAAf;;AAOe,SAASW,UAAT,CAAoBC,KAApB,EAA4C;EACvD,MAAM;IACFC,QADE;IAEFN,QAAQ,GAAG,KAFT;IAGFO,eAAe,GAAG,KAHhB;IAIFC,OAJE;IAKFC,WAAW,GAAG,SALZ;IAMFC,KANE;IAOFC,cAAc,GAAG,GAPf;IAQF,GAAGC;EARD,IASFP,KATJ;EAWA,MAAMQ,WAAW,GAAG,IAAAC,kBAAA,EAAY;IAC5BC,YAAY,EAAER,eAAe,GAAG,CAAH,GAAOI,cADR;IAE5BK,QAAQ,EAAER;EAFkB,CAAZ,CAApB;EAKA,MAAMP,OAAO,GAAG,IAAAgB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,MAAM,CAACG,QAAV,GAAqB2B,SAF1B,EAGHjB,KAHG;EALX,GAUQE,UAVR,GAYK,OAAON,QAAP,KAAoB,UAApB,GACG,QAAiB;IAAA,IAAhB;MAAEsB;IAAF,CAAgB;;IACb,IAAIA,OAAO,KAAKD,SAAZ,IAAyB,CAAC3B,QAA9B,EAAwC;MACpCsB,cAAc,CAACM,OAAD,EAAU,IAAV,CAAd;IACH;;IAED,OAAOtB,QAAP;EACH,CAPJ,GAQGA,QApBR,CADJ;AAwBH;;AAAA"}
1
+ {"version":3,"names":["ORIGINAL_OPACITY","DISABLED_OPACITY","ACTIVE_OPACITY","ORIGINAL_SCALE","MINIFIED_SCALE","SCALE_EFFECT_PRESS_IN_DELAY","OPACITY_EFFECT_PRESS_IN_DELAY","startTimingAnimationWithDefaults","value","toValue","Animated","timing","duration","useNativeDriver","isNotAndroid12","start","getOpacityByDisabled","disabled","ButtonBase","props","children","disableThrottle","onPress","onPressOut","pressEffect","pressDelay","pressDelayOrNil","style","styleProp","throttleMillis","otherProps","handlePress","useThrottle","periodMillis","callback","opacity","useAnimatedValue","scale","useEffect","setValue","startScaleAnimation","useCallback","pressIn","isHover","startOpacityAnimation","startPressAnimation","handlePressIn","handlePressOut","animatedStyle","transform","defaultPressDelay","hovered","undefined"],"sources":["ButtonBase.tsx"],"sourcesContent":["import React, { useCallback, useEffect } from 'react';\nimport { Animated } from 'react-native';\nimport { useAnimatedValue, useThrottle } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\nimport { AnimatedPressable } from '../animated';\nimport type ButtonBaseProps from './ButtonBaseProps';\n\ninterface StartPressAnimation {\n (pressIn: boolean, isHover: boolean): void;\n}\n\nexport const ORIGINAL_OPACITY = 1;\nexport const DISABLED_OPACITY = .3;\nconst ACTIVE_OPACITY = .65;\n\nconst ORIGINAL_SCALE = 1;\nconst MINIFIED_SCALE = .96;\n\n// at \"node_modules/react-native/Libraries/Pressability.js\"\n// const DEFAULT_MIN_PRESS_DURATION = 130;\nconst SCALE_EFFECT_PRESS_IN_DELAY = 130;\nconst OPACITY_EFFECT_PRESS_IN_DELAY = 0;\n\ntype TimingAnimationValue = Animated.Value | Animated.ValueXY;\ntype TimingAnimationToValue = Animated.TimingAnimationConfig['toValue'];\n\nconst startTimingAnimationWithDefaults = (\n value: TimingAnimationValue,\n toValue: TimingAnimationToValue,\n) => {\n Animated.timing(value, {\n toValue,\n duration: 150,\n useNativeDriver: isNotAndroid12,\n }).start();\n};\n\nconst getOpacityByDisabled = (disabled: boolean) => disabled ? DISABLED_OPACITY : ORIGINAL_OPACITY;\n\nexport default function ButtonBase(props: ButtonBaseProps) {\n const {\n children,\n disabled = false,\n disableThrottle = false,\n onPress,\n onPressOut,\n pressEffect = 'opacity',\n pressDelay: pressDelayOrNil,\n style: styleProp,\n throttleMillis = 650,\n ...otherProps\n } = props;\n\n const handlePress = useThrottle({\n periodMillis: disableThrottle ? 0 : throttleMillis,\n callback: onPress,\n });\n\n const opacity = useAnimatedValue(getOpacityByDisabled(disabled));\n const scale = useAnimatedValue(ORIGINAL_SCALE);\n\n useEffect(() => {\n opacity.setValue(getOpacityByDisabled(disabled));\n }, [disabled, pressEffect]);\n\n const startScaleAnimation = useCallback<StartPressAnimation>((pressIn, isHover) => {\n if (!isHover) {\n startTimingAnimationWithDefaults(\n scale,\n pressIn ? MINIFIED_SCALE : ORIGINAL_SCALE,\n );\n }\n }, []);\n\n const startOpacityAnimation = useCallback<StartPressAnimation>((pressIn) => {\n if (pressIn) {\n opacity.setValue(ACTIVE_OPACITY);\n } else {\n startTimingAnimationWithDefaults(opacity, ORIGINAL_OPACITY);\n }\n }, []);\n\n const startPressAnimation = useCallback<StartPressAnimation>((pressIn, isHover = false) => {\n if (pressEffect === 'scale') {\n startScaleAnimation(pressIn, isHover);\n } else if (pressEffect === 'opacity') {\n startOpacityAnimation(pressIn, isHover);\n }\n }, [pressEffect]);\n\n const handlePressIn = useCallback(() => {\n startPressAnimation(true, false);\n }, [startPressAnimation]);\n\n const handlePressOut = useCallback(() => {\n onPressOut && onPressOut();\n\n startPressAnimation(false, false);\n }, [startPressAnimation, onPressOut]);\n\n const animatedStyle = {\n opacity,\n transform: [{ scale }],\n };\n\n const defaultPressDelay = pressEffect === 'scale'\n ? SCALE_EFFECT_PRESS_IN_DELAY\n : OPACITY_EFFECT_PRESS_IN_DELAY;\n const pressDelay = pressDelayOrNil ?? defaultPressDelay;\n\n return (\n <AnimatedPressable\n disabled={disabled}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n style={[\n animatedStyle,\n styleProp,\n ]}\n unstable_pressDelay={pressDelay}\n {...otherProps}\n >\n {typeof children !== 'function' ? (\n ({ hovered }) => {\n if (hovered !== undefined && !disabled) {\n startPressAnimation(hovered, true);\n }\n\n return children;\n }\n ) : children}\n </AnimatedPressable>\n );\n};\n"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAOO,MAAMA,gBAAgB,GAAG,CAAzB;;AACA,MAAMC,gBAAgB,GAAG,EAAzB;;AACP,MAAMC,cAAc,GAAG,GAAvB;AAEA,MAAMC,cAAc,GAAG,CAAvB;AACA,MAAMC,cAAc,GAAG,GAAvB,C,CAEA;AACA;;AACA,MAAMC,2BAA2B,GAAG,GAApC;AACA,MAAMC,6BAA6B,GAAG,CAAtC;;AAKA,MAAMC,gCAAgC,GAAG,CACrCC,KADqC,EAErCC,OAFqC,KAGpC;EACDC,qBAAA,CAASC,MAAT,CAAgBH,KAAhB,EAAuB;IACnBC,OADmB;IAEnBG,QAAQ,EAAE,GAFS;IAGnBC,eAAe,EAAEC;EAHE,CAAvB,EAIGC,KAJH;AAKH,CATD;;AAWA,MAAMC,oBAAoB,GAAIC,QAAD,IAAuBA,QAAQ,GAAGhB,gBAAH,GAAsBD,gBAAlF;;AAEe,SAASkB,UAAT,CAAoBC,KAApB,EAA4C;EACvD,MAAM;IACFC,QADE;IAEFH,QAAQ,GAAG,KAFT;IAGFI,eAAe,GAA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AAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["ButtonBaseProps.ts"],"sourcesContent":["import type { PressableProps } from '../Pressable';\nimport type { OverridableComponentProps } from '../types';\n\nexport type PressEffect = 'opacity' | 'scale' | 'none';\n\nexport default interface ButtonBaseProps extends OverridableComponentProps<PressableProps, {\n /**\n * Content of the ButtonBase.\n */\n children: PressableProps['children'];\n\n /**\n * Whether to prevent interaction with the ButtonBase.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Whether to debounce when button is pressed\n * @default false\n */\n disableThrottle?: boolean;\n\n /**\n * Function to execute on press. If not set, will cause the ButtonBase to be disabled.\n */\n onPress?: () => void;\n\n /**\n * Applied press effect.\n * @default 'opacity'\n */\n pressEffect?: PressEffect;\n\n /**\n * The millisecond for debouncing.\n * @default 650\n */\n throttleMillis?: number;\n}> {}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["ButtonBaseProps.ts"],"sourcesContent":["import type { PressableProps } from '../Pressable';\nimport type { OverridableComponentProps } from '../types';\n\nexport type PressEffect = 'opacity' | 'scale' | 'none';\n\nexport default interface ButtonBaseProps extends OverridableComponentProps<PressableProps, {\n /**\n * Content of the ButtonBase.\n */\n children: PressableProps['children'];\n\n /**\n * Whether to prevent interaction with the ButtonBase.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Whether to debounce when button is pressed\n * @default false\n */\n disableThrottle?: boolean;\n\n /**\n * Function to execute on press. If not set, will cause the ButtonBase to be disabled.\n */\n onPress?: () => void;\n\n /**\n * Function to execute on press out.\n */\n onPressOut?: () => void;\n\n /**\n * Applied press effect.\n * @default 'opacity'\n */\n pressEffect?: PressEffect;\n\n /**\n * The milliseconds to delay effect.\n */\n pressDelay?: number;\n\n /**\n * The millisecond for debouncing.\n * @default 650\n */\n throttleMillis?: number;\n}> {}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["CheckboxProps.ts"],"sourcesContent":["import React from 'react';\nimport type { CommonComponentColor, OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\ntype BaseProps = Omit<ButtonBaseProps, 'onPress'>;\n\nexport type CheckboxColor = CommonComponentColor;\n\nexport default interface CheckboxProps extends OverridableComponentProps<BaseProps, {\n /**\n * If `true`, the component is checked.\n * @default false\n */\n checked?: boolean;\n\n /**\n * The checked Icon which is replaced.\n */\n checkedIcon?: React.ReactElement;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'primary'\n */\n color?: CheckboxColor;\n\n /**\n * If `true`, the checkbox is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * The unchecked Icon which is replaced.\n */\n icon?: React.ReactElement;\n\n /**\n * Callback fired when the state is changed.\n */\n onChange?: (newChecked: boolean) => void;\n}> {}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["CheckboxProps.ts"],"sourcesContent":["import React from 'react';\nimport type { CommonComponentColor, OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\ntype BaseProps = Omit<ButtonBaseProps, 'onPress' | 'children'>;\n\nexport type CheckboxColor = CommonComponentColor;\n\nexport default interface CheckboxProps extends OverridableComponentProps<BaseProps, {\n /**\n * If `true`, the component is checked.\n * @default false\n */\n checked?: boolean;\n\n /**\n * The checked Icon which is replaced.\n */\n checkedIcon?: React.ReactElement;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'primary'\n */\n color?: CheckboxColor;\n\n /**\n * If `true`, the checkbox is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * The unchecked Icon which is replaced.\n */\n icon?: React.ReactElement;\n\n /**\n * Callback fired when the state is changed.\n */\n onChange?: (newChecked: boolean) => void;\n}> {}\n"],"mappings":""}
@@ -19,19 +19,19 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
19
19
 
20
20
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
21
 
22
- const ICON_SIZE = 16;
22
+ const ICON_SIZE = 20;
23
23
 
24
24
  const useStyles = function () {
25
25
  const theme = (0, _styles.useTheme)();
26
26
  return {
27
27
  root: {
28
28
  alignItems: 'center',
29
- borderRadius: 20,
29
+ borderRadius: theme.shape.roundnessExtra,
30
30
  flexDirection: 'row',
31
31
  height: 32,
32
32
  justifyContent: 'center',
33
- paddingLeft: theme.spacing(2),
34
- paddingRight: theme.spacing(2)
33
+ paddingLeft: theme.spacing(3),
34
+ paddingRight: theme.spacing(3)
35
35
  }
36
36
  };
37
37
  };
@@ -40,6 +40,7 @@ function Chip(props) {
40
40
  const {
41
41
  children,
42
42
  endIcon: endIconProp,
43
+ numberOfLines,
43
44
  onPress,
44
45
  startIcon: startIconProp,
45
46
  style: styleProp,
@@ -52,21 +53,21 @@ function Chip(props) {
52
53
  const variantStyleMap = {
53
54
  outlined: {
54
55
  backgroundColor: theme.palette.paper.default,
55
- borderColor: theme.palette.border,
56
- borderWidth: 2
56
+ borderColor: theme.palette.border.default,
57
+ borderWidth: 1
57
58
  },
58
59
  filled: {
59
60
  backgroundColor: theme.palette.paper.grey
60
61
  },
61
62
  bold: {
62
- backgroundColor: theme.palette.paper.grey,
63
+ backgroundColor: theme.palette.paper.default,
63
64
  borderColor: theme.palette.primary.main,
64
- borderWidth: 2
65
+ borderWidth: 1.5
65
66
  }
66
67
  };
67
68
  const chipStyle = (0, _styles.css)([styles.root, variantStyleMap[variant], styleProp]);
68
69
  const fontStyle = (0, _styles.createFontStyle)(theme, {
69
- selector: typo => typo.subtitle2,
70
+ selector: typo => variant === 'bold' ? typo.subtitle2 : typo.body2,
70
71
  color: fontColor
71
72
  });
72
73
  const textMarginSize = theme.spacing(1);
@@ -90,6 +91,7 @@ function Chip(props) {
90
91
  style: chipStyle
91
92
  }, otherProps), startIcon, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
92
93
  children: children,
94
+ numberOfLines: numberOfLines,
93
95
  style: textStyle
94
96
  }), endIcon);
95
97
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ICON_SIZE","useStyles","theme","useTheme","root","alignItems","borderRadius","flexDirection","height","justifyContent","paddingLeft","spacing","paddingRight","Chip","props","children","endIcon","endIconProp","onPress","startIcon","startIconProp","style","styleProp","variant","otherProps","styles","fontColor","palette","tertiary","main","primary","variantStyleMap","outlined","backgroundColor","paper","default","borderColor","border","borderWidth","filled","grey","bold","chipStyle","css","fontStyle","createFontStyle","selector","typo","subtitle2","color","textMarginSize","textMarginStyle","marginLeft","marginRight","undefined","textStyle","textAlign","iconProps","width","fill","cloneElementSafely"],"sources":["Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport ButtonBase from '../ButtonBase';\nimport type ChipProps from './ChipProps';\n\ntype ChipStyles = NamedStylesStringUnion<'root'>;\n\nconst ICON_SIZE = 16;\n\nconst useStyles: UseStyles<ChipStyles> = function (): ChipStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'center',\n borderRadius: 20,\n flexDirection: 'row',\n height: 32,\n justifyContent: 'center',\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n },\n };\n};\n\nexport default function Chip(props: ChipProps) {\n const {\n children,\n endIcon: endIconProp,\n onPress,\n startIcon: startIconProp,\n style: styleProp,\n variant = 'outlined',\n ...otherProps\n } = props;\n\n const theme = useTheme();\n const styles = useStyles();\n\n const fontColor = variant === 'outlined'\n ? theme.palette.tertiary.main\n : theme.palette.primary.main;\n\n const variantStyleMap = {\n outlined: {\n backgroundColor: theme.palette.paper.default,\n borderColor: theme.palette.border,\n borderWidth: 2,\n },\n filled: {\n backgroundColor: theme.palette.paper.grey,\n },\n bold: {\n backgroundColor: theme.palette.paper.grey,\n borderColor: theme.palette.primary.main,\n borderWidth: 2,\n },\n };\n\n const chipStyle = css([\n styles.root,\n variantStyleMap[variant],\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => typo.subtitle2,\n color: fontColor,\n });\n\n const textMarginSize = theme.spacing(1);\n const textMarginStyle = startIconProp\n ? { marginLeft: textMarginSize }\n : endIconProp\n ? { marginRight: textMarginSize }\n : undefined;\n\n const textStyle = css([\n fontStyle,\n textMarginStyle,\n { textAlign: 'center' },\n ]);\n\n const iconProps = {\n width: ICON_SIZE,\n height: ICON_SIZE,\n fill: fontColor,\n };\n\n const startIcon = cloneElementSafely(startIconProp, iconProps);\n const endIcon = cloneElementSafely(endIconProp, iconProps);\n\n return (\n <ButtonBase\n onPress={onPress}\n style={chipStyle}\n {...otherProps}\n >\n {startIcon}\n\n <Text\n children={children}\n style={textStyle}\n />\n\n {endIcon}\n </ButtonBase>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAKA,MAAMA,SAAS,GAAG,EAAlB;;AAEA,MAAMC,SAAgC,GAAG,YAAwB;EAC7D,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,YAAY,EAAE,EAFZ;MAGFC,aAAa,EAAE,KAHb;MAIFC,MAAM,EAAE,EAJN;MAKFC,cAAc,EAAE,QALd;MAMFC,WAAW,EAAER,KAAK,CAACS,OAAN,CAAc,CAAd,CANX;MAOFC,YAAY,EAAEV,KAAK,CAACS,OAAN,CAAc,CAAd;IAPZ;EADH,CAAP;AAWH,CAdD;;AAgBe,SAASE,IAAT,CAAcC,KAAd,EAAgC;EAC3C,MAAM;IACFC,QADE;IAEFC,OAAO,EAAEC,WAFP;IAGFC,OAHE;IAIFC,SAAS,EAAEC,aAJT;IAKFC,KAAK,EAAEC,SALL;IAMFC,OAAO,GAA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C,WAAW,EAAEH;EAAf,CADO,GAEPI,SAJV;EAMA,MAAMC,SAAS,GAAG,IAAAZ,WAAA,EAAI,CAClBC,SADkB,EAElBO,eAFkB,EAGlB;IAAEK,SAAS,EAAE;EAAb,CAHkB,CAAJ,CAAlB;EAMA,MAAMC,SAAS,GAAG;IACdC,KAAK,EAAE1D,SADO;IAEdQ,MAAM,EAAER,SAFM;IAGd2D,IAAI,EAAEjC;EAHQ,CAAlB;EAMA,MAAMP,SAAS,GAAG,IAAAyC,yBAAA,EAAmBxC,aAAnB,EAAkCqC,SAAlC,CAAlB;EACA,MAAMzC,OAAO,GAAG,IAAA4C,yBAAA,EAAmB3C,WAAnB,EAAgCwC,SAAhC,CAAhB;EAEA,oBACI,6BAAC,mBAAD;IACI,OAAO,EAAEvC,OADb;IAEI,KAAK,EAAEwB;EAFX,GAGQlB,UAHR,GAKKL,SALL,eAOI,6BAAC,iBAAD;IACI,QAAQ,EAAEJ,QADd;IAEI,KAAK,EAAEwC;EAFX,EAPJ,EAYKvC,OAZL,CADJ;AAgBH"}
1
+ {"version":3,"names":["ICON_SIZE","useStyles","theme","useTheme","root","alignItems","borderRadius","shape","roundnessExtra","flexDirection","height","justifyContent","paddingLeft","spacing","paddingRight","Chip","props","children","endIcon","endIconProp","numberOfLines","onPress","startIcon","startIconProp","style","styleProp","variant","otherProps","styles","fontColor","palette","tertiary","main","primary","variantStyleMap","outlined","backgroundColor","paper","default","borderColor","border","borderWidth","filled","grey","bold","chipStyle","css","fontStyle","createFontStyle","selector","typo","subtitle2","body2","color","textMarginSize","textMarginStyle","marginLeft","marginRight","undefined","textStyle","textAlign","iconProps","width","fill","cloneElementSafely"],"sources":["Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport ButtonBase from '../ButtonBase';\nimport type ChipProps from './ChipProps';\n\ntype ChipStyles = NamedStylesStringUnion<'root'>;\n\nconst ICON_SIZE = 20;\n\nconst useStyles: UseStyles<ChipStyles> = function (): ChipStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'center',\n borderRadius: theme.shape.roundnessExtra,\n flexDirection: 'row',\n height: 32,\n justifyContent: 'center',\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n };\n};\n\nexport default function Chip(props: ChipProps) {\n const {\n children,\n endIcon: endIconProp,\n numberOfLines,\n onPress,\n startIcon: startIconProp,\n style: styleProp,\n variant = 'outlined',\n ...otherProps\n } = props;\n\n const theme = useTheme();\n const styles = useStyles();\n\n const fontColor = variant === 'outlined'\n ? theme.palette.tertiary.main\n : theme.palette.primary.main;\n\n const variantStyleMap = {\n outlined: {\n backgroundColor: theme.palette.paper.default,\n borderColor: theme.palette.border.default,\n borderWidth: 1,\n },\n filled: {\n backgroundColor: theme.palette.paper.grey,\n },\n bold: {\n backgroundColor: theme.palette.paper.default,\n borderColor: theme.palette.primary.main,\n borderWidth: 1.5,\n },\n };\n\n const chipStyle = css([\n styles.root,\n variantStyleMap[variant],\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => variant === 'bold'\n ? typo.subtitle2\n : typo.body2,\n color: fontColor,\n });\n\n const textMarginSize = theme.spacing(1);\n const textMarginStyle = startIconProp\n ? { marginLeft: textMarginSize }\n : endIconProp\n ? { marginRight: textMarginSize }\n : undefined;\n\n const textStyle = css([\n fontStyle,\n textMarginStyle,\n { textAlign: 'center' },\n ]);\n\n const iconProps = {\n width: ICON_SIZE,\n height: ICON_SIZE,\n fill: fontColor,\n };\n\n const startIcon = cloneElementSafely(startIconProp, iconProps);\n const endIcon = cloneElementSafely(endIconProp, iconProps);\n\n return (\n <ButtonBase\n onPress={onPress}\n style={chipStyle}\n {...otherProps}\n >\n {startIcon}\n\n <Text\n children={children}\n numberOfLines={numberOfLines}\n style={textStyle}\n />\n\n {endIcon}\n </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IACI,OAAO,EAAExC,OADb;IAEI,KAAK,EAAEwB;EAFX,GAGQlB,UAHR,GAKKL,SALL,eAOI,6BAAC,iBAAD;IACI,QAAQ,EAAEL,QADd;IAEI,aAAa,EAAEG,aAFnB;IAGI,KAAK,EAAEuC;EAHX,EAPJ,EAaKzC,OAbL,CADJ;AAiBH"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["ChipProps.ts"],"sourcesContent":["import React from 'react';\nimport { OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport type ChipVariant = 'outlined' | 'filled' | 'bold';\n\nexport default interface ChipProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * Element placed after the children.\n */\n endIcon?: React.ReactElement;\n\n /**\n * The content of the component.\n */\n children: string;\n\n /**\n * Element placed before the children.\n */\n startIcon?: React.ReactElement;\n\n /**\n * The variant to use.\n * @default 'outlined'\n */\n variant?: ChipVariant;\n}> {}"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["ChipProps.ts"],"sourcesContent":["import React from 'react';\nimport { OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport type ChipVariant = 'outlined' | 'filled' | 'bold';\n\nexport default interface ChipProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * Element placed after the children.\n */\n endIcon?: React.ReactElement;\n\n /**\n * The content of the component.\n */\n children: string;\n\n /**\n * Number of lines of children.\n */\n numberOfLines?: number;\n\n /**\n * Element placed before the children.\n */\n startIcon?: React.ReactElement;\n\n /**\n * The variant to use.\n * @default 'outlined'\n */\n variant?: ChipVariant;\n}> {}"],"mappings":""}
@@ -5,19 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = CircularProgress;
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
- var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
10
+ var _reactNative = require("react-native");
11
11
 
12
12
  var _icons = require("../internal/icons");
13
13
 
14
- var _styles = require("../styles");
14
+ var _hooks = require("../hooks");
15
+
16
+ var _utils = require("../utils");
15
17
 
16
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
19
 
18
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
21
 
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
+ const MIN_ROTATE_DEGREE = 0;
23
+ const MAX_ROTATE_DEGREE = 360;
21
24
 
22
25
  const useStyles = function () {
23
26
  return {
@@ -30,34 +33,30 @@ const useStyles = function () {
30
33
 
31
34
  function CircularProgress(props) {
32
35
  const {
33
- style
36
+ style: styleProp
34
37
  } = props;
35
38
  const styles = useStyles();
36
- const rootStyle = (0, _styles.css)([styles.root, style]);
37
- const sharedSpin = (0, _reactNativeReanimated.useSharedValue)(0);
38
- const spinStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
39
- const interpolatedSpin = _reactNativeReanimated.default.interpolateNode(sharedSpin.value, {
40
- inputRange: [0, 1],
41
- outputRange: [0, 360]
42
- });
43
-
44
- return {
45
- transform: [{
46
- rotate: `${interpolatedSpin}deg`
47
- }]
48
- };
49
- });
50
-
51
- _react.default.useEffect(() => {
52
- sharedSpin.value = (0, _reactNativeReanimated.withRepeat)((0, _reactNativeReanimated.withTiming)(1, {
39
+ const rotate = (0, _hooks.useAnimatedValue)(MIN_ROTATE_DEGREE);
40
+ const animatedStyle = {
41
+ transform: [{
42
+ rotate: rotate.interpolate({
43
+ inputRange: [MIN_ROTATE_DEGREE, MAX_ROTATE_DEGREE],
44
+ outputRange: [`${MIN_ROTATE_DEGREE}deg`, `${MAX_ROTATE_DEGREE}deg`]
45
+ })
46
+ }]
47
+ };
48
+ (0, _react.useEffect)(() => {
49
+ _reactNative.Animated.loop(_reactNative.Animated.timing(rotate, {
50
+ toValue: MAX_ROTATE_DEGREE,
53
51
  duration: 900,
54
- easing: _reactNativeReanimated.Easing.linear
55
- }), -1, false);
52
+ easing: _reactNative.Easing.linear,
53
+ useNativeDriver: _utils.isNotAndroid12
54
+ })).start();
56
55
  }, []);
57
-
58
- return /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.View, {
59
- style: [spinStyle, rootStyle]
60
- }, /*#__PURE__*/_react.default.createElement(_icons.CircularProgress, null));
56
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
57
+ children: /*#__PURE__*/_react.default.createElement(_icons.CircularProgress, null),
58
+ style: [animatedStyle, styles.root, styleProp]
59
+ });
61
60
  }
62
61
 
63
62
  ;
@@ -1 +1 @@
1
- {"version":3,"names":["useStyles","root","alignItems","justifyContent","CircularProgress","props","style","styles","rootStyle","css","sharedSpin","useSharedValue","spinStyle","useAnimatedStyle","interpolatedSpin","Animated","interpolateNode","value","inputRange","outputRange","transform","rotate","React","useEffect","withRepeat","withTiming","duration","easing","Easing","linear"],"sources":["CircularProgress.tsx"],"sourcesContent":["import React from 'react';\nimport { ViewProps } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport Animated, { Easing, useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';\nimport { CircularProgress as CircularProgressIcon } from '../internal/icons';\nimport { css } from '../styles';\nimport { OverridableComponentProps } from '../types';\n\ntype CircularProgressStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: UseStyles<CircularProgressStyles> = function (): CircularProgressStyles {\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n };\n};\n\nexport default function CircularProgress(props: OverridableComponentProps<ViewProps>) {\n const { style } = props;\n\n const styles = useStyles();\n\n const rootStyle = css([\n styles.root,\n style,\n ]);\n\n const sharedSpin = useSharedValue(0);\n\n const spinStyle = useAnimatedStyle(() => {\n const interpolatedSpin = Animated.interpolateNode(sharedSpin.value, {\n inputRange: [0, 1],\n outputRange: [0, 360],\n });\n\n return {\n transform: [{ rotate: `${interpolatedSpin}deg` }],\n };\n });\n\n React.useEffect(() => {\n sharedSpin.value = withRepeat(\n withTiming(1, { duration: 900, easing: Easing.linear }),\n -1,\n false,\n );\n }, []);\n\n return (\n <Animated.View style={[spinStyle, rootStyle]}>\n <CircularProgressIcon/>\n </Animated.View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AAGA;;AACA;;AACA;;;;;;;;AAKA,MAAMA,SAA4C,GAAG,YAAoC;EACrF,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,cAAc,EAAE;IAFd;EADH,CAAP;AAMH,CAPD;;AASe,SAASC,gBAAT,CAA0BC,KAA1B,EAAuE;EAClF,MAAM;IAAEC;EAAF,IAAYD,KAAlB;EAEA,MAAME,MAAM,GAAGP,SAAS,EAAxB;EAEA,MAAMQ,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBF,MAAM,CAACN,IADW,EAElBK,KAFkB,CAAJ,CAAlB;EAKA,MAAMI,UAAU,GAAG,IAAAC,qCAAA,EAAe,CAAf,CAAnB;EAEA,MAAMC,SAAS,GAAG,IAAAC,uCAAA,EAAiB,MAAM;IACrC,MAAMC,gBAAgB,GAAGC,8BAAA,CAASC,eAAT,CAAyBN,UAAU,CAACO,KAApC,EAA2C;MAChEC,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CADoD;MAEhEC,WAAW,EAAE,CAAC,CAAD,EAAI,GAAJ;IAFmD,CAA3C,CAAzB;;IAKA,OAAO;MACHC,SAAS,EAAE,CAAC;QAAEC,MAAM,EAAG,GAAEP,gBAAiB;MAA9B,CAAD;IADR,CAAP;EAGH,CATiB,CAAlB;;EAWAQ,cAAA,CAAMC,SAAN,CAAgB,MAAM;IAClBb,UAAU,CAACO,KAAX,GAAmB,IAAAO,iCAAA,EACf,IAAAC,iCAAA,EAAW,CAAX,EAAc;MAAEC,QAAQ,EAAE,GAAZ;MAAiBC,MAAM,EAAEC,6BAAA,CAAOC;IAAhC,CAAd,CADe,EAEf,CAAC,CAFc,EAGf,KAHe,CAAnB;EAKH,CAND,EAMG,EANH;;EAQA,oBACI,6BAAC,8BAAD,CAAU,IAAV;IAAe,KAAK,EAAE,CAACjB,SAAD,EAAYJ,SAAZ;EAAtB,gBACI,6BAAC,uBAAD,OADJ,CADJ;AAKH;;AAAA"}
1
+ {"version":3,"names":["MIN_ROTATE_DEGREE","MAX_ROTATE_DEGREE","useStyles","root","alignItems","justifyContent","CircularProgress","props","style","styleProp","styles","rotate","useAnimatedValue","animatedStyle","transform","interpolate","inputRange","outputRange","useEffect","Animated","loop","timing","toValue","duration","easing","Easing","linear","useNativeDriver","isNotAndroid12","start"],"sources":["CircularProgress.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport type { ViewProps } from 'react-native';\nimport { Animated, Easing } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { CircularProgress as CircularProgressIcon } from '../internal/icons';\nimport type { OverridableComponentProps } from '../types';\nimport { useAnimatedValue } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\n\ntype CircularProgressStyles = NamedStylesStringUnion<'root'>;\n\nconst MIN_ROTATE_DEGREE = 0;\nconst MAX_ROTATE_DEGREE = 360;\n\nconst useStyles: UseStyles<CircularProgressStyles> = function (): CircularProgressStyles {\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n };\n};\n\nexport default function CircularProgress(props: OverridableComponentProps<ViewProps>) {\n const { style: styleProp } = props;\n\n const styles = useStyles();\n\n const rotate = useAnimatedValue(MIN_ROTATE_DEGREE);\n\n const animatedStyle = {\n transform: [{\n rotate: rotate.interpolate({\n inputRange: [MIN_ROTATE_DEGREE, MAX_ROTATE_DEGREE],\n outputRange: [`${MIN_ROTATE_DEGREE}deg`, `${MAX_ROTATE_DEGREE}deg`],\n }),\n }],\n };\n\n useEffect(() => {\n Animated.loop(\n Animated.timing(\n rotate,\n {\n toValue: MAX_ROTATE_DEGREE,\n duration: 900,\n easing: Easing.linear,\n useNativeDriver: isNotAndroid12,\n },\n ),\n ).start();\n }, []);\n\n return (\n <Animated.View\n children={<CircularProgressIcon/>}\n style={[\n animatedStyle,\n styles.root,\n styleProp,\n ]}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AAEA;;AACA;;;;;;AAIA,MAAMA,iBAAiB,GAAG,CAA1B;AACA,MAAMC,iBAAiB,GAAG,GAA1B;;AAEA,MAAMC,SAA4C,GAAG,YAAoC;EACrF,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,cAAc,EAAE;IAFd;EADH,CAAP;AAMH,CAPD;;AASe,SAASC,gBAAT,CAA0BC,KAA1B,EAAuE;EAClF,MAAM;IAAEC,KAAK,EAAEC;EAAT,IAAuBF,KAA7B;EAEA,MAAMG,MAAM,GAAGR,SAAS,EAAxB;EAEA,MAAMS,MAAM,GAAG,IAAAC,uBAAA,EAAiBZ,iBAAjB,CAAf;EAEA,MAAMa,aAAa,GAAG;IAClBC,SAAS,EAAE,CAAC;MACRH,MAAM,EAAEA,MAAM,CAACI,WAAP,CAAmB;QACvBC,UAAU,EAAE,CAAChB,iBAAD,EAAoBC,iBAApB,CADW;QAEvBgB,WAAW,EAAE,CAAE,GAAEjB,iBAAkB,KAAtB,EAA6B,GAAEC,iBAAkB,KAAjD;MAFU,CAAnB;IADA,CAAD;EADO,CAAtB;EASA,IAAAiB,gBAAA,EAAU,MAAM;IACZC,qBAAA,CAASC,IAAT,CACID,qBAAA,CAASE,MAAT,CACIV,MADJ,EAEI;MACIW,OAAO,EAAErB,iBADb;MAEIsB,QAAQ,EAAE,GAFd;MAGIC,MAAM,EAAEC,mBAAA,CAAOC,MAHnB;MAIIC,eAAe,EAAEC;IAJrB,CAFJ,CADJ,EAUEC,KAVF;EAWH,CAZD,EAYG,EAZH;EAcA,oBACI,6BAAC,qBAAD,CAAU,IAAV;IACI,QAAQ,eAAE,6BAAC,uBAAD,OADd;IAEI,KAAK,EAAE,CACHhB,aADG,EAEHH,MAAM,CAACP,IAFJ,EAGHM,SAHG;EAFX,EADJ;AAUH;;AAAA"}
@@ -5,26 +5,38 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = Dialog;
7
7
 
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _reactNative = require("react-native");
11
11
 
12
- var _Modal = _interopRequireDefault(require("../Modal"));
12
+ var _styles = require("@fountain-ui/styles");
13
+
14
+ var _Column = _interopRequireDefault(require("../Column"));
15
+
16
+ var _Modal = _interopRequireWildcard(require("../Modal"));
13
17
 
14
18
  var _Paper = _interopRequireDefault(require("../Paper"));
15
19
 
16
- var _styles = require("../styles");
20
+ var _styles2 = require("../styles");
17
21
 
18
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
23
 
24
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
+
26
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+
20
28
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
29
 
30
+ const DIALOG_MAX_WIDTH = 328;
31
+ const TOP_ELEMENT_OFFSET = 20;
32
+
22
33
  const useStyles = function () {
23
- const theme = (0, _styles.useTheme)();
34
+ const theme = (0, _styles2.useTheme)();
24
35
  const {
25
36
  width
26
37
  } = (0, _reactNative.useWindowDimensions)();
27
38
  const margin = theme.spacing(4);
39
+ const dialogWidth = width - margin * 2;
28
40
  return {
29
41
  root: {
30
42
  alignItems: 'center',
@@ -32,10 +44,11 @@ const useStyles = function () {
32
44
  zIndex: theme.zIndex.dialog
33
45
  },
34
46
  paper: {
47
+ borderRadius: theme.shape.roundnessExtra,
35
48
  margin,
36
- maxWidth: 328,
49
+ maxWidth: DIALOG_MAX_WIDTH,
37
50
  overflow: 'hidden',
38
- width: width - margin * 2
51
+ width: dialogWidth
39
52
  },
40
53
  paperFullScreen: {
41
54
  flexGrow: 1
@@ -44,29 +57,124 @@ const useStyles = function () {
44
57
  animationFullScreen: {
45
58
  width: '100%',
46
59
  height: '100%'
60
+ },
61
+ topElementSize: {
62
+ marginHorizontal: margin,
63
+ maxWidth: DIALOG_MAX_WIDTH,
64
+ width: dialogWidth
65
+ },
66
+ topElementPosition: {
67
+ position: 'absolute',
68
+ bottom: -1 * theme.spacing(4),
69
+ width: '100%'
47
70
  }
48
71
  };
49
72
  };
50
73
 
51
74
  function Dialog(props) {
52
75
  const {
76
+ animationType = _Modal.ANIMATION_TYPE.SLIDE,
53
77
  children,
54
78
  fullScreen = false,
79
+ hideBackdrop,
55
80
  onClose,
81
+ style = {},
56
82
  visible,
83
+ topElement,
57
84
  ...otherProps
58
85
  } = props;
59
86
  const styles = useStyles();
87
+ const {
88
+ height: screenHeight
89
+ } = (0, _reactNative.useWindowDimensions)();
90
+ const [topElementHeight, setTopElementHeight] = (0, _react.useState)(0);
91
+
92
+ const handleTopElementLayout = event => {
93
+ const {
94
+ height
95
+ } = event.nativeEvent.layout;
96
+ setTopElementHeight(height);
97
+ };
98
+
99
+ const offsetAnimation = (0, _react.useMemo)(() => {
100
+ if (topElementHeight === 0) {
101
+ return [];
102
+ }
103
+
104
+ return [{
105
+ toValue: (topElementHeight - TOP_ELEMENT_OFFSET) / 2,
106
+ type: _Modal.ANIMATION_TYPE.SLIDE
107
+ }];
108
+ }, [topElementHeight]);
109
+ const closeAnimation = (0, _react.useMemo)(() => {
110
+ if (animationType === _Modal.ANIMATION_TYPE.FADE) {
111
+ return [{
112
+ toValue: 0,
113
+ type: _Modal.ANIMATION_TYPE.FADE
114
+ }];
115
+ } else if (animationType === _Modal.ANIMATION_TYPE.SLIDE && !fullScreen) {
116
+ return [{
117
+ toValue: screenHeight,
118
+ type: _Modal.ANIMATION_TYPE.SLIDE
119
+ }, {
120
+ duration: 150,
121
+ toValue: 0,
122
+ type: _Modal.ANIMATION_TYPE.FADE
123
+ }];
124
+ }
125
+
126
+ return [{
127
+ duration: 150,
128
+ toValue: screenHeight,
129
+ type: _Modal.ANIMATION_TYPE.SLIDE
130
+ }];
131
+ }, [animationType, fullScreen, screenHeight]);
132
+ const openAnimation = (0, _react.useMemo)(() => {
133
+ if (animationType === _Modal.ANIMATION_TYPE.FADE) {
134
+ return [{
135
+ toValue: 1,
136
+ type: _Modal.ANIMATION_TYPE.FADE
137
+ }];
138
+ } else if (animationType === _Modal.ANIMATION_TYPE.SLIDE && !fullScreen) {
139
+ return [{
140
+ toValue: 0,
141
+ type: _Modal.ANIMATION_TYPE.SLIDE
142
+ }, {
143
+ delay: 50,
144
+ duration: 150,
145
+ toValue: 1,
146
+ type: _Modal.ANIMATION_TYPE.FADE
147
+ }];
148
+ }
149
+
150
+ return [{
151
+ toValue: 0,
152
+ type: _Modal.ANIMATION_TYPE.SLIDE
153
+ }];
154
+ }, [animationType, fullScreen]);
155
+ const initialOpacity = animationType === _Modal.ANIMATION_TYPE.SLIDE && fullScreen ? 1 : undefined;
156
+ const initialTranslateY = animationType === _Modal.ANIMATION_TYPE.FADE ? 0 : undefined;
60
157
  return /*#__PURE__*/_react.default.createElement(_Modal.default, _extends({
61
158
  animationStyle: fullScreen ? styles.animationFullScreen : styles.animation,
159
+ closeAnimation: closeAnimation,
160
+ hideBackdrop: hideBackdrop || animationType === _Modal.ANIMATION_TYPE.FADE,
161
+ initialOpacity: initialOpacity,
162
+ initialTranslateY: initialTranslateY,
62
163
  onClose: onClose,
164
+ openAnimation: openAnimation,
165
+ offsetAnimation: offsetAnimation,
63
166
  visible: visible,
64
167
  style: styles.root
65
- }, otherProps), /*#__PURE__*/_react.default.createElement(_Paper.default, {
66
- elevation: 24,
168
+ }, otherProps), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, topElement ? /*#__PURE__*/_react.default.createElement(_Column.default, {
169
+ style: fullScreen ? undefined : styles.topElementSize
170
+ }, /*#__PURE__*/_react.default.createElement(_Column.default, {
171
+ style: styles.topElementPosition,
172
+ onLayout: handleTopElementLayout
173
+ }, topElement)) : null, /*#__PURE__*/_react.default.createElement(_Paper.default, {
174
+ elevation: 6,
67
175
  square: fullScreen,
68
- style: fullScreen ? styles.paperFullScreen : styles.paper
69
- }, children));
176
+ style: (0, _styles.css)([fullScreen ? styles.paperFullScreen : styles.paper, style])
177
+ }, children)));
70
178
  }
71
179
 
72
180
  ;
@@ -1 +1 @@
1
- {"version":3,"names":["useStyles","theme","useTheme","width","useWindowDimensions","margin","spacing","root","alignItems","justifyContent","zIndex","dialog","paper","maxWidth","overflow","paperFullScreen","flexGrow","animation","animationFullScreen","height","Dialog","props","children","fullScreen","onClose","visible","otherProps","styles"],"sources":["Dialog.tsx"],"sourcesContent":["import React from 'react';\nimport { useWindowDimensions } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport Modal from '../Modal';\nimport Paper from '../Paper';\nimport { useTheme } from '../styles';\nimport type DialogProps from './DialogProps';\n\ntype DialogStyleKeys =\n | 'root'\n | 'paper'\n | 'paperFullScreen'\n | 'animation'\n | 'animationFullScreen';\n\ntype DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;\n\nconst useStyles: UseStyles<DialogStyles> = function (): DialogStyles {\n const theme = useTheme();\n\n const { width } = useWindowDimensions();\n\n const margin = theme.spacing(4);\n\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: theme.zIndex.dialog,\n },\n paper: {\n margin,\n maxWidth: 328,\n overflow: 'hidden',\n width: width - margin * 2,\n },\n paperFullScreen: {\n flexGrow: 1,\n },\n animation: {},\n animationFullScreen: {\n width: '100%',\n height: '100%',\n },\n };\n};\n\nexport default function Dialog(props: DialogProps) {\n const {\n children,\n fullScreen = false,\n onClose,\n visible,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n return (\n <Modal\n animationStyle={fullScreen ? styles.animationFullScreen : styles.animation}\n onClose={onClose}\n visible={visible}\n style={styles.root}\n {...otherProps}\n >\n <Paper\n elevation={24}\n square={fullScreen}\n style={fullScreen ? styles.paperFullScreen : styles.paper}\n >\n {children}\n </Paper>\n </Modal>\n );\n};\n"],"mappings":";;;;;;;AAAA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KKU,QALL,CAPJ,CADJ;AAiBH;;AAAA"}
1
+ {"version":3,"names":["DIALOG_MAX_WIDTH","TOP_ELEMENT_OFFSET","useStyles","theme","useTheme","width","useWindowDimensions","margin","spacing","dialogWidth","root","alignItems","justifyContent","zIndex","dialog","paper","borderRadius","shape","roundnessExtra","maxWidth","overflow","paperFullScreen","flexGrow","animation","animationFullScreen","height","topElementSize","marginHorizontal","topElementPosition","position","bottom","Dialog","props","animationType","ANIMATION_TYPE","SLIDE","children","fullScreen","hideBackdrop","onClose","style","visible","topElement","otherProps","styles","screenHeight","topElementHeight","setTopElementHeight","useState","handleTopElementLayout","event","nativeEvent","layout","offsetAnimation","useMemo","toValue","type","closeAnimation","FADE","duration","openAnimation","delay","initialOpacity","undefined","initialTranslateY","css"],"sources":["Dialog.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport { LayoutChangeEvent, useWindowDimensions } from 'react-native';\nimport { css, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport Column from '../Column';\nimport Modal, { ANIMATION_TYPE, AnimationUnit } from '../Modal';\nimport Paper from '../Paper';\nimport { useTheme } from '../styles';\nimport type DialogProps from './DialogProps';\n\ntype DialogStyleKeys =\n | 'root'\n | 'paper'\n | 'paperFullScreen'\n | 'animation'\n | 'animationFullScreen'\n | 'topElementSize'\n | 'topElementPosition';\n\ntype DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;\n\nconst DIALOG_MAX_WIDTH = 328;\n\nconst TOP_ELEMENT_OFFSET = 20;\n\nconst useStyles: UseStyles<DialogStyles> = function (): DialogStyles {\n const theme = useTheme();\n\n const { width } = useWindowDimensions();\n\n const margin = theme.spacing(4);\n const dialogWidth = width - margin * 2;\n\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: theme.zIndex.dialog,\n },\n paper: {\n borderRadius: theme.shape.roundnessExtra,\n margin,\n maxWidth: DIALOG_MAX_WIDTH,\n overflow: 'hidden',\n width: dialogWidth,\n },\n paperFullScreen: {\n flexGrow: 1,\n },\n animation: {},\n animationFullScreen: {\n width: '100%',\n height: '100%',\n },\n topElementSize: {\n marginHorizontal: margin,\n maxWidth: DIALOG_MAX_WIDTH,\n width: dialogWidth,\n },\n topElementPosition: {\n position: 'absolute',\n bottom: -1 * theme.spacing(4),\n width: '100%',\n },\n };\n};\n\nexport default function Dialog(props: DialogProps) {\n const {\n animationType = ANIMATION_TYPE.SLIDE,\n children,\n fullScreen = false,\n hideBackdrop,\n onClose,\n style = {},\n visible,\n topElement,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const { height: screenHeight } = useWindowDimensions();\n\n const [topElementHeight, setTopElementHeight] = useState(0);\n const handleTopElementLayout = (event: LayoutChangeEvent) => {\n const { height } = event.nativeEvent.layout;\n setTopElementHeight(height);\n };\n\n const offsetAnimation = useMemo<AnimationUnit[]>(() => {\n if (topElementHeight === 0) {\n return [];\n }\n\n return [{\n toValue: (topElementHeight - TOP_ELEMENT_OFFSET) / 2,\n type: ANIMATION_TYPE.SLIDE,\n }]\n }, [topElementHeight]);\n\n const closeAnimation = useMemo<AnimationUnit[]>(() => {\n if (animationType === ANIMATION_TYPE.FADE) {\n return [{\n toValue: 0,\n type: ANIMATION_TYPE.FADE,\n }];\n } else if (animationType === ANIMATION_TYPE.SLIDE && !fullScreen) {\n return [\n {\n toValue: screenHeight,\n type: ANIMATION_TYPE.SLIDE,\n },\n {\n duration: 150,\n toValue: 0,\n type: ANIMATION_TYPE.FADE,\n },\n ];\n }\n\n return [{\n duration: 150,\n toValue: screenHeight,\n type: ANIMATION_TYPE.SLIDE,\n }];\n }, [animationType, fullScreen, screenHeight]);\n\n const openAnimation = useMemo<AnimationUnit[]>(() => {\n if (animationType === ANIMATION_TYPE.FADE) {\n return [{\n toValue: 1,\n type: ANIMATION_TYPE.FADE,\n }];\n } else if (animationType === ANIMATION_TYPE.SLIDE && !fullScreen) {\n return [\n {\n toValue: 0,\n type: ANIMATION_TYPE.SLIDE,\n },\n {\n delay: 50,\n duration: 150,\n toValue: 1,\n type: ANIMATION_TYPE.FADE,\n },\n ];\n }\n\n return [{\n toValue: 0,\n type: ANIMATION_TYPE.SLIDE,\n }];\n }, [animationType, fullScreen]);\n\n const initialOpacity = animationType === ANIMATION_TYPE.SLIDE && fullScreen ? 1 : undefined;\n\n const initialTranslateY = animationType === ANIMATION_TYPE.FADE ? 0 : undefined;\n\n return (\n <Modal\n animationStyle={fullScreen ? styles.animationFullScreen : styles.animation}\n closeAnimation={closeAnimation}\n hideBackdrop={hideBackdrop || animationType === ANIMATION_TYPE.FADE}\n initialOpacity={initialOpacity}\n initialTranslateY={initialTranslateY}\n onClose={onClose}\n openAnimation={openAnimation}\n offsetAnimation={offsetAnimation}\n visible={visible}\n style={styles.root}\n {...otherProps}\n >\n <React.Fragment>\n {topElement ? (\n <Column style={fullScreen ? undefined : styles.topElementSize}>\n <Column\n style={styles.topElementPosition}\n onLayout={handleTopElementLayout}\n >\n {topElement}\n </Column>\n </Column>\n ) : null}\n\n <Paper\n elevation={6}\n square={fullScreen}\n style={css([\n fullScreen ? styles.paperFullScreen : styles.paper,\n style,\n ])}\n >\n {children}\n </Paper>\n </React.Fragment>\n </Modal>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAcA,MAAMA,gBAAgB,GAAG,GAAzB;AAEA,MAAMC,kBAAkB,GAAG,EAA3B;;AAEA,MAAMC,SAAkC,GAAG,YAA0B;EACjE,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,MAAM;IAAEC;EAAF,IAAY,IAAAC,gCAAA,GAAlB;EAEA,MAAMC,MAAM,GAAGJ,KAAK,CAACK,OAAN,CAAc,CAAd,CAAf;EACA,MAAMC,WAAW,GAAGJ,KAAK,GAAGE,MAAM,GAAG,CAArC;EAEA,OAAO;IACHG,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,cAAc,EAAE,QAFd;MAGFC,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AAenB,MAAM,CAAClB;EAA/C,gBACI,6BAAC,eAAD;IACI,KAAK,EAAEkB,MAAM,CAAChB,kBADlB;IAEI,QAAQ,EAAEqB;EAFd,GAIKP,UAJL,CADJ,CADO,GASP,IAVR,eAYI,6BAAC,cAAD;IACI,SAAS,EAAE,CADf;IAEI,MAAM,EAAEL,UAFZ;IAGI,KAAK,EAAE,IAAA4B,WAAA,EAAI,CACP5B,UAAU,GAAGO,MAAM,CAACvB,eAAV,GAA4BuB,MAAM,CAAC7B,KADtC,EAEPyB,KAFO,CAAJ;EAHX,GAQKJ,QARL,CAZJ,CAbJ,CADJ;AAuCH;;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["DialogProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ModalProps } from '../Modal';\nimport type { OverridableComponentProps } from '../types';\n\nexport default interface DialogProps extends OverridableComponentProps<ModalProps, {\n /**\n * Dialog children, usually the included sub-components.\n */\n children?: React.ReactNode;\n\n /**\n * If `true`, the dialog is full-screen.\n * @default false\n */\n fullScreen?: boolean;\n}> {}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["DialogProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ModalProps } from '../Modal';\nimport type { OverridableComponentProps } from '../types';\nimport { ANIMATION_TYPE } from '../Modal';\n\nexport default interface DialogProps extends OverridableComponentProps<ModalProps, {\n /**\n * Type of animation used when the dialog opens and closes.\n * @default 'slide'\n */\n animationType?: ANIMATION_TYPE;\n\n /**\n * Dialog children, usually the included sub-components.\n */\n children?: React.ReactNode;\n\n /**\n * If `true`, the dialog is full-screen.\n * @default false\n */\n fullScreen?: boolean;\n\n /**\n * Top element for displaying additional information on the dialog.\n */\n topElement?: React.ReactNode;\n}> {}\n"],"mappings":""}
@@ -28,26 +28,24 @@ const styles = _styles.StyleSheet.create({
28
28
  },
29
29
  divider: {
30
30
  flexGrow: 1
31
- },
32
- borderBottom: {
33
- borderBottomWidth: 1
34
- },
35
- borderRight: {
36
- borderRightWidth: 1
37
31
  }
38
32
  });
39
33
 
40
34
  function Divider(props) {
41
35
  const {
36
+ borderWidth = 1,
42
37
  children: childrenProp,
38
+ color = 'divider',
39
+ elementAlign = 'center',
43
40
  inset = 0,
44
- vertical = false,
41
+ marginBetweenChildren = 2,
45
42
  style,
43
+ vertical = false,
46
44
  ...otherProps
47
45
  } = props;
48
46
  const theme = (0, _styles.useTheme)();
49
47
  const fontColor = theme.palette.text.secondary;
50
- const borderColor = theme.palette.divider;
48
+ const borderColor = color === 'divider' ? theme.palette.divider : color === 'border' ? theme.palette.border.default : theme.palette[color].main;
51
49
  const marginSize = theme.spacing(1);
52
50
  const insetSize = theme.spacing(inset);
53
51
  const marginLeft = marginSize;
@@ -71,19 +69,29 @@ function Divider(props) {
71
69
  const borderColorStyle = {
72
70
  borderColor
73
71
  };
74
- const borderWidthStyle = vertical ? styles.borderRight : styles.borderBottom;
72
+ const borderWidthStyle = vertical ? {
73
+ borderRightWidth: borderWidth
74
+ } : {
75
+ borderBottomWidth: borderWidth
76
+ };
75
77
  const containerStyle = (0, _styles.css)([insetStyle, marginStyle, styles.container, vertical ? styles.column : styles.row, childrenProp ? undefined : borderColorStyle, childrenProp ? undefined : borderWidthStyle, style]);
76
78
  const dividerStyle = (0, _styles.css)([borderColorStyle, borderWidthStyle, styles.divider]);
77
- const dividerMarginSize = theme.spacing(2);
78
- const startDividerStyle = vertical ? {
79
- marginBottom: dividerMarginSize
80
- } : {
81
- marginRight: dividerMarginSize
79
+ const dividerMarginSize = theme.spacing(marginBetweenChildren);
80
+ const startDividerStyle = {
81
+ display: elementAlign !== 'start' ? 'flex' : 'none',
82
+ ...(vertical ? {
83
+ marginBottom: dividerMarginSize
84
+ } : {
85
+ marginRight: dividerMarginSize
86
+ })
82
87
  };
83
- const endDividerStyle = vertical ? {
84
- marginTop: dividerMarginSize
85
- } : {
86
- marginLeft: dividerMarginSize
88
+ const endDividerStyle = {
89
+ display: elementAlign !== 'end' ? 'flex' : 'none',
90
+ ...(vertical ? {
91
+ marginTop: dividerMarginSize
92
+ } : {
93
+ marginLeft: dividerMarginSize
94
+ })
87
95
  };
88
96
  const fontStyle = (0, _styles.createFontStyle)(theme, {
89
97
  selector: typo => typo.caption2,