@mantine/core 9.0.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Accordion/Accordion.cjs.map +1 -1
- package/cjs/components/Accordion/Accordion.module.cjs.map +1 -1
- package/cjs/components/ActionIcon/ActionIcon.cjs.map +1 -1
- package/cjs/components/Affix/Affix.cjs.map +1 -1
- package/cjs/components/Alert/Alert.cjs.map +1 -1
- package/cjs/components/Anchor/Anchor.cjs.map +1 -1
- package/cjs/components/AngleSlider/AngleSlider.cjs.map +1 -1
- package/cjs/components/AppShell/AppShell.cjs.map +1 -1
- package/cjs/components/AspectRatio/AspectRatio.cjs.map +1 -1
- package/cjs/components/Autocomplete/Autocomplete.cjs +1 -1
- package/cjs/components/Autocomplete/Autocomplete.cjs.map +1 -1
- package/cjs/components/Avatar/Avatar.cjs.map +1 -1
- package/cjs/components/BackgroundImage/BackgroundImage.cjs.map +1 -1
- package/cjs/components/Badge/Badge.cjs.map +1 -1
- package/cjs/components/Badge/Badge.module.cjs.map +1 -1
- package/cjs/components/Blockquote/Blockquote.cjs.map +1 -1
- package/cjs/components/Breadcrumbs/Breadcrumbs.cjs.map +1 -1
- package/cjs/components/Burger/Burger.cjs.map +1 -1
- package/cjs/components/Button/Button.cjs.map +1 -1
- package/cjs/components/Card/Card.cjs.map +1 -1
- package/cjs/components/Center/Center.cjs.map +1 -1
- package/cjs/components/Checkbox/Checkbox.cjs.map +1 -1
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.cjs.map +1 -1
- package/cjs/components/Chip/Chip.cjs.map +1 -1
- package/cjs/components/Chip/ChipGroup/ChipGroup.cjs.map +1 -1
- package/cjs/components/CloseButton/CloseButton.cjs.map +1 -1
- package/cjs/components/Code/Code.cjs.map +1 -1
- package/cjs/components/Collapse/Collapse.cjs.map +1 -1
- package/cjs/components/ColorInput/ColorInput.cjs.map +1 -1
- package/cjs/components/ColorPicker/AlphaSlider/AlphaSlider.cjs.map +1 -1
- package/cjs/components/ColorPicker/ColorPicker.cjs.map +1 -1
- package/cjs/components/ColorPicker/HueSlider/HueSlider.cjs.map +1 -1
- package/cjs/components/ColorSwatch/ColorSwatch.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxTarget/ComboboxTarget.cjs +1 -0
- package/cjs/components/Combobox/ComboboxTarget/ComboboxTarget.cjs.map +1 -1
- package/cjs/components/Combobox/use-combobox-target-props/use-combobox-target-props.cjs.map +1 -1
- package/cjs/components/Container/Container.cjs.map +1 -1
- package/cjs/components/Dialog/Dialog.cjs.map +1 -1
- package/cjs/components/Divider/Divider.cjs.map +1 -1
- package/cjs/components/Fieldset/Fieldset.cjs.map +1 -1
- package/cjs/components/FileButton/FileButton.cjs.map +1 -1
- package/cjs/components/FileInput/FileInput.cjs.map +1 -1
- package/cjs/components/Flex/Flex.cjs.map +1 -1
- package/cjs/components/FloatingIndicator/FloatingIndicator.cjs.map +1 -1
- package/cjs/components/FloatingWindow/FloatingWindow.cjs.map +1 -1
- package/cjs/components/Grid/Grid.cjs.map +1 -1
- package/cjs/components/Group/Group.cjs.map +1 -1
- package/cjs/components/Highlight/Highlight.cjs.map +1 -1
- package/cjs/components/Image/Image.cjs.map +1 -1
- package/cjs/components/Indicator/Indicator.cjs.map +1 -1
- package/cjs/components/Input/Input.cjs +3 -2
- package/cjs/components/Input/Input.cjs.map +1 -1
- package/cjs/components/InputBase/InputBase.cjs.map +1 -1
- package/cjs/components/JsonInput/JsonInput.cjs.map +1 -1
- package/cjs/components/Kbd/Kbd.cjs.map +1 -1
- package/cjs/components/List/List.cjs.map +1 -1
- package/cjs/components/Loader/Loader.cjs.map +1 -1
- package/cjs/components/LoadingOverlay/LoadingOverlay.cjs +1 -0
- package/cjs/components/LoadingOverlay/LoadingOverlay.cjs.map +1 -1
- package/cjs/components/Mark/Mark.cjs.map +1 -1
- package/cjs/components/Marquee/Marquee.cjs.map +1 -1
- package/cjs/components/Menu/Menu.cjs.map +1 -1
- package/cjs/components/Modal/Modal.cjs.map +1 -1
- package/cjs/components/MultiSelect/MultiSelect.cjs +3 -1
- package/cjs/components/MultiSelect/MultiSelect.cjs.map +1 -1
- package/cjs/components/NativeSelect/NativeSelect.cjs +4 -1
- package/cjs/components/NativeSelect/NativeSelect.cjs.map +1 -1
- package/cjs/components/NavLink/NavLink.cjs.map +1 -1
- package/cjs/components/Notification/Notification.cjs.map +1 -1
- package/cjs/components/NumberInput/NumberInput.cjs +1 -0
- package/cjs/components/NumberInput/NumberInput.cjs.map +1 -1
- package/cjs/components/OverflowList/OverflowList.cjs.map +1 -1
- package/cjs/components/Overlay/Overlay.cjs.map +1 -1
- package/cjs/components/Pagination/Pagination.cjs.map +1 -1
- package/cjs/components/Paper/Paper.cjs.map +1 -1
- package/cjs/components/PasswordInput/PasswordInput.cjs +4 -1
- package/cjs/components/PasswordInput/PasswordInput.cjs.map +1 -1
- package/cjs/components/Pill/Pill.cjs.map +1 -1
- package/cjs/components/PillsInput/PillsInput.cjs.map +1 -1
- package/cjs/components/PinInput/PinInput.cjs.map +1 -1
- package/cjs/components/Popover/Popover.cjs +9 -0
- package/cjs/components/Popover/Popover.cjs.map +1 -1
- package/cjs/components/Portal/OptionalPortal.cjs.map +1 -1
- package/cjs/components/Portal/Portal.cjs.map +1 -1
- package/cjs/components/Progress/Progress.cjs.map +1 -1
- package/cjs/components/Radio/Radio.cjs.map +1 -1
- package/cjs/components/Radio/RadioGroup/RadioGroup.cjs.map +1 -1
- package/cjs/components/Rating/Rating.cjs.map +1 -1
- package/cjs/components/RingProgress/RingProgress.cjs +1 -0
- package/cjs/components/RingProgress/RingProgress.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollArea.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.cjs.map +1 -1
- package/cjs/components/Scroller/Scroller.cjs.map +1 -1
- package/cjs/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
- package/cjs/components/Select/Select.cjs +1 -0
- package/cjs/components/Select/Select.cjs.map +1 -1
- package/cjs/components/SemiCircleProgress/SemiCircleProgress.cjs +1 -2
- package/cjs/components/SemiCircleProgress/SemiCircleProgress.cjs.map +1 -1
- package/cjs/components/SimpleGrid/SimpleGrid.cjs.map +1 -1
- package/cjs/components/Skeleton/Skeleton.cjs.map +1 -1
- package/cjs/components/Slider/RangeSlider/RangeSlider.cjs.map +1 -1
- package/cjs/components/Slider/Slider/Slider.cjs.map +1 -1
- package/cjs/components/Slider/Slider.module.cjs.map +1 -1
- package/cjs/components/Space/Space.cjs.map +1 -1
- package/cjs/components/Spoiler/Spoiler.cjs.map +1 -1
- package/cjs/components/Stack/Stack.cjs.map +1 -1
- package/cjs/components/Stepper/Stepper.cjs.map +1 -1
- package/cjs/components/Switch/Switch.cjs.map +1 -1
- package/cjs/components/Switch/SwitchGroup/SwitchGroup.cjs.map +1 -1
- package/cjs/components/Table/Table.cjs.map +1 -1
- package/cjs/components/TableOfContents/TableOfContents.cjs.map +1 -1
- package/cjs/components/Tabs/Tabs.cjs.map +1 -1
- package/cjs/components/TagsInput/TagsInput.cjs +3 -1
- package/cjs/components/TagsInput/TagsInput.cjs.map +1 -1
- package/cjs/components/Text/Text.cjs.map +1 -1
- package/cjs/components/TextInput/TextInput.cjs.map +1 -1
- package/cjs/components/Textarea/Textarea.cjs.map +1 -1
- package/cjs/components/ThemeIcon/ThemeIcon.cjs.map +1 -1
- package/cjs/components/Timeline/Timeline.cjs.map +1 -1
- package/cjs/components/Title/Title.cjs.map +1 -1
- package/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
- package/cjs/components/Tree/Tree.cjs.map +1 -1
- package/cjs/components/Typography/Typography.cjs.map +1 -1
- package/cjs/components/UnstyledButton/UnstyledButton.cjs.map +1 -1
- package/cjs/components/VisuallyHidden/VisuallyHidden.cjs.map +1 -1
- package/cjs/core/MantineProvider/color-scheme-managers/local-storage-manager.cjs.map +1 -1
- package/cjs/core/utils/find-element-ancestor/find-element-ancestor.cjs.map +1 -1
- package/esm/components/Accordion/Accordion.mjs.map +1 -1
- package/esm/components/Accordion/Accordion.module.mjs.map +1 -1
- package/esm/components/ActionIcon/ActionIcon.mjs.map +1 -1
- package/esm/components/Affix/Affix.mjs.map +1 -1
- package/esm/components/Alert/Alert.mjs.map +1 -1
- package/esm/components/Anchor/Anchor.mjs.map +1 -1
- package/esm/components/AngleSlider/AngleSlider.mjs.map +1 -1
- package/esm/components/AppShell/AppShell.mjs.map +1 -1
- package/esm/components/AspectRatio/AspectRatio.mjs.map +1 -1
- package/esm/components/Autocomplete/Autocomplete.mjs +1 -1
- package/esm/components/Autocomplete/Autocomplete.mjs.map +1 -1
- package/esm/components/Avatar/Avatar.mjs.map +1 -1
- package/esm/components/BackgroundImage/BackgroundImage.mjs.map +1 -1
- package/esm/components/Badge/Badge.mjs.map +1 -1
- package/esm/components/Badge/Badge.module.mjs.map +1 -1
- package/esm/components/Blockquote/Blockquote.mjs.map +1 -1
- package/esm/components/Breadcrumbs/Breadcrumbs.mjs.map +1 -1
- package/esm/components/Burger/Burger.mjs.map +1 -1
- package/esm/components/Button/Button.mjs.map +1 -1
- package/esm/components/Card/Card.mjs.map +1 -1
- package/esm/components/Center/Center.mjs.map +1 -1
- package/esm/components/Checkbox/Checkbox.mjs.map +1 -1
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.mjs.map +1 -1
- package/esm/components/Chip/Chip.mjs.map +1 -1
- package/esm/components/Chip/ChipGroup/ChipGroup.mjs.map +1 -1
- package/esm/components/CloseButton/CloseButton.mjs.map +1 -1
- package/esm/components/Code/Code.mjs.map +1 -1
- package/esm/components/Collapse/Collapse.mjs.map +1 -1
- package/esm/components/ColorInput/ColorInput.mjs.map +1 -1
- package/esm/components/ColorPicker/AlphaSlider/AlphaSlider.mjs.map +1 -1
- package/esm/components/ColorPicker/ColorPicker.mjs.map +1 -1
- package/esm/components/ColorPicker/HueSlider/HueSlider.mjs.map +1 -1
- package/esm/components/ColorSwatch/ColorSwatch.mjs.map +1 -1
- package/esm/components/Combobox/ComboboxTarget/ComboboxTarget.mjs +1 -0
- package/esm/components/Combobox/ComboboxTarget/ComboboxTarget.mjs.map +1 -1
- package/esm/components/Combobox/use-combobox-target-props/use-combobox-target-props.mjs.map +1 -1
- package/esm/components/Container/Container.mjs.map +1 -1
- package/esm/components/Dialog/Dialog.mjs.map +1 -1
- package/esm/components/Divider/Divider.mjs.map +1 -1
- package/esm/components/Fieldset/Fieldset.mjs.map +1 -1
- package/esm/components/FileButton/FileButton.mjs.map +1 -1
- package/esm/components/FileInput/FileInput.mjs.map +1 -1
- package/esm/components/Flex/Flex.mjs.map +1 -1
- package/esm/components/FloatingIndicator/FloatingIndicator.mjs.map +1 -1
- package/esm/components/FloatingWindow/FloatingWindow.mjs.map +1 -1
- package/esm/components/Grid/Grid.mjs.map +1 -1
- package/esm/components/Group/Group.mjs.map +1 -1
- package/esm/components/Highlight/Highlight.mjs.map +1 -1
- package/esm/components/Image/Image.mjs.map +1 -1
- package/esm/components/Indicator/Indicator.mjs.map +1 -1
- package/esm/components/Input/Input.mjs +3 -2
- package/esm/components/Input/Input.mjs.map +1 -1
- package/esm/components/InputBase/InputBase.mjs.map +1 -1
- package/esm/components/JsonInput/JsonInput.mjs.map +1 -1
- package/esm/components/Kbd/Kbd.mjs.map +1 -1
- package/esm/components/List/List.mjs.map +1 -1
- package/esm/components/Loader/Loader.mjs.map +1 -1
- package/esm/components/LoadingOverlay/LoadingOverlay.mjs +1 -0
- package/esm/components/LoadingOverlay/LoadingOverlay.mjs.map +1 -1
- package/esm/components/Mark/Mark.mjs.map +1 -1
- package/esm/components/Marquee/Marquee.mjs.map +1 -1
- package/esm/components/Menu/Menu.mjs.map +1 -1
- package/esm/components/Modal/Modal.mjs.map +1 -1
- package/esm/components/MultiSelect/MultiSelect.mjs +3 -1
- package/esm/components/MultiSelect/MultiSelect.mjs.map +1 -1
- package/esm/components/NativeSelect/NativeSelect.mjs +4 -1
- package/esm/components/NativeSelect/NativeSelect.mjs.map +1 -1
- package/esm/components/NavLink/NavLink.mjs.map +1 -1
- package/esm/components/Notification/Notification.mjs.map +1 -1
- package/esm/components/NumberInput/NumberInput.mjs +1 -0
- package/esm/components/NumberInput/NumberInput.mjs.map +1 -1
- package/esm/components/OverflowList/OverflowList.mjs.map +1 -1
- package/esm/components/Overlay/Overlay.mjs.map +1 -1
- package/esm/components/Pagination/Pagination.mjs.map +1 -1
- package/esm/components/Paper/Paper.mjs.map +1 -1
- package/esm/components/PasswordInput/PasswordInput.mjs +4 -1
- package/esm/components/PasswordInput/PasswordInput.mjs.map +1 -1
- package/esm/components/Pill/Pill.mjs.map +1 -1
- package/esm/components/PillsInput/PillsInput.mjs.map +1 -1
- package/esm/components/PinInput/PinInput.mjs.map +1 -1
- package/esm/components/Popover/Popover.mjs +9 -0
- package/esm/components/Popover/Popover.mjs.map +1 -1
- package/esm/components/Portal/OptionalPortal.mjs.map +1 -1
- package/esm/components/Portal/Portal.mjs.map +1 -1
- package/esm/components/Progress/Progress.mjs.map +1 -1
- package/esm/components/Radio/Radio.mjs.map +1 -1
- package/esm/components/Radio/RadioGroup/RadioGroup.mjs.map +1 -1
- package/esm/components/Rating/Rating.mjs.map +1 -1
- package/esm/components/RingProgress/RingProgress.mjs +1 -0
- package/esm/components/RingProgress/RingProgress.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollArea.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.mjs.map +1 -1
- package/esm/components/Scroller/Scroller.mjs.map +1 -1
- package/esm/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/esm/components/Select/Select.mjs +1 -0
- package/esm/components/Select/Select.mjs.map +1 -1
- package/esm/components/SemiCircleProgress/SemiCircleProgress.mjs +1 -2
- package/esm/components/SemiCircleProgress/SemiCircleProgress.mjs.map +1 -1
- package/esm/components/SimpleGrid/SimpleGrid.mjs.map +1 -1
- package/esm/components/Skeleton/Skeleton.mjs.map +1 -1
- package/esm/components/Slider/RangeSlider/RangeSlider.mjs.map +1 -1
- package/esm/components/Slider/Slider/Slider.mjs.map +1 -1
- package/esm/components/Slider/Slider.module.mjs.map +1 -1
- package/esm/components/Space/Space.mjs.map +1 -1
- package/esm/components/Spoiler/Spoiler.mjs.map +1 -1
- package/esm/components/Stack/Stack.mjs.map +1 -1
- package/esm/components/Stepper/Stepper.mjs.map +1 -1
- package/esm/components/Switch/Switch.mjs.map +1 -1
- package/esm/components/Switch/SwitchGroup/SwitchGroup.mjs.map +1 -1
- package/esm/components/Table/Table.mjs.map +1 -1
- package/esm/components/TableOfContents/TableOfContents.mjs.map +1 -1
- package/esm/components/Tabs/Tabs.mjs.map +1 -1
- package/esm/components/TagsInput/TagsInput.mjs +3 -1
- package/esm/components/TagsInput/TagsInput.mjs.map +1 -1
- package/esm/components/Text/Text.mjs.map +1 -1
- package/esm/components/TextInput/TextInput.mjs.map +1 -1
- package/esm/components/Textarea/Textarea.mjs.map +1 -1
- package/esm/components/ThemeIcon/ThemeIcon.mjs.map +1 -1
- package/esm/components/Timeline/Timeline.mjs.map +1 -1
- package/esm/components/Title/Title.mjs.map +1 -1
- package/esm/components/Tooltip/Tooltip.mjs.map +1 -1
- package/esm/components/Tree/Tree.mjs.map +1 -1
- package/esm/components/Typography/Typography.mjs.map +1 -1
- package/esm/components/UnstyledButton/UnstyledButton.mjs.map +1 -1
- package/esm/components/VisuallyHidden/VisuallyHidden.mjs.map +1 -1
- package/esm/core/MantineProvider/color-scheme-managers/local-storage-manager.mjs.map +1 -1
- package/esm/core/utils/find-element-ancestor/find-element-ancestor.mjs.map +1 -1
- package/lib/components/Accordion/Accordion.d.ts +21 -3
- package/lib/components/Accordion/index.d.ts +0 -17
- package/lib/components/ActionIcon/ActionIcon.d.ts +20 -2
- package/lib/components/ActionIcon/index.d.ts +0 -18
- package/lib/components/Affix/Affix.d.ts +6 -0
- package/lib/components/Affix/index.d.ts +0 -6
- package/lib/components/Alert/Alert.d.ts +6 -0
- package/lib/components/Alert/index.d.ts +0 -6
- package/lib/components/Anchor/Anchor.d.ts +7 -0
- package/lib/components/Anchor/index.d.ts +0 -8
- package/lib/components/AngleSlider/AngleSlider.d.ts +6 -0
- package/lib/components/AngleSlider/index.d.ts +0 -6
- package/lib/components/AppShell/AppShell.d.ts +30 -6
- package/lib/components/AppShell/index.d.ts +0 -24
- package/lib/components/AspectRatio/AspectRatio.d.ts +6 -0
- package/lib/components/AspectRatio/index.d.ts +0 -6
- package/lib/components/Autocomplete/Autocomplete.d.ts +6 -0
- package/lib/components/Autocomplete/index.d.ts +0 -6
- package/lib/components/Avatar/Avatar.d.ts +15 -1
- package/lib/components/Avatar/index.d.ts +0 -14
- package/lib/components/BackgroundImage/BackgroundImage.d.ts +6 -0
- package/lib/components/BackgroundImage/index.d.ts +0 -6
- package/lib/components/Badge/Badge.d.ts +7 -0
- package/lib/components/Badge/index.d.ts +0 -7
- package/lib/components/Blockquote/Blockquote.d.ts +6 -0
- package/lib/components/Blockquote/index.d.ts +0 -6
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +6 -0
- package/lib/components/Breadcrumbs/index.d.ts +0 -7
- package/lib/components/Burger/Burger.d.ts +6 -0
- package/lib/components/Burger/index.d.ts +0 -6
- package/lib/components/Button/Button.d.ts +22 -2
- package/lib/components/Button/index.d.ts +0 -20
- package/lib/components/Card/Card.d.ts +11 -1
- package/lib/components/Card/index.d.ts +0 -10
- package/lib/components/Center/Center.d.ts +5 -0
- package/lib/components/Center/index.d.ts +0 -5
- package/lib/components/Checkbox/Checkbox.d.ts +29 -3
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +8 -8
- package/lib/components/Checkbox/index.d.ts +0 -26
- package/lib/components/Chip/Chip.d.ts +12 -1
- package/lib/components/Chip/ChipGroup/ChipGroup.d.ts +8 -8
- package/lib/components/Chip/index.d.ts +0 -11
- package/lib/components/CloseButton/CloseButton.d.ts +7 -0
- package/lib/components/CloseButton/index.d.ts +0 -7
- package/lib/components/Code/Code.d.ts +6 -0
- package/lib/components/Code/index.d.ts +0 -6
- package/lib/components/Collapse/Collapse.d.ts +4 -0
- package/lib/components/Collapse/index.d.ts +0 -4
- package/lib/components/ColorInput/ColorInput.d.ts +6 -0
- package/lib/components/ColorInput/index.d.ts +0 -6
- package/lib/components/ColorPicker/AlphaSlider/AlphaSlider.d.ts +4 -0
- package/lib/components/ColorPicker/ColorPicker.d.ts +6 -0
- package/lib/components/ColorPicker/HueSlider/HueSlider.d.ts +4 -0
- package/lib/components/ColorPicker/index.d.ts +0 -14
- package/lib/components/ColorSwatch/ColorSwatch.d.ts +6 -0
- package/lib/components/ColorSwatch/index.d.ts +0 -6
- package/lib/components/Container/Container.d.ts +6 -0
- package/lib/components/Container/index.d.ts +0 -6
- package/lib/components/Dialog/Dialog.d.ts +6 -0
- package/lib/components/Dialog/index.d.ts +0 -6
- package/lib/components/Divider/Divider.d.ts +7 -0
- package/lib/components/Divider/index.d.ts +0 -7
- package/lib/components/Fieldset/Fieldset.d.ts +6 -0
- package/lib/components/Fieldset/index.d.ts +0 -6
- package/lib/components/FileButton/FileButton.d.ts +4 -0
- package/lib/components/FileButton/index.d.ts +0 -4
- package/lib/components/FileInput/FileInput.d.ts +4 -0
- package/lib/components/FileInput/index.d.ts +0 -4
- package/lib/components/Flex/Flex.d.ts +5 -0
- package/lib/components/Flex/index.d.ts +0 -5
- package/lib/components/FloatingIndicator/FloatingIndicator.d.ts +6 -0
- package/lib/components/FloatingIndicator/index.d.ts +0 -6
- package/lib/components/FloatingWindow/FloatingWindow.d.ts +5 -0
- package/lib/components/FloatingWindow/index.d.ts +0 -5
- package/lib/components/Grid/Grid.d.ts +13 -2
- package/lib/components/Grid/index.d.ts +0 -11
- package/lib/components/Group/Group.d.ts +7 -0
- package/lib/components/Group/index.d.ts +0 -7
- package/lib/components/Highlight/Highlight.d.ts +5 -0
- package/lib/components/Highlight/index.d.ts +0 -5
- package/lib/components/Image/Image.d.ts +6 -0
- package/lib/components/Image/index.d.ts +0 -6
- package/lib/components/Indicator/Indicator.d.ts +6 -0
- package/lib/components/Indicator/index.d.ts +0 -6
- package/lib/components/Input/Input.d.ts +51 -7
- package/lib/components/Input/index.d.ts +0 -42
- package/lib/components/InputBase/InputBase.d.ts +4 -0
- package/lib/components/InputBase/index.d.ts +0 -4
- package/lib/components/JsonInput/JsonInput.d.ts +4 -0
- package/lib/components/JsonInput/index.d.ts +0 -4
- package/lib/components/Kbd/Kbd.d.ts +6 -0
- package/lib/components/Kbd/index.d.ts +0 -6
- package/lib/components/List/List.d.ts +12 -1
- package/lib/components/List/index.d.ts +0 -11
- package/lib/components/Loader/Loader.d.ts +6 -0
- package/lib/components/Loader/index.d.ts +0 -6
- package/lib/components/LoadingOverlay/LoadingOverlay.d.ts +6 -0
- package/lib/components/LoadingOverlay/index.d.ts +0 -6
- package/lib/components/Mark/Mark.d.ts +6 -0
- package/lib/components/Mark/index.d.ts +0 -6
- package/lib/components/Marquee/Marquee.d.ts +6 -0
- package/lib/components/Marquee/index.d.ts +0 -6
- package/lib/components/Menu/Menu.d.ts +43 -6
- package/lib/components/Menu/index.d.ts +0 -33
- package/lib/components/Modal/Modal.d.ts +37 -7
- package/lib/components/Modal/index.d.ts +0 -30
- package/lib/components/MultiSelect/MultiSelect.d.ts +5 -0
- package/lib/components/MultiSelect/index.d.ts +0 -6
- package/lib/components/NativeSelect/NativeSelect.d.ts +5 -0
- package/lib/components/NativeSelect/index.d.ts +0 -6
- package/lib/components/NavLink/NavLink.d.ts +7 -0
- package/lib/components/NavLink/index.d.ts +0 -7
- package/lib/components/Notification/Notification.d.ts +6 -0
- package/lib/components/Notification/index.d.ts +0 -6
- package/lib/components/NumberInput/NumberInput.d.ts +7 -0
- package/lib/components/NumberInput/index.d.ts +0 -7
- package/lib/components/OverflowList/OverflowList.d.ts +6 -0
- package/lib/components/OverflowList/index.d.ts +0 -6
- package/lib/components/Overlay/Overlay.d.ts +6 -0
- package/lib/components/Overlay/index.d.ts +0 -6
- package/lib/components/Pagination/Pagination.d.ts +25 -4
- package/lib/components/Pagination/index.d.ts +0 -21
- package/lib/components/Paper/Paper.d.ts +7 -0
- package/lib/components/Paper/index.d.ts +0 -7
- package/lib/components/PasswordInput/PasswordInput.d.ts +6 -0
- package/lib/components/PasswordInput/index.d.ts +0 -6
- package/lib/components/Pill/Pill.d.ts +14 -1
- package/lib/components/Pill/index.d.ts +0 -13
- package/lib/components/PillsInput/PillsInput.d.ts +12 -1
- package/lib/components/PillsInput/index.d.ts +0 -10
- package/lib/components/PinInput/PinInput.d.ts +5 -0
- package/lib/components/PinInput/index.d.ts +0 -5
- package/lib/components/Popover/Popover.d.ts +9 -0
- package/lib/components/Portal/OptionalPortal.d.ts +3 -0
- package/lib/components/Portal/Portal.d.ts +3 -0
- package/lib/components/Portal/index.d.ts +0 -6
- package/lib/components/Progress/Progress.d.ts +19 -3
- package/lib/components/Progress/index.d.ts +0 -15
- package/lib/components/Radio/Radio.d.ts +29 -3
- package/lib/components/Radio/RadioGroup/RadioGroup.d.ts +8 -8
- package/lib/components/Radio/index.d.ts +0 -26
- package/lib/components/Rating/Rating.d.ts +5 -0
- package/lib/components/Rating/index.d.ts +0 -5
- package/lib/components/RingProgress/RingProgress.d.ts +7 -0
- package/lib/components/RingProgress/index.d.ts +0 -7
- package/lib/components/ScrollArea/ScrollArea.d.ts +10 -0
- package/lib/components/ScrollArea/index.d.ts +0 -10
- package/lib/components/Scroller/Scroller.d.ts +6 -0
- package/lib/components/Scroller/index.d.ts +0 -6
- package/lib/components/SegmentedControl/SegmentedControl.d.ts +7 -0
- package/lib/components/SegmentedControl/index.d.ts +0 -8
- package/lib/components/Select/Select.d.ts +5 -0
- package/lib/components/Select/index.d.ts +0 -6
- package/lib/components/SemiCircleProgress/SemiCircleProgress.d.ts +6 -0
- package/lib/components/SemiCircleProgress/index.d.ts +0 -6
- package/lib/components/SimpleGrid/SimpleGrid.d.ts +5 -0
- package/lib/components/SimpleGrid/index.d.ts +0 -5
- package/lib/components/Skeleton/Skeleton.d.ts +6 -0
- package/lib/components/Skeleton/index.d.ts +0 -6
- package/lib/components/Slider/RangeSlider/RangeSlider.d.ts +8 -0
- package/lib/components/Slider/Slider/Slider.d.ts +7 -0
- package/lib/components/Slider/index.d.ts +0 -15
- package/lib/components/Space/Space.d.ts +4 -0
- package/lib/components/Space/index.d.ts +0 -5
- package/lib/components/Spoiler/Spoiler.d.ts +6 -0
- package/lib/components/Spoiler/index.d.ts +0 -6
- package/lib/components/Stack/Stack.d.ts +6 -0
- package/lib/components/Stack/index.d.ts +0 -6
- package/lib/components/Stepper/Stepper.d.ts +17 -2
- package/lib/components/Stepper/index.d.ts +0 -14
- package/lib/components/Switch/Switch.d.ts +13 -1
- package/lib/components/Switch/SwitchGroup/SwitchGroup.d.ts +8 -8
- package/lib/components/Switch/index.d.ts +0 -12
- package/lib/components/Table/Table.d.ts +35 -2
- package/lib/components/Table/index.d.ts +0 -32
- package/lib/components/TableOfContents/TableOfContents.d.ts +7 -0
- package/lib/components/TableOfContents/index.d.ts +0 -7
- package/lib/components/Tabs/Tabs.d.ts +24 -3
- package/lib/components/Tabs/index.d.ts +0 -20
- package/lib/components/TagsInput/TagsInput.d.ts +5 -0
- package/lib/components/TagsInput/index.d.ts +0 -5
- package/lib/components/Text/Text.d.ts +7 -0
- package/lib/components/Text/index.d.ts +0 -7
- package/lib/components/TextInput/TextInput.d.ts +4 -0
- package/lib/components/TextInput/index.d.ts +0 -4
- package/lib/components/Textarea/Textarea.d.ts +4 -0
- package/lib/components/Textarea/index.d.ts +0 -4
- package/lib/components/ThemeIcon/ThemeIcon.d.ts +7 -0
- package/lib/components/ThemeIcon/index.d.ts +0 -7
- package/lib/components/Timeline/Timeline.d.ts +12 -1
- package/lib/components/Timeline/index.d.ts +0 -11
- package/lib/components/Title/Title.d.ts +8 -0
- package/lib/components/Title/index.d.ts +0 -8
- package/lib/components/Tooltip/Tooltip.d.ts +15 -2
- package/lib/components/Tooltip/index.d.ts +0 -13
- package/lib/components/Tree/Tree.d.ts +7 -0
- package/lib/components/Tree/index.d.ts +0 -7
- package/lib/components/Typography/Typography.d.ts +5 -0
- package/lib/components/Typography/index.d.ts +0 -5
- package/lib/components/UnstyledButton/UnstyledButton.d.ts +5 -0
- package/lib/components/UnstyledButton/index.d.ts +0 -5
- package/lib/components/VisuallyHidden/VisuallyHidden.d.ts +3 -0
- package/lib/components/VisuallyHidden/index.d.ts +0 -3
- package/package.json +2 -2
- package/styles/Accordion.css +0 -4
- package/styles/Accordion.layer.css +0 -4
- package/styles/Badge.css +0 -2
- package/styles/Badge.layer.css +0 -2
- package/styles/Slider.css +10 -10
- package/styles/Slider.layer.css +10 -10
- package/styles.css +10 -16
- package/styles.layer.css +10 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.cjs","names":["getDefaultZIndex","createVarsResolver","getRadius","factory","useProps","useDirection","useTooltip","getFloatingPosition","useStyles","getSingleElementChild","getTransitionProps","OptionalPortal","Transition","Box","FloatingArrow","getRefProp","classes","TooltipFloating","TooltipGroup"],"sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { cloneElement, useEffect, useRef } from 'react';\nimport cx from 'clsx';\nimport { useMergedRef } from '@mantine/hooks';\nimport {\n Box,\n createVarsResolver,\n factory,\n Factory,\n getDefaultZIndex,\n getRadius,\n getRefProp,\n getSingleElementChild,\n useDirection,\n useProps,\n useStyles,\n} from '../../core';\nimport {\n ArrowPosition,\n FloatingArrow,\n FloatingAxesOffsets,\n FloatingPosition,\n FloatingStrategy,\n getFloatingPosition,\n} from '../../utils/Floating';\nimport { OptionalPortal } from '../Portal';\nimport { getTransitionProps, Transition, TransitionOverride } from '../Transition';\nimport { TooltipBaseProps, TooltipCssVariables, TooltipStylesNames } from './Tooltip.types';\nimport { TooltipFloating } from './TooltipFloating/TooltipFloating';\nimport { TooltipGroup } from './TooltipGroup/TooltipGroup';\nimport { useTooltip } from './use-tooltip';\nimport classes from './Tooltip.module.css';\n\nexport interface TooltipProps extends TooltipBaseProps {\n /** Called when tooltip position changes */\n onPositionChange?: (position: FloatingPosition) => void;\n\n /** Open delay in ms */\n openDelay?: number;\n\n /** Close delay in ms @default 0 */\n closeDelay?: number;\n\n /** Controlled opened state */\n opened?: boolean;\n\n /** Uncontrolled tooltip initial opened state */\n defaultOpened?: boolean;\n\n /** Space between target element and tooltip in px @default 5 */\n offset?: number | FloatingAxesOffsets;\n\n /** If set, the tooltip has an arrow @default false */\n withArrow?: boolean;\n\n /** Arrow size in px @default 4 */\n arrowSize?: number;\n\n /** Arrow offset in px @default 5 */\n arrowOffset?: number;\n\n /** Arrow `border-radius` in px @default 0 */\n arrowRadius?: number;\n\n /** Arrow position relative to the tooltip @default side */\n arrowPosition?: ArrowPosition;\n\n /** Props passed down to the `Transition` component that used to animate tooltip presence, use to configure duration and animation type @default { duration: 100, transition: 'fade' } */\n transitionProps?: TransitionOverride;\n\n /** Determines which events will be used to show tooltip @default { hover: true, focus: false, touch: false } */\n events?: { hover: boolean; focus: boolean; touch: boolean };\n\n /** Must be set if the tooltip target is an inline element */\n inline?: boolean;\n\n /** If set, the tooltip is not unmounted from the DOM when hidden, `display: none` styles are applied instead */\n keepMounted?: boolean;\n\n /** Changes floating ui [position strategy](https://floating-ui.com/docs/usefloating#strategy) @default 'absolute' */\n floatingStrategy?: FloatingStrategy;\n\n /** If set, adjusts text color based on background color for `filled` variant */\n autoContrast?: boolean;\n\n /** Selector, ref of an element or element itself that should be used for positioning */\n target?: React.RefObject<HTMLElement | null> | HTMLElement | null | string;\n}\n\nexport type TooltipFactory = Factory<{\n props: TooltipProps;\n ref: HTMLDivElement;\n stylesNames: TooltipStylesNames;\n vars: TooltipCssVariables;\n staticComponents: {\n Floating: typeof TooltipFloating;\n Group: typeof TooltipGroup;\n };\n}>;\n\nconst defaultProps = {\n position: 'top',\n refProp: 'ref',\n withinPortal: true,\n arrowSize: 4,\n arrowOffset: 5,\n arrowRadius: 0,\n arrowPosition: 'side',\n offset: 5,\n transitionProps: { duration: 100, transition: 'fade' },\n events: { hover: true, focus: false, touch: false },\n zIndex: getDefaultZIndex('popover'),\n middlewares: { flip: true, shift: true, inline: false },\n} satisfies Partial<TooltipProps>;\n\nconst varsResolver = createVarsResolver<TooltipFactory>(\n (theme, { radius, color, variant, autoContrast }) => {\n const colors = theme.variantColorResolver({\n theme,\n color: color || theme.primaryColor,\n autoContrast,\n variant: variant || 'filled',\n });\n\n return {\n tooltip: {\n '--tooltip-radius': radius === undefined ? undefined : getRadius(radius),\n '--tooltip-bg': color ? colors.background : undefined,\n '--tooltip-color': color ? colors.color : undefined,\n },\n };\n }\n);\n\nexport const Tooltip = factory<TooltipFactory>((_props) => {\n const props = useProps('Tooltip', defaultProps, _props);\n const {\n children,\n position,\n refProp,\n label,\n openDelay,\n closeDelay,\n onPositionChange,\n opened,\n defaultOpened,\n withinPortal,\n radius,\n color,\n classNames,\n styles,\n unstyled,\n style,\n className,\n withArrow,\n arrowSize,\n arrowOffset,\n arrowRadius,\n arrowPosition,\n offset,\n transitionProps,\n multiline,\n events,\n zIndex,\n disabled,\n onClick,\n onMouseEnter,\n onMouseLeave,\n inline,\n variant,\n keepMounted,\n vars,\n portalProps,\n mod,\n floatingStrategy,\n middlewares,\n autoContrast,\n attributes,\n target,\n ref,\n ...others\n } = props;\n\n const { dir } = useDirection();\n const arrowRef = useRef<HTMLDivElement>(null);\n\n const tooltip = useTooltip({\n position: getFloatingPosition(dir, position),\n closeDelay,\n openDelay,\n onPositionChange,\n opened,\n defaultOpened,\n events,\n arrowRef,\n arrowOffset,\n offset: typeof offset === 'number' ? offset + (withArrow ? arrowSize / 2 : 0) : offset,\n inline,\n strategy: floatingStrategy,\n middlewares,\n });\n\n useEffect(() => {\n const targetNode =\n target instanceof HTMLElement\n ? target\n : typeof target === 'string'\n ? document.querySelector(target)\n : target?.current || null;\n\n if (targetNode) {\n tooltip.reference(targetNode);\n }\n }, [target, tooltip]);\n\n const getStyles = useStyles<TooltipFactory>({\n name: 'Tooltip',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n rootSelector: 'tooltip',\n vars,\n varsResolver,\n });\n\n const child = getSingleElementChild(children);\n if (!target && !child) {\n throw new Error(\n '[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported'\n );\n }\n\n const tooltipStyles = getStyles('tooltip');\n\n if (target) {\n const transition = getTransitionProps(transitionProps, { duration: 100, transition: 'fade' });\n return (\n <>\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <Transition\n {...transition}\n keepMounted={keepMounted}\n mounted={!disabled && !!tooltip.opened}\n duration={tooltip.isGroupPhase ? 10 : transition.duration}\n >\n {(transitionStyles) => (\n <Box\n {...others}\n data-fixed={floatingStrategy === 'fixed' || undefined}\n variant={variant}\n mod={[{ multiline }, mod]}\n {...tooltipStyles}\n {...tooltip.getFloatingProps({\n ref: tooltip.floating,\n className: tooltipStyles.className,\n style: {\n ...tooltipStyles.style,\n ...transitionStyles,\n zIndex: zIndex as React.CSSProperties['zIndex'],\n top: tooltip.y ?? 0,\n left: tooltip.x ?? 0,\n },\n })}\n >\n {label}\n <FloatingArrow\n ref={arrowRef}\n arrowX={tooltip.arrowX}\n arrowY={tooltip.arrowY}\n visible={withArrow}\n position={tooltip.placement}\n arrowSize={arrowSize}\n arrowOffset={arrowOffset}\n arrowRadius={arrowRadius}\n arrowPosition={arrowPosition}\n {...getStyles('arrow')}\n />\n </Box>\n )}\n </Transition>\n </OptionalPortal>\n </>\n );\n }\n\n // fallback to children-based approach\n const childProps = child!.props as any;\n const targetRef = useMergedRef(tooltip.reference, getRefProp(child), ref);\n const transition = getTransitionProps(transitionProps, { duration: 100, transition: 'fade' });\n\n return (\n <>\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <Transition\n {...transition}\n keepMounted={keepMounted}\n mounted={!disabled && !!tooltip.opened}\n duration={tooltip.isGroupPhase ? 10 : transition.duration}\n >\n {(transitionStyles) => (\n <Box\n {...others}\n data-fixed={floatingStrategy === 'fixed' || undefined}\n variant={variant}\n mod={[{ multiline }, mod]}\n {...tooltip.getFloatingProps({\n ref: tooltip.floating,\n className: getStyles('tooltip').className,\n style: {\n ...getStyles('tooltip').style,\n ...transitionStyles,\n zIndex: zIndex as React.CSSProperties['zIndex'],\n top: tooltip.y ?? 0,\n left: tooltip.x ?? 0,\n },\n })}\n >\n {label}\n <FloatingArrow\n ref={arrowRef}\n arrowX={tooltip.arrowX}\n arrowY={tooltip.arrowY}\n visible={withArrow}\n position={tooltip.placement}\n arrowSize={arrowSize}\n arrowOffset={arrowOffset}\n arrowRadius={arrowRadius}\n arrowPosition={arrowPosition}\n {...getStyles('arrow')}\n />\n </Box>\n )}\n </Transition>\n </OptionalPortal>\n\n {cloneElement(\n child!,\n tooltip.getReferenceProps({\n onClick,\n onMouseEnter,\n onMouseLeave,\n onMouseMove: props.onMouseMove,\n onPointerDown: props.onPointerDown,\n onPointerEnter: props.onPointerEnter,\n ...childProps,\n className: cx(className, childProps.className),\n [refProp]: targetRef,\n })\n )}\n </>\n );\n});\n\nTooltip.classes = classes;\nTooltip.varsResolver = varsResolver;\nTooltip.displayName = '@mantine/core/Tooltip';\nTooltip.Floating = TooltipFloating;\nTooltip.Group = TooltipGroup;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGA,MAAM,eAAe;CACnB,UAAU;CACV,SAAS;CACT,cAAc;CACd,WAAW;CACX,aAAa;CACb,aAAa;CACb,eAAe;CACf,QAAQ;CACR,iBAAiB;EAAE,UAAU;EAAK,YAAY;EAAQ;CACtD,QAAQ;EAAE,OAAO;EAAM,OAAO;EAAO,OAAO;EAAO;CACnD,QAAQA,4BAAAA,iBAAiB,UAAU;CACnC,aAAa;EAAE,MAAM;EAAM,OAAO;EAAM,QAAQ;EAAO;CACxD;AAED,MAAM,eAAeC,6BAAAA,oBAClB,OAAO,EAAE,QAAQ,OAAO,SAAS,mBAAmB;CACnD,MA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|
1
|
+
{"version":3,"file":"Tooltip.cjs","names":["getDefaultZIndex","createVarsResolver","getRadius","factory","useProps","useDirection","useTooltip","getFloatingPosition","useStyles","getSingleElementChild","getTransitionProps","OptionalPortal","Transition","Box","FloatingArrow","getRefProp","classes","TooltipFloating","TooltipGroup"],"sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { cloneElement, useEffect, useRef } from 'react';\nimport cx from 'clsx';\nimport { useMergedRef } from '@mantine/hooks';\nimport {\n Box,\n createVarsResolver,\n factory,\n Factory,\n getDefaultZIndex,\n getRadius,\n getRefProp,\n getSingleElementChild,\n useDirection,\n useProps,\n useStyles,\n} from '../../core';\nimport {\n ArrowPosition,\n FloatingArrow,\n FloatingAxesOffsets,\n FloatingPosition,\n FloatingStrategy,\n getFloatingPosition,\n} from '../../utils/Floating';\nimport { OptionalPortal } from '../Portal';\nimport { getTransitionProps, Transition, TransitionOverride } from '../Transition';\nimport { TooltipBaseProps, TooltipCssVariables, TooltipStylesNames } from './Tooltip.types';\nimport { TooltipFloating, type TooltipFloatingProps } from './TooltipFloating/TooltipFloating';\nimport {\n TooltipGroup,\n type TooltipGroupProps,\n type TooltipGroupContextValue,\n} from './TooltipGroup/TooltipGroup';\nimport { useTooltip } from './use-tooltip';\nimport classes from './Tooltip.module.css';\nexport interface TooltipProps extends TooltipBaseProps {\n /** Called when tooltip position changes */\n onPositionChange?: (position: FloatingPosition) => void;\n\n /** Open delay in ms */\n openDelay?: number;\n\n /** Close delay in ms @default 0 */\n closeDelay?: number;\n\n /** Controlled opened state */\n opened?: boolean;\n\n /** Uncontrolled tooltip initial opened state */\n defaultOpened?: boolean;\n\n /** Space between target element and tooltip in px @default 5 */\n offset?: number | FloatingAxesOffsets;\n\n /** If set, the tooltip has an arrow @default false */\n withArrow?: boolean;\n\n /** Arrow size in px @default 4 */\n arrowSize?: number;\n\n /** Arrow offset in px @default 5 */\n arrowOffset?: number;\n\n /** Arrow `border-radius` in px @default 0 */\n arrowRadius?: number;\n\n /** Arrow position relative to the tooltip @default side */\n arrowPosition?: ArrowPosition;\n\n /** Props passed down to the `Transition` component that used to animate tooltip presence, use to configure duration and animation type @default { duration: 100, transition: 'fade' } */\n transitionProps?: TransitionOverride;\n\n /** Determines which events will be used to show tooltip @default { hover: true, focus: false, touch: false } */\n events?: { hover: boolean; focus: boolean; touch: boolean };\n\n /** Must be set if the tooltip target is an inline element */\n inline?: boolean;\n\n /** If set, the tooltip is not unmounted from the DOM when hidden, `display: none` styles are applied instead */\n keepMounted?: boolean;\n\n /** Changes floating ui [position strategy](https://floating-ui.com/docs/usefloating#strategy) @default 'absolute' */\n floatingStrategy?: FloatingStrategy;\n\n /** If set, adjusts text color based on background color for `filled` variant */\n autoContrast?: boolean;\n\n /** Selector, ref of an element or element itself that should be used for positioning */\n target?: React.RefObject<HTMLElement | null> | HTMLElement | null | string;\n}\n\nexport type TooltipFactory = Factory<{\n props: TooltipProps;\n ref: HTMLDivElement;\n stylesNames: TooltipStylesNames;\n vars: TooltipCssVariables;\n staticComponents: {\n Floating: typeof TooltipFloating;\n Group: typeof TooltipGroup;\n };\n}>;\n\nconst defaultProps = {\n position: 'top',\n refProp: 'ref',\n withinPortal: true,\n arrowSize: 4,\n arrowOffset: 5,\n arrowRadius: 0,\n arrowPosition: 'side',\n offset: 5,\n transitionProps: { duration: 100, transition: 'fade' },\n events: { hover: true, focus: false, touch: false },\n zIndex: getDefaultZIndex('popover'),\n middlewares: { flip: true, shift: true, inline: false },\n} satisfies Partial<TooltipProps>;\n\nconst varsResolver = createVarsResolver<TooltipFactory>(\n (theme, { radius, color, variant, autoContrast }) => {\n const colors = theme.variantColorResolver({\n theme,\n color: color || theme.primaryColor,\n autoContrast,\n variant: variant || 'filled',\n });\n\n return {\n tooltip: {\n '--tooltip-radius': radius === undefined ? undefined : getRadius(radius),\n '--tooltip-bg': color ? colors.background : undefined,\n '--tooltip-color': color ? colors.color : undefined,\n },\n };\n }\n);\n\nexport const Tooltip = factory<TooltipFactory>((_props) => {\n const props = useProps('Tooltip', defaultProps, _props);\n const {\n children,\n position,\n refProp,\n label,\n openDelay,\n closeDelay,\n onPositionChange,\n opened,\n defaultOpened,\n withinPortal,\n radius,\n color,\n classNames,\n styles,\n unstyled,\n style,\n className,\n withArrow,\n arrowSize,\n arrowOffset,\n arrowRadius,\n arrowPosition,\n offset,\n transitionProps,\n multiline,\n events,\n zIndex,\n disabled,\n onClick,\n onMouseEnter,\n onMouseLeave,\n inline,\n variant,\n keepMounted,\n vars,\n portalProps,\n mod,\n floatingStrategy,\n middlewares,\n autoContrast,\n attributes,\n target,\n ref,\n ...others\n } = props;\n\n const { dir } = useDirection();\n const arrowRef = useRef<HTMLDivElement>(null);\n\n const tooltip = useTooltip({\n position: getFloatingPosition(dir, position),\n closeDelay,\n openDelay,\n onPositionChange,\n opened,\n defaultOpened,\n events,\n arrowRef,\n arrowOffset,\n offset: typeof offset === 'number' ? offset + (withArrow ? arrowSize / 2 : 0) : offset,\n inline,\n strategy: floatingStrategy,\n middlewares,\n });\n\n useEffect(() => {\n const targetNode =\n target instanceof HTMLElement\n ? target\n : typeof target === 'string'\n ? document.querySelector(target)\n : target?.current || null;\n\n if (targetNode) {\n tooltip.reference(targetNode);\n }\n }, [target, tooltip]);\n\n const getStyles = useStyles<TooltipFactory>({\n name: 'Tooltip',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n rootSelector: 'tooltip',\n vars,\n varsResolver,\n });\n\n const child = getSingleElementChild(children);\n if (!target && !child) {\n throw new Error(\n '[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported'\n );\n }\n\n const tooltipStyles = getStyles('tooltip');\n\n if (target) {\n const transition = getTransitionProps(transitionProps, { duration: 100, transition: 'fade' });\n return (\n <>\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <Transition\n {...transition}\n keepMounted={keepMounted}\n mounted={!disabled && !!tooltip.opened}\n duration={tooltip.isGroupPhase ? 10 : transition.duration}\n >\n {(transitionStyles) => (\n <Box\n {...others}\n data-fixed={floatingStrategy === 'fixed' || undefined}\n variant={variant}\n mod={[{ multiline }, mod]}\n {...tooltipStyles}\n {...tooltip.getFloatingProps({\n ref: tooltip.floating,\n className: tooltipStyles.className,\n style: {\n ...tooltipStyles.style,\n ...transitionStyles,\n zIndex: zIndex as React.CSSProperties['zIndex'],\n top: tooltip.y ?? 0,\n left: tooltip.x ?? 0,\n },\n })}\n >\n {label}\n <FloatingArrow\n ref={arrowRef}\n arrowX={tooltip.arrowX}\n arrowY={tooltip.arrowY}\n visible={withArrow}\n position={tooltip.placement}\n arrowSize={arrowSize}\n arrowOffset={arrowOffset}\n arrowRadius={arrowRadius}\n arrowPosition={arrowPosition}\n {...getStyles('arrow')}\n />\n </Box>\n )}\n </Transition>\n </OptionalPortal>\n </>\n );\n }\n\n // fallback to children-based approach\n const childProps = child!.props as any;\n const targetRef = useMergedRef(tooltip.reference, getRefProp(child), ref);\n const transition = getTransitionProps(transitionProps, { duration: 100, transition: 'fade' });\n\n return (\n <>\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <Transition\n {...transition}\n keepMounted={keepMounted}\n mounted={!disabled && !!tooltip.opened}\n duration={tooltip.isGroupPhase ? 10 : transition.duration}\n >\n {(transitionStyles) => (\n <Box\n {...others}\n data-fixed={floatingStrategy === 'fixed' || undefined}\n variant={variant}\n mod={[{ multiline }, mod]}\n {...tooltip.getFloatingProps({\n ref: tooltip.floating,\n className: getStyles('tooltip').className,\n style: {\n ...getStyles('tooltip').style,\n ...transitionStyles,\n zIndex: zIndex as React.CSSProperties['zIndex'],\n top: tooltip.y ?? 0,\n left: tooltip.x ?? 0,\n },\n })}\n >\n {label}\n <FloatingArrow\n ref={arrowRef}\n arrowX={tooltip.arrowX}\n arrowY={tooltip.arrowY}\n visible={withArrow}\n position={tooltip.placement}\n arrowSize={arrowSize}\n arrowOffset={arrowOffset}\n arrowRadius={arrowRadius}\n arrowPosition={arrowPosition}\n {...getStyles('arrow')}\n />\n </Box>\n )}\n </Transition>\n </OptionalPortal>\n\n {cloneElement(\n child!,\n tooltip.getReferenceProps({\n onClick,\n onMouseEnter,\n onMouseLeave,\n onMouseMove: props.onMouseMove,\n onPointerDown: props.onPointerDown,\n onPointerEnter: props.onPointerEnter,\n ...childProps,\n className: cx(className, childProps.className),\n [refProp]: targetRef,\n })\n )}\n </>\n );\n});\n\nTooltip.classes = classes;\nTooltip.varsResolver = varsResolver;\nTooltip.displayName = '@mantine/core/Tooltip';\nTooltip.Floating = TooltipFloating;\nTooltip.Group = TooltipGroup;\n\nexport namespace Tooltip {\n export type Props = TooltipProps;\n export type Factory = TooltipFactory;\n export type CssVariables = TooltipCssVariables;\n export type StylesNames = TooltipStylesNames;\n\n export namespace Group {\n export type Props = TooltipGroupProps;\n export type ContextValue = TooltipGroupContextValue;\n }\n\n export namespace Floating {\n export type Props = TooltipFloatingProps;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAsGA,MAAM,eAAe;CACnB,UAAU;CACV,SAAS;CACT,cAAc;CACd,WAAW;CACX,aAAa;CACb,aAAa;CACb,eAAe;CACf,QAAQ;CACR,iBAAiB;EAAE,UAAU;EAAK,YAAY;EAAQ;CACtD,QAAQ;EAAE,OAAO;EAAM,OAAO;EAAO,OAAO;EAAO;CACnD,QAAQA,4BAAAA,iBAAiB,UAAU;CACnC,aAAa;EAAE,MAAM;EAAM,OAAO;EAAM,QAAQ;EAAO;CACxD;AAED,MAAM,eAAeC,6BAAAA,oBAClB,OAAO,EAAE,QAAQ,OAAO,SAAS,mBAAmB;CACnD,MAAM,SAAS,MAAM,qBAAqB;EACxC;EACA,OAAO,SAAS,MAAM;EACtB;EACA,SAAS,WAAW;EACrB,CAAC;AAEF,QAAO,EACL,SAAS;EACP,oBAAoB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,OAAO;EACxE,gBAAgB,QAAQ,OAAO,aAAa,KAAA;E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AAI;GACS;GACb,SAAS,CAAC,YAAY,CAAC,CAAC,QAAQ;GAChC,UAAU,QAAQ,eAAe,KAAK,WAAW;cAE/C,qBACA,iBAAA,GAAA,kBAAA,MAACC,YAAAA,KAAD;IACE,GAAI;IACJ,cAAY,qBAAqB,WAAW,KAAA;IACnC;IACT,KAAK,CAAC,EAAE,WAAW,EAAE,IAAI;IACzB,GAAI,QAAQ,iBAAiB;KAC3B,KAAK,QAAQ;KACb,WAAW,UAAU,UAAU,CAAC;KAChC,OAAO;MACL,GAAG,UAAU,UAAU,CAAC;MACxB,GAAG;MACK;MACR,KAAK,QAAQ,KAAK;MAClB,MAAM,QAAQ,KAAK;MACpB;KACF,CAAC;cAfJ,CAiBG,OACD,iBAAA,GAAA,kBAAA,KAACC,sBAAAA,eAAD;KACE,KAAK;KACL,QAAQ,QAAQ;KAChB,QAAQ,QAAQ;KAChB,SAAS;KACT,UAAU,QAAQ;KACP;KACE;KACA;KACE;KACf,GAAI,UAAU,QAAQ;KACtB,CAAA,CACE;;GAEG,CAAA;EACE,CAAA,GAAA,GAAA,MAAA,cAGf,OACA,QAAQ,kBAAkB;EACxB;EACA;EACA;EACA,aAAa,MAAM;EACnB,eAAe,MAAM;EACrB,gBAAgB,MAAM;EACtB,GAAG;EACH,YAAA,GAAA,KAAA,SAAc,WAAW,WAAW,UAAU;GAC7C,UAAU;EACZ,CAAC,CACH,CACA,EAAA,CAAA;EAEL;AAEF,QAAQ,UAAUE,uBAAAA;AAClB,QAAQ,eAAe;AACvB,QAAQ,cAAc;AACtB,QAAQ,WAAWC,wBAAAA;AACnB,QAAQ,QAAQC,qBAAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.cjs","names":["createVarsResolver","getSpacing","factory","useProps","useTree","useStyles","TreeNode","Box","classes"],"sources":["../../../src/components/Tree/Tree.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react';\nimport { useClickOutside, useMergedRef } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSpacing,\n MantineSpacing,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { TreeNode } from './TreeNode';\nimport { TreeController, useTree } from './use-tree';\nimport classes from './Tree.module.css';\n\nexport interface TreeNodeData {\n label: React.ReactNode;\n value: string;\n nodeProps?: Record<string, any>;\n children?: TreeNodeData[];\n}\n\nexport interface RenderTreeNodePayload {\n /** Node level in the tree */\n level: number;\n\n /** `true` if the node is expanded, applicable only for nodes with `children` */\n expanded: boolean;\n\n /** `true` if the node has non-empty `children` array */\n hasChildren: boolean;\n\n /** `true` if the node is selected */\n selected: boolean;\n\n /** Node data from the `data` prop of `Tree` */\n node: TreeNodeData;\n\n /** Tree controller instance, return value of `useTree` hook */\n tree: TreeController;\n\n /** Props to spread into the root node element */\n elementProps: {\n className: string;\n style: React.CSSProperties;\n onClick: (event: React.MouseEvent) => void;\n 'data-selected': boolean | undefined;\n 'data-value': string;\n };\n}\n\nexport type RenderNode = (payload: RenderTreeNodePayload) => React.ReactNode;\n\nexport type TreeStylesNames = 'root' | 'node' | 'subtree' | 'label';\nexport type TreeCssVariables = {\n root: '--level-offset';\n};\n\nexport interface TreeProps extends BoxProps, StylesApiProps<TreeFactory>, ElementProps<'ul'> {\n /** Data used to render nodes */\n data: TreeNodeData[];\n\n /** Horizontal padding of each subtree level, key of `theme.spacing` or any valid CSS value @default 'lg' */\n levelOffset?: MantineSpacing;\n\n /** If set, tree node with children is expanded on click @default true */\n expandOnClick?: boolean;\n\n /** If set, tree node with children is expanded on space key press @default true */\n expandOnSpace?: boolean;\n\n /** If set, tree node is checked on space key press @default false */\n checkOnSpace?: boolean;\n\n /** If set, tree node is selected on click @default false */\n selectOnClick?: boolean;\n\n /** Use-tree hook instance that can be used to manipulate component state */\n tree?: TreeController;\n\n /** A function to render tree node label */\n renderNode?: RenderNode;\n\n /** If set, selection is cleared when user clicks outside of the tree @default false */\n clearSelectionOnOutsideClick?: boolean;\n\n /** If set, tree nodes range can be selected with click when `Shift` key is pressed @default true */\n allowRangeSelection?: boolean;\n\n /** If set, subtree content is kept mounted when collapsed. React 19 `Activity` is used to preserve state. @default false */\n keepMounted?: boolean;\n}\n\nfunction getFlatValues(data: TreeNodeData[]): string[] {\n return data.reduce<string[]>((acc, item) => {\n acc.push(item.value);\n if (item.children) {\n acc.push(...getFlatValues(item.children));\n }\n return acc;\n }, []);\n}\n\nexport type TreeFactory = Factory<{\n props: TreeProps;\n ref: HTMLUListElement;\n stylesNames: TreeStylesNames;\n vars: TreeCssVariables;\n}>;\n\nconst defaultProps = {\n expandOnClick: true,\n allowRangeSelection: true,\n expandOnSpace: true,\n} satisfies Partial<TreeProps>;\n\nconst varsResolver = createVarsResolver<TreeFactory>((_theme, { levelOffset }) => ({\n root: {\n '--level-offset': getSpacing(levelOffset),\n },\n}));\n\nexport const Tree = factory<TreeFactory>((_props) => {\n const props = useProps('Tree', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n data,\n expandOnClick,\n tree,\n renderNode,\n selectOnClick,\n clearSelectionOnOutsideClick,\n allowRangeSelection,\n expandOnSpace,\n levelOffset,\n checkOnSpace,\n keepMounted,\n attributes,\n ref,\n ...others\n } = props;\n\n const defaultController = useTree();\n const controller = tree || defaultController;\n\n const getStyles = useStyles<TreeFactory>({\n name: 'Tree',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const clickOutsideRef = useClickOutside(\n () => clearSelectionOnOutsideClick && controller.clearSelected()\n );\n\n const mergedRef = useMergedRef(ref, clickOutsideRef);\n\n const flatValues = useMemo(() => getFlatValues(data), [data]);\n\n useEffect(() => {\n controller.initialize(data);\n }, [data]);\n\n const nodes = data.map((node, index) => (\n <TreeNode\n key={node.value}\n node={node}\n getStyles={getStyles}\n rootIndex={index}\n expandOnClick={expandOnClick}\n selectOnClick={selectOnClick}\n controller={controller}\n renderNode={renderNode}\n flatValues={flatValues}\n allowRangeSelection={allowRangeSelection}\n expandOnSpace={expandOnSpace}\n checkOnSpace={checkOnSpace}\n keepMounted={keepMounted}\n />\n ));\n\n return (\n <Box\n component=\"ul\"\n ref={mergedRef}\n {...getStyles('root')}\n {...others}\n role=\"tree\"\n aria-multiselectable={controller.multiple}\n data-tree-root\n >\n {nodes}\n </Box>\n );\n});\n\nTree.displayName = '@mantine/core/Tree';\nTree.classes = classes;\nTree.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;AAiGA,SAAS,cAAc,MAAgC;AACrD,QAAO,KAAK,QAAkB,KAAK,SAAS;AAC1C,MAAI,KAAK,KAAK,MAAM;AACpB,MAAI,KAAK,SACP,KAAI,KAAK,GAAG,cAAc,KAAK,SAAS,CAAC;AAE3C,SAAO;IACN,EAAE,CAAC;;AAUR,MAAM,eAAe;CACnB,eAAe;CACf,qBAAqB;CACrB,eAAe;CAChB;AAED,MAAM,eAAeA,6BAAAA,oBAAiC,QAAQ,EAAE,mBAAmB,EACjF,MAAM,EACJ,kBAAkBC,iBAAAA,WAAW,YAAY,EAC1C,EACF,EAAE;AAEH,MAAa,OAAOC,gBAAAA,SAAsB,WAAW;CACnD,MAAM,QAAQC,kBAAAA,SAAS,QAAQ,cAAc,OAAO;CACpD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,eACA,MACA,YACA,eACA,8BACA,qBACA,eACA,aACA,cACA,aACA,YACA,KACA,GAAG,WACD;CAEJ,MAAM,oBAAoBC,iBAAAA,SAAS;CACnC,MAAM,aAAa,QAAQ;CAE3B,MAAM,YAAYC,mBAAAA,UAAuB;EACvC,MAAM;EACN,SAAA,oBAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAMF,MAAM,aAAA,GAAA,eAAA,cAAyB,MAAA,GAAA,eAAA,uBAHvB,gCAAgC,WAAW,eAAe,CACjE,CAEmD;CAEpD,MAAM,cAAA,GAAA,MAAA,eAA2B,cAAc,KAAK,EAAE,CAAC,KAAK,CAAC;AAE7D,EAAA,GAAA,MAAA,iBAAgB;AACd,aAAW,WAAW,KAAK;IAC1B,CAAC,KAAK,CAAC;CAEV,MAAM,QAAQ,KAAK,KAAK,MAAM,UAC5B,iBAAA,GAAA,kBAAA,KAACC,iBAAAA,UAAD;EAEQ;EACK;EACX,WAAW;EACI;EACA;EACH;EACA;EACA;EACS;EACN;EACD;EACD;EACb,EAbK,KAAK,MAaV,CACF;AAEF,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,WAAU;EACV,KAAK;EACL,GAAI,UAAU,OAAO;EACrB,GAAI;EACJ,MAAK;EACL,wBAAsB,WAAW;EACjC,kBAAA;YAEC;EACG,CAAA;EAER;AAEF,KAAK,cAAc;AACnB,KAAK,UAAUC,oBAAAA;AACf,KAAK,eAAe"}
|
|
1
|
+
{"version":3,"file":"Tree.cjs","names":["createVarsResolver","getSpacing","factory","useProps","useTree","useStyles","TreeNode","Box","classes"],"sources":["../../../src/components/Tree/Tree.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react';\nimport { useClickOutside, useMergedRef } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSpacing,\n MantineSpacing,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { TreeNode } from './TreeNode';\nimport { TreeController, useTree } from './use-tree';\nimport classes from './Tree.module.css';\n\nexport interface TreeNodeData {\n label: React.ReactNode;\n value: string;\n nodeProps?: Record<string, any>;\n children?: TreeNodeData[];\n}\n\nexport interface RenderTreeNodePayload {\n /** Node level in the tree */\n level: number;\n\n /** `true` if the node is expanded, applicable only for nodes with `children` */\n expanded: boolean;\n\n /** `true` if the node has non-empty `children` array */\n hasChildren: boolean;\n\n /** `true` if the node is selected */\n selected: boolean;\n\n /** Node data from the `data` prop of `Tree` */\n node: TreeNodeData;\n\n /** Tree controller instance, return value of `useTree` hook */\n tree: TreeController;\n\n /** Props to spread into the root node element */\n elementProps: {\n className: string;\n style: React.CSSProperties;\n onClick: (event: React.MouseEvent) => void;\n 'data-selected': boolean | undefined;\n 'data-value': string;\n };\n}\n\nexport type RenderNode = (payload: RenderTreeNodePayload) => React.ReactNode;\n\nexport type TreeStylesNames = 'root' | 'node' | 'subtree' | 'label';\nexport type TreeCssVariables = {\n root: '--level-offset';\n};\n\nexport interface TreeProps extends BoxProps, StylesApiProps<TreeFactory>, ElementProps<'ul'> {\n /** Data used to render nodes */\n data: TreeNodeData[];\n\n /** Horizontal padding of each subtree level, key of `theme.spacing` or any valid CSS value @default 'lg' */\n levelOffset?: MantineSpacing;\n\n /** If set, tree node with children is expanded on click @default true */\n expandOnClick?: boolean;\n\n /** If set, tree node with children is expanded on space key press @default true */\n expandOnSpace?: boolean;\n\n /** If set, tree node is checked on space key press @default false */\n checkOnSpace?: boolean;\n\n /** If set, tree node is selected on click @default false */\n selectOnClick?: boolean;\n\n /** Use-tree hook instance that can be used to manipulate component state */\n tree?: TreeController;\n\n /** A function to render tree node label */\n renderNode?: RenderNode;\n\n /** If set, selection is cleared when user clicks outside of the tree @default false */\n clearSelectionOnOutsideClick?: boolean;\n\n /** If set, tree nodes range can be selected with click when `Shift` key is pressed @default true */\n allowRangeSelection?: boolean;\n\n /** If set, subtree content is kept mounted when collapsed. React 19 `Activity` is used to preserve state. @default false */\n keepMounted?: boolean;\n}\n\nfunction getFlatValues(data: TreeNodeData[]): string[] {\n return data.reduce<string[]>((acc, item) => {\n acc.push(item.value);\n if (item.children) {\n acc.push(...getFlatValues(item.children));\n }\n return acc;\n }, []);\n}\n\nexport type TreeFactory = Factory<{\n props: TreeProps;\n ref: HTMLUListElement;\n stylesNames: TreeStylesNames;\n vars: TreeCssVariables;\n}>;\n\nconst defaultProps = {\n expandOnClick: true,\n allowRangeSelection: true,\n expandOnSpace: true,\n} satisfies Partial<TreeProps>;\n\nconst varsResolver = createVarsResolver<TreeFactory>((_theme, { levelOffset }) => ({\n root: {\n '--level-offset': getSpacing(levelOffset),\n },\n}));\n\nexport const Tree = factory<TreeFactory>((_props) => {\n const props = useProps('Tree', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n data,\n expandOnClick,\n tree,\n renderNode,\n selectOnClick,\n clearSelectionOnOutsideClick,\n allowRangeSelection,\n expandOnSpace,\n levelOffset,\n checkOnSpace,\n keepMounted,\n attributes,\n ref,\n ...others\n } = props;\n\n const defaultController = useTree();\n const controller = tree || defaultController;\n\n const getStyles = useStyles<TreeFactory>({\n name: 'Tree',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const clickOutsideRef = useClickOutside(\n () => clearSelectionOnOutsideClick && controller.clearSelected()\n );\n\n const mergedRef = useMergedRef(ref, clickOutsideRef);\n\n const flatValues = useMemo(() => getFlatValues(data), [data]);\n\n useEffect(() => {\n controller.initialize(data);\n }, [data]);\n\n const nodes = data.map((node, index) => (\n <TreeNode\n key={node.value}\n node={node}\n getStyles={getStyles}\n rootIndex={index}\n expandOnClick={expandOnClick}\n selectOnClick={selectOnClick}\n controller={controller}\n renderNode={renderNode}\n flatValues={flatValues}\n allowRangeSelection={allowRangeSelection}\n expandOnSpace={expandOnSpace}\n checkOnSpace={checkOnSpace}\n keepMounted={keepMounted}\n />\n ));\n\n return (\n <Box\n component=\"ul\"\n ref={mergedRef}\n {...getStyles('root')}\n {...others}\n role=\"tree\"\n aria-multiselectable={controller.multiple}\n data-tree-root\n >\n {nodes}\n </Box>\n );\n});\n\nTree.displayName = '@mantine/core/Tree';\nTree.classes = classes;\nTree.varsResolver = varsResolver;\n\nexport namespace Tree {\n export type Props = TreeProps;\n export type StylesNames = TreeStylesNames;\n export type Factory = TreeFactory;\n export type NodeData = TreeNodeData;\n export type RenderNodePayload = RenderTreeNodePayload;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAiGA,SAAS,cAAc,MAAgC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;EACE,WAAU;EACV,KAAK;EACL,GAAI,UAAU,OAAO;EACrB,GAAI;EACJ,MAAK;EACL,wBAAsB,WAAW;EACjC,kBAAA;YAEC;EACG,CAAA;EAER;AAEF,KAAK,cAAc;AACnB,KAAK,UAAUC,oBAAAA;AACf,KAAK,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.cjs","names":["factory","useProps","Box","useStyles","classes"],"sources":["../../../src/components/Typography/Typography.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Typography.module.css';\n\nexport type TypographyStylesNames = 'root';\n\nexport interface TypographyProps\n extends BoxProps, StylesApiProps<TypographyFactory>, ElementProps<'div'> {}\n\nexport type TypographyFactory = Factory<{\n props: TypographyProps;\n ref: HTMLDivElement;\n stylesNames: TypographyStylesNames;\n}>;\n\nexport const Typography = factory<TypographyFactory>((_props) => {\n const props = useProps('Typography', null, _props);\n const { classNames, className, style, styles, unstyled, attributes, ...others } = props;\n\n const getStyles = useStyles<TypographyFactory>({\n name: 'Typography',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n });\n\n return <Box {...getStyles('root')} {...others} />;\n});\n\nTypography.classes = classes;\nTypography.displayName = '@mantine/core/Typography';\n"],"mappings":";;;;;;;;;AAuBA,MAAa,aAAaA,gBAAAA,SAA4B,WAAW;CAC/D,MAAM,QAAQC,kBAAAA,SAAS,cAAc,MAAM,OAAO;CAClD,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,UAAU,YAAY,GAAG,WAAW;AAclF,QAAO,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EAAK,GAZMC,mBAAAA,UAA6B;GAC7C,MAAM;GACN,SAAA,0BAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,CAEwB,OAAO;EAAE,GAAI;EAAU,CAAA;EACjD;AAEF,WAAW,UAAUC,0BAAAA;AACrB,WAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"Typography.cjs","names":["factory","useProps","Box","useStyles","classes"],"sources":["../../../src/components/Typography/Typography.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Typography.module.css';\n\nexport type TypographyStylesNames = 'root';\n\nexport interface TypographyProps\n extends BoxProps, StylesApiProps<TypographyFactory>, ElementProps<'div'> {}\n\nexport type TypographyFactory = Factory<{\n props: TypographyProps;\n ref: HTMLDivElement;\n stylesNames: TypographyStylesNames;\n}>;\n\nexport const Typography = factory<TypographyFactory>((_props) => {\n const props = useProps('Typography', null, _props);\n const { classNames, className, style, styles, unstyled, attributes, ...others } = props;\n\n const getStyles = useStyles<TypographyFactory>({\n name: 'Typography',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n });\n\n return <Box {...getStyles('root')} {...others} />;\n});\n\nTypography.classes = classes;\nTypography.displayName = '@mantine/core/Typography';\n\nexport namespace Typography {\n export type Props = TypographyProps;\n export type StylesNames = TypographyStylesNames;\n export type Factory = TypographyFactory;\n}\n"],"mappings":";;;;;;;;;AAuBA,MAAa,aAAaA,gBAAAA,SAA4B,WAAW;CAC/D,MAAM,QAAQC,kBAAAA,SAAS,cAAc,MAAM,OAAO;CAClD,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,UAAU,YAAY,GAAG,WAAW;AAclF,QAAO,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EAAK,GAZMC,mBAAAA,UAA6B;GAC7C,MAAM;GACN,SAAA,0BAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,CAEwB,OAAO;EAAE,GAAI;EAAU,CAAA;EACjD;AAEF,WAAW,UAAUC,0BAAAA;AACrB,WAAW,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnstyledButton.cjs","names":["polymorphicFactory","useProps","Box","useStyles","classes"],"sources":["../../../src/components/UnstyledButton/UnstyledButton.tsx"],"sourcesContent":["import {\n Box,\n BoxComponentProps,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './UnstyledButton.module.css';\n\nexport type UnstyledButtonStylesNames = 'root';\n\nexport interface UnstyledButtonProps\n extends Omit<BoxComponentProps, 'vars' | 'variant'>, StylesApiProps<UnstyledButtonFactory> {\n __staticSelector?: string;\n}\n\nconst defaultProps = {\n __staticSelector: 'UnstyledButton',\n} satisfies Partial<UnstyledButtonProps>;\n\nexport type UnstyledButtonFactory = PolymorphicFactory<{\n props: UnstyledButtonProps;\n stylesNames: UnstyledButtonStylesNames;\n defaultComponent: 'button';\n defaultRef: HTMLButtonElement;\n}>;\n\nexport const UnstyledButton = polymorphicFactory<UnstyledButtonFactory>(\n (_props: UnstyledButtonProps & { component?: any }) => {\n const props = useProps('UnstyledButton', defaultProps, _props);\n const {\n className,\n component = 'button',\n __staticSelector,\n unstyled,\n classNames,\n styles,\n style,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<UnstyledButtonFactory>({\n name: __staticSelector,\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n });\n\n return (\n <Box\n {...getStyles('root', { focusable: true })}\n component={component}\n type={component === 'button' ? 'button' : undefined}\n {...others}\n />\n );\n }\n);\n\nUnstyledButton.classes = classes;\nUnstyledButton.displayName = '@mantine/core/UnstyledButton';\n"],"mappings":";;;;;;;;;AAkBA,MAAM,eAAe,EACnB,kBAAkB,kBACnB;AASD,MAAa,iBAAiBA,4BAAAA,oBAC3B,WAAsD;CACrD,MAAM,QAAQC,kBAAAA,SAAS,kBAAkB,cAAc,OAAO;CAC9D,MAAM,EACJ,WACA,YAAY,UACZ,kBACA,UACA,YACA,QACA,OACA,YACA,GAAG,WACD;AAcJ,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,GAdcC,mBAAAA,UAAiC;GACjD,MAAM;GACN;GACA,SAAA,8BAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,CAIgB,QAAQ,EAAE,WAAW,MAAM,CAAC;EAC/B;EACX,MAAM,cAAc,WAAW,WAAW,KAAA;EAC1C,GAAI;EACJ,CAAA;EAGP;AAED,eAAe,UAAUC,8BAAAA;AACzB,eAAe,cAAc"}
|
|
1
|
+
{"version":3,"file":"UnstyledButton.cjs","names":["polymorphicFactory","useProps","Box","useStyles","classes"],"sources":["../../../src/components/UnstyledButton/UnstyledButton.tsx"],"sourcesContent":["import {\n Box,\n BoxComponentProps,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './UnstyledButton.module.css';\n\nexport type UnstyledButtonStylesNames = 'root';\n\nexport interface UnstyledButtonProps\n extends Omit<BoxComponentProps, 'vars' | 'variant'>, StylesApiProps<UnstyledButtonFactory> {\n __staticSelector?: string;\n}\n\nconst defaultProps = {\n __staticSelector: 'UnstyledButton',\n} satisfies Partial<UnstyledButtonProps>;\n\nexport type UnstyledButtonFactory = PolymorphicFactory<{\n props: UnstyledButtonProps;\n stylesNames: UnstyledButtonStylesNames;\n defaultComponent: 'button';\n defaultRef: HTMLButtonElement;\n}>;\n\nexport const UnstyledButton = polymorphicFactory<UnstyledButtonFactory>(\n (_props: UnstyledButtonProps & { component?: any }) => {\n const props = useProps('UnstyledButton', defaultProps, _props);\n const {\n className,\n component = 'button',\n __staticSelector,\n unstyled,\n classNames,\n styles,\n style,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<UnstyledButtonFactory>({\n name: __staticSelector,\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n });\n\n return (\n <Box\n {...getStyles('root', { focusable: true })}\n component={component}\n type={component === 'button' ? 'button' : undefined}\n {...others}\n />\n );\n }\n);\n\nUnstyledButton.classes = classes;\nUnstyledButton.displayName = '@mantine/core/UnstyledButton';\n\nexport namespace UnstyledButton {\n export type Props = UnstyledButtonProps;\n export type StylesNames = UnstyledButtonStylesNames;\n export type Factory = UnstyledButtonFactory;\n}\n"],"mappings":";;;;;;;;;AAkBA,MAAM,eAAe,EACnB,kBAAkB,kBACnB;AASD,MAAa,iBAAiBA,4BAAAA,oBAC3B,WAAsD;CACrD,MAAM,QAAQC,kBAAAA,SAAS,kBAAkB,cAAc,OAAO;CAC9D,MAAM,EACJ,WACA,YAAY,UACZ,kBACA,UACA,YACA,QACA,OACA,YACA,GAAG,WACD;AAcJ,QACE,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EACE,GAdcC,mBAAAA,UAAiC;GACjD,MAAM;GACN;GACA,SAAA,8BAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,CAIgB,QAAQ,EAAE,WAAW,MAAM,CAAC;EAC/B;EACX,MAAM,cAAc,WAAW,WAAW,KAAA;EAC1C,GAAI;EACJ,CAAA;EAGP;AAED,eAAe,UAAUC,8BAAAA;AACzB,eAAe,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisuallyHidden.cjs","names":["factory","useProps","Box","useStyles","classes"],"sources":["../../../src/components/VisuallyHidden/VisuallyHidden.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './VisuallyHidden.module.css';\n\nexport type VisuallyHiddenStylesNames = 'root';\n\nexport interface VisuallyHiddenProps\n extends BoxProps, StylesApiProps<VisuallyHiddenFactory>, ElementProps<'span'> {}\n\nexport type VisuallyHiddenFactory = Factory<{\n props: VisuallyHiddenProps;\n ref: HTMLSpanElement;\n stylesNames: VisuallyHiddenStylesNames;\n}>;\n\nexport const VisuallyHidden = factory<VisuallyHiddenFactory>((_props) => {\n const props = useProps('VisuallyHidden', null, _props);\n const { classNames, className, style, styles, unstyled, vars, attributes, ...others } = props;\n\n const getStyles = useStyles<VisuallyHiddenFactory>({\n name: 'VisuallyHidden',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n });\n\n return <Box component=\"span\" {...getStyles('root')} {...others} />;\n});\n\nVisuallyHidden.classes = classes;\nVisuallyHidden.displayName = '@mantine/core/VisuallyHidden';\n"],"mappings":";;;;;;;;;AAuBA,MAAa,iBAAiBA,gBAAAA,SAAgC,WAAW;CACvE,MAAM,QAAQC,kBAAAA,SAAS,kBAAkB,MAAM,OAAO;CACtD,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,UAAU,MAAM,YAAY,GAAG,WAAW;AAcxF,QAAO,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EAAK,WAAU;EAAO,GAZXC,mBAAAA,UAAiC;GACjD,MAAM;GACN,SAAA,8BAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,CAEyC,OAAO;EAAE,GAAI;EAAU,CAAA;EAClE;AAEF,eAAe,UAAUC,8BAAAA;AACzB,eAAe,cAAc"}
|
|
1
|
+
{"version":3,"file":"VisuallyHidden.cjs","names":["factory","useProps","Box","useStyles","classes"],"sources":["../../../src/components/VisuallyHidden/VisuallyHidden.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './VisuallyHidden.module.css';\n\nexport type VisuallyHiddenStylesNames = 'root';\n\nexport interface VisuallyHiddenProps\n extends BoxProps, StylesApiProps<VisuallyHiddenFactory>, ElementProps<'span'> {}\n\nexport type VisuallyHiddenFactory = Factory<{\n props: VisuallyHiddenProps;\n ref: HTMLSpanElement;\n stylesNames: VisuallyHiddenStylesNames;\n}>;\n\nexport const VisuallyHidden = factory<VisuallyHiddenFactory>((_props) => {\n const props = useProps('VisuallyHidden', null, _props);\n const { classNames, className, style, styles, unstyled, vars, attributes, ...others } = props;\n\n const getStyles = useStyles<VisuallyHiddenFactory>({\n name: 'VisuallyHidden',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n });\n\n return <Box component=\"span\" {...getStyles('root')} {...others} />;\n});\n\nVisuallyHidden.classes = classes;\nVisuallyHidden.displayName = '@mantine/core/VisuallyHidden';\n\nexport namespace VisuallyHidden {\n export type Props = VisuallyHiddenProps;\n}\n"],"mappings":";;;;;;;;;AAuBA,MAAa,iBAAiBA,gBAAAA,SAAgC,WAAW;CACvE,MAAM,QAAQC,kBAAAA,SAAS,kBAAkB,MAAM,OAAO;CACtD,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,UAAU,MAAM,YAAY,GAAG,WAAW;AAcxF,QAAO,iBAAA,GAAA,kBAAA,KAACC,YAAAA,KAAD;EAAK,WAAU;EAAO,GAZXC,mBAAAA,UAAiC;GACjD,MAAM;GACN,SAAA,8BAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,CAEyC,OAAO;EAAE,GAAI;EAAU,CAAA;EAClE;AAEF,eAAe,UAAUC,8BAAAA;AACzB,eAAe,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage-manager.cjs","names":["isMantineColorScheme"],"sources":["../../../../src/core/MantineProvider/color-scheme-managers/local-storage-manager.ts"],"sourcesContent":["import { isMantineColorScheme } from './is-mantine-color-scheme';\nimport type { MantineColorSchemeManager } from './types';\n\nexport interface LocalStorageColorSchemeManagerOptions {\n /** Local storage key used to retrieve value with `localStorage.getItem(key)`, `mantine-color-scheme-value` by default */\n key?: string;\n}\n\nexport function localStorageColorSchemeManager({\n key = 'mantine-color-scheme-value',\n}: LocalStorageColorSchemeManagerOptions = {}): MantineColorSchemeManager {\n let handleStorageEvent: (event: StorageEvent) => void;\n\n return {\n get: (defaultValue) => {\n if (typeof window === 'undefined') {\n return defaultValue;\n }\n\n try {\n const storedColorScheme = window.localStorage.getItem(key);\n return isMantineColorScheme(storedColorScheme) ? storedColorScheme : defaultValue;\n } catch {\n return defaultValue;\n }\n },\n\n set: (value) => {\n try {\n window.localStorage.setItem(key, value);\n } catch (error) {\n //
|
|
1
|
+
{"version":3,"file":"local-storage-manager.cjs","names":["isMantineColorScheme"],"sources":["../../../../src/core/MantineProvider/color-scheme-managers/local-storage-manager.ts"],"sourcesContent":["import { isMantineColorScheme } from './is-mantine-color-scheme';\nimport type { MantineColorSchemeManager } from './types';\n\nexport interface LocalStorageColorSchemeManagerOptions {\n /** Local storage key used to retrieve value with `localStorage.getItem(key)`, `mantine-color-scheme-value` by default */\n key?: string;\n}\n\nexport function localStorageColorSchemeManager({\n key = 'mantine-color-scheme-value',\n}: LocalStorageColorSchemeManagerOptions = {}): MantineColorSchemeManager {\n let handleStorageEvent: (event: StorageEvent) => void;\n\n return {\n get: (defaultValue) => {\n if (typeof window === 'undefined') {\n return defaultValue;\n }\n\n try {\n const storedColorScheme = window.localStorage.getItem(key);\n return isMantineColorScheme(storedColorScheme) ? storedColorScheme : defaultValue;\n } catch {\n return defaultValue;\n }\n },\n\n set: (value) => {\n try {\n window.localStorage.setItem(key, value);\n } catch (error) {\n // oxlint-disable-next-line no-console\n console.warn(\n '[@mantine/core] Local storage color scheme manager was unable to save color scheme.',\n error\n );\n }\n },\n\n subscribe: (onUpdate) => {\n handleStorageEvent = (event) => {\n if (event.storageArea === window.localStorage && event.key === key) {\n isMantineColorScheme(event.newValue) && onUpdate(event.newValue);\n }\n };\n\n window.addEventListener('storage', handleStorageEvent);\n },\n\n unsubscribe: () => {\n window.removeEventListener('storage', handleStorageEvent);\n },\n\n clear: () => {\n window.localStorage.removeItem(key);\n },\n };\n}\n"],"mappings":";;;AAQA,SAAgB,+BAA+B,EAC7C,MAAM,iCACmC,EAAE,EAA6B;CACxE,IAAI;AAEJ,QAAO;EACL,MAAM,iBAAiB;AACrB,OAAI,OAAO,WAAW,YACpB,QAAO;AAGT,OAAI;IACF,MAAM,oBAAoB,OAAO,aAAa,QAAQ,IAAI;AAC1D,WAAOA,gCAAAA,qBAAqB,kBAAkB,GAAG,oBAAoB;WAC/D;AACN,WAAO;;;EAIX,MAAM,UAAU;AACd,OAAI;AACF,WAAO,aAAa,QAAQ,KAAK,MAAM;YAChC,OAAO;AAEd,YAAQ,KACN,uFACA,MACD;;;EAIL,YAAY,aAAa;AACvB,yBAAsB,UAAU;AAC9B,QAAI,MAAM,gBAAgB,OAAO,gBAAgB,MAAM,QAAQ,IAC7D,iCAAA,qBAAqB,MAAM,SAAS,IAAI,SAAS,MAAM,SAAS;;AAIpE,UAAO,iBAAiB,WAAW,mBAAmB;;EAGxD,mBAAmB;AACjB,UAAO,oBAAoB,WAAW,mBAAmB;;EAG3D,aAAa;AACX,UAAO,aAAa,WAAW,IAAI;;EAEtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-element-ancestor.cjs","names":[],"sources":["../../../../src/core/utils/find-element-ancestor/find-element-ancestor.ts"],"sourcesContent":["/*
|
|
1
|
+
{"version":3,"file":"find-element-ancestor.cjs","names":[],"sources":["../../../../src/core/utils/find-element-ancestor/find-element-ancestor.ts"],"sourcesContent":["/* oxlint-disable no-empty */\nexport function findElementAncestor(element: HTMLElement, selector: string) {\n let _element: HTMLElement | null = element;\n while ((_element = _element.parentElement) && !_element.matches(selector)) {}\n return _element;\n}\n"],"mappings":";;AACA,SAAgB,oBAAoB,SAAsB,UAAkB;CAC1E,IAAI,WAA+B;AACnC,SAAQ,WAAW,SAAS,kBAAkB,CAAC,SAAS,QAAQ,SAAS;AACzE,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.mjs","names":["classes"],"sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n Factory,\n genericFactory,\n getRadius,\n getSafeId,\n MantineRadius,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { AccordionProvider } from './Accordion.context';\nimport { AccordionChevronPosition, AccordionHeadingOrder, AccordionValue } from './Accordion.types';\nimport { AccordionChevron } from './AccordionChevron';\nimport { AccordionControl } from './AccordionControl/AccordionControl';\nimport { AccordionItem } from './AccordionItem/AccordionItem';\nimport { AccordionPanel } from './AccordionPanel/AccordionPanel';\nimport classes from './Accordion.module.css';\
|
|
1
|
+
{"version":3,"file":"Accordion.mjs","names":["classes"],"sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n Factory,\n genericFactory,\n getRadius,\n getSafeId,\n MantineRadius,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { AccordionProvider } from './Accordion.context';\nimport { AccordionChevronPosition, AccordionHeadingOrder, AccordionValue } from './Accordion.types';\nimport { AccordionChevron } from './AccordionChevron';\nimport { AccordionControl, type AccordionControlProps } from './AccordionControl/AccordionControl';\nimport { AccordionItem, type AccordionItemProps } from './AccordionItem/AccordionItem';\nimport { AccordionPanel, type AccordionPanelProps } from './AccordionPanel/AccordionPanel';\nimport classes from './Accordion.module.css';\nimport type { AccordionItemContextValue } from './AccordionItem.context';\nexport type AccordionStylesNames =\n | 'root'\n | 'content'\n | 'item'\n | 'panel'\n | 'icon'\n | 'chevron'\n | 'label'\n | 'itemTitle'\n | 'control';\n\nexport type AccordionVariant = 'default' | 'contained' | 'filled' | 'separated';\nexport type AccordionCssVariables = {\n root: '--accordion-transition-duration' | '--accordion-chevron-size' | '--accordion-radius';\n};\n\nexport interface AccordionProps<Multiple extends boolean = false>\n extends\n BoxProps,\n StylesApiProps<AccordionFactory>,\n ElementProps<'div', 'value' | 'defaultValue' | 'onChange'> {\n /** If set, multiple items can be opened at the same time */\n multiple?: Multiple;\n\n /** Controlled component value */\n value?: AccordionValue<Multiple>;\n\n /** Uncontrolled component default value */\n defaultValue?: AccordionValue<Multiple>;\n\n /** Called when value changes, payload type depends on `multiple` prop */\n onChange?: (value: AccordionValue<Multiple>) => void;\n\n /** If set, arrow keys loop through items (first to last and last to first) @default true */\n loop?: boolean;\n\n /** Transition duration in ms @default 200 */\n transitionDuration?: number;\n\n /** If set, chevron rotation is disabled */\n disableChevronRotation?: boolean;\n\n /** Position of the chevron relative to the item label @default right */\n chevronPosition?: AccordionChevronPosition;\n\n /** Size of the chevron icon container @default auto */\n chevronSize?: number | string;\n\n /** Size of the default chevron icon. Ignored when `chevron` prop is set. Use `chevronSize` instead when using custom chevron. @default 16 */\n chevronIconSize?: number | string;\n\n /** Sets heading level (h2-h6) for `Accordion.Control` elements to meet WAI-ARIA requirements. Has no visual effect. */\n order?: AccordionHeadingOrder;\n\n /** Custom chevron icon */\n chevron?: React.ReactNode;\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius. Numbers are converted to rem. @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** If set to `false`, panels are unmounted when collapsed. By default, panels stay mounted when collapsed. */\n keepMounted?: boolean;\n}\n\nexport type AccordionFactory = Factory<{\n props: AccordionProps;\n ref: HTMLDivElement;\n stylesNames: AccordionStylesNames;\n vars: AccordionCssVariables;\n variant: AccordionVariant;\n signature: <Multiple extends boolean = false>(\n props: AccordionProps<Multiple>\n ) => React.JSX.Element;\n staticComponents: {\n Item: typeof AccordionItem;\n Panel: typeof AccordionPanel;\n Control: typeof AccordionControl;\n Chevron: typeof AccordionChevron;\n };\n}>;\n\nconst defaultProps = {\n multiple: false,\n disableChevronRotation: false,\n chevronPosition: 'right',\n variant: 'default',\n chevronSize: 'auto',\n chevronIconSize: 16,\n} satisfies Partial<AccordionProps>;\n\nconst varsResolver = createVarsResolver<AccordionFactory>(\n (_, { transitionDuration, chevronSize, radius }) => ({\n root: {\n '--accordion-transition-duration':\n transitionDuration === undefined ? undefined : `${transitionDuration}ms`,\n '--accordion-chevron-size': chevronSize === undefined ? undefined : rem(chevronSize),\n '--accordion-radius': radius === undefined ? undefined : getRadius(radius),\n },\n })\n);\n\nexport const Accordion = genericFactory<AccordionFactory>((_props) => {\n const props = useProps('Accordion', defaultProps as any, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n children,\n multiple,\n value,\n defaultValue,\n onChange,\n id,\n loop,\n transitionDuration,\n disableChevronRotation,\n chevronPosition,\n chevronSize,\n order,\n chevron,\n variant,\n radius,\n chevronIconSize,\n attributes,\n keepMounted,\n ...others\n } = props;\n\n const uid = useId(id);\n const [_value, handleChange] = useUncontrolled({\n value,\n defaultValue,\n finalValue: multiple ? ([] as any) : null,\n onChange,\n });\n\n const isItemActive = (itemValue: string) =>\n Array.isArray(_value) ? _value.includes(itemValue) : itemValue === _value;\n\n const handleItemChange = (itemValue: string) => {\n const nextValue = Array.isArray(_value)\n ? _value.includes(itemValue)\n ? _value.filter((selectedValue) => selectedValue !== itemValue)\n : [..._value, itemValue]\n : itemValue === _value\n ? null\n : (itemValue as any);\n\n handleChange(nextValue);\n };\n\n const getStyles = useStyles<AccordionFactory>({\n name: 'Accordion',\n classes,\n props: props as AccordionProps,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <AccordionProvider\n value={{\n isItemActive,\n onChange: handleItemChange,\n getControlId: getSafeId(\n `${uid}-control`,\n 'Accordion.Item component was rendered with invalid value or without value'\n ),\n getRegionId: getSafeId(\n `${uid}-panel`,\n 'Accordion.Item component was rendered with invalid value or without value'\n ),\n chevron: chevron === null ? null : chevron || <AccordionChevron size={chevronIconSize} />,\n transitionDuration,\n disableChevronRotation,\n chevronPosition,\n order,\n loop,\n getStyles,\n variant,\n unstyled,\n keepMounted,\n }}\n >\n <Box {...getStyles('root')} id={uid} {...others} variant={variant} data-accordion>\n {children}\n </Box>\n </AccordionProvider>\n );\n});\n\nAccordion.classes = classes;\nAccordion.varsResolver = varsResolver;\nAccordion.displayName = '@mantine/core/Accordion';\nAccordion.Item = AccordionItem;\nAccordion.Panel = AccordionPanel;\nAccordion.Control = AccordionControl;\nAccordion.Chevron = AccordionChevron;\n\nexport namespace Accordion {\n export type Props = AccordionProps;\n export type StylesNames = AccordionStylesNames;\n export type CssVariables = AccordionCssVariables;\n export type Factory = AccordionFactory;\n export type Variant = AccordionVariant;\n\n export namespace Control {\n export type Props = AccordionControlProps;\n }\n\n export namespace Item {\n export type Props = AccordionItemProps;\n export type Context = AccordionItemContextValue;\n }\n\n export namespace Panel {\n export type Props = AccordionPanelProps;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyGA,MAAM,eAAe;CACnB,UAAU;CACV,wBAAwB;CACxB,iBAAiB;CACjB,SAAS;CACT,aAAa;CACb,iBAAiB;CAClB;AAED,MAAM,eAAe,oBAClB,GAAG,EAAE,oBAAoB,aAAa,cAAc,EACnD,MAAM;CACJ,mCACE,uBAAuB,KAAA,IAAY,KAAA,IAAY,GAAG,mBAAmB;CACvE,4BAA4B,gBAAgB,KAAA,IAAY,KAAA,IAAY,IAAI,YAAY;CACpF,sBAAsB,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,OAAO;CAC3E,EACF,EACF;AAED,MAAa,YAAY,gBAAkC,WAAW;CACpE,MAAM,QAAQ,SAAS,aAAa,cAAqB,OAAO;CAChE,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,UACA,UACA,OACA,cACA,UACA,IACA,MACA,oBACA,wBACA,iBACA,aACA,OACA,SACA,SACA,QACA,iBACA,YACA,aACA,GAAG,WACD;CAEJ,MAAM,MAAM,MAAM,GAAG;CACrB,MAAM,CAAC,QAAQ,gBAAgB,gBAAgB;EAC7C;EACA;EACA,YAAY,WAAY,EAAE,GAAW;EACrC;EACD,CAAC;CAEF,MAAM,gBAAgB,cACpB,MAAM,QAAQ,OAAO,GAAG,OAAO,SAAS,UAAU,GAAG,cAAc;CAErE,MAAM,oBAAoB,cAAsB;AAS9C,eARkB,MAAM,QAAQ,OAAO,GACnC,OAAO,SAAS,UAAU,GACxB,OAAO,QAAQ,kBAAkB,kBAAkB,UAAU,GAC7D,CAAC,GAAG,QAAQ,UAAU,GACxB,cAAc,SACZ,OACC,UAEgB;;CAGzB,MAAM,YAAY,UAA4B;EAC5C,MAAM;EACN,SAAA;EACO;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC,mBAAD;EACE,OAAO;GACL;GACA,UAAU;GACV,cAAc,UACZ,GAAG,IAAI,WACP,4EACD;GACD,aAAa,UACX,GAAG,IAAI,SACP,4EACD;GACD,SAAS,YAAY,OAAO,OAAO,WAAW,oBAAC,kBAAD,EAAkB,MAAM,iBAAmB,CAAA;GACzF;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;YAED,oBAAC,KAAD;GAAK,GAAI,UAAU,OAAO;GAAE,IAAI;GAAK,GAAI;GAAiB;GAAS,kBAAA;GAChE;GACG,CAAA;EACY,CAAA;EAEtB;AAEF,UAAU,UAAUA;AACpB,UAAU,eAAe;AACzB,UAAU,cAAc;AACxB,UAAU,OAAO;AACjB,UAAU,QAAQ;AAClB,UAAU,UAAU;AACpB,UAAU,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.module.mjs","names":[],"sources":["../../../src/components/Accordion/Accordion.module.css"],"sourcesContent":[".root {\n --accordion-radius: var(--mantine-radius-default);\n}\n\n.panel {\n overflow-wrap: break-word;\n}\n\n.content {\n padding: var(--mantine-spacing-md);\n padding-top: calc(var(--mantine-spacing-xs) / 2);\n}\n\n.itemTitle {\n margin: 0;\n padding: 0;\n width: 100%;\n}\n\n.control {\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: row-reverse;\n padding-inline: var(--mantine-spacing-md);\n opacity: 1;\n cursor: pointer;\n background-color: transparent;\n color: var(--mantine-color-bright);\n\n &:where([data-chevron-position='left']) {\n flex-direction: row;\n padding-inline-start: 0;\n }\n\n &:where(:disabled, [data-disabled]) {\n opacity: 0.4;\n cursor: not-allowed;\n }\n}\n\n.control--default,\n.control--contained {\n &:where(:not(:disabled, [data-disabled])) {\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n }\n}\n\n.label {\n color: inherit;\n font-weight: var(--mantine-font-weight-regular);\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: var(--mantine-spacing-sm);\n padding-bottom: var(--mantine-spacing-sm);\n}\n\n.chevron {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n transition: transform var(--accordion-transition-duration, 200ms) ease;\n width: var(--accordion-chevron-size, rem(15px));\n min-width: var(--accordion-chevron-size, rem(15px));\n transform: rotate(0deg);\n\n &:where([data-rotate]) {\n transform: rotate(180deg);\n }\n\n &:where([data-position='left']) {\n margin-inline-end: var(--mantine-spacing-md);\n margin-inline-start: var(--mantine-spacing-md);\n }\n}\n\n.icon {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-inline-end: var(--mantine-spacing-sm);\n\n &:where([data-chevron-position='left']) {\n margin-inline-end: 0;\n margin-inline-start: var(--mantine-spacing-lg);\n }\n}\n\n.item {\n
|
|
1
|
+
{"version":3,"file":"Accordion.module.mjs","names":[],"sources":["../../../src/components/Accordion/Accordion.module.css"],"sourcesContent":[".root {\n --accordion-radius: var(--mantine-radius-default);\n}\n\n.panel {\n overflow-wrap: break-word;\n}\n\n.content {\n padding: var(--mantine-spacing-md);\n padding-top: calc(var(--mantine-spacing-xs) / 2);\n}\n\n.itemTitle {\n margin: 0;\n padding: 0;\n width: 100%;\n}\n\n.control {\n width: 100%;\n display: flex;\n align-items: center;\n flex-direction: row-reverse;\n padding-inline: var(--mantine-spacing-md);\n opacity: 1;\n cursor: pointer;\n background-color: transparent;\n color: var(--mantine-color-bright);\n\n &:where([data-chevron-position='left']) {\n flex-direction: row;\n padding-inline-start: 0;\n }\n\n &:where(:disabled, [data-disabled]) {\n opacity: 0.4;\n cursor: not-allowed;\n }\n}\n\n.control--default,\n.control--contained {\n &:where(:not(:disabled, [data-disabled])) {\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n }\n}\n\n.label {\n color: inherit;\n font-weight: var(--mantine-font-weight-regular);\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: var(--mantine-spacing-sm);\n padding-bottom: var(--mantine-spacing-sm);\n}\n\n.chevron {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n transition: transform var(--accordion-transition-duration, 200ms) ease;\n width: var(--accordion-chevron-size, rem(15px));\n min-width: var(--accordion-chevron-size, rem(15px));\n transform: rotate(0deg);\n\n &:where([data-rotate]) {\n transform: rotate(180deg);\n }\n\n &:where([data-position='left']) {\n margin-inline-end: var(--mantine-spacing-md);\n margin-inline-start: var(--mantine-spacing-md);\n }\n}\n\n.icon {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-inline-end: var(--mantine-spacing-sm);\n\n &:where([data-chevron-position='left']) {\n margin-inline-end: 0;\n margin-inline-start: var(--mantine-spacing-lg);\n }\n}\n\n.item {\n @mixin where-light {\n --item-border-color: var(--mantine-color-gray-3);\n --item-filled-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --item-border-color: var(--mantine-color-dark-4);\n --item-filled-color: var(--mantine-color-dark-6);\n }\n}\n\n.item--default {\n border-bottom: 1px solid var(--item-border-color);\n}\n\n.item--contained {\n border: 1px solid var(--item-border-color);\n transition: background-color 150ms ease;\n\n &:where([data-active]) {\n background-color: var(--item-filled-color);\n }\n\n &:first-of-type {\n border-start-start-radius: var(--accordion-radius);\n border-start-end-radius: var(--accordion-radius);\n\n & > [data-accordion-control] {\n border-start-start-radius: var(--accordion-radius);\n border-start-end-radius: var(--accordion-radius);\n }\n }\n\n &:last-of-type {\n border-end-start-radius: var(--accordion-radius);\n border-end-end-radius: var(--accordion-radius);\n\n & > [data-accordion-control] {\n border-end-start-radius: var(--accordion-radius);\n border-end-end-radius: var(--accordion-radius);\n }\n }\n\n & + & {\n border-top: 0;\n }\n}\n\n.item--filled {\n border-radius: var(--accordion-radius);\n\n &:where([data-active]) {\n background-color: var(--item-filled-color);\n }\n}\n\n.item--separated {\n background-color: var(--item-filled-color);\n border-radius: var(--accordion-radius);\n border: 1px solid transparent;\n transition: background-color 150ms ease;\n\n &[data-active] {\n border-color: var(--item-border-color);\n\n @mixin where-light {\n background-color: var(--mantine-color-white);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-7);\n }\n }\n\n & + & {\n margin-top: var(--mantine-spacing-md);\n }\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionIcon.mjs","names":["classes"],"sources":["../../../src/components/ActionIcon/ActionIcon.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n getRadius,\n getSize,\n MantineColor,\n MantineGradient,\n MantineRadius,\n MantineSize,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { Loader, LoaderProps } from '../Loader';\nimport { Transition } from '../Transition';\nimport { UnstyledButton } from '../UnstyledButton';\nimport {
|
|
1
|
+
{"version":3,"file":"ActionIcon.mjs","names":["classes"],"sources":["../../../src/components/ActionIcon/ActionIcon.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n getRadius,\n getSize,\n MantineColor,\n MantineGradient,\n MantineRadius,\n MantineSize,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { Loader, LoaderProps } from '../Loader';\nimport { Transition } from '../Transition';\nimport { UnstyledButton } from '../UnstyledButton';\nimport {\n ActionIconGroup,\n type ActionIconGroupProps,\n type ActionIconGroupStylesNames,\n type ActionIconGroupCssVariables,\n type ActionIconGroupFactory,\n} from './ActionIconGroup/ActionIconGroup';\nimport {\n ActionIconGroupSection,\n type ActionIconGroupSectionProps,\n type ActionIconGroupSectionStylesNames,\n type ActionIconGroupSectionCssVariables,\n type ActionIconGroupSectionFactory,\n} from './ActionIconGroupSection/ActionIconGroupSection';\nimport classes from './ActionIcon.module.css';\nexport type ActionIconVariant =\n | 'filled'\n | 'light'\n | 'outline'\n | 'transparent'\n | 'white'\n | 'subtle'\n | 'default'\n | 'gradient';\n\nexport type ActionIconStylesNames = 'root' | 'loader' | 'icon';\nexport type ActionIconCssVariables = {\n root:\n | '--ai-radius'\n | '--ai-size'\n | '--ai-bg'\n | '--ai-hover'\n | '--ai-hover-color'\n | '--ai-color'\n | '--ai-bd';\n};\n\nexport interface ActionIconProps extends BoxProps, StylesApiProps<ActionIconFactory> {\n 'data-disabled'?: boolean;\n __staticSelector?: string;\n\n /** If set, `Loader` component is displayed instead of the `children` */\n loading?: boolean;\n\n /** Props passed down to the `Loader` component. Ignored when `loading` prop is not set. */\n loaderProps?: LoaderProps;\n\n /** Controls width and height of the button. Numbers are converted to rem. @default 'md'. */\n size?: MantineSize | `input-${MantineSize}` | (string & {}) | number;\n\n /** Key of `theme.colors` or any valid CSS color. @default theme.primaryColor. */\n color?: MantineColor;\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius. Numbers are converted to rem. @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Gradient values used with `variant=\"gradient\"`. @default theme.defaultGradient. */\n gradient?: MantineGradient;\n\n /** Sets `disabled` attribute, prevents interactions */\n disabled?: boolean;\n\n /** Icon element */\n children?: React.ReactNode;\n\n /** If set, adjusts text color based on background color for `filled` variant */\n autoContrast?: boolean;\n}\n\nexport type ActionIconFactory = PolymorphicFactory<{\n props: ActionIconProps;\n defaultComponent: 'button';\n defaultRef: HTMLButtonElement;\n stylesNames: ActionIconStylesNames;\n variant: ActionIconVariant;\n vars: ActionIconCssVariables;\n staticComponents: {\n Group: typeof ActionIconGroup;\n GroupSection: typeof ActionIconGroupSection;\n };\n}>;\n\nconst varsResolver = createVarsResolver<ActionIconFactory>(\n (theme, { size, radius, variant, gradient, color, autoContrast }) => {\n const colors = theme.variantColorResolver({\n color: color || theme.primaryColor,\n theme,\n gradient,\n variant: variant || 'filled',\n autoContrast,\n });\n\n return {\n root: {\n '--ai-size': getSize(size, 'ai-size'),\n '--ai-radius': radius === undefined ? undefined : getRadius(radius),\n '--ai-bg': color || variant ? colors.background : undefined,\n '--ai-hover': color || variant ? colors.hover : undefined,\n '--ai-hover-color': color || variant ? colors.hoverColor : undefined,\n '--ai-color': colors.color,\n '--ai-bd': color || variant ? colors.border : undefined,\n },\n };\n }\n);\n\nexport const ActionIcon = polymorphicFactory<ActionIconFactory>((_props) => {\n const props = useProps('ActionIcon', null, _props);\n const {\n className,\n unstyled,\n variant,\n classNames,\n styles,\n style,\n loading,\n loaderProps,\n size,\n color,\n radius,\n __staticSelector,\n gradient,\n vars,\n children,\n disabled,\n 'data-disabled': dataDisabled,\n autoContrast,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<ActionIconFactory>({\n name: ['ActionIcon', __staticSelector],\n props,\n className,\n style,\n classes,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <UnstyledButton\n {...getStyles('root', { active: !disabled && !loading && !dataDisabled })}\n {...others}\n unstyled={unstyled}\n variant={variant}\n size={size}\n disabled={disabled || loading}\n mod={[{ loading, disabled: disabled || dataDisabled }, mod]}\n >\n {typeof loading === 'boolean' && (\n <Transition mounted={loading} transition=\"slide-down\" duration={150}>\n {(transitionStyles) => (\n <Box component=\"span\" {...getStyles('loader', { style: transitionStyles })} aria-hidden>\n <Loader color=\"var(--ai-color)\" size=\"calc(var(--ai-size) * 0.55)\" {...loaderProps} />\n </Box>\n )}\n </Transition>\n )}\n\n <Box component=\"span\" mod={{ loading }} {...getStyles('icon')}>\n {children}\n </Box>\n </UnstyledButton>\n );\n});\n\nActionIcon.classes = classes;\nActionIcon.varsResolver = varsResolver;\nActionIcon.displayName = '@mantine/core/ActionIcon';\nActionIcon.Group = ActionIconGroup;\nActionIcon.GroupSection = ActionIconGroupSection;\n\nexport namespace ActionIcon {\n export type Props = ActionIconProps;\n export type StylesNames = ActionIconStylesNames;\n export type CssVariables = ActionIconCssVariables;\n export type Factory = ActionIconFactory;\n\n export namespace Group {\n export type Props = ActionIconGroupProps;\n export type StylesNames = ActionIconGroupStylesNames;\n export type CssVariables = ActionIconGroupCssVariables;\n export type Factory = ActionIconGroupFactory;\n }\n\n export namespace GroupSection {\n export type Props = ActionIconGroupSectionProps;\n export type StylesNames = ActionIconGroupSectionStylesNames;\n export type CssVariables = ActionIconGroupSectionCssVariables;\n export type Factory = ActionIconGroupSectionFactory;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqGA,MAAM,eAAe,oBAClB,OAAO,EAAE,MAAM,QAAQ,SAAS,UAAU,OAAO,mBAAmB;CACnE,MAAM,SAAS,MAAM,qBAAqB;EACxC,OAAO,SAAS,MAAM;EACtB;EACA;EACA,SAAS,WAAW;EACpB;EACD,CAAC;AAEF,QAAO,EACL,MAAM;EACJ,aAAa,QAAQ,MAAM,UAAU;EACrC,eAAe,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,OAAO;EACnE,WAAW,SAAS,UAAU,OAAO,aAAa,KAAA;EAClD,cAAc,SAAS,UAAU,OAAO,QAAQ,KAAA;EAChD,oBAAoB,SAAS,UAAU,OAAO,aAAa,KAAA;EAC3D,cAAc,OAAO;EACrB,WAAW,SAAS,UAAU,OAAO,SAAS,KAAA;EAC/C,EACF;EAEJ;AAED,MAAa,aAAa,oBAAuC,WAAW;CAC1E,MAAM,QAAQ,SAAS,cAAc,MAAM,OAAO;CAClD,MAAM,EACJ,WACA,UACA,SACA,YACA,QACA,OACA,SACA,aACA,MACA,OACA,QACA,kBACA,UACA,MACA,UACA,UACA,iBAAiB,cACjB,cACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAA6B;EAC7C,MAAM,CAAC,cAAc,iBAAiB;EACtC;EACA;EACA;EACA,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,qBAAC,gBAAD;EACE,GAAI,UAAU,QAAQ,EAAE,QAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,cAAc,CAAC;EACzE,GAAI;EACM;EACD;EACH;EACN,UAAU,YAAY;EACtB,KAAK,CAAC;GAAE;GAAS,UAAU,YAAY;GAAc,EAAE,IAAI;YAP7D,CASG,OAAO,YAAY,aAClB,oBAAC,YAAD;GAAY,SAAS;GAAS,YAAW;GAAa,UAAU;cAC5D,qBACA,oBAAC,KAAD;IAAK,WAAU;IAAO,GAAI,UAAU,UAAU,EAAE,OAAO,kBAAkB,CAAC;IAAE,eAAA;cAC1E,oBAAC,QAAD;KAAQ,OAAM;KAAkB,MAAK;KAA8B,GAAI;KAAe,CAAA;IAClF,CAAA;GAEG,CAAA,EAGf,oBAAC,KAAD;GAAK,WAAU;GAAO,KAAK,EAAE,SAAS;GAAE,GAAI,UAAU,OAAO;GAC1D;GACG,CAAA,CACS;;EAEnB;AAEF,WAAW,UAAUA;AACrB,WAAW,eAAe;AAC1B,WAAW,cAAc;AACzB,WAAW,QAAQ;AACnB,WAAW,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Affix.mjs","names":["classes"],"sources":["../../../src/components/Affix/Affix.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getDefaultZIndex,\n getSpacing,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { BasePortalProps, OptionalPortal } from '../Portal';\nimport classes from './Affix.module.css';\n\nexport type AffixStylesNames = 'root';\nexport type AffixCssVariables = {\n root: '--affix-z-index' | '--affix-top' | '--affix-left' | '--affix-bottom' | '--affix-right';\n};\n\nexport interface AffixPosition {\n top?: MantineSize | (string & {}) | number;\n left?: MantineSize | (string & {}) | number;\n bottom?: MantineSize | (string & {}) | number;\n right?: MantineSize | (string & {}) | number;\n}\n\nexport interface AffixBaseProps {\n /** Root element `z-index` property @default 200 */\n zIndex?: React.CSSProperties['zIndex'];\n\n /** Determines whether the component is rendered within `Portal` @default true */\n withinPortal?: boolean;\n\n /** Props passed down to the `Portal` component. Ignored when `withinPortal` is `false`. */\n portalProps?: BasePortalProps;\n\n /** Affix position on screen @default { bottom: 0, right: 0 } */\n position?: AffixPosition;\n}\n\nexport interface AffixProps\n extends BoxProps, AffixBaseProps, StylesApiProps<AffixFactory>, ElementProps<'div'> {}\n\nexport type AffixFactory = Factory<{\n props: AffixProps;\n ref: HTMLDivElement;\n stylesNames: AffixStylesNames;\n vars: AffixCssVariables;\n}>;\n\nconst defaultProps = {\n position: { bottom: 0, right: 0 },\n zIndex: getDefaultZIndex('modal'),\n withinPortal: true,\n} satisfies Partial<AffixProps>;\n\nconst varsResolver = createVarsResolver<AffixFactory>((_, { zIndex, position }) => ({\n root: {\n '--affix-z-index': zIndex?.toString(),\n '--affix-top': getSpacing(position?.top),\n '--affix-left': getSpacing(position?.left),\n '--affix-bottom': getSpacing(position?.bottom),\n '--affix-right': getSpacing(position?.right),\n },\n}));\n\nexport const Affix = factory<AffixFactory>((_props) => {\n const props = useProps('Affix', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n portalProps,\n zIndex,\n withinPortal,\n position,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<AffixFactory>({\n name: 'Affix',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <Box {...getStyles('root')} {...others} />\n </OptionalPortal>\n );\n});\n\nAffix.classes = classes;\nAffix.varsResolver = varsResolver;\nAffix.displayName = '@mantine/core/Affix';\n"],"mappings":";;;;;;;;;;;;AAqDA,MAAM,eAAe;CACnB,UAAU;EAAE,QAAQ;EAAG,OAAO;EAAG;CACjC,QAAQ,iBAAiB,QAAQ;CACjC,cAAc;CACf;AAED,MAAM,eAAe,oBAAkC,GAAG,EAAE,QAAQ,gBAAgB,EAClF,MAAM;CACJ,mBAAmB,QAAQ,UAAU;CACrC,eAAe,WAAW,UAAU,IAAI;CACxC,gBAAgB,WAAW,UAAU,KAAK;CAC1C,kBAAkB,WAAW,UAAU,OAAO;CAC9C,iBAAiB,WAAW,UAAU,MAAM;CAC7C,EACF,EAAE;AAEH,MAAa,QAAQ,SAAuB,WAAW;CACrD,MAAM,QAAQ,SAAS,SAAS,cAAc,OAAO;CACrD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,aACA,QACA,cACA,UACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAAwB;EACxC,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC,gBAAD;EAAgB,GAAI;EAA2B;YAC7C,oBAAC,KAAD;GAAK,GAAI,UAAU,OAAO;GAAE,GAAI;GAAU,CAAA;EAC3B,CAAA;EAEnB;AAEF,MAAM,UAAUA;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc"}
|
|
1
|
+
{"version":3,"file":"Affix.mjs","names":["classes"],"sources":["../../../src/components/Affix/Affix.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getDefaultZIndex,\n getSpacing,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { BasePortalProps, OptionalPortal } from '../Portal';\nimport classes from './Affix.module.css';\n\nexport type AffixStylesNames = 'root';\nexport type AffixCssVariables = {\n root: '--affix-z-index' | '--affix-top' | '--affix-left' | '--affix-bottom' | '--affix-right';\n};\n\nexport interface AffixPosition {\n top?: MantineSize | (string & {}) | number;\n left?: MantineSize | (string & {}) | number;\n bottom?: MantineSize | (string & {}) | number;\n right?: MantineSize | (string & {}) | number;\n}\n\nexport interface AffixBaseProps {\n /** Root element `z-index` property @default 200 */\n zIndex?: React.CSSProperties['zIndex'];\n\n /** Determines whether the component is rendered within `Portal` @default true */\n withinPortal?: boolean;\n\n /** Props passed down to the `Portal` component. Ignored when `withinPortal` is `false`. */\n portalProps?: BasePortalProps;\n\n /** Affix position on screen @default { bottom: 0, right: 0 } */\n position?: AffixPosition;\n}\n\nexport interface AffixProps\n extends BoxProps, AffixBaseProps, StylesApiProps<AffixFactory>, ElementProps<'div'> {}\n\nexport type AffixFactory = Factory<{\n props: AffixProps;\n ref: HTMLDivElement;\n stylesNames: AffixStylesNames;\n vars: AffixCssVariables;\n}>;\n\nconst defaultProps = {\n position: { bottom: 0, right: 0 },\n zIndex: getDefaultZIndex('modal'),\n withinPortal: true,\n} satisfies Partial<AffixProps>;\n\nconst varsResolver = createVarsResolver<AffixFactory>((_, { zIndex, position }) => ({\n root: {\n '--affix-z-index': zIndex?.toString(),\n '--affix-top': getSpacing(position?.top),\n '--affix-left': getSpacing(position?.left),\n '--affix-bottom': getSpacing(position?.bottom),\n '--affix-right': getSpacing(position?.right),\n },\n}));\n\nexport const Affix = factory<AffixFactory>((_props) => {\n const props = useProps('Affix', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n portalProps,\n zIndex,\n withinPortal,\n position,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<AffixFactory>({\n name: 'Affix',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return (\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <Box {...getStyles('root')} {...others} />\n </OptionalPortal>\n );\n});\n\nAffix.classes = classes;\nAffix.varsResolver = varsResolver;\nAffix.displayName = '@mantine/core/Affix';\n\nexport namespace Affix {\n export type Props = AffixProps;\n export type StylesNames = AffixStylesNames;\n export type CssVariables = AffixCssVariables;\n export type Factory = AffixFactory;\n}\n"],"mappings":";;;;;;;;;;;;AAqDA,MAAM,eAAe;CACnB,UAAU;EAAE,QAAQ;EAAG,OAAO;EAAG;CACjC,QAAQ,iBAAiB,QAAQ;CACjC,cAAc;CACf;AAED,MAAM,eAAe,oBAAkC,GAAG,EAAE,QAAQ,gBAAgB,EAClF,MAAM;CACJ,mBAAmB,QAAQ,UAAU;CACrC,eAAe,WAAW,UAAU,IAAI;CACxC,gBAAgB,WAAW,UAAU,KAAK;CAC1C,kBAAkB,WAAW,UAAU,OAAO;CAC9C,iBAAiB,WAAW,UAAU,MAAM;CAC7C,EACF,EAAE;AAEH,MAAa,QAAQ,SAAuB,WAAW;CACrD,MAAM,QAAQ,SAAS,SAAS,cAAc,OAAO;CACrD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,aACA,QACA,cACA,UACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAAwB;EACxC,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC,gBAAD;EAAgB,GAAI;EAA2B;YAC7C,oBAAC,KAAD;GAAK,GAAI,UAAU,OAAO;GAAE,GAAI;GAAU,CAAA;EAC3B,CAAA;EAEnB;AAEF,MAAM,UAAUA;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.mjs","names":["classes"],"sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { useId } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineColor,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { CloseButton } from '../CloseButton';\nimport classes from './Alert.module.css';\n\nexport type AlertStylesNames =\n | 'root'\n | 'body'\n | 'label'\n | 'title'\n | 'icon'\n | 'wrapper'\n | 'message'\n | 'closeButton';\nexport type AlertVariant = 'filled' | 'light' | 'outline' | 'default' | 'transparent' | 'white';\nexport type AlertCssVariables = {\n root: '--alert-radius' | '--alert-bg' | '--alert-color' | '--alert-bd';\n};\n\nexport interface AlertProps\n extends BoxProps, StylesApiProps<AlertFactory>, ElementProps<'div', 'title'> {\n /** Key of `theme.radius` or any valid CSS value to set border-radius @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Key of `theme.colors` or any valid CSS color @default theme.primaryColor */\n color?: MantineColor;\n\n /** Alert title */\n title?: React.ReactNode;\n\n /** Icon displayed next to the title */\n icon?: React.ReactNode;\n\n /** Determines whether close button should be displayed @default false */\n withCloseButton?: boolean;\n\n /** Called when the close button is clicked */\n onClose?: () => void;\n\n /** Close button `aria-label` */\n closeButtonLabel?: string;\n\n /** If set, adjusts text color based on background color for `filled` variant */\n autoContrast?: boolean;\n}\n\nexport type AlertFactory = Factory<{\n props: AlertProps;\n ref: HTMLDivElement;\n stylesNames: AlertStylesNames;\n vars: AlertCssVariables;\n variant: AlertVariant;\n}>;\n\nconst varsResolver = createVarsResolver<AlertFactory>(\n (theme, { radius, color, variant, autoContrast }) => {\n const colors = theme.variantColorResolver({\n color: color || theme.primaryColor,\n theme,\n variant: variant || 'light',\n autoContrast,\n });\n\n return {\n root: {\n '--alert-radius': radius === undefined ? undefined : getRadius(radius),\n '--alert-bg': color || variant ? colors.background : undefined,\n '--alert-color': colors.color,\n '--alert-bd': color || variant ? colors.border : undefined,\n },\n };\n }\n);\n\nexport const Alert = factory<AlertFactory>((_props) => {\n const props = useProps('Alert', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n radius,\n color,\n title,\n children,\n id,\n icon,\n withCloseButton,\n onClose,\n closeButtonLabel,\n variant,\n autoContrast,\n role,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<AlertFactory>({\n name: 'Alert',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const rootId = useId(id);\n const titleId = (title && `${rootId}-title`) || undefined;\n const bodyId = `${rootId}-body`;\n\n return (\n <Box\n id={rootId}\n {...getStyles('root', { variant })}\n variant={variant}\n {...others}\n role={role || 'alert'}\n aria-describedby={children ? bodyId : undefined}\n aria-labelledby={title ? titleId : undefined}\n >\n <div {...getStyles('wrapper')}>\n {icon && <div {...getStyles('icon')}>{icon}</div>}\n\n <div {...getStyles('body')}>\n {title && (\n <div {...getStyles('title')} data-with-close-button={withCloseButton || undefined}>\n <span id={titleId} {...getStyles('label')}>\n {title}\n </span>\n </div>\n )}\n\n {children && (\n <div id={bodyId} {...getStyles('message')} data-variant={variant}>\n {children}\n </div>\n )}\n </div>\n\n {withCloseButton && (\n <CloseButton\n {...getStyles('closeButton')}\n onClick={onClose}\n variant=\"transparent\"\n size={16}\n iconSize={16}\n aria-label={closeButtonLabel}\n unstyled={unstyled}\n />\n )}\n </div>\n </Box>\n );\n});\n\nAlert.classes = classes;\nAlert.varsResolver = varsResolver;\nAlert.displayName = '@mantine/core/Alert';\n"],"mappings":";;;;;;;;;;;;AAmEA,MAAM,eAAe,oBAClB,OAAO,EAAE,QAAQ,OAAO,SAAS,mBAAmB;CACnD,MAAM,SAAS,MAAM,qBAAqB;EACxC,OAAO,SAAS,MAAM;EACtB;EACA,SAAS,WAAW;EACpB;EACD,CAAC;AAEF,QAAO,EACL,MAAM;EACJ,kBAAkB,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,OAAO;EACtE,cAAc,SAAS,UAAU,OAAO,aAAa,KAAA;EACrD,iBAAiB,OAAO;EACxB,cAAc,SAAS,UAAU,OAAO,SAAS,KAAA;EAClD,EACF;EAEJ;AAED,MAAa,QAAQ,SAAuB,WAAW;CACrD,MAAM,QAAQ,SAAS,SAAS,MAAM,OAAO;CAC7C,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,QACA,OACA,OACA,UACA,IACA,MACA,iBACA,SACA,kBACA,SACA,cACA,MACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAAwB;EACxC,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,SAAS,MAAM,GAAG;CACxB,MAAM,UAAW,SAAS,GAAG,OAAO,WAAY,KAAA;CAChD,MAAM,SAAS,GAAG,OAAO;AAEzB,QACE,oBAAC,KAAD;EACE,IAAI;EACJ,GAAI,UAAU,QAAQ,EAAE,SAAS,CAAC;EACzB;EACT,GAAI;EACJ,MAAM,QAAQ;EACd,oBAAkB,WAAW,SAAS,KAAA;EACtC,mBAAiB,QAAQ,UAAU,KAAA;YAEnC,qBAAC,OAAD;GAAK,GAAI,UAAU,UAAU;aAA7B;IACG,QAAQ,oBAAC,OAAD;KAAK,GAAI,UAAU,OAAO;eAAG;KAAW,CAAA;IAEjD,qBAAC,OAAD;KAAK,GAAI,UAAU,OAAO;eAA1B,CACG,SACC,oBAAC,OAAD;MAAK,GAAI,UAAU,QAAQ;MAAE,0BAAwB,mBAAmB,KAAA;gBACtE,oBAAC,QAAD;OAAM,IAAI;OAAS,GAAI,UAAU,QAAQ;iBACtC;OACI,CAAA;MACH,CAAA,EAGP,YACC,oBAAC,OAAD;MAAK,IAAI;MAAQ,GAAI,UAAU,UAAU;MAAE,gBAAc;MACtD;MACG,CAAA,CAEJ;;IAEL,mBACC,oBAAC,aAAD;KACE,GAAI,UAAU,cAAc;KAC5B,SAAS;KACT,SAAQ;KACR,MAAM;KACN,UAAU;KACV,cAAY;KACF;KACV,CAAA;IAEA;;EACF,CAAA;EAER;AAEF,MAAM,UAAUA;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc"}
|
|
1
|
+
{"version":3,"file":"Alert.mjs","names":["classes"],"sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { useId } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineColor,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { CloseButton } from '../CloseButton';\nimport classes from './Alert.module.css';\n\nexport type AlertStylesNames =\n | 'root'\n | 'body'\n | 'label'\n | 'title'\n | 'icon'\n | 'wrapper'\n | 'message'\n | 'closeButton';\nexport type AlertVariant = 'filled' | 'light' | 'outline' | 'default' | 'transparent' | 'white';\nexport type AlertCssVariables = {\n root: '--alert-radius' | '--alert-bg' | '--alert-color' | '--alert-bd';\n};\n\nexport interface AlertProps\n extends BoxProps, StylesApiProps<AlertFactory>, ElementProps<'div', 'title'> {\n /** Key of `theme.radius` or any valid CSS value to set border-radius @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** Key of `theme.colors` or any valid CSS color @default theme.primaryColor */\n color?: MantineColor;\n\n /** Alert title */\n title?: React.ReactNode;\n\n /** Icon displayed next to the title */\n icon?: React.ReactNode;\n\n /** Determines whether close button should be displayed @default false */\n withCloseButton?: boolean;\n\n /** Called when the close button is clicked */\n onClose?: () => void;\n\n /** Close button `aria-label` */\n closeButtonLabel?: string;\n\n /** If set, adjusts text color based on background color for `filled` variant */\n autoContrast?: boolean;\n}\n\nexport type AlertFactory = Factory<{\n props: AlertProps;\n ref: HTMLDivElement;\n stylesNames: AlertStylesNames;\n vars: AlertCssVariables;\n variant: AlertVariant;\n}>;\n\nconst varsResolver = createVarsResolver<AlertFactory>(\n (theme, { radius, color, variant, autoContrast }) => {\n const colors = theme.variantColorResolver({\n color: color || theme.primaryColor,\n theme,\n variant: variant || 'light',\n autoContrast,\n });\n\n return {\n root: {\n '--alert-radius': radius === undefined ? undefined : getRadius(radius),\n '--alert-bg': color || variant ? colors.background : undefined,\n '--alert-color': colors.color,\n '--alert-bd': color || variant ? colors.border : undefined,\n },\n };\n }\n);\n\nexport const Alert = factory<AlertFactory>((_props) => {\n const props = useProps('Alert', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n radius,\n color,\n title,\n children,\n id,\n icon,\n withCloseButton,\n onClose,\n closeButtonLabel,\n variant,\n autoContrast,\n role,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<AlertFactory>({\n name: 'Alert',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const rootId = useId(id);\n const titleId = (title && `${rootId}-title`) || undefined;\n const bodyId = `${rootId}-body`;\n\n return (\n <Box\n id={rootId}\n {...getStyles('root', { variant })}\n variant={variant}\n {...others}\n role={role || 'alert'}\n aria-describedby={children ? bodyId : undefined}\n aria-labelledby={title ? titleId : undefined}\n >\n <div {...getStyles('wrapper')}>\n {icon && <div {...getStyles('icon')}>{icon}</div>}\n\n <div {...getStyles('body')}>\n {title && (\n <div {...getStyles('title')} data-with-close-button={withCloseButton || undefined}>\n <span id={titleId} {...getStyles('label')}>\n {title}\n </span>\n </div>\n )}\n\n {children && (\n <div id={bodyId} {...getStyles('message')} data-variant={variant}>\n {children}\n </div>\n )}\n </div>\n\n {withCloseButton && (\n <CloseButton\n {...getStyles('closeButton')}\n onClick={onClose}\n variant=\"transparent\"\n size={16}\n iconSize={16}\n aria-label={closeButtonLabel}\n unstyled={unstyled}\n />\n )}\n </div>\n </Box>\n );\n});\n\nAlert.classes = classes;\nAlert.varsResolver = varsResolver;\nAlert.displayName = '@mantine/core/Alert';\n\nexport namespace Alert {\n export type Props = AlertProps;\n export type StylesNames = AlertStylesNames;\n export type CssVariables = AlertCssVariables;\n export type Factory = AlertFactory;\n}\n"],"mappings":";;;;;;;;;;;;AAmEA,MAAM,eAAe,oBAClB,OAAO,EAAE,QAAQ,OAAO,SAAS,mBAAmB;CACnD,MAAM,SAAS,MAAM,qBAAqB;EACxC,OAAO,SAAS,MAAM;EACtB;EACA,SAAS,WAAW;EACpB;EACD,CAAC;AAEF,QAAO,EACL,MAAM;EACJ,kBAAkB,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,OAAO;EACtE,cAAc,SAAS,UAAU,OAAO,aAAa,KAAA;EACrD,iBAAiB,OAAO;EACxB,cAA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UAAUA;AAChB,MAAM,eAAe;AACrB,MAAM,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Anchor.mjs","names":["classes"],"sources":["../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import cx from 'clsx';\nimport { polymorphicFactory, PolymorphicFactory, useProps } from '../../core';\nimport { Text, TextCssVariables, TextProps, TextStylesNames, TextVariant } from '../Text';\nimport classes from './Anchor.module.css';\n\nexport type AnchorStylesNames = TextStylesNames;\nexport type AnchorVariant = TextVariant;\nexport type AnchorCssVariables = TextCssVariables;\n\nexport interface AnchorProps extends Omit<TextProps, 'span'> {\n /** Defines when `text-decoration: underline` styles are applied. @default hover */\n underline?: 'always' | 'hover' | 'not-hover' | 'never';\n}\n\nexport type AnchorFactory = PolymorphicFactory<{\n props: AnchorProps;\n defaultComponent: 'a';\n defaultRef: HTMLAnchorElement;\n stylesNames: AnchorStylesNames;\n vars: AnchorCssVariables;\n variant: AnchorVariant;\n}>;\n\nconst defaultProps = {\n underline: 'hover',\n} satisfies Partial<AnchorProps>;\n\nexport const Anchor = polymorphicFactory<AnchorFactory>((props) => {\n const { underline, className, unstyled, mod, ...others } = useProps(\n 'Anchor',\n defaultProps,\n props\n );\n\n return (\n <Text\n component=\"a\"\n className={cx({ [classes.root]: !unstyled }, className)}\n {...others}\n mod={[{ underline }, mod]}\n __staticSelector=\"Anchor\"\n unstyled={unstyled}\n />\n );\n});\n\nAnchor.classes = classes;\nAnchor.displayName = '@mantine/core/Anchor';\n"],"mappings":";;;;;;;;AAuBA,MAAM,eAAe,EACnB,WAAW,SACZ;AAED,MAAa,SAAS,oBAAmC,UAAU;CACjE,MAAM,EAAE,WAAW,WAAW,UAAU,KAAK,GAAG,WAAW,SACzD,UACA,cACA,MACD;AAED,QACE,oBAAC,MAAD;EACE,WAAU;EACV,WAAW,GAAG,GAAGA,sBAAQ,OAAO,CAAC,UAAU,EAAE,UAAU;EACvD,GAAI;EACJ,KAAK,CAAC,EAAE,WAAW,EAAE,IAAI;EACzB,kBAAiB;EACP;EACV,CAAA;EAEJ;AAEF,OAAO,UAAUA;AACjB,OAAO,cAAc"}
|
|
1
|
+
{"version":3,"file":"Anchor.mjs","names":["classes"],"sources":["../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import cx from 'clsx';\nimport { polymorphicFactory, PolymorphicFactory, useProps } from '../../core';\nimport { Text, TextCssVariables, TextProps, TextStylesNames, TextVariant } from '../Text';\nimport classes from './Anchor.module.css';\n\nexport type AnchorStylesNames = TextStylesNames;\nexport type AnchorVariant = TextVariant;\nexport type AnchorCssVariables = TextCssVariables;\n\nexport interface AnchorProps extends Omit<TextProps, 'span'> {\n /** Defines when `text-decoration: underline` styles are applied. @default hover */\n underline?: 'always' | 'hover' | 'not-hover' | 'never';\n}\n\nexport type AnchorFactory = PolymorphicFactory<{\n props: AnchorProps;\n defaultComponent: 'a';\n defaultRef: HTMLAnchorElement;\n stylesNames: AnchorStylesNames;\n vars: AnchorCssVariables;\n variant: AnchorVariant;\n}>;\n\nconst defaultProps = {\n underline: 'hover',\n} satisfies Partial<AnchorProps>;\n\nexport const Anchor = polymorphicFactory<AnchorFactory>((props) => {\n const { underline, className, unstyled, mod, ...others } = useProps(\n 'Anchor',\n defaultProps,\n props\n );\n\n return (\n <Text\n component=\"a\"\n className={cx({ [classes.root]: !unstyled }, className)}\n {...others}\n mod={[{ underline }, mod]}\n __staticSelector=\"Anchor\"\n unstyled={unstyled}\n />\n );\n});\n\nAnchor.classes = classes;\nAnchor.displayName = '@mantine/core/Anchor';\n\nexport namespace Anchor {\n export type Props = AnchorProps;\n export type StylesNames = AnchorStylesNames;\n export type CssVariables = AnchorCssVariables;\n export type Factory = AnchorFactory;\n export type Variant = AnchorVariant;\n}\n"],"mappings":";;;;;;;;AAuBA,MAAM,eAAe,EACnB,WAAW,SACZ;AAED,MAAa,SAAS,oBAAmC,UAAU;CACjE,MAAM,EAAE,WAAW,WAAW,UAAU,KAAK,GAAG,WAAW,SACzD,UACA,cACA,MACD;AAED,QACE,oBAAC,MAAD;EACE,WAAU;EACV,WAAW,GAAG,GAAGA,sBAAQ,OAAO,CAAC,UAAU,EAAE,UAAU;EACvD,GAAI;EACJ,KAAK,CAAC,EAAE,WAAW,EAAE,IAAI;EACzB,kBAAiB;EACP;EACV,CAAA;EAEJ;AAEF,OAAO,UAAUA;AACjB,OAAO,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AngleSlider.mjs","names":["classes"],"sources":["../../../src/components/AngleSlider/AngleSlider.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { normalizeRadialValue, useMergedRef, useRadialMove, useUncontrolled } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n findClosestNumber,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './AngleSlider.module.css';\n\nexport type AngleSliderStylesNames = 'root' | 'thumb' | 'label' | 'marks' | 'mark';\nexport type AngleSliderCssVariables = {\n root: '--slider-size' | '--thumb-size';\n};\n\nexport interface AngleSliderProps\n extends BoxProps, StylesApiProps<AngleSliderFactory>, ElementProps<'div', 'onChange'> {\n /** Step between values @default 1 */\n step?: number;\n\n /** Controlled component value */\n value?: number;\n\n /** Uncontrolled component default value */\n defaultValue?: number;\n\n /** Called on value change */\n onChange?: (value: number) => void;\n\n /** Called after the selection is finished */\n onChangeEnd?: (value: number) => void;\n\n /** Called in `onMouseDown` and `onTouchStart` */\n onScrubStart?: () => void;\n\n /** Called in `onMouseUp` and `onTouchEnd` */\n onScrubEnd?: () => void;\n\n /** If set, the label is displayed inside the slider @default true */\n withLabel?: boolean;\n\n /** Array of marks displayed on the slider */\n marks?: { value: number; label?: string }[];\n\n /** Slider size in px @default 60 */\n size?: number;\n\n /** Size of the thumb in px. Calculated based on the `size` value by default. */\n thumbSize?: number;\n\n /** A function to format label based on the current value */\n formatLabel?: (value: number) => React.ReactNode;\n\n /** Sets `data-disabled` attribute, disables interactions */\n disabled?: boolean;\n\n /** If set, the selection is allowed only from the given marks array @default false */\n restrictToMarks?: boolean;\n\n /** Props passed down to the hidden input */\n hiddenInputProps?: React.ComponentProps<'input'>;\n\n /** Hidden input name, use with uncontrolled component */\n name?: string;\n}\n\nexport type AngleSliderFactory = Factory<{\n props: AngleSliderProps;\n ref: HTMLDivElement;\n stylesNames: AngleSliderStylesNames;\n vars: AngleSliderCssVariables;\n}>;\n\nconst defaultProps = {\n step: 1,\n withLabel: true,\n} satisfies Partial<AngleSliderProps>;\n\nconst varsResolver = createVarsResolver<AngleSliderFactory>((_, { size, thumbSize }) => ({\n root: {\n '--slider-size': rem(size),\n '--thumb-size': rem(thumbSize),\n },\n}));\n\nexport const AngleSlider = factory<AngleSliderFactory>((_props) => {\n const props = useProps('AngleSlider', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n step,\n value,\n defaultValue,\n onChange,\n onMouseDown,\n withLabel,\n marks,\n thumbSize,\n restrictToMarks,\n formatLabel,\n onChangeEnd,\n disabled,\n onTouchStart,\n name,\n hiddenInputProps,\n 'aria-label': ariaLabel,\n tabIndex,\n onScrubStart,\n onScrubEnd,\n mod,\n attributes,\n ref,\n ...others\n } = props;\n\n const rootRef = useRef<HTMLDivElement | null>(null);\n\n const [_value, setValue] = useUncontrolled({\n value,\n defaultValue,\n finalValue: 0,\n onChange,\n });\n\n const update = (val: number) => {\n if (rootRef.current && !disabled) {\n const newValue =\n restrictToMarks && Array.isArray(marks)\n ? findClosestNumber(\n val,\n marks.map((mark) => mark.value)\n )\n : val;\n\n setValue(newValue);\n }\n };\n\n const { ref: radialMoveRef } = useRadialMove(update, {\n step,\n onChangeEnd,\n onScrubStart,\n onScrubEnd,\n });\n\n const getStyles = useStyles<AngleSliderFactory>({\n name: 'AngleSlider',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (disabled) {\n return;\n }\n\n let newValue = _value;\n\n if (event.key === 'ArrowLeft' || event.key === 'ArrowDown') {\n event.preventDefault();\n if (_value === 0) {\n newValue = 359;\n } else {\n newValue = normalizeRadialValue(_value - step, step);\n }\n }\n\n if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {\n event.preventDefault();\n if (_value === 359) {\n newValue = 0;\n } else {\n newValue = normalizeRadialValue(_value + step, step);\n }\n }\n\n if (event.key === 'Home') {\n newValue = 0;\n }\n\n if (event.key === 'End') {\n newValue = 359;\n }\n\n if (restrictToMarks && Array.isArray(marks)) {\n const markValues = marks.map((mark) => mark.value);\n const currentIndex = markValues.indexOf(_value);\n\n if (currentIndex !== -1) {\n if (event.key === 'ArrowLeft' || event.key === 'ArrowDown') {\n newValue = markValues[currentIndex === 0 ? markValues.length - 1 : currentIndex - 1];\n } else if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {\n newValue = markValues[currentIndex === markValues.length - 1 ? 0 : currentIndex + 1];\n } else {\n newValue = findClosestNumber(newValue, markValues);\n }\n } else {\n newValue = findClosestNumber(newValue, markValues);\n }\n }\n\n setValue(newValue);\n onChangeEnd?.(newValue);\n };\n\n const marksItems = marks?.map((mark, index) => (\n <div\n {...getStyles('mark', { style: { '--angle': `${mark.value}deg` } })}\n data-label={mark.label || undefined}\n key={index}\n />\n ));\n\n return (\n <Box\n ref={useMergedRef(ref, rootRef, radialMoveRef)}\n {...getStyles('root', { focusable: true })}\n mod={[{ disabled }, mod]}\n {...others}\n >\n {marksItems && marksItems.length > 0 && <div {...getStyles('marks')}>{marksItems}</div>}\n\n {withLabel && (\n <div {...getStyles('label')}>\n {typeof formatLabel === 'function' ? formatLabel(_value) : _value}\n </div>\n )}\n <div\n tabIndex={tabIndex ?? (disabled ? -1 : 0)}\n role=\"slider\"\n aria-valuemax={360}\n aria-valuemin={0}\n aria-valuenow={_value}\n onKeyDown={handleKeyDown}\n aria-label={ariaLabel}\n {...getStyles('thumb', { style: { transform: `rotate(${_value}deg)` } })}\n />\n <input type=\"hidden\" name={name} value={_value} {...hiddenInputProps} />\n </Box>\n );\n});\n\nAngleSlider.displayName = '@mantine/core/AngleSlider';\nAngleSlider.classes = classes;\nAngleSlider.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;AAgFA,MAAM,eAAe;CACnB,MAAM;CACN,WAAW;CACZ;AAED,MAAM,eAAe,oBAAwC,GAAG,EAAE,MAAM,iBAAiB,EACvF,MAAM;CACJ,iBAAiB,IAAI,KAAK;CAC1B,gBAAgB,IAAI,UAAU;CAC/B,EACF,EAAE;AAEH,MAAa,cAAc,SAA6B,WAAW;CACjE,MAAM,QAAQ,SAAS,eAAe,cAAc,OAAO;CAC3D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,OACA,cACA,UACA,aACA,WACA,OACA,WACA,iBACA,aACA,aACA,UACA,cACA,MACA,kBACA,cAAc,WACd,UACA,cACA,YACA,KACA,YACA,KACA,GAAG,WACD;CAEJ,MAAM,UAAU,OAA8B,KAAK;CAEnD,MAAM,CAAC,QAAQ,YAAY,gBAAgB;EACzC;EACA;EACA,YAAY;EACZ;EACD,CAAC;CAEF,MAAM,UAAU,QAAgB;AAC9B,MAAI,QAAQ,WAAW,CAAC,SAStB,UAPE,mBAAmB,MAAM,QAAQ,MAAM,GACnC,kBACE,KACA,MAAM,KAAK,SAAS,KAAK,MAAM,CAChC,GACD,IAEY;;CAItB,MAAM,EAAE,KAAK,kBAAkB,cAAc,QAAQ;EACnD;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,YAAY,UAA8B;EAC9C,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,iBAAiB,UAA+C;AACpE,MAAI,SACF;EAGF,IAAI,WAAW;AAEf,MAAI,MAAM,QAAQ,eAAe,MAAM,QAAQ,aAAa;AAC1D,SAAM,gBAAgB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IAAK,GAAI,UAAU,QAAQ;cACxB,OAAO,gBAAgB,aAAa,YAAY,OAAO,GAAG;IACvD,CAAA;GAER,oBAAC,OAAD;IACE,UAAU,aAAa,WAAW,KAAK;IACvC,MAAK;IACL,iBAAe;IACf,iBAAe;IACf,iBAAe;IACf,WAAW;IACX,cAAY;IACZ,GAAI,UAAU,SAAS,EAAE,OAAO,EAAE,WAAW,UAAU,OAAO,OAAO,EAAE,CAAC;IACxE,CAAA;GACF,oBAAC,SAAD;IAAO,MAAK;IAAe;IAAM,OAAO;IAAQ,GAAI;IAAoB,CAAA;GACpE;;EAER;AAEF,YAAY,cAAc;AAC1B,YAAY,UAAUA;AACtB,YAAY,eAAe"}
|
|
1
|
+
{"version":3,"file":"AngleSlider.mjs","names":["classes"],"sources":["../../../src/components/AngleSlider/AngleSlider.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { normalizeRadialValue, useMergedRef, useRadialMove, useUncontrolled } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n findClosestNumber,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './AngleSlider.module.css';\n\nexport type AngleSliderStylesNames = 'root' | 'thumb' | 'label' | 'marks' | 'mark';\nexport type AngleSliderCssVariables = {\n root: '--slider-size' | '--thumb-size';\n};\n\nexport interface AngleSliderProps\n extends BoxProps, StylesApiProps<AngleSliderFactory>, ElementProps<'div', 'onChange'> {\n /** Step between values @default 1 */\n step?: number;\n\n /** Controlled component value */\n value?: number;\n\n /** Uncontrolled component default value */\n defaultValue?: number;\n\n /** Called on value change */\n onChange?: (value: number) => void;\n\n /** Called after the selection is finished */\n onChangeEnd?: (value: number) => void;\n\n /** Called in `onMouseDown` and `onTouchStart` */\n onScrubStart?: () => void;\n\n /** Called in `onMouseUp` and `onTouchEnd` */\n onScrubEnd?: () => void;\n\n /** If set, the label is displayed inside the slider @default true */\n withLabel?: boolean;\n\n /** Array of marks displayed on the slider */\n marks?: { value: number; label?: string }[];\n\n /** Slider size in px @default 60 */\n size?: number;\n\n /** Size of the thumb in px. Calculated based on the `size` value by default. */\n thumbSize?: number;\n\n /** A function to format label based on the current value */\n formatLabel?: (value: number) => React.ReactNode;\n\n /** Sets `data-disabled` attribute, disables interactions */\n disabled?: boolean;\n\n /** If set, the selection is allowed only from the given marks array @default false */\n restrictToMarks?: boolean;\n\n /** Props passed down to the hidden input */\n hiddenInputProps?: React.ComponentProps<'input'>;\n\n /** Hidden input name, use with uncontrolled component */\n name?: string;\n}\n\nexport type AngleSliderFactory = Factory<{\n props: AngleSliderProps;\n ref: HTMLDivElement;\n stylesNames: AngleSliderStylesNames;\n vars: AngleSliderCssVariables;\n}>;\n\nconst defaultProps = {\n step: 1,\n withLabel: true,\n} satisfies Partial<AngleSliderProps>;\n\nconst varsResolver = createVarsResolver<AngleSliderFactory>((_, { size, thumbSize }) => ({\n root: {\n '--slider-size': rem(size),\n '--thumb-size': rem(thumbSize),\n },\n}));\n\nexport const AngleSlider = factory<AngleSliderFactory>((_props) => {\n const props = useProps('AngleSlider', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n step,\n value,\n defaultValue,\n onChange,\n onMouseDown,\n withLabel,\n marks,\n thumbSize,\n restrictToMarks,\n formatLabel,\n onChangeEnd,\n disabled,\n onTouchStart,\n name,\n hiddenInputProps,\n 'aria-label': ariaLabel,\n tabIndex,\n onScrubStart,\n onScrubEnd,\n mod,\n attributes,\n ref,\n ...others\n } = props;\n\n const rootRef = useRef<HTMLDivElement | null>(null);\n\n const [_value, setValue] = useUncontrolled({\n value,\n defaultValue,\n finalValue: 0,\n onChange,\n });\n\n const update = (val: number) => {\n if (rootRef.current && !disabled) {\n const newValue =\n restrictToMarks && Array.isArray(marks)\n ? findClosestNumber(\n val,\n marks.map((mark) => mark.value)\n )\n : val;\n\n setValue(newValue);\n }\n };\n\n const { ref: radialMoveRef } = useRadialMove(update, {\n step,\n onChangeEnd,\n onScrubStart,\n onScrubEnd,\n });\n\n const getStyles = useStyles<AngleSliderFactory>({\n name: 'AngleSlider',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (disabled) {\n return;\n }\n\n let newValue = _value;\n\n if (event.key === 'ArrowLeft' || event.key === 'ArrowDown') {\n event.preventDefault();\n if (_value === 0) {\n newValue = 359;\n } else {\n newValue = normalizeRadialValue(_value - step, step);\n }\n }\n\n if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {\n event.preventDefault();\n if (_value === 359) {\n newValue = 0;\n } else {\n newValue = normalizeRadialValue(_value + step, step);\n }\n }\n\n if (event.key === 'Home') {\n newValue = 0;\n }\n\n if (event.key === 'End') {\n newValue = 359;\n }\n\n if (restrictToMarks && Array.isArray(marks)) {\n const markValues = marks.map((mark) => mark.value);\n const currentIndex = markValues.indexOf(_value);\n\n if (currentIndex !== -1) {\n if (event.key === 'ArrowLeft' || event.key === 'ArrowDown') {\n newValue = markValues[currentIndex === 0 ? markValues.length - 1 : currentIndex - 1];\n } else if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {\n newValue = markValues[currentIndex === markValues.length - 1 ? 0 : currentIndex + 1];\n } else {\n newValue = findClosestNumber(newValue, markValues);\n }\n } else {\n newValue = findClosestNumber(newValue, markValues);\n }\n }\n\n setValue(newValue);\n onChangeEnd?.(newValue);\n };\n\n const marksItems = marks?.map((mark, index) => (\n <div\n {...getStyles('mark', { style: { '--angle': `${mark.value}deg` } })}\n data-label={mark.label || undefined}\n key={index}\n />\n ));\n\n return (\n <Box\n ref={useMergedRef(ref, rootRef, radialMoveRef)}\n {...getStyles('root', { focusable: true })}\n mod={[{ disabled }, mod]}\n {...others}\n >\n {marksItems && marksItems.length > 0 && <div {...getStyles('marks')}>{marksItems}</div>}\n\n {withLabel && (\n <div {...getStyles('label')}>\n {typeof formatLabel === 'function' ? formatLabel(_value) : _value}\n </div>\n )}\n <div\n tabIndex={tabIndex ?? (disabled ? -1 : 0)}\n role=\"slider\"\n aria-valuemax={360}\n aria-valuemin={0}\n aria-valuenow={_value}\n onKeyDown={handleKeyDown}\n aria-label={ariaLabel}\n {...getStyles('thumb', { style: { transform: `rotate(${_value}deg)` } })}\n />\n <input type=\"hidden\" name={name} value={_value} {...hiddenInputProps} />\n </Box>\n );\n});\n\nAngleSlider.displayName = '@mantine/core/AngleSlider';\nAngleSlider.classes = classes;\nAngleSlider.varsResolver = varsResolver;\n\nexport namespace AngleSlider {\n export type Props = AngleSliderProps;\n export type StylesNames = AngleSliderStylesNames;\n export type CssVariables = AngleSliderCssVariables;\n export type Factory = AngleSliderFactory;\n}\n"],"mappings":";;;;;;;;;;;;;AAgFA,MAAM,eAAe;CACnB,MAAM;CACN,WAAW;CACZ;AAED,MAAM,eAAe,oBAAwC,GAAG,EAAE,MAAM,iBAAiB,EACvF,MAAM;CACJ,iBAAiB,IAAI,KAAK;CAC1B,gBAAgB,IAAI,UAAU;CAC/B,EACF,EAAE;AAEH,MAAa,cAAc,SAA6B,WAAW;CACjE,MAAM,QAAQ,SAAS,eAAe,cAAc,OAAO;CAC3D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,OACA,cACA,UACA,aACA,WACA,OACA,WACA,iBACA,aACA,aACA,UACA,cACA,MACA,kBACA,cAAc,WACd,UACA,cACA,YACA,KACA,YACA,KACA,GAAG,WACD;CAEJ,MAAM,UAAU,OAA8B,KAAK;CAEnD,MAAM,CAAC,QAAQ,YAAY,gBAAgB;EACzC;EACA;EACA,YAAY;EACZ;EACD,CAAC;CAEF,MAAM,UAAU,QAAgB;AAC9B,MAAI,QAAQ,WAAW,CAAC,SAStB,UAPE,mBAAmB,MAAM,QAAQ,MAAM,GACnC,kBACE,KACA,MAAM,KAAK,SAAS,KAAK,MAAM,CAChC,GACD,IAEY;;CAItB,MAAM,EAAE,KAAK,kBAAkB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AEF,QACE,qBAAC,KAAD;EACE,KAAK,aAAa,KAAK,SAAS,cAAc;EAC9C,GAAI,UAAU,QAAQ,EAAE,WAAW,MAAM,CAAC;EAC1C,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI;EACxB,GAAI;YAJN;GAMG,cAAc,WAAW,SAAS,KAAK,oBAAC,OAAD;IAAK,GAAI,UAAU,QAAQ;cAAG;IAAiB,CAAA;GAEtF,aACC,oBAAC,OAAD;IAAK,GAAI,UAAU,QAAQ;cACxB,OAAO,gBAAgB,aAAa,YAAY,OAAO,GAAG;IACvD,CAAA;GAER,oBAAC,OAAD;IACE,UAAU,aAAa,WAAW,KAAK;IACvC,MAAK;IACL,iBAAe;IACf,iBAAe;IACf,iBAAe;IACf,WAAW;IACX,cAAY;IACZ,GAAI,UAAU,SAAS,EAAE,OAAO,EAAE,WAAW,UAAU,OAAO,OAAO,EAAE,CAAC;IACxE,CAAA;GACF,oBAAC,SAAD;IAAO,MAAK;IAAe;IAAM,OAAO;IAAQ,GAAI;IAAoB,CAAA;GACpE;;EAER;AAEF,YAAY,cAAc;AAC1B,YAAY,UAAUA;AACtB,YAAY,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.mjs","names":["classes"],"sources":["../../../src/components/AppShell/AppShell.tsx"],"sourcesContent":["import { useId } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getDefaultZIndex,\n MantineSpacing,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { AppShellProvider } from './AppShell.context';\nimport {\n AppShellAsideConfiguration,\n AppShellFooterConfiguration,\n AppShellHeaderConfiguration,\n AppShellNavbarConfiguration,\n AppShellResponsiveSize,\n} from './AppShell.types';\nimport { AppShellAside } from './AppShellAside/AppShellAside';\nimport { AppShellFooter } from './AppShellFooter/AppShellFooter';\nimport { AppShellHeader } from './AppShellHeader/AppShellHeader';\nimport { AppShellMain } from './AppShellMain/AppShellMain';\nimport { AppShellMediaStyles } from './AppShellMediaStyles/AppShellMediaStyles';\nimport { AppShellNavbar } from './AppShellNavbar/AppShellNavbar';\nimport { AppShellSection } from './AppShellSection/AppShellSection';\nimport { useResizing } from './use-resizing/use-resizing';\nimport classes from './AppShell.module.css';\
|
|
1
|
+
{"version":3,"file":"AppShell.mjs","names":["classes"],"sources":["../../../src/components/AppShell/AppShell.tsx"],"sourcesContent":["import { useId } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getDefaultZIndex,\n MantineSpacing,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { AppShellProvider } from './AppShell.context';\nimport {\n AppShellAsideConfiguration,\n AppShellFooterConfiguration,\n AppShellHeaderConfiguration,\n AppShellNavbarConfiguration,\n AppShellResponsiveSize,\n} from './AppShell.types';\nimport { AppShellAside, type AppShellAsideProps } from './AppShellAside/AppShellAside';\nimport { AppShellFooter, type AppShellFooterProps } from './AppShellFooter/AppShellFooter';\nimport { AppShellHeader, type AppShellHeaderProps } from './AppShellHeader/AppShellHeader';\nimport { AppShellMain, type AppShellMainProps } from './AppShellMain/AppShellMain';\nimport { AppShellMediaStyles } from './AppShellMediaStyles/AppShellMediaStyles';\nimport { AppShellNavbar, type AppShellNavbarProps } from './AppShellNavbar/AppShellNavbar';\nimport { AppShellSection, type AppShellSectionProps } from './AppShellSection/AppShellSection';\nimport { useResizing } from './use-resizing/use-resizing';\nimport classes from './AppShell.module.css';\nexport type AppShellStylesNames =\n | 'root'\n | 'navbar'\n | 'main'\n | 'header'\n | 'footer'\n | 'aside'\n | 'section';\n\nexport type AppShellCssVariables = {\n root: '--app-shell-transition-duration' | '--app-shell-transition-timing-function';\n};\n\nexport interface AppShellProps\n extends BoxProps, StylesApiProps<AppShellFactory>, ElementProps<'div'> {\n /** If set, the associated components have a border @default true */\n withBorder?: boolean;\n\n /** Padding of the main section. Important: use `padding` prop instead of `p`. @default 0 */\n padding?: MantineSpacing | AppShellResponsiveSize;\n\n /** `Navbar` configuration, controls width, breakpoints and collapsed state. Required if you use `Navbar` component. */\n navbar?: AppShellNavbarConfiguration;\n\n /** `Aside` configuration, controls width, breakpoints and collapsed state. Required if you use `Aside` component. */\n aside?: AppShellAsideConfiguration;\n\n /** `Header` configuration, controls height, offset and collapsed state. Required if you use `Header` component. */\n header?: AppShellHeaderConfiguration;\n\n /** `Footer` configuration, controls height, offset and collapsed state. Required if you use `Footer` component. */\n footer?: AppShellFooterConfiguration;\n\n /** Duration of all transitions in ms @default 200 */\n transitionDuration?: number;\n\n /** Timing function of all transitions @default ease */\n transitionTimingFunction?: React.CSSProperties['transitionTimingFunction'];\n\n /** `z-index` of all associated elements @default 100 */\n zIndex?: string | number;\n\n /** Determines how `Navbar`/`Aside` are arranged relative to `Header`/`Footer` */\n layout?: 'default' | 'alt';\n\n /** If set, `Navbar`, `Aside`, `Header` and `Footer` components are hidden */\n disabled?: boolean;\n\n /** If set, `Header` and `Footer` components include styles to offset scrollbars. Based on `react-remove-scroll`. @default true */\n offsetScrollbars?: boolean;\n\n /** Determines positioning mode of all sections @default 'fixed' */\n mode?: 'fixed' | 'static';\n}\n\nexport type AppShellFactory = Factory<{\n props: AppShellProps;\n ref: HTMLDivElement;\n stylesNames: AppShellStylesNames;\n vars: AppShellCssVariables;\n staticComponents: {\n Navbar: typeof AppShellNavbar;\n Header: typeof AppShellHeader;\n Main: typeof AppShellMain;\n Aside: typeof AppShellAside;\n Footer: typeof AppShellFooter;\n Section: typeof AppShellSection;\n };\n}>;\n\nconst defaultProps = {\n withBorder: true,\n padding: 0,\n transitionDuration: 200,\n transitionTimingFunction: 'ease',\n zIndex: getDefaultZIndex('app'),\n mode: 'fixed',\n} satisfies Partial<AppShellProps>;\n\nconst varsResolver = createVarsResolver<AppShellFactory>(\n (_, { transitionDuration, transitionTimingFunction }) => ({\n root: {\n '--app-shell-transition-duration': `${transitionDuration}ms`,\n '--app-shell-transition-timing-function': transitionTimingFunction,\n },\n })\n);\n\nexport const AppShell = factory<AppShellFactory>((_props) => {\n const props = useProps('AppShell', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n navbar,\n withBorder,\n padding,\n transitionDuration,\n transitionTimingFunction,\n header,\n zIndex,\n layout,\n disabled,\n aside,\n footer,\n offsetScrollbars = true,\n mode,\n mod,\n attributes,\n id,\n ...others\n } = props;\n\n const getStyles = useStyles<AppShellFactory>({\n name: 'AppShell',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const resizing = useResizing({ disabled, transitionDuration });\n const _id = useId(id);\n\n return (\n <AppShellProvider value={{ getStyles, withBorder, zIndex, disabled, offsetScrollbars, mode }}>\n <AppShellMediaStyles\n navbar={navbar}\n header={header}\n aside={aside}\n footer={footer}\n padding={padding}\n mode={mode}\n selector={mode === 'static' ? `#${_id}` : undefined}\n />\n <Box\n {...getStyles('root')}\n id={_id}\n mod={[{ resizing, layout, disabled, mode }, mod]}\n {...others}\n />\n </AppShellProvider>\n );\n});\n\nAppShell.classes = classes;\nAppShell.varsResolver = varsResolver;\nAppShell.displayName = '@mantine/core/AppShell';\nAppShell.Navbar = AppShellNavbar;\nAppShell.Header = AppShellHeader;\nAppShell.Main = AppShellMain;\nAppShell.Aside = AppShellAside;\nAppShell.Footer = AppShellFooter;\nAppShell.Section = AppShellSection;\n\nexport namespace AppShell {\n export type Props = AppShellProps;\n export type StylesNames = AppShellStylesNames;\n export type CssVariables = AppShellCssVariables;\n export type Factory = AppShellFactory;\n\n export namespace Section {\n export type Props = AppShellSectionProps;\n }\n\n export namespace Header {\n export type Props = AppShellHeaderProps;\n }\n\n export namespace Footer {\n export type Props = AppShellFooterProps;\n }\n\n export namespace Navbar {\n export type Props = AppShellNavbarProps;\n }\n\n export namespace Aside {\n export type Props = AppShellAsideProps;\n }\n\n export namespace Main {\n export type Props = AppShellMainProps;\n }\n}\n"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,"file":"AspectRatio.mjs","names":["classes"],"sources":["../../../src/components/AspectRatio/AspectRatio.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './AspectRatio.module.css';\n\nexport type AspectRatioStylesNames = 'root';\nexport type AspectRatioCssVariables = {\n root: '--ar-ratio';\n};\n\nexport interface AspectRatioProps\n extends BoxProps, StylesApiProps<AspectRatioFactory>, ElementProps<'div'> {\n /** Aspect ratio, for example, `16 / 9`, `4 / 3`, `1920 / 1080` @default 1 */\n ratio?: number;\n}\n\nexport type AspectRatioFactory = Factory<{\n props: AspectRatioProps;\n ref: HTMLDivElement;\n stylesNames: AspectRatioStylesNames;\n vars: AspectRatioCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<AspectRatioFactory>((_, { ratio }) => ({\n root: {\n '--ar-ratio': ratio?.toString(),\n },\n}));\n\nexport const AspectRatio = factory<AspectRatioFactory>((_props) => {\n const props = useProps('AspectRatio', null, _props);\n const { classNames, className, style, styles, unstyled, vars, ratio, attributes, ...others } =\n props;\n\n const getStyles = useStyles<AspectRatioFactory>({\n name: 'AspectRatio',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return <Box {...getStyles('root')} {...others} />;\n});\n\nAspectRatio.classes = classes;\nAspectRatio.varsResolver = varsResolver;\nAspectRatio.displayName = '@mantine/core/AspectRatio';\n"],"mappings":";;;;;;;;;AA+BA,MAAM,eAAe,oBAAwC,GAAG,EAAE,aAAa,EAC7E,MAAM,EACJ,cAAc,OAAO,UAAU,EAChC,EACF,EAAE;AAEH,MAAa,cAAc,SAA6B,WAAW;CACjE,MAAM,QAAQ,SAAS,eAAe,MAAM,OAAO;CACnD,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,UAAU,MAAM,OAAO,YAAY,GAAG,WAClF;AAgBF,QAAO,oBAAC,KAAD;EAAK,GAdM,UAA8B;GAC9C,MAAM;GACN,SAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,CAEwB,OAAO;EAAE,GAAI;EAAU,CAAA;EACjD;AAEF,YAAY,UAAUA;AACtB,YAAY,eAAe;AAC3B,YAAY,cAAc"}
|
|
1
|
+
{"version":3,"file":"AspectRatio.mjs","names":["classes"],"sources":["../../../src/components/AspectRatio/AspectRatio.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './AspectRatio.module.css';\n\nexport type AspectRatioStylesNames = 'root';\nexport type AspectRatioCssVariables = {\n root: '--ar-ratio';\n};\n\nexport interface AspectRatioProps\n extends BoxProps, StylesApiProps<AspectRatioFactory>, ElementProps<'div'> {\n /** Aspect ratio, for example, `16 / 9`, `4 / 3`, `1920 / 1080` @default 1 */\n ratio?: number;\n}\n\nexport type AspectRatioFactory = Factory<{\n props: AspectRatioProps;\n ref: HTMLDivElement;\n stylesNames: AspectRatioStylesNames;\n vars: AspectRatioCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<AspectRatioFactory>((_, { ratio }) => ({\n root: {\n '--ar-ratio': ratio?.toString(),\n },\n}));\n\nexport const AspectRatio = factory<AspectRatioFactory>((_props) => {\n const props = useProps('AspectRatio', null, _props);\n const { classNames, className, style, styles, unstyled, vars, ratio, attributes, ...others } =\n props;\n\n const getStyles = useStyles<AspectRatioFactory>({\n name: 'AspectRatio',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return <Box {...getStyles('root')} {...others} />;\n});\n\nAspectRatio.classes = classes;\nAspectRatio.varsResolver = varsResolver;\nAspectRatio.displayName = '@mantine/core/AspectRatio';\n\nexport namespace AspectRatio {\n export type Props = AspectRatioProps;\n export type StylesNames = AspectRatioStylesNames;\n export type CssVariables = AspectRatioCssVariables;\n export type Factory = AspectRatioFactory;\n}\n"],"mappings":";;;;;;;;;AA+BA,MAAM,eAAe,oBAAwC,GAAG,EAAE,aAAa,EAC7E,MAAM,EACJ,cAAc,OAAO,UAAU,EAChC,EACF,EAAE;AAEH,MAAa,cAAc,SAA6B,WAAW;CACjE,MAAM,QAAQ,SAAS,eAAe,MAAM,OAAO;CACnD,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,UAAU,MAAM,OAAO,YAAY,GAAG,WAClF;AAgBF,QAAO,oBAAC,KAAD;EAAK,GAdM,UAA8B;GAC9C,MAAM;GACN,SAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,CAEwB,OAAO;EAAE,GAAI;EAAU,CAAA;EACjD;AAEF,YAAY,UAAUA;AACtB,YAAY,eAAe;AAC3B,YAAY,cAAc"}
|
|
@@ -13,7 +13,7 @@ import { useId as useId$1, useUncontrolled } from "@mantine/hooks";
|
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
//#region packages/@mantine/core/src/components/Autocomplete/Autocomplete.tsx
|
|
15
15
|
const Autocomplete = factory((_props) => {
|
|
16
|
-
const props = useProps("Autocomplete",
|
|
16
|
+
const props = useProps("Autocomplete", { size: "sm" }, _props);
|
|
17
17
|
const { classNames, styles, unstyled, vars, dropdownOpened, defaultDropdownOpened, onDropdownClose, onDropdownOpen, onFocus, onBlur, onClick, onChange, data, value, defaultValue, selectFirstOptionOnChange, selectFirstOptionOnDropdownOpen, onOptionSubmit, comboboxProps, readOnly, disabled, filter, limit, withScrollArea, maxDropdownHeight, size, id, renderOption, autoComplete, scrollAreaProps, onClear, clearButtonProps, error, clearable, clearSectionMode, rightSection, autoSelectOnBlur, openOnFocus = true, attributes, ...others } = props;
|
|
18
18
|
const _id = useId$1(id);
|
|
19
19
|
const parsedData = getParsedComboboxData(data);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.mjs","names":["useId"],"sources":["../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n ElementProps,\n factory,\n Factory,\n Primitive,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n} from '../../core';\nimport {\n Combobox,\n ComboboxGenericData,\n ComboboxGenericItem,\n ComboboxLikeProps,\n ComboboxLikeRenderOptionInput,\n ComboboxLikeStylesNames,\n getOptionsLockup,\n getParsedComboboxData,\n OptionsDropdown,\n OptionsFilter,\n useCombobox,\n} from '../Combobox';\nimport {\n __BaseInputProps,\n __InputStylesNames,\n ClearSectionMode,\n InputClearButtonProps,\n InputVariant,\n} from '../Input';\nimport { InputBase } from '../InputBase';\nimport { ScrollAreaProps } from '../ScrollArea';\n\nexport type RenderAutocompleteOption = (\n input: ComboboxLikeRenderOptionInput<ComboboxGenericItem>\n) => React.ReactNode;\n\nexport type AutocompleteStylesNames = __InputStylesNames | ComboboxLikeStylesNames;\n\nexport interface AutocompleteProps\n extends\n BoxProps,\n Omit<__BaseInputProps, 'pointer'>,\n Omit<ComboboxLikeProps, 'data'>,\n StylesApiProps<AutocompleteFactory>,\n ElementProps<'input', 'onChange' | 'size'> {\n /** Data used to display options. Values must be unique. */\n data?: ComboboxGenericData;\n\n /** Controlled component value */\n value?: string;\n\n /** Default value for uncontrolled component */\n defaultValue?: string;\n\n /** Called when value changes */\n onChange?: (value: string) => void;\n\n /** Function to render custom option content */\n renderOption?: RenderAutocompleteOption;\n\n /** Props passed to the underlying `ScrollArea` component in the dropdown */\n scrollAreaProps?: ScrollAreaProps;\n\n /** Called when the clear button is clicked */\n onClear?: () => void;\n\n /** Props passed down to the clear button */\n clearButtonProps?: InputClearButtonProps;\n\n /** If set, the clear button is displayed when the component has a value @default false */\n clearable?: boolean;\n\n /** Determines how the clear button and rightSection are rendered @default 'both' */\n clearSectionMode?: ClearSectionMode;\n\n /** If set, the highlighted option is selected when the input loses focus @default false */\n autoSelectOnBlur?: boolean;\n\n /** If set, the dropdown opens when the input receives focus @default true */\n openOnFocus?: boolean;\n}\n\nexport type AutocompleteFactory = Factory<{\n props: AutocompleteProps;\n ref: HTMLInputElement;\n stylesNames: AutocompleteStylesNames;\n variant: InputVariant;\n}>;\n\nexport const Autocomplete = factory<AutocompleteFactory>((_props) => {\n const props = useProps('Autocomplete'
|
|
1
|
+
{"version":3,"file":"Autocomplete.mjs","names":["useId"],"sources":["../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n ElementProps,\n factory,\n Factory,\n Primitive,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n} from '../../core';\nimport {\n Combobox,\n ComboboxGenericData,\n ComboboxGenericItem,\n ComboboxLikeProps,\n ComboboxLikeRenderOptionInput,\n ComboboxLikeStylesNames,\n getOptionsLockup,\n getParsedComboboxData,\n OptionsDropdown,\n OptionsFilter,\n useCombobox,\n} from '../Combobox';\nimport {\n __BaseInputProps,\n __InputStylesNames,\n ClearSectionMode,\n InputClearButtonProps,\n InputVariant,\n} from '../Input';\nimport { InputBase } from '../InputBase';\nimport { ScrollAreaProps } from '../ScrollArea';\n\nexport type RenderAutocompleteOption = (\n input: ComboboxLikeRenderOptionInput<ComboboxGenericItem>\n) => React.ReactNode;\n\nexport type AutocompleteStylesNames = __InputStylesNames | ComboboxLikeStylesNames;\n\nexport interface AutocompleteProps\n extends\n BoxProps,\n Omit<__BaseInputProps, 'pointer'>,\n Omit<ComboboxLikeProps, 'data'>,\n StylesApiProps<AutocompleteFactory>,\n ElementProps<'input', 'onChange' | 'size'> {\n /** Data used to display options. Values must be unique. */\n data?: ComboboxGenericData;\n\n /** Controlled component value */\n value?: string;\n\n /** Default value for uncontrolled component */\n defaultValue?: string;\n\n /** Called when value changes */\n onChange?: (value: string) => void;\n\n /** Function to render custom option content */\n renderOption?: RenderAutocompleteOption;\n\n /** Props passed to the underlying `ScrollArea` component in the dropdown */\n scrollAreaProps?: ScrollAreaProps;\n\n /** Called when the clear button is clicked */\n onClear?: () => void;\n\n /** Props passed down to the clear button */\n clearButtonProps?: InputClearButtonProps;\n\n /** If set, the clear button is displayed when the component has a value @default false */\n clearable?: boolean;\n\n /** Determines how the clear button and rightSection are rendered @default 'both' */\n clearSectionMode?: ClearSectionMode;\n\n /** If set, the highlighted option is selected when the input loses focus @default false */\n autoSelectOnBlur?: boolean;\n\n /** If set, the dropdown opens when the input receives focus @default true */\n openOnFocus?: boolean;\n}\n\nexport type AutocompleteFactory = Factory<{\n props: AutocompleteProps;\n ref: HTMLInputElement;\n stylesNames: AutocompleteStylesNames;\n variant: InputVariant;\n}>;\n\nexport const Autocomplete = factory<AutocompleteFactory>((_props) => {\n const props = useProps(\n 'Autocomplete',\n { size: 'sm' } satisfies Partial<AutocompleteProps>,\n _props\n );\n const {\n classNames,\n styles,\n unstyled,\n vars,\n dropdownOpened,\n defaultDropdownOpened,\n onDropdownClose,\n onDropdownOpen,\n onFocus,\n onBlur,\n onClick,\n onChange,\n data,\n value,\n defaultValue,\n selectFirstOptionOnChange,\n selectFirstOptionOnDropdownOpen,\n onOptionSubmit,\n comboboxProps,\n readOnly,\n disabled,\n filter,\n limit,\n withScrollArea,\n maxDropdownHeight,\n size,\n id,\n renderOption,\n autoComplete,\n scrollAreaProps,\n onClear,\n clearButtonProps,\n error,\n clearable,\n clearSectionMode,\n rightSection,\n autoSelectOnBlur,\n openOnFocus = true,\n attributes,\n ...others\n } = props;\n\n const _id = useId(id);\n const parsedData = getParsedComboboxData(data);\n const optionsLockup = getOptionsLockup(parsedData);\n\n const [_value, setValue] = useUncontrolled({\n value,\n defaultValue,\n finalValue: '',\n onChange,\n });\n\n const combobox = useCombobox({\n opened: dropdownOpened,\n defaultOpened: defaultDropdownOpened,\n onDropdownOpen: () => {\n onDropdownOpen?.();\n if (selectFirstOptionOnDropdownOpen) {\n combobox.selectFirstOption();\n }\n },\n onDropdownClose: () => {\n onDropdownClose?.();\n // Required for autoSelectOnBlur to work correctly\n setTimeout(combobox.resetSelectedOption, 0);\n },\n });\n\n const handleValueChange = (value: string) => {\n setValue(value);\n combobox.resetSelectedOption();\n };\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<AutocompleteFactory>({\n props,\n styles,\n classNames,\n });\n\n useEffect(() => {\n if (selectFirstOptionOnChange) {\n combobox.selectFirstOption();\n }\n }, [selectFirstOptionOnChange, _value]);\n\n const clearButton = (\n <Combobox.ClearButton\n {...clearButtonProps}\n onClear={() => {\n handleValueChange('');\n onClear?.();\n }}\n />\n );\n\n return (\n <Combobox\n store={combobox}\n __staticSelector=\"Autocomplete\"\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n readOnly={readOnly}\n size={size}\n attributes={attributes}\n keepMounted={autoSelectOnBlur}\n onOptionSubmit={(val) => {\n onOptionSubmit?.(val);\n handleValueChange(optionsLockup[val].label);\n combobox.closeDropdown();\n }}\n {...comboboxProps}\n >\n <Combobox.Target autoComplete={autoComplete} withExpandedAttribute>\n <InputBase\n {...others}\n size={size}\n __staticSelector=\"Autocomplete\"\n __clearSection={clearButton}\n __clearable={clearable && !!_value && !disabled && !readOnly}\n __clearSectionMode={clearSectionMode}\n rightSection={rightSection}\n disabled={disabled}\n readOnly={readOnly}\n value={_value}\n error={error}\n onChange={(event) => {\n handleValueChange(event.currentTarget.value);\n combobox.openDropdown();\n selectFirstOptionOnChange && combobox.selectFirstOption();\n }}\n onFocus={(event) => {\n openOnFocus && combobox.openDropdown();\n onFocus?.(event);\n }}\n onBlur={(event) => {\n if (autoSelectOnBlur) {\n combobox.clickSelectedOption();\n }\n\n combobox.closeDropdown();\n onBlur?.(event);\n }}\n onClick={(event) => {\n combobox.openDropdown();\n onClick?.(event);\n }}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n attributes={attributes}\n id={_id}\n />\n </Combobox.Target>\n <OptionsDropdown\n data={parsedData}\n hidden={readOnly || disabled}\n filter={filter as OptionsFilter<Primitive> | undefined}\n search={_value}\n limit={limit}\n hiddenWhenEmpty\n withScrollArea={withScrollArea}\n maxDropdownHeight={maxDropdownHeight}\n unstyled={unstyled}\n labelId={others.label ? `${_id}-label` : undefined}\n aria-label={others.label ? undefined : others['aria-label']}\n renderOption={renderOption}\n scrollAreaProps={scrollAreaProps}\n />\n </Combobox>\n );\n});\n\nAutocomplete.classes = { ...InputBase.classes, ...Combobox.classes };\nAutocomplete.displayName = '@mantine/core/Autocomplete';\n\nexport namespace Autocomplete {\n export type Props = AutocompleteProps;\n export type StylesNames = AutocompleteStylesNames;\n export type RenderOption = RenderAutocompleteOption;\n export type Factory = AutocompleteFactory;\n}\n"],"mappings":";;;;;;;;;;;;;;AA4FA,MAAa,eAAe,SAA8B,WAAW;CACnE,MAAM,QAAQ,SACZ,gBACA,EAAE,MAAM,MAAM,EACd,OACD;CACD,MAAM,EACJ,YACA,QACA,UACA,MACA,gBACA,uBACA,iBACA,gBACA,SACA,QACA,SACA,UACA,MACA,OACA,cACA,2BACA,iCACA,gBACA,eACA,UACA,UACA,QACA,OACA,gBACA,mBACA,MACA,IACA,cACA,cACA,iBACA,SACA,kBACA,OACA,WACA,kBACA,cACA,kBACA,cAAc,MACd,YACA,GAAG,WACD;CAEJ,MAAM,MAAMA,QAAM,GAAG;CACrB,MAAM,aAAa,sBAAsB,KAAK;CAC9C,MAAM,gBAAgB,iBAAiB,WAAW;CAElD,MAAM,CAAC,QAAQ,YAAY,gBAAgB;EACzC;EACA;EACA,YAAY;EACZ;EACD,CAAC;CAEF,MAAM,WAAW,YAAY;EAC3B,QAAQ;EACR,eAAe;EACf,sBAAsB;AACpB,qBAAkB;AAClB,OAAI,gCACF,UAAS,mBAAmB;;EAGhC,uBAAuB;AACrB,sBAAmB;AAEnB,cAAW,SAAS,qBAAqB,EAAE;;EAE9C,CAAC;CAEF,MAAM,qBAAqB,UAAkB;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G,IAAI,UAAU,KAAA;GACzC,cAAY,OAAO,QAAQ,KAAA,IAAY,OAAO;GAChC;GACG;GACjB,CAAA,CACO;;EAEb;AAEF,aAAa,UAAU;CAAE,GAAG,UAAU;CAAS,GAAG,SAAS;CAAS;AACpE,aAAa,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.mjs","names":["classes"],"sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { use, useEffect, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n getRadius,\n getSize,\n MantineColor,\n MantineGradient,\n MantineRadius,\n MantineSize,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport {
|
|
1
|
+
{"version":3,"file":"Avatar.mjs","names":["classes"],"sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { use, useEffect, useState } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n getRadius,\n getSize,\n MantineColor,\n MantineGradient,\n MantineRadius,\n MantineSize,\n polymorphicFactory,\n PolymorphicFactory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport {\n AvatarGroup,\n AvatarGroupContext,\n type AvatarGroupProps,\n type AvatarGroupStylesNames,\n type AvatarGroupCssVariables,\n type AvatarGroupFactory,\n type AvatarGroupContextValue,\n} from './AvatarGroup/AvatarGroup';\nimport { AvatarPlaceholderIcon } from './AvatarPlaceholderIcon';\nimport { getInitialsColor } from './get-initials-color/get-initials-color';\nimport { getInitials } from './get-initials/get-initials';\nimport classes from './Avatar.module.css';\nexport type AvatarStylesNames = 'root' | 'placeholder' | 'image';\nexport type AvatarVariant =\n | 'filled'\n | 'light'\n | 'gradient'\n | 'outline'\n | 'transparent'\n | 'default'\n | 'white';\n\nexport type AvatarCssVariables = {\n root: '--avatar-size' | '--avatar-radius' | '--avatar-bg' | '--avatar-color' | '--avatar-bd';\n};\n\nexport interface AvatarProps extends BoxProps, StylesApiProps<AvatarFactory> {\n /** Width and height of the avatar, numbers are converted to rem @default 'md' */\n size?: MantineSize | (string & {}) | number;\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius @default '1000px' */\n radius?: MantineRadius;\n\n /** Key of `theme.colors` or any valid CSS color @default 'gray' */\n color?: MantineColor | 'initials';\n\n /** Gradient configuration for `variant=\"gradient\"` @default theme.defaultGradient */\n gradient?: MantineGradient;\n\n /** Image url, if the image cannot be loaded or `src={null}`, then placeholder is displayed instead */\n src?: string | null;\n\n /** Image `alt` attribute, also used as `title` attribute for placeholder */\n alt?: string;\n\n /** Attributes passed down to `img` element */\n imageProps?: React.ComponentProps<'img'>;\n\n /** Avatar placeholder, displayed when `src={null}` or when the image cannot be loaded */\n children?: React.ReactNode;\n\n /** If set, adjusts text color based on background color for `filled` variant */\n autoContrast?: boolean;\n\n /** Name of the user. When `src` is not set, used to display initials and to generate color when `color=\"initials\"` is set. */\n name?: string;\n\n /** A list of colors that is used for autogenerated initials. By default, all default Mantine colors can be used except gray and dark. */\n allowedInitialsColors?: MantineColor[];\n}\n\nexport type AvatarFactory = PolymorphicFactory<{\n props: AvatarProps;\n defaultRef: HTMLDivElement;\n defaultComponent: 'div';\n stylesNames: AvatarStylesNames;\n vars: AvatarCssVariables;\n variant: AvatarVariant;\n staticComponents: {\n Group: typeof AvatarGroup;\n };\n}>;\n\nconst varsResolver = createVarsResolver<AvatarFactory>(\n (\n theme,\n { size, radius, variant, gradient, color, autoContrast, name, allowedInitialsColors }\n ) => {\n const _color =\n color === 'initials' && typeof name === 'string'\n ? getInitialsColor(name, allowedInitialsColors)\n : color;\n\n const colors = theme.variantColorResolver({\n color: _color || 'gray',\n theme,\n gradient,\n variant: variant || 'light',\n autoContrast,\n });\n\n return {\n root: {\n '--avatar-size': getSize(size, 'avatar-size'),\n '--avatar-radius': radius === undefined ? undefined : getRadius(radius),\n '--avatar-bg': _color || variant ? colors.background : undefined,\n '--avatar-color': _color || variant ? colors.color : undefined,\n '--avatar-bd': _color || variant ? colors.border : undefined,\n },\n };\n }\n);\n\nexport const Avatar = polymorphicFactory<AvatarFactory>((_props) => {\n const props = useProps('Avatar', null, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n src,\n alt,\n radius,\n color,\n gradient,\n imageProps,\n children,\n autoContrast,\n mod,\n name,\n allowedInitialsColors,\n attributes,\n ...others\n } = props;\n const groupCtx = use(AvatarGroupContext);\n const [error, setError] = useState(!src);\n\n const getStyles = useStyles<AvatarFactory>({\n name: 'Avatar',\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n useEffect(() => setError(!src), [src]);\n\n return (\n <Box {...getStyles('root')} mod={[{ 'within-group': groupCtx.withinGroup }, mod]} {...others}>\n {error || !src ? (\n <span {...getStyles('placeholder')} title={alt}>\n {children || (typeof name === 'string' && getInitials(name)) || <AvatarPlaceholderIcon />}\n </span>\n ) : (\n <img\n {...imageProps}\n {...getStyles('image')}\n src={src}\n alt={alt}\n onError={(event) => {\n setError(true);\n imageProps?.onError?.(event);\n }}\n />\n )}\n </Box>\n );\n});\n\nAvatar.classes = classes;\nAvatar.varsResolver = varsResolver;\nAvatar.displayName = '@mantine/core/Avatar';\nAvatar.Group = AvatarGroup;\n\nexport namespace Avatar {\n export type Props = AvatarProps;\n export type StylesNames = AvatarStylesNames;\n export type CssVariables = AvatarCssVariables;\n export type Variant = AvatarVariant;\n export type Factory = AvatarFactory;\n\n export namespace Group {\n export type Props = AvatarGroupProps;\n export type StylesNames = AvatarGroupStylesNames;\n export type CssVariables = AvatarGroupCssVariables;\n export type Factory = AvatarGroupFactory;\n export type ContextValue = AvatarGroupContextValue;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2FA,MAAM,eAAe,oBAEjB,OACA,EAAE,MAAM,QAAQ,SAAS,UAAU,OAAO,cAAc,MAAM,4BAC3D;CACH,MAAM,SACJ,UAAU,cAAc,OAAO,SAAS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