@fountain-ui/core 2.0.0-beta.91 → 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 (378) 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/Divider/Divider.js +16 -4
  40. package/build/commonjs/Divider/Divider.js.map +1 -1
  41. package/build/commonjs/Divider/DividerProps.js +9 -0
  42. package/build/commonjs/Divider/DividerProps.js.map +1 -1
  43. package/build/commonjs/Divider/LegacyDivider.js +114 -0
  44. package/build/commonjs/Divider/LegacyDivider.js.map +1 -0
  45. package/build/commonjs/Divider/LegacyDividerProps.js +2 -0
  46. package/build/commonjs/Divider/LegacyDividerProps.js.map +1 -0
  47. package/build/commonjs/Divider/index.js +2 -2
  48. package/build/commonjs/Divider/index.js.map +1 -1
  49. package/build/commonjs/IconButton/IconButton.js +39 -42
  50. package/build/commonjs/IconButton/IconButton.js.map +1 -1
  51. package/build/commonjs/IconButton/IconButtonProps.js +7 -0
  52. package/build/commonjs/IconButton/IconButtonProps.js.map +1 -1
  53. package/build/commonjs/IconButton/LegacyIconButton.js +88 -0
  54. package/build/commonjs/IconButton/LegacyIconButton.js.map +1 -0
  55. package/build/commonjs/IconButton/LegacyIconButtonProps.js +2 -0
  56. package/build/commonjs/IconButton/LegacyIconButtonProps.js.map +1 -0
  57. package/build/commonjs/IconButton/index.js +2 -2
  58. package/build/commonjs/IconButton/index.js.map +1 -1
  59. package/build/commonjs/Modal/index.js +0 -10
  60. package/build/commonjs/Modal/index.js.map +1 -1
  61. package/build/commonjs/Radio/LegacyRadio.js +82 -0
  62. package/build/commonjs/Radio/LegacyRadio.js.map +1 -0
  63. package/build/commonjs/Radio/LegacyRadioProps.js +2 -0
  64. package/build/commonjs/Radio/LegacyRadioProps.js.map +1 -0
  65. package/build/commonjs/Radio/Radio.js +40 -19
  66. package/build/commonjs/Radio/Radio.js.map +1 -1
  67. package/build/commonjs/Radio/RadioProps.js.map +1 -1
  68. package/build/commonjs/Radio/index.js +2 -2
  69. package/build/commonjs/Radio/index.js.map +1 -1
  70. package/build/commonjs/RadioGroup/LegacyRadioGroup.js +31 -0
  71. package/build/commonjs/RadioGroup/LegacyRadioGroup.js.map +1 -0
  72. package/build/commonjs/RadioGroup/RadioGroup.js +28 -2
  73. package/build/commonjs/RadioGroup/RadioGroup.js.map +1 -1
  74. package/build/commonjs/RadioGroup/index.js +2 -2
  75. package/build/commonjs/RadioGroup/index.js.map +1 -1
  76. package/build/commonjs/ShadowView/ShadowView.js +35 -0
  77. package/build/commonjs/ShadowView/ShadowView.js.map +1 -0
  78. package/build/commonjs/ShadowView/ShadowView.native.js +35 -0
  79. package/build/commonjs/ShadowView/ShadowView.native.js.map +1 -0
  80. package/build/commonjs/ShadowView/ShadowViewProps.js +2 -0
  81. package/build/commonjs/ShadowView/ShadowViewProps.js.map +1 -0
  82. package/build/commonjs/ShadowView/index.js +16 -0
  83. package/build/commonjs/ShadowView/index.js.map +1 -0
  84. package/build/commonjs/SvgIcon/LegacySvgIcon.js +43 -0
  85. package/build/commonjs/SvgIcon/LegacySvgIcon.js.map +1 -0
  86. package/build/commonjs/SvgIcon/LegacySvgIconProps.js +2 -0
  87. package/build/commonjs/SvgIcon/LegacySvgIconProps.js.map +1 -0
  88. package/build/commonjs/SvgIcon/SvgIcon.js +16 -4
  89. package/build/commonjs/SvgIcon/SvgIcon.js.map +1 -1
  90. package/build/commonjs/SvgIcon/SvgIconProps.js +15 -0
  91. package/build/commonjs/SvgIcon/SvgIconProps.js.map +1 -1
  92. package/build/commonjs/SvgIcon/index.js +2 -2
  93. package/build/commonjs/SvgIcon/index.js.map +1 -1
  94. package/build/commonjs/Toggle/Toggle.js +110 -0
  95. package/build/commonjs/Toggle/Toggle.js.map +1 -0
  96. package/build/commonjs/Toggle/ToggleProps.js +2 -0
  97. package/build/commonjs/Toggle/ToggleProps.js.map +1 -0
  98. package/build/commonjs/Toggle/index.js +16 -0
  99. package/build/commonjs/Toggle/index.js.map +1 -0
  100. package/build/commonjs/Typography/LegacyTypography.js +142 -0
  101. package/build/commonjs/Typography/LegacyTypography.js.map +1 -0
  102. package/build/commonjs/Typography/LegacyTypographyProps.js +2 -0
  103. package/build/commonjs/Typography/LegacyTypographyProps.js.map +1 -0
  104. package/build/commonjs/Typography/Typography.js +15 -54
  105. package/build/commonjs/Typography/Typography.js.map +1 -1
  106. package/build/commonjs/Typography/TypographyProps.js +7 -0
  107. package/build/commonjs/Typography/TypographyProps.js.map +1 -1
  108. package/build/commonjs/Typography/index.js +2 -2
  109. package/build/commonjs/Typography/index.js.map +1 -1
  110. package/build/commonjs/hooks/useCollapsibleAppBar.js +11 -2
  111. package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
  112. package/build/commonjs/index.js +80 -3
  113. package/build/commonjs/index.js.map +1 -1
  114. package/build/commonjs/internal/icons/Check.js +23 -0
  115. package/build/commonjs/internal/icons/Check.js.map +1 -0
  116. package/build/commonjs/internal/icons/CheckboxOn.js +23 -0
  117. package/build/commonjs/internal/icons/CheckboxOn.js.map +1 -0
  118. package/build/commonjs/internal/icons/index.js +16 -0
  119. package/build/commonjs/internal/icons/index.js.map +1 -1
  120. package/build/commonjs/styles/createFontStyle.js.map +1 -1
  121. package/build/commonjs/utils/cloneElementSafely.js.map +1 -1
  122. package/build/commonjs/utils/createSvgIcon.js +15 -3
  123. package/build/commonjs/utils/createSvgIcon.js.map +1 -1
  124. package/build/commonjs/utils/index.js.map +1 -1
  125. package/build/module/Button/Button.js +53 -63
  126. package/build/module/Button/Button.js.map +1 -1
  127. package/build/module/Button/ButtonProps.js +3 -1
  128. package/build/module/Button/ButtonProps.js.map +1 -1
  129. package/build/module/Button/LegacyButton.js +127 -0
  130. package/build/module/Button/LegacyButton.js.map +1 -0
  131. package/build/module/Button/LegacyButtonProps.js +2 -0
  132. package/build/module/Button/LegacyButtonProps.js.map +1 -0
  133. package/build/module/Button/index.js +1 -1
  134. package/build/module/Button/index.js.map +1 -1
  135. package/build/module/Button/useVariantStyleMap.js +85 -0
  136. package/build/module/Button/useVariantStyleMap.js.map +1 -0
  137. package/build/module/ButtonSet/ButtonSet.js +34 -0
  138. package/build/module/ButtonSet/ButtonSet.js.map +1 -0
  139. package/build/module/ButtonSet/ButtonSetProps.js +3 -0
  140. package/build/module/ButtonSet/ButtonSetProps.js.map +1 -0
  141. package/build/module/ButtonSet/index.js +3 -0
  142. package/build/module/ButtonSet/index.js.map +1 -0
  143. package/build/module/ButtonSet/useVariantStyleMap.js +76 -0
  144. package/build/module/ButtonSet/useVariantStyleMap.js.map +1 -0
  145. package/build/module/Checkbox/Checkbox.js +32 -26
  146. package/build/module/Checkbox/Checkbox.js.map +1 -1
  147. package/build/module/Checkbox/CheckboxProps.js +1 -1
  148. package/build/module/Checkbox/CheckboxProps.js.map +1 -1
  149. package/build/module/Checkbox/LegacyCheckbox.js +52 -0
  150. package/build/module/Checkbox/LegacyCheckbox.js.map +1 -0
  151. package/build/module/Checkbox/LegacyCheckboxProps.js +2 -0
  152. package/build/module/Checkbox/LegacyCheckboxProps.js.map +1 -0
  153. package/build/module/Checkbox/index.js +1 -1
  154. package/build/module/Checkbox/index.js.map +1 -1
  155. package/build/module/Checkbox/useVariantStyleMap.js +59 -0
  156. package/build/module/Checkbox/useVariantStyleMap.js.map +1 -0
  157. package/build/module/CheckboxGroup/CheckboxGroup.js +34 -0
  158. package/build/module/CheckboxGroup/CheckboxGroup.js.map +1 -0
  159. package/build/module/CheckboxGroup/CheckboxGroupProps.js +2 -0
  160. package/build/module/CheckboxGroup/CheckboxGroupProps.js.map +1 -0
  161. package/build/module/CheckboxGroup/index.js +2 -0
  162. package/build/module/CheckboxGroup/index.js.map +1 -0
  163. package/build/module/Divider/Divider.js +17 -4
  164. package/build/module/Divider/Divider.js.map +1 -1
  165. package/build/module/Divider/DividerProps.js +2 -1
  166. package/build/module/Divider/DividerProps.js.map +1 -1
  167. package/build/module/Divider/LegacyDivider.js +100 -0
  168. package/build/module/Divider/LegacyDivider.js.map +1 -0
  169. package/build/module/Divider/LegacyDividerProps.js +2 -0
  170. package/build/module/Divider/LegacyDividerProps.js.map +1 -0
  171. package/build/module/Divider/index.js +1 -1
  172. package/build/module/Divider/index.js.map +1 -1
  173. package/build/module/IconButton/IconButton.js +36 -40
  174. package/build/module/IconButton/IconButton.js.map +1 -1
  175. package/build/module/IconButton/IconButtonProps.js +1 -1
  176. package/build/module/IconButton/IconButtonProps.js.map +1 -1
  177. package/build/module/IconButton/LegacyIconButton.js +73 -0
  178. package/build/module/IconButton/LegacyIconButton.js.map +1 -0
  179. package/build/module/IconButton/LegacyIconButtonProps.js +2 -0
  180. package/build/module/IconButton/LegacyIconButtonProps.js.map +1 -0
  181. package/build/module/IconButton/index.js +1 -1
  182. package/build/module/IconButton/index.js.map +1 -1
  183. package/build/module/Modal/index.js +0 -1
  184. package/build/module/Modal/index.js.map +1 -1
  185. package/build/module/Radio/LegacyRadio.js +63 -0
  186. package/build/module/Radio/LegacyRadio.js.map +1 -0
  187. package/build/module/Radio/LegacyRadioProps.js +2 -0
  188. package/build/module/Radio/LegacyRadioProps.js.map +1 -0
  189. package/build/module/Radio/Radio.js +35 -18
  190. package/build/module/Radio/Radio.js.map +1 -1
  191. package/build/module/Radio/RadioProps.js.map +1 -1
  192. package/build/module/Radio/index.js +1 -1
  193. package/build/module/Radio/index.js.map +1 -1
  194. package/build/module/RadioGroup/LegacyRadioGroup.js +18 -0
  195. package/build/module/RadioGroup/LegacyRadioGroup.js.map +1 -0
  196. package/build/module/RadioGroup/RadioGroup.js +21 -2
  197. package/build/module/RadioGroup/RadioGroup.js.map +1 -1
  198. package/build/module/RadioGroup/index.js +1 -1
  199. package/build/module/RadioGroup/index.js.map +1 -1
  200. package/build/module/ShadowView/ShadowView.js +23 -0
  201. package/build/module/ShadowView/ShadowView.js.map +1 -0
  202. package/build/module/ShadowView/ShadowView.native.js +23 -0
  203. package/build/module/ShadowView/ShadowView.native.js.map +1 -0
  204. package/build/module/ShadowView/ShadowViewProps.js +2 -0
  205. package/build/module/ShadowView/ShadowViewProps.js.map +1 -0
  206. package/build/module/ShadowView/index.js +2 -0
  207. package/build/module/ShadowView/index.js.map +1 -0
  208. package/build/module/SvgIcon/LegacySvgIcon.js +30 -0
  209. package/build/module/SvgIcon/LegacySvgIcon.js.map +1 -0
  210. package/build/module/SvgIcon/LegacySvgIconProps.js +2 -0
  211. package/build/module/SvgIcon/LegacySvgIconProps.js.map +1 -0
  212. package/build/module/SvgIcon/SvgIcon.js +15 -4
  213. package/build/module/SvgIcon/SvgIcon.js.map +1 -1
  214. package/build/module/SvgIcon/SvgIconProps.js +7 -1
  215. package/build/module/SvgIcon/SvgIconProps.js.map +1 -1
  216. package/build/module/SvgIcon/index.js +1 -1
  217. package/build/module/SvgIcon/index.js.map +1 -1
  218. package/build/module/Toggle/Toggle.js +90 -0
  219. package/build/module/Toggle/Toggle.js.map +1 -0
  220. package/build/module/Toggle/ToggleProps.js +2 -0
  221. package/build/module/Toggle/ToggleProps.js.map +1 -0
  222. package/build/module/Toggle/index.js +2 -0
  223. package/build/module/Toggle/index.js.map +1 -0
  224. package/build/module/Typography/LegacyTypography.js +126 -0
  225. package/build/module/Typography/LegacyTypography.js.map +1 -0
  226. package/build/module/Typography/LegacyTypographyProps.js +2 -0
  227. package/build/module/Typography/LegacyTypographyProps.js.map +1 -0
  228. package/build/module/Typography/Typography.js +15 -54
  229. package/build/module/Typography/Typography.js.map +1 -1
  230. package/build/module/Typography/TypographyProps.js +1 -1
  231. package/build/module/Typography/TypographyProps.js.map +1 -1
  232. package/build/module/Typography/index.js +1 -1
  233. package/build/module/Typography/index.js.map +1 -1
  234. package/build/module/hooks/useCollapsibleAppBar.js +12 -3
  235. package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
  236. package/build/module/index.js +9 -1
  237. package/build/module/index.js.map +1 -1
  238. package/build/module/internal/icons/Check.js +9 -0
  239. package/build/module/internal/icons/Check.js.map +1 -0
  240. package/build/module/internal/icons/CheckboxOn.js +9 -0
  241. package/build/module/internal/icons/CheckboxOn.js.map +1 -0
  242. package/build/module/internal/icons/index.js +2 -0
  243. package/build/module/internal/icons/index.js.map +1 -1
  244. package/build/module/styles/createFontStyle.js.map +1 -1
  245. package/build/module/utils/cloneElementSafely.js.map +1 -1
  246. package/build/module/utils/createSvgIcon.js +14 -3
  247. package/build/module/utils/createSvgIcon.js.map +1 -1
  248. package/build/module/utils/index.js.map +1 -1
  249. package/build/typescript/Button/ButtonProps.d.ts +13 -11
  250. package/build/typescript/Button/LegacyButton.d.ts +3 -0
  251. package/build/typescript/Button/LegacyButtonProps.d.ts +51 -0
  252. package/build/typescript/Button/index.d.ts +2 -2
  253. package/build/typescript/Button/useVariantStyleMap.d.ts +9 -0
  254. package/build/typescript/ButtonSet/ButtonSet.d.ts +3 -0
  255. package/build/typescript/ButtonSet/ButtonSetProps.d.ts +20 -0
  256. package/build/typescript/ButtonSet/index.d.ts +3 -0
  257. package/build/typescript/ButtonSet/useVariantStyleMap.d.ts +10 -0
  258. package/build/typescript/Checkbox/CheckboxProps.d.ts +10 -14
  259. package/build/typescript/Checkbox/LegacyCheckbox.d.ts +3 -0
  260. package/build/typescript/Checkbox/LegacyCheckboxProps.d.ts +36 -0
  261. package/build/typescript/Checkbox/index.d.ts +2 -2
  262. package/build/typescript/Checkbox/useVariantStyleMap.d.ts +9 -0
  263. package/build/typescript/CheckboxGroup/CheckboxGroup.d.ts +3 -0
  264. package/build/typescript/CheckboxGroup/CheckboxGroupProps.d.ts +11 -0
  265. package/build/typescript/CheckboxGroup/index.d.ts +2 -0
  266. package/build/typescript/Divider/DividerProps.d.ts +12 -9
  267. package/build/typescript/Divider/LegacyDivider.d.ts +3 -0
  268. package/build/typescript/Divider/LegacyDividerProps.d.ts +41 -0
  269. package/build/typescript/Divider/index.d.ts +2 -2
  270. package/build/typescript/IconButton/IconButtonProps.d.ts +7 -10
  271. package/build/typescript/IconButton/LegacyIconButton.d.ts +3 -0
  272. package/build/typescript/IconButton/LegacyIconButtonProps.d.ts +26 -0
  273. package/build/typescript/IconButton/index.d.ts +2 -2
  274. package/build/typescript/Modal/index.d.ts +0 -2
  275. package/build/typescript/Radio/LegacyRadio.d.ts +3 -0
  276. package/build/typescript/Radio/LegacyRadioProps.d.ts +43 -0
  277. package/build/typescript/Radio/RadioProps.d.ts +9 -14
  278. package/build/typescript/Radio/index.d.ts +2 -2
  279. package/build/typescript/RadioGroup/LegacyRadioGroup.d.ts +3 -0
  280. package/build/typescript/RadioGroup/index.d.ts +1 -1
  281. package/build/typescript/ShadowView/ShadowView.d.ts +3 -0
  282. package/build/typescript/ShadowView/ShadowView.native.d.ts +3 -0
  283. package/build/typescript/ShadowView/ShadowViewProps.d.ts +11 -0
  284. package/build/typescript/ShadowView/index.d.ts +2 -0
  285. package/build/typescript/SvgIcon/LegacySvgIcon.d.ts +3 -0
  286. package/build/typescript/SvgIcon/LegacySvgIconProps.d.ts +35 -0
  287. package/build/typescript/SvgIcon/SvgIconProps.d.ts +17 -6
  288. package/build/typescript/SvgIcon/index.d.ts +2 -2
  289. package/build/typescript/Toggle/Toggle.d.ts +3 -0
  290. package/build/typescript/Toggle/ToggleProps.d.ts +19 -0
  291. package/build/typescript/Toggle/index.d.ts +2 -0
  292. package/build/typescript/Typography/LegacyTypography.d.ts +5 -0
  293. package/build/typescript/Typography/LegacyTypographyProps.d.ts +81 -0
  294. package/build/typescript/Typography/Typography.d.ts +1 -1
  295. package/build/typescript/Typography/TypographyProps.d.ts +12 -9
  296. package/build/typescript/Typography/index.d.ts +2 -2
  297. package/build/typescript/hooks/useCollapsibleAppBar.d.ts +1 -0
  298. package/build/typescript/index.d.ts +10 -2
  299. package/build/typescript/internal/icons/Check.d.ts +8 -0
  300. package/build/typescript/internal/icons/Checkbox.d.ts +2 -124
  301. package/build/typescript/internal/icons/CheckboxChecked.d.ts +2 -124
  302. package/build/typescript/internal/icons/CheckboxOn.d.ts +8 -0
  303. package/build/typescript/internal/icons/ChevronDown.d.ts +2 -124
  304. package/build/typescript/internal/icons/ChevronLeft.d.ts +2 -124
  305. package/build/typescript/internal/icons/ChevronRight.d.ts +2 -124
  306. package/build/typescript/internal/icons/Close.d.ts +2 -124
  307. package/build/typescript/internal/icons/Radio.d.ts +2 -124
  308. package/build/typescript/internal/icons/RadioChecked.d.ts +2 -124
  309. package/build/typescript/internal/icons/index.d.ts +2 -0
  310. package/build/typescript/styles/createFontStyle.d.ts +1 -1
  311. package/build/typescript/utils/cloneElementSafely.d.ts +1 -2
  312. package/build/typescript/utils/createSvgIcon.d.ts +8 -3
  313. package/build/typescript/utils/index.d.ts +1 -0
  314. package/package.json +2 -2
  315. package/src/Button/Button.tsx +53 -71
  316. package/src/Button/ButtonProps.ts +29 -12
  317. package/src/Button/LegacyButton.tsx +157 -0
  318. package/src/Button/LegacyButtonProps.ts +62 -0
  319. package/src/Button/index.ts +2 -2
  320. package/src/Button/useVariantStyleMap.ts +99 -0
  321. package/src/ButtonSet/ButtonSet.tsx +43 -0
  322. package/src/ButtonSet/ButtonSetProps.ts +27 -0
  323. package/src/ButtonSet/index.ts +3 -0
  324. package/src/ButtonSet/useVariantStyleMap.ts +84 -0
  325. package/src/Checkbox/Checkbox.tsx +48 -33
  326. package/src/Checkbox/CheckboxProps.ts +10 -15
  327. package/src/Checkbox/LegacyCheckbox.tsx +62 -0
  328. package/src/Checkbox/LegacyCheckboxProps.ts +42 -0
  329. package/src/Checkbox/index.ts +2 -2
  330. package/src/Checkbox/useVariantStyleMap.ts +71 -0
  331. package/src/CheckboxGroup/CheckboxGroup.tsx +47 -0
  332. package/src/CheckboxGroup/CheckboxGroupProps.ts +11 -0
  333. package/src/CheckboxGroup/index.ts +2 -0
  334. package/src/Divider/Divider.tsx +17 -8
  335. package/src/Divider/DividerProps.ts +14 -10
  336. package/src/Divider/LegacyDivider.tsx +114 -0
  337. package/src/Divider/LegacyDividerProps.ts +48 -0
  338. package/src/Divider/index.ts +2 -2
  339. package/src/IconButton/IconButton.tsx +36 -54
  340. package/src/IconButton/IconButtonProps.ts +12 -12
  341. package/src/IconButton/LegacyIconButton.tsx +96 -0
  342. package/src/IconButton/LegacyIconButtonProps.ts +31 -0
  343. package/src/IconButton/index.ts +2 -2
  344. package/src/Modal/index.ts +0 -2
  345. package/src/Radio/LegacyRadio.tsx +72 -0
  346. package/src/Radio/LegacyRadioProps.ts +50 -0
  347. package/src/Radio/Radio.tsx +47 -16
  348. package/src/Radio/RadioProps.ts +10 -16
  349. package/src/Radio/index.ts +2 -2
  350. package/src/RadioGroup/LegacyRadioGroup.tsx +20 -0
  351. package/src/RadioGroup/RadioGroup.tsx +31 -4
  352. package/src/RadioGroup/index.ts +2 -2
  353. package/src/ShadowView/ShadowView.native.tsx +37 -0
  354. package/src/ShadowView/ShadowView.tsx +33 -0
  355. package/src/ShadowView/ShadowViewProps.ts +11 -0
  356. package/src/ShadowView/index.ts +2 -0
  357. package/src/SvgIcon/LegacySvgIcon.tsx +36 -0
  358. package/src/SvgIcon/LegacySvgIconProps.ts +41 -0
  359. package/src/SvgIcon/SvgIcon.tsx +19 -5
  360. package/src/SvgIcon/SvgIconProps.ts +33 -6
  361. package/src/SvgIcon/index.ts +2 -2
  362. package/src/Toggle/Toggle.tsx +113 -0
  363. package/src/Toggle/ToggleProps.ts +21 -0
  364. package/src/Toggle/index.ts +2 -0
  365. package/src/Typography/LegacyTypography.tsx +107 -0
  366. package/src/Typography/LegacyTypographyProps.ts +122 -0
  367. package/src/Typography/Typography.tsx +24 -30
  368. package/src/Typography/TypographyProps.ts +29 -34
  369. package/src/Typography/index.ts +2 -2
  370. package/src/hooks/useCollapsibleAppBar.ts +12 -2
  371. package/src/index.ts +14 -2
  372. package/src/internal/icons/Check.tsx +13 -0
  373. package/src/internal/icons/CheckboxOn.tsx +13 -0
  374. package/src/internal/icons/index.ts +2 -0
  375. package/src/styles/createFontStyle.ts +1 -1
  376. package/src/utils/cloneElementSafely.ts +1 -1
  377. package/src/utils/createSvgIcon.tsx +29 -6
  378. package/src/utils/index.ts +1 -0
@@ -0,0 +1,90 @@
1
+ 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); }
2
+
3
+ import React, { useRef, useEffect } from 'react';
4
+ import { Animated } from 'react-native';
5
+ import { commonColors } from '@fountain-ui/styles';
6
+ import ButtonBase from '../ButtonBase';
7
+ import ShadowView from '../ShadowView';
8
+ import { css, useTheme } from '../styles';
9
+
10
+ const useStyles = function () {
11
+ const theme = useTheme();
12
+ return {
13
+ root: {
14
+ borderRadius: theme.shape.radius.full,
15
+ justifyContent: 'center'
16
+ },
17
+ toggle: {
18
+ backgroundColor: commonColors.static.strongInverse,
19
+ borderRadius: theme.shape.radius.full
20
+ }
21
+ };
22
+ };
23
+
24
+ const sizeMap = {
25
+ medium: {
26
+ containerHeight: 24,
27
+ containerWidth: 42,
28
+ paddingHorizontal: 3,
29
+ toggleSize: 18
30
+ }
31
+ };
32
+ export default function Toggle(props) {
33
+ const {
34
+ checked = false,
35
+ onChange,
36
+ style: styleProp,
37
+ ...otherProps
38
+ } = props;
39
+ const styles = useStyles();
40
+ const theme = useTheme();
41
+ const animation = useRef(new Animated.Value(checked ? 1 : 0)).current;
42
+ const {
43
+ containerHeight,
44
+ containerWidth,
45
+ paddingHorizontal,
46
+ toggleSize
47
+ } = sizeMap['medium'];
48
+ useEffect(() => {
49
+ Animated.timing(animation, {
50
+ toValue: checked ? 1 : 0,
51
+ duration: 150,
52
+ useNativeDriver: false
53
+ }).start();
54
+ }, [checked]);
55
+ const translateX = animation.interpolate({
56
+ inputRange: [0, 1],
57
+ outputRange: [paddingHorizontal, containerWidth - toggleSize - paddingHorizontal]
58
+ });
59
+ const containerStyle = css([styles.root, {
60
+ backgroundColor: checked ? theme.palette.fill.accent : theme.palette.fill.weak,
61
+ height: containerHeight,
62
+ width: containerWidth
63
+ }, styleProp]);
64
+ const toggleStyle = css([styles.toggle, {
65
+ height: toggleSize,
66
+ width: toggleSize
67
+ }]);
68
+ const animatedStyle = {
69
+ transform: [{
70
+ translateX: translateX
71
+ }]
72
+ };
73
+
74
+ const handlePress = () => {
75
+ onChange === null || onChange === void 0 ? void 0 : onChange(!checked);
76
+ };
77
+
78
+ return /*#__PURE__*/React.createElement(ButtonBase, _extends({}, otherProps, {
79
+ pressEffect: 'none',
80
+ onPress: handlePress,
81
+ style: containerStyle
82
+ }), /*#__PURE__*/React.createElement(Animated.View, {
83
+ style: animatedStyle
84
+ }, /*#__PURE__*/React.createElement(ShadowView, {
85
+ style: toggleStyle,
86
+ variant: 400
87
+ })));
88
+ }
89
+ ;
90
+ //# sourceMappingURL=Toggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useRef","useEffect","Animated","commonColors","ButtonBase","ShadowView","css","useTheme","useStyles","theme","root","borderRadius","shape","radius","full","justifyContent","toggle","backgroundColor","static","strongInverse","sizeMap","medium","containerHeight","containerWidth","paddingHorizontal","toggleSize","Toggle","props","checked","onChange","style","styleProp","otherProps","styles","animation","Value","current","timing","toValue","duration","useNativeDriver","start","translateX","interpolate","inputRange","outputRange","containerStyle","palette","fill","accent","weak","height","width","toggleStyle","animatedStyle","transform","handlePress"],"sources":["Toggle.tsx"],"sourcesContent":["import React, { useRef, useEffect } from 'react';\nimport { Animated } from 'react-native';\nimport { commonColors, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport ShadowView from '../ShadowView';\nimport { css, useTheme } from '../styles';\nimport { ExtendedStyle } from '../types';\nimport type ToggleProps from './ToggleProps';\n\ntype ToggleStyles = NamedStylesStringUnion<'root' | 'toggle'>;\n\nconst useStyles: UseStyles<ToggleStyles> = function (): ToggleStyles {\n const theme = useTheme();\n\n return {\n root: {\n borderRadius: theme.shape.radius.full,\n justifyContent: 'center',\n },\n toggle: {\n backgroundColor: commonColors.static.strongInverse,\n borderRadius: theme.shape.radius.full,\n },\n };\n};\n\nconst sizeMap = {\n medium: {\n containerHeight: 24,\n containerWidth: 42,\n paddingHorizontal: 3,\n toggleSize: 18,\n },\n};\n\nexport default function Toggle(props: ToggleProps) {\n const {\n checked = false,\n onChange,\n style: styleProp,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const theme = useTheme();\n\n const animation = useRef(new Animated.Value(checked ? 1 : 0)).current;\n\n const {\n containerHeight,\n containerWidth,\n paddingHorizontal,\n toggleSize,\n } = sizeMap['medium'];\n\n useEffect(() => {\n Animated.timing(animation, {\n toValue: checked ? 1 : 0,\n duration: 150,\n useNativeDriver: false,\n }).start();\n }, [checked]);\n\n const translateX = animation.interpolate({\n inputRange: [0, 1],\n outputRange: [paddingHorizontal, containerWidth - toggleSize - paddingHorizontal],\n });\n\n const containerStyle = css([\n styles.root,\n {\n backgroundColor: checked\n ? theme.palette.fill.accent\n : theme.palette.fill.weak,\n height: containerHeight,\n width: containerWidth,\n },\n styleProp,\n ]);\n\n const toggleStyle = css([\n styles.toggle,\n {\n height: toggleSize,\n width: toggleSize,\n },\n ]);\n\n const animatedStyle = {\n transform: [{ translateX: translateX as unknown }],\n } as ExtendedStyle;\n\n const handlePress = () => {\n onChange?.(!checked);\n };\n\n return (\n <ButtonBase\n {...otherProps}\n pressEffect={'none'}\n onPress={handlePress}\n style={containerStyle}\n >\n <Animated.View style={animatedStyle}>\n <ShadowView\n style={toggleStyle}\n variant={400}\n />\n </Animated.View>\n </ButtonBase>\n );\n};\n"],"mappings":";;AAAA,OAA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C,QAAD,CAAU,IAAV;IAAe,KAAK,EAAEQ;EAAtB,gBACI,oBAAC,UAAD;IACI,KAAK,EAAED,WADX;IAEI,OAAO,EAAE;EAFb,EADJ,CANJ,CADJ;AAeH;AAAA"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=ToggleProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["ToggleProps.ts"],"sourcesContent":["import type { ButtonBaseProps } from '../ButtonBase';\nimport type { OverridableComponentProps } from '../types';\n\nexport default interface ToggleProps extends OverridableComponentProps<Omit<ButtonBaseProps, 'children'>, {\n /**\n * If `true`, the component is checked.\n * @default false\n */\n checked?: boolean;\n\n /**\n * If `true`, the switch is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback fired when the switch is changed.\n */\n onChange?: (newChecked: boolean) => void;\n}> {}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { default } from './Toggle';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './Toggle';\nexport type { default as ToggleProps } from './ToggleProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,UAAxB"}
@@ -0,0 +1,126 @@
1
+ import React from 'react';
2
+ import { Platform, Text } from 'react-native';
3
+ import { createFontStyle, css, StyleSheet, useTheme } from '../styles';
4
+ const accessibilityMap = {
5
+ h1: {
6
+ accessibilityRole: 'header',
7
+ 'area-level': 1
8
+ },
9
+ h2: {
10
+ accessibilityRole: 'header',
11
+ 'area-level': 2
12
+ },
13
+ h3: {
14
+ accessibilityRole: 'header',
15
+ 'area-level': 3
16
+ },
17
+ subtitle1: {
18
+ accessibilityRole: 'header',
19
+ 'area-level': 6
20
+ },
21
+ subtitle2: {
22
+ accessibilityRole: 'header',
23
+ 'area-level': 6
24
+ },
25
+ body1: {
26
+ accessibilityRole: 'text'
27
+ },
28
+ body2: {
29
+ accessibilityRole: 'text'
30
+ },
31
+ caption1: {
32
+ accessibilityRole: 'text'
33
+ },
34
+ caption2: {
35
+ accessibilityRole: 'text'
36
+ },
37
+ flag: {
38
+ accessibilityRole: 'text'
39
+ }
40
+ };
41
+
42
+ function selectColor(theme, colorProp) {
43
+ var _theme$palette$colorP;
44
+
45
+ const palette = theme.palette.text;
46
+
47
+ switch (colorProp) {
48
+ case 'inherit':
49
+ return Platform.OS === 'web' ? 'inherit' : undefined;
50
+
51
+ case 'textPrimary':
52
+ return palette.primary;
53
+
54
+ case 'textSecondary':
55
+ return palette.secondary;
56
+
57
+ case 'textAccent':
58
+ return palette.accent;
59
+
60
+ case 'textHint':
61
+ return palette.hint;
62
+ }
63
+
64
+ return (_theme$palette$colorP = theme.palette[colorProp]) === null || _theme$palette$colorP === void 0 ? void 0 : _theme$palette$colorP.main;
65
+ }
66
+
67
+ const styles = StyleSheet.create({
68
+ root: {
69
+ flexShrink: 1,
70
+ ...(Platform.OS === 'web' ? {
71
+ maxWidth: '100%'
72
+ } : {})
73
+ }
74
+ });
75
+ const Typography = /*#__PURE__*/React.forwardRef(function Typography(props, ref) {
76
+ const {
77
+ accessibilityRole,
78
+ align = 'inherit',
79
+ ariaLevel,
80
+ disableFontScaling = false,
81
+ children,
82
+ color: colorProp = 'inherit',
83
+ ellipsizeMode = 'tail',
84
+ href,
85
+ numberOfLines,
86
+ onPress,
87
+ selectable,
88
+ style,
89
+ variant = 'body1',
90
+ onLayout,
91
+ onTextLayout
92
+ } = props;
93
+ const theme = useTheme();
94
+ const fontStyle = createFontStyle(theme, {
95
+ selector: typography => typography[variant],
96
+ color: selectColor(theme, colorProp)
97
+ }); // To prevent white-space: pre, word-wrap:break-word style conflicting issue at safari browser.
98
+
99
+ const textWrapStyle = numberOfLines && numberOfLines > 0 && Platform.OS === 'web' ? {
100
+ wordWrap: 'normal'
101
+ } : {};
102
+ const textStyle = css([styles.root, {
103
+ textAlign: align === 'inherit' ? 'auto' : align
104
+ }, textWrapStyle, fontStyle, style]);
105
+ const accessibility = accessibilityMap[variant];
106
+ const variantRole = href !== undefined ? 'link' : accessibility === null || accessibility === void 0 ? void 0 : accessibility.accessibilityRole;
107
+ const variantLevel = accessibility === null || accessibility === void 0 ? void 0 : accessibility['area-level'];
108
+ return /*#__PURE__*/React.createElement(Text, {
109
+ ref: ref,
110
+ accessibilityRole: accessibilityRole || variantRole,
111
+ allowFontScaling: !disableFontScaling,
112
+ "aria-level": ariaLevel || variantLevel,
113
+ children: children,
114
+ ellipsizeMode: ellipsizeMode // @ts-ignore
115
+ ,
116
+ href: href,
117
+ numberOfLines: numberOfLines,
118
+ onPress: onPress,
119
+ selectable: selectable,
120
+ style: textStyle,
121
+ onLayout: onLayout,
122
+ onTextLayout: onTextLayout
123
+ });
124
+ });
125
+ export default /*#__PURE__*/React.memo(Typography);
126
+ //# sourceMappingURL=LegacyTypography.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Platform","Text","createFontStyle","css","StyleSheet","useTheme","accessibilityMap","h1","accessibilityRole","h2","h3","subtitle1","subtitle2","body1","body2","caption1","caption2","flag","selectColor","theme","colorProp","palette","text","OS","undefined","primary","secondary","accent","hint","main","styles","create","root","flexShrink","maxWidth","Typography","forwardRef","props","ref","align","ariaLevel","disableFontScaling","children","color","ellipsizeMode","href","numberOfLines","onPress","selectable","style","variant","onLayout","onTextLayout","fontStyle","selector","typography","textWrapStyle","wordWrap","textStyle","textAlign","accessibility","variantRole","variantLevel","memo"],"sources":["LegacyTypography.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, Text, TextStyle } from 'react-native';\nimport type { Theme } from '@fountain-ui/styles';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport TypographyProps, { AccessibilityMap, TypographyColor } from './LegacyTypographyProps';\n\nconst accessibilityMap: AccessibilityMap = {\n h1: { accessibilityRole: 'header', 'area-level': 1 },\n h2: { accessibilityRole: 'header', 'area-level': 2 },\n h3: { accessibilityRole: 'header', 'area-level': 3 },\n subtitle1: { accessibilityRole: 'header', 'area-level': 6 },\n subtitle2: { accessibilityRole: 'header', 'area-level': 6 },\n body1: { accessibilityRole: 'text' },\n body2: { accessibilityRole: 'text' },\n caption1: { accessibilityRole: 'text' },\n caption2: { accessibilityRole: 'text' },\n flag: { accessibilityRole: 'text' },\n};\n\nfunction selectColor(theme: Theme, colorProp: TypographyColor): string | undefined {\n const palette = theme.palette.text;\n\n switch (colorProp) {\n case 'inherit':\n return Platform.OS === 'web' ? 'inherit' : undefined;\n case 'textPrimary':\n return palette.primary;\n case 'textSecondary':\n return palette.secondary;\n case 'textAccent':\n return palette.accent;\n case 'textHint':\n return palette.hint;\n }\n\n return theme.palette[colorProp]?.main;\n}\n\nconst styles = StyleSheet.create({\n root: {\n flexShrink: 1,\n ...(Platform.OS === 'web' ? { maxWidth: '100%' } : {}),\n },\n});\n\nconst Typography = React.forwardRef<Text, TypographyProps>(function Typography(props, ref) {\n const {\n accessibilityRole,\n align = 'inherit',\n ariaLevel,\n disableFontScaling = false,\n children,\n color: colorProp = 'inherit',\n ellipsizeMode = 'tail',\n href,\n numberOfLines,\n onPress,\n selectable,\n style,\n variant = 'body1',\n onLayout,\n onTextLayout,\n } = props;\n\n const theme = useTheme();\n\n const fontStyle = createFontStyle(theme, {\n selector: (typography) => typography[variant],\n color: selectColor(theme, colorProp),\n });\n\n // To prevent white-space: pre, word-wrap:break-word style conflicting issue at safari browser.\n const textWrapStyle = numberOfLines && numberOfLines > 0 && Platform.OS === 'web' ? { wordWrap: 'normal' } : {};\n\n const textStyle = css([\n styles.root,\n { textAlign: align === 'inherit' ? 'auto' : align },\n textWrapStyle as TextStyle,\n fontStyle,\n style,\n ]);\n\n const accessibility = accessibilityMap[variant];\n const variantRole = href !== undefined ? 'link' : accessibility?.accessibilityRole;\n const variantLevel = accessibility?.['area-level'];\n\n return (\n <Text\n ref={ref}\n accessibilityRole={accessibilityRole || variantRole}\n allowFontScaling={!disableFontScaling}\n aria-level={ariaLevel || variantLevel}\n children={children}\n ellipsizeMode={ellipsizeMode}\n // @ts-ignore\n href={href}\n numberOfLines={numberOfLines}\n onPress={onPress}\n selectable={selectable}\n style={textStyle}\n onLayout={onLayout}\n onTextLayout={onTextLayout}\n />\n );\n});\n\nexport default React.memo(Typography);\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,EAAmBC,IAAnB,QAA0C,cAA1C;AAEA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,UAA/B,EAA2CC,QAA3C,QAA2D,WAA3D;AAGA,MAAMC,gBAAkC,GAAG;EACvCC,EAAE,EAAE;IAAEC,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CADmC;EAEvCC,EAAE,EAAE;IAAED,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CAFmC;EAGvCE,EAAE,EAAE;IAAEF,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CAHmC;EAIvCG,SAAS,EAAE;IAAEH,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CAJ4B;EAKvCI,SAAS,EAAE;IAAEJ,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CAL4B;EAMvCK,KAAK,EAAE;IAAEL,iBAAiB,EAAE;EAArB,CANgC;EAOvCM,KAAK,EAAE;IAAEN,iBAAiB,EAAE;EAArB,CAPgC;EAQvCO,QAAQ,EAAE;IAAEP,iBAAiB,EAAE;EAArB,CAR6B;EASvCQ,QAAQ,EAAE;IAAER,iBAAiB,EAAE;EAArB,CAT6B;EAUvCS,IAAI,EAAE;IAAET,iBAAiB,EAAE;EAArB;AAViC,CAA3C;;AAaA,SAASU,WAAT,CAAqBC,KAArB,EAAmCC,SAAnC,EAAmF;EAAA;;EAC/E,MAAMC,OAAO,GAAGF,KAAK,CAACE,OAAN,CAAcC,IAA9B;;EAEA,QAAQF,SAAR;IACI,KAAK,SAAL;MACI,OAAOpB,QAAQ,CAACuB,EAAT,KAAgB,KAAhB,GAAwB,S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import type { AccessibilityProps, TextProps } from 'react-native';\nimport type { ComponentProps } from '../types';\n\nexport type TypographyAlign = 'inherit' | 'left' | 'center' | 'right' | 'justify';\n\nexport type TypographyColor =\n | 'inherit'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'warning'\n | 'error'\n | 'accent'\n | 'textPrimary'\n | 'textSecondary'\n | 'textAccent'\n | 'textHint';\n\nexport type TypographyVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'subtitle1'\n | 'subtitle2'\n | 'body1'\n | 'body2'\n | 'caption1'\n | 'caption2'\n | 'flag'\n | 'button1'\n | 'button2';\n\nexport interface Accessibility {\n accessibilityRole: AccessibilityProps['accessibilityRole'];\n 'area-level'?: number;\n}\n\nexport interface AccessibilityMap extends Partial<{\n [key: string]: Accessibility;\n}> {}\n\nexport default interface TypographyProps extends ComponentProps<{\n /**\n * Applies HTML tag at web and communicates purpose of component at app\n */\n accessibilityRole?: AccessibilityProps['accessibilityRole'];\n\n /**\n * Set the text-align on the component.\n * The value 'justify' is not supported on Android and fallbacks to left.\n * @default 'inherit'\n */\n align?: TypographyAlign;\n\n /**\n * Applies HTML heading level\n */\n ariaLevel?: number;\n\n /**\n * Specifies whether fonts should scale to respect Text Size accessibility settings.\n * @default false\n */\n disableFontScaling?: boolean;\n\n /**\n * The content of the component.\n */\n children?: React.ReactNode;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'inherit'\n */\n color?: TypographyColor;\n\n /**\n * The text ellipsis mode.\n * @default 'tail'\n */\n ellipsizeMode?: TextProps['ellipsizeMode'];\n\n /**\n * Internal use only. The hyperlink of the text.\n */\n href?: string;\n\n /**\n * Used to truncate the text with an ellipsis after computing the text\n * layout, including line wrapping, such that the total number of lines\n * does not exceed this number.\n */\n numberOfLines?: TextProps['numberOfLines'];\n\n /**\n * Lets the user select text, to use the native copy and paste functionality.\n */\n onPress?: TextProps['onPress'];\n\n /**\n * Lets the user select text, to use the native copy and paste functionality.\n */\n selectable?: boolean;\n\n /**\n * Applies the theme typography styles.\n * @default 'body1'\n */\n variant?: TypographyVariant;\n\n\n /**\n * Callback that is called when the text layout has been calculated.\n */\n onTextLayout?: TextProps['onTextLayout'];\n\n /**\n * Callback that is called when the layout of the Text component changes.\n */\n onLayout?: TextProps['onLayout'];\n}> {}\n"],"mappings":""}
@@ -1,67 +1,27 @@
1
1
  import React from 'react';
2
2
  import { Platform, Text } from 'react-native';
3
3
  import { createFontStyle, css, StyleSheet, useTheme } from '../styles';
4
- const accessibilityMap = {
5
- h1: {
6
- accessibilityRole: 'header',
7
- 'area-level': 1
8
- },
9
- h2: {
10
- accessibilityRole: 'header',
11
- 'area-level': 2
12
- },
13
- h3: {
14
- accessibilityRole: 'header',
15
- 'area-level': 3
16
- },
17
- subtitle1: {
18
- accessibilityRole: 'header',
19
- 'area-level': 6
20
- },
21
- subtitle2: {
22
- accessibilityRole: 'header',
23
- 'area-level': 6
24
- },
25
- body1: {
26
- accessibilityRole: 'text'
27
- },
28
- body2: {
29
- accessibilityRole: 'text'
30
- },
31
- caption1: {
32
- accessibilityRole: 'text'
33
- },
34
- caption2: {
35
- accessibilityRole: 'text'
36
- },
37
- flag: {
38
- accessibilityRole: 'text'
39
- }
4
+ const accessibilityMap = {// TODO: set accessibilityRole.
5
+ // h1: { accessibilityRole: 'header', 'aria-level': 1 },
6
+ // h2: { accessibilityRole: 'header', 'aria-level': 2 },
7
+ // h3: { accessibilityRole: 'header', 'aria-level': 3 },
8
+ // subtitle1: { accessibilityRole: 'header', 'aria-level': 6 },
9
+ // subtitle2: { accessibilityRole: 'header', 'aria-level': 6 },
10
+ // body1: { accessibilityRole: 'text' },
11
+ // body2: { accessibilityRole: 'text' },
12
+ // caption1: { accessibilityRole: 'text' },
13
+ // caption2: { accessibilityRole: 'text' },
14
+ // flag: { accessibilityRole: 'text' },
40
15
  };
41
16
 
42
17
  function selectColor(theme, colorProp) {
43
- var _theme$palette$colorP;
44
-
45
- const palette = theme.palette.text;
46
-
47
18
  switch (colorProp) {
48
19
  case 'inherit':
49
20
  return Platform.OS === 'web' ? 'inherit' : undefined;
50
21
 
51
- case 'textPrimary':
52
- return palette.primary;
53
-
54
- case 'textSecondary':
55
- return palette.secondary;
56
-
57
- case 'textAccent':
58
- return palette.accent;
59
-
60
- case 'textHint':
61
- return palette.hint;
22
+ default:
23
+ return theme.palette.text[colorProp];
62
24
  }
63
-
64
- return (_theme$palette$colorP = theme.palette[colorProp]) === null || _theme$palette$colorP === void 0 ? void 0 : _theme$palette$colorP.main;
65
25
  }
66
26
 
67
27
  const styles = StyleSheet.create({
@@ -87,12 +47,13 @@ const Typography = /*#__PURE__*/React.forwardRef(function Typography(props, ref)
87
47
  selectable,
88
48
  style,
89
49
  variant = 'body1',
50
+ weight = 'medium',
90
51
  onLayout,
91
52
  onTextLayout
92
53
  } = props;
93
54
  const theme = useTheme();
94
55
  const fontStyle = createFontStyle(theme, {
95
- selector: typography => typography[variant],
56
+ selector: typography => typography[variant][weight],
96
57
  color: selectColor(theme, colorProp)
97
58
  }); // To prevent white-space: pre, word-wrap:break-word style conflicting issue at safari browser.
98
59
 
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","Text","createFontStyle","css","StyleSheet","useTheme","accessibilityMap","h1","accessibilityRole","h2","h3","subtitle1","subtitle2","body1","body2","caption1","caption2","flag","selectColor","theme","colorProp","palette","text","OS","undefined","primary","secondary","accent","hint","main","styles","create","root","flexShrink","maxWidth","Typography","forwardRef","props","ref","align","ariaLevel","disableFontScaling","children","color","ellipsizeMode","href","numberOfLines","onPress","selectable","style","variant","onLayout","onTextLayout","fontStyle","selector","typography","textWrapStyle","wordWrap","textStyle","textAlign","accessibility","variantRole","variantLevel","memo"],"sources":["Typography.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, Text, TextStyle } from 'react-native';\nimport type { Theme } from '@fountain-ui/styles';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport TypographyProps, { AccessibilityMap, TypographyColor } from './TypographyProps';\n\nconst accessibilityMap: AccessibilityMap = {\n h1: { accessibilityRole: 'header', 'area-level': 1 },\n h2: { accessibilityRole: 'header', 'area-level': 2 },\n h3: { accessibilityRole: 'header', 'area-level': 3 },\n subtitle1: { accessibilityRole: 'header', 'area-level': 6 },\n subtitle2: { accessibilityRole: 'header', 'area-level': 6 },\n body1: { accessibilityRole: 'text' },\n body2: { accessibilityRole: 'text' },\n caption1: { accessibilityRole: 'text' },\n caption2: { accessibilityRole: 'text' },\n flag: { accessibilityRole: 'text' },\n};\n\nfunction selectColor(theme: Theme, colorProp: TypographyColor): string | undefined {\n const palette = theme.palette.text;\n\n switch (colorProp) {\n case 'inherit':\n return Platform.OS === 'web' ? 'inherit' : undefined;\n case 'textPrimary':\n return palette.primary;\n case 'textSecondary':\n return palette.secondary;\n case 'textAccent':\n return palette.accent;\n case 'textHint':\n return palette.hint;\n }\n\n return theme.palette[colorProp]?.main;\n}\n\nconst styles = StyleSheet.create({\n root: {\n flexShrink: 1,\n ...(Platform.OS === 'web' ? { maxWidth: '100%' } : {}),\n },\n});\n\nconst Typography = React.forwardRef<Text, TypographyProps>(function Typography(props, ref) {\n const {\n accessibilityRole,\n align = 'inherit',\n ariaLevel,\n disableFontScaling = false,\n children,\n color: colorProp = 'inherit',\n ellipsizeMode = 'tail',\n href,\n numberOfLines,\n onPress,\n selectable,\n style,\n variant = 'body1',\n onLayout,\n onTextLayout,\n } = props;\n\n const theme = useTheme();\n\n const fontStyle = createFontStyle(theme, {\n selector: (typography) => typography[variant],\n color: selectColor(theme, colorProp),\n });\n\n // To prevent white-space: pre, word-wrap:break-word style conflicting issue at safari browser.\n const textWrapStyle = numberOfLines && numberOfLines > 0 && Platform.OS === 'web' ? { wordWrap: 'normal' } : {};\n\n const textStyle = css([\n styles.root,\n { textAlign: align === 'inherit' ? 'auto' : align },\n textWrapStyle as TextStyle,\n fontStyle,\n style,\n ]);\n\n const accessibility = accessibilityMap[variant];\n const variantRole = href !== undefined ? 'link' : accessibility?.accessibilityRole;\n const variantLevel = accessibility?.['area-level'];\n\n return (\n <Text\n ref={ref}\n accessibilityRole={accessibilityRole || variantRole}\n allowFontScaling={!disableFontScaling}\n aria-level={ariaLevel || variantLevel}\n children={children}\n ellipsizeMode={ellipsizeMode}\n // @ts-ignore\n href={href}\n numberOfLines={numberOfLines}\n onPress={onPress}\n selectable={selectable}\n style={textStyle}\n onLayout={onLayout}\n onTextLayout={onTextLayout}\n />\n );\n});\n\nexport default React.memo(Typography);\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,EAAmBC,IAAnB,QAA0C,cAA1C;AAEA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,UAA/B,EAA2CC,QAA3C,QAA2D,WAA3D;AAGA,MAAMC,gBAAkC,GAAG;EACvCC,EAAE,EAAE;IAAEC,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CADmC;EAEvCC,EAAE,EAAE;IAAED,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CAFmC;EAGvCE,EAAE,EAAE;IAAEF,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CAHmC;EAIvCG,SAAS,EAAE;IAAEH,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CAJ4B;EAKvCI,SAAS,EAAE;IAAEJ,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CAL4B;EAMvCK,KAAK,EAAE;IAAEL,iBAAiB,EAAE;EAArB,CANgC;EAOvCM,KAAK,EAAE;IAAEN,iBAAiB,EAAE;EAArB,CAPgC;EAQvCO,QAAQ,EAAE;IAAEP,iBAAiB,EAAE;EAArB,CAR6B;EASvCQ,QAAQ,EAAE;IAAER,iBAAiB,EAAE;EAArB,CAT6B;EAUvCS,IAAI,EAAE;IAAET,iBAAiB,EAAE;EAArB;AAViC,CAA3C;;AAaA,SAASU,WAAT,CAAqBC,KAArB,EAAmCC,SAAnC,EAAmF;EAAA;;EAC/E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AAf"}
1
+ {"version":3,"names":["React","Platform","Text","createFontStyle","css","StyleSheet","useTheme","accessibilityMap","selectColor","theme","colorProp","OS","undefined","palette","text","styles","create","root","flexShrink","maxWidth","Typography","forwardRef","props","ref","accessibilityRole","align","ariaLevel","disableFontScaling","children","color","ellipsizeMode","href","numberOfLines","onPress","selectable","style","variant","weight","onLayout","onTextLayout","fontStyle","selector","typography","textWrapStyle","wordWrap","textStyle","textAlign","accessibility","variantRole","variantLevel","memo"],"sources":["Typography.tsx"],"sourcesContent":["import React from 'react';\nimport type { TextProps, TextStyle } from 'react-native';\nimport { Platform, Text } from 'react-native';\nimport type { FontVariant, FontWeight, Theme } from '@fountain-ui/styles';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport type TypographyProps from './TypographyProps';\nimport type { AccessibilityMap, TypographyAlign, TypographyColor } from './TypographyProps';\n\nconst accessibilityMap: AccessibilityMap = {\n // TODO: set accessibilityRole.\n // h1: { accessibilityRole: 'header', 'aria-level': 1 },\n // h2: { accessibilityRole: 'header', 'aria-level': 2 },\n // h3: { accessibilityRole: 'header', 'aria-level': 3 },\n // subtitle1: { accessibilityRole: 'header', 'aria-level': 6 },\n // subtitle2: { accessibilityRole: 'header', 'aria-level': 6 },\n // body1: { accessibilityRole: 'text' },\n // body2: { accessibilityRole: 'text' },\n // caption1: { accessibilityRole: 'text' },\n // caption2: { accessibilityRole: 'text' },\n // flag: { accessibilityRole: 'text' },\n};\n\nfunction selectColor(theme: Theme, colorProp: TypographyColor): string | undefined {\n switch (colorProp) {\n case 'inherit':\n return Platform.OS === 'web' ? 'inherit' : undefined;\n default:\n return theme.palette.text[colorProp];\n }\n}\n\nconst styles = StyleSheet.create({\n root: {\n flexShrink: 1,\n ...(Platform.OS === 'web' ? { maxWidth: '100%' } : {}),\n },\n});\n\nconst Typography = React.forwardRef<Text, TypographyProps>(function Typography(props, ref) {\n const {\n accessibilityRole,\n align = 'inherit' as TypographyAlign,\n ariaLevel,\n disableFontScaling = false,\n children,\n color: colorProp = 'inherit' as TypographyColor,\n ellipsizeMode = 'tail' as TextProps['ellipsizeMode'],\n href,\n numberOfLines,\n onPress,\n selectable,\n style,\n variant = 'body1' as FontVariant,\n weight = 'medium' as FontWeight,\n onLayout,\n onTextLayout,\n } = props;\n\n const theme = useTheme();\n\n const fontStyle = createFontStyle(theme, {\n selector: (typography) => typography[variant][weight],\n color: selectColor(theme, colorProp),\n });\n\n // To prevent white-space: pre, word-wrap:break-word style conflicting issue at safari browser.\n const textWrapStyle = numberOfLines && numberOfLines > 0 && Platform.OS === 'web' ? { wordWrap: 'normal' } : {};\n\n const textStyle = css([\n styles.root,\n { textAlign: align === 'inherit' ? 'auto' : align },\n textWrapStyle as TextStyle,\n fontStyle,\n style,\n ]);\n\n const accessibility = accessibilityMap[variant];\n const variantRole = href !== undefined ? 'link' : accessibility?.accessibilityRole;\n const variantLevel = accessibility?.['area-level'];\n\n return (\n <Text\n ref={ref}\n accessibilityRole={accessibilityRole || variantRole}\n allowFontScaling={!disableFontScaling}\n aria-level={ariaLevel || variantLevel}\n children={children}\n ellipsizeMode={ellipsizeMode}\n // @ts-ignore\n href={href}\n numberOfLines={numberOfLines}\n onPress={onPress}\n selectable={selectable}\n style={textStyle}\n onLayout={onLayout}\n onTextLayout={onTextLayout}\n />\n );\n});\n\nexport default React.memo(Typography);\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAASC,QAAT,EAAmBC,IAAnB,QAA+B,cAA/B;AAEA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,UAA/B,EAA2CC,QAA3C,QAA2D,WAA3D;AAIA,MAAMC,gBAAkC,GAAG,CACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAXuC,CAA3C;;AAcA,SAASC,WAAT,CAAqBC,KAArB,EAAmCC,SAAnC,EAAmF;EAC/E,QAAQA,SAAR;IACI,KAAK,SAAL;MACI,OAAOT,QAAQ,CAACU,EAAT,KAAg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GAAGzC,GAAG,CAAC,CAClBW,MAAM,CAACE,IADW,EAElB;IAAE6B,SAAS,EAAErB,KAAK,KAAK,SAAV,GAAsB,MAAtB,GAA+BA;EAA5C,CAFkB,EAGlBkB,aAHkB,EAIlBH,SAJkB,EAKlBL,KALkB,CAAD,CAArB;EAQA,MAAMY,aAAa,GAAGxC,gBAAgB,CAAC6B,OAAD,CAAtC;EACA,MAAMY,WAAW,GAAGjB,IAAI,KAAKnB,SAAT,GAAqB,MAArB,GAA8BmC,aAA9B,aAA8BA,aAA9B,uBAA8BA,aAAa,CAAEvB,iBAAjE;EACA,MAAMyB,YAAY,GAAGF,aAAH,aAAGA,aAAH,uBAAGA,aAAa,CAAG,YAAH,CAAlC;EAEA,oBACI,oBAAC,IAAD;IACI,GAAG,EAAExB,GADT;IAEI,iBAAiB,EAAEC,iBAAiB,IAAIwB,WAF5C;IAGI,gBAAgB,EAAE,CAACrB,kBAHvB;IAII,cAAYD,SAAS,IAAIuB,YAJ7B;IAKI,QAAQ,EAAErB,QALd;IAMI,aAAa,EAAEE,aANnB,CAOI;IAPJ;IAQI,IAAI,EAAEC,IARV;IASI,aAAa,EAAEC,aATnB;IAUI,OAAO,EAAEC,OAVb;IAWI,UAAU,EAAEC,UAXhB;IAYI,KAAK,EAAEW,SAZX;IAaI,QAAQ,EAAEP,QAbd;IAcI,YAAY,EAAEC;EAdlB,EADJ;AAkBH,CA5DkB,CAAnB;AA8DA,4BAAevC,KAAK,CAACkD,IAAN,CAAW9B,UAAX,CAAf"}
@@ -1,2 +1,2 @@
1
-
1
+ export const typographyColors = ['inherit', 'accent', 'accentAlt', 'strong', 'strongInverse', 'base', 'baseInverse', 'baseOpacity', 'baseOpacityInverse', 'weak', 'weakOpacity', 'weakInverse', 'weakOpacityInverse'];
2
2
  //# sourceMappingURL=TypographyProps.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["TypographyProps.ts"],"sourcesContent":["import React from 'react';\nimport type { AccessibilityProps, TextProps } from 'react-native';\nimport type { ComponentProps } from '../types';\n\nexport type TypographyAlign = 'inherit' | 'left' | 'center' | 'right' | 'justify';\n\nexport type TypographyColor =\n | 'inherit'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'warning'\n | 'error'\n | 'accent'\n | 'textPrimary'\n | 'textSecondary'\n | 'textAccent'\n | 'textHint';\n\nexport type TypographyVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'subtitle1'\n | 'subtitle2'\n | 'body1'\n | 'body2'\n | 'caption1'\n | 'caption2'\n | 'flag'\n | 'button1'\n | 'button2';\n\nexport interface Accessibility {\n accessibilityRole: AccessibilityProps['accessibilityRole'];\n 'area-level'?: number;\n}\n\nexport interface AccessibilityMap extends Partial<{\n [key: string]: Accessibility;\n}> {}\n\nexport default interface TypographyProps extends ComponentProps<{\n /**\n * Applies HTML tag at web and communicates purpose of component at app\n */\n accessibilityRole?: AccessibilityProps['accessibilityRole'];\n\n /**\n * Set the text-align on the component.\n * The value 'justify' is not supported on Android and fallbacks to left.\n * @default 'inherit'\n */\n align?: TypographyAlign;\n\n /**\n * Applies HTML heading level\n */\n ariaLevel?: number;\n\n /**\n * Specifies whether fonts should scale to respect Text Size accessibility settings.\n * @default false\n */\n disableFontScaling?: boolean;\n\n /**\n * The content of the component.\n */\n children?: React.ReactNode;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'inherit'\n */\n color?: TypographyColor;\n\n /**\n * The text ellipsis mode.\n * @default 'tail'\n */\n ellipsizeMode?: TextProps['ellipsizeMode'];\n\n /**\n * Internal use only. The hyperlink of the text.\n */\n href?: string;\n\n /**\n * Used to truncate the text with an ellipsis after computing the text\n * layout, including line wrapping, such that the total number of lines\n * does not exceed this number.\n */\n numberOfLines?: TextProps['numberOfLines'];\n\n /**\n * Lets the user select text, to use the native copy and paste functionality.\n */\n onPress?: TextProps['onPress'];\n\n /**\n * Lets the user select text, to use the native copy and paste functionality.\n */\n selectable?: boolean;\n\n /**\n * Applies the theme typography styles.\n * @default 'body1'\n */\n variant?: TypographyVariant;\n\n\n /**\n * Callback that is called when the text layout has been calculated.\n */\n onTextLayout?: TextProps['onTextLayout'];\n\n /**\n * Callback that is called when the layout of the Text component changes.\n */\n onLayout?: TextProps['onLayout'];\n}> {}\n"],"mappings":""}
1
+ {"version":3,"names":["typographyColors"],"sources":["TypographyProps.ts"],"sourcesContent":["import React from 'react';\nimport type { AccessibilityProps, TextProps, TextStyle } from 'react-native';\nimport type { FontVariant, FontWeight } from '@fountain-ui/styles';\nimport type { ComponentProps } from '../types';\n\nexport type TypographyAlign = 'inherit' | TextStyle['textAlign'];\n\nexport const typographyColors = [\n 'inherit',\n 'accent',\n 'accentAlt',\n 'strong',\n 'strongInverse',\n 'base',\n 'baseInverse',\n 'baseOpacity',\n 'baseOpacityInverse',\n 'weak',\n 'weakOpacity',\n 'weakInverse',\n 'weakOpacityInverse',\n] as const;\n\nexport type TypographyColor = typeof typographyColors[number];\n\nexport interface Accessibility {\n accessibilityRole: AccessibilityProps['accessibilityRole'];\n 'area-level'?: number;\n}\n\nexport type AccessibilityMap = Partial<Record<FontVariant, Accessibility>>;\n\nexport default interface TypographyProps extends ComponentProps<{\n /**\n * Applies HTML tag at web and communicates purpose of component at app\n */\n accessibilityRole?: AccessibilityProps['accessibilityRole'];\n\n /**\n * Set the text-align on the component.\n * The value 'justify' is not supported on Android and fallbacks to left.\n * @default 'inherit'\n */\n align?: TypographyAlign;\n\n /**\n * Applies HTML heading level\n */\n ariaLevel?: number;\n\n /**\n * Specifies whether fonts should scale to respect Text Size accessibility settings.\n * @default false\n */\n disableFontScaling?: boolean;\n\n /**\n * The content of the component.\n */\n children?: React.ReactNode;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'inherit'\n */\n color?: TypographyColor;\n\n /**\n * The text ellipsis mode.\n * @default 'tail'\n */\n ellipsizeMode?: TextProps['ellipsizeMode'];\n\n /**\n * Internal use only. The hyperlink of the text.\n */\n href?: string;\n\n /**\n * Used to truncate the text with an ellipsis after computing the text\n * layout, including line wrapping, such that the total number of lines\n * does not exceed this number.\n */\n numberOfLines?: TextProps['numberOfLines'];\n\n /**\n * Lets the user select text, to use the native copy and paste functionality.\n */\n onPress?: TextProps['onPress'];\n\n /**\n * Lets the user select text, to use the native copy and paste functionality.\n */\n selectable?: boolean;\n\n /**\n * Applies the theme typography styles.\n * @default 'body1'\n */\n variant?: FontVariant;\n\n /**\n * Determines the font weight.\n * @default 'medium'\n */\n weight?: FontWeight;\n\n /**\n * Callback that is called when the text layout has been calculated.\n */\n onTextLayout?: TextProps['onTextLayout'];\n\n /**\n * Callback that is called when the layout of the Text component changes.\n */\n onLayout?: TextProps['onLayout'];\n}> {}\n"],"mappings":"AAOA,OAAO,MAAMA,gBAAgB,GAAG,CAC5B,SAD4B,EAE5B,QAF4B,EAG5B,WAH4B,EAI5B,QAJ4B,EAK5B,eAL4B,EAM5B,MAN4B,EAO5B,aAP4B,EAQ5B,aAR4B,EAS5B,oBAT4B,EAU5B,MAV4B,EAW5B,aAX4B,EAY5B,aAZ4B,EAa5B,oBAb4B,CAAzB"}
@@ -1,2 +1,2 @@
1
- export { default } from './Typography';
1
+ export { default } from './LegacyTypography';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './Typography';\nexport type { default as TypographyProps } from './TypographyProps';"],"mappings":"AAAA,SAASA,OAAT,QAAwB,cAAxB"}
1
+ {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './LegacyTypography';\nexport type { default as TypographyProps } from './LegacyTypographyProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,oBAAxB"}
@@ -1,4 +1,4 @@
1
- import { useCallback, useRef } from 'react';
1
+ import { useCallback, useRef, useState } from 'react';
2
2
  import { Keyboard, Platform, StyleSheet } from 'react-native';
3
3
  import { runOnJS, useAnimatedScrollHandler, useAnimatedStyle, useDerivedValue, useSharedValue, withTiming } from 'react-native-reanimated';
4
4
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
@@ -36,6 +36,7 @@ export default function useCollapsibleAppBar() {
36
36
  const lastTranslateY = useSharedValue(0);
37
37
  const lastOffsetY = useSharedValue(0);
38
38
  const overlapped = useSharedValue(false);
39
+ const [isScrolled, setIsScrolled] = useState(false);
39
40
  const theme = useTheme();
40
41
  const animatedStyle = useAnimatedStyle(() => {
41
42
  const transform = [{
@@ -80,6 +81,13 @@ export default function useCollapsibleAppBar() {
80
81
  },
81
82
  onScroll: event => {
82
83
  const offsetY = event.contentOffset.y;
84
+
85
+ if (!isScrolled && offsetY > 0) {
86
+ runOnJS(setIsScrolled)(true);
87
+ } else if (isScrolled && offsetY <= 0) {
88
+ runOnJS(setIsScrolled)(false);
89
+ }
90
+
83
91
  const maxTy = maxTranslateY.value;
84
92
 
85
93
  if (SUPPORTS_DRAG_DETECTION) {
@@ -117,7 +125,7 @@ export default function useCollapsibleAppBar() {
117
125
  overlapped.value = offsetY + nextTranslateY > 0;
118
126
  translateY.value = withTiming(nextTranslateY, ANIMATION_CONFIG);
119
127
  }
120
- }, [keyboardDismissMode, appBarHeight]);
128
+ }, [keyboardDismissMode, appBarHeight, isScrolled]);
121
129
  const hasCollapsible = collapsibleToolbarHeight > 0;
122
130
  const appBarStyle = [animatedStyle, {
123
131
  paddingTop: safeAreaInsets.top
@@ -130,7 +138,8 @@ export default function useCollapsibleAppBar() {
130
138
  onScrollViewChanged,
131
139
  scrollContentInsets: {
132
140
  top: hasCollapsible ? appBarHeight : 0
133
- }
141
+ },
142
+ isScrolled
134
143
  };
135
144
  }
136
145
  ;
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useRef","Keyboard","Platform","StyleSheet","runOnJS","useAnimatedScrollHandler","useAnimatedStyle","useDerivedValue","useSharedValue","withTiming","useSafeAreaInsets","useTheme","useHeight","useAppbarStyles","defaultOptions","keyboardDismissMode","dividerExposureMode","supportsReverseScroll","ANIMATION_CONFIG","duration","TRANSPARENT","SUPPORTS_DRAG_DETECTION","OS","dismissKeyboard","dismiss","useCollapsibleAppBar","userOptions","styles","safeAreaInsets","appBarHeight","onAppBarLayout","collapsibleToolbarHeight","onCollapsibleToolbarLayout","maxTranslateY","translateY","lastTranslateY","lastOffsetY","overlapped","theme","animatedStyle","transform","value","borderColor","palette","divider","borderBottomWidth","hairlineWidth","indexRef","offsetsRef","onScrollViewChanged","nextIndex","prevIndex","current","savedOffsetY","scrollHandler","onBeginDrag","onMomentumBegin","onScroll","event","offsetY","contentOffset","y","maxTy","dy","Math","min","max","minOffsetY","maxOffsetY","contentSize","height","layoutMeasurement","safeOffsetY","safeLastOffsetY","newTranslateY","onEndDrag","onMomentumEnd","ty","threshold","nextTranslateY","hasCollapsible","appBarStyle","paddingTop","top","floating","undefined","scrollContentInsets"],"sources":["useCollapsibleAppBar.ts"],"sourcesContent":["import { useCallback, useRef } from 'react';\nimport {\n Falsy,\n Keyboard,\n Platform,\n RegisteredStyle,\n ScrollViewProps,\n StyleSheet,\n ViewProps,\n ViewStyle,\n} from 'react-native';\nimport type { WithTimingConfig } from 'react-native-reanimated';\nimport {\n runOnJS,\n useAnimatedScrollHandler,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { useTheme } from '@fountain-ui/styles';\nimport { useHeight } from '../internal/hooks';\nimport useAppbarStyles from './useAppbarStyles';\n\ntype WebOnlyStyle = { boxShadow: any };\n\ntype ViewStyleProp = Array<ViewStyle | RegisteredStyle<ViewStyle> | WebOnlyStyle | Falsy>;\n\ntype OnScroll = ScrollViewProps['onScroll'];\n\ntype OnLayoutCallback = ViewProps['onLayout'];\n\nexport interface ContentInsets {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\nexport interface Options {\n keyboardDismissMode?: 'none' | 'on-drag';\n dividerExposureMode?: 'always' | 'overlapped';\n supportsReverseScroll?: boolean;\n}\n\nexport interface CollapsibleAppBar {\n appBarStyle: ViewStyleProp;\n onAppBarLayout: OnLayoutCallback;\n onCollapsibleToolbarLayout: OnLayoutCallback;\n onScroll: OnScroll;\n onScrollViewChanged: (index: number) => void;\n scrollContentInsets: ContentInsets;\n}\n\nconst defaultOptions: Required<Options> = {\n keyboardDismissMode: 'none',\n dividerExposureMode: 'overlapped',\n supportsReverseScroll: true,\n};\n\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = { duration: 100 };\nconst TRANSPARENT = '#FFFFFF00';\n\nconst SUPPORTS_DRAG_DETECTION = Platform.OS !== 'web';\nconst dismissKeyboard = () => Keyboard.dismiss();\n\nexport default function useCollapsibleAppBar(userOptions: Options = defaultOptions): CollapsibleAppBar {\n const { keyboardDismissMode, dividerExposureMode, supportsReverseScroll }: Required<Options> = {\n ...defaultOptions,\n ...userOptions,\n };\n\n const styles = useAppbarStyles();\n\n const safeAreaInsets = useSafeAreaInsets();\n\n const [appBarHeight, onAppBarLayout] = useHeight();\n const [collapsibleToolbarHeight, onCollapsibleToolbarLayout] = useHeight();\n\n const maxTranslateY = useDerivedValue(() => -collapsibleToolbarHeight, [collapsibleToolbarHeight]);\n\n const translateY = useSharedValue<number>(0);\n const lastTranslateY = useSharedValue<number>(0);\n const lastOffsetY = useSharedValue<number>(0);\n const overlapped = useSharedValue<boolean>(false);\n\n const theme = useTheme();\n\n const animatedStyle = useAnimatedStyle(() => {\n const transform = [{ translateY: translateY.value }];\n\n return {\n transform,\n borderColor: dividerExposureMode === 'always' || overlapped.value ? theme.palette.divider : TRANSPARENT,\n borderBottomWidth: StyleSheet.hairlineWidth,\n };\n }, [\n theme,\n dividerExposureMode,\n ]);\n\n const indexRef = useRef<number>(0);\n const offsetsRef = useRef<Array<number>>([]);\n\n const onScrollViewChanged = useCallback((nextIndex: number) => {\n const prevIndex = indexRef.current;\n if (prevIndex === nextIndex) {\n return;\n }\n\n offsetsRef.current[prevIndex] = lastOffsetY.value;\n\n const savedOffsetY = offsetsRef.current[nextIndex] ?? 0;\n lastOffsetY.value = savedOffsetY;\n\n indexRef.current = nextIndex;\n\n // Determine whether to overlap every time index is changed.\n overlapped.value = savedOffsetY > 0;\n\n // If next ScrollView's offset is too short, expand app bar.\n if (translateY.value < 0 && savedOffsetY < appBarHeight) {\n translateY.value = withTiming(0, ANIMATION_CONFIG);\n }\n }, [appBarHeight]);\n\n const scrollHandler = useAnimatedScrollHandler({\n onBeginDrag: () => {\n if (keyboardDismissMode === 'on-drag') {\n runOnJS(dismissKeyboard)();\n }\n lastTranslateY.value = translateY.value;\n },\n onMomentumBegin: () => {\n lastTranslateY.value = translateY.value;\n },\n onScroll: (event) => {\n const offsetY = event.contentOffset.y;\n\n const maxTy = maxTranslateY.value;\n\n if (SUPPORTS_DRAG_DETECTION) {\n const dy = offsetY - lastOffsetY.value;\n\n translateY.value = offsetY <= 0 ? 0 : Math.min(Math.max(lastTranslateY.value - dy, maxTy), 0);\n\n overlapped.value = offsetY + translateY.value > 0;\n } else {\n const minOffsetY = -maxTy;\n const maxOffsetY = event.contentSize.height - event.layoutMeasurement.height;\n\n const safeOffsetY = Math.min(Math.max(offsetY, minOffsetY), maxOffsetY);\n const safeLastOffsetY = Math.min(Math.max(lastOffsetY.value, minOffsetY), maxOffsetY);\n const dy = safeOffsetY - safeLastOffsetY;\n\n const newTranslateY = supportsReverseScroll\n ? dy === 0\n ? lastTranslateY.value\n : dy > 0\n ? maxTy\n : 0\n : safeLastOffsetY === minOffsetY\n ? 0\n : maxTy;\n\n translateY.value = withTiming(newTranslateY, ANIMATION_CONFIG);\n lastTranslateY.value = newTranslateY;\n\n overlapped.value = offsetY > 0;\n\n lastOffsetY.value = offsetY;\n }\n },\n onEndDrag: (event) => {\n lastOffsetY.value = event.contentOffset.y;\n },\n onMomentumEnd: (event) => {\n const offsetY = event.contentOffset.y;\n\n lastOffsetY.value = offsetY;\n\n const ty = translateY.value;\n const maxTy = maxTranslateY.value;\n\n // If toolbar is already positioned on edge, do nothing.\n if (ty <= maxTy || ty >= 0) {\n return;\n }\n\n const threshold = maxTy * 0.5;\n\n const nextTranslateY = (ty > threshold || offsetY < appBarHeight) ? 0 : maxTy;\n\n overlapped.value = offsetY + nextTranslateY > 0;\n\n translateY.value = withTiming(nextTranslateY, ANIMATION_CONFIG);\n },\n }, [keyboardDismissMode, appBarHeight]);\n\n const hasCollapsible = collapsibleToolbarHeight > 0;\n\n const appBarStyle = [\n animatedStyle,\n { paddingTop: safeAreaInsets.top },\n hasCollapsible ? styles.floating : undefined,\n ];\n\n return {\n appBarStyle,\n onAppBarLayout,\n onCollapsibleToolbarLayout,\n onScroll: scrollHandler,\n onScrollViewChanged,\n scrollContentInsets: { top: hasCollapsible ? appBarHeight : 0 },\n };\n};\n"],"mappings":"AAAA,SAASA,WAAT,EAAsBC,MAAtB,QAAoC,OAApC;AACA,SAEIC,QAFJ,EAGIC,QAHJ,EAMIC,UANJ,QASO,cATP;AAWA,SACIC,OADJ,EAEIC,wBAFJ,EAGIC,gBAHJ,EAIIC,eAJJ,EAKIC,cALJ,EAMIC,UANJ,QAOO,yBAPP;AAQA,SAASC,iBAAT,QAAkC,gCAAlC;AACA,SAASC,QAAT,QAAyB,qBAAzB;AACA,SAASC,SAAT,QAA0B,mBAA1B;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AAgCA,MAAMC,cAAiC,GAAG;EACtCC,mBAAmB,EAAE,MADiB;EAEtCC,mBAAmB,EAAE,YAFiB;EAGtCC,qBAAqB,EAAE;AAHe,CAA1C;AAMA,MAAMC,gBAA4C,GAAG;EAAEC,QAAQ,EAAE;AAAZ,CAArD;AACA,MAAMC,WAAW,GAAG,WAApB;AAEA,MAAMC,uBAAuB,GAAGnB,QAAQ,CAACoB,EAAT,KAAgB,KAAhD;;AACA,MAAMC,eAAe,GAAG,MAAMtB,QAAQ,CAACuB,OAAT,EAA9B;;AAEA,eAAe,SAASC,oBAAT,GAAwF;EAAA,IAA1DC,WAA0D,uEAAnCZ,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C;IACH,CAjD0C;IAkD3Ce,aAAa,EAAGlB,KAAD,IAAW;MACtB,MAAMC,OAAO,GAAGD,KAAK,CAACE,aAAN,CAAoBC,CAApC;MAEAzB,WAAW,CAACK,KAAZ,GAAoBkB,OAApB;MAEA,MAAMkB,EAAE,GAAG3C,UAAU,CAACO,KAAtB;MACA,MAAMqB,KAAK,GAAG7B,aAAa,CAACQ,KAA5B,CANsB,CAQtB;;MACA,IAAIoC,EAAE,IAAIf,KAAN,IAAee,EAAE,IAAI,CAAzB,EAA4B;QACxB;MACH;;MAED,MAAMC,SAAS,GAAGhB,KAAK,GAAG,GAA1B;MAEA,MAAMiB,cAAc,GAAIF,EAAE,GAAGC,SAAL,IAAkBnB,OAAO,GAAG9B,YAA7B,GAA6C,CAA7C,GAAiDiC,KAAxE;MAEAzB,UAAU,CAACI,KAAX,GAAmBkB,OAAO,GAAGoB,cAAV,GAA2B,CAA9C;MAEA7C,UAAU,CAACO,KAAX,GAAmBhC,UAAU,CAACsE,cAAD,EAAiB7D,gBAAjB,CAA7B;IACH;EAtE0C,CAAD,EAuE3C,CAACH,mBAAD,EAAsBc,YAAtB,CAvE2C,CAA9C;EAyEA,MAAMmD,cAAc,GAAGjD,wBAAwB,GAAG,CAAlD;EAEA,MAAMkD,WAAW,GAAG,CAChB1C,aADgB,EAEhB;IAAE2C,UAAU,EAAEtD,cAAc,CAACuD;EAA7B,CAFgB,EAGhBH,cAAc,GAAGrD,MAAM,CAACyD,QAAV,GAAqBC,SAHnB,CAApB;EAMA,OAAO;IACHJ,WADG;IAEHnD,cAFG;IAGHE,0BAHG;IAIHyB,QAAQ,EAAEH,aAJP;IAKHL,mBALG;IAMHqC,mBAAmB,EAAE;MAAEH,GAAG,EAAEH,cAAc,GAAGnD,YAAH,GAAkB;IAAvC;EANlB,CAAP;AAQH;AAAA"}
1
+ {"version":3,"names":["useCallback","useRef","useState","Keyboard","Platform","StyleSheet","runOnJS","useAnimatedScrollHandler","useAnimatedStyle","useDerivedValue","useSharedValue","withTiming","useSafeAreaInsets","useTheme","useHeight","useAppbarStyles","defaultOptions","keyboardDismissMode","dividerExposureMode","supportsReverseScroll","ANIMATION_CONFIG","duration","TRANSPARENT","SUPPORTS_DRAG_DETECTION","OS","dismissKeyboard","dismiss","useCollapsibleAppBar","userOptions","styles","safeAreaInsets","appBarHeight","onAppBarLayout","collapsibleToolbarHeight","onCollapsibleToolbarLayout","maxTranslateY","translateY","lastTranslateY","lastOffsetY","overlapped","isScrolled","setIsScrolled","theme","animatedStyle","transform","value","borderColor","palette","divider","borderBottomWidth","hairlineWidth","indexRef","offsetsRef","onScrollViewChanged","nextIndex","prevIndex","current","savedOffsetY","scrollHandler","onBeginDrag","onMomentumBegin","onScroll","event","offsetY","contentOffset","y","maxTy","dy","Math","min","max","minOffsetY","maxOffsetY","contentSize","height","layoutMeasurement","safeOffsetY","safeLastOffsetY","newTranslateY","onEndDrag","onMomentumEnd","ty","threshold","nextTranslateY","hasCollapsible","appBarStyle","paddingTop","top","floating","undefined","scrollContentInsets"],"sources":["useCollapsibleAppBar.ts"],"sourcesContent":["import { useCallback, useRef, useState } from 'react';\nimport {\n Falsy,\n Keyboard,\n Platform,\n RegisteredStyle,\n ScrollViewProps,\n StyleSheet,\n ViewProps,\n ViewStyle,\n} from 'react-native';\nimport type { WithTimingConfig } from 'react-native-reanimated';\nimport {\n runOnJS,\n useAnimatedScrollHandler,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { useTheme } from '@fountain-ui/styles';\nimport { useHeight } from '../internal/hooks';\nimport useAppbarStyles from './useAppbarStyles';\n\ntype WebOnlyStyle = { boxShadow: any };\n\ntype ViewStyleProp = Array<ViewStyle | RegisteredStyle<ViewStyle> | WebOnlyStyle | Falsy>;\n\ntype OnScroll = ScrollViewProps['onScroll'];\n\ntype OnLayoutCallback = ViewProps['onLayout'];\n\nexport interface ContentInsets {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\nexport interface Options {\n keyboardDismissMode?: 'none' | 'on-drag';\n dividerExposureMode?: 'always' | 'overlapped';\n supportsReverseScroll?: boolean;\n}\n\nexport interface CollapsibleAppBar {\n appBarStyle: ViewStyleProp;\n onAppBarLayout: OnLayoutCallback;\n onCollapsibleToolbarLayout: OnLayoutCallback;\n onScroll: OnScroll;\n onScrollViewChanged: (index: number) => void;\n scrollContentInsets: ContentInsets;\n isScrolled: boolean;\n}\n\nconst defaultOptions: Required<Options> = {\n keyboardDismissMode: 'none',\n dividerExposureMode: 'overlapped',\n supportsReverseScroll: true,\n};\n\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = { duration: 100 };\nconst TRANSPARENT = '#FFFFFF00';\n\nconst SUPPORTS_DRAG_DETECTION = Platform.OS !== 'web';\nconst dismissKeyboard = () => Keyboard.dismiss();\n\nexport default function useCollapsibleAppBar(userOptions: Options = defaultOptions): CollapsibleAppBar {\n const { keyboardDismissMode, dividerExposureMode, supportsReverseScroll }: Required<Options> = {\n ...defaultOptions,\n ...userOptions,\n };\n\n const styles = useAppbarStyles();\n\n const safeAreaInsets = useSafeAreaInsets();\n\n const [appBarHeight, onAppBarLayout] = useHeight();\n const [collapsibleToolbarHeight, onCollapsibleToolbarLayout] = useHeight();\n\n const maxTranslateY = useDerivedValue(() => -collapsibleToolbarHeight, [collapsibleToolbarHeight]);\n\n const translateY = useSharedValue<number>(0);\n const lastTranslateY = useSharedValue<number>(0);\n const lastOffsetY = useSharedValue<number>(0);\n const overlapped = useSharedValue<boolean>(false);\n\n const [isScrolled, setIsScrolled] = useState<boolean>(false);\n\n const theme = useTheme();\n\n const animatedStyle = useAnimatedStyle(() => {\n const transform = [{ translateY: translateY.value }];\n\n return {\n transform,\n borderColor: dividerExposureMode === 'always' || overlapped.value ? theme.palette.divider : TRANSPARENT,\n borderBottomWidth: StyleSheet.hairlineWidth,\n };\n }, [\n theme,\n dividerExposureMode,\n ]);\n\n const indexRef = useRef<number>(0);\n const offsetsRef = useRef<Array<number>>([]);\n\n const onScrollViewChanged = useCallback((nextIndex: number) => {\n const prevIndex = indexRef.current;\n if (prevIndex === nextIndex) {\n return;\n }\n\n offsetsRef.current[prevIndex] = lastOffsetY.value;\n\n const savedOffsetY = offsetsRef.current[nextIndex] ?? 0;\n lastOffsetY.value = savedOffsetY;\n\n indexRef.current = nextIndex;\n\n // Determine whether to overlap every time index is changed.\n overlapped.value = savedOffsetY > 0;\n\n // If next ScrollView's offset is too short, expand app bar.\n if (translateY.value < 0 && savedOffsetY < appBarHeight) {\n translateY.value = withTiming(0, ANIMATION_CONFIG);\n }\n }, [appBarHeight]);\n\n const scrollHandler = useAnimatedScrollHandler({\n onBeginDrag: () => {\n if (keyboardDismissMode === 'on-drag') {\n runOnJS(dismissKeyboard)();\n }\n lastTranslateY.value = translateY.value;\n },\n onMomentumBegin: () => {\n lastTranslateY.value = translateY.value;\n },\n onScroll: (event) => {\n const offsetY = event.contentOffset.y;\n\n if (!isScrolled && offsetY > 0) {\n runOnJS(setIsScrolled)(true);\n } else if (isScrolled && offsetY <= 0) {\n runOnJS(setIsScrolled)(false);\n }\n\n const maxTy = maxTranslateY.value;\n\n if (SUPPORTS_DRAG_DETECTION) {\n const dy = offsetY - lastOffsetY.value;\n\n translateY.value = offsetY <= 0 ? 0 : Math.min(Math.max(lastTranslateY.value - dy, maxTy), 0);\n\n overlapped.value = offsetY + translateY.value > 0;\n } else {\n const minOffsetY = -maxTy;\n const maxOffsetY = event.contentSize.height - event.layoutMeasurement.height;\n\n const safeOffsetY = Math.min(Math.max(offsetY, minOffsetY), maxOffsetY);\n const safeLastOffsetY = Math.min(Math.max(lastOffsetY.value, minOffsetY), maxOffsetY);\n const dy = safeOffsetY - safeLastOffsetY;\n\n const newTranslateY = supportsReverseScroll\n ? dy === 0\n ? lastTranslateY.value\n : dy > 0\n ? maxTy\n : 0\n : safeLastOffsetY === minOffsetY\n ? 0\n : maxTy;\n\n translateY.value = withTiming(newTranslateY, ANIMATION_CONFIG);\n lastTranslateY.value = newTranslateY;\n\n overlapped.value = offsetY > 0;\n\n lastOffsetY.value = offsetY;\n }\n },\n onEndDrag: (event) => {\n lastOffsetY.value = event.contentOffset.y;\n },\n onMomentumEnd: (event) => {\n const offsetY = event.contentOffset.y;\n\n lastOffsetY.value = offsetY;\n\n const ty = translateY.value;\n const maxTy = maxTranslateY.value;\n\n // If toolbar is already positioned on edge, do nothing.\n if (ty <= maxTy || ty >= 0) {\n return;\n }\n\n const threshold = maxTy * 0.5;\n\n const nextTranslateY = (ty > threshold || offsetY < appBarHeight) ? 0 : maxTy;\n\n overlapped.value = offsetY + nextTranslateY > 0;\n\n translateY.value = withTiming(nextTranslateY, ANIMATION_CONFIG);\n },\n }, [keyboardDismissMode, appBarHeight, isScrolled]);\n\n const hasCollapsible = collapsibleToolbarHeight > 0;\n\n const appBarStyle = [\n animatedStyle,\n { paddingTop: safeAreaInsets.top },\n hasCollapsible ? styles.floating : undefined,\n ];\n\n return {\n appBarStyle,\n onAppBarLayout,\n onCollapsibleToolbarLayout,\n onScroll: scrollHandler,\n onScrollViewChanged,\n scrollContentInsets: { top: hasCollapsible ? appBarHeight : 0 },\n isScrolled,\n };\n};\n"],"mappings":"AAAA,SAASA,WAAT,EAAsBC,MAAtB,EAA8BC,QAA9B,QAA8C,OAA9C;AACA,SAEIC,QAFJ,EAGIC,QAHJ,EAMIC,UANJ,QASO,cATP;AAWA,SACIC,OADJ,EAEIC,wBAFJ,EAGIC,gBAHJ,EAIIC,eAJJ,EAKIC,cALJ,EAMIC,UANJ,QAOO,yBAPP;AAQA,SAASC,iBAAT,QAAkC,gCAAlC;AACA,SAASC,QAAT,QAAyB,qBAAzB;AACA,SAASC,SAAT,QAA0B,mBAA1B;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AAiCA,MAAMC,cAAiC,GAAG;EACtCC,mBAAmB,EAAE,MADiB;EAEtCC,mBAAmB,EAAE,YAFiB;EAGtCC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AACwE,cAAD,EAAiB/D,gBAAjB,CAA7B;IACH;EA5E0C,CAAD,EA6E3C,CAACH,mBAAD,EAAsBc,YAAtB,EAAoCS,UAApC,CA7E2C,CAA9C;EA+EA,MAAM4C,cAAc,GAAGnD,wBAAwB,GAAG,CAAlD;EAEA,MAAMoD,WAAW,GAAG,CAChB1C,aADgB,EAEhB;IAAE2C,UAAU,EAAExD,cAAc,CAACyD;EAA7B,CAFgB,EAGhBH,cAAc,GAAGvD,MAAM,CAAC2D,QAAV,GAAqBC,SAHnB,CAApB;EAMA,OAAO;IACHJ,WADG;IAEHrD,cAFG;IAGHE,0BAHG;IAIH2B,QAAQ,EAAEH,aAJP;IAKHL,mBALG;IAMHqC,mBAAmB,EAAE;MAAEH,GAAG,EAAEH,cAAc,GAAGrD,YAAH,GAAkB;IAAvC,CANlB;IAOHS;EAPG,CAAP;AASH;AAAA"}
@@ -17,6 +17,8 @@ export { default as Button } from './Button';
17
17
  export * from './Button';
18
18
  export { default as ButtonBase } from './ButtonBase';
19
19
  export * from './ButtonBase';
20
+ export { default as ButtonSet } from './ButtonSet';
21
+ export * from './ButtonSet';
20
22
  export { default as Card } from './Card';
21
23
  export * from './Card';
22
24
  export { default as CardActions } from './CardActions';
@@ -27,6 +29,8 @@ export { default as CardMedia } from './CardMedia';
27
29
  export * from './CardMedia';
28
30
  export { default as Checkbox } from './Checkbox';
29
31
  export * from './Checkbox';
32
+ export { default as CheckboxGroup } from './CheckboxGroup';
33
+ export * from './CheckboxGroup';
30
34
  export { default as Chip } from './Chip';
31
35
  export * from './Chip';
32
36
  export { default as CircularProgress } from './CircularProgress';
@@ -70,7 +74,7 @@ export { default as Menu } from './Menu';
70
74
  export * from './Menu';
71
75
  export { default as MenuItem } from './MenuItem';
72
76
  export * from './MenuItem';
73
- export { default as Modal, createModalCloseEvent, SimpleBackdrop } from './Modal';
77
+ export { default as Modal, createModalCloseEvent } from './Modal';
74
78
  export * from './Modal';
75
79
  export { default as Pagination } from './Pagination';
76
80
  export * from './Pagination';
@@ -86,6 +90,8 @@ export { default as RadioGroup } from './RadioGroup';
86
90
  export * from './RadioGroup';
87
91
  export { default as Row } from './Row';
88
92
  export * from './Row';
93
+ export { default as ShadowView } from './ShadowView';
94
+ export * from './ShadowView';
89
95
  export { default as Slide } from './Slide';
90
96
  export * from './Slide';
91
97
  export { default as Slider } from './Slider';
@@ -108,6 +114,8 @@ export { default as Tabs } from './Tabs';
108
114
  export * from './Tabs';
109
115
  export { default as TextField } from './TextField';
110
116
  export * from './TextField';
117
+ export { default as Toggle } from './Toggle';
118
+ export * from './Toggle';
111
119
  export { default as Toolbar } from './Toolbar';
112
120
  export * from './Toolbar';
113
121
  export { default as Tooltip } from './Tooltip';