@astral/ui 4.55.4 → 4.57.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 (278) hide show
  1. package/components/BottomDrawer/styles.js +1 -1
  2. package/components/CardGridInfinite/Footer/styles.js +1 -1
  3. package/components/CheckableTag/styles.js +1 -1
  4. package/components/Checkbox/styles.js +4 -2
  5. package/components/Chip/styles.js +1 -1
  6. package/components/CodeField/styles.js +1 -1
  7. package/components/ComplianceStatus/styles.js +1 -1
  8. package/components/ContentState/ContentState.d.ts +1 -1
  9. package/components/ContentState/ContentState.js +2 -2
  10. package/components/ContentState/types.d.ts +4 -0
  11. package/components/DashboardLayout/DashboardWrapper/styles.js +1 -1
  12. package/components/DashboardLayout/Header/styles.js +4 -4
  13. package/components/DashboardLayoutSkeleton/styles.js +1 -1
  14. package/components/DashboardSidebar/styles.js +2 -2
  15. package/components/DashboardSidebarSkeleton/styles.js +1 -1
  16. package/components/DataGrid/Body/Body.d.ts +1 -1
  17. package/components/DataGrid/Body/Body.js +14 -7
  18. package/components/DataGrid/Body/constants.d.ts +4 -0
  19. package/components/DataGrid/Body/constants.js +5 -0
  20. package/components/DataGrid/Body/styles.d.ts +0 -3
  21. package/components/DataGrid/Body/styles.js +14 -1
  22. package/components/DataGrid/Body/useLogic/index.d.ts +1 -0
  23. package/components/DataGrid/Body/useLogic/index.js +1 -0
  24. package/components/DataGrid/Body/useLogic/useLogic.d.ts +9 -0
  25. package/components/DataGrid/Body/useLogic/useLogic.js +15 -0
  26. package/components/DataGrid/Cell/Cell.js +20 -4
  27. package/components/DataGrid/Cell/constants.d.ts +7 -0
  28. package/components/DataGrid/Cell/constants.js +8 -0
  29. package/components/DataGrid/Cell/styles.d.ts +14 -0
  30. package/components/DataGrid/Cell/styles.js +47 -0
  31. package/components/DataGrid/Cell/useLogic/useLogic.d.ts +2 -0
  32. package/components/DataGrid/Cell/useLogic/useLogic.js +3 -2
  33. package/components/DataGrid/DataGrid.js +42 -8
  34. package/components/DataGrid/Head/Head.js +1 -1
  35. package/components/DataGrid/Head/styles.js +5 -1
  36. package/components/DataGrid/Loader/styles.js +4 -0
  37. package/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +6 -0
  38. package/components/DataGrid/MobileSkeleton/MobileSkeleton.js +10 -0
  39. package/components/DataGrid/MobileSkeleton/index.d.ts +1 -0
  40. package/components/DataGrid/MobileSkeleton/index.js +1 -0
  41. package/components/DataGrid/MobileSkeleton/styles.d.ts +17 -0
  42. package/components/DataGrid/MobileSkeleton/styles.js +37 -0
  43. package/components/DataGrid/PinnedSections/Section/styles.js +2 -2
  44. package/components/DataGrid/Row/NestedChildren/styles.js +8 -3
  45. package/components/DataGrid/Row/Row.js +25 -8
  46. package/components/DataGrid/Row/constants.d.ts +8 -0
  47. package/components/DataGrid/Row/constants.js +8 -0
  48. package/components/DataGrid/Row/styles.d.ts +4 -9
  49. package/components/DataGrid/Row/styles.js +69 -17
  50. package/components/DataGrid/Row/types.d.ts +5 -1
  51. package/components/DataGrid/Row/useLogic/hooks/index.d.ts +1 -0
  52. package/components/DataGrid/Row/useLogic/hooks/index.js +1 -0
  53. package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +5 -0
  54. package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +15 -0
  55. package/components/DataGrid/Row/useLogic/useLogic.d.ts +868 -3
  56. package/components/DataGrid/Row/useLogic/useLogic.js +28 -13
  57. package/components/DataGrid/constants.d.ts +4 -0
  58. package/components/DataGrid/constants.js +4 -0
  59. package/components/DataGrid/index.d.ts +1 -0
  60. package/components/DataGrid/index.js +1 -0
  61. package/components/DataGrid/styles.d.ts +0 -9
  62. package/components/DataGrid/styles.js +43 -12
  63. package/components/DataGrid/types.d.ts +7 -0
  64. package/components/DataGrid/useLogic/hooks/index.d.ts +1 -1
  65. package/components/DataGrid/useLogic/hooks/index.js +1 -1
  66. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.d.ts +1 -0
  67. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.js +1 -0
  68. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +16 -0
  69. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +32 -0
  70. package/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.js +11 -3
  71. package/components/DataGrid/useLogic/useLogic.d.ts +10 -4
  72. package/components/DataGrid/useLogic/useLogic.js +17 -12
  73. package/components/DataGrid/useLogic/utils/getIsAllowHorizontalScroll/getIsAllowHorizontalScroll.js +1 -1
  74. package/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.d.ts +2 -0
  75. package/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.js +5 -0
  76. package/components/DataGrid/utils/getDataGridCssVars/index.d.ts +1 -0
  77. package/components/DataGrid/utils/getDataGridCssVars/index.js +1 -0
  78. package/components/DataGrid/utils/index.d.ts +1 -0
  79. package/components/DataGrid/utils/index.js +1 -0
  80. package/components/DataGridActionCell/DataGridSecondaryActions/DataGridSecondaryActions.js +1 -1
  81. package/components/DataGridInfinite/DataGridInfinite.js +5 -4
  82. package/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -1
  83. package/components/DataGridInfinite/useLogic/useLogic.js +12 -2
  84. package/components/DateRangePicker/styles.js +1 -1
  85. package/components/Description/Name/styles.js +1 -1
  86. package/components/DescriptionCell/styles.js +12 -3
  87. package/components/DescriptionList/styles.js +4 -2
  88. package/components/ExpansionPanel/styles.js +1 -1
  89. package/components/InfiniteDataList/styles.js +1 -1
  90. package/components/InfiniteTreeList/TreeItem/styles.js +1 -1
  91. package/components/MenuOrganization/styles.js +2 -2
  92. package/components/NewStepper/Step/Description/styles.js +1 -1
  93. package/components/NewStepper/Step/styles.js +2 -2
  94. package/components/NewStepper/index.d.ts +1 -0
  95. package/components/NewStepper/index.js +1 -0
  96. package/components/NewStepper/public.d.ts +1 -0
  97. package/components/NewStepper/public.js +1 -0
  98. package/components/PageAside/styles.js +3 -3
  99. package/components/PageContent/PageContentHeader/styles.js +2 -2
  100. package/components/PageContent/styles.js +4 -2
  101. package/components/PageHeader/HeaderContent/styles.js +1 -1
  102. package/components/PageHeader/styles.js +2 -2
  103. package/components/PageLayoutLoader/styles.js +1 -1
  104. package/components/PageLayoutSection/PageLayoutSection.d.ts +4 -0
  105. package/components/PageLayoutSection/PageLayoutSection.js +13 -4
  106. package/components/PageLayoutSection/PageLayoutSectionContainer/styles.js +1 -1
  107. package/components/PageLayoutSection/constants.d.ts +5 -0
  108. package/components/PageLayoutSection/constants.js +6 -0
  109. package/components/PageLayoutSection/styles.d.ts +1 -1
  110. package/components/PageLayoutSection/styles.js +7 -2
  111. package/components/PagePinnableAside/styles.js +6 -6
  112. package/components/PdfViewer/PdfPage/styles.js +2 -2
  113. package/components/Radio/styles.js +4 -2
  114. package/components/RadioCard/styles.js +13 -5
  115. package/components/SideDialogActions/styles.js +1 -1
  116. package/components/SideDialogHeader/styles.js +1 -1
  117. package/components/SideDialogTitle/styles.js +1 -1
  118. package/components/Stepper/styles.js +2 -2
  119. package/components/Tag/styles.js +1 -1
  120. package/components/Tree/TreeItem/styles.js +3 -3
  121. package/components/fileUploading/FileUploaderDropzone/DropzoneWrapper/styles.js +1 -1
  122. package/components/fileUploading/FileUploaderFile/styles.js +1 -1
  123. package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.d.ts +5 -1
  124. package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +5 -4
  125. package/components/theme/components/MuiButton.js +1 -1
  126. package/components/theme/components/MuiDivider.d.ts +3 -0
  127. package/components/theme/components/MuiDivider.js +9 -0
  128. package/components/theme/components/MuiListItem.d.ts +3 -0
  129. package/components/theme/components/MuiListItem.js +9 -0
  130. package/components/theme/components/MuiOutlinedInput.js +2 -2
  131. package/components/theme/components/MuiPaper.js +1 -1
  132. package/components/theme/components/MuiStepConnector.js +4 -1
  133. package/components/theme/components/components.js +4 -0
  134. package/components/theme/palette/componentsColors/componentsColors.d.ts +3 -0
  135. package/components/theme/palette/componentsColors/componentsColors.js +3 -0
  136. package/node/components/BottomDrawer/styles.js +1 -1
  137. package/node/components/CardGridInfinite/Footer/styles.js +1 -1
  138. package/node/components/CheckableTag/styles.js +1 -1
  139. package/node/components/Checkbox/styles.js +4 -2
  140. package/node/components/Chip/styles.js +1 -1
  141. package/node/components/CodeField/styles.js +1 -1
  142. package/node/components/ComplianceStatus/styles.js +1 -1
  143. package/node/components/ContentState/ContentState.d.ts +1 -1
  144. package/node/components/ContentState/ContentState.js +2 -2
  145. package/node/components/ContentState/types.d.ts +4 -0
  146. package/node/components/DashboardLayout/DashboardWrapper/styles.js +1 -1
  147. package/node/components/DashboardLayout/Header/styles.js +4 -4
  148. package/node/components/DashboardLayoutSkeleton/styles.js +1 -1
  149. package/node/components/DashboardSidebar/styles.js +2 -2
  150. package/node/components/DashboardSidebarSkeleton/styles.js +1 -1
  151. package/node/components/DataGrid/Body/Body.d.ts +1 -1
  152. package/node/components/DataGrid/Body/Body.js +14 -7
  153. package/node/components/DataGrid/Body/constants.d.ts +4 -0
  154. package/node/components/DataGrid/Body/constants.js +8 -0
  155. package/node/components/DataGrid/Body/styles.d.ts +0 -3
  156. package/node/components/DataGrid/Body/styles.js +14 -1
  157. package/node/components/DataGrid/Body/useLogic/index.d.ts +1 -0
  158. package/node/components/DataGrid/{useLogic/hooks/useClassnames → Body/useLogic}/index.js +1 -1
  159. package/node/components/DataGrid/Body/useLogic/useLogic.d.ts +9 -0
  160. package/node/components/DataGrid/Body/useLogic/useLogic.js +19 -0
  161. package/node/components/DataGrid/Cell/Cell.js +18 -2
  162. package/node/components/DataGrid/Cell/constants.d.ts +7 -0
  163. package/node/components/DataGrid/Cell/constants.js +11 -0
  164. package/node/components/DataGrid/Cell/styles.d.ts +14 -0
  165. package/node/components/DataGrid/Cell/styles.js +48 -1
  166. package/node/components/DataGrid/Cell/useLogic/useLogic.d.ts +2 -0
  167. package/node/components/DataGrid/Cell/useLogic/useLogic.js +3 -2
  168. package/node/components/DataGrid/DataGrid.js +41 -7
  169. package/node/components/DataGrid/Head/Head.js +1 -1
  170. package/node/components/DataGrid/Head/styles.js +5 -1
  171. package/node/components/DataGrid/Loader/styles.js +4 -0
  172. package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +6 -0
  173. package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.js +14 -0
  174. package/node/components/DataGrid/MobileSkeleton/index.d.ts +1 -0
  175. package/node/components/DataGrid/MobileSkeleton/index.js +17 -0
  176. package/node/components/DataGrid/MobileSkeleton/styles.d.ts +17 -0
  177. package/node/components/DataGrid/MobileSkeleton/styles.js +40 -0
  178. package/node/components/DataGrid/PinnedSections/Section/styles.js +2 -2
  179. package/node/components/DataGrid/Row/NestedChildren/styles.js +8 -3
  180. package/node/components/DataGrid/Row/Row.js +23 -6
  181. package/node/components/DataGrid/Row/constants.d.ts +8 -0
  182. package/node/components/DataGrid/Row/constants.js +9 -1
  183. package/node/components/DataGrid/Row/styles.d.ts +4 -9
  184. package/node/components/DataGrid/Row/styles.js +69 -17
  185. package/node/components/DataGrid/Row/types.d.ts +5 -1
  186. package/node/components/DataGrid/Row/useLogic/hooks/index.d.ts +1 -0
  187. package/node/components/DataGrid/Row/useLogic/hooks/index.js +17 -0
  188. package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +5 -0
  189. package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +19 -0
  190. package/node/components/DataGrid/Row/useLogic/useLogic.d.ts +868 -3
  191. package/node/components/DataGrid/Row/useLogic/useLogic.js +28 -13
  192. package/node/components/DataGrid/constants.d.ts +4 -0
  193. package/node/components/DataGrid/constants.js +5 -1
  194. package/node/components/DataGrid/index.d.ts +1 -0
  195. package/node/components/DataGrid/index.js +3 -1
  196. package/node/components/DataGrid/styles.d.ts +0 -9
  197. package/node/components/DataGrid/styles.js +43 -12
  198. package/node/components/DataGrid/types.d.ts +7 -0
  199. package/node/components/DataGrid/useLogic/hooks/index.d.ts +1 -1
  200. package/node/components/DataGrid/useLogic/hooks/index.js +1 -1
  201. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.d.ts +1 -0
  202. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/index.js +17 -0
  203. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +16 -0
  204. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +36 -0
  205. package/node/components/DataGrid/useLogic/hooks/usePinnedColumns/usePinnedColumns.js +11 -3
  206. package/node/components/DataGrid/useLogic/useLogic.d.ts +10 -4
  207. package/node/components/DataGrid/useLogic/useLogic.js +19 -14
  208. package/node/components/DataGrid/useLogic/utils/getIsAllowHorizontalScroll/getIsAllowHorizontalScroll.js +1 -1
  209. package/node/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.d.ts +2 -0
  210. package/node/components/DataGrid/utils/getDataGridCssVars/getDataGridCssVars.js +9 -0
  211. package/node/components/DataGrid/utils/getDataGridCssVars/index.d.ts +1 -0
  212. package/node/components/DataGrid/utils/getDataGridCssVars/index.js +5 -0
  213. package/node/components/DataGrid/utils/index.d.ts +1 -0
  214. package/node/components/DataGrid/utils/index.js +3 -1
  215. package/node/components/DataGridActionCell/DataGridSecondaryActions/DataGridSecondaryActions.js +1 -1
  216. package/node/components/DataGridInfinite/DataGridInfinite.js +5 -4
  217. package/node/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -1
  218. package/node/components/DataGridInfinite/useLogic/useLogic.js +11 -1
  219. package/node/components/DateRangePicker/styles.js +1 -1
  220. package/node/components/Description/Name/styles.js +1 -1
  221. package/node/components/DescriptionCell/styles.js +15 -6
  222. package/node/components/DescriptionList/styles.js +4 -2
  223. package/node/components/ExpansionPanel/styles.js +1 -1
  224. package/node/components/InfiniteDataList/styles.js +1 -1
  225. package/node/components/InfiniteTreeList/TreeItem/styles.js +1 -1
  226. package/node/components/MenuOrganization/styles.js +2 -2
  227. package/node/components/NewStepper/Step/Description/styles.js +1 -1
  228. package/node/components/NewStepper/Step/styles.js +2 -2
  229. package/node/components/NewStepper/index.d.ts +1 -0
  230. package/node/components/NewStepper/index.js +3 -1
  231. package/node/components/NewStepper/public.d.ts +1 -0
  232. package/node/components/NewStepper/public.js +3 -1
  233. package/node/components/PageAside/styles.js +3 -3
  234. package/node/components/PageContent/PageContentHeader/styles.js +2 -2
  235. package/node/components/PageContent/styles.js +4 -2
  236. package/node/components/PageHeader/HeaderContent/styles.js +1 -1
  237. package/node/components/PageHeader/styles.js +2 -2
  238. package/node/components/PageLayoutLoader/styles.js +1 -1
  239. package/node/components/PageLayoutSection/PageLayoutSection.d.ts +4 -0
  240. package/node/components/PageLayoutSection/PageLayoutSection.js +12 -3
  241. package/node/components/PageLayoutSection/PageLayoutSectionContainer/styles.js +1 -1
  242. package/node/components/PageLayoutSection/constants.d.ts +5 -0
  243. package/node/components/PageLayoutSection/constants.js +9 -0
  244. package/node/components/PageLayoutSection/styles.d.ts +1 -1
  245. package/node/components/PageLayoutSection/styles.js +8 -3
  246. package/node/components/PagePinnableAside/styles.js +6 -6
  247. package/node/components/PdfViewer/PdfPage/styles.js +2 -2
  248. package/node/components/Radio/styles.js +4 -2
  249. package/node/components/RadioCard/styles.js +13 -5
  250. package/node/components/SideDialogActions/styles.js +1 -1
  251. package/node/components/SideDialogHeader/styles.js +1 -1
  252. package/node/components/SideDialogTitle/styles.js +1 -1
  253. package/node/components/Stepper/styles.js +2 -2
  254. package/node/components/Tag/styles.js +1 -1
  255. package/node/components/Tree/TreeItem/styles.js +3 -3
  256. package/node/components/fileUploading/FileUploaderDropzone/DropzoneWrapper/styles.js +1 -1
  257. package/node/components/fileUploading/FileUploaderFile/styles.js +1 -1
  258. package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.d.ts +5 -1
  259. package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +5 -4
  260. package/node/components/theme/components/MuiButton.js +1 -1
  261. package/node/components/theme/components/MuiDivider.d.ts +3 -0
  262. package/node/components/theme/components/MuiDivider.js +12 -0
  263. package/node/components/theme/components/MuiListItem.d.ts +3 -0
  264. package/node/components/theme/components/MuiListItem.js +12 -0
  265. package/node/components/theme/components/MuiOutlinedInput.js +2 -2
  266. package/node/components/theme/components/MuiPaper.js +1 -1
  267. package/node/components/theme/components/MuiStepConnector.js +4 -1
  268. package/node/components/theme/components/components.js +4 -0
  269. package/node/components/theme/palette/componentsColors/componentsColors.d.ts +3 -0
  270. package/node/components/theme/palette/componentsColors/componentsColors.js +3 -0
  271. package/package.json +20 -1
  272. package/components/DataGrid/useLogic/hooks/useClassnames/index.d.ts +0 -1
  273. package/components/DataGrid/useLogic/hooks/useClassnames/index.js +0 -1
  274. package/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.d.ts +0 -12
  275. package/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.js +0 -14
  276. package/node/components/DataGrid/useLogic/hooks/useClassnames/index.d.ts +0 -1
  277. package/node/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.d.ts +0 -12
  278. package/node/components/DataGrid/useLogic/hooks/useClassnames/useClassnames.js +0 -18
@@ -27,7 +27,7 @@ export const Header = styled.header `
27
27
  height: ${({ drawerHeaderHeight }) => `${drawerHeaderHeight}px`};
28
28
  padding: ${({ theme }) => theme.spacing(1, 2, 1, 4)};
29
29
 
30
- border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
30
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
31
31
  `;
32
32
  export const HeaderTitle = styled(Typography) `
33
33
  margin-right: ${({ theme }) => theme.spacing(2)};
@@ -9,7 +9,7 @@ export const Wrapper = styled.footer `
9
9
  max-height: 76px;
10
10
  margin-top: ${({ theme }) => theme.spacing(4)};
11
11
 
12
- border-top: 1px solid ${({ theme }) => theme.palette.grey[300]};
12
+ border-top: 1px solid ${({ theme }) => theme.palette.components.border.default};
13
13
  `;
14
14
  export const FooterDummy = styled.div `
15
15
  min-height: 20px;
@@ -86,7 +86,7 @@ const getBorder = ({ isChecked, variant, color, theme, disabled, tagState = 'def
86
86
  if (tagState === 'default') {
87
87
  `1px solid ${theme.palette.grey[600]}`;
88
88
  }
89
- return `1px solid ${theme.palette.grey[400]}`;
89
+ return `1px solid ${theme.palette.components.border.default}`;
90
90
  };
91
91
  export const Wrapper = styled.label `
92
92
  width: fit-content;
@@ -3,7 +3,7 @@ import { easeOutBackTransition } from '../styled/mixins';
3
3
  import { CHECKBOX_SIZE, checkboxClassnames, MOBILE_CHECKBOX_SIZE, } from './constants';
4
4
  const getOutlineColor = ({ theme, isHover, isDisabled, isError, isChecked, isIndeterminate, }) => {
5
5
  if (isDisabled) {
6
- return theme.palette.grey[300];
6
+ return theme.palette.components.border.default;
7
7
  }
8
8
  if (isError) {
9
9
  return isHover ? theme.palette.error[700] : theme.palette.error[800];
@@ -11,7 +11,9 @@ const getOutlineColor = ({ theme, isHover, isDisabled, isError, isChecked, isInd
11
11
  if (isChecked || isIndeterminate) {
12
12
  return isHover ? theme.palette.primary[700] : theme.palette.primary[800];
13
13
  }
14
- return isHover ? theme.palette.grey[900] : theme.palette.grey[300];
14
+ return isHover
15
+ ? theme.palette.grey[900]
16
+ : theme.palette.components.border.default;
15
17
  };
16
18
  export const Wrapper = styled('span', {
17
19
  shouldForwardProp: (prop) => !['$isDisabled', '$isError', '$isChecked', '$isIndeterminate'].includes(prop),
@@ -14,7 +14,7 @@ export const Wrapper = styled.div `
14
14
  padding: ${({ theme }) => theme.spacing(0, 2)};
15
15
 
16
16
  background-color: ${({ theme }) => theme.palette.background.default};
17
- border: 1px solid ${({ theme }) => theme.palette.grey[400]};
17
+ border: 1px solid ${({ theme }) => theme.palette.components.border.default};
18
18
  border-radius: ${({ theme }) => theme.shape.medium};
19
19
 
20
20
  transition: ${({ theme }) => theme.transitions.create(['border-color', 'background-color'], {
@@ -7,7 +7,7 @@ const getBorder = (theme, isDisabled, isError) => {
7
7
  }
8
8
  return isError
9
9
  ? `1px solid ${theme.palette.error[800]}`
10
- : `1px solid ${theme.palette.grey[300]};`;
10
+ : `1px solid ${theme.palette.components.border.default};`;
11
11
  };
12
12
  export const Wrapper = styled.div `
13
13
  display: flex;
@@ -37,7 +37,7 @@ export const Wrapper = styled.article `
37
37
  &.${complianceStatusClassnames.outlined} {
38
38
  padding: ${({ theme }) => theme.spacing(3)};
39
39
 
40
- border: 1px solid ${({ theme }) => theme.palette.grey[300]};
40
+ border: 1px solid ${({ theme }) => theme.palette.components.border.default};
41
41
  }
42
42
  `;
43
43
  export const Inner = styled('ul') `
@@ -1,2 +1,2 @@
1
1
  import type { ContentStateProps } from './types';
2
- export declare const ContentState: ({ isLoading, isError, isCustom, errorState, customState, children, loadingContent, loadingTitle, placeholderSize, isSmoothLoading, }: ContentStateProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const ContentState: ({ isLoading, isError, isCustom, errorState, customState, children, loadingContent, loadingTitle, placeholderSize, isSmoothLoading, loadingPlaceholderClassname, }: ContentStateProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,13 +5,13 @@ import { LoadingPlaceholder } from '../placeholders/LoadingPlaceholder';
5
5
  import { Placeholder } from '../placeholders/Placeholder';
6
6
  import { Typography } from '../Typography';
7
7
  import { useLogic } from './useLogic';
8
- export const ContentState = ({ isLoading, isError, isCustom, errorState, customState, children, loadingContent, loadingTitle, placeholderSize, isSmoothLoading, }) => {
8
+ export const ContentState = ({ isLoading, isError, isCustom, errorState, customState, children, loadingContent, loadingTitle, placeholderSize, isSmoothLoading, loadingPlaceholderClassname, }) => {
9
9
  const { imagesMap, isLoadingPhase, isShowLoader } = useLogic({
10
10
  isLoading,
11
11
  isSmoothLoading,
12
12
  });
13
13
  if (isLoadingPhase) {
14
- return (_jsx(LoadingPlaceholder, { content: loadingContent, title: loadingTitle, isShowLoader: isShowLoader }));
14
+ return (_jsx(LoadingPlaceholder, { content: loadingContent, title: loadingTitle, isShowLoader: isShowLoader, className: loadingPlaceholderClassname }));
15
15
  }
16
16
  if (isCustom && customState) {
17
17
  return _jsx(Placeholder, { ...customState });
@@ -78,4 +78,8 @@ export type ContentStateProps = {
78
78
  * лоадер показывается и скрывается сразу при изменении `isLoading`.
79
79
  */
80
80
  isSmoothLoading?: boolean;
81
+ /**
82
+ * Класс применяемый для loading placeholder
83
+ */
84
+ loadingPlaceholderClassname?: string;
81
85
  };
@@ -19,7 +19,7 @@ export const DecorativeHeaderBackground = styled.div `
19
19
  height: ${({ $isFocusedMode }) => ($isFocusedMode ? 0 : HEADER_HEIGHT_DESKTOP)};
20
20
 
21
21
  background-color: ${({ theme }) => theme.palette.background.default};
22
- border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
22
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
23
23
 
24
24
  transition: ${({ theme }) => {
25
25
  return theme.transitions.create(['height'], {
@@ -42,7 +42,7 @@ export const HeaderRoot = styled('header', {
42
42
  padding: ${({ theme }) => theme.spacing(0, 2, 0, 1)};
43
43
 
44
44
  background-color: ${({ theme }) => theme.palette.background.default};
45
- border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
45
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
46
46
 
47
47
  transition: unset;
48
48
  }
@@ -157,14 +157,14 @@ export const PriorityFeatureWrapper = styled.div `
157
157
  height: ${MOBILE_BUTTON_HEIGHT};
158
158
  padding: ${({ theme }) => theme.spacing(3, 4)};
159
159
 
160
- border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
160
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
161
161
 
162
162
  &:hover {
163
- border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
163
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
164
164
  }
165
165
 
166
166
  &:active {
167
- border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
167
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
168
168
  }
169
169
  }
170
170
 
@@ -6,7 +6,7 @@ export const Content = styled.div `
6
6
  min-height: 0;
7
7
 
8
8
  background-color: ${({ theme }) => theme.palette.common.white};
9
- border: 1px solid ${({ theme }) => theme.palette.grey[300]};
9
+ border: 1px solid ${({ theme }) => theme.palette.components.border.default};
10
10
  border-radius: ${({ theme }) => theme.shape.medium};
11
11
 
12
12
  ${({ theme }) => theme.breakpoints.down('sm')} {
@@ -85,7 +85,7 @@ export const SidebarHeader = styled.header `
85
85
  ${({ theme }) => theme.breakpoints.down('sm')} {
86
86
  padding: ${({ theme }) => theme.spacing(4)};
87
87
 
88
- border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
88
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
89
89
 
90
90
  /* Причина игнора: Не критично для отображения */
91
91
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
@@ -148,7 +148,7 @@ export const Footer = styled.footer `
148
148
  margin-top: auto;
149
149
 
150
150
  background-color: ${({ theme }) => theme.palette.background.default};
151
- border-top: 1px solid ${({ theme }) => theme.palette.grey[300]};
151
+ border-top: 1px solid ${({ theme }) => theme.palette.components.border.default};
152
152
  border-bottom-right-radius: ${({ theme }) => theme.shape.medium};
153
153
  border-bottom-left-radius: ${({ theme }) => theme.shape.medium};
154
154
 
@@ -12,7 +12,7 @@ export const Wrapper = styled('div', {
12
12
  padding: ${({ theme, $isPinned }) => $isPinned ? theme.spacing(4, 3) : theme.spacing(4, 2)};
13
13
 
14
14
  background-color: ${({ theme }) => theme.palette.background.default};
15
- border: 1px solid ${({ theme }) => theme.palette.grey[300]};
15
+ border: 1px solid ${({ theme }) => theme.palette.components.border.default};
16
16
  border-radius: ${({ theme }) => theme.shape.medium};
17
17
 
18
18
  ${({ theme }) => theme.breakpoints.down('sm')} {
@@ -1,2 +1,2 @@
1
1
  import type { BodyProps } from './types';
2
- export declare const Body: <TData extends Record<string, unknown>>(props: BodyProps<TData>) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Body: <TData extends Record<string, unknown>>({ rows, selectedRows, minDisplayRows, keyId, noDataPlaceholder, className, ...rowProps }: BodyProps<TData>) => import("react/jsx-runtime").JSX.Element;
@@ -1,18 +1,25 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useContext } from 'react';
3
- import { ConfigContext } from '../../ConfigProvider';
2
+ import { classNames } from '../../utils/classNames';
3
+ import { cva } from '../../utils/cva';
4
4
  import { Row } from '../Row';
5
5
  import { RowContextProvider } from '../Row/RowContext';
6
+ import { bodyClassnames } from './constants';
6
7
  import { Wrapper } from './styles';
8
+ import { useLogic } from './useLogic';
7
9
  const INITIAL_LEVEL = 0;
8
- export const Body = (props) => {
9
- const { components } = useContext(ConfigContext);
10
- const disableMinHeight = components?.dataGrid?.defaultProps?.disableMinHeight;
11
- const { rows, selectedRows = [], minDisplayRows, keyId, noDataPlaceholder, className, ...rowProps } = props;
10
+ const bodyCva = cva(bodyClassnames.root, {
11
+ variants: {
12
+ disableMinHeight: {
13
+ true: bodyClassnames.disableMinHeight,
14
+ },
15
+ },
16
+ });
17
+ export const Body = ({ rows, selectedRows = [], minDisplayRows, keyId, noDataPlaceholder, className, ...rowProps }) => {
18
+ const { disableMinHeight, bodyCssVars } = useLogic({ minDisplayRows });
12
19
  const renderedRows = rows.map(({ children, options, ...row }) => {
13
20
  const rowId = row[keyId];
14
21
  const isSelected = Boolean(selectedRows?.find((selectedRow) => selectedRow[keyId] === rowId));
15
22
  return (_jsx(RowContextProvider, { children: _jsx(Row, { row: row, selectedRows: selectedRows, options: options, keyId: keyId, level: INITIAL_LEVEL, nestedChildren: children, isSelected: isSelected, ...rowProps }, rowId) }, rowId));
16
23
  });
17
- return (_jsx(Wrapper, { className: className, "$minDisplayRows": minDisplayRows, "$disableMinHeight": disableMinHeight, children: rows.length ? renderedRows : noDataPlaceholder }));
24
+ return (_jsx(Wrapper, { className: classNames(className, bodyCva({ disableMinHeight })), style: bodyCssVars, children: rows.length ? renderedRows : noDataPlaceholder }));
18
25
  };
@@ -0,0 +1,4 @@
1
+ export declare const bodyClassnames: {
2
+ root: string;
3
+ disableMinHeight: string;
4
+ };
@@ -0,0 +1,5 @@
1
+ import { createUIKitClassname } from '../../utils/createUIKitClassname';
2
+ export const bodyClassnames = {
3
+ root: createUIKitClassname('data-grid__body'),
4
+ disableMinHeight: createUIKitClassname('data-grid__body_disable-min-height'),
5
+ };
@@ -2,7 +2,4 @@
2
2
  export declare const Wrapper: import("../../styled").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
4
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
- } & {
6
- $minDisplayRows: number;
7
- $disableMinHeight?: boolean | undefined;
8
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
@@ -1,19 +1,32 @@
1
1
  import { styled } from '../../styled';
2
2
  import { dataGridClassnames, MIN_ROW_HEIGHT } from '../constants';
3
+ import { bodyClassnames } from './constants';
3
4
  export const Wrapper = styled.ul `
5
+ --min-display-rows: 0;
6
+
4
7
  overflow-y: auto;
5
8
 
6
9
  width: fit-content;
7
10
  min-width: 100%;
8
11
  height: 100%;
9
- min-height: ${({ $minDisplayRows, $disableMinHeight }) => ($disableMinHeight ? 'unset' : `${MIN_ROW_HEIGHT * $minDisplayRows}px`)};
12
+ min-height: calc(var(--min-display-rows) * ${MIN_ROW_HEIGHT}px);
10
13
  margin: 0;
11
14
  padding: 0;
12
15
 
13
16
  list-style-type: none;
14
17
 
18
+ &.${bodyClassnames.disableMinHeight} {
19
+ min-height: unset;
20
+ }
21
+
15
22
  &.${dataGridClassnames.bodyEmpty} {
16
23
  display: flex;
17
24
  align-items: center;
18
25
  }
26
+
27
+ ${({ theme }) => theme.breakpoints.down('sm')} {
28
+ overflow: initial;
29
+
30
+ width: 100%;
31
+ }
19
32
  `;
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1,9 @@
1
+ import { type CSSProperties } from 'react';
2
+ import { type CellValue } from '../../types';
3
+ import type { BodyProps } from '../types';
4
+ type UseLogicParams<TData extends Record<string, CellValue>> = Pick<BodyProps<TData>, 'minDisplayRows'>;
5
+ export declare const useLogic: <TData extends Record<string, unknown>>({ minDisplayRows, }: UseLogicParams<TData>) => {
6
+ disableMinHeight: boolean | undefined;
7
+ bodyCssVars: CSSProperties;
8
+ };
9
+ export {};
@@ -0,0 +1,15 @@
1
+ import { useContext } from 'react';
2
+ import { ConfigContext } from '../../../ConfigProvider';
3
+ export const useLogic = ({ minDisplayRows, }) => {
4
+ const { components } = useContext(ConfigContext);
5
+ const disableMinHeight = components?.dataGrid?.defaultProps?.disableMinHeight;
6
+ const bodyCssVars = !disableMinHeight && minDisplayRows
7
+ ? {
8
+ '--min-display-rows': minDisplayRows,
9
+ }
10
+ : {};
11
+ return {
12
+ disableMinHeight,
13
+ bodyCssVars,
14
+ };
15
+ };
@@ -1,16 +1,32 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { OverflowTypography } from '../../OverflowTypography';
3
3
  import { useHidePersonalData } from '../../personalDataSecurity';
4
4
  import { classNames } from '../../utils/classNames';
5
+ import { cva } from '../../utils/cva';
5
6
  import { getInertProps } from '../../utils/getInertProps';
6
- import { Wrapper } from './styles';
7
+ import { dataGridCellClassnames } from './constants';
8
+ import { CellContent, ColumnLabel, Wrapper } from './styles';
7
9
  import { useLogic } from './useLogic';
10
+ const cellCva = cva(dataGridCellClassnames.root, {
11
+ variants: {
12
+ isHideOnMobile: {
13
+ true: dataGridCellClassnames.isHideOnMobile,
14
+ },
15
+ },
16
+ });
17
+ const cellContentCva = cva(dataGridCellClassnames.cellContent, {
18
+ variants: {
19
+ isActionColumn: {
20
+ true: dataGridCellClassnames.actionColumn,
21
+ },
22
+ },
23
+ });
8
24
  export const Cell = (props) => {
9
- const { formattedValue, hasStartAdornment } = useLogic(props);
25
+ const { formattedValue, hasStartAdornment, isActionColumn, label } = useLogic(props);
10
26
  const { className, startAdornment, row, cell, isDisabled, isHidePersonalData, } = props;
11
27
  const { renderCell, align = 'left' } = cell;
12
28
  const hidePersonalDataClassname = useHidePersonalData({
13
29
  isEnabled: isHidePersonalData === true,
14
30
  });
15
- return (_jsxs(Wrapper, { "$isDisabled": isDisabled, "$align": align, "$hasStartAdornment": hasStartAdornment, className: classNames(className, hidePersonalDataClassname), ...getInertProps(isDisabled), children: [startAdornment && startAdornment, renderCell?.(row), !renderCell && (_jsx(OverflowTypography, { rowsCount: 2, tooltipProps: { className: hidePersonalDataClassname }, children: _jsx(_Fragment, { children: formattedValue }) }))] }));
31
+ return (_jsxs(Wrapper, { "$isDisabled": isDisabled, "$align": align, "$hasStartAdornment": hasStartAdornment, className: classNames(className, hidePersonalDataClassname, cellCva({ isHideOnMobile: cell.isHideOnMobile })), ...getInertProps(isDisabled), children: [startAdornment && startAdornment, _jsxs(CellContent, { className: cellContentCva({ isActionColumn }), children: [_jsx(ColumnLabel, { variant: "caption", color: "textSecondary", className: dataGridCellClassnames.columnLabel, children: label }), renderCell?.(row), !renderCell && (_jsx(OverflowTypography, { rowsCount: 2, tooltipProps: { className: hidePersonalDataClassname }, children: _jsx(_Fragment, { children: formattedValue }) }))] })] }));
16
32
  };
@@ -0,0 +1,7 @@
1
+ export declare const dataGridCellClassnames: {
2
+ root: string;
3
+ isHideOnMobile: string;
4
+ columnLabel: string;
5
+ actionColumn: string;
6
+ cellContent: string;
7
+ };
@@ -0,0 +1,8 @@
1
+ import { createUIKitClassname } from '../../utils/createUIKitClassname';
2
+ export const dataGridCellClassnames = {
3
+ root: createUIKitClassname('data-grid__cell'),
4
+ isHideOnMobile: createUIKitClassname('data-grid__cell_hide-on-mobile'),
5
+ columnLabel: createUIKitClassname('data-grid__cell-column-label'),
6
+ actionColumn: createUIKitClassname('data-grid__cell_action-column'),
7
+ cellContent: createUIKitClassname('data-grid__cell-content'),
8
+ };
@@ -9,4 +9,18 @@ export declare const Wrapper: import("../../styled").StyledComponent<{
9
9
  theme?: import("@emotion/react").Theme | undefined;
10
10
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
11
11
  } & HeadCellProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
12
+ export declare const ColumnLabel: import("../../styled").StyledComponent<import("../../Typography/types").TypographyPropsBase & {
13
+ color?: import("../../Typography").TypographyColor | undefined;
14
+ variant?: import("../../Typography").TypographyVariant | undefined;
15
+ colorIntensity?: import("../../Typography").Intensity | undefined;
16
+ component?: import("../../Typography/types").ComponentProp | undefined;
17
+ isUpperCase?: boolean | undefined;
18
+ withoutCalt?: boolean | undefined;
19
+ } & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
20
+ theme?: import("@emotion/react").Theme | undefined;
21
+ }, {}, {}>;
22
+ export declare const CellContent: import("../../styled").StyledComponent<{
23
+ theme?: import("@emotion/react").Theme | undefined;
24
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
25
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
12
26
  export {};
@@ -1,6 +1,9 @@
1
1
  import { styled } from '../../styled';
2
+ import { Typography } from '../../Typography';
2
3
  import { MIN_ROW_HEIGHT } from '../constants';
4
+ import { dataGridRowClassnames } from '../Row/constants';
3
5
  import { alignToJustifyContent } from '../utils';
6
+ import { dataGridCellClassnames } from './constants';
4
7
  export const Wrapper = styled('div', {
5
8
  shouldForwardProp: (prop) => !['$align', '$isDisabled', '$hasStartAdornment'].includes(prop),
6
9
  }) `
@@ -13,4 +16,48 @@ export const Wrapper = styled('div', {
13
16
  padding: ${({ theme, $hasStartAdornment }) => $hasStartAdornment ? theme.spacing(1, 2, 1, 0) : theme.spacing(1, 2)};
14
17
 
15
18
  opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};
19
+
20
+ ${({ theme }) => theme.breakpoints.down('sm')} {
21
+ justify-content: space-between;
22
+
23
+ min-height: unset;
24
+ padding: 0;
25
+
26
+ &.${dataGridCellClassnames.isHideOnMobile} {
27
+ display: none;
28
+ }
29
+
30
+
31
+ & .${dataGridRowClassnames.checkbox} {
32
+ align-self: flex-start;
33
+ order: 1;
34
+ }
35
+ }
36
+ `;
37
+ export const ColumnLabel = styled(Typography) `
38
+ display: none;
39
+
40
+ ${({ theme }) => theme.breakpoints.down('sm')} {
41
+ display: block;
42
+ }
43
+ `;
44
+ export const CellContent = styled.div `
45
+ min-width: 0;
46
+
47
+ ${({ theme }) => theme.breakpoints.down('sm')} {
48
+ display: flex;
49
+ flex-direction: column;
50
+ gap: ${({ theme }) => theme.spacing(1)};
51
+ align-items: flex-start;
52
+
53
+ width: 100%;
54
+
55
+ &.${dataGridCellClassnames.actionColumn} {
56
+ align-items: flex-end;
57
+
58
+ & .${dataGridCellClassnames.columnLabel} {
59
+ display: none;
60
+ }
61
+ }
62
+ }
16
63
  `;
@@ -4,5 +4,7 @@ type UseLogicParams<TData extends Record<string, CellValue>> = CellProps<TData>;
4
4
  export declare const useLogic: <TData extends Record<string, unknown>>({ row, cell, emptyCellValue, startAdornment, }: UseLogicParams<TData>) => {
5
5
  formattedValue: unknown;
6
6
  hasStartAdornment: boolean;
7
+ isActionColumn: boolean;
8
+ label: string | undefined;
7
9
  };
8
10
  export {};
@@ -1,6 +1,6 @@
1
1
  import { useMemo } from 'react';
2
2
  export const useLogic = ({ row, cell, emptyCellValue, startAdornment, }) => {
3
- const { format, field } = cell;
3
+ const { format, field, label } = cell;
4
4
  const isValidValue = (value) => {
5
5
  return Boolean(value) || value === 0;
6
6
  };
@@ -14,5 +14,6 @@ export const useLogic = ({ row, cell, emptyCellValue, startAdornment, }) => {
14
14
  return emptyCellValue;
15
15
  }, [field, format, row, emptyCellValue]);
16
16
  const hasStartAdornment = Boolean(startAdornment);
17
- return { formattedValue, hasStartAdornment };
17
+ const isActionColumn = cell.field === 'actions';
18
+ return { formattedValue, hasStartAdornment, isActionColumn, label };
18
19
  };
@@ -2,24 +2,51 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useContext } from 'react';
3
3
  import { ConfigContext } from '../ConfigProvider';
4
4
  import { ContentState } from '../ContentState';
5
+ import { classNames } from '../utils/classNames';
6
+ import { cva } from '../utils/cva';
5
7
  import { getInertProps } from '../utils/getInertProps';
6
8
  import { Body } from './Body';
7
- import { EXPANDED_LEVEL_BY_DEFAULT, INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, MIN_DISPLAY_ROWS_BY_DEFAULT, } from './constants';
9
+ import { dataGridClassnames, EXPANDED_LEVEL_BY_DEFAULT, INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, MIN_DISPLAY_ROWS_BY_DEFAULT, } from './constants';
8
10
  import { DataGridContextProvider } from './DataGridContext';
9
11
  import { Variant } from './enums';
10
12
  import { Head } from './Head';
11
13
  import { Loader } from './Loader';
14
+ import { MobileSkeleton } from './MobileSkeleton';
12
15
  import { NoData } from './NoData';
13
16
  import { PinnedSections } from './PinnedSections';
14
17
  import { Container, DataGridWrapper, DisabledDataGridWrapper } from './styles';
15
18
  import { useLogic } from './useLogic';
19
+ const pinnedSectionsCva = cva(dataGridClassnames.pinnedSections, {
20
+ variants: {
21
+ isDisabled: {
22
+ true: dataGridClassnames.disabled,
23
+ },
24
+ },
25
+ });
26
+ const dataGridCva = cva(dataGridClassnames.root, {
27
+ variants: {
28
+ hasPinnedColumns: {
29
+ true: dataGridClassnames.dataGridHasPinnedSections,
30
+ },
31
+ isAllowHorizontalScroll: {
32
+ true: dataGridClassnames.isAllowHorizontalScroll,
33
+ },
34
+ },
35
+ });
36
+ const bodyCva = cva(dataGridClassnames.body, {
37
+ variants: {
38
+ isNoData: {
39
+ true: dataGridClassnames.bodyEmpty,
40
+ },
41
+ },
42
+ });
16
43
  export const DataGrid = (props) => {
17
- const { isDataGridDisabled, treeRenderConfig, headColumns, headProps, bodyProps, gridColumns, loaderProps, renderRows, isAllowHorizontalScroll, isHideHead, hasPinnedColumns, pinnedSectionsClassname, dataGridClassname, contentStateProps, rowHoverProps, containerRef, sections, isNoData, bodyClassName, } = useLogic(props);
44
+ const { dataGridClassName, isDataGridDisabled, treeRenderConfig, headColumns, headProps, bodyProps, gridColumns, loaderProps, renderRows, isAllowHorizontalScroll, isHideHead, hasPinnedColumns, contentStateProps, rowHoverProps, containerRef, sections, isNoData, isMobile, mobileSkeletonProps, isLoading, containerCssVars, } = useLogic(props);
18
45
  const { emptySymbol } = useContext(ConfigContext);
19
- const { columns, selectedRows = [], maxHeight, minDisplayRows = MIN_DISPLAY_ROWS_BY_DEFAULT, variant = Variant.Tree, footer, noDataPlaceholder, isLoading, subrows, keyId, activeRowId, emptyCellValue = emptySymbol, onRowClick, noDataOptions, headPreAddon, } = props;
46
+ const { columns, selectedRows = [], minDisplayRows = MIN_DISPLAY_ROWS_BY_DEFAULT, variant = Variant.Tree, footer, noDataPlaceholder, subrows, keyId, activeRowId, emptyCellValue = emptySymbol, onRowClick, noDataOptions, headPreAddon, } = props;
20
47
  const { moreButtonColumnPosition = 1, isVisibleCollapseButton = true } = subrows || {};
21
48
  const { isInitialExpanded = false, expandedLevel = EXPANDED_LEVEL_BY_DEFAULT, initialVisibleChildrenCount = INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, } = treeRenderConfig || {};
22
- const TableContainer = isDataGridDisabled
49
+ const Wrapper = isDataGridDisabled
23
50
  ? DisabledDataGridWrapper
24
51
  : DataGridWrapper;
25
52
  const renderedPlaceholder = useCallback(() => {
@@ -47,10 +74,17 @@ export const DataGrid = (props) => {
47
74
  ...rowHoverProps,
48
75
  };
49
76
  const renderTableContent = () => {
50
- if (!hasPinnedColumns) {
51
- return (_jsxs(TableContainer, { "$isAllowHorizontalScroll": isAllowHorizontalScroll, ...getInertProps(isDataGridDisabled), children: [headPreAddon, !isHideHead && (_jsx(Head, { ...headProps, columns: headColumns, gridColumns: gridColumns })), _jsx(ContentState, { ...contentStateProps, children: _jsx(Body, { ...commonBodyProps, columns: columns, gridColumns: gridColumns, className: bodyClassName }) })] }));
77
+ if (!hasPinnedColumns || isMobile) {
78
+ return (_jsxs(Wrapper, { ...getInertProps(isDataGridDisabled), className: dataGridClassnames.wrapper, children: [headPreAddon, !isHideHead && (_jsx(Head, { ...headProps, columns: headColumns, gridColumns: gridColumns })), _jsx(ContentState, { ...contentStateProps, loadingContent: isMobile && _jsx(MobileSkeleton, { ...mobileSkeletonProps }), children: _jsx(Body, { ...commonBodyProps, columns: columns, gridColumns: gridColumns, className: bodyCva({
79
+ isNoData,
80
+ }) }) })] }));
52
81
  }
53
- return (_jsx(ContentState, { ...contentStateProps, children: _jsx(PinnedSections, { sections: sections, className: pinnedSectionsClassname, isDisabled: isDataGridDisabled, headProps: headProps, gridColumns: gridColumns, bodyProps: commonBodyProps, isNoData: isNoData }) }));
82
+ return (_jsx(ContentState, { ...contentStateProps, children: _jsx(PinnedSections, { sections: sections, className: pinnedSectionsCva({
83
+ isDisabled: isDataGridDisabled,
84
+ }), isDisabled: isDataGridDisabled, headProps: headProps, gridColumns: gridColumns, bodyProps: commonBodyProps, isNoData: isNoData }) }));
54
85
  };
55
- return (_jsx(DataGridContextProvider, { isLoading: isLoading, children: _jsxs(Container, { ref: containerRef, "$maxHeight": maxHeight, "$isAllowHorizontalScroll": isAllowHorizontalScroll, className: dataGridClassname, children: [renderTableContent(), _jsx(Loader, { ...loaderProps }), footer && footer] }) }));
86
+ return (_jsx(DataGridContextProvider, { isLoading: isLoading, children: _jsxs(Container, { ref: containerRef, style: containerCssVars, className: classNames(dataGridClassName, dataGridCva({
87
+ isAllowHorizontalScroll,
88
+ hasPinnedColumns,
89
+ })), children: [renderTableContent(), _jsx(Loader, { ...loaderProps }), footer && footer] }) }));
56
90
  };
@@ -29,5 +29,5 @@ export const Head = (props) => {
29
29
  onSelectAllRows,
30
30
  handleSort,
31
31
  ]);
32
- return (_jsx(Wrapper, { className: dataGridClassnames.header, "$gridColumns": gridColumns, children: renderColumns }));
32
+ return (_jsx(Wrapper, { role: "heading", className: dataGridClassnames.header, "$gridColumns": gridColumns, children: renderColumns }));
33
33
  };
@@ -9,7 +9,11 @@ export const Wrapper = styled('header', {
9
9
  width: fit-content;
10
10
  min-width: 100%;
11
11
 
12
- border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
12
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
13
+
14
+ ${({ theme }) => theme.breakpoints.down('sm')} {
15
+ display: none;
16
+ }
13
17
  `;
14
18
  export const CheckboxCell = styled.div `
15
19
  display: flex;
@@ -18,6 +18,10 @@ export const LoaderWrapper = styled.div `
18
18
  position: sticky;
19
19
  z-index: ${({ theme }) => theme.zIndex.fab};
20
20
  left: 0;
21
+
22
+ ${({ theme }) => theme.breakpoints.down('sm')} {
23
+ display: none;
24
+ }
21
25
  `;
22
26
  export const StyledLinearProgress = styled(LinearProgress) `
23
27
  height: 2px;
@@ -0,0 +1,6 @@
1
+ type MobileSkeletonProps = {
2
+ cellsCount: number;
3
+ rowsCount: number;
4
+ };
5
+ export declare const MobileSkeleton: ({ cellsCount, rowsCount, }: MobileSkeletonProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Skeleton } from '../../Skeleton';
3
+ import { Actions, Cell, Root, RowWrapper } from './styles';
4
+ export const MobileSkeleton = ({ cellsCount, rowsCount, }) => {
5
+ return (_jsx(Root, { children: Array.from({ length: rowsCount }, (_, rowIndex) => (_jsxs(RowWrapper
6
+ // biome-ignore lint/suspicious/noArrayIndexKey: Статичный скелетон
7
+ , { children: [Array.from({ length: cellsCount - 1 }, (_cell, cellIndex) => (
8
+ // biome-ignore lint/suspicious/noArrayIndexKey: Статичный скелетон
9
+ _jsxs(Cell, { children: [_jsx(Skeleton, { variant: "rounded", height: 20 }), _jsx(Skeleton, { variant: "rounded", height: 16, width: "50%" })] }, cellIndex))), _jsx(Actions, { children: _jsx(Skeleton, { variant: "rounded", width: "100%", height: 40 }) })] }, rowIndex))) }));
10
+ };
@@ -0,0 +1 @@
1
+ export * from './MobileSkeleton';
@@ -0,0 +1 @@
1
+ export * from './MobileSkeleton';