@mantine/core 9.6.2 → 9.7.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 (436) hide show
  1. package/cjs/components/ActionBar/ActionBar.cjs +0 -3
  2. package/cjs/components/ActionBar/ActionBar.cjs.map +1 -1
  3. package/cjs/components/ActionBar/ActionBar.module.cjs.map +1 -1
  4. package/cjs/components/AppShell/AppShell.cjs +33 -6
  5. package/cjs/components/AppShell/AppShell.cjs.map +1 -1
  6. package/cjs/components/AppShell/AppShell.context.cjs.map +1 -1
  7. package/cjs/components/AppShell/AppShell.module.cjs +2 -1
  8. package/cjs/components/AppShell/AppShell.module.cjs.map +1 -1
  9. package/cjs/components/AppShell/AppShellAside/AppShellAside.cjs +28 -7
  10. package/cjs/components/AppShell/AppShellAside/AppShellAside.cjs.map +1 -1
  11. package/cjs/components/AppShell/AppShellFooter/AppShellFooter.cjs +28 -7
  12. package/cjs/components/AppShell/AppShellFooter/AppShellFooter.cjs.map +1 -1
  13. package/cjs/components/AppShell/AppShellHeader/AppShellHeader.cjs +28 -7
  14. package/cjs/components/AppShell/AppShellHeader/AppShellHeader.cjs.map +1 -1
  15. package/cjs/components/AppShell/AppShellMediaStyles/AppShellMediaStyles.cjs +3 -2
  16. package/cjs/components/AppShell/AppShellMediaStyles/AppShellMediaStyles.cjs.map +1 -1
  17. package/cjs/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.cjs +27 -16
  18. package/cjs/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.cjs.map +1 -1
  19. package/cjs/components/AppShell/AppShellMediaStyles/assign-footer-variables/assign-footer-variables.cjs +24 -16
  20. package/cjs/components/AppShell/AppShellMediaStyles/assign-footer-variables/assign-footer-variables.cjs.map +1 -1
  21. package/cjs/components/AppShell/AppShellMediaStyles/assign-header-variables/assign-header-variables.cjs +24 -16
  22. package/cjs/components/AppShell/AppShellMediaStyles/assign-header-variables/assign-header-variables.cjs.map +1 -1
  23. package/cjs/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.cjs +30 -19
  24. package/cjs/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.cjs.map +1 -1
  25. package/cjs/components/AppShell/AppShellMediaStyles/escape-css-id/escape-css-id.cjs +26 -0
  26. package/cjs/components/AppShell/AppShellMediaStyles/escape-css-id/escape-css-id.cjs.map +1 -0
  27. package/cjs/components/AppShell/AppShellMediaStyles/get-resized-value/get-resized-value.cjs +10 -0
  28. package/cjs/components/AppShell/AppShellMediaStyles/get-resized-value/get-resized-value.cjs.map +1 -0
  29. package/cjs/components/AppShell/AppShellMediaStyles/get-variables/get-variables.cjs +13 -5
  30. package/cjs/components/AppShell/AppShellMediaStyles/get-variables/get-variables.cjs.map +1 -1
  31. package/cjs/components/AppShell/AppShellNavbar/AppShellNavbar.cjs +28 -7
  32. package/cjs/components/AppShell/AppShellNavbar/AppShellNavbar.cjs.map +1 -1
  33. package/cjs/components/AppShell/AppShellResizeHandle/AppShellResizeHandle.cjs +270 -0
  34. package/cjs/components/AppShell/AppShellResizeHandle/AppShellResizeHandle.cjs.map +1 -0
  35. package/cjs/components/AppShell/use-app-shell-resize/clamp-resize-size.cjs +15 -0
  36. package/cjs/components/AppShell/use-app-shell-resize/clamp-resize-size.cjs.map +1 -0
  37. package/cjs/components/AppShell/use-app-shell-resize/resize-section-config.cjs +51 -0
  38. package/cjs/components/AppShell/use-app-shell-resize/resize-section-config.cjs.map +1 -0
  39. package/cjs/components/AppShell/use-app-shell-resize/safe-area-inset.cjs +12 -0
  40. package/cjs/components/AppShell/use-app-shell-resize/safe-area-inset.cjs.map +1 -0
  41. package/cjs/components/AppShell/use-app-shell-resize/use-app-shell-resize.cjs +127 -0
  42. package/cjs/components/AppShell/use-app-shell-resize/use-app-shell-resize.cjs.map +1 -0
  43. package/cjs/components/AppShell/use-resizing/use-resizing.cjs +20 -2
  44. package/cjs/components/AppShell/use-resizing/use-resizing.cjs.map +1 -1
  45. package/cjs/components/Checkbox/Checkbox.cjs +10 -2
  46. package/cjs/components/Checkbox/Checkbox.cjs.map +1 -1
  47. package/cjs/components/Checkbox/Checkbox.module.cjs +1 -0
  48. package/cjs/components/Checkbox/Checkbox.module.cjs.map +1 -1
  49. package/cjs/components/Checkbox/CheckboxIndicator/CheckboxIndicator.cjs +10 -2
  50. package/cjs/components/Checkbox/CheckboxIndicator/CheckboxIndicator.cjs.map +1 -1
  51. package/cjs/components/Checkbox/CheckboxIndicator/CheckboxIndicator.module.cjs +1 -0
  52. package/cjs/components/Checkbox/CheckboxIndicator/CheckboxIndicator.module.cjs.map +1 -1
  53. package/cjs/components/ComboboxPopover/ComboboxPopover.cjs.map +1 -1
  54. package/cjs/components/Dialog/Dialog.cjs +0 -1
  55. package/cjs/components/Dialog/Dialog.cjs.map +1 -1
  56. package/cjs/components/Dialog/Dialog.module.cjs.map +1 -1
  57. package/cjs/components/HoverCard/HoverCard.cjs +34 -5
  58. package/cjs/components/HoverCard/HoverCard.cjs.map +1 -1
  59. package/cjs/components/HoverCard/HoverCard.context.cjs.map +1 -1
  60. package/cjs/components/HoverCard/HoverCardDropdown/HoverCardDropdown.cjs +13 -18
  61. package/cjs/components/HoverCard/HoverCardDropdown/HoverCardDropdown.cjs.map +1 -1
  62. package/cjs/components/HoverCard/HoverCardTarget/HoverCardTarget.cjs +6 -23
  63. package/cjs/components/HoverCard/HoverCardTarget/HoverCardTarget.cjs.map +1 -1
  64. package/cjs/components/HoverCard/use-hover-card.cjs +26 -12
  65. package/cjs/components/HoverCard/use-hover-card.cjs.map +1 -1
  66. package/cjs/components/Input/InputWrapper/InputWrapper.cjs +1 -1
  67. package/cjs/components/Input/InputWrapper/InputWrapper.cjs.map +1 -1
  68. package/cjs/components/Marquee/Marquee.cjs.map +1 -1
  69. package/cjs/components/Marquee/Marquee.module.cjs.map +1 -1
  70. package/cjs/components/PasswordInput/PasswordInput.cjs +10 -5
  71. package/cjs/components/PasswordInput/PasswordInput.cjs.map +1 -1
  72. package/cjs/components/PinInput/PinInput.cjs.map +1 -1
  73. package/cjs/components/Portal/Portal.cjs +10 -1
  74. package/cjs/components/Portal/Portal.cjs.map +1 -1
  75. package/cjs/components/Radio/Radio.cjs +10 -2
  76. package/cjs/components/Radio/Radio.cjs.map +1 -1
  77. package/cjs/components/Radio/Radio.module.cjs +1 -0
  78. package/cjs/components/Radio/Radio.module.cjs.map +1 -1
  79. package/cjs/components/Radio/RadioIndicator/RadioIndicator.cjs +10 -2
  80. package/cjs/components/Radio/RadioIndicator/RadioIndicator.cjs.map +1 -1
  81. package/cjs/components/Radio/RadioIndicator/RadioIndicator.module.cjs +1 -0
  82. package/cjs/components/Radio/RadioIndicator/RadioIndicator.module.cjs.map +1 -1
  83. package/cjs/components/Rating/Rating.cjs +35 -12
  84. package/cjs/components/Rating/Rating.cjs.map +1 -1
  85. package/cjs/components/Select/Select.cjs +1 -1
  86. package/cjs/components/Select/Select.cjs.map +1 -1
  87. package/cjs/components/Slider/Thumb/Thumb.cjs +7 -2
  88. package/cjs/components/Slider/Thumb/Thumb.cjs.map +1 -1
  89. package/cjs/components/Table/Table.cjs +23 -10
  90. package/cjs/components/Table/Table.cjs.map +1 -1
  91. package/cjs/components/Toggle/Toggle.cjs +80 -0
  92. package/cjs/components/Toggle/Toggle.cjs.map +1 -0
  93. package/cjs/components/Toggle/Toggle.module.cjs +7 -0
  94. package/cjs/components/Toggle/Toggle.module.cjs.map +1 -0
  95. package/cjs/components/Toolbar/Toolbar.cjs +107 -0
  96. package/cjs/components/Toolbar/Toolbar.cjs.map +1 -0
  97. package/cjs/components/Toolbar/Toolbar.context.cjs +8 -0
  98. package/cjs/components/Toolbar/Toolbar.context.cjs.map +1 -0
  99. package/cjs/components/Toolbar/Toolbar.module.cjs +12 -0
  100. package/cjs/components/Toolbar/Toolbar.module.cjs.map +1 -0
  101. package/cjs/components/Toolbar/ToolbarDivider/ToolbarDivider.cjs +31 -0
  102. package/cjs/components/Toolbar/ToolbarDivider/ToolbarDivider.cjs.map +1 -0
  103. package/cjs/components/Toolbar/ToolbarGroup/ToolbarGroup.cjs +31 -0
  104. package/cjs/components/Toolbar/ToolbarGroup/ToolbarGroup.cjs.map +1 -0
  105. package/cjs/components/Toolbar/ToolbarToggle/ToolbarToggle.cjs +47 -0
  106. package/cjs/components/Toolbar/ToolbarToggle/ToolbarToggle.cjs.map +1 -0
  107. package/cjs/components/Toolbar/ToolbarToggleGroup/ToolbarToggleGroup.cjs +61 -0
  108. package/cjs/components/Toolbar/ToolbarToggleGroup/ToolbarToggleGroup.cjs.map +1 -0
  109. package/cjs/components/Toolbar/ToolbarToggleGroup/ToolbarToggleGroup.context.cjs +8 -0
  110. package/cjs/components/Toolbar/ToolbarToggleGroup/ToolbarToggleGroup.context.cjs.map +1 -0
  111. package/cjs/components/Toolbar/ToolbarToggleItem/ToolbarToggleItem.cjs +51 -0
  112. package/cjs/components/Toolbar/ToolbarToggleItem/ToolbarToggleItem.cjs.map +1 -0
  113. package/cjs/components/Toolbar/use-toolbar-navigation.cjs +76 -0
  114. package/cjs/components/Toolbar/use-toolbar-navigation.cjs.map +1 -0
  115. package/cjs/components/Tooltip/Tooltip.cjs +9 -5
  116. package/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
  117. package/cjs/components/Tooltip/use-tooltip.cjs +6 -3
  118. package/cjs/components/Tooltip/use-tooltip.cjs.map +1 -1
  119. package/cjs/components/Tour/Tour.cjs +283 -0
  120. package/cjs/components/Tour/Tour.cjs.map +1 -0
  121. package/cjs/components/Tour/Tour.context.cjs +25 -0
  122. package/cjs/components/Tour/Tour.context.cjs.map +1 -0
  123. package/cjs/components/Tour/Tour.module.cjs +19 -0
  124. package/cjs/components/Tour/Tour.module.cjs.map +1 -0
  125. package/cjs/components/Tour/TourBeacon/TourBeacon.cjs +54 -0
  126. package/cjs/components/Tour/TourBeacon/TourBeacon.cjs.map +1 -0
  127. package/cjs/components/Tour/TourBeaconPositioned.cjs +46 -0
  128. package/cjs/components/Tour/TourBeaconPositioned.cjs.map +1 -0
  129. package/cjs/components/Tour/TourBody/TourBody.cjs +37 -0
  130. package/cjs/components/Tour/TourBody/TourBody.cjs.map +1 -0
  131. package/cjs/components/Tour/TourCloseButton/TourCloseButton.cjs +26 -0
  132. package/cjs/components/Tour/TourCloseButton/TourCloseButton.cjs.map +1 -0
  133. package/cjs/components/Tour/TourNavigation/TourNavigation.cjs +63 -0
  134. package/cjs/components/Tour/TourNavigation/TourNavigation.cjs.map +1 -0
  135. package/cjs/components/Tour/TourOverlay/TourOverlay.cjs +70 -0
  136. package/cjs/components/Tour/TourOverlay/TourOverlay.cjs.map +1 -0
  137. package/cjs/components/Tour/TourRoot/TourRoot.cjs +125 -0
  138. package/cjs/components/Tour/TourRoot/TourRoot.cjs.map +1 -0
  139. package/cjs/components/Tour/TourStep/TourStep.cjs +10 -0
  140. package/cjs/components/Tour/TourStep/TourStep.cjs.map +1 -0
  141. package/cjs/components/Tour/TourTitle/TourTitle.cjs +38 -0
  142. package/cjs/components/Tour/TourTitle/TourTitle.cjs.map +1 -0
  143. package/cjs/components/Tour/TourTooltip/TourTooltip.cjs +87 -0
  144. package/cjs/components/Tour/TourTooltip/TourTooltip.cjs.map +1 -0
  145. package/cjs/components/Tour/get-overlay-hit-path.cjs +17 -0
  146. package/cjs/components/Tour/get-overlay-hit-path.cjs.map +1 -0
  147. package/cjs/components/Tour/is-element-in-view.cjs +30 -0
  148. package/cjs/components/Tour/is-element-in-view.cjs.map +1 -0
  149. package/cjs/components/Tour/press-aware-auto-update.cjs +38 -0
  150. package/cjs/components/Tour/press-aware-auto-update.cjs.map +1 -0
  151. package/cjs/components/Tour/use-target-rect.cjs +61 -0
  152. package/cjs/components/Tour/use-target-rect.cjs.map +1 -0
  153. package/cjs/components/Tour/use-tooltip-auto-focus.cjs +34 -0
  154. package/cjs/components/Tour/use-tooltip-auto-focus.cjs.map +1 -0
  155. package/cjs/components/Tour/use-tour-state.cjs +102 -0
  156. package/cjs/components/Tour/use-tour-state.cjs.map +1 -0
  157. package/cjs/components/Tour/use-tour.cjs +155 -0
  158. package/cjs/components/Tour/use-tour.cjs.map +1 -0
  159. package/cjs/components/TreeSelect/TreeSelect.cjs +29 -16
  160. package/cjs/components/TreeSelect/TreeSelect.cjs.map +1 -1
  161. package/cjs/core/Box/Box.cjs +1 -1
  162. package/cjs/core/Box/Box.cjs.map +1 -1
  163. package/cjs/core/Box/style-props/style-props-data.cjs +2 -2
  164. package/cjs/core/Box/style-props/style-props-data.cjs.map +1 -1
  165. package/cjs/core/styles-api/use-styles/use-styles.cjs +32 -2
  166. package/cjs/core/styles-api/use-styles/use-styles.cjs.map +1 -1
  167. package/cjs/core/utils/shallow-equal/shallow-equal.cjs +19 -0
  168. package/cjs/core/utils/shallow-equal/shallow-equal.cjs.map +1 -0
  169. package/cjs/index.cjs +42 -2
  170. package/esm/components/ActionBar/ActionBar.mjs +0 -3
  171. package/esm/components/ActionBar/ActionBar.mjs.map +1 -1
  172. package/esm/components/ActionBar/ActionBar.module.mjs.map +1 -1
  173. package/esm/components/AppShell/AppShell.context.mjs.map +1 -1
  174. package/esm/components/AppShell/AppShell.mjs +35 -8
  175. package/esm/components/AppShell/AppShell.mjs.map +1 -1
  176. package/esm/components/AppShell/AppShell.module.mjs +2 -1
  177. package/esm/components/AppShell/AppShell.module.mjs.map +1 -1
  178. package/esm/components/AppShell/AppShellAside/AppShellAside.mjs +29 -8
  179. package/esm/components/AppShell/AppShellAside/AppShellAside.mjs.map +1 -1
  180. package/esm/components/AppShell/AppShellFooter/AppShellFooter.mjs +29 -8
  181. package/esm/components/AppShell/AppShellFooter/AppShellFooter.mjs.map +1 -1
  182. package/esm/components/AppShell/AppShellHeader/AppShellHeader.mjs +29 -8
  183. package/esm/components/AppShell/AppShellHeader/AppShellHeader.mjs.map +1 -1
  184. package/esm/components/AppShell/AppShellMediaStyles/AppShellMediaStyles.mjs +3 -2
  185. package/esm/components/AppShell/AppShellMediaStyles/AppShellMediaStyles.mjs.map +1 -1
  186. package/esm/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.mjs +27 -16
  187. package/esm/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.mjs.map +1 -1
  188. package/esm/components/AppShell/AppShellMediaStyles/assign-footer-variables/assign-footer-variables.mjs +24 -16
  189. package/esm/components/AppShell/AppShellMediaStyles/assign-footer-variables/assign-footer-variables.mjs.map +1 -1
  190. package/esm/components/AppShell/AppShellMediaStyles/assign-header-variables/assign-header-variables.mjs +24 -16
  191. package/esm/components/AppShell/AppShellMediaStyles/assign-header-variables/assign-header-variables.mjs.map +1 -1
  192. package/esm/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.mjs +30 -19
  193. package/esm/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.mjs.map +1 -1
  194. package/esm/components/AppShell/AppShellMediaStyles/escape-css-id/escape-css-id.mjs +26 -0
  195. package/esm/components/AppShell/AppShellMediaStyles/escape-css-id/escape-css-id.mjs.map +1 -0
  196. package/esm/components/AppShell/AppShellMediaStyles/get-resized-value/get-resized-value.mjs +10 -0
  197. package/esm/components/AppShell/AppShellMediaStyles/get-resized-value/get-resized-value.mjs.map +1 -0
  198. package/esm/components/AppShell/AppShellMediaStyles/get-variables/get-variables.mjs +13 -5
  199. package/esm/components/AppShell/AppShellMediaStyles/get-variables/get-variables.mjs.map +1 -1
  200. package/esm/components/AppShell/AppShellNavbar/AppShellNavbar.mjs +29 -8
  201. package/esm/components/AppShell/AppShellNavbar/AppShellNavbar.mjs.map +1 -1
  202. package/esm/components/AppShell/AppShellResizeHandle/AppShellResizeHandle.mjs +270 -0
  203. package/esm/components/AppShell/AppShellResizeHandle/AppShellResizeHandle.mjs.map +1 -0
  204. package/esm/components/AppShell/use-app-shell-resize/clamp-resize-size.mjs +14 -0
  205. package/esm/components/AppShell/use-app-shell-resize/clamp-resize-size.mjs.map +1 -0
  206. package/esm/components/AppShell/use-app-shell-resize/resize-section-config.mjs +49 -0
  207. package/esm/components/AppShell/use-app-shell-resize/resize-section-config.mjs.map +1 -0
  208. package/esm/components/AppShell/use-app-shell-resize/safe-area-inset.mjs +12 -0
  209. package/esm/components/AppShell/use-app-shell-resize/safe-area-inset.mjs.map +1 -0
  210. package/esm/components/AppShell/use-app-shell-resize/use-app-shell-resize.mjs +127 -0
  211. package/esm/components/AppShell/use-app-shell-resize/use-app-shell-resize.mjs.map +1 -0
  212. package/esm/components/AppShell/use-resizing/use-resizing.mjs +21 -3
  213. package/esm/components/AppShell/use-resizing/use-resizing.mjs.map +1 -1
  214. package/esm/components/Checkbox/Checkbox.mjs +10 -2
  215. package/esm/components/Checkbox/Checkbox.mjs.map +1 -1
  216. package/esm/components/Checkbox/Checkbox.module.mjs +1 -0
  217. package/esm/components/Checkbox/Checkbox.module.mjs.map +1 -1
  218. package/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.mjs +10 -2
  219. package/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.mjs.map +1 -1
  220. package/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.module.mjs +1 -0
  221. package/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.module.mjs.map +1 -1
  222. package/esm/components/ComboboxPopover/ComboboxPopover.mjs.map +1 -1
  223. package/esm/components/Dialog/Dialog.mjs +0 -1
  224. package/esm/components/Dialog/Dialog.mjs.map +1 -1
  225. package/esm/components/Dialog/Dialog.module.mjs.map +1 -1
  226. package/esm/components/HoverCard/HoverCard.context.mjs.map +1 -1
  227. package/esm/components/HoverCard/HoverCard.mjs +34 -5
  228. package/esm/components/HoverCard/HoverCard.mjs.map +1 -1
  229. package/esm/components/HoverCard/HoverCardDropdown/HoverCardDropdown.mjs +13 -18
  230. package/esm/components/HoverCard/HoverCardDropdown/HoverCardDropdown.mjs.map +1 -1
  231. package/esm/components/HoverCard/HoverCardTarget/HoverCardTarget.mjs +7 -24
  232. package/esm/components/HoverCard/HoverCardTarget/HoverCardTarget.mjs.map +1 -1
  233. package/esm/components/HoverCard/use-hover-card.mjs +27 -13
  234. package/esm/components/HoverCard/use-hover-card.mjs.map +1 -1
  235. package/esm/components/Input/InputWrapper/InputWrapper.mjs +1 -1
  236. package/esm/components/Input/InputWrapper/InputWrapper.mjs.map +1 -1
  237. package/esm/components/Marquee/Marquee.mjs.map +1 -1
  238. package/esm/components/Marquee/Marquee.module.mjs.map +1 -1
  239. package/esm/components/PasswordInput/PasswordInput.mjs +12 -7
  240. package/esm/components/PasswordInput/PasswordInput.mjs.map +1 -1
  241. package/esm/components/PinInput/PinInput.mjs.map +1 -1
  242. package/esm/components/Portal/Portal.mjs +10 -1
  243. package/esm/components/Portal/Portal.mjs.map +1 -1
  244. package/esm/components/Radio/Radio.mjs +10 -2
  245. package/esm/components/Radio/Radio.mjs.map +1 -1
  246. package/esm/components/Radio/Radio.module.mjs +1 -0
  247. package/esm/components/Radio/Radio.module.mjs.map +1 -1
  248. package/esm/components/Radio/RadioIndicator/RadioIndicator.mjs +10 -2
  249. package/esm/components/Radio/RadioIndicator/RadioIndicator.mjs.map +1 -1
  250. package/esm/components/Radio/RadioIndicator/RadioIndicator.module.mjs +1 -0
  251. package/esm/components/Radio/RadioIndicator/RadioIndicator.module.mjs.map +1 -1
  252. package/esm/components/Rating/Rating.mjs +35 -12
  253. package/esm/components/Rating/Rating.mjs.map +1 -1
  254. package/esm/components/Select/Select.mjs +1 -1
  255. package/esm/components/Select/Select.mjs.map +1 -1
  256. package/esm/components/Slider/Thumb/Thumb.mjs +7 -2
  257. package/esm/components/Slider/Thumb/Thumb.mjs.map +1 -1
  258. package/esm/components/Table/Table.mjs +23 -10
  259. package/esm/components/Table/Table.mjs.map +1 -1
  260. package/esm/components/Toggle/Toggle.mjs +80 -0
  261. package/esm/components/Toggle/Toggle.mjs.map +1 -0
  262. package/esm/components/Toggle/Toggle.module.mjs +7 -0
  263. package/esm/components/Toggle/Toggle.module.mjs.map +1 -0
  264. package/esm/components/Toolbar/Toolbar.context.mjs +8 -0
  265. package/esm/components/Toolbar/Toolbar.context.mjs.map +1 -0
  266. package/esm/components/Toolbar/Toolbar.mjs +107 -0
  267. package/esm/components/Toolbar/Toolbar.mjs.map +1 -0
  268. package/esm/components/Toolbar/Toolbar.module.mjs +12 -0
  269. package/esm/components/Toolbar/Toolbar.module.mjs.map +1 -0
  270. package/esm/components/Toolbar/ToolbarDivider/ToolbarDivider.mjs +31 -0
  271. package/esm/components/Toolbar/ToolbarDivider/ToolbarDivider.mjs.map +1 -0
  272. package/esm/components/Toolbar/ToolbarGroup/ToolbarGroup.mjs +31 -0
  273. package/esm/components/Toolbar/ToolbarGroup/ToolbarGroup.mjs.map +1 -0
  274. package/esm/components/Toolbar/ToolbarToggle/ToolbarToggle.mjs +47 -0
  275. package/esm/components/Toolbar/ToolbarToggle/ToolbarToggle.mjs.map +1 -0
  276. package/esm/components/Toolbar/ToolbarToggleGroup/ToolbarToggleGroup.context.mjs +8 -0
  277. package/esm/components/Toolbar/ToolbarToggleGroup/ToolbarToggleGroup.context.mjs.map +1 -0
  278. package/esm/components/Toolbar/ToolbarToggleGroup/ToolbarToggleGroup.mjs +61 -0
  279. package/esm/components/Toolbar/ToolbarToggleGroup/ToolbarToggleGroup.mjs.map +1 -0
  280. package/esm/components/Toolbar/ToolbarToggleItem/ToolbarToggleItem.mjs +51 -0
  281. package/esm/components/Toolbar/ToolbarToggleItem/ToolbarToggleItem.mjs.map +1 -0
  282. package/esm/components/Toolbar/use-toolbar-navigation.mjs +76 -0
  283. package/esm/components/Toolbar/use-toolbar-navigation.mjs.map +1 -0
  284. package/esm/components/Tooltip/Tooltip.mjs +9 -5
  285. package/esm/components/Tooltip/Tooltip.mjs.map +1 -1
  286. package/esm/components/Tooltip/use-tooltip.mjs +7 -4
  287. package/esm/components/Tooltip/use-tooltip.mjs.map +1 -1
  288. package/esm/components/Tour/Tour.context.mjs +22 -0
  289. package/esm/components/Tour/Tour.context.mjs.map +1 -0
  290. package/esm/components/Tour/Tour.mjs +283 -0
  291. package/esm/components/Tour/Tour.mjs.map +1 -0
  292. package/esm/components/Tour/Tour.module.mjs +19 -0
  293. package/esm/components/Tour/Tour.module.mjs.map +1 -0
  294. package/esm/components/Tour/TourBeacon/TourBeacon.mjs +54 -0
  295. package/esm/components/Tour/TourBeacon/TourBeacon.mjs.map +1 -0
  296. package/esm/components/Tour/TourBeaconPositioned.mjs +46 -0
  297. package/esm/components/Tour/TourBeaconPositioned.mjs.map +1 -0
  298. package/esm/components/Tour/TourBody/TourBody.mjs +37 -0
  299. package/esm/components/Tour/TourBody/TourBody.mjs.map +1 -0
  300. package/esm/components/Tour/TourCloseButton/TourCloseButton.mjs +26 -0
  301. package/esm/components/Tour/TourCloseButton/TourCloseButton.mjs.map +1 -0
  302. package/esm/components/Tour/TourNavigation/TourNavigation.mjs +63 -0
  303. package/esm/components/Tour/TourNavigation/TourNavigation.mjs.map +1 -0
  304. package/esm/components/Tour/TourOverlay/TourOverlay.mjs +70 -0
  305. package/esm/components/Tour/TourOverlay/TourOverlay.mjs.map +1 -0
  306. package/esm/components/Tour/TourRoot/TourRoot.mjs +125 -0
  307. package/esm/components/Tour/TourRoot/TourRoot.mjs.map +1 -0
  308. package/esm/components/Tour/TourStep/TourStep.mjs +10 -0
  309. package/esm/components/Tour/TourStep/TourStep.mjs.map +1 -0
  310. package/esm/components/Tour/TourTitle/TourTitle.mjs +38 -0
  311. package/esm/components/Tour/TourTitle/TourTitle.mjs.map +1 -0
  312. package/esm/components/Tour/TourTooltip/TourTooltip.mjs +87 -0
  313. package/esm/components/Tour/TourTooltip/TourTooltip.mjs.map +1 -0
  314. package/esm/components/Tour/get-overlay-hit-path.mjs +17 -0
  315. package/esm/components/Tour/get-overlay-hit-path.mjs.map +1 -0
  316. package/esm/components/Tour/is-element-in-view.mjs +30 -0
  317. package/esm/components/Tour/is-element-in-view.mjs.map +1 -0
  318. package/esm/components/Tour/press-aware-auto-update.mjs +38 -0
  319. package/esm/components/Tour/press-aware-auto-update.mjs.map +1 -0
  320. package/esm/components/Tour/use-target-rect.mjs +59 -0
  321. package/esm/components/Tour/use-target-rect.mjs.map +1 -0
  322. package/esm/components/Tour/use-tooltip-auto-focus.mjs +34 -0
  323. package/esm/components/Tour/use-tooltip-auto-focus.mjs.map +1 -0
  324. package/esm/components/Tour/use-tour-state.mjs +102 -0
  325. package/esm/components/Tour/use-tour-state.mjs.map +1 -0
  326. package/esm/components/Tour/use-tour.mjs +155 -0
  327. package/esm/components/Tour/use-tour.mjs.map +1 -0
  328. package/esm/components/TreeSelect/TreeSelect.mjs +30 -17
  329. package/esm/components/TreeSelect/TreeSelect.mjs.map +1 -1
  330. package/esm/core/Box/Box.mjs +2 -2
  331. package/esm/core/Box/Box.mjs.map +1 -1
  332. package/esm/core/Box/style-props/style-props-data.mjs +2 -2
  333. package/esm/core/Box/style-props/style-props-data.mjs.map +1 -1
  334. package/esm/core/styles-api/use-styles/use-styles.mjs +32 -2
  335. package/esm/core/styles-api/use-styles/use-styles.mjs.map +1 -1
  336. package/esm/core/utils/shallow-equal/shallow-equal.mjs +19 -0
  337. package/esm/core/utils/shallow-equal/shallow-equal.mjs.map +1 -0
  338. package/esm/index.mjs +22 -3
  339. package/lib/components/ActionBar/ActionBar.d.ts +1 -1
  340. package/lib/components/AppShell/AppShell.context.d.ts +4 -0
  341. package/lib/components/AppShell/AppShell.d.ts +5 -3
  342. package/lib/components/AppShell/AppShell.types.d.ts +70 -0
  343. package/lib/components/AppShell/AppShellMediaStyles/AppShellMediaStyles.d.ts +6 -1
  344. package/lib/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.d.ts +3 -1
  345. package/lib/components/AppShell/AppShellMediaStyles/assign-footer-variables/assign-footer-variables.d.ts +3 -1
  346. package/lib/components/AppShell/AppShellMediaStyles/assign-header-variables/assign-header-variables.d.ts +3 -1
  347. package/lib/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.d.ts +3 -1
  348. package/lib/components/AppShell/AppShellMediaStyles/escape-css-id/escape-css-id.d.ts +2 -0
  349. package/lib/components/AppShell/AppShellMediaStyles/get-resized-value/get-resized-value.d.ts +1 -0
  350. package/lib/components/AppShell/AppShellMediaStyles/get-variables/get-variables.d.ts +6 -1
  351. package/lib/components/AppShell/AppShellResizeHandle/AppShellResizeHandle.d.ts +10 -0
  352. package/lib/components/AppShell/index.d.ts +3 -2
  353. package/lib/components/AppShell/use-app-shell-resize/clamp-resize-size.d.ts +9 -0
  354. package/lib/components/AppShell/use-app-shell-resize/resize-section-config.d.ts +29 -0
  355. package/lib/components/AppShell/use-app-shell-resize/safe-area-inset.d.ts +1 -0
  356. package/lib/components/AppShell/use-app-shell-resize/use-app-shell-resize.d.ts +2 -0
  357. package/lib/components/AppShell/use-resizing/use-resizing.d.ts +2 -1
  358. package/lib/components/Checkbox/Checkbox.d.ts +2 -2
  359. package/lib/components/Checkbox/CheckboxIndicator/CheckboxIndicator.d.ts +2 -2
  360. package/lib/components/Combobox/Combobox.types.d.ts +1 -1
  361. package/lib/components/ComboboxPopover/ComboboxPopover.d.ts +1 -1
  362. package/lib/components/HoverCard/HoverCard.context.d.ts +8 -4
  363. package/lib/components/HoverCard/HoverCard.d.ts +41 -0
  364. package/lib/components/HoverCard/index.d.ts +1 -1
  365. package/lib/components/HoverCard/use-hover-card.d.ts +11 -0
  366. package/lib/components/Marquee/Marquee.d.ts +1 -1
  367. package/lib/components/PinInput/PinInput.d.ts +1 -1
  368. package/lib/components/Radio/Radio.d.ts +2 -2
  369. package/lib/components/Radio/RadioIndicator/RadioIndicator.d.ts +2 -2
  370. package/lib/components/Slider/Thumb/Thumb.d.ts +1 -1
  371. package/lib/components/Toggle/Toggle.d.ts +73 -0
  372. package/lib/components/Toggle/index.d.ts +7 -0
  373. package/lib/components/Toolbar/Toolbar.context.d.ts +7 -0
  374. package/lib/components/Toolbar/Toolbar.d.ts +58 -0
  375. package/lib/components/Toolbar/ToolbarDivider/ToolbarDivider.d.ts +16 -0
  376. package/lib/components/Toolbar/ToolbarGroup/ToolbarGroup.d.ts +16 -0
  377. package/lib/components/Toolbar/ToolbarToggle/ToolbarToggle.d.ts +44 -0
  378. package/lib/components/Toolbar/ToolbarToggleGroup/ToolbarToggleGroup.context.d.ts +7 -0
  379. package/lib/components/Toolbar/ToolbarToggleGroup/ToolbarToggleGroup.d.ts +42 -0
  380. package/lib/components/Toolbar/ToolbarToggleItem/ToolbarToggleItem.d.ts +22 -0
  381. package/lib/components/Toolbar/index.d.ts +32 -0
  382. package/lib/components/Toolbar/use-toolbar-navigation.d.ts +11 -0
  383. package/lib/components/Tooltip/Tooltip.d.ts +3 -1
  384. package/lib/components/Tooltip/use-tooltip.d.ts +2 -0
  385. package/lib/components/Tour/Tour.context.d.ts +66 -0
  386. package/lib/components/Tour/Tour.d.ts +144 -0
  387. package/lib/components/Tour/TourBeacon/TourBeacon.d.ts +23 -0
  388. package/lib/components/Tour/TourBeaconPositioned.d.ts +13 -0
  389. package/lib/components/Tour/TourBody/TourBody.d.ts +19 -0
  390. package/lib/components/Tour/TourCloseButton/TourCloseButton.d.ts +12 -0
  391. package/lib/components/Tour/TourNavigation/TourNavigation.d.ts +11 -0
  392. package/lib/components/Tour/TourOverlay/TourOverlay.d.ts +22 -0
  393. package/lib/components/Tour/TourRoot/TourRoot.d.ts +72 -0
  394. package/lib/components/Tour/TourStep/TourStep.d.ts +30 -0
  395. package/lib/components/Tour/TourTitle/TourTitle.d.ts +19 -0
  396. package/lib/components/Tour/TourTooltip/TourTooltip.d.ts +29 -0
  397. package/lib/components/Tour/get-overlay-hit-path.d.ts +2 -0
  398. package/lib/components/Tour/index.d.ts +23 -0
  399. package/lib/components/Tour/is-element-in-view.d.ts +1 -0
  400. package/lib/components/Tour/press-aware-auto-update.d.ts +2 -0
  401. package/lib/components/Tour/use-target-rect.d.ts +13 -0
  402. package/lib/components/Tour/use-tooltip-auto-focus.d.ts +7 -0
  403. package/lib/components/Tour/use-tour-state.d.ts +23 -0
  404. package/lib/components/Tour/use-tour.d.ts +40 -0
  405. package/lib/components/TreeSelect/TreeSelect.d.ts +14 -0
  406. package/lib/components/TreeSelect/index.d.ts +2 -2
  407. package/lib/components/index.d.ts +3 -0
  408. package/lib/core/Box/style-props/index.d.ts +1 -1
  409. package/lib/core/Box/style-props/style-props-data.d.ts +1 -1
  410. package/lib/core/styles-api/use-styles/use-styles.d.ts +2 -1
  411. package/lib/core/utils/shallow-equal/shallow-equal.d.ts +1 -0
  412. package/package.json +5 -5
  413. package/styles/ActionBar.css +1 -0
  414. package/styles/ActionBar.layer.css +1 -0
  415. package/styles/AppShell.css +68 -0
  416. package/styles/AppShell.layer.css +68 -0
  417. package/styles/Checkbox.css +20 -0
  418. package/styles/Checkbox.layer.css +20 -0
  419. package/styles/CheckboxIndicator.css +16 -0
  420. package/styles/CheckboxIndicator.layer.css +16 -0
  421. package/styles/Dialog.css +1 -0
  422. package/styles/Dialog.layer.css +1 -0
  423. package/styles/Marquee.css +1 -1
  424. package/styles/Marquee.layer.css +1 -1
  425. package/styles/Radio.css +10 -0
  426. package/styles/Radio.layer.css +10 -0
  427. package/styles/RadioIndicator.css +11 -0
  428. package/styles/RadioIndicator.layer.css +11 -0
  429. package/styles/Toggle.css +98 -0
  430. package/styles/Toggle.layer.css +99 -0
  431. package/styles/Toolbar.css +220 -0
  432. package/styles/Toolbar.layer.css +221 -0
  433. package/styles/Tour.css +127 -0
  434. package/styles/Tour.layer.css +128 -0
  435. package/styles.css +576 -1
  436. package/styles.layer.css +576 -1
@@ -0,0 +1,270 @@
1
+ "use client";
2
+ const require_rem = require("../../../core/utils/units-converters/rem.cjs");
3
+ const require_MantineThemeProvider = require("../../../core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs");
4
+ const require_Box = require("../../../core/Box/Box.cjs");
5
+ const require_DirectionProvider = require("../../../core/DirectionProvider/DirectionProvider.cjs");
6
+ const require_AppShell_context = require("../AppShell.context.cjs");
7
+ const require_clamp_resize_size = require("../use-app-shell-resize/clamp-resize-size.cjs");
8
+ const require_resize_section_config = require("../use-app-shell-resize/resize-section-config.cjs");
9
+ const require_safe_area_inset = require("../use-app-shell-resize/safe-area-inset.cjs");
10
+ let react = require("react");
11
+ let _mantine_hooks = require("@mantine/hooks");
12
+ let react_jsx_runtime = require("react/jsx-runtime");
13
+ //#region packages/@mantine/core/src/components/AppShell/AppShellResizeHandle/AppShellResizeHandle.tsx
14
+ const LABELS = {
15
+ navbar: "Resize navbar",
16
+ aside: "Resize aside",
17
+ header: "Resize header",
18
+ footer: "Resize footer"
19
+ };
20
+ const KEYBOARD_STEP = 10;
21
+ const KEYBOARD_SHIFT_STEP = 50;
22
+ const KEY_DELTAS = {
23
+ ArrowRight: {
24
+ deltaX: 1,
25
+ deltaY: 0
26
+ },
27
+ ArrowLeft: {
28
+ deltaX: -1,
29
+ deltaY: 0
30
+ },
31
+ ArrowDown: {
32
+ deltaX: 0,
33
+ deltaY: 1
34
+ },
35
+ ArrowUp: {
36
+ deltaX: 0,
37
+ deltaY: -1
38
+ }
39
+ };
40
+ function restoreBodyStyleProperty(property, value) {
41
+ if (value) document.body.style.setProperty(property, value);
42
+ else document.body.style.removeProperty(property);
43
+ }
44
+ function AppShellResizeHandle({ section, sectionId }) {
45
+ const ctx = require_AppShell_context.useAppShellContext();
46
+ const controller = ctx.resize;
47
+ const handleRef = (0, react.useRef)(null);
48
+ const dragRef = (0, react.useRef)({
49
+ startSize: 0,
50
+ startX: 0,
51
+ startY: 0,
52
+ size: 0,
53
+ moved: false
54
+ });
55
+ const activePointerIdRef = (0, react.useRef)(null);
56
+ const abortRef = (0, react.useRef)(null);
57
+ const previousBodyStylesRef = (0, react.useRef)(null);
58
+ const { dir } = require_DirectionProvider.useDirection();
59
+ const theme = require_MantineThemeProvider.useMantineTheme();
60
+ const config = require_resize_section_config.RESIZE_SECTIONS[section];
61
+ const options = controller?.options[section] ?? {};
62
+ const getViewportPx = () => config.axis === "horizontal" ? window.innerWidth : window.innerHeight;
63
+ const [viewportPx, setViewportPx] = (0, react.useState)(0);
64
+ const [measuredSize, setMeasuredSize] = (0, react.useState)(void 0);
65
+ const getViewportMax = () => getViewportPx() / theme.scale;
66
+ const measureSectionSize = (sectionElement) => {
67
+ const rect = sectionElement.getBoundingClientRect();
68
+ return ((config.axis === "horizontal" ? rect.width : rect.height) - require_safe_area_inset.getSafeAreaInset(sectionElement, config.safeAreaVariable)) / theme.scale;
69
+ };
70
+ const applyPreview = (size) => {
71
+ const root = ctx.rootRef.current;
72
+ if (!root) return;
73
+ const value = require_rem.rem(size);
74
+ root.style.setProperty(config.sizeVariable, value);
75
+ if (ctx.resizeOffsets[section]) root.style.setProperty(config.offsetVariable, value);
76
+ if (ctx.mode === "static" && config.gridWidthVariable) root.style.setProperty(config.gridWidthVariable, value);
77
+ };
78
+ const clearPreview = () => {
79
+ const root = ctx.rootRef.current;
80
+ if (!root) return;
81
+ root.style.removeProperty(config.sizeVariable);
82
+ root.style.removeProperty(config.offsetVariable);
83
+ if (config.gridWidthVariable) root.style.removeProperty(config.gridWidthVariable);
84
+ };
85
+ const stopListeners = () => {
86
+ abortRef.current?.abort();
87
+ abortRef.current = null;
88
+ activePointerIdRef.current = null;
89
+ const previousBodyStyles = previousBodyStylesRef.current;
90
+ previousBodyStylesRef.current = null;
91
+ if (previousBodyStyles) {
92
+ restoreBodyStyleProperty("user-select", previousBodyStyles.userSelect);
93
+ restoreBodyStyleProperty("-webkit-user-select", previousBodyStyles.webkitUserSelect);
94
+ restoreBodyStyleProperty("cursor", previousBodyStyles.cursor);
95
+ }
96
+ };
97
+ const cancelResize = () => {
98
+ controller?.reportCollapse(section, require_clamp_resize_size.getCollapseState(dragRef.current.startSize, options.collapseThreshold));
99
+ controller?.endResize(section, null);
100
+ };
101
+ const onPointerMove = (event) => {
102
+ if (event.pointerId !== activePointerIdRef.current) return;
103
+ dragRef.current.moved = true;
104
+ const delta = require_resize_section_config.getResizeDelta({
105
+ section,
106
+ deltaX: event.clientX - dragRef.current.startX,
107
+ deltaY: event.clientY - dragRef.current.startY,
108
+ dir
109
+ }) / theme.scale;
110
+ const rawSize = dragRef.current.startSize + delta;
111
+ const size = require_clamp_resize_size.clampResizeSize({
112
+ size: rawSize,
113
+ min: options.min,
114
+ max: options.max,
115
+ viewportMax: getViewportMax()
116
+ });
117
+ dragRef.current.size = size;
118
+ applyPreview(size);
119
+ handleRef.current?.setAttribute("aria-valuenow", String(Math.round(size)));
120
+ controller?.previewResize(section, size);
121
+ controller?.reportCollapse(section, require_clamp_resize_size.getCollapseState(rawSize, options.collapseThreshold));
122
+ };
123
+ const onPointerUp = (event) => {
124
+ if (event.pointerId !== activePointerIdRef.current) return;
125
+ stopListeners();
126
+ if (!dragRef.current.moved) {
127
+ controller?.endResize(section, null);
128
+ return;
129
+ }
130
+ controller?.endResize(section, dragRef.current.size);
131
+ };
132
+ const onPointerCancel = (event) => {
133
+ if (event.pointerId !== activePointerIdRef.current) return;
134
+ stopListeners();
135
+ clearPreview();
136
+ cancelResize();
137
+ };
138
+ const onDragKeyDown = (event) => {
139
+ if (event.key !== "Escape") return;
140
+ event.preventDefault();
141
+ stopListeners();
142
+ clearPreview();
143
+ handleRef.current?.setAttribute("aria-valuenow", String(Math.round(dragRef.current.startSize)));
144
+ cancelResize();
145
+ };
146
+ const getCurrentSize = () => {
147
+ const size = controller?.[section].size;
148
+ if (size !== void 0) return size;
149
+ const sectionElement = handleRef.current?.parentElement;
150
+ if (!sectionElement) return 0;
151
+ return measureSectionSize(sectionElement);
152
+ };
153
+ const commitKeyboardSize = (size) => {
154
+ controller?.initCollapse(section, require_clamp_resize_size.getCollapseState(getCurrentSize(), options.collapseThreshold));
155
+ controller?.reportCollapse(section, require_clamp_resize_size.getCollapseState(size, options.collapseThreshold));
156
+ controller?.endResize(section, require_clamp_resize_size.clampResizeSize({
157
+ size,
158
+ min: options.min,
159
+ max: options.max,
160
+ viewportMax: getViewportMax()
161
+ }));
162
+ };
163
+ const onKeyDown = (event) => {
164
+ const step = event.shiftKey ? KEYBOARD_SHIFT_STEP : KEYBOARD_STEP;
165
+ if (event.key === "Home") {
166
+ event.preventDefault();
167
+ commitKeyboardSize(options.min ?? 0);
168
+ return;
169
+ }
170
+ if (event.key === "End") {
171
+ event.preventDefault();
172
+ commitKeyboardSize(options.max ?? getViewportMax());
173
+ return;
174
+ }
175
+ const keyDelta = KEY_DELTAS[event.key];
176
+ if (!keyDelta) return;
177
+ const direction = require_resize_section_config.getResizeDelta({
178
+ section,
179
+ ...keyDelta,
180
+ dir
181
+ });
182
+ if (direction === 0) return;
183
+ event.preventDefault();
184
+ commitKeyboardSize(getCurrentSize() + direction * step);
185
+ };
186
+ const onDoubleClick = () => {
187
+ clearPreview();
188
+ controller?.[section].reset();
189
+ };
190
+ const onPointerDown = (event) => {
191
+ if (event.button !== 0) return;
192
+ if (abortRef.current !== null) return;
193
+ const sectionElement = handleRef.current?.parentElement;
194
+ if (!sectionElement) return;
195
+ const startSize = measureSectionSize(sectionElement);
196
+ dragRef.current = {
197
+ startSize,
198
+ startX: event.clientX,
199
+ startY: event.clientY,
200
+ size: startSize,
201
+ moved: false
202
+ };
203
+ activePointerIdRef.current = event.pointerId;
204
+ controller?.initCollapse(section, require_clamp_resize_size.getCollapseState(startSize, options.collapseThreshold));
205
+ const abortController = new AbortController();
206
+ abortRef.current = abortController;
207
+ const { signal } = abortController;
208
+ previousBodyStylesRef.current = {
209
+ userSelect: document.body.style.getPropertyValue("user-select"),
210
+ webkitUserSelect: document.body.style.getPropertyValue("-webkit-user-select"),
211
+ cursor: document.body.style.getPropertyValue("cursor")
212
+ };
213
+ document.body.style.setProperty("user-select", "none");
214
+ document.body.style.setProperty("-webkit-user-select", "none");
215
+ document.body.style.setProperty("cursor", config.axis === "horizontal" ? "col-resize" : "row-resize");
216
+ controller?.startResize(section);
217
+ document.addEventListener("pointermove", onPointerMove, { signal });
218
+ document.addEventListener("pointerup", onPointerUp, { signal });
219
+ document.addEventListener("pointercancel", onPointerCancel, { signal });
220
+ document.addEventListener("keydown", onDragKeyDown, { signal });
221
+ };
222
+ (0, _mantine_hooks.useIsomorphicEffect)(() => {
223
+ if (controller && controller.activeSection !== section) clearPreview();
224
+ }, [controller?.activeSection, controller?.[section].size]);
225
+ (0, _mantine_hooks.useIsomorphicEffect)(() => {
226
+ setViewportPx(getViewportPx());
227
+ const handleWindowResize = () => setViewportPx(getViewportPx());
228
+ window.addEventListener("resize", handleWindowResize);
229
+ return () => window.removeEventListener("resize", handleWindowResize);
230
+ }, [config.axis]);
231
+ (0, _mantine_hooks.useIsomorphicEffect)(() => {
232
+ if (controller?.[section].size === void 0) setMeasuredSize(getCurrentSize());
233
+ }, [controller?.[section].size, viewportPx]);
234
+ (0, _mantine_hooks.useIsomorphicEffect)(() => () => {
235
+ const wasDragging = abortRef.current !== null;
236
+ stopListeners();
237
+ clearPreview();
238
+ if (wasDragging) cancelResize();
239
+ }, []);
240
+ if (!controller?.[section].enabled) return null;
241
+ const viewportMax = viewportPx / theme.scale;
242
+ const effectiveMax = Math.min(options.max ?? viewportMax, viewportMax);
243
+ const committedSize = controller[section].size;
244
+ const currentValue = committedSize !== void 0 && viewportPx > 0 ? Math.min(committedSize, viewportMax) : committedSize ?? measuredSize;
245
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
246
+ ref: handleRef,
247
+ role: "separator",
248
+ tabIndex: 0,
249
+ "aria-label": options.label ?? LABELS[section],
250
+ "aria-controls": sectionId,
251
+ "aria-orientation": config.orientation,
252
+ "aria-valuemin": options.min ?? 0,
253
+ "aria-valuemax": Math.round(effectiveMax),
254
+ "aria-valuenow": currentValue !== void 0 ? Math.round(currentValue) : void 0,
255
+ onPointerDown,
256
+ onKeyDown,
257
+ onDoubleClick,
258
+ mod: {
259
+ section,
260
+ orientation: config.orientation,
261
+ active: controller[section].active
262
+ },
263
+ ...ctx.getStyles("resizeHandle")
264
+ });
265
+ }
266
+ AppShellResizeHandle.displayName = "@mantine/core/AppShellResizeHandle";
267
+ //#endregion
268
+ exports.AppShellResizeHandle = AppShellResizeHandle;
269
+
270
+ //# sourceMappingURL=AppShellResizeHandle.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppShellResizeHandle.cjs","names":["useAppShellContext","useRef","useDirection","useMantineTheme","RESIZE_SECTIONS","useState","getSafeAreaInset","rem","getCollapseState","getResizeDelta","clampResizeSize","Box"],"sources":["../../../../src/components/AppShell/AppShellResizeHandle/AppShellResizeHandle.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { useIsomorphicEffect } from '@mantine/hooks';\nimport { Box, rem, useDirection, useMantineTheme } from '../../../core';\nimport { useAppShellContext } from '../AppShell.context';\nimport type { AppShellResizeSection } from '../AppShell.types';\nimport { clampResizeSize, getCollapseState } from '../use-app-shell-resize/clamp-resize-size';\nimport { getResizeDelta, RESIZE_SECTIONS } from '../use-app-shell-resize/resize-section-config';\nimport { getSafeAreaInset } from '../use-app-shell-resize/safe-area-inset';\n\ninterface AppShellResizeHandleProps {\n section: AppShellResizeSection;\n sectionId: string;\n}\n\nconst LABELS: Record<AppShellResizeSection, string> = {\n navbar: 'Resize navbar',\n aside: 'Resize aside',\n header: 'Resize header',\n footer: 'Resize footer',\n};\n\nconst KEYBOARD_STEP = 10;\nconst KEYBOARD_SHIFT_STEP = 50;\n\nconst KEY_DELTAS: Record<string, { deltaX: number; deltaY: number }> = {\n ArrowRight: { deltaX: 1, deltaY: 0 },\n ArrowLeft: { deltaX: -1, deltaY: 0 },\n ArrowDown: { deltaX: 0, deltaY: 1 },\n ArrowUp: { deltaX: 0, deltaY: -1 },\n};\n\ninterface PreviousBodyStyles {\n userSelect: string;\n webkitUserSelect: string;\n cursor: string;\n}\n\nfunction restoreBodyStyleProperty(property: string, value: string) {\n if (value) {\n document.body.style.setProperty(property, value);\n } else {\n document.body.style.removeProperty(property);\n }\n}\n\nexport function AppShellResizeHandle({ section, sectionId }: AppShellResizeHandleProps) {\n const ctx = useAppShellContext();\n const controller = ctx.resize;\n\n const handleRef = useRef<HTMLDivElement>(null);\n const dragRef = useRef({ startSize: 0, startX: 0, startY: 0, size: 0, moved: false });\n const activePointerIdRef = useRef<number | null>(null);\n const abortRef = useRef<AbortController | null>(null);\n const previousBodyStylesRef = useRef<PreviousBodyStyles | null>(null);\n const { dir } = useDirection();\n const theme = useMantineTheme();\n\n const config = RESIZE_SECTIONS[section];\n const options = controller?.options[section] ?? {};\n\n const getViewportPx = () =>\n config.axis === 'horizontal' ? window.innerWidth : window.innerHeight;\n\n const [viewportPx, setViewportPx] = useState(0);\n const [measuredSize, setMeasuredSize] = useState<number | undefined>(undefined);\n\n const getViewportMax = () => getViewportPx() / theme.scale;\n\n const measureSectionSize = (sectionElement: HTMLElement) => {\n const rect = sectionElement.getBoundingClientRect();\n const rawSize = config.axis === 'horizontal' ? rect.width : rect.height;\n const safeAreaInset = getSafeAreaInset(sectionElement, config.safeAreaVariable);\n return (rawSize - safeAreaInset) / theme.scale;\n };\n\n const applyPreview = (size: number) => {\n const root = ctx.rootRef.current;\n if (!root) {\n return;\n }\n\n const value = rem(size);\n root.style.setProperty(config.sizeVariable, value);\n\n if (ctx.resizeOffsets[section]) {\n root.style.setProperty(config.offsetVariable, value);\n }\n\n if (ctx.mode === 'static' && config.gridWidthVariable) {\n root.style.setProperty(config.gridWidthVariable, value);\n }\n };\n\n const clearPreview = () => {\n const root = ctx.rootRef.current;\n if (!root) {\n return;\n }\n\n root.style.removeProperty(config.sizeVariable);\n root.style.removeProperty(config.offsetVariable);\n if (config.gridWidthVariable) {\n root.style.removeProperty(config.gridWidthVariable);\n }\n };\n\n const stopListeners = () => {\n abortRef.current?.abort();\n abortRef.current = null;\n activePointerIdRef.current = null;\n\n const previousBodyStyles = previousBodyStylesRef.current;\n previousBodyStylesRef.current = null;\n if (previousBodyStyles) {\n restoreBodyStyleProperty('user-select', previousBodyStyles.userSelect);\n restoreBodyStyleProperty('-webkit-user-select', previousBodyStyles.webkitUserSelect);\n restoreBodyStyleProperty('cursor', previousBodyStyles.cursor);\n }\n };\n\n const cancelResize = () => {\n controller?.reportCollapse(\n section,\n getCollapseState(dragRef.current.startSize, options.collapseThreshold)\n );\n controller?.endResize(section, null);\n };\n\n const onPointerMove = (event: PointerEvent) => {\n if (event.pointerId !== activePointerIdRef.current) {\n return;\n }\n\n dragRef.current.moved = true;\n\n const delta =\n getResizeDelta({\n section,\n deltaX: event.clientX - dragRef.current.startX,\n deltaY: event.clientY - dragRef.current.startY,\n dir,\n }) / theme.scale;\n\n const rawSize = dragRef.current.startSize + delta;\n const size = clampResizeSize({\n size: rawSize,\n min: options.min,\n max: options.max,\n viewportMax: getViewportMax(),\n });\n\n dragRef.current.size = size;\n applyPreview(size);\n handleRef.current?.setAttribute('aria-valuenow', String(Math.round(size)));\n controller?.previewResize(section, size);\n controller?.reportCollapse(section, getCollapseState(rawSize, options.collapseThreshold));\n };\n\n const onPointerUp = (event: PointerEvent) => {\n if (event.pointerId !== activePointerIdRef.current) {\n return;\n }\n\n stopListeners();\n\n if (!dragRef.current.moved) {\n controller?.endResize(section, null);\n return;\n }\n\n controller?.endResize(section, dragRef.current.size);\n };\n\n const onPointerCancel = (event: PointerEvent) => {\n if (event.pointerId !== activePointerIdRef.current) {\n return;\n }\n\n stopListeners();\n clearPreview();\n cancelResize();\n };\n\n const onDragKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') {\n return;\n }\n\n event.preventDefault();\n stopListeners();\n clearPreview();\n handleRef.current?.setAttribute('aria-valuenow', String(Math.round(dragRef.current.startSize)));\n cancelResize();\n };\n\n const getCurrentSize = () => {\n const size = controller?.[section].size;\n if (size !== undefined) {\n return size;\n }\n\n const sectionElement = handleRef.current?.parentElement;\n if (!sectionElement) {\n return 0;\n }\n\n return measureSectionSize(sectionElement);\n };\n\n const commitKeyboardSize = (size: number) => {\n controller?.initCollapse(\n section,\n getCollapseState(getCurrentSize(), options.collapseThreshold)\n );\n controller?.reportCollapse(section, getCollapseState(size, options.collapseThreshold));\n controller?.endResize(\n section,\n clampResizeSize({\n size,\n min: options.min,\n max: options.max,\n viewportMax: getViewportMax(),\n })\n );\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const step = event.shiftKey ? KEYBOARD_SHIFT_STEP : KEYBOARD_STEP;\n\n if (event.key === 'Home') {\n event.preventDefault();\n commitKeyboardSize(options.min ?? 0);\n return;\n }\n\n if (event.key === 'End') {\n event.preventDefault();\n commitKeyboardSize(options.max ?? getViewportMax());\n return;\n }\n\n const keyDelta = KEY_DELTAS[event.key];\n if (!keyDelta) {\n return;\n }\n\n const direction = getResizeDelta({ section, ...keyDelta, dir });\n if (direction === 0) {\n return;\n }\n\n event.preventDefault();\n commitKeyboardSize(getCurrentSize() + direction * step);\n };\n\n const onDoubleClick = () => {\n clearPreview();\n controller?.[section].reset();\n };\n\n const onPointerDown = (event: React.PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) {\n return;\n }\n\n if (abortRef.current !== null) {\n return;\n }\n\n const sectionElement = handleRef.current?.parentElement;\n if (!sectionElement) {\n return;\n }\n\n const startSize = measureSectionSize(sectionElement);\n dragRef.current = {\n startSize,\n startX: event.clientX,\n startY: event.clientY,\n size: startSize,\n moved: false,\n };\n activePointerIdRef.current = event.pointerId;\n controller?.initCollapse(section, getCollapseState(startSize, options.collapseThreshold));\n\n const abortController = new AbortController();\n abortRef.current = abortController;\n const { signal } = abortController;\n\n previousBodyStylesRef.current = {\n userSelect: document.body.style.getPropertyValue('user-select'),\n webkitUserSelect: document.body.style.getPropertyValue('-webkit-user-select'),\n cursor: document.body.style.getPropertyValue('cursor'),\n };\n document.body.style.setProperty('user-select', 'none');\n document.body.style.setProperty('-webkit-user-select', 'none');\n document.body.style.setProperty(\n 'cursor',\n config.axis === 'horizontal' ? 'col-resize' : 'row-resize'\n );\n controller?.startResize(section);\n\n document.addEventListener('pointermove', onPointerMove, { signal });\n document.addEventListener('pointerup', onPointerUp, { signal });\n document.addEventListener('pointercancel', onPointerCancel, { signal });\n document.addEventListener('keydown', onDragKeyDown, { signal });\n };\n\n useIsomorphicEffect(() => {\n if (controller && controller.activeSection !== section) {\n clearPreview();\n }\n }, [controller?.activeSection, controller?.[section].size]);\n\n useIsomorphicEffect(() => {\n setViewportPx(getViewportPx());\n\n const handleWindowResize = () => setViewportPx(getViewportPx());\n window.addEventListener('resize', handleWindowResize);\n return () => window.removeEventListener('resize', handleWindowResize);\n }, [config.axis]);\n\n useIsomorphicEffect(() => {\n if (controller?.[section].size === undefined) {\n setMeasuredSize(getCurrentSize());\n }\n }, [controller?.[section].size, viewportPx]);\n\n useIsomorphicEffect(\n () => () => {\n const wasDragging = abortRef.current !== null;\n stopListeners();\n clearPreview();\n\n if (wasDragging) {\n cancelResize();\n }\n },\n []\n );\n\n if (!controller?.[section].enabled) {\n return null;\n }\n\n const viewportMax = viewportPx / theme.scale;\n const effectiveMax = Math.min(options.max ?? viewportMax, viewportMax);\n const committedSize = controller[section].size;\n const currentValue =\n committedSize !== undefined && viewportPx > 0\n ? Math.min(committedSize, viewportMax)\n : (committedSize ?? measuredSize);\n\n return (\n <Box\n ref={handleRef}\n role=\"separator\"\n tabIndex={0}\n aria-label={options.label ?? LABELS[section]}\n aria-controls={sectionId}\n aria-orientation={config.orientation}\n aria-valuemin={options.min ?? 0}\n aria-valuemax={Math.round(effectiveMax)}\n aria-valuenow={currentValue !== undefined ? Math.round(currentValue) : undefined}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n onDoubleClick={onDoubleClick}\n mod={{ section, orientation: config.orientation, active: controller[section].active }}\n {...ctx.getStyles('resizeHandle')}\n />\n );\n}\n\nAppShellResizeHandle.displayName = '@mantine/core/AppShellResizeHandle';\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAM,SAAgD;CACpD,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,QAAQ;AACV;AAEA,MAAM,gBAAgB;AACtB,MAAM,sBAAsB;AAE5B,MAAM,aAAiE;CACrE,YAAY;EAAE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;CACvC,MAAM,eAAe,KAAK,IAAI,QAAQ,OAAO,aAAa,WAAW;CACrE,MAAM,gBAAgB,WAAW,QAAQ,CAAC;CAC1C,MAAM,eACJ,kBAAkB,KAAA,KAAa,aAAa,IACxC,KAAK,IAAI,eAAe,WAAW,IAClC,iBAAiB;CAExB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACG,YAAAA,KAAD;EACE,KAAK;EACL,MAAK;EACL,UAAU;EACV,cAAY,QAAQ,SAAS,OAAO;EACpC,iBAAe;EACf,oBAAkB,OAAO;EACzB,iBAAe,QAAQ,OAAO;EAC9B,iBAAe,KAAK,MAAM,YAAY;EACtC,iBAAe,iBAAiB,KAAA,IAAY,KAAK,MAAM,YAAY,IAAI,KAAA;EACxD;EACJ;EACI;EACf,KAAK;GAAE;GAAS,aAAa,OAAO;GAAa,QAAQ,WAAW,QAAQ,CAAC;EAAO;EACpF,GAAI,IAAI,UAAU,cAAc;CACjC,CAAA;AAEL;AAEA,qBAAqB,cAAc"}
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ //#region packages/@mantine/core/src/components/AppShell/use-app-shell-resize/clamp-resize-size.ts
3
+ function clampResizeSize({ size, min, max, viewportMax }) {
4
+ const upperBound = Math.min(max ?? Number.POSITIVE_INFINITY, viewportMax);
5
+ return Math.max(Math.min(min ?? 0, upperBound), Math.min(size, upperBound));
6
+ }
7
+ function getCollapseState(size, collapseThreshold) {
8
+ if (collapseThreshold === void 0) return false;
9
+ return size < collapseThreshold;
10
+ }
11
+ //#endregion
12
+ exports.clampResizeSize = clampResizeSize;
13
+ exports.getCollapseState = getCollapseState;
14
+
15
+ //# sourceMappingURL=clamp-resize-size.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clamp-resize-size.cjs","names":[],"sources":["../../../../src/components/AppShell/use-app-shell-resize/clamp-resize-size.ts"],"sourcesContent":["interface ClampResizeSizeInput {\n size: number;\n min: number | undefined;\n max: number | undefined;\n viewportMax: number;\n}\n\nexport function clampResizeSize({ size, min, max, viewportMax }: ClampResizeSizeInput) {\n const upperBound = Math.min(max ?? Number.POSITIVE_INFINITY, viewportMax);\n const lowerBound = Math.min(min ?? 0, upperBound);\n return Math.max(lowerBound, Math.min(size, upperBound));\n}\n\nexport function getCollapseState(size: number, collapseThreshold: number | undefined) {\n if (collapseThreshold === undefined) {\n return false;\n }\n\n return size < collapseThreshold;\n}\n"],"mappings":";;AAOA,SAAgB,gBAAgB,EAAE,MAAM,KAAK,KAAK,eAAqC;CACrF,MAAM,aAAa,KAAK,IAAI,OAAO,OAAO,mBAAmB,WAAW;CAExE,OAAO,KAAK,IADO,KAAK,IAAI,OAAO,GAAG,UACb,GAAG,KAAK,IAAI,MAAM,UAAU,CAAC;AACxD;AAEA,SAAgB,iBAAiB,MAAc,mBAAuC;CACpF,IAAI,sBAAsB,KAAA,GACxB,OAAO;CAGT,OAAO,OAAO;AAChB"}
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ //#region packages/@mantine/core/src/components/AppShell/use-app-shell-resize/resize-section-config.ts
3
+ const RESIZE_SECTIONS = {
4
+ navbar: {
5
+ axis: "horizontal",
6
+ orientation: "vertical",
7
+ sizeVariable: "--app-shell-navbar-width",
8
+ offsetVariable: "--app-shell-navbar-offset",
9
+ gridWidthVariable: "--app-shell-navbar-grid-width",
10
+ handleDisplayVariable: "--app-shell-navbar-resize-handle-display",
11
+ sign: 1
12
+ },
13
+ aside: {
14
+ axis: "horizontal",
15
+ orientation: "vertical",
16
+ sizeVariable: "--app-shell-aside-width",
17
+ offsetVariable: "--app-shell-aside-offset",
18
+ gridWidthVariable: "--app-shell-aside-grid-width",
19
+ handleDisplayVariable: "--app-shell-aside-resize-handle-display",
20
+ sign: -1
21
+ },
22
+ header: {
23
+ axis: "vertical",
24
+ orientation: "horizontal",
25
+ sizeVariable: "--app-shell-header-height",
26
+ offsetVariable: "--app-shell-header-offset",
27
+ handleDisplayVariable: "--app-shell-header-resize-handle-display",
28
+ sign: 1
29
+ },
30
+ footer: {
31
+ axis: "vertical",
32
+ orientation: "horizontal",
33
+ sizeVariable: "--app-shell-footer-height",
34
+ offsetVariable: "--app-shell-footer-offset",
35
+ handleDisplayVariable: "--app-shell-footer-resize-handle-display",
36
+ safeAreaVariable: "--app-shell-footer-safe-area",
37
+ sign: -1
38
+ }
39
+ };
40
+ const RESIZE_SECTION_NAMES = Object.keys(RESIZE_SECTIONS);
41
+ function getResizeDelta({ section, deltaX, deltaY, dir }) {
42
+ const config = RESIZE_SECTIONS[section];
43
+ if (config.axis === "vertical") return deltaY * config.sign;
44
+ return deltaX * config.sign * (dir === "rtl" ? -1 : 1);
45
+ }
46
+ //#endregion
47
+ exports.RESIZE_SECTIONS = RESIZE_SECTIONS;
48
+ exports.RESIZE_SECTION_NAMES = RESIZE_SECTION_NAMES;
49
+ exports.getResizeDelta = getResizeDelta;
50
+
51
+ //# sourceMappingURL=resize-section-config.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-section-config.cjs","names":[],"sources":["../../../../src/components/AppShell/use-app-shell-resize/resize-section-config.ts"],"sourcesContent":["import type { AppShellResizeSection } from '../AppShell.types';\n\nexport interface ResizeSectionConfig {\n /** Axis the pointer moves along to resize the section */\n axis: 'horizontal' | 'vertical';\n\n /** `aria-orientation` of the separator element */\n orientation: 'vertical' | 'horizontal';\n\n /** CSS variable that controls the section size */\n sizeVariable: string;\n\n /** CSS variable that controls the space reserved for the section */\n offsetVariable: string;\n\n /** CSS variable that controls the grid track size in `mode=\"static\"` */\n gridWidthVariable?: string;\n\n /** CSS variable that controls whether the resize handle is displayed */\n handleDisplayVariable: string;\n\n /** CSS variable that exposes a safe-area inset baked into the section's measured size, if any */\n safeAreaVariable?: string;\n\n /** `1` when moving towards the end of the axis grows the section, `-1` otherwise */\n sign: 1 | -1;\n}\n\nexport const RESIZE_SECTIONS: Record<AppShellResizeSection, ResizeSectionConfig> = {\n navbar: {\n axis: 'horizontal',\n orientation: 'vertical',\n sizeVariable: '--app-shell-navbar-width',\n offsetVariable: '--app-shell-navbar-offset',\n gridWidthVariable: '--app-shell-navbar-grid-width',\n handleDisplayVariable: '--app-shell-navbar-resize-handle-display',\n sign: 1,\n },\n aside: {\n axis: 'horizontal',\n orientation: 'vertical',\n sizeVariable: '--app-shell-aside-width',\n offsetVariable: '--app-shell-aside-offset',\n gridWidthVariable: '--app-shell-aside-grid-width',\n handleDisplayVariable: '--app-shell-aside-resize-handle-display',\n sign: -1,\n },\n header: {\n axis: 'vertical',\n orientation: 'horizontal',\n sizeVariable: '--app-shell-header-height',\n offsetVariable: '--app-shell-header-offset',\n handleDisplayVariable: '--app-shell-header-resize-handle-display',\n sign: 1,\n },\n footer: {\n axis: 'vertical',\n orientation: 'horizontal',\n sizeVariable: '--app-shell-footer-height',\n offsetVariable: '--app-shell-footer-offset',\n handleDisplayVariable: '--app-shell-footer-resize-handle-display',\n safeAreaVariable: '--app-shell-footer-safe-area',\n sign: -1,\n },\n};\n\nexport const RESIZE_SECTION_NAMES = Object.keys(RESIZE_SECTIONS) as AppShellResizeSection[];\n\ninterface GetResizeDeltaInput {\n section: AppShellResizeSection;\n deltaX: number;\n deltaY: number;\n dir: 'ltr' | 'rtl';\n}\n\nexport function getResizeDelta({ section, deltaX, deltaY, dir }: GetResizeDeltaInput) {\n const config = RESIZE_SECTIONS[section];\n\n if (config.axis === 'vertical') {\n return deltaY * config.sign;\n }\n\n return deltaX * config.sign * (dir === 'rtl' ? -1 : 1);\n}\n"],"mappings":";;AA4BA,MAAa,kBAAsE;CACjF,QAAQ;EACN,MAAM;EACN,aAAa;EACb,cAAc;EACd,gBAAgB;EAChB,mBAAmB;EACnB,uBAAuB;EACvB,MAAM;CACR;CACA,OAAO;EACL,MAAM;EACN,aAAa;EACb,cAAc;EACd,gBAAgB;EAChB,mBAAmB;EACnB,uBAAuB;EACvB,MAAM;CACR;CACA,QAAQ;EACN,MAAM;EACN,aAAa;EACb,cAAc;EACd,gBAAgB;EAChB,uBAAuB;EACvB,MAAM;CACR;CACA,QAAQ;EACN,MAAM;EACN,aAAa;EACb,cAAc;EACd,gBAAgB;EAChB,uBAAuB;EACvB,kBAAkB;EAClB,MAAM;CACR;AACF;AAEA,MAAa,uBAAuB,OAAO,KAAK,eAAe;AAS/D,SAAgB,eAAe,EAAE,SAAS,QAAQ,QAAQ,OAA4B;CACpF,MAAM,SAAS,gBAAgB;CAE/B,IAAI,OAAO,SAAS,YAClB,OAAO,SAAS,OAAO;CAGzB,OAAO,SAAS,OAAO,QAAQ,QAAQ,QAAQ,KAAK;AACtD"}
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ //#region packages/@mantine/core/src/components/AppShell/use-app-shell-resize/safe-area-inset.ts
3
+ function getSafeAreaInset(element, variable) {
4
+ if (!variable) return 0;
5
+ const value = window.getComputedStyle(element).getPropertyValue(variable);
6
+ const parsed = Number.parseFloat(value);
7
+ return Number.isFinite(parsed) ? parsed : 0;
8
+ }
9
+ //#endregion
10
+ exports.getSafeAreaInset = getSafeAreaInset;
11
+
12
+ //# sourceMappingURL=safe-area-inset.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe-area-inset.cjs","names":[],"sources":["../../../../src/components/AppShell/use-app-shell-resize/safe-area-inset.ts"],"sourcesContent":["export function getSafeAreaInset(element: Element, variable: string | undefined) {\n if (!variable) {\n return 0;\n }\n\n const value = window.getComputedStyle(element).getPropertyValue(variable);\n const parsed = Number.parseFloat(value);\n return Number.isFinite(parsed) ? parsed : 0;\n}\n"],"mappings":";;AAAA,SAAgB,iBAAiB,SAAkB,UAA8B;CAC/E,IAAI,CAAC,UACH,OAAO;CAGT,MAAM,QAAQ,OAAO,iBAAiB,OAAO,CAAC,CAAC,iBAAiB,QAAQ;CACxE,MAAM,SAAS,OAAO,WAAW,KAAK;CACtC,OAAO,OAAO,SAAS,MAAM,IAAI,SAAS;AAC5C"}
@@ -0,0 +1,127 @@
1
+ "use client";
2
+ const require_resize_section_config = require("./resize-section-config.cjs");
3
+ let react = require("react");
4
+ let _mantine_hooks = require("@mantine/hooks");
5
+ //#region packages/@mantine/core/src/components/AppShell/use-app-shell-resize/use-app-shell-resize.ts
6
+ function useAppShellResize(input = {}) {
7
+ const { navbar, aside, header, footer, initialSizes, onResize, onResizeEnd, onCollapseChange } = input;
8
+ const [sizes, setSizes] = (0, react.useState)({});
9
+ const [touched, setTouched] = (0, react.useState)({});
10
+ const [activeSection, setActiveSection] = (0, react.useState)(null);
11
+ const collapsedRef = (0, react.useRef)({});
12
+ const handleResize = (0, _mantine_hooks.useCallbackRef)(onResize);
13
+ const handleResizeEnd = (0, _mantine_hooks.useCallbackRef)(onResizeEnd);
14
+ const handleCollapseChange = (0, _mantine_hooks.useCallbackRef)(onCollapseChange);
15
+ const options = (0, react.useMemo)(() => ({
16
+ navbar,
17
+ aside,
18
+ header,
19
+ footer
20
+ }), [
21
+ navbar,
22
+ aside,
23
+ header,
24
+ footer
25
+ ]);
26
+ const resolvedSizes = (0, react.useMemo)(() => {
27
+ const result = {};
28
+ require_resize_section_config.RESIZE_SECTION_NAMES.forEach((section) => {
29
+ if (sizes[section] !== void 0) {
30
+ result[section] = sizes[section];
31
+ return;
32
+ }
33
+ if (!touched[section] && initialSizes?.[section] !== void 0) result[section] = initialSizes[section];
34
+ });
35
+ return result;
36
+ }, [
37
+ sizes,
38
+ touched,
39
+ initialSizes
40
+ ]);
41
+ const resolvedSizesRef = (0, react.useRef)(resolvedSizes);
42
+ resolvedSizesRef.current = resolvedSizes;
43
+ const commitSize = (0, react.useCallback)((section, size) => {
44
+ setTouched((current) => ({
45
+ ...current,
46
+ [section]: true
47
+ }));
48
+ setSizes((current) => ({
49
+ ...current,
50
+ [section]: size
51
+ }));
52
+ }, []);
53
+ const clearSize = (0, react.useCallback)((section) => {
54
+ setTouched((current) => ({
55
+ ...current,
56
+ [section]: true
57
+ }));
58
+ setSizes((current) => {
59
+ const next = { ...current };
60
+ delete next[section];
61
+ return next;
62
+ });
63
+ }, []);
64
+ const startResize = (0, react.useCallback)((section) => {
65
+ setActiveSection(section);
66
+ }, []);
67
+ const previewResize = (0, react.useCallback)((section, size) => {
68
+ handleResize({
69
+ ...resolvedSizesRef.current,
70
+ [section]: size
71
+ });
72
+ }, [handleResize]);
73
+ const endResize = (0, react.useCallback)((section, size) => {
74
+ setActiveSection(null);
75
+ delete collapsedRef.current[section];
76
+ if (size === null) return;
77
+ commitSize(section, size);
78
+ handleResizeEnd({
79
+ ...resolvedSizesRef.current,
80
+ [section]: size
81
+ });
82
+ }, [commitSize, handleResizeEnd]);
83
+ const initCollapse = (0, react.useCallback)((section, collapsed) => {
84
+ collapsedRef.current[section] = collapsed;
85
+ }, []);
86
+ const reportCollapse = (0, react.useCallback)((section, collapsed) => {
87
+ if (collapsedRef.current[section] === collapsed) return;
88
+ collapsedRef.current[section] = collapsed;
89
+ handleCollapseChange(section, collapsed);
90
+ }, [handleCollapseChange]);
91
+ const resetAll = (0, react.useCallback)(() => {
92
+ setTouched(() => {
93
+ const next = {};
94
+ require_resize_section_config.RESIZE_SECTION_NAMES.forEach((section) => {
95
+ next[section] = true;
96
+ });
97
+ return next;
98
+ });
99
+ setSizes({});
100
+ }, []);
101
+ const getSectionController = (section) => ({
102
+ enabled: options[section] !== void 0,
103
+ size: resolvedSizes[section],
104
+ active: activeSection === section,
105
+ setSize: (size) => commitSize(section, size),
106
+ reset: () => clearSize(section)
107
+ });
108
+ return {
109
+ navbar: getSectionController("navbar"),
110
+ aside: getSectionController("aside"),
111
+ header: getSectionController("header"),
112
+ footer: getSectionController("footer"),
113
+ sizes: resolvedSizes,
114
+ resetAll,
115
+ options,
116
+ activeSection,
117
+ startResize,
118
+ previewResize,
119
+ endResize,
120
+ initCollapse,
121
+ reportCollapse
122
+ };
123
+ }
124
+ //#endregion
125
+ exports.useAppShellResize = useAppShellResize;
126
+
127
+ //# sourceMappingURL=use-app-shell-resize.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-app-shell-resize.cjs","names":["useState","useRef","useCallbackRef","useMemo","useCallback"],"sources":["../../../../src/components/AppShell/use-app-shell-resize/use-app-shell-resize.ts"],"sourcesContent":["import { useCallback, useMemo, useRef, useState } from 'react';\nimport { useCallbackRef } from '@mantine/hooks';\nimport type {\n AppShellResizeController,\n AppShellResizeSection,\n AppShellResizeSectionController,\n AppShellResizeSizes,\n UseAppShellResizeInput,\n} from '../AppShell.types';\nimport { RESIZE_SECTION_NAMES } from './resize-section-config';\n\ntype SectionFlags = Partial<Record<AppShellResizeSection, boolean>>;\n\nexport function useAppShellResize(input: UseAppShellResizeInput = {}): AppShellResizeController {\n const { navbar, aside, header, footer, initialSizes, onResize, onResizeEnd, onCollapseChange } =\n input;\n\n const [sizes, setSizes] = useState<AppShellResizeSizes>({});\n const [touched, setTouched] = useState<SectionFlags>({});\n const [activeSection, setActiveSection] = useState<AppShellResizeSection | null>(null);\n const collapsedRef = useRef<SectionFlags>({});\n const handleResize = useCallbackRef(onResize);\n const handleResizeEnd = useCallbackRef(onResizeEnd);\n const handleCollapseChange = useCallbackRef(onCollapseChange);\n\n const options = useMemo(\n () => ({ navbar, aside, header, footer }),\n [navbar, aside, header, footer]\n );\n\n const resolvedSizes = useMemo(() => {\n const result: AppShellResizeSizes = {};\n\n RESIZE_SECTION_NAMES.forEach((section) => {\n if (sizes[section] !== undefined) {\n result[section] = sizes[section];\n return;\n }\n\n if (!touched[section] && initialSizes?.[section] !== undefined) {\n result[section] = initialSizes[section];\n }\n });\n\n return result;\n }, [sizes, touched, initialSizes]);\n\n const resolvedSizesRef = useRef(resolvedSizes);\n resolvedSizesRef.current = resolvedSizes;\n\n const commitSize = useCallback((section: AppShellResizeSection, size: number) => {\n setTouched((current) => ({ ...current, [section]: true }));\n setSizes((current) => ({ ...current, [section]: size }));\n }, []);\n\n const clearSize = useCallback((section: AppShellResizeSection) => {\n setTouched((current) => ({ ...current, [section]: true }));\n setSizes((current) => {\n const next = { ...current };\n delete next[section];\n return next;\n });\n }, []);\n\n const startResize = useCallback((section: AppShellResizeSection) => {\n setActiveSection(section);\n }, []);\n\n const previewResize = useCallback(\n (section: AppShellResizeSection, size: number) => {\n handleResize({ ...resolvedSizesRef.current, [section]: size });\n },\n [handleResize]\n );\n\n const endResize = useCallback(\n (section: AppShellResizeSection, size: number | null) => {\n setActiveSection(null);\n delete collapsedRef.current[section];\n\n if (size === null) {\n return;\n }\n\n commitSize(section, size);\n handleResizeEnd({ ...resolvedSizesRef.current, [section]: size });\n },\n [commitSize, handleResizeEnd]\n );\n\n const initCollapse = useCallback((section: AppShellResizeSection, collapsed: boolean) => {\n collapsedRef.current[section] = collapsed;\n }, []);\n\n const reportCollapse = useCallback(\n (section: AppShellResizeSection, collapsed: boolean) => {\n if (collapsedRef.current[section] === collapsed) {\n return;\n }\n\n collapsedRef.current[section] = collapsed;\n handleCollapseChange(section, collapsed);\n },\n [handleCollapseChange]\n );\n\n const resetAll = useCallback(() => {\n setTouched(() => {\n const next: SectionFlags = {};\n RESIZE_SECTION_NAMES.forEach((section) => {\n next[section] = true;\n });\n return next;\n });\n setSizes({});\n }, []);\n\n const getSectionController = (\n section: AppShellResizeSection\n ): AppShellResizeSectionController => ({\n enabled: options[section] !== undefined,\n size: resolvedSizes[section],\n active: activeSection === section,\n setSize: (size: number) => commitSize(section, size),\n reset: () => clearSize(section),\n });\n\n return {\n navbar: getSectionController('navbar'),\n aside: getSectionController('aside'),\n header: getSectionController('header'),\n footer: getSectionController('footer'),\n sizes: resolvedSizes,\n resetAll,\n options,\n activeSection,\n startResize,\n previewResize,\n endResize,\n initCollapse,\n reportCollapse,\n };\n}\n"],"mappings":";;;;;AAaA,SAAgB,kBAAkB,QAAgC,CAAC,GAA6B;CAC9F,MAAM,EAAE,QAAQ,OAAO,QAAQ,QAAQ,cAAc,UAAU,aAAa,qBAC1E;CAEF,MAAM,CAAC,OAAO,aAAA,GAAYA,MAAAA,SAAAA,CAA8B,CAAC,CAAC;CAC1D,MAAM,CAAC,SAAS,eAAA,GAAcA,MAAAA,SAAAA,CAAuB,CA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O,qBAAqB,OAAO;EACnC,QAAQ,qBAAqB,QAAQ;EACrC,QAAQ,qBAAqB,QAAQ;EACrC,OAAO;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -2,10 +2,28 @@
2
2
  let react = require("react");
3
3
  let _mantine_hooks = require("@mantine/hooks");
4
4
  //#region packages/@mantine/core/src/components/AppShell/use-resizing/use-resizing.tsx
5
- function useResizing({ transitionDuration, disabled }) {
5
+ function useResizing({ transitionDuration, disabled, resizeKey }) {
6
6
  const [resizing, setResizing] = (0, react.useState)(true);
7
+ const [settling, setSettling] = (0, react.useState)({
8
+ key: resizeKey,
9
+ active: false
10
+ });
7
11
  const resizingTimeout = (0, react.useRef)(-1);
8
12
  const disabledTimeout = (0, react.useRef)(-1);
13
+ if (settling.key !== resizeKey) setSettling({
14
+ key: resizeKey,
15
+ active: true
16
+ });
17
+ (0, react.useEffect)(() => {
18
+ if (!settling.active) return;
19
+ const settlingTimeout = window.setTimeout(() => (0, react.startTransition)(() => {
20
+ setSettling((current) => ({
21
+ ...current,
22
+ active: false
23
+ }));
24
+ }), transitionDuration || 0);
25
+ return () => window.clearTimeout(settlingTimeout);
26
+ }, [settling, transitionDuration]);
9
27
  (0, _mantine_hooks.useWindowEvent)("resize", () => {
10
28
  setResizing(true);
11
29
  clearTimeout(resizingTimeout.current);
@@ -20,7 +38,7 @@ function useResizing({ transitionDuration, disabled }) {
20
38
  setResizing(false);
21
39
  }), transitionDuration || 0);
22
40
  }, [disabled, transitionDuration]);
23
- return resizing;
41
+ return resizing || settling.active;
24
42
  }
25
43
  //#endregion
26
44
  exports.useResizing = useResizing;
@@ -1 +1 @@
1
- {"version":3,"file":"use-resizing.cjs","names":["useState","useRef","startTransition"],"sources":["../../../../src/components/AppShell/use-resizing/use-resizing.tsx"],"sourcesContent":["import { startTransition, useRef, useState } from 'react';\nimport { useIsomorphicEffect, useWindowEvent } from '@mantine/hooks';\n\ninterface UseResizingInput {\n transitionDuration: number | undefined;\n disabled: boolean | undefined;\n}\n\nexport function useResizing({ transitionDuration, disabled }: UseResizingInput) {\n const [resizing, setResizing] = useState(true);\n const resizingTimeout = useRef<number>(-1);\n const disabledTimeout = useRef<number>(-1);\n\n useWindowEvent('resize', () => {\n setResizing(true);\n clearTimeout(resizingTimeout.current);\n resizingTimeout.current = window.setTimeout(\n () =>\n startTransition(() => {\n setResizing(false);\n }),\n 200\n );\n });\n\n useIsomorphicEffect(() => {\n setResizing(true);\n clearTimeout(disabledTimeout.current);\n disabledTimeout.current = window.setTimeout(\n () =>\n startTransition(() => {\n setResizing(false);\n }),\n transitionDuration || 0\n );\n }, [disabled, transitionDuration]);\n\n return resizing;\n}\n"],"mappings":";;;;AAQA,SAAgB,YAAY,EAAE,oBAAoB,YAA8B;CAC9E,MAAM,CAAC,UAAU,gBAAA,GAAeA,MAAAA,SAAAA,CAAS,IAAI;CAC7C,MAAM,mBAAA,GAAkBC,MAAAA,OAAAA,CAAe,EAAE;CACzC,MAAM,mBAAA,GAAkBA,MAAAA,OAAAA,CAAe,EAAE;CAEzC,CAAA,GAAA,eAAA,eAAA,CAAe,gBAAgB;EAC7B,YAAY,IAAI;EAChB,aAAa,gBAAgB,OAAO;EACpC,gBAAgB,UAAU,OAAO,kBAAA,GAE7BC,MAAAA,gBAAAA,OAAsB;GACpB,YAAY,KAAK;EACnB,CAAC,GACH,GACF;CACF,CAAC;CAED,CAAA,GAAA,eAAA,oBAAA,OAA0B;EACxB,YAAY,IAAI;EAChB,aAAa,gBAAgB,OAAO;EACpC,gBAAgB,UAAU,OAAO,kBAAA,GAE7BA,MAAAA,gBAAAA,OAAsB;GACpB,YAAY,KAAK;EACnB,CAAC,GACH,sBAAsB,CACxB;CACF,GAAG,CAAC,UAAU,kBAAkB,CAAC;CAEjC,OAAO;AACT"}
1
+ {"version":3,"file":"use-resizing.cjs","names":["useState","useRef","startTransition"],"sources":["../../../../src/components/AppShell/use-resizing/use-resizing.tsx"],"sourcesContent":["import { startTransition, useEffect, useRef, useState } from 'react';\nimport { useIsomorphicEffect, useWindowEvent } from '@mantine/hooks';\n\ninterface UseResizingInput {\n transitionDuration: number | undefined;\n disabled: boolean | undefined;\n resizeKey?: string;\n}\n\nexport function useResizing({ transitionDuration, disabled, resizeKey }: UseResizingInput) {\n const [resizing, setResizing] = useState(true);\n const [settling, setSettling] = useState({ key: resizeKey, active: false });\n const resizingTimeout = useRef<number>(-1);\n const disabledTimeout = useRef<number>(-1);\n\n if (settling.key !== resizeKey) {\n setSettling({ key: resizeKey, active: true });\n }\n\n useEffect(() => {\n if (!settling.active) {\n return undefined;\n }\n\n const settlingTimeout = window.setTimeout(\n () =>\n startTransition(() => {\n setSettling((current) => ({ ...current, active: false }));\n }),\n transitionDuration || 0\n );\n\n return () => window.clearTimeout(settlingTimeout);\n }, [settling, transitionDuration]);\n\n useWindowEvent('resize', () => {\n setResizing(true);\n clearTimeout(resizingTimeout.current);\n resizingTimeout.current = window.setTimeout(\n () =>\n startTransition(() => {\n setResizing(false);\n }),\n 200\n );\n });\n\n useIsomorphicEffect(() => {\n setResizing(true);\n clearTimeout(disabledTimeout.current);\n disabledTimeout.current = window.setTimeout(\n () =>\n startTransition(() => {\n setResizing(false);\n }),\n transitionDuration || 0\n );\n }, [disabled, transitionDuration]);\n\n return resizing || settling.active;\n}\n"],"mappings":";;;;AASA,SAAgB,YAAY,EAAE,oBAAoB,UAAU,aAA+B;CACzF,MAAM,CAAC,UAAU,gBAAA,GAAeA,MAAAA,SAAAA,CAAS,IAAI;CAC7C,MAAM,CAAC,UAAU,gBAAA,GAAeA,MAAAA,SAAAA,CAAS;EAAE,KAAK;EAAW,QAAQ;CAAM,CAAC;CAC1E,MAAM,mBAAA,GAAkBC,MAAAA,OAAAA,CAAe,EAAE;CACzC,MAAM,mBAAA,GAAkBA,MAAAA,OAAAA,CAAe,EAAE;CAEzC,IAAI,SAAS,QAAQ,WACnB,YAAY;EAAE,KAAK;EAAW,QAAQ;CAAK,CAAC;CAG9C,CAAA,GAAA,MAAA,UAAA,OAAgB;EACd,IAAI,CAAC,SAAS,QACZ;EAGF,MAAM,kBAAkB,OAAO,kBAAA,GAE3BC,MAAAA,gBAAAA,OAAsB;GACpB,aAAa,aAAa;IAAE,GAAG;IAAS,QAAQ;GAAM,EAAE;EAC1D,CAAC,GACH,sBAAsB,CACxB;EAEA,aAAa,OAAO,aAAa,eAAe;CAClD,GAAG,CAAC,UAAU,kBAAkB,CAAC;CAEjC,CAAA,GAAA,eAAA,eAAA,CAAe,gBAAgB;EAC7B,YAAY,IAAI;EAChB,aAAa,gBAAgB,OAAO;EACpC,gBAAgB,UAAU,OAAO,kBAAA,GAE7BA,MAAAA,gBAAAA,OAAsB;GACpB,YAAY,KAAK;EACnB,CAAC,GACH,GACF;CACF,CAAC;CAED,CAAA,GAAA,eAAA,oBAAA,OAA0B;EACxB,YAAY,IAAI;EAChB,aAAa,gBAAgB,OAAO;EACpC,gBAAgB,UAAU,OAAO,kBAAA,GAE7BA,MAAAA,gBAAAA,OAAsB;GACpB,YAAY,KAAK;EACnB,CAAC,GACH,sBAAsB,CACxB;CACF,GAAG,CAAC,UAAU,kBAAkB,CAAC;CAEjC,OAAO,YAAY,SAAS;AAC9B"}
@@ -33,11 +33,19 @@ const varsResolver = require_create_vars_resolver.createVarsResolver((theme, { r
33
33
  theme
34
34
  });
35
35
  const outlineColor = parsedColor.isThemeColor && parsedColor.shade === void 0 ? `var(--mantine-color-${parsedColor.color}-outline)` : parsedColor.color;
36
+ const lightColors = variant === "light" ? theme.variantColorResolver({
37
+ color: color || theme.primaryColor,
38
+ theme,
39
+ variant: "light",
40
+ autoContrast
41
+ }) : void 0;
42
+ const resolvedColor = variant === "outline" ? outlineColor : lightColors ? lightColors.color : require_get_theme_color.getThemeColor(color, theme);
36
43
  return { root: {
37
44
  "--checkbox-size": require_get_size.getSize(size, "checkbox-size"),
38
45
  "--checkbox-radius": radius === void 0 ? void 0 : require_get_size.getRadius(radius),
39
- "--checkbox-color": variant === "outline" ? outlineColor : require_get_theme_color.getThemeColor(color, theme),
40
- "--checkbox-icon-color": iconColor ? require_get_theme_color.getThemeColor(iconColor, theme) : require_get_auto_contrast_value.getAutoContrastValue(autoContrast, theme) ? require_get_contrast_color.getContrastColor({
46
+ "--checkbox-color": resolvedColor,
47
+ "--checkbox-bg": lightColors?.background,
48
+ "--checkbox-icon-color": iconColor ? require_get_theme_color.getThemeColor(iconColor, theme) : lightColors ? lightColors.color : require_get_auto_contrast_value.getAutoContrastValue(autoContrast, theme) ? require_get_contrast_color.getContrastColor({
41
49
  color,
42
50
  theme,
43
51
  autoContrast