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
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arithmetic an `MPDataTable` is made of.
|
|
3
|
+
*
|
|
4
|
+
* Here rather than in the component for the reason `internal/mockup.tsx` gives:
|
|
5
|
+
* a component whose interesting fifty lines are buried in machinery is a
|
|
6
|
+
* component nobody can read. Ranking two rows, cutting a page out of a list,
|
|
7
|
+
* working out which rows a Shift-click covers and escaping a comma so a
|
|
8
|
+
* spreadsheet does not shift a column are four questions with plain answers, and
|
|
9
|
+
* a file that also has to draw a resize handle is not where they can be found.
|
|
10
|
+
*
|
|
11
|
+
* There is no React in this file and nothing in it knows what a column is.
|
|
12
|
+
* Everything takes plain values and returns plain values, which is also what
|
|
13
|
+
* makes it the half of the component that can be tested without a browser.
|
|
14
|
+
*/
|
|
15
|
+
/** Which way a column runs when it is sorted. */
|
|
16
|
+
export type MPSortDirection = 'asc' | 'desc';
|
|
17
|
+
/** One key of the sort, and its direction. A sort is a list of these. */
|
|
18
|
+
export interface MPDataTableSort {
|
|
19
|
+
/** The column's `key`. */
|
|
20
|
+
key: string;
|
|
21
|
+
direction: MPSortDirection;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The default comparison, for the columns that do not bring one.
|
|
25
|
+
*
|
|
26
|
+
* Empty sorts last in **both** directions, which is the one asymmetry here and
|
|
27
|
+
* the one every spreadsheet has: a blank is not the smallest value, it is the
|
|
28
|
+
* absence of one, and a descending sort whose first screen is forty blanks has
|
|
29
|
+
* answered a question nobody asked.
|
|
30
|
+
*
|
|
31
|
+
* Numbers compare as numbers, dates as instants, booleans with `false` first,
|
|
32
|
+
* and everything else through the collator — which is `numeric`, so `item2`
|
|
33
|
+
* comes before `item10` rather than after it.
|
|
34
|
+
*/
|
|
35
|
+
export declare function compareValues(a: unknown, b: unknown, collator: Intl.Collator, descending?: boolean): number;
|
|
36
|
+
/**
|
|
37
|
+
* Sorts by every key at once, the first key outermost.
|
|
38
|
+
*
|
|
39
|
+
* The sort is **stable** — `Array.prototype.sort` has been since ES2019 — which
|
|
40
|
+
* is what makes a multi-key sort composable: sorting by name and then adding
|
|
41
|
+
* date to the end of the list leaves rows with the same date in name order,
|
|
42
|
+
* because that is the order they were already in.
|
|
43
|
+
*
|
|
44
|
+
* **The direction goes to `comparatorFor` rather than being applied to what it
|
|
45
|
+
* hands back.** A machine that reversed the result would reverse everything in
|
|
46
|
+
* it, and a comparison has parts that must not turn over — an empty cell sorts
|
|
47
|
+
* last whichever way the column runs. Who reverses what is a policy, and this
|
|
48
|
+
* function has none.
|
|
49
|
+
*
|
|
50
|
+
* `comparatorFor` answers `null` for a key no column claims, so a sort left over
|
|
51
|
+
* from a column that has since gone is skipped rather than throwing.
|
|
52
|
+
*/
|
|
53
|
+
export declare function sortRows<T>(rows: readonly T[], sort: readonly MPDataTableSort[], comparatorFor: (key: string, direction: MPSortDirection) => ((a: T, b: T) => number) | null): T[];
|
|
54
|
+
/**
|
|
55
|
+
* What pressing a heading does, given what the sort already says.
|
|
56
|
+
*
|
|
57
|
+
* Three states rather than two — ascending, descending, unsorted — because the
|
|
58
|
+
* order the rows arrived in is a state a reader cannot get back to by pressing
|
|
59
|
+
* anything if the cycle only has two. That is the opposite of the choice
|
|
60
|
+
* `MPTreeView`'s single select makes, and for the same reason read the other
|
|
61
|
+
* way: there, "nothing chosen" is reachable by pressing something else; here it
|
|
62
|
+
* is not.
|
|
63
|
+
*
|
|
64
|
+
* `additive` is what a Shift-press sets. It leaves the column where it already
|
|
65
|
+
* is in the list rather than moving it to the end, so flipping the second key of
|
|
66
|
+
* a two-key sort does not quietly make it the first.
|
|
67
|
+
*/
|
|
68
|
+
export declare function nextSort(current: readonly MPDataTableSort[], key: string, additive: boolean): MPDataTableSort[];
|
|
69
|
+
/** Where one page starts and stops, and how many there are. */
|
|
70
|
+
export interface MPPageBounds {
|
|
71
|
+
/** How many pages the rows come to. Never below `1`. */
|
|
72
|
+
pages: number;
|
|
73
|
+
/** The page actually shown, clamped into range. */
|
|
74
|
+
page: number;
|
|
75
|
+
/** Index of the first row on it. */
|
|
76
|
+
start: number;
|
|
77
|
+
/** One past the last. */
|
|
78
|
+
end: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The page arithmetic, with the clamp in it.
|
|
82
|
+
*
|
|
83
|
+
* The clamp is the whole reason this is a function rather than two expressions
|
|
84
|
+
* at the call site. A search that cuts a twenty-page table to three leaves the
|
|
85
|
+
* caller's `page` at fourteen, and a table that answers with an empty screen has
|
|
86
|
+
* told the reader their search found nothing. The page moves to the last one
|
|
87
|
+
* that exists instead.
|
|
88
|
+
*/
|
|
89
|
+
export declare function pageBounds(total: number, page: number, pageSize: number): MPPageBounds;
|
|
90
|
+
/**
|
|
91
|
+
* Every key between two, inclusive, in the order the rows are currently in.
|
|
92
|
+
*
|
|
93
|
+
* "Currently" is the point. A Shift-press chooses what the reader can see
|
|
94
|
+
* between the two rows they pressed, so the range is taken from the sorted,
|
|
95
|
+
* searched order rather than from the order `items` arrived in — otherwise
|
|
96
|
+
* shift-pressing two adjacent rows of a sorted table would take in every row
|
|
97
|
+
* that happens to lie between them in the original array.
|
|
98
|
+
*
|
|
99
|
+
* Which of the two keys is the anchor does not matter: dragging up covers the
|
|
100
|
+
* same rows as dragging down. A key that is no longer in the list — a row the
|
|
101
|
+
* current search hides — yields nothing rather than the range from one end that
|
|
102
|
+
* an index of `-1` would quietly produce.
|
|
103
|
+
*/
|
|
104
|
+
export declare function keysBetween(order: readonly string[], from: string, to: string): string[];
|
|
105
|
+
/**
|
|
106
|
+
* A value as something a query can be matched against.
|
|
107
|
+
*
|
|
108
|
+
* `toLocaleLowerCase` and nothing else, which is the fold `MPCombobox`,
|
|
109
|
+
* `MPCommandPalette` and `MPTreeSelect` already use. A collator that knew about
|
|
110
|
+
* diacritics would be a second answer to a question this library has answered
|
|
111
|
+
* one way — and a reader who has learned what the search box in one part of a
|
|
112
|
+
* product does should not have learned the wrong thing about the rest of it.
|
|
113
|
+
*
|
|
114
|
+
* A `Date` is deliberately not formatted. What a reader sees in a cell came out
|
|
115
|
+
* of the caller's own `render`, and guessing a format the search would agree
|
|
116
|
+
* with is how a table ends up not finding a date that is on the screen. A column
|
|
117
|
+
* whose dates should be searchable gives them a `value`.
|
|
118
|
+
*/
|
|
119
|
+
export declare function searchText(value: unknown): string;
|
|
120
|
+
/** Every string a row can be found by, folded once and joined into one haystack. */
|
|
121
|
+
export declare function searchHaystack(values: readonly unknown[]): string;
|
|
122
|
+
/**
|
|
123
|
+
* One field, quoted only when it has to be.
|
|
124
|
+
*
|
|
125
|
+
* The escaping is the whole job here and getting it wrong is silent: a comma
|
|
126
|
+
* inside a cell shifts every column after it by one, and nobody notices until a
|
|
127
|
+
* spreadsheet somewhere is off by a column. RFC 4180 is four rules and all four
|
|
128
|
+
* are in these six lines — a field is quoted if it holds the separator, a quote
|
|
129
|
+
* or a line break, and a quote inside a quoted field is written twice.
|
|
130
|
+
*
|
|
131
|
+
* `null` and `undefined` are empty rather than the words "null" and "undefined",
|
|
132
|
+
* which is what `String()` would put in the cell.
|
|
133
|
+
*/
|
|
134
|
+
export declare function csvField(value: unknown, separator: string): string;
|
|
135
|
+
export interface MPCsvOptions {
|
|
136
|
+
/** What goes between fields. `;` for the locales whose spreadsheets expect it. */
|
|
137
|
+
separator?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Writes a byte-order mark in front.
|
|
140
|
+
*
|
|
141
|
+
* On by default, and not as a nicety: Excel reads a UTF-8 CSV without one as
|
|
142
|
+
* the local code page, so every non-ASCII name in the file arrives as
|
|
143
|
+
* mojibake. Every other reader ignores the mark.
|
|
144
|
+
*/
|
|
145
|
+
bom?: boolean;
|
|
146
|
+
}
|
|
147
|
+
/** Rows of already-stringable values, as one CSV document. */
|
|
148
|
+
export declare function toCsv(rows: readonly (readonly unknown[])[], options?: MPCsvOptions): string;
|
|
149
|
+
/**
|
|
150
|
+
* Hands the file to the browser.
|
|
151
|
+
*
|
|
152
|
+
* A `blob:` URL and a synthesised press, which is the only way a page can
|
|
153
|
+
* produce a file the reader keeps. The URL is released on the next frame rather
|
|
154
|
+
* than straight away: some browsers have not finished reading it when the press
|
|
155
|
+
* returns, and releasing it too early is a download that silently produces
|
|
156
|
+
* nothing.
|
|
157
|
+
*/
|
|
158
|
+
export declare function downloadText(text: string, fileName: string, type: string): void;
|
|
159
|
+
/** How wide a column is when neither the caller nor a drag has said. */
|
|
160
|
+
export declare const DEFAULT_COLUMN_WIDTH = 160;
|
|
161
|
+
/** How narrow a drag may make one. Below this the heading is a single letter. */
|
|
162
|
+
export declare const MIN_COLUMN_WIDTH = 48;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function compareValues(e,t,n,o=!1){const r=null==e||""===e,i=null==t||""===t;if(r||i)return r&&i?0:r?1:-1;const a=o?-1:1;return"number"==typeof e&&"number"==typeof t?Number.isNaN(e)||Number.isNaN(t)?Number.isNaN(e)&&Number.isNaN(t)?0:Number.isNaN(e)?1:-1:a*(e-t):"boolean"==typeof e&&"boolean"==typeof t?a*(Number(e)-Number(t)):e instanceof Date&&t instanceof Date?a*(e.getTime()-t.getTime()):a*n.compare(String(e),String(t))}export function sortRows(e,t,n){const o=[];for(const e of t){const t=n(e.key,e.direction);t&&o.push(t)}return 0===o.length?e:[...e].sort((e,t)=>{for(const n of o){const o=n(e,t);if(0!==o)return o}return 0})}export function nextSort(e,t,n){const o=e.find(e=>e.key===t),r=void 0===o?"asc":"asc"===o.direction?"desc":null;return n?null===r?e.filter(e=>e.key!==t):void 0===o?[...e,{key:t,direction:r}]:e.map(e=>e.key===t?{key:t,direction:r}:e):null===r?[]:[{key:t,direction:r}]}export function pageBounds(e,t,n){const o=Math.max(1,Math.floor(n)),r=Math.max(1,Math.ceil(e/o)),i=Math.min(Math.max(Math.floor(t),1),r),a=(i-1)*o;return{pages:r,page:i,start:a,end:Math.min(a+o,e)}}export function keysBetween(e,t,n){const o=e.indexOf(t),r=e.indexOf(n);return-1===o||-1===r?[]:e.slice(Math.min(o,r),Math.max(o,r)+1)}export function searchText(e){return null==e||"object"==typeof e?"":String(e).toLocaleLowerCase()}export function searchHaystack(e){return e.map(searchText).join("\0")}export function csvField(e,t){if(null==e)return"";const n=e instanceof Date?e.toISOString():"object"==typeof e?JSON.stringify(e):String(e);return/["\r\n]/.test(n)||n.includes(t)?`"${n.replaceAll('"','""')}"`:n}export function toCsv(e,t={}){const{separator:n=",",bom:o=!0}=t,r=e.map(e=>e.map(e=>csvField(e,n)).join(n)).join("\r\n");return o?`\ufeff${r}`:r}export function downloadText(e,t,n){const o=URL.createObjectURL(new Blob([e],{type:n})),r=document.createElement("a");r.href=o,r.download=t,r.rel="noopener",r.style.display="none",document.body.append(r),r.click(),r.remove(),requestAnimationFrame(()=>URL.revokeObjectURL(o))}export const DEFAULT_COLUMN_WIDTH=160;export const MIN_COLUMN_WIDTH=48;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MPDensity, MPSize } from '../types.js';
|
|
2
|
+
/** The control height at a rung, tightened by a density step. */
|
|
3
|
+
export declare function controlHeight(size: MPSize, density?: MPDensity): string;
|
|
4
|
+
/** The room inside a sheet at a rung, tightened by a density step. */
|
|
5
|
+
export declare function sheetPad(size: MPSize, density?: MPDensity): string;
|
|
6
|
+
/** The same, sideways only. */
|
|
7
|
+
export declare function sheetPadX(size: MPSize, density?: MPDensity): string;
|
|
8
|
+
/** And the other axis. */
|
|
9
|
+
export declare function sheetPadY(size: MPSize, density?: MPDensity): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CONTROL_HEIGHT as p,SHEET_PAD as x,SHEET_PAD_X as t,SHEET_PAD_Y as h}from"./scale.js";const e={xs:["h-7","h-6","h-6"],sm:["h-9","h-8","h-7"],md:["h-13","h-12","h-11"],lg:["h-15","h-14","h-13"],xl:["h-17","h-16","h-15"]};export function controlHeight(x,t=0){return 0===t?p[x]:e[x][-t-1]}const n={xs:["p-2","p-1.5","p-1.5"],sm:["p-2.5","p-2","p-1.5"],md:["p-3.5","p-3","p-2.5"],lg:["p-4.5","p-4","p-3.5"],xl:["p-5.5","p-5","p-4.5"]},r={xs:["px-2","px-1.5","px-1.5"],sm:["px-2.5","px-2","px-1.5"],md:["px-3.5","px-3","px-2.5"],lg:["px-4.5","px-4","px-3.5"],xl:["px-5.5","px-5","px-4.5"]},s={xs:["py-2","py-1.5","py-1.5"],sm:["py-2.5","py-2","py-1.5"],md:["py-3.5","py-3","py-2.5"],lg:["py-4.5","py-4","py-3.5"],xl:["py-5.5","py-5","py-4.5"]};export function sheetPad(p,t=0){return 0===t?x[p]:n[p][-t-1]}export function sheetPadX(p,x=0){return 0===x?t[p]:r[p][-x-1]}export function sheetPadY(p,x=0){return 0===x?h[p]:s[p][-x-1]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MPElevation, MPVariant } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The five weights of `CONTAINER_SURFACE` said as a height instead, one row per
|
|
4
|
+
* MD3 level.
|
|
5
|
+
*
|
|
6
|
+
* A tone **and** a shadow per row, which is what makes an `elevation` prop
|
|
7
|
+
* possible at all. The `elevated` row of the variant table is this table's level
|
|
8
|
+
* 1, written twice because the two props are two different questions and neither
|
|
9
|
+
* should have to resolve the other to answer its own.
|
|
10
|
+
*
|
|
11
|
+
* Levels 4 and 5 share `surface-container-high` and `surface-container-highest`
|
|
12
|
+
* with the levels under them because the specification runs out of container
|
|
13
|
+
* roles before it runs out of levels. Inventing a sixth tone to keep the columns
|
|
14
|
+
* tidy would be inventing a colour role.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ELEVATION_SURFACE: Record<MPElevation, string>;
|
|
17
|
+
/**
|
|
18
|
+
* What a container paints, from whichever of the two props answered.
|
|
19
|
+
*
|
|
20
|
+
* A level wins where one was given, and takes the tone with it — so `variant` is
|
|
21
|
+
* left holding only what a level does not describe, which is the hairline. Two
|
|
22
|
+
* props writing one `background-color` would otherwise be settled by the order
|
|
23
|
+
* two class names happened to reach the generated stylesheet, which is not a
|
|
24
|
+
* decision anybody made.
|
|
25
|
+
*/
|
|
26
|
+
export declare function containerSurface(variant: MPVariant, elevation: MPElevation | undefined): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CONTAINER_SURFACE as o}from"./surface.js";export const ELEVATION_SURFACE={0:"bg-mp-surface shadow-none",1:"shadow-mp-1 bg-mp-surface-container-low",2:"shadow-mp-2 bg-mp-surface-container",3:"shadow-mp-3 bg-mp-surface-container-high",4:"shadow-mp-4 bg-mp-surface-container-high",5:"shadow-mp-5 bg-mp-surface-container-highest"};export function containerSurface(r,e){return void 0===e?o[r]:"outlined"===r?`border-mp-outline-variant border ${ELEVATION_SURFACE[e]}`:ELEVATION_SURFACE[e]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The grammar engine behind `MPCodeBlock`, and the only thing in this library
|
|
3
|
+
* that is *loaded* rather than imported.
|
|
4
|
+
*
|
|
5
|
+
* highlight.js is the second runtime dependency the package has, and it is here
|
|
6
|
+
* for a reason no amount of hand-written regex answers: colouring a language
|
|
7
|
+
* means knowing that language, and there are thirty-four of them here. It is
|
|
8
|
+
* reached through `highlight.js/lib/core` plus one module per language, never
|
|
9
|
+
* through the package root — which is all hundred and ninety at once.
|
|
10
|
+
*
|
|
11
|
+
* **Every one of those specifiers sits behind an `import()`, and that is the
|
|
12
|
+
* whole design.** A bundler resolves it at build time and emits it as its own
|
|
13
|
+
* chunk, so a page that renders an `MPCodeBlock` with `highlight={false}`
|
|
14
|
+
* downloads none of it, and a page that colours TypeScript downloads the core
|
|
15
|
+
* and TypeScript and not the other thirty-three. Done with a static import the
|
|
16
|
+
* component would spend forty kilobytes before drawing a character.
|
|
17
|
+
*
|
|
18
|
+
* It is a real `dependencies` entry rather than an optional peer because a
|
|
19
|
+
* specifier a bundler cannot resolve fails the **whole** build rather than the
|
|
20
|
+
* part that would have used it: the bundler walks and resolves this module
|
|
21
|
+
* while it is still deciding whether to keep it. An optional peer would mean
|
|
22
|
+
* `import { MPButton } from 'material-plus-ui'` breaking for anyone who had not
|
|
23
|
+
* installed a syntax highlighter.
|
|
24
|
+
*
|
|
25
|
+
* What comes back out of here is not HTML. highlight.js emits a string of
|
|
26
|
+
* nested `<span>`s, and the block needs *lines* — a line is what carries a
|
|
27
|
+
* number, a prompt and a place in the scroll — so `tokenize` turns that string
|
|
28
|
+
* into runs of text with a class on them, split at every newline. Which is also
|
|
29
|
+
* why nothing in this library ever writes `dangerouslySetInnerHTML`.
|
|
30
|
+
*/
|
|
31
|
+
/** One run of text with a single colour: the innermost span highlight.js drew. */
|
|
32
|
+
export interface MPCodeToken {
|
|
33
|
+
text: string;
|
|
34
|
+
/** The class it was drawn under — `hljs-keyword`, `hljs-title function_`. */
|
|
35
|
+
token?: string;
|
|
36
|
+
}
|
|
37
|
+
/** One line of code, as the runs it is made of. An empty array is a blank line. */
|
|
38
|
+
export type MPCodeLine = MPCodeToken[];
|
|
39
|
+
/** The core, and what it hands `registerMPLanguage`. Opaque here; only hljs reads them. */
|
|
40
|
+
type Hljs = typeof import('highlight.js/lib/core').default;
|
|
41
|
+
type LanguageDefinition = Parameters<Hljs['registerLanguage']>[1];
|
|
42
|
+
/**
|
|
43
|
+
* Teaches `MPCodeBlock` a language the built-in set does not have.
|
|
44
|
+
*
|
|
45
|
+
* The same arrangement `registerMPMessages` makes for the eighteen languages
|
|
46
|
+
* the library does not ship, and for the same reason: highlight.js knows a
|
|
47
|
+
* hundred and ninety grammars, a documentation site uses six, and the
|
|
48
|
+
* thirty-four here are a guess at which six. Registering is how an Elixir
|
|
49
|
+
* project or a Nix flake gets coloured without the other hundred and fifty
|
|
50
|
+
* being in anybody's build.
|
|
51
|
+
*
|
|
52
|
+
* ```ts
|
|
53
|
+
* import { registerMPLanguage } from 'material-plus-ui';
|
|
54
|
+
* import elixir from 'highlight.js/lib/languages/elixir';
|
|
55
|
+
*
|
|
56
|
+
* registerMPLanguage('elixir', elixir);
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* Call it at module scope. A language registered after a block has drawn does
|
|
60
|
+
* not repaint that block — nothing here re-renders on its own — but every block
|
|
61
|
+
* mounted after it sees it.
|
|
62
|
+
*
|
|
63
|
+
* @param name What `language` will be written as. Registering a name the
|
|
64
|
+
* library already has replaces it.
|
|
65
|
+
* @param definition The default export of a `highlight.js/lib/languages/*`
|
|
66
|
+
* module.
|
|
67
|
+
*/
|
|
68
|
+
export declare function registerMPLanguage(name: string, definition: LanguageDefinition): void;
|
|
69
|
+
/** The canonical name a caller's spelling means, whether or not it can be loaded. */
|
|
70
|
+
export declare function canonicalLanguage(language: string | undefined): string | null;
|
|
71
|
+
/**
|
|
72
|
+
* Colours `code`, or answers `null` when the language is unknown.
|
|
73
|
+
*
|
|
74
|
+
* The block is coloured whole and split afterwards, never a line at a time: a
|
|
75
|
+
* block comment, a template literal and a heredoc all span lines, and a
|
|
76
|
+
* highlighter handed one line at a time reads the second line of a comment as
|
|
77
|
+
* code.
|
|
78
|
+
*/
|
|
79
|
+
export declare function highlightCode(code: string, language: string): Promise<MPCodeLine[] | null>;
|
|
80
|
+
/**
|
|
81
|
+
* highlight.js's own markup, as lines of coloured runs.
|
|
82
|
+
*
|
|
83
|
+
* The output is a strictly nested tree of `<span class="…">` with escaped text
|
|
84
|
+
* between, and a span may cross a newline — which is exactly why this exists
|
|
85
|
+
* rather than a `split('\n')` over the string. Walking it keeps the open class
|
|
86
|
+
* across the break and reopens it on the next line.
|
|
87
|
+
*
|
|
88
|
+
* Only the innermost class survives a nesting. In the browser that is the one
|
|
89
|
+
* on the element the text actually sits in, so it is the one whose colour
|
|
90
|
+
* applies; keeping the ancestors would put two equally specific rules on one
|
|
91
|
+
* run and let stylesheet order decide the colour.
|
|
92
|
+
*/
|
|
93
|
+
export declare function tokenize(html: string): MPCodeLine[];
|
|
94
|
+
/** The same shape with no colour in it: what a block draws before its chunk lands. */
|
|
95
|
+
export declare function plainLines(code: string): MPCodeLine[];
|
|
96
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i={bash:()=>import("highlight.js/lib/languages/bash"),c:()=>import("highlight.js/lib/languages/c"),cpp:()=>import("highlight.js/lib/languages/cpp"),csharp:()=>import("highlight.js/lib/languages/csharp"),css:()=>import("highlight.js/lib/languages/css"),diff:()=>import("highlight.js/lib/languages/diff"),dockerfile:()=>import("highlight.js/lib/languages/dockerfile"),go:()=>import("highlight.js/lib/languages/go"),graphql:()=>import("highlight.js/lib/languages/graphql"),ini:()=>import("highlight.js/lib/languages/ini"),java:()=>import("highlight.js/lib/languages/java"),javascript:()=>import("highlight.js/lib/languages/javascript"),json:()=>import("highlight.js/lib/languages/json"),kotlin:()=>import("highlight.js/lib/languages/kotlin"),less:()=>import("highlight.js/lib/languages/less"),lua:()=>import("highlight.js/lib/languages/lua"),makefile:()=>import("highlight.js/lib/languages/makefile"),markdown:()=>import("highlight.js/lib/languages/markdown"),objectivec:()=>import("highlight.js/lib/languages/objectivec"),perl:()=>import("highlight.js/lib/languages/perl"),php:()=>import("highlight.js/lib/languages/php"),plaintext:()=>import("highlight.js/lib/languages/plaintext"),powershell:()=>import("highlight.js/lib/languages/powershell"),python:()=>import("highlight.js/lib/languages/python"),r:()=>import("highlight.js/lib/languages/r"),ruby:()=>import("highlight.js/lib/languages/ruby"),rust:()=>import("highlight.js/lib/languages/rust"),scss:()=>import("highlight.js/lib/languages/scss"),shell:()=>import("highlight.js/lib/languages/shell"),sql:()=>import("highlight.js/lib/languages/sql"),swift:()=>import("highlight.js/lib/languages/swift"),typescript:()=>import("highlight.js/lib/languages/typescript"),xml:()=>import("highlight.js/lib/languages/xml"),yaml:()=>import("highlight.js/lib/languages/yaml")},t={"c++":"cpp",cc:"cpp",cjs:"javascript",console:"bash",cs:"csharp",cts:"typescript",docker:"dockerfile",golang:"go",gql:"graphql",h:"cpp",hpp:"cpp",htm:"xml",html:"xml",js:"javascript",jsx:"javascript",kt:"kotlin",kts:"kotlin",md:"markdown",mdx:"markdown",mjs:"javascript",mm:"objectivec",mts:"typescript",mysql:"sql",node:"javascript",none:"plaintext",objc:"objectivec",plain:"plaintext",posh:"powershell",ps1:"powershell",psql:"sql",py:"python",rb:"ruby",rs:"rust",sh:"bash",svelte:"xml",svg:"xml",text:"plaintext",toml:"ini",ts:"typescript",tsx:"typescript",txt:"plaintext",vue:"xml",yml:"yaml",zsh:"bash"},l=new Map;let g=null;const s=new Map;export function registerMPLanguage(i,t){const g=i.toLowerCase();l.set(g,t),s.delete(g)}export function canonicalLanguage(i){if(!i)return null;const l=i.trim().toLowerCase();return l?t[l]??l:null}export async function highlightCode(t,a){let e=s.get(a);e||(e=async function(t){const s=l.get(t),a=s?void 0:i[t];if(!s&&!a)return null;g??=import("highlight.js/lib/core").then(i=>i.default);const e=await g;return s?e.registerLanguage(t,s):e.getLanguage(t)||e.registerLanguage(t,(await a()).default),t}(a).catch(i=>{throw s.delete(a),i}),s.set(a,e));const h=await e;if(!h||!g)return null;return tokenize((await g).highlight(t,{language:h,ignoreIllegals:!0}).value)}const a={"&":"&","<":"<",">":">",""":'"',"'":"'"};export function tokenize(i){const t=[[]],l=[],g=/<span class="([^"]*)">|<\/span>/g;let s=0;const e=i=>{if(!i)return;const g=l[l.length-1];i.replace(/&(?:amp|lt|gt|quot|#x27);/g,i=>a[i]).split("\n").forEach((i,l)=>{l>0&&t.push([]),i&&t[t.length-1].push(g?{text:i,token:g}:{text:i})})};for(const t of i.matchAll(g))e(i.slice(s,t.index)),s=t.index+t[0].length,void 0===t[1]?l.pop():l.push(t[1]);return e(i.slice(s)),t}export function plainLines(i){return i.split("\n").map(i=>i?[{text:i}]:[])}
|
package/dist/internal/i18n.d.ts
CHANGED
|
@@ -189,6 +189,57 @@ export interface MPMessages {
|
|
|
189
189
|
/** One slide, and its own position mark. `Slide 2 of 5`. */
|
|
190
190
|
slide: string;
|
|
191
191
|
};
|
|
192
|
+
/**
|
|
193
|
+
* MPScrollZone.
|
|
194
|
+
*
|
|
195
|
+
* Read out and never drawn, like the carousel's above — but a namespace of
|
|
196
|
+
* its own rather than three more keys in that one, because the words differ
|
|
197
|
+
* where it matters. A carousel's arrow moves to the *slide* before this one
|
|
198
|
+
* and there is a countable thing on the other side of the press; a scroll
|
|
199
|
+
* zone's moves the strip along and lands wherever the content happens to
|
|
200
|
+
* start. A translation that reused *Previous slide* for it would be naming a
|
|
201
|
+
* slide the reader is not being taken to.
|
|
202
|
+
*/
|
|
203
|
+
scroll: {
|
|
204
|
+
/** What the strip is called when the caller has not said what is in it. */
|
|
205
|
+
label: string;
|
|
206
|
+
/** The two buttons, named by which way they travel. */
|
|
207
|
+
previous: string;
|
|
208
|
+
next: string;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* MPAnchor.
|
|
212
|
+
*
|
|
213
|
+
* One string, and it is read out rather than drawn: the rows are the page's
|
|
214
|
+
* own headings, and the only thing the component says on its own behalf is
|
|
215
|
+
* what the `<nav>` around them is called. A page with a table of contents and
|
|
216
|
+
* a menu in it has two navigation landmarks, and a screen reader that offers
|
|
217
|
+
* both of them as "navigation" has told the reader nothing.
|
|
218
|
+
*/
|
|
219
|
+
anchor: {
|
|
220
|
+
/** The name of the `<nav>` the list of headings is inside. */
|
|
221
|
+
label: string;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* MPCodeBlock.
|
|
225
|
+
*
|
|
226
|
+
* Two of these are **drawn** — the copy button says its own word, and says a
|
|
227
|
+
* different one once the clipboard has taken the code — which is unusual in
|
|
228
|
+
* this table and is what makes the namespace necessary. A Korean page with a
|
|
229
|
+
* button reading *Copy* is a page the component broke.
|
|
230
|
+
*/
|
|
231
|
+
code: {
|
|
232
|
+
/** The button that puts the code on the clipboard. */
|
|
233
|
+
copy: string;
|
|
234
|
+
/** What it says for a moment afterwards. */
|
|
235
|
+
copied: string;
|
|
236
|
+
/** And what it says when the browser refused. */
|
|
237
|
+
copyFailed: string;
|
|
238
|
+
/** The toggle that drops the colouring. Read out; the button is a glyph. */
|
|
239
|
+
raw: string;
|
|
240
|
+
/** What the scrollable region is called when nothing named it. */
|
|
241
|
+
label: string;
|
|
242
|
+
};
|
|
192
243
|
/**
|
|
193
244
|
* MPBreadcrumb.
|
|
194
245
|
*
|
|
@@ -215,6 +266,74 @@ export interface MPMessages {
|
|
|
215
266
|
/** The row that offers what was typed as a value of its own. */
|
|
216
267
|
add: string;
|
|
217
268
|
};
|
|
269
|
+
/**
|
|
270
|
+
* MPSparkline.
|
|
271
|
+
*
|
|
272
|
+
* One string, and it is the whole of what a sparkline says to a reader who
|
|
273
|
+
* cannot see it. The mark has no axis and no tooltip — see the note on the
|
|
274
|
+
* component — so the shape has to arrive as a sentence or not at all.
|
|
275
|
+
*
|
|
276
|
+
* `{count}`, `{first}` and `{last}` are filled in by `fillMessage`, and the
|
|
277
|
+
* two ends rather than the two extremes because it is the direction a reader
|
|
278
|
+
* wants from a sparkline: 120 to 400 says which way it went, and 90 to 410
|
|
279
|
+
* does not.
|
|
280
|
+
*/
|
|
281
|
+
/**
|
|
282
|
+
* The framed charts.
|
|
283
|
+
*
|
|
284
|
+
* Three words, and every one of them is a name for a thing the chart drew
|
|
285
|
+
* rather than a thing the caller wrote. A chart's own content — its series
|
|
286
|
+
* names, its categories, its title — is the caller's and is never translated
|
|
287
|
+
* here; these are the scaffolding around it.
|
|
288
|
+
*
|
|
289
|
+
* `label` is the fallback accessible name. A chart is a focusable
|
|
290
|
+
* `role="img"`, and one with nothing to be called by is a tab stop that
|
|
291
|
+
* announces silence, so there is always a name even when the caller gave
|
|
292
|
+
* none.
|
|
293
|
+
*
|
|
294
|
+
* `table` names the grid under every chart — the relief channel that makes a
|
|
295
|
+
* picture readable to somebody who cannot see it — and `category` heads its
|
|
296
|
+
* first column, the one holding whatever the marks are filed under.
|
|
297
|
+
*/
|
|
298
|
+
chart: {
|
|
299
|
+
/** What an unnamed chart is called. */
|
|
300
|
+
label: string;
|
|
301
|
+
/** The caption on the table under it. */
|
|
302
|
+
table: string;
|
|
303
|
+
/** The heading over that table's first column. */
|
|
304
|
+
category: string;
|
|
305
|
+
};
|
|
306
|
+
sparkline: {
|
|
307
|
+
summary: string;
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* MPTour.
|
|
311
|
+
*
|
|
312
|
+
* The four buttons and the counter — every one of them drawn, and none of
|
|
313
|
+
* them the caller's. A tour is a component whose whole content is somebody
|
|
314
|
+
* else's writing, so these five are the only words it says on its own behalf,
|
|
315
|
+
* and a tour whose steps are in Korean under a *Next* button is a tour that
|
|
316
|
+
* was translated halfway.
|
|
317
|
+
*
|
|
318
|
+
* The × is `common`'s, because it is the same × every sheet in the library
|
|
319
|
+
* closes with.
|
|
320
|
+
*
|
|
321
|
+
* `{index}` and `{total}` are filled in by `fillMessage`, and they are
|
|
322
|
+
* positional for the reason the pagination's are: a language that counts the
|
|
323
|
+
* total first is not one an argument order can serve.
|
|
324
|
+
*/
|
|
325
|
+
tour: {
|
|
326
|
+
/** Back one step. Missing on the first. */
|
|
327
|
+
previous: string;
|
|
328
|
+
/** On one step. */
|
|
329
|
+
next: string;
|
|
330
|
+
/** What Next becomes on the last step. */
|
|
331
|
+
done: string;
|
|
332
|
+
/** Leaves the tour without finishing it. */
|
|
333
|
+
skip: string;
|
|
334
|
+
/** Where the reader is: "Step 2 of 5". */
|
|
335
|
+
position: string;
|
|
336
|
+
};
|
|
218
337
|
/**
|
|
219
338
|
* MPTable.
|
|
220
339
|
*
|
|
@@ -225,6 +344,57 @@ export interface MPMessages {
|
|
|
225
344
|
table: {
|
|
226
345
|
empty: string;
|
|
227
346
|
};
|
|
347
|
+
/**
|
|
348
|
+
* MPDataTable.
|
|
349
|
+
*
|
|
350
|
+
* The words the table says on its own behalf, and not one of them is the
|
|
351
|
+
* caller's data. Three are read out and never drawn — the ticks have no
|
|
352
|
+
* visible label, and a column of unnamed checkboxes is a column a screen
|
|
353
|
+
* reader announces as nothing at all — and three are drawn in the bar under
|
|
354
|
+
* the rows.
|
|
355
|
+
*
|
|
356
|
+
* The empty line is `table`'s, the search field's word is `transfer`'s and the
|
|
357
|
+
* pages are `pagination`'s: what is here is only what none of them says.
|
|
358
|
+
*
|
|
359
|
+
* `{count}` and `{total}` are filled in by `fillMessage`.
|
|
360
|
+
*/
|
|
361
|
+
dataTable: {
|
|
362
|
+
/** The tick in the header, which chooses every row on the page. */
|
|
363
|
+
selectAll: string;
|
|
364
|
+
/** One row's tick. Read out with the row it is in. */
|
|
365
|
+
selectRow: string;
|
|
366
|
+
/**
|
|
367
|
+
* How many rows there are, after the search and before the page.
|
|
368
|
+
*
|
|
369
|
+
* A label with a number after it — "Rows: 7" — in every language that
|
|
370
|
+
* inflects a noun for number, and the natural phrase in the ones that do
|
|
371
|
+
* not. "1 rows" is what a single `{total} rows` says one row in seven times
|
|
372
|
+
* out of seven, and the alternative is a plural form per language in a table
|
|
373
|
+
* that holds one string per key: Polish and Arabic need four and six of
|
|
374
|
+
* them. Naming the thing and then counting it is right in every language and
|
|
375
|
+
* costs nothing.
|
|
376
|
+
*/
|
|
377
|
+
total: string;
|
|
378
|
+
/**
|
|
379
|
+
* And how many of them are held, when any are.
|
|
380
|
+
*
|
|
381
|
+
* A second fact beside the first rather than a sentence joining the two.
|
|
382
|
+
* Written as one — "{count} of {total} selected" — the two numbers are
|
|
383
|
+
* counted over different sets, because a row the search has hidden is still
|
|
384
|
+
* chosen: a table of seven with one hidden row held would have said "1 of 1
|
|
385
|
+
* selected" the moment a search left one row on screen.
|
|
386
|
+
*/
|
|
387
|
+
selected: string;
|
|
388
|
+
/** The button that writes the rows out as a file. */
|
|
389
|
+
download: string;
|
|
390
|
+
/** The label on the footer's page-size control. */
|
|
391
|
+
perPage: string;
|
|
392
|
+
/**
|
|
393
|
+
* The handle between two headings, which is a control a keyboard can reach:
|
|
394
|
+
* the arrow keys widen and narrow the column it belongs to.
|
|
395
|
+
*/
|
|
396
|
+
resize: string;
|
|
397
|
+
};
|
|
228
398
|
/**
|
|
229
399
|
* MPFilePicker.
|
|
230
400
|
*
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A name reduced to the letters that stand in for it.
|
|
3
|
+
*
|
|
4
|
+
* The first character of the first word plus the first of the last — "Jane Doe"
|
|
5
|
+
* is `JD`, "Acme Supply Co" is `AC`, and "홍길동" is `홍`.
|
|
6
|
+
*
|
|
7
|
+
* One word gives one character on purpose. Korean, Japanese and Chinese names
|
|
8
|
+
* are a single token, and two of their characters at 32px is a smudge where one
|
|
9
|
+
* of them is a name.
|
|
10
|
+
*
|
|
11
|
+
* `Array.from` rather than indexing, and that is the whole reason this is a
|
|
12
|
+
* function rather than a `slice(0, 1)` at each call site: a string index is a
|
|
13
|
+
* UTF-16 code unit, so `name[0]` on a name beginning with an emoji or any
|
|
14
|
+
* character outside the basic plane returns half of it, and half a surrogate
|
|
15
|
+
* pair renders as the replacement glyph. `normalize('NFC')` is the other half
|
|
16
|
+
* of the same care — a decomposed "Å" would otherwise give the bare A, with the
|
|
17
|
+
* ring left behind on the next character.
|
|
18
|
+
*
|
|
19
|
+
* The rule is wrong for some names, which is what every caller's own `initials`
|
|
20
|
+
* prop is for. It is not wrong often enough to be worth a locale-aware guess
|
|
21
|
+
* that would be wrong differently.
|
|
22
|
+
*
|
|
23
|
+
* A file of its own because two components need it and neither should import
|
|
24
|
+
* the other. `MPAvatar` derives a person's initials and `MPAppLogo` derives a
|
|
25
|
+
* product's, and a page carrying both would otherwise be able to disagree with
|
|
26
|
+
* itself about what a two-word name comes to.
|
|
27
|
+
*/
|
|
28
|
+
export declare function initialsOf(name: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function initialsOf(r){const t=r.normalize("NFC").trim().split(/\s+/).filter(Boolean);if(0===t.length)return"";return((Array.from(t[0])[0]??"")+(t.length>1?Array.from(t[t.length-1])[0]??"":"")).toLocaleUpperCase()}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The mark that comes and goes, and the timing every one of them shares.
|
|
3
|
+
*
|
|
4
|
+
* Six controls in this library draw a small shape to say "this one" — a
|
|
5
|
+
* checkbox's tick, a radio's dot, the tick beside a chosen row in a select, in a
|
|
6
|
+
* combobox, and in a menu's two kinds of item. They are the same event, so they
|
|
7
|
+
* have to be the same motion: a tick that grows into a `MPSelect` and one that
|
|
8
|
+
* is stamped into an `MPMenu` beside it read as two libraries, and that is
|
|
9
|
+
* exactly what the library had before this file.
|
|
10
|
+
*
|
|
11
|
+
* It is a string rather than a component because the elements it goes on are
|
|
12
|
+
* Base UI's own indicator parts. There is nothing to wrap: what differs between
|
|
13
|
+
* the six is which part renders and what the mark is drawn with, and what does
|
|
14
|
+
* not differ is the two hundred milliseconds and the frame it arrives from.
|
|
15
|
+
*
|
|
16
|
+
* ## Two from-states, because there are two kinds of mark
|
|
17
|
+
*
|
|
18
|
+
* A tick is a **stroke**. Drawn from nothing it spends its first frames as a
|
|
19
|
+
* smudge too small to read as a tick, and the eye takes the arrival for a
|
|
20
|
+
* flicker rather than for a stroke — so it starts at 0.6, already legible.
|
|
21
|
+
*
|
|
22
|
+
* A dot is a **disc**, and a disc at any size is still a disc. It can grow out
|
|
23
|
+
* of the centre of the ring taking the accent around it, which is the arrival
|
|
24
|
+
* MD3 draws for a radio.
|
|
25
|
+
*
|
|
26
|
+
* ## Why the third one is spelled differently
|
|
27
|
+
*
|
|
28
|
+
* `data-starting-style` and `data-ending-style` are Base UI's own two frames,
|
|
29
|
+
* and they are what `MARK_MOTION` and `DOT_MOTION` are written against. They
|
|
30
|
+
* work wherever the part stays mounted for the length of its exit, which the
|
|
31
|
+
* checkbox's, the radio's and the menu's indicators all do.
|
|
32
|
+
*
|
|
33
|
+
* `Select.ItemIndicator` and `Combobox.ItemIndicator` do not: both return `null`
|
|
34
|
+
* the moment their row stops being the chosen one, so `data-ending-style` never
|
|
35
|
+
* reaches the DOM and a tick that faded in vanished in a frame. Their answer is
|
|
36
|
+
* `keepMounted` plus `MARK_MOTION_KEPT`, which drives both directions off
|
|
37
|
+
* `data-selected` and needs neither frame. The cost is one empty `aria-hidden`
|
|
38
|
+
* span per row, in a column the list already reserves the width of.
|
|
39
|
+
*/
|
|
40
|
+
/** A stroke, arriving from 0.6 and leaving the same way. */
|
|
41
|
+
export declare const MARK_MOTION: string;
|
|
42
|
+
/** A disc, arriving from nothing. */
|
|
43
|
+
export declare const DOT_MOTION: string;
|
|
44
|
+
/**
|
|
45
|
+
* A stroke on a part that is kept mounted, so its resting state is the empty
|
|
46
|
+
* one and `data-selected` is what draws it.
|
|
47
|
+
*
|
|
48
|
+
* Always paired with `keepMounted` on the indicator. Without it the part is only
|
|
49
|
+
* ever in the DOM while it is selected, and a rule that hides everything else
|
|
50
|
+
* would hide the only thing there is.
|
|
51
|
+
*/
|
|
52
|
+
export declare const MARK_MOTION_KEPT: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=/*@__PURE__*/["transition-[opacity,scale]","duration-(--mp-sys-motion-duration-short4)","ease-mp-standard"].join(" ");export const MARK_MOTION=/*@__PURE__*/[t,"data-starting-style:scale-60 data-starting-style:opacity-0","data-ending-style:scale-60 data-ending-style:opacity-0"].join(" ");export const DOT_MOTION=/*@__PURE__*/[t,"data-starting-style:scale-0 data-starting-style:opacity-0","data-ending-style:scale-0 data-ending-style:opacity-0"].join(" ");export const MARK_MOTION_KEPT=/*@__PURE__*/[t,"scale-60 opacity-0","data-selected:scale-100 data-selected:opacity-100"].join(" ");
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How wide content is allowed to get, and the ladder it is usually asked for on.
|
|
3
|
+
*
|
|
4
|
+
* A module of its own rather than a third table in `internal/scale.ts`, and the
|
|
5
|
+
* reason is what `scale.ts` is: ladders of literal Tailwind class names, read by
|
|
6
|
+
* nearly every component in the library. The measure stopped being one of those
|
|
7
|
+
* when it started being read off the window size classes — and an `MPBox`, which
|
|
8
|
+
* wants a padding ladder and nothing else, should not carry those into its
|
|
9
|
+
* bundle to get one.
|
|
10
|
+
*
|
|
11
|
+
* Three components import this: `MPContainer`, `MPHeader` and `MPFooter`. They
|
|
12
|
+
* are the three that hold content to a width while the sheet around it spans the
|
|
13
|
+
* window, and they have to agree about where that edge is or the bar and the
|
|
14
|
+
* article under it line up at every width but one.
|
|
15
|
+
*/
|
|
16
|
+
import type { MPMeasure, MPWindowClass } from '../types.js';
|
|
17
|
+
/**
|
|
18
|
+
* One `maxWidth`, as the length `max-width` is given.
|
|
19
|
+
*
|
|
20
|
+
* A rung of the ladder above, resolved against the boundaries in force where the
|
|
21
|
+
* component is — so a page that moved one with `MPConfigProvider` moves its
|
|
22
|
+
* measures too — or anything else the caller wrote, which reaches CSS untouched.
|
|
23
|
+
* `'60ch'` and `'42rem'` are the same kind of answer as `'lg'` rather than a
|
|
24
|
+
* second prop. See `MPMeasure`.
|
|
25
|
+
*
|
|
26
|
+
* The rungs were once four `rem` values written out — `37.5rem`, `52.5rem`,
|
|
27
|
+
* `75rem`, `100rem` — which are the four boundaries at a 16px root and only at a
|
|
28
|
+
* 16px root. A reader who had scaled their text up got a container that agreed
|
|
29
|
+
* with the media queries at no width at all.
|
|
30
|
+
*/
|
|
31
|
+
export declare function measureValue(value: MPMeasure, mins: Record<MPWindowClass, number>): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={xs:null,sm:"medium",md:"expanded",lg:"large",xl:"extra-large"};export function measureValue(n,r){if(!(n in e))return n;const l=e[n];return`${l?r[l]:480}px`}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ANCHOR={name:"anchor",en:{label:"On this page"}};
|