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,111 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassElevation, PlassPosition, PlassStyleProps } from '../../types.js';
|
|
4
|
+
/** A destination's value. The same restraint `PlTabs` and `PlSegmentedButton` put on theirs. */
|
|
5
|
+
export type PlBottomNavigationValue = string | number;
|
|
6
|
+
/**
|
|
7
|
+
* Which names are drawn.
|
|
8
|
+
*
|
|
9
|
+
* - `all` — every destination is named. The default, and the only one that works
|
|
10
|
+
* for a reader who has not used the app before.
|
|
11
|
+
* - `selected` — only the destination that is current. The bar keeps its height
|
|
12
|
+
* either way, because the named one is always the tallest; what changes is how
|
|
13
|
+
* much of the row is words. The names the other items lose are still in the
|
|
14
|
+
* document for a screen reader.
|
|
15
|
+
* - `none` — glyphs only, with every name read out but never drawn.
|
|
16
|
+
*/
|
|
17
|
+
export type PlBottomNavigationLabels = 'all' | 'selected' | 'none';
|
|
18
|
+
export interface PlBottomNavigationProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'nav'>, 'color' | 'defaultValue' | 'onChange'> {
|
|
19
|
+
/** The destination the reader is on. Use with `onValueChange` for a controlled bar. */
|
|
20
|
+
value?: PlBottomNavigationValue | null;
|
|
21
|
+
/** Which starts current, for an uncontrolled bar. */
|
|
22
|
+
defaultValue?: PlBottomNavigationValue | null;
|
|
23
|
+
onValueChange?: (value: PlBottomNavigationValue) => void;
|
|
24
|
+
/**
|
|
25
|
+
* How the bar sits in the page's scroll.
|
|
26
|
+
*
|
|
27
|
+
* `fixed` — the default here, against the `static` a layout component would
|
|
28
|
+
* take — is what a bottom navigation *is*: held against the bottom edge of the
|
|
29
|
+
* window whatever the page does.
|
|
30
|
+
* @default 'fixed'
|
|
31
|
+
*/
|
|
32
|
+
position?: PlassPosition;
|
|
33
|
+
/** Which names are drawn. @default 'all' */
|
|
34
|
+
labels?: PlBottomNavigationLabels;
|
|
35
|
+
/**
|
|
36
|
+
* Draws a hairline along the top edge, against the content the bar is over.
|
|
37
|
+
*
|
|
38
|
+
* On by default: a bar pinned over a scrolling page has content passing
|
|
39
|
+
* underneath it at every moment, and a translucent sheet with nothing marking
|
|
40
|
+
* its edge reads as part of that.
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
divider?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Keeps the bar clear of the home indicator on a phone, by adding
|
|
46
|
+
* `env(safe-area-inset-bottom)` under it. The sheet still reaches the bottom
|
|
47
|
+
* of the screen; only the items move up.
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
safeArea?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Drop shadow depth. `0` is the default and it is flat: the bar is attached to
|
|
53
|
+
* the edge of the window rather than floating over the middle of it, and
|
|
54
|
+
* `divider` is what separates it from the content.
|
|
55
|
+
* @default 0
|
|
56
|
+
*/
|
|
57
|
+
elevation?: PlassElevation;
|
|
58
|
+
/** Every destination stops answering. */
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
/** The name the bar is announced by — "Main", "Sections". */
|
|
61
|
+
label?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Renders something other than a `<nav>`. Base UI's own escape hatch, and
|
|
64
|
+
* rarely what you want here: a row of destinations is navigation.
|
|
65
|
+
*/
|
|
66
|
+
render?: useRender.RenderProp;
|
|
67
|
+
/** The `PlBottomNavigationItem`s. */
|
|
68
|
+
children?: React.ReactNode;
|
|
69
|
+
}
|
|
70
|
+
export interface PlBottomNavigationItemProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'value' | 'color'> {
|
|
71
|
+
/** Identifies the destination. What `onValueChange` reports. */
|
|
72
|
+
value: PlBottomNavigationValue;
|
|
73
|
+
/** The glyph above the name. Sized on the standalone-glyph ladder. */
|
|
74
|
+
icon?: React.ReactNode;
|
|
75
|
+
/** Renders the item as a link rather than as a button. */
|
|
76
|
+
href?: string;
|
|
77
|
+
/** Unavailable, but still part of the set. */
|
|
78
|
+
disabled?: boolean;
|
|
79
|
+
/** The destination's name. Read out even when `labels` keeps it undrawn. */
|
|
80
|
+
children?: React.ReactNode;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A row of destinations held against the bottom edge of the window.
|
|
84
|
+
*
|
|
85
|
+
* It is a `<nav>` rather than a `role="tablist"`, and its items are ordinary
|
|
86
|
+
* links or buttons rather than tabs. That is a deliberate choice about what is
|
|
87
|
+
* being promised: a tab list owes a keyboard reader one tab stop for the whole
|
|
88
|
+
* set and arrow keys within it, and it owes a screen reader a panel per tab. A
|
|
89
|
+
* bottom navigation switches what the *page* is, not which panel of one is
|
|
90
|
+
* showing, and claiming the role without the behaviour is worse for a keyboard
|
|
91
|
+
* reader than never claiming it. What is claimed instead is `aria-current`,
|
|
92
|
+
* which is the honest statement: this is the destination you are on.
|
|
93
|
+
*
|
|
94
|
+
* The sheet is never dyed, exactly as on a `PlCard`. What carries the colour
|
|
95
|
+
* family is the one item that is current.
|
|
96
|
+
*/
|
|
97
|
+
export declare const PlBottomNavigation: React.ForwardRefExoticComponent<PlBottomNavigationProps & React.RefAttributes<HTMLElement>>;
|
|
98
|
+
/**
|
|
99
|
+
* One destination.
|
|
100
|
+
*
|
|
101
|
+
* It has no `size`, no `color` and no `variant` of its own: all three belong to
|
|
102
|
+
* the bar, which is the only place they can be set once and mean the same thing
|
|
103
|
+
* for every item.
|
|
104
|
+
*
|
|
105
|
+
* With an `href` it is a real `<a>`, which is what makes a long press offer
|
|
106
|
+
* "open in a new tab" and what puts the destination in the status bar — neither
|
|
107
|
+
* of which a `<button>` that calls `router.push` can do. Without one it is a
|
|
108
|
+
* `<button>`, because a `<div>` carrying a click handler is invisible to a
|
|
109
|
+
* keyboard.
|
|
110
|
+
*/
|
|
111
|
+
export declare const PlBottomNavigationItem: React.ForwardRefExoticComponent<PlBottomNavigationItemProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,Fragment as a,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{useRender as s}from"@base-ui/react/use-render";import{cx as i,focusRingInsetClasses as n,hasContent as r,iconSizeClasses as o,metaTextClasses as c,radiusClasses as d,sheetLineClasses as m,sheetRestClasses as u,srOnlyClasses as p,surfaceSlots as f,transitionClasses as g}from"../../internal/styles.js";const h=/* @__PURE__ */l.createContext({value:null,change:()=>{},size:"md",density:"default",labels:"all",disabled:!1}),x={static:"",sticky:"sticky bottom-0 z-20",fixed:"fixed inset-x-0 bottom-0 z-30"},v={xs:"min-h-10",sm:"min-h-12",md:"min-h-14",lg:"min-h-16",xl:"min-h-18"},b={default:{xs:"p-1",sm:"p-1",md:"p-1.5",lg:"p-2",xl:"p-2.5"},compact:{xs:"p-0.5",sm:"p-0.5",md:"p-1",lg:"p-1",xl:"p-1.5"}},y={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const PlBottomNavigation=/* @__PURE__ */l.forwardRef(function PlBottomNavigation({variant:a="glass",size:t="md",color:n="primary",density:r="default",elevation:o=0,value:c,defaultValue:p=null,onValueChange:y,position:N="fixed",labels:w="all",divider:z=!0,safeArea:k=!0,disabled:C=!1,label:j,render:P,className:B,style:I,children:R,...V},A){const[D,F]=l.useState(p),M=void 0!==c,S=M?c:D,q=l.useCallback(e=>{M||F(e),y?.(e)},[M,y]),E=l.useMemo(()=>({value:S??null,change:q,size:t,density:r,labels:w,disabled:C}),[S,q,t,r,w,C]),G=i("w-full min-w-0","static"===N?d[t]:"",u[a],"glass"===a&&"static"!==N?"border-0":"",z?m:"",x[N],k?"pb-[env(safe-area-inset-bottom)]":"",g,B);return s({render:P??e("nav",{}),ref:A,props:{"aria-label":j,className:G,style:{...f(n,o),...I},children:e(h.Provider,{value:E,children:e("div",{className:i("flex w-full items-stretch",v[t],b[r][t]),children:R})}),...V}})});export const PlBottomNavigationItem=/* @__PURE__ */l.forwardRef(function PlBottomNavigationItem({value:s,icon:m,href:u,disabled:f=!1,className:x,children:v,onClick:b,...N},w){const z=l.useContext(h),k=f||z.disabled,C=null!==z.value&&z.value===s,j="all"===z.labels||"selected"===z.labels&&C,P=i("flex min-w-0 flex-1 flex-col items-center justify-center px-1 py-1.5",y[z.size],d[z.size],"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",g,n,k?"cursor-not-allowed opacity-50 saturate-[0.35] text-(--plass-muted-fg)":C?"cursor-pointer font-medium text-(--p-accent) bg-(--p-soft) hover:bg-(--p-soft-hover)":"cursor-pointer text-(--plass-muted-fg) hover:text-(--plass-fg) hover:bg-(--plass-glass-hover)",x),B=t(a,{children:[r(m)?e("span",{className:i("flex shrink-0 items-center justify-center",o[z.size]),children:m}):null,r(v)?e("span",{className:j?i("max-w-full truncate leading-tight",c[z.size]):p,children:v}):null]}),press=e=>{k?e.preventDefault():(z.change(s),b?.(e))};return u?e("a",{ref:w,href:k?void 0:u,"aria-current":C?"page":void 0,"aria-disabled":k||void 0,className:P,onClick:press,...N,children:B}):e("button",{ref:w,type:"button",disabled:k,"aria-current":C?"page":void 0,className:P,onClick:press,...N,children:B})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlBottomNavigation,PlBottomNavigationItem}from"./PlBottomNavigation.js";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassElevation, PlassStyleProps } from '../../types.js';
|
|
4
|
+
export interface PlBoxProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
|
|
5
|
+
/**
|
|
6
|
+
* Drop shadow depth. `0` is the default and it is flat — the glass edge is
|
|
7
|
+
* what separates the box from the page. Raise it only for a surface that
|
|
8
|
+
* genuinely floats above the content around it.
|
|
9
|
+
* @default 0
|
|
10
|
+
*/
|
|
11
|
+
elevation?: PlassElevation;
|
|
12
|
+
/**
|
|
13
|
+
* Inner padding, on the `size` / `density` scale. Turn it off for full-bleed
|
|
14
|
+
* content — an image, a table, a list that draws its own rows.
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
padded?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Renders something other than a `<div>`: `render={<section />}`,
|
|
20
|
+
* `render={<li />}`, or a function for full control. Base UI's own escape
|
|
21
|
+
* hatch, so it behaves the same here as on every Base UI primitive.
|
|
22
|
+
*/
|
|
23
|
+
render?: useRender.RenderProp;
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A sheet of glass with content on it. The plainest surface in the library: it
|
|
28
|
+
* groups things, and that is all it does.
|
|
29
|
+
*
|
|
30
|
+
* Everything structural — a title, a footer, hairlines between sections —
|
|
31
|
+
* belongs to `PlCard`, which is a box with those sections laid out on it. What
|
|
32
|
+
* is left here is the sheet itself, and the reason it is worth having on its own
|
|
33
|
+
* is that most of what a screen groups has no heading: a well behind a form, a
|
|
34
|
+
* tile in a shelf, a panel round a chart.
|
|
35
|
+
*
|
|
36
|
+
* `size` means something different here from what it means on a control, and
|
|
37
|
+
* this is the one place in the library where that is true. A box is as tall as
|
|
38
|
+
* what it holds, and its children bring their own typography — a container that
|
|
39
|
+
* reset the type scale would render the same paragraph at two sizes depending
|
|
40
|
+
* on what it was wrapped in. So `size` is the size of the **sheet**: its radius
|
|
41
|
+
* and its padding, and nothing else.
|
|
42
|
+
*
|
|
43
|
+
* The three materials say what they say everywhere else, read as a container's:
|
|
44
|
+
* the sheet is never dyed, because what a box holds arrives with its own
|
|
45
|
+
* colours and tinting the pane under them puts every one on a background it was
|
|
46
|
+
* not chosen against. The family reaches the hairline and the focus ring and
|
|
47
|
+
* stops. `ghost` is the one to reach for inside another surface, where a second
|
|
48
|
+
* bordered rectangle is a second rectangle.
|
|
49
|
+
*/
|
|
50
|
+
export declare const PlBox: React.ForwardRefExoticComponent<PlBoxProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{useRender as s}from"@base-ui/react/use-render";import{cx as t,radiusClasses as o,sheetPaddingXClasses as a,sheetPaddingYClasses as i,sheetRestClasses as n,surfaceSlots as l,transitionClasses as c}from"../../internal/styles.js";export const PlBox=/* @__PURE__ */r.forwardRef(function PlBox({variant:r="glass",size:d="md",color:m="primary",density:f="default",elevation:p=0,padded:u=!0,render:x,className:y,style:j,children:v,...b},h){const B=t("block",o[d],u?`${a[f][d]} ${i[f][d]}`:"",n[r],c,y);return s({render:x??e("div",{}),ref:h,props:{className:B,style:{...l(m,p),...j},children:v,...b}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlBox}from"./PlBox.js";
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassColor, PlassDensity, PlassSize } from '../../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* What is drawn between two steps of the trail.
|
|
5
|
+
*
|
|
6
|
+
* Four named marks rather than a free-for-all, because a separator is read
|
|
7
|
+
* hundreds of times a day and the difference between them is meaning, not
|
|
8
|
+
* decoration: a `chevron` and an `arrow` say "and then", a `slash` says "path",
|
|
9
|
+
* a `dot` says "these are peers of one thing". Anything else can still be passed
|
|
10
|
+
* as a node.
|
|
11
|
+
*/
|
|
12
|
+
export type PlBreadcrumbSeparator = 'chevron' | 'arrow' | 'slash' | 'dot';
|
|
13
|
+
export interface PlBreadcrumbProps extends Omit<React.ComponentPropsWithoutRef<'nav'>, 'color'> {
|
|
14
|
+
/** @default 'md' */
|
|
15
|
+
size?: PlassSize;
|
|
16
|
+
/**
|
|
17
|
+
* The colour family a link picks up when it is hovered.
|
|
18
|
+
* @default 'primary'
|
|
19
|
+
*/
|
|
20
|
+
color?: PlassColor;
|
|
21
|
+
/**
|
|
22
|
+
* How tightly the steps pack. Spacing only.
|
|
23
|
+
* @default 'default'
|
|
24
|
+
*/
|
|
25
|
+
density?: PlassDensity;
|
|
26
|
+
/**
|
|
27
|
+
* The mark between two steps. One of the four names, or any node.
|
|
28
|
+
* @default 'chevron'
|
|
29
|
+
*/
|
|
30
|
+
separator?: PlBreadcrumbSeparator | React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* How many steps to show before the middle is folded away behind a `…`. Left
|
|
33
|
+
* out, the whole trail is shown however long it gets.
|
|
34
|
+
*/
|
|
35
|
+
maxItems?: number;
|
|
36
|
+
/**
|
|
37
|
+
* How many steps stay at the front of a folded trail.
|
|
38
|
+
* @default 1
|
|
39
|
+
*/
|
|
40
|
+
itemsBeforeCollapse?: number;
|
|
41
|
+
/**
|
|
42
|
+
* How many stay at the end.
|
|
43
|
+
* @default 1
|
|
44
|
+
*/
|
|
45
|
+
itemsAfterCollapse?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Whether pressing the `…` unfolds the trail in place. Turn it off to leave
|
|
48
|
+
* the fold as a plain mark.
|
|
49
|
+
* @default true
|
|
50
|
+
*/
|
|
51
|
+
expandable?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The name the trail is announced by. Never drawn.
|
|
54
|
+
* @default 'Breadcrumb'
|
|
55
|
+
*/
|
|
56
|
+
label?: string;
|
|
57
|
+
/**
|
|
58
|
+
* What the `…` is announced as. Never drawn.
|
|
59
|
+
* @default 'Show the hidden steps'
|
|
60
|
+
*/
|
|
61
|
+
expandLabel?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Emits the trail a second time as a `BreadcrumbList`, in a
|
|
64
|
+
* `<script type="application/ld+json">` beside the markup.
|
|
65
|
+
*
|
|
66
|
+
* Off by default, because a page can only have one of these and a great many
|
|
67
|
+
* apps already emit theirs from an SEO layer of their own — two would be a
|
|
68
|
+
* page describing itself twice. Turn it on where this component *is* the
|
|
69
|
+
* trail: correct markup alone is not what puts a path under a search result,
|
|
70
|
+
* and the structured data is.
|
|
71
|
+
*
|
|
72
|
+
* Every step goes in, including the ones a `maxItems` fold is hiding — what is
|
|
73
|
+
* collapsed is a matter of how much room the row has, and the path is the path
|
|
74
|
+
* either way.
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
structuredData?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* What relative `href`s are resolved against for `structuredData` — the site's
|
|
80
|
+
* origin, as `https://example.com`.
|
|
81
|
+
*
|
|
82
|
+
* Search engines want an absolute URL there. Without this the `href`s are
|
|
83
|
+
* emitted exactly as written, which is right when they are already absolute
|
|
84
|
+
* and not much use when they are not.
|
|
85
|
+
*/
|
|
86
|
+
baseUrl?: string;
|
|
87
|
+
/** The `PlBreadcrumbItem`s. */
|
|
88
|
+
children?: React.ReactNode;
|
|
89
|
+
}
|
|
90
|
+
export interface PlBreadcrumbItemProps extends Omit<React.ComponentPropsWithoutRef<'li'>, 'color' | 'onClick'> {
|
|
91
|
+
/** Renders the step as a link. */
|
|
92
|
+
href?: string;
|
|
93
|
+
/** Fires when the step is pressed. Renders it as a button when there is no `href`. */
|
|
94
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
95
|
+
/** Content before the label — a home glyph, a repository avatar. */
|
|
96
|
+
startIcon?: React.ReactNode;
|
|
97
|
+
/** Content after the label. */
|
|
98
|
+
endIcon?: React.ReactNode;
|
|
99
|
+
/**
|
|
100
|
+
* Marks this step as the page you are on, which stops it being a link.
|
|
101
|
+
*
|
|
102
|
+
* The last step is the current one on its own, so this is only needed for a
|
|
103
|
+
* trail that ends somewhere the reader is not — and setting it anywhere takes
|
|
104
|
+
* the mark off the last step, because only one step in a trail can be it.
|
|
105
|
+
*/
|
|
106
|
+
current?: boolean;
|
|
107
|
+
/** Unavailable. Stops answering, keeps its place in the trail. */
|
|
108
|
+
disabled?: boolean;
|
|
109
|
+
/** The step's label. */
|
|
110
|
+
children?: React.ReactNode;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The trail of pages above the one being read.
|
|
114
|
+
*
|
|
115
|
+
* Two things make this more than a row of links. The first is that the last step
|
|
116
|
+
* is where the reader already is, so it is not a link at all — it carries
|
|
117
|
+
* `aria-current="page"` and stops being pressable, and the component works that
|
|
118
|
+
* out rather than asking every caller to remember it. The second is the fold: a
|
|
119
|
+
* trail seven levels deep is a trail nobody reads, so the middle collapses to a
|
|
120
|
+
* `…` that puts it back when pressed.
|
|
121
|
+
*
|
|
122
|
+
* The separators are drawn by the trail rather than by the steps. A step does
|
|
123
|
+
* not know whether anything follows it, and a mark that belonged to a step would
|
|
124
|
+
* have to be taken off the last one by hand.
|
|
125
|
+
*
|
|
126
|
+
* There is no `variant` and no `elevation`: a trail is a line of text above the
|
|
127
|
+
* page, not a surface laid on it.
|
|
128
|
+
*/
|
|
129
|
+
export declare const PlBreadcrumb: React.ForwardRefExoticComponent<PlBreadcrumbProps & React.RefAttributes<HTMLElement>>;
|
|
130
|
+
/**
|
|
131
|
+
* One step of the trail.
|
|
132
|
+
*
|
|
133
|
+
* It renders three different things and the caller picks by what they pass: an
|
|
134
|
+
* `<a>` with an `href`, a `<button>` with an `onClick`, and a plain `<span>` with
|
|
135
|
+
* neither — which is what the last step is, because the page you are already on
|
|
136
|
+
* is not somewhere to go.
|
|
137
|
+
*/
|
|
138
|
+
export declare const PlBreadcrumbItem: React.ForwardRefExoticComponent<PlBreadcrumbItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as a from"react";import{ArrowRightIcon as s,ChevronIcon as n,EllipsisIcon as l}from"../../internal/icons.js";import{controlTextClasses as i,cx as c,focusRingClasses as o,gapClasses as m,hasContent as p,iconClasses as d,radiusClasses as u,transitionClasses as f}from"../../internal/styles.js";const h=/* @__PURE__ */a.createContext({size:"md",last:!1}),x={default:{xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"},compact:{xs:"gap-0.5",sm:"gap-1",md:"gap-1",lg:"gap-1.5",xl:"gap-2"}},g={xs:u.xs,sm:u.xs,md:u.xs,lg:u.sm,xl:u.sm},b=["chevron","arrow","slash","dot"];function textOf(e){return"string"==typeof e||"number"==typeof e?String(e):Array.isArray(e)?e.map(textOf).join(""):a.isValidElement(e)?textOf(e.props.children):""}function absoluteHref(e,t){if(!t)return e;try{return new URL(e,t).href}catch{return e}}function breadcrumbListData(e,t){const r=e.map((e,r)=>{const{href:a,children:s}=e.props;return{"@type":"ListItem",position:r+1,name:textOf(s),...a?{item:absoluteHref(a,t)}:null}});return JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:r}).replace(/</g,"\\u003c")}export const PlBreadcrumb=/* @__PURE__ */a.forwardRef(function PlBreadcrumb({size:r="md",color:m="primary",density:p="default",separator:u="chevron",maxItems:g,itemsBeforeCollapse:y=1,itemsAfterCollapse:N=1,expandable:v=!0,label:w="Breadcrumb",expandLabel:k="Show the hidden steps",structuredData:C=!1,baseUrl:B,className:L,style:j,children:I,...S},M){const[O,P]=a.useState(!1),z=a.Children.toArray(I).filter(a.isValidElement),A=z.length,D=z.some(e=>!0===e.props.current),E=!O&&void 0!==g&&A>Math.max(g,1)&&A-y-N>1?[...z.slice(0,Math.max(0,y)),null,...z.slice(A-Math.max(0,N))]:z,H=function isSeparatorName(e){return"string"==typeof e&&b.includes(e)}(u)?function separatorMark(t){switch(t){case"chevron":return e("span",{className:"flex -rotate-90 items-center rtl:rotate-90",children:e(n,{})});case"arrow":return e("span",{className:"flex items-center rtl:rotate-180",children:e(s,{})});case"slash":return e("span",{className:"opacity-70",children:"/"});case"dot":return e("span",{className:"opacity-70",children:"·"});default:return null}}(u):u,R=c("inline-flex items-center rounded-(--plass-radius-xs) px-0.5","text-(--plass-muted-fg)",f,d,v?c("cursor-pointer hover:bg-(--p-soft) hover:text-(--p-accent)",o):"");return t("nav",{ref:M,"aria-label":w,className:c("flex",i[r],d,L),style:{"--p-accent":`var(--plass-${m}-accent)`,"--p-soft":`var(--plass-${m}-soft)`,"--p-ring":`var(--plass-${m}-ring)`,...j},...S,children:[C&&A>0?e("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:breadcrumbListData(z,B)}}):null,e("ol",{role:"list",className:c("flex list-none flex-wrap items-center p-0",x[p][r]),children:E.map((s,n)=>t(a.Fragment,{children:[n>0?e("li",{"aria-hidden":"true",className:"flex shrink-0 items-center text-(--plass-muted-fg) select-none",children:H}):null,s?e(h.Provider,{value:{size:r,last:!D&&n===E.length-1},children:s}):e("li",{className:"flex shrink-0 items-center",children:v?e("button",{type:"button",className:R,"aria-label":k,onClick:()=>P(!0),children:e(l,{})}):e("span",{className:R,"aria-hidden":"true",children:e(l,{})})})]},s?s.key??n:"fold"))})]})});export const PlBreadcrumbItem=/* @__PURE__ */a.forwardRef(function PlBreadcrumbItem({href:s,onClick:n,startIcon:l,endIcon:i,current:d,disabled:u=!1,className:x,children:b,...y},N){const{size:v,last:w}=a.useContext(h),k=d??w,C=Boolean(s||n)&&!k&&!u,B=c("inline-flex min-w-0 items-center px-1",m[v],g[v],f,u?"cursor-not-allowed text-(--plass-muted-fg) opacity-50":k?"font-medium text-(--plass-fg)":C?c("cursor-pointer text-(--plass-muted-fg)","hover:bg-(--p-soft) hover:text-(--p-accent)",o):"text-(--plass-muted-fg)"),L=t(r,{children:[p(l)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:l}):null,e("span",{className:"truncate",children:b}),p(i)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:i}):null]});return e("li",{ref:N,className:c("flex min-w-0 items-center",x),...y,children:C&&s?e("a",{href:s,className:B,onClick:n,children:L}):C?e("button",{type:"button",className:B,onClick:n,children:L}):e("span",{className:B,"aria-current":k?"page":void 0,"aria-disabled":u||void 0,children:L})})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlBreadcrumb,PlBreadcrumbItem}from"./PlBreadcrumb.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { PlassElevation, PlassStyleProps } from '../../types';
|
|
4
|
-
export interface
|
|
3
|
+
import type { PlassElevation, PlassStyleProps } from '../../types.js';
|
|
4
|
+
export interface PlButtonProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'button'>, 'color'> {
|
|
5
5
|
/**
|
|
6
6
|
* Drop shadow depth. `1` is the default, because a moulded key **rests on**
|
|
7
7
|
* the sheet rather than lying flush with it. Hover adds a level and pressing
|
|
@@ -39,4 +39,4 @@ export interface ButtonProps extends PlassStyleProps, Omit<React.ComponentPropsW
|
|
|
39
39
|
render?: useRender.RenderProp;
|
|
40
40
|
children?: React.ReactNode;
|
|
41
41
|
}
|
|
42
|
-
export declare const
|
|
42
|
+
export declare const PlButton: React.ForwardRefExoticComponent<PlButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as s,Fragment as e,jsxs as o}from"react/jsx-runtime";import*as r from"react";import{Button as a}from"@base-ui/react/button";import{useRender as t}from"@base-ui/react/use-render";import{ButtonGroupContext as l}from"../../internal/button-group.js";import{Spinner as n}from"../../internal/icons.js";import{controlHeightClasses as i,controlSlots as p,controlSquareClasses as d,controlTextClasses as v,disabledClasses as c,focusRingClasses as g,gapClasses as m,glassClasses as x,hasContent as b,iconClasses as f,paddingXClasses as h,radiusClasses as u,readOnlyFilterClasses as $,transitionClasses as j}from"../../internal/styles.js";const y={xs:`${i.xs} ${m.xs} ${u.xs} ${v.xs}`,sm:`${i.sm} ${m.sm} ${u.sm} ${v.sm}`,md:`${i.md} ${m.md} ${u.md} ${v.md}`,lg:`${i.lg} ${m.lg} ${u.lg} ${v.lg}`,xl:`${i.xl} ${m.xl} ${u.xl} ${v.xl}`},w={xs:`${d.xs} px-0`,sm:`${d.sm} px-0`,md:`${d.md} px-0`,lg:`${d.lg} px-0`,xl:`${d.xl} px-0`},P=/* @__PURE__ */["relative inline-flex shrink-0 select-none items-center justify-center","whitespace-nowrap align-middle font-semibold leading-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",j,g,f].join(" "),k={solid:/* @__PURE__ */["text-(--p-on-solid) [background-image:var(--p-fill)]","[box-shadow:var(--p-elev),var(--p-lift)]"].join(" "),glass:/* @__PURE__ */[x,"border text-(--p-accent) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--p-accent) bg-transparent"},B={solid:/* @__PURE__ */["hover:brightness-105","hover:[box-shadow:var(--p-elev-hover),var(--p-lift-hover)]","active:brightness-95","active:[box-shadow:var(--p-elev-press),var(--p-lift-press)]"].join(" "),glass:/* @__PURE__ */["hover:bg-(--plass-glass-hover) hover:[border-color:var(--p-line)]","hover:[box-shadow:var(--p-elev-hover),var(--plass-gloss-glass)]","active:bg-(--plass-glass-press)","active:[box-shadow:var(--p-elev-press),var(--plass-gloss-glass)]"].join(" "),ghost:"hover:bg-(--p-soft) active:bg-(--p-soft-hover)"},C={solid:/* @__PURE__ */["cursor-default text-(--p-on-solid) [background-image:var(--p-fill)]",`shadow-none ${$}`].join(" "),glass:/* @__PURE__ */[x,"cursor-default border text-(--p-accent) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]",`[box-shadow:var(--plass-gloss-glass)] ${$}`].join(" "),ghost:`cursor-default text-(--p-accent) bg-transparent ${$}`};export const PlButton=/* @__PURE__ */r.forwardRef(function PlButton({variant:i,size:d,color:v,density:g,elevation:m,startIcon:x,endIcon:f,loading:u=!1,readOnly:$=!1,fullWidth:j=!1,disabled:z,render:E,className:I,style:M,children:N,onClick:D,onPointerMove:F,...O},R){const T=r.useContext(l),W=i??T?.variant??"solid",X=d??T?.size??"md",Y=v??T?.color??"primary",q=g??T?.density??"default",A=m??T?.elevation??1,G=z??T?.disabled??!1,H=!b(N),J=u||$,K=!G&&!J,L=[P,y[X],H?w[X]:h[q][X],G?c[W]:$?C[W]:k[W],K?`${B[W]} cursor-pointer`:"",K?"plass-glow":"",u?"cursor-progress":"",j?"w-full":"",I??""].filter(Boolean).join(" ");return t({render:E??s(a,{disabled:G}),ref:R,props:{className:L,style:{...p(Y,A,W),...M},"aria-disabled":J||void 0,"aria-busy":u||void 0,"data-loading":u||void 0,"data-readonly":$||void 0,onClick:s=>{if(J)return s.preventDefault(),void s.stopPropagation();D?.(s)},onPointerMove:s=>{const e=s.currentTarget;e.style.setProperty("--p-mx",`${s.nativeEvent.offsetX}px`),e.style.setProperty("--p-my",`${s.nativeEvent.offsetY}px`),F?.(s)},...O,children:o(e,{children:[u?s(n,{}):x,N,f]})}})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { PlButton } from './PlButton.js';
|
|
2
|
+
export type { PlButtonProps } from './PlButton.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{PlButton}from"./PlButton.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassElevation, PlassOrientation, PlassStyleProps } from '../../types.js';
|
|
3
|
+
export interface PlButtonGroupProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
|
|
4
|
+
/**
|
|
5
|
+
* Which way the buttons run. A vertical group is a stacked menu of equal
|
|
6
|
+
* actions; a horizontal one is the default because that is what a toolbar is.
|
|
7
|
+
* @default 'horizontal'
|
|
8
|
+
*/
|
|
9
|
+
orientation?: PlassOrientation;
|
|
10
|
+
/** Drop shadow depth, passed to every button in the group. */
|
|
11
|
+
elevation?: PlassElevation;
|
|
12
|
+
/** Disables every button in the group at once. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** Stretches to the container and divides the width evenly between buttons. */
|
|
15
|
+
fullWidth?: boolean;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A run of buttons that belong together.
|
|
20
|
+
*
|
|
21
|
+
* Two things are happening here and only one of them is visual. The corners
|
|
22
|
+
* that face a neighbour are squared off — that is the look. The other half is
|
|
23
|
+
* that `variant`, `size`, `color`, `density`, `elevation` and `disabled` are
|
|
24
|
+
* stated once for the set rather than repeated on every button; a group where
|
|
25
|
+
* one button is a size out is the failure this exists to prevent.
|
|
26
|
+
*
|
|
27
|
+
* The buttons stay real `PlButton`s and nothing about them is replaced. Which
|
|
28
|
+
* also means this is **not** a segmented control and it does not manage
|
|
29
|
+
* selection: for one-of-a-set reach for `PlSegmentedButton`, which is what that
|
|
30
|
+
* actually is.
|
|
31
|
+
*/
|
|
32
|
+
export declare const PlButtonGroup: React.ForwardRefExoticComponent<PlButtonGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import*as e from"react";import{ButtonGroupContext as i}from"../../internal/button-group.js";import{cx as t}from"../../internal/styles.js";const n={horizontal:"[&>*:not(:first-child)]:rounded-s-none [&>*:not(:last-child)]:rounded-e-none",vertical:"[&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none"},r={horizontal:"[&>*:not(:first-child)]:-ms-px",vertical:"[&>*:not(:first-child)]:-mt-px"},l=/* @__PURE__ */["inline-flex align-middle","[&>*]:relative [&>*:hover]:z-10 [&>*:focus-visible]:z-10","[&>*]:shrink-0"].join(" ");export const PlButtonGroup=/* @__PURE__ */e.forwardRef(function PlButtonGroup({variant:s,size:a,color:d,density:c,elevation:f,orientation:u="horizontal",disabled:h,fullWidth:m=!1,className:v,children:p,...x},z){const b=e.useMemo(()=>({variant:s,size:a,color:d,density:c,elevation:f,disabled:h}),[s,a,d,c,f,h]);return o(i.Provider,{value:b,children:o("div",{ref:z,role:"group",className:t(l,"vertical"===u?"flex-col":"flex-row",n[u],"glass"===(s??"solid")?r[u]:"",m?"flex w-full [&>*]:flex-1":"",v),...x,children:p})})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlButtonGroup}from"./PlButtonGroup.js";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassElevation, PlassStyleProps } from '../../types.js';
|
|
4
|
+
export interface PlCardProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'title'> {
|
|
5
|
+
/**
|
|
6
|
+
* Drop shadow depth. `1` is the default: a card is a sheet lying **on** the
|
|
7
|
+
* page wash rather than printed into it, and the small amount of grey under
|
|
8
|
+
* it is what says so.
|
|
9
|
+
* @default 1
|
|
10
|
+
*/
|
|
11
|
+
elevation?: PlassElevation;
|
|
12
|
+
/**
|
|
13
|
+
* The card's heading. A plain string is styled as the title; pass a real
|
|
14
|
+
* heading element (`title={<h2>…</h2>}`) when the card belongs in the
|
|
15
|
+
* document outline — it inherits the title's typography rather than the
|
|
16
|
+
* browser's.
|
|
17
|
+
*/
|
|
18
|
+
title?: React.ReactNode;
|
|
19
|
+
/** A second line under the title, one step down the type scale and muted. */
|
|
20
|
+
subtitle?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Content pinned to the end of the header row — a menu button, a status
|
|
23
|
+
* chip. Stays on the title's line while the title wraps beside it.
|
|
24
|
+
*/
|
|
25
|
+
headerAction?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* The bottom area. Laid out as a wrapping row so a pair of buttons needs no
|
|
28
|
+
* wrapper of its own; anything else can bring its own layout.
|
|
29
|
+
*/
|
|
30
|
+
footer?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Scores the sheet between sections with a hairline instead of separating
|
|
33
|
+
* them with space. The rules run the full width, so the padding moves from
|
|
34
|
+
* the card onto each section.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
dividers?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Inner padding, on the `size` / `density` scale. Turn it off for full-bleed
|
|
40
|
+
* content — an image, a table, a list that draws its own rows.
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
padded?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Lifts the sheet under the pointer and adds a level of elevation.
|
|
46
|
+
*
|
|
47
|
+
* This is the one place the library allows a `transform`, and the exception
|
|
48
|
+
* is the rule rather than a hole in it: what may not move is the thing under
|
|
49
|
+
* the finger — a key whose label resamples as it scales. A sheet that
|
|
50
|
+
* *holds* content is the other kind of surface, and lifting one is how a
|
|
51
|
+
* pane of glass says it can be picked up.
|
|
52
|
+
*
|
|
53
|
+
* It changes how the card looks and nothing else. A card that is actually
|
|
54
|
+
* clickable has to be a real element: `render={<a href="…" />}` or
|
|
55
|
+
* `render={<button type="button" />}`, so it is focusable, announced, and
|
|
56
|
+
* reachable from a keyboard.
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
interactive?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Renders something other than a `<div>`: `render={<section />}`,
|
|
62
|
+
* `render={<li />}`, `render={<a href="…" />}`. Base UI's own escape hatch.
|
|
63
|
+
*/
|
|
64
|
+
render?: useRender.RenderProp;
|
|
65
|
+
/** The card's body. */
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The sheet everything else on a screen is grouped onto, with the parts a card
|
|
70
|
+
* is made of laid out on it: a title, a subtitle, a body and a footer.
|
|
71
|
+
*
|
|
72
|
+
* The sections are props rather than compound sub-components — `<Card.Header>`,
|
|
73
|
+
* `<Card.Title>` — for the same reason `PlTextField` takes `label` and
|
|
74
|
+
* `description` as props: the arrangement is fixed, and what a caller wants to
|
|
75
|
+
* decide is what goes in each slot, not what order the slots come in.
|
|
76
|
+
*
|
|
77
|
+
* There is no Base UI primitive under this, and there should not be. A card has
|
|
78
|
+
* no interaction to delegate: it is a surface with a layout, and the moment it
|
|
79
|
+
* becomes something you press it is a `render` away from being a real one.
|
|
80
|
+
*/
|
|
81
|
+
export declare const PlCard: React.ForwardRefExoticComponent<PlCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as s,Fragment as r}from"react/jsx-runtime";import*as a from"react";import{useRender as l}from"@base-ui/react/use-render";import{focusRingClasses as o,hasContent as t,metaTextClasses as n,radiusClasses as i,sheetBodyClasses as c,sheetHeaderGapClasses as d,sheetLineClasses as v,sheetPaddingXClasses as p,sheetPaddingYClasses as m,sheetRestClasses as f,sheetSectionGapClasses as h,sheetTitleClasses as u,surfaceSlots as g}from"../../internal/styles.js";const x=/* @__PURE__ */["[transition-property:background-color,border-color,box-shadow,color,transform]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]"].join(" "),b={solid:/* @__PURE__ */["cursor-pointer hover:-translate-y-0.5","hover:[box-shadow:var(--p-elev-hover),var(--plass-gloss-glass)]","active:translate-y-0 active:[box-shadow:var(--p-elev-press),var(--plass-gloss-glass)]"].join(" "),glass:/* @__PURE__ */["cursor-pointer hover:-translate-y-0.5 hover:bg-(--plass-glass-hover)","hover:[border-color:var(--p-line)]","hover:[box-shadow:var(--p-elev-hover),var(--plass-gloss-glass)]","active:translate-y-0 active:[box-shadow:var(--p-elev-press),var(--plass-gloss-glass)]"].join(" "),ghost:"cursor-pointer hover:bg-(--p-soft) active:bg-(--p-soft-hover)"};export const PlCard=/* @__PURE__ */a.forwardRef(function PlCard({variant:a="glass",size:y="md",color:N="primary",density:$="default",elevation:j=1,title:w,subtitle:k,headerAction:B,footer:C,dividers:P=!1,padded:z=!0,interactive:A=!1,render:F,className:R,style:q,children:D,...E},G){const H=z?p[$][y]:"",I=z?m[$][y]:"",J=P?`${H} ${I}`:H,K=t(w)||t(k)||t(B),L=s(r,{children:[t(w)||t(k)?s("div",{className:`flex min-w-0 flex-1 flex-col ${d[y]}`,children:[t(w)?e("div",{className:`plass-title font-semibold ${u[y]}`,children:w}):null,t(k)?e("div",{className:`text-(--plass-muted-fg) ${n[y]}`,children:k}):null]}):null,t(B)?e("div",{className:"ml-auto shrink-0",children:B}):null]}),M=[K?{key:"header",className:"flex items-start gap-3",content:L}:null,t(D)?{key:"content",className:c[y],content:D}:null,t(C)?{key:"footer",className:`flex flex-wrap items-center gap-2 ${c[y]}`,content:C}:null].filter(e=>null!==e),O=["flex flex-col",i[y],f[a],x,A?`${b[a]} ${o}`:"",P?"overflow-hidden":`${I} ${h[y]}`,R??""].filter(Boolean).join(" ");return l({render:F??e("div",{}),ref:G,props:{className:O,style:{...g(N,j),...q},...E,children:M.map((s,r)=>e("div",{className:[J,s.className,P&&r>0?v:""].filter(Boolean).join(" "),children:s.content},s.key))}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlCard}from"./PlCard.js";
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassElevation, PlassStyleProps } from '../../types.js';
|
|
3
|
+
export interface PlCarouselProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'defaultValue' | 'onChange'> {
|
|
4
|
+
/**
|
|
5
|
+
* Drop shadow depth of the frame. `0` — the default — is flat.
|
|
6
|
+
* @default 0
|
|
7
|
+
*/
|
|
8
|
+
elevation?: PlassElevation;
|
|
9
|
+
/** Which slide is showing, counted from 0. Use with `onValueChange`. */
|
|
10
|
+
value?: number;
|
|
11
|
+
/** Which starts showing, for an uncontrolled carousel. @default 0 */
|
|
12
|
+
defaultValue?: number;
|
|
13
|
+
onValueChange?: (index: number) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the arrows wrap from the last slide back to the first. With it off
|
|
16
|
+
* they go inert at the ends instead, which is the honest thing for a set that
|
|
17
|
+
* has a beginning and an end — a gallery of three photographs does, a
|
|
18
|
+
* rotating banner does not.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
loop?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Advances on its own.
|
|
24
|
+
*
|
|
25
|
+
* Off by default and deliberately so: a carousel that moves while it is being
|
|
26
|
+
* read is the most complained-about pattern on the web. It pauses on hover,
|
|
27
|
+
* on focus anywhere inside it, while the tab is in the background, and it
|
|
28
|
+
* does not start at all for a reader who has asked for reduced motion.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
autoPlay?: boolean;
|
|
32
|
+
/** How long each slide is held, in milliseconds. @default 5000 */
|
|
33
|
+
interval?: number;
|
|
34
|
+
/** The previous/next buttons. @default true */
|
|
35
|
+
arrows?: boolean;
|
|
36
|
+
/** The row of position dots under the frame. @default true */
|
|
37
|
+
indicators?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The carousel's accessible name, and what the arrows and the dots are called.
|
|
40
|
+
* Never drawn.
|
|
41
|
+
* @default 'Carousel'
|
|
42
|
+
*/
|
|
43
|
+
label?: string;
|
|
44
|
+
/** @default 'Previous slide' */
|
|
45
|
+
previousLabel?: string;
|
|
46
|
+
/** @default 'Next slide' */
|
|
47
|
+
nextLabel?: string;
|
|
48
|
+
/**
|
|
49
|
+
* How one slide is named to a screen reader, and how its dot is labelled.
|
|
50
|
+
* @default (index, count) => `Slide ${index} of ${count}`
|
|
51
|
+
*/
|
|
52
|
+
slideLabel?: (index: number, count: number) => string;
|
|
53
|
+
/** The slides. Every top-level child becomes one. */
|
|
54
|
+
children?: React.ReactNode;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A strip of slides, one of which is in view.
|
|
58
|
+
*
|
|
59
|
+
* The mechanism is a scroll container with CSS scroll snapping, and everything
|
|
60
|
+
* good about this component follows from that one choice. Swiping on a phone
|
|
61
|
+
* and two-finger dragging on a trackpad both work because they are the
|
|
62
|
+
* browser's own scrolling and not a gesture handler pretending to be it. The
|
|
63
|
+
* strip runs the other way under RTL without being told, because scrolling is
|
|
64
|
+
* directional and `translate` is not. And nothing is transformed — the house
|
|
65
|
+
* rule against moving a surface holds here for free, where a translated track
|
|
66
|
+
* would have had to argue for an exception.
|
|
67
|
+
*
|
|
68
|
+
* The motion is `scroll-behavior: smooth`, which means a reader who has asked
|
|
69
|
+
* for reduced motion gets an instant cut from the same code path rather than
|
|
70
|
+
* from a second one written to remember them.
|
|
71
|
+
*
|
|
72
|
+
* Slides are not a sub-component. Every top-level child is wrapped in its own
|
|
73
|
+
* slide, so `<PlCarousel><img /><img /></PlCarousel>` is the whole API — and the
|
|
74
|
+
* wrapper is what carries the snap point, the width and the
|
|
75
|
+
* `role="group"` / `aria-roledescription="slide"` pair a screen reader needs,
|
|
76
|
+
* none of which a caller should have to remember to put on a photograph.
|
|
77
|
+
*/
|
|
78
|
+
export declare const PlCarousel: React.ForwardRefExoticComponent<PlCarouselProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{PlIconButton as a}from"../icon-button/PlIconButton.js";import{ChevronIcon as n}from"../../internal/icons.js";import{cx as s,radiusClasses as l,sheetRestClasses as i,srOnlyClasses as o,surfaceSlots as c,transitionClasses as u}from"../../internal/styles.js";const d={xs:"start-1 end-1",sm:"start-1.5 end-1.5",md:"start-2 end-2",lg:"start-3 end-3",xl:"start-4 end-4"},f={xs:{rest:"h-1 w-1",current:"h-1 w-3",gap:"gap-1"},sm:{rest:"h-1 w-1",current:"h-1 w-3.5",gap:"gap-1"},md:{rest:"h-1.5 w-1.5",current:"h-1.5 w-4",gap:"gap-1.5"},lg:{rest:"h-1.5 w-1.5",current:"h-1.5 w-5",gap:"gap-2"},xl:{rest:"h-2 w-2",current:"h-2 w-6",gap:"gap-2"}};export const PlCarousel=/* @__PURE__ */t.forwardRef(function PlCarousel({variant:m="glass",size:p="md",color:h="primary",density:v="default",elevation:b=0,value:w,defaultValue:g=0,onValueChange:x,loop:N=!0,autoPlay:y=!1,interval:k=5e3,arrows:C=!0,indicators:M=!0,label:j="Carousel",previousLabel:P="Previous slide",nextLabel:R="Next slide",slideLabel:I,className:L,style:S,children:$,..._},z){const E=I??((e,r)=>`Slide ${e} of ${r}`),V=t.Children.toArray($),B=V.length,[T,W]=t.useState(g),A=Math.min(Math.max(w??T,0),Math.max(B-1,0)),F=t.useRef(null),q=t.useRef([]),D=t.useRef(!1),G=t.useRef(!1),H=t.useRef(!1),[J,K]=t.useState(!1),O=t.useCallback((e,r=!1)=>{if(0===B)return;const t=N?(e%B+B)%B:Math.min(Math.max(e,0),B-1);D.current=r,void 0===w&&W(t),t!==A&&x?.(t)},[B,N,w,A,x]);t.useEffect(()=>{if(D.current)return void(D.current=!1);if(!G.current)return void(G.current=!0);q.current[A]?.scrollIntoView({block:"nearest",inline:"start"}),H.current=!0;const e=window.setTimeout(()=>{H.current=!1},700);return()=>window.clearTimeout(e)},[A]),t.useEffect(()=>{if(!y||J||B<2)return;if(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;const e=window.setInterval(()=>{document.hidden||O(A+1)},k);return()=>window.clearInterval(e)},[y,J,B,k,A,O]);const Q=A<=0,U=A>=B-1;return r("div",{ref:z,role:"region","aria-roledescription":"carousel","aria-label":j,className:s("flex flex-col",L),style:{...c(h,b),...S},onPointerEnter:()=>K(!0),onPointerLeave:()=>K(!1),onFocus:()=>K(!0),onBlur:()=>K(!1),..._,children:[r("div",{className:s("relative min-w-0 overflow-hidden",l[p],i[m],u),children:[e("div",{ref:F,tabIndex:0,role:"group","aria-label":j,className:s("flex min-w-0 snap-x snap-mandatory overflow-x-auto scroll-smooth","motion-reduce:scroll-auto","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]"),onScroll:()=>{const e=F.current;if(H.current||!e||0===e.clientWidth)return;const r=Math.round(Math.abs(e.scrollLeft)/e.clientWidth);r!==A&&r>=0&&r<B&&O(r,!0)},children:V.map((r,t)=>e("div",{ref:e=>{q.current[t]=e},role:"group","aria-roledescription":"slide","aria-label":E(t+1,B),className:"w-full shrink-0 grow-0 basis-full snap-start",children:r},t))}),C&&B>1?r("div",{className:s("pointer-events-none absolute inset-y-0 flex items-center",d[p]),children:[e(a,{variant:"glass",size:p,color:h,density:v,elevation:1,label:P,disabled:!N&&Q,className:"pointer-events-auto",icon:e("span",{className:"flex rotate-90 items-center rtl:-rotate-90",children:e(n,{})}),onClick:()=>O(A-1)}),e("span",{className:"flex-1"}),e(a,{variant:"glass",size:p,color:h,density:v,elevation:1,label:R,disabled:!N&&U,className:"pointer-events-auto",icon:e("span",{className:"flex -rotate-90 items-center rtl:rotate-90",children:e(n,{})}),onClick:()=>O(A+1)})]}):null]}),M&&B>1?e("div",{className:s("flex shrink-0 items-center justify-center pt-2",f[p].gap),children:V.map((r,t)=>e("button",{type:"button","aria-label":E(t+1,B),"aria-current":t===A?"true":void 0,className:s("cursor-pointer rounded-full","[transition-property:width,background-color]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:outline-offset-2",t===A?`${f[p].current} bg-(--p-accent)`:`${f[p].rest} bg-(--plass-border) hover:bg-(--p-accent)`),onClick:()=>O(t)},t))}):null,e("span",{className:o,"aria-live":y?"off":"polite",children:B>0?E(A+1,B):""})]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlCarousel}from"./PlCarousel.js";
|