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,83 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassAlignItems, PlassJustify, PlassOrientation, PlassResponsive } from '../../types.js';
|
|
4
|
+
export interface PlFlexProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
/**
|
|
6
|
+
* Which way the children run. `horizontal` is a row, `vertical` is a column.
|
|
7
|
+
*
|
|
8
|
+
* Responsive: `direction={{ xs: 'vertical', md: 'horizontal' }}` stacks on a
|
|
9
|
+
* phone and lines up on a laptop, which is most of what this component is
|
|
10
|
+
* for.
|
|
11
|
+
* @default 'horizontal'
|
|
12
|
+
*/
|
|
13
|
+
direction?: PlassResponsive<PlassOrientation>;
|
|
14
|
+
/**
|
|
15
|
+
* Runs the children the other way along that axis — the last one first.
|
|
16
|
+
*
|
|
17
|
+
* It reverses the **painting order and nothing else**: the DOM order is what
|
|
18
|
+
* a screen reader reads and what the Tab key walks, and neither of them
|
|
19
|
+
* changes here. Use it for a visual arrangement, never to reorder content.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
reverse?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The gap between children, on Tailwind's spacing scale — `spacing={4}` is
|
|
25
|
+
* `1rem`, the same length `gap-4` is. Fractions are allowed, so `1.5` is
|
|
26
|
+
* `0.375rem`.
|
|
27
|
+
* @default 2
|
|
28
|
+
*/
|
|
29
|
+
spacing?: PlassResponsive<number>;
|
|
30
|
+
/** The gap between rows only. Falls back to `spacing`. */
|
|
31
|
+
rowSpacing?: PlassResponsive<number>;
|
|
32
|
+
/** The gap between columns only. Falls back to `spacing`. */
|
|
33
|
+
columnSpacing?: PlassResponsive<number>;
|
|
34
|
+
/** How the box distributes the space its children did not use, along the axis. */
|
|
35
|
+
justify?: PlassJustify;
|
|
36
|
+
/** How the children sit against each other across the axis. @default 'stretch' */
|
|
37
|
+
alignItems?: PlassAlignItems;
|
|
38
|
+
/** Where the lines sit when the box is longer across than its content. */
|
|
39
|
+
alignContent?: PlassJustify;
|
|
40
|
+
/**
|
|
41
|
+
* Whether children that run out of room continue on the next line.
|
|
42
|
+
*
|
|
43
|
+
* `false` by default, which is what a flex box already does — a row that
|
|
44
|
+
* wraps is a decision rather than the absence of one, and the opposite
|
|
45
|
+
* default would silently reflow a toolbar somebody sized to fit.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
wrap?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Lays the box out **inline**, so it sits in a line of text and is only as
|
|
51
|
+
* wide as its children.
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
inline?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Renders something other than a `<div>`: `render={<ul />}`,
|
|
57
|
+
* `render={<nav />}`. Base UI's own escape hatch.
|
|
58
|
+
*/
|
|
59
|
+
render?: useRender.RenderProp;
|
|
60
|
+
/** What is laid out. */
|
|
61
|
+
children?: React.ReactNode;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A row or a column, and the gap between the things in it.
|
|
65
|
+
*
|
|
66
|
+
* This is the layout box with no arithmetic in it — the one to reach for when
|
|
67
|
+
* the answer is "these, side by side, with a gap". A [PlGrid](./grid) divides a
|
|
68
|
+
* row into columns and needs a `PlGridItem` to take them; here the children
|
|
69
|
+
* are whatever they are and the box only decides which way they run.
|
|
70
|
+
*
|
|
71
|
+
* **`direction` is responsive and resolves in CSS**, which is the whole reason
|
|
72
|
+
* it is worth a component rather than three Tailwind classes. `{ xs:
|
|
73
|
+
* 'vertical', md: 'horizontal' }` is a form that stacks on a phone and lines up
|
|
74
|
+
* on a laptop, decided by the stylesheet — so a server renders it correctly at
|
|
75
|
+
* every width, and dragging a window costs no re-render. It is also the only
|
|
76
|
+
* way to say that in a project that imports `plass-ui/styles.css` and has no
|
|
77
|
+
* Tailwind of its own.
|
|
78
|
+
*
|
|
79
|
+
* It draws **nothing**: no surface, no padding, no `variant`, `color`, `size`
|
|
80
|
+
* or `density`. A flex box is the arrangement of the surfaces inside it, and
|
|
81
|
+
* `spacing` — the space *between* children — is the only measurement it owns.
|
|
82
|
+
*/
|
|
83
|
+
export declare const PlFlex: React.ForwardRefExoticComponent<PlFlexProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{alignContentClasses as n,alignItemsClasses as i,justifyClasses as a,spacingValue as l}from"../../internal/grid.js";import{responsiveSlots as t,withBaseline as o}from"../../internal/responsive.js";import{cx as s}from"../../internal/styles.js";export const PlFlex=/* @__PURE__ */e.forwardRef(function PlFlex({direction:e,reverse:p=!1,spacing:c,rowSpacing:f,columnSpacing:m,justify:g,alignItems:u,alignContent:x,wrap:d=!1,inline:y=!1,render:w,className:j,style:v,children:h,...F},N){const P=s("plass-flex",y?"inline-flex":"flex",d?"flex-wrap":"flex-nowrap","gap-x-(--p-gap-x) gap-y-(--p-gap-y)",g?a[g]:"",u?i[u]:"",x?n[x]:"",j);return r({render:w,ref:N,props:{className:P,style:{...t("dir",o(e,"horizontal"),e=>function directionValue(e,r){const n="vertical"===e?"column":"row";return r?`${n}-reverse`:n}(e,p)),...t("gap-x",o(m??c,2),l),...t("gap-y",o(f??c,2),l),...v},children:h,...F}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlFlex}from"./PlFlex.js";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type PlButtonProps } from '../button/PlButton.js';
|
|
3
|
+
import type { PlassCorner, PlassElevation, PlassSize, PlassVariant } from '../../types.js';
|
|
4
|
+
export interface PlFloatingActionButtonProps extends Omit<PlButtonProps, 'children' | 'startIcon' | 'endIcon'> {
|
|
5
|
+
/** The glyph. Sized in `em` against the button, exactly as a `startIcon` is. */
|
|
6
|
+
icon: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* What the button does, in words.
|
|
9
|
+
*
|
|
10
|
+
* Required, and the one prop here that is. It is the accessible name whether
|
|
11
|
+
* or not the words are drawn — a floating button is a disc with a mark in it
|
|
12
|
+
* nine times out of ten, and an unnamed one is the most common accessibility
|
|
13
|
+
* defect this pattern ships with.
|
|
14
|
+
*/
|
|
15
|
+
label: string;
|
|
16
|
+
/**
|
|
17
|
+
* Draws the label beside the glyph.
|
|
18
|
+
*
|
|
19
|
+
* Worth turning on for the action a first-time reader would not guess from a
|
|
20
|
+
* glyph, and worth turning off again once they would.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
extended?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Which corner of the window it sits in.
|
|
26
|
+
* @default 'bottom-end'
|
|
27
|
+
*/
|
|
28
|
+
corner?: PlassCorner;
|
|
29
|
+
/**
|
|
30
|
+
* How far it stands off the two edges it is against. A number is pixels.
|
|
31
|
+
* @default '1.5rem'
|
|
32
|
+
*/
|
|
33
|
+
offset?: number | string;
|
|
34
|
+
/**
|
|
35
|
+
* Whether it pins itself to the window at all.
|
|
36
|
+
*
|
|
37
|
+
* On by default, because that is what this component is. Turn it off to put
|
|
38
|
+
* the same button somewhere of your own — the end of a card, a toolbar — and
|
|
39
|
+
* keep the shape and the shadow.
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
floating?: boolean;
|
|
43
|
+
/** @default 'solid' */
|
|
44
|
+
variant?: PlassVariant;
|
|
45
|
+
/**
|
|
46
|
+
* One step up the ladder from a `PlButton`'s default.
|
|
47
|
+
* @default 'lg'
|
|
48
|
+
*/
|
|
49
|
+
size?: PlassSize;
|
|
50
|
+
/**
|
|
51
|
+
* How far off the page. `3` — the top of the ladder — and unlike every other
|
|
52
|
+
* default in the library it is not a compromise: this is the one control that
|
|
53
|
+
* genuinely floats over the content rather than resting on it.
|
|
54
|
+
* @default 3
|
|
55
|
+
*/
|
|
56
|
+
elevation?: PlassElevation;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The one action a screen is about, floating over it.
|
|
60
|
+
*
|
|
61
|
+
* It is a [PlButton](./button) in a corner, and everything that makes it one is
|
|
62
|
+
* the button's: the three materials, the elevation ladder, the pointer light,
|
|
63
|
+
* `loading`, `readOnly` and `disabled`. What this adds is the **pinning**, the
|
|
64
|
+
* shape, and one rule.
|
|
65
|
+
*
|
|
66
|
+
* **`label` is required and is always the accessible name.** A floating button
|
|
67
|
+
* is a disc with a mark in it nine times out of ten, and `extended` decides
|
|
68
|
+
* only whether the words are also drawn — never whether they exist. An icon
|
|
69
|
+
* with no name is the defect this pattern ships with everywhere else.
|
|
70
|
+
*
|
|
71
|
+
* The icon-only form is a **disc**, which is [PlIconButton](./icon-button)'s
|
|
72
|
+
* deliberate exception to the radius rule: the flat run along a control's edge
|
|
73
|
+
* is there for a line of text to sit on, and a glyph has no line of text. The
|
|
74
|
+
* extended form is **not** a pill for exactly that reason — it has words along
|
|
75
|
+
* its edge, so it takes the house fillet like every other labelled control.
|
|
76
|
+
*
|
|
77
|
+
* **One per screen.** Two floating buttons in one corner is two primary
|
|
78
|
+
* actions, which is none; and a screen whose main action is already a button in
|
|
79
|
+
* the content does not want a second copy of it in the corner.
|
|
80
|
+
*/
|
|
81
|
+
export declare const PlFloatingActionButton: React.ForwardRefExoticComponent<PlFloatingActionButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import*as o from"react";import{PlButton as n}from"../button/PlButton.js";import{PlIconButton as e}from"../icon-button/PlIconButton.js";import{useDefaults as r}from"../../internal/defaults.js";import{cx as i,toLength as s}from"../../internal/styles.js";const a={"top-start":["Start","Start"],"top-end":["Start","End"],"bottom-start":["End","Start"],"bottom-end":["End","End"]};export const PlFloatingActionButton=/* @__PURE__ */o.forwardRef(function PlFloatingActionButton({icon:o,label:l,extended:c=!1,corner:m="bottom-end",offset:f,floating:d=!0,variant:u="solid",size:p,elevation:b=3,className:j,style:x,...B},g){const v=r(),z=p??v.size??"lg",[E,P]=a[m],S=s(f)??"1.5rem",y=d?{position:"fixed",[`insetBlock${E}`]:S,[`insetInline${P}`]:S}:{},I={ref:g,variant:u,size:z,elevation:b,className:i(d?"z-30":"",j),style:{...y,...x},...B};return c?t(n,{...I,startIcon:o,children:l}):t(e,{...I,icon:o,label:l})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlFloatingActionButton}from"./PlFloatingActionButton.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import*as s from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import*as s from"react";import{useDefaults as r}from"../../internal/defaults.js";import{useRender as i}from"@base-ui/react/use-render";import{controlHeightClasses as l,controlSlots as o,controlSquareClasses as n,cx as d,focusRingClasses as c,glassClasses as p,hasContent as u,iconSizeClasses as f,srOnlyClasses as m,transitionClasses as g}from"../../internal/styles.js";const v=/* @__PURE__ */s.createContext({value:null,change:()=>{},size:"md",disabled:!1}),b={xs:"pb-2",sm:"pb-3",md:"pb-4",lg:"pb-5",xl:"pb-6"},h={xs:"pb-[calc(env(safe-area-inset-bottom)+0.5rem)]",sm:"pb-[calc(env(safe-area-inset-bottom)+0.75rem)]",md:"pb-[calc(env(safe-area-inset-bottom)+1rem)]",lg:"pb-[calc(env(safe-area-inset-bottom)+1.25rem)]",xl:"pb-[calc(env(safe-area-inset-bottom)+1.5rem)]"},x={default:{xs:"p-1",sm:"p-1",md:"p-1.5",lg:"p-2",xl:"p-2.5"},compact:{xs:"p-0.5",sm:"p-0.5",md:"p-1",lg:"p-1",xl:"p-1.5"}},y={default:{xs:"gap-1",sm:"gap-1",md:"gap-1.5",lg:"gap-2",xl:"gap-2.5"},compact:{xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"}},w={static:"",sticky:"sticky bottom-0 z-20",fixed:"fixed inset-x-0 bottom-0 z-30"},N={solid:/* @__PURE__ */[p,"bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),glass:/* @__PURE__ */[p,"border bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:""},z=/* @__PURE__ */["pointer-events-none absolute rounded-full","top-(--p-disc-y) left-(--p-disc-x) h-(--p-disc-h) w-(--p-disc-w)","[background-image:var(--p-fill)]","[box-shadow:var(--plass-shadow-1),var(--p-lift)]","data-[quiet]:opacity-50 data-[quiet]:saturate-[0.35]","[transition-property:left,top,width,height,opacity,filter]","[transition-timing-function:var(--plass-ease)]","[transition-duration:0ms] data-[ready]:[transition-duration:var(--plass-duration)]"].join(" ");export const PlFloatingBottomNavigation=/* @__PURE__ */s.forwardRef(function PlFloatingBottomNavigation({variant:a="glass",size:l,color:n,density:c,elevation:p=2,value:u,defaultValue:f=null,onValueChange:m,position:j="fixed",safeArea:k=!0,disabled:P=!1,label:C,render:A,className:R,style:F,children:q,...B},$){const E=r(),I=l??E.size??"md",L=n??E.color??"primary",O=c??E.density??"default",[S,V]=s.useState(f),W=void 0!==u,D=W?u:S,H=s.useRef(null),M=s.useRef(null),T=s.useCallback(e=>{const t=H.current,a=M.current;if(!t||!a)return;const s=t.querySelector("[data-disc][data-current]");if(!s)return;const r=!e||!a.hasAttribute("data-ready");r&&a.removeAttribute("data-ready"),a.style.setProperty("--p-disc-x",`${s.offsetLeft}px`),a.style.setProperty("--p-disc-y",`${s.offsetTop}px`),a.style.setProperty("--p-disc-w",`${s.offsetWidth}px`),a.style.setProperty("--p-disc-h",`${s.offsetHeight}px`),a.toggleAttribute("data-quiet",s.hasAttribute("data-disabled")),r&&a.offsetWidth,a.setAttribute("data-ready","")},[]);s.useLayoutEffect(()=>{T(!0)},[T,D,a,I,O,P,q]),s.useEffect(()=>{const e=H.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>T(!1));return t.observe(e),()=>t.disconnect()},[T]);const G=s.useCallback(e=>{W||V(e),m?.(e)},[W,m]),J=s.useMemo(()=>({value:D??null,change:G,size:I,disabled:P}),[D,G,I,P]),K=d("flex w-full justify-center px-4","static"===j?"":"pointer-events-none",k?h[I]:b[I],w[j],R);return i({render:A??e("nav",{}),ref:$,props:{"aria-label":C,className:K,style:{...o(L,p,"solid"),...F},children:e(v.Provider,{value:J,children:t("div",{ref:H,className:d("pointer-events-auto relative inline-flex items-center rounded-full",N[a],x[O][I],y[O][I],g),children:[null!=D?e("span",{ref:M,"aria-hidden":"true",className:z}):null,q]})}),...B}})});export const PlFloatingBottomNavigationItem=/* @__PURE__ */s.forwardRef(function PlFloatingBottomNavigationItem({value:r,icon:i,href:o,disabled:p=!1,className:b,children:h,onClick:x,...y},w){const N=s.useContext(v),z=p||N.disabled,j=null!==N.value&&N.value===r,k=d("relative z-10 inline-flex shrink-0 items-center justify-center rounded-full",l[N.size],n[N.size],"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",g,c,z?"cursor-not-allowed opacity-50 saturate-[0.35] text-(--plass-muted-fg)":j?"cursor-pointer text-(--p-on-solid)":"cursor-pointer text-(--plass-muted-fg) hover:text-(--plass-fg) hover:bg-(--plass-glass-hover)",b),P=t(a,{children:[u(i)?e("span",{className:d("flex shrink-0 items-center justify-center",f[N.size]),children:i}):null,u(h)?e("span",{className:m,children:h}):null]}),C={"data-disc":"","data-current":j?"":void 0,"data-disabled":z?"":void 0},press=e=>{z?e.preventDefault():(N.change(r),x?.(e))};return o?e("a",{ref:w,href:z?void 0:o,"aria-current":j?"page":void 0,"aria-disabled":z||void 0,...C,className:k,onClick:press,...y,children:P}):e("button",{ref:w,type:"button",disabled:z,"aria-current":j?"page":void 0,...C,className:k,onClick:press,...y,children:P})});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import
|
|
3
|
+
import { type PlassMeasure } from '../../internal/responsive.js';
|
|
4
|
+
import type { PlassColor, PlassDensity, PlassElevation, PlassPosition, PlassResponsive, PlassSize, PlassVariant } from '../../types.js';
|
|
4
5
|
/** How wide the content inside the sheet is allowed to get. */
|
|
5
|
-
export type PlFooterWidth =
|
|
6
|
+
export type PlFooterWidth = PlassMeasure;
|
|
6
7
|
export interface PlFooterProps extends Omit<React.ComponentPropsWithoutRef<'footer'>, 'color' | 'title'> {
|
|
7
8
|
/**
|
|
8
9
|
* How the bar sits in the page's scroll.
|
|
@@ -45,7 +46,7 @@ export interface PlFooterProps extends Omit<React.ComponentPropsWithoutRef<'foot
|
|
|
45
46
|
* spans the window. The same ladder `PlContainer`'s `maxWidth` uses.
|
|
46
47
|
* @default 'none'
|
|
47
48
|
*/
|
|
48
|
-
maxWidth?: PlFooterWidth
|
|
49
|
+
maxWidth?: PlassResponsive<PlFooterWidth>;
|
|
49
50
|
/** The gutter and the air above and below. @default true */
|
|
50
51
|
padded?: boolean;
|
|
51
52
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{useDefaults as t}from"../../internal/defaults.js";import{useRender as o}from"@base-ui/react/use-render";import{PlPageLayoutContext as s}from"../../internal/page-layout.js";import{measureSlots as i}from"../../internal/responsive.js";import{cx as a,sheetPaddingXClasses as l,sheetPaddingYClasses as n,sheetRestClasses as d,surfaceSlots as m,transitionClasses as c}from"../../internal/styles.js";const f=d,p={static:"",sticky:"sticky bottom-0 z-20",fixed:"fixed inset-x-0 bottom-0 z-30"};export const PlFooter=/* @__PURE__ */r.forwardRef(function PlFooter({position:d="static",variant:u="glass",size:y,color:x,density:b,elevation:v=0,divider:j=!0,maxWidth:h,padded:w=!0,label:z,render:N,className:g,style:k,children:C,...F},P){const R=i(h),W=t(),q=y??W.size??"md",A=x??W.color??"primary",B=b??W.density??"default",{register:D}=r.useContext(s),E=r.useCallback(e=>{D("footer",e),"function"==typeof P?P(e):P&&(P.current=e)},[D,P]),G=a("w-full min-w-0",f[u],j?"border-t [border-color:var(--plass-divider)]":"",p[d],c,g);return o({render:N??e("footer",{}),ref:E,props:{"aria-label":z,className:G,style:{...m(A,v),...k},children:e("div",{style:R.style,className:a("w-full",w?a(l[B][q],n[B][q]):"",R.className,void 0===h?"":"mx-auto"),children:C}),...F}})});
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassColor, PlassResponsive, PlassSize } from '../../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* How the tiles are arranged.
|
|
5
|
+
*
|
|
6
|
+
* Four, and they answer four different questions rather than being four looks.
|
|
7
|
+
* `grid` is a contact sheet: every tile the same shape, whatever shape the
|
|
8
|
+
* files are. `masonry` keeps each picture's own proportion and stacks the
|
|
9
|
+
* columns. `justified` keeps the proportions *and* fills every row to the edge,
|
|
10
|
+
* scaling each row to a common height — the arrangement a photograph library
|
|
11
|
+
* uses, and the only one where no tile is cropped and no space is left over.
|
|
12
|
+
* `quilted` is a grid whose tiles may take more than one cell, for a set where
|
|
13
|
+
* some pictures matter more than others.
|
|
14
|
+
*/
|
|
15
|
+
export type PlGalleryLayout = 'grid' | 'masonry' | 'justified' | 'quilted';
|
|
16
|
+
/** What a tile does when the pointer is on it. */
|
|
17
|
+
export type PlGalleryHover = 'none' | 'lift' | 'dim' | 'zoom';
|
|
18
|
+
/** Where a tile's words go. */
|
|
19
|
+
export type PlGalleryCaption = 'none' | 'below' | 'overlay' | 'hover';
|
|
20
|
+
/** One picture in the set. */
|
|
21
|
+
export interface PlGalleryItem {
|
|
22
|
+
/** Where the picture is. */
|
|
23
|
+
src: string;
|
|
24
|
+
/** What the picture says. Required, for the reason `PlImage` requires it. */
|
|
25
|
+
alt: string;
|
|
26
|
+
/** A stable identity. Defaults to `src`. */
|
|
27
|
+
id?: string;
|
|
28
|
+
/** The first line of the caption. */
|
|
29
|
+
title?: React.ReactNode;
|
|
30
|
+
/** The second, one step down the scale and muted. */
|
|
31
|
+
description?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* A larger file for the viewer, when the tile is a thumbnail. Falls back to
|
|
34
|
+
* `src`, so a set that has only one size of each picture needs nothing here.
|
|
35
|
+
*/
|
|
36
|
+
full?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The picture's own proportion, as a number or a CSS ratio.
|
|
39
|
+
*
|
|
40
|
+
* `masonry` and `justified` are laid out from this, and both are laid out
|
|
41
|
+
* *before* anything has loaded — which is the whole reason it is data rather
|
|
42
|
+
* than a measurement. A set without it falls back to the gallery's own
|
|
43
|
+
* `ratio`, and comes out as a grid of squares in a masonry's clothing.
|
|
44
|
+
*/
|
|
45
|
+
ratio?: number | string;
|
|
46
|
+
/** How many columns the tile takes in `quilted`. @default 1 */
|
|
47
|
+
cols?: number;
|
|
48
|
+
/** How many rows the tile takes in `quilted`. @default 1 */
|
|
49
|
+
rows?: number;
|
|
50
|
+
}
|
|
51
|
+
/** The parts of a gallery a `className` does not reach. */
|
|
52
|
+
export interface PlGalleryClassNames {
|
|
53
|
+
/** One tile's `<li>`. */
|
|
54
|
+
item?: string;
|
|
55
|
+
/** The picture inside it. */
|
|
56
|
+
image?: string;
|
|
57
|
+
/** The box the two lines of words sit in. */
|
|
58
|
+
caption?: string;
|
|
59
|
+
/** The first of them. */
|
|
60
|
+
title?: string;
|
|
61
|
+
/** The second. */
|
|
62
|
+
description?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface PlGalleryProps extends Omit<React.ComponentPropsWithoutRef<'ul'>, 'children' | 'onSelect'> {
|
|
65
|
+
/** The pictures, in the order they are drawn. */
|
|
66
|
+
items: readonly PlGalleryItem[];
|
|
67
|
+
/** How the tiles are arranged. @default 'grid' */
|
|
68
|
+
layout?: PlGalleryLayout;
|
|
69
|
+
/**
|
|
70
|
+
* How many tiles across, per breakpoint. Read by `grid`, `masonry` and
|
|
71
|
+
* `quilted`; `justified` decides for itself, row by row.
|
|
72
|
+
* @default { xs: 2, sm: 3, lg: 4 }
|
|
73
|
+
*/
|
|
74
|
+
columns?: PlassResponsive<number>;
|
|
75
|
+
/**
|
|
76
|
+
* The space between tiles — a step of the size ladder, a number in pixels, or
|
|
77
|
+
* a CSS length.
|
|
78
|
+
* @default 'md'
|
|
79
|
+
*/
|
|
80
|
+
gap?: PlassSize | number | string;
|
|
81
|
+
/**
|
|
82
|
+
* The shape of a tile in `grid`, and what an item with no `ratio` of its own
|
|
83
|
+
* falls back to everywhere else.
|
|
84
|
+
* @default 1
|
|
85
|
+
*/
|
|
86
|
+
ratio?: number | string;
|
|
87
|
+
/**
|
|
88
|
+
* How tall a row aims to be in `justified`, and how tall one cell is in
|
|
89
|
+
* `quilted`. Rows come out near it rather than on it, because the last thing
|
|
90
|
+
* a justified row does is scale to the width it actually has.
|
|
91
|
+
* @default 220
|
|
92
|
+
*/
|
|
93
|
+
rowHeight?: number;
|
|
94
|
+
/** Rounds the tiles. @default true */
|
|
95
|
+
rounded?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Where a tile's `title` and `description` go. `below` puts them under the
|
|
98
|
+
* picture, `overlay` writes them across the foot of it, and `hover` is
|
|
99
|
+
* `overlay` that arrives with the pointer.
|
|
100
|
+
* @default 'none'
|
|
101
|
+
*/
|
|
102
|
+
caption?: PlGalleryCaption;
|
|
103
|
+
/**
|
|
104
|
+
* What a tile does under the pointer.
|
|
105
|
+
*
|
|
106
|
+
* `lift` and `dim` are depth and colour, which is how everything else in the
|
|
107
|
+
* library answers a pointer. `zoom` is the one that scales, and it is the
|
|
108
|
+
* exception the design language names: what moves is a photograph inside a
|
|
109
|
+
* frame that stays exactly where it was, with no text on it to resample.
|
|
110
|
+
* @default 'lift'
|
|
111
|
+
*/
|
|
112
|
+
hover?: PlGalleryHover;
|
|
113
|
+
/**
|
|
114
|
+
* Opens the picture full size when a tile is chosen, with the rest of the set
|
|
115
|
+
* an arrow key away.
|
|
116
|
+
*
|
|
117
|
+
* The viewer is fetched on demand, so a gallery that does not offer one does
|
|
118
|
+
* not carry it.
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
preview?: boolean;
|
|
122
|
+
/** Called when a tile is chosen, whether or not there is a viewer. */
|
|
123
|
+
onItemSelect?: (item: PlGalleryItem, index: number) => void;
|
|
124
|
+
/** The list's accessible name. @default 'Gallery' */
|
|
125
|
+
label?: string;
|
|
126
|
+
/**
|
|
127
|
+
* How a tile and the viewer's counter say where in the set they are.
|
|
128
|
+
* @default (index, total) => `${index} of ${total}`
|
|
129
|
+
*/
|
|
130
|
+
itemLabel?: (index: number, total: number) => string;
|
|
131
|
+
/** What is drawn when `items` is empty. Nothing at all by default. */
|
|
132
|
+
empty?: React.ReactNode;
|
|
133
|
+
/** @default 'md' */
|
|
134
|
+
size?: PlassSize;
|
|
135
|
+
/** @default 'primary' */
|
|
136
|
+
color?: PlassColor;
|
|
137
|
+
/** Class names for the parts behind the root. */
|
|
138
|
+
classNames?: PlGalleryClassNames;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* A set of pictures, arranged.
|
|
142
|
+
*
|
|
143
|
+
* The four layouts are the component: everything else — the captions, the
|
|
144
|
+
* pointer treatment, the viewer — is the same in all of them, and choosing
|
|
145
|
+
* between a contact sheet, a masonry, a justified library and a quilt is one
|
|
146
|
+
* prop rather than four components.
|
|
147
|
+
*
|
|
148
|
+
* **None of them measures anything.** A tile's shape comes from the item's own
|
|
149
|
+
* `ratio`, which means the whole arrangement is right in the first frame the
|
|
150
|
+
* browser paints and does not move again as the files arrive — the same bargain
|
|
151
|
+
* `PlImage`'s `ratio` makes one level up, and the reason a gallery of forty
|
|
152
|
+
* photographs does not reflow forty times.
|
|
153
|
+
*/
|
|
154
|
+
export declare const PlGallery: React.ForwardRefExoticComponent<PlGalleryProps & React.RefAttributes<HTMLUListElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import*as a from"react";import{useDefaults as s}from"../../internal/defaults.js";import{useLabels as i}from"../../internal/labels.js";import{dealColumns as r,ratioOf as o}from"../../internal/gallery.js";import{responsiveSlots as n,withBaseline as m}from"../../internal/responsive.js";import{usePlBreakpointValue as p}from"../../hooks/usePlBreakpoint.js";import{cx as c,focusRingClasses as d,hasContent as u,metaTextClasses as f,radiusClasses as g,surfaceSlots as h,toLength as x,transitionClasses as v}from"../../internal/styles.js";import{PlImage as y}from"../image/PlImage.js";const b=/* @__PURE__ */a.lazy(()=>import("./PlGalleryViewer.js").then(e=>({default:e.PlGalleryViewer}))),w={xs:2,sm:3,lg:4},_={xs:"0.25rem",sm:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"1rem"},j={none:"",lift:"group-hover/tile:[box-shadow:var(--plass-shadow-2)] group-focus-visible/tile:[box-shadow:var(--plass-shadow-2)]",dim:"",zoom:""},N={none:"",lift:"",dim:"group-hover/tile:[&_img]:[filter:brightness(0.82)] group-focus-visible/tile:[&_img]:[filter:brightness(0.82)]",zoom:"group-hover/tile:[&_img]:scale-106 group-focus-visible/tile:[&_img]:scale-106"};export const PlGallery=/* @__PURE__ */a.forwardRef(function PlGallery({items:z,layout:k="grid",columns:M,gap:$="md",ratio:q=1,rowHeight:P=220,rounded:G=!0,caption:S="none",hover:C="lift",preview:I=!1,onItemSelect:R,label:A,itemLabel:B,empty:F,size:L,color:V,className:H,classNames:W,style:D,...E},J){const K=s(),O=L??K.size??"md",Q=V??K.color??"primary",T=i(),U=A??T.gallery,X=B??((e,l)=>`${e} of ${l}`),[Y,Z]=a.useState(null),ee=m(M??w,2),le=Math.max(1,p(ee)??2),te="string"==typeof $&&$ in _?_[$]:x($)??_.md,ae=G?g[O]:"",se=o(q,1),tile=(a,s,i)=>{const r=u(a.title)||u(a.description),o="none"!==S&&r,n="overlay"===S||"hover"===S,m=e(y,{src:a.src,alt:a.alt,ratio:"grid"===k?q:"quilted"===k?"auto":a.ratio??q,fit:"cover",rounded:!1,size:O,color:Q,className:c("size-full",W?.image)}),p=o?l("div",{className:c("min-w-0",n?c("pointer-events-none absolute inset-x-0 bottom-0 flex flex-col gap-0.5 p-2.5 text-white","[background:linear-gradient(to_top,color-mix(in_oklab,#000_72%,transparent),transparent)]","hover"===S?c("opacity-0 group-hover/tile:opacity-100 group-focus-visible/tile:opacity-100","[transition:opacity_var(--plass-duration)_var(--plass-ease)]"):""):"flex flex-col gap-0.5 pt-1.5",W?.caption),children:[u(a.title)?e("span",{className:c("truncate font-medium",f[O],n?"":"text-(--plass-fg)",W?.title),children:a.title}):null,u(a.description)?e("span",{className:c("truncate",f[O],n?"text-white/80":"text-(--plass-muted-fg)",W?.description),children:a.description}):null]}):null,g=l("span",{className:c("relative block overflow-hidden",ae,"quilted"===k||"justified"===k?"size-full":"","[transition:box-shadow_var(--plass-duration)_var(--plass-ease)]",j[C],N[C],"[&_img]:[transition:opacity_var(--plass-duration)_var(--plass-ease),filter_var(--plass-duration)_var(--plass-ease),scale_var(--plass-duration)_var(--plass-ease)]"),children:[m,n?p:null]}),h=n||!o?g:l(t,{children:[g,p]});return e("li",{className:c("group/tile relative m-0 min-w-0 list-none","justified"===k?"flex flex-col":"",W?.item),style:i,children:I||R?e("button",{type:"button","aria-label":`${a.alt} — ${X(s+1,z.length)}`,className:c("block w-full bg-transparent p-0 text-start",I?"cursor-zoom-in":"cursor-pointer",d,v,ae,"justified"===k?"flex-1":""),onClick:()=>(e=>{R?.(z[e],e),I&&Z(e)})(s),children:h}):h},a.id??a.src)};let ie;if("masonry"===k){const l=z.map(e=>o(e.ratio,se));ie=r(l,le).map((l,t)=>e("li",{className:"m-0 flex min-w-0 flex-1 list-none flex-col",style:{gap:te},children:e("ul",{className:"m-0 flex list-none flex-col p-0",style:{gap:te},children:l.map(e=>tile(z[e],e,{}))})},t))}else ie="justified"===k?z.map((e,l)=>{const t=o(e.ratio,se);return tile(e,l,{flexGrow:t,flexBasis:t*P+"px",maxWidth:"100%"})}):z.map((e,l)=>tile(e,l,"quilted"===k?{gridColumn:`span ${Math.max(1,Math.round(e.cols??1))}`,gridRow:`span ${Math.max(1,Math.round(e.rows??1))}`}:{}));return 0===z.length&&u(F)?e(t,{children:F}):l(t,{children:[e("ul",{ref:J,role:"list","aria-label":U,className:c("plass-gallery m-0 list-none p-0","justified"===k?"flex flex-wrap":"","masonry"===k?"flex items-start":"","grid"===k?"plass-gallery-grid grid":"","quilted"===k?"plass-gallery-quilted grid":"",H),style:{gap:te,...h(Q,0),...n("cols",ee,e=>String(Math.max(1,Math.round(e)))),..."quilted"===k?{gridAutoRows:`${P}px`,gridAutoFlow:"dense"}:null,...D},...E,children:ie}),I?e(a.Suspense,{fallback:null,children:e(b,{items:z,index:Y,onIndexChange:Z,size:O,color:Q,label:U,itemLabel:X})}):null]})});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlGalleryItem } from './PlGallery.js';
|
|
3
|
+
import type { PlassColor, PlassSize } from '../../types.js';
|
|
4
|
+
export interface PlGalleryViewerProps {
|
|
5
|
+
items: readonly PlGalleryItem[];
|
|
6
|
+
/** Which picture is open, or `null` for none. */
|
|
7
|
+
index: number | null;
|
|
8
|
+
onIndexChange: (index: number | null) => void;
|
|
9
|
+
size: PlassSize;
|
|
10
|
+
color: PlassColor;
|
|
11
|
+
/** The overlay's own name — the gallery's. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Resolved by the gallery, so the viewer resolves nothing a second time. */
|
|
14
|
+
itemLabel: (index: number, total: number) => string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* One picture from a `PlGallery`, full size, with the rest of the set an arrow
|
|
18
|
+
* key away.
|
|
19
|
+
*
|
|
20
|
+
* A file of its own rather than a branch inside `PlGallery`, and that is the
|
|
21
|
+
* whole point of it: this is the only thing in the component that needs an
|
|
22
|
+
* overlay, and an overlay is more than the gallery that opens it. Reached
|
|
23
|
+
* through `React.lazy`, a wall of thumbnails costs nothing for a viewer nobody
|
|
24
|
+
* opened.
|
|
25
|
+
*
|
|
26
|
+
* It is not a `PlCarousel`. A carousel is a set somebody is being shown in
|
|
27
|
+
* order; this is one picture with a way to the next — so there is no autoplay,
|
|
28
|
+
* no wrap, and the arrows stop at the ends rather than looping back to a
|
|
29
|
+
* photograph the reader has already seen.
|
|
30
|
+
*/
|
|
31
|
+
export declare function PlGalleryViewer({ items, index, onIndexChange, size, color, label, itemLabel }: PlGalleryViewerProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useLabels as t}from"../../internal/labels.js";import{ChevronIcon as n}from"../../internal/icons.js";import{cx as s,metaTextClasses as i}from"../../internal/styles.js";import{PlIconButton as a}from"../icon-button/PlIconButton.js";import{PlOverlay as r}from"../overlay/PlOverlay.js";export function PlGalleryViewer({items:o,index:c,onIndexChange:m,size:u,color:d,label:p,itemLabel:f}){const x=t(),v=null!==c,h=null===c?void 0:o[c],g=null===c||c<=0,b=null===c||c>=o.length-1,go=e=>{e>=0&&e<o.length&&m(e)};return e(r,{open:v,onOpenChange:e=>{e||m(null)},tone:"glass",dismissible:!0,size:u,color:d,label:p,onKeyDown:e=>{null===c||e.metaKey||e.ctrlKey||e.altKey||("ArrowRight"===e.key?(e.preventDefault(),go(c+1)):"ArrowLeft"===e.key&&(e.preventDefault(),go(c-1)))},children:l("div",{className:"flex max-w-[90vw] flex-col gap-3",children:[l("div",{className:"relative flex items-center justify-center",children:[h?e("img",{src:h.full??h.src,alt:h.alt,className:"max-h-[80vh] max-w-[90vw] object-contain"},h.id??h.src):null,o.length>1?l("div",{className:"pointer-events-none absolute inset-x-0 flex items-center justify-between px-1",children:[e(a,{variant:"solid",elevation:1,size:u,color:d,label:x.previous,disabled:g,className:"pointer-events-auto",icon:e("span",{className:"flex items-center rotate-90 rtl:-rotate-90",children:e(n,{})}),onClick:()=>go((c??0)-1)}),e(a,{variant:"solid",elevation:1,size:u,color:d,label:x.next,disabled:b,className:"pointer-events-auto",icon:e("span",{className:"flex items-center -rotate-90 rtl:rotate-90",children:e(n,{})}),onClick:()=>go((c??0)+1)})]}):null]}),h&&(h.title||h.description)?l("div",{className:"flex min-w-0 flex-col gap-0.5 text-center",children:[h.title?e("span",{className:"truncate font-medium text-(--plass-fg)",children:h.title}):null,h.description?e("span",{className:s("truncate text-(--plass-muted-fg)",i[u]),children:h.description}):null]}):null,o.length>1?e("p",{className:s("m-0 text-center text-(--plass-muted-fg)",i[u]),"aria-live":"polite",children:f((c??0)+1,o.length)}):null]})})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlGallery}from"./PlGallery.js";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ChartBaseProps } from '../../internal/chart-frame.js';
|
|
3
|
+
import type { PlassColor, PlassThreshold } from '../../types.js';
|
|
4
|
+
export interface PlGaugeChartProps extends Omit<ChartBaseProps, 'legend' | 'tooltip'> {
|
|
5
|
+
/**
|
|
6
|
+
* The reading. `null` draws the dial with nothing on it, which is the honest
|
|
7
|
+
* picture of an instrument that has not been told anything.
|
|
8
|
+
*/
|
|
9
|
+
value: number | null;
|
|
10
|
+
/** The bottom of the scale. @default 0 */
|
|
11
|
+
min?: number;
|
|
12
|
+
/** And the top of it. @default 100 */
|
|
13
|
+
max?: number;
|
|
14
|
+
/**
|
|
15
|
+
* How far round the dial goes, in degrees, opened symmetrically about twelve
|
|
16
|
+
* o'clock. `180` is the half-dial a dashboard tile wants; `270` is the
|
|
17
|
+
* instrument shape; `360` is a ring.
|
|
18
|
+
* @default 180
|
|
19
|
+
*/
|
|
20
|
+
sweep?: number;
|
|
21
|
+
/** How thick the arc is, as a fraction of its radius. @default 0.22 */
|
|
22
|
+
thickness?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Where the arc changes colour — the same `{ from, color }` bands a
|
|
25
|
+
* [`PlMeter`](../feedback/meter) takes, read the same way: the highest band
|
|
26
|
+
* at or below the value wins, and below all of them `color` stands.
|
|
27
|
+
*/
|
|
28
|
+
thresholds?: readonly PlassThreshold[];
|
|
29
|
+
/**
|
|
30
|
+
* How many marks are drawn around the dial, ends included. `false` — the
|
|
31
|
+
* default — draws none: a gauge on a dashboard is read as a proportion, and
|
|
32
|
+
* ticks are for an instrument somebody takes a *number* off.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
ticks?: number | false;
|
|
36
|
+
/** Writes `min` and `max` at the two ends of the arc. @default true */
|
|
37
|
+
showRange?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* What goes in the middle. Left out, it is the value written through
|
|
40
|
+
* `format` — which is what the dial is for, so replacing it is for adding to
|
|
41
|
+
* it rather than for taking it away.
|
|
42
|
+
*/
|
|
43
|
+
center?: React.ReactNode;
|
|
44
|
+
/** A line under the value: the unit, or what is being measured. */
|
|
45
|
+
caption?: React.ReactNode;
|
|
46
|
+
/** The family the arc takes where no threshold applies. @default 'primary' */
|
|
47
|
+
color?: PlassColor;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* One number on a scale that is known in advance, drawn as a dial.
|
|
51
|
+
*
|
|
52
|
+
* It is a [`PlMeter`](../feedback/meter) bent into an arc, and the two are
|
|
53
|
+
* deliberately the same idea in two shapes: `value`, `min`, `max` and
|
|
54
|
+
* `thresholds` mean exactly what they mean there, so a page can move a reading
|
|
55
|
+
* from a bar to a dial without changing what it says. Reach for the bar in a
|
|
56
|
+
* row of fields and for this one in a tile of its own, where a dial reads at a
|
|
57
|
+
* glance from across a room and a four-pixel bar does not.
|
|
58
|
+
*
|
|
59
|
+
* It is not a [`PlPieChart`](./pie-chart) with `shape="semi"`. A pie is *parts
|
|
60
|
+
* of a whole* and every slice is a category; this is one value against a scale,
|
|
61
|
+
* and the unfilled part of the arc is not a second category — it is the rest of
|
|
62
|
+
* the dial.
|
|
63
|
+
*/
|
|
64
|
+
export declare function PlGaugeChart({ value, min, max, sweep, thickness, thresholds, ticks, showRange, center, caption, height, format, locale: localeProp, label, empty, size: sizeProp, variant, color: colorProp, padded, className, ...box }: PlGaugeChartProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t,jsxs as a,Fragment as e}from"react/jsx-runtime";import*as s from"react";import{ChartSurface as l,useMeasuredWidth as r}from"../../internal/chart-frame.js";import{arcPath as n,chartFontSizes as i,compactNumber as o,plotHeights as h,ringPath as m,textWidth as c,truncate as d}from"../../internal/chart.js";import{useDefaults as f}from"../../internal/defaults.js";import{numberFormatter as p}from"../../internal/format.js";import{useLabels as u}from"../../internal/labels.js";import{cx as x,hasContent as M,metaTextClasses as g}from"../../internal/styles.js";import{bandColor as v}from"../../internal/threshold.js";function pointAt(t,a,e,s){const l=(s-90)*Math.PI/180;return[t+e*Math.cos(l),a+e*Math.sin(l)]}export function PlGaugeChart({value:y,min:b=0,max:k=100,sweep:j=180,thickness:N=.22,thresholds:$,ticks:w=!1,showRange:A=!0,center:z,caption:P,height:S,format:W,locale:q,label:C,empty:D,size:I,variant:L="ghost",color:R,padded:B=!1,className:F,...G}){const T=f(),Y=I??T.size??"md",E=R??T.color??"primary",H=q??T.locale,J=s.useRef(null),K=r(J),O=u(),Q=s.useCallback(t=>W?p(H,W).format(t):o(t,H),[W,H]),U=Math.max(1,Math.min(360,j)),V=U/2,X=-V,Z=V,_=k-b,tt=null===y||Number.isNaN(y)||0===_?null:Math.min(1,Math.max(0,(y-b)/_)),at=null===y?E:v(y,E,$),et="number"==typeof S?S:h[Y],st=i[Y],lt=Math.min(.9,Math.max(.05,N)),rt=V*Math.PI/180,nt=U>=360?1:Math.max(0,-Math.cos(rt)),it=U>=180?1:Math.sin(rt),ot=Math.sin(rt),ht=-Math.cos(rt),mt=A&&U<330?[b,k].map(t=>d(Q(t),Math.max(0,.28*K),st)):[],ct=mt.reduce((t,a)=>Math.max(t,c(a,st)),0),dt=.35*st,ft=!1===w?0:.85*st,pt=ht<=.25,ut=pt?0:.5*st,xt=pt?st:st*(.35+.55*ht),Mt=mt.length>0?ht*ut+xt+.25*st:0,gt=Math.max(dt,ft),vt=Math.max(dt,ft),yt=Math.max(dt,ft,Mt),bt=[(K/2-gt)/Math.max(.05,it),(et-vt-yt)/(1+nt)];if(ct>0&&ot>.05){const t=pt?ct/2:ct;bt.push(Math.max(0,K/2-dt-t)/ot-ut)}const kt=Math.max(0,Math.min(...bt)),jt=kt*(1-lt),Nt=K/2,$t=vt+kt*(1+nt)+yt,wt=vt+kt+Math.max(0,(et-$t)/2),At=kt<=0||0===_,zt=M(P)?1.85*st:0,Pt=wt-jt*(1-Math.min(1,nt))/2,St=Math.min(jt,Math.abs(wt-Pt)),Wt=Math.min(jt,Math.abs(wt-Pt-zt/2)),qt=2*Math.sqrt(Math.max(0,jt*jt-Wt*Wt)),Ct=z??(null===y?"—":Q(y)),Dt="string"==typeof Ct?c(Ct,1):0,It=Dt>0?Math.max(st,Math.min(2*st,function fitType(t,a,e,s,l){const r=t*t/(4*l*l)+s*s,n=2*a*s,i=a*a-e*e;return r<=0||i>=0?0:(Math.sqrt(n*n-4*r*i)-n)/(2*r)}(Dt,St,jt,.42,.86))):2*st,Lt=!1===w?0:Math.max(2,Math.floor(w));return t(l,{...G,variant:L,color:E,size:Y,padded:B,legendSide:"bottom",className:F,legend:null,table:null,children:t("div",{ref:J,className:"relative w-full",style:{height:et},role:void 0===C?void 0:"img","aria-label":void 0===C?void 0:null===y?C:`${C}: ${Q(y)} / ${Q(k)}`,children:At?t("div",{className:x("flex h-full items-center justify-center text-(--plass-muted-fg)",g[Y]),children:D??O.empty}):K>0?a(e,{children:[a("svg",{width:K,height:et,viewBox:`0 0 ${K} ${et}`,"aria-hidden":"true",className:"block",children:[t("path",{d:n(Nt,wt,kt,jt,X,Z),fill:`var(--plass-${E}-soft)`}),null!==tt?t("path",{d:m(Nt,wt,(kt+jt)/2,X,Z),fill:"none",stroke:`var(--plass-${at}-fill)`,strokeWidth:kt-jt,pathLength:"1",strokeDasharray:"1",strokeDashoffset:1-tt,style:{transition:"stroke-dashoffset var(--plass-duration-slow) var(--plass-ease), stroke var(--plass-duration) var(--plass-ease)"}}):null,Lt>0?Array.from({length:Lt},(a,e)=>{const s=X+U*e/(Lt-1),[l,r]=pointAt(Nt,wt,kt+.25*st,s),[n,i]=pointAt(Nt,wt,kt+.6*st,s);return t("line",{x1:l,y1:r,x2:n,y2:i,stroke:"var(--plass-chart-grid)",strokeWidth:1,strokeLinecap:"round"},e)}):null,mt.length>0?[[mt[0],X,"start"],[mt[1],Z,"end"]].map(([a,e,s])=>{const[l,r]=pointAt(Nt,wt,kt+ut,e);return t("text",{x:l,y:r+xt,textAnchor:pt?"middle":"start"===s?"end":"start",fontSize:st,fill:"var(--plass-muted-fg)",children:a},s)}):null]}),a("div",{className:"pointer-events-none absolute inset-x-0 mx-auto flex flex-col items-center gap-0.5 text-center",style:{top:Pt+zt/2,maxWidth:qt,transform:"translateY(-50%)"},children:[t("span",{className:"font-semibold text-(--plass-fg) tabular-nums",style:{fontSize:It},children:Ct}),P?t("span",{className:x("text-(--plass-muted-fg)",g[Y]),children:P}):null]})]}):null})})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlGaugeChart}from"./PlGaugeChart.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as r from"react";import{useRender as e}from"@base-ui/react/use-render";import{alignContentClasses as
|
|
1
|
+
"use client";import*as r from"react";import{useRender as e}from"@base-ui/react/use-render";import{alignContentClasses as n,alignItemsClasses as a,columnCount as s,justifyClasses as i,spacingValue as p}from"../../internal/grid.js";import{responsiveSlots as o,withBaseline as t}from"../../internal/responsive.js";import{cx as l}from"../../internal/styles.js";export const PlGrid=/* @__PURE__ */r.forwardRef(function PlGrid({columns:r,spacing:c,rowSpacing:m,columnSpacing:f,justify:g,alignItems:d,alignContent:u,wrap:x=!0,render:y,className:w,style:j,children:h,...G},N){const P=l("plass-grid flex",x?"flex-wrap":"flex-nowrap","gap-x-(--p-gap-x) gap-y-(--p-gap-y)",g?i[g]:"",d?a[d]:"",u?n[u]:"",w);return e({render:y,ref:N,props:{className:P,style:{...o("cols",t(r,12),s),...o("gap-x",t(f??c,2),p),...o("gap-y",t(m??c,2),p),...j},children:h,...G}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as
|
|
1
|
+
"use client";import*as r from"react";import{useRender as e}from"@base-ui/react/use-render";import{alignSelfClasses as s,offsetValue as t,spanValue as n}from"../../internal/grid.js";import{responsiveSlots as i}from"../../internal/responsive.js";import{cx as o}from"../../internal/styles.js";export const PlGridItem=/* @__PURE__ */r.forwardRef(function PlGridItem({span:r,offset:a,alignSelf:l,render:m,className:f,style:p,children:c,...d},u){const g=o("plass-grid-item",l?s[l]:"",f);return e({render:m,ref:u,props:{className:g,style:{...i("span",r,n),...i("offset",a,t),...p},children:c,...d}})});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import
|
|
3
|
+
import { type PlassMeasure } from '../../internal/responsive.js';
|
|
4
|
+
import type { PlassAlign, PlassColor, PlassDensity, PlassElevation, PlassPosition, PlassResponsive, PlassSize, PlassVariant } from '../../types.js';
|
|
4
5
|
/** How wide the row inside the bar is allowed to get. */
|
|
5
|
-
export type PlHeaderWidth =
|
|
6
|
+
export type PlHeaderWidth = PlassMeasure;
|
|
6
7
|
export interface PlHeaderProps extends Omit<React.ComponentPropsWithoutRef<'header'>, 'color' | 'title'> {
|
|
7
8
|
/**
|
|
8
9
|
* The leading slot: the logo, the product's name, the thing that is the same
|
|
@@ -79,7 +80,7 @@ export interface PlHeaderProps extends Omit<React.ComponentPropsWithoutRef<'head
|
|
|
79
80
|
* a header and the container under it line up on the same edge.
|
|
80
81
|
* @default 'none'
|
|
81
82
|
*/
|
|
82
|
-
maxWidth?: PlHeaderWidth
|
|
83
|
+
maxWidth?: PlassResponsive<PlHeaderWidth>;
|
|
83
84
|
/** The gutter down each side of the row. @default true */
|
|
84
85
|
padded?: boolean;
|
|
85
86
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as r from"react";import{useDefaults as i}from"../../internal/defaults.js";import{useRender as t}from"@base-ui/react/use-render";import{PlPageLayoutContext as n}from"../../internal/page-layout.js";import{measureSlots as a}from"../../internal/responsive.js";import{cx as l,hasContent as m,sheetPaddingXClasses as d,sheetRestClasses as c,sheetSectionGapClasses as o,surfaceSlots as f,transitionClasses as p}from"../../internal/styles.js";const u={xs:"min-h-10",sm:"min-h-12",md:"min-h-16",lg:"min-h-20",xl:"min-h-24"},x={xs:"py-2",sm:"py-2",md:"py-3",lg:"py-4",xl:"py-5"},y={xs:"gap-3",sm:"gap-4",md:"gap-6",lg:"gap-7",xl:"gap-8"},h=c,v={static:"",sticky:"sticky top-0 z-20",fixed:"fixed inset-x-0 top-0 z-30"},g={start:"shrink-0",center:"flex-1 basis-0",end:"shrink-0"},j={start:"flex min-w-0 flex-1 items-center justify-start",center:"flex min-w-0 shrink items-center justify-center",end:"flex min-w-0 flex-1 items-center justify-end"};export const PlHeader=/* @__PURE__ */r.forwardRef(function PlHeader({brand:c,actions:b,align:w="start",position:N="sticky",variant:k="glass",size:z,color:C,density:H,elevation:P=0,divider:R=!0,maxWidth:W,padded:q=!0,label:A,render:B,className:D,style:E,children:F,...G},I){const J=a(W),K=i(),L=z??K.size??"md",M=C??K.color??"primary",O=H??K.density??"default",{register:Q}=r.useContext(n),S=r.useCallback(e=>{Q("header",e),"function"==typeof I?I(e):I&&(I.current=e)},[Q,I]),T=l("w-full min-w-0",h[k],R?"border-b [border-color:var(--plass-divider)]":"",v[N],p,D);return t({render:B??e("header",{}),ref:S,props:{"aria-label":A,className:T,style:{...f(M,P),...E},children:s("div",{style:J.style,className:l("flex w-full items-center",u[L],x[L],y[L],q?d[O][L]:"",J.className,void 0===W?"":"mx-auto"),children:[m(c)?e("div",{className:l("flex min-w-0 items-center",g[w],o[L]),children:c}):"center"===w?e("div",{"aria-hidden":"true",className:g[w]}):null,m(F)?e("div",{className:l(j[w],o[L]),children:F}):null,m(b)?e("div",{className:l("flex min-w-0 items-center justify-end",g[w],o[L]),children:b}):"center"===w?e("div",{"aria-hidden":"true",className:g[w]}):null]}),...G}})});
|