material-plus-ui 1.6.0 → 1.8.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/LICENSE +1 -1
- package/README.md +20 -14
- package/dist/components/accordion/MPAccordion.d.ts +21 -1
- package/dist/components/accordion/MPAccordion.js +1 -1
- package/dist/components/alert/MPAlert.d.ts +34 -3
- package/dist/components/alert/MPAlert.js +1 -1
- package/dist/components/anchor/MPAnchor.d.ts +107 -0
- package/dist/components/anchor/MPAnchor.js +2 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.js +1 -0
- package/dist/components/animate-appear/MPAnimateAppear.d.ts +2 -2
- package/dist/components/animate-appear/MPAnimateAppear.js +1 -1
- package/dist/components/animate-blink/MPAnimateBlink.d.ts +2 -2
- package/dist/components/animate-blink/MPAnimateBlink.js +2 -1
- package/dist/components/animate-counter/MPAnimateCounter.d.ts +67 -0
- package/dist/components/animate-counter/MPAnimateCounter.js +2 -0
- package/dist/components/animate-counter/index.d.ts +2 -0
- package/dist/components/animate-counter/index.js +1 -0
- package/dist/components/animate-fade/MPAnimateFade.d.ts +2 -2
- package/dist/components/animate-fade/MPAnimateFade.js +2 -1
- package/dist/components/animate-float/MPAnimateFloat.d.ts +53 -0
- package/dist/components/animate-float/MPAnimateFloat.js +2 -0
- package/dist/components/animate-float/index.d.ts +2 -0
- package/dist/components/animate-float/index.js +1 -0
- package/dist/components/animate-grow/MPAnimateGrow.d.ts +2 -2
- package/dist/components/animate-grow/MPAnimateGrow.js +2 -1
- package/dist/components/animate-lighting/MPAnimateLighting.js +1 -0
- package/dist/components/animate-reveal/MPAnimateReveal.d.ts +64 -0
- package/dist/components/animate-reveal/MPAnimateReveal.js +2 -0
- package/dist/components/animate-reveal/index.d.ts +2 -0
- package/dist/components/animate-reveal/index.js +1 -0
- package/dist/components/animate-rotate/MPAnimateRotate.d.ts +2 -2
- package/dist/components/animate-rotate/MPAnimateRotate.js +2 -1
- package/dist/components/animate-scramble/MPAnimateScramble.d.ts +65 -0
- package/dist/components/animate-scramble/MPAnimateScramble.js +2 -0
- package/dist/components/animate-scramble/index.d.ts +2 -0
- package/dist/components/animate-scramble/index.js +1 -0
- package/dist/components/animate-shake/MPAnimateShake.d.ts +65 -0
- package/dist/components/animate-shake/MPAnimateShake.js +2 -0
- package/dist/components/animate-shake/index.d.ts +2 -0
- package/dist/components/animate-shake/index.js +1 -0
- package/dist/components/animate-slide/MPAnimateSlide.d.ts +2 -2
- package/dist/components/animate-slide/MPAnimateSlide.js +2 -1
- package/dist/components/animate-split/MPAnimateSplit.d.ts +56 -0
- package/dist/components/animate-split/MPAnimateSplit.js +2 -0
- package/dist/components/animate-split/index.d.ts +2 -0
- package/dist/components/animate-split/index.js +1 -0
- package/dist/components/animate-typing/MPAnimateTyping.js +1 -1
- package/dist/components/animate-zoom/MPAnimateZoom.d.ts +2 -2
- package/dist/components/animate-zoom/MPAnimateZoom.js +2 -1
- package/dist/components/app-logo/MPAppLogo.d.ts +171 -0
- package/dist/components/app-logo/MPAppLogo.js +2 -0
- package/dist/components/app-logo/index.d.ts +2 -0
- package/dist/components/app-logo/index.js +1 -0
- package/dist/components/area-chart/MPAreaChart.d.ts +79 -0
- package/dist/components/area-chart/MPAreaChart.js +2 -0
- package/dist/components/area-chart/index.d.ts +2 -0
- package/dist/components/area-chart/index.js +1 -0
- package/dist/components/aspect-ratio/MPAspectRatio.d.ts +1 -1
- package/dist/components/aspect-ratio/MPAspectRatio.js +2 -1
- package/dist/components/avatar/MPAvatar.d.ts +10 -1
- package/dist/components/avatar/MPAvatar.js +1 -1
- package/dist/components/bar-chart/MPBarChart.d.ts +74 -0
- package/dist/components/bar-chart/MPBarChart.js +2 -0
- package/dist/components/bar-chart/index.d.ts +2 -0
- package/dist/components/bar-chart/index.js +1 -0
- package/dist/components/blockquote/MPBlockquote.d.ts +18 -1
- package/dist/components/blockquote/MPBlockquote.js +1 -1
- package/dist/components/bottom-navigation/MPBottomNavigation.d.ts +2 -18
- package/dist/components/bottom-navigation/MPBottomNavigation.js +1 -1
- package/dist/components/box/MPBox.d.ts +43 -8
- package/dist/components/box/MPBox.js +2 -1
- package/dist/components/breadcrumb/MPBreadcrumb.js +1 -1
- package/dist/components/button/MPButton.js +1 -1
- package/dist/components/calendar/MPCalendar.js +1 -1
- package/dist/components/card/MPCard.js +1 -1
- package/dist/components/carousel/MPCarousel.js +1 -1
- package/dist/components/checkbox/MPCheckbox.js +1 -1
- package/dist/components/chip/MPChip.d.ts +11 -2
- package/dist/components/chip/MPChip.js +1 -1
- package/dist/components/code-block/MPCodeBlock.d.ts +177 -0
- package/dist/components/code-block/MPCodeBlock.js +2 -0
- package/dist/components/code-block/index.d.ts +2 -0
- package/dist/components/code-block/index.js +1 -0
- package/dist/components/collapsible/MPCollapsible.d.ts +12 -1
- package/dist/components/collapsible/MPCollapsible.js +1 -1
- package/dist/components/color-picker/MPColorPicker.js +1 -1
- package/dist/components/combobox/MPCombobox.d.ts +21 -4
- package/dist/components/combobox/MPCombobox.js +1 -1
- package/dist/components/command-palette/MPCommandPalette.d.ts +12 -2
- package/dist/components/command-palette/MPCommandPalette.js +1 -1
- package/dist/components/config/MPConfigProvider.d.ts +49 -7
- package/dist/components/config/MPConfigProvider.js +1 -1
- package/dist/components/confirm/MPConfirmProvider.js +1 -1
- package/dist/components/container/MPContainer.d.ts +9 -2
- package/dist/components/container/MPContainer.js +2 -1
- package/dist/components/data-list/MPDataList.d.ts +82 -0
- package/dist/components/data-list/MPDataList.js +2 -0
- package/dist/components/data-list/index.d.ts +2 -0
- package/dist/components/data-list/index.js +1 -0
- package/dist/components/data-table/MPDataTable.d.ts +314 -0
- package/dist/components/data-table/MPDataTable.js +2 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/index.js +1 -0
- package/dist/components/date-picker/MPDatePicker.js +1 -1
- package/dist/components/dialog/MPDialog.d.ts +10 -2
- package/dist/components/dialog/MPDialog.js +1 -1
- package/dist/components/drawer/MPDrawer.d.ts +8 -2
- package/dist/components/drawer/MPDrawer.js +1 -1
- package/dist/components/empty/MPEmpty.d.ts +10 -1
- package/dist/components/empty/MPEmpty.js +1 -1
- package/dist/components/fieldset/MPFieldset.js +1 -1
- package/dist/components/file-picker/MPFilePicker.js +1 -1
- package/dist/components/flex/MPFlex.d.ts +95 -0
- package/dist/components/flex/MPFlex.js +2 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +1 -0
- package/dist/components/floating-action-button/MPFloatingActionButton.js +1 -1
- package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.d.ts +127 -0
- package/dist/components/floating-bottom-navigation/MPFloatingBottomNavigation.js +2 -0
- package/dist/components/floating-bottom-navigation/index.d.ts +2 -0
- package/dist/components/floating-bottom-navigation/index.js +1 -0
- package/dist/components/footer/MPFooter.d.ts +24 -4
- package/dist/components/footer/MPFooter.js +1 -1
- package/dist/components/form/MPForm.js +1 -1
- package/dist/components/gauge-chart/MPGaugeChart.d.ts +78 -0
- package/dist/components/gauge-chart/MPGaugeChart.js +2 -0
- package/dist/components/gauge-chart/index.d.ts +2 -0
- package/dist/components/gauge-chart/index.js +1 -0
- package/dist/components/grid/MPGrid.d.ts +25 -8
- package/dist/components/grid/MPGrid.js +1 -1
- package/dist/components/header/MPHeader.d.ts +26 -4
- package/dist/components/header/MPHeader.js +1 -1
- package/dist/components/heatmap-chart/MPHeatmapChart.d.ts +75 -0
- package/dist/components/heatmap-chart/MPHeatmapChart.js +2 -0
- package/dist/components/heatmap-chart/index.d.ts +2 -0
- package/dist/components/heatmap-chart/index.js +1 -0
- package/dist/components/hover-card/MPHoverCard.d.ts +101 -0
- package/dist/components/hover-card/MPHoverCard.js +2 -0
- package/dist/components/hover-card/index.d.ts +2 -0
- package/dist/components/hover-card/index.js +1 -0
- package/dist/components/icon/MPIcon.js +1 -1
- package/dist/components/image/MPImage.d.ts +122 -5
- package/dist/components/image/MPImage.js +1 -1
- package/dist/components/image/index.d.ts +1 -1
- package/dist/components/line-chart/MPLineChart.d.ts +66 -0
- package/dist/components/line-chart/MPLineChart.js +2 -0
- package/dist/components/line-chart/index.d.ts +2 -0
- package/dist/components/line-chart/index.js +1 -0
- package/dist/components/list/MPList.d.ts +23 -1
- package/dist/components/list/MPList.js +1 -1
- package/dist/components/menu/MPMenu.d.ts +1 -1
- package/dist/components/menu/MPMenu.js +1 -1
- package/dist/components/menubar/MPMenubar.js +1 -1
- package/dist/components/meter/MPMeter.d.ts +87 -0
- package/dist/components/meter/MPMeter.js +2 -0
- package/dist/components/meter/index.d.ts +2 -0
- package/dist/components/meter/index.js +1 -0
- package/dist/components/mockup/MPMockup.d.ts +143 -0
- package/dist/components/mockup/MPMockup.js +2 -0
- package/dist/components/mockup/index.d.ts +2 -0
- package/dist/components/mockup/index.js +1 -0
- package/dist/components/navigation-menu/MPNavigationMenu.js +1 -1
- package/dist/components/number-field/MPNumberField.js +1 -1
- package/dist/components/pie-chart/MPPieChart.d.ts +77 -0
- package/dist/components/pie-chart/MPPieChart.js +2 -0
- package/dist/components/pie-chart/index.d.ts +2 -0
- package/dist/components/pie-chart/index.js +1 -0
- package/dist/components/pill/MPPill.js +1 -1
- package/dist/components/popconfirm/MPPopconfirm.d.ts +2 -2
- package/dist/components/popover/MPPopover.d.ts +1 -0
- package/dist/components/popover/MPPopover.js +1 -1
- package/dist/components/portal/MPPortal.d.ts +75 -0
- package/dist/components/portal/MPPortal.js +2 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +1 -0
- package/dist/components/radio-group/MPRadioGroup.js +1 -1
- package/dist/components/rating/MPRating.js +1 -1
- package/dist/components/scatter-chart/MPScatterChart.d.ts +66 -0
- package/dist/components/scatter-chart/MPScatterChart.js +2 -0
- package/dist/components/scatter-chart/index.d.ts +2 -0
- package/dist/components/scatter-chart/index.js +1 -0
- package/dist/components/scroll-area/MPScrollArea.d.ts +82 -0
- package/dist/components/scroll-area/MPScrollArea.js +2 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.js +1 -0
- package/dist/components/scroll-zone/MPScrollZone.d.ts +165 -0
- package/dist/components/scroll-zone/MPScrollZone.js +2 -0
- package/dist/components/scroll-zone/index.d.ts +2 -0
- package/dist/components/scroll-zone/index.js +1 -0
- package/dist/components/segmented-button/MPSegmentedButton.js +1 -1
- package/dist/components/select/MPSelect.d.ts +27 -4
- package/dist/components/select/MPSelect.js +1 -1
- package/dist/components/show/MPShow.d.ts +78 -0
- package/dist/components/show/MPShow.js +2 -0
- package/dist/components/show/index.d.ts +2 -0
- package/dist/components/show/index.js +1 -0
- package/dist/components/sidebar/MPSidebar.d.ts +20 -1
- package/dist/components/sidebar/MPSidebar.js +1 -1
- package/dist/components/sparkline/MPSparkline.d.ts +85 -0
- package/dist/components/sparkline/MPSparkline.js +2 -0
- package/dist/components/sparkline/index.d.ts +2 -0
- package/dist/components/sparkline/index.js +1 -0
- package/dist/components/spoiler/MPSpoiler.d.ts +12 -0
- package/dist/components/spoiler/MPSpoiler.js +1 -1
- package/dist/components/stack/MPStack.d.ts +198 -0
- package/dist/components/stack/MPStack.js +2 -0
- package/dist/components/stack/index.d.ts +2 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/statistic/MPStatistic.d.ts +104 -0
- package/dist/components/statistic/MPStatistic.js +2 -0
- package/dist/components/statistic/index.d.ts +2 -0
- package/dist/components/statistic/index.js +1 -0
- package/dist/components/stepper/MPStepper.js +1 -1
- package/dist/components/table/MPTable.d.ts +25 -3
- package/dist/components/table/MPTable.js +1 -1
- package/dist/components/tabs/MPTabs.d.ts +12 -0
- package/dist/components/tabs/MPTabs.js +1 -1
- package/dist/components/timeline/MPTimeline.js +1 -1
- package/dist/components/timeline-chart/MPTimelineChart.d.ts +63 -0
- package/dist/components/timeline-chart/MPTimelineChart.js +2 -0
- package/dist/components/timeline-chart/index.d.ts +2 -0
- package/dist/components/timeline-chart/index.js +1 -0
- package/dist/components/toggle/MPToggle.js +1 -1
- package/dist/components/toolbar/MPToolbar.d.ts +106 -0
- package/dist/components/toolbar/MPToolbar.js +2 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/index.js +1 -0
- package/dist/components/tooltip/MPTooltip.js +1 -1
- package/dist/components/tour/MPTour.d.ts +120 -0
- package/dist/components/tour/MPTour.js +2 -0
- package/dist/components/tour/index.d.ts +2 -0
- package/dist/components/tour/index.js +1 -0
- package/dist/components/transfer/MPTransfer.js +1 -1
- package/dist/components/tree-select/MPTreeSelect.d.ts +113 -0
- package/dist/components/tree-select/MPTreeSelect.js +2 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +1 -0
- package/dist/components/tree-view/MPTreeView.d.ts +153 -0
- package/dist/components/tree-view/MPTreeView.js +2 -0
- package/dist/components/tree-view/index.d.ts +2 -0
- package/dist/components/tree-view/index.js +1 -0
- package/dist/components/typography/MPTypography.d.ts +10 -1
- package/dist/components/typography/MPTypography.js +2 -1
- package/dist/constants/glyphs.d.ts +33 -31
- package/dist/constants/glyphs.js +1 -1
- package/dist/constants/icons.d.ts +32 -31
- package/dist/constants/icons.js +1 -1
- package/dist/hooks/index.d.ts +22 -5
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useMPColorScheme.js +1 -0
- package/dist/hooks/useMPDisclosure.d.ts +58 -0
- package/dist/hooks/useMPDisclosure.js +2 -0
- package/dist/hooks/useMPElementSize.d.ts +55 -0
- package/dist/hooks/useMPElementSize.js +2 -0
- package/dist/hooks/useMPMediaQuery.d.ts +40 -0
- package/dist/hooks/useMPMediaQuery.js +2 -0
- package/dist/hooks/useMPOnScreen.d.ts +58 -0
- package/dist/hooks/useMPOnScreen.js +2 -0
- package/dist/hooks/useMPReducedMotion.js +1 -0
- package/dist/hooks/useMPWindowClass.d.ts +7 -0
- package/dist/hooks/useMPWindowClass.js +1 -0
- package/dist/index.d.ts +35 -1
- package/dist/index.js +1 -1
- package/dist/internal/Calendar.js +1 -1
- package/dist/internal/ChartChrome.d.ts +199 -0
- package/dist/internal/ChartChrome.js +2 -0
- package/dist/internal/ChartFrame.d.ts +197 -0
- package/dist/internal/ChartFrame.js +2 -0
- package/dist/internal/FieldOutline.d.ts +14 -5
- package/dist/internal/FieldOutline.js +1 -1
- package/dist/internal/Picker.js +1 -1
- package/dist/internal/PopupArrow.d.ts +60 -0
- package/dist/internal/PopupArrow.js +2 -0
- package/dist/internal/SupportingText.d.ts +24 -0
- package/dist/internal/SupportingText.js +1 -1
- package/dist/internal/animate-core.d.ts +121 -0
- package/dist/internal/animate-core.js +1 -0
- package/dist/internal/animate.d.ts +75 -55
- package/dist/internal/animate.js +1 -1
- package/dist/internal/bottom-navigation.d.ts +58 -0
- package/dist/internal/bottom-navigation.js +2 -0
- package/dist/internal/chart.d.ts +461 -0
- package/dist/internal/chart.js +1 -0
- package/dist/internal/color-scheme.d.ts +0 -9
- package/dist/internal/color-scheme.js +1 -1
- package/dist/internal/config.d.ts +24 -5
- package/dist/internal/config.js +1 -1
- package/dist/internal/data-table.d.ts +195 -0
- package/dist/internal/data-table.js +1 -0
- package/dist/internal/date.d.ts +22 -18
- package/dist/internal/date.js +1 -1
- package/dist/internal/density.d.ts +9 -0
- package/dist/internal/density.js +1 -0
- package/dist/internal/elevation.d.ts +26 -0
- package/dist/internal/elevation.js +1 -0
- package/dist/internal/highlight.d.ts +96 -0
- package/dist/internal/highlight.js +1 -0
- package/dist/internal/i18n.d.ts +180 -0
- package/dist/internal/initials.d.ts +28 -0
- package/dist/internal/initials.js +1 -0
- package/dist/internal/intl.d.ts +64 -0
- package/dist/internal/intl.js +1 -0
- package/dist/internal/mark.d.ts +52 -0
- package/dist/internal/mark.js +1 -0
- package/dist/internal/measure.d.ts +31 -0
- package/dist/internal/measure.js +1 -0
- package/dist/internal/messages/anchor.d.ts +3 -0
- package/dist/internal/messages/anchor.js +1 -0
- package/dist/internal/messages/chart.d.ts +3 -0
- package/dist/internal/messages/chart.js +1 -0
- package/dist/internal/messages/code.d.ts +3 -0
- package/dist/internal/messages/code.js +1 -0
- package/dist/internal/messages/data-table.d.ts +3 -0
- package/dist/internal/messages/data-table.js +1 -0
- package/dist/internal/messages/scroll.d.ts +3 -0
- package/dist/internal/messages/scroll.js +1 -0
- package/dist/internal/messages/sparkline.d.ts +3 -0
- package/dist/internal/messages/sparkline.js +1 -0
- package/dist/internal/messages/tour.d.ts +3 -0
- package/dist/internal/messages/tour.js +1 -0
- package/dist/internal/messages/transfer.d.ts +1 -1
- package/dist/internal/messages/transfer.js +1 -1
- package/dist/internal/mockup.d.ts +174 -0
- package/dist/internal/mockup.js +2 -0
- package/dist/internal/page-layout.d.ts +24 -5
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/responsive.d.ts +55 -0
- package/dist/internal/responsive.js +1 -0
- package/dist/internal/scale.d.ts +0 -17
- package/dist/internal/scale.js +1 -1
- package/dist/internal/step.d.ts +15 -0
- package/dist/internal/step.js +1 -1
- package/dist/internal/table.d.ts +53 -0
- package/dist/internal/table.js +1 -0
- package/dist/internal/text.d.ts +57 -0
- package/dist/internal/text.js +1 -0
- package/dist/internal/threshold.d.ts +19 -0
- package/dist/internal/threshold.js +1 -0
- package/dist/internal/time-scale.d.ts +44 -0
- package/dist/internal/time-scale.js +1 -0
- package/dist/internal/transition.d.ts +33 -0
- package/dist/internal/transition.js +1 -0
- package/dist/internal/visibility.d.ts +48 -0
- package/dist/internal/visibility.js +1 -0
- package/dist/internal/window-class.d.ts +29 -2
- package/dist/internal/window-class.js +1 -1
- package/dist/locales/ar.js +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/hi.js +1 -1
- package/dist/locales/id.js +1 -1
- package/dist/locales/it.js +1 -1
- package/dist/locales/ja.js +1 -1
- package/dist/locales/ko.js +1 -1
- package/dist/locales/nl.js +1 -1
- package/dist/locales/pl.js +1 -1
- package/dist/locales/pt.js +1 -1
- package/dist/locales/ru.js +1 -1
- package/dist/locales/th.js +1 -1
- package/dist/locales/tr.js +1 -1
- package/dist/locales/vi.js +1 -1
- package/dist/locales/zh-hans.js +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/anchor.css +2 -0
- package/dist/styles/animate-appear.css +1 -1
- package/dist/styles/animate-blink.css +1 -1
- package/dist/styles/animate-counter.css +2 -0
- package/dist/styles/animate-fade.css +1 -1
- package/dist/styles/animate-float.css +2 -0
- package/dist/styles/animate-grow.css +1 -1
- package/dist/styles/animate-headline.css +1 -1
- package/dist/styles/animate-lighting.css +1 -1
- package/dist/styles/animate-marquee.css +1 -1
- package/dist/styles/animate-reveal.css +2 -0
- package/dist/styles/animate-rotate.css +1 -1
- package/dist/styles/animate-scramble.css +2 -0
- package/dist/styles/animate-shake.css +2 -0
- package/dist/styles/animate-slide.css +1 -1
- package/dist/styles/animate-split.css +2 -0
- package/dist/styles/animate-typing.css +1 -1
- package/dist/styles/animate-zoom.css +1 -1
- package/dist/styles/app-logo.css +2 -0
- package/dist/styles/area-chart.css +2 -0
- package/dist/styles/aspect-ratio.css +1 -1
- package/dist/styles/avatar.css +1 -1
- package/dist/styles/badge.css +1 -1
- package/dist/styles/bar-chart.css +2 -0
- 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.css +1 -1
- package/dist/styles/calendar.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/code-block.css +2 -0
- 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 +1 -1
- package/dist/styles/config.css +1 -1
- package/dist/styles/confirm.css +1 -1
- package/dist/styles/container.css +1 -1
- package/dist/styles/data-list.css +2 -0
- package/dist/styles/data-table.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 +1 -1
- package/dist/styles/file-picker.css +1 -1
- package/dist/styles/flex.css +2 -0
- package/dist/styles/floating-action-button.css +1 -1
- package/dist/styles/floating-bottom-navigation.css +2 -0
- package/dist/styles/footer.css +1 -1
- package/dist/styles/form.css +1 -1
- package/dist/styles/gauge-chart.css +2 -0
- package/dist/styles/grid.css +1 -1
- package/dist/styles/header.css +1 -1
- package/dist/styles/heatmap-chart.css +2 -0
- package/dist/styles/highlight.css +1 -1
- package/dist/styles/hover-card.css +2 -0
- package/dist/styles/icon-button.css +1 -1
- package/dist/styles/icon.css +1 -1
- package/dist/styles/image.css +1 -1
- package/dist/styles/line-chart.css +2 -0
- 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 +1 -1
- package/dist/styles/meter.css +2 -0
- package/dist/styles/mockup.css +2 -0
- package/dist/styles/navigation-menu.css +1 -1
- 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 +1 -1
- package/dist/styles/pagination.css +1 -1
- package/dist/styles/pie-chart.css +2 -0
- package/dist/styles/pill.css +1 -1
- package/dist/styles/popconfirm.css +1 -1
- package/dist/styles/popover.css +1 -1
- package/dist/styles/portal.css +2 -0
- 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/rating.css +1 -1
- package/dist/styles/scatter-chart.css +2 -0
- package/dist/styles/scroll-area.css +2 -0
- package/dist/styles/scroll-zone.css +2 -0
- package/dist/styles/segmented-button.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/show.css +2 -0
- package/dist/styles/sidebar.css +1 -1
- package/dist/styles/skeleton.css +1 -1
- package/dist/styles/slider.css +1 -1
- package/dist/styles/snackbar.css +1 -1
- package/dist/styles/sparkline.css +2 -0
- package/dist/styles/spoiler.css +1 -1
- package/dist/styles/stack.css +2 -0
- package/dist/styles/statistic.css +2 -0
- package/dist/styles/stepper.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-chart.css +2 -0
- package/dist/styles/timeline.css +1 -1
- package/dist/styles/toggle.css +1 -1
- package/dist/styles/tokens.css +1 -1
- package/dist/styles/toolbar.css +2 -0
- package/dist/styles/tour.css +2 -0
- package/dist/styles/transfer.css +1 -1
- package/dist/styles/tree-select.css +2 -0
- package/dist/styles/tree-view.css +2 -0
- package/dist/styles/typography.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +2606 -185
- package/dist/types.d.ts +566 -5
- package/package.json +26 -25
- package/.fix.py +0 -92
- package/dist/components/avatar-group/MPAvatarGroup.d.ts +0 -74
- package/dist/components/avatar-group/MPAvatarGroup.js +0 -2
- package/dist/components/avatar-group/index.d.ts +0 -2
- package/dist/components/avatar-group/index.js +0 -1
- package/dist/internal/avatar-group.d.ts +0 -22
- package/dist/internal/avatar-group.js +0 -2
- package/dist/styles/avatar-group.css +0 -2
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";export const MPAnimateGrow=/*@__PURE__*/e.forwardRef(function({duration:e,delay:n=0,easing:i,repeat:o=1,alternate:s,paused:l,trigger:d="mount",play:c,once:m=!0,threshold:p=.2,stagger:f=0,durationStep:g,reverse:u,timeline:h,range:y,mode:w="in",from:N=.8,origin:j="center",fade:v=!0,render:S,className:b,style:x,children:A,...B},G){const M=a({effect:"grow",duration:e,delay:n,easing:i,repeat:o,alternate:s,mode:w,scale:N,opacity:v?0:1,trigger:d,play:c,once:m,threshold:p,paused:l,infinite:t(o),stagger:f,durationStep:g,reverse:u,timeline:h,range:y,children:A});return r({render:S,ref:[G,M.ref],props:{...B,className:[M.className,b].filter(Boolean).join(" "),style:{transformOrigin:j,...M.style,...x},...M.props,children:M.children}})});
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{accentSlots as a}from"../../internal/accent.js";import{isInfinite as n,repeatValue as t,useAnimationRun as i}from"../../internal/animate.js";import{useMPColor as m,useMPSize as o}from"../../internal/config.js";const s={xs:"rounded-mp-xs",sm:"rounded-mp-sm",md:"rounded-mp-md",lg:"rounded-mp-lg",xl:"rounded-mp-xl"};export const MPAnimateLighting=/*@__PURE__*/e.forwardRef(function({duration:e=3e3,delay:d=0,repeat:l="infinite",alternate:p,paused:c,trigger:g="mount",play:u,once:f=!0,threshold:h=.2,color:_,size:x,spread:y=3,arc:w=50,blur:$=4,reverse:j=!1,render:b,className:v,style:z,children:N,...A},B){const L=m(_),M=o(x),P=i({trigger:g,play:u,once:f,threshold:h,paused:c,infinite:n(l)});return r({render:b,ref:[B,P.ref],props:{...A,"data-mp-size":M,className:["mp-anim-lighting",s[M],v].filter(Boolean).join(" "),style:{...a(L),"--_mp-anim-duration":`${e}ms`,"--_mp-anim-delay":`${d}ms`,"--_mp-anim-repeat":t(l),"--_mp-anim-direction":j?p?"alternate-reverse":"reverse":p?"alternate":"normal","--_mp-anim-state":P.state,"--_mp-anim-glow-width":`${y}px`,"--_mp-anim-glow-arc":`${w}deg`,"--_mp-anim-glow-blur":`${$}px`,...z},...P.handlers,"data-mp-animation":"lighting","data-mp-state":P.state,children:N}})});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { MPAnimateMode, MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps, MPSide } from '../../types.js';
|
|
4
|
+
export interface MPAnimateRevealProps extends MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the content is uncovered or covered again. An exit is quicker than
|
|
7
|
+
* an entrance — MD3's `short4` against `medium4` — unless `duration` says
|
|
8
|
+
* otherwise.
|
|
9
|
+
* @default 'in'
|
|
10
|
+
*/
|
|
11
|
+
mode?: MPAnimateMode;
|
|
12
|
+
/**
|
|
13
|
+
* Which edge the wipe opens at. `left` discloses the content from its left
|
|
14
|
+
* edge rightwards, which is the reading direction of most of the world and
|
|
15
|
+
* the right default for a line of text.
|
|
16
|
+
*
|
|
17
|
+
* Physical, as `MPSide` is everywhere in this library: a title disclosed from
|
|
18
|
+
* the left of its box is disclosed from the left in every writing direction.
|
|
19
|
+
* Which edge to name under RTL is a caller's decision, not a translation.
|
|
20
|
+
* @default 'left'
|
|
21
|
+
*/
|
|
22
|
+
from?: MPSide;
|
|
23
|
+
/**
|
|
24
|
+
* Fades the content in as it is uncovered.
|
|
25
|
+
*
|
|
26
|
+
* **Off** by default, and that is the one setting here worth arguing about. A
|
|
27
|
+
* reveal is not a fade: the whole point is that the ink is final from the
|
|
28
|
+
* first frame and only the extent of it changes. Doing both gives a weaker
|
|
29
|
+
* version of each — a wipe that is also translucent reads as neither.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
fade?: boolean;
|
|
33
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
34
|
+
render?: useRender.RenderProp;
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Content uncovered where it already is.
|
|
39
|
+
*
|
|
40
|
+
* The only entrance in this set where **nothing moves and no colour changes**.
|
|
41
|
+
* The element is at its final position from the first frame and at the ink it
|
|
42
|
+
* will end at; what changes is how much of it has been disclosed.
|
|
43
|
+
*
|
|
44
|
+
* That is what makes it the effect for anything whose *position* is part of
|
|
45
|
+
* what it is saying. A page title, a rule under a heading, the plot area of a
|
|
46
|
+
* chart, a table's first row: all of those mean something by being exactly
|
|
47
|
+
* where they are, and an entrance that travels tells the reader they arrived
|
|
48
|
+
* from somewhere. [MPAnimateFade](./animate-fade) is the other effect that
|
|
49
|
+
* leaves position alone, and the two differ in what they are willing to give
|
|
50
|
+
* up — a fade spends the colour, a reveal spends the extent.
|
|
51
|
+
*
|
|
52
|
+
* ## Why `clip-path` and not a mask or an `overflow` box
|
|
53
|
+
*
|
|
54
|
+
* A mask needs a gradient per direction and a second one to undo itself, and it
|
|
55
|
+
* is a second thing that has to agree with the side. A wrapper with
|
|
56
|
+
* `overflow: hidden` puts an element into the layout that was not there before,
|
|
57
|
+
* which for something inside a grid or a flex row changes what it is a child of
|
|
58
|
+
* — the very thing this effect exists to leave alone.
|
|
59
|
+
*
|
|
60
|
+
* `inset(0)` is already the spelling of "nothing is clipped", so the to-state
|
|
61
|
+
* needs no custom property and the resting appearance is the element's own.
|
|
62
|
+
* Nothing here reflows, so a reveal around a paragraph costs the page nothing.
|
|
63
|
+
*/
|
|
64
|
+
export declare const MPAnimateReveal: React.ForwardRefExoticComponent<MPAnimateRevealProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as a,revealClip as t,useAnimateElement as n}from"../../internal/animate.js";export const MPAnimateReveal=/*@__PURE__*/e.forwardRef(function({duration:e,delay:i=0,easing:o,repeat:l=1,alternate:s,paused:d,trigger:p="mount",play:c,once:m=!0,threshold:f=.2,stagger:g=0,durationStep:u,reverse:h,timeline:y,range:v,mode:N="in",from:j="left",fade:R=!1,render:S,className:b,style:w,children:x,...A},B){const M=n({effect:"reveal",duration:e,delay:i,easing:o,repeat:l,alternate:s,mode:N,clip:t(j),opacity:R?0:1,trigger:p,play:c,once:m,threshold:f,paused:d,infinite:a(l),stagger:g,durationStep:u,reverse:h,timeline:y,range:v,children:x});return r({render:S,ref:[B,M.ref],props:{...A,className:[M.className,b].filter(Boolean).join(" "),style:{...M.style,...w},...M.props,children:M.children}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPAnimateReveal}from"./MPAnimateReveal.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { MPAnimateMode, MPAnimateProps } from '../../types.js';
|
|
4
|
-
export interface MPAnimateRotateProps extends MPAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { MPAnimateMode, MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps } from '../../types.js';
|
|
4
|
+
export interface MPAnimateRotateProps extends MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether the content turns into place or out of it.
|
|
7
7
|
* @default 'in'
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";export const MPAnimateRotate=/*@__PURE__*/e.forwardRef(function({duration:e,delay:n=0,easing:i,repeat:o=1,alternate:s,paused:l,trigger:d="mount",play:g,once:m=!0,threshold:c=.2,stagger:p=0,durationStep:f,reverse:u,timeline:h,range:y,mode:N="in",from:j=-180,to:v=0,origin:R="center",fade:S=!0,render:$,className:b,style:w,children:x,...A},B){const M=a({effect:"rotate",duration:e,delay:n,easing:i,repeat:o,alternate:s,mode:N,angle:`${j}deg`,angleTo:`${v}deg`,opacity:S?0:1,trigger:d,play:g,once:m,threshold:c,paused:l,infinite:t(o),stagger:p,durationStep:f,reverse:u,timeline:h,range:y,children:x});return r({render:$,ref:[B,M.ref],props:{...A,className:[M.className,b].filter(Boolean).join(" "),style:{transformOrigin:R,...M.style,...w},...M.props,children:M.children}})});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { MPAnimateProps } from '../../types.js';
|
|
3
|
+
export interface MPAnimateScrambleProps extends Omit<MPAnimateProps, 'alternate' | 'easing'>, Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
4
|
+
/** The text, when it is easier to pass than to nest. Overrides `children`. */
|
|
5
|
+
text?: string;
|
|
6
|
+
/**
|
|
7
|
+
* How long the whole line takes to settle, in milliseconds.
|
|
8
|
+
* @default 1200
|
|
9
|
+
*/
|
|
10
|
+
duration?: number;
|
|
11
|
+
/**
|
|
12
|
+
* How much of that each character spends unsettled, as a fraction of the
|
|
13
|
+
* whole. At `1` the last character is still noise when the first has been
|
|
14
|
+
* still for the entire run; low values make the line resolve almost at once.
|
|
15
|
+
* @default 0.4
|
|
16
|
+
*/
|
|
17
|
+
spread?: number;
|
|
18
|
+
/**
|
|
19
|
+
* How often an unsettled character is replaced, in milliseconds. Below about
|
|
20
|
+
* 30 the noise stops reading as characters and starts reading as flicker.
|
|
21
|
+
* @default 50
|
|
22
|
+
*/
|
|
23
|
+
tick?: number;
|
|
24
|
+
/** The alphabet the noise is drawn from. */
|
|
25
|
+
characters?: string;
|
|
26
|
+
/** Which language the text is in, for deciding where a character ends. */
|
|
27
|
+
locale?: string;
|
|
28
|
+
/** The text to settle. Only text is settled — see below. */
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Text settling out of noise.
|
|
33
|
+
*
|
|
34
|
+
* `MPAnimateTyping`'s sibling, and the difference is what the box does. A
|
|
35
|
+
* typewriter's line grows a character at a time, so everything after it on the
|
|
36
|
+
* page moves while it runs; this one is **its finished length from the first
|
|
37
|
+
* frame** and only the characters inside it change. That is why it is the one
|
|
38
|
+
* to reach for in a heading, a table cell or anything else with something
|
|
39
|
+
* beside it.
|
|
40
|
+
*
|
|
41
|
+
* ## Written in JavaScript, and paused like everything else
|
|
42
|
+
*
|
|
43
|
+
* There is no keyframe for this: replacing a character with a random one is not
|
|
44
|
+
* an interpolation, so the frame loop is real. What it borrows is the trigger,
|
|
45
|
+
* the play state and the rewind — so `trigger="visible"`, `paused` and a
|
|
46
|
+
* `manual` replay behave exactly as they do on the six declared effects.
|
|
47
|
+
*
|
|
48
|
+
* Before it is triggered it shows its own **first frame**, which for this
|
|
49
|
+
* effect is the line fully scrambled. Not the answer: a heading that has
|
|
50
|
+
* already resolved while it waits to be scrolled to has given away the thing it
|
|
51
|
+
* was about to do. The waiting noise is fixed rather than churning, because
|
|
52
|
+
* motion that starts before the trigger is not the effect, it is a distraction
|
|
53
|
+
* beside it.
|
|
54
|
+
*
|
|
55
|
+
* ## What a screen reader gets
|
|
56
|
+
*
|
|
57
|
+
* The finished line, once, out of a clipped box; the settling copy is
|
|
58
|
+
* `aria-hidden`. Noise read out character by character is not text, and
|
|
59
|
+
* find-on-page still matches the real words.
|
|
60
|
+
*
|
|
61
|
+
* Under `prefers-reduced-motion` the line is simply there, finished, from the
|
|
62
|
+
* first frame — the state rather than the animation, because an effect switched
|
|
63
|
+
* off at the wrong end would leave a heading permanently unreadable.
|
|
64
|
+
*/
|
|
65
|
+
export declare const MPAnimateScramble: React.ForwardRefExoticComponent<MPAnimateScrambleProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{isInfinite as r,useAnimationRun as n,usePrefersReducedMotion as s}from"../../internal/animate.js";import{graphemesOf as i,textOf as o}from"../../internal/text.js";import{VISUALLY_HIDDEN as m}from"../../internal/visually-hidden.js";export const MPAnimateScramble=/*@__PURE__*/a.forwardRef(function({text:c,duration:l=1200,spread:u=.4,tick:d=50,characters:h="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#%&@$?!",locale:p,delay:f=0,repeat:g=1,paused:x,trigger:M="mount",play:j,once:y=!0,threshold:A=.2,className:N,style:b,children:v,...F},w){const S=s(),q=n({trigger:M,play:j,once:y,threshold:A,paused:x,infinite:r(g)}),E=c??o(v),P=a.useMemo(()=>i(E,p),[E,p]),[R,k]=a.useState(0),B="running"===q.state&&!S;a.useEffect(()=>{if(S)return void k(1);if(!B)return void k(0);let e=0,t=0;const a=r=>{0===t&&(t=r);const n=r-t-f,s=l>0?Math.min(1,Math.max(0,n/l)):1;k(s),s<1&&(e=requestAnimationFrame(a))};return e=requestAnimationFrame(a),()=>cancelAnimationFrame(e)},[B,S,l,f,q.started]);const C=S?E:P.map((e,t)=>(e=>{const t=P.length>1?e/(P.length-1):0;return R>=t*u+(1-u)})(t)?e:(e=>{const t=(2654435761*e+40503*Math.floor(R*l/Math.max(1,d)))%h.length;return h[Math.abs(t)]??h[0]})(t)).join("");return t("div",{ref:e=>{q.ref(e),"function"==typeof w?w(e):w&&(w.current=e)},className:N,style:b,"data-mp-animation":"scramble","data-mp-state":q.state,...q.handlers,...F,children:[e("span",{className:m,children:E}),e("span",{"aria-hidden":"true",className:"tabular-nums whitespace-pre-wrap",children:C})]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPAnimateScramble}from"./MPAnimateScramble.js";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { MPAnimateProps } from '../../types.js';
|
|
4
|
+
export interface MPAnimateShakeProps extends Omit<MPAnimateProps, 'alternate' | 'repeat' | 'once' | 'threshold'>, React.ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
/**
|
|
6
|
+
* How far it travels at the widest point of the first swing — a number in
|
|
7
|
+
* pixels, or any CSS length.
|
|
8
|
+
* @default '0.5rem'
|
|
9
|
+
*/
|
|
10
|
+
distance?: number | string;
|
|
11
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
12
|
+
render?: useRender.RenderProp;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The answer to something that did not work.
|
|
17
|
+
*
|
|
18
|
+
* A wrong code, a rejected card, a form submitted with a field still empty. It
|
|
19
|
+
* is over in four hundred milliseconds and it says *that was refused* more
|
|
20
|
+
* plainly than any colour does — a red border is a **state** the field is now
|
|
21
|
+
* in, and this is a reply to what the reader just did.
|
|
22
|
+
*
|
|
23
|
+
* ## Why this is allowed, when a control never moves
|
|
24
|
+
*
|
|
25
|
+
* The library's rule is that controls do not transform, and it holds without
|
|
26
|
+
* exception — but the rule is about a control's **resting states**: hover,
|
|
27
|
+
* press, on, off. Movement there is a stand-in for something colour says
|
|
28
|
+
* better, and it makes a target that the pointer has to chase.
|
|
29
|
+
*
|
|
30
|
+
* A shake is not a state. It is not a thing the control *is*, it is a thing
|
|
31
|
+
* that just happened, and it is finished before a reader could try to point at
|
|
32
|
+
* it. That is the whole of the exception, and it is the only one.
|
|
33
|
+
*
|
|
34
|
+
* ## What keeps it from becoming decoration
|
|
35
|
+
*
|
|
36
|
+
* `trigger` defaults to **`manual`**, so nothing shakes on mount. A shake that
|
|
37
|
+
* runs when a page loads is decoration, and readers learn to ignore moving
|
|
38
|
+
* decoration — which costs the effect exactly the meaning it is here for.
|
|
39
|
+
*
|
|
40
|
+
* There is no `repeat`. A refusal is said once.
|
|
41
|
+
*
|
|
42
|
+
* The keyframe is home at both ends, so an interrupted shake leaves the element
|
|
43
|
+
* where the page put it, and its second half is smaller than its first — a
|
|
44
|
+
* shake that ends as hard as it starts reads as a loop that was cut off.
|
|
45
|
+
*
|
|
46
|
+
* ## Shaking again
|
|
47
|
+
*
|
|
48
|
+
* Set `play` back to `false` and then to `true`. The animation is rewound
|
|
49
|
+
* without unmounting anything, so the field keeps its value and its focus and
|
|
50
|
+
* the second wrong answer moves exactly as much as the first did.
|
|
51
|
+
*
|
|
52
|
+
* ```tsx
|
|
53
|
+
* const [wrong, setWrong] = React.useState(false);
|
|
54
|
+
*
|
|
55
|
+
* function reject() {
|
|
56
|
+
* setWrong(false);
|
|
57
|
+
* requestAnimationFrame(() => setWrong(true));
|
|
58
|
+
* }
|
|
59
|
+
*
|
|
60
|
+
* <MPAnimateShake play={wrong}>
|
|
61
|
+
* <MPOtpField />
|
|
62
|
+
* </MPAnimateShake>;
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare const MPAnimateShake: React.ForwardRefExoticComponent<MPAnimateShakeProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{lengthValue as a,useAnimateElement as n}from"../../internal/animate.js";export const MPAnimateShake=/*@__PURE__*/e.forwardRef(function({duration:e=400,delay:s=0,easing:t="standard",paused:i,trigger:l="manual",play:o,distance:d="0.5rem",render:c,className:m,style:f,children:p,...h},u){const y=n({effect:"shake",effectClass:"mp-anim-shake",duration:e,delay:s,easing:t,repeat:1,x:a(d),trigger:l,play:o,once:!0,threshold:.2,paused:i,infinite:!1,children:p});return r({render:c,ref:[u,y.ref],props:{...h,className:[y.className,m].filter(Boolean).join(" "),style:{...y.style,...f},...y.props,children:y.children}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPAnimateShake}from"./MPAnimateShake.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { MPAnimateMode, MPAnimateProps, MPSide } from '../../types.js';
|
|
4
|
-
export interface MPAnimateSlideProps extends MPAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { MPAnimateMode, MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps, MPSide } from '../../types.js';
|
|
4
|
+
export interface MPAnimateSlideProps extends MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether the content slides in or slides away. `out` leaves by the same edge
|
|
7
7
|
* it would have come from, and is quicker — MD3's `short4` against `medium4`.
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,slideOffsets as a,useAnimateElement as n}from"../../internal/animate.js";export const MPAnimateSlide=/*@__PURE__*/e.forwardRef(function({duration:e,delay:i=0,easing:o,repeat:s=1,alternate:l,paused:d,trigger:m="mount",play:c,once:p=!0,threshold:f=.2,stagger:g=0,durationStep:u,reverse:y,timeline:h,range:x,mode:N="in",from:S="bottom",distance:b="100%",fade:j=!0,render:v,className:w,style:A,children:B,...M},P){const{x:R,y:k}=a(S,b),q=n({effect:"slide",duration:e,delay:i,easing:o,repeat:s,alternate:l,mode:N,x:R,y:k,opacity:j?0:1,trigger:m,play:c,once:p,threshold:f,paused:d,infinite:t(s),stagger:g,durationStep:u,reverse:y,timeline:h,range:x,children:B});return r({render:v,ref:[P,q.ref],props:{...M,className:[q.className,w].filter(Boolean).join(" "),style:{...q.style,...A},...q.props,children:q.children}})});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { MPAnimateProps, MPAnimateTimelineProps, MPSide } from '../../types.js';
|
|
3
|
+
/** What a line is cut into before it is animated. */
|
|
4
|
+
export type MPAnimateSplitBy = 'word' | 'character';
|
|
5
|
+
export interface MPAnimateSplitProps extends MPAnimateProps, MPAnimateTimelineProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
6
|
+
/** The text, when it is easier to pass than to nest. Overrides `children`. */
|
|
7
|
+
text?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether each piece is a word or a character.
|
|
10
|
+
* @default 'word'
|
|
11
|
+
*/
|
|
12
|
+
by?: MPAnimateSplitBy;
|
|
13
|
+
/**
|
|
14
|
+
* How long after one piece the next one starts, in milliseconds. This is the
|
|
15
|
+
* whole effect.
|
|
16
|
+
*
|
|
17
|
+
* The default is right for words. Characters want a good deal less — there
|
|
18
|
+
* are five or six times as many of them, and the same step turns a sentence
|
|
19
|
+
* into something that takes four seconds to finish arriving.
|
|
20
|
+
* @default 40
|
|
21
|
+
*/
|
|
22
|
+
stagger?: number;
|
|
23
|
+
/**
|
|
24
|
+
* How much longer each piece takes than the one before it, in milliseconds.
|
|
25
|
+
* Negative shortens instead, clamped at zero.
|
|
26
|
+
* @default 0
|
|
27
|
+
*/
|
|
28
|
+
durationStep?: number;
|
|
29
|
+
/** Runs the line from the last piece to the first. */
|
|
30
|
+
reverse?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Which edge each piece drifts in from.
|
|
33
|
+
* @default 'bottom'
|
|
34
|
+
*/
|
|
35
|
+
from?: MPSide;
|
|
36
|
+
/**
|
|
37
|
+
* How far each piece travels. Short on purpose — a long travel over forty
|
|
38
|
+
* pieces is a paragraph that is moving rather than a paragraph arriving.
|
|
39
|
+
* @default '0.5rem'
|
|
40
|
+
*/
|
|
41
|
+
distance?: number | string;
|
|
42
|
+
/**
|
|
43
|
+
* Fades each piece in as it settles.
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
fade?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Which language the text is in, for deciding where a word ends. Only worth
|
|
49
|
+
* setting where the answer is genuinely ambiguous; `Intl.Segmenter` reads the
|
|
50
|
+
* script itself for most of them.
|
|
51
|
+
*/
|
|
52
|
+
locale?: string;
|
|
53
|
+
/** The text to split. Only text is split — see below. */
|
|
54
|
+
children?: React.ReactNode;
|
|
55
|
+
}
|
|
56
|
+
export declare const MPAnimateSplit: React.ForwardRefExoticComponent<MPAnimateSplitProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{ANIMATION_CLASS as r,ANIM_BASE as n,animationSlots as i,isInfinite as s,slideOffsets as l,useAnimationRun as o}from"../../internal/animate.js";import{graphemesOf as m,textOf as d,wordsOf as c}from"../../internal/text.js";import{VISUALLY_HIDDEN as p}from"../../internal/visually-hidden.js";export const MPAnimateSplit=/*@__PURE__*/t.forwardRef(function({text:t,by:f="word",duration:u,delay:h=0,easing:y,repeat:g=1,alternate:x,paused:j,trigger:N="mount",play:b,once:v=!0,threshold:w=.2,timeline:k,range:S,stagger:$=40,durationStep:A=0,reverse:M=!1,from:O="bottom",distance:P="0.5rem",fade:R=!0,locale:_,className:q,style:z,children:B,...C},D){const E=o({trigger:N,play:b,once:v,threshold:w,paused:j,infinite:s(g)}),F="view"===k?j?"paused":"running":E.state,G=t??d(B),{x:H,y:I}=l(O,P),J=c(G,_),K="character"===f?J.map(e=>m(e,_)):J.map(e=>[e]),L=`${n} ${r.slide} inline-block`,Q=K.reduce((e,a)=>e+a.length,0);let T=-1;return a("div",{ref:e=>{E.ref(e),"function"==typeof D?D(e):D&&(D.current=e)},className:q,style:{"--_mp-anim-state":F,...z},"data-mp-animation":"split","data-mp-state":F,...E.handlers,...C,children:[e("span",{className:p,children:G}),e("span",{"aria-hidden":"true",children:K.map((a,t)=>e("span",{className:"inline-block whitespace-pre",children:a.map((a,t)=>{T+=1;const r=M?Q-1-T:T;return e("span",{className:L,style:i({effect:"slide",duration:u,delay:h+r*$,easing:y,repeat:g,alternate:x,durationOffset:r*A,timeline:k,range:S,x:H,y:I,opacity:R?0:1}),children:a},t)})},t))})]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPAnimateSplit}from"./MPAnimateSplit.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{isInfinite as
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{isInfinite as a,useAnimationRun as i,usePrefersReducedMotion as n}from"../../internal/animate.js";import{graphemesOf as s,textOf as o}from"../../internal/text.js";import{VISUALLY_HIDDEN as u}from"../../internal/visually-hidden.js";export const MPAnimateTyping=/*@__PURE__*/r.forwardRef(function({text:c,speed:m=24,hold:l=1400,erase:d=!1,eraseSpeed:f,caret:p=!0,caretChar:h="|",duration:y,delay:x=0,repeat:g=1,paused:T,trigger:j="mount",play:v,once:M=!0,threshold:N=.2,className:w,style:E,children:R,...S},A){const C=i({trigger:j,play:v,once:M,threshold:N,paused:T,infinite:a(g)}),P=n(),b=c??o(R),k=r.useMemo(()=>s(b),[b]),q=k.length,[z,B]=r.useState(0),D=r.useRef(0),F=y&&q>0?y/q:1e3/Math.max(m,1),G=1e3/Math.max(f??2*m,1);return r.useEffect(()=>{D.current=0},[q]),r.useEffect(()=>{if(P||0===q)return void B(q);if(!C.started)return D.current=0,void B(0);if(T)return;let e,t=!1,r=D.current,a=1,i=!1;const n="infinite"===g?1/0:Math.max(1,g);if(r>=q&&1===n)return;const s=()=>{if(!t){if(i)return r-=1,D.current=r,B(r),r<=0&&(i=!1,a+=1),void(e=setTimeout(s,i?G:F));if(r+=1,D.current=r,B(r),r<q)e=setTimeout(s,F);else if(!(a>=n)){if(d)return i=!0,void(e=setTimeout(s,l));a+=1,e=setTimeout(()=>{t||(r=0,D.current=0,B(0),e=setTimeout(s,F))},l)}}};return B(r),e=setTimeout(s,0===r?x:F),()=>{t=!0,clearTimeout(e)}},[C.started,T,P,q,F,G,x,l,d,g]),t("div",{ref:e=>{C.ref(e),"function"==typeof A?A(e):A&&(A.current=e)},className:w,style:E,"data-mp-animation":"typing","data-mp-state":C.state,...C.handlers,...S,children:[e("span",{className:u,children:b}),t("span",{"aria-hidden":"true",className:"whitespace-pre-wrap",children:[k.slice(0,z).join(""),p?e("span",{className:"mp-typing-caret",children:h}):null]})]})});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { MPAnimateMode, MPAnimateProps } from '../../types.js';
|
|
4
|
-
export interface MPAnimateZoomProps extends MPAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { MPAnimateMode, MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps } from '../../types.js';
|
|
4
|
+
export interface MPAnimateZoomProps extends MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether the content comes forward or falls away. An exit is quicker than an
|
|
7
7
|
* entrance — MD3's `short4` against `medium4` — unless `duration` says
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";export const MPAnimateZoom=/*@__PURE__*/e.forwardRef(function({duration:e,delay:n=0,easing:o,repeat:i=1,alternate:s,paused:l,trigger:d="mount",play:m,once:c=!0,threshold:p=.2,stagger:f=0,durationStep:g,reverse:u,timeline:h,range:y,mode:N="in",from:j=.4,fade:v=!0,render:S,className:b,style:w,children:x,...z},A){const B=a({effect:"zoom",duration:e,delay:n,easing:o,repeat:i,alternate:s,mode:N,scale:j,opacity:v?0:1,trigger:d,play:m,once:c,threshold:p,paused:l,infinite:t(i),stagger:f,durationStep:g,reverse:u,timeline:h,range:y,children:x});return r({render:S,ref:[A,B.ref],props:{...z,className:[B.className,b].filter(Boolean).join(" "),style:{transformOrigin:"center",...B.style,...w},...B.props,children:B.children}})});
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { MPColor, MPSize, MPVariant } from '../../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* How the artwork is **framed**, which is the one question this component
|
|
6
|
+
* exists to answer.
|
|
7
|
+
*
|
|
8
|
+
* - `bare` — drawn as it was given, at the height `size` asks for and whatever
|
|
9
|
+
* width that comes to. No tile, no crop, no inset. The default, and the only
|
|
10
|
+
* one that is right for a logo drawn with its own background, its own margin,
|
|
11
|
+
* or the product's name set into it.
|
|
12
|
+
* - `app` — an app icon: a filled tile with the artwork inset in it and the
|
|
13
|
+
* corners cut off. What a mark drawn as a bare glyph needs before it can sit
|
|
14
|
+
* beside anything else.
|
|
15
|
+
* - `circle` — the same tile, round, for the products whose icon is a disc.
|
|
16
|
+
*
|
|
17
|
+
* There is no `square`. A tile with the corners left on is the one shape MD3
|
|
18
|
+
* does not draw, and an `app` icon at `xs` is already close enough to a square
|
|
19
|
+
* that a fourth value would be one nobody could see.
|
|
20
|
+
*/
|
|
21
|
+
export type MPAppLogoShape = 'bare' | 'app' | 'circle';
|
|
22
|
+
export interface MPAppLogoProps extends Omit<React.ComponentPropsWithoutRef<'a'>, 'color' | 'href' | 'target' | 'rel'> {
|
|
23
|
+
/**
|
|
24
|
+
* The artwork, as an image. Beaten by `children`, so a project that inlines
|
|
25
|
+
* its SVG and a project that links a PNG use the same component.
|
|
26
|
+
*/
|
|
27
|
+
src?: string;
|
|
28
|
+
/** Candidate images at other resolutions, as on any `<img>`. */
|
|
29
|
+
srcSet?: string;
|
|
30
|
+
/**
|
|
31
|
+
* What the artwork says for a reader who cannot see it. Defaults to `name`,
|
|
32
|
+
* which is almost always right: a logo means the product.
|
|
33
|
+
*/
|
|
34
|
+
alt?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The product's name.
|
|
37
|
+
*
|
|
38
|
+
* One prop doing three jobs, as on `MPAvatar`: it names the artwork, its
|
|
39
|
+
* initials are what a tile falls back to, and it is drawn as the logotype
|
|
40
|
+
* when there is no artwork at all. That last one is what makes
|
|
41
|
+
* `<MPAppLogo name="Acme" />` — no file, no glyph, no markup — still a logo.
|
|
42
|
+
*/
|
|
43
|
+
name?: string;
|
|
44
|
+
/** The initials on a tile, written out, for when the rule derived the wrong ones. */
|
|
45
|
+
initials?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Draws the name beside the artwork, as the words half of a lockup.
|
|
48
|
+
*
|
|
49
|
+
* Off by default, because the common case is a file that already says the
|
|
50
|
+
* name. Turn it on for a bare mark — the icon in a header with the product
|
|
51
|
+
* beside it — and the name stops being read out twice: what is drawn *is* the
|
|
52
|
+
* accessible name from then on.
|
|
53
|
+
*
|
|
54
|
+
* Ignored when the name is already the whole logo, which is what a `bare`
|
|
55
|
+
* logo with no artwork is.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
showName?: boolean;
|
|
59
|
+
/** @default 'bare' */
|
|
60
|
+
shape?: MPAppLogoShape;
|
|
61
|
+
/**
|
|
62
|
+
* How much surface the tile paints. Nothing at all on `bare`, which draws no
|
|
63
|
+
* tile.
|
|
64
|
+
* @default 'filled'
|
|
65
|
+
*/
|
|
66
|
+
variant?: MPVariant;
|
|
67
|
+
/**
|
|
68
|
+
* How tall the mark is — the control heights, so a logo and the button beside
|
|
69
|
+
* it in a header line up. On `bare` only the height is set and the width is
|
|
70
|
+
* whatever the artwork's proportions come to; on a tile both are, because a
|
|
71
|
+
* tile is square.
|
|
72
|
+
* @default 'md'
|
|
73
|
+
*/
|
|
74
|
+
size?: MPSize;
|
|
75
|
+
/** @default 'primary' */
|
|
76
|
+
color?: MPColor;
|
|
77
|
+
/**
|
|
78
|
+
* Insets the artwork from the tile's edge, the way an app icon's glyph is
|
|
79
|
+
* held off its own corners. Turn it off for a mark drawn to fill the tile — a
|
|
80
|
+
* favicon, a photograph.
|
|
81
|
+
*
|
|
82
|
+
* No effect on `bare`, which has no tile to be inset from, and none on a tile
|
|
83
|
+
* showing initials, which are sized by their own type scale.
|
|
84
|
+
* @default true
|
|
85
|
+
*/
|
|
86
|
+
padded?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* An exact height for the mark, overriding `size`. A number is pixels.
|
|
89
|
+
*
|
|
90
|
+
* The one escape hatch this component needs. A brand's artwork is drawn at a
|
|
91
|
+
* height somebody chose, and rounding it to the nearest rung of a ladder is
|
|
92
|
+
* how a logo ends up half a pixel off the type beside it.
|
|
93
|
+
*/
|
|
94
|
+
height?: number | string;
|
|
95
|
+
/**
|
|
96
|
+
* Makes the whole lockup a link. A logo in a header is nearly always the way
|
|
97
|
+
* back to the front page, and a `<span>` inside an `<a>` the caller wrote is
|
|
98
|
+
* the same thing with one more element in it.
|
|
99
|
+
*/
|
|
100
|
+
href?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Where that link opens. `rel` follows on its own for `_blank` — see `rel`.
|
|
103
|
+
*
|
|
104
|
+
* A logo in a header is usually the way back to the front page and opens in
|
|
105
|
+
* place, so this is rarely set. The one case it is set for is the lockup that
|
|
106
|
+
* links to somebody else's site, which is also the case where the `rel`
|
|
107
|
+
* matters most.
|
|
108
|
+
*/
|
|
109
|
+
target?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Overrides the `rel` a `_blank` lockup would otherwise get, which is
|
|
112
|
+
* `noopener noreferrer`. Writing one **replaces** it rather than adding to it,
|
|
113
|
+
* so a logo that also needs `nofollow` spells all three out.
|
|
114
|
+
*/
|
|
115
|
+
rel?: string;
|
|
116
|
+
/** Anything else the `<img>` needs — `loading`, `decoding`, `crossOrigin`. */
|
|
117
|
+
imageProps?: Omit<React.ComponentPropsWithoutRef<'img'>, 'src' | 'srcSet' | 'alt'>;
|
|
118
|
+
/**
|
|
119
|
+
* Renders something other than a `<span>`, or than the `<a>` an `href` makes
|
|
120
|
+
* it. `render={<Link to="/" />}` for a router's own link, `render={<h1 />}`
|
|
121
|
+
* for the one page where the product's name is the page's heading.
|
|
122
|
+
*/
|
|
123
|
+
render?: useRender.RenderProp;
|
|
124
|
+
/**
|
|
125
|
+
* The artwork, as markup. An inline `<svg>` is the usual one, and it is worth
|
|
126
|
+
* preferring to `src`: a mark that is part of the document takes the page's
|
|
127
|
+
* own colours, needs no second request, and cannot arrive late.
|
|
128
|
+
*/
|
|
129
|
+
children?: React.ReactNode;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* A product's mark, at a known size, that is never an empty box.
|
|
133
|
+
*
|
|
134
|
+
* ```tsx
|
|
135
|
+
* <MPAppLogo name="Acme" shape="app" href="/" showName />
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* Four things can be the mark and exactly one of them is at a time: markup
|
|
139
|
+
* handed to `children`, an image at `src`, the initials of `name` on a tile, or
|
|
140
|
+
* — with no tile to put them on — the name itself, set as the logotype. The
|
|
141
|
+
* last of those is the point of the component: a product that has not drawn a
|
|
142
|
+
* logo yet still has one, and swapping it for the real file later is one prop.
|
|
143
|
+
*
|
|
144
|
+
* ## What it adds over an `<img>`
|
|
145
|
+
*
|
|
146
|
+
* The framing. A mark drawn as a bare glyph and a mark drawn with its own
|
|
147
|
+
* background need opposite treatment, and which of the two a given file is
|
|
148
|
+
* cannot be worked out from the file. So `shape` is a decision the caller makes
|
|
149
|
+
* once and everything else follows: `bare` keeps the artwork's own proportions
|
|
150
|
+
* and draws nothing behind it, `app` and `circle` inset it into a tile of the
|
|
151
|
+
* page's own colour.
|
|
152
|
+
*
|
|
153
|
+
* ## The name is in the document exactly once
|
|
154
|
+
*
|
|
155
|
+
* Which element carries it depends on what the mark turned out to be. A
|
|
156
|
+
* logotype *is* the name; an image can carry it as `alt`; a glyph and a pair of
|
|
157
|
+
* initials say nothing at all, so those are the cases a clipped copy is for.
|
|
158
|
+
* And whenever the words are drawn beside the mark, the mark becomes decoration
|
|
159
|
+
* rather than a second reading of the same thing — "AC" read out is two
|
|
160
|
+
* letters, not a product.
|
|
161
|
+
*
|
|
162
|
+
* ## What it does not carry
|
|
163
|
+
*
|
|
164
|
+
* No tagline, no version, no elevation. A logo with a line of text under it is
|
|
165
|
+
* a logo next to an `MPTypography`, and a second spelling for that would give
|
|
166
|
+
* the library two. Elevation is left out for a sharper reason: the prop moves
|
|
167
|
+
* tone as well as shadow everywhere else it appears, and a logo tile's tone is
|
|
168
|
+
* the accent — there is nothing for it to move to. An app icon is a sticker on
|
|
169
|
+
* the page rather than a thing hovering over it.
|
|
170
|
+
*/
|
|
171
|
+
export declare const MPAppLogo: React.ForwardRefExoticComponent<MPAppLogoProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{useRender as r}from"@base-ui/react/use-render";import{accentSlots as a}from"../../internal/accent.js";import{linkRel as o}from"../../internal/link.js";import{initialsOf as i}from"../../internal/initials.js";import{cssLength as l}from"../../internal/length.js";import{CONTROL_GAP as m,CONTROL_HEIGHT as s,CONTROL_SQUARE as c,hasContent as d}from"../../internal/scale.js";import{VISUALLY_HIDDEN as p}from"../../internal/visually-hidden.js";import{useMPColor as u,useMPSize as f}from"../../internal/config.js";const x={xs:"text-[0.75rem]",sm:"text-[0.875rem]",md:"text-[1.0625rem]",lg:"text-[1.375rem]",xl:"text-[1.625rem]"},g={xs:"text-[0.75rem]",sm:"text-[0.875rem]",md:"text-[1.0625rem]",lg:"text-[1.3125rem]",xl:"text-[1.5625rem]"},h={xs:"rounded-mp-xs",sm:"rounded-mp-sm",md:"rounded-mp-md",lg:"rounded-mp-md",xl:"rounded-mp-md"},v={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-1 bg-mp-surface-container-low text-(--_mp-accent)",outlined:"border-mp-outline border bg-transparent text-(--_mp-accent)",text:"text-mp-on-surface-variant bg-transparent"};export const MPAppLogo=/*@__PURE__*/n.forwardRef(function({src:w,srcSet:j,alt:b,name:_,initials:y,showName:N=!1,shape:k="bare",variant:B="filled",size:z,color:P,padded:S=!0,height:A,href:F,target:L,rel:M,imageProps:R,render:$,className:q,style:C,children:D,...E},G){const H=f(z),I=u(P),J="bare"!==k,K=d(D)?D:w?"image":null,O=J&&S,Q=null===K&&!J,T=N&&!Q&&d(_),U=b??_,V=y??(_?i(_):""),W="image"===K&&!T&&d(U),X=Q||W,Y=!X&&!T&&d(U),Z=l(A),ee=Z?{height:Z,width:J?Z:void 0}:null,te=e("span",{"aria-hidden":!X||void 0,className:["mp-app-logo__mark flex shrink-0 items-center justify-center overflow-hidden","font-semibold tracking-tight whitespace-nowrap",Z?"":s[H],J?[Z?"":c[H],"circle"===k?"rounded-mp-full":h[H],g[H],v[B]].filter(Boolean).join(" "):["text-mp-on-surface w-auto",x[H]].join(" "),"[&_svg]:w-auto [&_svg]:shrink-0",O?"[&_svg]:h-[72%] [&_svg]:max-w-[72%]":"[&_svg]:h-full [&_svg]:max-w-full"].filter(Boolean).join(" "),style:ee??void 0,children:"image"===K?e("img",{src:w,srcSet:j,alt:W?U??"":"",className:["w-auto object-contain",O?"h-[72%] max-w-[72%]":"h-full max-w-full"].join(" "),decoding:"async",...R}):K??(Q?_:V)});return r({render:$??e(F?"a":"span",{}),ref:G,props:{href:F,target:L,rel:o(L,M),"data-mp-size":H,"data-mp-variant":B,className:["mp-app-logo inline-flex max-w-full min-w-0 items-center align-middle","text-mp-on-surface no-underline select-none",m[H],F?"rounded-mp-xs cursor-pointer":"",F?"outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid outline-none":"",q??""].filter(Boolean).join(" "),style:{...a(I),...C},children:t(n.Fragment,{children:[te,T?e("span",{className:`mp-app-logo__name min-w-0 truncate font-semibold ${x[H]}`,children:_}):null,Y?e("span",{className:p,children:U}):null]}),...E}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPAppLogo}from"./MPAppLogo.js";
|