material-plus-ui 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/components/accordion/MPAccordion.d.ts +1 -1
- package/dist/components/accordion/MPAccordion.js +2 -1
- package/dist/components/accordion/index.d.ts +2 -2
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/alert/MPAlert.d.ts +27 -1
- package/dist/components/alert/MPAlert.js +2 -1
- package/dist/components/alert/index.d.ts +2 -2
- package/dist/components/alert/index.js +1 -1
- package/dist/components/animate-appear/MPAnimateAppear.d.ts +1 -1
- package/dist/components/animate-appear/MPAnimateAppear.js +2 -1
- package/dist/components/animate-appear/index.d.ts +2 -2
- package/dist/components/animate-appear/index.js +1 -1
- package/dist/components/animate-blink/MPAnimateBlink.d.ts +1 -1
- package/dist/components/animate-blink/MPAnimateBlink.js +1 -1
- package/dist/components/animate-blink/index.d.ts +2 -2
- package/dist/components/animate-blink/index.js +1 -1
- package/dist/components/animate-fade/MPAnimateFade.d.ts +1 -1
- package/dist/components/animate-fade/MPAnimateFade.js +1 -1
- package/dist/components/animate-fade/index.d.ts +2 -2
- package/dist/components/animate-fade/index.js +1 -1
- package/dist/components/animate-grow/MPAnimateGrow.d.ts +1 -1
- package/dist/components/animate-grow/MPAnimateGrow.js +1 -1
- package/dist/components/animate-grow/index.d.ts +2 -2
- package/dist/components/animate-grow/index.js +1 -1
- package/dist/components/animate-headline/MPAnimateHeadline.d.ts +1 -1
- package/dist/components/animate-headline/MPAnimateHeadline.js +2 -1
- package/dist/components/animate-headline/index.d.ts +2 -2
- package/dist/components/animate-headline/index.js +1 -1
- package/dist/components/animate-lighting/MPAnimateLighting.d.ts +1 -1
- package/dist/components/animate-lighting/MPAnimateLighting.js +1 -1
- package/dist/components/animate-lighting/index.d.ts +2 -2
- package/dist/components/animate-lighting/index.js +1 -1
- package/dist/components/animate-marquee/MPAnimateMarquee.d.ts +1 -1
- package/dist/components/animate-marquee/MPAnimateMarquee.js +2 -1
- package/dist/components/animate-marquee/index.d.ts +2 -2
- package/dist/components/animate-marquee/index.js +1 -1
- package/dist/components/animate-rotate/MPAnimateRotate.d.ts +1 -1
- package/dist/components/animate-rotate/MPAnimateRotate.js +1 -1
- package/dist/components/animate-rotate/index.d.ts +2 -2
- package/dist/components/animate-rotate/index.js +1 -1
- package/dist/components/animate-slide/MPAnimateSlide.d.ts +1 -1
- package/dist/components/animate-slide/MPAnimateSlide.js +1 -1
- package/dist/components/animate-slide/index.d.ts +2 -2
- package/dist/components/animate-slide/index.js +1 -1
- package/dist/components/animate-typing/MPAnimateTyping.d.ts +1 -1
- package/dist/components/animate-typing/MPAnimateTyping.js +2 -1
- package/dist/components/animate-typing/index.d.ts +2 -2
- package/dist/components/animate-typing/index.js +1 -1
- package/dist/components/animate-zoom/MPAnimateZoom.d.ts +1 -1
- package/dist/components/animate-zoom/MPAnimateZoom.js +1 -1
- package/dist/components/animate-zoom/index.d.ts +2 -2
- package/dist/components/animate-zoom/index.js +1 -1
- package/dist/components/aspect-ratio/MPAspectRatio.d.ts +1 -1
- package/dist/components/aspect-ratio/MPAspectRatio.js +1 -1
- package/dist/components/aspect-ratio/index.d.ts +2 -2
- package/dist/components/aspect-ratio/index.js +1 -1
- package/dist/components/avatar/MPAvatar.d.ts +1 -1
- package/dist/components/avatar/MPAvatar.js +2 -1
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar-group/MPAvatarGroup.d.ts +74 -0
- package/dist/components/avatar-group/MPAvatarGroup.js +2 -0
- package/dist/components/avatar-group/index.d.ts +2 -0
- package/dist/components/avatar-group/index.js +1 -0
- package/dist/components/badge/MPBadge.d.ts +1 -1
- package/dist/components/badge/MPBadge.js +2 -1
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/badge/index.js +1 -1
- package/dist/components/blockquote/MPBlockquote.d.ts +1 -1
- package/dist/components/blockquote/MPBlockquote.js +2 -1
- package/dist/components/blockquote/index.d.ts +2 -2
- package/dist/components/blockquote/index.js +1 -1
- package/dist/components/bottom-navigation/MPBottomNavigation.d.ts +1 -1
- package/dist/components/bottom-navigation/MPBottomNavigation.js +2 -1
- package/dist/components/bottom-navigation/index.d.ts +2 -2
- package/dist/components/bottom-navigation/index.js +1 -1
- package/dist/components/box/MPBox.d.ts +1 -1
- package/dist/components/box/MPBox.js +1 -1
- package/dist/components/box/index.d.ts +2 -2
- package/dist/components/box/index.js +1 -1
- package/dist/components/breadcrumb/MPBreadcrumb.d.ts +11 -5
- package/dist/components/breadcrumb/MPBreadcrumb.js +2 -1
- package/dist/components/breadcrumb/index.d.ts +2 -2
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button/MPButton.d.ts +1 -1
- package/dist/components/button/MPButton.js +2 -1
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/index.js +1 -1
- package/dist/components/button-group/MPButtonGroup.d.ts +10 -1
- package/dist/components/button-group/MPButtonGroup.js +2 -1
- package/dist/components/button-group/index.d.ts +2 -2
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/card/MPCard.d.ts +1 -1
- package/dist/components/card/MPCard.js +2 -1
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/card/index.js +1 -1
- package/dist/components/carousel/MPCarousel.d.ts +13 -8
- package/dist/components/carousel/MPCarousel.js +2 -1
- package/dist/components/carousel/index.d.ts +2 -2
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/chat-bubble/MPChatBubble.d.ts +16 -3
- package/dist/components/chat-bubble/MPChatBubble.js +2 -1
- package/dist/components/chat-bubble/index.d.ts +2 -2
- package/dist/components/chat-bubble/index.js +1 -1
- package/dist/components/checkbox/MPCheckbox.d.ts +1 -1
- package/dist/components/checkbox/MPCheckbox.js +2 -1
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/chip/MPChip.d.ts +1 -1
- package/dist/components/chip/MPChip.js +2 -1
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/chip/index.js +1 -1
- package/dist/components/collapsible/MPCollapsible.d.ts +1 -1
- package/dist/components/collapsible/MPCollapsible.js +2 -1
- package/dist/components/collapsible/index.d.ts +2 -2
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/color-picker/MPColorPicker.d.ts +22 -19
- package/dist/components/color-picker/MPColorPicker.js +2 -1
- package/dist/components/color-picker/index.d.ts +2 -2
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/MPCombobox.d.ts +23 -5
- package/dist/components/combobox/MPCombobox.js +2 -1
- package/dist/components/combobox/index.d.ts +2 -2
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/MPCommandPalette.d.ts +132 -0
- package/dist/components/command-palette/MPCommandPalette.js +2 -0
- package/dist/components/command-palette/index.d.ts +2 -0
- package/dist/components/command-palette/index.js +1 -0
- package/dist/components/container/MPContainer.d.ts +1 -1
- package/dist/components/container/MPContainer.js +1 -1
- package/dist/components/container/index.d.ts +2 -2
- package/dist/components/container/index.js +1 -1
- package/dist/components/date-picker/MPDatePicker.d.ts +3 -3
- package/dist/components/date-picker/MPDatePicker.js +2 -1
- package/dist/components/date-picker/index.d.ts +2 -2
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/MPDateRangePicker.d.ts +3 -3
- package/dist/components/date-range-picker/MPDateRangePicker.js +2 -1
- package/dist/components/date-range-picker/index.d.ts +2 -2
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/MPDateTimePicker.d.ts +9 -4
- package/dist/components/date-time-picker/MPDateTimePicker.js +2 -1
- package/dist/components/date-time-picker/index.d.ts +2 -2
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/dialog/MPDialog.d.ts +1 -1
- package/dist/components/dialog/MPDialog.js +2 -1
- package/dist/components/dialog/index.d.ts +2 -2
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/divider/MPDivider.d.ts +1 -1
- package/dist/components/divider/MPDivider.js +2 -1
- package/dist/components/divider/index.d.ts +2 -2
- package/dist/components/divider/index.js +1 -1
- package/dist/components/drawer/MPDrawer.d.ts +1 -1
- package/dist/components/drawer/MPDrawer.js +2 -1
- package/dist/components/drawer/index.d.ts +2 -2
- package/dist/components/drawer/index.js +1 -1
- package/dist/components/empty/MPEmpty.d.ts +1 -1
- package/dist/components/empty/MPEmpty.js +2 -1
- package/dist/components/empty/index.d.ts +2 -2
- package/dist/components/empty/index.js +1 -1
- package/dist/components/fieldset/MPFieldset.d.ts +52 -0
- package/dist/components/fieldset/MPFieldset.js +2 -0
- package/dist/components/fieldset/index.d.ts +2 -0
- package/dist/components/fieldset/index.js +1 -0
- package/dist/components/file-picker/MPFilePicker.d.ts +5 -4
- package/dist/components/file-picker/MPFilePicker.js +2 -1
- package/dist/components/file-picker/index.d.ts +2 -2
- package/dist/components/file-picker/index.js +1 -1
- package/dist/components/floating-action-button/MPFloatingActionButton.d.ts +1 -1
- package/dist/components/floating-action-button/MPFloatingActionButton.js +2 -1
- package/dist/components/floating-action-button/index.d.ts +2 -2
- package/dist/components/floating-action-button/index.js +1 -1
- package/dist/components/footer/MPFooter.d.ts +94 -0
- package/dist/components/footer/MPFooter.js +2 -0
- package/dist/components/footer/index.d.ts +2 -0
- package/dist/components/footer/index.js +1 -0
- package/dist/components/form/MPForm.d.ts +73 -0
- package/dist/components/form/MPForm.js +2 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/grid/MPGrid.d.ts +1 -1
- package/dist/components/grid/MPGrid.js +1 -0
- package/dist/components/grid/index.d.ts +2 -2
- package/dist/components/grid/index.js +1 -1
- package/dist/components/header/MPHeader.d.ts +122 -0
- package/dist/components/header/MPHeader.js +2 -0
- package/dist/components/header/index.d.ts +2 -0
- package/dist/components/header/index.js +1 -0
- package/dist/components/highlight/MPHighlight.d.ts +9 -2
- package/dist/components/highlight/MPHighlight.js +2 -1
- package/dist/components/highlight/index.d.ts +2 -2
- package/dist/components/highlight/index.js +1 -1
- package/dist/components/icon/MPIcon.d.ts +1 -1
- package/dist/components/icon/MPIcon.js +1 -0
- package/dist/components/icon/index.d.ts +2 -2
- package/dist/components/icon/index.js +1 -1
- package/dist/components/icon-button/MPIconButton.d.ts +1 -1
- package/dist/components/icon-button/MPIconButton.js +2 -1
- package/dist/components/icon-button/index.d.ts +2 -2
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/list/MPList.d.ts +1 -1
- package/dist/components/list/MPList.js +2 -1
- package/dist/components/list/index.d.ts +2 -2
- package/dist/components/list/index.js +1 -1
- package/dist/components/locale/MPLocaleProvider.d.ts +1 -1
- package/dist/components/locale/MPLocaleProvider.js +2 -1
- package/dist/components/locale/index.d.ts +2 -2
- package/dist/components/locale/index.js +1 -1
- package/dist/components/menu/MPMenu.d.ts +1 -1
- package/dist/components/menu/MPMenu.js +2 -1
- package/dist/components/menu/index.d.ts +2 -2
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menubar/MPMenubar.d.ts +82 -0
- package/dist/components/menubar/MPMenubar.js +2 -0
- package/dist/components/menubar/index.d.ts +2 -0
- package/dist/components/menubar/index.js +1 -0
- package/dist/components/navigation-menu/MPNavigationMenu.d.ts +151 -0
- package/dist/components/navigation-menu/MPNavigationMenu.js +2 -0
- package/dist/components/navigation-menu/index.d.ts +2 -0
- package/dist/components/navigation-menu/index.js +1 -0
- package/dist/components/number-field/MPNumberField.d.ts +13 -4
- package/dist/components/number-field/MPNumberField.js +2 -1
- package/dist/components/number-field/index.d.ts +2 -2
- package/dist/components/number-field/index.js +1 -1
- package/dist/components/otp-field/MPOtpField.d.ts +1 -1
- package/dist/components/otp-field/MPOtpField.js +2 -1
- package/dist/components/otp-field/index.d.ts +2 -2
- package/dist/components/otp-field/index.js +1 -1
- package/dist/components/overlay/MPOverlay.d.ts +9 -3
- package/dist/components/overlay/MPOverlay.js +2 -1
- package/dist/components/overlay/index.d.ts +2 -2
- package/dist/components/overlay/index.js +1 -1
- package/dist/components/page-layout/MPPageLayout.d.ts +145 -0
- package/dist/components/page-layout/MPPageLayout.js +2 -0
- package/dist/components/page-layout/index.d.ts +2 -0
- package/dist/components/page-layout/index.js +1 -0
- package/dist/components/pagination/MPPagination.d.ts +2 -2
- package/dist/components/pagination/MPPagination.js +2 -1
- package/dist/components/pagination/index.d.ts +2 -2
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/panes/MPPanes.d.ts +1 -1
- package/dist/components/panes/MPPanes.js +2 -1
- package/dist/components/panes/index.d.ts +2 -2
- package/dist/components/panes/index.js +1 -1
- package/dist/components/pill/MPPill.d.ts +1 -1
- package/dist/components/pill/MPPill.js +2 -1
- package/dist/components/pill/index.d.ts +2 -2
- package/dist/components/pill/index.js +1 -1
- package/dist/components/popover/MPPopover.d.ts +1 -1
- package/dist/components/popover/MPPopover.js +2 -1
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/index.js +1 -1
- package/dist/components/progress-box/MPProgressBox.d.ts +2 -2
- package/dist/components/progress-box/MPProgressBox.js +2 -1
- package/dist/components/progress-box/index.d.ts +2 -2
- package/dist/components/progress-box/index.js +1 -1
- package/dist/components/progress-circular/MPProgressCircular.d.ts +2 -2
- package/dist/components/progress-circular/MPProgressCircular.js +2 -1
- package/dist/components/progress-circular/index.d.ts +2 -2
- package/dist/components/progress-circular/index.js +1 -1
- package/dist/components/progress-linear/MPProgressLinear.d.ts +2 -2
- package/dist/components/progress-linear/MPProgressLinear.js +2 -1
- package/dist/components/progress-linear/index.d.ts +2 -2
- package/dist/components/progress-linear/index.js +1 -1
- package/dist/components/radio-group/MPRadioGroup.d.ts +1 -1
- package/dist/components/radio-group/MPRadioGroup.js +2 -1
- package/dist/components/radio-group/index.d.ts +2 -2
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/rating/MPRating.d.ts +2 -2
- package/dist/components/rating/MPRating.js +2 -1
- package/dist/components/rating/index.d.ts +2 -2
- package/dist/components/rating/index.js +1 -1
- package/dist/components/segmented-button/MPSegmentedButton.d.ts +1 -1
- package/dist/components/segmented-button/MPSegmentedButton.js +2 -1
- package/dist/components/segmented-button/index.d.ts +2 -2
- package/dist/components/segmented-button/index.js +1 -1
- package/dist/components/select/MPSelect.d.ts +13 -2
- package/dist/components/select/MPSelect.js +2 -1
- package/dist/components/select/index.d.ts +2 -2
- package/dist/components/select/index.js +1 -1
- package/dist/components/shortcut/MPShortcut.d.ts +1 -1
- package/dist/components/shortcut/MPShortcut.js +2 -1
- package/dist/components/shortcut/index.d.ts +2 -2
- package/dist/components/shortcut/index.js +1 -1
- package/dist/components/sidebar/MPSidebar.d.ts +160 -0
- package/dist/components/sidebar/MPSidebar.js +2 -0
- package/dist/components/sidebar/MPSidebarTrigger.d.ts +45 -0
- package/dist/components/sidebar/MPSidebarTrigger.js +2 -0
- package/dist/components/sidebar/index.d.ts +4 -0
- package/dist/components/sidebar/index.js +1 -0
- package/dist/components/skeleton/MPSkeleton.d.ts +1 -1
- package/dist/components/skeleton/MPSkeleton.js +2 -1
- package/dist/components/skeleton/index.d.ts +2 -2
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/slider/MPSlider.d.ts +1 -1
- package/dist/components/slider/MPSlider.js +2 -1
- package/dist/components/slider/index.d.ts +2 -2
- package/dist/components/slider/index.js +1 -1
- package/dist/components/snackbar/MPSnackbar.d.ts +1 -1
- package/dist/components/snackbar/MPSnackbar.js +2 -1
- package/dist/components/snackbar/index.d.ts +2 -2
- package/dist/components/snackbar/index.js +1 -1
- package/dist/components/spoiler/MPSpoiler.d.ts +1 -1
- package/dist/components/spoiler/MPSpoiler.js +2 -1
- package/dist/components/spoiler/index.d.ts +2 -2
- package/dist/components/spoiler/index.js +1 -1
- package/dist/components/switch/MPSwitch.d.ts +1 -1
- package/dist/components/switch/MPSwitch.js +2 -1
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/switch/index.js +1 -1
- package/dist/components/table/MPTable.d.ts +28 -6
- package/dist/components/table/MPTable.js +2 -1
- package/dist/components/table/index.d.ts +2 -2
- package/dist/components/table/index.js +1 -1
- package/dist/components/tabs/MPTabs.d.ts +1 -1
- package/dist/components/tabs/MPTabs.js +2 -1
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/text-field/MPTextField.d.ts +15 -4
- package/dist/components/text-field/MPTextField.js +2 -1
- package/dist/components/text-field/index.d.ts +2 -2
- package/dist/components/text-field/index.js +1 -1
- package/dist/components/text-link/MPTextLink.d.ts +8 -2
- package/dist/components/text-link/MPTextLink.js +2 -1
- package/dist/components/text-link/index.d.ts +2 -2
- package/dist/components/text-link/index.js +1 -1
- package/dist/components/time-picker/MPTimePicker.d.ts +7 -3
- package/dist/components/time-picker/MPTimePicker.js +2 -1
- package/dist/components/time-picker/index.d.ts +2 -2
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/timeline/MPTimeline.d.ts +1 -1
- package/dist/components/timeline/MPTimeline.js +2 -1
- package/dist/components/timeline/index.d.ts +2 -2
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/toggle/MPToggle.d.ts +72 -0
- package/dist/components/toggle/MPToggle.js +2 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle/index.js +1 -0
- package/dist/components/toggle-group/MPToggleGroup.d.ts +74 -0
- package/dist/components/toggle-group/MPToggleGroup.js +2 -0
- package/dist/components/toggle-group/index.d.ts +2 -0
- package/dist/components/toggle-group/index.js +1 -0
- package/dist/components/tooltip/MPTooltip.d.ts +1 -1
- package/dist/components/tooltip/MPTooltip.js +2 -1
- package/dist/components/tooltip/index.d.ts +2 -2
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/transfer/MPTransfer.d.ts +98 -0
- package/dist/components/transfer/MPTransfer.js +2 -0
- package/dist/components/transfer/index.d.ts +2 -0
- package/dist/components/transfer/index.js +1 -0
- package/dist/components/typography/MPTypography.d.ts +1 -1
- package/dist/components/typography/MPTypography.js +2 -1
- package/dist/components/typography/index.d.ts +2 -2
- package/dist/components/typography/index.js +1 -1
- package/dist/constants/glyphs.d.ts +72 -0
- package/dist/constants/glyphs.js +2 -0
- package/dist/constants/icons.d.ts +32 -60
- package/dist/constants/icons.js +1 -1
- package/dist/index.d.ts +91 -78
- package/dist/index.js +1 -1
- package/dist/internal/Calendar.d.ts +3 -3
- package/dist/internal/Calendar.js +2 -1
- package/dist/internal/FieldOutline.d.ts +1 -1
- package/dist/internal/FieldOutline.js +2 -1
- package/dist/internal/Picker.d.ts +2 -2
- package/dist/internal/Picker.js +2 -1
- package/dist/internal/StateLayer.js +1 -0
- package/dist/internal/SupportingText.d.ts +1 -1
- package/dist/internal/SupportingText.js +2 -1
- package/dist/internal/WidthSizer.js +1 -0
- package/dist/internal/accent.d.ts +1 -1
- package/dist/internal/animate.d.ts +1 -18
- package/dist/internal/animate.js +2 -1
- package/dist/internal/avatar-group.d.ts +22 -0
- package/dist/internal/avatar-group.js +2 -0
- package/dist/internal/button-group.d.ts +20 -1
- package/dist/internal/button-group.js +2 -1
- package/dist/internal/color.d.ts +0 -5
- package/dist/internal/color.js +1 -1
- package/dist/internal/date.d.ts +1 -1
- package/dist/internal/date.js +1 -1
- package/dist/internal/i18n.d.ts +245 -14
- package/dist/internal/i18n.js +1 -1
- package/dist/internal/keys.d.ts +72 -0
- package/dist/internal/keys.js +2 -0
- package/dist/internal/length.d.ts +42 -0
- package/dist/internal/length.js +1 -0
- package/dist/internal/link.d.ts +44 -0
- package/dist/internal/link.js +1 -0
- package/dist/internal/locale.d.ts +27 -3
- package/dist/internal/locale.js +2 -1
- package/dist/internal/menu.d.ts +1 -1
- package/dist/internal/menu.js +1 -0
- package/dist/internal/messages/alert.d.ts +3 -0
- package/dist/internal/messages/alert.js +1 -0
- package/dist/internal/messages/breadcrumb.d.ts +3 -0
- package/dist/internal/messages/breadcrumb.js +1 -0
- package/dist/internal/messages/carousel.d.ts +3 -0
- package/dist/internal/messages/carousel.js +1 -0
- package/dist/internal/messages/chat.d.ts +3 -0
- package/dist/internal/messages/chat.js +1 -0
- package/dist/internal/messages/color-picker.d.ts +3 -0
- package/dist/internal/messages/color-picker.js +1 -0
- package/dist/internal/messages/combobox.d.ts +3 -0
- package/dist/internal/messages/combobox.js +1 -0
- package/dist/internal/messages/command.d.ts +3 -0
- package/dist/internal/messages/command.js +1 -0
- package/dist/internal/messages/common.d.ts +3 -0
- package/dist/internal/messages/common.js +1 -0
- package/dist/internal/messages/empty.d.ts +3 -0
- package/dist/internal/messages/empty.js +1 -0
- package/dist/internal/messages/file-picker.d.ts +3 -0
- package/dist/internal/messages/file-picker.js +1 -0
- package/dist/internal/messages/layout.d.ts +3 -0
- package/dist/internal/messages/layout.js +1 -0
- package/dist/internal/messages/number-field.d.ts +3 -0
- package/dist/internal/messages/number-field.js +1 -0
- package/dist/internal/messages/overlay.d.ts +3 -0
- package/dist/internal/messages/overlay.js +1 -0
- package/dist/internal/messages/pagination.d.ts +3 -0
- package/dist/internal/messages/pagination.js +1 -0
- package/dist/internal/messages/picker.d.ts +3 -0
- package/dist/internal/messages/picker.js +1 -0
- package/dist/internal/messages/rating.d.ts +3 -0
- package/dist/internal/messages/rating.js +1 -0
- package/dist/internal/messages/spoiler.d.ts +3 -0
- package/dist/internal/messages/spoiler.js +1 -0
- package/dist/internal/messages/table.d.ts +3 -0
- package/dist/internal/messages/table.js +1 -0
- package/dist/internal/messages/text-field.d.ts +3 -0
- package/dist/internal/messages/text-field.js +1 -0
- package/dist/internal/messages/text-link.d.ts +3 -0
- package/dist/internal/messages/text-link.js +1 -0
- package/dist/internal/messages/transfer.d.ts +3 -0
- package/dist/internal/messages/transfer.js +1 -0
- package/dist/internal/page-layout.d.ts +182 -0
- package/dist/internal/page-layout.js +2 -0
- package/dist/internal/progress.d.ts +1 -1
- package/dist/internal/scale.d.ts +18 -1
- package/dist/internal/scale.js +1 -1
- package/dist/internal/surface.d.ts +1 -1
- package/dist/internal/surface.js +1 -1
- package/dist/locales/ar.d.ts +1 -1
- package/dist/locales/ar.js +1 -1
- package/dist/locales/de.d.ts +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/es.d.ts +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/fr.d.ts +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/hi.d.ts +1 -1
- package/dist/locales/hi.js +1 -1
- package/dist/locales/id.d.ts +1 -1
- package/dist/locales/id.js +1 -1
- package/dist/locales/index.d.ts +19 -19
- package/dist/locales/index.js +1 -1
- package/dist/locales/it.d.ts +1 -1
- package/dist/locales/it.js +1 -1
- package/dist/locales/ja.d.ts +1 -1
- package/dist/locales/ja.js +1 -1
- package/dist/locales/ko.d.ts +1 -1
- package/dist/locales/ko.js +1 -1
- package/dist/locales/nl.d.ts +1 -1
- package/dist/locales/nl.js +1 -1
- package/dist/locales/pl.d.ts +1 -1
- package/dist/locales/pl.js +1 -1
- package/dist/locales/pt.d.ts +1 -1
- package/dist/locales/pt.js +1 -1
- package/dist/locales/ru.d.ts +1 -1
- package/dist/locales/ru.js +1 -1
- package/dist/locales/th.d.ts +1 -1
- package/dist/locales/th.js +1 -1
- package/dist/locales/tr.d.ts +1 -1
- package/dist/locales/tr.js +1 -1
- package/dist/locales/vi.d.ts +1 -1
- package/dist/locales/vi.js +1 -1
- package/dist/locales/zh-hans.d.ts +1 -1
- package/dist/locales/zh-hans.js +1 -1
- package/dist/locales/zh-hant.d.ts +1 -1
- package/dist/locales/zh-hant.js +1 -1
- package/dist/styles/accordion.css +1 -1
- package/dist/styles/alert.css +1 -1
- package/dist/styles/avatar-group.css +2 -0
- package/dist/styles/avatar.css +1 -1
- package/dist/styles/badge.css +1 -1
- package/dist/styles/blockquote.css +1 -1
- package/dist/styles/bottom-navigation.css +1 -1
- package/dist/styles/box.css +1 -1
- package/dist/styles/breadcrumb.css +1 -1
- package/dist/styles/button-group.css +1 -1
- package/dist/styles/button.css +1 -1
- package/dist/styles/card.css +1 -1
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/chat-bubble.css +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/chip.css +1 -1
- package/dist/styles/collapsible.css +1 -1
- package/dist/styles/color-picker.css +1 -1
- package/dist/styles/combobox.css +1 -1
- package/dist/styles/command-palette.css +2 -0
- package/dist/styles/date-picker.css +1 -1
- package/dist/styles/date-range-picker.css +1 -1
- package/dist/styles/date-time-picker.css +1 -1
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +1 -1
- package/dist/styles/empty.css +1 -1
- package/dist/styles/fieldset.css +2 -0
- package/dist/styles/file-picker.css +1 -1
- package/dist/styles/floating-action-button.css +1 -1
- package/dist/styles/footer.css +2 -0
- package/dist/styles/form.css +2 -0
- package/dist/styles/header.css +2 -0
- package/dist/styles/highlight.css +1 -1
- package/dist/styles/icon-button.css +1 -1
- package/dist/styles/list.css +1 -1
- package/dist/styles/locale.css +1 -1
- package/dist/styles/menu.css +1 -1
- package/dist/styles/menubar.css +2 -0
- package/dist/styles/navigation-menu.css +2 -0
- package/dist/styles/number-field.css +1 -1
- package/dist/styles/otp-field.css +1 -1
- package/dist/styles/overlay.css +1 -1
- package/dist/styles/page-layout.css +2 -0
- package/dist/styles/pagination.css +1 -1
- package/dist/styles/panes.css +1 -1
- package/dist/styles/pill.css +1 -1
- package/dist/styles/popover.css +1 -1
- package/dist/styles/progress-box.css +1 -1
- package/dist/styles/progress-circular.css +1 -1
- package/dist/styles/progress-linear.css +1 -1
- package/dist/styles/radio-group.css +1 -1
- package/dist/styles/segmented-button.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/sidebar.css +2 -0
- package/dist/styles/skeleton.css +1 -1
- package/dist/styles/slider.css +1 -1
- package/dist/styles/spoiler.css +1 -1
- package/dist/styles/switch.css +1 -1
- package/dist/styles/table.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/text-link.css +1 -1
- package/dist/styles/time-picker.css +1 -1
- package/dist/styles/timeline.css +1 -1
- package/dist/styles/toggle-group.css +2 -0
- package/dist/styles/toggle.css +2 -0
- package/dist/styles/transfer.css +2 -0
- package/dist/styles.css +1 -1
- package/package.json +12 -10
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import*as e from"react";import{useRender as t}from"@base-ui/react/use-render";const n=["compact","medium","expanded","large","extra-large"];function r(e,t,r){const a=function(e){return null==e?{}:"object"==typeof e?e:{compact:e}}(t),s={};for(const t of n){const n=a[t];void 0!==n&&(s[`--_mp-${e}-${t}`]=r(n))}return s}function a(e,t){return null==e?t:"object"==typeof e?{compact:t,...e}:e}function s(e){return String(Math.max(1,Math.round(e)))}function o(e){return String(Math.max(1,Math.round(e)))}function c(e){return String(Math.max(0,Math.round(e)))}function i(e){const t=.25*Math.max(0,e);return`${Number(t.toFixed(5))}rem`}const l={start:"justify-start",center:"justify-center",end:"justify-end","space-between":"justify-between","space-around":"justify-around","space-evenly":"justify-evenly"},f={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},u={start:"content-start",center:"content-center",end:"content-end","space-between":"content-between","space-around":"content-around","space-evenly":"content-evenly",stretch:"content-stretch"},p={auto:"self-auto",start:"self-start",center:"self-center",end:"self-end",stretch:"self-stretch",baseline:"self-baseline"};export const MPGrid=/*@__PURE__*/e.forwardRef(function({columns:e,spacing:n,rowSpacing:o,columnSpacing:c,justifyContent:p,alignItems:d,alignContent:m,wrap:y=!0,render:g,className:h,style:x,children:b,...j},w){return t({render:g,ref:w,props:{className:["mp-grid flex",y?"flex-wrap":"flex-nowrap","gap-x-(--_mp-gap-x) gap-y-(--_mp-gap-y)",p?l[p]:"",d?f[d]:"",m?u[m]:"",h??""].filter(Boolean).join(" "),style:{...r("cols",a(e,12),s),...r("gap-x",a(c??n,4),i),...r("gap-y",a(o??n,4),i),...x},children:b,...j}})});export const MPGridItem=/*@__PURE__*/e.forwardRef(function({span:e,offset:n,alignSelf:a,render:s,className:i,style:l,children:f,...u},d){return t({render:s,ref:d,props:{className:["mp-grid-item",a?p[a]:"",i??""].filter(Boolean).join(" "),style:{...r("span",e,o),...r("offset",n,c),...l},children:f,...u}})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPGrid, MPGridItem } from './MPGrid';
|
|
2
|
-
export type { MPGridAlign, MPGridAlignSelf, MPGridItemProps, MPGridJustify, MPGridProps } from './MPGrid';
|
|
1
|
+
export { MPGrid, MPGridItem } from './MPGrid.js';
|
|
2
|
+
export type { MPGridAlign, MPGridAlignSelf, MPGridItemProps, MPGridJustify, MPGridProps } from './MPGrid.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPGrid,MPGridItem}from"./MPGrid";
|
|
1
|
+
export{MPGrid,MPGridItem}from"./MPGrid.js";
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { MPAlign, MPPosition, MPSize, MPVariant } from '../../types.js';
|
|
4
|
+
export interface MPHeaderProps extends Omit<React.ComponentPropsWithoutRef<'header'>, 'title'> {
|
|
5
|
+
/**
|
|
6
|
+
* The leading slot: the mark, the product's name, the thing that is the same
|
|
7
|
+
* on every page — and, on a narrow window, the
|
|
8
|
+
* [MPSidebarTrigger](./sidebar#mpsidebartrigger) that goes ahead of it.
|
|
9
|
+
*
|
|
10
|
+
* A slot rather than the first of `children` because the three regions of a
|
|
11
|
+
* bar are laid out *against each other* — the middle can only be centred on
|
|
12
|
+
* the bar if the two ends are the component's to measure — and a caller
|
|
13
|
+
* writing three wrappers by hand is a caller whose header drifts from the next
|
|
14
|
+
* one.
|
|
15
|
+
*/
|
|
16
|
+
brand?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* The trailing slot: the account menu, the theme switch, the call to action.
|
|
19
|
+
* Laid out end-aligned, so a row of icon buttons needs no wrapper of its own.
|
|
20
|
+
*/
|
|
21
|
+
actions?: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Where the middle slot sits.
|
|
24
|
+
*
|
|
25
|
+
* `center` is MD3's own **center-aligned top app bar**, and it is centred on
|
|
26
|
+
* the *bar* rather than in the space left over: both ends are given equal
|
|
27
|
+
* shares, so the middle stays on the bar's midline however long the brand is.
|
|
28
|
+
* @default 'start'
|
|
29
|
+
*/
|
|
30
|
+
align?: MPAlign;
|
|
31
|
+
/**
|
|
32
|
+
* How the bar sits in the page's scroll, spelled the way CSS spells it.
|
|
33
|
+
*
|
|
34
|
+
* `sticky` — the default — holds it against the top of the window once the
|
|
35
|
+
* page has scrolled to it, while leaving it in the flow so nothing has to be
|
|
36
|
+
* padded out of its way. `fixed` takes it out of the flow entirely, which an
|
|
37
|
+
* [MPPageLayout](./page-layout) answers by reserving its height. `static` lets
|
|
38
|
+
* it scroll away.
|
|
39
|
+
* @default 'sticky'
|
|
40
|
+
*/
|
|
41
|
+
position?: MPPosition;
|
|
42
|
+
/**
|
|
43
|
+
* How much surface the bar paints, on the **container** ladder — the bar is
|
|
44
|
+
* never dyed, because what sits on it arrives with colours of its own.
|
|
45
|
+
*
|
|
46
|
+
* `tonal` is the default and is MD3's own scrolled top app bar:
|
|
47
|
+
* `surface-container` against the page's `surface`. `outlined` is the flat one
|
|
48
|
+
* — the page's own surface with a hairline where it ends — and `text` paints
|
|
49
|
+
* nothing at all, which is what a bar over a hero image wants.
|
|
50
|
+
* @default 'tonal'
|
|
51
|
+
*/
|
|
52
|
+
variant?: MPVariant;
|
|
53
|
+
/**
|
|
54
|
+
* The bar's height floor, its gutter and the air between its slots.
|
|
55
|
+
*
|
|
56
|
+
* `md` is 64px, which is MD3's own small top app bar. It is a floor rather
|
|
57
|
+
* than a height: a bar whose middle slot wrapped onto a second line would
|
|
58
|
+
* otherwise clip it.
|
|
59
|
+
* @default 'md'
|
|
60
|
+
*/
|
|
61
|
+
size?: MPSize;
|
|
62
|
+
/**
|
|
63
|
+
* Holds the row of slots to a measure and centres it while the sheet itself
|
|
64
|
+
* still spans the window. The same ladder [MPContainer](./container)'s
|
|
65
|
+
* `maxWidth` uses, so a header and the container under it line up on one edge.
|
|
66
|
+
* @default 'none'
|
|
67
|
+
*/
|
|
68
|
+
maxWidth?: MPSize | 'none';
|
|
69
|
+
/**
|
|
70
|
+
* The gutter down each side of the row.
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
padded?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* The name the bar is announced by. Worth writing when a page has more than
|
|
76
|
+
* one `<header>` in it — an article's own and the site's — because "banner"
|
|
77
|
+
* twice tells a reader which is which not at all.
|
|
78
|
+
*/
|
|
79
|
+
label?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Renders something other than a `<header>`. Base UI's own escape hatch, and
|
|
82
|
+
* rarely what you want: at the top level of a document that tag *is* the
|
|
83
|
+
* `banner` landmark, and it is what says so to a screen reader's landmark
|
|
84
|
+
* list, to a reader mode and to a crawler.
|
|
85
|
+
*/
|
|
86
|
+
render?: useRender.RenderProp;
|
|
87
|
+
/** The middle slot: a row of navigation links, a search field, a headline. */
|
|
88
|
+
children?: React.ReactNode;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The bar across the top of a page. **MD3's top app bar**, with the site's own
|
|
92
|
+
* three regions on it.
|
|
93
|
+
*
|
|
94
|
+
* A real `<header>`, which is the whole reason it is a component rather than a
|
|
95
|
+
* row of divs: at the top level of a document that tag is the `banner` landmark,
|
|
96
|
+
* and it is what a screen reader's landmark list, a reader mode and a search
|
|
97
|
+
* engine's understanding of the page are built out of.
|
|
98
|
+
*
|
|
99
|
+
* The slots are props rather than compound sub-components, for
|
|
100
|
+
* [MPCard](./card)'s reason: the arrangement is fixed — brand, middle, actions —
|
|
101
|
+
* and what a caller wants to decide is what goes in each. That the middle can be
|
|
102
|
+
* centred on the bar's own midline is only possible *because* the ends are the
|
|
103
|
+
* component's to measure.
|
|
104
|
+
*
|
|
105
|
+
* ## Why there is no `divider`
|
|
106
|
+
*
|
|
107
|
+
* [MPBottomNavigation](./bottom-navigation) has one and this does not, and the
|
|
108
|
+
* difference is that this takes a `variant`. MD3 separates a bar from the
|
|
109
|
+
* content by **tone** — `surface-container` against `surface` — and the case a
|
|
110
|
+
* hairline exists for is the bar that paints the page's own surface. That bar is
|
|
111
|
+
* `variant="outlined"`, and the rule is what `outlined` *means* here: a
|
|
112
|
+
* container's outline is a hairline all the way round, and a bar has exactly one
|
|
113
|
+
* edge with anything on the other side of it.
|
|
114
|
+
*
|
|
115
|
+
* ## Inside a layout, and outside one
|
|
116
|
+
*
|
|
117
|
+
* Inside an [MPPageLayout](./page-layout) the bar registers itself, so a column
|
|
118
|
+
* that holds its place knows how far down the window to start and a `fixed` bar
|
|
119
|
+
* has its height reserved. Outside one it is simply a bar, and everything above
|
|
120
|
+
* still holds.
|
|
121
|
+
*/
|
|
122
|
+
export declare const MPHeader: React.ForwardRefExoticComponent<MPHeaderProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{useRender as i}from"@base-ui/react/use-render";import{BAR_SURFACE as n,MPPageLayoutContext as r}from"../../internal/page-layout.js";import{hasContent as s,MEASURE as l,SHEET_PAD_X as m}from"../../internal/scale.js";const d={xs:"min-h-12",sm:"min-h-14",md:"min-h-16",lg:"min-h-20",xl:"min-h-24"},o={xs:"text-mp-title-small",sm:"text-mp-title-medium",md:"text-mp-title-large",lg:"text-mp-headline-small",xl:"text-mp-headline-medium"},c={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-4",xl:"gap-5"},p={xs:"gap-3",sm:"gap-4",md:"gap-6",lg:"gap-8",xl:"gap-10"},x={static:"",absolute:"absolute inset-x-0 top-0 z-30",sticky:"sticky top-0 z-30",fixed:"fixed inset-x-0 top-0 z-40"},f={start:"shrink-0",center:"flex-1 basis-0",end:"shrink-0"},u={start:"flex min-w-0 flex-1 items-center justify-start",center:"flex min-w-0 shrink items-center justify-center",end:"flex min-w-0 flex-1 items-center justify-end"};export const MPHeader=/*@__PURE__*/a.forwardRef(function({brand:h,actions:g,align:b="start",position:j="sticky",variant:v="tonal",size:w="md",maxWidth:y="none",padded:N=!0,label:k,render:_,className:z,children:$,...B},C){const{register:H}=a.useContext(r),M=a.useCallback(e=>{H("header",e),"function"==typeof C?C(e):C&&(C.current=e)},[H,C]);return i({render:_??e("header",{}),ref:M,props:{"aria-label":k,"data-mp-size":w,"data-mp-variant":v,className:["mp-header text-mp-on-surface box-border w-full min-w-0",n[v],"outlined"===v?"border-mp-outline-variant border-b":"",x[j],z??""].filter(Boolean).join(" "),children:t("div",{className:["flex w-full items-center",d[w],p[w],N?m[w]:"","none"===y?"":`${l[y]} mx-auto`].filter(Boolean).join(" "),children:[s(h)?e("div",{className:["mp-header__brand flex min-w-0 items-center",f[b],c[w],o[w]].join(" "),children:h}):"center"===b?e("div",{"aria-hidden":"true",className:f[b]}):null,s($)?e("div",{className:`mp-header__middle ${u[b]} ${c[w]}`,children:$}):null,s(g)?e("div",{className:["mp-header__actions flex min-w-0 items-center justify-end",f[b],c[w]].join(" "),children:g}):"center"===b?e("div",{"aria-hidden":"true",className:f[b]}):null]}),...B}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPHeader}from"./MPHeader.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { MPTypographyWeight } from '../typography/MPTypography';
|
|
3
|
-
import type { MPColor, MPVariant } from '../../types';
|
|
2
|
+
import type { MPTypographyWeight } from '../typography/MPTypography.js';
|
|
3
|
+
import type { MPColor, MPVariant } from '../../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* The four weights a mark can be drawn at.
|
|
6
6
|
*
|
|
@@ -19,6 +19,13 @@ export interface MPHighlightProps extends Omit<React.ComponentPropsWithoutRef<'s
|
|
|
19
19
|
* letters of it. A `RegExp` is used as written, with the global flag forced on;
|
|
20
20
|
* `caseSensitive` and `wholeWord` are ignored for it, because a regular
|
|
21
21
|
* expression already says both of those things itself.
|
|
22
|
+
*
|
|
23
|
+
* Strings are escaped, so a search box's contents are safe to pass straight
|
|
24
|
+
* through however they are spelled. A `RegExp` is **not** — it is run as
|
|
25
|
+
* written, which is the point of accepting one. Building one out of text
|
|
26
|
+
* somebody else typed is a denial of service waiting for the input that
|
|
27
|
+
* backtracks; escape it into a string term instead, or keep the expression a
|
|
28
|
+
* literal in your own source.
|
|
22
29
|
*/
|
|
23
30
|
query: string | string[] | RegExp;
|
|
24
31
|
/**
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import*as n from"react";import{accentSlots as t}from"../../internal/accent.js";const r={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",outlined:"border border-(--_mp-accent) bg-transparent text-(--_mp-accent)",text:"bg-transparent text-(--_mp-accent)"},o={regular:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},i=/[\p{L}\p{N}_]/u;function l(e){return e.replace(/[-.*+?^${}()|[\]\\]/g,"\\$&")}function a(e,n,t){const r=n>0?e[n-1]:"",o=t<e.length?e[t]:"";return!i.test(r)&&!i.test(o)}function c(e,n,t,r){n.lastIndex=0;const o=[];let i,l=0;for(;null!==(i=n.exec(e));){if(""===i[0]){n.lastIndex+=1;continue}const c=i.index,s=c+i[0].length;t&&!a(e,c,s)||(c>l&&o.push(e.slice(l,c)),o.push(r(i[0],String(c))),l=s)}return 0===o.length?e:(l<e.length&&o.push(e.slice(l)),o)}function s(e,t,r,o){if("string"==typeof e)return c(e,t,r,o);if("number"==typeof e)return c(String(e),t,r,o);if(Array.isArray(e))return n.Children.map(e,e=>s(e,t,r,o));if(n.isValidElement(e)){const i=e.props.children;return void 0===i||"function"==typeof i?e:n.cloneElement(e,void 0,s(i,t,r,o))}return e}export const MPHighlight=/*@__PURE__*/n.forwardRef(function({query:i,variant:a="tonal",color:c="tertiary",caseSensitive:u=!1,wholeWord:f=!1,underline:m=!1,weight:p,className:g,style:d,children:h,...x},b){const y=i instanceof RegExp?`re ${i.source} ${i.flags}`:Array.isArray(i)?`a ${i.join("\0")}`:`s ${i}`,_=n.useMemo(()=>function(e,n){if(e instanceof RegExp)return new RegExp(e.source,e.global?e.flags:`${e.flags}g`);const t=(Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(Boolean).sort((e,n)=>n.length-e.length);return 0===t.length?null:new RegExp(t.map(l).join("|"),n?"gu":"giu")}(i,u),[y,u]),j=["rounded-mp-xs -mx-0.5 px-0.5","box-decoration-clone",r[a],m?"underline decoration-2 underline-offset-2":"",p?o[p]:""].filter(Boolean).join(" "),$=n.useMemo(()=>_?s(h,_,f,(n,t)=>e("mark",{className:j,children:n},t)):h,[h,_,f,j]);return e("span",{ref:b,className:["mp-highlight",g??""].filter(Boolean).join(" "),style:{...t(c),...d},...x,children:$})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPHighlight } from './MPHighlight';
|
|
2
|
-
export type { MPHighlightProps, MPHighlightVariant } from './MPHighlight';
|
|
1
|
+
export { MPHighlight } from './MPHighlight.js';
|
|
2
|
+
export type { MPHighlightProps, MPHighlightVariant } from './MPHighlight.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPHighlight}from"./MPHighlight";
|
|
1
|
+
export{MPHighlight}from"./MPHighlight.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { MPIconGlyph } from '../../types';
|
|
2
|
+
import type { MPIconGlyph } from '../../types.js';
|
|
3
3
|
export interface MPIconProps extends Omit<React.ComponentPropsWithoutRef<'span'>, 'color'> {
|
|
4
4
|
/**
|
|
5
5
|
* The glyph to draw: a component from an icon set, or an element of your own.
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import{jsx as e}from"react/jsx-runtime";import*as i from"react";function o(e){return!i.isValidElement(e)}export const MPIcon=/*@__PURE__*/i.forwardRef(function({icon:r,size:t,color:l,strokeWidth:n,center:s=!1,label:c,className:a,style:d,...f},m){const u=["mp-icon inline-flex shrink-0 items-center justify-center align-middle",void 0===t?"":"[&>svg]:block [&>svg]:size-full [&>img]:block [&>img]:size-full",s?"justify-self-center":"",a??""].filter(Boolean).join(" ");return e("span",{ref:m,className:u,style:{...void 0===t?{}:{width:t,height:t,fontSize:t},...void 0===l?{}:{color:l},...d},role:c?"img":void 0,"aria-label":c,"aria-hidden":!c||void 0,...f,children:o(r)?i.createElement(r,{size:t,color:void 0===l?"currentColor":l,strokeWidth:n}):r})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPIcon } from './MPIcon';
|
|
2
|
-
export type { MPIconProps } from './MPIcon';
|
|
1
|
+
export { MPIcon } from './MPIcon.js';
|
|
2
|
+
export type { MPIconProps } from './MPIcon.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPIcon}from"./MPIcon";
|
|
1
|
+
export{MPIcon}from"./MPIcon.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type MPButtonProps } from '../button/MPButton';
|
|
2
|
+
import { type MPButtonProps } from '../button/MPButton.js';
|
|
3
3
|
export interface MPIconButtonProps extends Omit<MPButtonProps, 'children' | 'startIcon' | 'endIcon' | 'fullWidth'> {
|
|
4
4
|
/**
|
|
5
5
|
* The glyph.
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import*as r from"react";import{MPButton as o}from"../button/MPButton.js";export const MPIconButton=/*@__PURE__*/r.forwardRef(function({icon:r,label:a,variant:n="text",...e},i){return t(o,{ref:i,"aria-label":a,variant:n,startIcon:r,...e})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPIconButton } from './MPIconButton';
|
|
2
|
-
export type { MPIconButtonProps } from './MPIconButton';
|
|
1
|
+
export { MPIconButton } from './MPIconButton.js';
|
|
2
|
+
export type { MPIconButtonProps } from './MPIconButton.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPIconButton}from"./MPIconButton";
|
|
1
|
+
export{MPIconButton}from"./MPIconButton.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { MPColor, MPSize, MPVariant } from '../../types';
|
|
3
|
+
import type { MPColor, MPSize, MPVariant } from '../../types.js';
|
|
4
4
|
export interface MPListProps extends Omit<React.ComponentPropsWithoutRef<'ul'>, 'color'> {
|
|
5
5
|
/**
|
|
6
6
|
* How much surface the sheet paints behind the rows.
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as r,Fragment as n}from"react/jsx-runtime";import*as t from"react";import{useRender as i}from"@base-ui/react/use-render";import{accentSlots as o}from"../../internal/accent.js";import{CONTROL_GAP as l,hasContent as s,PROSE_TEXT as a,SHEET_PAD_X as d}from"../../internal/scale.js";import{MPStateLayer as c}from"../../internal/StateLayer.js";import{CONTAINER_SURFACE as m}from"../../internal/surface.js";const p=/*@__PURE__*/t.createContext({size:"md",color:"primary",dividers:!1}),u={xs:"py-1.5",sm:"py-2.5",md:"py-4",lg:"py-5",xl:"py-6"},f={xs:"text-mp-body-small",sm:"text-mp-body-small",md:"text-mp-body-medium",lg:"text-mp-body-medium",xl:"text-mp-body-medium"},x={xs:"rounded-mp-xs",sm:"rounded-mp-xs",md:"rounded-mp-sm",lg:"rounded-mp-sm",xl:"rounded-mp-md"};export const MPList=/*@__PURE__*/t.forwardRef(function({variant:r="outlined",size:n="md",color:l="primary",dividers:s=!1,render:a,className:d,style:c,children:u,...f},x){const h=t.useMemo(()=>({size:n,color:l,dividers:s}),[n,l,s]),v=["mp-list rounded-mp-md flex flex-col",m[r],"text-mp-on-surface",s?"overflow-hidden [&>li+li]:border-mp-outline-variant [&>li+li]:border-t":"p-1",d??""].filter(Boolean).join(" "),b=i({render:a??e("ul",{}),ref:x,props:{role:"list","data-mp-size":n,"data-mp-variant":r,className:v,style:{...o(l),...c},children:u,...f}});return e(p.Provider,{value:h,children:b})});export const MPListItem=/*@__PURE__*/t.forwardRef(function({startIcon:i,endIcon:o,description:m,action:h,href:v,selected:b=!1,disabled:y=!1,className:N,children:j,onClick:g,...k},w){const{size:z,dividers:B}=t.useContext(p),C=Boolean(g||v)&&!y,I=d[z],L=["group relative flex min-w-0 flex-1 items-center overflow-hidden text-start","font-[inherit] no-underline",I,u[z],l[z],a[z],"transition-[background-color,color] duration-(--mp-sys-motion-duration-short4)",B?"":x[z],y?"text-mp-on-surface/38 cursor-default":b?"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)":"",C?["cursor-pointer appearance-none border-0",b?"":"bg-transparent","outline-mp-secondary focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid outline-none"].filter(Boolean).join(" "):""].filter(Boolean).join(" "),M=r(n,{children:[C?e(c,{}):null,s(i)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:i}):null,r("span",{className:"flex min-w-0 flex-1 flex-col",children:[s(j)?e("span",{className:"truncate",children:j}):null,s(m)?e("span",{className:["truncate",f[z],b?"opacity-80":"text-mp-on-surface-variant"].join(" "),children:m}):null]}),s(o)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:o}):null]});return r("li",{ref:w,"data-selected":b||void 0,className:["flex w-full items-center",N??""].filter(Boolean).join(" "),...k,children:[C&&v?e("a",{href:v,className:L,"aria-current":b?"page":void 0,onClick:g,children:M}):C?e("button",{type:"button",className:L,"aria-current":!!b||void 0,onClick:g,children:M}):e("div",{className:L,"aria-disabled":y||void 0,children:M}),s(h)?e("div",{className:`flex shrink-0 items-center ${I}`,children:h}):null]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPList, MPListItem } from './MPList';
|
|
2
|
-
export type { MPListItemProps, MPListProps } from './MPList';
|
|
1
|
+
export { MPList, MPListItem } from './MPList.js';
|
|
2
|
+
export type { MPListItemProps, MPListProps } from './MPList.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPList,MPListItem}from"./MPList";
|
|
1
|
+
export{MPList,MPListItem}from"./MPList.js";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as r}from"react/jsx-runtime";import{MPLocaleContext as e,useMPLocale as o}from"../../internal/locale.js";export function MPLocaleProvider({locale:o,children:i}){return r(e.Provider,{value:o,children:i})}export{o as useMPLocale};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPLocaleProvider, useMPLocale } from './MPLocaleProvider';
|
|
2
|
-
export type { MPLocaleProviderProps } from './MPLocaleProvider';
|
|
1
|
+
export { MPLocaleProvider, useMPLocale } from './MPLocaleProvider.js';
|
|
2
|
+
export type { MPLocaleProviderProps } from './MPLocaleProvider.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPLocaleProvider,useMPLocale}from"./MPLocaleProvider";
|
|
1
|
+
export{MPLocaleProvider,useMPLocale}from"./MPLocaleProvider.js";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{Menu as a}from"@base-ui/react/menu";import{ContextMenu as l}from"@base-ui/react/context-menu";import{MPIcon as r}from"../icon/MPIcon.js";import{CheckIcon as s,ChevronRightIcon as o}from"../../constants/icons.js";import{linkRel as i}from"../../internal/link.js";import{MPMenuContext as c}from"../../internal/menu.js";import{accentSlots as d}from"../../internal/accent.js";import{MPStateLayer as m}from"../../internal/StateLayer.js";import{CONTROL_ICON as u,META_TEXT as p,hasContent as h}from"../../internal/scale.js";import{FADE as f,PORTAL_LAYER as x}from"../../internal/surface.js";const b=/*@__PURE__*/["mp-menu__popup rounded-mp-xs shadow-mp-2 bg-mp-surface-container text-mp-on-surface","max-h-[min(24rem,var(--available-height))] min-w-[112px] max-w-[280px]","overflow-y-auto overscroll-contain py-2 outline-none",f].join(" "),g={xs:"min-h-8",sm:"min-h-10",md:"min-h-12",lg:"min-h-14",xl:"min-h-16"},N={xs:"px-2",sm:"px-2.5",md:"px-3",lg:"px-4",xl:"px-5"},v={xs:"gap-2",sm:"gap-2.5",md:"gap-3",lg:"gap-3",xl:"gap-4"},C={xs:"text-mp-label-medium",sm:"text-mp-label-large",md:"text-mp-label-large",lg:"text-mp-title-medium",xl:"text-mp-title-medium"};function y(e,n,t){return["group relative flex w-full cursor-pointer items-center select-none",n?"text-(--_mp-accent)":"text-mp-on-surface",g[e],N[e],v[e],C[e],"data-disabled:text-mp-on-surface/38 data-disabled:cursor-default","outline-none",t??""].filter(Boolean).join(" ")}function k(){return e(m,{layer:"inset-0 bg-current",className:"group-data-highlighted:opacity-8 group-data-popup-open:opacity-8 group-data-disabled:opacity-0"})}const M="relative flex shrink-0 items-center justify-center";function O({children:t,description:a}){return h(a)?n("span",{className:"relative flex min-w-0 flex-1 flex-col py-1.5 text-start",children:[e("span",{className:"truncate",children:t}),e("span",{className:`text-mp-on-surface-variant truncate ${p}`,children:a})]}):e("span",{className:"relative min-w-0 flex-1 truncate text-start",children:t})}function P({shortcut:n}){return h(n)?e("span",{className:`text-mp-on-surface-variant relative ms-2 shrink-0 ${p}`,children:n}):null}export function MPMenuItem({onClick:l,href:r,target:s,rel:o,startIcon:d,endIcon:m,shortcut:u,description:p,color:f,closeOnClick:x=!0,disabled:b=!1,label:g,children:N,className:v,style:C}){const{size:j}=t.useContext(c),I=n(t.Fragment,{children:[e(k,{}),h(d)?e("span",{className:`${M} text-mp-on-surface-variant`,children:d}):null,e(O,{description:p,children:N}),h(m)?e("span",{className:`${M} text-mp-on-surface-variant`,children:m}):null,e(P,{shortcut:u})]}),$=f?{"--_mp-accent":`var(--_mp-color-${f})`}:void 0,z=$||C?{...$,...C}:void 0;return void 0===r||b?e(a.Item,{disabled:b,label:g,closeOnClick:x,onClick:l,className:y(j,Boolean(f),v),style:z,children:I}):e(a.LinkItem,{href:r,target:s,rel:i(s,o),label:g,closeOnClick:x,onClick:l,className:y(j,Boolean(f),v),style:z,children:I})}export function MPMenuCheckboxItem({checked:l,defaultChecked:o,onCheckedChange:i,endIcon:d,shortcut:m,description:p,color:f,closeOnClick:x=!1,disabled:b=!1,label:g,children:N,className:v,style:C}){const{size:j}=t.useContext(c),I=f?{"--_mp-accent":`var(--_mp-color-${f})`}:void 0;return n(a.CheckboxItem,{checked:l,defaultChecked:o,onCheckedChange:e=>i?.(e),disabled:b,label:g,closeOnClick:x,className:y(j,Boolean(f),v),style:I||C?{...I,...C}:void 0,children:[e(k,{}),e("span",{className:`${M} text-(--_mp-accent)`,style:{width:u[j]},children:e(a.CheckboxItemIndicator,{className:"flex items-center justify-center",children:e(r,{icon:s,size:u[j]})})}),e(O,{description:p,children:N}),h(d)?e("span",{className:`${M} text-mp-on-surface-variant`,children:d}):null,e(P,{shortcut:m})]})}export function MPMenuRadioGroup({value:n,defaultValue:t,onValueChange:l,disabled:r=!1,children:s,className:o}){return e(a.RadioGroup,{value:n,defaultValue:t,onValueChange:e=>l?.(e),disabled:r,className:o,children:s})}export function MPMenuRadioItem({value:l,endIcon:r,shortcut:s,description:o,color:i,closeOnClick:d=!1,disabled:m=!1,label:p,children:f,className:x,style:b}){const{size:g}=t.useContext(c),N=i?{"--_mp-accent":`var(--_mp-color-${i})`}:void 0;return n(a.RadioItem,{value:l,disabled:m,label:p,closeOnClick:d,className:y(g,Boolean(i),x),style:N||b?{...N,...b}:void 0,children:[e(k,{}),e("span",{className:`${M} text-(--_mp-accent)`,style:{width:u[g]},children:e(a.RadioItemIndicator,{className:"flex items-center justify-center",children:e("span",{className:"block size-2.5 rounded-full bg-current"})})}),e(O,{description:o,children:f}),h(r)?e("span",{className:`${M} text-mp-on-surface-variant`,children:r}):null,e(P,{shortcut:s})]})}export function MPMenuGroup({label:l,children:r,className:s}){const{size:o}=t.useContext(c);return n(a.Group,{className:s,children:[h(l)?e(a.GroupLabel,{className:`text-mp-on-surface-variant pt-2 pb-1 ${N[o]} ${p}`,children:l}):null,r]})}export function MPMenuSeparator({className:n,...t}){return e(a.Separator,{className:["bg-mp-outline-variant my-2 h-px",n??""].filter(Boolean).join(" "),...t})}export function MPMenuSubmenu({label:l,startIcon:s,disabled:i=!1,side:m="right",sideOffset:p=0,children:f,className:g,style:N}){const{size:v,color:C}=t.useContext(c);return n(a.SubmenuRoot,{children:[n(a.SubmenuTrigger,{disabled:i,className:y(v,!1),children:[e(k,{}),h(s)?e("span",{className:`${M} text-mp-on-surface-variant`,children:s}):null,e("span",{className:"relative min-w-0 flex-1 truncate text-start",children:l}),e("span",{className:`${M} text-mp-on-surface-variant rtl:rotate-180`,children:e(r,{icon:o,size:u[v]})})]}),e(a.Portal,{children:e(a.Positioner,{className:x,side:m,sideOffset:p,align:"start",children:e(a.Popup,{className:[b,g??""].filter(Boolean).join(" "),style:{...d(C),...N},children:f})})})]})}export function MPMenu({size:l="md",color:r="primary",trigger:s,open:o,defaultOpen:i,onOpenChange:m,side:u="bottom",align:p="start",sideOffset:h=4,modal:f,openOnHover:g=!1,loopFocus:N=!0,disabled:v=!1,className:C,style:y,children:k}){const M=t.useMemo(()=>({size:l,color:r}),[l,r]);return e(c.Provider,{value:M,children:n(a.Root,{open:o,defaultOpen:i,onOpenChange:e=>m?.(e),modal:f,loopFocus:N,disabled:v,children:[s?e(a.Trigger,{render:s,openOnHover:g,disabled:v}):null,e(a.Portal,{children:e(a.Positioner,{className:x,side:u,align:p,sideOffset:h,children:e(a.Popup,{"data-mp-size":l,className:[b,C??""].filter(Boolean).join(" "),style:{...d(r),...y},children:k})})})]})})}export function MPContextMenu({size:a="md",color:r="primary",content:s,children:o,open:i,defaultOpen:m,onOpenChange:u,loopFocus:p=!0,disabled:h=!1,className:f,style:g}){const N=t.useMemo(()=>({size:a,color:r}),[a,r]);return e(c.Provider,{value:N,children:n(l.Root,{open:i,defaultOpen:m,onOpenChange:e=>u?.(e),loopFocus:p,disabled:h,children:[e(l.Trigger,{children:o}),e(l.Portal,{children:e(l.Positioner,{className:x,children:e(l.Popup,{"data-mp-size":a,className:[b,f??""].filter(Boolean).join(" "),style:{...d(r),...g},children:s})})})]})})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPContextMenu, MPMenu, MPMenuCheckboxItem, MPMenuGroup, MPMenuItem, MPMenuRadioGroup, MPMenuRadioItem, MPMenuSeparator, MPMenuSubmenu } from './MPMenu';
|
|
2
|
-
export type { MPContextMenuProps, MPMenuCheckboxItemProps, MPMenuGroupProps, MPMenuItemProps, MPMenuProps, MPMenuRadioGroupProps, MPMenuRadioItemProps, MPMenuSeparatorProps, MPMenuSubmenuProps } from './MPMenu';
|
|
1
|
+
export { MPContextMenu, MPMenu, MPMenuCheckboxItem, MPMenuGroup, MPMenuItem, MPMenuRadioGroup, MPMenuRadioItem, MPMenuSeparator, MPMenuSubmenu } from './MPMenu.js';
|
|
2
|
+
export type { MPContextMenuProps, MPMenuCheckboxItemProps, MPMenuGroupProps, MPMenuItemProps, MPMenuProps, MPMenuRadioGroupProps, MPMenuRadioItemProps, MPMenuSeparatorProps, MPMenuSubmenuProps } from './MPMenu.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPContextMenu,MPMenu,MPMenuCheckboxItem,MPMenuGroup,MPMenuItem,MPMenuRadioGroup,MPMenuRadioItem,MPMenuSeparator,MPMenuSubmenu}from"./MPMenu";
|
|
1
|
+
export{MPContextMenu,MPMenu,MPMenuCheckboxItem,MPMenuGroup,MPMenuItem,MPMenuRadioGroup,MPMenuRadioItem,MPMenuSeparator,MPMenuSubmenu}from"./MPMenu.js";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { MPColor, MPOrientation, MPSize } from '../../types.js';
|
|
3
|
+
export interface MPMenubarProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
|
|
4
|
+
/**
|
|
5
|
+
* Which way the bar runs. `vertical` is the shape a side rail of menus takes;
|
|
6
|
+
* the arrow keys follow it either way.
|
|
7
|
+
* @default 'horizontal'
|
|
8
|
+
*/
|
|
9
|
+
orientation?: MPOrientation;
|
|
10
|
+
/**
|
|
11
|
+
* Whether an open menu takes the page away.
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
modal?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the arrow keys wrap around at the ends of the bar.
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
loopFocus?: boolean;
|
|
20
|
+
/** Disables every menu on the bar at once. */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The row height and type scale, passed to every menu on the bar.
|
|
24
|
+
* @default 'md'
|
|
25
|
+
*/
|
|
26
|
+
size?: MPSize;
|
|
27
|
+
/**
|
|
28
|
+
* Which accent family an open menu's word reads, and which a chosen row inside
|
|
29
|
+
* it reads.
|
|
30
|
+
* @default 'primary'
|
|
31
|
+
*/
|
|
32
|
+
color?: MPColor;
|
|
33
|
+
/** The `MPMenubarMenu`s. */
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export interface MPMenubarMenuProps {
|
|
37
|
+
/** The word on the bar. */
|
|
38
|
+
label: React.ReactNode;
|
|
39
|
+
/** A glyph before the label. */
|
|
40
|
+
startIcon?: React.ReactNode;
|
|
41
|
+
/** Unavailable. The word stays on the bar and opens nothing. */
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
/** The rows, written exactly as they are inside an [MPMenu](./menu). */
|
|
44
|
+
children?: React.ReactNode;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* One menu on the bar: the word, and the rows behind it.
|
|
48
|
+
*
|
|
49
|
+
* It has no `size` and no `color` of its own — both belong to the bar, which is
|
|
50
|
+
* the only place they can be set once and hold for every menu on it. The rows
|
|
51
|
+
* inside are the same [MPMenuItem](./menu), `MPMenuSeparator`, `MPMenuGroup` and
|
|
52
|
+
* `MPMenuSubmenu` an [MPMenu](./menu) takes, because it *is* the same menu.
|
|
53
|
+
*/
|
|
54
|
+
export declare function MPMenubarMenu({ label, startIcon, disabled, children }: MPMenubarMenuProps): React.JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* The strip of words at the top of an application — File, Edit, View — each of
|
|
57
|
+
* which opens a menu.
|
|
58
|
+
*
|
|
59
|
+
* ## What makes it a bar rather than a row of menus
|
|
60
|
+
*
|
|
61
|
+
* What happens once one of them is **open**: moving along the strip walks
|
|
62
|
+
* through the others instead of closing the one you left, and the arrow keys
|
|
63
|
+
* move between the menus as well as inside them. Base UI owns all of that, along
|
|
64
|
+
* with the `menubar` role — which is what tells a screen reader that the strip
|
|
65
|
+
* is one widget with one tab stop rather than six unrelated buttons.
|
|
66
|
+
*
|
|
67
|
+
* ## Why it draws no surface
|
|
68
|
+
*
|
|
69
|
+
* A menu bar sits **on** something: an [MPHeader](../layout/header), a title
|
|
70
|
+
* bar, a toolbar. A sheet under a strip that is already on a sheet is two
|
|
71
|
+
* sheets, and the second one has nothing to say. It is the same refusal
|
|
72
|
+
* [MPContainer](../layout/container#why-it-draws-no-surface) makes, one level
|
|
73
|
+
* down.
|
|
74
|
+
*
|
|
75
|
+
* ## When this is the wrong component
|
|
76
|
+
*
|
|
77
|
+
* When there are more actions than a strip can hold. A menu bar's whole
|
|
78
|
+
* advantage is that every heading is visible before you go looking for one, and
|
|
79
|
+
* a bar of twelve words has already lost it — that is an
|
|
80
|
+
* [MPCommandPalette](./command-palette).
|
|
81
|
+
*/
|
|
82
|
+
export declare const MPMenubar: React.ForwardRefExoticComponent<MPMenubarProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{Menubar as r}from"@base-ui/react/menubar";import{MPMenu as n}from"../menu/MPMenu.js";import{accentSlots as i}from"../../internal/accent.js";import{MPMenuContext as s}from"../../internal/menu.js";import{MPStateLayer as a}from"../../internal/StateLayer.js";import{CONTROL_GAP as l,hasContent as m}from"../../internal/scale.js";const c={xs:"h-6",sm:"h-7",md:"h-8",lg:"h-10",xl:"h-12"},p={xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3",xl:"px-4"},u={xs:"text-mp-label-medium",sm:"text-mp-label-large",md:"text-mp-label-large",lg:"text-mp-title-medium",xl:"text-mp-title-medium"};export function MPMenubarMenu({label:r,startIcon:i,disabled:d=!1,children:f}){const{size:x,color:b}=o.useContext(s);return e(n,{size:x,color:b,disabled:d,openOnHover:!0,sideOffset:4,trigger:t("button",{type:"button",disabled:d,className:["mp-menubar__menu group text-mp-on-surface relative inline-flex shrink-0","rounded-mp-xs cursor-pointer items-center justify-center bg-transparent","appearance-none font-[inherit] whitespace-nowrap select-none","transition-colors duration-(--mp-sys-motion-duration-short4)","data-popup-open:text-(--_mp-accent)","disabled:text-mp-on-surface/38 disabled:cursor-default","outline-mp-secondary focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid outline-none",c[x],p[x],u[x],l[x]].join(" "),children:[d?null:e(a,{className:"group-data-popup-open:opacity-8"}),m(i)?e("span",{className:"relative flex",children:i}):null,e("span",{className:"relative",children:r})]}),children:f})}export const MPMenubar=/*@__PURE__*/o.forwardRef(function({orientation:t="horizontal",modal:n=!0,loopFocus:a=!0,disabled:m=!1,size:c="md",color:p="primary",className:u,style:d,children:f,...x},b){const h=o.useMemo(()=>({size:c,color:p}),[c,p]);return e(s.Provider,{value:h,children:e(r,{ref:b,orientation:t,modal:n,loopFocus:a,disabled:m,"data-mp-size":c,"data-mp-orientation":t,className:["mp-menubar flex items-center","vertical"===t?"flex-col items-stretch":"flex-row",l[c],u??""].filter(Boolean).join(" "),style:{...i(p),...d},...x,children:f})})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPMenubar,MPMenubarMenu}from"./MPMenubar.js";
|