@mantine/core 9.0.0-alpha.7 → 9.0.1

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 (505) 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/Blockquote/Blockquote.cjs.map +1 -1
  16. package/cjs/components/Breadcrumbs/Breadcrumbs.cjs.map +1 -1
  17. package/cjs/components/Burger/Burger.cjs.map +1 -1
  18. package/cjs/components/Button/Button.cjs.map +1 -1
  19. package/cjs/components/Button/Button.module.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 +2 -1
  23. package/cjs/components/Checkbox/Checkbox.cjs.map +1 -1
  24. package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.cjs.map +1 -1
  25. package/cjs/components/Checkbox/CheckboxIndicator/CheckboxIndicator.cjs +2 -1
  26. package/cjs/components/Checkbox/CheckboxIndicator/CheckboxIndicator.cjs.map +1 -1
  27. package/cjs/components/Chip/Chip.cjs.map +1 -1
  28. package/cjs/components/Chip/Chip.module.cjs.map +1 -1
  29. package/cjs/components/Chip/ChipGroup/ChipGroup.cjs.map +1 -1
  30. package/cjs/components/CloseButton/CloseButton.cjs.map +1 -1
  31. package/cjs/components/Code/Code.cjs.map +1 -1
  32. package/cjs/components/Collapse/Collapse.cjs.map +1 -1
  33. package/cjs/components/ColorInput/ColorInput.cjs.map +1 -1
  34. package/cjs/components/ColorPicker/AlphaSlider/AlphaSlider.cjs.map +1 -1
  35. package/cjs/components/ColorPicker/ColorPicker.cjs.map +1 -1
  36. package/cjs/components/ColorPicker/HueSlider/HueSlider.cjs.map +1 -1
  37. package/cjs/components/ColorSwatch/ColorSwatch.cjs.map +1 -1
  38. package/cjs/components/Combobox/ComboboxTarget/ComboboxTarget.cjs +1 -0
  39. package/cjs/components/Combobox/ComboboxTarget/ComboboxTarget.cjs.map +1 -1
  40. package/cjs/components/Combobox/use-combobox-target-props/use-combobox-target-props.cjs.map +1 -1
  41. package/cjs/components/Container/Container.cjs.map +1 -1
  42. package/cjs/components/Dialog/Dialog.cjs.map +1 -1
  43. package/cjs/components/Divider/Divider.cjs.map +1 -1
  44. package/cjs/components/Fieldset/Fieldset.cjs.map +1 -1
  45. package/cjs/components/FileButton/FileButton.cjs.map +1 -1
  46. package/cjs/components/FileInput/FileInput.cjs.map +1 -1
  47. package/cjs/components/Flex/Flex.cjs.map +1 -1
  48. package/cjs/components/FloatingIndicator/FloatingIndicator.cjs.map +1 -1
  49. package/cjs/components/FloatingWindow/FloatingWindow.cjs.map +1 -1
  50. package/cjs/components/Grid/Grid.cjs.map +1 -1
  51. package/cjs/components/Group/Group.cjs.map +1 -1
  52. package/cjs/components/Highlight/Highlight.cjs.map +1 -1
  53. package/cjs/components/Image/Image.cjs.map +1 -1
  54. package/cjs/components/Indicator/Indicator.cjs.map +1 -1
  55. package/cjs/components/Input/Input.cjs +3 -2
  56. package/cjs/components/Input/Input.cjs.map +1 -1
  57. package/cjs/components/InputBase/InputBase.cjs.map +1 -1
  58. package/cjs/components/JsonInput/JsonInput.cjs.map +1 -1
  59. package/cjs/components/Kbd/Kbd.cjs.map +1 -1
  60. package/cjs/components/List/List.cjs.map +1 -1
  61. package/cjs/components/Loader/Loader.cjs.map +1 -1
  62. package/cjs/components/LoadingOverlay/LoadingOverlay.cjs +1 -0
  63. package/cjs/components/LoadingOverlay/LoadingOverlay.cjs.map +1 -1
  64. package/cjs/components/Mark/Mark.cjs.map +1 -1
  65. package/cjs/components/Marquee/Marquee.cjs.map +1 -1
  66. package/cjs/components/Menu/Menu.cjs.map +1 -1
  67. package/cjs/components/Modal/Modal.cjs.map +1 -1
  68. package/cjs/components/MultiSelect/MultiSelect.cjs +3 -1
  69. package/cjs/components/MultiSelect/MultiSelect.cjs.map +1 -1
  70. package/cjs/components/NativeSelect/NativeSelect.cjs +4 -1
  71. package/cjs/components/NativeSelect/NativeSelect.cjs.map +1 -1
  72. package/cjs/components/NavLink/NavLink.cjs.map +1 -1
  73. package/cjs/components/Notification/Notification.cjs.map +1 -1
  74. package/cjs/components/NumberInput/NumberInput.cjs +1 -0
  75. package/cjs/components/NumberInput/NumberInput.cjs.map +1 -1
  76. package/cjs/components/OverflowList/OverflowList.cjs.map +1 -1
  77. package/cjs/components/Overlay/Overlay.cjs.map +1 -1
  78. package/cjs/components/Pagination/Pagination.cjs.map +1 -1
  79. package/cjs/components/Paper/Paper.cjs.map +1 -1
  80. package/cjs/components/PasswordInput/PasswordInput.cjs +4 -1
  81. package/cjs/components/PasswordInput/PasswordInput.cjs.map +1 -1
  82. package/cjs/components/Pill/Pill.cjs.map +1 -1
  83. package/cjs/components/Pill/Pill.module.cjs.map +1 -1
  84. package/cjs/components/PillsInput/PillsInput.cjs.map +1 -1
  85. package/cjs/components/PinInput/PinInput.cjs.map +1 -1
  86. package/cjs/components/Popover/Popover.cjs +9 -0
  87. package/cjs/components/Popover/Popover.cjs.map +1 -1
  88. package/cjs/components/Portal/OptionalPortal.cjs.map +1 -1
  89. package/cjs/components/Portal/Portal.cjs.map +1 -1
  90. package/cjs/components/Progress/Progress.cjs.map +1 -1
  91. package/cjs/components/Radio/Radio.cjs.map +1 -1
  92. package/cjs/components/Radio/RadioGroup/RadioGroup.cjs.map +1 -1
  93. package/cjs/components/Rating/Rating.cjs.map +1 -1
  94. package/cjs/components/RingProgress/RingProgress.cjs +1 -0
  95. package/cjs/components/RingProgress/RingProgress.cjs.map +1 -1
  96. package/cjs/components/ScrollArea/ScrollArea.cjs.map +1 -1
  97. package/cjs/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.cjs.map +1 -1
  98. package/cjs/components/Scroller/Scroller.cjs.map +1 -1
  99. package/cjs/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
  100. package/cjs/components/SegmentedControl/SegmentedControl.module.cjs.map +1 -1
  101. package/cjs/components/Select/Select.cjs +1 -0
  102. package/cjs/components/Select/Select.cjs.map +1 -1
  103. package/cjs/components/SemiCircleProgress/SemiCircleProgress.cjs +1 -2
  104. package/cjs/components/SemiCircleProgress/SemiCircleProgress.cjs.map +1 -1
  105. package/cjs/components/SimpleGrid/SimpleGrid.cjs.map +1 -1
  106. package/cjs/components/Skeleton/Skeleton.cjs.map +1 -1
  107. package/cjs/components/Slider/RangeSlider/RangeSlider.cjs.map +1 -1
  108. package/cjs/components/Slider/Slider/Slider.cjs.map +1 -1
  109. package/cjs/components/Slider/Slider.module.cjs.map +1 -1
  110. package/cjs/components/Space/Space.cjs.map +1 -1
  111. package/cjs/components/Spoiler/Spoiler.cjs.map +1 -1
  112. package/cjs/components/Stack/Stack.cjs.map +1 -1
  113. package/cjs/components/Stepper/Stepper.cjs.map +1 -1
  114. package/cjs/components/Stepper/Stepper.module.cjs +1 -0
  115. package/cjs/components/Stepper/Stepper.module.cjs.map +1 -1
  116. package/cjs/components/Stepper/StepperStep/StepperStep.cjs +8 -5
  117. package/cjs/components/Stepper/StepperStep/StepperStep.cjs.map +1 -1
  118. package/cjs/components/Switch/Switch.cjs.map +1 -1
  119. package/cjs/components/Switch/SwitchGroup/SwitchGroup.cjs.map +1 -1
  120. package/cjs/components/Table/Table.cjs.map +1 -1
  121. package/cjs/components/TableOfContents/TableOfContents.cjs.map +1 -1
  122. package/cjs/components/Tabs/Tabs.cjs.map +1 -1
  123. package/cjs/components/TagsInput/TagsInput.cjs +3 -1
  124. package/cjs/components/TagsInput/TagsInput.cjs.map +1 -1
  125. package/cjs/components/Text/Text.cjs.map +1 -1
  126. package/cjs/components/TextInput/TextInput.cjs.map +1 -1
  127. package/cjs/components/Textarea/Textarea.cjs.map +1 -1
  128. package/cjs/components/ThemeIcon/ThemeIcon.cjs.map +1 -1
  129. package/cjs/components/Timeline/Timeline.cjs.map +1 -1
  130. package/cjs/components/Timeline/TimelineItem/TimelineItem.cjs +1 -1
  131. package/cjs/components/Timeline/TimelineItem/TimelineItem.cjs.map +1 -1
  132. package/cjs/components/Title/Title.cjs.map +1 -1
  133. package/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
  134. package/cjs/components/Tree/Tree.cjs.map +1 -1
  135. package/cjs/components/Typography/Typography.cjs.map +1 -1
  136. package/cjs/components/UnstyledButton/UnstyledButton.cjs.map +1 -1
  137. package/cjs/components/VisuallyHidden/VisuallyHidden.cjs.map +1 -1
  138. package/cjs/core/MantineProvider/color-scheme-managers/local-storage-manager.cjs.map +1 -1
  139. package/cjs/core/MantineProvider/default-theme.cjs +1 -1
  140. package/cjs/core/MantineProvider/default-theme.cjs.map +1 -1
  141. package/cjs/core/utils/find-element-ancestor/find-element-ancestor.cjs.map +1 -1
  142. package/esm/components/Accordion/Accordion.mjs.map +1 -1
  143. package/esm/components/Accordion/Accordion.module.mjs.map +1 -1
  144. package/esm/components/ActionIcon/ActionIcon.mjs.map +1 -1
  145. package/esm/components/Affix/Affix.mjs.map +1 -1
  146. package/esm/components/Alert/Alert.mjs.map +1 -1
  147. package/esm/components/Anchor/Anchor.mjs.map +1 -1
  148. package/esm/components/AngleSlider/AngleSlider.mjs.map +1 -1
  149. package/esm/components/AppShell/AppShell.mjs.map +1 -1
  150. package/esm/components/AspectRatio/AspectRatio.mjs.map +1 -1
  151. package/esm/components/Autocomplete/Autocomplete.mjs +1 -1
  152. package/esm/components/Autocomplete/Autocomplete.mjs.map +1 -1
  153. package/esm/components/Avatar/Avatar.mjs.map +1 -1
  154. package/esm/components/BackgroundImage/BackgroundImage.mjs.map +1 -1
  155. package/esm/components/Badge/Badge.mjs.map +1 -1
  156. package/esm/components/Blockquote/Blockquote.mjs.map +1 -1
  157. package/esm/components/Breadcrumbs/Breadcrumbs.mjs.map +1 -1
  158. package/esm/components/Burger/Burger.mjs.map +1 -1
  159. package/esm/components/Button/Button.mjs.map +1 -1
  160. package/esm/components/Button/Button.module.mjs.map +1 -1
  161. package/esm/components/Card/Card.mjs.map +1 -1
  162. package/esm/components/Center/Center.mjs.map +1 -1
  163. package/esm/components/Checkbox/Checkbox.mjs +2 -1
  164. package/esm/components/Checkbox/Checkbox.mjs.map +1 -1
  165. package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.mjs.map +1 -1
  166. package/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.mjs +2 -1
  167. package/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.mjs.map +1 -1
  168. package/esm/components/Chip/Chip.mjs.map +1 -1
  169. package/esm/components/Chip/Chip.module.mjs.map +1 -1
  170. package/esm/components/Chip/ChipGroup/ChipGroup.mjs.map +1 -1
  171. package/esm/components/CloseButton/CloseButton.mjs.map +1 -1
  172. package/esm/components/Code/Code.mjs.map +1 -1
  173. package/esm/components/Collapse/Collapse.mjs.map +1 -1
  174. package/esm/components/ColorInput/ColorInput.mjs.map +1 -1
  175. package/esm/components/ColorPicker/AlphaSlider/AlphaSlider.mjs.map +1 -1
  176. package/esm/components/ColorPicker/ColorPicker.mjs.map +1 -1
  177. package/esm/components/ColorPicker/HueSlider/HueSlider.mjs.map +1 -1
  178. package/esm/components/ColorSwatch/ColorSwatch.mjs.map +1 -1
  179. package/esm/components/Combobox/ComboboxTarget/ComboboxTarget.mjs +1 -0
  180. package/esm/components/Combobox/ComboboxTarget/ComboboxTarget.mjs.map +1 -1
  181. package/esm/components/Combobox/use-combobox-target-props/use-combobox-target-props.mjs.map +1 -1
  182. package/esm/components/Container/Container.mjs.map +1 -1
  183. package/esm/components/Dialog/Dialog.mjs.map +1 -1
  184. package/esm/components/Divider/Divider.mjs.map +1 -1
  185. package/esm/components/Fieldset/Fieldset.mjs.map +1 -1
  186. package/esm/components/FileButton/FileButton.mjs.map +1 -1
  187. package/esm/components/FileInput/FileInput.mjs.map +1 -1
  188. package/esm/components/Flex/Flex.mjs.map +1 -1
  189. package/esm/components/FloatingIndicator/FloatingIndicator.mjs.map +1 -1
  190. package/esm/components/FloatingWindow/FloatingWindow.mjs.map +1 -1
  191. package/esm/components/Grid/Grid.mjs.map +1 -1
  192. package/esm/components/Group/Group.mjs.map +1 -1
  193. package/esm/components/Highlight/Highlight.mjs.map +1 -1
  194. package/esm/components/Image/Image.mjs.map +1 -1
  195. package/esm/components/Indicator/Indicator.mjs.map +1 -1
  196. package/esm/components/Input/Input.mjs +3 -2
  197. package/esm/components/Input/Input.mjs.map +1 -1
  198. package/esm/components/InputBase/InputBase.mjs.map +1 -1
  199. package/esm/components/JsonInput/JsonInput.mjs.map +1 -1
  200. package/esm/components/Kbd/Kbd.mjs.map +1 -1
  201. package/esm/components/List/List.mjs.map +1 -1
  202. package/esm/components/Loader/Loader.mjs.map +1 -1
  203. package/esm/components/LoadingOverlay/LoadingOverlay.mjs +1 -0
  204. package/esm/components/LoadingOverlay/LoadingOverlay.mjs.map +1 -1
  205. package/esm/components/Mark/Mark.mjs.map +1 -1
  206. package/esm/components/Marquee/Marquee.mjs.map +1 -1
  207. package/esm/components/Menu/Menu.mjs.map +1 -1
  208. package/esm/components/Modal/Modal.mjs.map +1 -1
  209. package/esm/components/MultiSelect/MultiSelect.mjs +3 -1
  210. package/esm/components/MultiSelect/MultiSelect.mjs.map +1 -1
  211. package/esm/components/NativeSelect/NativeSelect.mjs +4 -1
  212. package/esm/components/NativeSelect/NativeSelect.mjs.map +1 -1
  213. package/esm/components/NavLink/NavLink.mjs.map +1 -1
  214. package/esm/components/Notification/Notification.mjs.map +1 -1
  215. package/esm/components/NumberInput/NumberInput.mjs +1 -0
  216. package/esm/components/NumberInput/NumberInput.mjs.map +1 -1
  217. package/esm/components/OverflowList/OverflowList.mjs.map +1 -1
  218. package/esm/components/Overlay/Overlay.mjs.map +1 -1
  219. package/esm/components/Pagination/Pagination.mjs.map +1 -1
  220. package/esm/components/Paper/Paper.mjs.map +1 -1
  221. package/esm/components/PasswordInput/PasswordInput.mjs +4 -1
  222. package/esm/components/PasswordInput/PasswordInput.mjs.map +1 -1
  223. package/esm/components/Pill/Pill.mjs.map +1 -1
  224. package/esm/components/Pill/Pill.module.mjs.map +1 -1
  225. package/esm/components/PillsInput/PillsInput.mjs.map +1 -1
  226. package/esm/components/PinInput/PinInput.mjs.map +1 -1
  227. package/esm/components/Popover/Popover.mjs +9 -0
  228. package/esm/components/Popover/Popover.mjs.map +1 -1
  229. package/esm/components/Portal/OptionalPortal.mjs.map +1 -1
  230. package/esm/components/Portal/Portal.mjs.map +1 -1
  231. package/esm/components/Progress/Progress.mjs.map +1 -1
  232. package/esm/components/Radio/Radio.mjs.map +1 -1
  233. package/esm/components/Radio/RadioGroup/RadioGroup.mjs.map +1 -1
  234. package/esm/components/Rating/Rating.mjs.map +1 -1
  235. package/esm/components/RingProgress/RingProgress.mjs +1 -0
  236. package/esm/components/RingProgress/RingProgress.mjs.map +1 -1
  237. package/esm/components/ScrollArea/ScrollArea.mjs.map +1 -1
  238. package/esm/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.mjs.map +1 -1
  239. package/esm/components/Scroller/Scroller.mjs.map +1 -1
  240. package/esm/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  241. package/esm/components/SegmentedControl/SegmentedControl.module.mjs.map +1 -1
  242. package/esm/components/Select/Select.mjs +1 -0
  243. package/esm/components/Select/Select.mjs.map +1 -1
  244. package/esm/components/SemiCircleProgress/SemiCircleProgress.mjs +1 -2
  245. package/esm/components/SemiCircleProgress/SemiCircleProgress.mjs.map +1 -1
  246. package/esm/components/SimpleGrid/SimpleGrid.mjs.map +1 -1
  247. package/esm/components/Skeleton/Skeleton.mjs.map +1 -1
  248. package/esm/components/Slider/RangeSlider/RangeSlider.mjs.map +1 -1
  249. package/esm/components/Slider/Slider/Slider.mjs.map +1 -1
  250. package/esm/components/Slider/Slider.module.mjs.map +1 -1
  251. package/esm/components/Space/Space.mjs.map +1 -1
  252. package/esm/components/Spoiler/Spoiler.mjs.map +1 -1
  253. package/esm/components/Stack/Stack.mjs.map +1 -1
  254. package/esm/components/Stepper/Stepper.mjs.map +1 -1
  255. package/esm/components/Stepper/Stepper.module.mjs +1 -0
  256. package/esm/components/Stepper/Stepper.module.mjs.map +1 -1
  257. package/esm/components/Stepper/StepperStep/StepperStep.mjs +8 -5
  258. package/esm/components/Stepper/StepperStep/StepperStep.mjs.map +1 -1
  259. package/esm/components/Switch/Switch.mjs.map +1 -1
  260. package/esm/components/Switch/SwitchGroup/SwitchGroup.mjs.map +1 -1
  261. package/esm/components/Table/Table.mjs.map +1 -1
  262. package/esm/components/TableOfContents/TableOfContents.mjs.map +1 -1
  263. package/esm/components/Tabs/Tabs.mjs.map +1 -1
  264. package/esm/components/TagsInput/TagsInput.mjs +3 -1
  265. package/esm/components/TagsInput/TagsInput.mjs.map +1 -1
  266. package/esm/components/Text/Text.mjs.map +1 -1
  267. package/esm/components/TextInput/TextInput.mjs.map +1 -1
  268. package/esm/components/Textarea/Textarea.mjs.map +1 -1
  269. package/esm/components/ThemeIcon/ThemeIcon.mjs.map +1 -1
  270. package/esm/components/Timeline/Timeline.mjs.map +1 -1
  271. package/esm/components/Timeline/TimelineItem/TimelineItem.mjs +1 -1
  272. package/esm/components/Timeline/TimelineItem/TimelineItem.mjs.map +1 -1
  273. package/esm/components/Title/Title.mjs.map +1 -1
  274. package/esm/components/Tooltip/Tooltip.mjs.map +1 -1
  275. package/esm/components/Tree/Tree.mjs.map +1 -1
  276. package/esm/components/Typography/Typography.mjs.map +1 -1
  277. package/esm/components/UnstyledButton/UnstyledButton.mjs.map +1 -1
  278. package/esm/components/VisuallyHidden/VisuallyHidden.mjs.map +1 -1
  279. package/esm/core/MantineProvider/color-scheme-managers/local-storage-manager.mjs.map +1 -1
  280. package/esm/core/MantineProvider/default-theme.mjs +1 -1
  281. package/esm/core/MantineProvider/default-theme.mjs.map +1 -1
  282. package/esm/core/utils/find-element-ancestor/find-element-ancestor.mjs.map +1 -1
  283. package/lib/components/Accordion/Accordion.d.ts +21 -3
  284. package/lib/components/Accordion/index.d.ts +0 -17
  285. package/lib/components/ActionIcon/ActionIcon.d.ts +20 -2
  286. package/lib/components/ActionIcon/index.d.ts +0 -18
  287. package/lib/components/Affix/Affix.d.ts +6 -0
  288. package/lib/components/Affix/index.d.ts +0 -6
  289. package/lib/components/Alert/Alert.d.ts +6 -0
  290. package/lib/components/Alert/index.d.ts +0 -6
  291. package/lib/components/Anchor/Anchor.d.ts +7 -0
  292. package/lib/components/Anchor/index.d.ts +0 -8
  293. package/lib/components/AngleSlider/AngleSlider.d.ts +6 -0
  294. package/lib/components/AngleSlider/index.d.ts +0 -6
  295. package/lib/components/AppShell/AppShell.d.ts +30 -6
  296. package/lib/components/AppShell/index.d.ts +0 -24
  297. package/lib/components/AspectRatio/AspectRatio.d.ts +6 -0
  298. package/lib/components/AspectRatio/index.d.ts +0 -6
  299. package/lib/components/Autocomplete/Autocomplete.d.ts +6 -0
  300. package/lib/components/Autocomplete/index.d.ts +0 -6
  301. package/lib/components/Avatar/Avatar.d.ts +15 -1
  302. package/lib/components/Avatar/index.d.ts +0 -14
  303. package/lib/components/BackgroundImage/BackgroundImage.d.ts +6 -0
  304. package/lib/components/BackgroundImage/index.d.ts +0 -6
  305. package/lib/components/Badge/Badge.d.ts +7 -0
  306. package/lib/components/Badge/index.d.ts +0 -7
  307. package/lib/components/Blockquote/Blockquote.d.ts +6 -0
  308. package/lib/components/Blockquote/index.d.ts +0 -6
  309. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +6 -0
  310. package/lib/components/Breadcrumbs/index.d.ts +0 -7
  311. package/lib/components/Burger/Burger.d.ts +6 -0
  312. package/lib/components/Burger/index.d.ts +0 -6
  313. package/lib/components/Button/Button.d.ts +22 -2
  314. package/lib/components/Button/index.d.ts +0 -20
  315. package/lib/components/Card/Card.d.ts +11 -1
  316. package/lib/components/Card/index.d.ts +0 -10
  317. package/lib/components/Center/Center.d.ts +5 -0
  318. package/lib/components/Center/index.d.ts +0 -5
  319. package/lib/components/Checkbox/Checkbox.d.ts +29 -3
  320. package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +8 -8
  321. package/lib/components/Checkbox/index.d.ts +0 -26
  322. package/lib/components/Chip/Chip.d.ts +12 -1
  323. package/lib/components/Chip/ChipGroup/ChipGroup.d.ts +8 -8
  324. package/lib/components/Chip/index.d.ts +0 -11
  325. package/lib/components/CloseButton/CloseButton.d.ts +7 -0
  326. package/lib/components/CloseButton/index.d.ts +0 -7
  327. package/lib/components/Code/Code.d.ts +6 -0
  328. package/lib/components/Code/index.d.ts +0 -6
  329. package/lib/components/Collapse/Collapse.d.ts +4 -0
  330. package/lib/components/Collapse/index.d.ts +0 -4
  331. package/lib/components/ColorInput/ColorInput.d.ts +6 -0
  332. package/lib/components/ColorInput/index.d.ts +0 -6
  333. package/lib/components/ColorPicker/AlphaSlider/AlphaSlider.d.ts +4 -0
  334. package/lib/components/ColorPicker/ColorPicker.d.ts +6 -0
  335. package/lib/components/ColorPicker/HueSlider/HueSlider.d.ts +4 -0
  336. package/lib/components/ColorPicker/index.d.ts +0 -14
  337. package/lib/components/ColorSwatch/ColorSwatch.d.ts +6 -0
  338. package/lib/components/ColorSwatch/index.d.ts +0 -6
  339. package/lib/components/Container/Container.d.ts +6 -0
  340. package/lib/components/Container/index.d.ts +0 -6
  341. package/lib/components/Dialog/Dialog.d.ts +6 -0
  342. package/lib/components/Dialog/index.d.ts +0 -6
  343. package/lib/components/Divider/Divider.d.ts +7 -0
  344. package/lib/components/Divider/index.d.ts +0 -7
  345. package/lib/components/Fieldset/Fieldset.d.ts +6 -0
  346. package/lib/components/Fieldset/index.d.ts +0 -6
  347. package/lib/components/FileButton/FileButton.d.ts +4 -0
  348. package/lib/components/FileButton/index.d.ts +0 -4
  349. package/lib/components/FileInput/FileInput.d.ts +4 -0
  350. package/lib/components/FileInput/index.d.ts +0 -4
  351. package/lib/components/Flex/Flex.d.ts +5 -0
  352. package/lib/components/Flex/index.d.ts +0 -5
  353. package/lib/components/FloatingIndicator/FloatingIndicator.d.ts +6 -0
  354. package/lib/components/FloatingIndicator/index.d.ts +0 -6
  355. package/lib/components/FloatingWindow/FloatingWindow.d.ts +5 -0
  356. package/lib/components/FloatingWindow/index.d.ts +0 -5
  357. package/lib/components/Grid/Grid.d.ts +13 -2
  358. package/lib/components/Grid/index.d.ts +0 -11
  359. package/lib/components/Group/Group.d.ts +7 -0
  360. package/lib/components/Group/index.d.ts +0 -7
  361. package/lib/components/Highlight/Highlight.d.ts +5 -0
  362. package/lib/components/Highlight/index.d.ts +0 -5
  363. package/lib/components/Image/Image.d.ts +6 -0
  364. package/lib/components/Image/index.d.ts +0 -6
  365. package/lib/components/Indicator/Indicator.d.ts +6 -0
  366. package/lib/components/Indicator/index.d.ts +0 -6
  367. package/lib/components/Input/Input.d.ts +51 -7
  368. package/lib/components/Input/index.d.ts +0 -42
  369. package/lib/components/InputBase/InputBase.d.ts +4 -0
  370. package/lib/components/InputBase/index.d.ts +0 -4
  371. package/lib/components/JsonInput/JsonInput.d.ts +4 -0
  372. package/lib/components/JsonInput/index.d.ts +0 -4
  373. package/lib/components/Kbd/Kbd.d.ts +6 -0
  374. package/lib/components/Kbd/index.d.ts +0 -6
  375. package/lib/components/List/List.d.ts +12 -1
  376. package/lib/components/List/index.d.ts +0 -11
  377. package/lib/components/Loader/Loader.d.ts +6 -0
  378. package/lib/components/Loader/index.d.ts +0 -6
  379. package/lib/components/LoadingOverlay/LoadingOverlay.d.ts +6 -0
  380. package/lib/components/LoadingOverlay/index.d.ts +0 -6
  381. package/lib/components/Mark/Mark.d.ts +6 -0
  382. package/lib/components/Mark/index.d.ts +0 -6
  383. package/lib/components/Marquee/Marquee.d.ts +6 -0
  384. package/lib/components/Marquee/index.d.ts +0 -6
  385. package/lib/components/Menu/Menu.d.ts +43 -6
  386. package/lib/components/Menu/index.d.ts +0 -33
  387. package/lib/components/Modal/Modal.d.ts +37 -7
  388. package/lib/components/Modal/index.d.ts +0 -30
  389. package/lib/components/MultiSelect/MultiSelect.d.ts +5 -0
  390. package/lib/components/MultiSelect/index.d.ts +0 -6
  391. package/lib/components/NativeSelect/NativeSelect.d.ts +5 -0
  392. package/lib/components/NativeSelect/index.d.ts +0 -6
  393. package/lib/components/NavLink/NavLink.d.ts +7 -0
  394. package/lib/components/NavLink/index.d.ts +0 -7
  395. package/lib/components/Notification/Notification.d.ts +6 -0
  396. package/lib/components/Notification/index.d.ts +0 -6
  397. package/lib/components/NumberInput/NumberInput.d.ts +7 -0
  398. package/lib/components/NumberInput/index.d.ts +0 -7
  399. package/lib/components/OverflowList/OverflowList.d.ts +6 -0
  400. package/lib/components/OverflowList/index.d.ts +0 -6
  401. package/lib/components/Overlay/Overlay.d.ts +6 -0
  402. package/lib/components/Overlay/index.d.ts +0 -6
  403. package/lib/components/Pagination/Pagination.d.ts +25 -4
  404. package/lib/components/Pagination/index.d.ts +0 -21
  405. package/lib/components/Paper/Paper.d.ts +7 -0
  406. package/lib/components/Paper/index.d.ts +0 -7
  407. package/lib/components/PasswordInput/PasswordInput.d.ts +6 -0
  408. package/lib/components/PasswordInput/index.d.ts +0 -6
  409. package/lib/components/Pill/Pill.d.ts +14 -1
  410. package/lib/components/Pill/index.d.ts +0 -13
  411. package/lib/components/PillsInput/PillsInput.d.ts +12 -1
  412. package/lib/components/PillsInput/index.d.ts +0 -10
  413. package/lib/components/PinInput/PinInput.d.ts +5 -0
  414. package/lib/components/PinInput/index.d.ts +0 -5
  415. package/lib/components/Popover/Popover.d.ts +9 -0
  416. package/lib/components/Portal/OptionalPortal.d.ts +3 -0
  417. package/lib/components/Portal/Portal.d.ts +3 -0
  418. package/lib/components/Portal/index.d.ts +0 -6
  419. package/lib/components/Progress/Progress.d.ts +19 -3
  420. package/lib/components/Progress/index.d.ts +0 -15
  421. package/lib/components/Radio/Radio.d.ts +29 -3
  422. package/lib/components/Radio/RadioGroup/RadioGroup.d.ts +8 -8
  423. package/lib/components/Radio/index.d.ts +0 -26
  424. package/lib/components/Rating/Rating.d.ts +5 -0
  425. package/lib/components/Rating/index.d.ts +0 -5
  426. package/lib/components/RingProgress/RingProgress.d.ts +7 -0
  427. package/lib/components/RingProgress/index.d.ts +0 -7
  428. package/lib/components/ScrollArea/ScrollArea.d.ts +10 -0
  429. package/lib/components/ScrollArea/index.d.ts +0 -10
  430. package/lib/components/Scroller/Scroller.d.ts +6 -0
  431. package/lib/components/Scroller/index.d.ts +0 -6
  432. package/lib/components/SegmentedControl/SegmentedControl.d.ts +7 -0
  433. package/lib/components/SegmentedControl/index.d.ts +0 -8
  434. package/lib/components/Select/Select.d.ts +5 -0
  435. package/lib/components/Select/index.d.ts +0 -6
  436. package/lib/components/SemiCircleProgress/SemiCircleProgress.d.ts +6 -0
  437. package/lib/components/SemiCircleProgress/index.d.ts +0 -6
  438. package/lib/components/SimpleGrid/SimpleGrid.d.ts +5 -0
  439. package/lib/components/SimpleGrid/index.d.ts +0 -5
  440. package/lib/components/Skeleton/Skeleton.d.ts +6 -0
  441. package/lib/components/Skeleton/index.d.ts +0 -6
  442. package/lib/components/Slider/RangeSlider/RangeSlider.d.ts +8 -0
  443. package/lib/components/Slider/Slider/Slider.d.ts +7 -0
  444. package/lib/components/Slider/index.d.ts +0 -15
  445. package/lib/components/Space/Space.d.ts +4 -0
  446. package/lib/components/Space/index.d.ts +0 -5
  447. package/lib/components/Spoiler/Spoiler.d.ts +6 -0
  448. package/lib/components/Spoiler/index.d.ts +0 -6
  449. package/lib/components/Stack/Stack.d.ts +6 -0
  450. package/lib/components/Stack/index.d.ts +0 -6
  451. package/lib/components/Stepper/Stepper.d.ts +18 -3
  452. package/lib/components/Stepper/StepperStep/StepperStep.d.ts +1 -1
  453. package/lib/components/Stepper/index.d.ts +0 -14
  454. package/lib/components/Switch/Switch.d.ts +13 -1
  455. package/lib/components/Switch/SwitchGroup/SwitchGroup.d.ts +8 -8
  456. package/lib/components/Switch/index.d.ts +0 -12
  457. package/lib/components/Table/Table.d.ts +35 -2
  458. package/lib/components/Table/index.d.ts +0 -32
  459. package/lib/components/TableOfContents/TableOfContents.d.ts +7 -0
  460. package/lib/components/TableOfContents/index.d.ts +0 -7
  461. package/lib/components/Tabs/Tabs.d.ts +24 -3
  462. package/lib/components/Tabs/index.d.ts +0 -20
  463. package/lib/components/TagsInput/TagsInput.d.ts +5 -0
  464. package/lib/components/TagsInput/index.d.ts +0 -5
  465. package/lib/components/Text/Text.d.ts +7 -0
  466. package/lib/components/Text/index.d.ts +0 -7
  467. package/lib/components/TextInput/TextInput.d.ts +4 -0
  468. package/lib/components/TextInput/index.d.ts +0 -4
  469. package/lib/components/Textarea/Textarea.d.ts +4 -0
  470. package/lib/components/Textarea/index.d.ts +0 -4
  471. package/lib/components/ThemeIcon/ThemeIcon.d.ts +7 -0
  472. package/lib/components/ThemeIcon/index.d.ts +0 -7
  473. package/lib/components/Timeline/Timeline.d.ts +12 -1
  474. package/lib/components/Timeline/index.d.ts +0 -11
  475. package/lib/components/Title/Title.d.ts +8 -0
  476. package/lib/components/Title/index.d.ts +0 -8
  477. package/lib/components/Tooltip/Tooltip.d.ts +15 -2
  478. package/lib/components/Tooltip/index.d.ts +0 -13
  479. package/lib/components/Tree/Tree.d.ts +7 -0
  480. package/lib/components/Tree/index.d.ts +0 -7
  481. package/lib/components/Typography/Typography.d.ts +5 -0
  482. package/lib/components/Typography/index.d.ts +0 -5
  483. package/lib/components/UnstyledButton/UnstyledButton.d.ts +5 -0
  484. package/lib/components/UnstyledButton/index.d.ts +0 -5
  485. package/lib/components/VisuallyHidden/VisuallyHidden.d.ts +3 -0
  486. package/lib/components/VisuallyHidden/index.d.ts +0 -3
  487. package/package.json +2 -2
  488. package/styles/Accordion.css +0 -4
  489. package/styles/Accordion.layer.css +0 -4
  490. package/styles/Button.css +2 -0
  491. package/styles/Button.layer.css +2 -0
  492. package/styles/Chip.css +2 -0
  493. package/styles/Chip.layer.css +2 -0
  494. package/styles/Pill.css +5 -2
  495. package/styles/Pill.layer.css +5 -2
  496. package/styles/SegmentedControl.css +3 -3
  497. package/styles/SegmentedControl.layer.css +3 -3
  498. package/styles/Slider.css +10 -10
  499. package/styles/Slider.layer.css +10 -10
  500. package/styles/Stepper.css +4 -0
  501. package/styles/Stepper.layer.css +4 -0
  502. package/styles/default-css-variables.css +1 -1
  503. package/styles/default-css-variables.layer.css +1 -1
  504. package/styles.css +27 -20
  505. package/styles.layer.css +27 -20
@@ -1 +1 @@
1
- {"version":3,"file":"NavLink.cjs","names":["createVarsResolver","getSpacing","polymorphicFactory","useProps","useStyles","UnstyledButton","Box","AccordionChevron","Collapse","classes"],"sources":["../../../src/components/NavLink/NavLink.tsx"],"sourcesContent":["import { useUncontrolled } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n getSpacing,\n MantineColor,\n MantineSpacing,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { AccordionChevron } from '../Accordion';\nimport { Collapse } from '../Collapse';\nimport { UnstyledButton } from '../UnstyledButton';\nimport classes from './NavLink.module.css';\n\nexport type NavLinkStylesNames =\n | 'root'\n | 'section'\n | 'body'\n | 'label'\n | 'description'\n | 'chevron'\n | 'collapse'\n | 'children';\nexport type NavLinkVariant = 'filled' | 'light' | 'subtle';\nexport type NavLinkCssVariables = {\n root: '--nl-color' | '--nl-bg' | '--nl-hover';\n children: '--nl-offset';\n};\n\nexport interface NavLinkProps extends BoxProps, StylesApiProps<NavLinkFactory> {\n /** Main link label */\n label?: React.ReactNode;\n\n /** Link description, displayed below the label */\n description?: React.ReactNode;\n\n /** Section displayed on the left side of the label */\n leftSection?: React.ReactNode;\n\n /** Section displayed on the right side of the label */\n rightSection?: React.ReactNode;\n\n /** Determines whether the link should have active styles @default false */\n active?: boolean;\n\n /** Key of `theme.colors` or any valid CSS color to control active styles @default theme.primaryColor */\n color?: MantineColor;\n\n /** If set, label and description are truncated with ellipsis instead of wrapping @default false */\n noWrap?: boolean;\n\n /** Child `NavLink` components */\n children?: React.ReactNode;\n\n /** Controlled nested items collapse state */\n opened?: boolean;\n\n /** Uncontrolled nested items collapse initial state */\n defaultOpened?: boolean;\n\n /** Called when open state changes */\n onChange?: (opened: boolean) => void;\n\n /** If set, right section will not be rotated when collapse is opened @default false */\n disableRightSectionRotation?: boolean;\n\n /** Controls indentation of nested NavLink components, key of `theme.spacing` or any valid CSS value @default 'lg' */\n childrenOffset?: MantineSpacing;\n\n /** If set, disabled styles will be added to the root element @default false */\n disabled?: boolean;\n\n /** If set, adjusts text color based on background color for `filled` variant */\n autoContrast?: boolean;\n\n /** Called when the root element is clicked */\n onClick?: React.MouseEventHandler<HTMLElement>;\n\n /** Called on keydown of the root element */\n onKeyDown?: React.KeyboardEventHandler<HTMLElement>;\n\n /** If set to `false`, child `NavLinks` are unmounted when collapsed */\n keepMounted?: boolean;\n}\n\nexport type NavLinkFactory = PolymorphicFactory<{\n props: NavLinkProps;\n defaultRef: HTMLAnchorElement;\n defaultComponent: 'a';\n stylesNames: NavLinkStylesNames;\n vars: NavLinkCssVariables;\n variant: NavLinkVariant;\n}>;\n\nconst varsResolver = createVarsResolver<NavLinkFactory>(\n (theme, { variant, color, childrenOffset, autoContrast }) => {\n const colors = theme.variantColorResolver({\n color: color || theme.primaryColor,\n theme,\n variant: variant || 'light',\n autoContrast,\n });\n\n return {\n root: {\n '--nl-bg': color || variant ? colors.background : undefined,\n '--nl-hover': color || variant ? colors.hover : undefined,\n '--nl-color': color || variant ? colors.color : undefined,\n },\n\n children: {\n '--nl-offset': getSpacing(childrenOffset),\n },\n };\n }\n);\n\nexport const NavLink = polymorphicFactory<NavLinkFactory>((_props) => {\n const props = useProps('NavLink', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n opened,\n defaultOpened,\n onChange,\n children,\n active,\n disabled,\n leftSection,\n rightSection,\n label,\n description,\n disableRightSectionRotation,\n noWrap,\n childrenOffset,\n autoContrast,\n mod,\n attributes,\n onClick,\n onKeyDown,\n keepMounted,\n ...others\n } = props;\n\n const getStyles = useStyles<NavLinkFactory>({\n name: 'NavLink',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const [_opened, setOpened] = useUncontrolled({\n value: opened,\n defaultValue: defaultOpened,\n finalValue: false,\n onChange,\n });\n\n const withChildren = !!children;\n\n const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => {\n onClick?.(event);\n\n if (withChildren) {\n event.preventDefault();\n setOpened(!_opened);\n }\n };\n\n return (\n <>\n <UnstyledButton\n {...getStyles('root')}\n component=\"a\"\n onClick={handleClick}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n\n if (event.nativeEvent.code === 'Space' && withChildren) {\n event.preventDefault();\n setOpened(!_opened);\n }\n }}\n unstyled={unstyled}\n mod={[{ disabled, active, expanded: _opened }, mod]}\n {...others}\n >\n {leftSection && (\n <Box component=\"span\" {...getStyles('section')} mod={{ position: 'left' }}>\n {leftSection}\n </Box>\n )}\n <Box {...getStyles('body')} mod={{ 'no-wrap': noWrap }}>\n <Box component=\"span\" {...getStyles('label')}>\n {label}\n </Box>\n <Box component=\"span\" mod={{ active }} {...getStyles('description')}>\n {description}\n </Box>\n </Box>\n {(withChildren || rightSection !== undefined) && (\n <Box\n {...getStyles('section')}\n component=\"span\"\n mod={{ rotate: _opened && !disableRightSectionRotation, position: 'right' }}\n >\n {withChildren ? (\n rightSection !== undefined ? (\n rightSection\n ) : (\n <AccordionChevron {...getStyles('chevron')} />\n )\n ) : (\n rightSection\n )}\n </Box>\n )}\n </UnstyledButton>\n {withChildren && (\n <Collapse expanded={_opened} keepMounted={keepMounted} {...getStyles('collapse')}>\n <div {...getStyles('children')}>{children}</div>\n </Collapse>\n )}\n </>\n );\n});\n\nNavLink.classes = classes;\nNavLink.varsResolver = varsResolver;\nNavLink.displayName = '@mantine/core/NavLink';\n"],"mappings":";;;;;;;;;;;;;;;AAmGA,MAAM,eAAeA,6BAAAA,oBAClB,OAAO,EAAE,SAAS,OAAO,gBAAgB,mBAAmB;CAC3D,MAAM,SAAS,MAAM,qBAAqB;EACxC,OAAO,SAAS,MAAM;EACtB;EACA,SAAS,WAAW;EACpB;EACD,CAAC;AAEF,QAAO;EACL,MAAM;GACJ,WAAW,SAAS,UAAU,OAAO,aAAa,KAAA;GAClD,cAAc,SAAS,UAAU,OAAO,QAAQ,KAAA;GAChD,cAAc,SAAS,UAAU,OAAO,QAAQ,KAAA;GACjD;EAED,UAAU,EACR,eAAeC,iBAAAA,WAAW,eAAe,EAC1C;EACF;EAEJ;AAED,MAAa,UAAUC,4BAAAA,oBAAoC,WAAW;CACpE,MAAM,QAAQC,kBAAAA,SAAS,WAAW,MAAM,OAAO;CAC/C,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,QACA,eACA,UACA,UACA,QACA,UACA,aACA,cACA,OACA,aACA,6BACA,QACA,gBACA,cACA,KACA,YACA,SACA,WACA,aACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAA0B;EAC1C,MAAM;EACN;EACA,SAAA,uBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,CAAC,SAAS,cAAA,GAAA,eAAA,iBAA6B;EAC3C,OAAO;EACP,cAAc;EACd,YAAY;E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BAAD,EAAkB,GAAI,UAAU,UAAU,EAAI,CAAA,GAGhD;IAEE,CAAA;GAEO;KAChB,gBACC,iBAAA,GAAA,kBAAA,KAACC,iBAAAA,UAAD;EAAU,UAAU;EAAsB;EAAa,GAAI,UAAU,WAAW;YAC9E,iBAAA,GAAA,kBAAA,KAAC,OAAD;GAAK,GAAI,UAAU,WAAW;GAAG;GAAe,CAAA;EACvC,CAAA,CAEZ,EAAA,CAAA;EAEL;AAEF,QAAQ,UAAUC,uBAAAA;AAClB,QAAQ,eAAe;AACvB,QAAQ,cAAc"}
1
+ {"version":3,"file":"NavLink.cjs","names":["createVarsResolver","getSpacing","polymorphicFactory","useProps","useStyles","UnstyledButton","Box","AccordionChevron","Collapse","classes"],"sources":["../../../src/components/NavLink/NavLink.tsx"],"sourcesContent":["import { useUncontrolled } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n getSpacing,\n MantineColor,\n MantineSpacing,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { AccordionChevron } from '../Accordion';\nimport { Collapse } from '../Collapse';\nimport { UnstyledButton } from '../UnstyledButton';\nimport classes from './NavLink.module.css';\n\nexport type NavLinkStylesNames =\n | 'root'\n | 'section'\n | 'body'\n | 'label'\n | 'description'\n | 'chevron'\n | 'collapse'\n | 'children';\nexport type NavLinkVariant = 'filled' | 'light' | 'subtle';\nexport type NavLinkCssVariables = {\n root: '--nl-color' | '--nl-bg' | '--nl-hover';\n children: '--nl-offset';\n};\n\nexport interface NavLinkProps extends BoxProps, StylesApiProps<NavLinkFactory> {\n /** Main link label */\n label?: React.ReactNode;\n\n /** Link description, displayed below the label */\n description?: React.ReactNode;\n\n /** Section displayed on the left side of the label */\n leftSection?: React.ReactNode;\n\n /** Section displayed on the right side of the label */\n rightSection?: React.ReactNode;\n\n /** Determines whether the link should have active styles @default false */\n active?: boolean;\n\n /** Key of `theme.colors` or any valid CSS color to control active styles @default theme.primaryColor */\n color?: MantineColor;\n\n /** If set, label and description are truncated with ellipsis instead of wrapping @default false */\n noWrap?: boolean;\n\n /** Child `NavLink` components */\n children?: React.ReactNode;\n\n /** Controlled nested items collapse state */\n opened?: boolean;\n\n /** Uncontrolled nested items collapse initial state */\n defaultOpened?: boolean;\n\n /** Called when open state changes */\n onChange?: (opened: boolean) => void;\n\n /** If set, right section will not be rotated when collapse is opened @default false */\n disableRightSectionRotation?: boolean;\n\n /** Controls indentation of nested NavLink components, key of `theme.spacing` or any valid CSS value @default 'lg' */\n childrenOffset?: MantineSpacing;\n\n /** If set, disabled styles will be added to the root element @default false */\n disabled?: boolean;\n\n /** If set, adjusts text color based on background color for `filled` variant */\n autoContrast?: boolean;\n\n /** Called when the root element is clicked */\n onClick?: React.MouseEventHandler<HTMLElement>;\n\n /** Called on keydown of the root element */\n onKeyDown?: React.KeyboardEventHandler<HTMLElement>;\n\n /** If set to `false`, child `NavLinks` are unmounted when collapsed */\n keepMounted?: boolean;\n}\n\nexport type NavLinkFactory = PolymorphicFactory<{\n props: NavLinkProps;\n defaultRef: HTMLAnchorElement;\n defaultComponent: 'a';\n stylesNames: NavLinkStylesNames;\n vars: NavLinkCssVariables;\n variant: NavLinkVariant;\n}>;\n\nconst varsResolver = createVarsResolver<NavLinkFactory>(\n (theme, { variant, color, childrenOffset, autoContrast }) => {\n const colors = theme.variantColorResolver({\n color: color || theme.primaryColor,\n theme,\n variant: variant || 'light',\n autoContrast,\n });\n\n return {\n root: {\n '--nl-bg': color || variant ? colors.background : undefined,\n '--nl-hover': color || variant ? colors.hover : undefined,\n '--nl-color': color || variant ? colors.color : undefined,\n },\n\n children: {\n '--nl-offset': getSpacing(childrenOffset),\n },\n };\n }\n);\n\nexport const NavLink = polymorphicFactory<NavLinkFactory>((_props) => {\n const props = useProps('NavLink', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n opened,\n defaultOpened,\n onChange,\n children,\n active,\n disabled,\n leftSection,\n rightSection,\n label,\n description,\n disableRightSectionRotation,\n noWrap,\n childrenOffset,\n autoContrast,\n mod,\n attributes,\n onClick,\n onKeyDown,\n keepMounted,\n ...others\n } = props;\n\n const getStyles = useStyles<NavLinkFactory>({\n name: 'NavLink',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const [_opened, setOpened] = useUncontrolled({\n value: opened,\n defaultValue: defaultOpened,\n finalValue: false,\n onChange,\n });\n\n const withChildren = !!children;\n\n const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => {\n onClick?.(event);\n\n if (withChildren) {\n event.preventDefault();\n setOpened(!_opened);\n }\n };\n\n return (\n <>\n <UnstyledButton\n {...getStyles('root')}\n component=\"a\"\n onClick={handleClick}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n\n if (event.nativeEvent.code === 'Space' && withChildren) {\n event.preventDefault();\n setOpened(!_opened);\n }\n }}\n unstyled={unstyled}\n mod={[{ disabled, active, expanded: _opened }, mod]}\n {...others}\n >\n {leftSection && (\n <Box component=\"span\" {...getStyles('section')} mod={{ position: 'left' }}>\n {leftSection}\n </Box>\n )}\n <Box {...getStyles('body')} mod={{ 'no-wrap': noWrap }}>\n <Box component=\"span\" {...getStyles('label')}>\n {label}\n </Box>\n <Box component=\"span\" mod={{ active }} {...getStyles('description')}>\n {description}\n </Box>\n </Box>\n {(withChildren || rightSection !== undefined) && (\n <Box\n {...getStyles('section')}\n component=\"span\"\n mod={{ rotate: _opened && !disableRightSectionRotation, position: 'right' }}\n >\n {withChildren ? (\n rightSection !== undefined ? (\n rightSection\n ) : (\n <AccordionChevron {...getStyles('chevron')} />\n )\n ) : (\n rightSection\n )}\n </Box>\n )}\n </UnstyledButton>\n {withChildren && (\n <Collapse expanded={_opened} keepMounted={keepMounted} {...getStyles('collapse')}>\n <div {...getStyles('children')}>{children}</div>\n </Collapse>\n )}\n </>\n );\n});\n\nNavLink.classes = classes;\nNavLink.varsResolver = varsResolver;\nNavLink.displayName = '@mantine/core/NavLink';\n\nexport namespace NavLink {\n export type Props = NavLinkProps;\n export type StylesNames = NavLinkStylesNames;\n export type CssVariables = NavLinkCssVariables;\n export type Factory = NavLinkFactory;\n export type Variant = NavLinkVariant;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmGA,MAAM,eAAeA,6BAAAA,oBAClB,OAAO,EAAE,SAAS,OAAO,gBAAgB,mBAAmB;CAC3D,MAAM,SAAS,MAAM,qBAAqB;EACxC,OAAO,SAAS,MAAM;EACtB;EACA,SAAS,WAAW;EACpB;EACD,CAAC;AAEF,QAAO;EACL,MAAM;GACJ,WAAW,SAAS,UAAU,OAAO,aAAa,KAAA;GAClD,cAAc,SAAS,UAAU,OAAO,QAAQ,KAAA;GAChD,cAAc,SAAS,UAAU,OAAO,QAAQ,KAAA;GACjD;EAED,UAAU,EACR,eAAeC,iBAAAA,WAAW,eAAe,EAC1C;EACF;EAEJ;AAED,MAAa,UAAUC,4BAAAA,oBAAoC,WAAW;CACpE,MAAM,QAAQC,kBAAAA,SAAS,WAAW,MAAM,OAAO;CAC/C,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,QACA,eACA,UACA,UACA,QACA,UACA,aACA,cACA,OACA,aACA,6BACA,QACA,gBACA,cACA,KACA,YACA,SACA,WACA,aACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAA0B;EAC1C,MAAM;EACN;EACA,SAAA,uBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,CAAC,SAAS,cAAA,GAAA,eAAA,iBAA6B;EAC3C,OAAO;EACP,cAAc;EACd,YAAY;EACZ;EACD,CAAC;CAEF,MAAM,eAAe,CAAC,CAAC;CAEvB,MAAM,eAAe,UAA+C;AAClE,YAAU,MAAM;AAEhB,MAAI,cAAc;AAChB,SAAM,gBAAgB;AACtB,aAAU,CAAC,QAAQ;;;AAIvB,QACE,iBAAA,GAAA,kBAAA,MAAA,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C,OAAD;GAAK,GAAI,UAAU,WAAW;GAAG;GAAe,CAAA;EACvC,CAAA,CAEZ,EAAA,CAAA;EAEL;AAEF,QAAQ,UAAUC,uBAAAA;AAClB,QAAQ,eAAe;AACvB,QAAQ,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Notification.cjs","names":["createVarsResolver","getRadius","getThemeColor","factory","useProps","useStyles","Box","Loader","CloseButton","classes"],"sources":["../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getRadius,\n getThemeColor,\n MantineColor,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { CloseButton } from '../CloseButton';\nimport { Loader, LoaderProps } from '../Loader';\nimport classes from './Notification.module.css';\n\nexport type NotificationStylesNames =\n | 'root'\n | 'icon'\n | 'loader'\n | 'body'\n | 'title'\n | 'description'\n | 'closeButton';\nexport type NotificationCssVariables = {\n root: '--notification-radius' | '--notification-color';\n};\n\nexport interface NotificationProps\n extends BoxProps, StylesApiProps<NotificationFactory>, ElementProps<'div', 'title'> {\n /** Called when the close button is clicked */\n onClose?: () => void;\n\n /** Controls icon background color or notification accent line color, key of `theme.colors` or any valid CSS color. When `icon` is provided, sets the icon background color. When no icon is provided, sets the colored accent line on the left. @default theme.primaryColor */\n color?: MantineColor;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Notification icon, replaces color line */\n icon?: React.ReactNode;\n\n /** Notification title, displayed above the message body */\n title?: React.ReactNode;\n\n /** Notification description, displayed below the title. When no title is provided, this serves as the main message. */\n children?: React.ReactNode;\n\n /** If set, displays a `Loader` component instead of the icon. Takes precedence over the `icon` prop if both are provided. */\n loading?: boolean;\n\n /** Adds border to the root element */\n withBorder?: boolean;\n\n /** If set, the close button is visible @default true */\n withCloseButton?: boolean;\n\n /** Props passed down to the close button */\n closeButtonProps?: ElementProps<'button'> & DataAttributes;\n\n /** Props passed down to the `Loader` component */\n loaderProps?: LoaderProps;\n}\n\nexport type NotificationFactory = Factory<{\n props: NotificationProps;\n ref: HTMLDivElement;\n stylesNames: NotificationStylesNames;\n vars: NotificationCssVariables;\n}>;\n\nconst defaultProps = {\n withCloseButton: true,\n} satisfies Partial<NotificationProps>;\n\nconst varsResolver = createVarsResolver<NotificationFactory>((theme, { radius, color }) => ({\n root: {\n '--notification-radius': radius === undefined ? undefined : getRadius(radius),\n '--notification-color': color ? getThemeColor(color, theme) : undefined,\n },\n}));\n\nexport const Notification = factory<NotificationFactory>((_props) => {\n const props = useProps('Notification', defaultProps, _props);\n const {\n className,\n color,\n radius,\n loading,\n withCloseButton,\n withBorder,\n title,\n icon,\n children,\n onClose,\n closeButtonProps,\n classNames,\n style,\n styles,\n unstyled,\n vars,\n mod,\n loaderProps,\n role,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<NotificationFactory>({\n name: 'Notification',\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 {...getStyles('root')}\n mod={[{ 'data-with-icon': !!icon || loading, 'data-with-border': withBorder }, mod]}\n role={role || 'alert'}\n {...others}\n >\n {icon && !loading && <div {...getStyles('icon')}>{icon}</div>}\n {loading && <Loader size={28} color={color} {...getStyles('loader')} {...loaderProps} />}\n\n <div {...getStyles('body')}>\n {title && <div {...getStyles('title')}>{title}</div>}\n\n <Box {...getStyles('description')} mod={{ 'data-with-title': !!title }}>\n {children}\n </Box>\n </div>\n\n {withCloseButton && (\n <CloseButton\n iconSize={16}\n color=\"gray\"\n {...closeButtonProps}\n unstyled={unstyled}\n onClick={(event) => {\n closeButtonProps?.onClick?.(event);\n onClose?.();\n }}\n {...getStyles('closeButton')}\n />\n )}\n </Box>\n );\n});\n\nNotification.classes = classes;\nNotification.varsResolver = varsResolver;\nNotification.displayName = '@mantine/core/Notification';\n"],"mappings":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KAAD;KAAK,GAAI,UAAU,cAAc;KAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,OAAO;KACnE;KACG,CAAA,CACF;;GAEL,mBACC,iBAAA,GAAA,kBAAA,KAACE,oBAAAA,aAAD;IACE,UAAU;IACV,OAAM;IACN,GAAI;IACM;IACV,UAAU,UAAU;AAClB,uBAAkB,UAAU,MAAM;AAClC,gBAAW;;IAEb,GAAI,UAAU,cAAc;IAC5B,CAAA;GAEA;;EAER;AAEF,aAAa,UAAUC,4BAAAA;AACvB,aAAa,eAAe;AAC5B,aAAa,cAAc"}
1
+ {"version":3,"file":"Notification.cjs","names":["createVarsResolver","getRadius","getThemeColor","factory","useProps","useStyles","Box","Loader","CloseButton","classes"],"sources":["../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getRadius,\n getThemeColor,\n MantineColor,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { CloseButton } from '../CloseButton';\nimport { Loader, LoaderProps } from '../Loader';\nimport classes from './Notification.module.css';\n\nexport type NotificationStylesNames =\n | 'root'\n | 'icon'\n | 'loader'\n | 'body'\n | 'title'\n | 'description'\n | 'closeButton';\nexport type NotificationCssVariables = {\n root: '--notification-radius' | '--notification-color';\n};\n\nexport interface NotificationProps\n extends BoxProps, StylesApiProps<NotificationFactory>, ElementProps<'div', 'title'> {\n /** Called when the close button is clicked */\n onClose?: () => void;\n\n /** Controls icon background color or notification accent line color, key of `theme.colors` or any valid CSS color. When `icon` is provided, sets the icon background color. When no icon is provided, sets the colored accent line on the left. @default theme.primaryColor */\n color?: MantineColor;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Notification icon, replaces color line */\n icon?: React.ReactNode;\n\n /** Notification title, displayed above the message body */\n title?: React.ReactNode;\n\n /** Notification description, displayed below the title. When no title is provided, this serves as the main message. */\n children?: React.ReactNode;\n\n /** If set, displays a `Loader` component instead of the icon. Takes precedence over the `icon` prop if both are provided. */\n loading?: boolean;\n\n /** Adds border to the root element */\n withBorder?: boolean;\n\n /** If set, the close button is visible @default true */\n withCloseButton?: boolean;\n\n /** Props passed down to the close button */\n closeButtonProps?: ElementProps<'button'> & DataAttributes;\n\n /** Props passed down to the `Loader` component */\n loaderProps?: LoaderProps;\n}\n\nexport type NotificationFactory = Factory<{\n props: NotificationProps;\n ref: HTMLDivElement;\n stylesNames: NotificationStylesNames;\n vars: NotificationCssVariables;\n}>;\n\nconst defaultProps = {\n withCloseButton: true,\n} satisfies Partial<NotificationProps>;\n\nconst varsResolver = createVarsResolver<NotificationFactory>((theme, { radius, color }) => ({\n root: {\n '--notification-radius': radius === undefined ? undefined : getRadius(radius),\n '--notification-color': color ? getThemeColor(color, theme) : undefined,\n },\n}));\n\nexport const Notification = factory<NotificationFactory>((_props) => {\n const props = useProps('Notification', defaultProps, _props);\n const {\n className,\n color,\n radius,\n loading,\n withCloseButton,\n withBorder,\n title,\n icon,\n children,\n onClose,\n closeButtonProps,\n classNames,\n style,\n styles,\n unstyled,\n vars,\n mod,\n loaderProps,\n role,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<NotificationFactory>({\n name: 'Notification',\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 {...getStyles('root')}\n mod={[{ 'data-with-icon': !!icon || loading, 'data-with-border': withBorder }, mod]}\n role={role || 'alert'}\n {...others}\n >\n {icon && !loading && <div {...getStyles('icon')}>{icon}</div>}\n {loading && <Loader size={28} color={color} {...getStyles('loader')} {...loaderProps} />}\n\n <div {...getStyles('body')}>\n {title && <div {...getStyles('title')}>{title}</div>}\n\n <Box {...getStyles('description')} mod={{ 'data-with-title': !!title }}>\n {children}\n </Box>\n </div>\n\n {withCloseButton && (\n <CloseButton\n iconSize={16}\n color=\"gray\"\n {...closeButtonProps}\n unstyled={unstyled}\n onClick={(event) => {\n closeButtonProps?.onClick?.(event);\n onClose?.();\n }}\n {...getStyles('closeButton')}\n />\n )}\n </Box>\n );\n});\n\nNotification.classes = classes;\nNotification.varsResolver = varsResolver;\nNotification.displayName = '@mantine/core/Notification';\n\nexport namespace Notification {\n export type Props = NotificationProps;\n export type StylesNames = NotificationStylesNames;\n export type Factory = NotificationFactory;\n export type CssVariables = NotificationCssVariables;\n}\n"],"mappings":";;;;;;;;;;;;;;AA2EA,MAAM,eAAe,EACnB,iBAAiB,MAClB;AAED,MAAM,eAAeA,6BAAAA,oBAAyC,OAAO,EAAE,QAAQ,aAAa,EAC1F,MAAM;CACJ,yBAAyB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO;CAC7E,wBAAwB,QAAQC,wBAAAA,cAAc,OAAO,MAAM,GAAG,KAAA;CAC/D,EACF,EAAE;AAEH,MAAa,eAAeC,gBAAAA,SAA8B,WAAW;CACnE,MAAM,QAAQC,kBAAAA,SAAS,gBAAgB,cAAc,OAAO;CAC5D,MAAM,EACJ,WACA,OACA,QACA,SACA,iBACA,YACA,OACA,MACA,UACA,SACA,kBACA,YACA,OACA,QACA,UACA,MACA,KACA,aACA,MACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAA+B;EAC/C,MAAM;EACN,SAAA,4BAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,MAACC,YAAAA,KAAD;EACE,GAAI,UAAU,OAAO;EACrB,KAAK,CAAC;GAAE,kBAAkB,CAAC,CAAC,QAAQ;GAAS,oBAAoB;GAAY,EAAE,IAAI;EACnF,MAAM,QAAQ;EACd,GAAI;YAJN;GAMG,QAAQ,CAAC,WAAW,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,GAAI,UAAU,OAAO;cAAG;IAAW,CAAA;GAC5D,WAAW,iBAAA,GAAA,kBAAA,KAACC,eAAAA,QAAD;IAAQ,MAAM;IAAW;IAAO,GAAI,UAAU,SAAS;IAAE,GAAI;IAAe,CAAA;GAExF,iBAAA,GAAA,kBAAA,MAAC,OAAD;IAAK,GAAI,UAAU,OAAO;cAA1B,CACG,SAAS,iBAAA,GAAA,kBAAA,KAAC,OAAD;KAAK,GAAI,UAAU,QAAQ;eAAG;KAAY,CAAA,EAEpD,iBAAA,GAAA,kBAAA,KAACD,YAAAA,KAAD;KAAK,GAAI,UAAU,cAAc;KAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,OAAO;KACnE;KACG,CAAA,CACF;;GAEL,mBACC,iBAAA,GAAA,kBAAA,KAACE,oBAAAA,aAAD;IACE,UAAU;IACV,OAAM;IACN,GAAI;IACM;IACV,UAAU,UAAU;AAClB,uBAAkB,UAAU,MAAM;AAClC,gBAAW;;IAEb,GAAI,UAAU,cAAc;IAC5B,CAAA;GAEA;;EAER;AAEF,aAAa,UAAUC,4BAAAA;AACvB,aAAa,eAAe;AAC5B,aAAa,cAAc"}
@@ -71,6 +71,7 @@ function isInRange(value, min, max) {
71
71
  return (min === void 0 || value >= min) && (max === void 0 || value <= max);
72
72
  }
73
73
  const defaultProps = {
74
+ size: "sm",
74
75
  step: 1,
75
76
  clampBehavior: "blur",
76
77
  allowDecimal: true,
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.cjs","names":["createVarsResolver","getSize","genericFactory","useProps","useStyles","useResolvedStylesApi","noop","UnstyledButton","NumberInputChevron","InputBase","NumericFormat","classes"],"sources":["../../../src/components/NumberInput/NumberInput.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport cx from 'clsx';\nimport { NumberFormatValues, NumericFormat, OnValueChange } from 'react-number-format';\nimport { assignRef, clamp, useMergedRef, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n createVarsResolver,\n ElementProps,\n Factory,\n genericFactory,\n getSize,\n noop,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '../../core';\nimport { __BaseInputProps, __InputStylesNames, InputVariant } from '../Input';\nimport { InputBase } from '../InputBase';\nimport { UnstyledButton } from '../UnstyledButton';\nimport { NumberInputChevron } from './NumberInputChevron';\nimport classes from './NumberInput.module.css';\n\n// Re for negative -0, -0., -0.0, -0.00, -0.000 ... strings\n// And for positive 0., 0.0, 0.00, 0.000 ... strings\nconst leadingDecimalZeroPattern = /^(0\\.0*|-0(\\.0*)?)$/;\n\n// Re for 01, 006, 00.02, -0010, -000.293 ... and negative counterparts\nconst leadingZerosPattern = /^-?0\\d+(\\.\\d+)?\\.?$/;\n\n// Re for decimal numbers with trailing zeros like 13.0, 13.00, 5.10 ... strings\nconst trailingZerosPattern = /\\.\\d*0$/;\n\n// Re for numbers with trailing decimal separator like 10. or -3.\nconst trailingDecimalSeparatorPattern = /^-?\\d+\\.$/;\n\nexport interface NumberInputHandlers {\n increment: () => void;\n decrement: () => void;\n}\n\nexport type NumberInputMode = 'number' | 'bigint';\nexport type NumberInputNumericType = number | bigint;\nexport type NumberInputValue<T extends NumberInputNumericType = number> = T | string;\ntype NumberInputNumericValue<T extends NumberInputNumericType = number> = T;\ntype InternalNumberInputValue = string | number | bigint;\n\nfunction isNumberString(value: unknown) {\n return typeof value === 'string' && value !== '' && !Number.isNaN(Number(value));\n}\n\nfunction isBigIntValue(value: unknown): value is bigint {\n return typeof value === 'bigint';\n}\n\nfunction canStep(value: number | string) {\n if (typeof value === 'number') {\n return value < Number.MAX_SAFE_INTEGER;\n }\n\n return value === '' || (isNumberString(value) && Number(value) < Number.MAX_SAFE_INTEGER);\n}\n\nfunction isValidBigIntString(value: string, allowNegative: boolean) {\n if (value === '') {\n return false;\n }\n\n if (value === '-') {\n return false;\n }\n\n if (!allowNegative && value.startsWith('-')) {\n return false;\n }\n\n return /^-?\\d+$/.test(value);\n}\n\nfunction canStepBigInt(value: bigint | string, allowNegative: boolean) {\n if (typeof value === 'bigint') {\n return true;\n }\n\n return value === '' || isValidBigIntString(value, allowNegative);\n}\n\nfunction parseBigIntFromString(value: string): bigint | null {\n if (!/^-?\\d+$/.test(value)) {\n return null;\n }\n\n try {\n return BigInt(value);\n } catch {\n return null;\n }\n}\n\nfunction toBigIntOrUndefined(value: unknown): bigint | undefined {\n if (typeof value === 'bigint') {\n return value;\n }\n\n if (typeof value === 'number' && Number.isFinite(value) && Number.isInteger(value)) {\n return BigInt(value);\n }\n\n return undefined;\n}\n\nfunction clampBigInt(value: bigint, min?: bigint, max?: bigint) {\n if (min !== undefined && value < min) {\n return min;\n }\n\n if (max !== undefined && value > max) {\n return max;\n }\n\n return value;\n}\n\nfunction getTotalDigits(inputValue: string | number): number {\n // All digits must be counted, parseFloat precision depends\n // on the number of digits in the input, not only on the decimal scale\n return inputValue.toString().replace('.', '').length;\n}\n\nfunction isValidNumber(floatValue: number | undefined, value: string): floatValue is number {\n return (\n (typeof floatValue === 'number'\n ? floatValue < Number.MAX_SAFE_INTEGER\n : !Number.isNaN(Number(floatValue))) &&\n !Number.isNaN(floatValue) &&\n getTotalDigits(value) < 14 &&\n value !== ''\n );\n}\n\nfunction isInRange(value: number | undefined, min: number | undefined, max: number | undefined) {\n if (value === undefined) {\n return true;\n }\n\n const minValid = min === undefined || value >= min;\n const maxValid = max === undefined || value <= max;\n\n return minValid && maxValid;\n}\n\nexport type NumberInputStylesNames = 'controls' | 'control' | __InputStylesNames;\nexport type NumberInputCssVariables = {\n controls: '--ni-chevron-size';\n};\n\nexport interface NumberInputProps<T extends NumberInputNumericType = number>\n extends\n BoxProps,\n Omit<__BaseInputProps, 'pointer'>,\n StylesApiProps<NumberInputFactory>,\n ElementProps<\n 'input',\n 'size' | 'type' | 'onChange' | 'value' | 'defaultValue' | 'min' | 'max' | 'step'\n > {\n /** Controlled component value */\n value?: NumberInputValue<T>;\n\n /** Uncontrolled component default value */\n defaultValue?: NumberInputValue<T>;\n\n /** Called when value changes */\n onChange?: (value: NumberInputValue<T>) => void;\n\n /** Called when value changes with `react-number-format` payload */\n onValueChange?: OnValueChange;\n\n /** Determines whether leading zeros are allowed during input. If `false`, leading zeros are removed as you type (e.g., typing `007` results in `7`). Works in conjunction with `trimLeadingZeroesOnBlur`. @default true */\n allowLeadingZeros?: boolean;\n\n /** Determines whether negative numbers are allowed. If `false`, the input will not accept negative values, and the decrement button will stop at `0` (when `min` is not set). @default true */\n allowNegative?: boolean;\n\n /** Characters which when pressed result in a decimal separator. These characters will be replaced by the `decimalSeparator` in the input value. @default ['.', ','] */\n allowedDecimalSeparators?: string[];\n\n /** Limits the number of digits that can be entered after the decimal point @default Infinity */\n decimalScale?: number;\n\n /** Character used as a decimal separator. Generally used with `allowedDecimalSeparators` prop. @default '.' */\n decimalSeparator?: string;\n\n /** If `true`, automatically pads the decimal part with zeros to match `decimalScale` (e.g., with `decimalScale={2}`, typing `5.1` displays as `5.10`). Requires `decimalScale` to be set. @default false */\n fixedDecimalScale?: boolean;\n\n /** Prefix added before the input value */\n prefix?: string;\n\n /** Suffix added after the input value */\n suffix?: string;\n\n /** Defines the thousand grouping style. 'thousand' (1,000), 'lakh' (1,00,000), 'wan' (1,0000), 'none'. */\n thousandsGroupStyle?: 'thousand' | 'lakh' | 'wan' | 'none';\n\n /** A function to validate the input value. If this function returns `false`, the `onChange` will not be called and the input value will not change. */\n isAllowed?: (values: NumberFormatValues) => boolean;\n\n /** Advanced: Set to `true` if you're passing numeric strings (e.g., `\"12345\"`) and using formatting props like `prefix` or `suffix`. In most cases, you don't need this prop. See [react-number-format docs](https://www.npmjs.com/package/react-number-format) for details. @default false */\n valueIsNumericString?: boolean;\n\n /** Controls input `type` attribute @default 'text' */\n type?: 'text' | 'tel' | 'password';\n\n /** A character used to separate thousands */\n thousandSeparator?: string | boolean;\n\n /** Minimum possible value */\n min?: NumberInputNumericValue<T>;\n\n /** Maximum possible value */\n max?: NumberInputNumericValue<T>;\n\n /** Number by which value will be incremented/decremented with up/down controls and keyboard arrows @default 1 */\n step?: NumberInputNumericValue<T>;\n\n /** If set, the up/down controls are hidden @default false */\n hideControls?: boolean;\n\n /** Controls how values are clamped to the `min`/`max` range:\n * - `'blur'` (default): User can type any value, but it's clamped when the input loses focus\n * - `'strict'`: User cannot type values outside the range\n * - `'none'`: No clamping; `min`/`max` only apply to increment/decrement controls and arrow keys\n */\n clampBehavior?: 'strict' | 'blur' | 'none';\n\n /** If set, decimal values are allowed @default true */\n allowDecimal?: boolean;\n\n /** Increment/decrement handlers */\n handlersRef?: React.Ref<NumberInputHandlers | undefined>;\n\n /** Value used when incrementing/decrementing an empty input. If `min` is set and `startValue < min`, `min` is used instead. @default 0 */\n startValue?: NumberInputNumericValue<T>;\n\n /** Interval in milliseconds between value steps when increment/decrement button is held down. Can be a number or a function `(stepCount) => number` for dynamic intervals. Requires `stepHoldDelay` to be set. @default undefined */\n stepHoldInterval?: number | ((stepCount: number) => number);\n\n /** Initial delay in milliseconds before stepping the value. */\n stepHoldDelay?: number;\n\n /** If set, up/down keyboard events increment/decrement value @default true */\n withKeyboardEvents?: boolean;\n\n /** If set, leading zeros are removed on blur. For example, `00100` -> `100` @default true */\n trimLeadingZeroesOnBlur?: boolean;\n\n /** If set, all text is selected when the input receives focus @default false */\n selectAllOnFocus?: boolean;\n\n /** Called when the increment button or arrow up key is pressed and the value has reached the maximum */\n onMinReached?: () => void;\n\n /** Called when the decrement button or arrow down key is pressed and the value has reached the minimum */\n onMaxReached?: () => void;\n}\n\nexport type NumberInputFactory = Factory<{\n props: NumberInputProps;\n ref: HTMLInputElement;\n stylesNames: NumberInputStylesNames;\n vars: NumberInputCssVariables;\n variant: InputVariant;\n signature: <T extends NumberInputNumericType = number>(\n props: NumberInputProps<T>\n ) => React.JSX.Element;\n}>;\n\nconst defaultProps = {\n step: 1,\n clampBehavior: 'blur',\n allowDecimal: true,\n allowNegative: true,\n withKeyboardEvents: true,\n allowLeadingZeros: true,\n trimLeadingZeroesOnBlur: true,\n startValue: 0,\n allowedDecimalSeparators: ['.', ','],\n} satisfies Partial<NumberInputProps<number | bigint>>;\n\nconst varsResolver = createVarsResolver<NumberInputFactory>((_, { size }) => ({\n controls: {\n '--ni-chevron-size': getSize(size, 'ni-chevron-size'),\n },\n}));\n\nfunction clampAndSanitizeInput(sanitizedValue: string | number, max?: number, min?: number) {\n const stringValue = sanitizedValue.toString();\n const hasTrailingDecimalSeparator = trailingDecimalSeparatorPattern.test(stringValue);\n\n const replaced = stringValue.replace(/^0+(?=\\d)/, '');\n const parsedValue = parseFloat(replaced);\n\n if (Number.isNaN(parsedValue)) {\n return replaced;\n }\n\n if (parsedValue > Number.MAX_SAFE_INTEGER) {\n return max !== undefined ? max : replaced;\n }\n\n const clamped = clamp(parsedValue, min, max);\n\n if (hasTrailingDecimalSeparator) {\n const clampedString = clamped.toString().replace(/^0+(?=\\d)/, '');\n return `${clampedString}.`;\n }\n\n return clamped;\n}\n\nfunction clampAndSanitizeBigIntInput(\n sanitizedValue: string,\n options: { min?: bigint; max?: bigint; clampBehavior: NumberInputProps['clampBehavior'] }\n) {\n if (sanitizedValue === '' || sanitizedValue === '-') {\n return sanitizedValue;\n }\n\n const parsed = parseBigIntFromString(sanitizedValue);\n\n if (parsed === null) {\n return sanitizedValue;\n }\n\n return options.clampBehavior === 'blur' ? clampBigInt(parsed, options.min, options.max) : parsed;\n}\n\nexport const NumberInput = genericFactory<NumberInputFactory>(\n <T extends NumberInputNumericType = number>(_props: NumberInputProps<T>) => {\n const props = useProps(\n 'NumberInput',\n defaultProps as Partial<NumberInputProps>,\n _props as unknown as NumberInputProps\n );\n const {\n className,\n classNames,\n styles,\n unstyled,\n vars,\n onChange,\n onValueChange,\n value,\n defaultValue,\n max,\n min,\n step,\n hideControls,\n rightSection,\n isAllowed,\n clampBehavior,\n onBlur,\n allowDecimal,\n decimalScale,\n onKeyDown,\n onKeyDownCapture,\n handlersRef,\n startValue,\n disabled,\n rightSectionPointerEvents,\n allowNegative,\n readOnly,\n size,\n rightSectionWidth,\n stepHoldInterval,\n stepHoldDelay,\n allowLeadingZeros,\n withKeyboardEvents,\n trimLeadingZeroesOnBlur,\n allowedDecimalSeparators,\n selectAllOnFocus,\n onMinReached,\n onMaxReached,\n onFocus,\n attributes,\n ref,\n ...others\n } = props;\n const allowNegativeResolved = allowNegative ?? true;\n const allowLeadingZerosResolved = allowLeadingZeros ?? true;\n\n const getStyles = useStyles<NumberInputFactory>({\n name: 'NumberInput',\n classes,\n props: props as NumberInputProps,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<NumberInputFactory>({\n classNames,\n styles,\n props: props as NumberInputProps,\n });\n\n const valueModeRef = useRef<NumberInputMode>(\n isBigIntValue(value) || isBigIntValue(defaultValue) ? 'bigint' : 'number'\n );\n\n if (isBigIntValue(value)) {\n valueModeRef.current = 'bigint';\n } else if (typeof value === 'number') {\n valueModeRef.current = 'number';\n }\n\n const isBigIntMode = valueModeRef.current === 'bigint';\n\n const [_value, setValue] = useUncontrolled<InternalNumberInputValue>({\n value: value as InternalNumberInputValue | undefined,\n defaultValue: defaultValue as InternalNumberInputValue | undefined,\n finalValue: '',\n onChange: onChange as ((value: InternalNumberInputValue) => void) | undefined,\n });\n\n const shouldUseStepInterval = stepHoldDelay !== undefined && stepHoldInterval !== undefined;\n const inputRef = useRef<HTMLInputElement>(null);\n const onStepTimeoutRef = useRef<number | null>(null);\n const stepCountRef = useRef<number>(0);\n\n const minNumber = typeof min === 'number' ? min : undefined;\n const maxNumber = typeof max === 'number' ? max : undefined;\n const stepNumber = typeof step === 'number' ? step : defaultProps.step;\n const startValueNumber = typeof startValue === 'number' ? startValue : defaultProps.startValue;\n\n const minBigInt = toBigIntOrUndefined(min);\n const maxBigInt = toBigIntOrUndefined(max);\n const stepBigInt = toBigIntOrUndefined(step) ?? BigInt(1);\n const startValueBigInt = toBigIntOrUndefined(startValue) ?? BigInt(0);\n\n const parseBigIntOrString = (inputValue: string): bigint | string => {\n if (\n !isValidBigIntString(inputValue, allowNegativeResolved) ||\n (allowLeadingZerosResolved && leadingZerosPattern.test(inputValue))\n ) {\n return inputValue;\n }\n\n const parsed = parseBigIntFromString(inputValue);\n return parsed ?? inputValue;\n };\n\n const getBigIntFloatValue = (inputValue: bigint) => {\n const numericValue = Number(inputValue);\n return Number.isSafeInteger(numericValue) ? numericValue : undefined;\n };\n\n const handleValueChange: OnValueChange = (payload, event) => {\n if (event.source === 'event') {\n if (isBigIntMode) {\n setValue(parseBigIntOrString(payload.value));\n } else {\n setValue(\n isValidNumber(payload.floatValue, payload.value) &&\n !leadingDecimalZeroPattern.test(payload.value) &&\n !(allowLeadingZerosResolved ? leadingZerosPattern.test(payload.value) : false) &&\n !trailingZerosPattern.test(payload.value) &&\n !trailingDecimalSeparatorPattern.test(payload.value)\n ? payload.floatValue\n : payload.value\n );\n }\n }\n onValueChange?.(payload, event);\n };\n\n const getDecimalPlaces = (inputValue: number | string): number => {\n const match = String(inputValue).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\n if (!match) {\n return 0;\n }\n return Math.max(0, (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0));\n };\n\n const adjustCursor = (position?: number) => {\n if (inputRef.current && typeof position !== 'undefined') {\n inputRef.current.setSelectionRange(position, position);\n }\n };\n\n const incrementRef = useRef<() => void>(noop);\n incrementRef.current = () => {\n if (isBigIntMode) {\n if (!canStepBigInt(_value as bigint | string, allowNegativeResolved)) {\n return;\n }\n\n let val: bigint;\n const currentValue = _value;\n\n if (typeof currentValue === 'bigint') {\n const incrementedValue = currentValue + stepBigInt;\n if (maxBigInt !== undefined && incrementedValue > maxBigInt) {\n onMaxReached?.();\n }\n val =\n maxBigInt !== undefined && incrementedValue > maxBigInt ? maxBigInt : incrementedValue;\n } else if (typeof currentValue === 'string' && currentValue !== '') {\n const parsed = parseBigIntFromString(currentValue);\n if (parsed === null) {\n return;\n }\n\n const incrementedValue = parsed + stepBigInt;\n if (maxBigInt !== undefined && incrementedValue > maxBigInt) {\n onMaxReached?.();\n }\n val =\n maxBigInt !== undefined && incrementedValue > maxBigInt ? maxBigInt : incrementedValue;\n } else {\n val = clampBigInt(startValueBigInt, minBigInt, maxBigInt);\n }\n\n const formattedValue = val.toString();\n setValue(val);\n onValueChange?.(\n { floatValue: getBigIntFloatValue(val), formattedValue, value: formattedValue },\n { source: 'increment' as any }\n );\n setTimeout(() => adjustCursor(inputRef.current?.value.length), 0);\n return;\n }\n\n if (!canStep(_value as number | string)) {\n return;\n }\n\n let val: number;\n const currentValuePrecision = getDecimalPlaces(_value as number | string);\n const stepPrecision = getDecimalPlaces(stepNumber);\n const maxPrecision = Math.max(currentValuePrecision, stepPrecision);\n const factor = 10 ** maxPrecision;\n\n if (!isNumberString(_value) && (typeof _value !== 'number' || Number.isNaN(_value))) {\n val = clamp(startValueNumber, minNumber, maxNumber);\n } else if (maxNumber !== undefined) {\n const incrementedValue =\n (Math.round(Number(_value) * factor) + Math.round(stepNumber * factor)) / factor;\n if (incrementedValue > maxNumber) {\n onMaxReached?.();\n }\n val = incrementedValue <= maxNumber ? incrementedValue : maxNumber;\n } else {\n val = (Math.round(Number(_value) * factor) + Math.round(stepNumber * factor)) / factor;\n }\n\n const formattedValue = val.toFixed(maxPrecision);\n setValue(parseFloat(formattedValue));\n onValueChange?.(\n { floatValue: parseFloat(formattedValue), formattedValue, value: formattedValue },\n { source: 'increment' as any }\n );\n setTimeout(() => adjustCursor(inputRef.current?.value.length), 0);\n };\n\n const decrementRef = useRef<() => void>(noop);\n decrementRef.current = () => {\n if (isBigIntMode) {\n if (!canStepBigInt(_value as bigint | string, allowNegativeResolved)) {\n return;\n }\n\n let val: bigint;\n const minValue =\n minBigInt !== undefined ? minBigInt : !allowNegativeResolved ? BigInt(0) : undefined;\n const currentValue = _value;\n\n if (typeof currentValue === 'bigint') {\n const decrementedValue = currentValue - stepBigInt;\n if (minValue !== undefined && decrementedValue < minValue) {\n onMinReached?.();\n }\n val = minValue !== undefined && decrementedValue < minValue ? minValue : decrementedValue;\n } else if (typeof currentValue === 'string' && currentValue !== '') {\n const parsed = parseBigIntFromString(currentValue);\n if (parsed === null) {\n return;\n }\n\n const decrementedValue = parsed - stepBigInt;\n if (minValue !== undefined && decrementedValue < minValue) {\n onMinReached?.();\n }\n val = minValue !== undefined && decrementedValue < minValue ? minValue : decrementedValue;\n } else {\n val = clampBigInt(startValueBigInt, minValue, maxBigInt);\n }\n\n const formattedValue = val.toString();\n setValue(val);\n onValueChange?.(\n { floatValue: getBigIntFloatValue(val), formattedValue, value: formattedValue },\n { source: 'decrement' as any }\n );\n setTimeout(() => adjustCursor(inputRef.current?.value.length), 0);\n return;\n }\n\n if (!canStep(_value as number | string)) {\n return;\n }\n\n let val: number;\n const minValue =\n minNumber !== undefined ? minNumber : !allowNegativeResolved ? 0 : Number.MIN_SAFE_INTEGER;\n const currentValuePrecision = getDecimalPlaces(_value as number | string);\n const stepPrecision = getDecimalPlaces(stepNumber);\n const maxPrecision = Math.max(currentValuePrecision, stepPrecision);\n const factor = 10 ** maxPrecision;\n\n if ((!isNumberString(_value) && typeof _value !== 'number') || Number.isNaN(_value)) {\n val = clamp(startValueNumber, minValue, maxNumber);\n } else {\n const decrementedValue =\n (Math.round(Number(_value) * factor) - Math.round(stepNumber * factor)) / factor;\n if (minValue !== undefined && decrementedValue < minValue) {\n onMinReached?.();\n }\n val = minValue !== undefined && decrementedValue < minValue ? minValue : decrementedValue;\n }\n\n const formattedValue = val.toFixed(maxPrecision);\n setValue(parseFloat(formattedValue));\n onValueChange?.(\n { floatValue: parseFloat(formattedValue), formattedValue, value: formattedValue },\n { source: 'decrement' as any }\n );\n setTimeout(() => adjustCursor(inputRef.current?.value.length), 0);\n };\n\n const handlePaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\n const pastedText = event.clipboardData.getData('text');\n const _decimalSeparator = others.decimalSeparator || '.';\n const separatorsToReplace = (allowedDecimalSeparators || ['.', ',']).filter(\n (s) => s !== _decimalSeparator\n );\n\n if (separatorsToReplace.some((s) => pastedText.includes(s))) {\n event.preventDefault();\n let modifiedText = pastedText;\n separatorsToReplace.forEach((s) => {\n modifiedText = modifiedText.split(s).join(_decimalSeparator);\n });\n\n const input = inputRef.current;\n if (input) {\n const start = input.selectionStart ?? 0;\n const end = input.selectionEnd ?? 0;\n const currentValue = input.value;\n const newValue =\n currentValue.substring(0, start) + modifiedText + currentValue.substring(end);\n\n const nativeInputValueSetter = Object.getOwnPropertyDescriptor(\n window.HTMLInputElement.prototype,\n 'value'\n )?.set;\n nativeInputValueSetter?.call(input, newValue);\n input.dispatchEvent(new Event('change', { bubbles: true }));\n\n const cursorPos = start + modifiedText.length;\n setTimeout(() => adjustCursor(cursorPos), 0);\n }\n }\n\n others.onPaste?.(event as any);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n\n if (readOnly || !withKeyboardEvents) {\n return;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n incrementRef.current?.();\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n decrementRef.current?.();\n }\n };\n\n const handleKeyDownCapture = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDownCapture?.(event);\n if (event.key === 'Backspace') {\n const input = inputRef.current;\n if (input && input.selectionStart === 0 && input.selectionStart === input.selectionEnd) {\n event.preventDefault();\n window.setTimeout(() => adjustCursor(0), 0);\n }\n }\n };\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n if (selectAllOnFocus) {\n setTimeout(() => event.currentTarget.select(), 0);\n }\n onFocus?.(event);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n let sanitizedValue = _value;\n\n if (isBigIntMode) {\n if (clampBehavior === 'blur' && typeof sanitizedValue === 'bigint') {\n sanitizedValue = clampBigInt(sanitizedValue, minBigInt, maxBigInt);\n }\n\n if (trimLeadingZeroesOnBlur && typeof sanitizedValue === 'string') {\n sanitizedValue = clampAndSanitizeBigIntInput(sanitizedValue, {\n min: minBigInt,\n max: maxBigInt,\n clampBehavior,\n });\n }\n } else {\n if (clampBehavior === 'blur' && typeof sanitizedValue === 'number') {\n sanitizedValue = clamp(sanitizedValue, minNumber, maxNumber);\n }\n\n if (\n trimLeadingZeroesOnBlur &&\n typeof sanitizedValue === 'string' &&\n getDecimalPlaces(sanitizedValue) < 15\n ) {\n sanitizedValue = clampAndSanitizeInput(sanitizedValue, maxNumber, minNumber);\n }\n }\n\n if (_value !== sanitizedValue) {\n setValue(sanitizedValue);\n }\n\n onBlur?.(event);\n };\n\n assignRef(handlersRef, { increment: incrementRef.current, decrement: decrementRef.current });\n\n const onStepHandleChange = (isIncrement: boolean) => {\n if (isIncrement) {\n incrementRef.current?.();\n } else {\n decrementRef.current?.();\n }\n stepCountRef.current += 1;\n };\n\n const onStepLoop = (isIncrement: boolean) => {\n onStepHandleChange(isIncrement);\n\n if (shouldUseStepInterval) {\n const interval =\n typeof stepHoldInterval === 'number'\n ? stepHoldInterval\n : stepHoldInterval(stepCountRef.current);\n onStepTimeoutRef.current = window.setTimeout(() => onStepLoop(isIncrement), interval);\n }\n };\n\n const onStep = (\n event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n isIncrement: boolean\n ) => {\n event.preventDefault();\n inputRef.current?.focus();\n onStepHandleChange(isIncrement);\n if (shouldUseStepInterval) {\n onStepTimeoutRef.current = window.setTimeout(() => onStepLoop(isIncrement), stepHoldDelay);\n }\n };\n\n const onStepDone = () => {\n if (onStepTimeoutRef.current) {\n window.clearTimeout(onStepTimeoutRef.current);\n }\n onStepTimeoutRef.current = null;\n stepCountRef.current = 0;\n };\n\n const controls = (\n <div {...getStyles('controls')}>\n <UnstyledButton\n {...getStyles('control')}\n tabIndex={-1}\n aria-hidden\n disabled={\n disabled ||\n (typeof _value === 'number' && maxNumber !== undefined && _value >= maxNumber) ||\n (typeof _value === 'bigint' && maxBigInt !== undefined && _value >= maxBigInt)\n }\n mod={{ direction: 'up' }}\n onMouseDown={(event) => event.preventDefault()}\n onPointerDown={(event) => {\n onStep(event, true);\n }}\n onPointerUp={onStepDone}\n onPointerLeave={onStepDone}\n >\n <NumberInputChevron direction=\"up\" />\n </UnstyledButton>\n <UnstyledButton\n {...getStyles('control')}\n tabIndex={-1}\n aria-hidden\n disabled={\n disabled ||\n (typeof _value === 'number' && minNumber !== undefined && _value <= minNumber) ||\n (typeof _value === 'bigint' && minBigInt !== undefined && _value <= minBigInt)\n }\n mod={{ direction: 'down' }}\n onMouseDown={(event) => event.preventDefault()}\n onPointerDown={(event) => {\n onStep(event, false);\n }}\n onPointerUp={onStepDone}\n onPointerLeave={onStepDone}\n >\n <NumberInputChevron direction=\"down\" />\n </UnstyledButton>\n </div>\n );\n\n return (\n <InputBase\n component={NumericFormat}\n allowNegative={allowNegative}\n className={cx(classes.root, className)}\n size={size}\n {...others}\n inputMode={isBigIntMode ? 'numeric' : 'decimal'}\n readOnly={readOnly}\n disabled={disabled}\n value={typeof _value === 'bigint' ? _value.toString() : _value}\n getInputRef={useMergedRef(ref, inputRef)}\n onValueChange={handleValueChange}\n rightSection={\n hideControls ||\n readOnly ||\n !(isBigIntMode\n ? canStepBigInt(_value as bigint | string, allowNegativeResolved)\n : canStep(_value as number | string))\n ? rightSection\n : rightSection || controls\n }\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n __staticSelector=\"NumberInput\"\n decimalScale={isBigIntMode ? 0 : allowDecimal ? decimalScale : 0}\n onPaste={handlePaste}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n onKeyDownCapture={handleKeyDownCapture}\n rightSectionPointerEvents={rightSectionPointerEvents ?? (disabled ? 'none' : undefined)}\n rightSectionWidth={rightSectionWidth ?? `var(--ni-right-section-width-${size || 'sm'})`}\n allowLeadingZeros={allowLeadingZeros}\n allowedDecimalSeparators={allowedDecimalSeparators}\n onBlur={handleBlur}\n attributes={attributes}\n isAllowed={(val) => {\n const userAllowed = isAllowed ? isAllowed(val) : true;\n if (!userAllowed) {\n return false;\n }\n\n if (clampBehavior !== 'strict') {\n return true;\n }\n\n if (!isBigIntMode) {\n return isInRange(val.floatValue, minNumber, maxNumber);\n }\n\n if (val.value === '' || val.value === '-') {\n return true;\n }\n\n const parsed = parseBigIntFromString(val.value);\n\n if (parsed === null) {\n return true;\n }\n\n return (\n (minBigInt === undefined || parsed >= minBigInt) &&\n (maxBigInt === undefined || parsed <= maxBigInt)\n );\n }}\n />\n );\n }\n);\n\nNumberInput.classes = { ...InputBase.classes, ...classes };\nNumberInput.varsResolver = varsResolver;\nNumberInput.displayName = '@mantine/core/NumberInput';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,4BAA4B;AAGlC,MAAM,sBAAsB;AAG5B,MAAM,uBAAuB;AAG7B,MAAM,kCAAkC;AAaxC,SAAS,eAAe,OAAgB;AACtC,QAAO,OAAO,UAAU,YAAY,UAAU,MAAM,CAAC,OAAO,MAAM,OAAO,MAAM,CAAC;;AAGlF,SAAS,cAAc,OAAiC;AACtD,QAAO,OAAO,UAAU;;AAG1B,SAAS,QAAQ,OAAwB;AACvC,KAAI,OAAO,UAAU,SACnB,QAAO,QAAQ,OAAO;AAGxB,QAAO,UAAU,MAAO,eAAe,MAAM,IAAI,OAAO,MAAM,GAAG,OAAO;;AAG1E,SAAS,oBAAoB,OAAe,eAAwB;AAClE,KAAI,UAAU,GACZ,QAAO;AAGT,KAAI,UAAU,IACZ,QAAO;AAGT,KAAI,CAAC,iBAAiB,MAAM,WAAW,IAAI,CACzC,QAAO;AAGT,QAAO,UAAU,KAAK,MAAM;;AAG9B,SAAS,cAAc,OAAwB,eAAwB;AACrE,KAAI,OAAO,UAAU,SACnB,QAAO;AAGT,QAAO,UAAU,MAAM,oBAAoB,OAAO,cAAc;;AAGlE,SAAS,sBAAsB,OAA8B;AAC3D,KAAI,CAAC,UAAU,KAAK,MAAM,CACxB,QAAO;AAGT,KAAI;AACF,SAAO,OAAO,MAAM;SACd;AACN,SAAO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C5B;EACA;EACV,OAAO,OAAO,WAAW,WAAW,OAAO,UAAU,GAAG;EACxD,cAAA,GAAA,eAAA,cAA0B,KAAK,SAAS;EACxC,eAAe;EACf,cACE,gBACA,YACA,EAAE,eACE,cAAc,QAA2B,sBAAsB,GAC/D,QAAQ,OAA0B,IAClC,eACA,gBAAgB;EAEtB,YAAY;EACZ,QAAQ;EACE;EACV,kBAAiB;EACjB,cAAc,eAAe,IAAI,eAAe,eAAe;EAC/D,SAAS;EACT,SAAS;EACT,WAAW;EACX,kBAAkB;EAClB,2BAA2B,8BAA8B,WAAW,SAAS,KAAA;EAC7E,mBAAmB,qBAAqB,gCAAgC,QAAQ,KAAK;EAClE;EACO;EAC1B,QAAQ;EACI;EACZ,YAAY,QAAQ;AAElB,OAAI,EADgB,YAAY,UAAU,IAAI,GAAG,MAE/C,QAAO;AAGT,OAAI,kBAAkB,SACpB,QAAO;AAGT,OAAI,CAAC,aACH,QAAO,UAAU,IAAI,YAAY,WAAW,UAAU;AAGxD,OAAI,IAAI,UAAU,MAAM,IAAI,UAAU,IACpC,QAAO;GAGT,MAAM,SAAS,sBAAsB,IAAI,MAAM;AAE/C,OAAI,WAAW,KACb,QAAO;AAGT,WACG,cAAc,KAAA,KAAa,UAAU,eACrC,cAAc,KAAA,KAAa,UAAU;;EAG1C,CAAA;EAGP;AAED,YAAY,UAAU;CAAE,GAAGF,kBAAAA,UAAU;CAAS,GAAGE,2BAAAA;CAAS;AAC1D,YAAY,eAAe;AAC3B,YAAY,cAAc"}
1
+ {"version":3,"file":"NumberInput.cjs","names":["createVarsResolver","getSize","genericFactory","useProps","useStyles","useResolvedStylesApi","noop","UnstyledButton","NumberInputChevron","InputBase","NumericFormat","classes"],"sources":["../../../src/components/NumberInput/NumberInput.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport cx from 'clsx';\nimport { NumberFormatValues, NumericFormat, OnValueChange } from 'react-number-format';\nimport { assignRef, clamp, useMergedRef, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n createVarsResolver,\n ElementProps,\n Factory,\n genericFactory,\n getSize,\n noop,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '../../core';\nimport { __BaseInputProps, __InputStylesNames, InputVariant } from '../Input';\nimport { InputBase } from '../InputBase';\nimport { UnstyledButton } from '../UnstyledButton';\nimport { NumberInputChevron } from './NumberInputChevron';\nimport classes from './NumberInput.module.css';\n\n// Re for negative -0, -0., -0.0, -0.00, -0.000 ... strings\n// And for positive 0., 0.0, 0.00, 0.000 ... strings\nconst leadingDecimalZeroPattern = /^(0\\.0*|-0(\\.0*)?)$/;\n\n// Re for 01, 006, 00.02, -0010, -000.293 ... and negative counterparts\nconst leadingZerosPattern = /^-?0\\d+(\\.\\d+)?\\.?$/;\n\n// Re for decimal numbers with trailing zeros like 13.0, 13.00, 5.10 ... strings\nconst trailingZerosPattern = /\\.\\d*0$/;\n\n// Re for numbers with trailing decimal separator like 10. or -3.\nconst trailingDecimalSeparatorPattern = /^-?\\d+\\.$/;\n\nexport interface NumberInputHandlers {\n increment: () => void;\n decrement: () => void;\n}\n\nexport type NumberInputMode = 'number' | 'bigint';\nexport type NumberInputNumericType = number | bigint;\nexport type NumberInputValue<T extends NumberInputNumericType = number> = T | string;\ntype NumberInputNumericValue<T extends NumberInputNumericType = number> = T;\ntype InternalNumberInputValue = string | number | bigint;\n\nfunction isNumberString(value: unknown) {\n return typeof value === 'string' && value !== '' && !Number.isNaN(Number(value));\n}\n\nfunction isBigIntValue(value: unknown): value is bigint {\n return typeof value === 'bigint';\n}\n\nfunction canStep(value: number | string) {\n if (typeof value === 'number') {\n return value < Number.MAX_SAFE_INTEGER;\n }\n\n return value === '' || (isNumberString(value) && Number(value) < Number.MAX_SAFE_INTEGER);\n}\n\nfunction isValidBigIntString(value: string, allowNegative: boolean) {\n if (value === '') {\n return false;\n }\n\n if (value === '-') {\n return false;\n }\n\n if (!allowNegative && value.startsWith('-')) {\n return false;\n }\n\n return /^-?\\d+$/.test(value);\n}\n\nfunction canStepBigInt(value: bigint | string, allowNegative: boolean) {\n if (typeof value === 'bigint') {\n return true;\n }\n\n return value === '' || isValidBigIntString(value, allowNegative);\n}\n\nfunction parseBigIntFromString(value: string): bigint | null {\n if (!/^-?\\d+$/.test(value)) {\n return null;\n }\n\n try {\n return BigInt(value);\n } catch {\n return null;\n }\n}\n\nfunction toBigIntOrUndefined(value: unknown): bigint | undefined {\n if (typeof value === 'bigint') {\n return value;\n }\n\n if (typeof value === 'number' && Number.isFinite(value) && Number.isInteger(value)) {\n return BigInt(value);\n }\n\n return undefined;\n}\n\nfunction clampBigInt(value: bigint, min?: bigint, max?: bigint) {\n if (min !== undefined && value < min) {\n return min;\n }\n\n if (max !== undefined && value > max) {\n return max;\n }\n\n return value;\n}\n\nfunction getTotalDigits(inputValue: string | number): number {\n // All digits must be counted, parseFloat precision depends\n // on the number of digits in the input, not only on the decimal scale\n return inputValue.toString().replace('.', '').length;\n}\n\nfunction isValidNumber(floatValue: number | undefined, value: string): floatValue is number {\n return (\n (typeof floatValue === 'number'\n ? floatValue < Number.MAX_SAFE_INTEGER\n : !Number.isNaN(Number(floatValue))) &&\n !Number.isNaN(floatValue) &&\n getTotalDigits(value) < 14 &&\n value !== ''\n );\n}\n\nfunction isInRange(value: number | undefined, min: number | undefined, max: number | undefined) {\n if (value === undefined) {\n return true;\n }\n\n const minValid = min === undefined || value >= min;\n const maxValid = max === undefined || value <= max;\n\n return minValid && maxValid;\n}\n\nexport type NumberInputStylesNames = 'controls' | 'control' | __InputStylesNames;\nexport type NumberInputCssVariables = {\n controls: '--ni-chevron-size';\n};\n\nexport interface NumberInputProps<T extends NumberInputNumericType = number>\n extends\n BoxProps,\n Omit<__BaseInputProps, 'pointer'>,\n StylesApiProps<NumberInputFactory>,\n ElementProps<\n 'input',\n 'size' | 'type' | 'onChange' | 'value' | 'defaultValue' | 'min' | 'max' | 'step'\n > {\n /** Controlled component value */\n value?: NumberInputValue<T>;\n\n /** Uncontrolled component default value */\n defaultValue?: NumberInputValue<T>;\n\n /** Called when value changes */\n onChange?: (value: NumberInputValue<T>) => void;\n\n /** Called when value changes with `react-number-format` payload */\n onValueChange?: OnValueChange;\n\n /** Determines whether leading zeros are allowed during input. If `false`, leading zeros are removed as you type (e.g., typing `007` results in `7`). Works in conjunction with `trimLeadingZeroesOnBlur`. @default true */\n allowLeadingZeros?: boolean;\n\n /** Determines whether negative numbers are allowed. If `false`, the input will not accept negative values, and the decrement button will stop at `0` (when `min` is not set). @default true */\n allowNegative?: boolean;\n\n /** Characters which when pressed result in a decimal separator. These characters will be replaced by the `decimalSeparator` in the input value. @default ['.', ','] */\n allowedDecimalSeparators?: string[];\n\n /** Limits the number of digits that can be entered after the decimal point @default Infinity */\n decimalScale?: number;\n\n /** Character used as a decimal separator. Generally used with `allowedDecimalSeparators` prop. @default '.' */\n decimalSeparator?: string;\n\n /** If `true`, automatically pads the decimal part with zeros to match `decimalScale` (e.g., with `decimalScale={2}`, typing `5.1` displays as `5.10`). Requires `decimalScale` to be set. @default false */\n fixedDecimalScale?: boolean;\n\n /** Prefix added before the input value */\n prefix?: string;\n\n /** Suffix added after the input value */\n suffix?: string;\n\n /** Defines the thousand grouping style. 'thousand' (1,000), 'lakh' (1,00,000), 'wan' (1,0000), 'none'. */\n thousandsGroupStyle?: 'thousand' | 'lakh' | 'wan' | 'none';\n\n /** A function to validate the input value. If this function returns `false`, the `onChange` will not be called and the input value will not change. */\n isAllowed?: (values: NumberFormatValues) => boolean;\n\n /** Advanced: Set to `true` if you're passing numeric strings (e.g., `\"12345\"`) and using formatting props like `prefix` or `suffix`. In most cases, you don't need this prop. See [react-number-format docs](https://www.npmjs.com/package/react-number-format) for details. @default false */\n valueIsNumericString?: boolean;\n\n /** Controls input `type` attribute @default 'text' */\n type?: 'text' | 'tel' | 'password';\n\n /** A character used to separate thousands */\n thousandSeparator?: string | boolean;\n\n /** Minimum possible value */\n min?: NumberInputNumericValue<T>;\n\n /** Maximum possible value */\n max?: NumberInputNumericValue<T>;\n\n /** Number by which value will be incremented/decremented with up/down controls and keyboard arrows @default 1 */\n step?: NumberInputNumericValue<T>;\n\n /** If set, the up/down controls are hidden @default false */\n hideControls?: boolean;\n\n /** Controls how values are clamped to the `min`/`max` range:\n * - `'blur'` (default): User can type any value, but it's clamped when the input loses focus\n * - `'strict'`: User cannot type values outside the range\n * - `'none'`: No clamping; `min`/`max` only apply to increment/decrement controls and arrow keys\n */\n clampBehavior?: 'strict' | 'blur' | 'none';\n\n /** If set, decimal values are allowed @default true */\n allowDecimal?: boolean;\n\n /** Increment/decrement handlers */\n handlersRef?: React.Ref<NumberInputHandlers | undefined>;\n\n /** Value used when incrementing/decrementing an empty input. If `min` is set and `startValue < min`, `min` is used instead. @default 0 */\n startValue?: NumberInputNumericValue<T>;\n\n /** Interval in milliseconds between value steps when increment/decrement button is held down. Can be a number or a function `(stepCount) => number` for dynamic intervals. Requires `stepHoldDelay` to be set. @default undefined */\n stepHoldInterval?: number | ((stepCount: number) => number);\n\n /** Initial delay in milliseconds before stepping the value. */\n stepHoldDelay?: number;\n\n /** If set, up/down keyboard events increment/decrement value @default true */\n withKeyboardEvents?: boolean;\n\n /** If set, leading zeros are removed on blur. For example, `00100` -> `100` @default true */\n trimLeadingZeroesOnBlur?: boolean;\n\n /** If set, all text is selected when the input receives focus @default false */\n selectAllOnFocus?: boolean;\n\n /** Called when the increment button or arrow up key is pressed and the value has reached the maximum */\n onMinReached?: () => void;\n\n /** Called when the decrement button or arrow down key is pressed and the value has reached the minimum */\n onMaxReached?: () => void;\n}\n\nexport type NumberInputFactory = Factory<{\n props: NumberInputProps;\n ref: HTMLInputElement;\n stylesNames: NumberInputStylesNames;\n vars: NumberInputCssVariables;\n variant: InputVariant;\n signature: <T extends NumberInputNumericType = number>(\n props: NumberInputProps<T>\n ) => React.JSX.Element;\n}>;\n\nconst defaultProps = {\n size: 'sm',\n step: 1,\n clampBehavior: 'blur',\n allowDecimal: true,\n allowNegative: true,\n withKeyboardEvents: true,\n allowLeadingZeros: true,\n trimLeadingZeroesOnBlur: true,\n startValue: 0,\n allowedDecimalSeparators: ['.', ','],\n} satisfies Partial<NumberInputProps<number | bigint>>;\n\nconst varsResolver = createVarsResolver<NumberInputFactory>((_, { size }) => ({\n controls: {\n '--ni-chevron-size': getSize(size, 'ni-chevron-size'),\n },\n}));\n\nfunction clampAndSanitizeInput(sanitizedValue: string | number, max?: number, min?: number) {\n const stringValue = sanitizedValue.toString();\n const hasTrailingDecimalSeparator = trailingDecimalSeparatorPattern.test(stringValue);\n\n const replaced = stringValue.replace(/^0+(?=\\d)/, '');\n const parsedValue = parseFloat(replaced);\n\n if (Number.isNaN(parsedValue)) {\n return replaced;\n }\n\n if (parsedValue > Number.MAX_SAFE_INTEGER) {\n return max !== undefined ? max : replaced;\n }\n\n const clamped = clamp(parsedValue, min, max);\n\n if (hasTrailingDecimalSeparator) {\n const clampedString = clamped.toString().replace(/^0+(?=\\d)/, '');\n return `${clampedString}.`;\n }\n\n return clamped;\n}\n\nfunction clampAndSanitizeBigIntInput(\n sanitizedValue: string,\n options: { min?: bigint; max?: bigint; clampBehavior: NumberInputProps['clampBehavior'] }\n) {\n if (sanitizedValue === '' || sanitizedValue === '-') {\n return sanitizedValue;\n }\n\n const parsed = parseBigIntFromString(sanitizedValue);\n\n if (parsed === null) {\n return sanitizedValue;\n }\n\n return options.clampBehavior === 'blur' ? clampBigInt(parsed, options.min, options.max) : parsed;\n}\n\nexport const NumberInput = genericFactory<NumberInputFactory>(\n <T extends NumberInputNumericType = number>(_props: NumberInputProps<T>) => {\n const props = useProps(\n 'NumberInput',\n defaultProps as Partial<NumberInputProps>,\n _props as unknown as NumberInputProps\n );\n const {\n className,\n classNames,\n styles,\n unstyled,\n vars,\n onChange,\n onValueChange,\n value,\n defaultValue,\n max,\n min,\n step,\n hideControls,\n rightSection,\n isAllowed,\n clampBehavior,\n onBlur,\n allowDecimal,\n decimalScale,\n onKeyDown,\n onKeyDownCapture,\n handlersRef,\n startValue,\n disabled,\n rightSectionPointerEvents,\n allowNegative,\n readOnly,\n size,\n rightSectionWidth,\n stepHoldInterval,\n stepHoldDelay,\n allowLeadingZeros,\n withKeyboardEvents,\n trimLeadingZeroesOnBlur,\n allowedDecimalSeparators,\n selectAllOnFocus,\n onMinReached,\n onMaxReached,\n onFocus,\n attributes,\n ref,\n ...others\n } = props;\n const allowNegativeResolved = allowNegative ?? true;\n const allowLeadingZerosResolved = allowLeadingZeros ?? true;\n\n const getStyles = useStyles<NumberInputFactory>({\n name: 'NumberInput',\n classes,\n props: props as NumberInputProps,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<NumberInputFactory>({\n classNames,\n styles,\n props: props as NumberInputProps,\n });\n\n const valueModeRef = useRef<NumberInputMode>(\n isBigIntValue(value) || isBigIntValue(defaultValue) ? 'bigint' : 'number'\n );\n\n if (isBigIntValue(value)) {\n valueModeRef.current = 'bigint';\n } else if (typeof value === 'number') {\n valueModeRef.current = 'number';\n }\n\n const isBigIntMode = valueModeRef.current === 'bigint';\n\n const [_value, setValue] = useUncontrolled<InternalNumberInputValue>({\n value: value as InternalNumberInputValue | undefined,\n defaultValue: defaultValue as InternalNumberInputValue | undefined,\n finalValue: '',\n onChange: onChange as ((value: InternalNumberInputValue) => void) | undefined,\n });\n\n const shouldUseStepInterval = stepHoldDelay !== undefined && stepHoldInterval !== undefined;\n const inputRef = useRef<HTMLInputElement>(null);\n const onStepTimeoutRef = useRef<number | null>(null);\n const stepCountRef = useRef<number>(0);\n\n const minNumber = typeof min === 'number' ? min : undefined;\n const maxNumber = typeof max === 'number' ? max : undefined;\n const stepNumber = typeof step === 'number' ? step : defaultProps.step;\n const startValueNumber = typeof startValue === 'number' ? startValue : defaultProps.startValue;\n\n const minBigInt = toBigIntOrUndefined(min);\n const maxBigInt = toBigIntOrUndefined(max);\n const stepBigInt = toBigIntOrUndefined(step) ?? BigInt(1);\n const startValueBigInt = toBigIntOrUndefined(startValue) ?? BigInt(0);\n\n const parseBigIntOrString = (inputValue: string): bigint | string => {\n if (\n !isValidBigIntString(inputValue, allowNegativeResolved) ||\n (allowLeadingZerosResolved && leadingZerosPattern.test(inputValue))\n ) {\n return inputValue;\n }\n\n const parsed = parseBigIntFromString(inputValue);\n return parsed ?? inputValue;\n };\n\n const getBigIntFloatValue = (inputValue: bigint) => {\n const numericValue = Number(inputValue);\n return Number.isSafeInteger(numericValue) ? numericValue : undefined;\n };\n\n const handleValueChange: OnValueChange = (payload, event) => {\n if (event.source === 'event') {\n if (isBigIntMode) {\n setValue(parseBigIntOrString(payload.value));\n } else {\n setValue(\n isValidNumber(payload.floatValue, payload.value) &&\n !leadingDecimalZeroPattern.test(payload.value) &&\n !(allowLeadingZerosResolved ? leadingZerosPattern.test(payload.value) : false) &&\n !trailingZerosPattern.test(payload.value) &&\n !trailingDecimalSeparatorPattern.test(payload.value)\n ? payload.floatValue\n : payload.value\n );\n }\n }\n onValueChange?.(payload, event);\n };\n\n const getDecimalPlaces = (inputValue: number | string): number => {\n const match = String(inputValue).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\n if (!match) {\n return 0;\n }\n return Math.max(0, (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0));\n };\n\n const adjustCursor = (position?: number) => {\n if (inputRef.current && typeof position !== 'undefined') {\n inputRef.current.setSelectionRange(position, position);\n }\n };\n\n const incrementRef = useRef<() => void>(noop);\n incrementRef.current = () => {\n if (isBigIntMode) {\n if (!canStepBigInt(_value as bigint | string, allowNegativeResolved)) {\n return;\n }\n\n let val: bigint;\n const currentValue = _value;\n\n if (typeof currentValue === 'bigint') {\n const incrementedValue = currentValue + stepBigInt;\n if (maxBigInt !== undefined && incrementedValue > maxBigInt) {\n onMaxReached?.();\n }\n val =\n maxBigInt !== undefined && incrementedValue > maxBigInt ? maxBigInt : incrementedValue;\n } else if (typeof currentValue === 'string' && currentValue !== '') {\n const parsed = parseBigIntFromString(currentValue);\n if (parsed === null) {\n return;\n }\n\n const incrementedValue = parsed + stepBigInt;\n if (maxBigInt !== undefined && incrementedValue > maxBigInt) {\n onMaxReached?.();\n }\n val =\n maxBigInt !== undefined && incrementedValue > maxBigInt ? maxBigInt : incrementedValue;\n } else {\n val = clampBigInt(startValueBigInt, minBigInt, maxBigInt);\n }\n\n const formattedValue = val.toString();\n setValue(val);\n onValueChange?.(\n { floatValue: getBigIntFloatValue(val), formattedValue, value: formattedValue },\n { source: 'increment' as any }\n );\n setTimeout(() => adjustCursor(inputRef.current?.value.length), 0);\n return;\n }\n\n if (!canStep(_value as number | string)) {\n return;\n }\n\n let val: number;\n const currentValuePrecision = getDecimalPlaces(_value as number | string);\n const stepPrecision = getDecimalPlaces(stepNumber);\n const maxPrecision = Math.max(currentValuePrecision, stepPrecision);\n const factor = 10 ** maxPrecision;\n\n if (!isNumberString(_value) && (typeof _value !== 'number' || Number.isNaN(_value))) {\n val = clamp(startValueNumber, minNumber, maxNumber);\n } else if (maxNumber !== undefined) {\n const incrementedValue =\n (Math.round(Number(_value) * factor) + Math.round(stepNumber * factor)) / factor;\n if (incrementedValue > maxNumber) {\n onMaxReached?.();\n }\n val = incrementedValue <= maxNumber ? incrementedValue : maxNumber;\n } else {\n val = (Math.round(Number(_value) * factor) + Math.round(stepNumber * factor)) / factor;\n }\n\n const formattedValue = val.toFixed(maxPrecision);\n setValue(parseFloat(formattedValue));\n onValueChange?.(\n { floatValue: parseFloat(formattedValue), formattedValue, value: formattedValue },\n { source: 'increment' as any }\n );\n setTimeout(() => adjustCursor(inputRef.current?.value.length), 0);\n };\n\n const decrementRef = useRef<() => void>(noop);\n decrementRef.current = () => {\n if (isBigIntMode) {\n if (!canStepBigInt(_value as bigint | string, allowNegativeResolved)) {\n return;\n }\n\n let val: bigint;\n const minValue =\n minBigInt !== undefined ? minBigInt : !allowNegativeResolved ? BigInt(0) : undefined;\n const currentValue = _value;\n\n if (typeof currentValue === 'bigint') {\n const decrementedValue = currentValue - stepBigInt;\n if (minValue !== undefined && decrementedValue < minValue) {\n onMinReached?.();\n }\n val = minValue !== undefined && decrementedValue < minValue ? minValue : decrementedValue;\n } else if (typeof currentValue === 'string' && currentValue !== '') {\n const parsed = parseBigIntFromString(currentValue);\n if (parsed === null) {\n return;\n }\n\n const decrementedValue = parsed - stepBigInt;\n if (minValue !== undefined && decrementedValue < minValue) {\n onMinReached?.();\n }\n val = minValue !== undefined && decrementedValue < minValue ? minValue : decrementedValue;\n } else {\n val = clampBigInt(startValueBigInt, minValue, maxBigInt);\n }\n\n const formattedValue = val.toString();\n setValue(val);\n onValueChange?.(\n { floatValue: getBigIntFloatValue(val), formattedValue, value: formattedValue },\n { source: 'decrement' as any }\n );\n setTimeout(() => adjustCursor(inputRef.current?.value.length), 0);\n return;\n }\n\n if (!canStep(_value as number | string)) {\n return;\n }\n\n let val: number;\n const minValue =\n minNumber !== undefined ? minNumber : !allowNegativeResolved ? 0 : Number.MIN_SAFE_INTEGER;\n const currentValuePrecision = getDecimalPlaces(_value as number | string);\n const stepPrecision = getDecimalPlaces(stepNumber);\n const maxPrecision = Math.max(currentValuePrecision, stepPrecision);\n const factor = 10 ** maxPrecision;\n\n if ((!isNumberString(_value) && typeof _value !== 'number') || Number.isNaN(_value)) {\n val = clamp(startValueNumber, minValue, maxNumber);\n } else {\n const decrementedValue =\n (Math.round(Number(_value) * factor) - Math.round(stepNumber * factor)) / factor;\n if (minValue !== undefined && decrementedValue < minValue) {\n onMinReached?.();\n }\n val = minValue !== undefined && decrementedValue < minValue ? minValue : decrementedValue;\n }\n\n const formattedValue = val.toFixed(maxPrecision);\n setValue(parseFloat(formattedValue));\n onValueChange?.(\n { floatValue: parseFloat(formattedValue), formattedValue, value: formattedValue },\n { source: 'decrement' as any }\n );\n setTimeout(() => adjustCursor(inputRef.current?.value.length), 0);\n };\n\n const handlePaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\n const pastedText = event.clipboardData.getData('text');\n const _decimalSeparator = others.decimalSeparator || '.';\n const separatorsToReplace = (allowedDecimalSeparators || ['.', ',']).filter(\n (s) => s !== _decimalSeparator\n );\n\n if (separatorsToReplace.some((s) => pastedText.includes(s))) {\n event.preventDefault();\n let modifiedText = pastedText;\n separatorsToReplace.forEach((s) => {\n modifiedText = modifiedText.split(s).join(_decimalSeparator);\n });\n\n const input = inputRef.current;\n if (input) {\n const start = input.selectionStart ?? 0;\n const end = input.selectionEnd ?? 0;\n const currentValue = input.value;\n const newValue =\n currentValue.substring(0, start) + modifiedText + currentValue.substring(end);\n\n const nativeInputValueSetter = Object.getOwnPropertyDescriptor(\n window.HTMLInputElement.prototype,\n 'value'\n )?.set;\n nativeInputValueSetter?.call(input, newValue);\n input.dispatchEvent(new Event('change', { bubbles: true }));\n\n const cursorPos = start + modifiedText.length;\n setTimeout(() => adjustCursor(cursorPos), 0);\n }\n }\n\n others.onPaste?.(event as any);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n\n if (readOnly || !withKeyboardEvents) {\n return;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n incrementRef.current?.();\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n decrementRef.current?.();\n }\n };\n\n const handleKeyDownCapture = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDownCapture?.(event);\n if (event.key === 'Backspace') {\n const input = inputRef.current;\n if (input && input.selectionStart === 0 && input.selectionStart === input.selectionEnd) {\n event.preventDefault();\n window.setTimeout(() => adjustCursor(0), 0);\n }\n }\n };\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n if (selectAllOnFocus) {\n setTimeout(() => event.currentTarget.select(), 0);\n }\n onFocus?.(event);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n let sanitizedValue = _value;\n\n if (isBigIntMode) {\n if (clampBehavior === 'blur' && typeof sanitizedValue === 'bigint') {\n sanitizedValue = clampBigInt(sanitizedValue, minBigInt, maxBigInt);\n }\n\n if (trimLeadingZeroesOnBlur && typeof sanitizedValue === 'string') {\n sanitizedValue = clampAndSanitizeBigIntInput(sanitizedValue, {\n min: minBigInt,\n max: maxBigInt,\n clampBehavior,\n });\n }\n } else {\n if (clampBehavior === 'blur' && typeof sanitizedValue === 'number') {\n sanitizedValue = clamp(sanitizedValue, minNumber, maxNumber);\n }\n\n if (\n trimLeadingZeroesOnBlur &&\n typeof sanitizedValue === 'string' &&\n getDecimalPlaces(sanitizedValue) < 15\n ) {\n sanitizedValue = clampAndSanitizeInput(sanitizedValue, maxNumber, minNumber);\n }\n }\n\n if (_value !== sanitizedValue) {\n setValue(sanitizedValue);\n }\n\n onBlur?.(event);\n };\n\n assignRef(handlersRef, { increment: incrementRef.current, decrement: decrementRef.current });\n\n const onStepHandleChange = (isIncrement: boolean) => {\n if (isIncrement) {\n incrementRef.current?.();\n } else {\n decrementRef.current?.();\n }\n stepCountRef.current += 1;\n };\n\n const onStepLoop = (isIncrement: boolean) => {\n onStepHandleChange(isIncrement);\n\n if (shouldUseStepInterval) {\n const interval =\n typeof stepHoldInterval === 'number'\n ? stepHoldInterval\n : stepHoldInterval(stepCountRef.current);\n onStepTimeoutRef.current = window.setTimeout(() => onStepLoop(isIncrement), interval);\n }\n };\n\n const onStep = (\n event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n isIncrement: boolean\n ) => {\n event.preventDefault();\n inputRef.current?.focus();\n onStepHandleChange(isIncrement);\n if (shouldUseStepInterval) {\n onStepTimeoutRef.current = window.setTimeout(() => onStepLoop(isIncrement), stepHoldDelay);\n }\n };\n\n const onStepDone = () => {\n if (onStepTimeoutRef.current) {\n window.clearTimeout(onStepTimeoutRef.current);\n }\n onStepTimeoutRef.current = null;\n stepCountRef.current = 0;\n };\n\n const controls = (\n <div {...getStyles('controls')}>\n <UnstyledButton\n {...getStyles('control')}\n tabIndex={-1}\n aria-hidden\n disabled={\n disabled ||\n (typeof _value === 'number' && maxNumber !== undefined && _value >= maxNumber) ||\n (typeof _value === 'bigint' && maxBigInt !== undefined && _value >= maxBigInt)\n }\n mod={{ direction: 'up' }}\n onMouseDown={(event) => event.preventDefault()}\n onPointerDown={(event) => {\n onStep(event, true);\n }}\n onPointerUp={onStepDone}\n onPointerLeave={onStepDone}\n >\n <NumberInputChevron direction=\"up\" />\n </UnstyledButton>\n <UnstyledButton\n {...getStyles('control')}\n tabIndex={-1}\n aria-hidden\n disabled={\n disabled ||\n (typeof _value === 'number' && minNumber !== undefined && _value <= minNumber) ||\n (typeof _value === 'bigint' && minBigInt !== undefined && _value <= minBigInt)\n }\n mod={{ direction: 'down' }}\n onMouseDown={(event) => event.preventDefault()}\n onPointerDown={(event) => {\n onStep(event, false);\n }}\n onPointerUp={onStepDone}\n onPointerLeave={onStepDone}\n >\n <NumberInputChevron direction=\"down\" />\n </UnstyledButton>\n </div>\n );\n\n return (\n <InputBase\n component={NumericFormat}\n allowNegative={allowNegative}\n className={cx(classes.root, className)}\n size={size}\n {...others}\n inputMode={isBigIntMode ? 'numeric' : 'decimal'}\n readOnly={readOnly}\n disabled={disabled}\n value={typeof _value === 'bigint' ? _value.toString() : _value}\n getInputRef={useMergedRef(ref, inputRef)}\n onValueChange={handleValueChange}\n rightSection={\n hideControls ||\n readOnly ||\n !(isBigIntMode\n ? canStepBigInt(_value as bigint | string, allowNegativeResolved)\n : canStep(_value as number | string))\n ? rightSection\n : rightSection || controls\n }\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n __staticSelector=\"NumberInput\"\n decimalScale={isBigIntMode ? 0 : allowDecimal ? decimalScale : 0}\n onPaste={handlePaste}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n onKeyDownCapture={handleKeyDownCapture}\n rightSectionPointerEvents={rightSectionPointerEvents ?? (disabled ? 'none' : undefined)}\n rightSectionWidth={rightSectionWidth ?? `var(--ni-right-section-width-${size || 'sm'})`}\n allowLeadingZeros={allowLeadingZeros}\n allowedDecimalSeparators={allowedDecimalSeparators}\n onBlur={handleBlur}\n attributes={attributes}\n isAllowed={(val) => {\n const userAllowed = isAllowed ? isAllowed(val) : true;\n if (!userAllowed) {\n return false;\n }\n\n if (clampBehavior !== 'strict') {\n return true;\n }\n\n if (!isBigIntMode) {\n return isInRange(val.floatValue, minNumber, maxNumber);\n }\n\n if (val.value === '' || val.value === '-') {\n return true;\n }\n\n const parsed = parseBigIntFromString(val.value);\n\n if (parsed === null) {\n return true;\n }\n\n return (\n (minBigInt === undefined || parsed >= minBigInt) &&\n (maxBigInt === undefined || parsed <= maxBigInt)\n );\n }}\n />\n );\n }\n);\n\nNumberInput.classes = { ...InputBase.classes, ...classes };\nNumberInput.varsResolver = varsResolver;\nNumberInput.displayName = '@mantine/core/NumberInput';\n\nexport namespace NumberInput {\n export type Props<T extends NumberInputNumericType = number> = NumberInputProps<T>;\n export type StylesNames = NumberInputStylesNames;\n export type Factory = NumberInputFactory;\n export type CssVariables = NumberInputCssVariables;\n export type Handlers = NumberInputHandlers;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,4BAA4B;AAGlC,MAAM,sBAAsB;AAG5B,MAAM,uBAAuB;AAG7B,MAAM,kCAAkC;AAaxC,SAAS,eAAe,OAAgB;AACtC,QAAO,OAAO,UAAU,YAAY,UAAU,MAAM,CAAC,OAAO,MAAM,OAAO,MAAM,CAAC;;AAGlF,SAAS,cAAc,OAAiC;AACtD,QAAO,OAAO,UAAU;;AAG1B,SAAS,QAAQ,OAAwB;AACvC,KAAI,OAAO,UAAU,SACnB,QAAO,QAAQ,OAAO;AAGxB,QAAO,UAAU,MAAO,eAAe,MAAM,IAAI,OAAO,MAAM,GAAG,OAAO;;AAG1E,SAAS,oBAAoB,OAAe,eAAwB;AAClE,KAAI,UAAU,GACZ,QAAO;AAGT,KAAI,UAAU,IACZ,QAAO;AAGT,KAAI,CAAC,iBAAiB,MAAM,WAAW,IAAI,CACzC,QAAO;AAGT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@
1
- {"version":3,"file":"OverflowList.cjs","names":["createVarsResolver","getSpacing","genericFactory","useProps","useStyles","useDimensions","getRowPositionsData","Box","Fragment","classes"],"sources":["../../../src/components/OverflowList/OverflowList.tsx"],"sourcesContent":["// Originally based on https://github.com/Eliav2/react-responsive-overflow-list (MIT License)\n// Contains the modified version adapted for Mantine\nimport { cloneElement, Ref, useRef, useState } from 'react';\nimport { Fragment } from 'react/jsx-runtime';\nimport { useIsomorphicEffect, useMergedRef } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n Factory,\n genericFactory,\n getSpacing,\n MantineSpacing,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { getRowPositionsData } from './get-row-position-data';\nimport { useDimensions } from './use-dimensions';\nimport classes from './OverflowList.module.css';\n\nexport type OverflowListStylesNames = 'root';\nexport type OverflowListCssVariables = {\n root: '--ol-gap';\n};\n\nexport interface OverflowListProps<T = any>\n extends BoxProps, StylesApiProps<OverflowListFactory>, ElementProps<'div', 'children'> {\n /** Array of items to display */\n data: T[];\n\n /** Function to render item */\n renderItem: (item: T, index: number) => React.ReactNode;\n\n /** Function to render hidden items */\n renderOverflow: (items: T[]) => React.ReactNode;\n\n /** Number of rows to display @default 1 */\n maxRows?: number;\n\n /** Maximum number of visible items @default Infinity */\n maxVisibleItems?: number;\n\n /** Key of `theme.spacing` or any valid CSS value for `gap`, numbers are converted to rem @default 'xs' */\n gap?: MantineSpacing;\n\n ref?: Ref<HTMLDivElement>;\n}\n\nexport type OverflowListFactory = Factory<{\n props: OverflowListProps<any>;\n ref: HTMLDivElement;\n stylesNames: OverflowListStylesNames;\n vars: OverflowListCssVariables;\n signature: <T = any>(props: OverflowListProps<T>) => React.JSX.Element;\n}>;\n\nconst defaultProps = {\n maxRows: 1,\n maxVisibleItems: Infinity,\n} satisfies Partial<OverflowListProps<any>>;\n\nconst varsResolver = createVarsResolver<OverflowListFactory>((_, { gap }) => ({\n root: {\n '--ol-gap': getSpacing(gap),\n },\n}));\n\nexport const OverflowList = genericFactory<OverflowListFactory>((_props) => {\n const props = useProps('OverflowList', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n attributes,\n data,\n renderOverflow,\n renderItem,\n maxRows,\n maxVisibleItems,\n ref,\n ...others\n } = props;\n\n const getStyles = useStyles<OverflowListFactory>({\n name: 'OverflowList',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const [visibleCount, setVisibleCount] = useState(data.length);\n const [subtractCount, setSubtractCount] = useState(0);\n const [phase, setPhase] = useState<'normal' | 'measuring' | 'measuring-overflow-indicator'>(\n 'normal'\n );\n\n const containerRef = useRef<HTMLElement>(null);\n const rootRef = useMergedRef(containerRef, ref);\n const finalVisibleCount = visibleCount - subtractCount;\n const overflowCount = data.length - finalVisibleCount;\n const showOverflow = overflowCount > 0 && phase !== 'measuring';\n const overflowElement = showOverflow ? renderOverflow?.(data.slice(finalVisibleCount)) : null;\n\n const _overflowRef = useRef<HTMLElement>(null);\n const overflowRef = useMergedRef(_overflowRef, (overflowElement as any)?.ref);\n const dimensions = useDimensions(containerRef);\n\n useIsomorphicEffect(() => {\n setPhase('measuring');\n setVisibleCount(data.length);\n setSubtractCount(0);\n }, [data.length, maxRows]);\n\n useIsomorphicEffect(() => {\n if (phase === 'measuring') {\n countVisibleItems();\n setPhase('measuring-overflow-indicator');\n }\n }, [phase]);\n\n useIsomorphicEffect(() => {\n if (phase === 'measuring-overflow-indicator') {\n const updateWasNeeded = updateOverflowIndicator();\n if (!updateWasNeeded) {\n setPhase('normal');\n }\n }\n }, [phase, subtractCount]);\n\n useIsomorphicEffect(() => {\n if (phase === 'normal') {\n setPhase('measuring');\n setSubtractCount(0);\n }\n }, [dimensions]);\n\n const countVisibleItems = () => {\n const rowData = getRowPositionsData(containerRef, _overflowRef);\n if (!rowData) {\n return;\n }\n\n if (data.length === 1) {\n const itemRef = rowData.itemsSizesMap[rowData.rowPositions[0]].elements.values().next().value;\n const containerWidth = containerRef.current?.getBoundingClientRect().width ?? 0;\n const itemWidth = itemRef?.getBoundingClientRect().width ?? 0;\n\n if (itemWidth > containerWidth) {\n setVisibleCount(0);\n } else {\n setVisibleCount(1);\n }\n\n return;\n }\n\n const visibleRowPositions = rowData.rowPositions.slice(0, maxRows);\n\n let fittingCount = visibleRowPositions.reduce((acc, position) => {\n return acc + rowData.itemsSizesMap[position].elements.size;\n }, 0);\n\n fittingCount = Math.min(fittingCount, maxVisibleItems);\n setVisibleCount(fittingCount);\n };\n\n const updateOverflowIndicator = () => {\n if (!_overflowRef.current) {\n return false;\n }\n const rowData = getRowPositionsData(containerRef, _overflowRef);\n if (!rowData) {\n return false;\n }\n\n const { rowPositions, itemsSizesMap } = rowData;\n\n const overflowRect = _overflowRef.current.getBoundingClientRect();\n const overflowMiddleY = overflowRect.top + overflowRect.height / 2;\n const lastRowTop = rowPositions[rowPositions.length - 1];\n const lastRow = itemsSizesMap[lastRowTop];\n\n if (overflowMiddleY > lastRow.bottom) {\n setSubtractCount((c) => c + 1);\n return true;\n }\n\n return false;\n };\n\n const clonedOverflowElement = overflowElement\n ? cloneElement(overflowElement as React.ReactElement<any>, { ref: overflowRef })\n : null;\n\n let finalItems = data;\n if (maxVisibleItems) {\n finalItems = finalItems.slice(0, maxVisibleItems);\n }\n\n return (\n <Box ref={rootRef} {...getStyles('root')} {...others}>\n {finalItems.map((item, index) => {\n const isVisible = phase === 'measuring' || index < finalVisibleCount;\n if (!isVisible) {\n return null;\n }\n const itemComponent = renderItem(item, index);\n\n return <Fragment key={index}>{itemComponent}</Fragment>;\n })}\n\n {clonedOverflowElement}\n </Box>\n );\n});\n\nOverflowList.displayName = '@mantine/core/OverflowList';\nOverflowList.classes = classes;\nOverflowList.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;AA0DA,MAAM,eAAe;CACnB,SAAS;CACT,iBAAiB;CAClB;AAED,MAAM,eA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AACjB,KAAI,gBACF,cAAa,WAAW,MAAM,GAAG,gBAAgB;AAGnD,QACE,iBAAA,GAAA,kBAAA,MAACC,YAAAA,KAAD;EAAK,KAAK;EAAS,GAAI,UAAU,OAAO;EAAE,GAAI;YAA9C,CACG,WAAW,KAAK,MAAM,UAAU;AAE/B,OAAI,EADc,UAAU,eAAe,QAAQ,mBAEjD,QAAO;AAIT,UAAO,iBAAA,GAAA,kBAAA,KAACC,kBAAAA,UAAD,EAAA,UAFe,WAAW,MAAM,MAAM,EAEU,EAAjC,MAAiC;IACvD,EAED,sBACG;;EAER;AAEF,aAAa,cAAc;AAC3B,aAAa,UAAUC,4BAAAA;AACvB,aAAa,eAAe"}
1
+ {"version":3,"file":"OverflowList.cjs","names":["createVarsResolver","getSpacing","genericFactory","useProps","useStyles","useDimensions","getRowPositionsData","Box","Fragment","classes"],"sources":["../../../src/components/OverflowList/OverflowList.tsx"],"sourcesContent":["// Originally based on https://github.com/Eliav2/react-responsive-overflow-list (MIT License)\n// Contains the modified version adapted for Mantine\nimport { cloneElement, Ref, useRef, useState } from 'react';\nimport { Fragment } from 'react/jsx-runtime';\nimport { useIsomorphicEffect, useMergedRef } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n Factory,\n genericFactory,\n getSpacing,\n MantineSpacing,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { getRowPositionsData } from './get-row-position-data';\nimport { useDimensions } from './use-dimensions';\nimport classes from './OverflowList.module.css';\n\nexport type OverflowListStylesNames = 'root';\nexport type OverflowListCssVariables = {\n root: '--ol-gap';\n};\n\nexport interface OverflowListProps<T = any>\n extends BoxProps, StylesApiProps<OverflowListFactory>, ElementProps<'div', 'children'> {\n /** Array of items to display */\n data: T[];\n\n /** Function to render item */\n renderItem: (item: T, index: number) => React.ReactNode;\n\n /** Function to render hidden items */\n renderOverflow: (items: T[]) => React.ReactNode;\n\n /** Number of rows to display @default 1 */\n maxRows?: number;\n\n /** Maximum number of visible items @default Infinity */\n maxVisibleItems?: number;\n\n /** Key of `theme.spacing` or any valid CSS value for `gap`, numbers are converted to rem @default 'xs' */\n gap?: MantineSpacing;\n\n ref?: Ref<HTMLDivElement>;\n}\n\nexport type OverflowListFactory = Factory<{\n props: OverflowListProps<any>;\n ref: HTMLDivElement;\n stylesNames: OverflowListStylesNames;\n vars: OverflowListCssVariables;\n signature: <T = any>(props: OverflowListProps<T>) => React.JSX.Element;\n}>;\n\nconst defaultProps = {\n maxRows: 1,\n maxVisibleItems: Infinity,\n} satisfies Partial<OverflowListProps<any>>;\n\nconst varsResolver = createVarsResolver<OverflowListFactory>((_, { gap }) => ({\n root: {\n '--ol-gap': getSpacing(gap),\n },\n}));\n\nexport const OverflowList = genericFactory<OverflowListFactory>((_props) => {\n const props = useProps('OverflowList', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n attributes,\n data,\n renderOverflow,\n renderItem,\n maxRows,\n maxVisibleItems,\n ref,\n ...others\n } = props;\n\n const getStyles = useStyles<OverflowListFactory>({\n name: 'OverflowList',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const [visibleCount, setVisibleCount] = useState(data.length);\n const [subtractCount, setSubtractCount] = useState(0);\n const [phase, setPhase] = useState<'normal' | 'measuring' | 'measuring-overflow-indicator'>(\n 'normal'\n );\n\n const containerRef = useRef<HTMLElement>(null);\n const rootRef = useMergedRef(containerRef, ref);\n const finalVisibleCount = visibleCount - subtractCount;\n const overflowCount = data.length - finalVisibleCount;\n const showOverflow = overflowCount > 0 && phase !== 'measuring';\n const overflowElement = showOverflow ? renderOverflow?.(data.slice(finalVisibleCount)) : null;\n\n const _overflowRef = useRef<HTMLElement>(null);\n const overflowRef = useMergedRef(_overflowRef, (overflowElement as any)?.ref);\n const dimensions = useDimensions(containerRef);\n\n useIsomorphicEffect(() => {\n setPhase('measuring');\n setVisibleCount(data.length);\n setSubtractCount(0);\n }, [data.length, maxRows]);\n\n useIsomorphicEffect(() => {\n if (phase === 'measuring') {\n countVisibleItems();\n setPhase('measuring-overflow-indicator');\n }\n }, [phase]);\n\n useIsomorphicEffect(() => {\n if (phase === 'measuring-overflow-indicator') {\n const updateWasNeeded = updateOverflowIndicator();\n if (!updateWasNeeded) {\n setPhase('normal');\n }\n }\n }, [phase, subtractCount]);\n\n useIsomorphicEffect(() => {\n if (phase === 'normal') {\n setPhase('measuring');\n setSubtractCount(0);\n }\n }, [dimensions]);\n\n const countVisibleItems = () => {\n const rowData = getRowPositionsData(containerRef, _overflowRef);\n if (!rowData) {\n return;\n }\n\n if (data.length === 1) {\n const itemRef = rowData.itemsSizesMap[rowData.rowPositions[0]].elements.values().next().value;\n const containerWidth = containerRef.current?.getBoundingClientRect().width ?? 0;\n const itemWidth = itemRef?.getBoundingClientRect().width ?? 0;\n\n if (itemWidth > containerWidth) {\n setVisibleCount(0);\n } else {\n setVisibleCount(1);\n }\n\n return;\n }\n\n const visibleRowPositions = rowData.rowPositions.slice(0, maxRows);\n\n let fittingCount = visibleRowPositions.reduce((acc, position) => {\n return acc + rowData.itemsSizesMap[position].elements.size;\n }, 0);\n\n fittingCount = Math.min(fittingCount, maxVisibleItems);\n setVisibleCount(fittingCount);\n };\n\n const updateOverflowIndicator = () => {\n if (!_overflowRef.current) {\n return false;\n }\n const rowData = getRowPositionsData(containerRef, _overflowRef);\n if (!rowData) {\n return false;\n }\n\n const { rowPositions, itemsSizesMap } = rowData;\n\n const overflowRect = _overflowRef.current.getBoundingClientRect();\n const overflowMiddleY = overflowRect.top + overflowRect.height / 2;\n const lastRowTop = rowPositions[rowPositions.length - 1];\n const lastRow = itemsSizesMap[lastRowTop];\n\n if (overflowMiddleY > lastRow.bottom) {\n setSubtractCount((c) => c + 1);\n return true;\n }\n\n return false;\n };\n\n const clonedOverflowElement = overflowElement\n ? cloneElement(overflowElement as React.ReactElement<any>, { ref: overflowRef })\n : null;\n\n let finalItems = data;\n if (maxVisibleItems) {\n finalItems = finalItems.slice(0, maxVisibleItems);\n }\n\n return (\n <Box ref={rootRef} {...getStyles('root')} {...others}>\n {finalItems.map((item, index) => {\n const isVisible = phase === 'measuring' || index < finalVisibleCount;\n if (!isVisible) {\n return null;\n }\n const itemComponent = renderItem(item, index);\n\n return <Fragment key={index}>{itemComponent}</Fragment>;\n })}\n\n {clonedOverflowElement}\n </Box>\n );\n});\n\nOverflowList.displayName = '@mantine/core/OverflowList';\nOverflowList.classes = classes;\nOverflowList.varsResolver = varsResolver;\n\nexport namespace OverflowList {\n export type Props = OverflowListProps;\n export type Factory = OverflowListFactory;\n export type StylesNames = OverflowListStylesNames;\n export type CssVariables = OverflowListCssVariables;\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0DA,MAAM,eAAe;CACnB,SAAS;CACT,iBAAiB;CAClB;AAED,MAAM,eAAeA,6BAAAA,oBAAyC,GAAG,EAAE,WAAW,EAC5E,MAAM,EACJ,YAAYC,iBAAAA,WAAW,IAAI,EAC5B,EACF,EAAE;AAEH,MAAa,eAAeC,gBAAAA,gBAAqC,WAAW;CAC1E,MAAM,QAAQC,kBAAAA,SAAS,gBAAgB,cAAc,OAAO;CAC5D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,YACA,MACA,gBACA,YACA,SACA,iBACA,KACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAA+B;EAC/C,MAAM;EACN,SAAA,4BAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,CAAC,cAAc,oBAAA,GAAA,MAAA,UAA4B,KAAK,OAAO;CAC7D,MAAM,CAAC,eAAe,qBAAA,GAAA,MAAA,UAA6B,EAAE;CACrD,MAAM,CAAC,OAAO,aAAA,GAAA,MAAA,UACZ,SACD;CAED,MAAM,gBAAA,GAAA,MAAA,QAAmC,KAAK;CAC9C,MAAM,WAAA,GAAA,eAAA,cAAuB,cAAc,IAAI;CAC/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c,UAAU,SAAS;KACrD,EAAE;AAEL,iBAAe,KAAK,IAAI,cAAc,gBAAgB;AACtD,kBAAgB,aAAa;;CAG/B,MAAM,gCAAgC;AACpC,MAAI,CAAC,aAAa,QAChB,QAAO;EAET,MAAM,UAAUA,8BAAAA,oBAAoB,cAAc,aAAa;AAC/D,MAAI,CAAC,QACH,QAAO;EAGT,MAAM,EAAE,cAAc,kBAAkB;EAExC,MAAM,eAAe,aAAa,QAAQ,uBAAuB;AAKjE,MAJwB,aAAa,MAAM,aAAa,SAAS,IAEjD,cADG,aAAa,aAAa,SAAS,IAGxB,QAAQ;AACpC,qBAAkB,MAAM,IAAI,EAAE;AAC9B,UAAO;;AAGT,SAAO;;CAGT,MAAM,wBAAwB,mBAAA,GAAA,MAAA,cACb,iBAA4C,EAAE,KAAK,aAAa,CAAC,GAC9E;CAEJ,IAAI,aAAa;AACjB,KAAI,gBACF,cAAa,WAAW,MAAM,GAAG,gBAAgB;AAGnD,QACE,iBAAA,GAAA,kBAAA,MAACC,YAAAA,KAAD;EAAK,KAAK;EAAS,GAAI,UAAU,OAAO;EAAE,GAAI;YAA9C,CACG,WAAW,KAAK,MAAM,UAAU;AAE/B,OAAI,EADc,UAAU,eAAe,QAAQ,mBAEjD,QAAO;AAIT,UAAO,iBAAA,GAAA,kBAAA,KAACC,kBAAAA,UAAD,EAAA,UAFe,WAAW,MAAM,MAAM,EAEU,EAAjC,MAAiC;IACvD,EAED,sBACG;;EAER;AAEF,aAAa,cAAc;AAC3B,aAAa,UAAUC,4BAAAA;AACvB,aAAa,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"Overlay.cjs","names":["getDefaultZIndex","createVarsResolver","rgba","rem","getRadius","polymorphicFactory","useProps","Box","useStyles","classes"],"sources":["../../../src/components/Overlay/Overlay.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n getDefaultZIndex,\n getRadius,\n MantineRadius,\n polymorphicFactory,\n PolymorphicFactory,\n rem,\n rgba,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Overlay.module.css';\n\nexport type OverlayStylesNames = 'root';\nexport type OverlayCssVariables = {\n root: '--overlay-bg' | '--overlay-filter' | '--overlay-radius' | '--overlay-z-index';\n};\n\nexport interface OverlayProps extends BoxProps, StylesApiProps<OverlayFactory> {\n /** Overlay `background-color` opacity 0–1, ignored when `gradient` prop is set @default 0.6 */\n backgroundOpacity?: number;\n\n /** Overlay `background-color` @default #000 */\n color?: React.CSSProperties['backgroundColor'];\n\n /** Overlay background blur in px (converted to rem). Applies `backdrop-filter: blur()`. Note: backdrop-filter is not supported in all browsers. @default 0 */\n blur?: number | string;\n\n /** Changes overlay to gradient. If set, both `color` and `backgroundOpacity` props are ignored. */\n gradient?: string;\n\n /** Overlay z-index @default 200 */\n zIndex?: string | number;\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius @default 0 */\n radius?: MantineRadius;\n\n /** Content inside overlay */\n children?: React.ReactNode;\n\n /** Centers content inside the overlay using flexbox (sets display: flex, align-items: center, justify-content: center) @default false */\n center?: boolean;\n\n /** Changes position from `absolute` to `fixed` (viewport-relative instead of parent-relative) @default false */\n fixed?: boolean;\n}\n\nexport type OverlayFactory = PolymorphicFactory<{\n props: OverlayProps;\n defaultRef: HTMLDivElement;\n defaultComponent: 'div';\n stylesNames: OverlayStylesNames;\n vars: OverlayCssVariables;\n}>;\n\nconst defaultProps = {\n zIndex: getDefaultZIndex('modal'),\n} satisfies Partial<OverlayProps>;\n\nconst varsResolver = createVarsResolver<OverlayFactory>(\n (_, { gradient, color, backgroundOpacity, blur, radius, zIndex }) => ({\n root: {\n '--overlay-bg':\n gradient ||\n ((color !== undefined || backgroundOpacity !== undefined) &&\n rgba(color || '#000', backgroundOpacity ?? 0.6)) ||\n undefined,\n '--overlay-filter': blur ? `blur(${rem(blur)})` : undefined,\n '--overlay-radius': radius === undefined ? undefined : getRadius(radius),\n '--overlay-z-index': zIndex?.toString(),\n },\n })\n);\n\nexport const Overlay = polymorphicFactory<OverlayFactory>((_props) => {\n const props = useProps('Overlay', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n fixed,\n center,\n children,\n radius,\n zIndex,\n gradient,\n blur,\n color,\n backgroundOpacity,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<OverlayFactory>({\n name: 'Overlay',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <Box {...getStyles('root')} mod={[{ center, fixed }, mod]} {...others}>\n {children}\n </Box>\n );\n});\n\nOverlay.classes = classes;\nOverlay.varsResolver = varsResolver;\nOverlay.displayName = '@mantine/core/Overlay';\n"],"mappings":";;;;;;;;;;;;;;AA2DA,MAAM,eAAe,EACnB,QAAQA,4BAAAA,iBAAiB,QAAQ,EAClC;AAED,MAAM,eAAeC,6BAAAA,oBAClB,GAAG,EAAE,UAAU,OAAO,mBAAmB,MAAM,QAAQ,cAAc,EACpE,MAAM;CACJ,gBACE,aACE,UAAU,KAAA,KAAa,sBAAsB,KAAA,MAC7CC,aAAAA,KAAK,SAAS,QAAQ,qBAAqB,GAAI,IACjD,KAAA;CACF,oBAAoB,OAAO,QAAQC,YAAAA,IAAI,KAAK,CAAC,KAAK,KAAA;CAClD,oBAAoB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO;CACxE,qBAAqB,QAAQ,UAAU;CACxC,EACF,EACF;AAED,MAAa,UAAUC,4BAAAA,oBAAoC,WAAW;CACpE,MAAM,QAAQC,kBAAAA,SAAS,WAAW,cAAc,OAAO;CACvD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,OACA,QACA,UACA,QACA,QACA,UACA,MACA,OACA,mBACA,KACA,YACA,GAAG,WACD;AAgBJ,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EAAK,GAfWC,mBAAAA,UAA0B;GAC1C,MAAM;GACN;GACA,SAAA,uBAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,CAGmB,OAAO;EAAE,KAAK,CAAC;GAAE;GAAQ;GAAO,EAAE,IAAI;EAAE,GAAI;EAC5D;EACG,CAAA;EAER;AAEF,QAAQ,UAAUC,uBAAAA;AAClB,QAAQ,eAAe;AACvB,QAAQ,cAAc"}
1
+ {"version":3,"file":"Overlay.cjs","names":["getDefaultZIndex","createVarsResolver","rgba","rem","getRadius","polymorphicFactory","useProps","Box","useStyles","classes"],"sources":["../../../src/components/Overlay/Overlay.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n getDefaultZIndex,\n getRadius,\n MantineRadius,\n polymorphicFactory,\n PolymorphicFactory,\n rem,\n rgba,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Overlay.module.css';\n\nexport type OverlayStylesNames = 'root';\nexport type OverlayCssVariables = {\n root: '--overlay-bg' | '--overlay-filter' | '--overlay-radius' | '--overlay-z-index';\n};\n\nexport interface OverlayProps extends BoxProps, StylesApiProps<OverlayFactory> {\n /** Overlay `background-color` opacity 0–1, ignored when `gradient` prop is set @default 0.6 */\n backgroundOpacity?: number;\n\n /** Overlay `background-color` @default #000 */\n color?: React.CSSProperties['backgroundColor'];\n\n /** Overlay background blur in px (converted to rem). Applies `backdrop-filter: blur()`. Note: backdrop-filter is not supported in all browsers. @default 0 */\n blur?: number | string;\n\n /** Changes overlay to gradient. If set, both `color` and `backgroundOpacity` props are ignored. */\n gradient?: string;\n\n /** Overlay z-index @default 200 */\n zIndex?: string | number;\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius @default 0 */\n radius?: MantineRadius;\n\n /** Content inside overlay */\n children?: React.ReactNode;\n\n /** Centers content inside the overlay using flexbox (sets display: flex, align-items: center, justify-content: center) @default false */\n center?: boolean;\n\n /** Changes position from `absolute` to `fixed` (viewport-relative instead of parent-relative) @default false */\n fixed?: boolean;\n}\n\nexport type OverlayFactory = PolymorphicFactory<{\n props: OverlayProps;\n defaultRef: HTMLDivElement;\n defaultComponent: 'div';\n stylesNames: OverlayStylesNames;\n vars: OverlayCssVariables;\n}>;\n\nconst defaultProps = {\n zIndex: getDefaultZIndex('modal'),\n} satisfies Partial<OverlayProps>;\n\nconst varsResolver = createVarsResolver<OverlayFactory>(\n (_, { gradient, color, backgroundOpacity, blur, radius, zIndex }) => ({\n root: {\n '--overlay-bg':\n gradient ||\n ((color !== undefined || backgroundOpacity !== undefined) &&\n rgba(color || '#000', backgroundOpacity ?? 0.6)) ||\n undefined,\n '--overlay-filter': blur ? `blur(${rem(blur)})` : undefined,\n '--overlay-radius': radius === undefined ? undefined : getRadius(radius),\n '--overlay-z-index': zIndex?.toString(),\n },\n })\n);\n\nexport const Overlay = polymorphicFactory<OverlayFactory>((_props) => {\n const props = useProps('Overlay', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n fixed,\n center,\n children,\n radius,\n zIndex,\n gradient,\n blur,\n color,\n backgroundOpacity,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<OverlayFactory>({\n name: 'Overlay',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <Box {...getStyles('root')} mod={[{ center, fixed }, mod]} {...others}>\n {children}\n </Box>\n );\n});\n\nOverlay.classes = classes;\nOverlay.varsResolver = varsResolver;\nOverlay.displayName = '@mantine/core/Overlay';\n\nexport namespace Overlay {\n export type Props = OverlayProps;\n export type StylesNames = OverlayStylesNames;\n export type Factory = OverlayFactory;\n export type CssVariables = OverlayCssVariables;\n}\n"],"mappings":";;;;;;;;;;;;;;AA2DA,MAAM,eAAe,EACnB,QAAQA,4BAAAA,iBAAiB,QAAQ,EAClC;AAED,MAAM,eAAeC,6BAAAA,oBAClB,GAAG,EAAE,UAAU,OAAO,mBAAmB,MAAM,QAAQ,cAAc,EACpE,MAAM;CACJ,gBACE,aACE,UAAU,KAAA,KAAa,sBAAsB,KAAA,MAC7CC,aAAAA,KAAK,SAAS,QAAQ,qBAAqB,GAAI,IACjD,KAAA;CACF,oBAAoB,OAAO,QAAQC,YAAAA,IAAI,KAAK,CAAC,KAAK,KAAA;CAClD,oBAAoB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO;CACxE,qBAAqB,QAAQ,UAAU;CACxC,EACF,EACF;AAED,MAAa,UAAUC,4BAAAA,oBAAoC,WAAW;CACpE,MAAM,QAAQC,kBAAAA,SAAS,WAAW,cAAc,OAAO;CACvD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,OACA,QACA,UACA,QACA,QACA,UACA,MACA,OACA,mBACA,KACA,YACA,GAAG,WACD;AAgBJ,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EAAK,GAfWC,mBAAAA,UAA0B;GAC1C,MAAM;GACN;GACA,SAAA,uBAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,CAGmB,OAAO;EAAE,KAAK,CAAC;GAAE;GAAQ;GAAO,EAAE,IAAI;EAAE,GAAI;EAC5D;EACG,CAAA;EAER;AAEF,QAAQ,UAAUC,uBAAAA;AAClB,QAAQ,eAAe;AACvB,QAAQ,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.cjs","names":["factory","useProps","PaginationRoot","Group","PaginationFirst","PaginationPrevious","PaginationItems","PaginationNext","PaginationLast","classes","PaginationControl","PaginationDots"],"sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import { factory, Factory, MantineSpacing, useProps } from '../../core';\nimport { Group } from '../Group/Group';\nimport { PaginationIcon } from './Pagination.icons';\nimport { PaginationControl } from './PaginationControl/PaginationControl';\nimport { PaginationDots } from './PaginationDots/PaginationDots';\nimport {\n PaginationFirst,\n PaginationLast,\n PaginationNext,\n PaginationPrevious,\n} from './PaginationEdges/PaginationEdges';\nimport { PaginationItems } from './PaginationItems/PaginationItems';\nimport {\n PaginationRoot,\n PaginationRootCssVariables,\n PaginationRootProps,\n PaginationRootStylesNames,\n} from './PaginationRoot/PaginationRoot';\nimport classes from './Pagination.module.css';\n\nexport type PaginationStylesNames = PaginationRootStylesNames;\nexport type PaginationCssVariables = PaginationRootCssVariables;\n\nexport interface PaginationProps extends PaginationRootProps {\n /** If set, first/last controls are displayed @default false */\n withEdges?: boolean;\n\n /** If set, next/previous controls are displayed @default true */\n withControls?: boolean;\n\n /** Props passed down to next/previous/first/last controls */\n getControlProps?: (control: 'first' | 'previous' | 'last' | 'next') => Record<string, any>;\n\n /** Next control icon component */\n nextIcon?: PaginationIcon;\n\n /** Previous control icon component */\n previousIcon?: PaginationIcon;\n\n /** Last control icon component */\n lastIcon?: PaginationIcon;\n\n /** First control icon component */\n firstIcon?: PaginationIcon;\n\n /** Dots icon component */\n dotsIcon?: PaginationIcon;\n\n /** Key of `theme.spacing`, gap between controls @default 8 */\n gap?: MantineSpacing;\n\n /** If set, the pagination is hidden when only one page is available (`total={1}`) @default false */\n hideWithOnePage?: boolean;\n\n /** If set to `false`, page number buttons are hidden, only next/previous controls remain @default `true` */\n withPages?: boolean;\n}\n\nexport type PaginationFactory = Factory<{\n props: PaginationProps;\n ref: HTMLDivElement;\n stylesNames: PaginationStylesNames;\n vars: PaginationCssVariables;\n staticComponents: {\n Root: typeof PaginationRoot;\n Control: typeof PaginationControl;\n Dots: typeof PaginationDots;\n First: typeof PaginationFirst;\n Last: typeof PaginationLast;\n Next: typeof PaginationNext;\n Previous: typeof PaginationPrevious;\n Items: typeof PaginationItems;\n };\n}>;\n\nconst defaultProps = {\n withControls: true,\n withPages: true,\n siblings: 1,\n boundaries: 1,\n gap: 8,\n} satisfies Partial<PaginationProps>;\n\nexport const Pagination = factory<PaginationFactory>((_props) => {\n const props = useProps('Pagination', defaultProps, _props);\n const {\n withEdges,\n withControls,\n getControlProps,\n nextIcon,\n previousIcon,\n lastIcon,\n firstIcon,\n dotsIcon,\n total,\n gap,\n hideWithOnePage,\n withPages,\n ...others\n } = props;\n\n if (total <= 0 || (hideWithOnePage && total === 1)) {\n return null;\n }\n\n return (\n <PaginationRoot total={total} {...others}>\n <Group gap={gap}>\n {withEdges && <PaginationFirst icon={firstIcon} {...getControlProps?.('first')} />}\n {withControls && (\n <PaginationPrevious icon={previousIcon} {...getControlProps?.('previous')} />\n )}\n {withPages && <PaginationItems dotsIcon={dotsIcon} />}\n {withControls && <PaginationNext icon={nextIcon} {...getControlProps?.('next')} />}\n {withEdges && <PaginationLast icon={lastIcon} {...getControlProps?.('last')} />}\n </Group>\n </PaginationRoot>\n );\n});\n\nPagination.classes = classes;\nPagination.displayName = '@mantine/core/Pagination';\nPagination.Root = PaginationRoot;\nPagination.Control = PaginationControl;\nPagination.Dots = PaginationDots;\nPagination.First = PaginationFirst;\nPagination.Last = PaginationLast;\nPagination.Next = PaginationNext;\nPagination.Previous = PaginationPrevious;\nPagination.Items = PaginationItems;\n"],"mappings":";;;;;;;;;;;;;AA2EA,MAAM,eAAe;CACnB,cAAc;CACd,WAAW;CACX,UAAU;CACV,YAAY;CACZ,KAAK;CACN;AAED,MAAa,aAAaA,gBAAAA,SAA4B,WAAW;CAE/D,MAAM,EACJ,WACA,cACA,iBACA,UACA,cACA,UACA,WACA,UACA,OACA,KACA,iBACA,WACA,GAAG,WAdSC,kBAAAA,SAAS,cAAc,cAAc,OAAO;AAiB1D,KAAI,SAAS,KAAM,mBAAmB,UAAU,EAC9C,QAAO;AAGT,QACE,iBAAA,GAAA,kBAAA,KAACC,uBAAAA,gBAAD;EAAuB;EAAO,GAAI;YAChC,iBAAA,GAAA,kBAAA,MAACC,cAAAA,OAAD;GAAY;aAAZ;IACG,aAAa,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,iBAAD;KAAiB,MAAM;KAAW,GAAI,kBAAkB,QAAQ;KAAI,CAAA;IACjF,gBACC,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,oBAAD;KAAoB,MAAM;KAAc,GAAI,kBAAkB,WAAW;KAAI,CAAA;IAE9E,aAAa,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,iBAAD,EAA2B,UAAY,CAAA;IACpD,gBAAgB,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,gBAAD;KAAgB,MAAM;KAAU,GAAI,kBAAkB,OAAO;KAAI,CAAA;IACjF,aAAa,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,gBAAD;KAAgB,MAAM;KAAU,GAAI,kBAAkB,OAAO;KAAI,CAAA;IACzE;;EACO,CAAA;EAEnB;AAEF,WAAW,UAAUC,0BAAAA;AACrB,WAAW,cAAc;AACzB,WAAW,OAAOP,uBAAAA;AAClB,WAAW,UAAUQ,0BAAAA;AACrB,WAAW,OAAOC,uBAAAA;AAClB,WAAW,QAAQP,wBAAAA;AACnB,WAAW,OAAOI,wBAAAA;AAClB,WAAW,OAAOD,wBAAAA;AAClB,WAAW,WAAWF,wBAAAA;AACtB,WAAW,QAAQC,wBAAAA"}
1
+ {"version":3,"file":"Pagination.cjs","names":["factory","useProps","PaginationRoot","Group","PaginationFirst","PaginationPrevious","PaginationItems","PaginationNext","PaginationLast","classes","PaginationControl","PaginationDots"],"sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import { factory, Factory, MantineSpacing, useProps } from '../../core';\nimport { Group } from '../Group/Group';\nimport { PaginationIcon } from './Pagination.icons';\nimport {\n PaginationControl,\n type PaginationControlProps,\n} from './PaginationControl/PaginationControl';\nimport { PaginationDots, type PaginationDotsProps } from './PaginationDots/PaginationDots';\nimport {\n PaginationFirst,\n PaginationLast,\n PaginationNext,\n PaginationPrevious,\n type PaginationEdgeProps,\n} from './PaginationEdges/PaginationEdges';\nimport { PaginationItems, type PaginationItemsProps } from './PaginationItems/PaginationItems';\nimport {\n PaginationRoot,\n PaginationRootCssVariables,\n PaginationRootProps,\n PaginationRootStylesNames,\n} from './PaginationRoot/PaginationRoot';\nimport classes from './Pagination.module.css';\nexport type PaginationStylesNames = PaginationRootStylesNames;\nexport type PaginationCssVariables = PaginationRootCssVariables;\n\nexport interface PaginationProps extends PaginationRootProps {\n /** If set, first/last controls are displayed @default false */\n withEdges?: boolean;\n\n /** If set, next/previous controls are displayed @default true */\n withControls?: boolean;\n\n /** Props passed down to next/previous/first/last controls */\n getControlProps?: (control: 'first' | 'previous' | 'last' | 'next') => Record<string, any>;\n\n /** Next control icon component */\n nextIcon?: PaginationIcon;\n\n /** Previous control icon component */\n previousIcon?: PaginationIcon;\n\n /** Last control icon component */\n lastIcon?: PaginationIcon;\n\n /** First control icon component */\n firstIcon?: PaginationIcon;\n\n /** Dots icon component */\n dotsIcon?: PaginationIcon;\n\n /** Key of `theme.spacing`, gap between controls @default 8 */\n gap?: MantineSpacing;\n\n /** If set, the pagination is hidden when only one page is available (`total={1}`) @default false */\n hideWithOnePage?: boolean;\n\n /** If set to `false`, page number buttons are hidden, only next/previous controls remain @default `true` */\n withPages?: boolean;\n}\n\nexport type PaginationFactory = Factory<{\n props: PaginationProps;\n ref: HTMLDivElement;\n stylesNames: PaginationStylesNames;\n vars: PaginationCssVariables;\n staticComponents: {\n Root: typeof PaginationRoot;\n Control: typeof PaginationControl;\n Dots: typeof PaginationDots;\n First: typeof PaginationFirst;\n Last: typeof PaginationLast;\n Next: typeof PaginationNext;\n Previous: typeof PaginationPrevious;\n Items: typeof PaginationItems;\n };\n}>;\n\nconst defaultProps = {\n withControls: true,\n withPages: true,\n siblings: 1,\n boundaries: 1,\n gap: 8,\n} satisfies Partial<PaginationProps>;\n\nexport const Pagination = factory<PaginationFactory>((_props) => {\n const props = useProps('Pagination', defaultProps, _props);\n const {\n withEdges,\n withControls,\n getControlProps,\n nextIcon,\n previousIcon,\n lastIcon,\n firstIcon,\n dotsIcon,\n total,\n gap,\n hideWithOnePage,\n withPages,\n ...others\n } = props;\n\n if (total <= 0 || (hideWithOnePage && total === 1)) {\n return null;\n }\n\n return (\n <PaginationRoot total={total} {...others}>\n <Group gap={gap}>\n {withEdges && <PaginationFirst icon={firstIcon} {...getControlProps?.('first')} />}\n {withControls && (\n <PaginationPrevious icon={previousIcon} {...getControlProps?.('previous')} />\n )}\n {withPages && <PaginationItems dotsIcon={dotsIcon} />}\n {withControls && <PaginationNext icon={nextIcon} {...getControlProps?.('next')} />}\n {withEdges && <PaginationLast icon={lastIcon} {...getControlProps?.('last')} />}\n </Group>\n </PaginationRoot>\n );\n});\n\nPagination.classes = classes;\nPagination.displayName = '@mantine/core/Pagination';\nPagination.Root = PaginationRoot;\nPagination.Control = PaginationControl;\nPagination.Dots = PaginationDots;\nPagination.First = PaginationFirst;\nPagination.Last = PaginationLast;\nPagination.Next = PaginationNext;\nPagination.Previous = PaginationPrevious;\nPagination.Items = PaginationItems;\n\nexport namespace Pagination {\n export type Props = PaginationProps;\n export type StylesNames = PaginationStylesNames;\n export type CssVariables = PaginationCssVariables;\n export type Factory = PaginationFactory;\n\n export namespace Root {\n export type Props = PaginationRootProps;\n }\n\n export namespace Control {\n export type Props = PaginationControlProps;\n }\n\n export namespace Dots {\n export type Props = PaginationDotsProps;\n }\n\n export namespace Edge {\n export type Props = PaginationEdgeProps;\n }\n\n export namespace Items {\n export type Props = PaginationItemsProps;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AA8EA,MAAM,eAAe;CACnB,cAAc;CACd,WAAW;CACX,UAAU;CACV,YAAY;CACZ,KAAK;CACN;AAED,MAAa,aAAaA,gBAAAA,SAA4B,WAAW;CAE/D,MAAM,EACJ,WACA,cACA,iBACA,UACA,cACA,UACA,WACA,UACA,OACA,KACA,iBACA,WACA,GAAG,WAdSC,kBAAAA,SAAS,cAAc,cAAc,OAAO;AAiB1D,KAAI,SAAS,KAAM,mBAAmB,UAAU,EAC9C,QAAO;AAGT,QACE,iBAAA,GAAA,kBAAA,KAACC,uBAAAA,gBAAD;EAAuB;EAAO,GAAI;YAChC,iBAAA,GAAA,kBAAA,MAACC,cAAAA,OAAD;GAAY;aAAZ;IACG,aAAa,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,iBAAD;KAAiB,MAAM;KAAW,GAAI,kBAAkB,QAAQ;KAAI,CAAA;IACjF,gBACC,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,oBAAD;KAAoB,MAAM;KAAc,GAAI,kBAAkB,WAAW;KAAI,CAAA;IAE9E,aAAa,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,iBAAD,EAA2B,UAAY,CAAA;IACpD,gBAAgB,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,gBAAD;KAAgB,MAAM;KAAU,GAAI,kBAAkB,OAAO;KAAI,CAAA;IACjF,aAAa,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,gBAAD;KAAgB,MAAM;KAAU,GAAI,kBAAkB,OAAO;KAAI,CAAA;IACzE;;EACO,CAAA;EAEnB;AAEF,WAAW,UAAUC,0BAAAA;AACrB,WAAW,cAAc;AACzB,WAAW,OAAOP,uBAAAA;AAClB,WAAW,UAAUQ,0BAAAA;AACrB,WAAW,OAAOC,uBAAAA;AAClB,WAAW,QAAQP,wBAAAA;AACnB,WAAW,OAAOI,wBAAAA;AAClB,WAAW,OAAOD,wBAAAA;AAClB,WAAW,WAAWF,wBAAAA;AACtB,WAAW,QAAQC,wBAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Paper.cjs","names":["createVarsResolver","getRadius","getShadow","polymorphicFactory","useProps","useStyles","Box","classes"],"sources":["../../../src/components/Paper/Paper.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n getRadius,\n getShadow,\n MantineRadius,\n MantineShadow,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Paper.module.css';\n\nexport type PaperStylesNames = 'root';\nexport type PaperCssVariables = {\n root: '--paper-radius' | '--paper-shadow';\n};\n\nexport interface PaperBaseProps {\n /** Key of `theme.shadows` or any valid CSS value to set `box-shadow` */\n shadow?: MantineShadow;\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 /** Adds border to the root element */\n withBorder?: boolean;\n}\n\nexport interface PaperProps extends BoxProps, PaperBaseProps, StylesApiProps<PaperFactory> {}\n\nexport type PaperFactory = PolymorphicFactory<{\n props: PaperProps;\n defaultComponent: 'div';\n defaultRef: HTMLDivElement;\n stylesNames: PaperStylesNames;\n vars: PaperCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<PaperFactory>((_, { radius, shadow }) => ({\n root: {\n '--paper-radius': radius === undefined ? undefined : getRadius(radius),\n '--paper-shadow': getShadow(shadow),\n },\n}));\n\nexport const Paper = polymorphicFactory<PaperFactory>((_props) => {\n const props = useProps('Paper', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n withBorder,\n vars,\n radius,\n shadow,\n variant,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<PaperFactory>({\n name: 'Paper',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <Box\n mod={[{ 'data-with-border': withBorder }, mod]}\n {...getStyles('root')}\n variant={variant}\n {...others}\n />\n );\n});\n\nPaper.classes = classes;\nPaper.varsResolver = varsResolver;\nPaper.displayName = '@mantine/core/Paper';\n"],"mappings":";;;;;;;;;;;AA0CA,MAAM,eAAeA,6BAAAA,oBAAkC,GAAG,EAAE,QAAQ,cAAc,EAChF,MAAM;CACJ,kBAAkB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO;CACtE,kBAAkBC,iBAAAA,UAAU,OAAO;CACpC,EACF,EAAE;AAEH,MAAa,QAAQC,4BAAAA,oBAAkC,WAAW;CAChE,MAAM,QAAQC,kBAAAA,SAAS,SAAS,MAAM,OAAO;CAC7C,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,YACA,MACA,QACA,QACA,SACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAAwB;EACxC,MAAM;EACN;EACA,SAAA,qBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,KAAK,CAAC,EAAE,oBAAoB,YAAY,EAAE,IAAI;EAC9C,GAAI,UAAU,OAAO;EACZ;EACT,GAAI;EACJ,CAAA;EAEJ;AAEF,MAAM,UAAUC,qBAAAA;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc"}
1
+ {"version":3,"file":"Paper.cjs","names":["createVarsResolver","getRadius","getShadow","polymorphicFactory","useProps","useStyles","Box","classes"],"sources":["../../../src/components/Paper/Paper.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n getRadius,\n getShadow,\n MantineRadius,\n MantineShadow,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Paper.module.css';\n\nexport type PaperStylesNames = 'root';\nexport type PaperCssVariables = {\n root: '--paper-radius' | '--paper-shadow';\n};\n\nexport interface PaperBaseProps {\n /** Key of `theme.shadows` or any valid CSS value to set `box-shadow` */\n shadow?: MantineShadow;\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 /** Adds border to the root element */\n withBorder?: boolean;\n}\n\nexport interface PaperProps extends BoxProps, PaperBaseProps, StylesApiProps<PaperFactory> {}\n\nexport type PaperFactory = PolymorphicFactory<{\n props: PaperProps;\n defaultComponent: 'div';\n defaultRef: HTMLDivElement;\n stylesNames: PaperStylesNames;\n vars: PaperCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<PaperFactory>((_, { radius, shadow }) => ({\n root: {\n '--paper-radius': radius === undefined ? undefined : getRadius(radius),\n '--paper-shadow': getShadow(shadow),\n },\n}));\n\nexport const Paper = polymorphicFactory<PaperFactory>((_props) => {\n const props = useProps('Paper', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n withBorder,\n vars,\n radius,\n shadow,\n variant,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<PaperFactory>({\n name: 'Paper',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <Box\n mod={[{ 'data-with-border': withBorder }, mod]}\n {...getStyles('root')}\n variant={variant}\n {...others}\n />\n );\n});\n\nPaper.classes = classes;\nPaper.varsResolver = varsResolver;\nPaper.displayName = '@mantine/core/Paper';\n\nexport namespace Paper {\n export type Props = PaperProps;\n export type StylesNames = PaperStylesNames;\n export type CssVariables = PaperCssVariables;\n export type Factory = PaperFactory;\n export type BaseProps = PaperBaseProps;\n}\n"],"mappings":";;;;;;;;;;;AA0CA,MAAM,eAAeA,6BAAAA,oBAAkC,GAAG,EAAE,QAAQ,cAAc,EAChF,MAAM;CACJ,kBAAkB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO;CACtE,kBAAkBC,iBAAAA,UAAU,OAAO;CACpC,EACF,EAAE;AAEH,MAAa,QAAQC,4BAAAA,oBAAkC,WAAW;CAChE,MAAM,QAAQC,kBAAAA,SAAS,SAAS,MAAM,OAAO;CAC7C,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,YACA,MACA,QACA,QACA,SACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAYC,mBAAAA,UAAwB;EACxC,MAAM;EACN;EACA,SAAA,qBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,KAAK,CAAC,EAAE,oBAAoB,YAAY,EAAE,IAAI;EAC9C,GAAI,UAAU,OAAO;EACZ;EACT,GAAI;EACJ,CAAA;EAEJ;AAEF,MAAM,UAAUC,qBAAAA;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc"}
@@ -17,7 +17,10 @@ let clsx = require("clsx");
17
17
  clsx = require_runtime.__toESM(clsx);
18
18
  let react_jsx_runtime = require("react/jsx-runtime");
19
19
  //#region packages/@mantine/core/src/components/PasswordInput/PasswordInput.tsx
20
- const defaultProps = { visibilityToggleIcon: require_PasswordToggleIcon.PasswordToggleIcon };
20
+ const defaultProps = {
21
+ visibilityToggleIcon: require_PasswordToggleIcon.PasswordToggleIcon,
22
+ size: "sm"
23
+ };
21
24
  const varsResolver = require_create_vars_resolver.createVarsResolver((_, { size }) => ({ root: {
22
25
  "--psi-icon-size": require_get_size.getSize(size, "psi-icon-size"),
23
26
  "--psi-button-size": require_get_size.getSize(size, "psi-button-size")
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordInput.cjs","names":["PasswordToggleIcon","createVarsResolver","getSize","factory","useProps","useStyles","useResolvedStylesApi","extractStyleProps","ActionIcon","Input","classes","InputBase"],"sources":["../../../src/components/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import cx from 'clsx';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n createVarsResolver,\n ElementProps,\n extractStyleProps,\n factory,\n Factory,\n getSize,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '../../core';\nimport { ActionIcon } from '../ActionIcon';\nimport { __BaseInputProps, __InputStylesNames, Input, InputVariant } from '../Input';\nimport { InputBase } from '../InputBase';\nimport { PasswordToggleIcon } from './PasswordToggleIcon';\nimport classes from './PasswordInput.module.css';\n\nexport type PasswordInputStylesNames =\n | 'root'\n | 'visibilityToggle'\n | 'innerInput'\n | __InputStylesNames;\nexport type PasswordInputCssVariables = {\n root: '--psi-icon-size' | '--psi-button-size';\n};\n\nexport interface PasswordInputProps\n extends\n BoxProps,\n Omit<__BaseInputProps, 'pointer'>,\n StylesApiProps<PasswordInputFactory>,\n ElementProps<'input', 'size'> {\n /** A component to replace the visibility toggle icon */\n visibilityToggleIcon?: React.FC<{ reveal: boolean }>;\n\n /** Props passed down to the visibility toggle button */\n visibilityToggleButtonProps?: Record<string, any>;\n\n /** If set, the input value is visible */\n visible?: boolean;\n\n /** If set, the input value is visible by default */\n defaultVisible?: boolean;\n\n /** Called when visibility changes */\n onVisibilityChange?: (visible: boolean) => void;\n}\n\nexport type PasswordInputFactory = Factory<{\n props: PasswordInputProps;\n ref: HTMLInputElement;\n stylesNames: PasswordInputStylesNames;\n vars: PasswordInputCssVariables;\n variant: InputVariant;\n}>;\n\nconst defaultProps = {\n visibilityToggleIcon: PasswordToggleIcon,\n} satisfies Partial<PasswordInputProps>;\n\nconst varsResolver = createVarsResolver<PasswordInputFactory>((_, { size }) => ({\n root: {\n '--psi-icon-size': getSize(size, 'psi-icon-size'),\n '--psi-button-size': getSize(size, 'psi-button-size'),\n },\n}));\n\nexport const PasswordInput = factory<PasswordInputFactory>((_props) => {\n const props = useProps('PasswordInput', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n required,\n error,\n leftSection,\n disabled,\n id,\n variant,\n inputContainer,\n description,\n label,\n size,\n errorProps,\n descriptionProps,\n labelProps,\n withAsterisk,\n inputWrapperOrder,\n wrapperProps,\n radius,\n rightSection,\n rightSectionWidth,\n rightSectionPointerEvents,\n leftSectionWidth,\n visible,\n defaultVisible,\n onVisibilityChange,\n visibilityToggleIcon: VisibilityToggleIcon,\n visibilityToggleButtonProps,\n rightSectionProps,\n leftSectionProps,\n leftSectionPointerEvents,\n withErrorStyles,\n mod,\n attributes,\n ...others\n } = props;\n\n const uuid = useId(id);\n\n const [_visible, setVisibility] = useUncontrolled({\n value: visible,\n defaultValue: defaultVisible,\n finalValue: false,\n onChange: onVisibilityChange,\n });\n\n const toggleVisibility = () => setVisibility(!_visible);\n\n const getStyles = useStyles<PasswordInputFactory>({\n name: 'PasswordInput',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<PasswordInputFactory>({\n classNames,\n styles,\n props,\n });\n\n const { styleProps, rest } = extractStyleProps(others);\n const errorId = errorProps?.id || `${uuid}-error`;\n const descriptionId = descriptionProps?.id || `${uuid}-description`;\n const hasError = !!error && typeof error !== 'boolean';\n const hasDescription = !!description;\n const _describedBy = `${hasError ? errorId : ''} ${hasDescription ? descriptionId : ''}`;\n const describedBy = _describedBy.trim().length > 0 ? _describedBy.trim() : undefined;\n\n const visibilityToggleButton = (\n <ActionIcon<'button'>\n {...getStyles('visibilityToggle')}\n disabled={disabled}\n radius={radius}\n aria-pressed={_visible}\n tabIndex={-1}\n aria-label=\"Toggle password visibility\"\n {...visibilityToggleButtonProps}\n variant={visibilityToggleButtonProps?.variant ?? 'subtle'}\n color=\"gray\"\n unstyled={unstyled}\n onTouchEnd={(event) => {\n event.preventDefault();\n visibilityToggleButtonProps?.onTouchEnd?.(event);\n toggleVisibility();\n }}\n onMouseDown={(event) => {\n event.preventDefault();\n visibilityToggleButtonProps?.onMouseDown?.(event);\n toggleVisibility();\n }}\n onKeyDown={(event) => {\n visibilityToggleButtonProps?.onKeyDown?.(event);\n if (event.key === ' ') {\n event.preventDefault();\n toggleVisibility();\n }\n }}\n >\n <VisibilityToggleIcon reveal={_visible} />\n </ActionIcon>\n );\n\n return (\n <Input.Wrapper\n required={required}\n id={uuid}\n label={label}\n error={error}\n description={description}\n size={size}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n __staticSelector=\"PasswordInput\"\n __stylesApiProps={props}\n unstyled={unstyled}\n withAsterisk={withAsterisk}\n inputWrapperOrder={inputWrapperOrder}\n inputContainer={inputContainer}\n variant={variant}\n labelProps={{ ...labelProps, htmlFor: uuid }}\n descriptionProps={{ ...descriptionProps, id: descriptionId }}\n errorProps={{ ...errorProps, id: errorId }}\n mod={mod}\n attributes={attributes}\n {...getStyles('root')}\n {...styleProps}\n {...wrapperProps}\n >\n <Input\n component=\"div\"\n error={error}\n leftSection={leftSection}\n size={size}\n classNames={{ ...resolvedClassNames, input: cx(classes.input, resolvedClassNames.input) }}\n styles={resolvedStyles}\n radius={radius}\n disabled={disabled}\n __staticSelector=\"PasswordInput\"\n __stylesApiProps={props}\n rightSectionWidth={rightSectionWidth}\n rightSection={rightSection ?? visibilityToggleButton}\n variant={variant}\n unstyled={unstyled}\n leftSectionWidth={leftSectionWidth}\n rightSectionPointerEvents={rightSectionPointerEvents || 'all'}\n rightSectionProps={rightSectionProps}\n leftSectionProps={leftSectionProps}\n leftSectionPointerEvents={leftSectionPointerEvents}\n withAria={false}\n withErrorStyles={withErrorStyles}\n attributes={attributes}\n >\n <input\n required={required}\n data-invalid={!!error || undefined}\n data-with-left-section={!!leftSection || undefined}\n {...getStyles('innerInput')}\n disabled={disabled}\n id={uuid}\n {...rest}\n aria-describedby={describedBy}\n autoComplete={rest.autoComplete || 'off'}\n type={_visible ? 'text' : 'password'}\n />\n </Input>\n </Input.Wrapper>\n );\n});\n\nPasswordInput.classes = { ...InputBase.classes, ...classes };\nPasswordInput.varsResolver = varsResolver;\nPasswordInput.displayName = '@mantine/core/PasswordInput';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4DA,MAAM,eAAe,EACnB,sBAAsBA,2BAAAA,oBACvB;AAED,MAAM,eAAeC,6BAAAA,oBAA0C,GAAG,EAAE,YAAY,EAC9E,MAAM;CACJ,mBAAmBC,iBAAAA,QAAQ,MAAM,gBAAgB;CACjD,qBAAqBA,iBAAAA,QAAQ,MAAM,kBAAkB;CACtD,EACF,EAAE;AAEH,MAAa,gBAAgBC,gBAAAA,SAA+B,WAAW;CACrE,MAAM,QAAQC,kBAAAA,SAAS,iBAAiB,cAAc,OAAO;CAC7D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,UACA,OACA,aACA,UACA,IACA,SACA,gBACA,aACA,OACA,MACA,YACA,kBACA,YACA,cACA,mBACA,cACA,QACA,cACA,mBACA,2BACA,kBACA,SACA,gBACA,oBACA,sBAAsB,sBACtB,6BACA,mBACA,kBAC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BAAA,KAAC,sBAAD,EAAsB,QAAQ,UAAY,CAAA;EAC/B,CAAA;AAGf,QACE,iBAAA,GAAA,kBAAA,KAACC,cAAAA,MAAM,SAAP;EACY;EACV,IAAI;EACG;EACA;EACM;EACP;EACN,YAAY;EACZ,QAAQ;EACR,kBAAiB;EACjB,kBAAkB;EACR;EACI;EACK;EACH;EACP;EACT,YAAY;GAAE,GAAG;GAAY,SAAS;GAAM;EAC5C,kBAAkB;GAAE,GAAG;GAAkB,IAAI;GAAe;EAC5D,YAAY;GAAE,GAAG;GAAY,IAAI;GAAS;EACrC;EACO;EACZ,GAAI,UAAU,OAAO;EACrB,GAAI;EACJ,GAAI;YAEJ,iBAAA,GAAA,kBAAA,KAACA,cAAAA,OAAD;GACE,WAAU;GACH;GACM;GACP;GACN,YAAY;IAAE,GAAG;IAAoB,QAAA,GAAA,KAAA,SAAUC,6BAAAA,QAAQ,OAAO,mBAAmB,MAAM;IAAE;GACzF,QAAQ;GACA;GACE;GACV,kBAAiB;GACjB,kBAAkB;GACC;GACnB,cAAc,gBAAgB;GACrB;GACC;GACQ;GAClB,2BAA2B,6BAA6B;GACrC;GACD;GACQ;GAC1B,UAAU;GACO;GACL;aAEZ,iBAAA,GAAA,kBAAA,KAAC,SAAD;IACY;IACV,gBAAc,CAAC,CAAC,SAAS,KAAA;IACzB,0BAAwB,CAAC,CAAC,eAAe,KAAA;IACzC,GAAI,UAAU,aAAa;IACjB;IACV,IAAI;IACJ,GAAI;IACJ,oBAAkB;IAClB,cAAc,KAAK,gBAAgB;IACnC,MAAM,WAAW,SAAS;IAC1B,CAAA;GACI,CAAA;EACM,CAAA;EAElB;AAEF,cAAc,UAAU;CAAE,GAAGC,kBAAAA,UAAU;CAAS,GAAGD,6BAAAA;CAAS;AAC5D,cAAc,eAAe;AAC7B,cAAc,cAAc"}
1
+ {"version":3,"file":"PasswordInput.cjs","names":["PasswordToggleIcon","createVarsResolver","getSize","factory","useProps","useStyles","useResolvedStylesApi","extractStyleProps","ActionIcon","Input","classes","InputBase"],"sources":["../../../src/components/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import cx from 'clsx';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n createVarsResolver,\n ElementProps,\n extractStyleProps,\n factory,\n Factory,\n getSize,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '../../core';\nimport { ActionIcon } from '../ActionIcon';\nimport { __BaseInputProps, __InputStylesNames, Input, InputVariant } from '../Input';\nimport { InputBase } from '../InputBase';\nimport { PasswordToggleIcon } from './PasswordToggleIcon';\nimport classes from './PasswordInput.module.css';\n\nexport type PasswordInputStylesNames =\n | 'root'\n | 'visibilityToggle'\n | 'innerInput'\n | __InputStylesNames;\nexport type PasswordInputCssVariables = {\n root: '--psi-icon-size' | '--psi-button-size';\n};\n\nexport interface PasswordInputProps\n extends\n BoxProps,\n Omit<__BaseInputProps, 'pointer'>,\n StylesApiProps<PasswordInputFactory>,\n ElementProps<'input', 'size'> {\n /** A component to replace the visibility toggle icon */\n visibilityToggleIcon?: React.FC<{ reveal: boolean }>;\n\n /** Props passed down to the visibility toggle button */\n visibilityToggleButtonProps?: Record<string, any>;\n\n /** If set, the input value is visible */\n visible?: boolean;\n\n /** If set, the input value is visible by default */\n defaultVisible?: boolean;\n\n /** Called when visibility changes */\n onVisibilityChange?: (visible: boolean) => void;\n}\n\nexport type PasswordInputFactory = Factory<{\n props: PasswordInputProps;\n ref: HTMLInputElement;\n stylesNames: PasswordInputStylesNames;\n vars: PasswordInputCssVariables;\n variant: InputVariant;\n}>;\n\nconst defaultProps = {\n visibilityToggleIcon: PasswordToggleIcon,\n size: 'sm',\n} satisfies Partial<PasswordInputProps>;\n\nconst varsResolver = createVarsResolver<PasswordInputFactory>((_, { size }) => ({\n root: {\n '--psi-icon-size': getSize(size, 'psi-icon-size'),\n '--psi-button-size': getSize(size, 'psi-button-size'),\n },\n}));\n\nexport const PasswordInput = factory<PasswordInputFactory>((_props) => {\n const props = useProps('PasswordInput', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n required,\n error,\n leftSection,\n disabled,\n id,\n variant,\n inputContainer,\n description,\n label,\n size,\n errorProps,\n descriptionProps,\n labelProps,\n withAsterisk,\n inputWrapperOrder,\n wrapperProps,\n radius,\n rightSection,\n rightSectionWidth,\n rightSectionPointerEvents,\n leftSectionWidth,\n visible,\n defaultVisible,\n onVisibilityChange,\n visibilityToggleIcon: VisibilityToggleIcon,\n visibilityToggleButtonProps,\n rightSectionProps,\n leftSectionProps,\n leftSectionPointerEvents,\n withErrorStyles,\n mod,\n attributes,\n ...others\n } = props;\n\n const uuid = useId(id);\n\n const [_visible, setVisibility] = useUncontrolled({\n value: visible,\n defaultValue: defaultVisible,\n finalValue: false,\n onChange: onVisibilityChange,\n });\n\n const toggleVisibility = () => setVisibility(!_visible);\n\n const getStyles = useStyles<PasswordInputFactory>({\n name: 'PasswordInput',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<PasswordInputFactory>({\n classNames,\n styles,\n props,\n });\n\n const { styleProps, rest } = extractStyleProps(others);\n const errorId = errorProps?.id || `${uuid}-error`;\n const descriptionId = descriptionProps?.id || `${uuid}-description`;\n const hasError = !!error && typeof error !== 'boolean';\n const hasDescription = !!description;\n const _describedBy = `${hasError ? errorId : ''} ${hasDescription ? descriptionId : ''}`;\n const describedBy = _describedBy.trim().length > 0 ? _describedBy.trim() : undefined;\n\n const visibilityToggleButton = (\n <ActionIcon<'button'>\n {...getStyles('visibilityToggle')}\n disabled={disabled}\n radius={radius}\n aria-pressed={_visible}\n tabIndex={-1}\n aria-label=\"Toggle password visibility\"\n {...visibilityToggleButtonProps}\n variant={visibilityToggleButtonProps?.variant ?? 'subtle'}\n color=\"gray\"\n unstyled={unstyled}\n onTouchEnd={(event) => {\n event.preventDefault();\n visibilityToggleButtonProps?.onTouchEnd?.(event);\n toggleVisibility();\n }}\n onMouseDown={(event) => {\n event.preventDefault();\n visibilityToggleButtonProps?.onMouseDown?.(event);\n toggleVisibility();\n }}\n onKeyDown={(event) => {\n visibilityToggleButtonProps?.onKeyDown?.(event);\n if (event.key === ' ') {\n event.preventDefault();\n toggleVisibility();\n }\n }}\n >\n <VisibilityToggleIcon reveal={_visible} />\n </ActionIcon>\n );\n\n return (\n <Input.Wrapper\n required={required}\n id={uuid}\n label={label}\n error={error}\n description={description}\n size={size}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n __staticSelector=\"PasswordInput\"\n __stylesApiProps={props}\n unstyled={unstyled}\n withAsterisk={withAsterisk}\n inputWrapperOrder={inputWrapperOrder}\n inputContainer={inputContainer}\n variant={variant}\n labelProps={{ ...labelProps, htmlFor: uuid }}\n descriptionProps={{ ...descriptionProps, id: descriptionId }}\n errorProps={{ ...errorProps, id: errorId }}\n mod={mod}\n attributes={attributes}\n {...getStyles('root')}\n {...styleProps}\n {...wrapperProps}\n >\n <Input\n component=\"div\"\n error={error}\n leftSection={leftSection}\n size={size}\n classNames={{ ...resolvedClassNames, input: cx(classes.input, resolvedClassNames.input) }}\n styles={resolvedStyles}\n radius={radius}\n disabled={disabled}\n __staticSelector=\"PasswordInput\"\n __stylesApiProps={props}\n rightSectionWidth={rightSectionWidth}\n rightSection={rightSection ?? visibilityToggleButton}\n variant={variant}\n unstyled={unstyled}\n leftSectionWidth={leftSectionWidth}\n rightSectionPointerEvents={rightSectionPointerEvents || 'all'}\n rightSectionProps={rightSectionProps}\n leftSectionProps={leftSectionProps}\n leftSectionPointerEvents={leftSectionPointerEvents}\n withAria={false}\n withErrorStyles={withErrorStyles}\n attributes={attributes}\n >\n <input\n required={required}\n data-invalid={!!error || undefined}\n data-with-left-section={!!leftSection || undefined}\n {...getStyles('innerInput')}\n disabled={disabled}\n id={uuid}\n {...rest}\n aria-describedby={describedBy}\n autoComplete={rest.autoComplete || 'off'}\n type={_visible ? 'text' : 'password'}\n />\n </Input>\n </Input.Wrapper>\n );\n});\n\nPasswordInput.classes = { ...InputBase.classes, ...classes };\nPasswordInput.varsResolver = varsResolver;\nPasswordInput.displayName = '@mantine/core/PasswordInput';\n\nexport namespace PasswordInput {\n export type Props = PasswordInputProps;\n export type StylesNames = PasswordInputStylesNames;\n export type CssVariables = PasswordInputCssVariables;\n export type Factory = PasswordInputFactory;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4DA,MAAM,eAAe;CACnB,sBAAsBA,2BAAAA;CACtB,MAAM;CACP;AAED,MAAM,eAAeC,6BAAAA,oBAA0C,GAAG,EAAE,YAAY,EAC9E,MAAM;CACJ,mBAAmBC,iBAAAA,QAAQ,MAAM,gBAAgB;CACjD,qBAAqBA,iBAAAA,QAAQ,MAAM,kBAAkB;CACtD,EACF,EAAE;AAEH,MAAa,gBAAgBC,gBAAAA,SAA+B,WAAW;CACrE,MAAM,QAAQC,kBAAAA,SAAS,iBAAiB,cAAc,OAAO;CAC7D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,UACA,OACA,aACA,UACA,IACA,SACA,gBACA,aACA,OACA,MACA,YACA,kBACA,YACA,cACA,mBACA,cACA,QACA,cACA,mBACA,2BACA,kBACA,SACA,gBACA,oBACA,sBAAsB,sBACtB,6BACA,mBACA,kBACA,0BACA,iBACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,QAAA,GAAA,eAAA,OAAa,GAAG;CAEtB,MAAM,CAAC,UAAU,kBAAA,GAAA,eAAA,iBAAiC;EAChD,OAAO;EACP,cAAc;EACd,YAAY;EACZ,UAAU;EACX,CAAC;CAEF,MAAM,yBAAyB,cAAc,CAAC,SAAS;CAEvD,MAAM,YAAYC,mBAAAA,UAAgC;EAChD,MAAM;EACN,SAAA,6BAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,EAAE,oBAAoB,mBAAmBC,gCAAAA,qBAA2C;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AAI;EACJ,GAAI;YAEJ,iBAAA,GAAA,kBAAA,KAACA,cAAAA,OAAD;GACE,WAAU;GACH;GACM;GACP;GACN,YAAY;IAAE,GAAG;IAAoB,QAAA,GAAA,KAAA,SAAUC,6BAAAA,QAAQ,OAAO,mBAAmB,MAAM;IAAE;GACzF,QAAQ;GACA;GACE;GACV,kBAAiB;GACjB,kBAAkB;GACC;GACnB,cAAc,gBAAgB;GACrB;GACC;GACQ;GAClB,2BAA2B,6BAA6B;GACrC;GACD;GACQ;GAC1B,UAAU;GACO;GACL;aAEZ,iBAAA,GAAA,kBAAA,KAAC,SAAD;IACY;IACV,gBAAc,CAAC,CAAC,SAAS,KAAA;IACzB,0BAAwB,CAAC,CAAC,eAAe,KAAA;IACzC,GAAI,UAAU,aAAa;IACjB;IACV,IAAI;IACJ,GAAI;IACJ,oBAAkB;IAClB,cAAc,KAAK,gBAAgB;IACnC,MAAM,WAAW,SAAS;IAC1B,CAAA;GACI,CAAA;EACM,CAAA;EAElB;AAEF,cAAc,UAAU;CAAE,GAAGC,kBAAAA,UAAU;CAAS,GAAGD,6BAAAA;CAAS;AAC5D,cAAc,eAAe;AAC7B,cAAc,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.cjs","names":["createVarsResolver","getSize","getRadius","factory","useProps","PillGroupContext","PillsInputContext","useStyles","Box","CloseButton","classes","PillGroup"],"sources":["../../../src/components/Pill/Pill.tsx"],"sourcesContent":["import { use } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getRadius,\n getSize,\n MantineRadius,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { CloseButton, CloseButtonProps } from '../CloseButton';\nimport { PillsInputContext } from '../PillsInput/PillsInput.context';\nimport { PillGroup, PillGroupContext } from './PillGroup/PillGroup';\nimport classes from './Pill.module.css';\n\nexport type PillStylesNames = 'root' | 'label' | 'remove';\nexport type PillVariant = 'default' | 'contrast';\nexport type PillCssVariables = {\n root: '--pill-fz' | '--pill-radius' | '--pill-height';\n};\n\nexport interface PillProps extends BoxProps, StylesApiProps<PillFactory>, ElementProps<'div'> {\n /** Controls pill `font-size` and `padding` @default 'sm' */\n size?: MantineSize;\n\n /** Controls visibility of the remove button @default false */\n withRemoveButton?: boolean;\n\n /** Called when the remove button is clicked */\n onRemove?: () => void;\n\n /** Props passed down to the remove button */\n removeButtonProps?: CloseButtonProps & React.ComponentProps<'button'>;\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius. Numbers are converted to rem. @default 'xl' */\n radius?: MantineRadius;\n\n /** Adds disabled attribute, applies disabled styles */\n disabled?: boolean;\n}\n\nexport type PillFactory = Factory<{\n props: PillProps;\n ref: HTMLDivElement;\n stylesNames: PillStylesNames;\n vars: PillCssVariables;\n variant: PillVariant;\n ctx: { size: MantineSize | (string & {}) | undefined };\n staticComponents: {\n Group: typeof PillGroup;\n };\n}>;\n\nconst defaultProps = {\n variant: 'default',\n} satisfies Partial<PillProps>;\n\nconst varsResolver = createVarsResolver<PillFactory>((_, { radius }, { size }) => ({\n root: {\n '--pill-fz': getSize(size, 'pill-fz'),\n '--pill-height': getSize(size, 'pill-height'),\n '--pill-radius': radius === undefined ? undefined : getRadius(radius),\n },\n}));\n\nexport const Pill = factory<PillFactory>((_props) => {\n const props = useProps('Pill', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n variant,\n children,\n withRemoveButton,\n onRemove,\n removeButtonProps,\n radius,\n size,\n disabled,\n mod,\n attributes,\n ...others\n } = props;\n\n const ctx = use(PillGroupContext);\n const pillsInputCtx = use(PillsInputContext);\n const _size = size || ctx?.size || undefined;\n const _variant = pillsInputCtx?.variant === 'filled' ? 'contrast' : variant || 'default';\n\n const getStyles = useStyles<PillFactory>({\n name: 'Pill',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n stylesCtx: { size: _size },\n });\n\n return (\n <Box\n component=\"span\"\n variant={_variant}\n size={_size}\n {...getStyles('root', { variant: _variant })}\n mod={[\n { 'with-remove': withRemoveButton && !disabled, disabled: disabled || ctx?.disabled },\n mod,\n ]}\n {...others}\n >\n <span {...getStyles('label')}>{children}</span>\n {withRemoveButton && (\n <CloseButton\n variant=\"transparent\"\n radius={radius}\n tabIndex={-1}\n aria-hidden\n unstyled={unstyled}\n {...removeButtonProps}\n {...getStyles('remove', {\n className: removeButtonProps?.className,\n style: removeButtonProps?.style,\n })}\n onMouseDown={(event) => {\n event.preventDefault();\n event.stopPropagation();\n removeButtonProps?.onMouseDown?.(event);\n }}\n onClick={(event) => {\n event.stopPropagation();\n onRemove?.();\n removeButtonProps?.onClick?.(event);\n }}\n />\n )}\n </Box>\n );\n});\n\nPill.classes = classes;\nPill.varsResolver = varsResolver;\nPill.displayName = '@mantine/core/Pill';\nPill.Group = PillGroup;\n"],"mappings":";;;;;;;;;;;;;;;AA2DA,MAAM,eAAe,EACnB,SAAS,WACV;AAED,MAAM,eAAeA,6BAAAA,oBAAiC,GAAG,EAAE,UAAU,EAAE,YAAY,EACjF,MAAM;CACJ,aAAaC,iBAAAA,QAAQ,MAAM,UAAU;CACrC,iBAAiBA,iBAAAA,QAAQ,MAAM,cAAc;CAC7C,iBAAiB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO;CACtE,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,SACA,UACA,kBACA,UACA,mBACA,QACA,MACA,UACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,OAAA,GAAA,MAAA,KAAUC,kBAAAA,iBAAiB;CACjC,MAAM,iBAAA,GAAA,MAAA,KAAoBC,2BAAAA,kBAAkB;CAC5C,MAAM,QAAQ,QAAQ,KAAK,QAAQ,KAAA;CACnC,MAAM,WAAW,eAAe,YAAY,WAAW,aAAa,WAAW;CAE/E,MAAM,YAAYC,mBAAAA,UAAuB;EACvC,MAAM;EACN,SAAA,oBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW,EAAE,MAAM,OAAO;EAC3B,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,MAACC,YAAAA,KAAD;EACE,WAAU;EACV,SAAS;EACT,MAAM;EACN,GAAI,UAAU,QAAQ,EAAE,SAAS,UAAU,CAAC;EAC5C,KAAK,CACH;GAAE,eAAe,oBAAoB,CAAC;GAAU,UAAU,YAAY,KAAK;GAAU,EACrF,IACD;EACD,GAAI;YATN,CAWE,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,GAAI,UAAU,QAAQ;GAAG;GAAgB,CAAA,EAC9C,oBACC,iBAAA,GAAA,kBAAA,KAACC,oBAAAA,aAAD;GACE,SAAQ;GACA;GACR,UAAU;GACV,eAAA;GACU;GACV,GAAI;GACJ,GAAI,UAAU,UAAU;IACtB,WAAW,mBAAmB;IAC9B,OAAO,mBAAmB;IAC3B,CAAC;GACF,cAAc,UAAU;AACtB,UAAM,gBAAgB;AACtB,UAAM,iBAAiB;AACvB,uBAAmB,cAAc,MAAM;;GAEzC,UAAU,UAAU;AAClB,UAAM,iBAAiB;AACvB,gBAAY;AACZ,uBAAmB,UAAU,MAAM;;GAErC,CAAA,CAEA;;EAER;AAEF,KAAK,UAAUC,oBAAAA;AACf,KAAK,eAAe;AACpB,KAAK,cAAc;AACnB,KAAK,QAAQC,kBAAAA"}
1
+ {"version":3,"file":"Pill.cjs","names":["createVarsResolver","getSize","getRadius","factory","useProps","PillGroupContext","PillsInputContext","useStyles","Box","CloseButton","classes","PillGroup"],"sources":["../../../src/components/Pill/Pill.tsx"],"sourcesContent":["import { use } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getRadius,\n getSize,\n MantineRadius,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { CloseButton, CloseButtonProps } from '../CloseButton';\nimport { PillsInputContext } from '../PillsInput/PillsInput.context';\nimport {\n PillGroup,\n PillGroupContext,\n type PillGroupProps,\n type PillGroupStylesNames,\n type PillGroupCssVariables,\n type PillGroupFactory,\n} from './PillGroup/PillGroup';\nimport classes from './Pill.module.css';\nexport type PillStylesNames = 'root' | 'label' | 'remove';\nexport type PillVariant = 'default' | 'contrast';\nexport type PillCssVariables = {\n root: '--pill-fz' | '--pill-radius' | '--pill-height';\n};\n\nexport interface PillProps extends BoxProps, StylesApiProps<PillFactory>, ElementProps<'div'> {\n /** Controls pill `font-size` and `padding` @default 'sm' */\n size?: MantineSize;\n\n /** Controls visibility of the remove button @default false */\n withRemoveButton?: boolean;\n\n /** Called when the remove button is clicked */\n onRemove?: () => void;\n\n /** Props passed down to the remove button */\n removeButtonProps?: CloseButtonProps & React.ComponentProps<'button'>;\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius. Numbers are converted to rem. @default 'xl' */\n radius?: MantineRadius;\n\n /** Adds disabled attribute, applies disabled styles */\n disabled?: boolean;\n}\n\nexport type PillFactory = Factory<{\n props: PillProps;\n ref: HTMLDivElement;\n stylesNames: PillStylesNames;\n vars: PillCssVariables;\n variant: PillVariant;\n ctx: { size: MantineSize | (string & {}) | undefined };\n staticComponents: {\n Group: typeof PillGroup;\n };\n}>;\n\nconst defaultProps = {\n variant: 'default',\n} satisfies Partial<PillProps>;\n\nconst varsResolver = createVarsResolver<PillFactory>((_, { radius }, { size }) => ({\n root: {\n '--pill-fz': getSize(size, 'pill-fz'),\n '--pill-height': getSize(size, 'pill-height'),\n '--pill-radius': radius === undefined ? undefined : getRadius(radius),\n },\n}));\n\nexport const Pill = factory<PillFactory>((_props) => {\n const props = useProps('Pill', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n variant,\n children,\n withRemoveButton,\n onRemove,\n removeButtonProps,\n radius,\n size,\n disabled,\n mod,\n attributes,\n ...others\n } = props;\n\n const ctx = use(PillGroupContext);\n const pillsInputCtx = use(PillsInputContext);\n const _size = size || ctx?.size || undefined;\n const _variant = pillsInputCtx?.variant === 'filled' ? 'contrast' : variant || 'default';\n\n const getStyles = useStyles<PillFactory>({\n name: 'Pill',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n stylesCtx: { size: _size },\n });\n\n return (\n <Box\n component=\"span\"\n variant={_variant}\n size={_size}\n {...getStyles('root', { variant: _variant })}\n mod={[\n { 'with-remove': withRemoveButton && !disabled, disabled: disabled || ctx?.disabled },\n mod,\n ]}\n {...others}\n >\n <span {...getStyles('label')}>{children}</span>\n {withRemoveButton && (\n <CloseButton\n variant=\"transparent\"\n radius={radius}\n tabIndex={-1}\n aria-hidden\n unstyled={unstyled}\n {...removeButtonProps}\n {...getStyles('remove', {\n className: removeButtonProps?.className,\n style: removeButtonProps?.style,\n })}\n onMouseDown={(event) => {\n event.preventDefault();\n event.stopPropagation();\n removeButtonProps?.onMouseDown?.(event);\n }}\n onClick={(event) => {\n event.stopPropagation();\n onRemove?.();\n removeButtonProps?.onClick?.(event);\n }}\n />\n )}\n </Box>\n );\n});\n\nPill.classes = classes;\nPill.varsResolver = varsResolver;\nPill.displayName = '@mantine/core/Pill';\nPill.Group = PillGroup;\n\nexport namespace Pill {\n export type Props = PillProps;\n export type StylesNames = PillStylesNames;\n export type CssVariables = PillCssVariables;\n export type Factory = PillFactory;\n export type Variant = PillVariant;\n\n export namespace Group {\n export type Props = PillGroupProps;\n export type StylesNames = PillGroupStylesNames;\n export type CssVariables = PillGroupCssVariables;\n export type Factory = PillGroupFactory;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAiEA,MAAM,eAAe,EACnB,SAAS,WACV;AAED,MAAM,eAAeA,6BAAAA,oBAAiC,GAAG,EAAE,UAAU,EAAE,YAAY,EACjF,MAAM;CACJ,aAAaC,iBA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AACtB,UAAM,gBAAgB;AACtB,UAAM,iBAAiB;AACvB,uBAAmB,cAAc,MAAM;;GAEzC,UAAU,UAAU;AAClB,UAAM,iBAAiB;AACvB,gBAAY;AACZ,uBAAmB,UAAU,MAAM;;GAErC,CAAA,CAEA;;EAER;AAEF,KAAK,UAAUC,oBAAAA;AACf,KAAK,eAAe;AACpB,KAAK,cAAc;AACnB,KAAK,QAAQC,kBAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.module.cjs","names":[],"sources":["../../../src/components/Pill/Pill.module.css"],"sourcesContent":[".root {\n --pill-fz-xs: 10px;\n --pill-fz-sm: 12px;\n --pill-fz-md: 14px;\n --pill-fz-lg: 16px;\n --pill-fz-xl: 18px;\n\n --pill-height-xs: 18px;\n --pill-height-sm: 22px;\n --pill-height-md: 25px;\n --pill-height-lg: 28px;\n --pill-height-xl: 32px;\n\n --pill-fz: var(--pill-fz-sm);\n --pill-height: var(--pill-height-sm);\n\n font-size: var(--pill-fz);\n flex: 0;\n height: var(--pill-height);\n padding-inline: 0.8em;\n display: inline-flex;\n align-items: center;\n border-radius: var(--pill-radius, 1000rem);\n line-height: 1;\n white-space: nowrap;\n user-select: none;\n -webkit-user-select: none;\n max-width: 100%;\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-7);\n color: var(--mantine-color-dark-0);\n }\n\n @mixin where-light {\n color: var(--mantine-color-black);\n }\n\n &:where([data-with-remove]:not(:has(button:disabled))) {\n padding-inline-end: 0;\n }\n\n &:where([data-disabled], :has(button:disabled)) {\n cursor: not-allowed;\n }\n}\n\n.root--default {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n\n &:where([data-disabled], :has(button:disabled)) {\n background-color: var(--mantine-color-disabled);\n }\n }\n}\n\n.root--contrast {\n @mixin where-light {\n background-color: var(--mantine-color-white);\n\n &:where([data-disabled], :has(button:disabled)) {\n background-color: var(--mantine-color-disabled);\n }\n }\n}\n\n.label {\n cursor: inherit;\n overflow: hidden;\n height: 100%;\n line-height: var(--pill-height);\n text-overflow: ellipsis;\n}\n\n.remove {\n color: inherit;\n font-size: inherit;\n height: 100%;\n min-height: unset;\n min-width: 2em;\n width: unset;\n border-radius: 0;\n padding-inline-start: 0.1em;\n padding-inline-end: 0.3em;\n flex: 0;\n border-end-end-radius: var(--pill-radius, 50%);\n border-start-end-radius: var(--pill-radius, 50%);\n\n .root[data-disabled] > &,\n &:disabled {\n display: none;\n background-color: transparent;\n width: 0.8em;\n min-width: 0.8em;\n padding: 0;\n cursor: not-allowed;\n\n & > svg {\n display: none;\n }\n }\n\n & > svg {\n pointer-events: none;\n }\n}\n\n.group {\n --pg-gap-xs: 6px;\n --pg-gap-sm: 8px;\n --pg-gap-md: 10px;\n --pg-gap-lg: 12px;\n --pg-gap-xl: 12px;\n --pg-gap: var(--pg-gap-sm);\n\n display: flex;\n align-items: center;\n gap: var(--pg-gap);\n flex-wrap: wrap;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"Pill.module.cjs","names":[],"sources":["../../../src/components/Pill/Pill.module.css"],"sourcesContent":[".root {\n --pill-fz-xs: 10px;\n --pill-fz-sm: 12px;\n --pill-fz-md: 14px;\n --pill-fz-lg: 16px;\n --pill-fz-xl: 18px;\n\n --pill-height-xs: 18px;\n --pill-height-sm: 22px;\n --pill-height-md: 25px;\n --pill-height-lg: 28px;\n --pill-height-xl: 32px;\n\n --pill-fz: var(--pill-fz-sm);\n --pill-height: var(--pill-height-sm);\n\n font-size: var(--pill-fz);\n flex: 0;\n height: var(--pill-height);\n padding-inline: 0.8em;\n display: inline-flex;\n align-items: center;\n border-radius: var(--pill-radius, 1000rem);\n line-height: 1;\n white-space: nowrap;\n user-select: none;\n -webkit-user-select: none;\n max-width: 100%;\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-7);\n color: var(--mantine-color-dark-0);\n }\n\n @mixin where-light {\n color: var(--mantine-color-black);\n }\n\n &:where([data-with-remove]:not(:has(button:disabled))) {\n padding-inline-end: 0;\n }\n\n &:where([data-disabled], :has(button:disabled)) {\n cursor: not-allowed;\n }\n}\n\n.root--default {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n\n &:where([data-disabled], :has(button:disabled)) {\n background-color: var(--mantine-color-disabled);\n }\n }\n}\n\n.root--contrast {\n @mixin where-light {\n background-color: var(--mantine-color-white);\n\n &:where([data-disabled], :has(button:disabled)) {\n background-color: var(--mantine-color-disabled);\n }\n }\n}\n\n.label {\n cursor: inherit;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n height: 100%;\n text-box-trim: trim-both;\n text-box-edge: cap alphabetic;\n}\n\n.remove {\n color: inherit;\n font-size: inherit;\n height: 100%;\n min-height: unset;\n min-width: 2em;\n width: unset;\n border-radius: 0;\n padding-inline-start: 0.1em;\n padding-inline-end: 0.3em;\n flex: 0;\n border-end-end-radius: var(--pill-radius, 50%);\n border-start-end-radius: var(--pill-radius, 50%);\n\n .root[data-disabled] > &,\n &:disabled {\n display: none;\n background-color: transparent;\n width: 0.8em;\n min-width: 0.8em;\n padding: 0;\n cursor: not-allowed;\n\n & > svg {\n display: none;\n }\n }\n\n & > svg {\n pointer-events: none;\n }\n}\n\n.group {\n --pg-gap-xs: 6px;\n --pg-gap-sm: 8px;\n --pg-gap-md: 10px;\n --pg-gap-lg: 12px;\n --pg-gap-xl: 12px;\n --pg-gap: var(--pg-gap-sm);\n\n display: flex;\n align-items: center;\n gap: var(--pg-gap);\n flex-wrap: wrap;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"PillsInput.cjs","names":["factory","useProps","PillsInputContext","InputBase","PillsInputField"],"sources":["../../../src/components/PillsInput/PillsInput.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { BoxProps, ElementProps, factory, Factory, StylesApiProps, useProps } from '../../core';\nimport { __BaseInputProps, __InputStylesNames } from '../Input';\nimport { InputBase } from '../InputBase';\nimport { PillsInputContext } from './PillsInput.context';\nimport { PillsInputField } from './PillsInputField/PillsInputField';\n\nexport interface PillsInputProps\n extends\n BoxProps,\n __BaseInputProps,\n StylesApiProps<PillsInputFactory>,\n ElementProps<'div', 'size'> {\n __stylesApiProps?: Record<string, any>;\n __staticSelector?: string;\n}\n\nexport type PillsInputFactory = Factory<{\n props: PillsInputProps;\n ref: HTMLDivElement;\n stylesNames: __InputStylesNames;\n staticComponents: {\n Field: typeof PillsInputField;\n };\n}>;\n\nconst defaultProps = {\n size: 'sm',\n} satisfies Partial<PillsInputProps>;\n\nexport const PillsInput = factory<PillsInputFactory>((_props) => {\n const props = useProps('PillsInput', defaultProps, _props);\n const {\n children,\n onMouseDown,\n onClick,\n size,\n disabled,\n __staticSelector,\n error,\n variant,\n ...others\n } = props;\n\n const fieldRef = useRef<HTMLInputElement>(null);\n\n return (\n <PillsInputContext value={{ fieldRef, size, disabled, hasError: !!error, variant }}>\n <InputBase\n size={size}\n error={error}\n variant={variant}\n component=\"div\"\n data-no-overflow\n onMouseDown={(event) => {\n event.preventDefault();\n onMouseDown?.(event);\n fieldRef.current?.focus();\n }}\n onClick={(event) => {\n event.preventDefault();\n const fieldset = event.currentTarget.closest('fieldset');\n if (!fieldset?.disabled) {\n fieldRef.current?.focus();\n onClick?.(event);\n }\n }}\n {...others}\n multiline\n disabled={disabled}\n __staticSelector={__staticSelector || 'PillsInput'}\n withAria={false}\n >\n {children}\n </InputBase>\n </PillsInputContext>\n );\n});\n\nPillsInput.displayName = '@mantine/core/PillsInput';\nPillsInput.classes = InputBase.classes;\nPillsInput.Field = PillsInputField;\n"],"mappings":";;;;;;;;;;AA0BA,MAAM,eAAe,EACnB,MAAM,MACP;AAED,MAAa,aAAaA,gBAAAA,SAA4B,WAAW;CAE/D,MAAM,EACJ,UACA,aACA,SACA,MACA,UACA,kBACA,OACA,SACA,GAAG,WAVSC,kBAAAA,SAAS,cAAc,cAAc,OAAO;CAa1D,MAAM,YAAA,GAAA,MAAA,QAAoC,KAAK;AAE/C,QACE,iBAAA,GAAA,kBAAA,KAACC,2BAAAA,mBAAD;EAAmB,OAAO;GAAE;GAAU;GAAM;GAAU,UAAU,CAAC,CAAC;GAAO;GAAS;YAChF,iBAAA,GAAA,kBAAA,KAACC,kBAAAA,WAAD;GACQ;GACC;GACE;GACT,WAAU;GACV,oBAAA;GACA,cAAc,UAAU;AACtB,UAAM,gBAAgB;AACtB,kBAAc,MAAM;AACpB,aAAS,SAAS,OAAO;;GAE3B,UAAU,UAAU;AAClB,UAAM,gBAAgB;AAEtB,QAAI,CADa,MAAM,cAAc,QAAQ,WAAW,EACzC,UAAU;AACvB,cAAS,SAAS,OAAO;AACzB,eAAU,MAAM;;;GAGpB,GAAI;GACJ,WAAA;GACU;GACV,kBAAkB,oBAAoB;GACtC,UAAU;GAET;GACS,CAAA;EACM,CAAA;EAEtB;AAEF,WAAW,cAAc;AACzB,WAAW,UAAUA,kBAAAA,UAAU;AAC/B,WAAW,QAAQC,wBAAAA"}
1
+ {"version":3,"file":"PillsInput.cjs","names":["factory","useProps","PillsInputContext","InputBase","PillsInputField"],"sources":["../../../src/components/PillsInput/PillsInput.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { BoxProps, ElementProps, factory, Factory, StylesApiProps, useProps } from '../../core';\nimport { __BaseInputProps, __InputStylesNames } from '../Input';\nimport { InputBase } from '../InputBase';\nimport { PillsInputContext, type PillsInputContextValue } from './PillsInput.context';\nimport {\n PillsInputField,\n type PillsInputFieldProps,\n type PillsInputFieldFactory,\n type PillsInputFieldStylesNames,\n} from './PillsInputField/PillsInputField';\nexport interface PillsInputProps\n extends\n BoxProps,\n __BaseInputProps,\n StylesApiProps<PillsInputFactory>,\n ElementProps<'div', 'size'> {\n __stylesApiProps?: Record<string, any>;\n __staticSelector?: string;\n}\n\nexport type PillsInputFactory = Factory<{\n props: PillsInputProps;\n ref: HTMLDivElement;\n stylesNames: __InputStylesNames;\n staticComponents: {\n Field: typeof PillsInputField;\n };\n}>;\n\nconst defaultProps = {\n size: 'sm',\n} satisfies Partial<PillsInputProps>;\n\nexport const PillsInput = factory<PillsInputFactory>((_props) => {\n const props = useProps('PillsInput', defaultProps, _props);\n const {\n children,\n onMouseDown,\n onClick,\n size,\n disabled,\n __staticSelector,\n error,\n variant,\n ...others\n } = props;\n\n const fieldRef = useRef<HTMLInputElement>(null);\n\n return (\n <PillsInputContext value={{ fieldRef, size, disabled, hasError: !!error, variant }}>\n <InputBase\n size={size}\n error={error}\n variant={variant}\n component=\"div\"\n data-no-overflow\n onMouseDown={(event) => {\n event.preventDefault();\n onMouseDown?.(event);\n fieldRef.current?.focus();\n }}\n onClick={(event) => {\n event.preventDefault();\n const fieldset = event.currentTarget.closest('fieldset');\n if (!fieldset?.disabled) {\n fieldRef.current?.focus();\n onClick?.(event);\n }\n }}\n {...others}\n multiline\n disabled={disabled}\n __staticSelector={__staticSelector || 'PillsInput'}\n withAria={false}\n >\n {children}\n </InputBase>\n </PillsInputContext>\n );\n});\n\nPillsInput.displayName = '@mantine/core/PillsInput';\nPillsInput.classes = InputBase.classes;\nPillsInput.Field = PillsInputField;\n\nexport namespace PillsInput {\n export type Props = PillsInputProps;\n export type Factory = PillsInputFactory;\n export type ContextValue = PillsInputContextValue;\n\n export namespace Field {\n export type Props = PillsInputFieldProps;\n export type Factory = PillsInputFieldFactory;\n export type StylesNames = PillsInputFieldStylesNames;\n }\n}\n"],"mappings":";;;;;;;;;;AA8BA,MAAM,eAAe,EACnB,MAAM,MACP;AAED,MAAa,aAAaA,gBAAAA,SAA4B,WAAW;CAE/D,MAAM,EACJ,UACA,aACA,SACA,MACA,UACA,kBACA,OACA,SACA,GAAG,WAVSC,kBAAAA,SAAS,cAAc,cAAc,OAAO;CAa1D,MAAM,YAAA,GAAA,MAAA,QAAoC,KAAK;AAE/C,QACE,iBAAA,GAAA,kBAAA,KAACC,2BAAAA,mBAAD;EAAmB,OAAO;GAAE;GAAU;GAAM;GAAU,UAAU,CAAC,CAAC;GAAO;GAAS;YAChF,iBAAA,GAAA,kBAAA,KAACC,kBAAAA,WAAD;GACQ;GACC;GACE;GACT,WAAU;GACV,oBAAA;GACA,cAAc,UAAU;AACtB,UAAM,gBAAgB;AACtB,kBAAc,MAAM;AACpB,aAAS,SAAS,OAAO;;GAE3B,UAAU,UAAU;AAClB,UAAM,gBAAgB;AAEtB,QAAI,CADa,MAAM,cAAc,QAAQ,WAAW,EACzC,UAAU;AACvB,cAAS,SAAS,OAAO;AACzB,eAAU,MAAM;;;GAGpB,GAAI;GACJ,WAAA;GACU;GACV,kBAAkB,oBAAoB;GACtC,UAAU;GAET;GACS,CAAA;EACM,CAAA;EAEtB;AAEF,WAAW,cAAc;AACzB,WAAW,UAAUA,kBAAAA,UAAU;AAC/B,WAAW,QAAQC,wBAAAA"}