@astral/ui 4.92.2 → 4.93.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 (233) hide show
  1. package/components/BottomDrawer/index.d.ts +1 -1
  2. package/components/BottomDrawer/index.js +1 -1
  3. package/components/ClickAwayListener/ClickAwayListener.d.ts +1 -1
  4. package/components/ClickAwayListener/ClickAwayListener.js +8 -2
  5. package/components/Fieldset/styles.js +1 -0
  6. package/components/Radio/Radio.js +1 -1
  7. package/components/Radio/constants.d.ts +3 -0
  8. package/components/Radio/constants.js +3 -0
  9. package/components/Radio/index.d.ts +1 -1
  10. package/components/Radio/index.js +1 -1
  11. package/components/Radio/styles.js +9 -9
  12. package/components/Tree/MultipleTreeList/MultipleTreeList.js +2 -2
  13. package/components/Tree/MultipleTreeList/TreeItem/TreeItem.js +4 -7
  14. package/components/Tree/MultipleTreeList/TreeItem/styles.d.ts +1 -17
  15. package/components/Tree/MultipleTreeList/TreeItem/styles.js +19 -2
  16. package/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.d.ts +4 -1
  17. package/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.js +8 -2
  18. package/components/Tree/MultipleTreeList/styles.d.ts +4 -0
  19. package/components/Tree/MultipleTreeList/styles.js +25 -0
  20. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanel.d.ts +2 -0
  21. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanel.js +11 -0
  22. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/MobileSlidePanelContent.d.ts +2 -0
  23. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/MobileSlidePanelContent.js +50 -0
  24. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/index.d.ts +1 -0
  25. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/index.js +1 -0
  26. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/styles.d.ts +404 -0
  27. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/styles.js +172 -0
  28. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/types.d.ts +11 -0
  29. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/types.js +1 -0
  30. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.d.ts +3 -0
  31. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.js +3 -0
  32. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/index.d.ts +1 -0
  33. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/index.js +1 -0
  34. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/useDelayedUnmount.d.ts +11 -0
  35. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/useDelayedUnmount.js +18 -0
  36. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/index.d.ts +1 -0
  37. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/index.js +1 -0
  38. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/usePanelHeader.d.ts +24 -0
  39. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/usePanelHeader.js +50 -0
  40. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/index.d.ts +1 -0
  41. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/index.js +1 -0
  42. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/useRegisterClose.d.ts +13 -0
  43. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/useRegisterClose.js +17 -0
  44. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/index.d.ts +1 -0
  45. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/index.js +1 -0
  46. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/useLogic.d.ts +19 -0
  47. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/useLogic.js +39 -0
  48. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContext.d.ts +13 -0
  49. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContext.js +6 -0
  50. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/MobileSlidePanelContextProvider.d.ts +7 -0
  51. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/MobileSlidePanelContextProvider.js +12 -0
  52. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/index.d.ts +1 -0
  53. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/index.js +1 -0
  54. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/index.d.ts +2 -0
  55. package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/index.js +2 -0
  56. package/components/Tree/TreeItem/MobileSlidePanel/constants.d.ts +11 -0
  57. package/components/Tree/TreeItem/MobileSlidePanel/constants.js +12 -0
  58. package/components/Tree/TreeItem/MobileSlidePanel/index.d.ts +2 -0
  59. package/components/Tree/TreeItem/MobileSlidePanel/index.js +2 -0
  60. package/components/Tree/TreeItem/MobileSlidePanel/types.d.ts +49 -0
  61. package/components/Tree/TreeItem/MobileSlidePanel/types.js +1 -0
  62. package/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/index.d.ts +1 -0
  63. package/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/index.js +1 -0
  64. package/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/index.d.ts +1 -0
  65. package/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/index.js +1 -0
  66. package/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/usePanelStack.d.ts +14 -0
  67. package/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/usePanelStack.js +62 -0
  68. package/components/Tree/TreeItem/MobileSlidePanel/useLogic/index.d.ts +1 -0
  69. package/components/Tree/TreeItem/MobileSlidePanel/useLogic/index.js +1 -0
  70. package/components/Tree/TreeItem/MobileSlidePanel/useLogic/useLogic.d.ts +9 -0
  71. package/components/Tree/TreeItem/MobileSlidePanel/useLogic/useLogic.js +11 -0
  72. package/components/Tree/TreeItem/TreeItem.d.ts +2 -1
  73. package/components/Tree/TreeItem/TreeItem.js +49 -9
  74. package/components/Tree/TreeItem/constants.d.ts +9 -0
  75. package/components/Tree/TreeItem/constants.js +9 -0
  76. package/components/Tree/TreeItem/styles.d.ts +4 -13
  77. package/components/Tree/TreeItem/styles.js +153 -39
  78. package/components/Tree/TreeItem/types.d.ts +18 -0
  79. package/components/Tree/TreeItem/useLogic/useLogic.d.ts +21 -7
  80. package/components/Tree/TreeItem/useLogic/useLogic.js +40 -2
  81. package/components/Tree/TreeList/TreeItem/TreeItem.js +5 -5
  82. package/components/Tree/TreeList/TreeItem/styles.d.ts +19 -0
  83. package/components/Tree/TreeList/TreeItem/styles.js +36 -0
  84. package/components/Tree/TreeList/TreeItem/useLogic/useLogic.d.ts +6 -0
  85. package/components/Tree/TreeList/TreeItem/useLogic/useLogic.js +11 -0
  86. package/components/Tree/TreeList/TreeList.js +2 -2
  87. package/components/Tree/TreeList/styles.d.ts +4 -0
  88. package/components/Tree/TreeList/styles.js +26 -0
  89. package/components/TreeAsyncAutocomplete/OptionsModal/NoData/styles.js +5 -0
  90. package/components/TreeAsyncAutocomplete/OptionsModal/OptionsModal.js +2 -3
  91. package/components/TreeAsyncAutocomplete/OptionsModal/styles.d.ts +17 -0
  92. package/components/TreeAsyncAutocomplete/OptionsModal/styles.js +75 -5
  93. package/components/TreeAutocomplete/OptionsModal/NoData/styles.js +5 -0
  94. package/components/TreeAutocomplete/OptionsModal/OptionsModal.js +2 -3
  95. package/components/TreeAutocomplete/OptionsModal/styles.d.ts +17 -0
  96. package/components/TreeAutocomplete/OptionsModal/styles.js +36 -0
  97. package/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/styles.js +5 -0
  98. package/components/TreeLikeAsyncAutocomplete/OptionsModal/OptionsModal.js +5 -9
  99. package/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.d.ts +35 -0
  100. package/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.js +96 -5
  101. package/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.d.ts +1 -0
  102. package/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.js +17 -2
  103. package/components/TreeLikeAutocomplete/OptionsModal/NoData/styles.js +5 -0
  104. package/components/TreeLikeAutocomplete/OptionsModal/OptionsModal.js +5 -6
  105. package/components/TreeLikeAutocomplete/OptionsModal/styles.d.ts +27 -0
  106. package/components/TreeLikeAutocomplete/OptionsModal/styles.js +44 -1
  107. package/components/TreeLikeAutocomplete/OptionsModal/useLogic/useLogic.d.ts +1 -0
  108. package/components/TreeLikeAutocomplete/OptionsModal/useLogic/useLogic.js +14 -1
  109. package/components/TreeLikeList/TreeItem/TreeItem.js +11 -4
  110. package/components/TreeLikeList/TreeItem/styles.d.ts +14 -17
  111. package/components/TreeLikeList/TreeItem/styles.js +48 -1
  112. package/components/TreeLikeList/TreeItem/useLogic/useLogic.d.ts +8 -2
  113. package/components/TreeLikeList/TreeItem/useLogic/useLogic.js +35 -13
  114. package/components/TreeLikeList/TreeLikeList.js +2 -2
  115. package/components/TreeLikeList/styles.d.ts +4 -0
  116. package/components/TreeLikeList/styles.js +25 -0
  117. package/node/components/BottomDrawer/index.d.ts +1 -1
  118. package/node/components/BottomDrawer/index.js +3 -1
  119. package/node/components/ClickAwayListener/ClickAwayListener.d.ts +1 -1
  120. package/node/components/ClickAwayListener/ClickAwayListener.js +8 -2
  121. package/node/components/Fieldset/styles.js +1 -0
  122. package/node/components/Radio/Radio.js +1 -1
  123. package/node/components/Radio/constants.d.ts +3 -0
  124. package/node/components/Radio/constants.js +4 -1
  125. package/node/components/Radio/index.d.ts +1 -1
  126. package/node/components/Radio/index.js +3 -1
  127. package/node/components/Radio/styles.js +8 -8
  128. package/node/components/Tree/MultipleTreeList/MultipleTreeList.js +1 -1
  129. package/node/components/Tree/MultipleTreeList/TreeItem/TreeItem.js +4 -7
  130. package/node/components/Tree/MultipleTreeList/TreeItem/styles.d.ts +1 -17
  131. package/node/components/Tree/MultipleTreeList/TreeItem/styles.js +18 -1
  132. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.d.ts +4 -1
  133. package/node/components/Tree/MultipleTreeList/TreeItem/useLogic/useLogic.js +8 -2
  134. package/node/components/Tree/MultipleTreeList/styles.d.ts +4 -0
  135. package/node/components/Tree/MultipleTreeList/styles.js +26 -1
  136. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanel.d.ts +2 -0
  137. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanel.js +15 -0
  138. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/MobileSlidePanelContent.d.ts +2 -0
  139. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/MobileSlidePanelContent.js +54 -0
  140. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/index.d.ts +1 -0
  141. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/index.js +17 -0
  142. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/styles.d.ts +404 -0
  143. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/styles.js +175 -0
  144. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/types.d.ts +11 -0
  145. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/types.js +2 -0
  146. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.d.ts +3 -0
  147. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.js +19 -0
  148. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/index.d.ts +1 -0
  149. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/index.js +17 -0
  150. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/useDelayedUnmount.d.ts +11 -0
  151. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount/useDelayedUnmount.js +22 -0
  152. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/index.d.ts +1 -0
  153. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/index.js +17 -0
  154. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/usePanelHeader.d.ts +24 -0
  155. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/usePanelHeader/usePanelHeader.js +54 -0
  156. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/index.d.ts +1 -0
  157. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/index.js +17 -0
  158. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/useRegisterClose.d.ts +13 -0
  159. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useRegisterClose/useRegisterClose.js +21 -0
  160. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/index.d.ts +1 -0
  161. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/index.js +17 -0
  162. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/useLogic.d.ts +19 -0
  163. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/useLogic.js +43 -0
  164. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContext.d.ts +13 -0
  165. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContext.js +9 -0
  166. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/MobileSlidePanelContextProvider.d.ts +7 -0
  167. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/MobileSlidePanelContextProvider.js +16 -0
  168. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/index.d.ts +1 -0
  169. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/MobileSlidePanelContextProvider/index.js +17 -0
  170. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/index.d.ts +2 -0
  171. package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContext/index.js +18 -0
  172. package/node/components/Tree/TreeItem/MobileSlidePanel/constants.d.ts +11 -0
  173. package/node/components/Tree/TreeItem/MobileSlidePanel/constants.js +15 -0
  174. package/node/components/Tree/TreeItem/MobileSlidePanel/index.d.ts +2 -0
  175. package/node/components/Tree/TreeItem/MobileSlidePanel/index.js +18 -0
  176. package/node/components/Tree/TreeItem/MobileSlidePanel/types.d.ts +49 -0
  177. package/node/components/Tree/TreeItem/MobileSlidePanel/types.js +2 -0
  178. package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/index.d.ts +1 -0
  179. package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/index.js +17 -0
  180. package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/index.d.ts +1 -0
  181. package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/index.js +17 -0
  182. package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/usePanelStack.d.ts +14 -0
  183. package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/hooks/usePanelStack/usePanelStack.js +66 -0
  184. package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/index.d.ts +1 -0
  185. package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/index.js +17 -0
  186. package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/useLogic.d.ts +9 -0
  187. package/node/components/Tree/TreeItem/MobileSlidePanel/useLogic/useLogic.js +15 -0
  188. package/node/components/Tree/TreeItem/TreeItem.d.ts +2 -1
  189. package/node/components/Tree/TreeItem/TreeItem.js +48 -9
  190. package/node/components/Tree/TreeItem/constants.d.ts +9 -0
  191. package/node/components/Tree/TreeItem/constants.js +10 -1
  192. package/node/components/Tree/TreeItem/styles.d.ts +4 -13
  193. package/node/components/Tree/TreeItem/styles.js +153 -39
  194. package/node/components/Tree/TreeItem/types.d.ts +18 -0
  195. package/node/components/Tree/TreeItem/useLogic/useLogic.d.ts +21 -7
  196. package/node/components/Tree/TreeItem/useLogic/useLogic.js +39 -1
  197. package/node/components/Tree/TreeList/TreeItem/TreeItem.js +4 -4
  198. package/node/components/Tree/TreeList/TreeItem/styles.d.ts +19 -0
  199. package/node/components/Tree/TreeList/TreeItem/styles.js +60 -1
  200. package/node/components/Tree/TreeList/TreeItem/useLogic/useLogic.d.ts +6 -0
  201. package/node/components/Tree/TreeList/TreeItem/useLogic/useLogic.js +11 -0
  202. package/node/components/Tree/TreeList/TreeList.js +1 -1
  203. package/node/components/Tree/TreeList/styles.d.ts +4 -0
  204. package/node/components/Tree/TreeList/styles.js +27 -1
  205. package/node/components/TreeAsyncAutocomplete/OptionsModal/NoData/styles.js +5 -0
  206. package/node/components/TreeAsyncAutocomplete/OptionsModal/OptionsModal.js +1 -2
  207. package/node/components/TreeAsyncAutocomplete/OptionsModal/styles.d.ts +17 -0
  208. package/node/components/TreeAsyncAutocomplete/OptionsModal/styles.js +76 -6
  209. package/node/components/TreeAutocomplete/OptionsModal/NoData/styles.js +5 -0
  210. package/node/components/TreeAutocomplete/OptionsModal/OptionsModal.js +1 -2
  211. package/node/components/TreeAutocomplete/OptionsModal/styles.d.ts +17 -0
  212. package/node/components/TreeAutocomplete/OptionsModal/styles.js +37 -1
  213. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/NoData/styles.js +5 -0
  214. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/OptionsModal.js +3 -7
  215. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.d.ts +35 -0
  216. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/styles.js +97 -6
  217. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.d.ts +1 -0
  218. package/node/components/TreeLikeAsyncAutocomplete/OptionsModal/useLogic/useLogic.js +17 -2
  219. package/node/components/TreeLikeAutocomplete/OptionsModal/NoData/styles.js +5 -0
  220. package/node/components/TreeLikeAutocomplete/OptionsModal/OptionsModal.js +3 -4
  221. package/node/components/TreeLikeAutocomplete/OptionsModal/styles.d.ts +27 -0
  222. package/node/components/TreeLikeAutocomplete/OptionsModal/styles.js +45 -2
  223. package/node/components/TreeLikeAutocomplete/OptionsModal/useLogic/useLogic.d.ts +1 -0
  224. package/node/components/TreeLikeAutocomplete/OptionsModal/useLogic/useLogic.js +14 -1
  225. package/node/components/TreeLikeList/TreeItem/TreeItem.js +9 -2
  226. package/node/components/TreeLikeList/TreeItem/styles.d.ts +14 -17
  227. package/node/components/TreeLikeList/TreeItem/styles.js +48 -1
  228. package/node/components/TreeLikeList/TreeItem/useLogic/useLogic.d.ts +8 -2
  229. package/node/components/TreeLikeList/TreeItem/useLogic/useLogic.js +34 -12
  230. package/node/components/TreeLikeList/TreeLikeList.js +1 -1
  231. package/node/components/TreeLikeList/styles.d.ts +4 -0
  232. package/node/components/TreeLikeList/styles.js +26 -1
  233. package/package.json +1 -1
@@ -3,16 +3,10 @@
3
3
  export declare const Item: import("../../styled").StyledComponent<{
4
4
  theme?: import("@emotion/react").Theme | undefined;
5
5
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
6
- } & {
7
- $level: number;
8
6
  }, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
9
7
  export declare const ItemContent: import("../../styled").StyledComponent<{
10
8
  theme?: import("@emotion/react").Theme | undefined;
11
9
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
12
- } & {
13
- $isSelected: boolean;
14
- $isDisabled: boolean;
15
- $level: number;
16
10
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
17
11
  export declare const CollapseButton: import("../../styled").StyledComponent<Omit<import("../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
18
12
  variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
@@ -23,8 +17,6 @@ export declare const CollapseButton: import("../../styled").StyledComponent<Omit
23
17
  size?: "large" | "medium" | undefined;
24
18
  } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
25
19
  theme?: import("@emotion/react").Theme | undefined;
26
- } & {
27
- $isNotBlockingExpandList?: boolean | undefined;
28
20
  }, {}, {}>;
29
21
  export declare const ChevronIcon: import("../../styled").StyledComponent<{
30
22
  children?: import("react").ReactNode;
@@ -33,14 +25,10 @@ export declare const ChevronIcon: import("../../styled").StyledComponent<{
33
25
  size?: "sm" | "md" | "auto" | undefined;
34
26
  } & import("react").SVGProps<SVGSVGElement> & {
35
27
  theme?: import("@emotion/react").Theme | undefined;
36
- } & {
37
- $isActive?: boolean | undefined;
38
28
  }, {}, {}>;
39
29
  export declare const LabelWrapper: import("../../styled").StyledComponent<{
40
30
  theme?: import("@emotion/react").Theme | undefined;
41
31
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
42
- } & {
43
- $level: number;
44
32
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
45
33
  export declare const Label: import("../../styled").StyledComponent<import("../../Typography/types").TypographyPropsBase & {
46
34
  color?: import("../../Typography").TypographyColor | undefined;
@@ -344,7 +332,7 @@ export declare const Note: import("../../styled").StyledComponent<import("../../
344
332
  onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
345
333
  open?: boolean | undefined;
346
334
  width?: import("csstype").Property.Width<string | number> | undefined;
347
- size?: import("../..").TooltipSize | undefined;
335
+ size?: import("../../Tooltip").TooltipSize | undefined;
348
336
  componentsProps?: {
349
337
  popper?: (Partial<import("@mui/material").PopperProps> & import("@mui/material").TooltipComponentsPropsOverrides) | undefined;
350
338
  transition?: (import("@mui/material/transitions").TransitionProps & import("@mui/material").TooltipComponentsPropsOverrides) | undefined;
@@ -406,3 +394,6 @@ export declare const ItemWrapper: import("../../styled").StyledComponent<{
406
394
  theme?: import("@emotion/react").Theme | undefined;
407
395
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
408
396
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
397
+ export declare const StyledCollapse: import("../../styled").StyledComponent<import("../../Collapse").CollapseProps & {
398
+ theme?: import("@emotion/react").Theme | undefined;
399
+ }, {}, {}>;
@@ -1,24 +1,20 @@
1
1
  import { typographyClasses } from '@mui/material/Typography';
2
2
  import { ChevronROutlineMd } from '../../../icons/ChevronROutlineMd';
3
3
  import { buttonClasses } from '../../Button';
4
+ import { Collapse } from '../../Collapse';
4
5
  import { descriptionClassnames } from '../../Description';
5
6
  import { IconButton } from '../../IconButton';
6
7
  import { OverflowTypography } from '../../OverflowTypography';
7
8
  import { svgIconClassnames } from '../../SvgIcon';
8
9
  import { styled } from '../../styled';
10
+ import { tooltipClassnames } from '../../Tooltip';
9
11
  import { Typography } from '../../Typography';
10
- import { COLLAPSE_BUTTON_WIDTH, GAP_WIDTH, HALF_PADDING_COLLAPSE_BUTTON_WIDTH, TREE_LINE_WIDTH, } from './constants';
11
- const getBackgroundColor = (theme, isSelected, isDisabled) => {
12
- if (isDisabled) {
13
- return 'transparent';
14
- }
15
- return isSelected
16
- ? theme.palette.primary[100]
17
- : theme.palette.background.elementHover;
18
- };
12
+ import { COLLAPSE_BUTTON_WIDTH, GAP_WIDTH, HALF_PADDING_COLLAPSE_BUTTON_WIDTH, MOBILE_COLLAPSE_BUTTON_WIDTH, TREE_LINE_WIDTH, treeClassnames, } from './constants';
19
13
  export const Item = styled('li', {
20
- shouldForwardProp: (prop) => !['as', '$level'].includes(prop),
14
+ shouldForwardProp: (prop) => !['as'].includes(prop),
21
15
  }) `
16
+ --tree-item-level: 0;
17
+
22
18
  position: relative;
23
19
 
24
20
  &:not(:last-of-type)::before {
@@ -27,18 +23,29 @@ export const Item = styled('li', {
27
23
  position: absolute;
28
24
  z-index: 1;
29
25
  top: 0;
30
- transform: ${({ $level }) => `translateX(calc(((${COLLAPSE_BUTTON_WIDTH} + ${GAP_WIDTH}) * ${$level}) - ${HALF_PADDING_COLLAPSE_BUTTON_WIDTH}))`};
26
+ transform: translateX(
27
+ calc(
28
+ ((${COLLAPSE_BUTTON_WIDTH} + ${GAP_WIDTH}) * var(--tree-item-level)) -
29
+ ${HALF_PADDING_COLLAPSE_BUTTON_WIDTH}
30
+ )
31
+ );
31
32
 
32
33
  width: 0;
33
34
  height: 100%;
34
35
 
35
36
  border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
36
37
  }
38
+
39
+ ${({ theme }) => theme.breakpoints.down('sm')} {
40
+ position: static;
41
+
42
+ &:not(:last-of-type)::before {
43
+ display: none;
44
+ }
45
+ }
37
46
  `;
38
- export const ItemContent = styled('div', {
39
- shouldForwardProp: (prop) => !['$isSelected', '$isDisabled', '$level'].includes(prop),
40
- }) `
41
- cursor: ${({ $isDisabled }) => ($isDisabled ? 'default' : 'pointer')};
47
+ export const ItemContent = styled('div') `
48
+ cursor: pointer;
42
49
 
43
50
  position: relative;
44
51
 
@@ -46,11 +53,14 @@ export const ItemContent = styled('div', {
46
53
 
47
54
  min-height: 32px;
48
55
  padding: ${({ theme }) => theme.spacing(0, 4, 1, 0)};
49
- padding-left: ${({ theme, $level }) => `calc(${theme.spacing($level * 7)} + ${theme.spacing(7)})`};
50
56
 
51
- color: ${({ theme, $isDisabled }) => $isDisabled ? theme.palette.text.disabled : theme.palette.text.primary};
57
+ padding-left: ${({ theme }) => `calc(
58
+ var(--tree-item-level) * ${theme.spacing(7)} + ${theme.spacing(7)}`}
59
+ );
60
+
61
+ color: ${({ theme }) => theme.palette.text.primary};
52
62
 
53
- background-color: ${({ theme, $isSelected }) => $isSelected ? theme.palette.primary[100] : 'transparent'};
63
+ background-color: transparent;
54
64
 
55
65
  transition: ${({ theme }) => theme.transitions.create('background-color', {
56
66
  easing: theme.transitions.easing.easeIn,
@@ -58,54 +68,124 @@ export const ItemContent = styled('div', {
58
68
  })};
59
69
 
60
70
  &:hover {
61
- background-color: ${({ theme, $isSelected, $isDisabled }) => getBackgroundColor(theme, $isSelected, $isDisabled)};
71
+ background-color: ${({ theme }) => theme.palette.background.elementHover};
72
+ }
73
+
74
+ &.${treeClassnames.selected} {
75
+ background-color: ${({ theme }) => theme.palette.primary[100]};
76
+
77
+ &:hover, &:focus {
78
+ background-color: ${({ theme }) => theme.palette.primary[100]};
79
+ }
80
+ }
81
+
82
+ &.${treeClassnames.disabled} {
83
+ cursor: default;
84
+ color: ${({ theme }) => theme.palette.text.disabled};
85
+
86
+ &:hover, &:focus {
87
+ background-color: transparent;
88
+ }
62
89
  }
63
90
 
64
91
  &:focus {
65
- background-color: ${({ theme, $isSelected, $isDisabled }) => getBackgroundColor(theme, $isSelected, $isDisabled)};
92
+ background-color: ${({ theme }) => theme.palette.background.elementHover};
66
93
  border: 0;
67
94
  outline: 0;
68
95
  }
96
+
97
+ ${({ theme }) => theme.breakpoints.down('sm')} {
98
+ padding: ${({ theme }) => theme.microSpacing(6, 3)};
99
+
100
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
101
+
102
+
103
+ &.${treeClassnames.hasNested} {
104
+ padding-right: ${({ theme }) => theme.spacing(11)};
105
+ }
106
+
107
+ & .${tooltipClassnames.contentWrapper} {
108
+ width: 100%;
109
+ }
110
+
111
+ &:focus {
112
+ border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
113
+ }
114
+ }
69
115
  `;
70
- export const CollapseButton = styled(IconButton, {
71
- shouldForwardProp: (prop) => !['$isNotBlockingExpandList'].includes(prop),
72
- }) `
116
+ export const CollapseButton = styled(IconButton) `
73
117
  position: relative;
74
118
  z-index: 1;
75
119
 
76
120
  width: ${COLLAPSE_BUTTON_WIDTH};
77
- height: 24px;
121
+ height: ${COLLAPSE_BUTTON_WIDTH};
78
122
  margin-left: -${COLLAPSE_BUTTON_WIDTH};
79
123
 
80
- color: ${({ theme, $isNotBlockingExpandList }) => $isNotBlockingExpandList ? theme.palette.text.primary : 'inherit'};
124
+ color: inherit;
125
+
126
+ &.${treeClassnames.notBlockingExpandList} {
127
+ color: ${({ theme }) => theme.palette.text.primary};
128
+ }
81
129
 
82
- &.${buttonClasses.root} .${svgIconClassnames.root}, &.${buttonClasses.root} {
83
- width: 24px;
84
- height: 24px;
130
+ &.${buttonClasses.root} {
131
+ width: ${COLLAPSE_BUTTON_WIDTH};
132
+ height: ${COLLAPSE_BUTTON_WIDTH};
133
+ }
85
134
 
86
- ${({ theme }) => theme.breakpoints.down('sm')} {
87
- width: 24px;
88
- height: 24px;
89
- }
135
+ &.${buttonClasses.root} .${svgIconClassnames.root} {
136
+ width: ${COLLAPSE_BUTTON_WIDTH};
137
+ height: ${COLLAPSE_BUTTON_WIDTH};
90
138
  }
91
139
 
92
140
  &:hover {
93
141
  background-color: ${({ theme }) => theme.palette.grey[300]};
94
142
  }
143
+
144
+ &.${treeClassnames.open} .${svgIconClassnames.root} {
145
+ transform: rotateZ(90deg);
146
+ }
147
+
148
+ ${({ theme }) => theme.breakpoints.down('sm')} {
149
+ position: absolute;
150
+ top: 0;
151
+ right: 0;
152
+ bottom: 0;
153
+ z-index: 0;
154
+
155
+ width: ${MOBILE_COLLAPSE_BUTTON_WIDTH};
156
+ height: auto;
157
+ margin-left: 0;
158
+ padding: ${({ theme }) => theme.spacing(0, 4, 0, 8)};
159
+
160
+ border-radius: 0;
161
+
162
+ &.${treeClassnames.open} .${svgIconClassnames.root} {
163
+ transform: rotateZ(0deg);
164
+ }
165
+
166
+ &.${buttonClasses.root} {
167
+ width: ${MOBILE_COLLAPSE_BUTTON_WIDTH};
168
+ height: auto;
169
+ }
170
+
171
+ &:hover {
172
+ background-color: transparent;
173
+ }
174
+ }
95
175
  `;
96
- export const ChevronIcon = styled(ChevronROutlineMd, {
97
- shouldForwardProp: (prop) => prop !== '$isActive',
98
- }) `
99
- transform: rotateZ(${({ $isActive }) => ($isActive ? 90 : 0)}deg);
176
+ export const ChevronIcon = styled(ChevronROutlineMd) `
177
+ transform: rotateZ(0deg);
100
178
 
101
179
  transition: ${({ theme }) => theme.transitions.create('transform', {
102
180
  easing: theme.transitions.easing.sharp,
103
181
  duration: theme.transitions.duration.short,
104
182
  })};
183
+
184
+ ${({ theme }) => theme.breakpoints.down('sm')} {
185
+ transition: none;
186
+ }
105
187
  `;
106
- export const LabelWrapper = styled('div', {
107
- shouldForwardProp: (prop) => prop !== '$level',
108
- }) `
188
+ export const LabelWrapper = styled.div `
109
189
  position: relative;
110
190
 
111
191
  display: flex;
@@ -134,12 +214,33 @@ export const LabelWrapper = styled('div', {
134
214
  border-left: 1px solid ${({ theme }) => theme.palette.components.border.default};
135
215
  border-radius: 0 0 0 ${({ theme }) => theme.shape.small};
136
216
  }
217
+
218
+ ${({ theme }) => theme.breakpoints.down('sm')} {
219
+ position: static;
220
+
221
+ &::before {
222
+ display: none;
223
+ }
224
+
225
+ padding-top: 0;
226
+
227
+ gap: ${({ theme }) => theme.spacing(1)};
228
+ width: 100%;
229
+
230
+ justify-content: space-between;
231
+ }
137
232
  `;
138
233
  export const Label = styled(Typography) `
139
234
  display: flex;
140
235
  align-items: center;
141
236
 
142
237
  margin-left: ${({ theme }) => theme.spacing(1)};
238
+
239
+ ${({ theme }) => theme.breakpoints.down('sm')} {
240
+ margin-left: 0;
241
+ order: 1;
242
+ padding: ${({ theme }) => theme.microSpacing(1, 0)};
243
+ }
143
244
  `;
144
245
  export const Note = styled(OverflowTypography) `
145
246
  margin-left: ${({ theme }) => theme.spacing(1)};
@@ -150,8 +251,21 @@ export const Note = styled(OverflowTypography) `
150
251
  color: inherit;
151
252
  }
152
253
  }
254
+
255
+ ${({ theme }) => theme.breakpoints.down('sm')} {
256
+ margin-left: 0;
257
+ }
153
258
  `;
154
259
  export const ItemWrapper = styled.div `
155
260
  display: flex;
156
261
  flex-direction: column;
262
+
263
+ ${({ theme }) => theme.breakpoints.down('sm')} {
264
+ width: 100%;
265
+ }
266
+ `;
267
+ export const StyledCollapse = styled(Collapse) `
268
+ ${({ theme }) => theme.breakpoints.down('sm')} {
269
+ display: none;
270
+ }
157
271
  `;
@@ -67,4 +67,22 @@ export type TreeItemProps<TComponent extends ElementType = ElementType> = {
67
67
  * Функция, которая запускается при нажатии на элемент списка.
68
68
  */
69
69
  onClick?: (event: SyntheticEvent) => void;
70
+ /**
71
+ * Содержимое родителя в шапке мобильной панели.
72
+ * По умолчанию используется `label` / `renderItem`.
73
+ */
74
+ mobileHeaderLabel?: ReactNode;
75
+ /**
76
+ * Элемент справа от родителя в шапке мобильной панели.
77
+ */
78
+ mobileHeaderControl?: ReactNode;
79
+ /**
80
+ * Дополнительное содержимое под родителем в шапке мобильной панели.
81
+ */
82
+ mobileHeaderAdditionalContent?: ReactNode;
83
+ /**
84
+ * Вызывается при открытии и закрытии мобильной панели вложенных элементов.
85
+ * На десктопе не вызывается: там список раскрывается через Collapse.
86
+ */
87
+ onMobilePanelOpenChange?: (isOpen: boolean) => void;
70
88
  } & Omit<ComponentProps<TComponent>, ''>;
@@ -1,22 +1,36 @@
1
- import { type MouseEvent, type SyntheticEvent } from 'react';
1
+ import { type CSSProperties, type MouseEvent, type SyntheticEvent } from 'react';
2
2
  import { type TreeItemProps } from '../types';
3
- type UseLogicProps = TreeItemProps;
4
- export declare const useLogic: ({ id, prefixId, isDefaultExpanded, isForceExpanded, isDisabled, disabledReason, onClick, }: UseLogicProps) => {
3
+ type UseLogicProps = Omit<TreeItemProps, 'ref'>;
4
+ export declare const useLogic: ({ id, prefixId, label, note, renderItem, mobileHeaderLabel, mobileHeaderControl, mobileHeaderAdditionalContent, isDefaultExpanded, isForceExpanded, isDisabled, isSelected, disabledReason, level, onClick, onMobilePanelOpenChange, }: UseLogicProps) => {
5
5
  isOpen: boolean;
6
+ isMobileOpen: boolean;
7
+ isMobile: boolean;
6
8
  handleToggle: (event: MouseEvent<HTMLElement>) => void;
7
- handleClick: (event: SyntheticEvent<HTMLDivElement>) => void;
9
+ handleClose: (event: MouseEvent<HTMLElement>) => void;
10
+ handleClick: (event: SyntheticEvent<HTMLDivElement>) => any;
11
+ itemCssVars: CSSProperties;
8
12
  itemProps: {
9
13
  id: any;
10
14
  };
11
15
  itemContentProps: {
12
16
  tabIndex: number;
13
- onClick: (event: SyntheticEvent<HTMLDivElement>) => void;
14
- onKeyDown: (event: SyntheticEvent<HTMLDivElement>) => void;
17
+ onClick: (event: SyntheticEvent<HTMLDivElement>) => any;
18
+ onKeyDown: (event: SyntheticEvent<HTMLDivElement>) => any;
15
19
  };
16
20
  tooltipProps: {
17
- title: string | undefined;
21
+ title: any;
18
22
  withoutContainer: boolean;
19
23
  disableInteractive: boolean;
20
24
  };
25
+ mobileSlidePanelProps: {
26
+ id: any;
27
+ parentLabel: any;
28
+ parentNote: any;
29
+ parentControl: any;
30
+ parentAdditionalContent: any;
31
+ isParentSelected: any;
32
+ isParentDisabled: any;
33
+ onParentClick: any;
34
+ };
21
35
  };
22
36
  export {};
@@ -1,6 +1,9 @@
1
- import { useEffect, useState, } from 'react';
2
- export const useLogic = ({ id, prefixId, isDefaultExpanded = false, isForceExpanded, isDisabled, disabledReason, onClick, }) => {
1
+ import { useEffect, useMemo, useState, } from 'react';
2
+ import { useViewportType } from '../../../useViewportType';
3
+ export const useLogic = ({ id, prefixId, label, note, renderItem, mobileHeaderLabel, mobileHeaderControl, mobileHeaderAdditionalContent, isDefaultExpanded = false, isForceExpanded, isDisabled, isSelected, disabledReason, level = 0, onClick, onMobilePanelOpenChange, }) => {
4
+ const { isMobile } = useViewportType();
3
5
  const [isOpen, setOpen] = useState(isDefaultExpanded);
6
+ const [isMobileOpen, setMobileOpen] = useState(false);
4
7
  useEffect(() => {
5
8
  setOpen(isDefaultExpanded);
6
9
  }, []);
@@ -23,14 +26,39 @@ export const useLogic = ({ id, prefixId, isDefaultExpanded = false, isForceExpan
23
26
  };
24
27
  const handleToggle = (event) => {
25
28
  event.stopPropagation();
29
+ if (isMobile) {
30
+ const nextState = !isMobileOpen;
31
+ setMobileOpen(nextState);
32
+ onMobilePanelOpenChange?.(nextState);
33
+ return;
34
+ }
26
35
  setOpen((currentState) => !currentState);
27
36
  };
37
+ const handleClose = (event) => {
38
+ event.stopPropagation();
39
+ setMobileOpen(false);
40
+ onMobilePanelOpenChange?.(false);
41
+ };
28
42
  const idAttr = prefixId ? `${prefixId}${id}` : id;
29
43
  const tabIndex = isDisabled ? -1 : 0;
44
+ const itemCssVars = { '--tree-item-level': level };
45
+ const parentLabel = useMemo(() => {
46
+ if (mobileHeaderLabel != null) {
47
+ return mobileHeaderLabel;
48
+ }
49
+ if (renderItem) {
50
+ return renderItem({ label, note, id });
51
+ }
52
+ return label;
53
+ }, [mobileHeaderLabel, renderItem, label, note, id]);
30
54
  return {
31
55
  isOpen,
56
+ isMobileOpen,
57
+ isMobile,
32
58
  handleToggle,
59
+ handleClose,
33
60
  handleClick,
61
+ itemCssVars,
34
62
  itemProps: {
35
63
  id: idAttr,
36
64
  },
@@ -44,5 +72,15 @@ export const useLogic = ({ id, prefixId, isDefaultExpanded = false, isForceExpan
44
72
  withoutContainer: !isDisabled,
45
73
  disableInteractive: true,
46
74
  },
75
+ mobileSlidePanelProps: {
76
+ id,
77
+ parentLabel,
78
+ parentNote: note,
79
+ parentControl: mobileHeaderControl,
80
+ parentAdditionalContent: mobileHeaderAdditionalContent,
81
+ isParentSelected: isSelected,
82
+ isParentDisabled: isDisabled,
83
+ onParentClick: onClick,
84
+ },
47
85
  };
48
86
  };
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { TreeItem as BaseTreeItem } from '../../TreeItem';
3
- import { List } from './styles';
2
+ import { List, StyledFormControlLabel, StyledRadio, StyledTreeItem, } from './styles';
4
3
  import { useLogic } from './useLogic';
5
4
  export const TreeItem = (props) => {
6
- const { isSelected, isDefaultExpanded, isDisabled, disabledReason, nextLevel, handleChange, } = useLogic(props);
5
+ const { isSelected, isDefaultExpanded, isDisabled, disabledReason, nextLevel, handleChange, formControlLabelProps, } = useLogic(props);
7
6
  const { item, prefixId, level, renderItem, value, isInitialExpanded, expandedLevel, chainToSelectedItem, disabledItems, onChange, isObjectMode, } = props;
8
7
  const { id, label, note, children = [], options } = item;
8
+ const itemLabel = renderItem ? renderItem({ label, note, id }) : label;
9
9
  if (children.length) {
10
- return (_jsx(BaseTreeItem, { id: id, prefixId: prefixId, isSelected: isSelected, isDefaultExpanded: isDefaultExpanded, isForceExpanded: options?.isForceExpanded, isDisabled: isDisabled, disabledReason: disabledReason, component: "li", label: label, renderItem: renderItem, note: note, level: level, onClick: handleChange, children: _jsx(List, { children: children.map((child) => (_jsx(TreeItem, { item: child, prefixId: prefixId, renderItem: renderItem, level: nextLevel, isInitialExpanded: isInitialExpanded, expandedLevel: expandedLevel, chainToSelectedItem: chainToSelectedItem, disabledItems: disabledItems, value: value, onChange: onChange, isObjectMode: isObjectMode }, child.id))) }) }));
10
+ return (_jsx(StyledTreeItem, { id: id, prefixId: prefixId, isSelected: isSelected, isDefaultExpanded: isDefaultExpanded, isForceExpanded: options?.isForceExpanded, isDisabled: isDisabled, disabledReason: disabledReason, component: "li", label: _jsx(StyledFormControlLabel, { control: _jsx(StyledRadio, { checked: isSelected, disabled: isDisabled, value: id }), label: itemLabel, ...formControlLabelProps }), note: renderItem ? null : note, mobileHeaderLabel: itemLabel, mobileHeaderControl: _jsx(StyledRadio, { checked: isSelected, disabled: isDisabled, value: id, onChange: handleChange }), level: level, onClick: handleChange, children: _jsx(List, { children: children.map((child) => (_jsx(TreeItem, { item: child, prefixId: prefixId, renderItem: renderItem, level: nextLevel, isInitialExpanded: isInitialExpanded, expandedLevel: expandedLevel, chainToSelectedItem: chainToSelectedItem, disabledItems: disabledItems, value: value, onChange: onChange, isObjectMode: isObjectMode }, child.id))) }) }));
11
11
  }
12
- return (_jsx(BaseTreeItem, { id: id, prefixId: prefixId, isSelected: isSelected, isDisabled: isDisabled, disabledReason: disabledReason, component: "li", label: label, renderItem: renderItem, note: note, level: level, onClick: handleChange }));
12
+ return (_jsx(StyledTreeItem, { id: id, prefixId: prefixId, isSelected: isSelected, isDisabled: isDisabled, disabledReason: disabledReason, note: renderItem ? null : note, component: "li", label: _jsx(StyledFormControlLabel, { control: _jsx(StyledRadio, { checked: isSelected, disabled: isDisabled, value: id }), label: itemLabel, ...formControlLabelProps }), level: level, onClick: handleChange }));
13
13
  };
@@ -1,5 +1,24 @@
1
1
  /// <reference types="react" />
2
+ export declare const StyledRadio: import("../../../styled").StyledComponent<import("react").HTMLAttributes<HTMLDivElement> & {
3
+ checked?: boolean | undefined;
4
+ isError?: boolean | undefined;
5
+ onChange?: ((event: import("react").ChangeEvent<HTMLInputElement, Element>, checked: boolean) => void) | undefined;
6
+ name?: string | undefined;
7
+ value?: string | undefined;
8
+ autoFocus?: boolean | undefined;
9
+ disabled?: boolean | undefined;
10
+ style?: import("react").CSSProperties | undefined;
11
+ inputRef?: import("react").RefObject<HTMLInputElement> | undefined;
12
+ } & import("react").RefAttributes<HTMLInputElement> & {
13
+ theme?: import("@emotion/react").Theme | undefined;
14
+ }, {}, {}>;
15
+ export declare const StyledTreeItem: import("../../../styled").StyledComponent<Omit<import("../../TreeItem").TreeItemProps, "ref"> & import("react").RefAttributes<HTMLLIElement> & {
16
+ theme?: import("@emotion/react").Theme | undefined;
17
+ }, {}, {}>;
2
18
  export declare const List: import("../../../styled").StyledComponent<{
3
19
  theme?: import("@emotion/react").Theme | undefined;
4
20
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
21
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
22
+ export declare const StyledFormControlLabel: import("../../../styled").StyledComponent<import("@mui/material/FormControlLabel").FormControlLabelProps & {
23
+ theme?: import("@emotion/react").Theme | undefined;
24
+ }, {}, {}>;
@@ -1,5 +1,41 @@
1
+ import FormControlLabel, { formControlLabelClasses, } from '@mui/material/FormControlLabel';
2
+ import { MOBILE_RADIO_SIZE, Radio, radioClassnames } from '../../../Radio';
1
3
  import { styled } from '../../../styled';
2
4
  import { listContainer } from '../../../styled/mixins';
5
+ import { TreeItem, treeClassnames } from '../../TreeItem';
6
+ export const StyledRadio = styled(Radio) `
7
+ ${({ theme }) => theme.breakpoints.up('sm')} {
8
+ display: none;
9
+ }
10
+
11
+ ${({ theme }) => theme.breakpoints.down('sm')} {
12
+ height: 20px;
13
+
14
+ & .${radioClassnames.iconWrapper}, & .${radioClassnames.input} {
15
+ height: 20px;
16
+ }
17
+ }
18
+ `;
19
+ export const StyledTreeItem = styled(TreeItem) `
20
+ ${({ theme }) => theme.breakpoints.down('sm')} {
21
+ .${treeClassnames.note} {
22
+
23
+ /* Добавляем к отступу ширину контейнера с радио кнопкой */
24
+ margin-left: ${({ theme }) => `calc(${theme.spacing(1)} + ${MOBILE_RADIO_SIZE})`};
25
+ }
26
+ }
27
+ `;
3
28
  export const List = styled.ul `
4
29
  ${listContainer}
5
30
  `;
31
+ export const StyledFormControlLabel = styled(FormControlLabel) `
32
+ margin-left: 0;
33
+
34
+ & .${formControlLabelClasses.label} {
35
+ margin-left: 0;
36
+ }
37
+
38
+ ${({ theme }) => theme.breakpoints.down('sm')} {
39
+ gap: ${({ theme }) => theme.spacing(1)};
40
+ }
41
+ `;
@@ -1,3 +1,4 @@
1
+ import { type SyntheticEvent } from 'react';
1
2
  import type { TreeListItemValue } from '../../types';
2
3
  import { type TreeItemProps } from '../types';
3
4
  type UseLogicProps<TValue extends TreeListItemValue = string> = TreeItemProps<TValue>;
@@ -8,5 +9,10 @@ export declare const useLogic: <TValue extends TreeListItemValue = string>({ val
8
9
  disabledReason: string | undefined;
9
10
  nextLevel: number;
10
11
  handleChange: () => void | undefined;
12
+ formControlLabelProps: {
13
+ disabled: boolean;
14
+ onChange: () => void | undefined;
15
+ onClick: (event: SyntheticEvent) => void;
16
+ };
11
17
  };
12
18
  export {};
@@ -27,6 +27,12 @@ export const useLogic = ({ value, level, item, isInitialExpanded, expandedLevel,
27
27
  }
28
28
  return onChange?.(id);
29
29
  };
30
+ /**
31
+ * Предотвращаем всплытие события, так как клик в области radio или label вызывает обработчик на уровне всего item
32
+ */
33
+ const handleClick = (event) => {
34
+ event.stopPropagation();
35
+ };
30
36
  return {
31
37
  isSelected,
32
38
  isDefaultExpanded,
@@ -34,5 +40,10 @@ export const useLogic = ({ value, level, item, isInitialExpanded, expandedLevel,
34
40
  disabledReason,
35
41
  nextLevel,
36
42
  handleChange,
43
+ formControlLabelProps: {
44
+ disabled: isDisabled,
45
+ onChange: handleChange,
46
+ onClick: handleClick,
47
+ },
37
48
  };
38
49
  };
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn } from '../../utils/cn';
3
3
  import { treeListClassnames } from './constants';
4
- import { List } from './styles';
4
+ import { List, ListWrapper } from './styles';
5
5
  import { TreeItem } from './TreeItem';
6
6
  import { useLogic } from './useLogic';
7
7
  const INITIAL_LEVEL = 0;
8
8
  export const TreeList = (props) => {
9
9
  const { listProps, itemProps } = useLogic(props);
10
10
  const { data, className, expandedLevel = 10, disabledItems, ...restProps } = props;
11
- return (_jsx(List, { className: cn(className, treeListClassnames.list), ...listProps, children: data.map((item) => (_jsx(TreeItem, { item: item, level: INITIAL_LEVEL, expandedLevel: expandedLevel, ...itemProps, ...restProps }, item.id))) }));
11
+ return (_jsx(ListWrapper, { children: _jsx(List, { className: cn(className, treeListClassnames.list), ...listProps, children: data.map((item) => (_jsx(TreeItem, { item: item, level: INITIAL_LEVEL, expandedLevel: expandedLevel, ...itemProps, ...restProps }, item.id))) }) }));
12
12
  };
@@ -1,4 +1,8 @@
1
1
  /// <reference types="react" />
2
+ export declare const ListWrapper: 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>, {}>;
2
6
  export declare const List: import("../../styled").StyledComponent<{
3
7
  theme?: import("@emotion/react").Theme | undefined;
4
8
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -1,6 +1,32 @@
1
1
  import { styled } from '../../styled';
2
2
  import { listContainer } from '../../styled/mixins';
3
+ export const ListWrapper = styled.div `
4
+ display: contents;
5
+
6
+ ${({ theme }) => theme.breakpoints.down('sm')} {
7
+ position: relative;
8
+ z-index: 0;
9
+
10
+ display: flex;
11
+ flex-direction: column;
12
+
13
+ height: 100%;
14
+ min-height: 0;
15
+
16
+ overflow: hidden;
17
+
18
+ transform: translateZ(0);
19
+ }
20
+ `;
3
21
  export const List = styled.ul `
4
22
  ${listContainer};
23
+ position: relative;
5
24
  overflow: hidden;
25
+
26
+ ${({ theme }) => theme.breakpoints.down('sm')} {
27
+ flex-grow: 1;
28
+ min-height: 0;
29
+
30
+ overflow-y: auto;
31
+ }
6
32
  `;