@astral/ui 4.74.0 → 4.75.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 (469) hide show
  1. package/components/CardGridInfinite/CardGridInfinite.js +11 -2
  2. package/components/CardGridInfinite/styles.js +4 -0
  3. package/components/CardGridInfinite/useLogic/useLogic.d.ts +1 -1
  4. package/components/CardGridInfinite/useLogic/useLogic.js +3 -13
  5. package/components/Chevron/Chevron.d.ts +1 -1
  6. package/components/ConfirmAction/ConfirmAction.js +3 -3
  7. package/components/ConfirmAction/constants.d.ts +1 -0
  8. package/components/ConfirmAction/constants.js +1 -0
  9. package/components/ConfirmAction/styles.js +13 -0
  10. package/components/ConfirmAction/types.d.ts +1 -1
  11. package/components/DataGrid/Body/Body.d.ts +1 -1
  12. package/components/DataGrid/Body/Body.js +5 -3
  13. package/components/DataGrid/Body/types.d.ts +5 -0
  14. package/components/DataGrid/Cell/Cell.d.ts +9 -1
  15. package/components/DataGrid/Cell/Cell.js +16 -2
  16. package/components/DataGrid/CustomRowWrapper/CustomRowWrapper.d.ts +19 -0
  17. package/components/DataGrid/CustomRowWrapper/CustomRowWrapper.js +15 -0
  18. package/components/DataGrid/CustomRowWrapper/index.d.ts +1 -0
  19. package/components/DataGrid/CustomRowWrapper/index.js +1 -0
  20. package/components/DataGrid/DataGrid.js +14 -3
  21. package/components/DataGrid/DataGridContext/DataGridContext.d.ts +9 -5
  22. package/components/DataGrid/DataGridContext/DataGridContext.js +7 -4
  23. package/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +3 -4
  24. package/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.js +18 -48
  25. package/components/DataGrid/DataGridStorageContext/DataGridStorageContext.d.ts +29 -0
  26. package/components/DataGrid/DataGridStorageContext/DataGridStorageContext.js +28 -0
  27. package/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/DataGridStorageProvider.d.ts +6 -0
  28. package/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/DataGridStorageProvider.js +12 -0
  29. package/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/index.d.ts +1 -0
  30. package/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/index.js +1 -0
  31. package/components/DataGrid/DataGridStorageContext/index.d.ts +2 -0
  32. package/components/DataGrid/DataGridStorageContext/index.js +2 -0
  33. package/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +2 -1
  34. package/components/DataGrid/MobileSkeleton/MobileSkeleton.js +21 -3
  35. package/components/DataGrid/MobileSkeleton/styles.js +12 -0
  36. package/components/DataGrid/Row/NestedChildren/NestedChildren.d.ts +1 -5
  37. package/components/DataGrid/Row/NestedChildren/NestedChildren.js +17 -7
  38. package/components/DataGrid/Row/NestedChildren/constants.d.ts +6 -0
  39. package/components/DataGrid/Row/NestedChildren/constants.js +7 -0
  40. package/components/DataGrid/Row/NestedChildren/styles.js +42 -3
  41. package/components/DataGrid/Row/NestedChildren/useLogic/useLogic.d.ts +1 -1
  42. package/components/DataGrid/Row/NestedChildren/useLogic/useLogic.js +4 -6
  43. package/components/DataGrid/Row/Row.js +34 -37
  44. package/components/DataGrid/Row/RowContext/RowContext.d.ts +10 -1
  45. package/components/DataGrid/Row/RowContext/RowContext.js +9 -0
  46. package/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +3 -2
  47. package/components/DataGrid/Row/RowContext/RowProvider/RowProvider.js +25 -2
  48. package/components/DataGrid/Row/constants.d.ts +6 -0
  49. package/components/DataGrid/Row/constants.js +6 -0
  50. package/components/DataGrid/Row/styles.js +102 -3
  51. package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +1 -0
  52. package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +1 -1
  53. package/components/DataGrid/Row/useLogic/useLogic.d.ts +5 -2
  54. package/components/DataGrid/Row/useLogic/useLogic.js +21 -19
  55. package/components/DataGrid/RowBase/GroupCell/GroupCell.d.ts +2 -0
  56. package/components/DataGrid/RowBase/GroupCell/GroupCell.js +22 -0
  57. package/components/DataGrid/RowBase/GroupCell/constants.d.ts +4 -0
  58. package/components/DataGrid/RowBase/GroupCell/constants.js +5 -0
  59. package/components/DataGrid/RowBase/GroupCell/index.d.ts +1 -0
  60. package/components/DataGrid/RowBase/GroupCell/index.js +1 -0
  61. package/components/DataGrid/RowBase/GroupCell/styles.d.ts +12 -0
  62. package/components/DataGrid/RowBase/GroupCell/styles.js +16 -0
  63. package/components/DataGrid/RowBase/GroupCell/types.d.ts +11 -0
  64. package/components/DataGrid/RowBase/GroupCell/types.js +1 -0
  65. package/components/DataGrid/RowBase/RowBase.d.ts +3 -0
  66. package/components/DataGrid/RowBase/RowBase.js +69 -0
  67. package/components/DataGrid/RowBase/constants.d.ts +9 -0
  68. package/components/DataGrid/RowBase/constants.js +10 -0
  69. package/components/DataGrid/RowBase/index.d.ts +3 -0
  70. package/components/DataGrid/RowBase/index.js +2 -0
  71. package/components/DataGrid/RowBase/styles.d.ts +17 -0
  72. package/components/DataGrid/RowBase/styles.js +87 -0
  73. package/components/DataGrid/RowBase/types.d.ts +92 -0
  74. package/components/DataGrid/RowBase/types.js +1 -0
  75. package/components/DataGrid/RowBase/useLogic/useLogic.d.ts +46 -0
  76. package/components/DataGrid/RowBase/useLogic/useLogic.js +90 -0
  77. package/components/DataGrid/constants.d.ts +8 -0
  78. package/components/DataGrid/constants.js +8 -0
  79. package/components/DataGrid/index.d.ts +3 -0
  80. package/components/DataGrid/index.js +3 -0
  81. package/components/DataGrid/styles.js +14 -0
  82. package/components/DataGrid/tests/performance/testDataGridPerformance.d.ts +21 -0
  83. package/components/DataGrid/tests/performance/testDataGridPerformance.js +102 -0
  84. package/components/DataGrid/types.d.ts +11 -0
  85. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +3 -1
  86. package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +2 -1
  87. package/components/DataGrid/useLogic/useLogic.d.ts +4 -1
  88. package/components/DataGrid/useLogic/useLogic.js +20 -7
  89. package/components/DataGridActionCell/DataGridMainActions/Action/MainIconButton/MainIconButton.js +4 -2
  90. package/components/DataGridActionCell/DataGridMainActions/Action/MobileMainButton/MobileMainButton.js +4 -2
  91. package/components/DataGridActionCell/types.d.ts +4 -0
  92. package/components/DataGridCollapsibleRow/DataGridCollapsibleRow.d.ts +2 -0
  93. package/components/DataGridCollapsibleRow/DataGridCollapsibleRow.js +29 -0
  94. package/components/DataGridCollapsibleRow/constants.d.ts +11 -0
  95. package/components/DataGridCollapsibleRow/constants.js +12 -0
  96. package/components/DataGridCollapsibleRow/index.d.ts +2 -0
  97. package/components/DataGridCollapsibleRow/index.js +1 -0
  98. package/components/DataGridCollapsibleRow/public.d.ts +2 -0
  99. package/components/DataGridCollapsibleRow/public.js +1 -0
  100. package/components/DataGridCollapsibleRow/styles.d.ts +42 -0
  101. package/components/DataGridCollapsibleRow/styles.js +99 -0
  102. package/components/DataGridCollapsibleRow/types.d.ts +19 -0
  103. package/components/DataGridCollapsibleRow/types.js +1 -0
  104. package/components/DataGridCollapsibleRow/useLogic/index.js +1 -0
  105. package/components/DataGridCollapsibleRow/useLogic/useLogic.d.ts +29 -0
  106. package/components/DataGridCollapsibleRow/useLogic/useLogic.js +62 -0
  107. package/components/DataGridInfinite/DataGridInfinite.js +37 -27
  108. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.d.ts +23 -0
  109. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.js +21 -0
  110. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/DataGridInfiniteContextProvider.d.ts +7 -0
  111. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/DataGridInfiniteContextProvider.js +5 -0
  112. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/index.d.ts +1 -0
  113. package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/index.js +1 -0
  114. package/components/DataGridInfinite/DataGridInfiniteContext/index.d.ts +2 -0
  115. package/components/DataGridInfinite/DataGridInfiniteContext/index.js +2 -0
  116. package/components/DataGridInfinite/List/List.js +2 -1
  117. package/components/DataGridInfinite/List/constants.d.ts +3 -0
  118. package/components/DataGridInfinite/List/constants.js +4 -0
  119. package/components/DataGridInfinite/List/index.d.ts +1 -0
  120. package/components/DataGridInfinite/List/index.js +1 -0
  121. package/components/DataGridInfinite/Row/Row.d.ts +2 -0
  122. package/components/DataGridInfinite/Row/Row.js +10 -0
  123. package/components/DataGridInfinite/Row/index.d.ts +1 -0
  124. package/components/DataGridInfinite/Row/index.js +1 -0
  125. package/components/DataGridInfinite/Row/types.d.ts +2 -0
  126. package/components/DataGridInfinite/Row/types.js +1 -0
  127. package/components/DataGridInfinite/Row/useLogic/index.d.ts +1 -0
  128. package/components/DataGridInfinite/Row/useLogic/index.js +1 -0
  129. package/components/DataGridInfinite/Row/useLogic/useLogic.d.ts +33 -0
  130. package/components/DataGridInfinite/Row/useLogic/useLogic.js +35 -0
  131. package/components/DataGridInfinite/faker.js +1 -1
  132. package/components/DataGridInfinite/styles.d.ts +6 -0
  133. package/components/DataGridInfinite/styles.js +11 -0
  134. package/components/DataGridInfinite/useLogic/useLogic.d.ts +6 -3
  135. package/components/DataGridInfinite/useLogic/useLogic.js +29 -10
  136. package/components/DialogActions/styles.js +2 -0
  137. package/components/DonutChart/DonutChart.d.ts +2 -0
  138. package/components/DonutChart/DonutChart.js +9 -0
  139. package/components/DonutChart/constants.d.ts +15 -0
  140. package/components/DonutChart/constants.js +16 -0
  141. package/components/DonutChart/index.d.ts +3 -0
  142. package/components/DonutChart/index.js +2 -0
  143. package/components/DonutChart/public.d.ts +3 -0
  144. package/components/DonutChart/public.js +2 -0
  145. package/components/DonutChart/styles.d.ts +21 -0
  146. package/components/DonutChart/styles.js +41 -0
  147. package/components/DonutChart/types.d.ts +27 -0
  148. package/components/DonutChart/types.js +1 -0
  149. package/components/DonutChart/useLogic/hooks/index.d.ts +1 -0
  150. package/components/DonutChart/useLogic/hooks/index.js +1 -0
  151. package/components/DonutChart/useLogic/hooks/useRenderWidth/index.d.ts +1 -0
  152. package/components/DonutChart/useLogic/hooks/useRenderWidth/index.js +1 -0
  153. package/components/DonutChart/useLogic/hooks/useRenderWidth/useRenderWidth.d.ts +9 -0
  154. package/components/DonutChart/useLogic/hooks/useRenderWidth/useRenderWidth.js +30 -0
  155. package/components/DonutChart/useLogic/index.d.ts +1 -0
  156. package/components/DonutChart/useLogic/index.js +1 -0
  157. package/components/DonutChart/useLogic/useLogic.d.ts +15 -0
  158. package/components/DonutChart/useLogic/useLogic.js +40 -0
  159. package/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.d.ts +16 -0
  160. package/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.js +10 -0
  161. package/components/DonutChart/useLogic/utils/getDonutChartCssVars/index.d.ts +1 -0
  162. package/components/DonutChart/useLogic/utils/getDonutChartCssVars/index.js +1 -0
  163. package/components/DonutChart/useLogic/utils/getGeometry/getGeometry.d.ts +10 -0
  164. package/components/DonutChart/useLogic/utils/getGeometry/getGeometry.js +13 -0
  165. package/components/DonutChart/useLogic/utils/getGeometry/index.d.ts +1 -0
  166. package/components/DonutChart/useLogic/utils/getGeometry/index.js +1 -0
  167. package/components/DonutChart/useLogic/utils/getMeterAriaValue/getMeterAriaValue.d.ts +13 -0
  168. package/components/DonutChart/useLogic/utils/getMeterAriaValue/getMeterAriaValue.js +22 -0
  169. package/components/DonutChart/useLogic/utils/getMeterAriaValue/index.d.ts +1 -0
  170. package/components/DonutChart/useLogic/utils/getMeterAriaValue/index.js +1 -0
  171. package/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.d.ts +9 -0
  172. package/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.js +29 -0
  173. package/components/DonutChart/useLogic/utils/getProgressCirclePath/index.d.ts +1 -0
  174. package/components/DonutChart/useLogic/utils/getProgressCirclePath/index.js +1 -0
  175. package/components/DonutChart/useLogic/utils/getProgressOffset/getProgressOffset.d.ts +8 -0
  176. package/components/DonutChart/useLogic/utils/getProgressOffset/getProgressOffset.js +21 -0
  177. package/components/DonutChart/useLogic/utils/getProgressOffset/index.d.ts +1 -0
  178. package/components/DonutChart/useLogic/utils/getProgressOffset/index.js +1 -0
  179. package/components/DonutChart/useLogic/utils/getProgressPercent/getProgressPercent.d.ts +8 -0
  180. package/components/DonutChart/useLogic/utils/getProgressPercent/getProgressPercent.js +16 -0
  181. package/components/DonutChart/useLogic/utils/getProgressPercent/index.d.ts +1 -0
  182. package/components/DonutChart/useLogic/utils/getProgressPercent/index.js +1 -0
  183. package/components/DonutChart/useLogic/utils/index.d.ts +6 -0
  184. package/components/DonutChart/useLogic/utils/index.js +6 -0
  185. package/components/ExpansionPanel/Summary/styles.d.ts +1 -1
  186. package/components/MenuOrganization/OrganizationButton/styles.d.ts +1 -1
  187. package/components/NewStepper/StepIcon/StepIcon.js +3 -1
  188. package/components/NewStepper/StepIcon/useLogic/index.d.ts +1 -0
  189. package/components/NewStepper/StepIcon/useLogic/index.js +1 -0
  190. package/components/NewStepper/StepIcon/useLogic/useLogic.d.ts +8 -0
  191. package/components/NewStepper/StepIcon/useLogic/useLogic.js +6 -0
  192. package/components/PageContent/PageContent.js +23 -5
  193. package/components/PageContent/constants.d.ts +2 -0
  194. package/components/PageContent/constants.js +2 -0
  195. package/components/PageContent/styles.d.ts +0 -2
  196. package/components/PageContent/styles.js +17 -11
  197. package/components/PageContent/types.d.ts +4 -0
  198. package/components/Profile/styles.d.ts +1 -1
  199. package/components/constants/classnames.d.ts +1 -0
  200. package/components/constants/classnames.js +2 -0
  201. package/components/constants/index.d.ts +1 -0
  202. package/components/constants/index.js +1 -0
  203. package/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.d.ts +2 -1
  204. package/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.js +4 -1
  205. package/components/fileUploading/FileUploaderDropzone/HintPlaceholder/useLogic/useLogic.d.ts +5 -4
  206. package/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/HintPlaceholder.js +11 -2
  207. package/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/useLogic/useLogic.d.ts +5 -5
  208. package/components/fileUploading/hooks/useFileUploader/useFileUploader.d.ts +1 -1
  209. package/components/fileUploading/hooks/usePreviewFileUploader/usePreviewFileUploader.d.ts +1 -1
  210. package/components/fileUploading/types.d.ts +2 -2
  211. package/components/useProfiler/index.d.ts +1 -0
  212. package/components/useProfiler/index.js +1 -0
  213. package/components/useProfiler/useProfiler.d.ts +14 -0
  214. package/components/useProfiler/useProfiler.js +46 -0
  215. package/components/useProfiler/utils/index.d.ts +1 -0
  216. package/components/useProfiler/utils/index.js +1 -0
  217. package/components/useProfiler/utils/shallowEqual/index.d.ts +1 -0
  218. package/components/useProfiler/utils/shallowEqual/index.js +1 -0
  219. package/components/useProfiler/utils/shallowEqual/shallowEqual.d.ts +5 -0
  220. package/components/useProfiler/utils/shallowEqual/shallowEqual.js +26 -0
  221. package/hook-form/FormFilters/FormFilters.js +1 -1
  222. package/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.d.ts +5 -1
  223. package/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.js +4 -3
  224. package/hook-form/FormFilters/FormQuickFiltersSkeleton/FormQuickFiltersSkeleton.d.ts +1 -0
  225. package/hook-form/FormFilters/FormQuickFiltersSkeleton/FormQuickFiltersSkeleton.js +9 -0
  226. package/hook-form/FormFilters/FormQuickFiltersSkeleton/index.d.ts +1 -0
  227. package/hook-form/FormFilters/FormQuickFiltersSkeleton/index.js +1 -0
  228. package/hook-form/FormFilters/FormQuickFiltersSkeleton/styles.d.ts +5 -0
  229. package/hook-form/FormFilters/FormQuickFiltersSkeleton/styles.js +5 -0
  230. package/node/components/CardGridInfinite/CardGridInfinite.js +13 -4
  231. package/node/components/CardGridInfinite/styles.js +4 -0
  232. package/node/components/CardGridInfinite/useLogic/useLogic.d.ts +1 -1
  233. package/node/components/CardGridInfinite/useLogic/useLogic.js +1 -11
  234. package/node/components/Chevron/Chevron.d.ts +1 -1
  235. package/node/components/ConfirmAction/ConfirmAction.js +2 -2
  236. package/node/components/ConfirmAction/constants.d.ts +1 -0
  237. package/node/components/ConfirmAction/constants.js +2 -1
  238. package/node/components/ConfirmAction/styles.js +13 -0
  239. package/node/components/ConfirmAction/types.d.ts +1 -1
  240. package/node/components/DataGrid/Body/Body.d.ts +1 -1
  241. package/node/components/DataGrid/Body/Body.js +5 -3
  242. package/node/components/DataGrid/Body/types.d.ts +5 -0
  243. package/node/components/DataGrid/Cell/Cell.d.ts +9 -1
  244. package/node/components/DataGrid/Cell/Cell.js +16 -2
  245. package/node/components/DataGrid/CustomRowWrapper/CustomRowWrapper.d.ts +19 -0
  246. package/node/components/DataGrid/CustomRowWrapper/CustomRowWrapper.js +18 -0
  247. package/node/components/DataGrid/CustomRowWrapper/index.d.ts +1 -0
  248. package/node/components/DataGrid/CustomRowWrapper/index.js +5 -0
  249. package/node/components/DataGrid/DataGrid.js +27 -16
  250. package/node/components/DataGrid/DataGridContext/DataGridContext.d.ts +9 -5
  251. package/node/components/DataGrid/DataGridContext/DataGridContext.js +7 -4
  252. package/node/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +3 -4
  253. package/node/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.js +17 -47
  254. package/node/components/DataGrid/DataGridStorageContext/DataGridStorageContext.d.ts +29 -0
  255. package/node/components/DataGrid/DataGridStorageContext/DataGridStorageContext.js +31 -0
  256. package/node/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/DataGridStorageProvider.d.ts +6 -0
  257. package/node/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/DataGridStorageProvider.js +16 -0
  258. package/node/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/index.d.ts +1 -0
  259. package/node/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/index.js +17 -0
  260. package/node/components/DataGrid/DataGridStorageContext/index.d.ts +2 -0
  261. package/node/components/DataGrid/DataGridStorageContext/index.js +18 -0
  262. package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +2 -1
  263. package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.js +21 -3
  264. package/node/components/DataGrid/MobileSkeleton/styles.js +12 -0
  265. package/node/components/DataGrid/Row/NestedChildren/NestedChildren.d.ts +1 -5
  266. package/node/components/DataGrid/Row/NestedChildren/NestedChildren.js +18 -7
  267. package/node/components/DataGrid/Row/NestedChildren/constants.d.ts +6 -0
  268. package/node/components/DataGrid/Row/NestedChildren/constants.js +10 -0
  269. package/node/components/DataGrid/Row/NestedChildren/styles.js +41 -2
  270. package/node/components/DataGrid/Row/NestedChildren/useLogic/useLogic.d.ts +1 -1
  271. package/node/components/DataGrid/Row/NestedChildren/useLogic/useLogic.js +3 -5
  272. package/node/components/DataGrid/Row/Row.js +33 -36
  273. package/node/components/DataGrid/Row/RowContext/RowContext.d.ts +10 -1
  274. package/node/components/DataGrid/Row/RowContext/RowContext.js +9 -0
  275. package/node/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +3 -2
  276. package/node/components/DataGrid/Row/RowContext/RowProvider/RowProvider.js +25 -2
  277. package/node/components/DataGrid/Row/constants.d.ts +6 -0
  278. package/node/components/DataGrid/Row/constants.js +6 -0
  279. package/node/components/DataGrid/Row/styles.js +99 -0
  280. package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +1 -0
  281. package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +1 -1
  282. package/node/components/DataGrid/Row/useLogic/useLogic.d.ts +5 -2
  283. package/node/components/DataGrid/Row/useLogic/useLogic.js +20 -18
  284. package/node/components/DataGrid/RowBase/GroupCell/GroupCell.d.ts +2 -0
  285. package/node/components/DataGrid/RowBase/GroupCell/GroupCell.js +26 -0
  286. package/node/components/DataGrid/RowBase/GroupCell/constants.d.ts +4 -0
  287. package/node/components/DataGrid/RowBase/GroupCell/constants.js +8 -0
  288. package/node/components/DataGrid/RowBase/GroupCell/index.d.ts +1 -0
  289. package/node/components/DataGrid/RowBase/GroupCell/index.js +5 -0
  290. package/node/components/DataGrid/RowBase/GroupCell/styles.d.ts +12 -0
  291. package/node/components/DataGrid/RowBase/GroupCell/styles.js +19 -0
  292. package/node/components/DataGrid/RowBase/GroupCell/types.d.ts +11 -0
  293. package/node/components/DataGrid/RowBase/GroupCell/types.js +2 -0
  294. package/node/components/DataGrid/RowBase/RowBase.d.ts +3 -0
  295. package/node/components/DataGrid/RowBase/RowBase.js +72 -0
  296. package/node/components/DataGrid/RowBase/constants.d.ts +9 -0
  297. package/node/components/DataGrid/RowBase/constants.js +13 -0
  298. package/node/components/DataGrid/RowBase/index.d.ts +3 -0
  299. package/node/components/DataGrid/RowBase/index.js +7 -0
  300. package/node/components/DataGrid/RowBase/styles.d.ts +17 -0
  301. package/node/components/DataGrid/RowBase/styles.js +90 -0
  302. package/node/components/DataGrid/RowBase/types.d.ts +92 -0
  303. package/node/components/DataGrid/RowBase/types.js +2 -0
  304. package/node/components/DataGrid/RowBase/useLogic/index.d.ts +1 -0
  305. package/node/components/DataGrid/RowBase/useLogic/useLogic.d.ts +46 -0
  306. package/node/components/DataGrid/RowBase/useLogic/useLogic.js +94 -0
  307. package/node/components/DataGrid/constants.d.ts +8 -0
  308. package/node/components/DataGrid/constants.js +9 -1
  309. package/node/components/DataGrid/index.d.ts +3 -0
  310. package/node/components/DataGrid/index.js +7 -1
  311. package/node/components/DataGrid/styles.js +40 -26
  312. package/node/components/DataGrid/tests/performance/testDataGridPerformance.d.ts +21 -0
  313. package/node/components/DataGrid/tests/performance/testDataGridPerformance.js +106 -0
  314. package/node/components/DataGrid/types.d.ts +11 -0
  315. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +3 -1
  316. package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +2 -1
  317. package/node/components/DataGrid/useLogic/useLogic.d.ts +4 -1
  318. package/node/components/DataGrid/useLogic/useLogic.js +19 -6
  319. package/node/components/DataGridActionCell/DataGridMainActions/Action/MainIconButton/MainIconButton.js +4 -2
  320. package/node/components/DataGridActionCell/DataGridMainActions/Action/MobileMainButton/MobileMainButton.js +4 -2
  321. package/node/components/DataGridActionCell/types.d.ts +4 -0
  322. package/node/components/DataGridCollapsibleRow/DataGridCollapsibleRow.d.ts +2 -0
  323. package/node/components/DataGridCollapsibleRow/DataGridCollapsibleRow.js +33 -0
  324. package/node/components/DataGridCollapsibleRow/constants.d.ts +11 -0
  325. package/node/components/DataGridCollapsibleRow/constants.js +15 -0
  326. package/node/components/DataGridCollapsibleRow/index.d.ts +2 -0
  327. package/node/components/DataGridCollapsibleRow/index.js +5 -0
  328. package/node/components/DataGridCollapsibleRow/public.d.ts +2 -0
  329. package/node/components/DataGridCollapsibleRow/public.js +5 -0
  330. package/node/components/DataGridCollapsibleRow/styles.d.ts +42 -0
  331. package/node/components/DataGridCollapsibleRow/styles.js +102 -0
  332. package/node/components/DataGridCollapsibleRow/types.d.ts +19 -0
  333. package/node/components/DataGridCollapsibleRow/types.js +2 -0
  334. package/node/components/DataGridCollapsibleRow/useLogic/index.d.ts +1 -0
  335. package/node/components/DataGridCollapsibleRow/useLogic/index.js +17 -0
  336. package/node/components/DataGridCollapsibleRow/useLogic/useLogic.d.ts +29 -0
  337. package/node/components/DataGridCollapsibleRow/useLogic/useLogic.js +66 -0
  338. package/node/components/DataGridInfinite/DataGridInfinite.js +45 -35
  339. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.d.ts +23 -0
  340. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.js +24 -0
  341. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/DataGridInfiniteContextProvider.d.ts +7 -0
  342. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/DataGridInfiniteContextProvider.js +9 -0
  343. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/index.d.ts +1 -0
  344. package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/index.js +17 -0
  345. package/node/components/DataGridInfinite/DataGridInfiniteContext/index.d.ts +2 -0
  346. package/node/components/DataGridInfinite/DataGridInfiniteContext/index.js +18 -0
  347. package/node/components/DataGridInfinite/List/List.js +2 -1
  348. package/node/components/DataGridInfinite/List/constants.d.ts +3 -0
  349. package/node/components/DataGridInfinite/List/constants.js +7 -0
  350. package/node/components/DataGridInfinite/List/index.d.ts +1 -0
  351. package/node/components/DataGridInfinite/List/index.js +3 -0
  352. package/node/components/DataGridInfinite/Row/Row.d.ts +2 -0
  353. package/node/components/DataGridInfinite/Row/Row.js +14 -0
  354. package/node/components/DataGridInfinite/Row/index.d.ts +1 -0
  355. package/node/components/DataGridInfinite/Row/index.js +17 -0
  356. package/node/components/DataGridInfinite/Row/types.d.ts +2 -0
  357. package/node/components/DataGridInfinite/Row/types.js +2 -0
  358. package/node/components/DataGridInfinite/Row/useLogic/index.d.ts +1 -0
  359. package/node/components/DataGridInfinite/Row/useLogic/index.js +17 -0
  360. package/node/components/DataGridInfinite/Row/useLogic/useLogic.d.ts +33 -0
  361. package/node/components/DataGridInfinite/Row/useLogic/useLogic.js +39 -0
  362. package/node/components/DataGridInfinite/faker.js +1 -1
  363. package/node/components/DataGridInfinite/styles.d.ts +6 -0
  364. package/node/components/DataGridInfinite/styles.js +12 -1
  365. package/node/components/DataGridInfinite/useLogic/useLogic.d.ts +6 -3
  366. package/node/components/DataGridInfinite/useLogic/useLogic.js +33 -14
  367. package/node/components/DialogActions/styles.js +2 -0
  368. package/node/components/DonutChart/DonutChart.d.ts +2 -0
  369. package/node/components/DonutChart/DonutChart.js +13 -0
  370. package/node/components/DonutChart/constants.d.ts +15 -0
  371. package/node/components/DonutChart/constants.js +19 -0
  372. package/node/components/DonutChart/index.d.ts +3 -0
  373. package/node/components/DonutChart/index.js +7 -0
  374. package/node/components/DonutChart/public.d.ts +3 -0
  375. package/node/components/DonutChart/public.js +7 -0
  376. package/node/components/DonutChart/styles.d.ts +21 -0
  377. package/node/components/DonutChart/styles.js +44 -0
  378. package/node/components/DonutChart/types.d.ts +27 -0
  379. package/node/components/DonutChart/types.js +2 -0
  380. package/node/components/DonutChart/useLogic/hooks/index.d.ts +1 -0
  381. package/node/components/DonutChart/useLogic/hooks/index.js +17 -0
  382. package/node/components/DonutChart/useLogic/hooks/useRenderWidth/index.d.ts +1 -0
  383. package/node/components/DonutChart/useLogic/hooks/useRenderWidth/index.js +17 -0
  384. package/node/components/DonutChart/useLogic/hooks/useRenderWidth/useRenderWidth.d.ts +9 -0
  385. package/node/components/DonutChart/useLogic/hooks/useRenderWidth/useRenderWidth.js +34 -0
  386. package/node/components/DonutChart/useLogic/index.d.ts +1 -0
  387. package/node/components/DonutChart/useLogic/index.js +17 -0
  388. package/node/components/DonutChart/useLogic/useLogic.d.ts +15 -0
  389. package/node/components/DonutChart/useLogic/useLogic.js +44 -0
  390. package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.d.ts +16 -0
  391. package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.js +14 -0
  392. package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/index.d.ts +1 -0
  393. package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/index.js +5 -0
  394. package/node/components/DonutChart/useLogic/utils/getGeometry/getGeometry.d.ts +10 -0
  395. package/node/components/DonutChart/useLogic/utils/getGeometry/getGeometry.js +17 -0
  396. package/node/components/DonutChart/useLogic/utils/getGeometry/index.d.ts +1 -0
  397. package/node/components/DonutChart/useLogic/utils/getGeometry/index.js +5 -0
  398. package/node/components/DonutChart/useLogic/utils/getMeterAriaValue/getMeterAriaValue.d.ts +13 -0
  399. package/node/components/DonutChart/useLogic/utils/getMeterAriaValue/getMeterAriaValue.js +26 -0
  400. package/node/components/DonutChart/useLogic/utils/getMeterAriaValue/index.d.ts +1 -0
  401. package/node/components/DonutChart/useLogic/utils/getMeterAriaValue/index.js +5 -0
  402. package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.d.ts +9 -0
  403. package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.js +33 -0
  404. package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/index.d.ts +1 -0
  405. package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/index.js +5 -0
  406. package/node/components/DonutChart/useLogic/utils/getProgressOffset/getProgressOffset.d.ts +8 -0
  407. package/node/components/DonutChart/useLogic/utils/getProgressOffset/getProgressOffset.js +25 -0
  408. package/node/components/DonutChart/useLogic/utils/getProgressOffset/index.d.ts +1 -0
  409. package/node/components/DonutChart/useLogic/utils/getProgressOffset/index.js +5 -0
  410. package/node/components/DonutChart/useLogic/utils/getProgressPercent/getProgressPercent.d.ts +8 -0
  411. package/node/components/DonutChart/useLogic/utils/getProgressPercent/getProgressPercent.js +20 -0
  412. package/node/components/DonutChart/useLogic/utils/getProgressPercent/index.d.ts +1 -0
  413. package/node/components/DonutChart/useLogic/utils/getProgressPercent/index.js +5 -0
  414. package/node/components/DonutChart/useLogic/utils/index.d.ts +6 -0
  415. package/node/components/DonutChart/useLogic/utils/index.js +15 -0
  416. package/node/components/ExpansionPanel/Summary/styles.d.ts +1 -1
  417. package/node/components/MenuOrganization/OrganizationButton/styles.d.ts +1 -1
  418. package/node/components/NewStepper/StepIcon/StepIcon.js +3 -1
  419. package/node/components/NewStepper/StepIcon/useLogic/index.d.ts +1 -0
  420. package/node/components/NewStepper/StepIcon/useLogic/index.js +17 -0
  421. package/node/components/NewStepper/StepIcon/useLogic/useLogic.d.ts +8 -0
  422. package/node/components/NewStepper/StepIcon/useLogic/useLogic.js +10 -0
  423. package/node/components/PageContent/PageContent.js +22 -4
  424. package/node/components/PageContent/constants.d.ts +2 -0
  425. package/node/components/PageContent/constants.js +2 -0
  426. package/node/components/PageContent/styles.d.ts +0 -2
  427. package/node/components/PageContent/styles.js +17 -11
  428. package/node/components/PageContent/types.d.ts +4 -0
  429. package/node/components/Profile/styles.d.ts +1 -1
  430. package/node/components/constants/classnames.d.ts +1 -0
  431. package/node/components/constants/classnames.js +5 -0
  432. package/node/components/constants/index.d.ts +1 -0
  433. package/node/components/constants/index.js +1 -0
  434. package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.d.ts +2 -1
  435. package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.js +4 -1
  436. package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/useLogic/useLogic.d.ts +5 -4
  437. package/node/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/HintPlaceholder.js +10 -1
  438. package/node/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/useLogic/useLogic.d.ts +5 -5
  439. package/node/components/fileUploading/hooks/useFileUploader/useFileUploader.d.ts +1 -1
  440. package/node/components/fileUploading/hooks/usePreviewFileUploader/usePreviewFileUploader.d.ts +1 -1
  441. package/node/components/fileUploading/types.d.ts +2 -2
  442. package/node/components/useProfiler/index.d.ts +1 -0
  443. package/node/components/useProfiler/index.js +5 -0
  444. package/node/components/useProfiler/useProfiler.d.ts +14 -0
  445. package/node/components/useProfiler/useProfiler.js +50 -0
  446. package/node/components/useProfiler/utils/index.d.ts +1 -0
  447. package/node/components/useProfiler/utils/index.js +17 -0
  448. package/node/components/useProfiler/utils/shallowEqual/index.d.ts +1 -0
  449. package/node/components/useProfiler/utils/shallowEqual/index.js +6 -0
  450. package/node/components/useProfiler/utils/shallowEqual/shallowEqual.d.ts +5 -0
  451. package/node/components/useProfiler/utils/shallowEqual/shallowEqual.js +31 -0
  452. package/node/hook-form/FormFilters/FormFilters.js +1 -1
  453. package/node/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.d.ts +5 -1
  454. package/node/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.js +3 -2
  455. package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/FormQuickFiltersSkeleton.d.ts +1 -0
  456. package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/FormQuickFiltersSkeleton.js +13 -0
  457. package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/index.d.ts +1 -0
  458. package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/index.js +17 -0
  459. package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/styles.d.ts +5 -0
  460. package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/styles.js +8 -0
  461. package/package.json +1 -1
  462. package/components/PageContent/useLogic/useLogic.d.ts +0 -7
  463. package/components/PageContent/useLogic/useLogic.js +0 -11
  464. package/node/components/PageContent/useLogic/useLogic.d.ts +0 -7
  465. package/node/components/PageContent/useLogic/useLogic.js +0 -15
  466. /package/components/{PageContent → DataGrid/RowBase}/useLogic/index.d.ts +0 -0
  467. /package/components/{PageContent → DataGrid/RowBase}/useLogic/index.js +0 -0
  468. /package/{node/components/PageContent → components/DataGridCollapsibleRow}/useLogic/index.d.ts +0 -0
  469. /package/node/components/{PageContent → DataGrid/RowBase}/useLogic/index.js +0 -0
@@ -1,4 +1,5 @@
1
- import { useCallback, useMemo, useRef, useState, } from 'react';
1
+ import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
2
+ import { EXPANDED_LEVEL_BY_DEFAULT, INITIAL_OPENED_NESTED_CHILDREN_COUNT_ON_MOBILE_BY_DEFAULT, } from '../../DataGrid/constants';
2
3
  import { Variant } from '../../DataGrid/enums';
3
4
  import { useDataGridMobileLogic } from '../../DataGrid/useLogic/hooks';
4
5
  import { getDataGridCssVars, getFlattenColumns, getGridTemplateColumns, isGroupColumns, } from '../../DataGrid/utils';
@@ -6,17 +7,32 @@ import { useViewportType } from '../../useViewportType';
6
7
  import { prop } from '../../utils/prop';
7
8
  import { uniqueBy } from '../../utils/uniqueBy';
8
9
  import { dataGridInfiniteClassnames, VIRTUOSO_CONTAINER_ID, VIRTUOSO_LIST_ID, } from '../constants';
9
- export const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows = [], maxHeight, isLoading, isDisabled, isEndReached, onEndReached, onSelectRow, isHideSelectAll, isHideHeaderIfNoData = false, gridViewMode: gridViewModeProp = 'standard', }) => {
10
+ export const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows = [], maxHeight, isLoading, isDisabled, isEndReached, onEndReached, onSelectRow, isHideSelectAll, isHideHeaderIfNoData = false, gridViewMode: gridViewModeProp = 'standard', mobileDisplayVariant = variant === 'subrows' ? 'cards' : 'list', }) => {
10
11
  const virtuoso = useRef(null);
11
12
  const scrollToTopButtonRef = useRef(null);
12
13
  const { isMobile } = useViewportType();
14
+ // Реф добавлен для избежания замыкания selectedRows в handleSelectRow (иначе в handleSelectRow приходят некорректные значения selectedRows).
15
+ const selectedRowsRef = useRef(selectedRows);
16
+ useEffect(() => {
17
+ selectedRowsRef.current = selectedRows;
18
+ }, [selectedRows]);
13
19
  const [hasVerticalScroll, setHasVerticalScroll] = useState(false);
14
20
  const isNoData = Boolean(rows?.length);
15
21
  const isSelectable = Boolean(onSelectRow);
16
22
  const isDataGridDisabled = isDisabled || (!isNoData && isLoading);
17
- const treeRenderConfig = Object.is(variant, Variant.Subrows)
18
- ? { ...subrows, isInitialExpanded: true }
19
- : tree;
23
+ const treeRenderConfig = useMemo(() => {
24
+ const config = Object.is(variant, Variant.Subrows)
25
+ ? { ...subrows, isInitialExpanded: true }
26
+ : tree;
27
+ if (isMobile) {
28
+ return {
29
+ ...config,
30
+ expandedLevel: EXPANDED_LEVEL_BY_DEFAULT,
31
+ initialVisibleChildrenCount: INITIAL_OPENED_NESTED_CHILDREN_COUNT_ON_MOBILE_BY_DEFAULT,
32
+ };
33
+ }
34
+ return config;
35
+ }, [variant, subrows, tree, isMobile]);
20
36
  const availableRows = rows.filter((row) => !(row.options?.isDisabled || row.options?.isNotSelectable));
21
37
  const flattenColumns = useMemo(() => getFlattenColumns(columns), [columns]);
22
38
  const hasGroupedColumns = columns.some(isGroupColumns);
@@ -51,10 +67,10 @@ export const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selecte
51
67
  return;
52
68
  }
53
69
  if (event.target.checked) {
54
- return onSelectRow([...selectedRows, row]);
70
+ return onSelectRow([...selectedRowsRef.current, row]);
55
71
  }
56
- onSelectRow(selectedRows.filter((selectedRow) => selectedRow[keyId] !== row[keyId]));
57
- }, [selectedRows, onSelectRow, keyId]);
72
+ onSelectRow(selectedRowsRef.current.filter((selectedRow) => selectedRow[keyId] !== row[keyId]));
73
+ }, []);
58
74
  const handleScrollToTop = () => {
59
75
  virtuoso.current?.scrollIntoView({ index: 0, behavior: 'smooth' });
60
76
  };
@@ -68,12 +84,12 @@ export const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selecte
68
84
  const isHideHead = isHideHeaderIfNoData && rows.length === 0;
69
85
  const { mobileSkeletonProps } = useDataGridMobileLogic({
70
86
  columns: flattenColumns,
87
+ mobileDisplayVariant,
71
88
  });
72
89
  const containerCssVars = getDataGridCssVars(maxHeight);
73
90
  return {
74
91
  containerCssVars,
75
92
  mobileSkeletonProps,
76
- flattenColumns,
77
93
  isNoData,
78
94
  isMobile,
79
95
  isDataGridDisabled,
@@ -82,6 +98,7 @@ export const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selecte
82
98
  isHideHead,
83
99
  hasGroupedColumns,
84
100
  gridViewMode,
101
+ gridColumns,
85
102
  virtuosoProps: {
86
103
  id: VIRTUOSO_CONTAINER_ID,
87
104
  ref: virtuoso,
@@ -100,11 +117,13 @@ export const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selecte
100
117
  rowProps: {
101
118
  isSelectable,
102
119
  gridColumns,
103
- onSelectRow: handleSelectRow,
104
120
  },
105
121
  scrollToTopButtonProps: {
106
122
  onClick: handleScrollToTop,
107
123
  ref: scrollToTopButtonRef,
108
124
  },
125
+ handleSelectRow,
126
+ mobileDisplayVariant,
127
+ isSelfContained: mobileDisplayVariant === 'cards',
109
128
  };
110
129
  };
@@ -2,6 +2,8 @@ import DialogActions from '@mui/material/DialogActions';
2
2
  import { Grid } from '../Grid';
3
3
  import { styled } from '../styled';
4
4
  export const StyledDialogActions = styled(DialogActions) `
5
+ z-index: ${({ theme }) => theme.zIndex.modal};
6
+
5
7
  padding-top: ${({ theme }) => theme.spacing(6)};
6
8
 
7
9
  ${({ theme }) => theme.breakpoints.down('sm')} {
@@ -0,0 +1,2 @@
1
+ import type { DonutChartProps } from './types';
2
+ export declare const DonutChart: ({ value, maxValue, children, color, colorIntensity, className, style, }: DonutChartProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { classNames } from '../utils/classNames';
3
+ import { donutChartClassnames } from './constants';
4
+ import { Content, ProgressArc, Svg, TrackArc, Wrapper } from './styles';
5
+ import { useLogic } from './useLogic';
6
+ export const DonutChart = ({ value, maxValue, children, color = 'primary', colorIntensity = '700', className, style, }) => {
7
+ const { rootRef, svgViewBox, arcCx, arcCy, donutParams, meterAriaValue } = useLogic({ value, maxValue, color, colorIntensity });
8
+ return (_jsxs(Wrapper, { ref: rootRef, className: classNames(donutChartClassnames.root, className), role: "meter", "aria-label": meterAriaValue.label, "aria-valuemin": meterAriaValue.min, "aria-valuemax": meterAriaValue.max, "aria-valuenow": meterAriaValue.now, style: { ...donutParams?.cssVars, ...style }, children: [donutParams && (_jsxs(Svg, { className: donutChartClassnames.svg, viewBox: svgViewBox, "aria-hidden": true, children: [_jsx(TrackArc, { className: donutChartClassnames.track, cx: arcCx, cy: arcCy, r: donutParams.arcR }), _jsx(ProgressArc, { className: donutChartClassnames.progress, d: donutParams.arcPath, pathLength: 1, strokeDasharray: 1, strokeDashoffset: donutParams.progressOffset })] })), children && (_jsx(Content, { className: donutChartClassnames.content, children: children }))] }));
9
+ };
@@ -0,0 +1,15 @@
1
+ /** Нормализованная система координат SVG. Масштаб — через CSS 100%. */
2
+ export declare const DONUT_CHART_VIEWBOX = 100;
3
+ /** Центр дуги в координатах viewBox (cx, cy). */
4
+ export declare const DONUT_CHART_VIEWBOX_CENTER: number;
5
+ /** Толщина обводки на экране (px), пересчитывается в единицы viewBox через getGeometry. */
6
+ export declare const DONUT_CHART_STROKE_WIDTH = 8;
7
+ /** Атрибут viewBox SVG (квадрат DONUT_CHART_VIEWBOX × DONUT_CHART_VIEWBOX). */
8
+ export declare const DONUT_CHART_SVG_VIEWBOX: "0 0 100 100";
9
+ export declare const donutChartClassnames: {
10
+ root: string;
11
+ svg: string;
12
+ track: string;
13
+ progress: string;
14
+ content: string;
15
+ };
@@ -0,0 +1,16 @@
1
+ import { createUIKitClassname } from '../utils/createUIKitClassname';
2
+ /** Нормализованная система координат SVG. Масштаб — через CSS 100%. */
3
+ export const DONUT_CHART_VIEWBOX = 100;
4
+ /** Центр дуги в координатах viewBox (cx, cy). */
5
+ export const DONUT_CHART_VIEWBOX_CENTER = DONUT_CHART_VIEWBOX / 2;
6
+ /** Толщина обводки на экране (px), пересчитывается в единицы viewBox через getGeometry. */
7
+ export const DONUT_CHART_STROKE_WIDTH = 8;
8
+ /** Атрибут viewBox SVG (квадрат DONUT_CHART_VIEWBOX × DONUT_CHART_VIEWBOX). */
9
+ export const DONUT_CHART_SVG_VIEWBOX = `0 0 ${DONUT_CHART_VIEWBOX} ${DONUT_CHART_VIEWBOX}`;
10
+ export const donutChartClassnames = {
11
+ root: createUIKitClassname('donut-chart'),
12
+ svg: createUIKitClassname('donut-chart__svg'),
13
+ track: createUIKitClassname('donut-chart__track'),
14
+ progress: createUIKitClassname('donut-chart__progress'),
15
+ content: createUIKitClassname('donut-chart__content'),
16
+ };
@@ -0,0 +1,3 @@
1
+ export { DonutChart } from './DonutChart';
2
+ export type { DonutChartProps } from './types';
3
+ export { donutChartClassnames } from './constants';
@@ -0,0 +1,2 @@
1
+ export { DonutChart } from './DonutChart';
2
+ export { donutChartClassnames } from './constants';
@@ -0,0 +1,3 @@
1
+ export { donutChartClassnames } from './constants';
2
+ export { DonutChart } from './DonutChart';
3
+ export type { DonutChartProps } from './types';
@@ -0,0 +1,2 @@
1
+ export { donutChartClassnames } from './constants';
2
+ export { DonutChart } from './DonutChart';
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ export declare const Wrapper: import("../styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const Svg: import("../styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
+ }, import("react").SVGProps<SVGSVGElement>, {}>;
10
+ export declare const TrackArc: import("../styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
13
+ }, import("react").SVGProps<SVGCircleElement>, {}>;
14
+ export declare const ProgressArc: import("../styled").StyledComponent<{
15
+ theme?: import("@emotion/react").Theme | undefined;
16
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
17
+ }, import("react").SVGProps<SVGPathElement>, {}>;
18
+ export declare const Content: import("../styled").StyledComponent<{
19
+ theme?: import("@emotion/react").Theme | undefined;
20
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
21
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,41 @@
1
+ import { styled } from '../styled';
2
+ export const Wrapper = styled.div `
3
+ position: relative;
4
+
5
+ aspect-ratio: 1 / 1;
6
+ width: 100%;
7
+ `;
8
+ export const Svg = styled.svg `
9
+ /* Старт дуги (точка 3 часа) переносим наверх. */
10
+ transform: rotate(-90deg);
11
+
12
+ display: block;
13
+
14
+ width: 100%;
15
+ height: 100%;
16
+ `;
17
+ export const TrackArc = styled.circle `
18
+ fill: none;
19
+ stroke: ${({ theme }) => theme.palette.grey[100]};
20
+ stroke-linecap: round;
21
+ stroke-width: var(--donut-chart-stroke-width);
22
+ `;
23
+ export const ProgressArc = styled.path `
24
+ fill: none;
25
+ stroke: var(--donut-chart-progress-color);
26
+ stroke-linecap: round;
27
+ stroke-width: var(--donut-chart-stroke-width);
28
+
29
+ transition: stroke-dashoffset
30
+ ${({ theme }) => theme.transitions.duration.standard}ms ease-in-out;
31
+ `;
32
+ export const Content = styled.div `
33
+ position: absolute;
34
+ inset: 0;
35
+
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: center;
39
+
40
+ padding: ${({ theme }) => theme.spacing(4)};
41
+ `;
@@ -0,0 +1,27 @@
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
+ export type DonutChartColor = 'primary' | 'success' | 'warning' | 'error' | 'grey' | 'red' | 'green' | 'yellow';
3
+ export type DonutChartColorIntensity = '900' | '800' | '700' | '600' | '500' | '400' | '300' | '200' | '100';
4
+ export type DonutChartProps = {
5
+ value: number;
6
+ maxValue: number;
7
+ /**
8
+ * Контент в центре. Можно передать другой `DonutChart`.
9
+ */
10
+ children?: ReactNode;
11
+ /**
12
+ * Цвет.
13
+ */
14
+ color?: DonutChartColor;
15
+ /**
16
+ * Интенсивность цвета.
17
+ */
18
+ colorIntensity?: DonutChartColorIntensity;
19
+ /**
20
+ * CSS-класс для корневого элемента.
21
+ */
22
+ className?: string;
23
+ /**
24
+ * Стили для корневого элемента.
25
+ */
26
+ style?: CSSProperties;
27
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './useRenderWidth';
@@ -0,0 +1 @@
1
+ export * from './useRenderWidth';
@@ -0,0 +1 @@
1
+ export * from './useRenderWidth';
@@ -0,0 +1 @@
1
+ export * from './useRenderWidth';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Отслеживает ширину элемента и обновляет значение при resize.
4
+ * @returns Объект с ref для присоединения к элементу и текущей шириной в пикселях
5
+ */
6
+ export declare const useRenderWidth: () => {
7
+ rootRef: import("react").RefObject<HTMLDivElement | null>;
8
+ renderWidth: number | null;
9
+ };
@@ -0,0 +1,30 @@
1
+ import { useLayoutEffect, useRef, useState } from 'react';
2
+ /**
3
+ * Отслеживает ширину элемента и обновляет значение при resize.
4
+ * @returns Объект с ref для присоединения к элементу и текущей шириной в пикселях
5
+ */
6
+ export const useRenderWidth = () => {
7
+ const rootRef = useRef(null);
8
+ const [renderWidth, setRenderWidth] = useState(null);
9
+ useLayoutEffect(() => {
10
+ const node = rootRef.current;
11
+ if (!node) {
12
+ return;
13
+ }
14
+ const initialWidth = node.getBoundingClientRect().width;
15
+ if (initialWidth > 0) {
16
+ setRenderWidth(initialWidth);
17
+ }
18
+ const resizeObserver = new ResizeObserver((entries) => {
19
+ const width = entries[0]?.contentRect.width ?? 0;
20
+ if (width > 0) {
21
+ setRenderWidth(width);
22
+ }
23
+ });
24
+ resizeObserver.observe(node);
25
+ return () => {
26
+ resizeObserver.disconnect();
27
+ };
28
+ }, []);
29
+ return { rootRef, renderWidth };
30
+ };
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import type { DonutChartProps } from '../types';
3
+ export declare const useLogic: ({ value, maxValue, color, colorIntensity, }: DonutChartProps) => {
4
+ rootRef: import("react").RefObject<HTMLDivElement | null>;
5
+ svgViewBox: "0 0 100 100";
6
+ arcCx: number;
7
+ arcCy: number;
8
+ donutParams: {
9
+ arcR: number;
10
+ arcPath: string;
11
+ progressOffset: number;
12
+ cssVars: import("react").CSSProperties;
13
+ } | null;
14
+ meterAriaValue: import("./utils/getMeterAriaValue").MeterAriaValue;
15
+ };
@@ -0,0 +1,40 @@
1
+ import { useMemo } from 'react';
2
+ import { useTheme } from '../../theme/hooks/useTheme';
3
+ import { DONUT_CHART_SVG_VIEWBOX, DONUT_CHART_VIEWBOX_CENTER, } from '../constants';
4
+ import { useRenderWidth } from './hooks';
5
+ import { getDonutChartCssVars } from './utils/getDonutChartCssVars';
6
+ import { getGeometry } from './utils/getGeometry';
7
+ import { getMeterAriaValue } from './utils/getMeterAriaValue';
8
+ import { getProgressCirclePath } from './utils/getProgressCirclePath';
9
+ import { getProgressOffset } from './utils/getProgressOffset';
10
+ import { getProgressPercent } from './utils/getProgressPercent';
11
+ export const useLogic = ({ value, maxValue, color = 'primary', colorIntensity = '700', }) => {
12
+ const theme = useTheme();
13
+ const { rootRef, renderWidth } = useRenderWidth();
14
+ const progressPercent = getProgressPercent(value, maxValue);
15
+ const meterAriaValue = getMeterAriaValue(value, maxValue);
16
+ const donutParams = useMemo(() => {
17
+ if (renderWidth === null) {
18
+ return null;
19
+ }
20
+ const { stroke, radius, roundCapPercent } = getGeometry(renderWidth);
21
+ return {
22
+ arcR: radius,
23
+ arcPath: getProgressCirclePath(DONUT_CHART_VIEWBOX_CENTER, DONUT_CHART_VIEWBOX_CENTER, radius),
24
+ progressOffset: getProgressOffset(progressPercent, roundCapPercent),
25
+ cssVars: getDonutChartCssVars(theme, {
26
+ color,
27
+ colorIntensity,
28
+ strokeWidth: stroke,
29
+ }),
30
+ };
31
+ }, [renderWidth, progressPercent, color, colorIntensity, theme]);
32
+ return {
33
+ rootRef,
34
+ svgViewBox: DONUT_CHART_SVG_VIEWBOX,
35
+ arcCx: DONUT_CHART_VIEWBOX_CENTER,
36
+ arcCy: DONUT_CHART_VIEWBOX_CENTER,
37
+ donutParams,
38
+ meterAriaValue,
39
+ };
40
+ };
@@ -0,0 +1,16 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { Theme } from '../../../../theme/types';
3
+ import type { DonutChartColor, DonutChartColorIntensity } from '../../../types';
4
+ type GetDonutChartCssVarsParams = {
5
+ color: DonutChartColor;
6
+ colorIntensity: DonutChartColorIntensity;
7
+ strokeWidth: number;
8
+ };
9
+ /**
10
+ * Генерирует CSS переменные для стилизации DonutChart по теме и цвету.
11
+ * @param theme - Объект темы с палитрой цветов
12
+ * @param params - Параметры цвета, интенсивности и ширины stroke
13
+ * @returns CSS свойства для диаграммы
14
+ */
15
+ export declare const getDonutChartCssVars: (theme: Theme, { color, colorIntensity, strokeWidth }: GetDonutChartCssVarsParams) => CSSProperties;
16
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Генерирует CSS переменные для стилизации DonutChart по теме и цвету.
3
+ * @param theme - Объект темы с палитрой цветов
4
+ * @param params - Параметры цвета, интенсивности и ширины stroke
5
+ * @returns CSS свойства для диаграммы
6
+ */
7
+ export const getDonutChartCssVars = (theme, { color, colorIntensity, strokeWidth }) => ({
8
+ '--donut-chart-stroke-width': String(strokeWidth),
9
+ '--donut-chart-progress-color': theme.palette[color][colorIntensity],
10
+ });
@@ -0,0 +1 @@
1
+ export { getDonutChartCssVars } from './getDonutChartCssVars';
@@ -0,0 +1 @@
1
+ export { getDonutChartCssVars } from './getDonutChartCssVars';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Вычисляет геометрию дуги в координатах viewBox по ширине контейнера.
3
+ * @param renderWidth - Ширина контейнера в пикселях
4
+ * @returns Геометрия дуги со stroke, радиусом и процентом round cap для расчетов
5
+ */
6
+ export declare const getGeometry: (renderWidth: number) => {
7
+ stroke: number;
8
+ radius: number;
9
+ roundCapPercent: number;
10
+ };
@@ -0,0 +1,13 @@
1
+ import { DONUT_CHART_STROKE_WIDTH, DONUT_CHART_VIEWBOX, DONUT_CHART_VIEWBOX_CENTER, } from '../../../constants';
2
+ /**
3
+ * Вычисляет геометрию дуги в координатах viewBox по ширине контейнера.
4
+ * @param renderWidth - Ширина контейнера в пикселях
5
+ * @returns Геометрия дуги со stroke, радиусом и процентом round cap для расчетов
6
+ */
7
+ export const getGeometry = (renderWidth) => {
8
+ const stroke = (DONUT_CHART_STROKE_WIDTH * DONUT_CHART_VIEWBOX) / renderWidth;
9
+ const radius = DONUT_CHART_VIEWBOX_CENTER - stroke / 2;
10
+ const circumference = 2 * Math.PI * radius;
11
+ const roundCapPercent = (stroke / circumference) * 100;
12
+ return { stroke, radius, roundCapPercent };
13
+ };
@@ -0,0 +1 @@
1
+ export { getGeometry } from './getGeometry';
@@ -0,0 +1 @@
1
+ export { getGeometry } from './getGeometry';
@@ -0,0 +1,13 @@
1
+ export type MeterAriaValue = {
2
+ min: number;
3
+ max: number;
4
+ now: number;
5
+ label: string;
6
+ };
7
+ /**
8
+ * Нормализует value/maxValue для ARIA role="meter" с проверкой границ.
9
+ * @param value - Текущее значение
10
+ * @param maxValue - Максимальное значение (должно быть положительным и конечным)
11
+ * @returns ARIA атрибуты с свойствами min, max, now для role="meter"
12
+ */
13
+ export declare const getMeterAriaValue: (value: number, maxValue: number) => MeterAriaValue;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Нормализует value/maxValue для ARIA role="meter" с проверкой границ.
3
+ * @param value - Текущее значение
4
+ * @param maxValue - Максимальное значение (должно быть положительным и конечным)
5
+ * @returns ARIA атрибуты с свойствами min, max, now для role="meter"
6
+ */
7
+ export const getMeterAriaValue = (value, maxValue) => {
8
+ const min = 0;
9
+ if (!Number.isFinite(maxValue) || maxValue <= 0) {
10
+ return { min, max: 1, now: 0, label: '0 / 1' };
11
+ }
12
+ if (!Number.isFinite(value)) {
13
+ return { min, max: maxValue, now: 0, label: `0 / ${maxValue}` };
14
+ }
15
+ const now = Math.max(min, Math.min(maxValue, value));
16
+ return {
17
+ min,
18
+ max: maxValue,
19
+ now,
20
+ label: `${now} / ${maxValue}`,
21
+ };
22
+ };
@@ -0,0 +1 @@
1
+ export { getMeterAriaValue, type MeterAriaValue } from './getMeterAriaValue';
@@ -0,0 +1 @@
1
+ export { getMeterAriaValue } from './getMeterAriaValue';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Строит `d` полного круга из двух полудуг.
3
+ * Без `Z` — открытый путь без шва, поэтому нет 1px-артефакта на стыке.
4
+ * @param cx - Центр по X
5
+ * @param cy - Центр по Y
6
+ * @param r - Радиус
7
+ * @returns Значение атрибута `d`
8
+ */
9
+ export declare const getProgressCirclePath: (cx: number, cy: number, r: number) => string;
@@ -0,0 +1,29 @@
1
+ /** Точка на окружности по углу (0° — 3 часа, далее по часовой: y растёт вниз). */
2
+ const polarToCartesian = (cx, cy, r, angleDeg) => {
3
+ const angleRad = (angleDeg * Math.PI) / 180;
4
+ return {
5
+ x: cx + r * Math.cos(angleRad),
6
+ y: cy + r * Math.sin(angleRad),
7
+ };
8
+ };
9
+ /**
10
+ * Строит `d` полного круга из двух полудуг.
11
+ * Без `Z` — открытый путь без шва, поэтому нет 1px-артефакта на стыке.
12
+ * @param cx - Центр по X
13
+ * @param cy - Центр по Y
14
+ * @param r - Радиус
15
+ * @returns Значение атрибута `d`
16
+ */
17
+ export const getProgressCirclePath = (cx, cy, r) => {
18
+ const start = polarToCartesian(cx, cy, r, 0);
19
+ const half = polarToCartesian(cx, cy, r, 180);
20
+ // Округляем координаты.
21
+ const f = (n) => Number(n.toFixed(3));
22
+ // Две полудуги (0°→180°→360°). Конец совпадает со стартом, но без `Z` —
23
+ // путь остаётся открытым, поэтому шва-стыка (источник 1px) не возникает.
24
+ return [
25
+ `M ${f(start.x)} ${f(start.y)}`,
26
+ `A ${f(r)} ${f(r)} 0 0 1 ${f(half.x)} ${f(half.y)}`,
27
+ `A ${f(r)} ${f(r)} 0 0 1 ${f(start.x)} ${f(start.y)}`,
28
+ ].join(' ');
29
+ };
@@ -0,0 +1 @@
1
+ export { getProgressCirclePath } from './getProgressCirclePath';
@@ -0,0 +1 @@
1
+ export { getProgressCirclePath } from './getProgressCirclePath';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Вычисляет stroke-dashoffset для SVG дуги с компенсацией round linecap.
3
+ * Выше 90% слегка уменьшает дисплей-процент, чтобы кэп не переливал за 100%.
4
+ * @param percent - Процент прогресса (0–100)
5
+ * @param roundCapPercent - Визуальная ширина round cap в процентах от окружности
6
+ * @returns Значение offset от 0 (полностью видно) до 1 (скрыто)
7
+ */
8
+ export declare const getProgressOffset: (percent: number, roundCapPercent: number) => number;
@@ -0,0 +1,21 @@
1
+ /** С какого процента начинаем компенсировать round linecap у конца дуги */
2
+ const ROUND_CAP_RAMP_START = 90;
3
+ /**
4
+ * Вычисляет stroke-dashoffset для SVG дуги с компенсацией round linecap.
5
+ * Выше 90% слегка уменьшает дисплей-процент, чтобы кэп не переливал за 100%.
6
+ * @param percent - Процент прогресса (0–100)
7
+ * @param roundCapPercent - Визуальная ширина round cap в процентах от окружности
8
+ * @returns Значение offset от 0 (полностью видно) до 1 (скрыто)
9
+ */
10
+ export const getProgressOffset = (percent, roundCapPercent) => {
11
+ if (percent >= 100) {
12
+ return 0;
13
+ }
14
+ if (percent <= 0) {
15
+ return 1;
16
+ }
17
+ const roundCapRampProgress = Math.max(0, (percent - ROUND_CAP_RAMP_START) / (100 - ROUND_CAP_RAMP_START));
18
+ const displayPercent = percent - roundCapPercent * roundCapRampProgress;
19
+ const offset = 1 - displayPercent / 100;
20
+ return Math.round(offset * 1000) / 1000;
21
+ };
@@ -0,0 +1 @@
1
+ export { getProgressOffset } from './getProgressOffset';
@@ -0,0 +1 @@
1
+ export { getProgressOffset } from './getProgressOffset';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Преобразует value/maxValue в целый процент 0–100.
3
+ * Дробная часть отбрасывается вниз, некорректные значения дают 0.
4
+ * @param value - Текущее значение
5
+ * @param maxValue - Максимальное значение (должно быть положительным и конечным)
6
+ * @returns Целый процент от 0 до 100
7
+ */
8
+ export declare const getProgressPercent: (value: number, maxValue: number) => number;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Преобразует value/maxValue в целый процент 0–100.
3
+ * Дробная часть отбрасывается вниз, некорректные значения дают 0.
4
+ * @param value - Текущее значение
5
+ * @param maxValue - Максимальное значение (должно быть положительным и конечным)
6
+ * @returns Целый процент от 0 до 100
7
+ */
8
+ export const getProgressPercent = (value, maxValue) => {
9
+ if (!Number.isFinite(maxValue) || maxValue <= 0) {
10
+ return 0;
11
+ }
12
+ if (!Number.isFinite(value)) {
13
+ return 0;
14
+ }
15
+ return Math.max(0, Math.min(100, Math.floor((value / maxValue) * 100)));
16
+ };
@@ -0,0 +1 @@
1
+ export { getProgressPercent } from './getProgressPercent';
@@ -0,0 +1 @@
1
+ export { getProgressPercent } from './getProgressPercent';