@astral/ui 4.13.0 → 4.14.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 (327) hide show
  1. package/components/CardGridInfinite/Card/Card.d.ts +3 -0
  2. package/components/CardGridInfinite/Card/Card.js +12 -0
  3. package/components/CardGridInfinite/Card/CardActionContext/CardActionContext.d.ts +10 -0
  4. package/components/CardGridInfinite/Card/CardActionContext/CardActionContext.js +8 -0
  5. package/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/CardActionContextProvider.d.ts +9 -0
  6. package/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/CardActionContextProvider.js +26 -0
  7. package/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/index.d.ts +1 -0
  8. package/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/index.js +1 -0
  9. package/components/CardGridInfinite/Card/CardActionContext/index.d.ts +2 -0
  10. package/components/CardGridInfinite/Card/CardActionContext/index.js +2 -0
  11. package/components/CardGridInfinite/Card/SecondaryActionButton/SecondaryActionButton.d.ts +7 -0
  12. package/components/CardGridInfinite/Card/SecondaryActionButton/SecondaryActionButton.js +21 -0
  13. package/components/CardGridInfinite/Card/SecondaryActionButton/index.d.ts +1 -0
  14. package/components/CardGridInfinite/Card/SecondaryActionButton/index.js +1 -0
  15. package/components/CardGridInfinite/Card/SecondaryActionButton/styles.d.ts +12 -0
  16. package/components/CardGridInfinite/Card/SecondaryActionButton/styles.js +5 -0
  17. package/components/CardGridInfinite/Card/index.d.ts +3 -0
  18. package/components/CardGridInfinite/Card/index.js +2 -0
  19. package/components/CardGridInfinite/Card/styles.d.ts +16 -0
  20. package/components/CardGridInfinite/Card/styles.js +22 -0
  21. package/components/CardGridInfinite/Card/types.d.ts +32 -0
  22. package/components/CardGridInfinite/Card/types.js +1 -0
  23. package/components/CardGridInfinite/Card/useLogic/index.d.ts +1 -0
  24. package/components/CardGridInfinite/Card/useLogic/index.js +1 -0
  25. package/components/CardGridInfinite/Card/useLogic/useLogic.d.ts +7 -0
  26. package/components/CardGridInfinite/Card/useLogic/useLogic.js +7 -0
  27. package/components/CardGridInfinite/CardGridInfinite.d.ts +3 -0
  28. package/components/CardGridInfinite/CardGridInfinite.js +21 -0
  29. package/components/CardGridInfinite/CardGridMainActions/Action/Action.d.ts +3 -0
  30. package/components/CardGridInfinite/CardGridMainActions/Action/Action.js +16 -0
  31. package/components/CardGridInfinite/CardGridMainActions/Action/index.d.ts +1 -0
  32. package/components/CardGridInfinite/CardGridMainActions/Action/index.js +1 -0
  33. package/components/CardGridInfinite/CardGridMainActions/Action/types.d.ts +13 -0
  34. package/components/CardGridInfinite/CardGridMainActions/Action/types.js +1 -0
  35. package/components/CardGridInfinite/CardGridMainActions/Action/useLogic/index.d.ts +1 -0
  36. package/components/CardGridInfinite/CardGridMainActions/Action/useLogic/index.js +1 -0
  37. package/components/CardGridInfinite/CardGridMainActions/Action/useLogic/useLogic.d.ts +11 -0
  38. package/components/CardGridInfinite/CardGridMainActions/Action/useLogic/useLogic.js +16 -0
  39. package/components/CardGridInfinite/CardGridMainActions/CardGridMainActions.d.ts +30 -0
  40. package/components/CardGridInfinite/CardGridMainActions/CardGridMainActions.js +29 -0
  41. package/components/CardGridInfinite/CardGridMainActions/index.d.ts +4 -0
  42. package/components/CardGridInfinite/CardGridMainActions/index.js +4 -0
  43. package/components/CardGridInfinite/CardGridMainActions/styles.d.ts +5 -0
  44. package/components/CardGridInfinite/CardGridMainActions/styles.js +9 -0
  45. package/components/CardGridInfinite/CardGridMainActions/types.d.ts +44 -0
  46. package/components/CardGridInfinite/CardGridMainActions/types.js +1 -0
  47. package/components/CardGridInfinite/CardGridMainActions/utils/index.d.ts +1 -0
  48. package/components/CardGridInfinite/CardGridMainActions/utils/index.js +1 -0
  49. package/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/index.d.ts +1 -0
  50. package/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/index.js +1 -0
  51. package/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/replaceActionComponent.d.ts +8 -0
  52. package/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/replaceActionComponent.js +11 -0
  53. package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActions.d.ts +18 -0
  54. package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActions.js +34 -0
  55. package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/CardGridSecondaryActionsSkeleton.d.ts +2 -0
  56. package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/CardGridSecondaryActionsSkeleton.js +4 -0
  57. package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/index.d.ts +1 -0
  58. package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/index.js +1 -0
  59. package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/styles.d.ts +9 -0
  60. package/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/styles.js +31 -0
  61. package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuContext.d.ts +12 -0
  62. package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuContext.js +5 -0
  63. package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/SecondaryActionsMenuProvider.d.ts +8 -0
  64. package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/SecondaryActionsMenuProvider.js +5 -0
  65. package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/index.d.ts +1 -0
  66. package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/index.js +1 -0
  67. package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/index.d.ts +2 -0
  68. package/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/index.js +2 -0
  69. package/components/CardGridInfinite/CardGridSecondaryAction/index.d.ts +4 -0
  70. package/components/CardGridInfinite/CardGridSecondaryAction/index.js +3 -0
  71. package/components/CardGridInfinite/CardGridSecondaryAction/types.d.ts +59 -0
  72. package/components/CardGridInfinite/CardGridSecondaryAction/types.js +1 -0
  73. package/components/CardGridInfinite/EndData/EndData.d.ts +6 -0
  74. package/components/CardGridInfinite/EndData/EndData.js +4 -0
  75. package/components/CardGridInfinite/EndData/constants.d.ts +1 -0
  76. package/components/CardGridInfinite/EndData/constants.js +1 -0
  77. package/components/CardGridInfinite/EndData/index.d.ts +1 -0
  78. package/components/CardGridInfinite/EndData/index.js +1 -0
  79. package/components/CardGridInfinite/ErrorMessage/ErrorMessage.d.ts +6 -0
  80. package/components/CardGridInfinite/ErrorMessage/ErrorMessage.js +6 -0
  81. package/components/CardGridInfinite/ErrorMessage/constants.d.ts +1 -0
  82. package/components/CardGridInfinite/ErrorMessage/constants.js +1 -0
  83. package/components/CardGridInfinite/ErrorMessage/index.d.ts +1 -0
  84. package/components/CardGridInfinite/ErrorMessage/index.js +1 -0
  85. package/components/CardGridInfinite/ErrorMessage/styles.d.ts +5 -0
  86. package/components/CardGridInfinite/ErrorMessage/styles.js +17 -0
  87. package/components/CardGridInfinite/Footer/Footer.d.ts +10 -0
  88. package/components/CardGridInfinite/Footer/Footer.js +12 -0
  89. package/components/CardGridInfinite/Footer/index.d.ts +1 -0
  90. package/components/CardGridInfinite/Footer/index.js +1 -0
  91. package/components/CardGridInfinite/Footer/styles.d.ts +9 -0
  92. package/components/CardGridInfinite/Footer/styles.js +16 -0
  93. package/components/CardGridInfinite/List/List.d.ts +8 -0
  94. package/components/CardGridInfinite/List/List.js +4 -0
  95. package/components/CardGridInfinite/List/index.d.ts +1 -0
  96. package/components/CardGridInfinite/List/index.js +1 -0
  97. package/components/CardGridInfinite/List/styles.d.ts +10 -0
  98. package/components/CardGridInfinite/List/styles.js +10 -0
  99. package/components/CardGridInfinite/NoDataPlaceholder/NoDataPlaceholder.d.ts +6 -0
  100. package/components/CardGridInfinite/NoDataPlaceholder/NoDataPlaceholder.js +10 -0
  101. package/components/CardGridInfinite/NoDataPlaceholder/constants.d.ts +1 -0
  102. package/components/CardGridInfinite/NoDataPlaceholder/constants.js +1 -0
  103. package/components/CardGridInfinite/NoDataPlaceholder/index.d.ts +1 -0
  104. package/components/CardGridInfinite/NoDataPlaceholder/index.js +1 -0
  105. package/components/CardGridInfinite/OnTopButton/OnTopButton.d.ts +8 -0
  106. package/components/CardGridInfinite/OnTopButton/OnTopButton.js +10 -0
  107. package/components/CardGridInfinite/OnTopButton/index.d.ts +1 -0
  108. package/components/CardGridInfinite/OnTopButton/index.js +1 -0
  109. package/components/CardGridInfinite/OnTopButton/styles.d.ts +3 -0
  110. package/components/CardGridInfinite/OnTopButton/styles.js +9 -0
  111. package/components/CardGridInfinite/SkeletonGrid/SkeletonGrid.d.ts +11 -0
  112. package/components/CardGridInfinite/SkeletonGrid/SkeletonGrid.js +5 -0
  113. package/components/CardGridInfinite/SkeletonGrid/index.d.ts +1 -0
  114. package/components/CardGridInfinite/SkeletonGrid/index.js +1 -0
  115. package/components/CardGridInfinite/SkeletonGrid/styles.d.ts +12 -0
  116. package/components/CardGridInfinite/SkeletonGrid/styles.js +5 -0
  117. package/components/CardGridInfinite/constants.d.ts +7 -0
  118. package/components/CardGridInfinite/constants.js +8 -0
  119. package/components/CardGridInfinite/hooks/index.d.ts +1 -0
  120. package/components/CardGridInfinite/hooks/index.js +1 -0
  121. package/components/CardGridInfinite/hooks/useBlockingActions/index.d.ts +1 -0
  122. package/components/CardGridInfinite/hooks/useBlockingActions/index.js +1 -0
  123. package/components/CardGridInfinite/hooks/useBlockingActions/useBlockingActions.d.ts +9 -0
  124. package/components/CardGridInfinite/hooks/useBlockingActions/useBlockingActions.js +23 -0
  125. package/components/CardGridInfinite/index.d.ts +8 -0
  126. package/components/CardGridInfinite/index.js +4 -0
  127. package/components/CardGridInfinite/styles.d.ts +13 -0
  128. package/components/CardGridInfinite/styles.js +26 -0
  129. package/components/CardGridInfinite/types.d.ts +98 -0
  130. package/components/CardGridInfinite/types.js +1 -0
  131. package/components/CardGridInfinite/useLogic/index.d.ts +1 -0
  132. package/components/CardGridInfinite/useLogic/index.js +1 -0
  133. package/components/CardGridInfinite/useLogic/useLogic.d.ts +41 -0
  134. package/components/CardGridInfinite/useLogic/useLogic.js +73 -0
  135. package/components/DashboardLayout/Sidebar/styles.d.ts +1 -4
  136. package/components/DatePicker/styles.d.ts +1 -4
  137. package/components/DateRangePicker/styles.d.ts +1 -4
  138. package/components/Description/styles.js +1 -1
  139. package/components/InfiniteTreeList/useLogic/useLogic.js +2 -2
  140. package/components/PageLayout/PageContent/styles.js +5 -2
  141. package/components/PageLayout/PageLayoutContainer/index.d.ts +1 -0
  142. package/components/PageLayout/PageLayoutContainer/index.js +1 -0
  143. package/components/PageLayout/PageLayoutContainer/styles.d.ts +1 -4
  144. package/components/Paper/Paper.d.ts +1 -1
  145. package/components/Paper/Paper.js +4 -3
  146. package/components/Tag/styles.js +2 -0
  147. package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/useScrollManagement.d.ts +2 -1
  148. package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/useScrollManagement.js +13 -3
  149. package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/useStickyButton.js +2 -2
  150. package/components/hooks/index.d.ts +1 -0
  151. package/components/hooks/index.js +1 -0
  152. package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +4 -3
  153. package/components/placeholders/LoadingPlaceholder/constants.d.ts +3 -0
  154. package/components/placeholders/LoadingPlaceholder/constants.js +4 -0
  155. package/components/placeholders/LoadingPlaceholder/index.d.ts +1 -0
  156. package/components/placeholders/LoadingPlaceholder/index.js +1 -0
  157. package/node/components/CardGridInfinite/Card/Card.d.ts +3 -0
  158. package/node/components/CardGridInfinite/Card/Card.js +16 -0
  159. package/node/components/CardGridInfinite/Card/CardActionContext/CardActionContext.d.ts +10 -0
  160. package/node/components/CardGridInfinite/Card/CardActionContext/CardActionContext.js +11 -0
  161. package/node/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/CardActionContextProvider.d.ts +9 -0
  162. package/node/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/CardActionContextProvider.js +30 -0
  163. package/node/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/index.d.ts +1 -0
  164. package/node/components/CardGridInfinite/Card/CardActionContext/CardActionContextProvider/index.js +17 -0
  165. package/node/components/CardGridInfinite/Card/CardActionContext/index.d.ts +2 -0
  166. package/node/components/CardGridInfinite/Card/CardActionContext/index.js +18 -0
  167. package/node/components/CardGridInfinite/Card/SecondaryActionButton/SecondaryActionButton.d.ts +7 -0
  168. package/node/components/CardGridInfinite/Card/SecondaryActionButton/SecondaryActionButton.js +25 -0
  169. package/node/components/CardGridInfinite/Card/SecondaryActionButton/index.d.ts +1 -0
  170. package/node/components/CardGridInfinite/Card/SecondaryActionButton/index.js +17 -0
  171. package/node/components/CardGridInfinite/Card/SecondaryActionButton/styles.d.ts +12 -0
  172. package/node/components/CardGridInfinite/Card/SecondaryActionButton/styles.js +8 -0
  173. package/node/components/CardGridInfinite/Card/index.d.ts +3 -0
  174. package/node/components/CardGridInfinite/Card/index.js +18 -0
  175. package/node/components/CardGridInfinite/Card/styles.d.ts +16 -0
  176. package/node/components/CardGridInfinite/Card/styles.js +25 -0
  177. package/node/components/CardGridInfinite/Card/types.d.ts +32 -0
  178. package/node/components/CardGridInfinite/Card/types.js +2 -0
  179. package/node/components/CardGridInfinite/Card/useLogic/index.d.ts +1 -0
  180. package/node/components/CardGridInfinite/Card/useLogic/index.js +17 -0
  181. package/node/components/CardGridInfinite/Card/useLogic/useLogic.d.ts +7 -0
  182. package/node/components/CardGridInfinite/Card/useLogic/useLogic.js +11 -0
  183. package/node/components/CardGridInfinite/CardGridInfinite.d.ts +3 -0
  184. package/node/components/CardGridInfinite/CardGridInfinite.js +25 -0
  185. package/node/components/CardGridInfinite/CardGridMainActions/Action/Action.d.ts +3 -0
  186. package/node/components/CardGridInfinite/CardGridMainActions/Action/Action.js +20 -0
  187. package/node/components/CardGridInfinite/CardGridMainActions/Action/index.d.ts +1 -0
  188. package/node/components/CardGridInfinite/CardGridMainActions/Action/index.js +17 -0
  189. package/node/components/CardGridInfinite/CardGridMainActions/Action/types.d.ts +13 -0
  190. package/node/components/CardGridInfinite/CardGridMainActions/Action/types.js +2 -0
  191. package/node/components/CardGridInfinite/CardGridMainActions/Action/useLogic/index.d.ts +1 -0
  192. package/node/components/CardGridInfinite/CardGridMainActions/Action/useLogic/index.js +17 -0
  193. package/node/components/CardGridInfinite/CardGridMainActions/Action/useLogic/useLogic.d.ts +11 -0
  194. package/node/components/CardGridInfinite/CardGridMainActions/Action/useLogic/useLogic.js +20 -0
  195. package/node/components/CardGridInfinite/CardGridMainActions/CardGridMainActions.d.ts +30 -0
  196. package/node/components/CardGridInfinite/CardGridMainActions/CardGridMainActions.js +33 -0
  197. package/node/components/CardGridInfinite/CardGridMainActions/index.d.ts +4 -0
  198. package/node/components/CardGridInfinite/CardGridMainActions/index.js +22 -0
  199. package/node/components/CardGridInfinite/CardGridMainActions/styles.d.ts +5 -0
  200. package/node/components/CardGridInfinite/CardGridMainActions/styles.js +12 -0
  201. package/node/components/CardGridInfinite/CardGridMainActions/types.d.ts +44 -0
  202. package/node/components/CardGridInfinite/CardGridMainActions/types.js +2 -0
  203. package/node/components/CardGridInfinite/CardGridMainActions/utils/index.d.ts +1 -0
  204. package/node/components/CardGridInfinite/CardGridMainActions/utils/index.js +17 -0
  205. package/node/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/index.d.ts +1 -0
  206. package/node/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/index.js +17 -0
  207. package/node/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/replaceActionComponent.d.ts +8 -0
  208. package/node/components/CardGridInfinite/CardGridMainActions/utils/replaceActionComponent/replaceActionComponent.js +15 -0
  209. package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActions.d.ts +18 -0
  210. package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActions.js +38 -0
  211. package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/CardGridSecondaryActionsSkeleton.d.ts +2 -0
  212. package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/CardGridSecondaryActionsSkeleton.js +8 -0
  213. package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/index.d.ts +1 -0
  214. package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/index.js +17 -0
  215. package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/styles.d.ts +9 -0
  216. package/node/components/CardGridInfinite/CardGridSecondaryAction/CardGridSecondaryActionsSkeleton/styles.js +34 -0
  217. package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuContext.d.ts +12 -0
  218. package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuContext.js +8 -0
  219. package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/SecondaryActionsMenuProvider.d.ts +8 -0
  220. package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/SecondaryActionsMenuProvider.js +9 -0
  221. package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/index.d.ts +1 -0
  222. package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/SecondaryActionsMenuProvider/index.js +5 -0
  223. package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/index.d.ts +2 -0
  224. package/node/components/CardGridInfinite/CardGridSecondaryAction/SecondaryActionsMenuContext/index.js +18 -0
  225. package/node/components/CardGridInfinite/CardGridSecondaryAction/index.d.ts +4 -0
  226. package/node/components/CardGridInfinite/CardGridSecondaryAction/index.js +22 -0
  227. package/node/components/CardGridInfinite/CardGridSecondaryAction/types.d.ts +59 -0
  228. package/node/components/CardGridInfinite/CardGridSecondaryAction/types.js +2 -0
  229. package/node/components/CardGridInfinite/EndData/EndData.d.ts +6 -0
  230. package/node/components/CardGridInfinite/EndData/EndData.js +8 -0
  231. package/node/components/CardGridInfinite/EndData/constants.d.ts +1 -0
  232. package/node/components/CardGridInfinite/EndData/constants.js +4 -0
  233. package/node/components/CardGridInfinite/EndData/index.d.ts +1 -0
  234. package/node/components/CardGridInfinite/EndData/index.js +17 -0
  235. package/node/components/CardGridInfinite/ErrorMessage/ErrorMessage.d.ts +6 -0
  236. package/node/components/CardGridInfinite/ErrorMessage/ErrorMessage.js +10 -0
  237. package/node/components/CardGridInfinite/ErrorMessage/constants.d.ts +1 -0
  238. package/node/components/CardGridInfinite/ErrorMessage/constants.js +4 -0
  239. package/node/components/CardGridInfinite/ErrorMessage/index.d.ts +1 -0
  240. package/node/components/CardGridInfinite/ErrorMessage/index.js +17 -0
  241. package/node/components/CardGridInfinite/ErrorMessage/styles.d.ts +5 -0
  242. package/node/components/CardGridInfinite/ErrorMessage/styles.js +20 -0
  243. package/node/components/CardGridInfinite/Footer/Footer.d.ts +10 -0
  244. package/node/components/CardGridInfinite/Footer/Footer.js +16 -0
  245. package/node/components/CardGridInfinite/Footer/index.d.ts +1 -0
  246. package/node/components/CardGridInfinite/Footer/index.js +17 -0
  247. package/node/components/CardGridInfinite/Footer/styles.d.ts +9 -0
  248. package/node/components/CardGridInfinite/Footer/styles.js +19 -0
  249. package/node/components/CardGridInfinite/List/List.d.ts +8 -0
  250. package/node/components/CardGridInfinite/List/List.js +7 -0
  251. package/node/components/CardGridInfinite/List/index.d.ts +1 -0
  252. package/node/components/CardGridInfinite/List/index.js +17 -0
  253. package/node/components/CardGridInfinite/List/styles.d.ts +10 -0
  254. package/node/components/CardGridInfinite/List/styles.js +13 -0
  255. package/node/components/CardGridInfinite/NoDataPlaceholder/NoDataPlaceholder.d.ts +6 -0
  256. package/node/components/CardGridInfinite/NoDataPlaceholder/NoDataPlaceholder.js +14 -0
  257. package/node/components/CardGridInfinite/NoDataPlaceholder/constants.d.ts +1 -0
  258. package/node/components/CardGridInfinite/NoDataPlaceholder/constants.js +4 -0
  259. package/node/components/CardGridInfinite/NoDataPlaceholder/index.d.ts +1 -0
  260. package/node/components/CardGridInfinite/NoDataPlaceholder/index.js +17 -0
  261. package/node/components/CardGridInfinite/OnTopButton/OnTopButton.d.ts +8 -0
  262. package/node/components/CardGridInfinite/OnTopButton/OnTopButton.js +14 -0
  263. package/node/components/CardGridInfinite/OnTopButton/index.d.ts +1 -0
  264. package/node/components/CardGridInfinite/OnTopButton/index.js +17 -0
  265. package/node/components/CardGridInfinite/OnTopButton/styles.d.ts +3 -0
  266. package/node/components/CardGridInfinite/OnTopButton/styles.js +12 -0
  267. package/node/components/CardGridInfinite/SkeletonGrid/SkeletonGrid.d.ts +11 -0
  268. package/node/components/CardGridInfinite/SkeletonGrid/SkeletonGrid.js +9 -0
  269. package/node/components/CardGridInfinite/SkeletonGrid/index.d.ts +1 -0
  270. package/node/components/CardGridInfinite/SkeletonGrid/index.js +5 -0
  271. package/node/components/CardGridInfinite/SkeletonGrid/styles.d.ts +12 -0
  272. package/node/components/CardGridInfinite/SkeletonGrid/styles.js +8 -0
  273. package/node/components/CardGridInfinite/constants.d.ts +7 -0
  274. package/node/components/CardGridInfinite/constants.js +11 -0
  275. package/node/components/CardGridInfinite/hooks/index.d.ts +1 -0
  276. package/node/components/CardGridInfinite/hooks/index.js +17 -0
  277. package/node/components/CardGridInfinite/hooks/useBlockingActions/index.d.ts +1 -0
  278. package/node/components/CardGridInfinite/hooks/useBlockingActions/index.js +17 -0
  279. package/node/components/CardGridInfinite/hooks/useBlockingActions/useBlockingActions.d.ts +9 -0
  280. package/node/components/CardGridInfinite/hooks/useBlockingActions/useBlockingActions.js +27 -0
  281. package/node/components/CardGridInfinite/index.d.ts +8 -0
  282. package/node/components/CardGridInfinite/index.js +13 -0
  283. package/node/components/CardGridInfinite/styles.d.ts +13 -0
  284. package/node/components/CardGridInfinite/styles.js +29 -0
  285. package/node/components/CardGridInfinite/types.d.ts +98 -0
  286. package/node/components/CardGridInfinite/types.js +2 -0
  287. package/node/components/CardGridInfinite/useLogic/index.d.ts +1 -0
  288. package/node/components/CardGridInfinite/useLogic/index.js +17 -0
  289. package/node/components/CardGridInfinite/useLogic/useLogic.d.ts +41 -0
  290. package/node/components/CardGridInfinite/useLogic/useLogic.js +77 -0
  291. package/node/components/DashboardLayout/Sidebar/styles.d.ts +1 -4
  292. package/node/components/DatePicker/styles.d.ts +1 -4
  293. package/node/components/DateRangePicker/styles.d.ts +1 -4
  294. package/node/components/Description/styles.js +1 -1
  295. package/node/components/InfiniteTreeList/useLogic/useLogic.js +3 -3
  296. package/node/components/PageLayout/PageContent/styles.js +5 -2
  297. package/node/components/PageLayout/PageLayoutContainer/index.d.ts +1 -0
  298. package/node/components/PageLayout/PageLayoutContainer/index.js +3 -0
  299. package/node/components/PageLayout/PageLayoutContainer/styles.d.ts +1 -4
  300. package/node/components/Paper/Paper.d.ts +1 -1
  301. package/node/components/Paper/Paper.js +4 -4
  302. package/node/components/Tag/styles.js +2 -0
  303. package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/useScrollManagement.d.ts +2 -1
  304. package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/useScrollManagement.js +13 -3
  305. package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/useStickyButton.js +3 -3
  306. package/node/components/hooks/index.d.ts +1 -0
  307. package/node/components/hooks/index.js +4 -1
  308. package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +4 -3
  309. package/node/components/placeholders/LoadingPlaceholder/constants.d.ts +3 -0
  310. package/node/components/placeholders/LoadingPlaceholder/constants.js +7 -0
  311. package/node/components/placeholders/LoadingPlaceholder/index.d.ts +1 -0
  312. package/node/components/placeholders/LoadingPlaceholder/index.js +3 -0
  313. package/package.json +8 -1
  314. /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/index.d.ts +0 -0
  315. /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/index.js +0 -0
  316. /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/index.d.ts +0 -0
  317. /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/index.js +0 -0
  318. /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/index.d.ts +0 -0
  319. /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/index.js +0 -0
  320. /package/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/useStickyButton.d.ts +0 -0
  321. /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/index.d.ts +0 -0
  322. /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/index.js +0 -0
  323. /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/index.d.ts +0 -0
  324. /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useScrollManagement/index.js +0 -0
  325. /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/index.d.ts +0 -0
  326. /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/index.js +0 -0
  327. /package/node/components/{InfiniteTreeList/useLogic/hooks → hooks/Infinite}/useStickyButton/useStickyButton.d.ts +0 -0
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { CardProps } from './types';
3
+ export declare const Card: <TItem>(props: CardProps<TItem>) => JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Paper } from '../../Paper';
3
+ import { Tooltip } from '../../Tooltip';
4
+ import { CardActionContextProvider } from './CardActionContext';
5
+ import { SecondaryActionButton } from './SecondaryActionButton';
6
+ import { CardHeader, HeaderWrapper, StyledDivider, Wrapper } from './styles';
7
+ import { useLogic } from './useLogic';
8
+ export const Card = (props) => {
9
+ const { handleActionClick } = useLogic(props);
10
+ const { isDisabled, mainActions: MainActions, content, header, disabledReason, secondaryActions, } = props;
11
+ return (_jsx(CardActionContextProvider, { onActionClick: handleActionClick, isDisabledCard: isDisabled, children: _jsx(Tooltip, { title: isDisabled && disabledReason, withoutContainer: !isDisabled, placement: "top", componentsProps: { popper: { disablePortal: true } }, children: _jsx(Paper, { variant: "outlined", inert: isDisabled ? '' : undefined, children: _jsxs(Wrapper, { children: [header && (_jsxs(_Fragment, { children: [_jsxs(CardHeader, { children: [_jsx(HeaderWrapper, { children: header }), secondaryActions && (_jsx(SecondaryActionButton, { renderActions: secondaryActions }))] }), _jsx(StyledDivider, {})] })), content, MainActions && _jsx(MainActions, {})] }) }) }) }));
12
+ };
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import type { CardGridActionHandler } from '../../CardGridMainActions/types';
3
+ export type CardActionContextProps<TAction> = {
4
+ isDisabledCard?: boolean;
5
+ isDisabled: boolean;
6
+ onActionClick: CardGridActionHandler<TAction>;
7
+ setDisabledActions: () => void;
8
+ removeDisabledActions: () => void;
9
+ };
10
+ export declare const CardActionContext: import("react").Context<CardActionContextProps<unknown>>;
@@ -0,0 +1,8 @@
1
+ import { createContext } from 'react';
2
+ export const CardActionContext = createContext({
3
+ isDisabledCard: false,
4
+ isDisabled: false,
5
+ onActionClick: () => undefined,
6
+ setDisabledActions: () => undefined,
7
+ removeDisabledActions: () => undefined,
8
+ });
@@ -0,0 +1,9 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { CardGridActionHandler } from '../../../CardGridMainActions';
3
+ type CardActionContextProviderProps<TAction> = {
4
+ children: ReactNode;
5
+ onActionClick: CardGridActionHandler<TAction>;
6
+ isDisabledCard?: boolean;
7
+ };
8
+ export declare const CardActionContextProvider: <TAction>({ children, isDisabledCard, onActionClick, }: CardActionContextProviderProps<TAction>) => JSX.Element;
9
+ export {};
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback, useMemo, useState } from 'react';
3
+ import { CardActionContext } from '../CardActionContext';
4
+ export const CardActionContextProvider = ({ children, isDisabledCard, onActionClick, }) => {
5
+ const [isDisabled, setDisabled] = useState(false);
6
+ const setDisabledActions = useCallback(() => {
7
+ setDisabled(true);
8
+ }, []);
9
+ const removeDisabledActions = useCallback(() => {
10
+ setDisabled(false);
11
+ }, []);
12
+ const contextValue = useMemo(() => ({
13
+ isDisabled,
14
+ isDisabledCard,
15
+ setDisabledActions,
16
+ removeDisabledActions,
17
+ onActionClick,
18
+ }), [
19
+ isDisabled,
20
+ setDisabledActions,
21
+ removeDisabledActions,
22
+ onActionClick,
23
+ isDisabledCard,
24
+ ]);
25
+ return (_jsx(CardActionContext.Provider, { value: contextValue, children: children }));
26
+ };
@@ -0,0 +1 @@
1
+ export * from './CardActionContextProvider';
@@ -0,0 +1 @@
1
+ export * from './CardActionContextProvider';
@@ -0,0 +1,2 @@
1
+ export * from './CardActionContext';
2
+ export * from './CardActionContextProvider';
@@ -0,0 +1,2 @@
1
+ export * from './CardActionContext';
2
+ export * from './CardActionContextProvider';
@@ -0,0 +1,7 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type CardGridSecondaryActionsProps } from '../../CardGridSecondaryAction';
3
+ type SecondaryActionButtonProps<TAction> = {
4
+ renderActions: (props: Omit<CardGridSecondaryActionsProps<TAction>, 'mobileTitle'>) => ReactNode;
5
+ };
6
+ export declare const SecondaryActionButton: <TAction>({ renderActions, }: SecondaryActionButtonProps<TAction>) => JSX.Element;
7
+ export {};
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ClickAwayListener } from '@mui/material';
3
+ import { useContext, useRef, useState } from 'react';
4
+ import { DotsVOutlineMd } from '../../../../icons';
5
+ import { useMenu } from '../../../hooks';
6
+ import { SecondaryActionsMenuProvider, } from '../../CardGridSecondaryAction';
7
+ import { CardActionContext } from '../CardActionContext';
8
+ import { StyledIconButton } from './styles';
9
+ export const SecondaryActionButton = ({ renderActions, }) => {
10
+ const buttonRef = useRef(null);
11
+ const { open, anchorRef, handleOpenMenu, handleCloseMenu } = useMenu(buttonRef);
12
+ const { isDisabled, isDisabledCard } = useContext(CardActionContext);
13
+ // Если контент единожды отрендерился, то будем рендерить его дальше,
14
+ // чтобы были актуальные статусы loading для блокировки действий
15
+ const [isOnceOpen, setIsOnceOpen] = useState(false);
16
+ const handleOpen = () => {
17
+ setIsOnceOpen(true);
18
+ handleOpenMenu();
19
+ };
20
+ return (_jsxs(SecondaryActionsMenuProvider, { value: { open, anchorEl: anchorRef.current }, children: [_jsx(ClickAwayListener, { onClickAway: handleCloseMenu, mouseEvent: "onMouseUp", children: _jsx(StyledIconButton, { ref: anchorRef, onClick: handleOpen, selected: open, variant: "outlined", color: "grey", disabled: isDisabled || isDisabledCard, children: _jsx(DotsVOutlineMd, {}) }) }), isOnceOpen && renderActions({ isLoading: false })] }));
21
+ };
@@ -0,0 +1 @@
1
+ export * from './SecondaryActionButton';
@@ -0,0 +1 @@
1
+ export * from './SecondaryActionButton';
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledIconButton: import("@emotion/styled").StyledComponent<Omit<import("../../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "variant"> & {
3
+ variant?: "link" | "light" | "outlined" | "contained" | "text" | undefined;
4
+ loading?: boolean | undefined;
5
+ color?: "grey" | "error" | "success" | "warning" | "primary" | undefined;
6
+ component?: import("react").ElementType | undefined;
7
+ selected?: boolean | undefined;
8
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
9
+ ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
10
+ }, ""> & import("react").RefAttributes<HTMLButtonElement> & {
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ }, {}, {}>;
@@ -0,0 +1,5 @@
1
+ import { IconButton } from '../../../IconButton';
2
+ import { styled } from '../../../styles';
3
+ export const StyledIconButton = styled(IconButton) `
4
+ align-self: flex-start;
5
+ `;
@@ -0,0 +1,3 @@
1
+ export * from './Card';
2
+ export * from './CardActionContext';
3
+ export type { CardProps } from './types';
@@ -0,0 +1,2 @@
1
+ export * from './Card';
2
+ export * from './CardActionContext';
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ export declare const Wrapper: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const StyledDivider: import("@emotion/styled").StyledComponent<import("../../Divider").DividerProps & {
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ }, {}, {}>;
9
+ export declare const CardHeader: import("@emotion/styled").StyledComponent<{
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ as?: import("react").ElementType<any> | undefined;
12
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
13
+ export declare const HeaderWrapper: import("@emotion/styled").StyledComponent<{
14
+ theme?: import("@emotion/react").Theme | undefined;
15
+ as?: import("react").ElementType<any> | undefined;
16
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,22 @@
1
+ import { Divider } from '../../Divider';
2
+ import { styled } from '../../styles';
3
+ export const Wrapper = styled.div `
4
+ padding: ${({ theme }) => theme.spacing(4, 5)};
5
+
6
+ ${({ theme }) => theme.breakpoints.down('sm')} {
7
+ padding: ${({ theme }) => theme.spacing(5, 4)};
8
+ }
9
+ `;
10
+ export const StyledDivider = styled(Divider) `
11
+ margin: ${({ theme }) => theme.spacing(4, 0)}
12
+ `;
13
+ export const CardHeader = styled.div `
14
+ display: flex;
15
+ gap: ${({ theme }) => theme.spacing(1)};
16
+ align-items: center;
17
+ justify-content: space-between;
18
+ `;
19
+ export const HeaderWrapper = styled.div `
20
+ overflow: hidden;
21
+ flex: 1;
22
+ `;
@@ -0,0 +1,32 @@
1
+ import { type FunctionComponent, type ReactNode } from 'react';
2
+ export type CardProps<TItem> = {
3
+ /**
4
+ * Header элемента
5
+ */
6
+ header?: ReactNode;
7
+ /**
8
+ * Основные действия элемента отображающиеся в footer
9
+ * Может быть как функцией без параметров, так и React компонентом
10
+ */
11
+ mainActions?: FunctionComponent;
12
+ /**
13
+ * Дополнительные действия элемента отображающиеся в header в виде кнопки с троеточием
14
+ */
15
+ secondaryActions?: () => ReactNode;
16
+ /**
17
+ * Основной контент отображающийся в центральной части элемента
18
+ */
19
+ content: ReactNode;
20
+ /**
21
+ * Если `true`, элемент будет заблокирован для взаимодействия
22
+ */
23
+ isDisabled?: boolean;
24
+ /**
25
+ * Причина блокировки элемента
26
+ */
27
+ disabledReason?: string;
28
+ /**
29
+ * Данные элемента
30
+ */
31
+ item: TItem;
32
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1,7 @@
1
+ import type { CardGridActionHandler } from '../../CardGridMainActions';
2
+ import type { CardProps } from '../types';
3
+ type UseLogicParams<TItem> = CardProps<TItem>;
4
+ export declare const useLogic: <TItem>({ item }: UseLogicParams<TItem>) => {
5
+ handleActionClick: CardGridActionHandler<TItem>;
6
+ };
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import { useCallback } from 'react';
2
+ export const useLogic = ({ item }) => {
3
+ const handleActionClick = useCallback((onClick) => () => {
4
+ onClick?.(item);
5
+ }, [item]);
6
+ return { handleActionClick };
7
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { CardGridInfiniteProps } from './types';
3
+ export declare const CardGridInfinite: <TDataItem extends Record<string, unknown>>(props: CardGridInfiniteProps<TDataItem>) => JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useMemo } from 'react';
3
+ import { VirtuosoGrid, } from 'react-virtuoso';
4
+ import { ContentState } from '../ContentState';
5
+ import { Card } from './Card';
6
+ import { cardGridClassnames } from './constants';
7
+ import { Footer } from './Footer';
8
+ import { List } from './List';
9
+ import { NoDataPlaceholder } from './NoDataPlaceholder';
10
+ import { OnTopButton } from './OnTopButton';
11
+ import { SkeletonGrid } from './SkeletonGrid';
12
+ import { ContentStateWrapper } from './styles';
13
+ import { useLogic } from './useLogic';
14
+ export const CardGridInfinite = (props) => {
15
+ const { contentStateProps, desktopCardWidth, virtuosoProps, scrollParent, skeleton, footerProps, onTopButtonProps, list, noDataImgSrc, defineCard, classnames, } = useLogic(props);
16
+ const VirtuosoList = useMemo(() => forwardRef((listProps, ref) => (_jsx(List, { ...listProps, ref: ref, desktopCardWidth: desktopCardWidth }))), [desktopCardWidth]);
17
+ return (_jsx(ContentStateWrapper, { className: classnames, children: _jsx(ContentState, { ...contentStateProps, loadingContent: _jsx(SkeletonGrid, { skeleton: skeleton, desktopCardWidth: desktopCardWidth }), children: list?.length && scrollParent ? (_jsxs(_Fragment, { children: [_jsx(VirtuosoGrid, { ...virtuosoProps, data: list, customScrollParent: scrollParent, listClassName: cardGridClassnames.list, components: {
18
+ List: VirtuosoList,
19
+ Footer: () => _jsx(Footer, { ...footerProps }),
20
+ }, itemContent: (_, item) => (_jsx(Card, { item: item, ...defineCard(item) })) }), _jsx(OnTopButton, { ...onTopButtonProps })] })) : (_jsx(NoDataPlaceholder, { noDataImgSrc: noDataImgSrc })) }) }));
21
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { ActionProps } from './types';
3
+ export declare const Action: <TAction>(props: ActionProps<TAction>) => JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Button } from '../../../Button';
3
+ import { ConfirmAction, } from '../../../ConfirmAction';
4
+ import { Tooltip } from '../../../Tooltip';
5
+ import { useLogic } from './useLogic';
6
+ export const Action = (props) => {
7
+ const { tooltipProps } = useLogic(props);
8
+ const { action, onActionClick, isDisabled } = props;
9
+ const { name, needConfirm, confirmText, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, note, onClick, component, variant, color, ...restProps } = action;
10
+ const renderButton = (renderProps) => {
11
+ return (_jsx(Tooltip, { withoutContainer: !disabled, placement: "bottom", ...tooltipProps, children: _jsx(Button, { disabled: isDisabled || disabled, loading: loading, component: component, variant: variant, color: color, ...restProps, ...renderProps, children: name }) }, name));
12
+ };
13
+ return (_jsx(_Fragment, { children: needConfirm ? (_jsx(ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps, actionComponent: (renderProps) => renderButton(renderProps), onConfirm: onActionClick(onClick) })) : (renderButton({
14
+ onClick: onActionClick(onClick),
15
+ })) }));
16
+ };
@@ -0,0 +1 @@
1
+ export * from './Action';
@@ -0,0 +1 @@
1
+ export * from './Action';
@@ -0,0 +1,13 @@
1
+ import type { ElementType } from 'react';
2
+ import type { CardGridActionHandler, CardGridMainActionComponent } from '../types';
3
+ export type ActionProps<TAction> = {
4
+ action: CardGridMainActionComponent<TAction, ElementType>;
5
+ /**
6
+ * Обработчик клика на действие
7
+ */
8
+ onActionClick: CardGridActionHandler<TAction>;
9
+ /**
10
+ * Если true, action не доступен
11
+ */
12
+ isDisabled?: boolean;
13
+ };
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1,11 @@
1
+ import type { ActionProps } from '../types';
2
+ type UseLogicParam<TAction> = ActionProps<TAction>;
3
+ export declare const useLogic: <TAction>({ action }: UseLogicParam<TAction>) => {
4
+ tooltipProps: {
5
+ title: string | undefined;
6
+ open: boolean;
7
+ onOpen: () => void;
8
+ onClose: () => void;
9
+ };
10
+ };
11
+ export {};
@@ -0,0 +1,16 @@
1
+ import { useState } from 'react';
2
+ export const useLogic = ({ action }) => {
3
+ const { loading, disabledReason, note } = action;
4
+ const [isVisibleTooltip, setVisibleTooltip] = useState(false);
5
+ const handleOpenTooltip = () => setVisibleTooltip(true);
6
+ const handleCloseTooltip = () => setVisibleTooltip(false);
7
+ const title = note || disabledReason;
8
+ return {
9
+ tooltipProps: {
10
+ title,
11
+ open: isVisibleTooltip && !loading,
12
+ onOpen: handleOpenTooltip,
13
+ onClose: handleCloseTooltip,
14
+ },
15
+ };
16
+ };
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ import type { CardGridMainAction } from './types';
3
+ export type CardGridMainActionsProps<TAction> = {
4
+ /**
5
+ * Действия отображаются слева направо в порядке, указанном в массиве
6
+ * Каждый элемент может иметь свой component (например, 'button', 'a', и т.д.)
7
+ * с соответствующими пропсами для этого компонента
8
+ */
9
+ actions?: CardGridMainAction<TAction>[];
10
+ };
11
+ /**
12
+ * Компонент для отображения основных действий в карточке CardGrid.
13
+ *
14
+ * Основные действия отображаются в виде отдельных кнопок в футере карточки
15
+ * и предназначены для наиболее часто используемых операций над ней
16
+ *
17
+ * @remarks
18
+ * - Компонент автоматически обрабатывает блокирующие операции, что предотвращает одновременное выполнение нескольких действий
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <CardGridMainActions
23
+ * actions={[
24
+ * { name: 'Редактировать', onClick: handleEdit },
25
+ * { name: 'Удалить', onClick: handleDelete, isBlockingOperation: true }
26
+ * ]}
27
+ * />
28
+ * ```
29
+ */
30
+ export declare const CardGridMainActions: <TAction>({ actions, }: CardGridMainActionsProps<TAction>) => JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useBlockingActions } from '../hooks';
3
+ import { Action } from './Action';
4
+ import { Wrapper } from './styles';
5
+ /**
6
+ * Компонент для отображения основных действий в карточке CardGrid.
7
+ *
8
+ * Основные действия отображаются в виде отдельных кнопок в футере карточки
9
+ * и предназначены для наиболее часто используемых операций над ней
10
+ *
11
+ * @remarks
12
+ * - Компонент автоматически обрабатывает блокирующие операции, что предотвращает одновременное выполнение нескольких действий
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * <CardGridMainActions
17
+ * actions={[
18
+ * { name: 'Редактировать', onClick: handleEdit },
19
+ * { name: 'Удалить', onClick: handleDelete, isBlockingOperation: true }
20
+ * ]}
21
+ * />
22
+ * ```
23
+ */
24
+ export const CardGridMainActions = ({ actions, }) => {
25
+ const { isDisabled, onActionClick } = useBlockingActions(actions);
26
+ return (_jsx(Wrapper, { children: actions?.map((action) => {
27
+ return (_jsx(Action, { action: action, onActionClick: onActionClick, isDisabled: isDisabled }, action.name));
28
+ }) }));
29
+ };
@@ -0,0 +1,4 @@
1
+ export * from './CardGridMainActions';
2
+ export * from './types';
3
+ export * from './Action';
4
+ export { replaceActionComponent } from './utils';
@@ -0,0 +1,4 @@
1
+ export * from './CardGridMainActions';
2
+ export * from './types';
3
+ export * from './Action';
4
+ export { replaceActionComponent } from './utils';
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const Wrapper: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,9 @@
1
+ import { styled } from '../../styles';
2
+ export const Wrapper = styled.div `
3
+ display: grid;
4
+ grid-auto-columns: 1fr;
5
+ grid-auto-flow: column;
6
+ gap: ${({ theme }) => theme.spacing(3)};
7
+
8
+ padding-top: ${({ theme }) => theme.spacing(6)};
9
+ `;
@@ -0,0 +1,44 @@
1
+ import type { ElementType, MouseEventHandler } from 'react';
2
+ import type { ButtonProps } from '../../Button';
3
+ import type { ConfirmActionProps } from '../../ConfirmAction';
4
+ export type CardGridMainActionBase<TItem> = {
5
+ /**
6
+ * Название действия (также используется как текст внутри кнопки)
7
+ */
8
+ name: string;
9
+ /**
10
+ * Если `true`, при клике на кнопку будет вызываться подтверждение действия
11
+ */
12
+ needConfirm?: boolean;
13
+ /**
14
+ * Поясняющий текст для подтверждения действия
15
+ */
16
+ confirmText?: ConfirmActionProps['text'];
17
+ /**
18
+ * Параметры кнопки подтверждения действия
19
+ */
20
+ confirmButtonProps?: ConfirmActionProps['confirmButtonProps'];
21
+ /**
22
+ * Если true, блокирует взаимодействие с actions
23
+ */
24
+ isBlockingOperation?: boolean;
25
+ /**
26
+ * Причина блокировки действия
27
+ */
28
+ disabledReason?: string;
29
+ /**
30
+ * Текст тултипа при наведении на кнопку
31
+ */
32
+ note?: string;
33
+ /**
34
+ * Причина блокировки строки во время загрузки
35
+ */
36
+ loadingNote?: string;
37
+ /**
38
+ * Обработчик действия
39
+ */
40
+ onClick?: (data: TItem) => void;
41
+ };
42
+ export type CardGridMainActionComponent<TItem, TComponent extends ElementType = ElementType> = CardGridMainActionBase<TItem> & Omit<ButtonProps<TComponent>, 'children' | 'onClick'>;
43
+ export type CardGridActionHandler<TItem> = (onClick: CardGridMainActionComponent<TItem>['onClick']) => MouseEventHandler<HTMLElement> | undefined;
44
+ export type CardGridMainAction<TItem> = CardGridMainActionComponent<TItem, ElementType>;
@@ -0,0 +1 @@
1
+ export * from './replaceActionComponent';
@@ -0,0 +1 @@
1
+ export * from './replaceActionComponent';
@@ -0,0 +1 @@
1
+ export * from './replaceActionComponent';
@@ -0,0 +1 @@
1
+ export * from './replaceActionComponent';
@@ -0,0 +1,8 @@
1
+ import { type ElementType } from 'react';
2
+ import type { CardGridMainActionComponent } from '../../types';
3
+ /**
4
+ * Заменяет дефолтный параметр component на кастомный
5
+ * @param component - Кастомный компонент для замены Button
6
+ * @param props - Параметры компонента
7
+ */
8
+ export declare const replaceActionComponent: <TItem, TComponent extends ElementType>(component: TComponent, props: Omit<CardGridMainActionComponent<TItem, TComponent>, "component">) => CardGridMainActionComponent<TItem, ElementType>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Заменяет дефолтный параметр component на кастомный
3
+ * @param component - Кастомный компонент для замены Button
4
+ * @param props - Параметры компонента
5
+ */
6
+ export const replaceActionComponent = (component, props) => {
7
+ return {
8
+ ...props,
9
+ component,
10
+ };
11
+ };
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import type { CardGridSecondaryActionsProps } from './types';
3
+ /**
4
+ * Компонент для отображения дополнительных действий в выпадающем меню.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * <CardGridSecondaryActions
9
+ * actions={[
10
+ * { name: 'Дублировать', onClick: handleDuplicate },
11
+ * { name: 'Архивировать', onClick: handleArchive, disabled: !canArchive },
12
+ * { name: 'Экспортировать', onClick: handleExport }
13
+ * ]}
14
+ * isLoading={isActionsLoading}
15
+ * />
16
+ * ```
17
+ */
18
+ export declare const CardGridSecondaryActions: <TAction>({ actions, isLoading, mobileTitle, }: CardGridSecondaryActionsProps<TAction>) => JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createElement as _createElement } from "react";
3
+ import { useContext } from 'react';
4
+ import { Menu } from '../../Menu';
5
+ import { MenuItem } from '../../MenuItem';
6
+ import { useBlockingActions } from '../hooks';
7
+ import { CardGridSecondaryActionsSkeleton } from './CardGridSecondaryActionsSkeleton';
8
+ import { SecondaryActionsMenuContext } from './SecondaryActionsMenuContext';
9
+ /**
10
+ * Компонент для отображения дополнительных действий в выпадающем меню.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * <CardGridSecondaryActions
15
+ * actions={[
16
+ * { name: 'Дублировать', onClick: handleDuplicate },
17
+ * { name: 'Архивировать', onClick: handleArchive, disabled: !canArchive },
18
+ * { name: 'Экспортировать', onClick: handleExport }
19
+ * ]}
20
+ * isLoading={isActionsLoading}
21
+ * />
22
+ * ```
23
+ */
24
+ export const CardGridSecondaryActions = ({ actions, isLoading, mobileTitle, }) => {
25
+ const { onActionClick } = useBlockingActions(actions);
26
+ const { anchorEl, open } = useContext(SecondaryActionsMenuContext);
27
+ const renderActions = () => {
28
+ return actions?.map((action) => {
29
+ const { onClick, name, loading, isBlockingOperation, ...restProps } = action;
30
+ return (_createElement(MenuItem, { ...restProps, key: name, tooltipPlacement: "left", onClick: onActionClick(onClick) }, name));
31
+ });
32
+ };
33
+ return (_jsx(Menu, { open: open, title: mobileTitle, anchorEl: anchorEl, anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, transformOrigin: { vertical: 'top', horizontal: 'right' }, children: isLoading ? _jsx(CardGridSecondaryActionsSkeleton, {}) : renderActions() }));
34
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const CardGridSecondaryActionsSkeleton: () => JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Skeleton } from '../../../Skeleton';
3
+ import { MenuItemWrapper, SkeletonWrapper } from './styles';
4
+ export const CardGridSecondaryActionsSkeleton = () => (_jsxs(SkeletonWrapper, { children: [_jsx(MenuItemWrapper, { children: _jsx(Skeleton, { variant: "rounded", width: 110 }) }), _jsx(MenuItemWrapper, { children: _jsx(Skeleton, { variant: "rounded", width: 60 }) }), _jsx(MenuItemWrapper, { children: _jsx(Skeleton, { variant: "rounded", width: 90 }) })] }));