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
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{accentSlots as i}from"../../internal/accent.js";import{inertProps as r}from"../../internal/inert.js";import{MPStateLayer as s}from"../../internal/StateLayer.js";import{CONTROL_GAP as a,CONTROL_ICON as l,CONTROL_TEXT as c,hasContent as m,META_TEXT as d,PROSE_TEXT as p,SHEET_PAD_X as u}from"../../internal/scale.js";const f={xs:"min-h-8",sm:"min-h-10",md:"min-h-14",lg:"min-h-16",xl:"min-h-18"},h={xs:"px-4",sm:"px-5",md:"px-6",lg:"px-8",xl:"px-10"},x={filled:"shadow-mp-2 bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"shadow-mp-2 bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-2 bg-mp-surface-container-low text-(--_mp-accent)",outlined:"border-mp-outline shadow-mp-1 border bg-mp-surface-container text-mp-on-surface",text:"shadow-mp-1 bg-mp-surface-container text-mp-on-surface"},b={static:{top:"",bottom:""},sticky:{top:"sticky top-3 z-20",bottom:"sticky bottom-3 z-20"},fixed:{top:"fixed inset-x-0 top-3 z-30 mx-auto w-fit",bottom:"fixed inset-x-0 bottom-3 z-30 mx-auto w-fit"}};export const MPPill=/*@__PURE__*/o.forwardRef(function({startIcon:w,endIcon:v,title:g,description:y,details:j,expanded:N=!1,position:k="static",side:_="top",onClick:z,variant:B="filled",size:C="md",color:I="secondary",className:R,style:$,children:H,...P},S){const E=o.useRef(null),F=o.useId(),[L,M]=o.useState(0);o.useEffect(()=>{const e=E.current;if(!e)return;const t=new ResizeObserver(()=>M(e.scrollHeight));return t.observe(e),M(e.scrollHeight),()=>t.disconnect()},[j]);const O=Boolean(z),q=u[C],A=t(n,{children:[m(w)?e("span",{className:"flex shrink-0 items-center justify-center overflow-hidden rounded-mp-full [&_img]:size-full [&_img]:object-cover",style:{width:l[C],height:l[C]},children:w}):null,m(g)||m(y)||m(H)?t("span",{className:["flex min-w-0 flex-1 flex-col items-center justify-center text-center",h[C]].join(" "),children:[m(g)?e("span",{className:"max-w-full truncate",children:g}):null,m(y)?e("span",{className:`max-w-full truncate font-normal ${d} [color:color-mix(in_oklab,currentColor_72%,transparent)]`,children:y}):null,H]}):null]});return t("div",{ref:S,"data-mp-size":C,"data-mp-variant":B,"data-mp-expanded":N||void 0,className:["mp-pill inline-flex max-w-full flex-col overflow-hidden align-middle","box-border whitespace-nowrap select-none",N?"rounded-mp-xl":"rounded-mp-full","transition-[border-radius,background-color,box-shadow]","duration-(--mp-sys-motion-duration-short4) ease-mp-standard","motion-reduce:transition-none",c[C],x[B],b[k][_],R??""].filter(Boolean).join(" "),style:{...i(I),...$},...P,children:[t("div",{className:["flex shrink-0 items-center py-1",f[C],a[C],O?"ps-0":q,m(v)?"pe-1":O?"pe-0":""].filter(Boolean).join(" "),children:[O?t("button",{type:"button",className:["group relative flex min-w-0 flex-1 cursor-pointer items-center justify-center","self-stretch appearance-none border-0 bg-transparent font-[inherit] text-inherit","rounded-[inherit]",a[C],q,"outline-mp-secondary focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),"aria-expanded":m(j)?N:void 0,"aria-controls":m(j)?F:void 0,onClick:z,children:[e(s,{}),A]}):A,m(v)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:v}):null]}),m(j)?e("div",{id:F,className:["overflow-hidden","transition-[height] duration-(--mp-sys-motion-duration-short4) ease-mp-standard","motion-reduce:transition-none"].join(" "),style:{height:N?L:0},...r(!N),children:e("div",{ref:E,className:`${q} pb-2 whitespace-normal ${p[C]}`,children:j})}):null]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPPill } from './MPPill';
|
|
2
|
-
export type { MPPillPosition, MPPillProps } from './MPPill';
|
|
1
|
+
export { MPPill } from './MPPill.js';
|
|
2
|
+
export type { MPPillPosition, MPPillProps } from './MPPill.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPPill}from"./MPPill";
|
|
1
|
+
export{MPPill}from"./MPPill.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Popover } from '@base-ui/react/popover';
|
|
3
|
-
import type { MPAlign, MPSide, MPSize } from '../../types';
|
|
3
|
+
import type { MPAlign, MPSide, MPSize } from '../../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* A popover takes `side`, `align` and `size`, and stops there.
|
|
6
6
|
*
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Popover as s}from"@base-ui/react/popover";import{MPIcon as t}from"../icon/MPIcon.js";import{CloseIcon as i}from"../../constants/icons.js";import{useMPLocale as a,useMPMessages as l}from"../../internal/locale.js";import{cssLength as r}from"../../internal/length.js";import{COMMON as n}from"../../internal/messages/common.js";import{MPStateLayer as m}from"../../internal/StateLayer.js";import{hasContent as c,META_TEXT as d,PROSE_TEXT as p,SHEET_GAP as f,SHEET_PAD as u,SHEET_TITLE as h}from"../../internal/scale.js";import{FADE as x,PORTAL_LAYER as g}from"../../internal/surface.js";const v={xs:"max-w-56",sm:"max-w-64",md:"max-w-80",lg:"max-w-96",xl:"max-w-lg"},b={xs:8,sm:9,md:10,lg:11,xl:12};export const MPPopoverClose=s.Close;export function MPPopover({trigger:j,title:w,description:N,side:O="bottom",align:P="center",sideOffset:y=8,alignOffset:C=0,arrow:z=!1,open:k,defaultOpen:M,onOpenChange:L,modal:B=!1,dismissible:T=!0,showClose:$=!1,closeLabel:A,locale:D,width:I,size:R="md",className:S,style:W,children:_}){const q=a(D),E=l(n,q),F=c(w)||c(N),G=b[R];return o(s.Root,{open:k,defaultOpen:M,modal:B,onOpenChange:(e,o)=>{T||e||"escape-key"!==o.reason&&"outside-press"!==o.reason&&"focus-out"!==o.reason?L?.(e):o.cancel()},children:[j?e(s.Trigger,{render:j}):null,e(s.Portal,{children:e(s.Positioner,{className:g,side:O,align:P,sideOffset:y,alignOffset:C,children:o(s.Popup,{"data-mp-size":R,className:["mp-popover rounded-mp-md relative flex flex-col outline-none","bg-mp-surface-container text-mp-on-surface shadow-mp-2","box-border",u[R],f[R],p[R],void 0===I?v[R]:"",x,S??""].filter(Boolean).join(" "),style:{...void 0===I?null:{maxWidth:r(I)},...W},children:[z?e(s.Arrow,{className:["data-[side=top]:bottom-[-1px]","data-[side=bottom]:top-[-1px] data-[side=bottom]:rotate-180","data-[side=left]:right-[-1px] data-[side=left]:-rotate-90","data-[side=right]:left-[-1px] data-[side=right]:rotate-90"].join(" "),children:e("svg",{width:G,height:G/2,viewBox:"0 0 10 5","aria-hidden":"true",className:"block",children:e("path",{d:"M0 0h10L5 5z",fill:"var(--_mp-color-surface-container)"})})}):null,F||$?o("div",{className:"flex shrink-0 items-start gap-3",children:[o("div",{className:"flex min-w-0 flex-1 flex-col",children:[c(w)?e(s.Title,{className:`m-0 ${h[R]}`,children:w}):null,c(N)?e(s.Description,{className:`text-mp-on-surface-variant m-0 ${d}`,children:N}):null]}),$?o(s.Close,{"aria-label":A??E.close,className:["group text-mp-on-surface-variant relative flex size-8 shrink-0","rounded-mp-full -m-1 cursor-pointer items-center justify-center","appearance-none border-0 bg-transparent","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),children:[e(m,{}),e(t,{icon:i,size:18})]}):null]}):null,c(_)?e("div",{className:"min-w-0",children:_}):null]})})})]})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPPopover, MPPopoverClose } from './MPPopover';
|
|
2
|
-
export type { MPPopoverCloseProps, MPPopoverProps } from './MPPopover';
|
|
1
|
+
export { MPPopover, MPPopoverClose } from './MPPopover.js';
|
|
2
|
+
export type { MPPopoverCloseProps, MPPopoverProps } from './MPPopover.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPPopover,MPPopoverClose}from"./MPPopover";
|
|
1
|
+
export{MPPopover,MPPopoverClose}from"./MPPopover.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type MPProgressProps } from '../../internal/progress';
|
|
3
|
-
import type { MPColor, MPSize } from '../../types';
|
|
2
|
+
import { type MPProgressProps } from '../../internal/progress.js';
|
|
3
|
+
import type { MPColor, MPSize } from '../../types.js';
|
|
4
4
|
export interface MPProgressBoxProps extends MPProgressProps {
|
|
5
5
|
/** Size of one segment. @default 'md' */
|
|
6
6
|
size?: MPSize;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Progress as s}from"@base-ui/react/progress";import{accentSlots as l}from"../../internal/accent.js";import{META_TEXT as t,STACK_GAP as n}from"../../internal/scale.js";import{SEGMENT_GAP as o,SEGMENT_RADIUS as i,SEGMENT_SIZE as m,progressAriaText as c,progressFraction as u,progressText as f}from"../../internal/progress.js";export const MPProgressBox=/*@__PURE__*/r.forwardRef(function({size:r="md",color:p="primary",count:d=4,value:x=null,min:h=0,max:g=100,label:b,showValue:j=!1,format:y,className:v,style:w},N){const M=u(x,h,g),B=null===M,V=void 0!==y,_=Math.max(1,Math.floor(d));return a(s.Root,{ref:N,value:null===M?null:x??null,min:h,max:g,format:y,getAriaValueText:c(M,V),"data-mp-size":r,className:["mp-progress-box inline-flex flex-col",n[r],v??""].filter(Boolean).join(" "),style:{...l(p),...w},children:[b||j?a("div",{className:["flex items-baseline gap-2",b?"justify-between":"justify-end",t].join(" "),children:[b?e(s.Label,{className:"text-mp-on-surface min-w-0 truncate",children:b}):null,j?e(s.Value,{className:"text-mp-on-surface-variant shrink-0 tabular-nums",children:e=>f(M,e,V)}):null]}):null,e(s.Track,{className:`flex ${o[r]}`,children:Array.from({length:_},(a,s)=>e("span",{className:["bg-mp-on-surface/12 relative overflow-hidden",m[r],i[r],B?"mp-progress-segment-wave bg-(--_mp-accent)":""].filter(Boolean).join(" "),style:B?{"--_mp-index":s}:void 0,children:B?null:e("span",{className:"absolute inset-y-0 start-0 bg-(--_mp-accent) transition-[width] duration-(--mp-sys-motion-duration-short4) ease-mp-standard",style:{width:`${Math.min(100,Math.max(0,100*(M*_-s)))}%`}})},s))})]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPProgressBox } from './MPProgressBox';
|
|
2
|
-
export type { MPProgressBoxProps } from './MPProgressBox';
|
|
1
|
+
export { MPProgressBox } from './MPProgressBox.js';
|
|
2
|
+
export type { MPProgressBoxProps } from './MPProgressBox.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPProgressBox}from"./MPProgressBox";
|
|
1
|
+
export{MPProgressBox}from"./MPProgressBox.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type MPProgressProps } from '../../internal/progress';
|
|
3
|
-
import type { MPColor, MPSize } from '../../types';
|
|
2
|
+
import { type MPProgressProps } from '../../internal/progress.js';
|
|
3
|
+
import type { MPColor, MPSize } from '../../types.js';
|
|
4
4
|
export interface MPProgressCircularProps extends MPProgressProps {
|
|
5
5
|
/**
|
|
6
6
|
* Diameter of the ring. `md` is MD3's own 48dp, and every rung sits inside the
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as r,jsxs as e}from"react/jsx-runtime";import*as a from"react";import{Progress as s}from"@base-ui/react/progress";import{accentSlots as t}from"../../internal/accent.js";import{CONTROL_GAP as o,META_TEXT as n}from"../../internal/scale.js";import{RING_DIAMETER as l,RING_STROKE as i,progressAriaText as c,progressFraction as m,progressText as u}from"../../internal/progress.js";export const MPProgressCircular=/*@__PURE__*/a.forwardRef(function({size:a="md",color:p="primary",value:f=null,min:h=0,max:d=100,label:x,showValue:k=!1,format:g,className:v,style:y},j){const N=m(f,h,d),w=null===N,b=void 0!==g,$=l[a],L=i[a],V=$/2,z=V-L/2;return e(s.Root,{ref:j,value:null===N?null:f??null,min:h,max:d,format:g,getAriaValueText:c(N,b),"data-mp-size":a,className:["mp-progress-circular inline-flex items-center",o[a],n,v??""].filter(Boolean).join(" "),style:{...t(p),...y},children:[e("svg",{className:w?"mp-progress-circular-turn shrink-0":"shrink-0",width:$,height:$,viewBox:`0 0 ${$} ${$}`,fill:"none","aria-hidden":"true",children:[r("circle",{cx:V,cy:V,r:z,stroke:"var(--_mp-color-on-surface)",strokeOpacity:.12,strokeWidth:L}),r("circle",{cx:V,cy:V,r:z,pathLength:100,stroke:"var(--_mp-accent)",strokeWidth:L,strokeLinecap:"round",className:w?"mp-progress-circular-arc":"transition-[stroke-dashoffset] duration-(--mp-sys-motion-duration-short4) ease-mp-standard",transform:`rotate(-90 ${V} ${V})`,...w?null:{strokeDasharray:100,strokeDashoffset:100*(1-N)}})]}),x?r(s.Label,{className:"text-mp-on-surface min-w-0 truncate",children:x}):null,k?r(s.Value,{className:"text-mp-on-surface-variant shrink-0 tabular-nums",children:r=>u(N,r,b)}):null]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPProgressCircular } from './MPProgressCircular';
|
|
2
|
-
export type { MPProgressCircularProps } from './MPProgressCircular';
|
|
1
|
+
export { MPProgressCircular } from './MPProgressCircular.js';
|
|
2
|
+
export type { MPProgressCircularProps } from './MPProgressCircular.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPProgressCircular}from"./MPProgressCircular";
|
|
1
|
+
export{MPProgressCircular}from"./MPProgressCircular.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type MPProgressProps } from '../../internal/progress';
|
|
3
|
-
import type { MPColor, MPSize } from '../../types';
|
|
2
|
+
import { type MPProgressProps } from '../../internal/progress.js';
|
|
3
|
+
import type { MPColor, MPSize } from '../../types.js';
|
|
4
4
|
export interface MPProgressLinearProps extends MPProgressProps {
|
|
5
5
|
/**
|
|
6
6
|
* Thickness of the track. `md` is MD3's own 4dp; nothing else on a bar has a
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Progress as l}from"@base-ui/react/progress";import{accentSlots as s}from"../../internal/accent.js";import{META_TEXT as n,STACK_GAP as t}from"../../internal/scale.js";import{BAR_THICKNESS as i,progressAriaText as o,progressFraction as m,progressText as c}from"../../internal/progress.js";export const MPProgressLinear=/*@__PURE__*/r.forwardRef(function({size:u="md",color:p="primary",value:f=null,min:d=0,max:x=100,label:g,showValue:h=!1,format:j,className:b,style:N},w){const v=m(f,d,x),y=null===v,V=void 0!==j,$="absolute inset-y-0 rounded-mp-full bg-(--_mp-accent)";return a(l.Root,{ref:w,value:null===v?null:f??null,min:d,max:x,format:j,getAriaValueText:o(v,V),"data-mp-size":u,className:["mp-progress-linear flex w-full flex-col",t[u],b??""].filter(Boolean).join(" "),style:{...s(p),...N},children:[g||h?a("div",{className:["flex items-baseline gap-2",g?"justify-between":"justify-end",n].join(" "),children:[g?e(l.Label,{className:"text-mp-on-surface min-w-0 truncate",children:g}):null,h?e(l.Value,{className:"text-mp-on-surface-variant shrink-0 tabular-nums",children:e=>c(v,e,V)}):null]}):null,e(l.Track,{className:["rounded-mp-full bg-mp-on-surface/12 relative w-full overflow-hidden",i[u]].join(" "),children:y?a(r.Fragment,{children:[e("span",{className:`${$} mp-progress-linear-lead`}),e("span",{className:`${$} mp-progress-linear-trail`})]}):e(l.Indicator,{className:`${$} start-0 transition-[width] duration-(--mp-sys-motion-duration-short4) ease-mp-standard`})})]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPProgressLinear } from './MPProgressLinear';
|
|
2
|
-
export type { MPProgressLinearProps } from './MPProgressLinear';
|
|
1
|
+
export { MPProgressLinear } from './MPProgressLinear.js';
|
|
2
|
+
export type { MPProgressLinearProps } from './MPProgressLinear.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPProgressLinear}from"./MPProgressLinear";
|
|
1
|
+
export{MPProgressLinear}from"./MPProgressLinear.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { MPColor, MPOrientation, MPSize } from '../../types';
|
|
2
|
+
import type { MPColor, MPOrientation, MPSize } from '../../types.js';
|
|
3
3
|
export interface MPRadioProps {
|
|
4
4
|
/** What this option is worth. Reported by the group's `onValueChange`. */
|
|
5
5
|
value: string;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Radio as i}from"@base-ui/react/radio";import{RadioGroup as n}from"@base-ui/react/radio-group";import{Field as l}from"@base-ui/react/field";import{accentSlots as o}from"../../internal/accent.js";import{MPStateLayer as t}from"../../internal/StateLayer.js";import{MPSupportingText as s}from"../../internal/SupportingText.js";import{META_TEXT as d,PROSE_TEXT as c,hasContent as p}from"../../internal/scale.js";const u={xs:{ring:"size-4",fill:"size-2",halo:"size-8"},sm:{ring:"size-[18px]",fill:"size-[9px]",halo:"size-9"},md:{ring:"size-5",fill:"size-2.5",halo:"size-10"},lg:{ring:"size-[22px]",fill:"size-[11px]",halo:"size-11"},xl:{ring:"size-6",fill:"size-3",halo:"size-12"}},m=/*@__PURE__*/r.createContext({size:"md",readOnly:!1,invalid:!1});export const MPRadio=/*@__PURE__*/r.forwardRef(function({value:n,label:o,description:s,disabled:f=!1,id:x},g){const h=r.useContext(m),b=u[h.size],y=r.useId(),z=x??y;return e(l.Root,{className:"mp-radio inline-block align-top",disabled:f,"data-mp-value":n,children:a("div",{className:["flex items-start gap-3",c[h.size]].join(" "),children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:a(i.Root,{ref:g,id:z,value:n,disabled:f,className:["mp-radio__dot group relative inline-flex shrink-0 items-center justify-center","box-border rounded-full border-2 p-0","appearance-none bg-transparent font-[inherit] outline-none","transition-[border-color] duration-(--mp-sys-motion-duration-short4)",b.ring,f?"border-mp-on-surface/38 cursor-default":[h.readOnly?"cursor-default":"cursor-pointer",h.invalid?"border-mp-error":"border-mp-on-surface-variant","data-checked:border-(--_mp-accent)"].join(" ")].join(" "),children:[f?null:e(t,{layer:["top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",b.halo,"bg-mp-on-surface","group-data-checked:bg-(--_mp-accent)"].join(" ")}),e(i.Indicator,{className:["rounded-full",b.fill,"transition-[opacity,scale] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard","data-starting-style:scale-0 data-starting-style:opacity-0","data-ending-style:scale-0 data-ending-style:opacity-0",f?"bg-mp-on-surface/38":"bg-(--_mp-accent)"].join(" ")})]})}),p(o)||p(s)?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[p(o)?e(l.Label,{htmlFor:z,className:["leading-[1.4]",f?"text-mp-on-surface/38 cursor-default":h.readOnly?"text-mp-on-surface":"text-mp-on-surface cursor-pointer"].join(" "),children:o}):null,p(s)?e(l.Description,{className:`${d} text-mp-on-surface-variant data-disabled:text-mp-on-surface/38`,children:s}):null]}):null]})})});export const MPRadioGroup=/*@__PURE__*/r.forwardRef(function({value:i,defaultValue:t,onValueChange:c,label:u,description:f,errorMessage:x,orientation:g="vertical",size:h="md",color:b="primary",required:y=!1,disabled:z=!1,readOnly:v=!1,name:j,children:N},R){const O=p(x),k=O?"error":b,w=r.useId(),M=r.useMemo(()=>({size:h,readOnly:v,invalid:O}),[h,v,O]);return e(m.Provider,{value:M,children:a(l.Root,{className:"mp-radio-group flex flex-col gap-2",disabled:z,invalid:O,"data-mp-size":h,"data-mp-orientation":g,style:o(k),children:[p(u)?a("span",{id:w,className:[d,z?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:[u,y?e("span",{"aria-hidden":"true",children:" *"}):null]}):null,e(n,{ref:R,"aria-labelledby":p(u)?w:void 0,value:i,defaultValue:t,onValueChange:e=>c?.(String(e??"")),disabled:z,readOnly:v,required:y,name:j,className:["flex","horizontal"===g?"flex-row flex-wrap gap-x-6 gap-y-2":"flex-col gap-2"].join(" "),children:N}),e(s,{description:f,errorMessage:x})]})})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPRadio, MPRadioGroup } from './MPRadioGroup';
|
|
2
|
-
export type { MPRadioGroupProps, MPRadioProps } from './MPRadioGroup';
|
|
1
|
+
export { MPRadio, MPRadioGroup } from './MPRadioGroup.js';
|
|
2
|
+
export type { MPRadioGroupProps, MPRadioProps } from './MPRadioGroup.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPRadio,MPRadioGroup}from"./MPRadioGroup";
|
|
1
|
+
export{MPRadio,MPRadioGroup}from"./MPRadioGroup.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type MPMessages } from '../../internal/i18n';
|
|
3
|
-
import type { MPColor, MPSize } from '../../types';
|
|
2
|
+
import { type MPMessages } from '../../internal/i18n.js';
|
|
3
|
+
import type { MPColor, MPSize } from '../../types.js';
|
|
4
4
|
/** The words the control says on its own behalf. */
|
|
5
5
|
export type MPRatingLabels = MPMessages['rating'];
|
|
6
6
|
export interface MPRatingProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'defaultValue' | 'onChange'> {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{MPIcon as i}from"../icon/MPIcon.js";import{StarIcon as n}from"../../constants/icons.js";import{accentSlots as r}from"../../internal/accent.js";import{fillMessage as o}from"../../internal/i18n.js";import{useMPLocale as s,useMPMessages as l}from"../../internal/locale.js";import{RATING as m}from"../../internal/messages/rating.js";import{VISUALLY_HIDDEN as c}from"../../internal/visually-hidden.js";const d={xs:16,sm:20,md:24,lg:30,xl:36},u={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const MPRating=/*@__PURE__*/a.forwardRef(function({value:p,defaultValue:h=0,onValueChange:f,count:g=5,precision:x=1,icon:y,emptyIcon:v,clearable:j=!0,readOnly:b=!1,disabled:M=!1,name:N,required:P=!1,size:w="md",color:S="primary",locale:R,labels:_,structuredData:z=!1,className:I,style:k,onPointerLeave:q,...C},L){const V=s(R),A=l(m,V,_),B=a.useId(),F=N??B,[D,E]=a.useState(h),O=void 0!==p,T=O?p:D,[G,H]=a.useState(null),J=Math.max(1,Math.floor(g)),K=x>0&&x<=1?x:1,Q=Math.round(1/K),U=Math.max(0,Math.min(J,G??T)),W=e=>e<=0?A.empty:o(A.value,{value:String(e),max:String(J)}),X=e=>{O||E(e),f?.(e)},Y=t=>{const a=e(i,{icon:n,size:d[w],className:t?"[&>svg]:fill-current":""});return(t?y:v)??a},Z=Array.from({length:J},(a,i)=>{const n=Math.max(0,Math.min(1,U-i));return t("span",{className:["mp-rating__star relative inline-flex shrink-0","rounded-mp-xs",b||M?"":["outline-mp-secondary has-[:focus-visible]:outline-2","has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-solid"].join(" ")].filter(Boolean).join(" "),style:{width:d[w],height:d[w]},children:[e("span",{className:["flex items-center justify-center",M?"text-mp-on-surface/38":"text-mp-outline"].join(" "),style:{width:d[w],height:d[w]},children:Y(!1)}),e("span",{"aria-hidden":"true",className:"mp-rating__fill pointer-events-none absolute inset-y-0 start-0 overflow-hidden",style:{width:100*n+"%"},children:e("span",{className:["flex items-center justify-center","transition-colors duration-(--mp-sys-motion-duration-short4)",M?"text-mp-on-surface/38":"text-(--_mp-accent)"].join(" "),style:{width:d[w],height:d[w]},children:Y(!0)})}),b?null:Array.from({length:Q},(t,a)=>{const n=Number((i+(a+1)*K).toFixed(4));return e("label",{className:["absolute inset-y-0",M?"":"cursor-pointer"].join(" "),style:{insetInlineStart:100*a/Q+"%",width:100/Q+"%"},onPointerEnter:()=>{M||H(n)},children:e("input",{type:"radio",className:c,name:F,value:n,checked:T===n,disabled:M,required:P,"aria-label":W(n),onChange:()=>X(n),onClick:()=>{j&&T===n&&X(0)}})},n)})]},i)}),$=["mp-rating inline-flex items-center align-middle",u[w],I??""].filter(Boolean).join(" "),ee={...r(S),...k};if(b){const i=Math.max(0,Math.min(J,T));return t("div",{ref:L,role:"img","data-mp-size":w,"aria-label":W(i),itemScope:z||void 0,itemType:z?"https://schema.org/Rating":void 0,className:$,style:ee,onPointerLeave:q,...C,children:[z?t(a.Fragment,{children:[e("meta",{itemProp:"ratingValue",content:String(i)}),e("meta",{itemProp:"bestRating",content:String(J)}),e("meta",{itemProp:"worstRating",content:"0"})]}):null,Z]})}return e("div",{ref:L,role:"radiogroup","data-mp-size":w,"aria-label":A.label,"aria-disabled":M||void 0,"aria-required":P||void 0,className:$,style:ee,onPointerLeave:e=>{H(null),q?.(e)},...C,children:Z})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPRating } from './MPRating';
|
|
2
|
-
export type { MPRatingLabels, MPRatingProps } from './MPRating';
|
|
1
|
+
export { MPRating } from './MPRating.js';
|
|
2
|
+
export type { MPRatingLabels, MPRatingProps } from './MPRating.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPRating}from"./MPRating";
|
|
1
|
+
export{MPRating}from"./MPRating.js";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{Toggle as n}from"@base-ui/react/toggle";import{ToggleGroup as o}from"@base-ui/react/toggle-group";import{MPIcon as a}from"../icon/MPIcon.js";import{CheckIcon as i}from"../../constants/icons.js";import{MPStateLayer as s}from"../../internal/StateLayer.js";import{CONTROL_GAP as l,CONTROL_HEIGHT as d,CONTROL_ICON as c,CONTROL_PAD_X as u,CONTROL_TEXT as m}from"../../internal/scale.js";export const MPSegmentedButton=/*@__PURE__*/r.forwardRef(function({items:r,value:p,defaultValue:f,onValueChange:b,multiple:h=!1,showCheck:g=!0,size:j="md",fullWidth:x=!1,disabled:y=!1,"aria-label":v},w){return e(o,{ref:w,"aria-label":v,value:p,defaultValue:f,onValueChange:e=>b?.(e),multiple:h,disabled:y,"data-mp-size":j,className:["mp-segmented-button rounded-mp-full box-border items-center align-middle","overflow-hidden border",y?"border-mp-on-surface/12":"border-mp-outline",x?"flex w-full":"inline-flex w-fit",d[j]].join(" "),children:r.map((r,o)=>{const d=y||r.disabled;return t(n,{value:r.value,disabled:r.disabled,className:["mp-segmented-button__segment group relative flex h-full items-center","box-border justify-center bg-transparent font-[inherit] whitespace-nowrap","select-none","appearance-none overflow-hidden outline-none","transition-[background-color,color] duration-(--mp-sys-motion-duration-short4)",m[j],l[j],u[j],0===o?"":"border-s",d?"border-mp-on-surface/12 text-mp-on-surface/38 cursor-default":["border-mp-outline cursor-pointer","text-mp-on-surface","data-pressed:bg-mp-secondary-container","data-pressed:text-mp-on-secondary-container"].join(" "),x?"flex-1":""].filter(Boolean).join(" "),children:[d?null:e(s,{}),g||r.icon?t("span",{className:"relative flex shrink-0 items-center justify-center",style:{width:c[j],height:c[j]},children:[g?e("span",{className:["absolute inset-0 flex items-center justify-center opacity-0","transition-opacity duration-(--mp-sys-motion-duration-short4)","ease-mp-standard group-data-pressed:opacity-100"].join(" "),children:e(a,{icon:i,size:c[j]})}):null,r.icon?e("span",{className:["absolute inset-0 flex items-center justify-center","transition-opacity duration-(--mp-sys-motion-duration-short4)","ease-mp-standard",g?"group-data-pressed:opacity-0":""].filter(Boolean).join(" "),children:r.icon}):null]}):null,e("span",{className:"truncate",children:r.label})]},`${o}:${r.value}`)})})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPSegmentedButton } from './MPSegmentedButton';
|
|
2
|
-
export type { MPSegment, MPSegmentedButtonProps } from './MPSegmentedButton';
|
|
1
|
+
export { MPSegmentedButton } from './MPSegmentedButton.js';
|
|
2
|
+
export type { MPSegment, MPSegmentedButtonProps } from './MPSegmentedButton.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPSegmentedButton}from"./MPSegmentedButton";
|
|
1
|
+
export{MPSegmentedButton}from"./MPSegmentedButton.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { MPStyleProps } from '../../types';
|
|
2
|
+
import type { MPStyleProps } from '../../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* What a select's value may be.
|
|
5
5
|
*
|
|
@@ -23,7 +23,18 @@ export interface MPSelectProps extends MPStyleProps {
|
|
|
23
23
|
* The options, as data. There is no `<MPSelect.Option>` to compose: what a
|
|
24
24
|
* caller has is almost always an array already, and the list has to be
|
|
25
25
|
* available to the trigger before the popup has ever been opened — otherwise
|
|
26
|
-
* a closed select can only show its raw value.
|
|
26
|
+
* a closed select can only show its raw value. *
|
|
27
|
+
* ## How long a list this holds
|
|
28
|
+
*
|
|
29
|
+
* Every row is rendered, and there is no windowing. That is the right default
|
|
30
|
+
* — windowing costs a measured container, a scroll listener and a row height
|
|
31
|
+
* the component would have to decide for the caller — and it has a ceiling: a
|
|
32
|
+
* few hundred rows is nothing, a few thousand is a visible pause when the list
|
|
33
|
+
* opens, and past that the answer is a narrower list rather than a faster one.
|
|
34
|
+
*
|
|
35
|
+
* A list somebody has to scroll ten thousand rows of is a list that wanted a
|
|
36
|
+
* filter. Where it genuinely is that long, window it yourself and pass the
|
|
37
|
+
* slice.
|
|
27
38
|
*/
|
|
28
39
|
items: readonly MPSelectOption[];
|
|
29
40
|
/** The chosen value. Use with `onValueChange` for a controlled select. */
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{Select as n}from"@base-ui/react/select";import{Field as r}from"@base-ui/react/field";import{MPIcon as i}from"../icon/MPIcon.js";import{CheckIcon as l,ChevronDownIcon as o}from"../../constants/icons.js";import{MPFieldLabel as s,MPFieldOutline as d,useFloatingLabel as c}from"../../internal/FieldOutline.js";import{MPStateLayer as m}from"../../internal/StateLayer.js";import{MPSupportingText as p}from"../../internal/SupportingText.js";import{CONTROL_ICON as u,PROSE_TEXT as f,hasContent as h}from"../../internal/scale.js";import{FADE as g,PORTAL_LAYER as x}from"../../internal/surface.js";const v={xs:{padding:"px-2",height:"h-8"},sm:{padding:"px-3",height:"h-10"},md:{padding:"px-4",height:"h-14"},lg:{padding:"px-4",height:"h-16"},xl:{padding:"px-5",height:"h-18"}};export const MPSelect=/*@__PURE__*/t.forwardRef(function({items:b,value:j,defaultValue:N,onValueChange:y,placeholder:w,label:I,floatingLabel:S=!0,description:k,errorMessage:z,startIcon:P,size:M="md",fullWidth:O=!1,required:V=!1,disabled:q=!1,readOnly:T=!1,name:_,id:C},L){const R=h(z),F=v[M],W=t.useId(),$=C??W,[B,A]=t.useState(N??null),[D,E]=t.useState(!1),G=void 0===j?B:j,{shrunk:H,focusProps:J}=c({floating:S&&h(I),filled:null!==G&&""!==G,pinned:D||!!P}),K=t.useMemo(()=>b.map(e=>({label:e.label??String(e.value),value:e.value})),[b]);return a(r.Root,{className:["mp-select group flex-col align-top",O?"flex w-full":"inline-flex w-fit"].join(" "),disabled:q,invalid:R,"data-mp-size":M,...J,children:[a(n.Root,{id:$,name:_,items:K,value:j,defaultValue:N,onValueChange:e=>{A(e??null),y?.(e??null)},onOpenChange:E,disabled:q,readOnly:T,required:V,children:[a("div",{className:"relative w-full",children:[a(n.Trigger,{ref:L,className:["relative flex w-full items-center gap-2 select-none","appearance-none bg-transparent font-[inherit] outline-none",F.padding,F.height,f[M],q?"text-mp-on-surface/38 cursor-default":"text-mp-on-surface "+(T?"cursor-default":"cursor-pointer")].join(" "),children:[P?e("span",{className:["flex shrink-0 items-center",q?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:P}):null,e(n.Value,{className:["min-w-0 flex-1 truncate text-start","data-placeholder:text-mp-on-surface-variant",q?"data-placeholder:text-mp-on-surface/38":""].filter(Boolean).join(" "),placeholder:H?w:void 0}),e(n.Icon,{className:["flex shrink-0 items-center","transition-transform duration-(--mp-sys-motion-duration-short4)","data-popup-open:rotate-180",q?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:e(i,{icon:o,size:u[M]})})]}),e(d,{label:I,required:V,notched:H}),h(I)?e(s,{size:M,label:I,required:V,htmlFor:$,shrunk:H}):null]}),e(n.Portal,{children:e(n.Positioner,{className:x,sideOffset:4,alignItemWithTrigger:!1,children:e(n.Popup,{className:["mp-select__popup rounded-mp-xs shadow-mp-2 bg-mp-surface-container p-2","text-mp-on-surface min-w-[var(--anchor-width)] outline-none",f[M],g].join(" "),children:e(n.List,{className:"max-h-[min(20rem,var(--available-height))] overflow-y-auto overscroll-contain",children:b.map((t,r)=>a(n.Item,{value:t.value,disabled:t.disabled,className:["mp-select__item group rounded-mp-xs relative flex cursor-pointer items-center","gap-3 py-2 pe-3 ps-2 select-none outline-none","transition-[background-color,color]","duration-(--mp-sys-motion-duration-short4)","data-selected:text-mp-on-secondary-container","data-selected:bg-mp-secondary-container","data-disabled:text-mp-on-surface/38 data-disabled:cursor-default"].join(" "),children:[e(m,{className:"group-data-highlighted:opacity-8 group-data-disabled:opacity-0"}),e("span",{className:"flex size-5 shrink-0 items-center justify-center",children:e(n.ItemIndicator,{children:e(i,{icon:l,size:18})})}),e(n.ItemText,{className:"min-w-0 flex-1 truncate",children:t.label??String(t.value)})]},`${r}:${String(t.value)}`))})})})})]}),e(p,{description:k,errorMessage:z,className:F.padding})]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPSelect } from './MPSelect';
|
|
2
|
-
export type { MPSelectOption, MPSelectProps, MPSelectValue } from './MPSelect';
|
|
1
|
+
export { MPSelect } from './MPSelect.js';
|
|
2
|
+
export type { MPSelectOption, MPSelectProps, MPSelectValue } from './MPSelect.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPSelect}from"./MPSelect";
|
|
1
|
+
export{MPSelect}from"./MPSelect.js";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,Fragment as n,jsxs as a}from"react/jsx-runtime";import*as m from"react";import{accentSlots as t}from"../../internal/accent.js";import{tokenizeShortcut as o,useDetectedOS as r}from"../../internal/keys.js";import{VISUALLY_HIDDEN as l}from"../../internal/visually-hidden.js";const s=e=>({symbol:e,name:e}),i={mod:{mac:{symbol:"⌘",name:"Command"},windows:s("Ctrl"),linux:s("Ctrl")},meta:{mac:{symbol:"⌘",name:"Command"},windows:s("Win"),linux:s("Super")},ctrl:{mac:{symbol:"⌃",name:"Control"},windows:s("Ctrl"),linux:s("Ctrl")},alt:{mac:{symbol:"⌥",name:"Option"},windows:s("Alt"),linux:s("Alt")},shift:{mac:{symbol:"⇧",name:"Shift"},windows:s("Shift"),linux:s("Shift")},enter:{mac:{symbol:"↩",name:"Enter"},windows:s("Enter"),linux:s("Enter")},tab:{mac:{symbol:"⇥",name:"Tab"},windows:s("Tab"),linux:s("Tab")},escape:{mac:{symbol:"⎋",name:"Escape"},windows:s("Esc"),linux:s("Esc")},backspace:{mac:{symbol:"⌫",name:"Backspace"},windows:s("Backspace"),linux:s("Backspace")},delete:{mac:{symbol:"⌦",name:"Delete"},windows:s("Del"),linux:s("Del")},capslock:{mac:{symbol:"⇪",name:"Caps Lock"},windows:s("Caps Lock"),linux:s("Caps Lock")}},c={cmdorctrl:"mod",commandorcontrol:"mod",cmd:"meta",command:"meta",super:"meta",win:"meta",windows:"meta",control:"ctrl",option:"alt",opt:"alt",return:"enter",esc:"escape",del:"delete",caps:"capslock"},d={up:{symbol:"↑",name:"Arrow up"},down:{symbol:"↓",name:"Arrow down"},left:{symbol:"←",name:"Arrow left"},right:{symbol:"→",name:"Arrow right"},arrowup:{symbol:"↑",name:"Arrow up"},arrowdown:{symbol:"↓",name:"Arrow down"},arrowleft:{symbol:"←",name:"Arrow left"},arrowright:{symbol:"→",name:"Arrow right"}};const p={xs:"h-5",sm:"h-6",md:"h-8",lg:"h-10",xl:"h-12"},u={xs:"min-w-5",sm:"min-w-6",md:"min-w-8",lg:"min-w-10",xl:"min-w-12"},w={xs:"text-mp-label-small",sm:"text-mp-label-medium",md:"text-mp-label-large",lg:"text-mp-label-large",xl:"text-mp-title-medium"},x={xs:"px-1",sm:"px-1.5",md:"px-2",lg:"px-2.5",xl:"px-3"},b={xs:"rounded-mp-xs",sm:"rounded-mp-xs",md:"rounded-mp-sm",lg:"rounded-mp-sm",xl:"rounded-mp-md"},f={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-1 bg-mp-surface-container-low text-mp-on-surface-variant",outlined:"border-mp-outline-variant text-mp-on-surface-variant border bg-transparent",text:"text-mp-on-surface-variant bg-mp-surface-container"};export const MPShortcut=/*@__PURE__*/m.forwardRef(function({variant:y="outlined",size:h="md",color:g="secondary",keys:k,os:C="auto",separator:v,className:A,style:j,...E},N){const S=r(),_="auto"===C?S:C,B=o(k).map(e=>function(e,n){const a=e.toLowerCase().replace(/[\s_-]/g,""),m=c[a]??a,t=d[m];if(t)return t;const o=i[m];return o?o[n]:s(1===e.length?e.toUpperCase():e)}(e,_)),L=void 0===v?"mac"===_?null:"+":v,D=/*@__PURE__*/["inline-flex shrink-0 items-center justify-center","font-mono leading-none whitespace-nowrap tabular-nums",p[h],u[h],w[h],x[h],b[h],f[y]].join(" ");return e("span",{ref:N,"data-mp-size":h,"data-mp-variant":y,className:["mp-shortcut inline-flex max-w-full items-center gap-1 align-middle",A??""].filter(Boolean).join(" "),style:{...t(g),...j},...E,children:B.map((t,o)=>a(m.Fragment,{children:[o>0&&null!==L?e("span",{"aria-hidden":"true",className:"text-mp-on-surface-variant",children:L}):null,e("kbd",{className:D,children:t.symbol===t.name?t.symbol:a(n,{children:[e("span",{"aria-hidden":"true",children:t.symbol}),e("span",{className:l,children:t.name})]})})]},o))})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { MPShortcut } from './MPShortcut';
|
|
2
|
-
export type { MPShortcutOS, MPShortcutProps } from './MPShortcut';
|
|
1
|
+
export { MPShortcut } from './MPShortcut.js';
|
|
2
|
+
export type { MPShortcutOS, MPShortcutProps } from './MPShortcut.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MPShortcut}from"./MPShortcut";
|
|
1
|
+
export{MPShortcut}from"./MPShortcut.js";
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type MPPageCollapse, type MPSidebarSide } from '../../internal/page-layout.js';
|
|
3
|
+
import type { MPSize, MPVariant } from '../../types.js';
|
|
4
|
+
export type { MPPageCollapse, MPSidebarSide } from '../../internal/page-layout.js';
|
|
5
|
+
export interface MPSidebarProps extends Omit<React.ComponentPropsWithoutRef<'aside'>, 'title'> {
|
|
6
|
+
/**
|
|
7
|
+
* Which end of the band it takes. Logical rather than physical — `start` is
|
|
8
|
+
* the left of an English page and the right of an Arabic one — because
|
|
9
|
+
* navigation sits beside the text it belongs to in every writing direction.
|
|
10
|
+
*
|
|
11
|
+
* Inside an [MPPageLayout](./page-layout) this is already decided by which
|
|
12
|
+
* slot the sidebar was handed to, and setting it again is only a way of
|
|
13
|
+
* disagreeing with the layout.
|
|
14
|
+
* @default 'start'
|
|
15
|
+
*/
|
|
16
|
+
side?: MPSidebarSide;
|
|
17
|
+
/**
|
|
18
|
+
* How wide the column is — a number in pixels or any CSS length. Left out, it
|
|
19
|
+
* is the width `size` implies.
|
|
20
|
+
*
|
|
21
|
+
* With `resizable` this is only the width the column *starts* at: a drag
|
|
22
|
+
* writes over it, and the caller hears about it through `onResizeEnd`.
|
|
23
|
+
*/
|
|
24
|
+
width?: number | string;
|
|
25
|
+
/**
|
|
26
|
+
* How narrow it may be dragged.
|
|
27
|
+
* @default 160
|
|
28
|
+
*/
|
|
29
|
+
minWidth?: number | string;
|
|
30
|
+
/**
|
|
31
|
+
* And how wide.
|
|
32
|
+
* @default 480
|
|
33
|
+
*/
|
|
34
|
+
maxWidth?: number | string;
|
|
35
|
+
/**
|
|
36
|
+
* Lets the reader drag the inner edge to change the column's width.
|
|
37
|
+
*
|
|
38
|
+
* Off by default. A sidebar that can be resized is a sidebar whose width is
|
|
39
|
+
* the reader's to remember, so a caller who turns this on usually also wants
|
|
40
|
+
* to store what `onResizeEnd` reports.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
resizable?: boolean;
|
|
44
|
+
/** Fires with the width in pixels while the edge is being dragged. */
|
|
45
|
+
onResize?: (width: number) => void;
|
|
46
|
+
/** Fires once, with the same number, when it is let go. */
|
|
47
|
+
onResizeEnd?: (width: number) => void;
|
|
48
|
+
/**
|
|
49
|
+
* The window size class below which the column becomes a drawer, opened by an
|
|
50
|
+
* [MPSidebarTrigger](#mpsidebartrigger). `none` keeps it a column at every
|
|
51
|
+
* width.
|
|
52
|
+
*
|
|
53
|
+
* Defaults to the [MPPageLayout](./page-layout)'s own `collapseBelow`, and to
|
|
54
|
+
* `none` outside one: a sidebar that collapsed with nothing on the page able
|
|
55
|
+
* to bring it back would be a sidebar the reader has lost.
|
|
56
|
+
*/
|
|
57
|
+
collapseBelow?: MPPageCollapse;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the drawer is open. Only meaningful once the sidebar has collapsed;
|
|
60
|
+
* a column is not opened, it is there.
|
|
61
|
+
*
|
|
62
|
+
* Inside an [MPPageLayout](./page-layout) the layout owns this — it is what a
|
|
63
|
+
* trigger anywhere on the page talks to — so control it there rather than
|
|
64
|
+
* here. `onOpenChange` still fires either way.
|
|
65
|
+
*/
|
|
66
|
+
open?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Which state it starts in, for an uncontrolled standalone sidebar.
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
defaultOpen?: boolean;
|
|
72
|
+
onOpenChange?: (open: boolean) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Whether the column holds its place while the page scrolls past it.
|
|
75
|
+
*
|
|
76
|
+
* On by default, and it costs nothing when it is not needed: with the page
|
|
77
|
+
* scrolling it becomes a `sticky` column as tall as what is left of the window
|
|
78
|
+
* under the header, and with only the content scrolling it is already as tall
|
|
79
|
+
* as the layout and this changes nothing.
|
|
80
|
+
* @default true
|
|
81
|
+
*/
|
|
82
|
+
sticky?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* The heading, drawn only while the sidebar is a drawer.
|
|
85
|
+
*
|
|
86
|
+
* A column has the page around it to say what it is. A panel that has covered
|
|
87
|
+
* the page does not, and a dialog with no heading has no accessible name — so
|
|
88
|
+
* without one the drawer falls back to `label`, and then to the word for
|
|
89
|
+
* "sidebar" in `locale`.
|
|
90
|
+
*/
|
|
91
|
+
title?: React.ReactNode;
|
|
92
|
+
/**
|
|
93
|
+
* How much surface the column paints, on the **container** ladder — a sidebar
|
|
94
|
+
* is never dyed, because what sits on it arrives with colours of its own.
|
|
95
|
+
*
|
|
96
|
+
* `outlined` is the default: the page's own surface, with a hairline down the
|
|
97
|
+
* edge that faces the content. That is the column *in the layout*. Once it has
|
|
98
|
+
* collapsed it is an [MPDrawer](./drawer), which paints MD3's own navigation
|
|
99
|
+
* drawer surface and takes no weight from here.
|
|
100
|
+
* @default 'outlined'
|
|
101
|
+
*/
|
|
102
|
+
variant?: MPVariant;
|
|
103
|
+
/**
|
|
104
|
+
* The column's default width and the air around its content. `md` is 360px,
|
|
105
|
+
* which is MD3's own navigation drawer and the same rung
|
|
106
|
+
* [MPDrawer](./drawer) is drawn at.
|
|
107
|
+
* @default 'md'
|
|
108
|
+
*/
|
|
109
|
+
size?: MPSize;
|
|
110
|
+
/**
|
|
111
|
+
* The gutter, and the air above and below the content.
|
|
112
|
+
* @default true
|
|
113
|
+
*/
|
|
114
|
+
padded?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* The name the region is announced by.
|
|
117
|
+
*
|
|
118
|
+
* Every `<aside>` on a page should have one, and a page with two sidebars
|
|
119
|
+
* *must*, or a screen reader offers two regions called "complementary".
|
|
120
|
+
* Defaults to the word for "sidebar" in `locale`.
|
|
121
|
+
*/
|
|
122
|
+
label?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Which language the sidebar's own words are in. Falls back to the
|
|
125
|
+
* [MPPageLayout](./page-layout)'s, then to the nearest `MPLocaleProvider`,
|
|
126
|
+
* then to English.
|
|
127
|
+
*/
|
|
128
|
+
locale?: string;
|
|
129
|
+
/** Everything in it: a nav, a filter panel, a table of contents. */
|
|
130
|
+
children?: React.ReactNode;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* A column beside the page's content, and a drawer once the window is too narrow
|
|
134
|
+
* to hold one.
|
|
135
|
+
*
|
|
136
|
+
* Two presentations of one panel, which is exactly the distinction MD3 draws:
|
|
137
|
+
* the **standard** navigation drawer is part of the layout and the content is
|
|
138
|
+
* laid out around it, and below an expanded window the same destinations arrive
|
|
139
|
+
* as a **modal** drawer over a scrim. They are one component here because they
|
|
140
|
+
* are one thing — a caller should not have to swap components at a breakpoint —
|
|
141
|
+
* and because the children exist once either way, so nothing inside is put into
|
|
142
|
+
* the document twice for a screen reader to read twice.
|
|
143
|
+
*
|
|
144
|
+
* A real `<aside>`, which is the `complementary` landmark: the region a screen
|
|
145
|
+
* reader offers as "related to the page but not the page", and what a crawler
|
|
146
|
+
* reads as navigation chrome rather than as the article.
|
|
147
|
+
*
|
|
148
|
+
* ## Which of the two is showing is answered twice, on purpose
|
|
149
|
+
*
|
|
150
|
+
* In CSS for the first paint, and in JavaScript from then on.
|
|
151
|
+
*
|
|
152
|
+
* The markup a server sends is the **column**, because a collapsed sidebar is a
|
|
153
|
+
* drawer, a modal drawer is a portal into `document.body`, and there is no body
|
|
154
|
+
* to portal into while the markup is being rendered. So a narrow screen would
|
|
155
|
+
* draw a full-width sidebar and throw it away a moment later — the class that
|
|
156
|
+
* hides the column below the breakpoint is what stops that, and `matchMedia` is
|
|
157
|
+
* what decides, once there is a window to ask, that the drawer should exist at
|
|
158
|
+
* all.
|
|
159
|
+
*/
|
|
160
|
+
export declare const MPSidebar: React.ForwardRefExoticComponent<MPSidebarProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{MPDrawer as n}from"../drawer/MPDrawer.js";import{pixelsIn as o}from"../../internal/length.js";import{useMPLocale as i,useMPMessages as a}from"../../internal/locale.js";import{LAYOUT as s}from"../../internal/messages/layout.js";import{BAR_SURFACE as l,drawerSide as u,EXPANDED_ONLY as d,MPPageLayoutContext as c,MPSidebarSideContext as m,useMPCollapsed as p}from"../../internal/page-layout.js";import{SHEET_PAD_X as f,SHEET_PAD_Y as b}from"../../internal/scale.js";const v={xs:"15rem",sm:"18rem",md:"22.5rem",lg:"26rem",xl:"30rem"};function y(e,t){return null==e?t:"number"==typeof e?e:o(e,"undefined"==typeof window?void 0:window.innerWidth)??t}export const MPSidebar=/*@__PURE__*/r.forwardRef(function({side:o,width:h,minWidth:g=160,maxWidth:w=480,resizable:x=!1,onResize:_,onResizeEnd:j,collapseBelow:R,open:k,defaultOpen:C=!1,onOpenChange:z,sticky:P=!0,title:E,variant:M="outlined",size:L="md",padded:B=!0,label:S,locale:N,className:A,style:D,children:O,...$},I){const W=r.useContext(c),T=r.useContext(m),X=o??T??"start",K=i(N??W.locale),V=a(s,K),q=R??(W.present?W.collapseBelow:"none"),F=p(q),[G,H]=r.useState(C),J=void 0!==k,Q=J?k:W.present?W.open[X]:G,U=e=>{J||(W.present?W.setOpen(X,e):H(e)),z?.(e)},Y=void 0===h?v[L]:"number"==typeof h?`${h}px`:h,Z=r.useRef(null),ee=r.useRef(Y),te=r.useRef(null),re=r.useId();ee.current!==Y&&(ee.current=Y,Z.current=null);const ne=Z.current??Y,oe=r.useRef(null),ie=r.useCallback(e=>{oe.current=e,"function"==typeof I?I(e):I&&(I.current=e)},[I]),ae=r.useRef(null);r.useEffect(()=>()=>ae.current?.(),[]);const se=e=>{const t=oe.current;if(!t)return e;const r=Math.min(y(w,480),Math.max(y(g,160),Math.round(e)));return Z.current=`${r}px`,t.style.setProperty("--_mp-sidebar-width",Z.current),te.current?.setAttribute("aria-valuenow",String(r)),r};return F?e(n,{side:u(X),mode:"modal",open:Q,onOpenChange:U,title:E??S??V.sidebar,size:L,locale:K,extent:void 0===h?void 0:ne,className:A,style:D,children:O}):t("aside",{ref:ie,"aria-label":S??V.sidebar,"data-mp-size":L,"data-mp-variant":M,"data-mp-side":X,className:["mp-sidebar text-mp-on-surface relative box-border flex min-w-0 shrink-0 flex-col","w-(--_mp-sidebar-width)",l[M],"outlined"===M?"border-mp-outline-variant "+("start"===X?"border-e":"border-s"):"","content"===W.scroll?"h-full":P?["self-start sticky [top:var(--_mp-layout-header,0px)]","[height:calc(100dvh_-_var(--_mp-layout-header,0px)_-_var(--_mp-layout-footer,0px))]"].join(" "):"",d[q],A??""].filter(Boolean).join(" "),style:{"--_mp-sidebar-width":ne,...D},...$,children:[e("div",{id:re,className:["mp-sidebar__body min-h-0 flex-1 overflow-y-auto overscroll-contain",B?`${f[L]} ${b[L]}`:""].filter(Boolean).join(" "),children:O}),x?e("div",{ref:te,role:"separator","aria-orientation":"vertical","aria-label":V.resizeSidebar,"aria-valuemin":Math.round(y(g,160)),"aria-valuemax":Math.round(y(w,480)),"aria-valuenow":Math.round(y(ne,y(v[L],360))),"aria-controls":re,tabIndex:0,className:["mp-sidebar__handle absolute inset-y-0 z-1 w-2 cursor-col-resize bg-transparent","start"===X?"-me-1 end-0":"-ms-1 start-0","hover:bg-mp-outline-variant data-dragging:bg-mp-outline-variant","transition-colors duration-(--mp-sys-motion-duration-short4)","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-0","focus-visible:outline-solid outline-none"].join(" "),onPointerDown:e=>{const t=oe.current;if(!t||0!==e.button)return;const r=e.currentTarget;r.setPointerCapture(e.pointerId),r.dataset.dragging="true";const n=document.body.style.getPropertyValue("-webkit-user-select");document.body.style.setProperty("-webkit-user-select","none");const o=e.clientX,i=t.getBoundingClientRect().width,a="rtl"===getComputedStyle(t).direction,s="start"===X===a?-1:1;let l=i;const u=e=>{l=se(i+(e.clientX-o)*s),_?.(l)},d=()=>{ae.current=null,r.removeEventListener("pointermove",u),r.removeEventListener("pointerup",c),r.removeEventListener("pointercancel",c),delete r.dataset.dragging,n?document.body.style.setProperty("-webkit-user-select",n):document.body.style.removeProperty("-webkit-user-select")},c=()=>{d(),j?.(l)};ae.current=d,r.addEventListener("pointermove",u),r.addEventListener("pointerup",c),r.addEventListener("pointercancel",c)},onKeyDown:e=>{if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const t="rtl"===getComputedStyle(e.currentTarget).direction,r="start"===X===t?-1:1;(e=>{const t=oe.current;if(!t)return;const r=se(t.getBoundingClientRect().width+e);_?.(r),j?.(r)})(("ArrowRight"===e.key?16:-16)*r)}}):null]})});
|