@mantine/core 9.3.2 → 9.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Accordion/Accordion.cjs +1 -0
- package/cjs/components/Accordion/Accordion.cjs.map +1 -1
- package/cjs/components/Accordion/Accordion.context.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/AccordionItem.context.cjs.map +1 -1
- package/cjs/components/Accordion/AccordionPanel/AccordionPanel.cjs.map +1 -1
- package/cjs/components/ActionIcon/ActionIcon.cjs +1 -0
- package/cjs/components/ActionIcon/ActionIcon.cjs.map +1 -1
- package/cjs/components/ActionIcon/ActionIconGroup/ActionIconGroup.cjs +1 -1
- package/cjs/components/ActionIcon/ActionIconGroup/ActionIconGroup.cjs.map +1 -1
- 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.map +1 -1
- package/cjs/components/AppShell/AppShell.cjs.map +1 -1
- package/cjs/components/AppShell/AppShell.context.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.map +1 -1
- package/cjs/components/AppShell/AppShellMediaStyles/AppShellMediaStyles.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellMediaStyles/assign-footer-variables/assign-footer-variables.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellMediaStyles/assign-header-variables/assign-header-variables.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellMediaStyles/assign-padding-variables/assign-padding-variables.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellMediaStyles/get-variables/get-variables.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellMediaStyles/is-primitive-size/is-primitive-size.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellMediaStyles/is-responsive-size/is-responsive-size.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellNavbar/AppShellNavbar.cjs.map +1 -1
- package/cjs/components/AppShell/AppShellSection/AppShellSection.cjs.map +1 -1
- package/cjs/components/AppShell/use-resizing/use-resizing.cjs.map +1 -1
- 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/Avatar/get-initials/get-initials.cjs.map +1 -1
- package/cjs/components/BackgroundImage/BackgroundImage.cjs.map +1 -1
- package/cjs/components/Badge/Badge.cjs.map +1 -1
- package/cjs/components/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.map +1 -1
- package/cjs/components/Button/ButtonGroupSection/ButtonGroupSection.cjs.map +1 -1
- package/cjs/components/Card/Card.cjs.map +1 -1
- package/cjs/components/Card/Card.context.cjs.map +1 -1
- package/cjs/components/Card/CardSection/CardSection.cjs.map +1 -1
- package/cjs/components/Center/Center.cjs.map +1 -1
- package/cjs/components/Checkbox/CheckIcon.cjs.map +1 -1
- package/cjs/components/Checkbox/Checkbox.cjs.map +1 -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/Code/Code.cjs.map +1 -1
- package/cjs/components/Collapse/Collapse.cjs +4 -0
- 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/AlphaSlider/AlphaSlider.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.map +1 -1
- package/cjs/components/ColorPicker/HueSlider/HueSlider.cjs.map +1 -1
- package/cjs/components/ColorPicker/Saturation/Saturation.cjs.map +1 -1
- package/cjs/components/ColorPicker/Swatches/Swatches.cjs.map +1 -1
- package/cjs/components/ColorPicker/Thumb/Thumb.cjs.map +1 -1
- package/cjs/components/ColorPicker/converters/converters.cjs.map +1 -1
- package/cjs/components/ColorPicker/converters/parsers.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/Combobox.context.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxChevron/ComboboxChevron.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxClearButton/ComboboxClearButton.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxDropdown/ComboboxDropdown.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxDropdownTarget/ComboboxDropdownTarget.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxEmpty/ComboboxEmpty.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxEventsTarget/ComboboxEventsTarget.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxFooter/ComboboxFooter.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxGroup/ComboboxGroup.cjs +3 -2
- package/cjs/components/Combobox/ComboboxGroup/ComboboxGroup.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxHeader/ComboboxHeader.cjs.map +1 -1
- package/cjs/components/Combobox/ComboboxHiddenInput/ComboboxHiddenInput.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.map +1 -1
- package/cjs/components/Combobox/OptionsDropdown/OptionsDropdown.cjs +2 -2
- 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/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 +218 -0
- package/cjs/components/ComboboxPopover/ComboboxPopover.cjs.map +1 -0
- package/cjs/components/ComboboxPopover/ComboboxPopoverTarget.cjs +45 -0
- package/cjs/components/ComboboxPopover/ComboboxPopoverTarget.cjs.map +1 -0
- package/cjs/components/Container/Container.cjs.map +1 -1
- package/cjs/components/CopyButton/CopyButton.cjs.map +1 -1
- package/cjs/components/DataList/DataList.cjs +61 -0
- package/cjs/components/DataList/DataList.cjs.map +1 -0
- package/cjs/components/DataList/DataList.context.cjs +8 -0
- package/cjs/components/DataList/DataList.context.cjs.map +1 -0
- package/cjs/components/DataList/DataList.module.cjs +12 -0
- package/cjs/components/DataList/DataList.module.cjs.map +1 -0
- package/cjs/components/DataList/DataListItem/DataListItem.cjs +32 -0
- package/cjs/components/DataList/DataListItem/DataListItem.cjs.map +1 -0
- package/cjs/components/DataList/DataListItemLabel/DataListItemLabel.cjs +33 -0
- package/cjs/components/DataList/DataListItemLabel/DataListItemLabel.cjs.map +1 -0
- package/cjs/components/DataList/DataListItemValue/DataListItemValue.cjs +33 -0
- package/cjs/components/DataList/DataListItemValue/DataListItemValue.cjs.map +1 -0
- 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/Drawer.context.cjs.map +1 -1
- package/cjs/components/Drawer/DrawerBody.cjs.map +1 -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.map +1 -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.map +1 -1
- package/cjs/components/EmptyState/EmptyState.cjs +102 -0
- package/cjs/components/EmptyState/EmptyState.cjs.map +1 -0
- package/cjs/components/EmptyState/EmptyState.context.cjs +8 -0
- package/cjs/components/EmptyState/EmptyState.context.cjs.map +1 -0
- package/cjs/components/EmptyState/EmptyState.module.cjs +14 -0
- package/cjs/components/EmptyState/EmptyState.module.cjs.map +1 -0
- package/cjs/components/EmptyState/EmptyStateActions/EmptyStateActions.cjs +28 -0
- package/cjs/components/EmptyState/EmptyStateActions/EmptyStateActions.cjs.map +1 -0
- package/cjs/components/EmptyState/EmptyStateDescription/EmptyStateDescription.cjs +29 -0
- package/cjs/components/EmptyState/EmptyStateDescription/EmptyStateDescription.cjs.map +1 -0
- package/cjs/components/EmptyState/EmptyStateIndicator/EmptyStateIndicator.cjs +29 -0
- package/cjs/components/EmptyState/EmptyStateIndicator/EmptyStateIndicator.cjs.map +1 -0
- package/cjs/components/EmptyState/EmptyStateTitle/EmptyStateTitle.cjs +30 -0
- package/cjs/components/EmptyState/EmptyStateTitle/EmptyStateTitle.cjs.map +1 -0
- package/cjs/components/Fieldset/Fieldset.cjs.map +1 -1
- package/cjs/components/FileButton/FileButton.cjs.map +1 -1
- package/cjs/components/FileInput/FileInput.cjs.map +1 -1
- package/cjs/components/Flex/Flex.cjs.map +1 -1
- package/cjs/components/FloatingIndicator/FloatingIndicator.cjs.map +1 -1
- package/cjs/components/FloatingIndicator/use-floating-indicator.cjs.map +1 -1
- package/cjs/components/FloatingWindow/FloatingWindow.cjs.map +1 -1
- package/cjs/components/FocusTrap/FocusTrap.cjs.map +1 -1
- package/cjs/components/Grid/Grid.cjs.map +1 -1
- package/cjs/components/Grid/Grid.context.cjs.map +1 -1
- package/cjs/components/Grid/GridCol/GridCol.cjs.map +1 -1
- package/cjs/components/Grid/GridCol/GridColVariables.cjs.map +1 -1
- package/cjs/components/Grid/GridVariables.cjs.map +1 -1
- package/cjs/components/Group/Group.cjs.map +1 -1
- package/cjs/components/Group/filter-falsy-children/filter-falsy-children.cjs.map +1 -1
- package/cjs/components/Highlight/Highlight.cjs.map +1 -1
- package/cjs/components/Highlight/highlighter/highlighter.cjs.map +1 -1
- package/cjs/components/HoverCard/HoverCard.cjs.map +1 -1
- package/cjs/components/HoverCard/HoverCard.context.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 +7 -2
- package/cjs/components/Input/Input.cjs.map +1 -1
- package/cjs/components/Input/Input.context.cjs.map +1 -1
- package/cjs/components/Input/Input.module.cjs +1 -0
- package/cjs/components/Input/Input.module.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.map +1 -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.map +1 -1
- package/cjs/components/Input/InputSuccess/InputSuccess.cjs +48 -0
- package/cjs/components/Input/InputSuccess/InputSuccess.cjs.map +1 -0
- package/cjs/components/Input/InputWrapper/InputWrapper.cjs +22 -5
- package/cjs/components/Input/InputWrapper/InputWrapper.cjs.map +1 -1
- package/cjs/components/Input/InputWrapper.context.cjs.map +1 -1
- package/cjs/components/Input/use-input-props.cjs +4 -1
- package/cjs/components/Input/use-input-props.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/JsonInput/validate-json/validate-json.cjs.map +1 -1
- package/cjs/components/Kbd/Kbd.cjs.map +1 -1
- package/cjs/components/List/List.cjs.map +1 -1
- package/cjs/components/List/List.context.cjs.map +1 -1
- package/cjs/components/List/ListItem/ListItem.cjs.map +1 -1
- package/cjs/components/Loader/Loader.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.map +1 -1
- package/cjs/components/Marquee/Marquee.cjs.map +1 -1
- 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/Menu.context.cjs.map +1 -1
- 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.map +1 -1
- package/cjs/components/Menu/MenuContextMenu/MenuContextMenu.cjs.map +1 -1
- package/cjs/components/Menu/MenuDivider/MenuDivider.cjs.map +1 -1
- package/cjs/components/Menu/MenuDropdown/MenuDropdown.cjs +1 -0
- 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.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.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/MenuSubTarget/MenuSubTarget.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 +146 -0
- package/cjs/components/Menubar/Menubar.cjs.map +1 -0
- package/cjs/components/Menubar/Menubar.context.cjs +12 -0
- package/cjs/components/Menubar/Menubar.context.cjs.map +1 -0
- package/cjs/components/Menubar/Menubar.module.cjs +10 -0
- package/cjs/components/Menubar/Menubar.module.cjs.map +1 -0
- package/cjs/components/Menubar/MenubarDropdown/MenubarDropdown.cjs +61 -0
- package/cjs/components/Menubar/MenubarDropdown/MenubarDropdown.cjs.map +1 -0
- package/cjs/components/Menubar/MenubarMenu/MenubarMenu.cjs +59 -0
- package/cjs/components/Menubar/MenubarMenu/MenubarMenu.cjs.map +1 -0
- package/cjs/components/Menubar/MenubarTarget/MenubarTarget.cjs +143 -0
- package/cjs/components/Menubar/MenubarTarget/MenubarTarget.cjs.map +1 -0
- package/cjs/components/Modal/Modal.cjs.map +1 -1
- package/cjs/components/Modal/Modal.context.cjs.map +1 -1
- package/cjs/components/Modal/ModalBody.cjs.map +1 -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.map +1 -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.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/ModalBase.context.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/NativeScrollArea.cjs.map +1 -1
- package/cjs/components/ModalBase/use-lock-scroll.cjs.map +1 -1
- package/cjs/components/ModalBase/use-modal-body-id.cjs.map +1 -1
- package/cjs/components/ModalBase/use-modal-title-id.cjs.map +1 -1
- package/cjs/components/ModalBase/use-modal.cjs.map +1 -1
- package/cjs/components/MultiSelect/MultiSelect.cjs +4 -1
- package/cjs/components/MultiSelect/MultiSelect.cjs.map +1 -1
- package/cjs/components/MultiSelect/filter-picked-values.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.map +1 -1
- package/cjs/components/NumberFormatter/NumberFormatter.cjs.map +1 -1
- package/cjs/components/NumberInput/NumberInput.cjs.map +1 -1
- package/cjs/components/NumberInput/NumberInputChevron.cjs.map +1 -1
- package/cjs/components/OverflowList/OverflowList.cjs.map +1 -1
- package/cjs/components/OverflowList/get-row-position-data.cjs.map +1 -1
- package/cjs/components/OverflowList/use-dimensions.cjs.map +1 -1
- package/cjs/components/Overlay/Overlay.cjs.map +1 -1
- package/cjs/components/Pagination/Pagination.cjs.map +1 -1
- package/cjs/components/Pagination/Pagination.context.cjs.map +1 -1
- package/cjs/components/Pagination/Pagination.icons.cjs.map +1 -1
- package/cjs/components/Pagination/PaginationControl/PaginationControl.cjs.map +1 -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.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.map +1 -1
- package/cjs/components/PasswordInput/PasswordInput.cjs +11 -2
- 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 +2 -1
- package/cjs/components/PinInput/PinInput.cjs.map +1 -1
- package/cjs/components/PinInput/create-pin-array/create-pin-array.cjs.map +1 -1
- package/cjs/components/Popover/Popover.cjs.map +1 -1
- package/cjs/components/Popover/Popover.context.cjs.map +1 -1
- 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.map +1 -1
- package/cjs/components/Portal/OptionalPortal.cjs.map +1 -1
- package/cjs/components/Portal/Portal.cjs.map +1 -1
- package/cjs/components/Progress/Progress.cjs.map +1 -1
- package/cjs/components/Progress/Progress.context.cjs.map +1 -1
- package/cjs/components/Progress/ProgressLabel/ProgressLabel.cjs.map +1 -1
- package/cjs/components/Progress/ProgressRoot/ProgressRoot.cjs.map +1 -1
- package/cjs/components/Progress/ProgressSection/ProgressSection.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.map +1 -1
- package/cjs/components/Rating/Rating.context.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.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/RingProgress/get-curves/get-curves.cjs.map +1 -1
- package/cjs/components/RollingNumber/DigitColumn.cjs.map +1 -1
- package/cjs/components/RollingNumber/RollingNumber.cjs.map +1 -1
- package/cjs/components/RollingNumber/get-digit-parts.cjs +2 -1
- package/cjs/components/RollingNumber/get-digit-parts.cjs.map +1 -1
- package/cjs/components/RollingNumber/get-render-slots.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollArea.cjs.map +1 -1
- package/cjs/components/ScrollArea/ScrollArea.context.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/ScrollAreaScrollbar.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/Scrollbar.context.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 +1 -0
- package/cjs/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.cjs.map +1 -1
- package/cjs/components/ScrollArea/use-resize-observer.cjs.map +1 -1
- package/cjs/components/ScrollArea/utils/add-unlinked-scroll-listener.cjs.map +1 -1
- package/cjs/components/ScrollArea/utils/get-scroll-position-from-pointer.cjs.map +1 -1
- package/cjs/components/ScrollArea/utils/get-thumb-offset-from-scroll.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 +4 -1
- package/cjs/components/SemiCircleProgress/SemiCircleProgress.cjs.map +1 -1
- package/cjs/components/SemiCircleProgress/SemiCircleProgress.module.cjs.map +1 -1
- package/cjs/components/SimpleGrid/SimpleGrid.cjs.map +1 -1
- package/cjs/components/SimpleGrid/SimpleGridVariables.cjs.map +1 -1
- package/cjs/components/Skeleton/Skeleton.cjs.map +1 -1
- package/cjs/components/Slider/Marks/Marks.cjs.map +1 -1
- package/cjs/components/Slider/RangeSlider/RangeSlider.cjs.map +1 -1
- package/cjs/components/Slider/Slider/Slider.cjs.map +1 -1
- package/cjs/components/Slider/Slider.context.cjs.map +1 -1
- package/cjs/components/Slider/Slider.module.cjs.map +1 -1
- package/cjs/components/Slider/SliderRoot/SliderRoot.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/Slider/utils/get-precision/get-precision.cjs.map +1 -1
- package/cjs/components/Slider/utils/get-step-mark-value/get-step-mark-value.cjs.map +1 -1
- package/cjs/components/Space/Space.cjs.map +1 -1
- package/cjs/components/Splitter/GripIcon.cjs.map +1 -1
- package/cjs/components/Splitter/Splitter.cjs +22 -1
- package/cjs/components/Splitter/Splitter.cjs.map +1 -1
- package/cjs/components/Splitter/Splitter.context.cjs.map +1 -1
- package/cjs/components/Splitter/SplitterPane/SplitterPane.cjs +1 -2
- package/cjs/components/Splitter/SplitterPane/SplitterPane.cjs.map +1 -1
- package/cjs/components/Spoiler/Spoiler.cjs.map +1 -1
- package/cjs/components/Stack/Stack.cjs.map +1 -1
- package/cjs/components/Stepper/Stepper.cjs.map +1 -1
- package/cjs/components/Stepper/Stepper.context.cjs.map +1 -1
- 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.map +1 -1
- package/cjs/components/Table/Table.components.cjs.map +1 -1
- package/cjs/components/Table/Table.context.cjs.map +1 -1
- package/cjs/components/Table/TableDataRenderer.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 +16 -1
- package/cjs/components/Tabs/Tabs.cjs.map +1 -1
- package/cjs/components/Tabs/Tabs.context.cjs.map +1 -1
- package/cjs/components/Tabs/TabsList/TabsList.cjs.map +1 -1
- package/cjs/components/Tabs/TabsPanel/TabsPanel.cjs +6 -0
- package/cjs/components/Tabs/TabsPanel/TabsPanel.cjs.map +1 -1
- package/cjs/components/Tabs/TabsTab/TabsTab.cjs +1 -1
- package/cjs/components/Tabs/TabsTab/TabsTab.cjs.map +1 -1
- package/cjs/components/TagsInput/TagsInput.cjs +4 -1
- package/cjs/components/TagsInput/TagsInput.cjs.map +1 -1
- package/cjs/components/TagsInput/filter-picked-tags.cjs.map +1 -1
- package/cjs/components/TagsInput/get-splitted-tags.cjs.map +1 -1
- package/cjs/components/Text/Text.cjs.map +1 -1
- package/cjs/components/TextInput/TextInput.cjs.map +1 -1
- package/cjs/components/Textarea/Autosize.cjs +1 -0
- package/cjs/components/Textarea/Autosize.cjs.map +1 -1
- package/cjs/components/Textarea/Textarea.cjs.map +1 -1
- package/cjs/components/ThemeIcon/ThemeIcon.cjs.map +1 -1
- package/cjs/components/Timeline/Timeline.cjs.map +1 -1
- package/cjs/components/Timeline/Timeline.context.cjs.map +1 -1
- package/cjs/components/Timeline/TimelineItem/TimelineItem.cjs.map +1 -1
- package/cjs/components/Title/Title.cjs.map +1 -1
- package/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
- package/cjs/components/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/get-transition-styles/get-transition-styles.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.map +1 -1
- package/cjs/components/Tree/TreeNode.cjs.map +1 -1
- package/cjs/components/Tree/filter-tree-data/filter-tree-data.cjs.map +1 -1
- package/cjs/components/Tree/is-node-checked/is-node-checked.cjs.map +1 -1
- package/cjs/components/Tree/is-node-indeterminate/is-node-indeterminate.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 +7 -1
- package/cjs/components/TreeSelect/TreeSelect.cjs.map +1 -1
- package/cjs/components/TreeSelect/TreeSelectOption.cjs.map +1 -1
- package/cjs/components/TreeSelect/get-checked-values-by-strategy.cjs.map +1 -1
- package/cjs/components/Typography/Typography.cjs.map +1 -1
- package/cjs/components/UnstyledButton/UnstyledButton.cjs.map +1 -1
- package/cjs/components/VisuallyHidden/VisuallyHidden.cjs.map +1 -1
- package/cjs/core/Box/Box.cjs.map +1 -1
- package/cjs/core/Box/get-box-mod/get-box-mod.cjs.map +1 -1
- package/cjs/core/Box/get-box-style/get-box-style.cjs.map +1 -1
- package/cjs/core/Box/get-style-object/get-style-object.cjs.map +1 -1
- package/cjs/core/Box/style-props/parse-style-props/parse-style-props.cjs.map +1 -1
- package/cjs/core/Box/style-props/parse-style-props/sort-media-queries.cjs.map +1 -1
- package/cjs/core/Box/style-props/resolvers/border-resolver/border-resolver.cjs.map +1 -1
- package/cjs/core/Box/use-random-classname/use-random-classname.cjs.map +1 -1
- package/cjs/core/DirectionProvider/DirectionProvider.cjs.map +1 -1
- package/cjs/core/InlineStyles/InlineStyles.cjs.map +1 -1
- package/cjs/core/InlineStyles/css-object-to-string/css-object-to-string.cjs.map +1 -1
- package/cjs/core/InlineStyles/hash-styles.cjs.map +1 -1
- package/cjs/core/MantineProvider/ColorSchemeScript/ColorSchemeScript.cjs.map +1 -1
- package/cjs/core/MantineProvider/Mantine.context.cjs.map +1 -1
- package/cjs/core/MantineProvider/MantineClasses/MantineClasses.cjs.map +1 -1
- package/cjs/core/MantineProvider/MantineCssVariables/MantineCssVariables.cjs.map +1 -1
- package/cjs/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.cjs +5 -1
- package/cjs/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.cjs.map +1 -1
- package/cjs/core/MantineProvider/MantineCssVariables/get-css-color-variables.cjs.map +1 -1
- package/cjs/core/MantineProvider/MantineCssVariables/remove-default-variables.cjs.map +1 -1
- package/cjs/core/MantineProvider/MantineCssVariables/v8-css-variables-resolver.cjs +3 -1
- package/cjs/core/MantineProvider/MantineCssVariables/v8-css-variables-resolver.cjs.map +1 -1
- package/cjs/core/MantineProvider/MantineCssVariables/virtual-color/virtual-color.cjs.map +1 -1
- 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/colors-tuple/colors-tuple.cjs.map +1 -1
- package/cjs/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.cjs +3 -1
- package/cjs/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.cjs.map +1 -1
- package/cjs/core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.cjs +19 -3
- package/cjs/core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.cjs.map +1 -1
- package/cjs/core/MantineProvider/color-functions/parse-theme-color/parse-theme-color.cjs.map +1 -1
- package/cjs/core/MantineProvider/color-functions/to-rgba/to-rgba.cjs.map +1 -1
- package/cjs/core/MantineProvider/convert-css-variables/convert-css-variables.cjs.map +1 -1
- package/cjs/core/MantineProvider/convert-css-variables/css-variables-object-to-string.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.map +1 -1
- package/cjs/core/MantineProvider/use-mantine-color-scheme/use-provider-color-scheme.cjs.map +1 -1
- package/cjs/core/MantineProvider/use-props/use-props.cjs.map +1 -1
- package/cjs/core/MantineProvider/use-respect-reduce-motion/use-respect-reduce-motion.cjs.map +1 -1
- package/cjs/core/factory/factory.cjs.map +1 -1
- package/cjs/core/factory/polymorphic-factory.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/get-options-class-names/get-options-class-names.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-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/styles-api/use-styles/get-style/get-style.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/get-style/resolve-vars/merge-vars.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/use-styles.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/use-transformed-styles.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 +3 -5
- package/cjs/core/utils/create-scoped-keydown-handler/create-scoped-keydown-handler.cjs.map +1 -1
- package/cjs/core/utils/create-use-external-events/create-use-external-events.cjs.map +1 -1
- package/cjs/core/utils/deep-merge/deep-merge.cjs.map +1 -1
- package/cjs/core/utils/filter-props/filter-props.cjs.map +1 -1
- package/cjs/core/utils/get-context-item-index/get-context-item-index.cjs.map +1 -1
- package/cjs/core/utils/get-safe-id/get-safe-id.cjs.map +1 -1
- package/cjs/core/utils/is-number-like/is-number-like.cjs.map +1 -1
- package/cjs/core/utils/units-converters/px.cjs.map +1 -1
- package/cjs/core/utils/units-converters/rem.cjs.map +1 -1
- package/cjs/core/utils/use-hovered/use-hovered.cjs.map +1 -1
- package/cjs/index.cjs +42 -2
- package/cjs/utils/Floating/FloatingArrow/FloatingArrow.cjs +1 -0
- package/cjs/utils/Floating/FloatingArrow/FloatingArrow.cjs.map +1 -1
- 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 +1 -0
- package/esm/components/Accordion/Accordion.mjs.map +1 -1
- package/esm/components/ActionIcon/ActionIcon.mjs +1 -0
- package/esm/components/ActionIcon/ActionIcon.mjs.map +1 -1
- package/esm/components/ActionIcon/ActionIconGroup/ActionIconGroup.mjs +1 -1
- package/esm/components/ActionIcon/ActionIconGroup/ActionIconGroup.mjs.map +1 -1
- package/esm/components/ActionIcon/ActionIconGroupSection/ActionIconGroupSection.mjs.map +1 -1
- package/esm/components/AppShell/AppShellFooter/AppShellFooter.mjs.map +1 -1
- package/esm/components/AppShell/AppShellHeader/AppShellHeader.mjs.map +1 -1
- package/esm/components/AppShell/AppShellMain/AppShellMain.mjs.map +1 -1
- package/esm/components/AppShell/AppShellMediaStyles/assign-aside-variables/assign-aside-variables.mjs.map +1 -1
- package/esm/components/AppShell/AppShellMediaStyles/assign-footer-variables/assign-footer-variables.mjs.map +1 -1
- package/esm/components/AppShell/AppShellMediaStyles/assign-header-variables/assign-header-variables.mjs.map +1 -1
- package/esm/components/AppShell/AppShellMediaStyles/assign-navbar-variables/assign-navbar-variables.mjs.map +1 -1
- package/esm/components/AppShell/AppShellMediaStyles/assign-padding-variables/assign-padding-variables.mjs.map +1 -1
- package/esm/components/AppShell/AppShellMediaStyles/get-variables/get-variables.mjs.map +1 -1
- package/esm/components/AppShell/AppShellMediaStyles/is-primitive-size/is-primitive-size.mjs.map +1 -1
- package/esm/components/AppShell/AppShellMediaStyles/is-responsive-size/is-responsive-size.mjs.map +1 -1
- package/esm/components/AspectRatio/AspectRatio.mjs.map +1 -1
- package/esm/components/Autocomplete/Autocomplete.mjs.map +1 -1
- package/esm/components/Avatar/AvatarGroup/AvatarGroup.mjs.map +1 -1
- package/esm/components/Avatar/get-initials/get-initials.mjs.map +1 -1
- package/esm/components/BackgroundImage/BackgroundImage.mjs.map +1 -1
- package/esm/components/Blockquote/Blockquote.mjs.map +1 -1
- package/esm/components/Breadcrumbs/Breadcrumbs.mjs.map +1 -1
- package/esm/components/Button/ButtonGroup/ButtonGroup.mjs.map +1 -1
- package/esm/components/Button/ButtonGroupSection/ButtonGroupSection.mjs.map +1 -1
- package/esm/components/Checkbox/Checkbox.mjs.map +1 -1
- package/esm/components/Collapse/Collapse.mjs +4 -0
- package/esm/components/Collapse/Collapse.mjs.map +1 -1
- package/esm/components/ColorInput/ColorInput.mjs.map +1 -1
- package/esm/components/ColorPicker/ColorSlider/ColorSlider.mjs.map +1 -1
- package/esm/components/ColorPicker/converters/converters.mjs.map +1 -1
- package/esm/components/ColorPicker/converters/parsers.mjs.map +1 -1
- package/esm/components/Combobox/ComboboxEmpty/ComboboxEmpty.mjs.map +1 -1
- package/esm/components/Combobox/ComboboxFooter/ComboboxFooter.mjs.map +1 -1
- package/esm/components/Combobox/ComboboxGroup/ComboboxGroup.mjs +3 -2
- package/esm/components/Combobox/ComboboxGroup/ComboboxGroup.mjs.map +1 -1
- package/esm/components/Combobox/ComboboxHeader/ComboboxHeader.mjs.map +1 -1
- package/esm/components/Combobox/OptionsDropdown/OptionsDropdown.mjs +2 -2
- 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/use-combobox.mjs.map +1 -1
- package/esm/components/Combobox/use-pills-reorder/use-pills-reorder.mjs.map +1 -1
- package/esm/components/ComboboxPopover/ComboboxPopover.mjs +216 -0
- package/esm/components/ComboboxPopover/ComboboxPopover.mjs.map +1 -0
- package/esm/components/ComboboxPopover/ComboboxPopoverTarget.mjs +45 -0
- package/esm/components/ComboboxPopover/ComboboxPopoverTarget.mjs.map +1 -0
- package/esm/components/DataList/DataList.context.mjs +8 -0
- package/esm/components/DataList/DataList.context.mjs.map +1 -0
- package/esm/components/DataList/DataList.mjs +61 -0
- package/esm/components/DataList/DataList.mjs.map +1 -0
- package/esm/components/DataList/DataList.module.mjs +12 -0
- package/esm/components/DataList/DataList.module.mjs.map +1 -0
- package/esm/components/DataList/DataListItem/DataListItem.mjs +32 -0
- package/esm/components/DataList/DataListItem/DataListItem.mjs.map +1 -0
- package/esm/components/DataList/DataListItemLabel/DataListItemLabel.mjs +33 -0
- package/esm/components/DataList/DataListItemLabel/DataListItemLabel.mjs.map +1 -0
- package/esm/components/DataList/DataListItemValue/DataListItemValue.mjs +33 -0
- package/esm/components/DataList/DataListItemValue/DataListItemValue.mjs.map +1 -0
- package/esm/components/Drawer/DrawerBody.mjs.map +1 -1
- package/esm/components/Drawer/DrawerCloseButton.mjs.map +1 -1
- package/esm/components/Drawer/DrawerHeader.mjs.map +1 -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.map +1 -1
- package/esm/components/EmptyState/EmptyState.context.mjs +8 -0
- package/esm/components/EmptyState/EmptyState.context.mjs.map +1 -0
- package/esm/components/EmptyState/EmptyState.mjs +102 -0
- package/esm/components/EmptyState/EmptyState.mjs.map +1 -0
- package/esm/components/EmptyState/EmptyState.module.mjs +14 -0
- package/esm/components/EmptyState/EmptyState.module.mjs.map +1 -0
- package/esm/components/EmptyState/EmptyStateActions/EmptyStateActions.mjs +28 -0
- package/esm/components/EmptyState/EmptyStateActions/EmptyStateActions.mjs.map +1 -0
- package/esm/components/EmptyState/EmptyStateDescription/EmptyStateDescription.mjs +29 -0
- package/esm/components/EmptyState/EmptyStateDescription/EmptyStateDescription.mjs.map +1 -0
- package/esm/components/EmptyState/EmptyStateIndicator/EmptyStateIndicator.mjs +29 -0
- package/esm/components/EmptyState/EmptyStateIndicator/EmptyStateIndicator.mjs.map +1 -0
- package/esm/components/EmptyState/EmptyStateTitle/EmptyStateTitle.mjs +30 -0
- package/esm/components/EmptyState/EmptyStateTitle/EmptyStateTitle.mjs.map +1 -0
- package/esm/components/FileInput/FileInput.mjs.map +1 -1
- package/esm/components/Grid/GridCol/GridColVariables.mjs.map +1 -1
- package/esm/components/Grid/GridVariables.mjs.map +1 -1
- package/esm/components/Group/Group.mjs.map +1 -1
- package/esm/components/Group/filter-falsy-children/filter-falsy-children.mjs.map +1 -1
- package/esm/components/Highlight/highlighter/highlighter.mjs.map +1 -1
- package/esm/components/HoverCard/HoverCardDropdown/HoverCardDropdown.mjs.map +1 -1
- package/esm/components/HoverCard/use-hover-card.mjs.map +1 -1
- package/esm/components/Input/Input.mjs +7 -2
- package/esm/components/Input/Input.mjs.map +1 -1
- package/esm/components/Input/Input.module.mjs +1 -0
- package/esm/components/Input/Input.module.mjs.map +1 -1
- package/esm/components/Input/InputDescription/InputDescription.mjs.map +1 -1
- package/esm/components/Input/InputError/InputError.mjs.map +1 -1
- package/esm/components/Input/InputPlaceholder/InputPlaceholder.mjs.map +1 -1
- package/esm/components/Input/InputSuccess/InputSuccess.mjs +48 -0
- package/esm/components/Input/InputSuccess/InputSuccess.mjs.map +1 -0
- package/esm/components/Input/InputWrapper/InputWrapper.mjs +22 -5
- package/esm/components/Input/InputWrapper/InputWrapper.mjs.map +1 -1
- package/esm/components/Input/use-input-props.mjs +4 -1
- package/esm/components/Input/use-input-props.mjs.map +1 -1
- package/esm/components/JsonInput/validate-json/validate-json.mjs.map +1 -1
- package/esm/components/Kbd/Kbd.mjs.map +1 -1
- package/esm/components/Mark/Mark.mjs.map +1 -1
- package/esm/components/Marquee/Marquee.mjs.map +1 -1
- package/esm/components/Menu/MenuDivider/MenuDivider.mjs.map +1 -1
- package/esm/components/Menu/MenuDropdown/MenuDropdown.mjs +1 -0
- 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.map +1 -1
- package/esm/components/Menu/MenuSearch/MenuSearch.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/use-menu-type-ahead.mjs.map +1 -1
- package/esm/components/Menubar/Menubar.context.mjs +9 -0
- package/esm/components/Menubar/Menubar.context.mjs.map +1 -0
- package/esm/components/Menubar/Menubar.mjs +146 -0
- package/esm/components/Menubar/Menubar.mjs.map +1 -0
- package/esm/components/Menubar/Menubar.module.mjs +10 -0
- package/esm/components/Menubar/Menubar.module.mjs.map +1 -0
- package/esm/components/Menubar/MenubarDropdown/MenubarDropdown.mjs +61 -0
- package/esm/components/Menubar/MenubarDropdown/MenubarDropdown.mjs.map +1 -0
- package/esm/components/Menubar/MenubarMenu/MenubarMenu.mjs +59 -0
- package/esm/components/Menubar/MenubarMenu/MenubarMenu.mjs.map +1 -0
- package/esm/components/Menubar/MenubarTarget/MenubarTarget.mjs +143 -0
- package/esm/components/Menubar/MenubarTarget/MenubarTarget.mjs.map +1 -0
- package/esm/components/Modal/ModalBody.mjs.map +1 -1
- package/esm/components/Modal/ModalCloseButton.mjs.map +1 -1
- package/esm/components/Modal/ModalHeader.mjs.map +1 -1
- package/esm/components/Modal/ModalOverlay.mjs.map +1 -1
- package/esm/components/Modal/ModalTitle.mjs.map +1 -1
- package/esm/components/ModalBase/ModalBase.mjs.map +1 -1
- package/esm/components/MultiSelect/MultiSelect.mjs +4 -1
- package/esm/components/MultiSelect/MultiSelect.mjs.map +1 -1
- package/esm/components/MultiSelect/filter-picked-values.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/NumberInput/NumberInput.mjs.map +1 -1
- package/esm/components/OverflowList/OverflowList.mjs.map +1 -1
- package/esm/components/OverflowList/get-row-position-data.mjs.map +1 -1
- package/esm/components/OverflowList/use-dimensions.mjs.map +1 -1
- package/esm/components/Overlay/Overlay.mjs.map +1 -1
- package/esm/components/Pagination/Pagination.mjs.map +1 -1
- package/esm/components/Pagination/PaginationDots/PaginationDots.mjs.map +1 -1
- package/esm/components/Pagination/PaginationItems/PaginationItems.mjs.map +1 -1
- package/esm/components/PasswordInput/PasswordInput.mjs +11 -2
- package/esm/components/PasswordInput/PasswordInput.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 +2 -1
- package/esm/components/PinInput/PinInput.mjs.map +1 -1
- package/esm/components/PinInput/create-pin-array/create-pin-array.mjs.map +1 -1
- package/esm/components/Popover/use-popover.mjs.map +1 -1
- package/esm/components/Portal/Portal.mjs.map +1 -1
- package/esm/components/Progress/ProgressLabel/ProgressLabel.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/Rating/Rating.mjs.map +1 -1
- package/esm/components/Rating/RatingItem/RatingItem.mjs.map +1 -1
- package/esm/components/Rating/StarSymbol/StarSymbol.mjs.map +1 -1
- package/esm/components/RingProgress/RingProgress.mjs.map +1 -1
- package/esm/components/RingProgress/get-curves/get-curves.mjs.map +1 -1
- package/esm/components/RollingNumber/get-digit-parts.mjs +2 -1
- package/esm/components/RollingNumber/get-digit-parts.mjs.map +1 -1
- package/esm/components/RollingNumber/get-render-slots.mjs.map +1 -1
- package/esm/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.mjs +1 -0
- package/esm/components/ScrollArea/ScrollAreaViewport/ScrollAreaViewport.mjs.map +1 -1
- package/esm/components/ScrollArea/utils/add-unlinked-scroll-listener.mjs.map +1 -1
- package/esm/components/ScrollArea/utils/get-scroll-position-from-pointer.mjs.map +1 -1
- package/esm/components/ScrollArea/utils/get-thumb-offset-from-scroll.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 +4 -1
- package/esm/components/SemiCircleProgress/SemiCircleProgress.mjs.map +1 -1
- package/esm/components/SemiCircleProgress/SemiCircleProgress.module.mjs.map +1 -1
- package/esm/components/SimpleGrid/SimpleGridVariables.mjs.map +1 -1
- package/esm/components/Skeleton/Skeleton.mjs.map +1 -1
- package/esm/components/Slider/RangeSlider/RangeSlider.mjs.map +1 -1
- package/esm/components/Slider/Slider.module.mjs.map +1 -1
- package/esm/components/Slider/utils/get-precision/get-precision.mjs.map +1 -1
- package/esm/components/Slider/utils/get-step-mark-value/get-step-mark-value.mjs.map +1 -1
- package/esm/components/Splitter/Splitter.context.mjs.map +1 -1
- package/esm/components/Splitter/Splitter.mjs +22 -1
- package/esm/components/Splitter/Splitter.mjs.map +1 -1
- package/esm/components/Splitter/SplitterPane/SplitterPane.mjs +1 -2
- package/esm/components/Splitter/SplitterPane/SplitterPane.mjs.map +1 -1
- package/esm/components/Stack/Stack.mjs.map +1 -1
- package/esm/components/Stepper/Stepper.mjs.map +1 -1
- package/esm/components/Switch/Switch.mjs.map +1 -1
- package/esm/components/Table/Table.components.mjs.map +1 -1
- package/esm/components/TableOfContents/TableOfContents.mjs.map +1 -1
- package/esm/components/Tabs/Tabs.context.mjs.map +1 -1
- package/esm/components/Tabs/Tabs.mjs +18 -3
- package/esm/components/Tabs/Tabs.mjs.map +1 -1
- package/esm/components/Tabs/TabsPanel/TabsPanel.mjs +7 -1
- package/esm/components/Tabs/TabsPanel/TabsPanel.mjs.map +1 -1
- package/esm/components/Tabs/TabsTab/TabsTab.mjs +1 -1
- package/esm/components/Tabs/TabsTab/TabsTab.mjs.map +1 -1
- package/esm/components/TagsInput/TagsInput.mjs +4 -1
- package/esm/components/TagsInput/TagsInput.mjs.map +1 -1
- package/esm/components/TagsInput/filter-picked-tags.mjs.map +1 -1
- package/esm/components/TagsInput/get-splitted-tags.mjs.map +1 -1
- package/esm/components/Text/Text.mjs.map +1 -1
- package/esm/components/Textarea/Autosize.mjs +1 -0
- package/esm/components/Textarea/Autosize.mjs.map +1 -1
- package/esm/components/ThemeIcon/ThemeIcon.mjs.map +1 -1
- package/esm/components/Title/Title.mjs.map +1 -1
- package/esm/components/Tooltip/Tooltip.mjs.map +1 -1
- package/esm/components/Tooltip/use-tooltip.mjs.map +1 -1
- package/esm/components/Transition/get-transition-styles/get-transition-styles.mjs.map +1 -1
- package/esm/components/Tree/FlatTreeNode.mjs.map +1 -1
- package/esm/components/Tree/TreeNode.mjs.map +1 -1
- package/esm/components/Tree/filter-tree-data/filter-tree-data.mjs.map +1 -1
- package/esm/components/Tree/is-node-checked/is-node-checked.mjs.map +1 -1
- package/esm/components/Tree/is-node-indeterminate/is-node-indeterminate.mjs.map +1 -1
- package/esm/components/Tree/use-tree.mjs.map +1 -1
- package/esm/components/TreeSelect/TreeSelect.mjs +7 -1
- package/esm/components/TreeSelect/TreeSelect.mjs.map +1 -1
- package/esm/components/TreeSelect/get-checked-values-by-strategy.mjs.map +1 -1
- package/esm/components/Typography/Typography.mjs.map +1 -1
- package/esm/components/UnstyledButton/UnstyledButton.mjs.map +1 -1
- package/esm/components/VisuallyHidden/VisuallyHidden.mjs.map +1 -1
- package/esm/core/Box/Box.mjs.map +1 -1
- package/esm/core/Box/get-box-mod/get-box-mod.mjs.map +1 -1
- package/esm/core/Box/get-box-style/get-box-style.mjs.map +1 -1
- package/esm/core/Box/get-style-object/get-style-object.mjs.map +1 -1
- package/esm/core/Box/style-props/parse-style-props/parse-style-props.mjs.map +1 -1
- package/esm/core/Box/style-props/parse-style-props/sort-media-queries.mjs.map +1 -1
- package/esm/core/Box/style-props/resolvers/border-resolver/border-resolver.mjs.map +1 -1
- package/esm/core/Box/use-random-classname/use-random-classname.mjs.map +1 -1
- package/esm/core/InlineStyles/InlineStyles.mjs.map +1 -1
- package/esm/core/InlineStyles/css-object-to-string/css-object-to-string.mjs.map +1 -1
- package/esm/core/InlineStyles/hash-styles.mjs.map +1 -1
- package/esm/core/MantineProvider/ColorSchemeScript/ColorSchemeScript.mjs.map +1 -1
- package/esm/core/MantineProvider/Mantine.context.mjs.map +1 -1
- package/esm/core/MantineProvider/MantineClasses/MantineClasses.mjs.map +1 -1
- package/esm/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.mjs +6 -2
- package/esm/core/MantineProvider/MantineCssVariables/default-css-variables-resolver.mjs.map +1 -1
- package/esm/core/MantineProvider/MantineCssVariables/get-css-color-variables.mjs.map +1 -1
- package/esm/core/MantineProvider/MantineCssVariables/remove-default-variables.mjs.map +1 -1
- package/esm/core/MantineProvider/MantineCssVariables/v8-css-variables-resolver.mjs +3 -1
- package/esm/core/MantineProvider/MantineCssVariables/v8-css-variables-resolver.mjs.map +1 -1
- package/esm/core/MantineProvider/MantineCssVariables/virtual-color/virtual-color.mjs.map +1 -1
- package/esm/core/MantineProvider/color-functions/colors-tuple/colors-tuple.mjs.map +1 -1
- package/esm/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.mjs +3 -1
- package/esm/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.mjs.map +1 -1
- package/esm/core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.mjs +19 -4
- package/esm/core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.mjs.map +1 -1
- package/esm/core/MantineProvider/color-functions/parse-theme-color/parse-theme-color.mjs.map +1 -1
- package/esm/core/MantineProvider/color-functions/to-rgba/to-rgba.mjs.map +1 -1
- package/esm/core/MantineProvider/convert-css-variables/convert-css-variables.mjs.map +1 -1
- package/esm/core/MantineProvider/convert-css-variables/css-variables-object-to-string.mjs.map +1 -1
- package/esm/core/MantineProvider/use-mantine-color-scheme/use-mantine-color-scheme.mjs.map +1 -1
- package/esm/core/MantineProvider/use-mantine-color-scheme/use-provider-color-scheme.mjs.map +1 -1
- package/esm/core/MantineProvider/use-props/use-props.mjs.map +1 -1
- package/esm/core/MantineProvider/use-respect-reduce-motion/use-respect-reduce-motion.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/get-class-name/resolve-class-names/resolve-class-names.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/get-style/get-style.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/get-style/resolve-vars/merge-vars.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/use-styles.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/use-transformed-styles.mjs.map +1 -1
- package/esm/core/utils/create-scoped-keydown-handler/create-scoped-keydown-handler.mjs +3 -5
- package/esm/core/utils/create-scoped-keydown-handler/create-scoped-keydown-handler.mjs.map +1 -1
- package/esm/core/utils/create-use-external-events/create-use-external-events.mjs.map +1 -1
- package/esm/core/utils/deep-merge/deep-merge.mjs.map +1 -1
- package/esm/core/utils/filter-props/filter-props.mjs.map +1 -1
- package/esm/core/utils/get-context-item-index/get-context-item-index.mjs.map +1 -1
- package/esm/core/utils/get-safe-id/get-safe-id.mjs.map +1 -1
- package/esm/core/utils/is-number-like/is-number-like.mjs.map +1 -1
- package/esm/core/utils/units-converters/px.mjs.map +1 -1
- package/esm/core/utils/units-converters/rem.mjs.map +1 -1
- package/esm/index.mjs +23 -4
- package/esm/utils/Floating/FloatingArrow/FloatingArrow.mjs +1 -0
- package/esm/utils/Floating/FloatingArrow/FloatingArrow.mjs.map +1 -1
- package/lib/components/Accordion/Accordion.d.ts +4 -4
- package/lib/components/ActionIcon/ActionIcon.d.ts +3 -3
- package/lib/components/Combobox/Combobox.types.d.ts +4 -3
- package/lib/components/Combobox/OptionsDropdown/OptionsDropdown.d.ts +1 -1
- package/lib/components/Combobox/index.d.ts +1 -1
- package/lib/components/ComboboxPopover/ComboboxPopover.d.ts +110 -0
- package/lib/components/ComboboxPopover/ComboboxPopover.types.d.ts +2 -0
- package/lib/components/ComboboxPopover/ComboboxPopoverTarget.d.ts +16 -0
- package/lib/components/ComboboxPopover/index.d.ts +14 -0
- package/lib/components/DataList/DataList.context.d.ts +6 -0
- package/lib/components/DataList/DataList.d.ts +44 -0
- package/lib/components/DataList/DataListItem/DataListItem.d.ts +18 -0
- package/lib/components/DataList/DataListItemLabel/DataListItemLabel.d.ts +18 -0
- package/lib/components/DataList/DataListItemValue/DataListItemValue.d.ts +18 -0
- package/lib/components/DataList/index.d.ts +32 -0
- package/lib/components/EmptyState/EmptyState.context.d.ts +8 -0
- package/lib/components/EmptyState/EmptyState.d.ts +83 -0
- package/lib/components/EmptyState/EmptyStateActions/EmptyStateActions.d.ts +18 -0
- package/lib/components/EmptyState/EmptyStateDescription/EmptyStateDescription.d.ts +18 -0
- package/lib/components/EmptyState/EmptyStateIndicator/EmptyStateIndicator.d.ts +18 -0
- package/lib/components/EmptyState/EmptyStateTitle/EmptyStateTitle.d.ts +20 -0
- package/lib/components/EmptyState/index.d.ts +13 -0
- package/lib/components/Input/Input.d.ts +11 -0
- package/lib/components/Input/InputSuccess/InputSuccess.d.ts +23 -0
- package/lib/components/Input/InputWrapper/InputWrapper.d.ts +7 -2
- package/lib/components/Input/index.d.ts +3 -1
- package/lib/components/Input/use-input-props.d.ts +5 -2
- package/lib/components/MaskInput/use-mask-input-props.d.ts +5 -1
- package/lib/components/Menubar/Menubar.context.d.ts +51 -0
- package/lib/components/Menubar/Menubar.d.ts +56 -0
- package/lib/components/Menubar/MenubarDropdown/MenubarDropdown.d.ts +7 -0
- package/lib/components/Menubar/MenubarMenu/MenubarMenu.d.ts +9 -0
- package/lib/components/Menubar/MenubarTarget/MenubarTarget.d.ts +14 -0
- package/lib/components/Menubar/index.d.ts +11 -0
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/NativeSelect/NativeSelect.d.ts +2 -2
- package/lib/components/PinInput/PinInput.d.ts +2 -0
- package/lib/components/Splitter/Splitter.context.d.ts +3 -1
- package/lib/components/Splitter/Splitter.d.ts +10 -10
- package/lib/components/Splitter/SplitterPane/SplitterPane.d.ts +9 -8
- package/lib/components/Tabs/Tabs.context.d.ts +2 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/core/MantineProvider/color-functions/get-contrast-color/get-contrast-color.d.ts +7 -2
- package/lib/core/MantineProvider/color-functions/index.d.ts +1 -1
- package/package.json +5 -5
- package/styles/DataList.css +54 -0
- package/styles/DataList.layer.css +55 -0
- package/styles/EmptyState.css +121 -0
- package/styles/EmptyState.layer.css +122 -0
- package/styles/Input.css +21 -2
- package/styles/Input.layer.css +21 -2
- package/styles/Menubar.css +29 -0
- package/styles/Menubar.layer.css +30 -0
- package/styles/SemiCircleProgress.css +1 -0
- package/styles/SemiCircleProgress.layer.css +1 -0
- package/styles/Slider.css +4 -0
- package/styles/Slider.layer.css +4 -0
- package/styles/default-css-variables.css +2 -0
- package/styles/default-css-variables.layer.css +2 -0
- package/styles.css +235 -2
- package/styles.layer.css +235 -2
|
@@ -11,6 +11,7 @@ import Input_module_default from "../Input.module.mjs";
|
|
|
11
11
|
import { InputDescription } from "../InputDescription/InputDescription.mjs";
|
|
12
12
|
import { InputError } from "../InputError/InputError.mjs";
|
|
13
13
|
import { InputLabel } from "../InputLabel/InputLabel.mjs";
|
|
14
|
+
import { InputSuccess } from "../InputSuccess/InputSuccess.mjs";
|
|
14
15
|
import { getInputOffsets } from "./get-input-offsets/get-input-offsets.mjs";
|
|
15
16
|
import { Fragment, createElement } from "react";
|
|
16
17
|
import { useId as useId$1 } from "@mantine/hooks";
|
|
@@ -32,11 +33,12 @@ const varsResolver = createVarsResolver((_, { size }) => ({
|
|
|
32
33
|
"--input-asterisk-color": void 0
|
|
33
34
|
},
|
|
34
35
|
error: { "--input-error-size": size === void 0 ? void 0 : `calc(${getFontSize(size)} - ${rem(2)})` },
|
|
36
|
+
success: { "--input-success-size": size === void 0 ? void 0 : `calc(${getFontSize(size)} - ${rem(2)})` },
|
|
35
37
|
description: { "--input-description-size": size === void 0 ? void 0 : `calc(${getFontSize(size)} - ${rem(2)})` }
|
|
36
38
|
}));
|
|
37
39
|
const InputWrapper = factory((_props) => {
|
|
38
40
|
const props = useProps("InputWrapper", defaultProps, _props);
|
|
39
|
-
const { classNames, className, style, styles, unstyled, vars, size, variant, __staticSelector, inputContainer, inputWrapperOrder, label, error, description, labelProps, descriptionProps, errorProps, labelElement, children, withAsterisk, id, required, __stylesApiProps, mod, attributes, ...others } = props;
|
|
41
|
+
const { classNames, className, style, styles, unstyled, vars, size, variant, __staticSelector, inputContainer, inputWrapperOrder, label, error, success, description, labelProps, descriptionProps, errorProps, successProps, labelElement, children, withAsterisk, id, required, __stylesApiProps, mod, attributes, ...others } = props;
|
|
40
42
|
const getStyles = useStyles({
|
|
41
43
|
name: ["InputWrapper", __staticSelector],
|
|
42
44
|
props: __stylesApiProps || props,
|
|
@@ -58,11 +60,16 @@ const InputWrapper = factory((_props) => {
|
|
|
58
60
|
const idBase = useId$1(id);
|
|
59
61
|
const isRequired = typeof withAsterisk === "boolean" ? withAsterisk : required;
|
|
60
62
|
const errorId = errorProps?.id || `${idBase}-error`;
|
|
63
|
+
const successId = successProps?.id || `${idBase}-success`;
|
|
61
64
|
const descriptionId = descriptionProps?.id || `${idBase}-description`;
|
|
62
65
|
const inputId = idBase;
|
|
63
66
|
const hasError = !!error && typeof error !== "boolean";
|
|
67
|
+
const hasSuccess = !!success && typeof success !== "boolean" && !error;
|
|
64
68
|
const hasDescription = !!description;
|
|
65
|
-
const
|
|
69
|
+
const errorRendered = hasError && inputWrapperOrder.includes("error");
|
|
70
|
+
const successRendered = hasSuccess && inputWrapperOrder.includes("error");
|
|
71
|
+
const descriptionRendered = hasDescription && inputWrapperOrder.includes("description");
|
|
72
|
+
const _describedBy = `${errorRendered ? errorId : ""} ${successRendered ? successId : ""} ${descriptionRendered ? descriptionId : ""}`;
|
|
66
73
|
const describedBy = _describedBy.trim().length > 0 ? _describedBy.trim() : void 0;
|
|
67
74
|
const labelId = labelProps?.id || `${idBase}-label`;
|
|
68
75
|
const _label = label && /* @__PURE__ */ jsx(InputLabel, {
|
|
@@ -89,12 +96,19 @@ const InputWrapper = factory((_props) => {
|
|
|
89
96
|
key: "error",
|
|
90
97
|
id: errorProps?.id || errorId
|
|
91
98
|
}, error);
|
|
99
|
+
const _success = hasSuccess && /* @__PURE__ */ createElement(InputSuccess, {
|
|
100
|
+
...successProps,
|
|
101
|
+
...sharedProps,
|
|
102
|
+
size: successProps?.size || sharedProps.size,
|
|
103
|
+
key: "success",
|
|
104
|
+
id: successProps?.id || successId
|
|
105
|
+
}, success);
|
|
92
106
|
const content = inputWrapperOrder.map((part) => {
|
|
93
107
|
switch (part) {
|
|
94
108
|
case "label": return _label;
|
|
95
109
|
case "input": return _input;
|
|
96
110
|
case "description": return _description;
|
|
97
|
-
case "error": return _error;
|
|
111
|
+
case "error": return _error || _success;
|
|
98
112
|
default: return null;
|
|
99
113
|
}
|
|
100
114
|
});
|
|
@@ -106,13 +120,16 @@ const InputWrapper = factory((_props) => {
|
|
|
106
120
|
labelId,
|
|
107
121
|
...getInputOffsets(inputWrapperOrder, {
|
|
108
122
|
hasDescription,
|
|
109
|
-
hasError
|
|
123
|
+
hasError: hasError || hasSuccess
|
|
110
124
|
})
|
|
111
125
|
},
|
|
112
126
|
children: /* @__PURE__ */ jsx(Box, {
|
|
113
127
|
variant,
|
|
114
128
|
size,
|
|
115
|
-
mod: [{
|
|
129
|
+
mod: [{
|
|
130
|
+
error: !!error,
|
|
131
|
+
success: !!success && !error
|
|
132
|
+
}, mod],
|
|
116
133
|
id: labelElement === "label" ? void 0 : id,
|
|
117
134
|
...getStyles("root"),
|
|
118
135
|
...others,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputWrapper.mjs","names":["useId","classes"],"sources":["../../../../src/components/Input/InputWrapper/InputWrapper.tsx"],"sourcesContent":["import { Fragment } from 'react';\nimport { useId } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getFontSize,\n MantineFontSize,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../../core';\nimport {\n InputDescription,\n InputDescriptionCssVariables,\n InputDescriptionProps,\n InputDescriptionStylesNames,\n} from '../InputDescription/InputDescription';\nimport {\n InputError,\n InputErrorCssVariables,\n InputErrorProps,\n InputErrorStylesNames,\n} from '../InputError/InputError';\nimport {\n InputLabel,\n InputLabelCssVariables,\n InputLabelProps,\n InputLabelStylesNames,\n} from '../InputLabel/InputLabel';\nimport { InputWrapperContext } from '../InputWrapper.context';\nimport { getInputOffsets } from './get-input-offsets/get-input-offsets';\nimport classes from '../Input.module.css';\n\nexport type InputWrapperCssVariables = InputLabelCssVariables &\n InputErrorCssVariables &\n InputDescriptionCssVariables;\n\nexport type InputWrapperStylesNames =\n | 'root'\n | InputLabelStylesNames\n | InputDescriptionStylesNames\n | InputErrorStylesNames;\n\nexport interface __InputWrapperProps {\n /** Contents of `Input.Label` component. If not set, label is not displayed. */\n label?: React.ReactNode;\n\n /** Contents of `Input.Description` component. If not set, description is not displayed. */\n description?: React.ReactNode;\n\n /** Contents of `Input.Error` component. If not set, error is not displayed. */\n error?: React.ReactNode;\n\n /** Adds required attribute to the input and a red asterisk on the right side of label @default false */\n required?: boolean;\n\n /** If set, the required asterisk is displayed next to the label. Overrides `required` prop. Does not add required attribute to the input. @default false */\n withAsterisk?: boolean;\n\n /** Props passed down to the `Input.Label` component */\n labelProps?: InputLabelProps & DataAttributes;\n\n /** Props passed down to the `Input.Description` component */\n descriptionProps?: InputDescriptionProps & DataAttributes;\n\n /** Props passed down to the `Input.Error` component */\n errorProps?: InputErrorProps & DataAttributes;\n\n /** Render function to wrap the input element. Useful for adding tooltips, popovers, or other wrappers around the input. @default React.Fragment */\n inputContainer?: (children: React.ReactNode) => React.ReactNode;\n\n /** Controls order and visibility of wrapper elements. Only elements included in this array will be rendered. @default ['label', 'description', 'input', 'error'] */\n inputWrapperOrder?: ('label' | 'input' | 'description' | 'error')[];\n}\n\nexport interface InputWrapperProps\n extends __InputWrapperProps, BoxProps, StylesApiProps<InputWrapperFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Props passed to Styles API context, replaces Input.Wrapper props */\n __stylesApiProps?: Record<string, any>;\n\n /** Static id used as base to generate `aria-` attributes, by default generates random id */\n id?: string;\n\n /** Controls size of `Input.Label`, `Input.Description` and `Input.Error` components */\n size?: MantineFontSize;\n\n /** Root element for the label. Use `'div'` when wrapper contains multiple input elements and you need to handle `htmlFor` manually. @default 'label' */\n labelElement?: 'label' | 'div';\n}\n\nexport type InputWrapperFactory = Factory<{\n props: InputWrapperProps;\n ref: HTMLDivElement;\n stylesNames: InputWrapperStylesNames;\n vars: InputWrapperCssVariables;\n}>;\n\nconst defaultProps = {\n labelElement: 'label',\n inputContainer: (children) => children,\n inputWrapperOrder: ['label', 'description', 'input', 'error'],\n} satisfies Partial<InputWrapperProps>;\n\nconst varsResolver = createVarsResolver<InputWrapperFactory>((_, { size }) => ({\n label: {\n '--input-label-size': getFontSize(size),\n '--input-asterisk-color': undefined,\n },\n\n error: {\n '--input-error-size': size === undefined ? undefined : `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n\n description: {\n '--input-description-size':\n size === undefined ? undefined : `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n}));\n\nexport const InputWrapper = factory<InputWrapperFactory>((_props) => {\n const props = useProps('InputWrapper', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n size,\n variant,\n __staticSelector,\n inputContainer,\n inputWrapperOrder,\n label,\n error,\n description,\n labelProps,\n descriptionProps,\n errorProps,\n labelElement,\n children,\n withAsterisk,\n id,\n required,\n __stylesApiProps,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<InputWrapperFactory>({\n name: ['InputWrapper', __staticSelector],\n props: __stylesApiProps || props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const sharedProps = {\n size,\n variant,\n __staticSelector,\n };\n\n const idBase = useId(id);\n const isRequired = typeof withAsterisk === 'boolean' ? withAsterisk : required;\n const errorId = errorProps?.id || `${idBase}-error`;\n const descriptionId = descriptionProps?.id || `${idBase}-description`;\n const inputId = idBase;\n const hasError = !!error && typeof error !== 'boolean';\n const hasDescription = !!description;\n const _describedBy = `${hasError ? errorId : ''} ${hasDescription ? descriptionId : ''}`;\n const describedBy = _describedBy.trim().length > 0 ? _describedBy.trim() : undefined;\n const labelId = labelProps?.id || `${idBase}-label`;\n\n const _label = label && (\n <InputLabel\n key=\"label\"\n labelElement={labelElement}\n id={labelId}\n htmlFor={inputId}\n required={isRequired}\n {...sharedProps}\n {...labelProps}\n >\n {label}\n </InputLabel>\n );\n\n const _description = hasDescription && (\n <InputDescription\n key=\"description\"\n {...descriptionProps}\n {...sharedProps}\n size={descriptionProps?.size || sharedProps.size}\n id={descriptionProps?.id || descriptionId}\n >\n {description}\n </InputDescription>\n );\n\n const _input = <Fragment key=\"input\">{inputContainer(children)}</Fragment>;\n\n const _error = hasError && (\n <InputError\n {...errorProps}\n {...sharedProps}\n size={errorProps?.size || sharedProps.size}\n key=\"error\"\n id={errorProps?.id || errorId}\n >\n {error}\n </InputError>\n );\n\n const content = inputWrapperOrder.map((part) => {\n switch (part) {\n case 'label':\n return _label;\n case 'input':\n return _input;\n case 'description':\n return _description;\n case 'error':\n return _error;\n default:\n return null;\n }\n });\n\n return (\n <InputWrapperContext\n value={{\n getStyles,\n describedBy,\n inputId,\n labelId,\n ...getInputOffsets(inputWrapperOrder, { hasDescription, hasError }),\n }}\n >\n <Box\n variant={variant}\n size={size}\n mod={[{ error: !!error }, mod]}\n id={labelElement === 'label' ? undefined : id}\n {...getStyles('root')}\n {...others}\n >\n {content}\n </Box>\n </InputWrapperContext>\n );\n});\n\nInputWrapper.classes = classes;\nInputWrapper.varsResolver = varsResolver;\nInputWrapper.displayName = '@mantine/core/InputWrapper';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyGA,MAAM,eAAe;CACnB,cAAc;CACd,iBAAiB,aAAa;CAC9B,mBAAmB;EAAC;EAAS;EAAe;EAAS;CAAO;AAC9D;AAEA,MAAM,eAAe,oBAAyC,GAAG,EAAE,YAAY;CAC7E,OAAO;EACL,sBAAsB,YAAY,IAAI;EACtC,0BAA0B,KAAA;CAC5B;CAEA,OAAO,EACL,sBAAsB,SAAS,KAAA,IAAY,KAAA,IAAY,QAAQ,YAAY,IAAI,EAAE,KAAK,IAAI,CAAC,EAAE,GAC/F;CAEA,aAAa,EACX,4BACE,SAAS,KAAA,IAAY,KAAA,IAAY,QAAQ,YAAY,IAAI,EAAE,KAAK,IAAI,CAAC,EAAE,GAC3E;AACF,EAAE;AAEF,MAAa,eAAe,SAA8B,WAAW;CACnE,MAAM,QAAQ,SAAS,gBAAgB,cAAc,MAAM;CAC3D,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,MACA,SACA,kBACA,gBACA,mBACA,OACA,OACA,aACA,YACA,kBACA,YACA,cACA,UACA,cACA,IACA,UACA,kBACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAA+B;EAC/C,MAAM,CAAC,gBAAgB,gBAAgB;EACvC,OAAO,oBAAoB;EAC3B,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,cAAc;EAClB;EACA;EACA;CACF;CAEA,MAAM,SAASA,QAAM,EAAE;CACvB,MAAM,aAAa,OAAO,iBAAiB,YAAY,eAAe;CACtE,MAAM,UAAU,YAAY,MAAM,GAAG,OAAO;CAC5C,MAAM,gBAAgB,kBAAkB,MAAM,GAAG,OAAO;CACxD,MAAM,UAAU;CAChB,MAAM,WA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,CAAC;AAED,aAAa,UAAUC;AACvB,aAAa,eAAe;AAC5B,aAAa,cAAc"}
|
|
1
|
+
{"version":3,"file":"InputWrapper.mjs","names":["useId","classes"],"sources":["../../../../src/components/Input/InputWrapper/InputWrapper.tsx"],"sourcesContent":["import { Fragment } from 'react';\nimport { useId } from '@mantine/hooks';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getFontSize,\n MantineFontSize,\n rem,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../../core';\nimport {\n InputDescription,\n InputDescriptionCssVariables,\n InputDescriptionProps,\n InputDescriptionStylesNames,\n} from '../InputDescription/InputDescription';\nimport {\n InputError,\n InputErrorCssVariables,\n InputErrorProps,\n InputErrorStylesNames,\n} from '../InputError/InputError';\nimport {\n InputLabel,\n InputLabelCssVariables,\n InputLabelProps,\n InputLabelStylesNames,\n} from '../InputLabel/InputLabel';\nimport {\n InputSuccess,\n InputSuccessCssVariables,\n InputSuccessProps,\n InputSuccessStylesNames,\n} from '../InputSuccess/InputSuccess';\nimport { InputWrapperContext } from '../InputWrapper.context';\nimport { getInputOffsets } from './get-input-offsets/get-input-offsets';\nimport classes from '../Input.module.css';\n\nexport type InputWrapperCssVariables = InputLabelCssVariables &\n InputErrorCssVariables &\n InputSuccessCssVariables &\n InputDescriptionCssVariables;\n\nexport type InputWrapperStylesNames =\n | 'root'\n | InputLabelStylesNames\n | InputDescriptionStylesNames\n | InputErrorStylesNames\n | InputSuccessStylesNames;\n\nexport interface __InputWrapperProps {\n /** Contents of `Input.Label` component. If not set, label is not displayed. */\n label?: React.ReactNode;\n\n /** Contents of `Input.Description` component. If not set, description is not displayed. */\n description?: React.ReactNode;\n\n /** Contents of `Input.Error` component. If not set, error is not displayed. */\n error?: React.ReactNode;\n\n /** Contents of `Input.Success` component. If not set, success is not displayed. */\n success?: React.ReactNode;\n\n /** Adds required attribute to the input and a red asterisk on the right side of label @default false */\n required?: boolean;\n\n /** If set, the required asterisk is displayed next to the label. Overrides `required` prop. Does not add required attribute to the input. @default false */\n withAsterisk?: boolean;\n\n /** Props passed down to the `Input.Label` component */\n labelProps?: InputLabelProps & DataAttributes;\n\n /** Props passed down to the `Input.Description` component */\n descriptionProps?: InputDescriptionProps & DataAttributes;\n\n /** Props passed down to the `Input.Error` component */\n errorProps?: InputErrorProps & DataAttributes;\n\n /** Props passed down to the `Input.Success` component */\n successProps?: InputSuccessProps & DataAttributes;\n\n /** Render function to wrap the input element. Useful for adding tooltips, popovers, or other wrappers around the input. @default React.Fragment */\n inputContainer?: (children: React.ReactNode) => React.ReactNode;\n\n /** Controls order and visibility of wrapper elements. Only elements included in this array will be rendered. @default ['label', 'description', 'input', 'error'] */\n inputWrapperOrder?: ('label' | 'input' | 'description' | 'error')[];\n}\n\nexport interface InputWrapperProps\n extends __InputWrapperProps, BoxProps, StylesApiProps<InputWrapperFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Props passed to Styles API context, replaces Input.Wrapper props */\n __stylesApiProps?: Record<string, any>;\n\n /** Static id used as base to generate `aria-` attributes, by default generates random id */\n id?: string;\n\n /** Controls size of `Input.Label`, `Input.Description` and `Input.Error` components */\n size?: MantineFontSize;\n\n /** Root element for the label. Use `'div'` when wrapper contains multiple input elements and you need to handle `htmlFor` manually. @default 'label' */\n labelElement?: 'label' | 'div';\n}\n\nexport type InputWrapperFactory = Factory<{\n props: InputWrapperProps;\n ref: HTMLDivElement;\n stylesNames: InputWrapperStylesNames;\n vars: InputWrapperCssVariables;\n}>;\n\nconst defaultProps = {\n labelElement: 'label',\n inputContainer: (children) => children,\n inputWrapperOrder: ['label', 'description', 'input', 'error'],\n} satisfies Partial<InputWrapperProps>;\n\nconst varsResolver = createVarsResolver<InputWrapperFactory>((_, { size }) => ({\n label: {\n '--input-label-size': getFontSize(size),\n '--input-asterisk-color': undefined,\n },\n\n error: {\n '--input-error-size': size === undefined ? undefined : `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n\n success: {\n '--input-success-size':\n size === undefined ? undefined : `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n\n description: {\n '--input-description-size':\n size === undefined ? undefined : `calc(${getFontSize(size)} - ${rem(2)})`,\n },\n}));\n\nexport const InputWrapper = factory<InputWrapperFactory>((_props) => {\n const props = useProps('InputWrapper', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n size,\n variant,\n __staticSelector,\n inputContainer,\n inputWrapperOrder,\n label,\n error,\n success,\n description,\n labelProps,\n descriptionProps,\n errorProps,\n successProps,\n labelElement,\n children,\n withAsterisk,\n id,\n required,\n __stylesApiProps,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<InputWrapperFactory>({\n name: ['InputWrapper', __staticSelector],\n props: __stylesApiProps || props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const sharedProps = {\n size,\n variant,\n __staticSelector,\n };\n\n const idBase = useId(id);\n const isRequired = typeof withAsterisk === 'boolean' ? withAsterisk : required;\n const errorId = errorProps?.id || `${idBase}-error`;\n const successId = successProps?.id || `${idBase}-success`;\n const descriptionId = descriptionProps?.id || `${idBase}-description`;\n const inputId = idBase;\n const hasError = !!error && typeof error !== 'boolean';\n const hasSuccess = !!success && typeof success !== 'boolean' && !error;\n const hasDescription = !!description;\n const errorRendered = hasError && inputWrapperOrder.includes('error');\n const successRendered = hasSuccess && inputWrapperOrder.includes('error');\n const descriptionRendered = hasDescription && inputWrapperOrder.includes('description');\n const _describedBy = `${errorRendered ? errorId : ''} ${successRendered ? successId : ''} ${descriptionRendered ? descriptionId : ''}`;\n const describedBy = _describedBy.trim().length > 0 ? _describedBy.trim() : undefined;\n const labelId = labelProps?.id || `${idBase}-label`;\n\n const _label = label && (\n <InputLabel\n key=\"label\"\n labelElement={labelElement}\n id={labelId}\n htmlFor={inputId}\n required={isRequired}\n {...sharedProps}\n {...labelProps}\n >\n {label}\n </InputLabel>\n );\n\n const _description = hasDescription && (\n <InputDescription\n key=\"description\"\n {...descriptionProps}\n {...sharedProps}\n size={descriptionProps?.size || sharedProps.size}\n id={descriptionProps?.id || descriptionId}\n >\n {description}\n </InputDescription>\n );\n\n const _input = <Fragment key=\"input\">{inputContainer(children)}</Fragment>;\n\n const _error = hasError && (\n <InputError\n {...errorProps}\n {...sharedProps}\n size={errorProps?.size || sharedProps.size}\n key=\"error\"\n id={errorProps?.id || errorId}\n >\n {error}\n </InputError>\n );\n\n const _success = hasSuccess && (\n <InputSuccess\n {...successProps}\n {...sharedProps}\n size={successProps?.size || sharedProps.size}\n key=\"success\"\n id={successProps?.id || successId}\n >\n {success}\n </InputSuccess>\n );\n\n const content = inputWrapperOrder.map((part) => {\n switch (part) {\n case 'label':\n return _label;\n case 'input':\n return _input;\n case 'description':\n return _description;\n case 'error':\n return _error || _success;\n default:\n return null;\n }\n });\n\n return (\n <InputWrapperContext\n value={{\n getStyles,\n describedBy,\n inputId,\n labelId,\n ...getInputOffsets(inputWrapperOrder, { hasDescription, hasError: hasError || hasSuccess }),\n }}\n >\n <Box\n variant={variant}\n size={size}\n mod={[{ error: !!error, success: !!success && !error }, mod]}\n id={labelElement === 'label' ? undefined : id}\n {...getStyles('root')}\n {...others}\n >\n {content}\n </Box>\n </InputWrapperContext>\n );\n});\n\nInputWrapper.classes = classes;\nInputWrapper.varsResolver = varsResolver;\nInputWrapper.displayName = '@mantine/core/InputWrapper';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuHA,MAAM,eAAe;CACnB,cAAc;CACd,iBAAiB,aAAa;CAC9B,mBAAmB;EAAC;EAAS;EAAe;EAAS;CAAO;AAC9D;AAEA,MAAM,eAAe,oBAAyC,GAAG,EAAE,YAAY;CAC7E,OAAO;EACL,sBAAsB,YAAY,IAAI;EACtC,0BAA0B,KAAA;CAC5B;CAEA,OAAO,EACL,sBAAsB,SAAS,KAAA,IAAY,KAAA,IAAY,QAAQ,YAAY,IAAI,EAAE,KAA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;GAAM,GAAG,GAAG;GAC3D,IAAI,iBAAiB,UAAU,KAAA,IAAY;GAC3C,GAAI,UAAU,MAAM;GACpB,GAAI;aAEH;EACE,CAAA;CACc,CAAA;AAEzB,CAAC;AAED,aAAa,UAAUC;AACvB,aAAa,eAAe;AAC5B,aAAa,cAAc"}
|
|
@@ -8,18 +8,20 @@ function useInputProps(component, defaultProps, _props) {
|
|
|
8
8
|
"InputWrapper",
|
|
9
9
|
component
|
|
10
10
|
], defaultProps, _props);
|
|
11
|
-
const { label, description, error, required, classNames, styles, className, unstyled, __staticSelector, __stylesApiProps, errorProps, labelProps, descriptionProps, wrapperProps: _wrapperProps, id, size, style, inputContainer, inputWrapperOrder, withAsterisk, variant, vars, mod, attributes, ...others } = props;
|
|
11
|
+
const { label, description, error, success, required, classNames, styles, className, unstyled, __staticSelector, __stylesApiProps, errorProps, successProps, labelProps, descriptionProps, wrapperProps: _wrapperProps, id, size, style, inputContainer, inputWrapperOrder, withAsterisk, variant, vars, mod, attributes, ...others } = props;
|
|
12
12
|
const { styleProps, rest } = extractStyleProps(others);
|
|
13
13
|
const wrapperProps = {
|
|
14
14
|
label,
|
|
15
15
|
description,
|
|
16
16
|
error,
|
|
17
|
+
success,
|
|
17
18
|
required,
|
|
18
19
|
classNames,
|
|
19
20
|
className,
|
|
20
21
|
__staticSelector,
|
|
21
22
|
__stylesApiProps: __stylesApiProps || props,
|
|
22
23
|
errorProps,
|
|
24
|
+
successProps,
|
|
23
25
|
labelProps,
|
|
24
26
|
descriptionProps,
|
|
25
27
|
unstyled,
|
|
@@ -53,6 +55,7 @@ function useInputProps(component, defaultProps, _props) {
|
|
|
53
55
|
__staticSelector,
|
|
54
56
|
__stylesApiProps: __stylesApiProps || props,
|
|
55
57
|
error,
|
|
58
|
+
success,
|
|
56
59
|
variant,
|
|
57
60
|
id,
|
|
58
61
|
attributes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-input-props.mjs","names":[],"sources":["../../../src/components/Input/use-input-props.ts"],"sourcesContent":["import { BoxProps, extractStyleProps, StylesApiProps, useProps } from '../../core';\nimport { __BaseInputProps } from './Input';\n\ninterface BaseProps\n extends __BaseInputProps, BoxProps, StylesApiProps<{ props: any; stylesNames: string }> {\n __staticSelector?: string;\n __stylesApiProps?: Record<string, any>;\n id?: string;\n}\n\nexport function useInputProps<T extends BaseProps, U extends Partial<T> | null>(\n component: string,\n defaultProps: U,\n _props: T\n) {\n const props = useProps<T, U>(['Input', 'InputWrapper', component], defaultProps, _props);\n const {\n label,\n description,\n error,\n required,\n classNames,\n styles,\n className,\n unstyled,\n __staticSelector,\n __stylesApiProps,\n errorProps,\n labelProps,\n descriptionProps,\n wrapperProps: _wrapperProps,\n id,\n size,\n style,\n inputContainer,\n inputWrapperOrder,\n withAsterisk,\n variant,\n vars,\n mod,\n attributes,\n ...others\n } = props;\n\n const { styleProps, rest } = extractStyleProps(others);\n\n const wrapperProps = {\n label,\n description,\n error,\n required,\n classNames,\n className,\n __staticSelector,\n __stylesApiProps: __stylesApiProps || props,\n errorProps,\n labelProps,\n descriptionProps,\n unstyled,\n styles,\n size,\n style,\n inputContainer,\n inputWrapperOrder,\n withAsterisk,\n variant,\n id,\n mod,\n attributes,\n ..._wrapperProps,\n };\n\n return {\n ...rest,\n classNames,\n styles,\n unstyled,\n wrapperProps: { ...wrapperProps, ...styleProps } as typeof wrapperProps & BoxProps,\n inputProps: {\n required,\n classNames,\n styles,\n unstyled,\n size,\n __staticSelector,\n __stylesApiProps: __stylesApiProps || props,\n error,\n variant,\n id,\n attributes,\n },\n };\n}\n"],"mappings":";;;;AAUA,SAAgB,cACd,WACA,cACA,QACA;CACA,MAAM,QAAQ,SAAe;EAAC;EAAS;EAAgB;CAAS,GAAG,cAAc,MAAM;CACvF,MAAM,EACJ,OACA,aACA,OACA,UACA,YACA,QACA,WACA,UACA,kBACA,kBACA,YACA,YACA,kBACA,cAAc,eACd,IACA,MACA,OACA,gBACA,mBACA,cACA,SACA,MACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,EAAE,YAAY,SAAS,kBAAkB,MAAM;CAErD,MAAM,eAAe;EACnB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,kBAAkB,oBAAoB;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,GAAG;CACL;CAEA,OAAO;EACL,GAAG;EACH;EACA;EACA;EACA,cAAc;GAAE,GAAG;GAAc,GAAG;EAAW;EAC/C,YAAY;GACV;GACA;GACA;GACA;GACA;GACA;GACA,kBAAkB,oBAAoB;GACtC;GACA;GACA;GACA;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"use-input-props.mjs","names":[],"sources":["../../../src/components/Input/use-input-props.ts"],"sourcesContent":["import { BoxProps, extractStyleProps, StylesApiProps, useProps } from '../../core';\nimport { __BaseInputProps } from './Input';\n\ninterface BaseProps\n extends __BaseInputProps, BoxProps, StylesApiProps<{ props: any; stylesNames: string }> {\n __staticSelector?: string;\n __stylesApiProps?: Record<string, any>;\n id?: string;\n}\n\nexport function useInputProps<T extends BaseProps, U extends Partial<T> | null>(\n component: string,\n defaultProps: U,\n _props: T\n) {\n const props = useProps<T, U>(['Input', 'InputWrapper', component], defaultProps, _props);\n const {\n label,\n description,\n error,\n success,\n required,\n classNames,\n styles,\n className,\n unstyled,\n __staticSelector,\n __stylesApiProps,\n errorProps,\n successProps,\n labelProps,\n descriptionProps,\n wrapperProps: _wrapperProps,\n id,\n size,\n style,\n inputContainer,\n inputWrapperOrder,\n withAsterisk,\n variant,\n vars,\n mod,\n attributes,\n ...others\n } = props;\n\n const { styleProps, rest } = extractStyleProps(others);\n\n const wrapperProps = {\n label,\n description,\n error,\n success,\n required,\n classNames,\n className,\n __staticSelector,\n __stylesApiProps: __stylesApiProps || props,\n errorProps,\n successProps,\n labelProps,\n descriptionProps,\n unstyled,\n styles,\n size,\n style,\n inputContainer,\n inputWrapperOrder,\n withAsterisk,\n variant,\n id,\n mod,\n attributes,\n ..._wrapperProps,\n };\n\n return {\n ...rest,\n classNames,\n styles,\n unstyled,\n wrapperProps: { ...wrapperProps, ...styleProps } as typeof wrapperProps & BoxProps,\n inputProps: {\n required,\n classNames,\n styles,\n unstyled,\n size,\n __staticSelector,\n __stylesApiProps: __stylesApiProps || props,\n error,\n success,\n variant,\n id,\n attributes,\n },\n };\n}\n"],"mappings":";;;;AAUA,SAAgB,cACd,WACA,cACA,QACA;CACA,MAAM,QAAQ,SAAe;EAAC;EAAS;EAAgB;CAAS,GAAG,cAAc,MAAM;CACvF,MAAM,EACJ,OACA,aACA,OACA,SACA,UACA,YACA,QACA,WACA,UACA,kBACA,kBACA,YACA,cACA,YACA,kBACA,cAAc,eACd,IACA,MACA,OACA,gBACA,mBACA,cACA,SACA,MACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,EAAE,YAAY,SAAS,kBAAkB,MAAM;CAErD,MAAM,eAAe;EACnB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,kBAAkB,oBAAoB;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,GAAG;CACL;CAEA,OAAO;EACL,GAAG;EACH;EACA;EACA;EACA,cAAc;GAAE,GAAG;GAAc,GAAG;EAAW;EAC/C,YAAY;GACV;GACA;GACA;GACA;GACA;GACA;GACA,kBAAkB,oBAAoB;GACtC;GACA;GACA;GACA;GACA;EACF;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-json.mjs","names":[],"sources":["../../../../src/components/JsonInput/validate-json/validate-json.ts"],"sourcesContent":["export function validateJson(value: string, deserialize: typeof JSON.parse) {\n if (typeof value === 'string' && value.trim().length === 0) {\n return true;\n }\n\n try {\n deserialize(value);\n return true;\n } catch (e) {\n return false;\n }\n}\n"],"mappings":";;AAAA,SAAgB,aAAa,OAAe,aAAgC;CAC1E,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"validate-json.mjs","names":[],"sources":["../../../../src/components/JsonInput/validate-json/validate-json.ts"],"sourcesContent":["export function validateJson(value: string, deserialize: typeof JSON.parse) {\n if (typeof value === 'string' && value.trim().length === 0) {\n return true;\n }\n\n try {\n deserialize(value);\n return true;\n } catch (e) {\n return false;\n }\n}\n"],"mappings":";;AAAA,SAAgB,aAAa,OAAe,aAAgC;CAC1E,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,CAAC,CAAC,WAAW,GACvD,OAAO;CAGT,IAAI;EACF,YAAY,KAAK;EACjB,OAAO;CACT,SAAS,GAAG;EACV,OAAO;CACT;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Kbd.mjs","names":["classes"],"sources":["../../../src/components/Kbd/Kbd.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSize,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Kbd.module.css';\n\nexport type KbdStylesNames = 'root';\nexport type KbdCssVariables = {\n root: '--kbd-fz';\n};\n\nexport interface KbdProps extends BoxProps, StylesApiProps<KbdFactory>, ElementProps<'kbd'> {\n /** Controls `font-size` and `padding` @default 'sm' */\n size?: MantineSize | number | (string & {});\n}\n\nexport type KbdFactory = Factory<{\n props: KbdProps;\n ref: HTMLElement;\n stylesNames: KbdStylesNames;\n vars: KbdCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<KbdFactory>((_, { size }) => ({\n root: { '--kbd-fz': getSize(size, 'kbd-fz') },\n}));\n\nexport const Kbd = factory<KbdFactory>((_props) => {\n const props = useProps('Kbd', null, _props);\n const { classNames, className, style, styles, unstyled, vars, attributes, ...others } = props;\n\n const getStyles = useStyles<KbdFactory>({\n name: 'Kbd',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return <Box component=\"kbd\" {...getStyles('root')} {...others} />;\n});\n\nKbd.classes = classes;\nKbd.varsResolver = varsResolver;\nKbd.displayName = '@mantine/core/Kbd';\n\nexport namespace Kbd {\n export type Props = KbdProps;\n export type StylesNames = KbdStylesNames;\n export type CssVariables = KbdCssVariables;\n export type Factory = KbdFactory;\n}\n"],"mappings":";;;;;;;;;;AAgCA,MAAM,eAAe,oBAAgC,GAAG,EAAE,YAAY,EACpE,MAAM,EAAE,YAAY,QAAQ,MAAM,QAAQ,EAAE,EAC9C,EAAE;AAEF,MAAa,MAAM,SAAqB,WAAW;CACjD,MAAM,QAAQ,SAAS,OAAO,MAAM,MAAM;CAC1C,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,UAAU,MAAM,YAAY,GAAG,WAAW;CAgBxF,OAAO,oBAAC,KAAD;EAAK,WAAU;EAAM,GAdV,UAAsB;GACtC,MAAM;GACN,SAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAEwC,
|
|
1
|
+
{"version":3,"file":"Kbd.mjs","names":["classes"],"sources":["../../../src/components/Kbd/Kbd.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSize,\n MantineSize,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Kbd.module.css';\n\nexport type KbdStylesNames = 'root';\nexport type KbdCssVariables = {\n root: '--kbd-fz';\n};\n\nexport interface KbdProps extends BoxProps, StylesApiProps<KbdFactory>, ElementProps<'kbd'> {\n /** Controls `font-size` and `padding` @default 'sm' */\n size?: MantineSize | number | (string & {});\n}\n\nexport type KbdFactory = Factory<{\n props: KbdProps;\n ref: HTMLElement;\n stylesNames: KbdStylesNames;\n vars: KbdCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<KbdFactory>((_, { size }) => ({\n root: { '--kbd-fz': getSize(size, 'kbd-fz') },\n}));\n\nexport const Kbd = factory<KbdFactory>((_props) => {\n const props = useProps('Kbd', null, _props);\n const { classNames, className, style, styles, unstyled, vars, attributes, ...others } = props;\n\n const getStyles = useStyles<KbdFactory>({\n name: 'Kbd',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return <Box component=\"kbd\" {...getStyles('root')} {...others} />;\n});\n\nKbd.classes = classes;\nKbd.varsResolver = varsResolver;\nKbd.displayName = '@mantine/core/Kbd';\n\nexport namespace Kbd {\n export type Props = KbdProps;\n export type StylesNames = KbdStylesNames;\n export type CssVariables = KbdCssVariables;\n export type Factory = KbdFactory;\n}\n"],"mappings":";;;;;;;;;;AAgCA,MAAM,eAAe,oBAAgC,GAAG,EAAE,YAAY,EACpE,MAAM,EAAE,YAAY,QAAQ,MAAM,QAAQ,EAAE,EAC9C,EAAE;AAEF,MAAa,MAAM,SAAqB,WAAW;CACjD,MAAM,QAAQ,SAAS,OAAO,MAAM,MAAM;CAC1C,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,UAAU,MAAM,YAAY,GAAG,WAAW;CAgBxF,OAAO,oBAAC,KAAD;EAAK,WAAU;EAAM,GAdV,UAAsB;GACtC,MAAM;GACN,SAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAEwC,CAAC,CAAC,MAAM;EAAG,GAAI;CAAS,CAAA;AAClE,CAAC;AAED,IAAI,UAAUA;AACd,IAAI,eAAe;AACnB,IAAI,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mark.mjs","names":["classes"],"sources":["../../../src/components/Mark/Mark.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n MantineColor,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { getMarkColor } from './get-mark-color';\nimport classes from './Mark.module.css';\n\nexport type MarkStylesNames = 'root';\nexport type MarkCssVariables = {\n root: '--mark-bg-dark' | '--mark-bg-light';\n};\n\nexport interface MarkProps extends BoxProps, StylesApiProps<MarkFactory>, ElementProps<'mark'> {\n /** Key of `theme.colors` or any valid CSS color @default yellow */\n color?: MantineColor;\n}\n\nexport type MarkFactory = Factory<{\n props: MarkProps;\n ref: HTMLElement;\n stylesNames: MarkStylesNames;\n vars: MarkCssVariables;\n}>;\n\nconst defaultProps = {\n color: 'yellow',\n} satisfies Partial<MarkProps>;\n\nconst varsResolver = createVarsResolver<MarkFactory>((theme, { color }) => ({\n root: {\n '--mark-bg-dark': getMarkColor({ color, theme, defaultShade: 5 }),\n '--mark-bg-light': getMarkColor({ color, theme, defaultShade: 2 }),\n },\n}));\n\nexport const Mark = factory<MarkFactory>((_props) => {\n const props = useProps('Mark', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n color,\n variant,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<MarkFactory>({\n name: 'Mark',\n props,\n className,\n style,\n classes,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return <Box component=\"mark\" variant={variant} {...getStyles('root')} {...others} />;\n});\n\nMark.classes = classes;\nMark.varsResolver = varsResolver;\nMark.displayName = '@mantine/core/Mark';\n\nexport namespace Mark {\n export type Props = MarkProps;\n export type StylesNames = MarkStylesNames;\n export type CssVariables = MarkCssVariables;\n export type Factory = MarkFactory;\n}\n"],"mappings":";;;;;;;;;;AAgCA,MAAM,eAAe,EACnB,OAAO,SACT;AAEA,MAAM,eAAe,oBAAiC,OAAO,EAAE,aAAa,EAC1E,MAAM;CACJ,kBAAkB,aAAa;EAAE;EAAO;EAAO,cAAc;CAAE,CAAC;CAChE,mBAAmB,aAAa;EAAE;EAAO;EAAO,cAAc;CAAE,CAAC;AACnE,EACF,EAAE;AAEF,MAAa,OAAO,SAAsB,WAAW;CACnD,MAAM,QAAQ,SAAS,QAAQ,cAAc,MAAM;CACnD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,OACA,SACA,YACA,GAAG,WACD;CAgBJ,OAAO,oBAAC,KAAD;EAAK,WAAU;EAAgB;EAAS,GAd7B,UAAuB;GACvC,MAAM;GACN;GACA;GACA;GACA,SAAA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAE2D,
|
|
1
|
+
{"version":3,"file":"Mark.mjs","names":["classes"],"sources":["../../../src/components/Mark/Mark.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n MantineColor,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport { getMarkColor } from './get-mark-color';\nimport classes from './Mark.module.css';\n\nexport type MarkStylesNames = 'root';\nexport type MarkCssVariables = {\n root: '--mark-bg-dark' | '--mark-bg-light';\n};\n\nexport interface MarkProps extends BoxProps, StylesApiProps<MarkFactory>, ElementProps<'mark'> {\n /** Key of `theme.colors` or any valid CSS color @default yellow */\n color?: MantineColor;\n}\n\nexport type MarkFactory = Factory<{\n props: MarkProps;\n ref: HTMLElement;\n stylesNames: MarkStylesNames;\n vars: MarkCssVariables;\n}>;\n\nconst defaultProps = {\n color: 'yellow',\n} satisfies Partial<MarkProps>;\n\nconst varsResolver = createVarsResolver<MarkFactory>((theme, { color }) => ({\n root: {\n '--mark-bg-dark': getMarkColor({ color, theme, defaultShade: 5 }),\n '--mark-bg-light': getMarkColor({ color, theme, defaultShade: 2 }),\n },\n}));\n\nexport const Mark = factory<MarkFactory>((_props) => {\n const props = useProps('Mark', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n color,\n variant,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<MarkFactory>({\n name: 'Mark',\n props,\n className,\n style,\n classes,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n return <Box component=\"mark\" variant={variant} {...getStyles('root')} {...others} />;\n});\n\nMark.classes = classes;\nMark.varsResolver = varsResolver;\nMark.displayName = '@mantine/core/Mark';\n\nexport namespace Mark {\n export type Props = MarkProps;\n export type StylesNames = MarkStylesNames;\n export type CssVariables = MarkCssVariables;\n export type Factory = MarkFactory;\n}\n"],"mappings":";;;;;;;;;;AAgCA,MAAM,eAAe,EACnB,OAAO,SACT;AAEA,MAAM,eAAe,oBAAiC,OAAO,EAAE,aAAa,EAC1E,MAAM;CACJ,kBAAkB,aAAa;EAAE;EAAO;EAAO,cAAc;CAAE,CAAC;CAChE,mBAAmB,aAAa;EAAE;EAAO;EAAO,cAAc;CAAE,CAAC;AACnE,EACF,EAAE;AAEF,MAAa,OAAO,SAAsB,WAAW;CACnD,MAAM,QAAQ,SAAS,QAAQ,cAAc,MAAM;CACnD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,OACA,SACA,YACA,GAAG,WACD;CAgBJ,OAAO,oBAAC,KAAD;EAAK,WAAU;EAAgB;EAAS,GAd7B,UAAuB;GACvC,MAAM;GACN;GACA;GACA;GACA,SAAA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAE2D,CAAC,CAAC,MAAM;EAAG,GAAI;CAAS,CAAA;AACrF,CAAC;AAED,KAAK,UAAUA;AACf,KAAK,eAAe;AACpB,KAAK,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marquee.mjs","names":["classes"],"sources":["../../../src/components/Marquee/Marquee.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSpacing,\n MantineSpacing,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Marquee.module.css';\n\nexport type MarqueeStylesNames = 'root' | 'content' | 'group';\nexport type MarqueeCssVariables = {\n root:\n | '--marquee-duration'\n | '--marquee-gap'\n | '--marquee-repeat'\n | '--marquee-fade-color'\n | '--marquee-fade-size';\n};\n\nexport interface MarqueeProps\n extends BoxProps, StylesApiProps<MarqueeFactory>, ElementProps<'div'> {\n /** Reverses animation direction @default false */\n reverse?: boolean;\n\n /** Pauses animation on hover @default false */\n pauseOnHover?: boolean;\n\n /** Content to scroll */\n children: React.ReactNode;\n\n /** Scroll orientation @default 'horizontal' */\n orientation?: 'horizontal' | 'vertical';\n\n /** Number of times children are repeated inline for seamless scrolling @default 4 */\n repeat?: number;\n\n /** Animation duration in ms @default 40000 */\n duration?: number;\n\n /** Gap between repeated children, key of `theme.spacing` or any valid CSS value @default 'md' */\n gap?: MantineSpacing;\n\n /** Whether to show gradient fade on edges, @default true */\n fadeEdges?: boolean;\n\n /** Color of the fade gradient, @default 'var(--mantine-color-body)' */\n fadeEdgeColor?: string;\n\n /** Size of the fade gradient, @default '5%' */\n fadeEdgeSize?: string;\n}\n\nexport type MarqueeFactory = Factory<{\n props: MarqueeProps;\n ref: HTMLDivElement;\n stylesNames: MarqueeStylesNames;\n vars: MarqueeCssVariables;\n}>;\n\nconst defaultProps = {\n repeat: 4,\n duration: 100_000,\n orientation: 'horizontal',\n fadeEdges: true,\n} satisfies Partial<MarqueeProps>;\n\nconst varsResolver = createVarsResolver<MarqueeFactory>(\n (_, { duration, gap, repeat, fadeEdgeColor, fadeEdgeSize }) => ({\n root: {\n '--marquee-duration': `${duration}ms`,\n '--marquee-gap': getSpacing(gap),\n '--marquee-repeat': (repeat ?? 4).toString(),\n '--marquee-fade-color': fadeEdgeColor,\n '--marquee-fade-size': fadeEdgeSize,\n },\n })\n);\n\nexport const Marquee = factory<MarqueeFactory>((_props) => {\n const props = useProps('Marquee', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n children,\n reverse,\n pauseOnHover,\n orientation,\n repeat,\n duration,\n gap,\n fadeEdges,\n fadeEdgeColor,\n fadeEdgeSize,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<MarqueeFactory>({\n name: 'Marquee',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const repeatedChildren = Array(repeat)\n .fill(0)\n .map((_, index) => (\n <div key={index} {...getStyles('group')}>\n {children}\n </div>\n ));\n\n return (\n <Box\n {...getStyles('root')}\n mod={[{ orientation, reverse, pauseOnHover, 'fade-edges': fadeEdges }, mod]}\n {...others}\n >\n <div {...getStyles('content')}>{repeatedChildren}</div>\n </Box>\n );\n});\n\nMarquee.classes = classes;\nMarquee.varsResolver = varsResolver;\nMarquee.displayName = '@mantine/core/Marquee';\n\nexport namespace Marquee {\n export type Props = MarqueeProps;\n export type StylesNames = MarqueeStylesNames;\n export type CssVariables = MarqueeCssVariables;\n export type Factory = MarqueeFactory;\n}\n"],"mappings":";;;;;;;;;;AAiEA,MAAM,eAAe;CACnB,QAAQ;CACR,UAAU;CACV,aAAa;CACb,WAAW;AACb;AAEA,MAAM,eAAe,oBAClB,GAAG,EAAE,UAAU,KAAK,QAAQ,eAAe,oBAAoB,EAC9D,MAAM;CACJ,sBAAsB,GAAG,SAAS;CAClC,iBAAiB,WAAW,GAAG;CAC/B,qBAAqB,UAAU,
|
|
1
|
+
{"version":3,"file":"Marquee.mjs","names":["classes"],"sources":["../../../src/components/Marquee/Marquee.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n createVarsResolver,\n ElementProps,\n factory,\n Factory,\n getSpacing,\n MantineSpacing,\n StylesApiProps,\n useProps,\n useStyles,\n} from '../../core';\nimport classes from './Marquee.module.css';\n\nexport type MarqueeStylesNames = 'root' | 'content' | 'group';\nexport type MarqueeCssVariables = {\n root:\n | '--marquee-duration'\n | '--marquee-gap'\n | '--marquee-repeat'\n | '--marquee-fade-color'\n | '--marquee-fade-size';\n};\n\nexport interface MarqueeProps\n extends BoxProps, StylesApiProps<MarqueeFactory>, ElementProps<'div'> {\n /** Reverses animation direction @default false */\n reverse?: boolean;\n\n /** Pauses animation on hover @default false */\n pauseOnHover?: boolean;\n\n /** Content to scroll */\n children: React.ReactNode;\n\n /** Scroll orientation @default 'horizontal' */\n orientation?: 'horizontal' | 'vertical';\n\n /** Number of times children are repeated inline for seamless scrolling @default 4 */\n repeat?: number;\n\n /** Animation duration in ms @default 40000 */\n duration?: number;\n\n /** Gap between repeated children, key of `theme.spacing` or any valid CSS value @default 'md' */\n gap?: MantineSpacing;\n\n /** Whether to show gradient fade on edges, @default true */\n fadeEdges?: boolean;\n\n /** Color of the fade gradient, @default 'var(--mantine-color-body)' */\n fadeEdgeColor?: string;\n\n /** Size of the fade gradient, @default '5%' */\n fadeEdgeSize?: string;\n}\n\nexport type MarqueeFactory = Factory<{\n props: MarqueeProps;\n ref: HTMLDivElement;\n stylesNames: MarqueeStylesNames;\n vars: MarqueeCssVariables;\n}>;\n\nconst defaultProps = {\n repeat: 4,\n duration: 100_000,\n orientation: 'horizontal',\n fadeEdges: true,\n} satisfies Partial<MarqueeProps>;\n\nconst varsResolver = createVarsResolver<MarqueeFactory>(\n (_, { duration, gap, repeat, fadeEdgeColor, fadeEdgeSize }) => ({\n root: {\n '--marquee-duration': `${duration}ms`,\n '--marquee-gap': getSpacing(gap),\n '--marquee-repeat': (repeat ?? 4).toString(),\n '--marquee-fade-color': fadeEdgeColor,\n '--marquee-fade-size': fadeEdgeSize,\n },\n })\n);\n\nexport const Marquee = factory<MarqueeFactory>((_props) => {\n const props = useProps('Marquee', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n children,\n reverse,\n pauseOnHover,\n orientation,\n repeat,\n duration,\n gap,\n fadeEdges,\n fadeEdgeColor,\n fadeEdgeSize,\n mod,\n attributes,\n ...others\n } = props;\n\n const getStyles = useStyles<MarqueeFactory>({\n name: 'Marquee',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n });\n\n const repeatedChildren = Array(repeat)\n .fill(0)\n .map((_, index) => (\n <div key={index} {...getStyles('group')}>\n {children}\n </div>\n ));\n\n return (\n <Box\n {...getStyles('root')}\n mod={[{ orientation, reverse, pauseOnHover, 'fade-edges': fadeEdges }, mod]}\n {...others}\n >\n <div {...getStyles('content')}>{repeatedChildren}</div>\n </Box>\n );\n});\n\nMarquee.classes = classes;\nMarquee.varsResolver = varsResolver;\nMarquee.displayName = '@mantine/core/Marquee';\n\nexport namespace Marquee {\n export type Props = MarqueeProps;\n export type StylesNames = MarqueeStylesNames;\n export type CssVariables = MarqueeCssVariables;\n export type Factory = MarqueeFactory;\n}\n"],"mappings":";;;;;;;;;;AAiEA,MAAM,eAAe;CACnB,QAAQ;CACR,UAAU;CACV,aAAa;CACb,WAAW;AACb;AAEA,MAAM,eAAe,oBAClB,GAAG,EAAE,UAAU,KAAK,QAAQ,eAAe,oBAAoB,EAC9D,MAAM;CACJ,sBAAsB,GAAG,SAAS;CAClC,iBAAiB,WAAW,GAAG;CAC/B,qBAAqB,UAAU,EAAA,CAAG,SAAS;CAC3C,wBAAwB;CACxB,uBAAuB;AACzB,EACF,EACF;AAEA,MAAa,UAAU,SAAyB,WAAW;CACzD,MAAM,QAAQ,SAAS,WAAW,cAAc,MAAM;CACtD,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,UACA,SACA,cACA,aACA,QACA,UACA,KACA,WACA,eACA,cACA,KACA,YACA,GAAG,WACD;CAEJ,MAAM,YAAY,UAA0B;EAC1C,MAAM;EACN,SAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,mBAAmB,MAAM,MAAM,CAAC,CACnC,KAAK,CAAC,CAAC,CACP,KAAK,GAAG,UACP,oBAAC,OAAD;EAAiB,GAAI,UAAU,OAAO;EACnC;CACE,GAFK,KAEL,CACN;CAEH,OACE,oBAAC,KAAD;EACE,GAAI,UAAU,MAAM;EACpB,KAAK,CAAC;GAAE;GAAa;GAAS;GAAc,cAAc;EAAU,GAAG,GAAG;EAC1E,GAAI;YAEJ,oBAAC,OAAD;GAAK,GAAI,UAAU,SAAS;aAAI;EAAsB,CAAA;CACnD,CAAA;AAET,CAAC;AAED,QAAQ,UAAUA;AAClB,QAAQ,eAAe;AACvB,QAAQ,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuDivider.mjs","names":["classes"],"sources":["../../../../src/components/Menu/MenuDivider/MenuDivider.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { useMenuContext } from '../Menu.context';\nimport classes from '../Menu.module.css';\n\nexport type MenuDividerStylesNames = 'divider';\n\nexport interface MenuDividerProps\n extends BoxProps, CompoundStylesApiProps<MenuDividerFactory>, ElementProps<'div'> {}\n\nexport type MenuDividerFactory = Factory<{\n props: MenuDividerProps;\n ref: HTMLDivElement;\n stylesNames: MenuDividerStylesNames;\n compound: true;\n}>;\n\nexport const MenuDivider = factory<MenuDividerFactory>((props) => {\n const { classNames, className, style, styles, vars, ...others } = useProps(\n 'MenuDivider',\n null,\n props\n );\n const ctx = useMenuContext();\n\n return (\n <Box {...ctx.getStyles('divider', { className, style, styles, classNames })} {...others} />\n );\n});\n\nMenuDivider.classes = classes;\nMenuDivider.displayName = '@mantine/core/MenuDivider';\n"],"mappings":";;;;;;;;AAwBA,MAAa,cAAc,SAA6B,UAAU;CAChE,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WAAW,SAChE,eACA,MACA,KACF;CAGA,OACE,oBAAC,KAAD;EAAK,GAHK,eAGC,
|
|
1
|
+
{"version":3,"file":"MenuDivider.mjs","names":["classes"],"sources":["../../../../src/components/Menu/MenuDivider/MenuDivider.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { useMenuContext } from '../Menu.context';\nimport classes from '../Menu.module.css';\n\nexport type MenuDividerStylesNames = 'divider';\n\nexport interface MenuDividerProps\n extends BoxProps, CompoundStylesApiProps<MenuDividerFactory>, ElementProps<'div'> {}\n\nexport type MenuDividerFactory = Factory<{\n props: MenuDividerProps;\n ref: HTMLDivElement;\n stylesNames: MenuDividerStylesNames;\n compound: true;\n}>;\n\nexport const MenuDivider = factory<MenuDividerFactory>((props) => {\n const { classNames, className, style, styles, vars, ...others } = useProps(\n 'MenuDivider',\n null,\n props\n );\n const ctx = useMenuContext();\n\n return (\n <Box {...ctx.getStyles('divider', { className, style, styles, classNames })} {...others} />\n );\n});\n\nMenuDivider.classes = classes;\nMenuDivider.displayName = '@mantine/core/MenuDivider';\n"],"mappings":";;;;;;;;AAwBA,MAAa,cAAc,SAA6B,UAAU;CAChE,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WAAW,SAChE,eACA,MACA,KACF;CAGA,OACE,oBAAC,KAAD;EAAK,GAHK,eAGC,CAAC,CAAC,UAAU,WAAW;GAAE;GAAW;GAAO;GAAQ;EAAW,CAAC;EAAG,GAAI;CAAS,CAAA;AAE9F,CAAC;AAED,YAAY,UAAUA;AACtB,YAAY,cAAc"}
|
|
@@ -47,6 +47,7 @@ const MenuDropdown = factory((props) => {
|
|
|
47
47
|
"data-menu-dropdown": true,
|
|
48
48
|
onKeyDown: handleKeyDown,
|
|
49
49
|
children: [ctx.withInitialFocusPlaceholder && !ctx.hasSearch && /* @__PURE__ */ jsx("div", {
|
|
50
|
+
role: "presentation",
|
|
50
51
|
tabIndex: -1,
|
|
51
52
|
"data-autofocus": true,
|
|
52
53
|
"data-mantine-stop-propagation": true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuDropdown.mjs","names":["classes"],"sources":["../../../../src/components/Menu/MenuDropdown/MenuDropdown.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport {\n BoxProps,\n CompoundStylesApiProps,\n createEventHandler,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { Popover } from '../../Popover';\nimport { useMenuContext } from '../Menu.context';\nimport { useMenuTypeAhead } from '../use-menu-type-ahead';\nimport classes from '../Menu.module.css';\n\nexport type MenuDropdownStylesNames = 'dropdown';\n\nexport interface MenuDropdownProps\n extends BoxProps, CompoundStylesApiProps<MenuDropdownFactory>, ElementProps<'div'> {}\n\nexport type MenuDropdownFactory = Factory<{\n props: MenuDropdownProps;\n ref: HTMLDivElement;\n stylesNames: MenuDropdownStylesNames;\n compound: true;\n}>;\n\nexport const MenuDropdown = factory<MenuDropdownFactory>((props) => {\n const {\n classNames,\n className,\n style,\n styles,\n vars,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n children,\n ref,\n ...others\n } = useProps('MenuDropdown', null, props);\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n const ctx = useMenuContext();\n\n const typeAhead = useMenuTypeAhead({\n enabled: !ctx.hasSearch,\n opened: ctx.opened,\n getDropdown: () => wrapperRef.current,\n });\n\n const handleKeyDown = createEventHandler<any>(onKeyDown, (event) => {\n typeAhead(event);\n if (event.defaultPrevented || ctx.hasSearch) {\n return;\n }\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n wrapperRef.current\n ?.querySelectorAll<HTMLButtonElement>('[data-menu-item]:not(:disabled)')[0]\n ?.focus();\n }\n });\n\n const handleMouseEnter = createEventHandler<any>(\n onMouseEnter,\n () => (ctx.trigger === 'hover' || ctx.trigger === 'click-hover') && ctx.openDropdown()\n );\n\n const handleMouseLeave = createEventHandler<any>(\n onMouseLeave,\n () => (ctx.trigger === 'hover' || ctx.trigger === 'click-hover') && ctx.closeDropdown()\n );\n\n return (\n <Popover.Dropdown\n {...others}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n role=\"menu\"\n aria-orientation=\"vertical\"\n ref={useMergedRef(ref, wrapperRef)}\n {...ctx.getStyles('dropdown', {\n className,\n style,\n styles,\n classNames,\n withStaticClass: false,\n })}\n tabIndex={-1}\n data-menu-dropdown\n onKeyDown={handleKeyDown}\n >\n {ctx.withInitialFocusPlaceholder && !ctx.hasSearch && (\n <div
|
|
1
|
+
{"version":3,"file":"MenuDropdown.mjs","names":["classes"],"sources":["../../../../src/components/Menu/MenuDropdown/MenuDropdown.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport {\n BoxProps,\n CompoundStylesApiProps,\n createEventHandler,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { Popover } from '../../Popover';\nimport { useMenuContext } from '../Menu.context';\nimport { useMenuTypeAhead } from '../use-menu-type-ahead';\nimport classes from '../Menu.module.css';\n\nexport type MenuDropdownStylesNames = 'dropdown';\n\nexport interface MenuDropdownProps\n extends BoxProps, CompoundStylesApiProps<MenuDropdownFactory>, ElementProps<'div'> {}\n\nexport type MenuDropdownFactory = Factory<{\n props: MenuDropdownProps;\n ref: HTMLDivElement;\n stylesNames: MenuDropdownStylesNames;\n compound: true;\n}>;\n\nexport const MenuDropdown = factory<MenuDropdownFactory>((props) => {\n const {\n classNames,\n className,\n style,\n styles,\n vars,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n children,\n ref,\n ...others\n } = useProps('MenuDropdown', null, props);\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n const ctx = useMenuContext();\n\n const typeAhead = useMenuTypeAhead({\n enabled: !ctx.hasSearch,\n opened: ctx.opened,\n getDropdown: () => wrapperRef.current,\n });\n\n const handleKeyDown = createEventHandler<any>(onKeyDown, (event) => {\n typeAhead(event);\n if (event.defaultPrevented || ctx.hasSearch) {\n return;\n }\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n wrapperRef.current\n ?.querySelectorAll<HTMLButtonElement>('[data-menu-item]:not(:disabled)')[0]\n ?.focus();\n }\n });\n\n const handleMouseEnter = createEventHandler<any>(\n onMouseEnter,\n () => (ctx.trigger === 'hover' || ctx.trigger === 'click-hover') && ctx.openDropdown()\n );\n\n const handleMouseLeave = createEventHandler<any>(\n onMouseLeave,\n () => (ctx.trigger === 'hover' || ctx.trigger === 'click-hover') && ctx.closeDropdown()\n );\n\n return (\n <Popover.Dropdown\n {...others}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n role=\"menu\"\n aria-orientation=\"vertical\"\n ref={useMergedRef(ref, wrapperRef)}\n {...ctx.getStyles('dropdown', {\n className,\n style,\n styles,\n classNames,\n withStaticClass: false,\n })}\n tabIndex={-1}\n data-menu-dropdown\n onKeyDown={handleKeyDown}\n >\n {ctx.withInitialFocusPlaceholder && !ctx.hasSearch && (\n <div\n role=\"presentation\"\n tabIndex={-1}\n data-autofocus\n data-mantine-stop-propagation\n style={{ outline: 0 }}\n />\n )}\n {children}\n </Popover.Dropdown>\n );\n});\n\nMenuDropdown.classes = classes;\nMenuDropdown.displayName = '@mantine/core/MenuDropdown';\n"],"mappings":";;;;;;;;;;;;AA4BA,MAAa,eAAe,SAA8B,UAAU;CAClE,MAAM,EACJ,YACA,WACA,OACA,QACA,MACA,cACA,cACA,WACA,UACA,KACA,GAAG,WACD,SAAS,gBAAgB,MAAM,KAAK;CAExC,MAAM,aAAa,OAAuB,IAAI;CAC9C,MAAM,MAAM,eAAe;CAE3B,MAAM,YAAY,iBAAiB;EACjC,SAAS,CAAC,IAAI;EACd,QAAQ,IAAI;EACZ,mBAAmB,WAAW;CAChC,CAAC;CAED,MAAM,gBAAgB,mBAAwB,YAAY,UAAU;EAClE,UAAU,KAAK;EACf,IAAI,MAAM,oBAAoB,IAAI,WAChC;EAEF,IAAI,MAAM,QAAQ,aAAa,MAAM,QAAQ,aAAa;GACxD,MAAM,eAAe;GACrB,WAAW,SACP,iBAAoC,iCAAiC,CAAC,CAAC,EAAE,EACzE,MAAM;EACZ;CACF,CAAC;CAED,MAAM,mBAAmB,mBACvB,qBACO,IAAI,YAAY,WAAW,IAAI,YAAY,kBAAkB,IAAI,aAAa,CACvF;CAEA,MAAM,mBAAmB,mBACvB,qBACO,IAAI,YAAY,WAAW,IAAI,YAAY,kBAAkB,IAAI,cAAc,CACxF;CAEA,OACE,qBAAC,QAAQ,UAAT;EACE,GAAI;EACJ,cAAc;EACd,cAAc;EACd,MAAK;EACL,oBAAiB;EACjB,KAAK,aAAa,KAAK,UAAU;EACjC,GAAI,IAAI,UAAU,YAAY;GAC5B;GACA;GACA;GACA;GACA,iBAAiB;EACnB,CAAC;EACD,UAAU;EACV,sBAAA;EACA,WAAW;YAhBb,CAkBG,IAAI,+BAA+B,CAAC,IAAI,aACvC,oBAAC,OAAD;GACE,MAAK;GACL,UAAU;GACV,kBAAA;GACA,iCAAA;GACA,OAAO,EAAE,SAAS,EAAE;EACrB,CAAA,GAEF,QACe;;AAEtB,CAAC;AAED,aAAa,UAAUA;AACvB,aAAa,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.mjs","names":["classes"],"sources":["../../../../src/components/Menu/MenuItem/MenuItem.tsx"],"sourcesContent":["import { use, useRef } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport {\n BoxProps,\n CompoundStylesApiProps,\n createEventHandler,\n createScopedKeydownHandler,\n MantineColor,\n parseThemeColor,\n polymorphicFactory,\n PolymorphicFactory,\n useDirection,\n useMantineTheme,\n useProps,\n} from '../../../core';\nimport { UnstyledButton } from '../../UnstyledButton';\nimport { useMenuContext } from '../Menu.context';\nimport { SubMenuContext } from '../MenuSub/MenuSub.context';\nimport classes from '../Menu.module.css';\n\nexport type MenuItemStylesNames = 'item' | 'itemLabel' | 'itemSection' | 'itemIndicator';\n\nexport interface MenuItemProps extends BoxProps, CompoundStylesApiProps<MenuItemFactory> {\n 'data-disabled'?: boolean;\n\n /** Item label */\n children?: React.ReactNode;\n\n /** Key of `theme.colors` or any valid CSS color */\n color?: MantineColor;\n\n /** Controls whether the menu closes when this item is clicked. When undefined, inherits from Menu's `closeOnItemClick` prop. When true or false, overrides the Menu-level setting */\n closeMenuOnClick?: boolean;\n\n /** Section displayed at the start of the label */\n leftSection?: React.ReactNode;\n\n /** Section displayed at the end of the label */\n rightSection?: React.ReactNode;\n\n /** Sets disabled attribute, applies disabled styles */\n disabled?: boolean;\n}\n\nexport type MenuItemFactory = PolymorphicFactory<{\n props: MenuItemProps;\n defaultRef: HTMLButtonElement;\n defaultComponent: 'button';\n stylesNames: MenuItemStylesNames;\n compound: true;\n}>;\n\nexport const MenuItem = polymorphicFactory<MenuItemFactory>((props) => {\n const {\n classNames,\n className,\n style,\n styles,\n vars,\n color,\n closeMenuOnClick,\n leftSection,\n rightSection,\n children,\n disabled,\n 'data-disabled': dataDisabled,\n ref,\n ...others\n } = useProps('MenuItem', null, props);\n\n const ctx = useMenuContext();\n const subCtx = use(SubMenuContext);\n const theme = useMantineTheme();\n const { dir } = useDirection();\n const itemRef = useRef<HTMLButtonElement>(null);\n const _others: any = others;\n\n const handleClick = createEventHandler(_others.onClick, () => {\n if (dataDisabled) {\n return;\n }\n if (typeof closeMenuOnClick === 'boolean') {\n closeMenuOnClick && ctx.closeDropdownImmediately();\n } else {\n ctx.closeOnItemClick && ctx.closeDropdownImmediately();\n }\n });\n\n const handleMouseMove = createEventHandler<any>(_others.onMouseMove, () => {\n if (!ctx.hasSearch) {\n return;\n }\n const dropdown = itemRef.current?.closest('[data-menu-dropdown]');\n if (!dropdown) {\n return;\n }\n dropdown.querySelectorAll<HTMLElement>('[data-menu-active]').forEach((node) => {\n if (node !== itemRef.current && node.closest('[data-menu-dropdown]') === dropdown) {\n node.removeAttribute('data-menu-active');\n }\n });\n });\n\n const colors = color ? theme.variantColorResolver({ color, theme, variant: 'light' }) : undefined;\n const parsedThemeColor = color ? parseThemeColor({ color, theme }) : null;\n\n const handleKeydown = createEventHandler<any>(_others.onKeyDown, (event) => {\n if (event.key === 'ArrowLeft' && subCtx) {\n subCtx.close();\n subCtx.focusParentItem();\n }\n });\n\n return (\n <UnstyledButton\n onMouseDown={(event) => event.preventDefault()}\n {...others}\n unstyled={ctx.unstyled}\n tabIndex={ctx.menuItemTabIndex}\n {...ctx.getStyles('item', { className, style, styles, classNames })}\n ref={useMergedRef(itemRef, ref)}\n role=\"menuitem\"\n disabled={disabled}\n data-menu-item\n data-disabled={disabled || dataDisabled || undefined}\n data-mantine-stop-propagation\n onClick={handleClick}\n onMouseMove={handleMouseMove}\n onKeyDown={createScopedKeydownHandler({\n siblingSelector: '[data-menu-item]:not([data-disabled])',\n parentSelector: '[data-menu-dropdown]',\n activateOnFocus: false,\n loop: ctx.loop,\n dir,\n orientation: 'vertical',\n onKeyDown: handleKeydown,\n })}\n __vars={{\n '--menu-item-color':\n parsedThemeColor?.isThemeColor && parsedThemeColor?.shade === undefined\n ? `var(--mantine-color-${parsedThemeColor.color}-6)`\n : colors?.color,\n '--menu-item-hover': colors?.hover,\n }}\n >\n {ctx.alignItemsLabels === 'all' && (\n <div {...ctx.getStyles('itemIndicator', { styles, classNames })} data-placeholder />\n )}\n {leftSection && (\n <div {...ctx.getStyles('itemSection', { styles, classNames })} data-position=\"left\">\n {leftSection}\n </div>\n )}\n {children && (\n <div {...ctx.getStyles('itemLabel', { styles, classNames })} data-menu-item-label>\n {children}\n </div>\n )}\n {rightSection && (\n <div {...ctx.getStyles('itemSection', { styles, classNames })} data-position=\"right\">\n {rightSection}\n </div>\n )}\n </UnstyledButton>\n );\n});\n\nMenuItem.classes = classes;\nMenuItem.displayName = '@mantine/core/MenuItem';\n"],"mappings":";;;;;;;;;;;;;;;;AAoDA,MAAa,WAAW,oBAAqC,UAAU;CACrE,MAAM,EACJ,YACA,WACA,OACA,QACA,MACA,OACA,kBACA,aACA,cACA,UACA,UACA,iBAAiB,cACjB,KACA,GAAG,WACD,SAAS,YAAY,MAAM,KAAK;CAEpC,MAAM,MAAM,eAAe;CAC3B,MAAM,SAAS,IAAI,cAAc;CACjC,MAAM,QAAQ,gBAAgB;CAC9B,MAAM,EAAE,QAAQ,aAAa;CAC7B,MAAM,UAAU,OAA0B,IAAI;CAC9C,MAAM,UAAe;CAErB,MAAM,cAAc,mBAAmB,QAAQ,eAAe;EAC5D,IAAI,cACF;EAEF,IAAI,OAAO,qBAAqB,WAC9B,oBAAoB,IAAI,yBAAyB;OAEjD,IAAI,oBAAoB,IAAI,yBAAyB;CAEzD,CAAC;CAED,MAAM,kBAAkB,mBAAwB,QAAQ,mBAAmB;EACzE,IAAI,CAAC,IAAI,WACP;EAEF,MAAM,WAAW,QAAQ,SAAS,QAAQ,sBAAsB;EAChE,IAAI,CAAC,UACH;EAEF,SAAS,iBAA8B,oBAAoB,
|
|
1
|
+
{"version":3,"file":"MenuItem.mjs","names":["classes"],"sources":["../../../../src/components/Menu/MenuItem/MenuItem.tsx"],"sourcesContent":["import { use, useRef } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport {\n BoxProps,\n CompoundStylesApiProps,\n createEventHandler,\n createScopedKeydownHandler,\n MantineColor,\n parseThemeColor,\n polymorphicFactory,\n PolymorphicFactory,\n useDirection,\n useMantineTheme,\n useProps,\n} from '../../../core';\nimport { UnstyledButton } from '../../UnstyledButton';\nimport { useMenuContext } from '../Menu.context';\nimport { SubMenuContext } from '../MenuSub/MenuSub.context';\nimport classes from '../Menu.module.css';\n\nexport type MenuItemStylesNames = 'item' | 'itemLabel' | 'itemSection' | 'itemIndicator';\n\nexport interface MenuItemProps extends BoxProps, CompoundStylesApiProps<MenuItemFactory> {\n 'data-disabled'?: boolean;\n\n /** Item label */\n children?: React.ReactNode;\n\n /** Key of `theme.colors` or any valid CSS color */\n color?: MantineColor;\n\n /** Controls whether the menu closes when this item is clicked. When undefined, inherits from Menu's `closeOnItemClick` prop. When true or false, overrides the Menu-level setting */\n closeMenuOnClick?: boolean;\n\n /** Section displayed at the start of the label */\n leftSection?: React.ReactNode;\n\n /** Section displayed at the end of the label */\n rightSection?: React.ReactNode;\n\n /** Sets disabled attribute, applies disabled styles */\n disabled?: boolean;\n}\n\nexport type MenuItemFactory = PolymorphicFactory<{\n props: MenuItemProps;\n defaultRef: HTMLButtonElement;\n defaultComponent: 'button';\n stylesNames: MenuItemStylesNames;\n compound: true;\n}>;\n\nexport const MenuItem = polymorphicFactory<MenuItemFactory>((props) => {\n const {\n classNames,\n className,\n style,\n styles,\n vars,\n color,\n closeMenuOnClick,\n leftSection,\n rightSection,\n children,\n disabled,\n 'data-disabled': dataDisabled,\n ref,\n ...others\n } = useProps('MenuItem', null, props);\n\n const ctx = useMenuContext();\n const subCtx = use(SubMenuContext);\n const theme = useMantineTheme();\n const { dir } = useDirection();\n const itemRef = useRef<HTMLButtonElement>(null);\n const _others: any = others;\n\n const handleClick = createEventHandler(_others.onClick, () => {\n if (dataDisabled) {\n return;\n }\n if (typeof closeMenuOnClick === 'boolean') {\n closeMenuOnClick && ctx.closeDropdownImmediately();\n } else {\n ctx.closeOnItemClick && ctx.closeDropdownImmediately();\n }\n });\n\n const handleMouseMove = createEventHandler<any>(_others.onMouseMove, () => {\n if (!ctx.hasSearch) {\n return;\n }\n const dropdown = itemRef.current?.closest('[data-menu-dropdown]');\n if (!dropdown) {\n return;\n }\n dropdown.querySelectorAll<HTMLElement>('[data-menu-active]').forEach((node) => {\n if (node !== itemRef.current && node.closest('[data-menu-dropdown]') === dropdown) {\n node.removeAttribute('data-menu-active');\n }\n });\n });\n\n const colors = color ? theme.variantColorResolver({ color, theme, variant: 'light' }) : undefined;\n const parsedThemeColor = color ? parseThemeColor({ color, theme }) : null;\n\n const handleKeydown = createEventHandler<any>(_others.onKeyDown, (event) => {\n if (event.key === 'ArrowLeft' && subCtx) {\n subCtx.close();\n subCtx.focusParentItem();\n }\n });\n\n return (\n <UnstyledButton\n onMouseDown={(event) => event.preventDefault()}\n {...others}\n unstyled={ctx.unstyled}\n tabIndex={ctx.menuItemTabIndex}\n {...ctx.getStyles('item', { className, style, styles, classNames })}\n ref={useMergedRef(itemRef, ref)}\n role=\"menuitem\"\n disabled={disabled}\n data-menu-item\n data-disabled={disabled || dataDisabled || undefined}\n data-mantine-stop-propagation\n onClick={handleClick}\n onMouseMove={handleMouseMove}\n onKeyDown={createScopedKeydownHandler({\n siblingSelector: '[data-menu-item]:not([data-disabled])',\n parentSelector: '[data-menu-dropdown]',\n activateOnFocus: false,\n loop: ctx.loop,\n dir,\n orientation: 'vertical',\n onKeyDown: handleKeydown,\n })}\n __vars={{\n '--menu-item-color':\n parsedThemeColor?.isThemeColor && parsedThemeColor?.shade === undefined\n ? `var(--mantine-color-${parsedThemeColor.color}-6)`\n : colors?.color,\n '--menu-item-hover': colors?.hover,\n }}\n >\n {ctx.alignItemsLabels === 'all' && (\n <div {...ctx.getStyles('itemIndicator', { styles, classNames })} data-placeholder />\n )}\n {leftSection && (\n <div {...ctx.getStyles('itemSection', { styles, classNames })} data-position=\"left\">\n {leftSection}\n </div>\n )}\n {children && (\n <div {...ctx.getStyles('itemLabel', { styles, classNames })} data-menu-item-label>\n {children}\n </div>\n )}\n {rightSection && (\n <div {...ctx.getStyles('itemSection', { styles, classNames })} data-position=\"right\">\n {rightSection}\n </div>\n )}\n </UnstyledButton>\n );\n});\n\nMenuItem.classes = classes;\nMenuItem.displayName = '@mantine/core/MenuItem';\n"],"mappings":";;;;;;;;;;;;;;;;AAoDA,MAAa,WAAW,oBAAqC,UAAU;CACrE,MAAM,EACJ,YACA,WACA,OACA,QACA,MACA,OACA,kBACA,aACA,cACA,UACA,UACA,iBAAiB,cACjB,KACA,GAAG,WACD,SAAS,YAAY,MAAM,KAAK;CAEpC,MAAM,MAAM,eAAe;CAC3B,MAAM,SAAS,IAAI,cAAc;CACjC,MAAM,QAAQ,gBAAgB;CAC9B,MAAM,EAAE,QAAQ,aAAa;CAC7B,MAAM,UAAU,OAA0B,IAAI;CAC9C,MAAM,UAAe;CAErB,MAAM,cAAc,mBAAmB,QAAQ,eAAe;EAC5D,IAAI,cACF;EAEF,IAAI,OAAO,qBAAqB,WAC9B,oBAAoB,IAAI,yBAAyB;OAEjD,IAAI,oBAAoB,IAAI,yBAAyB;CAEzD,CAAC;CAED,MAAM,kBAAkB,mBAAwB,QAAQ,mBAAmB;EACzE,IAAI,CAAC,IAAI,WACP;EAEF,MAAM,WAAW,QAAQ,SAAS,QAAQ,sBAAsB;EAChE,IAAI,CAAC,UAC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BAAc;cAC1E;GACE,CAAA;GAEN,YACC,oBAAC,OAAD;IAAK,GAAI,IAAI,UAAU,aAAa;KAAE;KAAQ;IAAW,CAAC;IAAG,wBAAA;IAC1D;GACE,CAAA;GAEN,gBACC,oBAAC,OAAD;IAAK,GAAI,IAAI,UAAU,eAAe;KAAE;KAAQ;IAAW,CAAC;IAAG,iBAAc;cAC1E;GACE,CAAA;EAEO;;AAEpB,CAAC;AAED,SAAS,UAAUA;AACnB,SAAS,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuLabel.mjs","names":["classes"],"sources":["../../../../src/components/Menu/MenuLabel/MenuLabel.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { useMenuContext } from '../Menu.context';\nimport classes from '../Menu.module.css';\n\nexport type MenuLabelStylesNames = 'label';\n\nexport interface MenuLabelProps\n extends BoxProps, CompoundStylesApiProps<MenuLabelFactory>, ElementProps<'div'> {}\n\nexport type MenuLabelFactory = Factory<{\n props: MenuLabelProps;\n ref: HTMLDivElement;\n stylesNames: MenuLabelStylesNames;\n compound: true;\n}>;\n\nexport const MenuLabel = factory<MenuLabelFactory>((props) => {\n const { classNames, className, style, styles, vars, ...others } = useProps(\n 'MenuLabel',\n null,\n props\n );\n const ctx = useMenuContext();\n\n return <Box {...ctx.getStyles('label', { className, style, styles, classNames })} {...others} />;\n});\n\nMenuLabel.classes = classes;\nMenuLabel.displayName = '@mantine/core/MenuLabel';\n"],"mappings":";;;;;;;;AAwBA,MAAa,YAAY,SAA2B,UAAU;CAC5D,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WAAW,SAChE,aACA,MACA,KACF;CAGA,OAAO,oBAAC,KAAD;EAAK,GAFA,eAEM,
|
|
1
|
+
{"version":3,"file":"MenuLabel.mjs","names":["classes"],"sources":["../../../../src/components/Menu/MenuLabel/MenuLabel.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '../../../core';\nimport { useMenuContext } from '../Menu.context';\nimport classes from '../Menu.module.css';\n\nexport type MenuLabelStylesNames = 'label';\n\nexport interface MenuLabelProps\n extends BoxProps, CompoundStylesApiProps<MenuLabelFactory>, ElementProps<'div'> {}\n\nexport type MenuLabelFactory = Factory<{\n props: MenuLabelProps;\n ref: HTMLDivElement;\n stylesNames: MenuLabelStylesNames;\n compound: true;\n}>;\n\nexport const MenuLabel = factory<MenuLabelFactory>((props) => {\n const { classNames, className, style, styles, vars, ...others } = useProps(\n 'MenuLabel',\n null,\n props\n );\n const ctx = useMenuContext();\n\n return <Box {...ctx.getStyles('label', { className, style, styles, classNames })} {...others} />;\n});\n\nMenuLabel.classes = classes;\nMenuLabel.displayName = '@mantine/core/MenuLabel';\n"],"mappings":";;;;;;;;AAwBA,MAAa,YAAY,SAA2B,UAAU;CAC5D,MAAM,EAAE,YAAY,WAAW,OAAO,QAAQ,MAAM,GAAG,WAAW,SAChE,aACA,MACA,KACF;CAGA,OAAO,oBAAC,KAAD;EAAK,GAFA,eAEM,CAAC,CAAC,UAAU,SAAS;GAAE;GAAW;GAAO;GAAQ;EAAW,CAAC;EAAG,GAAI;CAAS,CAAA;AACjG,CAAC;AAED,UAAU,UAAUA;AACpB,UAAU,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuSearch.mjs","names":["classes"],"sources":["../../../../src/components/Menu/MenuSearch/MenuSearch.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport { createEventHandler, ElementProps, factory, Factory, useProps } from '../../../core';\nimport { Input, InputProps } from '../../Input/Input';\nimport { useMenuContext } from '../Menu.context';\nimport classes from '../Menu.module.css';\n\nconst ITEM_SELECTOR = '[data-menu-item]:not([data-disabled])';\nconst ACTIVE_SELECTOR = '[data-menu-active]';\n\nfunction getDropdown(node: HTMLElement | null): HTMLElement | null {\n return node?.closest('[data-menu-dropdown]') as HTMLElement | null;\n}\n\nfunction getItems(dropdown: HTMLElement | null): HTMLElement[] {\n if (!dropdown) {\n return [];\n }\n return Array.from(dropdown.querySelectorAll<HTMLElement>(ITEM_SELECTOR)).filter(\n (item) => item.closest('[data-menu-dropdown]') === dropdown\n );\n}\n\nfunction clearActive(dropdown: HTMLElement | null) {\n if (!dropdown) {\n return;\n }\n dropdown.querySelectorAll<HTMLElement>(ACTIVE_SELECTOR).forEach((node) => {\n if (node.closest('[data-menu-dropdown]') === dropdown) {\n node.removeAttribute('data-menu-active');\n }\n });\n}\n\nfunction setActive(item: HTMLElement | null, dropdown: HTMLElement | null) {\n clearActive(dropdown);\n if (item) {\n item.setAttribute('data-menu-active', 'true');\n item.scrollIntoView({ block: 'nearest' });\n }\n}\n\nfunction getActiveIndex(items: HTMLElement[]): number {\n return items.findIndex((item) => item.hasAttribute('data-menu-active'));\n}\n\nexport type MenuSearchStylesNames = 'search';\n\nexport interface MenuSearchProps extends InputProps, ElementProps<'input', 'size'> {\n /** If set, clears the search value after the menu close transition completes. Requires a controlled `value`/`onChange` pair. @default true */\n clearSearchOnClose?: boolean;\n}\n\nexport type MenuSearchFactory = Factory<{\n props: MenuSearchProps;\n ref: HTMLInputElement;\n stylesNames: MenuSearchStylesNames;\n compound: true;\n}>;\n\nconst defaultProps = {\n clearSearchOnClose: true,\n} satisfies Partial<MenuSearchProps>;\n\nexport const MenuSearch = factory<MenuSearchFactory>((props) => {\n const { classNames, styles, onKeyDown, onChange, size, clearSearchOnClose, ref, ...others } =\n useProps('MenuSearch', defaultProps, props);\n\n const ctx = useMenuContext();\n const inputRef = useRef<HTMLInputElement>(null);\n const mergedRef = useMergedRef(ref, inputRef);\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n useEffect(() => {\n const unregister = ctx.registerSearch();\n return unregister;\n }, [ctx.registerSearch]);\n\n useEffect(() => {\n if (clearSearchOnClose) {\n ctx.searchExitClearRef.current = () => {\n onChangeRef.current?.({\n currentTarget: { value: '' },\n } as unknown as React.ChangeEvent<HTMLInputElement>);\n };\n } else {\n ctx.searchExitClearRef.current = null;\n }\n }, [clearSearchOnClose, ctx.searchExitClearRef]);\n\n useEffect(() => {\n if (!ctx.opened) {\n const dropdown = getDropdown(inputRef.current);\n clearActive(dropdown);\n }\n }, [ctx.opened]);\n\n const handleChange = createEventHandler<any>(\n onChange,\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const dropdown = getDropdown(event.currentTarget);\n clearActive(dropdown);\n }\n );\n\n const handleKeyDown = createEventHandler<any>(\n onKeyDown,\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.defaultPrevented) {\n return;\n }\n\n const dropdown = getDropdown(event.currentTarget);\n const items = getItems(dropdown);\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n if (items.length === 0) {\n return;\n }\n const current = getActiveIndex(items);\n const next = current >= items.length - 1 ? (ctx.loop ? 0 : current) : current + 1;\n setActive(items[next] ?? null, dropdown);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n if (items.length === 0) {\n return;\n }\n const current = getActiveIndex(items);\n const next =\n current <= 0\n ? current === -1\n ? items.length - 1\n : ctx.loop\n ? items.length - 1\n : 0\n : current - 1;\n setActive(items[next] ?? null, dropdown);\n } else if (event.key === 'Home') {\n event.preventDefault();\n if (items.length > 0) {\n setActive(items[0]!, dropdown);\n }\n } else if (event.key === 'End') {\n event.preventDefault();\n if (items.length > 0) {\n setActive(items[items.length - 1]!, dropdown);\n }\n } else if (event.key === 'Enter') {\n if (event.nativeEvent.isComposing || (event.nativeEvent as KeyboardEvent).keyCode === 229) {\n return;\n }\n const activeIndex = getActiveIndex(items);\n const target = items[activeIndex];\n if (target) {\n event.preventDefault();\n if (target.hasAttribute('data-sub-menu-item')) {\n target.focus();\n target.dispatchEvent(\n new KeyboardEvent('keydown', { key: 'ArrowRight', bubbles: true })\n );\n } else {\n target.click();\n }\n }\n }\n }\n );\n\n const _styles = ctx.getStyles('search');\n\n return (\n <Input\n data-autofocus\n data-mantine-stop-propagation\n type=\"search\"\n size={size}\n {...others}\n ref={mergedRef}\n classNames={[{ input: _styles.className }, classNames] as any}\n styles={[{ input: _styles.style }, styles] as any}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n __staticSelector=\"Menu\"\n />\n );\n});\n\nMenuSearch.classes = classes;\nMenuSearch.displayName = '@mantine/core/MenuSearch';\n"],"mappings":";;;;;;;;;;;AAOA,MAAM,gBAAgB;AACtB,MAAM,kBAAkB;AAExB,SAAS,YAAY,MAA8C;CACjE,OAAO,MAAM,QAAQ,sBAAsB;AAC7C;AAEA,SAAS,SAAS,UAA6C;CAC7D,IAAI,CAAC,UACH,OAAO,CAAC;CAEV,OAAO,MAAM,KAAK,SAAS,iBAA8B,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"MenuSearch.mjs","names":["classes"],"sources":["../../../../src/components/Menu/MenuSearch/MenuSearch.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport { createEventHandler, ElementProps, factory, Factory, useProps } from '../../../core';\nimport { Input, InputProps } from '../../Input/Input';\nimport { useMenuContext } from '../Menu.context';\nimport classes from '../Menu.module.css';\n\nconst ITEM_SELECTOR = '[data-menu-item]:not([data-disabled])';\nconst ACTIVE_SELECTOR = '[data-menu-active]';\n\nfunction getDropdown(node: HTMLElement | null): HTMLElement | null {\n return node?.closest('[data-menu-dropdown]') as HTMLElement | null;\n}\n\nfunction getItems(dropdown: HTMLElement | null): HTMLElement[] {\n if (!dropdown) {\n return [];\n }\n return Array.from(dropdown.querySelectorAll<HTMLElement>(ITEM_SELECTOR)).filter(\n (item) => item.closest('[data-menu-dropdown]') === dropdown\n );\n}\n\nfunction clearActive(dropdown: HTMLElement | null) {\n if (!dropdown) {\n return;\n }\n dropdown.querySelectorAll<HTMLElement>(ACTIVE_SELECTOR).forEach((node) => {\n if (node.closest('[data-menu-dropdown]') === dropdown) {\n node.removeAttribute('data-menu-active');\n }\n });\n}\n\nfunction setActive(item: HTMLElement | null, dropdown: HTMLElement | null) {\n clearActive(dropdown);\n if (item) {\n item.setAttribute('data-menu-active', 'true');\n item.scrollIntoView({ block: 'nearest' });\n }\n}\n\nfunction getActiveIndex(items: HTMLElement[]): number {\n return items.findIndex((item) => item.hasAttribute('data-menu-active'));\n}\n\nexport type MenuSearchStylesNames = 'search';\n\nexport interface MenuSearchProps extends InputProps, ElementProps<'input', 'size'> {\n /** If set, clears the search value after the menu close transition completes. Requires a controlled `value`/`onChange` pair. @default true */\n clearSearchOnClose?: boolean;\n}\n\nexport type MenuSearchFactory = Factory<{\n props: MenuSearchProps;\n ref: HTMLInputElement;\n stylesNames: MenuSearchStylesNames;\n compound: true;\n}>;\n\nconst defaultProps = {\n clearSearchOnClose: true,\n} satisfies Partial<MenuSearchProps>;\n\nexport const MenuSearch = factory<MenuSearchFactory>((props) => {\n const { classNames, styles, onKeyDown, onChange, size, clearSearchOnClose, ref, ...others } =\n useProps('MenuSearch', defaultProps, props);\n\n const ctx = useMenuContext();\n const inputRef = useRef<HTMLInputElement>(null);\n const mergedRef = useMergedRef(ref, inputRef);\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n useEffect(() => {\n const unregister = ctx.registerSearch();\n return unregister;\n }, [ctx.registerSearch]);\n\n useEffect(() => {\n if (clearSearchOnClose) {\n ctx.searchExitClearRef.current = () => {\n onChangeRef.current?.({\n currentTarget: { value: '' },\n } as unknown as React.ChangeEvent<HTMLInputElement>);\n };\n } else {\n ctx.searchExitClearRef.current = null;\n }\n }, [clearSearchOnClose, ctx.searchExitClearRef]);\n\n useEffect(() => {\n if (!ctx.opened) {\n const dropdown = getDropdown(inputRef.current);\n clearActive(dropdown);\n }\n }, [ctx.opened]);\n\n const handleChange = createEventHandler<any>(\n onChange,\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const dropdown = getDropdown(event.currentTarget);\n clearActive(dropdown);\n }\n );\n\n const handleKeyDown = createEventHandler<any>(\n onKeyDown,\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.defaultPrevented) {\n return;\n }\n\n const dropdown = getDropdown(event.currentTarget);\n const items = getItems(dropdown);\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n if (items.length === 0) {\n return;\n }\n const current = getActiveIndex(items);\n const next = current >= items.length - 1 ? (ctx.loop ? 0 : current) : current + 1;\n setActive(items[next] ?? null, dropdown);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n if (items.length === 0) {\n return;\n }\n const current = getActiveIndex(items);\n const next =\n current <= 0\n ? current === -1\n ? items.length - 1\n : ctx.loop\n ? items.length - 1\n : 0\n : current - 1;\n setActive(items[next] ?? null, dropdown);\n } else if (event.key === 'Home') {\n event.preventDefault();\n if (items.length > 0) {\n setActive(items[0]!, dropdown);\n }\n } else if (event.key === 'End') {\n event.preventDefault();\n if (items.length > 0) {\n setActive(items[items.length - 1]!, dropdown);\n }\n } else if (event.key === 'Enter') {\n if (event.nativeEvent.isComposing || (event.nativeEvent as KeyboardEvent).keyCode === 229) {\n return;\n }\n const activeIndex = getActiveIndex(items);\n const target = items[activeIndex];\n if (target) {\n event.preventDefault();\n if (target.hasAttribute('data-sub-menu-item')) {\n target.focus();\n target.dispatchEvent(\n new KeyboardEvent('keydown', { key: 'ArrowRight', bubbles: true })\n );\n } else {\n target.click();\n }\n }\n }\n }\n );\n\n const _styles = ctx.getStyles('search');\n\n return (\n <Input\n data-autofocus\n data-mantine-stop-propagation\n type=\"search\"\n size={size}\n {...others}\n ref={mergedRef}\n classNames={[{ input: _styles.className }, classNames] as any}\n styles={[{ input: _styles.style }, styles] as any}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n __staticSelector=\"Menu\"\n />\n );\n});\n\nMenuSearch.classes = classes;\nMenuSearch.displayName = '@mantine/core/MenuSearch';\n"],"mappings":";;;;;;;;;;;AAOA,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IACrB,IAAI,OAAO,aAAa,oBAAoB,GAAG;KAC7C,OAAO,MAAM;KACb,OAAO,cACL,IAAI,cAAc,WAAW;MAAE,KAAK;MAAc,SAAS;KAAK,CAAC,CACnE;IACF,OACE,OAAO,MAAM;GAEjB;EACF;CACF,CACF;CAEA,MAAM,UAAU,IAAI,UAAU,QAAQ;CAEtC,OACE,oBAAC,OAAD;EACE,kBAAA;EACA,iCAAA;EACA,MAAK;EACC;EACN,GAAI;EACJ,KAAK;EACL,YAAY,CAAC,EAAE,OAAO,QAAQ,UAAU,GAAG,UAAU;EACrD,QAAQ,CAAC,EAAE,OAAO,QAAQ,MAAM,GAAG,MAAM;EACzC,WAAW;EACX,UAAU;EACV,kBAAiB;CAClB,CAAA;AAEL,CAAC;AAED,WAAW,UAAUA;AACrB,WAAW,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuSelectableItem.mjs","names":[],"sources":["../../../../src/components/Menu/MenuSelectableItem/MenuSelectableItem.tsx"],"sourcesContent":["import { use, useRef } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport {\n createEventHandler,\n createScopedKeydownHandler,\n MantineColor,\n parseThemeColor,\n useDirection,\n useMantineTheme,\n} from '../../../core';\nimport { UnstyledButton } from '../../UnstyledButton';\nimport { useMenuContext } from '../Menu.context';\nimport { SubMenuContext } from '../MenuSub/MenuSub.context';\n\nexport interface MenuSelectableItemProps {\n role: 'menuitemcheckbox' | 'menuitemradio';\n checked: boolean;\n indicator: React.ReactNode;\n onSelect: () => void;\n color: MantineColor | undefined;\n closeMenuOnClick: boolean | undefined;\n rightSection: React.ReactNode;\n children: React.ReactNode;\n disabled: boolean | undefined;\n dataDisabled: boolean | undefined;\n className: string | undefined;\n style: any;\n styles: any;\n classNames: any;\n buttonRef: React.Ref<HTMLButtonElement> | undefined;\n others: Record<string, any>;\n}\n\nexport function MenuSelectableItem({\n role,\n checked,\n indicator,\n onSelect,\n color,\n closeMenuOnClick,\n rightSection,\n children,\n disabled,\n dataDisabled,\n className,\n style,\n styles,\n classNames,\n buttonRef,\n others,\n}: MenuSelectableItemProps) {\n const ctx = useMenuContext();\n const subCtx = use(SubMenuContext);\n const theme = useMantineTheme();\n const { dir } = useDirection();\n const itemRef = useRef<HTMLButtonElement>(null);\n\n const handleClick = createEventHandler<any>(others.onClick, () => {\n if (dataDisabled) {\n return;\n }\n onSelect();\n if (closeMenuOnClick) {\n ctx.closeDropdownImmediately();\n }\n });\n\n const handleMouseMove = createEventHandler<any>(others.onMouseMove, () => {\n if (!ctx.hasSearch) {\n return;\n }\n const dropdown = itemRef.current?.closest('[data-menu-dropdown]');\n if (!dropdown) {\n return;\n }\n dropdown.querySelectorAll<HTMLElement>('[data-menu-active]').forEach((node) => {\n if (node !== itemRef.current && node.closest('[data-menu-dropdown]') === dropdown) {\n node.removeAttribute('data-menu-active');\n }\n });\n });\n\n const handleKeydown = createEventHandler<any>(others.onKeyDown, (event) => {\n if (event.key === 'ArrowLeft' && subCtx) {\n subCtx.close();\n subCtx.focusParentItem();\n }\n });\n\n const colors = color ? theme.variantColorResolver({ color, theme, variant: 'light' }) : undefined;\n const parsedThemeColor = color ? parseThemeColor({ color, theme }) : null;\n const renderIndicator = ctx.alignItemsLabels !== 'none' || checked;\n\n return (\n <UnstyledButton\n onMouseDown={(event) => event.preventDefault()}\n {...others}\n unstyled={ctx.unstyled}\n tabIndex={ctx.menuItemTabIndex}\n {...ctx.getStyles('item', { className, style, styles, classNames })}\n ref={useMergedRef(itemRef, buttonRef)}\n role={role}\n aria-checked={checked}\n disabled={disabled}\n data-menu-item\n data-checked={checked || undefined}\n data-disabled={disabled || dataDisabled || undefined}\n data-mantine-stop-propagation\n onClick={handleClick}\n onMouseMove={handleMouseMove}\n onKeyDown={createScopedKeydownHandler({\n siblingSelector: '[data-menu-item]:not([data-disabled])',\n parentSelector: '[data-menu-dropdown]',\n activateOnFocus: false,\n loop: ctx.loop,\n dir,\n orientation: 'vertical',\n onKeyDown: handleKeydown,\n })}\n __vars={{\n '--menu-item-color':\n parsedThemeColor?.isThemeColor && parsedThemeColor?.shade === undefined\n ? `var(--mantine-color-${parsedThemeColor.color}-6)`\n : colors?.color,\n '--menu-item-hover': colors?.hover,\n }}\n >\n {renderIndicator && (\n <div\n {...ctx.getStyles('itemIndicator', { styles, classNames })}\n data-checked={checked || undefined}\n >\n {checked ? indicator : null}\n </div>\n )}\n {children && (\n <div {...ctx.getStyles('itemLabel', { styles, classNames })} data-menu-item-label>\n {children}\n </div>\n )}\n {rightSection && (\n <div {...ctx.getStyles('itemSection', { styles, classNames })} data-position=\"right\">\n {rightSection}\n </div>\n )}\n </UnstyledButton>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAiCA,SAAgB,mBAAmB,EACjC,MACA,SACA,WACA,UACA,OACA,kBACA,cACA,UACA,UACA,cACA,WACA,OACA,QACA,YACA,WACA,UAC0B;CAC1B,MAAM,MAAM,eAAe;CAC3B,MAAM,SAAS,IAAI,cAAc;CACjC,MAAM,QAAQ,gBAAgB;CAC9B,MAAM,EAAE,QAAQ,aAAa;CAC7B,MAAM,UAAU,OAA0B,IAAI;CAE9C,MAAM,cAAc,mBAAwB,OAAO,eAAe;EAChE,IAAI,cACF;EAEF,SAAS;EACT,IAAI,kBACF,IAAI,yBAAyB;CAEjC,CAAC;CAED,MAAM,kBAAkB,mBAAwB,OAAO,mBAAmB;EACxE,IAAI,CAAC,IAAI,WACP;EAEF,MAAM,WAAW,QAAQ,SAAS,QAAQ,sBAAsB;EAChE,IAAI,CAAC,UACH;EAEF,SAAS,iBAA8B,oBAAoB,
|
|
1
|
+
{"version":3,"file":"MenuSelectableItem.mjs","names":[],"sources":["../../../../src/components/Menu/MenuSelectableItem/MenuSelectableItem.tsx"],"sourcesContent":["import { use, useRef } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport {\n createEventHandler,\n createScopedKeydownHandler,\n MantineColor,\n parseThemeColor,\n useDirection,\n useMantineTheme,\n} from '../../../core';\nimport { UnstyledButton } from '../../UnstyledButton';\nimport { useMenuContext } from '../Menu.context';\nimport { SubMenuContext } from '../MenuSub/MenuSub.context';\n\nexport interface MenuSelectableItemProps {\n role: 'menuitemcheckbox' | 'menuitemradio';\n checked: boolean;\n indicator: React.ReactNode;\n onSelect: () => void;\n color: MantineColor | undefined;\n closeMenuOnClick: boolean | undefined;\n rightSection: React.ReactNode;\n children: React.ReactNode;\n disabled: boolean | undefined;\n dataDisabled: boolean | undefined;\n className: string | undefined;\n style: any;\n styles: any;\n classNames: any;\n buttonRef: React.Ref<HTMLButtonElement> | undefined;\n others: Record<string, any>;\n}\n\nexport function MenuSelectableItem({\n role,\n checked,\n indicator,\n onSelect,\n color,\n closeMenuOnClick,\n rightSection,\n children,\n disabled,\n dataDisabled,\n className,\n style,\n styles,\n classNames,\n buttonRef,\n others,\n}: MenuSelectableItemProps) {\n const ctx = useMenuContext();\n const subCtx = use(SubMenuContext);\n const theme = useMantineTheme();\n const { dir } = useDirection();\n const itemRef = useRef<HTMLButtonElement>(null);\n\n const handleClick = createEventHandler<any>(others.onClick, () => {\n if (dataDisabled) {\n return;\n }\n onSelect();\n if (closeMenuOnClick) {\n ctx.closeDropdownImmediately();\n }\n });\n\n const handleMouseMove = createEventHandler<any>(others.onMouseMove, () => {\n if (!ctx.hasSearch) {\n return;\n }\n const dropdown = itemRef.current?.closest('[data-menu-dropdown]');\n if (!dropdown) {\n return;\n }\n dropdown.querySelectorAll<HTMLElement>('[data-menu-active]').forEach((node) => {\n if (node !== itemRef.current && node.closest('[data-menu-dropdown]') === dropdown) {\n node.removeAttribute('data-menu-active');\n }\n });\n });\n\n const handleKeydown = createEventHandler<any>(others.onKeyDown, (event) => {\n if (event.key === 'ArrowLeft' && subCtx) {\n subCtx.close();\n subCtx.focusParentItem();\n }\n });\n\n const colors = color ? theme.variantColorResolver({ color, theme, variant: 'light' }) : undefined;\n const parsedThemeColor = color ? parseThemeColor({ color, theme }) : null;\n const renderIndicator = ctx.alignItemsLabels !== 'none' || checked;\n\n return (\n <UnstyledButton\n onMouseDown={(event) => event.preventDefault()}\n {...others}\n unstyled={ctx.unstyled}\n tabIndex={ctx.menuItemTabIndex}\n {...ctx.getStyles('item', { className, style, styles, classNames })}\n ref={useMergedRef(itemRef, buttonRef)}\n role={role}\n aria-checked={checked}\n disabled={disabled}\n data-menu-item\n data-checked={checked || undefined}\n data-disabled={disabled || dataDisabled || undefined}\n data-mantine-stop-propagation\n onClick={handleClick}\n onMouseMove={handleMouseMove}\n onKeyDown={createScopedKeydownHandler({\n siblingSelector: '[data-menu-item]:not([data-disabled])',\n parentSelector: '[data-menu-dropdown]',\n activateOnFocus: false,\n loop: ctx.loop,\n dir,\n orientation: 'vertical',\n onKeyDown: handleKeydown,\n })}\n __vars={{\n '--menu-item-color':\n parsedThemeColor?.isThemeColor && parsedThemeColor?.shade === undefined\n ? `var(--mantine-color-${parsedThemeColor.color}-6)`\n : colors?.color,\n '--menu-item-hover': colors?.hover,\n }}\n >\n {renderIndicator && (\n <div\n {...ctx.getStyles('itemIndicator', { styles, classNames })}\n data-checked={checked || undefined}\n >\n {checked ? indicator : null}\n </div>\n )}\n {children && (\n <div {...ctx.getStyles('itemLabel', { styles, classNames })} data-menu-item-label>\n {children}\n </div>\n )}\n {rightSection && (\n <div {...ctx.getStyles('itemSection', { styles, classNames })} data-position=\"right\">\n {rightSection}\n </div>\n )}\n </UnstyledButton>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAiCA,SAAgB,mBAAmB,EACjC,MACA,SACA,WACA,UACA,OACA,kBACA,cACA,UACA,UACA,cACA,WACA,OACA,QACA,YACA,WACA,UAC0B;CAC1B,MAAM,MAAM,eAAe;CAC3B,MAAM,SAAS,IAAI,cAAc;CACjC,MAAM,QAAQ,gBAAgB;CAC9B,MAAM,EAAE,QAAQ,aAAa;CAC7B,MAAM,UAAU,OAA0B,IAAI;CAE9C,MAAM,cAAc,mBAAwB,OAAO,eAAe;EAChE,IAAI,cACF;EAEF,SAA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C,QAAQ;GACd,qBAAqB,QAAQ;EAC/B;YA/BF;GAiCG,mBACC,oBAAC,OAAD;IACE,GAAI,IAAI,UAAU,iBAAiB;KAAE;KAAQ;IAAW,CAAC;IACzD,gBAAc,WAAW,KAAA;cAExB,UAAU,YAAY;GACpB,CAAA;GAEN,YACC,oBAAC,OAAD;IAAK,GAAI,IAAI,UAAU,aAAa;KAAE;KAAQ;IAAW,CAAC;IAAG,wBAAA;IAC1D;GACE,CAAA;GAEN,gBACC,oBAAC,OAAD;IAAK,GAAI,IAAI,UAAU,eAAe;KAAE;KAAQ;IAAW,CAAC;IAAG,iBAAc;cAC1E;GACE,CAAA;EAEO;;AAEpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuSub.mjs","names":["useId"],"sources":["../../../../src/components/Menu/MenuSub/MenuSub.tsx"],"sourcesContent":["import { use, useCallback, useEffect, useRef } from 'react';\nimport {\n safePolygon,\n useFloating,\n useHover,\n useInteractions,\n type SafePolygonOptions,\n} from '@floating-ui/react';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport { ExtendComponent, Factory, useDirection, useProps } from '../../../core';\nimport {\n FloatingAxesOffsets,\n FloatingPosition,\n getFloatingPosition,\n} from '../../../utils/Floating';\nimport { __PopoverProps, Popover } from '../../Popover';\nimport { TransitionOverride } from '../../Transition';\nimport { useMenuContext } from '../Menu.context';\nimport { MenuSubDropdown } from '../MenuSubDropdown/MenuSubDropdown';\nimport { MenuSubItem } from '../MenuSubItem/MenuSubItem';\nimport { MenuSubTarget } from '../MenuSubTarget/MenuSubTarget';\nimport { SubMenuContext } from './MenuSub.context';\n\nexport type MenuSubFactory = Factory<{\n props: MenuSubProps;\n}>;\n\nexport interface MenuSubProps extends __PopoverProps {\n children: React.ReactNode;\n\n /** Controlled opened state */\n opened?: boolean;\n\n /** Called with current state when dropdown opens or closes */\n onChange?: (opened: boolean) => void;\n\n /** Open delay in ms, applicable when hover trigger is used */\n openDelay?: number;\n\n /** Close delay in ms, applicable when hover trigger is used */\n closeDelay?: number;\n\n /** Dropdown position relative to the target element @default 'right-start' */\n position?: FloatingPosition;\n\n /** Offset of the dropdown element @default 0 */\n offset?: number | FloatingAxesOffsets;\n\n /** Props passed down to the `Transition` component that used to animate dropdown presence, use to configure duration and animation type @default { duration: 0 } */\n transitionProps?: TransitionOverride;\n\n /** Determines whether submenu stays open while the cursor moves toward its dropdown. Pass an object to configure safe polygon behavior. @default true */\n safeAreaPolygon?: boolean | SafePolygonOptions;\n}\n\nconst defaultProps = {\n offset: 0,\n position: 'right-start',\n safeAreaPolygon: true,\n transitionProps: { duration: 0 },\n openDelay: 0,\n middlewares: {\n shift: {\n // Enable crossAxis shift to keep submenu dropdown within viewport bounds when positioned horizontally\n crossAxis: true,\n },\n },\n} satisfies Partial<MenuSubProps>;\n\nexport function MenuSub(_props: MenuSubProps) {\n const {\n children,\n closeDelay,\n openDelay,\n position,\n safeAreaPolygon,\n opened: openedProp,\n onChange,\n ...others\n } = useProps('MenuSub', defaultProps, _props);\n const id = useId();\n const [opened, setOpened] = useUncontrolled({\n value: openedProp,\n finalValue: false,\n onChange,\n });\n const parentSubCtx = use(SubMenuContext);\n const menuCtx = useMenuContext();\n const { dir } = useDirection();\n const resolvedPosition = getFloatingPosition(dir, position);\n\n const levelRegister = parentSubCtx?.registerOpenSub ?? menuCtx.registerOpenSub;\n\n const activeChildCloseRef = useRef<(() => void) | null>(null);\n const registerOpenSub = useCallback((closeFn: () => void) => {\n const prev = activeChildCloseRef.current;\n if (prev && prev !== closeFn) {\n prev();\n }\n activeChildCloseRef.current = closeFn;\n return () => {\n if (activeChildCloseRef.current === closeFn) {\n activeChildCloseRef.current = null;\n }\n };\n }, []);\n\n const setOpenedRef = useRef(setOpened);\n setOpenedRef.current = setOpened;\n\n const handleOpen = useCallback(() => setOpenedRef.current(true), []);\n const handleClose = useCallback(() => setOpenedRef.current(false), []);\n\n useEffect(() => {\n if (!opened) {\n return undefined;\n }\n\n return levelRegister(handleClose);\n }, [opened, levelRegister, handleClose]);\n\n const { context, refs } = useFloating({\n placement: resolvedPosition,\n open: opened,\n onOpenChange: (nextOpen) => {\n if (nextOpen) {\n handleOpen();\n } else {\n handleClose();\n }\n },\n });\n\n const { getReferenceProps, getFloatingProps } = useInteractions([\n useHover(context, {\n handleClose: safeAreaPolygon\n ? safePolygon(typeof safeAreaPolygon === 'object' ? safeAreaPolygon : undefined)\n : undefined,\n delay: { open: openDelay, close: closeDelay },\n }),\n ]);\n\n const focusFirstItem = () =>\n window.setTimeout(() => {\n document\n .getElementById(`${id}-dropdown`)\n ?.querySelectorAll<HTMLButtonElement>('[data-menu-item]:not([data-disabled])')[0]\n ?.focus();\n }, 16);\n\n const focusParentItem = () =>\n window.setTimeout(() => {\n document.getElementById(`${id}-target`)?.focus();\n }, 16);\n\n return (\n <SubMenuContext\n value={{\n opened,\n close: handleClose,\n open: handleOpen,\n focusFirstItem,\n focusParentItem,\n parentContext: parentSubCtx,\n setReference: refs.setReference,\n setFloating: refs.setFloating,\n getReferenceProps,\n getFloatingProps,\n registerOpenSub,\n }}\n >\n <Popover\n opened={opened}\n onChange={(nextOpened) => (nextOpened ? handleOpen() : handleClose())}\n withinPortal={false}\n withArrow={false}\n id={id}\n position={position}\n {...others}\n >\n {children}\n </Popover>\n </SubMenuContext>\n );\n}\n\nMenuSub.extend = (input: ExtendComponent<MenuSubFactory>) => input;\nMenuSub.displayName = '@mantine/core/MenuSub';\nMenuSub.Target = MenuSubTarget;\nMenuSub.Dropdown = MenuSubDropdown;\nMenuSub.Item = MenuSubItem;\n"],"mappings":";;;;;;;;;;;;;;;AAuDA,MAAM,eAAe;CACnB,QAAQ;CACR,UAAU;CACV,iBAAiB;CACjB,iBAAiB,EAAE,UAAU,EAAE;CAC/B,WAAW;CACX,aAAa,EACX,OAAO,EAEL,WAAW,KACb,EACF;AACF;AAEA,SAAgB,QAAQ,QAAsB;CAC5C,MAAM,EACJ,UACA,YACA,WACA,UACA,iBACA,QAAQ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e,GAAG,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"MenuSub.mjs","names":["useId"],"sources":["../../../../src/components/Menu/MenuSub/MenuSub.tsx"],"sourcesContent":["import { use, useCallback, useEffect, useRef } from 'react';\nimport {\n safePolygon,\n useFloating,\n useHover,\n useInteractions,\n type SafePolygonOptions,\n} from '@floating-ui/react';\nimport { useId, useUncontrolled } from '@mantine/hooks';\nimport { ExtendComponent, Factory, useDirection, useProps } from '../../../core';\nimport {\n FloatingAxesOffsets,\n FloatingPosition,\n getFloatingPosition,\n} from '../../../utils/Floating';\nimport { __PopoverProps, Popover } from '../../Popover';\nimport { TransitionOverride } from '../../Transition';\nimport { useMenuContext } from '../Menu.context';\nimport { MenuSubDropdown } from '../MenuSubDropdown/MenuSubDropdown';\nimport { MenuSubItem } from '../MenuSubItem/MenuSubItem';\nimport { MenuSubTarget } from '../MenuSubTarget/MenuSubTarget';\nimport { SubMenuContext } from './MenuSub.context';\n\nexport type MenuSubFactory = Factory<{\n props: MenuSubProps;\n}>;\n\nexport interface MenuSubProps extends __PopoverProps {\n children: React.ReactNode;\n\n /** Controlled opened state */\n opened?: boolean;\n\n /** Called with current state when dropdown opens or closes */\n onChange?: (opened: boolean) => void;\n\n /** Open delay in ms, applicable when hover trigger is used */\n openDelay?: number;\n\n /** Close delay in ms, applicable when hover trigger is used */\n closeDelay?: number;\n\n /** Dropdown position relative to the target element @default 'right-start' */\n position?: FloatingPosition;\n\n /** Offset of the dropdown element @default 0 */\n offset?: number | FloatingAxesOffsets;\n\n /** Props passed down to the `Transition` component that used to animate dropdown presence, use to configure duration and animation type @default { duration: 0 } */\n transitionProps?: TransitionOverride;\n\n /** Determines whether submenu stays open while the cursor moves toward its dropdown. Pass an object to configure safe polygon behavior. @default true */\n safeAreaPolygon?: boolean | SafePolygonOptions;\n}\n\nconst defaultProps = {\n offset: 0,\n position: 'right-start',\n safeAreaPolygon: true,\n transitionProps: { duration: 0 },\n openDelay: 0,\n middlewares: {\n shift: {\n // Enable crossAxis shift to keep submenu dropdown within viewport bounds when positioned horizontally\n crossAxis: true,\n },\n },\n} satisfies Partial<MenuSubProps>;\n\nexport function MenuSub(_props: MenuSubProps) {\n const {\n children,\n closeDelay,\n openDelay,\n position,\n safeAreaPolygon,\n opened: openedProp,\n onChange,\n ...others\n } = useProps('MenuSub', defaultProps, _props);\n const id = useId();\n const [opened, setOpened] = useUncontrolled({\n value: openedProp,\n finalValue: false,\n onChange,\n });\n const parentSubCtx = use(SubMenuContext);\n const menuCtx = useMenuContext();\n const { dir } = useDirection();\n const resolvedPosition = getFloatingPosition(dir, position);\n\n const levelRegister = parentSubCtx?.registerOpenSub ?? menuCtx.registerOpenSub;\n\n const activeChildCloseRef = useRef<(() => void) | null>(null);\n const registerOpenSub = useCallback((closeFn: () => void) => {\n const prev = activeChildCloseRef.current;\n if (prev && prev !== closeFn) {\n prev();\n }\n activeChildCloseRef.current = closeFn;\n return () => {\n if (activeChildCloseRef.current === closeFn) {\n activeChildCloseRef.current = null;\n }\n };\n }, []);\n\n const setOpenedRef = useRef(setOpened);\n setOpenedRef.current = setOpened;\n\n const handleOpen = useCallback(() => setOpenedRef.current(true), []);\n const handleClose = useCallback(() => setOpenedRef.current(false), []);\n\n useEffect(() => {\n if (!opened) {\n return undefined;\n }\n\n return levelRegister(handleClose);\n }, [opened, levelRegister, handleClose]);\n\n const { context, refs } = useFloating({\n placement: resolvedPosition,\n open: opened,\n onOpenChange: (nextOpen) => {\n if (nextOpen) {\n handleOpen();\n } else {\n handleClose();\n }\n },\n });\n\n const { getReferenceProps, getFloatingProps } = useInteractions([\n useHover(context, {\n handleClose: safeAreaPolygon\n ? safePolygon(typeof safeAreaPolygon === 'object' ? safeAreaPolygon : undefined)\n : undefined,\n delay: { open: openDelay, close: closeDelay },\n }),\n ]);\n\n const focusFirstItem = () =>\n window.setTimeout(() => {\n document\n .getElementById(`${id}-dropdown`)\n ?.querySelectorAll<HTMLButtonElement>('[data-menu-item]:not([data-disabled])')[0]\n ?.focus();\n }, 16);\n\n const focusParentItem = () =>\n window.setTimeout(() => {\n document.getElementById(`${id}-target`)?.focus();\n }, 16);\n\n return (\n <SubMenuContext\n value={{\n opened,\n close: handleClose,\n open: handleOpen,\n focusFirstItem,\n focusParentItem,\n parentContext: parentSubCtx,\n setReference: refs.setReference,\n setFloating: refs.setFloating,\n getReferenceProps,\n getFloatingProps,\n registerOpenSub,\n }}\n >\n <Popover\n opened={opened}\n onChange={(nextOpened) => (nextOpened ? handleOpen() : handleClose())}\n withinPortal={false}\n withArrow={false}\n id={id}\n position={position}\n {...others}\n >\n {children}\n </Popover>\n </SubMenuContext>\n );\n}\n\nMenuSub.extend = (input: ExtendComponent<MenuSubFactory>) => input;\nMenuSub.displayName = '@mantine/core/MenuSub';\nMenuSub.Target = MenuSubTarget;\nMenuSub.Dropdown = MenuSubDropdown;\nMenuSub.Item = MenuSubItem;\n"],"mappings":";;;;;;;;;;;;;;;AAuDA,MAAM,eAAe;CACnB,QAAQ;CACR,UAAU;CACV,iBAAiB;CACjB,iBAAiB,EAAE,UAAU,EAAE;CAC/B,WAAW;CACX,aAAa,EACX,OAAO,EAEL,WAAW,KACb,EACF;AACF;AAEA,SAAgB,QAAQ,QAAsB;CAC5C,MAAM,EACJ,UACA,YACA,WACA,UACA,iBACA,QAAQ,YACR,UACA,GAAG,WACD,SAAS,WAAW,cAAc,MAAM;CAC5C,MAAM,KAAKA,QAAM;CACjB,MAAM,CAAC,QAAQ,aAAa,gBAAgB;EAC1C,OAAO;EACP,YAAY;EACZ;CACF,CAAC;CACD,MAAM,eAAe,IAAI,cAAc;CACvC,MAAM,UAAU,eAAe;CAC/B,MAAM,EAAE,QAAQ,aAAa;CAC7B,MAAM,mBAAmB,oBAAoB,KAAK,QAAQ;CAE1D,MAAM,gBAAgB,cAAc,mBAAmB,QAAQ;CAE/D,MAAM,sBAAsB,OAA4B,IAAI;CAC5D,MAAM,kBAAkB,aAAa,YAAwB;EAC3D,MAAM,OAAO,oBAAoB;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;GACd,WAAW;GACP;GACM;GACV,GAAI;GAEH;EACM,CAAA;CACK,CAAA;AAEpB;AAEA,QAAQ,UAAU,UAA2C;AAC7D,QAAQ,cAAc;AACtB,QAAQ,SAAS;AACjB,QAAQ,WAAW;AACnB,QAAQ,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuSubItem.mjs","names":["classes"],"sources":["../../../../src/components/Menu/MenuSubItem/MenuSubItem.tsx"],"sourcesContent":["import { use, useRef } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport {\n BoxProps,\n CompoundStylesApiProps,\n createEventHandler,\n createScopedKeydownHandler,\n MantineColor,\n parseThemeColor,\n polymorphicFactory,\n PolymorphicFactory,\n useDirection,\n useMantineTheme,\n useProps,\n} from '../../../core';\nimport { AccordionChevron } from '../../Accordion';\nimport { UnstyledButton } from '../../UnstyledButton';\nimport { useMenuContext } from '../Menu.context';\nimport { SubMenuContext } from '../MenuSub/MenuSub.context';\nimport classes from '../Menu.module.css';\n\nexport type MenuSubItemStylesNames = 'item' | 'itemLabel' | 'itemSection' | 'itemIndicator';\n\nexport interface MenuSubItemProps extends BoxProps, CompoundStylesApiProps<MenuSubItemFactory> {\n 'data-disabled'?: boolean;\n\n /** Item label */\n children?: React.ReactNode;\n\n /** Key of `theme.colors` or any valid CSS color */\n color?: MantineColor;\n\n /** Section displayed at the start of the label */\n leftSection?: React.ReactNode;\n\n /** Section displayed at the end of the label */\n rightSection?: React.ReactNode;\n\n /** Sets disabled attribute, applies disabled styles */\n disabled?: boolean;\n\n /** If set, the menu is closed when the item is clicked. Overrides `closeOnItemClick` prop on the `Menu` component. */\n closeMenuOnClick?: boolean;\n}\n\nexport type MenuSubItemFactory = PolymorphicFactory<{\n props: MenuSubItemProps;\n defaultRef: HTMLButtonElement;\n defaultComponent: 'button';\n stylesNames: MenuSubItemStylesNames;\n compound: true;\n}>;\n\nexport const MenuSubItem = polymorphicFactory<MenuSubItemFactory>((props) => {\n const {\n classNames,\n className,\n style,\n styles,\n vars,\n color,\n leftSection,\n rightSection,\n children,\n disabled,\n 'data-disabled': dataDisabled,\n closeMenuOnClick,\n ref,\n ...others\n } = useProps('MenuSubItem', null, props);\n\n const ctx = useMenuContext();\n const subCtx = use(SubMenuContext);\n const theme = useMantineTheme();\n const { dir } = useDirection();\n const itemRef = useRef<HTMLButtonElement>(null);\n const _others: any = others;\n\n const colors = color ? theme.variantColorResolver({ color, theme, variant: 'light' }) : undefined;\n const parsedThemeColor = color ? parseThemeColor({ color, theme }) : null;\n\n const handleKeydown = createEventHandler<any>(_others.onKeyDown, (event) => {\n if (event.key === 'ArrowRight') {\n subCtx?.open();\n subCtx?.focusFirstItem();\n }\n\n if (event.key === 'ArrowLeft' && subCtx?.parentContext) {\n subCtx.parentContext.close();\n subCtx.parentContext.focusParentItem();\n }\n });\n\n const handleClick = createEventHandler(_others.onClick, () => {\n if (!dataDisabled && closeMenuOnClick) {\n ctx.closeDropdownImmediately();\n }\n });\n\n const handleMouseMove = createEventHandler<any>(_others.onMouseMove, () => {\n if (!ctx.hasSearch) {\n return;\n }\n const dropdown = itemRef.current?.closest('[data-menu-dropdown]');\n if (!dropdown) {\n return;\n }\n dropdown.querySelectorAll<HTMLElement>('[data-menu-active]').forEach((node) => {\n if (node !== itemRef.current && node.closest('[data-menu-dropdown]') === dropdown) {\n node.removeAttribute('data-menu-active');\n }\n });\n });\n\n const referenceProps = subCtx?.getReferenceProps({\n onMouseEnter: _others.onMouseEnter,\n onMouseLeave: _others.onMouseLeave,\n onPointerEnter: _others.onPointerEnter,\n onPointerLeave: _others.onPointerLeave,\n });\n\n return (\n <UnstyledButton\n onMouseDown={(event) => event.preventDefault()}\n {...others}\n {...referenceProps}\n unstyled={ctx.unstyled}\n tabIndex={ctx.menuItemTabIndex}\n {...ctx.getStyles('item', { className, style, styles, classNames })}\n ref={useMergedRef(itemRef, ref, subCtx?.setReference)}\n role=\"menuitem\"\n disabled={disabled}\n data-menu-item\n data-sub-menu-item\n data-disabled={disabled || dataDisabled || undefined}\n data-mantine-stop-propagation\n onClick={handleClick}\n onMouseMove={handleMouseMove}\n onKeyDown={createScopedKeydownHandler({\n siblingSelector: '[data-menu-item]:not([data-disabled])',\n parentSelector: '[data-menu-dropdown]',\n activateOnFocus: false,\n loop: ctx.loop,\n dir,\n orientation: 'vertical',\n onKeyDown: handleKeydown,\n })}\n __vars={{\n '--menu-item-color':\n parsedThemeColor?.isThemeColor && parsedThemeColor?.shade === undefined\n ? `var(--mantine-color-${parsedThemeColor.color}-6)`\n : colors?.color,\n '--menu-item-hover': colors?.hover,\n }}\n >\n {ctx.alignItemsLabels === 'all' && (\n <div {...ctx.getStyles('itemIndicator', { styles, classNames })} data-placeholder />\n )}\n {leftSection && (\n <div {...ctx.getStyles('itemSection', { styles, classNames })} data-position=\"left\">\n {leftSection}\n </div>\n )}\n\n {children && (\n <div {...ctx.getStyles('itemLabel', { styles, classNames })} data-menu-item-label>\n {children}\n </div>\n )}\n\n <div {...ctx.getStyles('itemSection', { styles, classNames })} data-position=\"right\">\n {rightSection || <AccordionChevron {...ctx.getStyles('chevron')} size={14} />}\n </div>\n </UnstyledButton>\n );\n});\n\nMenuSubItem.classes = classes;\nMenuSubItem.displayName = '@mantine/core/MenuSubItem';\n"],"mappings":";;;;;;;;;;;;;;;;;AAqDA,MAAa,cAAc,oBAAwC,UAAU;CAC3E,MAAM,EACJ,YACA,WACA,OACA,QACA,MACA,OACA,aACA,cACA,UACA,UACA,iBAAiB,cACjB,kBACA,KACA,GAAG,WACD,SAAS,eAAe,MAAM,KAAK;CAEvC,MAAM,MAAM,eAAe;CAC3B,MAAM,SAAS,IAAI,cAAc;CACjC,MAAM,QAAQ,gBAAgB;CAC9B,MAAM,EAAE,QAAQ,aAAa;CAC7B,MAAM,UAAU,OAA0B,IAAI;CAC9C,MAAM,UAAe;CAErB,MAAM,SAAS,QAAQ,MAAM,qBAAqB;EAAE;EAAO;EAAO,SAAS;CAAQ,CAAC,IAAI,KAAA;CACxF,MAAM,mBAAmB,QAAQ,gBAAgB;EAAE;EAAO;CAAM,CAAC,IAAI;CAErE,MAAM,gBAAgB,mBAAwB,QAAQ,YAAY,UAAU;EAC1E,IAAI,MAAM,QAAQ,cAAc;GAC9B,QAAQ,KAAK;GACb,QAAQ,eAAe;EACzB;EAEA,IAAI,MAAM,QAAQ,eAAe,QAAQ,eAAe;GACtD,OAAO,cAAc,MAAM;GAC3B,OAAO,cAAc,gBAAgB;EACvC;CACF,CAAC;CAED,MAAM,cAAc,mBAAmB,QAAQ,eAAe;EAC5D,IAAI,CAAC,gBAAgB,kBACnB,IAAI,yBAAyB;CAEjC,CAAC;CAED,MAAM,kBAAkB,mBAAwB,QAAQ,mBAAmB;EACzE,IAAI,CAAC,IAAI,WACP;EAEF,MAAM,WAAW,QAAQ,SAAS,QAAQ,sBAAsB;EAChE,IAAI,CAAC,UACH;EAEF,SAAS,iBAA8B,oBAAoB,
|
|
1
|
+
{"version":3,"file":"MenuSubItem.mjs","names":["classes"],"sources":["../../../../src/components/Menu/MenuSubItem/MenuSubItem.tsx"],"sourcesContent":["import { use, useRef } from 'react';\nimport { useMergedRef } from '@mantine/hooks';\nimport {\n BoxProps,\n CompoundStylesApiProps,\n createEventHandler,\n createScopedKeydownHandler,\n MantineColor,\n parseThemeColor,\n polymorphicFactory,\n PolymorphicFactory,\n useDirection,\n useMantineTheme,\n useProps,\n} from '../../../core';\nimport { AccordionChevron } from '../../Accordion';\nimport { UnstyledButton } from '../../UnstyledButton';\nimport { useMenuContext } from '../Menu.context';\nimport { SubMenuContext } from '../MenuSub/MenuSub.context';\nimport classes from '../Menu.module.css';\n\nexport type MenuSubItemStylesNames = 'item' | 'itemLabel' | 'itemSection' | 'itemIndicator';\n\nexport interface MenuSubItemProps extends BoxProps, CompoundStylesApiProps<MenuSubItemFactory> {\n 'data-disabled'?: boolean;\n\n /** Item label */\n children?: React.ReactNode;\n\n /** Key of `theme.colors` or any valid CSS color */\n color?: MantineColor;\n\n /** Section displayed at the start of the label */\n leftSection?: React.ReactNode;\n\n /** Section displayed at the end of the label */\n rightSection?: React.ReactNode;\n\n /** Sets disabled attribute, applies disabled styles */\n disabled?: boolean;\n\n /** If set, the menu is closed when the item is clicked. Overrides `closeOnItemClick` prop on the `Menu` component. */\n closeMenuOnClick?: boolean;\n}\n\nexport type MenuSubItemFactory = PolymorphicFactory<{\n props: MenuSubItemProps;\n defaultRef: HTMLButtonElement;\n defaultComponent: 'button';\n stylesNames: MenuSubItemStylesNames;\n compound: true;\n}>;\n\nexport const MenuSubItem = polymorphicFactory<MenuSubItemFactory>((props) => {\n const {\n classNames,\n className,\n style,\n styles,\n vars,\n color,\n leftSection,\n rightSection,\n children,\n disabled,\n 'data-disabled': dataDisabled,\n closeMenuOnClick,\n ref,\n ...others\n } = useProps('MenuSubItem', null, props);\n\n const ctx = useMenuContext();\n const subCtx = use(SubMenuContext);\n const theme = useMantineTheme();\n const { dir } = useDirection();\n const itemRef = useRef<HTMLButtonElement>(null);\n const _others: any = others;\n\n const colors = color ? theme.variantColorResolver({ color, theme, variant: 'light' }) : undefined;\n const parsedThemeColor = color ? parseThemeColor({ color, theme }) : null;\n\n const handleKeydown = createEventHandler<any>(_others.onKeyDown, (event) => {\n if (event.key === 'ArrowRight') {\n subCtx?.open();\n subCtx?.focusFirstItem();\n }\n\n if (event.key === 'ArrowLeft' && subCtx?.parentContext) {\n subCtx.parentContext.close();\n subCtx.parentContext.focusParentItem();\n }\n });\n\n const handleClick = createEventHandler(_others.onClick, () => {\n if (!dataDisabled && closeMenuOnClick) {\n ctx.closeDropdownImmediately();\n }\n });\n\n const handleMouseMove = createEventHandler<any>(_others.onMouseMove, () => {\n if (!ctx.hasSearch) {\n return;\n }\n const dropdown = itemRef.current?.closest('[data-menu-dropdown]');\n if (!dropdown) {\n return;\n }\n dropdown.querySelectorAll<HTMLElement>('[data-menu-active]').forEach((node) => {\n if (node !== itemRef.current && node.closest('[data-menu-dropdown]') === dropdown) {\n node.removeAttribute('data-menu-active');\n }\n });\n });\n\n const referenceProps = subCtx?.getReferenceProps({\n onMouseEnter: _others.onMouseEnter,\n onMouseLeave: _others.onMouseLeave,\n onPointerEnter: _others.onPointerEnter,\n onPointerLeave: _others.onPointerLeave,\n });\n\n return (\n <UnstyledButton\n onMouseDown={(event) => event.preventDefault()}\n {...others}\n {...referenceProps}\n unstyled={ctx.unstyled}\n tabIndex={ctx.menuItemTabIndex}\n {...ctx.getStyles('item', { className, style, styles, classNames })}\n ref={useMergedRef(itemRef, ref, subCtx?.setReference)}\n role=\"menuitem\"\n disabled={disabled}\n data-menu-item\n data-sub-menu-item\n data-disabled={disabled || dataDisabled || undefined}\n data-mantine-stop-propagation\n onClick={handleClick}\n onMouseMove={handleMouseMove}\n onKeyDown={createScopedKeydownHandler({\n siblingSelector: '[data-menu-item]:not([data-disabled])',\n parentSelector: '[data-menu-dropdown]',\n activateOnFocus: false,\n loop: ctx.loop,\n dir,\n orientation: 'vertical',\n onKeyDown: handleKeydown,\n })}\n __vars={{\n '--menu-item-color':\n parsedThemeColor?.isThemeColor && parsedThemeColor?.shade === undefined\n ? `var(--mantine-color-${parsedThemeColor.color}-6)`\n : colors?.color,\n '--menu-item-hover': colors?.hover,\n }}\n >\n {ctx.alignItemsLabels === 'all' && (\n <div {...ctx.getStyles('itemIndicator', { styles, classNames })} data-placeholder />\n )}\n {leftSection && (\n <div {...ctx.getStyles('itemSection', { styles, classNames })} data-position=\"left\">\n {leftSection}\n </div>\n )}\n\n {children && (\n <div {...ctx.getStyles('itemLabel', { styles, classNames })} data-menu-item-label>\n {children}\n </div>\n )}\n\n <div {...ctx.getStyles('itemSection', { styles, classNames })} data-position=\"right\">\n {rightSection || <AccordionChevron {...ctx.getStyles('chevron')} size={14} />}\n </div>\n </UnstyledButton>\n );\n});\n\nMenuSubItem.classes = classes;\nMenuSubItem.displayName = '@mantine/core/MenuSubItem';\n"],"mappings":";;;;;;;;;;;;;;;;;AAqDA,MAAa,cAAc,oBAAwC,UA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u-type-ahead.mjs","names":[],"sources":["../../../src/components/Menu/use-menu-type-ahead.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\nconst RESET_DELAY = 500;\n\ninterface UseMenuTypeAheadOptions {\n enabled: boolean;\n opened: boolean;\n getDropdown: () => HTMLElement | null;\n}\n\ninterface TypeAheadState {\n buffer: string;\n timeoutId: number | null;\n}\n\nfunction getItemText(item: HTMLElement): string {\n const label = item.querySelector<HTMLElement>('[data-menu-item-label]');\n return ((label ?? item).textContent ?? '').trim().toLowerCase();\n}\n\nfunction isRepeatedChar(buffer: string): boolean {\n return buffer.length > 1 && buffer.split('').every((char) => char === buffer[0]);\n}\n\nexport function useMenuTypeAhead({ enabled, opened, getDropdown }: UseMenuTypeAheadOptions) {\n const stateRef = useRef<TypeAheadState>({ buffer: '', timeoutId: null });\n\n useEffect(() => {\n if (opened && enabled) {\n return;\n }\n const state = stateRef.current;\n if (state.timeoutId !== null) {\n window.clearTimeout(state.timeoutId);\n state.timeoutId = null;\n }\n state.buffer = '';\n }, [opened, enabled]);\n\n useEffect(\n () => () => {\n const { timeoutId } = stateRef.current;\n if (timeoutId !== null) {\n window.clearTimeout(timeoutId);\n }\n },\n []\n );\n\n return (event: React.KeyboardEvent<HTMLElement>) => {\n if (!enabled || event.defaultPrevented) {\n return;\n }\n if (event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n if (event.key.length !== 1 || event.key === ' ') {\n return;\n }\n\n const target = event.target as HTMLElement | null;\n if (\n target &&\n (target.tagName === 'INPUT' ||\n target.tagName === 'TEXTAREA' ||\n target.tagName === 'SELECT' ||\n target.isContentEditable)\n ) {\n return;\n }\n\n const dropdown = getDropdown();\n if (!dropdown) {\n return;\n }\n\n const items = Array.from(\n dropdown.querySelectorAll<HTMLElement>('[data-menu-item]:not([data-disabled])')\n ).filter((item) => item.closest('[data-menu-dropdown]') === dropdown);\n\n if (items.length === 0) {\n return;\n }\n\n const state = stateRef.current;\n state.buffer = (state.buffer + event.key).toLowerCase();\n\n if (state.timeoutId !== null) {\n window.clearTimeout(state.timeoutId);\n }\n state.timeoutId = window.setTimeout(() => {\n state.buffer = '';\n state.timeoutId = null;\n }, RESET_DELAY);\n\n const activeElement = document.activeElement as HTMLElement | null;\n const currentIndex = activeElement ? items.indexOf(activeElement) : -1;\n\n let match: HTMLElement | null = null;\n\n if (state.buffer.length === 1 || isRepeatedChar(state.buffer)) {\n const char = state.buffer[0]!;\n const startIndex = currentIndex + 1;\n for (let i = 0; i < items.length; i += 1) {\n const idx = (startIndex + i) % items.length;\n if (getItemText(items[idx]!).startsWith(char)) {\n match = items[idx]!;\n break;\n }\n }\n } else {\n for (let i = 0; i < items.length; i += 1) {\n if (getItemText(items[i]!).startsWith(state.buffer)) {\n match = items[i]!;\n break;\n }\n }\n }\n\n if (match) {\n event.preventDefault();\n match.focus();\n }\n };\n}\n"],"mappings":";;;AAEA,MAAM,cAAc;AAapB,SAAS,YAAY,MAA2B;CAE9C,SADc,KAAK,cAA2B,wBACjC,KAAK,
|
|
1
|
+
{"version":3,"file":"use-menu-type-ahead.mjs","names":[],"sources":["../../../src/components/Menu/use-menu-type-ahead.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\nconst RESET_DELAY = 500;\n\ninterface UseMenuTypeAheadOptions {\n enabled: boolean;\n opened: boolean;\n getDropdown: () => HTMLElement | null;\n}\n\ninterface TypeAheadState {\n buffer: string;\n timeoutId: number | null;\n}\n\nfunction getItemText(item: HTMLElement): string {\n const label = item.querySelector<HTMLElement>('[data-menu-item-label]');\n return ((label ?? item).textContent ?? '').trim().toLowerCase();\n}\n\nfunction isRepeatedChar(buffer: string): boolean {\n return buffer.length > 1 && buffer.split('').every((char) => char === buffer[0]);\n}\n\nexport function useMenuTypeAhead({ enabled, opened, getDropdown }: UseMenuTypeAheadOptions) {\n const stateRef = useRef<TypeAheadState>({ buffer: '', timeoutId: null });\n\n useEffect(() => {\n if (opened && enabled) {\n return;\n }\n const state = stateRef.current;\n if (state.timeoutId !== null) {\n window.clearTimeout(state.timeoutId);\n state.timeoutId = null;\n }\n state.buffer = '';\n }, [opened, enabled]);\n\n useEffect(\n () => () => {\n const { timeoutId } = stateRef.current;\n if (timeoutId !== null) {\n window.clearTimeout(timeoutId);\n }\n },\n []\n );\n\n return (event: React.KeyboardEvent<HTMLElement>) => {\n if (!enabled || event.defaultPrevented) {\n return;\n }\n if (event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n if (event.key.length !== 1 || event.key === ' ') {\n return;\n }\n\n const target = event.target as HTMLElement | null;\n if (\n target &&\n (target.tagName === 'INPUT' ||\n target.tagName === 'TEXTAREA' ||\n target.tagName === 'SELECT' ||\n target.isContentEditable)\n ) {\n return;\n }\n\n const dropdown = getDropdown();\n if (!dropdown) {\n return;\n }\n\n const items = Array.from(\n dropdown.querySelectorAll<HTMLElement>('[data-menu-item]:not([data-disabled])')\n ).filter((item) => item.closest('[data-menu-dropdown]') === dropdown);\n\n if (items.length === 0) {\n return;\n }\n\n const state = stateRef.current;\n state.buffer = (state.buffer + event.key).toLowerCase();\n\n if (state.timeoutId !== null) {\n window.clearTimeout(state.timeoutId);\n }\n state.timeoutId = window.setTimeout(() => {\n state.buffer = '';\n state.timeoutId = null;\n }, RESET_DELAY);\n\n const activeElement = document.activeElement as HTMLElement | null;\n const currentIndex = activeElement ? items.indexOf(activeElement) : -1;\n\n let match: HTMLElement | null = null;\n\n if (state.buffer.length === 1 || isRepeatedChar(state.buffer)) {\n const char = state.buffer[0]!;\n const startIndex = currentIndex + 1;\n for (let i = 0; i < items.length; i += 1) {\n const idx = (startIndex + i) % items.length;\n if (getItemText(items[idx]!).startsWith(char)) {\n match = items[idx]!;\n break;\n }\n }\n } else {\n for (let i = 0; i < items.length; i += 1) {\n if (getItemText(items[i]!).startsWith(state.buffer)) {\n match = items[i]!;\n break;\n }\n }\n }\n\n if (match) {\n event.preventDefault();\n match.focus();\n }\n };\n}\n"],"mappings":";;;AAEA,MAAM,cAAc;AAapB,SAAS,Y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ACtB,OAAO,aAAa,MAAM,SAAS;EAErC,MAAM,YAAY,OAAO,iBAAiB;GACxC,MAAM,SAAS;GACf,MAAM,YAAY;EACpB,GAAG,WAAW;EAEd,MAAM,gBAAgB,SAAS;EAC/B,MAAM,eAAe,gBAAgB,MAAM,QAAQ,aAAa,IAAI;EAEpE,IAAI,QAA4B;EAEhC,IAAI,MAAM,OAAO,WAAW,KAAK,eAAe,MAAM,MAAM,GAAG;GAC7D,MAAM,OAAO,MAAM,OAAO;GAC1B,MAAM,aAAa,eAAe;GAClC,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GAAG;IACxC,MAAM,OAAO,aAAa,KAAK,MAAM;IACrC,IAAI,YAAY,MAAM,IAAK,CAAC,CAAC,WAAW,IAAI,GAAG;KAC7C,QAAQ,MAAM;KACd;IACF;GACF;EACF,OACE,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GACrC,IAAI,YAAY,MAAM,EAAG,CAAC,CAAC,WAAW,MAAM,MAAM,GAAG;GACnD,QAAQ,MAAM;GACd;EACF;EAIJ,IAAI,OAAO;GACT,MAAM,eAAe;GACrB,MAAM,MAAM;EACd;CACF;AACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createSafeContext } from "../../core/utils/create-safe-context/create-safe-context.mjs";
|
|
3
|
+
//#region packages/@mantine/core/src/components/Menubar/Menubar.context.ts
|
|
4
|
+
const [MenubarContextProvider, useMenubarContext] = createSafeContext("Menubar component was not found in the tree");
|
|
5
|
+
const [MenubarMenuContextProvider, useMenubarMenuContext] = createSafeContext("Menubar.Menu component was not found in the tree");
|
|
6
|
+
//#endregion
|
|
7
|
+
export { MenubarContextProvider, MenubarMenuContextProvider, useMenubarContext, useMenubarMenuContext };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=Menubar.context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menubar.context.mjs","names":[],"sources":["../../../src/components/Menubar/Menubar.context.ts"],"sourcesContent":["import { createSafeContext, GetStylesApi } from '../../core';\nimport type { FloatingPosition } from '../../utils/Floating';\nimport type { MenubarFactory } from './Menubar';\n\nexport interface MenubarContextValue {\n getStyles: GetStylesApi<MenubarFactory>;\n\n /** Unique id of the menubar instance, used to scope dropdown lookups across multiple menubars */\n id: string;\n\n /** Index of the currently opened menu, `null` when all menus are closed */\n openIndex: number | null;\n\n /** Opens the menu at the given index, `null` closes all menus */\n setOpenIndex: (index: number | null) => void;\n\n /** Opens the menu at the given index and records whether it was opened by click or hover */\n openMenu: (index: number, source: 'click' | 'hover') => void;\n\n /** Closes all menus */\n closeMenu: () => void;\n\n /** Schedules a delayed close, used by hover trigger when the pointer leaves the bar */\n scheduleClose: () => void;\n\n /** Cancels a pending delayed close */\n cancelClose: () => void;\n\n /** Returns how the currently opened menu was opened */\n getOpenSource: () => 'click' | 'hover' | null;\n\n /** Returns the previously opened menu index, used to skip transitions when switching menus */\n getPreviousOpenIndex: () => number | null;\n\n /** Index of the menu that currently holds the single menubar tab stop */\n activeIndex: number;\n\n /** Sets the roving tabindex to the given menu index */\n setActiveIndex: (index: number) => void;\n\n trigger: 'click' | 'hover';\n loop: boolean;\n position: FloatingPosition;\n unstyled: boolean | undefined;\n\n /** Returns the DOM-order index of a `Menubar.Menu` by its id */\n getMenuIndex: (id: string) => number;\n\n /** Returns all top-level target buttons in DOM order */\n getTargets: () => HTMLButtonElement[];\n\n /** Returns the indexes of the enabled top-level targets in DOM order */\n getEnabledIndexes: () => number[];\n\n /** Returns the index of the next/previous enabled target relative to `current` */\n getAdjacentIndex: (current: number, direction: 1 | -1) => number;\n\n /** Focuses the top-level target at the given index */\n focusTarget: (index: number) => void;\n\n /** Focuses the first or last item of the (opened) menu at the given index */\n focusMenuItem: (index: number, position: 'first' | 'last') => void;\n}\n\nexport const [MenubarContextProvider, useMenubarContext] = createSafeContext<MenubarContextValue>(\n 'Menubar component was not found in the tree'\n);\n\nexport interface MenubarMenuContextValue {\n id: string;\n index: number;\n opened: boolean;\n}\n\nexport const [MenubarMenuContextProvider, useMenubarMenuContext] =\n createSafeContext<MenubarMenuContextValue>('Menubar.Menu component was not found in the tree');\n"],"mappings":";;;AAgEA,MAAa,CAAC,wBAAwB,qBAAqB,kBACzD,6CACF;AAQA,MAAa,CAAC,4BAA4B,yBACxC,kBAA2C,kDAAkD"}
|