plass-ui 1.2.0 → 1.4.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 +668 -0
- package/README.md +1 -1
- package/dist/components/accordion/PlAccordion.js +1 -1
- package/dist/components/alert/PlAlert.js +1 -1
- package/dist/components/anchor/PlAnchor.d.ts +72 -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-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 +54 -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.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.js +1 -1
- package/dist/components/avatar/PlAvatar.js +1 -1
- package/dist/components/back-top/PlBackTop.d.ts +55 -0
- package/dist/components/back-top/PlBackTop.js +1 -0
- package/dist/components/back-top/index.d.ts +2 -0
- package/dist/components/back-top/index.js +1 -0
- 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/blockquote/PlBlockquote.js +1 -1
- package/dist/components/bottom-navigation/PlBottomNavigation.js +1 -1
- package/dist/components/box/PlBox.js +1 -1
- package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
- package/dist/components/button/PlButton.js +1 -1
- package/dist/components/button-group/PlButtonGroup.js +1 -1
- package/dist/components/calendar/PlCalendar.d.ts +104 -0
- package/dist/components/calendar/PlCalendar.js +1 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/card/PlCard.js +1 -1
- package/dist/components/carousel/PlCarousel.js +1 -1
- package/dist/components/chat-bubble/PlChatBubble.js +1 -1
- package/dist/components/checkbox/PlCheckbox.js +1 -1
- package/dist/components/chip/PlChip.js +1 -1
- package/dist/components/code-block/PlCodeBlock.d.ts +175 -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/collapsible/PlCollapsible.js +1 -1
- package/dist/components/color-picker/PlColorPicker.js +1 -1
- package/dist/components/combobox/PlCombobox.d.ts +11 -2
- package/dist/components/combobox/PlCombobox.js +1 -1
- package/dist/components/command-palette/PlCommandPalette.d.ts +1 -1
- package/dist/components/command-palette/PlCommandPalette.js +1 -1
- package/dist/components/confirm/PlConfirmProvider.d.ts +100 -0
- package/dist/components/confirm/PlConfirmProvider.js +1 -0
- package/dist/components/confirm/index.d.ts +2 -0
- package/dist/components/confirm/index.js +1 -0
- 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 +202 -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.d.ts +41 -2
- 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/divider/PlDivider.js +1 -1
- package/dist/components/drawer/PlDrawer.d.ts +1 -1
- package/dist/components/drawer/PlDrawer.js +1 -1
- package/dist/components/empty/PlEmpty.d.ts +47 -0
- package/dist/components/empty/PlEmpty.js +1 -0
- package/dist/components/empty/index.d.ts +2 -0
- package/dist/components/empty/index.js +1 -0
- 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.js +1 -1
- package/dist/components/footer/PlFooter.d.ts +4 -3
- package/dist/components/footer/PlFooter.js +1 -1
- package/dist/components/gallery/PlGallery.d.ts +154 -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 +94 -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 +72 -0
- package/dist/components/image/PlImage.js +1 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/image/index.js +1 -0
- 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/list/PlList.js +1 -1
- package/dist/components/menu/PlMenu.d.ts +2 -2
- package/dist/components/menu/PlMenu.js +1 -1
- package/dist/components/menubar/PlMenubar.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.js +1 -1
- package/dist/components/number-field/PlNumberField.d.ts +11 -2
- package/dist/components/number-field/PlNumberField.js +1 -1
- package/dist/components/otp-field/PlOtpField.d.ts +10 -1
- 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.js +1 -1
- package/dist/components/panes/PlPanes.d.ts +2 -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 +61 -0
- package/dist/components/popconfirm/PlPopconfirm.js +1 -0
- package/dist/components/popconfirm/index.d.ts +2 -0
- package/dist/components/popconfirm/index.js +1 -0
- package/dist/components/popover/PlPopover.d.ts +1 -1
- 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.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 +9 -5
- package/dist/components/scroll-zone/PlScrollZone.js +1 -1
- package/dist/components/segmented-button/PlSegmentedButton.js +1 -1
- package/dist/components/select/PlSelect.d.ts +10 -1
- package/dist/components/select/PlSelect.js +1 -1
- package/dist/components/show/PlShow.d.ts +60 -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/skeleton/PlSkeleton.js +1 -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 +8 -0
- 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 +66 -0
- package/dist/components/stat/PlStat.js +1 -0
- package/dist/components/stat/index.d.ts +2 -0
- package/dist/components/stat/index.js +1 -0
- package/dist/components/stepper/PlStepper.d.ts +86 -0
- package/dist/components/stepper/PlStepper.js +1 -0
- package/dist/components/stepper/index.d.ts +2 -0
- package/dist/components/stepper/index.js +1 -0
- package/dist/components/switch/PlSwitch.js +1 -1
- package/dist/components/table/PlTable.js +1 -1
- package/dist/components/tabs/PlTabs.d.ts +2 -2
- package/dist/components/tabs/PlTabs.js +1 -1
- package/dist/components/text-field/PlTextField.d.ts +10 -1
- package/dist/components/text-field/PlTextField.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 +7 -10
- 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/toolbar/PlToolbar.js +1 -1
- package/dist/components/tooltip/PlTooltip.d.ts +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.js +1 -1
- package/dist/components/tree/PlTree.d.ts +67 -0
- package/dist/components/tree/PlTree.js +1 -0
- package/dist/components/tree/index.d.ts +2 -0
- package/dist/components/tree/index.js +1 -0
- 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/visually-hidden/PlVisuallyHidden.d.ts +46 -0
- package/dist/components/visually-hidden/PlVisuallyHidden.js +1 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/index.js +1 -0
- 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 +2 -0
- package/dist/css/back-top.css +2 -0
- package/dist/css/bar-chart.css +2 -0
- package/dist/css/calendar.css +2 -0
- package/dist/css/code-block.css +2 -0
- package/dist/css/confirm.css +2 -0
- package/dist/css/data-list.css +2 -0
- package/dist/css/data-table.css +2 -0
- package/dist/css/empty.css +2 -0
- package/dist/css/flex.css +2 -0
- package/dist/css/floating-action-button.css +2 -0
- package/dist/css/gallery.css +2 -0
- package/dist/css/gauge-chart.css +2 -0
- package/dist/css/heatmap-chart.css +2 -0
- package/dist/css/hover-card.css +2 -0
- package/dist/css/how-to-steps.css +2 -0
- package/dist/css/image.css +2 -0
- package/dist/css/line-chart.css +2 -0
- package/dist/css/meter.css +2 -0
- package/dist/css/mockup.css +2 -0
- package/dist/css/pie-chart.css +2 -0
- package/dist/css/popconfirm.css +2 -0
- package/dist/css/portal.css +2 -0
- package/dist/css/scatter-chart.css +2 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/show.css +2 -0
- package/dist/css/sparkline.css +2 -0
- package/dist/css/stack.css +2 -0
- package/dist/css/stat.css +2 -0
- package/dist/css/stepper.css +2 -0
- package/dist/css/timeline-chart.css +2 -0
- package/dist/css/tour.css +2 -0
- package/dist/css/tree-select.css +2 -0
- package/dist/css/tree.css +2 -0
- package/dist/css/visually-hidden.css +2 -0
- package/dist/css/window-pane.css +2 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/usePlBreakpoint.d.ts +41 -0
- package/dist/hooks/usePlBreakpoint.js +1 -0
- package/dist/hooks/usePlColorScheme.d.ts +66 -0
- package/dist/hooks/usePlColorScheme.js +1 -0
- package/dist/hooks/usePlDisclosure.d.ts +44 -0
- package/dist/hooks/usePlDisclosure.js +1 -0
- package/dist/hooks/usePlElementSize.d.ts +31 -0
- package/dist/hooks/usePlElementSize.js +1 -0
- package/dist/hooks/usePlHotKeys.d.ts +81 -0
- package/dist/hooks/usePlHotKeys.js +1 -0
- package/dist/hooks/usePlMediaQuery.d.ts +22 -0
- package/dist/hooks/usePlMediaQuery.js +1 -0
- package/dist/hooks/usePlOnScreen.d.ts +50 -0
- package/dist/hooks/usePlOnScreen.js +1 -0
- package/dist/hooks/usePlReducedMotion.d.ts +22 -0
- package/dist/hooks/usePlReducedMotion.js +1 -0
- package/dist/index.d.ts +46 -1
- package/dist/index.js +1 -1
- package/dist/internal/animate.d.ts +91 -6
- 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 +33 -36
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +458 -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 +473 -0
- package/dist/internal/chart.js +1 -0
- package/dist/internal/color-scheme.d.ts +23 -0
- package/dist/internal/color-scheme.js +1 -0
- package/dist/internal/data-table.d.ts +69 -0
- package/dist/internal/data-table.js +1 -0
- package/dist/internal/date.d.ts +21 -0
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +74 -0
- package/dist/internal/defaults.js +1 -0
- package/dist/internal/direction.d.ts +4 -0
- package/dist/internal/direction.js +1 -0
- package/dist/internal/drag.d.ts +49 -0
- package/dist/internal/drag.js +1 -0
- package/dist/internal/format.d.ts +2 -0
- package/dist/internal/format.js +1 -1
- package/dist/internal/gallery.d.ts +34 -0
- package/dist/internal/gallery.js +1 -0
- package/dist/internal/grid.d.ts +6 -25
- 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/keys.d.ts +93 -0
- package/dist/internal/keys.js +1 -0
- package/dist/internal/labels.d.ts +138 -0
- package/dist/internal/labels.js +1 -0
- package/dist/internal/media.d.ts +26 -0
- package/dist/internal/media.js +1 -0
- package/dist/internal/mockup.d.ts +193 -0
- package/dist/internal/mockup.js +1 -0
- package/dist/internal/page-layout.d.ts +6 -6
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/progress.d.ts +6 -0
- package/dist/internal/responsive.d.ts +108 -0
- package/dist/internal/responsive.js +1 -0
- package/dist/internal/scramble.d.ts +31 -0
- package/dist/internal/scramble.js +1 -0
- package/dist/internal/steps.d.ts +76 -0
- package/dist/internal/steps.js +1 -0
- package/dist/internal/styles.d.ts +15 -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/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/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.d.ts +40 -0
- package/dist/provider/PlColorSchemeScript.js +1 -0
- package/dist/provider/PlassProvider.d.ts +39 -0
- package/dist/provider/PlassProvider.js +1 -0
- package/dist/provider/index.d.ts +6 -0
- package/dist/provider/index.js +1 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1133 -20
- package/dist/tokens.css +1133 -20
- package/dist/types.d.ts +398 -2
- package/package.json +30 -4
- 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
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassAnimateProps } from '../../types.js';
|
|
4
|
+
export interface PlAnimateShakeProps extends PlassAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
/**
|
|
6
|
+
* Plays the shake again whenever this value changes, and never on the first
|
|
7
|
+
* render.
|
|
8
|
+
*
|
|
9
|
+
* The prop the component exists around. `play` is a boolean, so replaying
|
|
10
|
+
* with it means toggling off and on — two renders for one event, and a piece
|
|
11
|
+
* of state whose only job is to be flipped back. A refusal is an **event**,
|
|
12
|
+
* and a value that has changed is the closest React has to one: a count of
|
|
13
|
+
* failed attempts already is this.
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <PlAnimateShake replay={attempts}>…</PlAnimateShake>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
replay?: unknown;
|
|
20
|
+
/**
|
|
21
|
+
* How far it travels either side of where it started. A number is pixels.
|
|
22
|
+
* @default 6
|
|
23
|
+
*/
|
|
24
|
+
distance?: number | string;
|
|
25
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
26
|
+
render?: useRender.RenderProp;
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A refusal.
|
|
31
|
+
*
|
|
32
|
+
* The one effect in the set that is a **response** rather than an entrance: it
|
|
33
|
+
* is what a form does when the password was wrong again, what a locked control
|
|
34
|
+
* does when it is pressed. So it starts held still and plays only when it is
|
|
35
|
+
* told to, where every other effect here starts on mount.
|
|
36
|
+
*
|
|
37
|
+
* `replay` is the prop it exists around. A refusal can happen twice, and
|
|
38
|
+
* `play`, being a boolean, cannot say "again" — replaying with it means
|
|
39
|
+
* toggling off and on, which is two renders for one event and a piece of state
|
|
40
|
+
* whose only job is to be flipped back. A value that has changed is the closest
|
|
41
|
+
* React has to an event, and the count of failed attempts a form already keeps
|
|
42
|
+
* is exactly that value.
|
|
43
|
+
*
|
|
44
|
+
* It is not in `PlassAnimation`, for `PlAnimateFloat`'s reason: that union is
|
|
45
|
+
* the set of ways content can arrive, and this is not an arrival.
|
|
46
|
+
*
|
|
47
|
+
* Three shudders either side of home and back to nothing, so a shaken element
|
|
48
|
+
* is exactly where it was. This is the one effect a caller will run over
|
|
49
|
+
* content that is still being typed into, and a field left a few pixels off its
|
|
50
|
+
* label would be worse than the error it was reporting.
|
|
51
|
+
*
|
|
52
|
+
* **A reader who asked for less motion sees none of it**, which is the whole
|
|
53
|
+
* reason the words matter more than the shake: whatever a refusal is saying has
|
|
54
|
+
* to be said in text as well, in something a screen reader is told about. The
|
|
55
|
+
* shake is emphasis, never the message.
|
|
56
|
+
*/
|
|
57
|
+
export declare const PlAnimateShake: React.ForwardRefExoticComponent<PlAnimateShakeProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";import{useRender as a}from"@base-ui/react/use-render";import{animBaseClass as r,lengthValue as n,useAnimateElement as t}from"../../internal/animate.js";import{cx as s}from"../../internal/styles.js";export const PlAnimateShake=/* @__PURE__ */e.forwardRef(function PlAnimateShake({duration:e=400,delay:l=0,easing:i,repeat:o=1,alternate:c,paused:d,trigger:p="manual",play:m=!1,once:f=!0,threshold:h=.2,replay:u,distance:y=6,render:g,className:k,style:N,children:j,...x},A){const P=t({effect:null,duration:e,delay:l,easing:i,repeat:o,alternate:c,x:n(y),trigger:p,play:m,once:f,threshold:h,paused:d,infinite:!1,nonce:u,children:j});return a({render:g,ref:[A,P.ref],props:{...x,className:s(r,"plass-anim-shake",P.className,k),style:{...P.style,...N},...P.props,"data-plass-animation":"shake",children:P.children}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlAnimateShake}from"./PlAnimateShake.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { PlassAnimateMode, PlassAnimateProps, PlassSide } from '../../types.js';
|
|
4
|
-
export interface PlAnimateSlideProps extends PlassAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { PlassAnimateMode, PlassAnimateProps, PlassAnimateStaggerProps, PlassAnimateTimelineProps, PlassSide } from '../../types.js';
|
|
4
|
+
export interface PlAnimateSlideProps extends PlassAnimateProps, PlassAnimateStaggerProps, PlassAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether the content slides in or slides away. `out` leaves by the same edge
|
|
7
7
|
* it would have come from.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,slideOffsets as a,useAnimateElement as n}from"../../internal/animate.js";import{cx as i}from"../../internal/styles.js";export const PlAnimateSlide=/* @__PURE__ */e.forwardRef(function PlAnimateSlide({duration:e=360,delay:s=0,easing:o,repeat:l=1,alternate:d,paused:m,trigger:c="mount",play:p,once:f=!0,threshold:
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,slideOffsets as a,useAnimateElement as n}from"../../internal/animate.js";import{cx as i}from"../../internal/styles.js";export const PlAnimateSlide=/* @__PURE__ */e.forwardRef(function PlAnimateSlide({duration:e=360,delay:s=0,easing:o,repeat:l=1,alternate:d,paused:m,trigger:c="mount",play:p,once:f=!0,threshold:g=.2,timeline:u,range:y,stagger:h=0,durationStep:S=0,reverse:x=!1,mode:N="in",from:b="bottom",distance:j="100%",fade:v=!0,render:A,className:P,style:w,children:R,...k},q){const{x:z,y:B}=a(b,j),C=n({effect:"slide",duration:e,delay:s,easing:o,repeat:l,alternate:d,mode:N,x:z,y:B,opacity:v?0:1,trigger:c,play:p,once:f,threshold:g,paused:m,infinite:t(l),timeline:u,range:y,stagger:h,durationStep:S,reverse:x,children:R});return r({render:A,ref:[q,C.ref],props:{...k,className:i(C.className,P),style:{...C.style,...w},...C.props,children:C.children}})});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassAnimateMode, PlassAnimateProps, PlassAnimateStaggerProps, PlassAnimateTimelineProps, PlassAnimation } from '../../types.js';
|
|
4
|
+
/** What the line is cut into before the effect is told off across it. */
|
|
5
|
+
export type PlAnimateSplitBy = 'word' | 'character';
|
|
6
|
+
export interface PlAnimateSplitProps extends PlassAnimateProps, PlassAnimateStaggerProps, PlassAnimateTimelineProps, Omit<React.ComponentPropsWithoutRef<'span'>, 'children'> {
|
|
7
|
+
/**
|
|
8
|
+
* The line. A string, and it has to be: the component cuts it up, and there
|
|
9
|
+
* is nothing to cut inside a `<strong>`.
|
|
10
|
+
*/
|
|
11
|
+
children: string;
|
|
12
|
+
/**
|
|
13
|
+
* What it is cut into.
|
|
14
|
+
*
|
|
15
|
+
* `word` by default, and it is the safe one. See the note on the page about
|
|
16
|
+
* `character` and the scripts it must not be used on.
|
|
17
|
+
* @default 'word'
|
|
18
|
+
*/
|
|
19
|
+
by?: PlAnimateSplitBy;
|
|
20
|
+
/**
|
|
21
|
+
* Which of the entrances each part plays.
|
|
22
|
+
* @default 'fade'
|
|
23
|
+
*/
|
|
24
|
+
effect?: PlassAnimation;
|
|
25
|
+
/**
|
|
26
|
+
* `in` plays the entrance; `out` is the same run backwards, held at the end.
|
|
27
|
+
* @default 'in'
|
|
28
|
+
*/
|
|
29
|
+
mode?: PlassAnimateMode;
|
|
30
|
+
/** Renders something other than a `<span>`. Base UI's own escape hatch. */
|
|
31
|
+
render?: useRender.RenderProp;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A line of text arriving one part at a time.
|
|
35
|
+
*
|
|
36
|
+
* The other five effects tell themselves off across their **children**, which a
|
|
37
|
+
* line of text does not have. This one makes them: it cuts the string into
|
|
38
|
+
* words or characters, wraps each in a span, and hands the set to exactly the
|
|
39
|
+
* same `stagger` machinery a `PlAnimateFade` around a list of `<li>`s uses. So
|
|
40
|
+
* `effect`, `stagger`, `durationStep` and `reverse` all mean what they mean
|
|
41
|
+
* everywhere else — this component is the splitting and nothing more.
|
|
42
|
+
*
|
|
43
|
+
* **`by="character"` is not safe in every script**, and that is the one thing
|
|
44
|
+
* to know before reaching for it. A character span breaks the shaping between
|
|
45
|
+
* letters, so Arabic stops joining, Devanagari conjuncts come apart, and an
|
|
46
|
+
* emoji built out of several code points is cut into its pieces. `word` has
|
|
47
|
+
* none of those problems, is the default, and is what a headline wants anyway.
|
|
48
|
+
*
|
|
49
|
+
* **A screen reader is told the line, once.** The parts are hidden from the
|
|
50
|
+
* accessibility tree and the whole line sits beside them in a clipped span,
|
|
51
|
+
* which is what stops a split headline being read out one letter at a time —
|
|
52
|
+
* the defect this pattern is known for.
|
|
53
|
+
*/
|
|
54
|
+
export declare const PlAnimateSplit: React.ForwardRefExoticComponent<PlAnimateSplitProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,Fragment as r,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{useRender as n}from"@base-ui/react/use-render";import{animBaseClass as i,animationClasses as s,animationSlots as l,isInfinite as o,staggerSlots as m,useAnimationRun as d}from"../../internal/animate.js";import{cx as p,srOnlyClasses as c}from"../../internal/styles.js";export const PlAnimateSplit=/* @__PURE__ */a.forwardRef(function PlAnimateSplit({children:f,by:u="word",effect:h="fade",mode:g="in",duration:y=400,delay:j=0,easing:x,repeat:w=1,alternate:N,paused:S,trigger:b="mount",play:v,once:A=!0,threshold:$=.2,timeline:F,range:P,stagger:k=40,durationStep:M=0,reverse:O=!1,render:R,className:q,style:z,...B},C){const D=a.useMemo(()=>function partsOf(e,r){return"character"===r?Array.from(e):e.split(/(\s+)/).filter(e=>""!==e)}(f,u),[f,u]),E=d({trigger:"view"===F?"mount":b,play:v,once:A,threshold:$,paused:S,infinite:o(w)}),G={duration:y,delay:j,easing:x,repeat:w,alternate:N,mode:g,timeline:F,range:P},H=D.filter(e=>""!==e.trim()).length,I=`${i} ${s[h]}`;let J=-1;return n({render:R??e("span",{}),ref:[C,E.ref],props:{...B,className:p(q),style:z,...E.handlers,"data-plass-animation":h,"data-state":E.state,children:t(r,{children:[e("span",{className:c,children:f}),e("span",{"aria-hidden":"true",children:D.map((r,t)=>""===r.trim()?e(a.Fragment,{children:r},t):(J+=1,e("span",{className:`${I} inline-block whitespace-pre`,style:{...l(m(G,{index:J,count:H,stagger:k,durationStep:M,reverse:O})),"--p-anim-state":E.state},children:r},t)))})]})}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlAnimateSplit}from"./PlAnimateSplit.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{isInfinite as n,useAnimationRun as a
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{isInfinite as n,useAnimationRun as a}from"../../internal/animate.js";import{usePrefersReducedMotion as i}from"../../internal/media.js";import{srOnlyClasses as s}from"../../internal/styles.js";function textOf(e){return"string"==typeof e||"number"==typeof e?String(e):Array.isArray(e)?e.map(textOf).join(""):""}export const PlAnimateTyping=/* @__PURE__ */r.forwardRef(function PlAnimateTyping({text:o,speed:u=24,hold:m=1400,erase:l=!1,eraseSpeed:c,caret:f=!0,caretChar:p="|",duration:d,delay:h=0,repeat:g=1,paused:y,trigger:x="mount",play:T,once:j=!0,threshold:v=.2,className:N,style:S,children:w,...A},M){const O=a({trigger:x,play:T,once:j,threshold:v,paused:y,infinite:n(g)}),I=i(),E=o??textOf(w),P=r.useMemo(()=>function graphemesOf(e,t){return"undefined"!=typeof Intl&&"Segmenter"in Intl?[...new Intl.Segmenter(t,{granularity:"grapheme"}).segment(e)].map(e=>e.segment):[...e]}(E),[E]),R=P.length,[b,C]=r.useState(0),k=r.useRef(0),q=d&&R>0?d/R:1e3/Math.max(u,1),z=1e3/Math.max(c??2*u,1);return r.useEffect(()=>{k.current=0},[R]),r.useEffect(()=>{if(I||0===R)return void C(R);if(!O.started)return k.current=0,void C(0);if(y)return;let e,t=!1,r=k.current,n=1,a=!1;const i="infinite"===g?1/0:Math.max(1,g);if(r>=R&&1===i)return;const step=()=>{if(!t){if(a)return r-=1,k.current=r,C(r),r<=0&&(a=!1,n+=1),void(e=setTimeout(step,a?z:q));if(r+=1,k.current=r,C(r),r<R)e=setTimeout(step,q);else if(!(n>=i)){if(l)return a=!0,void(e=setTimeout(step,m));n+=1,e=setTimeout(()=>{t||(r=0,k.current=0,C(0),e=setTimeout(step,q))},m)}}};return C(r),e=setTimeout(step,0===r?h:q),()=>{t=!0,clearTimeout(e)}},[O.started,y,I,R,q,z,h,m,l,g]),t("div",{ref:e=>{O.ref(e),"function"==typeof M?M(e):M&&(M.current=e)},className:N,style:S,"data-plass-animation":"typing","data-state":O.state,...O.handlers,...A,children:[e("span",{className:s,children:E}),t("span",{"aria-hidden":"true",className:"whitespace-pre-wrap",children:[P.slice(0,b).join(""),f?e("span",{className:"plass-caret",children:p}):null]})]})});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { PlassAnimateMode, PlassAnimateProps } from '../../types.js';
|
|
4
|
-
export interface PlAnimateZoomProps extends PlassAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { PlassAnimateMode, PlassAnimateProps, PlassAnimateStaggerProps, PlassAnimateTimelineProps } from '../../types.js';
|
|
4
|
+
export interface PlAnimateZoomProps extends PlassAnimateProps, PlassAnimateStaggerProps, PlassAnimateTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether the content comes forward or falls away.
|
|
7
7
|
* @default 'in'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";import{cx as n}from"../../internal/styles.js";export const PlAnimateZoom=/* @__PURE__ */e.forwardRef(function PlAnimateZoom({duration:e=320,delay:
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";import{cx as n}from"../../internal/styles.js";export const PlAnimateZoom=/* @__PURE__ */e.forwardRef(function PlAnimateZoom({duration:e=320,delay:i=0,easing:o,repeat:s=1,alternate:l,paused:m,trigger:d="mount",play:c,once:p=!0,threshold:f=.2,timeline:g,range:u,stagger:y=0,durationStep:h=0,reverse:N=!1,mode:j="in",from:v=.4,fade:A=!0,render:P,className:S,style:Z,children:b,...w},x){const z=a({effect:"zoom",duration:e,delay:i,easing:o,repeat:s,alternate:l,mode:j,scale:v,opacity:A?0:1,trigger:d,play:c,once:p,threshold:f,paused:m,infinite:t(s),timeline:g,range:u,origin:"center",stagger:y,durationStep:h,reverse:N,children:b});return r({render:P,ref:[x,z.ref],props:{...w,className:n(z.className,S),style:{...z.style,...Z},...z.props,children:z.children}})});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassColor, PlassSize, PlassVariant } from '../../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* How the artwork is framed, which is the one question this component exists to
|
|
6
|
+
* answer.
|
|
7
|
+
*
|
|
8
|
+
* - `bare` — drawn as it was given, at the height `size` asks for and whatever
|
|
9
|
+
* width that comes to. No plate, no crop, no padding. The default, and the
|
|
10
|
+
* only one that is correct for a mark drawn with its own background, its own
|
|
11
|
+
* margin, or the product's name set into it.
|
|
12
|
+
* - `plate` — an app icon: a tile with the artwork inset in it and the corners
|
|
13
|
+
* cut to the house radius. What a mark drawn as a bare glyph needs before it
|
|
14
|
+
* can sit next to anything else.
|
|
15
|
+
* - `circle` — the same tile, round. For the products whose icon is a disc.
|
|
16
|
+
*/
|
|
17
|
+
export type PlAppLogoShape = 'bare' | 'plate' | 'circle';
|
|
18
|
+
export interface PlAppLogoProps extends Omit<React.ComponentPropsWithoutRef<'span'>, 'color'> {
|
|
19
|
+
/**
|
|
20
|
+
* The mark. An `<img>`, an inline `<svg>`, a `PlIcon` — whatever the product's
|
|
21
|
+
* artwork actually is.
|
|
22
|
+
*/
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
/** A picture to draw as the mark, instead of `children`. */
|
|
25
|
+
src?: string;
|
|
26
|
+
/**
|
|
27
|
+
* What the picture says, for a reader who cannot see it.
|
|
28
|
+
*
|
|
29
|
+
* Leave it empty when `name` is set: the wordmark beside the mark already
|
|
30
|
+
* says the product's name, and a picture that repeats it is a screen reader
|
|
31
|
+
* saying it twice.
|
|
32
|
+
*/
|
|
33
|
+
alt?: string;
|
|
34
|
+
/** The product's name, set beside the mark. */
|
|
35
|
+
name?: React.ReactNode;
|
|
36
|
+
/** A line under the name — an environment, a tenant, a plan. */
|
|
37
|
+
description?: React.ReactNode;
|
|
38
|
+
/** How the artwork is framed. @default 'bare' */
|
|
39
|
+
shape?: PlAppLogoShape;
|
|
40
|
+
/**
|
|
41
|
+
* What the plate is made of. Only read when `shape` is not `bare`.
|
|
42
|
+
* @default 'solid'
|
|
43
|
+
*/
|
|
44
|
+
variant?: PlassVariant;
|
|
45
|
+
/** The height of the mark, and the type scale of the name beside it. @default 'md' */
|
|
46
|
+
size?: PlassSize;
|
|
47
|
+
/** The family the plate takes. @default 'primary' */
|
|
48
|
+
color?: PlassColor;
|
|
49
|
+
/**
|
|
50
|
+
* Renders something other than a `<span>`. A logo is nearly always the way
|
|
51
|
+
* back to the front page, so `render={<a href="/" />}` is the ordinary case.
|
|
52
|
+
*/
|
|
53
|
+
render?: useRender.RenderProp;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A product's mark, and its name beside it.
|
|
57
|
+
*
|
|
58
|
+
* The whole component is the **framing**, which is the one thing a logo needs
|
|
59
|
+
* and the one thing every project gets wrong twice: `bare` is the default
|
|
60
|
+
* because a mark drawn with its own background, its own margin, or the
|
|
61
|
+
* product's name set into it must not be put on a plate or cropped to a circle.
|
|
62
|
+
* `plate` and `circle` are for a mark drawn as a bare glyph, which cannot sit
|
|
63
|
+
* next to anything else until it has been given an edge.
|
|
64
|
+
*
|
|
65
|
+
* It is not a [PlAvatar](./avatar). An avatar is a picture of a person or a
|
|
66
|
+
* thing and is always a circle or a fillet, with initials behind it when the
|
|
67
|
+
* picture fails; a logo is artwork the product owns, it has no fallback worth
|
|
68
|
+
* inventing, and its shape is a decision somebody already made.
|
|
69
|
+
*
|
|
70
|
+
* **With a `name`, the mark is decorative.** The wordmark beside it already
|
|
71
|
+
* says what the product is called, and a picture that says it again is a screen
|
|
72
|
+
* reader reading the name twice. That is why `alt` is a prop rather than
|
|
73
|
+
* something derived from `name`.
|
|
74
|
+
*
|
|
75
|
+
* A logo is nearly always the way back to the front page. `render={<a href="/"
|
|
76
|
+
* />}` makes it one without changing anything about how it is drawn.
|
|
77
|
+
*/
|
|
78
|
+
export declare const PlAppLogo: React.ForwardRefExoticComponent<PlAppLogoProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as s,Fragment as l}from"react/jsx-runtime";import*as a from"react";import{useRender as t}from"@base-ui/react/use-render";import{useDefaults as r}from"../../internal/defaults.js";import{controlSlots as n,cx as i,glassClasses as o,hasContent as c,metaTextClasses as m,radiusClasses as d}from"../../internal/styles.js";const p={xs:"h-5",sm:"h-6",md:"h-8",lg:"h-10",xl:"h-12"},x={xs:"size-5",sm:"size-6",md:"size-8",lg:"size-10",xl:"size-12"},g={xs:"text-sm",sm:"text-base",md:"text-lg",lg:"text-xl",xl:"text-2xl"},f={xs:"gap-1.5",sm:"gap-2",md:"gap-2.5",lg:"gap-3",xl:"gap-3.5"},u={solid:"[background-image:var(--p-fill)] text-(--p-on-solid) [box-shadow:var(--p-lift)]",glass:`${o} bg-(--plass-glass) text-(--p-accent) border [border-color:var(--plass-glass-line)]`,ghost:"bg-(--p-soft) text-(--p-accent)"};export const PlAppLogo=/* @__PURE__ */a.forwardRef(function PlAppLogo({children:a,src:o,alt:h="",name:b,description:v,shape:z="bare",variant:j="solid",size:N,color:w,render:y,className:k,style:A,...L},P){const _=r(),F=N??_.size??"md",R=w??_.color??"primary",$="bare"!==z,q=c(b)||c(v),B=o?e("img",{src:o,alt:h,className:$?"size-[70%] object-contain":"h-full w-auto"}):a;return t({render:y,ref:P,props:{className:i("inline-flex items-center text-(--plass-fg) [&_svg]:h-full [&_svg]:w-auto",f[F],k),style:{...n(R,1,j),...A},children:s(l,{children:[e("span",{"aria-hidden":!!c(b)||void 0,className:i("flex shrink-0 items-center justify-center overflow-hidden",$?x[F]:p[F],$?u[j]:"","circle"===z?"rounded-full":$?d[F]:""),children:B}),q?s("span",{className:"flex min-w-0 flex-col",children:[c(b)?e("span",{className:i("truncate font-semibold",g[F]),children:b}):null,c(v)?e("span",{className:i("truncate text-(--plass-muted-fg)",m[F]),children:v}):null]}):null]}),...L}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlAppLogo}from"./PlAppLogo.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type CartesianChartProps } from '../../internal/chart-frame.js';
|
|
3
|
+
import { type ChartMarkers } from '../../internal/chart-line.js';
|
|
4
|
+
import type { PlassChartCurve, PlassChartValueLabels } from '../../types.js';
|
|
5
|
+
export interface PlAreaChartProps extends CartesianChartProps {
|
|
6
|
+
/**
|
|
7
|
+
* How the edge of the band gets from one point to the next. The same three
|
|
8
|
+
* shapes a [PlLineChart](./line-chart) offers, and they mean the same things.
|
|
9
|
+
* @default 'linear'
|
|
10
|
+
*/
|
|
11
|
+
curve?: PlassChartCurve;
|
|
12
|
+
/**
|
|
13
|
+
* Stacks the bands, each one riding on the total of those below it.
|
|
14
|
+
*
|
|
15
|
+
* - `true` — absolute totals. The top edge is the sum, which is the thing a
|
|
16
|
+
* stacked area is usually drawn to show.
|
|
17
|
+
* - `'full'` — every category normalised to 100%, so the chart is about
|
|
18
|
+
* *share* and stops being about size. The value axis becomes a percentage
|
|
19
|
+
* and says so.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
stacked?: boolean | 'full';
|
|
23
|
+
/**
|
|
24
|
+
* Dots on the points. `none` by default rather than `auto`: a filled band
|
|
25
|
+
* already has a visible edge, and a row of dots on it is ink that says
|
|
26
|
+
* nothing the fill did not.
|
|
27
|
+
* @default 'none'
|
|
28
|
+
*/
|
|
29
|
+
markers?: ChartMarkers;
|
|
30
|
+
/** @default 'none' */
|
|
31
|
+
valueLabels?: PlassChartValueLabels;
|
|
32
|
+
/**
|
|
33
|
+
* Draws the band straight through a `null` instead of breaking at it. Off,
|
|
34
|
+
* and on an area it matters more than on a line: a fill that closes across a
|
|
35
|
+
* missing month paints a made-up number over a larger part of the chart.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
connectNulls?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A line with the space under it filled — which changes what the chart is
|
|
42
|
+
* about.
|
|
43
|
+
*
|
|
44
|
+
* A line says where a value went. An area says how much of something there was,
|
|
45
|
+
* and stacked it says how that amount was made up. That is the whole test for
|
|
46
|
+
* reaching for this instead of a [PlLineChart](./line-chart): if the quantity
|
|
47
|
+
* does not add up to anything — a temperature, a rate, a score — the fill under
|
|
48
|
+
* it is decoration, and a chart with two of them is two washes fighting.
|
|
49
|
+
*
|
|
50
|
+
* Unstacked bands are a wash at about a quarter opacity, fading out downward,
|
|
51
|
+
* so two of them overlapping stay readable. Stacked bands are opaquer, because
|
|
52
|
+
* there the fill *is* the mark rather than a hint at the line above it.
|
|
53
|
+
*/
|
|
54
|
+
export declare function PlAreaChart({ curve, stacked, markers, valueLabels, connectNulls, series, yAxis, format, ...props }: PlAreaChartProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{CartesianChart as a}from"../../internal/chart-frame.js";import{LineSeries as t}from"../../internal/chart-line.js";import{toValues as n}from"../../internal/chart.js";export function PlAreaChart({curve:l="linear",stacked:o=!1,markers:s="none",valueLabels:i="none",connectNulls:c=!1,series:u,yAxis:m,format:f,...d}){const x=r.useId().replace(/:/g,""),p="full"===o,h=r.useMemo(()=>{if(!p)return u;const e=n(u),r=[];for(const a of e)a.forEach((e,a)=>{r[a]=(r[a]??0)+Math.abs(e.value??0)});return u.map((a,t)=>({...a,data:e[t].map((e,a)=>{if(null===e.value)return null;const t=r[a];return{x:e.x,y:0===t?0:e.value/t*100,color:e.color,label:e.label??String(e.value)}})}))},[u,p]);return e(a,{...d,series:h,format:f,yAxis:p?{min:0,max:100,tickFormat:e=>`${e}%`,...m}:m,stacked:!1!==o,inset:!0,includeZero:!0,headroom:"none"===i?0:10,children:r=>e(t,{context:r,curve:l,filled:!0,stacked:!1!==o,markers:s,valueLabels:i,connectNulls:c,gradient:!1,idPrefix:x})})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlAreaChart}from"./PlAreaChart.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{
|
|
1
|
+
"use client";import*as e from"react";import{useDefaults as i}from"../../internal/defaults.js";import{useRender as o}from"@base-ui/react/use-render";import{cx as t,radiusClasses as c}from"../../internal/styles.js";const r=/* @__PURE__ */["[&>img]:size-full","[&>video]:size-full","[&>canvas]:size-full","[&>svg]:size-full","[&>iframe]:size-full","[&>picture]:size-full","[&>picture>img]:size-full"].join(" "),l={cover:"[&>img]:object-cover [&>video]:object-cover [&>picture>img]:object-cover",contain:"[&>img]:object-contain [&>video]:object-contain [&>picture>img]:object-contain",fill:"[&>img]:object-fill [&>video]:object-fill [&>picture>img]:object-fill",none:"[&>img]:object-none [&>video]:object-none [&>picture>img]:object-none"};export const PlAspectRatio=/* @__PURE__ */e.forwardRef(function PlAspectRatio({ratio:e=1,fit:n="cover",rounded:s=!1,size:a,render:f,className:m,style:u,children:d,...p},j){const b=i(),v=a??b.size??"md",g=t("relative block w-full overflow-hidden",r,l[n],s?c[v]:"",m);return o({render:f,ref:j,props:{className:g,style:{aspectRatio:e,...u},children:d,...p}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{useDefaults as t}from"../../internal/defaults.js";import{Avatar as s}from"@base-ui/react/avatar";import{controlHeightClasses as o,controlSlots as l,controlSquareClasses as n,glassClasses as i,hasContent as c,radiusClasses as d,srOnlyClasses as m,transitionClasses as p}from"../../internal/styles.js";const f={xs:"text-[0.5625rem]",sm:"text-[0.6875rem]",md:"text-[0.8125rem]",lg:"text-[1rem]",xl:"text-[1.1875rem]"},g={solid:/* @__PURE__ */["text-(--p-on-solid) [background-image:var(--p-fill)]","[box-shadow:var(--p-elev),var(--p-lift)]"].join(" "),glass:/* @__PURE__ */[i,"border text-(--p-accent) bg-(--plass-glass)","[border-color:var(--plass-border)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--p-accent) bg-(--p-soft-press) [box-shadow:var(--p-elev)]"},v=/* @__PURE__ */["relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden","align-middle leading-none font-semibold tracking-wide whitespace-nowrap","[&_svg]:pointer-events-none [&_svg]:size-[55%]",p].join(" ");function PersonIcon(){return r("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[e("path",{d:"M12 12a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9Z"}),e("path",{d:"M12 14.25c-4.28 0-7.75 2.42-7.75 5.4 0 .75.6 1.35 1.35 1.35h12.8c.75 0 1.35-.6 1.35-1.35 0-2.98-3.47-5.4-7.75-5.4Z"})]})}export const PlAvatar=/* @__PURE__ */a.forwardRef(function PlAvatar({src:a,srcSet:i,alt:p,name:h,initials:u,shape:x,variant:b,size:j,color:y,elevation:w,delay:N,imageProps:z,onLoadingStatusChange:A,className:C,style:P,children:k,...B},S){const I=t(),L=x??"circle",F=b??"ghost",M=j??I.size??"md",R=y??I.color??"primary",Z=w??0,_=h?function initialsOf(e){const r=e.normalize("NFC").trim().split(/\s+/).filter(Boolean);return 0===r.length?"":((Array.from(r[0])[0]??"")+(r.length>1?Array.from(r[r.length-1])[0]??"":"")).toLocaleUpperCase()}(h):"",O=p??h,U=c(k)?k:(u??_)||e(PersonIcon,{}),q=c(k)||Boolean(u??_),D=[v,o[M],n[M],f[M],"circle"===L?"rounded-full":d[M],g[F],C??""].filter(Boolean).join(" ");return r(s.Root,{ref:S,className:D,style:{...l(R,Z,F),...P},...B,children:[a?e(s.Image,{src:a,srcSet:i,alt:O??"",className:"size-full object-cover",onLoadingStatusChange:A,...z}):null,r(s.Fallback,{delay:a?N:void 0,className:"flex size-full items-center justify-center",children:[O&&q?e("span",{className:m,children:O}):null,e("span",{"aria-hidden":!(!O||!q)||void 0,className:"contents",children:U})]})]})});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassColor, PlassElevation, PlassSize, PlassVariant } from '../../types.js';
|
|
3
|
+
/** What is scrolled, and what is watched. */
|
|
4
|
+
export type PlBackTopTarget = Window | HTMLElement | React.RefObject<HTMLElement | null> | (() => Window | HTMLElement | null);
|
|
5
|
+
export interface PlBackTopProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'color'> {
|
|
6
|
+
/**
|
|
7
|
+
* What is scrolled. The window by default; a ref or an element for a panel
|
|
8
|
+
* that scrolls inside the page.
|
|
9
|
+
*/
|
|
10
|
+
target?: PlBackTopTarget;
|
|
11
|
+
/**
|
|
12
|
+
* How far down the reader has to be before it appears, in pixels.
|
|
13
|
+
*
|
|
14
|
+
* 400 is roughly one screen on a laptop, which is the point at which "go
|
|
15
|
+
* back to the top" stops being a thing they could just do by scrolling.
|
|
16
|
+
* @default 400
|
|
17
|
+
*/
|
|
18
|
+
visibilityHeight?: number;
|
|
19
|
+
/** What it does, in words, and its accessible name. @default 'Back to top' */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** The glyph. An upward chevron by default. */
|
|
22
|
+
icon?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Whether it pins itself to the bottom corner of the window.
|
|
25
|
+
*
|
|
26
|
+
* On by default, because that is what this component is. Turn it off to put
|
|
27
|
+
* the button somewhere of your own — the end of an article, a toolbar — and
|
|
28
|
+
* keep the appearing and the scrolling.
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
floating?: boolean;
|
|
32
|
+
/** @default 'glass' */
|
|
33
|
+
variant?: PlassVariant;
|
|
34
|
+
/** @default 'md' */
|
|
35
|
+
size?: PlassSize;
|
|
36
|
+
/** @default 'primary' */
|
|
37
|
+
color?: PlassColor;
|
|
38
|
+
/** @default 2 */
|
|
39
|
+
elevation?: PlassElevation;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The way back up, once there is a way back up to want.
|
|
43
|
+
*
|
|
44
|
+
* It is **hidden until it is useful** and that is the whole design: a button
|
|
45
|
+
* pinned to the corner of every page from the first paint is one more thing
|
|
46
|
+
* covering the content, and on a page short enough not to scroll it is a
|
|
47
|
+
* control that does nothing. It appears when the reader is a screen or so down,
|
|
48
|
+
* which is the point at which scrolling back stops being something they would
|
|
49
|
+
* just do.
|
|
50
|
+
*
|
|
51
|
+
* The scroll is smooth, and **not** under `prefers-reduced-motion` — a page
|
|
52
|
+
* that flies past a reader who asked for less movement is the exact case that
|
|
53
|
+
* setting exists for. It jumps instead, which arrives at the same place.
|
|
54
|
+
*/
|
|
55
|
+
export declare const PlBackTop: React.ForwardRefExoticComponent<PlBackTopProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import*as e from"react";import{PlIconButton as r}from"../icon-button/PlIconButton.js";import{useDefaults as n}from"../../internal/defaults.js";import{useLabels as t}from"../../internal/labels.js";import{usePrefersReducedMotion as i}from"../../internal/media.js";import{cx as l,transitionClasses as s}from"../../internal/styles.js";function ChevronUp(){return o("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o("path",{d:"M4.5 9.5 8 6l3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function resolve(o){return void 0===o?"undefined"==typeof window?null:window:"function"==typeof o?o():"current"in o?o.current:o}export const PlBackTop=/* @__PURE__ */e.forwardRef(function PlBackTop({target:a,visibilityHeight:c=400,label:d,icon:f,floating:u=!0,variant:p="glass",size:m,color:v,elevation:h=2,className:b,onClick:k,...j},w){const y=n(),T=t(),x=d??T.backToTop,g=m??y.size??"md",C=v??y.color??"primary",z=i(),[B,L]=e.useState(!1);return e.useEffect(()=>{const o=resolve(a);if(!o)return;const read=()=>L(function scrollTopOf(o){return o instanceof Window?o.scrollY:o.scrollTop}(o)>c);return read(),o.addEventListener("scroll",read,{passive:!0}),()=>o.removeEventListener("scroll",read)},[a,c]),o(r,{ref:w,label:x,icon:f??o(ChevronUp,{}),variant:p,size:g,color:C,elevation:h,onClick:o=>{k?.(o),o.defaultPrevented||resolve(a)?.scrollTo({top:0,behavior:z?"auto":"smooth"})},"aria-hidden":!B||void 0,tabIndex:B?void 0:-1,className:l(u?"fixed end-6 bottom-6 z-30":"",s,B?"opacity-100":"pointer-events-none opacity-0",b),...j})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlBackTop}from"./PlBackTop.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as t,jsxs as s}from"react/jsx-runtime";import*as m from"react";import{controlSlots as
|
|
1
|
+
"use client";import{jsx as e,Fragment as t,jsxs as s}from"react/jsx-runtime";import*as m from"react";import{useDefaults as o}from"../../internal/defaults.js";import{controlSlots as a,glassClasses as l,hasContent as n,srOnlyClasses as r,transitionClasses as i}from"../../internal/styles.js";const d={xs:"h-3.5 min-w-3.5",sm:"h-4 min-w-4",md:"h-4.5 min-w-4.5",lg:"h-5 min-w-5",xl:"h-6 min-w-6"},p={xs:"size-1.5",sm:"size-2",md:"size-2.5",lg:"size-2.5",xl:"size-3"},b={xs:"text-[0.5625rem]",sm:"text-[0.625rem]",md:"text-[0.6875rem]",lg:"text-[0.75rem]",xl:"text-[0.8125rem]"},x={default:{xs:"px-1",sm:"px-1",md:"px-1.5",lg:"px-1.5",xl:"px-2"},compact:{xs:"px-0.5",sm:"px-0.5",md:"px-1",lg:"px-1",xl:"px-1.5"}},c="rounded-full",g={xs:{badge:"-mt-1.5 -mb-1.5 -ms-1.5 -me-1.5",dot:"-mt-0.5 -mb-0.5 -ms-0.5 -me-0.5"},sm:{badge:"-mt-2 -mb-2 -ms-2 -me-2",dot:"-mt-1 -mb-1 -ms-1 -me-1"},md:{badge:"-mt-2 -mb-2 -ms-2 -me-2",dot:"-mt-1 -mb-1 -ms-1 -me-1"},lg:{badge:"-mt-2.5 -mb-2.5 -ms-2.5 -me-2.5",dot:"-mt-1 -mb-1 -ms-1 -me-1"},xl:{badge:"-mt-3 -mb-3 -ms-3 -me-3",dot:"-mt-1.5 -mb-1.5 -ms-1.5 -me-1.5"}},f={"top-start":"top-0 start-0","top-end":"top-0 end-0","bottom-start":"bottom-0 start-0","bottom-end":"bottom-0 end-0"},u={"top-start":"mt-[7%] ms-[7%]","top-end":"mt-[7%] me-[7%]","bottom-start":"mb-[7%] ms-[7%]","bottom-end":"mb-[7%] me-[7%]"},h={solid:/* @__PURE__ */["text-(--p-on-solid) [background-image:var(--p-fill)]","[box-shadow:var(--p-elev),var(--p-lift)]"].join(" "),glass:/* @__PURE__ */[l,"border text-(--p-accent) bg-(--plass-glass)","[border-color:var(--plass-border)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--p-accent) bg-(--p-soft-press)"};export const PlBadge=/* @__PURE__ */m.forwardRef(function PlBadge({variant:m="solid",size:l,color:v,density:w,elevation:j=0,content:y,max:z=99,dot:N=!1,showZero:k=!1,invisible:B=!1,placement:P="top-end",overlap:$="square",label:q,className:C,style:F,children:R,...Z},A){const D=o(),E=l??D.size??"md",G=v??D.color??"primary",H=w??D.density??"default",I=n(R),J=!n(y)||0===y&&!k,K=N||J,L=B||J&&!N,M=["pointer-events-none z-10 inline-flex shrink-0 items-center justify-center","font-semibold tabular-nums whitespace-nowrap",c,i,h[m],K?p[E]:[d[E],b[E],x[H][E]].join(" "),I?`absolute ${f[P]}`:"relative align-middle",I?K?g[E].dot:g[E].badge:"",I&&"circle"===$?u[P]:"",L?"invisible":"",C??""].filter(Boolean).join(" "),O=function capContent(e,t){return"number"==typeof e&&e>t?`${t}+`:e}(y,z),Q=e("span",{ref:A,className:M,style:{...a(G,j,m),...F},"aria-hidden":!!L||void 0,...Z,children:L?null:s(t,{children:[K||q?e("span",{className:r,children:q??O}):null,K?null:e("span",{"aria-hidden":!!q||void 0,children:O})]})});return I?s("span",{className:"relative inline-flex shrink-0 align-middle",children:[R,Q]}):Q});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type CartesianChartProps } from '../../internal/chart-frame.js';
|
|
3
|
+
import type { PlassChartValueLabels, PlassOrientation } from '../../types.js';
|
|
4
|
+
export interface PlBarChartProps extends CartesianChartProps {
|
|
5
|
+
/**
|
|
6
|
+
* Which way the bars run.
|
|
7
|
+
*
|
|
8
|
+
* `vertical` — the default — grows them up from the bottom, which is what
|
|
9
|
+
* most people mean by a bar chart. `horizontal` grows them out from the left,
|
|
10
|
+
* and it is the right answer whenever the category names are words: a
|
|
11
|
+
* horizontal chart has a whole column for them, and a vertical one has the
|
|
12
|
+
* width of one bar.
|
|
13
|
+
* @default 'vertical'
|
|
14
|
+
*/
|
|
15
|
+
orientation?: PlassOrientation;
|
|
16
|
+
/**
|
|
17
|
+
* Puts the series on top of each other instead of beside each other.
|
|
18
|
+
*
|
|
19
|
+
* - `false` — grouped. Comparing series within a category.
|
|
20
|
+
* - `true` — stacked. The bar's whole length is the total, and the segments
|
|
21
|
+
* are what it is made of.
|
|
22
|
+
* - `'full'` — every bar the same length, so the chart is about share rather
|
|
23
|
+
* than size. The value axis becomes a percentage.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
stacked?: boolean | 'full';
|
|
27
|
+
/**
|
|
28
|
+
* Cuts the corners off the data end of each bar. The baseline end stays
|
|
29
|
+
* square — that is where the value starts from, and a rounded foot makes the
|
|
30
|
+
* axis look scalloped.
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
rounded?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* How thick a bar may get, in pixels. Below the cap the bars fill their share
|
|
36
|
+
* of the band; above it the leftover stays as air.
|
|
37
|
+
* @default the `size` ladder — 24 at `md`
|
|
38
|
+
*/
|
|
39
|
+
barSize?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Which values are written on the bars.
|
|
42
|
+
*
|
|
43
|
+
* `all` is defensible here in a way it is not on a line chart: eight bars
|
|
44
|
+
* with their numbers on them is a chart and a table at once. Past about a
|
|
45
|
+
* dozen it stops being either.
|
|
46
|
+
* @default 'none'
|
|
47
|
+
*/
|
|
48
|
+
valueLabels?: PlassChartValueLabels;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Lengths, compared.
|
|
52
|
+
*
|
|
53
|
+
* A bar says *how much*, and it says it by being longer — which is the whole
|
|
54
|
+
* reason its axis starts at zero and cannot be talked out of it. Crop the scale
|
|
55
|
+
* and a bar twice as long stops meaning twice as much, and the reader has no
|
|
56
|
+
* way to know it happened. Reach for a [PlLineChart](./line-chart) when what
|
|
57
|
+
* matters is the shape of a change rather than the size of each value.
|
|
58
|
+
*
|
|
59
|
+
* Grouped bars answer "which series is bigger here"; stacked bars answer "what
|
|
60
|
+
* is this total made of". They are different questions and the chart should be
|
|
61
|
+
* asked only one of them at a time.
|
|
62
|
+
*/
|
|
63
|
+
export declare function PlBarChart({ orientation, stacked, rounded, barSize, valueLabels, series, yAxis, size: sizeProp, density: densityProp, ...props }: PlBarChartProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{CartesianChart as l,markTransitionClasses as n}from"../../internal/chart-frame.js";import{barBandRatio as r,barMaxThickness as o,barPath as i,barRadius as s,chartFontSizes as u,markGap as c,toValues as d}from"../../internal/chart.js";import{useDefaults as m}from"../../internal/defaults.js";export function PlBarChart({orientation:t="vertical",stacked:n=!1,rounded:i=!0,barSize:s,valueLabels:u="none",series:c,yAxis:h,size:f,density:v,...x}){const p=m(),b=f??p.size??"md",y=v??p.density??"default",z="horizontal"===t,g="full"===n,M=a.useMemo(()=>{if(!g)return c;const e=d(c),t=[];for(const a of e)a.forEach((e,a)=>{t[a]=(t[a]??0)+Math.abs(e.value??0)});return c.map((a,l)=>({...a,data:e[l].map((e,a)=>{if(null===e.value)return null;const l=t[a];return{x:e.x,y:0===l?0:e.value/l*100,color:e.color,label:e.label??String(e.value)}})}))},[c,g]);return e(l,{...x,series:M,size:b,density:y,horizontal:z,stacked:!1!==n,yAxis:g?{min:0,max:100,tickFormat:e=>`${e}%`,...h}:h,includeZero:!0,bandRatio:r[y],headroom:"none"===u?0:12,children:t=>e(Bars,{context:t,stacked:!1!==n,rounded:i,barSize:s??o[b],valueLabels:u,size:b})})}function Bars({context:a,stacked:l,rounded:r,barSize:o,valueLabels:d,size:m}){const{values:h,visible:f,colors:v,hovered:x,activeIndex:p,plot:b,band:y,horizontal:z,valuePx:g,categoryPx:M,zeroPx:k,format:j}=a,S=h.map((e,t)=>({one:e,index:t})).filter(e=>f[e.index]),B=l?1:Math.max(1,S.length),P=Math.min(o,Math.max(1,(y.band-c*(B-1))/B)),A=P*B+c*(B-1),E=[],L=[],N=u[m];return t("g",{children:[S.map(({one:a,index:o},u)=>{const m=v[o];return e("g",{opacity:null!==x&&x!==o?.28:1,className:n,children:a.map((o,h)=>{if(null===o.value)return null;const f=M(h),v=l?0:u*(P+c)-A/2+P/2,x=l?o.value>=0?E[h]??0:L[h]??0:0,y=g(x),k=g(x+o.value);l&&(o.value>=0?E[h]=x+o.value:L[h]=x+o.value);const S=l&&0!==x?c:0,B=Math.abs(k-y)-S;if(B<=0)return null;const W=k<y,w=h===p,C=z?i(Math.min(y,k)+(W?0:S),b.top+f+v-P/2,B,P,r&&!l?s:r?s/2:0,o.value>=0?"right":"left"):i(b.left+f+v-P/2,Math.min(y,k)+(W?0:S),P,B,r&&!l?s:r?s/2:0,o.value>=0?"up":"down");return t("g",{children:[e("path",{d:C,fill:o.color??m,opacity:w?1:.92,className:n}),"none"===d||"extremes"===d&&!isExtreme(a,h)||"last"===d&&h!==a.length-1?null:e("text",{x:z?k+(o.value>=0?5:-5):b.left+f+v,y:z?b.top+f+v:o.value>=0?k-5:k+N+2,textAnchor:z?o.value>=0?"start":"end":"middle",dominantBaseline:z?"central":void 0,fontSize:N,fontWeight:500,fill:"var(--plass-fg)",className:"tabular-nums",children:o.label??j(o.value)})]},h)})},o)}),e("line",z?{x1:k,x2:k,y1:b.top,y2:b.top+b.height,stroke:"var(--plass-chart-baseline)",strokeWidth:1}:{x1:b.left,x2:b.left+b.width,y1:k,y2:k,stroke:"var(--plass-chart-baseline)",strokeWidth:1})]})}function isExtreme(e,t){const a=e[t].value;if(null===a)return!1;let l=1/0,n=-1/0;for(const t of e)null!==t.value&&(l=Math.min(l,t.value),n=Math.max(n,t.value));return a===l||a===n}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlBarChart}from"./PlBarChart.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as r from"react";import{glassClasses as
|
|
1
|
+
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as r from"react";import{useDefaults as l}from"../../internal/defaults.js";import{glassClasses as t,hasContent as a,metaTextClasses as o,radiusClasses as n,sheetPaddingXClasses as i,sheetPaddingYClasses as c,surfaceSlots as d,transitionClasses as m}from"../../internal/styles.js";const p={xs:"text-[0.75rem]/[1.25rem]",sm:"text-[0.8125rem]/[1.375rem]",md:"text-[0.9375rem]/[1.625rem]",lg:"text-[1.0625rem]/[1.875rem]",xl:"text-[1.25rem]/[2.125rem]"},f="border-s-2 [border-inline-start-color:var(--p-accent)]",u={solid:/* @__PURE__ */[t,"bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),glass:/* @__PURE__ */[t,"border border-s-2 bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"bg-transparent"};function QuoteMarkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"M6.4 3.6c-2.3.9-3.7 2.8-3.7 5.1 0 2 1.2 3.3 2.8 3.3 1.4 0 2.5-1 2.5-2.4 0-1.3-.9-2.2-2.1-2.2-.2 0-.4 0-.6.1.3-1 1.1-1.8 2.2-2.3l-1.1-1.6ZM13.3 3.6c-2.3.9-3.7 2.8-3.7 5.1 0 2 1.2 3.3 2.8 3.3 1.4 0 2.5-1 2.5-2.4 0-1.3-.9-2.2-2.1-2.2-.2 0-.4 0-.6.1.3-1 1.1-1.8 2.2-2.3l-1.1-1.6Z",fill:"currentColor"})})}export const PlBlockquote=/* @__PURE__ */r.forwardRef(function PlBlockquote({variant:r="ghost",size:t,color:g,density:x,elevation:h=0,author:v,source:b,cite:j,icon:N,className:y,style:k,children:w,...z},B){const M=l(),q=t??M.size??"md",I=g??M.color??"primary",P=x??M.density??"default",Q=a(v)||a(b),Z=void 0===N?e(QuoteMarkIcon,{}):N,C=["flex flex-col text-(--plass-fg)",f,"ghost"===r?"":`${n[q]} rounded-s-none`,u[r],i[P][q],c[P][q],m,y??""].filter(Boolean).join(" "),R=s("blockquote",{cite:j,className:p[q],children:[a(Z)?e("span",{"aria-hidden":"true",className:"mb-1 block size-[2em] text-(--p-soft-press) [&>svg]:size-full",children:Z}):null,w]}),$={...d(I,h),...k};return Q?s("figure",{ref:B,className:C,style:$,...z,children:[R,s("figcaption",{className:["mt-2 flex flex-wrap items-baseline gap-x-1.5 text-(--plass-muted-fg)",o[q]].join(" "),children:[a(v)?s("span",{className:"font-medium text-(--plass-fg)",children:[e("span",{"aria-hidden":"true",children:"— "}),v]}):null,a(b)?e("cite",{className:"not-italic",children:b}):null]})]}):e("div",{ref:B,className:C,style:$,...z,children:R})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as a,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{
|
|
1
|
+
"use client";import{jsx as e,Fragment as a,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{useDefaults as s}from"../../internal/defaults.js";import{useRender as i}from"@base-ui/react/use-render";import{cx as r,focusRingInsetClasses as n,hasContent as o,iconSizeClasses as c,metaTextClasses as d,radiusClasses as m,sheetLineClasses as u,sheetRestClasses as p,srOnlyClasses as f,surfaceSlots as g,transitionClasses as h}from"../../internal/styles.js";const x=/* @__PURE__ */l.createContext({value:null,change:()=>{},size:"md",density:"default",labels:"all",disabled:!1}),v={static:"",sticky:"sticky bottom-0 z-20",fixed:"fixed inset-x-0 bottom-0 z-30"},b={xs:"min-h-10",sm:"min-h-12",md:"min-h-14",lg:"min-h-16",xl:"min-h-18"},y={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"}},N={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,color:n,density:o,elevation:c=0,value:d,defaultValue:f=null,onValueChange:N,position:z="fixed",labels:w="all",divider:k=!0,safeArea:j=!0,disabled:C=!1,label:P,render:B,className:I,style:R,children:V,...A},D){const F=s(),M=t??F.size??"md",S=n??F.color??"primary",q=o??F.density??"default",[E,G]=l.useState(f),H=void 0!==d,J=H?d:E,K=l.useCallback(e=>{H||G(e),N?.(e)},[H,N]),L=l.useMemo(()=>({value:J??null,change:K,size:M,density:q,labels:w,disabled:C}),[J,K,M,q,w,C]),O=r("w-full min-w-0","static"===z?m[M]:"",p[a],"glass"===a&&"static"!==z?"border-0":"",k?u:"",v[z],j?"pb-[env(safe-area-inset-bottom)]":"",h,I);return i({render:B??e("nav",{}),ref:D,props:{"aria-label":P,className:O,style:{...g(S,c),...R},children:e(x.Provider,{value:L,children:e("div",{className:r("flex w-full items-stretch",b[M],y[q][M]),children:V})}),...A}})});export const PlBottomNavigationItem=/* @__PURE__ */l.forwardRef(function PlBottomNavigationItem({value:s,icon:i,href:u,disabled:p=!1,className:g,children:v,onClick:b,...y},z){const w=l.useContext(x),k=p||w.disabled,j=null!==w.value&&w.value===s,C="all"===w.labels||"selected"===w.labels&&j,P=r("flex min-w-0 flex-1 flex-col items-center justify-center px-1 py-1.5",N[w.size],m[w.size],"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",h,n,k?"cursor-not-allowed opacity-50 saturate-[0.35] text-(--plass-muted-fg)":j?"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)",g),B=t(a,{children:[o(i)?e("span",{className:r("flex shrink-0 items-center justify-center",c[w.size]),children:i}):null,o(v)?e("span",{className:C?r("max-w-full truncate leading-tight",d[w.size]):f,children:v}):null]}),press=e=>{k?e.preventDefault():(w.change(s),b?.(e))};return u?e("a",{ref:z,href:k?void 0:u,"aria-current":j?"page":void 0,"aria-disabled":k||void 0,className:P,onClick:press,...y,children:B}):e("button",{ref:z,type:"button",disabled:k,"aria-current":j?"page":void 0,className:P,onClick:press,...y,children:B})});
|