@mantine/core 7.0.0-alpha.2 → 7.0.0-alpha.3
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.
- package/cjs/components/ActionIcon/ActionIcon.js +7 -5
- package/cjs/components/ActionIcon/ActionIcon.js.map +1 -1
- package/cjs/components/ActionIcon/ActionIconGroup/ActionIconGroup.js.map +1 -1
- package/cjs/components/Affix/Affix.js +109 -0
- package/cjs/components/Affix/Affix.js.map +1 -0
- package/cjs/components/Affix/Affix.module.css.js +8 -0
- package/cjs/components/Affix/Affix.module.css.js.map +1 -0
- package/cjs/components/Alert/Alert.js +147 -0
- package/cjs/components/Alert/Alert.js.map +1 -0
- package/cjs/components/Alert/Alert.module.css.js +8 -0
- package/cjs/components/Alert/Alert.module.css.js.map +1 -0
- package/cjs/components/Anchor/Anchor.js.map +1 -1
- package/cjs/components/AspectRatio/AspectRatio.js +73 -0
- package/cjs/components/AspectRatio/AspectRatio.js.map +1 -0
- package/cjs/components/AspectRatio/AspectRatio.module.css.js +8 -0
- package/cjs/components/AspectRatio/AspectRatio.module.css.js.map +1 -0
- package/cjs/components/Avatar/Avatar.js +140 -0
- package/cjs/components/Avatar/Avatar.js.map +1 -0
- package/cjs/components/Avatar/Avatar.module.css.js +8 -0
- package/cjs/components/Avatar/Avatar.module.css.js.map +1 -0
- package/cjs/components/Avatar/AvatarGroup/AvatarGroup.context.js +16 -0
- package/cjs/components/Avatar/AvatarGroup/AvatarGroup.context.js.map +1 -0
- package/cjs/components/Avatar/AvatarGroup/AvatarGroup.js +79 -0
- package/cjs/components/Avatar/AvatarGroup/AvatarGroup.js.map +1 -0
- package/cjs/components/Avatar/AvatarGroup/AvatarGroup.module.css.js +8 -0
- package/cjs/components/Avatar/AvatarGroup/AvatarGroup.module.css.js.map +1 -0
- package/cjs/components/Avatar/AvatarPlaceholderIcon.js +45 -0
- package/cjs/components/Avatar/AvatarPlaceholderIcon.js.map +1 -0
- package/cjs/components/BackgroundImage/BackgroundImage.js.map +1 -1
- package/cjs/components/Badge/Badge.js +134 -0
- package/cjs/components/Badge/Badge.js.map +1 -0
- package/cjs/components/Badge/Badge.module.css.js +8 -0
- package/cjs/components/Badge/Badge.module.css.js.map +1 -0
- package/cjs/components/Blockquote/Blockquote.js.map +1 -1
- package/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/cjs/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/cjs/components/Burger/Burger.js.map +1 -1
- package/cjs/components/Button/Button.js.map +1 -1
- package/cjs/components/Button/ButtonGroup/ButtonGroup.js.map +1 -1
- package/cjs/components/Center/Center.js.map +1 -1
- package/cjs/components/CloseButton/CloseButton.js.map +1 -1
- package/cjs/components/Code/Code.js.map +1 -1
- package/cjs/components/ColorPicker/ColorPicker.js.map +1 -1
- package/cjs/components/ColorPicker/converters/parsers.js +4 -4
- package/cjs/components/ColorPicker/converters/parsers.js.map +1 -1
- package/cjs/components/ColorSwatch/ColorSwatch.js +3 -3
- package/cjs/components/ColorSwatch/ColorSwatch.js.map +1 -1
- package/cjs/components/Container/Container.js.map +1 -1
- package/cjs/components/CopyButton/CopyButton.js.map +1 -1
- package/cjs/components/Divider/Divider.js +111 -0
- package/cjs/components/Divider/Divider.js.map +1 -0
- package/cjs/components/Divider/Divider.module.css.js +8 -0
- package/cjs/components/Divider/Divider.module.css.js.map +1 -0
- package/cjs/components/FileButton/FileButton.js.map +1 -1
- package/cjs/components/Group/Group.js.map +1 -1
- package/cjs/components/Input/Input.js.map +1 -1
- package/cjs/components/Input/InputWrapper/InputWrapper.js.map +1 -1
- package/cjs/components/Loader/Loader.js.map +1 -1
- package/cjs/components/Overlay/Overlay.js +121 -0
- package/cjs/components/Overlay/Overlay.js.map +1 -0
- package/cjs/components/Overlay/Overlay.module.css.js +8 -0
- package/cjs/components/Overlay/Overlay.module.css.js.map +1 -0
- package/cjs/components/Paper/Paper.js.map +1 -1
- package/cjs/components/Popover/Popover.js +1 -1
- package/cjs/components/Popover/Popover.js.map +1 -1
- package/cjs/components/ScrollArea/ScrollArea.context.js +11 -0
- package/cjs/components/ScrollArea/ScrollArea.context.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollArea.js +12 -29
- package/cjs/components/ScrollArea/ScrollArea.js.map +1 -1
- package/cjs/components/ScrollArea/ScrollArea.module.css.js +1 -1
- package/cjs/components/ScrollArea/ScrollAreaCorner/ScrollAreaCorner.js +78 -0
- package/cjs/components/ScrollArea/ScrollAreaCorner/ScrollAreaCorner.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.js +94 -0
- package/cjs/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbar.js +73 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbar.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarAuto.js +71 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarAuto.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarHover.js +80 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarHover.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarScroll.js +91 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarScroll.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarVisible.js +121 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarVisible.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.context.js +11 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.context.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.js +135 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollbarX.js +94 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollbarX.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollbarY.js +93 -0
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollbarY.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.js +108 -0
- package/cjs/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.js.map +1 -0
- package/cjs/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.js +63 -0
- package/cjs/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.js.map +1 -0
- package/cjs/components/ScrollArea/use-resize-observer.js +27 -0
- package/cjs/components/ScrollArea/use-resize-observer.js.map +1 -0
- package/cjs/components/ScrollArea/utils/add-unlinked-scroll-listener.js +22 -0
- package/cjs/components/ScrollArea/utils/add-unlinked-scroll-listener.js.map +1 -0
- package/cjs/components/ScrollArea/utils/compose-event-handlers.js +15 -0
- package/cjs/components/ScrollArea/utils/compose-event-handlers.js.map +1 -0
- package/cjs/components/ScrollArea/utils/get-scroll-position-from-pointer.js +22 -0
- package/cjs/components/ScrollArea/utils/get-scroll-position-from-pointer.js.map +1 -0
- package/cjs/components/ScrollArea/utils/get-thumb-offset-from-scroll.js +24 -0
- package/cjs/components/ScrollArea/utils/get-thumb-offset-from-scroll.js.map +1 -0
- package/cjs/components/ScrollArea/utils/get-thumb-ratio.js +11 -0
- package/cjs/components/ScrollArea/utils/get-thumb-ratio.js.map +1 -0
- package/cjs/components/ScrollArea/utils/get-thumb-size.js +15 -0
- package/cjs/components/ScrollArea/utils/get-thumb-size.js.map +1 -0
- package/cjs/components/ScrollArea/utils/is-scrolling-within-scrollbar-bounds.js +10 -0
- package/cjs/components/ScrollArea/utils/is-scrolling-within-scrollbar-bounds.js.map +1 -0
- package/cjs/components/ScrollArea/utils/linear-scale.js +15 -0
- package/cjs/components/ScrollArea/utils/linear-scale.js.map +1 -0
- package/cjs/components/ScrollArea/utils/to-int.js +10 -0
- package/cjs/components/ScrollArea/utils/to-int.js.map +1 -0
- package/cjs/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/cjs/components/Slider/RangeSlider/RangeSlider.js +4 -11
- package/cjs/components/Slider/RangeSlider/RangeSlider.js.map +1 -1
- package/cjs/components/Slider/Slider/Slider.js +4 -11
- package/cjs/components/Slider/Slider/Slider.js.map +1 -1
- package/cjs/components/Slider/Thumb/Thumb.js +5 -8
- package/cjs/components/Slider/Thumb/Thumb.js.map +1 -1
- package/cjs/components/Stack/Stack.js.map +1 -1
- package/cjs/components/Switch/Switch.js.map +1 -1
- package/cjs/components/Switch/SwitchGroup/SwitchGroup.js.map +1 -1
- package/cjs/components/Table/Table.js.map +1 -1
- package/cjs/components/Tabs/Tabs.js.map +1 -1
- package/cjs/components/Tabs/Tabs.module.css.js +1 -1
- package/cjs/components/Tabs/TabsList/TabsList.js.map +1 -1
- package/cjs/components/Tabs/TabsTab/TabsTab.js +5 -1
- package/cjs/components/Tabs/TabsTab/TabsTab.js.map +1 -1
- package/cjs/components/Text/Text.js +1 -1
- package/cjs/components/Text/Text.js.map +1 -1
- package/cjs/components/Tooltip/Tooltip.js +1 -1
- package/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/cjs/components/Tooltip/use-tooltip.js.map +1 -1
- package/cjs/components/TypographyStylesProvider/TypographyStylesProvider.js +65 -0
- package/cjs/components/TypographyStylesProvider/TypographyStylesProvider.js.map +1 -0
- package/cjs/components/TypographyStylesProvider/TypographyStylesProvider.module.css.js +8 -0
- package/cjs/components/TypographyStylesProvider/TypographyStylesProvider.module.css.js.map +1 -0
- package/cjs/core/Box/style-props/resolvers/font-size-resolver/font-size-resolver.js +3 -0
- package/cjs/core/Box/style-props/resolvers/font-size-resolver/font-size-resolver.js.map +1 -1
- package/cjs/core/Box/style-props/resolvers/spacing-resolver/spacing-resolver.js +1 -1
- package/cjs/core/Box/style-props/resolvers/spacing-resolver/spacing-resolver.js.map +1 -1
- package/cjs/core/MantineProvider/MantineCssVariables/MantineCssVariables.js +15 -8
- package/cjs/core/MantineProvider/MantineCssVariables/MantineCssVariables.js.map +1 -1
- package/cjs/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.js +1 -0
- package/cjs/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.js.map +1 -1
- package/cjs/core/MantineProvider/MantineCssVariables/remove-default-variables.js +35 -0
- package/cjs/core/MantineProvider/MantineCssVariables/remove-default-variables.js.map +1 -0
- package/cjs/core/MantineProvider/MantineProvider.js.map +1 -1
- package/cjs/core/MantineProvider/convert-css-variables/convert-css-variables.js +6 -5
- package/cjs/core/MantineProvider/convert-css-variables/convert-css-variables.js.map +1 -1
- package/cjs/core/MantineProvider/default-theme.js +28 -26
- package/cjs/core/MantineProvider/default-theme.js.map +1 -1
- package/cjs/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.js +39 -2
- package/cjs/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.js.map +1 -1
- package/cjs/core/utils/units-converters/px.js +21 -10
- package/cjs/core/utils/units-converters/px.js.map +1 -1
- package/cjs/core/utils/units-converters/rem.js +23 -9
- package/cjs/core/utils/units-converters/rem.js.map +1 -1
- package/cjs/index.css +1687 -285
- package/cjs/index.js +16 -0
- package/cjs/index.js.map +1 -1
- package/esm/components/ActionIcon/ActionIcon.js +7 -5
- package/esm/components/ActionIcon/ActionIcon.js.map +1 -1
- package/esm/components/ActionIcon/ActionIconGroup/ActionIconGroup.js.map +1 -1
- package/esm/components/Affix/Affix.js +101 -0
- package/esm/components/Affix/Affix.js.map +1 -0
- package/esm/components/Affix/Affix.module.css.js +4 -0
- package/esm/components/Affix/Affix.module.css.js.map +1 -0
- package/esm/components/Alert/Alert.js +139 -0
- package/esm/components/Alert/Alert.js.map +1 -0
- package/esm/components/Alert/Alert.module.css.js +4 -0
- package/esm/components/Alert/Alert.module.css.js.map +1 -0
- package/esm/components/Anchor/Anchor.js.map +1 -1
- package/esm/components/AspectRatio/AspectRatio.js +65 -0
- package/esm/components/AspectRatio/AspectRatio.js.map +1 -0
- package/esm/components/AspectRatio/AspectRatio.module.css.js +4 -0
- package/esm/components/AspectRatio/AspectRatio.module.css.js.map +1 -0
- package/esm/components/Avatar/Avatar.js +132 -0
- package/esm/components/Avatar/Avatar.js.map +1 -0
- package/esm/components/Avatar/Avatar.module.css.js +4 -0
- package/esm/components/Avatar/Avatar.module.css.js.map +1 -0
- package/esm/components/Avatar/AvatarGroup/AvatarGroup.context.js +11 -0
- package/esm/components/Avatar/AvatarGroup/AvatarGroup.context.js.map +1 -0
- package/esm/components/Avatar/AvatarGroup/AvatarGroup.js +71 -0
- package/esm/components/Avatar/AvatarGroup/AvatarGroup.js.map +1 -0
- package/esm/components/Avatar/AvatarGroup/AvatarGroup.module.css.js +4 -0
- package/esm/components/Avatar/AvatarGroup/AvatarGroup.module.css.js.map +1 -0
- package/esm/components/Avatar/AvatarPlaceholderIcon.js +37 -0
- package/esm/components/Avatar/AvatarPlaceholderIcon.js.map +1 -0
- package/esm/components/BackgroundImage/BackgroundImage.js.map +1 -1
- package/esm/components/Badge/Badge.js +126 -0
- package/esm/components/Badge/Badge.js.map +1 -0
- package/esm/components/Badge/Badge.module.css.js +4 -0
- package/esm/components/Badge/Badge.module.css.js.map +1 -0
- package/esm/components/Blockquote/Blockquote.js.map +1 -1
- package/esm/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/esm/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/esm/components/Burger/Burger.js.map +1 -1
- package/esm/components/Button/Button.js.map +1 -1
- package/esm/components/Button/ButtonGroup/ButtonGroup.js.map +1 -1
- package/esm/components/Center/Center.js.map +1 -1
- package/esm/components/CloseButton/CloseButton.js.map +1 -1
- package/esm/components/Code/Code.js.map +1 -1
- package/esm/components/ColorPicker/ColorPicker.js.map +1 -1
- package/esm/components/ColorPicker/converters/parsers.js +4 -4
- package/esm/components/ColorPicker/converters/parsers.js.map +1 -1
- package/esm/components/ColorSwatch/ColorSwatch.js +3 -3
- package/esm/components/ColorSwatch/ColorSwatch.js.map +1 -1
- package/esm/components/Container/Container.js.map +1 -1
- package/esm/components/CopyButton/CopyButton.js.map +1 -1
- package/esm/components/Divider/Divider.js +103 -0
- package/esm/components/Divider/Divider.js.map +1 -0
- package/esm/components/Divider/Divider.module.css.js +4 -0
- package/esm/components/Divider/Divider.module.css.js.map +1 -0
- package/esm/components/FileButton/FileButton.js.map +1 -1
- package/esm/components/Group/Group.js.map +1 -1
- package/esm/components/Input/Input.js.map +1 -1
- package/esm/components/Input/InputWrapper/InputWrapper.js.map +1 -1
- package/esm/components/Loader/Loader.js.map +1 -1
- package/esm/components/Overlay/Overlay.js +113 -0
- package/esm/components/Overlay/Overlay.js.map +1 -0
- package/esm/components/Overlay/Overlay.module.css.js +4 -0
- package/esm/components/Overlay/Overlay.module.css.js.map +1 -0
- package/esm/components/Paper/Paper.js.map +1 -1
- package/esm/components/Popover/Popover.js +1 -1
- package/esm/components/Popover/Popover.js.map +1 -1
- package/esm/components/ScrollArea/ScrollArea.context.js +6 -0
- package/esm/components/ScrollArea/ScrollArea.context.js.map +1 -0
- package/esm/components/ScrollArea/ScrollArea.js +12 -16
- package/esm/components/ScrollArea/ScrollArea.js.map +1 -1
- package/esm/components/ScrollArea/ScrollArea.module.css.js +1 -1
- package/esm/components/ScrollArea/ScrollAreaCorner/ScrollAreaCorner.js +69 -0
- package/esm/components/ScrollArea/ScrollAreaCorner/ScrollAreaCorner.js.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.js +86 -0
- package/esm/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.js.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbar.js +65 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbar.js.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarAuto.js +63 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarAuto.js.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarHover.js +72 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarHover.js.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarScroll.js +83 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarScroll.js.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarVisible.js +113 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarVisible.js.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.context.js +6 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.context.js.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.js +127 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.js.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollbarX.js +86 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollbarX.js.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollbarY.js +85 -0
- package/esm/components/ScrollArea/ScrollAreaScrollbar/ScrollbarY.js.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.js +99 -0
- package/esm/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.js.map +1 -0
- package/esm/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.js +55 -0
- package/esm/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.js.map +1 -0
- package/esm/components/ScrollArea/use-resize-observer.js +23 -0
- package/esm/components/ScrollArea/use-resize-observer.js.map +1 -0
- package/esm/components/ScrollArea/utils/add-unlinked-scroll-listener.js +18 -0
- package/esm/components/ScrollArea/utils/add-unlinked-scroll-listener.js.map +1 -0
- package/esm/components/ScrollArea/utils/compose-event-handlers.js +11 -0
- package/esm/components/ScrollArea/utils/compose-event-handlers.js.map +1 -0
- package/esm/components/ScrollArea/utils/get-scroll-position-from-pointer.js +18 -0
- package/esm/components/ScrollArea/utils/get-scroll-position-from-pointer.js.map +1 -0
- package/esm/components/ScrollArea/utils/get-thumb-offset-from-scroll.js +20 -0
- package/esm/components/ScrollArea/utils/get-thumb-offset-from-scroll.js.map +1 -0
- package/esm/components/ScrollArea/utils/get-thumb-ratio.js +7 -0
- package/esm/components/ScrollArea/utils/get-thumb-ratio.js.map +1 -0
- package/esm/components/ScrollArea/utils/get-thumb-size.js +11 -0
- package/esm/components/ScrollArea/utils/get-thumb-size.js.map +1 -0
- package/esm/components/ScrollArea/utils/is-scrolling-within-scrollbar-bounds.js +6 -0
- package/esm/components/ScrollArea/utils/is-scrolling-within-scrollbar-bounds.js.map +1 -0
- package/esm/components/ScrollArea/utils/linear-scale.js +11 -0
- package/esm/components/ScrollArea/utils/linear-scale.js.map +1 -0
- package/esm/components/ScrollArea/utils/to-int.js +6 -0
- package/esm/components/ScrollArea/utils/to-int.js.map +1 -0
- package/esm/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/esm/components/Slider/RangeSlider/RangeSlider.js +4 -11
- package/esm/components/Slider/RangeSlider/RangeSlider.js.map +1 -1
- package/esm/components/Slider/Slider/Slider.js +4 -11
- package/esm/components/Slider/Slider/Slider.js.map +1 -1
- package/esm/components/Slider/Thumb/Thumb.js +5 -8
- package/esm/components/Slider/Thumb/Thumb.js.map +1 -1
- package/esm/components/Stack/Stack.js.map +1 -1
- package/esm/components/Switch/Switch.js.map +1 -1
- package/esm/components/Switch/SwitchGroup/SwitchGroup.js.map +1 -1
- package/esm/components/Table/Table.js.map +1 -1
- package/esm/components/Tabs/Tabs.js.map +1 -1
- package/esm/components/Tabs/Tabs.module.css.js +1 -1
- package/esm/components/Tabs/TabsList/TabsList.js.map +1 -1
- package/esm/components/Tabs/TabsTab/TabsTab.js +5 -1
- package/esm/components/Tabs/TabsTab/TabsTab.js.map +1 -1
- package/esm/components/Text/Text.js +1 -1
- package/esm/components/Text/Text.js.map +1 -1
- package/esm/components/Tooltip/Tooltip.js +1 -1
- package/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/esm/components/Tooltip/use-tooltip.js.map +1 -1
- package/esm/components/TypographyStylesProvider/TypographyStylesProvider.js +57 -0
- package/esm/components/TypographyStylesProvider/TypographyStylesProvider.js.map +1 -0
- package/esm/components/TypographyStylesProvider/TypographyStylesProvider.module.css.js +4 -0
- package/esm/components/TypographyStylesProvider/TypographyStylesProvider.module.css.js.map +1 -0
- package/esm/core/Box/style-props/resolvers/font-size-resolver/font-size-resolver.js +3 -0
- package/esm/core/Box/style-props/resolvers/font-size-resolver/font-size-resolver.js.map +1 -1
- package/esm/core/Box/style-props/resolvers/spacing-resolver/spacing-resolver.js +1 -1
- package/esm/core/Box/style-props/resolvers/spacing-resolver/spacing-resolver.js.map +1 -1
- package/esm/core/MantineProvider/MantineCssVariables/MantineCssVariables.js +15 -8
- package/esm/core/MantineProvider/MantineCssVariables/MantineCssVariables.js.map +1 -1
- package/esm/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.js +1 -0
- package/esm/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.js.map +1 -1
- package/esm/core/MantineProvider/MantineCssVariables/remove-default-variables.js +31 -0
- package/esm/core/MantineProvider/MantineCssVariables/remove-default-variables.js.map +1 -0
- package/esm/core/MantineProvider/MantineProvider.js.map +1 -1
- package/esm/core/MantineProvider/convert-css-variables/convert-css-variables.js +6 -5
- package/esm/core/MantineProvider/convert-css-variables/convert-css-variables.js.map +1 -1
- package/esm/core/MantineProvider/default-theme.js +28 -26
- package/esm/core/MantineProvider/default-theme.js.map +1 -1
- package/esm/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.js +40 -3
- package/esm/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.js.map +1 -1
- package/esm/core/utils/units-converters/px.js +21 -10
- package/esm/core/utils/units-converters/px.js.map +1 -1
- package/esm/core/utils/units-converters/rem.js +23 -9
- package/esm/core/utils/units-converters/rem.js.map +1 -1
- package/esm/index.css +1687 -285
- package/esm/index.js +8 -0
- package/esm/index.js.map +1 -1
- package/lib/components/ActionIcon/ActionIcon.d.ts +9 -8
- package/lib/components/ActionIcon/ActionIconGroup/ActionIconGroup.d.ts +3 -3
- package/lib/components/Affix/Affix.d.ts +37 -0
- package/lib/components/Affix/index.d.ts +2 -0
- package/lib/components/Alert/Alert.d.ts +37 -0
- package/lib/components/Alert/index.d.ts +2 -0
- package/lib/components/Anchor/Anchor.d.ts +1 -1
- package/lib/components/AspectRatio/AspectRatio.d.ts +24 -0
- package/lib/components/AspectRatio/index.d.ts +2 -0
- package/lib/components/Avatar/Avatar.d.ts +56 -0
- package/lib/components/Avatar/AvatarGroup/AvatarGroup.context.d.ts +5 -0
- package/lib/components/Avatar/AvatarGroup/AvatarGroup.d.ts +24 -0
- package/lib/components/Avatar/AvatarPlaceholderIcon.d.ts +2 -0
- package/lib/components/Avatar/index.d.ts +3 -0
- package/lib/components/BackgroundImage/BackgroundImage.d.ts +1 -1
- package/lib/components/Badge/Badge.d.ts +47 -0
- package/lib/components/Badge/index.d.ts +2 -0
- package/lib/components/Blockquote/Blockquote.d.ts +2 -2
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/lib/components/Burger/Burger.d.ts +1 -1
- package/lib/components/Button/Button.d.ts +5 -5
- package/lib/components/Button/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/lib/components/Center/Center.d.ts +2 -2
- package/lib/components/CloseButton/CloseButton.d.ts +1 -1
- package/lib/components/Code/Code.d.ts +2 -2
- package/lib/components/ColorPicker/ColorPicker.d.ts +7 -7
- package/lib/components/ColorSwatch/ColorSwatch.d.ts +5 -4
- package/lib/components/Container/Container.d.ts +1 -1
- package/lib/components/CopyButton/CopyButton.d.ts +1 -1
- package/lib/components/Divider/Divider.d.ts +33 -0
- package/lib/components/Divider/index.d.ts +2 -0
- package/lib/components/FileButton/FileButton.d.ts +3 -3
- package/lib/components/Group/Group.d.ts +1 -1
- package/lib/components/Input/Input.d.ts +10 -10
- package/lib/components/Input/InputWrapper/InputWrapper.d.ts +3 -3
- package/lib/components/Input/use-input-props.d.ts +10 -10
- package/lib/components/Loader/Loader.d.ts +1 -1
- package/lib/components/Overlay/Overlay.d.ts +49 -0
- package/lib/components/Overlay/index.d.ts +2 -0
- package/lib/components/Paper/Paper.d.ts +2 -2
- package/lib/components/Popover/Popover.d.ts +16 -16
- package/lib/components/Popover/use-popover.d.ts +1 -32
- package/lib/components/ScrollArea/ScrollArea.context.d.ts +23 -0
- package/lib/components/ScrollArea/ScrollArea.d.ts +2 -2
- package/lib/components/ScrollArea/ScrollArea.types.d.ts +23 -0
- package/lib/components/ScrollArea/ScrollAreaCorner/ScrollAreaCorner.d.ts +6 -0
- package/lib/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.d.ts +30 -0
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbar.d.ts +7 -0
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarAuto.d.ts +6 -0
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarHover.d.ts +7 -0
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarScroll.d.ts +7 -0
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarVisible.d.ts +6 -0
- package/lib/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.context.d.ts +15 -0
- package/lib/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.d.ts +21 -0
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollbarX.d.ts +3 -0
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollbarY.d.ts +3 -0
- package/lib/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.d.ts +9 -0
- package/lib/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.d.ts +5 -0
- package/lib/components/ScrollArea/use-resize-observer.d.ts +1 -0
- package/lib/components/ScrollArea/utils/add-unlinked-scroll-listener.d.ts +1 -0
- package/lib/components/ScrollArea/utils/compose-event-handlers.d.ts +3 -0
- package/lib/components/ScrollArea/utils/get-scroll-position-from-pointer.d.ts +2 -0
- package/lib/components/ScrollArea/utils/get-thumb-offset-from-scroll.d.ts +2 -0
- package/lib/components/ScrollArea/utils/get-thumb-ratio.d.ts +1 -0
- package/lib/components/ScrollArea/utils/get-thumb-size.d.ts +2 -0
- package/lib/components/ScrollArea/utils/index.d.ts +8 -0
- package/lib/components/ScrollArea/utils/is-scrolling-within-scrollbar-bounds.d.ts +1 -0
- package/lib/components/ScrollArea/utils/linear-scale.d.ts +1 -0
- package/lib/components/ScrollArea/utils/to-int.d.ts +1 -0
- package/lib/components/SegmentedControl/SegmentedControl.d.ts +5 -5
- package/lib/components/Slider/RangeSlider/RangeSlider.d.ts +10 -14
- package/lib/components/Slider/Slider/Slider.d.ts +10 -14
- package/lib/components/Slider/Thumb/Thumb.d.ts +2 -4
- package/lib/components/Stack/Stack.d.ts +1 -1
- package/lib/components/Switch/Switch.d.ts +3 -3
- package/lib/components/Switch/SwitchGroup/SwitchGroup.d.ts +3 -3
- package/lib/components/Table/Table.d.ts +6 -6
- package/lib/components/Tabs/Tabs.d.ts +10 -10
- package/lib/components/Tabs/TabsList/TabsList.d.ts +2 -2
- package/lib/components/Tabs/TabsTab/TabsTab.d.ts +3 -3
- package/lib/components/Text/Text.d.ts +2 -2
- package/lib/components/Tooltip/Tooltip.d.ts +7 -7
- package/lib/components/Tooltip/Tooltip.types.d.ts +2 -2
- package/lib/components/Tooltip/use-tooltip.d.ts +2 -2
- package/lib/components/TypographyStylesProvider/TypographyStylesProvider.d.ts +17 -0
- package/lib/components/TypographyStylesProvider/index.d.ts +2 -0
- package/lib/components/index.d.ts +8 -0
- package/lib/core/MantineProvider/MantineCssVariables/MantineCssVariables.d.ts +1 -1
- package/lib/core/MantineProvider/MantineCssVariables/remove-default-variables.d.ts +2 -0
- package/lib/core/MantineProvider/MantineProvider.d.ts +1 -0
- package/lib/core/MantineProvider/theme.types.d.ts +2 -0
- package/lib/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.d.ts +3 -2
- package/lib/core/utils/units-converters/px.d.ts +1 -1
- package/lib/core/utils/units-converters/rem.d.ts +2 -2
- package/package.json +3 -5
- package/styles.css +1687 -285
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileButton.js","sources":["../../../src/components/FileButton/FileButton.tsx"],"sourcesContent":["/* eslint-disable react/no-unused-prop-types */\nimport React, { useRef, forwardRef } from 'react';\nimport { assignRef, useMergedRef } from '@mantine/hooks';\nimport { useProps } from '../../core';\n\nexport interface FileButtonProps<Multiple extends boolean = false> {\n /** Called when files are picked */\n onChange(payload: Multiple extends true ? File[] : File | null): void;\n\n /** Function that receives button props and returns react node that should be rendered */\n children(props: { onClick(): void }): React.ReactNode;\n\n /** Determines whether user can pick more than one file */\n multiple?: Multiple;\n\n /** File input accept attribute, for example,
|
|
1
|
+
{"version":3,"file":"FileButton.js","sources":["../../../src/components/FileButton/FileButton.tsx"],"sourcesContent":["/* eslint-disable react/no-unused-prop-types */\nimport React, { useRef, forwardRef } from 'react';\nimport { assignRef, useMergedRef } from '@mantine/hooks';\nimport { useProps } from '../../core';\n\nexport interface FileButtonProps<Multiple extends boolean = false> {\n /** Called when files are picked */\n onChange(payload: Multiple extends true ? File[] : File | null): void;\n\n /** Function that receives button props and returns react node that should be rendered */\n children(props: { onClick(): void }): React.ReactNode;\n\n /** Determines whether user can pick more than one file */\n multiple?: Multiple;\n\n /** File input accept attribute, for example, `\"image/png,image/jpeg\"` */\n accept?: string;\n\n /** Input name attribute */\n name?: string;\n\n /** Input form attribute */\n form?: string;\n\n /** Reference of the function that should be called when value changes to null or empty array */\n resetRef?: React.ForwardedRef<() => void>;\n\n /** Disables file picker */\n disabled?: boolean;\n\n /** Specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the accept attribute. */\n capture?: boolean | 'user' | 'environment';\n\n /** Passes down props to the input element used to capture files */\n inputProps?: React.ComponentPropsWithoutRef<'input'>;\n}\n\nconst defaultProps: Partial<FileButtonProps> = {\n multiple: false,\n};\n\ntype FileButtonComponent = (<Multiple extends boolean = false>(\n props: FileButtonProps<Multiple>\n) => React.ReactElement) & { displayName?: string };\n\nexport const FileButton: FileButtonComponent = forwardRef<HTMLInputElement, FileButtonProps>(\n (props, ref) => {\n const {\n onChange,\n children,\n multiple,\n accept,\n name,\n form,\n resetRef,\n disabled,\n capture,\n inputProps,\n ...others\n } = useProps('FileButton', defaultProps, props);\n\n const inputRef = useRef<HTMLInputElement>();\n\n const onClick = () => {\n !disabled && inputRef.current?.click();\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (multiple) {\n onChange(Array.from(event.currentTarget!.files!) as any);\n } else {\n onChange(event.currentTarget!.files![0] || null);\n }\n };\n\n const reset = () => {\n inputRef.current!.value = '';\n };\n\n assignRef(resetRef!, reset);\n\n return (\n <>\n {children({ onClick, ...others })}\n\n <input\n style={{ display: 'none' }}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n onChange={handleChange}\n ref={useMergedRef(ref, inputRef)}\n name={name}\n form={form}\n capture={capture}\n {...inputProps}\n />\n </>\n );\n }\n) as any;\n\nFileButton.displayName = '@mantine/core/FileButton';\n"],"names":[],"mappings":";;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;A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../../../src/components/Group/Group.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n MantineSpacing,\n getSpacing,\n createVarsResolver,\n Factory,\n} from '../../core';\nimport { filterFalsyChildren } from './filter-falsy-children/filter-falsy-children';\nimport classes from './Group.module.css';\n\nexport type GroupStylesNames = 'root';\nexport type GroupVariant = string;\nexport type GroupCssVariables = {\n root:\n | '--group-gap'\n | '--group-align'\n | '--group-justify'\n | '--group-wrap'\n | '--group-child-width';\n};\n\nexport interface GroupStylesCtx {\n childWidth: string;\n}\n\nexport interface GroupProps extends BoxProps, StylesApiProps<GroupFactory>, ElementProps<'div'> {\n /** Controls `justify-content` CSS property, `'flex-start'` by default */\n justify?: React.CSSProperties['justifyContent'];\n\n /** Controls `align-items` CSS property, `'center'` by default */\n align?: React.CSSProperties['alignItems'];\n\n /** Controls `flex-wrap` CSS property, `'wrap'` by default */\n wrap?: React.CSSProperties['flexWrap'];\n\n /** Key of `theme.spacing` or any valid CSS value for `gap`, numbers are converted to rem
|
|
1
|
+
{"version":3,"file":"Group.js","sources":["../../../src/components/Group/Group.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n MantineSpacing,\n getSpacing,\n createVarsResolver,\n Factory,\n} from '../../core';\nimport { filterFalsyChildren } from './filter-falsy-children/filter-falsy-children';\nimport classes from './Group.module.css';\n\nexport type GroupStylesNames = 'root';\nexport type GroupVariant = string;\nexport type GroupCssVariables = {\n root:\n | '--group-gap'\n | '--group-align'\n | '--group-justify'\n | '--group-wrap'\n | '--group-child-width';\n};\n\nexport interface GroupStylesCtx {\n childWidth: string;\n}\n\nexport interface GroupProps extends BoxProps, StylesApiProps<GroupFactory>, ElementProps<'div'> {\n /** Controls `justify-content` CSS property, `'flex-start'` by default */\n justify?: React.CSSProperties['justifyContent'];\n\n /** Controls `align-items` CSS property, `'center'` by default */\n align?: React.CSSProperties['alignItems'];\n\n /** Controls `flex-wrap` CSS property, `'wrap'` by default */\n wrap?: React.CSSProperties['flexWrap'];\n\n /** Key of `theme.spacing` or any valid CSS value for `gap`, numbers are converted to rem, `'md'` by default */\n gap?: MantineSpacing | (string & {}) | number;\n\n /** Determines whether each child element should have `flex-grow: 1` style, `false` by default */\n grow?: boolean;\n\n /** Determines whether children should take only dedicated amount of space (`max-width` style is set based on the number of children), `true` by default */\n preventGrowOverflow?: boolean;\n}\n\nexport type GroupFactory = Factory<{\n props: GroupProps;\n ref: HTMLDivElement;\n stylesNames: GroupStylesNames;\n vars: GroupCssVariables;\n ctx: GroupStylesCtx;\n variant: GroupVariant;\n}>;\n\nconst defaultProps: Partial<GroupProps> = {\n justify: 'flex-start',\n align: 'center',\n gap: 'md',\n preventGrowOverflow: true,\n};\n\nconst varsResolver = createVarsResolver<GroupFactory>(\n (_, { grow, preventGrowOverflow, gap, align, justify, wrap }, { childWidth }) => ({\n root: {\n '--group-child-width': grow && preventGrowOverflow ? childWidth : undefined,\n '--group-gap': getSpacing(gap),\n '--group-align': align,\n '--group-justify': justify,\n '--group-wrap': wrap,\n },\n })\n);\n\nexport const Group = factory<GroupFactory>((_props, ref) => {\n const props = useProps('Group', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n children,\n gap,\n align,\n justify,\n wrap,\n grow,\n preventGrowOverflow,\n vars,\n variant,\n ...others\n } = props;\n\n const filteredChildren = filterFalsyChildren(children);\n const childrenCount = filteredChildren.length;\n const childWidth = `calc(${100 / childrenCount}% - (${getSpacing(gap)} - ${getSpacing(\n gap\n )} / ${childrenCount}))`;\n\n const stylesCtx: GroupStylesCtx = { childWidth };\n\n const getStyles = useStyles<GroupFactory>({\n name: 'Group',\n props,\n stylesCtx,\n className,\n style,\n classes,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n return (\n <Box {...getStyles('root')} ref={ref} variant={variant} mod={{ grow }}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AAC,GAAG,CAAC,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC;AACpH,EAAE,MAAM,SAAS,GAAG,EAAE,UAAU,EAAE,CAAC;AACnC,EAAE,MAAM,SAAS,GAAG,SAAS,CAAC;AAC9B,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,KAAK;AACT,IAAI,SAAS;AACb,IAAI,SAAS;AACb,IAAI,KAAK;AACT,IAAI,OAAO;AACX,IAAI,UAAU;AACd,IAAI,MAAM;AACV,IAAI,QAAQ;AACZ,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,GAAG,CAAC,CAAC;AACL,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,cAAc,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE;AACtH,IAAI,GAAG;AACP,IAAI,OAAO;AACX,IAAI,GAAG,EAAE,EAAE,IAAI,EAAE;AACjB,GAAG,CAAC,EAAE,MAAM,CAAC,EAAE,gBAAgB,CAAC,CAAC;AACjC,CAAC,EAAE;AACH,KAAK,CAAC,WAAW,GAAG,qBAAqB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n polymorphicFactory,\n useProps,\n useStyles,\n MantineRadius,\n MantineSize,\n extractStyleProps,\n getSize,\n getFontSize,\n getRadius,\n rem,\n createVarsResolver,\n PolymorphicFactory,\n} from '../../core';\nimport { useInputWrapperContext } from './InputWrapper.context';\nimport { InputLabel } from './InputLabel/InputLabel';\nimport { InputError } from './InputError/InputError';\nimport { InputDescription } from './InputDescription/InputDescription';\nimport { InputPlaceholder } from './InputPlaceholder/InputPlaceholder';\nimport {\n InputWrapper,\n __InputWrapperProps,\n InputWrapperStylesNames,\n} from './InputWrapper/InputWrapper';\nimport classes from './Input.module.css';\n\nexport interface __BaseInputProps extends __InputWrapperProps, __InputProps {}\nexport type __InputStylesNames = InputStylesNames | InputWrapperStylesNames;\n\nexport type InputStylesNames = 'input' | 'wrapper' | 'section';\nexport type InputVariant = 'default' | 'filled' | 'unstyled';\nexport type InputCssVariables = {\n wrapper:\n | '--input-height'\n | '--input-fz'\n | '--input-radius'\n | '--input-left-section-width'\n | '--input-right-section-width'\n | '--input-left-section-pointer-events'\n | '--input-right-section-pointer-events'\n | '--input-padding-y'\n | '--input-margin-top'\n | '--input-margin-bottom';\n};\n\nexport interface InputStylesCtx {\n offsetTop: boolean;\n offsetBottom: boolean;\n}\n\nexport interface __InputProps {\n /** Content section rendered on the left side of the input */\n leftSection?: React.ReactNode;\n\n /** Left section width, used to set `width` of the section and input `padding-left`, by default equals to input height */\n leftSectionWidth?: React.CSSProperties['width'];\n\n /** Props added to `leftSection` element */\n leftSectionProps?: React.ComponentPropsWithoutRef<'div'>;\n\n /** Sets `pointer-events` styles of `leftSection` node, `'none'` by default */\n leftSectionPointerEvents?: React.CSSProperties['pointerEvents'];\n\n /** Content section rendered on the right side of the input */\n rightSection?: React.ReactNode;\n\n /** Right section width, used to set `width` of the section and input `padding-right`, by default equals to input height */\n rightSectionWidth?: React.CSSProperties['width'];\n\n /** Props added to `rightSection` element */\n rightSectionProps?: React.ComponentPropsWithoutRef<'div'>;\n\n /** Sets `pointer-events` styles of `rightSection` node, `'none'` by default */\n rightSectionPointerEvents?: React.CSSProperties['pointerEvents'];\n\n /** Props added to root element of `Input` component */\n wrapperProps?: React.ComponentPropsWithoutRef<'div'>;\n\n /** Sets `required` attribute on the `input` element */\n required?: boolean;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius`, numbers are converted to rem (1rem = 16px), `theme.defaultRadius` by default */\n radius?: MantineRadius | (string & {}) | number;\n\n /** Sets `disabled` attribute on the `input` element */\n disabled?: boolean;\n\n /** Input size */\n size?: MantineSize | (string & {});\n\n /** Determines whether the input should have `cursor: pointer` style, `false` by default */\n pointer?: boolean;\n}\n\nexport interface InputProps extends BoxProps, __InputProps, StylesApiProps<InputFactory> {\n __staticSelector?: string;\n\n /** Props passed to Styles API context, replaces Input.Wrapper props */\n __stylesApiProps?: Record<string, any>;\n\n /** Determines whether the input should have error styles and `aria-invalid` attribute */\n error?: React.ReactNode;\n\n /** Determines whether the input can have multiple lines, for example when `component=\"textarea\"`, `false` by default */\n multiline?: boolean;\n}\n\nexport type InputFactory = PolymorphicFactory<{\n props: InputProps;\n defaultRef: HTMLInputElement;\n defaultComponent: 'input';\n stylesNames: InputStylesNames;\n variant: InputVariant;\n vars: InputCssVariables;\n ctx: InputStylesCtx;\n staticComponents: {\n Label: typeof InputLabel;\n Error: typeof InputError;\n Description: typeof InputDescription;\n Placeholder: typeof InputPlaceholder;\n Wrapper: typeof InputWrapper;\n };\n}>;\n\nconst defaultProps: Partial<InputProps> = {\n size: 'sm',\n variant: 'default',\n leftSectionPointerEvents: 'none',\n rightSectionPointerEvents: 'none',\n};\n\nconst varsResolver = createVarsResolver<InputFactory>((_, props, ctx) => ({\n wrapper: {\n '--input-margin-top': ctx.offsetTop ? 'calc(var(--mantine-spacing-xs) / 2)' : undefined,\n '--input-margin-bottom': ctx.offsetBottom ? 'calc(var(--mantine-spacing-xs) / 2)' : undefined,\n '--input-height': getSize(props.size, 'input-height'),\n '--input-fz': getFontSize(props.size),\n '--input-radius': getRadius(props.radius),\n '--input-left-section-width':\n props.leftSectionWidth !== undefined ? rem(props.leftSectionWidth) : undefined,\n '--input-right-section-width':\n props.rightSectionWidth !== undefined ? rem(props.rightSectionWidth) : undefined,\n '--input-padding-y': props.multiline ? getSize(props.size, 'input-padding-y') : undefined,\n '--input-left-section-pointer-events': props.leftSectionPointerEvents,\n '--input-right-section-pointer-events': props.rightSectionPointerEvents,\n },\n}));\n\nexport const Input = polymorphicFactory<InputFactory>((_props, ref) => {\n const props = useProps('Input', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n required,\n __staticSelector,\n __stylesApiProps,\n size,\n wrapperProps,\n error,\n disabled,\n leftSection,\n leftSectionProps,\n leftSectionWidth,\n rightSection,\n rightSectionProps,\n rightSectionWidth,\n rightSectionPointerEvents,\n leftSectionPointerEvents,\n variant,\n vars,\n pointer,\n multiline,\n radius,\n ...others\n } = props;\n\n const { styleProps, rest } = extractStyleProps(others);\n const ctx = useInputWrapperContext();\n const stylesCtx: InputStylesCtx = { offsetBottom: ctx.offsetBottom, offsetTop: ctx.offsetTop };\n\n const getStyles = useStyles<InputFactory>({\n name: ['Input', __staticSelector],\n props: __stylesApiProps || props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n stylesCtx,\n rootSelector: 'wrapper',\n vars,\n varsResolver,\n });\n\n return (\n <Box\n {...getStyles('wrapper')}\n {...styleProps}\n {...wrapperProps}\n mod={{\n error: !!error,\n pointer,\n disabled,\n multiline,\n 'data-with-right-section': !!rightSection,\n 'data-with-left-section': !!leftSection,\n }}\n variant={variant}\n size={size}\n >\n {leftSection && (\n <div\n {...leftSectionProps}\n data-position=\"left\"\n {...getStyles('section', {\n className: leftSectionProps?.className,\n style: leftSectionProps?.style,\n })}\n >\n {leftSection}\n </div>\n )}\n\n <Box\n component=\"input\"\n {...rest}\n ref={ref}\n required={required}\n mod={{ disabled, error: !!error }}\n aria-invalid={!!error}\n variant={variant}\n aria-describedby={ctx.describedBy}\n disabled={disabled}\n {...getStyles('input')}\n />\n\n {rightSection && (\n <div\n {...rightSectionProps}\n data-position=\"right\"\n {...getStyles('section', {\n className: rightSectionProps?.className,\n style: rightSectionProps?.style,\n })}\n >\n {rightSection}\n </div>\n )}\n </Box>\n );\n});\n\nInput.Wrapper = InputWrapper;\nInput.Label = InputLabel;\nInput.Error = InputError;\nInput.Description = InputDescription;\nInput.Placeholder = InputPlaceholder;\nInput.displayName = '@mantine/core/Input';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;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I,OAAO;AACX,IAAI,kBAAkB,EAAE,GAAG,CAAC,WAAW;AACvC,IAAI,QAAQ;AACZ,GAAG,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,YAAY,oBAAoB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,iBAAiB,CAAC,EAAE;AAC3J,IAAI,eAAe,EAAE,OAAO;AAC5B,GAAG,CAAC,EAAE,SAAS,CAAC,SAAS,EAAE;AAC3B,IAAI,SAAS,EAAE,iBAAiB,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,iBAAiB,CAAC,SAAS;AAC/E,IAAI,KAAK,EAAE,iBAAiB,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,iBAAiB,CAAC,KAAK;AACvE,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;AACtB,CAAC,EAAE;AACH,KAAK,CAAC,OAAO,GAAG,YAAY,CAAC;AAC7B,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC;AACzB,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC;AACzB,KAAK,CAAC,WAAW,GAAG,gBAAgB,CAAC;AACrC,KAAK,CAAC,WAAW,GAAG,gBAAgB,CAAC;AACrC,KAAK,CAAC,WAAW,GAAG,qBAAqB;;;;"}
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n polymorphicFactory,\n useProps,\n useStyles,\n MantineRadius,\n MantineSize,\n extractStyleProps,\n getSize,\n getFontSize,\n getRadius,\n rem,\n createVarsResolver,\n PolymorphicFactory,\n} from '../../core';\nimport { useInputWrapperContext } from './InputWrapper.context';\nimport { InputLabel } from './InputLabel/InputLabel';\nimport { InputError } from './InputError/InputError';\nimport { InputDescription } from './InputDescription/InputDescription';\nimport { InputPlaceholder } from './InputPlaceholder/InputPlaceholder';\nimport {\n InputWrapper,\n __InputWrapperProps,\n InputWrapperStylesNames,\n} from './InputWrapper/InputWrapper';\nimport classes from './Input.module.css';\n\nexport interface __BaseInputProps extends __InputWrapperProps, __InputProps {}\nexport type __InputStylesNames = InputStylesNames | InputWrapperStylesNames;\n\nexport type InputStylesNames = 'input' | 'wrapper' | 'section';\nexport type InputVariant = 'default' | 'filled' | 'unstyled';\nexport type InputCssVariables = {\n wrapper:\n | '--input-height'\n | '--input-fz'\n | '--input-radius'\n | '--input-left-section-width'\n | '--input-right-section-width'\n | '--input-left-section-pointer-events'\n | '--input-right-section-pointer-events'\n | '--input-padding-y'\n | '--input-margin-top'\n | '--input-margin-bottom';\n};\n\nexport interface InputStylesCtx {\n offsetTop: boolean;\n offsetBottom: boolean;\n}\n\nexport interface __InputProps {\n /** Content section rendered on the left side of the input */\n leftSection?: React.ReactNode;\n\n /** Left section width, used to set `width` of the section and input `padding-left`, by default equals to the input height */\n leftSectionWidth?: React.CSSProperties['width'];\n\n /** Props added to the `leftSection` element */\n leftSectionProps?: React.ComponentPropsWithoutRef<'div'>;\n\n /** Sets `pointer-events` styles on the `leftSection` element, `'none'` by default */\n leftSectionPointerEvents?: React.CSSProperties['pointerEvents'];\n\n /** Content section rendered on the right side of the input */\n rightSection?: React.ReactNode;\n\n /** Right section width, used to set `width` of the section and input `padding-right`, by default equals to the input height */\n rightSectionWidth?: React.CSSProperties['width'];\n\n /** Props added to the `rightSection` element */\n rightSectionProps?: React.ComponentPropsWithoutRef<'div'>;\n\n /** Sets `pointer-events` styles on the `rightSection` element, `'none'` by default */\n rightSectionPointerEvents?: React.CSSProperties['pointerEvents'];\n\n /** Props added to the root element of the `Input` component */\n wrapperProps?: React.ComponentPropsWithoutRef<'div'>;\n\n /** Sets `required` attribute on the `input` element */\n required?: boolean;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius`, numbers are converted to rem, `theme.defaultRadius` by default */\n radius?: MantineRadius | (string & {}) | number;\n\n /** Sets `disabled` attribute on the `input` element */\n disabled?: boolean;\n\n /** Controls input `height` and horizontal `padding`, `'sm'` by default */\n size?: MantineSize | (string & {});\n\n /** Determines whether the input should have `cursor: pointer` style, `false` by default */\n pointer?: boolean;\n}\n\nexport interface InputProps extends BoxProps, __InputProps, StylesApiProps<InputFactory> {\n __staticSelector?: string;\n\n /** Props passed to Styles API context, replaces `Input.Wrapper` props */\n __stylesApiProps?: Record<string, any>;\n\n /** Determines whether the input should have error styles and `aria-invalid` attribute */\n error?: React.ReactNode;\n\n /** Determines whether the input can have multiple lines, for example when `component=\"textarea\"`, `false` by default */\n multiline?: boolean;\n}\n\nexport type InputFactory = PolymorphicFactory<{\n props: InputProps;\n defaultRef: HTMLInputElement;\n defaultComponent: 'input';\n stylesNames: InputStylesNames;\n variant: InputVariant;\n vars: InputCssVariables;\n ctx: InputStylesCtx;\n staticComponents: {\n Label: typeof InputLabel;\n Error: typeof InputError;\n Description: typeof InputDescription;\n Placeholder: typeof InputPlaceholder;\n Wrapper: typeof InputWrapper;\n };\n}>;\n\nconst defaultProps: Partial<InputProps> = {\n size: 'sm',\n variant: 'default',\n leftSectionPointerEvents: 'none',\n rightSectionPointerEvents: 'none',\n};\n\nconst varsResolver = createVarsResolver<InputFactory>((_, props, ctx) => ({\n wrapper: {\n '--input-margin-top': ctx.offsetTop ? 'calc(var(--mantine-spacing-xs) / 2)' : undefined,\n '--input-margin-bottom': ctx.offsetBottom ? 'calc(var(--mantine-spacing-xs) / 2)' : undefined,\n '--input-height': getSize(props.size, 'input-height'),\n '--input-fz': getFontSize(props.size),\n '--input-radius': getRadius(props.radius),\n '--input-left-section-width':\n props.leftSectionWidth !== undefined ? rem(props.leftSectionWidth) : undefined,\n '--input-right-section-width':\n props.rightSectionWidth !== undefined ? rem(props.rightSectionWidth) : undefined,\n '--input-padding-y': props.multiline ? getSize(props.size, 'input-padding-y') : undefined,\n '--input-left-section-pointer-events': props.leftSectionPointerEvents,\n '--input-right-section-pointer-events': props.rightSectionPointerEvents,\n },\n}));\n\nexport const Input = polymorphicFactory<InputFactory>((_props, ref) => {\n const props = useProps('Input', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n required,\n __staticSelector,\n __stylesApiProps,\n size,\n wrapperProps,\n error,\n disabled,\n leftSection,\n leftSectionProps,\n leftSectionWidth,\n rightSection,\n rightSectionProps,\n rightSectionWidth,\n rightSectionPointerEvents,\n leftSectionPointerEvents,\n variant,\n vars,\n pointer,\n multiline,\n radius,\n ...others\n } = props;\n\n const { styleProps, rest } = extractStyleProps(others);\n const ctx = useInputWrapperContext();\n const stylesCtx: InputStylesCtx = { offsetBottom: ctx.offsetBottom, offsetTop: ctx.offsetTop };\n\n const getStyles = useStyles<InputFactory>({\n name: ['Input', __staticSelector],\n props: __stylesApiProps || props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n stylesCtx,\n rootSelector: 'wrapper',\n vars,\n varsResolver,\n });\n\n return (\n <Box\n {...getStyles('wrapper')}\n {...styleProps}\n {...wrapperProps}\n mod={{\n error: !!error,\n pointer,\n disabled,\n multiline,\n 'data-with-right-section': !!rightSection,\n 'data-with-left-section': !!leftSection,\n }}\n variant={variant}\n size={size}\n >\n {leftSection && (\n <div\n {...leftSectionProps}\n data-position=\"left\"\n {...getStyles('section', {\n className: leftSectionProps?.className,\n style: leftSectionProps?.style,\n })}\n >\n {leftSection}\n </div>\n )}\n\n <Box\n component=\"input\"\n {...rest}\n ref={ref}\n required={required}\n mod={{ disabled, error: !!error }}\n aria-invalid={!!error}\n variant={variant}\n aria-describedby={ctx.describedBy}\n disabled={disabled}\n {...getStyles('input')}\n />\n\n {rightSection && (\n <div\n {...rightSectionProps}\n data-position=\"right\"\n {...getStyles('section', {\n className: rightSectionProps?.className,\n style: rightSectionProps?.style,\n })}\n >\n {rightSection}\n </div>\n )}\n </Box>\n );\n});\n\nInput.Wrapper = InputWrapper;\nInput.Label = InputLabel;\nInput.Error = InputError;\nInput.Description = InputDescription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AK,EAAE,CAAC,CAAC,KAAK,EAAE;AACrC,IAAI,cAAc,EAAE,CAAC,CAAC,KAAK;AAC3B,IAAI,OAAO;AACX,IAAI,kBAAkB,EAAE,GAAG,CAAC,WAAW;AACvC,IAAI,QAAQ;AACZ,GAAG,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,YAAY,oBAAoB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,iBAAiB,CAAC,EAAE;AAC3J,IAAI,eAAe,EAAE,OAAO;AAC5B,GAAG,CAAC,EAAE,SAAS,CAAC,SAAS,EAAE;AAC3B,IAAI,SAAS,EAAE,iBAAiB,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,iBAAiB,CAAC,SAAS;AAC/E,IAAI,KAAK,EAAE,iBAAiB,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,iBAAiB,CAAC,KAAK;AACvE,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;AACtB,CAAC,EAAE;AACH,KAAK,CAAC,OAAO,GAAG,YAAY,CAAC;AAC7B,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC;AACzB,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC;AACzB,KAAK,CAAC,WAAW,GAAG,gBAAgB,CAAC;AACrC,KAAK,CAAC,WAAW,GAAG,gBAAgB,CAAC;AACrC,KAAK,CAAC,WAAW,GAAG,qBAAqB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputWrapper.js","sources":["../../../../src/components/Input/InputWrapper/InputWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n MantineSize,\n Factory,\n createVarsResolver,\n getFontSize,\n rem,\n} from '../../../core';\nimport {\n InputLabel,\n InputLabelStylesNames,\n InputLabelCssVariables,\n} from '../InputLabel/InputLabel';\nimport {\n InputDescription,\n InputDescriptionStylesNames,\n InputDescriptionCssVariables,\n} from '../InputDescription/InputDescription';\nimport {\n InputError,\n InputErrorStylesNames,\n InputErrorCssVariables,\n} from '../InputError/InputError';\nimport { InputWrapperProvider } from '../InputWrapper.context';\nimport { getInputOffsets } from './get-input-offsets/get-input-offsets';\nimport classes from './InputWrapper.module.css';\n\nexport type InputWrapperCssVariables = InputLabelCssVariables &\n InputErrorCssVariables &\n InputDescriptionCssVariables;\n\nexport type InputWrapperStylesNames =\n | 'root'\n | InputLabelStylesNames\n | InputDescriptionStylesNames\n | InputErrorStylesNames;\n\nexport interface __InputWrapperProps {\n /** Contents of `Input.Label` component, if not set, label is not rendered. */\n label?: React.ReactNode;\n\n /** Contents of `Input.Description` component, if not set, description is not rendered. */\n description?: React.ReactNode;\n\n /** Contents of `Input.Error` component, if not set, error is not rendered. */\n error?: React.ReactNode;\n\n /** Adds required attribute to the input and a red asterisk on the right side of label, `false` by default */\n required?: boolean;\n\n /** Determines whether required asterisk should be rendered, overrides required prop, does not add required attribute to the input, `false` by default */\n withAsterisk?: boolean;\n\n /** Props spread to the `Input.Label` component */\n labelProps?: Record<string, any>;\n\n /** Props spread to the `Input.Description` component */\n descriptionProps?: Record<string, any>;\n\n /** Props spread to the `InputError` component */\n errorProps?: Record<string, any>;\n\n /** Input container component, defaults to `React.Fragment` */\n inputContainer?(children: React.ReactNode): React.ReactNode;\n\n /** Controls order of the elements, `['label', 'description', 'input', 'error']` by default */\n inputWrapperOrder?: ('label' | 'input' | 'description' | 'error')[];\n}\n\nexport interface InputWrapperProps\n extends __InputWrapperProps,\n BoxProps,\n StylesApiProps<InputWrapperFactory>,\n ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Props passed to Styles API context, replaces Input.Wrapper props */\n __stylesApiProps?: Record<string, any>;\n\n /** Static id used as base to generate `aria-` attributes, by default generates random id */\n id?: string;\n\n /** Controls size of `Input.Label`, `Input.Description` and `Input.Error` components */\n size?: MantineSize | (string & {});\n\n /** `Input.Label` root element, `'label'` by default */\n labelElement?: 'label' | 'div';\n}\n\nexport type InputWrapperFactory = Factory<{\n props: InputWrapperProps;\n ref: HTMLDivElement;\n stylesNames: InputWrapperStylesNames;\n vars: InputWrapperCssVariables;\n}>;\n\nconst defaultProps: Partial<InputWrapperProps> = {\n labelElement: 'label',\n size: 'sm',\n inputContainer: (children) => children,\n inputWrapperOrder: ['label', 'description', 'input', 'error'],\n};\n\nconst varsResolver = createVarsResolver<InputWrapperFactory>((_, { size }) => ({\n label: {\n '--input-label-size': getFontSize(size),\n '--input-asterisk-color': 'var(--mantine-color-red-filled)',\n },\n\n error: {\n '--input-error-size': `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n\n description: {\n '--input-description-size': `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n}));\n\nexport const InputWrapper = factory<InputWrapperFactory>((_props, ref) => {\n const props = useProps('InputWrapper', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n size,\n variant,\n __staticSelector,\n inputContainer,\n inputWrapperOrder,\n label,\n error,\n description,\n labelProps,\n descriptionProps,\n errorProps,\n labelElement,\n children,\n withAsterisk,\n id,\n required,\n __stylesApiProps,\n ...others\n } = props;\n\n const getStyles = useStyles<InputWrapperFactory>({\n name: ['InputWrapper', __staticSelector],\n props: __stylesApiProps || props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n const sharedProps = {\n size,\n variant,\n __staticSelector,\n };\n\n const isRequired = typeof withAsterisk === 'boolean' ? withAsterisk : required;\n const errorId = id ? `${id}-error` : errorProps?.id;\n const descriptionId = id ? `${id}-description` : descriptionProps?.id;\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 _label = label && (\n <InputLabel\n key=\"label\"\n labelElement={labelElement}\n id={id ? `${id}-label` : undefined}\n htmlFor={id}\n required={isRequired}\n {...sharedProps}\n {...labelProps}\n >\n {label}\n </InputLabel>\n );\n\n const _description = hasDescription && (\n <InputDescription\n key=\"description\"\n {...descriptionProps}\n {...sharedProps}\n size={descriptionProps?.size || sharedProps.size}\n id={descriptionProps?.id || descriptionId}\n >\n {description}\n </InputDescription>\n );\n\n const _input = <React.Fragment key=\"input\">{inputContainer!(children)}</React.Fragment>;\n\n const _error = hasError && (\n <InputError\n {...errorProps}\n {...sharedProps}\n size={errorProps?.size || sharedProps.size}\n key=\"error\"\n id={errorProps?.id || errorId}\n >\n {error}\n </InputError>\n );\n\n const content = inputWrapperOrder!.map((part) => {\n switch (part) {\n case 'label':\n return _label;\n case 'input':\n return _input;\n case 'description':\n return _description;\n case 'error':\n return _error;\n default:\n return null;\n }\n });\n\n return (\n <InputWrapperProvider\n value={{\n getStyles,\n describedBy,\n ...getInputOffsets(inputWrapperOrder!, { hasDescription, hasError }),\n }}\n >\n <Box ref={ref} variant={variant} size={size} {...getStyles('root')} {...others}>\n {content}\n </Box>\n </InputWrapperProvider>\n );\n});\n\nInputWrapper.displayName = '@mantine/core/InputWrapper';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAA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AE,MAAM,OAAO,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK;AAClD,IAAI,QAAQ,IAAI;AAChB,MAAM,KAAK,OAAO;AAClB,QAAQ,OAAO,MAAM,CAAC;AACtB,MAAM,KAAK,OAAO;AAClB,QAAQ,OAAO,MAAM,CAAC;AACtB,MAAM,KAAK,aAAa;AACxB,QAAQ,OAAO,YAAY,CAAC;AAC5B,MAAM,KAAK,OAAO;AAClB,QAAQ,OAAO,MAAM,CAAC;AACtB,MAAM;AACN,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,oBAAoB,EAAE;AACnE,IAAI,KAAK,EAAE,cAAc,CAAC;AAC1B,MAAM,SAAS;AACf,MAAM,WAAW;AACjB,KAAK,EAAE,eAAe,CAAC,iBAAiB,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,CAAC;AACxE,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,cAAc,CAAC,cAAc,CAAC;AAC5E,IAAI,GAAG;AACP,IAAI,OAAO;AACX,IAAI,IAAI;AACR,GAAG,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAC5C,CAAC,EAAE;AACH,YAAY,CAAC,WAAW,GAAG,4BAA4B;;;;"}
|
|
1
|
+
{"version":3,"file":"InputWrapper.js","sources":["../../../../src/components/Input/InputWrapper/InputWrapper.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n MantineSize,\n Factory,\n createVarsResolver,\n getFontSize,\n rem,\n} from '../../../core';\nimport {\n InputLabel,\n InputLabelStylesNames,\n InputLabelCssVariables,\n} from '../InputLabel/InputLabel';\nimport {\n InputDescription,\n InputDescriptionStylesNames,\n InputDescriptionCssVariables,\n} from '../InputDescription/InputDescription';\nimport {\n InputError,\n InputErrorStylesNames,\n InputErrorCssVariables,\n} from '../InputError/InputError';\nimport { InputWrapperProvider } from '../InputWrapper.context';\nimport { getInputOffsets } from './get-input-offsets/get-input-offsets';\nimport classes from './InputWrapper.module.css';\n\nexport type InputWrapperCssVariables = InputLabelCssVariables &\n InputErrorCssVariables &\n InputDescriptionCssVariables;\n\nexport type InputWrapperStylesNames =\n | 'root'\n | InputLabelStylesNames\n | InputDescriptionStylesNames\n | InputErrorStylesNames;\n\nexport interface __InputWrapperProps {\n /** Contents of `Input.Label` component, if not set, label is not rendered. */\n label?: React.ReactNode;\n\n /** Contents of `Input.Description` component, if not set, description is not rendered. */\n description?: React.ReactNode;\n\n /** Contents of `Input.Error` component, if not set, error is not rendered. */\n error?: React.ReactNode;\n\n /** Adds required attribute to the input and a red asterisk on the right side of label, `false` by default */\n required?: boolean;\n\n /** Determines whether required asterisk should be rendered, overrides required prop, does not add required attribute to the input, `false` by default */\n withAsterisk?: boolean;\n\n /** Props passed down to the `Input.Label` component */\n labelProps?: Record<string, any>;\n\n /** Props passed down to the `Input.Description` component */\n descriptionProps?: Record<string, any>;\n\n /** Props passed down to the `InputError` component */\n errorProps?: Record<string, any>;\n\n /** Input container component, defaults to `React.Fragment` */\n inputContainer?(children: React.ReactNode): React.ReactNode;\n\n /** Controls order of the elements, `['label', 'description', 'input', 'error']` by default */\n inputWrapperOrder?: ('label' | 'input' | 'description' | 'error')[];\n}\n\nexport interface InputWrapperProps\n extends __InputWrapperProps,\n BoxProps,\n StylesApiProps<InputWrapperFactory>,\n ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Props passed to Styles API context, replaces Input.Wrapper props */\n __stylesApiProps?: Record<string, any>;\n\n /** Static id used as base to generate `aria-` attributes, by default generates random id */\n id?: string;\n\n /** Controls size of `Input.Label`, `Input.Description` and `Input.Error` components */\n size?: MantineSize | (string & {});\n\n /** `Input.Label` root element, `'label'` by default */\n labelElement?: 'label' | 'div';\n}\n\nexport type InputWrapperFactory = Factory<{\n props: InputWrapperProps;\n ref: HTMLDivElement;\n stylesNames: InputWrapperStylesNames;\n vars: InputWrapperCssVariables;\n}>;\n\nconst defaultProps: Partial<InputWrapperProps> = {\n labelElement: 'label',\n size: 'sm',\n inputContainer: (children) => children,\n inputWrapperOrder: ['label', 'description', 'input', 'error'],\n};\n\nconst varsResolver = createVarsResolver<InputWrapperFactory>((_, { size }) => ({\n label: {\n '--input-label-size': getFontSize(size),\n '--input-asterisk-color': 'var(--mantine-color-red-filled)',\n },\n\n error: {\n '--input-error-size': `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n\n description: {\n '--input-description-size': `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n}));\n\nexport const InputWrapper = factory<InputWrapperFactory>((_props, ref) => {\n const props = useProps('InputWrapper', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n size,\n variant,\n __staticSelector,\n inputContainer,\n inputWrapperOrder,\n label,\n error,\n description,\n labelProps,\n descriptionProps,\n errorProps,\n labelElement,\n children,\n withAsterisk,\n id,\n required,\n __stylesApiProps,\n ...others\n } = props;\n\n const getStyles = useStyles<InputWrapperFactory>({\n name: ['InputWrapper', __staticSelector],\n props: __stylesApiProps || props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n const sharedProps = {\n size,\n variant,\n __staticSelector,\n };\n\n const isRequired = typeof withAsterisk === 'boolean' ? withAsterisk : required;\n const errorId = id ? `${id}-error` : errorProps?.id;\n const descriptionId = id ? `${id}-description` : descriptionProps?.id;\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 _label = label && (\n <InputLabel\n key=\"label\"\n labelElement={labelElement}\n id={id ? `${id}-label` : undefined}\n htmlFor={id}\n required={isRequired}\n {...sharedProps}\n {...labelProps}\n >\n {label}\n </InputLabel>\n );\n\n const _description = hasDescription && (\n <InputDescription\n key=\"description\"\n {...descriptionProps}\n {...sharedProps}\n size={descriptionProps?.size || sharedProps.size}\n id={descriptionProps?.id || descriptionId}\n >\n {description}\n </InputDescription>\n );\n\n const _input = <React.Fragment key=\"input\">{inputContainer!(children)}</React.Fragment>;\n\n const _error = hasError && (\n <InputError\n {...errorProps}\n {...sharedProps}\n size={errorProps?.size || sharedProps.size}\n key=\"error\"\n id={errorProps?.id || errorId}\n >\n {error}\n </InputError>\n );\n\n const content = inputWrapperOrder!.map((part) => {\n switch (part) {\n case 'label':\n return _label;\n case 'input':\n return _input;\n case 'description':\n return _description;\n case 'error':\n return _error;\n default:\n return null;\n }\n });\n\n return (\n <InputWrapperProvider\n value={{\n getStyles,\n describedBy,\n ...getInputOffsets(inputWrapperOrder!, { hasDescription, hasError }),\n }}\n >\n <Box ref={ref} variant={variant} size={size} {...getStyles('root')} {...others}>\n {content}\n </Box>\n </InputWrapperProvider>\n );\n});\n\nInputWrapper.displayName = '@mantine/core/InputWrapper';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAA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IAAI,KAAK;AAClD,IAAI,QAAQ,IAAI;AAChB,MAAM,KAAK,OAAO;AAClB,QAAQ,OAAO,MAAM,CAAC;AACtB,MAAM,KAAK,OAAO;AAClB,QAAQ,OAAO,MAAM,CAAC;AACtB,MAAM,KAAK,aAAa;AACxB,QAAQ,OAAO,YAAY,CAAC;AAC5B,MAAM,KAAK,OAAO;AAClB,QAAQ,OAAO,MAAM,CAAC;AACtB,MAAM;AACN,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,oBAAoB,EAAE;AACnE,IAAI,KAAK,EAAE,cAAc,CAAC;AAC1B,MAAM,SAAS;AACf,MAAM,WAAW;AACjB,KAAK,EAAE,eAAe,CAAC,iBAAiB,EAAE,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,CAAC;AACxE,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,cAAc,CAAC,cAAc,CAAC;AAC5E,IAAI,GAAG;AACP,IAAI,OAAO;AACX,IAAI,IAAI;AACR,GAAG,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAC5C,CAAC,EAAE;AACH,YAAY,CAAC,WAAW,GAAG,4BAA4B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loader.js","sources":["../../../src/components/Loader/Loader.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n MantineSize,\n MantineColor,\n BoxProps,\n useProps,\n getThemeColor,\n StylesApiProps,\n useStyles,\n factory,\n getSize,\n createVarsResolver,\n Factory,\n} from '../../core';\nimport { Bars } from './loaders/Bars';\nimport { Oval } from './loaders/Oval';\nimport { Dots } from './loaders/Dots';\nimport type { MantineLoader, MantineLoadersRecord } from './Loader.types';\nimport classes from './Loader.module.css';\n\nexport type LoaderStylesNames = 'root';\nexport type LoaderVariant = string;\nexport type LoaderCssVariables = {\n root: '--loader-size' | '--loader-color';\n};\n\nexport interface LoaderProps\n extends BoxProps,\n StylesApiProps<LoaderFactory>,\n Omit<React.ComponentPropsWithoutRef<'svg'>, keyof BoxProps> {\n /**
|
|
1
|
+
{"version":3,"file":"Loader.js","sources":["../../../src/components/Loader/Loader.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n MantineSize,\n MantineColor,\n BoxProps,\n useProps,\n getThemeColor,\n StylesApiProps,\n useStyles,\n factory,\n getSize,\n createVarsResolver,\n Factory,\n} from '../../core';\nimport { Bars } from './loaders/Bars';\nimport { Oval } from './loaders/Oval';\nimport { Dots } from './loaders/Dots';\nimport type { MantineLoader, MantineLoadersRecord } from './Loader.types';\nimport classes from './Loader.module.css';\n\nexport type LoaderStylesNames = 'root';\nexport type LoaderVariant = string;\nexport type LoaderCssVariables = {\n root: '--loader-size' | '--loader-color';\n};\n\nexport interface LoaderProps\n extends BoxProps,\n StylesApiProps<LoaderFactory>,\n Omit<React.ComponentPropsWithoutRef<'svg'>, keyof BoxProps> {\n /** Controls `width` and `height` of the loader. `Loader` has predefined `xs`-`xl` values. Numbers are converted to rem. Default value is `'md'` */\n size?: MantineSize | (string & {}) | number;\n\n /** Key of `theme.colors` or any valid CSS color, default value is `theme.primaryColor` */\n color?: MantineColor;\n\n /** Loader type, key of `loaders` prop, default value is `'oval'` */\n type?: MantineLoader;\n\n /** Object of loaders components, can be customized via default props or inline. Default value contains `bars`, `oval` and `dots` */\n loaders?: MantineLoadersRecord;\n}\n\nexport type LoaderFactory = Factory<{\n props: LoaderProps;\n ref: HTMLSpanElement;\n stylesNames: LoaderStylesNames;\n vars: LoaderCssVariables;\n staticComponents: {\n defaultLoaders: typeof defaultLoaders;\n };\n}>;\n\nexport const defaultLoaders: MantineLoadersRecord = {\n bars: Bars,\n oval: Oval,\n dots: Dots,\n};\n\nconst defaultProps: Partial<LoaderProps> = {\n size: 'md',\n loaders: defaultLoaders,\n type: 'oval',\n};\n\nconst varsResolver = createVarsResolver<LoaderFactory>((theme, { size, color }) => ({\n root: {\n '--loader-size': getSize(size, 'loader-size'),\n '--loader-color': getThemeColor(color, theme),\n },\n}));\n\nexport const Loader = factory<LoaderFactory>((_props, ref) => {\n const props = useProps('Loader', defaultProps, _props);\n const {\n size,\n color,\n type,\n vars,\n className,\n style,\n classNames,\n styles,\n unstyled,\n loaders,\n variant,\n ...others\n } = props;\n\n const getStyles = useStyles<LoaderFactory>({\n name: 'Loader',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n return (\n <Box\n {...getStyles('root')}\n ref={ref}\n component={(loaders as any)[type!]}\n variant={variant}\n size={size}\n {...others}\n />\n );\n});\n\nLoader.displayName = '@mantine/core/Loader';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CA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AI,SAAS;AACb,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,SAAS,GAAG,SAAS,CAAC;AAC9B,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,KAAK;AACT,IAAI,OAAO;AACX,IAAI,SAAS;AACb,IAAI,KAAK;AACT,IAAI,UAAU;AACd,IAAI,MAAM;AACV,IAAI,QAAQ;AACZ,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,GAAG,CAAC,CAAC;AACL,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,cAAc,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE;AACtH,IAAI,GAAG;AACP,IAAI,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC;AAC5B,IAAI,OAAO;AACX,IAAI,IAAI;AACR,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACf,CAAC,EAAE;AACH,MAAM,CAAC,WAAW,GAAG,sBAAsB;;;;"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classes from './Overlay.module.css.js';
|
|
3
|
+
import { polymorphicFactory } from '../../core/factory/polymorphic-factory.js';
|
|
4
|
+
import { useProps } from '../../core/MantineProvider/use-props/use-props.js';
|
|
5
|
+
import { useStyles } from '../../core/styles-api/use-styles/use-styles.js';
|
|
6
|
+
import { Box } from '../../core/Box/Box.js';
|
|
7
|
+
import { getDefaultZIndex } from '../../core/utils/get-default-z-index/get-default-z-index.js';
|
|
8
|
+
import { createVarsResolver } from '../../core/styles-api/create-vars-resolver/create-vars-resolver.js';
|
|
9
|
+
import { rgba } from '../../core/MantineProvider/color-functions/rgba/rgba.js';
|
|
10
|
+
import { rem } from '../../core/utils/units-converters/rem.js';
|
|
11
|
+
import { getRadius } from '../../core/utils/get-size/get-size.js';
|
|
12
|
+
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __defProps = Object.defineProperties;
|
|
15
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
16
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
17
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
19
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
20
|
+
var __spreadValues = (a, b) => {
|
|
21
|
+
for (var prop in b || (b = {}))
|
|
22
|
+
if (__hasOwnProp.call(b, prop))
|
|
23
|
+
__defNormalProp(a, prop, b[prop]);
|
|
24
|
+
if (__getOwnPropSymbols)
|
|
25
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
26
|
+
if (__propIsEnum.call(b, prop))
|
|
27
|
+
__defNormalProp(a, prop, b[prop]);
|
|
28
|
+
}
|
|
29
|
+
return a;
|
|
30
|
+
};
|
|
31
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
32
|
+
var __objRest = (source, exclude) => {
|
|
33
|
+
var target = {};
|
|
34
|
+
for (var prop in source)
|
|
35
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
36
|
+
target[prop] = source[prop];
|
|
37
|
+
if (source != null && __getOwnPropSymbols)
|
|
38
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
39
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
40
|
+
target[prop] = source[prop];
|
|
41
|
+
}
|
|
42
|
+
return target;
|
|
43
|
+
};
|
|
44
|
+
const defaultProps = {
|
|
45
|
+
color: "#000",
|
|
46
|
+
backgroundOpacity: 0.6,
|
|
47
|
+
zIndex: getDefaultZIndex("modal")
|
|
48
|
+
};
|
|
49
|
+
const varsResolver = createVarsResolver((theme, { gradient, color, backgroundOpacity, blur, radius, zIndex }) => ({
|
|
50
|
+
root: {
|
|
51
|
+
"--overlay-bg": gradient || rgba(color || "#000", backgroundOpacity != null ? backgroundOpacity : 0.6),
|
|
52
|
+
"--overlay-filter": blur ? `blur(${rem(blur)})` : void 0,
|
|
53
|
+
"--overlay-radius": getRadius(radius),
|
|
54
|
+
"--overlay-z-index": zIndex == null ? void 0 : zIndex.toString()
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
const Overlay = polymorphicFactory((_props, ref) => {
|
|
58
|
+
const props = useProps("Overlay", defaultProps, _props);
|
|
59
|
+
const _a = props, {
|
|
60
|
+
classNames,
|
|
61
|
+
className,
|
|
62
|
+
style,
|
|
63
|
+
styles,
|
|
64
|
+
unstyled,
|
|
65
|
+
vars,
|
|
66
|
+
fixed,
|
|
67
|
+
center,
|
|
68
|
+
children,
|
|
69
|
+
radius,
|
|
70
|
+
zIndex,
|
|
71
|
+
gradient,
|
|
72
|
+
blur,
|
|
73
|
+
color,
|
|
74
|
+
backgroundOpacity
|
|
75
|
+
} = _a, others = __objRest(_a, [
|
|
76
|
+
"classNames",
|
|
77
|
+
"className",
|
|
78
|
+
"style",
|
|
79
|
+
"styles",
|
|
80
|
+
"unstyled",
|
|
81
|
+
"vars",
|
|
82
|
+
"fixed",
|
|
83
|
+
"center",
|
|
84
|
+
"children",
|
|
85
|
+
"radius",
|
|
86
|
+
"zIndex",
|
|
87
|
+
"gradient",
|
|
88
|
+
"blur",
|
|
89
|
+
"color",
|
|
90
|
+
"backgroundOpacity"
|
|
91
|
+
]);
|
|
92
|
+
const getStyles = useStyles({
|
|
93
|
+
name: "Overlay",
|
|
94
|
+
props,
|
|
95
|
+
classes,
|
|
96
|
+
className,
|
|
97
|
+
style,
|
|
98
|
+
classNames,
|
|
99
|
+
styles,
|
|
100
|
+
unstyled,
|
|
101
|
+
vars,
|
|
102
|
+
varsResolver
|
|
103
|
+
});
|
|
104
|
+
return /* @__PURE__ */ React.createElement(Box, __spreadValues(__spreadProps(__spreadValues({
|
|
105
|
+
ref
|
|
106
|
+
}, getStyles("root")), {
|
|
107
|
+
mod: { center, fixed }
|
|
108
|
+
}), others), children);
|
|
109
|
+
});
|
|
110
|
+
Overlay.displayName = "@mantine/core/Overlay";
|
|
111
|
+
|
|
112
|
+
export { Overlay };
|
|
113
|
+
//# sourceMappingURL=Overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Overlay.js","sources":["../../../src/components/Overlay/Overlay.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n polymorphicFactory,\n useProps,\n useStyles,\n createVarsResolver,\n PolymorphicFactory,\n MantineRadius,\n rgba,\n getDefaultZIndex,\n getRadius,\n rem,\n} from '../../core';\nimport classes from './Overlay.module.css';\n\nexport type OverlayStylesNames = 'root';\nexport type OverlayVariant = string;\nexport type OverlayCssVariables = {\n root: '--overlay-bg' | '--overlay-filter' | '--overlay-radius' | '--overlay-z-index';\n};\n\nexport interface OverlayProps extends BoxProps, StylesApiProps<OverlayFactory> {\n /** Controls overlay `background-color` opacity 0–1, disregarded when `gradient` prop is set, `0.6` by default */\n backgroundOpacity?: number;\n\n /** Overlay `background-color`, `#000` by default */\n color?: React.CSSProperties['backgroundColor'];\n\n /** Overlay background blur, `0` by default */\n blur?: number | string;\n\n /** Changes overlay to gradient. If set, `color` prop is ignored */\n gradient?: string;\n\n /** Overlay z-index, `200` by default */\n zIndex?: React.CSSProperties['zIndex'];\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius, `0` by default */\n radius?: MantineRadius | (string & {}) | number;\n\n /** Content inside overlay */\n children?: React.ReactNode;\n\n /** Determines whether content inside overlay should be vertically and horizontally centered, `false` by default */\n center?: boolean;\n\n /** Determines whether overlay should have fixed position instead of absolute, `false` by default */\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 variant: OverlayVariant;\n}>;\n\nconst defaultProps: Partial<OverlayProps> = {\n color: '#000',\n backgroundOpacity: 0.6,\n zIndex: getDefaultZIndex('modal'),\n};\n\nconst varsResolver = createVarsResolver<OverlayFactory>(\n (theme, { gradient, color, backgroundOpacity, blur, radius, zIndex }) => ({\n root: {\n '--overlay-bg': gradient || rgba(color || '#000', backgroundOpacity ?? 0.6),\n '--overlay-filter': blur ? `blur(${rem(blur)})` : undefined,\n '--overlay-radius': getRadius(radius),\n '--overlay-z-index': zIndex?.toString(),\n },\n })\n);\n\nexport const Overlay = polymorphicFactory<OverlayFactory>((_props, ref) => {\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 ...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 vars,\n varsResolver,\n });\n\n return (\n <Box ref={ref} {...getStyles('root')} mod={{ center, fixed }} {...others}>\n {children}\n </Box>\n );\n});\n\nOverlay.displayName = '@mantine/core/Overlay';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAA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
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Overlay.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paper.js","sources":["../../../src/components/Paper/Paper.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n polymorphicFactory,\n useProps,\n useStyles,\n MantineShadow,\n MantineRadius,\n getRadius,\n getShadow,\n createVarsResolver,\n PolymorphicFactory,\n} from '../../core';\nimport classes from './Paper.module.css';\n\nexport type PaperStylesNames = 'root';\nexport type PaperVariant = string;\nexport type PaperCssVariables = {\n root: '--paper-radius' | '--paper-shadow';\n};\n\nexport interface PaperProps extends BoxProps, StylesApiProps<PaperFactory> {\n /** Key of `theme.shadows` or any valid CSS value to set box-shadow
|
|
1
|
+
{"version":3,"file":"Paper.js","sources":["../../../src/components/Paper/Paper.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n polymorphicFactory,\n useProps,\n useStyles,\n MantineShadow,\n MantineRadius,\n getRadius,\n getShadow,\n createVarsResolver,\n PolymorphicFactory,\n} from '../../core';\nimport classes from './Paper.module.css';\n\nexport type PaperStylesNames = 'root';\nexport type PaperVariant = string;\nexport type PaperCssVariables = {\n root: '--paper-radius' | '--paper-shadow';\n};\n\nexport interface PaperProps extends BoxProps, StylesApiProps<PaperFactory> {\n /** Key of `theme.shadows` or any valid CSS value to set `box-shadow`, `none` by default */\n shadow?: MantineShadow | (string & {});\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius, numbers are converted to rem, `theme.defaultRadius` by default */\n radius?: MantineRadius | number | (string & {});\n\n /** Determines whether the paper should have border, border color depends on color scheme, `false` by default */\n withBorder?: boolean;\n}\n\nexport type PaperFactory = PolymorphicFactory<{\n props: PaperProps;\n defaultComponent: 'div';\n defaultRef: HTMLDivElement;\n stylesNames: PaperStylesNames;\n vars: PaperCssVariables;\n}>;\n\nconst defaultProps: Partial<PaperProps> = {};\n\nconst varsResolver = createVarsResolver<PaperFactory>((_, { radius, shadow }) => ({\n root: {\n '--paper-radius': getRadius(radius),\n '--paper-shadow': getShadow(shadow),\n },\n}));\n\nexport const Paper = polymorphicFactory<PaperFactory>((_props, ref) => {\n const props = useProps('Paper', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n withBorder,\n vars,\n radius,\n shadow,\n variant,\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 vars,\n varsResolver,\n });\n\n return (\n <Box\n ref={ref}\n mod={{ 'data-with-border': withBorder }}\n {...getStyles('root')}\n variant={variant}\n {...others}\n />\n );\n});\n\nPaper.displayName = '@mantine/core/Paper';\n"],"names":[],"mappings":";;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,I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AI,YAAY;AAChB,GAAG,CAAC,CAAC;AACL,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,cAAc,CAAC,aAAa,CAAC,cAAc,CAAC;AAC9F,IAAI,GAAG;AACP,IAAI,GAAG,EAAE,EAAE,kBAAkB,EAAE,UAAU,EAAE;AAC3C,GAAG,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE;AACzB,IAAI,OAAO;AACX,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACf,CAAC,EAAE;AACH,KAAK,CAAC,WAAW,GAAG,qBAAqB;;;;"}
|
|
@@ -6,10 +6,10 @@ import { PopoverTarget } from './PopoverTarget/PopoverTarget.js';
|
|
|
6
6
|
import { PopoverDropdown } from './PopoverDropdown/PopoverDropdown.js';
|
|
7
7
|
import classes from './Popover.module.css.js';
|
|
8
8
|
import { getFloatingPosition } from '../Floating/get-floating-position/get-floating-position.js';
|
|
9
|
-
import { getDefaultZIndex } from '../../core/utils/get-default-z-index/get-default-z-index.js';
|
|
10
9
|
import { useProps } from '../../core/MantineProvider/use-props/use-props.js';
|
|
11
10
|
import { useStyles } from '../../core/styles-api/use-styles/use-styles.js';
|
|
12
11
|
import { useDirection } from '../../core/DirectionProvider/DirectionProvider.js';
|
|
12
|
+
import { getDefaultZIndex } from '../../core/utils/get-default-z-index/get-default-z-index.js';
|
|
13
13
|
import { createVarsResolver } from '../../core/styles-api/create-vars-resolver/create-vars-resolver.js';
|
|
14
14
|
import { getRadius, getShadow } from '../../core/utils/get-size/get-size.js';
|
|
15
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["/* eslint-disable react/no-unused-prop-types */\nimport React, { useRef, useState, useCallback } from 'react';\nimport { useId, useClickOutside } from '@mantine/hooks';\nimport {\n MantineShadow,\n getDefaultZIndex,\n useProps,\n MantineRadius,\n useDirection,\n useStyles,\n Factory,\n createVarsResolver,\n getRadius,\n getShadow,\n StylesApiProps,\n ExtendComponent,\n} from '../../core';\nimport { TransitionOverride } from '../Transition';\nimport {\n getFloatingPosition,\n FloatingAxesOffsets,\n FloatingPosition,\n ArrowPosition,\n} from '../Floating';\nimport { PortalProps } from '../Portal';\nimport { usePopover } from './use-popover';\nimport { PopoverContextProvider } from './Popover.context';\nimport { PopoverWidth, PopoverMiddlewares } from './Popover.types';\nimport { PopoverTarget } from './PopoverTarget/PopoverTarget';\nimport { PopoverDropdown } from './PopoverDropdown/PopoverDropdown';\nimport classes from './Popover.module.css';\n\nexport type PopoverStylesNames = 'dropdown' | 'arrow';\nexport type PopoverCssVariables = {\n dropdown: '--popover-radius' | '--popover-shadow';\n};\n\nexport interface __PopoverProps {\n /** Dropdown position relative to the target element, `'bottom'` by default */\n position?: FloatingPosition;\n\n /** Offset of the dropdown element, `8` by default */\n offset?: number | FloatingAxesOffsets;\n\n /** Called when dropdown position changes */\n onPositionChange?(position: FloatingPosition): void;\n\n /** `useEffect` dependencies to force update dropdown position, `[]` by default */\n positionDependencies?: any[];\n\n /** Called when dropdown closes */\n onClose?(): void;\n\n /** Called when dropdown opens */\n onOpen?(): void;\n\n /** If set dropdown will not be unmounted from the DOM when it is hidden, display: none styles will be added instead */\n keepMounted?: boolean;\n\n /** Props added to `Transition` component that used to animate dropdown presence, use to configure duration and animation type, `{ duration: 150, transition: 'fade' }` by default */\n transitionProps?: TransitionOverride;\n\n /** Dropdown width, or `'target'` to make dropdown width the same as target element, `'max-content'` by default */\n width?: PopoverWidth;\n\n /** Floating ui middlewares to configure position handling, `{ flip: true, shift: true, inline: false }` by default */\n middlewares?: PopoverMiddlewares;\n\n /** Determines whether component should have an arrow, `false` by default */\n withArrow?: boolean;\n\n /** Arrow size in px, `7` by default */\n arrowSize?: number;\n\n /** Arrow offset in px, `5` by default */\n arrowOffset?: number;\n\n /** Arrow border-radius in px, `0` by default */\n arrowRadius?: number;\n\n /** Arrow position **/\n arrowPosition?: ArrowPosition;\n\n /** Determines whether dropdown should be rendered within Portal, `true` by default */\n withinPortal?: boolean;\n\n /** Props to pass down to the portal when withinPortal is true */\n portalProps?: Omit<PortalProps, 'children'>;\n\n /** Dropdown z-index */\n zIndex?: React.CSSProperties['zIndex'];\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius, `theme.defaultRadius` by default */\n radius?: MantineRadius | (string & {}) | number;\n\n /** Key of theme.shadow or any other valid css box-shadow value */\n shadow?: MantineShadow | (string & {});\n\n /** If set, popover dropdown will not render */\n disabled?: boolean;\n\n /** Determines whether focus should be automatically returned to control when dropdown closes, false by default */\n returnFocus?: boolean;\n}\n\nexport interface PopoverProps extends __PopoverProps, StylesApiProps<PopoverFactory> {\n __staticSelector?: string;\n\n /** Popover.Target and Popover.Dropdown components */\n children: React.ReactNode;\n\n /** Initial opened state for uncontrolled component */\n defaultOpened?: boolean;\n\n /** Controls dropdown opened state */\n opened?: boolean;\n\n /** Called with current state when dropdown opens or closes */\n onChange?(opened: boolean): void;\n\n /** Determines whether dropdown should be closed on outside clicks, default to true */\n closeOnClickOutside?: boolean;\n\n /** Events that trigger outside clicks */\n clickOutsideEvents?: string[];\n\n /** Determines whether focus should be trapped within dropdown, default to false */\n trapFocus?: boolean;\n\n /** Determines whether dropdown should be closed when Escape key is pressed, defaults to true */\n closeOnEscape?: boolean;\n\n /** id base to create accessibility connections */\n id?: string;\n\n /** Determines whether dropdown and target element should have accessible roles, defaults to true */\n withRoles?: boolean;\n}\n\nexport type PopoverFactory = Factory<{\n props: PopoverProps;\n stylesNames: PopoverStylesNames;\n vars: PopoverCssVariables;\n}>;\n\nconst defaultProps: Partial<PopoverProps> = {\n position: 'bottom',\n offset: 8,\n positionDependencies: [],\n transitionProps: { transition: 'fade', duration: 150 },\n middlewares: { flip: true, shift: true, inline: false },\n arrowSize: 7,\n arrowOffset: 5,\n arrowRadius: 0,\n arrowPosition: 'side',\n closeOnClickOutside: true,\n withinPortal: true,\n closeOnEscape: true,\n trapFocus: false,\n withRoles: true,\n returnFocus: false,\n clickOutsideEvents: ['mousedown', 'touchstart'],\n zIndex: getDefaultZIndex('popover'),\n __staticSelector: 'Popover',\n width: 'max-content',\n};\n\nconst varsResolver = createVarsResolver<PopoverFactory>((_, { radius, shadow }) => ({\n dropdown: {\n '--popover-radius': getRadius(radius),\n '--popover-shadow': getShadow(shadow),\n },\n}));\n\nexport function Popover(_props: PopoverProps) {\n const props = useProps('Popover', defaultProps, _props);\n const {\n children,\n position,\n offset,\n onPositionChange,\n positionDependencies,\n opened,\n transitionProps,\n width,\n middlewares,\n withArrow,\n arrowSize,\n arrowOffset,\n arrowRadius,\n arrowPosition,\n unstyled,\n classNames,\n styles,\n closeOnClickOutside,\n withinPortal,\n portalProps,\n closeOnEscape,\n clickOutsideEvents,\n trapFocus,\n onClose,\n onOpen,\n onChange,\n zIndex,\n radius,\n shadow,\n id,\n defaultOpened,\n __staticSelector,\n withRoles,\n disabled,\n returnFocus,\n variant,\n keepMounted,\n vars,\n ...others\n } = props;\n\n const getStyles = useStyles<PopoverFactory>({\n name: __staticSelector!,\n props,\n classes,\n classNames,\n styles,\n unstyled,\n rootSelector: 'dropdown',\n vars,\n varsResolver,\n });\n\n const arrowRef = useRef<HTMLDivElement | null>(null);\n const [targetNode, setTargetNode] = useState<HTMLElement | null>(null);\n const [dropdownNode, setDropdownNode] = useState<HTMLElement | null>(null);\n const { dir } = useDirection();\n\n const uid = useId(id);\n const popover = usePopover({\n middlewares,\n width,\n position: getFloatingPosition(dir, position!),\n offset: typeof offset === 'number' ? offset + (withArrow ? arrowSize! / 2 : 0) : offset!,\n arrowRef,\n arrowOffset: arrowOffset!,\n onPositionChange,\n positionDependencies,\n opened,\n defaultOpened,\n onChange,\n onOpen,\n onClose,\n });\n\n useClickOutside(() => closeOnClickOutside && popover.onClose(), clickOutsideEvents, [\n targetNode,\n dropdownNode,\n ]);\n\n const reference = useCallback(\n (node: HTMLElement) => {\n setTargetNode(node);\n popover.floating.reference(node);\n },\n [popover.floating.reference]\n );\n\n const floating = useCallback(\n (node: HTMLElement) => {\n setDropdownNode(node);\n popover.floating.floating(node);\n },\n [popover.floating.floating]\n );\n\n return (\n <PopoverContextProvider\n value={{\n returnFocus,\n disabled,\n controlled: popover.controlled,\n reference,\n floating,\n x: popover.floating.x!,\n y: popover.floating.y!,\n arrowX: popover.floating?.middlewareData?.arrow?.x!,\n arrowY: popover.floating?.middlewareData?.arrow?.y!,\n opened: popover.opened,\n arrowRef,\n transitionProps,\n width,\n withArrow,\n arrowSize: arrowSize!,\n arrowOffset: arrowOffset!,\n arrowRadius: arrowRadius!,\n arrowPosition: arrowPosition!,\n placement: popover.floating.placement,\n trapFocus,\n withinPortal,\n portalProps,\n zIndex,\n radius,\n shadow,\n closeOnEscape,\n onClose: popover.onClose,\n onToggle: popover.onToggle,\n getTargetId: () => `${uid}-target`,\n getDropdownId: () => `${uid}-dropdown`,\n withRoles,\n targetProps: others,\n __staticSelector: __staticSelector!,\n classNames,\n styles,\n unstyled,\n variant,\n keepMounted,\n getStyles,\n }}\n >\n {children}\n </PopoverContextProvider>\n );\n}\n\nPopover.Target = PopoverTarget;\nPopover.Dropdown = PopoverDropdown;\nPopover.displayName = '@mantine/core/Popover';\nPopover.extend = (input: ExtendComponent<PopoverFactory>) => input;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,SAAS,GAAG,CAAC,MAAM,EAAE,OAAO,KAAK;AACrC,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC;AAClB,EAAE,KAAK,IAAI,IAAI,IAAI,MAAM;AACzB,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,OAAO,CAAC,OAA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EAAE,OAAO,CAAC,OAAO;AAC9B,MAAM,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAChC,MAAM,WAAW,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;AACxC,MAAM,aAAa,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC;AAC5C,MAAM,SAAS;AACf,MAAM,WAAW,EAAE,MAAM;AACzB,MAAM,gBAAgB;AACtB,MAAM,UAAU;AAChB,MAAM,MAAM;AACZ,MAAM,QAAQ;AACd,MAAM,OAAO;AACb,MAAM,WAAW;AACjB,MAAM,SAAS;AACf,KAAK;AACL,GAAG,EAAE,QAAQ,CAAC,CAAC;AACf,CAAC;AACD,OAAO,CAAC,MAAM,GAAG,aAAa,CAAC;AAC/B,OAAO,CAAC,QAAQ,GAAG,eAAe,CAAC;AACnC,OAAO,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAC9C,OAAO,CAAC,MAAM,GAAG,CAAC,KAAK,KAAK,KAAK;;;;"}
|
|
1
|
+
{"version":3,"file":"Popover.js","sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["/* eslint-disable react/no-unused-prop-types */\nimport React, { useRef, useState, useCallback } from 'react';\nimport { useId, useClickOutside } from '@mantine/hooks';\nimport {\n MantineShadow,\n getDefaultZIndex,\n useProps,\n MantineRadius,\n useDirection,\n useStyles,\n Factory,\n createVarsResolver,\n getRadius,\n getShadow,\n StylesApiProps,\n ExtendComponent,\n} from '../../core';\nimport { TransitionOverride } from '../Transition';\nimport {\n getFloatingPosition,\n FloatingAxesOffsets,\n FloatingPosition,\n ArrowPosition,\n} from '../Floating';\nimport { PortalProps } from '../Portal';\nimport { usePopover } from './use-popover';\nimport { PopoverContextProvider } from './Popover.context';\nimport { PopoverWidth, PopoverMiddlewares } from './Popover.types';\nimport { PopoverTarget } from './PopoverTarget/PopoverTarget';\nimport { PopoverDropdown } from './PopoverDropdown/PopoverDropdown';\nimport classes from './Popover.module.css';\n\nexport type PopoverStylesNames = 'dropdown' | 'arrow';\nexport type PopoverCssVariables = {\n dropdown: '--popover-radius' | '--popover-shadow';\n};\n\nexport interface __PopoverProps {\n /** Dropdown position relative to the target element, `'bottom'` by default */\n position?: FloatingPosition;\n\n /** Offset of the dropdown element, `8` by default */\n offset?: number | FloatingAxesOffsets;\n\n /** Called when dropdown position changes */\n onPositionChange?(position: FloatingPosition): void;\n\n /** `useEffect` dependencies to force update dropdown position, `[]` by default */\n positionDependencies?: any[];\n\n /** Called when dropdown closes */\n onClose?(): void;\n\n /** Called when dropdown opens */\n onOpen?(): void;\n\n /** If set dropdown will not be unmounted from the DOM when it is hidden, `display: none` styles will be added instead, `false` by default */\n keepMounted?: boolean;\n\n /** Props passed down to the `Transition` component that used to animate dropdown presence, use to configure duration and animation type, `{ duration: 150, transition: 'fade' }` by default */\n transitionProps?: TransitionOverride;\n\n /** Dropdown width, or `'target'` to make dropdown width the same as target element, `'max-content'` by default */\n width?: PopoverWidth;\n\n /** Floating ui middlewares to configure position handling, `{ flip: true, shift: true, inline: false }` by default */\n middlewares?: PopoverMiddlewares;\n\n /** Determines whether component should have an arrow, `false` by default */\n withArrow?: boolean;\n\n /** Arrow size in px, `7` by default */\n arrowSize?: number;\n\n /** Arrow offset in px, `5` by default */\n arrowOffset?: number;\n\n /** Arrow `border-radius` in px, `0` by default */\n arrowRadius?: number;\n\n /** Arrow position */\n arrowPosition?: ArrowPosition;\n\n /** Determines whether dropdown should be rendered within the `Portal`, `true` by default */\n withinPortal?: boolean;\n\n /** Props to pass down to the `Portal` when `withinPortal` is true */\n portalProps?: Omit<PortalProps, 'children'>;\n\n /** Dropdown `z-index`, `300` by default */\n zIndex?: React.CSSProperties['zIndex'];\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius, `theme.defaultRadius` by default */\n radius?: MantineRadius | (string & {}) | number;\n\n /** Key of `theme.shadows` or any other valid CSS `box-shadow` value */\n shadow?: MantineShadow | (string & {});\n\n /** If set, popover dropdown will not be rendered */\n disabled?: boolean;\n\n /** Determines whether focus should be automatically returned to control when dropdown closes, `false` by default */\n returnFocus?: boolean;\n}\n\nexport interface PopoverProps extends __PopoverProps, StylesApiProps<PopoverFactory> {\n __staticSelector?: string;\n\n /** `Popover.Target` and `Popover.Dropdown` components */\n children: React.ReactNode;\n\n /** Initial opened state for uncontrolled component */\n defaultOpened?: boolean;\n\n /** Controlled dropdown opened state */\n opened?: boolean;\n\n /** Called with current state when dropdown opens or closes */\n onChange?(opened: boolean): void;\n\n /** Determines whether dropdown should be closed on outside clicks, `true` by default */\n closeOnClickOutside?: boolean;\n\n /** Events that trigger outside clicks */\n clickOutsideEvents?: string[];\n\n /** Determines whether focus should be trapped within dropdown, `false` by default */\n trapFocus?: boolean;\n\n /** Determines whether dropdown should be closed when `Escape` key is pressed, `true` by default */\n closeOnEscape?: boolean;\n\n /** id base to create accessibility connections */\n id?: string;\n\n /** Determines whether dropdown and target elements should have accessible roles, `true` by default */\n withRoles?: boolean;\n}\n\nexport type PopoverFactory = Factory<{\n props: PopoverProps;\n stylesNames: PopoverStylesNames;\n vars: PopoverCssVariables;\n}>;\n\nconst defaultProps: Partial<PopoverProps> = {\n position: 'bottom',\n offset: 8,\n positionDependencies: [],\n transitionProps: { transition: 'fade', duration: 150 },\n middlewares: { flip: true, shift: true, inline: false },\n arrowSize: 7,\n arrowOffset: 5,\n arrowRadius: 0,\n arrowPosition: 'side',\n closeOnClickOutside: true,\n withinPortal: true,\n closeOnEscape: true,\n trapFocus: false,\n withRoles: true,\n returnFocus: false,\n clickOutsideEvents: ['mousedown', 'touchstart'],\n zIndex: getDefaultZIndex('popover'),\n __staticSelector: 'Popover',\n width: 'max-content',\n};\n\nconst varsResolver = createVarsResolver<PopoverFactory>((_, { radius, shadow }) => ({\n dropdown: {\n '--popover-radius': getRadius(radius),\n '--popover-shadow': getShadow(shadow),\n },\n}));\n\nexport function Popover(_props: PopoverProps) {\n const props = useProps('Popover', defaultProps, _props);\n const {\n children,\n position,\n offset,\n onPositionChange,\n positionDependencies,\n opened,\n transitionProps,\n width,\n middlewares,\n withArrow,\n arrowSize,\n arrowOffset,\n arrowRadius,\n arrowPosition,\n unstyled,\n classNames,\n styles,\n closeOnClickOutside,\n withinPortal,\n portalProps,\n closeOnEscape,\n clickOutsideEvents,\n trapFocus,\n onClose,\n onOpen,\n onChange,\n zIndex,\n radius,\n shadow,\n id,\n defaultOpened,\n __staticSelector,\n withRoles,\n disabled,\n returnFocus,\n variant,\n keepMounted,\n vars,\n ...others\n } = props;\n\n const getStyles = useStyles<PopoverFactory>({\n name: __staticSelector!,\n props,\n classes,\n classNames,\n styles,\n unstyled,\n rootSelector: 'dropdown',\n vars,\n varsResolver,\n });\n\n const arrowRef = useRef<HTMLDivElement | null>(null);\n const [targetNode, setTargetNode] = useState<HTMLElement | null>(null);\n const [dropdownNode, setDropdownNode] = useState<HTMLElement | null>(null);\n const { dir } = useDirection();\n\n const uid = useId(id);\n const popover = usePopover({\n middlewares,\n width,\n position: getFloatingPosition(dir, position!),\n offset: typeof offset === 'number' ? offset + (withArrow ? arrowSize! / 2 : 0) : offset!,\n arrowRef,\n arrowOffset: arrowOffset!,\n onPositionChange,\n positionDependencies,\n opened,\n defaultOpened,\n onChange,\n onOpen,\n onClose,\n });\n\n useClickOutside(() => closeOnClickOutside && popover.onClose(), clickOutsideEvents, [\n targetNode,\n dropdownNode,\n ]);\n\n const reference = useCallback(\n (node: HTMLElement) => {\n setTargetNode(node);\n popover.floating.reference(node);\n },\n [popover.floating.reference]\n );\n\n const floating = useCallback(\n (node: HTMLElement) => {\n setDropdownNode(node);\n popover.floating.floating(node);\n },\n [popover.floating.floating]\n );\n\n return (\n <PopoverContextProvider\n value={{\n returnFocus,\n disabled,\n controlled: popover.controlled,\n reference,\n floating,\n x: popover.floating.x!,\n y: popover.floating.y!,\n arrowX: popover.floating?.middlewareData?.arrow?.x!,\n arrowY: popover.floating?.middlewareData?.arrow?.y!,\n opened: popover.opened,\n arrowRef,\n transitionProps,\n width,\n withArrow,\n arrowSize: arrowSize!,\n arrowOffset: arrowOffset!,\n arrowRadius: arrowRadius!,\n arrowPosition: arrowPosition!,\n placement: popover.floating.placement,\n trapFocus,\n withinPortal,\n portalProps,\n zIndex,\n radius,\n shadow,\n closeOnEscape,\n onClose: popover.onClose,\n onToggle: popover.onToggle,\n getTargetId: () => `${uid}-target`,\n getDropdownId: () => `${uid}-dropdown`,\n withRoles,\n targetProps: others,\n __staticSelector: __staticSelector!,\n classNames,\n styles,\n unstyled,\n variant,\n keepMounted,\n getStyles,\n }}\n >\n {children}\n </PopoverContextProvider>\n );\n}\n\nPopover.Target = PopoverTarget;\nPopover.Dropdown = PopoverDropdown;\nPopover.displayName = '@mantine/core/Popover';\nPopover.extend = (input: ExtendComponent<PopoverFactory>) => input;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,SAAS,GAAG,CAAC,MAAM,EAAE,OAAO,KAAK;AACrC,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC;AAClB,EAAE,KAAK,IAAI,IAAI,IAAI,MAAM;AACzB,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;AACpE,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAClC,EAAE,IAAI,MAAM,IAAI,IAAI,IAAI,mBAAmB;AAC3C,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,MAAM,CAAC,EAAE;AAClD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,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Z,MAAM,QAAQ;AACd,MAAM,OAAO;AACb,MAAM,WAAW;AACjB,MAAM,SAAS;AACf,KAAK;AACL,GAAG,EAAE,QAAQ,CAAC,CAAC;AACf,CAAC;AACD,OAAO,CAAC,MAAM,GAAG,aAAa,CAAC;AAC/B,OAAO,CAAC,QAAQ,GAAG,eAAe,CAAC;AACnC,OAAO,CAAC,WAAW,GAAG,uBAAuB,CAAC;AAC9C,OAAO,CAAC,MAAM,GAAG,CAAC,KAAK,KAAK,KAAK;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createSafeContext } from '../../core/utils/create-safe-context/create-safe-context.js';
|
|
2
|
+
|
|
3
|
+
const [ScrollAreaProvider, useScrollAreaContext] = createSafeContext("ScrollArea.Root component was not found in tree");
|
|
4
|
+
|
|
5
|
+
export { ScrollAreaProvider, useScrollAreaContext };
|
|
6
|
+
//# sourceMappingURL=ScrollArea.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollArea.context.js","sources":["../../../src/components/ScrollArea/ScrollArea.context.ts"],"sourcesContent":["import { createSafeContext } from '../../core';\n\nexport interface ScrollAreaContextValue {\n type: 'auto' | 'always' | 'scroll' | 'hover' | 'never';\n scrollHideDelay: number;\n scrollArea: HTMLDivElement | null;\n viewport: HTMLDivElement | null;\n onViewportChange(viewport: HTMLDivElement | null): void;\n content: HTMLDivElement | null;\n onContentChange(content: HTMLDivElement): void;\n scrollbarX: HTMLDivElement | null;\n onScrollbarXChange(scrollbar: HTMLDivElement | null): void;\n scrollbarXEnabled: boolean;\n onScrollbarXEnabledChange(rendered: boolean): void;\n scrollbarY: HTMLDivElement | null;\n onScrollbarYChange(scrollbar: HTMLDivElement | null): void;\n scrollbarYEnabled: boolean;\n onScrollbarYEnabledChange(rendered: boolean): void;\n onCornerWidthChange(width: number): void;\n onCornerHeightChange(height: number): void;\n}\n\nexport const [ScrollAreaProvider, useScrollAreaContext] = createSafeContext<ScrollAreaContextValue>(\n 'ScrollArea.Root component was not found in tree'\n);\n"],"names":[],"mappings":";;AACY,MAAC,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,GAAG,iBAAiB,CAAC,iDAAiD;;;;"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { ScrollAreaScrollbar } from './ScrollAreaScrollbar/ScrollAreaScrollbar.js';
|
|
3
|
+
import { ScrollAreaCorner } from './ScrollAreaCorner/ScrollAreaCorner.js';
|
|
4
|
+
import { ScrollAreaRoot } from './ScrollAreaRoot/ScrollAreaRoot.js';
|
|
5
|
+
import { ScrollAreaViewport } from './ScrollAreaViewport/ScrollAreaViewport.js';
|
|
3
6
|
import classes from './ScrollArea.module.css.js';
|
|
7
|
+
import { ScrollAreaThumb } from './ScrollAreaThumb/ScrollAreaThumb.js';
|
|
4
8
|
import { factory } from '../../core/factory/factory.js';
|
|
5
9
|
import { useProps } from '../../core/MantineProvider/use-props/use-props.js';
|
|
6
|
-
import { useDirection } from '../../core/DirectionProvider/DirectionProvider.js';
|
|
7
10
|
import { useStyles } from '../../core/styles-api/use-styles/use-styles.js';
|
|
8
11
|
import { Box } from '../../core/Box/Box.js';
|
|
9
12
|
import { createVarsResolver } from '../../core/styles-api/create-vars-resolver/create-vars-resolver.js';
|
|
@@ -66,7 +69,6 @@ const ScrollArea = factory((_props, ref) => {
|
|
|
66
69
|
viewportRef,
|
|
67
70
|
onScrollPositionChange,
|
|
68
71
|
children,
|
|
69
|
-
variant,
|
|
70
72
|
offsetScrollbars
|
|
71
73
|
} = _a, others = __objRest(_a, [
|
|
72
74
|
"classNames",
|
|
@@ -82,10 +84,8 @@ const ScrollArea = factory((_props, ref) => {
|
|
|
82
84
|
"viewportRef",
|
|
83
85
|
"onScrollPositionChange",
|
|
84
86
|
"children",
|
|
85
|
-
"variant",
|
|
86
87
|
"offsetScrollbars"
|
|
87
88
|
]);
|
|
88
|
-
const { dir } = useDirection();
|
|
89
89
|
const [scrollbarHovered, setScrollbarHovered] = useState(false);
|
|
90
90
|
const getStyles = useStyles({
|
|
91
91
|
name: "ScrollArea",
|
|
@@ -99,37 +99,33 @@ const ScrollArea = factory((_props, ref) => {
|
|
|
99
99
|
vars,
|
|
100
100
|
varsResolver
|
|
101
101
|
});
|
|
102
|
-
return /* @__PURE__ */ React.createElement(
|
|
102
|
+
return /* @__PURE__ */ React.createElement(ScrollAreaRoot, __spreadValues(__spreadValues({
|
|
103
103
|
type: type === "never" ? "always" : type,
|
|
104
104
|
scrollHideDelay,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
asChild: true
|
|
108
|
-
}, /* @__PURE__ */ React.createElement(Box, __spreadValues(__spreadProps(__spreadValues({}, getStyles("root")), {
|
|
109
|
-
variant
|
|
110
|
-
}), others), /* @__PURE__ */ React.createElement(Rsa.Viewport, __spreadProps(__spreadValues(__spreadValues({}, viewportProps), getStyles("viewport")), {
|
|
105
|
+
ref
|
|
106
|
+
}, getStyles("root")), others), /* @__PURE__ */ React.createElement(ScrollAreaViewport, __spreadProps(__spreadValues(__spreadValues({}, viewportProps), getStyles("viewport")), {
|
|
111
107
|
ref: viewportRef,
|
|
112
108
|
"data-offset-scrollbars": offsetScrollbars || void 0,
|
|
113
109
|
onScroll: typeof onScrollPositionChange === "function" ? ({ currentTarget }) => onScrollPositionChange({
|
|
114
110
|
x: currentTarget.scrollLeft,
|
|
115
111
|
y: currentTarget.scrollTop
|
|
116
112
|
}) : void 0
|
|
117
|
-
}), children), /* @__PURE__ */ React.createElement(
|
|
113
|
+
}), children), /* @__PURE__ */ React.createElement(ScrollAreaScrollbar, __spreadProps(__spreadValues({}, getStyles("scrollbar")), {
|
|
118
114
|
orientation: "horizontal",
|
|
119
115
|
"data-hidden": type === "never" || void 0,
|
|
120
116
|
forceMount: true,
|
|
121
117
|
onMouseEnter: () => setScrollbarHovered(true),
|
|
122
118
|
onMouseLeave: () => setScrollbarHovered(false)
|
|
123
|
-
}), /* @__PURE__ */ React.createElement(
|
|
119
|
+
}), /* @__PURE__ */ React.createElement(ScrollAreaThumb, __spreadValues({}, getStyles("thumb")))), /* @__PURE__ */ React.createElement(ScrollAreaScrollbar, __spreadProps(__spreadValues({}, getStyles("scrollbar")), {
|
|
124
120
|
orientation: "vertical",
|
|
125
121
|
"data-hidden": type === "never" || void 0,
|
|
126
122
|
forceMount: true,
|
|
127
123
|
onMouseEnter: () => setScrollbarHovered(true),
|
|
128
124
|
onMouseLeave: () => setScrollbarHovered(false)
|
|
129
|
-
}), /* @__PURE__ */ React.createElement(
|
|
125
|
+
}), /* @__PURE__ */ React.createElement(ScrollAreaThumb, __spreadValues({}, getStyles("thumb")))), /* @__PURE__ */ React.createElement(ScrollAreaCorner, __spreadProps(__spreadValues({}, getStyles("corner")), {
|
|
130
126
|
"data-hovered": scrollbarHovered || void 0,
|
|
131
127
|
"data-hidden": type === "never" || void 0
|
|
132
|
-
})))
|
|
128
|
+
})));
|
|
133
129
|
});
|
|
134
130
|
ScrollArea.displayName = "@mantine/core/ScrollArea";
|
|
135
131
|
const ScrollAreaAutosize = factory((props, ref) => {
|