@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":["useStyles","theme","useTheme","root","alignItems","borderRadius","shape","radius","sm","flexDirection","justifyContent","fullWidth","width","large","gap","spacing","minWidth","paddingHorizontal","paddingVertical","medium","small","loadingSpinner","position","fontStyleMap","typographyOf","fontSize","lineHeight","fontFamily","letterSpacing","getLoadingSpinnerColor","variant","color","Button","props","children","colorProp","disabled","disabledProp","disableMinWidth","endIcon","endIconProp","href","isLoading","onPress","pressEffect","size","startIcon","startIconProp","style","styleProp","otherProps","styles","container","containerStyle","iconColor","labelColor","useVariantStyleMap","iconProps","fill","opacity","cloneElementSafely","buttonBaseStyle","css","undefined","fontStyle","createFontStyle","selector","_","textStyle","textAlign","modifiedPressEffect","handlePress","Linking","canOpenURL","openURL","loadingSpinnerColor"],"sources":["Button.tsx"],"sourcesContent":["import React from 'react';\nimport { Linking, Text } from 'react-native';\nimport type { FontStyle, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase/ButtonBase';\nimport { LoadingSpinner } from '../internal/icons';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type ButtonProps from './ButtonProps';\nimport type { ButtonColor, ButtonSize, ButtonVariant } from './ButtonProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\ntype ButtonStyles = NamedStylesStringUnion<'root' | 'fullWidth' | 'large' | 'medium' | 'small' | 'loadingSpinner'>;\n\nconst useStyles: UseStyles<ButtonStyles> = function (): ButtonStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'center',\n borderRadius: theme.shape.radius.sm,\n flexDirection: 'row',\n justifyContent: 'center',\n },\n fullWidth: {\n width: '100%',\n },\n large: {\n gap: theme.spacing(2),\n minWidth: 104,\n paddingHorizontal: theme.spacing(6),\n paddingVertical: theme.spacing(3.5),\n },\n medium: {\n gap: theme.spacing(1.5),\n minWidth: 88,\n paddingHorizontal: theme.spacing(6),\n paddingVertical: theme.spacing(2.75),\n },\n small: {\n minWidth: 64,\n paddingHorizontal: theme.spacing(6),\n paddingVertical: theme.spacing(2),\n },\n loadingSpinner: {\n position: 'absolute',\n },\n };\n};\n\nconst fontStyleMap: Record<ButtonSize, FontStyle> = {\n large: typographyOf({\n fontSize: 16,\n lineHeight: 20,\n fontFamily: 'LexendDeca-SemiBold',\n letterSpacing: -0.32,\n }),\n medium: typographyOf({\n fontSize: 15,\n lineHeight: 19.5,\n fontFamily: 'LexendDeca-SemiBold',\n letterSpacing: -0.3,\n }),\n small: typographyOf({\n fontSize: 13,\n lineHeight: 16.9,\n fontFamily: 'LexendDeca-SemiBold',\n letterSpacing: -0.26,\n }),\n};\n\nfunction getLoadingSpinnerColor(variant: ButtonVariant, color: ButtonColor) {\n if (variant === 'solid' || (variant === 'capsuleSolid' && color !== 'secondary')) {\n return 'white';\n }\n return 'gray';\n}\n\nexport default function Button(props: ButtonProps) {\n const {\n children,\n color: colorProp = 'primary' as ButtonColor,\n disabled: disabledProp = false,\n disableMinWidth = false,\n endIcon: endIconProp,\n fullWidth = false,\n href,\n isLoading = false,\n onPress,\n pressEffect,\n size = 'medium' as ButtonSize,\n startIcon: startIconProp,\n style: styleProp,\n variant = 'solid' as ButtonVariant,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const disabled = disabledProp || isLoading;\n\n const color = disabledProp ? 'disabled' : colorProp;\n const {\n container: containerStyle,\n iconColor,\n labelColor,\n } = useVariantStyleMap(variant, color);\n\n const iconProps = {\n fill: iconColor,\n opacity: isLoading ? 0 : 1,\n };\n\n const startIcon = cloneElementSafely(startIconProp, iconProps);\n const endIcon = cloneElementSafely(endIconProp, iconProps);\n\n const buttonBaseStyle = css([\n styles.root,\n containerStyle,\n styles[size],\n fullWidth ? styles.fullWidth : undefined,\n disableMinWidth ? { minWidth: 0 } : undefined,\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (_) => fontStyleMap[size],\n color: labelColor,\n });\n\n const textStyle = css([\n fontStyle,\n {\n opacity: isLoading ? 0 : 1,\n textAlign: 'center',\n },\n ]);\n\n const modifiedPressEffect = variant !== 'text' && !pressEffect\n ? 'scale'\n : pressEffect;\n\n const handlePress = async () => {\n if (disabled) {\n return;\n }\n if (onPress) {\n onPress();\n return;\n }\n if (href) {\n if (await Linking.canOpenURL(href)) {\n await Linking.openURL(href);\n }\n }\n };\n\n const loadingSpinnerColor = getLoadingSpinnerColor(variant, color);\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={buttonBaseStyle}\n pressEffect={modifiedPressEffect}\n {...otherProps}\n >\n {startIcon}\n\n <Text style={textStyle}>\n {children}\n </Text>\n\n {endIcon}\n\n {isLoading ? (\n <LoadingSpinner\n color={loadingSpinnerColor}\n size={size}\n style={styles.loadingSpinner}\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,IAAIF,IAAJ,EAAU;MACN,IAAI,MAAM+B,oBAAA,CAAQC,UAAR,CAAmBhC,IAAnB,CAAV,EAAoC;QAChC,MAAM+B,oBAAA,CAAQE,OAAR,CAAgBjC,IAAhB,CAAN;MACH;IACJ;EACJ,CAbD;;EAeA,MAAMkC,mBAAmB,GAAG9C,sBAAsB,CAACC,OAAD,EAAUC,KAAV,CAAlD;EAEA,oBACI,6BAAC,mBAAD;IACI,QAAQ,EAAEK,QADd;IAEI,OAAO,EAAEmC,WAFb;IAGI,KAAK,EAAEV,eAHX;IAII,WAAW,EAAES;EAJjB,GAKQpB,UALR,GAOKJ,SAPL,eASI,6BAAC,iBAAD;IAAM,KAAK,EAAEsB;EAAb,GACKlC,QADL,CATJ,EAaKK,OAbL,EAeKG,SAAS,gBACN,6BAAC,qBAAD;IACI,KAAK,EAAEiC,mBADX;IAEI,IAAI,EAAE9B,IAFV;IAGI,KAAK,EAAEM,MAAM,CAAC9B;EAHlB,EADM,GAMN,IArBR,CADJ;AAyBH;;AAAA"}
1
+ {"version":3,"names":["useStyles","theme","useTheme","root","alignItems","borderRadius","shape","radius","sm","flexDirection","justifyContent","minHeight","fullWidth","width","large","gap","minWidth","paddingHorizontal","paddingVertical","medium","small","loadingSpinner","position","iconContainer","paddingTop","fontStyleMap","typographyOf","fontSize","lineHeight","fontFamily","letterSpacing","getLoadingSpinnerColor","variant","color","Button","props","children","colorProp","disabled","disabledProp","disableMinWidth","disablePadding","endIcon","endIconProp","href","isLoading","onPress","pressEffect","size","startIcon","startIconProp","style","styleProp","otherProps","styles","container","containerStyle","iconColor","labelColor","useVariantStyleMap","iconProps","fill","opacity","cloneElementSafely","buttonBaseStyle","css","undefined","fontStyle","createFontStyle","selector","_","textStyle","textAlign","modifiedPressEffect","handlePress","Linking","canOpenURL","openURL","loadingSpinnerColor"],"sources":["Button.tsx"],"sourcesContent":["import React from 'react';\nimport { Linking, Text, View } from 'react-native';\nimport type { FontStyle, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase/ButtonBase';\nimport { LoadingSpinner } from '../internal/icons';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type ButtonProps from './ButtonProps';\nimport type { ButtonColor, ButtonSize, ButtonVariant } from './ButtonProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\ntype ButtonStyles = NamedStylesStringUnion<'root' | 'fullWidth' | 'large' | 'medium' | 'small' | 'loadingSpinner' | 'iconContainer'>;\n\nconst useStyles: UseStyles<ButtonStyles> = function (): ButtonStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'center',\n borderRadius: theme.shape.radius.sm,\n flexDirection: 'row',\n justifyContent: 'center',\n minHeight: 32,\n },\n fullWidth: {\n width: '100%',\n },\n large: {\n gap: 8,\n minWidth: 104,\n paddingHorizontal: 24,\n paddingVertical: 14,\n },\n medium: {\n gap: 6,\n minWidth: 88,\n paddingHorizontal: 16,\n paddingVertical: 11,\n },\n small: {\n minWidth: 64,\n paddingHorizontal: 10,\n paddingVertical: 8,\n },\n loadingSpinner: {\n position: 'absolute',\n },\n iconContainer: {\n paddingTop: 1,\n },\n };\n};\n\nconst fontStyleMap: Record<ButtonSize, FontStyle> = {\n large: typographyOf({\n fontSize: 16,\n lineHeight: 20,\n fontFamily: 'LexendDeca-SemiBold',\n letterSpacing: -0.32,\n }),\n medium: typographyOf({\n fontSize: 15,\n lineHeight: 19.5,\n fontFamily: 'LexendDeca-SemiBold',\n letterSpacing: -0.3,\n }),\n small: typographyOf({\n fontSize: 13,\n lineHeight: 16.9,\n fontFamily: 'LexendDeca-SemiBold',\n letterSpacing: -0.26,\n }),\n};\n\nfunction getLoadingSpinnerColor(variant: ButtonVariant, color: ButtonColor) {\n if (variant === 'solid' || (variant === 'capsuleSolid' && color !== 'secondary')) {\n return 'white';\n }\n return 'gray';\n}\n\nexport default function Button(props: ButtonProps) {\n const {\n children,\n color: colorProp = 'primary' as ButtonColor,\n disabled: disabledProp = false,\n disableMinWidth = false,\n disablePadding = false,\n endIcon: endIconProp,\n fullWidth = false,\n href,\n isLoading = false,\n onPress,\n pressEffect,\n size = 'medium' as ButtonSize,\n startIcon: startIconProp,\n style: styleProp,\n variant = 'solid' as ButtonVariant,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const disabled = disabledProp || isLoading;\n\n const color = disabledProp ? 'disabled' : colorProp;\n const {\n container: containerStyle,\n iconColor,\n labelColor,\n } = useVariantStyleMap(variant, color);\n\n const iconProps = {\n fill: iconColor,\n opacity: isLoading ? 0 : 1,\n };\n\n const startIcon = startIconProp ? (\n <View style={styles.iconContainer}>\n {cloneElementSafely(startIconProp, iconProps)}\n </View>\n ) : null;\n\n const endIcon = endIconProp ? (\n <View style={styles.iconContainer}>\n {cloneElementSafely(endIconProp, iconProps)}\n </View>\n ) : null;\n\n const buttonBaseStyle = css([\n styles.root,\n containerStyle,\n styles[size],\n (variant === 'capsuleSolid' || variant === 'capsuleOutlined') && size === 'small' ? { paddingHorizontal: 12 } : undefined,\n fullWidth ? styles.fullWidth : undefined,\n disableMinWidth ? { minWidth: 0 } : undefined,\n disablePadding ? { paddingHorizontal: 0, paddingVertical: 0 } : undefined,\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (_) => fontStyleMap[size],\n color: labelColor,\n });\n\n const textStyle = css([\n fontStyle,\n {\n opacity: isLoading ? 0 : 1,\n textAlign: 'center',\n },\n ]);\n\n const modifiedPressEffect = variant !== 'text' && !pressEffect\n ? 'scale'\n : pressEffect;\n\n const handlePress = async () => {\n if (disabled) {\n return;\n }\n if (onPress) {\n onPress();\n return;\n }\n if (href) {\n if (await Linking.canOpenURL(href)) {\n await Linking.openURL(href);\n }\n }\n };\n\n const loadingSpinnerColor = getLoadingSpinnerColor(variant, color);\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={buttonBaseStyle}\n pressEffect={modifiedPressEffect}\n {...otherProps}\n >\n {startIcon}\n\n <Text style={textStyle}>\n {children}\n </Text>\n\n {endIcon}\n\n {isLoading ? (\n <LoadingSpinner\n color={loadingSpinnerColor}\n size={size}\n style={styles.loadingSpinner}\n />\n ) : null}\n </ButtonBase>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;AAIA,MAAMA,SAAkC,GAAG,YAA0B;EACjE,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,YAAY,EAAEJ,KAAK,CAACK,KAAN,CAAYC,MAAZ,CAAmBC,EAF/B;MAGFC,aAAa,EAAE,KAHb;MAIFC,cAAc,EAAE,QAJd;MAKFC,SAAS,EAAE;IALT,CADH;IAQHC,SAAS,EAAE;MACPC,KAAK,EAAE;IADA,CARR;IAWHC,KAAK,EAAE;MACHC,GAAG,EAAE,CADF;MAEHC,QAAQ,EAAE,GAFP;MAGHC,iBAAiB,EAAE,EAHhB;MAIHC,eAAe,EAAE;IAJd,CAXJ;IAiBHC,MAAM,EAAE;MACJJ,GAAG,EAAE,CADD;MAEJC,QAAQ,EAAE,EAFN;MAGJC,iBAAiB,EAAE,EAHf;MAIJC,eAAe,EAAE;IAJb,CAjBL;IAuBHE,KAAK,EAAE;MACHJ,QAAQ,EAAE,EADP;MAEHC,iBAAiB,EAAE,EAFhB;MAGHC,eAAe,EAAE;IAHd,CAvBJ;IA4BHG,cAAc,EAAE;MACZC,QAAQ,EAAE;IADE,CA5Bb;IA+BHC,aAAa,EAAE;MACXC,UAAU,EAAE;IADD;EA/BZ,CAAP;AAmCH,CAtCD;;AAwCA,MAAMC,YAA2C,GAAG;EAChDX,KAAK,EAAE,IAAAY,oBAAA,EAAa;IAChBC,QAAQ,EAAE,EADM;IAEhBC,UAAU,EAAE,EAFI;IAGhBC,UAAU,EAAE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Y,CAACuB,IAAD,CADQ;IAErCf,KAAK,EAAEyB;EAF8B,CAAvB,CAAlB;EAKA,MAAMa,SAAS,GAAG,IAAAN,YAAA,EAAI,CAClBE,SADkB,EAElB;IACIL,OAAO,EAAEjB,SAAS,GAAG,CAAH,GAAO,CAD7B;IAEI2B,SAAS,EAAE;EAFf,CAFkB,CAAJ,CAAlB;EAQA,MAAMC,mBAAmB,GAAGzC,OAAO,KAAK,MAAZ,IAAsB,CAACe,WAAvB,GACtB,OADsB,GAEtBA,WAFN;;EAIA,MAAM2B,WAAW,GAAG,YAAY;IAC5B,IAAIpC,QAAJ,EAAc;MACV;IACH;;IACD,IAAIQ,OAAJ,EAAa;MACTA,OAAO;MACP;IACH;;IACD,IAAIF,IAAJ,EAAU;MACN,IAAI,MAAM+B,oBAAA,CAAQC,UAAR,CAAmBhC,IAAnB,CAAV,EAAoC;QAChC,MAAM+B,oBAAA,CAAQE,OAAR,CAAgBjC,IAAhB,CAAN;MACH;IACJ;EACJ,CAbD;;EAeA,MAAMkC,mBAAmB,GAAG/C,sBAAsB,CAACC,OAAD,EAAUC,KAAV,CAAlD;EAEA,oBACI,6BAAC,mBAAD;IACI,QAAQ,EAAEK,QADd;IAEI,OAAO,EAAEoC,WAFb;IAGI,KAAK,EAAEV,eAHX;IAII,WAAW,EAAES;EAJjB,GAKQpB,UALR,GAOKJ,SAPL,eASI,6BAAC,iBAAD;IAAM,KAAK,EAAEsB;EAAb,GACKnC,QADL,CATJ,EAaKM,OAbL,EAeKG,SAAS,gBACN,6BAAC,qBAAD;IACI,KAAK,EAAEiC,mBADX;IAEI,IAAI,EAAE9B,IAFV;IAGI,KAAK,EAAEM,MAAM,CAACjC;EAHlB,EADM,GAMN,IArBR,CADJ;AAyBH;;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["buttonColors","buttonSizes","buttonVariants"],"sources":["ButtonProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ButtonBaseProps } from '../ButtonBase';\nimport type { OverridableComponentProps } from '../types';\n\nexport const buttonColors = [\n 'accent',\n 'primary',\n 'danger',\n 'disabled',\n 'secondary',\n 'accentAlt',\n] as const;\nexport type ButtonColor = typeof buttonColors[number];\n\nexport const buttonSizes = [\n 'small',\n 'medium',\n 'large',\n] as const;\nexport type ButtonSize = typeof buttonSizes[number];\n\nexport const buttonVariants = [\n 'solid',\n 'outlined',\n 'text',\n 'capsuleSolid',\n 'capsuleOutlined',\n] as const;\nexport type ButtonVariant = typeof buttonVariants[number];\n\nexport default interface ButtonProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * The content of the button.\n */\n children: string;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'primary'\n */\n color?: ButtonColor;\n\n /**\n * Determines whether minWidth should be applied.\n * @default false\n */\n disableMinWidth?: boolean;\n\n /**\n * Element placed after the children.\n */\n endIcon?: React.ReactElement;\n\n /**\n * If `true`, the button will take up the full width of its container.\n * @default false\n */\n fullWidth?: boolean;\n\n /**\n * The URL to link to when the button is clicked.\n */\n href?: string;\n\n /**\n * Determines whether to show the loading status or not.\n * @default false\n */\n isLoading?: boolean;\n\n /**\n * The size of the button.\n * @default 'medium'\n */\n size?: ButtonSize;\n\n /**\n * Element placed before the children.\n */\n startIcon?: React.ReactElement;\n\n /**\n * The variant to use.\n * @default 'solid'\n */\n variant?: ButtonVariant;\n}> {}\n"],"mappings":";;;;;;AAIO,MAAMA,YAAY,GAAG,CACxB,QADwB,EAExB,SAFwB,EAGxB,QAHwB,EAIxB,UAJwB,EAKxB,WALwB,EAMxB,WANwB,CAArB;;AAUA,MAAMC,WAAW,GAAG,CACvB,OADuB,EAEvB,QAFuB,EAGvB,OAHuB,CAApB;;AAOA,MAAMC,cAAc,GAAG,CAC1B,OAD0B,EAE1B,UAF0B,EAG1B,MAH0B,EAI1B,cAJ0B,EAK1B,iBAL0B,CAAvB"}
1
+ {"version":3,"names":["buttonColors","buttonSizes","buttonVariants"],"sources":["ButtonProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ButtonBaseProps } from '../ButtonBase';\nimport type { OverridableComponentProps } from '../types';\n\nexport const buttonColors = [\n 'accent',\n 'primary',\n 'danger',\n 'disabled',\n 'secondary',\n 'accentAlt',\n] as const;\nexport type ButtonColor = typeof buttonColors[number];\n\nexport const buttonSizes = [\n 'small',\n 'medium',\n 'large',\n] as const;\nexport type ButtonSize = typeof buttonSizes[number];\n\nexport const buttonVariants = [\n 'solid',\n 'outlined',\n 'text',\n 'capsuleSolid',\n 'capsuleOutlined',\n] as const;\nexport type ButtonVariant = typeof buttonVariants[number];\n\nexport default interface ButtonProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * The content of the button.\n */\n children: string;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'primary'\n */\n color?: ButtonColor;\n\n /**\n * Determines whether minWidth should be applied.\n * @default false\n */\n disableMinWidth?: boolean;\n\n /**\n * Determines whether padding should be applied.\n * @default false\n */\n disablePadding?: boolean;\n\n /**\n * Element placed after the children.\n */\n endIcon?: React.ReactElement;\n\n /**\n * If `true`, the button will take up the full width of its container.\n * @default false\n */\n fullWidth?: boolean;\n\n /**\n * The URL to link to when the button is clicked.\n */\n href?: string;\n\n /**\n * Determines whether to show the loading status or not.\n * @default false\n */\n isLoading?: boolean;\n\n /**\n * The size of the button.\n * @default 'medium'\n */\n size?: ButtonSize;\n\n /**\n * Element placed before the children.\n */\n startIcon?: React.ReactElement;\n\n /**\n * The variant to use.\n * @default 'solid'\n */\n variant?: ButtonVariant;\n}> {}\n"],"mappings":";;;;;;AAIO,MAAMA,YAAY,GAAG,CACxB,QADwB,EAExB,SAFwB,EAGxB,QAHwB,EAIxB,UAJwB,EAKxB,WALwB,EAMxB,WANwB,CAArB;;AAUA,MAAMC,WAAW,GAAG,CACvB,OADuB,EAEvB,QAFuB,EAGvB,OAHuB,CAApB;;AAOA,MAAMC,cAAc,GAAG,CAC1B,OAD0B,EAE1B,UAF0B,EAG1B,MAH0B,EAI1B,cAJ0B,EAK1B,iBAL0B,CAAvB"}
@@ -162,6 +162,15 @@ function useVariantStyleMap(variant, color) {
162
162
  },
163
163
  labelColor: theme.palette.status.disabledLabel,
164
164
  iconColor: theme.palette.status.disabledLabel
165
+ },
166
+ accent: {
167
+ container: {
168
+ borderColor: theme.palette.border.accent,
169
+ borderRadius: theme.shape.radius.full,
170
+ borderWidth: 1
171
+ },
172
+ labelColor: theme.palette.text.accent,
173
+ iconColor: theme.palette.icon.accent
165
174
  }
166
175
  }
167
176
  };
@@ -1 +1 @@
1
- {"version":3,"names":["useVariantStyleMap","variant","color","theme","useTheme","useMemo","palette","variantStyleMap","solid","accent","container","backgroundColor","fill","labelColor","commonColors","static","strongInverse","iconColor","primary","base","text","icon","danger","status","disabled","onDisabled","outlined","borderColor","border","borderWidth","disabledLabel","strong","secondary","accentAlt","capsuleSolid","borderRadius","shape","radius","full","capsuleOutlined","process","env","NODE_ENV","console","warn"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { commonColors } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { ButtonColor, ButtonVariant } from './ButtonProps';\n\ntype UseVariantStyleMapReturns = {\n container?: FountainUiStyle;\n iconColor?: string;\n labelColor?: string;\n}\n\ntype VariantStyleMap = {\n [variant in ButtonVariant]: {\n [color in ButtonColor]?: UseVariantStyleMapReturns;\n }\n};\n\nexport default function useVariantStyleMap(variant: ButtonVariant, color: ButtonColor): UseVariantStyleMapReturns {\n const theme = useTheme();\n\n return useMemo(() => {\n const { palette } = theme;\n\n const variantStyleMap: VariantStyleMap = {\n solid: {\n accent: {\n container: {\n backgroundColor: palette.fill.accent,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n primary: {\n container: {\n backgroundColor: palette.fill.base,\n },\n labelColor: palette.text.strongInverse,\n iconColor: palette.icon.strongInverse,\n },\n danger: {\n container: {\n backgroundColor: palette.status.danger,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n disabled: {\n container: {\n backgroundColor: palette.status.disabled,\n },\n labelColor: palette.status.onDisabled,\n iconColor: palette.status.onDisabled,\n },\n },\n outlined: {\n accent: {\n container: {\n borderColor: palette.border.accent,\n borderWidth: 1,\n },\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n primary: {\n container: {\n borderColor: palette.border.base,\n borderWidth: 1,\n },\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n disabled: {\n container: {\n borderColor: palette.status.disabled,\n borderWidth: 1,\n },\n labelColor: palette.status.disabledLabel,\n iconColor: palette.status.disabledLabel,\n },\n },\n text: {\n primary: {\n labelColor: palette.text.strong,\n iconColor: palette.icon.strong,\n },\n secondary: {\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n accent: {\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n accentAlt: {\n labelColor: palette.text.accentAlt,\n iconColor: palette.icon.accentAlt,\n },\n danger: {\n labelColor: palette.status.danger,\n iconColor: palette.status.danger,\n },\n disabled: {\n labelColor: palette.status.disabledLabel,\n iconColor: palette.status.disabledLabel,\n },\n },\n capsuleSolid: {\n accent: {\n container: {\n backgroundColor: theme.palette.fill.accent,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n primary: {\n container: {\n backgroundColor: theme.palette.fill.base,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: palette.text.strongInverse,\n iconColor: palette.icon.strongInverse,\n },\n danger: {\n container: {\n backgroundColor: theme.palette.status.danger,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n secondary: {\n container: {\n backgroundColor: commonColors.static.strongInverse,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: theme.palette.text.strong,\n iconColor: theme.palette.icon.strong,\n },\n disabled: {\n container: {\n backgroundColor: theme.palette.status.disabled,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: theme.palette.status.onDisabled,\n iconColor: theme.palette.status.onDisabled,\n },\n },\n capsuleOutlined: {\n primary: {\n container: {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.text.strong,\n iconColor: theme.palette.icon.strong,\n },\n disabled: {\n container: {\n borderColor: theme.palette.status.disabled,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.status.disabledLabel,\n iconColor: theme.palette.status.disabledLabel,\n },\n },\n };\n\n if (variantStyleMap[variant]?.[color]) {\n return variantStyleMap[variant][color] as UseVariantStyleMapReturns;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n console.warn('The selected color is not supported for the chosen variant.');\n }\n\n return {};\n }, [theme, variant, color]);\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAee,SAASA,kBAAT,CAA4BC,OAA5B,EAAoDC,KAApD,EAAmG;EAC9G,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAQ,MAAM;IAAA;;IACjB,MAAM;MAAEC;IAAF,IAAcH,KAApB;IAEA,MAAMI,eAAgC,GAAG;MACrCC,KAAK,EAAE;QACHC,MAAM,EAAE;UACJC,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACM,IAAR,CAAaH;UADvB,CADP;UAIJI,UAAU,EAAEC,oBAAA,CAAaC,MAAb,CAAoBC,aAJ5B;UAKJC,SAAS,EAAEH,oBAAA,CAAaC,MAAb,CAAoBC;QAL3B,CADL;QAQHE,OAAO,EAAE;UACLR,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACM,IAAR,CAAaO;UADvB,CADN;UAILN,UAAU,EAAEP,OAAO,CAACc,IAAR,CAAaJ,aAJpB;UAKLC,SAAS,EAAEX,OAAO,CAACe,IAAR,CAA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,KAAK,CAACiC,KAAN,CAAYC,MAAZ,CAAmBC,IAF1B;YAGPT,WAAW,EAAE;UAHN,CADN;UAMLhB,UAAU,EAAEV,KAAK,CAACG,OAAN,CAAcc,IAAd,CAAmBW,MAN1B;UAOLd,SAAS,EAAEd,KAAK,CAACG,OAAN,CAAce,IAAd,CAAmBU;QAPzB,CADI;QAUbP,QAAQ,EAAE;UACNd,SAAS,EAAE;YACPiB,WAAW,EAAExB,KAAK,CAACG,OAAN,CAAciB,MAAd,CAAqBC,QAD3B;YAEPW,YAAY,EAAEhC,KAAK,CAACiC,KAAN,CAAYC,MAAZ,CAAmBC,IAF1B;YAGPT,WAAW,EAAE;UAHN,CADL;UAMNhB,UAAU,EAAEV,KAAK,CAACG,OAAN,CAAciB,MAAd,CAAqBO,aAN3B;UAONb,SAAS,EAAEd,KAAK,CAACG,OAAN,CAAciB,MAAd,CAAqBO;QAP1B;MAVG;IA7HoB,CAAzC;;IAmJA,6BAAIvB,eAAe,CAACN,OAAD,CAAnB,kDAAI,sBAA2BC,KAA3B,CAAJ,EAAuC;MACnC,OAAOK,eAAe,CAACN,OAAD,CAAf,CAAyBC,KAAzB,CAAP;IACH;;IAED,IAAIsC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;MACvCC,OAAO,CAACC,IAAR,CAAa,6DAAb;IACH;;IAED,OAAO,EAAP;EACH,CA/JM,EA+JJ,CAACzC,KAAD,EAAQF,OAAR,EAAiBC,KAAjB,CA/JI,CAAP;AAgKH"}
1
+ {"version":3,"names":["useVariantStyleMap","variant","color","theme","useTheme","useMemo","palette","variantStyleMap","solid","accent","container","backgroundColor","fill","labelColor","commonColors","static","strongInverse","iconColor","primary","base","text","icon","danger","status","disabled","onDisabled","outlined","borderColor","border","borderWidth","disabledLabel","strong","secondary","accentAlt","capsuleSolid","borderRadius","shape","radius","full","capsuleOutlined","process","env","NODE_ENV","console","warn"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { commonColors } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { ButtonColor, ButtonVariant } from './ButtonProps';\n\ntype UseVariantStyleMapReturns = {\n container?: FountainUiStyle;\n iconColor?: string;\n labelColor?: string;\n}\n\ntype VariantStyleMap = {\n [variant in ButtonVariant]: {\n [color in ButtonColor]?: UseVariantStyleMapReturns;\n }\n};\n\nexport default function useVariantStyleMap(variant: ButtonVariant, color: ButtonColor): UseVariantStyleMapReturns {\n const theme = useTheme();\n\n return useMemo(() => {\n const { palette } = theme;\n\n const variantStyleMap: VariantStyleMap = {\n solid: {\n accent: {\n container: {\n backgroundColor: palette.fill.accent,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n primary: {\n container: {\n backgroundColor: palette.fill.base,\n },\n labelColor: palette.text.strongInverse,\n iconColor: palette.icon.strongInverse,\n },\n danger: {\n container: {\n backgroundColor: palette.status.danger,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n disabled: {\n container: {\n backgroundColor: palette.status.disabled,\n },\n labelColor: palette.status.onDisabled,\n iconColor: palette.status.onDisabled,\n },\n },\n outlined: {\n accent: {\n container: {\n borderColor: palette.border.accent,\n borderWidth: 1,\n },\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n primary: {\n container: {\n borderColor: palette.border.base,\n borderWidth: 1,\n },\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n disabled: {\n container: {\n borderColor: palette.status.disabled,\n borderWidth: 1,\n },\n labelColor: palette.status.disabledLabel,\n iconColor: palette.status.disabledLabel,\n },\n },\n text: {\n primary: {\n labelColor: palette.text.strong,\n iconColor: palette.icon.strong,\n },\n secondary: {\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n accent: {\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n accentAlt: {\n labelColor: palette.text.accentAlt,\n iconColor: palette.icon.accentAlt,\n },\n danger: {\n labelColor: palette.status.danger,\n iconColor: palette.status.danger,\n },\n disabled: {\n labelColor: palette.status.disabledLabel,\n iconColor: palette.status.disabledLabel,\n },\n },\n capsuleSolid: {\n accent: {\n container: {\n backgroundColor: theme.palette.fill.accent,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n primary: {\n container: {\n backgroundColor: theme.palette.fill.base,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: palette.text.strongInverse,\n iconColor: palette.icon.strongInverse,\n },\n danger: {\n container: {\n backgroundColor: theme.palette.status.danger,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n secondary: {\n container: {\n backgroundColor: commonColors.static.strongInverse,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: theme.palette.text.strong,\n iconColor: theme.palette.icon.strong,\n },\n disabled: {\n container: {\n backgroundColor: theme.palette.status.disabled,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: theme.palette.status.onDisabled,\n iconColor: theme.palette.status.onDisabled,\n },\n },\n capsuleOutlined: {\n primary: {\n container: {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.text.strong,\n iconColor: theme.palette.icon.strong,\n },\n disabled: {\n container: {\n borderColor: theme.palette.status.disabled,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.status.disabledLabel,\n iconColor: theme.palette.status.disabledLabel,\n },\n accent: {\n container: {\n borderColor: theme.palette.border.accent,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.text.accent,\n iconColor: theme.palette.icon.accent,\n },\n },\n };\n\n if (variantStyleMap[variant]?.[color]) {\n return variantStyleMap[variant][color] as UseVariantStyleMapReturns;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n console.warn('The selected color is not supported for the chosen variant.');\n }\n\n return {};\n }, [theme, variant, color]);\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAee,SAASA,kBAAT,CAA4BC,OAA5B,EAAoDC,KAApD,EAAmG;EAC9G,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAQ,MAAM;IAAA;;IACjB,MAAM;MAAEC;IAAF,IAAcH,KAApB;IAEA,MAAMI,eAAgC,GAAG;MACrCC,KAAK,EAAE;QACHC,MAAM,EAAE;UACJC,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACM,IAAR,CAAaH;UADvB,CADP;UAIJI,UAAU,EAAEC,oBAAA,CAAaC,MAAb,CAAoBC,aAJ5B;UAKJC,SAAS,EAAEH,oBAAA,CAAaC,MAAb,CAAoBC;QAL3B,CADL;QAQHE,OAAO,EAAE;UACLR,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACM,IAAR,CAAaO;UADvB,CADN;UAILN,UAAU,EAAEP,OAAO,CAACc,IAAR,CAAaJ,aAJpB;UAKLC,SAAS,EAAEX,OAAO,CAACe,IAAR,CAAaL;QALnB,CARN;QAeHM,MAAM,EAAE;UACJZ,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACiB,MAAR,CAAeD;UADzB,CADP;UAIJT,UAAU,EAAEC,oBAAA,CAAaC,MAAb,CAAoBC,aAJ5B;UAKJC,SAAS,EAAEH,oBAAA,CAAaC,MAAb,CAAoBC;QAL3B,CAfL;QAsBHQ,QAAQ,EAAE;UACNd,SAAS,EAAE;YACPC,eAAe,EAAEL,OAAO,CAACiB,MAAR,CAAeC;UADzB,CADL;UAINX,UAAU,EAAEP,OAAO,CAACiB,MAAR,CAAeE,UAJrB;UAKNR,SAAS,EAAEX,OAAO,CAACiB,MAAR,CAAeE;QALpB;MAtBP,CAD8B;MA+BrCC,QAAQ,EAAE;QACNjB,MAAM,EAAE;UACJC,SAAS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,SAAS,EAAEd,KAAK,CAACG,OAAN,CAAciB,MAAd,CAAqBO;QAP1B,CAVG;QAmBbrB,MAAM,EAAE;UACJC,SAAS,EAAE;YACPiB,WAAW,EAAExB,KAAK,CAACG,OAAN,CAAcsB,MAAd,CAAqBnB,MAD3B;YAEP0B,YAAY,EAAEhC,KAAK,CAACiC,KAAN,CAAYC,MAAZ,CAAmBC,IAF1B;YAGPT,WAAW,EAAE;UAHN,CADP;UAMJhB,UAAU,EAAEV,KAAK,CAACG,OAAN,CAAcc,IAAd,CAAmBX,MAN3B;UAOJQ,SAAS,EAAEd,KAAK,CAACG,OAAN,CAAce,IAAd,CAAmBZ;QAP1B;MAnBK;IA7HoB,CAAzC;;IA4JA,6BAAIF,eAAe,CAACN,OAAD,CAAnB,kDAAI,sBAA2BC,KAA3B,CAAJ,EAAuC;MACnC,OAAOK,eAAe,CAACN,OAAD,CAAf,CAAyBC,KAAzB,CAAP;IACH;;IAED,IAAIsC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;MACvCC,OAAO,CAACC,IAAR,CAAa,6DAAb;IACH;;IAED,OAAO,EAAP;EACH,CAxKM,EAwKJ,CAACzC,KAAD,EAAQF,OAAR,EAAiBC,KAAjB,CAxKI,CAAP;AAyKH"}
@@ -26,7 +26,7 @@ const ORIGINAL_OPACITY = 1;
26
26
  exports.ORIGINAL_OPACITY = ORIGINAL_OPACITY;
27
27
  const ACTIVE_OPACITY = .65;
28
28
  const ORIGINAL_SCALE = 1;
29
- const MINIFIED_SCALE = .96; // at "node_modules/react-native/Libraries/Pressability.js"
29
+ const MINIFIED_SCALE = .98; // at "node_modules/react-native/Libraries/Pressability.js"
30
30
  // const DEFAULT_MIN_PRESS_DURATION = 130;
31
31
 
32
32
  const SCALE_EFFECT_PRESS_IN_DELAY = 130;
@@ -1 +1 @@
1
- {"version":3,"names":["ORIGINAL_OPACITY","ACTIVE_OPACITY","ORIGINAL_SCALE","MINIFIED_SCALE","SCALE_EFFECT_PRESS_IN_DELAY","OPACITY_EFFECT_PRESS_IN_DELAY","startTimingAnimationWithDefaults","value","toValue","Animated","timing","duration","useNativeDriver","isNotAndroid12","start","ButtonBase","props","children","disabled","disableThrottle","onPress","_onPress","onPressOut","pressEffect","pressDelay","pressDelayOrNil","style","styleProp","throttleMillis","otherProps","useCallback","handlePress","useThrottle","periodMillis","callback","opacity","useAnimatedValue","scale","startScaleAnimation","pressIn","isHover","startOpacityAnimation","setValue","startPressAnimation","handlePressIn","handlePressOut","animatedStyle","transform","defaultPressDelay","hovered","undefined"],"sources":["ButtonBase.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\nimport { Animated } from 'react-native';\nimport { useAnimatedValue, useThrottle } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\nimport { AnimatedPressable } from '../animated';\nimport type ButtonBaseProps from './ButtonBaseProps';\n\ninterface StartPressAnimation {\n (pressIn: boolean, isHover: boolean): void;\n}\n\nexport const ORIGINAL_OPACITY = 1;\nconst ACTIVE_OPACITY = .65;\n\nconst ORIGINAL_SCALE = 1;\nconst MINIFIED_SCALE = .96;\n\n// at \"node_modules/react-native/Libraries/Pressability.js\"\n// const DEFAULT_MIN_PRESS_DURATION = 130;\nconst SCALE_EFFECT_PRESS_IN_DELAY = 130;\nconst OPACITY_EFFECT_PRESS_IN_DELAY = 0;\n\ntype TimingAnimationValue = Animated.Value | Animated.ValueXY;\ntype TimingAnimationToValue = Animated.TimingAnimationConfig['toValue'];\n\nconst startTimingAnimationWithDefaults = (\n value: TimingAnimationValue,\n toValue: TimingAnimationToValue,\n) => {\n Animated.timing(value, {\n toValue,\n duration: 150,\n useNativeDriver: isNotAndroid12,\n }).start();\n};\n\nexport default function ButtonBase(props: ButtonBaseProps) {\n const {\n children,\n disabled = false,\n disableThrottle = false,\n onPress: _onPress,\n onPressOut,\n pressEffect = 'opacity',\n pressDelay: pressDelayOrNil,\n style: styleProp,\n throttleMillis = 650,\n ...otherProps\n } = props;\n\n const onPress = useCallback(() => _onPress?.(), [_onPress]);\n const handlePress = useThrottle({\n periodMillis: disableThrottle ? 0 : throttleMillis,\n callback: onPress,\n });\n\n const opacity = useAnimatedValue(ORIGINAL_OPACITY);\n const scale = useAnimatedValue(ORIGINAL_SCALE);\n\n const startScaleAnimation = useCallback<StartPressAnimation>((pressIn, isHover) => {\n if (!isHover) {\n startTimingAnimationWithDefaults(\n scale,\n pressIn ? MINIFIED_SCALE : ORIGINAL_SCALE,\n );\n }\n }, []);\n\n const startOpacityAnimation = useCallback<StartPressAnimation>((pressIn) => {\n if (pressIn) {\n opacity.setValue(ACTIVE_OPACITY);\n } else {\n startTimingAnimationWithDefaults(opacity, ORIGINAL_OPACITY);\n }\n }, []);\n\n const startPressAnimation = useCallback<StartPressAnimation>((pressIn, isHover = false) => {\n if (pressEffect === 'scale') {\n startScaleAnimation(pressIn, isHover);\n } else if (pressEffect === 'opacity') {\n startOpacityAnimation(pressIn, isHover);\n }\n }, [pressEffect]);\n\n const handlePressIn = useCallback(() => {\n startPressAnimation(true, false);\n }, [startPressAnimation]);\n\n const handlePressOut = useCallback(() => {\n onPressOut && onPressOut();\n\n startPressAnimation(false, false);\n }, [startPressAnimation, onPressOut]);\n\n const animatedStyle = {\n opacity,\n transform: [{ scale }],\n };\n\n const defaultPressDelay = pressEffect === 'scale'\n ? SCALE_EFFECT_PRESS_IN_DELAY\n : OPACITY_EFFECT_PRESS_IN_DELAY;\n const pressDelay = pressDelayOrNil ?? defaultPressDelay;\n\n return (\n <AnimatedPressable\n disabled={disabled}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n style={[\n animatedStyle,\n styleProp,\n ]}\n unstable_pressDelay={pressDelay}\n {...otherProps}\n >\n {typeof children !== 'function' ? (\n ({ hovered }) => {\n if (hovered !== undefined && !disabled) {\n startPressAnimation(hovered, true);\n }\n\n return children;\n }\n ) : children}\n </AnimatedPressable>\n );\n};\n"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;AAC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FN;EAGA,MAAMmB,UAAU,GAAGC,eAAe,IAAIuB,iBAAtC;EAEA,oBACI,6BAAC,2BAAD;IACI,QAAQ,EAAE9B,QADd;IAEI,OAAO,EAAEa,WAFb;IAGI,SAAS,EAAEa,aAHf;IAII,UAAU,EAAEC,cAJhB;IAKI,KAAK,EAAE,CACHC,aADG,EAEHnB,SAFG,CALX;IASI,mBAAmB,EAAEH;EATzB,GAUQK,UAVR,GAYK,OAAOZ,QAAP,KAAoB,UAApB,GACG,QAAiB;IAAA,IAAhB;MAAEgC;IAAF,CAAgB;;IACb,IAAIA,OAAO,KAAKC,SAAZ,IAAyB,CAAChC,QAA9B,EAAwC;MACpCyB,mBAAmB,CAACM,OAAD,EAAU,IAAV,CAAnB;IACH;;IAED,OAAOhC,QAAP;EACH,CAPJ,GAQGA,QApBR,CADJ;AAwBH;;AAAA"}
1
+ {"version":3,"names":["ORIGINAL_OPACITY","ACTIVE_OPACITY","ORIGINAL_SCALE","MINIFIED_SCALE","SCALE_EFFECT_PRESS_IN_DELAY","OPACITY_EFFECT_PRESS_IN_DELAY","startTimingAnimationWithDefaults","value","toValue","Animated","timing","duration","useNativeDriver","isNotAndroid12","start","ButtonBase","props","children","disabled","disableThrottle","onPress","_onPress","onPressOut","pressEffect","pressDelay","pressDelayOrNil","style","styleProp","throttleMillis","otherProps","useCallback","handlePress","useThrottle","periodMillis","callback","opacity","useAnimatedValue","scale","startScaleAnimation","pressIn","isHover","startOpacityAnimation","setValue","startPressAnimation","handlePressIn","handlePressOut","animatedStyle","transform","defaultPressDelay","hovered","undefined"],"sources":["ButtonBase.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\nimport { Animated } from 'react-native';\nimport { useAnimatedValue, useThrottle } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\nimport { AnimatedPressable } from '../animated';\nimport type ButtonBaseProps from './ButtonBaseProps';\n\ninterface StartPressAnimation {\n (pressIn: boolean, isHover: boolean): void;\n}\n\nexport const ORIGINAL_OPACITY = 1;\nconst ACTIVE_OPACITY = .65;\n\nconst ORIGINAL_SCALE = 1;\nconst MINIFIED_SCALE = .98;\n\n// at \"node_modules/react-native/Libraries/Pressability.js\"\n// const DEFAULT_MIN_PRESS_DURATION = 130;\nconst SCALE_EFFECT_PRESS_IN_DELAY = 130;\nconst OPACITY_EFFECT_PRESS_IN_DELAY = 0;\n\ntype TimingAnimationValue = Animated.Value | Animated.ValueXY;\ntype TimingAnimationToValue = Animated.TimingAnimationConfig['toValue'];\n\nconst startTimingAnimationWithDefaults = (\n value: TimingAnimationValue,\n toValue: TimingAnimationToValue,\n) => {\n Animated.timing(value, {\n toValue,\n duration: 150,\n useNativeDriver: isNotAndroid12,\n }).start();\n};\n\nexport default function ButtonBase(props: ButtonBaseProps) {\n const {\n children,\n disabled = false,\n disableThrottle = false,\n onPress: _onPress,\n onPressOut,\n pressEffect = 'opacity',\n pressDelay: pressDelayOrNil,\n style: styleProp,\n throttleMillis = 650,\n ...otherProps\n } = props;\n\n const onPress = useCallback(() => _onPress?.(), [_onPress]);\n const handlePress = useThrottle({\n periodMillis: disableThrottle ? 0 : throttleMillis,\n callback: onPress,\n });\n\n const opacity = useAnimatedValue(ORIGINAL_OPACITY);\n const scale = useAnimatedValue(ORIGINAL_SCALE);\n\n const startScaleAnimation = useCallback<StartPressAnimation>((pressIn, isHover) => {\n if (!isHover) {\n startTimingAnimationWithDefaults(\n scale,\n pressIn ? MINIFIED_SCALE : ORIGINAL_SCALE,\n );\n }\n }, []);\n\n const startOpacityAnimation = useCallback<StartPressAnimation>((pressIn) => {\n if (pressIn) {\n opacity.setValue(ACTIVE_OPACITY);\n } else {\n startTimingAnimationWithDefaults(opacity, ORIGINAL_OPACITY);\n }\n }, []);\n\n const startPressAnimation = useCallback<StartPressAnimation>((pressIn, isHover = false) => {\n if (pressEffect === 'scale') {\n startScaleAnimation(pressIn, isHover);\n } else if (pressEffect === 'opacity') {\n startOpacityAnimation(pressIn, isHover);\n }\n }, [pressEffect]);\n\n const handlePressIn = useCallback(() => {\n startPressAnimation(true, false);\n }, [startPressAnimation]);\n\n const handlePressOut = useCallback(() => {\n onPressOut && onPressOut();\n\n startPressAnimation(false, false);\n }, [startPressAnimation, onPressOut]);\n\n const animatedStyle = {\n opacity,\n transform: [{ scale }],\n };\n\n const defaultPressDelay = pressEffect === 'scale'\n ? SCALE_EFFECT_PRESS_IN_DELAY\n : OPACITY_EFFECT_PRESS_IN_DELAY;\n const pressDelay = pressDelayOrNil ?? defaultPressDelay;\n\n return (\n <AnimatedPressable\n disabled={disabled}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n style={[\n animatedStyle,\n styleProp,\n ]}\n unstable_pressDelay={pressDelay}\n {...otherProps}\n >\n {typeof children !== 'function' ? (\n ({ hovered }) => {\n if (hovered !== undefined && !disabled) {\n startPressAnimation(hovered, true);\n }\n\n return children;\n }\n ) : children}\n </AnimatedPressable>\n );\n};\n"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAOO,MAAMA,gBAAgB,GAAG,CAAzB;;AACP,MAAMC,cAAc,GAAG,GAAvB;AAEA,MAAMC,cAAc,GAAG,CAAvB;AACA,MAAMC,cAAc,GAAG,GAAvB,C,CAEA;AACA;;AACA,MAAMC,2BAA2B,GAAG,GAApC;AACA,MAAMC,6BAA6B,GAAG,CAAtC;;AAKA,MAAMC,gCAAgC,GAAG,CACrCC,KADqC,EAErCC,OAFqC,KAGpC;EACDC,qBAAA,CAASC,MAAT,CAAgBH,KAAhB,EAAuB;IACnBC,OADmB;IAEnBG,QAAQ,EAAE,GAFS;IAGnBC,eAAe,EAAEC;EAHE,CAAvB,EAIGC,KAJH;AAKH,CATD;;AAWe,SAASC,UAAT,CAAoBC,KAApB,EAA4C;EACvD,MAAM;IACFC,QADE;IAEFC,QAAQ,GAAG,KAFT;IAGFC,eAAe,GAAG,KAHhB;IAIFC,OAAO,EAAEC,QAJP;IAKFC,UALE;IAMFC,WAAW,GAAG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able: true,
8
8
  get: function () {
9
- return _LegacyButtonBase.default;
9
+ return _ButtonBase.default;
10
10
  }
11
11
  });
12
12
 
13
- var _LegacyButtonBase = _interopRequireDefault(require("./LegacyButtonBase"));
13
+ var _ButtonBase = _interopRequireDefault(require("./ButtonBase"));
14
14
 
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './LegacyButtonBase';\nexport type { default as ButtonBaseProps } from './ButtonBaseProps';\n"],"mappings":";;;;;;;;;;;;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './ButtonBase';\nexport type { default as ButtonBaseProps } from './ButtonBaseProps';\n"],"mappings":";;;;;;;;;;;;AAAA"}
@@ -35,6 +35,7 @@ function Checkbox(props) {
35
35
  } = props;
36
36
  const theme = (0, _styles.useTheme)();
37
37
  const {
38
+ checkboxContainerStyle,
38
39
  checkboxStyle,
39
40
  containerStyle,
40
41
  iconColor
@@ -56,12 +57,14 @@ function Checkbox(props) {
56
57
  onPress: handlePress,
57
58
  style: rootStyle
58
59
  }, otherProps), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
60
+ style: checkboxContainerStyle
61
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
59
62
  style: checkboxStyle
60
63
  }, checked ? /*#__PURE__*/_react.default.createElement(_icons.CheckboxOn, {
61
64
  fill: iconColor,
62
65
  height: 7.5,
63
66
  width: 11
64
- }) : null), children ? /*#__PURE__*/_react.default.createElement(_Row.default, {
67
+ }) : null)), children ? /*#__PURE__*/_react.default.createElement(_Row.default, {
65
68
  flexGrow: 1,
66
69
  flexShrink: 1
67
70
  }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
@@ -1 +1 @@
1
- {"version":3,"names":["Checkbox","props","checked","children","disabled","onChange","style","styleProp","variant","otherProps","theme","useTheme","checkboxStyle","containerStyle","iconColor","useVariantStyleMap","rootStyle","css","undefined","fontStyle","createFontStyle","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 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={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;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;AAEe,SAASA,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,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAM;IACFC,aADE;IAEFC,cAFE;IAGFC;EAHE,IAIF,IAAAC,2BAAA,EAAmBP,OAAnB,EAA4BN,OAA5B,CAJJ;EAMA,MAAMc,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBd,QAAQ,GAAGU,cAAH,GAAoBK,SADV,EAElBX,SAFkB,CAAJ,CAAlB;EAKA,MAAMY,SAAS,GAAG,IAAAC,uBAAA,EAAgBV,KAAhB,EAAuB;IACrCW,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,KAAX,CAAiBC,OADN;IAErCC,KAAK,EAAEf,KAAK,CAACgB,OAAN,CAAcC,IAAd,CAAmBC;EAFW,CAAvB,CAAlB;;EAKA,MAAMC,WAAW,GAAG,MAAM;IACtB,IAAIxB,QAAJ,EAAc;MACVA,QAAQ,CAAC,CAACH,OAAF,CAAR;IACH;EACJ,CAJD;;EAMA,oBACI,6BAAC,mBAAD;IACI,QAAQ,EAAEE,QADd;IAEI,OAAO,EAAEyB,WAFb;IAGI,KAAK,EAAEb;EAHX,GAIQP,UAJR,gBAMI,6BAAC,iBAAD;IAAM,KAAK,EAAEG;EAAb,GACKV,OAAO,gBACJ,6BAAC,iBAAD;IACI,IAAI,EAAEY,SADV;IAEI,MAAM,EAAE,GAFZ;IAGI,KAAK,EAAE;EAHX,EADI,GAMJ,IAPR,CANJ,EAgBKX,QAAQ,gBACL,6BAAC,YAAD;IACI,QAAQ,EAAE,CADd;IAEI,UAAU,EAAE;EAFhB,gBAII,6BAAC,iBAAD;IACI,QAAQ,EAAEA,QADd;IAEI,KAAK,EAAEgB;EAFX,EAJJ,CADK,GAUL,IA1BR,CADJ;AA8BH;;AAAA"}
1
+ {"version":3,"names":["Checkbox","props","checked","children","disabled","onChange","style","styleProp","variant","otherProps","theme","useTheme","checkboxContainerStyle","checkboxStyle","containerStyle","iconColor","useVariantStyleMap","rootStyle","css","undefined","fontStyle","createFontStyle","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;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;AAEe,SAASA,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;I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25
25
  switch (variant) {
26
26
  case 'square':
27
27
  return {
28
+ checkboxContainerStyle: {
29
+ alignSelf: 'flex-start',
30
+ paddingTop: 3
31
+ },
28
32
  checkboxStyle: (0, _styles2.css)([styles.checkbox, {
29
33
  borderColor: theme.palette.border.base,
30
34
  borderRadius: theme.shape.radius.xs,
@@ -36,9 +40,9 @@ function useVariantStyleMap(variant, checked) {
36
40
  } : {})
37
41
  }]),
38
42
  containerStyle: {
39
- alignItems: 'center',
40
43
  flexDirection: 'row',
41
- gap: theme.spacing(3)
44
+ gap: theme.spacing(3),
45
+ paddingVertical: theme.spacing(2)
42
46
  },
43
47
  iconColor: theme.palette.fill.baseAlt
44
48
  };
@@ -1 +1 @@
1
- {"version":3,"names":["styles","StyleSheet","create","checkbox","alignItems","borderWidth","justifyContent","useVariantStyleMap","variant","checked","theme","useTheme","checkboxStyle","css","borderColor","palette","border","base","borderRadius","shape","radius","xs","height","width","backgroundColor","fill","containerStyle","flexDirection","gap","spacing","iconColor","baseAlt","full","accent","borderBottomColor","weak","borderBottomWidth","paddingVertical","commonColors","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;;AACA;;AACA;;AAGA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC7BC,QAAQ,EAAE;IACNC,UAAU,EAAE,QADN;IAENC,WAAW,EAAE,CAFP;IAGNC,cAAc,EAAE;EAHV;AADmB,CAAlB,CAAf;;AAce,SAASC,kBAAT,CAA4BC,OAA5B,EAAsDC,OAAtD,EAAmG;EAC9G,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;;EAEA,QAAQH,OAAR;IACI,KAAK,QAAL;MACI,OAAO;QACHI,aAAa,EAAE,IAAAC,YAAA,EAAI,CACfb,MAAM,CAACG,QADQ,EAEf;UACIW,WAAW,EAAEJ,KAAK,CAACK,OAAN,CAAcC,MAAd,CAAqBC,IADtC;UAEIC,YAAY,EAAER,KAAK,CAACS,KAAN,CAAYC,MAAZ,CAAmBC,EAFrC;UAGIC,MAAM,EAAE,EAHZ;UAIIC,KAAK,EAAE,EAJX;UAKI,IAAId,OAAO,GAAG;YACVe,eAAe,EAAEd,KAAK,CAACK,OAAN,CAAcU,IAAd,CAAmBR,IAD1B;YAEVH,WAAW,EAAEJ,KAAK,CAACK,OAAN,CAAcU,IAAd,CAAmBR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ked","theme","useTheme","checkboxContainerStyle","alignSelf","paddingTop","checkboxStyle","css","borderColor","palette","border","base","borderRadius","shape","radius","xs","height","width","backgroundColor","fill","containerStyle","flexDirection","gap","spacing","paddingVertical","iconColor","baseAlt","full","accent","borderBottomColor","weak","borderBottomWidth","commonColors","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),\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K,OAAL;MACI,OAAO;QACHpB,aAAa,EAAE,IAAAC,YAAA,EAAI,CACfhB,MAAM,CAACG,QADQ,EAEf;UACIc,WAAW,EAAEP,KAAK,CAACQ,OAAN,CAAcC,MAAd,CAAqBC,IADtC;UAEIC,YAAY,EAAEX,KAAK,CAACY,KAAN,CAAYC,MAAZ,CAAmBa,IAFrC;UAGIX,MAAM,EAAE,EAHZ;UAIIC,KAAK,EAAE,EAJX;UAKI,IAAIjB,OAAO,GAAG;YACVkB,eAAe,EAAEjB,KAAK,CAACQ,OAAN,CAAcU,IAAd,CAAmBS,MAD1B;YAEVpB,WAAW,EAAEP,KAAK,CAACQ,OAAN,CAAcU,IAAd,CAAmBS;UAFtB,CAAH,GAGP,EAHJ;QALJ,CAFe,CAAJ,CADZ;QAcHR,cAAc,EAAE;UACZzB,UAAU,EAAE,QADA;UAEZkC,iBAAiB,EAAE5B,KAAK,CAACQ,OAAN,CAAcC,MAAd,CAAqBoB,IAF5B;UAGZC,iBAAiB,EAAE,GAHP;UAIZV,aAAa,EAAE,aAJH;UAKZC,GAAG,EAAErB,KAAK,CAACsB,OAAN,CAAc,CAAd,CALO;UAMZC,eAAe,EAAEvB,KAAK,CAACsB,OAAN,CAAc,GAAd;QANL,CAdb;QAsBHE,SAAS,EAAEO,oBAAA,CAAaC,MAAb,CAAoBC;MAtB5B,CAAP;;IAwBJ;MACI,OAAO,EAAP;EArDR;AAuDH"}
@@ -9,12 +9,14 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _reactNative = require("react-native");
11
11
 
12
+ var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
13
+
14
+ var _internal = require("../internal");
15
+
12
16
  var _styles = require("../styles");
13
17
 
14
18
  var _utils = require("../utils");
15
19
 
16
- var _ButtonBase = _interopRequireDefault(require("../ButtonBase/ButtonBase"));
17
-
18
20
  var _useChipStyle = _interopRequireDefault(require("./useChipStyle"));
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -24,9 +26,10 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
24
26
  function Chip(props) {
25
27
  const {
26
28
  children,
27
- endElement: endElementProp,
29
+ color = 'default',
28
30
  numberOfLines,
29
31
  onPress,
32
+ selected = false,
30
33
  size = 'small',
31
34
  startElement: startElementProp,
32
35
  startElementVariant = 'default',
@@ -35,26 +38,34 @@ function Chip(props) {
35
38
  } = props;
36
39
  const {
37
40
  container: containerStyle,
38
- endElement: endElementStyle,
41
+ closeButtonContainer: closeButtonContainerStyle,
42
+ closeIconSize,
39
43
  label: labelStyle,
40
- startElement: startElementStyle
41
- } = (0, _useChipStyle.default)(size, startElementVariant, !!endElementProp);
44
+ startElement: startElementStyle,
45
+ startElementContainer: startElementContainerStyle
46
+ } = (0, _useChipStyle.default)(size, startElementVariant, color, selected);
42
47
  const chipStyle = (0, _styles.css)([containerStyle, styleProp]);
43
- const startElement = startElementVariant === 'icon' ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
44
- style: startElementStyle
45
- }, (0, _utils.cloneElementSafely)(startElementProp)) : (0, _utils.cloneElementSafely)(startElementProp, {
48
+
49
+ const startElement = /*#__PURE__*/_react.default.createElement(_reactNative.View, {
50
+ style: startElementContainerStyle
51
+ }, (0, _utils.cloneElementSafely)(startElementProp, {
46
52
  style: startElementStyle
47
- });
48
- const endElement = (0, _utils.cloneElementSafely)(endElementProp, {
49
- style: endElementStyle
50
- });
53
+ }));
54
+
51
55
  return /*#__PURE__*/_react.default.createElement(_ButtonBase.default, _extends({
56
+ disabled: !onPress,
52
57
  onPress: onPress,
53
58
  style: chipStyle
54
59
  }, otherProps), startElement, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
55
60
  children: children,
56
61
  numberOfLines: numberOfLines,
57
62
  style: labelStyle
58
- }), endElement);
63
+ }), selected ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
64
+ style: closeButtonContainerStyle
65
+ }, /*#__PURE__*/_react.default.createElement(_internal.ChipClose, {
66
+ color: 'baseInverse',
67
+ height: closeIconSize === null || closeIconSize === void 0 ? void 0 : closeIconSize.height,
68
+ width: closeIconSize === null || closeIconSize === void 0 ? void 0 : closeIconSize.width
69
+ })) : null);
59
70
  }
60
71
  //# sourceMappingURL=Chip.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Chip","props","children","endElement","endElementProp","numberOfLines","onPress","size","startElement","startElementProp","startElementVariant","style","styleProp","otherProps","container","containerStyle","endElementStyle","label","labelStyle","startElementStyle","useChipStyle","chipStyle","css","cloneElementSafely"],"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 numberOfLines={numberOfLines}\n style={labelStyle}\n />\n\n {endElement}\n </ButtonBase>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;AAEe,SAASA,IAAT,CAAcC,KAAd,EAAgC;EAC3C,MAAM;IACFC,QADE;IAEFC,UAAU,EAAEC,cAFV;IAGFC,aAHE;IAIFC,OAJE;IAKFC,IAAI,GAAG,OALL;IAMFC,YAAY,EAAEC,gBANZ;IAOFC,mBAAmB,GAAG,SAPpB;IAQFC,KAAK,EAAEC,SARL;IASF,GAAGC;EATD,IAUFZ,KAVJ;EAYA,MAAM;IACFa,SAAS,EAAEC,cADT;IAEFZ,UAAU,EAAEa,eAFV;IAGFC,KAAK,EAAEC,UAHL;IAIFV,YAAY,EAAEW;EAJZ,IAKF,IAAAC,qBAAA,EAAab,IAAb,EAAmBG,mBAAnB,EAAwC,CAAC,CAACN,cAA1C,CALJ;EAOA,MAAMiB,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBP,cADkB,EAElBH,SAFkB,CAAJ,CAAlB;EAKA,MAAMJ,YAAY,GAAGE,mBAAmB,KAAK,MAAxB,gBAEb,6BAAC,iBAAD;IAAM,KAAK,EAAES;EAAb,GACK,IAAAI,yBAAA,EAAmBd,gBAAnB,CADL,CAFa,GAKb,IAAAc,yBAAA,EAAmBd,gBAAnB,EAAqC;IAAEE,KAAK,EAAEQ;EAAT,CAArC,CALR;EAMA,MAAMhB,UAAU,GAAG,IAAAoB,yBAAA,EAAmBnB,cAAnB,EAAmC;IAAEO,KAAK,EAAEK;EAAT,CAAnC,CAAnB;EAEA,oBACI,6BAAC,mBAAD;IACI,OAAO,EAAEV,OADb;IAEI,KAAK,EAAEe;EAFX,GAGQR,UAHR,GAKKL,YALL,eAOI,6BAAC,iBAAD;IACI,QAAQ,EAAEN,QADd;IAEI,aAAa,EAAEG,aAFnB;IAGI,KAAK,EAAEa;EAHX,EAPJ,EAaKf,UAbL,CADJ;AAiBH"}
1
+ {"version":3,"names":["Chip","props","children","color","numberOfLines","onPress","selected","size","startElement","startElementProp","startElementVariant","style","styleProp","otherProps","container","containerStyle","closeButtonContainer","closeButtonContainerStyle","closeIconSize","label","labelStyle","startElementStyle","startElementContainer","startElementContainerStyle","useChipStyle","chipStyle","css","cloneElementSafely","height","width"],"sources":["Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { ChipClose } 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 closeButtonContainer: closeButtonContainerStyle,\n closeIconSize,\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 <View style={closeButtonContainerStyle}>\n <ChipClose\n color={'baseInverse'}\n height={closeIconSize?.height}\n width={closeIconSize?.width}\n />\n </View>\n ) : null}\n </ButtonBase>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;AAEe,SAASA,IAAT,CAAcC,KAAd,EAAgC;EAC3C,MAAM;IACFC,QADE;IAEFC,KAAK,GAAG,SAFN;IAGFC,aAHE;IAIFC,OAJE;IAKFC,QAAQ,GAAG,KALT;IAMFC,IAAI,GAAG,OANL;IAOFC,YAAY,EAAEC,gBAPZ;IAQFC,mBAAmB,GAAG,SARpB;IASFC,KAAK,EAAEC,SATL;IAUF,GAAGC;EAVD,IAWFZ,KAXJ;EAaA,MAAM;IACFa,SAAS,EAAEC,cADT;IAEFC,oBAAoB,EAAEC,yBAFpB;IAGFC,aAHE;IAIFC,KAAK,EAAEC,UAJL;IAKFZ,YAAY,EAAEa,iBALZ;IAMFC,qBAAqB,EAAEC;EANrB,IAOF,IAAAC,qBAAA,EAAajB,IAAb,EAAmBG,mBAAnB,EAAwCP,KAAxC,EAA+CG,QAA/C,CAPJ;EASA,MAAMmB,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBX,cADkB,EAElBH,SAFkB,CAAJ,CAAlB;;EAKA,MAAMJ,YAAY,gBACd,6BAAC,iBAAD;IAAM,KAAK,EAAEe;EAAb,GACK,IAAAI,yBAAA,EAAmBlB,gBAAnB,EAAqC;IAAEE,KAAK,EAAEU;EAAT,CAArC,CADL,CADJ;;EAMA,oBACI,6BAAC,mBAAD;IACI,QAAQ,EAAE,CAAChB,OADf;IAEI,OAAO,EAAEA,OAFb;IAGI,KAAK,EAAEoB;EAHX,GAIQZ,UAJR,GAMKL,YANL,eAQI,6BAAC,iBAAD;IACI,QAAQ,EAAEN,QADd;IAEI,aAAa,EAAEE,aAFnB;IAGI,KAAK,EAAEgB;EAHX,EARJ,EAcKd,QAAQ,gBACL,6BAAC,iBAAD;IAAM,KAAK,EAAEW;EAAb,gBACI,6BAAC,mBAAD;IACI,KAAK,EAAE,aADX;IAEI,MAAM,EAAEC,aAAF,aAAEA,aAAF,uBAAEA,aAAa,CAAEU,MAF3B;IAGI,KAAK,EAAEV,aAAF,aAAEA,aAAF,uBAAEA,aAAa,CAAEW;EAH1B,EADJ,CADK,GAQL,IAtBR,CADJ;AA0BH"}
@@ -3,7 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.chipStartElementVariants = exports.chipSizes = void 0;
6
+ exports.chipStartElementVariants = exports.chipSizes = exports.chipColors = void 0;
7
+ const chipColors = ['default', 'white'];
8
+ exports.chipColors = chipColors;
7
9
  const chipSizes = ['large', 'small'];
8
10
  exports.chipSizes = chipSizes;
9
11
  const chipStartElementVariants = ['default', 'avatar', 'image', 'icon'];
@@ -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":";;;;;;AAIO,MAAMA,SAAS,GAAG,CAAC,OAAD,EAAU,OAAV,CAAlB;;AAGA,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":";;;;;;AAIO,MAAMA,UAAU,GAAG,CAAC,SAAD,EAAY,OAAZ,CAAnB;;AAGA,MAAMC,SAAS,GAAG,CAAC,OAAD,EAAU,OAAV,CAAlB;;AAGA,MAAMC,wBAAwB,GAAG,CAAC,SAAD,EAAY,QAAZ,EAAsB,OAAtB,EAA+B,MAA/B,CAAjC"}
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "chipColors", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _ChipProps.chipColors;
10
+ }
11
+ });
6
12
  Object.defineProperty(exports, "chipSizes", {
7
13
  enumerable: true,
8
14
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './Chip';\nexport type { default as ChipProps } from './ChipProps';\nexport { chipSizes, chipStartElementVariants } from './ChipProps';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './Chip';\nexport type { default as ChipProps } from './ChipProps';\nexport { chipColors, chipSizes, chipStartElementVariants } from './ChipProps';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA"}
@@ -9,37 +9,45 @@ var _react = require("react");
9
9
 
10
10
  var _styles = require("../styles");
11
11
 
12
- // TODO: need to refactoring...
13
- function useChipStyle(size, startElementVariant, isEndElement) {
12
+ const closeButtonContainerStyleMap = {
13
+ small: {
14
+ marginLeft: 8,
15
+ paddingTop: 1
16
+ },
17
+ large: {
18
+ marginLeft: 10,
19
+ paddingTop: 1
20
+ }
21
+ };
22
+ const closeIconSize = {
23
+ small: {
24
+ height: 14,
25
+ width: 8.17
26
+ },
27
+ large: {
28
+ height: 16,
29
+ width: 9
30
+ }
31
+ }; // TODO: need to refactoring...
32
+
33
+ function useChipStyle(size, startElementVariant, color, selected) {
14
34
  const theme = (0, _styles.useTheme)();
15
35
  return (0, _react.useMemo)(() => {
16
- var _variantStyleMap$star, _variantStyleMap$star2;
36
+ var _variantStyleMap$star, _variantStyleMap$star2, _variantStyleMap$star3;
17
37
 
18
38
  const fontStyleMap = {
19
39
  small: (0, _styles.createFontStyle)(theme, {
20
40
  selector: typography => typography.caption1.medium,
21
- color: theme.palette.text.strong
41
+ color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong
22
42
  }),
23
43
  large: (0, _styles.createFontStyle)(theme, {
24
44
  selector: typography => typography.body2.medium,
25
- color: theme.palette.text.strong
45
+ color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong
26
46
  })
27
47
  };
28
- const endElementStyleMap = {
29
- small: {
30
- height: 14,
31
- marginLeft: theme.spacing(2),
32
- width: 8.17
33
- },
34
- large: {
35
- height: 16,
36
- marginLeft: theme.spacing(2.5),
37
- width: 9
38
- }
39
- };
40
48
  const baseContainerStyle = {
41
49
  alignItems: 'center',
42
- backgroundColor: theme.palette.fill.weaker,
50
+ backgroundColor: selected ? theme.palette.fill.base : color === 'white' ? theme.palette.surface.base : theme.palette.fill.weaker,
43
51
  borderRadius: theme.shape.radius.full,
44
52
  flexDirection: 'row',
45
53
  overflow: 'hidden'
@@ -54,9 +62,11 @@ function useChipStyle(size, startElementVariant, isEndElement) {
54
62
  },
55
63
  startElement: {
56
64
  borderRadius: theme.shape.radius.full,
57
- height: isLarge ? 24 : 22,
58
- marginRight: theme.spacing(isLarge ? 1.5 : 1.25),
59
- width: isLarge ? 24 : 22
65
+ height: isLarge ? 26 : 23,
66
+ width: isLarge ? 26 : 23
67
+ },
68
+ startElementContainer: {
69
+ marginRight: theme.spacing(isLarge ? 1.5 : 1.25)
60
70
  }
61
71
  },
62
72
  icon: {
@@ -66,11 +76,16 @@ function useChipStyle(size, startElementVariant, isEndElement) {
66
76
  paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25)
67
77
  },
68
78
  startElement: {
79
+ color: selected ? theme.palette.icon.strongInverse : theme.palette.icon.strong,
80
+ height: isLarge ? 17 : 16,
81
+ width: isLarge ? 17 : 16
82
+ },
83
+ startElementContainer: {
69
84
  alignItems: 'center',
70
- height: isLarge ? 22 : 20,
85
+ height: isLarge ? 24 : 21,
71
86
  justifyContent: 'center',
72
87
  marginRight: theme.spacing(isLarge ? 1 : 0.75),
73
- width: isLarge ? 22 : 20
88
+ width: isLarge ? 24 : 21
74
89
  }
75
90
  },
76
91
  image: {
@@ -80,15 +95,18 @@ function useChipStyle(size, startElementVariant, isEndElement) {
80
95
  },
81
96
  startElement: {
82
97
  borderRadius: theme.shape.radius.full,
83
- height: isLarge ? 34 : 30,
84
- marginRight: theme.spacing(1.5),
85
- width: isLarge ? 45 : 40
98
+ height: isLarge ? 36 : 31,
99
+ width: isLarge ? 48 : 40
100
+ },
101
+ startElementContainer: {
102
+ marginRight: theme.spacing(1.5)
86
103
  }
87
104
  },
88
105
  default: {
89
106
  container: {
90
107
  paddingBottom: theme.spacing(1.75),
91
- paddingHorizontal: theme.spacing(isLarge ? 3.5 : 3),
108
+ paddingLeft: theme.spacing(isLarge ? 3.5 : 3),
109
+ paddingRight: theme.spacing(isLarge ? 3.5 : 3),
92
110
  paddingTop: theme.spacing(1.5)
93
111
  }
94
112
  }
@@ -96,14 +114,16 @@ function useChipStyle(size, startElementVariant, isEndElement) {
96
114
  return {
97
115
  container: { ...baseContainerStyle,
98
116
  ...((_variantStyleMap$star = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star === void 0 ? void 0 : _variantStyleMap$star.container),
99
- ...(isEndElement ? {
117
+ ...(selected ? {
100
118
  paddingRight: theme.spacing(isLarge ? 2.5 : 2.25)
101
119
  } : {})
102
120
  },
103
- endElement: endElementStyleMap[size],
121
+ closeButtonContainer: closeButtonContainerStyleMap[size],
122
+ closeIconSize: closeIconSize[size],
104
123
  label: fontStyleMap[size],
105
- startElement: (_variantStyleMap$star2 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star2 === void 0 ? void 0 : _variantStyleMap$star2.startElement
124
+ startElement: (_variantStyleMap$star2 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star2 === void 0 ? void 0 : _variantStyleMap$star2.startElement,
125
+ startElementContainer: (_variantStyleMap$star3 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star3 === void 0 ? void 0 : _variantStyleMap$star3.startElementContainer
106
126
  };
107
- }, [theme, size, startElementVariant]);
127
+ }, [theme, size, startElementVariant, color, selected]);
108
128
  }
109
129
  //# sourceMappingURL=useChipStyle.js.map