@fountain-ui/core 3.0.0-alpha.4 → 3.0.0-alpha.40

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 (494) hide show
  1. package/build/commonjs/Accordion/Accordion.js +20 -13
  2. package/build/commonjs/Accordion/Accordion.js.map +1 -1
  3. package/build/commonjs/Accordion/AccordionProps.js.map +1 -1
  4. package/build/commonjs/Accordion/useVariantStyleMap.js +15 -8
  5. package/build/commonjs/Accordion/useVariantStyleMap.js.map +1 -1
  6. package/build/commonjs/AppBar/AppBar.js +1 -1
  7. package/build/commonjs/AppBar/AppBar.js.map +1 -1
  8. package/build/commonjs/Badge/Badge.js +4 -3
  9. package/build/commonjs/Badge/Badge.js.map +1 -1
  10. package/build/commonjs/Badge/BadgeProps.js.map +1 -1
  11. package/build/commonjs/Badge/useVariantStyleMap.js +2 -2
  12. package/build/commonjs/Badge/useVariantStyleMap.js.map +1 -1
  13. package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js +6 -2
  14. package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
  15. package/build/commonjs/BottomSheetTitle/BottomSheetTitleProps.js.map +1 -1
  16. package/build/commonjs/Button/Button.js +26 -12
  17. package/build/commonjs/Button/Button.js.map +1 -1
  18. package/build/commonjs/Button/ButtonProps.js.map +1 -1
  19. package/build/commonjs/Button/useVariantStyleMap.js +9 -0
  20. package/build/commonjs/Button/useVariantStyleMap.js.map +1 -1
  21. package/build/commonjs/ButtonBase/ButtonBase.js +1 -1
  22. package/build/commonjs/ButtonBase/ButtonBase.js.map +1 -1
  23. package/build/commonjs/ButtonBase/index.js +2 -2
  24. package/build/commonjs/ButtonBase/index.js.map +1 -1
  25. package/build/commonjs/Checkbox/Checkbox.js +4 -1
  26. package/build/commonjs/Checkbox/Checkbox.js.map +1 -1
  27. package/build/commonjs/Checkbox/useVariantStyleMap.js +6 -2
  28. package/build/commonjs/Checkbox/useVariantStyleMap.js.map +1 -1
  29. package/build/commonjs/Chip/Chip.js +25 -14
  30. package/build/commonjs/Chip/Chip.js.map +1 -1
  31. package/build/commonjs/Chip/ChipProps.js +3 -1
  32. package/build/commonjs/Chip/ChipProps.js.map +1 -1
  33. package/build/commonjs/Chip/index.js +6 -0
  34. package/build/commonjs/Chip/index.js.map +1 -1
  35. package/build/commonjs/Chip/useChipStyle.js +51 -31
  36. package/build/commonjs/Chip/useChipStyle.js.map +1 -1
  37. package/build/commonjs/Dialog/Dialog.js +10 -12
  38. package/build/commonjs/Dialog/Dialog.js.map +1 -1
  39. package/build/commonjs/Dialog/DialogProps.js +1 -1
  40. package/build/commonjs/Dialog/DialogProps.js.map +1 -1
  41. package/build/commonjs/Dialog/useDialogSectionStyle.js +6 -4
  42. package/build/commonjs/Dialog/useDialogSectionStyle.js.map +1 -1
  43. package/build/commonjs/Dialog/useDialogStyle.js +19 -8
  44. package/build/commonjs/Dialog/useDialogStyle.js.map +1 -1
  45. package/build/commonjs/DialogActions/DialogActions.js +0 -1
  46. package/build/commonjs/DialogActions/DialogActions.js.map +1 -1
  47. package/build/commonjs/DialogTitle/DialogLargeTitle.js +80 -0
  48. package/build/commonjs/DialogTitle/DialogLargeTitle.js.map +1 -0
  49. package/build/commonjs/DialogTitle/DialogTitle.js +8 -4
  50. package/build/commonjs/DialogTitle/DialogTitle.js.map +1 -1
  51. package/build/commonjs/Divider/Divider.js +17 -9
  52. package/build/commonjs/Divider/Divider.js.map +1 -1
  53. package/build/commonjs/Divider/DividerProps.js +1 -1
  54. package/build/commonjs/Divider/DividerProps.js.map +1 -1
  55. package/build/commonjs/Empty/Empty.js +1 -1
  56. package/build/commonjs/Empty/Empty.js.map +1 -1
  57. package/build/commonjs/Flexbox/Flexbox.js +2 -0
  58. package/build/commonjs/Flexbox/Flexbox.js.map +1 -1
  59. package/build/commonjs/Flexbox/FlexboxProps.js.map +1 -1
  60. package/build/commonjs/IconButton/IconButton.js +3 -0
  61. package/build/commonjs/IconButton/IconButton.js.map +1 -1
  62. package/build/commonjs/IconButton/IconButtonProps.js +1 -1
  63. package/build/commonjs/IconButton/IconButtonProps.js.map +1 -1
  64. package/build/commonjs/Image/Image.js +2 -2
  65. package/build/commonjs/Image/Image.js.map +1 -1
  66. package/build/commonjs/ImageCore/ImageCoreNative.js +1 -1
  67. package/build/commonjs/ImageCore/ImageCoreNative.js.map +1 -1
  68. package/build/commonjs/ListItem/ListItem.js +38 -26
  69. package/build/commonjs/ListItem/ListItem.js.map +1 -1
  70. package/build/commonjs/ListItem/ListItemProps.js.map +1 -1
  71. package/build/commonjs/ListItemIcon/ListItemIcon.js +1 -2
  72. package/build/commonjs/ListItemIcon/ListItemIcon.js.map +1 -1
  73. package/build/commonjs/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
  74. package/build/commonjs/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
  75. package/build/commonjs/ListItemText/ListItemText.js +20 -21
  76. package/build/commonjs/ListItemText/ListItemText.js.map +1 -1
  77. package/build/commonjs/ListItemText/ListItemTextProps.js.map +1 -1
  78. package/build/commonjs/ListSubheader/ListSubheader.js +1 -1
  79. package/build/commonjs/ListSubheader/ListSubheader.js.map +1 -1
  80. package/build/commonjs/Modal/Modal.js +1 -1
  81. package/build/commonjs/Modal/Modal.js.map +1 -1
  82. package/build/commonjs/Pagination/NumberPagination.js +4 -2
  83. package/build/commonjs/Pagination/NumberPagination.js.map +1 -1
  84. package/build/commonjs/Pagination/Pagination.js +2 -0
  85. package/build/commonjs/Pagination/Pagination.js.map +1 -1
  86. package/build/commonjs/Pagination/PaginationProps.js +3 -1
  87. package/build/commonjs/Pagination/PaginationProps.js.map +1 -1
  88. package/build/commonjs/Pagination/index.js +6 -0
  89. package/build/commonjs/Pagination/index.js.map +1 -1
  90. package/build/commonjs/PaginationItem/PaginationItem.js +32 -22
  91. package/build/commonjs/PaginationItem/PaginationItem.js.map +1 -1
  92. package/build/commonjs/PaginationItem/PaginationItemProps.js.map +1 -1
  93. package/build/commonjs/Radio/Radio.js +11 -4
  94. package/build/commonjs/Radio/Radio.js.map +1 -1
  95. package/build/commonjs/RadioGroup/RadioGroup.js +2 -27
  96. package/build/commonjs/RadioGroup/RadioGroup.js.map +1 -1
  97. package/build/commonjs/Section/Section.js +32 -0
  98. package/build/commonjs/Section/Section.js.map +1 -0
  99. package/build/commonjs/Section/SectionProps.js +2 -0
  100. package/build/commonjs/Section/SectionProps.js.map +1 -0
  101. package/build/commonjs/Section/index.js +16 -0
  102. package/build/commonjs/Section/index.js.map +1 -0
  103. package/build/commonjs/ShadowView/ShadowView.native.js +4 -0
  104. package/build/commonjs/ShadowView/ShadowView.native.js.map +1 -1
  105. package/build/commonjs/SnackbarContent/SnackbarContent.js +26 -9
  106. package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
  107. package/build/commonjs/Tab/Tab.js +21 -19
  108. package/build/commonjs/Tab/Tab.js.map +1 -1
  109. package/build/commonjs/Tab/TabProps.js +4 -2
  110. package/build/commonjs/Tab/TabProps.js.map +1 -1
  111. package/build/commonjs/Tab/index.js +14 -0
  112. package/build/commonjs/Tab/index.js.map +1 -1
  113. package/build/commonjs/Tab/useVariantStyleMap.js +59 -18
  114. package/build/commonjs/Tab/useVariantStyleMap.js.map +1 -1
  115. package/build/commonjs/TabBase/TabBase.js +1 -8
  116. package/build/commonjs/TabBase/TabBase.js.map +1 -1
  117. package/build/commonjs/TabBase/TabBaseProps.js.map +1 -1
  118. package/build/commonjs/Tabs/Tabs.js +23 -7
  119. package/build/commonjs/Tabs/Tabs.js.map +1 -1
  120. package/build/commonjs/Tabs/TabsProps.js.map +1 -1
  121. package/build/commonjs/Tabs/index.js.map +1 -1
  122. package/build/commonjs/Tabs/useTabsStyle.js +81 -0
  123. package/build/commonjs/Tabs/useTabsStyle.js.map +1 -0
  124. package/build/commonjs/TextField/TextField.js +60 -15
  125. package/build/commonjs/TextField/TextField.js.map +1 -1
  126. package/build/commonjs/TextField/useVariantStyleMap.js +29 -29
  127. package/build/commonjs/TextField/useVariantStyleMap.js.map +1 -1
  128. package/build/commonjs/Toolbar/BackButton/BackButton.js +47 -0
  129. package/build/commonjs/Toolbar/BackButton/BackButton.js.map +1 -0
  130. package/build/commonjs/Toolbar/BackButton/BackButtonProps.js +2 -0
  131. package/build/commonjs/Toolbar/BackButton/BackButtonProps.js.map +1 -0
  132. package/build/commonjs/Toolbar/BackButton/index.js +16 -0
  133. package/build/commonjs/Toolbar/BackButton/index.js.map +1 -0
  134. package/build/commonjs/Toolbar/Toolbar.js +22 -12
  135. package/build/commonjs/Toolbar/Toolbar.js.map +1 -1
  136. package/build/commonjs/Toolbar/ToolbarProps.js.map +1 -1
  137. package/build/commonjs/Tooltip/Beaks/index.js +32 -0
  138. package/build/commonjs/Tooltip/Beaks/index.js.map +1 -1
  139. package/build/commonjs/Tooltip/Tooltip.js +18 -22
  140. package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
  141. package/build/commonjs/Tooltip/TooltipProps.js.map +1 -1
  142. package/build/commonjs/Tooltip/index.js +19 -0
  143. package/build/commonjs/Tooltip/index.js.map +1 -1
  144. package/build/commonjs/Typography/Typography.js +9 -2
  145. package/build/commonjs/Typography/Typography.js.map +1 -1
  146. package/build/commonjs/Typography/TypographyProps.js.map +1 -1
  147. package/build/commonjs/hooks/useBreakpointUp.js +4 -1
  148. package/build/commonjs/hooks/useBreakpointUp.js.map +1 -1
  149. package/build/commonjs/hooks/useCollapsibleAppBar.js +11 -13
  150. package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
  151. package/build/commonjs/hooks/useContentContainerStyle.js +39 -25
  152. package/build/commonjs/hooks/useContentContainerStyle.js.map +1 -1
  153. package/build/commonjs/hooks/useFadeInAppBar.js +4 -4
  154. package/build/commonjs/hooks/useFadeInAppBar.js.map +1 -1
  155. package/build/commonjs/index.js +21 -0
  156. package/build/commonjs/index.js.map +1 -1
  157. package/build/commonjs/internal/icons/AppBarChevronLeft.js +23 -0
  158. package/build/commonjs/internal/icons/AppBarChevronLeft.js.map +1 -0
  159. package/build/commonjs/internal/icons/ChevronLeft.js +4 -2
  160. package/build/commonjs/internal/icons/ChevronLeft.js.map +1 -1
  161. package/build/commonjs/internal/icons/ChevronRight.js +4 -2
  162. package/build/commonjs/internal/icons/ChevronRight.js.map +1 -1
  163. package/build/commonjs/internal/icons/ChipClose.js +23 -0
  164. package/build/commonjs/internal/icons/ChipClose.js.map +1 -0
  165. package/build/commonjs/internal/icons/Clear.js +3 -3
  166. package/build/commonjs/internal/icons/Clear.js.map +1 -1
  167. package/build/commonjs/internal/icons/Close.js +4 -2
  168. package/build/commonjs/internal/icons/Close.js.map +1 -1
  169. package/build/commonjs/internal/icons/Search.js +2 -2
  170. package/build/commonjs/internal/icons/Search.js.map +1 -1
  171. package/build/commonjs/internal/icons/index.js +16 -0
  172. package/build/commonjs/internal/icons/index.js.map +1 -1
  173. package/build/module/Accordion/Accordion.js +20 -13
  174. package/build/module/Accordion/Accordion.js.map +1 -1
  175. package/build/module/Accordion/AccordionProps.js.map +1 -1
  176. package/build/module/Accordion/useVariantStyleMap.js +15 -8
  177. package/build/module/Accordion/useVariantStyleMap.js.map +1 -1
  178. package/build/module/AppBar/AppBar.js +1 -1
  179. package/build/module/AppBar/AppBar.js.map +1 -1
  180. package/build/module/Badge/Badge.js +4 -3
  181. package/build/module/Badge/Badge.js.map +1 -1
  182. package/build/module/Badge/BadgeProps.js.map +1 -1
  183. package/build/module/Badge/useVariantStyleMap.js +2 -2
  184. package/build/module/Badge/useVariantStyleMap.js.map +1 -1
  185. package/build/module/BottomSheetTitle/BottomSheetTitle.js +6 -2
  186. package/build/module/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
  187. package/build/module/BottomSheetTitle/BottomSheetTitleProps.js.map +1 -1
  188. package/build/module/Button/Button.js +27 -13
  189. package/build/module/Button/Button.js.map +1 -1
  190. package/build/module/Button/ButtonProps.js.map +1 -1
  191. package/build/module/Button/useVariantStyleMap.js +9 -0
  192. package/build/module/Button/useVariantStyleMap.js.map +1 -1
  193. package/build/module/ButtonBase/ButtonBase.js +1 -1
  194. package/build/module/ButtonBase/ButtonBase.js.map +1 -1
  195. package/build/module/ButtonBase/index.js +1 -1
  196. package/build/module/ButtonBase/index.js.map +1 -1
  197. package/build/module/Checkbox/Checkbox.js +4 -1
  198. package/build/module/Checkbox/Checkbox.js.map +1 -1
  199. package/build/module/Checkbox/useVariantStyleMap.js +6 -2
  200. package/build/module/Checkbox/useVariantStyleMap.js.map +1 -1
  201. package/build/module/Chip/Chip.js +21 -13
  202. package/build/module/Chip/Chip.js.map +1 -1
  203. package/build/module/Chip/ChipProps.js +1 -0
  204. package/build/module/Chip/ChipProps.js.map +1 -1
  205. package/build/module/Chip/index.js +1 -1
  206. package/build/module/Chip/index.js.map +1 -1
  207. package/build/module/Chip/useChipStyle.js +51 -31
  208. package/build/module/Chip/useChipStyle.js.map +1 -1
  209. package/build/module/Dialog/Dialog.js +10 -11
  210. package/build/module/Dialog/Dialog.js.map +1 -1
  211. package/build/module/Dialog/DialogProps.js +1 -1
  212. package/build/module/Dialog/DialogProps.js.map +1 -1
  213. package/build/module/Dialog/useDialogSectionStyle.js +6 -4
  214. package/build/module/Dialog/useDialogSectionStyle.js.map +1 -1
  215. package/build/module/Dialog/useDialogStyle.js +18 -8
  216. package/build/module/Dialog/useDialogStyle.js.map +1 -1
  217. package/build/module/DialogActions/DialogActions.js +0 -1
  218. package/build/module/DialogActions/DialogActions.js.map +1 -1
  219. package/build/module/DialogTitle/DialogLargeTitle.js +65 -0
  220. package/build/module/DialogTitle/DialogLargeTitle.js.map +1 -0
  221. package/build/module/DialogTitle/DialogTitle.js +6 -3
  222. package/build/module/DialogTitle/DialogTitle.js.map +1 -1
  223. package/build/module/Divider/Divider.js +7 -0
  224. package/build/module/Divider/Divider.js.map +1 -1
  225. package/build/module/Divider/DividerProps.js +1 -1
  226. package/build/module/Divider/DividerProps.js.map +1 -1
  227. package/build/module/Empty/Empty.js +1 -1
  228. package/build/module/Empty/Empty.js.map +1 -1
  229. package/build/module/Flexbox/Flexbox.js +2 -0
  230. package/build/module/Flexbox/Flexbox.js.map +1 -1
  231. package/build/module/Flexbox/FlexboxProps.js.map +1 -1
  232. package/build/module/IconButton/IconButton.js +3 -0
  233. package/build/module/IconButton/IconButton.js.map +1 -1
  234. package/build/module/IconButton/IconButtonProps.js +1 -1
  235. package/build/module/IconButton/IconButtonProps.js.map +1 -1
  236. package/build/module/Image/Image.js +2 -2
  237. package/build/module/Image/Image.js.map +1 -1
  238. package/build/module/ImageCore/ImageCoreNative.js +1 -1
  239. package/build/module/ImageCore/ImageCoreNative.js.map +1 -1
  240. package/build/module/ListItem/ListItem.js +36 -28
  241. package/build/module/ListItem/ListItem.js.map +1 -1
  242. package/build/module/ListItem/ListItemProps.js.map +1 -1
  243. package/build/module/ListItemIcon/ListItemIcon.js +1 -2
  244. package/build/module/ListItemIcon/ListItemIcon.js.map +1 -1
  245. package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
  246. package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
  247. package/build/module/ListItemText/ListItemText.js +17 -19
  248. package/build/module/ListItemText/ListItemText.js.map +1 -1
  249. package/build/module/ListItemText/ListItemTextProps.js.map +1 -1
  250. package/build/module/ListSubheader/ListSubheader.js +1 -1
  251. package/build/module/ListSubheader/ListSubheader.js.map +1 -1
  252. package/build/module/Modal/Modal.js +1 -1
  253. package/build/module/Modal/Modal.js.map +1 -1
  254. package/build/module/Pagination/NumberPagination.js +4 -2
  255. package/build/module/Pagination/NumberPagination.js.map +1 -1
  256. package/build/module/Pagination/Pagination.js +2 -0
  257. package/build/module/Pagination/Pagination.js.map +1 -1
  258. package/build/module/Pagination/PaginationProps.js +1 -0
  259. package/build/module/Pagination/PaginationProps.js.map +1 -1
  260. package/build/module/Pagination/index.js +1 -1
  261. package/build/module/Pagination/index.js.map +1 -1
  262. package/build/module/PaginationItem/PaginationItem.js +28 -21
  263. package/build/module/PaginationItem/PaginationItem.js.map +1 -1
  264. package/build/module/PaginationItem/PaginationItemProps.js.map +1 -1
  265. package/build/module/Radio/Radio.js +10 -4
  266. package/build/module/Radio/Radio.js.map +1 -1
  267. package/build/module/RadioGroup/RadioGroup.js +2 -20
  268. package/build/module/RadioGroup/RadioGroup.js.map +1 -1
  269. package/build/module/Section/Section.js +19 -0
  270. package/build/module/Section/Section.js.map +1 -0
  271. package/build/module/Section/SectionProps.js +2 -0
  272. package/build/module/Section/SectionProps.js.map +1 -0
  273. package/build/module/Section/index.js +2 -0
  274. package/build/module/Section/index.js.map +1 -0
  275. package/build/module/ShadowView/ShadowView.native.js +4 -0
  276. package/build/module/ShadowView/ShadowView.native.js.map +1 -1
  277. package/build/module/SnackbarContent/SnackbarContent.js +26 -9
  278. package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
  279. package/build/module/Tab/Tab.js +22 -19
  280. package/build/module/Tab/Tab.js.map +1 -1
  281. package/build/module/Tab/TabProps.js +2 -1
  282. package/build/module/Tab/TabProps.js.map +1 -1
  283. package/build/module/Tab/index.js +1 -0
  284. package/build/module/Tab/index.js.map +1 -1
  285. package/build/module/Tab/useVariantStyleMap.js +59 -18
  286. package/build/module/Tab/useVariantStyleMap.js.map +1 -1
  287. package/build/module/TabBase/TabBase.js +1 -8
  288. package/build/module/TabBase/TabBase.js.map +1 -1
  289. package/build/module/TabBase/TabBaseProps.js.map +1 -1
  290. package/build/module/Tabs/Tabs.js +21 -7
  291. package/build/module/Tabs/Tabs.js.map +1 -1
  292. package/build/module/Tabs/TabsProps.js.map +1 -1
  293. package/build/module/Tabs/index.js.map +1 -1
  294. package/build/module/Tabs/useTabsStyle.js +71 -0
  295. package/build/module/Tabs/useTabsStyle.js.map +1 -0
  296. package/build/module/TextField/TextField.js +60 -15
  297. package/build/module/TextField/TextField.js.map +1 -1
  298. package/build/module/TextField/useVariantStyleMap.js +29 -29
  299. package/build/module/TextField/useVariantStyleMap.js.map +1 -1
  300. package/build/module/Toolbar/BackButton/BackButton.js +32 -0
  301. package/build/module/Toolbar/BackButton/BackButton.js.map +1 -0
  302. package/build/module/Toolbar/BackButton/BackButtonProps.js +2 -0
  303. package/build/module/Toolbar/BackButton/BackButtonProps.js.map +1 -0
  304. package/build/module/Toolbar/BackButton/index.js +2 -0
  305. package/build/module/Toolbar/BackButton/index.js.map +1 -0
  306. package/build/module/Toolbar/Toolbar.js +20 -12
  307. package/build/module/Toolbar/Toolbar.js.map +1 -1
  308. package/build/module/Toolbar/ToolbarProps.js.map +1 -1
  309. package/build/module/Tooltip/Beaks/index.js +4 -0
  310. package/build/module/Tooltip/Beaks/index.js.map +1 -1
  311. package/build/module/Tooltip/Tooltip.js +11 -14
  312. package/build/module/Tooltip/Tooltip.js.map +1 -1
  313. package/build/module/Tooltip/TooltipProps.js.map +1 -1
  314. package/build/module/Tooltip/index.js +1 -0
  315. package/build/module/Tooltip/index.js.map +1 -1
  316. package/build/module/Typography/Typography.js +9 -2
  317. package/build/module/Typography/Typography.js.map +1 -1
  318. package/build/module/Typography/TypographyProps.js.map +1 -1
  319. package/build/module/hooks/useBreakpointUp.js +4 -1
  320. package/build/module/hooks/useBreakpointUp.js.map +1 -1
  321. package/build/module/hooks/useCollapsibleAppBar.js +12 -13
  322. package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
  323. package/build/module/hooks/useContentContainerStyle.js +43 -25
  324. package/build/module/hooks/useContentContainerStyle.js.map +1 -1
  325. package/build/module/hooks/useFadeInAppBar.js +4 -4
  326. package/build/module/hooks/useFadeInAppBar.js.map +1 -1
  327. package/build/module/index.js +2 -0
  328. package/build/module/index.js.map +1 -1
  329. package/build/module/internal/icons/AppBarChevronLeft.js +9 -0
  330. package/build/module/internal/icons/AppBarChevronLeft.js.map +1 -0
  331. package/build/module/internal/icons/ChevronLeft.js +4 -2
  332. package/build/module/internal/icons/ChevronLeft.js.map +1 -1
  333. package/build/module/internal/icons/ChevronRight.js +4 -2
  334. package/build/module/internal/icons/ChevronRight.js.map +1 -1
  335. package/build/module/internal/icons/ChipClose.js +9 -0
  336. package/build/module/internal/icons/ChipClose.js.map +1 -0
  337. package/build/module/internal/icons/Clear.js +3 -3
  338. package/build/module/internal/icons/Clear.js.map +1 -1
  339. package/build/module/internal/icons/Close.js +4 -2
  340. package/build/module/internal/icons/Close.js.map +1 -1
  341. package/build/module/internal/icons/Search.js +2 -2
  342. package/build/module/internal/icons/Search.js.map +1 -1
  343. package/build/module/internal/icons/index.js +2 -0
  344. package/build/module/internal/icons/index.js.map +1 -1
  345. package/build/typescript/Accordion/AccordionProps.d.ts +4 -1
  346. package/build/typescript/Accordion/useVariantStyleMap.d.ts +1 -0
  347. package/build/typescript/Badge/BadgeProps.d.ts +10 -5
  348. package/build/typescript/BottomSheetTitle/BottomSheetTitleProps.d.ts +1 -0
  349. package/build/typescript/Button/ButtonProps.d.ts +5 -0
  350. package/build/typescript/ButtonBase/index.d.ts +1 -1
  351. package/build/typescript/Checkbox/useVariantStyleMap.d.ts +1 -0
  352. package/build/typescript/Chip/ChipProps.d.ts +11 -4
  353. package/build/typescript/Chip/index.d.ts +1 -1
  354. package/build/typescript/Chip/useChipStyle.d.ts +6 -3
  355. package/build/typescript/Dialog/DialogProps.d.ts +1 -6
  356. package/build/typescript/Dialog/useDialogStyle.d.ts +1 -1
  357. package/build/typescript/DialogTitle/DialogLargeTitle.d.ts +9 -0
  358. package/build/typescript/DialogTitle/DialogTitle.d.ts +6 -1
  359. package/build/typescript/Divider/DividerProps.d.ts +1 -1
  360. package/build/typescript/Flexbox/FlexboxProps.d.ts +4 -0
  361. package/build/typescript/IconButton/IconButtonProps.d.ts +1 -1
  362. package/build/typescript/ListItem/ListItem.d.ts +1 -1
  363. package/build/typescript/ListItem/ListItemProps.d.ts +4 -0
  364. package/build/typescript/ListItemText/ListItemTextProps.d.ts +2 -9
  365. package/build/typescript/Pagination/PaginationProps.d.ts +12 -0
  366. package/build/typescript/Pagination/index.d.ts +2 -2
  367. package/build/typescript/PaginationItem/PaginationItemProps.d.ts +6 -0
  368. package/build/typescript/Section/Section.d.ts +3 -0
  369. package/build/typescript/Section/SectionProps.d.ts +6 -0
  370. package/build/typescript/Section/index.d.ts +2 -0
  371. package/build/typescript/Tab/TabProps.d.ts +21 -2
  372. package/build/typescript/Tab/index.d.ts +2 -1
  373. package/build/typescript/Tab/useVariantStyleMap.d.ts +4 -2
  374. package/build/typescript/TabBase/TabBaseProps.d.ts +0 -5
  375. package/build/typescript/Tabs/Tabs.d.ts +1 -1
  376. package/build/typescript/Tabs/TabsProps.d.ts +6 -1
  377. package/build/typescript/Tabs/index.d.ts +1 -1
  378. package/build/typescript/Tabs/useTabsStyle.d.ts +8 -0
  379. package/build/typescript/TextField/useVariantStyleMap.d.ts +2 -0
  380. package/build/typescript/Toolbar/BackButton/BackButton.d.ts +3 -0
  381. package/build/typescript/Toolbar/BackButton/BackButtonProps.d.ts +4 -0
  382. package/build/typescript/Toolbar/BackButton/index.d.ts +2 -0
  383. package/build/typescript/Toolbar/Toolbar.d.ts +6 -1
  384. package/build/typescript/Toolbar/ToolbarProps.d.ts +0 -5
  385. package/build/typescript/Tooltip/Beaks/index.d.ts +4 -0
  386. package/build/typescript/Tooltip/TooltipProps.d.ts +2 -2
  387. package/build/typescript/Tooltip/index.d.ts +1 -0
  388. package/build/typescript/Typography/TypographyProps.d.ts +4 -0
  389. package/build/typescript/hooks/useCollapsibleAppBar.d.ts +1 -1
  390. package/build/typescript/hooks/useContentContainerStyle.d.ts +5 -8
  391. package/build/typescript/index.d.ts +2 -0
  392. package/build/typescript/internal/icons/AppBarChevronLeft.d.ts +131 -0
  393. package/build/typescript/internal/icons/ChipClose.d.ts +131 -0
  394. package/build/typescript/internal/icons/index.d.ts +2 -0
  395. package/package.json +5 -5
  396. package/src/Accordion/Accordion.tsx +23 -14
  397. package/src/Accordion/AccordionProps.ts +4 -2
  398. package/src/Accordion/useVariantStyleMap.ts +14 -6
  399. package/src/AppBar/AppBar.tsx +2 -2
  400. package/src/Badge/Badge.tsx +4 -3
  401. package/src/Badge/BadgeProps.ts +12 -6
  402. package/src/Badge/useVariantStyleMap.ts +2 -2
  403. package/src/BottomSheetTitle/BottomSheetTitle.tsx +5 -1
  404. package/src/BottomSheetTitle/BottomSheetTitleProps.ts +1 -0
  405. package/src/Button/Button.tsx +28 -12
  406. package/src/Button/ButtonProps.ts +6 -0
  407. package/src/Button/useVariantStyleMap.ts +9 -0
  408. package/src/ButtonBase/ButtonBase.tsx +1 -1
  409. package/src/ButtonBase/index.ts +1 -1
  410. package/src/Checkbox/Checkbox.tsx +11 -8
  411. package/src/Checkbox/useVariantStyleMap.ts +6 -1
  412. package/src/Chip/Chip.tsx +24 -13
  413. package/src/Chip/ChipProps.ts +13 -4
  414. package/src/Chip/index.ts +1 -1
  415. package/src/Chip/useChipStyle.ts +59 -29
  416. package/src/Dialog/Dialog.tsx +12 -11
  417. package/src/Dialog/DialogProps.ts +1 -7
  418. package/src/Dialog/useDialogSectionStyle.ts +6 -4
  419. package/src/Dialog/useDialogStyle.ts +19 -7
  420. package/src/DialogActions/DialogActions.tsx +0 -1
  421. package/src/DialogTitle/DialogLargeTitle.tsx +95 -0
  422. package/src/DialogTitle/DialogTitle.tsx +6 -1
  423. package/src/Divider/Divider.tsx +5 -0
  424. package/src/Divider/DividerProps.ts +1 -1
  425. package/src/Empty/Empty.tsx +1 -1
  426. package/src/Flexbox/Flexbox.tsx +2 -0
  427. package/src/Flexbox/FlexboxProps.ts +5 -0
  428. package/src/IconButton/IconButton.tsx +2 -0
  429. package/src/IconButton/IconButtonProps.ts +1 -0
  430. package/src/Image/Image.tsx +3 -3
  431. package/src/ImageCore/ImageCoreNative.tsx +1 -1
  432. package/src/ListItem/ListItem.tsx +61 -30
  433. package/src/ListItem/ListItemProps.ts +5 -0
  434. package/src/ListItemIcon/ListItemIcon.tsx +1 -2
  435. package/src/ListItemSecondaryAction/ListItemSecondaryAction.tsx +2 -0
  436. package/src/ListItemText/ListItemText.tsx +20 -28
  437. package/src/ListItemText/ListItemTextProps.ts +2 -10
  438. package/src/ListSubheader/ListSubheader.tsx +1 -1
  439. package/src/Modal/Modal.tsx +1 -1
  440. package/src/Pagination/NumberPagination.tsx +7 -2
  441. package/src/Pagination/Pagination.tsx +3 -2
  442. package/src/Pagination/PaginationProps.ts +15 -0
  443. package/src/Pagination/index.ts +2 -2
  444. package/src/PaginationItem/PaginationItem.tsx +31 -24
  445. package/src/PaginationItem/PaginationItemProps.ts +7 -0
  446. package/src/Radio/Radio.tsx +12 -3
  447. package/src/RadioGroup/RadioGroup.tsx +2 -28
  448. package/src/Section/Section.tsx +26 -0
  449. package/src/Section/SectionProps.ts +6 -0
  450. package/src/Section/index.ts +2 -0
  451. package/src/ShadowView/ShadowView.native.tsx +4 -0
  452. package/src/SnackbarContent/SnackbarContent.tsx +36 -15
  453. package/src/Tab/Tab.tsx +32 -22
  454. package/src/Tab/TabProps.ts +25 -2
  455. package/src/Tab/index.ts +2 -1
  456. package/src/Tab/useVariantStyleMap.ts +72 -19
  457. package/src/TabBase/TabBase.tsx +1 -9
  458. package/src/TabBase/TabBaseProps.ts +0 -6
  459. package/src/Tabs/Tabs.tsx +26 -8
  460. package/src/Tabs/TabsProps.ts +7 -1
  461. package/src/Tabs/index.ts +1 -1
  462. package/src/Tabs/useTabsStyle.ts +79 -0
  463. package/src/TextField/TextField.tsx +99 -45
  464. package/src/TextField/useVariantStyleMap.ts +29 -27
  465. package/src/Toolbar/BackButton/BackButton.tsx +44 -0
  466. package/src/Toolbar/BackButton/BackButtonProps.ts +4 -0
  467. package/src/Toolbar/BackButton/index.ts +2 -0
  468. package/src/Toolbar/Toolbar.tsx +26 -17
  469. package/src/Toolbar/ToolbarProps.ts +0 -6
  470. package/src/Tooltip/Beaks/index.ts +4 -0
  471. package/src/Tooltip/Tooltip.tsx +10 -12
  472. package/src/Tooltip/TooltipProps.ts +2 -2
  473. package/src/Tooltip/index.ts +1 -0
  474. package/src/Typography/Typography.tsx +3 -1
  475. package/src/Typography/TypographyProps.ts +5 -0
  476. package/src/hooks/useBreakpointUp.ts +3 -1
  477. package/src/hooks/useCollapsibleAppBar.ts +10 -24
  478. package/src/hooks/useContentContainerStyle.ts +43 -31
  479. package/src/hooks/useFadeInAppBar.ts +4 -4
  480. package/src/index.ts +3 -0
  481. package/src/internal/icons/AppBarChevronLeft.tsx +15 -0
  482. package/src/internal/icons/ChevronLeft.tsx +4 -1
  483. package/src/internal/icons/ChevronRight.tsx +4 -1
  484. package/src/internal/icons/ChipClose.tsx +13 -0
  485. package/src/internal/icons/Clear.tsx +3 -3
  486. package/src/internal/icons/Close.tsx +4 -1
  487. package/src/internal/icons/Search.tsx +2 -2
  488. package/src/internal/icons/index.ts +2 -0
  489. package/build/commonjs/ButtonBase/LegacyButtonBase.js +0 -126
  490. package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +0 -1
  491. package/build/module/ButtonBase/LegacyButtonBase.js +0 -106
  492. package/build/module/ButtonBase/LegacyButtonBase.js.map +0 -1
  493. package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +0 -5
  494. package/src/ButtonBase/LegacyButtonBase.tsx +0 -135
@@ -1 +1 @@
1
- {"version":3,"names":["useChipStyle","size","startElementVariant","isEndElement","theme","useTheme","useMemo","fontStyleMap","small","createFontStyle","selector","typography","caption1","medium","color","palette","text","strong","large","body2","endElementStyleMap","height","marginLeft","spacing","width","baseContainerStyle","alignItems","backgroundColor","fill","weaker","borderRadius","shape","radius","full","flexDirection","overflow","isLarge","variantStyleMap","avatar","container","paddingLeft","paddingRight","paddingVertical","startElement","marginRight","icon","justifyContent","image","default","paddingBottom","paddingHorizontal","paddingTop","endElement","label"],"sources":["useChipStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { ChipSize, ChipStartElementVariant } from './ChipProps';\n\ninterface ChipStyle {\n container: FountainUiStyle;\n endElement?: FountainUiStyle;\n label: TextStyle;\n startElement?: FountainUiStyle;\n}\n\ntype VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;\n\n// TODO: need to refactoring...\nexport default function useChipStyle(\n size: ChipSize,\n startElementVariant: ChipStartElementVariant,\n isEndElement: boolean,\n): ChipStyle {\n const theme = useTheme();\n\n return useMemo<ChipStyle>(() => {\n const fontStyleMap: Record<ChipSize, TextStyle> = {\n small: createFontStyle(theme, {\n selector: (typography) => typography.caption1.medium,\n color: theme.palette.text.strong,\n }),\n large: createFontStyle(theme, {\n selector: (typography) => typography.body2.medium,\n color: theme.palette.text.strong,\n }),\n };\n\n const endElementStyleMap: Record<ChipSize, FountainUiStyle> = {\n small: {\n height: 14,\n marginLeft: theme.spacing(2),\n width: 8.17,\n },\n large: {\n height: 16,\n marginLeft: theme.spacing(2.5),\n width: 9,\n },\n };\n\n const baseContainerStyle: FountainUiStyle = {\n alignItems: 'center',\n backgroundColor: theme.palette.fill.weaker,\n borderRadius: theme.shape.radius.full,\n flexDirection: 'row',\n overflow: 'hidden',\n };\n\n const isLarge = size === 'large';\n\n const variantStyleMap: VariantStyleMap = {\n avatar: {\n container: {\n paddingLeft: theme.spacing(isLarge ? 1.5 : 1.25),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.25 : 1),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 24 : 22,\n marginRight: theme.spacing(isLarge ? 1.5 : 1.25),\n width: isLarge ? 24 : 22,\n },\n },\n icon: {\n container: {\n paddingLeft: theme.spacing(1.5),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n startElement: {\n alignItems: 'center',\n height: isLarge ? 22 : 20,\n justifyContent: 'center',\n marginRight: theme.spacing(isLarge ? 1 : 0.75),\n width: isLarge ? 22 : 20,\n },\n },\n image: {\n container: {\n alignItems: 'center',\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 34 : 30,\n marginRight: theme.spacing(1.5),\n width: isLarge ? 45 : 40,\n },\n },\n default: {\n container: {\n paddingBottom: theme.spacing(1.75),\n paddingHorizontal: theme.spacing(isLarge ? 3.5 : 3),\n paddingTop: theme.spacing(1.5),\n },\n },\n };\n\n return {\n container: {\n ...baseContainerStyle,\n ...variantStyleMap[startElementVariant]?.container,\n ...(isEndElement ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),\n },\n endElement: endElementStyleMap[size],\n label: fontStyleMap[size],\n startElement: variantStyleMap[startElementVariant]?.startElement,\n };\n }, [theme, size, startElementVariant]);\n}\n"],"mappings":";;;;;;;AAAA;;AAGA;;AAYA;AACe,SAASA,YAAT,CACXC,IADW,EAEXC,mBAFW,EAGXC,YAHW,EAIF;EACT,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAmB,MAAM;IAAA;;IAC5B,MAAMC,YAAyC,GAAG;MAC9CC,KAAK,EAAE,IAAAC,uBAAA,EAAgBL,KAAhB,EAAuB;QAC1BM,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,QAAX,CAAoBC,MADpB;QAE1BC,KAAK,EAAEV,KAAK,CAACW,OAAN,CAAcC,IAAd,CAAmBC;MAFA,CAAvB,CADuC;MAK9CC,KAAK,EAAE,IAAAT,uBAAA,EAAgBL,KAAhB,EAAuB;QAC1BM,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACQ,KAAX,CAAiBN,MADjB;QAE1BC,KAAK,EAAEV,KAAK,CAACW,OAAN,CAAcC,IAAd,CAAmBC;MAFA,CAAvB;IALuC,CAAlD;IAWA,MAAMG,kBAAqD,GAAG;MAC1DZ,KAAK,EAAE;QACHa,MAAM,EAAE,EADL;QAEHC,UAAU,EAAElB,KAAK,CAACmB,OAAN,CAAc,CAAd,CAFT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sC,YAAY,EAAErC,KAAK,CAACmB,OAAN,CAAca,OAAO,GAAG,GAAH,GAAS,IAA9B;QAAhB,CAAH,GAA2D,EAA3E;MAHO,CADR;MAMHgB,UAAU,EAAEhC,kBAAkB,CAACnB,IAAD,CAN3B;MAOHoD,KAAK,EAAE9C,YAAY,CAACN,IAAD,CAPhB;MAQH0C,YAAY,4BAAEN,eAAe,CAACnC,mBAAD,CAAjB,2DAAE,uBAAsCyC;IARjD,CAAP;EAUH,CA9FM,EA8FJ,CAACvC,KAAD,EAAQH,IAAR,EAAcC,mBAAd,CA9FI,CAAP;AA+FH"}
1
+ {"version":3,"names":["closeButtonContainerStyleMap","small","marginLeft","paddingTop","large","closeIconSize","height","width","useChipStyle","size","startElementVariant","color","selected","theme","useTheme","useMemo","fontStyleMap","createFontStyle","selector","typography","caption1","medium","palette","text","strongInverse","strong","body2","baseContainerStyle","alignItems","backgroundColor","fill","base","surface","weaker","borderRadius","shape","radius","full","flexDirection","overflow","isLarge","variantStyleMap","avatar","container","paddingLeft","spacing","paddingRight","paddingVertical","startElement","startElementContainer","marginRight","icon","justifyContent","image","default","paddingBottom","closeButtonContainer","label"],"sources":["useChipStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport type { SvgIconProps } from '../SvgIcon';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { ChipColor, ChipSize, ChipStartElementVariant } from './ChipProps';\n\ninterface ChipStyle {\n container: FountainUiStyle;\n closeButtonContainer?: FountainUiStyle;\n closeIconSize?: Pick<SvgIconProps, 'height' | 'width'>;\n label: TextStyle;\n startElement?: FountainUiStyle;\n startElementContainer?: FountainUiStyle;\n}\n\ntype VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;\n\nconst closeButtonContainerStyleMap: Record<ChipSize, FountainUiStyle> = {\n small: {\n marginLeft: 8,\n paddingTop: 1,\n },\n large: {\n marginLeft: 10,\n paddingTop: 1,\n },\n};\n\nconst closeIconSize: Record<ChipSize, ChipStyle['closeIconSize']> = {\n small: {\n height: 14,\n width: 8.17,\n },\n large: {\n height: 16,\n width: 9,\n },\n};\n\n// TODO: need to refactoring...\nexport default function useChipStyle(\n size: ChipSize,\n startElementVariant: ChipStartElementVariant,\n color: ChipColor,\n selected: boolean,\n): ChipStyle {\n const theme = useTheme();\n\n return useMemo<ChipStyle>(() => {\n const fontStyleMap: Record<ChipSize, TextStyle> = {\n small: createFontStyle(theme, {\n selector: (typography) => typography.caption1.medium,\n color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,\n }),\n large: createFontStyle(theme, {\n selector: (typography) => typography.body2.medium,\n color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong,\n }),\n };\n\n const baseContainerStyle: FountainUiStyle = {\n alignItems: 'center',\n backgroundColor: selected ? theme.palette.fill.base\n : color === 'white'\n ? theme.palette.surface.base\n : theme.palette.fill.weaker,\n borderRadius: theme.shape.radius.full,\n flexDirection: 'row',\n overflow: 'hidden',\n };\n\n const isLarge = size === 'large';\n\n const variantStyleMap: VariantStyleMap = {\n avatar: {\n container: {\n paddingLeft: theme.spacing(isLarge ? 1.5 : 1.25),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.25 : 1),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 26 : 23,\n width: isLarge ? 26 : 23,\n },\n startElementContainer: {\n marginRight: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n },\n icon: {\n container: {\n paddingLeft: theme.spacing(1.5),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n startElement: {\n color: selected\n ? theme.palette.icon.strongInverse\n : theme.palette.icon.strong,\n height: isLarge ? 17 : 16,\n width: isLarge ? 17 : 16,\n },\n startElementContainer: {\n alignItems: 'center',\n height: isLarge ? 24 : 21,\n justifyContent: 'center',\n marginRight: theme.spacing(isLarge ? 1 : 0.75),\n width: isLarge ? 24 : 21,\n },\n },\n image: {\n container: {\n alignItems: 'center',\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 36 : 31,\n width: isLarge ? 48 : 40,\n },\n startElementContainer: {\n marginRight: theme.spacing(1.5),\n },\n },\n default: {\n container: {\n paddingBottom: theme.spacing(1.75),\n paddingLeft: theme.spacing(isLarge ? 3.5 : 3),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingTop: theme.spacing(1.5),\n },\n },\n };\n\n return {\n container: {\n ...baseContainerStyle,\n ...variantStyleMap[startElementVariant]?.container,\n ...(selected ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),\n },\n closeButtonContainer: closeButtonContainerStyleMap[size],\n closeIconSize: closeIconSize[size],\n label: fontStyleMap[size],\n startElement: variantStyleMap[startElementVariant]?.startElement,\n startElementContainer: variantStyleMap[startElementVariant]?.startElementContainer,\n };\n }, [theme, size, startElementVariant, color, selected]);\n}\n"],"mappings":";;;;;;;AAAA;;AAIA;;AAcA,MAAMA,4BAA+D,GAAG;EACpEC,KAAK,EAAE;IACHC,UAAU,EAAE,CADT;IAEHC,UAAU,EAAE;EAFT,CAD6D;EAKpEC,KAAK,EAAE;IACHF,UAAU,EAAE,EADT;IAEHC,UAAU,EAAE;EAFT;AAL6D,CAAxE;AAWA,MAAME,aAA2D,GAAG;EAChEJ,KAAK,EAAE;IACHK,MAAM,EAAE,EADL;IAEHC,KAAK,EAAE;EAFJ,CADyD;EAKhEH,KAAK,EAAE;IACHE,MAAM,EAAE,EADL;IAEHC,KAAK,EAAE;EAFJ;AALyD,CAApE,C,CAWA;;AACe,SAASC,YAAT,CACXC,IADW,EAEXC,mBAFW,EAGXC,KAHW,EAIXC,QAJW,EAKF;EACT,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO,IAAAC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,IAAD,CAPzB;MAQHgD,KAAK,EAAEzC,YAAY,CAACP,IAAD,CARhB;MASHuC,YAAY,4BAAEP,eAAe,CAAC/B,mBAAD,CAAjB,2DAAE,uBAAsCsC,YATjD;MAUHC,qBAAqB,4BAAER,eAAe,CAAC/B,mBAAD,CAAjB,2DAAE,uBAAsCuC;IAV1D,CAAP;EAYH,CAlGM,EAkGJ,CAACpC,KAAD,EAAQJ,IAAR,EAAcC,mBAAd,EAAmCC,KAAnC,EAA0CC,QAA1C,CAlGI,CAAP;AAmGH"}
@@ -29,13 +29,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
29
29
 
30
30
  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); }
31
31
 
32
- const TOP_ELEMENT_OFFSET = 20;
32
+ const TOP_ELEMENT_HIDDEN_OFFSET = 20;
33
33
 
34
34
  function Dialog(props) {
35
35
  const {
36
36
  animationType = _Modal.ANIMATION_TYPE.SLIDE,
37
37
  children,
38
- fullScreen = false,
39
38
  hideBackdrop,
40
39
  onClose,
41
40
  style: styleProp,
@@ -44,7 +43,7 @@ function Dialog(props) {
44
43
  topElement,
45
44
  ...otherProps
46
45
  } = props;
47
- const styles = (0, _useDialogStyle.default)(size, fullScreen);
46
+ const styles = (0, _useDialogStyle.default)(size);
48
47
  const {
49
48
  height: screenHeight
50
49
  } = (0, _reactNative.useWindowDimensions)();
@@ -62,8 +61,9 @@ function Dialog(props) {
62
61
  return [];
63
62
  }
64
63
 
64
+ const topElementHeightWithoutOffset = Math.max(0, topElementHeight - TOP_ELEMENT_HIDDEN_OFFSET);
65
65
  return [{
66
- toValue: (topElementHeight - TOP_ELEMENT_OFFSET) / 2,
66
+ toValue: topElementHeightWithoutOffset / 2,
67
67
  type: _Modal.ANIMATION_TYPE.SLIDE
68
68
  }];
69
69
  }, [topElementHeight]);
@@ -73,7 +73,7 @@ function Dialog(props) {
73
73
  toValue: 0,
74
74
  type: _Modal.ANIMATION_TYPE.FADE
75
75
  }];
76
- } else if (animationType === _Modal.ANIMATION_TYPE.SLIDE && !fullScreen) {
76
+ } else if (animationType === _Modal.ANIMATION_TYPE.SLIDE) {
77
77
  return [{
78
78
  toValue: screenHeight,
79
79
  type: _Modal.ANIMATION_TYPE.SLIDE
@@ -89,14 +89,14 @@ function Dialog(props) {
89
89
  toValue: screenHeight,
90
90
  type: _Modal.ANIMATION_TYPE.SLIDE
91
91
  }];
92
- }, [animationType, fullScreen, screenHeight]);
92
+ }, [animationType, screenHeight]);
93
93
  const openAnimation = (0, _react.useMemo)(() => {
94
94
  if (animationType === _Modal.ANIMATION_TYPE.FADE) {
95
95
  return [{
96
96
  toValue: 1,
97
97
  type: _Modal.ANIMATION_TYPE.FADE
98
98
  }];
99
- } else if (animationType === _Modal.ANIMATION_TYPE.SLIDE && !fullScreen) {
99
+ } else if (animationType === _Modal.ANIMATION_TYPE.SLIDE) {
100
100
  return [{
101
101
  toValue: 0,
102
102
  type: _Modal.ANIMATION_TYPE.SLIDE
@@ -112,8 +112,8 @@ function Dialog(props) {
112
112
  toValue: 0,
113
113
  type: _Modal.ANIMATION_TYPE.SLIDE
114
114
  }];
115
- }, [animationType, fullScreen]);
116
- const initialOpacity = animationType === _Modal.ANIMATION_TYPE.SLIDE && fullScreen ? 1 : undefined;
115
+ }, [animationType]);
116
+ const initialOpacity = animationType === _Modal.ANIMATION_TYPE.SLIDE ? 1 : undefined;
117
117
  const initialTranslateY = animationType === _Modal.ANIMATION_TYPE.FADE ? 0 : undefined;
118
118
  const paperStyle = (0, _styles.css)([styles.paper, styleProp]);
119
119
  return /*#__PURE__*/_react.default.createElement(_Modal.default, _extends({
@@ -132,7 +132,7 @@ function Dialog(props) {
132
132
  size
133
133
  }
134
134
  }, topElement ? /*#__PURE__*/_react.default.createElement(_Column.default, {
135
- style: fullScreen ? undefined : styles.topElementContainer
135
+ style: styles.topElementContainer
136
136
  }, /*#__PURE__*/_react.default.createElement(_Column.default, {
137
137
  style: styles.topElementContent,
138
138
  onLayout: handleTopElementLayout
@@ -141,6 +141,4 @@ function Dialog(props) {
141
141
  style: paperStyle
142
142
  }, children)));
143
143
  }
144
-
145
- ;
146
144
  //# sourceMappingURL=Dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TOP_ELEMENT_OFFSET","Dialog","props","animationType","ANIMATION_TYPE","SLIDE","children","fullScreen","hideBackdrop","onClose","style","styleProp","size","visible","topElement","otherProps","styles","useDialogStyle","height","screenHeight","useWindowDimensions","topElementHeight","setTopElementHeight","useState","handleTopElementLayout","event","nativeEvent","layout","offsetAnimation","useMemo","toValue","type","closeAnimation","FADE","duration","openAnimation","delay","initialOpacity","undefined","initialTranslateY","paperStyle","css","paper","container","root","topElementContainer","topElementContent"],"sources":["Dialog.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport { LayoutChangeEvent, useWindowDimensions } from 'react-native';\nimport { css } from '@fountain-ui/styles';\nimport Column from '../Column';\nimport Modal, { ANIMATION_TYPE, AnimationUnit } from '../Modal';\nimport ShadowView from '../ShadowView';\nimport type DialogProps from './DialogProps';\nimport { DialogProvider } from './DialogContext';\nimport useDialogStyle from './useDialogStyle';\n\nconst TOP_ELEMENT_OFFSET = 20;\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: styleProp,\n size = 'medium',\n visible,\n topElement,\n ...otherProps\n } = props;\n\n const styles = useDialogStyle(size, fullScreen);\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 const paperStyle = css([\n styles.paper,\n styleProp,\n ]);\n\n return (\n <Modal\n animationStyle={styles.container}\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 <DialogProvider value={{ size }}>\n {topElement ? (\n <Column style={fullScreen ? undefined : styles.topElementContainer}>\n <Column\n style={styles.topElementContent}\n onLayout={handleTopElementLayout}\n >\n {topElement}\n </Column>\n </Column>\n ) : null}\n\n <ShadowView\n variant={600}\n style={paperStyle}\n >\n {children}\n </ShadowView>\n </DialogProvider>\n </Modal>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,MAAMA,kBAAkB,GAAG,EAA3B;;AAEe,SAASC,MAAT,CAAgBC,KAAhB,EAAoC;EAC/C,MAAM;IACFC,aAAa,GAAGC,qBAAA,CAAeC,KAD7B;IAEFC,QAFE;IAGFC,UAAU,GAAG,KAHX;IAIFC,YAJE;IAKFC,OALE;IAMFC,KAAK,EAAEC,SANL;IAOFC,IAAI,GAAG,QAPL;IAQFC,OARE;IASFC,UATE;IAUF,GAAGC;EAVD,IAWFb,KAXJ;EAaA,MAAMc,MAAM,GAAG,IAAAC,uBAAA,EAAeL,IAAf,EAAqBL,UAArB,CAAf;EAEA,MAAM;IAAEW,MAAM,EAAEC;EAAV,IAA2B,IAAAC,gCAAA,GAAjC;EAEA,MAAM,CAACC,gBAAD,EAAmBC,mBAAnB,IAA0C,IAAAC,eAAA,EAAS,CAAT,CAAhD;;EACA,MAAMC,sBAAsB,GAAIC,KAAD,IAA8B;IACzD,MAAM;MAAEP;IAAF,IAAaO,KAAK,CAACC,WAAN,CAAkBC,MAArC;IACAL,mBAAmB,CAACJ,MAAD,CAAnB;EACH,CAHD;;EAKA,MAAMU,eAAe,GAAG,IAAAC,cAAA,EAAyB,MAAM;IACnD,IAAIR,gBAAgB,KAAK,CAAzB,EAA4B;MACxB,OAAO,EAAP;IACH;;IAED,OAAO,CAAC;MACJS,OAAO,EAAE,CAACT,gBAAgB,GAAGrB,kBAApB,IAA0C,CAD/C;MAEJ+B,IAAI,EAAE3B,qBAAA,CAAeC;IAFjB,CAAD,CAAP;EAIH,CATuB,EASrB,CAACgB,gBAAD,CATq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CAZJ,CAbJ,CADJ;AAmCH;;AAAA"}
1
+ {"version":3,"names":["TOP_ELEMENT_HIDDEN_OFFSET","Dialog","props","animationType","ANIMATION_TYPE","SLIDE","children","hideBackdrop","onClose","style","styleProp","size","visible","topElement","otherProps","styles","useDialogStyle","height","screenHeight","useWindowDimensions","topElementHeight","setTopElementHeight","useState","handleTopElementLayout","event","nativeEvent","layout","offsetAnimation","useMemo","topElementHeightWithoutOffset","Math","max","toValue","type","closeAnimation","FADE","duration","openAnimation","delay","initialOpacity","undefined","initialTranslateY","paperStyle","css","paper","container","root","topElementContainer","topElementContent"],"sources":["Dialog.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport { LayoutChangeEvent, useWindowDimensions } from 'react-native';\nimport { css } from '@fountain-ui/styles';\nimport Column from '../Column';\nimport Modal, { ANIMATION_TYPE, AnimationUnit } from '../Modal';\nimport ShadowView from '../ShadowView';\nimport type DialogProps from './DialogProps';\nimport { DialogProvider } from './DialogContext';\nimport useDialogStyle from './useDialogStyle';\n\nconst TOP_ELEMENT_HIDDEN_OFFSET = 20;\n\nexport default function Dialog(props: DialogProps) {\n const {\n animationType = ANIMATION_TYPE.SLIDE,\n children,\n hideBackdrop,\n onClose,\n style: styleProp,\n size = 'medium',\n visible,\n topElement,\n ...otherProps\n } = props;\n\n const styles = useDialogStyle(size);\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 const topElementHeightWithoutOffset = Math.max(0, topElementHeight - TOP_ELEMENT_HIDDEN_OFFSET);\n\n return [{\n toValue: (topElementHeightWithoutOffset) / 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) {\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, 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) {\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]);\n\n const initialOpacity = animationType === ANIMATION_TYPE.SLIDE ? 1 : undefined;\n\n const initialTranslateY = animationType === ANIMATION_TYPE.FADE ? 0 : undefined;\n\n const paperStyle = css([\n styles.paper,\n styleProp,\n ]);\n\n return (\n <Modal\n animationStyle={styles.container}\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 <DialogProvider value={{ size }}>\n {topElement ? (\n <Column style={styles.topElementContainer}>\n <Column\n style={styles.topElementContent}\n onLayout={handleTopElementLayout}\n >\n {topElement}\n </Column>\n </Column>\n ) : null}\n\n <ShadowView\n variant={600}\n style={paperStyle}\n >\n {children}\n </ShadowView>\n </DialogProvider>\n </Modal>\n );\n}\n"],"mappings":";;;;;;;AAAA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jC,GAAyC,CAAzC,GAA6CmC,SAApE;EAEA,MAAMC,iBAAiB,GAAGtC,aAAa,KAAKC,qBAAA,CAAe+B,IAAjC,GAAwC,CAAxC,GAA4CK,SAAtE;EAEA,MAAME,UAAU,GAAG,IAAAC,WAAA,EAAI,CACnB5B,MAAM,CAAC6B,KADY,EAEnBlC,SAFmB,CAAJ,CAAnB;EAKA,oBACI,6BAAC,cAAD;IACI,cAAc,EAAEK,MAAM,CAAC8B,SAD3B;IAEI,cAAc,EAAEX,cAFpB;IAGI,YAAY,EAAE3B,YAAY,IAAIJ,aAAa,KAAKC,qBAAA,CAAe+B,IAHnE;IAII,cAAc,EAAEI,cAJpB;IAKI,iBAAiB,EAAEE,iBALvB;IAMI,OAAO,EAAEjC,OANb;IAOI,aAAa,EAAE6B,aAPnB;IAQI,eAAe,EAAEV,eARrB;IASI,OAAO,EAAEf,OATb;IAUI,KAAK,EAAEG,MAAM,CAAC+B;EAVlB,GAWQhC,UAXR,gBAaI,6BAAC,6BAAD;IAAgB,KAAK,EAAE;MAAEH;IAAF;EAAvB,GACKE,UAAU,gBACP,6BAAC,eAAD;IAAQ,KAAK,EAAEE,MAAM,CAACgC;EAAtB,gBACI,6BAAC,eAAD;IACI,KAAK,EAAEhC,MAAM,CAACiC,iBADlB;IAEI,QAAQ,EAAEzB;EAFd,GAIKV,UAJL,CADJ,CADO,GASP,IAVR,eAYI,6BAAC,mBAAD;IACI,OAAO,EAAE,GADb;IAEI,KAAK,EAAE6B;EAFX,GAIKpC,QAJL,CAZJ,CAbJ,CADJ;AAmCH"}
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.dialogSizes = void 0;
7
- const dialogSizes = ['small', 'medium', 'large'];
7
+ const dialogSizes = ['small', 'medium', 'large', 'full'];
8
8
  exports.dialogSizes = dialogSizes;
9
9
  //# sourceMappingURL=DialogProps.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["dialogSizes"],"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 const dialogSizes = ['small', 'medium', 'large'] as const;\nexport type DialogSize = typeof dialogSizes[number];\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 * Determines the minWidth of the Dialog.\n * @default 'medium'\n */\n size?: DialogSize;\n\n /**\n * Top element for displaying additional information on the dialog.\n */\n topElement?: React.ReactNode;\n}> {}\n"],"mappings":";;;;;;AAKO,MAAMA,WAAW,GAAG,CAAC,OAAD,EAAU,QAAV,EAAoB,OAApB,CAApB"}
1
+ {"version":3,"names":["dialogSizes"],"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 const dialogSizes = ['small', 'medium', 'large', 'full'] as const;\nexport type DialogSize = typeof dialogSizes[number];\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 * Determines the minWidth of the Dialog.\n * @default 'medium'\n */\n size?: DialogSize;\n\n /**\n * Top element for displaying additional information on the dialog.\n */\n topElement?: React.ReactNode;\n}> {}\n"],"mappings":";;;;;;AAKO,MAAMA,WAAW,GAAG,CAAC,OAAD,EAAU,QAAV,EAAoB,OAApB,EAA6B,MAA7B,CAApB"}
@@ -24,14 +24,16 @@ function useDialogSectionStyle() {
24
24
  return (0, _react.useMemo)(() => {
25
25
  const sizePaddingHorizontalMap = {
26
26
  small: {
27
- paddingHorizontal: theme.spacing(6)
27
+ paddingHorizontal: 24
28
28
  },
29
29
  medium: {
30
- // TODO: need to refactor breakpoints.
31
- paddingHorizontal: theme.spacing(windowWidth >= 448 ? 8 : 6)
30
+ paddingHorizontal: windowWidth >= 448 ? 32 : 24
32
31
  },
33
32
  large: {
34
- paddingHorizontal: theme.spacing(8)
33
+ paddingHorizontal: 32
34
+ },
35
+ full: {
36
+ paddingHorizontal: windowWidth >= 448 ? 32 : 24
35
37
  }
36
38
  };
37
39
  return sizePaddingHorizontalMap[size];
@@ -1 +1 @@
1
- {"version":3,"names":["useDialogSectionStyle","size","useDialogContext","width","windowWidth","useWindowDimensions","theme","useTheme","useMemo","sizePaddingHorizontalMap","small","paddingHorizontal","spacing","medium","large"],"sources":["useDialogSectionStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useWindowDimensions } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { useDialogContext } from './DialogContext';\nimport type { DialogSize } from './DialogProps';\n\nexport default function useDialogSectionStyle() {\n const { size } = useDialogContext();\n\n const { width: windowWidth } = useWindowDimensions();\n\n const theme = useTheme();\n\n return useMemo<FountainUiStyle>(() => {\n const sizePaddingHorizontalMap: Record<DialogSize, FountainUiStyle> = {\n small: {\n paddingHorizontal: theme.spacing(6),\n },\n medium: {\n // TODO: need to refactor breakpoints.\n paddingHorizontal: theme.spacing(windowWidth >= 448 ? 8 : 6),\n },\n large: {\n paddingHorizontal: theme.spacing(8),\n },\n };\n\n return sizePaddingHorizontalMap[size];\n }, [size, theme, windowWidth]);\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAGe,SAASA,qBAAT,GAAiC;EAC5C,MAAM;IAAEC;EAAF,IAAW,IAAAC,+BAAA,GAAjB;EAEA,MAAM;IAAEC,KAAK,EAAEC;EAAT,IAAyB,IAAAC,gCAAA,GAA/B;EAEA,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAyB,MAAM;IAClC,MAAMC,wBAA6D,GAAG;MAClEC,KAAK,EAAE;QACHC,iBAAiB,EAAEL,KAAK,CAACM,OAAN,CAAc,CAAd;MADhB,CAD2D;MAIlEC,MAAM,EAAE;QACJ;QACAF,iBAAiB,EAAEL,KAAK,CAACM,OAAN,CAAcR,WAAW,IAAI,GAAf,GAAqB,CAArB,GAAyB,CAAvC;MAFf,CAJ0D;MAQlEU,KAAK,EAAE;QACHH,iBAAiB,EAAEL,KAAK,CAACM,OAAN,CAAc,CAAd;MADhB;IAR2D,CAAtE;IAaA,OAAOH,wBAAwB,CAACR,IAAD,CAA/B;EACH,CAfM,EAeJ,CAACA,IAAD,EAAOK,KAAP,EAAcF,WAAd,CAfI,CAAP;AAgBH"}
1
+ {"version":3,"names":["useDialogSectionStyle","size","useDialogContext","width","windowWidth","useWindowDimensions","theme","useTheme","useMemo","sizePaddingHorizontalMap","small","paddingHorizontal","medium","large","full"],"sources":["useDialogSectionStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useWindowDimensions } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { useDialogContext } from './DialogContext';\nimport type { DialogSize } from './DialogProps';\n\nexport default function useDialogSectionStyle() {\n const { size } = useDialogContext();\n\n const { width: windowWidth } = useWindowDimensions();\n\n const theme = useTheme();\n\n return useMemo<FountainUiStyle>(() => {\n const sizePaddingHorizontalMap: Record<DialogSize, FountainUiStyle> = {\n small: {\n paddingHorizontal: 24,\n },\n medium: {\n paddingHorizontal: windowWidth >= 448 ? 32 : 24,\n },\n large: {\n paddingHorizontal: 32,\n },\n full: {\n paddingHorizontal: windowWidth >= 448 ? 32 : 24,\n },\n };\n\n return sizePaddingHorizontalMap[size];\n }, [size, theme, windowWidth]);\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAGe,SAASA,qBAAT,GAAiC;EAC5C,MAAM;IAAEC;EAAF,IAAW,IAAAC,+BAAA,GAAjB;EAEA,MAAM;IAAEC,KAAK,EAAEC;EAAT,IAAyB,IAAAC,gCAAA,GAA/B;EAEA,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAyB,MAAM;IAClC,MAAMC,wBAA6D,GAAG;MAClEC,KAAK,EAAE;QACHC,iBAAiB,EAAE;MADhB,CAD2D;MAIlEC,MAAM,EAAE;QACJD,iBAAiB,EAAEP,WAAW,IAAI,GAAf,GAAqB,EAArB,GAA0B;MADzC,CAJ0D;MAOlES,KAAK,EAAE;QACHF,iBAAiB,EAAE;MADhB,CAP2D;MAUlEG,IAAI,EAAE;QACFH,iBAAiB,EAAEP,WAAW,IAAI,GAAf,GAAqB,EAArB,GAA0B;MAD3C;IAV4D,CAAtE;IAeA,OAAOK,wBAAwB,CAACR,IAAD,CAA/B;EACH,CAjBM,EAiBJ,CAACA,IAAD,EAAOK,KAAP,EAAcF,WAAd,CAjBI,CAAP;AAkBH"}
@@ -9,14 +9,20 @@ var _react = require("react");
9
9
 
10
10
  var _reactNative = require("react-native");
11
11
 
12
+ var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
13
+
12
14
  var _styles = require("../styles");
13
15
 
14
- function useDialogStyle(size, fullScreen) {
16
+ function useDialogStyle(size) {
15
17
  const theme = (0, _styles.useTheme)();
16
18
  const {
17
19
  height: windowHeight,
18
20
  width: windowWidth
19
21
  } = (0, _reactNative.useWindowDimensions)();
22
+ const {
23
+ bottom: bottomSafeAreaInset,
24
+ top: topSafeAreaInset
25
+ } = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
20
26
  return (0, _react.useMemo)(() => {
21
27
  var _sizeStyleMap$size;
22
28
 
@@ -31,31 +37,36 @@ function useDialogStyle(size, fullScreen) {
31
37
  maxWidth: 512,
32
38
  minHeight: 360,
33
39
  width: 512
40
+ },
41
+ full: {
42
+ paddingBottom: bottomSafeAreaInset,
43
+ paddingTop: Math.max(0, topSafeAreaInset - 3)
34
44
  }
35
45
  };
36
- const containerPaddingVertical = theme.spacing(6);
46
+ const containerPaddingVertical = 24;
37
47
  const dialogMaxHeight = windowHeight - containerPaddingVertical * 2;
38
48
  const dialogMaxWidth = (_sizeStyleMap$size = sizeStyleMap[size]) === null || _sizeStyleMap$size === void 0 ? void 0 : _sizeStyleMap$size.maxWidth;
49
+ const isFullScreen = size === 'full';
39
50
  return {
40
51
  root: {
41
52
  alignItems: 'center',
42
53
  justifyContent: 'center',
43
54
  zIndex: theme.zIndex.dialog
44
55
  },
45
- container: fullScreen ? {
56
+ container: isFullScreen ? {
46
57
  height: '100%',
47
58
  width: '100%'
48
59
  } : {
49
60
  alignItems: 'center',
50
- // TODO: need to refactor breakpoints.
51
- paddingHorizontal: theme.spacing(windowWidth > 320 ? 6 : 4),
61
+ paddingHorizontal: windowWidth > theme.breakpoints.values.xs ? 24 : 16,
52
62
  paddingVertical: containerPaddingVertical,
53
63
  width: '100%'
54
64
  },
55
- paper: fullScreen ? {
65
+ paper: isFullScreen ? {
56
66
  backgroundColor: theme.palette.surface.base,
57
67
  height: '100%',
58
- width: '100%'
68
+ width: '100%',
69
+ ...sizeStyleMap[size]
59
70
  } : {
60
71
  backgroundColor: theme.palette.surface.base,
61
72
  borderRadius: theme.shape.radius.xl,
@@ -74,6 +85,6 @@ function useDialogStyle(size, fullScreen) {
74
85
  width: '100%'
75
86
  }
76
87
  };
77
- }, [theme, windowHeight, windowWidth, size, fullScreen]);
88
+ }, [theme, windowHeight, windowWidth, size, bottomSafeAreaInset, topSafeAreaInset]);
78
89
  }
79
90
  //# sourceMappingURL=useDialogStyle.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useDialogStyle","size","fullScreen","theme","useTheme","height","windowHeight","width","windowWidth","useWindowDimensions","useMemo","sizeStyleMap","small","maxWidth","medium","large","minHeight","containerPaddingVertical","spacing","dialogMaxHeight","dialogMaxWidth","root","alignItems","justifyContent","zIndex","dialog","container","paddingHorizontal","paddingVertical","paper","backgroundColor","palette","surface","base","borderRadius","shape","radius","xl","maxHeight","overflow","topElementContainer","topElementContent","position","bottom"],"sources":["useDialogStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useWindowDimensions } from 'react-native';\nimport type { FountainUiStyle, NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport type { DialogSize } from './DialogProps';\n\ntype DialogStyleKeys =\n | 'root'\n | 'container'\n | 'paper'\n | 'topElementContainer'\n | 'topElementContent';\n\ntype DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;\n\nexport default function useDialogStyle(size: DialogSize, fullScreen: boolean): DialogStyles {\n const theme = useTheme();\n\n const {\n height: windowHeight,\n width: windowWidth,\n } = useWindowDimensions();\n\n return useMemo(() => {\n const sizeStyleMap: Record<DialogSize, FountainUiStyle> = {\n small: {\n maxWidth: 260,\n },\n medium: {\n maxWidth: 400,\n },\n large: {\n maxWidth: 512,\n minHeight: 360,\n width: 512,\n },\n };\n\n const containerPaddingVertical = theme.spacing(6);\n const dialogMaxHeight = windowHeight - containerPaddingVertical * 2;\n const dialogMaxWidth = sizeStyleMap[size]?.maxWidth;\n\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: theme.zIndex.dialog,\n },\n container: fullScreen ? {\n height: '100%',\n width: '100%',\n } : {\n alignItems: 'center',\n // TODO: need to refactor breakpoints.\n paddingHorizontal: theme.spacing(windowWidth > 320 ? 6 : 4),\n paddingVertical: containerPaddingVertical,\n width: '100%',\n },\n paper: fullScreen ? {\n backgroundColor: theme.palette.surface.base,\n height: '100%',\n width: '100%',\n } : {\n backgroundColor: theme.palette.surface.base,\n borderRadius: theme.shape.radius.xl,\n maxHeight: dialogMaxHeight,\n overflow: 'hidden',\n width: '100%',\n ...sizeStyleMap[size],\n },\n topElementContainer: {\n maxWidth: dialogMaxWidth,\n width: '100%',\n },\n topElementContent: {\n position: 'absolute',\n bottom: 0,\n width: '100%',\n },\n };\n }, [theme, windowHeight, windowWidth, size, fullScreen]);\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAYe,SAASA,cAAT,CAAwBC,IAAxB,EAA0CC,UAA1C,EAA6E;EACxF,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAM;IACFC,MAAM,EAAEC,YADN;IAEFC,KAAK,EAAEC;EAFL,IAGF,IAAAC,gCAAA,GAHJ;EAKA,OAAO,IAAAC,cAAA,EAAQ,MAAM;IAAA;;IACjB,MAAMC,YAAiD,GAAG;MACtDC,KAAK,EAAE;QACHC,QAAQ,EAAE;MADP,CAD+C;MAItDC,MAAM,EAAE;QACJD,QAAQ,EAAE;MADN,CAJ8C;MAOtDE,KAAK,EAAE;QACHF,QAAQ,EAAE,GADP;QAEHG,SAAS,EAAE,GAFR;QAGHT,KAAK,EAAE;MAHJ;IAP+C,CAA1D;IAcA,MAAMU,wBAAwB,GAAGd,KAAK,CAACe,OAAN,CAAc,CAAd,CAAjC;IACA,MAAMC,eAAe,GAAGb,YAAY,GAAGW,wBAAwB,GAAG,CAAlE;IACA,MAAMG,cAAc,yBAAGT,YAAY,CAACV,IAAD,CAAf,uDAAG,mBAAoBY,QAA3C;IAEA,OAAO;MACHQ,IAAI,EAAE;QACFC,UAAU,EAAE,QADV;QAEFC,cAAc,EAAE,QAFd;QAGFC,MAAM,EAAErB,KAAK,CAACqB,MAAN,CAAaC;MAHnB,CADH;MAMHC,SAAS,EAAExB,UAAU,GAAG;QACpBG,MAAM,EAAE,MADY;QAEpBE,KAAK,EAAE;MAFa,CAAH,GAGjB;QACAe,UAAU,EAAE,QADZ;QAEA;QACAK,iBAAiB,EAAExB,KAAK,CAACe,OAAN,CAAcV,WAAW,GAAG,GAAd,GAAoB,CAApB,GAAwB,CAAtC,CAHnB;QAIAoB,eAAe,EAAEX,wBAJjB;QAKAV,KAAK,EAAE;MALP,CATD;MAgBHsB,KAAK,EAAE3B,UAAU,GAAG;QAChB4B,eAAe,EAAE3B,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBC,IADvB;QAEhB5B,MAAM,EAAE,MAFQ;QAGhBE,KAAK,EAAE;MAHS,CAAH,GAIb;QACAuB,eAAe,EAAE3B,KAAK,CAAC4B,OAAN,CAAcC,OAAd,CAAsBC,IADvC;QAEAC,YAAY,EAAE/B,KAAK,CAACgC,KAAN,CAAYC,MAAZ,CAAmBC,EAFjC;QAGAC,SAAS,EAAEnB,eAHX;QAIAoB,QAAQ,EAAE,QAJV;QAKAhC,KAAK,EAAE,MALP;QAMA,GAAGI,YAAY,CAACV,IAAD;MANf,CApBD;MA4BHuC,mBAAmB,EAAE;QACjB3B,QAAQ,EAAEO,cADO;QAEjBb,KAAK,EAAE;MAFU,CA5BlB;MAgCHkC,iBAAiB,EAAE;QACfC,QAAQ,EAAE,UADK;QAEfC,MAAM,EAAE,CAFO;QAGfpC,KAAK,EAAE;MAHQ;IAhChB,CAAP;EAsCH,CAzDM,EAyDJ,CAACJ,KAAD,EAAQG,YAAR,EAAsBE,WAAtB,EAAmCP,IAAnC,EAAyCC,UAAzC,CAzDI,CAAP;AA0DH"}
1
+ {"version":3,"names":["useDialogStyle","size","theme","useTheme","height","windowHeight","width","windowWidth","useWindowDimensions","bottom","bottomSafeAreaInset","top","topSafeAreaInset","useSafeAreaInsets","useMemo","sizeStyleMap","small","maxWidth","medium","large","minHeight","full","paddingBottom","paddingTop","Math","max","containerPaddingVertical","dialogMaxHeight","dialogMaxWidth","isFullScreen","root","alignItems","justifyContent","zIndex","dialog","container","paddingHorizontal","breakpoints","values","xs","paddingVertical","paper","backgroundColor","palette","surface","base","borderRadius","shape","radius","xl","maxHeight","overflow","topElementContainer","topElementContent","position"],"sources":["useDialogStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useWindowDimensions } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport type { FountainUiStyle, NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport type { DialogSize } from './DialogProps';\n\ntype DialogStyleKeys =\n | 'root'\n | 'container'\n | 'paper'\n | 'topElementContainer'\n | 'topElementContent';\n\ntype DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;\n\nexport default function useDialogStyle(size: DialogSize): DialogStyles {\n const theme = useTheme();\n\n const {\n height: windowHeight,\n width: windowWidth,\n } = useWindowDimensions();\n\n const {\n bottom: bottomSafeAreaInset,\n top: topSafeAreaInset,\n } = useSafeAreaInsets();\n\n return useMemo(() => {\n const sizeStyleMap: Record<DialogSize, FountainUiStyle> = {\n small: {\n maxWidth: 260,\n },\n medium: {\n maxWidth: 400,\n },\n large: {\n maxWidth: 512,\n minHeight: 360,\n width: 512,\n },\n full: {\n paddingBottom: bottomSafeAreaInset,\n paddingTop: Math.max(0, topSafeAreaInset - 3),\n },\n };\n\n const containerPaddingVertical = 24;\n const dialogMaxHeight = windowHeight - containerPaddingVertical * 2;\n const dialogMaxWidth = sizeStyleMap[size]?.maxWidth;\n\n const isFullScreen = size === 'full';\n\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: theme.zIndex.dialog,\n },\n container: isFullScreen ? {\n height: '100%',\n width: '100%',\n } : {\n alignItems: 'center',\n paddingHorizontal: windowWidth > theme.breakpoints.values.xs ? 24 : 16,\n paddingVertical: containerPaddingVertical,\n width: '100%',\n },\n paper: isFullScreen ? {\n backgroundColor: theme.palette.surface.base,\n height: '100%',\n width: '100%',\n ...sizeStyleMap[size],\n } : {\n backgroundColor: theme.palette.surface.base,\n borderRadius: theme.shape.radius.xl,\n maxHeight: dialogMaxHeight,\n overflow: 'hidden',\n width: '100%',\n ...sizeStyleMap[size],\n },\n topElementContainer: {\n maxWidth: dialogMaxWidth,\n width: '100%',\n },\n topElementContent: {\n position: 'absolute',\n bottom: 0,\n width: '100%',\n },\n };\n }, [theme, windowHeight, windowWidth, size, bottomS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AAU,EAAE,QADZ;QAEAK,iBAAiB,EAAE7B,WAAW,GAAGL,KAAK,CAACmC,WAAN,CAAkBC,MAAlB,CAAyBC,EAAvC,GAA4C,EAA5C,GAAiD,EAFpE;QAGAC,eAAe,EAAEd,wBAHjB;QAIApB,KAAK,EAAE;MAJP,CATD;MAeHmC,KAAK,EAAEZ,YAAY,GAAG;QAClBa,eAAe,EAAExC,KAAK,CAACyC,OAAN,CAAcC,OAAd,CAAsBC,IADrB;QAElBzC,MAAM,EAAE,MAFU;QAGlBE,KAAK,EAAE,MAHW;QAIlB,GAAGS,YAAY,CAACd,IAAD;MAJG,CAAH,GAKf;QACAyC,eAAe,EAAExC,KAAK,CAACyC,OAAN,CAAcC,OAAd,CAAsBC,IADvC;QAEAC,YAAY,EAAE5C,KAAK,CAAC6C,KAAN,CAAYC,MAAZ,CAAmBC,EAFjC;QAGAC,SAAS,EAAEvB,eAHX;QAIAwB,QAAQ,EAAE,QAJV;QAKA7C,KAAK,EAAE,MALP;QAMA,GAAGS,YAAY,CAACd,IAAD;MANf,CApBD;MA4BHmD,mBAAmB,EAAE;QACjBnC,QAAQ,EAAEW,cADO;QAEjBtB,KAAK,EAAE;MAFU,CA5BlB;MAgCH+C,iBAAiB,EAAE;QACfC,QAAQ,EAAE,UADK;QAEf7C,MAAM,EAAE,CAFO;QAGfH,KAAK,EAAE;MAHQ;IAhChB,CAAP;EAsCH,CA/DM,EA+DJ,CAACJ,KAAD,EAAQG,YAAR,EAAsBE,WAAtB,EAAmCN,IAAnC,EAAyCS,mBAAzC,EAA8DE,gBAA9D,CA/DI,CAAP;AAgEH"}
@@ -21,7 +21,6 @@ const useStyles = function () {
21
21
  const theme = (0, _styles.useTheme)();
22
22
  return {
23
23
  root: {
24
- paddingTop: theme.spacing(2),
25
24
  paddingBottom: theme.spacing(4)
26
25
  }
27
26
  };
@@ -1 +1 @@
1
- {"version":3,"names":["useStyles","theme","useTheme","root","paddingTop","spacing","paddingBottom","DialogActions","props","children","style","styleProp","otherProps","styles","sectionStyle","useDialogSectionStyle","rootStyle","css"],"sources":["DialogActions.tsx"],"sourcesContent":["import React from 'react';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport Column from '../Column';\nimport { useDialogSectionStyle } from '../Dialog';\nimport { css, useTheme } from '../styles';\nimport type DialogActionsProps from './DialogActionsProps';\n\ntype DialogActionsStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: UseStyles<DialogActionsStyles> = function (): DialogActionsStyles {\n const theme = useTheme();\n\n return {\n root: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(4),\n },\n };\n};\n\nexport default function DialogActions(props: DialogActionsProps) {\n const {\n children,\n style: styleProp,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const sectionStyle = useDialogSectionStyle();\n\n const rootStyle = css([\n styles.root,\n sectionStyle,\n styleProp,\n ]);\n\n return (\n <Column\n style={rootStyle}\n {...otherProps}\n >\n {children}\n </Column>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;;;;;AAKA,MAAMA,SAAyC,GAAG,YAAiC;EAC/E,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAEH,KAAK,CAACI,OAAN,CAAc,CAAd,CADV;MAEFC,aAAa,EAAEL,KAAK,CAACI,OAAN,CAAc,CAAd;IAFb;EADH,CAAP;AAMH,CATD;;AAWe,SAASE,aAAT,CAAuBC,KAAvB,EAAkD;EAC7D,MAAM;IACFC,QADE;IAEFC,KAAK,EAAEC,SAFL;IAGF,GAAGC;EAHD,IAIFJ,KAJJ;EAMA,MAAMK,MAAM,GAAGb,SAAS,EAAxB;EAEA,MAAMc,YAAY,GAAG,IAAAC,6BAAA,GAArB;EAEA,MAAMC,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBJ,MAAM,CAACV,IADW,EAElBW,YAFkB,EAGlBH,SAHkB,CAAJ,CAAlB;EAMA,oBACI,6BAAC,eAAD;IACI,KAAK,EAAEK;EADX,GAEQJ,UAFR,GAIKH,QAJL,CADJ;AAQH;;AAAA"}
1
+ {"version":3,"names":["useStyles","theme","useTheme","root","paddingBottom","spacing","DialogActions","props","children","style","styleProp","otherProps","styles","sectionStyle","useDialogSectionStyle","rootStyle","css"],"sources":["DialogActions.tsx"],"sourcesContent":["import React from 'react';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport Column from '../Column';\nimport { useDialogSectionStyle } from '../Dialog';\nimport { css, useTheme } from '../styles';\nimport type DialogActionsProps from './DialogActionsProps';\n\ntype DialogActionsStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: UseStyles<DialogActionsStyles> = function (): DialogActionsStyles {\n const theme = useTheme();\n\n return {\n root: {\n paddingBottom: theme.spacing(4),\n },\n };\n};\n\nexport default function DialogActions(props: DialogActionsProps) {\n const {\n children,\n style: styleProp,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const sectionStyle = useDialogSectionStyle();\n\n const rootStyle = css([\n styles.root,\n sectionStyle,\n styleProp,\n ]);\n\n return (\n <Column\n style={rootStyle}\n {...otherProps}\n >\n {children}\n </Column>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;;;;;AAKA,MAAMA,SAAyC,GAAG,YAAiC;EAC/E,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,aAAa,EAAEH,KAAK,CAACI,OAAN,CAAc,CAAd;IADb;EADH,CAAP;AAKH,CARD;;AAUe,SAASC,aAAT,CAAuBC,KAAvB,EAAkD;EAC7D,MAAM;IACFC,QADE;IAEFC,KAAK,EAAEC,SAFL;IAGF,GAAGC;EAHD,IAIFJ,KAJJ;EAMA,MAAMK,MAAM,GAAGZ,SAAS,EAAxB;EAEA,MAAMa,YAAY,GAAG,IAAAC,6BAAA,GAArB;EAEA,MAAMC,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBJ,MAAM,CAACT,IADW,EAElBU,YAFkB,EAGlBH,SAHkB,CAAJ,CAAlB;EAMA,oBACI,6BAAC,eAAD;IACI,KAAK,EAAEK;EADX,GAEQJ,UAFR,GAIKH,QAJL,CADJ;AAQH;;AAAA"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = DialogLargeTitle;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _styles = require("../styles");
13
+
14
+ var _IconButton = _interopRequireDefault(require("../IconButton"));
15
+
16
+ var _internal = require("../internal");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
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
+
22
+ const styles = _reactNative.StyleSheet.create({
23
+ root: {
24
+ alignItems: 'center',
25
+ height: 64,
26
+ justifyContent: 'center',
27
+ paddingHorizontal: 80,
28
+ width: '100%'
29
+ },
30
+ backButton: {
31
+ height: 40,
32
+ left: 20,
33
+ paddingLeft: 5,
34
+ paddingRight: 11,
35
+ paddingVertical: 8,
36
+ position: 'absolute',
37
+ width: 40
38
+ },
39
+ closeButton: {
40
+ height: 40,
41
+ left: 20,
42
+ padding: 8,
43
+ position: 'absolute',
44
+ width: 40
45
+ }
46
+ });
47
+
48
+ function DialogLargeTitle(props) {
49
+ const {
50
+ children,
51
+ closeButtonType = 'close',
52
+ onClose,
53
+ style: styleProp,
54
+ ...otherProps
55
+ } = props;
56
+ const theme = (0, _styles.useTheme)();
57
+ const fontStyle = (0, _styles.createFontStyle)(theme, {
58
+ selector: typo => typo.header4.semiBold,
59
+ color: theme.palette.text.strong
60
+ });
61
+ const rootStyle = (0, _styles.css)([styles.root, styleProp]);
62
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
63
+ style: rootStyle
64
+ }, otherProps), typeof onClose === 'function' ? closeButtonType === 'back' ? /*#__PURE__*/_react.default.createElement(_IconButton.default, {
65
+ style: styles.backButton,
66
+ onPress: onClose
67
+ }, /*#__PURE__*/_react.default.createElement(_internal.ChevronLeft, {
68
+ color: 'strong',
69
+ size: 'large'
70
+ })) : /*#__PURE__*/_react.default.createElement(_IconButton.default, {
71
+ style: styles.closeButton,
72
+ onPress: onClose
73
+ }, /*#__PURE__*/_react.default.createElement(_internal.Close, {
74
+ color: 'strong',
75
+ size: 'large'
76
+ })) : null, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
77
+ style: fontStyle
78
+ }, children));
79
+ }
80
+ //# sourceMappingURL=DialogLargeTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["styles","StyleSheet","create","root","alignItems","height","justifyContent","paddingHorizontal","width","backButton","left","paddingLeft","paddingRight","paddingVertical","position","closeButton","padding","DialogLargeTitle","props","children","closeButtonType","onClose","style","styleProp","otherProps","theme","useTheme","fontStyle","createFontStyle","selector","typo","header4","semiBold","color","palette","text","strong","rootStyle","css"],"sources":["DialogLargeTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\nimport type { DialogProps } from '../Dialog';\nimport type DialogTitleProps from './DialogTitleProps';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport IconButton from '../IconButton';\nimport { ChevronLeft, Close } from '../internal';\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: 'center',\n height: 64,\n justifyContent: 'center',\n paddingHorizontal: 80,\n width: '100%',\n },\n backButton: {\n height: 40,\n left: 20,\n paddingLeft: 5,\n paddingRight: 11,\n paddingVertical: 8,\n position: 'absolute',\n width: 40,\n },\n closeButton: {\n height: 40,\n left: 20,\n padding: 8,\n position: 'absolute',\n width: 40,\n },\n});\n\ninterface DialogLargeTitleProps extends DialogTitleProps {\n closeButtonType?: 'back' | 'close';\n onClose: DialogProps['onClose'];\n}\n\nexport default function DialogLargeTitle(props: DialogLargeTitleProps) {\n const {\n children,\n closeButtonType = 'close',\n onClose,\n style: styleProp,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => typo.header4.semiBold,\n color: theme.palette.text.strong,\n });\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n return (\n <View\n style={rootStyle}\n {...otherProps}\n >\n {typeof onClose === 'function' ? (\n closeButtonType === 'back' ? (\n <IconButton\n style={styles.backButton}\n onPress={onClose}\n >\n <ChevronLeft\n color={'strong'}\n size={'large'}\n />\n </IconButton>\n ) : (\n <IconButton\n style={styles.closeButton}\n onPress={onClose}\n >\n <Close\n color={'strong'}\n size={'large'}\n />\n </IconButton>\n )\n ) : null}\n\n <Text style={fontStyle}>\n {children}\n </Text>\n </View>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;AACA;;AACA;;;;;;AAEA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,UAAU,EAAE,QADV;IAEFC,MAAM,EAAE,EAFN;IAGFC,cAAc,EAAE,QAHd;IAIFC,iBAAiB,EAAE,EAJjB;IAKFC,KAAK,EAAE;EALL,CADuB;EAQ7BC,UAAU,EAAE;IACRJ,MAAM,EAAE,EADA;IAERK,IAAI,EAAE,EAFE;IAGRC,WAAW,EAAE,CAHL;IAIRC,YAAY,EAAE,EAJN;IAKRC,eAAe,EAAE,CALT;IAMRC,QAAQ,EAAE,UANF;IAORN,KAAK,EAAE;EAPC,CARiB;EAiB7BO,WAAW,EAAE;IACTV,MAAM,EAAE,EADC;IAETK,IAAI,EAAE,EAFG;IAGTM,OAAO,EAAE,CAHA;IAITF,QAAQ,EAAE,UAJD;IAKTN,KAAK,EAAE;EALE;AAjBgB,CAAlB,CAAf;;AA+Be,SAASS,gBAAT,CAA0BC,KAA1B,EAAwD;EACnE,MAAM;IACFC,QADE;IAEFC,eAAe,GAAG,OAFhB;IAGFC,OAHE;IAIFC,KAAK,EAAEC,SAJL;IAKF,GAAGC;EALD,IAMFN,KANJ;EAQA,MAAMO,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAMC,SAAS,GAAG,IAAAC,uBAAA,EAAgBH,KAAhB,EAAuB;IACrCI,QAAQ,EAAGC,IAAD,IAAUA,IAAI,CAACC,OAAL,CAAaC,QADI;IAErCC,KAAK,EAAER,KAAK,CAACS,OAAN,CAAcC,IAAd,CAAmBC;EAFW,CAAvB,CAAlB;EAKA,MAAMC,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBtC,MAAM,CAACG,IADW,EAElBoB,SAFkB,CAAJ,CAAlB;EAKA,oBACI,6BAAC,iBAAD;IACI,KAAK,EAAEc;EADX,GAEQb,UAFR,GAIK,OAAOH,OAAP,KAAmB,UAAnB,GACGD,eAAe,KAAK,MAApB,gBACI,6BAAC,mBAAD;IACI,KAAK,EAAEpB,MAAM,CAACS,UADlB;IAEI,OAAO,EAAEY;EAFb,gBAII,6BAAC,qBAAD;IACI,KAAK,EAAE,QADX;IAEI,IAAI,EAAE;EAFV,EAJJ,CADJ,gBAWI,6BAAC,mBAAD;IACI,KAAK,EAAErB,MAAM,CAACe,WADlB;IAEI,OAAO,EAAEM;EAFb,gBAII,6BAAC,eAAD;IACI,KAAK,EAAE,QADX;IAEI,IAAI,EAAE;EAFV,EAJJ,CAZP,GAsBG,IA1BR,eA4BI,6BAAC,iBAAD;IAAM,KAAK,EAAEM;EAAb,GACKR,QADL,CA5BJ,CADJ;AAkCH"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = DialogTitle;
6
+ exports.default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -13,6 +13,8 @@ var _Dialog = require("../Dialog");
13
13
 
14
14
  var _styles = require("../styles");
15
15
 
16
+ var _DialogLargeTitle = _interopRequireDefault(require("./DialogLargeTitle"));
17
+
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
19
 
18
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); }
@@ -29,7 +31,7 @@ const useStyles = function () {
29
31
  };
30
32
  };
31
33
 
32
- function DialogTitle(props) {
34
+ const DialogTitle = props => {
33
35
  const {
34
36
  children,
35
37
  style: styleProp,
@@ -49,7 +51,9 @@ function DialogTitle(props) {
49
51
  }), typeof children === 'string' ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
50
52
  style: titleStyle
51
53
  }, children) : children);
52
- }
54
+ };
53
55
 
54
- ;
56
+ DialogTitle.Large = _DialogLargeTitle.default;
57
+ var _default = DialogTitle;
58
+ exports.default = _default;
55
59
  //# sourceMappingURL=DialogTitle.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useStyles","theme","useTheme","root","paddingTop","spacing","title","textAlign","DialogTitle","props","children","style","styleProp","otherProps","styles","sectionStyle","useDialogSectionStyle","rootStyle","css","titleFontStyle","createFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle"],"sources":["DialogTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useDialogSectionStyle } from '../Dialog';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type DialogTitleProps from './DialogTitleProps';\n\ntype DialogTitleStyles = NamedStylesStringUnion<'root' | 'title'>;\n\nconst useStyles: UseStyles<DialogTitleStyles> = function (): DialogTitleStyles {\n const theme = useTheme();\n\n return {\n root: {\n paddingTop: theme.spacing(6.5),\n },\n title: {\n textAlign: 'center',\n },\n };\n};\n\nexport default function DialogTitle(props: DialogTitleProps) {\n const {\n children,\n style: styleProp,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const sectionStyle = useDialogSectionStyle();\n\n const rootStyle = css([\n styles.root,\n sectionStyle,\n styleProp,\n ]);\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.header3.semiBold,\n color: theme.palette.text.strong,\n });\n\n const titleStyle = css([\n styles.title,\n titleFontStyle,\n ]);\n\n return (\n <View\n {...otherProps}\n style={rootStyle}\n >\n {typeof children === 'string' ? (\n <Text style={titleStyle}>\n {children}\n </Text>\n ) : (children)}\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAKA,MAAMA,SAAuC,GAAG,YAA+B;EAC3E,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAEH,KAAK,CAACI,OAAN,CAAc,GAAd;IADV,CADH;IAIHC,KAAK,EAAE;MACHC,SAAS,EAAE;IADR;EAJJ,CAAP;AAQH,CAXD;;AAae,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,QADE;IAEFC,KAAK,EAAEC,SAFL;IAGF,GAAGC;EAHD,IAIFJ,KAJJ;EAMA,MAAMR,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAMY,MAAM,GAAGd,SAAS,EAAxB;EAEA,MAAMe,YAAY,GAAG,IAAAC,6BAAA,GAArB;EAEA,MAAMC,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBJ,MAAM,CAACX,IADW,EAElBY,YAFkB,EAGlBH,SAHkB,CAAJ,CAAlB;EAMA,MAAMO,cAAc,GAAG,IAAAC,uBAAA,EAAgBnB,KAAhB,EAAuB;IAC1CoB,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,OAAX,CAAmBC,QADH;IAE1CC,KAAK,EAAExB,KAAK,CAACyB,OAAN,CAAcC,IAAd,CAAmBC;EAFgB,CAAvB,CAAvB;EAKA,MAAMC,UAAU,GAAG,IAAAX,WAAA,EAAI,CACnBJ,MAAM,CAACR,KADY,EAEnBa,cAFmB,CAAJ,CAAnB;EAKA,oBACI,6BAAC,iBAAD,eACQN,UADR;IAEI,KAAK,EAAEI;EAFX,IAIK,OAAOP,QAAP,KAAoB,QAApB,gBACG,6BAAC,iBAAD;IAAM,KAAK,EAAEmB;EAAb,GACKnB,QADL,CADH,GAIIA,QART,CADJ;AAYH;;AAAA"}
1
+ {"version":3,"names":["useStyles","theme","useTheme","root","paddingTop","spacing","title","textAlign","DialogTitle","props","children","style","styleProp","otherProps","styles","sectionStyle","useDialogSectionStyle","rootStyle","css","titleFontStyle","createFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle","Large","DialogLargeTitle"],"sources":["DialogTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useDialogSectionStyle } from '../Dialog';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport DialogLargeTitle from './DialogLargeTitle';\nimport type DialogTitleProps from './DialogTitleProps';\n\ntype DialogTitleStyles = NamedStylesStringUnion<'root' | 'title'>;\n\nconst useStyles: UseStyles<DialogTitleStyles> = function (): DialogTitleStyles {\n const theme = useTheme();\n\n return {\n root: {\n paddingTop: theme.spacing(6.5),\n },\n title: {\n textAlign: 'center',\n },\n };\n};\n\nconst DialogTitle = (props: DialogTitleProps) => {\n const {\n children,\n style: styleProp,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const sectionStyle = useDialogSectionStyle();\n\n const rootStyle = css([\n styles.root,\n sectionStyle,\n styleProp,\n ]);\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.header3.semiBold,\n color: theme.palette.text.strong,\n });\n\n const titleStyle = css([\n styles.title,\n titleFontStyle,\n ]);\n\n return (\n <View\n {...otherProps}\n style={rootStyle}\n >\n {typeof children === 'string' ? (\n <Text style={titleStyle}>\n {children}\n </Text>\n ) : (children)}\n </View>\n );\n};\n\nDialogTitle.Large = DialogLargeTitle;\n\nexport default DialogTitle;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAKA,MAAMA,SAAuC,GAAG,YAA+B;EAC3E,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAEH,KAAK,CAACI,OAAN,CAAc,GAAd;IADV,CADH;IAIHC,KAAK,EAAE;MACHC,SAAS,EAAE;IADR;EAJJ,CAAP;AAQH,CAXD;;AAaA,MAAMC,WAAW,GAAIC,KAAD,IAA6B;EAC7C,MAAM;IACFC,QADE;IAEFC,KAAK,EAAEC,SAFL;IAGF,GAAGC;EAHD,IAIFJ,KAJJ;EAMA,MAAMR,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAMY,MAAM,GAAGd,SAAS,EAAxB;EAEA,MAAMe,YAAY,GAAG,IAAAC,6BAAA,GAArB;EAEA,MAAMC,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBJ,MAAM,CAACX,IADW,EAElBY,YAFkB,EAGlBH,SAHkB,CAAJ,CAAlB;EAMA,MAAMO,cAAc,GAAG,IAAAC,uBAAA,EAAgBnB,KAAhB,EAAuB;IAC1CoB,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,OAAX,CAAmBC,QADH;IAE1CC,KAAK,EAAExB,KAAK,CAACyB,OAAN,CAAcC,IAAd,CAAmBC;EAFgB,CAAvB,CAAvB;EAKA,MAAMC,UAAU,GAAG,IAAAX,WAAA,EAAI,CACnBJ,MAAM,CAACR,KADY,EAEnBa,cAFmB,CAAJ,CAAnB;EAKA,oBACI,6BAAC,iBAAD,eACQN,UADR;IAEI,KAAK,EAAEI;EAFX,IAIK,OAAOP,QAAP,KAAoB,QAApB,gBACG,6BAAC,iBAAD;IAAM,KAAK,EAAEmB;EAAb,GACKnB,QADL,CADH,GAIIA,QART,CADJ;AAYH,CAzCD;;AA2CAF,WAAW,CAACsB,KAAZ,GAAoBC,yBAApB;eAEevB,W"}
@@ -9,13 +9,15 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _reactNative = require("react-native");
11
11
 
12
- var _styles = require("../styles");
12
+ var _styles = require("@fountain-ui/styles");
13
+
14
+ var _styles2 = require("../styles");
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
18
  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); }
17
19
 
18
- const styles = _styles.StyleSheet.create({
20
+ const styles = _styles2.StyleSheet.create({
19
21
  container: {
20
22
  alignSelf: 'stretch',
21
23
  alignItems: 'center'
@@ -39,6 +41,12 @@ function selectBorderColor(theme, variant, vertical) {
39
41
 
40
42
  case 'strong':
41
43
  return vertical ? theme.palette.border.weak : theme.palette.border.base;
44
+
45
+ case 'strongStatic':
46
+ return _styles.commonColors.opacity.white['13'];
47
+
48
+ case 'baseStatic':
49
+ return _styles.commonColors.opacity.white['10'];
42
50
  }
43
51
  }
44
52
 
@@ -54,7 +62,7 @@ function Divider(props) {
54
62
  vertical = false,
55
63
  ...otherProps
56
64
  } = props;
57
- const theme = (0, _styles.useTheme)();
65
+ const theme = (0, _styles2.useTheme)();
58
66
  const borderWidth = borderWidthProp ?? (vertical ? 1 : 0.5);
59
67
  const fontColor = theme.palette.text.weak;
60
68
  const borderColor = selectBorderColor(theme, variant, vertical);
@@ -86,8 +94,8 @@ function Divider(props) {
86
94
  } : {
87
95
  borderBottomWidth: borderWidth
88
96
  };
89
- const containerStyle = (0, _styles.css)([insetStyle, marginStyle, styles.container, vertical ? styles.column : styles.row, childrenProp ? undefined : borderColorStyle, childrenProp ? undefined : borderWidthStyle, style]);
90
- const dividerStyle = (0, _styles.css)([borderColorStyle, borderWidthStyle, styles.divider]);
97
+ const containerStyle = (0, _styles2.css)([insetStyle, marginStyle, styles.container, vertical ? styles.column : styles.row, childrenProp ? undefined : borderColorStyle, childrenProp ? undefined : borderWidthStyle, style]);
98
+ const dividerStyle = (0, _styles2.css)([borderColorStyle, borderWidthStyle, styles.divider]);
91
99
  const dividerMarginSize = theme.spacing(marginBetweenChildren);
92
100
  const startDividerStyle = {
93
101
  display: elementAlign !== 'start' ? 'flex' : 'none',
@@ -105,17 +113,17 @@ function Divider(props) {
105
113
  marginLeft: dividerMarginSize
106
114
  })
107
115
  };
108
- const fontStyle = (0, _styles.createFontStyle)(theme, {
116
+ const fontStyle = (0, _styles2.createFontStyle)(theme, {
109
117
  selector: typo => typo.caption2.medium,
110
118
  color: fontColor
111
119
  });
112
120
  const element = typeof childrenProp === 'string' ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
113
- style: (0, _styles.css)(fontStyle)
121
+ style: (0, _styles2.css)(fontStyle)
114
122
  }, childrenProp) : childrenProp;
115
123
  const children = childrenProp ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
116
- style: (0, _styles.css)([dividerStyle, startDividerStyle])
124
+ style: (0, _styles2.css)([dividerStyle, startDividerStyle])
117
125
  }), element, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
118
- style: (0, _styles.css)([dividerStyle, endDividerStyle])
126
+ style: (0, _styles2.css)([dividerStyle, endDividerStyle])
119
127
  })) : null;
120
128
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
121
129
  style: containerStyle