@fountain-ui/core 2.0.0-beta.92 → 2.0.0-beta.93

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 (343) hide show
  1. package/build/commonjs/Button/Button.js +51 -63
  2. package/build/commonjs/Button/Button.js.map +1 -1
  3. package/build/commonjs/Button/ButtonProps.js +11 -0
  4. package/build/commonjs/Button/ButtonProps.js.map +1 -1
  5. package/build/commonjs/Button/LegacyButton.js +144 -0
  6. package/build/commonjs/Button/LegacyButton.js.map +1 -0
  7. package/build/commonjs/Button/LegacyButtonProps.js +2 -0
  8. package/build/commonjs/Button/LegacyButtonProps.js.map +1 -0
  9. package/build/commonjs/Button/index.js +2 -2
  10. package/build/commonjs/Button/index.js.map +1 -1
  11. package/build/commonjs/Button/useVariantStyleMap.js +95 -0
  12. package/build/commonjs/Button/useVariantStyleMap.js.map +1 -0
  13. package/build/commonjs/ButtonSet/ButtonSet.js +54 -0
  14. package/build/commonjs/ButtonSet/ButtonSet.js.map +1 -0
  15. package/build/commonjs/ButtonSet/ButtonSetProps.js +11 -0
  16. package/build/commonjs/ButtonSet/ButtonSetProps.js.map +1 -0
  17. package/build/commonjs/ButtonSet/index.js +30 -0
  18. package/build/commonjs/ButtonSet/index.js.map +1 -0
  19. package/build/commonjs/ButtonSet/useVariantStyleMap.js +85 -0
  20. package/build/commonjs/ButtonSet/useVariantStyleMap.js.map +1 -0
  21. package/build/commonjs/Checkbox/Checkbox.js +33 -23
  22. package/build/commonjs/Checkbox/Checkbox.js.map +1 -1
  23. package/build/commonjs/Checkbox/CheckboxProps.js +7 -0
  24. package/build/commonjs/Checkbox/CheckboxProps.js.map +1 -1
  25. package/build/commonjs/Checkbox/LegacyCheckbox.js +65 -0
  26. package/build/commonjs/Checkbox/LegacyCheckbox.js.map +1 -0
  27. package/build/commonjs/Checkbox/LegacyCheckboxProps.js +2 -0
  28. package/build/commonjs/Checkbox/LegacyCheckboxProps.js.map +1 -0
  29. package/build/commonjs/Checkbox/index.js +2 -2
  30. package/build/commonjs/Checkbox/index.js.map +1 -1
  31. package/build/commonjs/Checkbox/useVariantStyleMap.js +70 -0
  32. package/build/commonjs/Checkbox/useVariantStyleMap.js.map +1 -0
  33. package/build/commonjs/CheckboxGroup/CheckboxGroup.js +50 -0
  34. package/build/commonjs/CheckboxGroup/CheckboxGroup.js.map +1 -0
  35. package/build/commonjs/CheckboxGroup/CheckboxGroupProps.js +2 -0
  36. package/build/commonjs/CheckboxGroup/CheckboxGroupProps.js.map +1 -0
  37. package/build/commonjs/CheckboxGroup/index.js +16 -0
  38. package/build/commonjs/CheckboxGroup/index.js.map +1 -0
  39. package/build/commonjs/IconButton/IconButton.js +39 -42
  40. package/build/commonjs/IconButton/IconButton.js.map +1 -1
  41. package/build/commonjs/IconButton/IconButtonProps.js +7 -0
  42. package/build/commonjs/IconButton/IconButtonProps.js.map +1 -1
  43. package/build/commonjs/IconButton/LegacyIconButton.js +88 -0
  44. package/build/commonjs/IconButton/LegacyIconButton.js.map +1 -0
  45. package/build/commonjs/IconButton/LegacyIconButtonProps.js +2 -0
  46. package/build/commonjs/IconButton/LegacyIconButtonProps.js.map +1 -0
  47. package/build/commonjs/IconButton/index.js +2 -2
  48. package/build/commonjs/IconButton/index.js.map +1 -1
  49. package/build/commonjs/Radio/LegacyRadio.js +82 -0
  50. package/build/commonjs/Radio/LegacyRadio.js.map +1 -0
  51. package/build/commonjs/Radio/LegacyRadioProps.js +2 -0
  52. package/build/commonjs/Radio/LegacyRadioProps.js.map +1 -0
  53. package/build/commonjs/Radio/Radio.js +40 -19
  54. package/build/commonjs/Radio/Radio.js.map +1 -1
  55. package/build/commonjs/Radio/RadioProps.js.map +1 -1
  56. package/build/commonjs/Radio/index.js +2 -2
  57. package/build/commonjs/Radio/index.js.map +1 -1
  58. package/build/commonjs/RadioGroup/LegacyRadioGroup.js +31 -0
  59. package/build/commonjs/RadioGroup/LegacyRadioGroup.js.map +1 -0
  60. package/build/commonjs/RadioGroup/RadioGroup.js +28 -2
  61. package/build/commonjs/RadioGroup/RadioGroup.js.map +1 -1
  62. package/build/commonjs/RadioGroup/index.js +2 -2
  63. package/build/commonjs/RadioGroup/index.js.map +1 -1
  64. package/build/commonjs/ShadowView/ShadowView.js +35 -0
  65. package/build/commonjs/ShadowView/ShadowView.js.map +1 -0
  66. package/build/commonjs/ShadowView/ShadowView.native.js +35 -0
  67. package/build/commonjs/ShadowView/ShadowView.native.js.map +1 -0
  68. package/build/commonjs/ShadowView/ShadowViewProps.js +2 -0
  69. package/build/commonjs/ShadowView/ShadowViewProps.js.map +1 -0
  70. package/build/commonjs/ShadowView/index.js +16 -0
  71. package/build/commonjs/ShadowView/index.js.map +1 -0
  72. package/build/commonjs/SvgIcon/LegacySvgIcon.js +43 -0
  73. package/build/commonjs/SvgIcon/LegacySvgIcon.js.map +1 -0
  74. package/build/commonjs/SvgIcon/LegacySvgIconProps.js +2 -0
  75. package/build/commonjs/SvgIcon/LegacySvgIconProps.js.map +1 -0
  76. package/build/commonjs/SvgIcon/SvgIcon.js +16 -4
  77. package/build/commonjs/SvgIcon/SvgIcon.js.map +1 -1
  78. package/build/commonjs/SvgIcon/SvgIconProps.js +15 -0
  79. package/build/commonjs/SvgIcon/SvgIconProps.js.map +1 -1
  80. package/build/commonjs/SvgIcon/index.js +2 -2
  81. package/build/commonjs/SvgIcon/index.js.map +1 -1
  82. package/build/commonjs/Toggle/Toggle.js +110 -0
  83. package/build/commonjs/Toggle/Toggle.js.map +1 -0
  84. package/build/commonjs/Toggle/ToggleProps.js +2 -0
  85. package/build/commonjs/Toggle/ToggleProps.js.map +1 -0
  86. package/build/commonjs/Toggle/index.js +16 -0
  87. package/build/commonjs/Toggle/index.js.map +1 -0
  88. package/build/commonjs/Typography/LegacyTypography.js +142 -0
  89. package/build/commonjs/Typography/LegacyTypography.js.map +1 -0
  90. package/build/commonjs/Typography/LegacyTypographyProps.js +2 -0
  91. package/build/commonjs/Typography/LegacyTypographyProps.js.map +1 -0
  92. package/build/commonjs/Typography/Typography.js +15 -54
  93. package/build/commonjs/Typography/Typography.js.map +1 -1
  94. package/build/commonjs/Typography/TypographyProps.js +7 -0
  95. package/build/commonjs/Typography/TypographyProps.js.map +1 -1
  96. package/build/commonjs/Typography/index.js +2 -2
  97. package/build/commonjs/Typography/index.js.map +1 -1
  98. package/build/commonjs/hooks/useCollapsibleAppBar.js +11 -2
  99. package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
  100. package/build/commonjs/index.js +84 -0
  101. package/build/commonjs/index.js.map +1 -1
  102. package/build/commonjs/internal/icons/Check.js +23 -0
  103. package/build/commonjs/internal/icons/Check.js.map +1 -0
  104. package/build/commonjs/internal/icons/CheckboxOn.js +23 -0
  105. package/build/commonjs/internal/icons/CheckboxOn.js.map +1 -0
  106. package/build/commonjs/internal/icons/index.js +16 -0
  107. package/build/commonjs/internal/icons/index.js.map +1 -1
  108. package/build/commonjs/styles/createFontStyle.js.map +1 -1
  109. package/build/commonjs/utils/cloneElementSafely.js.map +1 -1
  110. package/build/commonjs/utils/createSvgIcon.js +15 -3
  111. package/build/commonjs/utils/createSvgIcon.js.map +1 -1
  112. package/build/commonjs/utils/index.js.map +1 -1
  113. package/build/module/Button/Button.js +53 -63
  114. package/build/module/Button/Button.js.map +1 -1
  115. package/build/module/Button/ButtonProps.js +3 -1
  116. package/build/module/Button/ButtonProps.js.map +1 -1
  117. package/build/module/Button/LegacyButton.js +127 -0
  118. package/build/module/Button/LegacyButton.js.map +1 -0
  119. package/build/module/Button/LegacyButtonProps.js +2 -0
  120. package/build/module/Button/LegacyButtonProps.js.map +1 -0
  121. package/build/module/Button/index.js +1 -1
  122. package/build/module/Button/index.js.map +1 -1
  123. package/build/module/Button/useVariantStyleMap.js +85 -0
  124. package/build/module/Button/useVariantStyleMap.js.map +1 -0
  125. package/build/module/ButtonSet/ButtonSet.js +34 -0
  126. package/build/module/ButtonSet/ButtonSet.js.map +1 -0
  127. package/build/module/ButtonSet/ButtonSetProps.js +3 -0
  128. package/build/module/ButtonSet/ButtonSetProps.js.map +1 -0
  129. package/build/module/ButtonSet/index.js +3 -0
  130. package/build/module/ButtonSet/index.js.map +1 -0
  131. package/build/module/ButtonSet/useVariantStyleMap.js +76 -0
  132. package/build/module/ButtonSet/useVariantStyleMap.js.map +1 -0
  133. package/build/module/Checkbox/Checkbox.js +32 -26
  134. package/build/module/Checkbox/Checkbox.js.map +1 -1
  135. package/build/module/Checkbox/CheckboxProps.js +1 -1
  136. package/build/module/Checkbox/CheckboxProps.js.map +1 -1
  137. package/build/module/Checkbox/LegacyCheckbox.js +52 -0
  138. package/build/module/Checkbox/LegacyCheckbox.js.map +1 -0
  139. package/build/module/Checkbox/LegacyCheckboxProps.js +2 -0
  140. package/build/module/Checkbox/LegacyCheckboxProps.js.map +1 -0
  141. package/build/module/Checkbox/index.js +1 -1
  142. package/build/module/Checkbox/index.js.map +1 -1
  143. package/build/module/Checkbox/useVariantStyleMap.js +59 -0
  144. package/build/module/Checkbox/useVariantStyleMap.js.map +1 -0
  145. package/build/module/CheckboxGroup/CheckboxGroup.js +34 -0
  146. package/build/module/CheckboxGroup/CheckboxGroup.js.map +1 -0
  147. package/build/module/CheckboxGroup/CheckboxGroupProps.js +2 -0
  148. package/build/module/CheckboxGroup/CheckboxGroupProps.js.map +1 -0
  149. package/build/module/CheckboxGroup/index.js +2 -0
  150. package/build/module/CheckboxGroup/index.js.map +1 -0
  151. package/build/module/IconButton/IconButton.js +36 -40
  152. package/build/module/IconButton/IconButton.js.map +1 -1
  153. package/build/module/IconButton/IconButtonProps.js +1 -1
  154. package/build/module/IconButton/IconButtonProps.js.map +1 -1
  155. package/build/module/IconButton/LegacyIconButton.js +73 -0
  156. package/build/module/IconButton/LegacyIconButton.js.map +1 -0
  157. package/build/module/IconButton/LegacyIconButtonProps.js +2 -0
  158. package/build/module/IconButton/LegacyIconButtonProps.js.map +1 -0
  159. package/build/module/IconButton/index.js +1 -1
  160. package/build/module/IconButton/index.js.map +1 -1
  161. package/build/module/Radio/LegacyRadio.js +63 -0
  162. package/build/module/Radio/LegacyRadio.js.map +1 -0
  163. package/build/module/Radio/LegacyRadioProps.js +2 -0
  164. package/build/module/Radio/LegacyRadioProps.js.map +1 -0
  165. package/build/module/Radio/Radio.js +35 -18
  166. package/build/module/Radio/Radio.js.map +1 -1
  167. package/build/module/Radio/RadioProps.js.map +1 -1
  168. package/build/module/Radio/index.js +1 -1
  169. package/build/module/Radio/index.js.map +1 -1
  170. package/build/module/RadioGroup/LegacyRadioGroup.js +18 -0
  171. package/build/module/RadioGroup/LegacyRadioGroup.js.map +1 -0
  172. package/build/module/RadioGroup/RadioGroup.js +21 -2
  173. package/build/module/RadioGroup/RadioGroup.js.map +1 -1
  174. package/build/module/RadioGroup/index.js +1 -1
  175. package/build/module/RadioGroup/index.js.map +1 -1
  176. package/build/module/ShadowView/ShadowView.js +23 -0
  177. package/build/module/ShadowView/ShadowView.js.map +1 -0
  178. package/build/module/ShadowView/ShadowView.native.js +23 -0
  179. package/build/module/ShadowView/ShadowView.native.js.map +1 -0
  180. package/build/module/ShadowView/ShadowViewProps.js +2 -0
  181. package/build/module/ShadowView/ShadowViewProps.js.map +1 -0
  182. package/build/module/ShadowView/index.js +2 -0
  183. package/build/module/ShadowView/index.js.map +1 -0
  184. package/build/module/SvgIcon/LegacySvgIcon.js +30 -0
  185. package/build/module/SvgIcon/LegacySvgIcon.js.map +1 -0
  186. package/build/module/SvgIcon/LegacySvgIconProps.js +2 -0
  187. package/build/module/SvgIcon/LegacySvgIconProps.js.map +1 -0
  188. package/build/module/SvgIcon/SvgIcon.js +15 -4
  189. package/build/module/SvgIcon/SvgIcon.js.map +1 -1
  190. package/build/module/SvgIcon/SvgIconProps.js +7 -1
  191. package/build/module/SvgIcon/SvgIconProps.js.map +1 -1
  192. package/build/module/SvgIcon/index.js +1 -1
  193. package/build/module/SvgIcon/index.js.map +1 -1
  194. package/build/module/Toggle/Toggle.js +90 -0
  195. package/build/module/Toggle/Toggle.js.map +1 -0
  196. package/build/module/Toggle/ToggleProps.js +2 -0
  197. package/build/module/Toggle/ToggleProps.js.map +1 -0
  198. package/build/module/Toggle/index.js +2 -0
  199. package/build/module/Toggle/index.js.map +1 -0
  200. package/build/module/Typography/LegacyTypography.js +126 -0
  201. package/build/module/Typography/LegacyTypography.js.map +1 -0
  202. package/build/module/Typography/LegacyTypographyProps.js +2 -0
  203. package/build/module/Typography/LegacyTypographyProps.js.map +1 -0
  204. package/build/module/Typography/Typography.js +15 -54
  205. package/build/module/Typography/Typography.js.map +1 -1
  206. package/build/module/Typography/TypographyProps.js +1 -1
  207. package/build/module/Typography/TypographyProps.js.map +1 -1
  208. package/build/module/Typography/index.js +1 -1
  209. package/build/module/Typography/index.js.map +1 -1
  210. package/build/module/hooks/useCollapsibleAppBar.js +12 -3
  211. package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
  212. package/build/module/index.js +8 -0
  213. package/build/module/index.js.map +1 -1
  214. package/build/module/internal/icons/Check.js +9 -0
  215. package/build/module/internal/icons/Check.js.map +1 -0
  216. package/build/module/internal/icons/CheckboxOn.js +9 -0
  217. package/build/module/internal/icons/CheckboxOn.js.map +1 -0
  218. package/build/module/internal/icons/index.js +2 -0
  219. package/build/module/internal/icons/index.js.map +1 -1
  220. package/build/module/styles/createFontStyle.js.map +1 -1
  221. package/build/module/utils/cloneElementSafely.js.map +1 -1
  222. package/build/module/utils/createSvgIcon.js +14 -3
  223. package/build/module/utils/createSvgIcon.js.map +1 -1
  224. package/build/module/utils/index.js.map +1 -1
  225. package/build/typescript/Button/ButtonProps.d.ts +13 -11
  226. package/build/typescript/Button/LegacyButton.d.ts +3 -0
  227. package/build/typescript/Button/LegacyButtonProps.d.ts +51 -0
  228. package/build/typescript/Button/index.d.ts +2 -2
  229. package/build/typescript/Button/useVariantStyleMap.d.ts +9 -0
  230. package/build/typescript/ButtonSet/ButtonSet.d.ts +3 -0
  231. package/build/typescript/ButtonSet/ButtonSetProps.d.ts +20 -0
  232. package/build/typescript/ButtonSet/index.d.ts +3 -0
  233. package/build/typescript/ButtonSet/useVariantStyleMap.d.ts +10 -0
  234. package/build/typescript/Checkbox/CheckboxProps.d.ts +10 -14
  235. package/build/typescript/Checkbox/LegacyCheckbox.d.ts +3 -0
  236. package/build/typescript/Checkbox/LegacyCheckboxProps.d.ts +36 -0
  237. package/build/typescript/Checkbox/index.d.ts +2 -2
  238. package/build/typescript/Checkbox/useVariantStyleMap.d.ts +9 -0
  239. package/build/typescript/CheckboxGroup/CheckboxGroup.d.ts +3 -0
  240. package/build/typescript/CheckboxGroup/CheckboxGroupProps.d.ts +11 -0
  241. package/build/typescript/CheckboxGroup/index.d.ts +2 -0
  242. package/build/typescript/IconButton/IconButtonProps.d.ts +7 -10
  243. package/build/typescript/IconButton/LegacyIconButton.d.ts +3 -0
  244. package/build/typescript/IconButton/LegacyIconButtonProps.d.ts +26 -0
  245. package/build/typescript/IconButton/index.d.ts +2 -2
  246. package/build/typescript/Radio/LegacyRadio.d.ts +3 -0
  247. package/build/typescript/Radio/LegacyRadioProps.d.ts +43 -0
  248. package/build/typescript/Radio/RadioProps.d.ts +9 -14
  249. package/build/typescript/Radio/index.d.ts +2 -2
  250. package/build/typescript/RadioGroup/LegacyRadioGroup.d.ts +3 -0
  251. package/build/typescript/RadioGroup/index.d.ts +1 -1
  252. package/build/typescript/ShadowView/ShadowView.d.ts +3 -0
  253. package/build/typescript/ShadowView/ShadowView.native.d.ts +3 -0
  254. package/build/typescript/ShadowView/ShadowViewProps.d.ts +11 -0
  255. package/build/typescript/ShadowView/index.d.ts +2 -0
  256. package/build/typescript/SvgIcon/LegacySvgIcon.d.ts +3 -0
  257. package/build/typescript/SvgIcon/LegacySvgIconProps.d.ts +35 -0
  258. package/build/typescript/SvgIcon/SvgIconProps.d.ts +17 -6
  259. package/build/typescript/SvgIcon/index.d.ts +2 -2
  260. package/build/typescript/Toggle/Toggle.d.ts +3 -0
  261. package/build/typescript/Toggle/ToggleProps.d.ts +19 -0
  262. package/build/typescript/Toggle/index.d.ts +2 -0
  263. package/build/typescript/Typography/LegacyTypography.d.ts +5 -0
  264. package/build/typescript/Typography/LegacyTypographyProps.d.ts +81 -0
  265. package/build/typescript/Typography/Typography.d.ts +1 -1
  266. package/build/typescript/Typography/TypographyProps.d.ts +12 -9
  267. package/build/typescript/Typography/index.d.ts +2 -2
  268. package/build/typescript/hooks/useCollapsibleAppBar.d.ts +1 -0
  269. package/build/typescript/index.d.ts +8 -0
  270. package/build/typescript/internal/icons/Check.d.ts +8 -0
  271. package/build/typescript/internal/icons/Checkbox.d.ts +2 -124
  272. package/build/typescript/internal/icons/CheckboxChecked.d.ts +2 -124
  273. package/build/typescript/internal/icons/CheckboxOn.d.ts +8 -0
  274. package/build/typescript/internal/icons/ChevronDown.d.ts +2 -124
  275. package/build/typescript/internal/icons/ChevronLeft.d.ts +2 -124
  276. package/build/typescript/internal/icons/ChevronRight.d.ts +2 -124
  277. package/build/typescript/internal/icons/Close.d.ts +2 -124
  278. package/build/typescript/internal/icons/Radio.d.ts +2 -124
  279. package/build/typescript/internal/icons/RadioChecked.d.ts +2 -124
  280. package/build/typescript/internal/icons/index.d.ts +2 -0
  281. package/build/typescript/styles/createFontStyle.d.ts +1 -1
  282. package/build/typescript/utils/cloneElementSafely.d.ts +1 -2
  283. package/build/typescript/utils/createSvgIcon.d.ts +8 -3
  284. package/build/typescript/utils/index.d.ts +1 -0
  285. package/package.json +2 -2
  286. package/src/Button/Button.tsx +53 -71
  287. package/src/Button/ButtonProps.ts +29 -12
  288. package/src/Button/LegacyButton.tsx +157 -0
  289. package/src/Button/LegacyButtonProps.ts +62 -0
  290. package/src/Button/index.ts +2 -2
  291. package/src/Button/useVariantStyleMap.ts +99 -0
  292. package/src/ButtonSet/ButtonSet.tsx +43 -0
  293. package/src/ButtonSet/ButtonSetProps.ts +27 -0
  294. package/src/ButtonSet/index.ts +3 -0
  295. package/src/ButtonSet/useVariantStyleMap.ts +84 -0
  296. package/src/Checkbox/Checkbox.tsx +48 -33
  297. package/src/Checkbox/CheckboxProps.ts +10 -15
  298. package/src/Checkbox/LegacyCheckbox.tsx +62 -0
  299. package/src/Checkbox/LegacyCheckboxProps.ts +42 -0
  300. package/src/Checkbox/index.ts +2 -2
  301. package/src/Checkbox/useVariantStyleMap.ts +71 -0
  302. package/src/CheckboxGroup/CheckboxGroup.tsx +47 -0
  303. package/src/CheckboxGroup/CheckboxGroupProps.ts +11 -0
  304. package/src/CheckboxGroup/index.ts +2 -0
  305. package/src/IconButton/IconButton.tsx +36 -54
  306. package/src/IconButton/IconButtonProps.ts +12 -12
  307. package/src/IconButton/LegacyIconButton.tsx +96 -0
  308. package/src/IconButton/LegacyIconButtonProps.ts +31 -0
  309. package/src/IconButton/index.ts +2 -2
  310. package/src/Radio/LegacyRadio.tsx +72 -0
  311. package/src/Radio/LegacyRadioProps.ts +50 -0
  312. package/src/Radio/Radio.tsx +47 -16
  313. package/src/Radio/RadioProps.ts +10 -16
  314. package/src/Radio/index.ts +2 -2
  315. package/src/RadioGroup/LegacyRadioGroup.tsx +20 -0
  316. package/src/RadioGroup/RadioGroup.tsx +31 -4
  317. package/src/RadioGroup/index.ts +2 -2
  318. package/src/ShadowView/ShadowView.native.tsx +37 -0
  319. package/src/ShadowView/ShadowView.tsx +33 -0
  320. package/src/ShadowView/ShadowViewProps.ts +11 -0
  321. package/src/ShadowView/index.ts +2 -0
  322. package/src/SvgIcon/LegacySvgIcon.tsx +36 -0
  323. package/src/SvgIcon/LegacySvgIconProps.ts +41 -0
  324. package/src/SvgIcon/SvgIcon.tsx +19 -5
  325. package/src/SvgIcon/SvgIconProps.ts +33 -6
  326. package/src/SvgIcon/index.ts +2 -2
  327. package/src/Toggle/Toggle.tsx +113 -0
  328. package/src/Toggle/ToggleProps.ts +21 -0
  329. package/src/Toggle/index.ts +2 -0
  330. package/src/Typography/LegacyTypography.tsx +107 -0
  331. package/src/Typography/LegacyTypographyProps.ts +122 -0
  332. package/src/Typography/Typography.tsx +24 -30
  333. package/src/Typography/TypographyProps.ts +29 -34
  334. package/src/Typography/index.ts +2 -2
  335. package/src/hooks/useCollapsibleAppBar.ts +12 -2
  336. package/src/index.ts +12 -0
  337. package/src/internal/icons/Check.tsx +13 -0
  338. package/src/internal/icons/CheckboxOn.tsx +13 -0
  339. package/src/internal/icons/index.ts +2 -0
  340. package/src/styles/createFontStyle.ts +1 -1
  341. package/src/utils/cloneElementSafely.ts +1 -1
  342. package/src/utils/createSvgIcon.tsx +29 -6
  343. package/src/utils/index.ts +1 -0
@@ -15,40 +15,50 @@ var _styles = require("../styles");
15
15
 
16
16
  var _utils = require("../utils");
17
17
 
18
+ var _useVariantStyleMap = _interopRequireDefault(require("./useVariantStyleMap"));
19
+
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
21
 
20
22
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
23
 
22
- const iconSizes = {
23
- small: 20,
24
- medium: 24
24
+ const useStyles = function () {
25
+ const theme = (0, _styles.useTheme)();
26
+ return {
27
+ root: {
28
+ alignItems: 'center',
29
+ borderRadius: theme.shape.radius.sm,
30
+ flexDirection: 'row',
31
+ justifyContent: 'center'
32
+ },
33
+ fullWidth: {
34
+ width: '100%'
35
+ },
36
+ large: {
37
+ gap: theme.spacing(2),
38
+ minWidth: 104,
39
+ paddingHorizontal: theme.spacing(6),
40
+ paddingVertical: theme.spacing(3.5)
41
+ },
42
+ medium: {
43
+ gap: theme.spacing(1.5),
44
+ minWidth: 88,
45
+ paddingHorizontal: 11,
46
+ paddingVertical: theme.spacing(3)
47
+ },
48
+ small: {
49
+ minWidth: 64,
50
+ paddingHorizontal: theme.spacing(2.5),
51
+ paddingVertical: theme.spacing(2)
52
+ }
53
+ };
25
54
  };
26
55
 
27
- const styles = _styles.StyleSheet.create({
28
- root: {
29
- flexDirection: 'row',
30
- justifyContent: 'center',
31
- alignItems: 'center'
32
- },
33
- fullWidth: {
34
- width: '100%'
35
- },
36
- medium: {
37
- minWidth: 104,
38
- height: 48
39
- },
40
- small: {
41
- minWidth: 56,
42
- height: 32
43
- }
44
- });
45
-
46
56
  function Button(props) {
47
57
  const {
48
58
  children,
49
- clipHorizontalSpacing = false,
50
59
  color = 'primary',
51
60
  disabled = false,
61
+ disableMinWidth = false,
52
62
  endIcon: endIconProp,
53
63
  fullWidth = false,
54
64
  href,
@@ -57,57 +67,35 @@ function Button(props) {
57
67
  size = 'medium',
58
68
  startIcon: startIconProp,
59
69
  style: styleProp,
60
- variant = 'contained',
70
+ variant = 'solid',
61
71
  ...otherProps
62
72
  } = props;
63
73
  const theme = (0, _styles.useTheme)();
64
- const mainColor = theme.palette[color].main;
65
- const fontColor = variant === 'contained' ? theme.palette[color].contrastTextColor : theme.palette[color].main;
66
- const variantStyleMap = {
67
- contained: {
68
- backgroundColor: mainColor
69
- },
70
- outlined: {
71
- backgroundColor: 'transparent',
72
- borderColor: mainColor,
73
- borderStyle: 'solid',
74
- borderWidth: 1
75
- },
76
- text: {
77
- backgroundColor: 'transparent'
78
- }
79
- };
74
+ const styles = useStyles();
75
+ const {
76
+ borderColor,
77
+ fillColor,
78
+ iconColor,
79
+ labelColor
80
+ } = (0, _useVariantStyleMap.default)(variant, color);
80
81
  const iconProps = {
81
- width: iconSizes[size],
82
- height: iconSizes[size],
83
- fill: fontColor
82
+ fill: iconColor
84
83
  };
85
84
  const startIcon = (0, _utils.cloneElementSafely)(startIconProp, iconProps);
86
85
  const endIcon = (0, _utils.cloneElementSafely)(endIconProp, iconProps);
87
- const paddingSize = size === 'small' ? theme.spacing(3) : theme.spacing(4);
88
- const paddingLeft = startIcon ? paddingSize - theme.spacing(1) : paddingSize;
89
- const paddingRight = endIcon ? paddingSize - theme.spacing(1) : paddingSize;
90
- const borderRadius = theme.shape.roundnessLarge;
91
- const buttonBaseStyle = (0, _styles.css)([styles.root, variantStyleMap[variant], size === 'medium' ? styles.medium : styles.small, fullWidth ? styles.fullWidth : undefined, {
92
- borderRadius,
93
- color: fontColor
94
- }, variant === 'text' && clipHorizontalSpacing ? {
86
+ const buttonBaseStyle = (0, _styles.css)([styles.root, {
87
+ backgroundColor: fillColor
88
+ }, variant === 'outlined' ? {
89
+ borderColor,
90
+ borderWidth: 1
91
+ } : undefined, styles[size], fullWidth ? styles.fullWidth : undefined, disableMinWidth ? {
95
92
  minWidth: 0
96
- } : {
97
- paddingLeft,
98
- paddingRight
99
- }, styleProp]);
93
+ } : undefined, styleProp]);
100
94
  const fontStyle = (0, _styles.createFontStyle)(theme, {
101
95
  selector: typo => size === 'small' ? typo.button2 : typo.button1,
102
- color: fontColor
96
+ color: labelColor
103
97
  });
104
- const textMarginSize = size === 'small' ? theme.spacing(1) : theme.spacing(2);
105
- const textMarginStyle = startIcon ? {
106
- marginLeft: textMarginSize
107
- } : endIcon ? {
108
- marginRight: textMarginSize
109
- } : undefined;
110
- const textStyle = (0, _styles.css)([fontStyle, textMarginStyle, {
98
+ const textStyle = (0, _styles.css)([fontStyle, {
111
99
  textAlign: 'center'
112
100
  }]);
113
101
  const modifiedPressEffect = variant !== 'text' && !pressEffect ? 'scale' : pressEffect;
@@ -1 +1 @@
1
- {"version":3,"names":["iconSizes","small","medium","styles","StyleSheet","create","root","flexDirection","justifyContent","alignItems","fullWidth","width","minWidth","height","Button","props","children","clipHorizontalSpacing","color","disabled","endIcon","endIconProp","href","onPress","pressEffect","size","startIcon","startIconProp","style","styleProp","variant","otherProps","theme","useTheme","mainColor","palette","main","fontColor","contrastTextColor","variantStyleMap","contained","backgroundColor","outlined","borderColor","borderStyle","borderWidth","text","iconProps","fill","cloneElementSafely","paddingSize","spacing","paddingLeft","paddingRight","borderRadius","shape","roundnessLarge","buttonBaseStyle","css","undefined","fontStyle","createFontStyle","selector","typo","button2","button1","textMarginSize","textMarginStyle","marginLeft","marginRight","textStyle","textAlign","modifiedPressEffect","handlePress","Linking","canOpenURL","openURL"],"sources":["Button.tsx"],"sourcesContent":["import React from 'react';\nimport { Linking, Text } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type ButtonProps from './ButtonProps';\nimport type { ButtonSize } from './ButtonProps';\n\ntype IconSizes = { [n in ButtonSize]: number };\n\nconst iconSizes: IconSizes = {\n small: 20,\n medium: 24,\n};\n\nconst styles = StyleSheet.create({\n root: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n },\n fullWidth: {\n width: '100%',\n },\n medium: {\n minWidth: 104,\n height: 48,\n },\n small: {\n minWidth: 56,\n height: 32,\n },\n});\n\nexport default function Button(props: ButtonProps) {\n const {\n children,\n clipHorizontalSpacing = false,\n color = 'primary',\n disabled = false,\n endIcon: endIconProp,\n fullWidth = false,\n href,\n onPress,\n pressEffect,\n size = 'medium',\n startIcon: startIconProp,\n style: styleProp,\n variant = 'contained',\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const mainColor = theme.palette[color].main;\n\n const fontColor = variant === 'contained'\n ? theme.palette[color].contrastTextColor\n : theme.palette[color].main;\n\n const variantStyleMap = {\n contained: {\n backgroundColor: mainColor,\n },\n outlined: {\n backgroundColor: 'transparent',\n borderColor: mainColor,\n borderStyle: 'solid',\n borderWidth: 1,\n },\n text: {\n backgroundColor: 'transparent',\n },\n };\n\n const iconProps = {\n width: iconSizes[size],\n height: iconSizes[size],\n fill: fontColor,\n };\n\n const startIcon = cloneElementSafely(startIconProp, iconProps);\n const endIcon = cloneElementSafely(endIconProp, iconProps);\n\n const paddingSize = size === 'small' ? theme.spacing(3) : theme.spacing(4);\n const paddingLeft = startIcon ? paddingSize - theme.spacing(1) : paddingSize;\n const paddingRight = endIcon ? paddingSize - theme.spacing(1) : paddingSize;\n\n const borderRadius = theme.shape.roundnessLarge;\n const buttonBaseStyle = css([\n styles.root,\n variantStyleMap[variant],\n size === 'medium' ? styles.medium : styles.small,\n fullWidth ? styles.fullWidth : undefined,\n { borderRadius, color: fontColor },\n (variant === 'text' && clipHorizontalSpacing)\n ? { minWidth: 0 }\n : { paddingLeft, paddingRight },\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => size === 'small' ? typo.button2 : typo.button1,\n color: fontColor,\n });\n\n const textMarginSize = size === 'small' ? theme.spacing(1) : theme.spacing(2);\n const textMarginStyle = startIcon\n ? { marginLeft: textMarginSize }\n : endIcon\n ? { marginRight: textMarginSize }\n : undefined;\n\n const textStyle = css([\n fontStyle,\n textMarginStyle,\n { textAlign: 'center' },\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 return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={buttonBaseStyle}\n pressEffect={modifiedPressEffect}\n {...otherProps}\n >\n {startIcon}\n\n <Text\n children={children}\n style={textStyle}\n />\n\n {endIcon}\n </ButtonBase>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAMA,MAAMA,SAAoB,GAAG;EACzBC,KAAK,EAAE,EADkB;EAEzBC,MAAM,EAAE;AAFiB,CAA7B;;AAKA,MAAMC,MAAM,GAAGC,kBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,aAAa,EAAE,KADb;IAEFC,cAAc,EAAE,QAFd;IAGFC,UAAU,EAAE;EAHV,CADuB;EAM7BC,SAAS,EAAE;IACPC,KAAK,EAAE;EADA,CANkB;EAS7BT,MAAM,EAAE;IACJU,QAAQ,EAAE,GADN;IAEJC,MAAM,EAAE;EAFJ,CATqB;EAa7BZ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AAN,CAAc,CAAd,CAAnB,GAAsCnB,KAAK,CAACmB,OAAN,CAAc,CAAd,CAA7D;EACA,MAAMgB,eAAe,GAAGzC,SAAS,GAC3B;IAAE0C,UAAU,EAAEF;EAAd,CAD2B,GAE3B9C,OAAO,GACH;IAAEiD,WAAW,EAAEH;EAAf,CADG,GAEHP,SAJV;EAMA,MAAMW,SAAS,GAAG,IAAAZ,WAAA,EAAI,CAClBE,SADkB,EAElBO,eAFkB,EAGlB;IAAEI,SAAS,EAAE;EAAb,CAHkB,CAAJ,CAAlB;EAMA,MAAMC,mBAAmB,GAAG1C,OAAO,KAAK,MAAZ,IAAsB,CAACN,WAAvB,GACtB,OADsB,GAEtBA,WAFN;;EAIA,MAAMiD,WAAW,GAAG,YAAY;IAC5B,IAAItD,QAAJ,EAAc;MACV;IACH;;IACD,IAAII,OAAJ,EAAa;MACTA,OAAO;MACP;IACH;;IACD,IAAID,IAAJ,EAAU;MACN,IAAI,MAAMoD,oBAAA,CAAQC,UAAR,CAAmBrD,IAAnB,CAAV,EAAoC;QAChC,MAAMoD,oBAAA,CAAQE,OAAR,CAAgBtD,IAAhB,CAAN;MACH;IACJ;EACJ,CAbD;;EAeA,oBACI,6BAAC,mBAAD;IACI,QAAQ,EAAEH,QADd;IAEI,OAAO,EAAEsD,WAFb;IAGI,KAAK,EAAEhB,eAHX;IAII,WAAW,EAAEe;EAJjB,GAKQzC,UALR,GAOKL,SAPL,eASI,6BAAC,iBAAD;IACI,QAAQ,EAAEV,QADd;IAEI,KAAK,EAAEsD;EAFX,EATJ,EAcKlD,OAdL,CADJ;AAkBH;;AAAA"}
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","Button","props","children","color","disabled","disableMinWidth","endIcon","endIconProp","href","onPress","pressEffect","size","startIcon","startIconProp","style","styleProp","variant","otherProps","styles","borderColor","fillColor","iconColor","labelColor","useVariantStyleMap","iconProps","fill","cloneElementSafely","buttonBaseStyle","css","backgroundColor","borderWidth","undefined","fontStyle","createFontStyle","selector","typo","button2","button1","textStyle","textAlign","modifiedPressEffect","handlePress","Linking","canOpenURL","openURL"],"sources":["Button.tsx"],"sourcesContent":["import React from 'react';\nimport { Linking, Text } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\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'>;\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: 11,\n paddingVertical: theme.spacing(3),\n },\n small: {\n minWidth: 64,\n paddingHorizontal: theme.spacing(2.5),\n paddingVertical: theme.spacing(2),\n },\n };\n};\n\nexport default function Button(props: ButtonProps) {\n const {\n children,\n color = 'primary' as ButtonColor,\n disabled = false,\n disableMinWidth = false,\n endIcon: endIconProp,\n fullWidth = false,\n href,\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 {\n borderColor,\n fillColor,\n iconColor,\n labelColor,\n } = useVariantStyleMap(variant, color);\n\n const iconProps = {\n fill: iconColor,\n };\n\n const startIcon = cloneElementSafely(startIconProp, iconProps);\n const endIcon = cloneElementSafely(endIconProp, iconProps);\n\n const buttonBaseStyle = css([\n styles.root,\n { backgroundColor: fillColor },\n variant === 'outlined' ? { borderColor, borderWidth: 1 } : undefined,\n styles[size],\n fullWidth ? styles.fullWidth : undefined,\n disableMinWidth ? { minWidth: 0 } : undefined,\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => size === 'small' ? typo.button2 : typo.button1,\n color: labelColor,\n });\n\n const textStyle = css([\n fontStyle,\n { textAlign: 'center' },\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 return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={buttonBaseStyle}\n pressEffect={modifiedPressEffect}\n {...otherProps}\n >\n {startIcon}\n\n <Text\n children={children}\n style={textStyle}\n />\n\n {endIcon}\n </ButtonBase>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AAGA;;;;;;AAIA,MAAMA,SAAkC,GAAG,YAA0B;EACjE,MAAMC,KAAK,GAAG,IAAAC,gBAAA,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;IAJd,CADH;IAOHC,SAAS,EAAE;MACPC,KAAK,EAAE;IADA,CAPR;IAUHC,KAAK,EAAE;MACHC,GAAG,EAAEb,KAAK,CAACc,OAAN,CAAc,CAAd,CADF;MAEHC,QAAQ,EAAE,GAFP;MAGHC,iBAAiB,EAAEhB,KAAK,CAACc,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AEI,OAAO,EAAEqC,WAFb;IAGI,KAAK,EAAEd,eAHX;IAII,WAAW,EAAEa;EAJjB,GAKQvB,UALR,GAOKL,SAPL,eASI,6BAAC,iBAAD;IACI,QAAQ,EAAEV,QADd;IAEI,KAAK,EAAEoC;EAFX,EATJ,EAcKhC,OAdL,CADJ;AAkBH;;AAAA"}
@@ -1,2 +1,13 @@
1
1
  "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ButtonVariants = exports.ButtonSizes = exports.ButtonColors = void 0;
7
+ const ButtonColors = ['accent', 'primary', 'danger', 'disabled', 'secondary', 'accentAlt'];
8
+ exports.ButtonColors = ButtonColors;
9
+ const ButtonSizes = ['small', 'medium', 'large'];
10
+ exports.ButtonSizes = ButtonSizes;
11
+ const ButtonVariants = ['solid', 'outlined', 'text'];
12
+ exports.ButtonVariants = ButtonVariants;
2
13
  //# sourceMappingURL=ButtonProps.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["ButtonProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ButtonBaseProps } from '../ButtonBase';\nimport type { OverridableComponentProps, CommonComponentColor } from '../types';\n\nexport type ButtonColor = CommonComponentColor;\n\nexport type ButtonSize = 'small' | 'medium';\n\nexport type ButtonVariant = 'contained' | 'outlined' | 'text';\n\nexport default interface ButtonProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * The content of the button.\n */\n children: string;\n\n /**\n * If `true`, remove horizontal padding and minimum width.\n * This prop only applied on `text` variant.\n * @default false\n */\n clipHorizontalSpacing?: boolean;\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 * 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 * 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 'contained'\n */\n variant?: ButtonVariant;\n}> {}\n"],"mappings":""}
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] 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 * 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,CAAvB"}
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = Button;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
13
+
14
+ var _styles = require("../styles");
15
+
16
+ var _utils = require("../utils");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
+
22
+ const iconSizes = {
23
+ small: 20,
24
+ medium: 24
25
+ };
26
+
27
+ const styles = _styles.StyleSheet.create({
28
+ root: {
29
+ flexDirection: 'row',
30
+ justifyContent: 'center',
31
+ alignItems: 'center'
32
+ },
33
+ fullWidth: {
34
+ width: '100%'
35
+ },
36
+ medium: {
37
+ minWidth: 104,
38
+ height: 48
39
+ },
40
+ small: {
41
+ minWidth: 56,
42
+ height: 32
43
+ }
44
+ });
45
+
46
+ function Button(props) {
47
+ const {
48
+ children,
49
+ clipHorizontalSpacing = false,
50
+ color = 'primary',
51
+ disabled = false,
52
+ endIcon: endIconProp,
53
+ fullWidth = false,
54
+ href,
55
+ onPress,
56
+ pressEffect,
57
+ size = 'medium',
58
+ startIcon: startIconProp,
59
+ style: styleProp,
60
+ variant = 'contained',
61
+ ...otherProps
62
+ } = props;
63
+ const theme = (0, _styles.useTheme)();
64
+ const mainColor = theme.palette[color].main;
65
+ const fontColor = variant === 'contained' ? theme.palette[color].contrastTextColor : theme.palette[color].main;
66
+ const variantStyleMap = {
67
+ contained: {
68
+ backgroundColor: mainColor
69
+ },
70
+ outlined: {
71
+ backgroundColor: 'transparent',
72
+ borderColor: mainColor,
73
+ borderStyle: 'solid',
74
+ borderWidth: 1
75
+ },
76
+ text: {
77
+ backgroundColor: 'transparent'
78
+ }
79
+ };
80
+ const iconProps = {
81
+ width: iconSizes[size],
82
+ height: iconSizes[size],
83
+ fill: fontColor
84
+ };
85
+ const startIcon = (0, _utils.cloneElementSafely)(startIconProp, iconProps);
86
+ const endIcon = (0, _utils.cloneElementSafely)(endIconProp, iconProps);
87
+ const paddingSize = size === 'small' ? theme.spacing(3) : theme.spacing(4);
88
+ const paddingLeft = startIcon ? paddingSize - theme.spacing(1) : paddingSize;
89
+ const paddingRight = endIcon ? paddingSize - theme.spacing(1) : paddingSize;
90
+ const borderRadius = theme.shape.roundnessLarge;
91
+ const buttonBaseStyle = (0, _styles.css)([styles.root, variantStyleMap[variant], size === 'medium' ? styles.medium : styles.small, fullWidth ? styles.fullWidth : undefined, {
92
+ borderRadius,
93
+ color: fontColor
94
+ }, variant === 'text' && clipHorizontalSpacing ? {
95
+ minWidth: 0
96
+ } : {
97
+ paddingLeft,
98
+ paddingRight
99
+ }, styleProp]);
100
+ const fontStyle = (0, _styles.createFontStyle)(theme, {
101
+ selector: typo => size === 'small' ? typo.button2 : typo.button1,
102
+ color: fontColor
103
+ });
104
+ const textMarginSize = size === 'small' ? theme.spacing(1) : theme.spacing(2);
105
+ const textMarginStyle = startIcon ? {
106
+ marginLeft: textMarginSize
107
+ } : endIcon ? {
108
+ marginRight: textMarginSize
109
+ } : undefined;
110
+ const textStyle = (0, _styles.css)([fontStyle, textMarginStyle, {
111
+ textAlign: 'center'
112
+ }]);
113
+ const modifiedPressEffect = variant !== 'text' && !pressEffect ? 'scale' : pressEffect;
114
+
115
+ const handlePress = async () => {
116
+ if (disabled) {
117
+ return;
118
+ }
119
+
120
+ if (onPress) {
121
+ onPress();
122
+ return;
123
+ }
124
+
125
+ if (href) {
126
+ if (await _reactNative.Linking.canOpenURL(href)) {
127
+ await _reactNative.Linking.openURL(href);
128
+ }
129
+ }
130
+ };
131
+
132
+ return /*#__PURE__*/_react.default.createElement(_ButtonBase.default, _extends({
133
+ disabled: disabled,
134
+ onPress: handlePress,
135
+ style: buttonBaseStyle,
136
+ pressEffect: modifiedPressEffect
137
+ }, otherProps), startIcon, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
138
+ children: children,
139
+ style: textStyle
140
+ }), endIcon);
141
+ }
142
+
143
+ ;
144
+ //# sourceMappingURL=LegacyButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["iconSizes","small","medium","styles","StyleSheet","create","root","flexDirection","justifyContent","alignItems","fullWidth","width","minWidth","height","Button","props","children","clipHorizontalSpacing","color","disabled","endIcon","endIconProp","href","onPress","pressEffect","size","startIcon","startIconProp","style","styleProp","variant","otherProps","theme","useTheme","mainColor","palette","main","fontColor","contrastTextColor","variantStyleMap","contained","backgroundColor","outlined","borderColor","borderStyle","borderWidth","text","iconProps","fill","cloneElementSafely","paddingSize","spacing","paddingLeft","paddingRight","borderRadius","shape","roundnessLarge","buttonBaseStyle","css","undefined","fontStyle","createFontStyle","selector","typo","button2","button1","textMarginSize","textMarginStyle","marginLeft","marginRight","textStyle","textAlign","modifiedPressEffect","handlePress","Linking","canOpenURL","openURL"],"sources":["LegacyButton.tsx"],"sourcesContent":["import React from 'react';\nimport { Linking, Text } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type ButtonProps from './LegacyButtonProps';\nimport type { ButtonSize } from './LegacyButtonProps';\n\ntype IconSizes = { [n in ButtonSize]: number };\n\nconst iconSizes: IconSizes = {\n small: 20,\n medium: 24,\n};\n\nconst styles = StyleSheet.create({\n root: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n },\n fullWidth: {\n width: '100%',\n },\n medium: {\n minWidth: 104,\n height: 48,\n },\n small: {\n minWidth: 56,\n height: 32,\n },\n});\n\nexport default function Button(props: ButtonProps) {\n const {\n children,\n clipHorizontalSpacing = false,\n color = 'primary',\n disabled = false,\n endIcon: endIconProp,\n fullWidth = false,\n href,\n onPress,\n pressEffect,\n size = 'medium',\n startIcon: startIconProp,\n style: styleProp,\n variant = 'contained',\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const mainColor = theme.palette[color].main;\n\n const fontColor = variant === 'contained'\n ? theme.palette[color].contrastTextColor\n : theme.palette[color].main;\n\n const variantStyleMap = {\n contained: {\n backgroundColor: mainColor,\n },\n outlined: {\n backgroundColor: 'transparent',\n borderColor: mainColor,\n borderStyle: 'solid',\n borderWidth: 1,\n },\n text: {\n backgroundColor: 'transparent',\n },\n };\n\n const iconProps = {\n width: iconSizes[size],\n height: iconSizes[size],\n fill: fontColor,\n };\n\n const startIcon = cloneElementSafely(startIconProp, iconProps);\n const endIcon = cloneElementSafely(endIconProp, iconProps);\n\n const paddingSize = size === 'small' ? theme.spacing(3) : theme.spacing(4);\n const paddingLeft = startIcon ? paddingSize - theme.spacing(1) : paddingSize;\n const paddingRight = endIcon ? paddingSize - theme.spacing(1) : paddingSize;\n\n const borderRadius = theme.shape.roundnessLarge;\n const buttonBaseStyle = css([\n styles.root,\n variantStyleMap[variant],\n size === 'medium' ? styles.medium : styles.small,\n fullWidth ? styles.fullWidth : undefined,\n { borderRadius, color: fontColor },\n (variant === 'text' && clipHorizontalSpacing)\n ? { minWidth: 0 }\n : { paddingLeft, paddingRight },\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => size === 'small' ? typo.button2 : typo.button1,\n color: fontColor,\n });\n\n const textMarginSize = size === 'small' ? theme.spacing(1) : theme.spacing(2);\n const textMarginStyle = startIcon\n ? { marginLeft: textMarginSize }\n : endIcon\n ? { marginRight: textMarginSize }\n : undefined;\n\n const textStyle = css([\n fontStyle,\n textMarginStyle,\n { textAlign: 'center' },\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 return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={buttonBaseStyle}\n pressEffect={modifiedPressEffect}\n {...otherProps}\n >\n {startIcon}\n\n <Text\n children={children}\n style={textStyle}\n />\n\n {endIcon}\n </ButtonBase>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAMA,MAAMA,SAAoB,GAAG;EACzBC,KAAK,EAAE,EADkB;EAEzBC,MAAM,EAAE;AAFiB,CAA7B;;AAKA,MAAMC,MAAM,GAAGC,kBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,aAAa,EAAE,KADb;IAEFC,cAAc,EAAE,QAFd;IAGFC,UAAU,EAAE;EAHV,CADuB;EAM7BC,SAAS,EAAE;IACPC,KAAK,EAAE;EADA,CANkB;EAS7BT,MAAM,EAAE;IACJU,QAAQ,EAAE,GADN;IAEJC,MAAM,EAAE;EAFJ,CATqB;EAa7BZ,KAAK,EAAE;IACHW,QAAQ,EAAE,EADP;IAEHC,MAAM,EAAE;EAFL;AAbsB,CAAlB,CAAf;;AAmBe,SAASC,MAAT,CAAgBC,KAAhB,EAAoC;EAC/C,MAAM;IACFC,QADE;IAEFC,qBAAqB,GAAG,KAFtB;IAGFC,KAAK,GAAG,SAHN;IAIFC,QAAQ,GAAG,KAJT;IAKFC,OAAO,EAAEC,WALP;IAMFX,SAAS,GAAG,KANV;IAOFY,IAPE;IAQFC,OARE;IASFC,WATE;IAUFC,IAAI,GAAG,QAVL;IAWFC,SAAS,EAAEC,aAXT;IAYFC,KAAK,EAAEC,SAZL;IAaFC,OAAO,GAAG,WAbR;IAcF,GAAGC;EAdD,IAeFhB,KAfJ;EAiBA,MAAMiB,KAAK,GAAG,IAAA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AAJ,EAAc;MACV;IACH;;IACD,IAAII,OAAJ,EAAa;MACTA,OAAO;MACP;IACH;;IACD,IAAID,IAAJ,EAAU;MACN,IAAI,MAAMoD,oBAAA,CAAQC,UAAR,CAAmBrD,IAAnB,CAAV,EAAoC;QAChC,MAAMoD,oBAAA,CAAQE,OAAR,CAAgBtD,IAAhB,CAAN;MACH;IACJ;EACJ,CAbD;;EAeA,oBACI,6BAAC,mBAAD;IACI,QAAQ,EAAEH,QADd;IAEI,OAAO,EAAEsD,WAFb;IAGI,KAAK,EAAEhB,eAHX;IAII,WAAW,EAAEe;EAJjB,GAKQzC,UALR,GAOKL,SAPL,eASI,6BAAC,iBAAD;IACI,QAAQ,EAAEV,QADd;IAEI,KAAK,EAAEsD;EAFX,EATJ,EAcKlD,OAdL,CADJ;AAkBH;;AAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=LegacyButtonProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["LegacyButtonProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ButtonBaseProps } from '../ButtonBase';\nimport type { OverridableComponentProps, CommonComponentColor } from '../types';\n\nexport type ButtonColor = CommonComponentColor;\n\nexport type ButtonSize = 'small' | 'medium';\n\nexport type ButtonVariant = 'contained' | 'outlined' | 'text';\n\nexport default interface ButtonProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * The content of the button.\n */\n children: string;\n\n /**\n * If `true`, remove horizontal padding and minimum width.\n * This prop only applied on `text` variant.\n * @default false\n */\n clipHorizontalSpacing?: boolean;\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 * 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 * 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 'contained'\n */\n variant?: ButtonVariant;\n}> {}\n"],"mappings":""}
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _Button.default;
9
+ return _LegacyButton.default;
10
10
  }
11
11
  });
12
12
 
13
- var _Button = _interopRequireDefault(require("./Button"));
13
+ var _LegacyButton = _interopRequireDefault(require("./LegacyButton"));
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 './Button';\nexport type { default as ButtonProps } from './ButtonProps';"],"mappings":";;;;;;;;;;;;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './LegacyButton';\nexport type { default as ButtonProps } from './LegacyButtonProps';\n"],"mappings":";;;;;;;;;;;;AAAA"}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = useVariantStyleMap;
7
+
8
+ var _react = require("react");
9
+
10
+ var _styles = require("@fountain-ui/styles");
11
+
12
+ var _styles2 = require("../styles");
13
+
14
+ function useVariantStyleMap(variant, color) {
15
+ const theme = (0, _styles2.useTheme)();
16
+ return (0, _react.useMemo)(() => {
17
+ const {
18
+ palette
19
+ } = theme;
20
+ const variantStyleMap = {
21
+ solid: {
22
+ accent: {
23
+ fillColor: palette.fill.accent,
24
+ labelColor: _styles.commonColors.static.strongInverse,
25
+ iconColor: _styles.commonColors.static.strongInverse
26
+ },
27
+ primary: {
28
+ fillColor: palette.fill.base,
29
+ labelColor: palette.text.strongInverse,
30
+ iconColor: palette.icon.strongInverse
31
+ },
32
+ danger: {
33
+ fillColor: palette.status.danger,
34
+ labelColor: _styles.commonColors.static.strongInverse,
35
+ iconColor: _styles.commonColors.static.strongInverse
36
+ },
37
+ disabled: {
38
+ fillColor: palette.status.disabled,
39
+ labelColor: palette.status.onDisabled,
40
+ iconColor: palette.status.onDisabled
41
+ }
42
+ },
43
+ outlined: {
44
+ accent: {
45
+ borderColor: palette.border.accent,
46
+ labelColor: palette.text.accent,
47
+ iconColor: palette.icon.accent
48
+ },
49
+ primary: {
50
+ borderColor: palette.border.base,
51
+ labelColor: palette.text.base,
52
+ iconColor: palette.icon.base
53
+ },
54
+ disabled: {
55
+ borderColor: palette.status.disabled,
56
+ labelColor: palette.status.disabledLabel,
57
+ iconColor: palette.status.disabledLabel
58
+ }
59
+ },
60
+ text: {
61
+ primary: {
62
+ labelColor: palette.text.strong,
63
+ iconColor: palette.icon.strong
64
+ },
65
+ secondary: {
66
+ labelColor: palette.text.base,
67
+ iconColor: palette.icon.base
68
+ },
69
+ accent: {
70
+ labelColor: palette.text.accent,
71
+ iconColor: palette.icon.accent
72
+ },
73
+ accentAlt: {
74
+ labelColor: palette.text.accentAlt,
75
+ iconColor: palette.icon.accentAlt
76
+ },
77
+ disabled: {
78
+ labelColor: palette.status.disabledLabel,
79
+ iconColor: palette.status.disabledLabel
80
+ }
81
+ }
82
+ };
83
+
84
+ if (variantStyleMap[variant][color]) {
85
+ return variantStyleMap[variant][color];
86
+ }
87
+
88
+ if (process.env.NODE_ENV !== 'production') {
89
+ console.warn('The selected color is not supported for the chosen variant.');
90
+ }
91
+
92
+ return {};
93
+ }, [theme, variant, color]);
94
+ }
95
+ //# sourceMappingURL=useVariantStyleMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useVariantStyleMap","variant","color","theme","useTheme","useMemo","palette","variantStyleMap","solid","accent","fillColor","fill","labelColor","commonColors","static","strongInverse","iconColor","primary","base","text","icon","danger","status","disabled","onDisabled","outlined","borderColor","border","disabledLabel","strong","secondary","accentAlt","process","env","NODE_ENV","console","warn"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { commonColors } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { ButtonColor, ButtonVariant } from './ButtonProps';\n\ntype UseVariantStyleMapReturns = {\n borderColor?: string;\n fillColor?: string;\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 fillColor: palette.fill.accent,\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n primary: {\n fillColor: palette.fill.base,\n labelColor: palette.text.strongInverse,\n iconColor: palette.icon.strongInverse,\n },\n danger: {\n fillColor: palette.status.danger,\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n disabled: {\n fillColor: palette.status.disabled,\n labelColor: palette.status.onDisabled,\n iconColor: palette.status.onDisabled,\n },\n },\n outlined: {\n accent: {\n borderColor: palette.border.accent,\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n primary: {\n borderColor: palette.border.base,\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n disabled: {\n borderColor: palette.status.disabled,\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 disabled: {\n labelColor: palette.status.disabledLabel,\n iconColor: 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;;AACA;;AACA;;AAgBe,SAASA,kBAAT,CAA4BC,OAA5B,EAAoDC,KAApD,EAAmG;EAC9G,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAQ,MAAM;IACjB,MAAM;MAAEC;IAAF,IAAcH,KAApB;IAEA,MAAMI,eAAgC,GAAG;MACrCC,KAAK,EAAE;QACHC,MAAM,EAAE;UACJC,SAAS,EAAEJ,OAAO,CAACK,IAAR,CAAaF,MADpB;UAEJG,UAAU,EAAEC,oBAAA,CAAaC,MAAb,CAAoBC,aAF5B;UAGJC,SAAS,EAAEH,oBAAA,CAAaC,MAAb,CAAoBC;QAH3B,CADL;QAMHE,OAAO,EAAE;UACLP,SAAS,EAAEJ,OAAO,CAACK,IAAR,CAAaO,IADnB;UAELN,UAAU,EAAEN,OAAO,CAACa,IAAR,CAAaJ,aAFpB;UAGLC,SAAS,EAAEV,OAAO,CAACc,IAAR,CAAaL;QAHnB,CANN;QAWHM,MAAM,EAAE;UACJX,SAAS,EAAEJ,OAAO,CAACgB,MAAR,CAAeD,MADtB;UAEJT,UAAU,EAAEC,oBAAA,CAAaC,MAAb,CAAoBC,aAF5B;UAGJC,SAAS,EAAEH,oBAAA,CAAaC,MAAb,CAAoBC;QAH3B,CAXL;QAgBHQ,QAAQ,EAAE;UACNb,SAAS,EAAEJ,OAAO,CAACgB,MAAR,CAAeC,QADpB;UAENX,UAAU,EAAEN,OAAO,CAACgB,MAAR,CAAeE,UAFrB;UAGNR,SAAS,EAAEV,OAAO,CAACgB,MAAR,CAAeE;QAHpB;MAhBP,CAD8B;MAuBrCC,QAAQ,EAAE;QACNhB,MAAM,EAAE;UACJiB,WAAW,EAAEpB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AACN,OAAD,CAAf,CAAyBC,KAAzB,CAAJ,EAAqC;MACjC,OAAOK,eAAe,CAACN,OAAD,CAAf,CAAyBC,KAAzB,CAAP;IACH;;IAED,IAAI8B,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;MACvCC,OAAO,CAACC,IAAR,CAAa,6DAAb;IACH;;IAED,OAAO,EAAP;EACH,CA5EM,EA4EJ,CAACjC,KAAD,EAAQF,OAAR,EAAiBC,KAAjB,CA5EI,CAAP;AA6EH"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = ButtonSet;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _utils = require("../utils");
13
+
14
+ var _useVariantStyleMap = _interopRequireDefault(require("./useVariantStyleMap"));
15
+
16
+ var _styles = require("../styles");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25
+
26
+ function ButtonSet(props) {
27
+ const {
28
+ children,
29
+ color = 'accent',
30
+ variant = 'horizontal',
31
+ style: styleProp,
32
+ ...otherProps
33
+ } = props;
34
+ const {
35
+ containerStyle,
36
+ buttonStyleMap
37
+ } = (0, _useVariantStyleMap.default)(variant, color);
38
+
39
+ const buttons = _react.Children.map(children, (child, index) => {
40
+ const props = { ...buttonStyleMap[index],
41
+ ...(variant === 'horizontal' ? {
42
+ style: {
43
+ flex: 1
44
+ }
45
+ } : {})
46
+ };
47
+ return (0, _utils.cloneElementSafely)(child, props);
48
+ });
49
+
50
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, otherProps, {
51
+ style: (0, _styles.css)([containerStyle, styleProp])
52
+ }), buttons);
53
+ }
54
+ //# sourceMappingURL=ButtonSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ButtonSet","props","children","color","variant","style","styleProp","otherProps","containerStyle","buttonStyleMap","useVariantStyleMap","buttons","Children","map","child","index","flex","cloneElementSafely","css"],"sources":["ButtonSet.tsx"],"sourcesContent":["import React, { Children } from 'react';\nimport { View } from 'react-native';\nimport type { FalsyReactElement } from '../utils';\nimport { cloneElementSafely } from '../utils';\nimport type ButtonSetProps from './ButtonSetProps';\nimport type { ButtonSetColor, ButtonSetVariant } from './ButtonSetProps';\nimport useVariantStyleMap from './useVariantStyleMap';\nimport { css } from '../styles';\n\nexport default function ButtonSet(props: ButtonSetProps) {\n const {\n children,\n color = 'accent' as ButtonSetColor,\n variant = 'horizontal' as ButtonSetVariant,\n style: styleProp,\n ...otherProps\n } = props;\n\n const {\n containerStyle,\n buttonStyleMap,\n } = useVariantStyleMap(variant, color);\n\n const buttons = Children.map(children, (child, index) => {\n const props = {\n ...buttonStyleMap[index],\n ...(variant === 'horizontal' ? { style: { flex: 1 } } : {}),\n };\n return cloneElementSafely(child as FalsyReactElement, props);\n });\n\n return (\n <View\n {...otherProps}\n style={css([\n containerStyle,\n styleProp,\n ])}\n >\n {buttons}\n </View>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAGA;;AACA;;;;;;;;;;AAEe,SAASA,SAAT,CAAmBC,KAAnB,EAA0C;EACrD,MAAM;IACFC,QADE;IAEFC,KAAK,GAAG,QAFN;IAGFC,OAAO,GAAG,YAHR;IAIFC,KAAK,EAAEC,SAJL;IAKF,GAAGC;EALD,IAMFN,KANJ;EAQA,MAAM;IACFO,cADE;IAEFC;EAFE,IAGF,IAAAC,2BAAA,EAAmBN,OAAnB,EAA4BD,KAA5B,CAHJ;;EAKA,MAAMQ,OAAO,GAAGC,eAAA,CAASC,GAAT,CAAaX,QAAb,EAAuB,CAACY,KAAD,EAAQC,KAAR,KAAkB;IACrD,MAAMd,KAAK,GAAG,EACV,GAAGQ,cAAc,CAACM,KAAD,CADP;MAEV,IAAIX,OAAO,KAAK,YAAZ,GAA2B;QAAEC,KAAK,EAAE;UAAEW,IAAI,EAAE;QAAR;MAAT,CAA3B,GAAoD,EAAxD;IAFU,CAAd;IAIA,OAAO,IAAAC,yBAAA,EAAmBH,KAAnB,EAA+Cb,KAA/C,CAAP;EACH,CANe,CAAhB;;EAQA,oBACI,6BAAC,iBAAD,eACQM,UADR;IAEI,KAAK,EAAE,IAAAW,WAAA,EAAI,CACPV,cADO,EAEPF,SAFO,CAAJ;EAFX,IAOKK,OAPL,CADJ;AAWH"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.buttonSetVariants = exports.buttonSetColors = void 0;
7
+ const buttonSetColors = ['accent', 'danger', 'warning'];
8
+ exports.buttonSetColors = buttonSetColors;
9
+ const buttonSetVariants = ['horizontal', 'vertical'];
10
+ exports.buttonSetVariants = buttonSetVariants;
11
+ //# sourceMappingURL=ButtonSetProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["buttonSetColors","buttonSetVariants"],"sources":["ButtonSetProps.ts"],"sourcesContent":["import type { PropsWithChildren } from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\n\nexport const buttonSetColors = [\n 'accent',\n 'danger',\n 'warning',\n] as const;\nexport type ButtonSetColor = typeof buttonSetColors[number];\n\nexport const buttonSetVariants = ['horizontal', 'vertical'] as const;\nexport type ButtonSetVariant = typeof buttonSetVariants[number];\n\nexport default interface ButtonSetProps extends OverridableComponentProps<PropsWithChildren<ViewProps>, {\n /**\n * Determines the base color of the button set that goes inside.\n * @default 'accent'\n */\n color?: ButtonSetColor;\n\n /**\n * Determines design variations of the component.\n * @default 'horizontal'\n */\n variant?: ButtonSetVariant;\n}> {}\n"],"mappings":";;;;;;AAIO,MAAMA,eAAe,GAAG,CAC3B,QAD2B,EAE3B,QAF2B,EAG3B,SAH2B,CAAxB;;AAOA,MAAMC,iBAAiB,GAAG,CAAC,YAAD,EAAe,UAAf,CAA1B"}