@mantine/core 9.5.2 → 9.6.0
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/_virtual/_rolldown/runtime.cjs +1 -1
- package/cjs/components/Accordion/Accordion.cjs.map +1 -1
- package/cjs/components/Accordion/AccordionChevron.cjs.map +1 -1
- package/cjs/components/Accordion/AccordionControl/AccordionControl.cjs.map +1 -1
- package/cjs/components/Accordion/AccordionItem/AccordionItem.cjs.map +1 -1
- package/cjs/components/Accordion/AccordionPanel/AccordionPanel.cjs.map +1 -1
- package/cjs/components/ActionBar/ActionBar.cjs +94 -0
- package/cjs/components/ActionBar/ActionBar.cjs.map +1 -0
- package/cjs/components/ActionBar/ActionBar.context.cjs +8 -0
- package/cjs/components/ActionBar/ActionBar.context.cjs.map +1 -0
- package/cjs/components/ActionBar/ActionBar.module.cjs +10 -0
- package/cjs/components/ActionBar/ActionBar.module.cjs.map +1 -0
- package/cjs/components/ActionBar/ActionBarCloseButton/ActionBarCloseButton.cjs +33 -0
- package/cjs/components/ActionBar/ActionBarCloseButton/ActionBarCloseButton.cjs.map +1 -0
- package/cjs/components/ActionBar/ActionBarDivider/ActionBarDivider.cjs +30 -0
- package/cjs/components/ActionBar/ActionBarDivider/ActionBarDivider.cjs.map +1 -0
- package/cjs/components/ActionIcon/ActionIcon.cjs.map +1 -1
- package/cjs/components/ActionIcon/ActionIconGroup/ActionIconGroup.cjs +16 -15
- package/cjs/components/ActionIcon/ActionIconGroup/ActionIconGroup.cjs.map +1 -1
- package/cjs/components/ActionIcon/ActionIconGroupSection/ActionIconGroupSection.cjs +15 -14
- package/cjs/components/ActionIcon/ActionIconGroupSection/ActionIconGroupSection.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 +5 -4
- package/cjs/components/AngleSlider/AngleSlider.cjs.map +1 -1
- package/cjs/components/AppShell/AppShell.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellAside/AppShellAside.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellFooter/AppShellFooter.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellHeader/AppShellHeader.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellMain/AppShellMain.cjs +2 -1
- package/cjs/components/AppShell/AppShellMain/AppShellMain.cjs.map +1 -1
- package/cjs/components/AppShell/use-resizing/use-resizing.cjs.map +1 -1
- package/cjs/components/AspectRatio/AspectRatio.cjs +14 -13
- package/cjs/components/AspectRatio/AspectRatio.cjs.map +1 -1
- package/cjs/components/Autocomplete/Autocomplete.cjs.map +1 -1
- package/cjs/components/Avatar/Avatar.cjs.map +1 -1
- package/cjs/components/Avatar/AvatarGroup/AvatarGroup.cjs.map +1 -1
- package/cjs/components/Avatar/AvatarPlaceholderIcon.cjs.map +1 -1
- package/cjs/components/BackgroundImage/BackgroundImage.cjs +14 -13
- package/cjs/components/BackgroundImage/BackgroundImage.cjs.map +1 -1
- package/cjs/components/Badge/Badge.cjs.map +1 -1
- package/cjs/components/Blockquote/Blockquote.cjs +6 -5
- 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/Button/ButtonGroup/ButtonGroup.cjs +16 -15
- package/cjs/components/Button/ButtonGroup/ButtonGroup.cjs.map +1 -1
- package/cjs/components/Button/ButtonGroupSection/ButtonGroupSection.cjs +15 -14
- package/cjs/components/Button/ButtonGroupSection/ButtonGroupSection.cjs.map +1 -1
- package/cjs/components/Card/Card.cjs.map +1 -1
- package/cjs/components/Cascader/Cascader.cjs +5 -4
- package/cjs/components/Cascader/Cascader.cjs.map +1 -1
- package/cjs/components/Cascader/CascaderColumns.cjs +2 -1
- package/cjs/components/Cascader/CascaderColumns.cjs.map +1 -1
- package/cjs/components/Cascader/get-cascader-columns.cjs.map +1 -1
- package/cjs/components/Cascader/use-cascader-safe-area.cjs.map +1 -1
- package/cjs/components/Cascader/use-cascader.cjs.map +1 -1
- package/cjs/components/Checkbox/CheckIcon.cjs +6 -5
- package/cjs/components/Checkbox/CheckIcon.cjs.map +1 -1
- package/cjs/components/Checkbox/Checkbox.cjs +1 -1
- package/cjs/components/Checkbox/Checkbox.cjs.map +1 -1
- package/cjs/components/Checkbox/CheckboxCard/CheckboxCard.cjs +2 -1
- package/cjs/components/Checkbox/CheckboxCard/CheckboxCard.cjs.map +1 -1
- package/cjs/components/Checkbox/CheckboxGroup/CheckboxGroup.cjs.map +1 -1
- package/cjs/components/Checkbox/CheckboxIndicator/CheckboxIndicator.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/CloseButton/CloseIcon.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/ColorInput/EyeDropperIcon.cjs.map +1 -1
- package/cjs/components/ColorPicker/ColorPicker.cjs.map +1 -1
- package/cjs/components/ColorPicker/ColorPicker.context.cjs.map +1 -1
- package/cjs/components/ColorPicker/ColorSlider/ColorSlider.cjs +4 -6
- package/cjs/components/ColorPicker/ColorSlider/ColorSlider.cjs.map +1 -1
- package/cjs/components/ColorPicker/Saturation/Saturation.cjs +4 -6
- package/cjs/components/ColorPicker/Saturation/Saturation.cjs.map +1 -1
- package/cjs/components/ColorPicker/Swatches/Swatches.cjs.map +1 -1
- package/cjs/components/ColorSwatch/ColorSwatch.cjs.map +1 -1
- package/cjs/components/Combobox/Combobox.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxChevron/ComboboxChevron.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxEmpty/ComboboxEmpty.cjs +2 -1
- package/cjs/components/Combobox/ComboboxEmpty/ComboboxEmpty.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxEventsTarget/ComboboxEventsTarget.cjs +10 -9
- package/cjs/components/Combobox/ComboboxEventsTarget/ComboboxEventsTarget.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxFooter/ComboboxFooter.cjs +2 -1
- package/cjs/components/Combobox/ComboboxFooter/ComboboxFooter.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxGroup/ComboboxGroup.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxHeader/ComboboxHeader.cjs +2 -1
- package/cjs/components/Combobox/ComboboxHeader/ComboboxHeader.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxOption/ComboboxOption.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxOptions/ComboboxOptions.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxSearch/ComboboxSearch.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxTarget/ComboboxTarget.cjs +10 -9
- package/cjs/components/Combobox/ComboboxTarget/ComboboxTarget.cjs.map +1 -1
- package/cjs/components/Combobox/OptionsDropdown/OptionsDropdown.cjs.map +1 -1
- package/cjs/components/Combobox/OptionsDropdown/default-options-filter.cjs.map +1 -1
- package/cjs/components/Combobox/use-combobox/get-index/get-index.cjs.map +1 -1
- package/cjs/components/Combobox/use-combobox/get-index/get-virtualized-index.cjs.map +1 -1
- package/cjs/components/Combobox/use-combobox/use-combobox.cjs.map +1 -1
- package/cjs/components/Combobox/use-combobox/use-virtualized-combobox.cjs.map +1 -1
- package/cjs/components/Combobox/use-combobox-target-props/use-combobox-target-props.cjs.map +1 -1
- package/cjs/components/Combobox/use-pills-reorder/use-pills-reorder.cjs.map +1 -1
- package/cjs/components/ComboboxPopover/ComboboxPopover.cjs.map +1 -1
- package/cjs/components/ComboboxPopover/ComboboxPopoverTarget.cjs +13 -12
- package/cjs/components/ComboboxPopover/ComboboxPopoverTarget.cjs.map +1 -1
- package/cjs/components/CopyButton/CopyButton.cjs.map +1 -1
- package/cjs/components/DataList/DataList.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/Drawer/Drawer.cjs.map +1 -1
- package/cjs/components/Drawer/DrawerBody.cjs +2 -1
- package/cjs/components/Drawer/DrawerBody.cjs.map +1 -1
- package/cjs/components/Drawer/DrawerCloseButton.cjs +2 -1
- package/cjs/components/Drawer/DrawerCloseButton.cjs.map +1 -1
- package/cjs/components/Drawer/DrawerContent.cjs.map +1 -1
- package/cjs/components/Drawer/DrawerHeader.cjs +2 -1
- package/cjs/components/Drawer/DrawerHeader.cjs.map +1 -1
- package/cjs/components/Drawer/DrawerOverlay.cjs +2 -1
- package/cjs/components/Drawer/DrawerOverlay.cjs.map +1 -1
- package/cjs/components/Drawer/DrawerRoot.cjs.map +1 -1
- package/cjs/components/Drawer/DrawerStack.cjs.map +1 -1
- package/cjs/components/Drawer/DrawerTitle.cjs +2 -1
- package/cjs/components/Drawer/DrawerTitle.cjs.map +1 -1
- package/cjs/components/EmptyState/EmptyState.cjs.map +1 -1
- package/cjs/components/EmptyState/EmptyStateActions/EmptyStateActions.cjs +2 -1
- package/cjs/components/EmptyState/EmptyStateActions/EmptyStateActions.cjs.map +1 -1
- package/cjs/components/EmptyState/EmptyStateDescription/EmptyStateDescription.cjs +2 -1
- package/cjs/components/EmptyState/EmptyStateDescription/EmptyStateDescription.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/FloatingIndicator/FloatingIndicator.cjs.map +1 -1
- package/cjs/components/FloatingIndicator/use-floating-indicator.cjs.map +1 -1
- package/cjs/components/FloatingWindow/FloatingWindow.cjs.map +1 -1
- package/cjs/components/FloatingWindow/FloatingWindowResizeHandle.cjs.map +1 -1
- package/cjs/components/FocusTrap/FocusTrap.cjs +2 -1
- package/cjs/components/FocusTrap/FocusTrap.cjs.map +1 -1
- package/cjs/components/Grid/Grid.cjs.map +1 -1
- package/cjs/components/Grid/GridCol/GridCol.cjs.map +1 -1
- package/cjs/components/Group/Group.cjs +16 -14
- package/cjs/components/Group/Group.cjs.map +1 -1
- package/cjs/components/Highlight/Highlight.cjs.map +1 -1
- package/cjs/components/HoverCard/HoverCard.cjs.map +1 -1
- package/cjs/components/HoverCard/HoverCardDropdown/HoverCardDropdown.cjs.map +1 -1
- package/cjs/components/HoverCard/HoverCardGroup/HoverCardGroup.cjs.map +1 -1
- package/cjs/components/HoverCard/HoverCardTarget/HoverCardTarget.cjs.map +1 -1
- package/cjs/components/HoverCard/use-hover-card.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 -3
- package/cjs/components/Input/Input.cjs.map +1 -1
- package/cjs/components/Input/Input.context.cjs.map +1 -1
- package/cjs/components/Input/InputClearButton/InputClearButton.cjs.map +1 -1
- package/cjs/components/Input/InputClearSection/InputClearSection.cjs.map +1 -1
- package/cjs/components/Input/InputDescription/InputDescription.cjs +2 -1
- package/cjs/components/Input/InputDescription/InputDescription.cjs.map +1 -1
- package/cjs/components/Input/InputError/InputError.cjs +2 -1
- package/cjs/components/Input/InputError/InputError.cjs.map +1 -1
- package/cjs/components/Input/InputLabel/InputLabel.cjs.map +1 -1
- package/cjs/components/Input/InputPlaceholder/InputPlaceholder.cjs +13 -12
- package/cjs/components/Input/InputPlaceholder/InputPlaceholder.cjs.map +1 -1
- package/cjs/components/Input/InputSuccess/InputSuccess.cjs +2 -1
- package/cjs/components/Input/InputSuccess/InputSuccess.cjs.map +1 -1
- package/cjs/components/Input/InputWrapper/InputWrapper.cjs.map +1 -1
- package/cjs/components/Input/InputWrapper.context.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 +14 -13
- package/cjs/components/Kbd/Kbd.cjs.map +1 -1
- package/cjs/components/List/List.cjs.map +1 -1
- package/cjs/components/List/ListItem/ListItem.cjs.map +1 -1
- package/cjs/components/Loader/loaders/Bars.cjs.map +1 -1
- package/cjs/components/Loader/loaders/Dots.cjs.map +1 -1
- package/cjs/components/Loader/loaders/Oval.cjs.map +1 -1
- package/cjs/components/LoadingOverlay/LoadingOverlay.cjs.map +1 -1
- package/cjs/components/Mark/Mark.cjs +14 -13
- package/cjs/components/Mark/Mark.cjs.map +1 -1
- package/cjs/components/Marquee/Marquee.cjs.map +1 -1
- package/cjs/components/MaskInput/MaskInput.cjs +3 -2
- package/cjs/components/MaskInput/MaskInput.cjs.map +1 -1
- package/cjs/components/MaskInput/use-mask-input-props.cjs.map +1 -1
- package/cjs/components/Menu/Menu.cjs.map +1 -1
- package/cjs/components/Menu/MenuCheckboxGroup/MenuCheckboxGroup.cjs +4 -3
- package/cjs/components/Menu/MenuCheckboxGroup/MenuCheckboxGroup.cjs.map +1 -1
- package/cjs/components/Menu/MenuCheckboxGroup/MenuCheckboxGroup.context.cjs.map +1 -1
- package/cjs/components/Menu/MenuCheckboxItem/MenuCheckboxItem.cjs +2 -1
- package/cjs/components/Menu/MenuCheckboxItem/MenuCheckboxItem.cjs.map +1 -1
- package/cjs/components/Menu/MenuContextMenu/MenuContextMenu.cjs +3 -2
- package/cjs/components/Menu/MenuContextMenu/MenuContextMenu.cjs.map +1 -1
- package/cjs/components/Menu/MenuDivider/MenuDivider.cjs +2 -1
- package/cjs/components/Menu/MenuDivider/MenuDivider.cjs.map +1 -1
- package/cjs/components/Menu/MenuDropdown/MenuDropdown.cjs.map +1 -1
- package/cjs/components/Menu/MenuItem/MenuItem.cjs.map +1 -1
- package/cjs/components/Menu/MenuLabel/MenuLabel.cjs +2 -1
- package/cjs/components/Menu/MenuLabel/MenuLabel.cjs.map +1 -1
- package/cjs/components/Menu/MenuRadioGroup/MenuRadioGroup.cjs.map +1 -1
- package/cjs/components/Menu/MenuRadioGroup/MenuRadioGroup.context.cjs.map +1 -1
- package/cjs/components/Menu/MenuRadioItem/MenuRadioItem.cjs +2 -1
- package/cjs/components/Menu/MenuRadioItem/MenuRadioItem.cjs.map +1 -1
- package/cjs/components/Menu/MenuSearch/MenuSearch.cjs.map +1 -1
- package/cjs/components/Menu/MenuSelectableItem/MenuSelectableItem.cjs.map +1 -1
- package/cjs/components/Menu/MenuSub/MenuSub.cjs.map +1 -1
- package/cjs/components/Menu/MenuSub/MenuSub.context.cjs.map +1 -1
- package/cjs/components/Menu/MenuSubDropdown/MenuSubDropdown.cjs.map +1 -1
- package/cjs/components/Menu/MenuSubItem/MenuSubItem.cjs.map +1 -1
- package/cjs/components/Menu/MenuTarget/MenuTarget.cjs.map +1 -1
- package/cjs/components/Menu/use-menu-type-ahead.cjs.map +1 -1
- package/cjs/components/Menubar/Menubar.cjs.map +1 -1
- package/cjs/components/Menubar/MenubarMenu/MenubarMenu.cjs.map +1 -1
- package/cjs/components/Menubar/MenubarTarget/MenubarTarget.cjs.map +1 -1
- package/cjs/components/Modal/Modal.cjs.map +1 -1
- package/cjs/components/Modal/ModalBody.cjs +2 -1
- package/cjs/components/Modal/ModalBody.cjs.map +1 -1
- package/cjs/components/Modal/ModalCloseButton.cjs +2 -1
- package/cjs/components/Modal/ModalCloseButton.cjs.map +1 -1
- package/cjs/components/Modal/ModalContent.cjs.map +1 -1
- package/cjs/components/Modal/ModalHeader.cjs +2 -1
- package/cjs/components/Modal/ModalHeader.cjs.map +1 -1
- package/cjs/components/Modal/ModalOverlay.cjs +2 -1
- package/cjs/components/Modal/ModalOverlay.cjs.map +1 -1
- package/cjs/components/Modal/ModalRoot.cjs.map +1 -1
- package/cjs/components/Modal/ModalStack.cjs.map +1 -1
- package/cjs/components/Modal/ModalTitle.cjs +2 -1
- package/cjs/components/Modal/ModalTitle.cjs.map +1 -1
- package/cjs/components/Modal/use-modals-stack.cjs.map +1 -1
- package/cjs/components/ModalBase/ModalBase.cjs.map +1 -1
- package/cjs/components/ModalBase/ModalBaseBody.cjs.map +1 -1
- package/cjs/components/ModalBase/ModalBaseCloseButton.cjs.map +1 -1
- package/cjs/components/ModalBase/ModalBaseContent.cjs.map +1 -1
- package/cjs/components/ModalBase/ModalBaseHeader.cjs.map +1 -1
- package/cjs/components/ModalBase/ModalBaseOverlay.cjs.map +1 -1
- package/cjs/components/ModalBase/ModalBaseTitle.cjs.map +1 -1
- package/cjs/components/ModalBase/use-lock-scroll.cjs.map +1 -1
- package/cjs/components/ModalBase/use-modal.cjs +2 -1
- package/cjs/components/ModalBase/use-modal.cjs.map +1 -1
- package/cjs/components/MultiSelect/MultiSelect.cjs.map +1 -1
- package/cjs/components/NativeSelect/NativeSelect.cjs.map +1 -1
- package/cjs/components/NativeSelect/NativeSelectOption.cjs.map +1 -1
- package/cjs/components/NavLink/NavLink.cjs.map +1 -1
- package/cjs/components/Notification/Notification.cjs +3 -3
- package/cjs/components/Notification/Notification.cjs.map +1 -1
- package/cjs/components/NumberInput/NumberInput.cjs +5 -3
- package/cjs/components/NumberInput/NumberInput.cjs.map +1 -1
- package/cjs/components/NumberInput/NumberInputChevron.cjs.map +1 -1
- package/cjs/components/OverflowList/OverflowList.cjs +4 -2
- package/cjs/components/OverflowList/OverflowList.cjs.map +1 -1
- package/cjs/components/OverflowList/use-dimensions.cjs.map +1 -1
- package/cjs/components/Overlay/Overlay.cjs +14 -13
- package/cjs/components/Overlay/Overlay.cjs.map +1 -1
- package/cjs/components/Pagination/Pagination.cjs +2 -1
- package/cjs/components/Pagination/Pagination.cjs.map +1 -1
- package/cjs/components/Pagination/Pagination.icons.cjs.map +1 -1
- package/cjs/components/Pagination/PaginationDots/PaginationDots.cjs +2 -1
- package/cjs/components/Pagination/PaginationDots/PaginationDots.cjs.map +1 -1
- package/cjs/components/Pagination/PaginationEdges/PaginationEdges.cjs.map +1 -1
- package/cjs/components/Pagination/PaginationItems/PaginationItems.cjs +3 -2
- package/cjs/components/Pagination/PaginationItems/PaginationItems.cjs.map +1 -1
- package/cjs/components/Pagination/PaginationLabel/PaginationLabel.cjs.map +1 -1
- package/cjs/components/Pagination/PaginationRoot/PaginationRoot.cjs.map +1 -1
- package/cjs/components/Paper/Paper.cjs +1 -1
- package/cjs/components/Paper/Paper.cjs.map +1 -1
- package/cjs/components/PasswordInput/PasswordInput.cjs.map +1 -1
- package/cjs/components/PasswordInput/PasswordToggleIcon.cjs.map +1 -1
- package/cjs/components/Pill/Pill.cjs.map +1 -1
- package/cjs/components/Pill/PillGroup/PillGroup.cjs.map +1 -1
- package/cjs/components/PillsInput/PillsInput.cjs.map +1 -1
- package/cjs/components/PillsInput/PillsInput.context.cjs.map +1 -1
- package/cjs/components/PillsInput/PillsInputField/PillsInputField.cjs.map +1 -1
- package/cjs/components/PinInput/PinInput.cjs +6 -5
- package/cjs/components/PinInput/PinInput.cjs.map +1 -1
- package/cjs/components/Popover/Popover.cjs.map +1 -1
- package/cjs/components/Popover/PopoverContextMenu/PopoverContextMenu.cjs +3 -2
- package/cjs/components/Popover/PopoverContextMenu/PopoverContextMenu.cjs.map +1 -1
- package/cjs/components/Popover/PopoverDropdown/PopoverDropdown.cjs.map +1 -1
- package/cjs/components/Popover/PopoverTarget/PopoverTarget.cjs.map +1 -1
- package/cjs/components/Popover/use-popover.cjs +16 -12
- package/cjs/components/Popover/use-popover.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/Progress/ProgressLabel/ProgressLabel.cjs +2 -1
- package/cjs/components/Progress/ProgressLabel/ProgressLabel.cjs.map +1 -1
- package/cjs/components/Progress/ProgressRoot/ProgressRoot.cjs.map +1 -1
- package/cjs/components/Radio/Radio.cjs.map +1 -1
- package/cjs/components/Radio/RadioCard/RadioCard.cjs.map +1 -1
- package/cjs/components/Radio/RadioGroup/RadioGroup.cjs.map +1 -1
- package/cjs/components/Radio/RadioIcon.cjs.map +1 -1
- package/cjs/components/Radio/RadioIndicator/RadioIndicator.cjs.map +1 -1
- package/cjs/components/Rating/Rating.cjs +6 -3
- package/cjs/components/Rating/Rating.cjs.map +1 -1
- package/cjs/components/Rating/RatingItem/RatingItem.cjs.map +1 -1
- package/cjs/components/Rating/StarSymbol/StarIcon.cjs.map +1 -1
- package/cjs/components/Rating/StarSymbol/StarSymbol.cjs +2 -1
- package/cjs/components/Rating/StarSymbol/StarSymbol.cjs.map +1 -1
- package/cjs/components/RingProgress/Curve/Curve.cjs.map +1 -1
- package/cjs/components/RingProgress/RingProgress.cjs.map +1 -1
- package/cjs/components/RollingNumber/DigitColumn.cjs.map +1 -1
- package/cjs/components/RollingNumber/RollingNumber.cjs +12 -10
- package/cjs/components/RollingNumber/RollingNumber.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollArea.cjs +8 -6
- package/cjs/components/ScrollArea/ScrollArea.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaCorner/ScrollAreaCorner.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarAuto.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarHover.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarScroll.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarVisible.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollbarX.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaScrollbar/ScrollbarY.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.cjs.map +1 -1
- package/cjs/components/ScrollArea/use-resize-observer.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.map +1 -1
- package/cjs/components/SemiCircleProgress/SemiCircleProgress.cjs.map +1 -1
- package/cjs/components/SimpleGrid/SimpleGrid.cjs.map +1 -1
- package/cjs/components/SimpleGrid/SimpleGridVariables.cjs +10 -8
- package/cjs/components/SimpleGrid/SimpleGridVariables.cjs.map +1 -1
- package/cjs/components/Skeleton/Skeleton.cjs +14 -13
- package/cjs/components/Skeleton/Skeleton.cjs.map +1 -1
- package/cjs/components/Slider/Marks/Marks.cjs +3 -2
- package/cjs/components/Slider/Marks/Marks.cjs.map +1 -1
- package/cjs/components/Slider/RangeSlider/RangeSlider.cjs +20 -11
- package/cjs/components/Slider/RangeSlider/RangeSlider.cjs.map +1 -1
- package/cjs/components/Slider/Slider/Slider.cjs +6 -6
- package/cjs/components/Slider/Slider/Slider.cjs.map +1 -1
- package/cjs/components/Slider/Thumb/Thumb.cjs.map +1 -1
- package/cjs/components/Slider/Track/Track.cjs.map +1 -1
- package/cjs/components/Splitter/GripIcon.cjs.map +1 -1
- package/cjs/components/Splitter/Splitter.cjs +8 -7
- package/cjs/components/Splitter/Splitter.cjs.map +1 -1
- package/cjs/components/Spoiler/Spoiler.cjs.map +1 -1
- package/cjs/components/Stack/Stack.cjs +14 -13
- package/cjs/components/Stack/Stack.cjs.map +1 -1
- package/cjs/components/Stepper/Stepper.cjs +6 -3
- package/cjs/components/Stepper/Stepper.cjs.map +1 -1
- package/cjs/components/Stepper/Stepper.context.cjs.map +1 -1
- package/cjs/components/Stepper/Stepper.module.cjs.map +1 -1
- package/cjs/components/Stepper/StepperStep/StepperStep.cjs +3 -2
- package/cjs/components/Stepper/StepperStep/StepperStep.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 +2 -2
- package/cjs/components/Table/Table.cjs.map +1 -1
- package/cjs/components/Table/TableScrollContainer.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/Tabs/TabsPanel/TabsPanel.cjs.map +1 -1
- package/cjs/components/Tabs/TabsTab/TabsTab.cjs.map +1 -1
- package/cjs/components/TagsInput/TagsInput.cjs.map +1 -1
- package/cjs/components/Text/Text.cjs +18 -17
- package/cjs/components/Text/Text.cjs.map +1 -1
- package/cjs/components/TextInput/TextInput.cjs +6 -5
- package/cjs/components/TextInput/TextInput.cjs.map +1 -1
- package/cjs/components/Textarea/Autosize.cjs.map +1 -1
- package/cjs/components/ThemeIcon/ThemeIcon.cjs +14 -13
- package/cjs/components/ThemeIcon/ThemeIcon.cjs.map +1 -1
- package/cjs/components/Timeline/Timeline.cjs.map +1 -1
- package/cjs/components/Timeline/TimelineItem/TimelineItem.cjs.map +1 -1
- package/cjs/components/Title/Title.cjs +1 -1
- package/cjs/components/Title/Title.cjs.map +1 -1
- package/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
- package/cjs/components/Tooltip/TooltipFloating/TooltipFloating.cjs.map +1 -1
- package/cjs/components/Tooltip/TooltipFloating/use-floating-tooltip.cjs.map +1 -1
- package/cjs/components/Tooltip/TooltipGroup/TooltipGroup.cjs.map +1 -1
- package/cjs/components/Tooltip/use-tooltip.cjs.map +1 -1
- package/cjs/components/Transition/Transition.cjs.map +1 -1
- package/cjs/components/Transition/use-transition.cjs.map +1 -1
- package/cjs/components/Tree/FlatTreeNode.cjs.map +1 -1
- package/cjs/components/Tree/Tree.cjs +2 -1
- package/cjs/components/Tree/Tree.cjs.map +1 -1
- package/cjs/components/Tree/TreeNode.cjs.map +1 -1
- package/cjs/components/Tree/use-tree-node-drag-drop.cjs.map +1 -1
- package/cjs/components/Tree/use-tree.cjs.map +1 -1
- package/cjs/components/TreeSelect/TreeSelect.cjs +11 -9
- package/cjs/components/TreeSelect/TreeSelect.cjs.map +1 -1
- package/cjs/components/TreeSelect/TreeSelectOption.cjs.map +1 -1
- package/cjs/components/Typography/Typography.cjs +12 -11
- package/cjs/components/Typography/Typography.cjs.map +1 -1
- package/cjs/components/Typography/Typography.module.cjs.map +1 -1
- package/cjs/components/UnstyledButton/UnstyledButton.cjs +12 -11
- package/cjs/components/UnstyledButton/UnstyledButton.cjs.map +1 -1
- package/cjs/components/VisuallyHidden/VisuallyHidden.cjs +12 -11
- package/cjs/components/VisuallyHidden/VisuallyHidden.cjs.map +1 -1
- package/cjs/core/Box/Box.cjs.map +1 -1
- package/cjs/core/Box/use-random-classname/use-random-classname.cjs.map +1 -1
- package/cjs/core/DirectionProvider/DirectionProvider.cjs +3 -2
- package/cjs/core/DirectionProvider/DirectionProvider.cjs.map +1 -1
- package/cjs/core/InlineStyles/InlineStyles.cjs.map +1 -1
- package/cjs/core/MantineProvider/Mantine.context.cjs.map +1 -1
- package/cjs/core/MantineProvider/MantineCssVariables/MantineCssVariables.cjs +4 -2
- package/cjs/core/MantineProvider/MantineCssVariables/MantineCssVariables.cjs.map +1 -1
- package/cjs/core/MantineProvider/MantineProvider.cjs +3 -3
- package/cjs/core/MantineProvider/MantineProvider.cjs.map +1 -1
- package/cjs/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs.map +1 -1
- package/cjs/core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.cjs.map +1 -1
- package/cjs/core/MantineProvider/merge-mantine-theme/merge-mantine-theme.cjs.map +1 -1
- package/cjs/core/MantineProvider/use-mantine-color-scheme/use-computed-color-scheme.cjs.map +1 -1
- package/cjs/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.cjs +2 -1
- package/cjs/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.cjs.map +1 -1
- package/cjs/core/MantineProvider/use-mantine-color-scheme/use-provider-color-scheme.cjs.map +1 -1
- package/cjs/core/MantineProvider/use-matches/use-matches.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/get-class-name/get-class-name.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/get-class-name/get-global-class-names/get-global-class-names.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/get-class-name/resolve-class-names/resolve-class-names.cjs.map +1 -1
- package/cjs/core/utils/create-safe-context/create-safe-context.cjs.map +1 -1
- package/cjs/core/utils/create-scoped-keydown-handler/create-scoped-keydown-handler.cjs +0 -1
- package/cjs/core/utils/create-scoped-keydown-handler/create-scoped-keydown-handler.cjs.map +1 -1
- package/cjs/core/utils/deep-merge/deep-merge.cjs +4 -3
- package/cjs/core/utils/deep-merge/deep-merge.cjs.map +1 -1
- package/cjs/core/utils/use-hovered/use-hovered.cjs.map +1 -1
- package/cjs/index.cjs +6 -0
- package/cjs/utils/Floating/use-context-menu-handlers.cjs.map +1 -1
- package/cjs/utils/Floating/use-delayed-hover.cjs.map +1 -1
- package/cjs/utils/InlineInput/InlineInput.cjs.map +1 -1
- package/cjs/utils/InputsGroupFieldset/InputsGroupFieldset.cjs.map +1 -1
- package/esm/components/Accordion/Accordion.mjs.map +1 -1
- package/esm/components/Accordion/AccordionChevron.mjs.map +1 -1
- package/esm/components/Accordion/AccordionControl/AccordionControl.mjs.map +1 -1
- package/esm/components/Accordion/AccordionItem/AccordionItem.mjs.map +1 -1
- package/esm/components/Accordion/AccordionPanel/AccordionPanel.mjs.map +1 -1
- package/esm/components/ActionBar/ActionBar.context.mjs +8 -0
- package/esm/components/ActionBar/ActionBar.context.mjs.map +1 -0
- package/esm/components/ActionBar/ActionBar.mjs +94 -0
- package/esm/components/ActionBar/ActionBar.mjs.map +1 -0
- package/esm/components/ActionBar/ActionBar.module.mjs +10 -0
- package/esm/components/ActionBar/ActionBar.module.mjs.map +1 -0
- package/esm/components/ActionBar/ActionBarCloseButton/ActionBarCloseButton.mjs +33 -0
- package/esm/components/ActionBar/ActionBarCloseButton/ActionBarCloseButton.mjs.map +1 -0
- package/esm/components/ActionBar/ActionBarDivider/ActionBarDivider.mjs +30 -0
- package/esm/components/ActionBar/ActionBarDivider/ActionBarDivider.mjs.map +1 -0
- package/esm/components/ActionIcon/ActionIcon.mjs.map +1 -1
- package/esm/components/ActionIcon/ActionIconGroup/ActionIconGroup.mjs +16 -15
- package/esm/components/ActionIcon/ActionIconGroup/ActionIconGroup.mjs.map +1 -1
- package/esm/components/ActionIcon/ActionIconGroupSection/ActionIconGroupSection.mjs +15 -14
- package/esm/components/ActionIcon/ActionIconGroupSection/ActionIconGroupSection.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/AngleSlider/AngleSlider.mjs +5 -4
- package/esm/components/AngleSlider/AngleSlider.mjs.map +1 -1
- package/esm/components/AppShell/AppShell.mjs.map +1 -1
- package/esm/components/AppShell/AppShellMain/AppShellMain.mjs +2 -1
- package/esm/components/AppShell/AppShellMain/AppShellMain.mjs.map +1 -1
- package/esm/components/AspectRatio/AspectRatio.mjs +14 -13
- package/esm/components/AspectRatio/AspectRatio.mjs.map +1 -1
- package/esm/components/Autocomplete/Autocomplete.mjs.map +1 -1
- package/esm/components/Avatar/Avatar.mjs.map +1 -1
- package/esm/components/Avatar/AvatarGroup/AvatarGroup.mjs.map +1 -1
- package/esm/components/Avatar/AvatarPlaceholderIcon.mjs.map +1 -1
- package/esm/components/BackgroundImage/BackgroundImage.mjs +14 -13
- package/esm/components/BackgroundImage/BackgroundImage.mjs.map +1 -1
- package/esm/components/Badge/Badge.mjs.map +1 -1
- package/esm/components/Blockquote/Blockquote.mjs +6 -5
- 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/Button/ButtonGroup/ButtonGroup.mjs +16 -15
- package/esm/components/Button/ButtonGroup/ButtonGroup.mjs.map +1 -1
- package/esm/components/Button/ButtonGroupSection/ButtonGroupSection.mjs +15 -14
- package/esm/components/Button/ButtonGroupSection/ButtonGroupSection.mjs.map +1 -1
- package/esm/components/Card/Card.mjs.map +1 -1
- package/esm/components/Cascader/Cascader.mjs +5 -4
- package/esm/components/Cascader/Cascader.mjs.map +1 -1
- package/esm/components/Cascader/CascaderColumns.mjs +2 -1
- package/esm/components/Cascader/CascaderColumns.mjs.map +1 -1
- package/esm/components/Cascader/get-cascader-columns.mjs.map +1 -1
- package/esm/components/Checkbox/CheckIcon.mjs +6 -5
- package/esm/components/Checkbox/CheckIcon.mjs.map +1 -1
- package/esm/components/Checkbox/Checkbox.mjs +1 -1
- package/esm/components/Checkbox/Checkbox.mjs.map +1 -1
- package/esm/components/Checkbox/CheckboxCard/CheckboxCard.mjs +2 -1
- package/esm/components/Checkbox/CheckboxCard/CheckboxCard.mjs.map +1 -1
- package/esm/components/Checkbox/CheckboxGroup/CheckboxGroup.mjs.map +1 -1
- package/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.mjs.map +1 -1
- package/esm/components/Chip/Chip.mjs.map +1 -1
- package/esm/components/CloseButton/CloseButton.mjs.map +1 -1
- package/esm/components/CloseButton/CloseIcon.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/ColorInput/EyeDropperIcon.mjs.map +1 -1
- package/esm/components/ColorPicker/ColorPicker.mjs.map +1 -1
- package/esm/components/ColorPicker/ColorSlider/ColorSlider.mjs +4 -6
- package/esm/components/ColorPicker/ColorSlider/ColorSlider.mjs.map +1 -1
- package/esm/components/ColorPicker/Saturation/Saturation.mjs +4 -6
- package/esm/components/ColorPicker/Saturation/Saturation.mjs.map +1 -1
- package/esm/components/ColorPicker/Swatches/Swatches.mjs.map +1 -1
- package/esm/components/ColorSwatch/ColorSwatch.mjs.map +1 -1
- package/esm/components/Combobox/Combobox.mjs.map +1 -1
- package/esm/components/Combobox/ComboboxChevron/ComboboxChevron.mjs.map +1 -1
- package/esm/components/Combobox/ComboboxEmpty/ComboboxEmpty.mjs +2 -1
- package/esm/components/Combobox/ComboboxEmpty/ComboboxEmpty.mjs.map +1 -1
- package/esm/components/Combobox/ComboboxEventsTarget/ComboboxEventsTarget.mjs +10 -9
- package/esm/components/Combobox/ComboboxEventsTarget/ComboboxEventsTarget.mjs.map +1 -1
- package/esm/components/Combobox/ComboboxFooter/ComboboxFooter.mjs +2 -1
- package/esm/components/Combobox/ComboboxFooter/ComboboxFooter.mjs.map +1 -1
- package/esm/components/Combobox/ComboboxGroup/ComboboxGroup.mjs.map +1 -1
- package/esm/components/Combobox/ComboboxHeader/ComboboxHeader.mjs +2 -1
- package/esm/components/Combobox/ComboboxHeader/ComboboxHeader.mjs.map +1 -1
- package/esm/components/Combobox/ComboboxTarget/ComboboxTarget.mjs +10 -9
- package/esm/components/Combobox/ComboboxTarget/ComboboxTarget.mjs.map +1 -1
- package/esm/components/Combobox/OptionsDropdown/OptionsDropdown.mjs.map +1 -1
- package/esm/components/Combobox/OptionsDropdown/default-options-filter.mjs.map +1 -1
- package/esm/components/Combobox/use-combobox/get-index/get-index.mjs.map +1 -1
- package/esm/components/Combobox/use-combobox/get-index/get-virtualized-index.mjs.map +1 -1
- package/esm/components/Combobox/use-combobox-target-props/use-combobox-target-props.mjs.map +1 -1
- package/esm/components/ComboboxPopover/ComboboxPopover.mjs.map +1 -1
- package/esm/components/ComboboxPopover/ComboboxPopoverTarget.mjs +13 -12
- package/esm/components/ComboboxPopover/ComboboxPopoverTarget.mjs.map +1 -1
- package/esm/components/DataList/DataList.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/Drawer/Drawer.mjs.map +1 -1
- package/esm/components/Drawer/DrawerBody.mjs +2 -1
- package/esm/components/Drawer/DrawerBody.mjs.map +1 -1
- package/esm/components/Drawer/DrawerCloseButton.mjs +2 -1
- package/esm/components/Drawer/DrawerCloseButton.mjs.map +1 -1
- package/esm/components/Drawer/DrawerContent.mjs.map +1 -1
- package/esm/components/Drawer/DrawerHeader.mjs +2 -1
- package/esm/components/Drawer/DrawerHeader.mjs.map +1 -1
- package/esm/components/Drawer/DrawerOverlay.mjs +2 -1
- package/esm/components/Drawer/DrawerOverlay.mjs.map +1 -1
- package/esm/components/Drawer/DrawerRoot.mjs.map +1 -1
- package/esm/components/Drawer/DrawerTitle.mjs +2 -1
- package/esm/components/Drawer/DrawerTitle.mjs.map +1 -1
- package/esm/components/EmptyState/EmptyState.mjs.map +1 -1
- package/esm/components/EmptyState/EmptyStateActions/EmptyStateActions.mjs +2 -1
- package/esm/components/EmptyState/EmptyStateActions/EmptyStateActions.mjs.map +1 -1
- package/esm/components/EmptyState/EmptyStateDescription/EmptyStateDescription.mjs +2 -1
- package/esm/components/EmptyState/EmptyStateDescription/EmptyStateDescription.mjs.map +1 -1
- package/esm/components/Fieldset/Fieldset.mjs.map +1 -1
- package/esm/components/FileInput/FileInput.mjs.map +1 -1
- package/esm/components/FloatingWindow/FloatingWindow.mjs.map +1 -1
- package/esm/components/FocusTrap/FocusTrap.mjs +2 -1
- package/esm/components/FocusTrap/FocusTrap.mjs.map +1 -1
- package/esm/components/Grid/Grid.mjs.map +1 -1
- package/esm/components/Group/Group.mjs +16 -14
- package/esm/components/Group/Group.mjs.map +1 -1
- package/esm/components/Highlight/Highlight.mjs.map +1 -1
- package/esm/components/HoverCard/HoverCard.mjs.map +1 -1
- package/esm/components/HoverCard/HoverCardGroup/HoverCardGroup.mjs.map +1 -1
- package/esm/components/HoverCard/HoverCardTarget/HoverCardTarget.mjs.map +1 -1
- package/esm/components/Indicator/Indicator.mjs.map +1 -1
- package/esm/components/Input/Input.mjs +3 -3
- package/esm/components/Input/Input.mjs.map +1 -1
- package/esm/components/Input/InputClearSection/InputClearSection.mjs.map +1 -1
- package/esm/components/Input/InputDescription/InputDescription.mjs +2 -1
- package/esm/components/Input/InputDescription/InputDescription.mjs.map +1 -1
- package/esm/components/Input/InputError/InputError.mjs +2 -1
- package/esm/components/Input/InputError/InputError.mjs.map +1 -1
- package/esm/components/Input/InputLabel/InputLabel.mjs.map +1 -1
- package/esm/components/Input/InputPlaceholder/InputPlaceholder.mjs +13 -12
- package/esm/components/Input/InputPlaceholder/InputPlaceholder.mjs.map +1 -1
- package/esm/components/Input/InputSuccess/InputSuccess.mjs +2 -1
- package/esm/components/Input/InputSuccess/InputSuccess.mjs.map +1 -1
- package/esm/components/Input/InputWrapper/InputWrapper.mjs.map +1 -1
- package/esm/components/InputBase/InputBase.mjs.map +1 -1
- package/esm/components/Kbd/Kbd.mjs +14 -13
- package/esm/components/Kbd/Kbd.mjs.map +1 -1
- package/esm/components/List/List.mjs.map +1 -1
- package/esm/components/List/ListItem/ListItem.mjs.map +1 -1
- package/esm/components/Loader/loaders/Bars.mjs.map +1 -1
- package/esm/components/Loader/loaders/Dots.mjs.map +1 -1
- package/esm/components/LoadingOverlay/LoadingOverlay.mjs.map +1 -1
- package/esm/components/Mark/Mark.mjs +14 -13
- package/esm/components/Mark/Mark.mjs.map +1 -1
- package/esm/components/Marquee/Marquee.mjs.map +1 -1
- package/esm/components/MaskInput/MaskInput.mjs +3 -2
- package/esm/components/MaskInput/MaskInput.mjs.map +1 -1
- package/esm/components/Menu/Menu.mjs.map +1 -1
- package/esm/components/Menu/MenuCheckboxGroup/MenuCheckboxGroup.mjs +4 -3
- package/esm/components/Menu/MenuCheckboxGroup/MenuCheckboxGroup.mjs.map +1 -1
- package/esm/components/Menu/MenuCheckboxItem/MenuCheckboxItem.mjs +2 -1
- package/esm/components/Menu/MenuCheckboxItem/MenuCheckboxItem.mjs.map +1 -1
- package/esm/components/Menu/MenuContextMenu/MenuContextMenu.mjs +3 -2
- package/esm/components/Menu/MenuContextMenu/MenuContextMenu.mjs.map +1 -1
- package/esm/components/Menu/MenuDivider/MenuDivider.mjs +2 -1
- package/esm/components/Menu/MenuDivider/MenuDivider.mjs.map +1 -1
- package/esm/components/Menu/MenuDropdown/MenuDropdown.mjs.map +1 -1
- package/esm/components/Menu/MenuItem/MenuItem.mjs.map +1 -1
- package/esm/components/Menu/MenuLabel/MenuLabel.mjs +2 -1
- package/esm/components/Menu/MenuLabel/MenuLabel.mjs.map +1 -1
- package/esm/components/Menu/MenuRadioItem/MenuRadioItem.mjs +2 -1
- package/esm/components/Menu/MenuRadioItem/MenuRadioItem.mjs.map +1 -1
- package/esm/components/Menu/MenuSelectableItem/MenuSelectableItem.mjs.map +1 -1
- package/esm/components/Menu/MenuSub/MenuSub.mjs.map +1 -1
- package/esm/components/Menu/MenuSubItem/MenuSubItem.mjs.map +1 -1
- package/esm/components/Menu/MenuTarget/MenuTarget.mjs.map +1 -1
- package/esm/components/Menubar/Menubar.mjs.map +1 -1
- package/esm/components/Menubar/MenubarMenu/MenubarMenu.mjs.map +1 -1
- package/esm/components/Menubar/MenubarTarget/MenubarTarget.mjs.map +1 -1
- package/esm/components/Modal/Modal.mjs.map +1 -1
- package/esm/components/Modal/ModalBody.mjs +2 -1
- package/esm/components/Modal/ModalBody.mjs.map +1 -1
- package/esm/components/Modal/ModalCloseButton.mjs +2 -1
- package/esm/components/Modal/ModalCloseButton.mjs.map +1 -1
- package/esm/components/Modal/ModalContent.mjs.map +1 -1
- package/esm/components/Modal/ModalHeader.mjs +2 -1
- package/esm/components/Modal/ModalHeader.mjs.map +1 -1
- package/esm/components/Modal/ModalOverlay.mjs +2 -1
- package/esm/components/Modal/ModalOverlay.mjs.map +1 -1
- package/esm/components/Modal/ModalRoot.mjs.map +1 -1
- package/esm/components/Modal/ModalTitle.mjs +2 -1
- package/esm/components/Modal/ModalTitle.mjs.map +1 -1
- package/esm/components/ModalBase/ModalBase.mjs.map +1 -1
- package/esm/components/ModalBase/ModalBaseContent.mjs.map +1 -1
- package/esm/components/ModalBase/ModalBaseOverlay.mjs.map +1 -1
- package/esm/components/ModalBase/use-modal.mjs +2 -1
- package/esm/components/ModalBase/use-modal.mjs.map +1 -1
- package/esm/components/MultiSelect/MultiSelect.mjs.map +1 -1
- package/esm/components/NativeSelect/NativeSelect.mjs.map +1 -1
- package/esm/components/NativeSelect/NativeSelectOption.mjs.map +1 -1
- package/esm/components/NavLink/NavLink.mjs.map +1 -1
- package/esm/components/Notification/Notification.mjs +3 -3
- package/esm/components/Notification/Notification.mjs.map +1 -1
- package/esm/components/NumberInput/NumberInput.mjs +5 -3
- package/esm/components/NumberInput/NumberInput.mjs.map +1 -1
- package/esm/components/NumberInput/NumberInputChevron.mjs.map +1 -1
- package/esm/components/OverflowList/OverflowList.mjs +4 -2
- package/esm/components/OverflowList/OverflowList.mjs.map +1 -1
- package/esm/components/Overlay/Overlay.mjs +14 -13
- package/esm/components/Overlay/Overlay.mjs.map +1 -1
- package/esm/components/Pagination/Pagination.icons.mjs.map +1 -1
- package/esm/components/Pagination/Pagination.mjs +2 -1
- package/esm/components/Pagination/Pagination.mjs.map +1 -1
- package/esm/components/Pagination/PaginationDots/PaginationDots.mjs +2 -1
- package/esm/components/Pagination/PaginationDots/PaginationDots.mjs.map +1 -1
- package/esm/components/Pagination/PaginationEdges/PaginationEdges.mjs.map +1 -1
- package/esm/components/Pagination/PaginationItems/PaginationItems.mjs +3 -2
- package/esm/components/Pagination/PaginationItems/PaginationItems.mjs.map +1 -1
- package/esm/components/Pagination/PaginationLabel/PaginationLabel.mjs.map +1 -1
- package/esm/components/Pagination/PaginationRoot/PaginationRoot.mjs.map +1 -1
- package/esm/components/Paper/Paper.mjs +1 -1
- package/esm/components/Paper/Paper.mjs.map +1 -1
- package/esm/components/PasswordInput/PasswordInput.mjs.map +1 -1
- package/esm/components/PasswordInput/PasswordToggleIcon.mjs.map +1 -1
- package/esm/components/Pill/Pill.mjs.map +1 -1
- package/esm/components/Pill/PillGroup/PillGroup.mjs.map +1 -1
- package/esm/components/PillsInput/PillsInput.mjs.map +1 -1
- package/esm/components/PinInput/PinInput.mjs +6 -5
- package/esm/components/PinInput/PinInput.mjs.map +1 -1
- package/esm/components/Popover/Popover.mjs.map +1 -1
- package/esm/components/Popover/PopoverContextMenu/PopoverContextMenu.mjs +3 -2
- package/esm/components/Popover/PopoverContextMenu/PopoverContextMenu.mjs.map +1 -1
- package/esm/components/Popover/PopoverDropdown/PopoverDropdown.mjs.map +1 -1
- package/esm/components/Popover/use-popover.mjs +16 -12
- package/esm/components/Popover/use-popover.mjs.map +1 -1
- package/esm/components/Progress/Progress.mjs.map +1 -1
- package/esm/components/Progress/ProgressLabel/ProgressLabel.mjs +2 -1
- package/esm/components/Progress/ProgressLabel/ProgressLabel.mjs.map +1 -1
- package/esm/components/Progress/ProgressRoot/ProgressRoot.mjs.map +1 -1
- package/esm/components/Radio/Radio.mjs.map +1 -1
- package/esm/components/Radio/RadioCard/RadioCard.mjs.map +1 -1
- package/esm/components/Radio/RadioGroup/RadioGroup.mjs.map +1 -1
- package/esm/components/Radio/RadioIcon.mjs.map +1 -1
- package/esm/components/Radio/RadioIndicator/RadioIndicator.mjs.map +1 -1
- package/esm/components/Rating/Rating.mjs +6 -3
- package/esm/components/Rating/Rating.mjs.map +1 -1
- package/esm/components/Rating/RatingItem/RatingItem.mjs.map +1 -1
- package/esm/components/Rating/StarSymbol/StarIcon.mjs.map +1 -1
- package/esm/components/Rating/StarSymbol/StarSymbol.mjs +2 -1
- package/esm/components/Rating/StarSymbol/StarSymbol.mjs.map +1 -1
- package/esm/components/RingProgress/Curve/Curve.mjs.map +1 -1
- package/esm/components/RingProgress/RingProgress.mjs.map +1 -1
- package/esm/components/RollingNumber/DigitColumn.mjs.map +1 -1
- package/esm/components/RollingNumber/RollingNumber.mjs +12 -10
- package/esm/components/RollingNumber/RollingNumber.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollArea.mjs +8 -6
- package/esm/components/ScrollArea/ScrollArea.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.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.map +1 -1
- package/esm/components/SemiCircleProgress/SemiCircleProgress.mjs.map +1 -1
- package/esm/components/SimpleGrid/SimpleGrid.mjs.map +1 -1
- package/esm/components/SimpleGrid/SimpleGridVariables.mjs +10 -8
- package/esm/components/SimpleGrid/SimpleGridVariables.mjs.map +1 -1
- package/esm/components/Skeleton/Skeleton.mjs +14 -13
- package/esm/components/Skeleton/Skeleton.mjs.map +1 -1
- package/esm/components/Slider/Marks/Marks.mjs +3 -2
- package/esm/components/Slider/Marks/Marks.mjs.map +1 -1
- package/esm/components/Slider/RangeSlider/RangeSlider.mjs +20 -11
- package/esm/components/Slider/RangeSlider/RangeSlider.mjs.map +1 -1
- package/esm/components/Slider/Slider/Slider.mjs +6 -6
- package/esm/components/Slider/Slider/Slider.mjs.map +1 -1
- package/esm/components/Slider/Thumb/Thumb.mjs.map +1 -1
- package/esm/components/Slider/Track/Track.mjs.map +1 -1
- package/esm/components/Splitter/GripIcon.mjs.map +1 -1
- package/esm/components/Splitter/Splitter.mjs +8 -7
- package/esm/components/Splitter/Splitter.mjs.map +1 -1
- package/esm/components/Spoiler/Spoiler.mjs.map +1 -1
- package/esm/components/Stack/Stack.mjs +14 -13
- package/esm/components/Stack/Stack.mjs.map +1 -1
- package/esm/components/Stepper/Stepper.context.mjs.map +1 -1
- package/esm/components/Stepper/Stepper.mjs +6 -3
- package/esm/components/Stepper/Stepper.mjs.map +1 -1
- package/esm/components/Stepper/Stepper.module.mjs.map +1 -1
- package/esm/components/Stepper/StepperStep/StepperStep.mjs +3 -2
- package/esm/components/Stepper/StepperStep/StepperStep.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 +2 -2
- package/esm/components/Table/Table.mjs.map +1 -1
- package/esm/components/Table/TableScrollContainer.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/Tabs/TabsPanel/TabsPanel.mjs.map +1 -1
- package/esm/components/Tabs/TabsTab/TabsTab.mjs.map +1 -1
- package/esm/components/TagsInput/TagsInput.mjs.map +1 -1
- package/esm/components/Text/Text.mjs +18 -17
- package/esm/components/Text/Text.mjs.map +1 -1
- package/esm/components/TextInput/TextInput.mjs +6 -5
- package/esm/components/TextInput/TextInput.mjs.map +1 -1
- package/esm/components/ThemeIcon/ThemeIcon.mjs +14 -13
- package/esm/components/ThemeIcon/ThemeIcon.mjs.map +1 -1
- package/esm/components/Timeline/Timeline.mjs.map +1 -1
- package/esm/components/Timeline/TimelineItem/TimelineItem.mjs.map +1 -1
- package/esm/components/Title/Title.mjs +1 -1
- package/esm/components/Title/Title.mjs.map +1 -1
- package/esm/components/Tooltip/Tooltip.mjs.map +1 -1
- package/esm/components/Tooltip/TooltipFloating/TooltipFloating.mjs.map +1 -1
- package/esm/components/Tooltip/TooltipGroup/TooltipGroup.mjs.map +1 -1
- package/esm/components/Transition/Transition.mjs.map +1 -1
- package/esm/components/Tree/FlatTreeNode.mjs.map +1 -1
- package/esm/components/Tree/Tree.mjs +2 -1
- package/esm/components/Tree/Tree.mjs.map +1 -1
- package/esm/components/Tree/TreeNode.mjs.map +1 -1
- package/esm/components/Tree/use-tree.mjs.map +1 -1
- package/esm/components/TreeSelect/TreeSelect.mjs +11 -9
- package/esm/components/TreeSelect/TreeSelect.mjs.map +1 -1
- package/esm/components/TreeSelect/TreeSelectOption.mjs.map +1 -1
- package/esm/components/Typography/Typography.mjs +12 -11
- package/esm/components/Typography/Typography.mjs.map +1 -1
- package/esm/components/Typography/Typography.module.mjs.map +1 -1
- package/esm/components/UnstyledButton/UnstyledButton.mjs +12 -11
- package/esm/components/UnstyledButton/UnstyledButton.mjs.map +1 -1
- package/esm/components/VisuallyHidden/VisuallyHidden.mjs +12 -11
- package/esm/components/VisuallyHidden/VisuallyHidden.mjs.map +1 -1
- package/esm/core/DirectionProvider/DirectionProvider.mjs +3 -2
- package/esm/core/DirectionProvider/DirectionProvider.mjs.map +1 -1
- package/esm/core/InlineStyles/InlineStyles.mjs.map +1 -1
- package/esm/core/MantineProvider/MantineCssVariables/MantineCssVariables.mjs +4 -2
- package/esm/core/MantineProvider/MantineCssVariables/MantineCssVariables.mjs.map +1 -1
- package/esm/core/MantineProvider/MantineProvider.mjs +3 -3
- package/esm/core/MantineProvider/MantineProvider.mjs.map +1 -1
- package/esm/core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.mjs.map +1 -1
- package/esm/core/MantineProvider/merge-mantine-theme/merge-mantine-theme.mjs.map +1 -1
- package/esm/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.mjs +2 -1
- package/esm/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.mjs.map +1 -1
- package/esm/core/utils/create-scoped-keydown-handler/create-scoped-keydown-handler.mjs +0 -1
- package/esm/core/utils/create-scoped-keydown-handler/create-scoped-keydown-handler.mjs.map +1 -1
- package/esm/core/utils/deep-merge/deep-merge.mjs +4 -3
- package/esm/core/utils/deep-merge/deep-merge.mjs.map +1 -1
- package/esm/index.mjs +4 -1
- package/esm/utils/InlineInput/InlineInput.mjs.map +1 -1
- package/lib/components/Accordion/Accordion.d.ts +1 -1
- package/lib/components/Accordion/AccordionChevron.d.ts +1 -1
- package/lib/components/ActionBar/ActionBar.context.d.ts +8 -0
- package/lib/components/ActionBar/ActionBar.d.ts +44 -0
- package/lib/components/ActionBar/ActionBarCloseButton/ActionBarCloseButton.d.ts +22 -0
- package/lib/components/ActionBar/ActionBarDivider/ActionBarDivider.d.ts +16 -0
- package/lib/components/ActionBar/index.d.ts +17 -0
- package/lib/components/AppShell/AppShellMediaStyles/AppShellMediaStyles.d.ts +1 -1
- package/lib/components/Avatar/AvatarPlaceholderIcon.d.ts +1 -1
- package/lib/components/Cascader/CascaderColumns.d.ts +1 -1
- package/lib/components/Checkbox/CheckIcon.d.ts +2 -2
- package/lib/components/CloseButton/CloseIcon.d.ts +1 -1
- package/lib/components/ColorInput/EyeDropperIcon.d.ts +1 -1
- package/lib/components/ColorPicker/Saturation/Saturation.d.ts +1 -1
- package/lib/components/ColorPicker/Swatches/Swatches.d.ts +1 -1
- package/lib/components/ColorPicker/Thumb/Thumb.d.ts +1 -1
- package/lib/components/Combobox/Combobox.d.ts +1 -1
- package/lib/components/Combobox/ComboboxClearButton/ComboboxClearButton.d.ts +1 -1
- package/lib/components/Combobox/ComboboxHiddenInput/ComboboxHiddenInput.d.ts +1 -1
- package/lib/components/Combobox/OptionsDropdown/OptionsDropdown.d.ts +1 -1
- package/lib/components/CopyButton/CopyButton.d.ts +1 -1
- package/lib/components/Drawer/DrawerStack.d.ts +1 -1
- package/lib/components/FocusTrap/FocusTrap.d.ts +1 -1
- package/lib/components/Grid/GridCol/GridColVariables.d.ts +1 -1
- package/lib/components/Grid/GridVariables.d.ts +1 -1
- package/lib/components/HoverCard/HoverCard.d.ts +1 -1
- package/lib/components/HoverCard/HoverCardDropdown/HoverCardDropdown.d.ts +1 -1
- package/lib/components/HoverCard/HoverCardGroup/HoverCardGroup.d.ts +1 -1
- package/lib/components/HoverCard/HoverCardTarget/HoverCardTarget.d.ts +1 -1
- package/lib/components/Input/InputClearSection/InputClearSection.d.ts +1 -1
- package/lib/components/Input/index.d.ts +1 -1
- package/lib/components/Menu/Menu.d.ts +1 -1
- package/lib/components/Menu/MenuCheckboxGroup/MenuCheckboxGroup.d.ts +1 -1
- package/lib/components/Menu/MenuRadioGroup/MenuRadioGroup.d.ts +1 -1
- package/lib/components/Menu/MenuSelectableItem/MenuSelectableItem.d.ts +1 -1
- package/lib/components/Menu/MenuSub/MenuSub.d.ts +1 -1
- package/lib/components/Menu/MenuSubTarget/MenuSubTarget.d.ts +1 -1
- package/lib/components/Menu/MenuTarget/MenuTarget.d.ts +1 -1
- package/lib/components/Menubar/MenubarDropdown/MenubarDropdown.d.ts +1 -1
- package/lib/components/Menubar/MenubarMenu/MenubarMenu.d.ts +1 -1
- package/lib/components/Menubar/MenubarTarget/MenubarTarget.d.ts +1 -1
- package/lib/components/Modal/ModalStack.d.ts +1 -1
- package/lib/components/ModalBase/ModalBase.d.ts +1 -1
- package/lib/components/ModalBase/ModalBaseBody.d.ts +1 -1
- package/lib/components/ModalBase/ModalBaseCloseButton.d.ts +1 -1
- package/lib/components/ModalBase/ModalBaseContent.d.ts +1 -1
- package/lib/components/ModalBase/ModalBaseHeader.d.ts +1 -1
- package/lib/components/ModalBase/ModalBaseOverlay.d.ts +1 -1
- package/lib/components/ModalBase/ModalBaseTitle.d.ts +1 -1
- package/lib/components/ModalBase/NativeScrollArea.d.ts +1 -1
- package/lib/components/NativeSelect/NativeSelectOption.d.ts +1 -1
- package/lib/components/NumberFormatter/NumberFormatter.d.ts +1 -1
- package/lib/components/NumberInput/NumberInputChevron.d.ts +1 -1
- package/lib/components/Pagination/Pagination.icons.d.ts +5 -5
- package/lib/components/Pagination/PaginationItems/PaginationItems.d.ts +1 -1
- package/lib/components/PasswordInput/PasswordToggleIcon.d.ts +1 -1
- package/lib/components/Popover/Popover.d.ts +2 -2
- package/lib/components/Progress/Progress.d.ts +1 -1
- package/lib/components/Radio/RadioIcon.d.ts +1 -1
- package/lib/components/Rating/RatingItem/RatingItem.d.ts +1 -1
- package/lib/components/Rating/StarSymbol/StarIcon.d.ts +1 -1
- package/lib/components/Rating/StarSymbol/StarSymbol.d.ts +1 -1
- package/lib/components/RingProgress/Curve/Curve.d.ts +1 -1
- package/lib/components/RollingNumber/DigitColumn.d.ts +1 -1
- package/lib/components/ScrollArea/ScrollAreaCorner/ScrollAreaCorner.d.ts +2 -2
- package/lib/components/ScrollArea/ScrollAreaRoot/ScrollAreaRoot.d.ts +1 -1
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbar.d.ts +1 -1
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarAuto.d.ts +1 -1
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarHover.d.ts +1 -1
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarScroll.d.ts +1 -1
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollAreaScrollbarVisible.d.ts +1 -1
- package/lib/components/ScrollArea/ScrollAreaScrollbar/Scrollbar.d.ts +1 -1
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollbarX.d.ts +1 -1
- package/lib/components/ScrollArea/ScrollAreaScrollbar/ScrollbarY.d.ts +1 -1
- package/lib/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.d.ts +2 -2
- package/lib/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.d.ts +1 -1
- package/lib/components/SimpleGrid/SimpleGridVariables.d.ts +2 -2
- package/lib/components/Slider/Marks/Marks.d.ts +1 -1
- package/lib/components/Slider/SliderRoot/SliderRoot.d.ts +1 -1
- package/lib/components/Slider/Thumb/Thumb.d.ts +1 -1
- package/lib/components/Slider/Track/Track.d.ts +1 -1
- package/lib/components/Splitter/GripIcon.d.ts +2 -2
- package/lib/components/Stepper/Stepper.context.d.ts +1 -0
- package/lib/components/Stepper/Stepper.d.ts +3 -1
- package/lib/components/Table/TableDataRenderer.d.ts +1 -1
- package/lib/components/Textarea/Autosize.d.ts +1 -1
- package/lib/components/Tooltip/TooltipGroup/TooltipGroup.d.ts +1 -1
- package/lib/components/Transition/Transition.d.ts +1 -1
- package/lib/components/Tree/FlatTreeNode.d.ts +1 -1
- package/lib/components/Tree/Tree.d.ts +1 -1
- package/lib/components/Tree/TreeNode.d.ts +1 -1
- package/lib/components/TreeSelect/TreeSelectOption.d.ts +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/core/DirectionProvider/DirectionProvider.d.ts +1 -1
- package/lib/core/InlineStyles/InlineStyles.d.ts +1 -1
- package/lib/core/MantineProvider/ColorSchemeScript/ColorSchemeScript.d.ts +1 -1
- package/lib/core/MantineProvider/MantineClasses/MantineClasses.d.ts +1 -1
- package/lib/core/MantineProvider/MantineCssVariables/MantineCssVariables.d.ts +1 -1
- package/lib/core/MantineProvider/MantineProvider.d.ts +5 -5
- package/lib/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.d.ts +1 -1
- package/lib/utils/Floating/FloatingArrow/FloatingArrow.d.ts +1 -1
- package/lib/utils/InlineInput/InlineInput.d.ts +1 -1
- package/lib/utils/InputsGroupFieldset/InputsGroupFieldset.d.ts +1 -1
- package/package.json +5 -5
- package/styles/ActionBar.css +13 -0
- package/styles/ActionBar.layer.css +14 -0
- package/styles/Stepper.css +30 -0
- package/styles/Stepper.layer.css +30 -0
- package/styles/Typography.css +59 -0
- package/styles/Typography.layer.css +59 -0
- package/styles.css +144 -41
- package/styles.layer.css +144 -41
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menubar.mjs","names":["useId","classes"],"sources":["../../../src/components/Menubar/Menubar.tsx"],"sourcesContent":["import { useCallback, useRef, useState } from 'react';\nimport { useId, useIsomorphicEffect, useMergedRef, useUncontrolled } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { FloatingPosition } from '../../utils/Floating';\nimport { MenubarContextProvider, type MenubarContextValue } from './Menubar.context';\nimport { MenubarDropdown, type MenubarDropdownProps } from './MenubarDropdown/MenubarDropdown';\nimport { MenubarMenu, type MenubarMenuProps } from './MenubarMenu/MenubarMenu';\nimport { MenubarTarget, type MenubarTargetProps } from './MenubarTarget/MenubarTarget';\nimport classes from './Menubar.module.css';\n\nexport type MenubarStylesNames = 'root' | 'target';\n\nexport type MenubarFactory = Factory<{\n props: MenubarProps;\n ref: HTMLDivElement;\n stylesNames: MenubarStylesNames;\n staticComponents: {\n Menu: typeof MenubarMenu;\n Target: typeof MenubarTarget;\n Dropdown: typeof MenubarDropdown;\n };\n}>;\n\nexport interface MenubarProps\n extends BoxProps, StylesApiProps<MenubarFactory>, ElementProps<'div'> {\n /** `Menubar.Menu` components */\n children?: React.ReactNode;\n\n /** Index of the controlled opened menu, `null` closes all menus */\n openIndex?: number | null;\n\n /** Index of the opened menu for uncontrolled component @default `null` */\n defaultOpenIndex?: number | null;\n\n /** Called when the opened menu changes with its index or `null` when all menus are closed */\n onOpenChange?: (index: number | null) => void;\n\n /** Event that opens a menu when none of the menus is opened. `'click'` opens a menu on target click and then switches menus on hover (desktop application pattern), `'hover'` opens a menu when the target is hovered @default `'click'` */\n trigger?: 'click' | 'hover';\n\n /** If set, arrow key navigation wraps from last to first menu and vice versa @default `true` */\n loop?: boolean;\n\n /** Dropdown position relative to the target element @default `'bottom-start'` */\n position?: FloatingPosition;\n}\n\nconst defaultProps = {\n trigger: 'click',\n loop: true,\n position: 'bottom-start',\n} satisfies Partial<MenubarProps>;\n\nexport const Menubar = factory<MenubarFactory>((_props) => {\n const props = useProps('Menubar', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n children,\n openIndex,\n defaultOpenIndex,\n onOpenChange,\n trigger,\n loop,\n position,\n attributes,\n mod,\n ref,\n ...others\n } = props;\n\n const getStyles = useStyles<MenubarFactory>({\n name: 'Menubar',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n });\n\n const rootRef = useRef<HTMLDivElement>(null);\n const menubarId = useId();\n\n const [_openIndex, setOpenIndex] = useUncontrolled<number | null>({\n value: openIndex,\n defaultValue: defaultOpenIndex,\n finalValue: null,\n onChange: onOpenChange,\n });\n\n const [activeIndex, setActiveIndex] = useState(0);\n const openSourceRef = useRef<'click' | 'hover' | null>(null);\n\n const openMenu = useCallback(\n (index: number, source: 'click' | 'hover') => {\n openSourceRef.current = source;\n setOpenIndex(index);\n },\n [setOpenIndex]\n );\n\n const closeMenu = useCallback(() => {\n openSourceRef.current = null;\n setOpenIndex(null);\n }, [setOpenIndex]);\n\n const closeTimeoutRef = useRef(-1);\n\n const cancelClose = useCallback(() => {\n window.clearTimeout(closeTimeoutRef.current);\n }, []);\n\n const scheduleClose = useCallback(() => {\n window.clearTimeout(closeTimeoutRef.current);\n closeTimeoutRef.current = window.setTimeout(closeMenu, 120);\n }, [closeMenu]);\n\n useIsomorphicEffect(() => () => window.clearTimeout(closeTimeoutRef.current), []);\n\n const getOpenSource = useCallback(() => openSourceRef.current, []);\n\n const previousOpenIndexRef = useRef<number | null>(_openIndex);\n const getPreviousOpenIndex = useCallback(() => previousOpenIndexRef.current, []);\n\n useIsomorphicEffect(() => {\n previousOpenIndexRef.current = _openIndex;\n });\n\n const getTargets = useCallback(\n () =>\n Array.from(\n rootRef.current?.querySelectorAll<HTMLButtonElement>('[data-menubar-target]') ?? []\n ),\n []\n );\n\n const getMenuIndex = useCallback(\n (id: string) => getTargets().findIndex((node) => node.getAttribute('data-menubar-id') === id),\n [getTargets]\n );\n\n const getEnabledIndexes = useCallback(\n () =>\n getTargets().reduce<number[]>((acc, node, index) => {\n if (!node.disabled && !node.hasAttribute('data-disabled')) {\n acc.push(index);\n }\n return acc;\n }, []),\n [getTargets]\n );\n\n const focusTarget = useCallback(\n (index: number) => {\n getTargets()[index]?.focus();\n },\n [getTargets]\n );\n\n const focusMenuItem = useCallback(\n (index: number, itemPosition: 'first' | 'last') => {\n window.setTimeout(() => {\n const target = getTargets()[index];\n const controls = target?.getAttribute('aria-controls');\n const dropdown = controls\n ? document.getElementById(controls)\n : document.querySelector<HTMLElement>(`[data-menubar-dropdown=\"${menubarId}\"]`);\n const items = dropdown?.querySelectorAll<HTMLElement>(\n '[data-menu-item]:not([data-disabled])'\n );\n\n if (items && items.length > 0) {\n const item = itemPosition === 'first' ? items[0] : items[items.length - 1];\n item?.focus();\n }\n }, 40);\n },\n [getTargets]\n );\n\n const getAdjacentIndex = useCallback(\n (current: number, direction: 1 | -1) => {\n const enabled = getEnabledIndexes();\n\n if (enabled.length === 0) {\n return current;\n }\n\n const currentPosition = enabled.indexOf(current);\n let nextPosition = currentPosition === -1 ? 0 : currentPosition + direction;\n\n if (loop) {\n nextPosition = (nextPosition + enabled.length) % enabled.length;\n } else {\n nextPosition = Math.max(0, Math.min(enabled.length - 1, nextPosition));\n }\n\n return enabled[nextPosition] ?? current;\n },\n [getEnabledIndexes, loop]\n );\n\n useIsomorphicEffect(() => {\n const enabled = getEnabledIndexes();\n if (enabled.length === 0) {\n return;\n }\n\n // While a menu is open, the single tab stop must stay on the opened menu's target,\n // including when it was opened programmatically via openIndex/defaultOpenIndex.\n if (_openIndex !== null && enabled.includes(_openIndex)) {\n if (activeIndex !== _openIndex) {\n setActiveIndex(_openIndex);\n }\n return;\n }\n\n if (!enabled.includes(activeIndex)) {\n setActiveIndex(enabled[0]);\n }\n });\n\n const contextValue: MenubarContextValue = {\n getStyles,\n id: menubarId,\n openIndex: _openIndex,\n setOpenIndex,\n openMenu,\n closeMenu,\n scheduleClose,\n cancelClose,\n getOpenSource,\n getPreviousOpenIndex,\n activeIndex,\n setActiveIndex,\n trigger: trigger!,\n loop: loop!,\n position: position!,\n unstyled,\n getMenuIndex,\n getTargets,\n getEnabledIndexes,\n getAdjacentIndex,\n focusTarget,\n focusMenuItem,\n };\n\n return (\n <MenubarContextProvider value={contextValue}>\n <Box\n ref={useMergedRef(ref, rootRef)}\n role=\"menubar\"\n aria-orientation=\"horizontal\"\n mod={mod}\n {...getStyles('root')}\n {...others}\n data-menubar\n >\n {children}\n </Box>\n </MenubarContextProvider>\n );\n});\n\nMenubar.classes = classes;\nMenubar.displayName = '@mantine/core/Menubar';\nMenubar.Menu = MenubarMenu;\nMenubar.Target = MenubarTarget;\nMenubar.Dropdown = MenubarDropdown;\n\nexport namespace Menubar {\n export type Props = MenubarProps;\n export type StylesNames = MenubarStylesNames;\n export type Factory = MenubarFactory;\n\n export namespace Menu {\n export type Props = MenubarMenuProps;\n }\n\n export namespace Target {\n export type Props = MenubarTargetProps;\n }\n\n export namespace Dropdown {\n export type Props = MenubarDropdownProps;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAwDA,MAAM,eAAe;CACnB,SAAS;CACT,MAAM;CACN,UAAU;AACZ;AAEA,MAAa,UAAU,SAAyB,WAAW;CACzD,MAAM,QAAQ,SAAS,WAAW,cAAc,MAAM;CACtD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,UACA,WACA,kBACA,cACA,SACA,MACA,UACA,YACA,KACA,KACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAA0B;EAC1C,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,UAAU,OAAuB,IAAI;CAC3C,MAAM,YAAYA,QAAM;CAExB,MAAM,CAAC,YAAY,gBAAgB,gBAA+B;EAChE,OAAO;EACP,cAAc;EACd,YAAY;EACZ,UAAU;CACZ,CAAC;CAED,MAAM,CAAC,aAAa,kBAAkB,SAAS,CAAC;CAChD,MAAM,gBAAgB,OAAiC,IAAI;CAE3D,MAAM,WAAW,aACd,OAAe,WAA8B;EAC5C,cAAc,UAAU;EACxB,aAAa,KAAK;CACpB,GACA,CAAC,YAAY,CACf;CAEA,MAAM,YAAY,kBAAkB;EAClC,cAAc,UAAU;EACxB,aAAa,IAAI;CACnB,GAAG,CAAC,YAAY,CAAC;CAEjB,MAAM,kBAAkB,OAAO,EAAE;CAEjC,MAAM,cAAc,kBAAkB;EACpC,OAAO,aAAa,gBAAgB,OAAO;CAC7C,GAAG,CAAC,CAAC;CAEL,M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EAClE,MAAM;EAEhB,GAAG,EAAE;CACP,GACA,CAAC,UAAU,CACb;CAEA,MAAM,mBAAmB,aACtB,SAAiB,cAAsB;EACtC,MAAM,UAAU,kBAAkB;EAElC,IAAI,QAAQ,WAAW,GACrB,OAAO;EAGT,MAAM,kBAAkB,QAAQ,QAAQ,OAAO;EAC/C,IAAI,eAAe,oBAAoB,KAAK,IAAI,kBAAkB;EAElE,IAAI,MACF,gBAAgB,eAAe,QAAQ,UAAU,QAAQ;OAEzD,eAAe,KAAK,IAAI,GAAG,KAAK,IAAI,QAAQ,SAAS,GAAG,YAAY,CAAC;EAGvE,OAAO,QAAQ,iBAAiB;CAClC,GACA,CAAC,mBAAmB,IAAI,CAC1B;CAEA,0BAA0B;EACxB,MAAM,UAAU,kBAAkB;EAClC,IAAI,QAAQ,WAAW,GACrB;EAKF,IAAI,eAAe,QAAQ,QAAQ,SAAS,UAAU,GAAG;GACvD,IAAI,gBAAgB,YAClB,eAAe,UAAU;GAE3B;EACF;EAEA,IAAI,CAAC,QAAQ,SAAS,WAAW,GAC/B,eAAe,QAAQ,EAAE;CAE7B,CAAC;CA2BD,OACE,oBAAC,wBAAD;EAAwB,OAAO;GAzB/B;GACA,IAAI;GACJ,WAAW;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACS;GACH;GACI;GACV;GACA;GACA;GACA;GACA;GACA;GACA;EAI0C;YACxC,oBAAC,KAAD;GACE,KAAK,aAAa,KAAK,OAAO;GAC9B,MAAK;GACL,oBAAiB;GACZ;GACL,GAAI,UAAU,MAAM;GACpB,GAAI;GACJ,gBAAA;GAEC;EACE,CAAA;CACiB,CAAA;AAE5B,CAAC;AAED,QAAQ,UAAUC;AAClB,QAAQ,cAAc;AACtB,QAAQ,OAAO;AACf,QAAQ,SAAS;AACjB,QAAQ,WAAW"}
|
|
1
|
+
{"version":3,"file":"Menubar.mjs","names":["useId","classes"],"sources":["../../../src/components/Menubar/Menubar.tsx"],"sourcesContent":["import { useCallback, useRef, useState } from 'react';\nimport { useId, useIsomorphicEffect, useMergedRef, useUncontrolled } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { FloatingPosition } from '../../utils/Floating';\nimport { MenubarContextProvider, type MenubarContextValue } from './Menubar.context';\nimport { MenubarDropdown, type MenubarDropdownProps } from './MenubarDropdown/MenubarDropdown';\nimport { MenubarMenu, type MenubarMenuProps } from './MenubarMenu/MenubarMenu';\nimport { MenubarTarget, type MenubarTargetProps } from './MenubarTarget/MenubarTarget';\nimport classes from './Menubar.module.css';\n\nexport type MenubarStylesNames = 'root' | 'target';\n\nexport type MenubarFactory = Factory<{\n props: MenubarProps;\n ref: HTMLDivElement;\n stylesNames: MenubarStylesNames;\n staticComponents: {\n Menu: typeof MenubarMenu;\n Target: typeof MenubarTarget;\n Dropdown: typeof MenubarDropdown;\n };\n}>;\n\nexport interface MenubarProps\n extends BoxProps, StylesApiProps<MenubarFactory>, ElementProps<'div'> {\n /** `Menubar.Menu` components */\n children?: React.ReactNode;\n\n /** Index of the controlled opened menu, `null` closes all menus */\n openIndex?: number | null;\n\n /** Index of the opened menu for uncontrolled component @default `null` */\n defaultOpenIndex?: number | null;\n\n /** Called when the opened menu changes with its index or `null` when all menus are closed */\n onOpenChange?: (index: number | null) => void;\n\n /** Event that opens a menu when none of the menus is opened. `'click'` opens a menu on target click and then switches menus on hover (desktop application pattern), `'hover'` opens a menu when the target is hovered @default `'click'` */\n trigger?: 'click' | 'hover';\n\n /** If set, arrow key navigation wraps from last to first menu and vice versa @default `true` */\n loop?: boolean;\n\n /** Dropdown position relative to the target element @default `'bottom-start'` */\n position?: FloatingPosition;\n}\n\nconst defaultProps = {\n trigger: 'click',\n loop: true,\n position: 'bottom-start',\n} satisfies Partial<MenubarProps>;\n\nexport const Menubar = factory<MenubarFactory>((_props) => {\n const props = useProps('Menubar', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n children,\n openIndex,\n defaultOpenIndex,\n onOpenChange,\n trigger,\n loop,\n position,\n attributes,\n mod,\n ref,\n ...others\n } = props;\n\n const getStyles = useStyles<MenubarFactory>({\n name: 'Menubar',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n });\n\n const rootRef = useRef<HTMLDivElement>(null);\n const menubarId = useId();\n\n const [_openIndex, setOpenIndex] = useUncontrolled<number | null>({\n value: openIndex,\n defaultValue: defaultOpenIndex,\n finalValue: null,\n onChange: onOpenChange,\n });\n\n const [activeIndex, setActiveIndex] = useState(0);\n const openSourceRef = useRef<'click' | 'hover' | null>(null);\n\n const openMenu = useCallback(\n (index: number, source: 'click' | 'hover') => {\n openSourceRef.current = source;\n setOpenIndex(index);\n },\n [setOpenIndex]\n );\n\n const closeMenu = useCallback(() => {\n openSourceRef.current = null;\n setOpenIndex(null);\n }, [setOpenIndex]);\n\n const closeTimeoutRef = useRef(-1);\n\n const cancelClose = useCallback(() => {\n window.clearTimeout(closeTimeoutRef.current);\n }, []);\n\n const scheduleClose = useCallback(() => {\n window.clearTimeout(closeTimeoutRef.current);\n closeTimeoutRef.current = window.setTimeout(closeMenu, 120);\n }, [closeMenu]);\n\n useIsomorphicEffect(() => () => window.clearTimeout(closeTimeoutRef.current), []);\n\n const getOpenSource = useCallback(() => openSourceRef.current, []);\n\n const previousOpenIndexRef = useRef<number | null>(_openIndex);\n const getPreviousOpenIndex = useCallback(() => previousOpenIndexRef.current, []);\n\n useIsomorphicEffect(() => {\n previousOpenIndexRef.current = _openIndex;\n });\n\n const getTargets = useCallback(\n () =>\n Array.from(\n rootRef.current?.querySelectorAll<HTMLButtonElement>('[data-menubar-target]') ?? []\n ),\n []\n );\n\n const getMenuIndex = useCallback(\n (id: string) => getTargets().findIndex((node) => node.getAttribute('data-menubar-id') === id),\n [getTargets]\n );\n\n const getEnabledIndexes = useCallback(\n () =>\n getTargets().reduce<number[]>((acc, node, index) => {\n if (!node.disabled && !node.hasAttribute('data-disabled')) {\n acc.push(index);\n }\n return acc;\n }, []),\n [getTargets]\n );\n\n const focusTarget = useCallback(\n (index: number) => {\n getTargets()[index]?.focus();\n },\n [getTargets]\n );\n\n const focusMenuItem = useCallback(\n (index: number, itemPosition: 'first' | 'last') => {\n window.setTimeout(() => {\n const target = getTargets()[index];\n const controls = target?.getAttribute('aria-controls');\n const dropdown = controls\n ? document.getElementById(controls)\n : document.querySelector<HTMLElement>(`[data-menubar-dropdown=\"${menubarId}\"]`);\n const items = dropdown?.querySelectorAll<HTMLElement>(\n '[data-menu-item]:not([data-disabled])'\n );\n\n if (items && items.length > 0) {\n const item = itemPosition === 'first' ? items[0] : items[items.length - 1];\n item?.focus();\n }\n }, 40);\n },\n [getTargets]\n );\n\n const getAdjacentIndex = useCallback(\n (current: number, direction: 1 | -1) => {\n const enabled = getEnabledIndexes();\n\n if (enabled.length === 0) {\n return current;\n }\n\n const currentPosition = enabled.indexOf(current);\n let nextPosition = currentPosition === -1 ? 0 : currentPosition + direction;\n\n if (loop) {\n nextPosition = (nextPosition + enabled.length) % enabled.length;\n } else {\n nextPosition = Math.max(0, Math.min(enabled.length - 1, nextPosition));\n }\n\n return enabled[nextPosition] ?? current;\n },\n [getEnabledIndexes, loop]\n );\n\n useIsomorphicEffect(() => {\n const enabled = getEnabledIndexes();\n if (enabled.length === 0) {\n return;\n }\n\n // While a menu is open, the single tab stop must stay on the opened menu's target,\n // including when it was opened programmatically via openIndex/defaultOpenIndex.\n if (_openIndex !== null && enabled.includes(_openIndex)) {\n if (activeIndex !== _openIndex) {\n setActiveIndex(_openIndex);\n }\n return;\n }\n\n if (!enabled.includes(activeIndex)) {\n setActiveIndex(enabled[0]);\n }\n });\n\n const contextValue: MenubarContextValue = {\n getStyles,\n id: menubarId,\n openIndex: _openIndex,\n setOpenIndex,\n openMenu,\n closeMenu,\n scheduleClose,\n cancelClose,\n getOpenSource,\n getPreviousOpenIndex,\n activeIndex,\n setActiveIndex,\n trigger: trigger!,\n loop: loop!,\n position: position!,\n unstyled,\n getMenuIndex,\n getTargets,\n getEnabledIndexes,\n getAdjacentIndex,\n focusTarget,\n focusMenuItem,\n };\n\n return (\n <MenubarContextProvider value={contextValue}>\n <Box\n ref={useMergedRef(ref, rootRef)}\n role=\"menubar\"\n aria-orientation=\"horizontal\"\n mod={mod}\n {...getStyles('root')}\n {...others}\n data-menubar\n >\n {children}\n </Box>\n </MenubarContextProvider>\n );\n});\n\nMenubar.classes = classes;\nMenubar.displayName = '@mantine/core/Menubar';\nMenubar.Menu = MenubarMenu;\nMenubar.Target = MenubarTarget;\nMenubar.Dropdown = MenubarDropdown;\n\nexport namespace Menubar {\n export type Props = MenubarProps;\n export type StylesNames = MenubarStylesNames;\n export type Factory = MenubarFactory;\n\n export namespace Menu {\n export type Props = MenubarMenuProps;\n }\n\n export namespace Target {\n export type Props = MenubarTargetProps;\n }\n\n export namespace Dropdown {\n export type Props = MenubarDropdownProps;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAwDA,MAAM,eAAe;CACnB,SAAS;CACT,MAAM;CACN,UAAU;AACZ;AAEA,MAAa,UAAU,SAAyB,WAAW;CACzD,MAAM,QAAQ,SAAS,WAAW,cAAc,MAAM;CACtD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,UACA,WACA,kBACA,cACA,SACA,MACA,UACA,YACA,KACA,KACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAA0B;EAC1C,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,UAAU,OAAuB,IAAI;CAC3C,MAAM,YAAYA,QAAM;CAExB,MAAM,CAAC,YAAY,gBAAgB,gBAA+B;EAChE,OAAO;EACP,cAAc;EACd,YAAY;EACZ,UAAU;CACZ,CAAC;CAED,MAAM,CAAC,aAAa,kBAAkB,SAAS,CAAC;CAChD,MAAM,gBAAgB,OAAiC,IAAI;CAE3D,MAAM,WAAW,aACd,O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,oBAAiB;GACZ;GACL,GAAI,UAAU,MAAM;GACpB,GAAI;GACJ,gBAAA;GAEC;EACE,CAAA;CACiB,CAAA;AAE5B,CAAC;AAED,QAAQ,UAAUC;AAClB,QAAQ,cAAc;AACtB,QAAQ,OAAO;AACf,QAAQ,SAAS;AACjB,QAAQ,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenubarMenu.mjs","names":["useId"],"sources":["../../../../src/components/Menubar/MenubarMenu/MenubarMenu.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useId, useIsomorphicEffect } from '@mantine/hooks';\nimport { Menu, MenuProps } from '../../Menu';\nimport { MenubarMenuContextProvider, useMenubarContext } from '../Menubar.context';\n\nexport interface MenubarMenuProps extends Omit<\n MenuProps,\n 'opened' | 'defaultOpened' | 'onChange' | 'onOpen' | 'onClose' | 'trigger' | 'returnFocus'\n> {\n /** `Menubar.Target` and `Menubar.Dropdown` components */\n children?: React.ReactNode;\n}\n\nconst DEFAULT_TRANSITION_DURATION = 150;\n\nexport function MenubarMenu({ children, transitionProps, ...others }: MenubarMenuProps) {\n const ctx = useMenubarContext();\n const id = useId();\n const [index, setIndex] = useState(-1);\n\n useIsomorphicEffect(() => {\n const next = ctx.getMenuIndex(id);\n setIndex((current) => (current === next ? current : next));\n });\n\n const opened = ctx.openIndex !== null && index !== -1 && ctx.openIndex === index;\n\n const handleChange = (value: boolean) => {\n if (value) {\n ctx.openMenu(index, 'click');\n ctx.setActiveIndex(index);\n } else {\n ctx.closeMenu();\n }\n };\n\n // Transitions should only play when the whole bar opens or closes, not when\n // switching between sibling menus while one is already open.\n const baseDuration = transitionProps?.duration ?? DEFAULT_TRANSITION_DURATION;\n const baseExitDuration = transitionProps?.exitDuration ?? baseDuration;\n const animateEnter = ctx.getPreviousOpenIndex() === null;\n const animateExit = ctx.openIndex === null;\n const resolvedTransitionProps = {\n ...transitionProps,\n duration: animateEnter ? baseDuration : 0,\n exitDuration: animateExit ? baseExitDuration : 0,\n };\n\n return (\n <MenubarMenuContextProvider value={{ id, index, opened }}>\n <Menu\n position={ctx.position}\n loop={ctx.loop}\n unstyled={ctx.unstyled}\n menuItemTabIndex={-1}\n trapFocus={false}\n {...others}\n transitionProps={resolvedTransitionProps}\n opened={opened}\n onChange={handleChange}\n trigger=\"click\"\n returnFocus={false}\n >\n {children}\n </Menu>\n </MenubarMenuContextProvider>\n );\n}\n\nMenubarMenu.displayName = '@mantine/core/MenubarMenu';\n"],"mappings":";;;;;;;AAaA,MAAM,8BAA8B;AAEpC,SAAgB,YAAY,EAAE,UAAU,iBAAiB,GAAG,UAA4B;CACtF,MAAM,MAAM,kBAAkB;CAC9B,MAAM,KAAKA,QAAM;CACjB,MAAM,CAAC,OAAO,YAAY,SAAS,EAAE;CAErC,0BAA0B;EACxB,MAAM,OAAO,IAAI,aAAa,EAAE;EAChC,UAAU,YAAa,YAAY,OAAO,UAAU,IAAK;CAC3D,CAAC;CAED,MAAM,SAAS,IAAI,cAAc,QAAQ,UAAU,MAAM,IAAI,cAAc;CAE3E,MAAM,gBAAgB,UAAmB;EACvC,IAAI,OAAO;GACT,IAAI,SAAS,OAAO,OAAO;GAC3B,IAAI,eAAe,KAAK;EAC1B,OACE,IAAI,UAAU;CAElB;CAIA,MAAM,eAAe,iBAAiB,YAAY;CAClD,MAAM,mBAAmB,iBAAiB,gBAAgB;CAC1D,MAAM,eAAe,IAAI,qBAAqB,MAAM;CACpD,MAAM,cAAc,IAAI,cAAc;CACtC,MAAM,0BAA0B;EAC9B,GAAG;EACH,UAAU,eAAe,eAAe;EACxC,cAAc,cAAc,mBAAmB;CACjD;CAEA,OACE,oBAAC,4BAAD;EAA4B,OAAO;GAAE;GAAI;GAAO;EAAO;
|
|
1
|
+
{"version":3,"file":"MenubarMenu.mjs","names":["useId"],"sources":["../../../../src/components/Menubar/MenubarMenu/MenubarMenu.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useId, useIsomorphicEffect } from '@mantine/hooks';\nimport { Menu, MenuProps } from '../../Menu';\nimport { MenubarMenuContextProvider, useMenubarContext } from '../Menubar.context';\n\nexport interface MenubarMenuProps extends Omit<\n MenuProps,\n 'opened' | 'defaultOpened' | 'onChange' | 'onOpen' | 'onClose' | 'trigger' | 'returnFocus'\n> {\n /** `Menubar.Target` and `Menubar.Dropdown` components */\n children?: React.ReactNode;\n}\n\nconst DEFAULT_TRANSITION_DURATION = 150;\n\nexport function MenubarMenu({ children, transitionProps, ...others }: MenubarMenuProps) {\n const ctx = useMenubarContext();\n const id = useId();\n const [index, setIndex] = useState(-1);\n\n useIsomorphicEffect(() => {\n const next = ctx.getMenuIndex(id);\n setIndex((current) => (current === next ? current : next));\n });\n\n const opened = ctx.openIndex !== null && index !== -1 && ctx.openIndex === index;\n\n const handleChange = (value: boolean) => {\n if (value) {\n ctx.openMenu(index, 'click');\n ctx.setActiveIndex(index);\n } else {\n ctx.closeMenu();\n }\n };\n\n // Transitions should only play when the whole bar opens or closes, not when\n // switching between sibling menus while one is already open.\n const baseDuration = transitionProps?.duration ?? DEFAULT_TRANSITION_DURATION;\n const baseExitDuration = transitionProps?.exitDuration ?? baseDuration;\n const animateEnter = ctx.getPreviousOpenIndex() === null;\n const animateExit = ctx.openIndex === null;\n const resolvedTransitionProps = {\n ...transitionProps,\n duration: animateEnter ? baseDuration : 0,\n exitDuration: animateExit ? baseExitDuration : 0,\n };\n\n return (\n <MenubarMenuContextProvider value={{ id, index, opened }}>\n <Menu\n position={ctx.position}\n loop={ctx.loop}\n unstyled={ctx.unstyled}\n menuItemTabIndex={-1}\n trapFocus={false}\n {...others}\n transitionProps={resolvedTransitionProps}\n opened={opened}\n onChange={handleChange}\n trigger=\"click\"\n returnFocus={false}\n >\n {children}\n </Menu>\n </MenubarMenuContextProvider>\n );\n}\n\nMenubarMenu.displayName = '@mantine/core/MenubarMenu';\n"],"mappings":";;;;;;;AAaA,MAAM,8BAA8B;AAEpC,SAAgB,YAAY,EAAE,UAAU,iBAAiB,GAAG,UAA4B;CACtF,MAAM,MAAM,kBAAkB;CAC9B,MAAM,KAAKA,QAAM;CACjB,MAAM,CAAC,OAAO,YAAY,SAAS,EAAE;CAErC,0BAA0B;EACxB,MAAM,OAAO,IAAI,aAAa,EAAE;EAChC,UAAU,YAAa,YAAY,OAAO,UAAU,IAAK;CAC3D,CAAC;CAED,MAAM,SAAS,IAAI,cAAc,QAAQ,UAAU,MAAM,IAAI,cAAc;CAE3E,MAAM,gBAAgB,UAAmB;EACvC,IAAI,OAAO;GACT,IAAI,SAAS,OAAO,OAAO;GAC3B,IAAI,eAAe,KAAK;EAC1B,OACE,IAAI,UAAU;CAElB;CAIA,MAAM,eAAe,iBAAiB,YAAY;CAClD,MAAM,mBAAmB,iBAAiB,gBAAgB;CAC1D,MAAM,eAAe,IAAI,qBAAqB,MAAM;CACpD,MAAM,cAAc,IAAI,cAAc;CACtC,MAAM,0BAA0B;EAC9B,GAAG;EACH,UAAU,eAAe,eAAe;EACxC,cAAc,cAAc,mBAAmB;CACjD;CAEA,OACE,oBAAC,4BAAD;EAA4B,OAAO;GAAE;GAAI;GAAO;EAAO;EACrD,UAAA,oBAAC,MAAD;GACE,UAAU,IAAI;GACd,MAAM,IAAI;GACV,UAAU,IAAI;GACd,kBAAkB;GAClB,WAAW;GACX,GAAI;GACJ,iBAAiB;GACT;GACR,UAAU;GACV,SAAQ;GACR,aAAa;GAEZ;EACG,CAAA;CACoB,CAAA;AAEhC;AAEA,YAAY,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenubarTarget.mjs","names":[],"sources":["../../../../src/components/Menubar/MenubarTarget/MenubarTarget.tsx"],"sourcesContent":["import {\n createEventHandler,\n ElementProps,\n MantineStyleProp,\n useDirection,\n useProps,\n} from '../../../core';\nimport { Popover } from '../../Popover';\nimport { UnstyledButton } from '../../UnstyledButton';\nimport { useMenubarContext, useMenubarMenuContext } from '../Menubar.context';\n\nexport interface MenubarTargetProps extends ElementProps<'button'> {\n 'data-disabled'?: boolean;\n\n /** Target label */\n children: React.ReactNode;\n\n /** Inline styles applied to the target button */\n style?: MantineStyleProp;\n\n /** Key of the prop used to get element ref, useful for forwarding refs to custom components @default 'ref' */\n refProp?: string;\n}\n\nconst defaultProps = {\n refProp: 'ref',\n} satisfies Partial<MenubarTargetProps>;\n\nfunction isPrintableKey(event: React.KeyboardEvent) {\n return (\n event.key.length === 1 && event.key !== ' ' && !event.ctrlKey && !event.metaKey && !event.altKey\n );\n}\n\nfunction getTargetLabel(node: HTMLElement) {\n return (node.textContent ?? '').trim().toLowerCase();\n}\n\nexport function MenubarTarget(props: MenubarTargetProps) {\n const {\n children,\n refProp,\n className,\n style,\n disabled,\n 'data-disabled': dataDisabled,\n onClick,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onKeyDown,\n ...others\n } = useProps('MenubarTarget', defaultProps, props);\n\n const ctx = useMenubarContext();\n const menuCtx = useMenubarMenuContext();\n const { dir } = useDirection();\n\n const isDisabled = disabled || dataDisabled;\n const isActive = ctx.activeIndex === menuCtx.index;\n\n // Before the menu indexes resolve from the DOM (first render / SSR HTML), every target\n // would otherwise compute `tabIndex={-1}`, leaving the menubar with no tab stop until\n // effects run. Keep unresolved targets focusable so keyboard users can enter the menubar.\n const isUnresolvedTabStop = menuCtx.index === -1 && !isDisabled;\n\n const moveToAdjacent = (direction: 1 | -1) => {\n const nextIndex = ctx.getAdjacentIndex(menuCtx.index, direction);\n ctx.setActiveIndex(nextIndex);\n ctx.focusTarget(nextIndex);\n if (ctx.openIndex !== null) {\n ctx.openMenu(nextIndex, 'click');\n }\n };\n\n const openAndFocusItem = (itemPosition: 'first' | 'last') => {\n ctx.openMenu(menuCtx.index, 'click');\n ctx.setActiveIndex(menuCtx.index);\n ctx.focusMenuItem(menuCtx.index, itemPosition);\n };\n\n const typeAhead = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n const targets = ctx.getTargets();\n if (targets.length === 0) {\n return;\n }\n\n const char = event.key.toLowerCase();\n for (let offset = 1; offset <= targets.length; offset += 1) {\n const index = (menuCtx.index + offset) % targets.length;\n const node = targets[index];\n if (\n node &&\n !node.disabled &&\n !node.hasAttribute('data-disabled') &&\n getTargetLabel(node).startsWith(char)\n ) {\n event.preventDefault();\n ctx.setActiveIndex(index);\n node.focus();\n if (ctx.openIndex !== null) {\n ctx.openMenu(index, 'click');\n }\n break;\n }\n }\n };\n\n const handleClick = createEventHandler<any>(onClick, () => {\n if (isDisabled) {\n return;\n }\n if (ctx.openIndex === menuCtx.index && ctx.getOpenSource() !== 'hover') {\n ctx.closeMenu();\n } else {\n ctx.openMenu(menuCtx.index, 'click');\n ctx.setActiveIndex(menuCtx.index);\n }\n });\n\n const handleMouseEnter = createEventHandler<any>(onMouseEnter, () => {\n if (isDisabled) {\n return;\n }\n ctx.cancelClose();\n if (ctx.trigger === 'hover') {\n ctx.openMenu(menuCtx.index, 'hover');\n ctx.setActiveIndex(menuCtx.index);\n } else if (ctx.openIndex !== null && ctx.openIndex !== menuCtx.index) {\n // Hover-switching with trigger=\"click\" continues a click-driven interaction:\n // keep 'click' as the open source so that the next click on the target\n // closes the menu, same as a click-opened menu (desktop application pattern)\n ctx.openMenu(menuCtx.index, 'click');\n ctx.setActiveIndex(menuCtx.index);\n }\n });\n\n const handleMouseLeave = createEventHandler<any>(onMouseLeave, () => {\n if (ctx.trigger === 'hover') {\n ctx.scheduleClose();\n }\n });\n\n const handleFocus = createEventHandler<any>(onFocus, () => ctx.setActiveIndex(menuCtx.index));\n\n const handleKeyDown = createEventHandler<any>(onKeyDown, (event) => {\n if (isDisabled) {\n return;\n }\n const forwardKey = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n const backKey = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n\n if (event.key === forwardKey) {\n event.preventDefault();\n moveToAdjacent(1);\n } else if (event.key === backKey) {\n event.preventDefault();\n moveToAdjacent(-1);\n } else if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n openAndFocusItem('first');\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n openAndFocusItem('last');\n } else if (event.key === 'Home') {\n event.preventDefault();\n const enabled = ctx.getEnabledIndexes();\n if (enabled.length > 0) {\n ctx.setActiveIndex(enabled[0]);\n ctx.focusTarget(enabled[0]);\n }\n } else if (event.key === 'End') {\n event.preventDefault();\n const enabled = ctx.getEnabledIndexes();\n if (enabled.length > 0) {\n const last = enabled[enabled.length - 1];\n ctx.setActiveIndex(last);\n ctx.focusTarget(last);\n }\n } else if (event.key === 'Escape') {\n if (menuCtx.opened) {\n ctx.closeMenu();\n }\n } else if (event.key === 'Tab') {\n if (menuCtx.opened) {\n ctx.closeMenu();\n }\n } else if (isPrintableKey(event)) {\n typeAhead(event);\n }\n });\n\n return (\n <Popover.Target refProp={refProp} popupType=\"menu\">\n <UnstyledButton\n {...others}\n unstyled={ctx.unstyled}\n role=\"menuitem\"\n tabIndex={isActive || isUnresolvedTabStop ? 0 : -1}\n disabled={disabled}\n data-menubar-target\n data-menubar-id={menuCtx.id}\n data-disabled={dataDisabled || undefined}\n data-expanded={menuCtx.opened || undefined}\n data-mantine-stop-propagation={menuCtx.opened || undefined}\n {...ctx.getStyles('target', { className, style })}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n >\n {children}\n </UnstyledButton>\n </Popover.Target>\n );\n}\n\nMenubarTarget.displayName = '@mantine/core/MenubarTarget';\n"],"mappings":";;;;;;;;;AAwBA,MAAM,eAAe,EACnB,SAAS,MACX;AAEA,SAAS,eAAe,OAA4B;CAClD,OACE,MAAM,IAAI,WAAW,KAAK,MAAM,QAAQ,OAAO,CAAC,MAAM,WAAW,CAAC,MAAM,WAAW,CAAC,MAAM;AAE9F;AAEA,SAAS,eAAe,MAAmB;CACzC,QAAQ,KAAK,eAAe,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY;AACrD;AAEA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AAe,QAAQ,EAAE;IAC7B,IAAI,YAAY,QAAQ,EAAE;GAC5B;EACF,OAAO,IAAI,MAAM,QAAQ,OAAO;GAC9B,MAAM,eAAe;GACrB,MAAM,UAAU,IAAI,kBAAkB;GACtC,IAAI,QAAQ,SAAS,GAAG;IACtB,MAAM,OAAO,QAAQ,QAAQ,SAAS;IACtC,IAAI,eAAe,IAAI;IACvB,IAAI,YAAY,IAAI;GACtB;EACF,OAAO,IAAI,MAAM,QAAQ;OACnB,QAAQ,QACV,IAAI,UAAU;EAAA,OAEX,IAAI,MAAM,QAAQ;OACnB,QAAQ,QACV,IAAI,UAAU;EAAA,OAEX,IAAI,eAAe,KAAK,GAC7B,UAAU,KAAK;CAEnB,CAAC;CAED,OACE,oBAAC,QAAQ,QAAT;EAAyB;EAAS,WAAU;YAC1C,oBAAC,gBAAD;GACE,GAAI;GACJ,UAAU,IAAI;GACd,MAAK;GACL,UAAU,YAAY,sBAAsB,IAAI;GACtC;GACV,uBAAA;GACA,mBAAiB,QAAQ;GACzB,iBAAe,gBAAgB,KAAA;GAC/B,iBAAe,QAAQ,UAAU,KAAA;GACjC,iCAA+B,QAAQ,UAAU,KAAA;GACjD,GAAI,IAAI,UAAU,UAAU;IAAE;IAAW;GAAM,CAAC;GAChD,SAAS;GACT,cAAc;GACd,cAAc;GACd,SAAS;GACT,WAAW;GAEV;EACa,CAAA;CACF,CAAA;AAEpB;AAEA,cAAc,cAAc"}
|
|
1
|
+
{"version":3,"file":"MenubarTarget.mjs","names":[],"sources":["../../../../src/components/Menubar/MenubarTarget/MenubarTarget.tsx"],"sourcesContent":["import {\n createEventHandler,\n ElementProps,\n MantineStyleProp,\n useDirection,\n useProps,\n} from '../../../core';\nimport { Popover } from '../../Popover';\nimport { UnstyledButton } from '../../UnstyledButton';\nimport { useMenubarContext, useMenubarMenuContext } from '../Menubar.context';\n\nexport interface MenubarTargetProps extends ElementProps<'button'> {\n 'data-disabled'?: boolean;\n\n /** Target label */\n children: React.ReactNode;\n\n /** Inline styles applied to the target button */\n style?: MantineStyleProp;\n\n /** Key of the prop used to get element ref, useful for forwarding refs to custom components @default 'ref' */\n refProp?: string;\n}\n\nconst defaultProps = {\n refProp: 'ref',\n} satisfies Partial<MenubarTargetProps>;\n\nfunction isPrintableKey(event: React.KeyboardEvent) {\n return (\n event.key.length === 1 && event.key !== ' ' && !event.ctrlKey && !event.metaKey && !event.altKey\n );\n}\n\nfunction getTargetLabel(node: HTMLElement) {\n return (node.textContent ?? '').trim().toLowerCase();\n}\n\nexport function MenubarTarget(props: MenubarTargetProps) {\n const {\n children,\n refProp,\n className,\n style,\n disabled,\n 'data-disabled': dataDisabled,\n onClick,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onKeyDown,\n ...others\n } = useProps('MenubarTarget', defaultProps, props);\n\n const ctx = useMenubarContext();\n const menuCtx = useMenubarMenuContext();\n const { dir } = useDirection();\n\n const isDisabled = disabled || dataDisabled;\n const isActive = ctx.activeIndex === menuCtx.index;\n\n // Before the menu indexes resolve from the DOM (first render / SSR HTML), every target\n // would otherwise compute `tabIndex={-1}`, leaving the menubar with no tab stop until\n // effects run. Keep unresolved targets focusable so keyboard users can enter the menubar.\n const isUnresolvedTabStop = menuCtx.index === -1 && !isDisabled;\n\n const moveToAdjacent = (direction: 1 | -1) => {\n const nextIndex = ctx.getAdjacentIndex(menuCtx.index, direction);\n ctx.setActiveIndex(nextIndex);\n ctx.focusTarget(nextIndex);\n if (ctx.openIndex !== null) {\n ctx.openMenu(nextIndex, 'click');\n }\n };\n\n const openAndFocusItem = (itemPosition: 'first' | 'last') => {\n ctx.openMenu(menuCtx.index, 'click');\n ctx.setActiveIndex(menuCtx.index);\n ctx.focusMenuItem(menuCtx.index, itemPosition);\n };\n\n const typeAhead = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n const targets = ctx.getTargets();\n if (targets.length === 0) {\n return;\n }\n\n const char = event.key.toLowerCase();\n for (let offset = 1; offset <= targets.length; offset += 1) {\n const index = (menuCtx.index + offset) % targets.length;\n const node = targets[index];\n if (\n node &&\n !node.disabled &&\n !node.hasAttribute('data-disabled') &&\n getTargetLabel(node).startsWith(char)\n ) {\n event.preventDefault();\n ctx.setActiveIndex(index);\n node.focus();\n if (ctx.openIndex !== null) {\n ctx.openMenu(index, 'click');\n }\n break;\n }\n }\n };\n\n const handleClick = createEventHandler<any>(onClick, () => {\n if (isDisabled) {\n return;\n }\n if (ctx.openIndex === menuCtx.index && ctx.getOpenSource() !== 'hover') {\n ctx.closeMenu();\n } else {\n ctx.openMenu(menuCtx.index, 'click');\n ctx.setActiveIndex(menuCtx.index);\n }\n });\n\n const handleMouseEnter = createEventHandler<any>(onMouseEnter, () => {\n if (isDisabled) {\n return;\n }\n ctx.cancelClose();\n if (ctx.trigger === 'hover') {\n ctx.openMenu(menuCtx.index, 'hover');\n ctx.setActiveIndex(menuCtx.index);\n } else if (ctx.openIndex !== null && ctx.openIndex !== menuCtx.index) {\n // Hover-switching with trigger=\"click\" continues a click-driven interaction:\n // keep 'click' as the open source so that the next click on the target\n // closes the menu, same as a click-opened menu (desktop application pattern)\n ctx.openMenu(menuCtx.index, 'click');\n ctx.setActiveIndex(menuCtx.index);\n }\n });\n\n const handleMouseLeave = createEventHandler<any>(onMouseLeave, () => {\n if (ctx.trigger === 'hover') {\n ctx.scheduleClose();\n }\n });\n\n const handleFocus = createEventHandler<any>(onFocus, () => ctx.setActiveIndex(menuCtx.index));\n\n const handleKeyDown = createEventHandler<any>(onKeyDown, (event) => {\n if (isDisabled) {\n return;\n }\n const forwardKey = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n const backKey = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';\n\n if (event.key === forwardKey) {\n event.preventDefault();\n moveToAdjacent(1);\n } else if (event.key === backKey) {\n event.preventDefault();\n moveToAdjacent(-1);\n } else if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n openAndFocusItem('first');\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n openAndFocusItem('last');\n } else if (event.key === 'Home') {\n event.preventDefault();\n const enabled = ctx.getEnabledIndexes();\n if (enabled.length > 0) {\n ctx.setActiveIndex(enabled[0]);\n ctx.focusTarget(enabled[0]);\n }\n } else if (event.key === 'End') {\n event.preventDefault();\n const enabled = ctx.getEnabledIndexes();\n if (enabled.length > 0) {\n const last = enabled[enabled.length - 1];\n ctx.setActiveIndex(last);\n ctx.focusTarget(last);\n }\n } else if (event.key === 'Escape') {\n if (menuCtx.opened) {\n ctx.closeMenu();\n }\n } else if (event.key === 'Tab') {\n if (menuCtx.opened) {\n ctx.closeMenu();\n }\n } else if (isPrintableKey(event)) {\n typeAhead(event);\n }\n });\n\n return (\n <Popover.Target refProp={refProp} popupType=\"menu\">\n <UnstyledButton\n {...others}\n unstyled={ctx.unstyled}\n role=\"menuitem\"\n tabIndex={isActive || isUnresolvedTabStop ? 0 : -1}\n disabled={disabled}\n data-menubar-target\n data-menubar-id={menuCtx.id}\n data-disabled={dataDisabled || undefined}\n data-expanded={menuCtx.opened || undefined}\n data-mantine-stop-propagation={menuCtx.opened || undefined}\n {...ctx.getStyles('target', { className, style })}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n >\n {children}\n </UnstyledButton>\n </Popover.Target>\n );\n}\n\nMenubarTarget.displayName = '@mantine/core/MenubarTarget';\n"],"mappings":";;;;;;;;;AAwBA,MAAM,eAAe,EACnB,SAAS,MACX;AAEA,SAAS,eAAe,OAA4B;CAClD,OACE,MAAM,IAAI,WAAW,KAAK,MAAM,QAAQ,OAAO,CAAC,MAAM,WAAW,CAAC,MAAM,WAAW,CAAC,MAAM;AAE9F;AAEA,SAAS,eAAe,MAAmB;CACzC,QAAQ,KAAK,eAAe,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY;AACrD;AAEA,SAAgB,cAAc,OAA2B;CACvD,MAAM,EACJ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AAQ,EAAE;GAC5B;EACF,OAAO,IAAI,MAAM,QAAQ,OAAO;GAC9B,MAAM,eAAe;GACrB,MAAM,UAAU,IAAI,kBAAkB;GACtC,IAAI,QAAQ,SAAS,GAAG;IACtB,MAAM,OAAO,QAAQ,QAAQ,SAAS;IACtC,IAAI,eAAe,IAAI;IACvB,IAAI,YAAY,IAAI;GACtB;EACF,OAAO,IAAI,MAAM,QAAQ,UACnB;OAAA,QAAQ,QACV,IAAI,UAAU;EAAA,OAEX,IAAI,MAAM,QAAQ,OACnB;OAAA,QAAQ,QACV,IAAI,UAAU;EAAA,OAEX,IAAI,eAAe,KAAK,GAC7B,UAAU,KAAK;CAEnB,CAAC;CAED,OACE,oBAAC,QAAQ,QAAT;EAAyB;EAAS,WAAU;EAC1C,UAAA,oBAAC,gBAAD;GACE,GAAI;GACJ,UAAU,IAAI;GACd,MAAK;GACL,UAAU,YAAY,sBAAsB,IAAI;GACtC;GACV,uBAAA;GACA,mBAAiB,QAAQ;GACzB,iBAAe,gBAAgB,KAAA;GAC/B,iBAAe,QAAQ,UAAU,KAAA;GACjC,iCAA+B,QAAQ,UAAU,KAAA;GACjD,GAAI,IAAI,UAAU,UAAU;IAAE;IAAW;GAAM,CAAC;GAChD,SAAS;GACT,cAAc;GACd,cAAc;GACd,SAAS;GACT,WAAW;GAEV;EACa,CAAA;CACF,CAAA;AAEpB;AAEA,cAAc,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.mjs","names":["classes"],"sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import { use, useEffect } from 'react';\nimport { factory, Factory, getDefaultZIndex, useProps } from '../../core';\nimport { ModalBaseCloseButtonProps, ModalBaseOverlayProps } from '../ModalBase';\nimport { ModalBody, type ModalBodyProps } from './ModalBody';\nimport { ModalCloseButton, type ModalCloseButtonProps } from './ModalCloseButton';\nimport { ModalContent, type ModalContentProps } from './ModalContent';\nimport { ModalHeader, type ModalHeaderProps } from './ModalHeader';\nimport { ModalOverlay, type ModalOverlayProps } from './ModalOverlay';\nimport {\n ModalRoot,\n ModalRootCssVariables,\n ModalRootProps,\n ModalRootStylesNames,\n} from './ModalRoot';\nimport { ModalStack, ModalStackContext, type ModalStackProps } from './ModalStack';\nimport { ModalTitle, type ModalTitleProps } from './ModalTitle';\nimport classes from './Modal.module.css';\nexport type ModalStylesNames = ModalRootStylesNames;\nexport type ModalCssVariables = ModalRootCssVariables;\n\nexport interface ModalProps extends ModalRootProps {\n __staticSelector?: string;\n\n /** Modal title */\n title?: React.ReactNode;\n\n /** If set, the overlay is rendered @default true */\n withOverlay?: boolean;\n\n /** Props passed down to the `Overlay` component, use to configure opacity, `background-color`, styles and other properties */\n overlayProps?: ModalBaseOverlayProps;\n\n /** Modal content */\n children?: React.ReactNode;\n\n /** If set, the close button is rendered @default true */\n withCloseButton?: boolean;\n\n /** Props passed down to the close button */\n closeButtonProps?: ModalBaseCloseButtonProps;\n\n /** Id of the modal in the `Modal.Stack` */\n stackId?: string;\n}\n\nexport type ModalFactory = Factory<{\n props: ModalProps;\n ref: HTMLDivElement;\n stylesNames: ModalStylesNames;\n vars: ModalCssVariables;\n staticComponents: {\n Root: typeof ModalRoot;\n Overlay: typeof ModalOverlay;\n Content: typeof ModalContent;\n Body: typeof ModalBody;\n Header: typeof ModalHeader;\n Title: typeof ModalTitle;\n CloseButton: typeof ModalCloseButton;\n Stack: typeof ModalStack;\n };\n}>;\n\nconst defaultProps = {\n closeOnClickOutside: true,\n withinPortal: true,\n lockScroll: true,\n trapFocus: true,\n returnFocus: true,\n closeOnEscape: true,\n keepMounted: false,\n zIndex: getDefaultZIndex('modal'),\n transitionProps: { duration: 200, transition: 'fade-down' },\n withOverlay: true,\n withCloseButton: true,\n} satisfies Partial<ModalProps>;\n\nexport const Modal = factory<ModalFactory>((_props) => {\n const {\n title,\n withOverlay,\n overlayProps,\n withCloseButton,\n closeButtonProps,\n children,\n radius,\n opened,\n stackId,\n zIndex,\n ...others\n } = useProps('Modal', defaultProps, _props);\n const ctx = use(ModalStackContext);\n const hasHeader = !!title || withCloseButton;\n const stackProps =\n ctx && stackId\n ? {\n closeOnEscape: ctx.currentId === stackId,\n trapFocus: ctx.currentId === stackId,\n zIndex: ctx.getZIndex(stackId),\n }\n : {};\n\n const overlayVisible =\n withOverlay === false ? false : stackId && ctx ? ctx.currentId === stackId : opened;\n\n useEffect(() => {\n if (ctx && stackId) {\n opened\n ? ctx.addModal(stackId, zIndex || getDefaultZIndex('modal'))\n : ctx.removeModal(stackId);\n }\n }, [opened, stackId, zIndex]);\n\n return (\n <ModalRoot\n radius={radius}\n opened={opened}\n zIndex={ctx && stackId ? ctx.getZIndex(stackId) : zIndex}\n {...others}\n {...stackProps}\n >\n {withOverlay && (\n <ModalOverlay\n visible={overlayVisible}\n transitionProps={ctx && stackId ? { duration: 0 } : undefined}\n {...overlayProps}\n />\n )}\n <ModalContent\n radius={radius}\n __hidden={ctx && stackId && opened ? stackId !== ctx.currentId : false}\n >\n {hasHeader && (\n <ModalHeader>\n {title && <ModalTitle>{title}</ModalTitle>}\n {withCloseButton && <ModalCloseButton {...closeButtonProps} />}\n </ModalHeader>\n )}\n\n <ModalBody>{children}</ModalBody>\n </ModalContent>\n </ModalRoot>\n );\n});\n\nModal.classes = classes;\nModal.displayName = '@mantine/core/Modal';\nModal.Root = ModalRoot;\nModal.Overlay = ModalOverlay;\nModal.Content = ModalContent;\nModal.Body = ModalBody;\nModal.Header = ModalHeader;\nModal.Title = ModalTitle;\nModal.CloseButton = ModalCloseButton;\nModal.Stack = ModalStack;\n\nexport namespace Modal {\n export type Props = ModalProps;\n export type StylesNames = ModalStylesNames;\n export type CssVariables = ModalCssVariables;\n export type Factory = ModalFactory;\n\n export namespace Root {\n export type Props = ModalRootProps;\n }\n\n export namespace Body {\n export type Props = ModalBodyProps;\n }\n\n export namespace CloseButton {\n export type Props = ModalCloseButtonProps;\n }\n\n export namespace Content {\n export type Props = ModalContentProps;\n }\n\n export namespace Header {\n export type Props = ModalHeaderProps;\n }\n\n export namespace Overlay {\n export type Props = ModalOverlayProps;\n }\n\n export namespace Title {\n export type Props = ModalTitleProps;\n }\n\n export namespace Stack {\n export type Props = ModalStackProps;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA8DA,MAAM,eAAe;CACnB,qBAAqB;CACrB,cAAc;CACd,YAAY;CACZ,WAAW;CACX,aAAa;CACb,eAAe;CACf,aAAa;CACb,QAAQ,iBAAiB,OAAO;CAChC,iBAAiB;EAAE,UAAU;EAAK,YAAY;CAAY;CAC1D,aAAa;CACb,iBAAiB;AACnB;AAEA,MAAa,QAAQ,SAAuB,WAAW;CACrD,MAAM,EACJ,OACA,aACA,cACA,iBACA,kBACA,UACA,QACA,QACA,SACA,QACA,GAAG,WACD,SAAS,SAAS,cAAc,MAAM;CAC1C,MAAM,MAAM,IAAI,iBAAiB;CACjC,MAAM,YAAY,CAAC,CAAC,SAAS;CAC7B,MAAM,aACJ,OAAO,UACH;EACE,eAAe,IAAI,cAAc;EACjC,WAAW,IAAI,cAAc;EAC7B,QAAQ,IAAI,UAAU,OAAO;CAC/B,IACA,CAAC;CAEP,MAAM,iBACJ,gBAAgB,QAAQ,QAAQ,WAAW,MAAM,IAAI,cAAc,UAAU;CAE/E,gBAAgB;EACd,IAAI,OAAO,SACT,SACI,IAAI,SAAS,SAAS,UAAU,iBAAiB,OAAO,CAAC,IACzD,IAAI,YAAY,OAAO;CAE/B,GAAG;EAAC;EAAQ;EAAS;CAAM,CAAC;CAE5B,OACE,qBAAC,WAAD;EACU;EACA;EACR,QAAQ,OAAO,UAAU,IAAI,UAAU,OAAO,IAAI;EAClD,GAAI;EACJ,GAAI;
|
|
1
|
+
{"version":3,"file":"Modal.mjs","names":["classes"],"sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import { use, useEffect } from 'react';\nimport { factory, Factory, getDefaultZIndex, useProps } from '../../core';\nimport { ModalBaseCloseButtonProps, ModalBaseOverlayProps } from '../ModalBase';\nimport { ModalBody, type ModalBodyProps } from './ModalBody';\nimport { ModalCloseButton, type ModalCloseButtonProps } from './ModalCloseButton';\nimport { ModalContent, type ModalContentProps } from './ModalContent';\nimport { ModalHeader, type ModalHeaderProps } from './ModalHeader';\nimport { ModalOverlay, type ModalOverlayProps } from './ModalOverlay';\nimport {\n ModalRoot,\n ModalRootCssVariables,\n ModalRootProps,\n ModalRootStylesNames,\n} from './ModalRoot';\nimport { ModalStack, ModalStackContext, type ModalStackProps } from './ModalStack';\nimport { ModalTitle, type ModalTitleProps } from './ModalTitle';\nimport classes from './Modal.module.css';\nexport type ModalStylesNames = ModalRootStylesNames;\nexport type ModalCssVariables = ModalRootCssVariables;\n\nexport interface ModalProps extends ModalRootProps {\n __staticSelector?: string;\n\n /** Modal title */\n title?: React.ReactNode;\n\n /** If set, the overlay is rendered @default true */\n withOverlay?: boolean;\n\n /** Props passed down to the `Overlay` component, use to configure opacity, `background-color`, styles and other properties */\n overlayProps?: ModalBaseOverlayProps;\n\n /** Modal content */\n children?: React.ReactNode;\n\n /** If set, the close button is rendered @default true */\n withCloseButton?: boolean;\n\n /** Props passed down to the close button */\n closeButtonProps?: ModalBaseCloseButtonProps;\n\n /** Id of the modal in the `Modal.Stack` */\n stackId?: string;\n}\n\nexport type ModalFactory = Factory<{\n props: ModalProps;\n ref: HTMLDivElement;\n stylesNames: ModalStylesNames;\n vars: ModalCssVariables;\n staticComponents: {\n Root: typeof ModalRoot;\n Overlay: typeof ModalOverlay;\n Content: typeof ModalContent;\n Body: typeof ModalBody;\n Header: typeof ModalHeader;\n Title: typeof ModalTitle;\n CloseButton: typeof ModalCloseButton;\n Stack: typeof ModalStack;\n };\n}>;\n\nconst defaultProps = {\n closeOnClickOutside: true,\n withinPortal: true,\n lockScroll: true,\n trapFocus: true,\n returnFocus: true,\n closeOnEscape: true,\n keepMounted: false,\n zIndex: getDefaultZIndex('modal'),\n transitionProps: { duration: 200, transition: 'fade-down' },\n withOverlay: true,\n withCloseButton: true,\n} satisfies Partial<ModalProps>;\n\nexport const Modal = factory<ModalFactory>((_props) => {\n const {\n title,\n withOverlay,\n overlayProps,\n withCloseButton,\n closeButtonProps,\n children,\n radius,\n opened,\n stackId,\n zIndex,\n ...others\n } = useProps('Modal', defaultProps, _props);\n const ctx = use(ModalStackContext);\n const hasHeader = !!title || withCloseButton;\n const stackProps =\n ctx && stackId\n ? {\n closeOnEscape: ctx.currentId === stackId,\n trapFocus: ctx.currentId === stackId,\n zIndex: ctx.getZIndex(stackId),\n }\n : {};\n\n const overlayVisible =\n withOverlay === false ? false : stackId && ctx ? ctx.currentId === stackId : opened;\n\n useEffect(() => {\n if (ctx && stackId) {\n opened\n ? ctx.addModal(stackId, zIndex || getDefaultZIndex('modal'))\n : ctx.removeModal(stackId);\n }\n }, [opened, stackId, zIndex]);\n\n return (\n <ModalRoot\n radius={radius}\n opened={opened}\n zIndex={ctx && stackId ? ctx.getZIndex(stackId) : zIndex}\n {...others}\n {...stackProps}\n >\n {withOverlay && (\n <ModalOverlay\n visible={overlayVisible}\n transitionProps={ctx && stackId ? { duration: 0 } : undefined}\n {...overlayProps}\n />\n )}\n <ModalContent\n radius={radius}\n __hidden={ctx && stackId && opened ? stackId !== ctx.currentId : false}\n >\n {hasHeader && (\n <ModalHeader>\n {title && <ModalTitle>{title}</ModalTitle>}\n {withCloseButton && <ModalCloseButton {...closeButtonProps} />}\n </ModalHeader>\n )}\n\n <ModalBody>{children}</ModalBody>\n </ModalContent>\n </ModalRoot>\n );\n});\n\nModal.classes = classes;\nModal.displayName = '@mantine/core/Modal';\nModal.Root = ModalRoot;\nModal.Overlay = ModalOverlay;\nModal.Content = ModalContent;\nModal.Body = ModalBody;\nModal.Header = ModalHeader;\nModal.Title = ModalTitle;\nModal.CloseButton = ModalCloseButton;\nModal.Stack = ModalStack;\n\nexport namespace Modal {\n export type Props = ModalProps;\n export type StylesNames = ModalStylesNames;\n export type CssVariables = ModalCssVariables;\n export type Factory = ModalFactory;\n\n export namespace Root {\n export type Props = ModalRootProps;\n }\n\n export namespace Body {\n export type Props = ModalBodyProps;\n }\n\n export namespace CloseButton {\n export type Props = ModalCloseButtonProps;\n }\n\n export namespace Content {\n export type Props = ModalContentProps;\n }\n\n export namespace Header {\n export type Props = ModalHeaderProps;\n }\n\n export namespace Overlay {\n export type Props = ModalOverlayProps;\n }\n\n export namespace Title {\n export type Props = ModalTitleProps;\n }\n\n export namespace Stack {\n export type Props = ModalStackProps;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA8DA,MAAM,eAAe;CACnB,qBAAqB;CACrB,cAAc;CACd,YAAY;CACZ,WAAW;CACX,aAAa;CACb,eAAe;CACf,aAAa;CACb,QAAQ,iBAAiB,OAAO;CAChC,iBAAiB;EAAE,UAAU;EAAK,YAAY;CAAY;CAC1D,aAAa;CACb,iBAAiB;AACnB;AAEA,MAAa,QAAQ,SAAuB,WAAW;CACrD,MAAM,EACJ,OACA,aACA,cACA,iBACA,kBACA,UACA,QACA,QACA,SACA,QACA,GAAG,WACD,SAAS,SAAS,cAAc,MAAM;CAC1C,MAAM,MAAM,IAAI,iBAAiB;CACjC,MAAM,YAAY,CAAC,CAAC,SAAS;CAC7B,MAAM,aACJ,OAAO,UACH;EACE,eAAe,IAAI,cAAc;EACjC,WAAW,IAAI,cAAc;EAC7B,QAAQ,IAAI,UAAU,OAAO;CAC/B,IACA,CAAC;CAEP,MAAM,iBACJ,gBAAgB,QAAQ,QAAQ,WAAW,MAAM,IAAI,cAAc,UAAU;CAE/E,gBAAgB;EACd,IAAI,OAAO,SACT,SACI,IAAI,SAAS,SAAS,UAAU,iBAAiB,OAAO,CAAC,IACzD,IAAI,YAAY,OAAO;CAE/B,GAAG;EAAC;EAAQ;EAAS;CAAM,CAAC;CAE5B,OACE,qBAAC,WAAD;EACU;EACA;EACR,QAAQ,OAAO,UAAU,IAAI,UAAU,OAAO,IAAI;EAClD,GAAI;EACJ,GAAI;EALN,UAAA,CAOG,eACC,oBAAC,cAAD;GACE,SAAS;GACT,iBAAiB,OAAO,UAAU,EAAE,UAAU,EAAE,IAAI,KAAA;GACpD,GAAI;EACL,CAAA,GAEH,qBAAC,cAAD;GACU;GACR,UAAU,OAAO,WAAW,SAAS,YAAY,IAAI,YAAY;GAFnE,UAAA,CAIG,aACC,qBAAC,aAAD,EAAA,UAAA,CACG,SAAS,oBAAC,YAAD,EAAA,UAAa,MAAkB,CAAA,GACxC,mBAAmB,oBAAC,kBAAD,EAAkB,GAAI,iBAAmB,CAAA,CAClD,EAAA,CAAA,GAGf,oBAAC,WAAD,EAAY,SAAoB,CAAA,CACpB;EACL,CAAA,CAAA;;AAEf,CAAC;AAED,MAAM,UAAUA;AAChB,MAAM,cAAc;AACpB,MAAM,OAAO;AACb,MAAM,UAAU;AAChB,MAAM,UAAU;AAChB,MAAM,OAAO;AACb,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,cAAc;AACpB,MAAM,QAAQ"}
|
|
@@ -8,8 +8,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
//#region packages/@mantine/core/src/components/Modal/ModalBody.tsx
|
|
9
9
|
const ModalBody = factory((_props) => {
|
|
10
10
|
const { classNames, className, style, styles, vars, ...others } = useProps("ModalBody", null, _props);
|
|
11
|
+
const ctx = useModalContext();
|
|
11
12
|
return /* @__PURE__ */ jsx(ModalBaseBody, {
|
|
12
|
-
...
|
|
13
|
+
...ctx.getStyles("body", {
|
|
13
14
|
classNames,
|
|
14
15
|
style,
|
|
15
16
|
styles,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalBody.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalBody.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, useProps } from '../../core';\nimport { ModalBaseBody, ModalBaseBodyProps } from '../ModalBase';\nimport { useModalContext } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalBodyStylesNames = 'body';\n\nexport interface ModalBodyProps\n extends ModalBaseBodyProps, CompoundStylesApiProps<ModalBodyFactory> {}\n\nexport type ModalBodyFactory = Factory<{\n props: ModalBodyProps;\n ref: HTMLDivElement;\n stylesNames: ModalBodyStylesNames;\n compound: true;\n}>;\n\nexport const ModalBody = factory<ModalBodyFactory>((_props) => {\n const props = useProps('ModalBody', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n\n const ctx = useModalContext();\n\n return (\n <ModalBaseBody\n {...ctx.getStyles('body', { classNames, style, styles, className })}\n {...others}\n />\n );\n});\n\nModalBody.classes = classes;\nModalBody.displayName = '@mantine/core/ModalBody';\n"],"mappings":";;;;;;;;AAiBA,MAAa,YAAY,SAA2B,WAAW;CAE7D,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WADzC,SAAS,aAAa,MAAM,MAC4B;
|
|
1
|
+
{"version":3,"file":"ModalBody.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalBody.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, useProps } from '../../core';\nimport { ModalBaseBody, ModalBaseBodyProps } from '../ModalBase';\nimport { useModalContext } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalBodyStylesNames = 'body';\n\nexport interface ModalBodyProps\n extends ModalBaseBodyProps, CompoundStylesApiProps<ModalBodyFactory> {}\n\nexport type ModalBodyFactory = Factory<{\n props: ModalBodyProps;\n ref: HTMLDivElement;\n stylesNames: ModalBodyStylesNames;\n compound: true;\n}>;\n\nexport const ModalBody = factory<ModalBodyFactory>((_props) => {\n const props = useProps('ModalBody', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n\n const ctx = useModalContext();\n\n return (\n <ModalBaseBody\n {...ctx.getStyles('body', { classNames, style, styles, className })}\n {...others}\n />\n );\n});\n\nModalBody.classes = classes;\nModalBody.displayName = '@mantine/core/ModalBody';\n"],"mappings":";;;;;;;;AAiBA,MAAa,YAAY,SAA2B,WAAW;CAE7D,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WADzC,SAAS,aAAa,MAAM,MAC4B;CAEtE,MAAM,MAAM,gBAAgB;CAE5B,OACE,oBAAC,eAAD;EACE,GAAI,IAAI,UAAU,QAAQ;GAAE;GAAY;GAAO;GAAQ;EAAU,CAAC;EAClE,GAAI;CACL,CAAA;AAEL,CAAC;AAED,UAAU,UAAUA;AACpB,UAAU,cAAc"}
|
|
@@ -8,8 +8,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
//#region packages/@mantine/core/src/components/Modal/ModalCloseButton.tsx
|
|
9
9
|
const ModalCloseButton = factory((_props) => {
|
|
10
10
|
const { classNames, className, style, styles, vars, ...others } = useProps("ModalCloseButton", null, _props);
|
|
11
|
+
const ctx = useModalContext();
|
|
11
12
|
return /* @__PURE__ */ jsx(ModalBaseCloseButton, {
|
|
12
|
-
...
|
|
13
|
+
...ctx.getStyles("close", {
|
|
13
14
|
classNames,
|
|
14
15
|
style,
|
|
15
16
|
styles,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalCloseButton.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalCloseButton.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, useProps } from '../../core';\nimport { ModalBaseCloseButton, ModalBaseCloseButtonProps } from '../ModalBase';\nimport { useModalContext } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalCloseButtonStylesNames = 'close';\n\nexport interface ModalCloseButtonProps\n extends ModalBaseCloseButtonProps, CompoundStylesApiProps<ModalCloseButtonFactory> {}\n\nexport type ModalCloseButtonFactory = Factory<{\n props: ModalCloseButtonProps;\n ref: HTMLButtonElement;\n stylesNames: ModalCloseButtonStylesNames;\n compound: true;\n}>;\n\nexport const ModalCloseButton = factory<ModalCloseButtonFactory>((_props) => {\n const props = useProps('ModalCloseButton', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n\n const ctx = useModalContext();\n\n return (\n <ModalBaseCloseButton\n {...ctx.getStyles('close', { classNames, style, styles, className })}\n {...others}\n />\n );\n});\n\nModalCloseButton.classes = classes;\nModalCloseButton.displayName = '@mantine/core/ModalCloseButton';\n"],"mappings":";;;;;;;;AAiBA,MAAa,mBAAmB,SAAkC,WAAW;CAE3E,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WADzC,SAAS,oBAAoB,MAAM,MACqB;
|
|
1
|
+
{"version":3,"file":"ModalCloseButton.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalCloseButton.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, useProps } from '../../core';\nimport { ModalBaseCloseButton, ModalBaseCloseButtonProps } from '../ModalBase';\nimport { useModalContext } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalCloseButtonStylesNames = 'close';\n\nexport interface ModalCloseButtonProps\n extends ModalBaseCloseButtonProps, CompoundStylesApiProps<ModalCloseButtonFactory> {}\n\nexport type ModalCloseButtonFactory = Factory<{\n props: ModalCloseButtonProps;\n ref: HTMLButtonElement;\n stylesNames: ModalCloseButtonStylesNames;\n compound: true;\n}>;\n\nexport const ModalCloseButton = factory<ModalCloseButtonFactory>((_props) => {\n const props = useProps('ModalCloseButton', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n\n const ctx = useModalContext();\n\n return (\n <ModalBaseCloseButton\n {...ctx.getStyles('close', { classNames, style, styles, className })}\n {...others}\n />\n );\n});\n\nModalCloseButton.classes = classes;\nModalCloseButton.displayName = '@mantine/core/ModalCloseButton';\n"],"mappings":";;;;;;;;AAiBA,MAAa,mBAAmB,SAAkC,WAAW;CAE3E,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WADzC,SAAS,oBAAoB,MAAM,MACqB;CAEtE,MAAM,MAAM,gBAAgB;CAE5B,OACE,oBAAC,sBAAD;EACE,GAAI,IAAI,UAAU,SAAS;GAAE;GAAY;GAAO;GAAQ;EAAU,CAAC;EACnE,GAAI;CACL,CAAA;AAEL,CAAC;AAED,iBAAiB,UAAUA;AAC3B,iBAAiB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalContent.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalContent.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, rem, useProps } from '../../core';\nimport { ModalBaseContent, ModalBaseContentProps, NativeScrollArea } from '../ModalBase';\nimport { useModalContext } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalContentStylesNames = 'content' | 'inner';\n\nexport interface ModalContentProps\n extends ModalBaseContentProps, CompoundStylesApiProps<ModalContentFactory> {\n __hidden?: boolean;\n}\n\nexport type ModalContentFactory = Factory<{\n props: ModalContentProps;\n ref: HTMLDivElement;\n stylesNames: ModalContentStylesNames;\n compound: true;\n}>;\n\nexport const ModalContent = factory<ModalContentFactory>((_props) => {\n const props = useProps('ModalContent', null, _props);\n const { classNames, className, style, styles, vars, children, __hidden, ...others } = props;\n\n const ctx = useModalContext();\n const Scroll: React.FC<any> = ctx.scrollAreaComponent || NativeScrollArea;\n\n return (\n <ModalBaseContent\n {...ctx.getStyles('content', { className, style, styles, classNames })}\n innerProps={ctx.getStyles('inner', { className, style, styles, classNames })}\n data-full-screen={ctx.fullScreen || undefined}\n data-modal-content\n data-hidden={__hidden || undefined}\n {...others}\n >\n <Scroll\n style={{\n maxHeight: ctx.fullScreen ? '100dvh' : `calc(100dvh - (${rem(ctx.yOffset)} * 2))`,\n }}\n >\n {children}\n </Scroll>\n </ModalBaseContent>\n );\n});\n\nModalContent.classes = classes;\nModalContent.displayName = '@mantine/core/ModalContent';\n"],"mappings":";;;;;;;;;;AAmBA,MAAa,eAAe,SAA8B,WAAW;CAEnE,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,UAAU,UAAU,GAAG,WAD7D,SAAS,gBAAgB,MAAM,MAC6C;CAE1F,MAAM,MAAM,gBAAgB;CAC5B,MAAM,SAAwB,IAAI,uBAAuB;CAEzD,OACE,oBAAC,kBAAD;EACE,GAAI,IAAI,UAAU,WAAW;GAAE;GAAW;GAAO;GAAQ;EAAW,CAAC;EACrE,YAAY,IAAI,UAAU,SAAS;GAAE;GAAW;GAAO;GAAQ;EAAW,CAAC;EAC3E,oBAAkB,IAAI,cAAc,KAAA;EACpC,sBAAA;EACA,eAAa,YAAY,KAAA;EACzB,GAAI;
|
|
1
|
+
{"version":3,"file":"ModalContent.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalContent.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, rem, useProps } from '../../core';\nimport { ModalBaseContent, ModalBaseContentProps, NativeScrollArea } from '../ModalBase';\nimport { useModalContext } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalContentStylesNames = 'content' | 'inner';\n\nexport interface ModalContentProps\n extends ModalBaseContentProps, CompoundStylesApiProps<ModalContentFactory> {\n __hidden?: boolean;\n}\n\nexport type ModalContentFactory = Factory<{\n props: ModalContentProps;\n ref: HTMLDivElement;\n stylesNames: ModalContentStylesNames;\n compound: true;\n}>;\n\nexport const ModalContent = factory<ModalContentFactory>((_props) => {\n const props = useProps('ModalContent', null, _props);\n const { classNames, className, style, styles, vars, children, __hidden, ...others } = props;\n\n const ctx = useModalContext();\n const Scroll: React.FC<any> = ctx.scrollAreaComponent || NativeScrollArea;\n\n return (\n <ModalBaseContent\n {...ctx.getStyles('content', { className, style, styles, classNames })}\n innerProps={ctx.getStyles('inner', { className, style, styles, classNames })}\n data-full-screen={ctx.fullScreen || undefined}\n data-modal-content\n data-hidden={__hidden || undefined}\n {...others}\n >\n <Scroll\n style={{\n maxHeight: ctx.fullScreen ? '100dvh' : `calc(100dvh - (${rem(ctx.yOffset)} * 2))`,\n }}\n >\n {children}\n </Scroll>\n </ModalBaseContent>\n );\n});\n\nModalContent.classes = classes;\nModalContent.displayName = '@mantine/core/ModalContent';\n"],"mappings":";;;;;;;;;;AAmBA,MAAa,eAAe,SAA8B,WAAW;CAEnE,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,UAAU,UAAU,GAAG,WAD7D,SAAS,gBAAgB,MAAM,MAC6C;CAE1F,MAAM,MAAM,gBAAgB;CAC5B,MAAM,SAAwB,IAAI,uBAAuB;CAEzD,OACE,oBAAC,kBAAD;EACE,GAAI,IAAI,UAAU,WAAW;GAAE;GAAW;GAAO;GAAQ;EAAW,CAAC;EACrE,YAAY,IAAI,UAAU,SAAS;GAAE;GAAW;GAAO;GAAQ;EAAW,CAAC;EAC3E,oBAAkB,IAAI,cAAc,KAAA;EACpC,sBAAA;EACA,eAAa,YAAY,KAAA;EACzB,GAAI;EAEJ,UAAA,oBAAC,QAAD;GACE,OAAO,EACL,WAAW,IAAI,aAAa,WAAW,kBAAkB,IAAI,IAAI,OAAO,EAAE,QAC5E;GAEC;EACK,CAAA;CACQ,CAAA;AAEtB,CAAC;AAED,aAAa,UAAUA;AACvB,aAAa,cAAc"}
|
|
@@ -8,8 +8,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
//#region packages/@mantine/core/src/components/Modal/ModalHeader.tsx
|
|
9
9
|
const ModalHeader = factory((_props) => {
|
|
10
10
|
const { classNames, className, style, styles, vars, ...others } = useProps("ModalHeader", null, _props);
|
|
11
|
+
const ctx = useModalContext();
|
|
11
12
|
return /* @__PURE__ */ jsx(ModalBaseHeader, {
|
|
12
|
-
...
|
|
13
|
+
...ctx.getStyles("header", {
|
|
13
14
|
classNames,
|
|
14
15
|
style,
|
|
15
16
|
styles,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalHeader.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalHeader.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, useProps } from '../../core';\nimport { ModalBaseHeader, ModalBaseHeaderProps } from '../ModalBase';\nimport { useModalContext } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalHeaderStylesNames = 'header';\n\nexport interface ModalHeaderProps\n extends ModalBaseHeaderProps, CompoundStylesApiProps<ModalHeaderFactory> {}\n\nexport type ModalHeaderFactory = Factory<{\n props: ModalHeaderProps;\n ref: HTMLElement;\n stylesNames: ModalHeaderStylesNames;\n compound: true;\n}>;\n\nexport const ModalHeader = factory<ModalHeaderFactory>((_props) => {\n const props = useProps('ModalHeader', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n\n const ctx = useModalContext();\n\n return (\n <ModalBaseHeader\n {...ctx.getStyles('header', { classNames, style, styles, className })}\n {...others}\n />\n );\n});\n\nModalHeader.classes = classes;\nModalHeader.displayName = '@mantine/core/ModalHeader';\n"],"mappings":";;;;;;;;AAiBA,MAAa,cAAc,SAA6B,WAAW;CAEjE,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WADzC,SAAS,eAAe,MAAM,MAC0B;
|
|
1
|
+
{"version":3,"file":"ModalHeader.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalHeader.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, useProps } from '../../core';\nimport { ModalBaseHeader, ModalBaseHeaderProps } from '../ModalBase';\nimport { useModalContext } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalHeaderStylesNames = 'header';\n\nexport interface ModalHeaderProps\n extends ModalBaseHeaderProps, CompoundStylesApiProps<ModalHeaderFactory> {}\n\nexport type ModalHeaderFactory = Factory<{\n props: ModalHeaderProps;\n ref: HTMLElement;\n stylesNames: ModalHeaderStylesNames;\n compound: true;\n}>;\n\nexport const ModalHeader = factory<ModalHeaderFactory>((_props) => {\n const props = useProps('ModalHeader', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n\n const ctx = useModalContext();\n\n return (\n <ModalBaseHeader\n {...ctx.getStyles('header', { classNames, style, styles, className })}\n {...others}\n />\n );\n});\n\nModalHeader.classes = classes;\nModalHeader.displayName = '@mantine/core/ModalHeader';\n"],"mappings":";;;;;;;;AAiBA,MAAa,cAAc,SAA6B,WAAW;CAEjE,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WADzC,SAAS,eAAe,MAAM,MAC0B;CAEtE,MAAM,MAAM,gBAAgB;CAE5B,OACE,oBAAC,iBAAD;EACE,GAAI,IAAI,UAAU,UAAU;GAAE;GAAY;GAAO;GAAQ;EAAU,CAAC;EACpE,GAAI;CACL,CAAA;AAEL,CAAC;AAED,YAAY,UAAUA;AACtB,YAAY,cAAc"}
|
|
@@ -8,8 +8,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
//#region packages/@mantine/core/src/components/Modal/ModalOverlay.tsx
|
|
9
9
|
const ModalOverlay = factory((_props) => {
|
|
10
10
|
const { classNames, className, style, styles, vars, ...others } = useProps("ModalOverlay", null, _props);
|
|
11
|
+
const ctx = useModalContext();
|
|
11
12
|
return /* @__PURE__ */ jsx(ModalBaseOverlay, {
|
|
12
|
-
...
|
|
13
|
+
...ctx.getStyles("overlay", {
|
|
13
14
|
classNames,
|
|
14
15
|
style,
|
|
15
16
|
styles,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalOverlay.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalOverlay.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, useProps } from '../../core';\nimport { ModalBaseOverlay, ModalBaseOverlayProps } from '../ModalBase';\nimport { useModalContext } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalOverlayStylesNames = 'overlay';\n\nexport interface ModalOverlayProps\n extends ModalBaseOverlayProps, CompoundStylesApiProps<ModalOverlayFactory> {}\n\nexport type ModalOverlayFactory = Factory<{\n props: ModalOverlayProps;\n ref: HTMLDivElement;\n stylesNames: ModalOverlayStylesNames;\n compound: true;\n}>;\n\nexport const ModalOverlay = factory<ModalOverlayFactory>((_props) => {\n const props = useProps('ModalOverlay', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n\n const ctx = useModalContext();\n\n return (\n <ModalBaseOverlay\n {...ctx.getStyles('overlay', { classNames, style, styles, className })}\n {...others}\n />\n );\n});\n\nModalOverlay.classes = classes;\nModalOverlay.displayName = '@mantine/core/ModalOverlay';\n"],"mappings":";;;;;;;;AAiBA,MAAa,eAAe,SAA8B,WAAW;CAEnE,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WADzC,SAAS,gBAAgB,MAAM,MACyB;
|
|
1
|
+
{"version":3,"file":"ModalOverlay.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalOverlay.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, useProps } from '../../core';\nimport { ModalBaseOverlay, ModalBaseOverlayProps } from '../ModalBase';\nimport { useModalContext } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalOverlayStylesNames = 'overlay';\n\nexport interface ModalOverlayProps\n extends ModalBaseOverlayProps, CompoundStylesApiProps<ModalOverlayFactory> {}\n\nexport type ModalOverlayFactory = Factory<{\n props: ModalOverlayProps;\n ref: HTMLDivElement;\n stylesNames: ModalOverlayStylesNames;\n compound: true;\n}>;\n\nexport const ModalOverlay = factory<ModalOverlayFactory>((_props) => {\n const props = useProps('ModalOverlay', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n\n const ctx = useModalContext();\n\n return (\n <ModalBaseOverlay\n {...ctx.getStyles('overlay', { classNames, style, styles, className })}\n {...others}\n />\n );\n});\n\nModalOverlay.classes = classes;\nModalOverlay.displayName = '@mantine/core/ModalOverlay';\n"],"mappings":";;;;;;;;AAiBA,MAAa,eAAe,SAA8B,WAAW;CAEnE,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WADzC,SAAS,gBAAgB,MAAM,MACyB;CAEtE,MAAM,MAAM,gBAAgB;CAE5B,OACE,oBAAC,kBAAD;EACE,GAAI,IAAI,UAAU,WAAW;GAAE;GAAY;GAAO;GAAQ;EAAU,CAAC;EACrE,GAAI;CACL,CAAA;AAEL,CAAC;AAED,aAAa,UAAUA;AACvB,aAAa,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalRoot.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalRoot.tsx"],"sourcesContent":["import {\n createVarsResolver,\n factory,\n Factory,\n getDefaultZIndex,\n getRadius,\n getSize,\n MantineRadius,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { ModalBase, ModalBaseProps, ModalBaseStylesNames } from '../ModalBase';\nimport { ScrollArea } from '../ScrollArea';\nimport { ModalProvider, ScrollAreaComponent } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalRootStylesNames = ModalBaseStylesNames;\nexport type ModalRootCssVariables = {\n root: '--modal-radius' | '--modal-size' | '--modal-y-offset' | '--modal-x-offset';\n};\n\nexport interface ModalRootProps extends StylesApiProps<ModalRootFactory>, ModalBaseProps {\n __staticSelector?: string;\n\n /** Top/bottom modal offset @default 5dvh */\n yOffset?: React.CSSProperties['marginTop'];\n\n /** Left/right modal offset @default 5vw */\n xOffset?: React.CSSProperties['marginLeft'];\n\n /** Scroll area component @default 'div' */\n scrollAreaComponent?: ScrollAreaComponent;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** If set, the modal is centered vertically @default false */\n centered?: boolean;\n\n /** If set, the modal takes the entire screen @default false */\n fullScreen?: boolean;\n}\n\nexport type ModalRootFactory = Factory<{\n props: ModalRootProps;\n ref: HTMLDivElement;\n stylesNames: ModalRootStylesNames;\n vars: ModalRootCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'Modal',\n closeOnClickOutside: true,\n withinPortal: true,\n lockScroll: true,\n trapFocus: true,\n returnFocus: true,\n closeOnEscape: true,\n keepMounted: false,\n zIndex: getDefaultZIndex('modal'),\n transitionProps: { duration: 200, transition: 'fade-down' },\n yOffset: '5dvh',\n} satisfies Partial<ModalRootProps>;\n\nconst varsResolver = createVarsResolver<ModalRootFactory>(\n (_, { radius, size, yOffset, xOffset }) => ({\n root: {\n '--modal-radius': radius === undefined ? undefined : getRadius(radius),\n '--modal-size': getSize(size, 'modal-size'),\n '--modal-y-offset': rem(yOffset),\n '--modal-x-offset': rem(xOffset),\n },\n })\n);\n\nexport const ModalRoot = factory<ModalRootFactory>((_props) => {\n const props = useProps('ModalRoot', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n yOffset,\n scrollAreaComponent,\n radius,\n fullScreen,\n centered,\n xOffset,\n __staticSelector,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<ModalRootFactory>({\n name: __staticSelector,\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 <ModalProvider value={{ yOffset, scrollAreaComponent, getStyles, fullScreen }}>\n <ModalBase\n {...getStyles('root')}\n data-full-screen={fullScreen || undefined}\n data-centered={centered || undefined}\n data-offset-scrollbars={scrollAreaComponent === ScrollArea.Autosize || undefined}\n unstyled={unstyled}\n {...others}\n />\n </ModalProvider>\n );\n});\n\nModalRoot.classes = classes;\nModalRoot.varsResolver = varsResolver;\nModalRoot.displayName = '@mantine/core/ModalRoot';\n"],"mappings":";;;;;;;;;;;;;;AAoDA,MAAM,eAAe;CACnB,kBAAkB;CAClB,qBAAqB;CACrB,cAAc;CACd,YAAY;CACZ,WAAW;CACX,aAAa;CACb,eAAe;CACf,aAAa;CACb,QAAQ,iBAAiB,OAAO;CAChC,iBAAiB;EAAE,UAAU;EAAK,YAAY;CAAY;CAC1D,SAAS;AACX;AAEA,MAAM,eAAe,oBAClB,GAAG,EAAE,QAAQ,MAAM,SAAS,eAAe,EAC1C,MAAM;CACJ,kBAAkB,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,MAAM;CACrE,gBAAgB,QAAQ,MAAM,YAAY;CAC1C,oBAAoB,IAAI,OAAO;CAC/B,oBAAoB,IAAI,OAAO;AACjC,EACF,EACF;AAEA,MAAa,YAAY,SAA2B,WAAW;CAC7D,MAAM,QAAQ,SAAS,aAAa,cAAc,MAAM;CACxD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,SACA,qBACA,QACA,YACA,UACA,SACA,kBACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAA4B;EAC5C,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,OACE,oBAAC,eAAD;EAAe,OAAO;GAAE;GAAS;GAAqB;GAAW;EAAW;
|
|
1
|
+
{"version":3,"file":"ModalRoot.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalRoot.tsx"],"sourcesContent":["import {\n createVarsResolver,\n factory,\n Factory,\n getDefaultZIndex,\n getRadius,\n getSize,\n MantineRadius,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { ModalBase, ModalBaseProps, ModalBaseStylesNames } from '../ModalBase';\nimport { ScrollArea } from '../ScrollArea';\nimport { ModalProvider, ScrollAreaComponent } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalRootStylesNames = ModalBaseStylesNames;\nexport type ModalRootCssVariables = {\n root: '--modal-radius' | '--modal-size' | '--modal-y-offset' | '--modal-x-offset';\n};\n\nexport interface ModalRootProps extends StylesApiProps<ModalRootFactory>, ModalBaseProps {\n __staticSelector?: string;\n\n /** Top/bottom modal offset @default 5dvh */\n yOffset?: React.CSSProperties['marginTop'];\n\n /** Left/right modal offset @default 5vw */\n xOffset?: React.CSSProperties['marginLeft'];\n\n /** Scroll area component @default 'div' */\n scrollAreaComponent?: ScrollAreaComponent;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** If set, the modal is centered vertically @default false */\n centered?: boolean;\n\n /** If set, the modal takes the entire screen @default false */\n fullScreen?: boolean;\n}\n\nexport type ModalRootFactory = Factory<{\n props: ModalRootProps;\n ref: HTMLDivElement;\n stylesNames: ModalRootStylesNames;\n vars: ModalRootCssVariables;\n}>;\n\nconst defaultProps = {\n __staticSelector: 'Modal',\n closeOnClickOutside: true,\n withinPortal: true,\n lockScroll: true,\n trapFocus: true,\n returnFocus: true,\n closeOnEscape: true,\n keepMounted: false,\n zIndex: getDefaultZIndex('modal'),\n transitionProps: { duration: 200, transition: 'fade-down' },\n yOffset: '5dvh',\n} satisfies Partial<ModalRootProps>;\n\nconst varsResolver = createVarsResolver<ModalRootFactory>(\n (_, { radius, size, yOffset, xOffset }) => ({\n root: {\n '--modal-radius': radius === undefined ? undefined : getRadius(radius),\n '--modal-size': getSize(size, 'modal-size'),\n '--modal-y-offset': rem(yOffset),\n '--modal-x-offset': rem(xOffset),\n },\n })\n);\n\nexport const ModalRoot = factory<ModalRootFactory>((_props) => {\n const props = useProps('ModalRoot', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n yOffset,\n scrollAreaComponent,\n radius,\n fullScreen,\n centered,\n xOffset,\n __staticSelector,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<ModalRootFactory>({\n name: __staticSelector,\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 <ModalProvider value={{ yOffset, scrollAreaComponent, getStyles, fullScreen }}>\n <ModalBase\n {...getStyles('root')}\n data-full-screen={fullScreen || undefined}\n data-centered={centered || undefined}\n data-offset-scrollbars={scrollAreaComponent === ScrollArea.Autosize || undefined}\n unstyled={unstyled}\n {...others}\n />\n </ModalProvider>\n );\n});\n\nModalRoot.classes = classes;\nModalRoot.varsResolver = varsResolver;\nModalRoot.displayName = '@mantine/core/ModalRoot';\n"],"mappings":";;;;;;;;;;;;;;AAoDA,MAAM,eAAe;CACnB,kBAAkB;CAClB,qBAAqB;CACrB,cAAc;CACd,YAAY;CACZ,WAAW;CACX,aAAa;CACb,eAAe;CACf,aAAa;CACb,QAAQ,iBAAiB,OAAO;CAChC,iBAAiB;EAAE,UAAU;EAAK,YAAY;CAAY;CAC1D,SAAS;AACX;AAEA,MAAM,eAAe,oBAClB,GAAG,EAAE,QAAQ,MAAM,SAAS,eAAe,EAC1C,MAAM;CACJ,kBAAkB,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,MAAM;CACrE,gBAAgB,QAAQ,MAAM,YAAY;CAC1C,oBAAoB,IAAI,OAAO;CAC/B,oBAAoB,IAAI,OAAO;AACjC,EACF,EACF;AAEA,MAAa,YAAY,SAA2B,WAAW;CAC7D,MAAM,QAAQ,SAAS,aAAa,cAAc,MAAM;CACxD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,SACA,qBACA,QACA,YACA,UACA,SACA,kBACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAA4B;EAC5C,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,OACE,oBAAC,eAAD;EAAe,OAAO;GAAE;GAAS;GAAqB;GAAW;EAAW;EAC1E,UAAA,oBAAC,WAAD;GACE,GAAI,UAAU,MAAM;GACpB,oBAAkB,cAAc,KAAA;GAChC,iBAAe,YAAY,KAAA;GAC3B,0BAAwB,wBAAwB,WAAW,YAAY,KAAA;GAC7D;GACV,GAAI;EACL,CAAA;CACY,CAAA;AAEnB,CAAC;AAED,UAAU,UAAUA;AACpB,UAAU,eAAe;AACzB,UAAU,cAAc"}
|
|
@@ -8,8 +8,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
//#region packages/@mantine/core/src/components/Modal/ModalTitle.tsx
|
|
9
9
|
const ModalTitle = factory((_props) => {
|
|
10
10
|
const { classNames, className, style, styles, vars, ...others } = useProps("ModalTitle", null, _props);
|
|
11
|
+
const ctx = useModalContext();
|
|
11
12
|
return /* @__PURE__ */ jsx(ModalBaseTitle, {
|
|
12
|
-
...
|
|
13
|
+
...ctx.getStyles("title", {
|
|
13
14
|
classNames,
|
|
14
15
|
style,
|
|
15
16
|
styles,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalTitle.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalTitle.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, useProps } from '../../core';\nimport { ModalBaseTitle, ModalBaseTitleProps } from '../ModalBase';\nimport { useModalContext } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalTitleStylesNames = 'title';\n\nexport interface ModalTitleProps\n extends ModalBaseTitleProps, CompoundStylesApiProps<ModalTitleFactory> {}\n\nexport type ModalTitleFactory = Factory<{\n props: ModalTitleProps;\n ref: HTMLHeadingElement;\n stylesNames: ModalTitleStylesNames;\n compound: true;\n}>;\n\nexport const ModalTitle = factory<ModalTitleFactory>((_props) => {\n const props = useProps('ModalTitle', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n\n const ctx = useModalContext();\n\n return (\n <ModalBaseTitle\n {...ctx.getStyles('title', { classNames, style, styles, className })}\n {...others}\n />\n );\n});\n\nModalTitle.classes = classes;\nModalTitle.displayName = '@mantine/core/ModalTitle';\n"],"mappings":";;;;;;;;AAiBA,MAAa,aAAa,SAA4B,WAAW;CAE/D,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WADzC,SAAS,cAAc,MAAM,MAC2B;
|
|
1
|
+
{"version":3,"file":"ModalTitle.mjs","names":["classes"],"sources":["../../../src/components/Modal/ModalTitle.tsx"],"sourcesContent":["import { CompoundStylesApiProps, factory, Factory, useProps } from '../../core';\nimport { ModalBaseTitle, ModalBaseTitleProps } from '../ModalBase';\nimport { useModalContext } from './Modal.context';\nimport classes from './Modal.module.css';\n\nexport type ModalTitleStylesNames = 'title';\n\nexport interface ModalTitleProps\n extends ModalBaseTitleProps, CompoundStylesApiProps<ModalTitleFactory> {}\n\nexport type ModalTitleFactory = Factory<{\n props: ModalTitleProps;\n ref: HTMLHeadingElement;\n stylesNames: ModalTitleStylesNames;\n compound: true;\n}>;\n\nexport const ModalTitle = factory<ModalTitleFactory>((_props) => {\n const props = useProps('ModalTitle', null, _props);\n const { classNames, className, style, styles, vars, ...others } = props;\n\n const ctx = useModalContext();\n\n return (\n <ModalBaseTitle\n {...ctx.getStyles('title', { classNames, style, styles, className })}\n {...others}\n />\n );\n});\n\nModalTitle.classes = classes;\nModalTitle.displayName = '@mantine/core/ModalTitle';\n"],"mappings":";;;;;;;;AAiBA,MAAa,aAAa,SAA4B,WAAW;CAE/D,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WADzC,SAAS,cAAc,MAAM,MAC2B;CAEtE,MAAM,MAAM,gBAAgB;CAE5B,OACE,oBAAC,gBAAD;EACE,GAAI,IAAI,UAAU,SAAS;GAAE;GAAY;GAAO;GAAQ;EAAU,CAAC;EACnE,GAAI;CACL,CAAA;AAEL,CAAC;AAED,WAAW,UAAUA;AACrB,WAAW,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalBase.mjs","names":[],"sources":["../../../src/components/ModalBase/ModalBase.tsx"],"sourcesContent":["import { RemoveScroll } from 'react-remove-scroll';\nimport {\n Box,\n BoxProps,\n ElementProps,\n getDefaultZIndex,\n getShadow,\n getSpacing,\n MantineShadow,\n MantineSize,\n MantineSpacing,\n} from '../../core';\nimport { BasePortalProps, OptionalPortal } from '../Portal';\nimport { TransitionOverride } from '../Transition';\nimport { ModalBaseProvider } from './ModalBase.context';\nimport { useModal } from './use-modal';\n\ntype RemoveScrollProps = Omit<React.ComponentProps<typeof RemoveScroll>, 'children'>;\n\nexport interface ModalBaseProps extends BoxProps, ElementProps<'div', 'title'> {\n unstyled?: boolean;\n\n /** If set modal/drawer is not unmounted from the DOM when hidden. `display: none` styles are applied instead. @default false */\n keepMounted?: boolean;\n\n /** Controls how the modal/drawer is hidden when `keepMounted` is set:\n * `'activity'` - hidden with React 19 `Activity` component,\n * `'display-none'` - hidden with `display: none` styles\n * @default 'activity'\n */\n keepMountedMode?: 'activity' | 'display-none';\n\n /** Controls opened state */\n opened: boolean;\n\n /** Called when modal/drawer is closed */\n onClose: () => void;\n\n /** Id used to connect modal/drawer with body and title */\n id?: string;\n\n /** If set, scroll is locked when `opened={true}` @default true */\n lockScroll?: boolean;\n\n /** If set, focus is trapped within the modal/drawer @default true */\n trapFocus?: boolean;\n\n /** If set, the component is rendered inside `Portal` @default true */\n withinPortal?: boolean;\n\n /** Props passed down to the Portal component when `withinPortal` is set */\n portalProps?: BasePortalProps;\n\n /** Modal/drawer content */\n children?: React.ReactNode;\n\n /** If set, the modal/drawer is closed when user clicks on the overlay @default true */\n closeOnClickOutside?: boolean;\n\n /** Props added to the `Transition` component that used to animate overlay and body, use to configure duration and animation type, `{ duration: 200, transition: 'fade-down' }` by default */\n transitionProps?: TransitionOverride;\n\n /** Called when exit transition ends */\n onExitTransitionEnd?: () => void;\n\n /** Called when enter transition ends */\n onEnterTransitionEnd?: () => void;\n\n /** If set, `onClose` is called when user presses the escape key @default true */\n closeOnEscape?: boolean;\n\n /** If set, focus is returned to the last active element when `onClose` is called @default true */\n returnFocus?: boolean;\n\n /** `z-index` CSS property of the root element @default 200 */\n zIndex?: string | number;\n\n /** Key of `theme.shadows` or any valid CSS box-shadow value @default 'xl' */\n shadow?: MantineShadow;\n\n /** Key of `theme.spacing` or any valid CSS value to set content, header and footer padding @default 'md' */\n padding?: MantineSpacing;\n\n /** Controls width of the content area @default 'md' */\n size?: MantineSize | (string & {}) | number;\n\n /** Props passed down to react-remove-scroll, can be used to customize scroll lock behavior */\n removeScrollProps?: RemoveScrollProps;\n}\n\nexport function ModalBase({\n keepMounted,\n keepMountedMode = 'activity',\n opened,\n onClose,\n id,\n transitionProps,\n onExitTransitionEnd,\n onEnterTransitionEnd,\n trapFocus,\n closeOnEscape,\n returnFocus,\n closeOnClickOutside,\n withinPortal,\n portalProps,\n lockScroll,\n children,\n zIndex,\n shadow,\n padding,\n __vars,\n unstyled,\n removeScrollProps,\n ...others\n}: ModalBaseProps) {\n const { _id, titleMounted, bodyMounted, shouldLockScroll, setTitleMounted, setBodyMounted } =\n useModal({ id, transitionProps, opened, trapFocus, closeOnEscape, onClose, returnFocus });\n\n const { key: removeScrollKey, ...otherRemoveScrollProps } = removeScrollProps || {};\n\n return (\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <ModalBaseProvider\n value={{\n opened,\n onClose,\n closeOnClickOutside,\n onExitTransitionEnd,\n onEnterTransitionEnd,\n transitionProps: { ...transitionProps, keepMounted, keepMountedMode },\n getTitleId: () => `${_id}-title`,\n getBodyId: () => `${_id}-body`,\n titleMounted,\n bodyMounted,\n setTitleMounted,\n setBodyMounted,\n trapFocus,\n closeOnEscape,\n zIndex,\n unstyled,\n }}\n >\n <RemoveScroll\n enabled={shouldLockScroll && lockScroll}\n key={removeScrollKey}\n {...otherRemoveScrollProps}\n >\n <Box\n {...others}\n id={_id}\n __vars={{\n ...__vars,\n '--mb-z-index': (zIndex || getDefaultZIndex('modal')).toString(),\n '--mb-shadow': getShadow(shadow),\n '--mb-padding': getSpacing(padding),\n }}\n >\n {children}\n </Box>\n </RemoveScroll>\n </ModalBaseProvider>\n </OptionalPortal>\n );\n}\n\nModalBase.displayName = '@mantine/core/ModalBase';\n"],"mappings":";;;;;;;;;;AA0FA,SAAgB,UAAU,EACxB,aACA,kBAAkB,YAClB,QACA,SACA,IACA,iBACA,qBACA,sBACA,WACA,eACA,aACA,qBACA,cACA,aACA,YACA,UACA,QACA,QACA,SACA,QACA,UACA,mBACA,GAAG,UACc;CACjB,MAAM,EAAE,KAAK,cAAc,aAAa,kBAAkB,iBAAiB,mBACzE,SAAS;EAAE;EAAI;EAAiB;EAAQ;EAAW;EAAe;EAAS;CAAY,CAAC;CAE1F,MAAM,EAAE,KAAK,iBAAiB,GAAG,2BAA2B,qBAAqB,CAAC;CAElF,OACE,oBAAC,gBAAD;EAAgB,GAAI;EAA2B;
|
|
1
|
+
{"version":3,"file":"ModalBase.mjs","names":[],"sources":["../../../src/components/ModalBase/ModalBase.tsx"],"sourcesContent":["import { RemoveScroll } from 'react-remove-scroll';\nimport {\n Box,\n BoxProps,\n ElementProps,\n getDefaultZIndex,\n getShadow,\n getSpacing,\n MantineShadow,\n MantineSize,\n MantineSpacing,\n} from '../../core';\nimport { BasePortalProps, OptionalPortal } from '../Portal';\nimport { TransitionOverride } from '../Transition';\nimport { ModalBaseProvider } from './ModalBase.context';\nimport { useModal } from './use-modal';\n\ntype RemoveScrollProps = Omit<React.ComponentProps<typeof RemoveScroll>, 'children'>;\n\nexport interface ModalBaseProps extends BoxProps, ElementProps<'div', 'title'> {\n unstyled?: boolean;\n\n /** If set modal/drawer is not unmounted from the DOM when hidden. `display: none` styles are applied instead. @default false */\n keepMounted?: boolean;\n\n /** Controls how the modal/drawer is hidden when `keepMounted` is set:\n * `'activity'` - hidden with React 19 `Activity` component,\n * `'display-none'` - hidden with `display: none` styles\n * @default 'activity'\n */\n keepMountedMode?: 'activity' | 'display-none';\n\n /** Controls opened state */\n opened: boolean;\n\n /** Called when modal/drawer is closed */\n onClose: () => void;\n\n /** Id used to connect modal/drawer with body and title */\n id?: string;\n\n /** If set, scroll is locked when `opened={true}` @default true */\n lockScroll?: boolean;\n\n /** If set, focus is trapped within the modal/drawer @default true */\n trapFocus?: boolean;\n\n /** If set, the component is rendered inside `Portal` @default true */\n withinPortal?: boolean;\n\n /** Props passed down to the Portal component when `withinPortal` is set */\n portalProps?: BasePortalProps;\n\n /** Modal/drawer content */\n children?: React.ReactNode;\n\n /** If set, the modal/drawer is closed when user clicks on the overlay @default true */\n closeOnClickOutside?: boolean;\n\n /** Props added to the `Transition` component that used to animate overlay and body, use to configure duration and animation type, `{ duration: 200, transition: 'fade-down' }` by default */\n transitionProps?: TransitionOverride;\n\n /** Called when exit transition ends */\n onExitTransitionEnd?: () => void;\n\n /** Called when enter transition ends */\n onEnterTransitionEnd?: () => void;\n\n /** If set, `onClose` is called when user presses the escape key @default true */\n closeOnEscape?: boolean;\n\n /** If set, focus is returned to the last active element when `onClose` is called @default true */\n returnFocus?: boolean;\n\n /** `z-index` CSS property of the root element @default 200 */\n zIndex?: string | number;\n\n /** Key of `theme.shadows` or any valid CSS box-shadow value @default 'xl' */\n shadow?: MantineShadow;\n\n /** Key of `theme.spacing` or any valid CSS value to set content, header and footer padding @default 'md' */\n padding?: MantineSpacing;\n\n /** Controls width of the content area @default 'md' */\n size?: MantineSize | (string & {}) | number;\n\n /** Props passed down to react-remove-scroll, can be used to customize scroll lock behavior */\n removeScrollProps?: RemoveScrollProps;\n}\n\nexport function ModalBase({\n keepMounted,\n keepMountedMode = 'activity',\n opened,\n onClose,\n id,\n transitionProps,\n onExitTransitionEnd,\n onEnterTransitionEnd,\n trapFocus,\n closeOnEscape,\n returnFocus,\n closeOnClickOutside,\n withinPortal,\n portalProps,\n lockScroll,\n children,\n zIndex,\n shadow,\n padding,\n __vars,\n unstyled,\n removeScrollProps,\n ...others\n}: ModalBaseProps) {\n const { _id, titleMounted, bodyMounted, shouldLockScroll, setTitleMounted, setBodyMounted } =\n useModal({ id, transitionProps, opened, trapFocus, closeOnEscape, onClose, returnFocus });\n\n const { key: removeScrollKey, ...otherRemoveScrollProps } = removeScrollProps || {};\n\n return (\n <OptionalPortal {...portalProps} withinPortal={withinPortal}>\n <ModalBaseProvider\n value={{\n opened,\n onClose,\n closeOnClickOutside,\n onExitTransitionEnd,\n onEnterTransitionEnd,\n transitionProps: { ...transitionProps, keepMounted, keepMountedMode },\n getTitleId: () => `${_id}-title`,\n getBodyId: () => `${_id}-body`,\n titleMounted,\n bodyMounted,\n setTitleMounted,\n setBodyMounted,\n trapFocus,\n closeOnEscape,\n zIndex,\n unstyled,\n }}\n >\n <RemoveScroll\n enabled={shouldLockScroll && lockScroll}\n key={removeScrollKey}\n {...otherRemoveScrollProps}\n >\n <Box\n {...others}\n id={_id}\n __vars={{\n ...__vars,\n '--mb-z-index': (zIndex || getDefaultZIndex('modal')).toString(),\n '--mb-shadow': getShadow(shadow),\n '--mb-padding': getSpacing(padding),\n }}\n >\n {children}\n </Box>\n </RemoveScroll>\n </ModalBaseProvider>\n </OptionalPortal>\n );\n}\n\nModalBase.displayName = '@mantine/core/ModalBase';\n"],"mappings":";;;;;;;;;;AA0FA,SAAgB,UAAU,EACxB,aACA,kBAAkB,YAClB,QACA,SACA,IACA,iBACA,qBACA,sBACA,WACA,eACA,aACA,qBACA,cACA,aACA,YACA,UACA,QACA,QACA,SACA,QACA,UACA,mBACA,GAAG,UACc;CACjB,MAAM,EAAE,KAAK,cAAc,aAAa,kBAAkB,iBAAiB,mBACzE,SAAS;EAAE;EAAI;EAAiB;EAAQ;EAAW;EAAe;EAAS;CAAY,CAAC;CAE1F,MAAM,EAAE,KAAK,iBAAiB,GAAG,2BAA2B,qBAAqB,CAAC;CAElF,OACE,oBAAC,gBAAD;EAAgB,GAAI;EAA2B;EAC7C,UAAA,oBAAC,mBAAD;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA,iBAAiB;KAAE,GAAG;KAAiB;KAAa;IAAgB;IACpE,kBAAkB,GAAG,IAAI;IACzB,iBAAiB,GAAG,IAAI;IACxB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GAEA,UAAA,oBAAC,cAAD;IACE,SAAS,oBAAoB;IAE7B,GAAI;IAEJ,UAAA,oBAAC,KAAD;KACE,GAAI;KACJ,IAAI;KACJ,QAAQ;MACN,GAAG;MACH,iBAAiB,UAAU,iBAAiB,OAAO,EAAA,CAAG,SAAS;MAC/D,eAAe,UAAU,MAAM;MAC/B,gBAAgB,WAAW,OAAO;KACpC;KAEC;IACE,CAAA;GACO,GAfP,eAeO;EACG,CAAA;CACL,CAAA;AAEpB;AAEA,UAAU,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalBaseContent.mjs","names":["classes"],"sources":["../../../src/components/ModalBase/ModalBaseContent.tsx"],"sourcesContent":["import cx from 'clsx';\nimport { BoxProps, ElementProps, MantineRadius, MantineShadow } from '../../core';\nimport { FocusTrap } from '../FocusTrap';\nimport { Paper } from '../Paper';\nimport { Transition, TransitionOverride } from '../Transition';\nimport { useModalBaseContext } from './ModalBase.context';\nimport classes from './ModalBase.module.css';\n\nexport interface ModalBaseContentProps extends BoxProps, ElementProps<'div'> {\n /** Props passed down to the `Transition` component */\n transitionProps?: TransitionOverride;\n\n /** Key of `theme.shadows` or any valid CSS value to set `box-shadow` */\n shadow?: MantineShadow;\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius, numbers are converted to rem @default theme.defaultRadius */\n radius?: MantineRadius;\n}\n\ninterface _ModalBaseContentProps extends ModalBaseContentProps {\n innerProps: React.ComponentProps<'div'>;\n}\n\nexport function ModalBaseContent({\n transitionProps,\n className,\n innerProps,\n onKeyDown,\n style,\n ref,\n ...others\n}: _ModalBaseContentProps) {\n const ctx = useModalBaseContext();\n\n return (\n <Transition\n mounted={ctx.opened}\n transition=\"pop\"\n {...ctx.transitionProps}\n onExited={() => {\n ctx.onExitTransitionEnd?.();\n ctx.transitionProps?.onExited?.();\n }}\n onEntered={() => {\n ctx.onEnterTransitionEnd?.();\n ctx.transitionProps?.onEntered?.();\n }}\n {...transitionProps}\n >\n {(transitionStyles) => (\n <div\n {...innerProps}\n className={cx({ [classes.inner]: !ctx.unstyled }, innerProps.className)}\n >\n <FocusTrap active={ctx.opened && ctx.trapFocus} innerRef={ref}>\n <Paper\n {...others}\n component=\"section\"\n role=\"dialog\"\n tabIndex={-1}\n aria-modal\n aria-describedby={ctx.bodyMounted ? ctx.getBodyId() : undefined}\n aria-labelledby={ctx.titleMounted ? ctx.getTitleId() : undefined}\n style={[style, transitionStyles]}\n className={cx({ [classes.content]: !ctx.unstyled }, className)}\n unstyled={ctx.unstyled}\n >\n {others.children}\n </Paper>\n </FocusTrap>\n </div>\n )}\n </Transition>\n );\n}\n\nModalBaseContent.displayName = '@mantine/core/ModalBaseContent';\n"],"mappings":";;;;;;;;;AAuBA,SAAgB,iBAAiB,EAC/B,iBACA,WACA,YACA,WACA,OACA,KACA,GAAG,UACsB;CACzB,MAAM,MAAM,oBAAoB;CAEhC,OACE,oBAAC,YAAD;EACE,SAAS,IAAI;EACb,YAAW;EACX,GAAI,IAAI;EACR,gBAAgB;GACd,IAAI,sBAAsB;GAC1B,IAAI,iBAAiB,WAAW;EAClC;EACA,iBAAiB;GACf,IAAI,uBAAuB;GAC3B,IAAI,iBAAiB,YAAY;EACnC;EACA,GAAI;
|
|
1
|
+
{"version":3,"file":"ModalBaseContent.mjs","names":["classes"],"sources":["../../../src/components/ModalBase/ModalBaseContent.tsx"],"sourcesContent":["import cx from 'clsx';\nimport { BoxProps, ElementProps, MantineRadius, MantineShadow } from '../../core';\nimport { FocusTrap } from '../FocusTrap';\nimport { Paper } from '../Paper';\nimport { Transition, TransitionOverride } from '../Transition';\nimport { useModalBaseContext } from './ModalBase.context';\nimport classes from './ModalBase.module.css';\n\nexport interface ModalBaseContentProps extends BoxProps, ElementProps<'div'> {\n /** Props passed down to the `Transition` component */\n transitionProps?: TransitionOverride;\n\n /** Key of `theme.shadows` or any valid CSS value to set `box-shadow` */\n shadow?: MantineShadow;\n\n /** Key of `theme.radius` or any valid CSS value to set border-radius, numbers are converted to rem @default theme.defaultRadius */\n radius?: MantineRadius;\n}\n\ninterface _ModalBaseContentProps extends ModalBaseContentProps {\n innerProps: React.ComponentProps<'div'>;\n}\n\nexport function ModalBaseContent({\n transitionProps,\n className,\n innerProps,\n onKeyDown,\n style,\n ref,\n ...others\n}: _ModalBaseContentProps) {\n const ctx = useModalBaseContext();\n\n return (\n <Transition\n mounted={ctx.opened}\n transition=\"pop\"\n {...ctx.transitionProps}\n onExited={() => {\n ctx.onExitTransitionEnd?.();\n ctx.transitionProps?.onExited?.();\n }}\n onEntered={() => {\n ctx.onEnterTransitionEnd?.();\n ctx.transitionProps?.onEntered?.();\n }}\n {...transitionProps}\n >\n {(transitionStyles) => (\n <div\n {...innerProps}\n className={cx({ [classes.inner]: !ctx.unstyled }, innerProps.className)}\n >\n <FocusTrap active={ctx.opened && ctx.trapFocus} innerRef={ref}>\n <Paper\n {...others}\n component=\"section\"\n role=\"dialog\"\n tabIndex={-1}\n aria-modal\n aria-describedby={ctx.bodyMounted ? ctx.getBodyId() : undefined}\n aria-labelledby={ctx.titleMounted ? ctx.getTitleId() : undefined}\n style={[style, transitionStyles]}\n className={cx({ [classes.content]: !ctx.unstyled }, className)}\n unstyled={ctx.unstyled}\n >\n {others.children}\n </Paper>\n </FocusTrap>\n </div>\n )}\n </Transition>\n );\n}\n\nModalBaseContent.displayName = '@mantine/core/ModalBaseContent';\n"],"mappings":";;;;;;;;;AAuBA,SAAgB,iBAAiB,EAC/B,iBACA,WACA,YACA,WACA,OACA,KACA,GAAG,UACsB;CACzB,MAAM,MAAM,oBAAoB;CAEhC,OACE,oBAAC,YAAD;EACE,SAAS,IAAI;EACb,YAAW;EACX,GAAI,IAAI;EACR,gBAAgB;GACd,IAAI,sBAAsB;GAC1B,IAAI,iBAAiB,WAAW;EAClC;EACA,iBAAiB;GACf,IAAI,uBAAuB;GAC3B,IAAI,iBAAiB,YAAY;EACnC;EACA,GAAI;EAEF,WAAA,qBACA,oBAAC,OAAD;GACE,GAAI;GACJ,WAAW,GAAG,GAAGA,yBAAQ,QAAQ,CAAC,IAAI,SAAS,GAAG,WAAW,SAAS;GAEtE,UAAA,oBAAC,WAAD;IAAW,QAAQ,IAAI,UAAU,IAAI;IAAW,UAAU;IACxD,UAAA,oBAAC,OAAD;KACE,GAAI;KACJ,WAAU;KACV,MAAK;KACL,UAAU;KACV,cAAA;KACA,oBAAkB,IAAI,cAAc,IAAI,UAAU,IAAI,KAAA;KACtD,mBAAiB,IAAI,eAAe,IAAI,WAAW,IAAI,KAAA;KACvD,OAAO,CAAC,OAAO,gBAAgB;KAC/B,WAAW,GAAG,GAAGA,yBAAQ,UAAU,CAAC,IAAI,SAAS,GAAG,SAAS;KAC7D,UAAU,IAAI;KAEb,UAAA,OAAO;IACH,CAAA;GACE,CAAA;EACR,CAAA;CAEG,CAAA;AAEhB;AAEA,iBAAiB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalBaseOverlay.mjs","names":[],"sources":["../../../src/components/ModalBase/ModalBaseOverlay.tsx"],"sourcesContent":["import { ElementProps } from '../../core';\nimport { Overlay, OverlayProps } from '../Overlay';\nimport { Transition, TransitionOverride } from '../Transition';\nimport { useModalBaseContext } from './ModalBase.context';\nimport { useModalTransition } from './use-modal-transition';\n\nexport interface ModalBaseOverlayProps\n extends\n Omit<OverlayProps, 'styles' | 'classNames' | 'variant' | 'vars'>,\n ElementProps<'div', 'color'> {\n /** Props passed down to the `Transition` component */\n transitionProps?: TransitionOverride;\n\n /** Determines whether the overlay should be visible. By default, has the same value as `opened` state. */\n visible?: boolean;\n}\n\nexport function ModalBaseOverlay({\n onClick,\n transitionProps,\n style,\n visible,\n ...others\n}: ModalBaseOverlayProps) {\n const ctx = useModalBaseContext();\n const transition = useModalTransition(transitionProps);\n\n return (\n <Transition\n mounted={visible !== undefined ? visible : ctx.opened}\n {...transition}\n transition=\"fade\"\n >\n {(transitionStyles) => (\n <Overlay\n fixed\n style={[style, transitionStyles]}\n zIndex={ctx.zIndex}\n unstyled={ctx.unstyled}\n onClick={(event) => {\n onClick?.(event);\n ctx.closeOnClickOutside && ctx.onClose();\n }}\n {...others}\n />\n )}\n </Transition>\n );\n}\n\nModalBaseOverlay.displayName = '@mantine/core/ModalBaseOverlay';\n"],"mappings":";;;;;;;AAiBA,SAAgB,iBAAiB,EAC/B,SACA,iBACA,OACA,SACA,GAAG,UACqB;CACxB,MAAM,MAAM,oBAAoB;CAChC,MAAM,aAAa,mBAAmB,eAAe;CAErD,OACE,oBAAC,YAAD;EACE,SAAS,YAAY,KAAA,IAAY,UAAU,IAAI;EAC/C,GAAI;EACJ,YAAW;
|
|
1
|
+
{"version":3,"file":"ModalBaseOverlay.mjs","names":[],"sources":["../../../src/components/ModalBase/ModalBaseOverlay.tsx"],"sourcesContent":["import { ElementProps } from '../../core';\nimport { Overlay, OverlayProps } from '../Overlay';\nimport { Transition, TransitionOverride } from '../Transition';\nimport { useModalBaseContext } from './ModalBase.context';\nimport { useModalTransition } from './use-modal-transition';\n\nexport interface ModalBaseOverlayProps\n extends\n Omit<OverlayProps, 'styles' | 'classNames' | 'variant' | 'vars'>,\n ElementProps<'div', 'color'> {\n /** Props passed down to the `Transition` component */\n transitionProps?: TransitionOverride;\n\n /** Determines whether the overlay should be visible. By default, has the same value as `opened` state. */\n visible?: boolean;\n}\n\nexport function ModalBaseOverlay({\n onClick,\n transitionProps,\n style,\n visible,\n ...others\n}: ModalBaseOverlayProps) {\n const ctx = useModalBaseContext();\n const transition = useModalTransition(transitionProps);\n\n return (\n <Transition\n mounted={visible !== undefined ? visible : ctx.opened}\n {...transition}\n transition=\"fade\"\n >\n {(transitionStyles) => (\n <Overlay\n fixed\n style={[style, transitionStyles]}\n zIndex={ctx.zIndex}\n unstyled={ctx.unstyled}\n onClick={(event) => {\n onClick?.(event);\n ctx.closeOnClickOutside && ctx.onClose();\n }}\n {...others}\n />\n )}\n </Transition>\n );\n}\n\nModalBaseOverlay.displayName = '@mantine/core/ModalBaseOverlay';\n"],"mappings":";;;;;;;AAiBA,SAAgB,iBAAiB,EAC/B,SACA,iBACA,OACA,SACA,GAAG,UACqB;CACxB,MAAM,MAAM,oBAAoB;CAChC,MAAM,aAAa,mBAAmB,eAAe;CAErD,OACE,oBAAC,YAAD;EACE,SAAS,YAAY,KAAA,IAAY,UAAU,IAAI;EAC/C,GAAI;EACJ,YAAW;EAET,WAAA,qBACA,oBAAC,SAAD;GACE,OAAA;GACA,OAAO,CAAC,OAAO,gBAAgB;GAC/B,QAAQ,IAAI;GACZ,UAAU,IAAI;GACd,UAAU,UAAU;IAClB,UAAU,KAAK;IACf,IAAI,uBAAuB,IAAI,QAAQ;GACzC;GACA,GAAI;EACL,CAAA;CAEO,CAAA;AAEhB;AAEA,iBAAiB,cAAc"}
|
|
@@ -7,9 +7,10 @@ function useModal({ id, transitionProps, opened, trapFocus, closeOnEscape, onClo
|
|
|
7
7
|
const _id = useId$1(id);
|
|
8
8
|
const [titleMounted, setTitleMounted] = useState(false);
|
|
9
9
|
const [bodyMounted, setBodyMounted] = useState(false);
|
|
10
|
+
const transitionDuration = typeof transitionProps?.duration === "number" ? transitionProps?.duration : 200;
|
|
10
11
|
const shouldLockScroll = useLockScroll({
|
|
11
12
|
opened,
|
|
12
|
-
transitionDuration
|
|
13
|
+
transitionDuration
|
|
13
14
|
});
|
|
14
15
|
useWindowEvent("keydown", (event) => {
|
|
15
16
|
if (event.key === "Escape" && closeOnEscape && !event.isComposing && opened) event.target?.getAttribute("data-mantine-stop-propagation") !== "true" && onClose();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-modal.mjs","names":["useId"],"sources":["../../../src/components/ModalBase/use-modal.ts"],"sourcesContent":["import { useState } from 'react';\nimport { useFocusReturn, useId, useWindowEvent } from '@mantine/hooks';\nimport { TransitionOverride } from '../Transition';\nimport { useLockScroll } from './use-lock-scroll';\n\ninterface UseModalInput {\n opened: boolean;\n onClose: () => void;\n id: string | undefined;\n transitionProps: TransitionOverride | undefined;\n trapFocus: boolean | undefined;\n closeOnEscape: boolean | undefined;\n returnFocus: boolean | undefined;\n}\n\nexport function useModal({\n id,\n transitionProps,\n opened,\n trapFocus,\n closeOnEscape,\n onClose,\n returnFocus,\n}: UseModalInput) {\n const _id = useId(id);\n const [titleMounted, setTitleMounted] = useState(false);\n const [bodyMounted, setBodyMounted] = useState(false);\n\n const transitionDuration =\n typeof transitionProps?.duration === 'number' ? transitionProps?.duration : 200;\n\n const shouldLockScroll = useLockScroll({ opened, transitionDuration });\n\n useWindowEvent(\n 'keydown',\n (event) => {\n if (event.key === 'Escape' && closeOnEscape && !event.isComposing && opened) {\n const shouldTrigger =\n (event.target as HTMLElement)?.getAttribute('data-mantine-stop-propagation') !== 'true';\n shouldTrigger && onClose();\n }\n },\n { capture: true }\n );\n\n useFocusReturn({ opened, shouldReturnFocus: trapFocus && returnFocus });\n\n return {\n _id,\n titleMounted,\n bodyMounted,\n shouldLockScroll,\n setTitleMounted,\n setBodyMounted,\n };\n}\n"],"mappings":";;;;;AAeA,SAAgB,SAAS,EACvB,IACA,iBACA,QACA,WACA,eACA,SACA,eACgB;CAChB,MAAM,MAAMA,QAAM,EAAE;CACpB,MAAM,CAAC,cAAc,mBAAmB,SAAS,KAAK;CACtD,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;
|
|
1
|
+
{"version":3,"file":"use-modal.mjs","names":["useId"],"sources":["../../../src/components/ModalBase/use-modal.ts"],"sourcesContent":["import { useState } from 'react';\nimport { useFocusReturn, useId, useWindowEvent } from '@mantine/hooks';\nimport { TransitionOverride } from '../Transition';\nimport { useLockScroll } from './use-lock-scroll';\n\ninterface UseModalInput {\n opened: boolean;\n onClose: () => void;\n id: string | undefined;\n transitionProps: TransitionOverride | undefined;\n trapFocus: boolean | undefined;\n closeOnEscape: boolean | undefined;\n returnFocus: boolean | undefined;\n}\n\nexport function useModal({\n id,\n transitionProps,\n opened,\n trapFocus,\n closeOnEscape,\n onClose,\n returnFocus,\n}: UseModalInput) {\n const _id = useId(id);\n const [titleMounted, setTitleMounted] = useState(false);\n const [bodyMounted, setBodyMounted] = useState(false);\n\n const transitionDuration =\n typeof transitionProps?.duration === 'number' ? transitionProps?.duration : 200;\n\n const shouldLockScroll = useLockScroll({ opened, transitionDuration });\n\n useWindowEvent(\n 'keydown',\n (event) => {\n if (event.key === 'Escape' && closeOnEscape && !event.isComposing && opened) {\n const shouldTrigger =\n (event.target as HTMLElement)?.getAttribute('data-mantine-stop-propagation') !== 'true';\n shouldTrigger && onClose();\n }\n },\n { capture: true }\n );\n\n useFocusReturn({ opened, shouldReturnFocus: trapFocus && returnFocus });\n\n return {\n _id,\n titleMounted,\n bodyMounted,\n shouldLockScroll,\n setTitleMounted,\n setBodyMounted,\n };\n}\n"],"mappings":";;;;;AAeA,SAAgB,SAAS,EACvB,IACA,iBACA,QACA,WACA,eACA,SACA,eACgB;CAChB,MAAM,MAAMA,QAAM,EAAE;CACpB,MAAM,CAAC,cAAc,mBAAmB,SAAS,KAAK;CACtD,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CAEpD,MAAM,qBACJ,OAAO,iBAAiB,aAAa,WAAW,iBAAiB,WAAW;CAE9E,MAAM,mBAAmB,cAAc;EAAE;EAAQ;CAAmB,CAAC;CAErE,eACE,YACC,UAAU;EACT,IAAI,MAAM,QAAQ,YAAY,iBAAiB,CAAC,MAAM,eAAe,QAGnE,MADS,QAAwB,aAAa,+BAA+B,MAAM,UAClE,QAAQ;CAE7B,GACA,EAAE,SAAS,KAAK,CAClB;CAEA,eAAe;EAAE;EAAQ,mBAAmB,aAAa;CAAY,CAAC;CAEtE,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.mjs","names":["useId"],"sources":["../../../src/components/MultiSelect/MultiSelect.tsx"],"sourcesContent":["import { Fragment, useEffect, useRef } from 'react';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n ElementProps,\n extractStyleProps,\n Factory,\n genericFactory,\n MantineColor,\n Primitive,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '../../core';\nimport {\n Combobox,\n ComboboxItem,\n ComboboxLikeProps,\n ComboboxLikeRenderOptionInput,\n ComboboxLikeStylesNames,\n ComboboxRenderPillInput,\n getOptionsLockup,\n getParsedComboboxData,\n OptionsDropdown,\n OptionsFilter,\n useCombobox,\n usePillsReorder,\n} from '../Combobox';\nimport { getOptionByLabel } from '../Combobox/get-options-lockup/get-option-by-label';\nimport { isExternalInputChange } from '../Combobox/is-external-input-change/is-external-input-change';\nimport {\n __BaseInputProps,\n __InputStylesNames,\n ClearSectionMode,\n InputClearButtonProps,\n} from '../Input';\nimport { InputBase } from '../InputBase';\nimport { Pill } from '../Pill';\nimport { PillsInput } from '../PillsInput';\nimport { ScrollAreaProps } from '../ScrollArea';\nimport { filterPickedValues } from './filter-picked-values';\n\nconst clearSectionOffset: Record<string, number> = {\n xs: 41,\n sm: 50,\n md: 60,\n lg: 72,\n xl: 89,\n};\n\nexport type MultiSelectStylesNames =\n | __InputStylesNames\n | ComboboxLikeStylesNames\n | 'pill'\n | 'pillsList'\n | 'inputField';\n\nexport interface MultiSelectProps<Value extends Primitive = string>\n extends\n BoxProps,\n __BaseInputProps,\n ComboboxLikeProps<Value>,\n StylesApiProps<MultiSelectFactory>,\n ElementProps<'input', 'size' | 'value' | 'defaultValue' | 'onChange'> {\n /** Controlled component value */\n value?: Value[];\n\n /** Uncontrolled component default value */\n defaultValue?: Value[];\n\n /** Called when value changes */\n onChange?: (value: Value[]) => void;\n\n /** Called with `value` of the removed item */\n onRemove?: (value: Value) => void;\n\n /** Called when the clear button is clicked */\n onClear?: () => void;\n\n /** Called when user attempts to select more values than allowed */\n onMaxValues?: () => void;\n\n /** Controlled search value */\n searchValue?: string;\n\n /** Default search value */\n defaultSearchValue?: string;\n\n /** Called when search changes */\n onSearchChange?: (value: string) => void;\n\n /** Maximum number of values, no limit if not set */\n maxValues?: number;\n\n /** Allows searching through options by user input @default false */\n searchable?: boolean;\n\n /** Message displayed when no options match the search query (when searchable is enabled) or when the data array is empty. If not set, the dropdown will be hidden instead. */\n nothingFoundMessage?: React.ReactNode;\n\n /** If set, the check icon is displayed near the selected option label @default true */\n withCheckIcon?: boolean;\n\n /** If set, unchecked labels are aligned with checked ones @default false */\n withAlignedLabels?: boolean;\n\n /** Position of the checkmark icon shown next to selected options in the dropdown @default 'left' */\n checkIconPosition?: 'left' | 'right';\n\n /** When enabled, selected options are hidden from the dropdown list @default false */\n hidePickedOptions?: boolean;\n\n /** When enabled, displays a clear button to remove all selected values (hidden when component is empty, disabled, or read-only) @default false */\n clearable?: boolean;\n\n /** Determines how the clear button and rightSection are rendered @default 'both' */\n clearSectionMode?: ClearSectionMode;\n\n /** Props passed down to the clear button */\n clearButtonProps?: InputClearButtonProps;\n\n /** Props passed down to the hidden input */\n hiddenInputProps?: Omit<React.ComponentProps<'input'>, 'value'>;\n\n /** Divider used to separate values in the hidden input `value` attribute @default ',' */\n hiddenInputValuesDivider?: string;\n\n /** A function to render content of the option, replaces the default content of the option */\n renderOption?: (item: ComboboxLikeRenderOptionInput<ComboboxItem<Value>>) => React.ReactNode;\n\n /** A function to render content of the pill */\n renderPill?: (props: ComboboxRenderPillInput<Value>) => React.ReactNode;\n\n /** Props passed down to the underlying `ScrollArea` component in the dropdown */\n scrollAreaProps?: ScrollAreaProps;\n\n /** Controls color of the default chevron */\n chevronColor?: MantineColor;\n\n /** Clear search value when item is selected @default true */\n clearSearchOnChange?: boolean;\n\n /** Controls whether dropdown opens when the input receives focus @default true */\n openOnFocus?: boolean;\n\n /** If set, selected values can be reordered by dragging pills. Disabled when `disabled` or `readOnly` is set. @default false */\n withPillsReorder?: boolean;\n}\n\nexport type MultiSelectFactory = Factory<{\n props: MultiSelectProps;\n ref: HTMLInputElement;\n stylesNames: MultiSelectStylesNames;\n signature: <Value extends Primitive = string>(\n props: MultiSelectProps<Value>\n ) => React.JSX.Element;\n}>;\n\nconst defaultProps = {\n maxValues: Infinity,\n withCheckIcon: true,\n checkIconPosition: 'left',\n hiddenInputValuesDivider: ',',\n clearSearchOnChange: true,\n openOnFocus: true,\n size: 'sm',\n} satisfies Partial<MultiSelectProps>;\n\nexport const MultiSelect = genericFactory<MultiSelectFactory>((_props) => {\n const props = useProps(['Input', 'InputWrapper', 'MultiSelect'], defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n size,\n value,\n defaultValue,\n onChange,\n onKeyDown,\n variant,\n data,\n dropdownOpened,\n defaultDropdownOpened,\n onDropdownOpen,\n onDropdownClose,\n selectFirstOptionOnChange,\n selectFirstOptionOnDropdownOpen,\n onOptionSubmit,\n comboboxProps,\n filter,\n limit,\n withScrollArea,\n maxDropdownHeight,\n floatingHeight,\n searchValue,\n defaultSearchValue,\n onSearchChange,\n readOnly,\n disabled,\n onFocus,\n onBlur,\n radius,\n rightSection,\n rightSectionWidth,\n rightSectionPointerEvents,\n rightSectionProps,\n leftSection,\n leftSectionWidth,\n leftSectionPointerEvents,\n leftSectionProps,\n inputContainer,\n inputWrapperOrder,\n withAsterisk,\n labelProps,\n descriptionProps,\n errorProps,\n successProps,\n wrapperProps,\n description,\n label,\n error,\n success,\n maxValues,\n searchable,\n nothingFoundMessage,\n withCheckIcon,\n withAlignedLabels,\n checkIconPosition,\n hidePickedOptions,\n withErrorStyles,\n withSuccessStyles,\n name,\n form,\n id,\n clearable,\n clearSectionMode,\n clearButtonProps,\n hiddenInputProps,\n placeholder,\n hiddenInputValuesDivider,\n required,\n mod,\n renderOption,\n renderPill,\n onRemove,\n onClear,\n onMaxValues,\n scrollAreaProps,\n chevronColor,\n attributes,\n clearSearchOnChange,\n openOnFocus,\n loading,\n loadingPosition,\n withPillsReorder,\n ...others\n } = props;\n\n const _id = useId(id);\n const parsedData = getParsedComboboxData(data);\n const optionsLockup = getOptionsLockup(parsedData);\n const retainedSelectedOptions = useRef<Record<string, ComboboxItem<Primitive>>>({});\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 combobox.resetSelectedOption();\n },\n });\n\n const {\n styleProps,\n rest: { type, autoComplete, ...rest },\n } = extractStyleProps(others);\n\n const [_value, setValue] = useUncontrolled({\n value,\n defaultValue,\n finalValue: [],\n onChange,\n });\n\n const { getPillProps, getListProps, handleInputKeyDown } = usePillsReorder({\n value: _value,\n onChange: setValue,\n enabled: withPillsReorder && !disabled && !readOnly,\n });\n\n const [_searchValue, setSearchValue] = useUncontrolled({\n value: searchValue,\n defaultValue: defaultSearchValue,\n finalValue: '',\n onChange: onSearchChange,\n });\n\n const handleSearchChange = (value: string) => {\n setSearchValue(value);\n combobox.resetSelectedOption();\n };\n\n const getStyles = useStyles<MultiSelectFactory>({\n name: 'MultiSelect',\n classes: {} as any,\n props: props as any,\n classNames,\n styles,\n unstyled,\n attributes,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<MultiSelectFactory>({\n props,\n styles,\n classNames,\n });\n\n const handleInputKeydown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n if (event.key === ' ' && !searchable) {\n event.preventDefault();\n combobox.toggleDropdown();\n }\n\n if (event.key === 'Backspace' && _searchValue.length === 0 && _value.length > 0) {\n onRemove?.(_value[_value.length - 1]);\n setValue(_value.slice(0, _value.length - 1));\n }\n\n handleInputKeyDown(event);\n };\n\n const values = _value.map((item, index) => {\n const optionData = optionsLockup[`${item}`] || retainedSelectedOptions.current[`${item}`];\n const reorderProps = getPillProps(index);\n\n if (renderPill) {\n return (\n <Fragment key={`${item}-${index}`}>\n {renderPill({\n option: optionData,\n value: item,\n onRemove: () => {\n setValue(_value.filter((i) => item !== i));\n onRemove?.(item);\n },\n disabled,\n reorderProps,\n })}\n </Fragment>\n );\n }\n\n return (\n <Pill\n key={`${item}-${index}`}\n withRemoveButton={!readOnly && !optionsLockup[`${item}`]?.disabled}\n onRemove={() => {\n setValue(_value.filter((i) => item !== i));\n onRemove?.(item);\n }}\n unstyled={unstyled}\n disabled={disabled}\n {...getStyles('pill')}\n {...reorderProps}\n >\n {optionData?.label || item}\n </Pill>\n );\n });\n\n useEffect(() => {\n if (selectFirstOptionOnChange) {\n combobox.selectFirstOption();\n }\n }, [selectFirstOptionOnChange, _searchValue]);\n\n useEffect(() => {\n _value.forEach((val) => {\n if (`${val}` in optionsLockup) {\n retainedSelectedOptions.current[`${val}`] = optionsLockup[`${val}`];\n }\n });\n }, [optionsLockup, _value]);\n\n const clearButton = (\n <Combobox.ClearButton\n {...clearButtonProps}\n onClear={() => {\n onClear?.();\n setValue([]);\n handleSearchChange('');\n }}\n />\n );\n\n const filteredData = filterPickedValues({ data: parsedData, value: _value });\n const _clearable = clearable && _value.length > 0 && !disabled && !readOnly;\n const pillsListStyle = _clearable\n ? { paddingInlineEnd: clearSectionOffset[size] ?? clearSectionOffset.sm }\n : undefined;\n\n return (\n <>\n <Combobox\n store={combobox}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n size={size}\n readOnly={readOnly}\n __staticSelector=\"MultiSelect\"\n attributes={attributes}\n floatingHeight={floatingHeight}\n onOptionSubmit={(val) => {\n onOptionSubmit?.(val as any);\n if (clearSearchOnChange) {\n handleSearchChange('');\n }\n combobox.updateSelectedOptionIndex('selected');\n\n if (_value.includes(optionsLockup[`${val}`].value as any)) {\n setValue(_value.filter((v) => v !== optionsLockup[`${val}`].value));\n onRemove?.(optionsLockup[`${val}`].value as any);\n } else if (_value.length < maxValues) {\n setValue([..._value, optionsLockup[`${val}`].value] as any);\n } else {\n onMaxValues?.();\n }\n }}\n {...comboboxProps}\n >\n <Combobox.DropdownTarget>\n <PillsInput\n {...styleProps}\n __staticSelector=\"MultiSelect\"\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n size={size}\n className={className}\n style={style}\n variant={variant}\n disabled={disabled}\n radius={radius}\n __defaultRightSection={\n <Combobox.Chevron\n size={size}\n error={error}\n unstyled={unstyled}\n color={chevronColor}\n />\n }\n __clearSection={clearButton}\n __clearable={_clearable}\n __clearSectionMode={clearSectionMode}\n rightSection={rightSection}\n rightSectionPointerEvents={rightSectionPointerEvents || 'none'}\n rightSectionWidth={rightSectionWidth}\n rightSectionProps={rightSectionProps}\n leftSection={leftSection}\n leftSectionWidth={leftSectionWidth}\n leftSectionPointerEvents={leftSectionPointerEvents}\n leftSectionProps={leftSectionProps}\n loading={loading}\n loadingPosition={loadingPosition}\n inputContainer={inputContainer}\n inputWrapperOrder={inputWrapperOrder}\n withAsterisk={withAsterisk}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorProps={errorProps}\n successProps={successProps}\n wrapperProps={wrapperProps}\n description={description}\n label={label}\n error={error}\n success={success}\n withErrorStyles={withErrorStyles}\n withSuccessStyles={withSuccessStyles}\n __stylesApiProps={{\n ...props,\n rightSectionPointerEvents: rightSectionPointerEvents || 'none',\n multiline: true,\n }}\n pointer={!searchable}\n onClick={() => (searchable ? combobox.openDropdown() : combobox.toggleDropdown())}\n data-expanded={combobox.dropdownOpened || undefined}\n id={_id}\n required={required}\n mod={mod}\n attributes={attributes}\n >\n <Pill.Group\n attributes={attributes}\n disabled={disabled}\n unstyled={unstyled}\n {...getStyles('pillsList', { style: pillsListStyle })}\n {...getListProps()}\n >\n {values}\n <Combobox.EventsTarget autoComplete={autoComplete} withExpandedAttribute>\n <PillsInput.Field\n {...rest}\n id={_id}\n placeholder={placeholder}\n type={!searchable && !placeholder ? 'hidden' : 'visible'}\n {...getStyles('inputField')}\n unstyled={unstyled}\n onFocus={(event) => {\n onFocus?.(event);\n openOnFocus && searchable && combobox.openDropdown();\n }}\n onBlur={(event) => {\n onBlur?.(event);\n combobox.closeDropdown();\n handleSearchChange('');\n }}\n onKeyDown={handleInputKeydown}\n value={_searchValue}\n onChange={(event) => {\n if (isExternalInputChange(event)) {\n if (!readOnly) {\n const externalOption = getOptionByLabel(\n optionsLockup,\n event.currentTarget.value\n );\n\n if (\n externalOption &&\n !_value.includes(externalOption.value as any) &&\n _value.length < maxValues\n ) {\n setValue([..._value, externalOption.value] as any);\n }\n }\n\n return;\n }\n\n handleSearchChange(event.currentTarget.value);\n searchable && combobox.openDropdown();\n selectFirstOptionOnChange && combobox.selectFirstOption();\n }}\n disabled={disabled}\n readOnly={readOnly || !searchable}\n pointer={!searchable}\n />\n </Combobox.EventsTarget>\n </Pill.Group>\n </PillsInput>\n </Combobox.DropdownTarget>\n\n <OptionsDropdown\n data={hidePickedOptions ? filteredData : parsedData}\n hidden={readOnly || disabled}\n filter={filter as OptionsFilter<Primitive> | undefined}\n search={_searchValue}\n limit={limit}\n hiddenWhenEmpty={!nothingFoundMessage}\n withScrollArea={withScrollArea}\n maxDropdownHeight={maxDropdownHeight}\n filterOptions={searchable}\n value={_value}\n checkIconPosition={checkIconPosition}\n withCheckIcon={withCheckIcon}\n withAlignedLabels={withAlignedLabels}\n nothingFoundMessage={nothingFoundMessage}\n unstyled={unstyled}\n labelId={label ? `${_id}-label` : undefined}\n aria-label={label ? undefined : others['aria-label']}\n renderOption={renderOption}\n scrollAreaProps={scrollAreaProps}\n />\n </Combobox>\n <Combobox.HiddenInput\n name={name}\n valuesDivider={hiddenInputValuesDivider}\n value={_value}\n form={form}\n disabled={disabled}\n {...hiddenInputProps}\n />\n </>\n );\n});\n\nMultiSelect.classes = { ...InputBase.classes, ...Combobox.classes };\nMultiSelect.displayName = '@mantine/core/MultiSelect';\n\nexport namespace MultiSelect {\n export type Props<Value extends Primitive = string> = MultiSelectProps<Value>;\n export type StylesNames = MultiSelectStylesNames;\n export type Factory = MultiSelectFactory;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,qBAA6C;CACjD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AA8GA,MAAM,eAAe;CACnB,WAAW;CACX,eAAe;CACf,mBAAmB;CACnB,0BAA0B;CAC1B,qBAAqB;CACrB,aAAa;CACb,MAAM;AACR;AAEA,MAAa,cAAc,gBAAoC,WAAW;CACxE,MAAM,QAAQ,SAAS;EAAC;EAAS;EAAgB;CAAa,GAAG,cAAc,MAAM;CACrF,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,OACA,cACA,UACA,WACA,SACA,MACA,gBACA,uBACA,gBACA,iBACA,2BACA,iCACA,gBACA,eACA,QACA,OACA,gBACA,mBACA,gBACA,aACA,oBACA,gBACA,UACA,UACA,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GACF;GACG;GACnB,eAAe;GACf,OAAO;GACY;GACJ;GACI;GACE;GACX;GACV,SAAS,QAAQ,GAAG,IAAI,UAAU,KAAA;GAClC,cAAY,QAAQ,KAAA,IAAY,OAAO;GACzB;GACG;EAClB,CAAA,CACO;KACV,oBAAC,SAAS,aAAV;EACQ;EACN,eAAe;EACf,OAAO;EACD;EACI;EACV,GAAI;CACL,CAAA,CACD,EAAA,CAAA;AAEN,CAAC;AAED,YAAY,UAAU;CAAE,GAAG,UAAU;CAAS,GAAG,SAAS;AAAQ;AAClE,YAAY,cAAc"}
|
|
1
|
+
{"version":3,"file":"MultiSelect.mjs","names":["useId"],"sources":["../../../src/components/MultiSelect/MultiSelect.tsx"],"sourcesContent":["import { Fragment, useEffect, useRef } from 'react';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport {\n BoxProps,\n ElementProps,\n extractStyleProps,\n Factory,\n genericFactory,\n MantineColor,\n Primitive,\n StylesApiProps,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '../../core';\nimport {\n Combobox,\n ComboboxItem,\n ComboboxLikeProps,\n ComboboxLikeRenderOptionInput,\n ComboboxLikeStylesNames,\n ComboboxRenderPillInput,\n getOptionsLockup,\n getParsedComboboxData,\n OptionsDropdown,\n OptionsFilter,\n useCombobox,\n usePillsReorder,\n} from '../Combobox';\nimport { getOptionByLabel } from '../Combobox/get-options-lockup/get-option-by-label';\nimport { isExternalInputChange } from '../Combobox/is-external-input-change/is-external-input-change';\nimport {\n __BaseInputProps,\n __InputStylesNames,\n ClearSectionMode,\n InputClearButtonProps,\n} from '../Input';\nimport { InputBase } from '../InputBase';\nimport { Pill } from '../Pill';\nimport { PillsInput } from '../PillsInput';\nimport { ScrollAreaProps } from '../ScrollArea';\nimport { filterPickedValues } from './filter-picked-values';\n\nconst clearSectionOffset: Record<string, number> = {\n xs: 41,\n sm: 50,\n md: 60,\n lg: 72,\n xl: 89,\n};\n\nexport type MultiSelectStylesNames =\n | __InputStylesNames\n | ComboboxLikeStylesNames\n | 'pill'\n | 'pillsList'\n | 'inputField';\n\nexport interface MultiSelectProps<Value extends Primitive = string>\n extends\n BoxProps,\n __BaseInputProps,\n ComboboxLikeProps<Value>,\n StylesApiProps<MultiSelectFactory>,\n ElementProps<'input', 'size' | 'value' | 'defaultValue' | 'onChange'> {\n /** Controlled component value */\n value?: Value[];\n\n /** Uncontrolled component default value */\n defaultValue?: Value[];\n\n /** Called when value changes */\n onChange?: (value: Value[]) => void;\n\n /** Called with `value` of the removed item */\n onRemove?: (value: Value) => void;\n\n /** Called when the clear button is clicked */\n onClear?: () => void;\n\n /** Called when user attempts to select more values than allowed */\n onMaxValues?: () => void;\n\n /** Controlled search value */\n searchValue?: string;\n\n /** Default search value */\n defaultSearchValue?: string;\n\n /** Called when search changes */\n onSearchChange?: (value: string) => void;\n\n /** Maximum number of values, no limit if not set */\n maxValues?: number;\n\n /** Allows searching through options by user input @default false */\n searchable?: boolean;\n\n /** Message displayed when no options match the search query (when searchable is enabled) or when the data array is empty. If not set, the dropdown will be hidden instead. */\n nothingFoundMessage?: React.ReactNode;\n\n /** If set, the check icon is displayed near the selected option label @default true */\n withCheckIcon?: boolean;\n\n /** If set, unchecked labels are aligned with checked ones @default false */\n withAlignedLabels?: boolean;\n\n /** Position of the checkmark icon shown next to selected options in the dropdown @default 'left' */\n checkIconPosition?: 'left' | 'right';\n\n /** When enabled, selected options are hidden from the dropdown list @default false */\n hidePickedOptions?: boolean;\n\n /** When enabled, displays a clear button to remove all selected values (hidden when component is empty, disabled, or read-only) @default false */\n clearable?: boolean;\n\n /** Determines how the clear button and rightSection are rendered @default 'both' */\n clearSectionMode?: ClearSectionMode;\n\n /** Props passed down to the clear button */\n clearButtonProps?: InputClearButtonProps;\n\n /** Props passed down to the hidden input */\n hiddenInputProps?: Omit<React.ComponentProps<'input'>, 'value'>;\n\n /** Divider used to separate values in the hidden input `value` attribute @default ',' */\n hiddenInputValuesDivider?: string;\n\n /** A function to render content of the option, replaces the default content of the option */\n renderOption?: (item: ComboboxLikeRenderOptionInput<ComboboxItem<Value>>) => React.ReactNode;\n\n /** A function to render content of the pill */\n renderPill?: (props: ComboboxRenderPillInput<Value>) => React.ReactNode;\n\n /** Props passed down to the underlying `ScrollArea` component in the dropdown */\n scrollAreaProps?: ScrollAreaProps;\n\n /** Controls color of the default chevron */\n chevronColor?: MantineColor;\n\n /** Clear search value when item is selected @default true */\n clearSearchOnChange?: boolean;\n\n /** Controls whether dropdown opens when the input receives focus @default true */\n openOnFocus?: boolean;\n\n /** If set, selected values can be reordered by dragging pills. Disabled when `disabled` or `readOnly` is set. @default false */\n withPillsReorder?: boolean;\n}\n\nexport type MultiSelectFactory = Factory<{\n props: MultiSelectProps;\n ref: HTMLInputElement;\n stylesNames: MultiSelectStylesNames;\n signature: <Value extends Primitive = string>(\n props: MultiSelectProps<Value>\n ) => React.JSX.Element;\n}>;\n\nconst defaultProps = {\n maxValues: Infinity,\n withCheckIcon: true,\n checkIconPosition: 'left',\n hiddenInputValuesDivider: ',',\n clearSearchOnChange: true,\n openOnFocus: true,\n size: 'sm',\n} satisfies Partial<MultiSelectProps>;\n\nexport const MultiSelect = genericFactory<MultiSelectFactory>((_props) => {\n const props = useProps(['Input', 'InputWrapper', 'MultiSelect'], defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n size,\n value,\n defaultValue,\n onChange,\n onKeyDown,\n variant,\n data,\n dropdownOpened,\n defaultDropdownOpened,\n onDropdownOpen,\n onDropdownClose,\n selectFirstOptionOnChange,\n selectFirstOptionOnDropdownOpen,\n onOptionSubmit,\n comboboxProps,\n filter,\n limit,\n withScrollArea,\n maxDropdownHeight,\n floatingHeight,\n searchValue,\n defaultSearchValue,\n onSearchChange,\n readOnly,\n disabled,\n onFocus,\n onBlur,\n radius,\n rightSection,\n rightSectionWidth,\n rightSectionPointerEvents,\n rightSectionProps,\n leftSection,\n leftSectionWidth,\n leftSectionPointerEvents,\n leftSectionProps,\n inputContainer,\n inputWrapperOrder,\n withAsterisk,\n labelProps,\n descriptionProps,\n errorProps,\n successProps,\n wrapperProps,\n description,\n label,\n error,\n success,\n maxValues,\n searchable,\n nothingFoundMessage,\n withCheckIcon,\n withAlignedLabels,\n checkIconPosition,\n hidePickedOptions,\n withErrorStyles,\n withSuccessStyles,\n name,\n form,\n id,\n clearable,\n clearSectionMode,\n clearButtonProps,\n hiddenInputProps,\n placeholder,\n hiddenInputValuesDivider,\n required,\n mod,\n renderOption,\n renderPill,\n onRemove,\n onClear,\n onMaxValues,\n scrollAreaProps,\n chevronColor,\n attributes,\n clearSearchOnChange,\n openOnFocus,\n loading,\n loadingPosition,\n withPillsReorder,\n ...others\n } = props;\n\n const _id = useId(id);\n const parsedData = getParsedComboboxData(data);\n const optionsLockup = getOptionsLockup(parsedData);\n const retainedSelectedOptions = useRef<Record<string, ComboboxItem<Primitive>>>({});\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 combobox.resetSelectedOption();\n },\n });\n\n const {\n styleProps,\n rest: { type, autoComplete, ...rest },\n } = extractStyleProps(others);\n\n const [_value, setValue] = useUncontrolled({\n value,\n defaultValue,\n finalValue: [],\n onChange,\n });\n\n const { getPillProps, getListProps, handleInputKeyDown } = usePillsReorder({\n value: _value,\n onChange: setValue,\n enabled: withPillsReorder && !disabled && !readOnly,\n });\n\n const [_searchValue, setSearchValue] = useUncontrolled({\n value: searchValue,\n defaultValue: defaultSearchValue,\n finalValue: '',\n onChange: onSearchChange,\n });\n\n const handleSearchChange = (value: string) => {\n setSearchValue(value);\n combobox.resetSelectedOption();\n };\n\n const getStyles = useStyles<MultiSelectFactory>({\n name: 'MultiSelect',\n classes: {} as any,\n props: props as any,\n classNames,\n styles,\n unstyled,\n attributes,\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<MultiSelectFactory>({\n props,\n styles,\n classNames,\n });\n\n const handleInputKeydown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n if (event.key === ' ' && !searchable) {\n event.preventDefault();\n combobox.toggleDropdown();\n }\n\n if (event.key === 'Backspace' && _searchValue.length === 0 && _value.length > 0) {\n onRemove?.(_value[_value.length - 1]);\n setValue(_value.slice(0, _value.length - 1));\n }\n\n handleInputKeyDown(event);\n };\n\n const values = _value.map((item, index) => {\n const optionData = optionsLockup[`${item}`] || retainedSelectedOptions.current[`${item}`];\n const reorderProps = getPillProps(index);\n\n if (renderPill) {\n return (\n <Fragment key={`${item}-${index}`}>\n {renderPill({\n option: optionData,\n value: item,\n onRemove: () => {\n setValue(_value.filter((i) => item !== i));\n onRemove?.(item);\n },\n disabled,\n reorderProps,\n })}\n </Fragment>\n );\n }\n\n return (\n <Pill\n key={`${item}-${index}`}\n withRemoveButton={!readOnly && !optionsLockup[`${item}`]?.disabled}\n onRemove={() => {\n setValue(_value.filter((i) => item !== i));\n onRemove?.(item);\n }}\n unstyled={unstyled}\n disabled={disabled}\n {...getStyles('pill')}\n {...reorderProps}\n >\n {optionData?.label || item}\n </Pill>\n );\n });\n\n useEffect(() => {\n if (selectFirstOptionOnChange) {\n combobox.selectFirstOption();\n }\n }, [selectFirstOptionOnChange, _searchValue]);\n\n useEffect(() => {\n _value.forEach((val) => {\n if (`${val}` in optionsLockup) {\n retainedSelectedOptions.current[`${val}`] = optionsLockup[`${val}`];\n }\n });\n }, [optionsLockup, _value]);\n\n const clearButton = (\n <Combobox.ClearButton\n {...clearButtonProps}\n onClear={() => {\n onClear?.();\n setValue([]);\n handleSearchChange('');\n }}\n />\n );\n\n const filteredData = filterPickedValues({ data: parsedData, value: _value });\n const _clearable = clearable && _value.length > 0 && !disabled && !readOnly;\n const pillsListStyle = _clearable\n ? { paddingInlineEnd: clearSectionOffset[size] ?? clearSectionOffset.sm }\n : undefined;\n\n return (\n <>\n <Combobox\n store={combobox}\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n size={size}\n readOnly={readOnly}\n __staticSelector=\"MultiSelect\"\n attributes={attributes}\n floatingHeight={floatingHeight}\n onOptionSubmit={(val) => {\n onOptionSubmit?.(val as any);\n if (clearSearchOnChange) {\n handleSearchChange('');\n }\n combobox.updateSelectedOptionIndex('selected');\n\n if (_value.includes(optionsLockup[`${val}`].value as any)) {\n setValue(_value.filter((v) => v !== optionsLockup[`${val}`].value));\n onRemove?.(optionsLockup[`${val}`].value as any);\n } else if (_value.length < maxValues) {\n setValue([..._value, optionsLockup[`${val}`].value] as any);\n } else {\n onMaxValues?.();\n }\n }}\n {...comboboxProps}\n >\n <Combobox.DropdownTarget>\n <PillsInput\n {...styleProps}\n __staticSelector=\"MultiSelect\"\n classNames={resolvedClassNames}\n styles={resolvedStyles}\n unstyled={unstyled}\n size={size}\n className={className}\n style={style}\n variant={variant}\n disabled={disabled}\n radius={radius}\n __defaultRightSection={\n <Combobox.Chevron\n size={size}\n error={error}\n unstyled={unstyled}\n color={chevronColor}\n />\n }\n __clearSection={clearButton}\n __clearable={_clearable}\n __clearSectionMode={clearSectionMode}\n rightSection={rightSection}\n rightSectionPointerEvents={rightSectionPointerEvents || 'none'}\n rightSectionWidth={rightSectionWidth}\n rightSectionProps={rightSectionProps}\n leftSection={leftSection}\n leftSectionWidth={leftSectionWidth}\n leftSectionPointerEvents={leftSectionPointerEvents}\n leftSectionProps={leftSectionProps}\n loading={loading}\n loadingPosition={loadingPosition}\n inputContainer={inputContainer}\n inputWrapperOrder={inputWrapperOrder}\n withAsterisk={withAsterisk}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorProps={errorProps}\n successProps={successProps}\n wrapperProps={wrapperProps}\n description={description}\n label={label}\n error={error}\n success={success}\n withErrorStyles={withErrorStyles}\n withSuccessStyles={withSuccessStyles}\n __stylesApiProps={{\n ...props,\n rightSectionPointerEvents: rightSectionPointerEvents || 'none',\n multiline: true,\n }}\n pointer={!searchable}\n onClick={() => (searchable ? combobox.openDropdown() : combobox.toggleDropdown())}\n data-expanded={combobox.dropdownOpened || undefined}\n id={_id}\n required={required}\n mod={mod}\n attributes={attributes}\n >\n <Pill.Group\n attributes={attributes}\n disabled={disabled}\n unstyled={unstyled}\n {...getStyles('pillsList', { style: pillsListStyle })}\n {...getListProps()}\n >\n {values}\n <Combobox.EventsTarget autoComplete={autoComplete} withExpandedAttribute>\n <PillsInput.Field\n {...rest}\n id={_id}\n placeholder={placeholder}\n type={!searchable && !placeholder ? 'hidden' : 'visible'}\n {...getStyles('inputField')}\n unstyled={unstyled}\n onFocus={(event) => {\n onFocus?.(event);\n openOnFocus && searchable && combobox.openDropdown();\n }}\n onBlur={(event) => {\n onBlur?.(event);\n combobox.closeDropdown();\n handleSearchChange('');\n }}\n onKeyDown={handleInputKeydown}\n value={_searchValue}\n onChange={(event) => {\n if (isExternalInputChange(event)) {\n if (!readOnly) {\n const externalOption = getOptionByLabel(\n optionsLockup,\n event.currentTarget.value\n );\n\n if (\n externalOption &&\n !_value.includes(externalOption.value as any) &&\n _value.length < maxValues\n ) {\n setValue([..._value, externalOption.value] as any);\n }\n }\n\n return;\n }\n\n handleSearchChange(event.currentTarget.value);\n searchable && combobox.openDropdown();\n selectFirstOptionOnChange && combobox.selectFirstOption();\n }}\n disabled={disabled}\n readOnly={readOnly || !searchable}\n pointer={!searchable}\n />\n </Combobox.EventsTarget>\n </Pill.Group>\n </PillsInput>\n </Combobox.DropdownTarget>\n\n <OptionsDropdown\n data={hidePickedOptions ? filteredData : parsedData}\n hidden={readOnly || disabled}\n filter={filter as OptionsFilter<Primitive> | undefined}\n search={_searchValue}\n limit={limit}\n hiddenWhenEmpty={!nothingFoundMessage}\n withScrollArea={withScrollArea}\n maxDropdownHeight={maxDropdownHeight}\n filterOptions={searchable}\n value={_value}\n checkIconPosition={checkIconPosition}\n withCheckIcon={withCheckIcon}\n withAlignedLabels={withAlignedLabels}\n nothingFoundMessage={nothingFoundMessage}\n unstyled={unstyled}\n labelId={label ? `${_id}-label` : undefined}\n aria-label={label ? undefined : others['aria-label']}\n renderOption={renderOption}\n scrollAreaProps={scrollAreaProps}\n />\n </Combobox>\n <Combobox.HiddenInput\n name={name}\n valuesDivider={hiddenInputValuesDivider}\n value={_value}\n form={form}\n disabled={disabled}\n {...hiddenInputProps}\n />\n </>\n );\n});\n\nMultiSelect.classes = { ...InputBase.classes, ...Combobox.classes };\nMultiSelect.displayName = '@mantine/core/MultiSelect';\n\nexport namespace MultiSelect {\n export type Props<Value extends Primitive = string> = MultiSelectProps<Value>;\n export type StylesNames = MultiSelectStylesNames;\n export type Factory = MultiSelectFactory;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,qBAA6C;CACjD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AA8GA,MAAM,eAAe;CACnB,WAAW;CACX,eAAe;CACf,mBAAmB;CACnB,0BAA0B;CAC1B,qBAAqB;CACrB,aAAa;CACb,MAAM;AACR;AAEA,MAAa,cAAc,gBAAoC,WAAW;CACxE,MAAM,QAAQ,SAAS;EAAC;EAAS;EAAgB;CAAa,GAAG,cAAc,MAAM;CACrF,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,OACA,cACA,UACA,WACA,SACA,MACA,gBACA,uBACA,gBACA,iBACA,2BACA,iCACA,gBACA,eACA,QACA,OACA,gBACA,mBACA,gBACA,aACA,oBACA,gBACA,UACA,UACA,SACA,QACA,QACA,cACA,mBACA,2BACA,mBACA,aACA,kBACA,0BACA,kBACA,gBACA,mBACA,cACA,YACA,kBACA,YACA,cACA,cACA,aACA,OACA,OACA,SACA,WACA,YACA,qBACA,eACA,mBACA,mBACA,mBACA,iBACA,mBACA,MACA,MACA,IACA,WACA,kBACA,kBACA,kBACA,aACA,0BACA,UACA,KACA,cACA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Q;EACN,eAAe;EACf,OAAO;EACD;EACI;EACV,GAAI;CACL,CAAA,CACD,EAAA,CAAA;AAEN,CAAC;AAED,YAAY,UAAU;CAAE,GAAG,UAAU;CAAS,GAAG,SAAS;AAAQ;AAClE,YAAY,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeSelect.mjs","names":[],"sources":["../../../src/components/NativeSelect/NativeSelect.tsx"],"sourcesContent":["import { BoxProps, ElementProps, factory, Factory, StylesApiProps, useProps } from '../../core';\nimport { ComboboxChevron, ComboboxStringGroupData, getParsedComboboxData } from '../Combobox';\nimport { __BaseInputProps, __InputStylesNames } from '../Input';\nimport { InputBase } from '../InputBase';\nimport { NativeSelectOption } from './NativeSelectOption';\n\nexport interface NativeSelectProps\n extends\n BoxProps,\n Omit<__BaseInputProps, 'pointer'>,\n StylesApiProps<NativeSelectFactory>,\n ElementProps<'select', 'size'> {\n /**\n * Data used to render options. Accepts strings, objects with label/value,\n * or grouped options. If `children` prop is provided, `data` will be ignored.\n */\n data?: ComboboxStringGroupData;\n}\n\nexport type NativeSelectFactory = Factory<{\n props: NativeSelectProps;\n ref: HTMLSelectElement;\n stylesNames: __InputStylesNames;\n}>;\n\nconst defaultProps = {\n size: 'sm',\n rightSectionPointerEvents: 'none',\n} satisfies Partial<NativeSelectProps>;\n\nexport const NativeSelect = factory<NativeSelectFactory>((props) => {\n const { data, children, size, error, rightSection, unstyled, ...others } = useProps(\n ['Input', 'InputWrapper', 'NativeSelect'],\n defaultProps,\n props\n );\n\n const options = getParsedComboboxData<string>(data).map((item, index) => (\n <NativeSelectOption key={index} data={item} />\n ));\n\n return (\n <InputBase\n component=\"select\"\n {...others}\n __staticSelector=\"NativeSelect\"\n size={size}\n pointer\n error={error}\n unstyled={unstyled}\n rightSection={\n rightSection || <ComboboxChevron size={size} error={error} unstyled={unstyled} />\n }\n >\n {children || options}\n </InputBase>\n );\n});\n\nNativeSelect.classes = InputBase.classes;\nNativeSelect.displayName = '@mantine/core/NativeSelect';\n\nexport namespace NativeSelect {\n export type Props = NativeSelectProps;\n export type Factory = NativeSelectFactory;\n export type StylesNames = __InputStylesNames;\n}\n"],"mappings":";;;;;;;;;AAyBA,MAAM,eAAe;CACnB,MAAM;CACN,2BAA2B;AAC7B;AAEA,MAAa,eAAe,SAA8B,UAAU;CAClE,MAAM,EAAE,MAAM,UAAU,MAAM,OAAO,cAAc,UAAU,GAAG,WAAW,SACzE;EAAC;EAAS;EAAgB;CAAc,GACxC,cACA,KACF;CAEA,MAAM,UAAU,sBAA8B,IAAI,CAAC,CAAC,KAAK,MAAM,UAC7D,oBAAC,oBAAD,EAAgC,MAAM,KAAO,GAApB,KAAoB,CAC9C;CAED,OACE,oBAAC,WAAD;EACE,WAAU;EACV,GAAI;EACJ,kBAAiB;EACX;EACN,SAAA;EACO;EACG;EACV,cACE,gBAAgB,oBAAC,iBAAD;GAAuB;GAAa;GAAiB;EAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"NativeSelect.mjs","names":[],"sources":["../../../src/components/NativeSelect/NativeSelect.tsx"],"sourcesContent":["import { BoxProps, ElementProps, factory, Factory, StylesApiProps, useProps } from '../../core';\nimport { ComboboxChevron, ComboboxStringGroupData, getParsedComboboxData } from '../Combobox';\nimport { __BaseInputProps, __InputStylesNames } from '../Input';\nimport { InputBase } from '../InputBase';\nimport { NativeSelectOption } from './NativeSelectOption';\n\nexport interface NativeSelectProps\n extends\n BoxProps,\n Omit<__BaseInputProps, 'pointer'>,\n StylesApiProps<NativeSelectFactory>,\n ElementProps<'select', 'size'> {\n /**\n * Data used to render options. Accepts strings, objects with label/value,\n * or grouped options. If `children` prop is provided, `data` will be ignored.\n */\n data?: ComboboxStringGroupData;\n}\n\nexport type NativeSelectFactory = Factory<{\n props: NativeSelectProps;\n ref: HTMLSelectElement;\n stylesNames: __InputStylesNames;\n}>;\n\nconst defaultProps = {\n size: 'sm',\n rightSectionPointerEvents: 'none',\n} satisfies Partial<NativeSelectProps>;\n\nexport const NativeSelect = factory<NativeSelectFactory>((props) => {\n const { data, children, size, error, rightSection, unstyled, ...others } = useProps(\n ['Input', 'InputWrapper', 'NativeSelect'],\n defaultProps,\n props\n );\n\n const options = getParsedComboboxData<string>(data).map((item, index) => (\n <NativeSelectOption key={index} data={item} />\n ));\n\n return (\n <InputBase\n component=\"select\"\n {...others}\n __staticSelector=\"NativeSelect\"\n size={size}\n pointer\n error={error}\n unstyled={unstyled}\n rightSection={\n rightSection || <ComboboxChevron size={size} error={error} unstyled={unstyled} />\n }\n >\n {children || options}\n </InputBase>\n );\n});\n\nNativeSelect.classes = InputBase.classes;\nNativeSelect.displayName = '@mantine/core/NativeSelect';\n\nexport namespace NativeSelect {\n export type Props = NativeSelectProps;\n export type Factory = NativeSelectFactory;\n export type StylesNames = __InputStylesNames;\n}\n"],"mappings":";;;;;;;;;AAyBA,MAAM,eAAe;CACnB,MAAM;CACN,2BAA2B;AAC7B;AAEA,MAAa,eAAe,SAA8B,UAAU;CAClE,MAAM,EAAE,MAAM,UAAU,MAAM,OAAO,cAAc,UAAU,GAAG,WAAW,SACzE;EAAC;EAAS;EAAgB;CAAc,GACxC,cACA,KACF;CAEA,MAAM,UAAU,sBAA8B,IAAI,CAAC,CAAC,KAAK,MAAM,UAC7D,oBAAC,oBAAD,EAAgC,MAAM,KAAO,GAApB,KAAoB,CAC9C;CAED,OACE,oBAAC,WAAD;EACE,WAAU;EACV,GAAI;EACJ,kBAAiB;EACX;EACN,SAAA;EACO;EACG;EACV,cACE,gBAAgB,oBAAC,iBAAD;GAAuB;GAAa;GAAiB;EAAW,CAAA;EAGjF,UAAA,YAAY;CACJ,CAAA;AAEf,CAAC;AAED,aAAa,UAAU,UAAU;AACjC,aAAa,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeSelectOption.mjs","names":[],"sources":["../../../src/components/NativeSelect/NativeSelectOption.tsx"],"sourcesContent":["import { ComboboxParsedItem, ComboboxParsedItemGroup } from '../Combobox';\n\nexport interface NativeSelectOptionProps {\n data: ComboboxParsedItem;\n}\n\nfunction isGroup(input: ComboboxParsedItem): input is ComboboxParsedItemGroup {\n return 'group' in input;\n}\n\nexport function NativeSelectOption({ data }: NativeSelectOptionProps) {\n if (isGroup(data)) {\n const items = data.items.map((item) => <NativeSelectOption key={item.value} data={item} />);\n return <optgroup label={data.group as string}>{items}</optgroup>;\n }\n\n const { value, label, ...others } = data;\n\n return (\n <option value={data.value} {...others}>\n {data.label}\n </option>\n );\n}\n\nNativeSelectOption.displayName = '@mantine/core/NativeSelectOption';\n"],"mappings":";;;AAMA,SAAS,QAAQ,OAA6D;CAC5E,OAAO,WAAW;AACpB;AAEA,SAAgB,mBAAmB,EAAE,QAAiC;CACpE,IAAI,QAAQ,IAAI,GAAG;EACjB,MAAM,QAAQ,KAAK,MAAM,KAAK,SAAS,oBAAC,oBAAD,EAAqC,MAAM,KAAO,GAAzB,KAAK,KAAoB,CAAC;EAC1F,OAAO,oBAAC,YAAD;GAAU,OAAO,KAAK;
|
|
1
|
+
{"version":3,"file":"NativeSelectOption.mjs","names":[],"sources":["../../../src/components/NativeSelect/NativeSelectOption.tsx"],"sourcesContent":["import { ComboboxParsedItem, ComboboxParsedItemGroup } from '../Combobox';\n\nexport interface NativeSelectOptionProps {\n data: ComboboxParsedItem;\n}\n\nfunction isGroup(input: ComboboxParsedItem): input is ComboboxParsedItemGroup {\n return 'group' in input;\n}\n\nexport function NativeSelectOption({ data }: NativeSelectOptionProps) {\n if (isGroup(data)) {\n const items = data.items.map((item) => <NativeSelectOption key={item.value} data={item} />);\n return <optgroup label={data.group as string}>{items}</optgroup>;\n }\n\n const { value, label, ...others } = data;\n\n return (\n <option value={data.value} {...others}>\n {data.label}\n </option>\n );\n}\n\nNativeSelectOption.displayName = '@mantine/core/NativeSelectOption';\n"],"mappings":";;;AAMA,SAAS,QAAQ,OAA6D;CAC5E,OAAO,WAAW;AACpB;AAEA,SAAgB,mBAAmB,EAAE,QAAiC;CACpE,IAAI,QAAQ,IAAI,GAAG;EACjB,MAAM,QAAQ,KAAK,MAAM,KAAK,SAAS,oBAAC,oBAAD,EAAqC,MAAM,KAAO,GAAzB,KAAK,KAAoB,CAAC;EAC1F,OAAO,oBAAC,YAAD;GAAU,OAAO,KAAK;GAAkB,UAAA;EAAgB,CAAA;CACjE;CAEA,MAAM,EAAE,OAAO,OAAO,GAAG,WAAW;CAEpC,OACE,oBAAC,UAAD;EAAQ,OAAO,KAAK;EAAO,GAAI;EAC5B,UAAA,KAAK;CACA,CAAA;AAEZ;AAEA,mBAAmB,cAAc"}
|