@mantine/core 9.3.1 → 9.4.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 (876) hide show
  1. package/cjs/components/Accordion/Accordion.cjs +1 -0
  2. package/cjs/components/Accordion/Accordion.cjs.map +1 -1
  3. package/cjs/components/Accordion/Accordion.context.cjs.map +1 -1
  4. package/cjs/components/Accordion/AccordionChevron.cjs.map +1 -1
  5. package/cjs/components/Accordion/AccordionControl/AccordionControl.cjs.map +1 -1
  6. package/cjs/components/Accordion/AccordionItem/AccordionItem.cjs.map +1 -1
  7. package/cjs/components/Accordion/AccordionItem.context.cjs.map +1 -1
  8. package/cjs/components/Accordion/AccordionPanel/AccordionPanel.cjs.map +1 -1
  9. package/cjs/components/ActionIcon/ActionIcon.cjs +1 -0
  10. package/cjs/components/ActionIcon/ActionIcon.cjs.map +1 -1
  11. package/cjs/components/ActionIcon/ActionIconGroup/ActionIconGroup.cjs +1 -1
  12. package/cjs/components/ActionIcon/ActionIconGroup/ActionIconGroup.cjs.map +1 -1
  13. package/cjs/components/ActionIcon/ActionIconGroupSection/ActionIconGroupSection.cjs.map +1 -1
  14. package/cjs/components/Affix/Affix.cjs.map +1 -1
  15. package/cjs/components/Alert/Alert.cjs.map +1 -1
  16. package/cjs/components/Anchor/Anchor.cjs.map +1 -1
  17. package/cjs/components/AngleSlider/AngleSlider.cjs.map +1 -1
  18. package/cjs/components/AppShell/AppShell.cjs.map +1 -1
  19. package/cjs/components/AppShell/AppShell.context.cjs.map +1 -1
  20. package/cjs/components/AppShell/AppShellAside/AppShellAside.cjs.map +1 -1
  21. package/cjs/components/AppShell/AppShellFooter/AppShellFooter.cjs.map +1 -1
  22. package/cjs/components/AppShell/AppShellHeader/AppShellHeader.cjs.map +1 -1
  23. package/cjs/components/AppShell/AppShellMain/AppShellMain.cjs.map +1 -1
  24. package/cjs/components/AppShell/AppShellMediaStyles/AppShellMediaStyles.cjs.map +1 -1
  25. package/cjs/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.cjs.map +1 -1
  26. package/cjs/components/AppShell/AppShellMediaStyles/assign-footer-variables/assign-footer-variables.cjs.map +1 -1
  27. package/cjs/components/AppShell/AppShellMediaStyles/assign-header-variables/assign-header-variables.cjs.map +1 -1
  28. package/cjs/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.cjs.map +1 -1
  29. package/cjs/components/AppShell/AppShellMediaStyles/assign-padding-variables/assign-padding-variables.cjs.map +1 -1
  30. package/cjs/components/AppShell/AppShellMediaStyles/get-variables/get-variables.cjs.map +1 -1
  31. package/cjs/components/AppShell/AppShellMediaStyles/is-primitive-size/is-primitive-size.cjs.map +1 -1
  32. package/cjs/components/AppShell/AppShellMediaStyles/is-responsive-size/is-responsive-size.cjs.map +1 -1
  33. package/cjs/components/AppShell/AppShellNavbar/AppShellNavbar.cjs.map +1 -1
  34. package/cjs/components/AppShell/AppShellSection/AppShellSection.cjs.map +1 -1
  35. package/cjs/components/AppShell/use-resizing/use-resizing.cjs.map +1 -1
  36. package/cjs/components/AspectRatio/AspectRatio.cjs.map +1 -1
  37. package/cjs/components/Autocomplete/Autocomplete.cjs.map +1 -1
  38. package/cjs/components/Avatar/Avatar.cjs.map +1 -1
  39. package/cjs/components/Avatar/AvatarGroup/AvatarGroup.cjs.map +1 -1
  40. package/cjs/components/Avatar/AvatarPlaceholderIcon.cjs.map +1 -1
  41. package/cjs/components/Avatar/get-initials/get-initials.cjs.map +1 -1
  42. package/cjs/components/BackgroundImage/BackgroundImage.cjs.map +1 -1
  43. package/cjs/components/Badge/Badge.cjs.map +1 -1
  44. package/cjs/components/Blockquote/Blockquote.cjs.map +1 -1
  45. package/cjs/components/Blockquote/Blockquote.module.cjs.map +1 -1
  46. package/cjs/components/Breadcrumbs/Breadcrumbs.cjs.map +1 -1
  47. package/cjs/components/Burger/Burger.cjs.map +1 -1
  48. package/cjs/components/Button/Button.cjs.map +1 -1
  49. package/cjs/components/Button/ButtonGroup/ButtonGroup.cjs.map +1 -1
  50. package/cjs/components/Button/ButtonGroupSection/ButtonGroupSection.cjs.map +1 -1
  51. package/cjs/components/Card/Card.cjs.map +1 -1
  52. package/cjs/components/Card/Card.context.cjs.map +1 -1
  53. package/cjs/components/Card/CardSection/CardSection.cjs.map +1 -1
  54. package/cjs/components/Center/Center.cjs.map +1 -1
  55. package/cjs/components/Checkbox/CheckIcon.cjs.map +1 -1
  56. package/cjs/components/Checkbox/Checkbox.cjs +2 -1
  57. package/cjs/components/Checkbox/Checkbox.cjs.map +1 -1
  58. package/cjs/components/Checkbox/CheckboxCard/CheckboxCard.cjs.map +1 -1
  59. package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.cjs.map +1 -1
  60. package/cjs/components/Checkbox/CheckboxIndicator/CheckboxIndicator.cjs.map +1 -1
  61. package/cjs/components/Chip/Chip.cjs.map +1 -1
  62. package/cjs/components/Chip/ChipGroup/ChipGroup.cjs.map +1 -1
  63. package/cjs/components/CloseButton/CloseButton.cjs.map +1 -1
  64. package/cjs/components/CloseButton/CloseIcon.cjs.map +1 -1
  65. package/cjs/components/Code/Code.cjs.map +1 -1
  66. package/cjs/components/Collapse/Collapse.cjs.map +1 -1
  67. package/cjs/components/ColorInput/ColorInput.cjs.map +1 -1
  68. package/cjs/components/ColorInput/EyeDropperIcon.cjs.map +1 -1
  69. package/cjs/components/ColorPicker/AlphaSlider/AlphaSlider.cjs.map +1 -1
  70. package/cjs/components/ColorPicker/ColorPicker.cjs.map +1 -1
  71. package/cjs/components/ColorPicker/ColorPicker.context.cjs.map +1 -1
  72. package/cjs/components/ColorPicker/ColorSlider/ColorSlider.cjs.map +1 -1
  73. package/cjs/components/ColorPicker/HueSlider/HueSlider.cjs.map +1 -1
  74. package/cjs/components/ColorPicker/Saturation/Saturation.cjs.map +1 -1
  75. package/cjs/components/ColorPicker/Swatches/Swatches.cjs.map +1 -1
  76. package/cjs/components/ColorPicker/Thumb/Thumb.cjs.map +1 -1
  77. package/cjs/components/ColorPicker/converters/converters.cjs.map +1 -1
  78. package/cjs/components/ColorPicker/converters/parsers.cjs.map +1 -1
  79. package/cjs/components/ColorSwatch/ColorSwatch.cjs.map +1 -1
  80. package/cjs/components/Combobox/Combobox.cjs +1 -0
  81. package/cjs/components/Combobox/Combobox.cjs.map +1 -1
  82. package/cjs/components/Combobox/Combobox.context.cjs.map +1 -1
  83. package/cjs/components/Combobox/ComboboxChevron/ComboboxChevron.cjs.map +1 -1
  84. package/cjs/components/Combobox/ComboboxClearButton/ComboboxClearButton.cjs.map +1 -1
  85. package/cjs/components/Combobox/ComboboxDropdown/ComboboxDropdown.cjs.map +1 -1
  86. package/cjs/components/Combobox/ComboboxDropdownTarget/ComboboxDropdownTarget.cjs.map +1 -1
  87. package/cjs/components/Combobox/ComboboxEmpty/ComboboxEmpty.cjs.map +1 -1
  88. package/cjs/components/Combobox/ComboboxEventsTarget/ComboboxEventsTarget.cjs.map +1 -1
  89. package/cjs/components/Combobox/ComboboxFooter/ComboboxFooter.cjs.map +1 -1
  90. package/cjs/components/Combobox/ComboboxGroup/ComboboxGroup.cjs +3 -2
  91. package/cjs/components/Combobox/ComboboxGroup/ComboboxGroup.cjs.map +1 -1
  92. package/cjs/components/Combobox/ComboboxHeader/ComboboxHeader.cjs.map +1 -1
  93. package/cjs/components/Combobox/ComboboxHiddenInput/ComboboxHiddenInput.cjs.map +1 -1
  94. package/cjs/components/Combobox/ComboboxOption/ComboboxOption.cjs.map +1 -1
  95. package/cjs/components/Combobox/ComboboxOptions/ComboboxOptions.cjs.map +1 -1
  96. package/cjs/components/Combobox/ComboboxSearch/ComboboxSearch.cjs.map +1 -1
  97. package/cjs/components/Combobox/ComboboxTarget/ComboboxTarget.cjs.map +1 -1
  98. package/cjs/components/Combobox/OptionsDropdown/OptionsDropdown.cjs +2 -2
  99. package/cjs/components/Combobox/OptionsDropdown/OptionsDropdown.cjs.map +1 -1
  100. package/cjs/components/Combobox/OptionsDropdown/default-options-filter.cjs.map +1 -1
  101. package/cjs/components/Combobox/use-combobox/get-index/get-index.cjs.map +1 -1
  102. package/cjs/components/Combobox/use-combobox/use-combobox.cjs.map +1 -1
  103. package/cjs/components/Combobox/use-combobox/use-virtualized-combobox.cjs.map +1 -1
  104. package/cjs/components/Combobox/use-combobox-target-props/use-combobox-target-props.cjs.map +1 -1
  105. package/cjs/components/Combobox/use-pills-reorder/use-pills-reorder.cjs.map +1 -1
  106. package/cjs/components/ComboboxPopover/ComboboxPopover.cjs +218 -0
  107. package/cjs/components/ComboboxPopover/ComboboxPopover.cjs.map +1 -0
  108. package/cjs/components/ComboboxPopover/ComboboxPopoverTarget.cjs +45 -0
  109. package/cjs/components/ComboboxPopover/ComboboxPopoverTarget.cjs.map +1 -0
  110. package/cjs/components/Container/Container.cjs.map +1 -1
  111. package/cjs/components/CopyButton/CopyButton.cjs.map +1 -1
  112. package/cjs/components/DataList/DataList.cjs +61 -0
  113. package/cjs/components/DataList/DataList.cjs.map +1 -0
  114. package/cjs/components/DataList/DataList.context.cjs +8 -0
  115. package/cjs/components/DataList/DataList.context.cjs.map +1 -0
  116. package/cjs/components/DataList/DataList.module.cjs +12 -0
  117. package/cjs/components/DataList/DataList.module.cjs.map +1 -0
  118. package/cjs/components/DataList/DataListItem/DataListItem.cjs +32 -0
  119. package/cjs/components/DataList/DataListItem/DataListItem.cjs.map +1 -0
  120. package/cjs/components/DataList/DataListItemLabel/DataListItemLabel.cjs +33 -0
  121. package/cjs/components/DataList/DataListItemLabel/DataListItemLabel.cjs.map +1 -0
  122. package/cjs/components/DataList/DataListItemValue/DataListItemValue.cjs +33 -0
  123. package/cjs/components/DataList/DataListItemValue/DataListItemValue.cjs.map +1 -0
  124. package/cjs/components/Dialog/Dialog.cjs.map +1 -1
  125. package/cjs/components/Divider/Divider.cjs.map +1 -1
  126. package/cjs/components/Drawer/Drawer.cjs.map +1 -1
  127. package/cjs/components/Drawer/Drawer.context.cjs.map +1 -1
  128. package/cjs/components/Drawer/DrawerBody.cjs.map +1 -1
  129. package/cjs/components/Drawer/DrawerCloseButton.cjs.map +1 -1
  130. package/cjs/components/Drawer/DrawerContent.cjs.map +1 -1
  131. package/cjs/components/Drawer/DrawerHeader.cjs.map +1 -1
  132. package/cjs/components/Drawer/DrawerOverlay.cjs.map +1 -1
  133. package/cjs/components/Drawer/DrawerRoot.cjs.map +1 -1
  134. package/cjs/components/Drawer/DrawerStack.cjs.map +1 -1
  135. package/cjs/components/Drawer/DrawerTitle.cjs.map +1 -1
  136. package/cjs/components/EmptyState/EmptyState.cjs +102 -0
  137. package/cjs/components/EmptyState/EmptyState.cjs.map +1 -0
  138. package/cjs/components/EmptyState/EmptyState.context.cjs +8 -0
  139. package/cjs/components/EmptyState/EmptyState.context.cjs.map +1 -0
  140. package/cjs/components/EmptyState/EmptyState.module.cjs +14 -0
  141. package/cjs/components/EmptyState/EmptyState.module.cjs.map +1 -0
  142. package/cjs/components/EmptyState/EmptyStateActions/EmptyStateActions.cjs +28 -0
  143. package/cjs/components/EmptyState/EmptyStateActions/EmptyStateActions.cjs.map +1 -0
  144. package/cjs/components/EmptyState/EmptyStateDescription/EmptyStateDescription.cjs +29 -0
  145. package/cjs/components/EmptyState/EmptyStateDescription/EmptyStateDescription.cjs.map +1 -0
  146. package/cjs/components/EmptyState/EmptyStateIndicator/EmptyStateIndicator.cjs +29 -0
  147. package/cjs/components/EmptyState/EmptyStateIndicator/EmptyStateIndicator.cjs.map +1 -0
  148. package/cjs/components/EmptyState/EmptyStateTitle/EmptyStateTitle.cjs +30 -0
  149. package/cjs/components/EmptyState/EmptyStateTitle/EmptyStateTitle.cjs.map +1 -0
  150. package/cjs/components/Fieldset/Fieldset.cjs.map +1 -1
  151. package/cjs/components/FileButton/FileButton.cjs.map +1 -1
  152. package/cjs/components/FileInput/FileInput.cjs.map +1 -1
  153. package/cjs/components/Flex/Flex.cjs.map +1 -1
  154. package/cjs/components/FloatingIndicator/FloatingIndicator.cjs.map +1 -1
  155. package/cjs/components/FloatingIndicator/use-floating-indicator.cjs.map +1 -1
  156. package/cjs/components/FloatingWindow/FloatingWindow.cjs.map +1 -1
  157. package/cjs/components/FocusTrap/FocusTrap.cjs.map +1 -1
  158. package/cjs/components/Grid/Grid.cjs.map +1 -1
  159. package/cjs/components/Grid/Grid.context.cjs.map +1 -1
  160. package/cjs/components/Grid/GridCol/GridCol.cjs.map +1 -1
  161. package/cjs/components/Grid/GridCol/GridColVariables.cjs.map +1 -1
  162. package/cjs/components/Grid/GridVariables.cjs.map +1 -1
  163. package/cjs/components/Group/Group.cjs.map +1 -1
  164. package/cjs/components/Group/filter-falsy-children/filter-falsy-children.cjs.map +1 -1
  165. package/cjs/components/Highlight/Highlight.cjs.map +1 -1
  166. package/cjs/components/Highlight/highlighter/highlighter.cjs.map +1 -1
  167. package/cjs/components/HoverCard/HoverCard.cjs +1 -0
  168. package/cjs/components/HoverCard/HoverCard.cjs.map +1 -1
  169. package/cjs/components/HoverCard/HoverCard.context.cjs.map +1 -1
  170. package/cjs/components/HoverCard/HoverCardDropdown/HoverCardDropdown.cjs.map +1 -1
  171. package/cjs/components/HoverCard/HoverCardGroup/HoverCardGroup.cjs.map +1 -1
  172. package/cjs/components/HoverCard/HoverCardTarget/HoverCardTarget.cjs +10 -2
  173. package/cjs/components/HoverCard/HoverCardTarget/HoverCardTarget.cjs.map +1 -1
  174. package/cjs/components/HoverCard/use-hover-card.cjs +24 -0
  175. package/cjs/components/HoverCard/use-hover-card.cjs.map +1 -1
  176. package/cjs/components/Image/Image.cjs.map +1 -1
  177. package/cjs/components/Indicator/Indicator.cjs.map +1 -1
  178. package/cjs/components/Input/Input.cjs +7 -2
  179. package/cjs/components/Input/Input.cjs.map +1 -1
  180. package/cjs/components/Input/Input.context.cjs.map +1 -1
  181. package/cjs/components/Input/Input.module.cjs +1 -0
  182. package/cjs/components/Input/Input.module.cjs.map +1 -1
  183. package/cjs/components/Input/InputClearButton/InputClearButton.cjs.map +1 -1
  184. package/cjs/components/Input/InputClearSection/InputClearSection.cjs.map +1 -1
  185. package/cjs/components/Input/InputDescription/InputDescription.cjs.map +1 -1
  186. package/cjs/components/Input/InputError/InputError.cjs.map +1 -1
  187. package/cjs/components/Input/InputLabel/InputLabel.cjs.map +1 -1
  188. package/cjs/components/Input/InputPlaceholder/InputPlaceholder.cjs.map +1 -1
  189. package/cjs/components/Input/InputSuccess/InputSuccess.cjs +48 -0
  190. package/cjs/components/Input/InputSuccess/InputSuccess.cjs.map +1 -0
  191. package/cjs/components/Input/InputWrapper/InputWrapper.cjs +22 -5
  192. package/cjs/components/Input/InputWrapper/InputWrapper.cjs.map +1 -1
  193. package/cjs/components/Input/InputWrapper.context.cjs.map +1 -1
  194. package/cjs/components/Input/use-input-props.cjs +4 -1
  195. package/cjs/components/Input/use-input-props.cjs.map +1 -1
  196. package/cjs/components/InputBase/InputBase.cjs.map +1 -1
  197. package/cjs/components/JsonInput/JsonInput.cjs.map +1 -1
  198. package/cjs/components/JsonInput/validate-json/validate-json.cjs.map +1 -1
  199. package/cjs/components/Kbd/Kbd.cjs.map +1 -1
  200. package/cjs/components/List/List.cjs.map +1 -1
  201. package/cjs/components/List/List.context.cjs.map +1 -1
  202. package/cjs/components/List/ListItem/ListItem.cjs.map +1 -1
  203. package/cjs/components/Loader/Loader.cjs.map +1 -1
  204. package/cjs/components/Loader/loaders/Bars.cjs.map +1 -1
  205. package/cjs/components/Loader/loaders/Dots.cjs.map +1 -1
  206. package/cjs/components/Loader/loaders/Oval.cjs.map +1 -1
  207. package/cjs/components/LoadingOverlay/LoadingOverlay.cjs.map +1 -1
  208. package/cjs/components/Mark/Mark.cjs.map +1 -1
  209. package/cjs/components/Marquee/Marquee.cjs.map +1 -1
  210. package/cjs/components/MaskInput/MaskInput.cjs.map +1 -1
  211. package/cjs/components/MaskInput/use-mask-input-props.cjs.map +1 -1
  212. package/cjs/components/Menu/Menu.cjs.map +1 -1
  213. package/cjs/components/Menu/Menu.context.cjs.map +1 -1
  214. package/cjs/components/Menu/MenuCheckboxGroup/MenuCheckboxGroup.cjs.map +1 -1
  215. package/cjs/components/Menu/MenuCheckboxGroup/MenuCheckboxGroup.context.cjs.map +1 -1
  216. package/cjs/components/Menu/MenuCheckboxItem/MenuCheckboxItem.cjs.map +1 -1
  217. package/cjs/components/Menu/MenuContextMenu/MenuContextMenu.cjs.map +1 -1
  218. package/cjs/components/Menu/MenuDivider/MenuDivider.cjs.map +1 -1
  219. package/cjs/components/Menu/MenuDropdown/MenuDropdown.cjs.map +1 -1
  220. package/cjs/components/Menu/MenuItem/MenuItem.cjs.map +1 -1
  221. package/cjs/components/Menu/MenuLabel/MenuLabel.cjs.map +1 -1
  222. package/cjs/components/Menu/MenuRadioGroup/MenuRadioGroup.cjs.map +1 -1
  223. package/cjs/components/Menu/MenuRadioGroup/MenuRadioGroup.context.cjs.map +1 -1
  224. package/cjs/components/Menu/MenuRadioItem/MenuRadioItem.cjs.map +1 -1
  225. package/cjs/components/Menu/MenuSearch/MenuSearch.cjs.map +1 -1
  226. package/cjs/components/Menu/MenuSelectableItem/MenuSelectableItem.cjs.map +1 -1
  227. package/cjs/components/Menu/MenuSub/MenuSub.cjs.map +1 -1
  228. package/cjs/components/Menu/MenuSub/MenuSub.context.cjs.map +1 -1
  229. package/cjs/components/Menu/MenuSubDropdown/MenuSubDropdown.cjs.map +1 -1
  230. package/cjs/components/Menu/MenuSubItem/MenuSubItem.cjs.map +1 -1
  231. package/cjs/components/Menu/MenuSubTarget/MenuSubTarget.cjs.map +1 -1
  232. package/cjs/components/Menu/MenuTarget/MenuTarget.cjs.map +1 -1
  233. package/cjs/components/Menu/use-menu-type-ahead.cjs.map +1 -1
  234. package/cjs/components/Menubar/Menubar.cjs +146 -0
  235. package/cjs/components/Menubar/Menubar.cjs.map +1 -0
  236. package/cjs/components/Menubar/Menubar.context.cjs +12 -0
  237. package/cjs/components/Menubar/Menubar.context.cjs.map +1 -0
  238. package/cjs/components/Menubar/Menubar.module.cjs +10 -0
  239. package/cjs/components/Menubar/Menubar.module.cjs.map +1 -0
  240. package/cjs/components/Menubar/MenubarDropdown/MenubarDropdown.cjs +61 -0
  241. package/cjs/components/Menubar/MenubarDropdown/MenubarDropdown.cjs.map +1 -0
  242. package/cjs/components/Menubar/MenubarMenu/MenubarMenu.cjs +59 -0
  243. package/cjs/components/Menubar/MenubarMenu/MenubarMenu.cjs.map +1 -0
  244. package/cjs/components/Menubar/MenubarTarget/MenubarTarget.cjs +143 -0
  245. package/cjs/components/Menubar/MenubarTarget/MenubarTarget.cjs.map +1 -0
  246. package/cjs/components/Modal/Modal.cjs.map +1 -1
  247. package/cjs/components/Modal/Modal.context.cjs.map +1 -1
  248. package/cjs/components/Modal/ModalBody.cjs.map +1 -1
  249. package/cjs/components/Modal/ModalCloseButton.cjs.map +1 -1
  250. package/cjs/components/Modal/ModalContent.cjs.map +1 -1
  251. package/cjs/components/Modal/ModalHeader.cjs.map +1 -1
  252. package/cjs/components/Modal/ModalOverlay.cjs.map +1 -1
  253. package/cjs/components/Modal/ModalRoot.cjs.map +1 -1
  254. package/cjs/components/Modal/ModalStack.cjs.map +1 -1
  255. package/cjs/components/Modal/ModalTitle.cjs.map +1 -1
  256. package/cjs/components/Modal/use-modals-stack.cjs.map +1 -1
  257. package/cjs/components/ModalBase/ModalBase.cjs.map +1 -1
  258. package/cjs/components/ModalBase/ModalBase.context.cjs.map +1 -1
  259. package/cjs/components/ModalBase/ModalBaseBody.cjs.map +1 -1
  260. package/cjs/components/ModalBase/ModalBaseCloseButton.cjs.map +1 -1
  261. package/cjs/components/ModalBase/ModalBaseContent.cjs.map +1 -1
  262. package/cjs/components/ModalBase/ModalBaseHeader.cjs.map +1 -1
  263. package/cjs/components/ModalBase/ModalBaseOverlay.cjs.map +1 -1
  264. package/cjs/components/ModalBase/ModalBaseTitle.cjs.map +1 -1
  265. package/cjs/components/ModalBase/NativeScrollArea.cjs.map +1 -1
  266. package/cjs/components/ModalBase/use-lock-scroll.cjs.map +1 -1
  267. package/cjs/components/ModalBase/use-modal-body-id.cjs.map +1 -1
  268. package/cjs/components/ModalBase/use-modal-title-id.cjs.map +1 -1
  269. package/cjs/components/ModalBase/use-modal.cjs.map +1 -1
  270. package/cjs/components/MultiSelect/MultiSelect.cjs +4 -1
  271. package/cjs/components/MultiSelect/MultiSelect.cjs.map +1 -1
  272. package/cjs/components/MultiSelect/filter-picked-values.cjs.map +1 -1
  273. package/cjs/components/NativeSelect/NativeSelect.cjs.map +1 -1
  274. package/cjs/components/NativeSelect/NativeSelectOption.cjs.map +1 -1
  275. package/cjs/components/NavLink/NavLink.cjs.map +1 -1
  276. package/cjs/components/Notification/Notification.cjs.map +1 -1
  277. package/cjs/components/NumberFormatter/NumberFormatter.cjs.map +1 -1
  278. package/cjs/components/NumberInput/NumberInput.cjs.map +1 -1
  279. package/cjs/components/NumberInput/NumberInputChevron.cjs.map +1 -1
  280. package/cjs/components/OverflowList/OverflowList.cjs.map +1 -1
  281. package/cjs/components/OverflowList/get-row-position-data.cjs.map +1 -1
  282. package/cjs/components/OverflowList/use-dimensions.cjs.map +1 -1
  283. package/cjs/components/Overlay/Overlay.cjs.map +1 -1
  284. package/cjs/components/Pagination/Pagination.cjs.map +1 -1
  285. package/cjs/components/Pagination/Pagination.context.cjs.map +1 -1
  286. package/cjs/components/Pagination/Pagination.icons.cjs.map +1 -1
  287. package/cjs/components/Pagination/PaginationControl/PaginationControl.cjs.map +1 -1
  288. package/cjs/components/Pagination/PaginationDots/PaginationDots.cjs.map +1 -1
  289. package/cjs/components/Pagination/PaginationEdges/PaginationEdges.cjs.map +1 -1
  290. package/cjs/components/Pagination/PaginationItems/PaginationItems.cjs.map +1 -1
  291. package/cjs/components/Pagination/PaginationLabel/PaginationLabel.cjs.map +1 -1
  292. package/cjs/components/Pagination/PaginationRoot/PaginationRoot.cjs.map +1 -1
  293. package/cjs/components/Paper/Paper.cjs.map +1 -1
  294. package/cjs/components/PasswordInput/PasswordInput.cjs +13 -2
  295. package/cjs/components/PasswordInput/PasswordInput.cjs.map +1 -1
  296. package/cjs/components/PasswordInput/PasswordToggleIcon.cjs.map +1 -1
  297. package/cjs/components/Pill/Pill.cjs.map +1 -1
  298. package/cjs/components/Pill/PillGroup/PillGroup.cjs.map +1 -1
  299. package/cjs/components/PillsInput/PillsInput.cjs.map +1 -1
  300. package/cjs/components/PillsInput/PillsInput.context.cjs.map +1 -1
  301. package/cjs/components/PillsInput/PillsInputField/PillsInputField.cjs.map +1 -1
  302. package/cjs/components/PinInput/PinInput.cjs +2 -1
  303. package/cjs/components/PinInput/PinInput.cjs.map +1 -1
  304. package/cjs/components/PinInput/create-pin-array/create-pin-array.cjs.map +1 -1
  305. package/cjs/components/Popover/Popover.cjs +2 -1
  306. package/cjs/components/Popover/Popover.cjs.map +1 -1
  307. package/cjs/components/Popover/Popover.context.cjs.map +1 -1
  308. package/cjs/components/Popover/PopoverContextMenu/PopoverContextMenu.cjs.map +1 -1
  309. package/cjs/components/Popover/PopoverDropdown/PopoverDropdown.cjs +1 -0
  310. package/cjs/components/Popover/PopoverDropdown/PopoverDropdown.cjs.map +1 -1
  311. package/cjs/components/Popover/PopoverTarget/PopoverTarget.cjs.map +1 -1
  312. package/cjs/components/Popover/use-popover.cjs +23 -11
  313. package/cjs/components/Popover/use-popover.cjs.map +1 -1
  314. package/cjs/components/Portal/OptionalPortal.cjs.map +1 -1
  315. package/cjs/components/Portal/Portal.cjs.map +1 -1
  316. package/cjs/components/Progress/Progress.cjs.map +1 -1
  317. package/cjs/components/Progress/Progress.context.cjs.map +1 -1
  318. package/cjs/components/Progress/ProgressLabel/ProgressLabel.cjs.map +1 -1
  319. package/cjs/components/Progress/ProgressRoot/ProgressRoot.cjs.map +1 -1
  320. package/cjs/components/Progress/ProgressSection/ProgressSection.cjs.map +1 -1
  321. package/cjs/components/Radio/Radio.cjs.map +1 -1
  322. package/cjs/components/Radio/RadioCard/RadioCard.cjs.map +1 -1
  323. package/cjs/components/Radio/RadioGroup/RadioGroup.cjs.map +1 -1
  324. package/cjs/components/Radio/RadioIcon.cjs.map +1 -1
  325. package/cjs/components/Radio/RadioIndicator/RadioIndicator.cjs.map +1 -1
  326. package/cjs/components/Rating/Rating.cjs.map +1 -1
  327. package/cjs/components/Rating/Rating.context.cjs.map +1 -1
  328. package/cjs/components/Rating/RatingItem/RatingItem.cjs.map +1 -1
  329. package/cjs/components/Rating/StarSymbol/StarIcon.cjs.map +1 -1
  330. package/cjs/components/Rating/StarSymbol/StarSymbol.cjs.map +1 -1
  331. package/cjs/components/RingProgress/Curve/Curve.cjs.map +1 -1
  332. package/cjs/components/RingProgress/RingProgress.cjs.map +1 -1
  333. package/cjs/components/RingProgress/get-curves/get-curves.cjs.map +1 -1
  334. package/cjs/components/RollingNumber/DigitColumn.cjs.map +1 -1
  335. package/cjs/components/RollingNumber/RollingNumber.cjs.map +1 -1
  336. package/cjs/components/RollingNumber/get-digit-parts.cjs.map +1 -1
  337. package/cjs/components/RollingNumber/get-render-slots.cjs.map +1 -1
  338. package/cjs/components/ScrollArea/ScrollArea.cjs.map +1 -1
  339. package/cjs/components/ScrollArea/ScrollArea.context.cjs.map +1 -1
  340. package/cjs/components/ScrollArea/ScrollAreaCorner/ScrollAreaCorner.cjs.map +1 -1
  341. package/cjs/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.cjs.map +1 -1
  342. package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbar.cjs.map +1 -1
  343. package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarAuto.cjs.map +1 -1
  344. package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarHover.cjs.map +1 -1
  345. package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarScroll.cjs.map +1 -1
  346. package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarVisible.cjs.map +1 -1
  347. package/cjs/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.cjs.map +1 -1
  348. package/cjs/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.context.cjs.map +1 -1
  349. package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollbarX.cjs.map +1 -1
  350. package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollbarY.cjs.map +1 -1
  351. package/cjs/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.cjs.map +1 -1
  352. package/cjs/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.cjs +1 -0
  353. package/cjs/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.cjs.map +1 -1
  354. package/cjs/components/ScrollArea/use-resize-observer.cjs.map +1 -1
  355. package/cjs/components/ScrollArea/utils/add-unlinked-scroll-listener.cjs.map +1 -1
  356. package/cjs/components/ScrollArea/utils/get-scroll-position-from-pointer.cjs.map +1 -1
  357. package/cjs/components/ScrollArea/utils/get-thumb-offset-from-scroll.cjs.map +1 -1
  358. package/cjs/components/Scroller/Scroller.cjs.map +1 -1
  359. package/cjs/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
  360. package/cjs/components/Select/Select.cjs.map +1 -1
  361. package/cjs/components/SemiCircleProgress/SemiCircleProgress.cjs +4 -1
  362. package/cjs/components/SemiCircleProgress/SemiCircleProgress.cjs.map +1 -1
  363. package/cjs/components/SemiCircleProgress/SemiCircleProgress.module.cjs.map +1 -1
  364. package/cjs/components/SimpleGrid/SimpleGrid.cjs.map +1 -1
  365. package/cjs/components/SimpleGrid/SimpleGridVariables.cjs.map +1 -1
  366. package/cjs/components/Skeleton/Skeleton.cjs.map +1 -1
  367. package/cjs/components/Slider/Marks/Marks.cjs.map +1 -1
  368. package/cjs/components/Slider/RangeSlider/RangeSlider.cjs.map +1 -1
  369. package/cjs/components/Slider/Slider/Slider.cjs.map +1 -1
  370. package/cjs/components/Slider/Slider.context.cjs.map +1 -1
  371. package/cjs/components/Slider/SliderRoot/SliderRoot.cjs.map +1 -1
  372. package/cjs/components/Slider/Thumb/Thumb.cjs.map +1 -1
  373. package/cjs/components/Slider/Track/Track.cjs.map +1 -1
  374. package/cjs/components/Slider/utils/get-precision/get-precision.cjs.map +1 -1
  375. package/cjs/components/Slider/utils/get-step-mark-value/get-step-mark-value.cjs.map +1 -1
  376. package/cjs/components/Space/Space.cjs.map +1 -1
  377. package/cjs/components/Splitter/GripIcon.cjs.map +1 -1
  378. package/cjs/components/Splitter/Splitter.cjs +27 -4
  379. package/cjs/components/Splitter/Splitter.cjs.map +1 -1
  380. package/cjs/components/Splitter/Splitter.context.cjs.map +1 -1
  381. package/cjs/components/Splitter/SplitterPane/SplitterPane.cjs +1 -2
  382. package/cjs/components/Splitter/SplitterPane/SplitterPane.cjs.map +1 -1
  383. package/cjs/components/Spoiler/Spoiler.cjs.map +1 -1
  384. package/cjs/components/Stack/Stack.cjs.map +1 -1
  385. package/cjs/components/Stepper/Stepper.cjs.map +1 -1
  386. package/cjs/components/Stepper/Stepper.context.cjs.map +1 -1
  387. package/cjs/components/Stepper/StepperStep/StepperStep.cjs.map +1 -1
  388. package/cjs/components/Switch/Switch.cjs.map +1 -1
  389. package/cjs/components/Switch/SwitchGroup/SwitchGroup.cjs.map +1 -1
  390. package/cjs/components/Table/Table.cjs.map +1 -1
  391. package/cjs/components/Table/Table.components.cjs.map +1 -1
  392. package/cjs/components/Table/Table.context.cjs.map +1 -1
  393. package/cjs/components/Table/TableDataRenderer.cjs.map +1 -1
  394. package/cjs/components/Table/TableScrollContainer.cjs.map +1 -1
  395. package/cjs/components/TableOfContents/TableOfContents.cjs.map +1 -1
  396. package/cjs/components/Tabs/Tabs.cjs +16 -1
  397. package/cjs/components/Tabs/Tabs.cjs.map +1 -1
  398. package/cjs/components/Tabs/Tabs.context.cjs.map +1 -1
  399. package/cjs/components/Tabs/TabsList/TabsList.cjs.map +1 -1
  400. package/cjs/components/Tabs/TabsPanel/TabsPanel.cjs +6 -0
  401. package/cjs/components/Tabs/TabsPanel/TabsPanel.cjs.map +1 -1
  402. package/cjs/components/Tabs/TabsTab/TabsTab.cjs +1 -1
  403. package/cjs/components/Tabs/TabsTab/TabsTab.cjs.map +1 -1
  404. package/cjs/components/TagsInput/TagsInput.cjs +4 -1
  405. package/cjs/components/TagsInput/TagsInput.cjs.map +1 -1
  406. package/cjs/components/TagsInput/filter-picked-tags.cjs.map +1 -1
  407. package/cjs/components/TagsInput/get-splitted-tags.cjs.map +1 -1
  408. package/cjs/components/Text/Text.cjs.map +1 -1
  409. package/cjs/components/Text/Text.module.cjs.map +1 -1
  410. package/cjs/components/TextInput/TextInput.cjs.map +1 -1
  411. package/cjs/components/Textarea/Autosize.cjs +14 -0
  412. package/cjs/components/Textarea/Autosize.cjs.map +1 -1
  413. package/cjs/components/Textarea/Textarea.cjs.map +1 -1
  414. package/cjs/components/ThemeIcon/ThemeIcon.cjs.map +1 -1
  415. package/cjs/components/Timeline/Timeline.cjs.map +1 -1
  416. package/cjs/components/Timeline/Timeline.context.cjs.map +1 -1
  417. package/cjs/components/Timeline/TimelineItem/TimelineItem.cjs.map +1 -1
  418. package/cjs/components/Title/Title.cjs.map +1 -1
  419. package/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
  420. package/cjs/components/Tooltip/TooltipFloating/TooltipFloating.cjs.map +1 -1
  421. package/cjs/components/Tooltip/TooltipFloating/use-floating-tooltip.cjs.map +1 -1
  422. package/cjs/components/Tooltip/TooltipGroup/TooltipGroup.cjs.map +1 -1
  423. package/cjs/components/Tooltip/use-tooltip.cjs.map +1 -1
  424. package/cjs/components/Transition/Transition.cjs +17 -10
  425. package/cjs/components/Transition/Transition.cjs.map +1 -1
  426. package/cjs/components/Transition/get-transition-styles/get-transition-styles.cjs.map +1 -1
  427. package/cjs/components/Transition/use-transition.cjs.map +1 -1
  428. package/cjs/components/Tree/FlatTreeNode.cjs.map +1 -1
  429. package/cjs/components/Tree/Tree.cjs.map +1 -1
  430. package/cjs/components/Tree/TreeNode.cjs.map +1 -1
  431. package/cjs/components/Tree/filter-tree-data/filter-tree-data.cjs.map +1 -1
  432. package/cjs/components/Tree/is-node-checked/is-node-checked.cjs.map +1 -1
  433. package/cjs/components/Tree/is-node-indeterminate/is-node-indeterminate.cjs.map +1 -1
  434. package/cjs/components/Tree/use-tree-node-drag-drop.cjs.map +1 -1
  435. package/cjs/components/Tree/use-tree.cjs.map +1 -1
  436. package/cjs/components/TreeSelect/TreeSelect.cjs +7 -1
  437. package/cjs/components/TreeSelect/TreeSelect.cjs.map +1 -1
  438. package/cjs/components/TreeSelect/TreeSelectOption.cjs.map +1 -1
  439. package/cjs/components/TreeSelect/get-checked-values-by-strategy.cjs.map +1 -1
  440. package/cjs/components/Typography/Typography.cjs.map +1 -1
  441. package/cjs/components/UnstyledButton/UnstyledButton.cjs.map +1 -1
  442. package/cjs/components/VisuallyHidden/VisuallyHidden.cjs.map +1 -1
  443. package/cjs/core/Box/Box.cjs.map +1 -1
  444. package/cjs/core/Box/get-box-mod/get-box-mod.cjs.map +1 -1
  445. package/cjs/core/Box/get-box-style/get-box-style.cjs.map +1 -1
  446. package/cjs/core/Box/get-style-object/get-style-object.cjs.map +1 -1
  447. package/cjs/core/Box/style-props/parse-style-props/parse-style-props.cjs.map +1 -1
  448. package/cjs/core/Box/style-props/parse-style-props/sort-media-queries.cjs.map +1 -1
  449. package/cjs/core/Box/style-props/resolvers/border-resolver/border-resolver.cjs.map +1 -1
  450. package/cjs/core/Box/use-random-classname/use-random-classname.cjs.map +1 -1
  451. package/cjs/core/DirectionProvider/DirectionProvider.cjs.map +1 -1
  452. package/cjs/core/InlineStyles/InlineStyles.cjs.map +1 -1
  453. package/cjs/core/InlineStyles/css-object-to-string/css-object-to-string.cjs.map +1 -1
  454. package/cjs/core/InlineStyles/hash-styles.cjs.map +1 -1
  455. package/cjs/core/MantineProvider/ColorSchemeScript/ColorSchemeScript.cjs.map +1 -1
  456. package/cjs/core/MantineProvider/Mantine.context.cjs.map +1 -1
  457. package/cjs/core/MantineProvider/MantineClasses/MantineClasses.cjs.map +1 -1
  458. package/cjs/core/MantineProvider/MantineCssVariables/MantineCssVariables.cjs.map +1 -1
  459. package/cjs/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.cjs +5 -1
  460. package/cjs/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.cjs.map +1 -1
  461. package/cjs/core/MantineProvider/MantineCssVariables/get-css-color-variables.cjs.map +1 -1
  462. package/cjs/core/MantineProvider/MantineCssVariables/remove-default-variables.cjs.map +1 -1
  463. package/cjs/core/MantineProvider/MantineCssVariables/v8-css-variables-resolver.cjs +3 -1
  464. package/cjs/core/MantineProvider/MantineCssVariables/v8-css-variables-resolver.cjs.map +1 -1
  465. package/cjs/core/MantineProvider/MantineCssVariables/virtual-color/virtual-color.cjs.map +1 -1
  466. package/cjs/core/MantineProvider/MantineProvider.cjs.map +1 -1
  467. package/cjs/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs.map +1 -1
  468. package/cjs/core/MantineProvider/color-functions/colors-tuple/colors-tuple.cjs.map +1 -1
  469. package/cjs/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.cjs +3 -1
  470. package/cjs/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.cjs.map +1 -1
  471. package/cjs/core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.cjs +19 -3
  472. package/cjs/core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.cjs.map +1 -1
  473. package/cjs/core/MantineProvider/color-functions/parse-theme-color/parse-theme-color.cjs.map +1 -1
  474. package/cjs/core/MantineProvider/color-functions/to-rgba/to-rgba.cjs.map +1 -1
  475. package/cjs/core/MantineProvider/convert-css-variables/convert-css-variables.cjs.map +1 -1
  476. package/cjs/core/MantineProvider/convert-css-variables/css-variables-object-to-string.cjs.map +1 -1
  477. package/cjs/core/MantineProvider/use-mantine-color-scheme/use-computed-color-scheme.cjs.map +1 -1
  478. package/cjs/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.cjs.map +1 -1
  479. package/cjs/core/MantineProvider/use-mantine-color-scheme/use-provider-color-scheme.cjs.map +1 -1
  480. package/cjs/core/MantineProvider/use-props/use-props.cjs.map +1 -1
  481. package/cjs/core/MantineProvider/use-respect-reduce-motion/use-respect-reduce-motion.cjs.map +1 -1
  482. package/cjs/core/factory/factory.cjs.map +1 -1
  483. package/cjs/core/factory/polymorphic-factory.cjs.map +1 -1
  484. package/cjs/core/styles-api/use-styles/get-class-name/get-class-name.cjs.map +1 -1
  485. package/cjs/core/styles-api/use-styles/get-class-name/get-global-class-names/get-global-class-names.cjs.map +1 -1
  486. package/cjs/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.cjs.map +1 -1
  487. package/cjs/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.cjs.map +1 -1
  488. package/cjs/core/styles-api/use-styles/get-class-name/resolve-class-names/resolve-class-names.cjs.map +1 -1
  489. package/cjs/core/styles-api/use-styles/get-style/get-style.cjs.map +1 -1
  490. package/cjs/core/styles-api/use-styles/get-style/resolve-vars/merge-vars.cjs.map +1 -1
  491. package/cjs/core/styles-api/use-styles/use-styles.cjs.map +1 -1
  492. package/cjs/core/styles-api/use-styles/use-transformed-styles.cjs.map +1 -1
  493. package/cjs/core/utils/create-safe-context/create-safe-context.cjs.map +1 -1
  494. package/cjs/core/utils/create-scoped-keydown-handler/create-scoped-keydown-handler.cjs +3 -5
  495. package/cjs/core/utils/create-scoped-keydown-handler/create-scoped-keydown-handler.cjs.map +1 -1
  496. package/cjs/core/utils/create-use-external-events/create-use-external-events.cjs.map +1 -1
  497. package/cjs/core/utils/deep-merge/deep-merge.cjs.map +1 -1
  498. package/cjs/core/utils/filter-props/filter-props.cjs.map +1 -1
  499. package/cjs/core/utils/get-context-item-index/get-context-item-index.cjs.map +1 -1
  500. package/cjs/core/utils/get-safe-id/get-safe-id.cjs.map +1 -1
  501. package/cjs/core/utils/is-number-like/is-number-like.cjs.map +1 -1
  502. package/cjs/core/utils/units-converters/px.cjs.map +1 -1
  503. package/cjs/core/utils/units-converters/rem.cjs.map +1 -1
  504. package/cjs/core/utils/use-hovered/use-hovered.cjs.map +1 -1
  505. package/cjs/index.cjs +42 -2
  506. package/cjs/utils/Floating/FloatingArrow/FloatingArrow.cjs.map +1 -1
  507. package/cjs/utils/Floating/use-context-menu-handlers.cjs.map +1 -1
  508. package/cjs/utils/Floating/use-delayed-hover.cjs.map +1 -1
  509. package/cjs/utils/InlineInput/InlineInput.cjs.map +1 -1
  510. package/cjs/utils/InputsGroupFieldset/InputsGroupFieldset.cjs.map +1 -1
  511. package/esm/components/Accordion/Accordion.mjs +1 -0
  512. package/esm/components/Accordion/Accordion.mjs.map +1 -1
  513. package/esm/components/ActionIcon/ActionIcon.mjs +1 -0
  514. package/esm/components/ActionIcon/ActionIcon.mjs.map +1 -1
  515. package/esm/components/ActionIcon/ActionIconGroup/ActionIconGroup.mjs +1 -1
  516. package/esm/components/ActionIcon/ActionIconGroup/ActionIconGroup.mjs.map +1 -1
  517. package/esm/components/ActionIcon/ActionIconGroupSection/ActionIconGroupSection.mjs.map +1 -1
  518. package/esm/components/AppShell/AppShellFooter/AppShellFooter.mjs.map +1 -1
  519. package/esm/components/AppShell/AppShellHeader/AppShellHeader.mjs.map +1 -1
  520. package/esm/components/AppShell/AppShellMain/AppShellMain.mjs.map +1 -1
  521. package/esm/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.mjs.map +1 -1
  522. package/esm/components/AppShell/AppShellMediaStyles/assign-footer-variables/assign-footer-variables.mjs.map +1 -1
  523. package/esm/components/AppShell/AppShellMediaStyles/assign-header-variables/assign-header-variables.mjs.map +1 -1
  524. package/esm/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.mjs.map +1 -1
  525. package/esm/components/AppShell/AppShellMediaStyles/assign-padding-variables/assign-padding-variables.mjs.map +1 -1
  526. package/esm/components/AppShell/AppShellMediaStyles/get-variables/get-variables.mjs.map +1 -1
  527. package/esm/components/AppShell/AppShellMediaStyles/is-primitive-size/is-primitive-size.mjs.map +1 -1
  528. package/esm/components/AppShell/AppShellMediaStyles/is-responsive-size/is-responsive-size.mjs.map +1 -1
  529. package/esm/components/AspectRatio/AspectRatio.mjs.map +1 -1
  530. package/esm/components/Autocomplete/Autocomplete.mjs.map +1 -1
  531. package/esm/components/Avatar/AvatarGroup/AvatarGroup.mjs.map +1 -1
  532. package/esm/components/Avatar/get-initials/get-initials.mjs.map +1 -1
  533. package/esm/components/BackgroundImage/BackgroundImage.mjs.map +1 -1
  534. package/esm/components/Blockquote/Blockquote.mjs.map +1 -1
  535. package/esm/components/Blockquote/Blockquote.module.mjs.map +1 -1
  536. package/esm/components/Breadcrumbs/Breadcrumbs.mjs.map +1 -1
  537. package/esm/components/Button/ButtonGroup/ButtonGroup.mjs.map +1 -1
  538. package/esm/components/Button/ButtonGroupSection/ButtonGroupSection.mjs.map +1 -1
  539. package/esm/components/Checkbox/Checkbox.mjs +2 -1
  540. package/esm/components/Checkbox/Checkbox.mjs.map +1 -1
  541. package/esm/components/Collapse/Collapse.mjs.map +1 -1
  542. package/esm/components/ColorInput/ColorInput.mjs.map +1 -1
  543. package/esm/components/ColorPicker/ColorSlider/ColorSlider.mjs.map +1 -1
  544. package/esm/components/ColorPicker/converters/converters.mjs.map +1 -1
  545. package/esm/components/ColorPicker/converters/parsers.mjs.map +1 -1
  546. package/esm/components/Combobox/Combobox.mjs +1 -0
  547. package/esm/components/Combobox/Combobox.mjs.map +1 -1
  548. package/esm/components/Combobox/ComboboxEmpty/ComboboxEmpty.mjs.map +1 -1
  549. package/esm/components/Combobox/ComboboxFooter/ComboboxFooter.mjs.map +1 -1
  550. package/esm/components/Combobox/ComboboxGroup/ComboboxGroup.mjs +3 -2
  551. package/esm/components/Combobox/ComboboxGroup/ComboboxGroup.mjs.map +1 -1
  552. package/esm/components/Combobox/ComboboxHeader/ComboboxHeader.mjs.map +1 -1
  553. package/esm/components/Combobox/OptionsDropdown/OptionsDropdown.mjs +2 -2
  554. package/esm/components/Combobox/OptionsDropdown/OptionsDropdown.mjs.map +1 -1
  555. package/esm/components/Combobox/OptionsDropdown/default-options-filter.mjs.map +1 -1
  556. package/esm/components/Combobox/use-combobox/get-index/get-index.mjs.map +1 -1
  557. package/esm/components/Combobox/use-combobox/use-combobox.mjs.map +1 -1
  558. package/esm/components/Combobox/use-pills-reorder/use-pills-reorder.mjs.map +1 -1
  559. package/esm/components/ComboboxPopover/ComboboxPopover.mjs +216 -0
  560. package/esm/components/ComboboxPopover/ComboboxPopover.mjs.map +1 -0
  561. package/esm/components/ComboboxPopover/ComboboxPopoverTarget.mjs +45 -0
  562. package/esm/components/ComboboxPopover/ComboboxPopoverTarget.mjs.map +1 -0
  563. package/esm/components/DataList/DataList.context.mjs +8 -0
  564. package/esm/components/DataList/DataList.context.mjs.map +1 -0
  565. package/esm/components/DataList/DataList.mjs +61 -0
  566. package/esm/components/DataList/DataList.mjs.map +1 -0
  567. package/esm/components/DataList/DataList.module.mjs +12 -0
  568. package/esm/components/DataList/DataList.module.mjs.map +1 -0
  569. package/esm/components/DataList/DataListItem/DataListItem.mjs +32 -0
  570. package/esm/components/DataList/DataListItem/DataListItem.mjs.map +1 -0
  571. package/esm/components/DataList/DataListItemLabel/DataListItemLabel.mjs +33 -0
  572. package/esm/components/DataList/DataListItemLabel/DataListItemLabel.mjs.map +1 -0
  573. package/esm/components/DataList/DataListItemValue/DataListItemValue.mjs +33 -0
  574. package/esm/components/DataList/DataListItemValue/DataListItemValue.mjs.map +1 -0
  575. package/esm/components/Drawer/DrawerBody.mjs.map +1 -1
  576. package/esm/components/Drawer/DrawerCloseButton.mjs.map +1 -1
  577. package/esm/components/Drawer/DrawerHeader.mjs.map +1 -1
  578. package/esm/components/Drawer/DrawerOverlay.mjs.map +1 -1
  579. package/esm/components/Drawer/DrawerRoot.mjs.map +1 -1
  580. package/esm/components/Drawer/DrawerTitle.mjs.map +1 -1
  581. package/esm/components/EmptyState/EmptyState.context.mjs +8 -0
  582. package/esm/components/EmptyState/EmptyState.context.mjs.map +1 -0
  583. package/esm/components/EmptyState/EmptyState.mjs +102 -0
  584. package/esm/components/EmptyState/EmptyState.mjs.map +1 -0
  585. package/esm/components/EmptyState/EmptyState.module.mjs +14 -0
  586. package/esm/components/EmptyState/EmptyState.module.mjs.map +1 -0
  587. package/esm/components/EmptyState/EmptyStateActions/EmptyStateActions.mjs +28 -0
  588. package/esm/components/EmptyState/EmptyStateActions/EmptyStateActions.mjs.map +1 -0
  589. package/esm/components/EmptyState/EmptyStateDescription/EmptyStateDescription.mjs +29 -0
  590. package/esm/components/EmptyState/EmptyStateDescription/EmptyStateDescription.mjs.map +1 -0
  591. package/esm/components/EmptyState/EmptyStateIndicator/EmptyStateIndicator.mjs +29 -0
  592. package/esm/components/EmptyState/EmptyStateIndicator/EmptyStateIndicator.mjs.map +1 -0
  593. package/esm/components/EmptyState/EmptyStateTitle/EmptyStateTitle.mjs +30 -0
  594. package/esm/components/EmptyState/EmptyStateTitle/EmptyStateTitle.mjs.map +1 -0
  595. package/esm/components/FileInput/FileInput.mjs.map +1 -1
  596. package/esm/components/Grid/GridCol/GridColVariables.mjs.map +1 -1
  597. package/esm/components/Grid/GridVariables.mjs.map +1 -1
  598. package/esm/components/Group/Group.mjs.map +1 -1
  599. package/esm/components/Group/filter-falsy-children/filter-falsy-children.mjs.map +1 -1
  600. package/esm/components/Highlight/highlighter/highlighter.mjs.map +1 -1
  601. package/esm/components/HoverCard/HoverCard.context.mjs.map +1 -1
  602. package/esm/components/HoverCard/HoverCard.mjs +1 -0
  603. package/esm/components/HoverCard/HoverCard.mjs.map +1 -1
  604. package/esm/components/HoverCard/HoverCardDropdown/HoverCardDropdown.mjs.map +1 -1
  605. package/esm/components/HoverCard/HoverCardTarget/HoverCardTarget.mjs +10 -2
  606. package/esm/components/HoverCard/HoverCardTarget/HoverCardTarget.mjs.map +1 -1
  607. package/esm/components/HoverCard/use-hover-card.mjs +24 -0
  608. package/esm/components/HoverCard/use-hover-card.mjs.map +1 -1
  609. package/esm/components/Input/Input.mjs +7 -2
  610. package/esm/components/Input/Input.mjs.map +1 -1
  611. package/esm/components/Input/Input.module.mjs +1 -0
  612. package/esm/components/Input/Input.module.mjs.map +1 -1
  613. package/esm/components/Input/InputDescription/InputDescription.mjs.map +1 -1
  614. package/esm/components/Input/InputError/InputError.mjs.map +1 -1
  615. package/esm/components/Input/InputPlaceholder/InputPlaceholder.mjs.map +1 -1
  616. package/esm/components/Input/InputSuccess/InputSuccess.mjs +48 -0
  617. package/esm/components/Input/InputSuccess/InputSuccess.mjs.map +1 -0
  618. package/esm/components/Input/InputWrapper/InputWrapper.mjs +22 -5
  619. package/esm/components/Input/InputWrapper/InputWrapper.mjs.map +1 -1
  620. package/esm/components/Input/use-input-props.mjs +4 -1
  621. package/esm/components/Input/use-input-props.mjs.map +1 -1
  622. package/esm/components/JsonInput/validate-json/validate-json.mjs.map +1 -1
  623. package/esm/components/Kbd/Kbd.mjs.map +1 -1
  624. package/esm/components/Mark/Mark.mjs.map +1 -1
  625. package/esm/components/Marquee/Marquee.mjs.map +1 -1
  626. package/esm/components/Menu/MenuDivider/MenuDivider.mjs.map +1 -1
  627. package/esm/components/Menu/MenuDropdown/MenuDropdown.mjs.map +1 -1
  628. package/esm/components/Menu/MenuItem/MenuItem.mjs.map +1 -1
  629. package/esm/components/Menu/MenuLabel/MenuLabel.mjs.map +1 -1
  630. package/esm/components/Menu/MenuSearch/MenuSearch.mjs.map +1 -1
  631. package/esm/components/Menu/MenuSelectableItem/MenuSelectableItem.mjs.map +1 -1
  632. package/esm/components/Menu/MenuSub/MenuSub.mjs.map +1 -1
  633. package/esm/components/Menu/MenuSubItem/MenuSubItem.mjs.map +1 -1
  634. package/esm/components/Menu/use-menu-type-ahead.mjs.map +1 -1
  635. package/esm/components/Menubar/Menubar.context.mjs +9 -0
  636. package/esm/components/Menubar/Menubar.context.mjs.map +1 -0
  637. package/esm/components/Menubar/Menubar.mjs +146 -0
  638. package/esm/components/Menubar/Menubar.mjs.map +1 -0
  639. package/esm/components/Menubar/Menubar.module.mjs +10 -0
  640. package/esm/components/Menubar/Menubar.module.mjs.map +1 -0
  641. package/esm/components/Menubar/MenubarDropdown/MenubarDropdown.mjs +61 -0
  642. package/esm/components/Menubar/MenubarDropdown/MenubarDropdown.mjs.map +1 -0
  643. package/esm/components/Menubar/MenubarMenu/MenubarMenu.mjs +59 -0
  644. package/esm/components/Menubar/MenubarMenu/MenubarMenu.mjs.map +1 -0
  645. package/esm/components/Menubar/MenubarTarget/MenubarTarget.mjs +143 -0
  646. package/esm/components/Menubar/MenubarTarget/MenubarTarget.mjs.map +1 -0
  647. package/esm/components/Modal/ModalBody.mjs.map +1 -1
  648. package/esm/components/Modal/ModalCloseButton.mjs.map +1 -1
  649. package/esm/components/Modal/ModalHeader.mjs.map +1 -1
  650. package/esm/components/Modal/ModalOverlay.mjs.map +1 -1
  651. package/esm/components/Modal/ModalTitle.mjs.map +1 -1
  652. package/esm/components/ModalBase/ModalBase.mjs.map +1 -1
  653. package/esm/components/MultiSelect/MultiSelect.mjs +4 -1
  654. package/esm/components/MultiSelect/MultiSelect.mjs.map +1 -1
  655. package/esm/components/MultiSelect/filter-picked-values.mjs.map +1 -1
  656. package/esm/components/NativeSelect/NativeSelect.mjs.map +1 -1
  657. package/esm/components/NativeSelect/NativeSelectOption.mjs.map +1 -1
  658. package/esm/components/NumberInput/NumberInput.mjs.map +1 -1
  659. package/esm/components/OverflowList/OverflowList.mjs.map +1 -1
  660. package/esm/components/OverflowList/get-row-position-data.mjs.map +1 -1
  661. package/esm/components/OverflowList/use-dimensions.mjs.map +1 -1
  662. package/esm/components/Overlay/Overlay.mjs.map +1 -1
  663. package/esm/components/Pagination/Pagination.icons.mjs.map +1 -1
  664. package/esm/components/Pagination/Pagination.mjs.map +1 -1
  665. package/esm/components/Pagination/PaginationDots/PaginationDots.mjs.map +1 -1
  666. package/esm/components/Pagination/PaginationItems/PaginationItems.mjs.map +1 -1
  667. package/esm/components/PasswordInput/PasswordInput.mjs +13 -2
  668. package/esm/components/PasswordInput/PasswordInput.mjs.map +1 -1
  669. package/esm/components/Pill/PillGroup/PillGroup.mjs.map +1 -1
  670. package/esm/components/PillsInput/PillsInput.mjs.map +1 -1
  671. package/esm/components/PinInput/PinInput.mjs +2 -1
  672. package/esm/components/PinInput/PinInput.mjs.map +1 -1
  673. package/esm/components/PinInput/create-pin-array/create-pin-array.mjs.map +1 -1
  674. package/esm/components/Popover/Popover.context.mjs.map +1 -1
  675. package/esm/components/Popover/Popover.mjs +2 -1
  676. package/esm/components/Popover/Popover.mjs.map +1 -1
  677. package/esm/components/Popover/PopoverDropdown/PopoverDropdown.mjs +1 -0
  678. package/esm/components/Popover/PopoverDropdown/PopoverDropdown.mjs.map +1 -1
  679. package/esm/components/Popover/use-popover.mjs +23 -11
  680. package/esm/components/Popover/use-popover.mjs.map +1 -1
  681. package/esm/components/Portal/Portal.mjs.map +1 -1
  682. package/esm/components/Progress/ProgressLabel/ProgressLabel.mjs.map +1 -1
  683. package/esm/components/Radio/Radio.mjs.map +1 -1
  684. package/esm/components/Radio/RadioCard/RadioCard.mjs.map +1 -1
  685. package/esm/components/Rating/Rating.mjs.map +1 -1
  686. package/esm/components/Rating/RatingItem/RatingItem.mjs.map +1 -1
  687. package/esm/components/Rating/StarSymbol/StarSymbol.mjs.map +1 -1
  688. package/esm/components/RingProgress/RingProgress.mjs.map +1 -1
  689. package/esm/components/RingProgress/get-curves/get-curves.mjs.map +1 -1
  690. package/esm/components/RollingNumber/get-digit-parts.mjs.map +1 -1
  691. package/esm/components/RollingNumber/get-render-slots.mjs.map +1 -1
  692. package/esm/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.mjs +1 -0
  693. package/esm/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.mjs.map +1 -1
  694. package/esm/components/ScrollArea/utils/add-unlinked-scroll-listener.mjs.map +1 -1
  695. package/esm/components/ScrollArea/utils/get-scroll-position-from-pointer.mjs.map +1 -1
  696. package/esm/components/ScrollArea/utils/get-thumb-offset-from-scroll.mjs.map +1 -1
  697. package/esm/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  698. package/esm/components/Select/Select.mjs.map +1 -1
  699. package/esm/components/SemiCircleProgress/SemiCircleProgress.mjs +4 -1
  700. package/esm/components/SemiCircleProgress/SemiCircleProgress.mjs.map +1 -1
  701. package/esm/components/SemiCircleProgress/SemiCircleProgress.module.mjs.map +1 -1
  702. package/esm/components/SimpleGrid/SimpleGridVariables.mjs.map +1 -1
  703. package/esm/components/Skeleton/Skeleton.mjs.map +1 -1
  704. package/esm/components/Slider/RangeSlider/RangeSlider.mjs.map +1 -1
  705. package/esm/components/Slider/Thumb/Thumb.mjs.map +1 -1
  706. package/esm/components/Slider/utils/get-precision/get-precision.mjs.map +1 -1
  707. package/esm/components/Slider/utils/get-step-mark-value/get-step-mark-value.mjs.map +1 -1
  708. package/esm/components/Splitter/Splitter.context.mjs.map +1 -1
  709. package/esm/components/Splitter/Splitter.mjs +27 -4
  710. package/esm/components/Splitter/Splitter.mjs.map +1 -1
  711. package/esm/components/Splitter/SplitterPane/SplitterPane.mjs +1 -2
  712. package/esm/components/Splitter/SplitterPane/SplitterPane.mjs.map +1 -1
  713. package/esm/components/Stack/Stack.mjs.map +1 -1
  714. package/esm/components/Stepper/Stepper.mjs.map +1 -1
  715. package/esm/components/Switch/Switch.mjs.map +1 -1
  716. package/esm/components/Table/Table.components.mjs.map +1 -1
  717. package/esm/components/TableOfContents/TableOfContents.mjs.map +1 -1
  718. package/esm/components/Tabs/Tabs.context.mjs.map +1 -1
  719. package/esm/components/Tabs/Tabs.mjs +18 -3
  720. package/esm/components/Tabs/Tabs.mjs.map +1 -1
  721. package/esm/components/Tabs/TabsPanel/TabsPanel.mjs +7 -1
  722. package/esm/components/Tabs/TabsPanel/TabsPanel.mjs.map +1 -1
  723. package/esm/components/Tabs/TabsTab/TabsTab.mjs +1 -1
  724. package/esm/components/Tabs/TabsTab/TabsTab.mjs.map +1 -1
  725. package/esm/components/TagsInput/TagsInput.mjs +4 -1
  726. package/esm/components/TagsInput/TagsInput.mjs.map +1 -1
  727. package/esm/components/TagsInput/filter-picked-tags.mjs.map +1 -1
  728. package/esm/components/TagsInput/get-splitted-tags.mjs.map +1 -1
  729. package/esm/components/Text/Text.mjs.map +1 -1
  730. package/esm/components/Text/Text.module.mjs.map +1 -1
  731. package/esm/components/Textarea/Autosize.mjs +14 -0
  732. package/esm/components/Textarea/Autosize.mjs.map +1 -1
  733. package/esm/components/ThemeIcon/ThemeIcon.mjs.map +1 -1
  734. package/esm/components/Title/Title.mjs.map +1 -1
  735. package/esm/components/Tooltip/Tooltip.mjs.map +1 -1
  736. package/esm/components/Tooltip/use-tooltip.mjs.map +1 -1
  737. package/esm/components/Transition/Transition.mjs +17 -10
  738. package/esm/components/Transition/Transition.mjs.map +1 -1
  739. package/esm/components/Transition/get-transition-styles/get-transition-styles.mjs.map +1 -1
  740. package/esm/components/Tree/FlatTreeNode.mjs.map +1 -1
  741. package/esm/components/Tree/TreeNode.mjs.map +1 -1
  742. package/esm/components/Tree/filter-tree-data/filter-tree-data.mjs.map +1 -1
  743. package/esm/components/Tree/is-node-checked/is-node-checked.mjs.map +1 -1
  744. package/esm/components/Tree/is-node-indeterminate/is-node-indeterminate.mjs.map +1 -1
  745. package/esm/components/Tree/use-tree.mjs.map +1 -1
  746. package/esm/components/TreeSelect/TreeSelect.mjs +7 -1
  747. package/esm/components/TreeSelect/TreeSelect.mjs.map +1 -1
  748. package/esm/components/TreeSelect/get-checked-values-by-strategy.mjs.map +1 -1
  749. package/esm/components/Typography/Typography.mjs.map +1 -1
  750. package/esm/components/UnstyledButton/UnstyledButton.mjs.map +1 -1
  751. package/esm/components/VisuallyHidden/VisuallyHidden.mjs.map +1 -1
  752. package/esm/core/Box/Box.mjs.map +1 -1
  753. package/esm/core/Box/get-box-mod/get-box-mod.mjs.map +1 -1
  754. package/esm/core/Box/get-box-style/get-box-style.mjs.map +1 -1
  755. package/esm/core/Box/get-style-object/get-style-object.mjs.map +1 -1
  756. package/esm/core/Box/style-props/parse-style-props/parse-style-props.mjs.map +1 -1
  757. package/esm/core/Box/style-props/parse-style-props/sort-media-queries.mjs.map +1 -1
  758. package/esm/core/Box/style-props/resolvers/border-resolver/border-resolver.mjs.map +1 -1
  759. package/esm/core/Box/use-random-classname/use-random-classname.mjs.map +1 -1
  760. package/esm/core/InlineStyles/InlineStyles.mjs.map +1 -1
  761. package/esm/core/InlineStyles/css-object-to-string/css-object-to-string.mjs.map +1 -1
  762. package/esm/core/InlineStyles/hash-styles.mjs.map +1 -1
  763. package/esm/core/MantineProvider/ColorSchemeScript/ColorSchemeScript.mjs.map +1 -1
  764. package/esm/core/MantineProvider/Mantine.context.mjs.map +1 -1
  765. package/esm/core/MantineProvider/MantineClasses/MantineClasses.mjs.map +1 -1
  766. package/esm/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.mjs +6 -2
  767. package/esm/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.mjs.map +1 -1
  768. package/esm/core/MantineProvider/MantineCssVariables/get-css-color-variables.mjs.map +1 -1
  769. package/esm/core/MantineProvider/MantineCssVariables/remove-default-variables.mjs.map +1 -1
  770. package/esm/core/MantineProvider/MantineCssVariables/v8-css-variables-resolver.mjs +3 -1
  771. package/esm/core/MantineProvider/MantineCssVariables/v8-css-variables-resolver.mjs.map +1 -1
  772. package/esm/core/MantineProvider/MantineCssVariables/virtual-color/virtual-color.mjs.map +1 -1
  773. package/esm/core/MantineProvider/color-functions/colors-tuple/colors-tuple.mjs.map +1 -1
  774. package/esm/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.mjs +3 -1
  775. package/esm/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.mjs.map +1 -1
  776. package/esm/core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.mjs +19 -4
  777. package/esm/core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.mjs.map +1 -1
  778. package/esm/core/MantineProvider/color-functions/parse-theme-color/parse-theme-color.mjs.map +1 -1
  779. package/esm/core/MantineProvider/color-functions/to-rgba/to-rgba.mjs.map +1 -1
  780. package/esm/core/MantineProvider/convert-css-variables/convert-css-variables.mjs.map +1 -1
  781. package/esm/core/MantineProvider/convert-css-variables/css-variables-object-to-string.mjs.map +1 -1
  782. package/esm/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.mjs.map +1 -1
  783. package/esm/core/MantineProvider/use-mantine-color-scheme/use-provider-color-scheme.mjs.map +1 -1
  784. package/esm/core/MantineProvider/use-props/use-props.mjs.map +1 -1
  785. package/esm/core/MantineProvider/use-respect-reduce-motion/use-respect-reduce-motion.mjs.map +1 -1
  786. package/esm/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.mjs.map +1 -1
  787. package/esm/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.mjs.map +1 -1
  788. package/esm/core/styles-api/use-styles/get-class-name/resolve-class-names/resolve-class-names.mjs.map +1 -1
  789. package/esm/core/styles-api/use-styles/get-style/get-style.mjs.map +1 -1
  790. package/esm/core/styles-api/use-styles/get-style/resolve-vars/merge-vars.mjs.map +1 -1
  791. package/esm/core/styles-api/use-styles/use-styles.mjs.map +1 -1
  792. package/esm/core/styles-api/use-styles/use-transformed-styles.mjs.map +1 -1
  793. package/esm/core/utils/create-scoped-keydown-handler/create-scoped-keydown-handler.mjs +3 -5
  794. package/esm/core/utils/create-scoped-keydown-handler/create-scoped-keydown-handler.mjs.map +1 -1
  795. package/esm/core/utils/create-use-external-events/create-use-external-events.mjs.map +1 -1
  796. package/esm/core/utils/deep-merge/deep-merge.mjs.map +1 -1
  797. package/esm/core/utils/filter-props/filter-props.mjs.map +1 -1
  798. package/esm/core/utils/get-context-item-index/get-context-item-index.mjs.map +1 -1
  799. package/esm/core/utils/get-safe-id/get-safe-id.mjs.map +1 -1
  800. package/esm/core/utils/is-number-like/is-number-like.mjs.map +1 -1
  801. package/esm/core/utils/units-converters/px.mjs.map +1 -1
  802. package/esm/core/utils/units-converters/rem.mjs.map +1 -1
  803. package/esm/index.mjs +23 -4
  804. package/lib/components/Accordion/Accordion.d.ts +4 -4
  805. package/lib/components/ActionIcon/ActionIcon.d.ts +3 -3
  806. package/lib/components/Combobox/Combobox.types.d.ts +4 -3
  807. package/lib/components/Combobox/OptionsDropdown/OptionsDropdown.d.ts +1 -1
  808. package/lib/components/Combobox/index.d.ts +1 -1
  809. package/lib/components/ComboboxPopover/ComboboxPopover.d.ts +110 -0
  810. package/lib/components/ComboboxPopover/ComboboxPopover.types.d.ts +2 -0
  811. package/lib/components/ComboboxPopover/ComboboxPopoverTarget.d.ts +16 -0
  812. package/lib/components/ComboboxPopover/index.d.ts +14 -0
  813. package/lib/components/DataList/DataList.context.d.ts +6 -0
  814. package/lib/components/DataList/DataList.d.ts +44 -0
  815. package/lib/components/DataList/DataListItem/DataListItem.d.ts +18 -0
  816. package/lib/components/DataList/DataListItemLabel/DataListItemLabel.d.ts +18 -0
  817. package/lib/components/DataList/DataListItemValue/DataListItemValue.d.ts +18 -0
  818. package/lib/components/DataList/index.d.ts +32 -0
  819. package/lib/components/EmptyState/EmptyState.context.d.ts +8 -0
  820. package/lib/components/EmptyState/EmptyState.d.ts +83 -0
  821. package/lib/components/EmptyState/EmptyStateActions/EmptyStateActions.d.ts +18 -0
  822. package/lib/components/EmptyState/EmptyStateDescription/EmptyStateDescription.d.ts +18 -0
  823. package/lib/components/EmptyState/EmptyStateIndicator/EmptyStateIndicator.d.ts +18 -0
  824. package/lib/components/EmptyState/EmptyStateTitle/EmptyStateTitle.d.ts +20 -0
  825. package/lib/components/EmptyState/index.d.ts +13 -0
  826. package/lib/components/HoverCard/HoverCard.context.d.ts +1 -0
  827. package/lib/components/HoverCard/use-hover-card.d.ts +1 -0
  828. package/lib/components/Input/Input.d.ts +11 -0
  829. package/lib/components/Input/InputSuccess/InputSuccess.d.ts +23 -0
  830. package/lib/components/Input/InputWrapper/InputWrapper.d.ts +7 -2
  831. package/lib/components/Input/index.d.ts +3 -1
  832. package/lib/components/Input/use-input-props.d.ts +8 -5
  833. package/lib/components/MaskInput/use-mask-input-props.d.ts +7 -3
  834. package/lib/components/Menubar/Menubar.context.d.ts +51 -0
  835. package/lib/components/Menubar/Menubar.d.ts +56 -0
  836. package/lib/components/Menubar/MenubarDropdown/MenubarDropdown.d.ts +7 -0
  837. package/lib/components/Menubar/MenubarMenu/MenubarMenu.d.ts +9 -0
  838. package/lib/components/Menubar/MenubarTarget/MenubarTarget.d.ts +14 -0
  839. package/lib/components/Menubar/index.d.ts +11 -0
  840. package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
  841. package/lib/components/NativeSelect/NativeSelect.d.ts +2 -2
  842. package/lib/components/Pagination/Pagination.icons.d.ts +1 -1
  843. package/lib/components/PinInput/PinInput.d.ts +2 -0
  844. package/lib/components/Popover/Popover.context.d.ts +1 -0
  845. package/lib/components/Popover/Popover.d.ts +7 -0
  846. package/lib/components/Slider/Thumb/Thumb.d.ts +1 -1
  847. package/lib/components/Splitter/Splitter.context.d.ts +3 -1
  848. package/lib/components/Splitter/Splitter.d.ts +12 -10
  849. package/lib/components/Splitter/SplitterPane/SplitterPane.d.ts +9 -8
  850. package/lib/components/Tabs/Tabs.context.d.ts +2 -0
  851. package/lib/components/Transition/Transition.d.ts +8 -1
  852. package/lib/components/index.d.ts +4 -0
  853. package/lib/core/Box/Box.d.ts +1 -1
  854. package/lib/core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.d.ts +7 -2
  855. package/lib/core/MantineProvider/color-functions/index.d.ts +1 -1
  856. package/lib/core/styles-api/styles-api.types.d.ts +2 -2
  857. package/lib/core/styles-api/use-styles/use-styles.d.ts +1 -1
  858. package/package.json +5 -5
  859. package/styles/Blockquote.css +1 -1
  860. package/styles/Blockquote.layer.css +1 -1
  861. package/styles/DataList.css +54 -0
  862. package/styles/DataList.layer.css +55 -0
  863. package/styles/EmptyState.css +121 -0
  864. package/styles/EmptyState.layer.css +122 -0
  865. package/styles/Input.css +21 -2
  866. package/styles/Input.layer.css +21 -2
  867. package/styles/Menubar.css +29 -0
  868. package/styles/Menubar.layer.css +30 -0
  869. package/styles/SemiCircleProgress.css +1 -0
  870. package/styles/SemiCircleProgress.layer.css +1 -0
  871. package/styles/Text.css +1 -1
  872. package/styles/Text.layer.css +1 -1
  873. package/styles/default-css-variables.css +2 -0
  874. package/styles/default-css-variables.layer.css +2 -0
  875. package/styles.css +233 -4
  876. package/styles.layer.css +233 -4
@@ -1 +1 @@
1
- {"version":3,"file":"RangeSlider.mjs","names":["classes"],"sources":["../../../../src/components/Slider/RangeSlider/RangeSlider.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { clamp, useMergedRef, useMove, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n findClosestNumber,\n getRadius,\n getSize,\n getThemeColor,\n MantineColor,\n MantineRadius,\n MantineSize,\n rem,\n StylesApiProps,\n useDirection,\n useProps,\n useStyles,\n} from '../../../core';\nimport { TransitionOverride } from '../../Transition';\nimport { SliderCssVariables, SliderProvider, SliderStylesNames } from '../Slider.context';\nimport { SliderMark } from '../SliderMark';\nimport { SliderRoot } from '../SliderRoot/SliderRoot';\nimport { Thumb } from '../Thumb/Thumb';\nimport { Track } from '../Track/Track';\nimport { getChangeValue } from '../utils/get-change-value/get-change-value';\nimport { getClientPosition } from '../utils/get-client-position/get-client-position';\nimport { getFloatingValue } from '../utils/get-floating-value/get-floating-value';\nimport { getPosition } from '../utils/get-position/get-position';\nimport { getPrecision } from '../utils/get-precision/get-precision';\nimport {\n getFirstMarkValue,\n getLastMarkValue,\n getNextMarkValue,\n getPreviousMarkValue,\n} from '../utils/get-step-mark-value/get-step-mark-value';\nimport classes from '../Slider.module.css';\n\nexport type RangeSliderValue = [number, number];\n\nexport interface RangeSliderProps\n extends\n BoxProps,\n StylesApiProps<RangeSliderFactory>,\n ElementProps<'div', 'onChange' | 'value' | 'defaultValue'> {\n /** Key of `theme.colors` or any valid CSS color, controls color of track and thumb @default theme.primaryColor */\n color?: MantineColor;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius`, numbers are converted to rem @default 'xl' */\n radius?: MantineRadius;\n\n /** Controls size of the track @default 'md' */\n size?: MantineSize | (string & {}) | number;\n\n /** Minimal possible value @default 0 */\n min?: number;\n\n /** Maximum possible value @default 100 */\n max?: number;\n\n /** Domain of the slider, defines the selectable value range independently of min/max. Useful when you want to display a wider track range (min/max) but restrict actual selection to a subset (domain). @default [min, max] */\n domain?: [number, number];\n\n /** Number by which value will be incremented/decremented with thumb drag and arrows @default 1 */\n step?: number;\n\n /** Number of significant digits after the decimal point */\n precision?: number;\n\n /** Controlled component value */\n value?: RangeSliderValue;\n\n /** Uncontrolled component default value */\n defaultValue?: RangeSliderValue;\n\n /** Called when value changes */\n onChange?: (value: RangeSliderValue) => void;\n\n /** Called when user stops dragging slider or changes value with arrows */\n onChangeEnd?: (value: RangeSliderValue) => void;\n\n /** Hidden input name, use with uncontrolled component */\n name?: string;\n\n /** Marks displayed on the track */\n marks?: SliderMark[];\n\n /** Function to generate label or any react node to render instead, set to null to disable label */\n label?: React.ReactNode | ((value: number) => React.ReactNode);\n\n /** Props passed down to the `Transition` component @default { transition: 'fade', duration: 0 } */\n labelTransitionProps?: TransitionOverride;\n\n /** Determines whether the label should be visible when the slider is not being dragged or hovered @default false */\n labelAlwaysOn?: boolean;\n\n /** Determines whether the label should be displayed when the slider is hovered @default true */\n showLabelOnHover?: boolean;\n\n /** Content rendered inside thumb */\n thumbChildren?: React.ReactNode;\n\n /** Disables slider */\n disabled?: boolean;\n\n /** Thumb `width` and `height`, by default value is computed based on `size` prop */\n thumbSize?: number | string;\n\n /** A transformation function to change the scale of the slider */\n scale?: (value: number) => number;\n\n /** Determines whether track values representation should be inverted @default false */\n inverted?: boolean;\n\n /** Slider orientation @default 'horizontal' */\n orientation?: 'horizontal' | 'vertical';\n\n /** Minimal range interval between the two thumbs. Consider this value relative to the total range (max - min). @default 10 */\n minRange?: number;\n\n /** Maximum range interval @default Infinity */\n maxRange?: number;\n\n /** `aria-label` for both thumbs (overridden by thumbFromLabel/thumbToLabel if provided) */\n thumbLabel?: string;\n\n /** `aria-valuetext` for both thumbs. When a function is provided, it receives the scaled value. */\n thumbValueText?: string | ((value: number) => string);\n\n /** First thumb `aria-label` */\n thumbFromLabel?: string;\n\n /** Second thumb `aria-label` */\n thumbToLabel?: string;\n\n /** Props passed down to the hidden input */\n hiddenInputProps?: React.ComponentProps<'input'>;\n\n /** Determines whether the selection should be only allowed from the given marks array @default false */\n restrictToMarks?: boolean;\n\n /** Props passed down to thumb element based on the thumb index */\n thumbProps?: (index: 0 | 1) => React.ComponentProps<'div'>;\n\n /** Determines whether the other thumb should be pushed by the current thumb dragging when `minRange`/`maxRange` is reached @default true */\n pushOnOverlap?: boolean;\n}\n\nexport type RangeSliderFactory = Factory<{\n props: RangeSliderProps;\n ref: HTMLDivElement;\n stylesNames: SliderStylesNames;\n vars: SliderCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<RangeSliderFactory>(\n (theme, { size, color, thumbSize, radius }) => ({\n root: {\n '--slider-size': getSize(size, 'slider-size'),\n '--slider-color': color ? getThemeColor(color, theme) : undefined,\n '--slider-radius': radius === undefined ? undefined : getRadius(radius),\n '--slider-thumb-size':\n thumbSize !== undefined ? rem(thumbSize) : 'calc(var(--slider-size) * 2)',\n },\n })\n);\n\nconst defaultProps = {\n min: 0,\n max: 100,\n minRange: 10,\n step: 1,\n marks: [],\n label: (f) => f,\n labelTransitionProps: { transition: 'fade', duration: 0 },\n labelAlwaysOn: false,\n showLabelOnHover: true,\n disabled: false,\n pushOnOverlap: true,\n scale: (v) => v,\n size: 'md',\n maxRange: Infinity,\n} satisfies Partial<RangeSliderProps>;\n\nexport const RangeSlider = factory<RangeSliderFactory>((_props) => {\n const props = useProps('RangeSlider', defaultProps, _props);\n const {\n classNames,\n styles,\n value,\n onChange,\n onChangeEnd,\n size,\n min,\n max,\n domain,\n minRange,\n maxRange,\n step,\n precision: _precision,\n defaultValue,\n name,\n marks,\n label,\n labelTransitionProps,\n labelAlwaysOn,\n thumbFromLabel,\n thumbToLabel,\n thumbValueText,\n showLabelOnHover,\n thumbChildren,\n disabled,\n unstyled,\n scale,\n inverted,\n orientation,\n className,\n style,\n vars,\n hiddenInputProps,\n restrictToMarks,\n thumbProps,\n pushOnOverlap,\n attributes,\n ref,\n ...others\n } = props;\n\n const getStyles = useStyles<RangeSliderFactory>({\n name: 'RangeSlider',\n props,\n classes,\n classNames,\n className,\n styles,\n style,\n attributes,\n vars,\n varsResolver,\n unstyled,\n });\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n const { dir } = useDirection();\n const [focused, setFocused] = useState(-1);\n const [hovered, setHovered] = useState(false);\n const [_value, setValue] = useUncontrolled<RangeSliderValue>({\n value,\n defaultValue,\n finalValue: [min, max],\n onChange,\n });\n const valueRef = useRef(_value);\n const thumbs = useRef<HTMLDivElement[]>([]);\n const root = useRef<HTMLDivElement>(null);\n const thumbIndex = useRef<number | undefined>(undefined);\n const [domainMin, domainMax] = domain || [min!, max!];\n const positions = [\n getPosition({ value: _value[0], min: domainMin, max: domainMax }),\n getPosition({ value: _value[1], min: domainMin, max: domainMax }),\n ];\n\n const precision = _precision ?? getPrecision(step);\n\n const _setValue = (val: RangeSliderValue) => {\n setValue(val);\n valueRef.current = val;\n };\n\n useEffect(\n () => {\n if (Array.isArray(value)) {\n valueRef.current = value;\n }\n },\n Array.isArray(value) ? [value[0], value[1]] : [null, null]\n );\n\n const setRangedValue = (val: number, index: number, triggerChangeEnd: boolean) => {\n if (index === -1) {\n return;\n }\n\n const clone: RangeSliderValue = [...valueRef.current];\n\n if (restrictToMarks && marks) {\n const closest = findClosestNumber(\n val,\n marks.map((m) => m.value)\n );\n\n const current = clone[index];\n clone[index] = closest;\n const otherIndex = index === 0 ? 1 : 0;\n\n const lastMarkValue = getLastMarkValue(marks);\n const firstMarkValue = getFirstMarkValue(marks);\n\n if (closest === lastMarkValue && clone[otherIndex] === lastMarkValue) {\n clone[index] = current;\n } else if (closest === firstMarkValue && clone[otherIndex] === firstMarkValue) {\n clone[index] = current;\n } else if (closest === clone[otherIndex]) {\n if (current > clone[otherIndex]) {\n clone[otherIndex] = getPreviousMarkValue(closest, marks);\n } else {\n clone[otherIndex] = getNextMarkValue(closest, marks);\n }\n }\n } else {\n const clampedVal = clamp(val, min!, max!);\n clone[index] = clampedVal;\n\n if (index === 0) {\n if (clampedVal > clone[1] - (minRange - 0.000000001)) {\n if (pushOnOverlap) {\n clone[1] = Math.min(val + minRange, max);\n } else {\n clone[index] = valueRef.current[index];\n }\n }\n\n if (clampedVal > (max - (minRange - 0.000000001) || min)) {\n clone[index] = valueRef.current[index];\n }\n\n if (clone[1] - val > maxRange) {\n if (pushOnOverlap) {\n clone[1] = val + maxRange;\n } else {\n clone[index] = valueRef.current[index];\n }\n }\n }\n\n if (index === 1) {\n if (clampedVal < clone[0] + minRange) {\n if (pushOnOverlap) {\n clone[0] = Math.max(val - minRange, min);\n } else {\n clone[index] = valueRef.current[index];\n }\n }\n\n if (clampedVal < clone[0] + minRange) {\n clone[index] = valueRef.current[index];\n }\n\n if (clampedVal - clone[0] > maxRange) {\n if (pushOnOverlap) {\n clone[0] = val - maxRange;\n } else {\n clone[index] = valueRef.current[index];\n }\n }\n }\n }\n\n clone[0] = getFloatingValue(clone[0], precision);\n clone[1] = getFloatingValue(clone[1], precision);\n\n if (clone[0] > clone[1]) {\n const temp = clone[0];\n clone[0] = clone[1];\n clone[1] = temp;\n }\n\n _setValue(clone);\n\n if (triggerChangeEnd) {\n onChangeEnd?.(valueRef.current);\n }\n };\n\n const handleChange = (val: number) => {\n if (!disabled && thumbIndex.current !== undefined) {\n const nextValue = getChangeValue({\n value: val,\n min: domainMin,\n max: domainMax,\n step,\n precision,\n });\n setRangedValue(nextValue, thumbIndex.current, false);\n }\n };\n\n const { ref: useMoveRef, active } = useMove(\n ({ x, y }) => handleChange(orientation === 'vertical' ? 1 - y : x),\n { onScrubEnd: () => !disabled && onChangeEnd?.(valueRef.current) },\n dir\n );\n\n function handleThumbMouseDown(index: number) {\n thumbIndex.current = index;\n }\n\n const handleTrackMouseDownCapture = (\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n ) => {\n if (containerRef.current) {\n containerRef.current.focus();\n const rect = containerRef.current.getBoundingClientRect();\n const changePosition = getClientPosition(event.nativeEvent, orientation);\n\n const changeValue =\n orientation === 'vertical'\n ? getChangeValue({\n value: rect.bottom - changePosition,\n max,\n min,\n step,\n containerWidth: rect.height,\n })\n : getChangeValue({\n value: changePosition - rect.left,\n max,\n min,\n step,\n containerWidth: rect.width,\n });\n\n const nearestHandle =\n Math.abs(_value[0] - changeValue) > Math.abs(_value[1] - changeValue) ? 1 : 0;\n const _nearestHandle =\n orientation === 'vertical'\n ? nearestHandle\n : dir === 'ltr'\n ? nearestHandle\n : nearestHandle === 1\n ? 0\n : 1;\n\n thumbIndex.current = _nearestHandle;\n }\n };\n\n const getFocusedThumbIndex = () => {\n if (focused !== 1 && focused !== 0) {\n setFocused(0);\n return 0;\n }\n\n return focused;\n };\n\n const handleTrackKeydownCapture = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (!disabled) {\n switch (event.key) {\n case 'ArrowUp': {\n event.preventDefault();\n const focusedIndex = getFocusedThumbIndex();\n thumbs.current[focusedIndex].focus();\n const nextValue =\n restrictToMarks && marks\n ? getNextMarkValue(valueRef.current[focusedIndex], marks)\n : Math.min(Math.max(valueRef.current[focusedIndex] + step, domainMin), domainMax);\n setRangedValue(getFloatingValue(nextValue, precision), focusedIndex, true);\n break;\n }\n\n case 'ArrowRight': {\n event.preventDefault();\n const focusedIndex = getFocusedThumbIndex();\n thumbs.current[focusedIndex].focus();\n\n const nextValue =\n restrictToMarks && marks\n ? (dir === 'rtl' ? getPreviousMarkValue : getNextMarkValue)(\n valueRef.current[focusedIndex],\n marks\n )\n : Math.min(\n Math.max(\n dir === 'rtl'\n ? valueRef.current[focusedIndex] - step\n : valueRef.current[focusedIndex] + step,\n domainMin\n ),\n domainMax\n );\n\n setRangedValue(getFloatingValue(nextValue, precision), focusedIndex, true);\n break;\n }\n\n case 'ArrowDown': {\n event.preventDefault();\n const focusedIndex = getFocusedThumbIndex();\n thumbs.current[focusedIndex].focus();\n const nextValue =\n restrictToMarks && marks\n ? getPreviousMarkValue(valueRef.current[focusedIndex], marks)\n : Math.min(Math.max(valueRef.current[focusedIndex] - step, domainMin), domainMax);\n setRangedValue(getFloatingValue(nextValue, precision), focusedIndex, true);\n break;\n }\n\n case 'ArrowLeft': {\n event.preventDefault();\n const focusedIndex = getFocusedThumbIndex();\n thumbs.current[focusedIndex].focus();\n\n const nextValue =\n restrictToMarks && marks\n ? (dir === 'rtl' ? getNextMarkValue : getPreviousMarkValue)(\n valueRef.current[focusedIndex],\n marks\n )\n : Math.min(\n Math.max(\n dir === 'rtl'\n ? valueRef.current[focusedIndex] + step\n : valueRef.current[focusedIndex] - step,\n domainMin\n ),\n domainMax\n );\n\n setRangedValue(getFloatingValue(nextValue, precision), focusedIndex, true);\n break;\n }\n\n default: {\n break;\n }\n }\n }\n };\n\n const sharedThumbProps = {\n max,\n min,\n size,\n labelTransitionProps,\n labelAlwaysOn,\n orientation,\n onBlur: () => setFocused(-1),\n };\n\n const hasArrayThumbChildren = Array.isArray(thumbChildren);\n\n return (\n <SliderProvider value={{ getStyles }}>\n <SliderRoot\n {...others}\n size={size}\n ref={useMergedRef(ref, root)}\n disabled={disabled}\n orientation={orientation}\n onMouseDownCapture={() => root.current?.focus()}\n onKeyDownCapture={() => {\n if (thumbs.current[0]?.parentElement?.contains(document.activeElement)) {\n return;\n }\n thumbs.current[0]?.focus();\n }}\n >\n <Track\n offset={positions[0]}\n marksOffset={_value[0]}\n filled={positions[1] - positions[0]}\n marks={marks}\n inverted={inverted}\n min={domainMin}\n max={domainMax}\n value={_value[1]}\n disabled={disabled}\n containerProps={{\n ref: useMergedRef(containerRef, useMoveRef) as any,\n onMouseEnter: showLabelOnHover ? () => setHovered(true) : undefined,\n onMouseLeave: showLabelOnHover ? () => setHovered(false) : undefined,\n onTouchStartCapture: handleTrackMouseDownCapture,\n onTouchEndCapture: () => {\n thumbIndex.current = -1;\n },\n onMouseDownCapture: handleTrackMouseDownCapture,\n onMouseUpCapture: () => {\n thumbIndex.current = -1;\n },\n onKeyDownCapture: handleTrackKeydownCapture,\n }}\n >\n <Thumb\n {...sharedThumbProps}\n value={scale(_value[0])}\n position={positions[0]}\n dragging={active}\n label={\n typeof label === 'function'\n ? label(getFloatingValue(scale(_value[0]), precision))\n : label\n }\n ref={(node) => {\n if (node) {\n thumbs.current[0] = node;\n }\n }}\n thumbLabel={thumbFromLabel}\n thumbValueText={thumbValueText}\n onMouseDown={() => handleThumbMouseDown(0)}\n onFocus={() => setFocused(0)}\n showLabelOnHover={showLabelOnHover}\n isHovered={hovered}\n disabled={disabled}\n {...thumbProps?.(0)}\n >\n {hasArrayThumbChildren ? thumbChildren[0] : thumbChildren}\n </Thumb>\n\n <Thumb\n {...sharedThumbProps}\n thumbLabel={thumbToLabel}\n value={scale(_value[1])}\n position={positions[1]}\n dragging={active}\n label={\n typeof label === 'function'\n ? label(getFloatingValue(scale(_value[1]), precision))\n : label\n }\n ref={(node) => {\n if (node) {\n thumbs.current[1] = node;\n }\n }}\n thumbValueText={thumbValueText}\n onMouseDown={() => handleThumbMouseDown(1)}\n onFocus={() => setFocused(1)}\n showLabelOnHover={showLabelOnHover}\n isHovered={hovered}\n disabled={disabled}\n {...thumbProps?.(1)}\n >\n {hasArrayThumbChildren ? thumbChildren[1] : thumbChildren}\n </Thumb>\n </Track>\n\n <input type=\"hidden\" name={`${name}_from`} value={_value[0]} {...hiddenInputProps} />\n <input type=\"hidden\" name={`${name}_to`} value={_value[1]} {...hiddenInputProps} />\n </SliderRoot>\n </SliderProvider>\n );\n});\n\nRangeSlider.classes = classes;\nRangeSlider.varsResolver = varsResolver;\nRangeSlider.displayName = '@mantine/core/RangeSlider';\n\nexport namespace RangeSlider {\n export type Props = RangeSliderProps;\n export type Value = RangeSliderValue;\n export type Factory = RangeSliderFactory;\n export type StylesNames = SliderStylesNames;\n export type CssVariables = SliderCssVariables;\n export type Mark = SliderMark;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6JA,MAAM,eAAe,oBAClB,OAAO,EAAE,MAAM,OAAO,WAAW,cAAc,EAC9C,MAAM;CACJ,iBAAiB,QAAQ,MAAM,aAAa;CAC5C,kBAAkB,QAAQ,cAAc,OAAO,KAAK,IAAI,KAAA;CACxD,mBAAmB,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,MAAM;CACtE,uBACE,cAAc,KAAA,IAAY,IAAI,SAAS,IAAI;AAC/C,EACF,EACF;AAEA,MAAM,eAAe;CACnB,KAAK;CACL,KAAK;CACL,UAAU;CACV,MAAM;CACN,OAAO,CAAC;CACR,QAAQ,MAAM;CACd,sBAAsB;EAAE,YAAY;EAAQ,UAAU;CAAE;CACxD,eAAe;CACf,kBAAkB;CAClB,UAAU;CACV,eAAe;CACf,QAAQ,MAAM;CACd,MAAM;CACN,UAAU;AACZ;AAEA,MAAa,cAAc,SAA6B,WAAW;CACjE,MAAM,QAAQ,SAAS,eAAe,cAAc,MAAM;CAC1D,MAAM,EACJ,YACA,QACA,OACA,UACA,aACA,MACA,KACA,KACA,QACA,UACA,UACA,MACA,WAAW,YACX,cACA,MACA,OACA,OACA,sBACA,eACA,gBACA,cACA,gBACA,kBACA,eACA,UACA,UACA,OACA,UACA,aACA,WACA,OACA,MACA,kBACA,iBACA,YACA,eACA,YACA,KACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAA8B;EAC9C,MAAM;EACN;EACA,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,eAAe,OAA8B,IAAI;CACvD,MAAM,EAAE,QA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,MACF,OAAO,QAAQ,KAAK;MAExB;MACgB;MAChB,mBAAmB,qBAAqB,CAAC;MACzC,eAAe,WAAW,CAAC;MACT;MAClB,WAAW;MACD;MACV,GAAI,aAAa,CAAC;gBAEjB,wBAAwB,cAAc,KAAK;KACvC,CAAA,CACF;;IAEP,oBAAC,SAAD;KAAO,MAAK;KAAS,MAAM,GAAG,KAAK;KAAQ,OAAO,OAAO;KAAI,GAAI;IAAmB,CAAA;IACpF,oBAAC,SAAD;KAAO,MAAK;KAAS,MAAM,GAAG,KAAK;KAAM,OAAO,OAAO;KAAI,GAAI;IAAmB,CAAA;GACxE;;CACE,CAAA;AAEpB,CAAC;AAED,YAAY,UAAUA;AACtB,YAAY,eAAe;AAC3B,YAAY,cAAc"}
1
+ {"version":3,"file":"RangeSlider.mjs","names":["classes"],"sources":["../../../../src/components/Slider/RangeSlider/RangeSlider.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { clamp, useMergedRef, useMove, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n findClosestNumber,\n getRadius,\n getSize,\n getThemeColor,\n MantineColor,\n MantineRadius,\n MantineSize,\n rem,\n StylesApiProps,\n useDirection,\n useProps,\n useStyles,\n} from '../../../core';\nimport { TransitionOverride } from '../../Transition';\nimport { SliderCssVariables, SliderProvider, SliderStylesNames } from '../Slider.context';\nimport { SliderMark } from '../SliderMark';\nimport { SliderRoot } from '../SliderRoot/SliderRoot';\nimport { Thumb } from '../Thumb/Thumb';\nimport { Track } from '../Track/Track';\nimport { getChangeValue } from '../utils/get-change-value/get-change-value';\nimport { getClientPosition } from '../utils/get-client-position/get-client-position';\nimport { getFloatingValue } from '../utils/get-floating-value/get-floating-value';\nimport { getPosition } from '../utils/get-position/get-position';\nimport { getPrecision } from '../utils/get-precision/get-precision';\nimport {\n getFirstMarkValue,\n getLastMarkValue,\n getNextMarkValue,\n getPreviousMarkValue,\n} from '../utils/get-step-mark-value/get-step-mark-value';\nimport classes from '../Slider.module.css';\n\nexport type RangeSliderValue = [number, number];\n\nexport interface RangeSliderProps\n extends\n BoxProps,\n StylesApiProps<RangeSliderFactory>,\n ElementProps<'div', 'onChange' | 'value' | 'defaultValue'> {\n /** Key of `theme.colors` or any valid CSS color, controls color of track and thumb @default theme.primaryColor */\n color?: MantineColor;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius`, numbers are converted to rem @default 'xl' */\n radius?: MantineRadius;\n\n /** Controls size of the track @default 'md' */\n size?: MantineSize | (string & {}) | number;\n\n /** Minimal possible value @default 0 */\n min?: number;\n\n /** Maximum possible value @default 100 */\n max?: number;\n\n /** Domain of the slider, defines the selectable value range independently of min/max. Useful when you want to display a wider track range (min/max) but restrict actual selection to a subset (domain). @default [min, max] */\n domain?: [number, number];\n\n /** Number by which value will be incremented/decremented with thumb drag and arrows @default 1 */\n step?: number;\n\n /** Number of significant digits after the decimal point */\n precision?: number;\n\n /** Controlled component value */\n value?: RangeSliderValue;\n\n /** Uncontrolled component default value */\n defaultValue?: RangeSliderValue;\n\n /** Called when value changes */\n onChange?: (value: RangeSliderValue) => void;\n\n /** Called when user stops dragging slider or changes value with arrows */\n onChangeEnd?: (value: RangeSliderValue) => void;\n\n /** Hidden input name, use with uncontrolled component */\n name?: string;\n\n /** Marks displayed on the track */\n marks?: SliderMark[];\n\n /** Function to generate label or any react node to render instead, set to null to disable label */\n label?: React.ReactNode | ((value: number) => React.ReactNode);\n\n /** Props passed down to the `Transition` component @default { transition: 'fade', duration: 0 } */\n labelTransitionProps?: TransitionOverride;\n\n /** Determines whether the label should be visible when the slider is not being dragged or hovered @default false */\n labelAlwaysOn?: boolean;\n\n /** Determines whether the label should be displayed when the slider is hovered @default true */\n showLabelOnHover?: boolean;\n\n /** Content rendered inside thumb */\n thumbChildren?: React.ReactNode;\n\n /** Disables slider */\n disabled?: boolean;\n\n /** Thumb `width` and `height`, by default value is computed based on `size` prop */\n thumbSize?: number | string;\n\n /** A transformation function to change the scale of the slider */\n scale?: (value: number) => number;\n\n /** Determines whether track values representation should be inverted @default false */\n inverted?: boolean;\n\n /** Slider orientation @default 'horizontal' */\n orientation?: 'horizontal' | 'vertical';\n\n /** Minimal range interval between the two thumbs. Consider this value relative to the total range (max - min). @default 10 */\n minRange?: number;\n\n /** Maximum range interval @default Infinity */\n maxRange?: number;\n\n /** `aria-label` for both thumbs (overridden by thumbFromLabel/thumbToLabel if provided) */\n thumbLabel?: string;\n\n /** `aria-valuetext` for both thumbs. When a function is provided, it receives the scaled value. */\n thumbValueText?: string | ((value: number) => string);\n\n /** First thumb `aria-label` */\n thumbFromLabel?: string;\n\n /** Second thumb `aria-label` */\n thumbToLabel?: string;\n\n /** Props passed down to the hidden input */\n hiddenInputProps?: React.ComponentProps<'input'>;\n\n /** Determines whether the selection should be only allowed from the given marks array @default false */\n restrictToMarks?: boolean;\n\n /** Props passed down to thumb element based on the thumb index */\n thumbProps?: (index: 0 | 1) => React.ComponentProps<'div'>;\n\n /** Determines whether the other thumb should be pushed by the current thumb dragging when `minRange`/`maxRange` is reached @default true */\n pushOnOverlap?: boolean;\n}\n\nexport type RangeSliderFactory = Factory<{\n props: RangeSliderProps;\n ref: HTMLDivElement;\n stylesNames: SliderStylesNames;\n vars: SliderCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<RangeSliderFactory>(\n (theme, { size, color, thumbSize, radius }) => ({\n root: {\n '--slider-size': getSize(size, 'slider-size'),\n '--slider-color': color ? getThemeColor(color, theme) : undefined,\n '--slider-radius': radius === undefined ? undefined : getRadius(radius),\n '--slider-thumb-size':\n thumbSize !== undefined ? rem(thumbSize) : 'calc(var(--slider-size) * 2)',\n },\n })\n);\n\nconst defaultProps = {\n min: 0,\n max: 100,\n minRange: 10,\n step: 1,\n marks: [],\n label: (f) => f,\n labelTransitionProps: { transition: 'fade', duration: 0 },\n labelAlwaysOn: false,\n showLabelOnHover: true,\n disabled: false,\n pushOnOverlap: true,\n scale: (v) => v,\n size: 'md',\n maxRange: Infinity,\n} satisfies Partial<RangeSliderProps>;\n\nexport const RangeSlider = factory<RangeSliderFactory>((_props) => {\n const props = useProps('RangeSlider', defaultProps, _props);\n const {\n classNames,\n styles,\n value,\n onChange,\n onChangeEnd,\n size,\n min,\n max,\n domain,\n minRange,\n maxRange,\n step,\n precision: _precision,\n defaultValue,\n name,\n marks,\n label,\n labelTransitionProps,\n labelAlwaysOn,\n thumbFromLabel,\n thumbToLabel,\n thumbValueText,\n showLabelOnHover,\n thumbChildren,\n disabled,\n unstyled,\n scale,\n inverted,\n orientation,\n className,\n style,\n vars,\n hiddenInputProps,\n restrictToMarks,\n thumbProps,\n pushOnOverlap,\n attributes,\n ref,\n ...others\n } = props;\n\n const getStyles = useStyles<RangeSliderFactory>({\n name: 'RangeSlider',\n props,\n classes,\n classNames,\n className,\n styles,\n style,\n attributes,\n vars,\n varsResolver,\n unstyled,\n });\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n const { dir } = useDirection();\n const [focused, setFocused] = useState(-1);\n const [hovered, setHovered] = useState(false);\n const [_value, setValue] = useUncontrolled<RangeSliderValue>({\n value,\n defaultValue,\n finalValue: [min, max],\n onChange,\n });\n const valueRef = useRef(_value);\n const thumbs = useRef<HTMLDivElement[]>([]);\n const root = useRef<HTMLDivElement>(null);\n const thumbIndex = useRef<number | undefined>(undefined);\n const [domainMin, domainMax] = domain || [min!, max!];\n const positions = [\n getPosition({ value: _value[0], min: domainMin, max: domainMax }),\n getPosition({ value: _value[1], min: domainMin, max: domainMax }),\n ];\n\n const precision = _precision ?? getPrecision(step);\n\n const _setValue = (val: RangeSliderValue) => {\n setValue(val);\n valueRef.current = val;\n };\n\n useEffect(\n () => {\n if (Array.isArray(value)) {\n valueRef.current = value;\n }\n },\n Array.isArray(value) ? [value[0], value[1]] : [null, null]\n );\n\n const setRangedValue = (val: number, index: number, triggerChangeEnd: boolean) => {\n if (index === -1) {\n return;\n }\n\n const clone: RangeSliderValue = [...valueRef.current];\n\n if (restrictToMarks && marks) {\n const closest = findClosestNumber(\n val,\n marks.map((m) => m.value)\n );\n\n const current = clone[index];\n clone[index] = closest;\n const otherIndex = index === 0 ? 1 : 0;\n\n const lastMarkValue = getLastMarkValue(marks);\n const firstMarkValue = getFirstMarkValue(marks);\n\n if (closest === lastMarkValue && clone[otherIndex] === lastMarkValue) {\n clone[index] = current;\n } else if (closest === firstMarkValue && clone[otherIndex] === firstMarkValue) {\n clone[index] = current;\n } else if (closest === clone[otherIndex]) {\n if (current > clone[otherIndex]) {\n clone[otherIndex] = getPreviousMarkValue(closest, marks);\n } else {\n clone[otherIndex] = getNextMarkValue(closest, marks);\n }\n }\n } else {\n const clampedVal = clamp(val, min!, max!);\n clone[index] = clampedVal;\n\n if (index === 0) {\n if (clampedVal > clone[1] - (minRange - 0.000000001)) {\n if (pushOnOverlap) {\n clone[1] = Math.min(val + minRange, max);\n } else {\n clone[index] = valueRef.current[index];\n }\n }\n\n if (clampedVal > (max - (minRange - 0.000000001) || min)) {\n clone[index] = valueRef.current[index];\n }\n\n if (clone[1] - val > maxRange) {\n if (pushOnOverlap) {\n clone[1] = val + maxRange;\n } else {\n clone[index] = valueRef.current[index];\n }\n }\n }\n\n if (index === 1) {\n if (clampedVal < clone[0] + minRange) {\n if (pushOnOverlap) {\n clone[0] = Math.max(val - minRange, min);\n } else {\n clone[index] = valueRef.current[index];\n }\n }\n\n if (clampedVal < clone[0] + minRange) {\n clone[index] = valueRef.current[index];\n }\n\n if (clampedVal - clone[0] > maxRange) {\n if (pushOnOverlap) {\n clone[0] = val - maxRange;\n } else {\n clone[index] = valueRef.current[index];\n }\n }\n }\n }\n\n clone[0] = getFloatingValue(clone[0], precision);\n clone[1] = getFloatingValue(clone[1], precision);\n\n if (clone[0] > clone[1]) {\n const temp = clone[0];\n clone[0] = clone[1];\n clone[1] = temp;\n }\n\n _setValue(clone);\n\n if (triggerChangeEnd) {\n onChangeEnd?.(valueRef.current);\n }\n };\n\n const handleChange = (val: number) => {\n if (!disabled && thumbIndex.current !== undefined) {\n const nextValue = getChangeValue({\n value: val,\n min: domainMin,\n max: domainMax,\n step,\n precision,\n });\n setRangedValue(nextValue, thumbIndex.current, false);\n }\n };\n\n const { ref: useMoveRef, active } = useMove(\n ({ x, y }) => handleChange(orientation === 'vertical' ? 1 - y : x),\n { onScrubEnd: () => !disabled && onChangeEnd?.(valueRef.current) },\n dir\n );\n\n function handleThumbMouseDown(index: number) {\n thumbIndex.current = index;\n }\n\n const handleTrackMouseDownCapture = (\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>\n ) => {\n if (containerRef.current) {\n containerRef.current.focus();\n const rect = containerRef.current.getBoundingClientRect();\n const changePosition = getClientPosition(event.nativeEvent, orientation);\n\n const changeValue =\n orientation === 'vertical'\n ? getChangeValue({\n value: rect.bottom - changePosition,\n max,\n min,\n step,\n containerWidth: rect.height,\n })\n : getChangeValue({\n value: changePosition - rect.left,\n max,\n min,\n step,\n containerWidth: rect.width,\n });\n\n const nearestHandle =\n Math.abs(_value[0] - changeValue) > Math.abs(_value[1] - changeValue) ? 1 : 0;\n const _nearestHandle =\n orientation === 'vertical'\n ? nearestHandle\n : dir === 'ltr'\n ? nearestHandle\n : nearestHandle === 1\n ? 0\n : 1;\n\n thumbIndex.current = _nearestHandle;\n }\n };\n\n const getFocusedThumbIndex = () => {\n if (focused !== 1 && focused !== 0) {\n setFocused(0);\n return 0;\n }\n\n return focused;\n };\n\n const handleTrackKeydownCapture = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (!disabled) {\n switch (event.key) {\n case 'ArrowUp': {\n event.preventDefault();\n const focusedIndex = getFocusedThumbIndex();\n thumbs.current[focusedIndex].focus();\n const nextValue =\n restrictToMarks && marks\n ? getNextMarkValue(valueRef.current[focusedIndex], marks)\n : Math.min(Math.max(valueRef.current[focusedIndex] + step, domainMin), domainMax);\n setRangedValue(getFloatingValue(nextValue, precision), focusedIndex, true);\n break;\n }\n\n case 'ArrowRight': {\n event.preventDefault();\n const focusedIndex = getFocusedThumbIndex();\n thumbs.current[focusedIndex].focus();\n\n const nextValue =\n restrictToMarks && marks\n ? (dir === 'rtl' ? getPreviousMarkValue : getNextMarkValue)(\n valueRef.current[focusedIndex],\n marks\n )\n : Math.min(\n Math.max(\n dir === 'rtl'\n ? valueRef.current[focusedIndex] - step\n : valueRef.current[focusedIndex] + step,\n domainMin\n ),\n domainMax\n );\n\n setRangedValue(getFloatingValue(nextValue, precision), focusedIndex, true);\n break;\n }\n\n case 'ArrowDown': {\n event.preventDefault();\n const focusedIndex = getFocusedThumbIndex();\n thumbs.current[focusedIndex].focus();\n const nextValue =\n restrictToMarks && marks\n ? getPreviousMarkValue(valueRef.current[focusedIndex], marks)\n : Math.min(Math.max(valueRef.current[focusedIndex] - step, domainMin), domainMax);\n setRangedValue(getFloatingValue(nextValue, precision), focusedIndex, true);\n break;\n }\n\n case 'ArrowLeft': {\n event.preventDefault();\n const focusedIndex = getFocusedThumbIndex();\n thumbs.current[focusedIndex].focus();\n\n const nextValue =\n restrictToMarks && marks\n ? (dir === 'rtl' ? getNextMarkValue : getPreviousMarkValue)(\n valueRef.current[focusedIndex],\n marks\n )\n : Math.min(\n Math.max(\n dir === 'rtl'\n ? valueRef.current[focusedIndex] + step\n : valueRef.current[focusedIndex] - step,\n domainMin\n ),\n domainMax\n );\n\n setRangedValue(getFloatingValue(nextValue, precision), focusedIndex, true);\n break;\n }\n\n default: {\n break;\n }\n }\n }\n };\n\n const sharedThumbProps = {\n max,\n min,\n size,\n labelTransitionProps,\n labelAlwaysOn,\n orientation,\n onBlur: () => setFocused(-1),\n };\n\n const hasArrayThumbChildren = Array.isArray(thumbChildren);\n\n return (\n <SliderProvider value={{ getStyles }}>\n <SliderRoot\n {...others}\n size={size}\n ref={useMergedRef(ref, root)}\n disabled={disabled}\n orientation={orientation}\n onMouseDownCapture={() => root.current?.focus()}\n onKeyDownCapture={() => {\n if (thumbs.current[0]?.parentElement?.contains(document.activeElement)) {\n return;\n }\n thumbs.current[0]?.focus();\n }}\n >\n <Track\n offset={positions[0]}\n marksOffset={_value[0]}\n filled={positions[1] - positions[0]}\n marks={marks}\n inverted={inverted}\n min={domainMin}\n max={domainMax}\n value={_value[1]}\n disabled={disabled}\n containerProps={{\n ref: useMergedRef(containerRef, useMoveRef) as any,\n onMouseEnter: showLabelOnHover ? () => setHovered(true) : undefined,\n onMouseLeave: showLabelOnHover ? () => setHovered(false) : undefined,\n onTouchStartCapture: handleTrackMouseDownCapture,\n onTouchEndCapture: () => {\n thumbIndex.current = -1;\n },\n onMouseDownCapture: handleTrackMouseDownCapture,\n onMouseUpCapture: () => {\n thumbIndex.current = -1;\n },\n onKeyDownCapture: handleTrackKeydownCapture,\n }}\n >\n <Thumb\n {...sharedThumbProps}\n value={scale(_value[0])}\n position={positions[0]}\n dragging={active}\n label={\n typeof label === 'function'\n ? label(getFloatingValue(scale(_value[0]), precision))\n : label\n }\n ref={(node) => {\n if (node) {\n thumbs.current[0] = node;\n }\n }}\n thumbLabel={thumbFromLabel}\n thumbValueText={thumbValueText}\n onMouseDown={() => handleThumbMouseDown(0)}\n onFocus={() => setFocused(0)}\n showLabelOnHover={showLabelOnHover}\n isHovered={hovered}\n disabled={disabled}\n {...thumbProps?.(0)}\n >\n {hasArrayThumbChildren ? thumbChildren[0] : thumbChildren}\n </Thumb>\n\n <Thumb\n {...sharedThumbProps}\n thumbLabel={thumbToLabel}\n value={scale(_value[1])}\n position={positions[1]}\n dragging={active}\n label={\n typeof label === 'function'\n ? label(getFloatingValue(scale(_value[1]), precision))\n : label\n }\n ref={(node) => {\n if (node) {\n thumbs.current[1] = node;\n }\n }}\n thumbValueText={thumbValueText}\n onMouseDown={() => handleThumbMouseDown(1)}\n onFocus={() => setFocused(1)}\n showLabelOnHover={showLabelOnHover}\n isHovered={hovered}\n disabled={disabled}\n {...thumbProps?.(1)}\n >\n {hasArrayThumbChildren ? thumbChildren[1] : thumbChildren}\n </Thumb>\n </Track>\n\n <input type=\"hidden\" name={`${name}_from`} value={_value[0]} {...hiddenInputProps} />\n <input type=\"hidden\" name={`${name}_to`} value={_value[1]} {...hiddenInputProps} />\n </SliderRoot>\n </SliderProvider>\n );\n});\n\nRangeSlider.classes = classes;\nRangeSlider.varsResolver = varsResolver;\nRangeSlider.displayName = '@mantine/core/RangeSlider';\n\nexport namespace RangeSlider {\n export type Props = RangeSliderProps;\n export type Value = RangeSliderValue;\n export type Factory = RangeSliderFactory;\n export type StylesNames = SliderStylesNames;\n export type CssVariables = SliderCssVariables;\n export type Mark = SliderMark;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6JA,MAAM,eAAe,oBAClB,OAAO,EAAE,MAAM,OAAO,WAAW,cAAc,EAC9C,MAAM;CACJ,iBAAiB,QAAQ,MAAM,aAAa;CAC5C,kBAAkB,QAAQ,cAAc,OAAO,KAAK,IAAI,KAAA;CACxD,mBAAmB,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,MAAM;CACtE,uBACE,cAAc,KAAA,IAAY,IAAI,SAAS,IAAI;AAC/C,EACF,EACF;AAEA,MAAM,eAAe;CACnB,KAAK;CACL,KAAK;CACL,UAAU;CACV,MAAM;CACN,OAAO,CAAC;CACR,QAAQ,MAAM;CACd,sBAAsB;EAAE,YAAY;EAAQ,UAAU;CAAE;CACxD,eAAe;CACf,kBAAkB;CAClB,UAAU;CACV,eAAe;CACf,QAAQ,MAAM;CACd,MAAM;CACN,UAAU;AACZ;AAEA,MAAa,cAAc,SAA6B,WAAW;CACjE,MAAM,QAAQ,SAAS,eAAe,cAAc,MAAM;CAC1D,MAAM,EACJ,YACA,QACA,OACA,UACA,aACA,MACA,KACA,KACA,QACA,UACA,UACA,MACA,WAAW,YACX,cACA,MACA,OACA,OACA,sBACA,eACA,gBACA,cACA,gBACA,kBACA,eACA,UACA,UACA,OACA,UACA,aACA,WACA,OACA,MACA,kBACA,iBACA,YACA,eACA,YACA,KACA,GAAG,WACD;CAEJ,MAAM,YAAY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I;MACJ,YAAY;MACZ,OAAO,MAAM,OAAO,EAAE;MACtB,UAAU,UAAU;MACpB,UAAU;MACV,OACE,OAAO,UAAU,aACb,MAAM,iBAAiB,MAAM,OAAO,EAAE,GAAG,SAAS,CAAC,IACnD;MAEN,MAAM,SAAS;OACb,IAAI,MACF,OAAO,QAAQ,KAAK;MAExB;MACgB;MAChB,mBAAmB,qBAAqB,CAAC;MACzC,eAAe,WAAW,CAAC;MACT;MAClB,WAAW;MACD;MACV,GAAI,aAAa,CAAC;gBAEjB,wBAAwB,cAAc,KAAK;KACvC,CAAA,CACF;;IAEP,oBAAC,SAAD;KAAO,MAAK;KAAS,MAAM,GAAG,KAAK;KAAQ,OAAO,OAAO;KAAI,GAAI;IAAmB,CAAA;IACpF,oBAAC,SAAD;KAAO,MAAK;KAAS,MAAM,GAAG,KAAK;KAAM,OAAO,OAAO;KAAI,GAAI;IAAmB,CAAA;GACxE;;CACE,CAAA;AAEpB,CAAC;AAED,YAAY,UAAUA;AACtB,YAAY,eAAe;AAC3B,YAAY,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Thumb.mjs","names":[],"sources":["../../../../src/components/Slider/Thumb/Thumb.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Box } from '../../../core';\nimport { Transition, TransitionOverride } from '../../Transition';\nimport { useSliderContext } from '../Slider.context';\n\nexport interface ThumbProps extends Omit<React.ComponentProps<'div'>, 'value'> {\n max: number;\n min: number;\n value: number;\n position: number;\n dragging: boolean;\n label: React.ReactNode;\n thumbValueText?: string | ((value: number) => string);\n onKeyDownCapture?: (event: React.KeyboardEvent<HTMLDivElement>) => void;\n onMouseDown?: (event: any) => void;\n labelTransitionProps: TransitionOverride | undefined;\n labelAlwaysOn: boolean | undefined;\n thumbLabel: string | undefined;\n showLabelOnHover: boolean | undefined;\n isHovered?: boolean;\n children?: React.ReactNode;\n disabled: boolean | undefined;\n orientation?: 'horizontal' | 'vertical';\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function Thumb({\n max,\n min,\n value,\n position,\n label,\n dragging,\n onMouseDown,\n onKeyDownCapture,\n labelTransitionProps,\n labelAlwaysOn,\n thumbLabel,\n thumbValueText,\n onFocus,\n onBlur,\n showLabelOnHover,\n isHovered,\n children = null,\n disabled,\n orientation = 'horizontal',\n ref,\n}: ThumbProps) {\n const { getStyles } = useSliderContext();\n\n const [focused, setFocused] = useState(false);\n\n const isVisible = labelAlwaysOn || dragging || focused || (showLabelOnHover && isHovered);\n const valueText = typeof thumbValueText === 'function' ? thumbValueText(value) : thumbValueText;\n\n return (\n <Box<'div'>\n tabIndex={disabled ? -1 : 0}\n role=\"slider\"\n aria-label={thumbLabel}\n aria-valuemax={max}\n aria-valuemin={min}\n aria-valuenow={value}\n aria-valuetext={valueText}\n aria-disabled={disabled}\n aria-orientation={orientation}\n ref={ref}\n __vars={{ '--slider-thumb-offset': `${position}%` }}\n {...getStyles('thumb', { focusable: true })}\n mod={{ dragging, disabled }}\n onFocus={(event) => {\n setFocused(true);\n typeof onFocus === 'function' && onFocus(event);\n }}\n onBlur={(event) => {\n setFocused(false);\n typeof onBlur === 'function' && onBlur(event);\n }}\n onTouchStart={onMouseDown}\n onMouseDown={onMouseDown}\n onKeyDownCapture={onKeyDownCapture}\n onClick={(event) => event.stopPropagation()}\n >\n {children}\n <Transition\n mounted={label != null && !!isVisible}\n transition=\"fade\"\n duration={0}\n {...labelTransitionProps}\n >\n {(transitionStyles) => (\n <div {...getStyles('label', { style: transitionStyles })}>{label}</div>\n )}\n </Transition>\n </Box>\n );\n}\n\nThumb.displayName = '@mantine/core/SliderThumb';\n"],"mappings":";;;;;;;AA2BA,SAAgB,MAAM,EACpB,KACA,KACA,OACA,UACA,OACA,UACA,aACA,kBACA,sBACA,eACA,YACA,gBACA,SACA,QACA,kBACA,WACA,WAAW,MACX,UACA,cAAc,cACd,OACa;CACb,MAAM,EAAE,cAAc,iBAAiB;CAEvC,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAE5C,MAAM,YAAY,iBAAiB,YAAY,WAAY,oBAAoB;CAC/E,MAAM,YAAY,OAAO,mBAAmB,aAAa,eAAe,KAAK,IAAI;CAEjF,OACE,qBAAC,KAAD;EACE,UAAU,WAAW,KAAK;EAC1B,MAAK;EACL,cAAY;EACZ,iBAAe;EACf,iBAAe;EACf,iBAAe;EACf,kBAAgB;EAChB,iBAAe;EACf,oBAAkB;EACb;EACL,QAAQ,EAAE,yBAAyB,GAAG,SAAS,GAAG;EAClD,GAAI,UAAU,SAAS,EAAE,WAAW,KAAK,CAAC;EAC1C,KAAK;GAAE;GAAU;EAAS;EAC1B,UAAU,UAAU;GAClB,WAAW,IAAI;GACf,OAAO,YAAY,cAAc,QAAQ,KAAK;EAChD;EACA,SAAS,UAAU;GACjB,WAAW,KAAK;GAChB,OAAO,WAAW,cAAc,OAAO,KAAK;EAC9C;EACA,cAAc;EACD;EACK;EAClB,UAAU,UAAU,MAAM,gBAAgB;YAzB5C,CA2BG,UACD,oBAAC,YAAD;GACE,SAAS,SAAS,QAAQ,CAAC,CAAC;GAC5B,YAAW;GACX,UAAU;GACV,GAAI;cAEF,qBACA,oBAAC,OAAD;IAAK,GAAI,UAAU,SAAS,EAAE,OAAO,iBAAiB,CAAC;cAAI;GAAW,CAAA;EAE9D,CAAA,CACT;;AAET;AAEA,MAAM,cAAc"}
1
+ {"version":3,"file":"Thumb.mjs","names":[],"sources":["../../../../src/components/Slider/Thumb/Thumb.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Box } from '../../../core';\nimport { Transition, TransitionOverride } from '../../Transition';\nimport { useSliderContext } from '../Slider.context';\n\nexport interface ThumbProps extends Omit<React.ComponentProps<'div'>, 'value'> {\n max: number;\n min: number;\n value: number;\n position: number;\n dragging: boolean;\n label: React.ReactNode;\n thumbValueText?: string | ((value: number) => string);\n onKeyDownCapture?: (event: React.KeyboardEvent<HTMLDivElement>) => void;\n onMouseDown?: (event: any) => void;\n labelTransitionProps: TransitionOverride | undefined;\n labelAlwaysOn: boolean | undefined;\n thumbLabel: string | undefined;\n showLabelOnHover: boolean | undefined;\n isHovered?: boolean;\n children?: React.ReactNode;\n disabled: boolean | undefined;\n orientation?: 'horizontal' | 'vertical';\n className?: string | undefined;\n style?: React.CSSProperties;\n}\n\nexport function Thumb({\n max,\n min,\n value,\n position,\n label,\n dragging,\n onMouseDown,\n onKeyDownCapture,\n labelTransitionProps,\n labelAlwaysOn,\n thumbLabel,\n thumbValueText,\n onFocus,\n onBlur,\n showLabelOnHover,\n isHovered,\n children = null,\n disabled,\n orientation = 'horizontal',\n ref,\n}: ThumbProps) {\n const { getStyles } = useSliderContext();\n\n const [focused, setFocused] = useState(false);\n\n const isVisible = labelAlwaysOn || dragging || focused || (showLabelOnHover && isHovered);\n const valueText = typeof thumbValueText === 'function' ? thumbValueText(value) : thumbValueText;\n\n return (\n <Box<'div'>\n tabIndex={disabled ? -1 : 0}\n role=\"slider\"\n aria-label={thumbLabel}\n aria-valuemax={max}\n aria-valuemin={min}\n aria-valuenow={value}\n aria-valuetext={valueText}\n aria-disabled={disabled}\n aria-orientation={orientation}\n ref={ref}\n __vars={{ '--slider-thumb-offset': `${position}%` }}\n {...getStyles('thumb', { focusable: true })}\n mod={{ dragging, disabled }}\n onFocus={(event) => {\n setFocused(true);\n typeof onFocus === 'function' && onFocus(event);\n }}\n onBlur={(event) => {\n setFocused(false);\n typeof onBlur === 'function' && onBlur(event);\n }}\n onTouchStart={onMouseDown}\n onMouseDown={onMouseDown}\n onKeyDownCapture={onKeyDownCapture}\n onClick={(event) => event.stopPropagation()}\n >\n {children}\n <Transition\n mounted={label != null && !!isVisible}\n transition=\"fade\"\n duration={0}\n {...labelTransitionProps}\n >\n {(transitionStyles) => (\n <div {...getStyles('label', { style: transitionStyles })}>{label}</div>\n )}\n </Transition>\n </Box>\n );\n}\n\nThumb.displayName = '@mantine/core/SliderThumb';\n"],"mappings":";;;;;;;AA2BA,SAAgB,MAAM,EACpB,KACA,KACA,OACA,UACA,OACA,UACA,aACA,kBACA,sBACA,eACA,YACA,gBACA,SACA,QACA,kBACA,WACA,WAAW,MACX,UACA,cAAc,cACd,OACa;CACb,MAAM,EAAE,cAAc,iBAAiB;CAEvC,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAE5C,MAAM,YAAY,iBAAiB,YAAY,WAAY,oBAAoB;CAC/E,MAAM,YAAY,OAAO,mBAAmB,aAAa,eAAe,KAAK,IAAI;CAEjF,OACE,qBAAC,KAAD;EACE,UAAU,WAAW,KAAK;EAC1B,MAAK;EACL,cAAY;EACZ,iBAAe;EACf,iBAAe;EACf,iBAAe;EACf,kBAAgB;EAChB,iBAAe;EACf,oBAAkB;EACb;EACL,QAAQ,EAAE,yBAAyB,GAAG,SAAS,GAAG;EAClD,GAAI,UAAU,SAAS,EAAE,WAAW,KAAK,CAAC;EAC1C,KAAK;GAAE;GAAU;EAAS;EAC1B,UAAU,UAAU;GAClB,WAAW,IAAI;GACf,OAAO,YAAY,cAAc,QAAQ,KAAK;EAChD;EACA,SAAS,UAAU;GACjB,WAAW,KAAK;GAChB,OAAO,WAAW,cAAc,OAAO,KAAK;EAC9C;EACA,cAAc;EACD;EACK;EAClB,UAAU,UAAU,MAAM,gBAAgB;YAzB5C,CA2BG,UACD,oBAAC,YAAD;GACE,SAAS,SAAS,QAAQ,CAAC,CAAC;GAC5B,YAAW;GACX,UAAU;GACV,GAAI;cAEF,qBACA,oBAAC,OAAD;IAAK,GAAI,UAAU,SAAS,EAAE,OAAO,iBAAiB,CAAC;cAAI;GAAW,CAAA;EAE9D,CAAA,CACT;;AAET;AAEA,MAAM,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-precision.mjs","names":[],"sources":["../../../../../src/components/Slider/utils/get-precision/get-precision.ts"],"sourcesContent":["export function getPrecision(step: number) {\n if (!step) {\n return 0;\n }\n const split = step.toString().split('.');\n return split.length > 1 ? split[1].length : 0;\n}\n"],"mappings":";;AAAA,SAAgB,aAAa,MAAc;CACzC,IAAI,CAAC,MACH,OAAO;CAET,MAAM,QAAQ,KAAK,SAAS,EAAE,MAAM,GAAG;CACvC,OAAO,MAAM,SAAS,IAAI,MAAM,GAAG,SAAS;AAC9C"}
1
+ {"version":3,"file":"get-precision.mjs","names":[],"sources":["../../../../../src/components/Slider/utils/get-precision/get-precision.ts"],"sourcesContent":["export function getPrecision(step: number) {\n if (!step) {\n return 0;\n }\n const split = step.toString().split('.');\n return split.length > 1 ? split[1].length : 0;\n}\n"],"mappings":";;AAAA,SAAgB,aAAa,MAAc;CACzC,IAAI,CAAC,MACH,OAAO;CAET,MAAM,QAAQ,KAAK,SAAS,CAAC,CAAC,MAAM,GAAG;CACvC,OAAO,MAAM,SAAS,IAAI,MAAM,EAAE,CAAC,SAAS;AAC9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-step-mark-value.mjs","names":[],"sources":["../../../../../src/components/Slider/utils/get-step-mark-value/get-step-mark-value.ts"],"sourcesContent":["export function getNextMarkValue(\n currentValue: number,\n marks: { value: number; label?: React.ReactNode }[]\n) {\n const sortedMarks = [...marks].sort((a, b) => a.value - b.value);\n const nextMark = sortedMarks.find((mark) => mark.value > currentValue);\n return nextMark ? nextMark.value : currentValue;\n}\n\nexport function getPreviousMarkValue(\n currentValue: number,\n marks: { value: number; label?: React.ReactNode }[]\n) {\n const sortedMarks = [...marks].sort((a, b) => b.value - a.value);\n const previousMark = sortedMarks.find((mark) => mark.value < currentValue);\n return previousMark ? previousMark.value : currentValue;\n}\n\nexport function getFirstMarkValue(marks: { value: number; label?: React.ReactNode }[]) {\n const sortedMarks = [...marks].sort((a, b) => a.value - b.value);\n return sortedMarks.length > 0 ? sortedMarks[0].value : 0;\n}\n\nexport function getLastMarkValue(marks: { value: number; label?: React.ReactNode }[]) {\n const sortedMarks = [...marks].sort((a, b) => a.value - b.value);\n return sortedMarks.length > 0 ? sortedMarks[sortedMarks.length - 1].value : 100;\n}\n"],"mappings":";;AAAA,SAAgB,iBACd,cACA,OACA;CAEA,MAAM,WADc,CAAC,GAAG,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAC/B,EAAE,MAAM,SAAS,KAAK,QAAQ,YAAY;CACrE,OAAO,WAAW,SAAS,QAAQ;AACrC;AAEA,SAAgB,qBACd,cACA,OACA;CAEA,MAAM,eADc,CAAC,GAAG,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAC3B,EAAE,MAAM,SAAS,KAAK,QAAQ,YAAY;CACzE,OAAO,eAAe,aAAa,QAAQ;AAC7C;AAEA,SAAgB,kBAAkB,OAAqD;CACrF,MAAM,cAAc,CAAC,GAAG,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK;CAC/D,OAAO,YAAY,SAAS,IAAI,YAAY,GAAG,QAAQ;AACzD;AAEA,SAAgB,iBAAiB,OAAqD;CACpF,MAAM,cAAc,CAAC,GAAG,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK;CAC/D,OAAO,YAAY,SAAS,IAAI,YAAY,YAAY,SAAS,GAAG,QAAQ;AAC9E"}
1
+ {"version":3,"file":"get-step-mark-value.mjs","names":[],"sources":["../../../../../src/components/Slider/utils/get-step-mark-value/get-step-mark-value.ts"],"sourcesContent":["export function getNextMarkValue(\n currentValue: number,\n marks: { value: number; label?: React.ReactNode }[]\n) {\n const sortedMarks = [...marks].sort((a, b) => a.value - b.value);\n const nextMark = sortedMarks.find((mark) => mark.value > currentValue);\n return nextMark ? nextMark.value : currentValue;\n}\n\nexport function getPreviousMarkValue(\n currentValue: number,\n marks: { value: number; label?: React.ReactNode }[]\n) {\n const sortedMarks = [...marks].sort((a, b) => b.value - a.value);\n const previousMark = sortedMarks.find((mark) => mark.value < currentValue);\n return previousMark ? previousMark.value : currentValue;\n}\n\nexport function getFirstMarkValue(marks: { value: number; label?: React.ReactNode }[]) {\n const sortedMarks = [...marks].sort((a, b) => a.value - b.value);\n return sortedMarks.length > 0 ? sortedMarks[0].value : 0;\n}\n\nexport function getLastMarkValue(marks: { value: number; label?: React.ReactNode }[]) {\n const sortedMarks = [...marks].sort((a, b) => a.value - b.value);\n return sortedMarks.length > 0 ? sortedMarks[sortedMarks.length - 1].value : 100;\n}\n"],"mappings":";;AAAA,SAAgB,iBACd,cACA,OACA;CAEA,MAAM,WADc,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAC/B,CAAC,CAAC,MAAM,SAAS,KAAK,QAAQ,YAAY;CACrE,OAAO,WAAW,SAAS,QAAQ;AACrC;AAEA,SAAgB,qBACd,cACA,OACA;CAEA,MAAM,eADc,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAC3B,CAAC,CAAC,MAAM,SAAS,KAAK,QAAQ,YAAY;CACzE,OAAO,eAAe,aAAa,QAAQ;AAC7C;AAEA,SAAgB,kBAAkB,OAAqD;CACrF,MAAM,cAAc,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK;CAC/D,OAAO,YAAY,SAAS,IAAI,YAAY,EAAE,CAAC,QAAQ;AACzD;AAEA,SAAgB,iBAAiB,OAAqD;CACpF,MAAM,cAAc,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK;CAC/D,OAAO,YAAY,SAAS,IAAI,YAAY,YAAY,SAAS,EAAE,CAAC,QAAQ;AAC9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"Splitter.context.mjs","names":[],"sources":["../../../src/components/Splitter/Splitter.context.ts"],"sourcesContent":["import { createSafeContext, GetStylesApi } from '../../core';\nimport type { SplitterFactory } from './Splitter';\n\nexport interface SplitterContextValue {\n getStyles: GetStylesApi<SplitterFactory>;\n sizes: number[];\n collapsed: boolean[];\n orientation: 'horizontal' | 'vertical';\n}\n\nexport const [SplitterProvider, useSplitterContext] = createSafeContext<SplitterContextValue>(\n 'Splitter component was not found in the tree'\n);\n"],"mappings":";;;AAUA,MAAa,CAAC,kBAAkB,sBAAsB,kBACpD,8CACF"}
1
+ {"version":3,"file":"Splitter.context.mjs","names":[],"sources":["../../../src/components/Splitter/Splitter.context.ts"],"sourcesContent":["import type { SplitterPaneSize } from '@mantine/hooks';\nimport { createSafeContext, GetStylesApi } from '../../core';\nimport type { SplitterFactory } from './Splitter';\n\nexport interface SplitterContextValue {\n getStyles: GetStylesApi<SplitterFactory>;\n sizes: SplitterPaneSize[];\n collapsed: boolean[];\n orientation: 'horizontal' | 'vertical';\n getPaneStyle: (index: number) => React.CSSProperties;\n}\n\nexport const [SplitterProvider, useSplitterContext] = createSafeContext<SplitterContextValue>(\n 'Splitter component was not found in the tree'\n);\n"],"mappings":";;;AAYA,MAAa,CAAC,kBAAkB,sBAAsB,kBACpD,8CACF"}
@@ -15,10 +15,30 @@ import { Children, cloneElement, createElement, useImperativeHandle } from "reac
15
15
  import { useMergedRef, useSplitter } from "@mantine/hooks";
16
16
  import { jsx } from "react/jsx-runtime";
17
17
  //#region packages/@mantine/core/src/components/Splitter/Splitter.tsx
18
+ const PX_RE = /^(-?[\d.]+)px$/;
19
+ const REM_RE = /^(-?[\d.]+)rem$/;
20
+ function isFixedPaneSize(size) {
21
+ return typeof size === "string" && (PX_RE.test(size) || REM_RE.test(size));
22
+ }
23
+ function getPaneFlexStyle(size, pixelMode) {
24
+ const magnitude = typeof size === "number" ? size : parseFloat(size);
25
+ if (!pixelMode) return { flexBasis: `${magnitude}%` };
26
+ if (isFixedPaneSize(size)) return {
27
+ flexGrow: 0,
28
+ flexShrink: 1,
29
+ flexBasis: size
30
+ };
31
+ return {
32
+ flexGrow: magnitude,
33
+ flexShrink: 1,
34
+ flexBasis: 0
35
+ };
36
+ }
18
37
  const defaultProps = {
19
38
  orientation: "horizontal",
20
39
  lineSize: 2,
21
- withHandle: true
40
+ withHandle: true,
41
+ resetOnDoubleClick: true
22
42
  };
23
43
  const varsResolver = createVarsResolver((theme, { lineSize, handleColor }) => ({ root: {
24
44
  "--splitter-line-size": rem(lineSize),
@@ -26,7 +46,7 @@ const varsResolver = createVarsResolver((theme, { lineSize, handleColor }) => ({
26
46
  } }));
27
47
  const Splitter = factory((_props) => {
28
48
  const props = useProps("Splitter", defaultProps, _props);
29
- const { orientation, sizes: controlledSizes, onSizeChange, onResizeStart, onResizeEnd, onCollapseChange, redistribute, step, shiftStep, lineSize, handleColor, handleIcon, withHandle, splitterRef, children, className, classNames, style, styles, unstyled, vars, mod, attributes, ref, ...others } = props;
49
+ const { orientation, sizes: controlledSizes, onSizeChange, onResizeStart, onResizeEnd, onCollapseChange, redistribute, step, shiftStep, lineSize, handleColor, handleIcon, withHandle, resetOnDoubleClick, splitterRef, children, className, classNames, style, styles, unstyled, vars, mod, attributes, ref, ...others } = props;
30
50
  const { dir } = useDirection();
31
51
  const paneChildren = Children.toArray(children);
32
52
  const splitter = useSplitter({
@@ -46,9 +66,11 @@ const Splitter = factory((_props) => {
46
66
  redistribute,
47
67
  step,
48
68
  shiftStep,
49
- dir
69
+ dir,
70
+ resetOnDoubleClick
50
71
  });
51
72
  useImperativeHandle(splitterRef, () => splitter, [splitter]);
73
+ const getPaneStyle = (index) => getPaneFlexStyle(splitter.sizes[index], splitter.pixelMode);
52
74
  const mergedRef = useMergedRef(ref, splitter.ref);
53
75
  const getStyles = useStyles({
54
76
  name: "Splitter",
@@ -90,7 +112,8 @@ const Splitter = factory((_props) => {
90
112
  getStyles,
91
113
  sizes: splitter.sizes,
92
114
  collapsed: splitter.collapsed,
93
- orientation
115
+ orientation,
116
+ getPaneStyle
94
117
  },
95
118
  children: /* @__PURE__ */ jsx(Box, {
96
119
  ref: mergedRef,
@@ -1 +1 @@
1
- {"version":3,"file":"Splitter.mjs","names":["classes"],"sources":["../../../src/components/Splitter/Splitter.tsx"],"sourcesContent":["import { Children, cloneElement, useImperativeHandle } from 'react';\nimport {\n useMergedRef,\n useSplitter,\n UseSplitterRedistributeFn,\n UseSplitterReturnValue,\n} from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getThemeColor,\n MantineColor,\n rem,\n StylesApiProps,\n useDirection,\n useProps,\n useStyles,\n} from '../../core';\nimport { GripHorizontalIcon, GripVerticalIcon } from './GripIcon';\nimport { SplitterProvider } from './Splitter.context';\nimport {\n SplitterPane,\n SplitterPaneProps,\n SplitterPaneStylesNames,\n} from './SplitterPane/SplitterPane';\nimport classes from './Splitter.module.css';\n\nexport type SplitterStylesNames = 'root' | 'handle' | 'thumb' | SplitterPaneStylesNames;\n\nexport type SplitterCssVariables = {\n root: '--splitter-line-size' | '--splitter-handle-color';\n};\n\nexport interface SplitterProps\n extends BoxProps, StylesApiProps<SplitterFactory>, ElementProps<'div'> {\n /** Layout direction @default 'horizontal' */\n orientation?: 'horizontal' | 'vertical';\n\n /** Controlled sizes (percentages summing to 100) */\n sizes?: number[];\n\n /** Called during resize with updated sizes */\n onSizeChange?: (sizes: number[]) => void;\n\n /** Called when drag starts */\n onResizeStart?: (handleIndex: number) => void;\n\n /** Called when drag ends */\n onResizeEnd?: (handleIndex: number, sizes: number[]) => void;\n\n /** Called when a panel collapses or expands */\n onCollapseChange?: (panelIndex: number, collapsed: boolean) => void;\n\n /** How to redistribute space when immediate neighbor is at its min/max */\n redistribute?: 'nearest' | 'equal' | UseSplitterRedistributeFn;\n\n /** Keyboard step size in percentage @default 1 */\n step?: number;\n\n /** Shift+arrow step size in percentage @default 10 */\n shiftStep?: number;\n\n /** CSS value for separator line thickness between panes @default 2 */\n lineSize?: number | string;\n\n /** Key of `theme.colors` or any valid CSS color for the separator line */\n handleColor?: MantineColor;\n\n /** Custom icon displayed in the handle thumb, by default uses grip icon based on orientation */\n handleIcon?: React.ReactNode;\n\n /** Determines whether the thumb with grip icon is displayed on the handle @default true */\n withHandle?: boolean;\n\n /** Ref to imperative splitter API (sizes, collapse, expand, etc.) */\n splitterRef?: React.RefObject<UseSplitterReturnValue | null>;\n\n /** Splitter panes */\n children?: React.ReactNode;\n}\n\nexport type SplitterFactory = Factory<{\n props: SplitterProps;\n ref: HTMLDivElement;\n stylesNames: SplitterStylesNames;\n vars: SplitterCssVariables;\n staticComponents: {\n Pane: typeof SplitterPane;\n };\n}>;\n\nconst defaultProps = {\n orientation: 'horizontal',\n lineSize: 2,\n withHandle: true,\n} satisfies Partial<SplitterProps>;\n\nconst varsResolver = createVarsResolver<SplitterFactory>((theme, { lineSize, handleColor }) => ({\n root: {\n '--splitter-line-size': rem(lineSize),\n '--splitter-handle-color': handleColor ? getThemeColor(handleColor, theme) : undefined,\n },\n}));\n\nexport const Splitter = factory<SplitterFactory>((_props) => {\n const props = useProps('Splitter', defaultProps, _props);\n const {\n orientation,\n sizes: controlledSizes,\n onSizeChange,\n onResizeStart,\n onResizeEnd,\n onCollapseChange,\n redistribute,\n step,\n shiftStep,\n lineSize,\n handleColor,\n handleIcon,\n withHandle,\n splitterRef,\n children,\n className,\n classNames,\n style,\n styles,\n unstyled,\n vars,\n mod,\n attributes,\n ref,\n ...others\n } = props;\n\n const { dir } = useDirection();\n\n const paneChildren = Children.toArray(children) as React.ReactElement<SplitterPaneProps>[];\n\n const panels = paneChildren.map((child) => ({\n defaultSize: child.props.defaultSize,\n min: child.props.min,\n max: child.props.max,\n collapsible: child.props.collapsible,\n collapseThreshold: child.props.collapseThreshold,\n }));\n\n const splitter = useSplitter({\n panels,\n orientation,\n sizes: controlledSizes,\n onSizeChange,\n onResizeStart,\n onResizeEnd,\n onCollapseChange,\n redistribute,\n step,\n shiftStep,\n dir,\n });\n\n useImperativeHandle(splitterRef, () => splitter, [splitter]);\n\n const mergedRef = useMergedRef(ref, splitter.ref);\n\n const getStyles = useStyles<SplitterFactory>({\n name: 'Splitter',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const defaultIcon = orientation === 'vertical' ? <GripHorizontalIcon /> : <GripVerticalIcon />;\n const thumbIcon = handleIcon !== undefined ? handleIcon : defaultIcon;\n\n const items: React.ReactNode[] = [];\n\n paneChildren.forEach((child, index) => {\n if (index > 0) {\n const handleProps = splitter.getHandleProps({ index: index - 1 });\n const isActive = splitter.activeHandle === index - 1;\n items.push(\n <Box {...getStyles('handle')} key={`handle-${index - 1}`} {...handleProps}>\n {withHandle && (\n <div\n {...getStyles('thumb')}\n data-orientation={orientation}\n data-active={isActive || undefined}\n >\n {thumbIcon}\n </div>\n )}\n </Box>\n );\n }\n\n items.push(\n cloneElement(child, {\n key: `pane-${index}`,\n __index: index,\n })\n );\n });\n\n return (\n <SplitterProvider\n value={{\n getStyles,\n sizes: splitter.sizes,\n collapsed: splitter.collapsed,\n orientation: orientation!,\n }}\n >\n <Box ref={mergedRef} {...getStyles('root')} mod={[{ orientation }, mod]} {...others}>\n {items}\n </Box>\n </SplitterProvider>\n );\n});\n\nSplitter.classes = classes;\nSplitter.varsResolver = varsResolver;\nSplitter.displayName = '@mantine/core/Splitter';\nSplitter.Pane = SplitterPane;\n"],"mappings":";;;;;;;;;;;;;;;;;AA+FA,MAAM,eAAe;CACnB,aAAa;CACb,UAAU;CACV,YAAY;AACd;AAEA,MAAM,eAAe,oBAAqC,OAAO,EAAE,UAAU,mBAAmB,EAC9F,MAAM;CACJ,wBAAwB,IAAI,QAAQ;CACpC,2BAA2B,cAAc,cAAc,aAAa,KAAK,IAAI,KAAA;AAC/E,EACF,EAAE;AAEF,MAAa,WAAW,SAA0B,WAAW;CAC3D,MAAM,QAAQ,SAAS,YAAY,cAAc,MAAM;CACvD,MAAM,EACJ,aACA,OAAO,iBACP,cACA,eACA,aACA,kBACA,cACA,MACA,WACA,UACA,aACA,YACA,YACA,aACA,UACA,WACA,YACA,OACA,QACA,UACA,MACA,KACA,YACA,KACA,GAAG,WACD;CAEJ,MAAM,EAAE,QAAQ,aAAa;CAE7B,MAAM,eAAe,SAAS,QAAQ,QAAQ;CAU9C,MAAM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GAAI;aAC1E;EACE,CAAA;CACW,CAAA;AAEtB,CAAC;AAED,SAAS,UAAUA;AACnB,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,OAAO"}
1
+ {"version":3,"file":"Splitter.mjs","names":["classes"],"sources":["../../../src/components/Splitter/Splitter.tsx"],"sourcesContent":["import { Children, cloneElement, useImperativeHandle } from 'react';\nimport {\n SplitterPaneSize,\n SplitterStep,\n useMergedRef,\n useSplitter,\n UseSplitterRedistributeFn,\n UseSplitterReturnValue,\n} from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getThemeColor,\n MantineColor,\n rem,\n StylesApiProps,\n useDirection,\n useProps,\n useStyles,\n} from '../../core';\nimport { GripHorizontalIcon, GripVerticalIcon } from './GripIcon';\nimport { SplitterProvider } from './Splitter.context';\nimport {\n SplitterPane,\n SplitterPaneProps,\n SplitterPaneStylesNames,\n} from './SplitterPane/SplitterPane';\nimport classes from './Splitter.module.css';\n\nconst PX_RE = /^(-?[\\d.]+)px$/;\nconst REM_RE = /^(-?[\\d.]+)rem$/;\n\nfunction isFixedPaneSize(size: SplitterPaneSize): boolean {\n return typeof size === 'string' && (PX_RE.test(size) || REM_RE.test(size));\n}\n\nfunction getPaneFlexStyle(size: SplitterPaneSize, pixelMode: boolean): React.CSSProperties {\n const magnitude = typeof size === 'number' ? size : parseFloat(size);\n\n if (!pixelMode) {\n return { flexBasis: `${magnitude}%` };\n }\n\n if (isFixedPaneSize(size)) {\n return { flexGrow: 0, flexShrink: 1, flexBasis: size as string };\n }\n\n return { flexGrow: magnitude, flexShrink: 1, flexBasis: 0 };\n}\n\nexport type SplitterStylesNames = 'root' | 'handle' | 'thumb' | SplitterPaneStylesNames;\n\nexport type SplitterCssVariables = {\n root: '--splitter-line-size' | '--splitter-handle-color';\n};\n\nexport interface SplitterProps\n extends BoxProps, StylesApiProps<SplitterFactory>, ElementProps<'div'> {\n /** Layout direction @default 'horizontal' */\n orientation?: 'horizontal' | 'vertical';\n\n /** Controlled sizes, each value keeps the unit it was declared in (number/`%` flexible, `px`/`rem` fixed) */\n sizes?: SplitterPaneSize[];\n\n /** Called during resize with updated sizes, each value keeps its declared unit */\n onSizeChange?: (sizes: SplitterPaneSize[]) => void;\n\n /** Called when drag starts */\n onResizeStart?: (handleIndex: number) => void;\n\n /** Called when drag ends */\n onResizeEnd?: (handleIndex: number, sizes: SplitterPaneSize[]) => void;\n\n /** Called when a panel collapses or expands */\n onCollapseChange?: (panelIndex: number, collapsed: boolean) => void;\n\n /** How to redistribute space when immediate neighbor is at its min/max */\n redistribute?: 'nearest' | 'equal' | UseSplitterRedistributeFn;\n\n /** Keyboard step size, a `number`/`%` is a percentage, `px`/`rem` is resolved to pixels @default 1 */\n step?: SplitterStep;\n\n /** Shift+arrow step size, a `number`/`%` is a percentage, `px`/`rem` is resolved to pixels @default 10 */\n shiftStep?: SplitterStep;\n\n /** CSS value for separator line thickness between panes @default 2 */\n lineSize?: number | string;\n\n /** Key of `theme.colors` or any valid CSS color for the separator line */\n handleColor?: MantineColor;\n\n /** Custom icon displayed in the handle thumb, by default uses grip icon based on orientation */\n handleIcon?: React.ReactNode;\n\n /** Determines whether the thumb with grip icon is displayed on the handle @default true */\n withHandle?: boolean;\n\n /** Restore the two panes adjacent to a handle to their default ratio (preserving their combined size) when the handle is double-clicked @default true */\n resetOnDoubleClick?: boolean;\n\n /** Ref to imperative splitter API (sizes, collapse, expand, etc.) */\n splitterRef?: React.RefObject<UseSplitterReturnValue | null>;\n\n /** Splitter panes */\n children?: React.ReactNode;\n}\n\nexport type SplitterFactory = Factory<{\n props: SplitterProps;\n ref: HTMLDivElement;\n stylesNames: SplitterStylesNames;\n vars: SplitterCssVariables;\n staticComponents: {\n Pane: typeof SplitterPane;\n };\n}>;\n\nconst defaultProps = {\n orientation: 'horizontal',\n lineSize: 2,\n withHandle: true,\n resetOnDoubleClick: true,\n} satisfies Partial<SplitterProps>;\n\nconst varsResolver = createVarsResolver<SplitterFactory>((theme, { lineSize, handleColor }) => ({\n root: {\n '--splitter-line-size': rem(lineSize),\n '--splitter-handle-color': handleColor ? getThemeColor(handleColor, theme) : undefined,\n },\n}));\n\nexport const Splitter = factory<SplitterFactory>((_props) => {\n const props = useProps('Splitter', defaultProps, _props);\n const {\n orientation,\n sizes: controlledSizes,\n onSizeChange,\n onResizeStart,\n onResizeEnd,\n onCollapseChange,\n redistribute,\n step,\n shiftStep,\n lineSize,\n handleColor,\n handleIcon,\n withHandle,\n resetOnDoubleClick,\n splitterRef,\n children,\n className,\n classNames,\n style,\n styles,\n unstyled,\n vars,\n mod,\n attributes,\n ref,\n ...others\n } = props;\n\n const { dir } = useDirection();\n\n const paneChildren = Children.toArray(children) as React.ReactElement<SplitterPaneProps>[];\n\n const panels = paneChildren.map((child) => ({\n defaultSize: child.props.defaultSize,\n min: child.props.min,\n max: child.props.max,\n collapsible: child.props.collapsible,\n collapseThreshold: child.props.collapseThreshold,\n }));\n\n const splitter = useSplitter({\n panels,\n orientation,\n sizes: controlledSizes,\n onSizeChange,\n onResizeStart,\n onResizeEnd,\n onCollapseChange,\n redistribute,\n step,\n shiftStep,\n dir,\n resetOnDoubleClick,\n });\n\n useImperativeHandle(splitterRef, () => splitter, [splitter]);\n\n const getPaneStyle = (index: number) =>\n getPaneFlexStyle(splitter.sizes[index], splitter.pixelMode);\n\n const mergedRef = useMergedRef(ref, splitter.ref);\n\n const getStyles = useStyles<SplitterFactory>({\n name: 'Splitter',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const defaultIcon = orientation === 'vertical' ? <GripHorizontalIcon /> : <GripVerticalIcon />;\n const thumbIcon = handleIcon !== undefined ? handleIcon : defaultIcon;\n\n const items: React.ReactNode[] = [];\n\n paneChildren.forEach((child, index) => {\n if (index > 0) {\n const handleProps = splitter.getHandleProps({ index: index - 1 });\n const isActive = splitter.activeHandle === index - 1;\n items.push(\n <Box {...getStyles('handle')} key={`handle-${index - 1}`} {...handleProps}>\n {withHandle && (\n <div\n {...getStyles('thumb')}\n data-orientation={orientation}\n data-active={isActive || undefined}\n >\n {thumbIcon}\n </div>\n )}\n </Box>\n );\n }\n\n items.push(\n cloneElement(child, {\n key: `pane-${index}`,\n __index: index,\n })\n );\n });\n\n return (\n <SplitterProvider\n value={{\n getStyles,\n sizes: splitter.sizes,\n collapsed: splitter.collapsed,\n orientation: orientation!,\n getPaneStyle,\n }}\n >\n <Box ref={mergedRef} {...getStyles('root')} mod={[{ orientation }, mod]} {...others}>\n {items}\n </Box>\n </SplitterProvider>\n );\n});\n\nSplitter.classes = classes;\nSplitter.varsResolver = varsResolver;\nSplitter.displayName = '@mantine/core/Splitter';\nSplitter.Pane = SplitterPane;\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,MAAM,QAAQ;AACd,MAAM,SAAS;AAEf,SAAS,gBAAgB,MAAiC;CACxD,OAAO,OAAO,SAAS,aAAa,MAAM,KAAK,IAAI,KAAK,OAAO,KAAK,IAAI;AAC1E;AAEA,SAAS,iBAAiB,MAAwB,WAAyC;CACzF,MAAM,YAAY,OAAO,SAAS,WAAW,OAAO,WAAW,IAAI;CAEnE,IAAI,CAAC,WACH,OAAO,EAAE,WAAW,GAAG,UAAU,GAAG;CAGtC,IAAI,gBAAgB,IAAI,GACtB,OAAO;EAAE,UAAU;EAAG,YAAY;EAAG,WAAW;CAAe;CAGjE,OAAO;EAAE,UAAU;EAAW,YAAY;EAAG,WAAW;CAAE;AAC5D;AAqEA,MAAM,eAAe;CACnB,aAAa;CACb,UAAU;CACV,YAAY;CACZ,oBAAoB;AACtB;AAEA,MAAM,eAAe,oBAAqC,OAAO,EAAE,UAAU,mBAAmB,EAC9F,MAAM;CACJ,wBAAwB,IAAI,QAAQ;CACpC,2BAA2B,cAAc,cAAc,aAAa,KAAK,IAAI,KAAA;AAC/E,EACF,EAAE;AAEF,MAAa,WAAW,SAA0B,WAAW;CAC3D,MAAM,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IACrB,oBAAkB;IAClB,eAAa,YAAY,KAAA;cAExB;GACE,CAAA,CAEJ,CACP;EACF;EAEA,MAAM,KACJ,aAAa,OAAO;GAClB,KAAK,QAAQ;GACb,SAAS;EACX,CAAC,CACH;CACF,CAAC;CAED,OACE,oBAAC,kBAAD;EACE,OAAO;GACL;GACA,OAAO,SAAS;GAChB,WAAW,SAAS;GACP;GACb;EACF;YAEA,oBAAC,KAAD;GAAK,KAAK;GAAW,GAAI,UAAU,MAAM;GAAG,KAAK,CAAC,EAAE,YAAY,GAAG,GAAG;GAAG,GAAI;aAC1E;EACE,CAAA;CACW,CAAA;AAEtB,CAAC;AAED,SAAS,UAAUA;AACnB,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,OAAO"}
@@ -10,9 +10,8 @@ const SplitterPane = factory((_props) => {
10
10
  const props = useProps("SplitterPane", null, _props);
11
11
  const { className, classNames, style, styles, vars, children, defaultSize, min, max, collapsible, collapseThreshold, __index, mod, ...others } = props;
12
12
  const ctx = useSplitterContext();
13
- const size = ctx.sizes[__index];
14
13
  const isCollapsed = ctx.collapsed[__index];
15
- const sizeStyle = { flexBasis: `${size}%` };
14
+ const sizeStyle = ctx.getPaneStyle(__index);
16
15
  return /* @__PURE__ */ jsx(Box, {
17
16
  ...ctx.getStyles("pane", {
18
17
  className,
@@ -1 +1 @@
1
- {"version":3,"file":"SplitterPane.mjs","names":["classes"],"sources":["../../../../src/components/Splitter/SplitterPane/SplitterPane.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { useSplitterContext } from '../Splitter.context';\nimport classes from '../Splitter.module.css';\n\nexport type SplitterPaneStylesNames = 'pane';\n\nexport interface SplitterPaneProps\n extends BoxProps, CompoundStylesApiProps<SplitterPaneFactory>, ElementProps<'div'> {\n /** Initial size as percentage (0-100). All panes must sum to 100. */\n defaultSize: number;\n\n /** Minimum size percentage @default 0 */\n min?: number;\n\n /** Maximum size percentage @default 100 */\n max?: number;\n\n /** Whether this pane can be collapsed @default false */\n collapsible?: boolean;\n\n /** Size below which the pane snaps to collapsed (percentage), defaults to `min` */\n collapseThreshold?: number;\n\n /** Pane content */\n children?: React.ReactNode;\n\n /** @internal Index set by parent */\n __index?: number;\n}\n\nexport type SplitterPaneFactory = Factory<{\n props: SplitterPaneProps;\n ref: HTMLDivElement;\n stylesNames: SplitterPaneStylesNames;\n compound: true;\n}>;\n\nexport const SplitterPane = factory<SplitterPaneFactory>((_props) => {\n const props = useProps('SplitterPane', null, _props);\n const {\n className,\n classNames,\n style,\n styles,\n vars,\n children,\n defaultSize,\n min,\n max,\n collapsible,\n collapseThreshold,\n __index,\n mod,\n ...others\n } = props;\n\n const ctx = useSplitterContext();\n const size = ctx.sizes[__index!];\n const isCollapsed = ctx.collapsed[__index!];\n\n const sizeStyle = { flexBasis: `${size}%` };\n\n return (\n <Box\n {...ctx.getStyles('pane', {\n className,\n classNames,\n style: [sizeStyle, style],\n styles,\n props,\n })}\n mod={[{ collapsed: isCollapsed || undefined }, mod]}\n {...others}\n >\n {children}\n </Box>\n );\n});\n\nSplitterPane.classes = classes;\nSplitterPane.displayName = '@mantine/core/SplitterPane';\n"],"mappings":";;;;;;;;AA6CA,MAAa,eAAe,SAA8B,WAAW;CACnE,MAAM,QAAQ,SAAS,gBAAgB,MAAM,MAAM;CACnD,MAAM,EACJ,WACA,YACA,OACA,QACA,MACA,UACA,aACA,KACA,KACA,aACA,mBACA,SACA,KACA,GAAG,WACD;CAEJ,MAAM,MAAM,mBAAmB;CAC/B,MAAM,OAAO,IAAI,MAAM;CACvB,MAAM,cAAc,IAAI,UAAU;CAElC,MAAM,YAAY,EAAE,WAAW,GAAG,KAAK,GAAG;CAE1C,OACE,oBAAC,KAAD;EACE,GAAI,IAAI,UAAU,QAAQ;GACxB;GACA;GACA,OAAO,CAAC,WAAW,KAAK;GACxB;GACA;EACF,CAAC;EACD,KAAK,CAAC,EAAE,WAAW,eAAe,KAAA,EAAU,GAAG,GAAG;EAClD,GAAI;EAEH;CACE,CAAA;AAET,CAAC;AAED,aAAa,UAAUA;AACvB,aAAa,cAAc"}
1
+ {"version":3,"file":"SplitterPane.mjs","names":["classes"],"sources":["../../../../src/components/Splitter/SplitterPane/SplitterPane.tsx"],"sourcesContent":["import type { SplitterPaneSize } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { useSplitterContext } from '../Splitter.context';\nimport classes from '../Splitter.module.css';\n\nexport type SplitterPaneStylesNames = 'pane';\n\nexport interface SplitterPaneProps\n extends BoxProps, CompoundStylesApiProps<SplitterPaneFactory>, ElementProps<'div'> {\n /** Initial size, a `number`/`%` is a flexible size (shares leftover space), `px`/`rem` is a fixed size. A bare number is treated as a percentage. */\n defaultSize: SplitterPaneSize;\n\n /** Minimum size in the same units as `defaultSize` @default 0 */\n min?: SplitterPaneSize;\n\n /** Maximum size in the same units as `defaultSize`, no limit by default */\n max?: SplitterPaneSize;\n\n /** Whether this pane can be collapsed @default false */\n collapsible?: boolean;\n\n /** Size below which the pane snaps to collapsed, defaults to `min` */\n collapseThreshold?: SplitterPaneSize;\n\n /** Pane content */\n children?: React.ReactNode;\n\n /** @internal Index set by parent */\n __index?: number;\n}\n\nexport type SplitterPaneFactory = Factory<{\n props: SplitterPaneProps;\n ref: HTMLDivElement;\n stylesNames: SplitterPaneStylesNames;\n compound: true;\n}>;\n\nexport const SplitterPane = factory<SplitterPaneFactory>((_props) => {\n const props = useProps('SplitterPane', null, _props);\n const {\n className,\n classNames,\n style,\n styles,\n vars,\n children,\n defaultSize,\n min,\n max,\n collapsible,\n collapseThreshold,\n __index,\n mod,\n ...others\n } = props;\n\n const ctx = useSplitterContext();\n const isCollapsed = ctx.collapsed[__index!];\n\n const sizeStyle = ctx.getPaneStyle(__index!);\n\n return (\n <Box\n {...ctx.getStyles('pane', {\n className,\n classNames,\n style: [sizeStyle, style],\n styles,\n props,\n })}\n mod={[{ collapsed: isCollapsed || undefined }, mod]}\n {...others}\n >\n {children}\n </Box>\n );\n});\n\nSplitterPane.classes = classes;\nSplitterPane.displayName = '@mantine/core/SplitterPane';\n"],"mappings":";;;;;;;;AA8CA,MAAa,eAAe,SAA8B,WAAW;CACnE,MAAM,QAAQ,SAAS,gBAAgB,MAAM,MAAM;CACnD,MAAM,EACJ,WACA,YACA,OACA,QACA,MACA,UACA,aACA,KACA,KACA,aACA,mBACA,SACA,KACA,GAAG,WACD;CAEJ,MAAM,MAAM,mBAAmB;CAC/B,MAAM,cAAc,IAAI,UAAU;CAElC,MAAM,YAAY,IAAI,aAAa,OAAQ;CAE3C,OACE,oBAAC,KAAD;EACE,GAAI,IAAI,UAAU,QAAQ;GACxB;GACA;GACA,OAAO,CAAC,WAAW,KAAK;GACxB;GACA;EACF,CAAC;EACD,KAAK,CAAC,EAAE,WAAW,eAAe,KAAA,EAAU,GAAG,GAAG;EAClD,GAAI;EAEH;CACE,CAAA;AAET,CAAC;AAED,aAAa,UAAUA;AACvB,aAAa,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Stack.mjs","names":["classes"],"sources":["../../../src/components/Stack/Stack.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSpacing,\n MantineSpacing,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Stack.module.css';\n\nexport type StackStylesNames = 'root';\nexport type StackCssVariables = {\n root: '--stack-gap' | '--stack-align' | '--stack-justify';\n};\n\nexport interface StackProps extends BoxProps, StylesApiProps<StackFactory>, ElementProps<'div'> {\n /** Key of `theme.spacing` or any valid CSS value to set `gap` property, numbers are converted to rem @default 'md' */\n gap?: MantineSpacing;\n\n /** Controls `align-items` CSS property @default 'stretch' */\n align?: React.CSSProperties['alignItems'];\n\n /** Controls `justify-content` CSS property @default 'flex-start' */\n justify?: React.CSSProperties['justifyContent'];\n}\n\nexport type StackFactory = Factory<{\n props: StackProps;\n ref: HTMLDivElement;\n stylesNames: StackStylesNames;\n vars: StackCssVariables;\n}>;\n\nconst defaultProps = {\n gap: 'md',\n align: 'stretch',\n justify: 'flex-start',\n} satisfies Partial<StackProps>;\n\nconst varsResolver = createVarsResolver<StackFactory>((_, { gap, align, justify }) => ({\n root: {\n '--stack-gap': getSpacing(gap),\n '--stack-align': align,\n '--stack-justify': justify,\n },\n}));\n\nexport const Stack = factory<StackFactory>((_props) => {\n const props = useProps('Stack', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n align,\n justify,\n gap,\n variant,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<StackFactory>({\n name: 'Stack',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return <Box {...getStyles('root')} variant={variant} {...others} />;\n});\n\nStack.classes = classes;\nStack.varsResolver = varsResolver;\nStack.displayName = '@mantine/core/Stack';\n\nexport namespace Stack {\n export type Props = StackProps;\n export type StylesNames = StackStylesNames;\n export type CssVariables = StackCssVariables;\n export type Factory = StackFactory;\n}\n"],"mappings":";;;;;;;;;;AAsCA,MAAM,eAAe;CACnB,KAAK;CACL,OAAO;CACP,SAAS;AACX;AAEA,MAAM,eAAe,oBAAkC,GAAG,EAAE,KAAK,OAAO,eAAe,EACrF,MAAM;CACJ,eAAe,WAAW,GAAG;CAC7B,iBAAiB;CACjB,mBAAmB;AACrB,EACF,EAAE;AAEF,MAAa,QAAQ,SAAuB,WAAW;CACrD,MAAM,QAAQ,SAAS,SAAS,cAAc,MAAM;CACpD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,OACA,SACA,KACA,SACA,YACA,GAAG,WACD;CAgBJ,OAAO,oBAAC,KAAD;EAAK,GAdM,UAAwB;GACxC,MAAM;GACN;GACA,SAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAEwB,EAAE,MAAM;EAAY;EAAS,GAAI;CAAS,CAAA;AACpE,CAAC;AAED,MAAM,UAAUA;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc"}
1
+ {"version":3,"file":"Stack.mjs","names":["classes"],"sources":["../../../src/components/Stack/Stack.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSpacing,\n MantineSpacing,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Stack.module.css';\n\nexport type StackStylesNames = 'root';\nexport type StackCssVariables = {\n root: '--stack-gap' | '--stack-align' | '--stack-justify';\n};\n\nexport interface StackProps extends BoxProps, StylesApiProps<StackFactory>, ElementProps<'div'> {\n /** Key of `theme.spacing` or any valid CSS value to set `gap` property, numbers are converted to rem @default 'md' */\n gap?: MantineSpacing;\n\n /** Controls `align-items` CSS property @default 'stretch' */\n align?: React.CSSProperties['alignItems'];\n\n /** Controls `justify-content` CSS property @default 'flex-start' */\n justify?: React.CSSProperties['justifyContent'];\n}\n\nexport type StackFactory = Factory<{\n props: StackProps;\n ref: HTMLDivElement;\n stylesNames: StackStylesNames;\n vars: StackCssVariables;\n}>;\n\nconst defaultProps = {\n gap: 'md',\n align: 'stretch',\n justify: 'flex-start',\n} satisfies Partial<StackProps>;\n\nconst varsResolver = createVarsResolver<StackFactory>((_, { gap, align, justify }) => ({\n root: {\n '--stack-gap': getSpacing(gap),\n '--stack-align': align,\n '--stack-justify': justify,\n },\n}));\n\nexport const Stack = factory<StackFactory>((_props) => {\n const props = useProps('Stack', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n align,\n justify,\n gap,\n variant,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<StackFactory>({\n name: 'Stack',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return <Box {...getStyles('root')} variant={variant} {...others} />;\n});\n\nStack.classes = classes;\nStack.varsResolver = varsResolver;\nStack.displayName = '@mantine/core/Stack';\n\nexport namespace Stack {\n export type Props = StackProps;\n export type StylesNames = StackStylesNames;\n export type CssVariables = StackCssVariables;\n export type Factory = StackFactory;\n}\n"],"mappings":";;;;;;;;;;AAsCA,MAAM,eAAe;CACnB,KAAK;CACL,OAAO;CACP,SAAS;AACX;AAEA,MAAM,eAAe,oBAAkC,GAAG,EAAE,KAAK,OAAO,eAAe,EACrF,MAAM;CACJ,eAAe,WAAW,GAAG;CAC7B,iBAAiB;CACjB,mBAAmB;AACrB,EACF,EAAE;AAEF,MAAa,QAAQ,SAAuB,WAAW;CACrD,MAAM,QAAQ,SAAS,SAAS,cAAc,MAAM;CACpD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,OACA,SACA,KACA,SACA,YACA,GAAG,WACD;CAgBJ,OAAO,oBAAC,KAAD;EAAK,GAdM,UAAwB;GACxC,MAAM;GACN;GACA,SAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAEwB,CAAC,CAAC,MAAM;EAAY;EAAS,GAAI;CAAS,CAAA;AACpE,CAAC;AAED,MAAM,UAAUA;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.mjs","names":["classes"],"sources":["../../../src/components/Stepper/Stepper.tsx"],"sourcesContent":["import { Activity, Children, cloneElement } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getAutoContrastValue,\n getContrastColor,\n getFontSize,\n getRadius,\n getSize,\n getSpacing,\n getThemeColor,\n MantineColor,\n MantineRadius,\n MantineSize,\n MantineSpacing,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { StepperProvider, type StepperContextValue } from './Stepper.context';\nimport { StepperCompleted, StepperCompletedProps } from './StepperCompleted/StepperCompleted';\nimport { StepperStep, StepperStepProps } from './StepperStep/StepperStep';\nimport classes from './Stepper.module.css';\nexport type StepFragmentComponent = React.FC<{ step: number }>;\n\nexport type StepperStylesNames =\n | 'root'\n | 'separator'\n | 'steps'\n | 'content'\n | 'step'\n | 'stepLoader'\n | 'verticalSeparator'\n | 'stepWrapper'\n | 'stepIcon'\n | 'stepCompletedIcon'\n | 'stepIconContent'\n | 'stepBody'\n | 'stepLabel'\n | 'stepDescription';\n\nexport type StepperCssVariables = {\n root:\n | '--stepper-color'\n | '--stepper-icon-color'\n | '--stepper-icon-size'\n | '--stepper-content-padding'\n | '--stepper-radius'\n | '--stepper-fz'\n | '--stepper-spacing';\n};\n\nexport interface StepperProps\n extends BoxProps, StylesApiProps<StepperFactory>, ElementProps<'div'> {\n /** `Stepper.Step` components */\n children: React.ReactNode;\n\n /** Called when a clickable step is clicked with its 0-based index. Not called for the currently active step. */\n onStepClick?: (stepIndex: number) => void;\n\n /** Index of the active step */\n active: number;\n\n /** Step icon @default step index + 1 */\n icon?: React.ReactNode | StepFragmentComponent;\n\n /** Step icon displayed when step is completed @default CheckIcon */\n completedIcon?: React.ReactNode | StepFragmentComponent;\n\n /** Step icon displayed when step is in progress @default step index + 1 */\n progressIcon?: React.ReactNode | StepFragmentComponent;\n\n /** Key of `theme.colors` or any valid CSS color, controls colors of active and progress steps @default theme.primaryColor */\n color?: MantineColor;\n\n /** Controls size of the step icon, by default icon size is inferred from `size` prop */\n iconSize?: number | string;\n\n /** Key of `theme.spacing` or any valid CSS value to set `padding-top` of the content @default 'md' */\n contentPadding?: MantineSpacing;\n\n /** Stepper orientation @default 'horizontal' */\n orientation?: 'vertical' | 'horizontal';\n\n /** Icon position relative to the step body @default 'left' */\n iconPosition?: 'right' | 'left';\n\n /** Controls size of various Stepper elements */\n size?: MantineSize;\n\n /** Key of `theme.radius` or any valid CSS value to set steps border-radius @default \"xl\" */\n radius?: MantineRadius;\n\n /** When true, users can click and jump to any step. When false, users can only navigate to completed steps @default true */\n allowNextStepsSelect?: boolean;\n\n /** Determines whether steps should wrap to the next line if no space is available @default true */\n wrap?: boolean;\n\n /** When true, automatically adjusts the icon color in completed steps to ensure sufficient contrast against the step background color */\n autoContrast?: boolean;\n\n /** If set, all step content is kept mounted. React 19 `Activity` is used to preserve state while content is hidden. @default false */\n keepMounted?: boolean;\n}\n\nexport type StepperFactory = Factory<{\n props: StepperProps;\n ref: HTMLDivElement;\n stylesNames: StepperStylesNames;\n vars: StepperCssVariables;\n staticComponents: {\n Step: typeof StepperStep;\n Completed: typeof StepperCompleted;\n };\n}>;\n\nconst defaultProps = {\n orientation: 'horizontal',\n iconPosition: 'left',\n allowNextStepsSelect: true,\n wrap: true,\n} satisfies Partial<StepperProps>;\n\nconst varsResolver = createVarsResolver<StepperFactory>(\n (theme, { color, iconSize, size, contentPadding, radius, autoContrast }) => ({\n root: {\n '--stepper-color': color ? getThemeColor(color, theme) : undefined,\n '--stepper-icon-color': getAutoContrastValue(autoContrast, theme)\n ? getContrastColor({ color, theme, autoContrast })\n : undefined,\n '--stepper-icon-size':\n iconSize === undefined ? getSize(size, 'stepper-icon-size') : rem(iconSize),\n '--stepper-content-padding': getSpacing(contentPadding),\n '--stepper-radius': radius === undefined ? undefined : getRadius(radius),\n '--stepper-fz': getFontSize(size),\n '--stepper-spacing': getSpacing(size),\n },\n })\n);\n\nexport const Stepper = factory<StepperFactory>((_props) => {\n const props = useProps('Stepper', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n children,\n onStepClick,\n active,\n icon,\n completedIcon,\n progressIcon,\n color,\n iconSize,\n contentPadding,\n orientation,\n iconPosition,\n size,\n radius,\n allowNextStepsSelect,\n wrap,\n autoContrast,\n keepMounted,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<StepperFactory>({\n name: 'Stepper',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const convertedChildren = Children.toArray(children) as React.ReactElement[];\n const _children = convertedChildren.filter(\n (child) => child.type !== StepperCompleted\n ) as React.ReactElement<StepperStepProps>[];\n const completedStep = convertedChildren.find(\n (item) => item.type === StepperCompleted\n ) as React.ReactElement<StepperCompletedProps>;\n\n const items = _children.reduce<React.ReactElement<StepperStepProps>[]>(\n (acc, item: React.ReactElement<StepperStepProps>, index) => {\n const state =\n active === index ? 'stepProgress' : active > index ? 'stepCompleted' : 'stepInactive';\n\n const shouldAllowSelect = () => {\n if (typeof onStepClick !== 'function') {\n return false;\n }\n\n if (typeof item.props.allowStepSelect === 'boolean') {\n return item.props.allowStepSelect;\n }\n\n return state === 'stepCompleted' || allowNextStepsSelect;\n };\n\n const isStepSelectionEnabled = shouldAllowSelect();\n\n acc.push(\n cloneElement(item, {\n icon: item.props.icon || icon || index + 1,\n key: index,\n step: index,\n state,\n onClick: () => isStepSelectionEnabled && onStepClick?.(index),\n allowStepClick: isStepSelectionEnabled,\n completedIcon: item.props.completedIcon || completedIcon,\n progressIcon: item.props.progressIcon || progressIcon,\n color: item.props.color || color,\n iconSize,\n iconPosition: item.props.iconPosition || iconPosition,\n orientation,\n })\n );\n\n if (orientation === 'horizontal' && index !== _children.length - 1) {\n acc.push(\n <div\n {...getStyles('separator')}\n data-active={index < active || undefined}\n data-orientation={orientation}\n key={`separator-${index}`}\n />\n );\n }\n\n return acc;\n },\n []\n );\n\n const stepContent = _children[active]?.props?.children;\n const completedContent = completedStep?.props?.children;\n const content = active > _children.length - 1 ? completedContent : stepContent;\n\n const contentSection = keepMounted ? (\n <>\n {_children.map((child, index) => (\n <Activity key={index} mode={active === index ? 'visible' : 'hidden'}>\n <div {...getStyles('content')}>{child.props.children}</div>\n </Activity>\n ))}\n {completedStep && (\n <Activity mode={active > _children.length - 1 ? 'visible' : 'hidden'}>\n <div {...getStyles('content')}>{completedStep.props.children}</div>\n </Activity>\n )}\n </>\n ) : (\n content && <div {...getStyles('content')}>{content}</div>\n );\n\n return (\n <StepperProvider value={{ getStyles, orientation, iconPosition }}>\n <Box {...getStyles('root')} size={size} {...others}>\n <Box\n {...getStyles('steps')}\n mod={{\n orientation,\n 'icon-position': iconPosition,\n wrap: wrap && orientation !== 'vertical',\n }}\n >\n {items}\n </Box>\n {contentSection}\n </Box>\n </StepperProvider>\n );\n});\n\nStepper.classes = classes;\nStepper.varsResolver = varsResolver;\nStepper.displayName = '@mantine/core/Stepper';\nStepper.Completed = StepperCompleted;\nStepper.Step = StepperStep;\n\nexport namespace Stepper {\n export type Props = StepperProps;\n export type StylesNames = StepperStylesNames;\n export type CssVariables = StepperCssVariables;\n export type Factory = StepperFactory;\n export type Step = StepFragmentComponent;\n export type ContextValue = StepperContextValue;\n\n export namespace Step {\n export type Props = StepperStepProps;\n }\n\n export namespace Completed {\n export type Props = StepperCompletedProps;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0HA,MAAM,eAAe;CACnB,aAAa;CACb,cAAc;CACd,sBAAsB;CACtB,MAAM;AACR;AAEA,MAAM,eAAe,oBAClB,OAAO,EAAE,OAAO,UAAU,MAAM,gBAAgB,QAAQ,oBAAoB,EAC3E,MAAM;CACJ,mBAAmB,QAAQ,cAAc,OAAO,KAAK,IAAI,KAAA;CACzD,wBAAwB,qBAAqB,cAAc,KAAK,IAC5D,iBAAiB;EAAE;EAAO;EAAO;CAAa,CAAC,IAC/C,KAAA;CACJ,uBACE,aAAa,KAAA,IAAY,QAAQ,MAAM,mBAAmB,IAAI,IAAI,QAAQ;CAC5E,6BAA6B,WAAW,cAAc;CACtD,oBAAoB,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,MAAM;CACvE,gBAAgB,YAAY,IAAI;CAChC,qBAAqB,WAAW,IAAI;AACtC,EACF,EACF;AAEA,MAAa,UAAU,SAAyB,WAAW;CACzD,MAAM,QAAQ,SAAS,WAAW,cAAc,MAAM;CACtD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,UACA,aACA,QACA,MACA,eACA,cACA,OACA,UACA,gBACA,aACA,cACA,MACA,QACA,sBACA,MACA,cACA,aACA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AAM,iBAAiB,cACrB,qBAAA,YAAA,EAAA,UAAA,CACG,UAAU,KAAK,OAAO,UACrB,oBAAC,UAAD;EAAsB,MAAM,WAAW,QAAQ,YAAY;YACzD,oBAAC,OAAD;GAAK,GAAI,UAAU,SAAS;aAAI,MAAM,MAAM;EAAc,CAAA;CAClD,GAFK,KAEL,CACX,GACA,iBACC,oBAAC,UAAD;EAAU,MAAM,SAAS,UAAU,SAAS,IAAI,YAAY;YAC1D,oBAAC,OAAD;GAAK,GAAI,UAAU,SAAS;aAAI,cAAc,MAAM;EAAc,CAAA;CAC1D,CAAA,CAEZ,EAAA,CAAA,IAEF,WAAW,oBAAC,OAAD;EAAK,GAAI,UAAU,SAAS;YAAI;CAAa,CAAA;CAG1D,OACE,oBAAC,iBAAD;EAAiB,OAAO;GAAE;GAAW;GAAa;EAAa;YAC7D,qBAAC,KAAD;GAAK,GAAI,UAAU,MAAM;GAAS;GAAM,GAAI;aAA5C,CACE,oBAAC,KAAD;IACE,GAAI,UAAU,OAAO;IACrB,KAAK;KACH;KACA,iBAAiB;KACjB,MAAM,QAAQ,gBAAgB;IAChC;cAEC;GACE,CAAA,GACJ,cACE;;CACU,CAAA;AAErB,CAAC;AAED,QAAQ,UAAUA;AAClB,QAAQ,eAAe;AACvB,QAAQ,cAAc;AACtB,QAAQ,YAAY;AACpB,QAAQ,OAAO"}
1
+ {"version":3,"file":"Stepper.mjs","names":["classes"],"sources":["../../../src/components/Stepper/Stepper.tsx"],"sourcesContent":["import { Activity, Children, cloneElement } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getAutoContrastValue,\n getContrastColor,\n getFontSize,\n getRadius,\n getSize,\n getSpacing,\n getThemeColor,\n MantineColor,\n MantineRadius,\n MantineSize,\n MantineSpacing,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { StepperProvider, type StepperContextValue } from './Stepper.context';\nimport { StepperCompleted, StepperCompletedProps } from './StepperCompleted/StepperCompleted';\nimport { StepperStep, StepperStepProps } from './StepperStep/StepperStep';\nimport classes from './Stepper.module.css';\nexport type StepFragmentComponent = React.FC<{ step: number }>;\n\nexport type StepperStylesNames =\n | 'root'\n | 'separator'\n | 'steps'\n | 'content'\n | 'step'\n | 'stepLoader'\n | 'verticalSeparator'\n | 'stepWrapper'\n | 'stepIcon'\n | 'stepCompletedIcon'\n | 'stepIconContent'\n | 'stepBody'\n | 'stepLabel'\n | 'stepDescription';\n\nexport type StepperCssVariables = {\n root:\n | '--stepper-color'\n | '--stepper-icon-color'\n | '--stepper-icon-size'\n | '--stepper-content-padding'\n | '--stepper-radius'\n | '--stepper-fz'\n | '--stepper-spacing';\n};\n\nexport interface StepperProps\n extends BoxProps, StylesApiProps<StepperFactory>, ElementProps<'div'> {\n /** `Stepper.Step` components */\n children: React.ReactNode;\n\n /** Called when a clickable step is clicked with its 0-based index. Not called for the currently active step. */\n onStepClick?: (stepIndex: number) => void;\n\n /** Index of the active step */\n active: number;\n\n /** Step icon @default step index + 1 */\n icon?: React.ReactNode | StepFragmentComponent;\n\n /** Step icon displayed when step is completed @default CheckIcon */\n completedIcon?: React.ReactNode | StepFragmentComponent;\n\n /** Step icon displayed when step is in progress @default step index + 1 */\n progressIcon?: React.ReactNode | StepFragmentComponent;\n\n /** Key of `theme.colors` or any valid CSS color, controls colors of active and progress steps @default theme.primaryColor */\n color?: MantineColor;\n\n /** Controls size of the step icon, by default icon size is inferred from `size` prop */\n iconSize?: number | string;\n\n /** Key of `theme.spacing` or any valid CSS value to set `padding-top` of the content @default 'md' */\n contentPadding?: MantineSpacing;\n\n /** Stepper orientation @default 'horizontal' */\n orientation?: 'vertical' | 'horizontal';\n\n /** Icon position relative to the step body @default 'left' */\n iconPosition?: 'right' | 'left';\n\n /** Controls size of various Stepper elements */\n size?: MantineSize;\n\n /** Key of `theme.radius` or any valid CSS value to set steps border-radius @default \"xl\" */\n radius?: MantineRadius;\n\n /** When true, users can click and jump to any step. When false, users can only navigate to completed steps @default true */\n allowNextStepsSelect?: boolean;\n\n /** Determines whether steps should wrap to the next line if no space is available @default true */\n wrap?: boolean;\n\n /** When true, automatically adjusts the icon color in completed steps to ensure sufficient contrast against the step background color */\n autoContrast?: boolean;\n\n /** If set, all step content is kept mounted. React 19 `Activity` is used to preserve state while content is hidden. @default false */\n keepMounted?: boolean;\n}\n\nexport type StepperFactory = Factory<{\n props: StepperProps;\n ref: HTMLDivElement;\n stylesNames: StepperStylesNames;\n vars: StepperCssVariables;\n staticComponents: {\n Step: typeof StepperStep;\n Completed: typeof StepperCompleted;\n };\n}>;\n\nconst defaultProps = {\n orientation: 'horizontal',\n iconPosition: 'left',\n allowNextStepsSelect: true,\n wrap: true,\n} satisfies Partial<StepperProps>;\n\nconst varsResolver = createVarsResolver<StepperFactory>(\n (theme, { color, iconSize, size, contentPadding, radius, autoContrast }) => ({\n root: {\n '--stepper-color': color ? getThemeColor(color, theme) : undefined,\n '--stepper-icon-color': getAutoContrastValue(autoContrast, theme)\n ? getContrastColor({ color, theme, autoContrast })\n : undefined,\n '--stepper-icon-size':\n iconSize === undefined ? getSize(size, 'stepper-icon-size') : rem(iconSize),\n '--stepper-content-padding': getSpacing(contentPadding),\n '--stepper-radius': radius === undefined ? undefined : getRadius(radius),\n '--stepper-fz': getFontSize(size),\n '--stepper-spacing': getSpacing(size),\n },\n })\n);\n\nexport const Stepper = factory<StepperFactory>((_props) => {\n const props = useProps('Stepper', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n children,\n onStepClick,\n active,\n icon,\n completedIcon,\n progressIcon,\n color,\n iconSize,\n contentPadding,\n orientation,\n iconPosition,\n size,\n radius,\n allowNextStepsSelect,\n wrap,\n autoContrast,\n keepMounted,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<StepperFactory>({\n name: 'Stepper',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const convertedChildren = Children.toArray(children) as React.ReactElement[];\n const _children = convertedChildren.filter(\n (child) => child.type !== StepperCompleted\n ) as React.ReactElement<StepperStepProps>[];\n const completedStep = convertedChildren.find(\n (item) => item.type === StepperCompleted\n ) as React.ReactElement<StepperCompletedProps>;\n\n const items = _children.reduce<React.ReactElement<StepperStepProps>[]>(\n (acc, item: React.ReactElement<StepperStepProps>, index) => {\n const state =\n active === index ? 'stepProgress' : active > index ? 'stepCompleted' : 'stepInactive';\n\n const shouldAllowSelect = () => {\n if (typeof onStepClick !== 'function') {\n return false;\n }\n\n if (typeof item.props.allowStepSelect === 'boolean') {\n return item.props.allowStepSelect;\n }\n\n return state === 'stepCompleted' || allowNextStepsSelect;\n };\n\n const isStepSelectionEnabled = shouldAllowSelect();\n\n acc.push(\n cloneElement(item, {\n icon: item.props.icon || icon || index + 1,\n key: index,\n step: index,\n state,\n onClick: () => isStepSelectionEnabled && onStepClick?.(index),\n allowStepClick: isStepSelectionEnabled,\n completedIcon: item.props.completedIcon || completedIcon,\n progressIcon: item.props.progressIcon || progressIcon,\n color: item.props.color || color,\n iconSize,\n iconPosition: item.props.iconPosition || iconPosition,\n orientation,\n })\n );\n\n if (orientation === 'horizontal' && index !== _children.length - 1) {\n acc.push(\n <div\n {...getStyles('separator')}\n data-active={index < active || undefined}\n data-orientation={orientation}\n key={`separator-${index}`}\n />\n );\n }\n\n return acc;\n },\n []\n );\n\n const stepContent = _children[active]?.props?.children;\n const completedContent = completedStep?.props?.children;\n const content = active > _children.length - 1 ? completedContent : stepContent;\n\n const contentSection = keepMounted ? (\n <>\n {_children.map((child, index) => (\n <Activity key={index} mode={active === index ? 'visible' : 'hidden'}>\n <div {...getStyles('content')}>{child.props.children}</div>\n </Activity>\n ))}\n {completedStep && (\n <Activity mode={active > _children.length - 1 ? 'visible' : 'hidden'}>\n <div {...getStyles('content')}>{completedStep.props.children}</div>\n </Activity>\n )}\n </>\n ) : (\n content && <div {...getStyles('content')}>{content}</div>\n );\n\n return (\n <StepperProvider value={{ getStyles, orientation, iconPosition }}>\n <Box {...getStyles('root')} size={size} {...others}>\n <Box\n {...getStyles('steps')}\n mod={{\n orientation,\n 'icon-position': iconPosition,\n wrap: wrap && orientation !== 'vertical',\n }}\n >\n {items}\n </Box>\n {contentSection}\n </Box>\n </StepperProvider>\n );\n});\n\nStepper.classes = classes;\nStepper.varsResolver = varsResolver;\nStepper.displayName = '@mantine/core/Stepper';\nStepper.Completed = StepperCompleted;\nStepper.Step = StepperStep;\n\nexport namespace Stepper {\n export type Props = StepperProps;\n export type StylesNames = StepperStylesNames;\n export type CssVariables = StepperCssVariables;\n export type Factory = StepperFactory;\n export type Step = StepFragmentComponent;\n export type ContextValue = StepperContextValue;\n\n export namespace Step {\n export type Props = StepperStepProps;\n }\n\n export namespace Completed {\n export type Props = StepperCompletedProps;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0HA,MAAM,eAAe;CACnB,aAAa;CACb,cAAc;CACd,sBAAsB;CACtB,MAAM;AACR;AAEA,MAAM,eAAe,oBAClB,OAAO,EAAE,OAAO,UAAU,MAAM,gBAAgB,QAAQ,oBAAoB,EAC3E,MAAM;CACJ,mBAAmB,QAAQ,cAAc,OAAO,KAAK,IAAI,KAAA;CACzD,wBAAwB,qBAAqB,cAAc,KAAK,IAC5D,iBAAiB;EAAE;EAAO;EAAO;CAAa,CAAC,IAC/C,KAAA;CACJ,uBACE,aAAa,KAAA,IAAY,QAAQ,MAAM,mBAAmB,IAAI,IAAI,QAAQ;CAC5E,6BAA6B,WAAW,cAAc;CACtD,oBAAoB,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,MAAM;CACvE,gBAAgB,YAAY,IAAI;CAChC,qBAAqB,WAAW,IAAI;AACtC,EACF,EACF;AAEA,MAAa,UAAU,SAAyB,WAAW;CACzD,MAAM,QAAQ,SAAS,WAAW,cAAc,MAAM;CACtD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,UACA,aACA,QACA,MACA,eACA,cAC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O;CAC/C,MAAM,UAAU,SAAS,UAAU,SAAS,IAAI,mBAAmB;CAEnE,MAAM,iBAAiB,cACrB,qBAAA,YAAA,EAAA,UAAA,CACG,UAAU,KAAK,OAAO,UACrB,oBAAC,UAAD;EAAsB,MAAM,WAAW,QAAQ,YAAY;YACzD,oBAAC,OAAD;GAAK,GAAI,UAAU,SAAS;aAAI,MAAM,MAAM;EAAc,CAAA;CAClD,GAFK,KAEL,CACX,GACA,iBACC,oBAAC,UAAD;EAAU,MAAM,SAAS,UAAU,SAAS,IAAI,YAAY;YAC1D,oBAAC,OAAD;GAAK,GAAI,UAAU,SAAS;aAAI,cAAc,MAAM;EAAc,CAAA;CAC1D,CAAA,CAEZ,EAAA,CAAA,IAEF,WAAW,oBAAC,OAAD;EAAK,GAAI,UAAU,SAAS;YAAI;CAAa,CAAA;CAG1D,OACE,oBAAC,iBAAD;EAAiB,OAAO;GAAE;GAAW;GAAa;EAAa;YAC7D,qBAAC,KAAD;GAAK,GAAI,UAAU,MAAM;GAAS;GAAM,GAAI;aAA5C,CACE,oBAAC,KAAD;IACE,GAAI,UAAU,OAAO;IACrB,KAAK;KACH;KACA,iBAAiB;KACjB,MAAM,QAAQ,gBAAgB;IAChC;cAEC;GACE,CAAA,GACJ,cACE;;CACU,CAAA;AAErB,CAAC;AAED,QAAQ,UAAUA;AAClB,QAAQ,eAAe;AACvB,QAAQ,cAAc;AACtB,QAAQ,YAAY;AACpB,QAAQ,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.mjs","names":["useId","classes"],"sources":["../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import { use } from 'react';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n extractStyleProps,\n factory,\n Factory,\n getRadius,\n getSize,\n getThemeColor,\n MantineColor,\n MantineRadius,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { InlineInput, InlineInputClasses, InlineInputStylesNames } from '../../utils/InlineInput';\nimport {\n SwitchGroup,\n SwitchGroupContext,\n type SwitchGroupProps,\n type SwitchGroupStylesNames,\n type SwitchGroupFactory,\n type SwitchGroupContextValue,\n} from './SwitchGroup/SwitchGroup';\nimport classes from './Switch.module.css';\nexport type SwitchStylesNames =\n | 'root'\n | 'track'\n | 'trackLabel'\n | 'thumb'\n | 'input'\n | InlineInputStylesNames;\n\nexport type SwitchCssVariables = {\n root:\n | '--switch-radius'\n | '--switch-height'\n | '--switch-width'\n | '--switch-thumb-size'\n | '--switch-label-font-size'\n | '--switch-track-label-padding'\n | '--switch-color';\n};\n\nexport interface SwitchProps\n extends BoxProps, StylesApiProps<SwitchFactory>, ElementProps<'input', 'size' | 'children'> {\n /** Id used to bind input and label, if not passed, unique id will be generated instead */\n id?: string;\n\n /** Content of the label associated with the switch */\n label?: React.ReactNode;\n\n /** Inner label when the `Switch` is in unchecked state */\n offLabel?: React.ReactNode;\n\n /** Inner label when the `Switch` is in checked state */\n onLabel?: React.ReactNode;\n\n /** Key of `theme.colors` or any valid CSS color to set input color in checked state @default theme.primaryColor */\n color?: MantineColor;\n\n /** Controls size of all elements */\n size?: MantineSize | (string & {});\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default 'xl' */\n radius?: MantineRadius;\n\n /** Props passed down to the root element */\n wrapperProps?: React.ComponentProps<'div'> & DataAttributes;\n\n /** Icon inside the thumb of the switch */\n thumbIcon?: React.ReactNode;\n\n /** Position of the label relative to the input @default 'right' */\n labelPosition?: 'left' | 'right';\n\n /** Description displayed below the label */\n description?: React.ReactNode;\n\n /** Error displayed below the label */\n error?: React.ReactNode;\n\n /** Assigns ref of the root element */\n rootRef?: React.Ref<HTMLDivElement>;\n\n /** If set, displays a colored dot inside the thumb that matches the track background color @default true */\n withThumbIndicator?: boolean;\n}\n\nexport type SwitchFactory = Factory<{\n props: SwitchProps;\n ref: HTMLInputElement;\n stylesNames: SwitchStylesNames;\n vars: SwitchCssVariables;\n staticComponents: {\n Group: typeof SwitchGroup;\n };\n}>;\n\nconst defaultProps = {\n labelPosition: 'right',\n withThumbIndicator: true,\n} satisfies Partial<SwitchProps>;\n\nconst varsResolver = createVarsResolver<SwitchFactory>((theme, { radius, color, size }) => ({\n root: {\n '--switch-radius': radius === undefined ? undefined : getRadius(radius),\n '--switch-height': getSize(size, 'switch-height'),\n '--switch-width': getSize(size, 'switch-width'),\n '--switch-thumb-size': getSize(size, 'switch-thumb-size'),\n '--switch-label-font-size': getSize(size, 'switch-label-font-size'),\n '--switch-track-label-padding': getSize(size, 'switch-track-label-padding'),\n '--switch-color': color ? getThemeColor(color, theme) : undefined,\n },\n}));\n\nexport const Switch = factory<SwitchFactory>((_props) => {\n const props = useProps('Switch', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n color,\n label,\n offLabel,\n onLabel,\n id,\n size,\n radius,\n wrapperProps,\n thumbIcon,\n checked,\n defaultChecked,\n onChange,\n labelPosition,\n description,\n error,\n disabled,\n variant,\n rootRef,\n mod,\n withThumbIndicator,\n attributes,\n ...others\n } = props;\n\n const ctx = use(SwitchGroupContext);\n const _size = size || ctx?.size;\n\n const getStyles = useStyles<SwitchFactory>({\n name: 'Switch',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const { styleProps, rest } = extractStyleProps(others);\n const uuid = useId(id);\n const descriptionId = description ? `${uuid}-description` : undefined;\n const errorId = error && typeof error !== 'boolean' ? `${uuid}-error` : undefined;\n const describedBy =\n [descriptionId, errorId, rest['aria-describedby']].filter(Boolean).join(' ') || undefined;\n\n const withContextProps = {\n checked: ctx?.value.includes(rest.value as string) ?? checked,\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => {\n ctx?.onChange(event);\n onChange?.(event);\n },\n };\n\n const _disabled = disabled || ctx?.isDisabled?.(rest.value as string);\n\n const [_checked, handleChange] = useUncontrolled({\n value: withContextProps.checked ?? checked,\n defaultValue: defaultChecked,\n finalValue: false,\n });\n\n return (\n <InlineInput\n {...getStyles('root')}\n __staticSelector=\"Switch\"\n __stylesApiProps={props}\n id={uuid}\n size={_size}\n labelPosition={labelPosition}\n label={label}\n description={description}\n error={error}\n disabled={_disabled}\n bodyElement=\"label\"\n labelElement=\"span\"\n classNames={classNames}\n styles={styles}\n unstyled={unstyled}\n data-checked={withContextProps.checked}\n variant={variant}\n ref={rootRef}\n mod={mod}\n attributes={attributes}\n inert={rest.inert}\n {...styleProps}\n {...wrapperProps}\n >\n <input\n {...rest}\n {...withContextProps}\n disabled={_disabled}\n checked={_checked}\n data-checked={withContextProps.checked}\n onChange={(event) => {\n withContextProps.onChange?.(event);\n handleChange(event.currentTarget.checked);\n }}\n id={uuid}\n type=\"checkbox\"\n role=\"switch\"\n inert={rest.inert}\n aria-describedby={describedBy}\n {...getStyles('input')}\n />\n\n <Box\n aria-hidden=\"true\"\n component=\"span\"\n mod={{ error, 'label-position': labelPosition, 'without-labels': !onLabel && !offLabel }}\n {...getStyles('track')}\n >\n <Box\n component=\"span\"\n mod={{ 'reduce-motion': true, 'with-thumb-indicator': withThumbIndicator && !thumbIcon }}\n {...getStyles('thumb')}\n >\n {thumbIcon}\n </Box>\n <span {...getStyles('trackLabel')}>{_checked ? onLabel : offLabel}</span>\n </Box>\n </InlineInput>\n );\n});\n\nSwitch.classes = { ...classes, ...InlineInputClasses };\nSwitch.varsResolver = varsResolver;\nSwitch.displayName = '@mantine/core/Switch';\nSwitch.Group = SwitchGroup;\n\nexport namespace Switch {\n export type Props = SwitchProps;\n export type StylesNames = SwitchStylesNames;\n export type CssVariables = SwitchCssVariables;\n export type Factory = SwitchFactory;\n\n export namespace Group {\n export type Props = SwitchGroupProps;\n export type StylesNames = SwitchGroupStylesNames;\n export type Factory = SwitchGroupFactory;\n export type Context = SwitchGroupContextValue;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyGA,MAAM,eAAe;CACnB,eAAe;C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,KAAK,KAAe;CAEpE,MAAM,CAAC,UAAU,gBAAgB,gBAAgB;EAC/C,OAAO,iBAAiB,WAAW;EACnC,cAAc;EACd,YAAY;CACd,CAAC;CAED,OACE,qBAAC,aAAD;EACE,GAAI,UAAU,MAAM;EACpB,kBAAiB;EACjB,kBAAkB;EAClB,IAAI;EACJ,MAAM;EACS;EACR;EACM;EACN;EACP,UAAU;EACV,aAAY;EACZ,cAAa;EACD;EACJ;EACE;EACV,gBAAc,iBAAiB;EACtB;EACT,KAAK;EACA;EACO;EACZ,OAAO,KAAK;EACZ,GAAI;EACJ,GAAI;YAvBN,CAyBE,oBAAC,SAAD;GACE,GAAI;GACJ,GAAI;GACJ,UAAU;GACV,SAAS;GACT,gBAAc,iBAAiB;GAC/B,WAAW,UAAU;IACnB,iBAAiB,WAAW,KAAK;IACjC,aAAa,MAAM,cAAc,OAAO;GAC1C;GACA,IAAI;GACJ,MAAK;GACL,MAAK;GACL,OAAO,KAAK;GACZ,oBAAkB;GAClB,GAAI,UAAU,OAAO;EACtB,CAAA,GAED,qBAAC,KAAD;GACE,eAAY;GACZ,WAAU;GACV,KAAK;IAAE;IAAO,kBAAkB;IAAe,kBAAkB,CAAC,WAAW,CAAC;GAAS;GACvF,GAAI,UAAU,OAAO;aAJvB,CAME,oBAAC,KAAD;IACE,WAAU;IACV,KAAK;KAAE,iBAAiB;KAAM,wBAAwB,sBAAsB,CAAC;IAAU;IACvF,GAAI,UAAU,OAAO;cAEpB;GACE,CAAA,GACL,oBAAC,QAAD;IAAM,GAAI,UAAU,YAAY;cAAI,WAAW,UAAU;GAAe,CAAA,CACrE;IACM;;AAEjB,CAAC;AAED,OAAO,UAAU;CAAE,GAAGC;CAAS,GAAG;AAAmB;AACrD,OAAO,eAAe;AACtB,OAAO,cAAc;AACrB,OAAO,QAAQ"}
1
+ {"version":3,"file":"Switch.mjs","names":["useId","classes"],"sources":["../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import { use } from 'react';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n extractStyleProps,\n factory,\n Factory,\n getRadius,\n getSize,\n getThemeColor,\n MantineColor,\n MantineRadius,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { InlineInput, InlineInputClasses, InlineInputStylesNames } from '../../utils/InlineInput';\nimport {\n SwitchGroup,\n SwitchGroupContext,\n type SwitchGroupProps,\n type SwitchGroupStylesNames,\n type SwitchGroupFactory,\n type SwitchGroupContextValue,\n} from './SwitchGroup/SwitchGroup';\nimport classes from './Switch.module.css';\nexport type SwitchStylesNames =\n | 'root'\n | 'track'\n | 'trackLabel'\n | 'thumb'\n | 'input'\n | InlineInputStylesNames;\n\nexport type SwitchCssVariables = {\n root:\n | '--switch-radius'\n | '--switch-height'\n | '--switch-width'\n | '--switch-thumb-size'\n | '--switch-label-font-size'\n | '--switch-track-label-padding'\n | '--switch-color';\n};\n\nexport interface SwitchProps\n extends BoxProps, StylesApiProps<SwitchFactory>, ElementProps<'input', 'size' | 'children'> {\n /** Id used to bind input and label, if not passed, unique id will be generated instead */\n id?: string;\n\n /** Content of the label associated with the switch */\n label?: React.ReactNode;\n\n /** Inner label when the `Switch` is in unchecked state */\n offLabel?: React.ReactNode;\n\n /** Inner label when the `Switch` is in checked state */\n onLabel?: React.ReactNode;\n\n /** Key of `theme.colors` or any valid CSS color to set input color in checked state @default theme.primaryColor */\n color?: MantineColor;\n\n /** Controls size of all elements */\n size?: MantineSize | (string & {});\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default 'xl' */\n radius?: MantineRadius;\n\n /** Props passed down to the root element */\n wrapperProps?: React.ComponentProps<'div'> & DataAttributes;\n\n /** Icon inside the thumb of the switch */\n thumbIcon?: React.ReactNode;\n\n /** Position of the label relative to the input @default 'right' */\n labelPosition?: 'left' | 'right';\n\n /** Description displayed below the label */\n description?: React.ReactNode;\n\n /** Error displayed below the label */\n error?: React.ReactNode;\n\n /** Assigns ref of the root element */\n rootRef?: React.Ref<HTMLDivElement>;\n\n /** If set, displays a colored dot inside the thumb that matches the track background color @default true */\n withThumbIndicator?: boolean;\n}\n\nexport type SwitchFactory = Factory<{\n props: SwitchProps;\n ref: HTMLInputElement;\n stylesNames: SwitchStylesNames;\n vars: SwitchCssVariables;\n staticComponents: {\n Group: typeof SwitchGroup;\n };\n}>;\n\nconst defaultProps = {\n labelPosition: 'right',\n withThumbIndicator: true,\n} satisfies Partial<SwitchProps>;\n\nconst varsResolver = createVarsResolver<SwitchFactory>((theme, { radius, color, size }) => ({\n root: {\n '--switch-radius': radius === undefined ? undefined : getRadius(radius),\n '--switch-height': getSize(size, 'switch-height'),\n '--switch-width': getSize(size, 'switch-width'),\n '--switch-thumb-size': getSize(size, 'switch-thumb-size'),\n '--switch-label-font-size': getSize(size, 'switch-label-font-size'),\n '--switch-track-label-padding': getSize(size, 'switch-track-label-padding'),\n '--switch-color': color ? getThemeColor(color, theme) : undefined,\n },\n}));\n\nexport const Switch = factory<SwitchFactory>((_props) => {\n const props = useProps('Switch', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n color,\n label,\n offLabel,\n onLabel,\n id,\n size,\n radius,\n wrapperProps,\n thumbIcon,\n checked,\n defaultChecked,\n onChange,\n labelPosition,\n description,\n error,\n disabled,\n variant,\n rootRef,\n mod,\n withThumbIndicator,\n attributes,\n ...others\n } = props;\n\n const ctx = use(SwitchGroupContext);\n const _size = size || ctx?.size;\n\n const getStyles = useStyles<SwitchFactory>({\n name: 'Switch',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const { styleProps, rest } = extractStyleProps(others);\n const uuid = useId(id);\n const descriptionId = description ? `${uuid}-description` : undefined;\n const errorId = error && typeof error !== 'boolean' ? `${uuid}-error` : undefined;\n const describedBy =\n [descriptionId, errorId, rest['aria-describedby']].filter(Boolean).join(' ') || undefined;\n\n const withContextProps = {\n checked: ctx?.value.includes(rest.value as string) ?? checked,\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => {\n ctx?.onChange(event);\n onChange?.(event);\n },\n };\n\n const _disabled = disabled || ctx?.isDisabled?.(rest.value as string);\n\n const [_checked, handleChange] = useUncontrolled({\n value: withContextProps.checked ?? checked,\n defaultValue: defaultChecked,\n finalValue: false,\n });\n\n return (\n <InlineInput\n {...getStyles('root')}\n __staticSelector=\"Switch\"\n __stylesApiProps={props}\n id={uuid}\n size={_size}\n labelPosition={labelPosition}\n label={label}\n description={description}\n error={error}\n disabled={_disabled}\n bodyElement=\"label\"\n labelElement=\"span\"\n classNames={classNames}\n styles={styles}\n unstyled={unstyled}\n data-checked={withContextProps.checked}\n variant={variant}\n ref={rootRef}\n mod={mod}\n attributes={attributes}\n inert={rest.inert}\n {...styleProps}\n {...wrapperProps}\n >\n <input\n {...rest}\n {...withContextProps}\n disabled={_disabled}\n checked={_checked}\n data-checked={withContextProps.checked}\n onChange={(event) => {\n withContextProps.onChange?.(event);\n handleChange(event.currentTarget.checked);\n }}\n id={uuid}\n type=\"checkbox\"\n role=\"switch\"\n inert={rest.inert}\n aria-describedby={describedBy}\n {...getStyles('input')}\n />\n\n <Box\n aria-hidden=\"true\"\n component=\"span\"\n mod={{ error, 'label-position': labelPosition, 'without-labels': !onLabel && !offLabel }}\n {...getStyles('track')}\n >\n <Box\n component=\"span\"\n mod={{ 'reduce-motion': true, 'with-thumb-indicator': withThumbIndicator && !thumbIcon }}\n {...getStyles('thumb')}\n >\n {thumbIcon}\n </Box>\n <span {...getStyles('trackLabel')}>{_checked ? onLabel : offLabel}</span>\n </Box>\n </InlineInput>\n );\n});\n\nSwitch.classes = { ...classes, ...InlineInputClasses };\nSwitch.varsResolver = varsResolver;\nSwitch.displayName = '@mantine/core/Switch';\nSwitch.Group = SwitchGroup;\n\nexport namespace Switch {\n export type Props = SwitchProps;\n export type StylesNames = SwitchStylesNames;\n export type CssVariables = SwitchCssVariables;\n export type Factory = SwitchFactory;\n\n export namespace Group {\n export type Props = SwitchGroupProps;\n export type StylesNames = SwitchGroupStylesNames;\n export type Factory = SwitchGroupFactory;\n export type Context = SwitchGroupContextValue;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyGA,MAAM,eAAe;CACnB,eAAe;CACf,oBAAoB;AACtB;AAEA,MAAM,eAAe,oBAAmC,OAAO,EAAE,QAAQ,OAAO,YAAY,EAC1F,MAAM;CACJ,mBAAmB,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,MAAM;CACtE,mBAAmB,QAAQ,MAAM,eAAe;CAChD,kBAAkB,QAAQ,MAAM,cAAc;CAC9C,uBAAuB,QAAQ,MAAM,mBAAmB;CACxD,4BAA4B,QAAQ,MAAM,wBAAwB;CAClE,gCAAgC,QAAQ,MAAM,4BAA4B;CAC1E,kBAAkB,QAAQ,cAAc,OAAO,KAAK,IAAI,KAAA;AAC1D,EACF,EAAE;AAEF,MAAa,SAAS,SAAwB,WAAW;CACvD,MAAM,QAAQ,SAAS,UAAU,cAAc,MAAM;CACrD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,OACA,OACA,UACA,SACA,IACA,MACA,QACA,cACA,WACA,SACA,gBACA,UACA,eACA,aACA,OACA,UACA,SACA,SACA,KACA,oBACA,YACA,GAAG,WACD;CAEJ,MAAM,MAAM,IAAI,kBAAkB;CAClC,MAAM,QAAQ,QAAQ,KAAK;CAE3B,MAAM,YAAY,UAAyB;EACzC,MAAM;EACN;EACA,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,EAAE,YAAY,SAAS,kBAAkB,MAAM;CACrD,MAAM,OAAOA,QAAM,EAAE;CAGrB,MAAM,cACJ;EAHoB,cAAc,GAAG,KAAK,gBAAgB,KAAA;EAC5C,SAAS,OAAO,UAAU,YAAY,GAAG,KAAK,UAAU,KAAA;EAE7C,KAAK;CAAmB,CAAC,CAAC,OAA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jB,CAAC;AAED,OAAO,UAAU;CAAE,GAAGC;CAAS,GAAG;AAAmB;AACrD,OAAO,eAAe;AACtB,OAAO,cAAc;AACrB,OAAO,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"Table.components.mjs","names":["classes"],"sources":["../../../src/components/Table/Table.components.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n FactoryPayload,\n useProps,\n} from '../../core';\nimport type { TableFactory } from './Table';\nimport { TableContextValue, useTableContext } from './Table.context';\nimport classes from './Table.module.css';\n\nexport interface TableElementProps<Selector extends string>\n extends\n BoxProps,\n CompoundStylesApiProps<Omit<TableFactory, 'stylesNames'> & { stylesNames: Selector }> {}\n\nexport interface TableThProps extends TableElementProps<'th'>, ElementProps<'th'> {}\nexport interface TableTdProps extends TableElementProps<'td'>, ElementProps<'td'> {}\nexport interface TableTrProps extends TableElementProps<'tr'>, ElementProps<'tr'> {}\nexport interface TableTheadProps extends TableElementProps<'thead'>, ElementProps<'thead'> {}\nexport interface TableTbodyProps extends TableElementProps<'tbody'>, ElementProps<'tbody'> {}\nexport interface TableTfootProps extends TableElementProps<'tfoot'>, ElementProps<'tfoot'> {}\nexport interface TableCaptionProps extends TableElementProps<'caption'>, ElementProps<'caption'> {}\n\nexport type TableThFactory = Factory<{\n props: TableThProps;\n ref: HTMLTableCellElement;\n stylesNames: 'th';\n compound: true;\n}>;\n\nexport type TableTdFactory = Factory<{\n props: TableTdProps;\n ref: HTMLTableCellElement;\n stylesNames: 'td';\n compound: true;\n}>;\n\nexport type TableTrFactory = Factory<{\n props: TableTrProps;\n ref: HTMLTableRowElement;\n stylesNames: 'tr';\n compound: true;\n}>;\n\nexport type TableTheadFactory = Factory<{\n props: TableTheadProps;\n ref: HTMLTableSectionElement;\n stylesNames: 'thead';\n compound: true;\n}>;\n\nexport type TableTbodyFactory = Factory<{\n props: TableTbodyProps;\n ref: HTMLTableSectionElement;\n stylesNames: 'tbody';\n compound: true;\n}>;\n\nexport type TableTfootFactory = Factory<{\n props: TableTfootProps;\n ref: HTMLTableSectionElement;\n stylesNames: 'tfoot';\n compound: true;\n}>;\n\nexport type TableCaptionFactory = Factory<{\n props: TableCaptionProps;\n ref: HTMLTableCaptionElement;\n stylesNames: 'caption';\n compound: true;\n}>;\n\ninterface TableElementOptions {\n columnBorder?: true;\n rowBorder?: true;\n striped?: true;\n highlightOnHover?: true;\n captionSide?: true;\n stickyHeader?: true;\n}\n\nfunction getDataAttributes(ctx: TableContextValue, options?: TableElementOptions) {\n if (!options) {\n return undefined;\n }\n\n const data: Record<string, boolean | string> = {};\n\n if (options.columnBorder && ctx.withColumnBorders) {\n data['data-with-column-border'] = true;\n }\n\n if (options.rowBorder && ctx.withRowBorders) {\n data['data-with-row-border'] = true;\n }\n\n if (options.striped && ctx.striped) {\n data['data-striped'] = ctx.striped;\n }\n\n if (options.highlightOnHover && ctx.highlightOnHover) {\n data['data-hover'] = true;\n }\n\n if (options.captionSide && ctx.captionSide) {\n data['data-side'] = ctx.captionSide;\n }\n\n if (options.stickyHeader && ctx.stickyHeader) {\n data['data-sticky'] = true;\n }\n\n return data;\n}\n\nexport function tableElement<Factory extends FactoryPayload>(\n element: 'th' | 'td' | 'tr' | 'thead' | 'tbody' | 'tfoot' | 'caption',\n options?: TableElementOptions\n) {\n const name = `Table${element.charAt(0).toUpperCase()}${element.slice(1)}`;\n const Component = factory<Factory>((_props) => {\n const props = useProps(name, {}, _props);\n const { classNames, className, style, styles, ...others } = props;\n\n const ctx = useTableContext();\n\n return (\n <Box\n component={element}\n {...getDataAttributes(ctx, options)}\n {...ctx.getStyles(element, { className, classNames, style, styles, props })}\n {...others}\n />\n );\n });\n\n Component.displayName = `@mantine/core/${name}`;\n Component.classes = classes;\n return Component;\n}\n\nexport const TableTh = tableElement<TableThFactory>('th', { columnBorder: true });\nexport const TableTd = tableElement<TableTdFactory>('td', { columnBorder: true });\nexport const TableTr = tableElement<TableTrFactory>('tr', {\n rowBorder: true,\n striped: true,\n highlightOnHover: true,\n});\nexport const TableThead = tableElement<TableTheadFactory>('thead', { stickyHeader: true });\nexport const TableTbody = tableElement<TableTbodyFactory>('tbody');\nexport const TableTfoot = tableElement<TableTfootFactory>('tfoot');\nexport const TableCaption = tableElement<TableCaptionFactory>('caption', { captionSide: true });\n"],"mappings":";;;;;;;;AAqFA,SAAS,kBAAkB,KAAwB,SAA+B;CAChF,IAAI,CAAC,SACH;CAGF,MAAM,OAAyC,CAAC;CAEhD,IAAI,QAAQ,gBAAgB,IAAI,mBAC9B,KAAK,6BAA6B;CAGpC,IAAI,QAAQ,aAAa,IAAI,gBAC3B,KAAK,0BAA0B;CAGjC,IAAI,QAAQ,WAAW,IAAI,SACzB,KAAK,kBAAkB,IAAI;CAG7B,IAAI,QAAQ,oBAAoB,IAAI,kBAClC,KAAK,gBAAgB;CAGvB,IAAI,QAAQ,eAAe,IAAI,aAC7B,KAAK,eAAe,IAAI;CAG1B,IAAI,QAAQ,gBAAgB,IAAI,cAC9B,KAAK,iBAAiB;CAGxB,OAAO;AACT;AAEA,SAAgB,aACd,SACA,SACA;CACA,MAAM,OAAO,QAAQ,QAAQ,OAAO,CAAC,EAAE,YAAY,IAAI,QAAQ,MAAM,CAAC;CACtE,MAAM,YAAY,SAAkB,WAAW;EAC7C,MAAM,QAAQ,SAAS,MAAM,CAAC,GAAG,MAAM;EACvC,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,GAAG,WAAW;EAE5D,MAAM,MAAM,gBAAgB;EAE5B,OACE,oBAAC,KAAD;GACE,WAAW;GACX,GAAI,kBAAkB,KAAK,OAAO;GAClC,GAAI,IAAI,UAAU,SAAS;IAAE;IAAW;IAAY;IAAO;IAAQ;GAAM,CAAC;GAC1E,GAAI;EACL,CAAA;CAEL,CAAC;CAED,UAAU,cAAc,iBAAiB;CACzC,UAAU,UAAUA;CACpB,OAAO;AACT;AAEA,MAAa,UAAU,aAA6B,MAAM,EAAE,cAAc,KAAK,CAAC;AAChF,MAAa,UAAU,aAA6B,MAAM,EAAE,cAAc,KAAK,CAAC;AAChF,MAAa,UAAU,aAA6B,MAAM;CACxD,WAAW;CACX,SAAS;CACT,kBAAkB;AACpB,CAAC;AACD,MAAa,aAAa,aAAgC,SAAS,EAAE,cAAc,KAAK,CAAC;AACzF,MAAa,aAAa,aAAgC,OAAO;AACjE,MAAa,aAAa,aAAgC,OAAO;AACjE,MAAa,eAAe,aAAkC,WAAW,EAAE,aAAa,KAAK,CAAC"}
1
+ {"version":3,"file":"Table.components.mjs","names":["classes"],"sources":["../../../src/components/Table/Table.components.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n FactoryPayload,\n useProps,\n} from '../../core';\nimport type { TableFactory } from './Table';\nimport { TableContextValue, useTableContext } from './Table.context';\nimport classes from './Table.module.css';\n\nexport interface TableElementProps<Selector extends string>\n extends\n BoxProps,\n CompoundStylesApiProps<Omit<TableFactory, 'stylesNames'> & { stylesNames: Selector }> {}\n\nexport interface TableThProps extends TableElementProps<'th'>, ElementProps<'th'> {}\nexport interface TableTdProps extends TableElementProps<'td'>, ElementProps<'td'> {}\nexport interface TableTrProps extends TableElementProps<'tr'>, ElementProps<'tr'> {}\nexport interface TableTheadProps extends TableElementProps<'thead'>, ElementProps<'thead'> {}\nexport interface TableTbodyProps extends TableElementProps<'tbody'>, ElementProps<'tbody'> {}\nexport interface TableTfootProps extends TableElementProps<'tfoot'>, ElementProps<'tfoot'> {}\nexport interface TableCaptionProps extends TableElementProps<'caption'>, ElementProps<'caption'> {}\n\nexport type TableThFactory = Factory<{\n props: TableThProps;\n ref: HTMLTableCellElement;\n stylesNames: 'th';\n compound: true;\n}>;\n\nexport type TableTdFactory = Factory<{\n props: TableTdProps;\n ref: HTMLTableCellElement;\n stylesNames: 'td';\n compound: true;\n}>;\n\nexport type TableTrFactory = Factory<{\n props: TableTrProps;\n ref: HTMLTableRowElement;\n stylesNames: 'tr';\n compound: true;\n}>;\n\nexport type TableTheadFactory = Factory<{\n props: TableTheadProps;\n ref: HTMLTableSectionElement;\n stylesNames: 'thead';\n compound: true;\n}>;\n\nexport type TableTbodyFactory = Factory<{\n props: TableTbodyProps;\n ref: HTMLTableSectionElement;\n stylesNames: 'tbody';\n compound: true;\n}>;\n\nexport type TableTfootFactory = Factory<{\n props: TableTfootProps;\n ref: HTMLTableSectionElement;\n stylesNames: 'tfoot';\n compound: true;\n}>;\n\nexport type TableCaptionFactory = Factory<{\n props: TableCaptionProps;\n ref: HTMLTableCaptionElement;\n stylesNames: 'caption';\n compound: true;\n}>;\n\ninterface TableElementOptions {\n columnBorder?: true;\n rowBorder?: true;\n striped?: true;\n highlightOnHover?: true;\n captionSide?: true;\n stickyHeader?: true;\n}\n\nfunction getDataAttributes(ctx: TableContextValue, options?: TableElementOptions) {\n if (!options) {\n return undefined;\n }\n\n const data: Record<string, boolean | string> = {};\n\n if (options.columnBorder && ctx.withColumnBorders) {\n data['data-with-column-border'] = true;\n }\n\n if (options.rowBorder && ctx.withRowBorders) {\n data['data-with-row-border'] = true;\n }\n\n if (options.striped && ctx.striped) {\n data['data-striped'] = ctx.striped;\n }\n\n if (options.highlightOnHover && ctx.highlightOnHover) {\n data['data-hover'] = true;\n }\n\n if (options.captionSide && ctx.captionSide) {\n data['data-side'] = ctx.captionSide;\n }\n\n if (options.stickyHeader && ctx.stickyHeader) {\n data['data-sticky'] = true;\n }\n\n return data;\n}\n\nexport function tableElement<Factory extends FactoryPayload>(\n element: 'th' | 'td' | 'tr' | 'thead' | 'tbody' | 'tfoot' | 'caption',\n options?: TableElementOptions\n) {\n const name = `Table${element.charAt(0).toUpperCase()}${element.slice(1)}`;\n const Component = factory<Factory>((_props) => {\n const props = useProps(name, {}, _props);\n const { classNames, className, style, styles, ...others } = props;\n\n const ctx = useTableContext();\n\n return (\n <Box\n component={element}\n {...getDataAttributes(ctx, options)}\n {...ctx.getStyles(element, { className, classNames, style, styles, props })}\n {...others}\n />\n );\n });\n\n Component.displayName = `@mantine/core/${name}`;\n Component.classes = classes;\n return Component;\n}\n\nexport const TableTh = tableElement<TableThFactory>('th', { columnBorder: true });\nexport const TableTd = tableElement<TableTdFactory>('td', { columnBorder: true });\nexport const TableTr = tableElement<TableTrFactory>('tr', {\n rowBorder: true,\n striped: true,\n highlightOnHover: true,\n});\nexport const TableThead = tableElement<TableTheadFactory>('thead', { stickyHeader: true });\nexport const TableTbody = tableElement<TableTbodyFactory>('tbody');\nexport const TableTfoot = tableElement<TableTfootFactory>('tfoot');\nexport const TableCaption = tableElement<TableCaptionFactory>('caption', { captionSide: true });\n"],"mappings":";;;;;;;;AAqFA,SAAS,kBAAkB,KAAwB,SAA+B;CAChF,IAAI,CAAC,SACH;CAGF,MAAM,OAAyC,CAAC;CAEhD,IAAI,QAAQ,gBAAgB,IAAI,mBAC9B,KAAK,6BAA6B;CAGpC,IAAI,QAAQ,aAAa,IAAI,gBAC3B,KAAK,0BAA0B;CAGjC,IAAI,QAAQ,WAAW,IAAI,SACzB,KAAK,kBAAkB,IAAI;CAG7B,IAAI,QAAQ,oBAAoB,IAAI,kBAClC,KAAK,gBAAgB;CAGvB,IAAI,QAAQ,eAAe,IAAI,aAC7B,KAAK,eAAe,IAAI;CAG1B,IAAI,QAAQ,gBAAgB,IAAI,cAC9B,KAAK,iBAAiB;CAGxB,OAAO;AACT;AAEA,SAAgB,aACd,SACA,SACA;CACA,MAAM,OAAO,QAAQ,QAAQ,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,QAAQ,MAAM,CAAC;CACtE,MAAM,YAAY,SAAkB,WAAW;EAC7C,MAAM,QAAQ,SAAS,MAAM,CAAC,GAAG,MAAM;EACvC,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,GAAG,WAAW;EAE5D,MAAM,MAAM,gBAAgB;EAE5B,OACE,oBAAC,KAAD;GACE,WAAW;GACX,GAAI,kBAAkB,KAAK,OAAO;GAClC,GAAI,IAAI,UAAU,SAAS;IAAE;IAAW;IAAY;IAAO;IAAQ;GAAM,CAAC;GAC1E,GAAI;EACL,CAAA;CAEL,CAAC;CAED,UAAU,cAAc,iBAAiB;CACzC,UAAU,UAAUA;CACpB,OAAO;AACT;AAEA,MAAa,UAAU,aAA6B,MAAM,EAAE,cAAc,KAAK,CAAC;AAChF,MAAa,UAAU,aAA6B,MAAM,EAAE,cAAc,KAAK,CAAC;AAChF,MAAa,UAAU,aAA6B,MAAM;CACxD,WAAW;CACX,SAAS;CACT,kBAAkB;AACpB,CAAC;AACD,MAAa,aAAa,aAAgC,SAAS,EAAE,cAAc,KAAK,CAAC;AACzF,MAAa,aAAa,aAAgC,OAAO;AACjE,MAAa,aAAa,aAAgC,OAAO;AACjE,MAAa,eAAe,aAAkC,WAAW,EAAE,aAAa,KAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableOfContents.mjs","names":["classes"],"sources":["../../../src/components/TableOfContents/TableOfContents.tsx"],"sourcesContent":["import {\n assignRef,\n useId,\n useScrollSpy,\n UseScrollSpyHeadingData,\n UseScrollSpyOptions,\n} from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getFontSize,\n getRadius,\n MantineColor,\n MantineRadius,\n MantineSize,\n noop,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { UnstyledButton, UnstyledButtonProps } from '../UnstyledButton';\nimport classes from './TableOfContents.module.css';\n\nexport type TableOfContentsStylesNames = 'root' | 'control';\nexport type TableOfContentsVariant = 'filled' | 'light' | 'none';\nexport type TableOfContentsCssVariables = {\n root: '--toc-bg' | '--toc-color' | '--toc-size' | '--toc-depth-offset' | '--toc-radius';\n};\n\nexport interface InitialTableOfContentsData {\n /** Heading depth, 1-6 */\n depth: number;\n\n /** Heading text content value */\n value: string;\n\n /** Heading id, must be unique, used as `key` */\n id?: string;\n}\n\nexport interface TableOfContentsGetControlPropsPayload {\n /** True if the associated heading is currently the best match in the viewport */\n active: boolean;\n\n /** Data passed down from `use-scroll-spy` hook: depth, id, value */\n data: UseScrollSpyHeadingData;\n}\n\nexport interface TableOfContentsProps\n extends BoxProps, StylesApiProps<TableOfContentsFactory>, ElementProps<'div'> {\n /** Key of `theme.colors` or any valid CSS color value @default theme.primaryColor */\n color?: MantineColor;\n\n /** Controls font-size and padding of all elements @default 'md' */\n size?: MantineSize | (string & {}) | number;\n\n /** If set, adjusts text color based on background color for `filled` variant */\n autoContrast?: boolean;\n\n /** Options passed down to `use-scroll-spy` hook */\n scrollSpyOptions?: UseScrollSpyOptions;\n\n /** Data used to render content until actual values are retrieved from the DOM */\n initialData?: InitialTableOfContentsData[];\n\n /** A function to pass props down to controls, accepts values from `use-scroll-spy` hook as an argument and active state. */\n getControlProps?: (\n payload: TableOfContentsGetControlPropsPayload\n ) => UnstyledButtonProps & ElementProps<'button'> & Record<`data-${string}`, any>;\n\n /** Minimum `depth` value that requires offset, `1` by default */\n minDepthToOffset?: number;\n\n /** Controls padding on the left side of control, multiplied by (`depth` - `minDepthToOffset`), `20px` by default */\n depthOffset?: number | string;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** A function to reinitialize headings from `use-scroll-spy` hook */\n reinitializeRef?: React.RefObject<() => void>;\n}\n\nexport type TableOfContentsFactory = Factory<{\n props: TableOfContentsProps;\n ref: HTMLDivElement;\n stylesNames: TableOfContentsStylesNames;\n vars: TableOfContentsCssVariables;\n variant: TableOfContentsVariant;\n}>;\n\nconst defaultProps = {\n getControlProps: ({ data }) => ({\n children: data.value,\n }),\n} satisfies Partial<TableOfContentsProps>;\n\nconst varsResolver = createVarsResolver<TableOfContentsFactory>(\n (theme, { color, size, variant, autoContrast, depthOffset, radius }) => {\n const colors = theme.variantColorResolver({\n color: color || theme.primaryColor,\n theme,\n variant: variant || 'filled',\n autoContrast,\n });\n\n return {\n root: {\n '--toc-bg': variant !== 'none' ? colors.background : undefined,\n '--toc-color': variant !== 'none' ? colors.color : undefined,\n '--toc-size': getFontSize(size),\n '--toc-depth-offset': rem(depthOffset),\n '--toc-radius': getRadius(radius),\n },\n };\n }\n);\n\nexport const TableOfContents = factory<TableOfContentsFactory>((_props) => {\n const props = useProps('TableOfContents', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n color,\n autoContrast,\n scrollSpyOptions,\n initialData,\n getControlProps,\n minDepthToOffset,\n depthOffset,\n variant,\n radius,\n reinitializeRef,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<TableOfContentsFactory>({\n name: 'TableOfContents',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const idBase = useId();\n const spy = useScrollSpy(scrollSpyOptions);\n\n assignRef(reinitializeRef, spy.reinitialize);\n\n const headingsData = (\n spy.initialized ? spy.data : initialData || []\n ) as UseScrollSpyHeadingData[];\n\n const controls = headingsData.map((data, index) => {\n const controlProps = getControlProps?.({\n active: index === spy.active,\n data: { ...data, getNode: data.getNode || noop },\n });\n\n return (\n <UnstyledButton\n key={data.id || `${idBase}-${index}`}\n __vars={{ '--depth-offset': `${data.depth - (minDepthToOffset || 1)}` }}\n data-active={index === spy.active || undefined}\n variant={variant}\n {...controlProps}\n {...getStyles('control', {\n className: controlProps?.className,\n style: controlProps?.style,\n })}\n />\n );\n });\n\n return (\n <Box variant={variant} {...getStyles('root')} {...others}>\n {controls}\n </Box>\n );\n});\n\nTableOfContents.displayName = '@mantine/core/TableOfContents';\nTableOfContents.classes = classes;\nTableOfContents.varsResolver = varsResolver;\n\nexport namespace TableOfContents {\n export type Props = TableOfContentsProps;\n export type StylesNames = TableOfContentsStylesNames;\n export type CssVariables = TableOfContentsCssVariables;\n export type Factory = TableOfContentsFactory;\n export type Variant = TableOfContentsVariant;\n}\n"],"mappings":";;;;;;;;;;;;;;AAgGA,MAAM,eAAe,EACnB,kBAAkB,EAAE,YAAY,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OAAO,GAAG,OAS9B;CAEL,CAAC;CAED,OACE,oBAAC,KAAD;EAAc;EAAS,GAAI,UAAU,MAAM;EAAG,GAAI;YAC/C;CACE,CAAA;AAET,CAAC;AAED,gBAAgB,cAAc;AAC9B,gBAAgB,UAAUA;AAC1B,gBAAgB,eAAe"}
1
+ {"version":3,"file":"TableOfContents.mjs","names":["classes"],"sources":["../../../src/components/TableOfContents/TableOfContents.tsx"],"sourcesContent":["import {\n assignRef,\n useId,\n useScrollSpy,\n UseScrollSpyHeadingData,\n UseScrollSpyOptions,\n} from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getFontSize,\n getRadius,\n MantineColor,\n MantineRadius,\n MantineSize,\n noop,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { UnstyledButton, UnstyledButtonProps } from '../UnstyledButton';\nimport classes from './TableOfContents.module.css';\n\nexport type TableOfContentsStylesNames = 'root' | 'control';\nexport type TableOfContentsVariant = 'filled' | 'light' | 'none';\nexport type TableOfContentsCssVariables = {\n root: '--toc-bg' | '--toc-color' | '--toc-size' | '--toc-depth-offset' | '--toc-radius';\n};\n\nexport interface InitialTableOfContentsData {\n /** Heading depth, 1-6 */\n depth: number;\n\n /** Heading text content value */\n value: string;\n\n /** Heading id, must be unique, used as `key` */\n id?: string;\n}\n\nexport interface TableOfContentsGetControlPropsPayload {\n /** True if the associated heading is currently the best match in the viewport */\n active: boolean;\n\n /** Data passed down from `use-scroll-spy` hook: depth, id, value */\n data: UseScrollSpyHeadingData;\n}\n\nexport interface TableOfContentsProps\n extends BoxProps, StylesApiProps<TableOfContentsFactory>, ElementProps<'div'> {\n /** Key of `theme.colors` or any valid CSS color value @default theme.primaryColor */\n color?: MantineColor;\n\n /** Controls font-size and padding of all elements @default 'md' */\n size?: MantineSize | (string & {}) | number;\n\n /** If set, adjusts text color based on background color for `filled` variant */\n autoContrast?: boolean;\n\n /** Options passed down to `use-scroll-spy` hook */\n scrollSpyOptions?: UseScrollSpyOptions;\n\n /** Data used to render content until actual values are retrieved from the DOM */\n initialData?: InitialTableOfContentsData[];\n\n /** A function to pass props down to controls, accepts values from `use-scroll-spy` hook as an argument and active state. */\n getControlProps?: (\n payload: TableOfContentsGetControlPropsPayload\n ) => UnstyledButtonProps & ElementProps<'button'> & Record<`data-${string}`, any>;\n\n /** Minimum `depth` value that requires offset, `1` by default */\n minDepthToOffset?: number;\n\n /** Controls padding on the left side of control, multiplied by (`depth` - `minDepthToOffset`), `20px` by default */\n depthOffset?: number | string;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** A function to reinitialize headings from `use-scroll-spy` hook */\n reinitializeRef?: React.RefObject<() => void>;\n}\n\nexport type TableOfContentsFactory = Factory<{\n props: TableOfContentsProps;\n ref: HTMLDivElement;\n stylesNames: TableOfContentsStylesNames;\n vars: TableOfContentsCssVariables;\n variant: TableOfContentsVariant;\n}>;\n\nconst defaultProps = {\n getControlProps: ({ data }) => ({\n children: data.value,\n }),\n} satisfies Partial<TableOfContentsProps>;\n\nconst varsResolver = createVarsResolver<TableOfContentsFactory>(\n (theme, { color, size, variant, autoContrast, depthOffset, radius }) => {\n const colors = theme.variantColorResolver({\n color: color || theme.primaryColor,\n theme,\n variant: variant || 'filled',\n autoContrast,\n });\n\n return {\n root: {\n '--toc-bg': variant !== 'none' ? colors.background : undefined,\n '--toc-color': variant !== 'none' ? colors.color : undefined,\n '--toc-size': getFontSize(size),\n '--toc-depth-offset': rem(depthOffset),\n '--toc-radius': getRadius(radius),\n },\n };\n }\n);\n\nexport const TableOfContents = factory<TableOfContentsFactory>((_props) => {\n const props = useProps('TableOfContents', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n color,\n autoContrast,\n scrollSpyOptions,\n initialData,\n getControlProps,\n minDepthToOffset,\n depthOffset,\n variant,\n radius,\n reinitializeRef,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<TableOfContentsFactory>({\n name: 'TableOfContents',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const idBase = useId();\n const spy = useScrollSpy(scrollSpyOptions);\n\n assignRef(reinitializeRef, spy.reinitialize);\n\n const headingsData = (\n spy.initialized ? spy.data : initialData || []\n ) as UseScrollSpyHeadingData[];\n\n const controls = headingsData.map((data, index) => {\n const controlProps = getControlProps?.({\n active: index === spy.active,\n data: { ...data, getNode: data.getNode || noop },\n });\n\n return (\n <UnstyledButton\n key={data.id || `${idBase}-${index}`}\n __vars={{ '--depth-offset': `${data.depth - (minDepthToOffset || 1)}` }}\n data-active={index === spy.active || undefined}\n variant={variant}\n {...controlProps}\n {...getStyles('control', {\n className: controlProps?.className,\n style: controlProps?.style,\n })}\n />\n );\n });\n\n return (\n <Box variant={variant} {...getStyles('root')} {...others}>\n {controls}\n </Box>\n );\n});\n\nTableOfContents.displayName = '@mantine/core/TableOfContents';\nTableOfContents.classes = classes;\nTableOfContents.varsResolver = varsResolver;\n\nexport namespace TableOfContents {\n export type Props = TableOfContentsProps;\n export type StylesNames = TableOfContentsStylesNames;\n export type CssVariables = TableOfContentsCssVariables;\n export type Factory = TableOfContentsFactory;\n export type Variant = TableOfContentsVariant;\n}\n"],"mappings":";;;;;;;;;;;;;;AAgGA,MAAM,eAAe,EACnB,kBAAkB,EAAE,YAAY,EAC9B,UAAU,KAAK,MACjB,GACF;AAEA,MAAM,eAAe,oBAClB,OAAO,EAAE,OAAO,MAAM,SAAS,cAAc,aAAa,aAAa;CACtE,MAAM,SAAS,MAAM,qBAAqB;EACxC,OAAO,SAAS,MAAM;EACtB;EACA,SAAS,WAAW;EACpB;CACF,CAAC;CAED,OAAO,EACL,MAAM;EACJ,YAAY,YAAY,SAAS,OAAO,aAAa,KAAA;EACrD,eAAe,YAAY,SAAS,OAAO,QAAQ,KAAA;EACnD,cAAc,YAAY,IAAI;EAC9B,sBAAsB,IAAI,WAAW;EACrC,gBAAgB,UAAU,MAAM;CAClC,EACF;AACF,CACF;AAEA,MAAa,kBAAkB,SAAiC,WAAW;CACzE,MAAM,QAAQ,SAAS,mBAAmB,cAAc,MAAM;CAC9D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,OACA,cACA,kBACA,aACA,iBACA,kBACA,aACA,SACA,QACA,iBACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAAkC;EAClD,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,SAAS,MAAM;CACrB,MAAM,MAAM,aAAa,gBAAgB;CAEzC,UAAU,iBAAiB,IAAI,YAAY;CAM3C,MAAM,YAHJ,IAAI,cAAc,IAAI,OAAO,eAAe,CAAC,EAAA,CAGjB,KAAK,MAAM,UAAU;EACjD,MAAM,eAAe,kBAAkB;GACrC,QAAQ,UAAU,IAAI;GACtB,MAAM;IAAE,GAAG;IAAM,SAAS,KAAK,WAAW;GAAK;EACjD,CAAC;EAED,OACE,oBAAC,gBAAD;GAEE,QAAQ,EAAE,kBAAkB,GAAG,KAAK,SAAS,oBAAoB,KAAK;GACtE,eAAa,UAAU,IAAI,UAAU,KAAA;GAC5B;GACT,GAAI;GACJ,GAAI,UAAU,WAAW;IACvB,WAAW,cAAc;IACzB,OAAO,cAAc;GACvB,CAAC;EACF,GATM,KAAK,MAAM,GAAG,OAAO,GAAG,OAS9B;CAEL,CAAC;CAED,OACE,oBAAC,KAAD;EAAc;EAAS,GAAI,UAAU,MAAM;EAAG,GAAI;YAC/C;CACE,CAAA;AAET,CAAC;AAED,gBAAgB,cAAc;AAC9B,gBAAgB,UAAUA;AAC1B,gBAAgB,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.context.mjs","names":[],"sources":["../../../src/components/Tabs/Tabs.context.ts"],"sourcesContent":["import { createSafeContext, GetStylesApi } from '../../core';\nimport type { TabsFactory } from './Tabs';\n\nexport interface TabsContextValue {\n id: string;\n value: string | null;\n orientation: 'horizontal' | 'vertical' | undefined;\n loop: boolean | undefined;\n activateTabWithKeyboard: boolean | undefined;\n allowTabDeactivation: boolean | undefined;\n onChange: (value: string | null) => void;\n getTabId: (value: string) => string;\n getPanelId: (value: string) => string;\n variant: string | undefined;\n color: string | undefined;\n radius: string | number | undefined;\n inverted: boolean | undefined;\n keepMounted: boolean | undefined;\n keepMountedMode: 'activity' | 'display-none' | undefined;\n placement: 'right' | 'left' | undefined;\n unstyled: boolean | undefined;\n getStyles: GetStylesApi<TabsFactory>;\n}\n\nexport const [TabsProvider, useTabsContext] = createSafeContext<TabsContextValue>(\n 'Tabs component was not found in the tree'\n);\n"],"mappings":";;;AAwBA,MAAa,CAAC,cAAc,kBAAkB,kBAC5C,0CACF"}
1
+ {"version":3,"file":"Tabs.context.mjs","names":[],"sources":["../../../src/components/Tabs/Tabs.context.ts"],"sourcesContent":["import { createSafeContext, GetStylesApi } from '../../core';\nimport type { TabsFactory } from './Tabs';\n\nexport interface TabsContextValue {\n id: string;\n value: string | null;\n orientation: 'horizontal' | 'vertical' | undefined;\n loop: boolean | undefined;\n activateTabWithKeyboard: boolean | undefined;\n allowTabDeactivation: boolean | undefined;\n onChange: (value: string | null) => void;\n getTabId: (value: string) => string;\n getPanelId: (value: string) => string;\n variant: string | undefined;\n color: string | undefined;\n radius: string | number | undefined;\n inverted: boolean | undefined;\n keepMounted: boolean | undefined;\n keepMountedMode: 'activity' | 'display-none' | undefined;\n placement: 'right' | 'left' | undefined;\n unstyled: boolean | undefined;\n getStyles: GetStylesApi<TabsFactory>;\n mountedPanels: React.RefObject<Set<string>>;\n setMountedPanel: (value: string, mounted: boolean) => void;\n}\n\nexport const [TabsProvider, useTabsContext] = createSafeContext<TabsContextValue>(\n 'Tabs component was not found in the tree'\n);\n"],"mappings":";;;AA0BA,MAAa,CAAC,cAAc,kBAAkB,kBAC5C,0CACF"}
@@ -14,7 +14,8 @@ import Tabs_module_default from "./Tabs.module.mjs";
14
14
  import { TabsList } from "./TabsList/TabsList.mjs";
15
15
  import { TabsPanel } from "./TabsPanel/TabsPanel.mjs";
16
16
  import { TabsTab } from "./TabsTab/TabsTab.mjs";
17
- import { useId, useUncontrolled } from "@mantine/hooks";
17
+ import { useCallback, useRef } from "react";
18
+ import { useForceUpdate, useId as useId$1, useUncontrolled } from "@mantine/hooks";
18
19
  import { jsx } from "react/jsx-runtime";
19
20
  //#region packages/@mantine/core/src/components/Tabs/Tabs.tsx
20
21
  const VALUE_ERROR = "Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value";
@@ -39,7 +40,19 @@ const varsResolver = createVarsResolver((theme, { radius, color, autoContrast })
39
40
  const Tabs = factory((_props) => {
40
41
  const props = useProps("Tabs", defaultProps, _props);
41
42
  const { defaultValue, value, onChange, orientation, children, loop, id, activateTabWithKeyboard, allowTabDeactivation, variant, color, radius, inverted, placement, keepMounted, keepMountedMode, classNames, styles, unstyled, className, style, vars, autoContrast, mod, attributes, ...others } = props;
42
- const uid = useId(id);
43
+ const uid = useId$1(id);
44
+ const mountedPanels = useRef(/* @__PURE__ */ new Set());
45
+ const forceUpdate = useForceUpdate();
46
+ const setMountedPanel = useCallback((panelValue, mounted) => {
47
+ const panels = mountedPanels.current;
48
+ if (mounted && !panels.has(panelValue)) {
49
+ panels.add(panelValue);
50
+ forceUpdate();
51
+ } else if (!mounted && panels.has(panelValue)) {
52
+ panels.delete(panelValue);
53
+ forceUpdate();
54
+ }
55
+ }, []);
43
56
  const [currentTab, setCurrentTab] = useUncontrolled({
44
57
  value,
45
58
  defaultValue,
@@ -78,7 +91,9 @@ const Tabs = factory((_props) => {
78
91
  keepMounted,
79
92
  keepMountedMode,
80
93
  unstyled,
81
- getStyles
94
+ getStyles,
95
+ mountedPanels,
96
+ setMountedPanel
82
97
  },
83
98
  children: /* @__PURE__ */ jsx(Box, {
84
99
  id: uid,