plass-ui 0.0.1 → 1.0.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/dist/components/accordion/PlAccordion.d.ts +98 -0
- package/dist/components/accordion/PlAccordion.js +131 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/alert/PlAlert.d.ts +50 -0
- package/dist/components/alert/PlAlert.js +109 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +1 -0
- package/dist/components/animate-appear/PlAnimateAppear.d.ts +55 -0
- package/dist/components/animate-appear/PlAnimateAppear.js +71 -0
- package/dist/components/animate-appear/index.d.ts +2 -0
- package/dist/components/animate-appear/index.js +1 -0
- package/dist/components/animate-blink/PlAnimateBlink.d.ts +30 -0
- package/dist/components/animate-blink/PlAnimateBlink.js +47 -0
- package/dist/components/animate-blink/index.d.ts +2 -0
- package/dist/components/animate-blink/index.js +1 -0
- package/dist/components/animate-fade/PlAnimateFade.d.ts +35 -0
- package/dist/components/animate-fade/PlAnimateFade.js +48 -0
- package/dist/components/animate-fade/index.d.ts +2 -0
- package/dist/components/animate-fade/index.js +1 -0
- package/dist/components/animate-grow/PlAnimateGrow.d.ts +45 -0
- package/dist/components/animate-grow/PlAnimateGrow.js +49 -0
- package/dist/components/animate-grow/index.d.ts +2 -0
- package/dist/components/animate-grow/index.js +1 -0
- package/dist/components/animate-headline/PlAnimateHeadline.d.ts +55 -0
- package/dist/components/animate-headline/PlAnimateHeadline.js +120 -0
- package/dist/components/animate-headline/index.d.ts +2 -0
- package/dist/components/animate-headline/index.js +1 -0
- package/dist/components/animate-lighting/PlAnimateLighting.d.ts +67 -0
- package/dist/components/animate-lighting/PlAnimateLighting.js +65 -0
- package/dist/components/animate-lighting/index.d.ts +2 -0
- package/dist/components/animate-lighting/index.js +1 -0
- package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +65 -0
- package/dist/components/animate-marquee/PlAnimateMarquee.js +94 -0
- package/dist/components/animate-marquee/index.d.ts +2 -0
- package/dist/components/animate-marquee/index.js +1 -0
- package/dist/components/animate-rotate/PlAnimateRotate.d.ts +52 -0
- package/dist/components/animate-rotate/PlAnimateRotate.js +50 -0
- package/dist/components/animate-rotate/index.d.ts +2 -0
- package/dist/components/animate-rotate/index.js +1 -0
- package/dist/components/animate-slide/PlAnimateSlide.d.ts +47 -0
- package/dist/components/animate-slide/PlAnimateSlide.js +49 -0
- package/dist/components/animate-slide/index.d.ts +2 -0
- package/dist/components/animate-slide/index.js +1 -0
- package/dist/components/animate-typing/PlAnimateTyping.d.ts +56 -0
- package/dist/components/animate-typing/PlAnimateTyping.js +177 -0
- package/dist/components/animate-typing/index.d.ts +2 -0
- package/dist/components/animate-typing/index.js +1 -0
- package/dist/components/animate-zoom/PlAnimateZoom.d.ts +37 -0
- package/dist/components/animate-zoom/PlAnimateZoom.js +45 -0
- package/dist/components/animate-zoom/index.d.ts +2 -0
- package/dist/components/animate-zoom/index.js +1 -0
- package/dist/components/aspect-ratio/PlAspectRatio.d.ts +64 -0
- package/dist/components/aspect-ratio/PlAspectRatio.js +58 -0
- package/dist/components/aspect-ratio/index.d.ts +2 -0
- package/dist/components/aspect-ratio/index.js +1 -0
- package/dist/components/avatar/PlAvatar.d.ts +102 -0
- package/dist/components/avatar/PlAvatar.js +121 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/badge/PlBadge.d.ts +86 -0
- package/dist/components/badge/PlBadge.js +168 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/blockquote/PlBlockquote.d.ts +64 -0
- package/dist/components/blockquote/PlBlockquote.js +112 -0
- package/dist/components/blockquote/index.d.ts +2 -0
- package/dist/components/blockquote/index.js +1 -0
- package/dist/components/bottom-navigation/PlBottomNavigation.d.ts +111 -0
- package/dist/components/bottom-navigation/PlBottomNavigation.js +141 -0
- package/dist/components/bottom-navigation/index.d.ts +2 -0
- package/dist/components/bottom-navigation/index.js +1 -0
- package/dist/components/box/PlBox.d.ts +50 -0
- package/dist/components/box/PlBox.js +46 -0
- package/dist/components/box/index.d.ts +2 -0
- package/dist/components/box/index.js +1 -0
- package/dist/components/breadcrumb/PlBreadcrumb.d.ts +138 -0
- package/dist/components/breadcrumb/PlBreadcrumb.js +201 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/button/{Button.d.ts → PlButton.d.ts} +3 -3
- package/dist/components/button/PlButton.js +196 -0
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/index.js +1 -1
- package/dist/components/button-group/PlButtonGroup.d.ts +32 -0
- package/dist/components/button-group/PlButtonGroup.js +64 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/card/PlCard.d.ts +81 -0
- package/dist/components/card/PlCard.js +102 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/carousel/PlCarousel.d.ts +78 -0
- package/dist/components/carousel/PlCarousel.js +177 -0
- package/dist/components/carousel/index.d.ts +2 -0
- package/dist/components/carousel/index.js +1 -0
- package/dist/components/chat-bubble/PlChatBubble.d.ts +127 -0
- package/dist/components/chat-bubble/PlChatBubble.js +206 -0
- package/dist/components/chat-bubble/index.d.ts +2 -0
- package/dist/components/chat-bubble/index.js +1 -0
- package/dist/components/checkbox/PlCheckbox.d.ts +39 -0
- package/dist/components/checkbox/PlCheckbox.js +100 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/PlChip.d.ts +55 -0
- package/dist/components/chip/PlChip.js +144 -0
- package/dist/components/chip/index.d.ts +2 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/collapsible/PlCollapsible.d.ts +84 -0
- package/dist/components/collapsible/PlCollapsible.js +65 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/collapsible/index.js +1 -0
- package/dist/components/combobox/PlCombobox.d.ts +140 -0
- package/dist/components/combobox/PlCombobox.js +199 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/combobox/index.js +1 -0
- package/dist/components/container/PlContainer.d.ts +66 -0
- package/dist/components/container/PlContainer.js +47 -0
- package/dist/components/container/index.d.ts +2 -0
- package/dist/components/container/index.js +1 -0
- package/dist/components/date-picker/PlDatePicker.d.ts +73 -0
- package/dist/components/date-picker/PlDatePicker.js +87 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/date-range-picker/PlDateRangePicker.d.ts +91 -0
- package/dist/components/date-range-picker/PlDateRangePicker.js +152 -0
- package/dist/components/date-range-picker/index.d.ts +2 -0
- package/dist/components/date-range-picker/index.js +1 -0
- package/dist/components/date-time-picker/PlDateTimePicker.d.ts +74 -0
- package/dist/components/date-time-picker/PlDateTimePicker.js +106 -0
- package/dist/components/date-time-picker/index.d.ts +2 -0
- package/dist/components/date-time-picker/index.js +1 -0
- package/dist/components/divider/PlDivider.d.ts +73 -0
- package/dist/components/divider/PlDivider.js +107 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/drawer/PlDrawer.d.ts +144 -0
- package/dist/components/drawer/PlDrawer.js +190 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/file-picker/PlFilePicker.d.ts +105 -0
- package/dist/components/file-picker/PlFilePicker.js +274 -0
- package/dist/components/file-picker/index.d.ts +2 -0
- package/dist/components/file-picker/index.js +1 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.d.ts +118 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.js +291 -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/grid/PlGrid.d.ts +67 -0
- package/dist/components/grid/PlGrid.js +51 -0
- package/dist/components/grid/PlGridItem.d.ts +50 -0
- package/dist/components/grid/PlGridItem.js +34 -0
- package/dist/components/grid/index.d.ts +4 -0
- package/dist/components/grid/index.js +2 -0
- package/dist/components/highlight/PlHighlight.d.ts +90 -0
- package/dist/components/highlight/PlHighlight.js +185 -0
- package/dist/components/highlight/index.d.ts +2 -0
- package/dist/components/highlight/index.js +1 -0
- package/dist/components/hot-keys/PlHotKeys.d.ts +93 -0
- package/dist/components/hot-keys/PlHotKeys.js +294 -0
- package/dist/components/hot-keys/index.d.ts +2 -0
- package/dist/components/hot-keys/index.js +1 -0
- package/dist/components/icon/PlIcon.d.ts +62 -0
- package/dist/components/icon/PlIcon.js +58 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/index.js +1 -0
- package/dist/components/icon-button/PlIconButton.d.ts +39 -0
- package/dist/components/icon-button/PlIconButton.js +37 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +1 -0
- package/dist/components/list/PlList.d.ts +82 -0
- package/dist/components/list/PlList.js +160 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/list/index.js +1 -0
- package/dist/components/menu/PlMenu.d.ts +210 -0
- package/dist/components/menu/PlMenu.js +209 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/modal/PlModal.d.ts +112 -0
- package/dist/components/modal/PlModal.js +150 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.js +1 -0
- package/dist/components/number-field/PlNumberField.d.ts +133 -0
- package/dist/components/number-field/PlNumberField.js +111 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/index.js +1 -0
- package/dist/components/otp-field/PlOtpField.d.ts +82 -0
- package/dist/components/otp-field/PlOtpField.js +109 -0
- package/dist/components/otp-field/index.d.ts +2 -0
- package/dist/components/otp-field/index.js +1 -0
- package/dist/components/overlay/PlOverlay.d.ts +96 -0
- package/dist/components/overlay/PlOverlay.js +77 -0
- package/dist/components/overlay/index.d.ts +2 -0
- package/dist/components/overlay/index.js +1 -0
- package/dist/components/pagination/PlPagination.d.ts +88 -0
- package/dist/components/pagination/PlPagination.js +159 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/panes/PlPanes.d.ts +79 -0
- package/dist/components/panes/PlPanes.js +324 -0
- package/dist/components/panes/index.d.ts +2 -0
- package/dist/components/panes/index.js +1 -0
- package/dist/components/pill/PlPill.d.ts +81 -0
- package/dist/components/pill/PlPill.js +154 -0
- package/dist/components/pill/index.d.ts +2 -0
- package/dist/components/pill/index.js +1 -0
- package/dist/components/popover/PlPopover.d.ts +107 -0
- package/dist/components/popover/PlPopover.js +113 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/progress-box/PlProgressBox.d.ts +32 -0
- package/dist/components/progress-box/PlProgressBox.js +34 -0
- package/dist/components/progress-box/index.d.ts +2 -0
- package/dist/components/progress-box/index.js +1 -0
- package/dist/components/progress-circular/PlProgressCircular.d.ts +22 -0
- package/dist/components/progress-circular/PlProgressCircular.js +47 -0
- package/dist/components/progress-circular/index.d.ts +2 -0
- package/dist/components/progress-circular/index.js +1 -0
- package/dist/components/progress-linear/PlProgressLinear.d.ts +31 -0
- package/dist/components/progress-linear/PlProgressLinear.js +40 -0
- package/dist/components/progress-linear/index.d.ts +2 -0
- package/dist/components/progress-linear/index.js +1 -0
- package/dist/components/radio-group/PlRadioGroup.d.ts +54 -0
- package/dist/components/radio-group/PlRadioGroup.js +99 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/rating/PlRating.d.ts +90 -0
- package/dist/components/rating/PlRating.js +101 -0
- package/dist/components/rating/index.d.ts +2 -0
- package/dist/components/rating/index.js +1 -0
- package/dist/components/scroll-zone/PlScrollZone.d.ts +132 -0
- package/dist/components/scroll-zone/PlScrollZone.js +411 -0
- package/dist/components/scroll-zone/index.d.ts +2 -0
- package/dist/components/scroll-zone/index.js +1 -0
- package/dist/components/segmented-button/PlSegmentedButton.d.ts +79 -0
- package/dist/components/segmented-button/PlSegmentedButton.js +206 -0
- package/dist/components/segmented-button/index.d.ts +2 -0
- package/dist/components/segmented-button/index.js +1 -0
- package/dist/components/select/PlSelect.d.ts +77 -0
- package/dist/components/select/PlSelect.js +115 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/skeleton/PlSkeleton.d.ts +73 -0
- package/dist/components/skeleton/PlSkeleton.js +142 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/slider/PlSlider.d.ts +44 -0
- package/dist/components/slider/PlSlider.js +132 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/spoiler/PlSpoiler.d.ts +84 -0
- package/dist/components/spoiler/PlSpoiler.js +74 -0
- package/dist/components/spoiler/index.d.ts +2 -0
- package/dist/components/spoiler/index.js +1 -0
- package/dist/components/switch/PlSwitch.d.ts +42 -0
- package/dist/components/switch/PlSwitch.js +131 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/table/PlTable.d.ts +112 -0
- package/dist/components/table/PlTable.js +210 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/tabs/PlTabs.d.ts +94 -0
- package/dist/components/tabs/PlTabs.js +182 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/text-field/{TextField.d.ts → PlTextField.d.ts} +5 -5
- package/dist/components/text-field/PlTextField.js +126 -0
- package/dist/components/text-field/index.d.ts +2 -2
- package/dist/components/text-field/index.js +1 -1
- package/dist/components/text-link/PlTextLink.d.ts +80 -0
- package/dist/components/text-link/PlTextLink.js +136 -0
- package/dist/components/text-link/index.d.ts +2 -0
- package/dist/components/text-link/index.js +1 -0
- package/dist/components/time-picker/PlTimePicker.d.ts +88 -0
- package/dist/components/time-picker/PlTimePicker.js +97 -0
- package/dist/components/time-picker/index.d.ts +2 -0
- package/dist/components/time-picker/index.js +1 -0
- package/dist/components/timeline/PlTimeline.d.ts +98 -0
- package/dist/components/timeline/PlTimeline.js +207 -0
- package/dist/components/timeline/index.d.ts +2 -0
- package/dist/components/timeline/index.js +1 -0
- package/dist/components/toast/PlToast.d.ts +122 -0
- package/dist/components/toast/PlToast.js +174 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/toolbar/PlToolbar.d.ts +68 -0
- package/dist/components/toolbar/PlToolbar.js +65 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/index.js +1 -0
- package/dist/components/tooltip/PlTooltip.d.ts +92 -0
- package/dist/components/tooltip/PlTooltip.js +117 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/typography/PlTypography.d.ts +66 -0
- package/dist/components/typography/PlTypography.js +143 -0
- package/dist/components/typography/index.d.ts +2 -0
- package/dist/components/typography/index.js +1 -0
- package/dist/css/accordion.css +2 -0
- package/dist/css/alert.css +2 -0
- package/dist/css/animate-appear.css +2 -0
- package/dist/css/animate-blink.css +2 -0
- package/dist/css/animate-fade.css +2 -0
- package/dist/css/animate-grow.css +2 -0
- package/dist/css/animate-headline.css +2 -0
- package/dist/css/animate-lighting.css +2 -0
- package/dist/css/animate-marquee.css +2 -0
- package/dist/css/animate-rotate.css +2 -0
- package/dist/css/animate-slide.css +2 -0
- package/dist/css/animate-typing.css +2 -0
- package/dist/css/animate-zoom.css +2 -0
- package/dist/css/aspect-ratio.css +2 -0
- package/dist/css/avatar.css +2 -0
- package/dist/css/badge.css +2 -0
- package/dist/css/base.css +4 -0
- package/dist/css/blockquote.css +2 -0
- package/dist/css/bottom-navigation.css +2 -0
- package/dist/css/box.css +2 -0
- package/dist/css/breadcrumb.css +2 -0
- package/dist/css/button-group.css +2 -0
- package/dist/css/button.css +2 -0
- package/dist/css/card.css +2 -0
- package/dist/css/carousel.css +2 -0
- package/dist/css/chat-bubble.css +2 -0
- package/dist/css/checkbox.css +2 -0
- package/dist/css/chip.css +2 -0
- package/dist/css/collapsible.css +2 -0
- package/dist/css/combobox.css +2 -0
- package/dist/css/container.css +2 -0
- package/dist/css/date-picker.css +2 -0
- package/dist/css/date-range-picker.css +2 -0
- package/dist/css/date-time-picker.css +2 -0
- package/dist/css/divider.css +2 -0
- package/dist/css/drawer.css +2 -0
- package/dist/css/file-picker.css +2 -0
- package/dist/css/floating-bottom-navigation.css +2 -0
- package/dist/css/grid.css +2 -0
- package/dist/css/highlight.css +2 -0
- package/dist/css/hot-keys.css +2 -0
- package/dist/css/icon-button.css +2 -0
- package/dist/css/icon.css +2 -0
- package/dist/css/list.css +2 -0
- package/dist/css/menu.css +2 -0
- package/dist/css/modal.css +2 -0
- package/dist/css/number-field.css +2 -0
- package/dist/css/otp-field.css +2 -0
- package/dist/css/overlay.css +2 -0
- package/dist/css/pagination.css +2 -0
- package/dist/css/panes.css +2 -0
- package/dist/css/pill.css +2 -0
- package/dist/css/popover.css +2 -0
- package/dist/css/progress-box.css +2 -0
- package/dist/css/progress-circular.css +2 -0
- package/dist/css/progress-linear.css +2 -0
- package/dist/css/radio-group.css +2 -0
- package/dist/css/rating.css +2 -0
- package/dist/css/scroll-zone.css +2 -0
- package/dist/css/segmented-button.css +2 -0
- package/dist/css/select.css +2 -0
- package/dist/css/skeleton.css +2 -0
- package/dist/css/slider.css +2 -0
- package/dist/css/spoiler.css +2 -0
- package/dist/css/switch.css +2 -0
- package/dist/css/table.css +2 -0
- package/dist/css/tabs.css +2 -0
- package/dist/css/text-field.css +2 -0
- package/dist/css/text-link.css +2 -0
- package/dist/css/time-picker.css +2 -0
- package/dist/css/timeline.css +2 -0
- package/dist/css/toast.css +2 -0
- package/dist/css/toolbar.css +2 -0
- package/dist/css/tooltip.css +2 -0
- package/dist/css/typography.css +2 -0
- package/dist/index.d.ts +75 -3
- package/dist/index.js +75 -1
- package/dist/internal/animate.d.ts +161 -0
- package/dist/internal/animate.js +318 -0
- package/dist/internal/button-group.d.ts +27 -0
- package/dist/internal/button-group.js +19 -0
- package/dist/internal/calendar.d.ts +148 -0
- package/dist/internal/calendar.js +501 -0
- package/dist/internal/date.d.ts +173 -0
- package/dist/internal/date.js +353 -0
- package/dist/internal/format.d.ts +24 -0
- package/dist/internal/format.js +41 -0
- package/dist/internal/grid.d.ts +67 -0
- package/dist/internal/grid.js +143 -0
- package/dist/internal/icons.d.ts +86 -1
- package/dist/internal/icons.js +138 -1
- package/dist/internal/menu.d.ts +20 -0
- package/dist/internal/menu.js +18 -0
- package/dist/internal/picker.d.ts +118 -0
- package/dist/internal/picker.js +139 -0
- package/dist/internal/progress.d.ts +145 -0
- package/dist/internal/progress.js +167 -0
- package/dist/internal/sizer.d.ts +32 -0
- package/dist/internal/sizer.js +35 -0
- package/dist/internal/styles.d.ts +198 -8
- package/dist/internal/styles.js +636 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +899 -125
- package/dist/tokens.css +1275 -0
- package/dist/types.d.ts +150 -8
- package/dist/types.js +1 -1
- package/package.json +31 -27
- package/README.md +0 -111
- package/dist/components/button/Button.js +0 -1
- package/dist/components/text-field/TextField.js +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
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'> {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the content arrives or leaves.
|
|
7
|
+
* @default 'in'
|
|
8
|
+
*/
|
|
9
|
+
mode?: PlassAnimateMode;
|
|
10
|
+
/**
|
|
11
|
+
* The opacity it starts from, between `0` and `1`. Raise it for content that
|
|
12
|
+
* should never be completely gone.
|
|
13
|
+
* @default 0
|
|
14
|
+
*/
|
|
15
|
+
from?: number;
|
|
16
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
17
|
+
render?: useRender.RenderProp;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Content arriving or leaving on opacity alone.
|
|
22
|
+
*
|
|
23
|
+
* The plainest effect in the set and the one to reach for first: nothing moves,
|
|
24
|
+
* so nothing reflows and nothing is resampled. A fade is the only entrance that
|
|
25
|
+
* is safe on a block of text at any size.
|
|
26
|
+
*
|
|
27
|
+
* It is also the effect that suits glass. A Plass sheet is defined by what
|
|
28
|
+
* shows through it, and opacity is the axis the material already answers on —
|
|
29
|
+
* the same axis the glass ladder itself is built from.
|
|
30
|
+
*
|
|
31
|
+
* `mode="out"` is the same animation run backwards, and it is held at the end:
|
|
32
|
+
* a faded-out element stays faded out rather than snapping back into view when
|
|
33
|
+
* the animation finishes.
|
|
34
|
+
*/
|
|
35
|
+
export declare const PlAnimateFade: React.ForwardRefExoticComponent<PlAnimateFadeProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { isInfinite, useAnimateElement } from '../../internal/animate.js';
|
|
4
|
+
import { cx } from '../../internal/styles.js';
|
|
5
|
+
/**
|
|
6
|
+
* Content arriving or leaving on opacity alone.
|
|
7
|
+
*
|
|
8
|
+
* The plainest effect in the set and the one to reach for first: nothing moves,
|
|
9
|
+
* so nothing reflows and nothing is resampled. A fade is the only entrance that
|
|
10
|
+
* is safe on a block of text at any size.
|
|
11
|
+
*
|
|
12
|
+
* It is also the effect that suits glass. A Plass sheet is defined by what
|
|
13
|
+
* shows through it, and opacity is the axis the material already answers on —
|
|
14
|
+
* the same axis the glass ladder itself is built from.
|
|
15
|
+
*
|
|
16
|
+
* `mode="out"` is the same animation run backwards, and it is held at the end:
|
|
17
|
+
* a faded-out element stays faded out rather than snapping back into view when
|
|
18
|
+
* the animation finishes.
|
|
19
|
+
*/
|
|
20
|
+
export const PlAnimateFade = /* @__PURE__ */ React.forwardRef(function PlAnimateFade({ duration = 300, delay = 0, easing, repeat = 1, alternate, paused, trigger = 'mount', play, once = true, threshold = 0.2, mode = 'in', from = 0, render, className, style, children, ...props }, ref) {
|
|
21
|
+
const animate = useAnimateElement({
|
|
22
|
+
effect: 'fade',
|
|
23
|
+
duration,
|
|
24
|
+
delay,
|
|
25
|
+
easing,
|
|
26
|
+
repeat,
|
|
27
|
+
alternate,
|
|
28
|
+
mode,
|
|
29
|
+
opacity: from,
|
|
30
|
+
trigger,
|
|
31
|
+
play,
|
|
32
|
+
once,
|
|
33
|
+
threshold,
|
|
34
|
+
paused,
|
|
35
|
+
infinite: isInfinite(repeat)
|
|
36
|
+
});
|
|
37
|
+
return useRender({
|
|
38
|
+
render,
|
|
39
|
+
ref: [ref, animate.ref],
|
|
40
|
+
props: {
|
|
41
|
+
...props,
|
|
42
|
+
className: cx(animate.className, className),
|
|
43
|
+
style: { ...animate.style, ...style },
|
|
44
|
+
...animate.props,
|
|
45
|
+
children
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PlAnimateFade } from './PlAnimateFade.js';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
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'> {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the content unfolds or folds away.
|
|
7
|
+
* @default 'in'
|
|
8
|
+
*/
|
|
9
|
+
mode?: PlassAnimateMode;
|
|
10
|
+
/**
|
|
11
|
+
* The scale it starts from, as a multiple of its final size. Above `1` it
|
|
12
|
+
* settles down onto the page instead of up out of it.
|
|
13
|
+
* @default 0.8
|
|
14
|
+
*/
|
|
15
|
+
from?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Which point stays put while the rest moves — any CSS `transform-origin`.
|
|
18
|
+
* `'top'` unfolds downwards, `'bottom left'` out of a corner.
|
|
19
|
+
* @default 'center'
|
|
20
|
+
*/
|
|
21
|
+
origin?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Fades in as it grows. Turn it off for something already on the page that is
|
|
24
|
+
* only changing size.
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
fade?: boolean;
|
|
28
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
29
|
+
render?: useRender.RenderProp;
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Content unfolding from a point.
|
|
34
|
+
*
|
|
35
|
+
* The difference from Zoom is `origin` and how far it travels: a Grow starts
|
|
36
|
+
* close to its final size and can be anchored to an edge, so it reads as
|
|
37
|
+
* something opening out of the thing beside it — a panel out of a toolbar, a
|
|
38
|
+
* card out of the row it belongs to. A Zoom starts much smaller and always from
|
|
39
|
+
* the middle.
|
|
40
|
+
*
|
|
41
|
+
* Short travel is what makes it safe on glass. A sheet growing from 0.8 stays
|
|
42
|
+
* recognisably the same sheet the whole way, and the blur behind it never has
|
|
43
|
+
* to resolve a surface that is a fifth of the size it is about to be.
|
|
44
|
+
*/
|
|
45
|
+
export declare const PlAnimateGrow: React.ForwardRefExoticComponent<PlAnimateGrowProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { isInfinite, useAnimateElement } from '../../internal/animate.js';
|
|
4
|
+
import { cx } from '../../internal/styles.js';
|
|
5
|
+
/**
|
|
6
|
+
* Content unfolding from a point.
|
|
7
|
+
*
|
|
8
|
+
* The difference from Zoom is `origin` and how far it travels: a Grow starts
|
|
9
|
+
* close to its final size and can be anchored to an edge, so it reads as
|
|
10
|
+
* something opening out of the thing beside it — a panel out of a toolbar, a
|
|
11
|
+
* card out of the row it belongs to. A Zoom starts much smaller and always from
|
|
12
|
+
* the middle.
|
|
13
|
+
*
|
|
14
|
+
* Short travel is what makes it safe on glass. A sheet growing from 0.8 stays
|
|
15
|
+
* recognisably the same sheet the whole way, and the blur behind it never has
|
|
16
|
+
* to resolve a surface that is a fifth of the size it is about to be.
|
|
17
|
+
*/
|
|
18
|
+
export const PlAnimateGrow = /* @__PURE__ */ React.forwardRef(function PlAnimateGrow({ duration = 320, delay = 0, easing, repeat = 1, alternate, paused, trigger = 'mount', play, once = true, threshold = 0.2, mode = 'in', from = 0.8, origin = 'center', fade = true, render, className, style, children, ...props }, ref) {
|
|
19
|
+
const animate = useAnimateElement({
|
|
20
|
+
effect: 'grow',
|
|
21
|
+
duration,
|
|
22
|
+
delay,
|
|
23
|
+
easing,
|
|
24
|
+
repeat,
|
|
25
|
+
alternate,
|
|
26
|
+
mode,
|
|
27
|
+
scale: from,
|
|
28
|
+
opacity: fade ? 0 : 1,
|
|
29
|
+
trigger,
|
|
30
|
+
play,
|
|
31
|
+
once,
|
|
32
|
+
threshold,
|
|
33
|
+
paused,
|
|
34
|
+
infinite: isInfinite(repeat)
|
|
35
|
+
});
|
|
36
|
+
return useRender({
|
|
37
|
+
render,
|
|
38
|
+
ref: [ref, animate.ref],
|
|
39
|
+
props: {
|
|
40
|
+
...props,
|
|
41
|
+
className: cx(animate.className, className),
|
|
42
|
+
// `transform-origin` governs the standalone `scale` property too, which
|
|
43
|
+
// is what lets the effect stay off the `transform` shorthand entirely.
|
|
44
|
+
style: { transformOrigin: origin, ...animate.style, ...style },
|
|
45
|
+
...animate.props,
|
|
46
|
+
children
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PlAnimateGrow } from './PlAnimateGrow.js';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassAnimateProps } from '../../types.js';
|
|
3
|
+
export interface PlAnimateHeadlineProps extends Omit<PlassAnimateProps, 'alternate'>, React.ComponentPropsWithoutRef<'div'> {
|
|
4
|
+
/**
|
|
5
|
+
* How long each line is held before the next one comes up, in milliseconds.
|
|
6
|
+
* Counted from the moment a line arrives, so it is reading time rather than a
|
|
7
|
+
* cycle length.
|
|
8
|
+
* @default 2600
|
|
9
|
+
*/
|
|
10
|
+
interval?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Which line is showing. Pass it to drive the reel yourself — from a step in
|
|
13
|
+
* a form, a tab, or a timer of your own.
|
|
14
|
+
*/
|
|
15
|
+
index?: number;
|
|
16
|
+
/** Where an uncontrolled reel starts. @default 0 */
|
|
17
|
+
defaultIndex?: number;
|
|
18
|
+
/** Called with the line that has just come up. */
|
|
19
|
+
onIndexChange?: (index: number) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Starts again after the last line. Off, the reel stops on the last one and
|
|
22
|
+
* stays there.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
loop?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* How far a line travels as it comes up or leaves — a CSS length, or a number
|
|
28
|
+
* in pixels. `'100%'` is one line's own height.
|
|
29
|
+
* @default '100%'
|
|
30
|
+
*/
|
|
31
|
+
rise?: number | string;
|
|
32
|
+
/** The lines, in the order they should be read. */
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* One line replacing the one above it, on a timer.
|
|
37
|
+
*
|
|
38
|
+
* Every line sits in the same grid cell, so the box is as tall as the longest of
|
|
39
|
+
* them from the first frame and never resizes as the reel turns — which is the
|
|
40
|
+
* whole difficulty with this effect, and the reason the lines that are not
|
|
41
|
+
* showing keep their space with `visibility` rather than being taken out of the
|
|
42
|
+
* layout.
|
|
43
|
+
*
|
|
44
|
+
* It is deliberately not a ticker. A line comes up, it stops, and it is held
|
|
45
|
+
* long enough to read; `interval` is counted from the moment it arrives rather
|
|
46
|
+
* than from the start of the cycle, so raising `duration` does not quietly eat
|
|
47
|
+
* the reading time.
|
|
48
|
+
*
|
|
49
|
+
* Use it for a set of phrases where any one of them would have done — three
|
|
50
|
+
* ways of saying what a product is, a rotating set of customer names. What it is
|
|
51
|
+
* not for is content a reader has to see, because there is no guarantee they are
|
|
52
|
+
* looking during the two seconds it is up, and a screen reader is given the line
|
|
53
|
+
* that happens to be showing rather than the set.
|
|
54
|
+
*/
|
|
55
|
+
export declare const PlAnimateHeadline: React.ForwardRefExoticComponent<PlAnimateHeadlineProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { isInfinite, lengthValue, useAnimationRun, usePrefersReducedMotion } from '../../internal/animate.js';
|
|
4
|
+
import { cx } from '../../internal/styles.js';
|
|
5
|
+
/**
|
|
6
|
+
* One line replacing the one above it, on a timer.
|
|
7
|
+
*
|
|
8
|
+
* Every line sits in the same grid cell, so the box is as tall as the longest of
|
|
9
|
+
* them from the first frame and never resizes as the reel turns — which is the
|
|
10
|
+
* whole difficulty with this effect, and the reason the lines that are not
|
|
11
|
+
* showing keep their space with `visibility` rather than being taken out of the
|
|
12
|
+
* layout.
|
|
13
|
+
*
|
|
14
|
+
* It is deliberately not a ticker. A line comes up, it stops, and it is held
|
|
15
|
+
* long enough to read; `interval` is counted from the moment it arrives rather
|
|
16
|
+
* than from the start of the cycle, so raising `duration` does not quietly eat
|
|
17
|
+
* the reading time.
|
|
18
|
+
*
|
|
19
|
+
* Use it for a set of phrases where any one of them would have done — three
|
|
20
|
+
* ways of saying what a product is, a rotating set of customer names. What it is
|
|
21
|
+
* not for is content a reader has to see, because there is no guarantee they are
|
|
22
|
+
* looking during the two seconds it is up, and a screen reader is given the line
|
|
23
|
+
* that happens to be showing rather than the set.
|
|
24
|
+
*/
|
|
25
|
+
export const PlAnimateHeadline = /* @__PURE__ */ React.forwardRef(function PlAnimateHeadline({ duration = 460, delay = 0, easing, repeat = 'infinite', paused, trigger = 'mount', play, once = true, threshold = 0.2, interval = 2600, index, defaultIndex = 0, onIndexChange, loop = true, rise = '100%', className, style, children, ...props }, ref) {
|
|
26
|
+
const run = useAnimationRun({
|
|
27
|
+
trigger,
|
|
28
|
+
play,
|
|
29
|
+
once,
|
|
30
|
+
threshold,
|
|
31
|
+
paused,
|
|
32
|
+
infinite: isInfinite(repeat)
|
|
33
|
+
});
|
|
34
|
+
const reduced = usePrefersReducedMotion();
|
|
35
|
+
const items = React.Children.toArray(children);
|
|
36
|
+
const count = items.length;
|
|
37
|
+
const [uncontrolled, setUncontrolled] = React.useState(defaultIndex);
|
|
38
|
+
const active = Math.min(index ?? uncontrolled, Math.max(count - 1, 0));
|
|
39
|
+
/** The line on its way out. Cleared once its animation has had its time. */
|
|
40
|
+
const [leaving, setLeaving] = React.useState(null);
|
|
41
|
+
const previous = React.useRef(active);
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
if (previous.current !== active) {
|
|
44
|
+
setLeaving(previous.current);
|
|
45
|
+
previous.current = active;
|
|
46
|
+
}
|
|
47
|
+
}, [active]);
|
|
48
|
+
React.useEffect(() => {
|
|
49
|
+
if (leaving === null) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const timer = setTimeout(() => setLeaving(null), duration);
|
|
53
|
+
return () => clearTimeout(timer);
|
|
54
|
+
}, [leaving, duration]);
|
|
55
|
+
const advance = React.useCallback(() => {
|
|
56
|
+
const next = active + 1;
|
|
57
|
+
if (next >= count) {
|
|
58
|
+
if (!loop) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (index === undefined) {
|
|
62
|
+
setUncontrolled(0);
|
|
63
|
+
}
|
|
64
|
+
onIndexChange?.(0);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (index === undefined) {
|
|
68
|
+
setUncontrolled(next);
|
|
69
|
+
}
|
|
70
|
+
onIndexChange?.(next);
|
|
71
|
+
}, [active, count, loop, index, onIndexChange]);
|
|
72
|
+
/**
|
|
73
|
+
* The reel only turns on its own when it was not handed an `index`. A
|
|
74
|
+
* controlled Headline is somebody else's timer, and a second one running
|
|
75
|
+
* underneath it would fight for the same state.
|
|
76
|
+
*/
|
|
77
|
+
const turned = React.useRef(false);
|
|
78
|
+
React.useEffect(() => {
|
|
79
|
+
if (index !== undefined || count < 2 || run.state !== 'running') {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (!loop && active === count - 1) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
// `delay` is what happens before the reel starts turning at all, so it is
|
|
86
|
+
// added once rather than to every line — which is what an `interval` is.
|
|
87
|
+
const timer = setTimeout(() => {
|
|
88
|
+
turned.current = true;
|
|
89
|
+
advance();
|
|
90
|
+
}, interval + (turned.current ? 0 : delay));
|
|
91
|
+
return () => clearTimeout(timer);
|
|
92
|
+
}, [index, count, run.state, interval, delay, advance, loop, active]);
|
|
93
|
+
return (_jsx("div", { ref: (node) => {
|
|
94
|
+
run.ref(node);
|
|
95
|
+
if (typeof ref === 'function') {
|
|
96
|
+
ref(node);
|
|
97
|
+
}
|
|
98
|
+
else if (ref) {
|
|
99
|
+
ref.current = node;
|
|
100
|
+
}
|
|
101
|
+
}, className: cx('plass-headline', className), style: {
|
|
102
|
+
'--p-anim-duration': `${duration}ms`,
|
|
103
|
+
'--p-anim-rise': lengthValue(rise),
|
|
104
|
+
...(easing ? { '--p-anim-ease': easing } : {}),
|
|
105
|
+
'--p-anim-state': run.state,
|
|
106
|
+
...style
|
|
107
|
+
}, "data-plass-animation": "headline", "data-state": run.state, ...run.handlers, ...props, children: items.map((child, position) => {
|
|
108
|
+
const state = position === active ? 'active' : position === leaving && !reduced ? 'leaving' : undefined;
|
|
109
|
+
const wrap = (content, key) => (_jsx("span", { className: "plass-headline-item", "data-state": state, children: content }, key));
|
|
110
|
+
if (!React.isValidElement(child)) {
|
|
111
|
+
return wrap(child, position);
|
|
112
|
+
}
|
|
113
|
+
const childProps = child.props;
|
|
114
|
+
return React.cloneElement(child, {
|
|
115
|
+
key: position,
|
|
116
|
+
className: cx('plass-headline-item', childProps.className),
|
|
117
|
+
'data-state': state
|
|
118
|
+
});
|
|
119
|
+
}) }));
|
|
120
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PlAnimateHeadline } from './PlAnimateHeadline.js';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassAnimateProps, PlassColor, PlassSize } from '../../types.js';
|
|
4
|
+
export interface PlAnimateLightingProps extends PlassAnimateProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
|
|
5
|
+
/**
|
|
6
|
+
* Which family the light is drawn in. The arc turns between that family's two
|
|
7
|
+
* ends as it travels, exactly as a `solid` fill does.
|
|
8
|
+
* @default 'primary'
|
|
9
|
+
*/
|
|
10
|
+
color?: PlassColor;
|
|
11
|
+
/**
|
|
12
|
+
* A CSS colour, when a semantic family is not what is wanted. Overrides
|
|
13
|
+
* `color`, and the arc stops turning — one colour has nowhere to turn to.
|
|
14
|
+
*/
|
|
15
|
+
glow?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The radius the light follows, on the shared ladder. It has to match what is
|
|
18
|
+
* inside, or the glow will cut a corner the content has rounded off.
|
|
19
|
+
* @default 'md'
|
|
20
|
+
*/
|
|
21
|
+
size?: PlassSize;
|
|
22
|
+
/**
|
|
23
|
+
* How far past the content the light reaches, in pixels.
|
|
24
|
+
* @default 3
|
|
25
|
+
*/
|
|
26
|
+
spread?: number;
|
|
27
|
+
/**
|
|
28
|
+
* How much of the outline is lit at once, in degrees. Small is a travelling
|
|
29
|
+
* spark; large is a sweep.
|
|
30
|
+
* @default 50
|
|
31
|
+
*/
|
|
32
|
+
arc?: number;
|
|
33
|
+
/**
|
|
34
|
+
* How soft the light is, in pixels. At `0` it is a hard-edged wedge, which
|
|
35
|
+
* reads as a graphic rather than as light.
|
|
36
|
+
* @default 5
|
|
37
|
+
*/
|
|
38
|
+
blur?: number;
|
|
39
|
+
/** Runs the light the other way round. @default false */
|
|
40
|
+
reverse?: boolean;
|
|
41
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
42
|
+
render?: useRender.RenderProp;
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A light travelling around the outside of something.
|
|
47
|
+
*
|
|
48
|
+
* The light is **behind** the content rather than on it, so what a reader sees
|
|
49
|
+
* is a glow escaping from under the edges — which is why it works on a PlCard
|
|
50
|
+
* or a PlButton without touching anything about how they are drawn. Nothing
|
|
51
|
+
* inside is altered, nothing is overlaid, and the content stays exactly as
|
|
52
|
+
* legible as it was.
|
|
53
|
+
*
|
|
54
|
+
* The arc itself is a gradient that turns between the two ends of the family,
|
|
55
|
+
* which is the same rule every filled surface in the library follows: a flat
|
|
56
|
+
* coloured arc would be paint, and nothing here is paint.
|
|
57
|
+
*
|
|
58
|
+
* Use it to mark the one thing on a screen that is currently live — the row
|
|
59
|
+
* that is processing, the field being checked, the plan being recommended. It
|
|
60
|
+
* draws attention with light rather than by moving anything, which is the only
|
|
61
|
+
* way this library has of saying "here" without also saying "and it moved".
|
|
62
|
+
*
|
|
63
|
+
* `size` has to agree with the radius of what is inside it. The glow follows
|
|
64
|
+
* the wrapper's own corners, so an `lg` card in an `xs` Lighting will show light
|
|
65
|
+
* poking out of four corners the card has already rounded away.
|
|
66
|
+
*/
|
|
67
|
+
export declare const PlAnimateLighting: React.ForwardRefExoticComponent<PlAnimateLightingProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { isInfinite, useAnimateElement } from '../../internal/animate.js';
|
|
4
|
+
import { cx, radiusClasses } from '../../internal/styles.js';
|
|
5
|
+
/**
|
|
6
|
+
* A light travelling around the outside of something.
|
|
7
|
+
*
|
|
8
|
+
* The light is **behind** the content rather than on it, so what a reader sees
|
|
9
|
+
* is a glow escaping from under the edges — which is why it works on a PlCard
|
|
10
|
+
* or a PlButton without touching anything about how they are drawn. Nothing
|
|
11
|
+
* inside is altered, nothing is overlaid, and the content stays exactly as
|
|
12
|
+
* legible as it was.
|
|
13
|
+
*
|
|
14
|
+
* The arc itself is a gradient that turns between the two ends of the family,
|
|
15
|
+
* which is the same rule every filled surface in the library follows: a flat
|
|
16
|
+
* coloured arc would be paint, and nothing here is paint.
|
|
17
|
+
*
|
|
18
|
+
* Use it to mark the one thing on a screen that is currently live — the row
|
|
19
|
+
* that is processing, the field being checked, the plan being recommended. It
|
|
20
|
+
* draws attention with light rather than by moving anything, which is the only
|
|
21
|
+
* way this library has of saying "here" without also saying "and it moved".
|
|
22
|
+
*
|
|
23
|
+
* `size` has to agree with the radius of what is inside it. The glow follows
|
|
24
|
+
* the wrapper's own corners, so an `lg` card in an `xs` Lighting will show light
|
|
25
|
+
* poking out of four corners the card has already rounded away.
|
|
26
|
+
*/
|
|
27
|
+
export const PlAnimateLighting = /* @__PURE__ */ React.forwardRef(function PlAnimateLighting({ duration = 3000, delay = 0, easing, repeat = 'infinite', alternate, paused, trigger = 'mount', play, once = true, threshold = 0.2, color = 'primary', glow, size = 'md', spread = 3, arc = 50, blur = 5, reverse = false, render, className, style, children, ...props }, ref) {
|
|
28
|
+
const animate = useAnimateElement({
|
|
29
|
+
// The keyframe runs on a pseudo-element rather than on the root, so there
|
|
30
|
+
// is no effect class to apply here — only the slots it reads.
|
|
31
|
+
effect: null,
|
|
32
|
+
duration,
|
|
33
|
+
delay,
|
|
34
|
+
easing,
|
|
35
|
+
repeat,
|
|
36
|
+
alternate,
|
|
37
|
+
mode: reverse ? 'out' : 'in',
|
|
38
|
+
trigger,
|
|
39
|
+
play,
|
|
40
|
+
once,
|
|
41
|
+
threshold,
|
|
42
|
+
paused,
|
|
43
|
+
infinite: isInfinite(repeat)
|
|
44
|
+
});
|
|
45
|
+
return useRender({
|
|
46
|
+
render,
|
|
47
|
+
ref: [ref, animate.ref],
|
|
48
|
+
props: {
|
|
49
|
+
...props,
|
|
50
|
+
className: cx('plass-anim-lighting', radiusClasses[size], className),
|
|
51
|
+
style: {
|
|
52
|
+
...animate.style,
|
|
53
|
+
'--p-anim-glow-from': glow ?? `var(--plass-${color}-solid)`,
|
|
54
|
+
'--p-anim-glow-to': glow ?? `var(--plass-${color}-solid-to)`,
|
|
55
|
+
'--p-anim-glow-width': `${spread}px`,
|
|
56
|
+
'--p-anim-glow-arc': `${arc}deg`,
|
|
57
|
+
'--p-anim-glow-blur': `${blur}px`,
|
|
58
|
+
...style
|
|
59
|
+
},
|
|
60
|
+
...animate.props,
|
|
61
|
+
'data-plass-animation': 'lighting',
|
|
62
|
+
children
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PlAnimateLighting } from './PlAnimateLighting.js';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassAnimateProps, PlassOrientation } from '../../types.js';
|
|
3
|
+
export interface PlAnimateMarqueeProps extends PlassAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
4
|
+
/**
|
|
5
|
+
* Which way the strip runs.
|
|
6
|
+
* @default 'horizontal'
|
|
7
|
+
*/
|
|
8
|
+
orientation?: PlassOrientation;
|
|
9
|
+
/**
|
|
10
|
+
* Runs it the other way — left to right, or bottom to top.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
reverse?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* How fast the content travels, in pixels per second. A speed rather than a
|
|
16
|
+
* duration, so a strip of four logos and a strip of forty move at the same
|
|
17
|
+
* pace instead of the long one becoming a blur.
|
|
18
|
+
* @default 60
|
|
19
|
+
*/
|
|
20
|
+
speed?: number;
|
|
21
|
+
/**
|
|
22
|
+
* The gap between items, and between the last item and the first of the next
|
|
23
|
+
* pass — a CSS length, or a number in pixels.
|
|
24
|
+
* @default '2rem'
|
|
25
|
+
*/
|
|
26
|
+
gap?: number | string;
|
|
27
|
+
/**
|
|
28
|
+
* How many copies of the content are laid end to end. Two is enough for
|
|
29
|
+
* anything at least as wide as its container; raise it when the content is
|
|
30
|
+
* short enough to leave a hole behind itself.
|
|
31
|
+
* @default 2
|
|
32
|
+
*/
|
|
33
|
+
copies?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Stops while the pointer is on it, so something scrolling past can actually
|
|
36
|
+
* be read or clicked.
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
pauseOnHover?: boolean;
|
|
40
|
+
/** The things that scroll past. */
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Content scrolling steadily past, forever.
|
|
45
|
+
*
|
|
46
|
+
* The content is laid down twice, and each copy travels exactly its own length
|
|
47
|
+
* plus the gap — so the moment the first copy has left, the second is standing
|
|
48
|
+
* precisely where it began. There is no seam, no jump and no frame where the
|
|
49
|
+
* strip is empty, and none of that depends on measuring anything.
|
|
50
|
+
*
|
|
51
|
+
* What *is* measured is only the speed. A duration would mean a strip of four
|
|
52
|
+
* logos and a strip of forty crossing the same box in the same time, with the
|
|
53
|
+
* long one becoming unreadable; `speed` is pixels per second, so both move at
|
|
54
|
+
* the pace of a reader instead. The strip is re-measured whenever it changes
|
|
55
|
+
* size.
|
|
56
|
+
*
|
|
57
|
+
* `pauseOnHover` is on by default and is not decoration: content moving past a
|
|
58
|
+
* pointer cannot be clicked reliably, and a link inside a marquee that never
|
|
59
|
+
* stops is a link nobody can follow.
|
|
60
|
+
*
|
|
61
|
+
* Only the first copy is read out. The rest carry `aria-hidden`, or a screen
|
|
62
|
+
* reader would announce everything on the strip as many times as it was laid
|
|
63
|
+
* down.
|
|
64
|
+
*/
|
|
65
|
+
export declare const PlAnimateMarquee: React.ForwardRefExoticComponent<PlAnimateMarqueeProps & React.RefAttributes<HTMLDivElement>>;
|