material-plus-ui 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- 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 +1 -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/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 +1 -1
- 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 +1 -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 +1 -1
- 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 +1 -1
- 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 +2 -2
- 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 +1 -1
- 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/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 +4 -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/file-picker/MPFilePicker.d.ts +1 -1
- 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/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/highlight/MPHighlight.d.ts +2 -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/number-field/MPNumberField.d.ts +1 -1
- 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 +1 -1
- 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/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 +1 -1
- 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/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 +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +3 -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/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/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 +62 -0
- package/dist/constants/glyphs.js +2 -0
- package/dist/constants/icons.d.ts +31 -60
- package/dist/constants/icons.js +1 -1
- package/dist/index.d.ts +78 -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.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 -1
- package/dist/internal/animate.js +1 -0
- package/dist/internal/button-group.d.ts +1 -1
- package/dist/internal/button-group.js +1 -0
- package/dist/internal/date.d.ts +1 -1
- package/dist/internal/i18n.d.ts +48 -14
- package/dist/internal/i18n.js +1 -1
- package/dist/internal/locale.d.ts +8 -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/chat.d.ts +3 -0
- package/dist/internal/messages/chat.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/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/text-field.d.ts +3 -0
- package/dist/internal/messages/text-field.js +1 -0
- package/dist/internal/progress.d.ts +1 -1
- package/dist/internal/scale.d.ts +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/de.d.ts +1 -1
- package/dist/locales/es.d.ts +1 -1
- package/dist/locales/fr.d.ts +1 -1
- package/dist/locales/hi.d.ts +1 -1
- package/dist/locales/id.d.ts +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/ja.d.ts +1 -1
- package/dist/locales/ko.d.ts +1 -1
- package/dist/locales/nl.d.ts +1 -1
- package/dist/locales/pl.d.ts +1 -1
- package/dist/locales/pt.d.ts +1 -1
- package/dist/locales/ru.d.ts +1 -1
- package/dist/locales/th.d.ts +1 -1
- package/dist/locales/tr.d.ts +1 -1
- package/dist/locales/vi.d.ts +1 -1
- package/dist/locales/zh-hans.d.ts +1 -1
- package/dist/locales/zh-hant.d.ts +1 -1
- package/package.json +11 -9
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as r,Fragment as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{Field as n}from"@base-ui/react/field";import{PROSE_TEXT as a}from"./scale.js";const i={xs:"left-1",sm:"left-2",md:"left-3",lg:"left-3",xl:"left-4"},s={xs:"top-[18px]",sm:"top-[18px]",md:"top-5",lg:"top-5",xl:"top-5"};function d(o,n){return t(e,{children:[o,n?r("span",{"aria-hidden":"true",children:" *"}):null]})}export function MPFieldOutline({label:e,required:t=!1,notched:o=!0}){return r("fieldset",{"aria-hidden":"true",className:["pointer-events-none absolute inset-0 -top-[5px] m-0 min-w-0 px-2 pt-0","rounded-mp-xs border border-mp-outline","transition-[border-color] duration-(--mp-sys-motion-duration-short4)","group-hover:border-mp-on-surface","group-focus-within:border-2 group-focus-within:border-mp-primary","group-data-focused:border-2 group-data-focused:border-mp-primary","group-data-invalid:border-mp-error","group-data-disabled:border-mp-on-surface/12"].join(" "),children:e?r("legend",{className:["text-mp-body-small invisible float-none block h-[11px] w-auto overflow-hidden p-0","leading-none","ease-mp-standard transition-[max-width,padding]","duration-(--mp-sys-motion-duration-short4)",o?"max-w-full px-1":"max-w-0 px-0"].join(" "),children:d(e,t)}):null})}export function MPFieldLabel({size:e,label:t,required:o=!1,htmlFor:p,shrunk:l=!0,multiline:u=!1}){return r(n.Label,{htmlFor:p,"data-mp-shrunk":l?"":void 0,className:["text-mp-on-surface-variant","ease-mp-standard transition-[color,top,font-size,max-width]","duration-(--mp-sys-motion-duration-short4)","absolute -translate-y-1/2 px-1 leading-none",i[e],l?"text-mp-body-small pointer-events-auto top-0 max-w-none":[a[e],"pointer-events-none max-w-[calc(100%-2rem)] truncate",u?s[e]:"top-1/2"].join(" "),"group-focus-within:text-mp-primary","group-data-focused:text-mp-primary","group-data-invalid:text-mp-error","group-data-disabled:text-mp-on-surface/38"].join(" "),children:d(t,o)})}export function useFloatingLabel({floating:r,filled:e,pinned:t=!1}){const[n,a]=o.useState(!1);return{shrunk:!r||e||n||t,focusProps:{onFocusCapture:()=>a(!0),onBlurCapture:r=>{r.currentTarget.contains(r.relatedTarget)||a(!1)}}}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { MPPickerLabels } from './Calendar';
|
|
3
|
-
import type { MPColor, MPSize, MPStyleProps } from '../types';
|
|
2
|
+
import type { MPPickerLabels } from './Calendar.js';
|
|
3
|
+
import type { MPColor, MPSize, MPStyleProps } from '../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* The strings a trigger is held open by, kept across renders that did not
|
|
6
6
|
* change what it could say.
|
package/dist/internal/Picker.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as i from"react";import{Field as n}from"@base-ui/react/field";import{Popover as t}from"@base-ui/react/popover";import{MPIcon as o}from"../components/icon/MPIcon.js";import{CloseIcon as a}from"../constants/icons.js";import{accentSlots as s}from"./accent.js";import{MPFieldLabel as l,MPFieldOutline as p,useFloatingLabel as c}from"./FieldOutline.js";import{MPStateLayer as m}from"./StateLayer.js";import{MPSupportingText as d}from"./SupportingText.js";import{MPWidthSizer as u}from"./WidthSizer.js";import{displaySamples as f}from"./date.js";import{CONTROL_ICON as h,hasContent as g,PROSE_TEXT as x}from"./scale.js";import{FADE as b,PORTAL_LAYER as j}from"./surface.js";export function useDisplaySamples(e,r){const n=`${e??""} ${JSON.stringify(r)}`;return i.useMemo(()=>f(e,r),[n])}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"}},y={xs:"p-1.5",sm:"p-2",md:"p-2.5",lg:"p-3",xl:"p-3.5"};export function MPPickerShell({slug:f,size:N="md",color:P="primary",fullWidth:w=!1,label:O,floatingLabel:k=!0,description:M,errorMessage:S,startIcon:z,required:F=!1,disabled:B=!1,readOnly:C=!1,id:I,className:R,style:$,display:q,samples:T,empty:_,clearable:D=!1,onClear:E,open:L,onOpenChange:W,labels:J,hiddenValues:V,children:Z,triggerRef:A}){const G=g(S),H=v[N],K=i.useId(),Q=I??K,U=D&&!_&&!(B||C),{shrunk:X,focusProps:Y}=c({floating:k&&g(O),filled:!_,pinned:L||g(z)});return r(n.Root,{disabled:B,invalid:G,"data-mp-size":N,className:[`mp-${f} group flex-col align-top`,w?"flex w-full":"inline-flex w-fit",R??""].filter(Boolean).join(" "),style:{...s(P),...$},...Y,children:[r(t.Root,{open:L,onOpenChange:W,children:[r("div",{className:"relative w-full",children:[r(t.Trigger,{id:Q,ref:A,disabled:B,nativeButton:!0,className:["relative flex w-full items-center gap-2 select-none","appearance-none bg-transparent font-[inherit] outline-none",H.padding,U?"pe-10":"",H.height,x[N],B?"text-mp-on-surface/38 cursor-default":"text-mp-on-surface "+(C?"cursor-default":"cursor-pointer")].filter(Boolean).join(" "),children:[z?e("span",{className:["flex shrink-0 items-center",B?"text-mp-on-surface/38":"text-mp-on-surface-variant"].join(" "),children:z}):null,r("span",{className:"flex min-w-0 flex-1 flex-col",children:[e("span",{className:["w-full truncate text-start",_&&!B?"text-mp-on-surface-variant":""].filter(Boolean).join(" "),children:_&&!X?null:q}),e(u,{samples:T??[]})]})]}),U?r("button",{type:"button","aria-label":J.clear,onClick:E,className:["group/clear rounded-mp-full text-mp-on-surface-variant absolute inset-y-0","end-1 my-auto flex size-8 cursor-pointer items-center justify-center","appearance-none border-0 bg-transparent font-[inherit]","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-1","focus-visible:outline-solid outline-none"].join(" "),children:[e(m,{className:"group-hover/clear:opacity-8 group-focus-visible/clear:opacity-10"}),e(o,{icon:a,size:h[N]})]}):null,e(p,{label:O,required:F,notched:X}),g(O)?e(l,{size:N,label:O,required:F,htmlFor:Q,shrunk:X}):null]}),e(t.Portal,{children:e(t.Positioner,{className:j,sideOffset:4,align:"start",children:e(t.Popup,{initialFocus:!1,className:[`mp-${f}__popup rounded-mp-md shadow-mp-2 bg-mp-surface-container`,"text-mp-on-surface outline-none",y[N],x[N],b].join(" "),children:Z})})})]}),e(d,{description:M,errorMessage:S,className:H.padding}),V?.map((r,i)=>e("input",{type:"hidden",name:r.name,value:r.value},i))]})}export function MPPickerFooter({children:r}){return e("div",{className:"border-mp-outline-variant flex items-center justify-end gap-1 border-t pt-1.5",children:r})}export function MPPickerDivider(){return e("div",{"aria-hidden":"true",className:"bg-mp-outline-variant w-px self-stretch"})}export const FOOTER_SIZE={xs:"xs",sm:"xs",md:"sm",lg:"sm",xl:"md"};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import{jsx as o}from"react/jsx-runtime";export function MPStateLayer({layer:t="inset-0 rounded-[inherit] bg-current",className:a}){return o("span",{"aria-hidden":"true",className:["pointer-events-none absolute opacity-0",t,"transition-opacity duration-(--mp-sys-motion-duration-short4)","group-hover:opacity-8","group-active:opacity-10","group-focus-visible:opacity-10","group-disabled:opacity-0 group-data-disabled:opacity-0",a??""].filter(Boolean).join(" ")})}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as r}from"react/jsx-runtime";import{Field as e}from"@base-ui/react/field";import{META_TEXT as t,hasContent as o}from"./scale.js";export function MPSupportingText({description:a,errorMessage:s,className:i}){const n=["mp-supporting-text block",t,"data-disabled:text-mp-on-surface/38",i??""].filter(Boolean).join(" ");return o(s)?r(e.Error,{match:!0,className:`${n} text-mp-error`,children:s}):o(a)?r(e.Description,{className:`${n} text-mp-on-surface-variant`,children:a}):null}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import{jsx as e}from"react/jsx-runtime";export function MPWidthSizer({samples:a}){return 0===a.length?null:e("span",{"aria-hidden":"true",className:"invisible h-0 min-h-0 overflow-hidden",children:a.map((a,n)=>e("span",{"data-sample":a,className:"block whitespace-nowrap before:content-[attr(data-sample)]"},`${n}:${a}`))})}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* source colour scoped to a section, is what the component resolves against.
|
|
28
28
|
*/
|
|
29
29
|
import type * as React from 'react';
|
|
30
|
-
import type { MPColor } from '../types';
|
|
30
|
+
import type { MPColor } from '../types.js';
|
|
31
31
|
/**
|
|
32
32
|
* The four roles an accent family has, pointed at one of the four families.
|
|
33
33
|
*
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
* and their logic stays in their own files.
|
|
39
39
|
*/
|
|
40
40
|
import * as React from 'react';
|
|
41
|
-
import type { MPAnimateMode, MPAnimateRepeat, MPAnimateTrigger, MPAnimation, MPEasing, MPSide } from '../types';
|
|
41
|
+
import type { MPAnimateMode, MPAnimateRepeat, MPAnimateTrigger, MPAnimation, MPEasing, MPSide } from '../types.js';
|
|
42
42
|
/** The class that reads the slots. Always paired with one of the below. */
|
|
43
43
|
export declare const ANIM_BASE = "mp-anim";
|
|
44
44
|
/**
|
package/dist/internal/animate.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import*as e from"react";export const ANIM_BASE="mp-anim";export const ANIMATION_CLASS={fade:"mp-anim-fade",grow:"mp-anim-scale",slide:"mp-anim-slide",zoom:"mp-anim-scale",rotate:"mp-anim-rotate",blink:"mp-anim-blink"};const n={fade:{in:"medium2",out:"short4"},grow:{in:"medium4",out:"short4"},slide:{in:"medium4",out:"short4"},zoom:{in:"medium4",out:"short4"},rotate:{in:"long2",out:"medium2"},blink:{in:"extra-long4",out:"extra-long4"}},t={fade:"emphasized-decelerate",grow:"emphasized-decelerate",slide:"emphasized-decelerate",zoom:"emphasized-decelerate",rotate:"emphasized-decelerate",blink:"standard"};export function easingValue(e){return`var(--mp-sys-motion-easing-${e})`}export function durationValue(e,t,i="in"){return void 0!==e?`${e}ms`:`var(--mp-sys-motion-duration-${n[t][i]})`}export function lengthValue(e){return"number"==typeof e?`${e}px`:e}export function repeatValue(e){return"infinite"===e?"infinite":String(e)}export function isInfinite(e){return"infinite"===e}export function directionValue(e,n){return"out"===e?n?"alternate-reverse":"reverse":n?"alternate":"normal"}export function animationSlots(e){const n=e.mode??"in",i={"--_mp-anim-duration":durationValue(e.duration,e.effect,n),"--_mp-anim-delay":`${e.delay}ms`,"--_mp-anim-ease":easingValue(e.easing??t[e.effect]),"--_mp-anim-repeat":repeatValue(e.repeat),"--_mp-anim-direction":directionValue(n,e.alternate)};return void 0!==e.opacity&&(i["--_mp-anim-opacity"]=String(e.opacity)),void 0!==e.scale&&(i["--_mp-anim-scale"]=String(e.scale)),void 0!==e.x&&(i["--_mp-anim-x"]=e.x),void 0!==e.y&&(i["--_mp-anim-y"]=e.y),void 0!==e.angle&&(i["--_mp-anim-angle"]=e.angle),void 0!==e.angleTo&&(i["--_mp-anim-angle-to"]=e.angleTo),i}export function slideOffsets(e,n){const t=lengthValue(n),i="number"==typeof n?-n+"px":`calc(-1 * ${t})`;switch(e){case"top":return{x:"0px",y:i};case"bottom":return{x:"0px",y:t};case"left":return{x:i,y:"0px"};default:return{x:t,y:"0px"}}}const i="(prefers-reduced-motion: reduce)";function a(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const n=window.matchMedia(i);return n.addEventListener("change",e),()=>n.removeEventListener("change",e)}function r(){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(i).matches}function o(){return!1}export function usePrefersReducedMotion(){return e.useSyncExternalStore(a,r,o)}export function useAnimationRun({trigger:n,play:t,once:i,threshold:a,paused:r,infinite:o}){const s=e.useRef(null),[u,m]=e.useState("mount"===n),[c,d]=e.useState(0),l=e.useCallback(()=>{m(!0),d(e=>e+1)},[]);e.useLayoutEffect(()=>{const e=s.current;if(!e||0===c)return;const n=[e,...e.querySelectorAll(".mp-anim, .mp-marquee-track")];for(const e of n)e.style.animationName="none";e.offsetWidth;for(const e of n)e.style.animationName=""},[c]),e.useEffect(()=>{if("visible"!==n)return;const e=s.current;if(!e||"undefined"==typeof IntersectionObserver)return void m(!0);const t=new IntersectionObserver(([e])=>{e.isIntersecting?(l(),i&&t.disconnect()):i||m(!1)},{threshold:a});return t.observe(e),()=>t.disconnect()},[n,i,a,l]),e.useEffect(()=>{"manual"===n&&(t?l():m(!1))},[n,t,l]);const p=e.useCallback(()=>{o&&m(!1)},[o]),f="hover"===n?{onPointerEnter:l,onFocus:l,onPointerLeave:p,onBlur:p}:{};return{ref:e.useCallback(e=>{s.current=e},[]),state:u&&!r?"running":"paused",started:u,handlers:f}}export function useAnimateElement(e){const{trigger:n,play:t,once:i,threshold:a,paused:r,infinite:o,...s}=e,u=useAnimationRun({trigger:n,play:t,once:i,threshold:a,paused:r,infinite:o});return{ref:u.ref,className:`mp-anim ${ANIMATION_CLASS[s.effect]}`,style:{...animationSlots(s),"--_mp-anim-state":u.state},props:{...u.handlers,"data-mp-animation":s.effect,"data-mp-state":u.state}}}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* meaning "use the button's own default" rather than turning into one.
|
|
12
12
|
*/
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import type { MPColor, MPSize, MPVariant } from '../types';
|
|
14
|
+
import type { MPColor, MPSize, MPVariant } from '../types.js';
|
|
15
15
|
export interface MPButtonGroupContextValue {
|
|
16
16
|
variant?: MPVariant;
|
|
17
17
|
size?: MPSize;
|
package/dist/internal/date.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* Nothing here is exported from `src/index.ts`. It is the library talking to
|
|
23
23
|
* itself, in the sense `internal/` always means.
|
|
24
24
|
*/
|
|
25
|
-
import type { MPWeekday } from '../types';
|
|
25
|
+
import type { MPWeekday } from '../types.js';
|
|
26
26
|
/** Which unit the calendar is currently letting you pick. */
|
|
27
27
|
export type MPCalendarView = 'day' | 'month' | 'year';
|
|
28
28
|
/** How many years one page of the year grid holds. Four columns of three. */
|
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 nine 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
|
/**
|
|
@@ -256,6 +266,25 @@ export interface MPLocale {
|
|
|
256
266
|
/** The strings. Anything left out falls back to English, a namespace at a time. */
|
|
257
267
|
messages: MPPartialMessages;
|
|
258
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
* One namespace's English strings, carrying the name they answer to.
|
|
271
|
+
*
|
|
272
|
+
* The nine of them live in `internal/messages/`, one to a module, and a
|
|
273
|
+
* component imports the one it speaks. That is the whole reason this type
|
|
274
|
+
* exists: `resolveNamespace` below is handed the English table rather than
|
|
275
|
+
* looking it up, so the eight tables a component does not use are eight modules
|
|
276
|
+
* nothing imports.
|
|
277
|
+
*
|
|
278
|
+
* The name travels with the strings rather than beside them, so a call site is
|
|
279
|
+
* `useMPMessages(PICKER, locale)` and cannot name one namespace while passing
|
|
280
|
+
* another's words.
|
|
281
|
+
*/
|
|
282
|
+
export interface MPNamespace<Name extends keyof MPMessages> {
|
|
283
|
+
/** The key this namespace occupies in `MPMessages` and in a translation. */
|
|
284
|
+
readonly name: Name;
|
|
285
|
+
/** English, which every other language is merged over. */
|
|
286
|
+
readonly en: MPMessages[Name];
|
|
287
|
+
}
|
|
259
288
|
/**
|
|
260
289
|
* Teaches the library a language.
|
|
261
290
|
*
|
|
@@ -272,7 +301,7 @@ export interface MPLocale {
|
|
|
272
301
|
*/
|
|
273
302
|
export declare function registerMPMessages(...locales: MPLocale[]): void;
|
|
274
303
|
/**
|
|
275
|
-
*
|
|
304
|
+
* One namespace's strings for a locale, merged over English.
|
|
276
305
|
*
|
|
277
306
|
* `undefined` is English rather than the runtime's own locale, and that is
|
|
278
307
|
* deliberate: `navigator.language` differs between the server that renders the
|
|
@@ -281,11 +310,16 @@ export declare function registerMPMessages(...locales: MPLocale[]): void;
|
|
|
281
310
|
* at. A component that should follow the reader is *told* which language to
|
|
282
311
|
* follow — by its own `locale` prop, or by an `MPLocaleProvider` above it.
|
|
283
312
|
*
|
|
313
|
+
* A namespace at a time, so a language that has one and not another keeps
|
|
314
|
+
* English for the rest rather than losing both. That was already how the merge
|
|
315
|
+
* worked; what changed is that the namespaces are no longer merged all at once,
|
|
316
|
+
* because a component that reads one of them should not carry the other eight.
|
|
317
|
+
*
|
|
284
318
|
* Note that this is only about the words in the table. The dates themselves are
|
|
285
319
|
* formatted by `Intl` against the same tag, and `Intl` speaks every language the
|
|
286
320
|
* platform does whether or not there is an entry here.
|
|
287
321
|
*/
|
|
288
|
-
export declare function
|
|
322
|
+
export declare function resolveNamespace<Name extends keyof MPMessages>(namespace: MPNamespace<Name>, locale?: string): MPMessages[Name];
|
|
289
323
|
/**
|
|
290
324
|
* A message with its placeholders filled in.
|
|
291
325
|
*
|
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)}
|
|
@@ -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,10 @@ 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 eight namespaces out of the bundle entirely. The objects
|
|
46
|
+
* are module constants, so the identity `useMemo` compares is stable.
|
|
42
47
|
*/
|
|
43
|
-
export declare function useMPMessages<
|
|
48
|
+
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 e from"react";import{resolveNamespace as t}from"./i18n.js";export const MPLocaleContext=/*@__PURE__*/e.createContext(void 0);export function useMPLocale(t){const o=e.useContext(MPLocaleContext);return t??o}export function useMPMessages(o,n,r){return e.useMemo(()=>{const e=t(o,n);return r?{...e,...r}:e},[o,n,r])}
|
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 CHAT={name:"chat",en:{sending:"Sending",sent:"Sent",delivered:"Delivered",read:"Read",failed:"Not sent",typing:"Typing"}};
|
|
@@ -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"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PAGINATION={name:"pagination",en:{label:"Pagination",page:"Page {page}",status:"Page {page} of {total}",previous:"Previous page",next:"Next page",first:"First page",last:"Last page"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PICKER={name:"picker",en:{previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose a month",chooseYear:"Choose a year",today:"Today",now:"Now",clear:"Clear",done:"Done",hour:"Hour",minute:"Minute",second:"Second",meridiem:"AM/PM",start:"Start",end:"End"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const RATING={name:"rating",en:{label:"Rating",value:"{value} out of {max}",empty:"Not rated"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SPOILER={name:"spoiler",en:{reveal:"Reveal",hide:"Hide",notice:"Hidden so it is not read by accident"}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const TEXT_FIELD={name:"textField",en:{showPassword:"Show the password",hidePassword:"Hide the password"}};
|
package/dist/internal/scale.d.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* sized by the thumb. A checkbox's tick is not either. Those tables stay in the
|
|
22
22
|
* component that owns them, next to the reasoning for their numbers.
|
|
23
23
|
*/
|
|
24
|
-
import type { MPSize } from '../types';
|
|
24
|
+
import type { MPSize } from '../types.js';
|
|
25
25
|
/**
|
|
26
26
|
* The control heights, and the ladder every other table here is derived from.
|
|
27
27
|
*
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* The second is what a *container* paints itself at, which is the last section
|
|
14
14
|
* of the file.
|
|
15
15
|
*/
|
|
16
|
-
import type { MPVariant } from '../types';
|
|
16
|
+
import type { MPVariant } from '../types.js';
|
|
17
17
|
/**
|
|
18
18
|
* The positioner every portalled popup wears.
|
|
19
19
|
*
|
package/dist/internal/surface.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PORTAL_LAYER="mp-portal z-50 outline-none";export const SCRIM="bg-mp-scrim/32 [backdrop-filter:blur(2px)]";export const FADE
|
|
1
|
+
export const PORTAL_LAYER="mp-portal z-50 outline-none";export const SCRIM="bg-mp-scrim/32 [backdrop-filter:blur(2px)]";export const FADE=/*@__PURE__*/["transition-opacity duration-(--mp-sys-motion-duration-short4)","ease-mp-standard","data-starting-style:opacity-0 data-ending-style:opacity-0"].join(" ");export const SHEET_MOTION=/*@__PURE__*/["duration-(--mp-sys-motion-duration-medium4)","ease-(--mp-sys-motion-easing-emphasized-decelerate)","data-ending-style:duration-(--mp-sys-motion-duration-short4)","data-ending-style:ease-(--mp-sys-motion-easing-emphasized-accelerate)","data-starting-style:opacity-0 data-ending-style:opacity-0"].join(" ");export const CONTAINER_SURFACE={filled:"bg-mp-surface-container-highest",tonal:"bg-mp-surface-container",elevated:"shadow-mp-1 bg-mp-surface-container-low",outlined:"border-mp-outline-variant border bg-transparent",text:"bg-transparent"};
|
package/dist/locales/ar.d.ts
CHANGED
package/dist/locales/de.d.ts
CHANGED
package/dist/locales/es.d.ts
CHANGED
package/dist/locales/fr.d.ts
CHANGED
package/dist/locales/hi.d.ts
CHANGED
package/dist/locales/id.d.ts
CHANGED
package/dist/locales/index.d.ts
CHANGED
|
@@ -60,25 +60,25 @@
|
|
|
60
60
|
* and `registerMPMessages({ locale: 'sv', messages: { ... } })` is as good as
|
|
61
61
|
* anything in this directory.
|
|
62
62
|
*/
|
|
63
|
-
export { ko } from './ko';
|
|
64
|
-
export { ja } from './ja';
|
|
65
|
-
export { zhHans } from './zh-hans';
|
|
66
|
-
export { zhHant } from './zh-hant';
|
|
67
|
-
export { es } from './es';
|
|
68
|
-
export { pt } from './pt';
|
|
69
|
-
export { fr } from './fr';
|
|
70
|
-
export { de } from './de';
|
|
71
|
-
export { it } from './it';
|
|
72
|
-
export { nl } from './nl';
|
|
73
|
-
export { pl } from './pl';
|
|
74
|
-
export { ru } from './ru';
|
|
75
|
-
export { tr } from './tr';
|
|
76
|
-
export { ar } from './ar';
|
|
77
|
-
export { hi } from './hi';
|
|
78
|
-
export { id } from './id';
|
|
79
|
-
export { vi } from './vi';
|
|
80
|
-
export { th } from './th';
|
|
81
|
-
import type { MPLocale } from '../internal/i18n';
|
|
63
|
+
export { ko } from './ko.js';
|
|
64
|
+
export { ja } from './ja.js';
|
|
65
|
+
export { zhHans } from './zh-hans.js';
|
|
66
|
+
export { zhHant } from './zh-hant.js';
|
|
67
|
+
export { es } from './es.js';
|
|
68
|
+
export { pt } from './pt.js';
|
|
69
|
+
export { fr } from './fr.js';
|
|
70
|
+
export { de } from './de.js';
|
|
71
|
+
export { it } from './it.js';
|
|
72
|
+
export { nl } from './nl.js';
|
|
73
|
+
export { pl } from './pl.js';
|
|
74
|
+
export { ru } from './ru.js';
|
|
75
|
+
export { tr } from './tr.js';
|
|
76
|
+
export { ar } from './ar.js';
|
|
77
|
+
export { hi } from './hi.js';
|
|
78
|
+
export { id } from './id.js';
|
|
79
|
+
export { vi } from './vi.js';
|
|
80
|
+
export { th } from './th.js';
|
|
81
|
+
import type { MPLocale } from '../internal/i18n.js';
|
|
82
82
|
/**
|
|
83
83
|
* All eighteen tables, in one array.
|
|
84
84
|
*
|
package/dist/locales/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ko}from"./ko";export{ja}from"./ja";export{zhHans}from"./zh-hans";export{zhHant}from"./zh-hant";export{es}from"./es";export{pt}from"./pt";export{fr}from"./fr";export{de}from"./de";export{it}from"./it";export{nl}from"./nl";export{pl}from"./pl";export{ru}from"./ru";export{tr}from"./tr";export{ar}from"./ar";export{hi}from"./hi";export{id}from"./id";export{vi}from"./vi";export{th}from"./th";import{ko as r}from"./ko";import{ja as o}from"./ja";import{zhHans as m}from"./zh-hans";import{zhHant as t}from"./zh-hant";import{es as p}from"./es";import{pt as
|
|
1
|
+
export{ko}from"./ko.js";export{ja}from"./ja.js";export{zhHans}from"./zh-hans.js";export{zhHant}from"./zh-hant.js";export{es}from"./es.js";export{pt}from"./pt.js";export{fr}from"./fr.js";export{de}from"./de.js";export{it}from"./it.js";export{nl}from"./nl.js";export{pl}from"./pl.js";export{ru}from"./ru.js";export{tr}from"./tr.js";export{ar}from"./ar.js";export{hi}from"./hi.js";export{id}from"./id.js";export{vi}from"./vi.js";export{th}from"./th.js";import{ko as r}from"./ko.js";import{ja as o}from"./ja.js";import{zhHans as m}from"./zh-hans.js";import{zhHant as t}from"./zh-hant.js";import{es as p}from"./es.js";import{pt as s}from"./pt.js";import{fr as f}from"./fr.js";import{de as j}from"./de.js";import{it as i}from"./it.js";import{nl as e}from"./nl.js";import{pl as x}from"./pl.js";import{ru as h}from"./ru.js";import{tr as a}from"./tr.js";import{ar as n}from"./ar.js";import{hi as d}from"./hi.js";import{id as l}from"./id.js";import{vi as z}from"./vi.js";import{th as k}from"./th.js";export const LOCALES=[r,o,m,t,p,s,f,j,i,e,x,h,a,n,d,l,z,k];
|
package/dist/locales/it.d.ts
CHANGED
package/dist/locales/ja.d.ts
CHANGED
package/dist/locales/ko.d.ts
CHANGED
package/dist/locales/nl.d.ts
CHANGED
package/dist/locales/pl.d.ts
CHANGED
package/dist/locales/pt.d.ts
CHANGED
package/dist/locales/ru.d.ts
CHANGED
package/dist/locales/th.d.ts
CHANGED
package/dist/locales/tr.d.ts
CHANGED
package/dist/locales/vi.d.ts
CHANGED