material-plus-ui 1.5.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 +2 -1
- 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 +2 -1
- package/dist/components/avatar/MPAvatar.d.ts +10 -1
- package/dist/components/avatar/MPAvatar.js +1 -1
- package/dist/components/badge/MPBadge.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 +19 -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.d.ts +49 -3
- package/dist/components/button/MPButton.js +1 -1
- package/dist/components/calendar/MPCalendar.d.ts +160 -0
- package/dist/components/calendar/MPCalendar.js +2 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/card/MPCard.js +1 -1
- package/dist/components/carousel/MPCarousel.js +1 -1
- package/dist/components/chat-bubble/MPChatBubble.js +1 -1
- package/dist/components/checkbox/MPCheckbox.js +1 -1
- package/dist/components/chip/MPChip.d.ts +31 -7
- 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 +71 -5
- 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 +166 -0
- package/dist/components/config/MPConfigProvider.js +2 -0
- package/dist/components/config/index.d.ts +2 -0
- package/dist/components/config/index.js +1 -0
- package/dist/components/confirm/MPConfirmProvider.d.ts +143 -0
- package/dist/components/confirm/MPConfirmProvider.js +2 -0
- package/dist/components/confirm/index.d.ts +2 -0
- package/dist/components/confirm/index.js +1 -0
- 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/date-picker/MPDatePicker.d.ts +53 -2
- package/dist/components/date-picker/MPDatePicker.js +1 -1
- package/dist/components/date-picker/index.d.ts +1 -1
- package/dist/components/date-range-picker/MPDateRangePicker.js +1 -1
- package/dist/components/date-time-picker/MPDateTimePicker.js +1 -1
- package/dist/components/dialog/MPDialog.d.ts +24 -3
- package/dist/components/dialog/MPDialog.js +1 -1
- package/dist/components/divider/MPDivider.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 +23 -1
- 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 +121 -0
- package/dist/components/image/MPImage.js +2 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/image/index.js +1 -0
- 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 +51 -1
- package/dist/components/list/MPList.js +1 -1
- package/dist/components/menu/MPMenu.d.ts +21 -2
- 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.d.ts +3 -3
- package/dist/components/number-field/MPNumberField.js +1 -1
- package/dist/components/otp-field/MPOtpField.js +1 -1
- package/dist/components/overlay/MPOverlay.d.ts +1 -1
- package/dist/components/overlay/MPOverlay.js +1 -1
- package/dist/components/pagination/MPPagination.js +1 -1
- package/dist/components/panes/MPPanes.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 +92 -0
- package/dist/components/popconfirm/MPPopconfirm.js +2 -0
- package/dist/components/popconfirm/index.d.ts +2 -0
- package/dist/components/popconfirm/index.js +1 -0
- package/dist/components/popover/MPPopover.d.ts +1 -1
- 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/progress-box/MPProgressBox.js +1 -1
- package/dist/components/progress-circular/MPProgressCircular.js +1 -1
- package/dist/components/progress-linear/MPProgressLinear.js +1 -1
- 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 +28 -5
- package/dist/components/select/MPSelect.js +1 -1
- package/dist/components/shortcut/MPShortcut.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/skeleton/MPSkeleton.js +1 -1
- package/dist/components/slider/MPSlider.d.ts +27 -0
- package/dist/components/slider/MPSlider.js +1 -1
- package/dist/components/snackbar/MPSnackbar.d.ts +20 -1
- package/dist/components/snackbar/MPSnackbar.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.d.ts +153 -0
- package/dist/components/stepper/MPStepper.js +2 -0
- package/dist/components/stepper/index.d.ts +2 -0
- package/dist/components/stepper/index.js +1 -0
- package/dist/components/switch/MPSwitch.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/text-field/MPTextField.d.ts +38 -14
- package/dist/components/text-field/MPTextField.js +1 -1
- package/dist/components/time-picker/MPTimePicker.js +1 -1
- package/dist/components/timeline/MPTimeline.d.ts +10 -2
- 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/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 +17 -1
- package/dist/components/typography/MPTypography.js +1 -1
- package/dist/components/visually-hidden/MPVisuallyHidden.d.ts +60 -0
- package/dist/components/visually-hidden/MPVisuallyHidden.js +2 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/index.js +1 -0
- package/dist/constants/glyphs.d.ts +4 -0
- package/dist/constants/glyphs.js +1 -1
- package/dist/constants/icons.d.ts +2 -0
- package/dist/constants/icons.js +1 -1
- package/dist/hooks/index.d.ts +40 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useMPColorScheme.d.ts +135 -0
- package/dist/hooks/useMPColorScheme.js +2 -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.d.ts +32 -0
- package/dist/hooks/useMPReducedMotion.js +2 -0
- package/dist/hooks/useMPShortcut.d.ts +105 -0
- package/dist/hooks/useMPShortcut.js +2 -0
- package/dist/hooks/useMPWindowClass.d.ts +55 -0
- package/dist/hooks/useMPWindowClass.js +2 -0
- package/dist/index.d.ts +43 -1
- package/dist/index.js +1 -1
- package/dist/internal/Calendar.d.ts +19 -4
- 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/Picker.d.ts +15 -3
- package/dist/internal/Picker.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/color-scheme.d.ts +28 -0
- package/dist/internal/color-scheme.js +2 -0
- package/dist/internal/config.d.ts +62 -0
- package/dist/internal/config.js +2 -0
- package/dist/internal/data-table.d.ts +162 -0
- package/dist/internal/data-table.js +1 -0
- package/dist/internal/date.d.ts +50 -3
- 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 +196 -1
- 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/confirm.d.ts +3 -0
- package/dist/internal/messages/confirm.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/picker.js +1 -1
- 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/progress.d.ts +14 -0
- 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 +86 -0
- package/dist/internal/step.js +1 -0
- 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 +48 -0
- package/dist/internal/window-class.js +2 -0
- 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 +2 -0
- 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 +2 -0
- package/dist/styles/confirm.css +2 -0
- 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 +2 -0
- 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/panes.css +1 -1
- package/dist/styles/pie-chart.css +2 -0
- package/dist/styles/pill.css +1 -1
- package/dist/styles/popconfirm.css +2 -0
- 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/shortcut.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 +2 -0
- 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/visually-hidden.css +2 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1423 -114
- package/dist/types.d.ts +628 -3
- package/package.json +8 -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
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The values an animation comes to, and nothing that runs one.
|
|
3
|
+
*
|
|
4
|
+
* Split from `animate.ts` for the reason `density.ts` is split from `scale.ts`,
|
|
5
|
+
* with a sharper edge: the split stylesheet is cut along the import graph a file
|
|
6
|
+
* at a time, and `animate.ts` names the marquee's own class in a query selector.
|
|
7
|
+
* A component reaching in here for a single entrance was coming out with the
|
|
8
|
+
* marquee's rules and its two keyframes attached.
|
|
9
|
+
*
|
|
10
|
+
* Which is also a rule about writing in this file. A hand-written rule is
|
|
11
|
+
* attributed by looking for its class names in a component's files, and a
|
|
12
|
+
* comment is one of those files — so naming another component's class here, even
|
|
13
|
+
* in prose, would put that component's CSS into every sheet this module reaches.
|
|
14
|
+
*
|
|
15
|
+
* So this half is the tables and the arithmetic — what a duration, a curve, a
|
|
16
|
+
* repeat and an offset resolve to — and the other half is the machinery that
|
|
17
|
+
* watches a trigger and drives them. `transition.ts` reads this one; the
|
|
18
|
+
* `MPAnimate*` components read both, through the re-export next door.
|
|
19
|
+
*/
|
|
20
|
+
import * as React from 'react';
|
|
21
|
+
import type { MPAnimateMode, MPAnimateRepeat, MPAnimateTimeline, MPAnimation, MPEasing, MPSide } from '../types.js';
|
|
22
|
+
/** The class that reads the slots. Always paired with one of the below. */
|
|
23
|
+
export declare const ANIM_BASE = "mp-anim";
|
|
24
|
+
/**
|
|
25
|
+
* Which keyframe an effect runs.
|
|
26
|
+
*
|
|
27
|
+
* `grow` and `zoom` share one: they are the same arithmetic at two strengths,
|
|
28
|
+
* and a second identical `@keyframes` would only be a second place to fix a
|
|
29
|
+
* bug. What separates them is their defaults and their origin, which is a
|
|
30
|
+
* property rather than a keyframe.
|
|
31
|
+
*/
|
|
32
|
+
export declare const ANIMATION_CLASS: Record<MPAnimation, string>;
|
|
33
|
+
/**
|
|
34
|
+
* The name an effect goes by, which is wider than the shared union.
|
|
35
|
+
*
|
|
36
|
+
* `float` and `shake` are not entrances and are not in `MPAnimation` — see
|
|
37
|
+
* `effectClass` below for why a shared lookup table is a thing to keep small.
|
|
38
|
+
* They still need a *name*, because `data-mp-animation` is how a test and a
|
|
39
|
+
* page's own CSS find one, and because the tables above are read by name.
|
|
40
|
+
*
|
|
41
|
+
* Neither of them reads those tables: an effect that brings its own keyframe
|
|
42
|
+
* brings its own duration and curve with it, since a six-second drift and a
|
|
43
|
+
* four-hundred-millisecond refusal are not on any Material ladder. The
|
|
44
|
+
* fallbacks in the two lookups below exist so the types do not have to lie
|
|
45
|
+
* about that, not because anything relies on them.
|
|
46
|
+
*/
|
|
47
|
+
export type AnimationEffect = MPAnimation | 'float' | 'shake' | 'count';
|
|
48
|
+
/** A curve, as the stylesheet spells it. */
|
|
49
|
+
export declare function easingValue(easing: MPEasing): string;
|
|
50
|
+
/** A number is pixels; a string is already a CSS length. */
|
|
51
|
+
export declare function lengthValue(value: number | string): string;
|
|
52
|
+
/** `'infinite'` reaches CSS as the word; a count reaches it as the number. */
|
|
53
|
+
export declare function repeatValue(repeat: MPAnimateRepeat): string;
|
|
54
|
+
export declare function isInfinite(repeat: MPAnimateRepeat | undefined): boolean;
|
|
55
|
+
export interface AnimationSlotOptions {
|
|
56
|
+
/** Which effect's tokens to fall back to, and which keyframe to run. */
|
|
57
|
+
effect: AnimationEffect;
|
|
58
|
+
/** Milliseconds. Unset takes the effect's Material duration token. */
|
|
59
|
+
duration?: number;
|
|
60
|
+
/** Milliseconds. */
|
|
61
|
+
delay: number;
|
|
62
|
+
/** Unset takes the effect's Material easing token. */
|
|
63
|
+
easing?: MPEasing;
|
|
64
|
+
repeat: MPAnimateRepeat;
|
|
65
|
+
alternate?: boolean;
|
|
66
|
+
mode?: MPAnimateMode;
|
|
67
|
+
/** Milliseconds added to the duration, clamped at zero. See `durationValue`. */
|
|
68
|
+
durationOffset?: number;
|
|
69
|
+
/** `view` hands the animation to the reader's scrolling instead of a clock. */
|
|
70
|
+
timeline?: MPAnimateTimeline;
|
|
71
|
+
/** Any CSS `animation-range`. Only read on `timeline: 'view'`. */
|
|
72
|
+
range?: string;
|
|
73
|
+
/** Where the animated properties start. Only the ones an effect reads. */
|
|
74
|
+
opacity?: number;
|
|
75
|
+
scale?: number;
|
|
76
|
+
x?: string;
|
|
77
|
+
y?: string;
|
|
78
|
+
angle?: string;
|
|
79
|
+
angleTo?: string;
|
|
80
|
+
clip?: string;
|
|
81
|
+
/** The two ends of a counted value. Only `MPAnimateCounter` fills these. */
|
|
82
|
+
from?: number;
|
|
83
|
+
to?: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The `--_mp-anim-*` slots, as an inline style object.
|
|
87
|
+
*
|
|
88
|
+
* Inline rather than utilities for the reason the accent slots are: these are
|
|
89
|
+
* per-instance numbers, and Tailwind cannot generate a class for a duration it
|
|
90
|
+
* has never seen written down.
|
|
91
|
+
*/
|
|
92
|
+
export declare function animationSlots(options: AnimationSlotOptions): React.CSSProperties;
|
|
93
|
+
/**
|
|
94
|
+
* Which way a slide starts, given the edge it comes from.
|
|
95
|
+
*
|
|
96
|
+
* `MPSide` is physical everywhere in this library, and it stays physical here:
|
|
97
|
+
* something sliding in from the top of the window comes from the top in every
|
|
98
|
+
* writing direction.
|
|
99
|
+
*/
|
|
100
|
+
export declare function slideOffsets(from: MPSide, distance: number | string): {
|
|
101
|
+
x: string;
|
|
102
|
+
y: string;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* The `inset()` a wipe starts from, given the edge it opens at.
|
|
106
|
+
*
|
|
107
|
+
* A reveal is one rectangle shrinking to nothing: `inset(0 100% 0 0)` is the
|
|
108
|
+
* whole element clipped away from the right, so the content is disclosed
|
|
109
|
+
* left-to-right as the inset returns to `inset(0)`. Naming the *edge it opens
|
|
110
|
+
* at* rather than the direction it travels is the same choice `MPAnimateSlide`
|
|
111
|
+
* makes, and for the same reason — a caller is pointing at a place.
|
|
112
|
+
*
|
|
113
|
+
* `inset(0)` is the to-state and needs no slot, which is the argument for a
|
|
114
|
+
* clip-path over a mask: "nothing is clipped" already has a spelling, where a
|
|
115
|
+
* gradient mask would need a second gradient per direction to say it.
|
|
116
|
+
*
|
|
117
|
+
* Physical, like `MPSide` everywhere else here. A title disclosed from the left
|
|
118
|
+
* of its box is disclosed from the left in every writing direction; what changes
|
|
119
|
+
* under RTL is which edge a caller names, and that is theirs to decide.
|
|
120
|
+
*/
|
|
121
|
+
export declare function revealClip(from: MPSide): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ANIM_BASE="mp-anim";export const ANIMATION_CLASS={fade:"mp-anim-fade",grow:"mp-anim-scale",slide:"mp-anim-slide",zoom:"mp-anim-scale",rotate:"mp-anim-rotate",blink:"mp-anim-blink",reveal:"mp-anim-reveal"};const e={fade:{in:"medium2",out:"short4"},grow:{in:"medium4",out:"short4"},slide:{in:"medium4",out:"short4"},zoom:{in:"medium4",out:"short4"},rotate:{in:"long2",out:"medium2"},blink:{in:"extra-long4",out:"extra-long4"},reveal:{in:"medium4",out:"short4"}},t={fade:"emphasized-decelerate",grow:"emphasized-decelerate",slide:"emphasized-decelerate",zoom:"emphasized-decelerate",rotate:"emphasized-decelerate",blink:"standard",reveal:"emphasized-decelerate"};export function easingValue(e){return`var(--mp-sys-motion-easing-${e})`}function n(t,n,i="in",a=0){const r=void 0!==t?`${t}ms`:`var(--mp-sys-motion-duration-${(e[n]??e.fade)[i]})`;return 0===a?r:void 0!==t?`${Math.max(0,t+a)}ms`:`max(0ms, calc(${r} + ${a}ms))`}export function lengthValue(e){return"number"==typeof e?`${e}px`:e}export function repeatValue(e){return"infinite"===e?"infinite":String(e)}export function isInfinite(e){return"infinite"===e}function i(e,t){return"out"===e?t?"alternate-reverse":"reverse":t?"alternate":"normal"}export function animationSlots(e){const a=e.mode??"in",r={"--_mp-anim-duration":n(e.duration,e.effect,a,e.durationOffset),"--_mp-anim-delay":`${e.delay}ms`,"--_mp-anim-ease":easingValue(e.easing??t[e.effect]??t.fade),"--_mp-anim-repeat":repeatValue(e.repeat),"--_mp-anim-direction":i(a,e.alternate)};return"view"===e.timeline&&(r["--_mp-anim-timeline"]="view()",r["--_mp-anim-range"]=e.range??"entry 0% cover 45%"),void 0!==e.opacity&&(r["--_mp-anim-opacity"]=String(e.opacity)),void 0!==e.scale&&(r["--_mp-anim-scale"]=String(e.scale)),void 0!==e.x&&(r["--_mp-anim-x"]=e.x),void 0!==e.y&&(r["--_mp-anim-y"]=e.y),void 0!==e.angle&&(r["--_mp-anim-angle"]=e.angle),void 0!==e.angleTo&&(r["--_mp-anim-angle-to"]=e.angleTo),void 0!==e.clip&&(r["--_mp-anim-clip"]=e.clip),void 0!==e.from&&(r["--_mp-anim-from"]=String(e.from)),void 0!==e.to&&(r["--_mp-anim-to"]=String(e.to)),r}export function slideOffsets(e,t){const n=lengthValue(t),i="number"==typeof t?-t+"px":`calc(-1 * ${n})`;switch(e){case"top":return{x:"0px",y:i};case"bottom":return{x:"0px",y:n};case"left":return{x:i,y:"0px"};default:return{x:n,y:"0px"}}}export function revealClip(e){switch(e){case"top":return"inset(0 0 100% 0)";case"bottom":return"inset(100% 0 0 0)";case"right":return"inset(0 0 0 100%)";default:return"inset(0 100% 0 0)"}}
|
|
@@ -30,72 +30,66 @@
|
|
|
30
30
|
* this library: the value a caller does not name is the *token*, so a theme can
|
|
31
31
|
* still reach it.
|
|
32
32
|
*
|
|
33
|
+
* ## One effect, or one effect per child
|
|
34
|
+
*
|
|
35
|
+
* `stagger` is the same six effects written onto the children instead of onto
|
|
36
|
+
* the box, and it is three props rather than an `MPAnimateStagger` component:
|
|
37
|
+
* a list settling in is not a different effect from a fade, it is the same fade
|
|
38
|
+
* told when to start. The per-child half is `staggerChildren`, which
|
|
39
|
+
* `MPAnimateAppear` was built out of first and now shares — two copies would be
|
|
40
|
+
* two answers to which child is the third one.
|
|
41
|
+
*
|
|
33
42
|
* ## What is deliberately not here
|
|
34
43
|
*
|
|
35
44
|
* An animation that has to know what its children *are* — a marquee that
|
|
36
45
|
* duplicates them, a headline that swaps between them, a typewriter that counts
|
|
37
46
|
* characters — cannot be a class name and a few numbers. Those are components,
|
|
38
|
-
* and their logic stays in their own files.
|
|
47
|
+
* and their logic stays in their own files. They are also the ones that cannot
|
|
48
|
+
* take a `stagger`, and for the same reason.
|
|
39
49
|
*/
|
|
50
|
+
import { ANIM_BASE, ANIMATION_CLASS, animationSlots, easingValue, isInfinite, lengthValue, repeatValue, revealClip, slideOffsets, type AnimationEffect, type AnimationSlotOptions } from './animate-core.js';
|
|
51
|
+
export { ANIM_BASE, ANIMATION_CLASS, animationSlots, easingValue, isInfinite, lengthValue, repeatValue, revealClip, slideOffsets };
|
|
52
|
+
export type { AnimationEffect, AnimationSlotOptions };
|
|
40
53
|
import * as React from 'react';
|
|
41
|
-
import type {
|
|
42
|
-
/**
|
|
43
|
-
export
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*/
|
|
52
|
-
|
|
53
|
-
/** A curve, as the stylesheet spells it. */
|
|
54
|
-
export declare function easingValue(easing: MPEasing): string;
|
|
55
|
-
/** A number is pixels; a string is already a CSS length. */
|
|
56
|
-
export declare function lengthValue(value: number | string): string;
|
|
57
|
-
/** `'infinite'` reaches CSS as the word; a count reaches it as the number. */
|
|
58
|
-
export declare function repeatValue(repeat: MPAnimateRepeat): string;
|
|
59
|
-
export declare function isInfinite(repeat: MPAnimateRepeat | undefined): boolean;
|
|
60
|
-
export interface AnimationSlotOptions {
|
|
61
|
-
/** Which effect's tokens to fall back to, and which keyframe to run. */
|
|
62
|
-
effect: MPAnimation;
|
|
63
|
-
/** Milliseconds. Unset takes the effect's Material duration token. */
|
|
64
|
-
duration?: number;
|
|
65
|
-
/** Milliseconds. */
|
|
66
|
-
delay: number;
|
|
67
|
-
/** Unset takes the effect's Material easing token. */
|
|
68
|
-
easing?: MPEasing;
|
|
69
|
-
repeat: MPAnimateRepeat;
|
|
70
|
-
alternate?: boolean;
|
|
71
|
-
mode?: MPAnimateMode;
|
|
72
|
-
/** Where the animated properties start. Only the ones an effect reads. */
|
|
73
|
-
opacity?: number;
|
|
74
|
-
scale?: number;
|
|
75
|
-
x?: string;
|
|
76
|
-
y?: string;
|
|
77
|
-
angle?: string;
|
|
78
|
-
angleTo?: string;
|
|
54
|
+
import type { MPAnimateTrigger } from '../types.js';
|
|
55
|
+
/** What differs between one child and the next. */
|
|
56
|
+
export interface StaggerOptions {
|
|
57
|
+
/**
|
|
58
|
+
* Milliseconds added to each child's delay. The whole of the effect: at 0
|
|
59
|
+
* there is nothing per-child to do and the box animates instead.
|
|
60
|
+
*/
|
|
61
|
+
stagger: number;
|
|
62
|
+
/** Milliseconds added to each child's duration. Negative is allowed. */
|
|
63
|
+
durationStep?: number;
|
|
64
|
+
/** Runs the set from the last child to the first. */
|
|
65
|
+
reverse?: boolean;
|
|
79
66
|
}
|
|
80
67
|
/**
|
|
81
|
-
* The
|
|
68
|
+
* The same animation on every child, held back by its position.
|
|
82
69
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
*
|
|
70
|
+
* One implementation for all of it. `MPAnimateAppear` had this and the six
|
|
71
|
+
* single-keyframe effects did not, and writing it a second time would have left
|
|
72
|
+
* the library with two answers to "which child is the third one" — which is the
|
|
73
|
+
* kind of disagreement nobody finds until a list is reversed inside a fragment.
|
|
74
|
+
*
|
|
75
|
+
* ## The animation goes on the children, not on wrappers
|
|
76
|
+
*
|
|
77
|
+
* A row of `<li>`s stays a row of `<li>`s and a grid's cells stay its direct
|
|
78
|
+
* children, so nothing about the layout changes because the set is being
|
|
79
|
+
* animated. The cost is real and worth naming: a child has to accept
|
|
80
|
+
* `className` and `style`, which every host element and every component in this
|
|
81
|
+
* library does, and a caller's own component need not. Only a bare string has
|
|
82
|
+
* no element to write onto, and that one is wrapped in a `<span>`.
|
|
83
|
+
*
|
|
84
|
+
* ## The step is per child, which makes the grouping the caller's dial
|
|
85
|
+
*
|
|
86
|
+
* Eight children are eight steps and one child holding eight things is one
|
|
87
|
+
* step. That is also how to opt part of a set out of the sequence — group it.
|
|
90
88
|
*
|
|
91
|
-
* `
|
|
92
|
-
*
|
|
93
|
-
* writing direction.
|
|
89
|
+
* The caller's own `style` wins over the slots, deliberately: the slots are
|
|
90
|
+
* this library's answer and the attribute is the caller's.
|
|
94
91
|
*/
|
|
95
|
-
export declare function
|
|
96
|
-
x: string;
|
|
97
|
-
y: string;
|
|
98
|
-
};
|
|
92
|
+
export declare function staggerChildren(children: React.ReactNode, className: string, slots: AnimationSlotOptions, { stagger, durationStep, reverse }: StaggerOptions): React.ReactNode[];
|
|
99
93
|
export declare function usePrefersReducedMotion(): boolean;
|
|
100
94
|
export interface AnimationRunOptions {
|
|
101
95
|
trigger: MPAnimateTrigger;
|
|
@@ -136,7 +130,31 @@ export interface AnimationRun {
|
|
|
136
130
|
* and leaves everything inside it alone.
|
|
137
131
|
*/
|
|
138
132
|
export declare function useAnimationRun({ trigger, play, once, threshold, paused, infinite }: AnimationRunOptions): AnimationRun;
|
|
139
|
-
export interface AnimateElementParams extends AnimationSlotOptions, AnimationRunOptions {
|
|
133
|
+
export interface AnimateElementParams extends AnimationSlotOptions, AnimationRunOptions, Partial<StaggerOptions> {
|
|
134
|
+
/**
|
|
135
|
+
* A keyframe class the effect brings itself, instead of the one its `effect`
|
|
136
|
+
* names.
|
|
137
|
+
*
|
|
138
|
+
* `MPAnimation` and the three tables behind it are what everything with an
|
|
139
|
+
* entrance shares, and a shared lookup table is a tax on everything that
|
|
140
|
+
* imports it: a `Record<Effect, string>` is not tree-shaken key by key, so
|
|
141
|
+
* every component reading one pays for the rows it will never use. The
|
|
142
|
+
* question to ask before adding a value is whether a component that will
|
|
143
|
+
* never use it has any business paying for it.
|
|
144
|
+
*
|
|
145
|
+
* `float` and `shake` do not: neither is an arrival. A drift with no
|
|
146
|
+
* destination and a four-hundred-millisecond answer to a rejection have
|
|
147
|
+
* nothing in common with a fade beyond the machinery below, so they keep
|
|
148
|
+
* their keyframes in their own files and borrow everything else — the
|
|
149
|
+
* trigger, the rewind, the slots, the stagger.
|
|
150
|
+
*
|
|
151
|
+
* `effect` is still named, because the durations and the curves are per
|
|
152
|
+
* effect and the data attribute is how a test finds one. What this replaces
|
|
153
|
+
* is only which `@keyframes` runs.
|
|
154
|
+
*/
|
|
155
|
+
effectClass?: string;
|
|
156
|
+
/** Only read when the effect is being spread across them. */
|
|
157
|
+
children?: React.ReactNode;
|
|
140
158
|
}
|
|
141
159
|
export interface AnimateElement {
|
|
142
160
|
ref: React.RefCallback<HTMLElement>;
|
|
@@ -144,6 +162,8 @@ export interface AnimateElement {
|
|
|
144
162
|
style: React.CSSProperties;
|
|
145
163
|
/** The hover handlers and the two data attributes, ready to be spread. */
|
|
146
164
|
props: React.HTMLAttributes<HTMLElement> & Record<string, unknown>;
|
|
165
|
+
/** The children, wrapped when there is a `stagger` and untouched otherwise. */
|
|
166
|
+
children: React.ReactNode;
|
|
147
167
|
}
|
|
148
168
|
/**
|
|
149
169
|
* Everything an `MPAnimate*` root needs, in one call.
|
package/dist/internal/animate.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import{ANIM_BASE as e,ANIMATION_CLASS as t,animationSlots as n,easingValue as r,isInfinite as a,lengthValue as s,repeatValue as o,revealClip as i,slideOffsets as c}from"./animate-core.js";export{e as ANIM_BASE,t as ANIMATION_CLASS,n as animationSlots,r as easingValue,a as isInfinite,s as lengthValue,o as repeatValue,i as revealClip,c as slideOffsets};import*as u from"react";export function staggerChildren(e,t,r,{stagger:a,durationStep:s=0,reverse:o=!1}){const i=u.Children.toArray(e);return i.map((e,c)=>{const d=o?i.length-1-c:c,f=n({...r,delay:r.delay+d*a,durationOffset:(r.durationOffset??0)+d*s});if(!u.isValidElement(e))return u.createElement("span",{key:c,className:t,style:f},e);const l=e.props;return u.cloneElement(e,{className:[t,l.className].filter(Boolean).join(" "),style:{...f,...l.style}})})}const d="(prefers-reduced-motion: reduce)";function f(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const t=window.matchMedia(d);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function l(){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(d).matches}function m(){return!1}export function usePrefersReducedMotion(){return u.useSyncExternalStore(f,l,m)}export function useAnimationRun({trigger:e,play:t,once:n,threshold:r,paused:a,infinite:s}){const o=u.useRef(null),[i,c]=u.useState("mount"===e),[d,f]=u.useState(0),l=u.useCallback(()=>{c(!0),f(e=>e+1)},[]);u.useLayoutEffect(()=>{const e=o.current;if(!e||0===d)return;const t=[e,...e.querySelectorAll(".mp-anim, .mp-marquee-track")];for(const e of t)e.style.animationName="none";e.offsetWidth;for(const e of t)e.style.animationName=""},[d]),u.useEffect(()=>{if("visible"!==e)return;const t=o.current;if(!t||"undefined"==typeof IntersectionObserver)return void c(!0);const a=new IntersectionObserver(([e])=>{e.isIntersecting?(l(),n&&a.disconnect()):n||c(!1)},{threshold:r});return a.observe(t),()=>a.disconnect()},[e,n,r,l]),u.useEffect(()=>{"manual"===e&&(t?l():c(!1))},[e,t,l]);const m=u.useCallback(()=>{s&&c(!1)},[s]),p="hover"===e?{onPointerEnter:l,onFocus:l,onPointerLeave:m,onBlur:m}:{};return{ref:u.useCallback(e=>{o.current=e},[]),state:i&&!a?"running":"paused",started:i,handlers:p}}export function useAnimateElement(r){const{trigger:a,play:s,once:o,threshold:i,paused:c,infinite:u,stagger:d=0,durationStep:f,reverse:l,effectClass:m,children:p,...h}=r,g=useAnimationRun({trigger:a,play:s,once:o,threshold:i,paused:c,infinite:u}),y=`${e} ${m??t[h.effect]}`,v=function(e,t,n){return"view"!==t?e:n?"paused":"running"}(g.state,h.timeline,c);return d>0?{ref:g.ref,className:"",style:{"--_mp-anim-state":v},props:{...g.handlers,"data-mp-animation":h.effect,"data-mp-state":v},children:staggerChildren(p,y,h,{stagger:d,durationStep:f,reverse:l})}:{ref:g.ref,className:y,style:{...n(h),"--_mp-anim-state":v},props:{...g.handlers,"data-mp-animation":h.effect,"data-mp-state":v},children:p}}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the two navigation bars share, which is everything except the sheet.
|
|
3
|
+
*
|
|
4
|
+
* `MPBottomNavigation` is the bar held against the bottom edge of the window;
|
|
5
|
+
* `MPFloatingBottomNavigation` is the same row of destinations lifted clear of
|
|
6
|
+
* it. They differ in shape, in where they sit and in how wide they are — and in
|
|
7
|
+
* nothing a destination can see. So the context an `MPBottomNavigationItem`
|
|
8
|
+
* reads lives here rather than inside either of them, and an item works in
|
|
9
|
+
* both without knowing which it is in.
|
|
10
|
+
*
|
|
11
|
+
* A file of its own rather than one bar importing the other, because that
|
|
12
|
+
* import would run the wrong way: an item belongs to whichever bar it was put
|
|
13
|
+
* in, and a floating bar that had to pull in the full-width bar's height table
|
|
14
|
+
* and position map to reach a context would carry both sheets' CSS into every
|
|
15
|
+
* page that rendered either.
|
|
16
|
+
*
|
|
17
|
+
* There are no class strings in here, which is why it costs nothing to be
|
|
18
|
+
* shared — see the note at the top of `internal/density.ts` for what happens
|
|
19
|
+
* when there are.
|
|
20
|
+
*/
|
|
21
|
+
import * as React from 'react';
|
|
22
|
+
import type { MPSize } from '../types.js';
|
|
23
|
+
/** A destination's value. The same restraint `MPTabs` puts on a tab's. */
|
|
24
|
+
export type MPBottomNavigationValue = string | number;
|
|
25
|
+
/**
|
|
26
|
+
* Which names are drawn.
|
|
27
|
+
*
|
|
28
|
+
* MD3's three label behaviours, and the order they lose information in:
|
|
29
|
+
*
|
|
30
|
+
* - `all` — every destination is named. The only one that works for a reader
|
|
31
|
+
* who has not used the application before.
|
|
32
|
+
* - `selected` — only the destination the reader is on.
|
|
33
|
+
* - `none` — glyphs only.
|
|
34
|
+
*
|
|
35
|
+
* Undrawn is never unsaid: in both of the last two the names stay in the
|
|
36
|
+
* document for a screen reader, because a glyph on its own has no accessible
|
|
37
|
+
* name at all.
|
|
38
|
+
*/
|
|
39
|
+
export type MPBottomNavigationLabels = 'all' | 'selected' | 'none';
|
|
40
|
+
/** What an `MPBottomNavigationItem` inherits from whichever bar it is in. */
|
|
41
|
+
export interface MPBottomNavigationContextValue {
|
|
42
|
+
value: MPBottomNavigationValue | null;
|
|
43
|
+
change: (value: MPBottomNavigationValue) => void;
|
|
44
|
+
size: MPSize;
|
|
45
|
+
labels: MPBottomNavigationLabels;
|
|
46
|
+
disabled: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the bar is the floating one.
|
|
49
|
+
*
|
|
50
|
+
* The one thing a destination does need to know, and it is about width rather
|
|
51
|
+
* than about looks: a full-width bar divides its own width between its
|
|
52
|
+
* destinations, so each is `flex-1`; a floating one is only as wide as what is
|
|
53
|
+
* in it, so each is as wide as its own contents. Stretched inside a lozenge
|
|
54
|
+
* they would each take a fifth of nothing.
|
|
55
|
+
*/
|
|
56
|
+
floating: boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare const MPBottomNavigationContext: React.Context<MPBottomNavigationContextValue>;
|