@mantine/core 7.0.0-alpha.20 → 7.0.0-alpha.22
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/Affix/Affix.js.map +1 -1
- package/cjs/components/AppShell/AppShell.context.js.map +1 -1
- package/cjs/components/AppShell/AppShell.js.map +1 -1
- package/cjs/components/AppShell/AppShellAside/AppShellAside.js.map +1 -1
- package/cjs/components/AppShell/AppShellFooter/AppShellFooter.js.map +1 -1
- package/cjs/components/AppShell/AppShellHeader/AppShellHeader.js.map +1 -1
- package/cjs/components/AppShell/AppShellMediaStyles/AppShellMediaStyles.js +1 -1
- package/cjs/components/AppShell/AppShellNavbar/AppShellNavbar.js.map +1 -1
- package/cjs/components/Checkbox/Checkbox.js.map +1 -1
- package/cjs/components/ColorInput/ColorInput.js +289 -0
- package/cjs/components/ColorInput/ColorInput.js.map +1 -0
- package/cjs/components/ColorInput/ColorInput.module.css.js +8 -0
- package/cjs/components/ColorInput/ColorInput.module.css.js.map +1 -0
- package/cjs/components/ColorInput/EyeDropperIcon.js +63 -0
- package/cjs/components/ColorInput/EyeDropperIcon.js.map +1 -0
- package/cjs/components/Dialog/Dialog.js +137 -0
- package/cjs/components/Dialog/Dialog.js.map +1 -0
- package/cjs/components/Dialog/Dialog.module.css.js +8 -0
- package/cjs/components/Dialog/Dialog.module.css.js.map +1 -0
- package/cjs/components/Flex/Flex.js +121 -0
- package/cjs/components/Flex/Flex.js.map +1 -0
- package/cjs/components/Flex/Flex.module.css.js +8 -0
- package/cjs/components/Flex/Flex.module.css.js.map +1 -0
- package/cjs/components/Flex/flex-props.js +16 -0
- package/cjs/components/Flex/flex-props.js.map +1 -0
- package/cjs/components/Grid/GridCol/GridCol.js +1 -1
- package/cjs/components/Grid/GridCol/GridColVariables.js +1 -1
- package/cjs/components/Highlight/Highlight.js.map +1 -1
- package/cjs/components/Indicator/Indicator.js.map +1 -1
- package/cjs/components/Input/InputPlaceholder/InputPlaceholder.js +13 -3
- package/cjs/components/Input/InputPlaceholder/InputPlaceholder.js.map +1 -1
- package/cjs/components/List/List.context.js +13 -0
- package/cjs/components/List/List.context.js.map +1 -0
- package/cjs/components/List/List.js +121 -0
- package/cjs/components/List/List.js.map +1 -0
- package/cjs/components/List/List.module.css.js +8 -0
- package/cjs/components/List/List.module.css.js.map +1 -0
- package/cjs/components/List/ListItem/ListItem.js +68 -0
- package/cjs/components/List/ListItem/ListItem.js.map +1 -0
- package/cjs/components/LoadingOverlay/LoadingOverlay.js +124 -0
- package/cjs/components/LoadingOverlay/LoadingOverlay.js.map +1 -0
- package/cjs/components/LoadingOverlay/LoadingOverlay.module.css.js +8 -0
- package/cjs/components/LoadingOverlay/LoadingOverlay.module.css.js.map +1 -0
- package/cjs/components/ModalBase/ModalBase.context.js.map +1 -1
- package/cjs/components/ModalBase/ModalBase.js.map +1 -1
- package/cjs/components/Notification/Notification.js +1 -11
- package/cjs/components/Notification/Notification.js.map +1 -1
- package/cjs/components/NumberInput/NumberInput.js +252 -0
- package/cjs/components/NumberInput/NumberInput.js.map +1 -0
- package/cjs/components/NumberInput/NumberInput.module.css.js +8 -0
- package/cjs/components/NumberInput/NumberInput.module.css.js.map +1 -0
- package/cjs/components/NumberInput/NumberInputChevron.js +66 -0
- package/cjs/components/NumberInput/NumberInputChevron.js.map +1 -0
- package/cjs/components/Overlay/Overlay.js.map +1 -1
- package/cjs/components/Paper/Paper.js.map +1 -1
- package/cjs/components/Popover/Popover.context.js.map +1 -1
- package/cjs/components/Popover/Popover.js.map +1 -1
- package/cjs/components/Popover/PopoverDropdown/PopoverDropdown.js.map +1 -1
- package/cjs/components/Radio/Radio.js +168 -0
- package/cjs/components/Radio/Radio.js.map +1 -0
- package/cjs/components/Radio/Radio.module.css.js +8 -0
- package/cjs/components/Radio/Radio.module.css.js.map +1 -0
- package/cjs/components/Radio/RadioGroup/RadioGroup.js +78 -0
- package/cjs/components/Radio/RadioGroup/RadioGroup.js.map +1 -0
- package/cjs/components/Radio/RadioGroup.context.js +11 -0
- package/cjs/components/Radio/RadioGroup.context.js.map +1 -0
- package/cjs/components/Radio/RadioIcon.js +55 -0
- package/cjs/components/Radio/RadioIcon.js.map +1 -0
- package/cjs/components/Stepper/Stepper.context.js +13 -0
- package/cjs/components/Stepper/Stepper.context.js.map +1 -0
- package/cjs/components/Stepper/Stepper.js +203 -0
- package/cjs/components/Stepper/Stepper.js.map +1 -0
- package/cjs/components/Stepper/Stepper.module.css.js +8 -0
- package/cjs/components/Stepper/Stepper.module.css.js.map +1 -0
- package/cjs/components/Stepper/StepperCompleted/StepperCompleted.js +9 -0
- package/cjs/components/Stepper/StepperCompleted/StepperCompleted.js.map +1 -0
- package/cjs/components/Stepper/StepperStep/StepperStep.js +163 -0
- package/cjs/components/Stepper/StepperStep/StepperStep.js.map +1 -0
- package/cjs/components/Text/Text.js +4 -2
- package/cjs/components/Text/Text.js.map +1 -1
- package/cjs/components/ThemeIcon/ThemeIcon.js +90 -0
- package/cjs/components/ThemeIcon/ThemeIcon.js.map +1 -0
- package/cjs/components/ThemeIcon/ThemeIcon.module.css.js +8 -0
- package/cjs/components/ThemeIcon/ThemeIcon.module.css.js.map +1 -0
- package/cjs/components/Timeline/Timeline.context.js +13 -0
- package/cjs/components/Timeline/Timeline.context.js.map +1 -0
- package/cjs/components/Timeline/Timeline.js +135 -0
- package/cjs/components/Timeline/Timeline.js.map +1 -0
- package/cjs/components/Timeline/Timeline.module.css.js +8 -0
- package/cjs/components/Timeline/Timeline.module.css.js.map +1 -0
- package/cjs/components/Timeline/TimelineItem/TimelineItem.js +116 -0
- package/cjs/components/Timeline/TimelineItem/TimelineItem.js.map +1 -0
- package/cjs/components/Title/Title.js.map +1 -1
- package/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/cjs/components/Tooltip/TooltipFloating/TooltipFloating.js.map +1 -1
- package/cjs/components/Transition/Transition.js +1 -1
- package/cjs/components/Transition/Transition.js.map +1 -1
- package/cjs/components/VisuallyHidden/VisuallyHidden.js +20 -6
- package/cjs/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/cjs/core/Box/style-props/parse-style-props/parse-style-props.js.map +1 -1
- package/cjs/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.js +7 -4
- package/cjs/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.js.map +1 -1
- package/cjs/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.js +1 -1
- package/cjs/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.js.map +1 -1
- package/cjs/core/factory/factory.js.map +1 -1
- package/cjs/core/utils/create-use-external-events/create-use-external-events.js +34 -0
- package/cjs/core/utils/create-use-external-events/create-use-external-events.js.map +1 -0
- package/cjs/index.css +849 -16
- package/cjs/index.js +41 -0
- package/cjs/index.js.map +1 -1
- package/esm/components/Affix/Affix.js.map +1 -1
- package/esm/components/AppShell/AppShell.context.js.map +1 -1
- package/esm/components/AppShell/AppShell.js.map +1 -1
- package/esm/components/AppShell/AppShellAside/AppShellAside.js.map +1 -1
- package/esm/components/AppShell/AppShellFooter/AppShellFooter.js.map +1 -1
- package/esm/components/AppShell/AppShellHeader/AppShellHeader.js.map +1 -1
- package/esm/components/AppShell/AppShellMediaStyles/AppShellMediaStyles.js +1 -1
- package/esm/components/AppShell/AppShellNavbar/AppShellNavbar.js.map +1 -1
- package/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/esm/components/ColorInput/ColorInput.js +281 -0
- package/esm/components/ColorInput/ColorInput.js.map +1 -0
- package/esm/components/ColorInput/ColorInput.module.css.js +4 -0
- package/esm/components/ColorInput/ColorInput.module.css.js.map +1 -0
- package/esm/components/ColorInput/EyeDropperIcon.js +55 -0
- package/esm/components/ColorInput/EyeDropperIcon.js.map +1 -0
- package/esm/components/Dialog/Dialog.js +129 -0
- package/esm/components/Dialog/Dialog.js.map +1 -0
- package/esm/components/Dialog/Dialog.module.css.js +4 -0
- package/esm/components/Dialog/Dialog.module.css.js.map +1 -0
- package/esm/components/Flex/Flex.js +113 -0
- package/esm/components/Flex/Flex.js.map +1 -0
- package/esm/components/Flex/Flex.module.css.js +4 -0
- package/esm/components/Flex/Flex.module.css.js.map +1 -0
- package/esm/components/Flex/flex-props.js +12 -0
- package/esm/components/Flex/flex-props.js.map +1 -0
- package/esm/components/Grid/GridCol/GridCol.js +1 -1
- package/esm/components/Grid/GridCol/GridColVariables.js +1 -1
- package/esm/components/Highlight/Highlight.js.map +1 -1
- package/esm/components/Indicator/Indicator.js.map +1 -1
- package/esm/components/Input/InputPlaceholder/InputPlaceholder.js +13 -3
- package/esm/components/Input/InputPlaceholder/InputPlaceholder.js.map +1 -1
- package/esm/components/List/List.context.js +8 -0
- package/esm/components/List/List.context.js.map +1 -0
- package/esm/components/List/List.js +113 -0
- package/esm/components/List/List.js.map +1 -0
- package/esm/components/List/List.module.css.js +4 -0
- package/esm/components/List/List.module.css.js.map +1 -0
- package/esm/components/List/ListItem/ListItem.js +60 -0
- package/esm/components/List/ListItem/ListItem.js.map +1 -0
- package/esm/components/LoadingOverlay/LoadingOverlay.js +116 -0
- package/esm/components/LoadingOverlay/LoadingOverlay.js.map +1 -0
- package/esm/components/LoadingOverlay/LoadingOverlay.module.css.js +4 -0
- package/esm/components/LoadingOverlay/LoadingOverlay.module.css.js.map +1 -0
- package/esm/components/ModalBase/ModalBase.context.js.map +1 -1
- package/esm/components/ModalBase/ModalBase.js.map +1 -1
- package/esm/components/Notification/Notification.js +1 -11
- package/esm/components/Notification/Notification.js.map +1 -1
- package/esm/components/NumberInput/NumberInput.js +244 -0
- package/esm/components/NumberInput/NumberInput.js.map +1 -0
- package/esm/components/NumberInput/NumberInput.module.css.js +4 -0
- package/esm/components/NumberInput/NumberInput.module.css.js.map +1 -0
- package/esm/components/NumberInput/NumberInputChevron.js +58 -0
- package/esm/components/NumberInput/NumberInputChevron.js.map +1 -0
- package/esm/components/Overlay/Overlay.js.map +1 -1
- package/esm/components/Paper/Paper.js.map +1 -1
- package/esm/components/Popover/Popover.context.js.map +1 -1
- package/esm/components/Popover/Popover.js.map +1 -1
- package/esm/components/Popover/PopoverDropdown/PopoverDropdown.js.map +1 -1
- package/esm/components/Radio/Radio.js +160 -0
- package/esm/components/Radio/Radio.js.map +1 -0
- package/esm/components/Radio/Radio.module.css.js +4 -0
- package/esm/components/Radio/Radio.module.css.js.map +1 -0
- package/esm/components/Radio/RadioGroup/RadioGroup.js +70 -0
- package/esm/components/Radio/RadioGroup/RadioGroup.js.map +1 -0
- package/esm/components/Radio/RadioGroup.context.js +6 -0
- package/esm/components/Radio/RadioGroup.context.js.map +1 -0
- package/esm/components/Radio/RadioIcon.js +47 -0
- package/esm/components/Radio/RadioIcon.js.map +1 -0
- package/esm/components/Stepper/Stepper.context.js +8 -0
- package/esm/components/Stepper/Stepper.context.js.map +1 -0
- package/esm/components/Stepper/Stepper.js +195 -0
- package/esm/components/Stepper/Stepper.js.map +1 -0
- package/esm/components/Stepper/Stepper.module.css.js +4 -0
- package/esm/components/Stepper/Stepper.module.css.js.map +1 -0
- package/esm/components/Stepper/StepperCompleted/StepperCompleted.js +5 -0
- package/esm/components/Stepper/StepperCompleted/StepperCompleted.js.map +1 -0
- package/esm/components/Stepper/StepperStep/StepperStep.js +155 -0
- package/esm/components/Stepper/StepperStep/StepperStep.js.map +1 -0
- package/esm/components/Text/Text.js +4 -2
- package/esm/components/Text/Text.js.map +1 -1
- package/esm/components/ThemeIcon/ThemeIcon.js +82 -0
- package/esm/components/ThemeIcon/ThemeIcon.js.map +1 -0
- package/esm/components/ThemeIcon/ThemeIcon.module.css.js +4 -0
- package/esm/components/ThemeIcon/ThemeIcon.module.css.js.map +1 -0
- package/esm/components/Timeline/Timeline.context.js +8 -0
- package/esm/components/Timeline/Timeline.context.js.map +1 -0
- package/esm/components/Timeline/Timeline.js +127 -0
- package/esm/components/Timeline/Timeline.js.map +1 -0
- package/esm/components/Timeline/Timeline.module.css.js +4 -0
- package/esm/components/Timeline/Timeline.module.css.js.map +1 -0
- package/esm/components/Timeline/TimelineItem/TimelineItem.js +108 -0
- package/esm/components/Timeline/TimelineItem/TimelineItem.js.map +1 -0
- package/esm/components/Title/Title.js.map +1 -1
- package/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/esm/components/Tooltip/TooltipFloating/TooltipFloating.js.map +1 -1
- package/esm/components/Transition/Transition.js +1 -1
- package/esm/components/Transition/Transition.js.map +1 -1
- package/esm/components/VisuallyHidden/VisuallyHidden.js +20 -5
- package/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/esm/core/Box/style-props/parse-style-props/parse-style-props.js.map +1 -1
- package/esm/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.js +7 -4
- package/esm/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.js.map +1 -1
- package/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.js +1 -1
- package/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.js.map +1 -1
- package/esm/core/factory/factory.js.map +1 -1
- package/esm/core/utils/create-use-external-events/create-use-external-events.js +30 -0
- package/esm/core/utils/create-use-external-events/create-use-external-events.js.map +1 -0
- package/esm/index.css +849 -16
- package/esm/index.js +20 -0
- package/esm/index.js.map +1 -1
- package/esm/styles/ActionIcon.css +1 -1
- package/esm/styles/Chip.css +1 -1
- package/esm/styles/ColorInput.css +1 -0
- package/esm/styles/Combobox.css +1 -1
- package/esm/styles/Dialog.css +1 -0
- package/esm/styles/Flex.css +1 -0
- package/esm/styles/Input.css +1 -1
- package/esm/styles/List.css +1 -0
- package/esm/styles/LoadingOverlay.css +1 -0
- package/esm/styles/ModalBase.css +1 -1
- package/esm/styles/NumberInput.css +1 -0
- package/esm/styles/Radio.css +1 -0
- package/esm/styles/Rating.css +1 -1
- package/esm/styles/Stepper.css +1 -0
- package/esm/styles/Switch.css +1 -1
- package/esm/styles/Text.css +1 -1
- package/esm/styles/ThemeIcon.css +1 -0
- package/esm/styles/Timeline.css +1 -0
- package/esm/styles/global.css +1 -1
- package/lib/components/Affix/Affix.d.ts +4 -3
- package/lib/components/Affix/index.d.ts +1 -1
- package/lib/components/AppShell/AppShell.context.d.ts +1 -1
- package/lib/components/AppShell/AppShell.d.ts +1 -1
- package/lib/components/AppShell/AppShellAside/AppShellAside.d.ts +1 -2
- package/lib/components/AppShell/AppShellFooter/AppShellFooter.d.ts +1 -2
- package/lib/components/AppShell/AppShellHeader/AppShellHeader.d.ts +1 -2
- package/lib/components/AppShell/AppShellNavbar/AppShellNavbar.d.ts +1 -2
- package/lib/components/Checkbox/Checkbox.d.ts +1 -1
- package/lib/components/ColorInput/ColorInput.d.ts +42 -0
- package/lib/components/ColorInput/EyeDropperIcon.d.ts +2 -0
- package/lib/components/ColorInput/index.d.ts +2 -0
- package/lib/components/ColorPicker/index.d.ts +2 -1
- package/lib/components/Dialog/Dialog.d.ts +37 -0
- package/lib/components/Dialog/index.d.ts +2 -0
- package/lib/components/Flex/Flex.d.ts +29 -0
- package/lib/components/Flex/flex-props.d.ts +2 -0
- package/lib/components/Flex/index.d.ts +3 -0
- package/lib/components/Highlight/Highlight.d.ts +1 -1
- package/lib/components/Image/Image.d.ts +1 -1
- package/lib/components/Indicator/Indicator.d.ts +1 -1
- package/lib/components/Input/InputPlaceholder/InputPlaceholder.d.ts +3 -0
- package/lib/components/Input/use-input-props.d.ts +7 -7
- package/lib/components/List/List.context.d.ts +13 -0
- package/lib/components/List/List.d.ts +43 -0
- package/lib/components/List/ListItem/ListItem.d.ts +21 -0
- package/lib/components/List/index.d.ts +4 -0
- package/lib/components/LoadingOverlay/LoadingOverlay.d.ts +32 -0
- package/lib/components/LoadingOverlay/index.d.ts +2 -0
- package/lib/components/ModalBase/ModalBase.context.d.ts +1 -1
- package/lib/components/ModalBase/ModalBase.d.ts +1 -1
- package/lib/components/NumberInput/NumberInput.d.ts +78 -0
- package/lib/components/NumberInput/NumberInputChevron.d.ts +6 -0
- package/lib/components/NumberInput/index.d.ts +2 -0
- package/lib/components/Overlay/Overlay.d.ts +1 -1
- package/lib/components/Paper/Paper.d.ts +3 -1
- package/lib/components/Paper/index.d.ts +1 -1
- package/lib/components/Popover/Popover.context.d.ts +1 -1
- package/lib/components/Popover/Popover.d.ts +1 -1
- package/lib/components/Radio/Radio.d.ts +47 -0
- package/lib/components/Radio/RadioGroup/RadioGroup.d.ts +30 -0
- package/lib/components/Radio/RadioGroup.context.d.ts +13 -0
- package/lib/components/Radio/RadioIcon.d.ts +5 -0
- package/lib/components/Radio/index.d.ts +6 -0
- package/lib/components/Stepper/Stepper.context.d.ts +13 -0
- package/lib/components/Stepper/Stepper.d.ts +63 -0
- package/lib/components/Stepper/StepperCompleted/StepperCompleted.d.ts +6 -0
- package/lib/components/Stepper/StepperStep/StepperStep.d.ts +50 -0
- package/lib/components/Stepper/index.d.ts +6 -0
- package/lib/components/Text/Text.d.ts +3 -1
- package/lib/components/ThemeIcon/ThemeIcon.d.ts +33 -0
- package/lib/components/ThemeIcon/index.d.ts +2 -0
- package/lib/components/Timeline/Timeline.context.d.ts +11 -0
- package/lib/components/Timeline/Timeline.d.ts +43 -0
- package/lib/components/Timeline/TimelineItem/TimelineItem.d.ts +35 -0
- package/lib/components/Timeline/index.d.ts +4 -0
- package/lib/components/Title/Title.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.types.d.ts +1 -1
- package/lib/components/Transition/Transition.d.ts +1 -1
- package/lib/components/VisuallyHidden/VisuallyHidden.d.ts +13 -7
- package/lib/components/index.d.ts +10 -0
- package/lib/core/Box/style-props/index.d.ts +1 -0
- package/lib/core/Box/style-props/parse-style-props/parse-style-props.d.ts +2 -2
- package/lib/core/factory/factory.d.ts +2 -1
- package/lib/core/factory/index.d.ts +1 -1
- package/lib/core/utils/create-use-external-events/create-use-external-events.d.ts +1 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/package.json +4 -3
- package/cjs/components/AppShell/AppShellMediaStyles/get-breakpoint-value/get-breakpoint-value.js +0 -19
- package/cjs/components/AppShell/AppShellMediaStyles/get-breakpoint-value/get-breakpoint-value.js.map +0 -1
- package/cjs/components/AppShell/AppShellMediaStyles/get-sorted-breakpoints/get-sorted-breakpoints.js +0 -17
- package/cjs/components/AppShell/AppShellMediaStyles/get-sorted-breakpoints/get-sorted-breakpoints.js.map +0 -1
- package/esm/components/AppShell/AppShellMediaStyles/get-breakpoint-value/get-breakpoint-value.js +0 -15
- package/esm/components/AppShell/AppShellMediaStyles/get-breakpoint-value/get-breakpoint-value.js.map +0 -1
- package/esm/components/AppShell/AppShellMediaStyles/get-sorted-breakpoints/get-sorted-breakpoints.js +0 -13
- package/esm/components/AppShell/AppShellMediaStyles/get-sorted-breakpoints/get-sorted-breakpoints.js.map +0 -1
- package/lib/components/AppShell/AppShellMediaStyles/assign-header-variables.d.ts +0 -12
- package/lib/components/AppShell/AppShellMediaStyles/assign-navbar-variables.d.ts +0 -12
- package/lib/components/AppShell/AppShellMediaStyles/get-base-size.d.ts +0 -2
- package/lib/components/AppShell/AppShellMediaStyles/get-breakpoint-value/get-breakpoint-value.d.ts +0 -2
- package/lib/components/AppShell/AppShellMediaStyles/get-breakpoint-value.d.ts +0 -2
- package/lib/components/AppShell/AppShellMediaStyles/get-padding-value.d.ts +0 -1
- package/lib/components/AppShell/AppShellMediaStyles/get-sorted-breakpoints/get-sorted-breakpoints.d.ts +0 -5
- package/lib/components/AppShell/AppShellMediaStyles/get-sorted-breakpoints.d.ts +0 -5
- package/lib/components/AppShell/AppShellMediaStyles/is-primitive-size.d.ts +0 -2
- package/lib/components/AppShell/AppShellMediaStyles/is-responsive-size.d.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalBase.js","sources":["../../../src/components/ModalBase/ModalBase.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport {\n Box,\n BoxProps,\n ElementProps,\n MantineShadow,\n MantineSize,\n MantineSpacing,\n getDefaultZIndex,\n getShadow,\n getSpacing,\n} from '../../core';\nimport { OptionalPortal, PortalProps } from '../Portal';\nimport { TransitionOverride } from '../Transition';\nimport { ModalBaseProvider } from './ModalBase.context';\nimport { useModal } from './use-modal';\n\nexport interface ModalBaseProps extends BoxProps, ElementProps<'div', 'title'> {\n /** If set modal/drawer 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 /** Determines whether modal/drawer is opened */\n opened: boolean;\n\n /** Called when modal/drawer is closed */\n onClose(): void;\n\n /** Id used to connect modal/drawer with body and title */\n id?: string;\n\n /** Determines whether scroll should be locked when `opened={true}`, `true` by default */\n lockScroll?: boolean;\n\n /** Determines whether focus should be trapped, `true` by default */\n trapFocus?: boolean;\n\n /** Determines whether the component should be rendered inside `Portal`, `true` by default */\n withinPortal?: boolean;\n\n /** Props passed down to the Portal component when `withinPortal` is set */\n portalProps?: Omit<PortalProps, 'children'>;\n\n /** Modal/drawer content */\n children?: React.ReactNode;\n\n /** Determines whether the modal/drawer should be closed when user clicks on the overlay, `true` by default */\n closeOnClickOutside?: boolean;\n\n /** Props added to the `Transition` component that used to animate overlay and body, use to configure duration and animation type, `{ duration: 200, transition: 'pop' }` by default */\n transitionProps?: TransitionOverride;\n\n /** Determines whether `onClose` should be called when user presses the escape key, `true` by default */\n closeOnEscape?: boolean;\n\n /** Determines whether focus should be returned to the last active element when `onClose` is called, `true` by default */\n returnFocus?: boolean;\n\n /** `z-index` CSS property of the root element, `200` by default */\n zIndex?:
|
|
1
|
+
{"version":3,"file":"ModalBase.js","sources":["../../../src/components/ModalBase/ModalBase.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport {\n Box,\n BoxProps,\n ElementProps,\n MantineShadow,\n MantineSize,\n MantineSpacing,\n getDefaultZIndex,\n getShadow,\n getSpacing,\n} from '../../core';\nimport { OptionalPortal, PortalProps } from '../Portal';\nimport { TransitionOverride } from '../Transition';\nimport { ModalBaseProvider } from './ModalBase.context';\nimport { useModal } from './use-modal';\n\nexport interface ModalBaseProps extends BoxProps, ElementProps<'div', 'title'> {\n /** If set modal/drawer 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 /** Determines whether modal/drawer is opened */\n opened: boolean;\n\n /** Called when modal/drawer is closed */\n onClose(): void;\n\n /** Id used to connect modal/drawer with body and title */\n id?: string;\n\n /** Determines whether scroll should be locked when `opened={true}`, `true` by default */\n lockScroll?: boolean;\n\n /** Determines whether focus should be trapped, `true` by default */\n trapFocus?: boolean;\n\n /** Determines whether the component should be rendered inside `Portal`, `true` by default */\n withinPortal?: boolean;\n\n /** Props passed down to the Portal component when `withinPortal` is set */\n portalProps?: Omit<PortalProps, 'children'>;\n\n /** Modal/drawer content */\n children?: React.ReactNode;\n\n /** Determines whether the modal/drawer should be closed when user clicks on the overlay, `true` by default */\n closeOnClickOutside?: boolean;\n\n /** Props added to the `Transition` component that used to animate overlay and body, use to configure duration and animation type, `{ duration: 200, transition: 'pop' }` by default */\n transitionProps?: TransitionOverride;\n\n /** Determines whether `onClose` should be called when user presses the escape key, `true` by default */\n closeOnEscape?: boolean;\n\n /** Determines whether focus should be returned to the last active element when `onClose` is called, `true` by default */\n returnFocus?: boolean;\n\n /** `z-index` CSS property of the root element, `200` by default */\n zIndex?: string | number;\n\n /** Key of `theme.shadows` or any valid CSS box-shadow value, 'xl' by default */\n shadow?: MantineShadow | (string & {});\n\n /** Key of `theme.spacing` or any valid CSS value to set content, header and footer padding, `'md'` by default */\n padding?: MantineSpacing | (string & {}) | number;\n\n /** Controls width of the content area, `'md'` by default */\n size?: MantineSize | (string & {}) | number;\n}\n\nexport const ModalBase = forwardRef<HTMLDivElement, ModalBaseProps>(\n (\n {\n keepMounted,\n opened,\n onClose,\n id,\n transitionProps,\n trapFocus,\n closeOnEscape,\n returnFocus,\n closeOnClickOutside,\n withinPortal,\n portalProps,\n lockScroll,\n children,\n zIndex,\n shadow,\n padding,\n __vars,\n ...others\n },\n ref\n ) => {\n const { _id, titleMounted, bodyMounted, shouldLockScroll, setTitleMounted, setBodyMounted } =\n useModal({ id, transitionProps, opened, trapFocus, closeOnEscape, onClose, returnFocus });\n\n return (\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <ModalBaseProvider\n value={{\n opened,\n onClose,\n closeOnClickOutside,\n transitionProps: { ...transitionProps, keepMounted },\n getTitleId: () => `${_id}-title`,\n getBodyId: () => `${_id}-body`,\n titleMounted,\n bodyMounted,\n setTitleMounted,\n setBodyMounted,\n trapFocus,\n closeOnEscape,\n zIndex,\n }}\n >\n <RemoveScroll enabled={shouldLockScroll && lockScroll}>\n <Box\n ref={ref}\n {...others}\n __vars={{\n ...__vars,\n '--mb-z-index': (zIndex || getDefaultZIndex('modal')).toString(),\n '--mb-shadow': getShadow(shadow),\n '--mb-padding': getSpacing(padding),\n }}\n >\n {children}\n </Box>\n </RemoveScroll>\n </ModalBaseProvider>\n </OptionalPortal>\n );\n }\n);\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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|
@@ -116,17 +116,7 @@ const Notification = factory((_props, ref) => {
|
|
|
116
116
|
}),
|
|
117
117
|
icon && !loading && /* @__PURE__ */ React.createElement("div", __spreadValues({}, getStyles("icon")), icon),
|
|
118
118
|
loading && /* @__PURE__ */ React.createElement(Loader, __spreadValues({ size: 28, color }, getStyles("loader"))),
|
|
119
|
-
/* @__PURE__ */ React.createElement("div", __spreadValues({}, getStyles("body")), title && /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({}, getStyles("title")), { size: "sm", fw: 500 }), title), /* @__PURE__ */ React.createElement(
|
|
120
|
-
Text,
|
|
121
|
-
__spreadProps(__spreadValues({}, getStyles("description")), {
|
|
122
|
-
color: "dimmed",
|
|
123
|
-
mod: {
|
|
124
|
-
"data-with-title": !!title
|
|
125
|
-
},
|
|
126
|
-
size: "sm"
|
|
127
|
-
}),
|
|
128
|
-
children
|
|
129
|
-
)),
|
|
119
|
+
/* @__PURE__ */ React.createElement("div", __spreadValues({}, getStyles("body")), title && /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({}, getStyles("title")), { size: "sm", fw: 500 }), title), /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({}, getStyles("description")), { mod: { "data-with-title": !!title }, size: "sm" }), children)),
|
|
130
120
|
withCloseButton && /* @__PURE__ */ React.createElement(
|
|
131
121
|
CloseButton,
|
|
132
122
|
__spreadValues(__spreadProps(__spreadValues({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.js","sources":["../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n createVarsResolver,\n Factory,\n MantineRadius,\n MantineColor,\n getRadius,\n getThemeColor,\n} from '../../core';\nimport classes from './Notification.module.css';\nimport { Loader } from '../Loader';\nimport { Text } from '../Text';\nimport { CloseButton } from '../CloseButton';\n\nexport type NotificationStylesNames =\n | 'root'\n | 'icon'\n | 'loader'\n | 'body'\n | 'title'\n | 'description'\n | 'closeButton';\nexport type NotificationCssVariables = {\n root: '--notification-radius' | '--notification-color';\n};\n\nexport interface NotificationProps\n extends BoxProps,\n StylesApiProps<NotificationFactory>,\n ElementProps<'div', 'title'> {\n variant?: string;\n\n /** Called when close button is clicked */\n onClose?(): void;\n\n /** Controls notification line or icon color, key of `theme.colors` or any valid CSS color, `theme.primaryColor` by default */\n color?: MantineColor;\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 /** Notification icon, replaces color line */\n icon?: React.ReactNode;\n\n /** Notification title, displayed before body */\n title?: React.ReactNode;\n\n /** Notification body, place main text here */\n children?: React.ReactNode;\n\n /** Replaces colored line or icon with Loader component */\n loading?: boolean;\n\n /** Determines whether notification should have a border, `false` by default */\n withBorder?: boolean;\n\n /** Determines whether close button should be visible, `true` by default */\n withCloseButton?: boolean;\n\n /** Props passed down to the close button */\n closeButtonProps?: Record<string, any>;\n}\n\nexport type NotificationFactory = Factory<{\n props: NotificationProps;\n ref: HTMLDivElement;\n stylesNames: NotificationStylesNames;\n vars: NotificationCssVariables;\n}>;\n\nconst defaultProps: Partial<NotificationProps> = {\n withCloseButton: true,\n};\n\nconst varsResolver = createVarsResolver<NotificationFactory>((theme, { radius, color }) => ({\n root: {\n '--notification-radius': getRadius(radius),\n '--notification-color': getThemeColor(color, theme),\n },\n}));\n\nexport const Notification = factory<NotificationFactory>((_props, ref) => {\n const props = useProps('Notification', defaultProps, _props);\n const {\n className,\n color,\n radius,\n loading,\n withCloseButton,\n withBorder,\n title,\n icon,\n children,\n onClose,\n closeButtonProps,\n classNames,\n style,\n styles,\n unstyled,\n variant,\n vars,\n ...others\n } = props;\n\n const getStyles = useStyles<NotificationFactory>({\n name: 'Notification',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n return (\n <Box\n {...getStyles('root')}\n mod={{\n 'data-with-icon': !!icon || loading,\n 'data-with-border': withBorder,\n }}\n ref={ref}\n variant={variant}\n {...others}\n role=\"alert\"\n >\n {icon && !loading && <div {...getStyles('icon')}>{icon}</div>}\n {loading && <Loader size={28} color={color} {...getStyles('loader')} />}\n\n <div {...getStyles('body')}>\n {title && (\n <Text {...getStyles('title')} size=\"sm\" fw={500}>\n {title}\n </Text>\n )}\n\n <Text
|
|
1
|
+
{"version":3,"file":"Notification.js","sources":["../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Box,\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n createVarsResolver,\n Factory,\n MantineRadius,\n MantineColor,\n getRadius,\n getThemeColor,\n} from '../../core';\nimport classes from './Notification.module.css';\nimport { Loader } from '../Loader';\nimport { Text } from '../Text';\nimport { CloseButton } from '../CloseButton';\n\nexport type NotificationStylesNames =\n | 'root'\n | 'icon'\n | 'loader'\n | 'body'\n | 'title'\n | 'description'\n | 'closeButton';\nexport type NotificationCssVariables = {\n root: '--notification-radius' | '--notification-color';\n};\n\nexport interface NotificationProps\n extends BoxProps,\n StylesApiProps<NotificationFactory>,\n ElementProps<'div', 'title'> {\n variant?: string;\n\n /** Called when close button is clicked */\n onClose?(): void;\n\n /** Controls notification line or icon color, key of `theme.colors` or any valid CSS color, `theme.primaryColor` by default */\n color?: MantineColor;\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 /** Notification icon, replaces color line */\n icon?: React.ReactNode;\n\n /** Notification title, displayed before body */\n title?: React.ReactNode;\n\n /** Notification body, place main text here */\n children?: React.ReactNode;\n\n /** Replaces colored line or icon with Loader component */\n loading?: boolean;\n\n /** Determines whether notification should have a border, `false` by default */\n withBorder?: boolean;\n\n /** Determines whether close button should be visible, `true` by default */\n withCloseButton?: boolean;\n\n /** Props passed down to the close button */\n closeButtonProps?: Record<string, any>;\n}\n\nexport type NotificationFactory = Factory<{\n props: NotificationProps;\n ref: HTMLDivElement;\n stylesNames: NotificationStylesNames;\n vars: NotificationCssVariables;\n}>;\n\nconst defaultProps: Partial<NotificationProps> = {\n withCloseButton: true,\n};\n\nconst varsResolver = createVarsResolver<NotificationFactory>((theme, { radius, color }) => ({\n root: {\n '--notification-radius': getRadius(radius),\n '--notification-color': getThemeColor(color, theme),\n },\n}));\n\nexport const Notification = factory<NotificationFactory>((_props, ref) => {\n const props = useProps('Notification', defaultProps, _props);\n const {\n className,\n color,\n radius,\n loading,\n withCloseButton,\n withBorder,\n title,\n icon,\n children,\n onClose,\n closeButtonProps,\n classNames,\n style,\n styles,\n unstyled,\n variant,\n vars,\n ...others\n } = props;\n\n const getStyles = useStyles<NotificationFactory>({\n name: 'Notification',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n return (\n <Box\n {...getStyles('root')}\n mod={{\n 'data-with-icon': !!icon || loading,\n 'data-with-border': withBorder,\n }}\n ref={ref}\n variant={variant}\n {...others}\n role=\"alert\"\n >\n {icon && !loading && <div {...getStyles('icon')}>{icon}</div>}\n {loading && <Loader size={28} color={color} {...getStyles('loader')} />}\n\n <div {...getStyles('body')}>\n {title && (\n <Text {...getStyles('title')} size=\"sm\" fw={500}>\n {title}\n </Text>\n )}\n\n <Text {...getStyles('description')} mod={{ 'data-with-title': !!title }} size=\"sm\">\n {children}\n </Text>\n </div>\n\n {withCloseButton && (\n <CloseButton\n iconSize={16}\n color=\"gray\"\n {...closeButtonProps}\n onClick={onClose}\n {...getStyles('closeButton')}\n />\n )}\n </Box>\n );\n});\n\nNotification.classes = classes;\nNotification.displayName = '@mantine/core/Notification';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MA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C;AACnC,KAAK;AACL,GAAG,CAAC;AACJ,CAAC,EAAE;AACH,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;AAC/B,YAAY,CAAC,WAAW,GAAG,4BAA4B;;;;"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NumericFormat } from 'react-number-format';
|
|
3
|
+
import { useUncontrolled, assignRef, clamp } from '@mantine/hooks';
|
|
4
|
+
import { NumberInputChevron } from './NumberInputChevron.js';
|
|
5
|
+
import classes from './NumberInput.module.css.js';
|
|
6
|
+
import { UnstyledButton } from '../UnstyledButton/UnstyledButton.js';
|
|
7
|
+
import { InputBase } from '../InputBase/InputBase.js';
|
|
8
|
+
import { factory } from '../../core/factory/factory.js';
|
|
9
|
+
import { useProps } from '../../core/MantineProvider/use-props/use-props.js';
|
|
10
|
+
import { useStyles } from '../../core/styles-api/use-styles/use-styles.js';
|
|
11
|
+
import { useResolvedStylesApi } from '../../core/styles-api/use-resolved-styles-api/use-resolved-styles-api.js';
|
|
12
|
+
import { createVarsResolver } from '../../core/styles-api/create-vars-resolver/create-vars-resolver.js';
|
|
13
|
+
import { getSize } from '../../core/utils/get-size/get-size.js';
|
|
14
|
+
|
|
15
|
+
var __defProp = Object.defineProperty;
|
|
16
|
+
var __defProps = Object.defineProperties;
|
|
17
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
18
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
19
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
20
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
21
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
22
|
+
var __spreadValues = (a, b) => {
|
|
23
|
+
for (var prop in b || (b = {}))
|
|
24
|
+
if (__hasOwnProp.call(b, prop))
|
|
25
|
+
__defNormalProp(a, prop, b[prop]);
|
|
26
|
+
if (__getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
28
|
+
if (__propIsEnum.call(b, prop))
|
|
29
|
+
__defNormalProp(a, prop, b[prop]);
|
|
30
|
+
}
|
|
31
|
+
return a;
|
|
32
|
+
};
|
|
33
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
34
|
+
var __objRest = (source, exclude) => {
|
|
35
|
+
var target = {};
|
|
36
|
+
for (var prop in source)
|
|
37
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
38
|
+
target[prop] = source[prop];
|
|
39
|
+
if (source != null && __getOwnPropSymbols)
|
|
40
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
41
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
42
|
+
target[prop] = source[prop];
|
|
43
|
+
}
|
|
44
|
+
return target;
|
|
45
|
+
};
|
|
46
|
+
function isValidNumber(value) {
|
|
47
|
+
return typeof value === "number" && !Number.isNaN(value);
|
|
48
|
+
}
|
|
49
|
+
function getDecrementedValue({ value, min, step = 1, allowNegative }) {
|
|
50
|
+
const nextValue = value - step;
|
|
51
|
+
if (!allowNegative && nextValue < 0 && min === void 0) {
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
if (min !== void 0 && min >= 0 && nextValue <= min) {
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
return nextValue;
|
|
58
|
+
}
|
|
59
|
+
function isInRange(value, min, max) {
|
|
60
|
+
if (value === void 0) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
const minValid = min === void 0 || value >= min;
|
|
64
|
+
const maxValid = max === void 0 || value <= max;
|
|
65
|
+
return minValid && maxValid;
|
|
66
|
+
}
|
|
67
|
+
const defaultProps = {
|
|
68
|
+
step: 1,
|
|
69
|
+
size: "sm",
|
|
70
|
+
clampBehavior: "blur",
|
|
71
|
+
allowDecimal: true,
|
|
72
|
+
startValue: 0
|
|
73
|
+
};
|
|
74
|
+
const varsResolver = createVarsResolver((_, { size }) => ({
|
|
75
|
+
controls: {
|
|
76
|
+
"--ni-chevron-size": getSize(size, "ni-chevron-size")
|
|
77
|
+
}
|
|
78
|
+
}));
|
|
79
|
+
const NumberInput = factory((_props, ref) => {
|
|
80
|
+
const props = useProps("NumberInput", defaultProps, _props);
|
|
81
|
+
const _a = props, {
|
|
82
|
+
classNames,
|
|
83
|
+
styles,
|
|
84
|
+
unstyled,
|
|
85
|
+
vars,
|
|
86
|
+
onChange,
|
|
87
|
+
onValueChange,
|
|
88
|
+
value,
|
|
89
|
+
defaultValue,
|
|
90
|
+
max,
|
|
91
|
+
min,
|
|
92
|
+
step,
|
|
93
|
+
hideControls,
|
|
94
|
+
rightSection,
|
|
95
|
+
isAllowed,
|
|
96
|
+
clampBehavior,
|
|
97
|
+
onBlur,
|
|
98
|
+
allowDecimal,
|
|
99
|
+
decimalScale,
|
|
100
|
+
onKeyDown,
|
|
101
|
+
handlersRef,
|
|
102
|
+
startValue,
|
|
103
|
+
disabled,
|
|
104
|
+
rightSectionPointerEvents,
|
|
105
|
+
allowNegative
|
|
106
|
+
} = _a, others = __objRest(_a, [
|
|
107
|
+
"classNames",
|
|
108
|
+
"styles",
|
|
109
|
+
"unstyled",
|
|
110
|
+
"vars",
|
|
111
|
+
"onChange",
|
|
112
|
+
"onValueChange",
|
|
113
|
+
"value",
|
|
114
|
+
"defaultValue",
|
|
115
|
+
"max",
|
|
116
|
+
"min",
|
|
117
|
+
"step",
|
|
118
|
+
"hideControls",
|
|
119
|
+
"rightSection",
|
|
120
|
+
"isAllowed",
|
|
121
|
+
"clampBehavior",
|
|
122
|
+
"onBlur",
|
|
123
|
+
"allowDecimal",
|
|
124
|
+
"decimalScale",
|
|
125
|
+
"onKeyDown",
|
|
126
|
+
"handlersRef",
|
|
127
|
+
"startValue",
|
|
128
|
+
"disabled",
|
|
129
|
+
"rightSectionPointerEvents",
|
|
130
|
+
"allowNegative"
|
|
131
|
+
]);
|
|
132
|
+
const getStyles = useStyles({
|
|
133
|
+
name: "NumberInput",
|
|
134
|
+
classes,
|
|
135
|
+
props,
|
|
136
|
+
classNames,
|
|
137
|
+
styles,
|
|
138
|
+
unstyled,
|
|
139
|
+
vars,
|
|
140
|
+
varsResolver
|
|
141
|
+
});
|
|
142
|
+
const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({
|
|
143
|
+
classNames,
|
|
144
|
+
styles,
|
|
145
|
+
props
|
|
146
|
+
});
|
|
147
|
+
const [_value, setValue] = useUncontrolled({
|
|
148
|
+
value,
|
|
149
|
+
defaultValue,
|
|
150
|
+
onChange
|
|
151
|
+
});
|
|
152
|
+
const handleValueChange = (payload, event) => {
|
|
153
|
+
setValue(isValidNumber(payload.floatValue) ? payload.floatValue : payload.value);
|
|
154
|
+
onValueChange == null ? void 0 : onValueChange(payload, event);
|
|
155
|
+
};
|
|
156
|
+
const increment = () => {
|
|
157
|
+
if (typeof _value !== "number" || Number.isNaN(_value)) {
|
|
158
|
+
setValue(min != null ? min : clamp(startValue, min, max));
|
|
159
|
+
} else if (max !== void 0) {
|
|
160
|
+
setValue(_value + step <= max ? _value + step : max);
|
|
161
|
+
} else {
|
|
162
|
+
setValue(_value + step);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
const decrement = () => {
|
|
166
|
+
if (typeof _value !== "number" || Number.isNaN(_value)) {
|
|
167
|
+
setValue(max != null ? max : clamp(startValue, min, max));
|
|
168
|
+
} else {
|
|
169
|
+
setValue(getDecrementedValue({ value: _value, min, step, allowNegative }));
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const handleKeyDown = (event) => {
|
|
173
|
+
onKeyDown == null ? void 0 : onKeyDown(event);
|
|
174
|
+
if (event.key === "ArrowUp") {
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
increment();
|
|
177
|
+
}
|
|
178
|
+
if (event.key === "ArrowDown") {
|
|
179
|
+
event.preventDefault();
|
|
180
|
+
decrement();
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
assignRef(handlersRef, { increment, decrement });
|
|
184
|
+
const controls = /* @__PURE__ */ React.createElement("div", __spreadValues({}, getStyles("controls")), /* @__PURE__ */ React.createElement(
|
|
185
|
+
UnstyledButton,
|
|
186
|
+
__spreadProps(__spreadValues({}, getStyles("control")), {
|
|
187
|
+
tabIndex: -1,
|
|
188
|
+
"aria-hidden": true,
|
|
189
|
+
disabled: disabled || typeof _value === "number" && max !== void 0 && _value >= max,
|
|
190
|
+
mod: { direction: "up" },
|
|
191
|
+
onPointerDown: increment
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ React.createElement(NumberInputChevron, { direction: "up" })
|
|
194
|
+
), /* @__PURE__ */ React.createElement(
|
|
195
|
+
UnstyledButton,
|
|
196
|
+
__spreadProps(__spreadValues({}, getStyles("control")), {
|
|
197
|
+
tabIndex: -1,
|
|
198
|
+
"aria-hidden": true,
|
|
199
|
+
disabled: disabled || typeof _value === "number" && min !== void 0 && _value <= min,
|
|
200
|
+
mod: { direction: "down" },
|
|
201
|
+
onPointerDown: decrement
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ React.createElement(NumberInputChevron, { direction: "down" })
|
|
204
|
+
));
|
|
205
|
+
return /* @__PURE__ */ React.createElement(
|
|
206
|
+
InputBase,
|
|
207
|
+
__spreadProps(__spreadValues({
|
|
208
|
+
component: NumericFormat
|
|
209
|
+
}, others), {
|
|
210
|
+
disabled,
|
|
211
|
+
value: _value,
|
|
212
|
+
getInputRef: ref,
|
|
213
|
+
onValueChange: handleValueChange,
|
|
214
|
+
rightSection: hideControls ? rightSection : rightSection || controls,
|
|
215
|
+
classNames: resolvedClassNames,
|
|
216
|
+
styles: resolvedStyles,
|
|
217
|
+
unstyled,
|
|
218
|
+
__staticSelector: "NumberInput",
|
|
219
|
+
decimalScale: allowDecimal ? decimalScale : 0,
|
|
220
|
+
onKeyDown: handleKeyDown,
|
|
221
|
+
rightSectionPointerEvents: (rightSectionPointerEvents != null ? rightSectionPointerEvents : disabled) ? "none" : void 0,
|
|
222
|
+
onBlur: (event) => {
|
|
223
|
+
onBlur == null ? void 0 : onBlur(event);
|
|
224
|
+
if (clampBehavior === "blur" && typeof _value === "number") {
|
|
225
|
+
setValue(clamp(_value, min, max));
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
isAllowed: (val) => {
|
|
229
|
+
if (clampBehavior === "strict") {
|
|
230
|
+
if (isAllowed) {
|
|
231
|
+
return isAllowed(val) && isInRange(val.floatValue, min, max);
|
|
232
|
+
}
|
|
233
|
+
return isInRange(val.floatValue, min, max);
|
|
234
|
+
}
|
|
235
|
+
return isAllowed ? isAllowed(val) : true;
|
|
236
|
+
}
|
|
237
|
+
})
|
|
238
|
+
);
|
|
239
|
+
});
|
|
240
|
+
NumberInput.classes = __spreadValues(__spreadValues({}, InputBase.classes), classes);
|
|
241
|
+
NumberInput.displayName = "@mantine/core/NumberInput";
|
|
242
|
+
|
|
243
|
+
export { NumberInput };
|
|
244
|
+
//# sourceMappingURL=NumberInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberInput.js","sources":["../../../src/components/NumberInput/NumberInput.tsx"],"sourcesContent":["import React from 'react';\nimport { NumericFormat, OnValueChange, NumberFormatValues } from 'react-number-format';\nimport { assignRef, clamp, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n StylesApiProps,\n factory,\n ElementProps,\n useProps,\n useStyles,\n createVarsResolver,\n Factory,\n getSize,\n useResolvedStylesApi,\n} from '../../core';\nimport { UnstyledButton } from '../UnstyledButton';\nimport { InputBase } from '../InputBase';\nimport { __BaseInputProps, __InputStylesNames, InputVariant } from '../Input';\nimport { NumberInputChevron } from './NumberInputChevron';\nimport classes from './NumberInput.module.css';\n\nexport interface NumberInputHandlers {\n increment(): void;\n decrement(): void;\n}\n\nfunction isValidNumber(value: number | undefined): value is number {\n return typeof value === 'number' && !Number.isNaN(value);\n}\n\ninterface GetDecrementedValueInput {\n value: number;\n min: number | undefined;\n step: number | undefined;\n allowNegative: boolean | undefined;\n}\n\nfunction getDecrementedValue({ value, min, step = 1, allowNegative }: GetDecrementedValueInput) {\n const nextValue = value - step;\n\n if (!allowNegative && nextValue < 0 && min === undefined) {\n return value;\n }\n\n if (min !== undefined && min >= 0 && nextValue <= min) {\n return value;\n }\n\n return nextValue;\n}\n\nfunction isInRange(value: number | undefined, min: number | undefined, max: number | undefined) {\n if (value === undefined) {\n return true;\n }\n\n const minValid = min === undefined || value >= min;\n const maxValid = max === undefined || value <= max;\n\n return minValid && maxValid;\n}\n\nexport type NumberInputStylesNames = 'controls' | 'control' | __InputStylesNames;\nexport type NumberInputCssVariables = {\n controls: '--ni-chevron-size';\n};\n\nexport interface NumberInputProps\n extends BoxProps,\n __BaseInputProps,\n StylesApiProps<NumberInputFactory>,\n ElementProps<'input', 'size' | 'type' | 'onChange'> {\n /** Controlled component value */\n value?: number | string;\n\n /** Uncontrolled component default value */\n defaultValue?: number | string;\n\n /** Called when value changes */\n onChange?(value: number | string): void;\n\n /** Called when value changes with `react-number-format` payload */\n onValueChange?: OnValueChange;\n\n /** Determines whether leading zeros are allowed. If not set, leading zeros are removed when the input is blurred. `false` by default */\n allowLeadingZeros?: boolean;\n\n /** Determines whether negative values are allowed, `true` by default */\n allowNegative?: boolean;\n\n /** Characters which when pressed result in a decimal separator, `['.']` by default */\n allowedDecimalSeparators?: string[];\n\n /** Limits the number of digits that can be entered after the decimal point */\n decimalScale?: number;\n\n /** Character used as a decimal separator, `'.'` by default */\n decimalSeparator?: string;\n\n /** If set, 0s are added after `decimalSeparator` to match given `decimalScale`. `false` by default */\n fixedDecimalScale?: boolean;\n\n /** Prefix added before the input value */\n prefix?: string;\n\n /** Suffix added after the input value */\n suffix?: string;\n\n /** Defines the thousand grouping style. */\n thousandsGroupStyle?: 'thousand' | 'lakh' | 'wan' | 'none';\n\n /** A function to validate the input value. If this function returns `false`, the `onChange` will not be called and the input value will not change. */\n isAllowed?(values: NumberFormatValues): boolean;\n\n /** If value is passed as string representation of numbers (unformatted) and number is used in any format props like in prefix or suffix in numeric format and format prop in pattern format then this should be passed as `true`. `false` by default. */\n valueIsNumericString?: boolean;\n\n /** Controls input `type` attribute, `'text'` by default */\n type?: 'text' | 'tel' | 'password';\n\n /** A character used to separate thousands */\n thousandSeparator?: string | boolean;\n\n /** Minimum possible value */\n min?: number;\n\n /** Maximum possible value */\n max?: number;\n\n /** Number by which value will be incremented/decremented with up/down controls and keyboard arrows, `1` by default */\n step?: number;\n\n /** Determines whether the up/down controls should be hidden, `false` by default */\n hideControls?: boolean;\n\n /** Controls how value is clamped, `strict` – user is not allowed to enter values that are not in `[min, max]` range, `blur` – user is allowed to enter any values, but the value is clamped when the input loses focus (default behavior), `none` – lifts all restrictions, `[min, max]` range is applied only for controls and up/down keys */\n clampBehavior?: 'strict' | 'blur' | 'none';\n\n /** Determines whether decimal values are allowed, `true` by default */\n allowDecimal?: boolean;\n\n /** Increment/decrement handlers */\n handlersRef?: React.ForwardedRef<NumberInputHandlers | undefined>;\n\n /** Value set to the input when increment/decrement buttons are clicked or up/down arrows pressed if the input is empty, `0` by default */\n startValue?: number;\n}\n\nexport type NumberInputFactory = Factory<{\n props: NumberInputProps;\n ref: HTMLDivElement;\n stylesNames: NumberInputStylesNames;\n vars: NumberInputCssVariables;\n variant: InputVariant;\n}>;\n\nconst defaultProps: Partial<NumberInputProps> = {\n step: 1,\n size: 'sm',\n clampBehavior: 'blur',\n allowDecimal: true,\n startValue: 0,\n};\n\nconst varsResolver = createVarsResolver<NumberInputFactory>((_, { size }) => ({\n controls: {\n '--ni-chevron-size': getSize(size, 'ni-chevron-size'),\n },\n}));\n\nexport const NumberInput = factory<NumberInputFactory>((_props, ref) => {\n const props = useProps('NumberInput', defaultProps, _props);\n const {\n classNames,\n styles,\n unstyled,\n vars,\n onChange,\n onValueChange,\n value,\n defaultValue,\n max,\n min,\n step,\n hideControls,\n rightSection,\n isAllowed,\n clampBehavior,\n onBlur,\n allowDecimal,\n decimalScale,\n onKeyDown,\n handlersRef,\n startValue,\n disabled,\n rightSectionPointerEvents,\n allowNegative,\n ...others\n } = props;\n\n const getStyles = useStyles<NumberInputFactory>({\n name: 'NumberInput',\n classes,\n props,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<NumberInputFactory>({\n classNames,\n styles,\n props,\n });\n\n const [_value, setValue] = useUncontrolled({\n value,\n defaultValue,\n onChange,\n });\n\n const handleValueChange: OnValueChange = (payload, event) => {\n setValue(isValidNumber(payload.floatValue) ? payload.floatValue : payload.value);\n onValueChange?.(payload, event);\n };\n\n const increment = () => {\n if (typeof _value !== 'number' || Number.isNaN(_value)) {\n setValue(min ?? clamp(startValue!, min, max));\n } else if (max !== undefined) {\n setValue(_value + step! <= max ? _value + step! : max);\n } else {\n setValue(_value + step!);\n }\n };\n\n const decrement = () => {\n if (typeof _value !== 'number' || Number.isNaN(_value)) {\n setValue(max ?? clamp(startValue!, min, max));\n } else {\n setValue(getDecrementedValue({ value: _value, min, step, allowNegative }));\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n increment();\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n decrement();\n }\n };\n\n assignRef(handlersRef, { increment, decrement });\n\n const controls = (\n <div {...getStyles('controls')}>\n <UnstyledButton\n {...getStyles('control')}\n tabIndex={-1}\n aria-hidden\n disabled={disabled || (typeof _value === 'number' && max !== undefined && _value >= max)}\n mod={{ direction: 'up' }}\n onPointerDown={increment}\n >\n <NumberInputChevron direction=\"up\" />\n </UnstyledButton>\n <UnstyledButton\n {...getStyles('control')}\n tabIndex={-1}\n aria-hidden\n disabled={disabled || (typeof _value === 'number' && min !== undefined && _value <= min)}\n mod={{ direction: 'down' }}\n onPointerDown={decrement}\n >\n <NumberInputChevron direction=\"down\" />\n </UnstyledButton>\n </div>\n );\n\n return (\n <InputBase\n component={NumericFormat}\n {...others}\n disabled={disabled}\n value={_value}\n getInputRef={ref}\n onValueChange={handleValueChange}\n rightSection={hideControls ? rightSection : rightSection || controls}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n __staticSelector=\"NumberInput\"\n decimalScale={allowDecimal ? decimalScale : 0}\n onKeyDown={handleKeyDown}\n rightSectionPointerEvents={rightSectionPointerEvents ?? disabled ? 'none' : undefined}\n onBlur={(event) => {\n onBlur?.(event);\n if (clampBehavior === 'blur' && typeof _value === 'number') {\n setValue(clamp(_value, min, max));\n }\n }}\n isAllowed={(val) => {\n if (clampBehavior === 'strict') {\n if (isAllowed) {\n return isAllowed(val) && isInRange(val.floatValue, min, max);\n }\n\n return isInRange(val.floatValue, min, max);\n }\n\n return isAllowed ? isAllowed(val) : true;\n }}\n />\n );\n});\n\nNumberInput.classes = { ...InputBase.classes, ...classes };\nNumberInput.displayName = '@mantine/core/NumberInput';\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,E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C;AACzE,WAAW;AACX,UAAU,OAAO,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACrD,SAAS;AACT,QAAQ,OAAO,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AACjD,OAAO;AACP,KAAK,CAAC;AACN,GAAG,CAAC;AACJ,CAAC,EAAE;AACH,WAAW,CAAC,OAAO,GAAG,cAAc,CAAC,cAAc,CAAC,EAAE,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AACrF,WAAW,CAAC,WAAW,GAAG,2BAA2B;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberInput.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __objRest = (source, exclude) => {
|
|
20
|
+
var target = {};
|
|
21
|
+
for (var prop in source)
|
|
22
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
23
|
+
target[prop] = source[prop];
|
|
24
|
+
if (source != null && __getOwnPropSymbols)
|
|
25
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
26
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
}
|
|
29
|
+
return target;
|
|
30
|
+
};
|
|
31
|
+
function NumberInputChevron(_a) {
|
|
32
|
+
var _b = _a, { direction, style } = _b, others = __objRest(_b, ["direction", "style"]);
|
|
33
|
+
return /* @__PURE__ */ React.createElement(
|
|
34
|
+
"svg",
|
|
35
|
+
__spreadValues({
|
|
36
|
+
style: __spreadValues({
|
|
37
|
+
width: "var(--ni-chevron-size)",
|
|
38
|
+
height: "var(--ni-chevron-size)",
|
|
39
|
+
transform: direction === "up" ? "rotate(180deg)" : void 0
|
|
40
|
+
}, style),
|
|
41
|
+
viewBox: "0 0 15 15",
|
|
42
|
+
fill: "none",
|
|
43
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
44
|
+
}, others),
|
|
45
|
+
/* @__PURE__ */ React.createElement(
|
|
46
|
+
"path",
|
|
47
|
+
{
|
|
48
|
+
d: "M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",
|
|
49
|
+
fill: "currentColor",
|
|
50
|
+
fillRule: "evenodd",
|
|
51
|
+
clipRule: "evenodd"
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { NumberInputChevron };
|
|
58
|
+
//# sourceMappingURL=NumberInputChevron.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberInputChevron.js","sources":["../../../src/components/NumberInput/NumberInputChevron.tsx"],"sourcesContent":["import React from 'react';\n\ninterface ChevronProps extends React.ComponentPropsWithoutRef<'svg'> {\n direction: 'up' | 'down';\n}\n\nexport function NumberInputChevron({ direction, style, ...others }: ChevronProps) {\n return (\n <svg\n style={{\n width: 'var(--ni-chevron-size)',\n height: 'var(--ni-chevron-size)',\n transform: direction === 'up' ? 'rotate(180deg)' : undefined,\n ...style,\n }}\n viewBox=\"0 0 15 15\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...others}\n >\n <path\n d=\"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\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;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,KAA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AAC;AACpC,KAAK;AACL,EAAE,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEK,SAAS,kBAAkB,CAAC,EAAE,EAAE;AACvC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AACzF,EAAE,uBAAuB,KAAK,CAAC,aAAa;AAC5C,IAAI,KAAK;AACT,IAAI,cAAc,CAAC;AACnB,MAAM,KAAK,EAAE,cAAc,CAAC;AAC5B,QAAQ,KAAK,EAAE,wBAAwB;AACvC,QAAQ,MAAM,EAAE,wBAAwB;AACxC,QAAQ,SAAS,EAAE,SAAS,KAAK,IAAI,GAAG,gBAAgB,GAAG,KAAK,CAAC;AACjE,OAAO,EAAE,KAAK,CAAC;AACf,MAAM,OAAO,EAAE,WAAW;AAC1B,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,KAAK,EAAE,4BAA4B;AACzC,KAAK,EAAE,MAAM,CAAC;AACd,oBAAoB,KAAK,CAAC,aAAa;AACvC,MAAM,MAAM;AACZ,MAAM;AACN,QAAQ,CAAC,EAAE,4TAA4T;AACvU,QAAQ,IAAI,EAAE,cAAc;AAC5B,QAAQ,QAAQ,EAAE,SAAS;AAC3B,QAAQ,QAAQ,EAAE,SAAS;AAC3B,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -1 +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 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?:
|
|
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 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?: string | number;\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}>;\n\nconst defaultProps: Partial<OverlayProps> = {\n color: '#000',\n backgroundOpacity: 0.6,\n zIndex: getDefaultZIndex('modal'),\n radius: 0,\n};\n\nconst varsResolver = createVarsResolver<OverlayFactory>(\n (_, { 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.classes = classes;\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,IAA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E,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC3K,CAAC,EAAE;AACH,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;AAC1B,OAAO,CAAC,WAAW,GAAG,uBAAuB;;;;"}
|
|
@@ -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 PaperCssVariables = {\n root: '--paper-radius' | '--paper-shadow';\n};\n\nexport interface
|
|
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 PaperCssVariables = {\n root: '--paper-radius' | '--paper-shadow';\n};\n\nexport interface PaperBaseProps {\n /** Key of `theme.shadows` or any valid CSS value to set `box-shadow`, `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 interface PaperProps extends BoxProps, PaperBaseProps, StylesApiProps<PaperFactory> {}\n\nexport type PaperFactory = PolymorphicFactory<{\n props: PaperProps;\n defaultComponent: 'div';\n defaultRef: HTMLDivElement;\n stylesNames: PaperStylesNames;\n vars: PaperCssVariables;\n}>;\n\nconst 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.classes = classes;\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,CAA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V,IAAI,QAAQ;AACZ,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,GAAG,CAAC,CAAC;AACL,EAAE,uBAAuB,KAAK,CAAC,aAAa;AAC5C,IAAI,GAAG;AACP,IAAI,cAAc,CAAC,aAAa,CAAC,cAAc,CAAC;AAChD,MAAM,GAAG;AACT,MAAM,GAAG,EAAE,EAAE,kBAAkB,EAAE,UAAU,EAAE;AAC7C,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE;AAC3B,MAAM,OAAO;AACb,KAAK,CAAC,EAAE,MAAM,CAAC;AACf,GAAG,CAAC;AACJ,CAAC,EAAE;AACH,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;AACxB,KAAK,CAAC,WAAW,GAAG,qBAAqB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.context.js","sources":["../../../src/components/Popover/Popover.context.ts"],"sourcesContent":["import {\n createSafeContext,\n MantineShadow,\n Styles,\n ClassNames,\n MantineRadius,\n GetStylesApi,\n} from '../../core';\nimport { FloatingPosition, ArrowPosition } from '../Floating';\nimport { TransitionOverride } from '../Transition';\nimport { PortalProps } from '../Portal';\nimport { PopoverWidth } from './Popover.types';\nimport type { PopoverFactory } from './Popover';\n\ninterface PopoverContext {\n x: number;\n y: number;\n arrowX: number;\n arrowY: number;\n arrowRef: React.RefObject<HTMLDivElement>;\n opened: boolean;\n transitionProps?: TransitionOverride;\n reference(node: HTMLElement): void;\n floating(node: HTMLElement): void;\n width?: PopoverWidth;\n withArrow: boolean | undefined;\n arrowSize: number;\n arrowOffset: number;\n arrowRadius: number;\n arrowPosition: ArrowPosition;\n trapFocus: boolean | undefined;\n placement: FloatingPosition;\n withinPortal: boolean | undefined;\n portalProps?: Omit<PortalProps, 'children'>;\n closeOnEscape: boolean | undefined;\n zIndex:
|
|
1
|
+
{"version":3,"file":"Popover.context.js","sources":["../../../src/components/Popover/Popover.context.ts"],"sourcesContent":["import {\n createSafeContext,\n MantineShadow,\n Styles,\n ClassNames,\n MantineRadius,\n GetStylesApi,\n} from '../../core';\nimport { FloatingPosition, ArrowPosition } from '../Floating';\nimport { TransitionOverride } from '../Transition';\nimport { PortalProps } from '../Portal';\nimport { PopoverWidth } from './Popover.types';\nimport type { PopoverFactory } from './Popover';\n\ninterface PopoverContext {\n x: number;\n y: number;\n arrowX: number;\n arrowY: number;\n arrowRef: React.RefObject<HTMLDivElement>;\n opened: boolean;\n transitionProps?: TransitionOverride;\n reference(node: HTMLElement): void;\n floating(node: HTMLElement): void;\n width?: PopoverWidth;\n withArrow: boolean | undefined;\n arrowSize: number;\n arrowOffset: number;\n arrowRadius: number;\n arrowPosition: ArrowPosition;\n trapFocus: boolean | undefined;\n placement: FloatingPosition;\n withinPortal: boolean | undefined;\n portalProps?: Omit<PortalProps, 'children'>;\n closeOnEscape: boolean | undefined;\n zIndex: string | number | undefined;\n radius?: MantineRadius | (string & {}) | number | undefined;\n shadow?: MantineShadow | (string & {}) | undefined;\n onClose?(): void;\n getDropdownId(): string;\n getTargetId(): string;\n controlled: boolean;\n onToggle(): void;\n withRoles: boolean | undefined;\n targetProps: Record<string, any>;\n disabled: boolean | undefined;\n returnFocus: boolean | undefined;\n classNames: ClassNames<PopoverFactory> | undefined;\n styles: Styles<PopoverFactory> | undefined;\n unstyled: boolean | undefined;\n __staticSelector: string;\n variant: string | undefined;\n keepMounted: boolean | undefined;\n getStyles: GetStylesApi<PopoverFactory>;\n}\n\nexport const [PopoverContextProvider, usePopoverContext] = createSafeContext<PopoverContext>(\n 'Popover component was not found in the tree'\n);\n"],"names":[],"mappings":";;AAGY,MAAC,CAAC,sBAAsB,EAAE,iBAAiB,CAAC,GAAG,iBAAiB;AAC5E,EAAE,6CAA6C;AAC/C;;;;"}
|