@mantine/core 9.0.0 → 9.0.2

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 (474) hide show
  1. package/cjs/components/Accordion/Accordion.cjs.map +1 -1
  2. package/cjs/components/Accordion/Accordion.module.cjs.map +1 -1
  3. package/cjs/components/ActionIcon/ActionIcon.cjs.map +1 -1
  4. package/cjs/components/Affix/Affix.cjs.map +1 -1
  5. package/cjs/components/Alert/Alert.cjs.map +1 -1
  6. package/cjs/components/Anchor/Anchor.cjs.map +1 -1
  7. package/cjs/components/AngleSlider/AngleSlider.cjs.map +1 -1
  8. package/cjs/components/AppShell/AppShell.cjs.map +1 -1
  9. package/cjs/components/AspectRatio/AspectRatio.cjs.map +1 -1
  10. package/cjs/components/Autocomplete/Autocomplete.cjs +1 -1
  11. package/cjs/components/Autocomplete/Autocomplete.cjs.map +1 -1
  12. package/cjs/components/Avatar/Avatar.cjs.map +1 -1
  13. package/cjs/components/BackgroundImage/BackgroundImage.cjs.map +1 -1
  14. package/cjs/components/Badge/Badge.cjs.map +1 -1
  15. package/cjs/components/Badge/Badge.module.cjs.map +1 -1
  16. package/cjs/components/Blockquote/Blockquote.cjs.map +1 -1
  17. package/cjs/components/Breadcrumbs/Breadcrumbs.cjs.map +1 -1
  18. package/cjs/components/Burger/Burger.cjs.map +1 -1
  19. package/cjs/components/Button/Button.cjs.map +1 -1
  20. package/cjs/components/Card/Card.cjs.map +1 -1
  21. package/cjs/components/Center/Center.cjs.map +1 -1
  22. package/cjs/components/Checkbox/Checkbox.cjs.map +1 -1
  23. package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.cjs.map +1 -1
  24. package/cjs/components/Chip/Chip.cjs.map +1 -1
  25. package/cjs/components/Chip/ChipGroup/ChipGroup.cjs.map +1 -1
  26. package/cjs/components/CloseButton/CloseButton.cjs.map +1 -1
  27. package/cjs/components/Code/Code.cjs.map +1 -1
  28. package/cjs/components/Collapse/Collapse.cjs.map +1 -1
  29. package/cjs/components/ColorInput/ColorInput.cjs.map +1 -1
  30. package/cjs/components/ColorPicker/AlphaSlider/AlphaSlider.cjs.map +1 -1
  31. package/cjs/components/ColorPicker/ColorPicker.cjs.map +1 -1
  32. package/cjs/components/ColorPicker/HueSlider/HueSlider.cjs.map +1 -1
  33. package/cjs/components/ColorSwatch/ColorSwatch.cjs.map +1 -1
  34. package/cjs/components/Combobox/ComboboxTarget/ComboboxTarget.cjs +1 -0
  35. package/cjs/components/Combobox/ComboboxTarget/ComboboxTarget.cjs.map +1 -1
  36. package/cjs/components/Combobox/use-combobox-target-props/use-combobox-target-props.cjs.map +1 -1
  37. package/cjs/components/Container/Container.cjs.map +1 -1
  38. package/cjs/components/Dialog/Dialog.cjs.map +1 -1
  39. package/cjs/components/Divider/Divider.cjs.map +1 -1
  40. package/cjs/components/Fieldset/Fieldset.cjs.map +1 -1
  41. package/cjs/components/FileButton/FileButton.cjs.map +1 -1
  42. package/cjs/components/FileInput/FileInput.cjs.map +1 -1
  43. package/cjs/components/Flex/Flex.cjs.map +1 -1
  44. package/cjs/components/FloatingIndicator/FloatingIndicator.cjs.map +1 -1
  45. package/cjs/components/FloatingWindow/FloatingWindow.cjs.map +1 -1
  46. package/cjs/components/Grid/Grid.cjs.map +1 -1
  47. package/cjs/components/Group/Group.cjs.map +1 -1
  48. package/cjs/components/Highlight/Highlight.cjs.map +1 -1
  49. package/cjs/components/Image/Image.cjs.map +1 -1
  50. package/cjs/components/Indicator/Indicator.cjs.map +1 -1
  51. package/cjs/components/Input/Input.cjs +3 -2
  52. package/cjs/components/Input/Input.cjs.map +1 -1
  53. package/cjs/components/InputBase/InputBase.cjs.map +1 -1
  54. package/cjs/components/JsonInput/JsonInput.cjs.map +1 -1
  55. package/cjs/components/Kbd/Kbd.cjs.map +1 -1
  56. package/cjs/components/List/List.cjs.map +1 -1
  57. package/cjs/components/Loader/Loader.cjs.map +1 -1
  58. package/cjs/components/LoadingOverlay/LoadingOverlay.cjs +1 -0
  59. package/cjs/components/LoadingOverlay/LoadingOverlay.cjs.map +1 -1
  60. package/cjs/components/Mark/Mark.cjs.map +1 -1
  61. package/cjs/components/Marquee/Marquee.cjs.map +1 -1
  62. package/cjs/components/Menu/Menu.cjs.map +1 -1
  63. package/cjs/components/Modal/Modal.cjs.map +1 -1
  64. package/cjs/components/MultiSelect/MultiSelect.cjs +3 -1
  65. package/cjs/components/MultiSelect/MultiSelect.cjs.map +1 -1
  66. package/cjs/components/NativeSelect/NativeSelect.cjs +4 -1
  67. package/cjs/components/NativeSelect/NativeSelect.cjs.map +1 -1
  68. package/cjs/components/NavLink/NavLink.cjs.map +1 -1
  69. package/cjs/components/Notification/Notification.cjs.map +1 -1
  70. package/cjs/components/NumberInput/NumberInput.cjs +1 -0
  71. package/cjs/components/NumberInput/NumberInput.cjs.map +1 -1
  72. package/cjs/components/OverflowList/OverflowList.cjs.map +1 -1
  73. package/cjs/components/Overlay/Overlay.cjs.map +1 -1
  74. package/cjs/components/Pagination/Pagination.cjs.map +1 -1
  75. package/cjs/components/Paper/Paper.cjs.map +1 -1
  76. package/cjs/components/PasswordInput/PasswordInput.cjs +4 -1
  77. package/cjs/components/PasswordInput/PasswordInput.cjs.map +1 -1
  78. package/cjs/components/Pill/Pill.cjs.map +1 -1
  79. package/cjs/components/PillsInput/PillsInput.cjs.map +1 -1
  80. package/cjs/components/PinInput/PinInput.cjs.map +1 -1
  81. package/cjs/components/Popover/Popover.cjs +9 -0
  82. package/cjs/components/Popover/Popover.cjs.map +1 -1
  83. package/cjs/components/Portal/OptionalPortal.cjs.map +1 -1
  84. package/cjs/components/Portal/Portal.cjs.map +1 -1
  85. package/cjs/components/Progress/Progress.cjs.map +1 -1
  86. package/cjs/components/Radio/Radio.cjs.map +1 -1
  87. package/cjs/components/Radio/RadioGroup/RadioGroup.cjs.map +1 -1
  88. package/cjs/components/Rating/Rating.cjs.map +1 -1
  89. package/cjs/components/RingProgress/RingProgress.cjs +1 -0
  90. package/cjs/components/RingProgress/RingProgress.cjs.map +1 -1
  91. package/cjs/components/ScrollArea/ScrollArea.cjs.map +1 -1
  92. package/cjs/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.cjs.map +1 -1
  93. package/cjs/components/Scroller/Scroller.cjs.map +1 -1
  94. package/cjs/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
  95. package/cjs/components/Select/Select.cjs +1 -0
  96. package/cjs/components/Select/Select.cjs.map +1 -1
  97. package/cjs/components/SemiCircleProgress/SemiCircleProgress.cjs +1 -2
  98. package/cjs/components/SemiCircleProgress/SemiCircleProgress.cjs.map +1 -1
  99. package/cjs/components/SimpleGrid/SimpleGrid.cjs.map +1 -1
  100. package/cjs/components/Skeleton/Skeleton.cjs.map +1 -1
  101. package/cjs/components/Slider/RangeSlider/RangeSlider.cjs.map +1 -1
  102. package/cjs/components/Slider/Slider/Slider.cjs.map +1 -1
  103. package/cjs/components/Slider/Slider.module.cjs.map +1 -1
  104. package/cjs/components/Space/Space.cjs.map +1 -1
  105. package/cjs/components/Spoiler/Spoiler.cjs.map +1 -1
  106. package/cjs/components/Stack/Stack.cjs.map +1 -1
  107. package/cjs/components/Stepper/Stepper.cjs.map +1 -1
  108. package/cjs/components/Switch/Switch.cjs.map +1 -1
  109. package/cjs/components/Switch/SwitchGroup/SwitchGroup.cjs.map +1 -1
  110. package/cjs/components/Table/Table.cjs.map +1 -1
  111. package/cjs/components/TableOfContents/TableOfContents.cjs.map +1 -1
  112. package/cjs/components/Tabs/Tabs.cjs.map +1 -1
  113. package/cjs/components/TagsInput/TagsInput.cjs +3 -1
  114. package/cjs/components/TagsInput/TagsInput.cjs.map +1 -1
  115. package/cjs/components/Text/Text.cjs.map +1 -1
  116. package/cjs/components/TextInput/TextInput.cjs.map +1 -1
  117. package/cjs/components/Textarea/Autosize.cjs +1 -0
  118. package/cjs/components/Textarea/Autosize.cjs.map +1 -1
  119. package/cjs/components/Textarea/Textarea.cjs.map +1 -1
  120. package/cjs/components/ThemeIcon/ThemeIcon.cjs.map +1 -1
  121. package/cjs/components/Timeline/Timeline.cjs.map +1 -1
  122. package/cjs/components/Title/Title.cjs.map +1 -1
  123. package/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
  124. package/cjs/components/Tree/Tree.cjs.map +1 -1
  125. package/cjs/components/Typography/Typography.cjs.map +1 -1
  126. package/cjs/components/UnstyledButton/UnstyledButton.cjs.map +1 -1
  127. package/cjs/components/VisuallyHidden/VisuallyHidden.cjs.map +1 -1
  128. package/cjs/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.cjs +3 -4
  129. package/cjs/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.cjs.map +1 -1
  130. package/cjs/core/MantineProvider/color-scheme-managers/local-storage-manager.cjs.map +1 -1
  131. package/cjs/core/utils/find-element-ancestor/find-element-ancestor.cjs.map +1 -1
  132. package/esm/components/Accordion/Accordion.mjs.map +1 -1
  133. package/esm/components/Accordion/Accordion.module.mjs.map +1 -1
  134. package/esm/components/ActionIcon/ActionIcon.mjs.map +1 -1
  135. package/esm/components/Affix/Affix.mjs.map +1 -1
  136. package/esm/components/Alert/Alert.mjs.map +1 -1
  137. package/esm/components/Anchor/Anchor.mjs.map +1 -1
  138. package/esm/components/AngleSlider/AngleSlider.mjs.map +1 -1
  139. package/esm/components/AppShell/AppShell.mjs.map +1 -1
  140. package/esm/components/AspectRatio/AspectRatio.mjs.map +1 -1
  141. package/esm/components/Autocomplete/Autocomplete.mjs +1 -1
  142. package/esm/components/Autocomplete/Autocomplete.mjs.map +1 -1
  143. package/esm/components/Avatar/Avatar.mjs.map +1 -1
  144. package/esm/components/BackgroundImage/BackgroundImage.mjs.map +1 -1
  145. package/esm/components/Badge/Badge.mjs.map +1 -1
  146. package/esm/components/Badge/Badge.module.mjs.map +1 -1
  147. package/esm/components/Blockquote/Blockquote.mjs.map +1 -1
  148. package/esm/components/Breadcrumbs/Breadcrumbs.mjs.map +1 -1
  149. package/esm/components/Burger/Burger.mjs.map +1 -1
  150. package/esm/components/Button/Button.mjs.map +1 -1
  151. package/esm/components/Card/Card.mjs.map +1 -1
  152. package/esm/components/Center/Center.mjs.map +1 -1
  153. package/esm/components/Checkbox/Checkbox.mjs.map +1 -1
  154. package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.mjs.map +1 -1
  155. package/esm/components/Chip/Chip.mjs.map +1 -1
  156. package/esm/components/Chip/ChipGroup/ChipGroup.mjs.map +1 -1
  157. package/esm/components/CloseButton/CloseButton.mjs.map +1 -1
  158. package/esm/components/Code/Code.mjs.map +1 -1
  159. package/esm/components/Collapse/Collapse.mjs.map +1 -1
  160. package/esm/components/ColorInput/ColorInput.mjs.map +1 -1
  161. package/esm/components/ColorPicker/AlphaSlider/AlphaSlider.mjs.map +1 -1
  162. package/esm/components/ColorPicker/ColorPicker.mjs.map +1 -1
  163. package/esm/components/ColorPicker/HueSlider/HueSlider.mjs.map +1 -1
  164. package/esm/components/ColorSwatch/ColorSwatch.mjs.map +1 -1
  165. package/esm/components/Combobox/ComboboxTarget/ComboboxTarget.mjs +1 -0
  166. package/esm/components/Combobox/ComboboxTarget/ComboboxTarget.mjs.map +1 -1
  167. package/esm/components/Combobox/use-combobox-target-props/use-combobox-target-props.mjs.map +1 -1
  168. package/esm/components/Container/Container.mjs.map +1 -1
  169. package/esm/components/Dialog/Dialog.mjs.map +1 -1
  170. package/esm/components/Divider/Divider.mjs.map +1 -1
  171. package/esm/components/Fieldset/Fieldset.mjs.map +1 -1
  172. package/esm/components/FileButton/FileButton.mjs.map +1 -1
  173. package/esm/components/FileInput/FileInput.mjs.map +1 -1
  174. package/esm/components/Flex/Flex.mjs.map +1 -1
  175. package/esm/components/FloatingIndicator/FloatingIndicator.mjs.map +1 -1
  176. package/esm/components/FloatingWindow/FloatingWindow.mjs.map +1 -1
  177. package/esm/components/Grid/Grid.mjs.map +1 -1
  178. package/esm/components/Group/Group.mjs.map +1 -1
  179. package/esm/components/Highlight/Highlight.mjs.map +1 -1
  180. package/esm/components/Image/Image.mjs.map +1 -1
  181. package/esm/components/Indicator/Indicator.mjs.map +1 -1
  182. package/esm/components/Input/Input.mjs +3 -2
  183. package/esm/components/Input/Input.mjs.map +1 -1
  184. package/esm/components/InputBase/InputBase.mjs.map +1 -1
  185. package/esm/components/JsonInput/JsonInput.mjs.map +1 -1
  186. package/esm/components/Kbd/Kbd.mjs.map +1 -1
  187. package/esm/components/List/List.mjs.map +1 -1
  188. package/esm/components/Loader/Loader.mjs.map +1 -1
  189. package/esm/components/LoadingOverlay/LoadingOverlay.mjs +1 -0
  190. package/esm/components/LoadingOverlay/LoadingOverlay.mjs.map +1 -1
  191. package/esm/components/Mark/Mark.mjs.map +1 -1
  192. package/esm/components/Marquee/Marquee.mjs.map +1 -1
  193. package/esm/components/Menu/Menu.mjs.map +1 -1
  194. package/esm/components/Modal/Modal.mjs.map +1 -1
  195. package/esm/components/MultiSelect/MultiSelect.mjs +3 -1
  196. package/esm/components/MultiSelect/MultiSelect.mjs.map +1 -1
  197. package/esm/components/NativeSelect/NativeSelect.mjs +4 -1
  198. package/esm/components/NativeSelect/NativeSelect.mjs.map +1 -1
  199. package/esm/components/NavLink/NavLink.mjs.map +1 -1
  200. package/esm/components/Notification/Notification.mjs.map +1 -1
  201. package/esm/components/NumberInput/NumberInput.mjs +1 -0
  202. package/esm/components/NumberInput/NumberInput.mjs.map +1 -1
  203. package/esm/components/OverflowList/OverflowList.mjs.map +1 -1
  204. package/esm/components/Overlay/Overlay.mjs.map +1 -1
  205. package/esm/components/Pagination/Pagination.mjs.map +1 -1
  206. package/esm/components/Paper/Paper.mjs.map +1 -1
  207. package/esm/components/PasswordInput/PasswordInput.mjs +4 -1
  208. package/esm/components/PasswordInput/PasswordInput.mjs.map +1 -1
  209. package/esm/components/Pill/Pill.mjs.map +1 -1
  210. package/esm/components/PillsInput/PillsInput.mjs.map +1 -1
  211. package/esm/components/PinInput/PinInput.mjs.map +1 -1
  212. package/esm/components/Popover/Popover.mjs +9 -0
  213. package/esm/components/Popover/Popover.mjs.map +1 -1
  214. package/esm/components/Portal/OptionalPortal.mjs.map +1 -1
  215. package/esm/components/Portal/Portal.mjs.map +1 -1
  216. package/esm/components/Progress/Progress.mjs.map +1 -1
  217. package/esm/components/Radio/Radio.mjs.map +1 -1
  218. package/esm/components/Radio/RadioGroup/RadioGroup.mjs.map +1 -1
  219. package/esm/components/Rating/Rating.mjs.map +1 -1
  220. package/esm/components/RingProgress/RingProgress.mjs +1 -0
  221. package/esm/components/RingProgress/RingProgress.mjs.map +1 -1
  222. package/esm/components/ScrollArea/ScrollArea.mjs.map +1 -1
  223. package/esm/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.mjs.map +1 -1
  224. package/esm/components/Scroller/Scroller.mjs.map +1 -1
  225. package/esm/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  226. package/esm/components/Select/Select.mjs +1 -0
  227. package/esm/components/Select/Select.mjs.map +1 -1
  228. package/esm/components/SemiCircleProgress/SemiCircleProgress.mjs +1 -2
  229. package/esm/components/SemiCircleProgress/SemiCircleProgress.mjs.map +1 -1
  230. package/esm/components/SimpleGrid/SimpleGrid.mjs.map +1 -1
  231. package/esm/components/Skeleton/Skeleton.mjs.map +1 -1
  232. package/esm/components/Slider/RangeSlider/RangeSlider.mjs.map +1 -1
  233. package/esm/components/Slider/Slider/Slider.mjs.map +1 -1
  234. package/esm/components/Slider/Slider.module.mjs.map +1 -1
  235. package/esm/components/Space/Space.mjs.map +1 -1
  236. package/esm/components/Spoiler/Spoiler.mjs.map +1 -1
  237. package/esm/components/Stack/Stack.mjs.map +1 -1
  238. package/esm/components/Stepper/Stepper.mjs.map +1 -1
  239. package/esm/components/Switch/Switch.mjs.map +1 -1
  240. package/esm/components/Switch/SwitchGroup/SwitchGroup.mjs.map +1 -1
  241. package/esm/components/Table/Table.mjs.map +1 -1
  242. package/esm/components/TableOfContents/TableOfContents.mjs.map +1 -1
  243. package/esm/components/Tabs/Tabs.mjs.map +1 -1
  244. package/esm/components/TagsInput/TagsInput.mjs +3 -1
  245. package/esm/components/TagsInput/TagsInput.mjs.map +1 -1
  246. package/esm/components/Text/Text.mjs.map +1 -1
  247. package/esm/components/TextInput/TextInput.mjs.map +1 -1
  248. package/esm/components/Textarea/Autosize.mjs +1 -0
  249. package/esm/components/Textarea/Autosize.mjs.map +1 -1
  250. package/esm/components/Textarea/Textarea.mjs.map +1 -1
  251. package/esm/components/ThemeIcon/ThemeIcon.mjs.map +1 -1
  252. package/esm/components/Timeline/Timeline.mjs.map +1 -1
  253. package/esm/components/Title/Title.mjs.map +1 -1
  254. package/esm/components/Tooltip/Tooltip.mjs.map +1 -1
  255. package/esm/components/Tree/Tree.mjs.map +1 -1
  256. package/esm/components/Typography/Typography.mjs.map +1 -1
  257. package/esm/components/UnstyledButton/UnstyledButton.mjs.map +1 -1
  258. package/esm/components/VisuallyHidden/VisuallyHidden.mjs.map +1 -1
  259. package/esm/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.mjs +3 -4
  260. package/esm/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.mjs.map +1 -1
  261. package/esm/core/MantineProvider/color-scheme-managers/local-storage-manager.mjs.map +1 -1
  262. package/esm/core/utils/find-element-ancestor/find-element-ancestor.mjs.map +1 -1
  263. package/lib/components/Accordion/Accordion.d.ts +21 -3
  264. package/lib/components/Accordion/index.d.ts +0 -17
  265. package/lib/components/ActionIcon/ActionIcon.d.ts +20 -2
  266. package/lib/components/ActionIcon/index.d.ts +0 -18
  267. package/lib/components/Affix/Affix.d.ts +6 -0
  268. package/lib/components/Affix/index.d.ts +0 -6
  269. package/lib/components/Alert/Alert.d.ts +6 -0
  270. package/lib/components/Alert/index.d.ts +0 -6
  271. package/lib/components/Anchor/Anchor.d.ts +7 -0
  272. package/lib/components/Anchor/index.d.ts +0 -8
  273. package/lib/components/AngleSlider/AngleSlider.d.ts +6 -0
  274. package/lib/components/AngleSlider/index.d.ts +0 -6
  275. package/lib/components/AppShell/AppShell.d.ts +30 -6
  276. package/lib/components/AppShell/index.d.ts +0 -24
  277. package/lib/components/AspectRatio/AspectRatio.d.ts +6 -0
  278. package/lib/components/AspectRatio/index.d.ts +0 -6
  279. package/lib/components/Autocomplete/Autocomplete.d.ts +6 -0
  280. package/lib/components/Autocomplete/index.d.ts +0 -6
  281. package/lib/components/Avatar/Avatar.d.ts +15 -1
  282. package/lib/components/Avatar/index.d.ts +0 -14
  283. package/lib/components/BackgroundImage/BackgroundImage.d.ts +6 -0
  284. package/lib/components/BackgroundImage/index.d.ts +0 -6
  285. package/lib/components/Badge/Badge.d.ts +7 -0
  286. package/lib/components/Badge/index.d.ts +0 -7
  287. package/lib/components/Blockquote/Blockquote.d.ts +6 -0
  288. package/lib/components/Blockquote/index.d.ts +0 -6
  289. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +6 -0
  290. package/lib/components/Breadcrumbs/index.d.ts +0 -7
  291. package/lib/components/Burger/Burger.d.ts +6 -0
  292. package/lib/components/Burger/index.d.ts +0 -6
  293. package/lib/components/Button/Button.d.ts +22 -2
  294. package/lib/components/Button/index.d.ts +0 -20
  295. package/lib/components/Card/Card.d.ts +11 -1
  296. package/lib/components/Card/index.d.ts +0 -10
  297. package/lib/components/Center/Center.d.ts +5 -0
  298. package/lib/components/Center/index.d.ts +0 -5
  299. package/lib/components/Checkbox/Checkbox.d.ts +29 -3
  300. package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +8 -8
  301. package/lib/components/Checkbox/index.d.ts +0 -26
  302. package/lib/components/Chip/Chip.d.ts +12 -1
  303. package/lib/components/Chip/ChipGroup/ChipGroup.d.ts +8 -8
  304. package/lib/components/Chip/index.d.ts +0 -11
  305. package/lib/components/CloseButton/CloseButton.d.ts +7 -0
  306. package/lib/components/CloseButton/index.d.ts +0 -7
  307. package/lib/components/Code/Code.d.ts +6 -0
  308. package/lib/components/Code/index.d.ts +0 -6
  309. package/lib/components/Collapse/Collapse.d.ts +4 -0
  310. package/lib/components/Collapse/index.d.ts +0 -4
  311. package/lib/components/ColorInput/ColorInput.d.ts +6 -0
  312. package/lib/components/ColorInput/index.d.ts +0 -6
  313. package/lib/components/ColorPicker/AlphaSlider/AlphaSlider.d.ts +4 -0
  314. package/lib/components/ColorPicker/ColorPicker.d.ts +6 -0
  315. package/lib/components/ColorPicker/HueSlider/HueSlider.d.ts +4 -0
  316. package/lib/components/ColorPicker/index.d.ts +0 -14
  317. package/lib/components/ColorSwatch/ColorSwatch.d.ts +6 -0
  318. package/lib/components/ColorSwatch/index.d.ts +0 -6
  319. package/lib/components/Container/Container.d.ts +6 -0
  320. package/lib/components/Container/index.d.ts +0 -6
  321. package/lib/components/Dialog/Dialog.d.ts +6 -0
  322. package/lib/components/Dialog/index.d.ts +0 -6
  323. package/lib/components/Divider/Divider.d.ts +7 -0
  324. package/lib/components/Divider/index.d.ts +0 -7
  325. package/lib/components/Fieldset/Fieldset.d.ts +6 -0
  326. package/lib/components/Fieldset/index.d.ts +0 -6
  327. package/lib/components/FileButton/FileButton.d.ts +4 -0
  328. package/lib/components/FileButton/index.d.ts +0 -4
  329. package/lib/components/FileInput/FileInput.d.ts +4 -0
  330. package/lib/components/FileInput/index.d.ts +0 -4
  331. package/lib/components/Flex/Flex.d.ts +5 -0
  332. package/lib/components/Flex/index.d.ts +0 -5
  333. package/lib/components/FloatingIndicator/FloatingIndicator.d.ts +6 -0
  334. package/lib/components/FloatingIndicator/index.d.ts +0 -6
  335. package/lib/components/FloatingWindow/FloatingWindow.d.ts +5 -0
  336. package/lib/components/FloatingWindow/index.d.ts +0 -5
  337. package/lib/components/Grid/Grid.d.ts +13 -2
  338. package/lib/components/Grid/index.d.ts +0 -11
  339. package/lib/components/Group/Group.d.ts +7 -0
  340. package/lib/components/Group/index.d.ts +0 -7
  341. package/lib/components/Highlight/Highlight.d.ts +5 -0
  342. package/lib/components/Highlight/index.d.ts +0 -5
  343. package/lib/components/Image/Image.d.ts +6 -0
  344. package/lib/components/Image/index.d.ts +0 -6
  345. package/lib/components/Indicator/Indicator.d.ts +6 -0
  346. package/lib/components/Indicator/index.d.ts +0 -6
  347. package/lib/components/Input/Input.d.ts +51 -7
  348. package/lib/components/Input/index.d.ts +0 -42
  349. package/lib/components/InputBase/InputBase.d.ts +4 -0
  350. package/lib/components/InputBase/index.d.ts +0 -4
  351. package/lib/components/JsonInput/JsonInput.d.ts +4 -0
  352. package/lib/components/JsonInput/index.d.ts +0 -4
  353. package/lib/components/Kbd/Kbd.d.ts +6 -0
  354. package/lib/components/Kbd/index.d.ts +0 -6
  355. package/lib/components/List/List.d.ts +12 -1
  356. package/lib/components/List/index.d.ts +0 -11
  357. package/lib/components/Loader/Loader.d.ts +6 -0
  358. package/lib/components/Loader/index.d.ts +0 -6
  359. package/lib/components/LoadingOverlay/LoadingOverlay.d.ts +6 -0
  360. package/lib/components/LoadingOverlay/index.d.ts +0 -6
  361. package/lib/components/Mark/Mark.d.ts +6 -0
  362. package/lib/components/Mark/index.d.ts +0 -6
  363. package/lib/components/Marquee/Marquee.d.ts +6 -0
  364. package/lib/components/Marquee/index.d.ts +0 -6
  365. package/lib/components/Menu/Menu.d.ts +43 -6
  366. package/lib/components/Menu/index.d.ts +0 -33
  367. package/lib/components/Modal/Modal.d.ts +37 -7
  368. package/lib/components/Modal/index.d.ts +0 -30
  369. package/lib/components/MultiSelect/MultiSelect.d.ts +5 -0
  370. package/lib/components/MultiSelect/index.d.ts +0 -6
  371. package/lib/components/NativeSelect/NativeSelect.d.ts +5 -0
  372. package/lib/components/NativeSelect/index.d.ts +0 -6
  373. package/lib/components/NavLink/NavLink.d.ts +7 -0
  374. package/lib/components/NavLink/index.d.ts +0 -7
  375. package/lib/components/Notification/Notification.d.ts +6 -0
  376. package/lib/components/Notification/index.d.ts +0 -6
  377. package/lib/components/NumberInput/NumberInput.d.ts +7 -0
  378. package/lib/components/NumberInput/index.d.ts +0 -7
  379. package/lib/components/OverflowList/OverflowList.d.ts +6 -0
  380. package/lib/components/OverflowList/index.d.ts +0 -6
  381. package/lib/components/Overlay/Overlay.d.ts +6 -0
  382. package/lib/components/Overlay/index.d.ts +0 -6
  383. package/lib/components/Pagination/Pagination.d.ts +25 -4
  384. package/lib/components/Pagination/index.d.ts +0 -21
  385. package/lib/components/Paper/Paper.d.ts +7 -0
  386. package/lib/components/Paper/index.d.ts +0 -7
  387. package/lib/components/PasswordInput/PasswordInput.d.ts +6 -0
  388. package/lib/components/PasswordInput/index.d.ts +0 -6
  389. package/lib/components/Pill/Pill.d.ts +14 -1
  390. package/lib/components/Pill/index.d.ts +0 -13
  391. package/lib/components/PillsInput/PillsInput.d.ts +12 -1
  392. package/lib/components/PillsInput/index.d.ts +0 -10
  393. package/lib/components/PinInput/PinInput.d.ts +5 -0
  394. package/lib/components/PinInput/index.d.ts +0 -5
  395. package/lib/components/Popover/Popover.d.ts +9 -0
  396. package/lib/components/Portal/OptionalPortal.d.ts +3 -0
  397. package/lib/components/Portal/Portal.d.ts +3 -0
  398. package/lib/components/Portal/index.d.ts +0 -6
  399. package/lib/components/Progress/Progress.d.ts +19 -3
  400. package/lib/components/Progress/index.d.ts +0 -15
  401. package/lib/components/Radio/Radio.d.ts +29 -3
  402. package/lib/components/Radio/RadioGroup/RadioGroup.d.ts +8 -8
  403. package/lib/components/Radio/index.d.ts +0 -26
  404. package/lib/components/Rating/Rating.d.ts +5 -0
  405. package/lib/components/Rating/index.d.ts +0 -5
  406. package/lib/components/RingProgress/RingProgress.d.ts +7 -0
  407. package/lib/components/RingProgress/index.d.ts +0 -7
  408. package/lib/components/ScrollArea/ScrollArea.d.ts +10 -0
  409. package/lib/components/ScrollArea/index.d.ts +0 -10
  410. package/lib/components/Scroller/Scroller.d.ts +6 -0
  411. package/lib/components/Scroller/index.d.ts +0 -6
  412. package/lib/components/SegmentedControl/SegmentedControl.d.ts +7 -0
  413. package/lib/components/SegmentedControl/index.d.ts +0 -8
  414. package/lib/components/Select/Select.d.ts +5 -0
  415. package/lib/components/Select/index.d.ts +0 -6
  416. package/lib/components/SemiCircleProgress/SemiCircleProgress.d.ts +6 -0
  417. package/lib/components/SemiCircleProgress/index.d.ts +0 -6
  418. package/lib/components/SimpleGrid/SimpleGrid.d.ts +5 -0
  419. package/lib/components/SimpleGrid/index.d.ts +0 -5
  420. package/lib/components/Skeleton/Skeleton.d.ts +6 -0
  421. package/lib/components/Skeleton/index.d.ts +0 -6
  422. package/lib/components/Slider/RangeSlider/RangeSlider.d.ts +8 -0
  423. package/lib/components/Slider/Slider/Slider.d.ts +7 -0
  424. package/lib/components/Slider/index.d.ts +0 -15
  425. package/lib/components/Space/Space.d.ts +4 -0
  426. package/lib/components/Space/index.d.ts +0 -5
  427. package/lib/components/Spoiler/Spoiler.d.ts +6 -0
  428. package/lib/components/Spoiler/index.d.ts +0 -6
  429. package/lib/components/Stack/Stack.d.ts +6 -0
  430. package/lib/components/Stack/index.d.ts +0 -6
  431. package/lib/components/Stepper/Stepper.d.ts +17 -2
  432. package/lib/components/Stepper/index.d.ts +0 -14
  433. package/lib/components/Switch/Switch.d.ts +13 -1
  434. package/lib/components/Switch/SwitchGroup/SwitchGroup.d.ts +8 -8
  435. package/lib/components/Switch/index.d.ts +0 -12
  436. package/lib/components/Table/Table.d.ts +35 -2
  437. package/lib/components/Table/index.d.ts +0 -32
  438. package/lib/components/TableOfContents/TableOfContents.d.ts +7 -0
  439. package/lib/components/TableOfContents/index.d.ts +0 -7
  440. package/lib/components/Tabs/Tabs.d.ts +24 -3
  441. package/lib/components/Tabs/index.d.ts +0 -20
  442. package/lib/components/TagsInput/TagsInput.d.ts +5 -0
  443. package/lib/components/TagsInput/index.d.ts +0 -5
  444. package/lib/components/Text/Text.d.ts +7 -0
  445. package/lib/components/Text/index.d.ts +0 -7
  446. package/lib/components/TextInput/TextInput.d.ts +4 -0
  447. package/lib/components/TextInput/index.d.ts +0 -4
  448. package/lib/components/Textarea/Textarea.d.ts +4 -0
  449. package/lib/components/Textarea/index.d.ts +0 -4
  450. package/lib/components/ThemeIcon/ThemeIcon.d.ts +7 -0
  451. package/lib/components/ThemeIcon/index.d.ts +0 -7
  452. package/lib/components/Timeline/Timeline.d.ts +12 -1
  453. package/lib/components/Timeline/index.d.ts +0 -11
  454. package/lib/components/Title/Title.d.ts +8 -0
  455. package/lib/components/Title/index.d.ts +0 -8
  456. package/lib/components/Tooltip/Tooltip.d.ts +15 -2
  457. package/lib/components/Tooltip/index.d.ts +0 -13
  458. package/lib/components/Tree/Tree.d.ts +7 -0
  459. package/lib/components/Tree/index.d.ts +0 -7
  460. package/lib/components/Typography/Typography.d.ts +5 -0
  461. package/lib/components/Typography/index.d.ts +0 -5
  462. package/lib/components/UnstyledButton/UnstyledButton.d.ts +5 -0
  463. package/lib/components/UnstyledButton/index.d.ts +0 -5
  464. package/lib/components/VisuallyHidden/VisuallyHidden.d.ts +3 -0
  465. package/lib/components/VisuallyHidden/index.d.ts +0 -3
  466. package/package.json +2 -2
  467. package/styles/Accordion.css +0 -4
  468. package/styles/Accordion.layer.css +0 -4
  469. package/styles/Badge.css +0 -2
  470. package/styles/Badge.layer.css +0 -2
  471. package/styles/Slider.css +10 -10
  472. package/styles/Slider.layer.css +10 -10
  473. package/styles.css +10 -16
  474. package/styles.layer.css +10 -16
@@ -1 +1 @@
1
- {"version":3,"file":"use-combobox-target-props.cjs","names":["useComboboxContext"],"sources":["../../../../src/components/Combobox/use-combobox-target-props/use-combobox-target-props.ts"],"sourcesContent":["import { useState } from 'react';\nimport { useComboboxContext } from '../Combobox.context';\n\ninterface UseComboboxTargetPropsInput {\n targetType: 'input' | 'button' | undefined;\n withAriaAttributes: boolean | undefined;\n withKeyboardNavigation: boolean | undefined;\n withExpandedAttribute: boolean | undefined;\n onKeyDown: React.KeyboardEventHandler<HTMLInputElement> | undefined;\n autoComplete: string | undefined;\n}\n\nexport function useComboboxTargetProps({\n onKeyDown,\n withKeyboardNavigation,\n withAriaAttributes,\n withExpandedAttribute,\n targetType,\n autoComplete,\n}: UseComboboxTargetPropsInput) {\n const ctx = useComboboxContext();\n const [selectedOptionId, setSelectedOptionId] = useState<string | null>(null);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n\n if (ctx.readOnly) {\n return;\n }\n\n if (withKeyboardNavigation) {\n // Ignore during composition in IME\n if (event.nativeEvent.isComposing) {\n return;\n }\n\n if (event.nativeEvent.code === 'ArrowDown') {\n event.preventDefault();\n\n if (!ctx.store.dropdownOpened) {\n ctx.store.openDropdown('keyboard');\n setSelectedOptionId(ctx.store.selectActiveOption());\n ctx.store.updateSelectedOptionIndex('selected', { scrollIntoView: true });\n } else {\n setSelectedOptionId(ctx.store.selectNextOption());\n }\n }\n\n if (event.nativeEvent.code === 'ArrowUp') {\n event.preventDefault();\n\n if (!ctx.store.dropdownOpened) {\n ctx.store.openDropdown('keyboard');\n setSelectedOptionId(ctx.store.selectActiveOption());\n ctx.store.updateSelectedOptionIndex('selected', { scrollIntoView: true });\n } else {\n setSelectedOptionId(ctx.store.selectPreviousOption());\n }\n }\n\n if (event.nativeEvent.code === 'Enter' || event.nativeEvent.code === 'NumpadEnter') {\n // This is a workaround for handling differences in behavior of isComposing property in Safari\n // See: https://dninomiya.github.io/form-guide/stop-enter-submit\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (event.nativeEvent.keyCode === 229) {\n return;\n }\n\n const selectedOptionIndex = ctx.store.getSelectedOptionIndex();\n\n if (ctx.store.dropdownOpened && selectedOptionIndex !== -1) {\n event.preventDefault();\n ctx.store.clickSelectedOption();\n } else if (targetType === 'button') {\n event.preventDefault();\n ctx.store.openDropdown('keyboard');\n }\n }\n\n if (event.key === 'Escape') {\n ctx.store.closeDropdown('keyboard');\n }\n\n if (event.nativeEvent.code === 'Space') {\n if (targetType === 'button') {\n event.preventDefault();\n ctx.store.toggleDropdown('keyboard');\n }\n }\n }\n };\n\n const ariaAttributes = withAriaAttributes\n ? {\n ...(withExpandedAttribute ? { role: 'combobox' as const } : {}),\n 'aria-haspopup': 'listbox' as const,\n 'aria-expanded': withExpandedAttribute\n ? !!(ctx.store.listId && ctx.store.dropdownOpened)\n : undefined,\n 'aria-controls':\n ctx.store.dropdownOpened && ctx.store.listId ? ctx.store.listId : undefined,\n 'aria-activedescendant': ctx.store.dropdownOpened\n ? selectedOptionId || undefined\n : undefined,\n autoComplete,\n 'data-expanded': ctx.store.dropdownOpened || undefined,\n 'data-mantine-stop-propagation': ctx.store.dropdownOpened || undefined,\n }\n : {};\n\n return {\n ...ariaAttributes,\n onKeyDown: handleKeyDown,\n };\n}\n"],"mappings":";;;;;AAYA,SAAgB,uBAAuB,EACrC,WACA,wBACA,oBACA,uBACA,YACA,gBAC8B;CAC9B,MAAM,MAAMA,yBAAAA,oBAAoB;CAChC,MAAM,CAAC,kBAAkB,wBAAA,GAAA,MAAA,UAA+C,KAAK;CAE7E,MAAM,iBAAiB,UAAiD;AACtE,cAAY,MAAM;AAElB,MAAI,IAAI,SACN;AAGF,MAAI,wBAAwB;AAE1B,OAAI,MAAM,YAAY,YACpB;AAGF,OAAI,MAAM,YAAY,SAAS,aAAa;AAC1C,UAAM,gBAAgB;AAEtB,QAAI,CAAC,IAAI,MAAM,gBAAgB;AAC7B,SAAI,MAAM,aAAa,WAAW;AAClC,yBAAoB,IAAI,MAAM,oBAAoB,CAAC;AACnD,SAAI,MAAM,0BAA0B,YAAY,EAAE,gBAAgB,MAAM,CAAC;UAEzE,qBAAoB,IAAI,MAAM,kBAAkB,CAAC;;AAIrD,OAAI,MAAM,YAAY,SAAS,WAAW;AACxC,UAAM,gBAAgB;AAEtB,QAAI,CAAC,IAAI,MAAM,gBAAgB;AAC7B,SAAI,MAAM,aAAa,WAAW;AAClC,yBAAoB,IAAI,MAAM,oBAAoB,CAAC;AACnD,SAAI,MAAM,0BAA0B,YAAY,EAAE,gBAAgB,MAAM,CAAC;UAEzE,qBAAoB,IAAI,MAAM,sBAAsB,CAAC;;AAIzD,OAAI,MAAM,YAAY,SAAS,WAAW,MAAM,YAAY,SAAS,eAAe;AAIlF,QAAI,MAAM,YAAY,YAAY,IAChC;IAGF,MAAM,sBAAsB,IAAI,MAAM,wBAAwB;AAE9D,QAAI,IAAI,MAAM,kBAAkB,wBAAwB,IAAI;AAC1D,WAAM,gBAAgB;AACtB,SAAI,MAAM,qBAAqB;eACtB,eAAe,UAAU;AAClC,WAAM,gBAAgB;AACtB,SAAI,MAAM,aAAa,WAAW;;;AAItC,OAAI,MAAM,QAAQ,SAChB,KAAI,MAAM,cAAc,WAAW;AAGrC,OAAI,MAAM,YAAY,SAAS;QACzB,eAAe,UAAU;AAC3B,WAAM,gBAAgB;AACtB,SAAI,MAAM,eAAe,WAAW;;;;;AAwB5C,QAAO;EACL,GAnBqB,qBACnB;GACE,GAAI,wBAAwB,EAAE,MAAM,YAAqB,GAAG,EAAE;GAC9D,iBAAiB;GACjB,iBAAiB,wBACb,CAAC,EAAE,IAAI,MAAM,UAAU,IAAI,MAAM,kBACjC,KAAA;GACJ,iBACE,IAAI,MAAM,kBAAkB,IAAI,MAAM,SAAS,IAAI,MAAM,SAAS,KAAA;GACpE,yBAAyB,IAAI,MAAM,iBAC/B,oBAAoB,KAAA,IACpB,KAAA;GACJ;GACA,iBAAiB,IAAI,MAAM,kBAAkB,KAAA;GAC7C,iCAAiC,IAAI,MAAM,kBAAkB,KAAA;GAC9D,GACD,EAAE;EAIJ,WAAW;EACZ"}
1
+ {"version":3,"file":"use-combobox-target-props.cjs","names":["useComboboxContext"],"sources":["../../../../src/components/Combobox/use-combobox-target-props/use-combobox-target-props.ts"],"sourcesContent":["import { useState } from 'react';\nimport { useComboboxContext } from '../Combobox.context';\n\ninterface UseComboboxTargetPropsInput {\n targetType: 'input' | 'button' | undefined;\n withAriaAttributes: boolean | undefined;\n withKeyboardNavigation: boolean | undefined;\n withExpandedAttribute: boolean | undefined;\n onKeyDown: React.KeyboardEventHandler<HTMLInputElement> | undefined;\n autoComplete: string | undefined;\n}\n\nexport function useComboboxTargetProps({\n onKeyDown,\n withKeyboardNavigation,\n withAriaAttributes,\n withExpandedAttribute,\n targetType,\n autoComplete,\n}: UseComboboxTargetPropsInput) {\n const ctx = useComboboxContext();\n const [selectedOptionId, setSelectedOptionId] = useState<string | null>(null);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n\n if (ctx.readOnly) {\n return;\n }\n\n if (withKeyboardNavigation) {\n // Ignore during composition in IME\n if (event.nativeEvent.isComposing) {\n return;\n }\n\n if (event.nativeEvent.code === 'ArrowDown') {\n event.preventDefault();\n\n if (!ctx.store.dropdownOpened) {\n ctx.store.openDropdown('keyboard');\n setSelectedOptionId(ctx.store.selectActiveOption());\n ctx.store.updateSelectedOptionIndex('selected', { scrollIntoView: true });\n } else {\n setSelectedOptionId(ctx.store.selectNextOption());\n }\n }\n\n if (event.nativeEvent.code === 'ArrowUp') {\n event.preventDefault();\n\n if (!ctx.store.dropdownOpened) {\n ctx.store.openDropdown('keyboard');\n setSelectedOptionId(ctx.store.selectActiveOption());\n ctx.store.updateSelectedOptionIndex('selected', { scrollIntoView: true });\n } else {\n setSelectedOptionId(ctx.store.selectPreviousOption());\n }\n }\n\n if (event.nativeEvent.code === 'Enter' || event.nativeEvent.code === 'NumpadEnter') {\n // This is a workaround for handling differences in behavior of isComposing property in Safari\n // See: https://dninomiya.github.io/form-guide/stop-enter-submit\n // oxlint-disable-next-line typescript/no-deprecated\n if (event.nativeEvent.keyCode === 229) {\n return;\n }\n\n const selectedOptionIndex = ctx.store.getSelectedOptionIndex();\n\n if (ctx.store.dropdownOpened && selectedOptionIndex !== -1) {\n event.preventDefault();\n ctx.store.clickSelectedOption();\n } else if (targetType === 'button') {\n event.preventDefault();\n ctx.store.openDropdown('keyboard');\n }\n }\n\n if (event.key === 'Escape') {\n ctx.store.closeDropdown('keyboard');\n }\n\n if (event.nativeEvent.code === 'Space') {\n if (targetType === 'button') {\n event.preventDefault();\n ctx.store.toggleDropdown('keyboard');\n }\n }\n }\n };\n\n const ariaAttributes = withAriaAttributes\n ? {\n ...(withExpandedAttribute ? { role: 'combobox' as const } : {}),\n 'aria-haspopup': 'listbox' as const,\n 'aria-expanded': withExpandedAttribute\n ? !!(ctx.store.listId && ctx.store.dropdownOpened)\n : undefined,\n 'aria-controls':\n ctx.store.dropdownOpened && ctx.store.listId ? ctx.store.listId : undefined,\n 'aria-activedescendant': ctx.store.dropdownOpened\n ? selectedOptionId || undefined\n : undefined,\n autoComplete,\n 'data-expanded': ctx.store.dropdownOpened || undefined,\n 'data-mantine-stop-propagation': ctx.store.dropdownOpened || undefined,\n }\n : {};\n\n return {\n ...ariaAttributes,\n onKeyDown: handleKeyDown,\n };\n}\n"],"mappings":";;;;;AAYA,SAAgB,uBAAuB,EACrC,WACA,wBACA,oBACA,uBACA,YACA,gBAC8B;CAC9B,MAAM,MAAMA,yBAAAA,oBAAoB;CAChC,MAAM,CAAC,kBAAkB,wBAAA,GAAA,MAAA,UAA+C,KAAK;CAE7E,MAAM,iBAAiB,UAAiD;AACtE,cAAY,MAAM;AAElB,MAAI,IAAI,SACN;AAGF,MAAI,wBAAwB;AAE1B,OAAI,MAAM,YAAY,YACpB;AAGF,OAAI,MAAM,YAAY,SAAS,aAAa;AAC1C,UAAM,gBAAgB;AAEtB,QAAI,CAAC,IAAI,MAAM,gBAAgB;AAC7B,SAAI,MAAM,aAAa,WAAW;AAClC,yBAAoB,IAAI,MAAM,oBAAoB,CAAC;AACnD,SAAI,MAAM,0BAA0B,YAAY,EAAE,gBAAgB,MAAM,CAAC;UAEzE,qBAAoB,IAAI,MAAM,kBAAkB,CAAC;;AAIrD,OAAI,MAAM,YAAY,SAAS,WAAW;AACxC,UAAM,gBAAgB;AAEtB,QAAI,CAAC,IAAI,MAAM,gBAAgB;AAC7B,SAAI,MAAM,aAAa,WAAW;AAClC,yBAAoB,IAAI,MAAM,oBAAoB,CAAC;AACnD,SAAI,MAAM,0BAA0B,YAAY,EAAE,gBAAgB,MAAM,CAAC;UAEzE,qBAAoB,IAAI,MAAM,sBAAsB,CAAC;;AAIzD,OAAI,MAAM,YAAY,SAAS,WAAW,MAAM,YAAY,SAAS,eAAe;AAIlF,QAAI,MAAM,YAAY,YAAY,IAChC;IAGF,MAAM,sBAAsB,IAAI,MAAM,wBAAwB;AAE9D,QAAI,IAAI,MAAM,kBAAkB,wBAAwB,IAAI;AAC1D,WAAM,gBAAgB;AACtB,SAAI,MAAM,qBAAqB;eACtB,eAAe,UAAU;AAClC,WAAM,gBAAgB;AACtB,SAAI,MAAM,aAAa,WAAW;;;AAItC,OAAI,MAAM,QAAQ,SAChB,KAAI,MAAM,cAAc,WAAW;AAGrC,OAAI,MAAM,YAAY,SAAS;QACzB,eAAe,UAAU;AAC3B,WAAM,gBAAgB;AACtB,SAAI,MAAM,eAAe,WAAW;;;;;AAwB5C,QAAO;EACL,GAnBqB,qBACnB;GACE,GAAI,wBAAwB,EAAE,MAAM,YAAqB,GAAG,EAAE;GAC9D,iBAAiB;GACjB,iBAAiB,wBACb,CAAC,EAAE,IAAI,MAAM,UAAU,IAAI,MAAM,kBACjC,KAAA;GACJ,iBACE,IAAI,MAAM,kBAAkB,IAAI,MAAM,SAAS,IAAI,MAAM,SAAS,KAAA;GACpE,yBAAyB,IAAI,MAAM,iBAC/B,oBAAoB,KAAA,IACpB,KAAA;GACJ;GACA,iBAAiB,IAAI,MAAM,kBAAkB,KAAA;GAC7C,iCAAiC,IAAI,MAAM,kBAAkB,KAAA;GAC9D,GACD,EAAE;EAIJ,WAAW;EACZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"Container.cjs","names":["createVarsResolver","getSize","factory","useProps","useStyles","Box","classes"],"sources":["../../../src/components/Container/Container.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSize,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Container.module.css';\n\nexport type ContainerStylesNames = 'root';\nexport type ContainerCssVariables = {\n root: '--container-size';\n};\n\nexport interface ContainerProps\n extends BoxProps, StylesApiProps<ContainerFactory>, ElementProps<'div'> {\n /** `max-width` of the container, value is not responsive – it is the same for all screen sizes. Numbers are converted to rem. Ignored when `fluid` prop is set. @default 'md' */\n size?: MantineSize | (string & {}) | number;\n\n /** If set, the container takes 100% width of its parent and `size` prop is ignored. @default false */\n fluid?: boolean;\n\n /** Centering strategy @default 'block' */\n strategy?: 'block' | 'grid';\n}\n\nexport type ContainerFactory = Factory<{\n props: ContainerProps;\n ref: HTMLDivElement;\n stylesNames: ContainerStylesNames;\n vars: ContainerCssVariables;\n}>;\n\nconst defaultProps = {\n strategy: 'block',\n} satisfies Partial<ContainerProps>;\n\nconst varsResolver = createVarsResolver<ContainerFactory>((_, { size, fluid }) => ({\n root: {\n '--container-size': fluid ? undefined : getSize(size, 'container-size'),\n },\n}));\n\nexport const Container = factory<ContainerFactory>((_props) => {\n const props = useProps('Container', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n fluid,\n mod,\n attributes,\n strategy,\n ...others\n } = props;\n\n const getStyles = useStyles<ContainerFactory>({\n name: 'Container',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return <Box mod={[{ fluid, strategy }, mod]} {...getStyles('root')} {...others} />;\n});\n\nContainer.classes = classes;\nContainer.varsResolver = varsResolver;\nContainer.displayName = '@mantine/core/Container';\n"],"mappings":";;;;;;;;;;;AAuCA,MAAM,eAAe,EACnB,UAAU,SACX;AAED,MAAM,eAAeA,6BAAAA,oBAAsC,GAAG,EAAE,MAAM,aAAa,EACjF,MAAM,EACJ,oBAAoB,QAAQ,KAAA,IAAYC,iBAAAA,QAAQ,MAAM,iBAAiB,EACxE,EACF,EAAE;AAEH,MAAa,YAAYC,gBAAAA,SAA2B,WAAW;CAC7D,MAAM,QAAQC,kBAAAA,SAAS,aAAa,cAAc,OAAO;CACzD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,OACA,KACA,YACA,UACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAA4B;EAC5C,MAAM;EACN,SAAA,yBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QAAO,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EAAK,KAAK,CAAC;GAAE;GAAO;GAAU,EAAE,IAAI;EAAE,GAAI,UAAU,OAAO;EAAE,GAAI;EAAU,CAAA;EAClF;AAEF,UAAU,UAAUC,yBAAAA;AACpB,UAAU,eAAe;AACzB,UAAU,cAAc"}
1
+ {"version":3,"file":"Container.cjs","names":["createVarsResolver","getSize","factory","useProps","useStyles","Box","classes"],"sources":["../../../src/components/Container/Container.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSize,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Container.module.css';\n\nexport type ContainerStylesNames = 'root';\nexport type ContainerCssVariables = {\n root: '--container-size';\n};\n\nexport interface ContainerProps\n extends BoxProps, StylesApiProps<ContainerFactory>, ElementProps<'div'> {\n /** `max-width` of the container, value is not responsive – it is the same for all screen sizes. Numbers are converted to rem. Ignored when `fluid` prop is set. @default 'md' */\n size?: MantineSize | (string & {}) | number;\n\n /** If set, the container takes 100% width of its parent and `size` prop is ignored. @default false */\n fluid?: boolean;\n\n /** Centering strategy @default 'block' */\n strategy?: 'block' | 'grid';\n}\n\nexport type ContainerFactory = Factory<{\n props: ContainerProps;\n ref: HTMLDivElement;\n stylesNames: ContainerStylesNames;\n vars: ContainerCssVariables;\n}>;\n\nconst defaultProps = {\n strategy: 'block',\n} satisfies Partial<ContainerProps>;\n\nconst varsResolver = createVarsResolver<ContainerFactory>((_, { size, fluid }) => ({\n root: {\n '--container-size': fluid ? undefined : getSize(size, 'container-size'),\n },\n}));\n\nexport const Container = factory<ContainerFactory>((_props) => {\n const props = useProps('Container', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n fluid,\n mod,\n attributes,\n strategy,\n ...others\n } = props;\n\n const getStyles = useStyles<ContainerFactory>({\n name: 'Container',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return <Box mod={[{ fluid, strategy }, mod]} {...getStyles('root')} {...others} />;\n});\n\nContainer.classes = classes;\nContainer.varsResolver = varsResolver;\nContainer.displayName = '@mantine/core/Container';\n\nexport namespace Container {\n export type Props = ContainerProps;\n export type StylesNames = ContainerStylesNames;\n export type CssVariables = ContainerCssVariables;\n export type Factory = ContainerFactory;\n}\n"],"mappings":";;;;;;;;;;;AAuCA,MAAM,eAAe,EACnB,UAAU,SACX;AAED,MAAM,eAAeA,6BAAAA,oBAAsC,GAAG,EAAE,MAAM,aAAa,EACjF,MAAM,EACJ,oBAAoB,QAAQ,KAAA,IAAYC,iBAAAA,QAAQ,MAAM,iBAAiB,EACxE,EACF,EAAE;AAEH,MAAa,YAAYC,gBAAAA,SAA2B,WAAW;CAC7D,MAAM,QAAQC,kBAAAA,SAAS,aAAa,cAAc,OAAO;CACzD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,OACA,KACA,YACA,UACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAA4B;EAC5C,MAAM;EACN,SAAA,yBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QAAO,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EAAK,KAAK,CAAC;GAAE;GAAO;GAAU,EAAE,IAAI;EAAE,GAAI,UAAU,OAAO;EAAE,GAAI;EAAU,CAAA;EAClF;AAEF,UAAU,UAAUC,yBAAAA;AACpB,UAAU,eAAe;AACzB,UAAU,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.cjs","names":["createVarsResolver","getSize","factory","useProps","useStyles","Affix","Transition","Paper","CloseButton","classes"],"sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import {\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSize,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { Affix, AffixBaseProps } from '../Affix';\nimport { CloseButton } from '../CloseButton';\nimport { Paper, PaperBaseProps } from '../Paper';\nimport { Transition, TransitionOverride } from '../Transition';\nimport classes from './Dialog.module.css';\n\nexport type DialogStylesNames = 'root' | 'closeButton';\nexport type DialogCssVariables = {\n root: '--dialog-size';\n};\n\nexport interface DialogProps\n extends\n BoxProps,\n AffixBaseProps,\n PaperBaseProps,\n StylesApiProps<DialogFactory>,\n ElementProps<'div'> {\n /** If set, the component uses `display: none` to hide the root element instead of removing the DOM node @default false */\n keepMounted?: boolean;\n\n /** If set, displays the close button @default true */\n withCloseButton?: boolean;\n\n /** Called on close button click */\n onClose?: () => void;\n\n /** Dialog content */\n children?: React.ReactNode;\n\n /** Opened state */\n opened: boolean;\n\n /** Props passed down to the underlying `Transition` component @default { transition: 'pop-top-right', duration: 200 } */\n transitionProps?: TransitionOverride;\n\n /** Controls `width` of the dialog @default 'md' */\n size?: MantineSize | (string & {}) | number;\n}\n\nexport type DialogFactory = Factory<{\n props: DialogProps;\n ref: HTMLDivElement;\n stylesNames: DialogStylesNames;\n vars: DialogCssVariables;\n}>;\n\nconst defaultProps = {\n shadow: 'md',\n p: 'md',\n withBorder: true,\n transitionProps: { transition: 'pop-top-right', duration: 200 },\n position: {\n bottom: 30,\n right: 30,\n },\n} satisfies Partial<DialogProps>;\n\nconst varsResolver = createVarsResolver<DialogFactory>((_, { size }) => ({\n root: {\n '--dialog-size': getSize(size, 'dialog-size'),\n },\n}));\n\nexport const Dialog = factory<DialogFactory>((_props) => {\n const props = useProps('Dialog', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n zIndex,\n position,\n keepMounted,\n opened,\n transitionProps,\n withCloseButton,\n withinPortal,\n children,\n onClose,\n portalProps,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<DialogFactory>({\n name: 'Dialog',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <Affix\n zIndex={zIndex}\n position={position}\n withinPortal={withinPortal}\n portalProps={portalProps}\n unstyled={unstyled}\n >\n <Transition keepMounted={keepMounted} mounted={opened} {...transitionProps}>\n {(transitionStyles) => (\n <Paper\n unstyled={unstyled}\n {...getStyles('root', { style: transitionStyles })}\n {...others}\n >\n {withCloseButton && (\n <CloseButton onClick={onClose} unstyled={unstyled} {...getStyles('closeButton')} />\n )}\n {children}\n </Paper>\n )}\n </Transition>\n </Affix>\n );\n});\n\nDialog.classes = classes;\nDialog.varsResolver = varsResolver;\nDialog.displayName = '@mantine/core/Dialog';\n"],"mappings":";;;;;;;;;;;;;;AA2DA,MAAM,eAAe;CACnB,QAAQ;CACR,GAAG;CACH,YAAY;CACZ,iBAAiB;EAAE,YAAY;EAAiB,UAAU;EAAK;CAC/D,UAAU;EACR,QAAQ;EACR,OAAO;EACR;CACF;AAED,MAAM,eAAeA,6BAAAA,oBAAmC,GAAG,EAAE,YAAY,EACvE,MAAM,EACJ,iBAAiBC,iBAAAA,QAAQ,MAAM,cAAc,EAC9C,EACF,EAAE;AAEH,MAAa,SAASC,gBAAAA,SAAwB,WAAW;CACvD,MAAM,QAAQC,kBAAAA,SAAS,UAAU,cAAc,OAAO;CACtD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,QACA,UACA,aACA,QACA,iBACA,iBACA,cACA,UACA,SACA,aACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAAyB;EACzC,MAAM;EACN,SAAA,sBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,cAAAA,OAAD;EACU;EACE;EACI;EACD;EACH;YAEV,iBAAA,GAAA,kBAAA,KAACC,mBAAAA,YAAD;GAAyB;GAAa,SAAS;GAAQ,GAAI;cACvD,qBACA,iBAAA,GAAA,kBAAA,MAACC,cAAAA,OAAD;IACY;IACV,GAAI,UAAU,QAAQ,EAAE,OAAO,kBAAkB,CAAC;IAClD,GAAI;cAHN,CAKG,mBACC,iBAAA,GAAA,kBAAA,KAACC,oBAAAA,aAAD;KAAa,SAAS;KAAmB;KAAU,GAAI,UAAU,cAAc;KAAI,CAAA,EAEpF,SACK;;GAEC,CAAA;EACP,CAAA;EAEV;AAEF,OAAO,UAAUC,sBAAAA;AACjB,OAAO,eAAe;AACtB,OAAO,cAAc"}
1
+ {"version":3,"file":"Dialog.cjs","names":["createVarsResolver","getSize","factory","useProps","useStyles","Affix","Transition","Paper","CloseButton","classes"],"sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import {\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSize,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { Affix, AffixBaseProps } from '../Affix';\nimport { CloseButton } from '../CloseButton';\nimport { Paper, PaperBaseProps } from '../Paper';\nimport { Transition, TransitionOverride } from '../Transition';\nimport classes from './Dialog.module.css';\n\nexport type DialogStylesNames = 'root' | 'closeButton';\nexport type DialogCssVariables = {\n root: '--dialog-size';\n};\n\nexport interface DialogProps\n extends\n BoxProps,\n AffixBaseProps,\n PaperBaseProps,\n StylesApiProps<DialogFactory>,\n ElementProps<'div'> {\n /** If set, the component uses `display: none` to hide the root element instead of removing the DOM node @default false */\n keepMounted?: boolean;\n\n /** If set, displays the close button @default true */\n withCloseButton?: boolean;\n\n /** Called on close button click */\n onClose?: () => void;\n\n /** Dialog content */\n children?: React.ReactNode;\n\n /** Opened state */\n opened: boolean;\n\n /** Props passed down to the underlying `Transition` component @default { transition: 'pop-top-right', duration: 200 } */\n transitionProps?: TransitionOverride;\n\n /** Controls `width` of the dialog @default 'md' */\n size?: MantineSize | (string & {}) | number;\n}\n\nexport type DialogFactory = Factory<{\n props: DialogProps;\n ref: HTMLDivElement;\n stylesNames: DialogStylesNames;\n vars: DialogCssVariables;\n}>;\n\nconst defaultProps = {\n shadow: 'md',\n p: 'md',\n withBorder: true,\n transitionProps: { transition: 'pop-top-right', duration: 200 },\n position: {\n bottom: 30,\n right: 30,\n },\n} satisfies Partial<DialogProps>;\n\nconst varsResolver = createVarsResolver<DialogFactory>((_, { size }) => ({\n root: {\n '--dialog-size': getSize(size, 'dialog-size'),\n },\n}));\n\nexport const Dialog = factory<DialogFactory>((_props) => {\n const props = useProps('Dialog', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n zIndex,\n position,\n keepMounted,\n opened,\n transitionProps,\n withCloseButton,\n withinPortal,\n children,\n onClose,\n portalProps,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<DialogFactory>({\n name: 'Dialog',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <Affix\n zIndex={zIndex}\n position={position}\n withinPortal={withinPortal}\n portalProps={portalProps}\n unstyled={unstyled}\n >\n <Transition keepMounted={keepMounted} mounted={opened} {...transitionProps}>\n {(transitionStyles) => (\n <Paper\n unstyled={unstyled}\n {...getStyles('root', { style: transitionStyles })}\n {...others}\n >\n {withCloseButton && (\n <CloseButton onClick={onClose} unstyled={unstyled} {...getStyles('closeButton')} />\n )}\n {children}\n </Paper>\n )}\n </Transition>\n </Affix>\n );\n});\n\nDialog.classes = classes;\nDialog.varsResolver = varsResolver;\nDialog.displayName = '@mantine/core/Dialog';\n\nexport namespace Dialog {\n export type Props = DialogProps;\n export type StylesNames = DialogStylesNames;\n export type CssVariables = DialogCssVariables;\n export type Factory = DialogFactory;\n}\n"],"mappings":";;;;;;;;;;;;;;AA2DA,MAAM,eAAe;CACnB,QAAQ;CACR,GAAG;CACH,YAAY;CACZ,iBAAiB;EAAE,YAAY;EAAiB,UAAU;EAAK;CAC/D,UAAU;EACR,QAAQ;EACR,OAAO;EACR;CACF;AAED,MAAM,eAAeA,6BAAAA,oBAAmC,GAAG,EAAE,YAAY,EACvE,MAAM,EACJ,iBAAiBC,iBAAAA,QAAQ,MAAM,cAAc,EAC9C,EACF,EAAE;AAEH,MAAa,SAASC,gBAAAA,SAAwB,WAAW;CACvD,MAAM,QAAQC,kBAAAA,SAAS,UAAU,cAAc,OAAO;CACtD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,QACA,UACA,aACA,QACA,iBACA,iBACA,cACA,UACA,SACA,aACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAAyB;EACzC,MAAM;EACN,SAAA,sBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,cAAAA,OAAD;EACU;EACE;EACI;EACD;EACH;YAEV,iBAAA,GAAA,kBAAA,KAACC,mBAAAA,YAAD;GAAyB;GAAa,SAAS;GAAQ,GAAI;cACvD,qBACA,iBAAA,GAAA,kBAAA,MAACC,cAAAA,OAAD;IACY;IACV,GAAI,UAAU,QAAQ,EAAE,OAAO,kBAAkB,CAAC;IAClD,GAAI;cAHN,CAKG,mBACC,iBAAA,GAAA,kBAAA,KAACC,oBAAAA,aAAD;KAAa,SAAS;KAAmB;KAAU,GAAI,UAAU,cAAc;KAAI,CAAA,EAEpF,SACK;;GAEC,CAAA;EACP,CAAA;EAEV;AAEF,OAAO,UAAUC,sBAAAA;AACjB,OAAO,eAAe;AACtB,OAAO,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Divider.cjs","names":["createVarsResolver","getThemeColor","getSize","factory","useProps","useStyles","Box","classes"],"sources":["../../../src/components/Divider/Divider.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSize,\n getThemeColor,\n MantineColor,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Divider.module.css';\n\nexport type DividerStylesNames = 'root' | 'label';\nexport type DividerVariant = 'solid' | 'dashed' | 'dotted';\nexport type DividerCssVariables = {\n root: '--divider-color' | '--divider-border-style' | '--divider-size';\n};\n\nexport interface DividerProps\n extends BoxProps, StylesApiProps<DividerFactory>, ElementProps<'div'> {\n /** Key of `theme.colors` or any valid CSS color value */\n color?: MantineColor;\n\n /** Controls width/height (depends on orientation) @default 'xs' */\n size?: MantineSize | number | (string & {});\n\n /** Divider label, visible only with `orientation=\"horizontal\"` */\n label?: React.ReactNode;\n\n /** Label position @default 'center' */\n labelPosition?: 'left' | 'center' | 'right';\n\n /** Divider orientation @default 'horizontal' */\n orientation?: 'horizontal' | 'vertical';\n}\n\nexport type DividerFactory = Factory<{\n props: DividerProps;\n ref: HTMLDivElement;\n stylesNames: DividerStylesNames;\n vars: DividerCssVariables;\n variant: DividerVariant;\n}>;\n\nconst defaultProps = {\n orientation: 'horizontal',\n} satisfies Partial<DividerProps>;\n\nconst varsResolver = createVarsResolver<DividerFactory>((theme, { color, variant, size }) => ({\n root: {\n '--divider-color': color ? getThemeColor(color, theme) : undefined,\n '--divider-border-style': variant,\n '--divider-size': getSize(size, 'divider-size'),\n },\n}));\n\nexport const Divider = factory<DividerFactory>((_props) => {\n const props = useProps('Divider', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n color,\n orientation,\n label,\n labelPosition,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<DividerFactory>({\n name: 'Divider',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <Box\n mod={[{ orientation, withLabel: !!label }, mod]}\n role=\"separator\"\n {...getStyles('root')}\n {...others}\n >\n {label && (\n <Box component=\"span\" mod={{ position: labelPosition }} {...getStyles('label')}>\n {label}\n </Box>\n )}\n </Box>\n );\n});\n\nDivider.classes = classes;\nDivider.varsResolver = varsResolver;\nDivider.displayName = '@mantine/core/Divider';\n"],"mappings":";;;;;;;;;;;;AAiDA,MAAM,eAAe,EACnB,aAAa,cACd;AAED,MAAM,eAAeA,6BAAAA,oBAAoC,OAAO,EAAE,OAAO,SAAS,YAAY,EAC5F,MAAM;CACJ,mBAAmB,QAAQC,wBAAAA,cAAc,OAAO,MAAM,GAAG,KAAA;CACzD,0BAA0B;CAC1B,kBAAkBC,iBAAAA,QAAQ,MAAM,eAAe;CAChD,EACF,EAAE;AAEH,MAAa,UAAUC,gBAAAA,SAAyB,WAAW;CACzD,MAAM,QAAQC,kBAAAA,SAAS,WAAW,cAAc,OAAO;CACvD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,OACA,aACA,OACA,eACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAA0B;EAC1C,MAAM;EACN,SAAA,uBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,KAAK,CAAC;GAAE;GAAa,WAAW,CAAC,CAAC;GAAO,EAAE,IAAI;EAC/C,MAAK;EACL,GAAI,UAAU,OAAO;EACrB,GAAI;YAEH,SACC,iBAAA,GAAA,kBAAA,KAACA,YAAAA,KAAD;GAAK,WAAU;GAAO,KAAK,EAAE,UAAU,eAAe;GAAE,GAAI,UAAU,QAAQ;aAC3E;GACG,CAAA;EAEJ,CAAA;EAER;AAEF,QAAQ,UAAUC,uBAAAA;AAClB,QAAQ,eAAe;AACvB,QAAQ,cAAc"}
1
+ {"version":3,"file":"Divider.cjs","names":["createVarsResolver","getThemeColor","getSize","factory","useProps","useStyles","Box","classes"],"sources":["../../../src/components/Divider/Divider.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSize,\n getThemeColor,\n MantineColor,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Divider.module.css';\n\nexport type DividerStylesNames = 'root' | 'label';\nexport type DividerVariant = 'solid' | 'dashed' | 'dotted';\nexport type DividerCssVariables = {\n root: '--divider-color' | '--divider-border-style' | '--divider-size';\n};\n\nexport interface DividerProps\n extends BoxProps, StylesApiProps<DividerFactory>, ElementProps<'div'> {\n /** Key of `theme.colors` or any valid CSS color value */\n color?: MantineColor;\n\n /** Controls width/height (depends on orientation) @default 'xs' */\n size?: MantineSize | number | (string & {});\n\n /** Divider label, visible only with `orientation=\"horizontal\"` */\n label?: React.ReactNode;\n\n /** Label position @default 'center' */\n labelPosition?: 'left' | 'center' | 'right';\n\n /** Divider orientation @default 'horizontal' */\n orientation?: 'horizontal' | 'vertical';\n}\n\nexport type DividerFactory = Factory<{\n props: DividerProps;\n ref: HTMLDivElement;\n stylesNames: DividerStylesNames;\n vars: DividerCssVariables;\n variant: DividerVariant;\n}>;\n\nconst defaultProps = {\n orientation: 'horizontal',\n} satisfies Partial<DividerProps>;\n\nconst varsResolver = createVarsResolver<DividerFactory>((theme, { color, variant, size }) => ({\n root: {\n '--divider-color': color ? getThemeColor(color, theme) : undefined,\n '--divider-border-style': variant,\n '--divider-size': getSize(size, 'divider-size'),\n },\n}));\n\nexport const Divider = factory<DividerFactory>((_props) => {\n const props = useProps('Divider', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n color,\n orientation,\n label,\n labelPosition,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<DividerFactory>({\n name: 'Divider',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <Box\n mod={[{ orientation, withLabel: !!label }, mod]}\n role=\"separator\"\n {...getStyles('root')}\n {...others}\n >\n {label && (\n <Box component=\"span\" mod={{ position: labelPosition }} {...getStyles('label')}>\n {label}\n </Box>\n )}\n </Box>\n );\n});\n\nDivider.classes = classes;\nDivider.varsResolver = varsResolver;\nDivider.displayName = '@mantine/core/Divider';\n\nexport namespace Divider {\n export type Props = DividerProps;\n export type StylesNames = DividerStylesNames;\n export type CssVariables = DividerCssVariables;\n export type Factory = DividerFactory;\n export type Variant = DividerVariant;\n}\n"],"mappings":";;;;;;;;;;;;AAiDA,MAAM,eAAe,EACnB,aAAa,cACd;AAED,MAAM,eAAeA,6BAAAA,oBAAoC,OAAO,EAAE,OAAO,SAAS,YAAY,EAC5F,MAAM;CACJ,mBAAmB,QAAQC,wBAAAA,cAAc,OAAO,MAAM,GAAG,KAAA;CACzD,0BAA0B;CAC1B,kBAAkBC,iBAAAA,QAAQ,MAAM,eAAe;CAChD,EACF,EAAE;AAEH,MAAa,UAAUC,gBAAAA,SAAyB,WAAW;CACzD,MAAM,QAAQC,kBAAAA,SAAS,WAAW,cAAc,OAAO;CACvD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,OACA,aACA,OACA,eACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAA0B;EAC1C,MAAM;EACN,SAAA,uBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,KAAK,CAAC;GAAE;GAAa,WAAW,CAAC,CAAC;GAAO,EAAE,IAAI;EAC/C,MAAK;EACL,GAAI,UAAU,OAAO;EACrB,GAAI;YAEH,SACC,iBAAA,GAAA,kBAAA,KAACA,YAAAA,KAAD;GAAK,WAAU;GAAO,KAAK,EAAE,UAAU,eAAe;GAAE,GAAI,UAAU,QAAQ;aAC3E;GACG,CAAA;EAEJ,CAAA;EAER;AAEF,QAAQ,UAAUC,uBAAAA;AAClB,QAAQ,eAAe;AACvB,QAAQ,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Fieldset.cjs","names":["createVarsResolver","getRadius","factory","useProps","useStyles","Box","classes"],"sources":["../../../src/components/Fieldset/Fieldset.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Fieldset.module.css';\n\nexport type FieldsetStylesNames = 'root' | 'legend';\nexport type FieldsetVariant = 'default' | 'filled' | 'unstyled';\nexport type FieldsetCSSVariables = {\n root: '--fieldset-radius';\n};\n\nexport interface FieldsetProps\n extends BoxProps, StylesApiProps<FieldsetFactory>, ElementProps<'fieldset'> {\n /** Fieldset legend */\n legend?: React.ReactNode;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n}\n\nexport type FieldsetFactory = Factory<{\n props: FieldsetProps;\n ref: HTMLFieldSetElement;\n stylesNames: FieldsetStylesNames;\n vars: FieldsetCSSVariables;\n variant: FieldsetVariant;\n}>;\n\nconst defaultProps = {\n variant: 'default',\n} satisfies Partial<FieldsetProps>;\n\nconst varsResolver = createVarsResolver<FieldsetFactory>((_, { radius }) => ({\n root: {\n '--fieldset-radius': radius === undefined ? undefined : getRadius(radius),\n },\n}));\n\nexport const Fieldset = factory<FieldsetFactory>((_props) => {\n const props = useProps('Fieldset', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n legend,\n variant,\n children,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<FieldsetFactory>({\n name: 'Fieldset',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <Box component=\"fieldset\" variant={variant} {...getStyles('root', { variant })} {...others}>\n {legend && <legend {...getStyles('legend', { variant })}>{legend}</legend>}\n {children}\n </Box>\n );\n});\n\nFieldset.classes = classes;\nFieldset.varsResolver = varsResolver;\nFieldset.displayName = '@mantine/core/Fieldset';\n"],"mappings":";;;;;;;;;;;AAsCA,MAAM,eAAe,EACnB,SAAS,WACV;AAED,MAAM,eAAeA,6BAAAA,oBAAqC,GAAG,EAAE,cAAc,EAC3E,MAAM,EACJ,qBAAqB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO,EAC1E,EACF,EAAE;AAEH,MAAa,WAAWC,gBAAAA,SAA0B,WAAW;CAC3D,MAAM,QAAQC,kBAAAA,SAAS,YAAY,cAAc,OAAO;CACxD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,QACA,SACA,UACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAA2B;EAC3C,MAAM;EACN,SAAA,wBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,MAACC,YAAAA,KAAD;EAAK,WAAU;EAAoB;EAAS,GAAI,UAAU,QAAQ,EAAE,SAAS,CAAC;EAAE,GAAI;YAApF,CACG,UAAU,iBAAA,GAAA,kBAAA,KAAC,UAAD;GAAQ,GAAI,UAAU,UAAU,EAAE,SAAS,CAAC;aAAG;GAAgB,CAAA,EACzE,SACG;;EAER;AAEF,SAAS,UAAUC,wBAAAA;AACnB,SAAS,eAAe;AACxB,SAAS,cAAc"}
1
+ {"version":3,"file":"Fieldset.cjs","names":["createVarsResolver","getRadius","factory","useProps","useStyles","Box","classes"],"sources":["../../../src/components/Fieldset/Fieldset.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Fieldset.module.css';\n\nexport type FieldsetStylesNames = 'root' | 'legend';\nexport type FieldsetVariant = 'default' | 'filled' | 'unstyled';\nexport type FieldsetCSSVariables = {\n root: '--fieldset-radius';\n};\n\nexport interface FieldsetProps\n extends BoxProps, StylesApiProps<FieldsetFactory>, ElementProps<'fieldset'> {\n /** Fieldset legend */\n legend?: React.ReactNode;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n}\n\nexport type FieldsetFactory = Factory<{\n props: FieldsetProps;\n ref: HTMLFieldSetElement;\n stylesNames: FieldsetStylesNames;\n vars: FieldsetCSSVariables;\n variant: FieldsetVariant;\n}>;\n\nconst defaultProps = {\n variant: 'default',\n} satisfies Partial<FieldsetProps>;\n\nconst varsResolver = createVarsResolver<FieldsetFactory>((_, { radius }) => ({\n root: {\n '--fieldset-radius': radius === undefined ? undefined : getRadius(radius),\n },\n}));\n\nexport const Fieldset = factory<FieldsetFactory>((_props) => {\n const props = useProps('Fieldset', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n legend,\n variant,\n children,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<FieldsetFactory>({\n name: 'Fieldset',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <Box component=\"fieldset\" variant={variant} {...getStyles('root', { variant })} {...others}>\n {legend && <legend {...getStyles('legend', { variant })}>{legend}</legend>}\n {children}\n </Box>\n );\n});\n\nFieldset.classes = classes;\nFieldset.varsResolver = varsResolver;\nFieldset.displayName = '@mantine/core/Fieldset';\n\nexport namespace Fieldset {\n export type Props = FieldsetProps;\n export type StylesNames = FieldsetStylesNames;\n export type Factory = FieldsetFactory;\n export type Variant = FieldsetVariant;\n}\n"],"mappings":";;;;;;;;;;;AAsCA,MAAM,eAAe,EACnB,SAAS,WACV;AAED,MAAM,eAAeA,6BAAAA,oBAAqC,GAAG,EAAE,cAAc,EAC3E,MAAM,EACJ,qBAAqB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO,EAC1E,EACF,EAAE;AAEH,MAAa,WAAWC,gBAAAA,SAA0B,WAAW;CAC3D,MAAM,QAAQC,kBAAAA,SAAS,YAAY,cAAc,OAAO;CACxD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,QACA,SACA,UACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAA2B;EAC3C,MAAM;EACN,SAAA,wBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,MAACC,YAAAA,KAAD;EAAK,WAAU;EAAoB;EAAS,GAAI,UAAU,QAAQ,EAAE,SAAS,CAAC;EAAE,GAAI;YAApF,CACG,UAAU,iBAAA,GAAA,kBAAA,KAAC,UAAD;GAAQ,GAAI,UAAU,UAAU,EAAE,SAAS,CAAC;aAAG;GAAgB,CAAA,EACzE,SACG;;EAER;AAEF,SAAS,UAAUC,wBAAAA;AACnB,SAAS,eAAe;AACxB,SAAS,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileButton.cjs","names":["genericFactory","useProps"],"sources":["../../../src/components/FileButton/FileButton.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { assignRef, useMergedRef } from '@mantine/hooks';\nimport { Factory, genericFactory, useProps } from '../../core';\n\nexport interface FileButtonProps<Multiple extends boolean = false> {\n ref?: React.Ref<HTMLInputElement>;\n\n /** Called when files are picked */\n onChange: (payload: Multiple extends true ? File[] : File | null) => void;\n\n /** Function that receives button props and returns react node that should be rendered */\n children: (props: { onClick: () => void }) => React.ReactNode;\n\n /** If set, user can pick more than one file */\n multiple?: Multiple;\n\n /** File input accept attribute, for example, `\"image/png,image/jpeg\"` */\n accept?: string;\n\n /** Input name attribute */\n name?: string;\n\n /** Input form attribute */\n form?: string;\n\n /** Reference of the function that should be called when value changes to null or empty array */\n resetRef?: React.Ref<() => void>;\n\n /** Disables file picker */\n disabled?: boolean;\n\n /** Specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the accept attribute. */\n capture?: boolean | 'user' | 'environment';\n\n /** Passes down props to the input element used to capture files */\n inputProps?: React.ComponentProps<'input'>;\n}\n\nexport type FileButtonFactory = Factory<{\n props: FileButtonProps;\n signature: <Multiple extends boolean = false>(\n props: FileButtonProps<Multiple>\n ) => React.JSX.Element;\n}>;\n\nexport const FileButton = genericFactory<FileButtonFactory>((props) => {\n const {\n onChange,\n children,\n multiple,\n accept,\n name,\n form,\n resetRef,\n disabled,\n capture,\n inputProps,\n ref,\n ...others\n } = useProps('FileButton', null, props);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n const onClick = () => {\n !disabled && inputRef.current?.click();\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (event.currentTarget.files === null) {\n return onChange(multiple ? ([] as any) : null);\n }\n\n if (multiple) {\n onChange(Array.from(event.currentTarget.files) as any);\n } else {\n onChange((event.currentTarget.files[0] as any) || null);\n }\n };\n\n const reset = () => {\n if (inputRef.current) {\n inputRef.current.value = '';\n }\n };\n\n assignRef(resetRef, reset);\n\n return (\n <>\n <input\n style={{ display: 'none' }}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n onChange={handleChange}\n ref={useMergedRef(ref, inputRef)}\n name={name}\n form={form}\n capture={capture}\n {...inputProps}\n />\n\n {children({ onClick, ...others })}\n </>\n );\n});\n\nFileButton.displayName = '@mantine/core/FileButton';\n"],"mappings":";;;;;;;;;AA6CA,MAAa,aAAaA,gBAAAA,gBAAmC,UAAU;CACrE,MAAM,EACJ,UACA,UACA,UACA,QACA,MACA,MACA,UACA,UACA,SACA,YACA,KACA,GAAG,WACDC,kBAAAA,SAAS,cAAc,MAAM,MAAM;CAEvC,MAAM,YAAA,GAAA,MAAA,QAAoC,KAAK;CAE/C,MAAM,gBAAgB;AACpB,GAAC,YAAY,SAAS,SAAS,OAAO;;CAGxC,MAAM,gBAAgB,UAA+C;AACnE,MAAI,MAAM,cAAc,UAAU,KAChC,QAAO,SAAS,WAAY,EAAE,GAAW,KAAK;AAGhD,MAAI,SACF,UAAS,MAAM,KAAK,MAAM,cAAc,MAAM,CAAQ;MAEtD,UAAU,MAAM,cAAc,MAAM,MAAc,KAAK;;CAI3D,MAAM,cAAc;AAClB,MAAI,SAAS,QACX,UAAS,QAAQ,QAAQ;;AAI7B,EAAA,GAAA,eAAA,WAAU,UAAU,MAAM;AAE1B,QACE,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;EACE,OAAO,EAAE,SAAS,QAAQ;EAC1B,MAAK;EACG;EACE;EACV,UAAU;EACV,MAAA,GAAA,eAAA,cAAkB,KAAK,SAAS;EAC1B;EACA;EACG;EACT,GAAI;EACJ,CAAA,EAED,SAAS;EAAE;EAAS,GAAG;EAAQ,CAAC,CAChC,EAAA,CAAA;EAEL;AAEF,WAAW,cAAc"}
1
+ {"version":3,"file":"FileButton.cjs","names":["genericFactory","useProps"],"sources":["../../../src/components/FileButton/FileButton.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { assignRef, useMergedRef } from '@mantine/hooks';\nimport { Factory, genericFactory, useProps } from '../../core';\n\nexport interface FileButtonProps<Multiple extends boolean = false> {\n ref?: React.Ref<HTMLInputElement>;\n\n /** Called when files are picked */\n onChange: (payload: Multiple extends true ? File[] : File | null) => void;\n\n /** Function that receives button props and returns react node that should be rendered */\n children: (props: { onClick: () => void }) => React.ReactNode;\n\n /** If set, user can pick more than one file */\n multiple?: Multiple;\n\n /** File input accept attribute, for example, `\"image/png,image/jpeg\"` */\n accept?: string;\n\n /** Input name attribute */\n name?: string;\n\n /** Input form attribute */\n form?: string;\n\n /** Reference of the function that should be called when value changes to null or empty array */\n resetRef?: React.Ref<() => void>;\n\n /** Disables file picker */\n disabled?: boolean;\n\n /** Specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the accept attribute. */\n capture?: boolean | 'user' | 'environment';\n\n /** Passes down props to the input element used to capture files */\n inputProps?: React.ComponentProps<'input'>;\n}\n\nexport type FileButtonFactory = Factory<{\n props: FileButtonProps;\n signature: <Multiple extends boolean = false>(\n props: FileButtonProps<Multiple>\n ) => React.JSX.Element;\n}>;\n\nexport const FileButton = genericFactory<FileButtonFactory>((props) => {\n const {\n onChange,\n children,\n multiple,\n accept,\n name,\n form,\n resetRef,\n disabled,\n capture,\n inputProps,\n ref,\n ...others\n } = useProps('FileButton', null, props);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n const onClick = () => {\n !disabled && inputRef.current?.click();\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (event.currentTarget.files === null) {\n return onChange(multiple ? ([] as any) : null);\n }\n\n if (multiple) {\n onChange(Array.from(event.currentTarget.files) as any);\n } else {\n onChange((event.currentTarget.files[0] as any) || null);\n }\n };\n\n const reset = () => {\n if (inputRef.current) {\n inputRef.current.value = '';\n }\n };\n\n assignRef(resetRef, reset);\n\n return (\n <>\n <input\n style={{ display: 'none' }}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n onChange={handleChange}\n ref={useMergedRef(ref, inputRef)}\n name={name}\n form={form}\n capture={capture}\n {...inputProps}\n />\n\n {children({ onClick, ...others })}\n </>\n );\n});\n\nFileButton.displayName = '@mantine/core/FileButton';\n\nexport namespace FileButton {\n export type Props<Multiple extends boolean = false> = FileButtonProps<Multiple>;\n export type Factory = FileButtonFactory;\n}\n"],"mappings":";;;;;;;;;AA6CA,MAAa,aAAaA,gBAAAA,gBAAmC,UAAU;CACrE,MAAM,EACJ,UACA,UACA,UACA,QACA,MACA,MACA,UACA,UACA,SACA,YACA,KACA,GAAG,WACDC,kBAAAA,SAAS,cAAc,MAAM,MAAM;CAEvC,MAAM,YAAA,GAAA,MAAA,QAAoC,KAAK;CAE/C,MAAM,gBAAgB;AACpB,GAAC,YAAY,SAAS,SAAS,OAAO;;CAGxC,MAAM,gBAAgB,UAA+C;AACnE,MAAI,MAAM,cAAc,UAAU,KAChC,QAAO,SAAS,WAAY,EAAE,GAAW,KAAK;AAGhD,MAAI,SACF,UAAS,MAAM,KAAK,MAAM,cAAc,MAAM,CAAQ;MAEtD,UAAU,MAAM,cAAc,MAAM,MAAc,KAAK;;CAI3D,MAAM,cAAc;AAClB,MAAI,SAAS,QACX,UAAS,QAAQ,QAAQ;;AAI7B,EAAA,GAAA,eAAA,WAAU,UAAU,MAAM;AAE1B,QACE,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;EACE,OAAO,EAAE,SAAS,QAAQ;EAC1B,MAAK;EACG;EACE;EACV,UAAU;EACV,MAAA,GAAA,eAAA,cAAkB,KAAK,SAAS;EAC1B;EACA;EACG;EACT,GAAI;EACJ,CAAA,EAED,SAAS;EAAE;EAAS,GAAG;EAAQ,CAAC,CAChC,EAAA,CAAA;EAEL;AAEF,WAAW,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.cjs","names":["genericFactory","useProps","useResolvedStylesApi","CloseButton","FileButton","InputBase","Input"],"sources":["../../../src/components/FileInput/FileInput.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { useMergedRef, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n ElementProps,\n Factory,\n genericFactory,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n} from '../../core';\nimport { CloseButton } from '../CloseButton';\nimport { FileButton } from '../FileButton';\nimport {\n __BaseInputProps,\n __InputStylesNames,\n ClearSectionMode,\n Input,\n InputVariant,\n} from '../Input';\nimport { InputBase } from '../InputBase/InputBase';\n\nexport interface FileInputProps<Multiple = false>\n extends\n BoxProps,\n __BaseInputProps,\n StylesApiProps<FileInputFactory>,\n ElementProps<'button', 'value' | 'defaultValue' | 'onChange' | 'placeholder'> {\n component?: any;\n\n /** Called when value changes */\n onChange?: (payload: Multiple extends true ? File[] : File | null) => void;\n\n /** Controlled component value */\n value?: Multiple extends true ? File[] : File | null;\n\n /** Uncontrolled component default value */\n defaultValue?: Multiple extends true ? File[] : File | null;\n\n /** If set, user can pick more than one file @default false */\n multiple?: Multiple;\n\n /** File input accept attribute, for example, `\"image/png,image/jpeg\"` */\n accept?: string;\n\n /** Input name attribute */\n name?: string;\n\n /** Input form attribute */\n form?: string;\n\n /** Value renderer. By default, displays file name. */\n valueComponent?: React.FC<{ value: null | File | File[] }>;\n\n /** If set, the clear button is displayed in the right section @default false */\n clearable?: boolean;\n\n /** Determines how the clear button and rightSection are rendered @default 'both' */\n clearSectionMode?: ClearSectionMode;\n\n /** Props passed down to the clear button */\n clearButtonProps?: React.ComponentProps<'button'>;\n\n /** If set, the input value cannot be changed */\n readOnly?: boolean;\n\n /** Specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the accept attribute. */\n capture?: boolean | 'user' | 'environment';\n\n /** Props passed down to the hidden `input[type=\"file\"]` */\n fileInputProps?: React.ComponentProps<'input'>;\n\n /** Input placeholder */\n placeholder?: React.ReactNode;\n\n /** Reference of the function that should be called when value changes to null or empty array */\n resetRef?: React.Ref<() => void>;\n}\n\nexport type FileInputFactory = Factory<{\n props: FileInputProps;\n ref: HTMLButtonElement;\n stylesNames: __InputStylesNames | 'placeholder';\n variant: InputVariant;\n signature: <Multiple extends boolean = false>(\n props: FileInputProps<Multiple>\n ) => React.JSX.Element;\n}>;\n\nconst DefaultValue: FileInputProps['valueComponent'] = ({ value }) => (\n <div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>\n {Array.isArray(value) ? value.map((file) => file.name).join(', ') : value?.name}\n </div>\n);\n\nconst defaultProps = {\n valueComponent: DefaultValue,\n size: 'sm',\n} satisfies Partial<FileInputProps>;\n\nexport const FileInput = genericFactory<FileInputFactory>((_props) => {\n const props = useProps('FileInput', defaultProps, _props);\n const {\n unstyled,\n vars,\n onChange,\n value,\n defaultValue,\n multiple,\n accept,\n name,\n form,\n valueComponent: ValueComponent,\n clearable,\n clearSectionMode,\n clearButtonProps,\n readOnly,\n capture,\n fileInputProps,\n rightSection,\n size,\n placeholder,\n component,\n resetRef: resetRefProp,\n classNames,\n styles,\n attributes,\n ...others\n } = props;\n\n const resetRef = useRef<() => void>(null);\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<FileInputFactory>({\n classNames,\n styles,\n props,\n });\n\n const [_value, setValue] = useUncontrolled<null | File | File[]>({\n value,\n defaultValue,\n onChange: onChange as any,\n finalValue: multiple ? [] : null,\n });\n\n const hasValue = Array.isArray(_value) ? _value.length !== 0 : _value !== null;\n\n const clearButton = (\n <CloseButton\n {...clearButtonProps}\n variant=\"subtle\"\n onClick={() => setValue(multiple ? [] : null)}\n size={size}\n unstyled={unstyled}\n />\n );\n\n const _clearable = clearable && hasValue && !readOnly;\n\n useEffect(() => {\n if ((Array.isArray(_value) && _value.length === 0) || _value === null) {\n resetRef.current?.();\n }\n }, [_value]);\n\n return (\n <FileButton\n onChange={setValue}\n multiple={multiple}\n accept={accept}\n name={name}\n form={form}\n resetRef={useMergedRef(resetRef, resetRefProp)}\n disabled={readOnly}\n capture={capture}\n inputProps={fileInputProps}\n >\n {(fileButtonProps) => (\n <InputBase\n component={component || 'button'}\n rightSection={rightSection}\n __clearSection={clearButton}\n __clearable={_clearable}\n __clearSectionMode={clearSectionMode}\n {...fileButtonProps}\n {...others}\n __staticSelector=\"FileInput\"\n multiline\n type=\"button\"\n pointer\n __stylesApiProps={props}\n unstyled={unstyled}\n size={size}\n classNames={classNames}\n styles={styles}\n attributes={attributes}\n >\n {!hasValue ? (\n <Input.Placeholder\n __staticSelector=\"FileInput\"\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n attributes={attributes}\n >\n {placeholder}\n </Input.Placeholder>\n ) : (\n <ValueComponent value={_value} />\n )}\n </InputBase>\n )}\n </FileButton>\n );\n});\n\nFileInput.classes = InputBase.classes;\nFileInput.displayName = '@mantine/core/FileInput';\n"],"mappings":";;;;;;;;;;;;;AAyFA,MAAM,gBAAkD,EAAE,YACxD,iBAAA,GAAA,kBAAA,KAAC,OAAD;CAAK,OAAO;EAAE,UAAU;EAAU,cAAc;EAAY,YAAY;EAAU;WAC/E,MAAM,QAAQ,MAAM,GAAG,MAAM,KAAK,SAAS,KAAK,KAAK,CAAC,KAAK,KAAK,GAAG,OAAO;CACvE,CAAA;AAGR,MAAM,eAAe;CACnB,gBAAgB;CAChB,MAAM;CACP;AAED,MAAa,YAAYA,gBAAAA,gBAAkC,WAAW;CACpE,MAAM,QAAQC,kBAAAA,SAAS,aAAa,cAAc,OAAO;CACzD,MAAM,EACJ,UACA,MACA,UACA,OACA,cACA,UACA,QACA,MACA,MACA,gBAAgB,gBAChB,WACA,kBACA,kBACA,UACA,SACA,gBACA,cACA,MACA,aACA,WACA,UAAU,cACV,YACA,QACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAA,GAAA,MAAA,QAA8B,KAAK;CACzC,MAAM,EAAE,oBAAoB,mBAAmBC,gCAAAA,qBAAuC;EACpF;EACA;EACA;EACD,CAAC;CAEF,MAAM,CAAC,QAAQ,aAAA,GAAA,eAAA,iBAAkD;EAC/D;EACA;EACU;EACV,YAAY,WAAW,EAAE,GAAG;EAC7B,CAAC;CAEF,MAAM,WAAW,MAAM,QAAQ,OAAO,GAAG,OAAO,WAAW,IAAI,WAAW;CAE1E,MAAM,cACJ,iBAAA,GAAA,kBAAA,KAACC,oBAAAA,aAAD;EACE,GAAI;EACJ,SAAQ;EACR,eAAe,SAAS,WAAW,EAAE,GAAG,KAAK;EACvC;EACI;EACV,CAAA;CAGJ,MAAM,aAAa,aAAa,YAAY,CAAC;AAE7C,EAAA,GAAA,MAAA,iBAAgB;AACd,MAAK,MAAM,QAAQ,OAAO,IAAI,OAAO,WAAW,KAAM,WAAW,KAC/D,UAAS,WAAW;IAErB,CAAC,OAAO,CAAC;AAEZ,QACE,iBAAA,GAAA,kBAAA,KAACC,mBAAAA,YAAD;EACE,UAAU;EACA;EACF;EACF;EACA;EACN,WAAA,GAAA,eAAA,cAAuB,UAAU,aAAa;EAC9C,UAAU;EACD;EACT,YAAY;aAEV,oBACA,iBAAA,GAAA,kBAAA,KAACC,kBAAAA,WAAD;GACE,WAAW,aAAa;GACV;GACd,gBAAgB;GAChB,aAAa;GACb,oBAAoB;GACpB,GAAI;GACJ,GAAI;GACJ,kBAAiB;GACjB,WAAA;GACA,MAAK;GACL,SAAA;GACA,kBAAkB;GACR;GACJ;GACM;GACJ;GACI;aAEX,CAAC,WACA,iBAAA,GAAA,kBAAA,KAACC,cAAAA,MAAM,aAAP;IACE,kBAAiB;IACjB,YAAY;IACZ,QAAQ;IACI;cAEX;IACiB,CAAA,GAEpB,iBAAA,GAAA,kBAAA,KAAC,gBAAD,EAAgB,OAAO,QAAU,CAAA;GAEzB,CAAA;EAEH,CAAA;EAEf;AAEF,UAAU,UAAUD,kBAAAA,UAAU;AAC9B,UAAU,cAAc"}
1
+ {"version":3,"file":"FileInput.cjs","names":["genericFactory","useProps","useResolvedStylesApi","CloseButton","FileButton","InputBase","Input"],"sources":["../../../src/components/FileInput/FileInput.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { useMergedRef, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n ElementProps,\n Factory,\n genericFactory,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n} from '../../core';\nimport { CloseButton } from '../CloseButton';\nimport { FileButton } from '../FileButton';\nimport {\n __BaseInputProps,\n __InputStylesNames,\n ClearSectionMode,\n Input,\n InputVariant,\n} from '../Input';\nimport { InputBase } from '../InputBase/InputBase';\n\nexport interface FileInputProps<Multiple = false>\n extends\n BoxProps,\n __BaseInputProps,\n StylesApiProps<FileInputFactory>,\n ElementProps<'button', 'value' | 'defaultValue' | 'onChange' | 'placeholder'> {\n component?: any;\n\n /** Called when value changes */\n onChange?: (payload: Multiple extends true ? File[] : File | null) => void;\n\n /** Controlled component value */\n value?: Multiple extends true ? File[] : File | null;\n\n /** Uncontrolled component default value */\n defaultValue?: Multiple extends true ? File[] : File | null;\n\n /** If set, user can pick more than one file @default false */\n multiple?: Multiple;\n\n /** File input accept attribute, for example, `\"image/png,image/jpeg\"` */\n accept?: string;\n\n /** Input name attribute */\n name?: string;\n\n /** Input form attribute */\n form?: string;\n\n /** Value renderer. By default, displays file name. */\n valueComponent?: React.FC<{ value: null | File | File[] }>;\n\n /** If set, the clear button is displayed in the right section @default false */\n clearable?: boolean;\n\n /** Determines how the clear button and rightSection are rendered @default 'both' */\n clearSectionMode?: ClearSectionMode;\n\n /** Props passed down to the clear button */\n clearButtonProps?: React.ComponentProps<'button'>;\n\n /** If set, the input value cannot be changed */\n readOnly?: boolean;\n\n /** Specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the accept attribute. */\n capture?: boolean | 'user' | 'environment';\n\n /** Props passed down to the hidden `input[type=\"file\"]` */\n fileInputProps?: React.ComponentProps<'input'>;\n\n /** Input placeholder */\n placeholder?: React.ReactNode;\n\n /** Reference of the function that should be called when value changes to null or empty array */\n resetRef?: React.Ref<() => void>;\n}\n\nexport type FileInputFactory = Factory<{\n props: FileInputProps;\n ref: HTMLButtonElement;\n stylesNames: __InputStylesNames | 'placeholder';\n variant: InputVariant;\n signature: <Multiple extends boolean = false>(\n props: FileInputProps<Multiple>\n ) => React.JSX.Element;\n}>;\n\nconst DefaultValue: FileInputProps['valueComponent'] = ({ value }) => (\n <div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>\n {Array.isArray(value) ? value.map((file) => file.name).join(', ') : value?.name}\n </div>\n);\n\nconst defaultProps = {\n valueComponent: DefaultValue,\n size: 'sm',\n} satisfies Partial<FileInputProps>;\n\nexport const FileInput = genericFactory<FileInputFactory>((_props) => {\n const props = useProps('FileInput', defaultProps, _props);\n const {\n unstyled,\n vars,\n onChange,\n value,\n defaultValue,\n multiple,\n accept,\n name,\n form,\n valueComponent: ValueComponent,\n clearable,\n clearSectionMode,\n clearButtonProps,\n readOnly,\n capture,\n fileInputProps,\n rightSection,\n size,\n placeholder,\n component,\n resetRef: resetRefProp,\n classNames,\n styles,\n attributes,\n ...others\n } = props;\n\n const resetRef = useRef<() => void>(null);\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<FileInputFactory>({\n classNames,\n styles,\n props,\n });\n\n const [_value, setValue] = useUncontrolled<null | File | File[]>({\n value,\n defaultValue,\n onChange: onChange as any,\n finalValue: multiple ? [] : null,\n });\n\n const hasValue = Array.isArray(_value) ? _value.length !== 0 : _value !== null;\n\n const clearButton = (\n <CloseButton\n {...clearButtonProps}\n variant=\"subtle\"\n onClick={() => setValue(multiple ? [] : null)}\n size={size}\n unstyled={unstyled}\n />\n );\n\n const _clearable = clearable && hasValue && !readOnly;\n\n useEffect(() => {\n if ((Array.isArray(_value) && _value.length === 0) || _value === null) {\n resetRef.current?.();\n }\n }, [_value]);\n\n return (\n <FileButton\n onChange={setValue}\n multiple={multiple}\n accept={accept}\n name={name}\n form={form}\n resetRef={useMergedRef(resetRef, resetRefProp)}\n disabled={readOnly}\n capture={capture}\n inputProps={fileInputProps}\n >\n {(fileButtonProps) => (\n <InputBase\n component={component || 'button'}\n rightSection={rightSection}\n __clearSection={clearButton}\n __clearable={_clearable}\n __clearSectionMode={clearSectionMode}\n {...fileButtonProps}\n {...others}\n __staticSelector=\"FileInput\"\n multiline\n type=\"button\"\n pointer\n __stylesApiProps={props}\n unstyled={unstyled}\n size={size}\n classNames={classNames}\n styles={styles}\n attributes={attributes}\n >\n {!hasValue ? (\n <Input.Placeholder\n __staticSelector=\"FileInput\"\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n attributes={attributes}\n >\n {placeholder}\n </Input.Placeholder>\n ) : (\n <ValueComponent value={_value} />\n )}\n </InputBase>\n )}\n </FileButton>\n );\n});\n\nFileInput.classes = InputBase.classes;\nFileInput.displayName = '@mantine/core/FileInput';\n\nexport namespace FileInput {\n export type Props<Multiple extends boolean = false> = FileInputProps<Multiple>;\n export type Factory = FileInputFactory;\n}\n"],"mappings":";;;;;;;;;;;;;AAyFA,MAAM,gBAAkD,EAAE,YACxD,iBAAA,GAAA,kBAAA,KAAC,OAAD;CAAK,OAAO;EAAE,UAAU;EAAU,cAAc;EAAY,YAAY;EAAU;WAC/E,MAAM,QAAQ,MAAM,GAAG,MAAM,KAAK,SAAS,KAAK,KAAK,CAAC,KAAK,KAAK,GAAG,OAAO;CACvE,CAAA;AAGR,MAAM,eAAe;CACnB,gBAAgB;CAChB,MAAM;CACP;AAED,MAAa,YAAYA,gBAAAA,gBAAkC,WAAW;CACpE,MAAM,QAAQC,kBAAAA,SAAS,aAAa,cAAc,OAAO;CACzD,MAAM,EACJ,UACA,MACA,UACA,OACA,cACA,UACA,QACA,MACA,MACA,gBAAgB,gBAChB,WACA,kBACA,kBACA,UACA,SACA,gBACA,cACA,MACA,aACA,WACA,UAAU,cACV,YACA,QACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAA,GAAA,MAAA,QAA8B,KAAK;CACzC,MAAM,EAAE,oBAAoB,mBAAmBC,gCAAAA,qBAAuC;EACpF;EACA;EACA;EACD,CAAC;CAEF,MAAM,CAAC,QAAQ,aAAA,GAAA,eAAA,iBAAkD;EAC/D;EACA;EACU;EACV,YAAY,WAAW,EAAE,GAAG;EAC7B,CAAC;CAEF,MAAM,WAAW,MAAM,QAAQ,OAAO,GAAG,OAAO,WAAW,IAAI,WAAW;CAE1E,MAAM,cACJ,iBAAA,GAAA,kBAAA,KAACC,oBAAAA,aAAD;EACE,GAAI;EACJ,SAAQ;EACR,eAAe,SAAS,WAAW,EAAE,GAAG,KAAK;EACvC;EACI;EACV,CAAA;CAGJ,MAAM,aAAa,aAAa,YAAY,CAAC;AAE7C,EAAA,GAAA,MAAA,iBAAgB;AACd,MAAK,MAAM,QAAQ,OAAO,IAAI,OAAO,WAAW,KAAM,WAAW,KAC/D,UAAS,WAAW;IAErB,CAAC,OAAO,CAAC;AAEZ,QACE,iBAAA,GAAA,kBAAA,KAACC,mBAAAA,YAAD;EACE,UAAU;EACA;EACF;EACF;EACA;EACN,WAAA,GAAA,eAAA,cAAuB,UAAU,aAAa;EAC9C,UAAU;EACD;EACT,YAAY;aAEV,oBACA,iBAAA,GAAA,kBAAA,KAACC,kBAAAA,WAAD;GACE,WAAW,aAAa;GACV;GACd,gBAAgB;GAChB,aAAa;GACb,oBAAoB;GACpB,GAAI;GACJ,GAAI;GACJ,kBAAiB;GACjB,WAAA;GACA,MAAK;GACL,SAAA;GACA,kBAAkB;GACR;GACJ;GACM;GACJ;GACI;aAEX,CAAC,WACA,iBAAA,GAAA,kBAAA,KAACC,cAAAA,MAAM,aAAP;IACE,kBAAiB;IACjB,YAAY;IACZ,QAAQ;IACI;cAEX;IACiB,CAAA,GAEpB,iBAAA,GAAA,kBAAA,KAAC,gBAAD,EAAgB,OAAO,QAAU,CAAA;GAEzB,CAAA;EAEH,CAAA;EAEf;AAEF,UAAU,UAAUD,kBAAAA,UAAU;AAC9B,UAAU,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.cjs","names":["polymorphicFactory","useProps","useStyles","useMantineTheme","useRandomClassName","parseStyleProps","FLEX_STYLE_PROPS_DATA","InlineStyles","Box","filterProps","classes"],"sources":["../../../src/components/Flex/Flex.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n filterProps,\n InlineStyles,\n MantineSpacing,\n parseStyleProps,\n polymorphicFactory,\n PolymorphicFactory,\n StyleProp,\n StylesApiProps,\n useMantineTheme,\n useProps,\n useRandomClassName,\n useStyles,\n} from '../../core';\nimport { FLEX_STYLE_PROPS_DATA } from './flex-props';\nimport classes from './Flex.module.css';\n\nexport type FlexStylesNames = 'root';\n\nexport interface FlexProps extends BoxProps, StylesApiProps<FlexFactory>, ElementProps<'div'> {\n /** `gap` CSS property */\n gap?: StyleProp<MantineSpacing>;\n\n /** `row-gap` CSS property */\n rowGap?: StyleProp<MantineSpacing>;\n\n /** `column-gap` CSS property */\n columnGap?: StyleProp<MantineSpacing>;\n\n /** `align-items` CSS property */\n align?: StyleProp<React.CSSProperties['alignItems']>;\n\n /** `justify-content` CSS property */\n justify?: StyleProp<React.CSSProperties['justifyContent']>;\n\n /** `flex-wrap` CSS property */\n wrap?: StyleProp<React.CSSProperties['flexWrap']>;\n\n /** `flex-direction` CSS property */\n direction?: StyleProp<React.CSSProperties['flexDirection']>;\n}\n\nexport type FlexFactory = PolymorphicFactory<{\n props: FlexProps;\n defaultRef: HTMLDivElement;\n defaultComponent: 'div';\n stylesNames: FlexStylesNames;\n}>;\n\nexport const Flex = polymorphicFactory<FlexFactory>((_props) => {\n const props = useProps('Flex', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n gap,\n rowGap,\n columnGap,\n align,\n justify,\n wrap,\n direction,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<FlexFactory>({\n name: 'Flex',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n });\n\n const theme = useMantineTheme();\n const responsiveClassName = useRandomClassName();\n const parsedStyleProps = parseStyleProps({\n styleProps: { gap, rowGap, columnGap, align, justify, wrap, direction },\n theme,\n data: FLEX_STYLE_PROPS_DATA,\n });\n\n return (\n <>\n {parsedStyleProps.hasResponsiveStyles && (\n <InlineStyles\n selector={`.${responsiveClassName}`}\n styles={parsedStyleProps.styles}\n media={parsedStyleProps.media}\n />\n )}\n <Box\n {...getStyles('root', {\n className: responsiveClassName,\n style: filterProps(parsedStyleProps.inlineStyles),\n })}\n {...others}\n />\n </>\n );\n});\n\nFlex.classes = classes;\nFlex.displayName = '@mantine/core/Flex';\n"],"mappings":";;;;;;;;;;;;;;;AAoDA,MAAa,OAAOA,4BAAAA,oBAAiC,WAAW;CAC9D,MAAM,QAAQC,kBAAAA,SAAS,QAAQ,MAAM,OAAO;CAC5C,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,KACA,QACA,WACA,OACA,SACA,MACA,WACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAAuB;EACvC,MAAM;EACN,SAAA,oBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,QAAQC,6BAAAA,iBAAiB;CAC/B,MAAM,sBAAsBC,6BAAAA,oBAAoB;CAChD,MAAM,mBAAmBC,0BAAAA,gBAAgB;EACvC,YAAY;GAAE;GAAK;GAAQ;GAAW;GAAO;GAAS;GAAM;GAAW;EACvE;EACA,MAAMC,mBAAAA;EACP,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA,CACG,iBAAiB,uBAChB,iBAAA,GAAA,kBAAA,KAACC,qBAAAA,cAAD;EACE,UAAU,IAAI;EACd,QAAQ,iBAAiB;EACzB,OAAO,iBAAiB;EACxB,CAAA,EAEJ,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,GAAI,UAAU,QAAQ;GACpB,WAAW;GACX,OAAOC,qBAAAA,YAAY,iBAAiB,aAAa;GAClD,CAAC;EACF,GAAI;EACJ,CAAA,CACD,EAAA,CAAA;EAEL;AAEF,KAAK,UAAUC,oBAAAA;AACf,KAAK,cAAc"}
1
+ {"version":3,"file":"Flex.cjs","names":["polymorphicFactory","useProps","useStyles","useMantineTheme","useRandomClassName","parseStyleProps","FLEX_STYLE_PROPS_DATA","InlineStyles","Box","filterProps","classes"],"sources":["../../../src/components/Flex/Flex.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n filterProps,\n InlineStyles,\n MantineSpacing,\n parseStyleProps,\n polymorphicFactory,\n PolymorphicFactory,\n StyleProp,\n StylesApiProps,\n useMantineTheme,\n useProps,\n useRandomClassName,\n useStyles,\n} from '../../core';\nimport { FLEX_STYLE_PROPS_DATA } from './flex-props';\nimport classes from './Flex.module.css';\n\nexport type FlexStylesNames = 'root';\n\nexport interface FlexProps extends BoxProps, StylesApiProps<FlexFactory>, ElementProps<'div'> {\n /** `gap` CSS property */\n gap?: StyleProp<MantineSpacing>;\n\n /** `row-gap` CSS property */\n rowGap?: StyleProp<MantineSpacing>;\n\n /** `column-gap` CSS property */\n columnGap?: StyleProp<MantineSpacing>;\n\n /** `align-items` CSS property */\n align?: StyleProp<React.CSSProperties['alignItems']>;\n\n /** `justify-content` CSS property */\n justify?: StyleProp<React.CSSProperties['justifyContent']>;\n\n /** `flex-wrap` CSS property */\n wrap?: StyleProp<React.CSSProperties['flexWrap']>;\n\n /** `flex-direction` CSS property */\n direction?: StyleProp<React.CSSProperties['flexDirection']>;\n}\n\nexport type FlexFactory = PolymorphicFactory<{\n props: FlexProps;\n defaultRef: HTMLDivElement;\n defaultComponent: 'div';\n stylesNames: FlexStylesNames;\n}>;\n\nexport const Flex = polymorphicFactory<FlexFactory>((_props) => {\n const props = useProps('Flex', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n gap,\n rowGap,\n columnGap,\n align,\n justify,\n wrap,\n direction,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<FlexFactory>({\n name: 'Flex',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n });\n\n const theme = useMantineTheme();\n const responsiveClassName = useRandomClassName();\n const parsedStyleProps = parseStyleProps({\n styleProps: { gap, rowGap, columnGap, align, justify, wrap, direction },\n theme,\n data: FLEX_STYLE_PROPS_DATA,\n });\n\n return (\n <>\n {parsedStyleProps.hasResponsiveStyles && (\n <InlineStyles\n selector={`.${responsiveClassName}`}\n styles={parsedStyleProps.styles}\n media={parsedStyleProps.media}\n />\n )}\n <Box\n {...getStyles('root', {\n className: responsiveClassName,\n style: filterProps(parsedStyleProps.inlineStyles),\n })}\n {...others}\n />\n </>\n );\n});\n\nFlex.classes = classes;\nFlex.displayName = '@mantine/core/Flex';\n\nexport namespace Flex {\n export type Props = FlexProps;\n export type StylesNames = FlexStylesNames;\n export type Factory = FlexFactory;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoDA,MAAa,OAAOA,4BAAAA,oBAAiC,WAAW;CAC9D,MAAM,QAAQC,kBAAAA,SAAS,QAAQ,MAAM,OAAO;CAC5C,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,KACA,QACA,WACA,OACA,SACA,MACA,WACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAAuB;EACvC,MAAM;EACN,SAAA,oBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,QAAQC,6BAAAA,iBAAiB;CAC/B,MAAM,sBAAsBC,6BAAAA,oBAAoB;CAChD,MAAM,mBAAmBC,0BAAAA,gBAAgB;EACvC,YAAY;GAAE;GAAK;GAAQ;GAAW;GAAO;GAAS;GAAM;GAAW;EACvE;EACA,MAAMC,mBAAAA;EACP,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA,CACG,iBAAiB,uBAChB,iBAAA,GAAA,kBAAA,KAACC,qBAAAA,cAAD;EACE,UAAU,IAAI;EACd,QAAQ,iBAAiB;EACzB,OAAO,iBAAiB;EACxB,CAAA,EAEJ,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,GAAI,UAAU,QAAQ;GACpB,WAAW;GACX,OAAOC,qBAAAA,YAAY,iBAAiB,aAAa;GAClD,CAAC;EACF,GAAI;EACJ,CAAA,CACD,EAAA,CAAA;EAEL;AAEF,KAAK,UAAUC,oBAAAA;AACf,KAAK,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingIndicator.cjs","names":["createVarsResolver","factory","useProps","useStyles","useFloatingIndicator","Box","classes"],"sources":["../../../src/components/FloatingIndicator/FloatingIndicator.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useMergedRef, useReducedMotion } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { useFloatingIndicator } from './use-floating-indicator';\nimport classes from './FloatingIndicator.module.css';\n\nexport type FloatingIndicatorStylesNames = 'root';\nexport type FloatingIndicatorCssVariables = {\n root: '--transition-duration';\n};\n\nexport interface FloatingIndicatorProps\n extends BoxProps, StylesApiProps<FloatingIndicatorFactory>, ElementProps<'div'> {\n /** Target element over which the indicator is displayed.\n * The indicator will be positioned to match the target's size and position.\n * */\n target: HTMLElement | null | undefined;\n\n /** Parent container element that must have `position: relative`.\n * The indicator's position is calculated relative to this element.\n * */\n parent: HTMLElement | null | undefined;\n\n /** Transition duration in ms @default 150 */\n transitionDuration?: number | string;\n\n /** Controls whether the indicator should be hidden initially and displayed after the parent's transition ends.\n * Set to `true` when the parent container has CSS transitions (e.g., `transform: scale()`) to prevent\n * the indicator from appearing at the wrong position during the parent's animation.\n * @default false\n * */\n displayAfterTransitionEnd?: boolean;\n\n /** Called when the indicator starts transitioning to a new position */\n onTransitionStart?: () => void;\n\n /** Called when the indicator finishes transitioning to a new position */\n onTransitionEnd?: () => void;\n}\n\nexport type FloatingIndicatorFactory = Factory<{\n props: FloatingIndicatorProps;\n ref: HTMLDivElement;\n stylesNames: FloatingIndicatorStylesNames;\n vars: FloatingIndicatorCssVariables;\n ctx: { shouldReduceMotion: boolean };\n}>;\n\nconst varsResolver = createVarsResolver<FloatingIndicatorFactory>(\n (theme, { transitionDuration }, { shouldReduceMotion }) => {\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion\n ? '0ms'\n : typeof transitionDuration === 'number'\n ? `${transitionDuration}ms`\n : transitionDuration || '150ms';\n\n return {\n root: {\n '--transition-duration': duration,\n },\n };\n }\n);\n\nexport const FloatingIndicator = factory<FloatingIndicatorFactory>((_props) => {\n const props = useProps('FloatingIndicator', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n target,\n parent,\n transitionDuration,\n mod,\n displayAfterTransitionEnd,\n onTransitionStart,\n onTransitionEnd,\n attributes,\n ref,\n ...others\n } = props;\n\n const shouldReduceMotion = useReducedMotion();\n\n const getStyles = useStyles<FloatingIndicatorFactory>({\n name: 'FloatingIndicator',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n stylesCtx: { shouldReduceMotion },\n });\n\n const innerRef = useRef<HTMLDivElement>(null);\n const { initialized, hidden } = useFloatingIndicator({\n target,\n parent,\n ref: innerRef,\n displayAfterTransitionEnd,\n onTransitionStart,\n onTransitionEnd,\n });\n\n const mergedRef = useMergedRef(ref, innerRef);\n\n if (!target || !parent) {\n return null;\n }\n\n return (\n <Box ref={mergedRef} mod={[{ initialized, hidden }, mod]} {...getStyles('root')} {...others} />\n );\n});\n\nFloatingIndicator.displayName = '@mantine/core/FloatingIndicator';\nFloatingIndicator.classes = classes;\nFloatingIndicator.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;AA0DA,MAAM,eAAeA,6BAAAA,oBAClB,OAAO,EAAE,sBAAsB,EAAE,yBAAyB;CAEzD,MAAM,YADe,MAAM,uBAAuB,qBAAqB,SAEnE,QACA,OAAO,uBAAuB,WAC5B,GAAG,mBAAmB,MACtB,sBAAsB;AAE5B,QAAO,EACL,MAAM,EACJ,yBAAyB,UAC1B,EACF;EAEJ;AAED,MAAa,oBAAoBC,gBAAAA,SAAmC,WAAW;CAC7E,MAAM,QAAQC,kBAAAA,SAAS,qBAAqB,MAAM,OAAO;CACzD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,QACA,QACA,oBACA,KACA,2BACA,mBACA,iBACA,YACA,KACA,GAAG,WACD;CAIJ,MAAM,YAAYC,mBAAAA,UAAoC;EACpD,MAAM;EACN,SAAA,iCAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW,EAAE,qBAAA,GAAA,eAAA,mBAd8B,EAcV;EAClC,CAAC;CAEF,MAAM,YAAA,GAAA,MAAA,QAAkC,KAAK;CAC7C,MAAM,EAAE,aAAa,WAAWC,+BAAAA,qBAAqB;EACnD;EACA;EACA,KAAK;EACL;EACA;EACA;EACD,CAAC;CAEF,MAAM,aAAA,GAAA,eAAA,cAAyB,KAAK,SAAS;AAE7C,KAAI,CAAC,UAAU,CAAC,OACd,QAAO;AAGT,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EAAK,KAAK;EAAW,KAAK,CAAC;GAAE;GAAa;GAAQ,EAAE,IAAI;EAAE,GAAI,UAAU,OAAO;EAAE,GAAI;EAAU,CAAA;EAEjG;AAEF,kBAAkB,cAAc;AAChC,kBAAkB,UAAUC,iCAAAA;AAC5B,kBAAkB,eAAe"}
1
+ {"version":3,"file":"FloatingIndicator.cjs","names":["createVarsResolver","factory","useProps","useStyles","useFloatingIndicator","Box","classes"],"sources":["../../../src/components/FloatingIndicator/FloatingIndicator.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useMergedRef, useReducedMotion } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { useFloatingIndicator } from './use-floating-indicator';\nimport classes from './FloatingIndicator.module.css';\n\nexport type FloatingIndicatorStylesNames = 'root';\nexport type FloatingIndicatorCssVariables = {\n root: '--transition-duration';\n};\n\nexport interface FloatingIndicatorProps\n extends BoxProps, StylesApiProps<FloatingIndicatorFactory>, ElementProps<'div'> {\n /** Target element over which the indicator is displayed.\n * The indicator will be positioned to match the target's size and position.\n * */\n target: HTMLElement | null | undefined;\n\n /** Parent container element that must have `position: relative`.\n * The indicator's position is calculated relative to this element.\n * */\n parent: HTMLElement | null | undefined;\n\n /** Transition duration in ms @default 150 */\n transitionDuration?: number | string;\n\n /** Controls whether the indicator should be hidden initially and displayed after the parent's transition ends.\n * Set to `true` when the parent container has CSS transitions (e.g., `transform: scale()`) to prevent\n * the indicator from appearing at the wrong position during the parent's animation.\n * @default false\n * */\n displayAfterTransitionEnd?: boolean;\n\n /** Called when the indicator starts transitioning to a new position */\n onTransitionStart?: () => void;\n\n /** Called when the indicator finishes transitioning to a new position */\n onTransitionEnd?: () => void;\n}\n\nexport type FloatingIndicatorFactory = Factory<{\n props: FloatingIndicatorProps;\n ref: HTMLDivElement;\n stylesNames: FloatingIndicatorStylesNames;\n vars: FloatingIndicatorCssVariables;\n ctx: { shouldReduceMotion: boolean };\n}>;\n\nconst varsResolver = createVarsResolver<FloatingIndicatorFactory>(\n (theme, { transitionDuration }, { shouldReduceMotion }) => {\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion\n ? '0ms'\n : typeof transitionDuration === 'number'\n ? `${transitionDuration}ms`\n : transitionDuration || '150ms';\n\n return {\n root: {\n '--transition-duration': duration,\n },\n };\n }\n);\n\nexport const FloatingIndicator = factory<FloatingIndicatorFactory>((_props) => {\n const props = useProps('FloatingIndicator', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n target,\n parent,\n transitionDuration,\n mod,\n displayAfterTransitionEnd,\n onTransitionStart,\n onTransitionEnd,\n attributes,\n ref,\n ...others\n } = props;\n\n const shouldReduceMotion = useReducedMotion();\n\n const getStyles = useStyles<FloatingIndicatorFactory>({\n name: 'FloatingIndicator',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n stylesCtx: { shouldReduceMotion },\n });\n\n const innerRef = useRef<HTMLDivElement>(null);\n const { initialized, hidden } = useFloatingIndicator({\n target,\n parent,\n ref: innerRef,\n displayAfterTransitionEnd,\n onTransitionStart,\n onTransitionEnd,\n });\n\n const mergedRef = useMergedRef(ref, innerRef);\n\n if (!target || !parent) {\n return null;\n }\n\n return (\n <Box ref={mergedRef} mod={[{ initialized, hidden }, mod]} {...getStyles('root')} {...others} />\n );\n});\n\nFloatingIndicator.displayName = '@mantine/core/FloatingIndicator';\nFloatingIndicator.classes = classes;\nFloatingIndicator.varsResolver = varsResolver;\n\nexport namespace FloatingIndicator {\n export type Props = FloatingIndicatorProps;\n export type StylesNames = FloatingIndicatorStylesNames;\n export type CssVariables = FloatingIndicatorCssVariables;\n export type Factory = FloatingIndicatorFactory;\n}\n"],"mappings":";;;;;;;;;;;;;AA0DA,MAAM,eAAeA,6BAAAA,oBAClB,OAAO,EAAE,sBAAsB,EAAE,yBAAyB;CAEzD,MAAM,YADe,MAAM,uBAAuB,qBAAqB,SAEnE,QACA,OAAO,uBAAuB,WAC5B,GAAG,mBAAmB,MACtB,sBAAsB;AAE5B,QAAO,EACL,MAAM,EACJ,yBAAyB,UAC1B,EACF;EAEJ;AAED,MAAa,oBAAoBC,gBAAAA,SAAmC,WAAW;CAC7E,MAAM,QAAQC,kBAAAA,SAAS,qBAAqB,MAAM,OAAO;CACzD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,QACA,QACA,oBACA,KACA,2BACA,mBACA,iBACA,YACA,KACA,GAAG,WACD;CAIJ,MAAM,YAAYC,mBAAAA,UAAoC;EACpD,MAAM;EACN,SAAA,iCAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW,EAAE,qBAAA,GAAA,eAAA,mBAd8B,EAcV;EAClC,CAAC;CAEF,MAAM,YAAA,GAAA,MAAA,QAAkC,KAAK;CAC7C,MAAM,EAAE,aAAa,WAAWC,+BAAAA,qBAAqB;EACnD;EACA;EACA,KAAK;EACL;EACA;EACA;EACD,CAAC;CAEF,MAAM,aAAA,GAAA,eAAA,cAAyB,KAAK,SAAS;AAE7C,KAAI,CAAC,UAAU,CAAC,OACd,QAAO;AAGT,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EAAK,KAAK;EAAW,KAAK,CAAC;GAAE;GAAa;GAAQ,EAAE,IAAI;EAAE,GAAI,UAAU,OAAO;EAAE,GAAI;EAAU,CAAA;EAEjG;AAEF,kBAAkB,cAAc;AAChC,kBAAkB,UAAUC,iCAAAA;AAC5B,kBAAkB,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingWindow.cjs","names":["getDefaultZIndex","factory","useProps","useStyles","OptionalPortal","Paper","classes"],"sources":["../../../src/components/FloatingWindow/FloatingWindow.tsx"],"sourcesContent":["import { useImperativeHandle } from 'react';\nimport {\n SetFloatingWindowPosition,\n useFloatingWindow,\n UseFloatingWindowOptions,\n useMergedRef,\n} from '@mantine/hooks';\nimport {\n BoxProps,\n ElementProps,\n factory,\n Factory,\n getDefaultZIndex,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { Paper, PaperBaseProps } from '../Paper';\nimport { OptionalPortal, PortalProps } from '../Portal';\nimport classes from './FloatingWindow.module.css';\n\nexport type FloatingWindowStylesNames = 'root';\n\nexport interface FloatingWindowProps\n extends\n UseFloatingWindowOptions,\n PaperBaseProps,\n BoxProps,\n StylesApiProps<FloatingWindowFactory>,\n ElementProps<'div', keyof UseFloatingWindowOptions> {\n /** Assigns ref to set position programmatically */\n setPositionRef?: React.RefObject<SetFloatingWindowPosition | null>;\n\n /** Determines whether the window should be rendered inside `Portal` @default true */\n withinPortal?: boolean;\n\n /** Props passed down to `Portal` component */\n portalProps?: Omit<PortalProps, 'children'>;\n\n /** `z-index` of the root element @default 400 */\n zIndex?: React.CSSProperties['zIndex'];\n}\n\nexport type FloatingWindowFactory = Factory<{\n props: FloatingWindowProps;\n ref: HTMLDivElement;\n stylesNames: FloatingWindowStylesNames;\n}>;\n\nconst defaultProps = {\n constrainToViewport: true,\n zIndex: getDefaultZIndex('overlay'),\n} satisfies Partial<FloatingWindowProps>;\n\nexport const FloatingWindow = factory<FloatingWindowFactory>((_props) => {\n const props = useProps('FloatingWindow', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n mod,\n enabled,\n constrainToViewport,\n constrainOffset,\n dragHandleSelector,\n excludeDragHandleSelector,\n axis,\n initialPosition,\n onPositionChange,\n onDragStart,\n onDragEnd,\n setPositionRef,\n withinPortal,\n portalProps,\n zIndex,\n ref,\n ...others\n } = props;\n\n const getStyles = useStyles<FloatingWindowFactory>({\n name: 'FloatingWindow',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n\n const floatingWindow = useFloatingWindow({\n enabled,\n constrainToViewport,\n constrainOffset,\n dragHandleSelector,\n excludeDragHandleSelector,\n axis,\n initialPosition,\n onPositionChange,\n onDragStart,\n onDragEnd,\n });\n\n useImperativeHandle(setPositionRef, () => floatingWindow.setPosition, [\n floatingWindow.setPosition,\n ]);\n\n return (\n <OptionalPortal withinPortal={withinPortal} {...portalProps}>\n <Paper\n ref={useMergedRef(ref, floatingWindow.ref)}\n mod={[{ dragging: floatingWindow.isDragging }, mod]}\n {...getStyles('root')}\n {...others}\n __vars={{ '--floating-window-z-index': zIndex.toString() }}\n />\n </OptionalPortal>\n );\n});\n\nFloatingWindow.displayName = '@mantine/core/FloatingWindow';\nFloatingWindow.classes = classes;\n"],"mappings":";;;;;;;;;;;;;AAiDA,MAAM,eAAe;CACnB,qBAAqB;CACrB,QAAQA,4BAAAA,iBAAiB,UAAU;CACpC;AAED,MAAa,iBAAiBC,gBAAAA,SAAgC,WAAW;CACvE,MAAM,QAAQC,kBAAAA,SAAS,kBAAkB,cAAc,OAAO;CAC9D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,KACA,SACA,qBACA,iBACA,oBACA,2BACA,MACA,iBACA,kBACA,aACA,WACA,gBACA,cACA,aACA,QACA,KACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAAiC;EACjD,MAAM;EACN,SAAA,8BAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,kBAAA,GAAA,eAAA,mBAAmC;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,EAAA,GAAA,MAAA,qBAAoB,sBAAsB,eAAe,aAAa,CACpE,eAAe,YAChB,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,uBAAAA,gBAAD;EAA8B;EAAc,GAAI;YAC9C,iBAAA,GAAA,kBAAA,KAACC,cAAAA,OAAD;GACE,MAAA,GAAA,eAAA,cAAkB,KAAK,eAAe,IAAI;GAC1C,KAAK,CAAC,EAAE,UAAU,eAAe,YAAY,EAAE,IAAI;GACnD,GAAI,UAAU,OAAO;GACrB,GAAI;GACJ,QAAQ,EAAE,6BAA6B,OAAO,UAAU,EAAE;GAC1D,CAAA;EACa,CAAA;EAEnB;AAEF,eAAe,cAAc;AAC7B,eAAe,UAAUC,8BAAAA"}
1
+ {"version":3,"file":"FloatingWindow.cjs","names":["getDefaultZIndex","factory","useProps","useStyles","OptionalPortal","Paper","classes"],"sources":["../../../src/components/FloatingWindow/FloatingWindow.tsx"],"sourcesContent":["import { useImperativeHandle } from 'react';\nimport {\n SetFloatingWindowPosition,\n useFloatingWindow,\n UseFloatingWindowOptions,\n useMergedRef,\n} from '@mantine/hooks';\nimport {\n BoxProps,\n ElementProps,\n factory,\n Factory,\n getDefaultZIndex,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { Paper, PaperBaseProps } from '../Paper';\nimport { OptionalPortal, PortalProps } from '../Portal';\nimport classes from './FloatingWindow.module.css';\n\nexport type FloatingWindowStylesNames = 'root';\n\nexport interface FloatingWindowProps\n extends\n UseFloatingWindowOptions,\n PaperBaseProps,\n BoxProps,\n StylesApiProps<FloatingWindowFactory>,\n ElementProps<'div', keyof UseFloatingWindowOptions> {\n /** Assigns ref to set position programmatically */\n setPositionRef?: React.RefObject<SetFloatingWindowPosition | null>;\n\n /** Determines whether the window should be rendered inside `Portal` @default true */\n withinPortal?: boolean;\n\n /** Props passed down to `Portal` component */\n portalProps?: Omit<PortalProps, 'children'>;\n\n /** `z-index` of the root element @default 400 */\n zIndex?: React.CSSProperties['zIndex'];\n}\n\nexport type FloatingWindowFactory = Factory<{\n props: FloatingWindowProps;\n ref: HTMLDivElement;\n stylesNames: FloatingWindowStylesNames;\n}>;\n\nconst defaultProps = {\n constrainToViewport: true,\n zIndex: getDefaultZIndex('overlay'),\n} satisfies Partial<FloatingWindowProps>;\n\nexport const FloatingWindow = factory<FloatingWindowFactory>((_props) => {\n const props = useProps('FloatingWindow', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n mod,\n enabled,\n constrainToViewport,\n constrainOffset,\n dragHandleSelector,\n excludeDragHandleSelector,\n axis,\n initialPosition,\n onPositionChange,\n onDragStart,\n onDragEnd,\n setPositionRef,\n withinPortal,\n portalProps,\n zIndex,\n ref,\n ...others\n } = props;\n\n const getStyles = useStyles<FloatingWindowFactory>({\n name: 'FloatingWindow',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n\n const floatingWindow = useFloatingWindow({\n enabled,\n constrainToViewport,\n constrainOffset,\n dragHandleSelector,\n excludeDragHandleSelector,\n axis,\n initialPosition,\n onPositionChange,\n onDragStart,\n onDragEnd,\n });\n\n useImperativeHandle(setPositionRef, () => floatingWindow.setPosition, [\n floatingWindow.setPosition,\n ]);\n\n return (\n <OptionalPortal withinPortal={withinPortal} {...portalProps}>\n <Paper\n ref={useMergedRef(ref, floatingWindow.ref)}\n mod={[{ dragging: floatingWindow.isDragging }, mod]}\n {...getStyles('root')}\n {...others}\n __vars={{ '--floating-window-z-index': zIndex.toString() }}\n />\n </OptionalPortal>\n );\n});\n\nFloatingWindow.displayName = '@mantine/core/FloatingWindow';\nFloatingWindow.classes = classes;\n\nexport namespace FloatingWindow {\n export type Props = FloatingWindowProps;\n export type StylesNames = FloatingWindowStylesNames;\n export type Factory = FloatingWindowFactory;\n}\n"],"mappings":";;;;;;;;;;;;;AAiDA,MAAM,eAAe;CACnB,qBAAqB;CACrB,QAAQA,4BAAAA,iBAAiB,UAAU;CACpC;AAED,MAAa,iBAAiBC,gBAAAA,SAAgC,WAAW;CACvE,MAAM,QAAQC,kBAAAA,SAAS,kBAAkB,cAAc,OAAO;CAC9D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,KACA,SACA,qBACA,iBACA,oBACA,2BACA,MACA,iBACA,kBACA,aACA,WACA,gBACA,cACA,aACA,QACA,KACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAAiC;EACjD,MAAM;EACN,SAAA,8BAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,kBAAA,GAAA,eAAA,mBAAmC;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,EAAA,GAAA,MAAA,qBAAoB,sBAAsB,eAAe,aAAa,CACpE,eAAe,YAChB,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,uBAAAA,gBAAD;EAA8B;EAAc,GAAI;YAC9C,iBAAA,GAAA,kBAAA,KAACC,cAAAA,OAAD;GACE,MAAA,GAAA,eAAA,cAAkB,KAAK,eAAe,IAAI;GAC1C,KAAK,CAAC,EAAE,UAAU,eAAe,YAAY,EAAE,IAAI;GACnD,GAAI,UAAU,OAAO;GACrB,GAAI;GACJ,QAAQ,EAAE,6BAA6B,OAAO,UAAU,EAAE;GAC1D,CAAA;EACa,CAAA;EAEnB;AAEF,eAAe,cAAc;AAC7B,eAAe,UAAUC,8BAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.cjs","names":["createVarsResolver","factory","useProps","useStyles","useRandomClassName","GridProvider","GridVariables","Box","classes","GridCol"],"sources":["../../../src/components/Grid/Grid.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n MantineSpacing,\n StyleProp,\n StylesApiProps,\n useProps,\n useRandomClassName,\n useStyles,\n} from '../../core';\nimport { GridBreakpoints, GridProvider } from './Grid.context';\nimport { GridCol } from './GridCol/GridCol';\nimport { GridVariables } from './GridVariables';\nimport classes from './Grid.module.css';\n\nexport type GridStylesNames = 'root' | 'col' | 'inner' | 'container';\nexport type GridCssVariables = {\n root: '--grid-justify' | '--grid-align' | '--grid-overflow';\n};\n\nexport interface GridProps extends BoxProps, StylesApiProps<GridFactory>, ElementProps<'div'> {\n /** Gap between columns and rows, key of `theme.spacing` or any valid CSS value @default 'md' */\n gap?: StyleProp<MantineSpacing>;\n\n /** Row gap, overrides `gap` for vertical spacing */\n rowGap?: StyleProp<MantineSpacing>;\n\n /** Column gap, overrides `gap` for horizontal spacing */\n columnGap?: StyleProp<MantineSpacing>;\n\n /** If set, columns in the last row expand to fill all available space @default false */\n grow?: boolean;\n\n /** Sets `justify-content` @default flex-start */\n justify?: React.CSSProperties['justifyContent'];\n\n /** Sets `align-items` @default stretch */\n align?: React.CSSProperties['alignItems'];\n\n /** Number of columns in each row @default 12 */\n columns?: number;\n\n /** Sets `overflow` CSS property on the root element @default 'visible' */\n overflow?: React.CSSProperties['overflow'];\n\n /** Type of queries used for responsive styles @default 'media' */\n type?: 'media' | 'container';\n\n /** Breakpoints values, only used with `type=\"container\"` */\n breakpoints?: GridBreakpoints;\n}\n\nexport type GridFactory = Factory<{\n props: GridProps;\n ref: HTMLDivElement;\n stylesNames: GridStylesNames;\n vars: GridCssVariables;\n staticComponents: {\n Col: typeof GridCol;\n };\n}>;\n\nconst defaultProps = {\n gap: 'md',\n columns: 12,\n} satisfies Partial<GridProps>;\n\nconst varsResolver = createVarsResolver<GridFactory>((_, { justify, align, overflow }) => ({\n root: {\n '--grid-justify': justify,\n '--grid-align': align,\n '--grid-overflow': overflow,\n },\n}));\n\nexport const Grid = factory<GridFactory>((_props) => {\n const props = useProps('Grid', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n grow,\n gap,\n rowGap,\n columnGap,\n columns,\n align,\n justify,\n children,\n breakpoints,\n type,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<GridFactory>({\n name: 'Grid',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const responsiveClassName = useRandomClassName();\n\n if (type === 'container' && breakpoints) {\n return (\n <GridProvider value={{ getStyles, grow, columns, breakpoints, type }}>\n <GridVariables selector={`.${responsiveClassName}`} {...props} />\n <div {...getStyles('container')}>\n <Box {...getStyles('root', { className: responsiveClassName })} {...others}>\n <div {...getStyles('inner')}>{children}</div>\n </Box>\n </div>\n </GridProvider>\n );\n }\n\n return (\n <GridProvider value={{ getStyles, grow, columns, breakpoints, type }}>\n <GridVariables selector={`.${responsiveClassName}`} {...props} />\n <Box {...getStyles('root', { className: responsiveClassName })} {...others}>\n <div {...getStyles('inner')}>{children}</div>\n </Box>\n </GridProvider>\n );\n});\n\nGrid.classes = classes;\nGrid.varsResolver = varsResolver;\nGrid.displayName = '@mantine/core/Grid';\nGrid.Col = GridCol;\n"],"mappings":";;;;;;;;;;;;;;AAkEA,MAAM,eAAe;CACnB,KAAK;CACL,SAAS;CACV;AAED,MAAM,eAAeA,6BAAAA,oBAAiC,GAAG,EAAE,SAAS,OAAO,gBAAgB,EACzF,MAAM;CACJ,kBAAkB;CAClB,gBAAgB;CAChB,mBAAmB;CACpB,EACF,EAAE;AAEH,MAAa,OAAOC,gBAAAA,SAAsB,WAAW;CACnD,MAAM,QAAQC,kBAAAA,SAAS,QAAQ,cAAc,OAAO;CACpD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,KACA,QACA,WACA,SACA,OACA,SACA,UACA,aACA,MACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAAuB;EACvC,MAAM;EACN,SAAA,oBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,sBAAsBC,6BAAAA,oBAAoB;AAEhD,KAAI,SAAS,eAAe,YAC1B,QACE,iBAAA,GAAA,kBAAA,MAACC,qBAAAA,cAAD;EAAc,OAAO;GAAE;GAAW;GAAM;GAAS;GAAa;GAAM;YAApE,CACE,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,eAAD;GAAe,UAAU,IAAI;GAAuB,GAAI;GAAS,CAAA,EACjE,iBAAA,GAAA,kBAAA,KAAC,OAAD;GAAK,GAAI,UAAU,YAAY;aAC7B,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;IAAK,GAAI,UAAU,QAAQ,EAAE,WAAW,qBAAqB,CAAC;IAAE,GAAI;cAClE,iBAAA,GAAA,kBAAA,KAAC,OAAD;KAAK,GAAI,UAAU,QAAQ;KAAG;KAAe,CAAA;IACzC,CAAA;GACF,CAAA,CACO;;AAInB,QACE,iBAAA,GAAA,kBAAA,MAACF,qBAAAA,cAAD;EAAc,OAAO;GAAE;GAAW;GAAM;GAAS;GAAa;GAAM;YAApE,CACE,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,eAAD;GAAe,UAAU,IAAI;GAAuB,GAAI;GAAS,CAAA,EACjE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;GAAK,GAAI,UAAU,QAAQ,EAAE,WAAW,qBAAqB,CAAC;GAAE,GAAI;aAClE,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,GAAI,UAAU,QAAQ;IAAG;IAAe,CAAA;GACzC,CAAA,CACO;;EAEjB;AAEF,KAAK,UAAUC,oBAAAA;AACf,KAAK,eAAe;AACpB,KAAK,cAAc;AACnB,KAAK,MAAMC,gBAAAA"}
1
+ {"version":3,"file":"Grid.cjs","names":["createVarsResolver","factory","useProps","useStyles","useRandomClassName","GridProvider","GridVariables","Box","classes","GridCol"],"sources":["../../../src/components/Grid/Grid.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n MantineSpacing,\n StyleProp,\n StylesApiProps,\n useProps,\n useRandomClassName,\n useStyles,\n} from '../../core';\nimport { GridBreakpoints, GridProvider, type GridContextValue } from './Grid.context';\nimport { GridCol, type GridColProps } from './GridCol/GridCol';\nimport { GridVariables } from './GridVariables';\nimport classes from './Grid.module.css';\nexport type GridStylesNames = 'root' | 'col' | 'inner' | 'container';\nexport type GridCssVariables = {\n root: '--grid-justify' | '--grid-align' | '--grid-overflow';\n};\n\nexport interface GridProps extends BoxProps, StylesApiProps<GridFactory>, ElementProps<'div'> {\n /** Gap between columns and rows, key of `theme.spacing` or any valid CSS value @default 'md' */\n gap?: StyleProp<MantineSpacing>;\n\n /** Row gap, overrides `gap` for vertical spacing */\n rowGap?: StyleProp<MantineSpacing>;\n\n /** Column gap, overrides `gap` for horizontal spacing */\n columnGap?: StyleProp<MantineSpacing>;\n\n /** If set, columns in the last row expand to fill all available space @default false */\n grow?: boolean;\n\n /** Sets `justify-content` @default flex-start */\n justify?: React.CSSProperties['justifyContent'];\n\n /** Sets `align-items` @default stretch */\n align?: React.CSSProperties['alignItems'];\n\n /** Number of columns in each row @default 12 */\n columns?: number;\n\n /** Sets `overflow` CSS property on the root element @default 'visible' */\n overflow?: React.CSSProperties['overflow'];\n\n /** Type of queries used for responsive styles @default 'media' */\n type?: 'media' | 'container';\n\n /** Breakpoints values, only used with `type=\"container\"` */\n breakpoints?: GridBreakpoints;\n}\n\nexport type GridFactory = Factory<{\n props: GridProps;\n ref: HTMLDivElement;\n stylesNames: GridStylesNames;\n vars: GridCssVariables;\n staticComponents: {\n Col: typeof GridCol;\n };\n}>;\n\nconst defaultProps = {\n gap: 'md',\n columns: 12,\n} satisfies Partial<GridProps>;\n\nconst varsResolver = createVarsResolver<GridFactory>((_, { justify, align, overflow }) => ({\n root: {\n '--grid-justify': justify,\n '--grid-align': align,\n '--grid-overflow': overflow,\n },\n}));\n\nexport const Grid = factory<GridFactory>((_props) => {\n const props = useProps('Grid', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n grow,\n gap,\n rowGap,\n columnGap,\n columns,\n align,\n justify,\n children,\n breakpoints,\n type,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<GridFactory>({\n name: 'Grid',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const responsiveClassName = useRandomClassName();\n\n if (type === 'container' && breakpoints) {\n return (\n <GridProvider value={{ getStyles, grow, columns, breakpoints, type }}>\n <GridVariables selector={`.${responsiveClassName}`} {...props} />\n <div {...getStyles('container')}>\n <Box {...getStyles('root', { className: responsiveClassName })} {...others}>\n <div {...getStyles('inner')}>{children}</div>\n </Box>\n </div>\n </GridProvider>\n );\n }\n\n return (\n <GridProvider value={{ getStyles, grow, columns, breakpoints, type }}>\n <GridVariables selector={`.${responsiveClassName}`} {...props} />\n <Box {...getStyles('root', { className: responsiveClassName })} {...others}>\n <div {...getStyles('inner')}>{children}</div>\n </Box>\n </GridProvider>\n );\n});\n\nGrid.classes = classes;\nGrid.varsResolver = varsResolver;\nGrid.displayName = '@mantine/core/Grid';\nGrid.Col = GridCol;\n\nexport namespace Grid {\n export type Props = GridProps;\n export type Factory = GridFactory;\n export type StylesNames = GridStylesNames;\n export type CssVariables = GridCssVariables;\n export type ColProps = GridColProps;\n export type ContextValue = GridContextValue;\n\n export namespace Col {\n export type Props = GridColProps;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAiEA,MAAM,eAAe;CACnB,KAAK;CACL,SAAS;CACV;AAED,MAAM,eAAeA,6BAAAA,oBAAiC,GAAG,EAAE,SAAS,OAAO,gBAAgB,EACzF,MAAM;CACJ,kBAAkB;CAClB,gBAAgB;CAChB,mBAAmB;CACpB,EACF,EAAE;AAEH,MAAa,OAAOC,gBAAAA,SAAsB,WAAW;CACnD,MAAM,QAAQC,kBAAAA,SAAS,QAAQ,cAAc,OAAO;CACpD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,KACA,QACA,WACA,SACA,OACA,SACA,UACA,aACA,MACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAAuB;EACvC,MAAM;EACN,SAAA,oBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,sBAAsBC,6BAAAA,oBAAoB;AAEhD,KAAI,SAAS,eAAe,YAC1B,QACE,iBAAA,GAAA,kBAAA,MAACC,qBAAAA,cAAD;EAAc,OAAO;GAAE;GAAW;GAAM;GAAS;GAAa;GAAM;YAApE,CACE,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,eAAD;GAAe,UAAU,IAAI;GAAuB,GAAI;GAAS,CAAA,EACjE,iBAAA,GAAA,kBAAA,KAAC,OAAD;GAAK,GAAI,UAAU,YAAY;aAC7B,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;IAAK,GAAI,UAAU,QAAQ,EAAE,WAAW,qBAAqB,CAAC;IAAE,GAAI;cAClE,iBAAA,GAAA,kBAAA,KAAC,OAAD;KAAK,GAAI,UAAU,QAAQ;KAAG;KAAe,CAAA;IACzC,CAAA;GACF,CAAA,CACO;;AAInB,QACE,iBAAA,GAAA,kBAAA,MAACF,qBAAAA,cAAD;EAAc,OAAO;GAAE;GAAW;GAAM;GAAS;GAAa;GAAM;YAApE,CACE,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,eAAD;GAAe,UAAU,IAAI;GAAuB,GAAI;GAAS,CAAA,EACjE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;GAAK,GAAI,UAAU,QAAQ,EAAE,WAAW,qBAAqB,CAAC;GAAE,GAAI;aAClE,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,GAAI,UAAU,QAAQ;IAAG;IAAe,CAAA;GACzC,CAAA,CACO;;EAEjB;AAEF,KAAK,UAAUC,oBAAAA;AACf,KAAK,eAAe;AACpB,KAAK,cAAc;AACnB,KAAK,MAAMC,gBAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Group.cjs","names":["createVarsResolver","getSpacing","factory","useProps","filterFalsyChildren","Box","useStyles","classes"],"sources":["../../../src/components/Group/Group.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 { filterFalsyChildren } from './filter-falsy-children/filter-falsy-children';\nimport classes from './Group.module.css';\n\nexport type GroupStylesNames = 'root';\nexport type GroupCssVariables = {\n root:\n | '--group-gap'\n | '--group-align'\n | '--group-justify'\n | '--group-wrap'\n | '--group-child-width';\n};\n\nexport interface GroupStylesCtx {\n childWidth: string;\n}\n\nexport interface GroupProps extends BoxProps, StylesApiProps<GroupFactory>, ElementProps<'div'> {\n __size?: any;\n\n /** Controls `justify-content` CSS property @default 'flex-start' */\n justify?: React.CSSProperties['justifyContent'];\n\n /** Controls `align-items` CSS property @default 'center' */\n align?: React.CSSProperties['alignItems'];\n\n /** Controls `flex-wrap` CSS property @default 'wrap' */\n wrap?: React.CSSProperties['flexWrap'];\n\n /** Key of `theme.spacing` or any valid CSS value for `gap`, numbers are converted to rem @default 'md' */\n gap?: MantineSpacing;\n\n /** Determines whether each child element should have `flex-grow: 1` style @default false */\n grow?: boolean;\n\n /** Determines whether children should take only dedicated amount of space (`max-width` style is set based on the number of children) @default true */\n preventGrowOverflow?: boolean;\n}\n\nexport type GroupFactory = Factory<{\n props: GroupProps;\n ref: HTMLDivElement;\n stylesNames: GroupStylesNames;\n vars: GroupCssVariables;\n ctx: GroupStylesCtx;\n}>;\n\nconst defaultProps = {\n preventGrowOverflow: true,\n gap: 'md',\n align: 'center',\n justify: 'flex-start',\n wrap: 'wrap',\n} satisfies Partial<GroupProps>;\n\nconst varsResolver = createVarsResolver<GroupFactory>(\n (_, { grow, preventGrowOverflow, gap, align, justify, wrap }, { childWidth }) => ({\n root: {\n '--group-child-width': grow && preventGrowOverflow ? childWidth : undefined,\n '--group-gap': getSpacing(gap),\n '--group-align': align,\n '--group-justify': justify,\n '--group-wrap': wrap,\n },\n })\n);\n\nexport const Group = factory<GroupFactory>((_props) => {\n const props = useProps('Group', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n children,\n gap,\n align,\n justify,\n wrap,\n grow,\n preventGrowOverflow,\n vars,\n variant,\n __size,\n mod,\n attributes,\n ...others\n } = props;\n\n const filteredChildren = filterFalsyChildren(children);\n const childrenCount = filteredChildren.length;\n const resolvedGap = getSpacing(gap ?? 'md');\n const childWidth = `calc(${\n 100 / childrenCount\n }% - (${resolvedGap} - ${resolvedGap} / ${childrenCount}))`;\n\n const stylesCtx: GroupStylesCtx = { childWidth };\n\n const getStyles = useStyles<GroupFactory>({\n name: 'Group',\n props,\n stylesCtx,\n className,\n style,\n classes,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <Box {...getStyles('root')} variant={variant} mod={[{ grow }, mod]} size={__size} {...others}>\n {filteredChildren}\n </Box>\n );\n});\n\nGroup.classes = classes;\nGroup.varsResolver = varsResolver;\nGroup.displayName = '@mantine/core/Group';\n"],"mappings":";;;;;;;;;;;;AA4DA,MAAM,eAAe;CACnB,qBAAqB;CACrB,KAAK;CACL,OAAO;CACP,SAAS;CACT,MAAM;CACP;AAED,MAAM,eAAeA,6BAAAA,oBAClB,GAAG,EAAE,MAAM,qBAAqB,KAAK,OAAO,SAAS,QAAQ,EAAE,kBAAkB,EAChF,MAAM;CACJ,uBAAuB,QAAQ,sBAAsB,aAAa,KAAA;CAClE,eAAeC,iBAAAA,WAAW,IAAI;CAC9B,iBAAiB;CACjB,mBAAmB;CACnB,gBAAgB;CACjB,EACF,EACF;AAED,MAAa,QAAQC,gBAAAA,SAAuB,WAAW;CACrD,MAAM,QAAQC,kBAAAA,SAAS,SAAS,cAAc,OAAO;CACrD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,UACA,KACA,OACA,SACA,MACA,MACA,qBACA,MACA,SACA,QACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,mBAAmBC,8BAAAA,oBAAoB,SAAS;CACtD,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,cAAcH,iBAAAA,WAAW,OAAO,KAAK;AAsB3C,QACE,iBAAA,GAAA,kBAAA,KAACI,YAAAA,KAAD;EAAK,GAhBWC,mBAAAA,UAAwB;GACxC,MAAM;GACN;GACA,WALgC,EAAE,YAJjB,QACjB,MAAM,cACP,OAAO,YAAY,KAAK,YAAY,KAAK,cAAc,KAER;GAM9C;GACA;GACA,SAAA,qBAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,CAGmB,OAAO;EAAW;EAAS,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI;EAAE,MAAM;EAAQ,GAAI;YACnF;EACG,CAAA;EAER;AAEF,MAAM,UAAUC,qBAAAA;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc"}
1
+ {"version":3,"file":"Group.cjs","names":["createVarsResolver","getSpacing","factory","useProps","filterFalsyChildren","Box","useStyles","classes"],"sources":["../../../src/components/Group/Group.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 { filterFalsyChildren } from './filter-falsy-children/filter-falsy-children';\nimport classes from './Group.module.css';\n\nexport type GroupStylesNames = 'root';\nexport type GroupCssVariables = {\n root:\n | '--group-gap'\n | '--group-align'\n | '--group-justify'\n | '--group-wrap'\n | '--group-child-width';\n};\n\nexport interface GroupStylesCtx {\n childWidth: string;\n}\n\nexport interface GroupProps extends BoxProps, StylesApiProps<GroupFactory>, ElementProps<'div'> {\n __size?: any;\n\n /** Controls `justify-content` CSS property @default 'flex-start' */\n justify?: React.CSSProperties['justifyContent'];\n\n /** Controls `align-items` CSS property @default 'center' */\n align?: React.CSSProperties['alignItems'];\n\n /** Controls `flex-wrap` CSS property @default 'wrap' */\n wrap?: React.CSSProperties['flexWrap'];\n\n /** Key of `theme.spacing` or any valid CSS value for `gap`, numbers are converted to rem @default 'md' */\n gap?: MantineSpacing;\n\n /** Determines whether each child element should have `flex-grow: 1` style @default false */\n grow?: boolean;\n\n /** Determines whether children should take only dedicated amount of space (`max-width` style is set based on the number of children) @default true */\n preventGrowOverflow?: boolean;\n}\n\nexport type GroupFactory = Factory<{\n props: GroupProps;\n ref: HTMLDivElement;\n stylesNames: GroupStylesNames;\n vars: GroupCssVariables;\n ctx: GroupStylesCtx;\n}>;\n\nconst defaultProps = {\n preventGrowOverflow: true,\n gap: 'md',\n align: 'center',\n justify: 'flex-start',\n wrap: 'wrap',\n} satisfies Partial<GroupProps>;\n\nconst varsResolver = createVarsResolver<GroupFactory>(\n (_, { grow, preventGrowOverflow, gap, align, justify, wrap }, { childWidth }) => ({\n root: {\n '--group-child-width': grow && preventGrowOverflow ? childWidth : undefined,\n '--group-gap': getSpacing(gap),\n '--group-align': align,\n '--group-justify': justify,\n '--group-wrap': wrap,\n },\n })\n);\n\nexport const Group = factory<GroupFactory>((_props) => {\n const props = useProps('Group', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n children,\n gap,\n align,\n justify,\n wrap,\n grow,\n preventGrowOverflow,\n vars,\n variant,\n __size,\n mod,\n attributes,\n ...others\n } = props;\n\n const filteredChildren = filterFalsyChildren(children);\n const childrenCount = filteredChildren.length;\n const resolvedGap = getSpacing(gap ?? 'md');\n const childWidth = `calc(${\n 100 / childrenCount\n }% - (${resolvedGap} - ${resolvedGap} / ${childrenCount}))`;\n\n const stylesCtx: GroupStylesCtx = { childWidth };\n\n const getStyles = useStyles<GroupFactory>({\n name: 'Group',\n props,\n stylesCtx,\n className,\n style,\n classes,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <Box {...getStyles('root')} variant={variant} mod={[{ grow }, mod]} size={__size} {...others}>\n {filteredChildren}\n </Box>\n );\n});\n\nGroup.classes = classes;\nGroup.varsResolver = varsResolver;\nGroup.displayName = '@mantine/core/Group';\n\nexport namespace Group {\n export type Props = GroupProps;\n export type StylesNames = GroupStylesNames;\n export type CssVariables = GroupCssVariables;\n export type StylesCtx = GroupStylesCtx;\n export type Factory = GroupFactory;\n}\n"],"mappings":";;;;;;;;;;;;AA4DA,MAAM,eAAe;CACnB,qBAAqB;CACrB,KAAK;CACL,OAAO;CACP,SAAS;CACT,MAAM;CACP;AAED,MAAM,eAAeA,6BAAAA,oBAClB,GAAG,EAAE,MAAM,qBAAqB,KAAK,OAAO,SAAS,QAAQ,EAAE,kBAAkB,EAChF,MAAM;CACJ,uBAAuB,QAAQ,sBAAsB,aAAa,KAAA;CAClE,eAAeC,iBAAAA,WAAW,IAAI;CAC9B,iBAAiB;CACjB,mBAAmB;CACnB,gBAAgB;CACjB,EACF,EACF;AAED,MAAa,QAAQC,gBAAAA,SAAuB,WAAW;CACrD,MAAM,QAAQC,kBAAAA,SAAS,SAAS,cAAc,OAAO;CACrD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,UACA,KACA,OACA,SACA,MACA,MACA,qBACA,MACA,SACA,QACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,mBAAmBC,8BAAAA,oBAAoB,SAAS;CACtD,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,cAAcH,iBAAAA,WAAW,OAAO,KAAK;AAsB3C,QACE,iBAAA,GAAA,kBAAA,KAACI,YAAAA,KAAD;EAAK,GAhBWC,mBAAAA,UAAwB;GACxC,MAAM;GACN;GACA,WALgC,EAAE,YAJjB,QACjB,MAAM,cACP,OAAO,YAAY,KAAK,YAAY,KAAK,cAAc,KAER;GAM9C;GACA;GACA,SAAA,qBAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,CAGmB,OAAO;EAAW;EAAS,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI;EAAE,MAAM;EAAQ,GAAI;YACnF;EACG,CAAA;EAER;AAEF,MAAM,UAAUC,qBAAAA;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Highlight.cjs","names":["polymorphicFactory","useProps","highlighter","Text","Mark"],"sources":["../../../src/components/Highlight/Highlight.tsx"],"sourcesContent":["import {\n MantineColor,\n MantineTheme,\n polymorphicFactory,\n PolymorphicFactory,\n useProps,\n} from '../../core';\nimport { Mark } from '../Mark';\nimport { Text, TextProps, TextStylesNames, TextVariant } from '../Text';\nimport { highlighter } from './highlighter/highlighter';\n\nexport interface HighlightTerm {\n /** Text to highlight */\n text: string;\n\n /** Background color for this specific term. Key of `theme.colors` or any valid CSS color */\n color?: MantineColor | string;\n}\n\nexport interface HighlightProps extends Omit<TextProps, 'color'> {\n /**\n * Substring(s) to highlight in `children`. Can be:\n * - string: single term\n * - string[]: multiple terms with same color\n * - HighlightTerm[]: multiple terms with custom colors per term\n *\n * - Matching is case-insensitive\n * - Regex special characters are automatically escaped\n * - When multiple substrings are provided, longer matches take precedence\n * - Empty strings and whitespace-only strings are ignored\n */\n highlight: string | string[] | HighlightTerm[];\n\n /**\n * Default background color for all highlighted text.\n * Key of `theme.colors` or any valid CSS color, passed to `Mark` component.\n * Can be overridden per term when using HighlightTerm objects.\n * @default 'yellow'\n */\n color?: MantineColor | string;\n\n /** Styles applied to `mark` elements */\n highlightStyles?: React.CSSProperties | ((theme: MantineTheme) => React.CSSProperties);\n\n /** String in which to highlight substrings */\n children: string;\n\n /**\n * Only match whole words (adds word boundaries to regex).\n * When enabled, 'the' will not match 'there'.\n * @default false\n */\n wholeWord?: boolean;\n}\n\nexport type HighlightFactory = PolymorphicFactory<{\n props: HighlightProps;\n defaultRef: HTMLDivElement;\n defaultComponent: 'div';\n stylesNames: TextStylesNames;\n variant: TextVariant;\n}>;\n\nconst defaultProps = {\n color: 'yellow',\n wholeWord: false,\n} satisfies Partial<HighlightProps>;\n\nexport const Highlight = polymorphicFactory<HighlightFactory>((_props) => {\n const { unstyled, children, highlight, highlightStyles, color, wholeWord, ...others } = useProps(\n 'Highlight',\n defaultProps,\n _props\n );\n\n const isTermArray = Array.isArray(highlight) && typeof highlight[0] === 'object';\n const colorMap = new Map<string, string>();\n\n let highlightStrings: string[];\n if (isTermArray) {\n highlightStrings = (highlight as HighlightTerm[]).map((term) => {\n if (term.color) {\n colorMap.set(term.text.toLowerCase(), term.color);\n }\n return term.text;\n });\n } else if (Array.isArray(highlight)) {\n highlightStrings = highlight as string[];\n } else {\n highlightStrings = [highlight as string];\n }\n\n const highlightChunks = highlighter(children, highlightStrings, { wholeWord });\n\n return (\n <Text unstyled={unstyled} {...others} __staticSelector=\"Highlight\">\n {highlightChunks.map(({ chunk, highlighted }, i) =>\n highlighted ? (\n <Mark\n unstyled={unstyled}\n key={i}\n color={colorMap.get(chunk.toLowerCase()) || color}\n style={highlightStyles}\n data-highlight={chunk}\n >\n {chunk}\n </Mark>\n ) : (\n <span key={i}>{chunk}</span>\n )\n )}\n </Text>\n );\n});\n\nHighlight.classes = Text.classes;\nHighlight.displayName = '@mantine/core/Highlight';\n"],"mappings":";;;;;;;;;AA+DA,MAAM,eAAe;CACnB,OAAO;CACP,WAAW;CACZ;AAED,MAAa,YAAYA,4BAAAA,oBAAsC,WAAW;CACxE,MAAM,EAAE,UAAU,UAAU,WAAW,iBAAiB,OAAO,WAAW,GAAG,WAAWC,kBAAAA,SACtF,aACA,cACA,OACD;CAED,MAAM,cAAc,MAAM,QAAQ,UAAU,IAAI,OAAO,UAAU,OAAO;CACxE,MAAM,2BAAW,IAAI,KAAqB;CAE1C,IAAI;AACJ,KAAI,YACF,oBAAoB,UAA8B,KAAK,SAAS;AAC9D,MAAI,KAAK,MACP,UAAS,IAAI,KAAK,KAAK,aAAa,EAAE,KAAK,MAAM;AAEnD,SAAO,KAAK;GACZ;UACO,MAAM,QAAQ,UAAU,CACjC,oBAAmB;KAEnB,oBAAmB,CAAC,UAAoB;CAG1C,MAAM,kBAAkBC,oBAAAA,YAAY,UAAU,kBAAkB,EAAE,WAAW,CAAC;AAE9E,QACE,iBAAA,GAAA,kBAAA,KAACC,aAAAA,MAAD;EAAgB;EAAU,GAAI;EAAQ,kBAAiB;YACpD,gBAAgB,KAAK,EAAE,OAAO,eAAe,MAC5C,cACE,iBAAA,GAAA,kBAAA,KAACC,aAAAA,MAAD;GACY;GAEV,OAAO,SAAS,IAAI,MAAM,aAAa,CAAC,IAAI;GAC5C,OAAO;GACP,kBAAgB;aAEf;GACI,EANA,EAMA,GAEP,iBAAA,GAAA,kBAAA,KAAC,QAAD,EAAA,UAAe,OAAa,EAAjB,EAAiB,CAE/B;EACI,CAAA;EAET;AAEF,UAAU,UAAUD,aAAAA,KAAK;AACzB,UAAU,cAAc"}
1
+ {"version":3,"file":"Highlight.cjs","names":["polymorphicFactory","useProps","highlighter","Text","Mark"],"sources":["../../../src/components/Highlight/Highlight.tsx"],"sourcesContent":["import {\n MantineColor,\n MantineTheme,\n polymorphicFactory,\n PolymorphicFactory,\n useProps,\n} from '../../core';\nimport { Mark } from '../Mark';\nimport { Text, TextProps, TextStylesNames, TextVariant } from '../Text';\nimport { highlighter } from './highlighter/highlighter';\n\nexport interface HighlightTerm {\n /** Text to highlight */\n text: string;\n\n /** Background color for this specific term. Key of `theme.colors` or any valid CSS color */\n color?: MantineColor | string;\n}\n\nexport interface HighlightProps extends Omit<TextProps, 'color'> {\n /**\n * Substring(s) to highlight in `children`. Can be:\n * - string: single term\n * - string[]: multiple terms with same color\n * - HighlightTerm[]: multiple terms with custom colors per term\n *\n * - Matching is case-insensitive\n * - Regex special characters are automatically escaped\n * - When multiple substrings are provided, longer matches take precedence\n * - Empty strings and whitespace-only strings are ignored\n */\n highlight: string | string[] | HighlightTerm[];\n\n /**\n * Default background color for all highlighted text.\n * Key of `theme.colors` or any valid CSS color, passed to `Mark` component.\n * Can be overridden per term when using HighlightTerm objects.\n * @default 'yellow'\n */\n color?: MantineColor | string;\n\n /** Styles applied to `mark` elements */\n highlightStyles?: React.CSSProperties | ((theme: MantineTheme) => React.CSSProperties);\n\n /** String in which to highlight substrings */\n children: string;\n\n /**\n * Only match whole words (adds word boundaries to regex).\n * When enabled, 'the' will not match 'there'.\n * @default false\n */\n wholeWord?: boolean;\n}\n\nexport type HighlightFactory = PolymorphicFactory<{\n props: HighlightProps;\n defaultRef: HTMLDivElement;\n defaultComponent: 'div';\n stylesNames: TextStylesNames;\n variant: TextVariant;\n}>;\n\nconst defaultProps = {\n color: 'yellow',\n wholeWord: false,\n} satisfies Partial<HighlightProps>;\n\nexport const Highlight = polymorphicFactory<HighlightFactory>((_props) => {\n const { unstyled, children, highlight, highlightStyles, color, wholeWord, ...others } = useProps(\n 'Highlight',\n defaultProps,\n _props\n );\n\n const isTermArray = Array.isArray(highlight) && typeof highlight[0] === 'object';\n const colorMap = new Map<string, string>();\n\n let highlightStrings: string[];\n if (isTermArray) {\n highlightStrings = (highlight as HighlightTerm[]).map((term) => {\n if (term.color) {\n colorMap.set(term.text.toLowerCase(), term.color);\n }\n return term.text;\n });\n } else if (Array.isArray(highlight)) {\n highlightStrings = highlight as string[];\n } else {\n highlightStrings = [highlight as string];\n }\n\n const highlightChunks = highlighter(children, highlightStrings, { wholeWord });\n\n return (\n <Text unstyled={unstyled} {...others} __staticSelector=\"Highlight\">\n {highlightChunks.map(({ chunk, highlighted }, i) =>\n highlighted ? (\n <Mark\n unstyled={unstyled}\n key={i}\n color={colorMap.get(chunk.toLowerCase()) || color}\n style={highlightStyles}\n data-highlight={chunk}\n >\n {chunk}\n </Mark>\n ) : (\n <span key={i}>{chunk}</span>\n )\n )}\n </Text>\n );\n});\n\nHighlight.classes = Text.classes;\nHighlight.displayName = '@mantine/core/Highlight';\n\nexport namespace Highlight {\n export type Props = HighlightProps;\n export type Factory = HighlightFactory;\n export type Term = HighlightTerm;\n}\n"],"mappings":";;;;;;;;;AA+DA,MAAM,eAAe;CACnB,OAAO;CACP,WAAW;CACZ;AAED,MAAa,YAAYA,4BAAAA,oBAAsC,WAAW;CACxE,MAAM,EAAE,UAAU,UAAU,WAAW,iBAAiB,OAAO,WAAW,GAAG,WAAWC,kBAAAA,SACtF,aACA,cACA,OACD;CAED,MAAM,cAAc,MAAM,QAAQ,UAAU,IAAI,OAAO,UAAU,OAAO;CACxE,MAAM,2BAAW,IAAI,KAAqB;CAE1C,IAAI;AACJ,KAAI,YACF,oBAAoB,UAA8B,KAAK,SAAS;AAC9D,MAAI,KAAK,MACP,UAAS,IAAI,KAAK,KAAK,aAAa,EAAE,KAAK,MAAM;AAEnD,SAAO,KAAK;GACZ;UACO,MAAM,QAAQ,UAAU,CACjC,oBAAmB;KAEnB,oBAAmB,CAAC,UAAoB;CAG1C,MAAM,kBAAkBC,oBAAAA,YAAY,UAAU,kBAAkB,EAAE,WAAW,CAAC;AAE9E,QACE,iBAAA,GAAA,kBAAA,KAACC,aAAAA,MAAD;EAAgB;EAAU,GAAI;EAAQ,kBAAiB;YACpD,gBAAgB,KAAK,EAAE,OAAO,eAAe,MAC5C,cACE,iBAAA,GAAA,kBAAA,KAACC,aAAAA,MAAD;GACY;GAEV,OAAO,SAAS,IAAI,MAAM,aAAa,CAAC,IAAI;GAC5C,OAAO;GACP,kBAAgB;aAEf;GACI,EANA,EAMA,GAEP,iBAAA,GAAA,kBAAA,KAAC,QAAD,EAAA,UAAe,OAAa,EAAjB,EAAiB,CAE/B;EACI,CAAA;EAET;AAEF,UAAU,UAAUD,aAAAA,KAAK;AACzB,UAAU,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Image.cjs","names":["createVarsResolver","getRadius","polymorphicFactory","useProps","useStyles","Box","classes"],"sources":["../../../src/components/Image/Image.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n getRadius,\n MantineRadius,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Image.module.css';\n\nexport type ImageStylesNames = 'root';\nexport type ImageCssVariables = {\n root: '--image-radius' | '--image-object-fit';\n};\n\nexport interface ImageProps extends BoxProps, StylesApiProps<ImageFactory> {\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default 0 */\n radius?: MantineRadius;\n\n /** Controls `object-fit` style @default 'cover' */\n fit?: React.CSSProperties['objectFit'];\n\n /** Image url used as a fallback if the image cannot be loaded */\n fallbackSrc?: string;\n\n /** Image url */\n src?: any;\n\n /** Called when image fails to load */\n onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;\n}\n\nexport type ImageFactory = PolymorphicFactory<{\n props: ImageProps;\n defaultRef: HTMLImageElement;\n defaultComponent: 'img';\n stylesNames: ImageStylesNames;\n vars: ImageCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<ImageFactory>((_, { radius, fit }) => ({\n root: {\n '--image-radius': radius === undefined ? undefined : getRadius(radius),\n '--image-object-fit': fit,\n },\n}));\n\nexport const Image = polymorphicFactory<ImageFactory>((_props) => {\n const props = useProps('Image', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n onError,\n src,\n radius,\n fit,\n fallbackSrc,\n mod,\n attributes,\n ...others\n } = props;\n\n const [error, setError] = useState(!src);\n\n useEffect(() => setError(!src), [src]);\n\n const getStyles = useStyles<ImageFactory>({\n name: 'Image',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n if (error && fallbackSrc) {\n return (\n <Box\n component=\"img\"\n src={fallbackSrc}\n {...getStyles('root')}\n onError={onError}\n mod={['fallback', mod]}\n {...others}\n />\n );\n }\n\n return (\n <Box\n component=\"img\"\n {...getStyles('root')}\n src={src}\n onError={(event) => {\n onError?.(event);\n setError(true);\n }}\n mod={mod}\n {...others}\n />\n );\n});\n\nImage.classes = classes;\nImage.varsResolver = varsResolver;\nImage.displayName = '@mantine/core/Image';\n"],"mappings":";;;;;;;;;;;;AA6CA,MAAM,eAAeA,6BAAAA,oBAAkC,GAAG,EAAE,QAAQ,WAAW,EAC7E,MAAM;CACJ,kBAAkB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO;CACtE,sBAAsB;CACvB,EACF,EAAE;AAEH,MAAa,QAAQC,4BAAAA,oBAAkC,WAAW;CAChE,MAAM,QAAQC,kBAAAA,SAAS,SAAS,MAAM,OAAO;CAC7C,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,SACA,KACA,QACA,KACA,aACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,CAAC,OAAO,aAAA,GAAA,MAAA,UAAqB,CAAC,IAAI;AAExC,EAAA,GAAA,MAAA,iBAAgB,SAAS,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC;CAEtC,MAAM,YAAYC,mBAAAA,UAAwB;EACxC,MAAM;EACN,SAAA,qBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,KAAI,SAAS,YACX,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,WAAU;EACV,KAAK;EACL,GAAI,UAAU,OAAO;EACZ;EACT,KAAK,CAAC,YAAY,IAAI;EACtB,GAAI;EACJ,CAAA;AAIN,QACE,iBAAA,GAAA,kBAAA,KAACA,YAAAA,KAAD;EACE,WAAU;EACV,GAAI,UAAU,OAAO;EAChB;EACL,UAAU,UAAU;AAClB,aAAU,MAAM;AAChB,YAAS,KAAK;;EAEX;EACL,GAAI;EACJ,CAAA;EAEJ;AAEF,MAAM,UAAUC,qBAAAA;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc"}
1
+ {"version":3,"file":"Image.cjs","names":["createVarsResolver","getRadius","polymorphicFactory","useProps","useStyles","Box","classes"],"sources":["../../../src/components/Image/Image.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n getRadius,\n MantineRadius,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Image.module.css';\n\nexport type ImageStylesNames = 'root';\nexport type ImageCssVariables = {\n root: '--image-radius' | '--image-object-fit';\n};\n\nexport interface ImageProps extends BoxProps, StylesApiProps<ImageFactory> {\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default 0 */\n radius?: MantineRadius;\n\n /** Controls `object-fit` style @default 'cover' */\n fit?: React.CSSProperties['objectFit'];\n\n /** Image url used as a fallback if the image cannot be loaded */\n fallbackSrc?: string;\n\n /** Image url */\n src?: any;\n\n /** Called when image fails to load */\n onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;\n}\n\nexport type ImageFactory = PolymorphicFactory<{\n props: ImageProps;\n defaultRef: HTMLImageElement;\n defaultComponent: 'img';\n stylesNames: ImageStylesNames;\n vars: ImageCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<ImageFactory>((_, { radius, fit }) => ({\n root: {\n '--image-radius': radius === undefined ? undefined : getRadius(radius),\n '--image-object-fit': fit,\n },\n}));\n\nexport const Image = polymorphicFactory<ImageFactory>((_props) => {\n const props = useProps('Image', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n onError,\n src,\n radius,\n fit,\n fallbackSrc,\n mod,\n attributes,\n ...others\n } = props;\n\n const [error, setError] = useState(!src);\n\n useEffect(() => setError(!src), [src]);\n\n const getStyles = useStyles<ImageFactory>({\n name: 'Image',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n if (error && fallbackSrc) {\n return (\n <Box\n component=\"img\"\n src={fallbackSrc}\n {...getStyles('root')}\n onError={onError}\n mod={['fallback', mod]}\n {...others}\n />\n );\n }\n\n return (\n <Box\n component=\"img\"\n {...getStyles('root')}\n src={src}\n onError={(event) => {\n onError?.(event);\n setError(true);\n }}\n mod={mod}\n {...others}\n />\n );\n});\n\nImage.classes = classes;\nImage.varsResolver = varsResolver;\nImage.displayName = '@mantine/core/Image';\n\nexport namespace Image {\n export type Props = ImageProps;\n export type StylesNames = ImageStylesNames;\n export type CssVariables = ImageCssVariables;\n export type Factory = ImageFactory;\n}\n"],"mappings":";;;;;;;;;;;;AA6CA,MAAM,eAAeA,6BAAAA,oBAAkC,GAAG,EAAE,QAAQ,WAAW,EAC7E,MAAM;CACJ,kBAAkB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO;CACtE,sBAAsB;CACvB,EACF,EAAE;AAEH,MAAa,QAAQC,4BAAAA,oBAAkC,WAAW;CAChE,MAAM,QAAQC,kBAAAA,SAAS,SAAS,MAAM,OAAO;CAC7C,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,SACA,KACA,QACA,KACA,aACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,CAAC,OAAO,aAAA,GAAA,MAAA,UAAqB,CAAC,IAAI;AAExC,EAAA,GAAA,MAAA,iBAAgB,SAAS,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC;CAEtC,MAAM,YAAYC,mBAAAA,UAAwB;EACxC,MAAM;EACN,SAAA,qBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,KAAI,SAAS,YACX,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,WAAU;EACV,KAAK;EACL,GAAI,UAAU,OAAO;EACZ;EACT,KAAK,CAAC,YAAY,IAAI;EACtB,GAAI;EACJ,CAAA;AAIN,QACE,iBAAA,GAAA,kBAAA,KAACA,YAAAA,KAAD;EACE,WAAU;EACV,GAAI,UAAU,OAAO;EAChB;EACL,UAAU,UAAU;AAClB,aAAU,MAAM;AAChB,YAAS,KAAK;;EAEX;EACL,GAAI;EACJ,CAAA;EAEJ;AAEF,MAAM,UAAUC,qBAAAA;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Indicator.cjs","names":["createVarsResolver","getThemeColor","getAutoContrastValue","getContrastColor","rem","getRadius","getPositionVariables","factory","useProps","useStyles","Box","classes"],"sources":["../../../src/components/Indicator/Indicator.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getAutoContrastValue,\n getContrastColor,\n getRadius,\n getThemeColor,\n MantineColor,\n MantineRadius,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { getPositionVariables } from './get-position-variables/get-position-variables';\nimport { IndicatorPosition } from './Indicator.types';\nimport classes from './Indicator.module.css';\n\nexport type IndicatorPositionVariables =\n | '--indicator-top'\n | '--indicator-bottom'\n | '--indicator-left'\n | '--indicator-right'\n | '--indicator-translate-x'\n | '--indicator-translate-y';\n\nexport type IndicatorStylesNames = 'root' | 'indicator';\nexport type IndicatorCssVariables = {\n root:\n | '--indicator-color'\n | '--indicator-text-color'\n | '--indicator-size'\n | '--indicator-radius'\n | '--indicator-z-index'\n | IndicatorPositionVariables;\n};\n\nexport interface IndicatorProps\n extends BoxProps, StylesApiProps<IndicatorFactory>, ElementProps<'div'> {\n /** Indicator position relative to the target element @default 'top-end' */\n position?: IndicatorPosition;\n\n /** Distance in pixels to offset the indicator from its default position, useful for elements with border-radius. Can be a number for uniform offset or an object with `x` and `y` properties for separate horizontal and vertical offsets @default 0 */\n offset?: number | { x: number; y: number };\n\n /** Changes container display from block to inline-block, use when wrapping elements with fixed width @default false */\n inline?: boolean;\n\n /** Indicator width and height @default 10 */\n size?: number | string;\n\n /** Label displayed inside the indicator, for example, notification count */\n label?: React.ReactNode;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default 100 */\n radius?: MantineRadius;\n\n /** Key of `theme.colors` or any valid CSS color value @default theme.primaryColor */\n color?: MantineColor;\n\n /** Adds border to the root element */\n withBorder?: boolean;\n\n /** Hides the indicator when set */\n disabled?: boolean;\n\n /** If set, the indicator has processing animation @default false */\n processing?: boolean;\n\n /** Indicator z-index @default 200 */\n zIndex?: string | number;\n\n /** If set, adjusts text color based on background color */\n autoContrast?: boolean;\n\n /** Maximum value to display. If label is a number greater than this value, it will be displayed as `{maxValue}+` */\n maxValue?: number;\n\n /** Determines whether indicator with label `0` should be displayed @default true */\n showZero?: boolean;\n}\n\nexport type IndicatorFactory = Factory<{\n props: IndicatorProps;\n ref: HTMLDivElement;\n stylesNames: IndicatorStylesNames;\n vars: IndicatorCssVariables;\n}>;\n\nconst defaultProps = {\n position: 'top-end',\n offset: 0,\n showZero: true,\n} satisfies Partial<IndicatorProps>;\n\nconst varsResolver = createVarsResolver<IndicatorFactory>(\n (theme, { color, position, offset, size, radius, zIndex, autoContrast }) => ({\n root: {\n '--indicator-color': color ? getThemeColor(color, theme) : undefined,\n '--indicator-text-color': getAutoContrastValue(autoContrast, theme)\n ? getContrastColor({ color, theme, autoContrast })\n : undefined,\n '--indicator-size': rem(size),\n '--indicator-radius': radius === undefined ? undefined : getRadius(radius),\n '--indicator-z-index': zIndex?.toString(),\n ...getPositionVariables(position, offset),\n },\n })\n);\n\nexport const Indicator = factory<IndicatorFactory>((_props) => {\n const props = useProps('Indicator', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n children,\n position,\n offset,\n inline,\n label,\n radius,\n color,\n withBorder,\n disabled,\n processing,\n zIndex,\n autoContrast,\n maxValue,\n showZero,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<IndicatorFactory>({\n name: 'Indicator',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const shouldHideZero = !showZero && (label === 0 || label === '0');\n const formattedLabel =\n maxValue !== undefined && typeof label === 'number' && label > maxValue\n ? `${maxValue}+`\n : label;\n\n return (\n <Box {...getStyles('root')} mod={[{ inline }, mod]} {...others}>\n {!disabled && !shouldHideZero && (\n <Box\n mod={{ 'with-label': !!label, 'with-border': withBorder, processing }}\n {...getStyles('indicator')}\n >\n {formattedLabel}\n </Box>\n )}\n {children}\n </Box>\n );\n});\n\nIndicator.classes = classes;\nIndicator.varsResolver = varsResolver;\nIndicator.displayName = '@mantine/core/Indicator';\n"],"mappings":";;;;;;;;;;;;;;;;AA6FA,MAAM,eAAe;CACnB,UAAU;CACV,QAAQ;CACR,UAAU;CACX;AAED,MAAM,eAAeA,6BAAAA,oBAClB,OAAO,EAAE,OAAO,UAAU,QAAQ,MAAM,QAAQ,QAAQ,oBAAoB,EAC3E,MAAM;CACJ,qBAAqB,QAAQC,wBAAAA,cAAc,OAAO,MAAM,GAAG,KAAA;CAC3D,0BAA0BC,gCAAAA,qBAAqB,cAAc,MAAM,GAC/DC,2BAAAA,iBAAiB;EAAE;EAAO;EAAO;EAAc,CAAC,GAChD,KAAA;CACJ,oBAAoBC,YAAAA,IAAI,KAAK;CAC7B,sBAAsB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO;CAC1E,uBAAuB,QAAQ,UAAU;CACzC,GAAGC,+BAAAA,qBAAqB,UAAU,OAAO;CAC1C,EACF,EACF;AAED,MAAa,YAAYC,gBAAAA,SAA2B,WAAW;CAC7D,MAAM,QAAQC,kBAAAA,SAAS,aAAa,cAAc,OAAO;CACzD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,UACA,UACA,QACA,QACA,OACA,QACA,OACA,YACA,UACA,YACA,QACA,cACA,UACA,UACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAA4B;EAC5C,MAAM;EACN,SAAA,yBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,iBAAiB,CAAC,aAAa,UAAU,KAAK,UAAU;CAC9D,MAAM,iBACJ,aAAa,KAAA,KAAa,OAAO,UAAU,YAAY,QAAQ,WAC3D,GAAG,SAAS,KACZ;AAEN,QACE,iBAAA,GAAA,kBAAA,MAACC,YAAAA,KAAD;EAAK,GAAI,UAAU,OAAO;EAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI;EAAE,GAAI;YAAxD,CACG,CAAC,YAAY,CAAC,kBACb,iBAAA,GAAA,kBAAA,KAACA,YAAAA,KAAD;GACE,KAAK;IAAE,cAAc,CAAC,CAAC;IAAO,eAAe;IAAY;IAAY;GACrE,GAAI,UAAU,YAAY;aAEzB;GACG,CAAA,EAEP,SACG;;EAER;AAEF,UAAU,UAAUC,yBAAAA;AACpB,UAAU,eAAe;AACzB,UAAU,cAAc"}
1
+ {"version":3,"file":"Indicator.cjs","names":["createVarsResolver","getThemeColor","getAutoContrastValue","getContrastColor","rem","getRadius","getPositionVariables","factory","useProps","useStyles","Box","classes"],"sources":["../../../src/components/Indicator/Indicator.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getAutoContrastValue,\n getContrastColor,\n getRadius,\n getThemeColor,\n MantineColor,\n MantineRadius,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { getPositionVariables } from './get-position-variables/get-position-variables';\nimport { IndicatorPosition } from './Indicator.types';\nimport classes from './Indicator.module.css';\n\nexport type IndicatorPositionVariables =\n | '--indicator-top'\n | '--indicator-bottom'\n | '--indicator-left'\n | '--indicator-right'\n | '--indicator-translate-x'\n | '--indicator-translate-y';\n\nexport type IndicatorStylesNames = 'root' | 'indicator';\nexport type IndicatorCssVariables = {\n root:\n | '--indicator-color'\n | '--indicator-text-color'\n | '--indicator-size'\n | '--indicator-radius'\n | '--indicator-z-index'\n | IndicatorPositionVariables;\n};\n\nexport interface IndicatorProps\n extends BoxProps, StylesApiProps<IndicatorFactory>, ElementProps<'div'> {\n /** Indicator position relative to the target element @default 'top-end' */\n position?: IndicatorPosition;\n\n /** Distance in pixels to offset the indicator from its default position, useful for elements with border-radius. Can be a number for uniform offset or an object with `x` and `y` properties for separate horizontal and vertical offsets @default 0 */\n offset?: number | { x: number; y: number };\n\n /** Changes container display from block to inline-block, use when wrapping elements with fixed width @default false */\n inline?: boolean;\n\n /** Indicator width and height @default 10 */\n size?: number | string;\n\n /** Label displayed inside the indicator, for example, notification count */\n label?: React.ReactNode;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default 100 */\n radius?: MantineRadius;\n\n /** Key of `theme.colors` or any valid CSS color value @default theme.primaryColor */\n color?: MantineColor;\n\n /** Adds border to the root element */\n withBorder?: boolean;\n\n /** Hides the indicator when set */\n disabled?: boolean;\n\n /** If set, the indicator has processing animation @default false */\n processing?: boolean;\n\n /** Indicator z-index @default 200 */\n zIndex?: string | number;\n\n /** If set, adjusts text color based on background color */\n autoContrast?: boolean;\n\n /** Maximum value to display. If label is a number greater than this value, it will be displayed as `{maxValue}+` */\n maxValue?: number;\n\n /** Determines whether indicator with label `0` should be displayed @default true */\n showZero?: boolean;\n}\n\nexport type IndicatorFactory = Factory<{\n props: IndicatorProps;\n ref: HTMLDivElement;\n stylesNames: IndicatorStylesNames;\n vars: IndicatorCssVariables;\n}>;\n\nconst defaultProps = {\n position: 'top-end',\n offset: 0,\n showZero: true,\n} satisfies Partial<IndicatorProps>;\n\nconst varsResolver = createVarsResolver<IndicatorFactory>(\n (theme, { color, position, offset, size, radius, zIndex, autoContrast }) => ({\n root: {\n '--indicator-color': color ? getThemeColor(color, theme) : undefined,\n '--indicator-text-color': getAutoContrastValue(autoContrast, theme)\n ? getContrastColor({ color, theme, autoContrast })\n : undefined,\n '--indicator-size': rem(size),\n '--indicator-radius': radius === undefined ? undefined : getRadius(radius),\n '--indicator-z-index': zIndex?.toString(),\n ...getPositionVariables(position, offset),\n },\n })\n);\n\nexport const Indicator = factory<IndicatorFactory>((_props) => {\n const props = useProps('Indicator', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n children,\n position,\n offset,\n inline,\n label,\n radius,\n color,\n withBorder,\n disabled,\n processing,\n zIndex,\n autoContrast,\n maxValue,\n showZero,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<IndicatorFactory>({\n name: 'Indicator',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const shouldHideZero = !showZero && (label === 0 || label === '0');\n const formattedLabel =\n maxValue !== undefined && typeof label === 'number' && label > maxValue\n ? `${maxValue}+`\n : label;\n\n return (\n <Box {...getStyles('root')} mod={[{ inline }, mod]} {...others}>\n {!disabled && !shouldHideZero && (\n <Box\n mod={{ 'with-label': !!label, 'with-border': withBorder, processing }}\n {...getStyles('indicator')}\n >\n {formattedLabel}\n </Box>\n )}\n {children}\n </Box>\n );\n});\n\nIndicator.classes = classes;\nIndicator.varsResolver = varsResolver;\nIndicator.displayName = '@mantine/core/Indicator';\n\nexport namespace Indicator {\n export type Props = IndicatorProps;\n export type StylesNames = IndicatorStylesNames;\n export type CssVariables = IndicatorCssVariables;\n export type Factory = IndicatorFactory;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA6FA,MAAM,eAAe;CACnB,UAAU;CACV,QAAQ;CACR,UAAU;CACX;AAED,MAAM,eAAeA,6BAAAA,oBAClB,OAAO,EAAE,OAAO,UAAU,QAAQ,MAAM,QAAQ,QAAQ,oBAAoB,EAC3E,MAAM;CACJ,qBAAqB,QAAQC,wBAAAA,cAAc,OAAO,MAAM,GAAG,KAAA;CAC3D,0BAA0BC,gCAAAA,qBAAqB,cAAc,MAAM,GAC/DC,2BAAAA,iBAAiB;EAAE;EAAO;EAAO;EAAc,CAAC,GAChD,KAAA;CACJ,oBAAoBC,YAAAA,IAAI,KAAK;CAC7B,sBAAsB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO;CAC1E,uBAAuB,QAAQ,UAAU;CACzC,GAAGC,+BAAAA,qBAAqB,UAAU,OAAO;CAC1C,EACF,EACF;AAED,MAAa,YAAYC,gBAAAA,SAA2B,WAAW;CAC7D,MAAM,QAAQC,kBAAAA,SAAS,aAAa,cAAc,OAAO;CACzD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,UACA,UACA,QACA,QACA,OACA,QACA,OACA,YACA,UACA,YACA,QACA,cACA,UACA,UACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAA4B;EAC5C,MAAM;EACN,SAAA,yBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,iBAAiB,CAAC,aAAa,UAAU,KAAK,UAAU;CAC9D,MAAM,iBACJ,aAAa,KAAA,KAAa,OAAO,UAAU,YAAY,QAAQ,WAC3D,GAAG,SAAS,KACZ;AAEN,QACE,iBAAA,GAAA,kBAAA,MAACC,YAAAA,KAAD;EAAK,GAAI,UAAU,OAAO;EAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI;EAAE,GAAI;YAAxD,CACG,CAAC,YAAY,CAAC,kBACb,iBAAA,GAAA,kBAAA,KAACA,YAAAA,KAAD;GACE,KAAK;IAAE,cAAc,CAAC,CAAC;IAAO,eAAe;IAAY;IAAY;GACrE,GAAI,UAAU,YAAY;aAEzB;GACG,CAAA,EAEP,SACG;;EAER;AAEF,UAAU,UAAUC,yBAAAA;AACpB,UAAU,eAAe;AACzB,UAAU,cAAc"}
@@ -46,7 +46,7 @@ const varsResolver = require_create_vars_resolver.createVarsResolver((_, props,
46
46
  } }));
47
47
  const Input = require_polymorphic_factory.polymorphicFactory((_props) => {
48
48
  const props = require_use_props.useProps("Input", defaultProps, _props);
49
- const { classNames, className, style, styles, unstyled, required, __staticSelector, __stylesApiProps, size, wrapperProps, error, disabled, leftSection, leftSectionProps, leftSectionWidth, rightSection, rightSectionProps, rightSectionWidth, rightSectionPointerEvents, leftSectionPointerEvents, variant, vars, pointer, multiline, radius, id, withAria, withErrorStyles, mod, inputSize, attributes, __clearSection, __clearable, __clearSectionMode, __defaultRightSection, loading, loadingPosition, ...others } = props;
49
+ const { classNames, className, style, styles, unstyled, required, __staticSelector, __stylesApiProps, size, wrapperProps, error, disabled, leftSection, leftSectionProps, leftSectionWidth, rightSection, rightSectionProps, rightSectionWidth, rightSectionPointerEvents, leftSectionPointerEvents, variant, vars, pointer, multiline, radius, id, withAria, withErrorStyles, mod, inputSize, attributes, __clearSection, __clearable, __clearSectionMode, __defaultRightSection, loading, loadingPosition, rootRef, ...others } = props;
50
50
  const { styleProps, rest } = require_extract_style_props.extractStyleProps(others);
51
51
  const ctx = (0, react.use)(require_InputWrapper_context.InputWrapperContext);
52
52
  const stylesCtx = {
@@ -71,7 +71,7 @@ const Input = require_polymorphic_factory.polymorphicFactory((_props) => {
71
71
  const ariaAttributes = withAria ? {
72
72
  required,
73
73
  disabled,
74
- "aria-invalid": !!error,
74
+ "aria-invalid": error ? true : void 0,
75
75
  "aria-describedby": ctx?.describedBy,
76
76
  id: ctx?.inputId || id
77
77
  } : {};
@@ -88,6 +88,7 @@ const Input = require_polymorphic_factory.polymorphicFactory((_props) => {
88
88
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Input_context.InputContext, {
89
89
  value: { size: size || "sm" },
90
90
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Box.Box, {
91
+ ref: rootRef,
91
92
  ...getStyles("wrapper"),
92
93
  ...styleProps,
93
94
  ...wrapperProps,
@@ -1 +1 @@
1
- {"version":3,"file":"Input.cjs","names":["createVarsResolver","getSize","getFontSize","getRadius","rem","polymorphicFactory","useProps","extractStyleProps","InputWrapperContext","useStyles","Loader","InputClearSection","InputContext","Box","classes","InputWrapper","InputLabel","InputError","InputDescription","InputPlaceholder","InputClearButton"],"sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import { use } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n extractStyleProps,\n getFontSize,\n getRadius,\n getSize,\n MantineRadius,\n MantineSize,\n polymorphicFactory,\n PolymorphicFactory,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { Loader } from '../Loader/Loader';\nimport { InputContext } from './Input.context';\nimport { InputClearButton } from './InputClearButton/InputClearButton';\nimport { ClearSectionMode, InputClearSection } from './InputClearSection/InputClearSection';\nimport { InputDescription } from './InputDescription/InputDescription';\nimport { InputError } from './InputError/InputError';\nimport { InputLabel } from './InputLabel/InputLabel';\nimport { InputPlaceholder } from './InputPlaceholder/InputPlaceholder';\nimport { InputWrapperContext } from './InputWrapper.context';\nimport {\n __InputWrapperProps,\n InputWrapper,\n InputWrapperStylesNames,\n} from './InputWrapper/InputWrapper';\nimport classes from './Input.module.css';\n\n// Required to be a separate type for docgen script\ntype WrapperProps = React.ComponentProps<'div'> & DataAttributes;\n\nexport interface __BaseInputProps extends __InputWrapperProps, __InputProps {\n /** Props passed down to the root element */\n wrapperProps?: WrapperProps;\n}\n\nexport type __InputStylesNames = InputStylesNames | InputWrapperStylesNames;\n\nexport type InputStylesNames = 'input' | 'wrapper' | 'section';\nexport type InputVariant = 'default' | 'filled' | 'unstyled';\nexport type InputCssVariables = {\n wrapper:\n | '--input-height'\n | '--input-fz'\n | '--input-radius'\n | '--input-left-section-width'\n | '--input-right-section-width'\n | '--input-left-section-pointer-events'\n | '--input-right-section-pointer-events'\n | '--input-padding-y'\n | '--input-margin-top'\n | '--input-margin-bottom';\n};\n\nexport interface InputStylesCtx {\n offsetTop: boolean | undefined;\n offsetBottom: boolean | undefined;\n}\n\nexport interface __InputProps {\n /** Content section displayed on the left side of the input */\n leftSection?: React.ReactNode;\n\n /** Left section width, used to set `width` of the section and input `padding-left`, by default equals to the input height */\n leftSectionWidth?: React.CSSProperties['width'];\n\n /** Props passed down to the `leftSection` element */\n leftSectionProps?: React.ComponentProps<'div'>;\n\n /** Sets `pointer-events` styles on the `leftSection` element. Use `'all'` when section contains interactive elements (buttons, links). @default 'none' */\n leftSectionPointerEvents?: React.CSSProperties['pointerEvents'];\n\n /** Content section displayed on the right side of the input */\n rightSection?: React.ReactNode;\n\n /** Right section width, used to set `width` of the section and input `padding-right`, by default equals to the input height */\n rightSectionWidth?: React.CSSProperties['width'];\n\n /** Props passed down to the `rightSection` element */\n rightSectionProps?: React.ComponentProps<'div'>;\n\n /** Sets `pointer-events` styles on the `rightSection` element. Use `'all'` when section contains interactive elements (buttons, links). @default 'none' */\n rightSectionPointerEvents?: React.CSSProperties['pointerEvents'];\n\n /** Sets `required` attribute on the `input` element */\n required?: boolean;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius`, numbers are converted to rem @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Sets `disabled` attribute on the `input` element */\n disabled?: boolean;\n\n /** Controls input `height`, horizontal `padding`, and `font-size` @default 'sm' */\n size?: MantineSize | (string & {});\n\n /** Determines whether the input should have `cursor: pointer` style. Use when input acts as a button-like trigger (e.g., `component=\"button\"` for Select/DatePicker). @default false */\n pointer?: boolean;\n\n /** Determines whether the input should have red border and red text color when the `error` prop is set @default true */\n withErrorStyles?: boolean;\n\n /** HTML `size` attribute for the input element (number of visible characters) */\n inputSize?: string;\n\n /** Section to be displayed when the input is `__clearable` and `rightSection` is not defined */\n __clearSection?: React.ReactNode;\n\n /** Determines whether the `__clearSection` should be displayed if it is passed to the component, has no effect if `rightSection` is defined */\n __clearable?: boolean;\n\n /** Determines how the clear button and rightSection are rendered @default 'both' */\n __clearSectionMode?: ClearSectionMode;\n\n /** Right section displayed when both `__clearSection` and `rightSection` are not defined */\n __defaultRightSection?: React.ReactNode;\n\n /** Displays loading indicator in the left or right section @default false */\n loading?: boolean;\n\n /** Position of the loading indicator @default 'right' */\n loadingPosition?: 'left' | 'right';\n}\n\nexport interface InputProps extends BoxProps, __InputProps, StylesApiProps<InputFactory> {\n __staticSelector?: string;\n\n /** Props passed to Styles API context, replaces `Input.Wrapper` props */\n __stylesApiProps?: Record<string, any>;\n\n /** Determines whether the input should have error styles and `aria-invalid` attribute */\n error?: React.ReactNode;\n\n /** Adjusts padding and sizing calculations for multiline inputs (use with `component=\"textarea\"`). Does not make the input multiline by itself. @default false */\n multiline?: boolean;\n\n /** Input element id */\n id?: string;\n\n /** Determines whether `aria-` and other accessibility attributes should be added to the input. Only disable when implementing custom accessibility handling. @default true */\n withAria?: boolean;\n\n /** Props passed down to the root element of the `Input` component */\n wrapperProps?: WrapperProps;\n}\n\nexport type InputFactory = PolymorphicFactory<{\n props: InputProps;\n defaultRef: HTMLInputElement;\n defaultComponent: 'input';\n stylesNames: InputStylesNames;\n variant: InputVariant;\n vars: InputCssVariables;\n ctx: InputStylesCtx;\n staticComponents: {\n Label: typeof InputLabel;\n Error: typeof InputError;\n Description: typeof InputDescription;\n Placeholder: typeof InputPlaceholder;\n Wrapper: typeof InputWrapper;\n ClearButton: typeof InputClearButton;\n };\n}>;\n\nconst defaultProps = {\n variant: 'default',\n leftSectionPointerEvents: 'none',\n rightSectionPointerEvents: 'none',\n withAria: true,\n withErrorStyles: true,\n size: 'sm',\n loading: false,\n loadingPosition: 'right',\n} satisfies Partial<InputProps>;\n\nconst varsResolver = createVarsResolver<InputFactory>((_, props, ctx) => ({\n wrapper: {\n '--input-margin-top': ctx.offsetTop ? 'calc(var(--mantine-spacing-xs) / 2)' : undefined,\n '--input-margin-bottom': ctx.offsetBottom ? 'calc(var(--mantine-spacing-xs) / 2)' : undefined,\n '--input-height': getSize(props.size, 'input-height'),\n '--input-fz': getFontSize(props.size),\n '--input-radius': props.radius === undefined ? undefined : getRadius(props.radius),\n '--input-left-section-width':\n props.leftSectionWidth !== undefined ? rem(props.leftSectionWidth) : undefined,\n '--input-right-section-width':\n props.rightSectionWidth !== undefined ? rem(props.rightSectionWidth) : undefined,\n '--input-padding-y': props.multiline ? getSize(props.size, 'input-padding-y') : undefined,\n '--input-left-section-pointer-events': props.leftSectionPointerEvents,\n '--input-right-section-pointer-events': props.rightSectionPointerEvents,\n },\n}));\n\nexport const Input = polymorphicFactory<InputFactory>((_props) => {\n const props = useProps('Input', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n required,\n __staticSelector,\n __stylesApiProps,\n size,\n wrapperProps,\n error,\n disabled,\n leftSection,\n leftSectionProps,\n leftSectionWidth,\n rightSection,\n rightSectionProps,\n rightSectionWidth,\n rightSectionPointerEvents,\n leftSectionPointerEvents,\n variant,\n vars,\n pointer,\n multiline,\n radius,\n id,\n withAria,\n withErrorStyles,\n mod,\n inputSize,\n attributes,\n __clearSection,\n __clearable,\n __clearSectionMode,\n __defaultRightSection,\n loading,\n loadingPosition,\n ...others\n } = props;\n\n const { styleProps, rest } = extractStyleProps(others);\n const ctx = use(InputWrapperContext);\n const stylesCtx: InputStylesCtx = { offsetBottom: ctx?.offsetBottom, offsetTop: ctx?.offsetTop };\n\n const getStyles = useStyles<InputFactory>({\n name: ['Input', __staticSelector],\n props: __stylesApiProps || props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n stylesCtx,\n rootSelector: 'wrapper',\n vars,\n varsResolver,\n });\n\n const ariaAttributes = withAria\n ? {\n required,\n disabled,\n 'aria-invalid': !!error,\n 'aria-describedby': ctx?.describedBy,\n id: ctx?.inputId || id,\n }\n : {};\n\n const loadingIndicator = loading ? (\n <Loader\n size={\n loadingPosition === 'left'\n ? 'calc(var(--input-left-section-size) / 2)'\n : 'calc(var(--input-right-section-size) / 2)'\n }\n />\n ) : null;\n\n const _leftSection = loading && loadingPosition === 'left' ? loadingIndicator : leftSection;\n const _rightSection: React.ReactNode = InputClearSection({\n __clearable,\n __clearSection,\n rightSection: loading && loadingPosition === 'right' ? loadingIndicator : rightSection,\n __defaultRightSection,\n size,\n __clearSectionMode,\n });\n\n return (\n <InputContext value={{ size: size || 'sm' }}>\n <Box\n {...getStyles('wrapper')}\n {...styleProps}\n {...wrapperProps}\n mod={[\n {\n error: !!error && withErrorStyles,\n pointer,\n disabled,\n multiline,\n 'data-with-right-section': !!_rightSection,\n 'data-with-left-section': !!_leftSection,\n },\n mod,\n ]}\n variant={variant}\n size={size}\n >\n {_leftSection && (\n <div\n {...leftSectionProps}\n data-position=\"left\"\n {...getStyles('section', {\n className: leftSectionProps?.className,\n style: leftSectionProps?.style,\n })}\n >\n {_leftSection}\n </div>\n )}\n\n <Box\n component=\"input\"\n {...rest}\n {...ariaAttributes}\n required={required}\n mod={{ disabled, error: !!error && withErrorStyles }}\n variant={variant}\n __size={inputSize}\n {...getStyles('input')}\n />\n\n {_rightSection && (\n <div\n {...rightSectionProps}\n data-position=\"right\"\n {...getStyles('section', {\n className: rightSectionProps?.className,\n style: rightSectionProps?.style,\n })}\n >\n {_rightSection}\n </div>\n )}\n </Box>\n </InputContext>\n );\n});\n\nInput.classes = classes;\nInput.varsResolver = varsResolver;\nInput.Wrapper = InputWrapper;\nInput.Label = InputLabel;\nInput.Error = InputError;\nInput.Description = InputDescription;\nInput.Placeholder = InputPlaceholder;\nInput.ClearButton = InputClearButton;\nInput.displayName = '@mantine/core/Input';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2KA,MAAM,eAAe;CACnB,SAAS;CACT,0BAA0B;CAC1B,2BAA2B;CAC3B,UAAU;CACV,iBAAiB;CACjB,MAAM;CACN,SAAS;CACT,iBAAiB;CAClB;AAED,MAAM,eAAeA,6BAAAA,oBAAkC,GAAG,OAAO,SAAS,EACxE,SAAS;CACP,sBAAsB,IAAI,YAAY,wCAAwC,KAAA;CAC9E,yBAAyB,IAAI,eAAe,wCAAwC,KAAA;CACpF,kBAAkBC,iBAAAA,QAAQ,MAAM,MAAM,eAAe;CACrD,cAAcC,iBAAAA,YAAY,MAAM,KAAK;CACrC,kBAAkB,MAAM,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,MAAM,OAAO;CAClF,8BACE,MAAM,qBAAqB,KAAA,IAAYC,YAAAA,IAAI,MAAM,iBAAiB,GAAG,KAAA;CACvE,+BACE,MAAM,sBAAsB,KAAA,IAAYA,YAAAA,IAAI,MAAM,kBAAkB,GAAG,KAAA;CACzE,qBAAqB,MAAM,YAAYH,iBAAAA,QAAQ,MAAM,MAAM,kBAAkB,GAAG,KAAA;CAChF,uCAAuC,MAAM;CAC7C,wCAAwC,MAAM;CAC/C,EACF,EAAE;AAEH,MAAa,QAAQI,4BAAAA,oBAAkC,WAAW;CAChE,MAAM,QAAQC,kBAAAA,SAAS,SAAS,cAAc,OAAO;CACrD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,UACA,kBACA,kBACA,MACA,cACA,OACA,UACA,aACA,kBACA,kBACA,cACA,mBACA,mBACA,2BACA,0BACA,SACA,MACA,SACA,WACA,QACA,IACA,UACA,iBACA,KACA,WACA,YACA,gBACA,aACA,oBACA,uBACA,SACA,iBACA,GAAG,WACD;CAEJ,MAAM,EAAE,YAAY,SAASC,4BAAAA,kBAAkB,OAAO;CACtD,MAAM,OAAA,GAAA,MAAA,KAAUC,6BAAAA,oBAAoB;CACpC,MAAM,YAA4B;EAAE,cAAc,KAAK;EAAc,WAAW,KAAK;EAAW;CAEhG,MAAM,YAAYC,mBAAAA,UAAwB;EACxC,MAAM,CAAC,SAAS,iBAAiB;EACjC,OAAO,oBAAoB;EAC3B,SAAA,qBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,CAAC;CAEF,MAAM,iBAAiB,WACnB;EACE;EACA;EACA,gBAAgB,CAAC,CAAC;EAClB,oBAAoB,KAAK;EACzB,IAAI,KAAK,WAAW;EACrB,GACD,EAAE;CAEN,MAAM,mBAAmB,UACvB,iBAAA,GAAA,kBAAA,KAACC,eAAAA,QAAD,EACE,MACE,oBAAoB,SAChB,6CACA,6CAEN,CAAA,GACA;CAEJ,MAAM,eAAe,WAAW,oBAAoB,SAAS,mBAAmB;CAChF,MAAM,gBAAiCC,0BAAAA,kBAAkB;EACvD;EACA;EACA,cAAc,WAAW,oBAAoB,UAAU,mBAAmB;EAC1E;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,cAAD;EAAc,OAAO,EAAE,MAAM,QAAQ,MAAM;YACzC,iBAAA,GAAA,kBAAA,MAACC,YAAAA,KAAD;GACE,GAAI,UAAU,UAAU;GACxB,GAAI;GACJ,GAAI;GACJ,KAAK,CACH;IACE,OAAO,CAAC,CAAC,SAAS;IAClB;IACA;IACA;IACA,2BAA2B,CAAC,CAAC;IAC7B,0BAA0B,CAAC,CAAC;IAC7B,EACD,IACD;GACQ;GACH;aAhBR;IAkBG,gBACC,iBAAA,GAAA,kBAAA,KAAC,OAAD;KACE,GAAI;KACJ,iBAAc;KACd,GAAI,UAAU,WAAW;MACvB,WAAW,kBAAkB;MAC7B,OAAO,kBAAkB;MAC1B,CAAC;eAED;KACG,CAAA;IAGR,iBAAA,GAAA,kBAAA,KAACA,YAAAA,KAAD;KACE,WAAU;KACV,GAAI;KACJ,GAAI;KACM;KACV,KAAK;MAAE;MAAU,OAAO,CAAC,CAAC,SAAS;MAAiB;KAC3C;KACT,QAAQ;KACR,GAAI,UAAU,QAAQ;KACtB,CAAA;IAED,iBACC,iBAAA,GAAA,kBAAA,KAAC,OAAD;KACE,GAAI;KACJ,iBAAc;KACd,GAAI,UAAU,WAAW;MACvB,WAAW,mBAAmB;MAC9B,OAAO,mBAAmB;MAC3B,CAAC;eAED;KACG,CAAA;IAEJ;;EACO,CAAA;EAEjB;AAEF,MAAM,UAAUC,qBAAAA;AAChB,MAAM,eAAe;AACrB,MAAM,UAAUC,qBAAAA;AAChB,MAAM,QAAQC,mBAAAA;AACd,MAAM,QAAQC,mBAAAA;AACd,MAAM,cAAcC,yBAAAA;AACpB,MAAM,cAAcC,yBAAAA;AACpB,MAAM,cAAcC,yBAAAA;AACpB,MAAM,cAAc"}
1
+ {"version":3,"file":"Input.cjs","names":["createVarsResolver","getSize","getFontSize","getRadius","rem","polymorphicFactory","useProps","extractStyleProps","InputWrapperContext","useStyles","Loader","InputClearSection","InputContext","Box","classes","InputWrapper","InputLabel","InputError","InputDescription","InputPlaceholder","InputClearButton"],"sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import { use } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n extractStyleProps,\n getFontSize,\n getRadius,\n getSize,\n MantineRadius,\n MantineSize,\n polymorphicFactory,\n PolymorphicFactory,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { Loader } from '../Loader/Loader';\nimport { InputContext } from './Input.context';\nimport {\n InputClearButton,\n type InputClearButtonProps,\n type InputClearButtonFactory,\n} from './InputClearButton/InputClearButton';\nimport {\n ClearSectionMode,\n InputClearSection,\n type InputClearSectionProps,\n} from './InputClearSection/InputClearSection';\nimport {\n InputDescription,\n type InputDescriptionProps,\n type InputDescriptionStylesNames,\n type InputDescriptionCssVariables,\n type InputDescriptionFactory,\n} from './InputDescription/InputDescription';\nimport {\n InputError,\n type InputErrorProps,\n type InputErrorStylesNames,\n type InputErrorCssVariables,\n type InputErrorFactory,\n} from './InputError/InputError';\nimport {\n InputLabel,\n type InputLabelProps,\n type InputLabelStylesNames,\n type InputLabelCssVariables,\n type InputLabelFactory,\n} from './InputLabel/InputLabel';\nimport {\n InputPlaceholder,\n type InputPlaceholderProps,\n type InputPlaceholderStylesNames,\n type InputPlaceholderFactory,\n} from './InputPlaceholder/InputPlaceholder';\nimport { InputWrapperContext } from './InputWrapper.context';\nimport {\n __InputWrapperProps,\n InputWrapper,\n InputWrapperStylesNames,\n type InputWrapperProps,\n type InputWrapperFactory,\n} from './InputWrapper/InputWrapper';\nimport classes from './Input.module.css';\n// Required to be a separate type for docgen script\ntype WrapperProps = React.ComponentProps<'div'> & DataAttributes;\n\nexport interface __BaseInputProps extends __InputWrapperProps, __InputProps {\n /** Props passed down to the root element */\n wrapperProps?: WrapperProps;\n}\n\nexport type __InputStylesNames = InputStylesNames | InputWrapperStylesNames;\n\nexport type InputStylesNames = 'input' | 'wrapper' | 'section';\nexport type InputVariant = 'default' | 'filled' | 'unstyled';\nexport type InputCssVariables = {\n wrapper:\n | '--input-height'\n | '--input-fz'\n | '--input-radius'\n | '--input-left-section-width'\n | '--input-right-section-width'\n | '--input-left-section-pointer-events'\n | '--input-right-section-pointer-events'\n | '--input-padding-y'\n | '--input-margin-top'\n | '--input-margin-bottom';\n};\n\nexport interface InputStylesCtx {\n offsetTop: boolean | undefined;\n offsetBottom: boolean | undefined;\n}\n\nexport interface __InputProps {\n /** Content section displayed on the left side of the input */\n leftSection?: React.ReactNode;\n\n /** Left section width, used to set `width` of the section and input `padding-left`, by default equals to the input height */\n leftSectionWidth?: React.CSSProperties['width'];\n\n /** Props passed down to the `leftSection` element */\n leftSectionProps?: React.ComponentProps<'div'>;\n\n /** Sets `pointer-events` styles on the `leftSection` element. Use `'all'` when section contains interactive elements (buttons, links). @default 'none' */\n leftSectionPointerEvents?: React.CSSProperties['pointerEvents'];\n\n /** Content section displayed on the right side of the input */\n rightSection?: React.ReactNode;\n\n /** Right section width, used to set `width` of the section and input `padding-right`, by default equals to the input height */\n rightSectionWidth?: React.CSSProperties['width'];\n\n /** Props passed down to the `rightSection` element */\n rightSectionProps?: React.ComponentProps<'div'>;\n\n /** Sets `pointer-events` styles on the `rightSection` element. Use `'all'` when section contains interactive elements (buttons, links). @default 'none' */\n rightSectionPointerEvents?: React.CSSProperties['pointerEvents'];\n\n /** Sets `required` attribute on the `input` element */\n required?: boolean;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius`, numbers are converted to rem @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Sets `disabled` attribute on the `input` element */\n disabled?: boolean;\n\n /** Controls input `height`, horizontal `padding`, and `font-size` @default 'sm' */\n size?: MantineSize | (string & {});\n\n /** Determines whether the input should have `cursor: pointer` style. Use when input acts as a button-like trigger (e.g., `component=\"button\"` for Select/DatePicker). @default false */\n pointer?: boolean;\n\n /** Determines whether the input should have red border and red text color when the `error` prop is set @default true */\n withErrorStyles?: boolean;\n\n /** HTML `size` attribute for the input element (number of visible characters) */\n inputSize?: string;\n\n /** Section to be displayed when the input is `__clearable` and `rightSection` is not defined */\n __clearSection?: React.ReactNode;\n\n /** Determines whether the `__clearSection` should be displayed if it is passed to the component, has no effect if `rightSection` is defined */\n __clearable?: boolean;\n\n /** Determines how the clear button and rightSection are rendered @default 'both' */\n __clearSectionMode?: ClearSectionMode;\n\n /** Right section displayed when both `__clearSection` and `rightSection` are not defined */\n __defaultRightSection?: React.ReactNode;\n\n /** Displays loading indicator in the left or right section @default false */\n loading?: boolean;\n\n /** Position of the loading indicator @default 'right' */\n loadingPosition?: 'left' | 'right';\n}\n\nexport interface InputProps extends BoxProps, __InputProps, StylesApiProps<InputFactory> {\n __staticSelector?: string;\n\n /** Props passed to Styles API context, replaces `Input.Wrapper` props */\n __stylesApiProps?: Record<string, any>;\n\n /** Determines whether the input should have error styles and `aria-invalid` attribute */\n error?: React.ReactNode;\n\n /** Adjusts padding and sizing calculations for multiline inputs (use with `component=\"textarea\"`). Does not make the input multiline by itself. @default false */\n multiline?: boolean;\n\n /** Input element id */\n id?: string;\n\n /** Determines whether `aria-` and other accessibility attributes should be added to the input. Only disable when implementing custom accessibility handling. @default true */\n withAria?: boolean;\n\n /** Props passed down to the root element of the `Input` component */\n wrapperProps?: WrapperProps;\n\n /** Root element ref */\n rootRef?: React.Ref<HTMLDivElement>;\n}\n\nexport type InputFactory = PolymorphicFactory<{\n props: InputProps;\n defaultRef: HTMLInputElement;\n defaultComponent: 'input';\n stylesNames: InputStylesNames;\n variant: InputVariant;\n vars: InputCssVariables;\n ctx: InputStylesCtx;\n staticComponents: {\n Label: typeof InputLabel;\n Error: typeof InputError;\n Description: typeof InputDescription;\n Placeholder: typeof InputPlaceholder;\n Wrapper: typeof InputWrapper;\n ClearButton: typeof InputClearButton;\n };\n}>;\n\nconst defaultProps = {\n variant: 'default',\n leftSectionPointerEvents: 'none',\n rightSectionPointerEvents: 'none',\n withAria: true,\n withErrorStyles: true,\n size: 'sm',\n loading: false,\n loadingPosition: 'right',\n} satisfies Partial<InputProps>;\n\nconst varsResolver = createVarsResolver<InputFactory>((_, props, ctx) => ({\n wrapper: {\n '--input-margin-top': ctx.offsetTop ? 'calc(var(--mantine-spacing-xs) / 2)' : undefined,\n '--input-margin-bottom': ctx.offsetBottom ? 'calc(var(--mantine-spacing-xs) / 2)' : undefined,\n '--input-height': getSize(props.size, 'input-height'),\n '--input-fz': getFontSize(props.size),\n '--input-radius': props.radius === undefined ? undefined : getRadius(props.radius),\n '--input-left-section-width':\n props.leftSectionWidth !== undefined ? rem(props.leftSectionWidth) : undefined,\n '--input-right-section-width':\n props.rightSectionWidth !== undefined ? rem(props.rightSectionWidth) : undefined,\n '--input-padding-y': props.multiline ? getSize(props.size, 'input-padding-y') : undefined,\n '--input-left-section-pointer-events': props.leftSectionPointerEvents,\n '--input-right-section-pointer-events': props.rightSectionPointerEvents,\n },\n}));\n\nexport const Input = polymorphicFactory<InputFactory>((_props) => {\n const props = useProps('Input', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n required,\n __staticSelector,\n __stylesApiProps,\n size,\n wrapperProps,\n error,\n disabled,\n leftSection,\n leftSectionProps,\n leftSectionWidth,\n rightSection,\n rightSectionProps,\n rightSectionWidth,\n rightSectionPointerEvents,\n leftSectionPointerEvents,\n variant,\n vars,\n pointer,\n multiline,\n radius,\n id,\n withAria,\n withErrorStyles,\n mod,\n inputSize,\n attributes,\n __clearSection,\n __clearable,\n __clearSectionMode,\n __defaultRightSection,\n loading,\n loadingPosition,\n rootRef,\n ...others\n } = props;\n\n const { styleProps, rest } = extractStyleProps(others);\n const ctx = use(InputWrapperContext);\n const stylesCtx: InputStylesCtx = { offsetBottom: ctx?.offsetBottom, offsetTop: ctx?.offsetTop };\n\n const getStyles = useStyles<InputFactory>({\n name: ['Input', __staticSelector],\n props: __stylesApiProps || props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n stylesCtx,\n rootSelector: 'wrapper',\n vars,\n varsResolver,\n });\n\n const ariaAttributes = withAria\n ? {\n required,\n disabled,\n 'aria-invalid': error ? true : undefined,\n 'aria-describedby': ctx?.describedBy,\n id: ctx?.inputId || id,\n }\n : {};\n\n const loadingIndicator = loading ? (\n <Loader\n size={\n loadingPosition === 'left'\n ? 'calc(var(--input-left-section-size) / 2)'\n : 'calc(var(--input-right-section-size) / 2)'\n }\n />\n ) : null;\n\n const _leftSection = loading && loadingPosition === 'left' ? loadingIndicator : leftSection;\n const _rightSection: React.ReactNode = InputClearSection({\n __clearable,\n __clearSection,\n rightSection: loading && loadingPosition === 'right' ? loadingIndicator : rightSection,\n __defaultRightSection,\n size,\n __clearSectionMode,\n });\n\n return (\n <InputContext value={{ size: size || 'sm' }}>\n <Box\n ref={rootRef}\n {...getStyles('wrapper')}\n {...styleProps}\n {...wrapperProps}\n mod={[\n {\n error: !!error && withErrorStyles,\n pointer,\n disabled,\n multiline,\n 'data-with-right-section': !!_rightSection,\n 'data-with-left-section': !!_leftSection,\n },\n mod,\n ]}\n variant={variant}\n size={size}\n >\n {_leftSection && (\n <div\n {...leftSectionProps}\n data-position=\"left\"\n {...getStyles('section', {\n className: leftSectionProps?.className,\n style: leftSectionProps?.style,\n })}\n >\n {_leftSection}\n </div>\n )}\n\n <Box\n component=\"input\"\n {...rest}\n {...ariaAttributes}\n required={required}\n mod={{ disabled, error: !!error && withErrorStyles }}\n variant={variant}\n __size={inputSize}\n {...getStyles('input')}\n />\n\n {_rightSection && (\n <div\n {...rightSectionProps}\n data-position=\"right\"\n {...getStyles('section', {\n className: rightSectionProps?.className,\n style: rightSectionProps?.style,\n })}\n >\n {_rightSection}\n </div>\n )}\n </Box>\n </InputContext>\n );\n});\n\nInput.classes = classes;\nInput.varsResolver = varsResolver;\nInput.Wrapper = InputWrapper;\nInput.Label = InputLabel;\nInput.Error = InputError;\nInput.Description = InputDescription;\nInput.Placeholder = InputPlaceholder;\nInput.ClearButton = InputClearButton;\nInput.displayName = '@mantine/core/Input';\n\nexport namespace Input {\n export type Props = InputProps;\n export type StylesNames = InputStylesNames;\n export type CssVariables = InputCssVariables;\n export type Factory = InputFactory;\n\n export namespace Wrapper {\n export type Props = InputWrapperProps;\n export type StylesNames = InputWrapperStylesNames;\n export type Factory = InputWrapperFactory;\n }\n\n export namespace Description {\n export type Props = InputDescriptionProps;\n export type StylesNames = InputDescriptionStylesNames;\n export type CssVariables = InputDescriptionCssVariables;\n export type Factory = InputDescriptionFactory;\n }\n\n export namespace Error {\n export type Props = InputErrorProps;\n export type StylesNames = InputErrorStylesNames;\n export type CssVariables = InputErrorCssVariables;\n export type Factory = InputErrorFactory;\n }\n\n export namespace Label {\n export type Props = InputLabelProps;\n export type StylesNames = InputLabelStylesNames;\n export type CssVariables = InputLabelCssVariables;\n export type Factory = InputLabelFactory;\n }\n\n export namespace Placeholder {\n export type Props = InputPlaceholderProps;\n export type StylesNames = InputPlaceholderStylesNames;\n export type Factory = InputPlaceholderFactory;\n }\n\n export namespace ClearButton {\n export type Props = InputClearButtonProps;\n export type Factory = InputClearButtonFactory;\n }\n\n export namespace ClearSection {\n export type Props = InputClearSectionProps;\n export type Mode = ClearSectionMode;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8MA,MAAM,eAAe;CACnB,SAAS;CACT,0BAA0B;CAC1B,2BAA2B;CAC3B,UAAU;CACV,iBAAiB;CACjB,MAAM;CACN,SAAS;CACT,iBAAiB;CAClB;AAED,MAAM,eAAeA,6BAAAA,oBAAkC,GAAG,OAAO,SAAS,EACxE,SAAS;CACP,sBAAsB,IAAI,YAAY,wCAAwC,KAAA;CAC9E,yBAAyB,IAAI,eAAe,wCAAwC,KAAA;CACpF,kBAAkBC,iBAAAA,QAAQ,MAAM,MAAM,eAAe;CACrD,cAAcC,iBAAAA,YAAY,MAAM,KAAK;CACrC,kBAAkB,MAAM,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,MAAM,OAAO;CAClF,8BACE,MAAM,qBAAqB,KAAA,IAAYC,YAAAA,IAAI,MAAM,iBAAiB,GAAG,KAAA;CACvE,+BACE,MAAM,sBAAsB,KAAA,IAAYA,YAAAA,IAAI,MAAM,kBAAkB,GAAG,KAAA;CACzE,qBAAqB,MAAM,YAAYH,iBAAAA,QAAQ,MAAM,MAAM,kBAAkB,GAAG,KAAA;CAChF,uCAAuC,MAAM;CAC7C,wCAAwC,MAAM;CAC/C,EACF,EAAE;AAEH,MAAa,QAAQI,4BAAAA,oBAAkC,WAAW;CAChE,MAAM,QAAQC,kBAAAA,SAAS,SAAS,cAAc,OAAO;CACrD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,UACA,kBACA,kBACA,MACA,cACA,OACA,UACA,aACA,kBACA,kBACA,cACA,mBACA,mBACA,2BACA,0BACA,SACA,MACA,SACA,WACA,QACA,IACA,UACA,iBACA,KACA,WACA,YACA,gBACA,aACA,oBACA,uBACA,SACA,iBACA,SACA,GAAG,WACD;CAEJ,MAAM,EAAE,YAAY,SAASC,4BAAAA,kBAAkB,OAAO;CACtD,MAAM,OAAA,GAAA,MAAA,KAAUC,6BAAAA,oBAAoB;CACpC,MAAM,YAA4B;EAAE,cAAc,KAAK;EAAc,WAAW,KAAK;EAAW;CAEhG,MAAM,YAAYC,mBAAAA,UAAwB;EACxC,MAAM,CAAC,SAAS,iBAAiB;EACjC,OAAO,oBAAoB;EAC3B,SAAA,qBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,CAAC;CAEF,MAAM,iBAAiB,WACnB;EACE;EACA;EACA,gBAAgB,QAAQ,OAAO,KAAA;EAC/B,oBAAoB,KAAK;EACzB,IAAI,KAAK,WAAW;EACrB,GACD,EAAE;CAEN,MAAM,mBAAmB,UACvB,iBAAA,GAAA,kBAAA,KAACC,eAAAA,QAAD,EACE,MACE,oBAAoB,SAChB,6CACA,6CAEN,CAAA,GACA;CAEJ,MAAM,eAAe,WAAW,oBAAoB,SAAS,mBAAmB;CAChF,MAAM,gBAAiCC,0BAAAA,kBAAkB;EACvD;EACA;EACA,cAAc,WAAW,oBAAoB,UAAU,mBAAmB;EAC1E;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,cAAD;EAAc,OAAO,EAAE,MAAM,QAAQ,MAAM;YACzC,iBAAA,GAAA,kBAAA,MAACC,YAAAA,KAAD;GACE,KAAK;GACL,GAAI,UAAU,UAAU;GACxB,GAAI;GACJ,GAAI;GACJ,KAAK,CACH;IACE,OAAO,CAAC,CAAC,SAAS;IAClB;IACA;IACA;IACA,2BAA2B,CAAC,CAAC;IAC7B,0BAA0B,CAAC,CAAC;IAC7B,EACD,IACD;GACQ;GACH;aAjBR;IAmBG,gBACC,iBAAA,GAAA,kBAAA,KAAC,OAAD;KACE,GAAI;KACJ,iBAAc;KACd,GAAI,UAAU,WAAW;MACvB,WAAW,kBAAkB;MAC7B,OAAO,kBAAkB;MAC1B,CAAC;eAED;KACG,CAAA;IAGR,iBAAA,GAAA,kBAAA,KAACA,YAAAA,KAAD;KACE,WAAU;KACV,GAAI;KACJ,GAAI;KACM;KACV,KAAK;MAAE;MAAU,OAAO,CAAC,CAAC,SAAS;MAAiB;KAC3C;KACT,QAAQ;KACR,GAAI,UAAU,QAAQ;KACtB,CAAA;IAED,iBACC,iBAAA,GAAA,kBAAA,KAAC,OAAD;KACE,GAAI;KACJ,iBAAc;KACd,GAAI,UAAU,WAAW;MACvB,WAAW,mBAAmB;MAC9B,OAAO,mBAAmB;MAC3B,CAAC;eAED;KACG,CAAA;IAEJ;;EACO,CAAA;EAEjB;AAEF,MAAM,UAAUC,qBAAAA;AAChB,MAAM,eAAe;AACrB,MAAM,UAAUC,qBAAAA;AAChB,MAAM,QAAQC,mBAAAA;AACd,MAAM,QAAQC,mBAAAA;AACd,MAAM,cAAcC,yBAAAA;AACpB,MAAM,cAAcC,yBAAAA;AACpB,MAAM,cAAcC,yBAAAA;AACpB,MAAM,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"InputBase.cjs","names":["polymorphicFactory","useInputProps","Input"],"sources":["../../../src/components/InputBase/InputBase.tsx"],"sourcesContent":["import {\n BoxProps,\n DataAttributes,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n} from '../../core';\nimport { __BaseInputProps, __InputStylesNames, Input, InputVariant, useInputProps } from '../Input';\n\nexport interface InputBaseProps\n extends BoxProps, __BaseInputProps, StylesApiProps<InputBaseFactory> {\n __staticSelector?: string;\n __stylesApiProps?: Record<string, any>;\n\n /** Props passed down to the root element (`Input.Wrapper` component) */\n wrapperProps?: React.ComponentProps<'div'> & DataAttributes;\n\n /** If set, the input can have multiple lines, for example when `component=\"textarea\"` @default false */\n multiline?: boolean;\n\n /** If set, `aria-` and other accessibility attributes are added to the input @default true */\n withAria?: boolean;\n}\n\nexport type InputBaseFactory = PolymorphicFactory<{\n props: InputBaseProps;\n defaultRef: HTMLInputElement;\n defaultComponent: 'input';\n stylesNames: __InputStylesNames;\n variant: InputVariant;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'InputBase',\n withAria: true,\n size: 'sm',\n} satisfies Partial<InputBaseProps>;\n\nexport const InputBase = polymorphicFactory<InputBaseFactory>((props) => {\n const { inputProps, wrapperProps, ...others } = useInputProps('InputBase', defaultProps, props);\n return (\n <Input.Wrapper {...wrapperProps}>\n <Input {...inputProps} {...others} />\n </Input.Wrapper>\n );\n});\n\nInputBase.classes = { ...Input.classes, ...Input.Wrapper.classes };\nInputBase.displayName = '@mantine/core/InputBase';\n"],"mappings":";;;;;;;AAgCA,MAAM,eAAe;CACnB,kBAAkB;CAClB,UAAU;CACV,MAAM;CACP;AAED,MAAa,YAAYA,4BAAAA,oBAAsC,UAAU;CACvE,MAAM,EAAE,YAAY,cAAc,GAAG,WAAWC,wBAAAA,cAAc,aAAa,cAAc,MAAM;AAC/F,QACE,iBAAA,GAAA,kBAAA,KAACC,cAAAA,MAAM,SAAP;EAAe,GAAI;YACjB,iBAAA,GAAA,kBAAA,KAACA,cAAAA,OAAD;GAAO,GAAI;GAAY,GAAI;GAAU,CAAA;EACvB,CAAA;EAElB;AAEF,UAAU,UAAU;CAAE,GAAGA,cAAAA,MAAM;CAAS,GAAGA,cAAAA,MAAM,QAAQ;CAAS;AAClE,UAAU,cAAc"}
1
+ {"version":3,"file":"InputBase.cjs","names":["polymorphicFactory","useInputProps","Input"],"sources":["../../../src/components/InputBase/InputBase.tsx"],"sourcesContent":["import {\n BoxProps,\n DataAttributes,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n} from '../../core';\nimport { __BaseInputProps, __InputStylesNames, Input, InputVariant, useInputProps } from '../Input';\n\nexport interface InputBaseProps\n extends BoxProps, __BaseInputProps, StylesApiProps<InputBaseFactory> {\n __staticSelector?: string;\n __stylesApiProps?: Record<string, any>;\n\n /** Props passed down to the root element (`Input.Wrapper` component) */\n wrapperProps?: React.ComponentProps<'div'> & DataAttributes;\n\n /** If set, the input can have multiple lines, for example when `component=\"textarea\"` @default false */\n multiline?: boolean;\n\n /** If set, `aria-` and other accessibility attributes are added to the input @default true */\n withAria?: boolean;\n}\n\nexport type InputBaseFactory = PolymorphicFactory<{\n props: InputBaseProps;\n defaultRef: HTMLInputElement;\n defaultComponent: 'input';\n stylesNames: __InputStylesNames;\n variant: InputVariant;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'InputBase',\n withAria: true,\n size: 'sm',\n} satisfies Partial<InputBaseProps>;\n\nexport const InputBase = polymorphicFactory<InputBaseFactory>((props) => {\n const { inputProps, wrapperProps, ...others } = useInputProps('InputBase', defaultProps, props);\n return (\n <Input.Wrapper {...wrapperProps}>\n <Input {...inputProps} {...others} />\n </Input.Wrapper>\n );\n});\n\nInputBase.classes = { ...Input.classes, ...Input.Wrapper.classes };\nInputBase.displayName = '@mantine/core/InputBase';\n\nexport namespace InputBase {\n export type Props = InputBaseProps;\n export type Factory = InputBaseFactory;\n}\n"],"mappings":";;;;;;;AAgCA,MAAM,eAAe;CACnB,kBAAkB;CAClB,UAAU;CACV,MAAM;CACP;AAED,MAAa,YAAYA,4BAAAA,oBAAsC,UAAU;CACvE,MAAM,EAAE,YAAY,cAAc,GAAG,WAAWC,wBAAAA,cAAc,aAAa,cAAc,MAAM;AAC/F,QACE,iBAAA,GAAA,kBAAA,KAACC,cAAAA,MAAM,SAAP;EAAe,GAAI;YACjB,iBAAA,GAAA,kBAAA,KAACA,cAAAA,OAAD;GAAO,GAAI;GAAY,GAAI;GAAU,CAAA;EACvB,CAAA;EAElB;AAEF,UAAU,UAAU;CAAE,GAAGA,cAAAA,MAAM;CAAS,GAAGA,cAAAA,MAAM,QAAQ;CAAS;AAClE,UAAU,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"JsonInput.cjs","names":["factory","useProps","validateJson","Textarea","InputBase"],"sources":["../../../src/components/JsonInput/JsonInput.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { factory, Factory, useProps } from '../../core';\nimport { __InputStylesNames } from '../Input';\nimport { InputBase } from '../InputBase';\nimport { Textarea, TextareaProps } from '../Textarea';\nimport { validateJson } from './validate-json/validate-json';\n\nexport interface JsonInputProps extends Omit<TextareaProps, 'onChange'> {\n /** Controlled component value */\n value?: string;\n\n /** Uncontrolled component default value */\n defaultValue?: string;\n\n /** Called when value changes */\n onChange?: (value: string) => void;\n\n /** Determines whether the value should be formatted on blur @default false */\n formatOnBlur?: boolean;\n\n /** Error message shown when the input value is invalid JSON (checked on blur). If not provided, a generic error state is shown. Takes precedence over the `error` prop when validation fails. */\n validationError?: React.ReactNode;\n\n /** Function to serialize value into a string for formatting. Called with (value, null, 2) where 2 is the indentation level. @default JSON.stringify */\n serialize?: typeof JSON.stringify;\n\n /** Function to deserialize string value for formatting and validation. Must throw an error if the string is invalid JSON. @default JSON.parse */\n deserialize?: typeof JSON.parse;\n\n /** Number of spaces to use as white space for formatting. Passed as the third argument to `serialize` function. @default 2 */\n indentSpaces?: number;\n}\n\nexport type JsonInputFactory = Factory<{\n props: JsonInputProps;\n ref: HTMLTextAreaElement;\n stylesNames: __InputStylesNames;\n}>;\n\nconst defaultProps = {\n serialize: JSON.stringify,\n deserialize: JSON.parse,\n size: 'sm',\n indentSpaces: 2,\n} satisfies Partial<JsonInputProps>;\n\nexport const JsonInput = factory<JsonInputFactory>((props) => {\n const {\n value,\n defaultValue,\n onChange,\n formatOnBlur,\n validationError,\n serialize,\n deserialize,\n onFocus,\n onBlur,\n readOnly,\n error,\n indentSpaces,\n ...others\n } = useProps('JsonInput', defaultProps, props);\n\n const [_value, setValue] = useUncontrolled({\n value,\n defaultValue,\n finalValue: '',\n onChange,\n });\n\n const [valid, setValid] = useState(validateJson(_value, deserialize));\n\n const handleFocus = (event: React.FocusEvent<HTMLTextAreaElement>) => {\n onFocus?.(event);\n setValid(true);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLTextAreaElement>) => {\n onBlur?.(event);\n const isValid = validateJson(event.currentTarget.value, deserialize);\n formatOnBlur &&\n !readOnly &&\n isValid &&\n event.currentTarget.value.trim() !== '' &&\n setValue(serialize(deserialize(event.currentTarget.value), null, indentSpaces));\n setValid(isValid);\n };\n\n return (\n <Textarea\n value={_value}\n onChange={(event) => setValue(event.currentTarget.value)}\n onFocus={handleFocus}\n onBlur={handleBlur}\n readOnly={readOnly}\n {...others}\n autoComplete=\"off\"\n __staticSelector=\"JsonInput\"\n error={valid ? error : validationError || true}\n data-monospace\n />\n );\n});\n\nJsonInput.classes = InputBase.classes;\nJsonInput.displayName = '@mantine/core/JsonInput';\n"],"mappings":";;;;;;;;;;;AAwCA,MAAM,eAAe;CACnB,WAAW,KAAK;CAChB,aAAa,KAAK;CAClB,MAAM;CACN,cAAc;CACf;AAED,MAAa,YAAYA,gBAAAA,SAA2B,UAAU;CAC5D,MAAM,EACJ,OACA,cACA,UACA,cACA,iBACA,WACA,aACA,SACA,QACA,UACA,OACA,cACA,GAAG,WACDC,kBAAAA,SAAS,aAAa,cAAc,MAAM;CAE9C,MAAM,CAAC,QAAQ,aAAA,GAAA,eAAA,iBAA4B;EACzC;EACA;EACA,YAAY;EACZ;EACD,CAAC;CAEF,MAAM,CAAC,OAAO,aAAA,GAAA,MAAA,UAAqBC,sBAAAA,aAAa,QAAQ,YAAY,CAAC;CAErE,MAAM,eAAe,UAAiD;AACpE,YAAU,MAAM;AAChB,WAAS,KAAK;;CAGhB,MAAM,cAAc,UAAiD;AACnE,WAAS,MAAM;EACf,MAAM,UAAUA,sBAAAA,aAAa,MAAM,cAAc,OAAO,YAAY;AACpE,kBACE,CAAC,YACD,WACA,MAAM,cAAc,MAAM,MAAM,KAAK,MACrC,SAAS,UAAU,YAAY,MAAM,cAAc,MAAM,EAAE,MAAM,aAAa,CAAC;AACjF,WAAS,QAAQ;;AAGnB,QACE,iBAAA,GAAA,kBAAA,KAACC,iBAAAA,UAAD;EACE,OAAO;EACP,WAAW,UAAU,SAAS,MAAM,cAAc,MAAM;EACxD,SAAS;EACT,QAAQ;EACE;EACV,GAAI;EACJ,cAAa;EACb,kBAAiB;EACjB,OAAO,QAAQ,QAAQ,mBAAmB;EAC1C,kBAAA;EACA,CAAA;EAEJ;AAEF,UAAU,UAAUC,kBAAAA,UAAU;AAC9B,UAAU,cAAc"}
1
+ {"version":3,"file":"JsonInput.cjs","names":["factory","useProps","validateJson","Textarea","InputBase"],"sources":["../../../src/components/JsonInput/JsonInput.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { factory, Factory, useProps } from '../../core';\nimport { __InputStylesNames } from '../Input';\nimport { InputBase } from '../InputBase';\nimport { Textarea, TextareaProps } from '../Textarea';\nimport { validateJson } from './validate-json/validate-json';\n\nexport interface JsonInputProps extends Omit<TextareaProps, 'onChange'> {\n /** Controlled component value */\n value?: string;\n\n /** Uncontrolled component default value */\n defaultValue?: string;\n\n /** Called when value changes */\n onChange?: (value: string) => void;\n\n /** Determines whether the value should be formatted on blur @default false */\n formatOnBlur?: boolean;\n\n /** Error message shown when the input value is invalid JSON (checked on blur). If not provided, a generic error state is shown. Takes precedence over the `error` prop when validation fails. */\n validationError?: React.ReactNode;\n\n /** Function to serialize value into a string for formatting. Called with (value, null, 2) where 2 is the indentation level. @default JSON.stringify */\n serialize?: typeof JSON.stringify;\n\n /** Function to deserialize string value for formatting and validation. Must throw an error if the string is invalid JSON. @default JSON.parse */\n deserialize?: typeof JSON.parse;\n\n /** Number of spaces to use as white space for formatting. Passed as the third argument to `serialize` function. @default 2 */\n indentSpaces?: number;\n}\n\nexport type JsonInputFactory = Factory<{\n props: JsonInputProps;\n ref: HTMLTextAreaElement;\n stylesNames: __InputStylesNames;\n}>;\n\nconst defaultProps = {\n serialize: JSON.stringify,\n deserialize: JSON.parse,\n size: 'sm',\n indentSpaces: 2,\n} satisfies Partial<JsonInputProps>;\n\nexport const JsonInput = factory<JsonInputFactory>((props) => {\n const {\n value,\n defaultValue,\n onChange,\n formatOnBlur,\n validationError,\n serialize,\n deserialize,\n onFocus,\n onBlur,\n readOnly,\n error,\n indentSpaces,\n ...others\n } = useProps('JsonInput', defaultProps, props);\n\n const [_value, setValue] = useUncontrolled({\n value,\n defaultValue,\n finalValue: '',\n onChange,\n });\n\n const [valid, setValid] = useState(validateJson(_value, deserialize));\n\n const handleFocus = (event: React.FocusEvent<HTMLTextAreaElement>) => {\n onFocus?.(event);\n setValid(true);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLTextAreaElement>) => {\n onBlur?.(event);\n const isValid = validateJson(event.currentTarget.value, deserialize);\n formatOnBlur &&\n !readOnly &&\n isValid &&\n event.currentTarget.value.trim() !== '' &&\n setValue(serialize(deserialize(event.currentTarget.value), null, indentSpaces));\n setValid(isValid);\n };\n\n return (\n <Textarea\n value={_value}\n onChange={(event) => setValue(event.currentTarget.value)}\n onFocus={handleFocus}\n onBlur={handleBlur}\n readOnly={readOnly}\n {...others}\n autoComplete=\"off\"\n __staticSelector=\"JsonInput\"\n error={valid ? error : validationError || true}\n data-monospace\n />\n );\n});\n\nJsonInput.classes = InputBase.classes;\nJsonInput.displayName = '@mantine/core/JsonInput';\n\nexport namespace JsonInput {\n export type Props = JsonInputProps;\n export type Factory = JsonInputFactory;\n}\n"],"mappings":";;;;;;;;;;;AAwCA,MAAM,eAAe;CACnB,WAAW,KAAK;CAChB,aAAa,KAAK;CAClB,MAAM;CACN,cAAc;CACf;AAED,MAAa,YAAYA,gBAAAA,SAA2B,UAAU;CAC5D,MAAM,EACJ,OACA,cACA,UACA,cACA,iBACA,WACA,aACA,SACA,QACA,UACA,OACA,cACA,GAAG,WACDC,kBAAAA,SAAS,aAAa,cAAc,MAAM;CAE9C,MAAM,CAAC,QAAQ,aAAA,GAAA,eAAA,iBAA4B;EACzC;EACA;EACA,YAAY;EACZ;EACD,CAAC;CAEF,MAAM,CAAC,OAAO,aAAA,GAAA,MAAA,UAAqBC,sBAAAA,aAAa,QAAQ,YAAY,CAAC;CAErE,MAAM,eAAe,UAAiD;AACpE,YAAU,MAAM;AAChB,WAAS,KAAK;;CAGhB,MAAM,cAAc,UAAiD;AACnE,WAAS,MAAM;EACf,MAAM,UAAUA,sBAAAA,aAAa,MAAM,cAAc,OAAO,YAAY;AACpE,kBACE,CAAC,YACD,WACA,MAAM,cAAc,MAAM,MAAM,KAAK,MACrC,SAAS,UAAU,YAAY,MAAM,cAAc,MAAM,EAAE,MAAM,aAAa,CAAC;AACjF,WAAS,QAAQ;;AAGnB,QACE,iBAAA,GAAA,kBAAA,KAACC,iBAAAA,UAAD;EACE,OAAO;EACP,WAAW,UAAU,SAAS,MAAM,cAAc,MAAM;EACxD,SAAS;EACT,QAAQ;EACE;EACV,GAAI;EACJ,cAAa;EACb,kBAAiB;EACjB,OAAO,QAAQ,QAAQ,mBAAmB;EAC1C,kBAAA;EACA,CAAA;EAEJ;AAEF,UAAU,UAAUC,kBAAAA,UAAU;AAC9B,UAAU,cAAc"}