plass-ui 0.0.1 → 1.0.1
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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -0
- package/dist/components/grid/PlGridItem.d.ts +50 -0
- package/dist/components/grid/PlGridItem.js +1 -0
- package/dist/components/grid/index.d.ts +4 -0
- package/dist/components/grid/index.js +1 -0
- package/dist/components/highlight/PlHighlight.d.ts +90 -0
- package/dist/components/highlight/PlHighlight.js +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +1 -1
- package/dist/internal/animate.d.ts +161 -0
- package/dist/internal/animate.js +1 -0
- package/dist/internal/button-group.d.ts +27 -0
- package/dist/internal/button-group.js +2 -0
- package/dist/internal/calendar.d.ts +148 -0
- package/dist/internal/calendar.js +1 -0
- package/dist/internal/date.d.ts +173 -0
- package/dist/internal/date.js +1 -0
- package/dist/internal/format.d.ts +24 -0
- package/dist/internal/format.js +1 -0
- package/dist/internal/grid.d.ts +67 -0
- package/dist/internal/grid.js +1 -0
- package/dist/internal/icons.d.ts +86 -1
- package/dist/internal/icons.js +1 -1
- package/dist/internal/menu.d.ts +20 -0
- package/dist/internal/menu.js +1 -0
- package/dist/internal/picker.d.ts +118 -0
- package/dist/internal/picker.js +1 -0
- package/dist/internal/progress.d.ts +145 -0
- package/dist/internal/progress.js +1 -0
- package/dist/internal/sizer.d.ts +32 -0
- package/dist/internal/sizer.js +1 -0
- package/dist/internal/styles.d.ts +198 -8
- package/dist/internal/styles.js +1 -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 +0 -8
- package/package.json +32 -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,98 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassElevation, PlassStyleProps } from '../../types.js';
|
|
3
|
+
export interface PlAccordionProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'defaultValue' | 'onChange'> {
|
|
4
|
+
/**
|
|
5
|
+
* Drop shadow depth. `0` is the default — an accordion is part of the page it
|
|
6
|
+
* is set into, not a panel floating over it.
|
|
7
|
+
* @default 0
|
|
8
|
+
*/
|
|
9
|
+
elevation?: PlassElevation;
|
|
10
|
+
/**
|
|
11
|
+
* Whether more than one section may be open at once.
|
|
12
|
+
*
|
|
13
|
+
* `false` by default, which is the whole reason an accordion is not just a
|
|
14
|
+
* stack of collapsibles: closing the last one as the next opens is what keeps
|
|
15
|
+
* the page from growing under the reader.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
/** Which sections are open. Use with `onValueChange` for a controlled accordion. */
|
|
20
|
+
value?: (string | number)[];
|
|
21
|
+
/** Which sections start open, for an uncontrolled one. */
|
|
22
|
+
defaultValue?: (string | number)[];
|
|
23
|
+
onValueChange?: (value: (string | number)[]) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Scores the sheet between sections with a hairline instead of separating
|
|
26
|
+
* them with space.
|
|
27
|
+
*
|
|
28
|
+
* On by default: the rule is what says the folds are parts of one pane rather
|
|
29
|
+
* than a stack of unrelated tiles.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
dividers?: boolean;
|
|
33
|
+
/** Unavailable. Every section stops answering. */
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Keeps closed panels in the DOM so the browser's own page search can find
|
|
37
|
+
* and open them. Overrides `keepMounted`.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
hiddenUntilFound?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Keeps closed panels in the DOM. For content that is expensive to build, or
|
|
43
|
+
* that holds form state which should survive being folded away.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
keepMounted?: boolean;
|
|
47
|
+
children?: React.ReactNode;
|
|
48
|
+
}
|
|
49
|
+
export interface PlAccordionItemProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title' | 'onChange'> {
|
|
50
|
+
/**
|
|
51
|
+
* Identifies the section to `value` / `defaultValue`. Base UI generates one
|
|
52
|
+
* when it is left out, which is enough for an accordion nobody drives from
|
|
53
|
+
* code.
|
|
54
|
+
*/
|
|
55
|
+
value?: string | number;
|
|
56
|
+
/** The heading on the fold. */
|
|
57
|
+
title?: React.ReactNode;
|
|
58
|
+
/** A second line under the title, one step down the type scale and muted. */
|
|
59
|
+
subtitle?: React.ReactNode;
|
|
60
|
+
/** Content before the title — an icon, a status dot, a count. */
|
|
61
|
+
startIcon?: React.ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* A control pinned to the end of the header, before the chevron.
|
|
64
|
+
*
|
|
65
|
+
* Deliberately outside the trigger: a header that both folds and holds a
|
|
66
|
+
* switch has two things to press, and one of them cannot be nested inside the
|
|
67
|
+
* other — the browser rewrites a `<button>` inside a `<button>` on parse.
|
|
68
|
+
*/
|
|
69
|
+
action?: React.ReactNode;
|
|
70
|
+
/** Unavailable. This section stops folding; the rest keep working. */
|
|
71
|
+
disabled?: boolean;
|
|
72
|
+
/** The body. */
|
|
73
|
+
children?: React.ReactNode;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A stack of sections, one of which is open.
|
|
77
|
+
*
|
|
78
|
+
* Base UI owns the parts that are genuinely hard: the `button` / `region`
|
|
79
|
+
* pairing and the `aria-controls` / `aria-expanded` wiring between them, the
|
|
80
|
+
* open set, and measuring the panel so it has a height to animate from.
|
|
81
|
+
*
|
|
82
|
+
* What is here is the sheet, the ladders and the one motion decision. The
|
|
83
|
+
* panel's height *is* animated, which looks like an exception to the rule
|
|
84
|
+
* against moving things and is not: nothing is transformed, no text is
|
|
85
|
+
* resampled, and the content does not shift relative to the panel it is in —
|
|
86
|
+
* the panel is a window opening onto it. An accordion whose sections appear
|
|
87
|
+
* instantly is a page that jumps, which is the failure the rule exists to
|
|
88
|
+
* prevent.
|
|
89
|
+
*/
|
|
90
|
+
export declare const PlAccordion: React.ForwardRefExoticComponent<PlAccordionProps & React.RefAttributes<HTMLDivElement>>;
|
|
91
|
+
/**
|
|
92
|
+
* One section.
|
|
93
|
+
*
|
|
94
|
+
* The header is always a row; what is inside it is a real `<button>` covering
|
|
95
|
+
* the title and the chevron, with `action` sitting outside that button as a
|
|
96
|
+
* control of its own.
|
|
97
|
+
*/
|
|
98
|
+
export declare const PlAccordionItem: React.ForwardRefExoticComponent<PlAccordionItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{Accordion as s}from"@base-ui/react/accordion";import{ChevronIcon as a}from"../../internal/icons.js";import{focusRingClasses as n,focusRingInsetClasses as i,gapClasses as r,hasContent as d,iconClasses as o,metaTextClasses as c,radiusClasses as p,sheetBodyClasses as m,sheetHeaderGapClasses as f,sheetPaddingXClasses as u,sheetPaddingYClasses as x,sheetRestClasses as h,sheetTitleClasses as v,surfaceSlots as b,transitionClasses as g}from"../../internal/styles.js";const N=/* @__PURE__ */l.createContext({size:"md",density:"default",dividers:!0}),j={xs:p.xs,sm:p.xs,md:p.sm,lg:p.sm,xl:p.md},y={default:{xs:"pt-1.5",sm:"pt-2",md:"pt-3",lg:"pt-3.5",xl:"pt-4"},compact:{xs:"pt-1",sm:"pt-1.5",md:"pt-2",lg:"pt-2.5",xl:"pt-3"}},w={default:{xs:"pb-2.5",sm:"pb-3",md:"pb-5",lg:"pb-6",xl:"pb-7"},compact:{xs:"pb-2",sm:"pb-2.5",md:"pb-3.5",lg:"pb-4",xl:"pb-5"}};export const PlAccordion=/* @__PURE__ */l.forwardRef(function PlAccordion({variant:t="glass",size:a="md",color:n="primary",density:i="default",elevation:r=0,multiple:d=!1,value:o,defaultValue:c,onValueChange:m,dividers:f=!0,disabled:u=!1,hiddenUntilFound:x=!1,keepMounted:v=!1,className:j,style:y,children:w,...P},$){const k=l.useMemo(()=>({size:a,density:i,dividers:f}),[a,i,f]),A=["flex flex-col",p[a],h[t],g,f?"overflow-hidden [&>div+div]:border-t [&>div+div]:[border-color:var(--plass-divider)]":"p-1",j??""].filter(Boolean).join(" ");return e(N.Provider,{value:k,children:e(s.Root,{ref:$,multiple:d,value:o,defaultValue:c,onValueChange:e=>m?.(e),disabled:u,hiddenUntilFound:x,keepMounted:v,className:A,style:{...b(n,r),...y},...P,children:w})})});export const PlAccordionItem=/* @__PURE__ */l.forwardRef(function PlAccordionItem({value:p,title:h,subtitle:b,startIcon:P,action:$,disabled:k=!1,className:A,children:z,...C},I){const{size:V,density:_,dividers:B}=l.useContext(N),M=u[_][V],R=x[_][V];return t(s.Item,{ref:I,value:p,disabled:k,className:["flex flex-col",A??""].filter(Boolean).join(" "),...C,children:[t(s.Header,{className:"m-0 flex w-full items-center [font:inherit]",children:[t(s.Trigger,{className:["flex min-w-0 flex-1 cursor-pointer items-center text-start",M,R,r[V],g,o,B?i:`${n} ${j[V]}`,"hover:bg-(--p-soft)","data-[panel-open]:bg-(--p-soft) data-[panel-open]:text-(--p-accent)","disabled:cursor-not-allowed disabled:bg-transparent disabled:opacity-50"].filter(Boolean).join(" "),children:[d(P)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:P}):null,t("span",{className:`flex min-w-0 flex-1 flex-col ${f[V]}`,children:[d(h)?e("span",{className:`plass-title truncate font-semibold ${v[V]}`,children:h}):null,d(b)?e("span",{className:`truncate text-(--plass-muted-fg) ${c[V]}`,children:b}):null]}),e("span",{className:["flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)","[transition:rotate_var(--plass-duration)_var(--plass-ease)]","data-[panel-open]:rotate-180"].join(" "),children:e(a,{})})]}),d($)?e("span",{className:`flex shrink-0 items-center ${M}`,children:$}):null]}),e(s.Panel,{className:["h-(--accordion-panel-height) overflow-hidden","[transition:height_var(--plass-duration-slow)_var(--plass-ease)]","data-[starting-style]:h-0 data-[ending-style]:h-0"].join(" "),children:e("div",{className:["text-(--plass-muted-fg)",m[V],M,y[_][V],w[_][V]].join(" "),children:z})})]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlAccordion,PlAccordionItem}from"./PlAccordion.js";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassElevation, PlassStyleProps } from '../../types.js';
|
|
3
|
+
export interface PlAlertProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'title'> {
|
|
4
|
+
/**
|
|
5
|
+
* Drop shadow depth. `0` is the default — an alert belongs to the flow of the
|
|
6
|
+
* page it interrupts. The one that floats above it is a dialog.
|
|
7
|
+
* @default 0
|
|
8
|
+
*/
|
|
9
|
+
elevation?: PlassElevation;
|
|
10
|
+
/**
|
|
11
|
+
* The heading line. With it the alert is two-part — a headline and the detail
|
|
12
|
+
* under it; without it the whole thing is one line.
|
|
13
|
+
*/
|
|
14
|
+
title?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The glyph at the start. Defaults to the one that goes with `color`; pass
|
|
17
|
+
* `false` to drop it, or a node to replace it. A node is sized in `em`, so it
|
|
18
|
+
* tracks whichever line it sits on.
|
|
19
|
+
*/
|
|
20
|
+
icon?: React.ReactNode | false;
|
|
21
|
+
/**
|
|
22
|
+
* Content pinned to the end of the row — a "Retry" button, a link. Kept out
|
|
23
|
+
* of `children` so it stays on the first line while the message wraps.
|
|
24
|
+
*/
|
|
25
|
+
action?: React.ReactNode;
|
|
26
|
+
/** Passing it is what makes the dismiss button appear. */
|
|
27
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Accessible name of the dismiss button. Never drawn.
|
|
30
|
+
* @default 'Dismiss'
|
|
31
|
+
*/
|
|
32
|
+
closeLabel?: string;
|
|
33
|
+
/** The message. */
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A message about something that happened, set into the page it is about.
|
|
38
|
+
*
|
|
39
|
+
* The three shapes people mean by "an alert" are one component with different
|
|
40
|
+
* slots filled rather than three components: a bare line
|
|
41
|
+
* (`<PlAlert icon={false}>`), a line with a glyph (the default), and a glyph
|
|
42
|
+
* with a headline and the detail under it (`title` plus `children`). Nothing
|
|
43
|
+
* about the surface changes between them — only how much of it is used.
|
|
44
|
+
*
|
|
45
|
+
* There is no Base UI primitive under this, and there should not be: an alert
|
|
46
|
+
* has no interaction to delegate. It is a live region with a layout, and the
|
|
47
|
+
* only interactive parts it can grow — the action and the dismiss button — are
|
|
48
|
+
* real buttons that the caller either passes in or gets by passing `onClose`.
|
|
49
|
+
*/
|
|
50
|
+
export declare const PlAlert: React.ForwardRefExoticComponent<PlAlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as s,jsxs as e}from"react/jsx-runtime";import*as l from"react";import{CloseIcon as t,severityIcon as a}from"../../internal/icons.js";import{controlSlots as i,focusRingClasses as r,glassClasses as n,hasContent as o,iconClasses as c,radiusClasses as d,sheetBodyClasses as f,sheetHeaderGapClasses as m,sheetPaddingXClasses as p,sheetPaddingYClasses as u,sheetSectionGapClasses as h,sheetTitleClasses as v,transitionClasses as x}from"../../internal/styles.js";const g={solid:/* @__PURE__ */["text-(--p-on-solid) [background-image:var(--p-fill)]","[box-shadow:var(--p-elev),var(--p-lift)]"].join(" "),glass:/* @__PURE__ */[n,"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)"},b={solid:"",glass:"text-(--p-accent)",ghost:"text-(--p-accent)"},y={solid:"",glass:"text-(--plass-muted-fg)",ghost:"text-(--plass-muted-fg)"},j={primary:"status",secondary:"status",info:"status",success:"status",warning:"alert",danger:"alert"};export const PlAlert=/* @__PURE__ */l.forwardRef(function PlAlert({variant:l="glass",size:n="md",color:N="info",density:w="default",elevation:k=0,title:$,icon:z,action:A,onClose:C,closeLabel:P="Dismiss",className:_,style:B,children:D,...L},R){const q=void 0===z?a(N):z,E=b[l],F=o($);return e("div",{ref:R,role:j[N],className:["flex w-full items-start",p[w][n],u[w][n],d[n],h[n],f[n],x,g[l],c,_??""].filter(Boolean).join(" "),style:{...i(N,k,l),...B},...L,children:[o(q)?s("span",{className:`flex h-[1lh] shrink-0 items-center ${E}`,children:q}):null,e("div",{className:`flex min-w-0 flex-1 flex-col ${m[n]}`,children:[F?s("div",{className:`plass-title font-semibold ${v[n]} ${E}`,children:$}):null,o(D)?s("div",{className:F?y[l]:void 0,children:D}):null]}),o(A)?s("div",{className:"flex h-[1lh] shrink-0 items-center",children:A}):null,C?s("span",{className:"flex h-[1lh] shrink-0 items-center",children:s("button",{type:"button","aria-label":P,onClick:C,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",r].join(" "),children:s(t,{})})}):null]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlAlert}from"./PlAlert.js";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassAnimateProps, PlassSide } from '../../types.js';
|
|
4
|
+
export interface PlAnimateAppearProps extends PlassAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
/**
|
|
6
|
+
* How long after one child the next one starts, in milliseconds. This is the
|
|
7
|
+
* whole effect — everything else is what a single child does.
|
|
8
|
+
* @default 70
|
|
9
|
+
*/
|
|
10
|
+
stagger?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Which edge each child drifts in from.
|
|
13
|
+
* @default 'bottom'
|
|
14
|
+
*/
|
|
15
|
+
from?: PlassSide;
|
|
16
|
+
/**
|
|
17
|
+
* How far each child travels. Short on purpose: this is a settling, not an
|
|
18
|
+
* entrance from off screen, and a long travel over a list of eight turns the
|
|
19
|
+
* whole block into something moving.
|
|
20
|
+
* @default '0.75rem'
|
|
21
|
+
*/
|
|
22
|
+
distance?: number | string;
|
|
23
|
+
/**
|
|
24
|
+
* Fades each child in as it settles.
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
fade?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Runs the list from the last child to the first.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
reverse?: boolean;
|
|
33
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
34
|
+
render?: useRender.RenderProp;
|
|
35
|
+
/** The things that appear, one after another. */
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A list of things settling into place one after another.
|
|
40
|
+
*
|
|
41
|
+
* Each child takes the same short drift and fade, held back by its position — so
|
|
42
|
+
* the effect belongs to the *set* rather than to any one item, and a reader's
|
|
43
|
+
* eye is walked down the list in the order it should be read.
|
|
44
|
+
*
|
|
45
|
+
* The animation is written onto the children themselves rather than onto
|
|
46
|
+
* wrappers around them. A row of `<li>`s stays a row of `<li>`s, a grid's cells
|
|
47
|
+
* stay its direct children, and nothing about the layout changes because the
|
|
48
|
+
* list is being animated. Only a bare string has no element to write onto, so
|
|
49
|
+
* that one is wrapped in a `<span>`.
|
|
50
|
+
*
|
|
51
|
+
* The stagger is per *child*, which means what you pass matters: eight children
|
|
52
|
+
* are eight steps, and one child holding eight things is one step. That is also
|
|
53
|
+
* how to opt part of a list out — group it.
|
|
54
|
+
*/
|
|
55
|
+
export declare const PlAnimateAppear: React.ForwardRefExoticComponent<PlAnimateAppearProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as a from"react";import{useRender as t}from"@base-ui/react/use-render";import{animBaseClass as r,animationClasses as s,animationSlots as n,isInfinite as i,slideOffsets as l,useAnimationRun as o}from"../../internal/animate.js";import{cx as m}from"../../internal/styles.js";export const PlAnimateAppear=/* @__PURE__ */a.forwardRef(function PlAnimateAppear({duration:p=380,delay:d=0,easing:c,repeat:f=1,alternate:y,paused:u,trigger:h="mount",play:g,once:x=!0,threshold:A=.2,stagger:N=70,from:j="bottom",distance:b="0.75rem",fade:E=!0,reverse:P=!1,render:$,className:v,style:w,children:C,...R},V){const k=o({trigger:h,play:g,once:x,threshold:A,paused:u,infinite:i(f)}),{x:q,y:z}=l(j,b),B=a.Children.toArray(C),D=`${r} ${s.slide}`,F=B.map((t,r)=>{const s=P?B.length-1-r:r,i=n({duration:p,delay:d+s*N,easing:c,repeat:f,alternate:y,x:q,y:z,opacity:E?0:1});if(!a.isValidElement(t))return e("span",{className:D,style:i,children:t},r);const l=t.props;return a.cloneElement(t,{className:m(D,l.className),style:{...i,...l.style}})});return t({render:$,ref:[V,k.ref],props:{...R,className:v,style:{"--p-anim-state":k.state,...w},...k.handlers,"data-plass-animation":"appear","data-state":k.state,children:F}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlAnimateAppear}from"./PlAnimateAppear.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
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'> {
|
|
5
|
+
/**
|
|
6
|
+
* How faint it gets at the bottom of the cycle, between `0` and `1`. Raise it
|
|
7
|
+
* for something that has to stay readable while it pulses.
|
|
8
|
+
* @default 0
|
|
9
|
+
*/
|
|
10
|
+
min?: number;
|
|
11
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
12
|
+
render?: useRender.RenderProp;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Content pulsing between full opacity and a floor.
|
|
17
|
+
*
|
|
18
|
+
* The cycle is symmetric — full, faint, full — so however many times it runs it
|
|
19
|
+
* ends where it started. A blink that finished halfway would leave the element
|
|
20
|
+
* permanently half drawn, which reads as a rendering fault rather than as an
|
|
21
|
+
* effect that ended.
|
|
22
|
+
*
|
|
23
|
+
* It repeats forever unless told otherwise, because a single blink is a flicker
|
|
24
|
+
* and nobody asks for a flicker. Two things are worth saying about using it at
|
|
25
|
+
* all: something that never stops moving in the corner of a page being read is
|
|
26
|
+
* the one kind of motion this library otherwise refuses, and a reader with a
|
|
27
|
+
* reduced-motion preference will see none of it — so `min` is a dimming, never
|
|
28
|
+
* the only thing carrying the message. If it is urgent, say so in words too.
|
|
29
|
+
*/
|
|
30
|
+
export declare const PlAnimateBlink: React.ForwardRefExoticComponent<PlAnimateBlinkProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as n}from"../../internal/animate.js";import{cx as a}from"../../internal/styles.js";export const PlAnimateBlink=/* @__PURE__ */e.forwardRef(function PlAnimateBlink({duration:e=1e3,delay:i=0,easing:s,repeat:l="infinite",alternate:o,paused:m,trigger:p="mount",play:c,once:d=!0,threshold:f=.2,min:u=0,render:y,className:g,style:h,children:k,...N},b){const j=n({effect:"blink",duration:e,delay:i,easing:s,repeat:l,alternate:o,opacity:u,trigger:p,play:c,once:d,threshold:f,paused:m,infinite:t(l)});return r({render:y,ref:[b,j.ref],props:{...N,className:a(j.className,g),style:{...j.style,...h},...j.props,children:k}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlAnimateBlink}from"./PlAnimateBlink.js";
|
|
@@ -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 @@
|
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as a,useAnimateElement as t}from"../../internal/animate.js";import{cx as n}from"../../internal/styles.js";export const PlAnimateFade=/* @__PURE__ */e.forwardRef(function PlAnimateFade({duration:e=300,delay:s=0,easing:o,repeat:i=1,alternate:l,paused:d,trigger:m="mount",play:p,once:c=!0,threshold:f=.2,mode:u="in",from:y=0,render:g,className:h,style:N,children:j,...A},F){const P=t({effect:"fade",duration:e,delay:s,easing:o,repeat:i,alternate:l,mode:u,opacity:y,trigger:m,play:p,once:c,threshold:f,paused:d,infinite:a(i)});return r({render:g,ref:[F,P.ref],props:{...A,className:n(P.className,h),style:{...P.style,...N},...P.props,children:j}})});
|
|
@@ -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 @@
|
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";import{cx as n}from"../../internal/styles.js";export const PlAnimateGrow=/* @__PURE__ */e.forwardRef(function PlAnimateGrow({duration:e=320,delay:o=0,easing:i,repeat:s=1,alternate:l,paused:m,trigger:c="mount",play:d,once:p=!0,threshold:f=.2,mode:u="in",from:g=.8,origin:y="center",fade:h=!0,render:w,className:N,style:j,children:A,...G},P){const b=a({effect:"grow",duration:e,delay:o,easing:i,repeat:s,alternate:l,mode:u,scale:g,opacity:h?0:1,trigger:c,play:d,once:p,threshold:f,paused:m,infinite:t(s)});return r({render:w,ref:[P,b.ref],props:{...G,className:n(b.className,N),style:{transformOrigin:y,...b.style,...j},...b.props,children:A}})});
|
|
@@ -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 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{isInfinite as n,lengthValue as a,useAnimationRun as r,usePrefersReducedMotion as i}from"../../internal/animate.js";import{cx as s}from"../../internal/styles.js";export const PlAnimateHeadline=/* @__PURE__ */t.forwardRef(function PlAnimateHeadline({duration:l=460,delay:o=0,easing:u,repeat:c="infinite",paused:m,trigger:d="mount",play:f,once:p=!0,threshold:h=.2,interval:g=2600,index:v,defaultIndex:y=0,onIndexChange:x,loop:E=!0,rise:N="100%",className:j,style:T,children:A,...C},R){const k=r({trigger:d,play:f,once:p,threshold:h,paused:m,infinite:n(c)}),H=i(),I=t.Children.toArray(A),M=I.length,[P,S]=t.useState(y),b=Math.min(v??P,Math.max(M-1,0)),[w,V]=t.useState(null),$=t.useRef(b);t.useEffect(()=>{$.current!==b&&(V($.current),$.current=b)},[b]),t.useEffect(()=>{if(null===w)return;const e=setTimeout(()=>V(null),l);return()=>clearTimeout(e)},[w,l]);const q=t.useCallback(()=>{const e=b+1;if(e>=M){if(!E)return;return void 0===v&&S(0),void x?.(0)}void 0===v&&S(e),x?.(e)},[b,M,E,v,x]),z=t.useRef(!1);return t.useEffect(()=>{if(void 0!==v||M<2||"running"!==k.state)return;if(!E&&b===M-1)return;const e=setTimeout(()=>{z.current=!0,q()},g+(z.current?0:o));return()=>clearTimeout(e)},[v,M,k.state,g,o,q,E,b]),e("div",{ref:e=>{k.ref(e),"function"==typeof R?R(e):R&&(R.current=e)},className:s("plass-headline",j),style:{"--p-anim-duration":`${l}ms`,"--p-anim-rise":a(N),...u?{"--p-anim-ease":u}:{},"--p-anim-state":k.state,...T},"data-plass-animation":"headline","data-state":k.state,...k.handlers,...C,children:I.map((n,a)=>{const r=a===b?"active":a!==w||H?void 0:"leaving";if(!t.isValidElement(n))return e("span",{className:"plass-headline-item","data-state":r,children:n},a);const i=n.props;return t.cloneElement(n,{key:a,className:s("plass-headline-item",i.className),"data-state":r})})})});
|
|
@@ -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 @@
|
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as a,useAnimateElement as i}from"../../internal/animate.js";import{cx as t,radiusClasses as n}from"../../internal/styles.js";export const PlAnimateLighting=/* @__PURE__ */e.forwardRef(function PlAnimateLighting({duration:e=3e3,delay:l=0,easing:o,repeat:s="infinite",alternate:p,paused:m,trigger:d="mount",play:g,once:c=!0,threshold:f=.2,color:u="primary",glow:h,size:y="md",spread:w=3,arc:$=50,blur:b=5,reverse:v=!1,render:x,className:j,style:A,children:L,...N},P){const z=i({effect:null,duration:e,delay:l,easing:o,repeat:s,alternate:p,mode:v?"out":"in",trigger:d,play:g,once:c,threshold:f,paused:m,infinite:a(s)});return r({render:x,ref:[P,z.ref],props:{...N,className:t("plass-anim-lighting",n[y],j),style:{...z.style,"--p-anim-glow-from":h??`var(--plass-${u}-solid)`,"--p-anim-glow-to":h??`var(--plass-${u}-solid-to)`,"--p-anim-glow-width":`${w}px`,"--p-anim-glow-arc":`${$}deg`,"--p-anim-glow-blur":`${b}px`,...A},...z.props,"data-plass-animation":"lighting",children:L}})});
|
|
@@ -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>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{isInfinite as a,lengthValue as r,repeatValue as n,directionValue as s,useAnimationRun as i}from"../../internal/animate.js";import{cx as o}from"../../internal/styles.js";export const PlAnimateMarquee=/* @__PURE__ */t.forwardRef(function PlAnimateMarquee({duration:l,delay:u=0,easing:m,repeat:p="infinite",alternate:c,paused:d,trigger:f="mount",play:h,once:v=!0,threshold:y=.2,orientation:g="horizontal",reverse:q=!1,speed:R=60,gap:b="2rem",copies:j=2,pauseOnHover:x=!0,className:M,style:w,children:z,...A},N){const O=i({trigger:f,play:h,once:v,threshold:y,paused:d,infinite:a(p)}),G=t.useRef(null),H=t.useRef(null),[P,S]=t.useState(0),$="vertical"===g;t.useEffect(()=>{const e=G.current,t=H.current;if(!e||!t)return;const measure=()=>{const a=getComputedStyle(e),r=parseFloat($?a.rowGap:a.columnGap)||0,n=$?t.offsetHeight:t.offsetWidth;S(n+r)};if(measure(),"undefined"==typeof ResizeObserver)return;const a=new ResizeObserver(measure);return a.observe(t),a.observe(e),()=>a.disconnect()},[$,z]);const k=l??(P>0?P/R*1e3:12e3);return e("div",{ref:e=>{G.current=e,O.ref(e),"function"==typeof N?N(e):N&&(N.current=e)},className:o("plass-marquee",$&&"plass-marquee-vertical",M),style:{"--p-anim-gap":r(b),...m?{"--p-anim-ease":m}:{},"--p-anim-duration":`${Math.round(k)}ms`,"--p-anim-delay":`${u}ms`,"--p-anim-repeat":n(p),"--p-anim-direction":s(q?"out":"in",c),"--p-anim-state":O.state,...w},"data-plass-animation":"marquee","data-state":O.state,"data-pause-on-hover":x?"":void 0,...O.handlers,...A,children:Array.from({length:Math.max(1,j)},(t,a)=>(t=>e("div",{ref:0===t?H:void 0,className:"plass-marquee-track","aria-hidden":0===t?void 0:"true",children:z},t))(a))})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlAnimateMarquee}from"./PlAnimateMarquee.js";
|