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
package/dist/internal/i18n.d.ts
CHANGED
|
@@ -23,22 +23,32 @@
|
|
|
23
23
|
* gets you a translation, `MPLocaleProvider` gets you one for the whole
|
|
24
24
|
* application at once, and the prop gets you one for anything else.
|
|
25
25
|
*
|
|
26
|
-
* ##
|
|
26
|
+
* ## Where the words themselves are
|
|
27
27
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* something: a component that says one word — `MPButton` says *Loading* — held a
|
|
31
|
-
* static import chain down to a table of every string in every language, and a
|
|
32
|
-
* bundler cannot drop data that something imports. Twenty kilobytes, on every
|
|
33
|
-
* consumer, for a word.
|
|
28
|
+
* Not here. This file is the shape of the table, the registry a translation
|
|
29
|
+
* arrives through, and the merge — no strings.
|
|
34
30
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
31
|
+
* The eighteen translations live under `src/locales/`, and nothing in the
|
|
32
|
+
* library imports them. They used to be here, and being here is what made them
|
|
33
|
+
* cost something: a component that says one word — `MPButton` says *Loading* —
|
|
34
|
+
* held a static import chain down to a table of every string in every language,
|
|
35
|
+
* and a bundler cannot drop data that something imports. Twenty kilobytes, on
|
|
36
|
+
* every consumer, for a word. So the table arrives from the outside instead:
|
|
37
|
+
* `registerMPMessages` below is how, `material-plus-ui/locales` is where from,
|
|
38
|
+
* and the only thing that changed for a reader is that the application now names
|
|
39
|
+
* the languages it speaks. Once it has, `locale="ko"` resolves through exactly
|
|
40
|
+
* the path it always did.
|
|
41
|
+
*
|
|
42
|
+
* English left too, for the same reason one step smaller. It is thirteen modules
|
|
43
|
+
* under `internal/messages/`, one per namespace, because a bundler that can drop
|
|
44
|
+
* a module it can also drop an export — and cannot drop a property. Held as one
|
|
45
|
+
* object, English was 1.75 kB that every component carried whole: `MPButton`
|
|
46
|
+
* shipped the calendar's eighteen strings to say *Loading*. `resolveNamespace`
|
|
47
|
+
* is handed the namespace it should merge, so a component pays for the words it
|
|
48
|
+
* speaks and no others.
|
|
39
49
|
*
|
|
40
50
|
* The public surface is `registerMPMessages`, `MPLocaleProvider` and the
|
|
41
|
-
* per-component `labels` props; `
|
|
51
|
+
* per-component `labels` props; `resolveNamespace` and `fillMessage` stay
|
|
42
52
|
* internal.
|
|
43
53
|
*/
|
|
44
54
|
/**
|
|
@@ -141,6 +151,101 @@ export interface MPMessages {
|
|
|
141
151
|
start: string;
|
|
142
152
|
end: string;
|
|
143
153
|
};
|
|
154
|
+
/**
|
|
155
|
+
* MPNumberField.
|
|
156
|
+
*
|
|
157
|
+
* The two steppers, which are a plus and a minus and have no words of their
|
|
158
|
+
* own — the same case the pagination's chevrons and the chat's delivery marks
|
|
159
|
+
* are in. They are read out and never drawn.
|
|
160
|
+
*/
|
|
161
|
+
numberField: {
|
|
162
|
+
increase: string;
|
|
163
|
+
decrease: string;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* MPCarousel.
|
|
167
|
+
*
|
|
168
|
+
* Every string here is read out and never drawn: the strip is pictures, the
|
|
169
|
+
* arrows are chevrons and the marks under it are dots. `{index}` and
|
|
170
|
+
* `{total}` are filled in by `fillMessage`, and they are named rather than
|
|
171
|
+
* positional for the reason the pagination's are — a language that counts the
|
|
172
|
+
* total first is not a language this table can serve with an argument order.
|
|
173
|
+
*/
|
|
174
|
+
carousel: {
|
|
175
|
+
/** The name of the `region` the strip is inside. */
|
|
176
|
+
label: string;
|
|
177
|
+
/** The two arrows. */
|
|
178
|
+
previous: string;
|
|
179
|
+
next: string;
|
|
180
|
+
/** One slide, and its own position mark. `Slide 2 of 5`. */
|
|
181
|
+
slide: string;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* MPBreadcrumb.
|
|
185
|
+
*
|
|
186
|
+
* Both read out and never drawn: a trail's steps are the caller's words, and
|
|
187
|
+
* these are the two things around them that are not.
|
|
188
|
+
*/
|
|
189
|
+
breadcrumb: {
|
|
190
|
+
/** The name of the `<nav>` the trail is inside. */
|
|
191
|
+
label: string;
|
|
192
|
+
/** The `…` that puts the folded middle back. */
|
|
193
|
+
expand: string;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* MPCombobox.
|
|
197
|
+
*
|
|
198
|
+
* Both **drawn**, which is what makes them belong here rather than in a prop:
|
|
199
|
+
* a Korean page whose search box says *No matches* has answered in a language
|
|
200
|
+
* the reader did not ask a question in. `{label}` is the text they typed, and
|
|
201
|
+
* is filled in by `fillMessage`.
|
|
202
|
+
*/
|
|
203
|
+
combobox: {
|
|
204
|
+
/** The line where the rows would be, when nothing matched. */
|
|
205
|
+
empty: string;
|
|
206
|
+
/** The row that offers what was typed as a value of its own. */
|
|
207
|
+
add: string;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* MPTable.
|
|
211
|
+
*
|
|
212
|
+
* One string, drawn across the whole width where the rows would be. A table
|
|
213
|
+
* that says *No data* in the middle of a translated page is the one part of it
|
|
214
|
+
* that was not translated.
|
|
215
|
+
*/
|
|
216
|
+
table: {
|
|
217
|
+
empty: string;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* MPFilePicker.
|
|
221
|
+
*
|
|
222
|
+
* The line inside the box, and the largest piece of text this table holds. It
|
|
223
|
+
* is drawn, it is an instruction, and it is the whole of what the component
|
|
224
|
+
* tells a reader to do.
|
|
225
|
+
*/
|
|
226
|
+
filePicker: {
|
|
227
|
+
prompt: string;
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* MPTextLink.
|
|
231
|
+
*
|
|
232
|
+
* The sentence after a link that takes over the window. Read out and never
|
|
233
|
+
* drawn — the arrow says it to a reader who can see it, and this says it to
|
|
234
|
+
* everybody else.
|
|
235
|
+
*/
|
|
236
|
+
textLink: {
|
|
237
|
+
newTab: string;
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* MPOverlay.
|
|
241
|
+
*
|
|
242
|
+
* The name of a modal region that may hold nothing readable at all — a bare
|
|
243
|
+
* spinner, a `clear` sheet. Without it a screen reader announces the region as
|
|
244
|
+
* nothing, which is why the component defaults it rather than requiring it.
|
|
245
|
+
*/
|
|
246
|
+
overlay: {
|
|
247
|
+
label: string;
|
|
248
|
+
};
|
|
144
249
|
/** MPAlert. */
|
|
145
250
|
alert: {
|
|
146
251
|
/** The × in the corner, which has no text of its own. */
|
|
@@ -224,6 +329,108 @@ export interface MPMessages {
|
|
|
224
329
|
/** The line above the button, saying why the content is covered. */
|
|
225
330
|
notice: string;
|
|
226
331
|
};
|
|
332
|
+
/**
|
|
333
|
+
* MPPageLayout, and the parts of a page it arranges.
|
|
334
|
+
*
|
|
335
|
+
* One namespace for the skeleton rather than one per component, for the reason
|
|
336
|
+
* the pickers share theirs: they are one vocabulary, written by whoever
|
|
337
|
+
* translates a page's chrome, and a caller who has translated the word for a
|
|
338
|
+
* sidebar has translated the button that opens it in the same breath.
|
|
339
|
+
*/
|
|
340
|
+
layout: {
|
|
341
|
+
/**
|
|
342
|
+
* The link that jumps past the navigation, drawn only while it holds the
|
|
343
|
+
* focus.
|
|
344
|
+
*
|
|
345
|
+
* Drawn rather than only announced, which makes it one of the few strings
|
|
346
|
+
* here that a sighted keyboard reader actually sees — and the one it would
|
|
347
|
+
* be least forgivable to leave in English, because the readers it exists for
|
|
348
|
+
* are the ones who cannot skip it.
|
|
349
|
+
*/
|
|
350
|
+
skipToContent: string;
|
|
351
|
+
/**
|
|
352
|
+
* What an `MPSidebar` is called when nothing named it.
|
|
353
|
+
*
|
|
354
|
+
* Read out and never drawn. Every `<aside>` needs a name and a page with two
|
|
355
|
+
* of them *must* have one each, or a screen reader offers two regions called
|
|
356
|
+
* "complementary" — which is exactly why this is a default rather than a
|
|
357
|
+
* required prop.
|
|
358
|
+
*/
|
|
359
|
+
sidebar: string;
|
|
360
|
+
/** The hamburger, which is a drawing and has no word of its own. */
|
|
361
|
+
openSidebar: string;
|
|
362
|
+
/** The same button once the drawer is open. */
|
|
363
|
+
closeSidebar: string;
|
|
364
|
+
/** The handle on a resizable column's inner edge. */
|
|
365
|
+
resizeSidebar: string;
|
|
366
|
+
};
|
|
367
|
+
/**
|
|
368
|
+
* MPTransfer.
|
|
369
|
+
*
|
|
370
|
+
* Every string here is **drawn**, which is unusual in this table and is what
|
|
371
|
+
* makes the namespace necessary: the two headings, the filter's placeholder
|
|
372
|
+
* and the line an empty list shows are all read off the screen, and a Korean
|
|
373
|
+
* page with a column headed *Available* is a page the component broke.
|
|
374
|
+
*
|
|
375
|
+
* The two arrows are the exception and are read out rather than drawn, for the
|
|
376
|
+
* reason the pagination's steppers are.
|
|
377
|
+
*/
|
|
378
|
+
transfer: {
|
|
379
|
+
/** The heading over the list of things that have not been chosen. */
|
|
380
|
+
source: string;
|
|
381
|
+
/** And over the list of things that have. */
|
|
382
|
+
target: string;
|
|
383
|
+
/** The arrow that sends the ticked rows across. */
|
|
384
|
+
toTarget: string;
|
|
385
|
+
/** And the one that brings them back. */
|
|
386
|
+
toSource: string;
|
|
387
|
+
/** The filter above each list. */
|
|
388
|
+
search: string;
|
|
389
|
+
/** What a list with nothing in it says. */
|
|
390
|
+
empty: string;
|
|
391
|
+
};
|
|
392
|
+
/**
|
|
393
|
+
* MPCommandPalette.
|
|
394
|
+
*
|
|
395
|
+
* Three strings, two of them drawn: a palette that says *Type a command or
|
|
396
|
+
* search…* to a Korean reader is a palette that has told them, in the first
|
|
397
|
+
* thing they see, that it is not for them.
|
|
398
|
+
*/
|
|
399
|
+
command: {
|
|
400
|
+
/** The dialog's accessible name. It has no visible title to take one from. */
|
|
401
|
+
label: string;
|
|
402
|
+
/** The placeholder in the field. */
|
|
403
|
+
search: string;
|
|
404
|
+
/** The line where the rows would be, when nothing matched. */
|
|
405
|
+
empty: string;
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* MPColorPicker.
|
|
409
|
+
*
|
|
410
|
+
* The one control in the library whose parts have **nowhere to take a name
|
|
411
|
+
* from**: a saturation square, a hue rail and an opacity rail are three
|
|
412
|
+
* draggable rectangles, and without these they are three draggable rectangles
|
|
413
|
+
* to a screen reader too.
|
|
414
|
+
*
|
|
415
|
+
* `empty` is the exception and is drawn — it is what the trigger reads before
|
|
416
|
+
* a colour has been chosen.
|
|
417
|
+
*/
|
|
418
|
+
colorPicker: {
|
|
419
|
+
/** The saturation/brightness square. */
|
|
420
|
+
area: string;
|
|
421
|
+
/** The hue rail beside it. */
|
|
422
|
+
hue: string;
|
|
423
|
+
/** The opacity rail, when `alpha` is on. */
|
|
424
|
+
alpha: string;
|
|
425
|
+
/** The field the value can be typed into. */
|
|
426
|
+
value: string;
|
|
427
|
+
/** The grid of ready-made colours. */
|
|
428
|
+
swatches: string;
|
|
429
|
+
/** The × that empties the control. */
|
|
430
|
+
clear: string;
|
|
431
|
+
/** What the trigger reads before anything has been chosen. */
|
|
432
|
+
empty: string;
|
|
433
|
+
};
|
|
227
434
|
}
|
|
228
435
|
/** A translation may fill in as much or as little of the table as it has. */
|
|
229
436
|
export type MPPartialMessages = {
|
|
@@ -256,6 +463,25 @@ export interface MPLocale {
|
|
|
256
463
|
/** The strings. Anything left out falls back to English, a namespace at a time. */
|
|
257
464
|
messages: MPPartialMessages;
|
|
258
465
|
}
|
|
466
|
+
/**
|
|
467
|
+
* One namespace's English strings, carrying the name they answer to.
|
|
468
|
+
*
|
|
469
|
+
* The thirteen of them live in `internal/messages/`, one to a module, and a
|
|
470
|
+
* component imports the one it speaks. That is the whole reason this type
|
|
471
|
+
* exists: `resolveNamespace` below is handed the English table rather than
|
|
472
|
+
* looking it up, so the twelve tables a component does not use are twelve modules
|
|
473
|
+
* nothing imports.
|
|
474
|
+
*
|
|
475
|
+
* The name travels with the strings rather than beside them, so a call site is
|
|
476
|
+
* `useMPMessages(PICKER, locale)` and cannot name one namespace while passing
|
|
477
|
+
* another's words.
|
|
478
|
+
*/
|
|
479
|
+
export interface MPNamespace<Name extends keyof MPMessages> {
|
|
480
|
+
/** The key this namespace occupies in `MPMessages` and in a translation. */
|
|
481
|
+
readonly name: Name;
|
|
482
|
+
/** English, which every other language is merged over. */
|
|
483
|
+
readonly en: MPMessages[Name];
|
|
484
|
+
}
|
|
259
485
|
/**
|
|
260
486
|
* Teaches the library a language.
|
|
261
487
|
*
|
|
@@ -272,7 +498,7 @@ export interface MPLocale {
|
|
|
272
498
|
*/
|
|
273
499
|
export declare function registerMPMessages(...locales: MPLocale[]): void;
|
|
274
500
|
/**
|
|
275
|
-
*
|
|
501
|
+
* One namespace's strings for a locale, merged over English.
|
|
276
502
|
*
|
|
277
503
|
* `undefined` is English rather than the runtime's own locale, and that is
|
|
278
504
|
* deliberate: `navigator.language` differs between the server that renders the
|
|
@@ -281,11 +507,16 @@ export declare function registerMPMessages(...locales: MPLocale[]): void;
|
|
|
281
507
|
* at. A component that should follow the reader is *told* which language to
|
|
282
508
|
* follow — by its own `locale` prop, or by an `MPLocaleProvider` above it.
|
|
283
509
|
*
|
|
510
|
+
* A namespace at a time, so a language that has one and not another keeps
|
|
511
|
+
* English for the rest rather than losing both. That was already how the merge
|
|
512
|
+
* worked; what changed is that the namespaces are no longer merged all at once,
|
|
513
|
+
* because a component that reads one of them should not carry the other twelve.
|
|
514
|
+
*
|
|
284
515
|
* Note that this is only about the words in the table. The dates themselves are
|
|
285
516
|
* formatted by `Intl` against the same tag, and `Intl` speaks every language the
|
|
286
517
|
* platform does whether or not there is an entry here.
|
|
287
518
|
*/
|
|
288
|
-
export declare function
|
|
519
|
+
export declare function resolveNamespace<Name extends keyof MPMessages>(namespace: MPNamespace<Name>, locale?: string): MPMessages[Name];
|
|
289
520
|
/**
|
|
290
521
|
* A message with its placeholders filled in.
|
|
291
522
|
*
|
package/dist/internal/i18n.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=
|
|
1
|
+
const e=new Map;export function registerMPMessages(...s){for(const t of s){e.set(t.locale.toLowerCase(),t.messages);for(const s of t.aliases??[])e.set(s.toLowerCase(),t.messages)}t.clear()}const t=new Map;export function resolveNamespace(s,n){const o=n?.trim()??"",r=`${s.name}\0${o}`,a=t.get(r);if(a)return a;const c=function(e){const t=e.toLowerCase().split(/[-_]/).filter(Boolean),s=t[0];if(!s)return[];const n=t.slice(1),o=n.find(e=>/^[a-z]{4}$/.test(e)),r=n.find(e=>/^([a-z]{2}|\d{3})$/.test(e));return[o?`${s}-${o}`:"",r?`${s}-${r}`:"",s].filter(Boolean)}(o).map(t=>e.get(t)).find(Boolean),i=c?.[s.name],f=i?{...s.en,...i}:s.en;return t.set(r,f),f}export function fillMessage(e,t){return e.replace(/\{(\w+)\}/g,(e,s)=>t[s]??e)}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What keyboard the reader is on, and how a shortcut is spelled.
|
|
3
|
+
*
|
|
4
|
+
* Two components speak this vocabulary and they speak it in opposite
|
|
5
|
+
* directions: [MPShortcut](../components/shortcut/MPShortcut.tsx) *writes* a
|
|
6
|
+
* shortcut down, and [MPCommandPalette](../components/command-palette/MPCommandPalette.tsx)
|
|
7
|
+
* *reads* one off a real keyboard event. Both files already said that the two
|
|
8
|
+
* had to agree — "a shortcut a component displays and one it binds have to be
|
|
9
|
+
* spelled the same way, or the label on the screen is a claim nobody checked" —
|
|
10
|
+
* and both then answered the question separately.
|
|
11
|
+
*
|
|
12
|
+
* They disagreed. The palette tested `navigator.userAgent` alone, which is the
|
|
13
|
+
* one of the three sources a browser is most willing to freeze or lie about, so
|
|
14
|
+
* a page could draw `⌘K` and bind Ctrl+K. Written once, they cannot.
|
|
15
|
+
*
|
|
16
|
+
* Nothing here is exported from `src/index.ts`. It is the library talking to
|
|
17
|
+
* itself, in the sense `internal/` always means.
|
|
18
|
+
*/
|
|
19
|
+
/** The three real platforms a shortcut is spelled for. */
|
|
20
|
+
export type MPResolvedOS = 'mac' | 'windows' | 'linux';
|
|
21
|
+
/**
|
|
22
|
+
* What the browser says it is running on.
|
|
23
|
+
*
|
|
24
|
+
* `userAgentData.platform` is the modern spelling and `navigator.platform` the
|
|
25
|
+
* deprecated one that every browser still answers; the user agent string is the
|
|
26
|
+
* last resort. All three are matched at once because the question is coarse —
|
|
27
|
+
* which of three key caps to print — and getting it slightly wrong is a label,
|
|
28
|
+
* not a bug.
|
|
29
|
+
*/
|
|
30
|
+
export declare function detectOS(): MPResolvedOS;
|
|
31
|
+
/**
|
|
32
|
+
* `useSyncExternalStore` rather than `useEffect` plus state, and rather than
|
|
33
|
+
* reading `navigator` during render.
|
|
34
|
+
*
|
|
35
|
+
* Reading it during render is a hydration mismatch waiting to happen: the server
|
|
36
|
+
* has no `navigator`, so it would render `Ctrl` and the client would render `⌘`
|
|
37
|
+
* into the same markup. This hook is the one API that tells React the two are
|
|
38
|
+
* *meant* to differ — it hydrates with the server's answer and re-renders with
|
|
39
|
+
* the browser's, which is exactly the sequence a Mac reader sees.
|
|
40
|
+
*/
|
|
41
|
+
export declare function useDetectedOS(): MPResolvedOS;
|
|
42
|
+
/**
|
|
43
|
+
* Splits the string form. Empty segments are what `'Ctrl++'` leaves behind, and
|
|
44
|
+
* dropping them is why the array form exists for that case.
|
|
45
|
+
*/
|
|
46
|
+
export declare function tokenizeShortcut(keys: string | string[]): string[];
|
|
47
|
+
/**
|
|
48
|
+
* Whether a keyboard event is the shortcut this string names.
|
|
49
|
+
*
|
|
50
|
+
* The same vocabulary `MPShortcut` draws, read rather than written — and the
|
|
51
|
+
* same tokenizer, so a shortcut that can be displayed is a shortcut that can be
|
|
52
|
+
* matched.
|
|
53
|
+
*
|
|
54
|
+
* ## `Mod` is a name for a key, not a fifth modifier
|
|
55
|
+
*
|
|
56
|
+
* It resolves to Command on a Mac and Control everywhere else, so `Mod+K` and
|
|
57
|
+
* `Ctrl+K` are the *same combination* on Windows — and the check has to say so.
|
|
58
|
+
* Tested as a modifier of its own, they contradicted each other: `Ctrl+K` on
|
|
59
|
+
* Windows held Control, `Mod` was not named, and "is Control down without Mod
|
|
60
|
+
* being asked for" answered no. `Ctrl+K` simply never matched anywhere except a
|
|
61
|
+
* Mac, on the component whose whole job is to answer a shortcut.
|
|
62
|
+
*
|
|
63
|
+
* So `Mod` is folded into whichever real key it stands for, and the four
|
|
64
|
+
* modifiers are then compared as themselves.
|
|
65
|
+
*
|
|
66
|
+
* Each is checked in **both** directions. A shortcut that fired with extra
|
|
67
|
+
* modifiers held would take a combination the page had given to something else.
|
|
68
|
+
*
|
|
69
|
+
* The platform is passed rather than sniffed, so a caller reads it through the
|
|
70
|
+
* same hook the label does and the two cannot end up on different answers.
|
|
71
|
+
*/
|
|
72
|
+
export declare function matchesShortcut(event: KeyboardEvent, shortcut: string | string[], os: MPResolvedOS): boolean;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import*as t from"react";export function detectOS(){if("undefined"==typeof navigator)return"windows";const t=navigator.userAgentData,e=`${t?.platform??""} ${navigator.platform??""} ${navigator.userAgent??""}`;return/mac|iphone|ipad|ipod/i.test(e)?"mac":/win/i.test(e)?"windows":"linux"}function e(){return()=>{}}function r(){return"windows"}export function useDetectedOS(){return t.useSyncExternalStore(e,detectOS,r)}export function tokenizeShortcut(t){return Array.isArray(t)?t.map(t=>t.trim()).filter(Boolean):t.split("+").map(t=>t.trim()).filter(Boolean)}export function matchesShortcut(t,e,r){const n=tokenizeShortcut(e).map(t=>t.toLowerCase()),o=n[n.length-1];if(void 0===o)return!1;const a=new Set(n.slice(0,-1)),i=a.has("mod"),s=a.has("ctrl")||i&&"mac"!==r,c=a.has("meta")||i&&"mac"===r;return s===t.ctrlKey&&c===t.metaKey&&(a.has("shift")===t.shiftKey&&a.has("alt")===t.altKey&&t.key.toLowerCase()===o)}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A length, said the way this library says lengths.
|
|
3
|
+
*
|
|
4
|
+
* One rule, everywhere: **a number is CSS pixels and a string is already a CSS
|
|
5
|
+
* length.** Twelve components had written it out inline and four more had a
|
|
6
|
+
* private `toLength` of their own, which is sixteen copies of a sentence that is
|
|
7
|
+
* either true of the whole library or true of nothing.
|
|
8
|
+
*
|
|
9
|
+
* They all happened to agree. That is the argument for collecting them rather
|
|
10
|
+
* than against it — sixteen agreeing copies are sixteen chances for the
|
|
11
|
+
* seventeenth to be written slightly differently, and the difference would be a
|
|
12
|
+
* prop that quietly took a number to mean something else.
|
|
13
|
+
*
|
|
14
|
+
* Nothing here is exported from `src/index.ts`. It is the library talking to
|
|
15
|
+
* itself, in the sense `internal/` always means.
|
|
16
|
+
*/
|
|
17
|
+
/** A number is pixels; a string is whatever it says; nothing is nothing. */
|
|
18
|
+
export declare function cssLength(value: number | string): string;
|
|
19
|
+
export declare function cssLength(value: number | string | undefined | null): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* A CSS length string, in pixels, or `undefined` for one this cannot resolve.
|
|
22
|
+
*
|
|
23
|
+
* The two components that let a reader *drag* a size — `MPSidebar` and
|
|
24
|
+
* `MPPanes` — both have to turn a written bound into a number to clamp against,
|
|
25
|
+
* and both had the same regex and the same unit arithmetic. This is that,
|
|
26
|
+
* once.
|
|
27
|
+
*
|
|
28
|
+
* `undefined` rather than a fallback, so each caller decides what an
|
|
29
|
+
* unresolvable bound means. They do not agree, and should not: a pane with an
|
|
30
|
+
* unreadable `minSize` is a pane with no minimum, and a sidebar with an
|
|
31
|
+
* unreadable one still has a default to fall back to. A parser that picked for
|
|
32
|
+
* them would have to pick wrongly for one of them.
|
|
33
|
+
*
|
|
34
|
+
* ## What the units are measured against
|
|
35
|
+
*
|
|
36
|
+
* `%` is a share of `extent`, which is whatever the caller is dividing up — the
|
|
37
|
+
* split's own width, the window's. `rem` is the document's font size and `em` is
|
|
38
|
+
* `root`'s, which is the distinction that makes `em` worth accepting at all: a
|
|
39
|
+
* bound written in `em` is a bound in the *component's* text, and a component
|
|
40
|
+
* inside a scaled-down panel means something different by it than the page does.
|
|
41
|
+
*/
|
|
42
|
+
export declare function pixelsIn(value: string, extent?: number, root?: Element | null): number | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function cssLength(e){if(null!=e)return"number"==typeof e?`${e}px`:e}const e=/^\s*(-?[\d.]+)\s*(px|rem|em|%)\s*$/;export function pixelsIn(t,n,o){const r=e.exec(t);if(!r)return;const u=Number(r[1]);if(!Number.isNaN(u))switch(r[2]){case"px":return u;case"%":return void 0===n?void 0:n*u/100;case"rem":return"undefined"==typeof document?void 0:u*(Number.parseFloat(getComputedStyle(document.documentElement).fontSize)||16);default:return"undefined"!=typeof document&&o?u*(Number.parseFloat(getComputedStyle(o).fontSize)||16):void 0}}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two questions a component has to ask about a URL it did not write.
|
|
3
|
+
*
|
|
4
|
+
* Four components render an `<a>` whose `target` a caller can set, and three of
|
|
5
|
+
* them had worked out the same `rel` independently — which is three chances for
|
|
6
|
+
* the fourth to forget, and the fourth did. One of them also renders a URL that
|
|
7
|
+
* arrives from somewhere else entirely, which is a different question with a
|
|
8
|
+
* worse failure.
|
|
9
|
+
*
|
|
10
|
+
* Nothing here is exported from `src/index.ts`. It is the library talking to
|
|
11
|
+
* itself, in the sense `internal/` always means.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The `rel` a link opening in a new tab needs, unless the caller named one.
|
|
15
|
+
*
|
|
16
|
+
* `target="_blank"` hands the opened page a `window.opener` back into this one
|
|
17
|
+
* unless it is told not to. Modern browsers imply `noopener` and older ones do
|
|
18
|
+
* not; `noreferrer` is never implied by anything, and is what stops the address
|
|
19
|
+
* of the page the reader was on travelling to wherever they just went.
|
|
20
|
+
*
|
|
21
|
+
* A caller's own `rel` **replaces** this rather than extending it, which is the
|
|
22
|
+
* bargain these components already documented: a row that also needs `nofollow`
|
|
23
|
+
* says `rel="noopener noreferrer nofollow"` and means it. The alternative —
|
|
24
|
+
* merging — is a component quietly adding tokens to an attribute the caller
|
|
25
|
+
* wrote out in full.
|
|
26
|
+
*/
|
|
27
|
+
export declare function linkRel(target: string | undefined, rel: string | undefined): string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* A URL if it is one a reader can safely be sent to, and nothing if it is not.
|
|
30
|
+
*
|
|
31
|
+
* This is for the URLs that arrive from **somewhere else** — the link preview on
|
|
32
|
+
* a message somebody else sent — rather than for the ones an application writes
|
|
33
|
+
* into its own navigation. React renders a `javascript:` href with a development
|
|
34
|
+
* warning and no more, so on a page built out of user-generated content a
|
|
35
|
+
* hostile preview URL is a one-click script execution.
|
|
36
|
+
*
|
|
37
|
+
* A URL with no scheme at all is relative, and a relative URL cannot escalate to
|
|
38
|
+
* anything: it resolves against the page it is already on. Those pass.
|
|
39
|
+
*
|
|
40
|
+
* Rejected means `undefined`, so the element renders with no `href` — visibly
|
|
41
|
+
* not a link, rather than a link that quietly goes nowhere. Half-sanitising a
|
|
42
|
+
* URL into something that still navigates is how a filter becomes a bypass.
|
|
43
|
+
*/
|
|
44
|
+
export declare function safeHref(href: string | undefined): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function linkRel(e,t){return void 0!==t?t:"_blank"===e?"noopener noreferrer":void 0}const e=/[\u0000-\u0020\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,t=/^([a-z][a-z0-9+.-]*):/i,u=new Set(["http:","https:","mailto:","tel:"]);export function safeHref(r){if(!r)return;const n=t.exec(r.replace(e,""));return n?u.has(`${n[1].toLowerCase()}:`)?r:void 0:r}
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
*
|
|
13
13
|
* There is deliberately no third source. `navigator.language` is *not* consulted
|
|
14
14
|
* as a fallback, and that is not an oversight — see the note on
|
|
15
|
-
* `
|
|
15
|
+
* `resolveNamespace` in `internal/i18n.ts`. The runtime's own locale differs
|
|
16
16
|
* between the server that renders the markup and the browser that hydrates it,
|
|
17
17
|
* so reading it would put a hydration mismatch in the one part of the page a
|
|
18
18
|
* reader is looking at. `undefined` therefore means "the platform's default",
|
|
19
19
|
* which `Intl` resolves consistently in both places.
|
|
20
20
|
*/
|
|
21
21
|
import * as React from 'react';
|
|
22
|
-
import { type MPMessages } from './i18n';
|
|
22
|
+
import { type MPMessages, type MPNamespace } from './i18n.js';
|
|
23
23
|
/**
|
|
24
24
|
* `undefined` rather than `'en'`, and the distinction matters.
|
|
25
25
|
*
|
|
@@ -39,5 +39,29 @@ export declare function useMPLocale(locale?: string): string | undefined;
|
|
|
39
39
|
* what makes an unsupported language a partial answer rather than a dead end: a
|
|
40
40
|
* caller supplies the handful of words they care about and everything else is
|
|
41
41
|
* still translated, or still English, rather than blank.
|
|
42
|
+
*
|
|
43
|
+
* The namespace is passed as the object from `internal/messages/`, not as its
|
|
44
|
+
* name: it carries English with it, which is what lets a component that says one
|
|
45
|
+
* word leave the other twelve namespaces out of the bundle entirely. The objects
|
|
46
|
+
* are module constants, so the identity `useMemo` compares is stable.
|
|
47
|
+
*
|
|
48
|
+
* ## Why the overrides are keyed on what they say
|
|
49
|
+
*
|
|
50
|
+
* Because of how they are written. `labels={{ clear: 'Leeren' }}` is an object
|
|
51
|
+
* literal in JSX, which is a *new object every render* — so keyed on identity
|
|
52
|
+
* the memo missed every single time, and every component with a `labels` prop
|
|
53
|
+
* rebuilt its merged table on every render of its parent.
|
|
54
|
+
*
|
|
55
|
+
* That was not expensive on its own; what made it worth fixing is what the table
|
|
56
|
+
* is used for. It is handed straight back out of this hook, so a fresh object
|
|
57
|
+
* per render is a fresh prop for everything downstream — and the calendar keeps
|
|
58
|
+
* `labels` in a `useMemo` dependency of its own, where a new object per render
|
|
59
|
+
* of the page above meant re-deriving a month's worth of `Intl` names for a
|
|
60
|
+
* table that had not changed a word.
|
|
61
|
+
*
|
|
62
|
+
* `internal/Picker.ts` keys its display samples on `JSON.stringify` for exactly
|
|
63
|
+
* this reason, with the same trade written out there: two objects whose keys are
|
|
64
|
+
* in a different order read as two tables. That costs one extra miss and never a
|
|
65
|
+
* wrong answer.
|
|
42
66
|
*/
|
|
43
|
-
export declare function useMPMessages<
|
|
67
|
+
export declare function useMPMessages<Name extends keyof MPMessages>(namespace: MPNamespace<Name>, locale: string | undefined, overrides?: Partial<MPMessages[Name]>): MPMessages[Name];
|
package/dist/internal/locale.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import*as t from"react";import{resolveNamespace as e}from"./i18n.js";export const MPLocaleContext=/*@__PURE__*/t.createContext(void 0);export function useMPLocale(e){const o=t.useContext(MPLocaleContext);return e??o}export function useMPMessages(o,n,r){const s=void 0===r?"":JSON.stringify(r);return t.useMemo(()=>{const t=e(o,n);return r?{...t,...r}:t},[o,n,s])}
|
package/dist/internal/menu.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* every row from having to answer "what if there is no menu".
|
|
16
16
|
*/
|
|
17
17
|
import * as React from 'react';
|
|
18
|
-
import type { MPColor, MPSize } from '../types';
|
|
18
|
+
import type { MPColor, MPSize } from '../types.js';
|
|
19
19
|
export interface MPMenuContextValue {
|
|
20
20
|
size: MPSize;
|
|
21
21
|
color: MPColor;
|
package/dist/internal/menu.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ALERT={name:"alert",en:{dismiss:"Dismiss"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const BREADCRUMB={name:"breadcrumb",en:{label:"Breadcrumb",expand:"Show hidden steps"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const CAROUSEL={name:"carousel",en:{label:"Carousel",previous:"Previous slide",next:"Next slide",slide:"Slide {index} of {total}"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const CHAT={name:"chat",en:{sending:"Sending",sent:"Sent",delivered:"Delivered",read:"Read",failed:"Not sent",typing:"Typing"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const COLOR_PICKER={name:"colorPicker",en:{area:"Saturation and brightness",hue:"Hue",alpha:"Opacity",value:"Colour value",swatches:"Swatches",clear:"Clear",empty:"No colour"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const COMBOBOX={name:"combobox",en:{empty:"No matches",add:"Add “{label}”"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const COMMAND={name:"command",en:{label:"Command palette",search:"Type a command or search…",empty:"No commands found"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const COMMON={name:"common",en:{close:"Close",clear:"Clear",open:"Open",remove:"Remove",removeNamed:"Remove {label}",loading:"Loading"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const EMPTY={name:"empty",en:{title:"Nothing here"}};
|