material-plus-ui 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/components/accordion/MPAccordion.d.ts +21 -1
- package/dist/components/accordion/MPAccordion.js +1 -1
- package/dist/components/alert/MPAlert.d.ts +33 -2
- 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 +156 -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.js +1 -0
- 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 +10 -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/card/MPCard.js +1 -1
- package/dist/components/checkbox/MPCheckbox.js +1 -1
- package/dist/components/chip/MPChip.d.ts +10 -1
- 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/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/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 +295 -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/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-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.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 +100 -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/image/MPImage.d.ts +10 -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.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/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/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/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 +24 -2
- 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/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/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 +2 -0
- package/dist/constants/glyphs.js +1 -1
- package/dist/constants/icons.d.ts +1 -0
- 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 +205 -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/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 +471 -0
- package/dist/internal/chart.js +1 -0
- package/dist/internal/config.d.ts +24 -5
- package/dist/internal/config.js +1 -1
- package/dist/internal/data-table.d.ts +162 -0
- package/dist/internal/data-table.js +1 -0
- 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 +170 -0
- package/dist/internal/initials.d.ts +28 -0
- package/dist/internal/initials.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/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/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/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 +1356 -133
- package/dist/types.d.ts +564 -3
- package/package.json +3 -2
- 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
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ It follows the specification directly rather than wrapping somebody's implementa
|
|
|
23
23
|
- **IME-safe by construction.** Korean, Japanese and Chinese composition survives whatever your `onChange` does with the value.
|
|
24
24
|
- **Bring your own icons.** `MPIcon` takes a component or an element from any set. `lucide-react` ships with the package, gathered in one readable constants file.
|
|
25
25
|
- **Works in a Next.js server component**, and in any bundler: the components carry `"use client"`, the barrel and the data do not, and every specifier in `dist/` names a file — so webpack, Vite, esbuild, Rollup and plain Node all resolve it.
|
|
26
|
-
- **ESM only**, TypeScript declarations included, and tree-shakeable for real: one component is
|
|
26
|
+
- **ESM only**, TypeScript declarations included, and tree-shakeable for real: one component is 3.0 kB gzipped and five are 9.0 kB, against 126.8 kB for every export there is. `npm run measure` prints those numbers off a real bundler, so they cannot quietly stop being true. The stylesheet splits the same way.
|
|
27
27
|
- **One runtime dependency.** React 18 or 19, Node.js 22 or later.
|
|
28
28
|
|
|
29
29
|
## Documentation
|
|
@@ -74,7 +74,7 @@ If Tailwind v4 is already in your project, import the token sheet instead:
|
|
|
74
74
|
@import 'material-plus-ui/tailwind.css';
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
A page that renders a handful of components can take the tokens and a sheet each instead of the whole
|
|
77
|
+
A page that renders a handful of components can take the tokens and a sheet each instead of the whole 144.8 kB — 4.8 kB gzipped for one component against 21.0 kB for the lot. [The guide](https://material-plus.cdget.com/guide/getting-started#if-you-only-render-a-few-components) has the numbers and where the two paths cross.
|
|
78
78
|
|
|
79
79
|
```ts
|
|
80
80
|
import 'material-plus-ui/styles/tokens.css';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { MPSize, MPVariant } from '../../types.js';
|
|
2
|
+
import type { MPDensity, MPSize, MPElevation, MPVariant } from '../../types.js';
|
|
3
3
|
export interface MPAccordionProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'defaultValue' | 'onChange'> {
|
|
4
4
|
/**
|
|
5
5
|
* Whether more than one section may be open at once.
|
|
@@ -31,11 +31,31 @@ export interface MPAccordionProps extends Omit<React.ComponentPropsWithoutRef<'d
|
|
|
31
31
|
* @default 'outlined'
|
|
32
32
|
*/
|
|
33
33
|
variant?: MPVariant;
|
|
34
|
+
/**
|
|
35
|
+
* How far off the page the sheet is lifted, on MD3's own scale.
|
|
36
|
+
*
|
|
37
|
+
* It moves the **tone** as well as the shadow, because Material pairs the two:
|
|
38
|
+
* a level-2 surface is `surface-container` under a level-2 shadow, and a prop
|
|
39
|
+
* that only cast a shadow would raise this into a surface the specification
|
|
40
|
+
* has no name for. Given a level, `variant` is left holding only its hairline.
|
|
41
|
+
*
|
|
42
|
+
* Left unset, `variant` decides — and `variant="elevated"` is this at `1`.
|
|
43
|
+
*/
|
|
44
|
+
elevation?: MPElevation;
|
|
34
45
|
/**
|
|
35
46
|
* The room inside every section, and the type scale of its header and body.
|
|
36
47
|
* @default 'md'
|
|
37
48
|
*/
|
|
38
49
|
size?: MPSize;
|
|
50
|
+
/**
|
|
51
|
+
* Takes room out of every section's header and body.
|
|
52
|
+
*
|
|
53
|
+
* An accordion is a list of rows that happen to open, so it wants density for
|
|
54
|
+
* the reason a list does: a panel of eight sections that fits on the screen is
|
|
55
|
+
* a different component from one that has to be scrolled to be understood.
|
|
56
|
+
* @default 0
|
|
57
|
+
*/
|
|
58
|
+
density?: MPDensity;
|
|
39
59
|
/**
|
|
40
60
|
* Keeps closed panels in the DOM so the browser's own page search can find and
|
|
41
61
|
* open them. Overrides `keepMounted`.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{Accordion as
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{Accordion as i}from"@base-ui/react/accordion";import{MPIcon as a}from"../icon/MPIcon.js";import{ChevronDownIcon as r}from"../../constants/icons.js";import{MPStateLayer as o}from"../../internal/StateLayer.js";import{CONTROL_GAP as s,CONTROL_ICON as l,hasContent as d,META_TEXT as c,PROSE_TEXT as m,SHEET_TITLE as u}from"../../internal/scale.js";import{sheetPadX as p,sheetPadY as f}from"../../internal/density.js";import{containerSurface as h}from"../../internal/elevation.js";import{useMPDensity as v,useMPSize as x}from"../../internal/config.js";const b=/*@__PURE__*/n.createContext({size:"md",density:0,dividers:!0}),g=/*@__PURE__*/["h-(--accordion-panel-height) overflow-hidden","transition-[height] duration-(--mp-sys-motion-duration-short4) ease-mp-standard","motion-reduce:transition-none","data-starting-style:h-0 data-ending-style:h-0"].join(" ");const j={xs:"pb-2.5",sm:"pb-3",md:"pb-4",lg:"pb-5",xl:"pb-6"};export const MPAccordion=/*@__PURE__*/n.forwardRef(function({multiple:t=!1,value:a,defaultValue:r,onValueChange:o,dividers:s=!0,disabled:l=!1,variant:d="outlined",elevation:c,size:m,density:u,hiddenUntilFound:p=!1,keepMounted:f=!1,className:g,children:j,...N},y){const w=x(m),_=v(u),k=n.useMemo(()=>({size:w,density:_,dividers:s}),[w,_,s]);return e(b.Provider,{value:k,children:e(i.Root,{ref:y,multiple:t,value:a,defaultValue:r,onValueChange:e=>o?.(e),disabled:l,hiddenUntilFound:p,keepMounted:f,"data-mp-size":w,"data-mp-variant":d,className:["mp-accordion rounded-mp-md flex w-full flex-col",h(d,c),"text-mp-on-surface",s?"overflow-hidden [&>div+div]:border-mp-outline-variant [&>div+div]:border-t":"p-1",g??""].filter(Boolean).join(" "),...N,children:j})})});export const MPAccordionItem=/*@__PURE__*/n.forwardRef(function({value:h,title:v,subtitle:x,startIcon:N,action:y,disabled:w=!1,className:_,children:k,...z},C){const{size:M,density:A,dividers:P}=n.useContext(b),B=p(M,A),I=f(M,A),R=n.useRef(null),[V,F]=n.useState(!1),S=n.useCallback(e=>{var t;R.current=e,e&&F(e.hasAttribute("data-open")&&!((t=e).hasAttribute("data-starting-style")&&parseFloat(getComputedStyle(t).transitionDuration)>0))},[]);return t(i.Item,{ref:C,value:h,disabled:w,className:["mp-accordion__item flex flex-col",_??""].filter(Boolean).join(" "),...z,children:[t(i.Header,{className:"m-0 flex w-full items-center font-[inherit]",children:[t(i.Trigger,{className:["group relative flex min-w-0 flex-1 cursor-pointer items-center text-start","appearance-none border-0 bg-transparent font-[inherit] text-inherit",B,I,s[M],P?"":"rounded-mp-sm","outline-mp-secondary focus-visible:outline-2 focus-visible:-outline-offset-2","focus-visible:outline-solid outline-none","disabled:text-mp-on-surface/38 disabled:cursor-default"].filter(Boolean).join(" "),children:[e(o,{}),d(N)?e("span",{className:"text-mp-on-surface-variant flex h-[1lh] shrink-0 items-center",children:N}):null,t("span",{className:"mp-accordion__text flex min-w-0 flex-1 flex-col",children:[d(v)?e("span",{className:`mp-accordion__title truncate ${u[M]}`,children:v}):null,d(x)?e("span",{className:`mp-accordion__subtitle text-mp-on-surface-variant truncate ${c}`,children:x}):null]}),e("span",{className:["text-mp-on-surface-variant flex h-[1lh] shrink-0 items-center","transition-[rotate] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard motion-reduce:transition-none","group-data-panel-open:rotate-180"].join(" "),children:e(a,{icon:r,size:l[M]})})]}),d(y)?e("span",{className:`flex shrink-0 items-center ${B}`,children:y}):null]}),e(i.Panel,{ref:S,className:[g,V?"data-open:overflow-visible":""].filter(Boolean).join(" "),onTransitionEnd:e=>{e.target===R.current&&"height"===e.propertyName&&F(R.current.hasAttribute("data-open"))},children:e("div",{className:["min-w-0",m[M],"text-mp-on-surface-variant",B,j[M]].join(" "),children:k})})]})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { MPColor, MPSize, MPVariant } from '../../types.js';
|
|
2
|
+
import type { MPColor, MPDensity, MPSize, MPTransition, MPVariant } from '../../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* How loudly an alert announces itself.
|
|
5
5
|
*
|
|
@@ -45,6 +45,16 @@ export interface MPAlertProps extends Omit<React.ComponentPropsWithoutRef<'div'>
|
|
|
45
45
|
* @default 'md'
|
|
46
46
|
*/
|
|
47
47
|
size?: MPSize;
|
|
48
|
+
/**
|
|
49
|
+
* Takes room out of the message without shrinking it.
|
|
50
|
+
*
|
|
51
|
+
* The step that matters on an alert is the first one. A page that shows
|
|
52
|
+
* several at once — a form reporting four invalid fields, a queue of
|
|
53
|
+
* warnings — stacks a lot of padding, and `-1` gives most of it back while
|
|
54
|
+
* leaving the text at the size a message has to be read at.
|
|
55
|
+
* @default 0
|
|
56
|
+
*/
|
|
57
|
+
density?: MPDensity;
|
|
48
58
|
/**
|
|
49
59
|
* The heading line. With it the alert is two-part — a headline and the detail
|
|
50
60
|
* under it; without it the whole thing is one line.
|
|
@@ -76,7 +86,19 @@ export interface MPAlertProps extends Omit<React.ComponentPropsWithoutRef<'div'>
|
|
|
76
86
|
* their own.
|
|
77
87
|
*/
|
|
78
88
|
live?: MPAlertLive;
|
|
79
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* Passing it is what makes the dismiss button appear.
|
|
91
|
+
*
|
|
92
|
+
* **It fires when the alert has finished leaving, not when the × is
|
|
93
|
+
* pressed.** An alert is in the flow of the page, so taking one out moves
|
|
94
|
+
* everything under it — and the caller owns the mount, which means an alert
|
|
95
|
+
* whose callback fired on the press had already been unmounted by the time
|
|
96
|
+
* there was anything to animate. So the press starts the exit and this is the
|
|
97
|
+
* end of it, roughly 200ms later, which is the moment `{open && <MPAlert/>}`
|
|
98
|
+
* wants to hear about.
|
|
99
|
+
*
|
|
100
|
+
* The event is the press that started it, held rather than re-created.
|
|
101
|
+
*/
|
|
80
102
|
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
81
103
|
/**
|
|
82
104
|
* The accessible name of the dismiss button. Defaults to the word for
|
|
@@ -90,6 +112,15 @@ export interface MPAlertProps extends Omit<React.ComponentPropsWithoutRef<'div'>
|
|
|
90
112
|
locale?: string;
|
|
91
113
|
/** The message. */
|
|
92
114
|
children?: React.ReactNode;
|
|
115
|
+
/**
|
|
116
|
+
* An entrance, run once as it mounts.
|
|
117
|
+
*
|
|
118
|
+
* `transition="fade"` is the whole of what most callers want; the object form
|
|
119
|
+
* takes a duration, an edge to come from, or a scale to start at. Anything
|
|
120
|
+
* that has to run again — on scroll, on hover, under your own control — is an
|
|
121
|
+
* [MPAnimateFade](../motion/animate-fade) and its siblings.
|
|
122
|
+
*/
|
|
123
|
+
transition?: MPTransition;
|
|
93
124
|
}
|
|
94
125
|
/**
|
|
95
126
|
* A message about something that happened, set into the page it is about.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{MPIcon as r}from"../icon/MPIcon.js";import{CloseIcon as
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{MPIcon as r}from"../icon/MPIcon.js";import{CloseIcon as i,ErrorIcon as o,InfoIcon as a}from"../../constants/icons.js";import{accentSlots as l}from"../../internal/accent.js";import{transitionProps as s}from"../../internal/transition.js";import{useMPLocale as c,useMPMessages as m}from"../../internal/locale.js";import{ALERT as d}from"../../internal/messages/alert.js";import{inertProps as p}from"../../internal/inert.js";import{MPStateLayer as f}from"../../internal/StateLayer.js";import{CONTROL_ICON as u,hasContent as x,PROSE_TEXT as v,SHEET_GAP as h,SHEET_TITLE as j,STACK_GAP as b}from"../../internal/scale.js";import{sheetPad as y}from"../../internal/density.js";import{useMPColor as g,useMPDensity as N,useMPSize as w}from"../../internal/config.js";const _={filled:"bg-(--_mp-accent) text-(--_mp-on-accent)",tonal:"bg-(--_mp-accent-container) text-(--_mp-on-accent-container)",elevated:"shadow-mp-1 bg-mp-surface-container-low text-mp-on-surface",outlined:"border-mp-outline border bg-transparent text-mp-on-surface",text:"bg-transparent text-mp-on-surface"},z={filled:"",tonal:"",elevated:"text-(--_mp-accent)",outlined:"text-(--_mp-accent)",text:"text-(--_mp-accent)"},k={filled:"",tonal:"",elevated:"text-mp-on-surface-variant",outlined:"text-mp-on-surface-variant",text:"text-mp-on-surface-variant"},C={primary:"polite",secondary:"polite",tertiary:"polite",error:"assertive"},B={assertive:"alert",polite:"status",off:void 0};export const MPAlert=/*@__PURE__*/n.forwardRef(function({variant:L="tonal",color:R,size:S,density:E,title:M,icon:P,action:T,live:A,onClose:D,closeLabel:F,locale:I,transition:$,className:q,style:G,children:H,...J},K){const O=s($),Q=g(R),U=w(S),V=N(E),W=c(I),X=m(d,W),[Y,Z]=n.useState(!1),ee=n.useRef(null),te=n.useRef(null),ne=n.useCallback(()=>{const e=ee.current;ee.current=null,e&&D?.(e)},[D]);n.useLayoutEffect(()=>{const e=te.current;Y&&e&&0===parseFloat(getComputedStyle(e).transitionDuration)&&ne()},[Y,ne]);const re=z[L],ie=x(M),oe=void 0===P?e(r,{icon:"error"===Q?o:a,size:u[U]}):P,ae=t("div",{ref:K,role:B[A??C[Q]],"data-mp-size":U,"data-mp-variant":L,...p(Y),className:["mp-alert rounded-mp-md flex w-full items-start","box-border",y(U,V),h[U],v[U],_[L],O.className,q??""].filter(Boolean).join(" "),style:{...l(Q),...O.style,...G},...J,children:[x(oe)?e("span",{className:["flex h-[1lh] shrink-0 items-center",re].filter(Boolean).join(" "),children:oe}):null,t("div",{className:`flex min-w-0 flex-1 flex-col ${b[U]}`,children:[ie?e("div",{className:[j[U],re].filter(Boolean).join(" "),children:M}):null,x(H)?e("div",{className:ie?k[L]:void 0,children:H}):null]}),x(T)?e("div",{className:"flex h-[1lh] shrink-0 items-center",children:T}):null,D?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:t("button",{type:"button","aria-label":F??X.dismiss,disabled:Y,onClick:e=>{ee.current=e,Z(!0)},className:["group rounded-mp-full relative -m-1 flex size-8 cursor-pointer items-center","justify-center bg-transparent text-inherit","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:outline-solid outline-none"].join(" "),children:[e(f,{}),e(r,{icon:i,size:u[U]})]})}):null]});return D?e("div",{ref:te,className:["mp-alert__reveal grid transition-[grid-template-rows,opacity]","duration-(--mp-sys-motion-duration-short4)","ease-(--mp-sys-motion-easing-emphasized-accelerate)","motion-reduce:transition-none",Y?"grid-rows-[0fr] opacity-0":"grid-rows-[1fr]"].join(" "),onTransitionEnd:e=>{Y&&"grid-template-rows"===e.propertyName&&e.target===e.currentTarget&&ne()},children:e("div",{className:"min-h-0 "+(Y?"overflow-hidden":""),children:ae})}):ae});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { MPColor, MPDensity, MPSize } from '../../types.js';
|
|
3
|
+
/** One heading in the list. */
|
|
4
|
+
export interface MPAnchorItem {
|
|
5
|
+
/**
|
|
6
|
+
* The fragment it points at — `#getting-started`. The `id` it names is what
|
|
7
|
+
* the list watches, so a heading with no `id` cannot be tracked.
|
|
8
|
+
*/
|
|
9
|
+
href: string;
|
|
10
|
+
/** What the row says. */
|
|
11
|
+
label: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* How deep the heading sits, counted from `0`.
|
|
14
|
+
*
|
|
15
|
+
* Only the indent depends on it. The list itself stays flat, because a nested
|
|
16
|
+
* `<ul>` inside a table of contents is announced as a list inside a list, and
|
|
17
|
+
* a reader who has just been told there are twelve headings does not need to
|
|
18
|
+
* be told again that four of them are their own list.
|
|
19
|
+
* @default 0
|
|
20
|
+
*/
|
|
21
|
+
depth?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface MPAnchorProps extends Omit<React.ComponentPropsWithoutRef<'nav'>, 'color' | 'children'> {
|
|
24
|
+
/** The headings, in the order they appear on the page. */
|
|
25
|
+
items: readonly MPAnchorItem[];
|
|
26
|
+
/**
|
|
27
|
+
* Which row is marked, by its `href`. Given, the list stops watching the
|
|
28
|
+
* scroll and says what it is told.
|
|
29
|
+
*/
|
|
30
|
+
activeHref?: string | null;
|
|
31
|
+
/** Called whenever the row the reader is in changes. */
|
|
32
|
+
onActiveChange?: (href: string | null) => void;
|
|
33
|
+
/**
|
|
34
|
+
* How far below the top of the scrollport a heading counts as reached, in
|
|
35
|
+
* pixels.
|
|
36
|
+
*
|
|
37
|
+
* Set it to the height of a sticky header, or the heading under the bar is
|
|
38
|
+
* never the one marked: it has scrolled past the top of the page and is still
|
|
39
|
+
* behind the header, so the reader is looking at the section before it.
|
|
40
|
+
* @default 0
|
|
41
|
+
*/
|
|
42
|
+
offset?: number;
|
|
43
|
+
/**
|
|
44
|
+
* What scrolls, when it is not the document. The element an `MPPageLayout`
|
|
45
|
+
* with `scroll="content"` puts the page inside, for instance.
|
|
46
|
+
*/
|
|
47
|
+
container?: React.RefObject<HTMLElement | null>;
|
|
48
|
+
/**
|
|
49
|
+
* Draws the rail down the leading edge, with the row the reader is in lit.
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
rail?: boolean;
|
|
53
|
+
/** The size of a row's text, and how far one level of heading is set in. */
|
|
54
|
+
size?: MPSize;
|
|
55
|
+
/** Which accent family the marked row reads. @default 'primary' */
|
|
56
|
+
color?: MPColor;
|
|
57
|
+
/** Tightens the rows and nothing else. @default 0 */
|
|
58
|
+
density?: MPDensity;
|
|
59
|
+
/**
|
|
60
|
+
* Which language the `<nav>` is named in. Falls back to the nearest
|
|
61
|
+
* `MPLocaleProvider`, then to English.
|
|
62
|
+
*/
|
|
63
|
+
locale?: string;
|
|
64
|
+
/** The accessible name of the `<nav>`. Defaults to the wording in `locale`. */
|
|
65
|
+
label?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The headings of the page being read, with the one the reader is in marked.
|
|
69
|
+
*
|
|
70
|
+
* ```tsx
|
|
71
|
+
* <MPAnchor
|
|
72
|
+
* items={[
|
|
73
|
+
* { href: '#install', label: 'Install' },
|
|
74
|
+
* { href: '#usage', label: 'Usage' },
|
|
75
|
+
* { href: '#options', label: 'Options', depth: 1 }
|
|
76
|
+
* ]}
|
|
77
|
+
* />
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* ## It is a `<nav>` of real links
|
|
81
|
+
*
|
|
82
|
+
* Which is what makes it work before any of the tracking runs: the rows jump to
|
|
83
|
+
* their headings with JavaScript turned off, they are in the link list a screen
|
|
84
|
+
* reader can pull up, and a middle-click opens one in a tab. Watching the scroll
|
|
85
|
+
* is added on top rather than being what holds it up.
|
|
86
|
+
*
|
|
87
|
+
* The marked row carries `aria-current="location"` rather than `"true"`. That
|
|
88
|
+
* value means "where the reader is within a set of links", which is exactly what
|
|
89
|
+
* a table of contents reports and is not what `"true"` — the current *page* —
|
|
90
|
+
* says.
|
|
91
|
+
*
|
|
92
|
+
* ## The headings are given, not scraped
|
|
93
|
+
*
|
|
94
|
+
* `items` is a list the caller already has. Whatever produced the page — an MDX
|
|
95
|
+
* pipeline, a CMS, a route's own frontmatter — knows its own headings and their
|
|
96
|
+
* ids, and a component that went looking for `<h2>`s in the document would be
|
|
97
|
+
* guessing at which of them were content and which were chrome.
|
|
98
|
+
*
|
|
99
|
+
* ## Nothing slides
|
|
100
|
+
*
|
|
101
|
+
* The rail's lit segment is a border on the row rather than a marker that
|
|
102
|
+
* travels between rows. A thing moving under a reader who is already moving is
|
|
103
|
+
* the one animation a table of contents should not have, and it is also the one
|
|
104
|
+
* that cannot be got right — the marker and the scroll are answering the same
|
|
105
|
+
* gesture at two different speeds.
|
|
106
|
+
*/
|
|
107
|
+
export declare const MPAnchor: React.ForwardRefExoticComponent<MPAnchorProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import*as n from"react";import{accentSlots as r}from"../../internal/accent.js";import{useMPLocale as t,useMPMessages as o}from"../../internal/locale.js";import{ANCHOR as i}from"../../internal/messages/anchor.js";import{CONTROL_TEXT as l}from"../../internal/scale.js";import{useMPColor as s,useMPDensity as a,useMPSize as c}from"../../internal/config.js";const m={xs:"py-1",sm:"py-1",md:"py-1.5",lg:"py-2",xl:"py-2.5"},p={xs:["py-0.5","py-0.5","py-0.5"],sm:["py-0.5","py-0.5","py-0.5"],md:["py-1","py-0.5","py-0.5"],lg:["py-1.5","py-1","py-0.5"],xl:["py-2","py-1.5","py-1"]};function u(e,n){return 0===n?m[e]:p[e][-n-1]}const d={xs:8,sm:10,md:12,lg:14,xl:16};export const MPAnchor=/*@__PURE__*/n.forwardRef(function({items:m,activeHref:p,onActiveChange:f,offset:h=0,container:y,rail:v=!0,size:g,color:x,density:b,locale:w,label:j,className:E,style:B,..._},H){const N=c(g),R=s(x),z=a(b),A=o(i,t(w)),[L,C]=n.useState(null),k=void 0!==p,F=k?p:L,I=n.useRef(f);I.current=f;const S=n.useRef(m);S.current=m;const q=m.map(e=>e.href).join(" ");return n.useEffect(()=>{if(k)return;const e=y?.current??window;let n=0,r=null;const t=()=>{n=0;const e=function(e,n,r){const t=(r?r.getBoundingClientRect().top:0)+n+1;let o=null;for(const n of e){const e=document.getElementById(n.href.replace(/^#/,""));e&&e.getBoundingClientRect().top<=t&&(o=n.href)}return(r?r.scrollTop+r.clientHeight>=r.scrollHeight-2:window.innerHeight+window.scrollY>=document.documentElement.scrollHeight-2)&&e.length>0?e[e.length-1].href:o}(S.current,h,y?.current??null);e!==r&&(r=e,C(e),I.current?.(e))},o=()=>{0===n&&(n=requestAnimationFrame(t))};return t(),e.addEventListener("scroll",o,{passive:!0}),window.addEventListener("resize",o,{passive:!0}),()=>{0!==n&&cancelAnimationFrame(n),e.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[q,h,y,k]),e("nav",{ref:H,"aria-label":j??A.label,"data-mp-size":N,className:["mp-anchor min-w-0",E??""].filter(Boolean).join(" "),style:{...r(R),...B},..._,children:e("ul",{className:["mp-anchor__list m-0 flex list-none flex-col p-0",v?"border-mp-outline-variant border-s":""].filter(Boolean).join(" "),children:m.map(n=>e("li",{className:v?"-ms-px":void 0,children:e("a",{href:n.href,"aria-current":F===n.href?"location":void 0,className:["mp-anchor__link block min-w-0 truncate no-underline","text-mp-on-surface-variant hover:text-mp-on-surface",l[N],u(N,z),"transition-[color,border-color] duration-(--mp-sys-motion-duration-short4)","ease-mp-standard motion-reduce:transition-none","aria-[current=location]:text-(--_mp-accent) aria-[current=location]:font-medium",v?"border-s border-transparent ps-3 aria-[current=location]:border-(--_mp-accent)":"","outline-mp-secondary focus-visible:outline-2 focus-visible:outline-offset-2","focus-visible:rounded-mp-xs focus-visible:outline-solid outline-none"].filter(Boolean).join(" "),style:{marginInlineStart:n.depth?n.depth*d[N]:void 0},children:n.label})},n.href))})})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPAnchor}from"./MPAnchor.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 { MPAnimateProps, MPSide } from '../../types.js';
|
|
4
|
-
export interface MPAnimateAppearProps extends MPAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { MPAnimateProps, MPAnimateTimelineProps, MPSide } from '../../types.js';
|
|
4
|
+
export interface MPAnimateAppearProps extends MPAnimateProps, MPAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* How long after one child the next one starts, in milliseconds. This is the
|
|
7
7
|
* whole effect — everything else is what a single child does.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import*as e from"react";import{useRender as a}from"@base-ui/react/use-render";import{ANIMATION_CLASS as r,ANIM_BASE as t,isInfinite as n,slideOffsets as i,staggerChildren as s,useAnimationRun as o}from"../../internal/animate.js";export const MPAnimateAppear=/*@__PURE__*/e.forwardRef(function({duration:e,delay:d=0,easing:m,repeat:p=1,alternate:l,paused:c,trigger:f="mount",play:g,once:u=!0,threshold:y=.2,stagger:h=80,from:v="bottom",distance:x="0.75rem",fade:b=!0,reverse:w=!1,timeline:A,range:N,render:$,className:j,style:M,children:P,...R},_){const k=o({trigger:f,play:g,once:u,threshold:y,paused:c,infinite:n(p)}),q="view"===A?c?"paused":"running":k.state,{x:z,y:B}=i(v,x),C=s(P,`${t} ${r.slide}`,{effect:"slide",duration:e,delay:d,easing:m,repeat:p,alternate:l,x:z,y:B,opacity:b?0:1,timeline:A,range:N},{stagger:h,reverse:w});return a({render:$,ref:[_,k.ref],props:{...R,className:j,style:{"--_mp-anim-state":q,...M},...k.handlers,"data-mp-animation":"appear","data-mp-state":q,children:C}})});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { MPAnimateProps } from '../../types.js';
|
|
4
|
-
export interface MPAnimateBlinkProps extends MPAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps } from '../../types.js';
|
|
4
|
+
export interface MPAnimateBlinkProps extends MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* How faint it gets at the bottom of the cycle, between `0` and `1`. Raise it
|
|
7
7
|
* for something that has to stay readable while it pulses.
|
|
@@ -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 n}from"../../internal/animate.js";export const MPAnimateBlink=/*@__PURE__*/e.forwardRef(function({duration:e,delay:a=0,easing:i,repeat:s="infinite",alternate:o,paused:l,trigger:d="mount",play:p,once:c=!0,threshold:m=.2,stagger:f=0,durationStep:g,reverse:u,timeline:h,range:y,min:N=0,render:b,className:j,style:k,children:v,...B},S){const w=n({effect:"blink",duration:e,delay:a,easing:i,repeat:s,alternate:o,opacity:N,trigger:d,play:p,once:c,threshold:m,paused:l,infinite:t(s),stagger:f,durationStep:g,reverse:u,timeline:h,range:y,children:v});return r({render:b,ref:[S,w.ref],props:{...B,className:[w.className,j].filter(Boolean).join(" "),style:{...w.style,...k},...w.props,children:w.children}})});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { MPAnimateProps, MPAnimateTimelineProps } from '../../types.js';
|
|
3
|
+
export interface MPAnimateCounterProps extends Omit<MPAnimateProps, 'alternate' | 'repeat'>, MPAnimateTimelineProps, Omit<React.ComponentPropsWithoutRef<'span'>, 'children'> {
|
|
4
|
+
/** The number it settles on. */
|
|
5
|
+
value: number;
|
|
6
|
+
/**
|
|
7
|
+
* Where it starts.
|
|
8
|
+
* @default 0
|
|
9
|
+
*/
|
|
10
|
+
from?: number;
|
|
11
|
+
/**
|
|
12
|
+
* How the number is written — anything `Intl.NumberFormat` takes, so a
|
|
13
|
+
* currency, a percentage or a compact notation is a prop rather than a
|
|
14
|
+
* template.
|
|
15
|
+
*
|
|
16
|
+
* Formatted rather than concatenated because the pieces of a number are not
|
|
17
|
+
* in the same order everywhere: `1 234,56 €` and `$1,234.56` are the same
|
|
18
|
+
* value, and a `prefix`/`suffix` pair can only write one of them.
|
|
19
|
+
*/
|
|
20
|
+
options?: Intl.NumberFormatOptions;
|
|
21
|
+
/**
|
|
22
|
+
* Which language it is written in. Falls back to the browser's own, which is
|
|
23
|
+
* what `Intl` does when nobody says.
|
|
24
|
+
*/
|
|
25
|
+
locale?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The whole formatter, for the numbers `Intl` has no option for — an ordinal,
|
|
28
|
+
* a score out of ten, a duration. Overrides `options` and `locale`.
|
|
29
|
+
*/
|
|
30
|
+
format?: (value: number) => string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A number counting up to its value.
|
|
34
|
+
*
|
|
35
|
+
* The one effect in this set that **cannot** be a keyframe on its own, because
|
|
36
|
+
* text is not an animatable property: every frame needs a fresh interpolation
|
|
37
|
+
* put through a formatter.
|
|
38
|
+
*
|
|
39
|
+
* ## It is still a CSS animation
|
|
40
|
+
*
|
|
41
|
+
* The obvious implementation is a `requestAnimationFrame` loop with its own
|
|
42
|
+
* clock, its own easing and its own idea of what *paused* means — three things
|
|
43
|
+
* that have to be kept in step with the rest of the library and will not be.
|
|
44
|
+
*
|
|
45
|
+
* So the animation here is a real one, over a registered custom property, and
|
|
46
|
+
* the frame loop does nothing but **read** it. `duration`, `delay`, the easing
|
|
47
|
+
* token, `trigger`, `paused`, `timeline="view"` and `prefers-reduced-motion`
|
|
48
|
+
* are then the same machinery every other effect uses rather than a second
|
|
49
|
+
* implementation of each. A counter waiting to be scrolled to shows `from`
|
|
50
|
+
* rather than the answer, for free: a paused animation with `fill-mode: both`
|
|
51
|
+
* is sitting on its own first frame.
|
|
52
|
+
*
|
|
53
|
+
* ## What a screen reader gets
|
|
54
|
+
*
|
|
55
|
+
* The final number, once, out of a clipped box — the counting copy is
|
|
56
|
+
* `aria-hidden`. A live count would be announced sixty times a second, and the
|
|
57
|
+
* one thing a reader wants from a statistic is the statistic.
|
|
58
|
+
*
|
|
59
|
+
* ## In a background tab
|
|
60
|
+
*
|
|
61
|
+
* `requestAnimationFrame` does not run in a tab nobody is looking at, so a
|
|
62
|
+
* counter left in the background sits at `from` and jumps to its value on
|
|
63
|
+
* return, having been "running" the whole time. That is correct — the reader
|
|
64
|
+
* sees the number they came back for — and it is worth knowing before it is
|
|
65
|
+
* reported as a bug.
|
|
66
|
+
*/
|
|
67
|
+
export declare const MPAnimateCounter: React.ForwardRefExoticComponent<MPAnimateCounterProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{useAnimateElement as n}from"../../internal/animate.js";import{VISUALLY_HIDDEN as a}from"../../internal/visually-hidden.js";export const MPAnimateCounter=/*@__PURE__*/r.forwardRef(function({value:s,from:i=0,options:o,locale:m,format:l,duration:u,delay:c=0,easing:f,paused:p,trigger:d="mount",play:y,once:g=!0,threshold:h=.2,timeline:N,range:F,className:j,style:A,...b},x){const q=n({effect:"count",effectClass:"mp-anim-count",duration:u,delay:c,easing:f,repeat:1,from:i,to:s,trigger:d,play:y,once:g,threshold:h,paused:p,infinite:!1,timeline:N,range:F}),v=r.useMemo(()=>{if(l)return l;const e=new Intl.NumberFormat(m,o);return t=>e.format(t)},[l,m,o]),w=r.useRef(null),[C,S]=r.useState(i);return r.useEffect(()=>{const e=w.current;if(!e||"undefined"==typeof requestAnimationFrame)return;let t=0,r=!0;const n=()=>{if(!r)return;const a=getComputedStyle(e).getPropertyValue("--mp-count"),s=Number.parseFloat(a);Number.isFinite(s)&&S(s);("view"===N||e.getAnimations().some(e=>"finished"!==e.playState))&&(t=requestAnimationFrame(n))};return t=requestAnimationFrame(n),()=>{r=!1,cancelAnimationFrame(t)}},[q.style,q.props["data-mp-state"],N]),t("span",{ref:e=>{w.current=e,q.ref(e),"function"==typeof x?x(e):x&&(x.current=e)},className:[q.className,j].filter(Boolean).join(" "),style:{...q.style,...A},...q.props,...b,children:[e("span",{className:a,children:v(s)}),e("span",{"aria-hidden":"true",className:"tabular-nums",children:v(C)})]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPAnimateCounter}from"./MPAnimateCounter.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 MPAnimateFadeProps extends MPAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { MPAnimateMode, MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps } from '../../types.js';
|
|
4
|
+
export interface MPAnimateFadeProps extends MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether the content arrives or leaves. An exit is quicker than an entrance
|
|
7
7
|
* — MD3's `short4` against `medium2` — unless `duration` says otherwise.
|
|
@@ -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 a,useAnimateElement as t}from"../../internal/animate.js";export const MPAnimateFade=/*@__PURE__*/e.forwardRef(function({duration:e,delay:n=0,easing:i,repeat:o=1,alternate:s,paused:l,trigger:d="mount",play:m,once:p=!0,threshold:c=.2,stagger:f=0,durationStep:g,reverse:u,timeline:h,range:y,mode:N="in",from:j=0,render:v,className:S,style:b,children:w,...x},A){const B=t({effect:"fade",duration:e,delay:n,easing:i,repeat:o,alternate:s,mode:N,opacity:j,trigger:d,play:m,once:p,threshold:c,paused:l,infinite:a(o),stagger:f,durationStep:g,reverse:u,timeline:h,range:y,children:w});return r({render:v,ref:[A,B.ref],props:{...x,className:[B.className,S].filter(Boolean).join(" "),style:{...B.style,...b},...B.props,children:B.children}})});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { MPAnimateProps, MPAnimateStaggerProps } from '../../types.js';
|
|
4
|
+
export interface MPAnimateFloatProps extends Omit<MPAnimateProps, 'alternate'>, MPAnimateStaggerProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
/**
|
|
6
|
+
* How far it rises at the top of the drift — a number in pixels, or any CSS
|
|
7
|
+
* length. Small on purpose: this says *not fixed down*, and anything a reader
|
|
8
|
+
* can measure says *moving* instead.
|
|
9
|
+
* @default '0.625rem'
|
|
10
|
+
*/
|
|
11
|
+
distance?: number | string;
|
|
12
|
+
/**
|
|
13
|
+
* How far it wanders to either side. Less than `distance`, so the path reads
|
|
14
|
+
* as a drift rather than as a circle.
|
|
15
|
+
* @default '0.375rem'
|
|
16
|
+
*/
|
|
17
|
+
sway?: number | string;
|
|
18
|
+
/**
|
|
19
|
+
* How far it leans at the extremes, in degrees. `0` by default — a tilt is
|
|
20
|
+
* the difference between something floating and something *tumbling*, and
|
|
21
|
+
* anything with text on it wants none of it.
|
|
22
|
+
* @default 0
|
|
23
|
+
*/
|
|
24
|
+
tilt?: number;
|
|
25
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
26
|
+
render?: useRender.RenderProp;
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* An endless, slow drift.
|
|
31
|
+
*
|
|
32
|
+
* The only thing in this set that says **not fixed to the page**. A card that
|
|
33
|
+
* drifts is a card that is above the sheet rather than printed on it, and no
|
|
34
|
+
* amount of shadow says that as plainly as half a centimetre of unhurried
|
|
35
|
+
* travel — a shadow is a claim about depth, and this is depth behaving.
|
|
36
|
+
*
|
|
37
|
+
* It has no arrival, which is what keeps it out of the shared effect table: the
|
|
38
|
+
* six entrances go from a state to the element's own, and this one goes nowhere
|
|
39
|
+
* and comes back. Its keyframe is its own.
|
|
40
|
+
*
|
|
41
|
+
* ## Never on a control
|
|
42
|
+
*
|
|
43
|
+
* A button that drifts cannot be pointed at. The pointer arrives where the
|
|
44
|
+
* button was, the button has moved four pixels, and the reader has to track a
|
|
45
|
+
* target that is running away from them — which is precisely the failure the
|
|
46
|
+
* library's rule against transforming controls exists to prevent. This is for
|
|
47
|
+
* decoration: an illustration, a hero graphic, a badge on a marketing page.
|
|
48
|
+
*
|
|
49
|
+
* It is also for one at a time. Six things drifting on their own cycles is a
|
|
50
|
+
* page that will not sit still to be read, and there is no way to look at any
|
|
51
|
+
* one of them.
|
|
52
|
+
*/
|
|
53
|
+
export declare const MPAnimateFloat: React.ForwardRefExoticComponent<MPAnimateFloatProps & 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 t,lengthValue as a,useAnimateElement as n}from"../../internal/animate.js";export const MPAnimateFloat=/*@__PURE__*/e.forwardRef(function({duration:e=6e3,delay:s=0,easing:i="standard",repeat:o="infinite",paused:l,trigger:d="mount",play:c,once:f=!0,threshold:p=.2,stagger:m=0,durationStep:g,reverse:u,distance:y="0.625rem",sway:h="0.375rem",tilt:N=0,render:j,className:v,style:w,children:x,...S},b){const A=n({effect:"float",effectClass:"mp-anim-float",duration:e,delay:s,easing:i,repeat:o,x:a(h),y:a(y),angle:`${N}deg`,trigger:d,play:c,once:f,threshold:p,paused:l,infinite:t(o),stagger:m,durationStep:g,reverse:u,children:x});return r({render:j,ref:[b,A.ref],props:{...S,className:[A.className,v].filter(Boolean).join(" "),style:{...A.style,...w},...A.props,children:A.children}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MPAnimateFloat}from"./MPAnimateFloat.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 MPAnimateGrowProps extends MPAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { MPAnimateMode, MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps } from '../../types.js';
|
|
4
|
+
export interface MPAnimateGrowProps extends MPAnimateProps, MPAnimateStaggerProps, MPAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether the content unfolds or folds 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 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";
|