plass-ui 1.3.0 → 1.5.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/CHANGELOG.md +962 -0
- package/README.md +19 -17
- package/dist/components/accordion/PlAccordion.d.ts +1 -1
- package/dist/components/alert/PlAlert.js +1 -1
- package/dist/components/anchor/PlAnchor.d.ts +85 -0
- package/dist/components/anchor/PlAnchor.js +1 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.js +1 -0
- package/dist/components/animate-appear/PlAnimateAppear.d.ts +10 -0
- package/dist/components/animate-appear/PlAnimateAppear.js +1 -1
- package/dist/components/animate-blink/PlAnimateBlink.d.ts +2 -2
- package/dist/components/animate-blink/PlAnimateBlink.js +1 -1
- package/dist/components/animate-counter/PlAnimateCounter.d.ts +83 -0
- package/dist/components/animate-counter/PlAnimateCounter.js +1 -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/PlAnimateFade.d.ts +2 -2
- package/dist/components/animate-fade/PlAnimateFade.js +1 -1
- package/dist/components/animate-float/PlAnimateFloat.d.ts +51 -0
- package/dist/components/animate-float/PlAnimateFloat.js +1 -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/PlAnimateGrow.d.ts +2 -2
- package/dist/components/animate-grow/PlAnimateGrow.js +1 -1
- package/dist/components/animate-headline/PlAnimateHeadline.js +1 -1
- package/dist/components/animate-lighting/PlAnimateLighting.js +1 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +13 -4
- package/dist/components/animate-marquee/PlAnimateMarquee.js +1 -1
- package/dist/components/animate-reveal/PlAnimateReveal.d.ts +51 -0
- package/dist/components/animate-reveal/PlAnimateReveal.js +1 -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/PlAnimateRotate.d.ts +2 -2
- package/dist/components/animate-rotate/PlAnimateRotate.js +1 -1
- package/dist/components/animate-scramble/PlAnimateScramble.d.ts +75 -0
- package/dist/components/animate-scramble/PlAnimateScramble.js +1 -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/PlAnimateShake.d.ts +57 -0
- package/dist/components/animate-shake/PlAnimateShake.js +1 -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/PlAnimateSlide.d.ts +2 -2
- package/dist/components/animate-slide/PlAnimateSlide.js +1 -1
- package/dist/components/animate-split/PlAnimateSplit.d.ts +57 -0
- package/dist/components/animate-split/PlAnimateSplit.js +1 -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/PlAnimateTyping.d.ts +3 -2
- package/dist/components/animate-typing/PlAnimateTyping.js +1 -1
- package/dist/components/animate-zoom/PlAnimateZoom.d.ts +2 -2
- package/dist/components/animate-zoom/PlAnimateZoom.js +1 -1
- package/dist/components/app-logo/PlAppLogo.d.ts +78 -0
- package/dist/components/app-logo/PlAppLogo.js +1 -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/PlAreaChart.d.ts +54 -0
- package/dist/components/area-chart/PlAreaChart.js +1 -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/PlAspectRatio.d.ts +2 -1
- package/dist/components/aspect-ratio/PlAspectRatio.js +1 -1
- package/dist/components/avatar/PlAvatar.js +1 -1
- package/dist/components/back-top/PlBackTop.d.ts +2 -1
- package/dist/components/back-top/PlBackTop.js +1 -1
- package/dist/components/badge/PlBadge.js +1 -1
- package/dist/components/bar-chart/PlBarChart.d.ts +63 -0
- package/dist/components/bar-chart/PlBarChart.js +1 -0
- package/dist/components/bar-chart/index.d.ts +2 -0
- package/dist/components/bar-chart/index.js +1 -0
- package/dist/components/bottom-navigation/PlBottomNavigation.d.ts +3 -0
- package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
- package/dist/components/button/PlButton.d.ts +8 -0
- package/dist/components/button/PlButton.js +1 -1
- package/dist/components/button-group/PlButtonGroup.js +1 -1
- package/dist/components/calendar/PlCalendar.js +1 -1
- package/dist/components/card/PlCard.js +1 -1
- package/dist/components/carousel/PlCarousel.d.ts +1 -1
- package/dist/components/carousel/PlCarousel.js +1 -1
- package/dist/components/chat-bubble/PlChatBubble.d.ts +4 -1
- package/dist/components/chat-bubble/PlChatBubble.js +1 -1
- package/dist/components/checkbox/PlCheckbox.js +1 -1
- package/dist/components/chip/PlChip.d.ts +6 -2
- package/dist/components/chip/PlChip.js +1 -1
- package/dist/components/code-block/PlCodeBlock.d.ts +192 -0
- package/dist/components/code-block/PlCodeBlock.js +1 -0
- package/dist/components/code-block/index.d.ts +2 -0
- package/dist/components/code-block/index.js +1 -0
- package/dist/components/color-picker/PlColorPicker.js +1 -1
- package/dist/components/combobox/PlCombobox.d.ts +6 -5
- package/dist/components/combobox/PlCombobox.js +1 -1
- package/dist/components/command-palette/PlCommandPalette.d.ts +6 -2
- package/dist/components/command-palette/PlCommandPalette.js +1 -1
- package/dist/components/confirm/PlConfirmProvider.js +1 -1
- package/dist/components/container/PlContainer.d.ts +22 -6
- package/dist/components/container/PlContainer.js +1 -1
- package/dist/components/data-list/PlDataList.d.ts +74 -0
- package/dist/components/data-list/PlDataList.js +1 -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/PlDataTable.d.ts +216 -0
- package/dist/components/data-table/PlDataTable.js +1 -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/PlDatePicker.js +1 -1
- package/dist/components/date-range-picker/PlDateRangePicker.js +1 -1
- package/dist/components/date-time-picker/PlDateTimePicker.js +1 -1
- package/dist/components/drawer/PlDrawer.d.ts +1 -1
- package/dist/components/drawer/PlDrawer.js +1 -1
- package/dist/components/file-picker/PlFilePicker.d.ts +4 -1
- package/dist/components/file-picker/PlFilePicker.js +1 -1
- package/dist/components/flex/PlFlex.d.ts +83 -0
- package/dist/components/flex/PlFlex.js +1 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +1 -0
- package/dist/components/floating-action-button/PlFloatingActionButton.d.ts +81 -0
- package/dist/components/floating-action-button/PlFloatingActionButton.js +1 -0
- package/dist/components/floating-action-button/index.d.ts +2 -0
- package/dist/components/floating-action-button/index.js +1 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.d.ts +3 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.js +1 -1
- package/dist/components/footer/PlFooter.d.ts +4 -3
- package/dist/components/footer/PlFooter.js +1 -1
- package/dist/components/form/PlForm.js +1 -1
- package/dist/components/gallery/PlGallery.d.ts +192 -0
- package/dist/components/gallery/PlGallery.js +1 -0
- package/dist/components/gallery/PlGalleryViewer.d.ts +31 -0
- package/dist/components/gallery/PlGalleryViewer.js +1 -0
- package/dist/components/gallery/index.d.ts +2 -0
- package/dist/components/gallery/index.js +1 -0
- package/dist/components/gauge-chart/PlGaugeChart.d.ts +64 -0
- package/dist/components/gauge-chart/PlGaugeChart.js +1 -0
- package/dist/components/gauge-chart/index.d.ts +2 -0
- package/dist/components/gauge-chart/index.js +1 -0
- package/dist/components/grid/PlGrid.js +1 -1
- package/dist/components/grid/PlGridItem.js +1 -1
- package/dist/components/header/PlHeader.d.ts +4 -3
- package/dist/components/header/PlHeader.js +1 -1
- package/dist/components/heatmap-chart/PlHeatmapChart.d.ts +69 -0
- package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -0
- package/dist/components/heatmap-chart/index.d.ts +2 -0
- package/dist/components/heatmap-chart/index.js +1 -0
- package/dist/components/highlight/PlHighlight.js +1 -1
- package/dist/components/hot-keys/PlHotKeys.js +1 -1
- package/dist/components/hover-card/PlHoverCard.d.ts +96 -0
- package/dist/components/hover-card/PlHoverCard.js +1 -0
- package/dist/components/hover-card/index.d.ts +2 -0
- package/dist/components/hover-card/index.js +1 -0
- package/dist/components/how-to-steps/PlHowToSteps.d.ts +87 -0
- package/dist/components/how-to-steps/PlHowToSteps.js +1 -0
- package/dist/components/how-to-steps/index.d.ts +2 -0
- package/dist/components/how-to-steps/index.js +1 -0
- package/dist/components/image/PlImage.d.ts +195 -8
- package/dist/components/image/PlImage.js +1 -1
- package/dist/components/image/PlImagePreview.d.ts +58 -0
- package/dist/components/image/PlImagePreview.js +1 -0
- package/dist/components/image/index.d.ts +1 -1
- package/dist/components/line-chart/PlLineChart.d.ts +74 -0
- package/dist/components/line-chart/PlLineChart.js +1 -0
- package/dist/components/line-chart/index.d.ts +2 -0
- package/dist/components/line-chart/index.js +1 -0
- package/dist/components/menu/PlMenu.d.ts +14 -5
- package/dist/components/menu/PlMenu.js +1 -1
- package/dist/components/meter/PlMeter.d.ts +83 -0
- package/dist/components/meter/PlMeter.js +1 -0
- package/dist/components/meter/index.d.ts +2 -0
- package/dist/components/meter/index.js +1 -0
- package/dist/components/mockup/PlMockup.d.ts +146 -0
- package/dist/components/mockup/PlMockup.js +1 -0
- package/dist/components/mockup/index.d.ts +2 -0
- package/dist/components/mockup/index.js +1 -0
- package/dist/components/modal/PlModal.d.ts +1 -1
- package/dist/components/modal/PlModal.js +1 -1
- package/dist/components/navigation-menu/PlNavigationMenu.d.ts +7 -1
- package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
- package/dist/components/number-field/PlNumberField.d.ts +1 -1
- package/dist/components/number-field/PlNumberField.js +1 -1
- package/dist/components/otp-field/PlOtpField.d.ts +6 -0
- package/dist/components/otp-field/PlOtpField.js +1 -1
- package/dist/components/overlay/PlOverlay.d.ts +1 -1
- package/dist/components/overlay/PlOverlay.js +1 -1
- package/dist/components/page-layout/PlPageLayout.js +1 -1
- package/dist/components/pagination/PlPagination.d.ts +12 -9
- package/dist/components/pagination/PlPagination.js +1 -1
- package/dist/components/panes/PlPanes.d.ts +7 -2
- package/dist/components/panes/PlPanes.js +1 -1
- package/dist/components/pie-chart/PlPieChart.d.ts +58 -0
- package/dist/components/pie-chart/PlPieChart.js +1 -0
- package/dist/components/pie-chart/index.d.ts +2 -0
- package/dist/components/pie-chart/index.js +1 -0
- package/dist/components/pill/PlPill.js +1 -1
- package/dist/components/popconfirm/PlPopconfirm.d.ts +1 -1
- package/dist/components/popconfirm/PlPopconfirm.js +1 -1
- package/dist/components/popover/PlPopover.d.ts +6 -6
- package/dist/components/popover/PlPopover.js +1 -1
- package/dist/components/portal/PlPortal.d.ts +78 -0
- package/dist/components/portal/PlPortal.js +1 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +1 -0
- package/dist/components/progress-box/PlProgressBox.js +1 -1
- package/dist/components/progress-circular/PlProgressCircular.js +1 -1
- package/dist/components/progress-linear/PlProgressLinear.js +1 -1
- package/dist/components/radio-group/PlRadioGroup.js +1 -1
- package/dist/components/rating/PlRating.d.ts +1 -1
- package/dist/components/rating/PlRating.js +1 -1
- package/dist/components/scatter-chart/PlScatterChart.d.ts +46 -0
- package/dist/components/scatter-chart/PlScatterChart.js +1 -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/PlScrollArea.d.ts +98 -0
- package/dist/components/scroll-area/PlScrollArea.js +1 -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/PlScrollZone.d.ts +27 -10
- package/dist/components/scroll-zone/PlScrollZone.js +1 -1
- package/dist/components/segmented-button/PlSegmentedButton.js +1 -1
- package/dist/components/select/PlSelect.js +1 -1
- package/dist/components/show/PlShow.d.ts +76 -0
- package/dist/components/show/PlShow.js +1 -0
- package/dist/components/show/index.d.ts +2 -0
- package/dist/components/show/index.js +1 -0
- package/dist/components/sidebar/PlSidebar.js +1 -1
- package/dist/components/sidebar/PlSidebarTrigger.js +1 -1
- package/dist/components/skeleton/PlSkeleton.js +1 -1
- package/dist/components/slider/PlSlider.d.ts +13 -1
- package/dist/components/slider/PlSlider.js +1 -1
- package/dist/components/sparkline/PlSparkline.d.ts +68 -0
- package/dist/components/sparkline/PlSparkline.js +1 -0
- package/dist/components/sparkline/index.d.ts +2 -0
- package/dist/components/sparkline/index.js +1 -0
- package/dist/components/spoiler/PlSpoiler.d.ts +16 -1
- package/dist/components/spoiler/PlSpoiler.js +1 -1
- package/dist/components/stack/PlStack.d.ts +114 -0
- package/dist/components/stack/PlStack.js +1 -0
- package/dist/components/stack/index.d.ts +2 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/stat/PlStat.d.ts +4 -0
- package/dist/components/stat/PlStat.js +1 -1
- package/dist/components/stepper/PlStepper.d.ts +3 -3
- package/dist/components/stepper/PlStepper.js +1 -1
- package/dist/components/switch/PlSwitch.js +1 -1
- package/dist/components/table/PlTable.d.ts +5 -5
- package/dist/components/table/PlTable.js +1 -1
- package/dist/components/tabs/PlTabs.d.ts +27 -2
- package/dist/components/tabs/PlTabs.js +1 -1
- package/dist/components/text-link/PlTextLink.js +1 -1
- package/dist/components/time-picker/PlTimePicker.js +1 -1
- package/dist/components/timeline/PlTimeline.d.ts +2 -2
- package/dist/components/timeline/PlTimeline.js +1 -1
- package/dist/components/timeline-chart/PlTimelineChart.d.ts +44 -0
- package/dist/components/timeline-chart/PlTimelineChart.js +1 -0
- package/dist/components/timeline-chart/index.d.ts +2 -0
- package/dist/components/timeline-chart/index.js +1 -0
- package/dist/components/toast/PlToast.d.ts +1 -1
- package/dist/components/toast/PlToast.js +1 -1
- package/dist/components/toggle/PlToggle.js +1 -1
- package/dist/components/toggle/PlToggleGroup.js +1 -1
- package/dist/components/tooltip/PlTooltip.js +1 -1
- package/dist/components/tour/PlTour.d.ts +134 -0
- package/dist/components/tour/PlTour.js +1 -0
- package/dist/components/tour/index.d.ts +2 -0
- package/dist/components/tour/index.js +1 -0
- package/dist/components/transfer/PlTransfer.d.ts +10 -1
- package/dist/components/transfer/PlTransfer.js +1 -1
- package/dist/components/tree/PlTree.js +1 -1
- package/dist/components/tree-select/PlTreeSelect.d.ts +99 -0
- package/dist/components/tree-select/PlTreeSelect.js +1 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +1 -0
- package/dist/components/typography/PlTypography.js +1 -1
- package/dist/components/window-pane/PlWindowPane.d.ts +179 -0
- package/dist/components/window-pane/PlWindowPane.js +1 -0
- package/dist/components/window-pane/index.d.ts +2 -0
- package/dist/components/window-pane/index.js +1 -0
- package/dist/css/anchor.css +2 -0
- package/dist/css/animate-counter.css +2 -0
- package/dist/css/animate-float.css +2 -0
- package/dist/css/animate-reveal.css +2 -0
- package/dist/css/animate-scramble.css +2 -0
- package/dist/css/animate-shake.css +2 -0
- package/dist/css/animate-split.css +2 -0
- package/dist/css/app-logo.css +2 -0
- package/dist/css/area-chart.css +3 -0
- package/dist/css/back-top.css +2 -0
- package/dist/css/bar-chart.css +3 -0
- package/dist/css/calendar.css +1 -0
- package/dist/css/carousel.css +2 -0
- package/dist/css/code-block.css +2 -0
- package/dist/css/color-picker.css +1 -0
- package/dist/css/combobox.css +1 -0
- package/dist/css/command-palette.css +1 -0
- package/dist/css/confirm.css +2 -0
- package/dist/css/data-list.css +2 -0
- package/dist/css/data-table.css +7 -0
- package/dist/css/date-picker.css +1 -0
- package/dist/css/date-range-picker.css +1 -0
- package/dist/css/date-time-picker.css +1 -0
- package/dist/css/flex.css +2 -0
- package/dist/css/floating-action-button.css +4 -0
- package/dist/css/gallery.css +7 -0
- package/dist/css/gauge-chart.css +3 -0
- package/dist/css/heatmap-chart.css +3 -0
- package/dist/css/hover-card.css +2 -0
- package/dist/css/how-to-steps.css +2 -0
- package/dist/css/icon-button.css +1 -0
- package/dist/css/image.css +2 -0
- package/dist/css/line-chart.css +3 -0
- package/dist/css/menubar.css +1 -0
- package/dist/css/meter.css +2 -0
- package/dist/css/mockup.css +2 -0
- package/dist/css/pagination.css +1 -0
- package/dist/css/pie-chart.css +3 -0
- package/dist/css/popconfirm.css +2 -0
- package/dist/css/portal.css +2 -0
- package/dist/css/scatter-chart.css +3 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/scroll-zone.css +2 -0
- package/dist/css/show.css +2 -0
- package/dist/css/sidebar.css +3 -0
- package/dist/css/sparkline.css +3 -0
- package/dist/css/spoiler.css +1 -0
- package/dist/css/stack.css +2 -0
- package/dist/css/stat.css +1 -0
- package/dist/css/time-picker.css +1 -0
- package/dist/css/timeline-chart.css +3 -0
- package/dist/css/tour.css +3 -0
- package/dist/css/transfer.css +4 -0
- package/dist/css/tree-select.css +4 -0
- package/dist/css/window-pane.css +2 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/usePlBreakpoint.d.ts +3 -0
- package/dist/hooks/usePlBreakpoint.js +1 -1
- package/dist/hooks/usePlDisclosure.d.ts +44 -0
- package/dist/hooks/usePlDisclosure.js +1 -0
- package/dist/hooks/usePlElementSize.d.ts +34 -0
- package/dist/hooks/usePlElementSize.js +1 -0
- package/dist/hooks/usePlHotKeys.d.ts +5 -1
- package/dist/hooks/usePlHotKeys.js +1 -1
- package/dist/hooks/usePlOnScreen.d.ts +54 -0
- package/dist/hooks/usePlOnScreen.js +1 -0
- package/dist/index.d.ts +34 -1
- package/dist/index.js +1 -1
- package/dist/internal/animate.d.ts +121 -7
- package/dist/internal/animate.js +1 -1
- package/dist/internal/breakpoints.d.ts +31 -0
- package/dist/internal/breakpoints.js +1 -0
- package/dist/internal/button-group.d.ts +29 -2
- package/dist/internal/button-group.js +2 -2
- package/dist/internal/calendar.d.ts +11 -36
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +462 -0
- package/dist/internal/chart-frame.js +1 -0
- package/dist/internal/chart-line.d.ts +44 -0
- package/dist/internal/chart-line.js +1 -0
- package/dist/internal/chart.d.ts +551 -0
- package/dist/internal/chart.js +1 -0
- package/dist/internal/color-scheme.js +1 -1
- package/dist/internal/data-table.d.ts +70 -0
- package/dist/internal/data-table.js +1 -0
- package/dist/internal/date.d.ts +10 -0
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +8 -3
- package/dist/internal/drag.d.ts +65 -0
- package/dist/internal/drag.js +1 -0
- package/dist/internal/focusable.d.ts +8 -0
- package/dist/internal/focusable.js +1 -0
- package/dist/internal/form.d.ts +61 -0
- package/dist/internal/form.js +1 -0
- package/dist/internal/format.d.ts +2 -0
- package/dist/internal/format.js +1 -1
- package/dist/internal/gallery.d.ts +80 -0
- package/dist/internal/gallery.js +1 -0
- package/dist/internal/glow.d.ts +17 -0
- package/dist/internal/glow.js +1 -0
- package/dist/internal/grid.d.ts +6 -27
- package/dist/internal/grid.js +1 -1
- package/dist/internal/highlight.d.ts +98 -0
- package/dist/internal/highlight.js +1 -0
- package/dist/internal/icons.d.ts +10 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/image.d.ts +94 -0
- package/dist/internal/image.js +1 -0
- package/dist/internal/inert.d.ts +19 -0
- package/dist/internal/inert.js +1 -0
- package/dist/internal/keys.d.ts +19 -0
- package/dist/internal/keys.js +1 -1
- package/dist/internal/labels.d.ts +182 -0
- package/dist/internal/labels.js +1 -0
- package/dist/internal/link.d.ts +17 -0
- package/dist/internal/link.js +1 -1
- package/dist/internal/mockup.d.ts +193 -0
- package/dist/internal/mockup.js +1 -0
- package/dist/internal/page-layout.d.ts +14 -7
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +43 -6
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +22 -8
- package/dist/internal/progress.js +1 -1
- package/dist/internal/responsive.d.ts +108 -0
- package/dist/internal/responsive.js +1 -0
- package/dist/internal/scramble.d.ts +35 -0
- package/dist/internal/scramble.js +1 -0
- package/dist/internal/scroll-target.d.ts +5 -0
- package/dist/internal/scroll-target.js +1 -0
- package/dist/internal/steps.js +1 -1
- package/dist/internal/styles.d.ts +81 -0
- package/dist/internal/styles.js +1 -1
- package/dist/internal/table.d.ts +86 -0
- package/dist/internal/table.js +1 -0
- package/dist/internal/text.d.ts +39 -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/tour.d.ts +42 -0
- package/dist/internal/tour.js +1 -0
- package/dist/internal/watermark.d.ts +44 -0
- package/dist/internal/watermark.js +1 -0
- package/dist/internal/wheel.d.ts +52 -0
- package/dist/internal/wheel.js +1 -0
- package/dist/internal/window.d.ts +201 -0
- package/dist/internal/window.js +1 -0
- package/dist/locales/de.d.ts +3 -0
- package/dist/locales/de.js +1 -0
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/es.d.ts +3 -0
- package/dist/locales/es.js +1 -0
- package/dist/locales/fr.d.ts +3 -0
- package/dist/locales/fr.js +1 -0
- package/dist/locales/index.d.ts +33 -0
- package/dist/locales/index.js +1 -0
- package/dist/locales/ja.d.ts +3 -0
- package/dist/locales/ja.js +1 -0
- package/dist/locales/ko.d.ts +3 -0
- package/dist/locales/ko.js +1 -0
- package/dist/locales/zh-Hans.d.ts +3 -0
- package/dist/locales/zh-Hans.js +1 -0
- package/dist/provider/PlColorSchemeScript.js +1 -1
- package/dist/provider/PlassProvider.js +1 -1
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1357 -25
- package/dist/tokens.css +1357 -25
- package/dist/types.d.ts +368 -2
- package/package.json +26 -16
- package/dist/components/avatar-group/PlAvatarGroup.d.ts +0 -47
- package/dist/components/avatar-group/PlAvatarGroup.js +0 -1
- package/dist/components/avatar-group/index.d.ts +0 -2
- package/dist/components/avatar-group/index.js +0 -1
- package/dist/css/avatar-group.css +0 -2
- package/dist/internal/avatar-group.d.ts +0 -25
- package/dist/internal/avatar-group.js +0 -2
package/README.md
CHANGED
|
@@ -4,23 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://github.com/jooy2/plass-ui/blob/main/LICENSE) [](https://www.npmjs.com/package/plass-ui) [](https://www.npmjs.com/package/plass-ui)
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### [**plass.cdget.com**](https://plass.cdget.com)
|
|
8
8
|
|
|
9
|
-
Live previews and full props for every component
|
|
9
|
+
Live previews and full props for every component. Pick **React** in the sidebar. This README is just the quick start.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
> **Plass is one design language, shipped as two libraries.**
|
|
13
|
+
> **Plass is one design language, shipped as two libraries.** 127 components made of tinted glass and gradients, in React and in Flutter, under the same names and the same numbers. React adds three more for problems only the DOM has.
|
|
14
|
+
>
|
|
15
|
+
> Every surface answers one question: is this pressed, or does it hold something? A thing you press is a tinted pane, filled with a gradient that turns through its colour family and lit by a bloom that follows your pointer. A thing that holds something is clear glass: translucent, deeply blurred, never dyed. Nothing is bevelled or embossed, and depth is carried by light, colour and blur.
|
|
14
16
|
|
|
15
|
-
This is the React half. The [Flutter package](https://pub.dev/packages/plass_ui) is the other one, and the two hold the same components under the same names, the same prop vocabulary and the same numbers. They version independently, so this package's number and the pub.dev one's will not always agree.
|
|
17
|
+
This is the React half. The [Flutter package](https://pub.dev/packages/plass_ui) is the other one, and the two hold the same 127 components under the same names, the same prop vocabulary and the same numbers. They version independently, so this package's number and the pub.dev one's will not always agree.
|
|
16
18
|
|
|
17
19
|
- **Finished the moment it is installed.** The gradients, the shadows, the blur, the focus ring and the press response are already decided and already agree with each other. One CSS import and the first screen looks like something.
|
|
18
|
-
- **Five props, not fifty.** `size`, `color`, `variant`, `density` and `elevation` mean the same thing on every component
|
|
20
|
+
- **Five props, not fifty.** `size`, `color`, `variant`, `density` and `elevation` mean the same thing on every component (an `md` control is 40px, `primary` is the same family), so the tenth one costs nothing to learn after the first.
|
|
19
21
|
- **Readable because it was measured.** Every gradient stop clears 4.5:1 against its own label, the lightest corner included. A colour choice here is not a contrast bug waiting for an audit.
|
|
20
22
|
- **Accessible without the checklist.** Real roles, labels, focus management and keyboard support, not `div`s with click handlers.
|
|
21
23
|
- **Dark mode you do not write.** Follows `prefers-color-scheme`, and can be forced either way on any subtree. No second palette, no colours redeclared.
|
|
22
24
|
- **Types in the box.** TypeScript declarations ship with the package, so your editor knows the prop names and the values they take before you do.
|
|
23
|
-
- **Nothing you did not ask for.** ESM only, tree-shakeable,
|
|
25
|
+
- **Nothing you did not ask for.** ESM only, tree-shakeable, two runtime dependencies (`@base-ui/react` and `highlight.js`), and an entry point per component for a build that cannot shake a barrel.
|
|
24
26
|
|
|
25
27
|
## Install
|
|
26
28
|
|
|
@@ -28,7 +30,7 @@ This is the React half. The [Flutter package](https://pub.dev/packages/plass_ui)
|
|
|
28
30
|
npm install plass-ui
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
`react` and `react-dom` are peer dependencies
|
|
33
|
+
`react` and `react-dom` are peer dependencies, React 18 or 19. Node.js 20.19 or later.
|
|
32
34
|
|
|
33
35
|
### Setup
|
|
34
36
|
|
|
@@ -38,7 +40,7 @@ Add one line to your app's CSS entry point:
|
|
|
38
40
|
@import 'plass-ui/styles.css';
|
|
39
41
|
```
|
|
40
42
|
|
|
41
|
-
`plass-ui/styles.css` is finished CSS
|
|
43
|
+
`plass-ui/styles.css` is finished CSS, the design tokens, the compiled rules for every utility class the components use, and a small reset whose every rule is specificity 0 so your own styles always win. [Tailwind CSS](https://tailwindcss.com) v4 builds this package; it does not have to be installed in yours.
|
|
42
44
|
|
|
43
45
|
If your project already runs Tailwind v4, import the token sheet instead:
|
|
44
46
|
|
|
@@ -47,7 +49,7 @@ If your project already runs Tailwind v4, import the token sheet instead:
|
|
|
47
49
|
@import 'plass-ui/tailwind.css';
|
|
48
50
|
```
|
|
49
51
|
|
|
50
|
-
`plass-ui/tailwind.css` registers all
|
|
52
|
+
`plass-ui/tailwind.css` registers all 130 components with Tailwind, because Tailwind scans files rather than imports, nothing in a build connects `import { PlButton }` to the classes `PlSelect.js` spells out. A project that uses a handful of components can register the handful instead:
|
|
51
53
|
|
|
52
54
|
```css
|
|
53
55
|
@import 'tailwindcss';
|
|
@@ -56,11 +58,11 @@ If your project already runs Tailwind v4, import the token sheet instead:
|
|
|
56
58
|
@import 'plass-ui/css/text-field.css';
|
|
57
59
|
```
|
|
58
60
|
|
|
59
|
-
Still one Tailwind pass, so the utilities keep Tailwind's own order
|
|
61
|
+
Still one Tailwind pass, so the utilities keep Tailwind's own order, and about 5 kB gzipped smaller for a small set of components. There is one manifest per component, named after its folder in `dist/components`.
|
|
60
62
|
|
|
61
63
|
### The page under the components
|
|
62
64
|
|
|
63
|
-
Plass draws controls and sheets. It does not paint your `<body
|
|
65
|
+
Plass draws controls and sheets. It does not paint your `<body>`, but a sheet of glass over a flat white page has nothing to be in front of, and every translucent surface in the library will read as opaque. Two tokens exist for exactly this:
|
|
64
66
|
|
|
65
67
|
```css
|
|
66
68
|
body {
|
|
@@ -92,7 +94,7 @@ export default function SignIn() {
|
|
|
92
94
|
|
|
93
95
|
### One entry point per component
|
|
94
96
|
|
|
95
|
-
Every component also has an entry point of its own, for a build that cannot tree-shake a barrel
|
|
97
|
+
Every component also has an entry point of its own, for a build that cannot tree-shake a barrel, or for a server render, where the barrel loads all 130 components and their dependencies before the first one is used:
|
|
96
98
|
|
|
97
99
|
```tsx
|
|
98
100
|
import { PlButton } from 'plass-ui/button';
|
|
@@ -102,19 +104,19 @@ Same component, same types. The barrel is the one to reach for by default; this
|
|
|
102
104
|
|
|
103
105
|
### Next.js and server components
|
|
104
106
|
|
|
105
|
-
Nearly every component carries `'use client'`, so a Server Component can import one directly and there is nothing to configure
|
|
107
|
+
Nearly every component carries `'use client'`, so a Server Component can import one directly and there is nothing to configure, no `transpilePackages`, no `next.config` entry, no provider. What the directive cannot do is carry a function across the server boundary: a file that passes `onClick`, `onValueChange` or `render` needs its own `'use client'`, which is React's rule for every client component rather than this library's. Outside a server-component graph the directive is inert.
|
|
106
108
|
|
|
107
109
|
`PlTable` is the exception and has no directive, because that rule would otherwise have cost it its own API: every column is a `render` callback, and a table belongs on a page that fetches its own rows. A Server Component renders it whole; a client module that imports it gets a client component, as it does for anything else it imports.
|
|
108
110
|
|
|
109
111
|
### Dark mode
|
|
110
112
|
|
|
111
|
-
Follows `prefers-color-scheme` with no configuration. To force it either way, put `.dark` / `.light`
|
|
113
|
+
Follows `prefers-color-scheme` with no configuration. To force it either way, put `.dark` / `.light` (or `[data-theme='dark']` / `[data-theme='light']`) on any ancestor, `<html>` included.
|
|
112
114
|
|
|
113
115
|
One thing does **not** change with the theme, and it is deliberate: the colour of a key. What changes is the sheet it rests on.
|
|
114
116
|
|
|
115
117
|
## Components
|
|
116
118
|
|
|
117
|
-
Every component is exported under a `Pl` prefix
|
|
119
|
+
Every component is exported under a `Pl` prefix. `Button`, `Card` and `Table` are the most-taken identifiers in the ecosystem, and a consumer should not have to alias ours on import.
|
|
118
120
|
|
|
119
121
|
### Display
|
|
120
122
|
|
|
@@ -150,14 +152,14 @@ This package is installed and run from its own folder; there is no install at th
|
|
|
150
152
|
|
|
151
153
|
```bash
|
|
152
154
|
npm install
|
|
153
|
-
npm test # Vitest,
|
|
155
|
+
npm test # Vitest, three shards of headless Chromium
|
|
154
156
|
npm run typecheck # tsc --noEmit over both TS projects
|
|
155
157
|
npm run build # tsc + terser + build-styles → dist/
|
|
156
158
|
npm run lint # ESLint
|
|
157
159
|
npm run size # what the package costs, packed and installed
|
|
158
160
|
```
|
|
159
161
|
|
|
160
|
-
The documentation site lives at the repository root, in [`docs/`](https://github.com/jooy2/plass-ui/tree/main/docs), and renders these components from `src/` through a Vite alias
|
|
162
|
+
The documentation site lives at the repository root, in [`docs/`](https://github.com/jooy2/plass-ui/tree/main/docs), and renders these components from `src/` through a Vite alias, so `cd docs && npm run dev` is the develop-and-eyeball loop and there is no separate demo app. [CONTRIBUTING.md](https://github.com/jooy2/plass-ui/blob/main/CONTRIBUTING.md) has the rest.
|
|
161
163
|
|
|
162
164
|
## License
|
|
163
165
|
|
|
@@ -60,7 +60,7 @@ export interface PlAccordionItemProps extends Omit<React.ComponentPropsWithoutRe
|
|
|
60
60
|
/** Content before the title — an icon, a status dot, a count. */
|
|
61
61
|
startIcon?: React.ReactNode;
|
|
62
62
|
/**
|
|
63
|
-
* A control pinned to the end of the header,
|
|
63
|
+
* A control pinned to the end of the header, after the chevron.
|
|
64
64
|
*
|
|
65
65
|
* Deliberately outside the trigger: a header that both folds and holds a
|
|
66
66
|
* switch has two things to press, and one of them cannot be nested inside the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as s,jsxs as e}from"react/jsx-runtime";import*as l from"react";import{useDefaults as t}from"../../internal/defaults.js";import{CloseIcon as
|
|
1
|
+
"use client";import{jsx as s,jsxs as e}from"react/jsx-runtime";import*as l from"react";import{useDefaults as t}from"../../internal/defaults.js";import{useLabels as a}from"../../internal/labels.js";import{CloseIcon as i,severityIcon as r}from"../../internal/icons.js";import{controlSlots as o,focusRingClasses as n,forcedFieldEdgeClasses as c,glassClasses as d,hasContent as m,iconClasses as f,radiusClasses as p,sheetBodyClasses as u,sheetHeaderGapClasses as h,sheetPaddingXClasses as v,sheetPaddingYClasses as x,sheetSectionGapClasses as g,sheetTitleClasses as b,transitionClasses as y}from"../../internal/styles.js";const j={solid:/* @__PURE__ */["text-(--p-on-solid) [background-image:var(--p-fill)]","[box-shadow:var(--p-elev),var(--p-lift)]",c].join(" "),glass:/* @__PURE__ */[d,"border text-(--plass-fg) bg-(--plass-glass)","[border-color:var(--p-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--plass-fg) bg-(--p-soft)"},N={solid:"",glass:"text-(--p-accent)",ghost:"text-(--p-accent)"},w={solid:"",glass:"text-(--plass-muted-fg)",ghost:"text-(--plass-muted-fg)"},k={primary:"status",secondary:"status",info:"status",success:"status",warning:"alert",danger:"alert"};export const PlAlert=/* @__PURE__ */l.forwardRef(function PlAlert({variant:l="glass",size:c,color:d,density:$,elevation:z=0,title:A,icon:C,action:P,onClose:_,closeLabel:B,className:L,style:R,children:q,...D},E){const F=t(),G=a(),H=B??G.dismiss,I=c??F.size??"md",J=d??F.color??"info",K=$??F.density??"default",M=void 0===C?r(J):C,O=N[l],Q=m(A);return e("div",{ref:E,role:k[J],className:["flex w-full items-start",v[K][I],x[K][I],p[I],g[I],u[I],y,j[l],f,L??""].filter(Boolean).join(" "),style:{...o(J,z,l),...R},...D,children:[m(M)?s("span",{className:`flex h-[1lh] shrink-0 items-center ${O}`,children:M}):null,e("div",{className:`flex min-w-0 flex-1 flex-col ${h[I]}`,children:[Q?s("div",{className:`plass-title font-semibold ${b[I]} ${O}`,children:A}):null,m(q)?s("div",{className:Q?w[l]:void 0,children:q}):null]}),m(P)?s("div",{className:"flex h-[1lh] shrink-0 items-center",children:P}):null,_?s("span",{className:"flex h-[1lh] shrink-0 items-center",children:s("button",{type:"button","aria-label":H,onClick:_,className:["inline-flex size-[1.15em] cursor-pointer items-center justify-center rounded-full","opacity-70 [transition:opacity_var(--plass-duration)_var(--plass-ease)]","hover:opacity-100 focus-visible:opacity-100",n].join(" "),children:s(i,{})})}):null]})});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassColor, PlassSize } from '../../types.js';
|
|
3
|
+
import type { PlBackTopTarget } from '../back-top/PlBackTop.js';
|
|
4
|
+
/** One heading in the list. */
|
|
5
|
+
export interface PlAnchorItem {
|
|
6
|
+
/**
|
|
7
|
+
* The fragment it points at — `#getting-started`. The `id` it names is what
|
|
8
|
+
* the list watches, so a heading with no `id` cannot be tracked.
|
|
9
|
+
*/
|
|
10
|
+
href: string;
|
|
11
|
+
/** What the row says. */
|
|
12
|
+
label: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* How deep the heading sits, from `0`. Only the indent depends on it.
|
|
15
|
+
* @default 0
|
|
16
|
+
*/
|
|
17
|
+
depth?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface PlAnchorProps extends Omit<React.ComponentPropsWithoutRef<'nav'>, 'onSelect'> {
|
|
20
|
+
/** The headings, in the order they appear in the document. */
|
|
21
|
+
items: readonly PlAnchorItem[];
|
|
22
|
+
/**
|
|
23
|
+
* The `href` of the row that is lit, taking the tracking over.
|
|
24
|
+
*
|
|
25
|
+
* For a list driven by a router rather than by the scroll — a documentation
|
|
26
|
+
* site whose sections are separate pages, say. Leaving it out is the ordinary
|
|
27
|
+
* case and the reason the component exists.
|
|
28
|
+
*/
|
|
29
|
+
active?: string;
|
|
30
|
+
/**
|
|
31
|
+
* How far below the top of `target` the reading line sits, in pixels.
|
|
32
|
+
*
|
|
33
|
+
* The height of whatever is pinned over the page. Without it a heading goes
|
|
34
|
+
* on counting as the *next* one after it has already slid out of sight behind
|
|
35
|
+
* a sticky header — so the list stays a section behind the reader for the
|
|
36
|
+
* height of the bar.
|
|
37
|
+
* @default 0
|
|
38
|
+
*/
|
|
39
|
+
offset?: number;
|
|
40
|
+
/**
|
|
41
|
+
* What scrolls the headings. The window by default; a ref or an element for
|
|
42
|
+
* an app shell whose `<main>` scrolls on its own.
|
|
43
|
+
*
|
|
44
|
+
* The window of such a shell never moves, so a list following it would light
|
|
45
|
+
* nothing however far the reader went.
|
|
46
|
+
*/
|
|
47
|
+
target?: PlBackTopTarget;
|
|
48
|
+
/** Called with the item that was clicked, before the browser moves. */
|
|
49
|
+
onSelect?: (item: PlAnchorItem, event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
50
|
+
/** A heading for the list itself. Drawn above it. */
|
|
51
|
+
label?: React.ReactNode;
|
|
52
|
+
/** Accessible name of the navigation region. Never drawn. @default 'On this page' */
|
|
53
|
+
navLabel?: string;
|
|
54
|
+
/** @default 'sm' */
|
|
55
|
+
size?: PlassSize;
|
|
56
|
+
/** The family the lit row takes. @default 'primary' */
|
|
57
|
+
color?: PlassColor;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A table of contents that follows the reader down the page.
|
|
61
|
+
*
|
|
62
|
+
* It takes its headings as **data** rather than as children, which is the
|
|
63
|
+
* opposite of most of this library and the right way round here: a table of
|
|
64
|
+
* contents is generated — from a Markdown file, from a CMS, from the document's
|
|
65
|
+
* own headings — and the thing that generates it produces a flat list, in
|
|
66
|
+
* document order, with a level on each entry.
|
|
67
|
+
*
|
|
68
|
+
* **It is a flat list and not a nested one**, and that is a decision rather
|
|
69
|
+
* than a shortcut. Real documents skip levels — an `h2` followed by an `h4` —
|
|
70
|
+
* so a nesting built from a flat list is a guess at a shape nobody wrote. The
|
|
71
|
+
* depth is carried by the indent, and the reading order is the document's own.
|
|
72
|
+
*
|
|
73
|
+
* The tracking is the component. What is lit is **the last heading whose top has
|
|
74
|
+
* passed the reading line**, not whichever heading happens to be on screen:
|
|
75
|
+
* three can be visible at once, and the one the reader is inside is the highest
|
|
76
|
+
* of them that is already above them. `offset` is where that line sits, and it
|
|
77
|
+
* is the height of whatever is pinned over the page — without it a heading goes
|
|
78
|
+
* on counting as the next one after it has slid out of sight behind the bar,
|
|
79
|
+
* and the list stays a section behind.
|
|
80
|
+
*
|
|
81
|
+
* `target` is what is scrolled, the window unless it says otherwise. An app
|
|
82
|
+
* shell whose `<main>` scrolls on its own never moves the window, and the line
|
|
83
|
+
* is measured from the top of that element instead.
|
|
84
|
+
*/
|
|
85
|
+
export declare const PlAnchor: React.ForwardRefExoticComponent<PlAnchorProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{useDefaults as n}from"../../internal/defaults.js";import{resolveScrollTarget as s}from"../../internal/scroll-target.js";import{useLabels as o}from"../../internal/labels.js";import{controlTextLeadingClasses as l,cx as a,focusRingClasses as i,surfaceSlots as c,transitionClasses as m}from"../../internal/styles.js";export const PlAnchor=/* @__PURE__ */r.forwardRef(function PlAnchor({items:f,active:d,offset:p=0,target:u,onSelect:h,label:g,navLabel:v,size:x,color:b,className:w,style:j,...y},E){const N=n(),A=o(),L=v??A.onThisPage,z=x??N.size??"sm",H=b??N.color??"primary",[B,C]=r.useState(void 0),P=void 0!==d;r.useEffect(()=>{if(P)return;const e=s(u);if(!e)return;let t=0;const measure=()=>{t=0,C(function readingAt(e,t,r){if(0===e.length)return;const n=r instanceof Window,s=n?document.documentElement.scrollHeight:r.scrollHeight,o=n?window.innerHeight:r.clientHeight,l=n?window.scrollY:r.scrollTop;if(s>o+1&&o+l>=s-2)return e[e.length-1].href;const a=n?0:r.getBoundingClientRect().top+r.clientTop;let i;for(const r of e){const e=document.getElementById(r.href.replace(/^#/,""));e&&e.getBoundingClientRect().top-a-t<=1&&(i=r.href)}return i}(f,p,e))},onScroll=()=>{t||=requestAnimationFrame(measure)};return measure(),e.addEventListener("scroll",onScroll,{passive:!0}),window.addEventListener("resize",onScroll,{passive:!0}),()=>{t&&cancelAnimationFrame(t),e.removeEventListener("scroll",onScroll),window.removeEventListener("resize",onScroll)}},[P,f,p,u]);const R=P?d:B;return t("nav",{ref:E,"aria-label":L,className:a("flex flex-col gap-2",l[z],w),style:{...c(H,0),...j},...y,children:[g?e("span",{className:"font-semibold text-(--plass-fg)",children:g}):null,e("ul",{className:"m-0 flex list-none flex-col gap-0.5 p-0",children:f.map(t=>{const r=t.href===R;return e("li",{className:"min-w-0",children:e("a",{href:t.href,"aria-current":r?"location":void 0,onClick:e=>h?.(t,e),className:a("block truncate rounded-(--plass-radius-xs) px-2 py-1","border-s-2",m,i,r?"[border-color:var(--p-accent)] bg-(--p-soft) font-medium text-(--p-accent)":"border-transparent text-(--plass-muted-fg) hover:bg-(--plass-glass-hover) hover:text-(--plass-fg)"),style:{paddingInlineStart:`calc(0.5rem + ${t.depth??0} * 0.75rem)`},children:t.label})},t.href)})})]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlAnchor}from"./PlAnchor.js";
|
|
@@ -5,9 +5,19 @@ export interface PlAnimateAppearProps extends PlassAnimateProps, React.Component
|
|
|
5
5
|
/**
|
|
6
6
|
* How long after one child the next one starts, in milliseconds. This is the
|
|
7
7
|
* whole effect — everything else is what a single child does.
|
|
8
|
+
*
|
|
9
|
+
* The same prop the six single-keyframe effects take, and the same machinery
|
|
10
|
+
* under it; what differs is the default, because a stagger of `0` on a set is
|
|
11
|
+
* a set that is not a set.
|
|
8
12
|
* @default 70
|
|
9
13
|
*/
|
|
10
14
|
stagger?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Milliseconds added to each child's duration, so later children take longer
|
|
17
|
+
* — or, negative, less long. Floored at `0`.
|
|
18
|
+
* @default 0
|
|
19
|
+
*/
|
|
20
|
+
durationStep?: number;
|
|
11
21
|
/**
|
|
12
22
|
* Which edge each child drifts in from.
|
|
13
23
|
* @default 'bottom'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import
|
|
1
|
+
"use client";import*as e from"react";import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as r}from"@base-ui/react/use-render";import{animBaseClass as t,animateChildren as n,animationClasses as s,animationSlots as i,isInfinite as o,slideOffsets as p,staggerSlots as d,useAnimationRun as l}from"../../internal/animate.js";export const PlAnimateAppear=/* @__PURE__ */e.forwardRef(function PlAnimateAppear({duration:e=380,delay:m=0,easing:c,repeat:u=1,alternate:f,paused:g,trigger:y="mount",play:h,once:x=!0,threshold:A=.2,stagger:b=70,durationStep:v=0,from:N="bottom",distance:P="0.75rem",fade:S=!0,reverse:$=!1,render:j,className:w,style:R,children:k,...q},z){const B=l({trigger:y,play:h,once:x,threshold:A,paused:g,infinite:o(u)}),{x:C,y:D}=p(N,P),E=n(k,`${t} ${s.slide}`,(a,r)=>i(d({duration:e,delay:m,easing:c,repeat:u,alternate:f,x:C,y:D,opacity:S?0:1},{index:a,count:r,stagger:b,durationStep:v,reverse:$})));return r({render:j,ref:[z,B.ref],props:{...a(q,B.handlers),className:w,style:{"--p-anim-state":B.state,...R},"data-plass-animation":"appear","data-state":B.state,children:E}})});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { PlassAnimateProps } from '../../types.js';
|
|
4
|
-
export interface PlAnimateBlinkProps extends PlassAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { PlassAnimateProps, PlassAnimateStaggerProps, PlassAnimateTimelineProps } from '../../types.js';
|
|
4
|
+
export interface PlAnimateBlinkProps extends PlassAnimateProps, PlassAnimateStaggerProps, PlassAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* How faint it gets at the bottom of the cycle, between `0` and `1`. Raise it
|
|
7
7
|
* for something that has to stay readable while it pulses.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{
|
|
1
|
+
"use client";import*as e from"react";import{mergeProps as r}from"@base-ui/react/merge-props";import{useRender as t}from"@base-ui/react/use-render";import{isInfinite as n,useAnimateElement as a}from"../../internal/animate.js";import{cx as i}from"../../internal/styles.js";export const PlAnimateBlink=/* @__PURE__ */e.forwardRef(function PlAnimateBlink({duration:e=1e3,delay:s=0,easing:l,repeat:o="infinite",alternate:m,paused:p,trigger:c="mount",play:d,once:f=!0,threshold:g=.2,timeline:u,range:y,stagger:h=0,durationStep:b=0,reverse:k=!1,min:N=0,render:j,className:v,style:A,children:B,...P},S){const w=a({effect:"blink",duration:e,delay:s,easing:l,repeat:o,alternate:m,opacity:N,trigger:c,play:d,once:f,threshold:g,paused:p,infinite:n(o),timeline:u,range:y,stagger:h,durationStep:b,reverse:k,children:B});return t({render:j,ref:[S,w.ref],props:{...r(P,w.props),className:i(w.className,v),style:{...w.style,...A},children:w.children}})});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassAnimateTrigger } from '../../types.js';
|
|
4
|
+
export interface PlAnimateCounterProps extends Omit<React.ComponentPropsWithoutRef<'span'>, 'children'> {
|
|
5
|
+
/** The number it arrives at, and the one a screen reader is told. */
|
|
6
|
+
value: number;
|
|
7
|
+
/**
|
|
8
|
+
* The number it starts from.
|
|
9
|
+
* @default 0
|
|
10
|
+
*/
|
|
11
|
+
from?: number;
|
|
12
|
+
/**
|
|
13
|
+
* How long the count takes, in milliseconds.
|
|
14
|
+
* @default 1200
|
|
15
|
+
*/
|
|
16
|
+
duration?: number;
|
|
17
|
+
/** How long it waits before starting, in milliseconds. @default 0 */
|
|
18
|
+
delay?: number;
|
|
19
|
+
/**
|
|
20
|
+
* How the number is written — `Intl.NumberFormat` options, so a currency, a
|
|
21
|
+
* percentage or a compact `1.2M` all work.
|
|
22
|
+
*
|
|
23
|
+
* This is the reason the count is JavaScript rather than a `@property` and a
|
|
24
|
+
* CSS counter, which is otherwise the neater way to animate a number: CSS can
|
|
25
|
+
* tick a value, and it cannot put a thousands separator in one.
|
|
26
|
+
*/
|
|
27
|
+
format?: Intl.NumberFormatOptions;
|
|
28
|
+
/**
|
|
29
|
+
* The shape of the count, as a function from `0`…`1` to `0`…`1`.
|
|
30
|
+
*
|
|
31
|
+
* A function rather than a CSS easing string, and not for want of trying: no
|
|
32
|
+
* CSS animation is running here, so there is nothing to hand a string to. It
|
|
33
|
+
* eases out by default, which is what a number arriving should do — quick
|
|
34
|
+
* enough to read as counting, slow enough at the end to land on the figure
|
|
35
|
+
* rather than snap to it.
|
|
36
|
+
*/
|
|
37
|
+
easing?: (t: number) => number;
|
|
38
|
+
/**
|
|
39
|
+
* What starts the count.
|
|
40
|
+
*
|
|
41
|
+
* **`visible` by default**, and it is the one component in the library that
|
|
42
|
+
* does not start on mount. That is deliberate rather than an oversight: an
|
|
43
|
+
* entrance played off screen has still delivered its content, and a count
|
|
44
|
+
* that ran off screen delivered a number that was simply already there. A
|
|
45
|
+
* counter is the one effect whose whole point is being watched.
|
|
46
|
+
* @default 'visible'
|
|
47
|
+
*/
|
|
48
|
+
trigger?: PlassAnimateTrigger;
|
|
49
|
+
/** Runs it, when `trigger` is `manual`. */
|
|
50
|
+
play?: boolean;
|
|
51
|
+
/** With `visible`, whether it counts only the first time. @default true */
|
|
52
|
+
once?: boolean;
|
|
53
|
+
/** With `visible`, how much has to be on screen to count. @default 0.2 */
|
|
54
|
+
threshold?: number;
|
|
55
|
+
/** Holds the count where it is. */
|
|
56
|
+
paused?: boolean;
|
|
57
|
+
/** Renders something other than a `<span>`. Base UI's own escape hatch. */
|
|
58
|
+
render?: useRender.RenderProp;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A number counting up to what it is.
|
|
62
|
+
*
|
|
63
|
+
* The one effect in the group that animates **content** rather than a box: what
|
|
64
|
+
* moves is the figure itself, one frame at a time, from `from` to `value`.
|
|
65
|
+
*
|
|
66
|
+
* It is JavaScript and not a keyframe, and the reason is formatting. A
|
|
67
|
+
* registered custom property and a CSS counter can tick a number perfectly
|
|
68
|
+
* well — and cannot put a thousands separator in one, or a currency symbol, or
|
|
69
|
+
* fold 1,200,000 into `1.2M`. A counter that cannot be formatted is a counter
|
|
70
|
+
* nobody can use on a dashboard, so `Intl.NumberFormat` decides what is drawn
|
|
71
|
+
* and the frame loop only decides which number it is drawing.
|
|
72
|
+
*
|
|
73
|
+
* **It starts when it is seen, not when it mounts**, which is the one place a
|
|
74
|
+
* `PlAnimate*` here departs from the rest. An entrance played off screen has
|
|
75
|
+
* still delivered its content; a count that ran off screen delivered a number
|
|
76
|
+
* that was already sitting there when the reader arrived.
|
|
77
|
+
*
|
|
78
|
+
* **What a screen reader hears is the final number, once.** The ticking figure
|
|
79
|
+
* is `aria-hidden` and the answer is beside it in a clipped span, because a
|
|
80
|
+
* number changing sixty times a second in the accessibility tree is either
|
|
81
|
+
* silence or sixty announcements, and neither is the figure.
|
|
82
|
+
*/
|
|
83
|
+
export declare const PlAnimateCounter: React.ForwardRefExoticComponent<PlAnimateCounterProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,Fragment as r,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as s}from"@base-ui/react/use-render";import{useAnimationRun as i}from"../../internal/animate.js";import{useDefaults as o}from"../../internal/defaults.js";import{usePrefersReducedMotion as u}from"../../internal/media.js";import{cx as m,srOnlyClasses as c}from"../../internal/styles.js";function easeOut(e){return 1-(1-e)**3}export const PlAnimateCounter=/* @__PURE__ */n.forwardRef(function PlAnimateCounter({value:l,from:f=0,duration:d=1200,delay:p=0,format:h,easing:g=easeOut,trigger:j="visible",play:A,once:F=!0,threshold:b=.2,paused:x,render:v,className:y,...N},q){const E=o(),M=u(),R=i({trigger:j,play:A,once:F,threshold:b,paused:x,infinite:!1,nonce:l}),w=n.useMemo(()=>new Intl.NumberFormat(E.locale,h),[E.locale,h]),[C,O]=n.useState(()=>M?l:f),P=n.useRef(0),I=n.useRef(g);n.useEffect(()=>{I.current=g}),n.useEffect(()=>{P.current=0},[R.runs,l,f]),n.useEffect(()=>{if(M)return void O(l);if(!R.started)return P.current=0,void O(f);if(x)return;const e=Math.max(1,d);let r,t=0;const step=n=>{r??=n-P.current,P.current=n-r;const a=Math.min(1,(P.current-p)/e);a<0?t=requestAnimationFrame(step):(O(f+(l-f)*I.current(a)),a<1&&(t=requestAnimationFrame(step)))};return t=requestAnimationFrame(step),()=>cancelAnimationFrame(t)},[R.started,R.runs,M,x,l,f,d,p]);const S=w.format(l);return s({render:v??e("span",{}),ref:[q,R.ref],props:{className:m("tabular-nums",y),"data-plass-animation":"counter","data-state":R.state,children:t(r,{children:[e("span",{className:c,children:S}),e("span",{"aria-hidden":"true",children:w.format(C)})]}),...a(N,R.handlers)}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlAnimateCounter}from"./PlAnimateCounter.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { PlassAnimateMode, PlassAnimateProps } from '../../types.js';
|
|
4
|
-
export interface PlAnimateFadeProps extends PlassAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { PlassAnimateMode, PlassAnimateProps, PlassAnimateStaggerProps, PlassAnimateTimelineProps } from '../../types.js';
|
|
4
|
+
export interface PlAnimateFadeProps extends PlassAnimateProps, PlassAnimateStaggerProps, PlassAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether the content arrives or leaves.
|
|
7
7
|
* @default 'in'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{
|
|
1
|
+
"use client";import*as e from"react";import{mergeProps as r}from"@base-ui/react/merge-props";import{useRender as t}from"@base-ui/react/use-render";import{isInfinite as a,useAnimateElement as n}from"../../internal/animate.js";import{cx as i}from"../../internal/styles.js";export const PlAnimateFade=/* @__PURE__ */e.forwardRef(function PlAnimateFade({duration:e=300,delay:s=0,easing:o,repeat:l=1,alternate:d,paused:m,trigger:p="mount",play:c,once:f=!0,threshold:g=.2,timeline:u,range:y,stagger:h=0,durationStep:N=0,reverse:b=!1,mode:j="in",from:v=0,render:A,className:F,style:P,children:S,...w},x){const R=n({effect:"fade",duration:e,delay:s,easing:o,repeat:l,alternate:d,mode:j,opacity:v,trigger:p,play:c,once:f,threshold:g,paused:m,infinite:a(l),timeline:u,range:y,stagger:h,durationStep:N,reverse:b,children:S});return t({render:A,ref:[x,R.ref],props:{...r(w,R.props),className:i(R.className,F),style:{...R.style,...P},children:R.children}})});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassAnimateProps, PlassOrientation } from '../../types.js';
|
|
4
|
+
export interface PlAnimateFloatProps extends PlassAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
/**
|
|
6
|
+
* How far it drifts from where it started. A number is pixels.
|
|
7
|
+
*
|
|
8
|
+
* Small on purpose. A float is meant to be noticed at the edge of attention
|
|
9
|
+
* and not looked at, and past about a dozen pixels it stops being a drift and
|
|
10
|
+
* starts being something moving on the page.
|
|
11
|
+
* @default 8
|
|
12
|
+
*/
|
|
13
|
+
distance?: number | string;
|
|
14
|
+
/**
|
|
15
|
+
* Which way it drifts.
|
|
16
|
+
* @default 'vertical'
|
|
17
|
+
*/
|
|
18
|
+
orientation?: PlassOrientation;
|
|
19
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
20
|
+
render?: useRender.RenderProp;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Content drifting gently, and not going anywhere.
|
|
25
|
+
*
|
|
26
|
+
* The odd one out among the `PlAnimate*` components, and the page says so: the
|
|
27
|
+
* other effects are **entrances**, played once when content arrives. This one
|
|
28
|
+
* never finishes. It is for the thing that is meant to read as weightless — an
|
|
29
|
+
* illustration on a landing page, a mark over an empty state — and for nothing
|
|
30
|
+
* that a reader has to read while it moves.
|
|
31
|
+
*
|
|
32
|
+
* That is also why it is **not** in `PlassAnimation`, the union `mode`,
|
|
33
|
+
* `stagger` and the shared effect map are built on. That union is the set of
|
|
34
|
+
* ways content can arrive; an endless drift is not an arrival, and every
|
|
35
|
+
* component importing the map would have paid for a row nothing else could
|
|
36
|
+
* want.
|
|
37
|
+
*
|
|
38
|
+
* The cycle is symmetric — home, out, home — so however many times it runs it
|
|
39
|
+
* ends where it started. A float stopped mid-cycle would leave the element
|
|
40
|
+
* permanently a few pixels out of place, which reads as a layout bug rather
|
|
41
|
+
* than as an effect that ended.
|
|
42
|
+
*
|
|
43
|
+
* `easing` defaults to `ease-in-out` rather than to the house curve, which is
|
|
44
|
+
* the one place in the library that is right: the house curve is an entrance's,
|
|
45
|
+
* fast out of the gate and slow into place, and a drift with it would lurch at
|
|
46
|
+
* each end of the cycle instead of turning around.
|
|
47
|
+
*
|
|
48
|
+
* A reader who asked for less motion sees none of it, as with every effect
|
|
49
|
+
* here. Nothing may depend on the movement.
|
|
50
|
+
*/
|
|
51
|
+
export declare const PlAnimateFloat: React.ForwardRefExoticComponent<PlAnimateFloatProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as r}from"@base-ui/react/use-render";import{animBaseClass as t,lengthValue as n,useAnimateElement as i}from"../../internal/animate.js";import{cx as s}from"../../internal/styles.js";export const PlAnimateFloat=/* @__PURE__ */e.forwardRef(function PlAnimateFloat({duration:e=3e3,delay:l=0,easing:o="ease-in-out",repeat:c="infinite",alternate:m,paused:p,trigger:d="mount",play:f,once:u=!0,threshold:y=.2,distance:h=8,orientation:g="vertical",render:N,className:b,style:j,children:v,...x},A){const F=n(h),P="vertical"===g,w=i({effect:null,duration:e,delay:l,easing:o,repeat:c,alternate:m,x:P?"0":F,y:P?`-${F}`:"0",trigger:d,play:f,once:u,threshold:y,paused:p,infinite:!0,children:v});return r({render:N,ref:[A,w.ref],props:{...a(x,w.props),className:s(t,"plass-anim-float",w.className,b),style:{...w.style,...j},"data-plass-animation":"float",children:w.children}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlAnimateFloat}from"./PlAnimateFloat.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { PlassAnimateMode, PlassAnimateProps } from '../../types.js';
|
|
4
|
-
export interface PlAnimateGrowProps extends PlassAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { PlassAnimateMode, PlassAnimateProps, PlassAnimateStaggerProps, PlassAnimateTimelineProps } from '../../types.js';
|
|
4
|
+
export interface PlAnimateGrowProps extends PlassAnimateProps, PlassAnimateStaggerProps, PlassAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether the content unfolds or folds away.
|
|
7
7
|
* @default 'in'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{
|
|
1
|
+
"use client";import*as e from"react";import{mergeProps as r}from"@base-ui/react/merge-props";import{useRender as t}from"@base-ui/react/use-render";import{isInfinite as a,useAnimateElement as n}from"../../internal/animate.js";import{cx as i}from"../../internal/styles.js";export const PlAnimateGrow=/* @__PURE__ */e.forwardRef(function PlAnimateGrow({duration:e=320,delay:o=0,easing:s,repeat:l=1,alternate:m,paused:d,trigger:p="mount",play:c,once:g=!0,threshold:f=.2,timeline:u,range:y,stagger:h=0,durationStep:w=0,reverse:N=!1,mode:b="in",from:j=.8,origin:v="center",fade:A=!0,render:G,className:P,style:S,children:x,...R},k){const q=n({effect:"grow",duration:e,delay:o,easing:s,repeat:l,alternate:m,mode:b,scale:j,opacity:A?0:1,trigger:p,play:c,once:g,threshold:f,paused:d,infinite:a(l),timeline:u,range:y,origin:v,stagger:h,durationStep:w,reverse:N,children:x});return t({render:G,ref:[k,q.ref],props:{...r(R,q.props),className:i(q.className,P),style:{...q.style,...S},children:q.children}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{isInfinite as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{mergeProps as n}from"@base-ui/react/merge-props";import{isInfinite as a,lengthValue as r,useAnimationRun as s}from"../../internal/animate.js";import{usePrefersReducedMotion as i}from"../../internal/media.js";import{cx as l}from"../../internal/styles.js";export const PlAnimateHeadline=/* @__PURE__ */t.forwardRef(function PlAnimateHeadline({duration:o=460,delay:u=0,easing:c,repeat:m="infinite",paused:d,trigger:f="mount",play:p,once:h=!0,threshold:g=.2,interval:v=2600,index:y,defaultIndex:x=0,onIndexChange:E,loop:j=!0,rise:N="100%",className:R,style:T,children:A,...C},b){const k=s({trigger:f,play:p,once:h,threshold:g,paused:d,infinite:a(m)}),H=i(),I=t.Children.toArray(A),M=I.length,[P,S]=t.useState(x),w=Math.min(y??P,Math.max(M-1,0)),[V,$]=t.useState(null),q=t.useRef(w);t.useEffect(()=>{q.current!==w&&($(q.current),q.current=w)},[w]),t.useEffect(()=>{if(null===V)return;const e=setTimeout(()=>$(null),o);return()=>clearTimeout(e)},[V,o]);const z=t.useCallback(()=>{const e=w+1;if(e>=M){if(!j)return;return void 0===y&&S(0),void E?.(0)}void 0===y&&S(e),E?.(e)},[w,M,j,y,E]),B=t.useRef(z);t.useEffect(()=>{B.current=z});const D=t.useRef(!1);return t.useEffect(()=>{if(void 0!==y||M<2||"running"!==k.state)return;if(!j&&w===M-1)return;const e=setTimeout(()=>{D.current=!0,B.current()},v+(D.current?0:u));return()=>clearTimeout(e)},[y,M,k.state,v,u,j,w]),e("div",{ref:e=>{k.ref(e),"function"==typeof b?b(e):b&&(b.current=e)},className:l("plass-headline",R),style:{"--p-anim-duration":`${o}ms`,"--p-anim-rise":r(N),...c?{"--p-anim-ease":c}:{},"--p-anim-state":k.state,...T},"data-plass-animation":"headline","data-state":k.state,...n(C,k.handlers),children:I.map((n,a)=>{const r=a===w?"active":a!==V||H?void 0:"leaving";if(!t.isValidElement(n))return e("span",{className:"plass-headline-item","data-state":r,children:n},a);const s=n.props;return t.cloneElement(n,{key:a,className:l("plass-headline-item",s.className),"data-state":r})})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{
|
|
1
|
+
"use client";import*as e from"react";import{mergeProps as r}from"@base-ui/react/merge-props";import{useDefaults as a}from"../../internal/defaults.js";import{useRender as i}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as n}from"../../internal/animate.js";import{cx as o,radiusClasses as l}from"../../internal/styles.js";export const PlAnimateLighting=/* @__PURE__ */e.forwardRef(function PlAnimateLighting({duration:e=3e3,delay:s=0,easing:p,repeat:m="infinite",alternate:d,paused:g,trigger:c="mount",play:f,once:u=!0,threshold:h=.2,color:y,glow:w,size:$,spread:b=3,arc:j=50,blur:v=5,reverse:x=!1,render:z,className:A,style:L,children:N,...P},R){const k=a(),q=y??k.color??"primary",B=$??k.size??"md",C=n({effect:null,duration:e,delay:s,easing:p,repeat:m,alternate:d,mode:x?"out":"in",trigger:c,play:f,once:u,threshold:h,paused:g,infinite:t(m)});return i({render:z,ref:[R,C.ref],props:{...r(P,C.props),className:o("plass-anim-lighting",l[B],A),style:{...C.style,"--p-anim-glow-from":w??`var(--plass-${q}-solid)`,"--p-anim-glow-to":w??`var(--plass-${q}-solid-to)`,"--p-anim-glow-width":`${b}px`,"--p-anim-glow-arc":`${j}deg`,"--p-anim-glow-blur":`${v}px`,...L},"data-plass-animation":"lighting",children:N}})});
|
|
@@ -27,7 +27,8 @@ export interface PlAnimateMarqueeProps extends PlassAnimateProps, React.Componen
|
|
|
27
27
|
/**
|
|
28
28
|
* How many copies of the content are laid end to end. Two is enough for
|
|
29
29
|
* anything at least as wide as its container; raise it when the content is
|
|
30
|
-
* short enough to leave a hole behind itself.
|
|
30
|
+
* short enough to leave a hole behind itself. Only the first is drawn under
|
|
31
|
+
* `prefers-reduced-motion`.
|
|
31
32
|
* @default 2
|
|
32
33
|
*/
|
|
33
34
|
copies?: number;
|
|
@@ -58,8 +59,16 @@ export interface PlAnimateMarqueeProps extends PlassAnimateProps, React.Componen
|
|
|
58
59
|
* pointer cannot be clicked reliably, and a link inside a marquee that never
|
|
59
60
|
* stops is a link nobody can follow.
|
|
60
61
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
62
|
+
* Under `prefers-reduced-motion` the strip stops, and what was past the edge of
|
|
63
|
+
* the box would be out of sight for good. So the stylesheet draws only the
|
|
64
|
+
* first copy and lets the box scroll along it instead of clipping it, and the
|
|
65
|
+
* box is a tab stop while there is anything to scroll, for a reader with no
|
|
66
|
+
* pointer to scroll it with.
|
|
67
|
+
*
|
|
68
|
+
* Only the first copy is read out or reached with Tab. The rest carry
|
|
69
|
+
* `aria-hidden`, or a screen reader would announce everything on the strip as
|
|
70
|
+
* many times as it was laid down, and `inert`, because `aria-hidden` does not
|
|
71
|
+
* stop the focus: a strip of ten links would otherwise be thirty Tab stops,
|
|
72
|
+
* twenty of them with no name.
|
|
64
73
|
*/
|
|
65
74
|
export declare const PlAnimateMarquee: React.ForwardRefExoticComponent<PlAnimateMarqueeProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{isInfinite as a,lengthValue as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{mergeProps as r}from"@base-ui/react/merge-props";import{isInfinite as a,lengthValue as n,repeatValue as i,directionValue as s,useAnimationRun as o}from"../../internal/animate.js";import{inertProps as l}from"../../internal/inert.js";import{usePrefersReducedMotion as m}from"../../internal/media.js";import{cx as p}from"../../internal/styles.js";export const PlAnimateMarquee=/* @__PURE__ */t.forwardRef(function PlAnimateMarquee({duration:u,delay:c=0,easing:d,repeat:f="infinite",alternate:h,paused:v,trigger:g="mount",play:y,once:b=!0,threshold:j=.2,orientation:q="horizontal",reverse:x=!1,speed:R=60,gap:H="2rem",copies:M=2,pauseOnHover:w=!0,className:z,style:A,children:N,...O},S){const W=o({trigger:g,play:y,once:b,threshold:j,paused:v,infinite:a(f)}),G=t.useRef(null),P=t.useRef(null),[$,k]=t.useState(0),[C,E]=t.useState(!1),F="vertical"===q,I=m();t.useEffect(()=>{const e=G.current,t=P.current;if(!e||!t)return;const measure=()=>{const r=getComputedStyle(e),a=parseFloat(F?r.rowGap:r.columnGap)||0,n=F?t.offsetHeight:t.offsetWidth;k(n+a),E(F?e.scrollHeight>e.clientHeight:e.scrollWidth>e.clientWidth)};if(measure(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(measure);return r.observe(t),r.observe(e),()=>r.disconnect()},[F,N,I]);const B=u??($>0?$/R*1e3:12e3);return e("div",{ref:e=>{G.current=e,W.ref(e),"function"==typeof S?S(e):S&&(S.current=e)},className:p("plass-marquee",F&&"plass-marquee-vertical",z),style:{"--p-anim-gap":n(H),...d?{"--p-anim-ease":d}:{},"--p-anim-duration":`${Math.round(B)}ms`,"--p-anim-delay":`${c}ms`,"--p-anim-repeat":i(f),"--p-anim-direction":s(x?"out":"in",h),"--p-anim-state":W.state,...A},"data-plass-animation":"marquee","data-state":W.state,"data-pause-on-hover":w?"":void 0,tabIndex:I&&C?0:void 0,...r(O,W.handlers),children:Array.from({length:Math.max(1,M)},(t,r)=>(t=>e("div",{ref:0===t?P:void 0,className:"plass-marquee-track","aria-hidden":0===t?void 0:"true",...l(0!==t),children:N},t))(r))})});
|