plass-ui 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +962 -0
- package/README.md +19 -17
- package/dist/components/accordion/PlAccordion.d.ts +1 -1
- package/dist/components/alert/PlAlert.js +1 -1
- package/dist/components/anchor/PlAnchor.d.ts +85 -0
- package/dist/components/anchor/PlAnchor.js +1 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.js +1 -0
- package/dist/components/animate-appear/PlAnimateAppear.d.ts +10 -0
- package/dist/components/animate-appear/PlAnimateAppear.js +1 -1
- package/dist/components/animate-blink/PlAnimateBlink.d.ts +2 -2
- package/dist/components/animate-blink/PlAnimateBlink.js +1 -1
- package/dist/components/animate-counter/PlAnimateCounter.d.ts +83 -0
- package/dist/components/animate-counter/PlAnimateCounter.js +1 -0
- package/dist/components/animate-counter/index.d.ts +2 -0
- package/dist/components/animate-counter/index.js +1 -0
- package/dist/components/animate-fade/PlAnimateFade.d.ts +2 -2
- package/dist/components/animate-fade/PlAnimateFade.js +1 -1
- package/dist/components/animate-float/PlAnimateFloat.d.ts +51 -0
- package/dist/components/animate-float/PlAnimateFloat.js +1 -0
- package/dist/components/animate-float/index.d.ts +2 -0
- package/dist/components/animate-float/index.js +1 -0
- package/dist/components/animate-grow/PlAnimateGrow.d.ts +2 -2
- package/dist/components/animate-grow/PlAnimateGrow.js +1 -1
- package/dist/components/animate-headline/PlAnimateHeadline.js +1 -1
- package/dist/components/animate-lighting/PlAnimateLighting.js +1 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +13 -4
- package/dist/components/animate-marquee/PlAnimateMarquee.js +1 -1
- package/dist/components/animate-reveal/PlAnimateReveal.d.ts +51 -0
- package/dist/components/animate-reveal/PlAnimateReveal.js +1 -0
- package/dist/components/animate-reveal/index.d.ts +2 -0
- package/dist/components/animate-reveal/index.js +1 -0
- package/dist/components/animate-rotate/PlAnimateRotate.d.ts +2 -2
- package/dist/components/animate-rotate/PlAnimateRotate.js +1 -1
- package/dist/components/animate-scramble/PlAnimateScramble.d.ts +75 -0
- package/dist/components/animate-scramble/PlAnimateScramble.js +1 -0
- package/dist/components/animate-scramble/index.d.ts +2 -0
- package/dist/components/animate-scramble/index.js +1 -0
- package/dist/components/animate-shake/PlAnimateShake.d.ts +57 -0
- package/dist/components/animate-shake/PlAnimateShake.js +1 -0
- package/dist/components/animate-shake/index.d.ts +2 -0
- package/dist/components/animate-shake/index.js +1 -0
- package/dist/components/animate-slide/PlAnimateSlide.d.ts +2 -2
- package/dist/components/animate-slide/PlAnimateSlide.js +1 -1
- package/dist/components/animate-split/PlAnimateSplit.d.ts +57 -0
- package/dist/components/animate-split/PlAnimateSplit.js +1 -0
- package/dist/components/animate-split/index.d.ts +2 -0
- package/dist/components/animate-split/index.js +1 -0
- package/dist/components/animate-typing/PlAnimateTyping.d.ts +3 -2
- package/dist/components/animate-typing/PlAnimateTyping.js +1 -1
- package/dist/components/animate-zoom/PlAnimateZoom.d.ts +2 -2
- package/dist/components/animate-zoom/PlAnimateZoom.js +1 -1
- package/dist/components/app-logo/PlAppLogo.d.ts +78 -0
- package/dist/components/app-logo/PlAppLogo.js +1 -0
- package/dist/components/app-logo/index.d.ts +2 -0
- package/dist/components/app-logo/index.js +1 -0
- package/dist/components/area-chart/PlAreaChart.d.ts +54 -0
- package/dist/components/area-chart/PlAreaChart.js +1 -0
- package/dist/components/area-chart/index.d.ts +2 -0
- package/dist/components/area-chart/index.js +1 -0
- package/dist/components/aspect-ratio/PlAspectRatio.d.ts +2 -1
- package/dist/components/aspect-ratio/PlAspectRatio.js +1 -1
- package/dist/components/avatar/PlAvatar.js +1 -1
- package/dist/components/back-top/PlBackTop.d.ts +2 -1
- package/dist/components/back-top/PlBackTop.js +1 -1
- package/dist/components/badge/PlBadge.js +1 -1
- package/dist/components/bar-chart/PlBarChart.d.ts +63 -0
- package/dist/components/bar-chart/PlBarChart.js +1 -0
- package/dist/components/bar-chart/index.d.ts +2 -0
- package/dist/components/bar-chart/index.js +1 -0
- package/dist/components/bottom-navigation/PlBottomNavigation.d.ts +3 -0
- package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
- package/dist/components/button/PlButton.d.ts +8 -0
- package/dist/components/button/PlButton.js +1 -1
- package/dist/components/button-group/PlButtonGroup.js +1 -1
- package/dist/components/calendar/PlCalendar.js +1 -1
- package/dist/components/card/PlCard.js +1 -1
- package/dist/components/carousel/PlCarousel.d.ts +1 -1
- package/dist/components/carousel/PlCarousel.js +1 -1
- package/dist/components/chat-bubble/PlChatBubble.d.ts +4 -1
- package/dist/components/chat-bubble/PlChatBubble.js +1 -1
- package/dist/components/checkbox/PlCheckbox.js +1 -1
- package/dist/components/chip/PlChip.d.ts +6 -2
- package/dist/components/chip/PlChip.js +1 -1
- package/dist/components/code-block/PlCodeBlock.d.ts +192 -0
- package/dist/components/code-block/PlCodeBlock.js +1 -0
- package/dist/components/code-block/index.d.ts +2 -0
- package/dist/components/code-block/index.js +1 -0
- package/dist/components/color-picker/PlColorPicker.js +1 -1
- package/dist/components/combobox/PlCombobox.d.ts +6 -5
- package/dist/components/combobox/PlCombobox.js +1 -1
- package/dist/components/command-palette/PlCommandPalette.d.ts +6 -2
- package/dist/components/command-palette/PlCommandPalette.js +1 -1
- package/dist/components/confirm/PlConfirmProvider.js +1 -1
- package/dist/components/container/PlContainer.d.ts +22 -6
- package/dist/components/container/PlContainer.js +1 -1
- package/dist/components/data-list/PlDataList.d.ts +74 -0
- package/dist/components/data-list/PlDataList.js +1 -0
- package/dist/components/data-list/index.d.ts +2 -0
- package/dist/components/data-list/index.js +1 -0
- package/dist/components/data-table/PlDataTable.d.ts +216 -0
- package/dist/components/data-table/PlDataTable.js +1 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/index.js +1 -0
- package/dist/components/date-picker/PlDatePicker.js +1 -1
- package/dist/components/date-range-picker/PlDateRangePicker.js +1 -1
- package/dist/components/date-time-picker/PlDateTimePicker.js +1 -1
- package/dist/components/drawer/PlDrawer.d.ts +1 -1
- package/dist/components/drawer/PlDrawer.js +1 -1
- package/dist/components/file-picker/PlFilePicker.d.ts +4 -1
- package/dist/components/file-picker/PlFilePicker.js +1 -1
- package/dist/components/flex/PlFlex.d.ts +83 -0
- package/dist/components/flex/PlFlex.js +1 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +1 -0
- package/dist/components/floating-action-button/PlFloatingActionButton.d.ts +81 -0
- package/dist/components/floating-action-button/PlFloatingActionButton.js +1 -0
- package/dist/components/floating-action-button/index.d.ts +2 -0
- package/dist/components/floating-action-button/index.js +1 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.d.ts +3 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.js +1 -1
- package/dist/components/footer/PlFooter.d.ts +4 -3
- package/dist/components/footer/PlFooter.js +1 -1
- package/dist/components/form/PlForm.js +1 -1
- package/dist/components/gallery/PlGallery.d.ts +192 -0
- package/dist/components/gallery/PlGallery.js +1 -0
- package/dist/components/gallery/PlGalleryViewer.d.ts +31 -0
- package/dist/components/gallery/PlGalleryViewer.js +1 -0
- package/dist/components/gallery/index.d.ts +2 -0
- package/dist/components/gallery/index.js +1 -0
- package/dist/components/gauge-chart/PlGaugeChart.d.ts +64 -0
- package/dist/components/gauge-chart/PlGaugeChart.js +1 -0
- package/dist/components/gauge-chart/index.d.ts +2 -0
- package/dist/components/gauge-chart/index.js +1 -0
- package/dist/components/grid/PlGrid.js +1 -1
- package/dist/components/grid/PlGridItem.js +1 -1
- package/dist/components/header/PlHeader.d.ts +4 -3
- package/dist/components/header/PlHeader.js +1 -1
- package/dist/components/heatmap-chart/PlHeatmapChart.d.ts +69 -0
- package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -0
- package/dist/components/heatmap-chart/index.d.ts +2 -0
- package/dist/components/heatmap-chart/index.js +1 -0
- package/dist/components/highlight/PlHighlight.js +1 -1
- package/dist/components/hot-keys/PlHotKeys.js +1 -1
- package/dist/components/hover-card/PlHoverCard.d.ts +96 -0
- package/dist/components/hover-card/PlHoverCard.js +1 -0
- package/dist/components/hover-card/index.d.ts +2 -0
- package/dist/components/hover-card/index.js +1 -0
- package/dist/components/how-to-steps/PlHowToSteps.d.ts +87 -0
- package/dist/components/how-to-steps/PlHowToSteps.js +1 -0
- package/dist/components/how-to-steps/index.d.ts +2 -0
- package/dist/components/how-to-steps/index.js +1 -0
- package/dist/components/image/PlImage.d.ts +195 -8
- package/dist/components/image/PlImage.js +1 -1
- package/dist/components/image/PlImagePreview.d.ts +58 -0
- package/dist/components/image/PlImagePreview.js +1 -0
- package/dist/components/image/index.d.ts +1 -1
- package/dist/components/line-chart/PlLineChart.d.ts +74 -0
- package/dist/components/line-chart/PlLineChart.js +1 -0
- package/dist/components/line-chart/index.d.ts +2 -0
- package/dist/components/line-chart/index.js +1 -0
- package/dist/components/menu/PlMenu.d.ts +14 -5
- package/dist/components/menu/PlMenu.js +1 -1
- package/dist/components/meter/PlMeter.d.ts +83 -0
- package/dist/components/meter/PlMeter.js +1 -0
- package/dist/components/meter/index.d.ts +2 -0
- package/dist/components/meter/index.js +1 -0
- package/dist/components/mockup/PlMockup.d.ts +146 -0
- package/dist/components/mockup/PlMockup.js +1 -0
- package/dist/components/mockup/index.d.ts +2 -0
- package/dist/components/mockup/index.js +1 -0
- package/dist/components/modal/PlModal.d.ts +1 -1
- package/dist/components/modal/PlModal.js +1 -1
- package/dist/components/navigation-menu/PlNavigationMenu.d.ts +7 -1
- package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
- package/dist/components/number-field/PlNumberField.d.ts +1 -1
- package/dist/components/number-field/PlNumberField.js +1 -1
- package/dist/components/otp-field/PlOtpField.d.ts +6 -0
- package/dist/components/otp-field/PlOtpField.js +1 -1
- package/dist/components/overlay/PlOverlay.d.ts +1 -1
- package/dist/components/overlay/PlOverlay.js +1 -1
- package/dist/components/page-layout/PlPageLayout.js +1 -1
- package/dist/components/pagination/PlPagination.d.ts +12 -9
- package/dist/components/pagination/PlPagination.js +1 -1
- package/dist/components/panes/PlPanes.d.ts +7 -2
- package/dist/components/panes/PlPanes.js +1 -1
- package/dist/components/pie-chart/PlPieChart.d.ts +58 -0
- package/dist/components/pie-chart/PlPieChart.js +1 -0
- package/dist/components/pie-chart/index.d.ts +2 -0
- package/dist/components/pie-chart/index.js +1 -0
- package/dist/components/pill/PlPill.js +1 -1
- package/dist/components/popconfirm/PlPopconfirm.d.ts +1 -1
- package/dist/components/popconfirm/PlPopconfirm.js +1 -1
- package/dist/components/popover/PlPopover.d.ts +6 -6
- package/dist/components/popover/PlPopover.js +1 -1
- package/dist/components/portal/PlPortal.d.ts +78 -0
- package/dist/components/portal/PlPortal.js +1 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +1 -0
- package/dist/components/progress-box/PlProgressBox.js +1 -1
- package/dist/components/progress-circular/PlProgressCircular.js +1 -1
- package/dist/components/progress-linear/PlProgressLinear.js +1 -1
- package/dist/components/radio-group/PlRadioGroup.js +1 -1
- package/dist/components/rating/PlRating.d.ts +1 -1
- package/dist/components/rating/PlRating.js +1 -1
- package/dist/components/scatter-chart/PlScatterChart.d.ts +46 -0
- package/dist/components/scatter-chart/PlScatterChart.js +1 -0
- package/dist/components/scatter-chart/index.d.ts +2 -0
- package/dist/components/scatter-chart/index.js +1 -0
- package/dist/components/scroll-area/PlScrollArea.d.ts +98 -0
- package/dist/components/scroll-area/PlScrollArea.js +1 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.js +1 -0
- package/dist/components/scroll-zone/PlScrollZone.d.ts +27 -10
- package/dist/components/scroll-zone/PlScrollZone.js +1 -1
- package/dist/components/segmented-button/PlSegmentedButton.js +1 -1
- package/dist/components/select/PlSelect.js +1 -1
- package/dist/components/show/PlShow.d.ts +76 -0
- package/dist/components/show/PlShow.js +1 -0
- package/dist/components/show/index.d.ts +2 -0
- package/dist/components/show/index.js +1 -0
- package/dist/components/sidebar/PlSidebar.js +1 -1
- package/dist/components/sidebar/PlSidebarTrigger.js +1 -1
- package/dist/components/skeleton/PlSkeleton.js +1 -1
- package/dist/components/slider/PlSlider.d.ts +13 -1
- package/dist/components/slider/PlSlider.js +1 -1
- package/dist/components/sparkline/PlSparkline.d.ts +68 -0
- package/dist/components/sparkline/PlSparkline.js +1 -0
- package/dist/components/sparkline/index.d.ts +2 -0
- package/dist/components/sparkline/index.js +1 -0
- package/dist/components/spoiler/PlSpoiler.d.ts +16 -1
- package/dist/components/spoiler/PlSpoiler.js +1 -1
- package/dist/components/stack/PlStack.d.ts +114 -0
- package/dist/components/stack/PlStack.js +1 -0
- package/dist/components/stack/index.d.ts +2 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/stat/PlStat.d.ts +4 -0
- package/dist/components/stat/PlStat.js +1 -1
- package/dist/components/stepper/PlStepper.d.ts +3 -3
- package/dist/components/stepper/PlStepper.js +1 -1
- package/dist/components/switch/PlSwitch.js +1 -1
- package/dist/components/table/PlTable.d.ts +5 -5
- package/dist/components/table/PlTable.js +1 -1
- package/dist/components/tabs/PlTabs.d.ts +27 -2
- package/dist/components/tabs/PlTabs.js +1 -1
- package/dist/components/text-link/PlTextLink.js +1 -1
- package/dist/components/time-picker/PlTimePicker.js +1 -1
- package/dist/components/timeline/PlTimeline.d.ts +2 -2
- package/dist/components/timeline/PlTimeline.js +1 -1
- package/dist/components/timeline-chart/PlTimelineChart.d.ts +44 -0
- package/dist/components/timeline-chart/PlTimelineChart.js +1 -0
- package/dist/components/timeline-chart/index.d.ts +2 -0
- package/dist/components/timeline-chart/index.js +1 -0
- package/dist/components/toast/PlToast.d.ts +1 -1
- package/dist/components/toast/PlToast.js +1 -1
- package/dist/components/toggle/PlToggle.js +1 -1
- package/dist/components/toggle/PlToggleGroup.js +1 -1
- package/dist/components/tooltip/PlTooltip.js +1 -1
- package/dist/components/tour/PlTour.d.ts +134 -0
- package/dist/components/tour/PlTour.js +1 -0
- package/dist/components/tour/index.d.ts +2 -0
- package/dist/components/tour/index.js +1 -0
- package/dist/components/transfer/PlTransfer.d.ts +10 -1
- package/dist/components/transfer/PlTransfer.js +1 -1
- package/dist/components/tree/PlTree.js +1 -1
- package/dist/components/tree-select/PlTreeSelect.d.ts +99 -0
- package/dist/components/tree-select/PlTreeSelect.js +1 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +1 -0
- package/dist/components/typography/PlTypography.js +1 -1
- package/dist/components/window-pane/PlWindowPane.d.ts +179 -0
- package/dist/components/window-pane/PlWindowPane.js +1 -0
- package/dist/components/window-pane/index.d.ts +2 -0
- package/dist/components/window-pane/index.js +1 -0
- package/dist/css/anchor.css +2 -0
- package/dist/css/animate-counter.css +2 -0
- package/dist/css/animate-float.css +2 -0
- package/dist/css/animate-reveal.css +2 -0
- package/dist/css/animate-scramble.css +2 -0
- package/dist/css/animate-shake.css +2 -0
- package/dist/css/animate-split.css +2 -0
- package/dist/css/app-logo.css +2 -0
- package/dist/css/area-chart.css +3 -0
- package/dist/css/back-top.css +2 -0
- package/dist/css/bar-chart.css +3 -0
- package/dist/css/calendar.css +1 -0
- package/dist/css/carousel.css +2 -0
- package/dist/css/code-block.css +2 -0
- package/dist/css/color-picker.css +1 -0
- package/dist/css/combobox.css +1 -0
- package/dist/css/command-palette.css +1 -0
- package/dist/css/confirm.css +2 -0
- package/dist/css/data-list.css +2 -0
- package/dist/css/data-table.css +7 -0
- package/dist/css/date-picker.css +1 -0
- package/dist/css/date-range-picker.css +1 -0
- package/dist/css/date-time-picker.css +1 -0
- package/dist/css/flex.css +2 -0
- package/dist/css/floating-action-button.css +4 -0
- package/dist/css/gallery.css +7 -0
- package/dist/css/gauge-chart.css +3 -0
- package/dist/css/heatmap-chart.css +3 -0
- package/dist/css/hover-card.css +2 -0
- package/dist/css/how-to-steps.css +2 -0
- package/dist/css/icon-button.css +1 -0
- package/dist/css/image.css +2 -0
- package/dist/css/line-chart.css +3 -0
- package/dist/css/menubar.css +1 -0
- package/dist/css/meter.css +2 -0
- package/dist/css/mockup.css +2 -0
- package/dist/css/pagination.css +1 -0
- package/dist/css/pie-chart.css +3 -0
- package/dist/css/popconfirm.css +2 -0
- package/dist/css/portal.css +2 -0
- package/dist/css/scatter-chart.css +3 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/scroll-zone.css +2 -0
- package/dist/css/show.css +2 -0
- package/dist/css/sidebar.css +3 -0
- package/dist/css/sparkline.css +3 -0
- package/dist/css/spoiler.css +1 -0
- package/dist/css/stack.css +2 -0
- package/dist/css/stat.css +1 -0
- package/dist/css/time-picker.css +1 -0
- package/dist/css/timeline-chart.css +3 -0
- package/dist/css/tour.css +3 -0
- package/dist/css/transfer.css +4 -0
- package/dist/css/tree-select.css +4 -0
- package/dist/css/window-pane.css +2 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/usePlBreakpoint.d.ts +3 -0
- package/dist/hooks/usePlBreakpoint.js +1 -1
- package/dist/hooks/usePlDisclosure.d.ts +44 -0
- package/dist/hooks/usePlDisclosure.js +1 -0
- package/dist/hooks/usePlElementSize.d.ts +34 -0
- package/dist/hooks/usePlElementSize.js +1 -0
- package/dist/hooks/usePlHotKeys.d.ts +5 -1
- package/dist/hooks/usePlHotKeys.js +1 -1
- package/dist/hooks/usePlOnScreen.d.ts +54 -0
- package/dist/hooks/usePlOnScreen.js +1 -0
- package/dist/index.d.ts +34 -1
- package/dist/index.js +1 -1
- package/dist/internal/animate.d.ts +121 -7
- package/dist/internal/animate.js +1 -1
- package/dist/internal/breakpoints.d.ts +31 -0
- package/dist/internal/breakpoints.js +1 -0
- package/dist/internal/button-group.d.ts +29 -2
- package/dist/internal/button-group.js +2 -2
- package/dist/internal/calendar.d.ts +11 -36
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +462 -0
- package/dist/internal/chart-frame.js +1 -0
- package/dist/internal/chart-line.d.ts +44 -0
- package/dist/internal/chart-line.js +1 -0
- package/dist/internal/chart.d.ts +551 -0
- package/dist/internal/chart.js +1 -0
- package/dist/internal/color-scheme.js +1 -1
- package/dist/internal/data-table.d.ts +70 -0
- package/dist/internal/data-table.js +1 -0
- package/dist/internal/date.d.ts +10 -0
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +8 -3
- package/dist/internal/drag.d.ts +65 -0
- package/dist/internal/drag.js +1 -0
- package/dist/internal/focusable.d.ts +8 -0
- package/dist/internal/focusable.js +1 -0
- package/dist/internal/form.d.ts +61 -0
- package/dist/internal/form.js +1 -0
- package/dist/internal/format.d.ts +2 -0
- package/dist/internal/format.js +1 -1
- package/dist/internal/gallery.d.ts +80 -0
- package/dist/internal/gallery.js +1 -0
- package/dist/internal/glow.d.ts +17 -0
- package/dist/internal/glow.js +1 -0
- package/dist/internal/grid.d.ts +6 -27
- package/dist/internal/grid.js +1 -1
- package/dist/internal/highlight.d.ts +98 -0
- package/dist/internal/highlight.js +1 -0
- package/dist/internal/icons.d.ts +10 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/image.d.ts +94 -0
- package/dist/internal/image.js +1 -0
- package/dist/internal/inert.d.ts +19 -0
- package/dist/internal/inert.js +1 -0
- package/dist/internal/keys.d.ts +19 -0
- package/dist/internal/keys.js +1 -1
- package/dist/internal/labels.d.ts +182 -0
- package/dist/internal/labels.js +1 -0
- package/dist/internal/link.d.ts +17 -0
- package/dist/internal/link.js +1 -1
- package/dist/internal/mockup.d.ts +193 -0
- package/dist/internal/mockup.js +1 -0
- package/dist/internal/page-layout.d.ts +14 -7
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +43 -6
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +22 -8
- package/dist/internal/progress.js +1 -1
- package/dist/internal/responsive.d.ts +108 -0
- package/dist/internal/responsive.js +1 -0
- package/dist/internal/scramble.d.ts +35 -0
- package/dist/internal/scramble.js +1 -0
- package/dist/internal/scroll-target.d.ts +5 -0
- package/dist/internal/scroll-target.js +1 -0
- package/dist/internal/steps.js +1 -1
- package/dist/internal/styles.d.ts +81 -0
- package/dist/internal/styles.js +1 -1
- package/dist/internal/table.d.ts +86 -0
- package/dist/internal/table.js +1 -0
- package/dist/internal/text.d.ts +39 -0
- package/dist/internal/text.js +1 -0
- package/dist/internal/threshold.d.ts +19 -0
- package/dist/internal/threshold.js +1 -0
- package/dist/internal/tour.d.ts +42 -0
- package/dist/internal/tour.js +1 -0
- package/dist/internal/watermark.d.ts +44 -0
- package/dist/internal/watermark.js +1 -0
- package/dist/internal/wheel.d.ts +52 -0
- package/dist/internal/wheel.js +1 -0
- package/dist/internal/window.d.ts +201 -0
- package/dist/internal/window.js +1 -0
- package/dist/locales/de.d.ts +3 -0
- package/dist/locales/de.js +1 -0
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/es.d.ts +3 -0
- package/dist/locales/es.js +1 -0
- package/dist/locales/fr.d.ts +3 -0
- package/dist/locales/fr.js +1 -0
- package/dist/locales/index.d.ts +33 -0
- package/dist/locales/index.js +1 -0
- package/dist/locales/ja.d.ts +3 -0
- package/dist/locales/ja.js +1 -0
- package/dist/locales/ko.d.ts +3 -0
- package/dist/locales/ko.js +1 -0
- package/dist/locales/zh-Hans.d.ts +3 -0
- package/dist/locales/zh-Hans.js +1 -0
- package/dist/provider/PlColorSchemeScript.js +1 -1
- package/dist/provider/PlassProvider.js +1 -1
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1357 -25
- package/dist/tokens.css +1357 -25
- package/dist/types.d.ts +368 -2
- package/package.json +26 -16
- package/dist/components/avatar-group/PlAvatarGroup.d.ts +0 -47
- package/dist/components/avatar-group/PlAvatarGroup.js +0 -1
- package/dist/components/avatar-group/index.d.ts +0 -2
- package/dist/components/avatar-group/index.js +0 -1
- package/dist/css/avatar-group.css +0 -2
- package/dist/internal/avatar-group.d.ts +0 -25
- package/dist/internal/avatar-group.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{useDefaults as t}from"../../internal/defaults.js";import{useLabels as n}from"../../internal/labels.js";import{StarIcon as l,StarOutlineIcon as i}from"../../internal/icons.js";import{controlSlots as s,cx as o,focusWithinRingClasses as c,gapClasses as m,iconSizeClasses as d,radiusClasses as u,srOnlyClasses as h,transitionClasses as p}from"../../internal/styles.js";const f="flex items-center justify-center";export const PlRating=/* @__PURE__ */r.forwardRef(function PlRating({value:y,defaultValue:x=0,onValueChange:b,count:g=5,precision:v=1,icon:N,emptyIcon:M,clearable:j=!0,readOnly:w=!1,disabled:P=!1,name:k,required:L=!1,size:q,color:C,label:I,valueLabel:R,className:S,style:V,onPointerLeave:z,...A},E){const F=t(),O=n(),B=I??O.rating,D=R??((e,a)=>e<=0?O.ratingNone:O.ratingValue(e,a)),G=q??F.size??"md",H=C??F.color??"warning",J=r.useId(),K=k??J,[Q,T]=r.useState(x),U=void 0!==y,W=U?y:Q,[X,Y]=r.useState(null),Z=Math.max(1,Math.floor(g)),$=v>0&&v<=1?v:1,_=Math.round(1/$),ee=Math.max(0,Math.min(Z,X??W)),change=e=>{U||T(e),b?.(e)},ae=Array.from({length:Z},(r,t)=>{const n=Math.max(0,Math.min(1,ee-t));return a("span",{className:o("relative inline-flex shrink-0",d[G],u.xs,w||P?"":c),children:[e("span",{className:o(f,d[G],"text-(--p-empty)"),children:M??e(i,{})}),e("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-0 start-0 overflow-hidden",style:{width:100*n+"%"},children:e("span",{className:o(f,d[G],"text-(--p-accent)",p),children:N??e(l,{})})}),w?null:Array.from({length:_},(a,r)=>{const n=Number((t+(r+1)*$).toFixed(4));return e("label",{className:o("absolute inset-y-0",P?"cursor-not-allowed":"cursor-pointer"),style:{insetInlineStart:100*r/_+"%",width:100/_+"%"},onPointerEnter:()=>{P||Y(n)},children:e("input",{type:"radio",className:h,name:K,value:n,checked:W===n,disabled:P,required:L,"aria-label":D(n,Z),onChange:()=>change(n),onClick:()=>{j&&W===n&&change(0)}})},n)})]},t)}),re=o("inline-flex items-center align-middle",m[G],P?"cursor-not-allowed opacity-50 saturate-[0.35]":"",S),te={...s(H,0,"solid"),"--p-empty":"color-mix(in oklab, var(--plass-muted-fg) 40%, transparent)",...V};return e("div",w?{ref:E,role:"img","aria-label":D(Math.max(0,Math.min(Z,W)),Z),className:re,style:te,onPointerLeave:z,...A,children:ae}:{ref:E,role:"radiogroup","aria-label":B,"aria-disabled":P||void 0,"aria-required":L||void 0,className:re,style:te,onPointerLeave:e=>{Y(null),z?.(e)},...A,children:ae})});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type CartesianChartProps } from '../../internal/chart-frame.js';
|
|
3
|
+
import { type MarkShape } from '../../internal/chart.js';
|
|
4
|
+
export interface PlScatterChartProps extends CartesianChartProps {
|
|
5
|
+
/**
|
|
6
|
+
* What each mark is drawn as.
|
|
7
|
+
*
|
|
8
|
+
* - `auto` — the default. A circle while colour alone can carry identity, and
|
|
9
|
+
* a shape per series from the fourth on, because past three it cannot: two
|
|
10
|
+
* of the palette's hues are indistinguishable under deuteranopia, and a
|
|
11
|
+
* shape is the one channel a dot has going spare.
|
|
12
|
+
* - `varied` — a shape per series always, in the fixed order circle, square,
|
|
13
|
+
* triangle, diamond, cross. Reach for it when the chart will be printed or
|
|
14
|
+
* read in greyscale.
|
|
15
|
+
* - one of the five names — every mark the same shape. On four or more series
|
|
16
|
+
* this is opting out of the second channel; do it only when each series
|
|
17
|
+
* carries a `color` of its own.
|
|
18
|
+
* @default 'auto'
|
|
19
|
+
*/
|
|
20
|
+
shape?: MarkShape | 'varied' | 'auto';
|
|
21
|
+
/**
|
|
22
|
+
* The radius of a mark with no `z`, in pixels.
|
|
23
|
+
* @default the `size` ladder — 4 at `md`
|
|
24
|
+
*/
|
|
25
|
+
pointRadius?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The radius of the largest bubble, in pixels. Everything else is scaled
|
|
28
|
+
* under it by area.
|
|
29
|
+
* @default a twelfth of the chart's height
|
|
30
|
+
*/
|
|
31
|
+
maxRadius?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Two numbers per point, and whether they move together.
|
|
35
|
+
*
|
|
36
|
+
* Both axes measure, which is what makes this the only chart in the library
|
|
37
|
+
* with no categories: there is no column a mark belongs to and no order the
|
|
38
|
+
* points could be shuffled out of. A point with a `z` is drawn as a bubble and
|
|
39
|
+
* one without it as a dot, so a scatter and a bubble chart are the same
|
|
40
|
+
* component reading the same data — the third number is simply present or not.
|
|
41
|
+
*
|
|
42
|
+
* `x` must be a number or a `Date`. A string has no place on a number line, and
|
|
43
|
+
* a chart of named things against one measure is a
|
|
44
|
+
* [`PlBarChart`](./bar-chart).
|
|
45
|
+
*/
|
|
46
|
+
export declare function PlScatterChart({ shape, pointRadius, maxRadius, series, categories, size: sizeProp, xAxis, ...props }: PlScatterChartProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{CartesianChart as t,markTransitionClasses as l}from"../../internal/chart-frame.js";import{bubbleRadius as s,dimmedByHover as i,formatCategory as o,markerRadii as c,markGap as n,markPath as u,markShapes as d,plotHeights as h,pointX as m}from"../../internal/chart.js";import{useDefaults as x}from"../../internal/defaults.js";import{cx as f,srOnlyClasses as p}from"../../internal/styles.js";export function PlScatterChart({shape:r="auto",pointRadius:l,maxRadius:i,series:o,categories:n,size:f,xAxis:p,...b}){const v=x(),y=f??v.size??"md",g=l??c[y],z=i??Math.max(g+2,("number"==typeof b.height?b.height:h[y])/12),k=o.reduce((e,r)=>r.color?e:e+1,0),j="auto"===r||"varied"===r?"circle":r,M="varied"===r||"auto"===r&&k>3,w=a.useCallback(e=>M?d[e%d.length]:j,[M,j]),N=a.useCallback(e=>{const r=[];let a=0;return e.values.forEach(e=>{e.forEach(e=>{null!==e.value&&void 0!==e.z&&Number.isFinite(e.z)&&(a=Math.max(a,e.z))})}),e.values.forEach((t,l)=>{e.visible[l]&&t.forEach((t,i)=>{if(null===t.value)return;const o=m(t,i,n);null!==o&&r.push({series:l,index:i,x:e.categoryValuePx(o),y:e.valuePx(t.value),r:void 0===t.z?g:s(t.z,a,z,2)})})}),r},[n,g,z]);return e(t,{...b,series:o,categories:n,size:y,xScale:"value",xAxis:p,marks:N,markInset:z,includeZero:!1,swatch:(r,a)=>e("svg",{viewBox:"0 0 10 10",className:"size-2.5 overflow-visible","aria-hidden":"true",children:e("path",{d:u(w(r),5,5,4),fill:a})}),table:r=>e(ScatterTable,{id:r,series:o,categories:n,label:b.label,xLabel:p?.label,yLabel:b.yAxis?.label,locale:b.locale??v.locale,format:b.format}),children:r=>e(ScatterMarks,{context:r,shapeOf:w})})}function ScatterMarks({context:r,shapeOf:t}){const{marks:s,values:o,colors:c,visible:d,hovered:h,activeMark:m}=r,x=a.useMemo(()=>[...s].sort((e,r)=>r.r-e.r),[s]);return e("g",{children:x.map(r=>{const a=o[r.series]?.[r.index],s=i(h,r.series,d),x=m?.series===r.series&&m?.index===r.index;return e("path",{d:u(t(r.series),r.x,r.y,r.r),fill:a?.color??c[r.series],stroke:"var(--plass-chart-gap)",strokeWidth:n,opacity:s?.28:1,className:l,style:{transformBox:"view-box",transformOrigin:`${r.x}px ${r.y}px`,scale:x&&r.r>0?(r.r+1)/r.r:1}},`${r.series}-${r.index}`)})})}function ScatterTable({id:t,series:l,categories:s,label:i,xLabel:c,yLabel:n,locale:u,format:d}){const h=a.useMemo(()=>new Intl.NumberFormat(u,d??{maximumFractionDigits:2}),[u,d]),m=l.some(e=>e.data.some(e=>"object"==typeof e&&null!==e&&void 0!==e.z));return r("table",{id:t,className:f(p),children:[i?e("caption",{children:i}):null,e("thead",{children:r("tr",{children:[e("th",{scope:"col"}),e("th",{scope:"col",children:c??"x"}),e("th",{scope:"col",children:n??"y"}),m?e("th",{scope:"col",children:"z"}):null]})}),e("tbody",{children:l.flatMap((a,t)=>a.data.map((l,i)=>{const c="object"==typeof l&&null!==l?l:null,n=c?c.y:"number"==typeof l?l:null,d=c?.x??s?.[i]??i;return r("tr",{children:[e("th",{scope:"row",children:a.name??t+1}),e("td",{children:o(d,u)}),e("td",{children:null!==n&&Number.isFinite(n)?h.format(n):""}),m?e("td",{children:void 0===c?.z?"":h.format(c.z)}):null]},`${t}-${i}`)}))})]})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlScatterChart}from"./PlScatterChart.js";
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassOrientation, PlassSize } from '../../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Which axes may scroll.
|
|
5
|
+
*
|
|
6
|
+
* `PlassOrientation` plus a third value rather than the shared type widened,
|
|
7
|
+
* because "both" is meaningless everywhere else it is used — a `PlDivider`, a
|
|
8
|
+
* `PlButtonGroup` and a `PlSlider` each run one way — and widening it there to
|
|
9
|
+
* say it here would be a fourth value nobody can answer.
|
|
10
|
+
*/
|
|
11
|
+
export type PlScrollAreaAxis = PlassOrientation | 'both';
|
|
12
|
+
/** Classes for the parts a `className` does not reach. */
|
|
13
|
+
export interface PlScrollAreaClassNames {
|
|
14
|
+
/** The scrolling element itself — the one that takes the focus and the keys. */
|
|
15
|
+
viewport?: string;
|
|
16
|
+
/** The lane a scrollbar runs in. */
|
|
17
|
+
scrollbar?: string;
|
|
18
|
+
/** The bar inside it. */
|
|
19
|
+
thumb?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface PlScrollAreaProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
22
|
+
/**
|
|
23
|
+
* Which axes may scroll.
|
|
24
|
+
* @default 'vertical'
|
|
25
|
+
*/
|
|
26
|
+
orientation?: PlScrollAreaAxis;
|
|
27
|
+
/**
|
|
28
|
+
* A fixed height. A number is pixels; a string is any CSS length.
|
|
29
|
+
*
|
|
30
|
+
* **A vertical scroll area has to be bounded by something**, or there is
|
|
31
|
+
* nothing for the content to overflow and the box simply grows. This is that
|
|
32
|
+
* something, and it is a prop rather than a `className` because it is the one
|
|
33
|
+
* measurement without which the component does nothing at all.
|
|
34
|
+
*/
|
|
35
|
+
height?: number | string;
|
|
36
|
+
/** The height it stops growing at, for a box that should shrink to short content. */
|
|
37
|
+
maxHeight?: number | string;
|
|
38
|
+
/** The same two for a horizontal area. */
|
|
39
|
+
width?: number | string;
|
|
40
|
+
maxWidth?: number | string;
|
|
41
|
+
/**
|
|
42
|
+
* When the scrollbars are drawn.
|
|
43
|
+
*
|
|
44
|
+
* - `auto` — while the pointer is over the box or the content is moving, and
|
|
45
|
+
* never otherwise. The default, and what a reader is used to on a Mac.
|
|
46
|
+
* - `always` — kept at full strength. For a panel whose whole point is that
|
|
47
|
+
* there is more below, where a bar that appears on hover is a signal
|
|
48
|
+
* nobody standing back from the screen ever sees.
|
|
49
|
+
*
|
|
50
|
+
* Either way the lane is **overlaid**, so turning it on does not reflow the
|
|
51
|
+
* content underneath.
|
|
52
|
+
* @default 'auto'
|
|
53
|
+
*/
|
|
54
|
+
scrollbars?: 'auto' | 'always';
|
|
55
|
+
/**
|
|
56
|
+
* A name for the region.
|
|
57
|
+
*
|
|
58
|
+
* Worth giving, and the reason is not obvious: a scrollable box **is a tab
|
|
59
|
+
* stop** when there is nothing focusable inside it, because a keyboard reader
|
|
60
|
+
* has to be able to scroll it. A tab stop with no name is announced as
|
|
61
|
+
* nothing at all, so a name is what turns it from a mystery landing point
|
|
62
|
+
* into "Release notes, region".
|
|
63
|
+
*/
|
|
64
|
+
label?: string;
|
|
65
|
+
/** Thickness of the scrollbars and the corner the box is cut to. @default 'md' */
|
|
66
|
+
size?: PlassSize;
|
|
67
|
+
/** Classes on the parts a `className` does not reach. */
|
|
68
|
+
classNames?: PlScrollAreaClassNames;
|
|
69
|
+
/** What scrolls. */
|
|
70
|
+
children?: React.ReactNode;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A bounded box that scrolls, with the library's own scrollbar in it.
|
|
74
|
+
*
|
|
75
|
+
* The reason to reach for it over `overflow: auto` is the **bar**. A platform
|
|
76
|
+
* scrollbar is either an overlay that vanishes the moment the content stops
|
|
77
|
+
* moving, or fifteen pixels of permanent grey furniture, and neither of them
|
|
78
|
+
* belongs beside a translucent sheet. This one is the library's own material:
|
|
79
|
+
* the thumb is `--plass-track`, the same neutral ink a slider's rail and a
|
|
80
|
+
* progress groove are cut in, and the lane is overlaid so drawing it costs the
|
|
81
|
+
* content no width.
|
|
82
|
+
*
|
|
83
|
+
* It is **not** a [PlScrollZone](./scroll-zone), which is the other answer to
|
|
84
|
+
* the same fact. A scroll zone is a strip that runs off the end of its box: it
|
|
85
|
+
* takes the scrollbar away entirely, fades the end that still has something
|
|
86
|
+
* behind it and adds a pair of buttons. That is right for a row of tabs or
|
|
87
|
+
* chips, where a bar under one line of labels is heavier than the labels. This
|
|
88
|
+
* is right for a panel of content, where the bar is the honest signal and where
|
|
89
|
+
* a reader wants to know **how far through** they are, which a fade cannot say.
|
|
90
|
+
*
|
|
91
|
+
* There is no fade here for that reason: two signals for one fact, one of which
|
|
92
|
+
* is measured and one of which is not, is one more than the box needs.
|
|
93
|
+
*
|
|
94
|
+
* Base UI owns the behaviour — the overlay measurement, the thumb's size and
|
|
95
|
+
* position, the drag, and making the viewport a tab stop exactly while there is
|
|
96
|
+
* something to scroll.
|
|
97
|
+
*/
|
|
98
|
+
export declare const PlScrollArea: React.ForwardRefExoticComponent<PlScrollAreaProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as a,jsxs as o}from"react/jsx-runtime";import*as t from"react";import{ScrollArea as r}from"@base-ui/react/scroll-area";import{useDefaults as l}from"../../internal/defaults.js";import{cx as e,focusRingInsetClasses as i,radiusClasses as n,toLength as s}from"../../internal/styles.js";const c={xs:"w-2 data-[orientation=horizontal]:h-2 data-[orientation=horizontal]:w-auto",sm:"w-2.5 data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:w-auto",md:"w-3 data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:w-auto",lg:"w-3.5 data-[orientation=horizontal]:h-3.5 data-[orientation=horizontal]:w-auto",xl:"w-4 data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-auto"},h="flex-1 rounded-full bg-(--plass-track) forced-colors:[background-color:CanvasText]";export const PlScrollArea=/* @__PURE__ */t.forwardRef(function PlScrollArea({orientation:t="vertical",height:d,maxHeight:m,width:u,maxWidth:w,scrollbars:f="auto",label:p,size:z,classNames:v,className:b,style:x,children:g,...y},N){const j=l(),S=z??j.size??"md",C="horizontal"!==t,T="vertical"!==t,k=e("flex touch-none select-none","p-[0.125rem]",c[S],"[transition:opacity_var(--plass-duration)_var(--plass-ease)]","always"===f?"opacity-100":"opacity-0 data-[hovering]:opacity-100 data-[scrolling]:opacity-100",v?.scrollbar);return o(r.Root,{ref:N,className:e("plass-scroll-area relative overflow-hidden",n[S],b),style:{height:s(d),maxHeight:s(m),width:s(u),maxWidth:s(w),...x},...y,children:[a(r.Viewport,{role:p?"region":void 0,"aria-label":p,className:e("size-full overscroll-contain",n[S],i,v?.viewport),style:{overflowX:T?"scroll":"hidden",overflowY:C?"scroll":"hidden"},children:a(r.Content,{children:g})}),C?a(r.Scrollbar,{orientation:"vertical",className:k,children:a(r.Thumb,{className:e(h,v?.thumb)})}):null,T?a(r.Scrollbar,{orientation:"horizontal",className:k,children:a(r.Thumb,{className:e(h,v?.thumb)})}):null,C&&T?a(r.Corner,{}):null]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlScrollArea}from"./PlScrollArea.js";
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { PlassOrientation, PlassStyleProps } from '../../types.js';
|
|
2
|
+
import type { PlassOrientation, PlassOverscroll, PlassResponsive, PlassStyleProps } from '../../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* When the scroll buttons are drawn.
|
|
5
5
|
*
|
|
6
|
-
* - `auto` —
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* - `auto` — neither of them while everything fits, which is the whole of what
|
|
7
|
+
* it decides: a row that does not overflow is not a scroller. Once it is one,
|
|
8
|
+
* both lanes are drawn and the one with nowhere to go is `disabled`, exactly
|
|
9
|
+
* as `always` draws it. What `auto` removes is a **pair of controls on a
|
|
10
|
+
* strip that has nothing to scroll**, not one control on a strip that does.
|
|
11
|
+
* `overlay` still drops the spare button outright, because there its lane
|
|
12
|
+
* costs nothing to give up.
|
|
9
13
|
* - `always` — both, from the first paint, with the one that has nowhere to go
|
|
10
14
|
* `disabled` rather than gone. What a row whose content arrives later wants,
|
|
11
15
|
* since the buttons do not appear under the pointer half a second in.
|
|
@@ -48,7 +52,7 @@ export interface PlScrollZoneProps extends PlassStyleProps, Omit<React.Component
|
|
|
48
52
|
* Which way the children run, and therefore which way the zone scrolls.
|
|
49
53
|
* @default 'horizontal'
|
|
50
54
|
*/
|
|
51
|
-
orientation?: PlassOrientation
|
|
55
|
+
orientation?: PlassResponsive<PlassOrientation>;
|
|
52
56
|
/**
|
|
53
57
|
* How many rows a horizontal zone lays its children out in before it starts a
|
|
54
58
|
* new column — and how many columns a vertical one uses. `2` is the shelf
|
|
@@ -100,14 +104,27 @@ export interface PlScrollZoneProps extends PlassStyleProps, Omit<React.Component
|
|
|
100
104
|
* reader happens to be in. The pointer being on the strip is them saying
|
|
101
105
|
* which of the two things under it they meant to move.
|
|
102
106
|
*
|
|
103
|
-
* Only the vertical half of a gesture
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* wheel goes back to the page, so a reader on their way down a long page is
|
|
107
|
-
* held up by one shelf rather than caught in it.
|
|
107
|
+
* Only the vertical half of a gesture: a trackpad's two fingers, a tilt wheel
|
|
108
|
+
* and Shift held down already scroll the strip sideways and are left alone.
|
|
109
|
+
* What happens once the strip has nowhere left to go is `overscroll`.
|
|
108
110
|
* @default true
|
|
109
111
|
*/
|
|
110
112
|
wheel?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* What the strip does with a gesture it has run out of room for.
|
|
115
|
+
*
|
|
116
|
+
* `contain`, the default, keeps it: the pointer being on the shelf is the
|
|
117
|
+
* reader saying which of the two things under it they meant to move, and a
|
|
118
|
+
* page that starts moving the instant the last card arrives is that answer
|
|
119
|
+
* being overruled halfway through a flick. `auto` is the browser's own
|
|
120
|
+
* chaining, held only for as long as the gesture lasts.
|
|
121
|
+
*
|
|
122
|
+
* A strip everything fits in is never a scroller and holds nothing back
|
|
123
|
+
* either way, and only the axis the strip runs on is contained — a shelf that
|
|
124
|
+
* kept the other one would be a box a finger cannot scroll the page from.
|
|
125
|
+
* @default 'contain'
|
|
126
|
+
*/
|
|
127
|
+
overscroll?: PlassOverscroll;
|
|
111
128
|
/** Shows the native scrollbar. @default false */
|
|
112
129
|
scrollbar?: boolean;
|
|
113
130
|
/** What the scrollable region is called — "Categories", "Recent files". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{useDefaults as r}from"../../internal/defaults.js";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{useDefaults as r}from"../../internal/defaults.js";import{useLabels as o}from"../../internal/labels.js";import{takeSelection as i}from"../../internal/drag.js";import{PlIconButton as s}from"../icon-button/PlIconButton.js";import{spacingValue as l}from"../../internal/grid.js";import{ChevronIcon as a}from"../../internal/icons.js";import{cx as c}from"../../internal/styles.js";import{useResponsiveValue as u}from"../../internal/responsive.js";import{overscrollClasses as d,useWheelScroll as f}from"../../internal/wheel.js";const p={xs:"p-1",sm:"p-1.5",md:"p-2",lg:"p-3",xl:"p-4"},m={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-3",xl:"gap-4"};export const PlScrollZone=/* @__PURE__ */n.forwardRef(function PlScrollZone({orientation:v,lines:g=1,spacing:w=2,buttons:b="auto",buttonPlacement:h="inline",mode:x="item",step:y=1,speed:k=900,snap:L=!1,drag:E=!0,wheel:j=!0,overscroll:C="contain",scrollbar:R=!1,variant:B="glass",size:M,color:N,density:P,label:T,previousLabel:z,nextLabel:A,className:D,style:S,children:H,...F},I){const W=u(v,"horizontal"),$=r(),q=o(),O=z??q.previous,X=A??q.next,Y=M??$.size??"md",Z=N??$.color??"primary",_=P??$.density??"default",K="horizontal"===W,G=Math.max(1,Math.round(g)),J=Math.max(1,Math.round(y)),Q=n.useRef(null),U=n.useRef(null),[V,ee]=n.useState({back:!1,forward:!1}),te=n.useCallback(()=>{const e=Q.current;if(!e)return;const t=K?e.clientWidth:e.clientHeight,n=K?e.scrollWidth:e.scrollHeight,r=Math.abs(K?e.scrollLeft:e.scrollTop);ee(e=>{const o=r>1,i=n-t-r>1;return e.back===o&&e.forward===i?e:{back:o,forward:i}})},[K]);n.useEffect(()=>{const e=Q.current,t=U.current;if(!e)return;if(te(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(te);return n.observe(e),t&&n.observe(t),()=>n.disconnect()},[te]);const ne=n.useCallback(()=>{const e=Q.current;return e&&K&&"rtl"===getComputedStyle(e).direction?-1:1},[K]),re=n.useCallback((e,t)=>{const n=Q.current;if(!n)return;const r=t?function scrollBehavior(){return"undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}():"instant";n.scrollBy(K?{left:e,behavior:r}:{top:e,behavior:r})},[K]);f(Q,{enabled:j&&K,overscroll:C});const oe=n.useCallback(()=>{const e=Q.current,t=U.current;if(!e||!t)return[];const n=K&&"rtl"===getComputedStyle(e).direction,r=K?n?"right":"left":"top",o=n?-1:1,i=e.getBoundingClientRect()[r],s=[];for(const e of Array.from(t.children)){const t=Math.round((e.getBoundingClientRect()[r]-i)*o);s.includes(t)||s.push(t)}return s.sort((e,t)=>e-t)},[K]),ie=n.useCallback((e,t=x)=>{const n=Q.current;if(!n)return;const r=ne(),o=K?n.clientWidth:n.clientHeight;if("page"===t)return void re(o*(e?1:-1)*r,!0);const i=oe(),s=i.filter(e=>e>1),l=i.filter(e=>e<-1),a=e?s[J-1]:l[l.length-J];re(void 0!==a?a*r:o*(e?1:-1)*r,!0)},[ne,K,oe,J,x,re]),se=n.useRef(null);n.useEffect(()=>()=>se.current?.(),[]);const le=n.useCallback((e,t)=>{if(se.current)return;const n=ne(),r=performance.now();let o=r,i=0;const tick=t=>{const r=t-o;o=t,re(k*r/1e3*(e?1:-1)*n,!1),i=requestAnimationFrame(tick)};i=requestAnimationFrame(tick);const release=()=>{cancelAnimationFrame(i),se.current=null,window.removeEventListener(t,release),window.removeEventListener("pointercancel",release),window.removeEventListener("blur",release),performance.now()-r<140&&ie(e,"item")};se.current=release,window.addEventListener(t,release),window.addEventListener("pointercancel",release),window.addEventListener("blur",release)},[ie,ne,re,k]),ae=n.useRef(null);function pressHandlers(e){return"hold"!==x?{onClick:()=>ie(e)}:{onPointerDown:t=>{0===t.button&&le(e,"pointerup")},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),le(e,"keyup"))}}}n.useEffect(()=>()=>ae.current?.(),[]);const ce="none"!==b&&("always"===b||V.back||V.forward),ue="inline"===h;function scrollButton(t){const n=t?V.forward:V.back;if("auto"===b&&!n&&!ue)return e("span",{});const r=e(s,{variant:B,size:Y,color:Z,density:_,elevation:1,label:t?X:O,disabled:!n,className:"pointer-events-auto",icon:e("span",{className:c("flex items-center",K?t?"-rotate-90 rtl:rotate-90":"rotate-90 rtl:-rotate-90":t?"":"rotate-180"),children:e(a,{})}),...pressHandlers(t)});return ue?e("span",{className:"flex shrink-0 items-center justify-center",children:r}):r}return t("div",{ref:I,className:c("relative flex min-w-0",ue&&K?"flex-row items-stretch":"flex-col",ue?m[Y]:"",D),style:{"--p-ring":`var(--plass-${Z}-ring)`,...S},...F,children:[ce&&ue?scrollButton(!1):null,e("div",{ref:Q,tabIndex:V.back||V.forward?0:void 0,role:T?"group":void 0,"aria-label":T,className:c("min-h-0 min-w-0 grow",K?"overflow-x-auto overflow-y-hidden":"overflow-y-auto overflow-x-hidden",d(C,K),L?K?"snap-x snap-mandatory":"snap-y snap-mandatory":"",R?"":"[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",E&&(V.back||V.forward)?"cursor-grab data-[dragging]:cursor-grabbing":"","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]"),onScroll:te,onPointerDown:function beginDrag(e){if(!E||"touch"===e.pointerType||0!==e.button)return;ae.current?.();const t=e.currentTarget,n=e.clientX,r=e.clientY,o=t.scrollLeft,s=t.scrollTop;let l=!1,a=null;const move=e=>{if(0===e.buttons)return void end();const c=e.clientX-n,u=e.clientY-r;if(!l){if(Math.abs(K?c:u)<4)return;l=!0,t.setPointerCapture(e.pointerId),t.dataset.dragging="true",a=i()}K?t.scrollLeft=o-c:t.scrollTop=s-u},release=()=>{ae.current=null,t.removeEventListener("pointermove",move),t.removeEventListener("pointerup",end),t.removeEventListener("pointercancel",release),delete t.dataset.dragging,a?.(),a=null},end=()=>{const e=l;if(release(),!e)return;const swallow=e=>{e.stopPropagation(),e.preventDefault()};t.addEventListener("click",swallow,{capture:!0,once:!0}),window.setTimeout(()=>t.removeEventListener("click",swallow,!0),0)};ae.current=release,t.addEventListener("pointermove",move),t.addEventListener("pointerup",end),t.addEventListener("pointercancel",release)},children:e("div",{ref:U,className:c(L?"[&>*]:snap-start":""),style:{display:"grid",gap:l(w),gridAutoFlow:K?"column":"row",...K?{width:"max-content",gridTemplateRows:`repeat(${G}, auto)`,gridAutoColumns:"max-content"}:{gridTemplateColumns:`repeat(${G}, minmax(0, 1fr))`,gridAutoRows:"max-content"}},children:H})}),ce&&ue?scrollButton(!0):null,ce&&!ue?t("div",{className:c("pointer-events-none absolute inset-0 flex justify-between",K?"items-center":"flex-col items-center",p[Y]),children:[scrollButton(!1),scrollButton(!0)]}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as t from"react";import{useDefaults as a}from"../../internal/defaults.js";import{Radio as r}from"@base-ui/react/radio";import{RadioGroup as l}from"@base-ui/react/radio-group";import{controlHeightClasses as n,controlSlots as o,controlTextClasses as i,focusRingInsetClasses as d,
|
|
1
|
+
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as t from"react";import{useDefaults as a}from"../../internal/defaults.js";import{Radio as r}from"@base-ui/react/radio";import{RadioGroup as l}from"@base-ui/react/radio-group";import{controlHeightClasses as n,controlSlots as o,controlTextClasses as i,focusRingInsetClasses as d,forcedCheckedTextClasses as u,forcedFieldEdgeClasses as c,forcedFillClasses as p,gapClasses as f,glassClasses as h,hasContent as g,iconClasses as m,paddingXClasses as v,transitionClasses as y}from"../../internal/styles.js";const b=/* @__PURE__ */t.createContext({variant:"glass",size:"md",density:"default",fullWidth:!1}),x={solid:`${h} bg-(--plass-glass-press) p-1 [box-shadow:var(--p-elev),var(--plass-well)] ${c}`,glass:`${h} border bg-(--plass-glass) p-1 [border-color:var(--plass-glass-line)] [box-shadow:var(--p-elev),var(--plass-well)]`,ghost:""},w={solid:"[background-image:var(--p-fill)] [box-shadow:var(--plass-shadow-1),var(--p-lift)]",glass:`${h} bg-(--plass-glass-press) [box-shadow:var(--plass-shadow-1),var(--plass-gloss-glass)]`,ghost:`${h} bg-(--plass-glass-press) [box-shadow:var(--plass-shadow-1),var(--plass-gloss-glass)]`},k={solid:"data-[checked]:text-(--p-on-solid)",glass:"data-[checked]:text-(--p-accent)",ghost:"data-[checked]:text-(--p-accent)"};export const PlSegment=/* @__PURE__ */t.forwardRef(function PlSegment({value:a,startIcon:l,endIcon:o,disabled:c=!1,className:p,children:h,...x},w){const{variant:j,size:P,density:$,fullWidth:R}=t.useContext(b);return s(r.Root,{ref:w,value:a,disabled:c,"data-segment":"",className:["relative z-10 inline-flex shrink-0 cursor-pointer items-center justify-center select-none","font-semibold whitespace-nowrap","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",n[P],i[P],f[P],v[$][P],"rounded-full",y,m,"text-(--plass-muted-fg) hover:text-(--plass-fg)",k[j],u,d,"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","data-[readonly]:cursor-default",R?"flex-1":"",p??""].filter(Boolean).join(" "),...x,children:[g(l)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:l}):null,h,g(o)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:o}):null]})});export const PlSegmentedButton=/* @__PURE__ */t.forwardRef(function PlSegmentedButton({variant:r="glass",size:n,color:i,density:d,elevation:u=0,value:c,defaultValue:f=null,onValueChange:h,disabled:g=!1,readOnly:m=!1,name:v,fullWidth:k=!1,className:j,style:P,children:$,...R},z){const N=a(),S=n??N.size??"md",W=i??N.color??"primary",C=d??N.density??"default",[B,A]=t.useState(f),O=void 0!==c,V=O?c:B,E=t.useRef(null),I=t.useRef(null),L=t.useCallback(e=>{const s=E.current,t=I.current;if(!s||!t)return;const a=s.querySelector("[data-segment][data-checked]");if(!a)return;const r=!e||!t.hasAttribute("data-ready");r&&t.removeAttribute("data-ready"),t.style.setProperty("--p-seg-x",`${a.offsetLeft}px`),t.style.setProperty("--p-seg-y",`${a.offsetTop}px`),t.style.setProperty("--p-seg-w",`${a.offsetWidth}px`),t.style.setProperty("--p-seg-h",`${a.offsetHeight}px`),r&&t.offsetWidth,t.setAttribute("data-ready","")},[]);t.useLayoutEffect(()=>{L(!0)},[L,V,r,S,C,k,$]),t.useEffect(()=>{const e=E.current;if(!e)return;const s=new ResizeObserver(()=>L(!1));return s.observe(e),()=>s.disconnect()},[L]);const q=t.useMemo(()=>({variant:r,size:S,density:C,fullWidth:k}),[r,S,C,k]);return e(b.Provider,{value:q,children:s(l,{ref:e=>{E.current=e,"function"==typeof z?z(e):z&&(z.current=e)},value:V,onValueChange:e=>{const s=e??null;O||A(s),h?.(s)},disabled:g,readOnly:m,name:v,className:["relative inline-flex items-center rounded-full",x[r],y,m?"saturate-[0.55]":"",g?"opacity-50 saturate-[0.35]":"",k?"flex w-full":"",j??""].filter(Boolean).join(" "),style:{...o(W,u,r),...P},...R,children:[null!=V?e("span",{ref:I,"aria-hidden":"true",className:["pointer-events-none absolute rounded-full","top-(--p-seg-y) left-(--p-seg-x) h-(--p-seg-h) w-(--p-seg-w)",w[r],p,"[transition-property:left,top,width,height]","[transition-timing-function:var(--plass-ease)]","[transition-duration:0ms] data-[ready]:[transition-duration:var(--plass-duration)]"].join(" ")}):null,$]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{useDefaults as t}from"../../internal/defaults.js";import{Select as s}from"@base-ui/react/select";import{Field as r}from"@base-ui/react/field";import{CheckIcon as i,ChevronIcon as n}from"../../internal/icons.js";import{WidthSizer as o}from"../../internal/sizer.js";import{hotKeyHandler as c}from"../../internal/keys.js";import{controlHeightClasses as d,controlTextLeadingClasses as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{useDefaults as t}from"../../internal/defaults.js";import{Select as s}from"@base-ui/react/select";import{Field as r}from"@base-ui/react/field";import{CheckIcon as i,ChevronIcon as n}from"../../internal/icons.js";import{WidthSizer as o}from"../../internal/sizer.js";import{hotKeyHandler as c}from"../../internal/keys.js";import{controlHeightClasses as d,controlTextLeadingClasses as p,cx as m,disabledClasses as u,fieldReadOnlyClasses as f,fieldRestClasses as h,focusWithinRingClasses as g,forcedHighlightedClasses as v,gapClasses as x,glassClasses as b,hasContent as y,iconClasses as N,metaTextClasses as j,paddingXClasses as w,radiusClasses as S,stackGapClasses as I,surfaceSlots as z,transitionClasses as P}from"../../internal/styles.js";const V=/* @__PURE__ */["group relative flex w-full cursor-pointer items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",P,g,N].join(" "),k=/* @__PURE__ */[b,"max-h-[min(20rem,var(--available-height))] overflow-y-auto overscroll-contain","min-w-[var(--anchor-width)] border bg-(--plass-glass-press) p-1","[border-color:var(--plass-glass-line)]","[box-shadow:var(--plass-shadow-3),var(--plass-gloss-glass)]","[outline:none]","[transition:opacity_var(--plass-duration)_var(--plass-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),O=/* @__PURE__ */["relative flex cursor-pointer items-center gap-2 select-none","rounded-(--plass-radius-xs) py-1.5 pe-2 ps-7",P,"data-[highlighted]:bg-(--p-soft-hover) data-[highlighted]:text-(--p-accent)",v,"data-[selected]:font-semibold data-[selected]:text-(--p-accent)","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","[outline:none]"].join(" ");export const PlSelect=/* @__PURE__ */l.forwardRef(function PlSelect({variant:g="glass",size:v,color:b,density:N,elevation:P=0,items:$,value:_,defaultValue:C,onValueChange:R,placeholder:T,label:q,description:B,error:D,invalid:E,startIcon:K,fullWidth:M=!1,disabled:W=!1,readOnly:L=!1,required:A=!1,name:F,id:G,className:H,hotKeys:J,classNames:Q,style:U,...X},Y){const Z=t(),ee=v??Z.size??"md",ae=b??Z.color??"primary",le=N??Z.density??"default",te=y(D),se=E??te,re=se?"danger":ae,ie=l.useMemo(()=>$.map(e=>({label:e.label??String(e.value),value:e.value})),[$]),[ne,oe]=l.useState(!1);l.useEffect(()=>{L&&oe(!1)},[L]);const ce=l.useMemo(()=>M?[]:[...$.map(e=>e.label??String(e.value)),...y(T)?[T]:[]],[M,$,T]);return a(r.Root,{disabled:W,invalid:se,className:["flex-col align-top",I[ee],M?"flex w-full":"inline-flex",H??""].filter(Boolean).join(" "),style:{...z(re,P),...U},...X,children:[q?e(r.Label,{className:m(j[ee],"font-semibold",W?"text-(--plass-muted-fg)":"text-(--plass-fg)",Q?.label),children:q}):null,a(s.Root,{id:G,name:F,items:ie,value:_,defaultValue:C,onValueChange:e=>R?.(e),disabled:W,readOnly:L,required:A,open:ne&&!L,onOpenChange:e=>oe(e&&!L),children:[a(s.Trigger,{ref:Y,onKeyDown:c(J,void 0),className:[V,d[ee],p[ee],S[ee],x[ee],w[le][ee],W?u[g]:L?`${f[g]} cursor-default`:h[g],Q?.control].filter(Boolean).join(" "),children:[K?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:K}):null,a("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(s.Value,{className:["w-full truncate text-start","data-[placeholder]:text-(--plass-muted-fg)"].join(" "),placeholder:T}),e(o,{samples:ce})]}),e(s.Icon,{className:["flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)","[transition:rotate_var(--plass-duration)_var(--plass-ease)]","data-[popup-open]:rotate-180"].join(" "),children:e(n,{})})]}),e(s.Portal,{children:e(s.Positioner,{className:"plass-portal z-(--plass-z-portal) [outline:none]",sideOffset:6,alignItemWithTrigger:!1,children:e(s.Popup,{className:`${k} ${S[ee]} ${p[ee]}`,style:z(re,3),children:$.map(l=>a(s.Item,{value:l.value,disabled:l.disabled,className:O,children:[e(s.ItemIndicator,{className:"absolute start-1.5 flex size-4 items-center justify-center",children:e(i,{})}),e(s.ItemText,{className:"truncate",children:l.label??String(l.value)})]},String(l.value)))})})})]}),B?e(r.Description,{className:m(j[ee],"text-(--plass-muted-fg)",Q?.description),children:B}):null,e(r.Error,te?{match:!0,className:m(j[ee],"text-(--p-accent)",Q?.error),children:D}:{className:m(j[ee],"text-(--p-accent)",Q?.error)})]})});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassBreakpointFloor } from '../../types.js';
|
|
4
|
+
export interface PlShowProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
/**
|
|
6
|
+
* The narrowest width this is drawn at. Below it, nothing.
|
|
7
|
+
*
|
|
8
|
+
* There is no `xs`: everything is at or above the bottom rung, so `from="xs"`
|
|
9
|
+
* would mean "always" — which is what leaving the prop out already means.
|
|
10
|
+
*/
|
|
11
|
+
from?: PlassBreakpointFloor;
|
|
12
|
+
/**
|
|
13
|
+
* The width it stops being drawn at. From that rung up, nothing.
|
|
14
|
+
*
|
|
15
|
+
* Exclusive, and it has to be: `until="md"` on one element and `from="md"` on
|
|
16
|
+
* another are then the two halves of one decision, with no width that draws
|
|
17
|
+
* both and none that draws neither.
|
|
18
|
+
*/
|
|
19
|
+
until?: PlassBreakpointFloor;
|
|
20
|
+
/**
|
|
21
|
+
* Renders something other than a `<div>`: `render={<span />}`. Base UI's own
|
|
22
|
+
* escape hatch.
|
|
23
|
+
*
|
|
24
|
+
* A paragraph cannot hold a `<div>`, so inside a `<p>` an HTML parser closes
|
|
25
|
+
* the paragraph in front of it and a page rendered on a server no longer
|
|
26
|
+
* hydrates. A gate in a line of text wants a `<span>`, and gates the same way.
|
|
27
|
+
*/
|
|
28
|
+
render?: useRender.RenderProp;
|
|
29
|
+
/** What is shown, at the widths it is shown at. */
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Content at some widths and not others.
|
|
34
|
+
*
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <PlShow from="md">
|
|
37
|
+
* <PlTable columns={columns} rows={rows} />
|
|
38
|
+
* </PlShow>
|
|
39
|
+
* <PlShow until="md">
|
|
40
|
+
* <PlList>…</PlList>
|
|
41
|
+
* </PlShow>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* **It is not a box.** While it is showing it is `display: contents`, so its
|
|
45
|
+
* children take part in the layout around it exactly as they would have without
|
|
46
|
+
* it — a gate inside a flex row does not become a flex item, and one inside a
|
|
47
|
+
* grid does not become a cell. Which also means a `className` carrying a margin
|
|
48
|
+
* or a width does nothing here: there is no box for it to land on. Put your own
|
|
49
|
+
* element inside.
|
|
50
|
+
*
|
|
51
|
+
* **It decides in CSS, and that is the whole point.** A media query answered in
|
|
52
|
+
* JavaScript is `false` on a server and on the first frame a browser renders,
|
|
53
|
+
* so a `useMediaQuery` and a ternary draw the wrong half of a responsive layout
|
|
54
|
+
* and then throw it away — a flash on every page load rather than an edge case.
|
|
55
|
+
* The stylesheet knows the width before React has been asked anything.
|
|
56
|
+
*
|
|
57
|
+
* What follows from that is the trade worth knowing: **both halves are in the
|
|
58
|
+
* document**. Hiding is `display: none`, which takes the subtree off the
|
|
59
|
+
* accessibility tree and out of the layout, so nothing is read twice and
|
|
60
|
+
* nothing is drawn — but both were rendered and both were sent. That is right
|
|
61
|
+
* for two arrangements of the same content and wrong for a subtree that is
|
|
62
|
+
* expensive to build or that must not mount at all; for those,
|
|
63
|
+
* `usePlBreakpointValue` picks one and only that one is mounted, at the cost of
|
|
64
|
+
* a server rendering the `xs` answer.
|
|
65
|
+
*
|
|
66
|
+
* **A layer that portals out is not hidden with its half.** A `PlModal`, a
|
|
67
|
+
* `PlDrawer` or a popover renders at the end of `<body>`, outside the box that
|
|
68
|
+
* `display: none` hides, so an open one in the closed half shows. Two halves
|
|
69
|
+
* that read the same `open` open two windows. Keep layers outside `PlShow`, or
|
|
70
|
+
* choose between them with `usePlBreakpointValue`.
|
|
71
|
+
*
|
|
72
|
+
* There is no `PlHide`, deliberately. `until` is the inverse of `from` and the
|
|
73
|
+
* two together are a band, so a second component would be a second way to spell
|
|
74
|
+
* the same three cases.
|
|
75
|
+
*/
|
|
76
|
+
export declare const PlShow: React.ForwardRefExoticComponent<PlShowProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as r from"react";import{useRender as e}from"@base-ui/react/use-render";import{cx as o}from"../../internal/styles.js";export const PlShow=/* @__PURE__ */r.forwardRef(function PlShow({from:r,until:a,render:s,className:t,children:n,...l},i){return e({render:s,ref:i,props:{className:o("plass-show",t),"data-from":r,"data-until":a,children:n,...l}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlShow}from"./PlShow.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{useDefaults as n}from"../../internal/defaults.js";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{useDefaults as n}from"../../internal/defaults.js";import{useLabels as o}from"../../internal/labels.js";import{beginPointerDrag as i}from"../../internal/drag.js";import{PlDrawer as a}from"../drawer/PlDrawer.js";import{drawerSide as s,expandedOnlyClasses as l,PlPageLayoutContext as u,PlassSidebarSideContext as d,useCollapsed as c}from"../../internal/page-layout.js";import{cx as p,sheetPaddingXClasses as m,sheetPaddingYClasses as f,sheetRestClasses as b,surfaceSlots as h,toLength as v,transitionClasses as x}from"../../internal/styles.js";const y={xs:"11rem",sm:"13rem",md:"16rem",lg:"18rem",xl:"21rem"},g=b;function toPixels(e,t){if(null==e)return t;if("number"==typeof e)return e;const r=/^\s*(-?[\d.]+)\s*(px|rem|em|%)\s*$/.exec(e);if(!r)return t;const n=Number(r[1]);if(Number.isNaN(n))return t;switch(r[2]){case"px":return n;case"%":return"undefined"==typeof window?t:window.innerWidth*n/100;default:return n*parseFloat(("undefined"==typeof document?"":getComputedStyle(document.documentElement).fontSize)||"16")}}export const PlSidebar=/* @__PURE__ */r.forwardRef(function PlSidebar({side:b,width:w,minWidth:z=160,maxWidth:C=480,resizable:R=!1,onResize:j,onResizeEnd:N,collapseBelow:P,open:S,defaultOpen:k=!1,onOpenChange:M,sticky:A=!0,title:B,variant:D="glass",size:E,color:L,density:O,elevation:I=0,divider:W=!0,padded:T=!0,label:X,closeLabel:$,resizeLabel:_,className:F,style:K,children:q,...G},H){const J=n(),Q=o(),U=X??Q.sidebar,V=$??Q.sidebarClose,Y=_??Q.sidebarResize,Z=E??J.size??"md",ee=L??J.color??"primary",te=O??J.density??"default",re=r.useContext(u),ne=r.useContext(d),oe=b??ne??"start",ie=P??(re.present?re.collapseBelow:"none"),ae=c(ie),[se,le]=r.useState(k),ue=void 0!==S,de=ue?S:re.present?re.open[oe]:se,ce=v(w)??y[Z],pe=r.useRef(null),me=r.useCallback(e=>{pe.current=e,"function"==typeof H?H(e):H&&(H.current=e)},[H]),fe=r.useRef(null);r.useEffect(()=>()=>fe.current?.(),[]);const be=r.useRef(null),he=toPixels(z,160),ve=toPixels(C,480),xe=Math.min(ve,Math.max(he,Math.round(toPixels(ce,he)))),applyWidth=e=>{const t=pe.current;if(!t)return e;const r=Math.min(ve,Math.max(he,Math.round(e)));return t.style.setProperty("--p-sidebar-w",`${r}px`),be.current?.setAttribute("aria-valuenow",String(r)),r};return ae?e(a,{side:s(oe,J.direction),mode:"overlay",open:de,onOpenChange:e=>{ue||(re.present?re.setOpen(oe,e):le(e)),M?.(e)},title:B,size:Z,color:ee,density:te,closeLabel:V,extent:void 0===w?void 0:ce,"aria-label":B?void 0:U,className:F,style:K,children:q}):t("aside",{ref:me,"aria-label":U,className:p("relative flex min-w-0 shrink-0 flex-col","w-(--p-sidebar-w)",g[D],W?p("start"===oe?"border-e":"border-s","[border-color:var(--plass-divider)]"):"","content"===re.scroll?"h-full":A?p("self-start","sticky [top:var(--p-layout-header,0px)]","[height:calc(100dvh-var(--p-layout-header,0px)-var(--p-layout-footer,0px))]"):"",l[ie],x,F),style:{...h(ee,I),"--p-sidebar-w":ce,...K},...G,children:[e("div",{className:p("min-h-0 flex-1 overflow-y-auto overscroll-contain",T?p(m[te][Z],f[te][Z]):""),children:q}),R?e("div",{ref:be,role:"separator","aria-orientation":"vertical","aria-label":Y,"aria-valuenow":xe,"aria-valuemin":he,"aria-valuemax":ve,tabIndex:0,className:p("absolute inset-y-0 z-1 w-2 cursor-col-resize touch-none","start"===oe?"end-0 -me-1":"start-0 -ms-1","bg-transparent hover:bg-(--p-soft) data-[dragging]:bg-(--p-soft)",x,"[outline:none] focus-visible:[outline:2px_solid_var(--p-ring)]","focus-visible:[outline-offset:0px]"),onPointerDown:e=>{const t=pe.current;if(!t||0!==e.button)return;const r=e.clientX,n=t.getBoundingClientRect().width,o="rtl"===getComputedStyle(t).direction,a="start"===oe===o?-1:1;let s=n;fe.current=i({target:e.currentTarget,pointerId:e.pointerId,onMove:e=>{s=applyWidth(n+(e.clientX-r)*a),j?.(s)},onEnd:()=>{fe.current=null,N?.(s)}})},onKeyDown:e=>{if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const t="rtl"===getComputedStyle(e.currentTarget).direction,r="start"===oe===t?-1:1;(e=>{const t=pe.current;if(!t)return;const r=applyWidth(t.getBoundingClientRect().width+e);j?.(r),N?.(r)})(("ArrowRight"===e.key?16:-16)*r)}}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{PlIconButton as n}from"../icon-button/PlIconButton.js";import{collapsedOnlyClasses as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{PlIconButton as n}from"../icon-button/PlIconButton.js";import{useLabels as o}from"../../internal/labels.js";import{collapsedOnlyClasses as t,PlPageLayoutContext as i}from"../../internal/page-layout.js";import{cx as a}from"../../internal/styles.js";function MenuIcon(){return e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:e("path",{d:"M4 7h16M4 12h16M4 17h16",strokeLinecap:"round"})})}export const PlSidebarTrigger=/* @__PURE__ */r.forwardRef(function PlSidebarTrigger({side:s="start",collapseBelow:l,icon:c,label:p,variant:u="ghost",className:m,onClick:d,...f},b){const h=r.useContext(i),g=o();if(!h.present)return null;const j=l??h.collapseBelow,x=h.open[s];return e(n,{ref:b,variant:u,icon:c??e(MenuIcon,{}),label:p??(x?g.sidebarClose:g.sidebarOpen),"aria-expanded":x,className:a(t[j],m),onClick:e=>{h.setOpen(s,!x),d?.(e)},...f})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,Fragment as r,jsxs as l}from"react/jsx-runtime";import*as s from"react";import{useDefaults as n}from"../../internal/defaults.js";import{useRender as d}from"@base-ui/react/use-render";import{controlHeightClasses as o,controlSquareClasses as a,srOnlyClasses as m,surfaceSlots as t}from"../../internal/styles.js";const i={xs:"h-[0.6875rem]",sm:"h-[0.75rem]",md:"h-[0.8125rem]",lg:"h-[0.9375rem]",xl:"h-[1.0625rem]"},u={xs:"gap-[0.3125rem]",sm:"gap-[0.375rem]",md:"gap-[0.5625rem]",lg:"gap-[0.5625rem]",xl:"gap-[0.6875rem]"},h={xs:"rounded-[0.3125rem]",sm:"rounded-[0.3125rem]",md:"rounded-[0.375rem]",lg:"rounded-[0.4375rem]",xl:"rounded-[0.5rem]"},f={xs:"h-12",sm:"h-16",md:"h-20",lg:"h-28",xl:"h-36"},p={xs:"rounded-(--plass-radius-xs)",sm:"rounded-(--plass-radius-sm)",md:"rounded-(--plass-radius-md)",lg:"rounded-(--plass-radius-lg)",xl:"rounded-(--plass-radius-xl)"},c="relative overflow-hidden bg-(--p-soft-hover)";function length(e){if(void 0!==e)return"number"==typeof e?`${e}px`:e}export const PlSkeleton=/* @__PURE__ */s.forwardRef(function PlSkeleton({shape:s="line",lines:g=1,size:x,color:w,width:j,height:$,animated:v=!0,label:y,render:b,className:k,style:N,...z},B){const P=n(),S=x??P.size??"md",A=w??P.color??"secondary",F=v?"plass-skeleton":"",R="circle"===s?`shrink-0 rounded-full ${o[S]} ${a[S]}`:"rect"===s?`w-full ${p[S]} ${void 0===$?f[S]:""}`:`w-full ${h[S]} ${i[S]}`,q=y?{role:"status"}:{"aria-hidden":!0},C=y?e("span",{className:m,children:y}):null,D="line"===s&&g>1;return d({render:b,ref:B,props:{className:(D?["flex w-full flex-col",u[S],k??""]:[c,F,R,k??""]).filter(Boolean).join(" "),style:{...t(A,0),width:length(j),height:length($),...N},...q,...D||C?{children:l(r,{children:[D?Array.from({length:g},(r,l)=>e("div",{className:[c,F,h[S],i[S],l===g-1?"w-3/5":"w-full"].filter(Boolean).join(" ")},l)):null,C]})}:null,...z}})});
|
|
@@ -21,8 +21,20 @@ export interface PlSliderProps extends BaseSliderProps {
|
|
|
21
21
|
orientation?: PlassOrientation;
|
|
22
22
|
/** The label above the track. */
|
|
23
23
|
label?: React.ReactNode;
|
|
24
|
-
/** Helper text below the track. */
|
|
24
|
+
/** Helper text below the track. Each thumb is described by it. */
|
|
25
25
|
description?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* The name of the thumb at `index`, for a range whose two ends need names of
|
|
28
|
+
* their own, such as "Minimum price" and "Maximum price". Left out, every
|
|
29
|
+
* thumb is named by `label`.
|
|
30
|
+
*/
|
|
31
|
+
getAriaLabel?: (index: number) => string;
|
|
32
|
+
/**
|
|
33
|
+
* What a screen reader says for the value of the thumb at `index`, given the
|
|
34
|
+
* value formatted for the locale and the raw number. Left out, it is the
|
|
35
|
+
* formatted number.
|
|
36
|
+
*/
|
|
37
|
+
getAriaValueText?: (formattedValue: string, value: number, index: number) => string;
|
|
26
38
|
/**
|
|
27
39
|
* Shows the current value beside the label. Pass a function to format it —
|
|
28
40
|
* the raw numbers and Base UI's already-localised strings are both handed in.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{useDefaults as l}from"../../internal/defaults.js";import{Slider as o}from"@base-ui/react/slider";import{controlSlots as s,focusRingClasses as t,forcedFieldEdgeClasses as i,forcedFillClasses as n,metaTextClasses as d}from"../../internal/styles.js";const c={xs:"h-1",sm:"h-1.5",md:"h-1.5",lg:"h-2",xl:"h-2.5"},u={xs:"w-1",sm:"w-1.5",md:"w-1.5",lg:"w-2",xl:"w-2.5"},m={xs:"size-3",sm:"size-3.5",md:"size-4.5",lg:"size-5",xl:"size-6"},f={xs:"h-4",sm:"h-4.5",md:"h-5",lg:"h-6",xl:"h-7"},p={xs:"w-4",sm:"w-4.5",md:"w-5",lg:"w-6",xl:"w-7"},g=`rounded-full bg-(--plass-track) ${i}`,h=/* @__PURE__ */["[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]","data-[dragging]:[transition-duration:0ms]","motion-reduce:[transition-duration:0ms]"].join(" "),x=/* @__PURE__ */["rounded-full [background-image:var(--p-fill)]",n,"forced-colors:data-[disabled]:[background-color:GrayText]","[transition-property:width,height,inset-inline-start,bottom,filter,opacity]",h].join(" "),b=/* @__PURE__ */["rounded-full border-2 [background-image:var(--p-fill)]","[border-color:var(--plass-surface)]","forced-colors:[background-color:CanvasText] forced-colors:[border-color:Canvas]","forced-colors:data-[disabled]:[background-color:GrayText]","[box-shadow:var(--p-elev),var(--p-lift)]","cursor-grab select-none active:cursor-grabbing","[transition-property:box-shadow,inset-inline-start,bottom,filter,opacity]",h,"hover:[box-shadow:var(--p-elev-hover),var(--p-lift-hover),0_0_0_4px_var(--p-soft)]",t,"data-[dragging]:[box-shadow:var(--p-elev-press),var(--p-lift-press),0_0_0_6px_var(--p-soft-hover)]"].join(" ");export const PlSlider=/* @__PURE__ */r.forwardRef(function PlSlider({size:t,color:i,elevation:n=1,orientation:h="horizontal",label:v,description:w,getAriaLabel:y,getAriaValueText:j,showValue:N=!1,disabled:$=!1,className:_,style:z,...k},A){const T=r.useId(),V=l(),C=t??V.size??"md",L=i??V.color??"primary",S="vertical"===h,G=k.value??k.defaultValue,I=Array.isArray(G)?G.length:1;return a(o.Root,{ref:A,orientation:h,disabled:$,className:["flex",S?"w-fit flex-col items-center gap-2":"w-full flex-col gap-1.5",$?"opacity-50 saturate-[0.35] [&_*]:cursor-not-allowed":"",_??""].filter(Boolean).join(" "),style:{...s(L,n,"solid"),...z},...k,children:[v||N?a("div",{className:`flex w-full items-baseline gap-2 ${d[C]}`,children:[v?e(o.Label,{className:"font-semibold text-(--plass-fg)",children:v}):null,N?e(o.Value,{className:"ms-auto tabular-nums text-(--plass-muted-fg)",children:"function"==typeof N?N:null}):null]}):null,e(o.Control,{className:["flex touch-none items-center justify-center select-none",S?`${p[C]} h-40 flex-col`:`w-full ${f[C]}`].join(" "),children:a(o.Track,{className:[g,S?`${u[C]} h-full`:`${c[C]} w-full`].join(" "),children:[e(o.Indicator,{className:x}),Array.from({length:I},(a,r)=>e(o.Thumb,{index:r,getAriaLabel:y,getAriaValueText:j,"aria-describedby":w?T:void 0,className:`${b} ${m[C]}`},r))]})}),w?e("div",{id:T,className:`${d[C]} text-(--plass-muted-fg)`,children:w}):null]})});
|