@astral/ui 1.16.2 → 1.17.0

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 (422) hide show
  1. package/ActionCell/ActionCell.js +19 -39
  2. package/ActionCell/styles.js +5 -7
  3. package/Alert/Alert.js +11 -22
  4. package/Alert/styles.js +17 -20
  5. package/Autocomplete/Autocomplete.js +23 -34
  6. package/BackdropStack/hooks/useBackdropStackToggle/useBackdropStackToggle.js +11 -12
  7. package/BackdropStack/services/BackdropStackManager/BackdropStackManager.js +17 -19
  8. package/Badge/Badge.js +5 -16
  9. package/Badge/styled.d.ts +2 -16
  10. package/Badge/styled.js +26 -31
  11. package/Button/Button.js +10 -21
  12. package/Button/styles.js +16 -22
  13. package/ButtonBase/ButtonBase.js +7 -18
  14. package/ButtonBase/styles.d.ts +3 -3
  15. package/ButtonBase/styles.js +68 -73
  16. package/Checkbox/Checkbox.js +6 -17
  17. package/Checkbox/icons.js +8 -19
  18. package/Checkbox/styled.js +47 -32
  19. package/Chevron/Chevron.js +3 -14
  20. package/Chevron/styles.js +11 -18
  21. package/CircularProgress/CircularProgress.js +7 -18
  22. package/CircularProgress/CircularProgressStory.js +4 -4
  23. package/CircularProgress/CircularProgressStoryTemplate.js +4 -15
  24. package/Collapse/Collapse.js +1 -1
  25. package/ConfigProvider/ConfigProvider.js +7 -19
  26. package/ContentState/ContentState.d.ts +1 -1
  27. package/ContentState/ContentState.js +12 -24
  28. package/ContentState/styles.js +8 -7
  29. package/DashboardLayout/DashboardLayout.js +7 -7
  30. package/DashboardLayout/DashboardLayoutStory.js +5 -16
  31. package/DashboardLayout/DashboardLayoutStoryTemplate.js +4 -15
  32. package/DashboardLayout/Header/Header.js +9 -20
  33. package/DashboardLayout/Header/styles.js +17 -20
  34. package/DashboardLayout/Main/Main.js +5 -17
  35. package/DashboardLayout/Main/styled.js +7 -7
  36. package/DashboardLayout/Sidebar/Sidebar.js +13 -24
  37. package/DashboardLayout/Sidebar/SidebarNav/SidebarNav.js +5 -16
  38. package/DashboardLayout/Sidebar/SidebarToggler/SidebarToggleButton/SidebarToggleButton.js +7 -18
  39. package/DashboardLayout/Sidebar/SidebarToggler/SidebarToggleButton/styles.js +13 -11
  40. package/DashboardLayout/Sidebar/SidebarToggler/SidebarToggler.js +8 -19
  41. package/DashboardLayout/Sidebar/SidebarToggler/styled.js +11 -12
  42. package/DashboardLayout/Sidebar/styles.js +16 -24
  43. package/DashboardLayout/styles.js +11 -9
  44. package/DataGrid/DataGrid.js +25 -50
  45. package/DataGrid/DataGridBody/DataGridBody.d.ts +2 -2
  46. package/DataGrid/DataGridBody/DataGridBody.js +19 -31
  47. package/DataGrid/DataGridBody/styles.js +9 -13
  48. package/DataGrid/DataGridCell/DataGridCell.d.ts +2 -2
  49. package/DataGrid/DataGridCell/DataGridCell.js +7 -19
  50. package/DataGrid/DataGridHead/DataGridHead.d.ts +2 -2
  51. package/DataGrid/DataGridHead/DataGridHead.js +15 -28
  52. package/DataGrid/DataGridHeadColumn/DataGridHeadColumn.js +9 -21
  53. package/DataGrid/DataGridHeadColumn/styles.js +23 -23
  54. package/DataGrid/DataGridLoader/DataGridLoader.js +3 -4
  55. package/DataGrid/DataGridLoader/styles.js +22 -15
  56. package/DataGrid/DataGridNoData/DataGridNoData.js +5 -17
  57. package/DataGrid/DataGridNoData/styles.js +29 -17
  58. package/DataGrid/styles.js +12 -13
  59. package/DataGrid/types.d.ts +1 -1
  60. package/DataGridPagination/DataGridPagination.js +11 -22
  61. package/DataGridPagination/styles.js +11 -15
  62. package/DatePicker/DatePicker.js +22 -33
  63. package/DatePicker/DatePickerDay/DatePickerDay.js +4 -15
  64. package/DatePicker/DatePickerDay/styled.js +6 -8
  65. package/DatePicker/DatePickerHeader/DatePickerHeader.js +12 -23
  66. package/DatePicker/DatePickerHeader/styled.js +10 -9
  67. package/DatePicker/styled.js +94 -70
  68. package/DatePickerProvider/DatePickerProvider.js +4 -4
  69. package/Description/Description.js +5 -6
  70. package/Description/Name/Name.js +5 -16
  71. package/Description/Value/Value.js +6 -17
  72. package/Description/styles.js +14 -13
  73. package/Dialog/Dialog.js +8 -19
  74. package/DialogActions/DialogActions.js +6 -17
  75. package/DialogTitle/DialogTitle.js +8 -19
  76. package/Divider/Divider.js +1 -1
  77. package/DropdownButton/DropdownButton.js +11 -22
  78. package/ErrorBoundary/ErrorBoundary.js +19 -48
  79. package/Fab/Fab.js +7 -18
  80. package/Fab/styles.js +33 -37
  81. package/Fade/Fade.js +1 -1
  82. package/FormControlLabel/FormControlLabel.js +4 -15
  83. package/FormControlLabel/styled.js +10 -11
  84. package/FormHelperText/FormHelperText.js +6 -6
  85. package/FormHelperText/styled.js +16 -18
  86. package/GlobalStyles/GlobalStyles.js +12 -25
  87. package/Grid/Grid.js +5 -16
  88. package/Grid/styled.js +5 -11
  89. package/Grow/Grow.js +1 -1
  90. package/IconButton/IconButton.js +6 -17
  91. package/IconButton/styles.js +15 -21
  92. package/IconDropdownButton/IconDropdownButton.js +10 -21
  93. package/List/List.js +4 -15
  94. package/ListItem/ListItem.js +4 -15
  95. package/ListItem/styles.js +19 -32
  96. package/ListItemAvatar/ListItemAvatar.js +1 -1
  97. package/ListItemButton/ListItemButton.js +5 -16
  98. package/ListItemIcon/ListItemIcon.js +5 -16
  99. package/ListItemIcon/styled.js +5 -11
  100. package/ListItemSecondaryAction/ListItemSecondaryAction.js +1 -1
  101. package/ListItemText/ListItemText.js +4 -15
  102. package/ListSubheader/ListSubheader.js +1 -1
  103. package/LocalizationProvider/LocalizationProvider.js +6 -18
  104. package/MaskField/MaskField.js +12 -23
  105. package/Menu/Menu.js +1 -1
  106. package/MenuGroup/MenuGroup.js +7 -18
  107. package/MenuGroup/stories/Icons.js +8 -19
  108. package/MenuGroup/stories/styled.js +12 -17
  109. package/MenuGroup/styled.js +14 -21
  110. package/MenuItem/MenuItem.js +5 -16
  111. package/MenuItem/styled.js +5 -11
  112. package/MenuList/MenuList.js +5 -16
  113. package/MenuList/styled.js +10 -17
  114. package/NavMenu/NavMenu.js +7 -18
  115. package/NavMenu/NavMenuItem/NavMenuItem.js +13 -25
  116. package/NavMenu/NavMenuItem/NavMenuItemButton/NavMenuItemButton.js +8 -19
  117. package/NavMenu/NavMenuItem/NavMenuItemButton/styles.js +29 -30
  118. package/NavMenu/NavMenuItem/NavMenuItemList/NavMenuItemList.js +8 -19
  119. package/Notification/Notification.js +6 -37
  120. package/Notification/NotificationContainer/NotificationContainer.js +7 -18
  121. package/Notification/NotificationContainer/styled.js +16 -7
  122. package/Notification/NotificationTemplate/NotificationTemplate.js +10 -22
  123. package/Notification/NotificationTemplate/styled.js +51 -51
  124. package/Notification/NotificationTemplate/utils/getActionsDirection/getActionsDirection.js +2 -2
  125. package/Notification/NotificationTemplate/utils/getNotificationTemplateStyles/getNotificationTemplateStyles.js +3 -3
  126. package/Notification/constants/notificationVariant.js +7 -18
  127. package/Notification/constants/positions.js +1 -1
  128. package/Notification/styled.js +18 -27
  129. package/Notification/utils/getNotificationIconByVariant/getNotificationIconByVariant.js +5 -6
  130. package/Notification/utils/notificationTemplatePropsCreator/notificationTemplatePropsCreator.js +2 -13
  131. package/OverflowTypography/OverflowTypography.js +13 -22
  132. package/OverflowTypography/hooks/useOverflowed/useOverflowed.js +13 -16
  133. package/OverflowTypography/styles.js +14 -12
  134. package/Pagination/Pagination.js +4 -15
  135. package/Placeholder/Placeholder.d.ts +9 -1
  136. package/Placeholder/Placeholder.js +4 -16
  137. package/Placeholder/styles.js +70 -76
  138. package/Product/Product.js +6 -17
  139. package/Profile/Profile.js +10 -21
  140. package/Profile/styled.js +32 -36
  141. package/Radio/Icon.js +6 -17
  142. package/Radio/Radio.d.ts +1 -1
  143. package/Radio/Radio.js +7 -18
  144. package/Radio/styled.js +43 -32
  145. package/Select/Select.js +16 -26
  146. package/Select/styled.js +36 -31
  147. package/SideDialog/SideDialog.js +6 -17
  148. package/SideDialog/styled.js +8 -8
  149. package/Slide/Slide.js +1 -1
  150. package/SwipeableDrawer/SwipeableDrawer.js +5 -16
  151. package/SwipeableDrawer/styles.js +73 -78
  152. package/Tab/Tab.js +1 -1
  153. package/Table/Table.js +5 -16
  154. package/Table/TableBody/TableBody.js +1 -1
  155. package/Table/TableCell/TableCell.js +1 -1
  156. package/Table/TableContainer/TableContainer.js +1 -1
  157. package/Table/TableFooter/TableFooter.js +1 -1
  158. package/Table/TableHead/TableHead.js +1 -1
  159. package/Table/TableRow/TableRow.js +1 -1
  160. package/Table/TableSortLabel/TableSortLabel.js +1 -1
  161. package/Tabs/Tabs.js +1 -1
  162. package/Tag/Tag.js +7 -18
  163. package/Tag/styled.js +84 -60
  164. package/TextArea/TextArea.js +6 -17
  165. package/TextField/TextField.js +11 -22
  166. package/ThemeProvider/ThemeProvider.js +7 -18
  167. package/Tooltip/Tooltip.js +7 -18
  168. package/Tooltip/styled.js +43 -58
  169. package/Typography/Typography.js +8 -19
  170. package/Zoom/Zoom.js +1 -1
  171. package/esm/ActionCell/ActionCell.js +11 -31
  172. package/esm/ActionCell/styles.js +4 -6
  173. package/esm/Alert/Alert.js +4 -15
  174. package/esm/Alert/styles.js +15 -18
  175. package/esm/Autocomplete/Autocomplete.js +12 -23
  176. package/esm/Autocomplete/constants.js +1 -1
  177. package/esm/BackdropStack/hooks/useBackdropStackToggle/useBackdropStackToggle.js +8 -9
  178. package/esm/BackdropStack/services/BackdropStackManager/BackdropStackManager.js +17 -19
  179. package/esm/Badge/Badge.js +3 -14
  180. package/esm/Badge/styled.d.ts +2 -16
  181. package/esm/Badge/styled.js +25 -30
  182. package/esm/Button/Button.js +4 -15
  183. package/esm/Button/styles.js +13 -19
  184. package/esm/ButtonBase/ButtonBase.js +3 -14
  185. package/esm/ButtonBase/styles.d.ts +3 -3
  186. package/esm/ButtonBase/styles.js +66 -71
  187. package/esm/Checkbox/Checkbox.js +3 -14
  188. package/esm/Checkbox/icons.js +6 -17
  189. package/esm/Checkbox/styled.js +45 -30
  190. package/esm/Chevron/Chevron.js +1 -12
  191. package/esm/Chevron/styles.js +10 -17
  192. package/esm/CircularProgress/CircularProgress.js +4 -15
  193. package/esm/CircularProgress/CircularProgressStory.js +2 -2
  194. package/esm/CircularProgress/CircularProgressStoryTemplate.js +2 -13
  195. package/esm/ConfigProvider/ConfigProvider.js +5 -17
  196. package/esm/ContentState/ContentState.d.ts +1 -1
  197. package/esm/ContentState/ContentState.js +6 -18
  198. package/esm/ContentState/styles.js +7 -6
  199. package/esm/DashboardLayout/DashboardLayout.js +2 -2
  200. package/esm/DashboardLayout/DashboardLayoutStory.js +3 -14
  201. package/esm/DashboardLayout/DashboardLayoutStoryTemplate.js +2 -13
  202. package/esm/DashboardLayout/Header/Header.js +4 -15
  203. package/esm/DashboardLayout/Header/styles.js +16 -19
  204. package/esm/DashboardLayout/Main/Main.js +2 -14
  205. package/esm/DashboardLayout/Main/styled.js +6 -6
  206. package/esm/DashboardLayout/Sidebar/Sidebar.js +6 -17
  207. package/esm/DashboardLayout/Sidebar/SidebarNav/SidebarNav.js +3 -14
  208. package/esm/DashboardLayout/Sidebar/SidebarToggler/SidebarToggleButton/SidebarToggleButton.js +3 -14
  209. package/esm/DashboardLayout/Sidebar/SidebarToggler/SidebarToggleButton/styles.js +11 -9
  210. package/esm/DashboardLayout/Sidebar/SidebarToggler/SidebarToggler.js +4 -15
  211. package/esm/DashboardLayout/Sidebar/SidebarToggler/styled.js +9 -10
  212. package/esm/DashboardLayout/Sidebar/styles.js +15 -23
  213. package/esm/DashboardLayout/styles.js +10 -8
  214. package/esm/DataGrid/DataGrid.js +17 -42
  215. package/esm/DataGrid/DataGridBody/DataGridBody.d.ts +2 -2
  216. package/esm/DataGrid/DataGridBody/DataGridBody.js +13 -25
  217. package/esm/DataGrid/DataGridBody/styles.js +8 -12
  218. package/esm/DataGrid/DataGridCell/DataGridCell.d.ts +2 -2
  219. package/esm/DataGrid/DataGridCell/DataGridCell.js +3 -15
  220. package/esm/DataGrid/DataGridHead/DataGridHead.d.ts +2 -2
  221. package/esm/DataGrid/DataGridHead/DataGridHead.js +8 -21
  222. package/esm/DataGrid/DataGridHeadColumn/DataGridHeadColumn.js +4 -16
  223. package/esm/DataGrid/DataGridHeadColumn/styles.js +21 -21
  224. package/esm/DataGrid/DataGridLoader/DataGridLoader.js +1 -2
  225. package/esm/DataGrid/DataGridLoader/styles.js +19 -12
  226. package/esm/DataGrid/DataGridNoData/DataGridNoData.js +3 -15
  227. package/esm/DataGrid/DataGridNoData/styles.js +27 -15
  228. package/esm/DataGrid/styles.js +11 -12
  229. package/esm/DataGrid/types.d.ts +1 -1
  230. package/esm/DataGridPagination/DataGridPagination.js +7 -18
  231. package/esm/DataGridPagination/styles.js +9 -13
  232. package/esm/DatePicker/DatePicker.js +11 -22
  233. package/esm/DatePicker/DatePickerDay/DatePickerDay.js +2 -13
  234. package/esm/DatePicker/DatePickerDay/styled.js +4 -6
  235. package/esm/DatePicker/DatePickerHeader/DatePickerHeader.js +5 -16
  236. package/esm/DatePicker/DatePickerHeader/styled.js +8 -7
  237. package/esm/DatePicker/styled.js +93 -69
  238. package/esm/DatePickerProvider/DatePickerProvider.js +2 -2
  239. package/esm/Description/Description.js +1 -2
  240. package/esm/Description/Name/Name.js +3 -14
  241. package/esm/Description/Value/Value.js +4 -15
  242. package/esm/Description/styles.js +13 -12
  243. package/esm/Dialog/Dialog.js +5 -16
  244. package/esm/DialogActions/DialogActions.js +3 -14
  245. package/esm/DialogTitle/DialogTitle.js +4 -15
  246. package/esm/DropdownButton/DropdownButton.js +4 -15
  247. package/esm/ErrorBoundary/ErrorBoundary.js +14 -43
  248. package/esm/Fab/Fab.js +3 -14
  249. package/esm/Fab/styles.js +31 -35
  250. package/esm/FormControlLabel/FormControlLabel.js +2 -13
  251. package/esm/FormControlLabel/styled.js +8 -9
  252. package/esm/FormHelperText/FormHelperText.js +3 -3
  253. package/esm/FormHelperText/styled.js +14 -16
  254. package/esm/GlobalStyles/GlobalStyles.js +8 -21
  255. package/esm/Grid/Grid.js +3 -14
  256. package/esm/Grid/styled.js +3 -9
  257. package/esm/IconButton/IconButton.js +3 -14
  258. package/esm/IconButton/styles.js +14 -20
  259. package/esm/IconDropdownButton/IconDropdownButton.js +4 -15
  260. package/esm/List/List.js +2 -13
  261. package/esm/ListItem/ListItem.js +2 -13
  262. package/esm/ListItem/styles.js +17 -30
  263. package/esm/ListItemButton/ListItemButton.js +2 -13
  264. package/esm/ListItemIcon/ListItemIcon.js +2 -13
  265. package/esm/ListItemIcon/styled.js +3 -9
  266. package/esm/ListItemText/ListItemText.js +2 -13
  267. package/esm/LocalizationProvider/LocalizationProvider.js +2 -14
  268. package/esm/MaskField/MaskField.js +9 -20
  269. package/esm/MenuGroup/MenuGroup.js +4 -15
  270. package/esm/MenuGroup/stories/Icons.js +7 -18
  271. package/esm/MenuGroup/stories/styled.js +9 -14
  272. package/esm/MenuGroup/styled.js +12 -19
  273. package/esm/MenuItem/MenuItem.js +3 -14
  274. package/esm/MenuItem/styled.js +3 -9
  275. package/esm/MenuList/MenuList.js +3 -14
  276. package/esm/MenuList/styled.js +8 -15
  277. package/esm/NavMenu/NavMenu.js +3 -14
  278. package/esm/NavMenu/NavMenuItem/NavMenuItem.js +8 -20
  279. package/esm/NavMenu/NavMenuItem/NavMenuItemButton/NavMenuItemButton.js +3 -14
  280. package/esm/NavMenu/NavMenuItem/NavMenuItemButton/styles.js +25 -26
  281. package/esm/NavMenu/NavMenuItem/NavMenuItemList/NavMenuItemList.js +4 -15
  282. package/esm/Notification/Notification.js +5 -36
  283. package/esm/Notification/NotificationContainer/NotificationContainer.js +2 -13
  284. package/esm/Notification/NotificationContainer/styled.js +15 -6
  285. package/esm/Notification/NotificationTemplate/NotificationTemplate.js +6 -18
  286. package/esm/Notification/NotificationTemplate/styled.js +48 -48
  287. package/esm/Notification/NotificationTemplate/utils/getActionsDirection/getActionsDirection.js +2 -2
  288. package/esm/Notification/NotificationTemplate/utils/getNotificationTemplateStyles/getNotificationTemplateStyles.js +3 -3
  289. package/esm/Notification/constants/defaultNotificationProps.js +1 -1
  290. package/esm/Notification/constants/notificationVariant.js +5 -16
  291. package/esm/Notification/constants/positions.js +1 -1
  292. package/esm/Notification/styled.js +20 -29
  293. package/esm/Notification/utils/getNotificationIconByVariant/getNotificationIconByVariant.js +2 -3
  294. package/esm/Notification/utils/notificationTemplatePropsCreator/notificationTemplatePropsCreator.js +2 -13
  295. package/esm/OverflowTypography/OverflowTypography.js +9 -18
  296. package/esm/OverflowTypography/hooks/useOverflowed/useOverflowed.js +11 -14
  297. package/esm/OverflowTypography/styles.js +13 -11
  298. package/esm/Pagination/Pagination.js +2 -13
  299. package/esm/Placeholder/Placeholder.d.ts +9 -1
  300. package/esm/Placeholder/Placeholder.js +2 -14
  301. package/esm/Placeholder/styles.js +68 -74
  302. package/esm/Product/Product.js +3 -14
  303. package/esm/Profile/Profile.js +4 -15
  304. package/esm/Profile/styled.js +30 -34
  305. package/esm/Radio/Icon.js +4 -15
  306. package/esm/Radio/Radio.d.ts +1 -1
  307. package/esm/Radio/Radio.js +3 -14
  308. package/esm/Radio/styled.js +41 -30
  309. package/esm/Select/Select.js +8 -18
  310. package/esm/Select/styled.js +34 -29
  311. package/esm/SideDialog/SideDialog.js +3 -14
  312. package/esm/SideDialog/styled.js +6 -6
  313. package/esm/SwipeableDrawer/SwipeableDrawer.js +3 -14
  314. package/esm/SwipeableDrawer/styles.js +71 -76
  315. package/esm/Table/Table.js +3 -14
  316. package/esm/Tag/Tag.js +3 -14
  317. package/esm/Tag/styled.js +82 -58
  318. package/esm/TextArea/TextArea.js +3 -14
  319. package/esm/TextField/TextField.js +7 -18
  320. package/esm/ThemeProvider/ThemeProvider.js +3 -14
  321. package/esm/Tooltip/Tooltip.js +3 -14
  322. package/esm/Tooltip/styled.js +39 -54
  323. package/esm/Typography/Typography.js +4 -15
  324. package/esm/hooks/useMenu.js +7 -8
  325. package/esm/theme/baseTheme/baseTheme.js +7 -7
  326. package/esm/theme/baseTheme/baseTheme.test.js +12 -12
  327. package/esm/theme/breakpoints.js +1 -1
  328. package/esm/theme/components/MuiAlert.js +7 -12
  329. package/esm/theme/components/MuiAutocomplete.js +13 -20
  330. package/esm/theme/components/MuiButton.js +42 -43
  331. package/esm/theme/components/MuiButtonBase.js +1 -1
  332. package/esm/theme/components/MuiCircularProgress.js +3 -4
  333. package/esm/theme/components/MuiDialog.js +3 -5
  334. package/esm/theme/components/MuiDialogActions.js +2 -3
  335. package/esm/theme/components/MuiDialogContent.js +2 -3
  336. package/esm/theme/components/MuiDialogTitle.js +2 -3
  337. package/esm/theme/components/MuiFormHelperText.js +2 -3
  338. package/esm/theme/components/MuiFormLabel.js +2 -2
  339. package/esm/theme/components/MuiInputBase.js +2 -3
  340. package/esm/theme/components/MuiInputLabel.js +2 -3
  341. package/esm/theme/components/MuiListItemButton.js +2 -3
  342. package/esm/theme/components/MuiListItemText.js +2 -2
  343. package/esm/theme/components/MuiLoadingButton.js +10 -12
  344. package/esm/theme/components/MuiMenu.js +3 -5
  345. package/esm/theme/components/MuiMenuItem.js +2 -3
  346. package/esm/theme/components/MuiOutlinedInput.js +7 -12
  347. package/esm/theme/components/MuiPaginationItem.js +5 -7
  348. package/esm/theme/components/MuiTab.js +2 -3
  349. package/esm/theme/components/MuiTableCell.js +2 -2
  350. package/esm/theme/components/MuiTableHead.js +3 -4
  351. package/esm/theme/components/MuiTableRow.js +2 -3
  352. package/esm/theme/components/MuiTabs.js +3 -4
  353. package/esm/theme/components/MuiTypography.js +1 -1
  354. package/esm/theme/components/components.js +64 -35
  355. package/esm/theme/constants.js +1 -1
  356. package/esm/theme/elevation.js +1 -1
  357. package/esm/theme/hooks/useTheme/index.js +1 -1
  358. package/esm/theme/palette/brandPalette.js +16 -17
  359. package/esm/theme/palette/palette.js +3 -15
  360. package/esm/theme/shape.js +1 -1
  361. package/esm/theme/typography.js +4 -5
  362. package/hooks/useMenu.js +8 -9
  363. package/package.json +14 -14
  364. package/theme/baseTheme/baseTheme.js +14 -14
  365. package/theme/baseTheme/baseTheme.test.js +14 -14
  366. package/theme/components/MuiAlert.js +6 -11
  367. package/theme/components/MuiAutocomplete.js +13 -20
  368. package/theme/components/MuiButton.js +43 -44
  369. package/theme/components/MuiCircularProgress.js +2 -3
  370. package/theme/components/MuiDialog.js +2 -4
  371. package/theme/components/MuiDialogActions.js +1 -2
  372. package/theme/components/MuiDialogContent.js +1 -2
  373. package/theme/components/MuiDialogTitle.js +1 -2
  374. package/theme/components/MuiFormHelperText.js +1 -2
  375. package/theme/components/MuiFormLabel.js +1 -1
  376. package/theme/components/MuiInputBase.js +1 -2
  377. package/theme/components/MuiInputLabel.js +1 -2
  378. package/theme/components/MuiListItemButton.js +1 -2
  379. package/theme/components/MuiListItemText.js +1 -1
  380. package/theme/components/MuiLoadingButton.js +12 -14
  381. package/theme/components/MuiMenu.js +2 -4
  382. package/theme/components/MuiMenuItem.js +1 -2
  383. package/theme/components/MuiOutlinedInput.js +6 -11
  384. package/theme/components/MuiPaginationItem.js +4 -6
  385. package/theme/components/MuiTab.js +1 -2
  386. package/theme/components/MuiTableCell.js +1 -1
  387. package/theme/components/MuiTableHead.js +2 -3
  388. package/theme/components/MuiTableRow.js +1 -2
  389. package/theme/components/MuiTabs.js +2 -3
  390. package/theme/components/components.js +64 -35
  391. package/theme/hooks/useTheme/index.js +2 -2
  392. package/theme/palette/brandPalette.js +17 -18
  393. package/theme/palette/palette.js +5 -17
  394. package/theme/typography.js +3 -4
  395. package/docs/Case/Case.d.ts +0 -8
  396. package/docs/Case/Case.js +0 -31
  397. package/docs/Case/index.d.ts +0 -1
  398. package/docs/Case/index.js +0 -17
  399. package/docs/Case/styles.d.ts +0 -5
  400. package/docs/Case/styles.js +0 -16
  401. package/docs/ExampleTemplate/ExampleTemplate.d.ts +0 -13
  402. package/docs/ExampleTemplate/ExampleTemplate.js +0 -26
  403. package/docs/ExampleTemplate/index.d.ts +0 -1
  404. package/docs/ExampleTemplate/index.js +0 -17
  405. package/docs/ExampleTemplate/styles.d.ts +0 -9
  406. package/docs/ExampleTemplate/styles.js +0 -13
  407. package/docs/index.d.ts +0 -2
  408. package/docs/index.js +0 -18
  409. package/esm/docs/Case/Case.d.ts +0 -8
  410. package/esm/docs/Case/Case.js +0 -27
  411. package/esm/docs/Case/index.d.ts +0 -1
  412. package/esm/docs/Case/index.js +0 -1
  413. package/esm/docs/Case/styles.d.ts +0 -5
  414. package/esm/docs/Case/styles.js +0 -13
  415. package/esm/docs/ExampleTemplate/ExampleTemplate.d.ts +0 -13
  416. package/esm/docs/ExampleTemplate/ExampleTemplate.js +0 -22
  417. package/esm/docs/ExampleTemplate/index.d.ts +0 -1
  418. package/esm/docs/ExampleTemplate/index.js +0 -1
  419. package/esm/docs/ExampleTemplate/styles.d.ts +0 -9
  420. package/esm/docs/ExampleTemplate/styles.js +0 -10
  421. package/esm/docs/index.d.ts +0 -2
  422. package/esm/docs/index.js +0 -2
@@ -1,20 +1,17 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
1
  import { Alert } from '@mui/material';
6
2
  import { styled } from '../styles';
7
- export var StyledAlert = styled(Alert)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n\n .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {\n padding: ", ";\n }\n\n ", " {\n padding: ", ";\n\n .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {\n padding: 0;\n }\n }\n"], ["\n padding: ", ";\n\n .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {\n padding: ", ";\n }\n\n ", " {\n padding: ", ";\n\n .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {\n padding: 0;\n }\n }\n"])), function (_a) {
8
- var theme = _a.theme;
9
- return theme.spacing(3);
10
- }, function (_a) {
11
- var theme = _a.theme;
12
- return theme.spacing(3, 0);
13
- }, function (_a) {
14
- var theme = _a.theme;
15
- return theme.breakpoints.up('sm');
16
- }, function (_a) {
17
- var theme = _a.theme;
18
- return theme.spacing(2, 4);
19
- });
20
- var templateObject_1;
3
+ export const StyledAlert = styled(Alert) `
4
+ padding: ${({ theme }) => theme.spacing(3)};
5
+
6
+ .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {
7
+ padding: ${({ theme }) => theme.spacing(3, 0)};
8
+ }
9
+
10
+ ${({ theme }) => theme.breakpoints.up('sm')} {
11
+ padding: ${({ theme }) => theme.spacing(2, 4)};
12
+
13
+ .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {
14
+ padding: 0;
15
+ }
16
+ }
17
+ `;
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  var __rest = (this && this.__rest) || function (s, e) {
13
2
  var t = {};
14
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -31,23 +20,23 @@ import { MenuItem } from '../MenuItem';
31
20
  import { Checkbox } from '../Checkbox';
32
21
  import { OverflowTypography, } from '../OverflowTypography';
33
22
  import { DEFAULT_AUTOCOMPLETE_ELEMENT_ROWS_COUNT, } from './constants';
34
- export var Autocomplete = function (props) {
35
- var multiple = props.multiple, placeholder = props.placeholder, error = props.error, success = props.success, helperText = props.helperText, label = props.label, _a = props.size, size = _a === void 0 ? 'medium' : _a, getOptionLabel = props.getOptionLabel, externalRenderOption = props.renderOption, overflowOption = props.overflowOption, restProps = __rest(props, ["multiple", "placeholder", "error", "success", "helperText", "label", "size", "getOptionLabel", "renderOption", "overflowOption"]);
36
- var renderTags = useCallback(function (tags, getTagProps) {
37
- return tags.map(function (tag, index) {
38
- var title = (getOptionLabel && getOptionLabel(tag)) || '';
39
- return (_jsx(Tag, __assign({ deleteIcon: _jsx(CrossSmOutlineSm, {}), color: "grey", label: title }, getTagProps({ index: index }))));
23
+ export const Autocomplete = (props) => {
24
+ const { multiple, placeholder, error, success, helperText, label, size = 'medium', getOptionLabel, renderOption: externalRenderOption, overflowOption } = props, restProps = __rest(props, ["multiple", "placeholder", "error", "success", "helperText", "label", "size", "getOptionLabel", "renderOption", "overflowOption"]);
25
+ const renderTags = useCallback((tags, getTagProps) => {
26
+ return tags.map((tag, index) => {
27
+ const title = (getOptionLabel && getOptionLabel(tag)) || '';
28
+ return (_jsx(Tag, Object.assign({ deleteIcon: _jsx(CrossSmOutlineSm, {}), color: "grey", label: title }, getTagProps({ index }))));
40
29
  });
41
30
  }, [getOptionLabel]);
42
- var renderInput = useCallback(function (inputParams) { return (_jsx(TextField, __assign({}, inputParams, { placeholder: placeholder, label: label, success: success, error: error, helperText: helperText, size: size }))); }, [placeholder, label, success, error, helperText, size]);
43
- var renderOption = useCallback(function (optionProps, option, optionState) {
31
+ const renderInput = useCallback((inputParams) => (_jsx(TextField, Object.assign({}, inputParams, { placeholder: placeholder, label: label, success: success, error: error, helperText: helperText, size: size }))), [placeholder, label, success, error, helperText, size]);
32
+ const renderOption = useCallback((optionProps, option, optionState) => {
44
33
  if (externalRenderOption) {
45
34
  return externalRenderOption(optionProps, option, optionState);
46
35
  }
47
- var selected = Boolean(optionProps['aria-selected']);
48
- return (_createElement(MenuItem, __assign({}, optionProps, { key: optionProps.id }),
36
+ const selected = Boolean(optionProps['aria-selected']);
37
+ return (_createElement(MenuItem, Object.assign({}, optionProps, { key: optionProps.id }),
49
38
  multiple && (_jsx(ListItemIcon, { children: _jsx(Checkbox, { checked: selected }) })),
50
- _jsx(OverflowTypography, __assign({ rowsCount: DEFAULT_AUTOCOMPLETE_ELEMENT_ROWS_COUNT }, overflowOption, { children: optionProps.key }))));
39
+ _jsx(OverflowTypography, Object.assign({ rowsCount: DEFAULT_AUTOCOMPLETE_ELEMENT_ROWS_COUNT }, overflowOption, { children: optionProps.key }))));
51
40
  }, [multiple, externalRenderOption]);
52
- return (_jsx(MuiAutocomplete, __assign({}, restProps, { size: size, multiple: multiple, getOptionLabel: getOptionLabel, disableCloseOnSelect: multiple, renderTags: renderTags, renderInput: renderInput, renderOption: renderOption, popupIcon: _jsx(ChevronDOutlineMd, {}), clearIcon: _jsx(CrossSmOutlineSm, {}), componentsProps: { clearIndicator: { disableRipple: true } }, noOptionsText: "\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445" })));
41
+ return (_jsx(MuiAutocomplete, Object.assign({}, restProps, { size: size, multiple: multiple, getOptionLabel: getOptionLabel, disableCloseOnSelect: multiple, renderTags: renderTags, renderInput: renderInput, renderOption: renderOption, popupIcon: _jsx(ChevronDOutlineMd, {}), clearIcon: _jsx(CrossSmOutlineSm, {}), componentsProps: { clearIndicator: { disableRipple: true } }, noOptionsText: "\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445" })));
53
42
  };
@@ -3,4 +3,4 @@ export var AutocompleteSizes;
3
3
  AutocompleteSizes["medium"] = "medium";
4
4
  AutocompleteSizes["small"] = "small";
5
5
  })(AutocompleteSizes || (AutocompleteSizes = {}));
6
- export var DEFAULT_AUTOCOMPLETE_ELEMENT_ROWS_COUNT = 2;
6
+ export const DEFAULT_AUTOCOMPLETE_ELEMENT_ROWS_COUNT = 2;
@@ -4,18 +4,17 @@ import { backdropStackManager, } from '../../services/BackdropStackManager';
4
4
  /**
5
5
  * @description хук предназначен для быстрого использования backdropStackManager в реакт компонентах, хранит неуправляемый стейт, если вам нужно управлять этим стейтом, воспользуйтесь backdropStackManager в своем компоненте напрямую.
6
6
  */
7
- export var useBackdropStackToggle = function (_a) {
8
- var _b = _a === void 0 ? {} : _a, parentId = _b.id;
9
- var id = useRef(parentId || nanoid());
10
- var pop = backdropStackManager.pop, push = backdropStackManager.push, remove = backdropStackManager.remove;
11
- var _c = useState(false), isOpened = _c[0], setOpened = _c[1];
12
- var handleOpen = function () {
7
+ export const useBackdropStackToggle = ({ id: parentId, } = {}) => {
8
+ const id = useRef(parentId || nanoid());
9
+ const { pop, push, remove } = backdropStackManager;
10
+ const [isOpened, setOpened] = useState(false);
11
+ const handleOpen = () => {
13
12
  push(id.current);
14
13
  setOpened(true);
15
14
  };
16
- var handleClose = function (_, reason) {
15
+ const handleClose = (_, reason) => {
17
16
  setOpened(!pop(id.current, reason));
18
17
  };
19
- useEffect(function () { return function () { return remove(id.current); }; }, []);
20
- return { isOpened: isOpened, handleOpen: handleOpen, handleClose: handleClose };
18
+ useEffect(() => () => remove(id.current), []);
19
+ return { isOpened, handleOpen, handleClose };
21
20
  };
@@ -1,38 +1,36 @@
1
1
  import { nanoid } from 'nanoid';
2
- var BackdropStackManager = /** @class */ (function () {
3
- function BackdropStackManager() {
4
- var _this = this;
2
+ class BackdropStackManager {
3
+ constructor() {
5
4
  this.stack = [];
6
5
  // сохраняем информацию о том какой был предыдущий вызов pop,
7
6
  // нужен для предотвращения синхронного закрытия при последовательности 'blur' и 'backdropClick' в рамках одного клика
8
7
  this.previousPopInfo = [null, null];
9
8
  this.currentPointerId = null;
10
- this.checkOn = function (reason) {
11
- var _a = _this.previousPopInfo, previousReason = _a[0], previousPointerId = _a[1];
9
+ this.checkOn = (reason) => {
10
+ const [previousReason, previousPointerId] = this.previousPopInfo;
12
11
  return (reason === 'backdropClick' &&
13
12
  previousReason === 'blur' &&
14
- previousPointerId === _this.currentPointerId);
13
+ previousPointerId === this.currentPointerId);
15
14
  };
16
- this.remove = function (id) {
17
- _this.stack = _this.stack.filter(function (item) { return item !== id; });
15
+ this.remove = (id) => {
16
+ this.stack = this.stack.filter((item) => item !== id);
18
17
  };
19
- this.push = function (id) {
20
- _this.stack.push(id);
18
+ this.push = (id) => {
19
+ this.stack.push(id);
21
20
  };
22
- this.pop = function (id, reason) {
23
- if (_this.checkOn(reason)) {
21
+ this.pop = (id, reason) => {
22
+ if (this.checkOn(reason)) {
24
23
  return false;
25
24
  }
26
- var lastOpenedElement = _this.stack[_this.stack.length - 1];
25
+ const lastOpenedElement = this.stack[this.stack.length - 1];
27
26
  if (lastOpenedElement === id) {
28
- _this.previousPopInfo = [reason, _this.currentPointerId];
29
- _this.stack.pop();
27
+ this.previousPopInfo = [reason, this.currentPointerId];
28
+ this.stack.pop();
30
29
  return true;
31
30
  }
32
31
  return false;
33
32
  };
34
- document === null || document === void 0 ? void 0 : document.addEventListener('pointerdown', function () { return (_this.currentPointerId = nanoid()); });
33
+ document === null || document === void 0 ? void 0 : document.addEventListener('pointerdown', () => (this.currentPointerId = nanoid()));
35
34
  }
36
- return BackdropStackManager;
37
- }());
38
- export var backdropStackManager = new BackdropStackManager();
35
+ }
36
+ export const backdropStackManager = new BackdropStackManager();
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  var __rest = (this && this.__rest) || function (s, e) {
13
2
  var t = {};
14
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -22,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
22
11
  };
23
12
  import { jsx as _jsx } from "react/jsx-runtime";
24
13
  import { StyledBadge } from './styled';
25
- export var Badge = function (_a) {
26
- var children = _a.children, color = _a.color, props = __rest(_a, ["children", "color"]);
27
- return (_jsx(StyledBadge, __assign({ customColor: color }, props, { max: 99 }, { children: children })));
14
+ export const Badge = (_a) => {
15
+ var { children, color } = _a, props = __rest(_a, ["children", "color"]);
16
+ return (_jsx(StyledBadge, Object.assign({ customColor: color }, props, { max: 99 }, { children: children })));
28
17
  };
@@ -8,23 +8,9 @@ export declare const StyledBadge: import("@emotion/styled").StyledComponent<{
8
8
  overlap?: "circular" | "rectangular" | undefined;
9
9
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
10
10
  variant?: "standard" | "dot" | undefined;
11
- } & {
12
- components?: {
13
- Root?: import("react").ElementType<any> | undefined;
14
- Badge?: import("react").ElementType<any> | undefined;
15
- } | undefined;
16
- componentsProps?: {
17
- root?: (import("react").HTMLAttributes<HTMLSpanElement> & import("@mui/base").BadgeUnstyledComponentsPropsOverrides) | undefined;
18
- badge?: (import("react").HTMLAttributes<HTMLSpanElement> & import("@mui/base").BadgeUnstyledComponentsPropsOverrides) | undefined;
19
- } | undefined;
20
- badgeContent?: import("react").ReactNode;
21
- children?: import("react").ReactNode;
22
- invisible?: boolean | undefined;
23
- max?: number | undefined;
24
- showZero?: boolean | undefined;
25
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | "css" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
11
+ } & import("@mui/base").BadgeUnstyledOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | "css" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
26
12
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
27
- }, "color" | "components" | "children" | "componentsProps" | "variant" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | "invisible" | "anchorOrigin" | "overlap" | "badgeContent" | "max" | "showZero"> & {
13
+ }, "color" | "variant" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | "anchorOrigin" | "overlap" | keyof import("@mui/base").BadgeUnstyledOwnProps> & {
28
14
  theme?: import("@emotion/react").Theme | undefined;
29
15
  } & Omit<BadgeProps, "color"> & {
30
16
  customColor: BadgeColor;
@@ -1,11 +1,6 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
1
  import { Badge } from '@mui/material';
6
2
  import { styled } from '../styles';
7
- var getBgColor = function (_a) {
8
- var customColor = _a.customColor, theme = _a.theme;
3
+ const getBgColor = ({ customColor, theme }) => {
9
4
  if (customColor === 'grey') {
10
5
  return theme.palette.grey[300];
11
6
  }
@@ -26,8 +21,7 @@ var getBgColor = function (_a) {
26
21
  }
27
22
  return theme.palette.primary.main;
28
23
  };
29
- var getTextColor = function (_a) {
30
- var customColor = _a.customColor, theme = _a.theme;
24
+ const getTextColor = ({ customColor, theme, }) => {
31
25
  if (customColor === 'grey') {
32
26
  return theme.palette.text.primary;
33
27
  }
@@ -48,25 +42,26 @@ var getTextColor = function (_a) {
48
42
  }
49
43
  return theme.palette.primary.contrastText;
50
44
  };
51
- export var StyledBadge = styled(Badge, {
52
- shouldForwardProp: function (prop) { return prop !== 'customColor'; },
53
- })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .MuiBadge-badge {\n height: 20px;\n padding: ", ";\n\n color: ", ";\n font-size: ", ";\n line-height: 20px;\n\n background-color: ", ";\n border: 2px solid ", ";\n border-radius: 12px;\n }\n\n .MuiBadge-dot {\n width: 12px;\n height: 12px;\n\n border: 2px solid ", ";\n }\n"], ["\n .MuiBadge-badge {\n height: 20px;\n padding: ", ";\n\n color: ", ";\n font-size: ", ";\n line-height: 20px;\n\n background-color: ", ";\n border: 2px solid ", ";\n border-radius: 12px;\n }\n\n .MuiBadge-dot {\n width: 12px;\n height: 12px;\n\n border: 2px solid ", ";\n }\n"])), function (_a) {
54
- var theme = _a.theme;
55
- return theme.spacing(0, 1);
56
- }, function (_a) {
57
- var customColor = _a.customColor, theme = _a.theme;
58
- return getTextColor({ customColor: customColor, theme: theme });
59
- }, function (_a) {
60
- var theme = _a.theme;
61
- return theme.typography.small.fontSize;
62
- }, function (_a) {
63
- var customColor = _a.customColor, theme = _a.theme;
64
- return getBgColor({ customColor: customColor, theme: theme });
65
- }, function (_a) {
66
- var theme = _a.theme;
67
- return theme.palette.common.white;
68
- }, function (_a) {
69
- var theme = _a.theme;
70
- return theme.palette.common.white;
71
- });
72
- var templateObject_1;
45
+ export const StyledBadge = styled(Badge, {
46
+ shouldForwardProp: (prop) => prop !== 'customColor',
47
+ }) `
48
+ .MuiBadge-badge {
49
+ height: 20px;
50
+ padding: ${({ theme }) => theme.spacing(0, 1)};
51
+
52
+ color: ${({ customColor, theme }) => getTextColor({ customColor, theme })};
53
+ font-size: ${({ theme }) => theme.typography.small.fontSize};
54
+ line-height: 20px;
55
+
56
+ background-color: ${({ customColor, theme }) => getBgColor({ customColor, theme })};
57
+ border: 2px solid ${({ theme }) => theme.palette.common.white};
58
+ border-radius: 12px;
59
+ }
60
+
61
+ .MuiBadge-dot {
62
+ width: 12px;
63
+ height: 12px;
64
+
65
+ border: 2px solid ${({ theme }) => theme.palette.common.white};
66
+ }
67
+ `;
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  var __rest = (this && this.__rest) || function (s, e) {
13
2
  var t = {};
14
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -26,14 +15,14 @@ import { ButtonColors, ButtonVariants } from '../ButtonBase';
26
15
  import { CircularProgress } from '../CircularProgress';
27
16
  import { CircularProgressColors } from '../CircularProgress/constants';
28
17
  import { LoadingButtonWrapper } from './styles';
29
- export var Button = forwardRef(function (props, ref) {
30
- var _a = props.variant, variant = _a === void 0 ? ButtonVariants.Contained : _a, _b = props.color, color = _b === void 0 ? ButtonColors.Primary : _b, restProps = __rest(props, ["variant", "color"]);
31
- var loadingIndicatorColor = useMemo(function () {
18
+ export const Button = forwardRef((props, ref) => {
19
+ const { variant = ButtonVariants.Contained, color = ButtonColors.Primary } = props, restProps = __rest(props, ["variant", "color"]);
20
+ const loadingIndicatorColor = useMemo(() => {
32
21
  if (variant !== ButtonVariants.Contained) {
33
22
  return CircularProgressColors.PRIMARY;
34
23
  }
35
24
  return CircularProgressColors.INVERTED;
36
25
  }, [variant]);
37
- return (_jsx(LoadingButtonWrapper, __assign({ ref: ref }, restProps, { variant: variant, color: color, loadingIndicator: _jsx(CircularProgress, { color: loadingIndicatorColor, size: "small" }) })));
26
+ return (_jsx(LoadingButtonWrapper, Object.assign({ ref: ref }, restProps, { variant: variant, color: color, loadingIndicator: _jsx(CircularProgress, { color: loadingIndicatorColor, size: "small" }) })));
38
27
  });
39
28
  export default Button;
@@ -1,23 +1,17 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
1
  import { LoadingButton } from '@mui/lab';
6
2
  import { styled } from '../styles';
7
3
  import { getButtonHeightMobile, getButtonPaddingMobile, } from '../ButtonBase/styles';
8
4
  import { ButtonVariants } from '../ButtonBase';
9
- export var LoadingButtonWrapper = styled(LoadingButton, {
10
- shouldForwardProp: function (prop) {
11
- return prop !== 'customColor' && prop !== 'customVariant';
12
- },
13
- })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n min-width: ", ";\n padding: ", ";\n\n ", " {\n height: ", ";\n padding: ", ";\n\n white-space: nowrap;\n }\n"], ["\n min-width: ", ";\n padding: ", ";\n\n ", " {\n height: ", ";\n padding: ", ";\n\n white-space: nowrap;\n }\n"])), function (_a) {
14
- var variant = _a.variant;
15
- return variant === ButtonVariants.Link ? 'auto' : '';
16
- }, function (_a) {
17
- var variant = _a.variant;
18
- return (variant === ButtonVariants.Link ? 0 : '');
19
- }, function (_a) {
20
- var theme = _a.theme;
21
- return theme.breakpoints.down('sm');
22
- }, getButtonHeightMobile, getButtonPaddingMobile);
23
- var templateObject_1;
5
+ export const LoadingButtonWrapper = styled(LoadingButton, {
6
+ shouldForwardProp: (prop) => prop !== 'customColor' && prop !== 'customVariant',
7
+ }) `
8
+ min-width: ${({ variant }) => variant === ButtonVariants.Link ? 'auto' : ''};
9
+ padding: ${({ variant }) => (variant === ButtonVariants.Link ? 0 : '')};
10
+
11
+ ${({ theme }) => theme.breakpoints.down('sm')} {
12
+ height: ${getButtonHeightMobile};
13
+ padding: ${getButtonPaddingMobile};
14
+
15
+ white-space: nowrap;
16
+ }
17
+ `;
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  var __rest = (this && this.__rest) || function (s, e) {
13
2
  var t = {};
14
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -24,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
24
13
  import { forwardRef } from 'react';
25
14
  import { ButtonColors, ButtonVariants } from './enums';
26
15
  import { ButtonBaseWrapper } from './styles';
27
- export var ButtonBase = forwardRef(function (_a, ref) {
28
- var children = _a.children, _b = _a.variant, variant = _b === void 0 ? ButtonVariants.Contained : _b, _c = _a.color, color = _c === void 0 ? ButtonColors.Primary : _c, props = __rest(_a, ["children", "variant", "color"]);
29
- return (_jsx(ButtonBaseWrapper, __assign({ ref: ref }, props, { customColor: color, customVariant: variant }, { children: children })));
16
+ export const ButtonBase = forwardRef((_a, ref) => {
17
+ var { children, variant = ButtonVariants.Contained, color = ButtonColors.Primary } = _a, props = __rest(_a, ["children", "variant", "color"]);
18
+ return (_jsx(ButtonBaseWrapper, Object.assign({ ref: ref }, props, { customColor: color, customVariant: variant }, { children: children })));
30
19
  });
@@ -24,9 +24,9 @@ export declare const getButtonPadding: ({ size, theme, }: ButtonBaseWrapperTheme
24
24
  export declare const getDisabledBgColor: ({ theme, customVariant, }: ButtonBaseWrapperThemeProps) => string;
25
25
  export declare const getButtonPaddingMobile: ({ size, theme, variant, }: ButtonBaseWrapperThemeProps) => string;
26
26
  export declare const getButtonHeightMobile: ({ size, }: ButtonBaseWrapperThemeProps) => string;
27
- export declare const ButtonBaseWrapper: import("@emotion/styled").StyledComponent<Pick<import("@mui/base/ButtonUnstyled").ButtonUnstyledOwnProps & Omit<any, keyof import("@mui/base/ButtonUnstyled").ButtonUnstyledOwnProps> & {
28
- component?: import("react").ElementType<any> | undefined;
29
- }, string | number | symbol> & import("react").RefAttributes<any> & {
27
+ export declare const ButtonBaseWrapper: import("@emotion/styled").StyledComponent<import("@mui/base/ButtonUnstyled").ButtonUnstyledOwnProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | "css" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
28
+ ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
29
+ }, keyof import("@mui/base/ButtonUnstyled").ButtonUnstyledOwnProps> & {
30
30
  theme?: import("@emotion/react").Theme | undefined;
31
31
  } & Omit<BaseButtonProps, "color" | "variant"> & {
32
32
  customColor?: "primary" | "error" | "warning" | "success" | undefined;
@@ -1,24 +1,8 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
1
  import ButtonUnstyled, { buttonUnstyledClasses, } from '@mui/base/ButtonUnstyled';
17
2
  import { styled } from '../styles';
18
3
  import { ButtonSizes, ButtonStates, ButtonVariants } from './enums';
19
- export var getColor = function (_a) {
20
- var theme = _a.theme, customVariant = _a.customVariant, customColor = _a.customColor, buttonState = _a.buttonState, selected = _a.selected;
21
- var textColorVariants = {
4
+ export const getColor = ({ theme, customVariant, customColor, buttonState, selected, }) => {
5
+ const textColorVariants = {
22
6
  selected: {
23
7
  default: theme.palette.grey['900'],
24
8
  hover: theme.palette.grey['700'],
@@ -81,9 +65,8 @@ export var getColor = function (_a) {
81
65
  }
82
66
  return textColorVariants.link[buttonState];
83
67
  };
84
- export var getBgColor = function (_a) {
85
- var selected = _a.selected, customColor = _a.customColor, customVariant = _a.customVariant, buttonState = _a.buttonState, theme = _a.theme;
86
- var bgColorVariants = {
68
+ export const getBgColor = ({ selected, customColor, customVariant, buttonState, theme, }) => {
69
+ const bgColorVariants = {
87
70
  selected: {
88
71
  default: theme.palette.grey['900'],
89
72
  hover: theme.palette.grey['700'],
@@ -164,30 +147,26 @@ export var getBgColor = function (_a) {
164
147
  }
165
148
  return bgColorVariants.link;
166
149
  };
167
- export var getButtonHeight = function (_a) {
168
- var size = _a.size;
150
+ export const getButtonHeight = ({ size, }) => {
169
151
  if (size === ButtonSizes.Large) {
170
152
  return '40px';
171
153
  }
172
154
  return '32px';
173
155
  };
174
- export var getButtonPadding = function (_a) {
175
- var size = _a.size, theme = _a.theme;
156
+ export const getButtonPadding = ({ size, theme, }) => {
176
157
  if (size === ButtonSizes.Large) {
177
158
  return theme.spacing(2, 4, 2, 4);
178
159
  }
179
160
  return theme.spacing(1, 3, 1, 3);
180
161
  };
181
- export var getDisabledBgColor = function (_a) {
182
- var theme = _a.theme, customVariant = _a.customVariant;
162
+ export const getDisabledBgColor = ({ theme, customVariant, }) => {
183
163
  if (customVariant === ButtonVariants.Link ||
184
164
  customVariant === ButtonVariants.Text) {
185
165
  return 'transparent';
186
166
  }
187
167
  return theme.palette.grey['100'];
188
168
  };
189
- export var getButtonPaddingMobile = function (_a) {
190
- var size = _a.size, theme = _a.theme, variant = _a.variant;
169
+ export const getButtonPaddingMobile = ({ size, theme, variant, }) => {
191
170
  if (variant === ButtonVariants.Link) {
192
171
  return '0';
193
172
  }
@@ -196,50 +175,66 @@ export var getButtonPaddingMobile = function (_a) {
196
175
  }
197
176
  return theme.spacing(4, 3);
198
177
  };
199
- export var getButtonHeightMobile = function (_a) {
200
- var size = _a.size;
178
+ export const getButtonHeightMobile = ({ size, }) => {
201
179
  if (size === ButtonSizes.Small) {
202
180
  return '32px';
203
181
  }
204
182
  return '48px';
205
183
  };
206
- export var ButtonBaseWrapper = styled(ButtonUnstyled, {
207
- shouldForwardProp: function (prop) {
208
- return prop !== 'customColor' && prop !== 'customVariant';
209
- },
210
- })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: ", ";\n padding: ", ";\n\n ", " {\n height: ", ";\n padding: ", ";\n }\n\n color: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-family: Ubuntu, serif;\n\n background-color: ", ";\n\n border: none;\n border-radius: ", ";\n cursor: pointer;\n\n &:hover {\n color: ", ";\n\n background-color: ", ";\n }\n\n &:focus {\n color: ", ";\n\n background-color: ", ";\n }\n\n &:active {\n color: ", ";\n\n background-color: ", ";\n outline: none;\n }\n\n &.", " {\n color: ", ";\n\n background-color: ", ";\n cursor: unset;\n }\n\n &.", " {\n outline: 2px solid ", ";\n }\n"], ["\n position: relative;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: ", ";\n padding: ", ";\n\n ", " {\n height: ", ";\n padding: ", ";\n }\n\n color: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-family: Ubuntu, serif;\n\n background-color: ", ";\n\n border: none;\n border-radius: ", ";\n cursor: pointer;\n\n &:hover {\n color: ", ";\n\n background-color: ", ";\n }\n\n &:focus {\n color: ", ";\n\n background-color: ", ";\n }\n\n &:active {\n color: ", ";\n\n background-color: ", ";\n outline: none;\n }\n\n &.", " {\n color: ", ";\n\n background-color: ", ";\n cursor: unset;\n }\n\n &.", " {\n outline: 2px solid ", ";\n }\n"])), getButtonHeight, getButtonPadding, function (_a) {
211
- var theme = _a.theme;
212
- return theme.breakpoints.down('sm');
213
- }, getButtonHeightMobile, getButtonPaddingMobile, function (props) {
214
- return getColor(__assign(__assign({}, props), { buttonState: ButtonStates.Default }));
215
- }, function (_a) {
216
- var theme = _a.theme;
217
- return theme.typography.button.fontWeight;
218
- }, function (_a) {
219
- var theme = _a.theme;
220
- return theme.typography.button.fontSize;
221
- }, function (props) {
222
- return getBgColor(__assign(__assign({}, props), { buttonState: ButtonStates.Default }));
223
- }, function (_a) {
224
- var theme = _a.theme;
225
- return theme.shape.small;
226
- }, function (props) {
227
- return getColor(__assign(__assign({}, props), { buttonState: ButtonStates.Hover }));
228
- }, function (props) {
229
- return getBgColor(__assign(__assign({}, props), { buttonState: ButtonStates.Hover }));
230
- }, function (props) {
231
- return getColor(__assign(__assign({}, props), { buttonState: ButtonStates.Focus }));
232
- }, function (props) {
233
- return getBgColor(__assign(__assign({}, props), { buttonState: ButtonStates.Focus }));
234
- }, function (props) {
235
- return getColor(__assign(__assign({}, props), { buttonState: ButtonStates.Active }));
236
- }, function (props) {
237
- return getBgColor(__assign(__assign({}, props), { buttonState: ButtonStates.Active }));
238
- }, buttonUnstyledClasses.disabled, function (_a) {
239
- var theme = _a.theme;
240
- return theme.palette.grey['500'];
241
- }, getDisabledBgColor, buttonUnstyledClasses.focusVisible, function (_a) {
242
- var theme = _a.theme;
243
- return theme.palette.primary['400'];
244
- });
245
- var templateObject_1;
184
+ export const ButtonBaseWrapper = styled(ButtonUnstyled, {
185
+ shouldForwardProp: (prop) => prop !== 'customColor' && prop !== 'customVariant',
186
+ }) `
187
+ position: relative;
188
+
189
+ display: inline-flex;
190
+ align-items: center;
191
+ justify-content: center;
192
+ height: ${getButtonHeight};
193
+ padding: ${getButtonPadding};
194
+
195
+ ${({ theme }) => theme.breakpoints.down('sm')} {
196
+ height: ${getButtonHeightMobile};
197
+ padding: ${getButtonPaddingMobile};
198
+ }
199
+
200
+ color: ${(props) => getColor(Object.assign(Object.assign({}, props), { buttonState: ButtonStates.Default }))};
201
+ font-weight: ${({ theme }) => theme.typography.button.fontWeight};
202
+ font-size: ${({ theme }) => theme.typography.button.fontSize};
203
+ font-family: Ubuntu, serif;
204
+
205
+ background-color: ${(props) => getBgColor(Object.assign(Object.assign({}, props), { buttonState: ButtonStates.Default }))};
206
+
207
+ border: none;
208
+ border-radius: ${({ theme }) => theme.shape.small};
209
+ cursor: pointer;
210
+
211
+ &:hover {
212
+ color: ${(props) => getColor(Object.assign(Object.assign({}, props), { buttonState: ButtonStates.Hover }))};
213
+
214
+ background-color: ${(props) => getBgColor(Object.assign(Object.assign({}, props), { buttonState: ButtonStates.Hover }))};
215
+ }
216
+
217
+ &:focus {
218
+ color: ${(props) => getColor(Object.assign(Object.assign({}, props), { buttonState: ButtonStates.Focus }))};
219
+
220
+ background-color: ${(props) => getBgColor(Object.assign(Object.assign({}, props), { buttonState: ButtonStates.Focus }))};
221
+ }
222
+
223
+ &:active {
224
+ color: ${(props) => getColor(Object.assign(Object.assign({}, props), { buttonState: ButtonStates.Active }))};
225
+
226
+ background-color: ${(props) => getBgColor(Object.assign(Object.assign({}, props), { buttonState: ButtonStates.Active }))};
227
+ outline: none;
228
+ }
229
+
230
+ &.${buttonUnstyledClasses.disabled} {
231
+ color: ${({ theme }) => theme.palette.grey['500']};
232
+
233
+ background-color: ${getDisabledBgColor};
234
+ cursor: unset;
235
+ }
236
+
237
+ &.${buttonUnstyledClasses.focusVisible} {
238
+ outline: 2px solid ${({ theme }) => theme.palette.primary['400']};
239
+ }
240
+ `;