@fountain-ui/core 3.0.0-alpha.1 → 3.0.0-alpha.11

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 (455) hide show
  1. package/build/commonjs/Accordion/Accordion.js +4 -1
  2. package/build/commonjs/Accordion/Accordion.js.map +1 -1
  3. package/build/commonjs/Accordion/index.js +8 -0
  4. package/build/commonjs/Accordion/index.js.map +1 -1
  5. package/build/commonjs/Accordion/useVariantStyleMap.js +11 -10
  6. package/build/commonjs/Accordion/useVariantStyleMap.js.map +1 -1
  7. package/build/commonjs/AppBar/AppBar.js +6 -1
  8. package/build/commonjs/AppBar/AppBar.js.map +1 -1
  9. package/build/commonjs/AppBar/index.js +8 -0
  10. package/build/commonjs/AppBar/index.js.map +1 -1
  11. package/build/commonjs/Badge/index.js +26 -0
  12. package/build/commonjs/Badge/index.js.map +1 -1
  13. package/build/commonjs/Badge/useVariantStyleMap.js +2 -2
  14. package/build/commonjs/Badge/useVariantStyleMap.js.map +1 -1
  15. package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js +1 -0
  16. package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
  17. package/build/commonjs/Button/Button.js +15 -3
  18. package/build/commonjs/Button/Button.js.map +1 -1
  19. package/build/commonjs/Button/ButtonProps.js +7 -7
  20. package/build/commonjs/Button/ButtonProps.js.map +1 -1
  21. package/build/commonjs/Button/index.js +20 -0
  22. package/build/commonjs/Button/index.js.map +1 -1
  23. package/build/commonjs/Button/useVariantStyleMap.js +5 -7
  24. package/build/commonjs/Button/useVariantStyleMap.js.map +1 -1
  25. package/build/commonjs/ButtonBase/index.js +2 -2
  26. package/build/commonjs/ButtonBase/index.js.map +1 -1
  27. package/build/commonjs/Checkbox/Checkbox.js +5 -2
  28. package/build/commonjs/Checkbox/Checkbox.js.map +1 -1
  29. package/build/commonjs/Checkbox/index.js +8 -0
  30. package/build/commonjs/Checkbox/index.js.map +1 -1
  31. package/build/commonjs/Checkbox/useVariantStyleMap.js +6 -2
  32. package/build/commonjs/Checkbox/useVariantStyleMap.js.map +1 -1
  33. package/build/commonjs/Chip/Chip.js +21 -14
  34. package/build/commonjs/Chip/Chip.js.map +1 -1
  35. package/build/commonjs/Chip/ChipProps.js +3 -1
  36. package/build/commonjs/Chip/ChipProps.js.map +1 -1
  37. package/build/commonjs/Chip/index.js +20 -0
  38. package/build/commonjs/Chip/index.js.map +1 -1
  39. package/build/commonjs/Chip/useChipStyle.js +31 -37
  40. package/build/commonjs/Chip/useChipStyle.js.map +1 -1
  41. package/build/commonjs/Dialog/Dialog.js +7 -8
  42. package/build/commonjs/Dialog/Dialog.js.map +1 -1
  43. package/build/commonjs/Dialog/DialogProps.js +1 -1
  44. package/build/commonjs/Dialog/DialogProps.js.map +1 -1
  45. package/build/commonjs/Dialog/index.js +8 -0
  46. package/build/commonjs/Dialog/index.js.map +1 -1
  47. package/build/commonjs/Dialog/useDialogSectionStyle.js +5 -5
  48. package/build/commonjs/Dialog/useDialogSectionStyle.js.map +1 -1
  49. package/build/commonjs/Dialog/useDialogStyle.js +9 -8
  50. package/build/commonjs/Dialog/useDialogStyle.js.map +1 -1
  51. package/build/commonjs/DialogContent/DialogContent.js +1 -2
  52. package/build/commonjs/DialogContent/DialogContent.js.map +1 -1
  53. package/build/commonjs/DialogTitle/BackButton.js +47 -0
  54. package/build/commonjs/DialogTitle/BackButton.js.map +1 -0
  55. package/build/commonjs/DialogTitle/CloseButton.js +45 -0
  56. package/build/commonjs/DialogTitle/CloseButton.js.map +1 -0
  57. package/build/commonjs/DialogTitle/DialogTitle.js +11 -4
  58. package/build/commonjs/DialogTitle/DialogTitle.js.map +1 -1
  59. package/build/commonjs/Divider/Divider.js +18 -10
  60. package/build/commonjs/Divider/Divider.js.map +1 -1
  61. package/build/commonjs/Divider/DividerProps.js +4 -4
  62. package/build/commonjs/Divider/DividerProps.js.map +1 -1
  63. package/build/commonjs/Divider/index.js +14 -0
  64. package/build/commonjs/Divider/index.js.map +1 -1
  65. package/build/commonjs/Empty/Empty.js +1 -2
  66. package/build/commonjs/Empty/Empty.js.map +1 -1
  67. package/build/commonjs/Flexbox/Flexbox.js +2 -0
  68. package/build/commonjs/Flexbox/Flexbox.js.map +1 -1
  69. package/build/commonjs/Flexbox/FlexboxProps.js.map +1 -1
  70. package/build/commonjs/IconButton/index.js +8 -0
  71. package/build/commonjs/IconButton/index.js.map +1 -1
  72. package/build/commonjs/ListItem/ListItem.js +47 -25
  73. package/build/commonjs/ListItem/ListItem.js.map +1 -1
  74. package/build/commonjs/ListItem/ListItemProps.js.map +1 -1
  75. package/build/commonjs/ListItemIcon/ListItemIcon.js +1 -2
  76. package/build/commonjs/ListItemIcon/ListItemIcon.js.map +1 -1
  77. package/build/commonjs/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
  78. package/build/commonjs/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
  79. package/build/commonjs/ListItemText/ListItemText.js +20 -21
  80. package/build/commonjs/ListItemText/ListItemText.js.map +1 -1
  81. package/build/commonjs/ListItemText/ListItemTextProps.js.map +1 -1
  82. package/build/commonjs/ListSubheader/ListSubheader.js +1 -1
  83. package/build/commonjs/ListSubheader/ListSubheader.js.map +1 -1
  84. package/build/commonjs/Pagination/NumberPagination.js +1 -1
  85. package/build/commonjs/Pagination/NumberPagination.js.map +1 -1
  86. package/build/commonjs/Pagination/Pagination.js +2 -0
  87. package/build/commonjs/Pagination/Pagination.js.map +1 -1
  88. package/build/commonjs/Pagination/PaginationProps.js +3 -1
  89. package/build/commonjs/Pagination/PaginationProps.js.map +1 -1
  90. package/build/commonjs/Pagination/index.js +14 -0
  91. package/build/commonjs/Pagination/index.js.map +1 -1
  92. package/build/commonjs/PaginationItem/PaginationItem.js +32 -22
  93. package/build/commonjs/PaginationItem/PaginationItem.js.map +1 -1
  94. package/build/commonjs/PaginationItem/PaginationItemProps.js.map +1 -1
  95. package/build/commonjs/Radio/Radio.js +6 -2
  96. package/build/commonjs/Radio/Radio.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/Snackbar/index.js +8 -0
  106. package/build/commonjs/Snackbar/index.js.map +1 -1
  107. package/build/commonjs/SnackbarContent/SnackbarContent.js +27 -12
  108. package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
  109. package/build/commonjs/SvgIcon/index.js +14 -0
  110. package/build/commonjs/SvgIcon/index.js.map +1 -1
  111. package/build/commonjs/Tab/useVariantStyleMap.js +3 -3
  112. package/build/commonjs/Tab/useVariantStyleMap.js.map +1 -1
  113. package/build/commonjs/Tabs/Tabs.js +6 -1
  114. package/build/commonjs/Tabs/Tabs.js.map +1 -1
  115. package/build/commonjs/Tabs/index.js +14 -0
  116. package/build/commonjs/Tabs/index.js.map +1 -1
  117. package/build/commonjs/Tabs/useTabsStyle.js +42 -0
  118. package/build/commonjs/Tabs/useTabsStyle.js.map +1 -0
  119. package/build/commonjs/TextField/TextField.js +1 -1
  120. package/build/commonjs/TextField/TextField.js.map +1 -1
  121. package/build/commonjs/TextField/index.js +8 -0
  122. package/build/commonjs/TextField/index.js.map +1 -1
  123. package/build/commonjs/TextField/useVariantStyleMap.js +2 -2
  124. package/build/commonjs/TextField/useVariantStyleMap.js.map +1 -1
  125. package/build/commonjs/Toolbar/BackButton/BackButton.js +47 -0
  126. package/build/commonjs/Toolbar/BackButton/BackButton.js.map +1 -0
  127. package/build/commonjs/Toolbar/BackButton/BackButtonProps.js +2 -0
  128. package/build/commonjs/Toolbar/BackButton/BackButtonProps.js.map +1 -0
  129. package/build/commonjs/Toolbar/BackButton/index.js +16 -0
  130. package/build/commonjs/Toolbar/BackButton/index.js.map +1 -0
  131. package/build/commonjs/Toolbar/Toolbar.js +8 -4
  132. package/build/commonjs/Toolbar/Toolbar.js.map +1 -1
  133. package/build/commonjs/Toolbar/index.js +8 -0
  134. package/build/commonjs/Toolbar/index.js.map +1 -1
  135. package/build/commonjs/Tooltip/Beaks/index.js +32 -0
  136. package/build/commonjs/Tooltip/Beaks/index.js.map +1 -1
  137. package/build/commonjs/Tooltip/Tooltip.js +11 -24
  138. package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
  139. package/build/commonjs/Tooltip/index.js +39 -0
  140. package/build/commonjs/Tooltip/index.js.map +1 -1
  141. package/build/commonjs/Typography/Typography.js +9 -2
  142. package/build/commonjs/Typography/Typography.js.map +1 -1
  143. package/build/commonjs/Typography/TypographyProps.js.map +1 -1
  144. package/build/commonjs/Typography/index.js +8 -0
  145. package/build/commonjs/Typography/index.js.map +1 -1
  146. package/build/commonjs/hooks/useBreakpointUp.js +4 -1
  147. package/build/commonjs/hooks/useBreakpointUp.js.map +1 -1
  148. package/build/commonjs/hooks/useContentContainerStyle.js +21 -28
  149. package/build/commonjs/hooks/useContentContainerStyle.js.map +1 -1
  150. package/build/commonjs/index.js +21 -0
  151. package/build/commonjs/index.js.map +1 -1
  152. package/build/commonjs/internal/icons/ChevronLeft.js +4 -2
  153. package/build/commonjs/internal/icons/ChevronLeft.js.map +1 -1
  154. package/build/commonjs/internal/icons/ChevronRight.js +4 -2
  155. package/build/commonjs/internal/icons/ChevronRight.js.map +1 -1
  156. package/build/commonjs/internal/icons/Close.js +4 -2
  157. package/build/commonjs/internal/icons/Close.js.map +1 -1
  158. package/build/module/Accordion/Accordion.js +4 -1
  159. package/build/module/Accordion/Accordion.js.map +1 -1
  160. package/build/module/Accordion/index.js +1 -0
  161. package/build/module/Accordion/index.js.map +1 -1
  162. package/build/module/Accordion/useVariantStyleMap.js +11 -10
  163. package/build/module/Accordion/useVariantStyleMap.js.map +1 -1
  164. package/build/module/AppBar/AppBar.js +5 -1
  165. package/build/module/AppBar/AppBar.js.map +1 -1
  166. package/build/module/AppBar/index.js +1 -0
  167. package/build/module/AppBar/index.js.map +1 -1
  168. package/build/module/Badge/index.js +1 -0
  169. package/build/module/Badge/index.js.map +1 -1
  170. package/build/module/Badge/useVariantStyleMap.js +2 -2
  171. package/build/module/Badge/useVariantStyleMap.js.map +1 -1
  172. package/build/module/BottomSheetTitle/BottomSheetTitle.js +1 -0
  173. package/build/module/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
  174. package/build/module/Button/Button.js +16 -4
  175. package/build/module/Button/Button.js.map +1 -1
  176. package/build/module/Button/ButtonProps.js +3 -3
  177. package/build/module/Button/ButtonProps.js.map +1 -1
  178. package/build/module/Button/index.js +1 -0
  179. package/build/module/Button/index.js.map +1 -1
  180. package/build/module/Button/useVariantStyleMap.js +5 -7
  181. package/build/module/Button/useVariantStyleMap.js.map +1 -1
  182. package/build/module/ButtonBase/index.js +1 -1
  183. package/build/module/ButtonBase/index.js.map +1 -1
  184. package/build/module/Checkbox/Checkbox.js +5 -2
  185. package/build/module/Checkbox/Checkbox.js.map +1 -1
  186. package/build/module/Checkbox/index.js +1 -0
  187. package/build/module/Checkbox/index.js.map +1 -1
  188. package/build/module/Checkbox/useVariantStyleMap.js +6 -2
  189. package/build/module/Checkbox/useVariantStyleMap.js.map +1 -1
  190. package/build/module/Chip/Chip.js +17 -13
  191. package/build/module/Chip/Chip.js.map +1 -1
  192. package/build/module/Chip/ChipProps.js +1 -0
  193. package/build/module/Chip/ChipProps.js.map +1 -1
  194. package/build/module/Chip/index.js +1 -0
  195. package/build/module/Chip/index.js.map +1 -1
  196. package/build/module/Chip/useChipStyle.js +31 -36
  197. package/build/module/Chip/useChipStyle.js.map +1 -1
  198. package/build/module/Dialog/Dialog.js +7 -8
  199. package/build/module/Dialog/Dialog.js.map +1 -1
  200. package/build/module/Dialog/DialogProps.js +1 -1
  201. package/build/module/Dialog/DialogProps.js.map +1 -1
  202. package/build/module/Dialog/index.js +1 -0
  203. package/build/module/Dialog/index.js.map +1 -1
  204. package/build/module/Dialog/useDialogSectionStyle.js +5 -5
  205. package/build/module/Dialog/useDialogSectionStyle.js.map +1 -1
  206. package/build/module/Dialog/useDialogStyle.js +9 -8
  207. package/build/module/Dialog/useDialogStyle.js.map +1 -1
  208. package/build/module/DialogContent/DialogContent.js +1 -2
  209. package/build/module/DialogContent/DialogContent.js.map +1 -1
  210. package/build/module/DialogTitle/BackButton.js +32 -0
  211. package/build/module/DialogTitle/BackButton.js.map +1 -0
  212. package/build/module/DialogTitle/CloseButton.js +30 -0
  213. package/build/module/DialogTitle/CloseButton.js.map +1 -0
  214. package/build/module/DialogTitle/DialogTitle.js +8 -3
  215. package/build/module/DialogTitle/DialogTitle.js.map +1 -1
  216. package/build/module/Divider/Divider.js +8 -1
  217. package/build/module/Divider/Divider.js.map +1 -1
  218. package/build/module/Divider/DividerProps.js +2 -2
  219. package/build/module/Divider/DividerProps.js.map +1 -1
  220. package/build/module/Divider/index.js +1 -0
  221. package/build/module/Divider/index.js.map +1 -1
  222. package/build/module/Empty/Empty.js +1 -2
  223. package/build/module/Empty/Empty.js.map +1 -1
  224. package/build/module/Flexbox/Flexbox.js +2 -0
  225. package/build/module/Flexbox/Flexbox.js.map +1 -1
  226. package/build/module/Flexbox/FlexboxProps.js.map +1 -1
  227. package/build/module/IconButton/index.js +1 -0
  228. package/build/module/IconButton/index.js.map +1 -1
  229. package/build/module/ListItem/ListItem.js +45 -27
  230. package/build/module/ListItem/ListItem.js.map +1 -1
  231. package/build/module/ListItem/ListItemProps.js.map +1 -1
  232. package/build/module/ListItemIcon/ListItemIcon.js +1 -2
  233. package/build/module/ListItemIcon/ListItemIcon.js.map +1 -1
  234. package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
  235. package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
  236. package/build/module/ListItemText/ListItemText.js +17 -19
  237. package/build/module/ListItemText/ListItemText.js.map +1 -1
  238. package/build/module/ListItemText/ListItemTextProps.js.map +1 -1
  239. package/build/module/ListSubheader/ListSubheader.js +1 -1
  240. package/build/module/ListSubheader/ListSubheader.js.map +1 -1
  241. package/build/module/Pagination/NumberPagination.js +1 -1
  242. package/build/module/Pagination/NumberPagination.js.map +1 -1
  243. package/build/module/Pagination/Pagination.js +2 -0
  244. package/build/module/Pagination/Pagination.js.map +1 -1
  245. package/build/module/Pagination/PaginationProps.js +1 -0
  246. package/build/module/Pagination/PaginationProps.js.map +1 -1
  247. package/build/module/Pagination/index.js +1 -0
  248. package/build/module/Pagination/index.js.map +1 -1
  249. package/build/module/PaginationItem/PaginationItem.js +28 -21
  250. package/build/module/PaginationItem/PaginationItem.js.map +1 -1
  251. package/build/module/PaginationItem/PaginationItemProps.js.map +1 -1
  252. package/build/module/Radio/Radio.js +5 -2
  253. package/build/module/Radio/Radio.js.map +1 -1
  254. package/build/module/Section/Section.js +19 -0
  255. package/build/module/Section/Section.js.map +1 -0
  256. package/build/module/Section/SectionProps.js +2 -0
  257. package/build/module/Section/SectionProps.js.map +1 -0
  258. package/build/module/Section/index.js +2 -0
  259. package/build/module/Section/index.js.map +1 -0
  260. package/build/module/ShadowView/ShadowView.native.js +4 -0
  261. package/build/module/ShadowView/ShadowView.native.js.map +1 -1
  262. package/build/module/Snackbar/index.js +1 -0
  263. package/build/module/Snackbar/index.js.map +1 -1
  264. package/build/module/SnackbarContent/SnackbarContent.js +27 -12
  265. package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
  266. package/build/module/SvgIcon/index.js +1 -0
  267. package/build/module/SvgIcon/index.js.map +1 -1
  268. package/build/module/Tab/useVariantStyleMap.js +3 -3
  269. package/build/module/Tab/useVariantStyleMap.js.map +1 -1
  270. package/build/module/Tabs/Tabs.js +5 -1
  271. package/build/module/Tabs/Tabs.js.map +1 -1
  272. package/build/module/Tabs/index.js +1 -0
  273. package/build/module/Tabs/index.js.map +1 -1
  274. package/build/module/Tabs/useTabsStyle.js +32 -0
  275. package/build/module/Tabs/useTabsStyle.js.map +1 -0
  276. package/build/module/TextField/TextField.js +1 -1
  277. package/build/module/TextField/TextField.js.map +1 -1
  278. package/build/module/TextField/index.js +1 -0
  279. package/build/module/TextField/index.js.map +1 -1
  280. package/build/module/TextField/useVariantStyleMap.js +2 -2
  281. package/build/module/TextField/useVariantStyleMap.js.map +1 -1
  282. package/build/module/Toolbar/BackButton/BackButton.js +32 -0
  283. package/build/module/Toolbar/BackButton/BackButton.js.map +1 -0
  284. package/build/module/Toolbar/BackButton/BackButtonProps.js +2 -0
  285. package/build/module/Toolbar/BackButton/BackButtonProps.js.map +1 -0
  286. package/build/module/Toolbar/BackButton/index.js +2 -0
  287. package/build/module/Toolbar/BackButton/index.js.map +1 -0
  288. package/build/module/Toolbar/Toolbar.js +7 -3
  289. package/build/module/Toolbar/Toolbar.js.map +1 -1
  290. package/build/module/Toolbar/index.js +1 -0
  291. package/build/module/Toolbar/index.js.map +1 -1
  292. package/build/module/Tooltip/Beaks/index.js +4 -0
  293. package/build/module/Tooltip/Beaks/index.js.map +1 -1
  294. package/build/module/Tooltip/Tooltip.js +4 -16
  295. package/build/module/Tooltip/Tooltip.js.map +1 -1
  296. package/build/module/Tooltip/index.js +2 -0
  297. package/build/module/Tooltip/index.js.map +1 -1
  298. package/build/module/Typography/Typography.js +9 -2
  299. package/build/module/Typography/Typography.js.map +1 -1
  300. package/build/module/Typography/TypographyProps.js.map +1 -1
  301. package/build/module/Typography/index.js +1 -0
  302. package/build/module/Typography/index.js.map +1 -1
  303. package/build/module/hooks/useBreakpointUp.js +4 -1
  304. package/build/module/hooks/useBreakpointUp.js.map +1 -1
  305. package/build/module/hooks/useContentContainerStyle.js +23 -26
  306. package/build/module/hooks/useContentContainerStyle.js.map +1 -1
  307. package/build/module/index.js +2 -0
  308. package/build/module/index.js.map +1 -1
  309. package/build/module/internal/icons/ChevronLeft.js +4 -2
  310. package/build/module/internal/icons/ChevronLeft.js.map +1 -1
  311. package/build/module/internal/icons/ChevronRight.js +4 -2
  312. package/build/module/internal/icons/ChevronRight.js.map +1 -1
  313. package/build/module/internal/icons/Close.js +4 -2
  314. package/build/module/internal/icons/Close.js.map +1 -1
  315. package/build/typescript/Accordion/index.d.ts +1 -0
  316. package/build/typescript/Accordion/useVariantStyleMap.d.ts +1 -0
  317. package/build/typescript/AppBar/index.d.ts +1 -0
  318. package/build/typescript/Badge/index.d.ts +2 -1
  319. package/build/typescript/Button/ButtonProps.d.ts +11 -6
  320. package/build/typescript/Button/index.d.ts +1 -0
  321. package/build/typescript/ButtonBase/index.d.ts +1 -1
  322. package/build/typescript/Checkbox/index.d.ts +1 -0
  323. package/build/typescript/Checkbox/useVariantStyleMap.d.ts +1 -0
  324. package/build/typescript/Chip/ChipProps.d.ts +11 -4
  325. package/build/typescript/Chip/index.d.ts +1 -0
  326. package/build/typescript/Chip/useChipStyle.d.ts +4 -3
  327. package/build/typescript/Dialog/DialogProps.d.ts +1 -6
  328. package/build/typescript/Dialog/index.d.ts +1 -0
  329. package/build/typescript/Dialog/useDialogStyle.d.ts +1 -1
  330. package/build/typescript/DialogTitle/BackButton.d.ts +6 -0
  331. package/build/typescript/DialogTitle/CloseButton.d.ts +6 -0
  332. package/build/typescript/DialogTitle/DialogTitle.d.ts +8 -1
  333. package/build/typescript/Divider/DividerProps.d.ts +4 -4
  334. package/build/typescript/Divider/index.d.ts +1 -0
  335. package/build/typescript/Flexbox/FlexboxProps.d.ts +4 -0
  336. package/build/typescript/IconButton/index.d.ts +1 -0
  337. package/build/typescript/ListItem/ListItem.d.ts +1 -1
  338. package/build/typescript/ListItem/ListItemProps.d.ts +4 -0
  339. package/build/typescript/ListItemText/ListItemTextProps.d.ts +2 -9
  340. package/build/typescript/Pagination/PaginationProps.d.ts +12 -0
  341. package/build/typescript/Pagination/index.d.ts +2 -1
  342. package/build/typescript/PaginationItem/PaginationItemProps.d.ts +6 -0
  343. package/build/typescript/Section/Section.d.ts +3 -0
  344. package/build/typescript/Section/SectionProps.d.ts +6 -0
  345. package/build/typescript/Section/index.d.ts +2 -0
  346. package/build/typescript/Snackbar/index.d.ts +1 -0
  347. package/build/typescript/SvgIcon/index.d.ts +1 -0
  348. package/build/typescript/Tabs/index.d.ts +1 -0
  349. package/build/typescript/Tabs/useTabsStyle.d.ts +7 -0
  350. package/build/typescript/TextField/index.d.ts +1 -0
  351. package/build/typescript/Toolbar/BackButton/BackButton.d.ts +3 -0
  352. package/build/typescript/Toolbar/BackButton/BackButtonProps.d.ts +4 -0
  353. package/build/typescript/Toolbar/BackButton/index.d.ts +2 -0
  354. package/build/typescript/Toolbar/Toolbar.d.ts +6 -1
  355. package/build/typescript/Toolbar/index.d.ts +1 -0
  356. package/build/typescript/Tooltip/Beaks/index.d.ts +4 -0
  357. package/build/typescript/Tooltip/index.d.ts +3 -1
  358. package/build/typescript/Typography/TypographyProps.d.ts +4 -0
  359. package/build/typescript/Typography/index.d.ts +1 -0
  360. package/build/typescript/hooks/useContentContainerStyle.d.ts +4 -8
  361. package/build/typescript/index.d.ts +2 -0
  362. package/package.json +3 -3
  363. package/src/Accordion/Accordion.tsx +4 -1
  364. package/src/Accordion/index.ts +1 -0
  365. package/src/Accordion/useVariantStyleMap.ts +12 -10
  366. package/src/AppBar/AppBar.tsx +4 -0
  367. package/src/AppBar/index.ts +1 -0
  368. package/src/Badge/index.ts +12 -1
  369. package/src/Badge/useVariantStyleMap.ts +2 -2
  370. package/src/BottomSheetTitle/BottomSheetTitle.tsx +1 -0
  371. package/src/Button/Button.tsx +19 -4
  372. package/src/Button/ButtonProps.ts +12 -6
  373. package/src/Button/index.ts +1 -0
  374. package/src/Button/useVariantStyleMap.ts +3 -7
  375. package/src/ButtonBase/index.ts +1 -1
  376. package/src/Checkbox/Checkbox.tsx +12 -9
  377. package/src/Checkbox/index.ts +1 -0
  378. package/src/Checkbox/useVariantStyleMap.ts +6 -1
  379. package/src/Chip/Chip.tsx +20 -13
  380. package/src/Chip/ChipProps.ts +13 -4
  381. package/src/Chip/index.ts +1 -0
  382. package/src/Chip/useChipStyle.ts +36 -34
  383. package/src/Dialog/Dialog.tsx +7 -8
  384. package/src/Dialog/DialogProps.ts +1 -7
  385. package/src/Dialog/index.ts +1 -0
  386. package/src/Dialog/useDialogSectionStyle.ts +4 -4
  387. package/src/Dialog/useDialogStyle.ts +9 -7
  388. package/src/DialogContent/DialogContent.tsx +1 -2
  389. package/src/DialogTitle/BackButton.tsx +44 -0
  390. package/src/DialogTitle/CloseButton.tsx +42 -0
  391. package/src/DialogTitle/DialogTitle.tsx +9 -1
  392. package/src/Divider/Divider.tsx +6 -1
  393. package/src/Divider/DividerProps.ts +4 -4
  394. package/src/Divider/index.ts +1 -0
  395. package/src/Empty/Empty.tsx +1 -2
  396. package/src/Flexbox/Flexbox.tsx +2 -0
  397. package/src/Flexbox/FlexboxProps.ts +5 -0
  398. package/src/IconButton/index.ts +1 -0
  399. package/src/ListItem/ListItem.tsx +69 -28
  400. package/src/ListItem/ListItemProps.ts +5 -0
  401. package/src/ListItemIcon/ListItemIcon.tsx +1 -2
  402. package/src/ListItemSecondaryAction/ListItemSecondaryAction.tsx +2 -0
  403. package/src/ListItemText/ListItemText.tsx +20 -28
  404. package/src/ListItemText/ListItemTextProps.ts +2 -10
  405. package/src/ListSubheader/ListSubheader.tsx +1 -1
  406. package/src/Pagination/NumberPagination.tsx +1 -1
  407. package/src/Pagination/Pagination.tsx +3 -2
  408. package/src/Pagination/PaginationProps.ts +15 -0
  409. package/src/Pagination/index.ts +2 -1
  410. package/src/PaginationItem/PaginationItem.tsx +31 -24
  411. package/src/PaginationItem/PaginationItemProps.ts +7 -0
  412. package/src/Radio/Radio.tsx +8 -2
  413. package/src/Section/Section.tsx +26 -0
  414. package/src/Section/SectionProps.ts +6 -0
  415. package/src/Section/index.ts +2 -0
  416. package/src/ShadowView/ShadowView.native.tsx +4 -0
  417. package/src/Snackbar/index.ts +1 -0
  418. package/src/SnackbarContent/SnackbarContent.tsx +37 -18
  419. package/src/SvgIcon/index.ts +1 -0
  420. package/src/Tab/useVariantStyleMap.ts +3 -3
  421. package/src/Tabs/Tabs.tsx +4 -0
  422. package/src/Tabs/index.ts +1 -0
  423. package/src/Tabs/useTabsStyle.ts +38 -0
  424. package/src/TextField/TextField.tsx +1 -1
  425. package/src/TextField/index.tsx +1 -0
  426. package/src/TextField/useVariantStyleMap.ts +2 -2
  427. package/src/Toolbar/BackButton/BackButton.tsx +42 -0
  428. package/src/Toolbar/BackButton/BackButtonProps.ts +4 -0
  429. package/src/Toolbar/BackButton/index.ts +2 -0
  430. package/src/Toolbar/Toolbar.tsx +6 -1
  431. package/src/Toolbar/index.ts +1 -0
  432. package/src/Tooltip/Beaks/index.ts +4 -0
  433. package/src/Tooltip/Tooltip.tsx +5 -16
  434. package/src/Tooltip/index.ts +3 -1
  435. package/src/Typography/Typography.tsx +3 -1
  436. package/src/Typography/TypographyProps.ts +5 -0
  437. package/src/Typography/index.ts +1 -0
  438. package/src/hooks/useBreakpointUp.ts +3 -1
  439. package/src/hooks/useContentContainerStyle.ts +26 -34
  440. package/src/index.ts +3 -0
  441. package/src/internal/icons/ChevronLeft.tsx +4 -1
  442. package/src/internal/icons/ChevronRight.tsx +4 -1
  443. package/src/internal/icons/Close.tsx +4 -1
  444. package/build/commonjs/ButtonBase/LegacyButtonBase.js +0 -126
  445. package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +0 -1
  446. package/build/commonjs/TextField/InputLabel.js +0 -163
  447. package/build/commonjs/TextField/InputLabel.js.map +0 -1
  448. package/build/module/ButtonBase/LegacyButtonBase.js +0 -106
  449. package/build/module/ButtonBase/LegacyButtonBase.js.map +0 -1
  450. package/build/module/TextField/InputLabel.js +0 -149
  451. package/build/module/TextField/InputLabel.js.map +0 -1
  452. package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +0 -5
  453. package/build/typescript/TextField/InputLabel.d.ts +0 -33
  454. package/src/ButtonBase/LegacyButtonBase.tsx +0 -135
  455. package/src/TextField/InputLabel.tsx +0 -234
@@ -19,13 +19,14 @@ export default function Checkbox(props) {
19
19
  } = props;
20
20
  const theme = useTheme();
21
21
  const {
22
+ checkboxContainerStyle,
22
23
  checkboxStyle,
23
24
  containerStyle,
24
25
  iconColor
25
26
  } = useVariantStyleMap(variant, checked);
26
27
  const rootStyle = css([children ? containerStyle : undefined, styleProp]);
27
28
  const fontStyle = createFontStyle(theme, {
28
- // TODO: apply typo select.
29
+ selector: typography => typography.body2.regular,
29
30
  color: theme.palette.text.strong
30
31
  });
31
32
 
@@ -40,12 +41,14 @@ export default function Checkbox(props) {
40
41
  onPress: handlePress,
41
42
  style: rootStyle
42
43
  }, otherProps), /*#__PURE__*/React.createElement(View, {
44
+ style: checkboxContainerStyle
45
+ }, /*#__PURE__*/React.createElement(View, {
43
46
  style: checkboxStyle
44
47
  }, checked ? /*#__PURE__*/React.createElement(CheckboxOnIcon, {
45
48
  fill: iconColor,
46
49
  height: 7.5,
47
50
  width: 11
48
- }) : null), children ? /*#__PURE__*/React.createElement(Row, {
51
+ }) : null)), children ? /*#__PURE__*/React.createElement(Row, {
49
52
  flexGrow: 1,
50
53
  flexShrink: 1
51
54
  }, /*#__PURE__*/React.createElement(Text, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","ButtonBase","CheckboxOn","CheckboxOnIcon","Row","createFontStyle","css","useTheme","useVariantStyleMap","Checkbox","props","checked","children","disabled","onChange","style","styleProp","variant","otherProps","theme","checkboxStyle","containerStyle","iconColor","rootStyle","undefined","fontStyle","color","palette","text","strong","handlePress"],"sources":["Checkbox.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { CheckboxOn as CheckboxOnIcon } from '../internal/icons';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type CheckboxProps from './CheckboxProps';\nimport type { CheckboxVariant } from './CheckboxProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\nexport default function Checkbox(props: CheckboxProps) {\n const {\n checked = false,\n children,\n disabled = false,\n onChange,\n style: styleProp,\n variant = 'square' as CheckboxVariant,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const {\n checkboxStyle,\n containerStyle,\n iconColor,\n } = useVariantStyleMap(variant, checked);\n\n const rootStyle = css([\n children ? containerStyle : undefined,\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n // TODO: apply typo select.\n color: theme.palette.text.strong,\n });\n\n const handlePress = () => {\n if (onChange) {\n onChange(!checked);\n }\n };\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={rootStyle}\n {...otherProps}\n >\n <View style={checkboxStyle}>\n {checked ? (\n <CheckboxOnIcon\n fill={iconColor}\n height={7.5}\n width={11}\n />\n ) : null}\n </View>\n\n {children ? (\n <Row\n flexGrow={1}\n flexShrink={1}\n >\n <Text\n children={children}\n style={fontStyle}\n />\n </Row>\n ) : null}\n </ButtonBase>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SAASC,UAAU,IAAIC,cAAvB,QAA6C,mBAA7C;AACA,OAAOC,GAAP,MAAgB,QAAhB;AACA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,QAA/B,QAA+C,WAA/C;AAGA,OAAOC,kBAAP,MAA+B,sBAA/B;AAEA,eAAe,SAASC,QAAT,CAAkBC,KAAlB,EAAwC;EACnD,MAAM;IACFC,OAAO,GAAG,KADR;IAEFC,QAFE;IAGFC,QAAQ,GAAG,KAHT;IAIFC,QAJE;IAKFC,KAAK,EAAEC,SALL;IAMFC,OAAO,GAAG,QANR;IAOF,GAAGC;EAPD,IAQFR,KARJ;EAUA,MAAMS,KAAK,GAAGZ,QAAQ,EAAtB;EAEA,MAAM;IACFa,aADE;IAEFC,cAFE;IAGFC;EAHE,IAIFd,kBAAkB,CAACS,OAAD,EAAUN,OAAV,CAJtB;EAMA,MAAMY,SAAS,GAAGjB,GAAG,CAAC,CAClBM,QAAQ,GAAGS,cAAH,GAAoBG,SADV,EAElBR,SAFkB,CAAD,CAArB;EAKA,MAAMS,SAAS,GAAGpB,eAAe,CAACc,KAAD,EAAQ;IACrC;IACAO,KAAK,EAAEP,KAAK,CAACQ,OAAN,CAAcC,IAAd,CAAmBC;EAFW,CAAR,CAAjC;;EAKA,MAAMC,WAAW,GAAG,MAAM;IACtB,IAAIhB,QAAJ,EAAc;MACVA,QAAQ,CAAC,CAACH,OAAF,CAAR;IACH;EACJ,CAJD;;EAMA,oBACI,oBAAC,UAAD;IACI,QAAQ,EAAEE,QADd;IAEI,OAAO,EAAEiB,WAFb;IAGI,KAAK,EAAEP;EAHX,GAIQL,UAJR,gBAMI,oBAAC,IAAD;IAAM,KAAK,EAAEE;EAAb,GACKT,OAAO,gBACJ,oBAAC,cAAD;IACI,IAAI,EAAEW,SADV;IAEI,MAAM,EAAE,GAFZ;IAGI,KAAK,EAAE;EAHX,EADI,GAMJ,IAPR,CANJ,EAgBKV,QAAQ,gBACL,oBAAC,GAAD;IACI,QAAQ,EAAE,CADd;IAEI,UAAU,EAAE;EAFhB,gBAII,oBAAC,IAAD;IACI,QAAQ,EAAEA,QADd;IAEI,KAAK,EAAEa;EAFX,EAJJ,CADK,GAUL,IA1BR,CADJ;AA8BH;AAAA"}
1
+ {"version":3,"names":["React","Text","View","ButtonBase","CheckboxOn","CheckboxOnIcon","Row","createFontStyle","css","useTheme","useVariantStyleMap","Checkbox","props","checked","children","disabled","onChange","style","styleProp","variant","otherProps","theme","checkboxContainerStyle","checkboxStyle","containerStyle","iconColor","rootStyle","undefined","fontStyle","selector","typography","body2","regular","color","palette","text","strong","handlePress"],"sources":["Checkbox.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { CheckboxOn as CheckboxOnIcon } from '../internal/icons';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type CheckboxProps from './CheckboxProps';\nimport type { CheckboxVariant } from './CheckboxProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\nexport default function Checkbox(props: CheckboxProps) {\n const {\n checked = false,\n children,\n disabled = false,\n onChange,\n style: styleProp,\n variant = 'square' as CheckboxVariant,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const {\n checkboxContainerStyle,\n checkboxStyle,\n containerStyle,\n iconColor,\n } = useVariantStyleMap(variant, checked);\n\n const rootStyle = css([\n children ? containerStyle : undefined,\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typography) => typography.body2.regular,\n color: theme.palette.text.strong,\n });\n\n const handlePress = () => {\n if (onChange) {\n onChange(!checked);\n }\n };\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={rootStyle}\n {...otherProps}\n >\n <View style={checkboxContainerStyle}>\n <View style={checkboxStyle}>\n {checked ? (\n <CheckboxOnIcon\n fill={iconColor}\n height={7.5}\n width={11}\n />\n ) : null}\n </View>\n </View>\n\n {children ? (\n <Row\n flexGrow={1}\n flexShrink={1}\n >\n <Text\n children={children}\n style={fontStyle}\n />\n </Row>\n ) : null}\n </ButtonBase>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SAASC,UAAU,IAAIC,cAAvB,QAA6C,mBAA7C;AACA,OAAOC,GAAP,MAAgB,QAAhB;AACA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,QAA/B,QAA+C,WAA/C;AAGA,OAAOC,kBAAP,MAA+B,sBAA/B;AAEA,eAAe,SAASC,QAAT,CAAkBC,KAAlB,EAAwC;EACnD,MAAM;IACFC,OAAO,GAAG,KADR;IAEFC,QAFE;IAGFC,QAAQ,GA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,3 @@
1
1
  export { default } from './Checkbox';
2
+ export { checkboxVariants } from './CheckboxProps';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './Checkbox';\nexport type { default as CheckboxProps } from './CheckboxProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,YAAxB"}
1
+ {"version":3,"names":["default","checkboxVariants"],"sources":["index.ts"],"sourcesContent":["export { default } from './Checkbox';\nexport type { default as CheckboxProps } from './CheckboxProps';\nexport { checkboxVariants } from './CheckboxProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,YAAxB;AAEA,SAASC,gBAAT,QAAiC,iBAAjC"}
@@ -14,6 +14,10 @@ export default function useVariantStyleMap(variant, checked) {
14
14
  switch (variant) {
15
15
  case 'square':
16
16
  return {
17
+ checkboxContainerStyle: {
18
+ alignSelf: 'flex-start',
19
+ paddingTop: 3
20
+ },
17
21
  checkboxStyle: css([styles.checkbox, {
18
22
  borderColor: theme.palette.border.base,
19
23
  borderRadius: theme.shape.radius.xs,
@@ -25,9 +29,9 @@ export default function useVariantStyleMap(variant, checked) {
25
29
  } : {})
26
30
  }]),
27
31
  containerStyle: {
28
- alignItems: 'center',
29
32
  flexDirection: 'row',
30
- gap: theme.spacing(3)
33
+ gap: theme.spacing(3),
34
+ paddingVertical: theme.spacing(2)
31
35
  },
32
36
  iconColor: theme.palette.fill.baseAlt
33
37
  };
@@ -1 +1 @@
1
- {"version":3,"names":["StyleSheet","commonColors","css","useTheme","styles","create","checkbox","alignItems","borderWidth","justifyContent","useVariantStyleMap","variant","checked","theme","checkboxStyle","borderColor","palette","border","base","borderRadius","shape","radius","xs","height","width","backgroundColor","fill","containerStyle","flexDirection","gap","spacing","iconColor","baseAlt","full","accent","borderBottomColor","weak","borderBottomWidth","paddingVertical","static","strongInverse"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport { commonColors, FountainUiStyle } from '@fountain-ui/styles';\nimport { css, useTheme } from '../styles';\nimport type { CheckboxVariant } from './CheckboxProps';\n\nconst styles = StyleSheet.create({\n checkbox: {\n alignItems: 'center',\n borderWidth: 1,\n justifyContent: 'center',\n },\n});\n\ntype useVariantStyleMapReturns = {\n checkboxStyle?: FountainUiStyle;\n containerStyle?: FountainUiStyle;\n iconColor?: string;\n};\n\nexport default function useVariantStyleMap(variant: CheckboxVariant, checked: boolean): useVariantStyleMapReturns {\n const theme = useTheme();\n\n switch (variant) {\n case 'square':\n return {\n checkboxStyle: css([\n styles.checkbox,\n {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.xs,\n height: 18,\n width: 18,\n ...(checked ? {\n backgroundColor: theme.palette.fill.base,\n borderColor: theme.palette.fill.base,\n } : {}),\n },\n ]),\n containerStyle: {\n alignItems: 'center',\n flexDirection: 'row',\n gap: theme.spacing(3),\n },\n iconColor: theme.palette.fill.baseAlt,\n };\n case 'round':\n return {\n checkboxStyle: css([\n styles.checkbox,\n {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.full,\n height: 20,\n width: 20,\n ...(checked ? {\n backgroundColor: theme.palette.fill.accent,\n borderColor: theme.palette.fill.accent,\n } : {}),\n },\n ]),\n containerStyle: {\n alignItems: 'center',\n borderBottomColor: theme.palette.border.weak,\n borderBottomWidth: 0.5,\n flexDirection: 'row-reverse',\n gap: theme.spacing(8),\n paddingVertical: theme.spacing(3.5),\n },\n iconColor: commonColors.static.strongInverse,\n };\n default:\n return {};\n }\n}\n"],"mappings":"AAAA,SAASA,UAAT,QAA2B,cAA3B;AACA,SAASC,YAAT,QAA8C,qBAA9C;AACA,SAASC,GAAT,EAAcC,QAAd,QAA8B,WAA9B;AAGA,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAX,CAAkB;EAC7BC,QAAQ,EAAE;IACNC,UAAU,EAAE,QADN;IAENC,WAAW,EAAE,CAFP;IAGNC,cAAc,EAAE;EAHV;AADmB,CAAlB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G,OAAN,CAAcU,IAAd,CAAmBQ;UAFtB,CAAH,GAGP,EAHJ;QALJ,CAFe,CAAD,CADf;QAcHP,cAAc,EAAE;UACZpB,UAAU,EAAE,QADA;UAEZ4B,iBAAiB,EAAEtB,KAAK,CAACG,OAAN,CAAcC,MAAd,CAAqBmB,IAF5B;UAGZC,iBAAiB,EAAE,GAHP;UAIZT,aAAa,EAAE,aAJH;UAKZC,GAAG,EAAEhB,KAAK,CAACiB,OAAN,CAAc,CAAd,CALO;UAMZQ,eAAe,EAAEzB,KAAK,CAACiB,OAAN,CAAc,GAAd;QANL,CAdb;QAsBHC,SAAS,EAAE9B,YAAY,CAACsC,MAAb,CAAoBC;MAtB5B,CAAP;;IAwBJ;MACI,OAAO,EAAP;EAjDR;AAmDH"}
1
+ {"version":3,"names":["StyleSheet","commonColors","css","useTheme","styles","create","checkbox","alignItems","borderWidth","justifyContent","useVariantStyleMap","variant","checked","theme","checkboxContainerStyle","alignSelf","paddingTop","checkboxStyle","borderColor","palette","border","base","borderRadius","shape","radius","xs","height","width","backgroundColor","fill","containerStyle","flexDirection","gap","spacing","paddingVertical","iconColor","baseAlt","full","accent","borderBottomColor","weak","borderBottomWidth","static","strongInverse"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport { commonColors, FountainUiStyle } from '@fountain-ui/styles';\nimport { css, useTheme } from '../styles';\nimport type { CheckboxVariant } from './CheckboxProps';\n\nconst styles = StyleSheet.create({\n checkbox: {\n alignItems: 'center',\n borderWidth: 1,\n justifyContent: 'center',\n },\n});\n\ntype useVariantStyleMapReturns = {\n checkboxContainerStyle?: FountainUiStyle;\n checkboxStyle?: FountainUiStyle;\n containerStyle?: FountainUiStyle;\n iconColor?: string;\n};\n\nexport default function useVariantStyleMap(variant: CheckboxVariant, checked: boolean): useVariantStyleMapReturns {\n const theme = useTheme();\n\n switch (variant) {\n case 'square':\n return {\n checkboxContainerStyle: {\n alignSelf: 'flex-start',\n paddingTop: 3,\n },\n checkboxStyle: css([\n styles.checkbox,\n {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.xs,\n height: 18,\n width: 18,\n ...(checked ? {\n backgroundColor: theme.palette.fill.base,\n borderColor: theme.palette.fill.base,\n } : {}),\n },\n ]),\n containerStyle: {\n flexDirection: 'row',\n gap: theme.spacing(3),\n paddingVertical: theme.spacing(2),\n },\n iconColor: theme.palette.fill.baseAlt,\n };\n case 'round':\n return {\n checkboxStyle: css([\n styles.checkbox,\n {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.full,\n height: 20,\n width: 20,\n ...(checked ? {\n backgroundColor: theme.palette.fill.accent,\n borderColor: theme.palette.fill.accent,\n } : {}),\n },\n ]),\n containerStyle: {\n alignItems: 'center',\n borderBottomColor: theme.palette.border.weak,\n borderBottomWidth: 0.5,\n flexDirection: 'row-reverse',\n gap: theme.spacing(8),\n paddingVertical: theme.spacing(3.5),\n },\n iconColor: commonColors.static.strongInverse,\n };\n default:\n return {};\n }\n}\n"],"mappings":"AAAA,SAASA,UAAT,QAA2B,cAA3B;AACA,SAASC,YAAT,QAA8C,qBAA9C;AACA,SAASC,GAAT,EAAcC,QAAd,QAA8B,WAA9B;AAGA,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAX,CAAkB;EAC7BC,QAAQ,EAAE;IACNC,UAAU,EAAE,QADN;IAENC,WAAW,EAAE,CAFP;IAGNC,cAAc,EAAE;EAHV;AADmB,CAAlB,CAAf;AAeA,eAAe,SAASC,kBAAT,CAA4BC,OAA5B,EAAsDC,OAAtD,EAAmG;EAC9G,MAAMC,KAAK,GAAGV,QAAQ,EAAtB;;EAEA,QAAQQ,OAAR;IACI,KAAK,QAAL;MACI,OAAO;QACHG,sBAAsB,EAAE;UACpBC,SAAS,EAAE,YADS;UAEpBC,UAAU,EAAE;QAFQ,CADrB;QAKHC,aAAa,EAAEf,GAAG,CAAC,CACfE,MAAM,CAACE,QADQ,EAEf;UACIY,WAAW,EAAEL,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GAHP;UAIZV,aAAa,EAAE,aAJH;UAKZC,GAAG,EAAEnB,KAAK,CAACoB,OAAN,CAAc,CAAd,CALO;UAMZC,eAAe,EAAErB,KAAK,CAACoB,OAAN,CAAc,GAAd;QANL,CAdb;QAsBHE,SAAS,EAAElC,YAAY,CAACyC,MAAb,CAAoBC;MAtB5B,CAAP;;IAwBJ;MACI,OAAO,EAAP;EArDR;AAuDH"}
@@ -2,16 +2,18 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
2
2
 
3
3
  import React from 'react';
4
4
  import { Text, View } from 'react-native';
5
+ import ButtonBase from '../ButtonBase';
6
+ import { Close } from '../internal';
5
7
  import { css } from '../styles';
6
8
  import { cloneElementSafely } from '../utils';
7
- import ButtonBase from '../ButtonBase/ButtonBase';
8
9
  import useChipStyle from './useChipStyle';
9
10
  export default function Chip(props) {
10
11
  const {
11
12
  children,
12
- endElement: endElementProp,
13
+ color = 'default',
13
14
  numberOfLines,
14
15
  onPress,
16
+ selected = false,
15
17
  size = 'small',
16
18
  startElement: startElementProp,
17
19
  startElementVariant = 'default',
@@ -20,26 +22,28 @@ export default function Chip(props) {
20
22
  } = props;
21
23
  const {
22
24
  container: containerStyle,
23
- endElement: endElementStyle,
25
+ closeButton: closeButtonStyle,
24
26
  label: labelStyle,
25
- startElement: startElementStyle
26
- } = useChipStyle(size, startElementVariant, !!endElementProp);
27
+ startElement: startElementStyle,
28
+ startElementContainer: startElementContainerStyle
29
+ } = useChipStyle(size, startElementVariant, color, selected);
27
30
  const chipStyle = css([containerStyle, styleProp]);
28
- const startElement = startElementVariant === 'icon' ? /*#__PURE__*/React.createElement(View, {
31
+ const startElement = /*#__PURE__*/React.createElement(View, {
32
+ style: startElementContainerStyle
33
+ }, cloneElementSafely(startElementProp, {
29
34
  style: startElementStyle
30
- }, cloneElementSafely(startElementProp)) : cloneElementSafely(startElementProp, {
31
- style: startElementStyle
32
- });
33
- const endElement = cloneElementSafely(endElementProp, {
34
- style: endElementStyle
35
- });
35
+ }));
36
36
  return /*#__PURE__*/React.createElement(ButtonBase, _extends({
37
+ disabled: !onPress,
37
38
  onPress: onPress,
38
39
  style: chipStyle
39
40
  }, otherProps), startElement, /*#__PURE__*/React.createElement(Text, {
40
41
  children: children,
41
42
  numberOfLines: numberOfLines,
42
43
  style: labelStyle
43
- }), endElement);
44
+ }), selected ? /*#__PURE__*/React.createElement(Close, {
45
+ color: 'baseInverse',
46
+ style: closeButtonStyle
47
+ }) : null);
44
48
  }
45
49
  //# sourceMappingURL=Chip.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","css","cloneElementSafely","ButtonBase","useChipStyle","Chip","props","children","endElement","endElementProp","numberOfLines","onPress","size","startElement","startElementProp","startElementVariant","style","styleProp","otherProps","container","containerStyle","endElementStyle","label","labelStyle","startElementStyle","chipStyle"],"sources":["Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { css } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport ButtonBase from '../ButtonBase/ButtonBase';\nimport type ChipProps from './ChipProps';\nimport type { ChipSize } from './ChipProps';\nimport useChipStyle from './useChipStyle';\n\nexport default function Chip(props: ChipProps) {\n const {\n children,\n endElement: endElementProp,\n numberOfLines,\n onPress,\n size = 'small' as ChipSize,\n startElement: startElementProp,\n startElementVariant = 'default',\n style: styleProp,\n ...otherProps\n } = props;\n\n const {\n container: containerStyle,\n endElement: endElementStyle,\n label: labelStyle,\n startElement: startElementStyle,\n } = useChipStyle(size, startElementVariant, !!endElementProp);\n\n const chipStyle = css([\n containerStyle,\n styleProp,\n ]);\n\n const startElement = startElementVariant === 'icon'\n ? (\n <View style={startElementStyle}>\n {cloneElementSafely(startElementProp)}\n </View>\n ) : cloneElementSafely(startElementProp, { style: startElementStyle });\n const endElement = cloneElementSafely(endElementProp, { style: endElementStyle });\n\n return (\n <ButtonBase\n onPress={onPress}\n style={chipStyle}\n {...otherProps}\n >\n {startElement}\n\n <Text\n children={children}\n numberOf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AC,IAAD;IACI,QAAQ,EAAEN,QADd;IAEI,aAAa,EAAEG,aAFnB;IAGI,KAAK,EAAEa;EAHX,EAPJ,EAaKf,UAbL,CADJ;AAiBH"}
1
+ {"version":3,"names":["React","Text","View","ButtonBase","Close","css","cloneElementSafely","useChipStyle","Chip","props","children","color","numberOfLines","onPress","selected","size","startElement","startElementProp","startElementVariant","style","styleProp","otherProps","container","containerStyle","closeButton","closeButtonStyle","label","labelStyle","startElementStyle","startElementContainer","startElementContainerStyle","chipStyle"],"sources":["Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { Close } from '../internal';\nimport { css } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type ChipProps from './ChipProps';\nimport type { ChipColor, ChipSize } from './ChipProps';\nimport useChipStyle from './useChipStyle';\n\nexport default function Chip(props: ChipProps) {\n const {\n children,\n color = 'default' as ChipColor,\n numberOfLines,\n onPress,\n selected = false,\n size = 'small' as ChipSize,\n startElement: startElementProp,\n startElementVariant = 'default',\n style: styleProp,\n ...otherProps\n } = props;\n\n const {\n container: containerStyle,\n closeButton: closeButtonStyle,\n label: labelStyle,\n startElement: startElementStyle,\n startElementContainer: startElementContainerStyle,\n } = useChipStyle(size, startElementVariant, color, selected);\n\n const chipStyle = css([\n containerStyle,\n styleProp,\n ]);\n\n const startElement = (\n <View style={startElementContainerStyle}>\n {cloneElementSafely(startElementProp, { style: startElementStyle })}\n </View>\n );\n\n return (\n <ButtonBase\n disabled={!onPress}\n onPress={onPress}\n style={chipStyle}\n {...otherProps}\n >\n {startElement}\n\n <Text\n children={children}\n numberOfLines={numberOfLines}\n style={labelStyle}\n />\n\n {selected ? (\n <Close\n color={'baseInverse'}\n style={closeButtonStyle}\n />\n ) : null}\n </ButtonBase>\n );\n}\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AACA,OAA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uBH"}
@@ -1,3 +1,4 @@
1
+ export const chipColors = ['default', 'white'];
1
2
  export const chipSizes = ['large', 'small'];
2
3
  export const chipStartElementVariants = ['default', 'avatar', 'image', 'icon'];
3
4
  //# sourceMappingURL=ChipProps.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["chipSizes","chipStartElementVariants"],"sources":["ChipProps.ts"],"sourcesContent":["import React from 'react';\nimport { OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport const chipSizes = ['large', 'small'] as const;\nexport type ChipSize = typeof chipSizes[number];\n\nexport const chipStartElementVariants = ['default', 'avatar', 'image', 'icon'] as const;\nexport type ChipStartElementVariant = typeof chipStartElementVariants[number];\n\nexport default interface ChipProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * Element placed after the children.\n */\n endElement?: React.ReactElement;\n\n /**\n * The content of the component.\n */\n children: string;\n\n /**\n * Number of lines of children.\n */\n numberOfLines?: number;\n\n /**\n * Determines size of component.\n * @default 'small'\n */\n size?: ChipSize;\n\n /**\n * Element placed before the children.\n */\n startElement?: React.ReactElement;\n\n /**\n * Determines the style of the start element.\n */\n startElementVariant?: ChipStartElementVariant;\n}> {}\n"],"mappings":"AAIA,OAAO,MAAMA,SAAS,GAAG,CAAC,OAAD,EAAU,OAAV,CAAlB;AAGP,OAAO,MAAMC,wBAAwB,GAAG,CAAC,SAAD,EAAY,QAAZ,EAAsB,OAAtB,EAA+B,MAA/B,CAAjC"}
1
+ {"version":3,"names":["chipColors","chipSizes","chipStartElementVariants"],"sources":["ChipProps.ts"],"sourcesContent":["import React from 'react';\nimport { OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport const chipColors = ['default', 'white'] as const;\nexport type ChipColor = typeof chipColors[number];\n\nexport const chipSizes = ['large', 'small'] as const;\nexport type ChipSize = typeof chipSizes[number];\n\nexport const chipStartElementVariants = ['default', 'avatar', 'image', 'icon'] as const;\nexport type ChipStartElementVariant = typeof chipStartElementVariants[number];\n\nexport default interface ChipProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * The content of the component.\n */\n children: string;\n\n /**\n * Set backgroundColor of the component.\n * @default 'default'\n */\n color?: ChipColor;\n\n /**\n * Number of lines of children.\n */\n numberOfLines?: number;\n\n /**\n * If `true`, showing a close icon and applying a highlighted style.\n */\n selected?: boolean;\n\n /**\n * Determines size of component.\n * @default 'small'\n */\n size?: ChipSize;\n\n /**\n * Element placed before the children.\n */\n startElement?: React.ReactElement;\n\n /**\n * Determines the style of the start element.\n */\n startElementVariant?: ChipStartElementVariant;\n}> {}\n"],"mappings":"AAIA,OAAO,MAAMA,UAAU,GAAG,CAAC,SAAD,EAAY,OAAZ,CAAnB;AAGP,OAAO,MAAMC,SAAS,GAAG,CAAC,OAAD,EAAU,OAAV,CAAlB;AAGP,OAAO,MAAMC,wBAAwB,GAAG,CAAC,SAAD,EAAY,QAAZ,EAAsB,OAAtB,EAA+B,MAA/B,CAAjC"}
@@ -1,2 +1,3 @@
1
1
  export { default } from './Chip';
2
+ export { chipColors, chipSizes, chipStartElementVariants } from './ChipProps';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './Chip';\nexport type { default as ChipProps } from './ChipProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,QAAxB"}
1
+ {"version":3,"names":["default","chipColors","chipSizes","chipStartElementVariants"],"sources":["index.ts"],"sourcesContent":["export { default } from './Chip';\nexport type { default as ChipProps } from './ChipProps';\nexport { chipColors, chipSizes, chipStartElementVariants } from './ChipProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,QAAxB;AAEA,SAASC,UAAT,EAAqBC,SAArB,EAAgCC,wBAAhC,QAAgE,aAAhE"}
@@ -1,51 +1,36 @@
1
1
  import { useMemo } from 'react';
2
2
  import { createFontStyle, useTheme } from '../styles';
3
- import { typographyOf } from '@fountain-ui/styles';
4
3
  // TODO: need to refactoring...
5
- export default function useChipStyle(size, startElementVariant, isEndElement) {
4
+ export default function useChipStyle(size, startElementVariant, color, selected) {
6
5
  const theme = useTheme();
7
6
  return useMemo(() => {
8
- var _variantStyleMap$star, _variantStyleMap$star2;
7
+ var _variantStyleMap$star, _variantStyleMap$star2, _variantStyleMap$star3;
9
8
 
10
9
  const fontStyleMap = {
11
10
  small: createFontStyle(theme, {
12
- // TODO: select typography.
13
- // selector: (typography) => typography.caption1.medium,
14
- selector: _ => typographyOf({
15
- fontSize: 12,
16
- lineHeight: 16.8,
17
- fontFamily: 'Pretendard-Medium',
18
- letterSpacing: 0
19
- }),
20
- color: theme.palette.text.strong
11
+ selector: typography => typography.caption1.medium,
12
+ color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong
21
13
  }),
22
14
  large: createFontStyle(theme, {
23
- // TODO: select typography.
24
- // selector: (typography) => typography.body2.medium,
25
- selector: _ => typographyOf({
26
- fontSize: 14,
27
- lineHeight: 21,
28
- fontFamily: 'Pretendard-Medium',
29
- letterSpacing: 0
30
- }),
31
- color: theme.palette.text.strong
15
+ selector: typography => typography.body2.medium,
16
+ color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong
32
17
  })
33
18
  };
34
- const endElementStyleMap = {
19
+ const closeButtonStyleMap = {
35
20
  small: {
36
21
  height: 14,
37
22
  marginLeft: theme.spacing(2),
38
23
  width: 8.17
39
24
  },
40
25
  large: {
41
- height: 16,
26
+ height: 17,
42
27
  marginLeft: theme.spacing(2.5),
43
28
  width: 9
44
29
  }
45
30
  };
46
31
  const baseContainerStyle = {
47
32
  alignItems: 'center',
48
- backgroundColor: theme.palette.fill.weaker,
33
+ backgroundColor: selected ? theme.palette.fill.base : color === 'white' ? theme.palette.surface.base : theme.palette.fill.weaker,
49
34
  borderRadius: theme.shape.radius.full,
50
35
  flexDirection: 'row',
51
36
  overflow: 'hidden'
@@ -60,9 +45,11 @@ export default function useChipStyle(size, startElementVariant, isEndElement) {
60
45
  },
61
46
  startElement: {
62
47
  borderRadius: theme.shape.radius.full,
63
- height: isLarge ? 24 : 22,
64
- marginRight: theme.spacing(isLarge ? 1.5 : 1.25),
65
- width: isLarge ? 24 : 22
48
+ height: isLarge ? 26 : 23,
49
+ width: isLarge ? 26 : 23
50
+ },
51
+ startElementContainer: {
52
+ marginRight: theme.spacing(isLarge ? 1.5 : 1.25)
66
53
  }
67
54
  },
68
55
  icon: {
@@ -72,11 +59,16 @@ export default function useChipStyle(size, startElementVariant, isEndElement) {
72
59
  paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25)
73
60
  },
74
61
  startElement: {
62
+ color: selected ? theme.palette.icon.strongInverse : theme.palette.icon.strong,
63
+ height: isLarge ? 17 : 16,
64
+ width: isLarge ? 17 : 16
65
+ },
66
+ startElementContainer: {
75
67
  alignItems: 'center',
76
- height: isLarge ? 22 : 20,
68
+ height: isLarge ? 24 : 21,
77
69
  justifyContent: 'center',
78
70
  marginRight: theme.spacing(isLarge ? 1 : 0.75),
79
- width: isLarge ? 22 : 20
71
+ width: isLarge ? 24 : 21
80
72
  }
81
73
  },
82
74
  image: {
@@ -86,9 +78,11 @@ export default function useChipStyle(size, startElementVariant, isEndElement) {
86
78
  },
87
79
  startElement: {
88
80
  borderRadius: theme.shape.radius.full,
89
- height: isLarge ? 34 : 30,
90
- marginRight: theme.spacing(1.5),
91
- width: isLarge ? 45 : 40
81
+ height: isLarge ? 36 : 31,
82
+ width: isLarge ? 48 : 40
83
+ },
84
+ startElementContainer: {
85
+ marginRight: theme.spacing(1.5)
92
86
  }
93
87
  },
94
88
  default: {
@@ -102,14 +96,15 @@ export default function useChipStyle(size, startElementVariant, isEndElement) {
102
96
  return {
103
97
  container: { ...baseContainerStyle,
104
98
  ...((_variantStyleMap$star = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star === void 0 ? void 0 : _variantStyleMap$star.container),
105
- ...(isEndElement ? {
99
+ ...(selected ? {
106
100
  paddingRight: theme.spacing(isLarge ? 2.5 : 2.25)
107
101
  } : {})
108
102
  },
109
- endElement: endElementStyleMap[size],
103
+ closeButton: closeButtonStyleMap[size],
110
104
  label: fontStyleMap[size],
111
- startElement: (_variantStyleMap$star2 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star2 === void 0 ? void 0 : _variantStyleMap$star2.startElement
105
+ startElement: (_variantStyleMap$star2 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star2 === void 0 ? void 0 : _variantStyleMap$star2.startElement,
106
+ startElementContainer: (_variantStyleMap$star3 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star3 === void 0 ? void 0 : _variantStyleMap$star3.startElementContainer
112
107
  };
113
- }, [theme, size, startElementVariant]);
108
+ }, [theme, size, startElementVariant, color, selected]);
114
109
  }
115
110
  //# sourceMappingURL=useChipStyle.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","createFontStyle","useTheme","typographyOf","useChipStyle","size","startElementVariant","isEndElement","theme","fontStyleMap","small","selector","_","fontSize","lineHeight","fontFamily","letterSpacing","color","palette","text","strong","large","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';\nimport { typographyOf } from '@fountain-ui/styles';\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 // TODO: select typography.\n // selector: (typography) => typography.caption1.medium,\n selector: (_) => typographyOf({\n fontSize: 12,\n lineHeight: 16.8,\n fontFamily: 'Pretendard-Medium',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strong,\n }),\n large: createFontStyle(theme, {\n // TODO: select typography.\n // selector: (typography) => typography.body2.medium,\n selector: (_) => typographyOf({\n fontSize: 14,\n lineHeight: 21,\n fontFamily: 'Pretendard-Medium',\n letterSpacing: 0,\n }),\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,SAASA,OAAT,QAAwB,OAAxB;AAGA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AAEA,SAASC,YAAT,QAA6B,qBAA7B;AAWA;AACA,eAAe,SAASC,YAAT,CACXC,IADW,EAEXC,mBAFW,EAGXC,YAHW,EAIF;EACT,MAAMC,KAAK,GAAGN,QAAQ,EAAtB;EAEA,OAAOF,OAAO,CAAY,MAAM;IAAA;;IAC5B,MAAMS,YAAyC,GAAG;MAC9CC,KAAK,EAAET,eAAe,CAACO,KAAD,EAAQ;QAC1B;QACA;QACAG,QAAQ,EAAGC,CAAD,IAAOT,YAAY,CAAC;UAC1BU,QAAQ,EAAE,EADgB;UAE1BC,UAAU,EAAE,IAFc;UAG1BC,UAAU,EAAE,mBAHc;UAI1BC,aAAa,EAAE;QAJW,CAAD,CAHH;QAS1BC,KAAK,EAAET,KAAK,CAACU,OAAN,CAAcC,IAAd,CAAmBC;MATA,CAAR,CADwB;MAY9CC,KAAK,EAAEpB,eAAe,CAACO,KAAD,EAAQ;QAC1B;QACA;QACAG,QAAQ,EAAGC,CAAD,IAAOT,YAAY,CAAC;UAC1BU,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R;UAEP2B,iBAAiB,EAAE5C,KAAK,CAACiB,OAAN,CAAca,OAAO,GAAG,GAAH,GAAS,CAA9B,CAFZ;UAGPe,UAAU,EAAE7C,KAAK,CAACiB,OAAN,CAAc,GAAd;QAHL;MADN;IAxC4B,CAAzC;IAiDA,OAAO;MACHgB,SAAS,EAAE,EACP,GAAGd,kBADI;QAEP,6BAAGY,eAAe,CAACjC,mBAAD,CAAlB,0DAAG,sBAAsCmC,SAAzC,CAFO;QAGP,IAAIlC,YAAY,GAAG;UAAEoC,YAAY,EAAEnC,KAAK,CAACiB,OAAN,CAAca,OAAO,GAAG,GAAH,GAAS,IAA9B;QAAhB,CAAH,GAA2D,EAA3E;MAHO,CADR;MAMHgB,UAAU,EAAEhC,kBAAkB,CAACjB,IAAD,CAN3B;MAOHkD,KAAK,EAAE9C,YAAY,CAACJ,IAAD,CAPhB;MAQHwC,YAAY,4BAAEN,eAAe,CAACjC,mBAAD,CAAjB,2DAAE,uBAAsCuC;IARjD,CAAP;EAUH,CA5Ga,EA4GX,CAACrC,KAAD,EAAQH,IAAR,EAAcC,mBAAd,CA5GW,CAAd;AA6GH"}
1
+ {"version":3,"names":["useMemo","createFontStyle","useTheme","useChipStyle","size","startElementVariant","color","selected","theme","fontStyleMap","small","selector","typography","caption1","medium","palette","text","strongInverse","strong","large","body2","closeButtonStyleMap","height","marginLeft","spacing","width","baseContainerStyle","alignItems","backgroundColor","fill","base","surface","weaker","borderRadius","shape","radius","full","flexDirection","overflow","isLarge","variantStyleMap","avatar","container","paddingLeft","paddingRight","paddingVertical","startElement","startElementContainer","marginRight","icon","justifyContent","image","default","paddingBottom","paddingHorizontal","paddingTop","closeButton","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 { ChipColor, ChipSize, ChipStartElementVariant } from './ChipProps';\n\ninterface ChipStyle {\n container: FountainUiStyle;\n closeButton?: FountainUiStyle;\n label: TextStyle;\n startElement?: FountainUiStyle;\n startElementContainer?: 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 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 closeButtonStyleMap: Record<ChipSize, FountainUiStyle> = {\n small: {\n height: 14,\n marginLeft: theme.spacing(2),\n width: 8.17,\n },\n large: {\n height: 17,\n marginLeft: theme.spacing(2.5),\n width: 9,\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 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 ...(selected ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),\n },\n closeButton: closeButtonStyleMap[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,SAASA,OAAT,QAAwB,OAAxB;AAGA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AAaA;AACA,eAAe,SAASC,YAAT,CACXC,IADW,EAEXC,mBAFW,EAGXC,KAHW,EAIXC,QAJW,EAKF;EACT,MAAMC,KAAK,GAAGN,QAAQ,EAAtB;EAEA,OAAOF,OAAO,CAAY,MAAM;IAAA;;IAC5B,MAAMS,YAAyC,GAAG;MAC9CC,KAAK,EAAET,eAAe,CAACO,KAAD,EAAQ;QAC1BG,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,QAAX,CAAoBC,MADpB;QAE1BR,KAAK,EAAEC,QAAQ,GAAGC,KAAK,CAACO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nC,mBAAD,CAAjB,2DAAE,uBAAsCyC,YARjD;MASHC,qBAAqB,4BAAEP,eAAe,CAACnC,mBAAD,CAAjB,2DAAE,uBAAsC0C;IAT1D,CAAP;EAWH,CA7Ga,EA6GX,CAACvC,KAAD,EAAQJ,IAAR,EAAcC,mBAAd,EAAmCC,KAAnC,EAA0CC,QAA1C,CA7GW,CAAd;AA8GH"}
@@ -13,7 +13,6 @@ export default function Dialog(props) {
13
13
  const {
14
14
  animationType = ANIMATION_TYPE.SLIDE,
15
15
  children,
16
- fullScreen = false,
17
16
  hideBackdrop,
18
17
  onClose,
19
18
  style: styleProp,
@@ -22,7 +21,7 @@ export default function Dialog(props) {
22
21
  topElement,
23
22
  ...otherProps
24
23
  } = props;
25
- const styles = useDialogStyle(size, fullScreen);
24
+ const styles = useDialogStyle(size);
26
25
  const {
27
26
  height: screenHeight
28
27
  } = useWindowDimensions();
@@ -51,7 +50,7 @@ export default function Dialog(props) {
51
50
  toValue: 0,
52
51
  type: ANIMATION_TYPE.FADE
53
52
  }];
54
- } else if (animationType === ANIMATION_TYPE.SLIDE && !fullScreen) {
53
+ } else if (animationType === ANIMATION_TYPE.SLIDE) {
55
54
  return [{
56
55
  toValue: screenHeight,
57
56
  type: ANIMATION_TYPE.SLIDE
@@ -67,14 +66,14 @@ export default function Dialog(props) {
67
66
  toValue: screenHeight,
68
67
  type: ANIMATION_TYPE.SLIDE
69
68
  }];
70
- }, [animationType, fullScreen, screenHeight]);
69
+ }, [animationType, screenHeight]);
71
70
  const openAnimation = useMemo(() => {
72
71
  if (animationType === ANIMATION_TYPE.FADE) {
73
72
  return [{
74
73
  toValue: 1,
75
74
  type: ANIMATION_TYPE.FADE
76
75
  }];
77
- } else if (animationType === ANIMATION_TYPE.SLIDE && !fullScreen) {
76
+ } else if (animationType === ANIMATION_TYPE.SLIDE) {
78
77
  return [{
79
78
  toValue: 0,
80
79
  type: ANIMATION_TYPE.SLIDE
@@ -90,8 +89,8 @@ export default function Dialog(props) {
90
89
  toValue: 0,
91
90
  type: ANIMATION_TYPE.SLIDE
92
91
  }];
93
- }, [animationType, fullScreen]);
94
- const initialOpacity = animationType === ANIMATION_TYPE.SLIDE && fullScreen ? 1 : undefined;
92
+ }, [animationType]);
93
+ const initialOpacity = animationType === ANIMATION_TYPE.SLIDE ? 1 : undefined;
95
94
  const initialTranslateY = animationType === ANIMATION_TYPE.FADE ? 0 : undefined;
96
95
  const paperStyle = css([styles.paper, styleProp]);
97
96
  return /*#__PURE__*/React.createElement(Modal, _extends({
@@ -110,7 +109,7 @@ export default function Dialog(props) {
110
109
  size
111
110
  }
112
111
  }, topElement ? /*#__PURE__*/React.createElement(Column, {
113
- style: fullScreen ? undefined : styles.topElementContainer
112
+ style: styles.topElementContainer
114
113
  }, /*#__PURE__*/React.createElement(Column, {
115
114
  style: styles.topElementContent,
116
115
  onLayout: handleTopElementLayout
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","useState","useWindowDimensions","css","Column","Modal","ANIMATION_TYPE","ShadowView","DialogProvider","useDialogStyle","TOP_ELEMENT_OFFSET","Dialog","props","animationType","SLIDE","children","fullScreen","hideBackdrop","onClose","style","styleProp","size","visible","topElement","otherProps","styles","height","screenHeight","topElementHeight","setTopElementHeight","handleTopElementLayout","event","nativeEvent","layout","offsetAnimation","toValue","type","closeAnimation","FADE","duration","openAnimation","delay","initialOpacity","undefined","initialTranslateY","paperStyle","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,OAAOA,KAAP,IAAgBC,OAAhB,EAAyBC,QAAzB,QAAyC,OAAzC;AACA,SAA4BC,mBAA5B,QAAuD,cAAvD;AACA,SAASC,GAAT,QAAoB,qBAApB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,KAAP,IAAgBC,cAAhB,QAAqD,UAArD;AACA,OAAOC,UAAP,MAAuB,eAAvB;AAEA,SAASC,cAAT,QAA+B,iBAA/B;AACA,OAAOC,cAAP,MAA2B,kBAA3B;AAEA,MAAMC,kBAAkB,GAAG,EAA3B;AAEA,eAAe,SAASC,MAAT,CAAgBC,KAAhB,EAAoC;EAC/C,MAAM;IACFC,aAAa,GAAGP,cAAc,CAACQ,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,IAWFZ,KAXJ;EAaA,MAAMa,MAAM,GAAGhB,cAAc,CAACY,IAAD,EAAOL,UAAP,CAA7B;EAEA,MAAM;IAAEU,MAAM,EAA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B,OANb;IAOI,aAAa,EAAEsB,aAPnB;IAQI,eAAe,EAAEN,eARrB;IASI,OAAO,EAAEZ,OATb;IAUI,KAAK,EAAEG,MAAM,CAACuB;EAVlB,GAWQxB,UAXR,gBAaI,oBAAC,cAAD;IAAgB,KAAK,EAAE;MAAEH;IAAF;EAAvB,GACKE,UAAU,gBACP,oBAAC,MAAD;IAAQ,KAAK,EAAEP,UAAU,GAAG2B,SAAH,GAAelB,MAAM,CAACwB;EAA/C,gBACI,oBAAC,MAAD;IACI,KAAK,EAAExB,MAAM,CAACyB,iBADlB;IAEI,QAAQ,EAAEpB;EAFd,GAIKP,UAJL,CADJ,CADO,GASP,IAVR,eAYI,oBAAC,UAAD;IACI,OAAO,EAAE,GADb;IAEI,KAAK,EAAEsB;EAFX,GAIK9B,QAJL,CAZJ,CAbJ,CADJ;AAmCH;AAAA"}
1
+ {"version":3,"names":["React","useMemo","useState","useWindowDimensions","css","Column","Modal","ANIMATION_TYPE","ShadowView","DialogProvider","useDialogStyle","TOP_ELEMENT_OFFSET","Dialog","props","animationType","SLIDE","children","hideBackdrop","onClose","style","styleProp","size","visible","topElement","otherProps","styles","height","screenHeight","topElementHeight","setTopElementHeight","handleTopElementLayout","event","nativeEvent","layout","offsetAnimation","toValue","type","closeAnimation","FADE","duration","openAnimation","delay","initialOpacity","undefined","initialTranslateY","paperStyle","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 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 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) {\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,OAAOA,KAAP,IAAgBC,OAAhB,EAAyBC,QAAzB,QAAyC,OAAzC;AACA,SAA4BC,mBAA5B,QAAuD,cAAvD;AACA,SAASC,GAAT,QAAoB,qBAApB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,KAAP,IAAgBC,cAAhB,QAAqD,UAArD;AACA,OAAOC,UAAP,MAAuB,eAAvB;AAEA,SAASC,cAAT,QAA+B,iBAA/B;AACA,OAAOC,cAAP,MAA2B,kBAA3B;AAEA,MAAMC,kBAAkB,GAAG,EAA3B;AAEA,eAAe,SAASC,MAAT,CAAgBC,KAAhB,EAAoC;EAC/C,MAAM;IACFC,aAAa,GAAGP,cAAc,CAACQ,KAD7B;IAEFC,QAFE;IAGFC,YAHE;IAIFC,OAJE;IAKFC,KAAK,EAAEC,SALL;IAMFC,IAAI,GAAG,QANL;IAOFC,OAPE;IAQFC,UARE;IASF,GAAGC;EATD,IAUFX,KAVJ;EAYA,MAAMY,MAAM,GAAGf,cAAc,CAACW,IAAD,CAA7B;EAEA,MAAM;IAAEK,MAAM,EAAEC;EAAV,IAA2BxB,mBAAmB,EAApD;EAEA,MAAM,CAACyB,gBAAD,EAAmBC,mBAAnB,IAA0C3B,QAAQ,CAAC,CAAD,CAAxD;;EACA,MAAM4B,sBAAsB,GAAI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MAAD;IAAQ,KAAK,EAAEE,MAAM,CAACwB;EAAtB,gBACI,oBAAC,MAAD;IACI,KAAK,EAAExB,MAAM,CAACyB,iBADlB;IAEI,QAAQ,EAAEpB;EAFd,GAIKP,UAJL,CADJ,CADO,GASP,IAVR,eAYI,oBAAC,UAAD;IACI,OAAO,EAAE,GADb;IAEI,KAAK,EAAEsB;EAFX,GAIK7B,QAJL,CAZJ,CAbJ,CADJ;AAmCH;AAAA"}
@@ -1,2 +1,2 @@
1
- export const dialogSizes = ['small', 'medium', 'large'];
1
+ export const dialogSizes = ['small', 'medium', 'large', 'full'];
2
2
  //# 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":"AAKA,OAAO,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":"AAKA,OAAO,MAAMA,WAAW,GAAG,CAAC,OAAD,EAAU,QAAV,EAAoB,OAApB,EAA6B,MAA7B,CAApB"}
@@ -1,4 +1,5 @@
1
1
  export { default } from './Dialog';
2
+ export { dialogSizes } from './DialogProps';
2
3
  export { DialogProvider, useDialogContext } from './DialogContext';
3
4
  export { default as useDialogSectionStyle } from './useDialogSectionStyle';
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default","DialogProvider","useDialogContext","useDialogSectionStyle"],"sources":["index.ts"],"sourcesContent":["export { default } from './Dialog';\nexport type { default as DialogProps } from './DialogProps';\nexport { DialogProvider, useDialogContext } from './DialogContext';\nexport { default as useDialogSectionStyle } from './useDialogSectionStyle';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,UAAxB;AAEA,SAASC,cAAT,EAAyBC,gBAAzB,QAAiD,iBAAjD;AACA,SAASF,OAAO,IAAIG,qBAApB,QAAiD,yBAAjD"}
1
+ {"version":3,"names":["default","dialogSizes","DialogProvider","useDialogContext","useDialogSectionStyle"],"sources":["index.ts"],"sourcesContent":["export { default } from './Dialog';\nexport type { default as DialogProps } from './DialogProps';\nexport { dialogSizes } from './DialogProps';\nexport { DialogProvider, useDialogContext } from './DialogContext';\nexport { default as useDialogSectionStyle } from './useDialogSectionStyle';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,UAAxB;AAEA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,cAAT,EAAyBC,gBAAzB,QAAiD,iBAAjD;AACA,SAASH,OAAO,IAAII,qBAApB,QAAiD,yBAAjD"}
@@ -13,15 +13,15 @@ export default function useDialogSectionStyle() {
13
13
  return useMemo(() => {
14
14
  const sizePaddingHorizontalMap = {
15
15
  small: {
16
- paddingHorizontal: theme.spacing(6)
16
+ paddingHorizontal: 24
17
17
  },
18
18
  medium: {
19
- // TODO: need to refactor breakpoints.
20
- paddingHorizontal: theme.spacing(windowWidth >= 448 ? 8 : 6)
19
+ paddingHorizontal: windowWidth >= 448 ? 32 : 24
21
20
  },
22
21
  large: {
23
- paddingHorizontal: theme.spacing(8)
24
- }
22
+ paddingHorizontal: 32
23
+ },
24
+ full: {}
25
25
  };
26
26
  return sizePaddingHorizontalMap[size];
27
27
  }, [size, theme, windowWidth]);
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useWindowDimensions","useTheme","useDialogContext","useDialogSectionStyle","size","width","windowWidth","theme","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,SAASA,OAAT,QAAwB,OAAxB;AACA,SAASC,mBAAT,QAAoC,cAApC;AAEA,SAASC,QAAT,QAAyB,WAAzB;AACA,SAASC,gBAAT,QAAiC,iBAAjC;AAGA,eAAe,SAASC,qBAAT,GAAiC;EAC5C,MAAM;IAAEC;EAAF,IAAWF,gBAAgB,EAAjC;EAEA,MAAM;IAAEG,KAAK,EAAEC;EAAT,IAAyBN,mBAAmB,EAAlD;EAEA,MAAMO,KAAK,GAAGN,QAAQ,EAAtB;EAEA,OAAOF,OAAO,CAAkB,MAAM;IAClC,MAAMS,wBAA6D,GAAG;MAClEC,KAAK,EAAE;QACHC,iBAAiB,EAAEH,KAAK,CAACI,OAAN,CAAc,CAAd;MADhB,CAD2D;MAIlEC,MAAM,EAAE;QACJ;QACAF,iBAAiB,EAAEH,KAAK,CAACI,OAAN,CAAcL,WAAW,IAAI,GAAf,GAAqB,CAArB,GAAyB,CAAvC;MAFf,CAJ0D;MAQlEO,KAAK,EAAE;QACHH,iBAAiB,EAAEH,KAAK,CAACI,OAAN,CAAc,CAAd;MADhB;IAR2D,CAAtE;IAaA,OAAOH,wBAAwB,CAACJ,IAAD,CAA/B;EACH,CAfa,EAeX,CAACA,IAAD,EAAOG,KAAP,EAAcD,WAAd,CAfW,CAAd;AAgBH"}
1
+ {"version":3,"names":["useMemo","useWindowDimensions","useTheme","useDialogContext","useDialogSectionStyle","size","width","windowWidth","theme","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 };\n\n return sizePaddingHorizontalMap[size];\n }, [size, theme, windowWidth]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AACA,SAASC,mBAAT,QAAoC,cAApC;AAEA,SAASC,QAAT,QAAyB,WAAzB;AACA,SAASC,gBAAT,QAAiC,iBAAjC;AAGA,eAAe,SAASC,qBAAT,GAAiC;EAC5C,MAAM;IAAEC;EAAF,IAAWF,gBAAgB,EAAjC;EAEA,MAAM;IAAEG,KAAK,EAAEC;EAAT,IAAyBN,mBAAmB,EAAlD;EAEA,MAAMO,KAAK,GAAGN,QAAQ,EAAtB;EAEA,OAAOF,OAAO,CAAkB,MAAM;IAClC,MAAMS,wBAA6D,GAAG;MAClEC,KAAK,EAAE;QACHC,iBAAiB,EAAE;MADhB,CAD2D;MAIlEC,MAAM,EAAE;QACJD,iBAAiB,EAAEJ,WAAW,IAAI,GAAf,GAAqB,EAArB,GAA0B;MADzC,CAJ0D;MAOlEM,KAAK,EAAE;QACHF,iBAAiB,EAAE;MADhB,CAP2D;MAUlEG,IAAI,EAAE;IAV4D,CAAtE;IAaA,OAAOL,wBAAwB,CAACJ,IAAD,CAA/B;EACH,CAfa,EAeX,CAACA,IAAD,EAAOG,KAAP,EAAcD,WAAd,CAfW,CAAd;AAgBH"}